blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5edf4c784cf7acf8a738e18b56e297d90581030d | a8b5b091df6da6bf39b68a16895234522290b5e9 | /app/src/main/java/com/radicaldroids/weathermap/network/ApiInterface.java | e380bb07a03d38b8d9626c91f3341bc6ab020d39 | [] | no_license | gaggigger/weathermap | 088ea716d61d8398d5e4809ca81586671aaab3f1 | 00918a525c5425c0fb190cc12853d3ed2e154c66 | refs/heads/master | 2021-01-14T14:27:35.146868 | 2016-04-20T05:24:42 | 2016-04-20T05:24:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.radicaldroids.weathermap.network;
import com.radicaldroids.weathermap.Constants;
import com.radicaldroids.weathermap.model.Example;
import retrofit.Call;
import retrofit.http.GET;
import retrofit.http.Query;
/**
* Created by Andrew on 3/18/2016.
*/
public interface ApiInterface {
//limiting forecast data to 1 day to help aleviate work-load on the openweathermap servers
//openweathermap allows up to 14 days of forecast, I would expand this if I get time to work on UI elements
@GET("?appid="+ Constants.WEATHER_API_KEY+"&units=imperial&cnt=1")
Call<Example> getCityData(@Query("lat") Double lat, @Query("lon") Double lon);
}
| [
"radicalalbert@gmail.com"
] | radicalalbert@gmail.com |
5b78fe8a14b6a060a3cfbba43fad2ecc957d24ca | ff1b01a0acdf9f5dd2cebebeb2690e76548ed5a5 | /app/src/main/java/com/tianjin/beichentiyu/ui/activity/my/IntelligentVenuesActivity.java | 4370eccb99f88903cd68ca370bebea282d969a1b | [] | no_license | RusselCK/HongQiaoTiYu | 03bb789d8f7332628219ea60215aa8fcd628b1a9 | ab9a4298647ee056047bf84ab342b99a2f2f35bb | refs/heads/master | 2023-07-12T13:01:14.216522 | 2021-08-19T16:52:54 | 2021-08-19T16:52:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,959 | java | package com.tianjin.beichentiyu.ui.activity.my;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.heitong.frame.GlideApp;
import com.heitong.frame.base.activity.BaseActivity;
import com.heitong.frame.base.adapter.BaseAdapter;
import com.heitong.frame.base.adapter.BaseViewHolder;
import com.tianjin.beichentiyu.R;
import com.tianjin.beichentiyu.api.ApiManager;
import com.tianjin.beichentiyu.api.BaseObserver;
import com.tianjin.beichentiyu.bean.AppointmentBean;
import com.tianjin.beichentiyu.manager.AccountManager;
import com.tianjin.beichentiyu.utils.DateUtils;
import com.tianjin.beichentiyu.utils.ToastUtil;
import com.tianjin.beichentiyu.widget.CustomToolbar;
import java.util.List;
import androidx.core.util.Pair;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 个人中心 智能场馆预约
*/
public class IntelligentVenuesActivity extends BaseActivity{
public static void toActivity(Context context){
context.startActivity(new Intent(context, IntelligentVenuesActivity.class));
}
@BindView(R.id.toolbar)
CustomToolbar mToolbar;
@BindView(R.id.rv_date)
RecyclerView mRvDate;
@BindView(R.id.rv_data)
RecyclerView mRvData;
@BindView(R.id.tv_nodata_view)
TextView mTvNodataView;
private static final int DAY_NUM = 6;
private BaseAdapter mDateAdapter;
private BaseAdapter mDataAdapter;
private List<Pair<String,String>> mDateList;
private List<AppointmentBean.ListBean> mDataList;
private int selectedDate = 0;
@Override
protected int getLayoutResID() {
return R.layout.activity_intelligent_venues;
}
@Override
protected void firstRequest() {
loadData(mDateList.get(0).second);
}
@Override
protected void bindView() {
ButterKnife.bind(this);
initDateRv();
initDataRv();
}
@Override
protected void bindEvent() {
mToolbar.setLeftOnClick(v -> finish());
}
/**
* 初始化日期菜单
*/
private void initDateRv(){
mDateList = DateUtils.getDates(DAY_NUM);
mDateAdapter = new BaseAdapter<Pair<String,String>>(R.layout.adapter_menu_date,mDateList) {
@Override
protected void convert(BaseViewHolder holder, Pair<String,String> item) {
TextView tvWeek = holder.getView(R.id.tv_week);
TextView tvDate = holder.getView(R.id.tv_date);
View viewLine = holder.getView(R.id.view_line);
tvWeek.setText(item.first);
tvDate.setText(item.second.substring(5));
if(selectedDate == holder.getLayoutPosition()){
tvWeek.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
tvWeek.setTextColor(getResources().getColor(R.color.color_161616));
tvDate.setTextColor(getResources().getColor(R.color.color_398DEE));
viewLine.setVisibility(View.VISIBLE);
}else{
tvWeek.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
tvWeek.setTextColor(getResources().getColor(R.color.color_777777));
tvDate.setTextColor(getResources().getColor(R.color.color_777777));
viewLine.setVisibility(View.INVISIBLE);
}
}
};
mDateAdapter.setItemClickListner(position -> {
if(selectedDate == position){
return;
}
selectedDate = position;
mDateAdapter.notifyDataSetChanged();
Pair<String,String> item = mDateList.get(position);
mTvNodataView.setVisibility(View.GONE);
loadData(item.second);
});
mRvDate.setLayoutManager(new GridLayoutManager(this,DAY_NUM));
mRvDate.setAdapter(mDateAdapter);
}
/**
* 初始化列表
*/
private void initDataRv(){
mDataAdapter = new BaseAdapter<AppointmentBean.ListBean>(R.layout.adapter_venue_booking,mDataList) {
@Override
protected void convert(BaseViewHolder holder, AppointmentBean.ListBean item) {
ImageView ivIcon = holder.getView(R.id.iv_icon);
TextView tvTitle = holder.getView(R.id.tv_title);
TextView tvTime = holder.getView(R.id.tv_time);
tvTitle.setText(item.getField_name());
tvTime.setText(item.getTime_slot());
GlideApp.with(ivIcon.getContext()).load(item.getBase_img()).placeholder(R.drawable.icon_field_err).error(R.drawable.icon_field_err).transition(new DrawableTransitionOptions().crossFade()).into(ivIcon);
}
};
mRvData.setLayoutManager(new LinearLayoutManager(this));
mRvData.setAdapter(mDataAdapter);
}
/**
* 加载数据
* @param date
*/
private void loadData(String date){
String tel = AccountManager.getInstance().getMemBean().getTel();
String nonstr = AccountManager.getInstance().getMemBean().getNonstr();
ApiManager.getBusinessService().getMemLogAppointmentIntellectList(tel, nonstr, date)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObserver<AppointmentBean>() {
@Override
protected void onSuccees(AppointmentBean bean) throws Exception {
if (bean.isSuccessful()) {
if (bean.getList().size() > 0){
mTvNodataView.setVisibility(View.GONE);
}else {
mTvNodataView.setVisibility(View.VISIBLE);
}
mDataList = bean.getList();
mDataAdapter.setData(mDataList);
}else{
mDataList = null;
mDataAdapter.setData(null);
ToastUtil.showToast(bean.getMsg());
}
}
@Override
protected void onFailure(Throwable e, boolean isNetWorkError) throws Exception {
ToastUtil.showToast(R.string.request_failure);
mDataList = null;
mDataAdapter.setData(null);
}
});
}
}
| [
"413767955@qq.com"
] | 413767955@qq.com |
714c2676e0a9cd4d96a4eb089b22a7e27f5debfc | a112809c86b7a9f1aed011c121b42ae2b7a3d4d1 | /CarParkingBaySystem2/src/main/java/com/myproject/CarParkingBaySystem/controller/ParkingStructure.java | 5a702df0ad107d065dab5af461d8193cf5ab7365 | [] | no_license | BHHong/CarParkingSystem | ac1679d1aedd4a3f21ce961e0b7344448f55d95a | 3834e08aaf535de15db1a597d8604b116662f0d1 | refs/heads/master | 2021-01-18T21:38:23.532849 | 2017-04-07T10:07:48 | 2017-04-07T10:07:48 | 87,016,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,606 | java | package com.myproject.CarParkingBaySystem.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.myproject.CarParkingBaySystem.exception.ThrowsCustomException;
import com.myproject.CarParkingBaySystem.model.ParkingToken;
public class ParkingStructure implements ParkingStructureOffice {
private static Map<Integer, ParkingToken> occupancy = new ConcurrentHashMap<>();
private int tokenCounter;
private final int totalFreeSpaces;
public ParkingStructure(int totalFreeSpaces) {
this.tokenCounter = 0;
this.totalFreeSpaces = totalFreeSpaces;
}
@Override
public boolean hasSpot() {
return (occupancy.size() < totalFreeSpaces);
}
@Override
public void entryGate() {
if (hasSpot()) {
if (occupancy.putIfAbsent(tokenCounter + 1, new ParkingToken(tokenCounter + 1)) == null) {
System.out.println(Thread.currentThread().getName() + " ENTRY GATE : Token #" + ++tokenCounter + " issued. ["
+ occupancy.size() + "/" + totalFreeSpaces + "]");
if(occupancy.size() > totalFreeSpaces){
new ThrowsCustomException().Error();
System.exit(1); // for testing purpose
}
} else {
System.out.println(Thread.currentThread().getName() + " Retry findSpot.");
entryGate();
}
} else {
new ThrowsCustomException().NoSpot();
}
}
@Override
public void exitGate(Integer tokenNumber) {
if (occupancy.get(tokenNumber).isPaid() == true) {
occupancy.remove(tokenNumber);
System.out.println(Thread.currentThread().getName() + " EXIT GATE : Token #" + tokenNumber + " collected. ["
+ occupancy.size() + "/" + totalFreeSpaces + "]");
} else {
new ThrowsCustomException().Unpaid(tokenNumber);
}
}
@Override
public void pay(Integer tokenNumber, double payment) {
PaymentSystem paymentSystem = new PaymentSystem(occupancy.get(tokenNumber), payment);
if (paymentSystem.isSuccessful()) {
occupancy.put(tokenNumber, paymentSystem.getParkingSpace());
System.out.println(Thread.currentThread().getName() + " Token #" + tokenNumber
+ " payment successful. Please proceed to exit.");
} else {
new ThrowsCustomException().InsufficientFund(tokenNumber);
}
}
@Override
public int capacityInfo() {
System.out.println((totalFreeSpaces-occupancy.size()) + " spaces available, out of " + totalFreeSpaces);
return totalFreeSpaces-occupancy.size();
}
@Override
public List<Integer> getOccupiedInfo(){
return new ArrayList<Integer>(occupancy.keySet());
}
}
| [
"Dean@192.168.0.8"
] | Dean@192.168.0.8 |
b9bdaa6b7b2a9bfadb9ed3134be02074dbb315c1 | df8b0978b6bbf58abacd3c429808fe9d4702e572 | /ISpy/app/src/main/java/com/ackerman/j/gavin/ispy/CameraPickerManager.java | 0b277f82f19f416d4781ba3aa9ef0b3a58a8fb6b | [] | no_license | gavin24/ISpy-Android | 5e4990c681b6de8c9ba5c2cac626f17bd1d75e8c | e0910aa3fd1db580b368ae814bb6c66d51d1d944 | refs/heads/master | 2021-01-19T02:32:57.098856 | 2016-12-09T13:18:39 | 2016-12-09T13:18:39 | 65,702,259 | 0 | 0 | null | 2016-12-09T13:18:39 | 2016-08-15T03:38:25 | Java | UTF-8 | Java | false | false | 122 | java | package com.ackerman.j.gavin.ispy;
/**
* Created by cuan.meyer on 2016/12/09.
*/
public class CameraPickerManager {
}
| [
"cuanmeyer@gmail.com"
] | cuanmeyer@gmail.com |
308396251f0d3bc899dc76b113e0413a282af07a | c47223a6f84586cbe0f5fa9dde5c095b704aa6c0 | /Criptografia/Cripto/src/net/Cripto/Euclides/CriptoEuclideActivity.java | cb35398acc89bcc05a467430e3dc4834b233a2cf | [] | no_license | smaug88/Practices | 842ab72e3391344227b0f26edc34acee81e60315 | 234fe302c98d09cf98344bd3e9f508efa6419d81 | refs/heads/master | 2016-09-05T10:42:22.858562 | 2013-06-06T22:08:34 | 2013-06-06T22:08:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,449 | java | package net.Cripto.Euclides;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.util.Log;
public class CriptoEuclideActivity extends Activity {
private static final String LOGTAG = "LogEuclide :";
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i(LOGTAG, "Creado");
super.onCreate(savedInstanceState);
Log.i(LOGTAG, "Intance State Salvado");
setContentView(net.Cripto.R.layout.euclides);
Log.i(LOGTAG, "Layout asignado");
final Button ButtonEuclideanOk = (Button) findViewById(net.Cripto.R.id.ButtonEuclideanOk);
final Button ButtonEuclideExtended = (Button) findViewById(net.Cripto.R.id.ButtonEuclideExtended);
final Button ButtonEuclideInverted = (Button) findViewById(net.Cripto.R.id.ButtonEuclideInverted);
Log.i(LOGTAG, "Boton asignado");
final EditText EditTextEuclideNumberA = (EditText) findViewById(net.Cripto.R.id.EditTextEuclideNumberA);
Log.i(LOGTAG, "Campo A Asignado");
final EditText EditTextEuclideNumberB = (EditText) findViewById(net.Cripto.R.id.EditTextEuclideNumberB);
Log.i(LOGTAG, "Campo B Asignado");
ButtonEuclideanOk.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Log.i(LOGTAG, "Se ha clickado");
Intent intent = new Intent(CriptoEuclideActivity.this, CriptoEuclideResultActivity.class);
Bundle BudleEuclide = new Bundle();
BudleEuclide.putInt("A", Integer.valueOf(EditTextEuclideNumberA.getText().toString()));
BudleEuclide.putInt("B", Integer.valueOf(EditTextEuclideNumberB.getText().toString()));
BudleEuclide.putInt("Option", 0); // Option = 0 means, Euclide's Method will be applied.
intent.putExtras(BudleEuclide);
Log.i(LOGTAG, "Se ha creado el Intent");
startActivity(intent);
}
});
ButtonEuclideExtended.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Log.i(LOGTAG, "Se ha clickado");
Intent intent = new Intent(CriptoEuclideActivity.this, CriptoEuclideResultActivity.class);
Bundle BudleEuclide = new Bundle();
BudleEuclide.putInt("A", Integer.valueOf(EditTextEuclideNumberA.getText().toString()));
BudleEuclide.putInt("B", Integer.valueOf(EditTextEuclideNumberB.getText().toString()));
BudleEuclide.putInt("Option", 1); // Option = 1 means, Euclide's EXTENDED Method will be applied.
intent.putExtras(BudleEuclide);
Log.i(LOGTAG, "Se ha creado el Intent");
startActivity(intent);
}
});
ButtonEuclideInverted.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Log.i(LOGTAG, "Se ha clickado");
Intent intent = new Intent(CriptoEuclideActivity.this, CriptoEuclideResultActivity.class);
Bundle BudleEuclide = new Bundle();
BudleEuclide.putInt("A", Integer.valueOf(EditTextEuclideNumberA.getText().toString()));
BudleEuclide.putInt("B", Integer.valueOf(EditTextEuclideNumberB.getText().toString()));
BudleEuclide.putInt("Option", 2); // Option = 0 means, Euclide's INVERTED Method will be applied.
intent.putExtras(BudleEuclide);
Log.i(LOGTAG, "Se ha creado el Intent");
startActivity(intent);
}
});
}
}
| [
"smaug888@gmail.com"
] | smaug888@gmail.com |
49b46c1badb846bcfb81587083ff0285ba6b5157 | 91f939c0c7ee9a40793ef3ac9d36293eb8fe7703 | /DashboardJava/src/org/tec/datastructures/BinaryTree.java | a2778e141038b21956dad32b2a417468afec8ed8 | [] | no_license | tsg3/Dashboard | 1fef208fb7f7bbef9ac81fc81119788593df548b | c763b43cb7f4e81b4b8bcd83a51589c2ac6456e9 | refs/heads/master | 2021-05-07T13:59:46.674616 | 2017-11-12T05:09:24 | 2017-11-12T05:09:24 | 109,791,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,075 | java | package org.tec.datastructures;
public class BinaryTree <V> {
public BinaryTreeNode<V> root;
public BinaryTree (){
root = null;
}
public void add (V value){
BinaryTreeNode<V> node = new BinaryTreeNode<>();
node.setValue(value);
if (root == null)
root = node;
else {
BinaryTreeNode<V> current = root;
BinaryTreeNode<V> root;
while (true){
root = current;
if ((Integer) value < (Integer) current.getValue()){
current = current.getLeftChild();
if (current == null){
root.setLeftChild(node);
return;
}
} else {
current = current.getRightChild();
if (current == null) {
root.setRightChild(node);
return;
}
}
}
}
}
public void delete (V value) {
BinaryTreeNode<V> root = this.root;
BinaryTreeNode<V> current = this.root;
boolean isLeftChild = true;
while (current.getValue() != value) {
root = current;
if((Integer) value < (Integer) current.getValue()){
isLeftChild = true;
current = current.getLeftChild();
} else {
isLeftChild = false;
current = current.getRightChild();
}
if (current == null) {
return;
}
}
if (current.getLeftChild()==null && current.getRightChild()==null){
if (current == this.root)
this.root = null;
else if (isLeftChild)
root.setLeftChild(null);
else
root.setRightChild(null);
} else if (current.getRightChild()==null){
if (current == this.root)
this.root = current.getLeftChild();
else if (isLeftChild)
root.setLeftChild(current.getLeftChild());
else
root.setRightChild(current.getLeftChild());
} else if (current.getLeftChild()==null){
if (current == this.root)
this.root = current.getRightChild();
else if (isLeftChild)
root.setLeftChild(current.getRightChild());
else
root.setRightChild(current.getRightChild());
} else {
BinaryTreeNode<V> substitute = substitute(current);
if (current == this.root)
this.root = substitute;
else if (isLeftChild)
root.setLeftChild(substitute);
else
root.setRightChild(substitute);
substitute.setLeftChild(current.getLeftChild());
}
}
public BinaryTreeNode<V> substitute (BinaryTreeNode<V> node){
BinaryTreeNode<V> rootSubstitute = node;
BinaryTreeNode<V> substitute = node;
BinaryTreeNode<V> current=node.getRightChild();
while (current != null){
rootSubstitute = substitute;
substitute = current;
current = current.getLeftChild();
}
if (substitute != node.getRightChild()){
rootSubstitute.setLeftChild(substitute.getRightChild());
substitute.setRightChild(node.getRightChild());
}
return substitute;
}
public void inOrder (BinaryTreeNode<V> current){
if (current != null){
inOrder (current.getLeftChild());
System.out.println(current.getValue()+", ");
inOrder (current.getRightChild());
}
}
public static void main (String[] args){
BinaryTree<Integer> T = new BinaryTree<Integer>();
T.add(6);
T.add(1);
T.add(30);
T.add(13);
T.add(78);
T.add(2);
T.add(3);
T.delete(78);
T.inOrder(T.root);
}
}
| [
"estebandcg1999@gmail.com"
] | estebandcg1999@gmail.com |
9203d247e86dc79bc6369d45eb8e1302d9e669a5 | 44566b7c5259ccbb1137b5e802dbeb0cf1c3f496 | /src/main/java/com/ilopezluna/config/AsyncConfiguration.java | f672e5c5d2ec89059e1831d6db7cf31c2b4f6eb7 | [] | no_license | ilopezluna/trends | abf97fb1249b90b695b255d5f769e8ffe16b1119 | 8ac9c78da4c0a76ae4870ebc81c545ea39d74c3d | refs/heads/master | 2021-01-22T02:53:02.100730 | 2015-05-17T11:38:34 | 2015-05-17T11:38:34 | 35,763,764 | 0 | 1 | null | 2020-09-18T08:48:01 | 2015-05-17T11:36:57 | Java | UTF-8 | Java | false | false | 2,196 | java | package com.ilopezluna.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import com.ilopezluna.async.ExceptionHandlingAsyncTaskExecutor;
@Configuration
@EnableAsync
@EnableScheduling
@Profile("!" + Constants.SPRING_PROFILE_FAST)
public class AsyncConfiguration implements AsyncConfigurer, EnvironmentAware {
private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);
private RelaxedPropertyResolver propertyResolver;
@Override
public void setEnvironment(Environment environment) {
this.propertyResolver = new RelaxedPropertyResolver(environment, "async.");
}
@Override
@Bean
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(propertyResolver.getProperty("corePoolSize", Integer.class, 2));
executor.setMaxPoolSize(propertyResolver.getProperty("maxPoolSize", Integer.class, 50));
executor.setQueueCapacity(propertyResolver.getProperty("queueCapacity", Integer.class, 10000));
executor.setThreadNamePrefix("trends-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}
}
| [
"ignasi.lopez.luna@gmail.com"
] | ignasi.lopez.luna@gmail.com |
1491c20dee8867677645adf2062151bdab2fd796 | eac8e2362ab8e56823693b676b7eac9a19ae6a57 | /app/src/main/java/com/alphago/alphago/fragment/HelpFragment.java | d0ecaf448113516dccf38ba6ca2fe439c0a30778 | [] | no_license | Onedelay/Alphago | e6c4de8afba12ecce9ae00b55e64d718a8bcafb0 | e72f31bd3d379e69802109fdc39f3a813ff05054 | refs/heads/master | 2021-05-14T00:45:48.997223 | 2018-11-20T14:35:29 | 2018-11-20T14:35:29 | 116,548,645 | 5 | 2 | null | 2018-03-19T05:52:30 | 2018-01-07T08:09:28 | Java | UTF-8 | Java | false | false | 3,142 | java | package com.alphago.alphago.fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import com.alphago.alphago.R;
public class HelpFragment extends Fragment {
private ImageView imageView;
private Button preButton;
private Button nextButton;
private Button closeButton;
private OnCloseListener listener;
private final int[] HELP_IMAGES = {R.drawable.help1, R.drawable.help2, R.drawable.help3, R.drawable.help4, R.drawable.help5};
private int count = 0;
public interface OnCloseListener {
void onClose();
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.help_layout, container, false);
imageView = rootView.findViewById(R.id.help_image);
preButton = rootView.findViewById(R.id.btn_help_pre);
nextButton = rootView.findViewById(R.id.btn_help_next);
closeButton = rootView.findViewById(R.id.btn_help_close);
preButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (count > 0) count--;
imageView.setImageResource(HELP_IMAGES[count]);
setPreButton();
setNextButton();
}
});
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (count < HELP_IMAGES.length - 1) {
count++;
} else if (count == HELP_IMAGES.length - 1) listener.onClose();
imageView.setImageResource(HELP_IMAGES[count]);
setPreButton();
setNextButton();
}
});
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onClose();
}
});
rootView.setClickable(true);
return rootView;
}
private void setPreButton() {
if (count < 1) {
preButton.setVisibility(View.GONE);
} else {
preButton.setVisibility(View.VISIBLE);
}
}
private void setNextButton() {
if (count == HELP_IMAGES.length) {
nextButton.setVisibility(View.GONE);
} else {
nextButton.setVisibility(View.VISIBLE);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
try {
listener = (OnCloseListener) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString() + " must implement OnRequestTrainingListener");
}
}
}
| [
"wjy0218@gmail.com"
] | wjy0218@gmail.com |
37fb6cde6441c0b300a5b0eb6f1d84d8c5e24435 | befbbfd50a2ef7e06d65a2e5ae7f178def82c54e | /MongoDbTeste/src/main/java/com/mongodb/bd/MongoDbTeste/config/MongoReactiveConfig.java | c96579ec8980117b8ecffd55e4ff4747ff8002da | [] | no_license | Jonathan931/BancoDeDadosII | 0633c011d97a9d086502cee0ad4dc4989ef8b93f | 5191f0d0f867d134b2a7a479f896f16f12d0017c | refs/heads/master | 2020-04-02T10:08:47.107086 | 2018-10-31T03:51:35 | 2018-10-31T03:51:35 | 154,326,268 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package com.mongodb.bd.MongoDbTeste.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.config.AbstractReactiveMongoConfiguration;
import org.springframework.data.mongodb.core.ReactiveMongoOperations;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
import com.mongodb.reactivestreams.client.MongoClient;
import com.mongodb.reactivestreams.client.MongoClients;
public class MongoReactiveConfig extends AbstractReactiveMongoConfiguration {
@Value("${spring.data.mongodb.database}")
private String database;
@Override
public MongoClient reactiveMongoClient() {
return MongoClients.create();
}
@Override
protected String getDatabaseName() {
return this.database;
}
@Override
public @Bean ReactiveMongoOperations reactiveMongoTemplate() throws Exception {
return new ReactiveMongoTemplate(reactiveMongoClient(), getDatabaseName());
}
} | [
"jonathanmatheus@Insights-Mac-mini.local"
] | jonathanmatheus@Insights-Mac-mini.local |
2ecf01b5e8b496f66892ff6340b2bb7f38503ec9 | a15fc7b50cfc0da3bcd4ca8f81d40492889e5ada | /generated/compiladores/lab01/parserLatexToHtml/LatexToHtmlParser.java | 47e0a6171128137db6a3278e55098e01d695b9b5 | [] | no_license | vamo89/Lab-de-Compiladores-01 | ed13de7fca035bb576d62a957c78e8392f43be62 | c51fc7c620afde9034d54ef1f9d77dd24f407ee8 | refs/heads/master | 2020-03-29T20:41:04.498908 | 2012-03-25T22:04:14 | 2012-03-25T22:04:14 | 3,618,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 45,892 | java | // $ANTLR 3.4 D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g 2012-03-25 19:02:45
package compiladores.lab01.parserLatexToHtml;
import java.util.regex.Pattern;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked"})
public class LatexToHtmlParser extends Parser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "AUTHOR", "BEGIN", "BRACKET", "CLOSEBRACKET", "CONF", "DOCUMENT", "DOCUMENTCLASS", "DOCUMENTCLASSTOKEN", "DOLLAR", "DOLLARSIGN", "END", "INCLUDEGRAPHICS", "ITEM", "ITEMIZE", "MKTITLE", "PUNCT", "SPECIALCHAR", "TEXTBF", "TEXTIT", "TEXT_CONTENT", "TITLE", "USEPACKAGE", "USEPACKAGE_IGNORE", "WS", "'{'", "'}'"
};
public static final int EOF=-1;
public static final int T__28=28;
public static final int T__29=29;
public static final int AUTHOR=4;
public static final int BEGIN=5;
public static final int BRACKET=6;
public static final int CLOSEBRACKET=7;
public static final int CONF=8;
public static final int DOCUMENT=9;
public static final int DOCUMENTCLASS=10;
public static final int DOCUMENTCLASSTOKEN=11;
public static final int DOLLAR=12;
public static final int DOLLARSIGN=13;
public static final int END=14;
public static final int INCLUDEGRAPHICS=15;
public static final int ITEM=16;
public static final int ITEMIZE=17;
public static final int MKTITLE=18;
public static final int PUNCT=19;
public static final int SPECIALCHAR=20;
public static final int TEXTBF=21;
public static final int TEXTIT=22;
public static final int TEXT_CONTENT=23;
public static final int TITLE=24;
public static final int USEPACKAGE=25;
public static final int USEPACKAGE_IGNORE=26;
public static final int WS=27;
// delegates
public Parser[] getDelegates() {
return new Parser[] {};
}
// delegators
public LatexToHtmlParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public LatexToHtmlParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
public String[] getTokenNames() { return LatexToHtmlParser.tokenNames; }
public String getGrammarFileName() { return "D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g"; }
String titleText = null;
String html = "";
// $ANTLR start "run"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:21:1: run returns [String out] : returnStr= latex ;
public final String run() throws RecognitionException {
String out = null;
String returnStr =null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:21:26: (returnStr= latex )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:21:28: returnStr= latex
{
pushFollow(FOLLOW_latex_in_run54);
returnStr=latex();
state._fsp--;
return returnStr;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return out;
}
// $ANTLR end "run"
public static class body_return extends ParserRuleReturnScope {
};
// $ANTLR start "body"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:1: body : (text= TEXT_CONTENT |dollar= DOLLAR |dollarSgn= DOLLARSIGN |text= SPECIALCHAR |text= WS |text= BRACKET |text= CLOSEBRACKET ) ;
public final LatexToHtmlParser.body_return body() throws RecognitionException {
LatexToHtmlParser.body_return retval = new LatexToHtmlParser.body_return();
retval.start = input.LT(1);
Token text=null;
Token dollar=null;
Token dollarSgn=null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:7: ( (text= TEXT_CONTENT |dollar= DOLLAR |dollarSgn= DOLLARSIGN |text= SPECIALCHAR |text= WS |text= BRACKET |text= CLOSEBRACKET ) )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:9: (text= TEXT_CONTENT |dollar= DOLLAR |dollarSgn= DOLLARSIGN |text= SPECIALCHAR |text= WS |text= BRACKET |text= CLOSEBRACKET )
{
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:9: (text= TEXT_CONTENT |dollar= DOLLAR |dollarSgn= DOLLARSIGN |text= SPECIALCHAR |text= WS |text= BRACKET |text= CLOSEBRACKET )
int alt1=7;
switch ( input.LA(1) ) {
case TEXT_CONTENT:
{
alt1=1;
}
break;
case DOLLAR:
{
alt1=2;
}
break;
case DOLLARSIGN:
{
alt1=3;
}
break;
case SPECIALCHAR:
{
alt1=4;
}
break;
case WS:
{
alt1=5;
}
break;
case BRACKET:
{
alt1=6;
}
break;
case CLOSEBRACKET:
{
alt1=7;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 1, 0, input);
throw nvae;
}
switch (alt1) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:10: text= TEXT_CONTENT
{
text=(Token)match(input,TEXT_CONTENT,FOLLOW_TEXT_CONTENT_in_body519);
}
break;
case 2 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:28: dollar= DOLLAR
{
dollar=(Token)match(input,DOLLAR,FOLLOW_DOLLAR_in_body523);
}
break;
case 3 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:42: dollarSgn= DOLLARSIGN
{
dollarSgn=(Token)match(input,DOLLARSIGN,FOLLOW_DOLLARSIGN_in_body527);
}
break;
case 4 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:63: text= SPECIALCHAR
{
text=(Token)match(input,SPECIALCHAR,FOLLOW_SPECIALCHAR_in_body531);
}
break;
case 5 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:80: text= WS
{
text=(Token)match(input,WS,FOLLOW_WS_in_body535);
}
break;
case 6 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:88: text= BRACKET
{
text=(Token)match(input,BRACKET,FOLLOW_BRACKET_in_body539);
}
break;
case 7 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:56:101: text= CLOSEBRACKET
{
text=(Token)match(input,CLOSEBRACKET,FOLLOW_CLOSEBRACKET_in_body543);
}
break;
}
String str="";
if(dollar!=null)str="$";
else if(dollarSgn!=null)str="$";
if(text!=null){
str = text.getText();
}
str = str.replaceAll("\r","");
str = str.replaceAll("\n", "<br>");
html+=str;
}
retval.stop = input.LT(-1);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "body"
// $ANTLR start "author"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:71:1: author : AUTHOR '{' ( command )* '}' ;
public final void author() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:71:11: ( AUTHOR '{' ( command )* '}' )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:71:13: AUTHOR '{' ( command )* '}'
{
match(input,AUTHOR,FOLLOW_AUTHOR_in_author560);
match(input,28,FOLLOW_28_in_author562);
html+="<META NAME=\"author\" content=\"";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:72:15: ( command )*
loop2:
do {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= BEGIN && LA2_0 <= CLOSEBRACKET)||(LA2_0 >= DOLLAR && LA2_0 <= DOLLARSIGN)||LA2_0==INCLUDEGRAPHICS||LA2_0==MKTITLE||(LA2_0 >= SPECIALCHAR && LA2_0 <= TEXT_CONTENT)||LA2_0==WS) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:72:15: command
{
pushFollow(FOLLOW_command_in_author607);
command();
state._fsp--;
}
break;
default :
break loop2;
}
} while (true);
match(input,29,FOLLOW_29_in_author610);
html+="\" />";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "author"
// $ANTLR start "textBF"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:75:1: textBF : TEXTBF '{' ( command )* '}' ;
public final void textBF() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:75:11: ( TEXTBF '{' ( command )* '}' )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:75:13: TEXTBF '{' ( command )* '}'
{
match(input,TEXTBF,FOLLOW_TEXTBF_in_textBF648);
match(input,28,FOLLOW_28_in_textBF650);
html+="<b>";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:76:15: ( command )*
loop3:
do {
int alt3=2;
int LA3_0 = input.LA(1);
if ( ((LA3_0 >= BEGIN && LA3_0 <= CLOSEBRACKET)||(LA3_0 >= DOLLAR && LA3_0 <= DOLLARSIGN)||LA3_0==INCLUDEGRAPHICS||LA3_0==MKTITLE||(LA3_0 >= SPECIALCHAR && LA3_0 <= TEXT_CONTENT)||LA3_0==WS) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:76:15: command
{
pushFollow(FOLLOW_command_in_textBF695);
command();
state._fsp--;
}
break;
default :
break loop3;
}
} while (true);
match(input,29,FOLLOW_29_in_textBF698);
html+="</b>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "textBF"
// $ANTLR start "textIT"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:79:1: textIT : TEXTIT '{' ( command )* '}' ;
public final void textIT() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:79:11: ( TEXTIT '{' ( command )* '}' )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:79:13: TEXTIT '{' ( command )* '}'
{
match(input,TEXTIT,FOLLOW_TEXTIT_in_textIT736);
match(input,28,FOLLOW_28_in_textIT738);
html+="<i>";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:80:15: ( command )*
loop4:
do {
int alt4=2;
int LA4_0 = input.LA(1);
if ( ((LA4_0 >= BEGIN && LA4_0 <= CLOSEBRACKET)||(LA4_0 >= DOLLAR && LA4_0 <= DOLLARSIGN)||LA4_0==INCLUDEGRAPHICS||LA4_0==MKTITLE||(LA4_0 >= SPECIALCHAR && LA4_0 <= TEXT_CONTENT)||LA4_0==WS) ) {
alt4=1;
}
switch (alt4) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:80:15: command
{
pushFollow(FOLLOW_command_in_textIT783);
command();
state._fsp--;
}
break;
default :
break loop4;
}
} while (true);
match(input,29,FOLLOW_29_in_textIT786);
html+="</i>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "textIT"
// $ANTLR start "mkTitle"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:83:1: mkTitle : MKTITLE ;
public final void mkTitle() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:83:11: ( MKTITLE )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:83:13: MKTITLE
{
match(input,MKTITLE,FOLLOW_MKTITLE_in_mkTitle823);
html+="<h1>"+titleText+"</h1>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "mkTitle"
// $ANTLR start "item"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:86:1: item : ITEM (id= CONF )? ( body | textBF | textIT )* ;
public final void item() throws RecognitionException {
Token id=null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:86:11: ( ITEM (id= CONF )? ( body | textBF | textIT )* )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:86:13: ITEM (id= CONF )? ( body | textBF | textIT )*
{
match(input,ITEM,FOLLOW_ITEM_in_item869);
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:86:20: (id= CONF )?
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==CONF) ) {
alt5=1;
}
switch (alt5) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:86:20: id= CONF
{
id=(Token)match(input,CONF,FOLLOW_CONF_in_item873);
}
break;
}
if (id==null) html+="<li>";
else html+=id.getText().substring(1,id.getText().length()-1)+" - ";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:91:16: ( body | textBF | textIT )*
loop6:
do {
int alt6=4;
switch ( input.LA(1) ) {
case BRACKET:
case CLOSEBRACKET:
case DOLLAR:
case DOLLARSIGN:
case SPECIALCHAR:
case TEXT_CONTENT:
case WS:
{
alt6=1;
}
break;
case TEXTBF:
{
alt6=2;
}
break;
case TEXTIT:
{
alt6=3;
}
break;
}
switch (alt6) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:91:17: body
{
pushFollow(FOLLOW_body_in_item921);
body();
state._fsp--;
}
break;
case 2 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:91:22: textBF
{
pushFollow(FOLLOW_textBF_in_item923);
textBF();
state._fsp--;
}
break;
case 3 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:91:29: textIT
{
pushFollow(FOLLOW_textIT_in_item925);
textIT();
state._fsp--;
}
break;
default :
break loop6;
}
} while (true);
if (id==null) html+="</li>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "item"
// $ANTLR start "itemList"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:94:1: itemList : BEGIN ITEMIZE ( WS )* ( item | ( itemList ( WS )* ) )* END ITEMIZE ;
public final void itemList() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:94:11: ( BEGIN ITEMIZE ( WS )* ( item | ( itemList ( WS )* ) )* END ITEMIZE )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:94:13: BEGIN ITEMIZE ( WS )* ( item | ( itemList ( WS )* ) )* END ITEMIZE
{
match(input,BEGIN,FOLLOW_BEGIN_in_itemList952);
match(input,ITEMIZE,FOLLOW_ITEMIZE_in_itemList954);
html+="<ul>";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:19: ( WS )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==WS) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:19: WS
{
match(input,WS,FOLLOW_WS_in_itemList1000);
}
break;
default :
break loop7;
}
} while (true);
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:23: ( item | ( itemList ( WS )* ) )*
loop9:
do {
int alt9=3;
int LA9_0 = input.LA(1);
if ( (LA9_0==ITEM) ) {
alt9=1;
}
else if ( (LA9_0==BEGIN) ) {
alt9=2;
}
switch (alt9) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:24: item
{
pushFollow(FOLLOW_item_in_itemList1004);
item();
state._fsp--;
}
break;
case 2 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:29: ( itemList ( WS )* )
{
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:29: ( itemList ( WS )* )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:30: itemList ( WS )*
{
pushFollow(FOLLOW_itemList_in_itemList1007);
itemList();
state._fsp--;
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:39: ( WS )*
loop8:
do {
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==WS) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:95:39: WS
{
match(input,WS,FOLLOW_WS_in_itemList1009);
}
break;
default :
break loop8;
}
} while (true);
}
}
break;
default :
break loop9;
}
} while (true);
match(input,END,FOLLOW_END_in_itemList1033);
match(input,ITEMIZE,FOLLOW_ITEMIZE_in_itemList1035);
html+="</ul>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "itemList"
// $ANTLR start "title"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:99:1: title : TITLE '{' id= TEXT_CONTENT '}' ;
public final void title() throws RecognitionException {
Token id=null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:99:11: ( TITLE '{' id= TEXT_CONTENT '}' )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:99:13: TITLE '{' id= TEXT_CONTENT '}'
{
match(input,TITLE,FOLLOW_TITLE_in_title1070);
match(input,28,FOLLOW_28_in_title1072);
id=(Token)match(input,TEXT_CONTENT,FOLLOW_TEXT_CONTENT_in_title1076);
match(input,29,FOLLOW_29_in_title1078);
titleText=id.getText();
html+="<title>"+titleText+"</title>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "title"
// $ANTLR start "graph"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:106:1: graph : INCLUDEGRAPHICS '{' id= TEXT_CONTENT '}' ;
public final void graph() throws RecognitionException {
Token id=null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:106:11: ( INCLUDEGRAPHICS '{' id= TEXT_CONTENT '}' )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:106:13: INCLUDEGRAPHICS '{' id= TEXT_CONTENT '}'
{
match(input,INCLUDEGRAPHICS,FOLLOW_INCLUDEGRAPHICS_in_graph1119);
match(input,28,FOLLOW_28_in_graph1121);
id=(Token)match(input,TEXT_CONTENT,FOLLOW_TEXT_CONTENT_in_graph1124);
match(input,29,FOLLOW_29_in_graph1125);
html+="<img src=\""+id.getText()+"\"/>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "graph"
// $ANTLR start "initCommands"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:113:1: initCommands : ( DOCUMENTCLASSTOKEN | title | author | USEPACKAGE_IGNORE | WS ) ;
public final void initCommands() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:113:14: ( ( DOCUMENTCLASSTOKEN | title | author | USEPACKAGE_IGNORE | WS ) )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:113:16: ( DOCUMENTCLASSTOKEN | title | author | USEPACKAGE_IGNORE | WS )
{
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:113:16: ( DOCUMENTCLASSTOKEN | title | author | USEPACKAGE_IGNORE | WS )
int alt10=5;
switch ( input.LA(1) ) {
case DOCUMENTCLASSTOKEN:
{
alt10=1;
}
break;
case TITLE:
{
alt10=2;
}
break;
case AUTHOR:
{
alt10=3;
}
break;
case USEPACKAGE_IGNORE:
{
alt10=4;
}
break;
case WS:
{
alt10=5;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:114:3: DOCUMENTCLASSTOKEN
{
match(input,DOCUMENTCLASSTOKEN,FOLLOW_DOCUMENTCLASSTOKEN_in_initCommands1144);
}
break;
case 2 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:115:3: title
{
pushFollow(FOLLOW_title_in_initCommands1155);
title();
state._fsp--;
}
break;
case 3 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:116:3: author
{
pushFollow(FOLLOW_author_in_initCommands1179);
author();
state._fsp--;
}
break;
case 4 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:117:3: USEPACKAGE_IGNORE
{
match(input,USEPACKAGE_IGNORE,FOLLOW_USEPACKAGE_IGNORE_in_initCommands1202);
}
break;
case 5 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:118:3: WS
{
match(input,WS,FOLLOW_WS_in_initCommands1214);
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "initCommands"
// $ANTLR start "document"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:122:1: document : BEGIN DOCUMENT ( command )* END DOCUMENT ;
public final void document() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:122:11: ( BEGIN DOCUMENT ( command )* END DOCUMENT )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:122:13: BEGIN DOCUMENT ( command )* END DOCUMENT
{
match(input,BEGIN,FOLLOW_BEGIN_in_document1226);
match(input,DOCUMENT,FOLLOW_DOCUMENT_in_document1228);
html+="</head><body>";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:123:19: ( command )*
loop11:
do {
int alt11=2;
int LA11_0 = input.LA(1);
if ( ((LA11_0 >= BEGIN && LA11_0 <= CLOSEBRACKET)||(LA11_0 >= DOLLAR && LA11_0 <= DOLLARSIGN)||LA11_0==INCLUDEGRAPHICS||LA11_0==MKTITLE||(LA11_0 >= SPECIALCHAR && LA11_0 <= TEXT_CONTENT)||LA11_0==WS) ) {
alt11=1;
}
switch (alt11) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:123:19: command
{
pushFollow(FOLLOW_command_in_document1274);
command();
state._fsp--;
}
break;
default :
break loop11;
}
} while (true);
match(input,END,FOLLOW_END_in_document1295);
match(input,DOCUMENT,FOLLOW_DOCUMENT_in_document1297);
html+="</body>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "document"
// $ANTLR start "command"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:127:1: command : ( textBF | mkTitle | graph | itemList | textIT | body ) ;
public final void command() throws RecognitionException {
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:127:9: ( ( textBF | mkTitle | graph | itemList | textIT | body ) )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:127:11: ( textBF | mkTitle | graph | itemList | textIT | body )
{
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:127:11: ( textBF | mkTitle | graph | itemList | textIT | body )
int alt12=6;
switch ( input.LA(1) ) {
case TEXTBF:
{
alt12=1;
}
break;
case MKTITLE:
{
alt12=2;
}
break;
case INCLUDEGRAPHICS:
{
alt12=3;
}
break;
case BEGIN:
{
alt12=4;
}
break;
case TEXTIT:
{
alt12=5;
}
break;
case BRACKET:
case CLOSEBRACKET:
case DOLLAR:
case DOLLARSIGN:
case SPECIALCHAR:
case TEXT_CONTENT:
case WS:
{
alt12=6;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:128:2: textBF
{
pushFollow(FOLLOW_textBF_in_command1331);
textBF();
state._fsp--;
}
break;
case 2 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:129:2: mkTitle
{
pushFollow(FOLLOW_mkTitle_in_command1344);
mkTitle();
state._fsp--;
}
break;
case 3 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:130:2: graph
{
pushFollow(FOLLOW_graph_in_command1356);
graph();
state._fsp--;
}
break;
case 4 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:131:2: itemList
{
pushFollow(FOLLOW_itemList_in_command1370);
itemList();
state._fsp--;
}
break;
case 5 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:132:2: textIT
{
pushFollow(FOLLOW_textIT_in_command1381);
textIT();
state._fsp--;
}
break;
case 6 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:133:2: body
{
pushFollow(FOLLOW_body_in_command1394);
body();
state._fsp--;
}
break;
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return ;
}
// $ANTLR end "command"
// $ANTLR start "latex"
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:136:1: latex returns [String out] : ( initCommands )* document ;
public final String latex() throws RecognitionException {
String out = null;
try {
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:136:27: ( ( initCommands )* document )
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:137:1: ( initCommands )* document
{
html+=
"<html><head>"+
"<script type=\"text/x-mathjax-config\">"+
"MathJax.Hub.Config({tex2jax: {inlineMath: [[\"\\$\",\"\\$\"]]}});"+
"</script>"+
"<script type=\"text/javascript\""+
" src=\"http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">"+
"</script>";
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:147:3: ( initCommands )*
loop13:
do {
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==AUTHOR||LA13_0==DOCUMENTCLASSTOKEN||LA13_0==TITLE||(LA13_0 >= USEPACKAGE_IGNORE && LA13_0 <= WS)) ) {
alt13=1;
}
switch (alt13) {
case 1 :
// D:\\Compiladores\\Lab-de-Compiladores-01\\src\\compiladores\\lab01\\parserLatexToHtml\\LatexToHtml.g:147:3: initCommands
{
pushFollow(FOLLOW_initCommands_in_latex1417);
initCommands();
state._fsp--;
}
break;
default :
break loop13;
}
} while (true);
pushFollow(FOLLOW_document_in_latex1420);
document();
state._fsp--;
return html+"</html>";
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return out;
}
// $ANTLR end "latex"
// Delegated rules
public static final BitSet FOLLOW_latex_in_run54 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEXT_CONTENT_in_body519 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOLLAR_in_body523 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOLLARSIGN_in_body527 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SPECIALCHAR_in_body531 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WS_in_body535 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BRACKET_in_body539 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_CLOSEBRACKET_in_body543 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_AUTHOR_in_author560 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_28_in_author562 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_command_in_author607 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_29_in_author610 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEXTBF_in_textBF648 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_28_in_textBF650 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_command_in_textBF695 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_29_in_textBF698 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TEXTIT_in_textIT736 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_28_in_textIT738 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_command_in_textIT783 = new BitSet(new long[]{0x0000000028F4B0E0L});
public static final BitSet FOLLOW_29_in_textIT786 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_MKTITLE_in_mkTitle823 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ITEM_in_item869 = new BitSet(new long[]{0x0000000008F031C2L});
public static final BitSet FOLLOW_CONF_in_item873 = new BitSet(new long[]{0x0000000008F030C2L});
public static final BitSet FOLLOW_body_in_item921 = new BitSet(new long[]{0x0000000008F030C2L});
public static final BitSet FOLLOW_textBF_in_item923 = new BitSet(new long[]{0x0000000008F030C2L});
public static final BitSet FOLLOW_textIT_in_item925 = new BitSet(new long[]{0x0000000008F030C2L});
public static final BitSet FOLLOW_BEGIN_in_itemList952 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_ITEMIZE_in_itemList954 = new BitSet(new long[]{0x0000000008014020L});
public static final BitSet FOLLOW_WS_in_itemList1000 = new BitSet(new long[]{0x0000000008014020L});
public static final BitSet FOLLOW_item_in_itemList1004 = new BitSet(new long[]{0x0000000000014020L});
public static final BitSet FOLLOW_itemList_in_itemList1007 = new BitSet(new long[]{0x0000000008014020L});
public static final BitSet FOLLOW_WS_in_itemList1009 = new BitSet(new long[]{0x0000000008014020L});
public static final BitSet FOLLOW_END_in_itemList1033 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_ITEMIZE_in_itemList1035 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TITLE_in_title1070 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_28_in_title1072 = new BitSet(new long[]{0x0000000000800000L});
public static final BitSet FOLLOW_TEXT_CONTENT_in_title1076 = new BitSet(new long[]{0x0000000020000000L});
public static final BitSet FOLLOW_29_in_title1078 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_INCLUDEGRAPHICS_in_graph1119 = new BitSet(new long[]{0x0000000010000000L});
public static final BitSet FOLLOW_28_in_graph1121 = new BitSet(new long[]{0x0000000000800000L});
public static final BitSet FOLLOW_TEXT_CONTENT_in_graph1124 = new BitSet(new long[]{0x0000000020000000L});
public static final BitSet FOLLOW_29_in_graph1125 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_DOCUMENTCLASSTOKEN_in_initCommands1144 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_title_in_initCommands1155 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_author_in_initCommands1179 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_USEPACKAGE_IGNORE_in_initCommands1202 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WS_in_initCommands1214 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BEGIN_in_document1226 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_DOCUMENT_in_document1228 = new BitSet(new long[]{0x0000000008F4F0E0L});
public static final BitSet FOLLOW_command_in_document1274 = new BitSet(new long[]{0x0000000008F4F0E0L});
public static final BitSet FOLLOW_END_in_document1295 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_DOCUMENT_in_document1297 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_textBF_in_command1331 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_mkTitle_in_command1344 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_graph_in_command1356 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_itemList_in_command1370 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_textIT_in_command1381 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_body_in_command1394 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_initCommands_in_latex1417 = new BitSet(new long[]{0x000000000D000830L});
public static final BitSet FOLLOW_document_in_latex1420 = new BitSet(new long[]{0x0000000000000002L});
} | [
"carlos.h.rodrigues.a@gmail.com"
] | carlos.h.rodrigues.a@gmail.com |
fb69c56352b6c16be20861ae9cc8f258bd5e28e9 | 41b7c1b3c59bd5bbe298652ae91b167e5082c060 | /src/main/java/com/rodrigorar/creational/builder/Reader.java | a20f41bccb86e818f82ded33e5eb3186404a4eea | [] | no_license | rodrigorar/design_patterns_examples | 4c544c075581d5e2b5870a9f3711ce76d89697ed | 90b735bede072f70fb813620f4cfa5fa4b88a211 | refs/heads/master | 2021-04-08T16:16:57.748582 | 2020-04-22T17:28:51 | 2020-04-22T17:28:51 | 248,789,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package com.rodrigorar.creational.builder;
import java.util.List;
public class Reader {
private List<Element> elements;
private Converter converter;
public Reader(Converter converter, List<Element> elements) {
this.elements = elements;
this.converter = converter;
}
public Converter parseInput() {
elements.forEach(element -> {
switch (element.getType()) {
case LINE:
converter.makeLine(element);
break;
case PARAGRAPH:
converter.makeParagraph(element);
break;
case TABLE:
converter.makeTable(element);
break;
default:
throw new RuntimeException("Unknown element type");
}
});
return converter;
}
}
| [
"rodrigo.rosa@premium-minds.com"
] | rodrigo.rosa@premium-minds.com |
99a933e10fd882108f0a70e63c1b46885f69ff9a | 40bea3a6520a5780cae127c12940872e61070305 | /src/com/enigma/oop/Circle.java | 897c5513307e05efae1205fd41cfbf14b92a3a76 | [] | no_license | adil819/BelajarOOPJava | 67f2dd0abfe67d9504ede43da63bfa6acfcac07a | 488ae89f2d65801f7cd460a2ab5ba2cc606ebffc | refs/heads/main | 2023-07-18T07:32:53.785124 | 2021-09-07T05:49:52 | 2021-09-07T05:49:52 | 403,855,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package com.enigma.oop;
import com.enigma.oop.constant.Constant;
public class Circle extends Shape{
private Double radius;
public Circle(Double radius) {
this.radius = radius;
}
@Override
public Double getArea() {
return Constant.PHI + Math.pow(this.radius, 2);
}
@Override
public Double getPerimeter() {
return 2 * (Constant.PHI * this.radius);
}
@Override
public String toString() {
return "Circle{" +
"radius=" + radius +
'}';
}
}
| [
"="
] | = |
4eda84e5d682d751974469168e23aa6c6b0fe11f | b37726900ee16a5b72a6cd7b2a2d72814fffe924 | /src/main/java/vn/com/vndirect/domain/IfoStockExchangeViewId.java | 9713b69b116e25c61b589c9fa5b01f1828f3862d | [] | no_license | UnsungHero0/portal | 6b9cfd7271f2b1d587a6f311de49c67e8dd8ff9f | 32325d3e1732d900ee3f874c55890afc8f347700 | refs/heads/master | 2021-01-20T06:18:01.548033 | 2014-11-12T10:27:43 | 2014-11-12T10:27:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,193 | java | package vn.com.vndirect.domain;
@SuppressWarnings("serial")
public class IfoStockExchangeViewId extends BaseBean implements java.io.Serializable {
// Fields
private String symbol;
private String exchangeCode;
private String exchangeName;
// Constructors
/** default constructor */
public IfoStockExchangeViewId() {
}
/** full constructor */
public IfoStockExchangeViewId(String symbol, String exchangeCode, String exchangeName) {
this.symbol = symbol;
this.exchangeCode = exchangeCode;
this.exchangeName = exchangeName;
}
// Property accessors
public String getSymbol() {
return this.symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public String getExchangeCode() {
return this.exchangeCode;
}
public void setExchangeCode(String exchangeCode) {
this.exchangeCode = exchangeCode;
}
public String getExchangeName() {
return this.exchangeName;
}
public void setExchangeName(String exchangeName) {
this.exchangeName = exchangeName;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof IfoStockExchangeViewId))
return false;
IfoStockExchangeViewId castOther = (IfoStockExchangeViewId) other;
return ((this.getSymbol() == castOther.getSymbol()) || (this.getSymbol() != null && castOther.getSymbol() != null && this.getSymbol().equals(castOther.getSymbol())))
&& ((this.getExchangeCode() == castOther.getExchangeCode()) || (this.getExchangeCode() != null && castOther.getExchangeCode() != null && this.getExchangeCode().equals(
castOther.getExchangeCode())))
&& ((this.getExchangeName() == castOther.getExchangeName()) || (this.getExchangeName() != null && castOther.getExchangeName() != null && this.getExchangeName().equals(
castOther.getExchangeName())));
}
public int hashCode() {
int result = 17;
result = 37 * result + (getSymbol() == null ? 0 : this.getSymbol().hashCode());
result = 37 * result + (getExchangeCode() == null ? 0 : this.getExchangeCode().hashCode());
result = 37 * result + (getExchangeName() == null ? 0 : this.getExchangeName().hashCode());
return result;
}
} | [
"minh.nguyen@vndirect.com.vn"
] | minh.nguyen@vndirect.com.vn |
2c3f76054bc96674a08e6a62d2119fd3d0c758f8 | a625dcbd2dc248732b94f596486733a73001d887 | /app/src/main/java/com/pure/purelive/ui/PhoneFindPassActivity.java | 863907e6a3dc04d3d0b5abe28dc2a29c26ee1d93 | [] | no_license | zhaiqc/jtpure | f8d1dac34f47c0043def33dbc9d304d989f2f668 | ae2cbf0df75752ac8494ff2cb4b92fd98ce475c5 | refs/heads/master | 2021-07-05T17:31:41.858333 | 2017-09-29T09:20:58 | 2017-09-29T09:20:58 | 105,254,239 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,999 | java | package com.pure.purelive.ui;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.view.View;
import com.hyphenate.util.NetUtils;
import com.pure.purelive.AppContext;
import com.pure.purelive.api.remote.ApiUtils;
import com.pure.purelive.ui.customviews.ActivityTitle;
import com.pure.purelive.widget.BlackEditText;
import com.pure.purelive.R;
import com.pure.purelive.api.remote.PhoneLiveApi;
import com.pure.purelive.base.ToolBarBaseActivity;
import com.pure.purelive.utils.DialogHelp;
import com.pure.purelive.utils.TDevice;
import com.zhy.http.okhttp.callback.StringCallback;
import org.json.JSONArray;
import butterknife.InjectView;
import butterknife.OnClick;
import okhttp3.Call;
/**
* 手机登陆 HHH 2016-09-09
*/
public class PhoneFindPassActivity extends ToolBarBaseActivity {
@InjectView(R.id.et_loginphone)
BlackEditText mEtUserPhone;
// @InjectView(R.id.et_logincode)
// BlackEditText mEtCode;
// @InjectView(R.id.btn_phone_login_send_code)
// TextView mBtnSendCode;
@InjectView(R.id.et_password)
BlackEditText mEtUserPassword;
@InjectView(R.id.et_secondPassword)
BlackEditText mEtSecondPassword;
@InjectView(R.id.view_title)
ActivityTitle mActivityTitle;
//HHH 2016-09-09
private String mUserName = "";
@Override
protected int getLayoutId() {
return R.layout.activity_find_pass;
}
@Override
public void initView() {
// mBtnSendCode.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// sendCode();
// }
// });
mActivityTitle.setReturnListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
private void sendCode() {
mUserName = mEtUserPhone.getText().toString();
if (!mUserName.equals("") && mUserName.length() == 11) {
if (!NetUtils.hasNetwork(PhoneFindPassActivity.this)) {
showToast3("请检查网络设置", 0);
return;
}
PhoneLiveApi.getMessageCode(mUserName, "Login.getForgetCode", new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
}
@Override
public void onResponse(String response, int id) {
JSONArray res = ApiUtils.checkIsSuccess(response);
if (res != null) {
showToast3(getString(R.string.codehasbeensend), 0);
}
}
});
// SimpleUtils.startTimer(new WeakReference<TextView>(mBtnSendCode),"发送验证码",60,1);
} else {
showToast3(getString(R.string.plase_check_you_num_is_correct), 0);
}
}
@Override
public void initData() {
}
@OnClick(R.id.btn_doResetPassword)
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_doResetPassword) {
if (prepareForFindPass()) {
return;
}
mUserName = mEtUserPhone.getText().toString();
// String mCode = mEtCode.getText().toString();
String mPassword = mEtUserPassword.getText().toString();
String mSecondPassword = mEtSecondPassword.getText().toString();
showWaitDialog(R.string.loading);
PhoneLiveApi.findPass(mUserName, mPassword, mSecondPassword, callback);
}
}
//注册回调
private final StringCallback callback = new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
AppContext.showToast("网络请求出错!");
}
@Override
public void onResponse(String s, int id) {
hideWaitDialog();
JSONArray res = ApiUtils.checkIsSuccess(s);
if (res != null) {
AlertDialog alertDialog = DialogHelp.getMessageDialog(PhoneFindPassActivity.this, "密码修改成功", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
finish();
}
}).setTitle("提示").create();
alertDialog.setCancelable(false);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
}
}
};
//HHH 2016-09-09
private boolean prepareForFindPass() {
if (!TDevice.hasInternet()) {
AppContext.showToastShort(R.string.tip_no_internet);
return true;
}
if (mEtUserPhone.length() == 0) {
mEtUserPhone.setError("请输入邮箱/用户名");
mEtUserPhone.requestFocus();
return true;
}
if (mEtUserPhone.length() < 5 || !mEtUserPhone.getText().toString().contains("@")) {
mEtUserPhone.setError("请输入正确的邮箱");
mEtUserPhone.requestFocus();
return true;
}
// if (mEtCode.length() == 0) {
// mEtCode.setError("请输入验证码");
// mEtCode.requestFocus();
// return true;
// }
if (mEtUserPassword.length() == 0) {
mEtUserPassword.setError("请输入密码");
mEtUserPassword.requestFocus();
return true;
}
if (!mEtSecondPassword.getText().toString().equals(mEtUserPassword.getText().toString())) {
mEtSecondPassword.setText("");
mEtSecondPassword.setError("密码不一致,请重新输入");
mEtSecondPassword.requestFocus();
return true;
}
return false;
}
@Override
protected boolean hasActionBar() {
return false;
}
}
| [
"zhaiqichao1994@163.com"
] | zhaiqichao1994@163.com |
23aba7651936c93f571a7d4a8a61303db54145bd | f6d940ecc5f0e1b844a5727abc90170761ccec18 | /src/test/java/me/khmoon/demojpa3/post/PostRepositoryTest.java | 6facd7c107024f008e5e60b642ea070c5ef5bd8b | [] | no_license | mgh3326/demo-jpa3 | e812b472fc7c2320402b0cc2b46fb820324608b7 | 4a2c4b686b18310df9e47b3a79498763c416a3e7 | refs/heads/master | 2022-07-06T01:41:24.646603 | 2019-07-23T05:10:40 | 2019-07-23T05:10:40 | 198,185,286 | 0 | 0 | null | 2019-11-30T06:39:39 | 2019-07-22T08:56:19 | Java | UTF-8 | Java | false | false | 1,147 | java | package me.khmoon.demojpa3.post;
import me.khmoon.demojpa3.post.Post;
import me.khmoon.demojpa3.post.PostPublishedEvent;
import me.khmoon.demojpa3.post.PostRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.jdbc.DataJdbcTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@DataJpaTest
@Import(PostRepositoryTestConfig.class)
public class PostRepositoryTest {
@Autowired
PostRepository postRepository;
@Test
public void crud() {
Post post = new Post();
post.setTitle("hipernate");
assertThat(postRepository.contains(post)).isFalse();
postRepository.save(post.publish());
assertThat(postRepository.contains(post)).isTrue();
postRepository.delete(post);
postRepository.flush();
}
} | [
"mgh3326@naver.com"
] | mgh3326@naver.com |
8a8286ae868c7a1230dca5a26a081bd3ddfb9241 | fff78f29843690ed1bf0175b7c34b9e0e750afcc | /ex01/src/main/java/ru/otus/borodkin/service/QuestionsService.java | df62a23aee791337c52a0c6a2f10e7a83e82ed3e | [] | no_license | oborodkin/2020-11-otus-spring-borodkin | 50a178349e6b0fd0b9890a8b52e0e7c9ce7a629b | fa3b05b3a4b86e0b0389951b7fc12224bb7fba9e | refs/heads/master | 2023-03-26T10:22:30.579714 | 2021-03-23T15:58:05 | 2021-03-23T15:58:05 | 315,665,121 | 0 | 0 | null | 2021-03-23T15:58:06 | 2020-11-24T14:56:49 | Java | UTF-8 | Java | false | false | 191 | java | package ru.otus.borodkin.service;
import ru.otus.borodkin.domain.Question;
import java.util.List;
public interface QuestionsService {
List<Question> getQuestions() throws Exception;
}
| [
"o.borodkin@gmail.com"
] | o.borodkin@gmail.com |
930b70d5051b87e02455613cca330f6c04b14feb | 5e7608123a22cecef836ec02fbe48f93aa03190a | /Java-Multi-Thread-Programming/src/main/java/com/multi/thread/chapter1/example19/MyThread.java | dba85a2f89b977c242319564753b22a9bede0a19 | [
"Apache-2.0"
] | permissive | liiibpm/Java_Multi_Thread | a01e2ba428d4cc9277357232ef37d4b770fddd6a | 39200a1096475557c749db68993e3a3ccc0547b5 | refs/heads/master | 2023-03-26T16:16:29.039854 | 2020-12-01T12:22:23 | 2020-12-01T12:22:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.multi.thread.chapter1.example19;
/**
* @Description
* @Author dongzonglei
* @Date 2018/12/06 下午1:43
*/
public class MyThread extends Thread {
@Override
public void run() {
super.run();
for (int i =0; i < 500000; i++) {
System.out.println("i = " + (i + 1));
}
}
}
| [
"dongzl"
] | dongzl |
3f9ceacc1e3ef5dbc03806c6cbdf65f815de2f21 | e85cbab74f03e1a0f8384af4581af761858f9993 | /src/aima/core/probability/bayes/BayesInference.java | db2b194ad0b69d12883128225a3affad15f6249b | [] | no_license | alessandrodignani/CluedoSolver | 47fef99ce53601b5349885c9e7961bdab7e25dd7 | e9bac3843109aff611047858e581fabd6b43c4c8 | refs/heads/master | 2021-06-19T22:07:45.304122 | 2017-03-13T22:49:19 | 2017-03-13T22:49:19 | 84,881,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package aima.core.probability.bayes;
import aima.core.probability.CategoricalDistribution;
import aima.core.probability.RandomVariable;
import aima.core.probability.proposition.AssignmentProposition;
/**
* General interface to be implemented by Bayesian Inference algorithms.
*
* @author Ciaran O'Reilly
*/
public interface BayesInference {
/**
* @param X
* the query variables.
* @param observedEvidence
* observed values for variables E.
* @param bn
* a Bayes net with variables {X} ∪ E ∪ Y /* Y = hidden
* variables
* @return a distribution over the query variables.
*/
CategoricalDistribution ask(final RandomVariable[] X,
final AssignmentProposition[] observedEvidence,
final BayesianNetwork bn);
}
| [
"alessandro.dignani@mail.polimi.it"
] | alessandro.dignani@mail.polimi.it |
2b8b8910b7b7e64a46d010270f82728669d33c02 | 63812ec422b198046234eb6827afb769d7fd5332 | /HibernateTutorial/src/com/febin/hibernate/UpdateStudentDemo.java | 0c077a81ad8c27cd0972eea48bf365106226663e | [] | no_license | fzachariah/Spring-WorkSpace | cfaa82eaa030e0baa5e277e6a2f4f60eaf01008a | 4ab3c205537cc12ad3ddc107b4cd268d2ff0d692 | refs/heads/master | 2021-06-16T12:27:09.730068 | 2017-04-08T01:57:50 | 2017-04-08T01:57:50 | 84,473,402 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package com.febin.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class UpdateStudentDemo {
public static void main(String args[])
{
SessionFactory factory=new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Student.class).buildSessionFactory();
Session session=factory.getCurrentSession();
try{
int studentId=1;
session.beginTransaction();
Student student=session.get(Student.class, studentId);
student.setFirstName("Febz");
session.getTransaction().commit();
System.out.println("Done");
session=factory.getCurrentSession();
session.beginTransaction();
session.createQuery("update Student set email='foo@gmail.com'").executeUpdate();
session.getTransaction().commit();
}
catch (Exception e) {
// TODO: handle exception
}
finally {
factory.close();
}
}
}
| [
"febinzachariah6@gmail.com"
] | febinzachariah6@gmail.com |
77c1068de3dd0a0e7e4e2d89b003325aa7c2943d | 77cfd3a22ca90d9ac94534f034bc81f3f4462424 | /CounsellingAPI/src/main/java/com/example/demo/model/BTGitHubUsersVO.java | 9de7109882d0767a176177877d40afb47f4479e6 | [] | no_license | OmenderSharma28/CounsellingAPI | fec7b6c73428a7860c11a7e04a4c555651286761 | 2c0b54fb388279184b0b5c1638fa8351d6e54abe | refs/heads/master | 2021-02-12T08:58:03.906882 | 2020-11-02T06:31:56 | 2020-11-02T06:31:56 | 244,580,057 | 0 | 0 | null | 2020-11-02T03:26:12 | 2020-03-03T08:22:30 | Java | UTF-8 | Java | false | false | 15,461 | java | package com.example.demo.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.jvnet.jaxb2_commons.lang.*;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import java.io.Serializable;
@JsonPropertyOrder({"login", "id", "node_id", "avatar_url", "gravatar_id", "url", "html_url", "followers_url", "following_url", "gists_url", "starred_url", "subscriptions_url"
, "organizations_url", "repos_url", "events_url", "received_events_url", "type", "site_admin", "name", "company", "blog", "location", "email", "hireable", "bio"
, "twitter_username", "public_repos", "public_gists", "followers", "following", "created_at", "updated_at"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BTGitHubUsersVO implements Serializable, ToString2 {
protected String login;
protected Long id;
protected String node_id;
protected String avatar_url;
protected String gravatar_id;
protected String url;
protected String html_url;
protected String followers_url;
protected String following_url;
protected String gists_url;
protected String starred_url;
protected String subscriptions_url;
protected String organizations_url;
protected String repos_url;
protected String events_url;
protected String received_events_url;
protected String type;
protected String site_admin;
protected String name;
protected String company;
protected String blog;
protected String location;
protected String email;
protected String hireable;
protected String bio;
protected String twitter_username;
protected int public_repos;
protected int public_gists;
protected int followers;
protected int following;
protected String created_at;
protected String updated_at;
public BTGitHubUsersVO() {
}
public BTGitHubUsersVO(String login, Long id, String node_id, String avatar_url, String gravatar_id, String url, String html_url,
String followers_url, String following_url, String gists_url, String starred_url, String subscriptions_url,
String organizations_url, String repos_url, String events_url, String received_events_url, String type,
String site_admin, String name, String company, String blog, String location, String email, String hireable,
String bio, String twitter_username, int public_repos, int public_gists, int followers, int following,
String created_at, String updated_at) {
this.login = login;
this.id = id;
this.node_id = node_id;
this.avatar_url = avatar_url;
this.gravatar_id = gravatar_id;
this.url = url;
this.html_url = html_url;
this.followers_url = followers_url;
this.following_url = following_url;
this.gists_url = gists_url;
this.starred_url = starred_url;
this.subscriptions_url = subscriptions_url;
this.organizations_url = organizations_url;
this.repos_url = repos_url;
this.events_url = events_url;
this.received_events_url = received_events_url;
this.type = type;
this.site_admin = site_admin;
this.name = name;
this.company = company;
this.blog = blog;
this.location = location;
this.email = email;
this.hireable = hireable;
this.bio = bio;
this.twitter_username = twitter_username;
this.public_repos = public_repos;
this.public_gists = public_gists;
this.followers = followers;
this.following = following;
this.created_at = created_at;
this.updated_at = updated_at;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNode_id() {
return node_id;
}
public void setNode_id(String node_id) {
this.node_id = node_id;
}
public String getAvatar_url() {
return avatar_url;
}
public void setAvatar_url(String avatar_url) {
this.avatar_url = avatar_url;
}
public String getGravatar_id() {
return gravatar_id;
}
public void setGravatar_id(String gravatar_id) {
this.gravatar_id = gravatar_id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getHtml_url() {
return html_url;
}
public void setHtml_url(String html_url) {
this.html_url = html_url;
}
public String getFollowers_url() {
return followers_url;
}
public void setFollowers_url(String followers_url) {
this.followers_url = followers_url;
}
public String getFollowing_url() {
return following_url;
}
public void setFollowing_url(String following_url) {
this.following_url = following_url;
}
public String getGists_url() {
return gists_url;
}
public void setGists_url(String gists_url) {
this.gists_url = gists_url;
}
public String getStarred_url() {
return starred_url;
}
public void setStarred_url(String starred_url) {
this.starred_url = starred_url;
}
public String getSubscriptions_url() {
return subscriptions_url;
}
public void setSubscriptions_url(String subscriptions_url) {
this.subscriptions_url = subscriptions_url;
}
public String getOrganizations_url() {
return organizations_url;
}
public void setOrganizations_url(String organizations_url) {
this.organizations_url = organizations_url;
}
public String getRepos_url() {
return repos_url;
}
public void setRepos_url(String repos_url) {
this.repos_url = repos_url;
}
public String getEvents_url() {
return events_url;
}
public void setEvents_url(String events_url) {
this.events_url = events_url;
}
public String getReceived_events_url() {
return received_events_url;
}
public void setReceived_events_url(String received_events_url) {
this.received_events_url = received_events_url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getSite_admin() {
return site_admin;
}
public void setSite_admin(String site_admin) {
this.site_admin = site_admin;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getBlog() {
return blog;
}
public void setBlog(String blog) {
this.blog = blog;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getHireable() {
return hireable;
}
public void setHireable(String hireable) {
this.hireable = hireable;
}
public String getBio() {
return bio;
}
public void setBio(String bio) {
this.bio = bio;
}
public String getTwitter_username() {
return twitter_username;
}
public void setTwitter_username(String twitter_username) {
this.twitter_username = twitter_username;
}
public int getPublic_repos() {
return public_repos;
}
public void setPublic_repos(int public_repos) {
this.public_repos = public_repos;
}
public int getPublic_gists() {
return public_gists;
}
public void setPublic_gists(int public_gists) {
this.public_gists = public_gists;
}
public int getFollowers() {
return followers;
}
public void setFollowers(int followers) {
this.followers = followers;
}
public int getFollowing() {
return following;
}
public void setFollowing(int following) {
this.following = following;
}
public String getCreated_at() {
return created_at;
}
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
public String getUpdated_at() {
return updated_at;
}
public void setUpdated_at(String updated_at) {
this.updated_at = updated_at;
}
@Override
public StringBuilder append(ObjectLocator objectLocator, StringBuilder buffer, ToStringStrategy2 strategy) {
strategy.appendStart(objectLocator, this, buffer);
this.appendFields(objectLocator, buffer, strategy);
strategy.appendEnd(objectLocator, this, buffer);
return buffer;
}
@Override
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
String Tlogin = this.login;
strategy.appendField(locator, this, "login", buffer, Tlogin, this.login != null);
Long Tid = this.id;
strategy.appendField(locator, this, "id", buffer, Tid, true);
String Tnode_id = this.node_id;
strategy.appendField(locator, this, "node_id", buffer, Tnode_id, this.node_id != null);
String Tavatar_url = this.avatar_url;
strategy.appendField(locator, this, "avatar_url", buffer, Tavatar_url, this.avatar_url != null);
String Tgravatar_id = this.gravatar_id;
strategy.appendField(locator, this, "gravatar_id", buffer, Tgravatar_id, this.gravatar_id != null);
String Turl = this.url;
strategy.appendField(locator, this, "url", buffer, Turl, this.url != null);
String Thtml_url = this.html_url;
strategy.appendField(locator, this, "html_url", buffer, Thtml_url, this.html_url != null);
String Tfollowers_url = this.followers_url;
strategy.appendField(locator, this, "followers_url", buffer, Tfollowers_url, this.followers_url != null);
String Tfollowing_url = this.following_url;
strategy.appendField(locator, this, "following_url", buffer, Tfollowing_url, this.following_url != null);
String Tgists_url = this.gists_url;
strategy.appendField(locator, this, "gists_url", buffer, Tgists_url, this.gists_url != null);
String Tstarred_url = this.starred_url;
strategy.appendField(locator, this, "starred_url", buffer, Tstarred_url, this.starred_url != null);
String Tsubscriptions_url = this.subscriptions_url;
strategy.appendField(locator, this, "subscriptions_url", buffer, Tsubscriptions_url, this.subscriptions_url != null);
String Torganizations_url = this.organizations_url;
strategy.appendField(locator, this, "organizations_url", buffer, Torganizations_url, this.organizations_url != null);
String Trepos_url = this.repos_url;
strategy.appendField(locator, this, "repos_url", buffer, Trepos_url, this.repos_url != null);
String Treceived_events_url = this.received_events_url;
strategy.appendField(locator, this, "received_events_url", buffer, Treceived_events_url, this.received_events_url != null);
String Ttype = this.type;
strategy.appendField(locator, this, "type", buffer, Ttype, this.type != null);
String Tsite_admin = this.site_admin;
strategy.appendField(locator, this, "site_admin", buffer, Tsite_admin, this.site_admin != null);
String Tname = this.url;
strategy.appendField(locator, this, "name", buffer, Tname, this.name != null);
String Tcompany = this.company;
strategy.appendField(locator, this, "company", buffer, Tcompany, this.company != null);
String Tblog = this.blog;
strategy.appendField(locator, this, "blog", buffer, Tblog, this.blog != null);
String Tlocation = this.location;
strategy.appendField(locator, this, "location", buffer, Tlocation, this.location != null);
String Temail = this.email;
strategy.appendField(locator, this, "email", buffer, Temail, this.email != null);
String Thireable = this.hireable;
strategy.appendField(locator, this, "hireable", buffer, Thireable, this.hireable != null);
String Tbio = this.bio;
strategy.appendField(locator, this, "bio", buffer, Tbio, this.bio != null);
String Ttwitter_username = this.twitter_username;
strategy.appendField(locator, this, "twitter_username", buffer, Ttwitter_username, this.twitter_username != null);
int Tpublic_repos = this.public_repos;
strategy.appendField(locator, this, "public_repos", buffer, Tpublic_repos, true);
int Tpublic_gists = this.public_gists;
strategy.appendField(locator, this, "public_gists", buffer, Tpublic_gists, true);
int Tfollowers = this.followers;
strategy.appendField(locator, this, "followers", buffer, Tfollowers, true);
int Tfollowing = this.following;
strategy.appendField(locator, this, "following", buffer, Tfollowing, true);
String Tcreated_at = this.created_at;
strategy.appendField(locator, this, "created_at", buffer, Tcreated_at, this.created_at != null);
String Tupdated_at = this.bio;
strategy.appendField(locator, this, "updated_at", buffer, Tupdated_at, this.updated_at != null);
return buffer;
}
public String toString() {
ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
StringBuilder buffer = new StringBuilder();
this.append((ObjectLocator) null, buffer, strategy);
return buffer.toString();
}
}
/*
{
"login": "octocat",
"id": 583231,
"node_id": "MDQ6VXNlcjU4MzIzMQ==",
"avatar_url": "https://avatars3.githubusercontent.com/u/583231?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false,
"name": "The Octocat",
"company": "@github",
"blog": "https://github.blog",
"location": "San Francisco",
"email": null,
"hireable": null,
"bio": null,
"twitter_username": null,
"public_repos": 8,
"public_gists": 8,
"followers": 3317,
"following": 9,
"created_at": "2011-01-25T18:44:36Z",
"updated_at": "2020-10-28T10:41:52Z"
}
*/ | [
"sharma.omi24x7@gmail.com"
] | sharma.omi24x7@gmail.com |
dfacb9ff18df92294580782eeb07b224cadb1a64 | 6d1f8f90cfbe9cbf0a109e2325ca3f9656e35ba1 | /src/com/xiaolianhust/leetcode/easy/BinaryTreeLevelOrderTraversalII.java | 63b8568dce0e0c7f2b616352c1b792b6601aa0f4 | [] | no_license | hustxiaolian/LeetCodeSulotion | a29841e01952e25f11dc98869cbf6d026b9f131a | 1179c45dc963107406e28050d574356a82762aaa | refs/heads/master | 2021-07-15T07:27:59.138624 | 2018-12-11T07:01:56 | 2018-12-11T07:01:56 | 129,014,664 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,691 | java | package com.xiaolianhust.leetcode.easy;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.xiaolianhust.leetcode.medium.UniqueBinarySearchTreesII.TreeNode;
public class BinaryTreeLevelOrderTraversalII {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
/**
* 第一种思路:
* 这类似的题目,我貌似在数据结构与算法导论的书上提到过。使用后今后出队列来做.
* 具体步骤:
* 1. 首先把root放入队列.
* 2. 取出队列中最前面的节点。判断它是否有左右节点。有的话放入队列中
* 3. 外层循环为深度向下迭代,内层为当前深度下所有节点的遍历。
*
* test1: 2ms, beats 96.27%ε=ε=ε=┏(゜ロ゜;)┛
* @param root
* @return
*/
public List<List<Integer>> levelOrderBottom(TreeNode root) {
//初始化变量,并且处理特殊情况
LinkedList<List<Integer>> result = new LinkedList<>();
if(root == null) return result;
LinkedList<TreeNode> queue = new LinkedList<>();
int cnt = 1;//记录当前深度下,节点的个数
//将根节点放入队列中
queue.add(root);
while(cnt != 0) {
int nextCnt = 0;//记录下一个深度下节点的个数
List<Integer> oneAns = new ArrayList<>();
for(int i = 0;i < cnt;++i) {
TreeNode t = queue.removeFirst();
oneAns.add(t.val);
if(t.left != null) {
++nextCnt;
queue.addLast(t.left);
}
if(t.right != null) {
++nextCnt;
queue.addLast(t.right);
}
}
result.addFirst(oneAns);
cnt = nextCnt;
}
return result;
}
}
| [
"2504033134@qq.com"
] | 2504033134@qq.com |
450bc0e6904bccbd74b0e83675393d19d9340bd2 | c08a7148d4480650d9f56b787bbfc35183265a26 | /src/com/own/store/test/TestBeanUtils.java | 62faeebb385f7974e323e7a48de6e7518249821a | [
"Apache-2.0"
] | permissive | TheOnlyAndLastOne/store | 242187ab8de99abd5f96b25f048bc40c29fdadb5 | 9702a712e4806822272589b5062f495a906bd419 | refs/heads/master | 2020-03-25T17:43:24.806676 | 2018-08-17T08:43:33 | 2018-08-17T08:43:33 | 143,991,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package com.own.store.test;
import com.own.store.domain.User;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.DateConverter;
import org.junit.Test;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
/**
* @Author: zhaozhi
* @Date: 2018/8/9 0009 10:16
* @Description:
*/
public class TestBeanUtils {
@Test
public void test01(){
Map<String,String[]> map = new HashMap<>();
map.put("username",new String[]{"tom"});
map.put("password",new String[]{"123"});
User user = new User();
try {
BeanUtils.populate(user,map);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
@Test
public void test02() throws InvocationTargetException, IllegalAccessException {
Map<String,String[]> map = new HashMap<>();
map.put("username",new String[]{"tom"});
map.put("password",new String[]{"123"});
map.put("birthday",new String[]{"2018-08-08"});
User user = new User();
DateConverter dt = new DateConverter();
dt.setPattern("yyyy-MM-dd");
ConvertUtils.register(dt,java.util.Date.class);
BeanUtils.populate(user,map);
System.out.println(user );
}
}
| [
"2435535660@qq.com"
] | 2435535660@qq.com |
3517f0be49b196c226ae386c8d0f8367f5fb8a32 | 47075da8c34f95fc26d9db0b8d57a76add8b325c | /lightdraw/CommandBaseImpl.java | 682f2d3836bcffdfded5ce84ea377c0adb84a52a | [] | no_license | atulim/Java-Codes | 8124cc07724e648e65556db1462ae193f77d13d4 | 7670493ea9c194a1de334d1a7edb653c67d142b8 | refs/heads/master | 2021-07-24T02:04:08.194973 | 2017-10-30T06:23:36 | 2017-10-30T06:23:36 | 108,806,501 | 0 | 2 | null | 2017-10-30T10:19:20 | 2017-10-30T05:37:41 | Java | UTF-8 | Java | false | false | 927 | java | import java.util.Arrays;
import java.util.Stack;
public class CommandBaseImpl implements CommandBase {
private final Stack<DrawCommand> commands = new Stack<DrawCommand>();
private final Stack<DrawCommand> undoStack = new Stack<DrawCommand>();
private static CommandBase SINGLETON;
public static CommandBase getInstance() {
if(SINGLETON==null) {
SINGLETON = new CommandBaseImpl();
}
return SINGLETON;
}
@Override
public void executeCommand(DrawCommand drawCommand) {
drawCommand.draw();
undoStack.clear();
commands.push(drawCommand);
}
@Override
public void undo() {
DrawCommand command = commands.pop();
command.undo();
undoStack.push(command);
}
@Override
public void redo() {
DrawCommand command = undoStack.pop();
command.draw();
commands.push(command);
}
@Override
public void showCurrentCommands() {
System.out.println(Arrays.toString(commands.toArray()));
}
}
| [
"cedric.sarmenta@gmail.com"
] | cedric.sarmenta@gmail.com |
709e89e852543d15d842e7545b15c2d45fde8083 | 61ad44d7ac7cc7b612f8d97c1241da8accc0abc5 | /JavaClasses/src/classes/Cat.java | b5b1173e886d6fdd6242077938f8d461aedb14e6 | [] | no_license | Nedelin/workspace | 89aa4fe0e493852d508340de12f64c904ded0296 | df5ea6fd547657c651edd649389edf29f5a9100d | refs/heads/master | 2021-05-07T19:34:40.993457 | 2017-10-30T23:53:56 | 2017-10-30T23:53:56 | 108,921,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package classes;
public class Cat {
void eat(){
System.out.println("Cat is eating.");
}
public void sleep(){
System.out.println("Cat is sleeping");
screem();
}
private void screem(){
System.out.println("Myyyyaaaauuu");
}
protected void scratch(){
System.out.println("Cat is scratching");
}
}
| [
"nedelinaleksandrov95@gmail.com"
] | nedelinaleksandrov95@gmail.com |
4b3d76052d4d0799bdf75222b48159105505addb | f94319f80ec75be1aa6ff7510424c1e0d71e6a25 | /src/main/java/com/vtest/it/telplatform/services/prober/ProberServices.java | 4afb1cb527c362dd895b2e2aa10fd7d455434d6a | [] | no_license | ShawnGW/telplatform | 7275795d3afc2b034fcca50ebe1356128e23f817 | 17aefb6441204ccb6ca352f1c6750a2b98bbf7bc | refs/heads/master | 2022-07-02T10:57:45.679547 | 2020-12-11T10:11:14 | 2020-12-11T10:11:14 | 197,745,497 | 0 | 0 | null | 2022-06-17T02:18:25 | 2019-07-19T09:35:08 | Java | UTF-8 | Java | false | false | 641 | java | package com.vtest.it.telplatform.services.prober;
import com.vtest.it.telplatform.pojo.vtptmt.BinWaferInforBean;
import java.util.ArrayList;
import java.util.HashMap;
public interface ProberServices {
public int insertSiteInforToBinInfoSummary(String customerCode, String device, String lot, String cp, String waferId, HashMap<Integer, HashMap<Integer, Integer>> siteMap, String testType, ArrayList<Integer> passBins);
public int deleteSiteInforToBinInfoSummary(String customerCode, String device, String lot, String cp, String waferId);
public int insertWaferInforToBinWaferSummary(BinWaferInforBean binWaferInforBean);
}
| [
"Mailsunguowei@163.com"
] | Mailsunguowei@163.com |
93614c590a989715d4705b7abe829e46f5eed696 | 711cb24b8623037176ce41c2af63c715d7e23560 | /TimeManagementSystem/src/java/adminController/ViewRequestController.java | 8db7350099b375baa6fb2f0f68aa04a9f4d06885 | [] | no_license | duongdd141100/Time-Management-System | d320048cbd744dffc51892a1afd0eaf307533d88 | 44f2053438e44858cc62c7862ef4a44af40bc9d8 | refs/heads/main | 2023-06-26T08:57:48.533899 | 2021-07-20T14:13:49 | 2021-07-20T14:13:49 | 376,997,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,038 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package adminController;
import dal.AbsentDAO;
import dal.AdminDAO;
import dal.EmployeeDAO;
import dal.RequestDAO;
import employeeCotroller.BaseAuthenticationController;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.Absent;
import model.Account;
import model.Admin;
import model.Employee;
import model.Request;
/**
*
* @author Do Duc Duong
*/
public class ViewRequestController extends BaseAuthenticationController {
@Override
protected void processGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String username = "all";
int pageIndex = 1;
if (request.getParameter("page") != null) {
pageIndex = Integer.parseInt(request.getParameter("page"));
}
int pageSize = 15;
AbsentDAO dbAbsent = new AbsentDAO();
ArrayList<Absent> listAbsent = dbAbsent.getAllRequest(pageIndex, pageSize);
int totalPage = dbAbsent.getTotalPageOfAll(pageSize);
if (request.getParameter("username") != null) {
username = request.getParameter("username");
if (!username.equals("all")) {
listAbsent = dbAbsent.getListAbsent(username, pageIndex, pageSize);
totalPage = dbAbsent.getTotalPage(username, pageSize);
Cookie c = new Cookie("username", username);
response.addCookie(c);
}else {
Cookie[] cookies = request.getCookies();
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("username")) {
cookies[i].setValue("");
cookies[i].setMaxAge(0);
response.addCookie(cookies[i]);
break;
}
}
}
} else {
Cookie[] cookies = request.getCookies();
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("username")) {
username = cookies[i].getValue();
listAbsent = dbAbsent.getListAbsent(username, pageIndex, pageSize);
totalPage = totalPage = dbAbsent.getTotalPage(username, pageSize);
break;
}
}
}
RequestDAO dbRequest = new RequestDAO();
ArrayList<Request> listRequest = dbRequest.getRequest();
for (int i = 0; i < listAbsent.size(); i++) {
for (int j = 0; j < listRequest.size(); j++) {
if (listAbsent.get(i).getRequest().getId() == listRequest.get(j).getId()) {
listAbsent.get(i).getRequest().setName(listRequest.get(j).getName());
break;
}
}
}
Account account = (Account) request.getSession().getAttribute("account");
String usernameAdmin = account.getUsername();
AdminDAO dbAdmin = new AdminDAO();
ArrayList<Admin> listAdmin = dbAdmin.getAllAdmin();
EmployeeDAO dbE = new EmployeeDAO();
ArrayList<Employee> listEmployee = dbE.getEmployee();
Admin admin = dbAdmin.getAdmin(account.getUsername());
request.setAttribute("adminName", admin.getName());
request.setAttribute("adminName", admin.getName());
request.setAttribute("username", username);
String url = request.getServletPath();
request.setAttribute("url", url.substring(1, url.length()));
request.setAttribute("listAdmin", listAdmin);
request.setAttribute("pageIndex", pageIndex);
request.setAttribute("totalPage", totalPage);
request.setAttribute("usernameAdmin", usernameAdmin);
request.setAttribute("listEmployee", listEmployee);
request.setAttribute("listAbsent", listAbsent);
request.getRequestDispatcher("adminView/ViewRequest.jsp").forward(request, response);
}
@Override
protected void processPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter("username");
String accepter = request.getParameter("accepter");
String date = request.getParameter("date");
String reason = request.getParameter("reason");
String requestId = request.getParameter("requestId");
String acceptType = request.getParameter("acceptType");
AbsentDAO dbAbsent = new AbsentDAO();
dbAbsent.updateRecord(username, accepter, date, reason, requestId, acceptType);
response.sendRedirect("view-request");
}
}
| [
"83938501+duongdd141100@users.noreply.github.com"
] | 83938501+duongdd141100@users.noreply.github.com |
f6716f4d074e5706d0b43309f3d00983d7ba90b6 | 15dbdeb0066f4ba11967400d09efbb52cc8ba53e | /E_comerceapp (2)/E_comerceapp/app/src/main/java/com/example/hakim/e_comerceapp/Model/Products.java | 7e656798a685215c3743352e3173d98cc0d247de | [] | no_license | hakamali/E_CommerceApp | 9759aed4353942319074e9a65cb5df66f67126e5 | 2e71bb86f5b027799e70d02239aed7e56e3f73fc | refs/heads/master | 2020-05-24T07:29:57.617880 | 2019-05-17T06:58:53 | 2019-05-17T06:58:53 | 184,030,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,679 | java | package com.example.hakim.e_comerceapp.Model;
public class Products
{
private String pname,description,price,image,category,pid,date,time;
public Products()
{
}
public Products(String pname, String description, String price, String image, String category, String pid, String date, String time) {
this.pname = pname;
this.description = description;
this.price = price;
this.image = image;
this.category = category;
this.pid = pid;
this.date = date;
this.time = time;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
| [
"hakamali1437@gmail.com"
] | hakamali1437@gmail.com |
141239440c178bf0f9936710a551bbf30e23998e | 60ab53e1d0ae41d7e86d83f628334fbffb4fcb3c | /src/exjava/exa01/ExA01.java | d3c127f481c761f9dcc0ad8fdb1774c3255266d5 | [] | no_license | bvanrooy/exjava | 461c6ea6ff03e4768234f226ad4521e81feeadbe | f72fc9e9811661f364e57c51e875145b4f63f10e | refs/heads/master | 2022-12-22T03:27:45.089799 | 2020-09-24T08:41:21 | 2020-09-24T08:41:21 | 297,541,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package exjava.exa01;
public class ExA01 {
public static void main(String[] args){
Course course = new Course();
course.title="Java Fundamentals";
course.numberOfDays=2;
course.pricePerDay=250;
course.priorKnowledgeNeeded=true;
System.out.println("Course");
System.out.println("Title " + course.title);
System.out.println("Number of days : " + course.numberOfDays);
System.out.println("Price / day : " + course.pricePerDay);
System.out.println("Prior knowledge needed : " + course.priorKnowledgeNeeded);
}
}
| [
"bart.van.rooy@gmail.com"
] | bart.van.rooy@gmail.com |
e5319bd72bf3fbd2c64af9cfd5f5673741f30741 | f912f0fe9b865a18b5bc31fe62c7eb8d97d108db | /workspace/at.jku.weiner.c.parser.tests/src-gen/at/jku/weiner/c/parser/xtexttests/Test0019_HelloWorld.java | f43ede2529857c7c53ca9a9485cbf36d78d0de17 | [] | no_license | timeraider4u/kefax | 44db2c63ea85e10a5157436bb2dabd742b590032 | 7e46c1730f561d1b76017f0ddb853c94dbb93cd6 | refs/heads/master | 2020-04-16T01:58:01.195430 | 2016-10-30T22:08:29 | 2016-10-30T22:08:29 | 41,462,260 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,472 | java | package at.jku.weiner.c.parser.xtexttests;
import com.google.inject.Inject;
import com.google.inject.Provider;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import org.antlr.runtime.Token;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.IGenerator;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
import org.eclipse.xtext.junit4.InjectWith;
import org.eclipse.xtext.junit4.util.ParseHelper;
import org.eclipse.xtext.junit4.validation.ValidationTestHelper;
import org.eclipse.xtext.junit4.XtextRunner;
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
import org.eclipse.xtext.resource.IResourceFactory;
import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CheckMode;
import org.eclipse.xtext.validation.IResourceValidator;
import org.eclipse.xtext.validation.Issue;
import org.junit.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import at.jku.weiner.c.parser.tests.ParserInjectorProvider;
import at.jku.weiner.c.parser.parser.antlr.ParserParser;
import at.jku.weiner.c.parser.parser.antlr.internal.InternalParserLexer;
import at.jku.weiner.c.parser.xtexttests.LexerAndParserTest;
import at.jku.weiner.c.parser.parser.Parser;
import at.jku.weiner.c.parser.parser.ExternalDeclaration;
import at.jku.weiner.c.parser.parser.FunctionDefHead;
import at.jku.weiner.c.parser.parser.FunctionDeclarationSpecifiers;
import at.jku.weiner.c.parser.parser.TypeSpecifier;
import at.jku.weiner.c.parser.parser.Declarator;
import at.jku.weiner.c.parser.parser.DirectDeclarator;
import at.jku.weiner.c.parser.parser.DeclaratorSuffix;
import at.jku.weiner.c.parser.parser.DirectDeclaratorLastSuffix;
import at.jku.weiner.c.parser.parser.ParameterTypeList;
import at.jku.weiner.c.parser.parser.ParameterList;
import at.jku.weiner.c.parser.parser.ParameterDeclaration;
import at.jku.weiner.c.parser.parser.DeclarationSpecifiers;
import at.jku.weiner.c.parser.parser.TypeSpecifier;
import at.jku.weiner.c.parser.parser.Declarator;
import at.jku.weiner.c.parser.parser.DirectDeclarator;
import at.jku.weiner.c.parser.parser.ParameterDeclaration;
import at.jku.weiner.c.parser.parser.DeclarationSpecifiers;
import at.jku.weiner.c.parser.parser.TypeSpecifier;
import at.jku.weiner.c.parser.parser.Declarator;
import at.jku.weiner.c.parser.parser.DirectDeclarator;
import at.jku.weiner.c.parser.parser.Pointer;
import at.jku.weiner.c.parser.parser.FunctionDefinition;
import at.jku.weiner.c.parser.parser.BodyStatement;
import at.jku.weiner.c.parser.parser.BlockList;
import at.jku.weiner.c.parser.parser.Statement;
import at.jku.weiner.c.parser.parser.ExpressionStatement;
import at.jku.weiner.c.parser.parser.PostfixExpression;
import at.jku.weiner.c.parser.parser.PrimaryExpression;
import at.jku.weiner.c.parser.parser.PostfixExpressionSuffixArgument;
import at.jku.weiner.c.parser.parser.ArgumentExpressionList;
import at.jku.weiner.c.parser.parser.PrimaryExpression;
import at.jku.weiner.c.parser.parser.PrimaryExpression;
import at.jku.weiner.c.parser.parser.Statement;
import at.jku.weiner.c.parser.parser.JumpStatement;
import at.jku.weiner.c.parser.parser.PrimaryExpression;
import at.jku.weiner.c.common.common.Constant2;
@SuppressWarnings("unused")
@RunWith(XtextRunner.class)
@InjectWith(ParserInjectorProvider.class)
public class Test0019_HelloWorld {
@Inject
private ParseHelper<Parser> parseHelper;
@Inject
private ValidationTestHelper valHelper;
@Inject
private InternalParserLexer lexer;
@Inject
private ParserParser parser;
@Inject
private ITokenDefProvider tokenDefProvider;
//@Inject
private LexerAndParserTest testHelper;
@Inject
private IGenerator generator;
@Inject
private Provider<ResourceSet> resourceSetProvider;
@Inject
private IResourceValidator validator;
@Inject
private JavaIoFileSystemAccess fileAccessSystem;
@Inject
private IResourceFactory resourceFactory;
@Before
public void initialize(){
this.testHelper = new LexerAndParserTest(lexer,
parser, tokenDefProvider);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("c",
this.resourceFactory);
}
@After
public void cleanUp() {
}
private String getTextFromFile(final String fileName)
throws Exception{
final Path path = Paths.get(fileName);
final String content = new String(Files.readAllBytes(path));
return content;
}
@Test (timeout=1000)
public void checkLexerTokens() throws Exception{
final String text = this.getTextFromFile(
"res/Test0019_HelloWorld.c");
final String[] expected = new String[] {
"RULE_LINEDIRECTIVE",
"RULE_NEWLINE",
"RULE_KW_INT",
"RULE_WHITESPACE",
"RULE_ID",
"RULE_SKW_LEFTPAREN",
"RULE_KW_INT",
"RULE_WHITESPACE",
"RULE_ID",
"RULE_SKW_COMMA",
"RULE_WHITESPACE",
"RULE_KW_CHAR",
"RULE_WHITESPACE",
"RULE_SKW_STAR",
"RULE_SKW_STAR",
"RULE_WHITESPACE",
"RULE_ID",
"RULE_SKW_RIGHTPAREN",
"RULE_WHITESPACE",
"RULE_SKW_LEFTBRACE",
"RULE_NEWLINE",
"RULE_WHITESPACE",
"RULE_ID",
"RULE_SKW_LEFTPAREN",
"RULE_STRING_LITERAL",
"RULE_SKW_COMMA",
"RULE_WHITESPACE",
"RULE_STRING_LITERAL",
"RULE_SKW_RIGHTPAREN",
"RULE_SKW_SEMI",
"RULE_NEWLINE",
"RULE_WHITESPACE",
"RULE_KW_RETURN",
"RULE_WHITESPACE",
"RULE_DECIMAL_LITERAL",
"RULE_SKW_SEMI",
"RULE_NEWLINE",
"RULE_SKW_RIGHTBRACE",
"RULE_NEWLINE",
};
//final List<Token> actual = testHelper.getTokens(text);
//testHelper.outputTokens(text);
testHelper.checkTokenisation(text, expected);
}
@Test (timeout=1000)
public void checkParserResult() throws Exception {
final String text = this.getTextFromFile(
"res/Test0019_HelloWorld.c");
final Parser Parser_0_Var
=
this.parseHelper.parse(text);
this.valHelper.assertNoErrors(Parser_0_Var
);
Assert.assertNotNull(Parser_0_Var
);
final EList<? extends EObject> External_0_list = Parser_0_Var
.getExternal();
Assert.assertNotNull(External_0_list);
Assert.assertEquals(1, External_0_list.size());
//0
final ExternalDeclaration ExternalDeclaration_1_Var
= (ExternalDeclaration)External_0_list.get(0);
Assert.assertNotNull(ExternalDeclaration_1_Var
);
//1
final FunctionDefHead FunctionDefHead_2_Var
= (FunctionDefHead)ExternalDeclaration_1_Var
.getFunctiondefHead();
Assert.assertNotNull(FunctionDefHead_2_Var
);
//2
final FunctionDeclarationSpecifiers FunctionDeclarationSpecifiers_3_Var
= (FunctionDeclarationSpecifiers)FunctionDefHead_2_Var
.getFunDeclSpecifiers();
Assert.assertNotNull(FunctionDeclarationSpecifiers_3_Var
);
final EList<? extends EObject> DeclarationSpecifier_3_list = FunctionDeclarationSpecifiers_3_Var
.getDeclarationSpecifier();
Assert.assertNotNull(DeclarationSpecifier_3_list);
Assert.assertEquals(1, DeclarationSpecifier_3_list.size());
//3
final TypeSpecifier TypeSpecifier_4_Var
= (TypeSpecifier)DeclarationSpecifier_3_list.get(0);
Assert.assertNotNull(TypeSpecifier_4_Var
);
Assert.assertEquals("int", TypeSpecifier_4_Var
.getName());
//4
final Declarator Declarator_5_Var
= (Declarator)FunctionDefHead_2_Var
.getFunDeclarator();
Assert.assertNotNull(Declarator_5_Var
);
//5
final DirectDeclarator DirectDeclarator_6_Var
= (DirectDeclarator)Declarator_5_Var
.getDeclarator();
Assert.assertNotNull(DirectDeclarator_6_Var
);
Assert.assertEquals("main", DirectDeclarator_6_Var
.getIdent());
final EList<? extends EObject> DeclaratorSuffix_6_list = DirectDeclarator_6_Var
.getDeclaratorSuffix();
Assert.assertNotNull(DeclaratorSuffix_6_list);
Assert.assertEquals(1, DeclaratorSuffix_6_list.size());
//6
final DeclaratorSuffix DeclaratorSuffix_7_Var
= (DeclaratorSuffix)DeclaratorSuffix_6_list.get(0);
Assert.assertNotNull(DeclaratorSuffix_7_Var
);
//7
final DirectDeclaratorLastSuffix DirectDeclaratorLastSuffix_8_Var
= (DirectDeclaratorLastSuffix)DeclaratorSuffix_7_Var
.getLastSuffix();
Assert.assertNotNull(DirectDeclaratorLastSuffix_8_Var
);
final EList<? extends EObject> ParameterTypeList_8_list = DirectDeclaratorLastSuffix_8_Var
.getParameterTypeList();
Assert.assertNotNull(ParameterTypeList_8_list);
Assert.assertEquals(1, ParameterTypeList_8_list.size());
//8
final ParameterTypeList ParameterTypeList_9_Var
= (ParameterTypeList)ParameterTypeList_8_list.get(0);
Assert.assertNotNull(ParameterTypeList_9_Var
);
//9
final ParameterList ParameterList_10_Var
= (ParameterList)ParameterTypeList_9_Var
.getList();
Assert.assertNotNull(ParameterList_10_Var
);
final EList<? extends EObject> ParameterDeclaration_10_list = ParameterList_10_Var
.getParameterDeclaration();
Assert.assertNotNull(ParameterDeclaration_10_list);
Assert.assertEquals(2, ParameterDeclaration_10_list.size());
//10
final ParameterDeclaration ParameterDeclaration_11_Var
= (ParameterDeclaration)ParameterDeclaration_10_list.get(0);
Assert.assertNotNull(ParameterDeclaration_11_Var
);
//11
final DeclarationSpecifiers DeclarationSpecifiers_12_Var
= (DeclarationSpecifiers)ParameterDeclaration_11_Var
.getDeclSpecifiers();
Assert.assertNotNull(DeclarationSpecifiers_12_Var
);
final EList<? extends EObject> DeclarationSpecifier_12_list = DeclarationSpecifiers_12_Var
.getDeclarationSpecifier();
Assert.assertNotNull(DeclarationSpecifier_12_list);
Assert.assertEquals(1, DeclarationSpecifier_12_list.size());
//12
final TypeSpecifier TypeSpecifier_13_Var
= (TypeSpecifier)DeclarationSpecifier_12_list.get(0);
Assert.assertNotNull(TypeSpecifier_13_Var
);
Assert.assertEquals("int", TypeSpecifier_13_Var
.getName());
//13
final Declarator Declarator_14_Var
= (Declarator)ParameterDeclaration_11_Var
.getDeclarator();
Assert.assertNotNull(Declarator_14_Var
);
//14
final DirectDeclarator DirectDeclarator_15_Var
= (DirectDeclarator)Declarator_14_Var
.getDeclarator();
Assert.assertNotNull(DirectDeclarator_15_Var
);
Assert.assertEquals("argc", DirectDeclarator_15_Var
.getIdent());
//15
final ParameterDeclaration ParameterDeclaration_16_Var
= (ParameterDeclaration)ParameterDeclaration_10_list.get(1);
Assert.assertNotNull(ParameterDeclaration_16_Var
);
//16
final DeclarationSpecifiers DeclarationSpecifiers_17_Var
= (DeclarationSpecifiers)ParameterDeclaration_16_Var
.getDeclSpecifiers();
Assert.assertNotNull(DeclarationSpecifiers_17_Var
);
final EList<? extends EObject> DeclarationSpecifier_17_list = DeclarationSpecifiers_17_Var
.getDeclarationSpecifier();
Assert.assertNotNull(DeclarationSpecifier_17_list);
Assert.assertEquals(1, DeclarationSpecifier_17_list.size());
//17
final TypeSpecifier TypeSpecifier_18_Var
= (TypeSpecifier)DeclarationSpecifier_17_list.get(0);
Assert.assertNotNull(TypeSpecifier_18_Var
);
Assert.assertEquals("char", TypeSpecifier_18_Var
.getName());
//18
final Declarator Declarator_19_Var
= (Declarator)ParameterDeclaration_16_Var
.getDeclarator();
Assert.assertNotNull(Declarator_19_Var
);
//19
final DirectDeclarator DirectDeclarator_20_Var
= (DirectDeclarator)Declarator_19_Var
.getDeclarator();
Assert.assertNotNull(DirectDeclarator_20_Var
);
Assert.assertEquals("argv", DirectDeclarator_20_Var
.getIdent());
//20
final Pointer Pointer_21_Var
= (Pointer)Declarator_19_Var
.getPointer();
Assert.assertNotNull(Pointer_21_Var
);
Assert.assertEquals("[*, *]", Pointer_21_Var
.getStar().toString());
//21
final FunctionDefinition FunctionDefinition_22_Var
= (FunctionDefinition)ExternalDeclaration_1_Var
.getFunctionDefinition();
Assert.assertNotNull(FunctionDefinition_22_Var
);
//22
final BodyStatement BodyStatement_23_Var
= (BodyStatement)FunctionDefinition_22_Var
.getBody();
Assert.assertNotNull(BodyStatement_23_Var
);
final EList<? extends EObject> BlockList_23_list = BodyStatement_23_Var
.getBlockList();
Assert.assertNotNull(BlockList_23_list);
Assert.assertEquals(1, BlockList_23_list.size());
//23
final BlockList BlockList_24_Var
= (BlockList)BlockList_23_list.get(0);
Assert.assertNotNull(BlockList_24_Var
);
final EList<? extends EObject> Statement_24_list = BlockList_24_Var
.getStatement();
Assert.assertNotNull(Statement_24_list);
Assert.assertEquals(2, Statement_24_list.size());
//24
final Statement Statement_25_Var
= (Statement)Statement_24_list.get(0);
Assert.assertNotNull(Statement_25_Var
);
//25
final ExpressionStatement ExpressionStatement_26_Var
= (ExpressionStatement)Statement_25_Var
.getStmt();
Assert.assertNotNull(ExpressionStatement_26_Var
);
//26
final PostfixExpression PostfixExpression_27_Var
= (PostfixExpression)ExpressionStatement_26_Var
.getExpression();
Assert.assertNotNull(PostfixExpression_27_Var
);
//27
final PrimaryExpression PrimaryExpression_28_Var
= (PrimaryExpression)PostfixExpression_27_Var
.getExpr();
Assert.assertNotNull(PrimaryExpression_28_Var
);
Assert.assertEquals("printf", PrimaryExpression_28_Var
.getIdent());
//28
final PostfixExpressionSuffixArgument PostfixExpressionSuffixArgument_29_Var
= (PostfixExpressionSuffixArgument)PostfixExpression_27_Var
.getSuffix();
Assert.assertNotNull(PostfixExpressionSuffixArgument_29_Var
);
//29
final ArgumentExpressionList ArgumentExpressionList_30_Var
= (ArgumentExpressionList)PostfixExpressionSuffixArgument_29_Var
.getArgumentExpressionList();
Assert.assertNotNull(ArgumentExpressionList_30_Var
);
final EList<? extends EObject> Expr_30_list = ArgumentExpressionList_30_Var
.getExpr();
Assert.assertNotNull(Expr_30_list);
Assert.assertEquals(2, Expr_30_list.size());
//30
final PrimaryExpression PrimaryExpression_31_Var
= (PrimaryExpression)Expr_30_list.get(0);
Assert.assertNotNull(PrimaryExpression_31_Var
);
Assert.assertEquals("[\"%s\\n\"]", PrimaryExpression_31_Var
.getString().toString());
//31
final PrimaryExpression PrimaryExpression_32_Var
= (PrimaryExpression)Expr_30_list.get(1);
Assert.assertNotNull(PrimaryExpression_32_Var
);
Assert.assertEquals("[\"Hello World!\"]", PrimaryExpression_32_Var
.getString().toString());
//32
final Statement Statement_33_Var
= (Statement)Statement_24_list.get(1);
Assert.assertNotNull(Statement_33_Var
);
//33
final JumpStatement JumpStatement_34_Var
= (JumpStatement)Statement_33_Var
.getStmt();
Assert.assertNotNull(JumpStatement_34_Var
);
//34
final PrimaryExpression PrimaryExpression_35_Var
= (PrimaryExpression)JumpStatement_34_Var
.getExpr();
Assert.assertNotNull(PrimaryExpression_35_Var
);
//35
final Constant2 Constant2_36_Var
= (Constant2)PrimaryExpression_35_Var
.getConst();
Assert.assertNotNull(Constant2_36_Var
);
Assert.assertEquals("0", Constant2_36_Var
.getDec());
Assert.assertEquals("return", JumpStatement_34_Var
.getReturn());
}
@Test
(timeout=1000
)
public void testGenerator() throws Exception {
// load the resource
ResourceSet set = this.resourceSetProvider.get();
URI uri = URI.createURI(
"res/Test0019_HelloWorld.c");
Resource resource = set.getResource(uri, true);
// validate the resource
List<Issue> list = this.validator.validate(resource,
CheckMode.ALL,CancelIndicator.NullImpl);
Assert.assertTrue(list.isEmpty());
// configure and start the generator
this.fileAccessSystem.setOutputPath("bin");
final Class<?> clazz = this.generator.getClass();
try {
final Method method = clazz.getMethod("setFileName",
String.class);
if (method != null) {
method.invoke(this.generator, "Test0019_HelloWorld.c");
}
} catch (NoSuchMethodException | SecurityException
| IllegalAccessException | IllegalArgumentException
| InvocationTargetException e) {
// do nothing
}
this.generator.doGenerate(resource, this.fileAccessSystem);
final String actual = this.getTextFromFile("bin/Test0019_HelloWorld.c");
final String expected = this.getTextFromFile(
"res/Test0019_HelloWorld.c"
);
Assert.assertEquals(preprocess(expected), preprocess(actual));
}
private String preprocess(String string) throws Exception {
string = preprocessForFile(string);
string = preprocessForPatterns(string);
return string;
}
private String preprocessForFile(String string) throws Exception {
final String content = this.getTextFromFile("res/Patterns.txt");
final String[] lines = content.split("\n");
if (lines == null) {
return string;
}
for (String line : lines) {
final String[] myLine = line.split("=");
if (myLine == null || myLine.length != 2) {
continue;
}
final String regex = myLine[0].replace("\"", "").replace("\\\\", "\\");
final String replace = myLine[1].replace("\"", "").replace("\\\\", "\\");
string = string.replaceAll(regex, replace);
}
return string;
}
private String preprocessForPatterns(String string) {
return string;
}
}
| [
"timeraider@gmx.at"
] | timeraider@gmx.at |
48eaa6bb9a7520b9aa97f30da8863241bde967af | dc42add86465329a18fc4eca8c480e9dd0797a7d | /numeros-romanos/src/RomanNumberGenerator.java | 6add9741d497c0771e15e700c556db4e6559ef88 | [] | no_license | fernando-lemes/dojo | 6ea230ca120f7856c1dd2d9a40275418288dc8b9 | cd1cbcd60832fe1b06475a28533fb908655c97c1 | refs/heads/master | 2021-01-21T04:40:42.544602 | 2016-06-16T18:56:59 | 2016-06-16T18:57:37 | 51,098,363 | 0 | 2 | null | 2016-06-16T18:02:58 | 2016-02-04T19:06:55 | Java | UTF-8 | Java | false | false | 2,105 | java | public class RomanNumberGenerator {
public String generateRomanNumber(int number){
String str = "";
switch (number) {
case 1:
str = "I";
break;
case 5:
str = "V";
break;
case 10:
str = "X";
break;
case 50:
str = "L";
break;
case 100:
str = "C";
break;
case 500:
str = "D";
break;
case 1000:
str = "M";
break;
}
return str;
}
public int generateAlgNumber(char romanNumber){
int str = 1;
switch (romanNumber) {
case 'I':
str = 1;
break;
case 'V':
str = 5;
break;
case 'X':
str = 10;
break;
case 'L':
str = 50;
break;
case 'C':
str = 100;
break;
case 'D':
str = 500;
break;
case 'M':
str = 1000;
break;
}
return str;
}
public String convertToRoman(int number, int position) {
int[] algNum = {1, 5, 10, 50, 100, 500, 1000};
String[] algRomNum = {"I", "V", "X", "L", "C", "D", "M"};
while(number != 0){
if(number % algNum[position] > 0){
number -= algNum[position];
String var = algRomNum[position] + convertToRoman(number - algNum[position],position );
}
}
return "";
}
/*public int generateAlgNumberFromString(String romanNumber){
int contx = 0; int contv =0;
for(int i =0;i < romanNumber.length(); i++){
char c = romanNumber.charAt(i);
}
return str;
}*/
}
| [
"fernando.lemes@hp.com"
] | fernando.lemes@hp.com |
73c4ff1962559f9c9b562fd18bceabe8cc9d7222 | 4ad2e9c3d7f98317ae12fec9cc210f46828e8380 | /MazeSolver.java | 05f91fe31f9524e0b70f64c16fb702736e18c486 | [] | no_license | gsmith98/FlipboardChallenge | be5cfa937b7299b132e3867e2892850c80b6355e | c42ca3771560d937a29dfec8296705eeea47ab80 | refs/heads/master | 2021-04-15T10:48:08.310974 | 2018-03-27T02:17:14 | 2018-03-27T02:17:14 | 126,915,740 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,869 | java | import java.io.*;
import java.net.*;
import java.util.HashSet;
import java.util.Stack;
import javax.json.*;
public class MazeSolver {
public static void main(String[] args) {
URL mazebase = createBaseURL();
String seed = getStartRedirectedURLSeed(mazebase);
String traveledPath = walk(mazebase, seed);
if (checkPath(mazebase, seed, traveledPath)) {
System.out.println("Found the exit for seed " + seed + "! The path traversed was:");
} else {
System.out.println("Lost forever in the maze with seed " + seed + " :( The path traversed was:");
}
System.out.println(traveledPath);
}
/**
* This is just an initializer function that will call a URL constructor for
* the base Flipboard challenge URL and handle catch exceptions. It mostly
* exists to keep ugly try catch blocks out of main for something so small.
*
* @return a URL object for the main Flipboard challenge page to be used for relative URL's
*/
public static URL createBaseURL() {
try {
return new URL("https://challenge.flipboard.com/");
} catch (MalformedURLException mue) {
mue.printStackTrace();
System.exit(0);
return null;
}
}
/**
* Makes the start request for a random maze and returns the seed string for the given maze
* (We can then start this maze by using grabJSONFromRelativeURL(mazebase, seed, <coords 0,0>)
* since all mazes start at coordinates x = 0, y = 0
*
* @param mazebase the base URL object for Flipboard's challenge
* @return the seed string for a random maze chosen by the 'start' URL
*/
public static String getStartRedirectedURLSeed(URL mazebase) {
try {
URLConnection con = new URL(mazebase, "start").openConnection();
con.connect();
con.getInputStream(); // this is the part that redirects the URL
String urlstring = con.getURL().toString();
return urlstring.substring(urlstring.indexOf("s=") + 2, urlstring.indexOf('&'));
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(0);
return null;
}
}
/**
* Given a base URL object for the Flipboard challenge site and the
* parameters to be applied to it for the specific request, this function
* will return to you a JsonObject of the Flipboard server's response
*
* @param mazebase the base URL object for Flipboard's challenge
* @param seed the seed for this maze
* @param coords a JsonObject containing the x and y coordinates to visit
* @return a JsonObject for the response from the maze server
*/
public static JsonObject grabJSONFromRelativeURL(URL mazebase, String seed, JsonObject coords) {
try {
String rel = "step?s=" + seed + "&x=" + coords.getInt("x") + "&y=" + coords.getInt("y");
URL fullurl = new URL(mazebase, rel);
JsonReader jsonreader = Json.createReader(fullurl.openStream());
return jsonreader.readObject();
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(0);
return null;
}
}
/**
* The central function that handles the logic of traversing the maze and keeping track.
* The guarantee that no path loops back on itself simplifies the maze to a tree, and
* the walking thereof would just be a Depth First Search save for the backtracking.
* The implementation is exactly like a DFS, but with an added auxiliary stack to keep
* track of our path so we can report the backtracking - without rerequesting steps.
* (The DFS part itself still 'jumps' after reaching a dead end.)
*
* @param mazebase the base URL object for Flipboard's challenge
* @param seed the seed for this maze
* @return the string of letters representing the path traversed (including backtracks)
*/
private static String walk(URL mazebase, String seed) {
//We maintain this HashSet just to avoid revisiting coordinates. The JsonObjects it stores are 'coords'.
//'Maintain' may be too strong a word, since add and contains are all we use and they are both O(1)
HashSet<JsonObject> visitedCoords = new HashSet<JsonObject>();
//This is the Stack that will act as the core data structure for the DFS through the maze.
//The JsonObjects it stores are 'coords'
Stack<JsonObject> dfsStack = new Stack<JsonObject>();
//We maintain this Stack to handle backtracking, the quirk that separates this from a regular DFS.
//As we travel, steps we take are pushed, and as we backtrack they are popped. An interesting result of
//this is that this stack will be a representation of the optimal path through the maze when we're done.
//This Stack holds not 'coords', but the JsonObjects that come from the maze server's responses.
Stack<JsonObject> truePathStack = new Stack<JsonObject>();
String traveledPath = ""; //string of letters representing our traversal
boolean done = false;
dfsStack.push(Json.createObjectBuilder().add("x", 0).add("y", 0).build()); //starting coord 0,0 on stack
while (!done) {
JsonObject coords = dfsStack.pop();
JsonObject current = grabJSONFromRelativeURL(mazebase, seed, coords);
visitedCoords.add(coords);
traveledPath += current.getString("letter");
int pushed = 0;
for (JsonObject adjxy : current.getJsonArray("adjacent").getValuesAs(JsonObject.class)) {
if (!visitedCoords.contains(adjxy)) {
dfsStack.push(adjxy);
pushed++;
}
} //^this for loop pushes each adjacent coord JsonObj that we haven't visited to the dfsStack
if (pushed == 0) { //if there weren't any viable adjacencies, we have to backtrack
traveledPath = backtrack(truePathStack, traveledPath, dfsStack.peek());
} else {
truePathStack.add(current); //otherwise, add this step to the current true path
}
done = current.getBoolean("end");
}
return traveledPath;
}
/**
* This is a helper function for walk that encapsulates the approach to backtracking.
* The function uses the stack of our effective path thus far along with the coordinates
* that the DFS algorithm would 'jump' to and updates the traversal report to include
* walking back to the branch that DFS will pick up from.
*
* @param truePathStack the effective path stack of 'response' JsonObjects from the maze server
* @param traveledPath the string of letters representing the path traversed thus far
* @param coordToReach the 'coord' JsonObject the brach next to which we want to backtrack to
* @return an updated traveledPath string of letters representing the path traversed thus far
*/
public static String backtrack(Stack<JsonObject> truePathStack, String traveledPath, JsonObject coordToReach) {
boolean done = false;
while (!done) {
JsonObject current = truePathStack.pop(); //go back one step
traveledPath += current.getString("letter"); //indicate the retracing of this step
//we go until we get back to the point adjacent to where the DFS wants to pick up
done = current.getJsonArray("adjacent").getValuesAs(JsonObject.class).contains(coordToReach);
if (done) {
//we just popped off the last step in the truepathstack that is still viable. Need to put it back.
truePathStack.push(current);
}
}
return traveledPath;
}
/**
* A function to test a solution to a maze using the 'check' URL as described on the challenge page
*
* @param mazebase the base URL object for Flipboard's challenge
* @param seed the seed for this maze
* @param traveledPath the path that 'walk' reported it used to find the end
* @return true if the response indicates success, false otherwise
*/
public static boolean checkPath(URL mazebase, String seed, String traveledPath) {
try {
String rel = "check?s=" + seed + "&guess=" + traveledPath;
URL fullurl = new URL(mazebase, rel);
JsonReader jsonreader = Json.createReader(fullurl.openStream());
return jsonreader.readObject().getBoolean("success");
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(0);
return false;
}
}
}
| [
"smitgw11@gmail.com"
] | smitgw11@gmail.com |
2ea2e7a8f7200b4512fa7662dc2ff879b04d5ed7 | 342e571310f8019a4fa8117b08897b9fb5736030 | /src/main/java/com/firedata/qtacker/repository/MakerRepository.java | fd9d663e7d3998cb1ac141ef39bd3e9029d8681b | [] | no_license | Marko-Mijovic/qtacker-application | 383ae9e2bd6c6d92d2555c8b79bdfca9d801851b | 3f97152f208cb3347142b2bbc207c498469b6c6c | refs/heads/master | 2022-04-14T04:03:28.834874 | 2020-04-15T00:32:04 | 2020-04-15T00:32:04 | 255,757,303 | 0 | 0 | null | 2020-04-15T00:32:42 | 2020-04-15T00:04:04 | Java | UTF-8 | Java | false | false | 355 | java | package com.firedata.qtacker.repository;
import com.firedata.qtacker.domain.Maker;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Maker entity.
*/
@SuppressWarnings("unused")
@Repository
public interface MakerRepository extends JpaRepository<Maker, Long> {
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
d13e7e6dc8c745d43098c2590e977cd939f42bb9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/18/18_0f4fe1c7c6f5c3733924d8f080c2451e41cc974c/ComponentRequestRouterFilter/18_0f4fe1c7c6f5c3733924d8f080c2451e41cc974c_ComponentRequestRouterFilter_t.java | 12340ad39792b16c102f66040a0a2bb9249635ab | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,576 | java | /**
* Copyright (C) 2000 - 2011 Silverpeas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* As a special exception to the terms and conditions of version 3.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* Open Source Software ("FLOSS") applications as described in Silverpeas's
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* "http://repository.silverpeas.com/legal/licensing"
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.silverpeas.whitePages.filters;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.stratelia.silverpeas.peasCore.URLManager;
/**
* Le filtre LoginFilter a pour effet de contrôler que l'utilisateur courant n'a pas une fiche à
* remplir dans une instance de whitePages. Si c'est le cas, 2 attributs sont mis en sessions : -
* RedirectToComponentId : componentId de l'instance pour que le mecanisme de redirection le renvoie
* sur le composant - - forceCardCreation : componentId de l'instance Le filtre RequestRouterFilter
* verifie la présence
* @author Ludovic Bertin
*/
public class ComponentRequestRouterFilter implements Filter {
/**
* Configuration du filtre, permettant de récupérer les paramètres.
*/
FilterConfig config = null;
/*
* (non-Javadoc)
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
* javax.servlet.FilterChain)
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest hsRequest = (HttpServletRequest) request;
String sURI = hsRequest.getRequestURI();
if (sURI.startsWith(URLManager.getApplicationURL() + "/R")) {
/*
* Retrieve main session controller
*/
HttpSession session = hsRequest.getSession(false);
if(session == null){
chain.doFilter(request, response);
return;
}
String componentId = (String) session
.getAttribute(LoginFilter.ATTRIBUTE_FORCE_CARD_CREATION);
// String sServletPath = hsRequest.getServletPath();
// String sPathInfo = hsRequest.getPathInfo();
String sRequestURL = hsRequest.getRequestURL().toString();
/*
* If a user must be redirected to a card creation, just do it.
*/
if ((sRequestURL.indexOf("RpdcClassify") == -1)
&& (sRequestURL.indexOf("RwhitePages") == -1)
&& (sRequestURL.indexOf("Rclipboard") == -1)
&& (sRequestURL.indexOf("importCalendar") == -1)
&& (componentId != null)) {
StringBuffer redirectURL = new StringBuffer();
redirectURL.append(URLManager.getURL(null, componentId));
redirectURL.append("ForceCardCreation");
RequestDispatcher dispatcher = request.getRequestDispatcher(redirectURL
.toString());
dispatcher.forward(request, response);
} else {
chain.doFilter(request, response);
}
} else {
chain.doFilter(request, response);
}
}
/*
* (non-Javadoc)
* @see javax.servlet.Filter#getFilterConfig()
*/
public FilterConfig getFilterConfig() {
return config;
}
/*
* (non-Javadoc)
* @see javax.servlet.Filter#setFilterConfig(javax.servlet.FilterConfig)
*/
public void setFilterConfig(FilterConfig arg0) {
// this.config = config;
}
public void init(FilterConfig arg0) {
// this.config = config;
}
public void destroy() {
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3f89e46fdd29a16fcfca4f91ffeb7dd8bef0bd8c | 12d052d264ac529146130dd1e937c6615c80a297 | /GetFileSize.java | 74e9acdef40de91c0049ca8a6b827c7e9d4cc595 | [] | no_license | clvnly/CST-3613 | 6a0c88ef7b5aeb10ab8d62fe4552d806de2e7c69 | a37864ab4bb8c1685753ced6654adbf0d1e3d11b | refs/heads/master | 2021-01-02T09:39:46.246826 | 2017-08-03T19:57:06 | 2017-08-03T19:57:06 | 99,269,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,047 | java | package project4;
import java.io.File;
import java.util.Scanner;
import java.util.LinkedList;
public class GetFileSize {
public static void main(String[] args) {
// Prompt the user to enter a directory or a file
System.out.print("Enter a directory or a file: ");
Scanner input = new Scanner(System.in);
String directory = input.nextLine();
// Display the size
System.out.println(getSize(new File(directory)) + " bytes");
}
public static long getSize(File file) {
long size = 0; // Store the total size of all files
LinkedList<File> queue = new LinkedList<File>();
queue.offer(file); // Same as queue.add(file)
while (queue.size() > 0) {
File t = queue.remove(); // Same as queue.removeFirst()
if (t.isDirectory()) {
File[] files = t.listFiles(); // All files and subdirectories
for (File f: files) {
queue.offer(f); // Same as queue.add(f)
}
}
else {
size += t.length();
}
}
return size;
}
}
| [
"clvnly@gmail.com"
] | clvnly@gmail.com |
610d1bac06fc47a9e32d00a6a1a81a6b9800c6ac | 039381b19e1a8d1751335bfb04b2eb0abc633807 | /src/main/java/com/jt/sys/entity/SysMenu.java | f4c895e3578532a4ff60dc010abf4720ce5f772d | [] | no_license | ecniee/CGB-JT-SYS-V1.01 | 5cb7b64f8008b2999d3dcc756289dd4153d57718 | 061f11a20632515cf5f438b200a0dc1941d16d52 | refs/heads/master | 2020-03-27T21:25:22.427147 | 2018-09-03T07:46:05 | 2018-09-03T07:46:05 | 147,142,434 | 0 | 1 | null | 2018-09-03T07:46:06 | 2018-09-03T02:38:54 | JavaScript | UTF-8 | Java | false | false | 1,970 | java | package com.jt.sys.entity;
import java.io.Serializable;
import java.util.Date;
public class SysMenu implements Serializable{
private static final long serialVersionUID = -5259265803332215029L;
private Integer id;
private String name;
private String url;
private Integer type;
private Integer sort;
private String note;
private Integer parentId;
private String permission;
private Date createdTime;
private Date modifiedTime;
private String createdUser;
private String modifiedUser;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public String getModifiedUser() {
return modifiedUser;
}
public void setModifiedUser(String modifiedUser) {
this.modifiedUser = modifiedUser;
}
}
| [
"ecniee531@users.noreply.github.com"
] | ecniee531@users.noreply.github.com |
92b5ddaa914134ab85c860469f027e6df3a5dabc | bb94a469e4f3cef6bfd285619f4e7fad6846a36f | /SimpleFactoryPattern/SimpleFactoryPatternSrc/test/java/SimpleFactoryTest.java | ce4c696bb8867f222f671fb5631ae531a14ae980 | [] | no_license | EchoChe/DesignPatterns | e13625b416137968250532d81f3d3eb4d46c1c43 | ecd68f5ff926236aa235539ba908e6d1ff218ee4 | refs/heads/master | 2020-04-06T07:01:52.593907 | 2016-09-09T09:26:27 | 2016-09-09T09:26:27 | 65,466,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | package test.java;
import static org.junit.Assert.*;
import org.junit.Test;
import junit.framework.Assert;
import main.java.Factory;
import main.java.Product;
public class SimpleFactoryTest {
@Test
public void test() {
Factory factory = new Factory();
Product paProduct = factory.createProduct("A");
Product pbProduct = factory.createProduct("B");
Assert.assertEquals("ConcreteProductA class \n", paProduct.use());
Assert.assertEquals("ConcreteProductB class \n", pbProduct.use());
}
}
| [
"1522815630@qq.com"
] | 1522815630@qq.com |
ff4136bb01e72a6ac0486858e62cee600d3e52da | 7e45191473a867a41152d13148904549a6a64210 | /toDoListRestful_1/src/main/java/org/dit/dss/toDoListRestful/util/ClientPK.java | b364134d8f28ce8bf9d334cb00e475965ef75f7e | [] | no_license | IvanDoe/DSS | 447abb09b59d6046f55f28cae5df517d7bd3d4be | 27fe2469ef99df5bf43d8d661fc79bf586ce2ddb | refs/heads/master | 2016-09-05T19:46:26.710417 | 2014-05-09T09:49:08 | 2014-05-09T09:49:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package org.dit.dss.toDoListRestful.util;
public class ClientPK {
private String pk;
public ClientPK(String pk) {
this.pk = pk;
}
public String getpk() {
return pk;
}
public void setpk(String pk) {
this.pk = pk;
}
}
| [
"ivanDoe@ivanDoe"
] | ivanDoe@ivanDoe |
435858a3e6e17d7dd9179936624e6a2cc1bb4eae | e04237dfb76540b07757c16ff15a66ee606971f5 | /src/main/java/org/csu/coderlee/handler/Handler.java | 5f71af619d167943e3192f0c7153a17528123209 | [] | no_license | csucoderlee/library-management-system | a26964a161cf92ed4365bf21cab385690462dc0b | 1d43e2c2023f15451ccf790d633be973269562de | refs/heads/master | 2021-12-23T22:09:13.625909 | 2021-12-15T11:16:26 | 2021-12-15T11:16:26 | 129,914,015 | 1 | 0 | null | 2021-12-15T11:16:27 | 2018-04-17T14:05:51 | Groovy | UTF-8 | Java | false | false | 1,389 | java | package org.csu.coderlee.handler;
import org.csu.coderlee.schedule.ISchedule;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author by bixi.lx
* @created on 2018 05 24 22:15
*/
@Component
public class Handler {
private static final int HANDLER_THREAD_NUM = 8;
private ExecutorService executorService;
@PostConstruct
public void startUp() {
executorService = Executors.newFixedThreadPool(HANDLER_THREAD_NUM);
}
@PreDestroy
public void shutdown() {
if (executorService != null) {
executorService.shutdownNow();
}
}
public void execute(final ISchedule scheduleCallBack) {
List<Callable<Integer>> tasks = new ArrayList<>();
Callable<Integer> callable = new Callable<Integer>() {
@Override
public Integer call() throws Exception {
scheduleCallBack.callBack();
return 0;
}
};
tasks.add(callable);
try {
executorService.invokeAll(tasks);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
| [
"csucoderlee@foxmail.com"
] | csucoderlee@foxmail.com |
d595c5821167b6b48854308aef89fcf6d436ede2 | 2c319d505e8f6a21708be831e9b5426aaa86d61e | /web/security/src/main/java/leap/web/security/cookie/SecurityCookieBean.java | 063f3170ca8dca1d712579dc5d77e7a16ab3063c | [
"Apache-2.0"
] | permissive | leapframework/framework | ed0584a1468288b3a6af83c1923fad2fd228a952 | 0703acbc0e246519ee50aa9957f68d931fab10c5 | refs/heads/dev | 2023-08-17T02:14:02.236354 | 2023-08-01T09:39:07 | 2023-08-01T09:39:07 | 48,562,236 | 47 | 23 | Apache-2.0 | 2022-12-14T20:36:57 | 2015-12-25T01:54:52 | Java | UTF-8 | Java | false | false | 1,400 | java | /*
* Copyright 2015 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 leap.web.security.cookie;
import leap.web.config.WebConfig;
import leap.web.cookie.CookieBean;
import leap.web.security.SecurityConfig;
public class SecurityCookieBean extends CookieBean {
protected SecurityConfig securityConfig;
public SecurityCookieBean(WebConfig webConfig, SecurityConfig securityConfg, String cookieName) {
super(webConfig, cookieName);
this.securityConfig = securityConfg;
}
public String getCookieDomain() {
String domain = securityConfig.getCookieDomain();
if(null == domain) {
return super.getCookieDomain();
}else{
return domain;
}
}
public boolean isCookieCrossContext() {
return securityConfig.isCrossContext();
}
} | [
"live.evan@gmail.com"
] | live.evan@gmail.com |
637fb1c21b68f066b79be704487fa9ba407a9a72 | 5c5a1793a01ea39316bb2cc8dc8fa713ffcff035 | /src/com/insthub/ecmobile/protocol/addressupdateRequest.java | ed7234c54ef8a39a0b4900557a34a14dc90500a0 | [] | no_license | yuyifly82/JGMALL | 51ba56330cba00b8424e07e16ed987de1b6d1c5a | 87cbc190766431dbb5339f02031df45bf17e6e40 | refs/heads/master | 2021-01-01T03:49:33.083934 | 2016-05-03T04:54:37 | 2016-05-03T04:54:37 | 56,892,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,706 | java |
package com.insthub.ecmobile.protocol;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;
@Table(name = "addressupdateRequest")
public class addressupdateRequest extends Model
{
@Column(name = "address")
public ADDRESS address;
@Column(name = "address_id")
public String address_id;
@Column(name = "session")
public SESSION session;
public void fromJson(JSONObject jsonObject) throws JSONException
{
if(null == jsonObject){
return ;
}
JSONArray subItemArray;
ADDRESS address = new ADDRESS();
address.fromJson(jsonObject.optJSONObject("address"));
this.address = address;
this.address_id = jsonObject.optString("address_id");
SESSION session = new SESSION();
session.fromJson(jsonObject.optJSONObject("session"));
this.session = session;
return ;
}
public JSONObject toJson() throws JSONException
{
JSONObject localItemObject = new JSONObject();
JSONArray itemJSONArray = new JSONArray();
if(null != address)
{
localItemObject.put("address", address.toJson());
}
localItemObject.put("address_id", address_id);
if(null != session)
{
localItemObject.put("session", session.toJson());
}
return localItemObject;
}
}
| [
"yuyifly82@outlook.com"
] | yuyifly82@outlook.com |
deec66ea09bace0d98b801335e31d1b474eaed6e | 16e0dfe53b56cfe439b25a25db83d217c7e8ebfa | /ExampleRetro/app/src/main/java/com/example/exampleretro/MyAdapter.java | 137d00cd20548b5f7ec83a179e4b0e2fa5c6e4fb | [] | no_license | AP-Skill-Development-Corporation/AAD-STP-BATCH-19 | 322f68ed9e61fa09abe4f15a2982d561ece0b077 | a3420a940662db9a825c6c010a0f3194ced61649 | refs/heads/master | 2022-12-23T02:36:54.129779 | 2020-10-03T15:29:57 | 2020-10-03T15:29:57 | 295,097,937 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,446 | java | package com.example.exampleretro;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.HoldView> {
Context ct;
ArrayList<MyModel> list;
public MyAdapter(Context ct, ArrayList<MyModel> list) {
this.ct = ct;
this.list = list;
}
@NonNull
@Override
public HoldView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new HoldView(LayoutInflater.from(ct).inflate(R.layout.row,
parent,false));
}
@Override
public void onBindViewHolder(@NonNull HoldView holder, int position) {
Picasso.with(ct).load(list.get(position).getLink()).into(holder.iv);
holder.tv.setText(list.get(position).getTitle());
}
@Override
public int getItemCount() {
return list.size();
}
public class HoldView extends RecyclerView.ViewHolder {
ImageView iv;
TextView tv;
public HoldView(@NonNull View itemView) {
super(itemView);
iv = itemView.findViewById(R.id.iv);
tv = itemView.findViewById(R.id.tv);
}
}
}
| [
"chaitanyakarri963@gmail.com"
] | chaitanyakarri963@gmail.com |
bd2f104143e9fb4381317d84845ce1cd665b3b07 | bda0e7e6f380acc040df92eaa8254b9f59aead53 | /app/src/main/java/com/example/linhdq/test/documents/creation/ProgressDialogFragment.java | 4e4393e62bff2338ce5dff106de7a1d3a5f16ebd | [] | no_license | linhdq/Test | a5b28380f9881f57f83fcba55e920dac16fd649b | 42860513caf6cafea86028c36dabdf3cb947d09f | refs/heads/master | 2021-01-19T19:14:38.912719 | 2017-04-16T11:18:54 | 2017-04-16T11:18:54 | 88,408,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,567 | java | package com.example.linhdq.test.documents.creation;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.linhdq.test.R;
public class ProgressDialogFragment extends DialogFragment {
private static final String MESSAGE_ID = "message_id";
private static final String TITLE_ID = "title_id";
public static ProgressDialogFragment newInstance(int titleId, int messageId) {
ProgressDialogFragment progressDialogFragment = new ProgressDialogFragment();
Bundle args = new Bundle();
args.putInt(TITLE_ID, titleId);
args.putInt(MESSAGE_ID, messageId);
progressDialogFragment.setArguments(args);
return progressDialogFragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NO_TITLE,getTheme());
setRetainInstance(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_progress, container, false);
Bundle arguments = getArguments();
if (arguments != null) {
int titleId = arguments.getInt(TITLE_ID);
int messageId = arguments.getInt(MESSAGE_ID);
//TextView title = (TextView) view.findViewById(R.id.title);
//title.setText(titleId);
TextView message = (TextView) view.findViewById(R.id.message);
message.setText(messageId);
}
return view;
}
}
| [
"linhdq@LinhDQs-MacBook-Pro.local"
] | linhdq@LinhDQs-MacBook-Pro.local |
e170b923bed9c3e9dfe1cbea14ea52545852741e | a689065b0ee1e8ea9f1afcbeb3c0309cfbaea23c | /app/src/main/java/bucur/ro/sensors/listeners/MagnetometerListener.java | 0f6d79b74a533eb100b7698f3d76c3b0ea1c4026 | [
"Apache-2.0"
] | permissive | florinBucur/Dizertatie | 17b2af3cd7938ff525fad22022a6da04d2b4a9fe | 56fceff0ecae2126f02bbf719014944731f5197a | refs/heads/master | 2021-01-23T06:39:51.000891 | 2017-03-27T22:01:13 | 2017-03-27T22:01:13 | 86,387,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,288 | java | package bucur.ro.sensors.listeners;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
/**
* Created by bucur on 3/25/2017.
*/
public class MagnetometerListener implements SensorEventListener {
public static float magnetic[];
private SensorManager sensorManager;
private Sensor magnetometer;
public MagnetometerListener(SensorManager sensorManager) {
magnetic = new float[4];
this.sensorManager = sensorManager;
this.magnetometer = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
}
@Override
public void onSensorChanged(SensorEvent event) {
magnetic[0] = event.values[0];
magnetic[1] = event.values[1];
magnetic[2] = event.values[2];
}
@Override
public void onAccuracyChanged(Sensor sensor, int i) {
}
public void startMagnetometer(){
System.out.println("Magnetometru initializat");
sensorManager.registerListener(this,magnetometer, SensorManager.SENSOR_DELAY_GAME);
}
public void stopMagnetometer(){
sensorManager.unregisterListener(this, magnetometer);
}
public float[] getMagnetometer(){
return magnetic;
}
}
| [
"florin.bucur92@gmail.com"
] | florin.bucur92@gmail.com |
919c163c5abf461a2c398a3fe6357f6500f2252b | 0db4f727e57ee833e8f80d7443de4f0dd244666b | /src/main/java/com/debuggerme/filerandomizer/FileRandomizerApp.java | b80188f7ec7f0b84041894fbd0f27390bd46103a | [] | no_license | JamithNimantha/File-Randomizer | 791e68630515c53b0baab7630b5ef261a3e854b1 | 0ef1908c60974a045cf13e99b480447f73916d34 | refs/heads/main | 2023-01-01T20:10:28.385902 | 2020-10-25T11:53:16 | 2020-10-25T11:53:16 | 306,938,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | package com.debuggerme.filerandomizer;
import com.sun.javafx.application.LauncherImpl;
import javafx.application.Application;
import javafx.application.Preloader;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
public class FileRandomizerApp extends Application {
public static void main(String[] args) {
LauncherImpl.launchApplication(FileRandomizerApp.class, AppPreLoader.class,args);
}
public void start(Stage primaryStage) throws Exception {
notifyPreloader(new Preloader.StateChangeNotification(Preloader.StateChangeNotification.Type.BEFORE_START));
Parent parent = FXMLLoader.load(this.getClass().getResource("/com/debuggerme/filerandomizer/view/Main.fxml"));
primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/com/debuggerme/filerandomizer/assets/logo.png")));
Scene temp = new Scene(parent);
primaryStage.setScene(temp);
primaryStage.centerOnScreen();
primaryStage.setTitle("File Randomizer Tool v 1.0 By DebuggerMe");
primaryStage.setResizable(false);
primaryStage.show();
}
}
| [
"jamithnimantha@gmail.com"
] | jamithnimantha@gmail.com |
8efaa759abb106770f263ab545270fe793b00d8f | 6dbddaf749cc71bb05b2b6a5abd92fd0c5e74096 | /gp-pay-service/src/main/java/com/mph/coreapi/gp/pay/entity/GroundPromotionOrderDataEntity.java | 74478a068d5b3ff5ec0a440af84ff7ca1e3e165f | [] | no_license | popshao/gp-pay-service | 836ec3246705e5cb61a257f498d20cf7ef337243 | 597a5798c2ab752ac114bcb7ac490bd5e11ebb7f | refs/heads/master | 2022-06-22T01:23:30.136460 | 2019-12-25T03:13:04 | 2019-12-25T03:13:04 | 230,033,856 | 0 | 0 | null | 2022-06-17T02:48:33 | 2019-12-25T03:13:57 | Java | UTF-8 | Java | false | false | 2,055 | java | package com.mph.coreapi.gp.pay.entity;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @ClassName: GroundPromotionOrderDataEntity
* @Description: 地推月度排行数据结果
* @Author yuting.li
* @Version 1.0
* @Date 2018-05-31 16:19
*/
public class GroundPromotionOrderDataEntity implements Serializable {
/**
* 地推人员的id
*/
private Integer userId;
/**
* 收益类型: 1 会员推广 2 专区商品 3 菲加云 4 注册拉新
*/
private Integer type;
/**
* 地推人员的所属省份id
*/
private Integer userProvinceId;
/**
* 统计成果的月份:201805
*/
private String monthDisplay;
/**
* 完成金额
*/
private BigDecimal amount;
/**
* 完成数量
*/
private BigDecimal quatity;
/**
* 当月排名
*/
private Integer orderInProvince;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId=userId;
}
public Integer getUserProvinceId() {
return userProvinceId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type=type;
}
public void setUserProvinceId(Integer userProvinceId) {
this.userProvinceId=userProvinceId;
}
public String getMonthDisplay() {
return monthDisplay;
}
public void setMonthDisplay(String monthDisplay) {
this.monthDisplay=monthDisplay;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount=amount;
}
public BigDecimal getQuatity() {
return quatity;
}
public void setQuatity(BigDecimal quatity) {
this.quatity=quatity;
}
public Integer getOrderInProvince() {
return orderInProvince;
}
public void setOrderInProvince(Integer orderInProvince) {
this.orderInProvince=orderInProvince;
}
}
| [
"369672922@qq.com"
] | 369672922@qq.com |
b07ec75a21dcd37803cc984b844a9714167de775 | 990acb7cd30f2fc96cf6d47ac3bcc377e83ab12f | /ProyectoInterfazGrafica/src/app/client/components/amigos/AmigosTemplate.java | c3710d335b5022d920f0b379c50bd43245d11b57 | [] | no_license | ronpp/ProyectoFrontendJava | 9ca0cdf086003fa0800d450e39bae72647f86e87 | 9e0804617953cdbd423753d6a895606cf59b7964 | refs/heads/master | 2023-03-16T16:56:41.989963 | 2020-09-30T15:30:50 | 2020-09-30T15:30:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,948 | java | package app.client.components.amigos;
import app.services.graphicServices.GraficosAvanzadosService;
import app.services.graphicServices.ObjGraficosService;
import app.services.graphicServices.RecursosService;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
public class AmigosTemplate extends JPanel {
private static final long serialVersionUID = 1L;
// Declaración servicios y objetos
private AmigosComponent amigosComponent;
private ObjGraficosService sObjGraficos;
private GraficosAvanzadosService sGraficosAvanzados;
private RecursosService sRecursos;
// Declaración objetos gráficos
private JPanel pOpciones, pDatos;
private JButton bMostrar, bInsertar, bFiltrar, bModificar, bEliminar;
private JTextField tConsulta;
private JLabel lTitulo, lInstrucciones, lEslogan;
private JLabel lId, lIdValor, lNombre, lEdad, lOficio, lTelefono, lEmail;
private JTextField tNombre, tEdad, tOficio, tTelefono, tEmail;
// Declaración objetos decoradores
private Color colorGris;
// Declaración objetos para JTable
private JScrollPane pTabla;
private JPanel pCorner;
private JTable tabla;
private JTableHeader header;
private DefaultTableModel modelo;
private String[] cabecera = { "id", "Nombre", "Teléfono", "Email" };
public AmigosTemplate(AmigosComponent amigosComponent) {
this.amigosComponent = amigosComponent;
this.sObjGraficos = ObjGraficosService.getService();
this.sRecursos = RecursosService.getService();
this.sGraficosAvanzados = GraficosAvanzadosService.getService();
this.colorGris = new Color(235, 235, 235);
this.crearJPanels();
this.crearJTable();
this.crearContenidoPOpciones();
this.crearContenidoPDatos();
this.setSize(850, 600);
this.setBackground(sRecursos.getColorGrisClaro());
this.setLayout(null);
this.setVisible(true);
}
public void crearJPanels() {
pOpciones = sObjGraficos.construirJPanel(10, 10, 580, 200, Color.WHITE, null);
this.add(pOpciones);
pDatos = sObjGraficos.construirJPanel(600, 10, 240, 580, Color.WHITE, null);
this.add(pDatos);
}
public void crearJTable() {
modelo = new DefaultTableModel();
modelo.setColumnIdentifiers(cabecera);
tabla = new JTable();
tabla.setModel(modelo);
tabla.addMouseListener(amigosComponent);
tabla.setRowHeight(40);
tabla.setShowHorizontalLines(false);
tabla.setShowVerticalLines(false);
header = tabla.getTableHeader();
header.setPreferredSize(new Dimension(580, 30));
pTabla = sObjGraficos.construirPanelBarra(
tabla,
10, 220, 580, 370,
Color.WHITE,
null
);
header.setDefaultRenderer(
sGraficosAvanzados.devolverTablaPersonalizada(
sRecursos.getColorPrincipal(),
null, null,
Color.WHITE,
sRecursos.getFontLigera()
)
);
tabla.setDefaultRenderer(
Object.class,
sGraficosAvanzados.devolverTablaPersonalizada(
Color.WHITE,
sRecursos.getColorGrisClaro(),
sRecursos.getColorPrincipalOscuro(),
sRecursos.getColorGrisOscuro(),
sRecursos.getFontLigera()
)
);
pTabla.getVerticalScrollBar().setUI(
sGraficosAvanzados.devolverScrollPersonalizado(
7, 10,
Color.WHITE,
Color.GRAY,
sRecursos.getColorGrisOscuro()
)
);
pCorner = new JPanel();
pCorner.setBackground(sRecursos.getColorPrincipal());
pTabla.setCorner(JScrollPane.UPPER_RIGHT_CORNER, pCorner);
this.add(pTabla);
}
public void crearContenidoPOpciones() {
// LABEL TITULO--------------------------------------------------------------------
lTitulo = sObjGraficos.construirJLabel(
"Edición de Contactos",
20, 10, 200, 30,
null, null,
sRecursos.getFontTitulo(),
null,
sRecursos.getColorGrisOscuro(),
null,
"c"
);
pOpciones.add(lTitulo);
// TEXTFIELD CONSULTA--------------------------------------------------------------------
tConsulta = sObjGraficos.construirJTextField(
"Filtrar...",
30, 60, 380, 40,
sRecursos.getFontMediana(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tConsulta.addFocusListener(amigosComponent);
pOpciones.add(tConsulta);
// BOTÓN FILTRAR--------------------------------------------------------------------
bFiltrar = sObjGraficos.construirJButton(
"Filtrar",
430, 65, 120, 35,
sRecursos.getCMano(),
null,
sRecursos.getFontMediana(),
sRecursos.getColorPrincipal(),
Color.WHITE,
null,
"c",
true
);
bFiltrar.addMouseListener(amigosComponent);
bFiltrar.addActionListener(amigosComponent);
pOpciones.add(bFiltrar);
// BOTÓN MOSTRAR--------------------------------------------------------------------
bMostrar = sObjGraficos.construirJButton(
"Mostrar",
20, 145, 120, 35,
sRecursos.getCMano(),
null,
sRecursos.getFontMediana(),
sRecursos.getColorPrincipal(),
Color.WHITE,
null,
"c",
true
);
bMostrar.addMouseListener(amigosComponent);
bMostrar.addActionListener(amigosComponent);
pOpciones.add(bMostrar);
// BOTÓN INSERTAR--------------------------------------------------------------------
bInsertar = sObjGraficos.construirJButton(
"Insertar",
160, 145, 120, 35,
sRecursos.getCMano(),
null,
sRecursos.getFontMediana(),
sRecursos.getColorPrincipal(),
Color.WHITE,
null,
"c",
true
);
bInsertar.addMouseListener(amigosComponent);
bInsertar.addActionListener(amigosComponent);
pOpciones.add(bInsertar);
// BOTÓN MODIFICAR--------------------------------------------------------------------
bModificar = sObjGraficos.construirJButton(
"Modificar",
300, 145, 120, 35,
sRecursos.getCMano(),
null,
sRecursos.getFontMediana(),
sRecursos.getColorPrincipal(),
Color.WHITE,
null,
"c",
true
);
bModificar.addMouseListener(amigosComponent);
bModificar.addActionListener(amigosComponent);
pOpciones.add(bModificar);
// BOTÓN ELIMINAR--------------------------------------------------------------------
bEliminar = sObjGraficos.construirJButton(
"Eliminar",
440, 145, 120, 35,
sRecursos.getCMano(),
null,
sRecursos.getFontMediana(),
sRecursos.getColorPrincipal(),
Color.WHITE,
null,
"c",
true
);
bEliminar.addMouseListener(amigosComponent);
bEliminar.addActionListener(amigosComponent);
pOpciones.add(bEliminar);
}
public void crearContenidoPDatos() {
// LABEL INSTRUCCIONES ----------------------------------------------------------------
lInstrucciones = sObjGraficos.construirJLabel(
"<html>Datos de los contactos<html>",
20, 10, 120, 50,
null, null,
sRecursos.getFontTitulo(),
null,
sRecursos.getColorGrisOscuro(),
null,
"l"
);
pDatos.add(lInstrucciones);
// LABEL ESLOGAN ----------------------------------------------------------------
lEslogan = sObjGraficos.construirJLabel(
"<html>A continuación puede ver y editar la información del Contacto<html>",
20, 50, 180, 90,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorGrisOscuro(),
null,
"l"
);
pDatos.add(lEslogan);
// LABEL ID ----------------------------------------------------------------
lId = sObjGraficos.construirJLabel(
"Id Contacto:",
20, 140, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lId);
// LABEL ID CONTENIDO ----------------------------------------------------------
lIdValor = sObjGraficos.construirJLabel(
"0",
120, 140, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lIdValor);
// LABEL NOMBRE ----------------------------------------------------------------
lNombre = sObjGraficos.construirJLabel(
"Nombre Contacto:",
20, 180, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lNombre);
// TEXTFIELD NOMBRE ----------------------------------------------------------------
tNombre = sObjGraficos.construirJTextField(
"Nombre",
30, 215, 180, 30,
sRecursos.getFontLigera(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tNombre.addFocusListener(amigosComponent);
pDatos.add(tNombre);
// LABEL EDAD ----------------------------------------------------------------
lEdad = sObjGraficos.construirJLabel(
"Edad Contacto:",
20, 265, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lEdad);
// TEXTFIELD NOMBRE ----------------------------------------------------------------
tEdad = sObjGraficos.construirJTextField(
"Edad",
30, 300, 180, 30,
sRecursos.getFontLigera(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tEdad.addFocusListener(amigosComponent);
pDatos.add(tEdad);
// LABEL OFICIO ----------------------------------------------------------------
lOficio = sObjGraficos.construirJLabel(
"Oficio Contacto:",
20, 350, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lOficio);
// TEXTFIELD OFICIO ----------------------------------------------------------------
tOficio = sObjGraficos.construirJTextField(
"Oficio",
30, 385, 180, 30,
sRecursos.getFontLigera(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tOficio.addFocusListener(amigosComponent);
pDatos.add(tOficio);
// LABEL TELEFONO ----------------------------------------------------------------
lTelefono = sObjGraficos.construirJLabel(
"Telefono Contacto:",
20, 425, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lTelefono);
// TEXTFIELD TELEFONO ----------------------------------------------------------------
tTelefono = sObjGraficos.construirJTextField(
"Telefono",
30, 460, 180, 30,
sRecursos.getFontLigera(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tTelefono.addFocusListener(amigosComponent);
pDatos.add(tTelefono);
// LABEL EMAIL ----------------------------------------------------------------
lEmail = sObjGraficos.construirJLabel(
"Email Contacto:",
20, 510, 160, 30,
null, null,
sRecursos.getFontLigera(),
null,
sRecursos.getColorPrincipalOscuro(),
null,
"l"
);
pDatos.add(lEmail);
// TEXTFIELD EMAIL ----------------------------------------------------------------
tEmail = sObjGraficos.construirJTextField(
"Email",
30, 545, 180, 30,
sRecursos.getFontLigera(),
colorGris,
sRecursos.getColorGrisOscuro(),
sRecursos.getColorGrisOscuro(),
null,
"c"
);
tEmail.addFocusListener(amigosComponent);
pDatos.add(tEmail);
}
public JTable getTabla() { return tabla; }
public DefaultTableModel getModelo() { return modelo; }
public JButton getBMostrar() { return bMostrar; }
public JButton getBInsertar() { return bInsertar; }
public JButton getBModificar() { return bModificar; }
public JButton getBEliminar() { return bEliminar; }
public JButton getBFiltrar() { return bFiltrar; }
public JLabel getLIdValor() { return lIdValor; }
public JTextField getTNombre() { return tNombre; }
public JTextField getTEdad() { return tEdad; }
public JTextField getTOficio() { return tOficio; }
public JTextField getTTelefono() { return tTelefono; }
public JTextField getTEmail() { return tEmail; }
public JTextField getTConsulta() { return tConsulta; }
} | [
"cfpatinoc@correo.udistrital.edu.co"
] | cfpatinoc@correo.udistrital.edu.co |
09d91b8851e3ff8ba237783f672f52c816fdc8f1 | 9186be97ad0e7856636df4660e00b9a36ceeeb9a | /src/main/java/net/foxdenstudio/sponge/foxguard/plugin/flag/Flag.java | 4bb80c19bc2a7b9f9a29cf6743a113e19707faa1 | [
"MIT"
] | permissive | gitter-badger/FoxGuard | a66e8cd5a7f3eda06d7fdd19eae6bce8c2810e53 | 8c4f5b62464073a689a48114e3bfd16910b61bfb | refs/heads/master | 2021-01-21T08:33:16.758402 | 2016-07-18T12:44:15 | 2016-07-18T12:44:15 | 63,922,902 | 0 | 0 | null | 2016-07-22T04:12:10 | 2016-07-22T04:12:10 | null | UTF-8 | Java | false | false | 1,835 | java | /*
* This file is part of FoxGuard, licensed under the MIT License (MIT).
*
* Copyright (c) gravityfox - https://gravityfox.net/
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.foxdenstudio.sponge.foxguard.plugin.flag;
/**
* Created by Fox on 5/25/2016.
*/
public class Flag implements Comparable<Flag> {
public final String name;
public final int id;
Flag(String name, int id) {
this.name = name;
this.id = id;
}
@Override
public String toString() {
return "FlagOld{" + name + "," + id + "}";
}
public String getName() {
return name;
}
public int getId() {
return id;
}
@Override
public int compareTo(Flag flag) {
return this.id - flag.id;
}
}
| [
"gravityreallyhatesme@gmail.com"
] | gravityreallyhatesme@gmail.com |
638b8c89f4e8837ef6f95d1d1c0e0ef543e14030 | 277e65c0fe3e6b6d7bbec4bf0cf0326599184ac6 | /src/fr/afcepf/ai83/itinelib/model/Employe.java | 6ff3f39603a7d4482c13dd3e27fbccc3b9db194c | [] | no_license | astrild/itinelib | 792b4b7fb61bcae6cd77cd8dd9fef5cccbdd4852 | ed4257762c6dc835605733e0df063f9e1c9c3f1e | refs/heads/master | 2020-05-22T14:32:15.122806 | 2012-07-04T18:58:53 | 2012-07-04T18:58:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,564 | java | package fr.afcepf.ai83.itinelib.model;
// Generated 29 juin 2012 16:59:41 by Hibernate Tools 3.4.0.Beta1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* Employe generated by hbm2java
*/
@Entity
@Table(name = "employe", catalog = "itinelib")
public class Employe implements java.io.Serializable {
private Integer idemploye;
private String nomemploye;
private String prenomemploye;
private String service;
private Set<Utilisateur> utilisateurs = new HashSet<Utilisateur>(0);
private Set<Registre> registres = new HashSet<Registre>(0);
public Employe() {
}
public Employe(String nomemploye, String prenomemploye) {
this.nomemploye = nomemploye;
this.prenomemploye = prenomemploye;
}
public Employe(String nomemploye, String prenomemploye, String service,
Set<Utilisateur> utilisateurs, Set<Registre> registres) {
this.nomemploye = nomemploye;
this.prenomemploye = prenomemploye;
this.service = service;
this.utilisateurs = utilisateurs;
this.registres = registres;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "IDEMPLOYE", unique = true, nullable = false)
public Integer getIdemploye() {
return this.idemploye;
}
public void setIdemploye(Integer idemploye) {
this.idemploye = idemploye;
}
@Column(name = "NOMEMPLOYE", nullable = false, length = 45)
public String getNomemploye() {
return this.nomemploye;
}
public void setNomemploye(String nomemploye) {
this.nomemploye = nomemploye;
}
@Column(name = "PRENOMEMPLOYE", nullable = false, length = 45)
public String getPrenomemploye() {
return this.prenomemploye;
}
public void setPrenomemploye(String prenomemploye) {
this.prenomemploye = prenomemploye;
}
@Column(name = "SERVICE", length = 45)
public String getService() {
return this.service;
}
public void setService(String service) {
this.service = service;
}
@OneToMany(mappedBy = "employe")
public Set<Utilisateur> getUtilisateurs() {
return this.utilisateurs;
}
public void setUtilisateurs(Set<Utilisateur> utilisateurs) {
this.utilisateurs = utilisateurs;
}
@OneToMany(mappedBy = "employe")
public Set<Registre> getRegistres() {
return this.registres;
}
public void setRegistres(Set<Registre> registres) {
this.registres = registres;
}
}
| [
"benoitricaud@gmail.com"
] | benoitricaud@gmail.com |
ca3cddf07ec3c49f05b2ee9d191cc2430722e969 | de3eb812d5d91cbc5b81e852fc32e25e8dcca05f | /branches/crux/4.1.0/OLD_CruxSite/src/org/cruxframework/cruxsite/client/resource/small/CssCruxSiteSmall.java | 12436a2ac063dae1e90aa88538d69a8ad78032d6 | [] | no_license | svn2github/crux-framework | 7dd52a951587d4635112987301c88db23325c427 | 58bcb4821752b405a209cfc21fb83e3bf528727b | refs/heads/master | 2016-09-06T13:33:41.975737 | 2015-01-22T08:03:25 | 2015-01-22T08:03:25 | 13,135,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,829 | java | /*
* Copyright 2013 cruxframework.org.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.cruxframework.cruxsite.client.resource.small;
import com.google.gwt.resources.client.CssResource;
/**
* @author Thiago da Rosa de Bustamante
*
*/
public interface CssCruxSiteSmall extends CssResource
{
// Site
String header();
String headerMenu();
String buttonMenu();
String cruxLabel();
String cruxLogo();
// String view();
String footer();
String poweredLabel();
String poweredImage();
// Home View
String contentAreas();
String contentLeft();
String contentCenter();
String contentRight();
String bannerAndNews();
String bannerArea();
String promoBanner();
String contentHorizontalSeparator();
String newsBoard();
String rssPanel();
// String shortcutsPanel();
// String menuShortcut();
// String headerMenuLabel();
// String siteContent();
// String siteFooter();
// String cruxLabelFooter();
// String cruxLabelFooter2();
// String cruxLabelFooter3();
// String cruxLabelFooter4();
// String labelFooter();
// String footerContent();
String p();
String h1();
String shyText();
String shyLink();
String divDownTxt();
String divDownTxtTitle();
String communityContent();
String blockTypes();
String blockTypes2();
String siteTutorial();
String donwloadButton();
}
| [
"thiago@cruxframework.org@a5d2bbaa-053c-11de-b17c-0f1ef23b492c"
] | thiago@cruxframework.org@a5d2bbaa-053c-11de-b17c-0f1ef23b492c |
b476710e8bf8d67c32a9f13f2b39cb927d42975f | 7faba52ec8e2253a52989d96c411c4a4d99cb636 | /mip-base/mip-channel/src/main/java/com/womai/m/mip/channel/geolocation/GeolocationController.java | 8954fe551229f75c82762482674fa6ae443bdc2e | [] | no_license | zhangz427/PersonalProject | 69adb0f5f65d204b76ef7dcdc15ea08b0465e5f1 | c4b9ac46f7f72650331a770c232a1cc491ad6c62 | refs/heads/master | 2020-09-14T19:03:48.447262 | 2016-08-19T02:22:08 | 2016-08-19T02:22:08 | 65,983,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,997 | java | package com.womai.m.mip.channel.geolocation;
import com.womai.m.mip.channel.BaseController;
import com.womai.m.mip.channel.BaseGeneralResponse;
import com.womai.m.mip.channel.BaseResponse;
import com.womai.m.mip.common.utils.ThreeDES;
import com.womai.m.mip.domain.geolocation.GeolocationInfo;
import com.womai.m.mip.service.BaseServiceResponse;
import com.womai.m.mip.service.geolocation.GeolocationService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* Created by zheng.zhang on 2016/3/4.
*/
@Controller
@RequestMapping("/geo")
public class GeolocationController extends BaseController {
public static final String RESPONSE_NONSUPPORT_ADDRESS = "-92";
@Autowired
private GeolocationService geolocationService;
@ResponseBody
@RequestMapping(value = "/getGeolocation",produces="application/json;charset=utf-8")
public BaseResponse getGeolocation(HttpServletRequest request) {
try{
String encryptedRequestData = request.getParameter("data");
logger.debug("encryptedRequestData:{}", encryptedRequestData);
if (StringUtils.isBlank(encryptedRequestData)) {
logger.error("request data is null");
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
String headerEncryptedString = request.getHeader("headerData");
logger.debug("headerEncryptedString:{}", headerEncryptedString);
if (StringUtils.isBlank(headerEncryptedString)) {
logger.error("header data is null");
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
Map<String, Object> requestMap = decryptRequestData(encryptedRequestData);
Map<String, Object> headerMap = decryptHeaderData(headerEncryptedString);
logger.debug("Request data:{}", requestMap);
logger.debug("Header data:{}", headerMap);
String latitude = (String)requestMap.get("latitude");
if (StringUtils.isBlank(latitude)) {
logger.error("latitude is null in request data");
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
String longitude = (String)requestMap.get("longitude");
if (StringUtils.isBlank(longitude)) {
logger.error("longitude is null in request data");
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
String mipSourceId = (String)headerMap.get("mipSourceId");
if (!sourceValidate(mipSourceId)) {
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
return convertToBaseEncryptResponse(getGeolocation(latitude, longitude, mipSourceId));
} catch (Exception e) {
logger.error("system error,", e);
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
}
@ResponseBody
@RequestMapping(value = "/getLocation",produces="application/json;charset=utf-8")
public BaseResponse getLocation(HttpServletRequest request) {
try{
String latitude = request.getParameter("latitude");
if (StringUtils.isBlank(latitude)) {
logger.error("latitude is null in request data");
return createErrorResponse("定位失败");
}
String longitude = request.getParameter("longitude");
if (StringUtils.isBlank(longitude)) {
logger.error("longitude is null in request data");
return createErrorResponse("定位失败");
}
String mipSourceId = decryptMipSource(request);
if (!sourceValidate(mipSourceId)) {
return convertToBaseEncryptResponse(createErrorResponse("定位失败"));
}
return getGeolocation(latitude, longitude, mipSourceId);
} catch (Exception e) {
logger.error("system error,", e);
return createErrorResponse("定位失败");
}
}
private BaseResponse getGeolocation(String latitude,String longitude, String mipSourceId) {
try {
//Android未获取经纬度情况下传递
if("1002".equals(mipSourceId)) {
if ("4.9E-324".equals(latitude) && "4.9E-324".equals(longitude)) {
logger.error("Android invalid input");
return createErrorResponse("定位失败");
}
}
String coordinateType = getCoordinateType(mipSourceId);
BaseServiceResponse<GeolocationInfo> geolocationServiceResponse = geolocationService.getGeolocation(latitude, longitude, coordinateType);
if (BaseServiceResponse.RESPONSE_SUCCESS.equals(geolocationServiceResponse.getCode())) {
logger.info("Get geolocation info mipSourceId={},latitude={},longitude={},result:{}", mipSourceId, latitude, longitude,geolocationServiceResponse.getData().toString());
return new BaseGeneralResponse(convertGeolocationInfoToMap(geolocationServiceResponse.getData()));
} else if (GeolocationService.RESPONSE_NONSUPPORT_ADDRESS.equals(geolocationServiceResponse.getCode())) {
logger.info("Address is not supported mipSourceId={},latitude={},longitude={}", mipSourceId, latitude, longitude);
BaseResponse response = new BaseResponse();
response.setCode(RESPONSE_NONSUPPORT_ADDRESS);
response.setMessage("当前位置未开通站点");
return response;
} else {
logger.error(geolocationServiceResponse.getMessage());
return createErrorResponse("定位失败");
}
} catch (Exception e) {
logger.error("system error,", e);
return createErrorResponse("定位失败");
}
}
private Map<String, String> convertGeolocationInfoToMap(GeolocationInfo geolocationInfo) {
Map<String, String> infoMap = new HashMap<String, String>();
infoMap.put("cityId", geolocationInfo.getCityId());
infoMap.put("cityName", geolocationInfo.getCityName());
infoMap.put("mid", geolocationInfo.getMid());
return infoMap;
}
private String getCoordinateType(String osCode) {
if ("1002".equals(osCode)) {
return GeolocationService.COORDINATE_TYPE_ANDROID;
} else {
return GeolocationService.COORDINATE_TYPE_STANDARD;
}
}
}
| [
"zheng.zhang"
] | zheng.zhang |
3cd70c5db99d860ebda9cee26e3aa2d2daec7e69 | 92a2fae0459de9ddba4365c660963cedc763ae98 | /9chapter/src/component/GridLayoutEx.java | 93dcb76f8e66eadcc68ae32c704e0512ed3ff344 | [] | no_license | thxogusrla/java | 9f187e50a443837a9f750813f5f2ff1b23ac7b0e | c0f6c248db361dc13f7c69153dfad3a18dc54e4d | refs/heads/master | 2020-05-24T22:31:58.282936 | 2019-06-08T14:20:18 | 2019-06-08T14:20:18 | 187,497,604 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 656 | java | package component;
import javax.swing.*;
import java.awt.*;
public class GridLayoutEx extends JFrame{ //GridLayout은
public GridLayoutEx() {
setTitle("그리드 레이아웃 예제");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout grid = new GridLayout(4,2);
grid.setVgap(5);
Container c = getContentPane();
c.setLayout(grid);
c.add(new JLabel("이름"));
c.add(new JTextField(""));
c.add(new JLabel("학번"));
c.add(new JTextField(""));
c.add(new JLabel("학과"));
c.add(new JTextField(""));
setSize(300, 200);
setVisible(true);
}
public static void main(String[] args) {
new GridLayoutEx();
}
}
| [
"thxogusrla@gmail.com"
] | thxogusrla@gmail.com |
5cb3a2b08a428c6efdd7a7bc721f94e87e76a85b | 0f574b24b3202d72813f753508d14c9b24b177c1 | /src/main/java/org/meteothink/common/util/DateUtil.java | 75481cdac7ef13507003fc3be11e9dc4af55e841 | [] | no_license | Yaqiang/meteothink-common | 4bdcd7f3b52d9a433ea09f0cbfbd28bb43e82ee8 | a816bf45c74abd8fffd15d807419aee68388009d | refs/heads/master | 2020-04-30T13:52:15.352280 | 2019-04-09T14:40:24 | 2019-04-09T14:40:24 | 176,871,340 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 13,198 | java | /* Copyright 2012 Yaqiang Wang,
* yaqiang.wang@gmail.com
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*/
package org.meteothink.common.util;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.Hours;
import org.joda.time.Minutes;
import org.joda.time.Months;
import org.joda.time.Period;
import org.joda.time.PeriodType;
import org.joda.time.ReadablePeriod;
import org.joda.time.Seconds;
import org.joda.time.Weeks;
import org.joda.time.Years;
import org.joda.time.format.DateTimeFormatter;
/**
*
* @author yaqiang
*/
public class DateUtil {
// <editor-fold desc="Variables">
// </editor-fold>
// <editor-fold desc="Constructor">
// </editor-fold>
// <editor-fold desc="Get Set Methods">
// </editor-fold>
// <editor-fold desc="Methods">
/**
* Add days to a date
*
* @param sDate Start date
* @param days Days
* @return Added date
*/
public static Date addDays(Date sDate, float days) {
Calendar cal = Calendar.getInstance();
cal.setTime(sDate);
int intDays = (int) days;
cal.add(Calendar.DAY_OF_YEAR, intDays);
int hours = (int) ((days - intDays) * 24);
cal.add(Calendar.HOUR, hours);
return cal.getTime();
}
/**
* Get days of a month
*
* @param year The year
* @param month The month
* @return The days in the month
*/
public static int getDaysInMonth(int year, int month) {
Calendar cal = Calendar.getInstance();
cal.set(year, month, 1);
return cal.getActualMaximum(Calendar.DAY_OF_MONTH);
}
/**
* Get time values - Time delta values of base date
*
* @param times Time list
* @param baseDate Base date
* @param tDelta Time delta type - days/hours/...
* @return The time delta values
*/
public static List<Integer> getTimeDeltaValues(List<Date> times, Date baseDate, String tDelta) {
List<Integer> values = new ArrayList<>();
Calendar cal = Calendar.getInstance();
cal.setTime(baseDate);
long sl = cal.getTimeInMillis();
long el, delta;
int value;
for (int i = 0; i < times.size(); i++) {
cal.setTime(times.get(i));
el = cal.getTimeInMillis();
delta = el - sl;
if (tDelta.equalsIgnoreCase("hours")) {
value = (int) (delta / (60 * 60 * 1000));
values.add(value);
} else if (tDelta.equalsIgnoreCase("days")) {
value = (int) (delta / (24 * 60 * 60 * 1000));
values.add(value);
}
}
return values;
}
/**
* Get time value - Time delta value of base date
*
* @param t The time
* @param baseDate Base date
* @param tDelta Time delta type - days/hours/...
* @return The time delta value
*/
public static int getTimeDeltaValue(Date t, Date baseDate, String tDelta) {
Calendar cal = Calendar.getInstance();
cal.setTime(baseDate);
long sl = cal.getTimeInMillis();
long el, delta;
int value = 0;
cal.setTime(t);
el = cal.getTimeInMillis();
delta = el - sl;
if (tDelta.equalsIgnoreCase("hours")) {
value = (int) (delta / (60 * 60 * 1000));
} else if (tDelta.equalsIgnoreCase("days")) {
value = (int) (delta / (24 * 60 * 60 * 1000));
}
return value;
}
/**
* Get days difference between two dates
*
* @param t The time
* @param baseDate Base date
* @return The time delta value
*/
public static int getDays(Date t, Date baseDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(baseDate);
long sl = cal.getTimeInMillis();
long el, delta;
cal.setTime(t);
el = cal.getTimeInMillis();
delta = el - sl;
int value = (int) (delta / (24 * 60 * 60 * 1000));
return value;
}
/**
* Get hours difference between two dates
*
* @param t The time
* @param baseDate Base date
* @return The time delta value
*/
public static int getHours(Date t, Date baseDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(baseDate);
long sl = cal.getTimeInMillis();
long el, delta;
cal.setTime(t);
el = cal.getTimeInMillis();
delta = el - sl;
int value = (int) (delta / (60 * 60 * 1000));
return value;
}
/**
* Convert OA date to date
*
* @param oaDate OA date
* @return Date
*/
public static Date fromOADate(double oaDate) {
Date date = new Date();
//long t = (long)((oaDate - 25569) * 24 * 3600 * 1000);
//long t = (long) (oaDate * 1000000);
long t = (long) BigDecimalUtil.mul(oaDate, 1000000);
date.setTime(t);
return date;
}
/**
* Convert date to OA date
*
* @param date Date
* @return OA date
*/
public static double toOADate(Date date) {
double oaDate = date.getTime();
//oaDate = oaDate / (24 * 3600 * 1000) + 25569;
//oaDate = oaDate / 1000000;
oaDate = BigDecimalUtil.div(oaDate, 1000000);
return oaDate;
}
/**
* Date equals
*
* @param a Date a
* @param b Date b
* @return If equals
*/
public static boolean equals(Date a, Date b) {
if (a.getTime() == b.getTime()) {
return true;
} else {
return false;
}
}
/**
* Get day of year
*
* @param year Year
* @param month Month
* @param day Day
* @return Day of year
*/
public static int dayOfYear(int year, int month, int day) {
Calendar cal = Calendar.getInstance();
cal.set(year, month, day);
int doy = cal.get(Calendar.DAY_OF_YEAR);
return doy;
}
/**
* Convert day of year to date
*
* @param year Year
* @param doy Day of year
* @return The date
*/
public static Date doy2date(int year, int doy) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, year);
cal.set(Calendar.DAY_OF_YEAR, doy);
return cal.getTime();
}
/**
* Get period type from string
*
* @param p Period type string
* @return PeriodType
*/
public static PeriodType getPeriodType(String p) {
PeriodType pt = PeriodType.days();
switch (p) {
case "H":
pt = PeriodType.hours();
break;
case "M":
pt = PeriodType.minutes();
break;
case "S":
pt = PeriodType.seconds();
break;
case "m":
pt = PeriodType.months();
break;
case "Y":
pt = PeriodType.years();
break;
}
return pt;
}
/**
* Get period from string
*
* @param pStr Period string
* @return Period
*/
public static ReadablePeriod getPeriod(String pStr) {
String p;
int n = 1;
int idx = 0;
for (int i = 0; i < pStr.length(); i++) {
if (Character.isLetter(pStr.charAt(i))){
break;
}
idx += 1;
}
if (idx == 0) {
p = pStr;
} else {
p = pStr.substring(idx);
n = Integer.parseInt(pStr.substring(0, idx));
}
ReadablePeriod pe;
switch (p) {
case "H":
pe = Hours.hours(n);
break;
case "T":
case "Min":
pe = Minutes.minutes(n);
break;
case "S":
pe = Seconds.seconds(n);
break;
case "D":
pe = Days.days(n);
break;
case "W":
pe = Weeks.weeks(n);
break;
case "M":
pe = Months.months(n);
break;
case "Y":
pe = Years.years(n);
break;
default:
pe = new Period();
break;
}
return pe;
}
/**
* Get date format string
*
* @param p Period
* @return Date format string
*/
public static String getDateFormat(ReadablePeriod p) {
String df = "yyyy-MM-dd";
if (p instanceof Hours) {
df = "yyyy-MM-dd HH";
} else if (p instanceof Minutes) {
df = "yyyy-MM-dd HH:mm";
} else if (p instanceof Seconds) {
df = "yyyy-MM-dd HH:mm:ss";
}
return df;
}
/**
* Get date time from string
*
* @param dts Date time string
* @return DateTime
*/
public static DateTime getDateTime(String dts) {
int year, month, day;
String dateStr = dts;
String timeStr = null;
if (dts.contains(":")) {
String[] v = dts.split("\\s+");
dateStr = v[0].trim();
timeStr = v[1].trim();
}
if (dateStr.contains("/")) {
String[] ymd = dateStr.split("/");
month = Integer.parseInt(ymd[0]);
day = Integer.parseInt(ymd[1]);
year = Integer.parseInt(ymd[2]);
} else if (dateStr.contains("-")) {
String[] ymd = dateStr.split("-");
month = Integer.parseInt(ymd[1]);
day = Integer.parseInt(ymd[2]);
year = Integer.parseInt(ymd[0]);
} else {
year = Integer.parseInt(dateStr.substring(0, 4));
month = Integer.parseInt(dateStr.substring(4, 6));
day = Integer.parseInt(dateStr.substring(6));
}
int hour = 0, minute = 0, second = 0;
if (timeStr != null) {
String[] hms = timeStr.split(":");
hour = Integer.parseInt(hms[0]);
minute = Integer.parseInt(hms[1]);
second = hms.length == 3 ? Integer.parseInt(hms[2]) : 0;
}
return new DateTime(year, month, day, hour, minute, second);
}
/**
* Get date time from string
*
* @param dts Date time string
* @return DateTime
*/
public static DateTime getDateTime_(String dts) {
DateTimeFormatter dtf;
if (dts.contains(":")) {
dtf = TypeUtils.getDateTimeFormatter(dts);
} else {
dtf = TypeUtils.getDateFormatter(dts);
}
DateTime dt = dtf.parseDateTime(dts);
return dt;
}
/**
* Get date time list
*
* @param start Start date time
* @param end End date time
* @param p Peroid
* @return Date time list
*/
public static List<DateTime> getDateTimes(DateTime start, DateTime end, ReadablePeriod p) {
List<DateTime> dts = new ArrayList<>();
while (!start.isAfter(end)) {
dts.add(start);
start = start.plus(p);
}
return dts;
}
/**
* Get date time list
*
* @param start Start date time
* @param tNum Date time number
* @param p Peroid
* @return Date time list
*/
public static List<DateTime> getDateTimes(DateTime start, int tNum, ReadablePeriod p) {
List<DateTime> dts = new ArrayList<>();
for (int i = 0; i < tNum; i++) {
dts.add(start);
start = start.plus(p);
}
return dts;
}
/**
* Get date time list
*
* @param end End date time
* @param tNum Date time number
* @param p Peroid
* @return Date time list
*/
public static List<DateTime> getDateTimes(int tNum, DateTime end, ReadablePeriod p) {
List<DateTime> dts = new ArrayList<>();
for (int i = 0; i < tNum; i++) {
dts.add(end);
end = end.minus(p);
}
return dts;
}
// </editor-fold>
}
| [
"yaqiang.wang@gmail.com"
] | yaqiang.wang@gmail.com |
71c0a78378dd77132f98febcb809d87ffd5035cc | cc81a11a6d92629e85cfcde03d26408bad39303f | /beakjoon/B2146_BridgeMaking.java | a611bbe7b682a3b308cd99b58d5d94c7457e09c4 | [] | no_license | kkssomm/Algorithm | af3a70b071b23242e92d407711dc4ab67bdc93cb | 976580e7b53ef909e30eda6913865885819b8c68 | refs/heads/master | 2020-12-28T17:24:13.996071 | 2020-05-10T01:39:26 | 2020-05-10T01:39:26 | 238,420,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,591 | java | package beakjoon;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class B2146_BridgeMaking {
static int N;
static int[][] map;
static boolean[][] visited;
static Queue<Pairs> q = new LinkedList<>();
static int[] dx = {0,0,1,-1};
static int[] dy = {1,-1,0,0};
static int mark = 2;
static int min = Integer.MAX_VALUE;
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
map = new int[N][N];
visited = new boolean[N][N];
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
map[i][j] = sc.nextInt();
}
}
mark();
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if(map[i][j] == 0 || !isEdge(i, j))
continue;
visited = new boolean[N][N];
int cnt = 0;
int idx = map[i][j];
visited[i][j] = true;
q.add(new Pairs(i, j));
loop: while(!q.isEmpty()) {
int size = q.size();
for (int s = 0; s < size; s++) {
Pairs cur = q.poll();
if(map[cur.x][cur.y] != idx && map[cur.x][cur.y] > 0) {
q.clear();
break loop;
}
for (int k = 0; k < 4; k++) {
int nx = cur.x + dx[k];
int ny = cur.y + dy[k];
if(!isRange(nx, ny) || visited[nx][ny] || map[nx][ny] == idx)
continue;
visited[nx][ny] = true;
q.add(new Pairs(nx, ny));
}
}
cnt++;
}
min = Math.min(min, cnt-1);
}
}
System.out.println(min);
sc.close();
}
static boolean isEdge(int x, int y) {
for (int i = 0; i < 4; i++) {
int nx = x + dx[i];
int ny = y + dy[i];
if(!isRange(nx,ny) || map[nx][ny] != 0) continue;
return true;
}
return false;
}
static void mark() {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if(map[i][j] != 1) continue;
map[i][j] = mark;
q.add(new Pairs(i, j));
while(!q.isEmpty()) {
Pairs cur = q.poll();
for (int k = 0; k < 4; k++) {
int nx = cur.x + dx[k];
int ny = cur.y + dy[k];
if(!isRange(nx, ny) || map[nx][ny] != 1) continue;
map[nx][ny] = mark;
q.add(new Pairs(nx, ny));
}
}
mark++;
}
}
}
static boolean isRange(int x, int y) {
if( x < 0 || x >= N || y < 0 || y >= N) return false;
return true;
}
} | [
"asdfx1415@naver.com"
] | asdfx1415@naver.com |
4a7a849afd80b2ec02ca52996918f9e0ae375644 | f2e15a3d873f121a2543758634baef0990de5af0 | /selunit/tags/selunit-root-0.7.3/selunit-core/src/main/java/org/selunit/report/support/DefaultTestCase.java | 967dbb0aaec22196e1684da384e24c0ca786f7c2 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nikgoodley-ibboost/selunit | 5c2a8e677cb24ce8e6e2eeb4cba3a08baa10beaf | adb06696feaebe7749a3aa7b65169134d2f40998 | refs/heads/master | 2016-09-05T10:41:33.821160 | 2013-09-27T23:13:26 | 2013-09-27T23:13:26 | 40,134,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,105 | java | /*******************************************************************************
* Copyright 2011 selunit.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package org.selunit.report.support;
import java.io.Serializable;
import org.selunit.report.ResultType;
import org.selunit.report.TestCaseReport;
import org.selunit.report.TestReportLog;
public class DefaultTestCase implements TestCaseReport, Serializable {
private static final long serialVersionUID = 1425513081555678875L;
private String name;
private String fileName;
private double time;
private ResultType resultType;
private TestReportLog resultLog;
private long startTime, endTime;
public DefaultTestCase() {
super();
}
public DefaultTestCase(TestCaseReport copy) {
this.name = copy.getName();
this.fileName = copy.getFileName();
this.time = copy.getTime();
this.resultType = copy.getResultType();
this.resultLog = copy.getResultLog();
this.startTime = copy.getStartTime();
this.endTime = copy.getEndTime();
}
@Override
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public double getTime() {
return time;
}
public void setTime(double time) {
this.time = time;
}
@Override
public ResultType getResultType() {
return resultType;
}
public void setResultType(ResultType resultType) {
this.resultType = resultType;
}
@Override
public TestReportLog getResultLog() {
return resultLog;
}
public void setResultLog(TestReportLog resultLog) {
this.resultLog = resultLog;
}
/**
* @return the startTime
*/
@Override
public long getStartTime() {
return startTime;
}
/**
* @param startTime
* the startTime to set
*/
public void setStartTime(long startTime) {
this.startTime = startTime;
}
/**
* @return the endTime
*/
@Override
public long getEndTime() {
return endTime;
}
/**
* @param endTime
* the endTime to set
*/
public void setEndTime(long endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return "name=" + getName() + "; file=" + getFileName() + "; result="
+ getResultType() + "; time=" + getTime() + "; log=["
+ getResultLog() + "];";
}
}
| [
"oliver.hager@gmail.com"
] | oliver.hager@gmail.com |
0ee268fa1da3539fd788253f299b01eb5654654e | 90dca8e52461a7efc35a133c856bb74987e2168f | /server/src/main/java/com/obinna/springangulardemo/model/Customer.java | 7ce3efeda94f5960986d3540fe59950d3d9658c7 | [] | no_license | obkalu/spring-rest-n-angular-demo | 2c2dbe0c219835b1895c5d4721ee990ded30d626 | e898106ded85a4142b0d5231624918c814e46767 | refs/heads/master | 2020-03-23T19:23:05.587855 | 2018-07-23T07:10:28 | 2018-07-23T07:10:28 | 141,973,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | package com.obinna.springangulardemo.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Customer {
@Id
@GeneratedValue
private Long id;
private String name;
public Customer() {
}
public Customer(String name) {
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Customer{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
| [
"obkalu@gmail.com"
] | obkalu@gmail.com |
99e132fbb70d8c1238657dc50e3c4c1f81126220 | 7438d39a27c6c3a9e9adae66c6e9ef8765e6f59e | /src/main/java/com/pm/background/admin/common/shiro/UserRealm.java | 57d2d3999959189f5d6fe141b11bc0aebfffb987 | [] | no_license | yaoas/gongyi | 0bb21a410f140c2611ec0c04798cbdfc96afe1dc | a9ff2936465760db26fbbea2c7e89549f401611a | refs/heads/master | 2022-10-26T01:56:13.453495 | 2019-11-25T06:40:35 | 2019-11-25T06:40:35 | 219,651,729 | 0 | 0 | null | 2022-10-12T20:34:12 | 2019-11-05T03:42:12 | Java | UTF-8 | Java | false | false | 3,120 | java | /**
* Copyright 2018 人人开源 http://www.renren.io
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.pm.background.admin.common.shiro;
import com.pm.background.admin.common.factory.IShiro;
import com.pm.background.admin.common.factory.impl.ShiroFactroy;
import com.pm.background.admin.sys.entity.User;
import com.pm.background.common.utils.ToolUtil;
import org.apache.shiro.authc.*;
import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 认证
*
*/
@Component
public class UserRealm extends AuthorizingRealm {
/**
* 授权(验证权限时调用)
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
IShiro shiroFactory = ShiroFactroy.me();
ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal();
List<String> roleNameList = shiroUser.getRoleNames();
List<String> permsList = shiroFactory.findPermissionsByUserId(shiroUser.getId());
//用户权限列表
Set<String> permsSet = new HashSet<>();
for(String perms : permsList){
if(ToolUtil.isEmpty(perms)){
continue;
}
permsSet.addAll(Arrays.asList(perms.trim().split(",")));
}
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
info.setStringPermissions(permsSet);
info.addRoles(roleNameList);
return info;
}
/**
* 认证(登录时调用)
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(
AuthenticationToken authcToken) throws AuthenticationException {
IShiro shiroFactory = ShiroFactroy.me();
UsernamePasswordToken token = (UsernamePasswordToken)authcToken;
User user = shiroFactory.user(token.getUsername());
ShiroUser shiroUser = shiroFactory.shiroUser(user);
SimpleAuthenticationInfo info = shiroFactory.info(shiroUser,user,getName());
return info;
}
@Override
public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher) {
HashedCredentialsMatcher shaCredentialsMatcher = new HashedCredentialsMatcher();
shaCredentialsMatcher.setHashAlgorithmName(ShiroUtils.hashAlgorithmName);
shaCredentialsMatcher.setHashIterations(ShiroUtils.hashIterations);
super.setCredentialsMatcher(shaCredentialsMatcher);
}
}
| [
"787663136@qq.com"
] | 787663136@qq.com |
237c53ae90a158a3beec925f8ba71cadd29d25ec | d7462ec35d59ed68f306b291bd8e505ff1d65946 | /service/template/src/main/java/com/alibaba/citrus/service/template/impl/TemplateSearchingStrategy.java | 0b826e4a902d8c4bc1893150ab3775393da0307a | [] | no_license | ixijiass/citrus | e6d10761697392fa51c8a14d4c9f133f0a013265 | 53426f1d73cc86c44457d43fb8cbe354ecb001fd | refs/heads/master | 2023-05-23T13:06:12.253428 | 2021-06-15T13:05:59 | 2021-06-15T13:05:59 | 368,477,372 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,222 | java | /*
* Copyright 2010 Alibaba Group Holding Limited.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.alibaba.citrus.service.template.impl;
/**
* 由<code>TemplateService</code>调用的,用来查找template的strategy。
*
* @author Michael Zhou
*/
public interface TemplateSearchingStrategy {
/**
* 取得用来缓存模板搜索结果的key。
*/
Object getKey(String templateName);
/**
* 查找template,如果找到,则返回<code>true</code>。
* <p>
* 可更改matcher参数中的模板名称和后缀。
* </p>
*/
boolean findTemplate(TemplateMatcher matcher);
}
| [
"isheng19982qrr@126.com"
] | isheng19982qrr@126.com |
68a60eb6fc1639ac9e33e22cff7deb7f21fb66d4 | ed42f701b2a7c32491b58e0b51e565c301f6eafe | /Speed/src/Maruti.java | 16ea5eb5561dfe5f7dde6aad83ae0f8cfab573af | [] | no_license | mohammed2205/Carspeed | 369ab4dbb8903b6c03d4e67da2d54cab287777ae | 08d6736465e2541c76393fd4d4f179cc929d8d5a | refs/heads/main | 2023-03-27T16:05:24.526107 | 2021-03-28T06:07:49 | 2021-03-28T06:07:49 | 352,254,251 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java |
public class Maruti extends speed {
public static void Spedd() {
System.out.println("the speed of the car is 60km/h");
}
}
| [
"MOHAMMED@DESKTOP-2H96LKI"
] | MOHAMMED@DESKTOP-2H96LKI |
4c76ea319abc493fcdc66d9e420a47d8300eab7b | 83e6554a7f253df8d26cd4e1f2457b61b8f1de30 | /src/com/by/utils/Config.java | 58719618fe0c9a4f4137a4212b50909742f63012 | [
"MIT"
] | permissive | chensaikang/baoyi | 55d95e50172423de0dd75fbf4b2c76021c140d31 | 5e4cd9cf60996c6c5638a62df7849103ae681fe6 | refs/heads/master | 2021-01-20T17:03:02.895986 | 2016-07-25T12:47:46 | 2016-07-25T12:47:46 | 64,133,612 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,735 | java | package com.by.utils;
/**
*
* @author 此类意在创建全局变量,方便信息传递
*
*/
public class Config {
public static final int STRING_TYPE = 0;
public static final int BITMAP_TYPE = 1;
// public static String OPENIDS = null;
public static int NOTALLSELECT = 100;
public static int ALLSELECT = 99;
public static boolean ISLOGIN = false;
// public static String MANAGER_PATHString =
// "http://app.byssteel.com/Manager.asmx/SeahData?pageNo=1&ChanDi=&PinMing=&WareHouseName=&CaiZhi=&houDuMin=&houDuMax=&kuanDuMin=&kuanDuMax=&bypar=&orBy=&keys=";
public static String Home_MNotice = "Home.asmx/MNoticeMore?pageNo=";// fragemnt的url
public static String Home_BNotice = "Home.asmx/BNoticeMore?pageNo=";
public static String Home_ZNotice = "Home.asmx/ZNoticeMore?pageNo=";
public static String JJinfo = "home.asmx/JJinfo";
// public static String URL_PATH = "http://apptest.baoyi188.com/";// 测试专用
// public static String URL_PATH = "http://app.byssteel.com/";// 实用版
public static String URL_PATH = "http://192.168.1.188:81/";// 内网
// public static String URL_PATH = "http://192.168.1.4:8080/";// 内网
public static int ITEM_POSITION = 0;// 碎片位置
public static boolean LOGIN_FLAG = false;// 登录状态
public static boolean FIRSIT_IN = true;// 买家未登录显示视图效果
public static int ORDERTAIL_OID = 0;
public static String OPENID = null;
public static String SEARCH_KEYS = null;
public static String INDENT_TITLE = null;
public static int CLASS_TYPE = 1;// 提示登陆返回机制的标识,判断是activity/fragment
public static int FRAGMENT_TYPE = 0;
public static String DEVICE_TYPE = "android";// 设备类型-提交订单所需参数
}
| [
"18501365753@163.com"
] | 18501365753@163.com |
28201d440ceb5b6f34c943d3bd0aa47d27e541f9 | d0b6eb87fb4fddb68a0b9f1712408ace0688f3ae | /src/com/javarush/test/level09/lesson11/home01/Solution.java | 3ea3617a5ebe52890c40524e89ff4a3f1174828a | [] | no_license | luckyjohn777/JavaRushHomeWork11 | 975ea86e6a7be7abce255ba59ecf68fb85c7abf8 | b9d8597ad876bea473ebddef5015a8815a4ff8b9 | refs/heads/master | 2021-01-10T07:36:40.509418 | 2016-03-28T08:58:23 | 2016-03-28T08:58:23 | 54,629,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package com.javarush.test.level09.lesson11.home01;
/* Деление на ноль
Создай метод public static void divisionByZero, в котором подели любое число на ноль и выведи на экран результат деления.
Оберни вызов метода divisionByZero в try..catch. Выведи стек-трейс исключения используя метод exception.printStackTrace()
*/
public class Solution
{
public static void main(String[] args)
{
try
{
divisionByZero();
}
catch (ArithmeticException e)
{
e.printStackTrace();
}
}
public static void divisionByZero()
{
int i = 1 / 0;
System.out.println(i);
}
}
| [
"divon777@mail.ru"
] | divon777@mail.ru |
b1bdb86da550922d0bc172d71a9e834414345e15 | 329f0481d9d05b77c99e87c68c8dfa1554676704 | /src/main/java/com/cyh/Mapper/MarryMapper.java | 1084823cf684835dd4801faa1b97f0073ebec760 | [] | no_license | a878804506/WeChat | 12b27ec822e1d61ca607ea4dc744fd2b686e3ccf | 17fdf33f47defcf665428e670a4ce004b62c1301 | refs/heads/master | 2022-07-03T06:52:48.954679 | 2019-12-02T03:52:45 | 2019-12-02T03:52:45 | 175,589,479 | 2 | 0 | null | 2022-06-21T02:12:52 | 2019-03-14T09:27:21 | JavaScript | UTF-8 | Java | false | false | 1,023 | java | package com.cyh.Mapper;
import com.cyh.entity.Picture;
import com.cyh.entity.PictureGroup;
import com.cyh.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface MarryMapper {
User loginUser(User user);
List<PictureGroup> getMarryPictureGroupList(@Param("isLogin") boolean isLogin);
PictureGroup getPictureGroupById(@Param("pictureGroupId") Integer pictureGroupId);
void addPictureGroupCountById(@Param("pictureGroupId") Integer pictureGroupId, @Param("pictureGroupLookCount") Integer pictureGroupLookCount);
List<Picture> getMarryPictureListByGroupId(@Param("pictureGroupId") Integer pictureGroupId);
void submitVisitor(@Param("name") String name, @Param("phone") String phone, @Param("peoples") String peoples, @Param("ip") String ip);
List<Map<String, String>> getAllVisitors();
void submitAdvise(@Param("advise") String advise, @Param("call") String call);
}
| [
"LIUfeng520"
] | LIUfeng520 |
c920a0f918199bc6201d97003b94d7b1dd383a35 | 81aa051321cf426d832b9b07126010ea77201d6a | /src/main/java/pl/edu/agh/iosr/twitter/dto/TweetDTO.java | 6fc1672fd6abbc4fbe4f9b30f97eb3a4038cf102 | [] | no_license | blostic/twitter_guards | d948555ea8d2c2de0d5b34ca3379d3a769a7edfa | a02a252c8b91d1e4453d750d5394a504dd4e7b05 | refs/heads/rest-integration | 2020-05-30T18:57:04.716931 | 2016-10-29T10:01:24 | 2016-10-29T10:01:24 | 32,815,067 | 0 | 0 | null | 2015-05-24T18:21:04 | 2015-03-24T17:48:23 | CSS | UTF-8 | Java | false | false | 1,118 | java | package pl.edu.agh.iosr.twitter.dto;
import twitter4j.GeoLocation;
import twitter4j.User;
import java.util.Date;
/**
* Created by radoslawdyrda on 11.05.2015.
*/
public class TweetDTO {
private String text;
private GeoLocation location;
private Long id;
private Long createdAt;
public TweetDTO(String text, GeoLocation location, Long id, Long createdAt, User user) {
this.text = text;
this.location = location;
this.id = id;
this.createdAt = createdAt;
}
public TweetDTO() {
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public GeoLocation getLocation() {
return location;
}
public void setLocation(GeoLocation location) {
this.location = location;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
}
| [
"raddyr@gmail.com"
] | raddyr@gmail.com |
a510b36c6d56260e12e78904544ed30eea59a050 | 632e2656b7743f6f1deb0bd061c26552bf073e67 | /SpeedSweeper/app/src/main/java/com/app/speedsweeper/speedsweeper/Board.java | 5cb0fcde0f85b35b825328e3042d5259f8e393e2 | [] | no_license | TrueFiction/SpeedSweeper | e71354ade007561ab56da7c7aeabadbc9c4adfaf | 12af7d7908067e207bfc323c817174271f16004a | refs/heads/master | 2021-01-10T15:16:23.847725 | 2015-11-21T15:39:07 | 2015-11-21T15:39:07 | 45,298,499 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,397 | java | package com.app.speedsweeper.speedsweeper;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.GridView;
import org.w3c.dom.Attr;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.ArrayList;
/**
* Board is going to call actions that only occur on create.
*/
public class Board extends GridView {
// Number of rows specified for this instance of board.
int rows;
// Number of columns specified for this instance of board.
int columns;
// Total number of bombs that this board contains.
int allBombs;
// Random object for improved gameplay (see plantBombs).
Random rand = new Random();
public Board(Context context, AttributeSet attrs) {
super(context, attrs);
setBoardAttributes(attrs);
this.rows = 8;
this.columns = 7;
this.allBombs = 7;
}
private void setBoardAttributes(AttributeSet attrs){
TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.Board, 0, 0);
try {
rows = a.getInt(R.styleable.Board_rows, 8);
columns = a.getInt(R.styleable.Board_columns, 7);
allBombs = a.getInt(R.styleable.Board_allBombs, 7);
} finally {
a.recycle();
}
}
public void layDownBoard(){
populateTileCollection();
selectBombPositions();
plantBombs();
}
private ArrayList<Tile> tiles = new ArrayList<>();
/*
If the app is run now, the error would occur here. From time to time I decided to have this method
operate on Views or Buttons in order to check the functionality of the code beyond this.
*/
public void populateTileCollection() {
int index = 0;
for (int y = 0; y < getRowCount(); y++) {
for (int x = 0; x < getColumnCount(); x++) {
Tile tile = (Tile)findViewById(R.id.tile);
tile.setIndex(index);
tile.setYCoordinate(y);
tile.setXCoordinate(x);
tiles.add(tile);
index++;
}
}
}
/*
Upon looking at the following method, it seems as if it might be a better idea to pass Tile data
from class to class by passing primitive data rather than by passing objects.
*/
private int[] selectBombPositions() {
int[] bombPositions = new int[allBombs];
for (int x = 0; x < allBombs; x++) {
bombPositions[x] = rand.nextInt(tiles.size());
}
return bombPositions;
}
/*
This method sets a variable specific to Tile, isBomb, to true or false and then marks the
surrounding tiles with setCautionTiles method. No errors here.
*/
public void plantBombs() {
for (int x : selectBombPositions()) {
tiles.get(x).setBomb(true);
setCautionTiles(tiles.get(x));
}
}
/*
Returns the total number of rows. Note that the value returned will be (1 + highestYCoordinate)
*/
public int getRowCount() {
return columns;
}
/*
This will be used if the user initiates a new game action event, whether within GameActivity or
from prospective HomeActivity.
*/
public void setRowCount(int r) {
columns = r;
}
/*
Returns the total number of columns. (1 + highestXCoordinate)
*/
public int getColumnCount() {
return rows;
}
// Mimics setRowCount, performs calculations on rows.
public void setColumnCount(int c) {
rows = c;
}
/*
It is this method that makes use of the Tile subclass the most.
*/
public void setCautionTiles(Tile focusTile) {
int focusPosition = focusTile.getIndex();
ArrayList<Tile> scannerList = new ArrayList<>();
for (Tile tile : tiles) {
scannerList.add(tile);
}
scan(scannerList, focusPosition);
}
public void scan(ArrayList<Tile> scannerList, int focusPosition) {
/*
The first block here checks the very top row. The values should be set dynamically.
*/
if (focusPosition <= this.getRowCount() - 1) {
if (focusPosition != 0 && focusPosition != getRowCount() - 1) {
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
scannerList.get(focusPosition + getRowCount() + 1).addBombToCount();
} else if (focusPosition == 0) {
scannerList.get(focusPosition + 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
scannerList.get(focusPosition + getRowCount() + 1).addBombToCount();
} else if (focusPosition == getRowCount() - 1) {
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
}
/*
The middle block checks the very bottom row. Values set dynamically.
*/
} else if (focusPosition >= ((getColumnCount() - 1) * (getRowCount()))) {
if (focusPosition != ((getColumnCount() - 1) * (getRowCount()))
&& focusPosition != ((getRowCount() * getColumnCount()) - 1)) {
scannerList.get(focusPosition + 1).addBombToCount();
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount()).addBombToCount();
scannerList.get(focusPosition - getRowCount() + 1).addBombToCount();
} else if (focusPosition == ((getColumnCount() - 1) * (getRowCount()))) {
scannerList.get(focusPosition + 1).addBombToCount();
scannerList.get(focusPosition - getRowCount()).addBombToCount();
scannerList.get(focusPosition - getRowCount() + 1).addBombToCount();
} else if (focusPosition == ((getRowCount() * getColumnCount()) - 1)) {
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount()).addBombToCount();
}
/*
Last block checks for all other tiles, dynamically.
*/
} else {
if ((focusPosition % getRowCount()) == 0 && focusPosition >= getRowCount()) {
scannerList.get(focusPosition - getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount()).addBombToCount();
scannerList.get(focusPosition + 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
scannerList.get(focusPosition + getRowCount() + 1).addBombToCount();
} else if ((focusPosition % getRowCount()) == getRowCount() - 1 && focusPosition >= getRowCount()) {
scannerList.get(focusPosition - getRowCount()).addBombToCount();
scannerList.get(focusPosition - getRowCount() + 1).addBombToCount();
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
} else {
scannerList.get(focusPosition + 1).addBombToCount();
scannerList.get(focusPosition - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition - getRowCount()).addBombToCount();
scannerList.get(focusPosition - getRowCount() + 1).addBombToCount();
scannerList.get(focusPosition + getRowCount() - 1).addBombToCount();
scannerList.get(focusPosition + getRowCount()).addBombToCount();
scannerList.get(focusPosition + getRowCount() + 1).addBombToCount();
}
}
}
}
| [
"sbraaten95@gmail.com"
] | sbraaten95@gmail.com |
8ced7bf0d69619c021c9687fd50420e5cdf92352 | 80fdf6a2fbaa774a9b10740642081a2e14f5f3c9 | /src/controllers/CreateServlet.java | cf2f8553cab7de52d99a146a225bd2ed83e07c40 | [] | no_license | fujinoshinyu/tasklist-git | 6ca7a9903ccbd13cc2980ca024a96c579d634b4e | 9546c623ec72e33e4523cd361f6172fdce5cf347 | refs/heads/main | 2023-03-11T05:24:57.314101 | 2021-02-28T11:41:00 | 2021-02-28T11:41:00 | 343,091,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,589 | java | package controllers;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.List;
import javax.persistence.EntityManager;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import models.Message;
import utils.DBUtil;
import validators.MessageValidator;
/**
* Servlet implementation class CreateServlet
*/
@WebServlet("/create")
public class CreateServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public CreateServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String _token=request.getParameter("_token");
if(_token !=null && _token.equals(request.getSession().getId())){
EntityManager em=DBUtil.createEntityManager();
Message m=new Message();
String content=request.getParameter("content");
m.setContent(content);
Timestamp currentTime = new Timestamp(System.currentTimeMillis());
m.setCreated_at(currentTime);
m.setUpdated_at(currentTime);
// バリデーションを実行してエラーがあったら新規登録のフォームに戻る
List<String> errors =MessageValidator.validate(m);
if(errors.size() > 0) {
em.close();
// フォームに初期値を設定、さらにエラーメッセージを送る
request.setAttribute("_token", request.getSession().getId());
request.setAttribute("message", m);
request.setAttribute("errors", errors);
RequestDispatcher rd = request.getRequestDispatcher("/WEB-INF/views/messages/new.jsp");
rd.forward(request, response);
} else {
// データベースに保存
em.getTransaction().begin();
em.persist(m);
em.getTransaction().commit();
request.getSession().setAttribute("flush", "登録が完了しました。");
em.close();
response.sendRedirect(request.getContextPath() + "/index");
}
}
}
} | [
"sincan.1911@gmail.com"
] | sincan.1911@gmail.com |
51763fffc90a24f38620d5080ffffd5bc41f4470 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/23/23_67530fe10a5b83da3780b23d977b809bf82221fb/BlockRedNetLogic/23_67530fe10a5b83da3780b23d977b809bf82221fb_BlockRedNetLogic_t.java | 9ff762dbc0294cc998f6881d73d60dd8c298724c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,007 | java | package powercrystals.minefactoryreloaded.block;
import java.util.ArrayList;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import powercrystals.minefactoryreloaded.MineFactoryReloadedCore;
import powercrystals.minefactoryreloaded.api.rednet.IConnectableRedNet;
import powercrystals.minefactoryreloaded.api.rednet.RedNetConnectionType;
import powercrystals.minefactoryreloaded.core.BlockNBTManager;
import powercrystals.minefactoryreloaded.core.MFRUtil;
import powercrystals.minefactoryreloaded.gui.MFRCreativeTab;
import powercrystals.minefactoryreloaded.item.ItemLogicUpgradeCard;
import powercrystals.minefactoryreloaded.item.ItemRedNetMemoryCard;
import powercrystals.minefactoryreloaded.item.ItemRedNetMeter;
import powercrystals.minefactoryreloaded.tile.rednet.TileEntityRedNetLogic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockRedNetLogic extends BlockContainer implements IConnectableRedNet
{
private int[] _sideRemap = new int[] { 3, 1, 2, 0 };
public BlockRedNetLogic(int id)
{
super(id, Material.clay);
setUnlocalizedName("mfr.rednet.logic");
setHardness(0.8F);
setCreativeTab(MFRCreativeTab.tab);
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entity, ItemStack stack)
{
if(entity == null)
{
return;
}
TileEntity te = world.getBlockTileEntity(x, y, z);
if(te instanceof TileEntityRedNetLogic)
{
int facing = MathHelper.floor_double((entity.rotationYaw * 4F) / 360F + 0.5D) & 3;
if(facing == 0)
{
world.setBlockMetadataWithNotify(x, y, z, 3, 3);
}
else if(facing == 1)
{
world.setBlockMetadataWithNotify(x, y, z, 0, 3);
}
else if(facing == 2)
{
world.setBlockMetadataWithNotify(x, y, z, 1, 3);
}
else if(facing == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 2, 3);
}
if(stack.hasTagCompound())
{
stack.getTagCompound().setInteger("x", x);
stack.getTagCompound().setInteger("y", y);
stack.getTagCompound().setInteger("z", z);
te.readFromNBT(stack.getTagCompound());
}
}
}
@Override
public void breakBlock(World world, int x, int y, int z, int blockId, int meta)
{
BlockNBTManager.setForBlock(world.getBlockTileEntity(x, y, z));
super.breakBlock(world, x, y, z, blockId, meta);
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileEntityRedNetLogic();
}
@Override
public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side)
{
TileEntityRedNetLogic logic = (TileEntityRedNetLogic)world.getBlockTileEntity(x, y, z);
if(logic != null && side.ordinal() > 1 && side.ordinal() < 6)
{
if(world.getBlockMetadata(x, y, z) == _sideRemap[side.ordinal() - 2])
{
return RedNetConnectionType.None;
}
}
return RedNetConnectionType.CableAll;
}
@Override
public int getOutputValue(World world, int x, int y, int z, ForgeDirection side, int subnet)
{
TileEntityRedNetLogic logic = (TileEntityRedNetLogic)world.getBlockTileEntity(x, y, z);
if(logic != null)
{
return logic.getOutputValue(side, subnet);
}
else
{
return 0;
}
}
@Override
public int[] getOutputValues(World world, int x, int y, int z, ForgeDirection side)
{
TileEntityRedNetLogic logic = (TileEntityRedNetLogic)world.getBlockTileEntity(x, y, z);
if(logic != null)
{
return logic.getOutputValues(side);
}
else
{
return new int[16];
}
}
@Override
public void onInputsChanged(World world, int x, int y, int z, ForgeDirection side, int[] inputValues)
{
TileEntityRedNetLogic logic = (TileEntityRedNetLogic)world.getBlockTileEntity(x, y, z);
if(logic != null)
{
logic.onInputsChanged(side, inputValues);
}
}
@Override
public void onInputChanged(World world, int x, int y, int z, ForgeDirection side, int inputValue)
{
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset)
{
PlayerInteractEvent e = new PlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, x, y, z, side);
if(MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.useBlock == Result.DENY)
{
return false;
}
if(MFRUtil.isHoldingHammer(player))
{
int nextMeta = world.getBlockMetadata(x, y, z) + 1;
if(nextMeta > 3)
{
nextMeta = 0;
}
world.setBlockMetadataWithNotify(x, y, z, nextMeta, 3);
return true;
}
else if(MFRUtil.isHolding(player, ItemLogicUpgradeCard.class))
{
TileEntityRedNetLogic logic = (TileEntityRedNetLogic)world.getBlockTileEntity(x, y, z);
if(logic != null)
{
if(logic.insertUpgrade(player.inventory.getCurrentItem().getItemDamage() + 1));
{
if(!player.capabilities.isCreativeMode)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
return true;
}
}
return false;
}
else if(!MFRUtil.isHolding(player, ItemRedNetMeter.class) && !MFRUtil.isHolding(player, ItemRedNetMemoryCard.class))
{
player.openGui(MineFactoryReloadedCore.instance(), 0, world, x, y, z);
return true;
}
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
blockIcon = ir.registerIcon("powercrystals/minefactoryreloaded/" + getUnlocalizedName());
}
@Override
public int getRenderType()
{
return MineFactoryReloadedCore.renderIdRedNetLogic;
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean isBlockNormalCube(World world, int x, int y, int z)
{
return false;
}
@Override
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
{
return true;
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
{
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
ItemStack prc = new ItemStack(idDropped(blockID, world.rand, fortune), 1, damageDropped(0));
prc.setTagCompound(BlockNBTManager.getForBlock(x, y, z));
drops.add(prc);
return drops;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
42d1f5e8fca60b6d845186accb25a3586f94416b | 2b7fd1a1fb4d913e5c47c9347c4faef6add797ff | /src/main/java/otherclasses/Student.java | 5d3f1cb601eec86268989b22ef43d5006d84a431 | [] | no_license | IvanaSE/Classroom_Rafaels | 924ad43f13396ad5cb48b97a23a25467d91f7870 | 4bd31377a01883e390a72a91c35894f2997da061 | refs/heads/master | 2021-01-17T17:46:29.922024 | 2016-10-12T20:17:11 | 2016-10-12T20:17:11 | 70,576,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,893 | java | package otherclasses;
import java.text.DecimalFormat;
public class Student extends Person {
//Attributes
private double firstGrade = 0.0;
private double secondGrade= 0.0;
private double thirdGrade= 0.0;
private double averageGrade= 0.0;
//Constructors
public Student(String firstName, String lastName, int age, char gender) {
super(firstName, lastName,age, gender);
}
public Student( String firstName, String lastName, int age, char gender, double firstGrade, double secondGrade,
double thirdGrade) {
super(firstName, lastName, age, gender);
this.firstGrade = firstGrade;
this.secondGrade = secondGrade;
this.thirdGrade = thirdGrade;
}
//Getters and setters
public double getFirstGrade() {
return firstGrade;
}
public void setFirstGrade(double firstGrade) {
this.firstGrade = firstGrade;
}
public double getSecondGrade() {
return secondGrade;
}
public void setSecondGrade(double secondGrade) {
this.secondGrade = secondGrade;
}
public double getThirdGrade() {
return thirdGrade;
}
public void setThirdGrade(double thirdGrade) {
this.thirdGrade = thirdGrade;
}
public double getAverageGrade() {
return averageGrade;
}
public void setAverageGrade(double averageGrade) {
this.averageGrade = averageGrade;
}
public double calculateAverage(double firstGrade){
double sum = firstGrade +secondGrade +thirdGrade;
double average = sum /3;
this.setAverageGrade(average);
return average;
}
public double calculateAverage(){
double sum = this.firstGrade +this.secondGrade +this.thirdGrade;
double average = sum /3;
this.setAverageGrade(average);
return average;
}
public double calculateAverage(double firstGrade, double secondGrade, double thirdGrade){
double sum = firstGrade +secondGrade +thirdGrade;
double average = sum /3;
this.setAverageGrade(average);
return average;
}
public boolean hasClearedTheCourse(){
if (this.getAverageGrade() >=6.0){
return true;
}
return false;
}
//ToString()
public String toString() {
calculateAverage(this.getFirstGrade(), getSecondGrade(), getThirdGrade());
DecimalFormat df = new DecimalFormat("#.0");
if (hasClearedTheCourse()) {
return "Student: " + getFirstName() + " " + getLastName() + "\n" + "Grades: " + this.firstGrade + " , "
+ this.secondGrade + " , " + this.thirdGrade + "\nFinalGrade: " + df.format(this.averageGrade)
+ "\nThe student has cleared the course\n-----------------------";
}
return "Student: " + getFirstName() + " " + getLastName() + "\n" + "Grades: " + this.firstGrade + " , "
+ this.secondGrade + " , " + this.thirdGrade + "\nFinalGrade: " + df.format(this.getAverageGrade())
+ "\nThe student has not cleared the course\n-----------------------";
}
} | [
"ivana.zdujic@nackademin.se"
] | ivana.zdujic@nackademin.se |
ecdb36840374acd366b155c3f5fd6a633581c263 | c717ccc8463ad501e53bdd347516a1311dc2efe4 | /Braille/app/src/main/java/com/example/miseon/braille/StudySymbolActivity.java | 0aef233ac3ea63756f9d1f1ab56ca50bbcd1dea4 | [] | no_license | 11mia/zoljak | 0f47f58e8ff681fd880d676173f2d794a0c210a1 | 68512ff9b6dd8d473a872867047293fb6870e205 | refs/heads/master | 2021-09-13T14:48:20.880003 | 2018-05-01T11:36:09 | 2018-05-01T11:36:09 | 116,907,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 825 | java | package com.example.miseon.braille;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
/**
* Created by miseon on 2018-01-15.
*/
public class StudySymbolActivity extends AppCompatActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_study_symbol);
setTitle("문장부호");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
//onBackPressed();
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"kangms6828@naver.com"
] | kangms6828@naver.com |
6f33b786eb074b79e53751fce2a51b126d0ce74d | 1c45871a066f0e5bcbec96951582df20a1ca59e3 | /weatherforcast/src/main/java/com/weather/forcast/utilies/EmployeeHelper.java | dc50adae1bfa7653af353f237db024f08580c26b | [] | no_license | fathyelshemy/OpenWeather | a4fe5ebfba0a071fc1055d46da1025c59aca43cb | 2c3eb5a22152bb0aa6507661eef451519bd9bff5 | refs/heads/master | 2023-06-19T12:15:15.835433 | 2019-12-01T21:33:37 | 2019-12-01T21:33:37 | 385,681,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package com.weather.forcast.utilies;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.weather.forcast.model.Employee;
@Component
public class EmployeeHelper {
private final Logger logger =LoggerFactory.getLogger(this.getClass());
public Employee getEmployee(String employeeStr) {
logger.info(Constants.CLASS_NAME+this.getClass().getName()+Constants.METHOD_NAME+new Object() {}.getClass().getEnclosingMethod().getName());
logger.debug(Constants.METHOD_ARGUMENTS+employeeStr);
JSONObject employeeJson= new JSONObject(employeeStr);
Employee employee= new Employee();
employee.setEmail(employeeJson.getString("email"));
employee.setUsername(employeeJson.getString("username"));
employee.setMobileNumber(employeeJson.getString("mobileNumber"));
employee.setPassword(employeeJson.getString("password"));
logger.info(Constants.METHOD_RETURN+employee.toString());
logger.info(Constants.END_METHOD);
return employee;
}
public String getEmail(String emailStr) {
logger.info(Constants.CLASS_NAME+this.getClass().getName()+Constants.METHOD_NAME+new Object() {}.getClass().getEnclosingMethod().getName());
logger.debug(Constants.METHOD_ARGUMENTS+emailStr);
JSONObject json= new JSONObject(emailStr);
String email=json.getString("email");
logger.info(Constants.METHOD_RETURN+email);
logger.info(Constants.END_METHOD);
return email;
}
}
| [
"fathyelshemy8@gmail.com"
] | fathyelshemy8@gmail.com |
1b682d5cdc4c765b73b8cd83b8796efc671eb96f | 146ab29e1d12a238c01019bb0c331790d97ecde7 | /src/main/java/com/mashibing/controller/base/TblDbbackupController.java | 42af3779ff870dd9721c32a2f6eb395f63f7dc8f | [] | no_license | DT0352/family_service | 9d4477af02e934614bc710b1f3f54bed1fe5856b | 50dc5801dd74c0030f80f0c9a0588106174d0d40 | refs/heads/master | 2023-02-16T14:31:22.413132 | 2021-01-09T07:37:47 | 2021-01-09T07:37:47 | 328,101,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.mashibing.controller.base;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
* <p>
* 数据库备份 前端控制器
* </p>
*
* @author lian
* @since 2021-01-09
*/
@Controller
@RequestMapping("/tblDbbackup")
public class TblDbbackupController {
}
| [
"18535222330fzd@gmail.com"
] | 18535222330fzd@gmail.com |
668b6a9417f8679b15925dcad9bbb9df40c0645f | b9f0660e136e46ddf9aa986ec77bcd453a568af3 | /src/blbutil/BlockLineReader.java | 4fe62ccfe0fb6f9f34a0a591bc26817bb6f1a343 | [
"Apache-2.0"
] | permissive | browning-lab/hap-ibd | ebab7dddc30e657416dccc8f0a7e399b30c41b5c | a3fdd2d6294903387ee29d2f67ce6260593b681f | refs/heads/master | 2023-06-24T20:51:41.467168 | 2023-06-16T00:29:06 | 2023-06-16T00:29:06 | 227,753,402 | 34 | 10 | null | 2022-11-12T04:40:29 | 2019-12-13T04:08:25 | Java | UTF-8 | Java | false | false | 6,734 | java | /*
* Copyright 2019 Brian L. Browning
*
* This file is part of the HapIbd program.
*
* 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 blbutil;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
/**
* <p>Class {@code BlockLineReader} is a {@code blbutil.FileIt} that reads
* blocks of lines from a file. The order of lines in the source file is
* preserved by the returned string arrays. The {@code hasNext()} method
* always returns {@code true}. After the final block of lines is returned
* by the {@code next()} method, the {@code next()} method returns
* {@code BlockLineReader.SENTINAL} on all subsequent invocations.
* {@code BlockLineReader.SENTINAL} is guaranteed to be the only returned
* array that has length 0.
*
* <p>Instances of class {@code BlockLineReader} are thread-safe.</p>
*
* <p>Methods of this class will terminate the Java Virtual Machine with
* an error message if an I/O Exception is encountered.
* </p>
*
* @author Brian L. Browning {@code <browning@uw.edu>}
*/
public class BlockLineReader implements FileIt<String[]> {
/**
* The string array returned by {@code next()} after all blocks
* of lines have been read.
*/
public static String[] SENTINAL = new String[0];
private final FileIt<String> it;
private final LinkedBlockingDeque<String[]> q;
private final int blockSize;
private final ExecutorService fileReaderService;
private final CountDownLatch latch;
private volatile boolean shutDownNow;
/**
* Constructs and returns a new {@code BlockLineReader} for the specified
* data. The {@code close()} method of the returned object will invoke the
* {@code close()} method on the specified {@code FileIt<String>} iterator.
* The calling thread should not directly invoke any methods of the
* specified {@code FileIt<String>} after it is passed to the
* {@code BlockLineReader.create()} method.
* @param it a file iterator that returns the lines of text
* @param blockSize the maximum length a string array returned by
* {@code next()}
* @param nBlocks the maximum number of non-empty string arrays that will be
* buffered
* @return a {@code BlockLineReader} for the specified data.
* @throws IllegalArgumentException if {@code blockSize < 1 || nBlocks < 1}
* @throws NullPointerException if {@code it == null}
*/
public static BlockLineReader create(FileIt<String> it, int blockSize,
int nBlocks) {
BlockLineReader reader = new BlockLineReader(it, blockSize, nBlocks);
reader.startFileReadingThread();
return reader;
}
private BlockLineReader(FileIt<String> it, int blockSize, int nBlocks) {
if (blockSize<1) {
throw new IllegalArgumentException(String.valueOf(blockSize));
}
if (nBlocks<1) {
throw new IllegalArgumentException(String.valueOf(nBlocks));
}
this.it = it;
this.q = new LinkedBlockingDeque<>(nBlocks);
this.blockSize = blockSize;
this.fileReaderService = Executors.newSingleThreadExecutor();
this.latch = new CountDownLatch(1);
this.shutDownNow = false;
}
private void startFileReadingThread() {
fileReaderService.submit(() -> {
try {
List<String> buffer = new ArrayList<>(blockSize);
while (it.hasNext()) {
buffer.add(it.next());
if (buffer.size()==blockSize) {
flushBuffer(buffer);
if (shutDownNow) {
break;
}
}
}
if (buffer.size()>0) {
flushBuffer(buffer);
}
latch.countDown();
MultiThreadUtils.putInBlockingQ(q, SENTINAL);
}
catch (Throwable t) {
Utilities.exit(t);
}
});
}
/*
* Returns {@code false} if no more blocks of lines will be enqueued.
*/
private void flushBuffer(List<String> buffer) {
String[] sa = buffer.toArray(new String[0]);
buffer.clear();
boolean success = false;
while (success==false && shutDownNow==false) {
success = MultiThreadUtils.putInBlockingQ(q, sa, 100,
TimeUnit.MILLISECONDS);
}
}
@Override
public File file() {
return it.file();
}
@Override
public void close() {
shutDownNow = true;
MultiThreadUtils.await(latch);
it.close();
String[] tail = q.pollLast();
while (tail!=null && tail!=SENTINAL) {
tail = q.pollLast();
}
if (tail==SENTINAL) {
boolean success = q.offer(SENTINAL);
assert success;
}
MultiThreadUtils.shutdownExecService(fileReaderService);
}
/**
* Returns the next element in the iteration.
* @return the next element in the iteration
* @throws java.util.NoSuchElementException if the iteration has no more elements
*/
@Override
public boolean hasNext() {
return true;
}
/**
* Returns {@code true} if the iteration has more elements, and returns
* {@code false} otherwise.
* @return {@code true} if the iteration has more elements
*/
@Override
public String[] next() {
assert hasNext();
String[] value = MultiThreadUtils.takeFromBlockingQ(q);
if (value==SENTINAL) {
boolean success = q.offer(SENTINAL);
assert success;
}
return value;
}
/**
* The {@code remove} method is not supported by this iterator.
* @throws UnsupportedOperationException if this method is invoked
*/
@Override
public void remove() {
throw new UnsupportedOperationException(this.getClass().toString());
}
}
| [
"browning@uw.edu"
] | browning@uw.edu |
5cee3787a839c17800d30344becdbfbac6815451 | 2e83c709f188eaafbeb7b910b0955f5465f6077a | /shop-server/src/test/java/com/lifeng/shopserver/ShopServerApplicationTests.java | 113afca76e38edc56b726d28a19463fc22f7983f | [] | no_license | a745111345/vueshop | aed08a3b39f5b5ccd72eb3a32a98358d6dd639d0 | 071d11d4828bfaab9cfefcb50a14bedf024b4e9e | refs/heads/master | 2023-08-04T13:14:45.947941 | 2021-09-16T16:39:55 | 2021-09-16T16:39:55 | 407,237,301 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,511 | java |
package com.lifeng.shopserver;
import com.lifeng.shopserver.Tools.TimeTool;
import com.lifeng.shopserver.pojo.entry.History;
import com.lifeng.shopserver.service.HistoryService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@SpringBootTest
class ShopServerApplicationTests {
@Autowired
private HistoryService historyService;
@Test
void contextLoads() {
}
@Test
void InsertHistoryTest(){
History history = new History();
history.setCategory("饮料");
history.setGoodsid(101);
history.setUserid(196);
history.setDate(TimeTool.getTime());
System.out.println(history.toString());
System.out.println(historyService.insertHistory(history));
}
@Test
void SelectHistoryTest(){
ArrayList<History> res = historyService.selectHistoryByUserId(1,0);
if(res==null){
System.out.println("未查询到数据");
}else {
for (History re : res) {
System.out.println(re.toString());
}
}
}
@Test
void DeleteHistoryByDateListTest(){
List<String> dateList = new ArrayList<>();
dateList.add("2021-08-08 10:49:23");
int userid = 1;
System.out.println(historyService.deleteHistoryByDateList(userid,dateList));
}
}
| [
"745111345@qq.com"
] | 745111345@qq.com |
ee7defb8a7e35db819fb313db8dbafe402d14b60 | 6e33005c639d0d806b20fd2dadb273e29174f1e1 | /com.zh.myapp/dzpiclibrary/src/main/java/me/iwf/photopicker/adapter/PhotoHoriAdapter.java | b97f08fe729b046e86ccc2a75a463b57665c6012 | [] | no_license | Zhhang2016/MyApp | 935743a2c38c4acacfdb21f0b5256a7acf927b3a | bb39842fdbe5f7b1b831a8681079df855a881bc6 | refs/heads/master | 2018-07-12T17:18:35.570834 | 2018-06-01T10:08:03 | 2018-06-01T10:08:03 | 107,745,845 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,011 | java | package me.iwf.photopicker.adapter;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.ArrayList;
import me.iwf.photopicker.PhotoPickUtils;
import me.iwf.photopicker.PhotoPreview;
import me.iwf.photopicker.R;
import me.iwf.photopicker.utils.BimpUtils;
import me.iwf.photopicker.utils.CommonUtils;
import me.iwf.photopicker.utils.ImagePreference;
import me.iwf.photopicker.utils.LoadingImgUtil;
import me.iwf.photopicker.widget.MultiPickResultView;
/**
* Created by liuyuan on 2016/9/12 0012.
*/
public class PhotoHoriAdapter extends RecyclerView.Adapter<PhotoHoriAdapter.PhotoHoriViewHolder> {
private LayoutInflater inflater;
private ArrayList<String> photoPaths;
private int PhotoCount;
private Context mContext;
private int action;
private ImagePreference instance;
private boolean isCrop = false;
public void setCrop(boolean crop) {
isCrop = crop;
}
public PhotoHoriAdapter(Context mContext, ArrayList<String> photoPaths) {
this.photoPaths = photoPaths;
this.mContext = mContext;
inflater = LayoutInflater.from(mContext);
instance = ImagePreference.getInstance(mContext);
}
public int getPhotoCount() {
return PhotoCount;
}
public void add(ArrayList<String> photoPaths) {
if (photoPaths != null && photoPaths.size() > 0) {
this.photoPaths.addAll(photoPaths);
notifyDataSetChanged();
}
}
public void refresh(ArrayList<String> photoPaths) {
this.photoPaths.clear();
if (photoPaths != null && photoPaths.size() > 0) {
this.photoPaths.addAll(photoPaths);
}
notifyDataSetChanged();
}
public void setPhotoCount(int photoCount) {
PhotoCount = photoCount;
}
@Override
public PhotoHoriViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = inflater.inflate(R.layout.__picker_horiitem, parent, false);
return new PhotoHoriViewHolder(itemView);
}
@Override
public void onBindViewHolder(PhotoHoriViewHolder holder, final int position) {
if (action == MultiPickResultView.ACTION_SELECT) {
if (position == getItemCount() - 1) {//最后一个始终是+号,点击能够跳去添加图片
if (instance.getImagesList(ImagePreference.DRR).size() == instance.getPhotoCount()) {
// Uri uri = Uri.fromFile(new File(photoPaths.get(position)));
// Glide.with(application)
// .load(uri)
// .centerCrop()
// .thumbnail(0.1f)
// .override(150, 150)
// .placeholder(R.drawable.__picker_default_weixin)
// .error(R.drawable.__picker_ic_broken_image_black_48dp)
// .into(holder.ivPhoto);
LoadingImgUtil.displayImage(holder.ivPhoto, photoPaths.get(position), new LoadingImgUtil.ImageSize(150, 150), 0.1f, false, false);
} else {
//预留的添加默认图位置
if (BimpUtils.ADDPICCON.equals("")) {
// Glide.with(application)
// .load("")
// .centerCrop()
// .thumbnail(0.1f)
//// .override(100, 100)
// .placeholder(R.drawable.addphoto)
// .error(R.drawable.addphoto)
// .into(holder.ivPhoto);
holder.ivPhoto.setImageResource(R.drawable.addphoto);
// LoadingImgUtil.displayImage(holder.ivPhoto, "", 0.1f, R.drawable.addphoto);
} else {
// Glide.with(application)
// .load("")
// .centerCrop()
// .thumbnail(0.1f)
//// .override(100, 100)
// .placeholder(R.drawable.addphoto)
// .error(R.drawable.addphoto)
// .into(holder.ivPhoto);
holder.ivPhoto.setImageResource(R.drawable.addphoto);
// LoadingImgUtil.displayImage(holder.ivPhoto, "", 0.1f, R.drawable.addphoto);
}
}
holder.ivPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (photoPaths != null && photoPaths.size() == instance.getPhotoCount()) {
PhotoPreview.builder()
.setPhotos(photoPaths)
.setAction(action)
.setCurrentItem(position)
.start2((Activity) mContext);
} else {
// PhotoPickUtils.startPick((Activity) application, BimpUtils.drr);
if (CommonUtils.checkPermission((Activity) mContext, null, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 30)) {
return;
}
PhotoPickUtils.startPickWithCount((Activity) mContext, instance.getImagesList(ImagePreference.DRR), getPhotoCount(), isCrop);
}
}
});
} else {
//String str = photoPaths.get(position);
// Uri uri = Uri.fromFile(new File(photoPaths.get(position)));
// Glide.with(application)
// .load(uri)
// .centerCrop()
// .thumbnail(0.1f)
// .override(150, 150)
// .placeholder(R.drawable.__picker_default_weixin)
// .error(R.drawable.__picker_ic_broken_image_black_48dp)
// .into(holder.ivPhoto);
LoadingImgUtil.displayImage(holder.ivPhoto, photoPaths.get(position), new LoadingImgUtil.ImageSize(150, 150), 0.1f);
holder.ivPhoto.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PhotoPreview.builder()
.setPhotos(photoPaths)
.setAction(action)
.setCurrentItem(position)
.start2((Activity) mContext);
}
});
}
} else if (action == MultiPickResultView.ACTION_ONLY_SHOW) {
// Uri uri = Uri.fromFile(new File(photoPaths.get(position)));
// Uri uri = Uri.parse(photoPaths.get(position));
try {
// LoadingImgUtil.loadingLocalImage(ImageDownloader.Scheme.FILE.wrap(photoPaths.get(position)), new ImageSize(50, 50), holder.ivPhoto);
// Glide.with(application)
// .load(uri)
// .placeholder(R.drawable.__picker_default_weixin)
// .error(R.drawable.__picker_ic_broken_image_black_48dp)
// .into(holder.ivPhoto);
LoadingImgUtil.displayImage(holder.ivPhoto, photoPaths.get(position));
} catch (Exception e) {
}
// holder.ivPhoto.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
//
// PhotoPreview.builder()
// .setPhotos(photoPaths)
// .setAction(action)
// .setCurrentItem(position)
// .start((Activity) application);
// }
// });
}
}
@Override
public int getItemCount() {
if (photoPaths.size() == instance.getPhotoCount()) {
return instance.getPhotoCount();
} else {
return action == MultiPickResultView.ACTION_SELECT ? photoPaths.size() + 1 : photoPaths.size();
}
}
public void setAction(@MultiPickResultView.MultiPicAction int action) {
this.action = action;
}
public static class PhotoHoriViewHolder extends RecyclerView.ViewHolder {
private ImageView ivPhoto;
public PhotoHoriViewHolder(View itemView) {
super(itemView);
ivPhoto = (ImageView) itemView.findViewById(R.id.img);
}
}
}
| [
"zhaoh@126.com"
] | zhaoh@126.com |
b316265c2afbe567b0e9a2d5994053bb2250ef84 | 9dc015c834810d5955f5beb1701a60ea74c1b41b | /basics/src/OnlineOrder/Orderable.java | 2905f1f9205fb9fedb1124df56db644adfc78a98 | [] | no_license | aurelijadro/JavaClasswork | 192216a66d7723f73ed35aaa4a6a39d4b0e77c56 | 1a1c2b6ca72e1fd1d1681626fadd9dcb6d40db38 | refs/heads/master | 2020-08-12T00:38:26.202780 | 2019-11-17T13:34:01 | 2019-11-17T13:34:01 | 214,656,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 84 | java | package OnlineOrder;
public interface Orderable {
double calculateOrderPrice();
}
| [
"a.drobelyte@gmail.com"
] | a.drobelyte@gmail.com |
726755b9dd19c72ecc1ec46efc5b3d471970bcb6 | 04ac638cc2851e216b6edd6578df19ae599f156c | /results/Nopol-Test-Runing-Result/math/57/193/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint_ESTest.java | 6f4e9620e2d7c5884c48d978f8c1fcdebb0cf25c | [] | no_license | tdurieux/test4repair-experiments | 9f719d72de7d67b53b7e7936b21763dbd2dc48d0 | c90e85a1c3759b4c40f0e8f7468bd8213c729674 | refs/heads/master | 2021-01-25T05:10:07.540557 | 2017-06-06T12:25:20 | 2017-06-06T12:25:20 | 93,516,208 | 0 | 0 | null | 2017-06-06T12:32:05 | 2017-06-06T12:32:05 | null | UTF-8 | Java | false | false | 8,067 | java | package org.apache.commons.math.stat.clustering;
public class EuclideanIntegerPoint_ESTest extends org.apache.commons.math.stat.clustering.EuclideanIntegerPoint_ESTest_scaffolding {
@org.junit.Test(timeout = 4000)
public void test00() throws java.lang.Throwable {
int[] intArray0 = new int[9];
intArray0[6] = -1;
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
euclideanIntegerPoint0.hashCode();
}
@org.junit.Test(timeout = 4000)
public void test01() throws java.lang.Throwable {
int[] intArray0 = new int[9];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = new int[9];
intArray1[6] = 8;
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray1);
boolean boolean0 = euclideanIntegerPoint0.equals(euclideanIntegerPoint1);
org.junit.Assert.assertFalse(boolean0);
org.junit.Assert.assertFalse(euclideanIntegerPoint1.equals(((java.lang.Object)(euclideanIntegerPoint0))));
}
@org.junit.Test(timeout = 4000)
public void test02() throws java.lang.Throwable {
int[] intArray0 = new int[2];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = new int[9];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray1);
boolean boolean0 = euclideanIntegerPoint0.equals(euclideanIntegerPoint1);
org.junit.Assert.assertFalse(boolean0);
}
@org.junit.Test(timeout = 4000)
public void test03() throws java.lang.Throwable {
int[] intArray0 = new int[3];
intArray0[2] = 1135;
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
java.util.LinkedList<org.apache.commons.math.stat.clustering.EuclideanIntegerPoint> linkedList0 = new java.util.LinkedList<org.apache.commons.math.stat.clustering.EuclideanIntegerPoint>();
linkedList0.add(euclideanIntegerPoint0);
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = euclideanIntegerPoint0.centroidOf(linkedList0);
org.junit.Assert.assertTrue(euclideanIntegerPoint1.equals(((java.lang.Object)(euclideanIntegerPoint0))));
}
@org.junit.Test(timeout = 4000)
public void test04() throws java.lang.Throwable {
int[] intArray0 = new int[3];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = euclideanIntegerPoint0.getPoint();
org.junit.Assert.assertSame(intArray0, intArray1);
}
@org.junit.Test(timeout = 4000)
public void test05() throws java.lang.Throwable {
int[] intArray0 = new int[0];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = euclideanIntegerPoint0.getPoint();
org.junit.Assert.assertSame(intArray0, intArray1);
}
@org.junit.Test(timeout = 4000)
public void test06() throws java.lang.Throwable {
int[] intArray0 = new int[9];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = new int[9];
intArray1[6] = -1;
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray1);
double double0 = euclideanIntegerPoint0.distanceFrom(euclideanIntegerPoint1);
org.junit.Assert.assertEquals(1.0, double0, 0.01);
}
@org.junit.Test(timeout = 4000)
public void test14() throws java.lang.Throwable {
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(((int[])(null)));
int[] intArray0 = euclideanIntegerPoint0.getPoint();
org.junit.Assert.assertNull(intArray0);
}
@org.junit.Test(timeout = 4000)
public void test15() throws java.lang.Throwable {
int[] intArray0 = new int[3];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
java.lang.String string0 = euclideanIntegerPoint0.toString();
org.junit.Assert.assertEquals("(0,0,0)", string0);
}
@org.junit.Test(timeout = 4000)
public void test16() throws java.lang.Throwable {
int[] intArray0 = new int[9];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = new int[9];
intArray1[6] = -1;
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray1);
boolean boolean0 = euclideanIntegerPoint0.equals(euclideanIntegerPoint1);
org.junit.Assert.assertFalse(boolean0);
org.junit.Assert.assertFalse(euclideanIntegerPoint1.equals(((java.lang.Object)(euclideanIntegerPoint0))));
}
@org.junit.Test(timeout = 4000)
public void test17() throws java.lang.Throwable {
int[] intArray0 = new int[11];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
int[] intArray1 = new int[9];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint1 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray1);
boolean boolean0 = euclideanIntegerPoint0.equals(euclideanIntegerPoint1);
org.junit.Assert.assertFalse(euclideanIntegerPoint1.equals(((java.lang.Object)(euclideanIntegerPoint0))));
org.junit.Assert.assertFalse(boolean0);
}
@org.junit.Test(timeout = 4000)
public void test18() throws java.lang.Throwable {
int[] intArray0 = new int[11];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
java.lang.Object object0 = new java.lang.Object();
boolean boolean0 = euclideanIntegerPoint0.equals(object0);
org.junit.Assert.assertFalse(boolean0);
}
@org.junit.Test(timeout = 4000)
public void test19() throws java.lang.Throwable {
int[] intArray0 = new int[11];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
boolean boolean0 = euclideanIntegerPoint0.equals(euclideanIntegerPoint0);
org.junit.Assert.assertTrue(boolean0);
}
@org.junit.Test(timeout = 4000)
public void test21() throws java.lang.Throwable {
int[] intArray0 = new int[11];
org.apache.commons.math.stat.clustering.EuclideanIntegerPoint euclideanIntegerPoint0 = new org.apache.commons.math.stat.clustering.EuclideanIntegerPoint(intArray0);
euclideanIntegerPoint0.distanceFrom(euclideanIntegerPoint0);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
38137fa1df411c8011a6667dd02f045bd2f4b6ea | 3d21a6b2b532370177f12789da533d255c7874be | /src/structuresLineaires/LienDouble.java | c17fb86f17898c87d4c4bfb03215d89b741be68c | [] | no_license | AdrienTorreilles/itineraire | 39e979627ee7469acf1bf4c5ec2d689f545f2352 | 990d21a59bce868be1e168f827049d82491c60c8 | refs/heads/master | 2020-05-01T01:20:19.620233 | 2019-04-10T15:38:51 | 2019-04-10T15:38:51 | 177,193,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package structuresLineaires;
public class LienDouble<T> extends Lien<T> {
protected Lien<T> precedent;
protected Lien<T> precedent() {return precedent;}
protected void precedent(Lien<T> p) { precedent = p;}
}
| [
"adrientorreilles@gmail.com"
] | adrientorreilles@gmail.com |
a1b698abbfeee6a1fc99a731e74193fe3537e102 | 48980c98527f01b7f6e84734f65929c9494d74e2 | /src/main/java/tltsu/expertsystem/fsm/compiler/CharSequenceCompiler.java | a5f816df0c729dc0ee9475cfd99e31afcd00a70d | [] | no_license | burog/tltsu-expert-system | 7e75a52dc808b87a6741d229abd51269ba8588da | 114d729882701b80b922b5ac58107804093411d3 | refs/heads/master | 2016-09-06T19:35:01.039855 | 2013-05-20T20:58:28 | 2013-05-20T20:58:28 | 35,750,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,512 | java | package tltsu.expertsystem.fsm.compiler;
/**
* @author FADEEV
*/
import tltsu.expertsystem.fsm.CharSequenceCompilerException;
import java.net.URI;
import java.net.URISyntaxException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.tools.DiagnosticCollector;
import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
/**
* Compile a String or other {@link CharSequence}, returning a Java
* {@link Class} instance that may be instantiated. This class is a Facade
* around {@link javax.tools.JavaCompiler} for a narrower use case, but a bit easier to use.
* <p>
* To compile a String containing source for a Java class which implements
* MyInterface:
*
* <pre>
* ClassLoader classLoader = MyClass.class.getClassLoader(); // optional; null is also OK
* List<Diagnostic> diagnostics = new ArrayList<Diagnostic>(); // optional; null is also OK
* JavaStringCompiler<Object> compiler = new JavaStringCompiler<MyInterface>(classLoader,
* null);
* try {
* Class<MyInterface> newClass = compiler.compile("com.mypackage.NewClass",
* stringContaininSourceForNewClass, diagnostics, MyInterface);
* MyInterface instance = newClass.newInstance();
* instance.someOperation(someArgs);
* } catch (JavaStringCompilerException e) {
* handle(e);
* } catch (IllegalAccessException e) {
* handle(e);
* }
* </pre>
*
* The source can be in a String, {@link StringBuffer}, or your own class which
* implements {@link CharSequence}. If you implement your own, it must be
* thread safe (preferably, immutable.)
*
* @author <a href="mailto:David.Biesack@sas.com">David J. Biesack</a>
*/
public class CharSequenceCompiler<T> {
// Compiler requires source files with a ".java" extension:
static final String JAVA_EXTENSION = ".java";
private final ClassLoaderImpl classLoader;
// The compiler instance that this facade uses.
private final JavaCompiler compiler;
// The compiler options (such as "-target" "1.5").
private final List<String> options;
// collect compiler diagnostics in this instance.
private DiagnosticCollector<JavaFileObject> diagnostics;
// The FileManager which will store source and class "files".
private final FileManagerImpl javaFileManager;
/**
* Construct a new instance which delegates to the named class loader.
*
* @param loader
* the application ClassLoader. The compiler will look through to
* this // class loader for dependent classes
* @param options
* The compiler options (such as "-target" "1.5"). See the usage
* for javac
* @throws IllegalStateException
* if the Java compiler cannot be loaded.
*/
public CharSequenceCompiler(ClassLoader loader, Iterable<String> options) {
compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
throw new IllegalStateException("Cannot find the system Java compiler. "
+ "Check that your class path includes tools.jar");
}
classLoader = new ClassLoaderImpl(loader);
diagnostics = new DiagnosticCollector<JavaFileObject>();
final JavaFileManager fileManager = compiler.getStandardFileManager(diagnostics,
null, null);
// create our FileManager which chains to the default file manager
// and our ClassLoader
javaFileManager = new FileManagerImpl(fileManager, classLoader);
this.options = new ArrayList<String>();
if (options != null) { // make a save copy of input options
for (String option : options) {
this.options.add(option);
}
}
}
/**
* Compile Java source in <var>javaSource</name> and return the resulting
* class.
* <p>
* Thread safety: this method is thread safe if the <var>javaSource</var>
* and <var>diagnosticsList</var> are isolated to this thread.
*
* @param qualifiedClassName
* The fully qualified class name.
* @param javaSource
* Complete java source, including a package statement and a class,
* interface, or annotation declaration.
* @param diagnosticsList
* Any diagnostics generated by compiling the source are added to
* this collector.
* @param types
* zero or more Class objects representing classes or interfaces
* that the resulting class must be assignable (castable) to.
* @return a Class which is generated by compiling the source
* @throws tltsu.expertsystem.fsm.CharSequenceCompilerException
* if the source cannot be compiled - for example, if it contains
* syntax or semantic errors or if dependent classes cannot be
* found.
* @throws ClassCastException
* if the generated class is not assignable to all the optional
* <var>types</var>.
*/
public synchronized Class<T> compile(final String qualifiedClassName,
final CharSequence javaSource,
final DiagnosticCollector<JavaFileObject> diagnosticsList,
final Class<?>... types) throws CharSequenceCompilerException,
ClassCastException {
if (diagnosticsList != null)
diagnostics = diagnosticsList;
else
diagnostics = new DiagnosticCollector<JavaFileObject>();
Map<String, CharSequence> classes = new HashMap<String, CharSequence>(1);
classes.put(qualifiedClassName, javaSource);
Map<String, Class<T>> compiled = compile(classes, diagnosticsList);
Class<T> newClass = compiled.get(qualifiedClassName);
return castable(newClass, types);
}
/**
* Compile multiple Java source strings and return a Map containing the
* resulting classes.
* <p>
* Thread safety: this method is thread safe if the <var>classes</var> and
* <var>diagnosticsList</var> are isolated to this thread.
*
* @param classes
* A Map whose keys are qualified class names and whose values are
* the Java source strings containing the definition of the class.
* A map value may be null, indicating that compiled class is
* expected, although no source exists for it (it may be a
* non-public class contained in one of the other strings.)
* @param diagnosticsList
* Any diagnostics generated by compiling the source are added to
* this list.
* @return A mapping of qualified class names to their corresponding classes.
* The map has the same keys as the input <var>classes</var>; the
* values are the corresponding Class objects.
* @throws CharSequenceCompilerException
* if the source cannot be compiled
*/
public synchronized Map<String, Class<T>> compile(
final Map<String, CharSequence> classes,
final DiagnosticCollector<JavaFileObject> diagnosticsList)
throws CharSequenceCompilerException {
List<JavaFileObject> sources = new ArrayList<JavaFileObject>();
for (Map.Entry<String, CharSequence> entry : classes.entrySet()) {
String qualifiedClassName = entry.getKey();
CharSequence javaSource = entry.getValue();
if (javaSource != null) {
final int dotPos = qualifiedClassName.lastIndexOf('.');
final String className = dotPos == -1 ? qualifiedClassName
: qualifiedClassName.substring(dotPos + 1);
final String packageName = dotPos == -1 ? "" : qualifiedClassName
.substring(0, dotPos);
final JavaFileObjectImpl source = new JavaFileObjectImpl(className,
javaSource);
sources.add(source);
// Store the source file in the FileManager via package/class
// name.
// For source files, we add a .java extension
javaFileManager.putFileForInput(StandardLocation.SOURCE_PATH, packageName,
className + JAVA_EXTENSION, source);
}
}
// Get a CompliationTask from the compiler and compile the sources
final JavaCompiler.CompilationTask task = compiler.getTask(null, javaFileManager, diagnostics,
options, null, sources);
final Boolean result = task.call();
if (result == null || !result.booleanValue()) {
throw new CharSequenceCompilerException("Compilation failed.", classes
.keySet(), diagnostics);
}
try {
// For each class name in the inpput map, get its compiled
// class and put it in the output map
Map<String, Class<T>> compiled = new HashMap<String, Class<T>>();
for (String qualifiedClassName : classes.keySet()) {
final Class<T> newClass = loadClass(qualifiedClassName);
compiled.put(qualifiedClassName, newClass);
}
return compiled;
} catch (ClassNotFoundException e) {
throw new CharSequenceCompilerException(classes.keySet(), e, diagnostics);
} catch (IllegalArgumentException e) {
throw new CharSequenceCompilerException(classes.keySet(), e, diagnostics);
} catch (SecurityException e) {
throw new CharSequenceCompilerException(classes.keySet(), e, diagnostics);
}
}
/**
* Load a class that was generated by this instance or accessible from its
* parent class loader. Use this method if you need access to additional
* classes compiled by
* {@link #compile(String, CharSequence, DiagnosticCollector, Class...) compile()},
* for example if the primary class contained nested classes or additional
* non-public classes.
*
* @param qualifiedClassName
* the name of the compiled class you wish to load
* @return a Class instance named by <var>qualifiedClassName</var>
* @throws ClassNotFoundException
* if no such class is found.
*/
@SuppressWarnings("unchecked")
public Class<T> loadClass(final String qualifiedClassName)
throws ClassNotFoundException {
return (Class<T>) classLoader.loadClass(qualifiedClassName);
}
/**
* Check that the <var>newClass</var> is a subtype of all the type
* parameters and throw a ClassCastException if not.
*
* @param types
* zero of more classes or interfaces that the <var>newClass</var>
* must be castable to.
* @return <var>newClass</var> if it is castable to all the types
* @throws ClassCastException
* if <var>newClass</var> is not castable to all the types.
*/
private Class<T> castable(Class<T> newClass, Class<?>... types)
throws ClassCastException {
for (Class<?> type : types)
if (!type.isAssignableFrom(newClass)) {
throw new ClassCastException(type.getName());
}
return newClass;
}
/**
* COnverts a String to a URI.
*
* @param name
* a file name
* @return a URI
*/
static URI toURI(String name) {
try {
return new URI(name);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
/**
* @return This compiler's class loader.
*/
public ClassLoader getClassLoader() {
return javaFileManager.getClassLoader();
}
}
/**
* A JavaFileManager which manages Java source and classes. This FileManager
* delegates to the JavaFileManager and the ClassLoaderImpl provided in the
* constructor. The sources are all in memory CharSequence instances and the
* classes are all in memory byte arrays.
*/
final class FileManagerImpl extends ForwardingJavaFileManager<JavaFileManager> {
// the delegating class loader (passed to the constructor)
private final ClassLoaderImpl classLoader;
// Internal map of filename URIs to JavaFileObjects.
private final Map<URI, JavaFileObject> fileObjects = new HashMap<URI, JavaFileObject>();
/**
* Construct a new FileManager which forwards to the <var>fileManager</var>
* for source and to the <var>classLoader</var> for classes
*
* @param fileManager
* another FileManager that this instance delegates to for
* additional source.
* @param classLoader
* a ClassLoader which contains dependent classes that the compiled
* classes will require when compiling them.
*/
public FileManagerImpl(JavaFileManager fileManager, ClassLoaderImpl classLoader) {
super(fileManager);
this.classLoader = classLoader;
}
/**
* @return the class loader which this file manager delegates to
*/
public ClassLoader getClassLoader() {
return classLoader;
}
/**
* For a given file <var>location</var>, return a FileObject from which the
* compiler can obtain source or byte code.
*
* @param location
* an abstract file location
* @param packageName
* the package name for the file
* @param relativeName
* the file's relative name
* @return a FileObject from this or the delegated FileManager
* @see javax.tools.ForwardingJavaFileManager#getFileForInput(javax.tools.JavaFileManager.Location,
* java.lang.String, java.lang.String)
*/
@Override
public FileObject getFileForInput(Location location, String packageName,
String relativeName) throws IOException
{
FileObject o = fileObjects.get(uri(location, packageName, relativeName));
if (o != null)
return o;
return super.getFileForInput(location, packageName, relativeName);
}
/**
* Store a file that may be retrieved later with
* {@link #getFileForInput(javax.tools.JavaFileManager.Location, String, String)}
*
* @param location
* the file location
* @param packageName
* the Java class' package name
* @param relativeName
* the relative name
* @param file
* the file object to store for later retrieval
*/
public void putFileForInput(StandardLocation location, String packageName,
String relativeName, JavaFileObject file) {
fileObjects.put(uri(location, packageName, relativeName), file);
}
/**
* Convert a location and class name to a URI
*/
private URI uri(Location location, String packageName, String relativeName) {
return CharSequenceCompiler.toURI(location.getName() + '/' + packageName + '/'
+ relativeName);
}
/**
* Create a JavaFileImpl for an output class file and store it in the
* classloader.
*
* @see javax.tools.ForwardingJavaFileManager#getJavaFileForOutput(javax.tools.JavaFileManager.Location,
* java.lang.String, javax.tools.JavaFileObject.Kind,
* javax.tools.FileObject)
*/
@Override
public JavaFileObject getJavaFileForOutput(Location location, String qualifiedName,
JavaFileObject.Kind kind, FileObject outputFile) throws IOException {
JavaFileObject file = new JavaFileObjectImpl(qualifiedName, kind);
classLoader.add(qualifiedName, file);
return file;
}
@Override
public ClassLoader getClassLoader(JavaFileManager.Location location) {
return classLoader;
}
@Override
public String inferBinaryName(Location loc, JavaFileObject file) {
String result;
// For our JavaFileImpl instances, return the file's name, else
// simply run the default implementation
if (file instanceof JavaFileObjectImpl)
result = file.getName();
else
result = super.inferBinaryName(loc, file);
return result;
}
@Override
public Iterable<JavaFileObject> list(Location location, String packageName,
Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException {
Iterable<JavaFileObject> result = super.list(location, packageName, kinds,
recurse);
ArrayList<JavaFileObject> files = new ArrayList<JavaFileObject>();
if (location == StandardLocation.CLASS_PATH
&& kinds.contains(JavaFileObject.Kind.CLASS)) {
for (JavaFileObject file : fileObjects.values()) {
if (file.getKind() == JavaFileObject.Kind.CLASS && file.getName().startsWith(packageName))
files.add(file);
}
files.addAll(classLoader.files());
} else if (location == StandardLocation.SOURCE_PATH
&& kinds.contains(JavaFileObject.Kind.SOURCE)) {
for (JavaFileObject file : fileObjects.values()) {
if (file.getKind() == JavaFileObject.Kind.SOURCE && file.getName().startsWith(packageName))
files.add(file);
}
}
for (JavaFileObject file : result) {
files.add(file);
}
return files;
}
}
/**
* A JavaFileObject which contains either the source text or the compiler
* generated class. This class is used in two cases.
* <ol>
* <li>This instance uses it to store the source which is passed to the
* compiler. This uses the
* {@link JavaFileObjectImpl#JavaFileObjectImpl(String, CharSequence)}
* constructor.
* <li>The Java compiler also creates instances (indirectly through the
* FileManagerImplFileManager) when it wants to create a JavaFileObject for the
* .class output. This uses the
* {@link JavaFileObjectImpl#JavaFileObjectImpl(String, JavaFileObject.Kind)}
* constructor.
* </ol>
* This class does not attempt to reuse instances (there does not seem to be a
* need, as it would require adding a Map for the purpose, and this would also
* prevent garbage collection of class byte code.)
*/
final class JavaFileObjectImpl extends SimpleJavaFileObject {
// If kind == CLASS, this stores byte code from openOutputStream
private ByteArrayOutputStream byteCode;
// if kind == SOURCE, this contains the source text
private final CharSequence source;
/**
* Construct a new instance which stores source
*
* @param baseName
* the base name
* @param source
* the source code
*/
JavaFileObjectImpl(final String baseName, final CharSequence source) {
super(CharSequenceCompiler.toURI(baseName + CharSequenceCompiler.JAVA_EXTENSION),
Kind.SOURCE);
this.source = source;
}
/**
* Construct a new instance
*
* @param name
* the file name
* @param kind
* the kind of file
*/
JavaFileObjectImpl(final String name, final Kind kind) {
super(CharSequenceCompiler.toURI(name), kind);
source = null;
}
/**
* Return the source code content
*
* @see javax.tools.SimpleJavaFileObject#getCharContent(boolean)
*/
@Override
public CharSequence getCharContent(final boolean ignoreEncodingErrors)
throws UnsupportedOperationException {
if (source == null)
throw new UnsupportedOperationException("getCharContent()");
return source;
}
/**
* Return an input stream for reading the byte code
*
* @see javax.tools.SimpleJavaFileObject#openInputStream()
*/
@Override
public InputStream openInputStream() {
return new ByteArrayInputStream(getByteCode());
}
/**
* Return an output stream for writing the bytecode
*
* @see javax.tools.SimpleJavaFileObject#openOutputStream()
*/
@Override
public OutputStream openOutputStream() {
byteCode = new ByteArrayOutputStream();
return byteCode;
}
/**
* @return the byte code generated by the compiler
*/
byte[] getByteCode() {
return byteCode.toByteArray();
}
}
/**
* A custom ClassLoader which maps class names to JavaFileObjectImpl instances.
*/
final class ClassLoaderImpl extends ClassLoader {
private final Map<String, JavaFileObject> classes = new HashMap<String, JavaFileObject>();
ClassLoaderImpl(final ClassLoader parentClassLoader) {
super(parentClassLoader);
}
/**
* @return An collection of JavaFileObject instances for the classes in the
* class loader.
*/
Collection<JavaFileObject> files() {
return Collections.unmodifiableCollection(classes.values());
}
@Override
protected Class<?> findClass(final String qualifiedClassName)
throws ClassNotFoundException {
JavaFileObject file = classes.get(qualifiedClassName);
if (file != null) {
byte[] bytes = ((JavaFileObjectImpl) file).getByteCode();
return defineClass(qualifiedClassName, bytes, 0, bytes.length);
}
// Workaround for "feature" in Java 6
// see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149
try {
Class<?> c = Class.forName(qualifiedClassName);
return c;
} catch (ClassNotFoundException nf) {
// Ignore and fall through
}
return super.findClass(qualifiedClassName);
}
/**
* Add a class name/JavaFileObject mapping
*
* @param qualifiedClassName
* the name
* @param javaFile
* the file associated with the name
*/
void add(final String qualifiedClassName, final JavaFileObject javaFile) {
classes.put(qualifiedClassName, javaFile);
}
@Override
protected synchronized Class<?> loadClass(final String name, final boolean resolve)
throws ClassNotFoundException {
return super.loadClass(name, resolve);
}
@Override
public InputStream getResourceAsStream(final String name) {
if (name.endsWith(".class")) {
String qualifiedClassName = name.substring(0,
name.length() - ".class".length()).replace('/', '.');
JavaFileObjectImpl file = (JavaFileObjectImpl) classes.get(qualifiedClassName);
if (file != null) {
return new ByteArrayInputStream(file.getByteCode());
}
}
return super.getResourceAsStream(name);
}
}
| [
"mark.fadeev@gmail.com"
] | mark.fadeev@gmail.com |
406703fde2d9f258ab761adbe5b921eade4b704a | fa9772cbce46cf1f0a193238427ceef0f3cf0142 | /src/table/model/MediaTableModel.java | 1fbd9a3d94e1527dac80f4ee2543304f10d9b69b | [] | no_license | robgura/PictureOrganizer | 226cae32ff6ce04450b575da8f5f7df6dc91102f | 4f13bc889a2bf151b590f361c83b28805b1f8dfb | refs/heads/master | 2022-06-24T15:42:18.883154 | 2013-01-24T04:42:19 | 2013-01-24T04:42:19 | 261,894,569 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,083 | java | package table.model;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import javax.swing.ImageIcon;
import javax.swing.table.AbstractTableModel;
import cameragroup.model.GroupData;
@SuppressWarnings("serial")
public class MediaTableModel extends AbstractTableModel
{
public static final int FILE_NAME_COLUMN = 0;
public static final int GROUP_COLUMN = 1;
public static final int IMAGE_COLUMN = 2;
public static final int MODEL_COLUMN = 3;
public static final int DATE_COLUMN = 4;
public static final int COLUMN_COUNT = 5;
public MediaTableModel()
{
groupings = new ArrayList<IGrouping>();
}
public void addGrouping(IGrouping grouping)
{
groupings.add(grouping);
}
@Override
public int getColumnCount()
{
return COLUMN_COUNT;
}
@Override
public String getColumnName(int column)
{
if(column == FILE_NAME_COLUMN)
{
return "File Name";
}
if(column == GROUP_COLUMN)
{
return "Group";
}
if(column == MODEL_COLUMN)
{
return "Model";
}
if(column == DATE_COLUMN)
{
return "Date";
}
if(column == IMAGE_COLUMN)
{
return "Image";
}
return super.getColumnName(column);
}
@Override
public int getRowCount()
{
if(mediaDatas == null)
{
return 0;
}
return mediaDatas.size();
}
@Override
public Object getValueAt(int row, int column)
{
MediaData data = mediaDatas.get(row);
if(column == FILE_NAME_COLUMN)
{
return data.getFile().getAbsolutePath();
}
if(column == IMAGE_COLUMN)
{
return new ImageIcon(data.getImage());
}
if(column == GROUP_COLUMN)
{
return data.getGroupData().getName();
}
if(column == MODEL_COLUMN)
{
return data.getCameraModel();
}
if(column == DATE_COLUMN)
{
return data.getCreationDate();
}
if(column == 5)
{
return data.getNewFileName();
}
return Integer.toString(row + 1) + " - " + Integer.toString(column + 1);
}
@Override
public Class<?> getColumnClass(int columnIndex)
{
if(columnIndex == IMAGE_COLUMN)
{
return ImageIcon.class;
}
if(columnIndex == DATE_COLUMN)
{
return Calendar.class;
}
return super.getColumnClass(columnIndex);
}
public void readDirectory(File newDir)
{
loadDirectoryInfo(newDir);
fireTableDataChanged();
}
public void updateGroup(String name)
{
int i = 0;
for(MediaData mediaData : mediaDatas)
{
if(mediaData.getGroupData().getName().compareTo(name) == 0)
{
this.fireTableRowsUpdated(i, i);
}
++i;
}
}
public void showThumbnail(int row)
{
MediaData mediaData = mediaDatas.get(row);
mediaData.createThumbnail();
this.fireTableCellUpdated(row, IMAGE_COLUMN);
}
public void changeGroup(int row, GroupData groupData)
{
MediaData mediaData = mediaDatas.get(row);
if(mediaData.getGroupData() != groupData)
{
mediaData.setGroupData(groupData);
this.fireTableRowsUpdated(row, row);
}
}
public ArrayList<MediaData> getMediaDatas()
{
return mediaDatas;
}
private void addToGroups(MediaData mediaData)
{
for(IGrouping g : groupings)
{
g.AddNewMediaDataToGroup(mediaData);
}
}
private void loadDirectoryInfo(File directory)
{
HackFileNameExtensionFilter filter = new HackFileNameExtensionFilter("Media", "jpg", "jpeg", "avi", "mts", "mpg", "mpeg", "mov");
File[] mediaFiles = directory.listFiles(filter);
mediaDatas = new ArrayList<MediaData>(mediaFiles.length);
for(int i = 0; i < mediaFiles.length; ++i)
{
try
{
MediaData mediaData = new MediaData(mediaFiles[i]);
mediaDatas.add(mediaData);
addToGroups(mediaData);
}
catch (NotMedia e)
{
System.err.println("Found non media type " + mediaFiles[i].getAbsolutePath());
}
}
}
private ArrayList<MediaData> mediaDatas;
//private CameraGroupMgr cameraGroupMgr;
private ArrayList<IGrouping> groupings;
}
| [
"devnull@localhost"
] | devnull@localhost |
e669f6e7dafe8ed3ca1a4b3d3d89fad71b6645e7 | 2e18dcce491989de3d765b67b9940c7debbe866b | /catalogo-jee14-java/src/main/java/com/valhala/jee14/catalogo/patterns/factory/Factory.java | bb676b47af5ddc1a60124b1299cfe99646a40eaa | [] | no_license | BrunoLV/catalogo-jee14 | 6fe6e33a9349d2c2c08ecf97be5603c82e4c10d6 | 5ede8a8351a707daf2e331697271553d9dcf376d | refs/heads/master | 2021-01-01T16:19:32.053924 | 2015-01-04T18:10:28 | 2015-01-04T18:14:03 | 28,726,479 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package com.valhala.jee14.catalogo.patterns.factory;
import com.valhala.jee14.catalogo.patterns.factory.exception.FactoryException;
public interface Factory {
Object obterObjeto() throws FactoryException;
Object obterObjeto(final int opcaoDao) throws FactoryException;
}
| [
"brunolviana22@hotmail.com"
] | brunolviana22@hotmail.com |
5d1e0e125b539c37d516ef7edea1dfb634ca0c8e | 181c09965bb04a4b37687d0f12855f555481318c | /Timepeacker_20/app/src/androidTest/java/com/example/hasantarek/timepeacker_20/ApplicationTest.java | fcc4e47800ab23df5f42813ea1ab6322d5636fc5 | [] | no_license | TarekCsePust/Learn-android-apps-part-2 | 4da017d23a5e9664e3523aff7dbd99f47d500d70 | 7303468aa7314a7dfd6d75d13311ea2c4e8e0eab | refs/heads/master | 2020-04-02T03:52:06.730880 | 2018-10-21T08:49:01 | 2018-10-21T08:49:01 | 153,988,773 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package com.example.hasantarek.timepeacker_20;
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);
}
} | [
"hasantarek12cse@gmail.com"
] | hasantarek12cse@gmail.com |
e3e5f14a2860724d595d4cf9264658699bd51b48 | 6c5e4a83d41170457c6f9cbbe7ba4e91b8547a58 | /DotComGameProject/src/dotComs/SimpleDotCom.java | dd49e252f9042a4a471e2e07ad59cdb99049a0b9 | [] | no_license | shockingblue211/HeadFirstJava | 1687a1fecce79aaa67b494f086d4010ac6555ace | 2ac2e59a5462ed18a8f9bea3ca3f77120f9b3c91 | refs/heads/master | 2020-03-21T21:54:29.180632 | 2018-07-03T02:45:20 | 2018-07-03T02:45:20 | 139,060,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package dotComs;
public class SimpleDotCom {
private int[] location;
private int numOfHits = 0;
public void setLocationCells(int[] locs){
location = locs;
}
public String checkYourself(String stringGuess){
int guess = Integer.parseInt(stringGuess);
String result = "miss";
for(int cell : location){
if(guess == cell){
result = "hit";
numOfHits++;
break;
}
}
if(numOfHits == location.length){
result = "kill";
}
System.out.println(result);
return result;
}
}
| [
"shockingblue211@gmail.com"
] | shockingblue211@gmail.com |
d373ca19cd68b3ccb1de95b37536658f06bdd382 | 03cd025911dae9c3c0fffd79bd3c52db9fec6241 | /Leetcode/LeetcodeRomanToInteger.java | dba02d2589c5b3bb06819d557bf4ef41d70a7794 | [] | no_license | zhouyix/Algorithm | 74b11dfd76d008a59aa8b6527e69bc822d58ead3 | ea8682c92f7c2546eb282f81d72e0608428b7669 | refs/heads/master | 2021-01-11T20:27:59.899079 | 2019-09-08T02:38:14 | 2019-09-08T02:38:14 | 79,116,628 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | public class Solution {
public int romanToInt(String s) {
if (s == null || s.length()==0) {
return 0;
}
Map<Character, Integer> m = new HashMap<Character, Integer>();
m.put('I', 1);
m.put('V', 5);
m.put('X', 10);
m.put('L', 50);
m.put('C', 100);
m.put('D', 500);
m.put('M', 1000);
int length = s.length();
int result = m.get(s.charAt(length - 1));
for (int i = length - 2; i >= 0; i--) {
if (m.get(s.charAt(i + 1)) <= m.get(s.charAt(i))) {
result += m.get(s.charAt(i));
} else {
result -= m.get(s.charAt(i));
}
}
return result;
}
} | [
"zhouyi_naive@163.com"
] | zhouyi_naive@163.com |
c4602e496eca8caa9445a32e632cb8636844d1ac | c245812a39663c80c420da109569c97dc2b40c15 | /src/edu/wildlifesecurity/trapdevice/communicatorclient/impl/AbstractChannel.java | 464e5684633a9b675fda96a9b96af751148c93d4 | [] | no_license | carka684/CDIO-TrapDevice | 38de5958055bd48851d6a4b5e570beaab8b81243 | 59b7f86e8882b8195e2041afa224474d0e0b0bd2 | refs/heads/master | 2021-01-10T02:21:34.330566 | 2014-12-18T14:50:05 | 2014-12-18T14:50:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package edu.wildlifesecurity.trapdevice.communicatorclient.impl;
import java.util.Map;
import edu.wildlifesecurity.framework.EventType;
import edu.wildlifesecurity.framework.IEventHandler;
import edu.wildlifesecurity.framework.ILogger;
import edu.wildlifesecurity.framework.ISubscription;
import edu.wildlifesecurity.framework.Message;
import edu.wildlifesecurity.framework.MessageEvent;
/**
* Represents a communication channel. A channel could be for example sms or internet.
* TODO: Handle lost connection
*/
public abstract class AbstractChannel {
protected Map<String, Object> configuration;
protected ILogger log;
protected AbstractChannel(Map<String, Object> config, ILogger logger){
this.configuration = config;
this.log = logger;
}
/**
* Start try to connect to server
*/
abstract void connect();
/**
* Adds support for receiving events when messages arrives from TrapDevices
*/
abstract ISubscription addEventHandler(EventType type, IEventHandler<MessageEvent> handler);
/**
* Sends a string message through the channel to the TrapDevice that is contained in the Message instance.
*/
abstract void sendMessage(Message message);
/**
* Disposes the channel
*/
abstract void dispose();
} | [
"tobias.norlund@tele2.se"
] | tobias.norlund@tele2.se |
144d16ded6ba7038ed5f9d203e4853d7c14183bd | 9982a9c17c0839edf2b1fa638f61dc686a5f2d13 | /app/src/test/java/com/example/sidra/unplugme/ExampleUnitTest.java | 5a83d7e5db3f641655808a2bd317abd9fa875e5c | [] | no_license | SidraJaved/UnPlugMe | 42d42bb66d37304e61b8aa644ec5ae3634cfedae | bc2946360eb79f33c0d3a08577ceea8e4e3fe078 | refs/heads/master | 2021-01-01T04:34:46.918722 | 2016-05-24T11:36:58 | 2016-05-24T11:36:58 | 59,567,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package com.example.sidra.unplugme;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"sidrajaved92@gmail.com"
] | sidrajaved92@gmail.com |
7e80ef96edb658af8c4f97df29bc438072fb1d90 | 556578a1c78aff5e1a45be4a726ee00056996f9f | /src/main/java/com/min/charge/security/CommonTool.java | 9b964e98d54d9a3f3b29de42aaa5fe4dfe5cad96 | [] | no_license | XiaoyaoEzio/MinCharge | af54e5c67ce44354c1d6e5e857fc8edb2de6b44b | b6d02b24f5dad3696b86c193c1e13326f6c8b3a4 | refs/heads/master | 2020-04-10T08:57:32.573392 | 2018-12-28T08:33:24 | 2018-12-28T08:33:24 | 160,921,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,272 | java | package com.min.charge.security;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.security.SecureRandom;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.ThreadLocalRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
/**
* 通用方法
*
* @author
*
*/
public class CommonTool {
/**
* 得到长度为20的随机数字字符串
*
* @return
*/
public static String getRandomDigitalString() {
return getRandomDigitalString(20);
}
/**
* 得到指定长度的随机数字字符串
*
* @param length
* 要生成的字符串的长度
* @return 生成的随机字符串
*/
public static String getRandomDigitalString(int length) {
StringBuilder builder = new StringBuilder(length);
for (int i = 0; i < length; i++) {
builder.append((char) (ThreadLocalRandom.current().nextInt(48, 57)));
}
return builder.toString();
}
/**
* 获取字符串的单双字节
*
* @param str
* @param flag
* true:双字节,false:单字节
* @return
*/
public static byte[] getStringByOddOrEven(String str, boolean flag) {
byte[] chars = hex2Bytes(str);
byte[] sb = new byte[chars.length / 2];
int j = 0;
for (int i = (flag == true ? 1 : 0); i < chars.length; i += 2) {
sb[j] = chars[i];
j++;
}
return sb;
}
/**
* 将十六进制字符串转换为字节数组
*
* @param strhex
* @return
*/
public static byte[] hex2Bytes(String strhex) {
if (strhex == null) {
return null;
}
int l = strhex.length();
if (l % 2 == 1) {
return null;
}
byte[] b = new byte[l / 2];
for (int i = 0; i != l / 2; i++) {
b[i] = (byte) Integer.parseInt(strhex.substring(i * 2, i * 2 + 2),
16);
}
return b;
}
/**
* 将字节数组转换为十六进制字符串
*
* @param b
* @return
*/
public static String byte2Hex(byte[] b) {
String hs = "";
String stmp = "";
for (int n = 0; n < b.length; n++) {
stmp = (java.lang.Integer.toHexString(b[n] & 0XFF));
if (stmp.length() == 1) {
hs = hs + "0" + stmp;
} else {
hs = hs + stmp;
}
}
return hs.toUpperCase();
}
/**
* 将字节数组转换为十六进制字符串,每个字节之间用空格分隔
*
* @param b
* @return
*/
public static String bytes2String(byte[] a) {
StringBuilder sb = new StringBuilder();
for (byte b : a)
sb.append(String.format("%02x ", b & 0xff));
return sb.toString();
}
// /**
// * BCD码转int
// */
// public static int bcd2int(byte[] inputdata) {
//
// int data = 0;
// for (int i = inputdata.length-1; i >-1; i--) {
// int tempdate = inputdata[i];
// if(tempdate < 0){
// tempdate = 0 - tempdate;
// }
//
// if(tempdate>0x99){
// tempdate = 0;
// }
// int x = tempdate /10;
// int y = tempdate % 10;
// tempdate = x*16 + y ;
// data = tempdate + data*100;
//
// }
// return data;
// }
/**
* BCD码转int
*/
public static long bcd2int(byte[] inputdata) {
long data = 0;
for (int i = inputdata.length - 1; i > -1; i--) {
int tempdate = inputdata[i];
int x = tempdate & 0x0f;
int y = (tempdate >> 4) & 0x0f;
tempdate = x + y * 10;
data = tempdate + data * 100;
}
return data;
}
/**
* BCD码转String 用于交易流水号,终端机器编码等情况
*/
public static String bcd2String(byte[] inputdata) {
String value = "";
value = String.valueOf(bcd2int(inputdata)); // 直接把int转String
return value;
}
/**
* bin码转int
*/
public static int bin2int(byte[] inputdata) {
// int data = 0;
// for (int i = inputdata.length-1; i > -1; i--) {
// data= (inputdata[i] & 0xff) +data*256; // 把bin码转int
// }
// return data;
int data = 0;
for (int i = 0; i < inputdata.length; i++) {
data = (inputdata[i] & 0xff) + data * 256; // 把bin码转int
}
return data;
}
/**
* bin码转double
*
* @throws IOException
*/
public static double bin2double(byte[] inputdata) throws IOException {
double data = 0.0;
// 构建输入流
ByteArrayInputStream bis = new ByteArrayInputStream(inputdata);
DataInputStream dis = new DataInputStream(bis);
try {
for (int i = 0; i < bis.available(); i++) {
data = dis.readDouble();
}
} catch (Exception ex) {
}
return data;
}
/**
* 把bin数据直接转换成String字符串
*
* @param inputdata
* @return
*/
public static String bin2string(byte[] inputdata) {
String data = "";
for (int k = 0; k < inputdata.length; k++)
data = data + String.valueOf(inputdata[k] / 16)
+ String.valueOf(inputdata[k] % 16);
return data;
}
/**
* ASII码转int;
*/
public static int Ascii2int(byte[] inputdata) {
int data = 0;
byte[] bytedata = new byte[2];
for (int i = 0; i < inputdata.length; i = i + 2) {
bytedata[0] = inputdata[i];
bytedata[1] = inputdata[i + 1];
data = bin2int(bytedata) - 48 + data * 10;
}
return data;
}
/**
* ASCII码转String
*/
public static String ASCII2String(byte[] inputdata) {
String data = "";
char getdata = 0;
for (int i = 0; i < inputdata.length; i++) {
getdata = (char) (inputdata[i] & 0xff);
data = data + String.valueOf(getdata);
}
return data;
}
private static final SimpleDateFormat formatter = new SimpleDateFormat(
"yyyyMMddHHmmss");
/**
* String转Data
*
* @param strTime
* @return
* @throws ParseException
*/
public static Date StringToDate(String strTime) throws ParseException {
Date date = null;
date = formatter.parse(strTime);
return date;
}
public static String DateToString(Date value) {
return formatter.format(value);
}
public static String GetTradingSn(Date date) {
long time = date.getTime();
String timeString = String.valueOf(time);
String sn = formatter.format(date)
+ timeString.substring(timeString.length() - 3,
timeString.length())+getRandomDigitalString(3);
return sn;
}
/**
* Description DES加密
*
* @param data
* MD5编码
* @param key
* 密钥
* @return
* @throws Exception
*/
public static String encrypt(String data, String key) throws Exception {
// 获取双字节数据
StringBuilder db = new StringBuilder();
for (int i = 1; i < data.length(); i = i + 2) {
db.append(data.charAt(i));
}
String dbString = db.toString();
// 生成一个可信任的随机数源
SecureRandom random = new SecureRandom();
// 从原始密钥数据创建DESKeySpec对象
DESKeySpec dks = new DESKeySpec(key.getBytes("UTF-8"));
// 创建一个密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey securekey = keyFactory.generateSecret(dks);
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance("DES");
// 用密钥初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, securekey, random);
// 加密结果
byte[] bt = cipher.doFinal(dbString.getBytes("UTF-8"));
// 将字节转换为16进制字符串
String result = CommonTool.byte2Hex(bt);
return result;
}
}
| [
"1085657070@qq.com"
] | 1085657070@qq.com |
22731f0e791bd19ed45b3119ed4570885bae814d | 7ce57ff4690416cbe1526417e970573f67ab966c | /src/VO/CompanyImageAttachmentVO.java | d1b2d68cb00b3397d35c4017e35797c22f263193 | [] | no_license | meetparikh51/CLEAN | 73748b06aac96a9ba46e33c337c9b439aade6071 | 72eda31166dce214a06b813da90dd06d50c61f5f | refs/heads/master | 2021-07-05T03:09:53.120612 | 2017-09-27T22:08:38 | 2017-09-27T22:08:38 | 105,074,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 874 | java | package VO;
public class CompanyImageAttachmentVO {
private int imageAttachmentId;
private String imageName;
private String path;
private int companyRegistrationId;
public int getImageAttachmentId() {
return imageAttachmentId;
}
public void setImageAttachmentId(int imageAttachmentId) {
this.imageAttachmentId = imageAttachmentId;
}
public String getImageName() {
return imageName;
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public int getCompanyRegistrationId() {
return companyRegistrationId;
}
public void setCompanyRegistrationId(int companyRegistrationId) {
this.companyRegistrationId = companyRegistrationId;
}
}
| [
"meetparikh51@gmail.com"
] | meetparikh51@gmail.com |
8f5d3a08bf57591da47dadd3cf253ff61b3a6ca7 | c278b2e06e98b0b99ca7350cfc12d2e535db1841 | /account/account-api/src/main/java/com/yl/account/api/bean/response/AccountQueryResponse.java | 78de4ae311c3297e40bf875b99b3e752640535c7 | [] | no_license | SplendorAnLin/paymentSystem | ea778c03179a36755c52498fd3f5f1a5bbeb5d34 | db308a354a23bd3a48ff88c16b29a43c4e483e7d | refs/heads/master | 2023-02-26T14:16:27.283799 | 2022-10-20T07:50:35 | 2022-10-20T07:50:35 | 191,535,643 | 5 | 6 | null | 2023-02-22T06:42:24 | 2019-06-12T09:01:15 | Java | UTF-8 | Java | false | false | 947 | java | /**
*
*/
package com.yl.account.api.bean.response;
import java.util.List;
import com.lefu.commons.utils.Page;
import com.yl.account.api.bean.AccountBean;
import com.yl.account.api.bean.BussinessResponse;
/**
* 账户信息查询响应
*
* @author 聚合支付有限公司
* @since 2016年5月22日
* @version V1.0.0
*/
public class AccountQueryResponse extends BussinessResponse {
private static final long serialVersionUID = 2738343722378764817L;
private Page<?> page;
private List<AccountBean> accountBeans;
public Page<?> getPage() {
return page;
}
public void setPage(Page<?> page) {
this.page = page;
}
public List<AccountBean> getAccountBeans() {
return accountBeans;
}
public void setAccountBeans(List<AccountBean> accountBeans) {
this.accountBeans = accountBeans;
}
@Override
public String toString() {
return "AccountQueryResponse [page=" + page + ", accountBeans=" + accountBeans + "]";
}
}
| [
"zl88888@live.com"
] | zl88888@live.com |
350dfcdba409477a6a5962b18f6cf1d637f11e95 | cf41be251d5689f7c5e32e0e2366b65356036a63 | /src/andy/test/swing/SwingThreadTest2.java | 1a97b84563696f992ba5e66693ad88c713d92a4b | [] | no_license | andyfengc/Test_Java | 4adb9585f3153127900c8844b4fd550361a30046 | 7c633b0ceaa9b2f0eace31e52bfc9f762b64fd35 | refs/heads/master | 2021-01-10T13:50:18.273423 | 2017-12-15T18:29:51 | 2017-12-15T18:29:51 | 44,214,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,834 | java | package andy.test.swing;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JProgressBar;
import javax.swing.JTextField;
public class SwingThreadTest2 extends JFrame {
private static final long serialVersionUID = 1L;
private static final String STR = "Completed : ";
private JProgressBar progressBar = new JProgressBar();
private JTextField text = new JTextField(10);
private JButton start = new JButton("Start");
private JButton end = new JButton("End");
private boolean flag = false;
private int count = 0;
GoThread t = null;
public SwingThreadTest2() {
this.setLayout(new FlowLayout());
add(progressBar);
text.setEditable(false);
add(text);
add(start);
add(end);
start.addActionListener(new Start());
end.addActionListener(new End());
}
private void go() {
while (count < 100) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (flag) {
count++;
System.out.println(count);
progressBar.setValue(count);
text.setText(STR + String.valueOf(count) + "%");
}
}
}
private class Start implements ActionListener {
public void actionPerformed(ActionEvent e) {
flag = true;
if(t == null){
t = new GoThread();
t.start();
}
}
}
//执行复杂工作,然后更新组件的线程
class GoThread extends Thread{
public void run() {
//do something...
go();
}
}
private class End implements ActionListener {
public void actionPerformed(ActionEvent e) {
flag = false;
}
}
public static void main(String[] args) {
SwingThreadTest2 fg = new SwingThreadTest2();
fg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fg.setSize(300, 100);
fg.setVisible(true);
}
}
| [
"andyfengc@gmail.com"
] | andyfengc@gmail.com |
25139458f1851554fa85fc3f9310194e4839407b | 9b4c8e9267f798e1469cc7db186e028de47c4822 | /src/main/java/com/numb3r3/common/concurrent/ThreadPool.java | 00d8b80df952b98742a9dccbfaa352b3718e39e0 | [] | no_license | hezila/commons-java | 5ac0d86f94ea21ef3ea98092cf962c86e4d8be5e | ad25c9312da4dd4949bfc5a7e4fe3ce885d2453f | refs/heads/master | 2021-05-28T17:12:54.817538 | 2015-03-23T12:53:13 | 2015-03-23T12:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,714 | java | package com.numb3r3.common.concurrent;
import com.numb3r3.common.concurrent.util.Pair;
import com.numb3r3.common.concurrent.util.Reducer;
import com.numb3r3.common.concurrent.util.Reducible;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ThreadPool {
private static int poolSize = Runtime.getRuntime().availableProcessors();
public static void setPoolSize(int poolSize) {
ThreadPool.poolSize = poolSize;
}
public static <T, E extends Reducible<E>, F> Collection<E> map
(final Collection<T> pElements, final E Operator, final Operation<E, T> pOperation) {
ExecutorService execSvc = Executors.newFixedThreadPool(ThreadPool.poolSize);
final LinkedList<E> queue = new LinkedList<E>();
for (int i = 0; i < ThreadPool.poolSize; i++) {
queue.add((E) Operator.copy());
}
System.err.printf("Performing map-reduce on %d cores\n", queue.size());
List<Pair<Integer, T>> indexedElements = new ArrayList<Pair<Integer, T>>(pElements.size());
int index = 0;
for (final T element : pElements) {
indexedElements.add(new Pair<Integer, T>(index, element));
index++;
}
int size = index;
final ArrayList<E> executors = new ArrayList<E>(size);
int numStarted = 0;
for (final Pair<Integer, T> element : indexedElements) {
synchronized (queue) {
while (queue.isEmpty()) {
try {
queue.wait();
numStarted++;
if (numStarted % 500 == 0)
System.out.printf(".", queue.size());
} catch (InterruptedException e) {
System.err.println(e.getMessage());
}
}
executors.add(queue.removeFirst());
}
try {
execSvc.execute(
new Runnable() {
@Override
public void run() {
pOperation.perform(executors.get(element.getFirst()),
element.getFirst(), element.getSecond());
synchronized (queue) {
queue.add(executors.get(element.getFirst()));
queue.notify();
}
}
});
} catch (Exception e) {
System.err.println(e.getMessage());
e.printStackTrace();
}
}
synchronized (queue) {
while (queue.size() != poolSize) {
// System.err.printf ("Waiting for the last threads to finish " +
// "%d of %d\n", queue.size(), ThreadPool.poolSize );
try {
queue.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
return queue;
}
public static <T, E extends Reducible<E>, F> E mapReduce
(final Collection<T> pElements, final E Operator, final Operation<E, T> pOperation) {
Collection<E> queue = map(pElements, Operator, pOperation);
Reducer<E> accumulator = new Reducer<E>();
return accumulator.reduce(queue);
}
public static interface Operation<E, T> {
public void perform(E operator, int index, T pParameter);
}
}
| [
"wangfengmadking@gmail.com"
] | wangfengmadking@gmail.com |
208ab186f5333aa2df9d3683ce9509c78a6a896e | 14e01f217256b6ac6e0fd0e3546ee4ae1d5a5ff5 | /core/src/fr/ul/duckseditor/Control/SelectorButtons/SelectorRight.java | 76553646b82b7579ac1dcc5ba89d0e86c7ef891d | [] | no_license | Bert54/MobileDev | fa3c1b84e40eb6ac652d45020ccad017af697719 | 6fc17fbe7549df5809e611faf86ed1ec81b6ff98 | refs/heads/master | 2020-04-18T12:37:42.321612 | 2019-01-25T11:55:12 | 2019-01-25T11:55:12 | 167,539,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package fr.ul.duckseditor.Control.SelectorButtons;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.physics.box2d.World;
import fr.ul.duckseditor.DataFactory.TextureFactory;
import static fr.ul.duckseditor.View.EditorScreen.CAMERAHEIGHT;
import static fr.ul.duckseditor.View.EditorScreen.CAMERAWIDTH;
public class SelectorRight extends SelectorButton {
protected float size = Math.max(CAMERAWIDTH/40f, CAMERAHEIGHT/40f) * 4;
protected static float positionX = CAMERAWIDTH/1.2f;
protected static float positionY = CAMERAHEIGHT/2f;
public SelectorRight(World world) {
super();
float vertices[] = new float[8];
vertices[0] = positionX;
vertices[1] = positionY;
vertices[2] = positionX+size;
vertices[3] = positionY;
vertices[4] = positionX+size;
vertices[5] = positionY+size;
vertices[6] = positionX;
vertices[7] = positionY+size;
this.shape.set(vertices);
this.fixtureDef.shape = this.shape;
this.body = world.createBody(this.bodyDef);
this.body.createFixture(this.fixtureDef);
this.shape.dispose();
}
@Override
public void draw(SpriteBatch sb) {
sb.draw(TextureFactory.getInstance().getRightArrow(), positionX, positionY, this.size, this.size);
}
}
| [
"matt.bert@live.fr"
] | matt.bert@live.fr |
8173fc644b9230f9dc9259296f17478b2c0feaee | 13d309bfec556ce5125944709c25e2e112461b47 | /src/main/java/BerlinSeconds.java | eb91b848d4e1f03fd590520b80e8cda1da49a7e4 | [] | no_license | odin-asen/tdd-kata-berlin-uhr | 7a0bedb3bc7e6d83458ee587b393a04c3d8b1bae | 24522cd17f882d63dd2c4d23ffb63a71198212c7 | refs/heads/master | 2020-03-28T13:17:39.155239 | 2018-09-11T21:19:43 | 2018-09-11T21:19:43 | 148,380,710 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | public class BerlinSeconds {
private int seconds;
public BerlinSeconds(int seconds) {
validate(seconds);
this.seconds = seconds;
}
private void validate(int seconds) {
if (seconds < 0 || seconds > 59) {
throw new IllegalArgumentException();
}
}
public String getOutput() {
if (seconds % 2 == 0) {
return StringOutputSymbol.OFF.toString();
} else {
return StringOutputSymbol.YELLOW.toString();
}
}
}
| [
"timm.herrmann@freenet.de"
] | timm.herrmann@freenet.de |
fa0030f95597957877bbeafbc5e27bd6a2eb0b23 | 09e8e5152f12877f22de560cdb324ff2c218bef9 | /whirl/android/app/src/debug/gen/com/example/whirl/BuildConfig.java | ca3fc01a52321319b4e120a363a8eb07d175963f | [] | no_license | cs340-20/Whirl | cac5b3c7bfc060724aba2bb5f240930f88b5657a | b9a76cc4c61f636b84cec2b64c7a55d2922ee412 | refs/heads/master | 2020-12-19T02:45:36.301311 | 2020-05-31T02:26:00 | 2020-05-31T02:26:00 | 235,595,137 | 7 | 1 | null | 2020-03-09T01:13:54 | 2020-01-22T14:50:11 | Dart | UTF-8 | Java | false | false | 259 | java | /*___Generated_by_IDEA___*/
package com.example.whirl;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
} | [
"mattmohandiss@gmail.com"
] | mattmohandiss@gmail.com |
b15d0a51860cf507971e30e6ba0739d686bf9f82 | 83a4e6a34a7a4f14aca6b68048714a71a8d1e40e | /Codigo/InstrumusicWeb/src/main/java/edu/co/sena/instrumusic/controller/administrador/beans/CarritoDeComprasFacade.java | 89999847d0de5e456158600199fd298663298c9e | [] | no_license | nmrada/Instrumusic-Web | 9b494aa3ada8532466610b1928f1d10e914cf300 | 146f4093496a260cac05546679a768d1083b6426 | refs/heads/master | 2021-01-18T20:21:34.090438 | 2015-06-12T20:11:39 | 2015-06-12T20:11:39 | 36,659,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 874 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.co.sena.instrumusic.controller.administrador.beans;
import edu.co.sena.instrumusic.model.entities.CarritoDeCompras;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author aprendiz
*/
@Stateless
public class CarritoDeComprasFacade extends AbstractFacade<CarritoDeCompras> {
@PersistenceContext(unitName = "edu.co.sena_InstrumusicWeb_war_1.0-SNAPSHOTPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public CarritoDeComprasFacade() {
super(CarritoDeCompras.class);
}
}
| [
"aprendiz@301_PC_11.corcolsutec.edu.co"
] | aprendiz@301_PC_11.corcolsutec.edu.co |
d8e038e6cb6e2241043dc0789f63a24ca41cb5bc | ff1fa232add9298921cba67377bdb06ed64544b6 | /chapter-07-other-web-frameworks/coursemanager-gwt/src/main/java/org/rooinaction/coursemanager/web/gwt/requests/RegistrationRequest.java | e1974defd2b2979ac2bcd273c166b2d1f5f62300 | [] | no_license | tsuji/spring-roo-in-action-examples | a60f1b74997101635caffdd9d19c351d5d0af079 | a2dd5af5cdd0a6ae1817bf896c7a3dffc38f954a | refs/heads/master | 2021-01-18T08:21:55.457227 | 2013-01-30T18:26:41 | 2013-01-30T18:26:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,585 | java | // WARNING: THIS FILE IS MANAGED BY SPRING ROO.
package org.rooinaction.coursemanager.web.gwt.requests;
import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.ServiceName;
import java.util.Date;
import org.rooinaction.coursemanager.web.gwt.proxies.OfferingProxy;
import org.rooinaction.coursemanager.web.gwt.proxies.StudentProxy;
import org.springframework.roo.addon.gwt.RooGwtRequest;
@RooGwtRequest(value = "org.rooinaction.coursemanager.model.Registration", exclude = { "clear", "entityManager", "equals", "flush", "hashCode", "merge", "toString" })
@ServiceName("org.rooinaction.coursemanager.model.Registration")
public interface RegistrationRequest extends RequestContext {
abstract Request<java.lang.Long> countRegistrations();
abstract Request<java.util.List<org.rooinaction.coursemanager.web.gwt.proxies.RegistrationProxy>> findAllRegistrations();
abstract Request<java.util.List<org.rooinaction.coursemanager.web.gwt.proxies.RegistrationProxy>> findRegistrationEntries(int firstResult, int maxResults);
abstract Request<org.rooinaction.coursemanager.web.gwt.proxies.RegistrationProxy> findRegistration(Long id);
abstract InstanceRequest<org.rooinaction.coursemanager.web.gwt.proxies.RegistrationProxy, java.lang.Void> persist();
abstract InstanceRequest<org.rooinaction.coursemanager.web.gwt.proxies.RegistrationProxy, java.lang.Void> remove();
}
| [
"krimple@chariotsolutions.com"
] | krimple@chariotsolutions.com |
dd930d6affbf84f130f0e836a71160741b7f2411 | a504fe39e5999c60eb6c8cf5091ae2514c8d9cd0 | /src/main/java/eu/zomtec/em2012/updater/League.java | c5a57f2676e097ab8190912bf74afaa5729beb54 | [
"MIT"
] | permissive | z0mt3c/euro-bet | 13375c461cc02da2ffad9be97f82c10e4fee1bd7 | 46eb36042c36a8b7a1751904419688dd5695fb49 | refs/heads/master | 2021-06-02T22:26:07.163797 | 2018-06-19T07:58:23 | 2018-06-19T07:58:23 | 20,211,198 | 0 | 1 | null | 2018-06-19T07:58:24 | 2014-05-27T07:36:23 | AspectJ | UTF-8 | Java | false | false | 763 | java | package eu.zomtec.em2012.updater;
import java.util.Date;
import java.util.Map;
public class League {
private boolean tournament;
private Long leagueId;
private Date timestamp;
private Map<Long, Match> matches;
public boolean isTournament() {
return tournament;
}
public void setTournament(boolean tournament) {
this.tournament = tournament;
}
public Long getLeagueId() {
return leagueId;
}
public void setLeagueId(Long leagueId) {
this.leagueId = leagueId;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Map<Long, Match> getMatches() {
return matches;
}
public void setMatches(Map<Long, Match> matches) {
this.matches = matches;
}
}
| [
"zomtec@10.0.1.4"
] | zomtec@10.0.1.4 |
775ce6ffe41a5d0f260b6a51eaa0bf5019f66066 | e11e0be27bd187b211e730a144688f4711608447 | /app/src/main/java/cn/hwwwwh/taoxiang/dagger/PresenterComponent.java | f898c8d80206773604e8a804629285e68617ab9c | [] | no_license | sudoconf/taoxiang | 542d4d76376c8e82d676e9ce30053c51ee369af4 | 06d063029076084c5d654055d34aec3718432222 | refs/heads/master | 2020-04-19T04:42:43.307173 | 2019-01-23T03:12:47 | 2019-01-23T03:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java | package cn.hwwwwh.taoxiang.dagger;
import javax.inject.Singleton;
import cn.hwwwwh.taoxiang.base.BaseActivity;
import cn.hwwwwh.taoxiang.dagger.module.PresenterModule;
import cn.hwwwwh.taoxiang.view.activity.AliSdkWebViewProxyActivity;
import cn.hwwwwh.taoxiang.view.activity.CollectActivity;
import cn.hwwwwh.taoxiang.view.activity.MainActivity;
import cn.hwwwwh.taoxiang.view.activity.TmrActivity;
import dagger.Component;
/**
* Created by 97481 on 2017/10/5/ 0005.
*/
@Singleton
@Component(modules = {PresenterModule.class})
public interface PresenterComponent {
/**
* 注入点
* @param activity 表示需要使用DaggerPresenterComponent.create().inject(this);注入的地方,
* 注意,此处一定不要使用Activity,需要使用MainActivity,否则的话会报空指针异常。
* 因为这里的注入点是什么,就会到该类里面去找。如果写Activity,就会到Activity里面去找,
* 而Activity中并没有@inject,即没有需要注入的地方,所以在生成的DaggerPresenterComponent
* 中,方法就不会被调用。
*/
void inject( MainActivity activity);
void inject(TmrActivity activity);
void inject(AliSdkWebViewProxyActivity activity);
void inject(CollectActivity collectActivity);
void inject(BaseActivity baseActivity);
}
| [
"974815768@qq.com"
] | 974815768@qq.com |
4955e392192ddc28569a16583b8d2b70f3534168 | d0bc7c81966eb466666509d65462be7fba1757e2 | /wodeapp/src/main/java/com/example/wodeapp/bean/LoginBean.java | 3d604424c1d283c6a34538bef4cca32679dd3113 | [] | no_license | qinchaomeng/wodeapp | 0b703763333e6f902bb3dc967bf86d57014dbeeb | aac16b9fcf66eebf29f08cba868ad6d629cb8559 | refs/heads/master | 2020-05-09T13:19:23.585965 | 2019-04-13T09:14:22 | 2019-04-13T09:14:22 | 181,147,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,299 | java | package com.example.wodeapp.bean;
public class LoginBean {
/**
* result : {"headPic":"http://172.17.8.100/images/small/default/user.jpg","nickName":"UM_3t5Gc","phone":"15117967942","sessionId":"15551257181103423","sex":1,"userId":3423}
* message : 登录成功
* status : 0000
*/
private ResultBean result;
private String message;
private String status;
public ResultBean getResult() {
return result;
}
public void setResult(ResultBean result) {
this.result = result;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public static class ResultBean {
/**
* headPic : http://172.17.8.100/images/small/default/user.jpg
* nickName : UM_3t5Gc
* phone : 15117967942
* sessionId : 15551257181103423
* sex : 1
* userId : 3423
*/
private String headPic;
private String nickName;
private String phone;
private String sessionId;
private int sex;
private int userId;
public String getHeadPic() {
return headPic;
}
public void setHeadPic(String headPic) {
this.headPic = headPic;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
}
}
| [
"1980057074@qq.com"
] | 1980057074@qq.com |
7a11a4abfcbba742a24d48707ec48be15b14b950 | 384f3a10e4c788f1b1dfecf9c2537890b1390b3f | /src/main/java/com/tinderjob/TinderJobCrud/Model/Endereco.java | 85f7f72b7df7b01f0370c741fd924a5d377daf22 | [
"MIT"
] | permissive | instereo4/TinderJob2.0 | 682a92969768750b5f2df96522934def1177653b | d7759ecb68527a1361d601934d69d262c449aed7 | refs/heads/main | 2023-05-16T20:34:36.489217 | 2021-06-08T18:28:41 | 2021-06-08T18:28:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,402 | java | package com.tinderjob.TinderJobCrud.Model;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@Table(name = "endereco")
public class Endereco {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String CEP;
private String numeroCasa;
private String rua;
private String bairro;
private String cidade;
private String estado;
private String complemento;
@OneToOne
@JoinColumn(name = "usuario_id")
private Usuario usuario;
@ManyToMany
@JoinColumn(name = "dadosPessoais_id")
private List<DadosPessoais> dadosPessoais;
public Endereco(int id, String cEP, String numeroCasa, String rua, String bairro, String cidade, String estado,
String complemento) {
this.id = id;
CEP = cEP;
this.numeroCasa = numeroCasa;
this.rua = rua;
this.bairro = bairro;
this.cidade = cidade;
this.estado = estado;
this.complemento = complemento;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCEP() {
return CEP;
}
public void setCEP(String cEP) {
CEP = cEP;
}
public String getNumeroCasa() {
return numeroCasa;
}
public void setNumeroCasa(String numeroCasa) {
this.numeroCasa = numeroCasa;
}
public String getRua() {
return rua;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
public String getComplemento() {
return complemento;
}
public void setComplemento(String complemento) {
this.complemento = complemento;
}
}
| [
"edupontes.devsforce@gmail.com"
] | edupontes.devsforce@gmail.com |
c2c67da366becf64a42fe20f635b5694595fe917 | 3ccc3cedfd71942692b66b189e21079f93e4fe4c | /AL-Game/src/com/aionemu/gameserver/dataholders/ConquestPortalData.java | 8dd6995dfe0d33ba2fdfc9030f7ba91eae61adf2 | [] | no_license | Ritchiee/Aion-Lightning-5.0-SRC | 5a4d4ce0bb5c88c05d05c9eb1132409e0dcf1c50 | 6a2f3f6e75572d05f299661373a5a34502f192ab | refs/heads/master | 2020-03-10T03:44:00.991145 | 2018-02-27T17:20:53 | 2018-02-27T17:20:53 | 129,173,070 | 1 | 0 | null | 2018-04-12T01:06:26 | 2018-04-12T01:06:26 | null | UTF-8 | Java | false | false | 1,623 | java | /**
c * This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.dataholders;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.aionemu.gameserver.model.templates.portal.ConquestPortal;
import javolution.util.FastList;
/**
* @author CoolyT
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "conquest_portals")
public class ConquestPortalData
{
@XmlElement(name = "portal")
public FastList<ConquestPortal> portals = new FastList<ConquestPortal>();
public int size()
{
return portals.size();
}
public ConquestPortal getPortalbyNpcId(int id)
{
for (ConquestPortal portal : portals)
{
if (portal.npcId == id)
return portal;
}
return null;
}
public FastList<ConquestPortal> getPortals()
{
return portals;
}
}
| [
"michelgorter@outlook.com"
] | michelgorter@outlook.com |
88db850e6bad0093cffcdaa6c87049d08a975be7 | aab885cf4d58fe840dc01f96fa8a62c595e298b5 | /app/src/main/java/com/group6/babytime/pojo/Story.java | d092b7dc0dd8b316de1f1815447200417c08df60 | [
"Apache-2.0"
] | permissive | cxy950705/Group6Project | 800c0e75437d323ee598244bac658b706591aa68 | c8a9913a1afc3d46e2a5c961f3ba9beeebf7531b | refs/heads/master | 2021-01-17T15:23:08.665860 | 2016-10-26T02:58:39 | 2016-10-26T02:58:39 | 70,442,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,316 | java | package com.group6.babytime.pojo;
import android.os.Parcel;
import android.os.Parcelable;
public class Story implements Parcelable {
private Integer story_id;
private String story_name;
private String story_type;
private String story_cover;
private Integer story_clicknum;
private String story_introduction;
private Integer story_episode;
private String story_content;
public Story(){
}
public Story(Integer story_id, String story_name, String story_type,
String story_cover, Integer story_clicknum,
String story_introduction, Integer story_episode,
String story_content) {
super();
this.story_id = story_id;
this.story_name = story_name;
this.story_type = story_type;
this.story_cover = story_cover;
this.story_clicknum = story_clicknum;
this.story_introduction = story_introduction;
this.story_episode = story_episode;
this.story_content = story_content;
}
public Integer getStory_id() {
return story_id;
}
public void setStory_id(Integer story_id) {
this.story_id = story_id;
}
public String getStory_name() {
return story_name;
}
public void setStory_name(String story_name) {
this.story_name = story_name;
}
public String getStory_type() {
return story_type;
}
public void setStory_type(String story_type) {
this.story_type = story_type;
}
public String getStory_cover() {
return story_cover;
}
public void setStory_cover(String story_cover) {
this.story_cover = story_cover;
}
public Integer getStory_clicknum() {
return story_clicknum;
}
public void setStory_clicknum(Integer story_clicknum) {
this.story_clicknum = story_clicknum;
}
public String getStory_introduction() {
return story_introduction;
}
public void setStory_introduction(String story_introduction) {
this.story_introduction = story_introduction;
}
public Integer getStory_episode() {
return story_episode;
}
public void setStory_episode(Integer story_episode) {
this.story_episode = story_episode;
}
public String getStory_content() {
return story_content;
}
public void setStory_content(String story_content) {
this.story_content = story_content;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(this.story_id);
dest.writeString(this.story_name);
dest.writeString(this.story_type);
dest.writeString(this.story_cover);
dest.writeValue(this.story_clicknum);
dest.writeString(this.story_introduction);
dest.writeValue(this.story_episode);
dest.writeString(this.story_content);
}
protected Story(Parcel in) {
this.story_id = (Integer) in.readValue(Integer.class.getClassLoader());
this.story_name = in.readString();
this.story_type = in.readString();
this.story_cover = in.readString();
this.story_clicknum = (Integer) in.readValue(Integer.class.getClassLoader());
this.story_introduction = in.readString();
this.story_episode = (Integer) in.readValue(Integer.class.getClassLoader());
this.story_content = in.readString();
}
public static final Parcelable.Creator<Story> CREATOR = new Parcelable.Creator<Story>() {
@Override
public Story createFromParcel(Parcel source) {
return new Story(source);
}
@Override
public Story[] newArray(int size) {
return new Story[size];
}
};
}
| [
"690948601@qq.com"
] | 690948601@qq.com |
37eb711584877f1028bda86663c7ba128e62520b | eb66c3a302f49823fcbf34a49514642e2db0f4d0 | /rsb/methods/Account.java | ed7740d64b21bab98950af476f125832c23a4f5d | [
"BSD-3-Clause"
] | permissive | kjax139/RSB | b8afa310e68ba9e89809dc3a395fc3694f638217 | 9481c39f7bf673e12029c05ad2dd15267022f36c | refs/heads/master | 2022-12-22T07:43:30.901967 | 2020-08-18T07:07:32 | 2020-08-18T07:07:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 996 | java | package net.runelite.client.rsb.methods;
import net.runelite.client.rsb.gui.AccountManager;
import java.util.logging.Logger;
/**
* Selected account information.
*/
public class Account extends MethodProvider {
Logger log = Logger.getLogger(getClass().getName());
public Account(MethodContext ctx) {
super(ctx);
}
/**
* The account name.
*
* @return The currently selected account's name.
*/
public String getName() {
return methods.runeLite.getAccountName();
}
/**
* The account password.
*
* @return The currently selected account's password.
*/
public String getPassword() {
return AccountManager.getPassword(getName());
}
/**
* The account pin.
*
* @return The currently selected account's pin.
*/
public String getPin() {
return AccountManager.getPin(getName());
}
/**
* The account reward.
*
* @return The currently selected account's reward.
*/
public String getReward() {
return AccountManager.getReward(getName());
}
}
| [
"18173108+GigiaJ@users.noreply.github.com"
] | 18173108+GigiaJ@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.