blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dea5ef2ef0af85cd92e692c318718e96f64a3b62 | 415e15d1a21709498e96647e51e357903d7676a5 | /dazuoye1/app/src/main/java/com/example/group/bean/GoodsInfo1.java | 492b2b64f5e3fd2c8a5e26b1e5542c1cce38cf7e | [] | no_license | 111zhangyue/- | a608b8d5332a2b913d8c61440724d72662bcb8cb | a4542392dc040987ab20260201b750d711041c5c | refs/heads/master | 2023-02-03T04:13:39.248813 | 2020-12-18T16:09:08 | 2020-12-18T16:09:08 | 304,999,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,977 | java | package com.example.group.bean;
import com.example.group.R;
import java.util.ArrayList;
public class GoodsInfo1 {
public long rowid; // 行号
public int sn; // 序号
public String name; // 名称
public String desc; // 描述
public float price; // 价格
public String thumb_path; // 小图的保存路径
public String pic_path; // 大图的保存路径
public int thumb; // 小图的资源编号
public int pic; // 大图的资源编号
public GoodsInfo1() {
rowid = 0L;
sn = 0;
name = "";
desc = "";
price = 0;
thumb_path = "";
pic_path = "";
thumb = 0;
pic = 0;
}
// 声明一个手机商品的名称数组
private static String[] mNameArray = {
"解忧杂货铺", "谁杀了他", "我杀了他", "白夜行", "落幕时祈祷", "大雪中的村庄","浡论13","恶意"
};
// 声明一个手机商品的描述数组
private static String[] mDescArray = {
"解忧杂货店+嫌疑X的献身+恶意+时生 东野圭吾全套共4册外国恐怖悬疑【新华正版",
"【正版包邮】谁杀了她 侦探推理悬疑小说 正版图书籍东野圭吾作品:加贺探案集3 ",
"谁杀了她+我杀了他 日本悬疑推理小说大师东野圭吾作品 排行榜书籍",
"东野圭吾四大杰作【4册】白夜行",
"祈祷落幕时 东野圭吾作品 感人至深的亲情力作 荣获2014年吉川英治文学奖 畅销",
"大雪中的山庄 东野圭吾作品 新华书店正版畅销图书籍 ",
"悖论13 东野圭吾 末世悬疑经典小说:13个幸存者困守废墟之城",
"恶意 东野圭吾著"
};
// 声明一个手机商品的价格数组
private static float[] mPriceArray = {27, 27, 28, 29, 30, 33,70,95};
// 声明一个手机商品的小图数组
private static int[] mThumbArray = {
R.drawable.ddd, R.drawable.dddd, R.drawable.ddddd,
R.drawable.dddddd, R.drawable.dddddddd, R.drawable.zzz,R.drawable.zzzz
,R.drawable.qqq
};
// 声明一个手机商品的大图数组
private static int[] mPicArray = {
R.drawable.ddd, R.drawable.dddd, R.drawable.ddddd,
R.drawable.dddddd, R.drawable.dddddddd, R.drawable.zzz,R.drawable.zzzz
,R.drawable.qqq
};
// 获取默认的手机信息列表
public static ArrayList<GoodsInfo1> getDefaultList() {
ArrayList<GoodsInfo1> goodsList = new ArrayList<GoodsInfo1>();
for (int i = 0; i < mNameArray.length; i++) {
GoodsInfo1 info = new GoodsInfo1();
info.name = mNameArray[i];
info.desc = mDescArray[i];
info.price = mPriceArray[i];
info.thumb = mThumbArray[i];
info.pic = mPicArray[i];
goodsList.add(info);
}
return goodsList;
}
}
| [
"18745400402@163.com"
] | 18745400402@163.com |
47bcd8700f727dc45c0c94e4ae94ab87c7188f83 | 84f8617d674d3f72ec6adac15ab6a047b0c735a8 | /website/basic/src/main/java/com/javaliao/basic/constant/DataConstant.java | 2963cdc183f32c5b2e81c8d3d7e0e324e3b70f35 | [] | no_license | javaliao/mall | 342ff75255e6dfa7dd0bcb96d47456870f0a6dbf | 2e681371c0155b8cc75e689395fec819e2c67b48 | refs/heads/master | 2022-11-18T13:27:18.225907 | 2020-01-17T15:15:11 | 2020-01-17T15:15:11 | 225,290,203 | 2 | 3 | null | 2022-11-16T04:57:37 | 2019-12-02T05:09:04 | Java | UTF-8 | Java | false | false | 284 | java | package com.javaliao.basic.constant;
public class DataConstant {
public static final String NO_DATA = "没有获取到数据";
public static final String MODIFY_DATA_FALSE = "修改数据失败";
public static final String MODIFY_DATA_SUCCESS = "修改数据成功";
}
| [
"lzw.liao.sh@baijiantest.com"
] | lzw.liao.sh@baijiantest.com |
eae6616b78515cec435a84b7a25211685178f341 | 993169554c3db6a73fddb8f57ce4b703ca597594 | /app/src/main/java/com/example/ws3/ProfileFragment.java | c9e0ca1d42a37d8dae745d1a22bd90876f2d4165 | [] | no_license | dhiya07/prak3-1918126-dhiya | 666252e0351c248952c713db4d84b8e1b5cedf39 | 73c9c179015fca976b65c3fc98f625298e56413b | refs/heads/main | 2023-08-22T05:11:59.885718 | 2021-10-12T04:54:25 | 2021-10-12T04:54:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | package com.example.ws3;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
public class ProfileFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_profile,container, false);
}
}
| [
"dhiyauddinabdurrohman007@gmail.com"
] | dhiyauddinabdurrohman007@gmail.com |
f3914fd77a1ec562c00f13783ca4464801fce8fb | a35b56fb45c9f812f3e6446a891a14825529a69d | /app/src/main/java/kotireddy/fragmentbackstack/ResultListFragment.java | 2cee729edce3234c27d2b072099474a793a78c28 | [] | no_license | yuvakoti/FragmentBackStack1 | cece2023eeccc29bf5818f8816235f6af000d0f7 | 5b68186461ee851adeb19a8670a1725e0be70da6 | refs/heads/master | 2021-01-20T17:47:18.825243 | 2017-05-10T17:02:03 | 2017-05-10T17:02:03 | 90,888,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java |
package kotireddy.fragmentbackstack;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class ResultListFragment extends Fragment {
View view;
ListView listView;
private ListAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.result_fragment, null);
initViews();
return view;
}
private void initViews() {
listView = (ListView) view.findViewById(R.id.listView1);
adapter = listView.getAdapter();
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view,
int position, long id) {
Toast.makeText(getActivity(),
adapter.getItem(position).toString(), Toast.LENGTH_LONG)
.show();
}
});
}
}
| [
"yuvakotireddy@Yuvakotis-MacBook-Pro.local"
] | yuvakotireddy@Yuvakotis-MacBook-Pro.local |
1c40b32d3a8b5dcf2b316febde8259e96135a955 | 518902b17c091871dfc8db688ecbbdadabbf1333 | /oib-responder/src/main/java/org/openinfobutton/responder/dao/impl/ResponderAssetPropertyDaoImpl.java | b7f757068e9f27cbcc0cd0cafaade40e2e80f7fd | [
"Apache-2.0"
] | permissive | rgiordano66/InfoButtons | 7ca2587e753e49818aa8aca33b42203a846da7d0 | 723047e557a2df7217cada6a37a9aacdeb2bae05 | refs/heads/2.3-SNAPSHOT | 2020-03-31T13:43:41.735893 | 2018-10-12T19:20:04 | 2018-10-12T19:20:04 | 152,267,215 | 0 | 1 | null | 2018-10-12T17:15:36 | 2018-10-09T14:36:13 | Java | UTF-8 | Java | false | false | 869 | java | package org.openinfobutton.responder.dao.impl;
import org.hibernate.criterion.Restrictions;
import org.openinfobutton.app.dao.DaoBase;
import org.openinfobutton.app.model.AssetProperty;
import org.openinfobutton.responder.dao.ResponderAssetPropertyDao;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
@Repository
public class ResponderAssetPropertyDaoImpl extends DaoBase<AssetProperty> implements ResponderAssetPropertyDao {
@Transactional
public List<AssetProperty> findByAssetId(BigDecimal assetId)
{
List<AssetProperty> assetProperties = getSessionFactory().getCurrentSession()
.createCriteria(AssetProperty.class).add(Restrictions.eq("asset.id", assetId)).list();
return assetProperties;
}
}
| [
"andrew.iskander@utah.edu"
] | andrew.iskander@utah.edu |
a9d77b35061e7fa591967244e12958fdd2edfa1c | 7e665366c0d488dfec91d9c19606b5c46da9b717 | /app/src/androidTest/java/bg/tu_sofia/pmu/project/testsystem/ApplicationTest.java | c6e8454b6de88fc4c649c79a124b1d3138b255c0 | [] | no_license | Crypto93/TestSystemPMU | 903fc708fb6847ff0e3ad59d5b5a2712c421aa3b | 4508e9f6dca26c2c0078546fce96c0ac6239ece6 | refs/heads/master | 2020-12-25T10:34:42.574407 | 2016-06-15T13:15:07 | 2016-06-15T13:15:07 | 60,813,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package bg.tu_sofia.pmu.project.testsystem;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"s.chuklev@gmail.com"
] | s.chuklev@gmail.com |
16de4a803e96a2844a6e0fdbc216d424b4632c41 | e5ff9241db9558ea38183c0fd61d07431af03f52 | /src/br/com/empresa/projeto/teste/util/TestaInterator.java | e62d5ca4730f12b970a2c338c5ad58581ef2240e | [] | no_license | alissonarm/projeto-java-util-listas | 18c6416e0dd0882352b80b4517be1756ff090c86 | 1410ce509cfad704533f6cd9dbe1c30e2e0c6aef | refs/heads/master | 2023-04-08T13:37:19.675118 | 2021-04-23T23:48:47 | 2021-04-23T23:48:47 | 361,030,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | package br.com.empresa.projeto.teste.util;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class TestaInterator {
public static void main(String[] args) {
// List<String> nomes = new ArrayList<>();
// nomes.add("Super Mario");
// nomes.add("Yoshi");
// nomes.add("Donkey Kong");
//
// Iterator<String> it = nomes.iterator();
//
// while(it.hasNext()) {
// System.out.println(it.next());
// }
Set<String> nomes = new HashSet<>();
nomes.add("Super Mario");
nomes.add("Yoshi");
nomes.add("Donkey Kong");
Iterator<String> it = nomes.iterator();
while(it.hasNext()) {
System.out.println(it.next());
}
}
}
| [
"alissonarm@bb.com.br"
] | alissonarm@bb.com.br |
75678b962d3339edb89bb0e2f402795d391b2717 | d031d397b7cd338a92535cd350ad2e236305ce3a | /src/main/java/com/board/mapper/ReplyMapper.java | e945e04d572b70abeadeb1b86e7bae04d4d6b1f4 | [] | no_license | yjs037/Board-Web | 39cdf899c1b053f5a60fb1ca0726b131af72f7c1 | e4318984443e8902cbb69078af90d0ca3e6af572 | refs/heads/main | 2023-08-27T15:36:55.645075 | 2021-10-20T16:40:41 | 2021-10-20T16:40:41 | 411,775,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 477 | java | package com.board.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.board.domain.Criteria;
import com.board.domain.ReplyVO;
public interface ReplyMapper {
public int replyInsert(ReplyVO vo);
public ReplyVO read(Long rno);
public int delete (Long rno);
public int update(ReplyVO reply);
public List<ReplyVO> getListWithPaging(@Param("cri") Criteria cri, @Param("bno") Long bno);
public int getCountByRno(Long rno);
}
| [
"dolph037@gmail.com"
] | dolph037@gmail.com |
2d3f4f826ed63c0261776b9ae7f241d6746b52c8 | 0dc1b2cb47c57b48f84b2c5f6c6699a073e48573 | /app/src/main/java/pl/kassad/teamplatform/services/exeption/UserNotFoundException.java | 3dafd35c11c1806b0333672a1817b4b30b543327 | [] | no_license | kamil-b/team-platform | 2d773ac5a1ca27ab336a0aa5236b577f65ea9ce3 | a035e9c29b73970d0fc56960d9006e5ef55c60bd | refs/heads/master | 2023-01-08T10:17:42.064635 | 2019-06-20T17:22:40 | 2019-06-20T17:22:40 | 177,316,729 | 0 | 0 | null | 2023-01-05T00:02:27 | 2019-03-23T17:04:34 | Java | UTF-8 | Java | false | false | 202 | java | package pl.kassad.teamplatform.services.exeption;
public class UserNotFoundException extends RuntimeException{
public UserNotFoundException(String message){
super(message);
}
}
| [
"kamil.bednarczyk@connectis.pl"
] | kamil.bednarczyk@connectis.pl |
fcf8adfd6c1d0ac4ba078665e9d7df24e59ddbdd | cca1b619a917d9fd19c51fb1e1d5fd69c7b5e70b | /Inline-plugin/src/main/java/com/tellh/inline/plugin/InlineAccessTransform.java | cc42d2f5a938957bee8122e3086923eb85198afa | [
"Apache-2.0"
] | permissive | TellH/AccessInline | d59698fb4e52a852565a793c73b3dc1e9e0360c6 | 054e552bee487eabe6ed7ce9f60806f391e4de55 | refs/heads/master | 2020-03-28T12:52:28.575109 | 2018-09-15T10:01:07 | 2018-09-15T10:01:07 | 148,342,520 | 20 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,300 | java | package com.tellh.inline.plugin;
import com.android.build.api.transform.QualifiedContent;
import com.android.build.api.transform.Transform;
import com.android.build.api.transform.TransformException;
import com.android.build.api.transform.TransformInvocation;
import com.android.build.gradle.internal.pipeline.TransformManager;
import com.tellh.inline.plugin.fetcher.AndroidJarProcessor;
import com.tellh.inline.plugin.fetcher.CollectClassInfoProcessor;
import com.tellh.inline.plugin.fetcher.Context;
import com.tellh.inline.plugin.fetcher.ShrinkAccessProcessor;
import com.tellh.inline.plugin.log.Log;
import com.tellh.inline.plugin.log.Timer;
import com.tellh.transformer.TransformContext;
import com.tellh.transformer.Transformer;
import com.tellh.transformer.fetcher.ClassFetcher;
import java.io.IOException;
import java.util.Set;
/**
* Created by tlh on 2018/8/29.
*/
public class InlineAccessTransform extends Transform {
private GlobalContext globalContext;
public InlineAccessTransform(GlobalContext context) {
this.globalContext = context;
}
@Override
public String getName() {
return InlineAccessTransform.class.getSimpleName();
}
@Override
public Set<QualifiedContent.ContentType> getInputTypes() {
return TransformManager.CONTENT_CLASS;
}
@Override
public Set<? super QualifiedContent.Scope> getScopes() {
return TransformManager.SCOPE_FULL_PROJECT;
}
@Override
public boolean isIncremental() {
return false;
}
@Override
public void transform(TransformInvocation transformInvocation) throws TransformException, InterruptedException, IOException {
super.transform(transformInvocation);
globalContext.init();
Timer timer = new Timer();
Transformer transformer = new Transformer(new TransformContext(transformInvocation));
Context context = new Context();
timer.startRecord("PRE_PROCESS");
if (globalContext.enable()) {
timer.startRecord("PROJECT_CLASS");
transformer.traverseOnly(ClassFetcher.newInstance(new CollectClassInfoProcessor(context)));
timer.stopRecord("PROJECT_CLASS", "Process project all .class files cost time = [%s ms]");
}
if (globalContext.enable()) {
timer.startRecord("ANDROID");
AndroidJarProcessor androidJarProcessor = new AndroidJarProcessor(context);
transformer.traverseAndroidJar(globalContext.androidJar(), ClassFetcher.newInstance(androidJarProcessor));
Log.i(String.format("Collect android class count = [%s]", androidJarProcessor.getCount()));
timer.stopRecord("ANDROID", "Process android jar cost time = [%s ms]");
}
timer.stopRecord("PRE_PROCESS", "Collect info cost time = [%s ms]");
Log.i("access$ method count : " + context.methodCount());
if (globalContext.enable()) {
timer.startRecord("PROCESS");
transformer.resolve(ClassFetcher.newInstance(new ShrinkAccessProcessor(context)));
timer.stopRecord("PROCESS", "Shrink access$ cost time = [%s ms]");
} else {
transformer.skip();
}
timer.record("Inline access$ transform total cost time = [%s ms]");
}
}
| [
"tanlehua@bytedance.com"
] | tanlehua@bytedance.com |
c2b6755015ffa2496c1b067d77f96fc983912cfd | 4ccdec0665d645f53293b4972debcb1ed13f74b5 | /content/modules/backoffice-ui/examples/ex1/src/main/java/ui/ex1/screen/screens/mixins/DeclarativeLoaderParametersState.java | 3a22dc60a6ea524a4753156472178bc3de665fd3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC-BY-4.0"
] | permissive | SevDan/jmix-docs | bf14770fd7e0ff0b2e0983029059a4861675f503 | 309f1a4e7cf838e16098a141eec9ae067f358621 | refs/heads/main | 2023-08-04T10:29:37.541094 | 2021-09-14T15:12:14 | 2021-09-14T15:12:14 | 407,216,666 | 0 | 0 | NOASSERTION | 2021-09-16T15:25:14 | 2021-09-16T15:25:14 | null | UTF-8 | Java | false | false | 497 | java | package ui.ex1.screen.screens.mixins;
import io.jmix.ui.model.DataLoader;
import java.util.Set;
// tag::state[]
public class DeclarativeLoaderParametersState {
private Set<DataLoader> loadersToLoadBeforeShow;
public DeclarativeLoaderParametersState(Set<DataLoader> loadersToLoadBeforeShow) {
this.loadersToLoadBeforeShow = loadersToLoadBeforeShow;
}
public Set<DataLoader> getLoadersToLoadBeforeShow() {
return loadersToLoadBeforeShow;
}
}
// end::state[]
| [
"zbitskaya@haulmont.com"
] | zbitskaya@haulmont.com |
1994ac29aff6b0ed9a95d431d5ba60b559218522 | 0e783a600feb56093a776686d917aa32be6c7053 | /src/main/java/com/zis/common/excel/CsvImporter.java | 370e6714995c8d77cdb1535ec8876151d2871feb | [] | no_license | lvbin0502/zis | ada666281372249edea81e0686d0352c6a8495cc | 749553cb043be97bf88fb1b9fccf592c08162aa5 | refs/heads/master | 2020-04-05T23:30:25.723694 | 2016-06-19T02:43:28 | 2016-06-19T02:43:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,819 | java | /**
*
*/
package com.zis.common.excel;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* @author lvbin
* 2015-8-14
* @param <T>
*/
public class CsvImporter<T> extends FileImporter<T>{
/**
* @param inputStream
* @param templateName
*/
public CsvImporter(InputStream inputStream, String templateName) {
super(inputStream, templateName);
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#getDate(java.lang.Integer, java.lang.Integer)
*/
@Override
public Object getDate(Integer rowNums, Integer index) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#getDouble(java.lang.Integer, int)
*/
@Override
public Double getDouble(Integer rowNums, int index) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#getInteger(java.lang.Integer, int)
*/
@Override
public Integer getInteger(Integer rowNums, int index) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#getRowNums()
*/
@Override
protected Integer getRowNums() {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#getString(java.lang.Integer, int)
*/
@Override
public String getString(Integer rowNums, int index) {
// TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see com.his.common.excel.AbstractFileImporter#loadFileFormat(java.io.InputStream)
*/
@Override
protected List<String> loadFileFormat(InputStream input) throws IOException {
// TODO Auto-generated method stub
return null;
}
}
| [
"290479238@qq.com"
] | 290479238@qq.com |
459180d5a4f31dfaa304f70ccf697754e49d0dc8 | 7ce89d9e6d8474cbd90bd3638aa33c7302996937 | /src/test/java/hurt_me_plenty_task/page/AbstractPage.java | f2777aeb4e1d1bae88e974141ed4f3dfa8fe37f7 | [] | no_license | balantain/selenium-webdriver | fcf61df0005c95b2b53246ab6ace11e12251932c | 5e898039f78cf0801b79b0e531305b6bc2ae7fb0 | refs/heads/main | 2023-09-03T01:14:16.438488 | 2021-11-03T18:46:23 | 2021-11-03T18:46:23 | 421,782,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package hurt_me_plenty_task.page;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
public abstract class AbstractPage {
protected WebDriver driver;
public AbstractPage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
}
| [
"dyrikov.a@gmail.com"
] | dyrikov.a@gmail.com |
93fab53ca04d4e473cd238b5a0be956d2478b7a5 | a6dc4a320fa6a246898b4436d2d0a1597acc8116 | /8/PrimeNGandRestExpress/AuthenticationService/src/main/java/org/authentication/Constants.java | 90af966f226b53375907f15f918ceaa149f8494d | [] | no_license | AnghelLeonard/Java-EE | da0b18338a3111053f35e8984d25bfd3153e8f52 | 60d505f18a5b84590a2ead9b27a9db1ada9b5660 | refs/heads/master | 2020-12-24T07:42:01.354225 | 2018-11-18T07:37:26 | 2018-11-18T07:37:26 | 43,373,489 | 24 | 48 | null | null | null | null | UTF-8 | Java | false | false | 1,142 | java | package org.authentication;
public class Constants {
/**
* These define the URL parameters used in the route definition strings
* (e.g. '{userId}').
*/
public class Url {
/**
* CLIENT_ID
*/
public static final String CLIENT_ID = "oid";
/**
* API_KEY
*/
public static final String API_KEY = "apiKey";
/**
* SECRET
*/
public static final String SECRET = "secret";
/**
* JWT
*/
public static final String JWT = "jwt";
}
/**
* These define the route names used in naming each route definitions. These
* names are used to retrieve URL patterns within the controllers by name to
* create links in responses.
*/
public class Routes {
/**
* SINGLE_CLIENT
*/
public static final String SINGLE_CLIENT = "client.single.route";
/**
* CLIENT_COLLECTION
*/
public static final String CLIENT_COLLECTION = "client.collection.route";
}
}
| [
"noreply@github.com"
] | noreply@github.com |
70f04b989d14ba753f2432335aa33c0dfbbad8d7 | 68327e9f668dd2dbd7e9894d8e18d1c69a8457bf | /src/main/java/com/ehrsystem/hr/controllers/JobPostController.java | 39bddbdd211f12530dd837d3179bf2b777f68f85 | [] | no_license | MKraev/HRMaster | 5b302adcaa844cc9a46dcba20988982bbf290f7b | cca2969e9f9f2e11b8463f86109d3854003b0fdc | refs/heads/master | 2023-06-23T14:03:44.600687 | 2021-07-23T15:51:25 | 2021-07-23T15:51:25 | 270,254,422 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,325 | java | package com.ehrsystem.hr.controllers;
import com.ehrsystem.hr.model.JobPost;
import com.ehrsystem.hr.model.User;
import com.ehrsystem.hr.repositories.JobPostRepository;
import com.ehrsystem.hr.repositories.UserRepository;
import com.ehrsystem.hr.services.JobPostService;
import com.ehrsystem.hr.services.UserService;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Objects;
@Controller
public class JobPostController {
private final JobPostService jobPostService;
private final UserService userService;
private final UserRepository userRepository;
private final JobPostRepository jobPostRepository;
public JobPostController(JobPostService jobPostService, UserService userService, UserRepository userRepository, JobPostRepository jobPostRepository) {
this.jobPostService = jobPostService;
this.userService = userService;
this.userRepository = userRepository;
this.jobPostRepository = jobPostRepository;
}
@RequestMapping("/jobpost")
public String saveJobPost(Model model){
String username = SecurityContextHolder.getContext().getAuthentication().getName();
User user= userRepository.findByUsername(username);
JobPost jobPost = new JobPost();
jobPost.setPoster(user);
user.getJobPosted().add(jobPost);
jobPostService.save(jobPost);
userService.save(user);
model.addAttribute("jobPost", jobPost);
return "job/jobpostform";
}
@PostMapping("/jobpost")
public String saveOrUpdate(@Valid @ModelAttribute("jobPost") JobPost jobPost, BindingResult bindingResult){
String username = SecurityContextHolder.getContext().getAuthentication().getName();
User user= userRepository.findByUsername(username);
if(bindingResult.hasErrors()){
return "job/jobpostform";
}
jobPost.setPoster(user);
JobPost saveJobPost = jobPostService.save(jobPost);
return "redirect:/";
}
@GetMapping("/job/{id}/show")
public String showById(@PathVariable String id, Model model){
model.addAttribute("jobPost", jobPostService.findById(new Long(id)));
return "job/show";
}
@GetMapping("/job/{id}/delete")
public String deleteById(@PathVariable String id){
String username = SecurityContextHolder.getContext().getAuthentication().getName();
JobPost jobPost = jobPostService.findById(Long.valueOf(id));
if (Objects.equals(username, jobPost.getPoster().getUsername())) {
User user= userRepository.findByUsername(username);
user.getJobPosted().remove(jobPost);
userService.save(user);
jobPostRepository.deleteById(Long.valueOf(id));
return "redirect:/";
}
return "redirect:/";
}
@GetMapping("/job/{id}/update")
public String updateJobPost(@PathVariable String id, Model model){
String username = SecurityContextHolder.getContext().getAuthentication().getName();
JobPost jobPost = jobPostService.findById(Long.valueOf(id));
if (Objects.equals(username, jobPost.getPoster().getUsername())) {
model.addAttribute("jobPost", jobPostService.findCommandById(Long.valueOf(id)));
return "job/jobpostform";
}
return "redirect:/";
}
@GetMapping("/job/{id}/apply")
public String applyJobPost(@PathVariable String id){
String username = SecurityContextHolder.getContext().getAuthentication().getName();
JobPost jobPost = jobPostService.findById(Long.valueOf(id));
User user= userRepository.findByUsername(username);
if (Objects.equals(username, jobPost.getPoster().getUsername())) {
return "job/show";
}
else{
user.getJobApplied().add(jobPost);
jobPost.getUsersApplied().add(user);
JobPost saveJobPost = jobPostService.save(jobPost);
User saveUser = userService.save(user);
return "job/applycompleted";
}
}
}
| [
"kraevmilen@gmail.com"
] | kraevmilen@gmail.com |
5f3adb9c6eb6536b23342dcc1d31c6e4ca8fdbca | 38c5ce43e2cd8532543baddb23d585464e7fd67b | /app/src/androidTest/java/com/firesoul/calculadorar/ExampleInstrumentedTest.java | 04e9bdcc5afdc42d655cf70f273cd832af0348a2 | [] | no_license | CristianFJ/CalculadoraR | 9d599fa144c32d3428b8685d3147fdf9f9ef8c8f | 720513d843916031eb3300d447a2b4f4eb8e2f1a | refs/heads/master | 2021-11-25T00:38:50.607488 | 2021-11-06T15:53:05 | 2021-11-06T15:53:05 | 124,395,315 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.firesoul.calculadorar;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.firesoul.calculadorar", appContext.getPackageName());
}
}
| [
"cstiven.osorio@udea.edu.co"
] | cstiven.osorio@udea.edu.co |
d252f5398b4a44d01f63957ec217a7c900b4bf47 | 8aaa6a94dc26de0c791491430ef9d55e1fa373fc | /app/src/main/java/com/zgld/mall/beans/HishopProductTagId.java | 25768e03b9e9c908548cc6c245d41d293af57f44 | [] | no_license | longliuping/zgldappmall | 89cf90218a2887d6a616a1228617a77d6fae7811 | 28a31577b947083021581c37fa4806fe95f593fe | refs/heads/master | 2021-01-10T08:17:15.838563 | 2016-03-31T02:58:41 | 2016-03-31T02:58:41 | 53,829,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package com.zgld.mall.beans;
/**
* HishopProductTagId entity. @author MyEclipse Persistence Tools
*/
public class HishopProductTagId extends AbstractHishopProductTagId implements
java.io.Serializable {
// Constructors
/** default constructor */
public HishopProductTagId() {
}
/** full constructor */
public HishopProductTagId(Integer tagId, HishopProducts hishopProducts) {
super(tagId, hishopProducts);
}
}
| [
"z819366568"
] | z819366568 |
b355024c498f7b75df87d022d17c7d9960c9d18d | 832a5f3fc5f72224a177cf9da3b6980dbd91522c | /src/test/main/Test19.java | 209583ffa12d98f51f042a34219577b118aaa80d | [] | no_license | json-lu/SSM_template | 203f24213396c814298365e445adc08ae2e2d701 | 77783ac58f8c0b6a294750fb2b7eade1ba6005a1 | refs/heads/master | 2023-02-06T10:02:45.478746 | 2020-12-26T09:54:34 | 2020-12-26T09:54:34 | 317,147,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,842 | java | import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;
/**
* <p>
* Properties属性类 来表示一个持久的属性集 它使用键值结构存储数据,每个键及其对应值都是一个字符串
* (1)是一个集合类,Hashtable的子类
* (2)特有功能
* A:public Object setProperty(String key,String value)
* B:public String getProperty(String key)
* C:public Set stringPropertyNames()
* (3)和IO流结合的方法
* 把键值对形式的文本文件内容加载到集合中
* public void load(Reader reader)
* public void load(InputStream inStream)
* 把集合中的数据存储到文本文件中
* public void store(Writer writer,String comments)
* public void store(OutputStream out,String comments)
* </p>
*
* @Since: Created in 11:24 2020/12/26
* @Author: Ljx
* @Decription:
*/
public class Test19 {
public static void main(String[] args) {
Properties properties = System.getProperties();
System.out.println(properties);
System.out.println(System.getProperty("file.separator"));
System.out.println("你爱"+System.getProperty("line.separator")+"不爱我");
System.out.println("当前系统信息:"+System.getProperty("os.name"));
properties.setProperty("msg","你好");
String msg = System.getProperty("msg");
System.out.println(msg);
Set<String> strings = properties.stringPropertyNames();
for (String string : strings) {
String value = properties.getProperty(string);
System.out.println(string+":"+value);
}
}
}
| [
"2806790537@qq.com"
] | 2806790537@qq.com |
de52882d62834cb4b21cd699e6767baba6051e8e | c0215859602a5140a8e523047798bff56c81d9aa | /src/com/example/threads/ThreadExample4.java | 910c223c603bd0f1287d945443fbd9318eb1e428 | [] | no_license | manojboot/CoreJavaBasics | 7d331afc2f742e01d1088871baaee5d90ea2382b | 72e2f9ba6075779e7d8214a70b74afff6676ae21 | refs/heads/master | 2023-02-10T23:29:40.973612 | 2023-01-29T17:08:49 | 2023-01-29T17:08:49 | 290,983,155 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.example.threads;
public class ThreadExample4 extends Thread{
public static void main(String[] args) {
ThreadExample4 t1 = new ThreadExample4();
ThreadExample4 t2 = new ThreadExample4();
t1.setPriority(MIN_PRIORITY);
t2.setPriority(MAX_PRIORITY);
t1.start();
t2.start();
}
//thread schedular schedules the threads according to their priority (known as preemptive scheduling).
//But it is not guaranteed because it depends on JVM specification that which scheduling it chooses.
public void run() {
System.out.println("Running Thread Name is :" +Thread.currentThread().getName() +" " +Thread1Example1.currentThread().getId());
System.out.println("Running Thread Priority is :" +Thread.currentThread().getPriority());
}
}
| [
"manoj.patelia@gmail.com"
] | manoj.patelia@gmail.com |
fbb61d4d714ea9902cae4203cf9fef2bfd2328ac | c7b426aafff89afb25556f2444c7b53006ffcbc5 | /src/main/java/com/hamzaburakhan/PortController/Controller.java | 7ca22af954fbc399b3b9fd8f50c02d1338467033 | [] | no_license | hamzagoc/PortController | 67bd467fcfe0ad3a0de963fbe169d165b1a08bca | 827a4cd2d30c0090d2225e55b3590a340e661ce8 | refs/heads/master | 2021-12-21T11:32:21.085106 | 2017-09-26T09:12:35 | 2017-09-26T09:12:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,504 | java | package com.hamzaburakhan.PortController;
import com.hamzaburakhan.PortController.entity.PortsAndProcess;
import com.hamzaburakhan.PortController.utils.PortScanner;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.scene.input.MouseButton;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import org.controlsfx.dialog.Dialogs;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException;
public class Controller implements Initializable{
private List<PortsAndProcess> listportandprocess = new ArrayList<>();
public TableView<PortsAndProcess> porttable;
public ObservableList<PortsAndProcess> filteredList;
public BorderPane borderPaneApp;
@Override
public void initialize(URL location, ResourceBundle resources) {
filteredList = FXCollections.observableArrayList(listportandprocess);
porttable.setItems(filteredList);
Platform.runLater(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
startTask();
}
catch (Exception e){
try {
Thread.sleep(150);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
startTask();
}
}
});
}
public void startTask(){
Service<Void> findMyDeviceService = new SearchPorts();
Dialogs.create()
.owner((Stage) borderPaneApp.getScene().getWindow())
.title("Portlar Bulunuyor")
.masthead("Portlar Bulunuyor")
.showWorkerProgress(findMyDeviceService);
findMyDeviceService.start();
}
class SearchPorts extends Service<Void> {
@Override
protected Task<Void> createTask() {
return new Task<Void>() {
@Override
protected Void call() {
try {
updateMessage("Portlar Aranıyor");
String line = null;
Process p = null;
p = Runtime.getRuntime().exec("netstat -a -n -o");
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
int proggresslimit = 0;
while (true) {
line = r.readLine();
if (line == null) {
break;
}
proggresslimit++;
}
updateProgress(0, proggresslimit);
p = Runtime.getRuntime().exec("netstat -a -n -o");
r = new BufferedReader(new InputStreamReader(p.getInputStream()));
listportandprocess = new ArrayList<>();
boolean contentReady = false;
int count = 0;
while (true) {
try {
line = r.readLine();
} catch (IOException e) {
e.printStackTrace();
}
if (line == null) {
break;
}
if(contentReady) {
PortsAndProcess portsAndProcess = new PortsAndProcess();
String splitArray[] = line.split(" ");
int colum = 0;
for (int i = 0; i < splitArray.length; i++) {
String result = splitArray[i].replace(" ", "");
if (!result.equals("")) {
switch (colum) {
case 0:
portsAndProcess.setProtocol(result);
break;
case 1:
portsAndProcess.setLocalAddress(result);
break;
case 2:
portsAndProcess.setForeignAddress(result);
break;
case 3:
portsAndProcess.setState(result);
break;
case 4:
portsAndProcess.setPID(result);
break;
}
colum++;
}
}
listportandprocess.add(portsAndProcess);
filteredList.add(portsAndProcess);
}
if(line.contains("PID")){
contentReady = true;
}
updateMessage("PID adları getiriliyor "+count+"/"+proggresslimit);
updateProgress(count, proggresslimit);
count++;
}
} catch (IOException e) {
e.printStackTrace();
}
porttable.setRowFactory(tv -> {
TableRow<PortsAndProcess> row = new TableRow<>();
row.setOnMouseClicked(event -> {
if (! row.isEmpty() && event.getButton()== MouseButton.PRIMARY
&& event.getClickCount() == 2) {
PortsAndProcess clickedRow = row.getItem();
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Kill To Process");
alert.setHeaderText("Kill To Process");
alert.setContentText("Are you sure to kill the process?");
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK){
try {
Process p = Runtime.getRuntime().exec("taskkill /F /PID "+clickedRow.getPID());
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
while (true) {
String line = r.readLine();
if (line == null) {
break;
}
}
filteredList.clear();
startTask();
} catch (IOException e) {
e.printStackTrace();
}
} else {
// ... user chose CANCEL or closed the dialog
}
}
});
return row ;
});
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
filteredList.forEach(item-> {
try
{
String pid = item.getPID();
Process p = Runtime.getRuntime().exec("cmd /c \n" +
"for /f %a in ( 'tasklist /fi \"PID eq " + pid + "\" ^| findstr \"" + pid + "\"' ) do (echo %a)");
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
int count = 0;
while (true) {
String line = r.readLine();
if (line == null) {
break;
}
if (count == 2) {
item.setProccessName(line);
}
count++;
}
porttable.refresh();
}catch(Exception e)
{
e.printStackTrace();
}
});
}
}).start();
return null;
}
};
}
}
}
| [
"hamzaburakhan@gmail.com"
] | hamzaburakhan@gmail.com |
5c8e70fc758a7c54e9f4842ca31f10735856ab1f | 62f1af1e6275591f536cf5064af314fee828464f | /dubbo/server/src/main/java/com/jiebbs/server/BootMoreApplication.java | 13ccf0c7ce63c080da160acd824ab055b7b10ad0 | [] | no_license | jiebbs/dubbo | a2cc8513c6b1caedb026fad717063b095a4ed9bd | 54ebd58ea29f9974ecfa8a6754abe611ed5c8039 | refs/heads/master | 2020-04-26T23:46:42.959046 | 2019-03-05T09:17:42 | 2019-03-05T09:17:42 | 173,913,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,055 | java | package com.jiebbs.server;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication
@ImportResource(value = {"classpath:spring/spring-jdbc.xml","classpath:spring/spring-dubbo.xml"})
@MapperScan(basePackages = "com.jiebbs.model.pojo")
public class BootMoreApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(BootMoreApplication.class);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(BootMoreApplication.class, args);
}
} | [
"jiebbs@126.com"
] | jiebbs@126.com |
a605b7d25510eabf57feb7d87d7c5dfc26fc6ba9 | 4e25d488d625f6ba458d54e0261f477933bc338e | /src/org/usfirst/frc/team503/robot/Robot.java | 6a2be6c8d8b26f7761f51742cab2fc38fa9b1695 | [] | no_license | Suhas-Kodali/2015Robot | 249942926e08734fa8d3beaa4072fd028af16ec0 | fc723c4951c3e14316bd651d73487cd58c674dbf | refs/heads/master | 2021-05-28T16:32:51.245201 | 2015-02-25T02:22:45 | 2015-02-25T02:22:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,620 | java |
package org.usfirst.frc.team503.robot;
import org.usfirst.frc.team503.robot.commands.DeterminePositionCommand;
import org.usfirst.frc.team503.robot.commands.ElevatorSpeedCommand;
import org.usfirst.frc.team503.robot.commands.SetModeCommand;
import org.usfirst.frc.team503.robot.commands.TeleopDriveCommand;
import org.usfirst.frc.team503.robot.commands.TestCommandGroup;
import org.usfirst.frc.team503.robot.subsystems.CustomRobotDrive;
import org.usfirst.frc.team503.robot.subsystems.Drivetrain;
import org.usfirst.frc.team503.robot.subsystems.ElevatorSubsystem;
import org.usfirst.frc.team503.robot.subsystems.GrabberSubsystem;
import edu.wpi.first.wpilibj.AnalogInput;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot {
public void robotInit() {
OI.init();
}
public void disabledPeriodic() {
Scheduler.getInstance().run();
}
DigitalInput testSensor = new DigitalInput(8);
AnalogInput analogSensor = new AnalogInput(0);
public void autonomousInit() {
(new SetModeCommand(1)).start();
(new DeterminePositionCommand()).start();
//(new Turn90Command(1.8)).start();
//(new DriveStraightCommand(50)).start();
(new TestCommandGroup()).start();
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
Scheduler.getInstance().run();
SmartDashboard.putNumber("ELEVATORSOSOFD Error", ElevatorSubsystem.getError());
SmartDashboard.putNumber("Drivetrain Encoder", Drivetrain.getDistance());
SmartDashboard.putNumber("Elevator Enc", ElevatorSubsystem.getDistance());
SmartDashboard.putNumber("ELEVATORSOFSOFF Output", ElevatorSubsystem.getPIDLastOutput());
}
public void teleopInit() {
(new SetModeCommand(1)).start();
(new DeterminePositionCommand()).start();
(new TeleopDriveCommand()).start();
(new ElevatorSpeedCommand()).start();
}
/**
* This function is called when the disabled button is hit.
* You can use it to reset subsystems before shutting down.
*/
public void disabledInit(){
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
SmartDashboard.putNumber("Drivetrain Encoder", Drivetrain.getDistance());
SmartDashboard.putNumber("Elevator Enc", ElevatorSubsystem.getDistance());
SmartDashboard.putNumber("Encoder Rate", Drivetrain.getRate());
SmartDashboard.putNumber("Y", OI.getJoystickY());
SmartDashboard.putNumber("X", OI.getJoystickX());
SmartDashboard.putBoolean("DIGITAL VALUE", testSensor.get());
SmartDashboard.putNumber("ANALOG VALUE", analogSensor.getVoltage());
Scheduler.getInstance().run();
CustomRobotDrive.getInstance().setGrabberSpeed(OI.getStealerInput());
GrabberSubsystem.getInstance().setLassoSpeed(OI.getLassoInput());
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
LiveWindow.run();
}
}
| [
"suhaskodali@gmail.com"
] | suhaskodali@gmail.com |
5902a2469854f892c5c18c78ae5a62833b748c19 | 9e4601501c71f6690e0f7bd99f157d7076a481b3 | /vendor/fop/src/java/org/apache/fop/area/Page.java | dac4bdef787f5049362dbcf0e7a619d8af32b1f8 | [
"Apache-2.0"
] | permissive | Fallmist42/hq | 5d74ae98d766b16dd047bde7a3433fa22a3643f0 | b67e302b8660318d84583c9138b9b59f56a05787 | refs/heads/master | 2020-12-11T08:06:22.887854 | 2015-10-02T14:22:17 | 2015-10-02T14:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,633 | 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.
*/
/* $Id: Page.java 1311120 2012-04-08 23:48:11Z gadams $ */
package org.apache.fop.area;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.datatypes.SimplePercentBaseContext;
import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.pagination.RegionBody;
import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.traits.WritingModeTraitsGetter;
import static org.apache.fop.fo.Constants.EN_ERROR_IF_OVERFLOW;
import static org.apache.fop.fo.Constants.EN_HIDDEN;
import static org.apache.fop.fo.Constants.FO_REGION_AFTER;
import static org.apache.fop.fo.Constants.FO_REGION_BEFORE;
import static org.apache.fop.fo.Constants.FO_REGION_BODY;
import static org.apache.fop.fo.Constants.FO_REGION_END;
import static org.apache.fop.fo.Constants.FO_REGION_START;
/**
* The page.
* This holds the contents of the page. Each region is added.
* The unresolved references area added so that if the page is
* serialized then it will handle the resolving properly after
* being reloaded.
* This is serializable so it can be saved to cache to save
* memory if there are forward references.
* The page is cloneable so the page master can make copies of
* the top level page and regions.
*/
public class Page extends AreaTreeObject implements Serializable {
private static final long serialVersionUID = 6272157047421543866L;
// contains before, start, body, end and after regions
private RegionViewport regionBefore = null;
private RegionViewport regionStart = null;
private RegionViewport regionBody = null;
private RegionViewport regionEnd = null;
private RegionViewport regionAfter = null;
// temporary map of unresolved objects used when serializing the page
private Map<String, List<Resolvable>> unresolved = null;
/** Set to true to make this page behave as if it were not empty. */
private boolean fakeNonEmpty = false;
/**
* Empty constructor
*/
public Page() { }
/**
* Constructor
* @param spm SimplePageMaster containing the dimensions for this
* page-reference-area
*/
public Page(SimplePageMaster spm) {
// Width and Height of the page view port
FODimension pageViewPortDims = new FODimension(spm.getPageWidth().getValue()
, spm.getPageHeight().getValue());
// Get absolute margin properties (top, left, bottom, right)
CommonMarginBlock mProps = spm.getCommonMarginBlock();
/*
* Create the page reference area rectangle (0,0 is at top left
* of the "page media" and y increases
* when moving towards the bottom of the page.
* The media rectangle itself is (0,0,pageWidth,pageHeight).
*/
/* Special rules apply to resolving margins in the page context.
* Contrary to normal margins in this case top and bottom margin
* are resolved relative to the height. In the property subsystem
* all margin properties are configured to using BLOCK_WIDTH.
* That's why we 'cheat' here and setup a context for the height but
* use the LengthBase.BLOCK_WIDTH.
*/
SimplePercentBaseContext pageWidthContext
= new SimplePercentBaseContext(null, LengthBase.CONTAINING_BLOCK_WIDTH
, pageViewPortDims.ipd);
SimplePercentBaseContext pageHeightContext
= new SimplePercentBaseContext(null, LengthBase.CONTAINING_BLOCK_WIDTH
, pageViewPortDims.bpd);
Rectangle pageRefRect
= new Rectangle(mProps.marginLeft.getValue(pageWidthContext)
, mProps.marginTop.getValue(pageHeightContext)
, pageViewPortDims.ipd
- mProps.marginLeft.getValue(pageWidthContext)
- mProps.marginRight.getValue(pageWidthContext)
, pageViewPortDims.bpd
- mProps.marginTop.getValue(pageHeightContext)
- mProps.marginBottom.getValue(pageHeightContext));
// Set up the CTM on the page reference area based on writing-mode
// and reference-orientation
FODimension reldims = new FODimension(0, 0);
CTM pageCTM = CTM.getCTMandRelDims(spm.getReferenceOrientation(),
spm.getWritingMode(), pageRefRect, reldims);
// Create a RegionViewport/ reference area pair for each page region
RegionReference rr;
for (Region r : spm.getRegions().values()) {
RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
if (r.getNameId() == FO_REGION_BODY) {
rr = new BodyRegion((RegionBody) r, rvp);
} else {
rr = new RegionReference(r, rvp);
}
// set borders and padding traits
// (a little extensions wrt what prescribed by the specs at 6.4.14)
TraitSetter.addBorders(rr, r.getCommonBorderPaddingBackground(),
false, false, false, false, null);
TraitSetter.addPadding(rr, r.getCommonBorderPaddingBackground(),
false, false, false, false, null);
setRegionReferencePosition(rr, r, rvp.getViewArea());
rvp.setRegionReference(rr);
setRegionViewport(r.getNameId(), rvp);
}
}
/**
* Call this method to force this page to pretend not to be empty.
*/
public void fakeNonEmpty() {
this.fakeNonEmpty = true;
}
/**
* Creates a RegionViewport Area object for this pagination Region.
* @param r the region the viewport is to be created for
* @param reldims relative dimensions
* @param pageCTM page coordinate transformation matrix
* @return the new region viewport
*/
private static RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM) {
Rectangle2D relRegionRect = r.getViewportRectangle(reldims);
Rectangle2D absRegionRect = pageCTM.transform(relRegionRect);
// Get the region viewport rectangle in absolute coords by
// transforming it using the page CTM
RegionViewport rv = new RegionViewport(absRegionRect);
rv.setBPD((int)relRegionRect.getHeight());
rv.setIPD((int)relRegionRect.getWidth());
TraitSetter.addBackground(rv, r.getCommonBorderPaddingBackground(), null);
rv.setClip(r.getOverflow() == EN_HIDDEN
|| r.getOverflow() == EN_ERROR_IF_OVERFLOW);
return rv;
}
/**
* Set the region reference position within the region viewport.
* This sets the transform that is used to place the contents of
* the region reference.
*
* @param rr the region reference area
* @param r the region-xxx formatting object
* @param absRegVPRect The region viewport rectangle in "absolute" coordinates
* where x=distance from left, y=distance from bottom, width=right-left
* height=top-bottom
*/
private static void setRegionReferencePosition(RegionReference rr, Region r,
Rectangle2D absRegVPRect) {
FODimension reldims = new FODimension(0, 0);
rr.setCTM(CTM.getCTMandRelDims(r.getReferenceOrientation(),
r.getWritingMode(), absRegVPRect, reldims));
rr.setIPD(reldims.ipd
- rr.getBorderAndPaddingWidthStart()
- rr.getBorderAndPaddingWidthEnd());
rr.setBPD(reldims.bpd
- rr.getBorderAndPaddingWidthBefore()
- rr.getBorderAndPaddingWidthAfter());
}
/**
* Set the region on this page.
*
* @param areaclass the area class of the region to set
* @param port the region viewport to set
*/
public void setRegionViewport(int areaclass, RegionViewport port) {
if (areaclass == FO_REGION_BEFORE) {
regionBefore = port;
} else if (areaclass == FO_REGION_START) {
regionStart = port;
} else if (areaclass == FO_REGION_BODY) {
regionBody = port;
} else if (areaclass == FO_REGION_END) {
regionEnd = port;
} else if (areaclass == FO_REGION_AFTER) {
regionAfter = port;
}
}
/**
* Get the region from this page.
*
* @param areaClass the region area class
* @return the region viewport or null if none
*/
public RegionViewport getRegionViewport(int areaClass) {
switch (areaClass) {
case FO_REGION_BEFORE:
return regionBefore;
case FO_REGION_START:
return regionStart;
case FO_REGION_BODY:
return regionBody;
case FO_REGION_END:
return regionEnd;
case FO_REGION_AFTER:
return regionAfter;
default:
throw new IllegalArgumentException("No such area class with ID = " + areaClass);
}
}
/**
* Indicates whether any FOs have been added to the body region
*
* @return whether any FOs have been added to the body region
*/
public boolean isEmpty() {
if (fakeNonEmpty) {
return false;
} else if (regionBody == null) {
return true;
} else {
BodyRegion body = (BodyRegion)regionBody.getRegionReference();
return body.isEmpty();
}
}
/** {@inheritDoc} */
public Object clone() throws CloneNotSupportedException {
Page p = (Page) super.clone();
if (regionBefore != null) {
p.regionBefore = (RegionViewport)regionBefore.clone();
}
if (regionStart != null) {
p.regionStart = (RegionViewport)regionStart.clone();
}
if (regionBody != null) {
p.regionBody = (RegionViewport)regionBody.clone();
}
if (regionEnd != null) {
p.regionEnd = (RegionViewport)regionEnd.clone();
}
if (regionAfter != null) {
p.regionAfter = (RegionViewport)regionAfter.clone();
}
return p;
}
/**
* Set the unresolved references on this page for serializing.
*
* @param unres the Map of unresolved objects
*/
public void setUnresolvedReferences(Map<String, List<Resolvable>> unres) {
unresolved = unres;
}
/**
* Get the map unresolved references from this page.
* This should be called after deserializing to retrieve
* the map of unresolved references that were serialized.
*
* @return the de-serialized HashMap of unresolved objects
*/
public Map<String, List<Resolvable>> getUnresolvedReferences() {
return unresolved;
}
/**
* Sets the writing mode traits for the region viewports of
* this page.
* @param wmtg a WM traits getter
*/
public void setWritingModeTraits(WritingModeTraitsGetter wmtg) {
if (regionBefore != null) {
regionBefore.setWritingModeTraits(wmtg);
}
if (regionStart != null) {
regionStart.setWritingModeTraits(wmtg);
}
if (regionBody != null) {
regionBody.setWritingModeTraits(wmtg);
}
if (regionEnd != null) {
regionEnd.setWritingModeTraits(wmtg);
}
if (regionAfter != null) {
regionAfter.setWritingModeTraits(wmtg);
}
}
}
| [
"vau2007@rambler.ru"
] | vau2007@rambler.ru |
34fcafb036bebffa12192718dfe964e033346d48 | 887331d77214d16db053882ae0a1129f67de82b4 | /src/Controlador/Crear_dispositivoController.java | a8b33a1096206caa0dee3f336f7a32c2fa24958b | [] | no_license | Christian08-hub/Practica3_Dispositivos | 21dffa784d6a61679d60e701734fcf96bf8b31aa | 47d8d2413cf32d6317fc7b83b3f2391644d8a4e4 | refs/heads/master | 2023-05-06T10:40:45.714656 | 2021-05-30T14:35:55 | 2021-05-30T14:35:55 | 372,310,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,729 | java |
package Controlador;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.MenuButton;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
public class Crear_dispositivoController implements Initializable {
@FXML
private Button btnguardar;
@FXML
private Button btncancelar;
@FXML
private TextField btncorreo;
@FXML
private TextField btnnombre;
@FXML
private CheckBox btnvisible;
@FXML
private CheckBox btnencendido;
@FXML
private MenuButton btndispositivo;
@FXML
private TextField btnnumero;
@Override
public void initialize(URL url, ResourceBundle rb) {
}
@FXML
private void guardar(ActionEvent event) {
Node source = (Node) event.getSource();
Stage stage = (Stage) source.getScene().getWindow();
stage.close();
}
@FXML
private void cancelar(ActionEvent event) {
Node source = (Node) event.getSource();
Stage stage = (Stage) source.getScene().getWindow();
stage.close();
}
@FXML
private void correo(ActionEvent event) {
}
@FXML
private void nombre(ActionEvent event) {
}
@FXML
private void visible(ActionEvent event) {
}
@FXML
private void encendido(ActionEvent event) {
}
@FXML
private void dispositivo(ActionEvent event) {
}
@FXML
private void numero(ActionEvent event) {
}
}
| [
"Christian Osorio@DESKTOP-A5MSM6L"
] | Christian Osorio@DESKTOP-A5MSM6L |
c8af10640ebe1ba5fb5476cdf0b9050472b15415 | a89f9130d56f5aef7e75ee17857c90774df6a4f5 | /V3Interface/src/eu/ensup/V3Interface/dao/IAvengerDao.java | b67a503dbc46271bf063881d8c652053d54f7b61 | [] | no_license | khady1996/GTM01-02-2019 | 092ab0278ea56e94d26ef034b0e5fd5d53cd1db7 | da5561730aa81078d499a451621fb761316cd0a2 | refs/heads/master | 2020-04-20T07:33:36.861790 | 2019-02-01T15:25:27 | 2019-02-01T15:25:27 | 168,714,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | package eu.ensup.V3Interface.dao;
import java.sql.SQLException;
import java.util.List;
import javax.swing.JComboBox;
import eu.ensup.V3Interface.domaine.Avenger;
import eu.ensup.V3Interface.exception.DaoException;
public interface IAvengerDao {
public void createAvenger(Avenger avenger) throws DaoException; // Create
public Avenger readAvengerbyname(Avenger avenger); // read
public String updateAvengerbyname(Avenger avenger, String newpower); // update
public void deleteAvengerbyname(Avenger avenger); // delete
public List<Avenger> getAll();
}
| [
"diijandiaye6@gmail.com"
] | diijandiaye6@gmail.com |
825aa10093ce1e5aa67549238a37a0881a686c9c | c6992ce8db7e5aab6fd959c0c448659ab91b16ce | /sdk/databox/azure-resourcemanager-databox/src/main/java/com/azure/resourcemanager/databox/models/AvailableSkusResult.java | c259babeabc0662fa95968dcdea6df9f34c22985 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later"
] | permissive | g2vinay/azure-sdk-for-java | ae6d94d583cc2983a5088ec8f6146744ee82cb55 | b88918a2ba0c3b3e88a36c985e6f83fc2bae2af2 | refs/heads/master | 2023-09-01T17:46:08.256214 | 2021-09-23T22:20:20 | 2021-09-23T22:20:20 | 161,234,198 | 3 | 1 | MIT | 2020-01-16T20:22:43 | 2018-12-10T20:44:41 | Java | UTF-8 | Java | false | false | 1,942 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.databox.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.databox.fluent.models.SkuInformationInner;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/** The available skus operation response. */
@Fluent
public final class AvailableSkusResult {
@JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableSkusResult.class);
/*
* List of available skus.
*/
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private List<SkuInformationInner> value;
/*
* Link for the next set of skus.
*/
@JsonProperty(value = "nextLink")
private String nextLink;
/**
* Get the value property: List of available skus.
*
* @return the value value.
*/
public List<SkuInformationInner> value() {
return this.value;
}
/**
* Get the nextLink property: Link for the next set of skus.
*
* @return the nextLink value.
*/
public String nextLink() {
return this.nextLink;
}
/**
* Set the nextLink property: Link for the next set of skus.
*
* @param nextLink the nextLink value to set.
* @return the AvailableSkusResult object itself.
*/
public AvailableSkusResult withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
6cb8bb6bc0b1b9bfed416577fa5f75c4ad46b65d | d79789894c9663a89f7a9f46e24b4da8bceb4cad | /src/main/java/com/training/service/ServiceFactory.java | 380f86bfde1fb986cc11db966a81cb5ab3ecaad0 | [] | no_license | olegdibrov/cash_machine_project | 1349318e29c315c8f7bcf511f9d8b248a1ab8d4f | 161f9d710aa83df16d40930afa8703f7a3e2de75 | refs/heads/master | 2020-04-30T22:55:34.922993 | 2019-03-26T23:32:01 | 2019-03-26T23:32:01 | 177,131,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,083 | java | package com.training.service;
import com.training.service.impl.BillService;
import com.training.service.impl.PaymentService;
import com.training.service.impl.ProductService;
import com.training.service.impl.UserService;
import com.training.util.constants.ServiceKey;
import java.util.HashMap;
import java.util.Map;
import static com.training.util.constants.ServiceKey.*;
/**
* Class contains instances of service classes
*
* @author Oleg Dibrov
*/
public class ServiceFactory {
/**
* map for instances
*/
private static Map<ServiceKey, Service> services;
static {
services = new HashMap<>();
services.put(USER_SERVICE, new UserService());
services.put(PRODUCT_SERVICE, new ProductService());
services.put(BILL_SERVICE, new BillService());
services.put(PAYMENT_SERVICE, new PaymentService());
}
/**
* defines service
*
* @param name service identifier
* @return service entity
*/
public static Service getService(ServiceKey name) {
return services.get(name);
}
}
| [
"mail.dibrov@gmail.com"
] | mail.dibrov@gmail.com |
e93f65006c69a567f8de06106943e16f6d27d40b | 6e6555340352d6740d84c264879338ac6d013725 | /FindLength.java | 3599110a4be2154ebc3a9c0d4e898eb35002eca4 | [] | no_license | pavaniAnapala/Java-Projects | 70ab9a2e8da23391b8c949cd8daa498221a35832 | 4c7bd1ddfdfb6a0ff7246caba4660dfeab87502c | refs/heads/master | 2020-03-21T11:48:40.349685 | 2018-07-01T15:56:29 | 2018-07-01T15:56:29 | 138,522,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package src;
import java.util.Scanner;
public class FindLength {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String a = scan.next();
String b = scan.next();
scan.close();
System.out.println(a);
System.out.println(b);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
e0814978683fa292e56e32ae51c119d4213a475c | 8116c59e1c37c09d34a5329b3f0eb8ffdbb03942 | /tvsuit/src/main/java/com/td/tvsuit/views/ratio/RatioLayoutDelegate.java | 6c0fb28fee715e6ac5469c6092b51d1848dfa62f | [
"BSD-3-Clause"
] | permissive | jaychou2012/AndroidTVSuit | 09ef1f203aae9d3fea992caaaffdac63ba3f3683 | 00f55156d99c1dbe05177be3d2665fafffc77498 | refs/heads/master | 2021-07-17T00:24:36.505222 | 2020-08-25T13:17:40 | 2020-08-25T13:17:40 | 202,989,159 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,103 | java | /*
* <pre>
* Copyright 2015 The Android Open Source Project for Android-RatioLayout
*
* 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.
* </pre>
*/
package com.td.tvsuit.views.ratio;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.td.tvsuit.R;
public final class RatioLayoutDelegate<TARGET extends View & RatioMeasureDelegate> {
public static <TARGET extends View & RatioMeasureDelegate> RatioLayoutDelegate obtain(TARGET target, AttributeSet attrs) {
return obtain(target, attrs, 0);
}
public static <TARGET extends View & RatioMeasureDelegate> RatioLayoutDelegate obtain(TARGET target, AttributeSet attrs, int defStyleAttr) {
return obtain(target, attrs, 0, 0);
}
public static <TARGET extends View & RatioMeasureDelegate> RatioLayoutDelegate obtain(TARGET target, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
return new RatioLayoutDelegate<>(target, attrs, defStyleAttr, defStyleRes);
}
private final TARGET mRatioTarget;
private RatioDatumMode mRatioDatumMode;
private float mDatumWidth;
private float mDatumHeight;
private float mAspectRatio;
private boolean mIsSquare;
private int mWidthMeasureSpec, mHeightMeasureSpec;
private RatioLayoutDelegate(TARGET target, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
mRatioTarget = target;
TypedArray a = mRatioTarget.getContext().obtainStyledAttributes(attrs, R.styleable.ViewSizeCalculate, defStyleAttr, defStyleRes);
mRatioDatumMode = RatioDatumMode.valueOf(a.getInt(R.styleable.ViewSizeCalculate_datumRatio, 0));
mDatumWidth = a.getFloat(R.styleable.ViewSizeCalculate_widthRatio, mDatumWidth);
mDatumHeight = a.getFloat(R.styleable.ViewSizeCalculate_heightRatio, mDatumHeight);
mIsSquare = a.getBoolean(R.styleable.ViewSizeCalculate_layoutSquare, false);
mAspectRatio = a.getFloat(R.styleable.ViewSizeCalculate_layoutAspectRatio, mAspectRatio);
a.recycle();
}
private RatioDatumMode shouldRatioDatumMode(ViewGroup.LayoutParams params) {
if (mRatioDatumMode == null || mRatioDatumMode == RatioDatumMode.DATUM_AUTO) {
if (params.width > 0 || shouldLinearParamsWidth(params)
|| params.width == ViewGroup.LayoutParams.MATCH_PARENT) {
return RatioDatumMode.DATUM_WIDTH;
}
if (params.height > 0 || shouldLinearParamsHeight(params)
|| params.height == ViewGroup.LayoutParams.MATCH_PARENT) {
return RatioDatumMode.DATUM_HEIGHT;
}
return null;
}
return mRatioDatumMode;
}
private boolean shouldLinearParamsWidth(ViewGroup.LayoutParams params) {
if (!(params instanceof LinearLayout.LayoutParams)) {
return false;
}
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) params;
return layoutParams.width == 0 && layoutParams.weight > 0;
}
private boolean shouldLinearParamsHeight(ViewGroup.LayoutParams params) {
if (!(params instanceof LinearLayout.LayoutParams)) {
return false;
}
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) params;
return layoutParams.height == 0 && layoutParams.weight > 0;
}
public final void update(int widthMeasureSpec, int heightMeasureSpec) {
mWidthMeasureSpec = widthMeasureSpec;
mHeightMeasureSpec = heightMeasureSpec;
final RatioDatumMode mode = shouldRatioDatumMode(mRatioTarget.getLayoutParams());
final int wp = mRatioTarget.getPaddingLeft() + mRatioTarget.getPaddingRight();
final int hp = mRatioTarget.getPaddingTop() + mRatioTarget.getPaddingBottom();
if (mode == RatioDatumMode.DATUM_WIDTH) {
final int width = View.MeasureSpec.getSize(widthMeasureSpec);
if (mIsSquare) {
final int height = resolveSize(width - wp + hp, heightMeasureSpec);
mHeightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
} else if (mAspectRatio > 0) {
final int height = resolveSize(Math.round((width - wp) / mAspectRatio + hp), heightMeasureSpec);
mHeightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
} else if (mDatumWidth > 0 && mDatumHeight > 0) {
final int height = resolveSize(Math.round((width - wp) / mDatumWidth * mDatumHeight + hp), heightMeasureSpec);
mHeightMeasureSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
}
} else if (mode == RatioDatumMode.DATUM_HEIGHT) {
final int height = View.MeasureSpec.getSize(heightMeasureSpec);
if (mIsSquare) {
final int width = resolveSize(height - hp + wp, widthMeasureSpec);
mWidthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
} else if (mAspectRatio > 0) {
final int width = resolveSize(Math.round((height - hp) / mAspectRatio + wp), widthMeasureSpec);
mWidthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
} else if (mDatumWidth > 0 && mDatumHeight > 0) {
final int width = resolveSize(Math.round((height - hp) / mDatumHeight * mDatumWidth + wp), widthMeasureSpec);
mWidthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
}
}
}
public final int getWidthMeasureSpec() {
return mWidthMeasureSpec;
}
public final int getHeightMeasureSpec() {
return mHeightMeasureSpec;
}
private void requestLayout() {
mRatioTarget.requestLayout();
}
private int resolveSize(int size, int measureSpec) {
/*return View.resolveSize(size,measureSpec);*/
return size;
}
public final void setRatio(RatioDatumMode mode, float datumWidth, float datumHeight) {
mRatioDatumMode = mode;
mDatumWidth = datumWidth;
mDatumHeight = datumHeight;
requestLayout();
}
public final void setSquare(boolean square) {
mIsSquare = square;
requestLayout();
}
public final void setAspectRatio(float aspectRatio) {
mAspectRatio = aspectRatio;
requestLayout();
}
}
| [
"td@qq.com"
] | td@qq.com |
08bf8553a96e3e6846e51811baf56402a0593f4b | 645aaf913a1d342a82fbda38aabe3f3345507c7a | /src/com/mousbah/defaultmethods/UnitCircle.java | 9faaa39502a96ee0cef73a6451de508a67002b04 | [] | no_license | MousbahFil/Java8 | 2a05098142e0573dd23cf3cdaf96bd03e836327b | d35040e58202453006525638df7fa1a193ac99c1 | refs/heads/master | 2016-08-07T10:23:44.064476 | 2015-01-10T14:13:17 | 2015-01-10T14:13:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | package com.mousbah.defaultmethods;
public class UnitCircle implements Circle{
private int x;
private int y;
private double radius;
public UnitCircle(int x, int y, double radius) {
super();
this.x = x;
this.y = y;
this.radius = radius;
}
public void setX(int x) {
this.x = x;
}
public void setY(int y) {
this.y = y;
}
public void setRadius(double radius) {
this.radius = radius;
}
@Override
public int getX() throws Exception {
return x;
}
@Override
public int getY() throws Exception {
return y;
}
@Override
public double getRadius() throws Exception {
return radius;
}
}
| [
"quantummousbah@gmail.com"
] | quantummousbah@gmail.com |
e76222d9fed9535576e1278c18a05034b9ad5f25 | 254f55601396e3c618e28af67fa3ec7ab4867e17 | /ecsite2/src/com/internousdev/ecsite2/action/BuyItemAction.java | bac4a2cb552479694a423a3af01a2d662796da47 | [] | no_license | hunterkuro/ECsite | c6e4c8c5ffaeab08a1df11f37adf13c8b33c27cb | 468104f8aa736e5b8dc57c3d6cbf10063f3beb78 | refs/heads/master | 2020-06-26T05:35:28.420096 | 2019-07-30T02:05:37 | 2019-07-30T02:05:37 | 199,549,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,734 | java | package com.internousdev.ecsite2.action;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
public class BuyItemAction extends ActionSupport implements SessionAware{
//buyItem.jspからcountとpayがformで送られている。
public Map<String,Object> session;
private int count;
private String pay;
//実行メソッド
public String execute(){
//商品購入の結果を返すresultの初期値はSUCCESS(変更されない
String result = SUCCESS;
//sessionに購入個数countを定義
session.put("count", count);
/* 合計金額(購入個数*値段)を計算するためsessionのcountとpriceをint型に変換
* .toString()でsessionのMAP型をString型に変換。
* Integer.parseInt(String型の変数)でString型をint型へ変換。 */
int intCount = Integer.parseInt(session.get("count").toString());
int intPrice = Integer.parseInt(session.get("buyItem_price").toString());
//count*priceをsessionのtotal_priceに格納。
session.put("total_price",intCount * intPrice);
/*ローカル変数paymentを定義してbuyItem.jspから送られた
*payのvalueに応じてpaymentに支払方法を格納 */
String payment;
if(pay.equals("1")){
payment = "現金払い";
session.put("pay",payment);
}else{
payment = "クレジットカード";
session.put("pay",payment);
}
//result = SUCCESSのまま返す。→buyItemConfirm.jspへ
return result;
}
public void setCount(int count){
this.count = count;
}
public void setPay(String pay){
this.pay = pay;
}
@Override
public void setSession(Map<String,Object> session){
this.session = session;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
41139dd3261c6b7c6a72b6fcb0d6f4ed2999e190 | d91e9190f9e3c4306b438a053119e886f132047f | /app/src/main/java/com/mxkj/yuanyintang/musicplayer/playcache/HttpProxyCacheServerClients.java | f8a014268a28ae456846d4e6d51775c55c9efecf | [] | no_license | WHX979454518/yuanyintang | ab4aae5660056eccbc69a79b0c18e32abea9f3f7 | 45ff50d08cd26ef738334151f4dee0787fb6e997 | refs/heads/master | 2022-11-22T00:48:14.125968 | 2020-07-30T09:34:18 | 2020-07-30T09:34:18 | 281,641,575 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,666 | java | package com.mxkj.yuanyintang.musicplayer.playcache;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.mxkj.yuanyintang.musicplayer.playcache.file.FileCache;
import java.io.File;
import java.io.IOException;
import java.net.Socket;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Client for {@link HttpProxyCacheServer}
*
* @author Alexey Danilov (danikula@gmail.com).
*/
final class HttpProxyCacheServerClients {
private final AtomicInteger clientsCount = new AtomicInteger(0);
private final String url;
private volatile HttpProxyCache proxyCache;
private final List<CacheListener> listeners = new CopyOnWriteArrayList<>();
private final CacheListener uiCacheListener;
private final Config config;
public HttpProxyCacheServerClients(String url, Config config) {
this.url = Preconditions.checkNotNull(url);
this.config = Preconditions.checkNotNull(config);
this.uiCacheListener = new UiListenerHandler(url, listeners);
}
public void processRequest(GetRequest request, Socket socket) throws ProxyCacheException, IOException {
startProcessRequest();
try {
clientsCount.incrementAndGet();
proxyCache.processRequest(request, socket);
} finally {
finishProcessRequest();
}
}
private synchronized void startProcessRequest() throws ProxyCacheException {
proxyCache = proxyCache == null ? newHttpProxyCache() : proxyCache;
}
private synchronized void finishProcessRequest() {
if (clientsCount.decrementAndGet() <= 0) {
proxyCache.shutdown();
proxyCache = null;
}
}
public void registerCacheListener(CacheListener cacheListener) {
listeners.add(cacheListener);
}
public void unregisterCacheListener(CacheListener cacheListener) {
listeners.remove(cacheListener);
}
public void shutdown() {
listeners.clear();
if (proxyCache != null) {
proxyCache.registerCacheListener(null);
proxyCache.shutdown();
proxyCache = null;
}
clientsCount.set(0);
}
public int getClientsCount() {
return clientsCount.get();
}
private HttpProxyCache newHttpProxyCache() throws ProxyCacheException {
HttpUrlSource source = new HttpUrlSource(url, config.sourceInfoStorage);
FileCache cache = new FileCache(config.generateCacheFile(url), config.diskUsage);
HttpProxyCache httpProxyCache = new HttpProxyCache(source, cache);
httpProxyCache.registerCacheListener(uiCacheListener);
return httpProxyCache;
}
private static final class UiListenerHandler extends Handler implements CacheListener {
private final String url;
private final List<CacheListener> listeners;
public UiListenerHandler(String url, List<CacheListener> listeners) {
super(Looper.getMainLooper());
this.url = url;
this.listeners = listeners;
}
@Override
public void onCacheAvailable(File file, String url, int percentsAvailable) {
Message message = obtainMessage();
message.arg1 = percentsAvailable;
message.obj = file;
sendMessage(message);
}
@Override
public void handleMessage(Message msg) {
for (CacheListener cacheListener : listeners) {
cacheListener.onCacheAvailable((File) msg.obj, url, msg.arg1);
}
}
}
}
| [
"wanghonxin@163.com"
] | wanghonxin@163.com |
2fd62cf99b11559a44743e27ead4c6cd53d28883 | 52592d045bbb9267a940da9f3a5d9df7a5d65783 | /app/src/main/java/com/macode/paynothing/activities/OtherItemDetailActivity.java | b520b1ee9a71b1211bb89e84a0bb9f7d276d2635 | [
"MIT"
] | permissive | kuya32/Pay-Nothing | 47b05bce6b0031f6c797fcbb5480039c7c5c552f | 42082895e8bb27c5e1f05c9e16e2080ee5145922 | refs/heads/main | 2023-03-23T22:42:36.067159 | 2021-03-24T23:58:25 | 2021-03-24T23:58:25 | 339,203,759 | 0 | 0 | MIT | 2021-03-18T17:37:20 | 2021-02-15T20:52:38 | Java | UTF-8 | Java | false | false | 18,863 | java | package com.macode.paynothing.activities;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Base64;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.Circle;
import com.google.android.gms.maps.model.CircleOptions;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.macode.paynothing.R;
import com.squareup.picasso.Picasso;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import de.hdodenhof.circleimageview.CircleImageView;
public class OtherItemDetailActivity extends AppCompatActivity implements OnMapReadyCallback{
private Toolbar itemDetailToolBar;
private CircleImageView itemDetailSellerImage;
private ImageView itemDetailImage;
private String itemKey, otherUserId, itemTitle, itemImage, itemCategory, itemCondition, itemBrand, itemModel, itemType, itemDescription, itemLocation, itemPickUpOnly, itemLat, itemLong, itemSellerImageUrl, itemSellerUsername, loyaltyString, stringDate;
private TextView itemDetailTitle, itemDetailLocation, itemDetailCategory, itemDetailCondition, itemDetailPickUpOnly, itemDetailSellerUsername, itemDetailBrand, itemDetailModel, itemDetailType, itemDetailDescription, loyalty;
private Boolean itemPickUp, isSaved = false;
private CardView sellerCardView;
private FirebaseAuth firebaseAuth;
private FirebaseUser firebaseUser;
private DatabaseReference userReference, itemReference, savedItemReference, inboxChatReference;
private MenuItem savedItem;
private Menu otherItemDetailTopMenu;
private Button messageSellerButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_other_item_detail);
itemDetailToolBar = findViewById(R.id.otherItemDetailToolbar);
itemDetailImage = findViewById(R.id.otherItemDetailImageView);
itemDetailTitle = findViewById(R.id.otherItemDetailTitle);
itemDetailLocation = findViewById(R.id.otherItemDetailLocation);
itemDetailCategory = findViewById(R.id.otherItemDetailCategory);
itemDetailCondition = findViewById(R.id.otherItemDetailCondition);
itemDetailPickUpOnly = findViewById(R.id.otherItemDetailPickUpOnly);
itemDetailSellerImage = findViewById(R.id.otherItemDetailSellerImage);
itemDetailSellerUsername = findViewById(R.id.otherItemDetailSellerUsername);
loyalty = findViewById(R.id.otherLoyalty);
itemDetailBrand = findViewById(R.id.otherItemDetailBrand);
itemDetailModel = findViewById(R.id.otherItemDetailModel);
itemDetailType = findViewById(R.id.otherItemDetailType);
itemDetailDescription = findViewById(R.id.otherItemDetailDescription);
messageSellerButton = findViewById(R.id.messageSellerButton);
sellerCardView = findViewById(R.id.otherCardView);
firebaseAuth = FirebaseAuth.getInstance();
firebaseUser = firebaseAuth.getCurrentUser();
userReference = FirebaseDatabase.getInstance().getReference().child("Users");
itemReference = FirebaseDatabase.getInstance().getReference().child("Items");
savedItemReference = FirebaseDatabase.getInstance().getReference().child("SavedItems");
inboxChatReference = FirebaseDatabase.getInstance().getReference().child("InboxChats");
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
retrieveExtraData();
otherUserId = itemKey.substring(0, itemKey.indexOf(" "));
setSupportActionBar(itemDetailToolBar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
retrieveItemData();
retrieveSellerData();
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.otherItemDetailGoogleMap);
if (mapFragment != null) {
mapFragment.getMapAsync(this);
} else {
Toast.makeText(this, "Null Map Fragment", Toast.LENGTH_LONG).show();
}
messageSellerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("dd-M-yyyy hh:mm:ss", Locale.getDefault());
stringDate = format.format(date);
HashMap hashMap = new HashMap();
hashMap.put("sellerId", otherUserId);
hashMap.put("itemKey", itemKey);
hashMap.put("buyerId", firebaseUser.getUid());
hashMap.put("mostRecentMessage", "No recent messages");
hashMap.put("dateOfMostRecentMessage", stringDate);
inboxChatReference.child(firebaseUser.getUid()).child(itemKey).updateChildren(hashMap).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
inboxChatReference.child(otherUserId).child(itemKey).updateChildren(hashMap).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
Intent intent = new Intent(OtherItemDetailActivity.this, ChatActivity.class);
intent.putExtra("sellersId", otherUserId);
intent.putExtra("itemKey", itemKey);
startActivity(intent);
} else {
Toast.makeText(OtherItemDetailActivity.this, "Chat could not be created!", Toast.LENGTH_SHORT).show();
}
}
});
} else {
Toast.makeText(OtherItemDetailActivity.this, "Chat could not be created!", Toast.LENGTH_SHORT).show();
}
}
});
}
});
sellerCardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(OtherItemDetailActivity.this, OtherPublicProfileActivity.class);
intent.putExtra("sellersId", otherUserId);
startActivity(intent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.other_item_detail_top_menu, menu);
this.otherItemDetailTopMenu = menu;
checkIfItemIsSaved();
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if ((item.getItemId() == R.id.saveItem && isSaved)) {
removedSavedItem();
isSaved = false;
} else if (item.getItemId() == R.id.saveItem && !isSaved) {
saveItem(itemKey);
isSaved = true;
} else if (item.getItemId() == R.id.share) {
ApplicationInfo api = getApplicationContext().getApplicationInfo();
String apkPath = api.sourceDir;
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("application/vnd.android.package-archive");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(apkPath)));
startActivity(Intent.createChooser(intent, "ShareVia"));
} else if (item.getItemId() == android.R.id.home) {
finish();
}
invalidateOptionsMenu();
return super.onOptionsItemSelected(item);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if (isSaved) {
savedItem = menu.findItem(R.id.saveItem)
.setIcon(R.drawable.ic_unsaved);
} else {
savedItem = menu.findItem(R.id.saveItem)
.setIcon(R.drawable.ic_saved);
}
return super.onPrepareOptionsMenu(menu);
}
private void checkIfItemIsSaved() {
savedItemReference.child(firebaseUser.getUid()).child(itemKey).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if (snapshot.child("title").exists()) {
isSaved = true;
savedItem = otherItemDetailTopMenu.findItem(R.id.saveItem);
savedItem.setIcon(R.drawable.ic_saved);
} else {
isSaved = false;
savedItem = otherItemDetailTopMenu.findItem(R.id.saveItem);
savedItem.setIcon(R.drawable.ic_unsaved);
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
private void saveItem(String itemKey) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("dd-M-yyyy hh:mm:ss", Locale.getDefault());
final String stringDate = format.format(date);
HashMap hashMap = new HashMap();
hashMap.put("title", itemTitle);
hashMap.put("imageUrl", itemImage);
hashMap.put("dateItemSaved", stringDate);
savedItemReference.child(firebaseUser.getUid()).child(itemKey).updateChildren(hashMap).addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(Object o) {
isSaved = true;
Toast.makeText(OtherItemDetailActivity.this, "Item Saved", Toast.LENGTH_SHORT).show();
}
});
}
private void removedSavedItem() {
savedItemReference.child(firebaseUser.getUid()).child(itemKey).removeValue().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
isSaved = false;
Toast.makeText(OtherItemDetailActivity.this, "Item has been unsaved", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(OtherItemDetailActivity.this, "" + task.getException().toString(), Toast.LENGTH_SHORT).show();
}
}
});
}
public void retrieveExtraData() {
Intent intent = getIntent();
itemKey = intent.getStringExtra("itemKey");
}
private void retrieveItemData() {
itemReference.child(itemKey).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if (snapshot.exists()) {
itemTitle = snapshot.child("title").getValue().toString();
itemImage = snapshot.child("imageUrl").getValue().toString();
itemLocation = snapshot.child("location").getValue().toString();
itemCategory = snapshot.child("category").getValue().toString();
itemCondition = snapshot.child("condition").getValue().toString();
itemPickUp = (Boolean) snapshot.child("pickUpOnly").getValue();
itemPickUpOnly = (itemPickUp) ? "Pick Up Only" : "Drop Off";
itemBrand = snapshot.child("brand").getValue().toString();
itemModel = snapshot.child("model").getValue().toString();
itemType = snapshot.child("type").getValue().toString();
itemDescription = snapshot.child("description").getValue().toString();
itemLat = snapshot.child("latitude").getValue().toString();
itemLong = snapshot.child("longitude").getValue().toString();
Picasso.get().load(itemImage).into(itemDetailImage);
itemDetailTitle.setText(itemTitle);
itemDetailLocation.setText(itemLocation);
itemDetailCategory.setText(itemCategory);
itemDetailCondition.setText(String.format("Condition: %s", itemCondition));
itemDetailPickUpOnly.setText(String.format("%s", itemPickUpOnly));
itemDetailBrand.setText(String.format("Brand: %s", itemBrand));
itemDetailModel.setText(String.format("Model: %s", itemModel));
itemDetailType.setText(String.format("Type: %s", itemType));
itemDetailDescription.setText(String.format("More info: %s", itemDescription));
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(OtherItemDetailActivity.this, "Sorry, something went wrong!", Toast.LENGTH_SHORT).show();
}
});
}
private void retrieveSellerData() {
userReference.child(otherUserId).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if (snapshot.exists()) {
itemSellerImageUrl = snapshot.child("profileImage").getValue().toString();
itemSellerUsername = snapshot.child("username").getValue().toString();
loyaltyString = snapshot.child("dateUserCreated").getValue().toString();
String subLoyaltyString = changeNumberDateToWordedDate(loyaltyString);
Picasso.get().load(itemSellerImageUrl).into(itemDetailSellerImage);
itemDetailSellerUsername.setText(itemSellerUsername);
loyalty.setText(String.format("Member since %s", subLoyaltyString));
getSupportActionBar().setTitle(String.format("%s\'s Item Details", itemSellerUsername));
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(OtherItemDetailActivity.this, "Sorry, something went wrong!", Toast.LENGTH_SHORT).show();
}
});
}
public Bitmap stringToBitMap(String encodedString) {
try {
byte[] encodeByte = Base64.decode(encodedString, Base64.DEFAULT);
Bitmap bitmap = BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
return bitmap;
} catch (Exception e) {
e.getMessage();
return null;
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
itemReference.child(itemKey).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if (snapshot.exists()) {
itemLat = snapshot.child("latitude").getValue().toString();
itemLong = snapshot.child("longitude").getValue().toString();
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(Double.parseDouble(itemLat), Double.parseDouble(itemLong)), 12));
Circle circle = googleMap.addCircle(new CircleOptions()
.center(new LatLng(Double.parseDouble(itemLat), Double.parseDouble(itemLong)))
.radius(1500)
.strokeColor(Color.parseColor("#8097FAFB"))
.fillColor(Color.parseColor("#8097FAFB")));
circle.setVisible(true);
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
private String changeNumberDateToWordedDate(String numberedDate) {
String refactorNumberedDate;
String month = "";
String wordedMonth = "";
String year = "";
HashMap<String, String> months = new HashMap<>();
months.put("1", "January");
months.put("2", "February");
months.put("3", "March");
months.put("4", "April");
months.put("5", "May");
months.put("6", "June");
months.put("7", "July");
months.put("8", "August");
months.put("9", "September");
months.put("10", "October");
months.put("11", "November");
months.put("12", "December");
refactorNumberedDate = numberedDate.substring(numberedDate.indexOf("-") + 1, numberedDate.indexOf(" "));
month = refactorNumberedDate.substring(0, refactorNumberedDate.indexOf("-"));
wordedMonth = months.get(month);
year = refactorNumberedDate.substring(refactorNumberedDate.indexOf("-") + 1);
return String.format("%s, %s", wordedMonth, year);
}
} | [
"m.acode@outlook.com"
] | m.acode@outlook.com |
9037092fd7150ded59cdaa629cbe3f8be71e5fa5 | 0155fbdef99b37732fcb404a2c579c2bd7089b8e | /src/main/java/com/traffic/transportservice/util/RandomUtil.java | 0bca8feffe51a96bb6bc03c27bee9dfe6843458e | [] | no_license | BeastAndBeauty/transportservice | 1795ad64796b9ff80afdff7e4ff0553b70b855f8 | 16280f4fe87ef44023cc48318a0b318948954793 | refs/heads/master | 2020-04-24T01:01:42.868390 | 2019-02-20T02:10:20 | 2019-02-20T02:10:20 | 171,583,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,575 | java | package com.traffic.transportservice.util;
import java.util.*;
/**
* @Description: 获取随机值
* @Author: paopao
* @CreateDate: 2019/2/13 19:07
*/
public class RandomUtil {
public static Map<String, Object> randomGetWeather() {
int WCurrent = randomNumber(8, 25);//当前温度
Map<String, Object> map = new LinkedHashMap<>();
map.putAll(ResultUtil.success("成功"));
map.put("WCurrent", WCurrent);
List<Map<String, String>> list = new ArrayList();
for (int i = -1; i < 5; i++) {
Map<String, String> ROWS_DETAIL = new LinkedHashMap<>();
ROWS_DETAIL.put("WData", DateUtil.getTime(i));
ROWS_DETAIL.put("temperature", randomNumber(WCurrent - 10, WCurrent) + "~" + randomNumber(WCurrent + 5, WCurrent + 10));
list.add(ROWS_DETAIL);
}
map.put("ROWS_DETAIL", list);
return map;
}
public static Map<String, Object> randomAllSense() {
Map<String, Object> map = new LinkedHashMap<>();
map.putAll(ResultUtil.success("成功"));
map.put("pm2.5", randomNumber(0, 400));
map.put("co2", randomNumber(350, 5000));
map.put("lightIntensity", randomNumber(0, 5000));
map.put("humidity", randomNumber(10, 50));
map.put("temperature", randomNumber(8, 40));
return map;
}
/**
* 指定传感器的值
*
* @param SenseName 传感器名
* @return
*/
public static Map<String, Object> randomSenseByName(String SenseName) {
Map<String, Object> map = new LinkedHashMap<>();
map.putAll(ResultUtil.success("成功"));
switch (SenseName) {
case "pm2.5":
map.put("pm2.5", randomNumber(0, 400));
break;
case "co2":
map.put("co2", randomNumber(350, 5000));
break;
case "lightIntensity":
map.put("lightIntensity", randomNumber(0, 5000));
break;
case "humidity":
map.put("humidity", randomNumber(10, 50));
break;
case "temperature":
map.put("temperature", randomNumber(8, 40));
break;
}
return map;
}
private static int randomNumber(int MIN, int MAX) {
Random rand = new Random();
return rand.nextInt(MAX - MIN + 1) + MIN;
}
private static String randomString(String[] strs) {
Random rand = new Random();
return strs[rand.nextInt(strs.length)];
}
}
| [
"2906381723@qq.comm"
] | 2906381723@qq.comm |
b0d75c14a128b7efa4080e31af3e5cdcffc43de9 | b49e9a5c83c5b1ce2e7aa44d8003c5d1b7de047e | /app/src/main/java/com/tunjid/projects/avantphotouploader/services/AvantApi.java | 6b4de77c721b166256df4af552fdae12252876d6 | [] | no_license | morristech/PhotoUploader | 468045cfc7923fbed91c4488eb2014f90e1af388 | 4a260027a3c4a2c1ddd058558bbab1e27c4a4816 | refs/heads/master | 2020-05-29T18:02:36.387808 | 2015-09-29T15:02:12 | 2015-09-29T15:02:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,617 | java | package com.tunjid.projects.avantphotouploader.services;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Binder;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.widget.Toast;
import com.parse.ParseException;
import com.parse.ParseFile;
import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.ProgressCallback;
import com.parse.SaveCallback;
import com.tunjid.projects.avantphotouploader.R;
import com.tunjid.projects.avantphotouploader.activities.HomeActivity;
import com.tunjid.projects.avantphotouploader.helpers.Utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func0;
import rx.schedulers.Schedulers;
/**
* Base class for bound service that makes API calls.
*/
public class AvantApi extends Service
implements
Observer<ParseFile> {
private static final int NOTIFICATION_ID = 1;
private int currentProgress;
private String exifOrientation;
private String fileType;
private String imagePath;
private final NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this);
private NotificationManager notificationManager;
private final IBinder binder = new LocalBinder();
public AvantApi() {
}
@Override
public void onCreate() {
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
public void createParseFileAsync(final String imagePath, final String fileType, final String exifOrientation) {
Toast.makeText(this, R.string.processing, Toast.LENGTH_SHORT).show();
this.fileType = fileType;
this.exifOrientation = exifOrientation;
Observable.defer(new Func0<Observable<ParseFile>>() {
@Override
public Observable<ParseFile> call() {
return Observable.just(createParseFile(imagePath, fileType));
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.timeout(12, TimeUnit.SECONDS)
.subscribe(this);
}
// NOTE: it is difficult to rotate a high resolution image locally without running into
// OutOfMemoryExceptions. This is a task best suited to a server side implementation.
// The Orientation from exif data is added to every filetype upload to facilitate this.
public ParseFile createParseFile(String imagePath, String formType) {
try {
this.imagePath = imagePath;
File file = new File(imagePath);
FileInputStream fis = new FileInputStream(file);
Bitmap bm = BitmapFactory.decodeStream(fis);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray();
return new ParseFile(formType + ".jpg", data);
}
catch (Exception e) {
e.printStackTrace();
}
return null;
}
public void uploadImageToParse(final ParseFile parseFile, final String fileType) {
Toast.makeText(this, R.string.starting_upload, Toast.LENGTH_SHORT).show();
Intent intent = new Intent(this, HomeActivity.class);
intent.putExtra(Utils.GENERIC_FLAG, HomeActivity.UPLOADED_FILES_TAG);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
PendingIntent.FLAG_CANCEL_CURRENT);
notificationBuilder.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setContentTitle(getString(R.string.uploading_file))
.setProgress(100, 0, false)
.setAutoCancel(false);
startForeground(NOTIFICATION_ID, notificationBuilder.build());
// First upload the file, and save it in the background.
parseFile.saveInBackground(new SaveCallback() {
public void done(ParseException e) {
if (e == null) {
final ParseUser currentUser = ParseUser.getCurrentUser();
if (currentUser != null) {
updateNotification(R.string.finishing_up);
// Create new class holding file and accociated metadata
final ParseObject formDataFile = new ParseObject(fileType);
formDataFile.put(Utils.ORIENTATION, exifOrientation);
formDataFile.put(Utils.FORM_UPLOAD, parseFile);
formDataFile.put(Utils.IMAGE_PATH, imagePath);
formDataFile.put(Utils.CUSTOMER_ID, currentUser.getUsername());
// Save the custom class in the background
formDataFile.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException fileSaveException) {
// If successfull save it to the user.
if (fileSaveException == null) {
currentUser.put(fileType, formDataFile);
currentUser.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException saveToUserException) {
if (saveToUserException == null) {
notificationBuilder
.setContentTitle(getString(R.string.upload_successful))
.setContentText(getString(R.string.application_review))
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(getString(R.string.application_review)))
.setProgress(0, 0, false)
.setAutoCancel(true);
notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
stopForeground(false);
}
else {
saveToUserException.printStackTrace();
updateNotification(R.string.upload_failure);
stopForeground(false);
}
}
});
}
}
});
}
else {
updateNotification(R.string.upload_failure);
stopForeground(false);
}
}
else {
e.printStackTrace();
updateNotification(R.string.upload_failure);
stopForeground(false);
}
}
}, new ProgressCallback() {
@Override
public void done(Integer percentDone) {
// This can be done better, but will suffice for this example
if (percentDone % 30 == 0 && percentDone != currentProgress) {
notificationBuilder
.setContentText(percentDone + "% done")
.setProgress(100, percentDone, false)
;
notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
}
currentProgress = percentDone;
}
});
}
private void updateNotification(int stringResource) {
notificationBuilder
.setContentText(getString(stringResource))
.setProgress(0, 0, false)
.setAutoCancel(true);
notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
}
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(ParseFile parseFile) {
if (parseFile != null) {
uploadImageToParse(parseFile, fileType);
}
else {
Toast.makeText(this, getString(R.string.error), Toast.LENGTH_SHORT).show();
}
}
@Override
public IBinder onBind(Intent intent) {
return binder;
}
@Override
public boolean onUnbind(Intent intent) {
return super.onUnbind(intent);
}
/**
* <p> Local Binder class that returns Binder interface for clients to bind to. </p>
*/
public class LocalBinder extends Binder {
/**
* <p> gets single unique instance of the API to bind to. </p>
*/
public AvantApi getService() {
return AvantApi.this;
}
}
}
| [
"tjdah100@gmail.com"
] | tjdah100@gmail.com |
0263464e571186f537ff4896d648a2ec063a92aa | e0c451b886aa2b8cc0fd387c60115482ee31e162 | /Animal.java | 2199cadd890c511ae1160c13e1074b78bf2d6641 | [] | no_license | tparris4/JavaSchoolCode | dffa04b628c128c4a78315d9241ae61425eaefa0 | 4020585b680415b6ecbc7d0ea297a03992b5600e | refs/heads/master | 2022-06-30T07:53:29.507571 | 2020-05-06T04:37:52 | 2020-05-06T04:37:52 | 261,650,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,363 | java | public abstract class Animal {
//TODO: declare position as an int.
private int position;
//TODO: declare pattern as an array of int
int[] movePattern = new int[];
//TODO: declare markId as a char
private char markId;
//TODO: declare name as a string.
private String name;
//TODO: default constructor.
public Animal() {
int position;
int[] movePattern;
char markId;
String name;
}
//TODO: The non-default constructor is to initialize data members.
//It cannot be used to instantiate an object from Animal,
//since Animal is declared as abstract.
public Animal(int position, int[] movePattern,
String name, char markId) {
setPosition(position); //this.position = position;
setMovePattern(movePattern);
setName(name);
setMarkId(markId);
}
//TODO: Move the animal according to movePattern.
public void move() {
int index = (int)(Math.random() * movePattern.length);
int stepsMoved = movePattern[index];
position += stepsMoved;
}
//TODO: Return the current position of the animal
public int getPosition() {
return position;
}
//TODO: Return markId of the animal
public char getMarkId() {
return markId;
}
//TODO: Return the name of the animal
public String getName() {
return name;
}
//TODO: Change the position of racing animal to
//given parameter position.
//Change the method to be protected so that only subclasses
//or classes in the same package can call it.
//This is because this method takes whatever given parameter as data member,
//we need to make sure that caller is aware of the direct assignment
//without checking for possible invalid parameters.
protected void setPosition(int position) {
this.position = position;
//position = i; //this is wrong. We do not change give parameter position,
//and i is not declared and defined.
}
//TODO: use given parameter movePattern to set
//data member movePattern.
public void setMovePattern(int[] movePattern) {
this.movePattern = movePattern.clone();
}
//TODO: set up the mark id for an animal
public void setMarkId(char markId) {
this.markId = markId;
}
//TODO: set up name for an animal
public void setName(String name) {
this.name = name;
}
public abstract void showExcitement();
}
| [
"noreply@github.com"
] | noreply@github.com |
e28d2b8ac4902f699c888f05447815e49112a1f6 | 35d2d736f0dc50b708d92055c4d5e4273ab41967 | /gateway/components/camel-bluetooth/src/test/java/io/rhiot/component/bluetooth/BluetoothComponentWithServiceDiscoveryTest.java | 14a2340966eedca71a507e3c9f94f374fc676bb6 | [
"Apache-2.0"
] | permissive | akram/rhiot | a9630fc18f65748dfa085aa6fe8fd67b3801365f | 82eac10e365f72bab9248b8c3bd0ec9a2fc0a721 | refs/heads/master | 2021-01-12T12:54:02.293554 | 2016-12-09T14:48:22 | 2016-12-09T14:48:22 | 54,881,830 | 0 | 0 | Apache-2.0 | 2019-10-11T08:11:48 | 2016-03-28T09:32:06 | C++ | UTF-8 | Java | false | false | 2,641 | java | /**
* Licensed to the Rhiot under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.rhiot.component.bluetooth;
import org.apache.camel.EndpointInject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
public class BluetoothComponentWithServiceDiscoveryTest extends CamelTestSupport {
@EndpointInject(uri = "mock:shouldFindBluetoothDevicesWithServices")
MockEndpoint findBluetoothDevicesMockEndpoint;
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from("bluetooth://scan?serviceDiscovery=true").to("mock:shouldFindBluetoothDevicesWithServices");
}
};
}
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
registry.bind("bluetoothDeviceProvider", new MockBluetoothDeviceProvider());
return registry;
}
@Test
public void shouldListBluetoothDevicesWithServices() throws InterruptedException {
BluetoothDevice[] bluetoothDevices = consumer.receiveBody("bluetooth://scan?serviceDiscovery=true", BluetoothDevice[].class);
assertEquals(2, bluetoothDevices.length);
assertEquals("name1", bluetoothDevices[0].getName());
assertEquals("address2", bluetoothDevices[1].getAddress());
assertEquals(2, bluetoothDevices[0].getBluetoothServices().size());
assertEquals(2, bluetoothDevices[1].getBluetoothServices().size());
}
@Test
public void shouldListBluetoothDevicesWithServices2() throws InterruptedException {
findBluetoothDevicesMockEndpoint.setExpectedMessageCount(1);
findBluetoothDevicesMockEndpoint.assertIsSatisfied();
}
}
| [
"arkadiusz.jurasz@gmail.com"
] | arkadiusz.jurasz@gmail.com |
d2ab6c4e737d3841050d7c8fcf9dceaacc9a664c | 105f289edc4ffe9625e75effe8825b3ac4c7bd0b | /model/src/main/java/com/icefamer/server/domain/course/ext/CategoryNode.java | af61a551ff4f2028cb58e80eb6f5f8704f979e38 | [] | no_license | icefamer/jenkins-test | a8fd5bef2af4c90a2456748b0e3ebb0124a7c47b | 3f158b845230a1a1e5307d48d1908961cf4b980b | refs/heads/master | 2022-12-04T23:41:30.122113 | 2019-11-07T06:32:27 | 2019-11-07T06:32:27 | 214,933,398 | 0 | 0 | null | 2022-11-24T06:27:06 | 2019-10-14T02:46:01 | Java | UTF-8 | Java | false | false | 307 | java | package com.icefamer.server.domain.course.ext;
import com.icefamer.server.domain.course.Category;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* Created by admin on 2018/2/7.
*/
@Data
@ToString
public class CategoryNode extends Category {
List<CategoryNode> children;
}
| [
"icefamer@gmail.com"
] | icefamer@gmail.com |
9028a49e25fc2df8e1cb933cd8429c118464eb65 | 38a0dc36b13f7dad1d24845b4103a8bf6c8daf7f | /LocationInfoController.java | 630e1893dfa0cb9b3e58ec32ec0c62972651d924 | [] | no_license | bo1988/hello-word | afd1add4ba88264c7ee4354237da863b94e36e40 | 10854793a33b5a825ce8d90b1c2a383dac0ca03b | refs/heads/master | 2021-07-19T15:22:41.531433 | 2018-10-17T01:18:08 | 2018-10-17T01:18:08 | 136,108,887 | 0 | 0 | null | 2018-06-05T05:03:38 | 2018-06-05T02:33:37 | null | UTF-8 | Java | false | false | 1,092 | java | package com.longhai.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.longhai.pojo.Param;
import com.longhai.util.HttpRequst;
@Controller
@RequestMapping("/locationInfo")
public class LocationInfoController {
//到高德地图获取目的点的详细信息
@RequestMapping(value="/toLocation.do",produces="application/json;charset=UTF-8")
@ResponseBody
public String toLocation( Param param) {
String params="key=c663b4064db54ab161778b3360e2e6f6&keywords="+param.getKeywords()+"&city="+param.getCity();
String s=HttpRequst.sendPost("http://restapi.amap.com/v3/assistant/inputtips", params);
s=s.replace("tips","data");
s=s.replace("status","flag");
s=s.replace("id","di");
s=s.replace("in","ni");
char[] cs = s.toCharArray();
cs[9]='0';
s= new String(cs);
System.out.println(s);
return s;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
c0dab45a87b32498b03acedf75f914f9cbfdd4f9 | 49d732eb1d70a2d1bedbbbd8cdd68621c79ebb76 | /IOC-Proj21-SBIDetailsLayeredApp/src/test/java/com/infosys/SBI/Test/SBIDetailsTest.java | 178a7da00544bdbdf76330a6c411c57ec8945049 | [] | no_license | Shree12GitRepo/-SpringProgram | aaa975aa60d64953768db3fa537a8947905c6c67 | 4c509e22b02c90a718bd1abc4adc31c4b08fe526 | refs/heads/master | 2021-07-12T08:57:01.774911 | 2019-09-23T06:35:26 | 2019-09-23T06:35:26 | 209,041,110 | 0 | 0 | null | 2020-10-13T16:13:42 | 2019-09-17T11:56:54 | Java | UTF-8 | Java | false | false | 2,279 | java | package com.infosys.SBI.Test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Scanner;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import com.Infosys.SBI.Contorller.SBIDetailsController;
import com.Infosys.SBI.VO.SBIDetailsVO;
public class SBIDetailsTest {
public static void main(String[] args) {
DefaultListableBeanFactory factory=null;
XmlBeanDefinitionReader reader=null;
SBIDetailsController ctrl=null;
Scanner sc=new Scanner(System.in);
System.out.println("-----------------------------SBI Bank Details-----------------------------");
System.out.println("Enter the BranchName: ");
String brnchName=sc.nextLine();
System.out.println("Enter the Branch Manager Name ");
String brnch_mgr_Name=sc.nextLine();
System.out.println("Enter the Bank Manager Name ");
String bnk_mgr_Name=sc.nextLine();
System.out.println("Enter the Accountant Name ");
String Acct_name=sc.nextLine();
System.out.println("Enter the Security Guard Name ");
String Scrt_guardName=sc.nextLine();
System.out.println("Enter the IFSC Code ");
int ifsc_code=Integer.parseInt(sc.nextLine());
System.out.println("Enter the Date Of Joining ");
String sdt=sc.nextLine();
SimpleDateFormat format= new SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH);
System.out.println(sdt);
Date dt=new Date();
try {
dt = format.parse(sdt);
System.out.println(dt);
//create vo class Object..
SBIDetailsVO vo=null;
vo=new SBIDetailsVO();
vo.setAccountant_Name(Acct_name);
vo.setBank_Mgr_Name(bnk_mgr_Name);
vo.setBranch_Mgr_Name(brnch_mgr_Name);
vo.setIfsc_code(ifsc_code);
vo.setBranch_name(brnchName);
vo.setDoj(dt);
//create IOC container..
factory=new DefaultListableBeanFactory();
reader=new XmlBeanDefinitionReader(factory);
reader.loadBeanDefinitions("com/Infosys/SBI/Cfgs/ApplicationContext.xml");
ctrl=factory.getBean("SBIctrl",SBIDetailsController.class);
ctrl.registartion_SBIDetails(vo);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"sahooshree1@gmail.com"
] | sahooshree1@gmail.com |
66313135a601e68911ff406b81c5a69e5354c03e | 409f59cf63ddef73b000f0b9fa6ed52d3bb70d5e | /app/src/main/java/com/nagy/zsolt/luna/widget/WidgetProvider.java | 2a0da94d70f2f3a17a5f4f72a9e4dc95c2138137 | [] | no_license | nagyzsolt1989/Luna | e3d61a2c5b17052028392a03cb328044c540dbd4 | 541f2622e0d05f669f5992fff1b6079ad030d1a1 | refs/heads/master | 2020-03-23T20:47:46.978670 | 2018-08-25T19:13:16 | 2018-08-25T19:13:16 | 142,063,120 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,763 | java | package com.nagy.zsolt.luna.widget;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.RemoteViews;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.nagy.zsolt.luna.R;
import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Random;
public class WidgetProvider extends AppWidgetProvider {
private static final String ACTION_CLICK = "ACTION_CLICK";
private int widgetIdToUse;
private char currencySymbol;
@Override
public void onUpdate(Context context, final AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
// Get all ids
ComponentName thisWidget = new ComponentName(context,
WidgetProvider.class);
int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
for (int widgetId : allWidgetIds) {
widgetIdToUse = widgetId;
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
String mSelectedCoin = mPrefs.getString("WIDGET_SELECTED_COIN", "coin was not in shared preferences");
final String prefCurrency = mPrefs.getString("pref_currency_key", "USD");
if (prefCurrency.equals("USD")){
currencySymbol = '$';
}else if (prefCurrency.equals("EUR")){
currencySymbol = '€';
}
final RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
R.layout.widget_layout);
// Get the data from the rest service
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://min-api.cryptocompare.com/data/price?fsym=" + mSelectedCoin + "&tsyms=" + prefCurrency;
JsonObjectRequest jsObjRequest = new JsonObjectRequest(
Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.w("WidgetExample",
"Response => " + response.toString());
// Set the text\
try {
remoteViews.setTextViewText(R.id.widget_coin_price,
response.getString(prefCurrency).concat(" " + currencySymbol));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
appWidgetManager.updateAppWidget(widgetIdToUse, remoteViews);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// TODO Auto-generated method stub
Log.w("WidgetExample",
"Error => " + error.toString());
remoteViews.setTextViewText(R.id.widget_coin_price,
"Error => " + error.toString());
appWidgetManager.updateAppWidget(widgetIdToUse, remoteViews);
}
});
queue.add(jsObjRequest);
// Set the text
Picasso.get()
.load("https://www.cryptocompare.com/media/19633/btc.png")
.into(remoteViews, R.id.widget_imageview, new int[] {widgetId});
// remoteViews.setTextViewText(R.id.widget_coin_price, String.valueOf(number));
// Register an onClickListener
Intent intent = new Intent(context, WidgetProvider.class);
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews.setOnClickPendingIntent(R.id.widget_coin_price, pendingIntent);
appWidgetManager.updateAppWidget(widgetId, remoteViews);
}
}
} | [
"nagy.zsolt.1989@gmail.com"
] | nagy.zsolt.1989@gmail.com |
766e70836754c039a590a1a7bb9412f8dd5d4c9a | 72a2d0e1964f13a9382e7ec2d47b85da60433c57 | /app/src/main/java/com/btp/batchten/cdvsprototype/AnganwadiScreen.java | 7b4f2b20ef6b6246ea648e62cdf395f998889df5 | [] | no_license | ApoorvaCh/Vaxicare | 47f88270445bfc20a0ce19f8598aff237ab5f28f | a6b329b494610bbca5c3443d65b95d0fd2012a18 | refs/heads/master | 2020-03-23T10:24:55.770640 | 2018-07-19T14:45:18 | 2018-07-19T14:45:18 | 141,442,019 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 542 | java | package com.btp.batchten.cdvsprototype;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class AnganwadiScreen extends AppCompatActivity {
public void openMap(View view){
Intent i = new Intent(this, AnganwadiMap.class);
startActivity(i);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_anganwadi_screen);
}
}
| [
"chennuru.apoorva@gmail.com"
] | chennuru.apoorva@gmail.com |
32f7f63053fb87da42fa5403447c9450635c68ce | 08f3d24b0c2ff34000c933095792cde078692176 | /src/infra/modelo/heranca/AlunoBolsista.java | fde59762df856df5a0abd135a64e1b39ccfa6200 | [] | no_license | FlavioLimas/exercicio-jpa | 0e8375fa4aba662c5f1f8b20b6c1cb473640ca9a | bf194253a684aad46b416b6cdfc442e8a194d0a4 | refs/heads/master | 2023-06-29T20:13:40.716145 | 2021-08-06T01:48:20 | 2021-08-06T01:48:20 | 383,655,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 587 | java | package infra.modelo.heranca;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@Entity
@DiscriminatorValue("AL")
public class AlunoBolsista extends Aluno {
private double valorBolsa;
public AlunoBolsista() {
}
public AlunoBolsista(Long matricula, String nome, double valorBolsa) {
super(matricula, nome);
this.valorBolsa = valorBolsa;
}
public double getValorBolsa() {
return valorBolsa;
}
public void setValorBolsa(double valorBolsa) {
this.valorBolsa = valorBolsa;
}
}
| [
"flaviolima.s@live.com"
] | flaviolima.s@live.com |
1d5cdee703494000a72e706453fa091f0d4af17a | ff5f00be10ef21710493902d0ad334c556ac1221 | /pkuhit.iih.mr-impl/src/main/java/pkuhit/iih/mr/md/dao/auto/entity/_MdMrTpSeg.java | 5a22756eb1404d9811c16ae99c59c506fa01b1e8 | [] | no_license | sun-wangbaiyu/emr-code | 2ed323a682f42db1ce3c3c61c7680de2f80d6290 | 034f2a6a969b55ff97c8b8cdaff1e0c0615a0dc7 | refs/heads/master | 2020-05-16T09:14:30.758529 | 2017-11-19T03:31:40 | 2017-11-19T03:31:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,286 | java | package pkuhit.iih.mr.md.dao.auto.entity;
/** */
@javax.annotation.Generated(value = { "Doma", "1.35.0" }, date = "2017-01-01T01:49:38.352+0800")
public final class _MdMrTpSeg extends org.seasar.doma.jdbc.entity.AbstractEntityType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> {
static {
org.seasar.doma.internal.Artifact.validateVersion("1.35.0");
}
private static final _MdMrTpSeg __singleton = new _MdMrTpSeg();
/** the mrTpSegCd */
public final org.seasar.doma.jdbc.entity.AssignedIdPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $mrTpSegCd = new org.seasar.doma.jdbc.entity.AssignedIdPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "mrTpSegCd", "MR_TP_SEG_CD");
/** the mrTpCd */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $mrTpCd = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "mrTpCd", "MR_TP_CD", true, true);
/** the mrSegTpCd */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $mrSegTpCd = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "mrSegTpCd", "MR_SEG_TP_CD", true, true);
/** the sortNo */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $sortNo = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "sortNo", "SORT_NO", true, true);
/** the updCnt */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.math.BigInteger, java.lang.Object> $updCnt = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.math.BigInteger, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.math.BigInteger.class, org.seasar.doma.wrapper.BigIntegerWrapper.class, null, null, "updCnt", "UPD_CNT", true, true);
/** the crtTime */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.sql.Timestamp, java.lang.Object> $crtTime = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.sql.Timestamp, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.sql.Timestamp.class, org.seasar.doma.wrapper.TimestampWrapper.class, null, null, "crtTime", "CRT_TIME", true, true);
/** the crtUserId */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $crtUserId = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "crtUserId", "CRT_USER_ID", true, true);
/** the crtDeptCd */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $crtDeptCd = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "crtDeptCd", "CRT_DEPT_CD", true, true);
/** the lastUpdTime */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.sql.Timestamp, java.lang.Object> $lastUpdTime = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.sql.Timestamp, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.sql.Timestamp.class, org.seasar.doma.wrapper.TimestampWrapper.class, null, null, "lastUpdTime", "LAST_UPD_TIME", true, true);
/** the lastUpdDeptCd */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $lastUpdDeptCd = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "lastUpdDeptCd", "LAST_UPD_DEPT_CD", true, true);
/** the lastUpdUserId */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object> $lastUpdUserId = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.String, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.String.class, org.seasar.doma.wrapper.StringWrapper.class, null, null, "lastUpdUserId", "LAST_UPD_USER_ID", true, true);
/** the delF */
public final org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.Short, java.lang.Object> $delF = new org.seasar.doma.jdbc.entity.BasicPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, java.lang.Short, java.lang.Object>(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class, java.lang.Short.class, org.seasar.doma.wrapper.ShortWrapper.class, null, null, "delF", "DEL_F", true, true);
private final pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSegListener __listener;
private final org.seasar.doma.jdbc.entity.NamingType __namingType;
private final boolean __immutable;
private final String __catalogName;
private final String __schemaName;
private final String __tableName;
private final String __qualifiedTableName;
private final String __name;
private final java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __idPropertyTypes;
private final java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __entityPropertyTypes;
private final java.util.Map<String, org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __entityPropertyTypeMap;
private _MdMrTpSeg() {
__listener = new pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSegListener();
__namingType = org.seasar.doma.jdbc.entity.NamingType.NONE;
__immutable = false;
__name = "MdMrTpSeg";
__catalogName = "";
__schemaName = "";
__tableName = "MD_MR_TP_SEG";
__qualifiedTableName = "MD_MR_TP_SEG";
java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __idList = new java.util.ArrayList<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>>();
java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __list = new java.util.ArrayList<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>>(12);
java.util.Map<String, org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> __map = new java.util.HashMap<String, org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>>(12);
__idList.add($mrTpSegCd);
__list.add($mrTpSegCd);
__map.put("mrTpSegCd", $mrTpSegCd);
__list.add($mrTpCd);
__map.put("mrTpCd", $mrTpCd);
__list.add($mrSegTpCd);
__map.put("mrSegTpCd", $mrSegTpCd);
__list.add($sortNo);
__map.put("sortNo", $sortNo);
__list.add($updCnt);
__map.put("updCnt", $updCnt);
__list.add($crtTime);
__map.put("crtTime", $crtTime);
__list.add($crtUserId);
__map.put("crtUserId", $crtUserId);
__list.add($crtDeptCd);
__map.put("crtDeptCd", $crtDeptCd);
__list.add($lastUpdTime);
__map.put("lastUpdTime", $lastUpdTime);
__list.add($lastUpdDeptCd);
__map.put("lastUpdDeptCd", $lastUpdDeptCd);
__list.add($lastUpdUserId);
__map.put("lastUpdUserId", $lastUpdUserId);
__list.add($delF);
__map.put("delF", $delF);
__idPropertyTypes = java.util.Collections.unmodifiableList(__idList);
__entityPropertyTypes = java.util.Collections.unmodifiableList(__list);
__entityPropertyTypeMap = java.util.Collections.unmodifiableMap(__map);
}
@Override
public org.seasar.doma.jdbc.entity.NamingType getNamingType() {
return __namingType;
}
@Override
public boolean isImmutable() {
return __immutable;
}
@Override
public String getName() {
return __name;
}
@Override
public String getCatalogName() {
return __catalogName;
}
@Override
public String getSchemaName() {
return __schemaName;
}
@Override
public String getTableName() {
return __tableName;
}
@Override
public String getQualifiedTableName() {
return __qualifiedTableName;
}
@Override
public void preInsert(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PreInsertContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.preInsert(entity, context);
}
@Override
public void preUpdate(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PreUpdateContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.preUpdate(entity, context);
}
@Override
public void preDelete(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PreDeleteContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.preDelete(entity, context);
}
@Override
public void postInsert(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PostInsertContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.postInsert(entity, context);
}
@Override
public void postUpdate(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PostUpdateContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.postUpdate(entity, context);
}
@Override
public void postDelete(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg entity, org.seasar.doma.jdbc.entity.PostDeleteContext<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> context) {
__listener.postDelete(entity, context);
}
@Override
public java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> getEntityPropertyTypes() {
return __entityPropertyTypes;
}
@Override
public org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?> getEntityPropertyType(String __name) {
return __entityPropertyTypeMap.get(__name);
}
@Override
public java.util.List<org.seasar.doma.jdbc.entity.EntityPropertyType<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?>> getIdPropertyTypes() {
return __idPropertyTypes;
}
@Override
public org.seasar.doma.jdbc.entity.GeneratedIdPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?, ?> getGeneratedIdPropertyType() {
return null;
}
@Override
public org.seasar.doma.jdbc.entity.VersionPropertyType<java.lang.Object, pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg, ?, ?> getVersionPropertyType() {
return null;
}
@Override
public pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg newEntity() {
return new pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg();
}
@Override
public pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg newEntity(java.util.Map<String, Object> __args) {
return new pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg();
}
@Override
public Class<pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg> getEntityClass() {
return pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg.class;
}
@Override
public pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg getOriginalStates(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg __entity) {
return null;
}
@Override
public void saveCurrentStates(pkuhit.iih.mr.md.dao.auto.entity.MdMrTpSeg __entity) {
}
/**
* @return the singleton
*/
public static _MdMrTpSeg getSingletonInternal() {
return __singleton;
}
/**
* @return the new instance
*/
public static _MdMrTpSeg newInstance() {
return new _MdMrTpSeg();
}
}
| [
"149516374@qq.com"
] | 149516374@qq.com |
5bc43c54759b7bbe694f98501643e37938575ad2 | 78b0d70c825cfc8b91c750a9f56cdd78da456257 | /ASpringFinalProject/src/main/java/com/programsji/security/CustomRememberMeService.java | 1650935978e312e9c7615d9bd671a5505658adf4 | [] | no_license | rejwan052/smallExamples | 5be6365cc3a356d95580151bf27197e299576fd8 | e01e899cf4ff5392e12bb654cfe38620a92e1221 | refs/heads/master | 2021-06-21T15:36:57.038274 | 2017-08-02T08:11:49 | 2017-08-02T08:11:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package com.programsji.security;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices;
import org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationException;
import org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices;
public class CustomRememberMeService extends TokenBasedRememberMeServices {
public CustomRememberMeService() {
// TODO Auto-generated constructor stub
}
}
| [
"dhruti@rohit"
] | dhruti@rohit |
65522bdcaf5fd2c96dd510a94d7162447cf17947 | dea04aa4c94afd38796e395b3707d7e98b05b609 | /Participant results/P33/Interaction-8/ArrayIntList_ES_0_Test.java | 0303ac96367b61efb8a0fd8e0293a53b8da8de80 | [] | no_license | PdedP/InterEvo-TR | aaa44ef0a4606061ba4263239bafdf0134bb11a1 | 77878f3e74ee5de510e37f211e907547674ee602 | refs/heads/master | 2023-04-11T11:51:37.222629 | 2023-01-09T17:37:02 | 2023-01-09T17:37:02 | 486,658,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 873 | java | /*
* This file was automatically generated by EvoSuite
* Wed Jul 27 10:26:49 GMT 2022
*/
package com.org.apache.commons.collections.primitives;
import org.junit.Test;
import static org.junit.Assert.*;
import com.org.apache.commons.collections.primitives.ArrayIntList;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class ArrayIntList_ES_0_Test extends ArrayIntList_ES_0_Test_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
ArrayIntList arrayIntList0 = new ArrayIntList(0);
arrayIntList0.ensureCapacity(0);
assertEquals(0, arrayIntList0.size());
}
}
| [
"pedro@uca.es"
] | pedro@uca.es |
61d0b451ad539b342a70a94cfae3fb2a7f2668ee | 7d2e0c0f71e0b704c5c4ffa806d0566f928ee5b1 | /src/GraphException.java | 46c328c97feaed1fbf6d4409e7d30fc43139a50e | [] | no_license | jman122/DFS-Traversal | 2936106ded9017d491dfb98169b82d944f62368e | b0b8a21f2ac15a70dda0573a9d4422f784450a3f | refs/heads/master | 2020-12-15T16:02:12.574444 | 2020-01-20T18:36:29 | 2020-01-20T18:36:29 | 235,161,813 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 167 | java | /**
* GraphException.java
* @author Jia Yu Man
*/
public class GraphException extends RuntimeException{
public GraphException() {
super("Graph error");
}
}
| [
"noreply@github.com"
] | noreply@github.com |
03e62bded43ade1cd1771efc1ad4c2d8ee68b5b5 | 330749a1267fc32d287fcc428cfc8e7fbe3f4daa | /src/strategyPattern/example_2/StudentDiscountStrategy.java | b5785f6dfb8e0f84e8912599be8afbab792d9666 | [] | no_license | smallpocket/java-DesignPatterns | 5be53bd354ff0a4a48b87ecc5b79b158296cbeaa | adde5276a5b771c2d2fad7bc547850de0cf0be6d | refs/heads/master | 2020-03-31T08:10:01.034353 | 2019-07-22T05:53:18 | 2019-07-22T05:53:18 | 152,048,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package strategyPattern.example_2;
/**
* @Author : yangfan
* @Date : 2019/7/17 13:20
* @Description :
*/
public class StudentDiscountStrategy implements DiscountStrategy {
@Override
public double calculate(double price) {
System.out.println("学生票:");
return price * 0.8;
}
}
| [
"yangfan09121@hellobike.com"
] | yangfan09121@hellobike.com |
eb0015432ccc8d39d993150b3ec1412fa73b2c36 | 3128688c84fb1a2d5e270b3524b44579fc25dcf3 | /asdasdasdasd/src/shiningDarkness/AnaliseErgo.java | e109a2405f2751d2cee5939221691543f2adc13a | [] | no_license | PRETO-BRANCO/Teste_Automatizado | 1c41194b78e32270fa6129b37f90ffb5d7fb652f | 0d15e49142a3e4af4c2151143cf4f32165fbf482 | refs/heads/master | 2020-12-22T17:29:08.882024 | 2020-01-29T00:54:32 | 2020-01-29T00:54:32 | 236,873,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,577 | java | package shiningDarkness;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
public class AnaliseErgo {
private WebDriver driver;
private WebDriverWait wdw;
private Signal horizon;
private String ed;
private Actions act;
private String unidade;
private JavascriptExecutor js;
private QuestArg quest;
private String quest1;
private String quest2;
private String quest3;
private Cargo cargo;
private String car;
public AnaliseErgo(WebDriver driver, WebDriverWait wdw,Signal horizon,String ed,String unidade,Long starttime) {
this.driver = driver;
this.wdw = wdw;
this.horizon = horizon;
this.ed = ed;
this.unidade = unidade;
this.act = new Actions(driver);
js = (JavascriptExecutor) driver;
quest = new QuestArg(driver, wdw, horizon, starttime, ed);
quest.criar();
quest.criar();
quest.criar();
quest1 = quest.getCat();
quest = new QuestArg(driver, wdw, horizon, starttime, ed);
quest.criar();
quest.criar();
quest.criar();
quest2 = quest.getCat();
quest = new QuestArg(driver, wdw, horizon, starttime, ed);
quest.criar();
quest.criar();
quest.criar();
quest3 = quest.getCat();
cargo = new Cargo(driver, wdw, horizon, starttime, ed);
car = cargo.criar();
}
public void criar() {
this.driver.get("https://"+ ed +".apollusehs.com.br/apollus/views/hoe/analise/");
this.horizon.waitLoad();
this.driver.findElement(By.xpath("//a [@ui-sref='analise']")).click();
this.horizon.waitLoad();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary pull-right bt-novo']")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("ac-area1-cadastro"))));
driver.findElement(By.id("ac-area1-cadastro")).sendKeys(unidade);
List<WebElement> lista = driver.findElements(By.xpath("//li [contains(@class,'ui-menu-item')]"));
lista.get(0).click();
this.horizon.waitLoad();
driver.findElement(By.id("ac-area2-cadastro")).sendKeys("a");
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//li [contains(@class,'ui-menu-item')]"));
lista.get(1).click();
this.horizon.waitLoad();
driver.findElement(By.id("ac-area3-cadastro")).sendKeys("s");
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//li [contains(@class,'ui-menu-item')]"));
lista.get(2).click();
this.horizon.waitLoad();
driver.findElement(By.id("ac-cargo")).sendKeys(car);
this.horizon.waitLoad();
this.horizon.sleep(350);
act.moveToElement(driver.findElement(By.xpath("//li [contains(text(),'" + car +"')]"))).click().perform();
this.horizon.waitLoad();
driver.findElement(By.id("i-ghe")).sendKeys(this.horizon.generateString(20));
driver.findElement(By.id("i-funcao")).clear();
driver.findElement(By.id("i-funcao")).sendKeys(this.horizon.generateString(25));
driver.findElement(By.id("i-jornada-revezamento")).clear();
driver.findElement(By.id("i-jornada-revezamento")).sendKeys(this.horizon.generateString(30));
driver.findElement(By.id("i-situacao-posto")).sendKeys(this.horizon.generateString(100));
driver.findElement(By.id("ta-atividades")).sendKeys(this.horizon.generateString(5000));
driver.findElement(By.id("li-checklist")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']"))));
lista = driver.findElements(By.xpath("//input [@ng-model='categoria.itemSelecionado']"));
for(int i=0; i<lista.size(); i++) {
act.moveToElement(lista.get(i)).click().perform();
}
act.moveToElement(driver.findElement(By.xpath("//span [contains(text(),'" + quest1 +"')]"))).click().perform();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']")).click();
this.horizon.waitLoad();
lista = driver.findElements(By.xpath("//select [contains(@id,'cb-variavel-')]"));
for(int i = 0;i<lista.size();i++) {
Select slek = new Select(lista.get(i));
List<WebElement> op = slek.getOptions();
slek.selectByIndex(ThreadLocalRandom.current().nextInt(1,op.size()));
if(i==2) {
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
}
}
js.executeScript("window.scrollTo(0, 0)");
driver.findElement(By.id("bt-adicionar-categoria")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']"))));
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//input [@ng-model='categoria.itemSelecionado']"));
for(int i=0; i<lista.size(); i++) {
act.moveToElement(lista.get(i)).click().perform();
}
act.moveToElement(driver.findElement(By.xpath("//span [contains(text(),'" + quest2 +"')]"))).click().perform();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//span [contains(text(),'" + quest2 +"')]"))));
this.horizon.sleep(350);
driver.findElement(By.xpath("//li [@class='ng-scope']")).click();
this.horizon.waitLoad();
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//select [contains(@id,'cb-variavel-')]"));
for(int i = 0;i<lista.size();i++) {
Select slek = new Select(lista.get(i));
List<WebElement> op = slek.getOptions();
slek.selectByIndex(ThreadLocalRandom.current().nextInt(1,op.size()));
if(i==2) {
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
}
}
driver.findElement(By.id("li-recomendacoes")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//li [@ng-click='onSelecionaRecomendacao(categoriaQuestao)']"))));
lista = driver.findElements(By.xpath("//li [@class='ng-scope']"));
lista.get(1).click();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary pull-right lb-rascunho']")).click();
this.horizon.waitLoad();
}
public void editar() {
this.driver.get("https://"+ ed +".apollusehs.com.br/apollus/views/hoe/analise/");
this.horizon.waitLoad();
this.driver.findElement(By.xpath("//a [@ui-sref='analise']")).click();
this.horizon.waitLoad();
driver.findElement(By.id("ac-area1-filtro")).sendKeys(unidade);
List<WebElement> lista = driver.findElements(By.xpath("//li [contains(@class,'ui-menu-item')]"));
lista.get(0).click();
this.horizon.waitLoad();
driver.findElement(By.xpath("//button [@class='btn btn-primary tooltip-top bt-pesquisar']")).click();
this.horizon.waitLoad();
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//tr [contains(@class,'ng-scope')]"));
act.moveToElement(lista.get(0)).doubleClick().perform();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("ac-area1-cadastro"))));
this.horizon.sleep(500);
this.horizon.waitLoad();
driver.findElement(By.id("i-ghe")).sendKeys(this.horizon.generateString(20));
driver.findElement(By.id("i-funcao")).sendKeys(this.horizon.generateString(25));
driver.findElement(By.id("i-jornada-revezamento")).sendKeys(this.horizon.generateString(30));
driver.findElement(By.id("i-situacao-posto")).sendKeys(this.horizon.generateString(100));
driver.findElement(By.id("ta-atividades")).sendKeys(this.horizon.generateString(5000));
driver.findElement(By.id("li-checklist")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//li [@class='ng-scope']"))));
driver.findElement(By.xpath("//button [@ng-click='onClickBtnExcluirCategoria()']")).click();
this.wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("bt-excluir-sim-analise"))));
this.driver.findElement(By.id("bt-excluir-sim-analise")).click();
this.horizon.waitLoad();
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
try{
wdw.until(ExpectedConditions.invisibilityOf(driver.findElement(By.xpath("//div [@class='modal-backdrop fade']"))));
}
catch(Exception e){
}
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
js.executeScript("window.scrollTo(0, 0)");
driver.findElement(By.id("bt-adicionar-categoria")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']"))));
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//input [@ng-model='categoria.itemSelecionado']"));
for(int i=0; i<lista.size(); i++) {
act.moveToElement(lista.get(i)).click().perform();
}
act.moveToElement(driver.findElement(By.xpath("//span [contains(text(),'" + quest3 +"')]"))).click().perform();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary lb-salvar']")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//span [contains(text(),'" + quest3 +"')]"))));
this.horizon.sleep(350);
driver.findElement(By.xpath("//li [@class='ng-scope']")).click();
this.horizon.waitLoad();
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//select [contains(@id,'cb-variavel-')]"));
for(int i = 0;i<lista.size();i++) {
Select slek = new Select(lista.get(i));
List<WebElement> op = slek.getOptions();
slek.selectByIndex(ThreadLocalRandom.current().nextInt(1,op.size()));
if(i==2) {
js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
}
}
driver.findElement(By.id("li-recomendacoes")).click();
wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//li [@ng-click='onSelecionaRecomendacao(categoriaQuestao)']"))));
lista = driver.findElements(By.xpath("//li [@class='ng-scope']"));
lista.get(1).click();
driver.findElement(By.xpath("//button [@class='btn btn-sm btn-primary pull-right lb-salvar']")).click();
this.horizon.waitLoad();
}
public void excluir() {
this.driver.get("https://"+ ed +".apollusehs.com.br/apollus/views/hoe/analise/");
this.horizon.waitLoad();
this.driver.findElement(By.xpath("//a [@ui-sref='analise']")).click();
this.horizon.waitLoad();
driver.findElement(By.id("ac-area1-filtro")).sendKeys(unidade);
List<WebElement> lista = driver.findElements(By.xpath("//li [contains(@class,'ui-menu-item')]"));
lista.get(0).click();
this.horizon.waitLoad();
driver.findElement(By.xpath("//button [@class='btn btn-primary tooltip-top bt-pesquisar']")).click();
this.horizon.waitLoad();
this.horizon.sleep(350);
lista = driver.findElements(By.xpath("//tr [contains(@class,'ng-scope')]"));
act.moveToElement(lista.get(0)).click().perform();
this.driver.findElement(By.xpath("//button [@class='btn btn-sm btn-default pull-right bt-excluir']")).click();
this.wdw.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("bt-excluir-sim-analise"))));
this.driver.findElement(By.id("bt-excluir-sim-analise")).click();
this.horizon.waitLoad();
for(int i = 0;i<9;i++) {
quest.excluir();
this.horizon.waitLoad();
}
for(int i = 0;i<3;i++) {
quest.excat();
this.horizon.waitLoad();
}
driver.get("https://desenvolvimento.apollusehs.com.br/apollus/views/cadastro/geral/cargo.html");
this.horizon.waitLoad2();
cargo.excluir();
}
}
| [
"preto.gustavo@outlook.com"
] | preto.gustavo@outlook.com |
bf17518791680ed0adf4966ade06ac5db749bc1a | 6b43d7f3731d473591a320cee0664fc39bebe6c4 | /src/com/gravical/bwell/models/Sessions.java | 452c110dbfcae01b5cc00b4819c969764aa1c988 | [] | no_license | energyscholar/GravicalBWell | 7ebfdc59bfe7bf759ba3580d8ae81154618fc4bc | c917e675a602647c9897ea91d982efba3dfeb4d7 | refs/heads/master | 2020-12-30T10:12:43.346157 | 2013-02-19T10:00:27 | 2013-02-19T10:00:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,723 | java | package com.gravical.bwell.models;
// Generated 19-Feb-2013 01:44:26 by Hibernate Tools 3.2.1.GA
import java.util.Date;
/**
* Sessions generated by hbm2java
*/
public class Sessions implements java.io.Serializable {
private int sessionId;
private Date sessionStart;
private Date sessionEnd;
private int sessionInitiator;
private int sessionParticipant1Id;
private int sessionParticipant2Id;
private int sessionParticipant3Id;
private String sessionDescription;
private String sessionSummary;
public Sessions() {
}
public Sessions(int sessionId, Date sessionStart, int sessionInitiator, int sessionParticipant1Id, int sessionParticipant2Id, int sessionParticipant3Id, String sessionDescription, String sessionSummary) {
this.sessionId = sessionId;
this.sessionStart = sessionStart;
this.sessionInitiator = sessionInitiator;
this.sessionParticipant1Id = sessionParticipant1Id;
this.sessionParticipant2Id = sessionParticipant2Id;
this.sessionParticipant3Id = sessionParticipant3Id;
this.sessionDescription = sessionDescription;
this.sessionSummary = sessionSummary;
}
public Sessions(int sessionId, Date sessionStart, Date sessionEnd, int sessionInitiator, int sessionParticipant1Id, int sessionParticipant2Id, int sessionParticipant3Id, String sessionDescription, String sessionSummary) {
this.sessionId = sessionId;
this.sessionStart = sessionStart;
this.sessionEnd = sessionEnd;
this.sessionInitiator = sessionInitiator;
this.sessionParticipant1Id = sessionParticipant1Id;
this.sessionParticipant2Id = sessionParticipant2Id;
this.sessionParticipant3Id = sessionParticipant3Id;
this.sessionDescription = sessionDescription;
this.sessionSummary = sessionSummary;
}
public int getSessionId() {
return this.sessionId;
}
public void setSessionId(int sessionId) {
this.sessionId = sessionId;
}
public Date getSessionStart() {
return this.sessionStart;
}
public void setSessionStart(Date sessionStart) {
this.sessionStart = sessionStart;
}
public Date getSessionEnd() {
return this.sessionEnd;
}
public void setSessionEnd(Date sessionEnd) {
this.sessionEnd = sessionEnd;
}
public int getSessionInitiator() {
return this.sessionInitiator;
}
public void setSessionInitiator(int sessionInitiator) {
this.sessionInitiator = sessionInitiator;
}
public int getSessionParticipant1Id() {
return this.sessionParticipant1Id;
}
public void setSessionParticipant1Id(int sessionParticipant1Id) {
this.sessionParticipant1Id = sessionParticipant1Id;
}
public int getSessionParticipant2Id() {
return this.sessionParticipant2Id;
}
public void setSessionParticipant2Id(int sessionParticipant2Id) {
this.sessionParticipant2Id = sessionParticipant2Id;
}
public int getSessionParticipant3Id() {
return this.sessionParticipant3Id;
}
public void setSessionParticipant3Id(int sessionParticipant3Id) {
this.sessionParticipant3Id = sessionParticipant3Id;
}
public String getSessionDescription() {
return this.sessionDescription;
}
public void setSessionDescription(String sessionDescription) {
this.sessionDescription = sessionDescription;
}
public String getSessionSummary() {
return this.sessionSummary;
}
public void setSessionSummary(String sessionSummary) {
this.sessionSummary = sessionSummary;
}
}
| [
"energyscholar@gmail.com"
] | energyscholar@gmail.com |
3990ed5a7a9ef54f85453d0cc6d5e07b7a56d366 | 222c56bda708da134203560d979fb90ba1a9da8d | /uapunit测试框架/bpmn/src/public/uap/workflow/bpmn2/model/FlowElement.java | 7786b89a926d85ea36d956facbf1ccf2135e0b85 | [] | no_license | langpf1/uapunit | 7575b8a1da2ebed098d67a013c7342599ef10ced | c7f616bede32bdc1c667ea0744825e5b8b6a69da | refs/heads/master | 2020-04-15T00:51:38.937211 | 2013-09-13T04:58:27 | 2013-09-13T04:58:27 | 12,448,060 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package uap.workflow.bpmn2.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import uap.workflow.bpmn2.annotation.TypeChangeMonitor;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FlowElement", propOrder = { "name" })
public class FlowElement extends BaseElement {
private static final long serialVersionUID = 5964455577899828530L;
@TypeChangeMonitor("name")
@XmlAttribute
public String name;
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String toString() {
return name;
}
} | [
"langpf1@yonyou.com"
] | langpf1@yonyou.com |
ce0dc34999d0fbbeb9a566cdd131bf326ba303b8 | 386cffb77ffbdbe2f4ce4b7f93e301a76e7ba294 | /src/edu/kpi/nesteruk/pzcs/model/primitives/IdAndValue.java | c48244a327bc5e2778c5f6fc7c628070adf5c824 | [] | no_license | yurkesh/PZCS2 | 925a7415d2af047e7f7734fa83a75c9d879963bc | 61cdf653088680d06a465a3d13ff78b37207490d | refs/heads/master | 2020-12-29T02:42:32.234435 | 2017-01-22T15:33:19 | 2017-01-22T15:33:19 | 53,532,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 840 | java | package edu.kpi.nesteruk.pzcs.model.primitives;
/**
* Created by Yurii on 2016-03-13.
*/
public class IdAndValue {
public final String id;
public final String value;
public IdAndValue(String id, String value) {
this.id = id;
this.value = value;
}
@Override
public String toString() {
return "IdAndValue{" +
"id='" + id + '\'' +
", value='" + value + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IdAndValue that = (IdAndValue) o;
return id != null ? id.equals(that.id) : that.id == null;
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
}
| [
"yuriy.nesteruk@yandex.ru"
] | yuriy.nesteruk@yandex.ru |
11407a56c655b03523ddea8c0980d28ec72409e1 | 4d893f7f59c38d703f90f1509944407862c8d0e9 | /app/src/main/java/com/example/zxg/myprogram/netapi/requestutil/CallBack.java | f0efadb630d87105df73a192f206488ab1f10c3b | [] | no_license | thedayisantherday/myProgram | b96b6d36c7974c22d18808ea51dbab145cda407c | e0bd8b778bbcf9a39f224ad79d90fdf14326f456 | refs/heads/master | 2023-09-06T05:27:18.195049 | 2023-08-25T07:36:09 | 2023-08-25T07:36:09 | 143,838,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package com.example.zxg.myprogram.netapi.requestutil;
/**
* 回调
* Created by zxg on 2016/10/2.
* QQ:1092885570
*/
public abstract class CallBack {
public abstract void onSucceed(String strJson);
public abstract void onFailed();
}
| [
"1092885570@qq.com"
] | 1092885570@qq.com |
5f4a0f854af81bbb403ab5fcf228f4b8b8407fb3 | 958b13739d7da564749737cb848200da5bd476eb | /src/main/java/com/alipay/api/domain/RepayDetailVO.java | 7e0a9a6a6eac7dfb34df93ad4c1f14d0efa0894c | [
"Apache-2.0"
] | permissive | anywhere/alipay-sdk-java-all | 0a181c934ca84654d6d2f25f199bf4215c167bd2 | 649e6ff0633ebfca93a071ff575bacad4311cdd4 | refs/heads/master | 2023-02-13T02:09:28.859092 | 2021-01-14T03:17:27 | 2021-01-14T03:17:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,595 | java | package com.alipay.api.domain;
import java.util.Date;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 还款流水明细
*
* @author auto create
* @since 1.0, 2018-11-13 11:12:09
*/
public class RepayDetailVO extends AlipayObject {
private static final long serialVersionUID = 5754378116443138991L;
/**
* 归还利息
*/
@ApiField("paid_int_amt")
private String paidIntAmt;
/**
* 归还逾期利息
*/
@ApiField("paid_ovd_int_amt")
private String paidOvdIntAmt;
/**
* 归还逾期利息罚息
*/
@ApiField("paid_ovd_int_penalty_amt")
private String paidOvdIntPenaltyAmt;
/**
* 归还逾期本金
*/
@ApiField("paid_ovd_prin_amt")
private String paidOvdPrinAmt;
/**
* 归还逾期本金罚息
*/
@ApiField("paid_ovd_prin_penalty_amt")
private String paidOvdPrinPenaltyAmt;
/**
* 归还本金
*/
@ApiField("paid_prin_amt")
private String paidPrinAmt;
/**
* 还款总金额
*/
@ApiField("repay_amt_total")
private String repayAmtTotal;
/**
* 还款时间
*/
@ApiField("repay_date")
private Date repayDate;
public String getPaidIntAmt() {
return this.paidIntAmt;
}
public void setPaidIntAmt(String paidIntAmt) {
this.paidIntAmt = paidIntAmt;
}
public String getPaidOvdIntAmt() {
return this.paidOvdIntAmt;
}
public void setPaidOvdIntAmt(String paidOvdIntAmt) {
this.paidOvdIntAmt = paidOvdIntAmt;
}
public String getPaidOvdIntPenaltyAmt() {
return this.paidOvdIntPenaltyAmt;
}
public void setPaidOvdIntPenaltyAmt(String paidOvdIntPenaltyAmt) {
this.paidOvdIntPenaltyAmt = paidOvdIntPenaltyAmt;
}
public String getPaidOvdPrinAmt() {
return this.paidOvdPrinAmt;
}
public void setPaidOvdPrinAmt(String paidOvdPrinAmt) {
this.paidOvdPrinAmt = paidOvdPrinAmt;
}
public String getPaidOvdPrinPenaltyAmt() {
return this.paidOvdPrinPenaltyAmt;
}
public void setPaidOvdPrinPenaltyAmt(String paidOvdPrinPenaltyAmt) {
this.paidOvdPrinPenaltyAmt = paidOvdPrinPenaltyAmt;
}
public String getPaidPrinAmt() {
return this.paidPrinAmt;
}
public void setPaidPrinAmt(String paidPrinAmt) {
this.paidPrinAmt = paidPrinAmt;
}
public String getRepayAmtTotal() {
return this.repayAmtTotal;
}
public void setRepayAmtTotal(String repayAmtTotal) {
this.repayAmtTotal = repayAmtTotal;
}
public Date getRepayDate() {
return this.repayDate;
}
public void setRepayDate(Date repayDate) {
this.repayDate = repayDate;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
fd3f32dd3ad162d50130828f4bc2b489792d47e3 | eeef8727187b913d405616a49e835a1345bbe0bf | /src/localhost/biblioteca/dao/LivroDAO.java | 96bdf2f08eaf6eb566ffaec79d9c78b2d1c6c83b | [
"Apache-2.0"
] | permissive | diverproject/Biblioteca | 071282d9330cb1be7e81405680b45d8bd2e9fa23 | 076fb9dd9396a977a7c3f5fd732d587a6ce546ec | refs/heads/master | 2016-08-05T20:24:18.739542 | 2014-11-07T18:13:55 | 2014-11-07T18:13:55 | 25,780,492 | 0 | 0 | Apache-2.0 | 2018-10-26T17:33:59 | 2014-10-26T16:23:06 | Java | UTF-8 | Java | false | false | 5,838 | java | package localhost.biblioteca.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import localhost.biblioteca.core.Biblioteca;
import localhost.biblioteca.core.Mysql;
import localhost.biblioteca.core.Sql;
import localhost.biblioteca.entidades.Livro;
public class LivroDAO extends AbstractDao<Livro>
{
public LivroDAO(HttpServletRequest request)
{
super(request);
}
@Override
public String validar(Livro livro)
{
if (!validarPaginas(livro))
return "número de páginas inválida";
if (!validarTradutor(livro))
return "tradutor inválido";
if (!validarIsbn(livro))
return "isbn inválido";
return null;
}
public boolean validarPaginas(Livro livro)
{
if (livro.getPaginas() > 10)
return true;
if (livro.getPaginas() < 3000)
return false;
return true;
}
public boolean validarTradutor(Livro livro)
{
if (livro.getTradutor() == null)
return true;
if (livro.getTradutor().length() == 0)
return false;
if (livro.getTradutor().length() < 3)
return false;
if (livro.getTradutor().length() > 48)
return false;
return true;
}
public boolean validarIsbn(Livro livro)
{
if (livro.getIsbn() == null)
return false;
if (livro.getIsbn().length() != 13)
return false;
return true;
}
@Override
public int proximo()
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "SELECT auto_increment FROM information_schema.tables WHERE table_schema = 'biblioteca' AND table_name = 'livros'";
PreparedStatement ps = connection.prepareStatement(query);
ResultSet result = ps.executeQuery();
if (result.next())
return result.getInt("auto_increment");
else
return 1;
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return 0;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return 0;
}
}
@Override
public boolean inserir(Livro livro)
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "INSERT INTO livros (paginas, tradutor, isbn) VALUES (?, ?, ?)";
PreparedStatement ps = connection.prepareStatement(query);
ps.setInt(1, livro.getPaginas());
ps.setString(2, livro.getTradutor());
ps.setString(3, livro.getIsbn());
return ps.executeUpdate() != PreparedStatement.EXECUTE_FAILED;
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return false;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return false;
}
}
@Override
public boolean atualizar(Livro livro)
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "UPDATE livros SET paginas = ?, tradutor = ?, isbn = ? WHERE id = ?";
PreparedStatement ps = connection.prepareStatement(query);
ps.setInt(1, livro.getPaginas());
ps.setString(2, livro.getTradutor());
ps.setString(3, livro.getIsbn());
ps.setInt(4, livro.getId());
return ps.executeUpdate() != PreparedStatement.EXECUTE_FAILED;
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return false;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return false;
}
}
@Override
public boolean remover(Livro livro)
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "DELETE FROM livros WHERE id = ?";
PreparedStatement ps = connection.prepareStatement(query);
ps.setInt(1, livro.getId());
return ps.executeUpdate() != PreparedStatement.EXECUTE_FAILED;
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return false;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return false;
}
}
@Override
public boolean truncar()
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "TRUNCATE livros";
PreparedStatement ps = connection.prepareStatement(query);
return ps.executeUpdate() != PreparedStatement.EXECUTE_FAILED;
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return false;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return false;
}
}
public Livro selecionar(int id)
{
try {
Sql sql = new Mysql();
Connection connection = sql.getConnection();
String query = "SELECT * FROM livros WHERE id = ?";
PreparedStatement ps = connection.prepareStatement(query);
ps.setInt(1, id);
ResultSet result = ps.executeQuery();
if (!result.next())
return null;
return new Livro()
.setPaginas(result.getInt("paginas"))
.setTradutor(result.getString("tradutor"))
.setIsbn(result.getString("isbn"));
} catch (SQLException e) {
Biblioteca.alert(request, "exception", "SQLException (%s)", e.getMessage());
return null;
} catch (ClassNotFoundException e) {
Biblioteca.alert(request, "exception", "ClassNotFoundException (%s)", e.getMessage());
return null;
}
}
}
| [
"driwfs@hotmail.com"
] | driwfs@hotmail.com |
1a88f5e24b79c40c8786bc62890c771d9d7025e2 | 83593598f21cba234f08eca4dec44d2f73a6052d | /prj/otc/web-tradeweb-otc/src/main/java/gnnt/MEBS/timebargain/tradeweb/webapp/filter/SetCharacterEncodingFilter.java | 9001de6ca26f64120ec45c21e55aeeb726d963bb | [
"Apache-2.0"
] | permissive | bigstar18/prjs | 23a04309a51b0372ddf6c391ee42270e640ec13c | c29da4d0892ce43e074d9e9831f1eedf828cd9d8 | refs/heads/master | 2021-05-31T19:55:16.217893 | 2016-06-24T02:35:31 | 2016-06-24T02:35:31 | 42,025,473 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package gnnt.MEBS.timebargain.tradeweb.webapp.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class SetCharacterEncodingFilter
implements Filter
{
public void init(FilterConfig arg0)
throws ServletException
{}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
request.setCharacterEncoding("GBK");
chain.doFilter(request, response);
}
public void destroy() {}
}
| [
"hxx@hxx-PC"
] | hxx@hxx-PC |
0a34f78ddae0864dcc207ddf1436c1f2463dfb2e | e498ea268e52a7683597375c6f2cfe8ff2c0b949 | /multithread-demo/src/main/java/com/baoli/thread/lock/SearchMatrixDemo.java | f1aabb914391742169f68079f21743935d1e4a98 | [] | no_license | lilybao/common-demo | e2ee53d36af65d3130ddae83262bc9bdd5f900de | 00f3a5f008c7111ffbf3f98bc38035b6fa814e4a | refs/heads/master | 2022-06-22T17:13:39.584178 | 2020-05-29T09:57:28 | 2020-05-29T09:57:28 | 230,351,579 | 1 | 0 | null | 2022-06-21T04:03:39 | 2019-12-27T01:28:44 | Java | UTF-8 | Java | false | false | 3,409 | java | package com.baoli.thread.lock;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
/**
* @program: common-demo
* @description: 获取二维 m*n 纵向横向递增矩阵的值是否存在
* @author: li baojian
* @create: 2020-04-09 10:37
*/
public class SearchMatrixDemo {
public static void main(String[] args) {
int target=20;
int[][] matrix = {{1, 4, 7, 11, 15}, {2, 5, 8, 12, 19}, {3, 6, 9, 16, 22}, {10, 13, 14, 17, 24}, {18, 21, 23, 26, 30}};
// int[][] matrix = {{15}};
// boolean a = searchMatrix(matrix,target);
// boolean a = searchMatrix1(matrix,target);
boolean a = binarySearchMatrix(matrix,target);
System.out.println(a);
}
//时间复杂度 O(m+n)
private static boolean searchMatrix1(int[][] matrix, int target) {
int col=0;
int row=matrix.length-1;
while (row>=0&&col<matrix[0].length){
if(matrix[row][col]<target){
col++;
}else if(matrix[row][col]>target){
row--;
}else {
return true;
}
}
return false;
}
//二分查找 时间复杂度 O(log n)
//本次查找的时间复杂度 k=min(m,n) O((logk+logk-1..)*2)=O(log(k!)*2)
private static boolean binarySearchMatrix(int[][] matrix, int target) {
if(matrix==null||matrix.length==0){
return false;
}
int shortdim=Math.min(matrix.length,matrix[0].length);
for (int i = 0; i < shortdim; i++) {
boolean rowBoolean=bianrySearch(matrix,i,target,true);
boolean colBoolean=bianrySearch(matrix,i,target,false);
if(rowBoolean||colBoolean){
return true;
}
}
HashMap<Object, Object> map = new HashMap<>();
ConcurrentHashMap<Object, Object> map1 = new ConcurrentHashMap<>();
map1.put("","");
map1.get("");
map.put("","");
return false;
}
private static boolean bianrySearch(int[][] matrix, int start, int target, boolean isRow) {
int lo=start;
int hi=isRow?matrix[0].length-1:matrix.length-1;
while (hi>=lo){
int mid =(hi+lo)/2;
if(isRow){
if(target>matrix[start][mid]){
lo=mid+1;
}else if(target<matrix[start][mid]){
hi=mid-1;
}else {
return true;
}
}else {
if(target>matrix[mid][start]){
lo=mid+1;
}else if(target<matrix[mid][start]){
hi=mid-1;
}else {
return true;
}
}
}
return false;
}
private static boolean searchMatrix(int[][] matrix, int target) {
int m=matrix.length;
if(m==0){
return false;
}
int n=matrix[0].length;
for (int i = m-1; i >=0 ; i--) {
for (int j = 0; j <=n-1 ; j++) {
if(matrix[i][j]==target){
return true;
}
if(matrix[i][j]<target){
continue;
}
if(matrix[i][j]>target){
break;
}
}
}
return false;
}
}
| [
"752415416@qq.com"
] | 752415416@qq.com |
8acb7815872aed083b4171a1e933303d56c3df02 | c359499370c20ee4b149b82452095d9950fd5eb9 | /src/Core/Main.java | 855410ef3e30177b5fe88861ba738d4d1bb7f612 | [] | no_license | WolfgangBischoff/SeGame | 8aab128cc80f3661f7899cc5149b11db2e5f5839 | 39e1b9693db86774e48a8699d4377bc8f4ddde39 | refs/heads/master | 2022-02-27T13:17:14.223830 | 2019-08-29T14:52:12 | 2019-08-29T14:52:12 | 107,113,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package Core;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application
{
// https://stackoverflow.com/questions/33494052/javafx-redirect-console-output-to-textarea-that-is-created-in-scenebuilder
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage gameWindow) throws IOException
{
Simulation simulation = Simulation.getSingleton();
//Console Window
Stage consoleWindow = new Stage();
consoleWindow.setTitle("SeGame Console");
consoleWindow.setScene(new Scene(simulation.getConsole()));
consoleWindow.show();
//Parent gameroot = FXMLLoader.load(getClass().getResource("../../resources/fxml/mainMenu.fxml"));
//Scene gamescene = new Scene(gameroot, 300,275);
//gameWindow.setScene(gamescene);
GuiSociety guiSociety = new GuiSociety();
GuiPersonGrid guiPersonGrid = new GuiPersonGrid(new Person(new PersonName("Hans Hubertus"), 42, EducationalLayer.fromInt(2),12345));
gameWindow.setScene(new Scene(guiSociety,600,400 ));
gameWindow.setTitle("SeGame");
gameWindow.show();
}
}
| [
"wolfgang.bischoff@outlook.at"
] | wolfgang.bischoff@outlook.at |
d98d173fae48b3f7e41fbf620732cc3e8b6bef7a | e9f671edda745b666d0297431c94a67304de6d50 | /spring_bootstrap/src/test/java/kr/or/ddit/service/MockMemberDAO.java | fee39494684415d62b9aacfa03c2419a7c85ba7d | [] | no_license | rabo2/Spring | ca026fca00fac1a8b2729b65eebcc8830afa7d18 | 41428dbfd94400edce338f446f02245ead269e56 | refs/heads/master | 2023-08-17T07:33:37.848099 | 2021-09-28T07:51:47 | 2021-09-28T07:51:47 | 390,545,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,181 | java | package kr.or.ddit.service;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import kr.or.ddit.command.Criteria;
import kr.or.ddit.command.SearchCriteria;
import kr.or.ddit.dao.MemberDAO;
import kr.or.ddit.dto.MemberVO;
public class MockMemberDAO implements MemberDAO{
@Override
public List<MemberVO> selectMemberList(SearchCriteria cri) throws SQLException {
List<MemberVO> memberList = new ArrayList<MemberVO>();
MemberVO member1=new MemberVO();
member1.setId("mimi");
member1.setPwd("mimi");
MemberVO member2=new MemberVO();
member2.setId("mimi1");
member2.setId("mimi1");
memberList.add(member1);
memberList.add(member2);
return memberList;
}
@Override
public int selectMemberListCount(SearchCriteria cri) throws SQLException {
// TODO Auto-generated method stub
return 0;
}
@Override
public MemberVO selectMemberById(String id) throws SQLException {
MemberVO member=null;
if(!id.equals("mimi"))return member;
member=new MemberVO();
member.setId(id);
member.setPwd("1234");
member.setEnabled(1);
member.setPhone("010-1234-5678");
member.setEmail(id+"@"+id+".com");
member.setPicture("noImage.jpg");
return member;
}
@Override
public void insertMember(MemberVO member) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void updateMember(MemberVO member) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void deleteMember(String id) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void disabledMember(String id) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public void enabledMember(String id) throws SQLException {
// TODO Auto-generated method stub
}
@Override
public List<MemberVO> selectMemberList() throws SQLException {
// TODO Auto-generated method stub
return null;
}
@Override
public List<MemberVO> selectMemberList(Criteria cri) throws SQLException {
// TODO Auto-generated method stub
return null;
}
} | [
"raboy500@gmail.com"
] | raboy500@gmail.com |
db0765fc19a702adc2e04366307581c1e3f3bc8c | 21273e06e016b0a5ae9f9cd1404d268c60f4ff3c | /Java/DataStructure/src/com/zuolizhu/InnerClasses/Gearbox.java | 1f8245de286984c14fceb4dfda9d279a583ead50 | [] | no_license | zuolizhu/DataStructures | d0dab8113cb0b2a85d8d81508ed50012df47aefd | 5aa3abef2ee39453b97bdcf9e439269127c4ba91 | refs/heads/master | 2021-01-02T09:40:24.825999 | 2017-09-23T15:58:29 | 2017-09-23T15:58:29 | 99,273,302 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package com.zuolizhu.InnerClasses;
import java.util.ArrayList;
public class Gearbox {
private ArrayList<Gear> gears;
private int maxGears;
private int currentGear = 0;
private boolean clutchIsIn;
public Gearbox(int maxGears) {
this.maxGears = maxGears;
this.gears = new ArrayList<Gear>();
Gear neutral = new Gear(0,0.0);
this.gears.add(neutral);
for(int i = 0; i < maxGears; i++) {
addGear(i, i * 6);
}
}
public void operateClutch(boolean in) {
this.clutchIsIn = in;
}
public void addGear(int number, double ration) {
if((number > 0) && number <= maxGears) {
this.gears.add(new Gear(number, ration));
}
}
public void changeGear(int newGear) {
if((newGear >= 0) && (newGear < this.gears.size()) && this.clutchIsIn) {
this.currentGear = newGear;
System.out.println("Gear " + newGear + " selected.");
} else {
System.out.println("Grind!");
this.currentGear = 0;
}
}
public double wheelSpeed(int revs) {
if(clutchIsIn) {
System.out.println("Cream!!");
return 0.0;
}
return revs * gears.get(currentGear).getRatio();
}
private class Gear {
private int gearNumber;
private double ratio;
public Gear(int gearNumber, double ratio) {
this.gearNumber = gearNumber;
this.ratio = ratio;
}
public double getRatio() {
return ratio;
}
public double driveSpeed(int revs) {
return revs *(this.ratio);
}
}
}
| [
"zuolizhu5960x@gmail.com"
] | zuolizhu5960x@gmail.com |
7ae9912cd934ebc2485108496758b3f544341826 | fab8236a0fa110d86a3496774a8f055247435400 | /src/rangeTests/TestGetLowerBound.java | 82795ccadc718d00d912a2c22958508e0c5289ea | [] | no_license | psettle/SENG437A4 | e888e71d5cd94bb7d8cdff8957548693a3a2d043 | a628a7f879901ae84d204daed5da6a3f12acfbdd | refs/heads/master | 2021-01-22T19:31:51.290401 | 2017-03-23T03:48:55 | 2017-03-23T03:48:55 | 85,210,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,632 | java | package rangeTests;
import static org.junit.Assert.*;
import org.jfree.data.Range;
import org.junit.Test;
public class TestGetLowerBound {
private static final int DEFAULT_TIMEOUT = 2000;
/**
* This test checks to see if getLowerBound correctly returns with a graph that extends to
* negative infinity
*/
@Test (timeout = DEFAULT_TIMEOUT)
public void testLowerBoundNegativeInfinity() {
Range range = new Range(Double.NEGATIVE_INFINITY, 5);
assertEquals("Testing getLowerBound with Lower == -infinity", Double.NEGATIVE_INFINITY, range.getLowerBound(), 0);
}
/**
* This test checks to see if getLowerBound correctly returns with a graph that extends to
* positive infinity
*/
@Test (timeout = DEFAULT_TIMEOUT)
public void testUpperBoundPositiveInfinity() {
Range range = new Range(44, Double.POSITIVE_INFINITY);
assertEquals("Testing getLowerBound with Upper == +infinity", 44, range.getLowerBound(), 0);
}
/**
* This test checks that getLowerBound correctly returns with a finite, valid range
*/
@Test (timeout = DEFAULT_TIMEOUT)
public void testValidRangeNeitherInfinity() {
Range range = new Range(-1000, -444);
assertEquals("Testing a valid range, (-1000, -444)", -1000, range.getLowerBound(), 0);
}
/**
* This test checks to see if getLowerBound correctly returns with a finite range of zero length
* i.e. upper == lower
*/
@Test (timeout = DEFAULT_TIMEOUT)
public void testLowerEqualsUpper() {
Range range = new Range(0, 0);
assertEquals("Testing getLowerBound with Lower == Upper", 0, range.getLowerBound(), 0);
}
}
| [
"patricksettle@hotmail.com"
] | patricksettle@hotmail.com |
10eb59b6b414b66b77cc7e8e710b5c8b01138d24 | 4646ec383cb0750e0cfc3bcc50f0a6a74f4b9f9a | /ui/TestFactory/src/timesheetpac/JyperionListener.java | c60ede22f9d880640fcde53ed13b38e75c2b80de | [] | no_license | ignatiuz-pune/Timesheet-automation | b979291d039a2ea12d747811935c57b1c5859254 | ace6067b129e58e77f2e4c724ba6b8cd64f6f04f | refs/heads/master | 2020-03-30T13:01:01.787127 | 2018-10-02T14:09:28 | 2018-10-02T14:09:28 | 151,252,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,717 | java | package timesheetpac;
import java.awt.Color;
import java.io.FileOutputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.Set;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.FontFactory;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfWriter;
/**
* JyperionListener
*
* @author janaudy at jyperion dot org
*/
public class JyperionListener implements ITestListener {
/**
* Document
*/
private Document document = null;
/**
* PdfPTables
*/
PdfPTable successTable = null, failTable = null;
/**
* throwableMap
*/
private HashMap<Integer, Throwable> throwableMap = null;
/**
* nbExceptions
*/
private int nbExceptions = 0;
/**
* JyperionListener
*/
public JyperionListener() {
log("JyperionListener()");
this.document = new Document();
this.throwableMap = new HashMap<Integer, Throwable>();
}
/**
* @see com.beust.testng.ITestListener#onTestSuccess(com.beust.testng.ITestResult)
*/
@Override
public void onTestSuccess(ITestResult result) {
try {
log("onTestSuccess(" + result + ")");
if (successTable == null) {
this.successTable = new PdfPTable(new float[] { .3f, .3f, .1f, .3f });
Paragraph p = new Paragraph("PASSED TESTS", new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD));
p.setAlignment(Element.ALIGN_CENTER);
PdfPCell cell = new PdfPCell(p);
cell.setColspan(4);
cell.setBackgroundColor(Color.GREEN);
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Class"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Method"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Time (ms)"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Exception"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.successTable.addCell(cell);
}
PdfPCell cell = new PdfPCell(new Paragraph(result.getTestClass().toString()));
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph(result.getMethod().toString()));
this.successTable.addCell(cell);
cell = new PdfPCell(new Paragraph("" + (result.getEndMillis() - result.getStartMillis())));
this.successTable.addCell(cell);
Throwable throwable = result.getThrowable();
if (throwable != null) {
this.throwableMap.put(new Integer(throwable.hashCode()), throwable);
this.nbExceptions++;
Paragraph excep = new Paragraph(
new Chunk(throwable.toString(), new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.UNDERLINE))
.setLocalGoto("" + throwable.hashCode()));
cell = new PdfPCell(excep);
this.successTable.addCell(cell);
} else {
this.successTable.addCell(new PdfPCell(new Paragraph("")));
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @see com.beust.testng.ITestListener#onTestFailure(com.beust.testng.ITestResult)
*/
@Override
public void onTestFailure(ITestResult result) {
try {
log("onTestFailure(" + result + ")");
if (this.failTable == null) {
this.failTable = new PdfPTable(new float[] { .3f, .3f, .1f, .3f });
this.failTable.setTotalWidth(20f);
Paragraph p = new Paragraph("FAILED TESTS", new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD));
p.setAlignment(Element.ALIGN_CENTER);
PdfPCell cell = new PdfPCell(p);
cell.setColspan(4);
cell.setBackgroundColor(Color.RED);
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Class"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Method"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Time (ms)"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph("Exception"));
cell.setBackgroundColor(Color.LIGHT_GRAY);
this.failTable.addCell(cell);
}
PdfPCell cell = new PdfPCell(new Paragraph(result.getTestClass().toString()));
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph(result.getMethod().toString()));
this.failTable.addCell(cell);
cell = new PdfPCell(new Paragraph("" + (result.getEndMillis() - result.getStartMillis())));
this.failTable.addCell(cell);
// String exception = result.getThrowable() == null ? "" :
// result.getThrowable().toString();
// cell = new PdfPCell(new Paragraph(exception));
// this.failTable.addCell(cell);
Throwable throwable = result.getThrowable();
if (throwable != null) {
this.throwableMap.put(new Integer(throwable.hashCode()), throwable);
this.nbExceptions++;
Paragraph excep = new Paragraph(
new Chunk(throwable.toString(), new Font(Font.TIMES_ROMAN, Font.DEFAULTSIZE, Font.UNDERLINE))
.setLocalGoto("" + throwable.hashCode()));
cell = new PdfPCell(excep);
this.failTable.addCell(cell);
} else {
this.failTable.addCell(new PdfPCell(new Paragraph("")));
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* @see com.beust.testng.ITestListener#onTestSkipped(com.beust.testng.ITestResult)
*/
@Override
public void onTestSkipped(ITestResult result) {
try {
log("onTestSkipped(" + result + ")");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @see com.beust.testng.ITestListener#onStart(com.beust.testng.ITestContext)
*/
@Override
public void onStart(ITestContext context) {
log("onStart(" + context + ")");
try {
PdfWriter.getInstance(this.document, new FileOutputStream(context.getName() + ".pdf"));
System.out.println("PDF File Name: " + context.getName() + ".pdf");
} catch (Exception e) {
e.printStackTrace();
}
this.document.open();
Paragraph p = new Paragraph(context.getName() + " TESTNG RESULTS",
FontFactory.getFont(FontFactory.HELVETICA, 20, Font.BOLD, new Color(0, 0, 255)));
try {
this.document.add(p);
this.document.add(new Paragraph(new Date().toString()));
} catch (DocumentException e1) {
e1.printStackTrace();
}
}
/**
* @see com.beust.testng.ITestListener#onFinish(com.beust.testng.ITestContext)
*/
@Override
public void onFinish(ITestContext context) {
log("onFinish(" + context + ")");
try {
if (this.failTable != null) {
log("Added fail table");
this.failTable.setSpacingBefore(15f);
this.document.add(this.failTable);
this.failTable.setSpacingAfter(15f);
}
if (this.successTable != null) {
log("Added success table");
this.successTable.setSpacingBefore(15f);
this.document.add(this.successTable);
this.successTable.setSpacingBefore(15f);
}
} catch (DocumentException e) {
e.printStackTrace();
}
Paragraph p = new Paragraph("EXCEPTIONS SUMMARY",
FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));
try {
this.document.add(p);
} catch (DocumentException e1) {
e1.printStackTrace();
}
Set<Integer> keys = this.throwableMap.keySet();
assert keys.size() == this.nbExceptions;
for (Integer key : keys) {
Throwable throwable = this.throwableMap.get(key);
Chunk chunk = new Chunk(throwable.toString(),
FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD, new Color(255, 0, 0)));
chunk.setLocalDestination("" + key);
Paragraph throwTitlePara = new Paragraph(chunk);
try {
this.document.add(throwTitlePara);
} catch (DocumentException e3) {
e3.printStackTrace();
}
StackTraceElement[] elems = throwable.getStackTrace();
String exception = "";
for (StackTraceElement ste : elems) {
Paragraph throwParagraph = new Paragraph(ste.toString());
try {
this.document.add(throwParagraph);
} catch (DocumentException e2) {
e2.printStackTrace();
}
}
}
this.document.close();
}
/**
* log
*
* @param o
*/
public static void log(Object o) {
// System.out.println("[JyperionListener] " + o);
}
@Override
public void onTestStart(ITestResult result) {
// TODO Auto-generated method stub
}
@Override
public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
// TODO Auto-generated method stub
}
}
| [
"Administrator@PUNEDEV21.dc.ignatiuz.com"
] | Administrator@PUNEDEV21.dc.ignatiuz.com |
72741c54a9609d8189b6a9e33c2d84ca0f0ab70c | 7d79cc962c1477ff188bd98e7d49b615c80486cc | /com.cheshangma.platform.ruleEngine.core/src/main/java/com/cheshangma/platform/ruleEngine/core/executor/ScriptInverseRunner.java | fef5672831e1b0479a5a73cf8f0ac72d63e5a022 | [] | no_license | LouisLei/csm-base-ruleEngine | 900bb47eba186697298463e89447039aa834a67e | e0979859c86b5454e08b92a4b390c6006a5f06c2 | refs/heads/yinwenjie-branch | 2021-09-16T15:40:46.984648 | 2018-06-22T06:56:55 | 2018-06-22T06:56:55 | 104,201,901 | 0 | 0 | null | 2017-09-20T10:37:19 | 2017-09-20T10:37:18 | null | UTF-8 | Java | false | false | 5,215 | java | package com.cheshangma.platform.ruleEngine.core.executor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* TODO 未写注释
* @author yinwenjie
*/
public class ScriptInverseRunner {
private static ScriptInverseRunner scriptInverseRunner;
private static ScriptReversableAbstractFactory scriptReversableFactory;
/**
* 日志
*/
private static final Logger LOG = LoggerFactory.getLogger(ScriptInverseRunner.class);
public static void initReversableFactory(ScriptReversableAbstractFactory scriptReversableFactory) {
ScriptInverseRunner.scriptReversableFactory = scriptReversableFactory;
}
/**
* @return
*/
public static ScriptInverseRunner getNewInstance() {
if (ScriptInverseRunner.scriptInverseRunner != null) {
return ScriptInverseRunner.scriptInverseRunner;
}
synchronized (ScriptInverseRunner.class) {
while (ScriptInverseRunner.scriptInverseRunner == null) {
if(ScriptInverseRunner.scriptInverseRunner != null) {
break;
}
ScriptInverseRunner.scriptInverseRunner = new ScriptInverseRunner();
return ScriptInverseRunner.scriptInverseRunner;
}
}
return ScriptInverseRunner.scriptInverseRunner;
}
/**
* 不能直接进行初始化
*/
private ScriptInverseRunner() {
}
/**
* 开始进行“反调”操作<br>
* componentAndMethod 传入的参数是java完整类型/spring bean名称 + 方法名<br>
* 举例如下:<br>
*
* springcomponent.method1<br>
* package1.name.ClassName.method2<br>
* a.b.c.ClassName.method2
*
* @return 如果反调过程有返回值,则会通过这里返回到动态脚本执行过程中。如果回调没有返回值,则返回null
*/
public Object inverse(String componentAndMethod) {
if(StringUtils.isEmpty(componentAndMethod)) {
return null;
}
/*
* 操作过程为:
* 1、根据componentAndMethod确定的组件,取得对象
* 2、在进行“反射”调用执行的方法
* 2.1、如果这个方法没有任何入参,则直接调用
* 2.2、如果这个方法有上下文信息,则还要输入上下文对象
* 2.3、其它情况不进行反射调用
* 3、如果反调过程有返回值,则会通过这里返回到动态脚本执行过程中;其它情况返回null
* */
//1、================
ScriptInvokerReversable invokerReversable = scriptReversableFactory.buildReversableBean(componentAndMethod);
if(invokerReversable == null) {
return null;
}
//2、=================
// 开始反调方法
int lastIndex = componentAndMethod.lastIndexOf(".");
if(lastIndex == -1) {
throw new IllegalArgumentException("component can not be found!!");
}
String methodName = componentAndMethod.substring(lastIndex + 1);
Method invokerMethod = this.findMethod(invokerReversable.getClass(), methodName);
if(invokerMethod == null) {
return null;
}
//3、===============调用
Object result = null;
try {
if(invokerMethod.getParameterCount() == 1) {
ScriptThread scriptThread = (ScriptThread)Thread.currentThread();
ExecuteContext context = scriptThread.getExecuteContext();
result = invokerMethod.invoke(invokerReversable, new Object[]{context});
} else {
result = invokerMethod.invoke(invokerReversable, new Object[]{});
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
LOG.error(e.getMessage() , e);
return null;
}
return result;
}
/**
* 该私有方法用于找到要被反调的方法,如果没找到就在其父类实现找(不是父级接口找哦)。<br>
* 直到找到方法或者没有更高级别的父类了
* @param targetClass
* @param methodName
* @return
*/
private Method findMethod(Class<?> targetClass , String methodName) {
Method[] methods = targetClass.getDeclaredMethods();
// 开始在本级class中找
for (int index = 0 ; methods != null && index < methods.length ; index++) {
Method method = methods[index];
// 如果条件成立,说明找到了名字吻合的方法名(但是不一定能被调用)
if(StringUtils.equals(method.getName(), methodName)) {
int parameterCount = method.getParameterCount();
if(parameterCount > 1) {
continue;
}
// 如果条件成立,说明真的找到了
Class<?>[] parameterTypes = method.getParameterTypes();
if(parameterTypes == null || parameterTypes.length == 0
|| parameterTypes[0] == ExecuteContext.class) {
return method;
}
}
}
// 如果代码运行到这里,说明在这个class中没有找到需要的method方法。
// 那么到它的父级类中找
Class<?> superCLass = targetClass.getSuperclass();
if(superCLass != null) {
return this.findMethod(superCLass, methodName);
}
return null;
}
}
| [
"yinwenjie@vanda-特此、"
] | yinwenjie@vanda-特此、 |
8eea9e8f5e9e5c1d6551c6803b699ec7bd5685a6 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/hadoop/hbase/coprocessor/TestCoprocessorShortCircuitRPC.java | 2988dcd87a2e2943b5b3272158cabb7bc9a43f16 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 3,888 | 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.hadoop.hbase.coprocessor;
import java.io.IOException;
import org.apache.hadoop.hbase.CoprocessorEnvironment;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.testclassification.CoprocessorTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
/**
* Ensure Coprocessors get ShortCircuit Connections when they get a Connection from their
* CoprocessorEnvironment.
*/
@Category({ CoprocessorTests.class, MediumTests.class })
public class TestCoprocessorShortCircuitRPC {
@ClassRule
public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestCoprocessorShortCircuitRPC.class);
@Rule
public TestName name = new TestName();
private static final HBaseTestingUtility HTU = HBaseTestingUtility.createLocalHTU();
// Three test coprocessors, one of each type that has a Connection in its environment
// (WALCoprocessor does not).
public static class TestMasterCoprocessor implements MasterCoprocessor {
public TestMasterCoprocessor() {
}
@Override
public void start(CoprocessorEnvironment env) throws IOException {
// At start, we get base CoprocessorEnvironment Type, not MasterCoprocessorEnvironment,
TestCoprocessorShortCircuitRPC.checkShared(getConnection());
TestCoprocessorShortCircuitRPC.checkShortCircuit(((MasterCoprocessorEnvironment) (env)).createConnection(env.getConfiguration()));
}
}
public static class TestRegionServerCoprocessor implements RegionServerCoprocessor {
public TestRegionServerCoprocessor() {
}
@Override
public void start(CoprocessorEnvironment env) throws IOException {
// At start, we get base CoprocessorEnvironment Type, not RegionServerCoprocessorEnvironment,
TestCoprocessorShortCircuitRPC.checkShared(getConnection());
TestCoprocessorShortCircuitRPC.checkShortCircuit(((RegionServerCoprocessorEnvironment) (env)).createConnection(env.getConfiguration()));
}
}
public static class TestRegionCoprocessor implements RegionCoprocessor {
public TestRegionCoprocessor() {
}
@Override
public void start(CoprocessorEnvironment env) throws IOException {
// At start, we get base CoprocessorEnvironment Type, not RegionCoprocessorEnvironment,
TestCoprocessorShortCircuitRPC.checkShared(getConnection());
TestCoprocessorShortCircuitRPC.checkShortCircuit(((RegionCoprocessorEnvironment) (env)).createConnection(env.getConfiguration()));
}
}
@Test
public void test() throws IOException {
// Nothing to do in here. The checks are done as part of the cluster spinup when CPs get
// loaded. Need this here so this class looks like a test.
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
c73b15db614a7f78fe9c26ea0d9c30593450f8de | 90e14530047fd8f58a8977a6740de9b53541fefa | /src/main/java/com/aaron/AA2_AD/exception/AuthorNotFoundException.java | 8bf809c2ee5d51e7b0cd8e3ab060e463eb14ea14 | [] | no_license | aaron0211/AA2_AD | 9e7b80708d23c90ca2c17f21184c754afef2f72b | 01a2551d12cf4cc2e2f0e9cf7bfc398c6eb69634 | refs/heads/master | 2023-04-06T13:08:11.085459 | 2021-04-15T20:57:10 | 2021-04-15T20:57:10 | 352,449,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 342 | java | package com.aaron.AA2_AD.exception;
public class AuthorNotFoundException extends RuntimeException{
public AuthorNotFoundException(){
super();
}
public AuthorNotFoundException(String message){
super(message);
}
public AuthorNotFoundException(long id){
super("Author not found: " + id);
}
}
| [
"aaronretave@hotmail.com"
] | aaronretave@hotmail.com |
a71da90ca16bb77d7b051fbe633ed98e78e958c6 | e35ec48addb74fd2c32883624356f15679d54e80 | /app/src/test/java/com/jxxx/zf/ExampleUnitTest.java | 26946d844647336917ce52314e599bdd99052607 | [] | no_license | ltg263/ZuFang | e6e816dd7910640579026b5bef7c43dd223f109a | 2e0195b52e63f1de01f9ace57f449494c1ae0764 | refs/heads/master | 2023-07-01T22:18:40.870333 | 2021-08-19T03:55:48 | 2021-08-19T03:55:48 | 371,552,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package com.jxxx.zf;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"qzj842179561@gmail.com"
] | qzj842179561@gmail.com |
2aa9f0b4e426ce20ca92e43ee878b02a859ec000 | 15afc00981d255b6be254b0e5a3f83bc50a530d3 | /src/test/java/com/epam/factory_method/test/TestNewMailPage.java | 69ca2a77770aa4919207494c493e5dd8e1be34fa | [] | no_license | Emartu/8TaskRepo | a788d020a0b62a171c4d14b9c1278716937241c0 | d246d42f8880f9cc2339ba6a40e80d233ffd5415 | refs/heads/master | 2020-04-06T04:06:05.529030 | 2017-02-24T11:06:56 | 2017-02-24T11:06:56 | 83,033,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,848 | java | package com.epam.factory_method.test;
import com.epam.factory_method.base.Driver;
import com.epam.factory_method.business_objects.MailData;
import com.epam.factory_method.business_objects.User;
import com.epam.factory_method.steps.TestLoginSteps;
import com.epam.factory_method.steps.TestNewMailSteps;
import com.epam.factory_method.test_data.TestInput;
import org.testng.Assert;
import org.testng.annotations.*;
public class TestNewMailPage {
private TestLoginSteps testLoginSteps;
private TestNewMailSteps testNewMailSteps;
private String login = "testtask28";
private String password = "testtask28testtask28";
private String to = "emartu@yandex.ru";
private String subject = "sent via WebDriver";
private String body = "testtask28testtask28";
@Parameters({"browser"})
@BeforeClass(alwaysRun = true)
public void setup(String brow) {
Driver.initBrowser(brow);
}
@AfterClass(alwaysRun = true)
public void closeBrowser() {
Driver.quitBrowser();
}
@DataProvider(name = "NewMail_Provider")
public Object[][] dataProvider() {
return new Object[][]{
{new User(login, password), new MailData(to, subject, body)}
};
}
@Test(dataProvider = "NewMail_Provider", groups = "Mail Page Test", description = "Tests whether email is sent")
public void testMailIsInDraft(User user, MailData mailData) {
testLoginSteps = new TestLoginSteps();
testNewMailSteps = new TestNewMailSteps();
testLoginSteps.openMailWebAddress(TestInput.mailBoxUrl);
testLoginSteps.doLogin(user);
testNewMailSteps.createNewMail(mailData);
testNewMailSteps.goDrafts();
Assert.assertTrue(testNewMailSteps.isMessageSent(), "Element is not found, seems like message is not saved in Drafts ... ");
}
}
| [
"y.a@mail.com"
] | y.a@mail.com |
1ae272dd33004e44e5287590dc8a266105e5bd6a | ee2581928ec549eff936cc53095ba934bb46a8c8 | /src/Users/Modules/User/Model/BLL/BLL_users/Files_Users/Admin/Utils_Files/Open_Admin.java | 390b3721efe950ce0af317530479d57aa4f07e04 | [] | no_license | Sermartguer/Framework | 67d270853bcc2a42d54e0fb78390229e65845c66 | 8507e95da5c21cfa3e6fbd9000f142f9028c727a | refs/heads/master | 2021-01-11T14:30:49.584207 | 2017-02-17T16:10:11 | 2017-02-17T16:10:11 | 80,147,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,672 | java | package Users.Modules.User.Model.BLL.BLL_users.Files_Users.Admin.Utils_Files;
import java.awt.HeadlessException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import com.google.gson.stream.JsonReader;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.Annotations;
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
import Users.Classes.lenguage;
import Users.Main.menu4;
import Users.Modules.User.Model.Classes.Singleton;
import Users.Modules.User.Model.Classes.userad;
import Users.Modules.User.Model.Classes.usu;
public class Open_Admin {
//AUTO
public static ArrayList<userad> openjson_admin() {
String PATH = null;
try {
PATH = new java.io.File(".").getCanonicalPath()
+ "/src/Users/Modules/User/Model/Files/Admin/Files/Admin/json/admin.json";
} catch (IOException e) {
e.printStackTrace();
}
//if (Singleton.useradmin.size() > 0) {
try {
XStream xstreamjson = new XStream(new JettisonMappedXmlDriver());
xstreamjson.setMode(XStream.NO_REFERENCES);
xstreamjson.alias("Client", userad.class);
Gson gson = new Gson();
String json = gson.toJson(Singleton.useradmin);
FileWriter fileXml = new FileWriter(PATH);
fileXml.write(json.toString());
fileXml.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_json"), "Error", JOptionPane.ERROR_MESSAGE);
}
//} else {
File path = new File(PATH);
path.delete();
// }
return Singleton.useradmin;
}
public static void openxml_admin() {
String PATH=null;
try {
XStream xstream = new XStream();
Annotations.configureAliases(xstream, userad.class);
PATH = new java.io.File(".").getCanonicalPath()
+ "/src/Users/Modules/User/Model/Files/Admin/Files/xml/admin.xml";
Singleton.useradmin = (ArrayList <userad>)xstream.fromXML(new FileReader(PATH));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_xml"), "Error", JOptionPane.ERROR_MESSAGE);
}
}
public static void opentxt_admin() {
String PATH = null;
try {
File file;
PATH = new java.io.File(".").getCanonicalPath()
+ "/src/Users/Modules/User/Model/Files/Admin/Files/txt/admin.txt";
file = new File(PATH);
FileInputStream FIS=new FileInputStream(file);
ObjectInputStream OIS=new ObjectInputStream(FIS);
Singleton.useradmin = (ArrayList<userad>)OIS.readObject();
OIS.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_txt"), "Error", JOptionPane.ERROR_MESSAGE);
}
}
//ON-DEMAND
public static ArrayList<userad> obri_json() {
String PATH = null;
userad e1=new userad("");
try {
XStream xstream = new XStream(new JettisonMappedXmlDriver());
xstream.setMode(XStream.NO_REFERENCES);
xstream.alias("userad", userad.class);
JFileChooser fileChooser = new JFileChooser();
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.addChoosableFileFilter(new FileNameExtensionFilter("JSON (*.json)", "json"));
int seleccion = fileChooser.showOpenDialog(null);
if (seleccion == JFileChooser.APPROVE_OPTION) {
File JFC = fileChooser.getSelectedFile();
PATH = JFC.getAbsolutePath();
Singleton.useradmin.clear();
//AlistEF.efi = (ArrayList<empleafijo>)xstream.fromXML(new FileReader(PATH)); //NO VA
/* TAMPOC VA
for (int i = 0; i < size; i++) {
e1 = (empleafijo)xstream.fromXML(new FileReader(PATH));
AlistEF.efi.add(e1);
}*/
JsonReader lector = new JsonReader(new FileReader(PATH));
JsonParser parseador = new JsonParser();
JsonElement raiz = parseador.parse(lector);
Gson json = new Gson();
JsonArray lista = raiz.getAsJsonArray();
for (JsonElement elemento : lista) {
e1 = json.fromJson(elemento, userad.class);
Singleton.useradmin.add(e1);
}
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_json"), "Error", JOptionPane.ERROR_MESSAGE);
}
return Singleton.useradmin;
}
public static ArrayList<userad> obri_xml() {
String PATH=null;
try {
XStream xstream = new XStream();
Annotations.configureAliases(xstream, userad.class);
JFileChooser fileChooser = new JFileChooser();
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.addChoosableFileFilter(new FileNameExtensionFilter("XML (*.xml)", "xml"));
int seleccion = fileChooser.showOpenDialog(null);
if (seleccion == JFileChooser.APPROVE_OPTION) {
File JFC = fileChooser.getSelectedFile();
PATH = JFC.getAbsolutePath();
Singleton.useradmin = (ArrayList <userad>)xstream.fromXML(new FileReader(PATH));
}
} catch (Exception e1) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_xml"), "Error", JOptionPane.ERROR_MESSAGE);
}
return Singleton.useradmin;
}
public static ArrayList<userad> obri_txt() {
String PATH = null;
try {
File f;
JFileChooser fileChooser = new JFileChooser();
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.addChoosableFileFilter(new FileNameExtensionFilter("Texto (*.txt)", "txt"));
int seleccion = fileChooser.showOpenDialog(null);
if (seleccion == JFileChooser.APPROVE_OPTION) {
File JFC = fileChooser.getSelectedFile();
PATH = JFC.getAbsolutePath();
f = new File(PATH);
FileInputStream fi=new FileInputStream(f);
ObjectInputStream oi=new ObjectInputStream(fi);
Singleton.useradmin = (ArrayList<userad>)oi.readObject();
oi.close();
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, lenguage.getInstance().getProperty("err_txt"), "Error", JOptionPane.ERROR_MESSAGE);
}
return Singleton.useradmin;
}
}
| [
"sermartguer@gmail.com"
] | sermartguer@gmail.com |
0350106c5fe14c32b6dac354cc6eee3bf7cf2fdf | 7976a176ab1b7cd3ca4ddf04a7757c4565a863c8 | /client/src/main/java/com/asylum/client/ClientMain.java | 28ae9376754ef7fa446f5bae30ee437a11d30982 | [] | no_license | ZenDarva/JavaServerExample | fbe4524444d73e7f210de35e465b185a7facf718 | a01ca1e722b699ea51a6b671af39d3d6b3f5ddd7 | refs/heads/master | 2021-06-23T06:22:35.236055 | 2017-08-15T04:00:59 | 2017-08-15T04:00:59 | 100,336,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 874 | java | package com.asylum.client;
import com.asylum.common.network.packets.PacketConnect;
import com.asylum.common.network.packets.PacketManager;
import com.asylum.common.network.packets.PacketShutdown;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
/**
* Created by James on 8/14/2017.
*/
public class ClientMain {
public static void main(String args[]) throws IOException, InterruptedException {
Socket socket = new Socket("localhost",9000);
//socket.connect(new InetSocketAddress("localhost",9000));
PacketConnect connect = new PacketConnect("darva");
PacketManager.getInstance().sendPacket(socket, connect);
Thread.sleep(20000);
PacketShutdown shutdown = new PacketShutdown();
PacketManager.getInstance().sendPacket(socket,shutdown);
Thread.sleep(20000);
}
}
| [
"zendarva@gmail.com"
] | zendarva@gmail.com |
e8e16bbc15bca16f5350272d05cbcc979dac3e8b | b89e8c32dbe2475c38e8d0a6332b0d201e885579 | /src/main/java/com/encuesta/app/services/CuestionarioServiceImpl.java | 63cb1745e32881270372a2429b7fecc965320e2a | [] | no_license | TechnoHackers/BackEndEncuesta | 72ee3712c02fa3d2a5693bb1e6e628a5609a520e | b6a46d821f691837942aa934c1df69c02a763447 | refs/heads/master | 2020-03-31T04:44:55.542446 | 2018-10-30T03:26:49 | 2018-10-30T03:26:49 | 151,918,278 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.encuesta.app.services;
import com.encuesta.app.dao.CuestionarioDao;
import com.encuesta.app.entity.CuestionarioEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class CuestionarioServiceImpl implements CuestionarioService {
@Autowired
private CuestionarioDao cuestionarioDao;
@Transactional(readOnly = true)
@Override
public List<CuestionarioEntity> findAll() {
return cuestionarioDao.findAll();
}
}
| [
"ajtr57@gmail.com"
] | ajtr57@gmail.com |
1f6f28bbc4ffbddf3c290dfef745f10443d63b82 | 029bec37200d8bd7ca87832dcea9f781558cb334 | /src/com/example/AppAquario2/LightRoutineActivity.java | 6415f8ac7e304e0a32b4bc6e7fb141c1632937e7 | [] | no_license | lucasnmilagres/AppAquario2.2 | 68aa1d9195cded3b9bb3cbc72cf18452dfe5945c | cec2751aa33769b4f55a258971706fee0e759c33 | refs/heads/master | 2021-01-21T13:48:24.609895 | 2016-05-16T07:37:16 | 2016-05-16T07:37:16 | 55,242,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,912 | java | package com.example.AppAquario2;
import android.app.Activity;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
import java.util.ArrayList;
/**
* Class: LightRoutineActivity
* Version: 1.0
* Parameters: - routineList
* - channelsNamesList
* - lightModeList
* - lightProgramList
* Return: - Activity result
* - lightUpdateList
* Perform: All actions in light_routine layout
* Created: 29/03/16
* Creator: Lucas Gabriel N. Milagres
*/
public class LightRoutineActivity extends Activity
{
//Intents
Intent sendIntent;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.light_routine);
sendIntent = getIntent();
ChannelNamesInitialize();
ChannelSpinnerInitialize();
ChannelEnabledInitialize();
}
/**
* Function: ChannelNamesInitialize
* Version: 1.0
* Parameters: Void
* Return: void
* Perform: - Reads actual channel names list
* - Writes actual channel names in TextView fields
* Created: 29/03/16
* Creator: Lucas Gabriel N. Milagres
*/
private void ChannelNamesInitialize()
{
//Reads actual channel names list
ArrayList<String> channelsNamesList = sendIntent.getStringArrayListExtra("channelsNamesList");
//Writes actual channel names in EditText fields.If channelNamesList is null, keep default channels names
if((channelsNamesList != null)&&(channelsNamesList.size()==5))
{
//Finds all channel name fields in the activity
TextView channelName1Field = (TextView)findViewById(R.id.light_routine_channel1_name);
TextView channelName2Field = (TextView)findViewById(R.id.light_routine_channel2_name);
TextView channelName3Field = (TextView)findViewById(R.id.light_routine_channel3_name);
TextView channelName4Field = (TextView)findViewById(R.id.light_routine_channel4_name);
TextView channelName5Field = (TextView)findViewById(R.id.light_routine_channel5_name);
//Sets actual channel names text
channelName1Field.setText(channelsNamesList.get(0));
channelName2Field.setText(channelsNamesList.get(1));
channelName3Field.setText(channelsNamesList.get(2));
channelName4Field.setText(channelsNamesList.get(3));
channelName5Field.setText(channelsNamesList.get(4));
}
}
/**
* Function: ChannelSpinnerInitialize
* Version: 1.0
* Parameters: Void
* Return: void
* Perform: - Reads routineList
* - Sets spinner' dropdown to actual routineList values
* - Avoids using obsolete programs
* - Selects spinner item
* Created: 29/03/16
* Creator: Lucas Gabriel N. Milagres
*/
private void ChannelSpinnerInitialize()
{
//Reads routineList
ArrayList<String> routineList=sendIntent.getStringArrayListExtra("routineList");
//Reads lightProgramList
ArrayList<String> lightProgramList=sendIntent.getStringArrayListExtra("lightProgramList");
//Sets spinners adapter (layout and strings settings)
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.spinner_item, routineList);
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item);
//Finds all spinners in the activity
ArrayList<Spinner> channelSpinnerList=new ArrayList<>();
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner1));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner2));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner3));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner4));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner5));
for(int count=0; count<=4;count++)
{
//Sets adapter
channelSpinnerList.get(count).setAdapter(adapter);
//Avoids using obsolete programs
if(!routineList.contains(lightProgramList.get(count)))
lightProgramList.set(count,getResources().getString(R.string.Unset));
//Selects spinner item
if(channelSpinnerList.size()==5)
channelSpinnerList.get(count).setSelection(routineList.indexOf(lightProgramList.get(count)));
else
channelSpinnerList.get(count).setSelection(0);
}
}
/**
* Function: ChannelEnabledInitialize
* Version: 1.0
* Parameters: Void
* Return: void
* Perform: - Reads actual channel mode list
* - Identify RoutineMode channels
* Created: 29/03/16
* Creator: Lucas Gabriel N. Milagres
*/
private void ChannelEnabledInitialize()
{
//Reads actual channel mode list
ArrayList<String> lightModeList = sendIntent.getStringArrayListExtra("lightModeList");
//Sets actual enabled channels
if ((lightModeList != null) && (lightModeList.size() == 5))
{
//Seeks RoutineMode channels
for (int count=0;count<=4;count++)
{
if(lightModeList.get(count).equals(getResources().getString(R.string.RoutineMode)))
changeEnabledState(count, true);
else
changeEnabledState(count, false);
}
}
}
/**
* Function: changeEnabledState
* Version: 1.0
* Parameters: - channelIndex
* - checkBoxStatus
* Return: Void
* Perform: - Changes selected CheckBox checked status
* - Changes enabled state of spinner
* - Reads lightProgramList
* - Sets selection to <Unset>
* Created: 29/03/16
* Creator: Lucas Gabriel N. Milagres
*/
private void changeEnabledState(int channelIndex, boolean checkBoxStatus)
{
//Finds all checkBoxes in the activity
ArrayList<CheckBox> channelCheckBoxList = new ArrayList<>();
channelCheckBoxList.add((CheckBox) findViewById(R.id.light_routine_checkBox1));
channelCheckBoxList.add((CheckBox) findViewById(R.id.light_routine_checkBox2));
channelCheckBoxList.add((CheckBox) findViewById(R.id.light_routine_checkBox3));
channelCheckBoxList.add((CheckBox) findViewById(R.id.light_routine_checkBox4));
channelCheckBoxList.add((CheckBox) findViewById(R.id.light_routine_checkBox5));
//Finds all spinners in the activity
ArrayList<Spinner> channelSpinnerList=new ArrayList<>();
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner1));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner2));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner3));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner4));
channelSpinnerList.add((Spinner) findViewById(R.id.light_routine_spinner5));
//Sets CheckBox status
channelCheckBoxList.get(channelIndex).setChecked(checkBoxStatus);
//Sets enabled status
channelSpinnerList.get(channelIndex).setEnabled(checkBoxStatus);
//Sets selection to <Unset>
if(checkBoxStatus==false)
channelSpinnerList.get(channelIndex).setSelection(0);
}
/**
* Function: changeChecked
* Version: 1.0
* Parameters: One of the CheckBoxes
* Return: Void
* Perform: Calls changeEnabledState
* Created: 28/03/16
* Creator: Lucas Gabriel N. Milagres
*/
public void changeChecked(View view)
{
changeEnabledState(Integer.parseInt(view.getTag().toString()), ((CheckBox)view).isChecked());
}
/**
* Function: finishActivity
* Version: 1.0
* Parameters: "Cancel" button
* Return: RESULT_CANCELED
* Perform: - Returns null to the parent activity
* - Finishes the activity
* Created: 27/03/16
* Creator: Lucas Gabriel N. Milagres
*/
public void finishActivity(View view)
{
//Returns null to the parent activity
Intent resultIntent = new Intent();
setResult(Activity.RESULT_CANCELED, resultIntent);
//finishes the activity
finish();
}
}
| [
"lucasnmilagres@outlook.com"
] | lucasnmilagres@outlook.com |
4aef9b602f5fb5b74a1190b51ba13328d645bd5a | 997a823bac06bb57b6ca7b0b28f479ccba511e7a | /src/test/java/com/psi/app/config/WebConfigurerTestController.java | a40b946080f805de17b408a51022f2249f710eec | [] | no_license | marcinh97/mobile-app-msi | 3917b79fa535a01b662e6464794a349475aec7d0 | c29b4cf8a9b58666a37caf6da2c9ad697897f397 | refs/heads/master | 2022-12-22T00:42:28.382268 | 2020-05-31T16:33:39 | 2020-05-31T16:33:39 | 248,334,345 | 0 | 0 | null | 2022-12-16T05:13:26 | 2020-03-18T20:20:57 | Java | UTF-8 | Java | false | false | 374 | java | package com.psi.app.config;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class WebConfigurerTestController {
@GetMapping("/api/test-cors")
public void testCorsOnApiPath() {
}
@GetMapping("/test/test-cors")
public void testCorsOnOtherPath() {
}
}
| [
"marcin.horak@gmail.com"
] | marcin.horak@gmail.com |
c52137f0fccf4cf1202cc6eb91e8f69674fff306 | 39dbd17662e3d944d1b360c82dfa984e9e0a2f19 | /src/main/java/com/lhzt/monitor/filter/SysUserFilter.java | fd22c958eef439557d7c7794e02bb0be5e49d862 | [] | no_license | pansen163/ZTEye | 0b4a809c24b0a179641a94f5fc93484ba135a5f9 | bf697f32014897d93799bf85344844d0ba2c29fe | refs/heads/master | 2021-05-15T20:56:17.859038 | 2017-10-31T01:54:30 | 2017-10-31T01:54:30 | 107,917,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 904 | java | package com.lhzt.monitor.filter;
import com.lhzt.monitor.constants.Constants;
import com.lhzt.monitor.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.web.filter.PathMatchingFilter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* <p>User: Zhang Kaitao <p>Date: 14-2-15 <p>Version: 1.0
*/
public class SysUserFilter extends PathMatchingFilter {
private UserService userService;
public void setUserService(UserService userService) {
this.userService = userService;
}
@Override
protected boolean onPreHandle(ServletRequest request, ServletResponse response,
Object mappedValue) throws Exception {
String username = (String) SecurityUtils.getSubject().getPrincipal();
request.setAttribute(Constants.CURRENT_USER, userService.findByUsername(username));
return true;
}
}
| [
"pansen163@163.com"
] | pansen163@163.com |
4e26c53a4a91fb1b36a6c444a7d28dee4acacc8a | a7e688debd8371c02a1f89f5886f1a5c5324fceb | /springboot-kafka-storm/src/com/lmy/storm/spout/KafkaInsertDataSpout.java | 44db74a929ffa1d6d9de2314b084466b018fe026 | [
"Apache-2.0"
] | permissive | lgfy1984/springboot2-study | 5a0751b809240ba77185af05d5ce64d80e5be088 | f5cd28021ca0eddde840084abde8819569ce7a47 | refs/heads/main | 2023-07-03T08:59:26.927278 | 2021-07-19T12:05:24 | 2021-07-19T12:05:24 | 387,447,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,712 | java | package com.lmy.storm.spout;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichSpout;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Values;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import com.lmy.config.ApplicationConfiguration;
import com.lmy.constant.Constants;
import com.lmy.pojo.User;
import com.lmy.util.GetSpringBean;
/**
*
* @Title: KafkaInsertDataSpout
* @Description:
* 从kafka获取新增数据
* @Version:1.0.0
* @author lmy
* @date 2018年4月19日
*/
public class KafkaInsertDataSpout extends BaseRichSpout{
/**
*
*/
private static final long serialVersionUID = -2548451744178936478L;
private static final Logger logger = LoggerFactory.getLogger(KafkaInsertDataSpout.class);
private SpoutOutputCollector collector;
private KafkaConsumer<String, String> consumer;
private ConsumerRecords<String, String> msgList;
private ApplicationConfiguration app;
@SuppressWarnings("rawtypes")
@Override
public void open(Map map, TopologyContext arg1, SpoutOutputCollector collector) {
app=GetSpringBean.getBean(ApplicationConfiguration.class);
kafkaInit();
this.collector = collector;
}
@Override
public void nextTuple() {
for (;;) {
try {
msgList = consumer.poll(100);
if (null != msgList && !msgList.isEmpty()) {
String msg = "";
List<User> list=new ArrayList<User>();
for (ConsumerRecord<String, String> record : msgList) {
// 原始数据
msg = record.value();
if (null == msg || "".equals(msg.trim())) {
continue;
}
try{
list.add(JSON.parseObject(msg, User.class));
}catch(Exception e){
logger.error("数据格式不符!数据:{}",msg);
continue;
}
}
logger.info("Spout发射的数据:"+list);
//发送到bolt中
this.collector.emit(new Values(JSON.toJSONString(list)));
consumer.commitAsync();
}else{
TimeUnit.SECONDS.sleep(3);
logger.info("未拉取到数据...");
}
} catch (Exception e) {
logger.error("消息队列处理异常!", e);
try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e1) {
logger.error("暂停失败!",e1);
}
}
}
}
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(new Fields(Constants.FIELD));
}
/**
* 初始化kafka配置
*/
private void kafkaInit(){
Properties props = new Properties();
props.put("bootstrap.servers", app.getServers());
props.put("max.poll.records", app.getMaxPollRecords());
props.put("enable.auto.commit", app.getAutoCommit());
props.put("group.id", app.getGroupId());
props.put("auto.offset.reset", app.getCommitRule());
props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
consumer = new KafkaConsumer<String, String>(props);
String topic=app.getTopicName();
this.consumer.subscribe(Arrays.asList(topic));
logger.info("消息队列[" + topic + "] 开始初始化...");
}
}
| [
"lgfy1984@gmail.com"
] | lgfy1984@gmail.com |
8a8731a968d2af81ee2a1415963f85dbe1aea4ee | 8ab17dcd7b0d9a129f13c43633e1936514c40b57 | /ParallelProject_PHASE2_153168/My Payment App_Wallet/src/com/cg/mypaymentapp/beans/Customer.java | 2fb5cffade28500aada587b6af4500457c528ccc | [] | no_license | Sunitha-Sharma/PHASE_2 | 20b930bee7f5f15d557daa17a3f9f21e2a09a4cb | b71c4557cf9fe5b84f7276c1a59007af0c898578 | refs/heads/master | 2020-03-23T07:45:13.705428 | 2018-07-17T12:45:42 | 2018-07-17T12:45:42 | 141,288,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package com.cg.mypaymentapp.beans;
public class Customer {
private String name;
private String mobileNo;
private Wallet wallet;
public Customer(String name2, String mobileNo2, Wallet wallet2) {
this.name = name2;
mobileNo = mobileNo2;
wallet = wallet2;
}
public Customer() {
super();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public Wallet getWallet() {
return wallet;
}
public void setWallet(Wallet wallet) {
this.wallet = wallet;
}
@Override
public String toString() {
return "Customer name=" + name + ", mobileNo=" + mobileNo + wallet;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
f08e50174a18952293cced4a8e78e43d3fbcd350 | 8da74f25fd1d7a4cfc84c355eb6e1334c324db4f | /orchestrator/src/main/java/com/example/banking/model/AccountSummaryWithHead.java | 5bbc22ca9077bf5bf38851b4ea5d00f9b7cccb9d | [] | no_license | stevexu01/banking-case-study-initial | a5c27c10a05294db1902c50e028bf10de0cb9c23 | 2cc1a3b22caf7d7b9869bfbdf91b6e4c3a07326f | refs/heads/master | 2021-01-08T22:35:35.408800 | 2020-02-21T21:57:39 | 2020-02-21T21:57:39 | 242,162,822 | 0 | 0 | null | 2020-02-21T14:51:12 | 2020-02-21T14:51:11 | null | UTF-8 | Java | false | false | 445 | java | package com.example.banking.model;
public class AccountSummaryWithHead {
private AccountSummary accountSummary;
public AccountSummaryWithHead(AccountSummary accountSummary) {
this.accountSummary = accountSummary;
}
public AccountSummary getAccountSummary() {
return accountSummary;
}
public void setAccountSummary(AccountSummary accountSummary) {
this.accountSummary = accountSummary;
}
}
| [
"amanmitt@buffalo.edu"
] | amanmitt@buffalo.edu |
715330cb0314c8e070913e997e8a03bbc9ddeed6 | 9410aecc77b0198c542abef06f41c3e6932b3850 | /src/main/java/com/recommendation/model/Movie.java | 479c3f93c111cbf714f97c859e11b01cea27998b | [] | no_license | celilkurt/movie-recommendation | 508095f8dffc4ae04fd025343feccbeae8413a4b | cba37ef57b4354071685fd4e921e6f19b520bdbb | refs/heads/master | 2022-12-29T04:50:54.528692 | 2020-10-15T17:23:54 | 2020-10-15T17:23:54 | 295,580,456 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,451 | java | package com.recommendation.model;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class Movie {
private String id;
private String title;
private int year;
private String genres;
private String director;
private String country;
private String poster;
private int minutes;
public Movie(String id, String title, String year, String genres) {
this.id = id.trim();
this.title = title.trim();
this.year = Integer.parseInt(year.trim());
this.genres = genres;
}
public Movie(String id, String title, String year, String genres, String director, String country, String poster, String minutes) {
this.id = id.trim();
this.title = title.trim();
this.year = Integer.parseInt(year.trim());
this.genres = genres;
this.director = director;
this.country = country;
this.poster = poster;
this.minutes = Integer.parseInt(minutes.trim());
}
@Override
public String toString() {
return "entity.Movie{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", year=" + year +
", genres='" + genres + '\'' +
", director='" + director + '\'' +
", country='" + country + '\'' +
", poster='" + poster + '\'' +
", minutes=" + minutes +
'}';
}
}
| [
"celilkurt82@gmail.com"
] | celilkurt82@gmail.com |
83e92d3a2f53d98ec94a2174a31f92448c38c58a | 73721ffe3892ae261ad69ce86fe58caaf1e4fa36 | /original-source/src/main/java/chapter_03/MainApplication.java | cb65b58ccc8504d0e73000bfe988db0346f4bfd1 | [] | no_license | sojeongw/real-world-software-development | f0e86318ad4235ac9cf851156c8b42033026a474 | 145fe9419513a8a25034cb150469a4a7db922ab7 | refs/heads/main | 2023-05-01T06:04:28.181196 | 2021-05-12T04:52:06 | 2021-05-12T04:52:06 | 299,034,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package chapter_03;
public class MainApplication {
public static void main(final String[] args) throws Exception {
final BankStatementAnalyzer bankStatementAnalyzer
= new BankStatementAnalyzer();
final BankStatementParser bankStatementParser
= new BankStatementCSVParser();
final Exporter exporter = new HtmlExporter();
bankStatementAnalyzer.analyze("bank-data-simple.csv", bankStatementParser, exporter);
}
}
| [
"sojeongw.official@gmail.com"
] | sojeongw.official@gmail.com |
c53aa3fc21d68d2f2a1d845f17301e09b17c95f6 | 9d83de9dacafd69c6ab1f52648ecaafbf25edb79 | /PrimeHomework.java | 90ac24dd4228f26b4f489d5c42abfd476c5b0ee5 | [] | no_license | Alice0618/NCNU-Java | 534d34b6d356945bf1ee0469cc3fc73b5e107eb6 | 4a57717cc3c815330a0b7050222850a09f23b671 | refs/heads/master | 2021-01-25T05:51:13.824497 | 2017-04-20T05:32:03 | 2017-04-20T05:32:03 | 80,697,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,714 | java | // 運用兩種不同找質數的方法(測試法、刪去法), 求出在某一個數字底下有多少個質數, 以及兩種方法所花費的時間
import java.util.Scanner;
public class PrimeHomework{
// 判斷是否為質數
public static boolean isPrime(int n){
for (int i = 2;i*i <= n;i++){
if (n%i==0)
return false;
}
return true;
}
// 測試法
public static int prime(int n){
int counter = 0;
for(int i=2;i<=n;i++){
if(isPrime(i))
counter++;
}
return counter;
}
// 刪除法
public static int p2(int n){
// the default value of boolean array is false
boolean[] deleted = new boolean[n];
int counter=0;
for (int i=2;i<n;i++){
// find a primes
if(!deleted[i]){
counter++;
for(int j=2*i;j<n;j=j+i)
deleted[j]=true;
}
}
return counter;
}
public static void main(String[] argv){
Scanner input = new Scanner(System.in);
int n = input.nextInt();
// 測試前時間
long starTime=System.currentTimeMillis();
int j=prime(n);
// 測試後時間
long endTime=System.currentTimeMillis();
// 刪除前時間
long staTime=System.currentTimeMillis();
int i=p2(n);
// 刪除後時間
long enTime=System.currentTimeMillis();
System.out.println("測試法 "+j+"個 "+(endTime-starTime)+"ms");
System.out.println("刪除法 "+i+"個 "+(enTime-staTime)+"ms");
}
}
| [
"kiki86722@gmail.com"
] | kiki86722@gmail.com |
197fc2bf8f23ce9f9dd7180b10312b5ccb7c5f9a | 182d6f40c2a97abad22f3939df6e5fb547e5744d | /tests/office365-files-lists-sdk-e2etests/src/com/microsoft/office365/test/integration/framework/TestStatus.java | 4f0eeafe1d7bad5d9d2b3d536b31b33f2cd65677 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | ashank/Office-365-SDK-for-Android | 6488d4dc41759661601394fb1842c41b6ae63076 | 935a58a66f23e80f237224b2b3dad92b5b1419ad | refs/heads/master | 2021-01-13T14:04:58.224879 | 2014-03-05T12:22:40 | 2014-03-05T12:22:40 | 17,461,088 | 3 | 4 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | /*
Copyright (c) Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
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.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
package com.microsoft.office365.test.integration.framework;
public enum TestStatus {
NotRun, Running, Failed, Passed
}
| [
"marcost@lagash.com"
] | marcost@lagash.com |
166fc890f2f605b0ca8dc38bff47751efa50607a | 6bd4842bdfa8ba379d2365dfba9f07f9d9ceaa37 | /RxHttp/src/main/java/com/github/eajon/base/BaseMvpFragment.java | e1eab4c41a8941d7bf3fcb35724ad8661b6dbe91 | [] | no_license | daiye830505/RxHttp | 5c724f04eb0526dae5474bf2f25b9f8511178e66 | 8a973733531f15093a1c0098f67b2bbbf44aba78 | refs/heads/master | 2020-03-30T07:34:16.009842 | 2018-09-30T08:45:04 | 2018-09-30T08:45:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package com.github.eajon.base;
import android.os.Bundle;
import com.github.eajon.rxbus.RxIResponse;
import com.github.eajon.rxbus.RxPresenter;
import com.trello.rxlifecycle2.components.support.RxFragment;
public abstract class BaseMvpFragment extends RxFragment implements RxIResponse {
RxPresenter rxPresenter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
rxPresenter = new RxPresenter(this);
rxPresenter.attachView(this);
rxPresenter.observe();
}
@Override
public void onDestroy() {
super.onDestroy();
rxPresenter.detachView();
}
}
| [
"975677067@qq.com"
] | 975677067@qq.com |
b967b4be9f064122149636e7bd1ddbad6cadc623 | a9c2805612ba304ef6421eeb998a036afed1b63d | /spring-boot-test/src/main/java/com/actor/spring_boot_test/config/SwaggerConfig.java | 08c1324a0724f9fca5be3014daf76070af439cdb | [] | no_license | actor20170211030627/JavaEETestProject | b2158ca999921fd8dbc6acf0bcca1c2f34c118e7 | 0afe7700017976b3aded4f70e2631f8ebc65b546 | refs/heads/master | 2023-03-05T04:11:18.584929 | 2022-11-24T06:07:01 | 2022-11-24T06:07:01 | 242,459,924 | 0 | 1 | null | 2023-02-22T08:40:18 | 2020-02-23T05:06:18 | Java | UTF-8 | Java | false | false | 1,621 | java | package com.actor.spring_boot_test.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Description: Swagger配置, 访问地址:
* http://localhost:8080/swagger-ui.html
* http://localhost:8080/doc.html (swagger增强版)
*
* Date : 2020/2/23 on 15:54
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.actor.spring_boot_test.controller"))
.paths(PathSelectors.any()).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("JavaEE测试项目 Manage Swagger RESTful APIs")
.description("JavaEE测试项目 Swagger API 服务")
.termsOfServiceUrl("http://swagger.io/")
.contact(new Contact("Actor Lee", "https://github.com/actor20170211030627", "1455198886@qq.com"))
.version("1.0")
.build();
}
}
| [
"1455198886@qq.com"
] | 1455198886@qq.com |
0d154acfa49d93b677159487b6df227ce6540b9f | dbebb719052b126a7359d38dd82337c5b8870f90 | /spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java | 83730ec28edfaf628c75bdb94567b13f3f0ba351 | [] | no_license | gaohongming1/spring-code-unscramble | ab8e2655d2792df35086d39b8e6f37d2593ea453 | 66e375fc77bde442744b06b1c8d07517a6d5a336 | refs/heads/main | 2023-08-05T12:55:03.616603 | 2021-09-22T11:50:55 | 2021-09-22T11:50:55 | 409,171,718 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 28,950 | java | /*
* Copyright 2002-2014 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.context.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.annotation.PostConstruct;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.scope.ScopedObject;
import org.springframework.aop.scope.ScopedProxyUtils;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.ChildBeanDefinition;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.componentscan.simple.SimpleComponent;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.DescriptiveResource;
import org.springframework.stereotype.Component;
import org.springframework.tests.sample.beans.ITestBean;
import org.springframework.tests.sample.beans.TestBean;
import org.springframework.util.Assert;
import static org.junit.Assert.*;
/**
* @author Chris Beams
* @author Juergen Hoeller
* @author Sam Brannen
*/
public class ConfigurationClassPostProcessorTests {
private DefaultListableBeanFactory beanFactory;
@Before
public void setUp() {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
QualifierAnnotationAutowireCandidateResolver acr = new QualifierAnnotationAutowireCandidateResolver();
acr.setBeanFactory(bf);
bf.setAutowireCandidateResolver(acr);
this.beanFactory = bf;
}
/**
* Enhanced {@link Configuration} classes are only necessary for respecting
* certain bean semantics, like singleton-scoping, scoped proxies, etc.
* <p>Technically, {@link ConfigurationClassPostProcessor} could fail to enhance the
* registered Configuration classes and many use cases would still work.
* Certain cases, however, like inter-bean singleton references would not.
* We test for such a case below, and in doing so prove that enhancement is
* working.
*/
@Test
public void enhancementIsPresentBecauseSingletonSemanticsAreRespected() {
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
Foo foo = beanFactory.getBean("foo", Foo.class);
Bar bar = beanFactory.getBean("bar", Bar.class);
assertSame(foo, bar.foo);
}
@Test
public void configurationIntrospectionOfInnerClassesWorksWithDotNameSyntax() {
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(getClass().getName() + ".SingletonBeanConfig"));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
Foo foo = beanFactory.getBean("foo", Foo.class);
Bar bar = beanFactory.getBean("bar", Bar.class);
assertSame(foo, bar.foo);
}
/**
* Tests the fix for SPR-5655, a special workaround that prefers reflection
* over ASM if a bean class is already loaded.
*/
@Test
public void alreadyLoadedConfigurationClasses() {
beanFactory.registerBeanDefinition("unloadedConfig", new RootBeanDefinition(UnloadedConfig.class.getName()));
beanFactory.registerBeanDefinition("loadedConfig", new RootBeanDefinition(LoadedConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.getBean("foo");
beanFactory.getBean("bar");
}
/**
* Tests whether a bean definition without a specified bean class is handled
* correctly.
*/
@Test
public void postProcessorIntrospectsInheritedDefinitionsCorrectly() {
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
beanFactory.registerBeanDefinition("parent", new RootBeanDefinition(TestBean.class));
beanFactory.registerBeanDefinition("child", new ChildBeanDefinition("parent"));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
Foo foo = beanFactory.getBean("foo", Foo.class);
Bar bar = beanFactory.getBean("bar", Bar.class);
assertSame(foo, bar.foo);
}
@Test
public void postProcessorWorksWithComposedConfigurationUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(ComposedConfigurationClass.class);
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedConfigurationUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(ComposedConfigurationClass.class.getName());
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedConfigurationWithAttributeOverrideForBasePackageUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedConfigurationWithAttributeOverrideForBasePackage.class);
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedConfigurationWithAttributeOverrideForBasePackageUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedConfigurationWithAttributeOverrideForBasePackage.class.getName());
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedConfigurationWithAttributeOverrideForExcludeFilterUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedConfigurationWithAttributeOverrideForExcludeFilter.class);
assertSupportForComposedAnnotationWithExclude(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedConfigurationWithAttributeOverrideForExcludeFilterUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedConfigurationWithAttributeOverrideForExcludeFilter.class.getName());
assertSupportForComposedAnnotationWithExclude(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedComposedConfigurationWithAttributeOverridesUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedComposedConfigurationWithAttributeOverridesClass.class);
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithComposedComposedConfigurationWithAttributeOverridesUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
ComposedComposedConfigurationWithAttributeOverridesClass.class.getName());
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithMetaComponentScanConfigurationWithAttributeOverridesUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
MetaComponentScanConfigurationWithAttributeOverridesClass.class);
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithMetaComponentScanConfigurationWithAttributeOverridesUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
MetaComponentScanConfigurationWithAttributeOverridesClass.class.getName());
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithMetaComponentScanConfigurationWithAttributeOverridesSubclassUsingReflection() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
SubMetaComponentScanConfigurationWithAttributeOverridesClass.class);
assertSupportForComposedAnnotation(beanDefinition);
}
@Test
public void postProcessorWorksWithMetaComponentScanConfigurationWithAttributeOverridesSubclassUsingAsm() {
RootBeanDefinition beanDefinition = new RootBeanDefinition(
SubMetaComponentScanConfigurationWithAttributeOverridesClass.class.getName());
assertSupportForComposedAnnotation(beanDefinition);
}
private void assertSupportForComposedAnnotation(RootBeanDefinition beanDefinition) {
beanFactory.registerBeanDefinition("config", beanDefinition);
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.setEnvironment(new StandardEnvironment());
pp.postProcessBeanFactory(beanFactory);
SimpleComponent simpleComponent = beanFactory.getBean(SimpleComponent.class);
assertNotNull(simpleComponent);
}
private void assertSupportForComposedAnnotationWithExclude(RootBeanDefinition beanDefinition) {
beanFactory.registerBeanDefinition("config", beanDefinition);
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.setEnvironment(new StandardEnvironment());
pp.postProcessBeanFactory(beanFactory);
try {
beanFactory.getBean(SimpleComponent.class);
fail("Should have thrown NoSuchBeanDefinitionException");
}
catch (NoSuchBeanDefinitionException ex) {
// expected
}
}
@Test
public void postProcessorOverridesNonApplicationBeanDefinitions() {
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setRole(RootBeanDefinition.ROLE_SUPPORT);
beanFactory.registerBeanDefinition("bar", rbd);
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
Foo foo = beanFactory.getBean("foo", Foo.class);
Bar bar = beanFactory.getBean("bar", Bar.class);
assertSame(foo, bar.foo);
}
@Test
public void postProcessorDoesNotOverrideRegularBeanDefinitions() {
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setResource(new DescriptiveResource("XML or something"));
beanFactory.registerBeanDefinition("bar", rbd);
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.getBean("foo", Foo.class);
beanFactory.getBean("bar", TestBean.class);
}
@Test
public void postProcessorDoesNotOverrideRegularBeanDefinitionsEvenWithScopedProxy() {
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setResource(new DescriptiveResource("XML or something"));
BeanDefinitionHolder proxied = ScopedProxyUtils.createScopedProxy(
new BeanDefinitionHolder(rbd, "bar"), beanFactory, true);
beanFactory.registerBeanDefinition("bar", proxied.getBeanDefinition());
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(SingletonBeanConfig.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.getBean("foo", Foo.class);
beanFactory.getBean("bar", TestBean.class);
}
@Test
public void scopedProxyTargetMarkedAsNonAutowireCandidate() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
beanFactory.registerBeanDefinition("config", new RootBeanDefinition(ScopedProxyConfigurationClass.class));
beanFactory.registerBeanDefinition("consumer", new RootBeanDefinition(ScopedProxyConsumer.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
ITestBean injected = beanFactory.getBean("consumer", ScopedProxyConsumer.class).testBean;
assertTrue(injected instanceof ScopedObject);
assertSame(beanFactory.getBean("scopedClass"), injected);
assertSame(beanFactory.getBean(ITestBean.class), injected);
}
@Test
public void processingAllowedOnlyOncePerProcessorRegistryPair() {
DefaultListableBeanFactory bf1 = new DefaultListableBeanFactory();
DefaultListableBeanFactory bf2 = new DefaultListableBeanFactory();
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(bf1); // first invocation -- should succeed
try {
pp.postProcessBeanFactory(bf1); // second invocation for bf1 -- should throw
fail("expected exception");
}
catch (IllegalStateException ex) {
}
pp.postProcessBeanFactory(bf2); // first invocation for bf2 -- should succeed
try {
pp.postProcessBeanFactory(bf2); // second invocation for bf2 -- should throw
fail("expected exception");
}
catch (IllegalStateException ex) {
}
}
@Test
public void genericsBasedInjection() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
RootBeanDefinition bd = new RootBeanDefinition(RepositoryInjectionBean.class);
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
beanFactory.registerBeanDefinition("annotatedBean", bd);
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(RepositoryConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
RepositoryInjectionBean bean = (RepositoryInjectionBean) beanFactory.getBean("annotatedBean");
assertEquals("Repository<String>", bean.stringRepository.toString());
assertEquals("Repository<Integer>", bean.integerRepository.toString());
}
@Test
public void genericsBasedInjectionWithScoped() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
RootBeanDefinition bd = new RootBeanDefinition(RepositoryInjectionBean.class);
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
beanFactory.registerBeanDefinition("annotatedBean", bd);
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(ScopedRepositoryConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
RepositoryInjectionBean bean = (RepositoryInjectionBean) beanFactory.getBean("annotatedBean");
assertEquals("Repository<String>", bean.stringRepository.toString());
assertEquals("Repository<Integer>", bean.integerRepository.toString());
}
@Test
public void genericsBasedInjectionWithScopedProxy() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
RootBeanDefinition bd = new RootBeanDefinition(RepositoryInjectionBean.class);
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
beanFactory.registerBeanDefinition("annotatedBean", bd);
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(ScopedProxyRepositoryConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.freezeConfiguration();
RepositoryInjectionBean bean = (RepositoryInjectionBean) beanFactory.getBean("annotatedBean");
assertEquals("Repository<String>", bean.stringRepository.toString());
assertEquals("Repository<Integer>", bean.integerRepository.toString());
}
@Test
public void genericsBasedInjectionWithImplTypeAtInjectionPoint() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
RootBeanDefinition bd = new RootBeanDefinition(SpecificRepositoryInjectionBean.class);
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
beanFactory.registerBeanDefinition("annotatedBean", bd);
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(SpecificRepositoryConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.preInstantiateSingletons();
SpecificRepositoryInjectionBean bean = (SpecificRepositoryInjectionBean) beanFactory.getBean("annotatedBean");
assertSame(beanFactory.getBean("genericRepo"), bean.genericRepository);
}
@Test
public void genericsBasedInjectionWithFactoryBean() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
RootBeanDefinition bd = new RootBeanDefinition(RepositoryFactoryBeanInjectionBean.class);
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
beanFactory.registerBeanDefinition("annotatedBean", bd);
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(RepositoryFactoryBeanConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
beanFactory.preInstantiateSingletons();
RepositoryFactoryBeanInjectionBean bean = (RepositoryFactoryBeanInjectionBean) beanFactory.getBean("annotatedBean");
assertSame(beanFactory.getBean("&repoFactoryBean"), bean.repositoryFactoryBean);
assertSame(beanFactory.getBean("&repoFactoryBean"), bean.qualifiedRepositoryFactoryBean);
assertSame(beanFactory.getBean("&repoFactoryBean"), bean.prefixQualifiedRepositoryFactoryBean);
}
@Test
public void genericsBasedInjectionWithRawMatch() {
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(RawMatchingConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
assertSame(beanFactory.getBean("rawRepo"), beanFactory.getBean("repoConsumer"));
}
@Test
public void genericsBasedInjectionWithWildcardMatch() {
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(WildcardMatchingConfiguration.class));
ConfigurationClassPostProcessor pp = new ConfigurationClassPostProcessor();
pp.postProcessBeanFactory(beanFactory);
assertSame(beanFactory.getBean("genericRepo"), beanFactory.getBean("repoConsumer"));
}
@Test
public void genericsBasedInjectionWithWildcardWithExtendsMatch() {
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(WildcardWithExtendsConfiguration.class));
new ConfigurationClassPostProcessor().postProcessBeanFactory(beanFactory);
assertSame(beanFactory.getBean("stringRepo"), beanFactory.getBean("repoConsumer"));
}
@Test
public void genericsBasedInjectionWithWildcardWithGenericExtendsMatch() {
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(WildcardWithGenericExtendsConfiguration.class));
new ConfigurationClassPostProcessor().postProcessBeanFactory(beanFactory);
assertSame(beanFactory.getBean("genericRepo"), beanFactory.getBean("repoConsumer"));
}
@Test
public void testSelfReferenceExclusionForFactoryMethodOnSameBean() {
AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
bpp.setBeanFactory(beanFactory);
beanFactory.addBeanPostProcessor(bpp);
beanFactory.addBeanPostProcessor(new CommonAnnotationBeanPostProcessor());
beanFactory.registerBeanDefinition("configClass", new RootBeanDefinition(ConcreteConfig.class));
beanFactory.registerBeanDefinition("serviceBeanProvider", new RootBeanDefinition(ServiceBeanProvider.class));
new ConfigurationClassPostProcessor().postProcessBeanFactory(beanFactory);
beanFactory.preInstantiateSingletons();
}
// -------------------------------------------------------------------------
@Configuration
static class SingletonBeanConfig {
public @Bean
Foo foo() {
return new Foo();
}
public @Bean
Bar bar() {
return new Bar(foo());
}
}
static class Foo {
}
static class Bar {
final Foo foo;
public Bar(Foo foo) {
this.foo = foo;
}
}
@Configuration
static class UnloadedConfig {
public @Bean
Foo foo() {
return new Foo();
}
}
@Configuration
static class LoadedConfig {
public @Bean
Bar bar() {
return new Bar(new Foo());
}
}
public static class ScopedProxyConsumer {
@Autowired
public ITestBean testBean;
}
@Configuration
public static class ScopedProxyConfigurationClass {
@Bean
@Lazy
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
public ITestBean scopedClass() {
return new TestBean();
}
}
public static class Repository<T> {
}
public static class GenericRepository<T> extends Repository<T> {
}
public static class RepositoryFactoryBean<T> implements FactoryBean<T> {
@Override
public T getObject() {
throw new IllegalStateException();
}
@Override
public Class<?> getObjectType() {
return Object.class;
}
@Override
public boolean isSingleton() {
return false;
}
}
public static class RepositoryInjectionBean {
@Autowired
public Repository<String> stringRepository;
@Autowired
public Repository<Integer> integerRepository;
}
@Configuration
public static class RepositoryConfiguration {
@Bean
public Repository<String> stringRepo() {
return new Repository<String>() {
@Override
public String toString() {
return "Repository<String>";
}
};
}
@Bean
public Repository<Integer> integerRepo() {
return new Repository<Integer>() {
@Override
public String toString() {
return "Repository<Integer>";
}
};
}
@Bean
public Repository<?> genericRepo() {
return new Repository<Object>() {
@Override
public String toString() {
return "Repository<Object>";
}
};
}
}
@Configuration
public static class ScopedRepositoryConfiguration {
@Bean
@Scope("prototype")
public Repository<String> stringRepo() {
return new Repository<String>() {
@Override
public String toString() {
return "Repository<String>";
}
};
}
@Bean
@Scope("prototype")
public Repository<Integer> integerRepo() {
return new Repository<Integer>() {
@Override
public String toString() {
return "Repository<Integer>";
}
};
}
@Bean
@Scope("prototype")
@SuppressWarnings("rawtypes")
public Repository genericRepo() {
return new Repository<Object>() {
@Override
public String toString() {
return "Repository<Object>";
}
};
}
}
@Configuration
public static class ScopedProxyRepositoryConfiguration {
@Bean
@Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Repository<String> stringRepo() {
return new Repository<String>() {
@Override
public String toString() {
return "Repository<String>";
}
};
}
@Bean
@Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Repository<Integer> integerRepo() {
return new Repository<Integer>() {
@Override
public String toString() {
return "Repository<Integer>";
}
};
}
}
public static class SpecificRepositoryInjectionBean {
@Autowired
public GenericRepository<?> genericRepository;
}
@Configuration
public static class SpecificRepositoryConfiguration {
@Bean
public Repository<Object> genericRepo() {
return new GenericRepository<Object>();
}
}
public static class RepositoryFactoryBeanInjectionBean {
@Autowired
public RepositoryFactoryBean<?> repositoryFactoryBean;
@Autowired
@Qualifier("repoFactoryBean")
public RepositoryFactoryBean<?> qualifiedRepositoryFactoryBean;
@Autowired
@Qualifier("&repoFactoryBean")
public RepositoryFactoryBean<?> prefixQualifiedRepositoryFactoryBean;
}
@Configuration
public static class RepositoryFactoryBeanConfiguration {
@Bean
public RepositoryFactoryBean<Object> repoFactoryBean() {
return new RepositoryFactoryBean<>();
}
}
@Configuration
public static class RawMatchingConfiguration {
@Bean
@SuppressWarnings("rawtypes")
public Repository rawRepo() {
return new Repository();
}
@Bean
public Object repoConsumer(Repository<String> repo) {
return repo;
}
}
@Configuration
public static class WildcardMatchingConfiguration {
@Bean
@SuppressWarnings("rawtypes")
public Repository<?> genericRepo() {
return new Repository();
}
@Bean
public Object repoConsumer(Repository<String> repo) {
return repo;
}
}
@Configuration
public static class WildcardWithExtendsConfiguration {
@Bean
public Repository<? extends String> stringRepo() {
return new Repository<String>();
}
@Bean
public Repository<? extends Number> numberRepo() {
return new Repository<Number>();
}
@Bean
public Object repoConsumer(Repository<? extends String> repo) {
return repo;
}
}
@Configuration
public static class WildcardWithGenericExtendsConfiguration {
@Bean
public Repository<? extends Object> genericRepo() {
return new Repository<String>();
}
@Bean
public Repository<? extends Number> numberRepo() {
return new Repository<Number>();
}
@Bean
public Object repoConsumer(Repository<String> repo) {
return repo;
}
}
@Configuration
@ComponentScan(basePackages = "org.springframework.context.annotation.componentscan.simple")
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public static @interface ComposedConfiguration {
}
@ComposedConfiguration
public static class ComposedConfigurationClass {
}
@Configuration
@ComponentScan
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public static @interface ComposedConfigurationWithAttributeOverrides {
String[] basePackages() default {};
ComponentScan.Filter[] excludeFilters() default {};
}
@ComposedConfigurationWithAttributeOverrides(basePackages = "org.springframework.context.annotation.componentscan.simple")
public static class ComposedConfigurationWithAttributeOverrideForBasePackage {
}
@ComposedConfigurationWithAttributeOverrides(basePackages = "org.springframework.context.annotation.componentscan.simple",
excludeFilters = @ComponentScan.Filter(Component.class))
public static class ComposedConfigurationWithAttributeOverrideForExcludeFilter {
}
@ComposedConfigurationWithAttributeOverrides
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public static @interface ComposedComposedConfigurationWithAttributeOverrides {
String[] basePackages() default {};
}
@ComposedComposedConfigurationWithAttributeOverrides(basePackages = "org.springframework.context.annotation.componentscan.simple")
public static class ComposedComposedConfigurationWithAttributeOverridesClass {
}
@ComponentScan
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public static @interface MetaComponentScan {
}
@MetaComponentScan
@Configuration
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public static @interface MetaComponentScanConfigurationWithAttributeOverrides {
String[] basePackages() default {};
}
@MetaComponentScanConfigurationWithAttributeOverrides(basePackages = "org.springframework.context.annotation.componentscan.simple")
public static class MetaComponentScanConfigurationWithAttributeOverridesClass {
}
@Configuration
public static class SubMetaComponentScanConfigurationWithAttributeOverridesClass extends
MetaComponentScanConfigurationWithAttributeOverridesClass {
}
public static class ServiceBean {
private final String parameter;
public ServiceBean(String parameter) {
this.parameter = parameter;
}
public String getParameter() {
return parameter;
}
}
@Configuration
public static abstract class AbstractConfig {
@Bean
public ServiceBean serviceBean() {
return provider().getServiceBean();
}
@Bean
public ServiceBeanProvider provider() {
return new ServiceBeanProvider();
}
}
@Configuration
public static class ConcreteConfig extends AbstractConfig {
@Autowired
private ServiceBeanProvider provider;
@Bean
@Override
public ServiceBeanProvider provider() {
return provider;
}
@PostConstruct
public void validate() {
Assert.notNull(provider);
}
}
@Primary
public static class ServiceBeanProvider {
public ServiceBean getServiceBean() {
return new ServiceBean("message");
}
}
}
| [
"gaohongming3@jd.com"
] | gaohongming3@jd.com |
34315446c4df342eed332db3e3b28b56fdc91681 | b58a8d21466a76f45f9627884955266174951fec | /app/src/main/java/com/google/counsellingadmin/LoginScreen.java | 1c695b8cd4c2764b7810e9f0df4215441f51da6d | [] | no_license | wmudit/Counselling-Admin | 330cd7e54acd2d9474885b6e7ef220a2d62872e9 | 33691be48d16b2c1a4b951abedeee04396971abc | refs/heads/master | 2021-07-09T15:09:12.165699 | 2017-10-09T13:55:06 | 2017-10-09T13:55:06 | 106,290,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,027 | java | package com.google.counsellingadmin;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class LoginScreen extends AppCompatActivity {
private static final String TAG = "SignIn";
FirebaseAuth mAuth;
private EditText emailInput;
private EditText passwordInput;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_screen);
emailInput = (EditText) findViewById(R.id.emailInput);
passwordInput = (EditText) findViewById(R.id.passwordInput);
mAuth = FirebaseAuth.getInstance();
Button signInButton = (Button) findViewById(R.id.email_sign_in_button);
signInButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signIn(emailInput.getText().toString(), passwordInput.getText().toString());
}
});
Button signOutButton = (Button) findViewById(R.id.sign_out_button);
signOutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signOut();
}
});
}
private boolean validateForm() {
boolean valid = true;
String email = emailInput.getText().toString();
if (TextUtils.isEmpty(email)) {
emailInput.setError("Required.");
valid = false;
} else {
emailInput.setError(null);
}
String password = passwordInput.getText().toString();
if (TextUtils.isEmpty(password)) {
passwordInput.setError("Required.");
valid = false;
} else {
passwordInput.setError(null);
}
return valid;
}
private void updateUI(FirebaseUser user) {
if (user != null) {
findViewById(R.id.email_login_form).setVisibility(View.GONE);
findViewById(R.id.sign_out_button).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.email_login_form).setVisibility(View.VISIBLE);
findViewById(R.id.sign_out_button).setVisibility(View.GONE);
}
}
private void signIn(String email, String password) {
Log.d(TAG, "signIn: " + email);
if (!validateForm()) {
return;
}
mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Log.d(TAG, "signInWithEmail:success");
Toast.makeText(LoginScreen.this, "Signed in", Toast.LENGTH_SHORT).show();
FirebaseUser user = mAuth.getCurrentUser();
updateUI(user);
//addUserToDatabase(user);
Intent intent = new Intent(LoginScreen.this, Blogs.class);
startActivity(intent);
} else {
Log.w(TAG, "signInWithEmail:failure");
Toast.makeText(LoginScreen.this, "Authentication Failed", Toast.LENGTH_SHORT).show();
updateUI(null);
}
}
});
}
private void signOut(){
mAuth.signOut();
updateUI(null);
Toast.makeText(LoginScreen.this, "Signed out", Toast.LENGTH_SHORT).show();
}
}
| [
"wmudit@gmail.com"
] | wmudit@gmail.com |
00a0a00b194b5e2a1de92e81ed05cdcfb7a52213 | ed11010def872d9845c3712ab3d69f25990d0a5f | /example/src/main/java/ru/proitr/example/repository/UserRepository.java | 902d4f29699c3e904e10ecf371f37a549c0a7ad0 | [] | no_license | northgroupru/java | f7695255cbb27f47088e23ae3ca5393add26f1f8 | 9475f5efc2f45713778f85e5713f9d19af137c72 | refs/heads/master | 2021-01-19T17:03:19.645356 | 2017-09-19T08:35:42 | 2017-09-19T08:35:42 | 101,040,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | package ru.proitr.example.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import ru.proitr.example.domain.auth.ProjectUser;
import ru.proitr.example.domain.auth.Role;
import java.util.List;
/**
* Created by Gainutdinov on 04.09.17.
*/
@Repository
public interface UserRepository extends CustomJpaRepository<ProjectUser, String>
{
ProjectUser findByLoginIgnoreCase(String login);
@Query("select c.roles from ProjectUser c where c.login = :login")
List<Role> getProjectUserRolesByLogin(@Param("login") String login);
}
| [
"gainutdinov@proitr.ru"
] | gainutdinov@proitr.ru |
51a662cc814c238c27cff729710a429c3d725d6b | 2f921ceba1bec1b305b6001894e6d6cc918212e6 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/ROOT/org/apache/jsp/WEB_002dINF/views/mypage/counseling_jsp.java | 4064fa8326a2c367e95e9c5eece22030a0ca04b4 | [] | no_license | jangyoonhee/springboot | e4b68b726da605679f97b1155e9634afd3d050a4 | cbc0a1099c39a79450f154c7471d3c7f6468906f | refs/heads/master | 2020-06-22T22:12:54.341995 | 2019-09-09T05:52:50 | 2019-09-09T05:52:50 | 198,413,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,924 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/8.5.35
* Generated at: 2019-05-12 03:41:20 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.views.mypage;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class counseling_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = null;
}
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\n");
out.write("\n");
out.write("<html>\n");
out.write("<head>\n");
out.write("\t<title>COUNSELING</title>\n");
out.write("</head>\n");
out.write("<body>\n");
out.write("<h1>\n");
out.write("\tMYPAGE >> COUNSELING\n");
out.write("</h1>\n");
out.write("</body>\n");
out.write("\n");
out.write("</html>\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"yh0109094@gmail.com"
] | yh0109094@gmail.com |
c301342856efad1c91adb4f60c8c39a1ddf47738 | 26f891945817ad2eeada11fe4ba8ea65218e6970 | /ARController/ArApp/src/main/java/edu/mpc/utexas/arcontroller/arApplication/BaseApplication/utils/LoadingDialogHandler.java | ca4ba4ab06834093686c730b09511f55d45c2e34 | [
"BSD-3-Clause"
] | permissive | UT-MPC/ArcIoT_PerIoT_2021 | 4ad04bb6a4b5c58fa2d2b47ebc0cdec0024270ce | 6ebf6b1dc96893c1d05f4f4a611df9932ba09e07 | refs/heads/main | 2023-03-28T18:25:41.910820 | 2021-03-26T16:58:01 | 2021-03-26T16:58:01 | 327,367,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,603 | java | /*===============================================================================
Copyright (c) 2016,2018 PTC Inc. All Rights Reserved.
Copyright (c) 2012-2014 Qualcomm Connected Experiences, Inc. All Rights Reserved.
Vuforia is a trademark of PTC Inc., registered in the United States and other
countries.
===============================================================================*/
package edu.mpc.utexas.arcontroller.arApplication.BaseApplication.utils;
import android.app.Activity;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import java.lang.ref.WeakReference;
/**
* This class handles the loading dialog present in all of the activities.
*/
public final class LoadingDialogHandler extends Handler
{
private final WeakReference<Activity> mActivityRef;
// Constants for Hiding/Showing Loading dialog
public static final int HIDE_LOADING_DIALOG = 0;
public static final int SHOW_LOADING_DIALOG = 1;
public View mLoadingDialogContainer;
public LoadingDialogHandler(Activity activity)
{
mActivityRef = new WeakReference<>(activity);
}
public void handleMessage(Message msg)
{
Activity activity = mActivityRef.get();
if (activity == null)
{
return;
}
if (msg.what == SHOW_LOADING_DIALOG)
{
mLoadingDialogContainer.setVisibility(View.VISIBLE);
} else if (msg.what == HIDE_LOADING_DIALOG)
{
mLoadingDialogContainer.setVisibility(View.GONE);
}
}
}
| [
"mich94hj@utexas.edu"
] | mich94hj@utexas.edu |
6213f71d169a843bc9dcbfa4513745096ffcf4e7 | 8095c1ad1b74e0e97a86630d878c3e8eb6edd62d | /VIS/2.1/server/api/MultipartElement.java | 014f4a95c0567cece661191a807b16d5e5a871d8 | [] | no_license | BartoszKonkol/projects | 7fe2cec19a37ef2cb912fa46d740105053e253d2 | 673fd7740d027866236e88a3fbaaa5ade33fe935 | refs/heads/master | 2020-03-19T19:16:55.867533 | 2018-06-10T22:01:45 | 2018-06-10T22:01:45 | 136,848,138 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package net.polishgames.vis2.server.api;
import java.util.Properties;
public interface MultipartElement
{
public abstract Properties giveDescription();
public abstract Properties giveDisposition();
public abstract byte[] giveContent();
}
| [
"bartoszkonkol.info@gmail.com"
] | bartoszkonkol.info@gmail.com |
23ca05e7c045e04ff12890c38f00c1f98a21b435 | d0ccbff285888a66360a4826ffd6e65942e60869 | /src/main/java/org/openaudible/desktop/swt/gui/tables/MultiColumnData.java | 1092e03824a9712ef347842be80ab78732f810e4 | [
"Apache-2.0"
] | permissive | kategray/openaudible | bbbf8b581758231767f8ea375c98f1a7fe7f18eb | 3776ed5071d5b5a5aef49fb77a91139f8599e128 | refs/heads/master | 2020-03-21T19:34:16.395388 | 2018-06-28T01:13:42 | 2018-06-28T01:13:42 | 138,957,191 | 0 | 1 | Apache-2.0 | 2018-06-28T02:40:35 | 2018-06-28T02:40:35 | null | UTF-8 | Java | false | false | 1,056 | java | package org.openaudible.desktop.swt.gui.tables;
public abstract class MultiColumnData extends SingleColumnData {
public MultiColumnData(Comparable<?> c) {
super(c);
}
@Override
public abstract String getTextValue(SuperTable table, int col);
/*
* { switch (col) { case 0: return data.toString(); default: return ""; }
*
* }
*/
public abstract int getSortCol();
@Override
public int compareTo(SuperTable table, SuperTableData that, int col) {
String x = getTextValue(table, col);
String y = that.getTextValue(table, col);
return x.compareTo(y);
}
@Override
public int compareTo(SuperTableData t) {
if (data == null || t == null) {
return -1;
}
assert (false);
// log.error("compareTo called for MultiColumnData. Should call other method.");
return -1;
// if (reverseSort)
// return ((SingleColumnData)t).getData().compareTo(data);
// return compareTo(t, getSortCol());
}
}
| [
"racer@torguard.tg"
] | racer@torguard.tg |
230dad372375f576a2d5835c023524dae62ce278 | 9107eb43c0508e370e95ae98cccd692a6c163b7f | /sams-web/src/main/java/com/zico/sams/controller/HealthCheckController.java | 629f999dfb7f52966173b864f8bfe9d44947ee6f | [] | no_license | Zico1017/sams | 7ce3321ce877a2ab5c78858f23faf6cd53f97e58 | e800ab5c1337286485445f069e605150a629da3a | refs/heads/master | 2020-04-12T01:11:29.486697 | 2018-12-18T04:00:09 | 2018-12-18T04:00:09 | 162,224,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | package com.zico.sams.controller;
import com.google.common.collect.Maps;
import com.zico.sams.annotation.NoNeedLogin;
import com.zico.sams.service.HealthCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* @author zico
* @version v1.0
* @title HealthCheckController
* @package com.zico.sams.controller
* @since 2018-12-17
* description 健康检查
**/
@Api("健康检查Controller")
@RestController
public class HealthCheckController {
@Autowired
private HealthCheckService healthCheckService;
@ApiOperation(value = "健康检查", notes = "健康检查正常则resultCode返回0")
@NoNeedLogin
@GetMapping("/healthCheck")
public Object healthCheck() {
Integer result = healthCheckService.healthCheck();
Map<String, Object> map = Maps.newHashMap();
map.put("resultCode", result == 1 ? "0" : "1");
return map;
}
}
| [
"caihongming@iboxpay.com"
] | caihongming@iboxpay.com |
eaf32fdb5b6f96310b5f3863394619b27b705816 | 419f8b9ba5c0502deeab567da18925194b5cd7a6 | /src/main/java/javaAdvanced/advanced/zadania/intercaces/zadania/zajeciowe/zadanie3/Pokarm.java | 8b01bd982bb33881977f7440014c0b36ee4413ff | [] | no_license | Grzebere/javaKurs | 7bbfbe61f39495abd5e1c29d9433a47072f6aefa | e0da3aaf30b850d1074e558ac8f761624969ffbd | refs/heads/master | 2023-03-23T12:54:35.653070 | 2021-03-11T17:36:52 | 2021-03-11T17:36:52 | 337,475,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | package javaAdvanced.advanced.zadania.intercaces.zadania.zajeciowe.zadanie3;
public class Pokarm {
private String nazwa;
private TypPokarmu typPokarmu;
private int waga;
public Pokarm(String nazwa, TypPokarmu typPokarmu, int waga) {
this.nazwa = nazwa;
this.typPokarmu = typPokarmu;
this.waga = waga;
}
public String getNazwa() {
return nazwa;
}
public TypPokarmu getTypPokarmu() {
return typPokarmu;
}
public int getWaga() {
return waga;
}
}
| [
"68393051+Grzebere@users.noreply.github.com"
] | 68393051+Grzebere@users.noreply.github.com |
1d59e70c0507a6034f0e4767a2898c9054d31001 | 4a3b97bf865153d0807e7f9bbc6f3268d16b0ae3 | /src/main/java/com/Jordan/Example/ThreadExample/E7ReturnValuesUsingCallable.java | 51630104f5e74ce2993aef64380a2661dabb2d32 | [] | no_license | good5dog5/JavaExample | 24eccdd3f225b5bfda63a6326ed848b145d708ce | d3aa9b559d6301d699fa93628ed977def1352095 | refs/heads/master | 2021-02-17T01:42:22.606022 | 2020-11-17T03:07:02 | 2020-11-17T03:07:02 | 245,060,950 | 0 | 0 | null | 2020-03-05T03:35:41 | 2020-03-05T03:35:40 | null | UTF-8 | Java | false | false | 1,780 | java | package com.Jordan.Example.ThreadExample;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class E7ReturnValuesUsingCallable {
public static void main(String[] args) throws InterruptedException, ExecutionException {
System.out.println("Thread main started");
ExecutorService executorService = Executors.newFixedThreadPool(5);
List<Future<Integer>> returnValues = executorService.invokeAll(Arrays.asList(
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50),
new E7SumFirstNum(50)));
for (Future<Integer> value : returnValues) {
System.out.println(value.get());;
}
executorService.shutdown();
System.out.println("Thread main finished");
}
}
@RequiredArgsConstructor
class E7SumFirstNum implements Callable<Integer> {
private final int n;
public Integer call() {
int sum = 0;
for (int i = 0; i <= n; i++) {
System.out.println("[" + Thread.currentThread().getName() + "] Adding " + i);
sum += i;
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return sum;
}
} | [
"jordan.huang@gapp.nthu.edu.tw"
] | jordan.huang@gapp.nthu.edu.tw |
41408b97a1d6d7a3f9d0363ddad3506066fb5605 | cdff06e46e6399d5a2b3f95615066cb63415bba6 | /app/src/main/java/com/zikriganteng/counternumber/CalculatorActivity.java | 348de10f761bac7500b77ca67c75b9d02360974c | [] | no_license | azizikri/Simple-Calculator-Android | 4b249b261df1f5cb07ac6e378e6ec4121426dcaf | 9f8bb5bd56c91721fc9b301439a47e5152f559a0 | refs/heads/master | 2023-06-11T19:32:15.664760 | 2021-07-09T20:28:50 | 2021-07-09T20:28:50 | 384,544,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,801 | java | package com.zikriganteng.counternumber;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class CalculatorActivity extends AppCompatActivity {
TextView workingsTV;
TextView resultsTV;
String workings = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_calculator);
initTextView();
}
private void initTextView(){
workingsTV = findViewById(R.id.workingsTextView);
resultsTV = findViewById(R.id.resultsTextView);
}
private void setWorkings(String givenValue){
workings = workings + givenValue;
workingsTV.setText(workings);
}
public void equalsOnClick(View view) {
Double result = null;
ScriptEngine engine = new ScriptEngineManager().getEngineByName("rhino");
try {
result = (double)engine.eval(workings);
} catch (ScriptException e) {
Toast.makeText(this, "Invalid Input", Toast.LENGTH_SHORT).show();
}
if (result != null){
resultsTV.setText(String.valueOf(result.doubleValue()));
}
}
public void clearOnClick(View view) {
workingsTV.setText("");
workings = "";
resultsTV.setText("");
}
public void bracketsOnClick(View view) {
}
public void powerOfOnClick(View view) {
setWorkings("^");
}
public void divisionOnClick(View view) {
setWorkings("/");
}
public void sevenOnClick(View view) {
setWorkings("7");
}
public void eightOnClick(View view) {
setWorkings("8");
}
public void nineOnClick(View view) {
setWorkings("9");
}
public void timesOnClick(View view) {
setWorkings("*");
}
public void fourOnClick(View view) {
setWorkings("4");
}
public void fiveOnClick(View view) {
setWorkings("5");
}
public void sixOnClick(View view) {
setWorkings("6");
}
public void subtractOnClick(View view) {
setWorkings("-");
}
public void oneOnClick(View view) {
setWorkings("1");
}
public void twoOnClick(View view) {
setWorkings("2");
}
public void threeOnClick(View view) {
setWorkings("3");
}
public void plusOnClick(View view) {
setWorkings("+");
}
public void dotOnClick(View view) {
setWorkings(".");
}
public void zeroOnClick(View view) {
setWorkings("0");
}
} | [
"azizikri15@gmail.com"
] | azizikri15@gmail.com |
791b3878a4f87009d242487e1bd690883a70b560 | 9949cb4d77323e61fbf03daa4dcfae26390ed6b4 | /util/src/DAO/Logger.java | d6d120216187c1c81f1f79807be7b42091a4557b | [] | no_license | mdn81777/java-advanced | d9b578fbc0cacad6a97265ec63bb46985a411c88 | d6d4f7506fa565ee33933f30b6c2bfaaecbc3d1b | refs/heads/master | 2022-07-14T22:18:05.905486 | 2019-05-23T15:21:49 | 2019-05-23T15:21:49 | 175,104,989 | 0 | 0 | null | 2022-06-21T01:07:44 | 2019-03-12T00:28:10 | Java | UTF-8 | Java | false | false | 106 | java | package DAO;
public interface Logger {
//声明输出日志的方法
void log(String message);
}
| [
"1758979656@qq.com"
] | 1758979656@qq.com |
027f7135bfab38011468cd2ac4a49c0c16081c22 | 4468800dd72174adada7c612b4343b9be4898a6d | /web01/src/step06/ex1/FooterServlet.java | 61abcc74abf56561fa3b056c4076d7d6f18e0a1d | [] | no_license | sharryhong/java93-hs | be793ea5d1e692c62939b001eba9d7a314f42be1 | ec73dbe0669d26073ec0fd7e7db99548c466cee9 | refs/heads/master | 2021-01-23T04:34:06.551942 | 2017-06-23T09:13:33 | 2017-06-23T09:13:33 | 86,209,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | /* Footer(꼬리말) 서블릿
* => 다른 서블릿과 협력하여 꼬리말을 출력하는 일을 한다.
*/
package step06.ex1;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns="/step06/footer")
public class FooterServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
PrintWriter out = res.getWriter();
out.println("<div class='footer'>");
out.println(" <span>비트캠프 자바93기</span> | ");
out.println(" <address>서울시 서초구 비트아카데미 빌딩 301호</address>");
out.println("</div>");
}
}
| [
"kshopzoa15@gmail.com"
] | kshopzoa15@gmail.com |
9d6fc20aee6a32601a758af9779db5e47bbcb994 | dc7411d3e13422e3428c15a0433b503a75f5035d | /androidorios/appiumcombat/src/test/java/com/young/appiumcombat/pages/ios/iOS_InitPage.java | 43c0594305471d7a2b287bed2dbc54783c46a62e | [] | no_license | ysycpjj/ysysxjdfapiao | 256ef8287bde76101913fa9bf61b9686d14faefb | 2d7a1a5ae6dda8889c3217c37b25db0222d94615 | refs/heads/master | 2020-06-19T08:24:38.914090 | 2017-06-13T08:51:13 | 2017-06-13T08:51:13 | 94,182,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,490 | java | package com.young.appiumcombat.pages.ios;
import org.openqa.selenium.WebDriverException;
import com.young.appiumcombat.utils.AppiumUtil;
import com.young.appiumcombat.utils.Assertion;
public class iOS_InitPage {
/**初始化页面图片*/
public static final String INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONTYPE ="iOSUIAutomation";
public static final String INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONVALUE = ".scrollViews()[0].images()[0]";
/**设置地区-全国体验版*/
public static final String INITPAGE_RELATIVELAYOUT_NATIONALVERSION_LOACTIONTYPE ="iOSUIAutomation";
public static final String INITPAGE_RELATIVELAYOUT_NATIONALVERSION_LOACTIONVALUE = ".tableViews()[0].cells()[5].staticTexts()[0]";
/**设置地区页面标题-设置之后再次打开该页面显示的标题*/
public static final String INITPAGE_TESTVIEW_TITLE_LOCATIONTYPE = "iOSUIAutomation";
public static final String INITPAGE_TESTVIEW_TITLE_LOCATIONVALUE = ".navigationBars()[0].staticTexts()[0]";
/**首次打开设置地区页面显示的标题*/
//.tableViews()[0].staticTexts()[0]
public static final String INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONTYPE = "iOSUIAutomation";
public static final String INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONVALUE = ".tableViews()[0].staticTexts()[0]";
//.navigationBars()[0].staticTexts()[0]
/**检查初始化页面的图片和翻页元素是否存在*/
public static void pageViewCorrect(AppiumUtil appiumUtil,int i){
appiumUtil.waitForElementToLoad(10,INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONTYPE,INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONVALUE);
Assertion.assertTrue(appiumUtil.doesElementsExist(INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONTYPE,INITPAGE_IMAGVIEW_HELLOIMAGE_LOACTIONVALUE),"经检查:初始化第"+i+"页图片 不存在");
}
/**翻页*/
public static void pageFlip(AppiumUtil appiumUtil) {
appiumUtil.pause(5);
try{
appiumUtil.swipeForiOS("Left",300,1);
}catch(WebDriverException e){
appiumUtil.logWriter("info", "抛出了WebDriverExeption!");
}
}
/**设置为全国体验版*/
public static void setToNationalVersion(AppiumUtil appiumUtil){
appiumUtil.waitForElementToLoad(10,INITPAGE_RELATIVELAYOUT_NATIONALVERSION_LOACTIONTYPE,INITPAGE_RELATIVELAYOUT_NATIONALVERSION_LOACTIONVALUE);
appiumUtil.click(appiumUtil.findElement("iOSUIAutomation",INITPAGE_RELATIVELAYOUT_NATIONALVERSION_LOACTIONVALUE));
}
/**验证是否是全国体验版*/
public static void verifyTheVersion(AppiumUtil appiumUtil){
String value =iOS_HomePage.getCity(appiumUtil);
System.out.println("value ="+value);
Assertion.assertTrue(value.trim().equals("全国"),"期望结果是:全国,实际结果为:"+value+";");
}
/**初始化页面*/
public static void initPageAndCheckPageView(AppiumUtil appiumUtil){
for(int i=1;i<3;i++){
appiumUtil.pause(2);
iOS_InitPage.pageViewCorrect(appiumUtil, i);
iOS_InitPage.pageFlip(appiumUtil);
appiumUtil.pause(2);
}
iOS_InitPage.pageViewCorrect(appiumUtil, 3);
iOS_InitPage.pageFlip(appiumUtil);
appiumUtil.pause(2);
appiumUtil.waitForElementToLoad(10,INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONTYPE,INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONVALUE);
Assertion.assertTrue(appiumUtil.doesElementsExist(INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONTYPE,INITPAGE_TESTVIEW_FIRSTOPENTITLE_LOCATIONVALUE), "经检查:设置地区页面标题 不存在");
appiumUtil.pause(2);
iOS_InitPage.setToNationalVersion(appiumUtil);
appiumUtil.pause(2);
}
}
| [
"yangfangfang@ukonwyangfangfang@uknower.com"
] | yangfangfang@ukonwyangfangfang@uknower.com |
775778a1b082c33d770bfdc9edcc9ca9140485ec | c99b50be998017711d632b8ebf22b541f56e2978 | /2018_spring_16061092_7_1/src/work_7/SPFA.java | 2507cd821de301b14e513e27eac438f8165016c5 | [] | no_license | LuZZhang/BUAA_OO | cc10a81929d2b5ddb18975eb96f022f613366b9a | 22ef836fd1697f0662c0e436ba2d815cab5e618e | refs/heads/master | 2021-09-23T18:15:36.321427 | 2021-09-15T09:58:20 | 2021-09-15T09:58:20 | 173,747,971 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,661 | java | package work_7;
import java.util.ArrayList;
public class SPFA {
public int[] result; //用于得到第s个顶点到其它顶点之间的最短距离
public int[] last;
public int[] next = new int[6400];
//内部类,用于存放图的具体边数据
class edge {
public int a; //边的起点
public int b; //边的终点
public int value; //边的权值
edge(int a, int b, int value) {
this.a = a;
this.b = b;
this.value = value;
}
}
/*
* 参数n:给定图的顶点个数
* 参数s:求取第s个顶点到其它所有顶点之间的最短距离
* 参数edge:给定图的具体边
* 函数功能:如果给定图不含负权回路,则可以得到最终结果,如果含有负权回路,则不能得到最终结果
*/
public boolean getShortestPaths(int s, int p,edge[] A) {//
ArrayList<Integer> list = new ArrayList<Integer>();
result = new int[6400];
boolean[] used = new boolean[6400];
int[] num = new int[6400];
last = new int[6400];//用于得到最短路径
for(int i = 0;i < 6400;i++) {
result[i] = Integer.MAX_VALUE;//s到i的最短距离
used[i] = false;
num[i]=0;
last[i]=i;//初始化时,令下一个结点为他自己
}
result[s] = 0; //第s个顶点到自身距离为0
used[s] = true; //表示第s个顶点进入数组队
num[s] = 1; //表示第s个顶点已被遍历一次
list.add(s); //第s个顶点入队
while(list.size() != 0) {
int a = list.get(0); //获取数组队中第一个元素
list.remove(0); //删除数组队中第一个元素
for(int i = 0;i < p;i++) {
//当list数组队的第一个元素等于边A[i]的起点时
// System.out.println(i);
if(a == A[i].a && result[A[i].b] > result[A[i].a] + 1) {
result[A[i].b] = result[A[i].a] + 1;
last[A[i].b]=a;//上一个
if(!used[A[i].b]) {
list.add(A[i].b);
num[A[i].b]++;
//if(num[A[i].b] > n)
// return false;
used[A[i].b] = true; //表示边A[i]的终点b已进入数组队
}
}
}
used[a] = false; //顶点a出数组对
}
return true;
}
public int distance(int startpoint,int endpoint){//
// Map map = new Map();//绝对不能去掉
SPFA test = new SPFA();
// int startpoint = 34;//qi点3556,3634
// int endpoint = 255;//终点
// System.out.println("sta:"+startpoint+"end:"+endpoint);
edge[] A = new edge[20000];
// System.out.println("请输入具体边的数据:");
int p=0;
for(int x=0,i=0;x<80;x++) {
for(int y=0;y<80;y++) {
i = 80*x+y;
if(y<79&&(Map.map[x][y]==1||Map.map[x][y]==3)) {
A[p]=test.new edge(i,i+1,1);
p++;
A[p]=test.new edge(i+1,i,1);
p++;
}
if(x<79&&(Map.map[x][y]==2||Map.map[x][y]==3)) {
A[p]=test.new edge(i,i+80,1);
p++;
A[p]=test.new edge(i+80,i,1);
p++;
}
}
}
// System.out.println(p);
// System.out.println(A[1]);
if(test.getShortestPaths(startpoint,p, A)) {
// for(int i = 0;i < test.result.length;i++)
// System.out.print(test.result[i]+" ");
// System.out.println("距离为"+test.result[endpoint]);
int j=0,i=endpoint;
while(j!=startpoint) {
j=test.last[i];//i的上一个是j
this.next[j]=i;//j的下一个是i
i=j;
}//这是一个从终点到起点的路径
/*for(int m=startpoint,mm=0;mm<k;mm++) {
System.out.println(test.next[m]);
m=test.next[m];
}*/
//System.out.println(k);
// System.out.println(test.next[0]);
return test.result[endpoint];
} else
System.out.println("给定图存在负环,没有最短距离");
return 0;
}
public int[] getnext() {
return this.next;
}
} | [
"noreply@github.com"
] | noreply@github.com |
e925e0f1210da4099d8ad0cdc10d29ac3cce3c68 | 5ebf663616a96491c439a90d027b0d71b4ee4d47 | /ActiveMQProducerApplication/src/main/java/com/amq/demo/controller/ApplicationController.java | 5922fc8df55537862f9a2a8152db1354beeab9db | [] | no_license | pxbx/activemqdemo | 3e7213dbcf905c63ae6e4d8a968660dd12986787 | 71b9ee1e7ee6cfda5d171003d799b8a009118e31 | refs/heads/master | 2022-07-26T20:00:58.844812 | 2019-03-31T20:25:11 | 2019-03-31T20:25:11 | 178,623,229 | 0 | 0 | null | 2022-07-11T21:04:24 | 2019-03-30T23:50:34 | Java | UTF-8 | Java | false | false | 1,575 | java | /*
*
*/
package com.amq.demo.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.amq.demo.object.QueueObject;
import com.amq.demo.senderservice.JMSSenderService;
import com.amq.demo.util.ApplicationUtil;
/**
* The Class ApplicationController.
*/
@RestController
@RequestMapping("/application")
public class ApplicationController {
/** The jms sender service. */
@Autowired
JMSSenderService jmsSenderService;
/**
* Demo sendto Q 1.
*
* @return the string
*/
@GetMapping(value = "/demo1", produces = MediaType.APPLICATION_JSON_VALUE)
public String demoSendtoQ1() {
System.out.println("CALLING DEMO 1");
QueueObject object = ApplicationUtil.createQueueObject();
System.out.println("SENDING QUEUEOBJECT -> " + object);
jmsSenderService.sendMessage(object, "demo1");
return "ENQUEUED -> ".concat("\n").concat(object.toString());
}
/**
* Demo sendto Q 2.
*
* @return the string
*/
@GetMapping(value = "/demo2", produces = MediaType.APPLICATION_JSON_VALUE)
public String demoSendtoQ2() {
System.out.println("CALLING DEMO 2");
QueueObject object = ApplicationUtil.createQueueObject();
System.out.println("SENDING QUEUEOBJECT -> " + object);
jmsSenderService.sendMessage(object, "demo2");
return "ENQUEUED -> ".concat("\n").concat(object.toString());
}
}
| [
"pinaki.barik@yahoo.com"
] | pinaki.barik@yahoo.com |
9bc32c8eee58902868547206ebe536078acf1b18 | 87df5ad03b0bbbed253ed4a5ba91f7a72a65f1bd | /dubbo.api/src/main/java/com/qyf/dubbowechat/api/IUserService.java | ff123e9e97f547da39f527fd02e724541d6d4ba0 | [] | no_license | qinyufeng/dubbo-project | 92ed5ddacf262d47f56fb1b951c40b799949a8ea | f63f8fabaeb8e28b7f9e0bb103c2a50541bc0446 | refs/heads/master | 2020-03-16T05:29:47.899124 | 2018-06-04T00:24:31 | 2018-06-04T00:24:31 | 132,533,425 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package com.qyf.dubbowechat.api;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author qyf
* @since 2018-05-07
*/
public interface IUserService {
Object queryInfo(Map<String, Object> data);
}
| [
"1085527496@qq.com"
] | 1085527496@qq.com |
6b99ae89bbc80197e9f2e646f1ea883d1d76adab | 7732e70f02f546a8714aa6f83cb352368614eced | /day1ques2.java | 4181ff97a425d7b09f9f88343abc9c3827454129 | [] | no_license | amanthakur-dev/20DAYS | ea6b7f284f950cea9e25c06e8f71c6b279aad9a6 | 437df05239c1ddb8da35afea0287874d431dff7d | refs/heads/master | 2023-04-29T20:49:14.298276 | 2021-05-22T15:42:21 | 2021-05-22T15:42:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | import java.util.*;
public class day1ques2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter word :");
String arr =sc.next();
int n1= arr.length();
int n=n1-1;
char c1=arr.charAt(0);
char c2=arr.charAt(1);
char c3=arr.charAt(2);
char c4=arr.charAt(n);
char c5=arr.charAt(n-1);
char c6=arr.charAt(n-2);
if (c1== 'd' && c2 =='a' && c3=='v' && c4=='i' && c5=='h' && c6=='c' )
{
System.out.println("correct code");
}
else
{
System.out.println("access denied");
}
}
}
| [
"thakuraman2001@gmail.com"
] | thakuraman2001@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.