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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d65777313b48c4dd764bff3f9e47993dc7a86419 | b92d4ba43e6e21ce5d23f7fc6380ee2576d9fc59 | /src/cs652/j/codegen/model/CallStat.java | 58106382680cc4f90d89993a240343e7f974d806 | [
"BSD-2-Clause"
] | permissive | bkommineni/CS652-Java-To-C-Translator-Part3 | 0d190cb7913da8326f8a9a9026345baf0ddc0cf4 | bdd25bba912ac43b675bbf5f8227fc1fb5637200 | refs/heads/master | 2021-05-08T16:28:07.369684 | 2017-04-28T04:15:56 | 2017-04-28T04:15:56 | 120,158,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package cs652.j.codegen.model;
import org.stringtemplate.v4.ST;
/**
* Created by bharu on 3/23/17.
*/
public class CallStat extends Stat {
@ModelElement public MethodCall call;
public CallStat(MethodCall call) {
this.call = call;
}
}
| [
"bharu@Bhargavis-MacBook-Pro.local"
] | bharu@Bhargavis-MacBook-Pro.local |
5651f54d39814afcf5913681aa00511913da981c | f05974aa4904d1c8d66b123aa03c2b27dc5918d1 | /ripple-openehr/src/main/java/org/rippleosi/patient/laborders/search/OpenEHRLabOrderSearch.java | ade331cf26dfe6e330e63440b43f02c8d3faa935 | [
"Apache-2.0"
] | permissive | viktor219/Ripple-Middleware | f1111e6c71195ae5fc1b9d98fb8b2b66120b640f | e064c01155ab502e8df83a231e65b49a91932d24 | refs/heads/master | 2020-07-08T14:54:37.147636 | 2016-11-17T12:13:56 | 2016-11-17T12:13:56 | 74,023,820 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,488 | java | /*
* Copyright 2015 Ripple OSI
*
* 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.rippleosi.patient.laborders.search;
import java.util.List;
import org.rippleosi.common.service.AbstractOpenEhrService;
import org.rippleosi.patient.laborders.model.LabOrderDetails;
import org.rippleosi.patient.laborders.model.LabOrderSummary;
import org.springframework.stereotype.Service;
/**
*/
@Service
public class OpenEHRLabOrderSearch extends AbstractOpenEhrService implements LabOrderSearch {
@Override
public List<LabOrderSummary> findAllLabOrders(String patientId) {
LabOrderSummaryQueryStrategy query = new LabOrderSummaryQueryStrategy(patientId);
return findData(query);
}
@Override
public LabOrderDetails findLabOrder(String patientId, String labOrderId) {
LabOrderDetailsQueryStrategy query = new LabOrderDetailsQueryStrategy(patientId, labOrderId);
return findData(query);
}
}
| [
"viktorbalybin@outlook.com"
] | viktorbalybin@outlook.com |
b90ee98d2812251793da3877716aa8ecf68c5b7c | d18656356ea34869db33059e3d922b94f7ca9bca | /src/main/java/com/google/i18n/pseudolocalization/format/MessageCatalog.java | f429a98feb6d2705299cc7b2f574b5b3786deeb5 | [
"Apache-2.0"
] | permissive | jsilland/cub | 09db0067b05a2e7ade6e28d1c9d763a9da63341f | 1f0f8de0f56892b9bee5af3134f113bd01e3c4a0 | refs/heads/master | 2021-01-23T07:03:01.849838 | 2014-09-21T01:33:56 | 2014-09-21T01:33:56 | 10,746,395 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,381 | java | /*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.i18n.pseudolocalization.format;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Interface of a message catalog which is both readable and writable.
*
* NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE.
*/
public interface MessageCatalog {
/**
* Read a message catalog from an input stream.
*
* @param istr
* @return a {@link ReadableMessageCatalog} instance
* @throws IOException
*/
ReadableMessageCatalog readFrom(InputStream istr) throws IOException;
/**
* Write a message catalog to an output stream.
*
* @param ostr
* @return a {@link WritableMessageCatalog} instance
* @throws IOException
*/
WritableMessageCatalog writeTo(OutputStream ostr) throws IOException;
}
| [
"jat@google.com@967d3ebf-6803-1e13-ace7-bbc928063b56"
] | jat@google.com@967d3ebf-6803-1e13-ace7-bbc928063b56 |
78de8f4af53216f25dd85245ec975e522606b037 | 092ea6642443390b55c5bdd70aaefce0e77f628a | /TravelPlan/src/model/PlanFlickrDAO.java | 88eb1a70121f937720277a74fdd29ecb16b5ad0d | [] | no_license | wgychris/Task8 | 0effc0dcfa2b92a53d8f818b42b7d22edfce5aaf | 6147996ef8100b0136e30140f67bc911aa9fbd01 | refs/heads/master | 2021-01-17T17:07:20.519793 | 2014-02-18T04:45:52 | 2014-02-18T04:45:52 | 16,654,133 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,020 | java | package model;
import org.genericdao.ConnectionPool;
import org.genericdao.DAOException;
import org.genericdao.GenericDAO;
import org.genericdao.MatchArg;
import org.genericdao.RollbackException;
import databeans.*;
public class PlanFlickrDAO extends GenericDAO<PlanFlickrBean> {
public PlanFlickrDAO(String tableName, ConnectionPool cp) throws DAOException {
super(PlanFlickrBean.class, tableName, cp);
}
/*
* void createNewPlan
*
* @param transactionBean
*
* @return void
*/
public void createNewPlan(PlanFlickrBean bean) throws RollbackException {
createAutoIncrement(bean);
}
/*
* PlanFlickerBean[] getPlanFlikcrByPlanId
*
* @description Get all PlanFlickrs of a certain user
*
* @param user_id
*
* @return PlanFlickrBean[]
*/
public PlanFlickrBean[] getPlanFlikcerByPlanId(int plan_id) throws RollbackException {
PlanFlickrBean[] pfb = match(MatchArg.equals("plan_id", plan_id));
if (pfb != null && pfb.length > 0)
return pfb;
else
return null;
}
}
| [
"sylviafang0@gmail.com"
] | sylviafang0@gmail.com |
e83505feb935ec86ef3a8c9f6f6f36e296d9ff3b | 139960e2d7d55e71c15e6a63acb6609e142a2ace | /mobile_app1/module1022/src/main/java/module1022packageJava0/Foo101.java | 78e07501a9defdac8b2a76ccb8e7db37046263dd | [
"Apache-2.0"
] | permissive | uber-common/android-build-eval | 448bfe141b6911ad8a99268378c75217d431766f | 7723bfd0b9b1056892cef1fef02314b435b086f2 | refs/heads/master | 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 | Apache-2.0 | 2021-09-24T08:55:30 | 2020-09-11T23:27:37 | Java | UTF-8 | Java | false | false | 296 | java | package module1022packageJava0;
import java.lang.Integer;
public class Foo101 {
Integer int0;
public void foo0() {
new module1022packageJava0.Foo100().foo3();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
}
| [
"oliviern@uber.com"
] | oliviern@uber.com |
78c03a52e2fad6ed65425fc9e68497d5fb9a15eb | 677e64ae83d4c73a8ef4710a58363432ed340315 | /SlideListView/src/com/slide/view/SlideView.java | 024ce5dfc2a0689fef965efc573ffe5e57119563 | [
"Apache-2.0"
] | permissive | tangjiabing/SlideListView | f86c209e16877b62b00e247ee92dd7cc86aa8120 | ce22e5329463d84d4e41e57ead71c19419069faa | refs/heads/master | 2021-01-10T02:49:25.343065 | 2016-04-01T15:35:07 | 2016-04-01T15:35:07 | 55,242,363 | 2 | 1 | null | null | null | null | GB18030 | Java | false | false | 8,950 | java | package com.slide.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.Scroller;
import com.slide.demo.R;
/**
*
* @author tangjiabing
*
* @see 开源时间:2016年04月01日
*
* 记得给我个star哦~
*
*/
public class SlideView extends LinearLayout {
private static final int SCROLL_OUT = 0x11; // 已滑出来了
private static final int SCROLLING = 0x12; // 正在滑动
private static final int NOT_SCROLL = 0x13; // 不能滑动
// 用来控制滑动角度,仅当角度a满足条件时才进行滑动:tan a = deltaX / deltaY
private static final int TAN_ANGLE = 50; // 正切角度
private static final int QUICK_TAN_ANGLE = 70; // 快速滑动时要求的正切角度
private static final int QUICK_SNAP_VELOCITY = 900; // 快速的手指滑动速度
private static final int NORMAL_SNAP_VELOCITY = 600; // 普通的手指滑动速度
private static final int SLOW_SNAP_VELOCITY = 100; // 缓慢的手指滑动速度
private int mTouchSlop = 0; // 用户滑动的最小距离
private double mTanValue = 0; // 正切值
private double mQuickTanValue = 0; // 快速滑动时要求的正切值
private int mLastX = 0; // 上次滑动的x坐标
private int mLastY = 0; // 上次滑动的y坐标
private int mDownX = 0; // 按下去时的x坐标
private int mDownY = 0; // 按下去时的y坐标
private int mScrollStatus = 0; // 滑动状态
private Scroller mScroller = null; // 弹性滑动对象,提供弹性滑动效果
private FrameLayout mItemContentView = null; // 用来放置所有view的容器
private FrameLayout mSlideContentView = null; // 用来放置滑动view的容器
private int mSlideContentWidth = 0; // 滑动view的宽度
private VelocityTracker mVelocityTracker = null; // 速度追踪对象
private boolean mIsCanLeftSlide = true; // SlideView是否可以左滑,true为可以
public SlideView(Context context) {
this(context, null);
}
public SlideView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public SlideView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
public void setItemContentView(View v) {
mItemContentView.addView(v);
}
public void setSlideContentView(View v) {
mSlideContentView.addView(v);
}
public void quickReset() {
if (!mScroller.isFinished())
mScroller.abortAnimation();
scrollTo(0, 0);
mScrollStatus = 0;
recycleVelocityTracker();
}
@Override
public void computeScroll() {
if (mScroller.computeScrollOffset()) {
scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
postInvalidate();
}
}
public void setCanLeftSlide(boolean flag) {
mIsCanLeftSlide = flag;
}
// ***********************************************************************
// 保护方法
protected void onHandleTouchEvent(MotionEvent event) {
if (mIsCanLeftSlide == true) {
int x = (int) event.getX();
int y = (int) event.getY();
int scrollX = getScrollX();
addVelocityTracker(event);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mDownX = x;
mDownY = y;
break;
case MotionEvent.ACTION_MOVE:
int deltaX = x - mLastX;
int deltaY = y - mLastY;
int xVelocity = 0;
int yVelocity = 0;
if (mScrollStatus == 0 || mScrollStatus == SCROLL_OUT) {
xVelocity = Math.abs(getScrollXVelocity());
yVelocity = Math.abs(getScrollYVelocity());
if (xVelocity > SLOW_SNAP_VELOCITY
|| Math.abs(x - mDownX) > mTouchSlop) {
double tan = 0;
if (xVelocity < QUICK_SNAP_VELOCITY)
tan = mTanValue;
else
tan = mQuickTanValue;
if (Math.abs(deltaX) >= Math.abs(deltaY) * tan)
mScrollStatus = SCROLLING;
else
mScrollStatus = NOT_SCROLL;
} else if (yVelocity > SLOW_SNAP_VELOCITY
|| Math.abs(y - mDownY) > mTouchSlop)
mScrollStatus = NOT_SCROLL;
}
if (mScrollStatus == SCROLLING) {
if (deltaX != 0) {
int newScrollX = scrollX - deltaX;
if (newScrollX < 0)
newScrollX = 0;
else if (newScrollX > mSlideContentWidth)
newScrollX = mSlideContentWidth;
scrollTo(newScrollX, 0);
}
}
break;
case MotionEvent.ACTION_UP:
if (mScrollStatus == SCROLLING) {
int direction = 0; // 滑动方向
int left = -1;
int right = 1;
xVelocity = getScrollXVelocity();
if (xVelocity > 0)
direction = right;
else
direction = left;
mScrollStatus = 0;
int newScrollX = 0;
if (Math.abs(xVelocity) > NORMAL_SNAP_VELOCITY) {
if (direction == left) {
mScrollStatus = SCROLL_OUT;
newScrollX = mSlideContentWidth;
}
} else {
double scale = 0;
if (direction == left)
scale = 0.4;
else
scale = 0.6;
if (scrollX > mSlideContentWidth * scale) {
mScrollStatus = SCROLL_OUT;
newScrollX = mSlideContentWidth;
}
}
smoothScrollTo(newScrollX, 0);
} else
mScrollStatus = 0;
recycleVelocityTracker();
break;
}
mLastX = x;
mLastY = y;
} else
mScrollStatus = NOT_SCROLL;
}
protected void reset() {
smoothScrollTo(0, 0);
mScrollStatus = 0;
recycleVelocityTracker();
}
protected boolean isScrollOut() {
if (mScrollStatus == SCROLL_OUT)
return true;
else
return false;
}
protected boolean isScrolling() {
if (mScrollStatus == SCROLLING)
return true;
else
return false;
}
protected boolean isNotScroll() {
if (mScrollStatus == NOT_SCROLL)
return true;
else
return false;
}
protected boolean isCanLeftSlide() {
return mIsCanLeftSlide;
}
protected void setItemContentViewPressed(boolean flag) {
setPressed(mItemContentView, flag);
}
protected void setItemContentViewEnabled(boolean flag) {
setEnabled(mItemContentView, flag);
}
protected void setDownXY(int downX, int downY) {
mDownX = downX;
mDownY = downY;
mLastX = downX;
mLastY = downY;
}
// ***********************************************************************
// 私有方法
private void init(Context context) {
mScroller = new Scroller(context); // 初始化弹性滑动对象
setOrientation(LinearLayout.HORIZONTAL); // 设置其方向为横向
// 解决listview中item的焦点占用问题
setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
View.inflate(context, R.layout.merge_slide_view, this); // 将merge_slide_view加载进来
mItemContentView = (FrameLayout) findViewById(R.id.itemContentView);
mSlideContentView = (FrameLayout) findViewById(R.id.slideContentView);
mItemContentView.setBackgroundDrawable(getResources().getDrawable(
R.drawable.selector_slide_listview_item));
setBackgroundColor(getResources().getColor(R.color.slideview_bg));
mSlideContentWidth = Math.round(getResources().getDimension(
R.dimen.slide_content_width));
mTanValue = Math.tan(Math.toRadians(TAN_ANGLE));
mQuickTanValue = Math.tan(Math.toRadians(QUICK_TAN_ANGLE));
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
private void smoothScrollTo(int destX, int destY) {
int scrollX = getScrollX();
int delta = destX - scrollX;
mScroller.startScroll(scrollX, 0, delta, 0, Math.abs(delta) * 3);
invalidate();
}
private void addVelocityTracker(MotionEvent event) {
if (mVelocityTracker == null)
mVelocityTracker = VelocityTracker.obtain();
mVelocityTracker.addMovement(event);
}
private void recycleVelocityTracker() {
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker = null;
}
}
/**
* 获取X方向的滑动速度,大于0向右滑动,反之向左
*
* @return
*/
private int getScrollXVelocity() {
mVelocityTracker.computeCurrentVelocity(1000);
int velocity = (int) mVelocityTracker.getXVelocity();
return velocity;
}
/**
* 获取Y方向的滑动速度,大于0向下滑动,反之向上
*
* @return
*/
private int getScrollYVelocity() {
mVelocityTracker.computeCurrentVelocity(1000);
int velocity = (int) mVelocityTracker.getYVelocity();
return velocity;
}
private void setPressed(ViewGroup viewGroup, boolean flag) {
viewGroup.setPressed(flag);
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View childView = viewGroup.getChildAt(i);
if (childView instanceof ViewGroup)
setPressed((ViewGroup) childView, flag);
}
}
private void setEnabled(ViewGroup viewGroup, boolean flag) {
viewGroup.setEnabled(flag);
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View childView = viewGroup.getChildAt(i);
if (childView instanceof ViewGroup)
setEnabled((ViewGroup) childView, flag);
}
}
}
| [
"645895947@qq.com"
] | 645895947@qq.com |
cbc3c075ec4fbaa54d732a69df117d2d4ac27f32 | c3c9042b35b7d693ac6b898674ca834440ef234b | /chapter05-wallet/src/main/java/com/wudimanong/wallet/dao/mapper/UserBalanceOrderDao.java | b4532b4f83fe38382416faf0d85462b90f2f4e9f | [] | no_license | manongwudi/springcloud-action | 969ad7cc51a0e42d88ca5f1d5479d93939559397 | afaecb9764fa4da2f1bfb208203454162f1fdb86 | refs/heads/master | 2022-09-22T23:20:50.632705 | 2021-08-26T05:17:55 | 2021-08-26T05:17:55 | 229,698,585 | 2 | 2 | null | 2022-09-08T01:04:51 | 2019-12-23T07:19:28 | Java | UTF-8 | Java | false | false | 331 | java | package com.wudimanong.wallet.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wudimanong.wallet.dao.model.UserBalanceOrderPO;
import org.springframework.stereotype.Repository;
/**
* @author jiangqiao
*/
@Repository
public interface UserBalanceOrderDao extends BaseMapper<UserBalanceOrderPO> {
}
| [
"jiangqiao@mafengwo.com"
] | jiangqiao@mafengwo.com |
619a4eabfec3f44aef7b4828eb4454702041726b | c9b2fbe82f94160f71218d822f9745e460eb80f4 | /app/src/main/java/com/hongbao5656/adapter/SelectKeywordAdapter.java | 15aa8236c83873560138b5450c9ff44f31981f16 | [] | no_license | xiaocaimeng007/Hong1.0- | 06fbb0905635f70d93438e2af84a162649f3ee06 | 1e5e888c08234cafd226bf73294eba69028af5b9 | refs/heads/master | 2021-01-01T18:36:39.329932 | 2017-08-09T09:24:38 | 2017-08-09T09:24:38 | 98,383,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,608 | java | package com.hongbao5656.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hongbao5656.R;
import com.hongbao5656.entity.Region2;
import com.hongbao5656.util.SU;
import java.util.ArrayList;
import java.util.List;
public class SelectKeywordAdapter extends BaseAdapter {
private List<Region2> datas;
private LayoutInflater inflater;
private onItemClickListener listener;
public SelectKeywordAdapter(Context context, List<Region2> datas) {
this.inflater = LayoutInflater.from(context);
this.datas = datas;
if (this.datas == null) {
this.datas = new ArrayList<Region2>();
}
}
@Override
public int getCount() {
return datas.size();
}
@Override
public Object getItem(int position) {
return datas.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.item_lv_selectplace, null);
holder.gridview_item_name = (TextView) convertView.findViewById(R.id.gridview_item_name);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final Region2 vo = datas.get(position);
String GrandpaNmae = "".equals(vo.GrandpaNmae)?"":vo.GrandpaNmae+"-";
String ParentNmae = "".equals(vo.ParentNmae)?"":vo.ParentNmae;
String pNmae = "".equals(GrandpaNmae)&&"".equals(ParentNmae)?"":"("+GrandpaNmae+ParentNmae+")";
String voname = vo.Name;
String pname = pNmae;
if(!SU.isEmpty(vo.Name)){
voname = vo.Name;
}else{
voname = "";
}
if(!SU.isEmpty(pname)){
pname = pNmae;
}else{
pname = "";
}
holder.gridview_item_name.setText(vo.Name+" "+pNmae);
convertView.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (listener != null) {
listener.itemClick(vo);
}
}
});
return convertView;
}
class ViewHolder {
TextView gridview_item_name;
}
public void setItemClickListener(onItemClickListener listener) {
this.listener = listener;
}
public interface onItemClickListener {
void itemClick(Region2 info);
}
public List<Region2> getDatas() {
return this.datas;
}
public void clearListView() {
this.datas.clear();
}
public void update_list(List<Region2> datas) {
this.datas.clear();
this.datas.addAll(datas);
notifyDataSetChanged();
}
}
| [
"771540581@qq.com"
] | 771540581@qq.com |
f0ff5b306e05dd2dec485fae0b48dbd863707cd4 | 0b0499e40174620955dfaa8bfa359b807ddc95c0 | /src/ru/kpetryaev/scene/BallSpaceMain.java | e98aed50b36b0a130fe842c2ac8e45dc32b54ec6 | [] | no_license | sibstu-ivt/oop_labs | 8de985f67bcde0a9e8e0874beb1fe5fff4d7e3b1 | 375288d1a56447f86b611653175c464c931b57f0 | refs/heads/master | 2021-01-21T09:53:09.902726 | 2015-11-20T01:47:08 | 2015-11-20T01:47:08 | 46,459,911 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 513 | java | package ru.kpetryaev.scene;
import javafx.application.Application;
import javafx.stage.Stage;
public class BallSpaceMain extends Application {
@Override
public void start(Stage stage) throws Exception{
BallSpace ballSpace = new BallSpace();
// stage.setScene(new Scene(ballSpace));
stage.setTitle("Custom Control");
stage.setWidth(500);
stage.setHeight(400);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
| [
"numminorihsf@gmail.com"
] | numminorihsf@gmail.com |
465d3d946c1edb51734c793c6faa75fe482fd8c1 | 3bb5908564cf7f3bfed0f0b31001ff123515ca06 | /demo/src/com/manasa/PmFraction.java | 78ffb04989d7241d178ad6540ebe738a8b805698 | [
"MIT"
] | permissive | meturi/demo | eb84ad8df2fa8bb1cf142a007fd0f5011be24956 | 045cd3115dc678865b482119a30eb3ba79370014 | refs/heads/master | 2020-04-06T11:07:34.174199 | 2019-02-24T07:54:03 | 2019-02-24T07:54:03 | 157,404,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package com.manasa;
import java.util.Scanner;
public class PmFraction {
static void plusMinus(int ar[])
{
float j=0,k=0,l=0;
for(int i=0;i<ar.length;i++)
{
if(ar[i]<0)
j++;
if(ar[i]==0)
k++;
if(ar[i]>0)
l++;
}
System.out.println(j/ar.length);
System.out.println("zeroes fraction in array are" +(k/ar.length));
System.out.println("positive numbers fraction in array are" +(l/ar.length));
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("enter the length of array");
int n = sc.nextInt();
int ar[] = new int[n];
for(int i=0;i<n;i++)
{
ar[i]= sc.nextInt();
}
plusMinus(ar);
}
}
| [
"manasaeturi@gmail.com"
] | manasaeturi@gmail.com |
9517a47601c290fc305d9e4659169386f40c3093 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Chart-1/org.jfree.chart.renderer.category.AbstractCategoryItemRenderer/default/30/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer_ESTest.java | 7a206612822e4897561fdf4c0946682aeb5e96b0 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 113,715 | java | /*
* This file was automatically generated by EvoSuite
* Thu Jul 29 15:31:51 GMT 2021
*/
package org.jfree.chart.renderer.category;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.sql.Connection;
import java.text.NumberFormat;
import java.util.Locale;
import javax.swing.text.DefaultCaret;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.jfree.chart.BufferedImageRenderingSource;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.LegendItem;
import org.jfree.chart.LegendItemCollection;
import org.jfree.chart.annotations.CategoryAnnotation;
import org.jfree.chart.annotations.CategoryLineAnnotation;
import org.jfree.chart.annotations.CategoryPointerAnnotation;
import org.jfree.chart.annotations.CategoryTextAnnotation;
import org.jfree.chart.axis.Axis;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryAxis3D;
import org.jfree.chart.axis.CyclicNumberAxis;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.ExtendedCategoryAxis;
import org.jfree.chart.axis.LogAxis;
import org.jfree.chart.axis.LogarithmicAxis;
import org.jfree.chart.axis.ModuloAxis;
import org.jfree.chart.axis.NumberAxis3D;
import org.jfree.chart.axis.PeriodAxis;
import org.jfree.chart.axis.SegmentedTimeline;
import org.jfree.chart.axis.SubCategoryAxis;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.entity.EntityCollection;
import org.jfree.chart.entity.StandardEntityCollection;
import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator;
import org.jfree.chart.labels.CategoryItemLabelGenerator;
import org.jfree.chart.labels.CategorySeriesLabelGenerator;
import org.jfree.chart.labels.CategoryToolTipGenerator;
import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator;
import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
import org.jfree.chart.labels.StandardCategorySeriesLabelGenerator;
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
import org.jfree.chart.plot.CategoryCrosshairState;
import org.jfree.chart.plot.CategoryMarker;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.CombinedDomainCategoryPlot;
import org.jfree.chart.plot.CombinedDomainXYPlot;
import org.jfree.chart.plot.CombinedRangeCategoryPlot;
import org.jfree.chart.plot.DrawingSupplier;
import org.jfree.chart.plot.FastScatterPlot;
import org.jfree.chart.plot.IntervalMarker;
import org.jfree.chart.plot.MeterPlot;
import org.jfree.chart.plot.MultiplePiePlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.PlotRenderingInfo;
import org.jfree.chart.plot.SpiderWebPlot;
import org.jfree.chart.plot.ThermometerPlot;
import org.jfree.chart.plot.ValueMarker;
import org.jfree.chart.plot.WaferMapPlot;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.chart.renderer.category.BarRenderer3D;
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer;
import org.jfree.chart.renderer.category.CategoryItemRendererState;
import org.jfree.chart.renderer.category.CategoryStepRenderer;
import org.jfree.chart.renderer.category.GanttRenderer;
import org.jfree.chart.renderer.category.GroupedStackedBarRenderer;
import org.jfree.chart.renderer.category.IntervalBarRenderer;
import org.jfree.chart.renderer.category.LayeredBarRenderer;
import org.jfree.chart.renderer.category.LevelRenderer;
import org.jfree.chart.renderer.category.LineRenderer3D;
import org.jfree.chart.renderer.category.MinMaxCategoryRenderer;
import org.jfree.chart.renderer.category.ScatterRenderer;
import org.jfree.chart.renderer.category.StackedAreaRenderer;
import org.jfree.chart.renderer.category.StackedBarRenderer;
import org.jfree.chart.renderer.category.StackedBarRenderer3D;
import org.jfree.chart.renderer.category.StatisticalBarRenderer;
import org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer;
import org.jfree.chart.renderer.category.WaterfallBarRenderer;
import org.jfree.chart.title.LegendTitle;
import org.jfree.chart.urls.CategoryURLGenerator;
import org.jfree.chart.urls.CustomCategoryURLGenerator;
import org.jfree.chart.urls.StandardCategoryURLGenerator;
import org.jfree.chart.util.Layer;
import org.jfree.chart.util.LengthAdjustmentType;
import org.jfree.chart.util.RectangleAnchor;
import org.jfree.chart.util.RectangleEdge;
import org.jfree.chart.util.RectangleInsets;
import org.jfree.chart.util.UnitType;
import org.jfree.data.Range;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.category.DefaultIntervalCategoryDataset;
import org.jfree.data.category.SlidingCategoryDataset;
import org.jfree.data.gantt.GanttCategoryDataset;
import org.jfree.data.gantt.SlidingGanttCategoryDataset;
import org.jfree.data.gantt.TaskSeriesCollection;
import org.jfree.data.general.DefaultKeyedValues2DDataset;
import org.jfree.data.general.DefaultValueDataset;
import org.jfree.data.general.ValueDataset;
import org.jfree.data.general.WaferMapDataset;
import org.jfree.data.jdbc.JDBCCategoryDataset;
import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset;
import org.jfree.data.statistics.DefaultMultiValueCategoryDataset;
import org.jfree.data.statistics.DefaultStatisticalCategoryDataset;
import org.jfree.data.time.DateRange;
import org.jfree.data.time.Hour;
import org.junit.runner.RunWith;
import sun.util.calendar.ZoneInfo;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class AbstractCategoryItemRenderer_ESTest extends AbstractCategoryItemRenderer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
WaferMapDataset waferMapDataset0 = new WaferMapDataset(1, 0);
WaferMapPlot waferMapPlot0 = new WaferMapPlot(waferMapDataset0);
IntervalBarRenderer intervalBarRenderer0 = new IntervalBarRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
TaskSeriesCollection taskSeriesCollection0 = new TaskSeriesCollection();
// Undeclared exception!
// try {
intervalBarRenderer0.addEntity(standardEntityCollection0, waferMapPlot0.DEFAULT_LEGEND_ITEM_CIRCLE, taskSeriesCollection0, 10, 0, false);
// fail("Expecting exception: IndexOutOfBoundsException");
// } catch(IndexOutOfBoundsException e) {
// //
// // Index: 10, Size: 0
// //
// verifyException("java.util.ArrayList", e);
// }
}
@Test(timeout = 4000)
public void test001() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(1129.7959644416, 12.0, "");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(cyclicNumberAxis0);
levelRenderer0.setPlot(combinedRangeCategoryPlot0);
// Undeclared exception!
// try {
levelRenderer0.getLegendItem(500, 10);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'dataset' argument.
// //
// verifyException("org.jfree.chart.labels.StandardCategorySeriesLabelGenerator", e);
// }
}
@Test(timeout = 4000)
public void test002() throws Throwable {
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer(true);
WaferMapDataset waferMapDataset0 = new WaferMapDataset(1, 184);
WaferMapPlot waferMapPlot0 = new WaferMapPlot(waferMapDataset0);
JFreeChart jFreeChart0 = new JFreeChart("$}C#R@", stackedAreaRenderer0.DEFAULT_VALUE_LABEL_FONT, waferMapPlot0, false);
ChartPanel chartPanel0 = new ChartPanel(jFreeChart0, false, false, false, false, true);
PlotOrientation plotOrientation0 = chartPanel0.getOrientation();
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.EXPAND;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.CENTER;
Rectangle rectangle0 = chartPanel0.getVisibleRect();
// Undeclared exception!
// try {
stackedAreaRenderer0.calculateRangeMarkerTextAnchorPoint((Graphics2D) null, plotOrientation0, rectangle0, (Rectangle2D) null, waferMapPlot0.DEFAULT_INSETS, lengthAdjustmentType0, rectangleAnchor0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'base' argument.
// //
// verifyException("org.jfree.chart.util.RectangleInsets", e);
// }
}
@Test(timeout = 4000)
public void test003() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
FastScatterPlot fastScatterPlot0 = new FastScatterPlot();
PlotOrientation plotOrientation0 = fastScatterPlot0.getOrientation();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot(categoryAxis3D0);
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.CONTRACT;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.RIGHT;
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(108.76, 0.0);
Point2D.Double point2D_Double0 = (Point2D.Double)stackedBarRenderer3D0.calculateDomainMarkerTextAnchorPoint((Graphics2D) null, plotOrientation0, (Rectangle2D) null, rectangle2D_Double0, combinedDomainCategoryPlot0.DEFAULT_INSETS, lengthAdjustmentType0, rectangleAnchor0);
assertEquals((-8.0), point2D_Double0.x, 0.01);
}
@Test(timeout = 4000)
public void test004() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
RectangleAnchor rectangleAnchor0 = RectangleAnchor.LEFT;
MeterPlot meterPlot0 = new MeterPlot();
JFreeChart jFreeChart0 = new JFreeChart("Base item URL generator not cloneable.", meterPlot0);
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo(standardEntityCollection0);
BufferedImage bufferedImage0 = jFreeChart0.createBufferedImage(5, 93, chartRenderingInfo0);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
PlotOrientation plotOrientation0 = PlotOrientation.HORIZONTAL;
DefaultCaret defaultCaret0 = new DefaultCaret();
Rectangle2D rectangle2D0 = defaultCaret0.getBounds2D();
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.CONTRACT;
Point2D.Double point2D_Double0 = (Point2D.Double)levelRenderer0.calculateDomainMarkerTextAnchorPoint(graphics2D0, plotOrientation0, rectangle2D0, defaultCaret0, meterPlot0.DEFAULT_INSETS, lengthAdjustmentType0, rectangleAnchor0);
assertEquals(8.0, point2D_Double0.x, 0.01);
}
@Test(timeout = 4000)
public void test005() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
DateAxis dateAxis0 = new DateAxis("Null 'hotspot' argument.");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(dateAxis0);
// Undeclared exception!
// try {
categoryStepRenderer0.drawRangeLine((Graphics2D) null, combinedRangeCategoryPlot0, dateAxis0, rectangle2D_Double0, 0.0, dateAxis0.DEFAULT_TICK_MARK_PAINT, groupedStackedBarRenderer0.DEFAULT_OUTLINE_STROKE);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test006() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
LogarithmicAxis logarithmicAxis0 = new LogarithmicAxis("Null 'generator' argument.");
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.drawDomainLine((Graphics2D) null, combinedRangeCategoryPlot0, rectangle2D_Double0, 0.0F, logarithmicAxis0.DEFAULT_TICK_LABEL_PAINT, categoryStepRenderer0.DEFAULT_OUTLINE_STROKE);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test007() throws Throwable {
LineRenderer3D lineRenderer3D0 = new LineRenderer3D();
CategoryTextAnnotation categoryTextAnnotation0 = new CategoryTextAnnotation("", 8.0, (-4.0));
lineRenderer3D0.addAnnotation((CategoryAnnotation) categoryTextAnnotation0);
boolean boolean0 = lineRenderer3D0.removeAnnotation(categoryTextAnnotation0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test008() throws Throwable {
StatisticalBarRenderer statisticalBarRenderer0 = new StatisticalBarRenderer();
CategoryURLGenerator categoryURLGenerator0 = statisticalBarRenderer0.getURLGenerator(0, 3, false);
assertNull(categoryURLGenerator0);
}
@Test(timeout = 4000)
public void test009() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
stackedBarRenderer3D0.setSeriesItemLabelGenerator(0, (CategoryItemLabelGenerator) null);
assertEquals(4.0, stackedBarRenderer3D0.getShadowXOffset(), 0.01);
}
@Test(timeout = 4000)
public void test010() throws Throwable {
CategoryTextAnnotation categoryTextAnnotation0 = new CategoryTextAnnotation("E<|", 0.2, (-1666.0));
NumberAxis3D numberAxis3D0 = new NumberAxis3D("FZ");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(numberAxis3D0);
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
JFreeChart jFreeChart0 = new JFreeChart("3V", categoryTextAnnotation0.DEFAULT_FONT, combinedRangeCategoryPlot0, true);
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
BufferedImage bufferedImage0 = jFreeChart0.createBufferedImage(3, 3, chartRenderingInfo0);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
ModuloAxis moduloAxis0 = new ModuloAxis("3V", numberAxis3D0.DEFAULT_RANGE);
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
categoryStepRenderer0.drawRangeLine(graphics2D0, combinedRangeCategoryPlot0, moduloAxis0, rectangle2D_Double0, 0.2, moduloAxis0.DEFAULT_TICK_LABEL_PAINT, moduloAxis0.DEFAULT_AXIS_LINE_STROKE);
assertNull(moduloAxis0.getLabelToolTip());
}
@Test(timeout = 4000)
public void test011() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
MultiplePiePlot multiplePiePlot0 = new MultiplePiePlot();
JFreeChart jFreeChart0 = new JFreeChart("gd@akSCW*<S,-", groupedStackedBarRenderer0.DEFAULT_VALUE_LABEL_FONT, multiplePiePlot0, true);
BufferedImage bufferedImage0 = jFreeChart0.createBufferedImage(10, 5260);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
PeriodAxis periodAxis0 = new PeriodAxis("+SwaM!e");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(periodAxis0);
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
groupedStackedBarRenderer0.drawOutline(graphics2D0, combinedRangeCategoryPlot0, rectangle2D_Double0);
assertEquals(0.2, groupedStackedBarRenderer0.getItemMargin(), 0.01);
}
@Test(timeout = 4000)
public void test012() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
DateAxis dateAxis0 = new DateAxis("");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(dateAxis0);
LevelRenderer levelRenderer0 = new LevelRenderer();
MultiplePiePlot multiplePiePlot0 = new MultiplePiePlot();
JFreeChart jFreeChart0 = multiplePiePlot0.getPieChart();
BufferedImage bufferedImage0 = jFreeChart0.createBufferedImage(10, 1);
Graphics2D graphics2D0 = bufferedImage0.createGraphics();
levelRenderer0.drawDomainLine(graphics2D0, combinedRangeCategoryPlot0, rectangle2D_Double0, 0.0, categoryStepRenderer0.DEFAULT_PAINT, combinedRangeCategoryPlot0.DEFAULT_OUTLINE_STROKE);
assertTrue(levelRenderer0.getAutoPopulateSeriesStroke());
}
@Test(timeout = 4000)
public void test013() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.addValue((double) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO);
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
MeterPlot meterPlot0 = new MeterPlot();
JFreeChart jFreeChart0 = new JFreeChart(meterPlot0);
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo(standardEntityCollection0);
BufferedImage bufferedImage0 = jFreeChart0.createBufferedImage(1024, 5, (-1299.235769382), (double) 5, chartRenderingInfo0);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
DefaultCaret defaultCaret0 = new DefaultCaret();
CategoryPlot categoryPlot0 = new CategoryPlot();
CategoryAxis categoryAxis0 = new CategoryAxis("_iyk|");
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
CategoryItemRendererState categoryItemRendererState0 = categoryStepRenderer0.createState(plotRenderingInfo0);
// Undeclared exception!
// try {
minMaxCategoryRenderer0.hitTest(0.0, (-269.41913629), graphics2D0, defaultCaret0, categoryPlot0, categoryAxis0, (ValueAxis) null, defaultKeyedValues2DDataset0, 10, 0, true, categoryItemRendererState0);
// fail("Expecting exception: IndexOutOfBoundsException");
// } catch(IndexOutOfBoundsException e) {
// //
// // Index: 10, Size: 1
// //
// verifyException("java.util.ArrayList", e);
// }
}
@Test(timeout = 4000)
public void test014() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.addValue(0.0, (Comparable) 0.0, (Comparable) 0.0);
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
boxAndWhiskerRenderer0.addEntity(standardEntityCollection0, rectangle2D_Double0, defaultKeyedValues2DDataset0, 0, 0, false);
assertEquals(1, standardEntityCollection0.getEntityCount());
}
@Test(timeout = 4000)
public void test015() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
TaskSeriesCollection taskSeriesCollection0 = new TaskSeriesCollection();
JFreeChart jFreeChart0 = new JFreeChart(combinedRangeCategoryPlot0);
ChartPanel chartPanel0 = new ChartPanel(jFreeChart0);
ChartRenderingInfo chartRenderingInfo0 = chartPanel0.getChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
CategoryItemRendererState categoryItemRendererState0 = categoryStepRenderer0.initialise((Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, taskSeriesCollection0, plotRenderingInfo0);
assertEquals(0.0, categoryItemRendererState0.getSeriesRunningTotal(), 0.01);
}
@Test(timeout = 4000)
public void test016() throws Throwable {
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
minMaxCategoryRenderer0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0, false);
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator1 = (BoxAndWhiskerToolTipGenerator)minMaxCategoryRenderer0.getToolTipGenerator(311, 311, false);
assertEquals("X: {1} Mean: {2} Median: {3} Min: {4} Max: {5} Q1: {6} Q3: {7} ", boxAndWhiskerToolTipGenerator1.getLabelFormat());
}
@Test(timeout = 4000)
public void test017() throws Throwable {
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
CategoryItemLabelGenerator categoryItemLabelGenerator0 = boxAndWhiskerRenderer0.getSeriesItemLabelGenerator(4);
assertNull(categoryItemLabelGenerator0);
}
@Test(timeout = 4000)
public void test018() throws Throwable {
CategoryPlot categoryPlot0 = new CategoryPlot();
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer();
ValueAxis valueAxis0 = stackedAreaRenderer0.getRangeAxis(categoryPlot0, 10);
assertNull(valueAxis0);
}
@Test(timeout = 4000)
public void test019() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
ThermometerPlot thermometerPlot0 = new ThermometerPlot();
ValueAxis valueAxis0 = thermometerPlot0.getRangeAxis();
CategoryPlot categoryPlot0 = new CategoryPlot(defaultBoxAndWhiskerCategoryDataset0, categoryAxis3D0, valueAxis0, groupedStackedBarRenderer0);
ValueAxis valueAxis1 = groupedStackedBarRenderer0.getRangeAxis(categoryPlot0, 0);
assertEquals(0.05, ValueAxis.DEFAULT_LOWER_MARGIN, 0.01);
}
@Test(timeout = 4000)
public void test020() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
DateRange dateRange0 = DateAxis.DEFAULT_DATE_RANGE;
ModuloAxis moduloAxis0 = new ModuloAxis("", dateRange0);
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(moduloAxis0);
moduloAxis0.pan((-4955.4));
ValueAxis valueAxis0 = groupedStackedBarRenderer0.getRangeAxis(combinedRangeCategoryPlot0, (-95));
assertTrue(Axis.DEFAULT_TICK_LABELS_VISIBLE);
}
@Test(timeout = 4000)
public void test021() throws Throwable {
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
ValueAxis valueAxis0 = categoryStepRenderer0.getRangeAxis(combinedRangeCategoryPlot0, 0);
assertEquals(0.0F, Axis.DEFAULT_TICK_MARK_INSIDE_LENGTH, 0.01F);
}
@Test(timeout = 4000)
public void test022() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
CategoryPlot categoryPlot0 = scatterRenderer0.getPlot();
assertNull(categoryPlot0);
}
@Test(timeout = 4000)
public void test023() throws Throwable {
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CategoryPlot categoryPlot0 = new CategoryPlot((CategoryDataset) null, categoryAxis3D0, (ValueAxis) null, minMaxCategoryRenderer0);
CategoryPlot categoryPlot1 = minMaxCategoryRenderer0.getPlot();
assertEquals(1, categoryPlot1.getDatasetCount());
}
@Test(timeout = 4000)
public void test024() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
CategorySeriesLabelGenerator categorySeriesLabelGenerator0 = groupedStackedBarRenderer0.getLegendItemLabelGenerator();
assertNotNull(categorySeriesLabelGenerator0);
}
@Test(timeout = 4000)
public void test025() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
GanttRenderer ganttRenderer0 = new GanttRenderer();
double[][] doubleArray0 = new double[2][0];
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset(doubleArray0, doubleArray0);
CategoryAxis categoryAxis0 = new CategoryAxis("Null 'transformer' attribute.");
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
RectangleEdge rectangleEdge0 = RectangleEdge.LEFT;
double double0 = levelRenderer0.getItemMiddle(ganttRenderer0.ZERO, 0.2, defaultIntervalCategoryDataset0, categoryAxis0, rectangle2D_Double0, rectangleEdge0);
assertEquals(0.0, double0, 0.01);
}
@Test(timeout = 4000)
public void test026() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
GanttRenderer ganttRenderer0 = new GanttRenderer();
double[][] doubleArray0 = new double[2][0];
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset(doubleArray0, doubleArray0);
CategoryAxis categoryAxis0 = new CategoryAxis("Null 'transformer' attribute.");
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
rectangle2D_Double0.setFrameFromDiagonal((-1468.306656488), 0.0, (double) 1.0F, 1411.1593666463027);
RectangleEdge rectangleEdge0 = RectangleEdge.LEFT;
double double0 = levelRenderer0.getItemMiddle(ganttRenderer0.ZERO, 0.2, defaultIntervalCategoryDataset0, categoryAxis0, rectangle2D_Double0, rectangleEdge0);
assertEquals((-1707.5028336420262), double0, 0.01);
}
@Test(timeout = 4000)
public void test027() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
DrawingSupplier drawingSupplier0 = stackedBarRenderer3D0.getDrawingSupplier();
assertNull(drawingSupplier0);
}
@Test(timeout = 4000)
public void test028() throws Throwable {
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
CategoryAxis categoryAxis0 = scatterRenderer0.getDomainAxis(combinedRangeCategoryPlot0, (CategoryDataset) null);
assertNull(categoryAxis0);
}
@Test(timeout = 4000)
public void test029() throws Throwable {
GanttRenderer ganttRenderer0 = new GanttRenderer();
double[][] doubleArray0 = new double[2][0];
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset(doubleArray0, doubleArray0);
CategoryAxis categoryAxis0 = new CategoryAxis("Null 'transformer' attribute.");
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(0.0, 4204.48443751);
CategoryPlot categoryPlot0 = new CategoryPlot(defaultIntervalCategoryDataset0, categoryAxis0, cyclicNumberAxis0, ganttRenderer0);
CategoryAxis categoryAxis1 = ganttRenderer0.getDomainAxis(categoryPlot0, defaultIntervalCategoryDataset0);
assertSame(categoryAxis0, categoryAxis1);
}
@Test(timeout = 4000)
public void test030() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
stackedBarRenderer3D0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0);
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator1 = (BoxAndWhiskerToolTipGenerator)stackedBarRenderer3D0.getBaseToolTipGenerator();
assertEquals("X: {1} Mean: {2} Median: {3} Min: {4} Max: {5} Q1: {6} Q3: {7} ", boxAndWhiskerToolTipGenerator1.getLabelFormat());
}
@Test(timeout = 4000)
public void test031() throws Throwable {
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator();
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(true);
stackedBarRenderer3D0.setBaseItemLabelGenerator((CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0, true);
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator1 = (IntervalCategoryItemLabelGenerator)stackedBarRenderer3D0.getBaseItemLabelGenerator();
assertEquals("({0}, {1}) = {3} - {4}", intervalCategoryItemLabelGenerator1.getLabelFormat());
}
@Test(timeout = 4000)
public void test032() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
Number[][] numberArray0 = new Number[8][4];
Number[] numberArray1 = new Number[1];
numberArray1[0] = (Number) 3.0;
numberArray0[0] = numberArray1;
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset((String[]) null, numberArray0, numberArray0);
Range range0 = groupedStackedBarRenderer0.findRangeBounds((CategoryDataset) defaultIntervalCategoryDataset0, false);
assertEquals(3.0, range0.getLength(), 0.01);
}
@Test(timeout = 4000)
public void test033() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.setValue((double) levelRenderer0.ZERO, (Comparable) 0.2, (Comparable) scatterRenderer0.ZERO);
Range range0 = scatterRenderer0.findRangeBounds((CategoryDataset) defaultKeyedValues2DDataset0, true);
assertEquals(0.0, range0.getLowerBound(), 0.01);
}
@Test(timeout = 4000)
public void test034() throws Throwable {
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.setValue(0.2, (Comparable) 5, (Comparable) 0.05);
Range range0 = categoryStepRenderer0.findRangeBounds((CategoryDataset) defaultKeyedValues2DDataset0, false);
assertEquals(0.2, range0.getCentralValue(), 0.01);
}
@Test(timeout = 4000)
public void test035() throws Throwable {
TaskSeriesCollection taskSeriesCollection0 = new TaskSeriesCollection();
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
Range range0 = layeredBarRenderer0.findRangeBounds(taskSeriesCollection0);
assertNull(range0);
}
@Test(timeout = 4000)
public void test036() throws Throwable {
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer(true);
Connection connection0 = mock(Connection.class, new ViolatedAssumptionAnswer());
JDBCCategoryDataset jDBCCategoryDataset0 = new JDBCCategoryDataset(connection0);
Range range0 = stackedAreaRenderer0.findRangeBounds(jDBCCategoryDataset0);
assertEquals(0.0, range0.getLowerBound(), 0.01);
}
@Test(timeout = 4000)
public void test037() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.addValue((double) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO);
Range range0 = scatterRenderer0.findRangeBounds(defaultKeyedValues2DDataset0);
assertEquals(0.0, range0.getCentralValue(), 0.01);
}
@Test(timeout = 4000)
public void test038() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.setValue(1.0, (Comparable) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO);
Range range0 = scatterRenderer0.findRangeBounds(defaultKeyedValues2DDataset0);
assertEquals(1.0, range0.getCentralValue(), 0.01);
}
@Test(timeout = 4000)
public void test039() throws Throwable {
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.addValue((-4454.478157098294), (Comparable) 8.0, (Comparable) 3.0);
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
Range range0 = scatterRenderer0.findRangeBounds(defaultKeyedValues2DDataset0);
assertEquals((-4454.478157098294), range0.getCentralValue(), 0.01);
}
@Test(timeout = 4000)
public void test040() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
boolean boolean0 = scatterRenderer0.equals(scatterRenderer0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test041() throws Throwable {
BarRenderer3D barRenderer3D0 = new BarRenderer3D();
GanttRenderer ganttRenderer0 = new GanttRenderer();
boolean boolean0 = barRenderer3D0.equals(ganttRenderer0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test042() throws Throwable {
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo(chartRenderingInfo0);
CategoryItemRendererState categoryItemRendererState0 = categoryStepRenderer0.createState(plotRenderingInfo0);
assertEquals(0.0, categoryItemRendererState0.getBarWidth(), 0.01);
}
@Test(timeout = 4000)
public void test043() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategoryItemRendererState categoryItemRendererState0 = stackedBarRenderer3D0.createState((PlotRenderingInfo) null);
assertEquals(0, categoryItemRendererState0.getVisibleSeriesCount());
}
@Test(timeout = 4000)
public void test044() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
Rectangle2D.Float rectangle2D_Float0 = new Rectangle2D.Float(1.0F, 0.0F, 0.0F, 1.0F);
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategoryAxis categoryAxis0 = new CategoryAxis();
DateAxis dateAxis0 = new DateAxis();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo((ChartRenderingInfo) null);
CategoryStepRenderer.State categoryStepRenderer_State0 = new CategoryStepRenderer.State(plotRenderingInfo0);
Rectangle2D rectangle2D0 = stackedBarRenderer3D0.createHotSpotBounds((Graphics2D) null, rectangle2D_Float0, (CategoryPlot) null, categoryAxis0, dateAxis0, defaultStatisticalCategoryDataset0, (-1225), 73, false, categoryStepRenderer_State0, rectangle2D_Double0);
assertNull(rectangle2D0);
}
@Test(timeout = 4000)
public void test045() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
// Undeclared exception!
// try {
stackedBarRenderer3D0.setSeriesURLGenerator((-1609), (CategoryURLGenerator) null, true);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test046() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.setSeriesURLGenerator((-3188), (CategoryURLGenerator) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test047() throws Throwable {
StatisticalLineAndShapeRenderer statisticalLineAndShapeRenderer0 = new StatisticalLineAndShapeRenderer(false, true);
// Undeclared exception!
// try {
statisticalLineAndShapeRenderer0.setSeriesToolTipGenerator((-28), (CategoryToolTipGenerator) null, true);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test048() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
SpiderWebPlot spiderWebPlot0 = new SpiderWebPlot();
CategoryItemLabelGenerator categoryItemLabelGenerator0 = spiderWebPlot0.getLabelGenerator();
// Undeclared exception!
// try {
stackedBarRenderer3D0.setSeriesItemLabelGenerator((-2624), categoryItemLabelGenerator0, false);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test049() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
NumberAxis3D numberAxis3D0 = new NumberAxis3D("");
SubCategoryAxis subCategoryAxis0 = new SubCategoryAxis("");
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
// Undeclared exception!
// try {
minMaxCategoryRenderer0.hitTest(0.2, (double) categoryStepRenderer0.ZERO, (Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, subCategoryAxis0, numberAxis3D0, (CategoryDataset) null, 10, 10, true, (CategoryItemRendererState) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test050() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D("");
DefaultCategoryDataset defaultCategoryDataset0 = new DefaultCategoryDataset();
// Undeclared exception!
// try {
categoryStepRenderer0.hitTest(5, 5, (Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, categoryAxis3D0, (ValueAxis) null, defaultCategoryDataset0, 10, (-227), true, (CategoryItemRendererState) null);
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// }
}
@Test(timeout = 4000)
public void test051() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
// Undeclared exception!
// try {
stackedBarRenderer3D0.getRangeAxis((CategoryPlot) null, 16);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test052() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
StatisticalBarRenderer statisticalBarRenderer0 = new StatisticalBarRenderer();
LegendTitle legendTitle0 = new LegendTitle(statisticalBarRenderer0);
// Undeclared exception!
// try {
statisticalBarRenderer0.getItemMiddle(0.0, 0.0, defaultKeyedValues2DDataset0, (CategoryAxis) null, rectangle2D_Double0, legendTitle0.DEFAULT_POSITION);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test053() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
// Undeclared exception!
// try {
scatterRenderer0.getDomainAxis((CategoryPlot) null, defaultKeyedValues2DDataset0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test054() throws Throwable {
GanttRenderer ganttRenderer0 = new GanttRenderer();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
// Undeclared exception!
// try {
ganttRenderer0.getDomainAxis(combinedRangeCategoryPlot0, defaultStatisticalCategoryDataset0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Negative 'index'.
// //
// verifyException("org.jfree.chart.plot.CategoryPlot", e);
// }
}
@Test(timeout = 4000)
public void test055() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
SlidingGanttCategoryDataset slidingGanttCategoryDataset0 = new SlidingGanttCategoryDataset((GanttCategoryDataset) null, (-1042), 0);
// Undeclared exception!
// try {
scatterRenderer0.findRangeBounds((CategoryDataset) slidingGanttCategoryDataset0, false);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.data.gantt.SlidingGanttCategoryDataset", e);
// }
}
@Test(timeout = 4000)
public void test056() throws Throwable {
LineRenderer3D lineRenderer3D0 = new LineRenderer3D();
Number[][] numberArray0 = new Number[6][1];
Number[] numberArray1 = new Number[5];
numberArray0[0] = numberArray1;
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset(numberArray0, numberArray0);
// Undeclared exception!
// try {
lineRenderer3D0.findRangeBounds((CategoryDataset) defaultIntervalCategoryDataset0, true);
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // 1
// //
// verifyException("org.jfree.data.category.DefaultIntervalCategoryDataset", e);
// }
}
@Test(timeout = 4000)
public void test057() throws Throwable {
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset((Number[][]) null, (Number[][]) null);
// Undeclared exception!
// try {
layeredBarRenderer0.findRangeBounds(defaultIntervalCategoryDataset0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.data.category.DefaultIntervalCategoryDataset", e);
// }
}
@Test(timeout = 4000)
public void test058() throws Throwable {
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
Number[][] numberArray0 = new Number[2][4];
Number[] numberArray1 = new Number[7];
numberArray0[0] = numberArray1;
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset((String[]) null, numberArray0, numberArray0);
// Undeclared exception!
// try {
layeredBarRenderer0.findRangeBounds(defaultIntervalCategoryDataset0);
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // 4
// //
// verifyException("org.jfree.data.category.DefaultIntervalCategoryDataset", e);
// }
}
@Test(timeout = 4000)
public void test059() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot();
CategoryMarker categoryMarker0 = new CategoryMarker(0.0, combinedDomainCategoryPlot0.DEFAULT_BACKGROUND_PAINT, combinedDomainCategoryPlot0.DEFAULT_GRIDLINE_STROKE);
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
// Undeclared exception!
// try {
categoryStepRenderer0.drawDomainMarker((Graphics2D) null, combinedDomainCategoryPlot0, categoryAxis3D0, categoryMarker0, rectangle2D_Double0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test060() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
// Undeclared exception!
// try {
categoryStepRenderer0.drawBackground((Graphics2D) null, combinedRangeCategoryPlot0, rectangle2D_Double0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.plot.Plot", e);
// }
}
@Test(timeout = 4000)
public void test061() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
LevelRenderer levelRenderer0 = new LevelRenderer();
DateAxis dateAxis0 = new DateAxis();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
// Undeclared exception!
// try {
levelRenderer0.drawAnnotations((Graphics2D) null, rectangle2D_Double0, categoryAxis3D0, dateAxis0, (Layer) null, plotRenderingInfo0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test062() throws Throwable {
IntervalBarRenderer intervalBarRenderer0 = new IntervalBarRenderer();
BufferedImage bufferedImage0 = new BufferedImage(3473, 3473, 1);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
RoundRectangle2D.Double roundRectangle2D_Double0 = new RoundRectangle2D.Double();
Rectangle2D rectangle2D0 = roundRectangle2D_Double0.getBounds2D();
ExtendedCategoryAxis extendedCategoryAxis0 = new ExtendedCategoryAxis("ozxb[(H6LgB:e");
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot(extendedCategoryAxis0);
LogarithmicAxis logarithmicAxis0 = new LogarithmicAxis("KZP{uTYD1Xxq$qnGdcc");
ModuloAxis moduloAxis0 = new ModuloAxis("ozxb[(H6LgB:e", logarithmicAxis0.DEFAULT_RANGE);
DefaultMultiValueCategoryDataset defaultMultiValueCategoryDataset0 = new DefaultMultiValueCategoryDataset();
// Undeclared exception!
// try {
intervalBarRenderer0.createHotSpotBounds(graphics2D0, rectangle2D0, combinedDomainCategoryPlot0, extendedCategoryAxis0, moduloAxis0, defaultMultiValueCategoryDataset0, 14, 500, true, (CategoryItemRendererState) null, rectangle2D0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.BarRenderer", e);
// }
}
@Test(timeout = 4000)
public void test063() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
DateAxis dateAxis0 = new DateAxis("");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo((ChartRenderingInfo) null);
CategoryItemRendererState categoryItemRendererState0 = categoryStepRenderer0.createState(plotRenderingInfo0);
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
// Undeclared exception!
// try {
categoryStepRenderer0.createHotSpotBounds((Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, categoryAxis3D0, dateAxis0, defaultStatisticalCategoryDataset0, 1878, (-1804), true, categoryItemRendererState0, rectangle2D_Double0);
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// }
}
@Test(timeout = 4000)
public void test064() throws Throwable {
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
PlotOrientation plotOrientation0 = PlotOrientation.HORIZONTAL;
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.CONTRACT;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.TOP_RIGHT;
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
// Undeclared exception!
// try {
layeredBarRenderer0.calculateDomainMarkerTextAnchorPoint((Graphics2D) null, plotOrientation0, (Rectangle2D) null, (Rectangle2D) null, combinedRangeCategoryPlot0.DEFAULT_INSETS, lengthAdjustmentType0, rectangleAnchor0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'base' argument.
// //
// verifyException("org.jfree.chart.util.RectangleInsets", e);
// }
}
@Test(timeout = 4000)
public void test065() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
Number[][] numberArray0 = new Number[0][9];
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset((Comparable[]) null, (Comparable[]) null, numberArray0, numberArray0);
// Undeclared exception!
// try {
layeredBarRenderer0.addEntity(standardEntityCollection0, stackedBarRenderer3D0.DEFAULT_SHAPE, defaultIntervalCategoryDataset0, 2385, 2385, true, 12.0, 8.0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // The 'row' argument is out of bounds.
// //
// verifyException("org.jfree.data.category.DefaultIntervalCategoryDataset", e);
// }
}
@Test(timeout = 4000)
public void test066() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
// Undeclared exception!
// try {
layeredBarRenderer0.addEntity(standardEntityCollection0, rectangle2D_Double0, defaultBoxAndWhiskerCategoryDataset0, (-866), (-866), true, 0.0, (-866));
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// }
}
@Test(timeout = 4000)
public void test067() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
// Undeclared exception!
// try {
boxAndWhiskerRenderer0.addEntity(standardEntityCollection0, stackedBarRenderer3D0.DEFAULT_SHAPE, defaultStatisticalCategoryDataset0, (-590), (-590), false);
// fail("Expecting exception: ArrayIndexOutOfBoundsException");
// } catch(ArrayIndexOutOfBoundsException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// }
}
@Test(timeout = 4000)
public void test068() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
CategoryLineAnnotation categoryLineAnnotation0 = new CategoryLineAnnotation(0.2, (double) groupedStackedBarRenderer0.ZERO, groupedStackedBarRenderer0.ZERO, 0.2, groupedStackedBarRenderer0.DEFAULT_OUTLINE_PAINT, groupedStackedBarRenderer0.DEFAULT_STROKE);
// Undeclared exception!
// try {
groupedStackedBarRenderer0.addAnnotation((CategoryAnnotation) categoryLineAnnotation0, (Layer) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test069() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
// Undeclared exception!
// try {
stackedBarRenderer3D0.addAnnotation((CategoryAnnotation) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'annotation' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test070() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
LegendItem legendItem0 = levelRenderer0.getLegendItem(1502, 1502);
assertNull(legendItem0);
}
@Test(timeout = 4000)
public void test071() throws Throwable {
StatisticalBarRenderer statisticalBarRenderer0 = new StatisticalBarRenderer();
StandardCategoryURLGenerator standardCategoryURLGenerator0 = new StandardCategoryURLGenerator("");
statisticalBarRenderer0.setSeriesURLGenerator(1, (CategoryURLGenerator) standardCategoryURLGenerator0, true);
assertFalse(statisticalBarRenderer0.getAutoPopulateSeriesFillPaint());
}
@Test(timeout = 4000)
public void test072() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
CategoryURLGenerator categoryURLGenerator0 = scatterRenderer0.getURLGenerator(10, 10, false);
assertNull(categoryURLGenerator0);
}
@Test(timeout = 4000)
public void test073() throws Throwable {
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
minMaxCategoryRenderer0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0, true);
assertTrue(minMaxCategoryRenderer0.getAutoPopulateSeriesStroke());
}
@Test(timeout = 4000)
public void test074() throws Throwable {
StatisticalLineAndShapeRenderer statisticalLineAndShapeRenderer0 = new StatisticalLineAndShapeRenderer();
statisticalLineAndShapeRenderer0.setSeriesToolTipGenerator(66, (CategoryToolTipGenerator) null, true);
assertFalse(statisticalLineAndShapeRenderer0.getUseSeriesOffset());
}
@Test(timeout = 4000)
public void test075() throws Throwable {
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
CategoryToolTipGenerator categoryToolTipGenerator0 = minMaxCategoryRenderer0.getToolTipGenerator(311, 311, false);
assertNull(categoryToolTipGenerator0);
}
@Test(timeout = 4000)
public void test076() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
CategoryToolTipGenerator categoryToolTipGenerator0 = groupedStackedBarRenderer0.getSeriesToolTipGenerator(3987);
assertNull(categoryToolTipGenerator0);
}
@Test(timeout = 4000)
public void test077() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
DateAxis dateAxis0 = new DateAxis("");
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo(standardEntityCollection0);
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo(chartRenderingInfo0);
CategoryItemRendererState categoryItemRendererState0 = categoryStepRenderer0.createState(plotRenderingInfo0);
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
// Undeclared exception!
// try {
categoryStepRenderer0.createHotSpotBounds((Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, categoryAxis3D0, dateAxis0, defaultBoxAndWhiskerCategoryDataset0, 5, 3, false, categoryItemRendererState0, (Rectangle2D) null);
// fail("Expecting exception: IndexOutOfBoundsException");
// } catch(IndexOutOfBoundsException e) {
// //
// // Index: 3, Size: 0
// //
// verifyException("java.util.ArrayList", e);
// }
}
@Test(timeout = 4000)
public void test078() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
stackedBarRenderer3D0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0);
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
DefaultMultiValueCategoryDataset defaultMultiValueCategoryDataset0 = new DefaultMultiValueCategoryDataset();
RoundRectangle2D.Float roundRectangle2D_Float0 = new RoundRectangle2D.Float();
// Undeclared exception!
// try {
stackedBarRenderer3D0.addEntity(standardEntityCollection0, roundRectangle2D_Float0, defaultMultiValueCategoryDataset0, 1784, 1070, true, 1784, 1784);
// fail("Expecting exception: IndexOutOfBoundsException");
// } catch(IndexOutOfBoundsException e) {
// //
// // Index: 1784, Size: 0
// //
// verifyException("java.util.ArrayList", e);
// }
}
@Test(timeout = 4000)
public void test079() throws Throwable {
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
TaskSeriesCollection taskSeriesCollection0 = new TaskSeriesCollection();
// Undeclared exception!
// try {
layeredBarRenderer0.addEntity(standardEntityCollection0, (Shape) null, taskSeriesCollection0, 2534, 2534, true, 1.0E-8, 0.0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test080() throws Throwable {
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
TaskSeriesCollection taskSeriesCollection0 = new TaskSeriesCollection();
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
// Undeclared exception!
// try {
boxAndWhiskerRenderer0.addEntity(standardEntityCollection0, (Shape) null, taskSeriesCollection0, (-2319), (-2319), true);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'hotspot' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test081() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
// Undeclared exception!
// try {
boxAndWhiskerRenderer0.addEntity(standardEntityCollection0, rectangle2D_Double0, (CategoryDataset) null, 3149, 3149, false);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test082() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
CategoryAxis categoryAxis0 = new CategoryAxis();
ThermometerPlot thermometerPlot0 = new ThermometerPlot((ValueDataset) null);
ValueAxis valueAxis0 = thermometerPlot0.getRangeAxis();
CategoryPlot categoryPlot0 = new CategoryPlot(defaultKeyedValues2DDataset0, categoryAxis0, valueAxis0, scatterRenderer0);
LegendItemCollection legendItemCollection0 = scatterRenderer0.getLegendItems();
assertEquals(0, legendItemCollection0.getItemCount());
}
@Test(timeout = 4000)
public void test083() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
LegendItemCollection legendItemCollection0 = scatterRenderer0.getLegendItems();
assertEquals(0, legendItemCollection0.getItemCount());
}
@Test(timeout = 4000)
public void test084() throws Throwable {
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot();
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
scatterRenderer0.setPlot(combinedDomainCategoryPlot0);
// Undeclared exception!
// try {
scatterRenderer0.getLegendItems();
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test085() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
Connection connection0 = mock(Connection.class, new ViolatedAssumptionAnswer());
JDBCCategoryDataset jDBCCategoryDataset0 = new JDBCCategoryDataset(connection0);
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D("'33Y5%It");
LogAxis logAxis0 = new LogAxis("Null 'annotation' argument.");
CategoryPlot categoryPlot0 = new CategoryPlot(jDBCCategoryDataset0, categoryAxis3D0, logAxis0, levelRenderer0);
ValueAxis valueAxis0 = levelRenderer0.getRangeAxis(categoryPlot0, 10);
assertTrue(ValueAxis.DEFAULT_AUTO_RANGE);
}
@Test(timeout = 4000)
public void test086() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(3, 1);
CategoryPlot categoryPlot0 = new CategoryPlot(defaultBoxAndWhiskerCategoryDataset0, categoryAxis3D0, cyclicNumberAxis0, groupedStackedBarRenderer0);
ValueAxis valueAxis0 = groupedStackedBarRenderer0.getRangeAxis(categoryPlot0, 0);
assertEquals(0.0, valueAxis0.getLabelAngle(), 0.01);
}
@Test(timeout = 4000)
public void test087() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
StandardCategorySeriesLabelGenerator standardCategorySeriesLabelGenerator0 = new StandardCategorySeriesLabelGenerator(".F.v053");
groupedStackedBarRenderer0.setLegendItemURLGenerator(standardCategorySeriesLabelGenerator0);
GroupedStackedBarRenderer groupedStackedBarRenderer1 = (GroupedStackedBarRenderer)groupedStackedBarRenderer0.clone();
assertEquals(4.0, groupedStackedBarRenderer1.getShadowXOffset(), 0.01);
}
@Test(timeout = 4000)
public void test088() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
StatisticalBarRenderer statisticalBarRenderer0 = new StatisticalBarRenderer();
CategorySeriesLabelGenerator categorySeriesLabelGenerator0 = statisticalBarRenderer0.getLegendItemLabelGenerator();
stackedBarRenderer3D0.setLegendItemToolTipGenerator(categorySeriesLabelGenerator0);
StackedBarRenderer3D stackedBarRenderer3D1 = (StackedBarRenderer3D)stackedBarRenderer3D0.clone();
assertFalse(stackedBarRenderer3D1.getRenderAsPercentages());
}
@Test(timeout = 4000)
public void test089() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(true);
StandardCategoryURLGenerator standardCategoryURLGenerator0 = new StandardCategoryURLGenerator("*4[\"M", "", "labelXOffset");
stackedBarRenderer3D0.setBaseURLGenerator((CategoryURLGenerator) standardCategoryURLGenerator0, true);
// try {
stackedBarRenderer3D0.clone();
// fail("Expecting exception: CloneNotSupportedException");
// } catch(CloneNotSupportedException e) {
// //
// // Base item URL generator not cloneable.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test090() throws Throwable {
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator();
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
stackedBarRenderer3D0.setBaseItemLabelGenerator((CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0, true);
StackedBarRenderer3D stackedBarRenderer3D1 = (StackedBarRenderer3D)stackedBarRenderer3D0.clone();
assertFalse(stackedBarRenderer3D1.getAutoPopulateSeriesFillPaint());
}
@Test(timeout = 4000)
public void test091() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
LevelRenderer levelRenderer0 = new LevelRenderer();
DateAxis dateAxis0 = new DateAxis();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
Layer layer0 = Layer.FOREGROUND;
levelRenderer0.drawAnnotations((Graphics2D) null, rectangle2D_Double0, categoryAxis3D0, dateAxis0, layer0, plotRenderingInfo0);
assertTrue(levelRenderer0.getBaseSeriesVisibleInLegend());
}
@Test(timeout = 4000)
public void test092() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
Layer layer0 = Layer.BACKGROUND;
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo(chartRenderingInfo0);
LevelRenderer levelRenderer0 = new LevelRenderer();
DateAxis dateAxis0 = new DateAxis();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D("8-)g");
levelRenderer0.drawAnnotations((Graphics2D) null, rectangle2D_Double0, categoryAxis3D0, dateAxis0, layer0, plotRenderingInfo0);
assertTrue(levelRenderer0.getAutoPopulateSeriesStroke());
}
@Test(timeout = 4000)
public void test093() throws Throwable {
Locale locale0 = new Locale("&d h\"M9-6i@y92m!^B", "org.jfree.chart.renderer.xy.XYSplineRenderer", "");
NumberFormat numberFormat0 = NumberFormat.getInstance(locale0);
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator("", numberFormat0);
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
groupedStackedBarRenderer0.setBaseItemLabelGenerator((CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0, true);
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
SlidingCategoryDataset slidingCategoryDataset0 = new SlidingCategoryDataset(defaultStatisticalCategoryDataset0, 1737, (-308));
PlotOrientation plotOrientation0 = PlotOrientation.VERTICAL;
// Undeclared exception!
// try {
groupedStackedBarRenderer0.drawItemLabel((Graphics2D) null, plotOrientation0, slidingCategoryDataset0, (-326), 8, true, (-3566.238490195), 0.0, false);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test094() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
CombinedDomainXYPlot combinedDomainXYPlot0 = new CombinedDomainXYPlot();
PlotOrientation plotOrientation0 = combinedDomainXYPlot0.getOrientation();
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
groupedStackedBarRenderer0.drawItemLabel((Graphics2D) null, plotOrientation0, defaultStatisticalCategoryDataset0, 79, 28, false, 0.2, 0.2, false);
assertTrue(groupedStackedBarRenderer0.getDataBoundsIncludesVisibleSeriesOnly());
}
@Test(timeout = 4000)
public void test095() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
PlotOrientation plotOrientation0 = PlotOrientation.VERTICAL;
CategoryCrosshairState categoryCrosshairState0 = new CategoryCrosshairState();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(3, 1);
CategoryPlot categoryPlot0 = new CategoryPlot(defaultBoxAndWhiskerCategoryDataset0, categoryAxis3D0, cyclicNumberAxis0, groupedStackedBarRenderer0);
groupedStackedBarRenderer0.updateCrosshairValues(categoryCrosshairState0, true, 1, 1.0E-8, 2, 2, 10, plotOrientation0);
assertFalse(groupedStackedBarRenderer0.getAutoPopulateSeriesFillPaint());
}
@Test(timeout = 4000)
public void test096() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
PlotOrientation plotOrientation0 = PlotOrientation.VERTICAL;
CategoryCrosshairState categoryCrosshairState0 = new CategoryCrosshairState();
// Undeclared exception!
// try {
groupedStackedBarRenderer0.updateCrosshairValues(categoryCrosshairState0, true, 1, 1.0E-8, 2, 2, 10, plotOrientation0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test097() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
// Undeclared exception!
// try {
groupedStackedBarRenderer0.updateCrosshairValues((CategoryCrosshairState) null, 0.0, 0.0, 0.0, 2518, 0.0, 2.0, (PlotOrientation) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'orientation' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test098() throws Throwable {
LineRenderer3D lineRenderer3D0 = new LineRenderer3D();
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
PlotOrientation plotOrientation0 = PlotOrientation.HORIZONTAL;
groupedStackedBarRenderer0.updateCrosshairValues((CategoryCrosshairState) null, 0.0, true, 10, 3, (double) lineRenderer3D0.ZERO, 0.05, plotOrientation0);
assertTrue(lineRenderer3D0.getBaseLinesVisible());
}
@Test(timeout = 4000)
public void test099() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategoryPointerAnnotation categoryPointerAnnotation0 = new CategoryPointerAnnotation("Null 'annotation' argument.", 3.0, 0.2, (double) stackedBarRenderer3D0.ZERO);
Layer layer0 = Layer.FOREGROUND;
stackedBarRenderer3D0.addAnnotation((CategoryAnnotation) categoryPointerAnnotation0, layer0);
StackedBarRenderer3D stackedBarRenderer3D1 = new StackedBarRenderer3D(false);
boolean boolean0 = stackedBarRenderer3D0.equals(stackedBarRenderer3D1);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test100() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();
CategoryTextAnnotation categoryTextAnnotation0 = new CategoryTextAnnotation("Bn[Q^dem2g", "Bn[Q^dem2g", 0.0);
Layer layer0 = Layer.BACKGROUND;
groupedStackedBarRenderer0.addAnnotation((CategoryAnnotation) categoryTextAnnotation0, layer0);
boolean boolean0 = layeredBarRenderer0.equals(groupedStackedBarRenderer0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test101() throws Throwable {
BarRenderer3D barRenderer3D0 = new BarRenderer3D();
StandardCategorySeriesLabelGenerator standardCategorySeriesLabelGenerator0 = new StandardCategorySeriesLabelGenerator("qX?6>UuQsnNrp");
barRenderer3D0.setLegendItemURLGenerator(standardCategorySeriesLabelGenerator0);
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(false);
boolean boolean0 = barRenderer3D0.equals(stackedBarRenderer3D0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test102() throws Throwable {
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
BarRenderer3D barRenderer3D0 = new BarRenderer3D();
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(false);
stackedBarRenderer3D0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0, false);
boolean boolean0 = barRenderer3D0.equals(stackedBarRenderer3D0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test103() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
StackedBarRenderer3D stackedBarRenderer3D1 = new StackedBarRenderer3D(false);
boolean boolean0 = stackedBarRenderer3D0.equals(stackedBarRenderer3D1);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test104() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer();
IntervalMarker intervalMarker0 = new IntervalMarker(0.0, 3.0, stackedAreaRenderer0.DEFAULT_VALUE_LABEL_PAINT);
LengthAdjustmentType lengthAdjustmentType0 = intervalMarker0.getLabelOffsetType();
RectangleAnchor rectangleAnchor0 = RectangleAnchor.CENTER;
// Undeclared exception!
// try {
stackedAreaRenderer0.calculateRangeMarkerTextAnchorPoint((Graphics2D) null, (PlotOrientation) null, rectangle2D_Double0, rectangle2D_Double0, (RectangleInsets) null, lengthAdjustmentType0, rectangleAnchor0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.util.RectangleAnchor", e);
// }
}
@Test(timeout = 4000)
public void test105() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
PlotOrientation plotOrientation0 = PlotOrientation.HORIZONTAL;
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.EXPAND;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.RIGHT;
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer();
UnitType unitType0 = UnitType.RELATIVE;
RectangleInsets rectangleInsets0 = new RectangleInsets(unitType0, (-1654.7141), 597.714, (double) categoryStepRenderer0.ZERO, (double) groupedStackedBarRenderer0.ZERO);
Rectangle rectangle0 = new Rectangle((-1510), 0, 0, (-1510));
Point2D.Double point2D_Double0 = (Point2D.Double)stackedAreaRenderer0.calculateRangeMarkerTextAnchorPoint((Graphics2D) null, plotOrientation0, rectangle2D_Double0, rectangle0, rectangleInsets0, lengthAdjustmentType0, rectangleAnchor0);
assertEquals(1248554.1454999999, point2D_Double0.y, 0.01);
}
@Test(timeout = 4000)
public void test106() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.EXPAND;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.RIGHT;
StackedAreaRenderer stackedAreaRenderer0 = new StackedAreaRenderer();
UnitType unitType0 = UnitType.RELATIVE;
RectangleInsets rectangleInsets0 = new RectangleInsets(unitType0, 0.25, (-811.2), 0.0, 1.0);
DefaultValueDataset defaultValueDataset0 = new DefaultValueDataset();
ThermometerPlot thermometerPlot0 = new ThermometerPlot(defaultValueDataset0);
PlotOrientation plotOrientation0 = thermometerPlot0.getOrientation();
Point2D.Double point2D_Double0 = (Point2D.Double)stackedAreaRenderer0.calculateRangeMarkerTextAnchorPoint((Graphics2D) null, plotOrientation0, rectangle2D_Double0, rectangle2D_Double0, rectangleInsets0, lengthAdjustmentType0, rectangleAnchor0);
assertEquals(0.0, point2D_Double0.x, 0.01);
}
@Test(timeout = 4000)
public void test107() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
LevelRenderer levelRenderer0 = new LevelRenderer();
LengthAdjustmentType lengthAdjustmentType0 = LengthAdjustmentType.EXPAND;
RectangleAnchor rectangleAnchor0 = RectangleAnchor.TOP_LEFT;
// Undeclared exception!
// try {
levelRenderer0.calculateDomainMarkerTextAnchorPoint((Graphics2D) null, (PlotOrientation) null, rectangle2D_Double0, rectangle2D_Double0, combinedRangeCategoryPlot0.DEFAULT_INSETS, lengthAdjustmentType0, rectangleAnchor0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.util.RectangleAnchor", e);
// }
}
@Test(timeout = 4000)
public void test108() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
ZoneInfo zoneInfo0 = (ZoneInfo)SegmentedTimeline.DEFAULT_TIME_ZONE;
IntervalMarker intervalMarker0 = new IntervalMarker((double) levelRenderer0.ZERO, 712.7616955852411, levelRenderer0.DEFAULT_PAINT);
DateAxis dateAxis0 = new DateAxis((String) null, zoneInfo0);
// Undeclared exception!
// try {
levelRenderer0.drawRangeMarker((Graphics2D) null, (CategoryPlot) null, dateAxis0, intervalMarker0, rectangle2D_Double0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test109() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultValueDataset defaultValueDataset0 = new DefaultValueDataset();
ThermometerPlot thermometerPlot0 = new ThermometerPlot(defaultValueDataset0);
ValueAxis valueAxis0 = thermometerPlot0.getRangeAxis();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(valueAxis0);
CategoryMarker categoryMarker0 = new CategoryMarker(0.0);
scatterRenderer0.drawRangeMarker((Graphics2D) null, combinedRangeCategoryPlot0, valueAxis0, categoryMarker0, rectangle2D_Double0);
assertEquals(0.0, rectangle2D_Double0.getMinX(), 0.01);
}
@Test(timeout = 4000)
public void test110() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
Color color0 = Color.lightGray;
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot(categoryAxis3D0);
LogAxis logAxis0 = new LogAxis();
ValueMarker valueMarker0 = new ValueMarker(0.0, color0, categoryStepRenderer0.DEFAULT_OUTLINE_STROKE);
// Undeclared exception!
// try {
categoryStepRenderer0.drawRangeMarker((Graphics2D) null, combinedDomainCategoryPlot0, logAxis0, valueMarker0, rectangle2D_Double0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test111() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
ValueMarker valueMarker0 = new ValueMarker((-1119.114996681005), combinedRangeCategoryPlot0.DEFAULT_BACKGROUND_PAINT, combinedRangeCategoryPlot0.DEFAULT_GRIDLINE_STROKE);
LogarithmicAxis logarithmicAxis0 = new LogarithmicAxis("Null 'generator' argument.");
categoryStepRenderer0.drawRangeMarker((Graphics2D) null, combinedRangeCategoryPlot0, logarithmicAxis0, valueMarker0, rectangle2D_Double0);
assertFalse(logarithmicAxis0.getAllowNegativesFlag());
}
@Test(timeout = 4000)
public void test112() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DateAxis dateAxis0 = new DateAxis();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(dateAxis0);
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
IntervalMarker intervalMarker0 = new IntervalMarker(663.567, 0.2, categoryStepRenderer0.DEFAULT_PAINT);
levelRenderer0.drawRangeMarker((Graphics2D) null, combinedRangeCategoryPlot0, dateAxis0, intervalMarker0, rectangle2D_Double0);
assertTrue(levelRenderer0.getBaseSeriesVisibleInLegend());
}
@Test(timeout = 4000)
public void test113() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DateAxis dateAxis0 = new DateAxis();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(dateAxis0);
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
Rectangle rectangle0 = rectangle2D_Double0.getBounds();
categoryStepRenderer0.drawRangeLine((Graphics2D) null, combinedRangeCategoryPlot0, dateAxis0, rectangle0, 2.0, dateAxis0.DEFAULT_AXIS_LABEL_PAINT, combinedRangeCategoryPlot0.DEFAULT_GRIDLINE_STROKE);
assertTrue(categoryStepRenderer0.getAutoPopulateSeriesPaint());
}
@Test(timeout = 4000)
public void test114() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.drawDomainLine((Graphics2D) null, combinedRangeCategoryPlot0, rectangle2D_Double0, 10, combinedRangeCategoryPlot0.DEFAULT_CROSSHAIR_PAINT, (Stroke) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'stroke' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test115() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.drawDomainLine((Graphics2D) null, combinedRangeCategoryPlot0, rectangle2D_Double0, 1.0F, (Paint) null, combinedRangeCategoryPlot0.DEFAULT_OUTLINE_STROKE);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'paint' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test116() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
scatterRenderer0.setDataBoundsIncludesVisibleSeriesOnly(false);
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
Range range0 = scatterRenderer0.findRangeBounds(defaultKeyedValues2DDataset0);
assertNull(range0);
}
@Test(timeout = 4000)
public void test117() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
Range range0 = scatterRenderer0.findRangeBounds((CategoryDataset) null, false);
assertNull(range0);
}
@Test(timeout = 4000)
public void test118() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
DefaultCaret defaultCaret0 = new DefaultCaret();
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
CategoryPlot categoryPlot0 = new CategoryPlot();
// Undeclared exception!
// try {
stackedBarRenderer3D0.initialise((Graphics2D) null, defaultCaret0, categoryPlot0, defaultBoxAndWhiskerCategoryDataset0, (PlotRenderingInfo) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Negative 'index'.
// //
// verifyException("org.jfree.chart.plot.CategoryPlot", e);
// }
}
@Test(timeout = 4000)
public void test119() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo(chartRenderingInfo0);
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
CombinedDomainCategoryPlot combinedDomainCategoryPlot0 = new CombinedDomainCategoryPlot();
// Undeclared exception!
// try {
groupedStackedBarRenderer0.initialise((Graphics2D) null, rectangle2D_Double0, combinedDomainCategoryPlot0, (CategoryDataset) null, plotRenderingInfo0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test120() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
defaultKeyedValues2DDataset0.addValue((double) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO, (Comparable) scatterRenderer0.ZERO);
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(43.42116272488865);
CategoryPlot categoryPlot0 = new CategoryPlot(defaultKeyedValues2DDataset0, (CategoryAxis) null, cyclicNumberAxis0, scatterRenderer0);
BufferedImage bufferedImage0 = new BufferedImage(500, 4, 4);
Graphics2D graphics2D0 = bufferedImage0.createGraphics();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
scatterRenderer0.initialise(graphics2D0, (Rectangle2D) null, categoryPlot0, defaultKeyedValues2DDataset0, plotRenderingInfo0);
assertEquals(1, scatterRenderer0.getRowCount());
}
@Test(timeout = 4000)
public void test121() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.setLegendItemLabelGenerator((CategorySeriesLabelGenerator) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'generator' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test122() throws Throwable {
BoxAndWhiskerRenderer boxAndWhiskerRenderer0 = new BoxAndWhiskerRenderer();
StandardCategorySeriesLabelGenerator standardCategorySeriesLabelGenerator0 = new StandardCategorySeriesLabelGenerator();
boxAndWhiskerRenderer0.setLegendItemLabelGenerator(standardCategorySeriesLabelGenerator0);
assertEquals(1, boxAndWhiskerRenderer0.getPassCount());
}
@Test(timeout = 4000)
public void test123() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
Layer layer0 = Layer.FOREGROUND;
// Undeclared exception!
// try {
groupedStackedBarRenderer0.addAnnotation((CategoryAnnotation) null, layer0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'annotation' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test124() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CustomCategoryURLGenerator customCategoryURLGenerator0 = new CustomCategoryURLGenerator();
stackedBarRenderer3D0.setBaseURLGenerator((CategoryURLGenerator) customCategoryURLGenerator0, false);
StackedBarRenderer3D stackedBarRenderer3D1 = (StackedBarRenderer3D)stackedBarRenderer3D0.clone();
assertEquals(0.2, BarRenderer.DEFAULT_ITEM_MARGIN, 0.01);
}
@Test(timeout = 4000)
public void test125() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
StandardCategoryURLGenerator standardCategoryURLGenerator0 = new StandardCategoryURLGenerator();
scatterRenderer0.setSeriesURLGenerator(10, (CategoryURLGenerator) standardCategoryURLGenerator0, false);
assertFalse(scatterRenderer0.getUseOutlinePaint());
}
@Test(timeout = 4000)
public void test126() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
StandardCategoryToolTipGenerator standardCategoryToolTipGenerator0 = new StandardCategoryToolTipGenerator();
stackedBarRenderer3D0.setSeriesToolTipGenerator(12, (CategoryToolTipGenerator) standardCategoryToolTipGenerator0);
assertEquals(4.0, stackedBarRenderer3D0.getShadowXOffset(), 0.01);
}
@Test(timeout = 4000)
public void test127() throws Throwable {
StatisticalLineAndShapeRenderer statisticalLineAndShapeRenderer0 = new StatisticalLineAndShapeRenderer(false, false);
statisticalLineAndShapeRenderer0.setSeriesToolTipGenerator(1, (CategoryToolTipGenerator) null, false);
assertTrue(statisticalLineAndShapeRenderer0.getAutoPopulateSeriesShape());
}
@Test(timeout = 4000)
public void test128() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator();
stackedBarRenderer3D0.setBaseItemLabelGenerator((CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0, false);
assertFalse(stackedBarRenderer3D0.getAutoPopulateSeriesOutlinePaint());
}
@Test(timeout = 4000)
public void test129() throws Throwable {
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator();
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
stackedBarRenderer3D0.setSeriesItemLabelGenerator(10, (CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0, true);
assertEquals(1, stackedBarRenderer3D0.getPassCount());
}
@Test(timeout = 4000)
public void test130() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategoryItemLabelGenerator categoryItemLabelGenerator0 = stackedBarRenderer3D0.getItemLabelGenerator(0, 0, true);
assertNull(categoryItemLabelGenerator0);
}
@Test(timeout = 4000)
public void test131() throws Throwable {
WaterfallBarRenderer waterfallBarRenderer0 = new WaterfallBarRenderer();
StandardCategoryItemLabelGenerator standardCategoryItemLabelGenerator0 = new StandardCategoryItemLabelGenerator();
waterfallBarRenderer0.setSeriesItemLabelGenerator(39, (CategoryItemLabelGenerator) standardCategoryItemLabelGenerator0, false);
StandardCategoryItemLabelGenerator standardCategoryItemLabelGenerator1 = (StandardCategoryItemLabelGenerator)waterfallBarRenderer0.getItemLabelGenerator(39, (byte)73, false);
assertEquals("{2}", standardCategoryItemLabelGenerator1.getLabelFormat());
}
@Test(timeout = 4000)
public void test132() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
// Undeclared exception!
// try {
scatterRenderer0.setPlot((CategoryPlot) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Null 'plot' argument.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test133() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
stackedBarRenderer3D0.setSeriesURLGenerator(1, (CategoryURLGenerator) null);
assertTrue(stackedBarRenderer3D0.getShadowsVisible());
}
@Test(timeout = 4000)
public void test134() throws Throwable {
WaterfallBarRenderer waterfallBarRenderer0 = new WaterfallBarRenderer();
CategorySeriesLabelGenerator categorySeriesLabelGenerator0 = waterfallBarRenderer0.getLegendItemToolTipGenerator();
assertNull(categorySeriesLabelGenerator0);
}
@Test(timeout = 4000)
public void test135() throws Throwable {
ScatterRenderer scatterRenderer0 = new ScatterRenderer();
CategoryURLGenerator categoryURLGenerator0 = scatterRenderer0.getSeriesURLGenerator(2);
assertNull(categoryURLGenerator0);
}
@Test(timeout = 4000)
public void test136() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(0.0, 0.0);
CategoryItemLabelGenerator categoryItemLabelGenerator0 = stackedBarRenderer3D0.getBaseItemLabelGenerator();
assertNull(categoryItemLabelGenerator0);
}
@Test(timeout = 4000)
public void test137() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
DateAxis dateAxis0 = new DateAxis();
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot(dateAxis0);
DefaultBoxAndWhiskerCategoryDataset defaultBoxAndWhiskerCategoryDataset0 = new DefaultBoxAndWhiskerCategoryDataset();
ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo((EntityCollection) null);
PlotRenderingInfo plotRenderingInfo0 = chartRenderingInfo0.getPlotInfo();
CategoryStepRenderer.State categoryStepRenderer_State0 = new CategoryStepRenderer.State(plotRenderingInfo0);
// Undeclared exception!
// try {
categoryStepRenderer0.createHotSpotShape((Graphics2D) null, rectangle2D_Double0, combinedRangeCategoryPlot0, (CategoryAxis) null, dateAxis0, defaultBoxAndWhiskerCategoryDataset0, 471, 10, false, categoryStepRenderer_State0);
// fail("Expecting exception: RuntimeException");
// } catch(RuntimeException e) {
// //
// // Not implemented.
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test138() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
IntervalCategoryItemLabelGenerator intervalCategoryItemLabelGenerator0 = new IntervalCategoryItemLabelGenerator();
stackedBarRenderer3D0.setBaseItemLabelGenerator((CategoryItemLabelGenerator) intervalCategoryItemLabelGenerator0);
assertEquals(0.2, stackedBarRenderer3D0.getItemMargin(), 0.01);
}
@Test(timeout = 4000)
public void test139() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
StandardCategorySeriesLabelGenerator standardCategorySeriesLabelGenerator0 = new StandardCategorySeriesLabelGenerator();
stackedBarRenderer3D0.setLegendItemToolTipGenerator(standardCategorySeriesLabelGenerator0);
StackedBarRenderer3D stackedBarRenderer3D1 = new StackedBarRenderer3D(false);
boolean boolean0 = stackedBarRenderer3D0.equals(stackedBarRenderer3D1);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test140() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
int int0 = levelRenderer0.getRowCount();
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test141() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
// Undeclared exception!
// try {
stackedBarRenderer3D0.setSeriesToolTipGenerator((-525), (CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
@Test(timeout = 4000)
public void test142() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
BoxAndWhiskerToolTipGenerator boxAndWhiskerToolTipGenerator0 = new BoxAndWhiskerToolTipGenerator();
stackedBarRenderer3D0.setBaseToolTipGenerator((CategoryToolTipGenerator) boxAndWhiskerToolTipGenerator0);
StackedBarRenderer3D stackedBarRenderer3D1 = (StackedBarRenderer3D)stackedBarRenderer3D0.clone();
assertEquals(1, stackedBarRenderer3D1.getPassCount());
}
@Test(timeout = 4000)
public void test143() throws Throwable {
CategoryStepRenderer categoryStepRenderer0 = new CategoryStepRenderer(false);
BufferedImage bufferedImage0 = new BufferedImage(5, 5, 5);
BufferedImageRenderingSource bufferedImageRenderingSource0 = new BufferedImageRenderingSource(bufferedImage0);
Graphics2D graphics2D0 = bufferedImageRenderingSource0.createGraphics2D();
CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();
Rectangle2D.Float rectangle2D_Float0 = new Rectangle2D.Float();
categoryStepRenderer0.drawBackground(graphics2D0, combinedRangeCategoryPlot0, rectangle2D_Float0);
assertEquals(5.0, combinedRangeCategoryPlot0.getGap(), 0.01);
}
@Test(timeout = 4000)
public void test144() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategorySeriesLabelGenerator categorySeriesLabelGenerator0 = stackedBarRenderer3D0.getLegendItemURLGenerator();
assertNull(categorySeriesLabelGenerator0);
}
@Test(timeout = 4000)
public void test145() throws Throwable {
MinMaxCategoryRenderer minMaxCategoryRenderer0 = new MinMaxCategoryRenderer();
minMaxCategoryRenderer0.removeAnnotations();
assertTrue(minMaxCategoryRenderer0.getBaseSeriesVisible());
}
@Test(timeout = 4000)
public void test146() throws Throwable {
BarRenderer3D barRenderer3D0 = new BarRenderer3D();
CustomCategoryURLGenerator customCategoryURLGenerator0 = new CustomCategoryURLGenerator();
barRenderer3D0.setBaseURLGenerator((CategoryURLGenerator) customCategoryURLGenerator0);
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D(true);
boolean boolean0 = barRenderer3D0.equals(stackedBarRenderer3D0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test147() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
CategoryURLGenerator categoryURLGenerator0 = stackedBarRenderer3D0.getBaseURLGenerator();
assertNull(categoryURLGenerator0);
}
@Test(timeout = 4000)
public void test148() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
StandardEntityCollection standardEntityCollection0 = new StandardEntityCollection();
Line2D.Double line2D_Double0 = new Line2D.Double();
Rectangle2D rectangle2D0 = line2D_Double0.getBounds2D();
Number[][] numberArray0 = new Number[8][9];
DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset((Comparable[]) null, (Comparable[]) null, numberArray0, numberArray0);
stackedBarRenderer3D0.addEntity(standardEntityCollection0, rectangle2D0, defaultIntervalCategoryDataset0, 0, 0, true, 0, (-3160.255));
assertEquals(1, standardEntityCollection0.getEntityCount());
}
@Test(timeout = 4000)
public void test149() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
// Undeclared exception!
// try {
groupedStackedBarRenderer0.drawOutline((Graphics2D) null, (CategoryPlot) null, rectangle2D_Double0);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("org.jfree.chart.renderer.category.AbstractCategoryItemRenderer", e);
// }
}
@Test(timeout = 4000)
public void test150() throws Throwable {
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
groupedStackedBarRenderer0.hashCode();
}
@Test(timeout = 4000)
public void test151() throws Throwable {
DefaultKeyedValues2DDataset defaultKeyedValues2DDataset0 = new DefaultKeyedValues2DDataset();
StatisticalLineAndShapeRenderer statisticalLineAndShapeRenderer0 = new StatisticalLineAndShapeRenderer(true, true);
Hour hour0 = new Hour();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D("Base item URL generator not cloneable.");
RectangleEdge rectangleEdge0 = RectangleEdge.RIGHT;
// Undeclared exception!
// try {
statisticalLineAndShapeRenderer0.getItemMiddle(hour0, hour0, defaultKeyedValues2DDataset0, categoryAxis3D0, (Rectangle2D) null, rectangleEdge0);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Invalid category index: -1
// //
// verifyException("org.jfree.chart.axis.CategoryAxis", e);
// }
}
@Test(timeout = 4000)
public void test152() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
int int0 = stackedBarRenderer3D0.getPassCount();
assertEquals(1, int0);
}
@Test(timeout = 4000)
public void test153() throws Throwable {
StackedBarRenderer3D stackedBarRenderer3D0 = new StackedBarRenderer3D();
int int0 = stackedBarRenderer3D0.getColumnCount();
assertEquals(0, int0);
}
@Test(timeout = 4000)
public void test154() throws Throwable {
Rectangle2D.Double rectangle2D_Double0 = new Rectangle2D.Double();
CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D();
CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(2);
DefaultStatisticalCategoryDataset defaultStatisticalCategoryDataset0 = new DefaultStatisticalCategoryDataset();
LineRenderer3D lineRenderer3D0 = new LineRenderer3D();
CategoryPlot categoryPlot0 = new CategoryPlot(defaultStatisticalCategoryDataset0, categoryAxis3D0, cyclicNumberAxis0, lineRenderer3D0);
GroupedStackedBarRenderer groupedStackedBarRenderer0 = new GroupedStackedBarRenderer();
PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo((ChartRenderingInfo) null);
CategoryItemRendererState categoryItemRendererState0 = groupedStackedBarRenderer0.initialise((Graphics2D) null, rectangle2D_Double0, categoryPlot0, defaultStatisticalCategoryDataset0, plotRenderingInfo0);
assertEquals(0.0, categoryItemRendererState0.getSeriesRunningTotal(), 0.01);
}
@Test(timeout = 4000)
public void test155() throws Throwable {
StackedBarRenderer stackedBarRenderer0 = new StackedBarRenderer(false);
CategoryToolTipGenerator categoryToolTipGenerator0 = stackedBarRenderer0.getBaseToolTipGenerator();
assertNull(categoryToolTipGenerator0);
}
@Test(timeout = 4000)
public void test156() throws Throwable {
LevelRenderer levelRenderer0 = new LevelRenderer();
// Undeclared exception!
// try {
levelRenderer0.setSeriesItemLabelGenerator((-245), (CategoryItemLabelGenerator) null);
// fail("Expecting exception: IllegalArgumentException");
// } catch(IllegalArgumentException e) {
// //
// // Requires index >= 0.
// //
// verifyException("org.jfree.chart.util.AbstractObjectList", e);
// }
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
64751559fce3a09cc7a845be02d5fe76a7781c49 | 124df74bce796598d224c4380c60c8e95756f761 | /com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/listener/GhgMonitorTableSelectionListener.java | 18445455f6227ec00b179fce286951a7ed032753 | [] | no_license | Mapoet/AWIPS-Test | 19059bbd401573950995c8cc442ddd45588e6c9f | 43c5a7cc360b3cbec2ae94cb58594fe247253621 | refs/heads/master | 2020-04-17T03:35:57.762513 | 2017-02-06T17:17:58 | 2017-02-06T17:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,315 | java | /**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.ghg.monitor.listener;
import com.raytheon.viz.ghg.monitor.event.GhgMonitorTableSelectionEvent;
/**
* Table selection interface.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 2, 2010 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public interface GhgMonitorTableSelectionListener {
public void notifyUpdate(GhgMonitorTableSelectionEvent evt);
}
| [
"joshua.t.love@saic.com"
] | joshua.t.love@saic.com |
8c4344015b82760393d90a06468b92149569bfbf | ea62492ea30f5280d0ee4982a5d91460fbfb6431 | /SpringStudy/spring-09-appconfig/src/test/java/MyTest.java | 9f1c105701e99479c2175c0eff03a949e8d64253 | [] | no_license | IPostYellow/SSMStudyRecords | 15e2a9d5c9a3bb667932384a48894be4d3b3ccdc | cd3dbffee416302e1679b098d0060fd5599af1c4 | refs/heads/main | 2023-05-09T06:43:44.248582 | 2021-05-25T12:41:04 | 2021-05-25T12:41:04 | 358,531,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 491 | java | import config.MyConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import pojo.User;
public class MyTest {
public static void main(String[] args) {
//通过纯注解配置
ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
User getUser = context.getBean("getUser", User.class);
System.out.println(getUser.toString());
}
}
| [
"185184970@qq.com"
] | 185184970@qq.com |
0a22bce63ba13b0723e08b79f5e8903a67d0521e | 14f6292ab8b76c3ee4e6e8e0e6dabb7f1644a256 | /app/src/main/java/com/github/hbtruong2017/oft/ui/Promotion.java | 401c0dc8846e2ecf4a6947dc2c0e280862a6d193 | [] | no_license | benleewd/off-the-top | 236b84c70bf7557dcf1ae430dffaa9ea591fdcdd | 7baec4a14c9c940aaf6b4f68d5698a17dfe6c3a4 | refs/heads/main | 2023-01-29T08:46:11.075740 | 2020-12-14T13:45:42 | 2020-12-14T13:45:42 | 321,358,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,963 | java | package com.github.hbtruong2017.oft.ui;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import android.Manifest;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Base64;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.github.hbtruong2017.oft.MainActivity;
import com.github.hbtruong2017.oft.R;
import com.github.hbtruong2017.oft.StoreActivity;
import com.github.hbtruong2017.oft.ui.appointment.MapActivity;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import java.io.ByteArrayOutputStream;
public class Promotion extends AppCompatActivity {
private static int TAKING_PIC=1;
private static int SELECTING_PIC=2;
private ImageView pic;
private Bitmap image;
private boolean justUploaded;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_promotion);
pic = findViewById(R.id.picture);
Toolbar mToolbar = (Toolbar) findViewById(R.id.app_bar);
mToolbar.setTitle("Promotion");
setSupportActionBar(mToolbar);
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
Intent intent = new Intent(Promotion.this, MainActivity.class);
startActivity(intent);
break;
case R.id.appointment:
Intent intent_barber = new Intent(Promotion.this, MapActivity.class);
startActivity(intent_barber);
break;
case R.id.store:
Intent intent_store = new Intent(Promotion.this, StoreActivity.class);
startActivity(intent_store);
break;
}
return true;
}
});
}
public void takePicture(View view) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
Intent takePic = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if(takePic.resolveActivity(getPackageManager())!=null){
startActivityForResult(takePic, TAKING_PIC);
}
}else{
String[] array = {Manifest.permission.READ_EXTERNAL_STORAGE};
ActivityCompat.requestPermissions(
this, array,TAKING_PIC);
}
}
public void SelectPicture(View view) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
Intent intent = new Intent(
Intent.ACTION_PICK,
MediaStore.Images.Media.INTERNAL_CONTENT_URI
);
intent.setType("image/*");
startActivityForResult(intent, SELECTING_PIC);
} else {
String[] array = {Manifest.permission.READ_EXTERNAL_STORAGE};
ActivityCompat.requestPermissions(
this, array,SELECTING_PIC);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==TAKING_PIC && resultCode ==RESULT_OK && data !=null ){
Bundle extras = data.getExtras();
this.image = (Bitmap) extras.get("data");
pic.setImageBitmap(image);
justUploaded=true;
savePhoto();
} else if(requestCode == SELECTING_PIC && resultCode ==RESULT_OK && data !=null){
Uri image = data.getData();
String[] filePath = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(image,
filePath, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePath[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
this.image = BitmapFactory.decodeFile(picturePath, options);
pic.setImageBitmap(this.image);
justUploaded=true;
savePhoto();
}
}
public void goToRatings(View view) {
if(image!=null){
Intent intent = new Intent(this, PromotionRatings.class);
intent.putExtra("bitmap",image);
startActivity(intent);
}else {
Toast.makeText(this, "Please upload your photo first!", Toast.LENGTH_SHORT).show();
}
}
private String convertBitmapToString(Bitmap bitmap){
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100, byteArrayOutputStream);
byte [] b=byteArrayOutputStream.toByteArray();
String temp= Base64.encodeToString(b, Base64.DEFAULT);
return temp;
}
private Bitmap convertStringToBitmap(String string){
try {
byte [] encodeByte=Base64.decode(string,Base64.DEFAULT);
Bitmap bit= BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
return bit;
} catch(Exception e) {
e.getMessage();
return null;
}
}
private void savePhoto(){
SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
String s = convertBitmapToString(image);
editor.putString("bitmap", s);
editor.commit();
}
@Override
protected void onResume() {
super.onResume();
if(!justUploaded){
SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
String s = sharedPreferences.getString("bitmap","");
if(s!=null && !s.equals("")){
image = convertStringToBitmap(s);
pic.setImageBitmap(image);
}
}
}
}
| [
"weida.lee.2017@sis.smu.edu.sg"
] | weida.lee.2017@sis.smu.edu.sg |
0d794d406c5b2b02b77a11c49c7e763e9edd422c | cc1efcfd76393bb8feb94fad238bab6ead6a38c2 | /weather-city-server/src/main/java/com/fangdean/weathercity/util/XmlBuilder.java | 296ccca87037629a0ed197d24830fa9cb784399b | [] | no_license | mianjuhou/weathernew | d8c37defe31b733c29c0f3833ab68d39b2ad37ac | 89937634edd5822b7fab5c6731e3981dfe0dbee9 | refs/heads/master | 2020-03-21T01:50:04.609794 | 2018-06-20T10:17:13 | 2018-06-20T10:17:13 | 137,965,512 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 706 | java | package com.fangdean.weathercity.util;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
public class XmlBuilder {
public static Object xmlStrTpObject(Class<?> clazz, String xmlStr) throws IOException, JAXBException {
Reader reader = new StringReader(xmlStr);
JAXBContext context = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = context.createUnmarshaller();
Object xmlObject = unmarshaller.unmarshal(reader);
if (null != reader) {
reader.close();
}
return xmlObject;
}
}
| [
"fangdean@yeah.net"
] | fangdean@yeah.net |
960e3aee3c76faf6c007787d0b97951405f85429 | e977c424543422f49a25695665eb85bfc0700784 | /benchmark/icse15/1546279/buggy-version/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java | 756ddb49855b5391ff743c3d9793b8acb75294f1 | [] | no_license | amir9979/pattern-detector-experiment | 17fcb8934cef379fb96002450d11fac62e002dd3 | db67691e536e1550245e76d7d1c8dced181df496 | refs/heads/master | 2022-02-18T10:24:32.235975 | 2019-09-13T15:42:55 | 2019-09-13T15:42:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,791 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.servlet;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.cloud.Aliases;
import org.apache.solr.common.cloud.ClusterState;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.Slice;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkCoreNodeProps;
import org.apache.solr.common.cloud.ZkNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.MapSolrParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStreamBase;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.core.ConfigSolr;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.handler.ContentStreamHandlerBase;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.request.SolrRequestInfo;
import org.apache.solr.response.BinaryQueryResponseWriter;
import org.apache.solr.response.QueryResponseWriter;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
import org.apache.solr.servlet.cache.Method;
import org.apache.solr.update.processor.DistributedUpdateProcessor;
import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
import org.apache.solr.util.FastWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.WeakHashMap;
/**
* This filter looks at the incoming URL maps them to handlers defined in solrconfig.xml
*
* @since solr 1.2
*/
public class SolrDispatchFilter implements Filter
{
private static final String CONNECTION_HEADER = "Connection";
private static final String TRANSFER_ENCODING_HEADER = "Transfer-Encoding";
final Logger log;
protected volatile CoreContainer cores;
protected String pathPrefix = null; // strip this from the beginning of a path
protected String abortErrorMessage = null;
protected final Map<SolrConfig, SolrRequestParsers> parsers = new WeakHashMap<SolrConfig, SolrRequestParsers>();
private static final Charset UTF8 = Charset.forName("UTF-8");
public SolrDispatchFilter() {
try {
log = LoggerFactory.getLogger(SolrDispatchFilter.class);
} catch (NoClassDefFoundError e) {
throw new SolrException(
ErrorCode.SERVER_ERROR,
"Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in "
+"the jetty lib/ext directory. For other containers, the corresponding directory should be used. "
+"For more information, see: http://wiki.apache.org/solr/SolrLogging",
e);
}
}
@Override
public void init(FilterConfig config) throws ServletException
{
log.info("SolrDispatchFilter.init()");
try {
// web.xml configuration
this.pathPrefix = config.getInitParameter( "path-prefix" );
this.cores = createCoreContainer();
log.info("user.dir=" + System.getProperty("user.dir"));
}
catch( Throwable t ) {
// catch this so our filter still works
log.error( "Could not start Solr. Check solr/home property and the logs");
SolrCore.log( t );
}
log.info("SolrDispatchFilter.init() done");
}
private ConfigSolr loadConfigSolr(SolrResourceLoader loader) {
String solrxmlLocation = System.getProperty("solr.solrxml.location", "solrhome");
if (solrxmlLocation == null || "solrhome".equalsIgnoreCase(solrxmlLocation))
return ConfigSolr.fromSolrHome(loader, loader.getInstanceDir());
if ("zookeeper".equalsIgnoreCase(solrxmlLocation)) {
String zkHost = System.getProperty("zkHost");
log.info("Trying to read solr.xml from " + zkHost);
if (StringUtils.isEmpty(zkHost))
throw new SolrException(ErrorCode.SERVER_ERROR,
"Could not load solr.xml from zookeeper: zkHost system property not set");
SolrZkClient zkClient = new SolrZkClient(zkHost, 30000);
try {
if (!zkClient.exists("/solr.xml", true))
throw new SolrException(ErrorCode.SERVER_ERROR, "Could not load solr.xml from zookeeper: node not found");
byte[] data = zkClient.getData("/solr.xml", null, null, true);
return ConfigSolr.fromInputStream(loader, new ByteArrayInputStream(data));
} catch (Exception e) {
throw new SolrException(ErrorCode.SERVER_ERROR, "Could not load solr.xml from zookeeper", e);
} finally {
zkClient.close();
}
}
throw new SolrException(ErrorCode.SERVER_ERROR,
"Bad solr.solrxml.location set: " + solrxmlLocation + " - should be 'solrhome' or 'zookeeper'");
}
/**
* Override this to change CoreContainer initialization
* @return a CoreContainer to hold this server's cores
*/
protected CoreContainer createCoreContainer() {
SolrResourceLoader loader = new SolrResourceLoader(SolrResourceLoader.locateSolrHome());
ConfigSolr config = loadConfigSolr(loader);
CoreContainer cores = new CoreContainer(loader, config);
cores.load();
return cores;
}
public CoreContainer getCores() {
return cores;
}
@Override
public void destroy() {
if (cores != null) {
cores.shutdown();
cores = null;
}
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
doFilter(request, response, chain, false);
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, boolean retry) throws IOException, ServletException {
if( abortErrorMessage != null ) {
((HttpServletResponse)response).sendError( 500, abortErrorMessage );
return;
}
if (this.cores == null) {
((HttpServletResponse)response).sendError( 503, "Server is shutting down or failed to initialize" );
return;
}
CoreContainer cores = this.cores;
SolrCore core = null;
SolrQueryRequest solrReq = null;
Aliases aliases = null;
if( request instanceof HttpServletRequest) {
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse resp = (HttpServletResponse)response;
SolrRequestHandler handler = null;
String corename = "";
String origCorename = null;
try {
// put the core container in request attribute
req.setAttribute("org.apache.solr.CoreContainer", cores);
String path = req.getServletPath();
if( req.getPathInfo() != null ) {
// this lets you handle /update/commit when /update is a servlet
path += req.getPathInfo();
}
if( pathPrefix != null && path.startsWith( pathPrefix ) ) {
path = path.substring( pathPrefix.length() );
}
// check for management path
String alternate = cores.getManagementPath();
if (alternate != null && path.startsWith(alternate)) {
path = path.substring(0, alternate.length());
}
// unused feature ?
int idx = path.indexOf( ':' );
if( idx > 0 ) {
// save the portion after the ':' for a 'handler' path parameter
path = path.substring( 0, idx );
}
// Check for the core admin page
if( path.equals( cores.getAdminPath() ) ) {
handler = cores.getMultiCoreHandler();
solrReq = SolrRequestParsers.DEFAULT.parse(null,path, req);
handleAdminRequest(req, response, handler, solrReq);
return;
}
boolean usingAliases = false;
List<String> collectionsList = null;
// Check for the core admin collections url
if( path.equals( "/admin/collections" ) ) {
handler = cores.getCollectionsHandler();
solrReq = SolrRequestParsers.DEFAULT.parse(null,path, req);
handleAdminRequest(req, response, handler, solrReq);
return;
}
// Check for the core admin info url
if( path.startsWith( "/admin/info" ) ) {
handler = cores.getInfoHandler();
solrReq = SolrRequestParsers.DEFAULT.parse(null,path, req);
handleAdminRequest(req, response, handler, solrReq);
return;
}
else {
//otherwise, we should find a core from the path
idx = path.indexOf( "/", 1 );
if( idx > 1 ) {
// try to get the corename as a request parameter first
corename = path.substring( 1, idx );
// look at aliases
if (cores.isZooKeeperAware()) {
origCorename = corename;
ZkStateReader reader = cores.getZkController().getZkStateReader();
aliases = reader.getAliases();
if (aliases != null && aliases.collectionAliasSize() > 0) {
usingAliases = true;
String alias = aliases.getCollectionAlias(corename);
if (alias != null) {
collectionsList = StrUtils.splitSmart(alias, ",", true);
corename = collectionsList.get(0);
}
}
}
core = cores.getCore(corename);
if (core != null) {
path = path.substring( idx );
}
}
if (core == null) {
if (!cores.isZooKeeperAware() ) {
core = cores.getCore("");
}
}
}
if (core == null && cores.isZooKeeperAware()) {
// we couldn't find the core - lets make sure a collection was not specified instead
core = getCoreByCollection(cores, corename, path);
if (core != null) {
// we found a core, update the path
path = path.substring( idx );
}
// if we couldn't find it locally, look on other nodes
if (core == null && idx > 0) {
String coreUrl = getRemotCoreUrl(cores, corename, origCorename);
// don't proxy for internal update requests
SolrParams queryParams = SolrRequestParsers.parseQueryString(req.getQueryString());
if (coreUrl != null
&& queryParams
.get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null
&& queryParams.get(DistributedUpdateProcessor.DISTRIB_FROM) == null) {
path = path.substring(idx);
remoteQuery(coreUrl + path, req, solrReq, resp);
return;
} else {
if (!retry) {
// we couldn't find a core to work with, try reloading aliases
// TODO: it would be nice if admin ui elements skipped this...
ZkStateReader reader = cores.getZkController()
.getZkStateReader();
reader.updateAliases();
doFilter(request, response, chain, true);
return;
}
}
}
// try the default core
if (core == null) {
core = cores.getCore("");
}
}
// With a valid core...
if( core != null ) {
final SolrConfig config = core.getSolrConfig();
// get or create/cache the parser for the core
SolrRequestParsers parser = null;
parser = parsers.get(config);
if( parser == null ) {
parser = new SolrRequestParsers(config);
parsers.put(config, parser );
}
// Handle /schema/* paths via Restlet
if( path.startsWith("/schema") ) {
solrReq = parser.parse(core, path, req);
SolrRequestInfo.setRequestInfo(new SolrRequestInfo(solrReq, new SolrQueryResponse()));
if( path.equals(req.getServletPath()) ) {
// avoid endless loop - pass through to Restlet via webapp
chain.doFilter(request, response);
} else {
// forward rewritten URI (without path prefix and core/collection name) to Restlet
req.getRequestDispatcher(path).forward(request, response);
}
return;
}
// Determine the handler from the url path if not set
// (we might already have selected the cores handler)
if( handler == null && path.length() > 1 ) { // don't match "" or "/" as valid path
handler = core.getRequestHandler( path );
// no handler yet but allowed to handle select; let's check
if( handler == null && parser.isHandleSelect() ) {
if( "/select".equals( path ) || "/select/".equals( path ) ) {
solrReq = parser.parse( core, path, req );
String qt = solrReq.getParams().get( CommonParams.QT );
handler = core.getRequestHandler( qt );
if( handler == null ) {
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "unknown handler: "+qt);
}
if( qt != null && qt.startsWith("/") && (handler instanceof ContentStreamHandlerBase)) {
//For security reasons it's a bad idea to allow a leading '/', ex: /select?qt=/update see SOLR-3161
//There was no restriction from Solr 1.4 thru 3.5 and it's not supported for update handlers.
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Invalid Request Handler ('qt'). Do not use /select to access: "+qt);
}
}
}
}
// With a valid handler and a valid core...
if( handler != null ) {
// if not a /select, create the request
if( solrReq == null ) {
solrReq = parser.parse( core, path, req );
}
if (usingAliases) {
processAliases(solrReq, aliases, collectionsList);
}
final Method reqMethod = Method.getMethod(req.getMethod());
HttpCacheHeaderUtil.setCacheControlHeader(config, resp, reqMethod);
// unless we have been explicitly told not to, do cache validation
// if we fail cache validation, execute the query
if (config.getHttpCachingConfig().isNever304() ||
!HttpCacheHeaderUtil.doCacheHeaderValidation(solrReq, req, reqMethod, resp)) {
SolrQueryResponse solrRsp = new SolrQueryResponse();
/* even for HEAD requests, we need to execute the handler to
* ensure we don't get an error (and to make sure the correct
* QueryResponseWriter is selected and we get the correct
* Content-Type)
*/
SolrRequestInfo.setRequestInfo(new SolrRequestInfo(solrReq, solrRsp));
this.execute( req, handler, solrReq, solrRsp );
HttpCacheHeaderUtil.checkHttpCachingVeto(solrRsp, resp, reqMethod);
// add info to http headers
//TODO: See SOLR-232 and SOLR-267.
/*try {
NamedList solrRspHeader = solrRsp.getResponseHeader();
for (int i=0; i<solrRspHeader.size(); i++) {
((javax.servlet.http.HttpServletResponse) response).addHeader(("Solr-" + solrRspHeader.getName(i)), String.valueOf(solrRspHeader.getVal(i)));
}
} catch (ClassCastException cce) {
log.log(Level.WARNING, "exception adding response header log information", cce);
}*/
QueryResponseWriter responseWriter = core.getQueryResponseWriter(solrReq);
writeResponse(solrRsp, response, responseWriter, solrReq, reqMethod);
}
return; // we are done with a valid handler
}
}
log.debug("no handler or core retrieved for " + path + ", follow through...");
}
catch (Throwable ex) {
sendError( core, solrReq, request, (HttpServletResponse)response, ex );
return;
}
finally {
if( solrReq != null ) {
log.debug("Closing out SolrRequest: {}", solrReq);
solrReq.close();
}
if (core != null) {
core.close();
}
SolrRequestInfo.clearRequestInfo();
}
}
// Otherwise let the webapp handle the request
chain.doFilter(request, response);
}
private void processAliases(SolrQueryRequest solrReq, Aliases aliases,
List<String> collectionsList) {
String collection = solrReq.getParams().get("collection");
if (collection != null) {
collectionsList = StrUtils.splitSmart(collection, ",", true);
}
if (collectionsList != null) {
Set<String> newCollectionsList = new HashSet<String>(
collectionsList.size());
for (String col : collectionsList) {
String al = aliases.getCollectionAlias(col);
if (al != null) {
List<String> aliasList = StrUtils.splitSmart(al, ",", true);
newCollectionsList.addAll(aliasList);
} else {
newCollectionsList.add(col);
}
}
if (newCollectionsList.size() > 0) {
StringBuilder collectionString = new StringBuilder();
Iterator<String> it = newCollectionsList.iterator();
int sz = newCollectionsList.size();
for (int i = 0; i < sz; i++) {
collectionString.append(it.next());
if (i < newCollectionsList.size() - 1) {
collectionString.append(",");
}
}
ModifiableSolrParams params = new ModifiableSolrParams(
solrReq.getParams());
params.set("collection", collectionString.toString());
solrReq.setParams(params);
}
}
}
private void remoteQuery(String coreUrl, HttpServletRequest req,
SolrQueryRequest solrReq, HttpServletResponse resp) throws IOException {
try {
String urlstr = coreUrl;
String queryString = req.getQueryString();
urlstr += queryString == null ? "" : "?" + queryString;
URL url = new URL(urlstr);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod(req.getMethod());
con.setUseCaches(false);
boolean isPostOrPutRequest = "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod());
if (isPostOrPutRequest) {
con.setDoOutput(true);
}
con.setDoInput(true);
for (Enumeration<String> e = req.getHeaderNames(); e.hasMoreElements();) {
String headerName = e.nextElement();
con.setRequestProperty(headerName, req.getHeader(headerName));
}
try {
con.connect();
InputStream is;
OutputStream os;
if (isPostOrPutRequest) {
is = req.getInputStream();
os = con.getOutputStream(); // side effect: method is switched to POST
try {
IOUtils.copyLarge(is, os);
os.flush();
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(is); // TODO: I thought we weren't supposed to explicitly close servlet streams
}
}
resp.setStatus(con.getResponseCode());
for (Iterator<Entry<String,List<String>>> i = con.getHeaderFields().entrySet().iterator(); i.hasNext();) {
Map.Entry<String,List<String>> mapEntry = i.next();
String header = mapEntry.getKey();
// We pull out these two headers below because they can cause chunked
// encoding issues with Tomcat and certain clients
if (header != null && !header.equals(TRANSFER_ENCODING_HEADER)
&& !header.equals(CONNECTION_HEADER)) {
for (String value : mapEntry.getValue()) {
resp.addHeader(mapEntry.getKey(), value);
}
}
}
resp.setCharacterEncoding(con.getContentEncoding());
resp.setContentType(con.getContentType());
is = con.getInputStream();
os = resp.getOutputStream();
try {
IOUtils.copyLarge(is, os);
os.flush();
} finally {
IOUtils.closeQuietly(os); // TODO: I thought we weren't supposed to explicitly close servlet streams
IOUtils.closeQuietly(is);
}
} finally {
con.disconnect();
}
} catch (IOException e) {
sendError(null, solrReq, req, resp, new SolrException(
SolrException.ErrorCode.SERVER_ERROR,
"Error trying to proxy request for url: " + coreUrl, e));
}
}
private String getRemotCoreUrl(CoreContainer cores, String collectionName, String origCorename) {
ClusterState clusterState = cores.getZkController().getClusterState();
Collection<Slice> slices = clusterState.getActiveSlices(collectionName);
boolean byCoreName = false;
if (slices == null) {
slices = new ArrayList<Slice>();
// look by core name
byCoreName = true;
slices = getSlicesForCollections(clusterState, slices, true);
if (slices == null || slices.size() == 0) {
slices = getSlicesForCollections(clusterState, slices, false);
}
}
if (slices == null || slices.size() == 0) {
return null;
}
String coreUrl = getCoreUrl(cores, collectionName, origCorename, clusterState,
slices, byCoreName, true);
if (coreUrl == null) {
coreUrl = getCoreUrl(cores, collectionName, origCorename, clusterState,
slices, byCoreName, false);
}
return coreUrl;
}
private String getCoreUrl(CoreContainer cores, String collectionName,
String origCorename, ClusterState clusterState, Collection<Slice> slices,
boolean byCoreName, boolean activeReplicas) {
String coreUrl;
Set<String> liveNodes = clusterState.getLiveNodes();
Iterator<Slice> it = slices.iterator();
while (it.hasNext()) {
Slice slice = it.next();
Map<String,Replica> sliceShards = slice.getReplicasMap();
for (ZkNodeProps nodeProps : sliceShards.values()) {
ZkCoreNodeProps coreNodeProps = new ZkCoreNodeProps(nodeProps);
if (!activeReplicas || (liveNodes.contains(coreNodeProps.getNodeName())
&& coreNodeProps.getState().equals(ZkStateReader.ACTIVE))) {
if (byCoreName && !collectionName.equals(coreNodeProps.getCoreName())) {
// if it's by core name, make sure they match
continue;
}
if (coreNodeProps.getBaseUrl().equals(cores.getZkController().getBaseUrl())) {
// don't count a local core
continue;
}
if (origCorename != null) {
coreUrl = coreNodeProps.getBaseUrl() + "/" + origCorename;
} else {
coreUrl = coreNodeProps.getCoreUrl();
if (coreUrl.endsWith("/")) {
coreUrl = coreUrl.substring(0, coreUrl.length() - 1);
}
}
return coreUrl;
}
}
}
return null;
}
private Collection<Slice> getSlicesForCollections(ClusterState clusterState,
Collection<Slice> slices, boolean activeSlices) {
Set<String> collections = clusterState.getCollections();
for (String collection : collections) {
if (activeSlices) {
slices.addAll(clusterState.getActiveSlices(collection));
} else {
slices.addAll(clusterState.getSlices(collection));
}
}
return slices;
}
private SolrCore getCoreByCollection(CoreContainer cores, String corename, String path) {
String collection = corename;
ZkStateReader zkStateReader = cores.getZkController().getZkStateReader();
ClusterState clusterState = zkStateReader.getClusterState();
Map<String,Slice> slices = clusterState.getActiveSlicesMap(collection);
if (slices == null) {
return null;
}
// look for a core on this node
Set<Entry<String,Slice>> entries = slices.entrySet();
SolrCore core = null;
done:
for (Entry<String,Slice> entry : entries) {
// first see if we have the leader
ZkNodeProps leaderProps = clusterState.getLeader(collection, entry.getKey());
if (leaderProps != null) {
core = checkProps(cores, path, leaderProps);
}
if (core != null) {
break done;
}
// check everyone then
Map<String,Replica> shards = entry.getValue().getReplicasMap();
Set<Entry<String,Replica>> shardEntries = shards.entrySet();
for (Entry<String,Replica> shardEntry : shardEntries) {
Replica zkProps = shardEntry.getValue();
core = checkProps(cores, path, zkProps);
if (core != null) {
break done;
}
}
}
return core;
}
private SolrCore checkProps(CoreContainer cores, String path,
ZkNodeProps zkProps) {
String corename;
SolrCore core = null;
if (cores.getZkController().getNodeName().equals(zkProps.getStr(ZkStateReader.NODE_NAME_PROP))) {
corename = zkProps.getStr(ZkStateReader.CORE_NAME_PROP);
core = cores.getCore(corename);
}
return core;
}
private void handleAdminRequest(HttpServletRequest req, ServletResponse response, SolrRequestHandler handler,
SolrQueryRequest solrReq) throws IOException {
SolrQueryResponse solrResp = new SolrQueryResponse();
SolrCore.preDecorateResponse(solrReq, solrResp);
handler.handleRequest(solrReq, solrResp);
SolrCore.postDecorateResponse(handler, solrReq, solrResp);
if (log.isInfoEnabled() && solrResp.getToLog().size() > 0) {
log.info(solrResp.getToLogAsString("[admin] "));
}
QueryResponseWriter respWriter = SolrCore.DEFAULT_RESPONSE_WRITERS.get(solrReq.getParams().get(CommonParams.WT));
if (respWriter == null) respWriter = SolrCore.DEFAULT_RESPONSE_WRITERS.get("standard");
writeResponse(solrResp, response, respWriter, solrReq, Method.getMethod(req.getMethod()));
}
private void writeResponse(SolrQueryResponse solrRsp, ServletResponse response,
QueryResponseWriter responseWriter, SolrQueryRequest solrReq, Method reqMethod)
throws IOException {
// Now write it out
final String ct = responseWriter.getContentType(solrReq, solrRsp);
// don't call setContentType on null
if (null != ct) response.setContentType(ct);
if (solrRsp.getException() != null) {
NamedList info = new SimpleOrderedMap();
int code = ResponseUtils.getErrorInfo(solrRsp.getException(), info, log);
solrRsp.add("error", info);
((HttpServletResponse) response).setStatus(code);
}
if (Method.HEAD != reqMethod) {
if (responseWriter instanceof BinaryQueryResponseWriter) {
BinaryQueryResponseWriter binWriter = (BinaryQueryResponseWriter) responseWriter;
binWriter.write(response.getOutputStream(), solrReq, solrRsp);
} else {
String charset = ContentStreamBase.getCharsetFromContentType(ct);
Writer out = (charset == null || charset.equalsIgnoreCase("UTF-8"))
? new OutputStreamWriter(response.getOutputStream(), UTF8)
: new OutputStreamWriter(response.getOutputStream(), charset);
out = new FastWriter(out);
responseWriter.write(out, solrReq, solrRsp);
out.flush();
}
}
//else http HEAD request, nothing to write out, waited this long just to get ContentType
}
protected void execute( HttpServletRequest req, SolrRequestHandler handler, SolrQueryRequest sreq, SolrQueryResponse rsp) {
// a custom filter could add more stuff to the request before passing it on.
// for example: sreq.getContext().put( "HttpServletRequest", req );
// used for logging query stats in SolrCore.execute()
sreq.getContext().put( "webapp", req.getContextPath() );
sreq.getCore().execute( handler, sreq, rsp );
}
protected void sendError(SolrCore core,
SolrQueryRequest req,
ServletRequest request,
HttpServletResponse response,
Throwable ex) throws IOException {
SolrCore localCore = null;
try {
SolrQueryResponse solrResp = new SolrQueryResponse();
if(ex instanceof Exception) {
solrResp.setException((Exception)ex);
}
else {
solrResp.setException(new RuntimeException(ex));
}
if(core==null) {
localCore = cores.getCore(""); // default core
} else {
localCore = core;
}
if(req==null) {
final SolrParams solrParams;
if (request instanceof HttpServletRequest) {
// use GET parameters if available:
solrParams = SolrRequestParsers.parseQueryString(((HttpServletRequest) request).getQueryString());
} else {
// we have no params at all, use empty ones:
solrParams = new MapSolrParams(Collections.<String,String>emptyMap());
}
req = new SolrQueryRequestBase(core, solrParams) {};
}
QueryResponseWriter writer = core.getQueryResponseWriter(req);
writeResponse(solrResp, response, writer, req, Method.GET);
}
catch( Throwable t ) { // This error really does not matter
SimpleOrderedMap info = new SimpleOrderedMap();
int code = ResponseUtils.getErrorInfo(ex, info, log);
response.sendError( code, info.toString() );
} finally {
if (core == null && localCore != null) {
localCore.close();
}
}
}
//---------------------------------------------------------------------
//---------------------------------------------------------------------
/**
* Set the prefix for all paths. This is useful if you want to apply the
* filter to something other then /*, perhaps because you are merging this
* filter into a larger web application.
*
* For example, if web.xml specifies:
* <pre class="prettyprint">
* {@code
* <filter-mapping>
* <filter-name>SolrRequestFilter</filter-name>
* <url-pattern>/xxx/*</url-pattern>
* </filter-mapping>}
* </pre>
*
* Make sure to set the PathPrefix to "/xxx" either with this function
* or in web.xml.
*
* <pre class="prettyprint">
* {@code
* <init-param>
* <param-name>path-prefix</param-name>
* <param-value>/xxx</param-value>
* </init-param>}
* </pre>
*/
public void setPathPrefix(String pathPrefix) {
this.pathPrefix = pathPrefix;
}
public String getPathPrefix() {
return pathPrefix;
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
4d83bb60c5f622718263a99862a86d8f14634d73 | 634ae05c5e190412b2c50a7b5317c3d331322bdf | /Sandbox/src/main/java/basic/SwitchString.java | dd9695c523b9f9908044570440ffd186164871f7 | [] | no_license | ganqzz/java_workspace | 1b919aff1f177c5b6971e7f19f465129a247ed72 | 3a7285e9b1945c8b55a4b02bbb20aee3d31a9086 | refs/heads/master | 2023-07-16T06:03:36.310878 | 2021-09-04T03:44:37 | 2021-09-04T03:44:37 | 389,467,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package basic;
class SwitchString {
public static void main(String[] args) {
int h = 0;
String s = args.length == 0 ? "" : args[0].trim().toLowerCase();
switch (s) {
case "hoge":
System.out.println("Case1: " + s);
break;
case "fuga":
System.out.println("Case2: " + s);
// break; // スルー
case "fefe":
System.out.println("Case3: " + s);
break;
default:
System.out.println("Default.");
break;
}
System.out.println();
}
}
| [
"ganqzz@users.noreply.github.com"
] | ganqzz@users.noreply.github.com |
b0d9ba572ca62c93a33a95e31f3d5b907929b6c5 | e30f9f9c1814a143fd338a234f695514dd07de0b | /app/build/generated/not_namespaced_r_class_sources/donateDebug/processDonateDebugResources/r/android/support/loader/R.java | 2323565d33f42248875926b98091eaf951d5ea74 | [
"LicenseRef-scancode-infineon-free",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | xkevin190/i2pAndroidModified | 6114448728b46dfe7fec1f35474a7cce119466ce | 4bac4b2c8f0ab16e09ddcb6a7ef957b854b15704 | refs/heads/master | 2022-11-29T21:07:45.325369 | 2020-08-07T20:15:05 | 2020-08-07T20:15:05 | 285,911,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,453 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.loader;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f03002b;
public static final int font = 0x7f0300b9;
public static final int fontProviderAuthority = 0x7f0300bb;
public static final int fontProviderCerts = 0x7f0300bc;
public static final int fontProviderFetchStrategy = 0x7f0300bd;
public static final int fontProviderFetchTimeout = 0x7f0300be;
public static final int fontProviderPackage = 0x7f0300bf;
public static final int fontProviderQuery = 0x7f0300c0;
public static final int fontStyle = 0x7f0300c1;
public static final int fontVariationSettings = 0x7f0300c2;
public static final int fontWeight = 0x7f0300c3;
public static final int ttcIndex = 0x7f0301fc;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f050054;
public static final int notification_icon_bg_color = 0x7f050055;
public static final int ripple_material_light = 0x7f050069;
public static final int secondary_text_default_material_light = 0x7f05006b;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f06004e;
public static final int compat_button_inset_vertical_material = 0x7f06004f;
public static final int compat_button_padding_horizontal_material = 0x7f060050;
public static final int compat_button_padding_vertical_material = 0x7f060051;
public static final int compat_control_corner_material = 0x7f060052;
public static final int compat_notification_large_icon_max_height = 0x7f060053;
public static final int compat_notification_large_icon_max_width = 0x7f060054;
public static final int notification_action_icon_size = 0x7f06008b;
public static final int notification_action_text_size = 0x7f06008c;
public static final int notification_big_circle_margin = 0x7f06008d;
public static final int notification_content_margin_start = 0x7f06008e;
public static final int notification_large_icon_height = 0x7f06008f;
public static final int notification_large_icon_width = 0x7f060090;
public static final int notification_main_column_padding_top = 0x7f060091;
public static final int notification_media_narrow_margin = 0x7f060092;
public static final int notification_right_icon_size = 0x7f060093;
public static final int notification_right_side_padding_top = 0x7f060094;
public static final int notification_small_icon_background_padding = 0x7f060095;
public static final int notification_small_icon_size_as_large = 0x7f060096;
public static final int notification_subtext_size = 0x7f060097;
public static final int notification_top_pad = 0x7f060098;
public static final int notification_top_pad_large_text = 0x7f060099;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f070082;
public static final int notification_bg = 0x7f070083;
public static final int notification_bg_low = 0x7f070084;
public static final int notification_bg_low_normal = 0x7f070085;
public static final int notification_bg_low_pressed = 0x7f070086;
public static final int notification_bg_normal = 0x7f070087;
public static final int notification_bg_normal_pressed = 0x7f070088;
public static final int notification_icon_background = 0x7f070089;
public static final int notification_template_icon_bg = 0x7f07008a;
public static final int notification_template_icon_low_bg = 0x7f07008b;
public static final int notification_tile_bg = 0x7f07008c;
public static final int notify_panel_notification_icon_bg = 0x7f07008d;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f080015;
public static final int action_divider = 0x7f080019;
public static final int action_image = 0x7f08001c;
public static final int action_text = 0x7f08002d;
public static final int actions = 0x7f08002e;
public static final int async = 0x7f080034;
public static final int blocking = 0x7f080037;
public static final int chronometer = 0x7f08004b;
public static final int forever = 0x7f080077;
public static final int icon = 0x7f08007d;
public static final int icon_group = 0x7f08007f;
public static final int info = 0x7f080086;
public static final int italic = 0x7f080087;
public static final int line1 = 0x7f080093;
public static final int line3 = 0x7f080094;
public static final int normal = 0x7f0800b7;
public static final int notification_background = 0x7f0800b8;
public static final int notification_main_column = 0x7f0800b9;
public static final int notification_main_column_container = 0x7f0800ba;
public static final int right_icon = 0x7f0800d5;
public static final int right_side = 0x7f0800d7;
public static final int tag_transition_group = 0x7f080104;
public static final int tag_unhandled_key_event_manager = 0x7f080105;
public static final int tag_unhandled_key_listeners = 0x7f080106;
public static final int text = 0x7f080107;
public static final int text2 = 0x7f080108;
public static final int time = 0x7f08010d;
public static final int title = 0x7f08010e;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f090012;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0a004f;
public static final int notification_action_tombstone = 0x7f0a0050;
public static final int notification_template_custom_big = 0x7f0a0057;
public static final int notification_template_icon_group = 0x7f0a0058;
public static final int notification_template_part_chronometer = 0x7f0a005c;
public static final int notification_template_part_time = 0x7f0a005d;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0e01b9;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0f012f;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0130;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f0132;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0135;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0137;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01a4;
public static final int Widget_Compat_NotificationActionText = 0x7f0f01a5;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f03002b };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300bb, 0x7f0300bc, 0x7f0300bd, 0x7f0300be, 0x7f0300bf, 0x7f0300c0 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300b9, 0x7f0300c1, 0x7f0300c2, 0x7f0300c3, 0x7f0301fc };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"kevinvelasco193@gmail.com"
] | kevinvelasco193@gmail.com |
a4a1f8ee6f50aab2aa325536ba28879619902232 | 2d67acd5dbb2a58664bae84dc4bc5a0ada1f4476 | /src/com/Shx/ExeUse/ExeOpen.java | 14080a0f6c1c1ce69b82b8665c4c704a1358fa4b | [] | no_license | IMSHX/QuickApplicationOpening | 7c93c761212e69659be3b78affd933c6dc55ea95 | 0de886be7d7e905966b368f60dc979ba5dd930d9 | refs/heads/master | 2020-05-04T06:09:50.244843 | 2019-05-13T15:50:38 | 2019-05-13T15:50:38 | 178,996,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.Shx.ExeUse;
import java.io.IOException;
/**
* 编写人:SHX
* 编写时间:2019/3/10
* 编写目的:启动.exe文件
*/
public class ExeOpen {
public void OpenExe(String fileName){
try {
Runtime.getRuntime().exec(fileName);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"imshx1091837568@gmail.com"
] | imshx1091837568@gmail.com |
ad5d498d07f45c90cb149c23859112dcb20fddf4 | ab4fbbb674014bf7f85ea3d71b6ab83253c22944 | /Menu.java | 41b6a14cd513596f965e271f634ba2a1a4b74f8e | [] | no_license | tobi5519/Delfinen | 6044ee5b5361e99267e8c46affb20c4fb2326a5f | f09dfa40a6e5b0e9ae5a5d6e63fe1e588de595a8 | refs/heads/master | 2021-01-21T18:11:24.801692 | 2017-05-28T14:39:46 | 2017-05-28T14:39:46 | 92,022,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,327 | java | public class Menu{
private UserInput input = new UserInput();
private Database db = new Database();
// Starter method -----------
public void start(){
menuRunner("mainMenu");
}
// MENUS --------------------
private Boolean mainMenu(){
String[] menuOptions = {"Main menu",
"Chairman's menu",
"Treasurer's menu",
"Coach's menu"};
printOptions(menuOptions);
switch(input.getInt()){
case 0:
db.save();
cls();
System.out.println("All changes saved.. \nExiting.");
return false;
case 1:
menuRunner("chairmanMenu");
return true;
case 2:
menuRunner("treasurerMenu");
return true;
case 3:
menuRunner("coachMenu");
return true;
default:
return true;
}
}
private Boolean chairmanMenu(){
String[] menuOptions = {"Chairman Menu","View all members","Add Member","Edit member","Remove Member"};
printOptions(menuOptions);
switch(input.getInt()){
case 0:
return false;
case 1:
cls();
db.printMembers();
System.out.println("============================");
input.waitForEnter();
break;
case 2:
addMember();
break;
case 3:
editMember(chooseMember("edit"));
break;
case 4:
deleteMember(chooseMember("delete"));
break;
default:
}
return true;
}
private Boolean treasurerMenu(){
System.out.println("Now viewing members with a due payment!");
db.printDueMembers();
input.waitForEnter();
return false;
}
private Boolean coachMenu(){
String[] menuOptions = {"Coach Menu","Add Performance", "Print top 5"};
printOptions(menuOptions);
switch(input.getInt()){
case 0:
return false;
case 1:
addPerformance();
input.waitForEnter();
break;
case 2:
db.printTopFive();
input.waitForEnter();
break;
default:
}
return true;
}
// Utility methods ----------
private void printOptions(String[] options){
System.out.println(options[0]);
System.out.println("Options:");
System.out.println("0: Go back/exit.");
for(int i = 1; i < options.length; i++){
System.out.println(i + ": " + options[i]);
}
}
private void menuRunner(String method){
Boolean running = true;
while(running){
cls();
switch(method){
case "chairmanMenu":
running = chairmanMenu();
break;
case "mainMenu":
running = mainMenu();
break;
case "treasurerMenu":
running = treasurerMenu();
break;
case "coachMenu":
running = coachMenu();
break;
}
}
}
private void cls(){
for(int i = 0; i < 30; i++){
System.out.println();
}
System.out.println("============================");
}
// Sub Menus ----------------
private void addMember(){
System.out.println("Adding new member.");
String name = input.getLine("Name");
int age = input.getInt("Age");
String residence = input.getLine("Address");
while(true){
if(chooseSwimType(name, age, residence)){
break;
}
}
}
private void editMember(Member placeholder){
if(placeholder != null){
Boolean running = true;
while(running){
switch( chooseProperty(
placeholder.getName(),
placeholder.getAge(),
placeholder.getResidence(),
placeholder.getMemberStatus()) )
{
case 0:
running = false;
break;
//name
case 1:
placeholder.setName(input.getLine("Name"));
break;
//age
case 2:
int age = input.getInt("Age");
placeholder.setAge(age);
break;
//residence
case 3:
placeholder.setResidence(input.getLine("Residence/Address"));
break;
//membership
case 4:
if(placeholder.getMemberStatus() == true){
placeholder.setMemberStatus(false);
System.out.println("Setting membership to Passive..");
} else {
placeholder.setMemberStatus(true);
System.out.println("Setting membership to Active..");
}
break;
}
}
}
}
private void deleteMember(Member placeholder){
if(placeholder != null){
String delete = "Do you want to delete " + placeholder.getName() + " (y/n)?";
if(input.getLine(delete).toLowerCase().contains("y")){
int[] location = db.findMember(placeholder.getName());
if(location[0] == 0){
db.deleteMember(location[1]);
} else if (location[0] == 1){
db.deleteCompetitiveSwimmer(location[1]);
}
}
}
}
private void addPerformance(){
String location = null;
String dicipline = null;
System.out.println("Adding performance.");
String[] options = {"Choose a Swimtype", "Crawl", "Butterfly"};
long time = 0;
printOptions(options);
switch(input.getInt()){
case 0:
break;
case 1:
dicipline = "Crawl";
break;
case 2:
dicipline = "Butterfly";
break;
default:
break;
}
if(dicipline != null){
location = input.getLine("Location");
time = input.getLong("Time in seconds");
CompetitiveSwimmer placeholder = null;
while(placeholder == null){
placeholder = chooseCompetitiveSwimmer("add the performance to");
if(placeholder == null){
if(input.getLine("Not a member, try again?").toLowerCase().contains("n")){
break;
}
} else {
placeholder.addPerformance(location, time, dicipline);
long sec = time%60;
long min = time/60;
System.out.println(dicipline + " performance: "+ min + ":" + sec +" in " + location + " added to " + placeholder.getName() + "'s records.");
}
}
}
}
// Choose menus -------------
private Boolean chooseSwimType(String name, int age, String residence){
String[] options = {"What kind of swimmer?", "Exercise", "Competitive", "Exercise not payed", "Competitive not payed"};
printOptions(options);
int selection = input.getInt();
if(selection == 1){
db.addMember(name, age, residence);
return true;
} else if ( selection == 2){
db.addCompetitiveSwimmer(name, age, residence);
return true;
} else if ( selection == 3){
db.addMember(name, age, residence, false);
return true;
} else if ( selection == 4){
db.addCompetitiveSwimmer(name, age, residence, false);
return true;
} else if (selection == 0) {
System.out.println("Exiting, no member added.");
return true;
} else {
System.out.println("No member added, try again.");
return false;
}
}
private Member chooseMember(String actionToDo){
System.out.println("What member would you like to " + actionToDo + "?");
int[] memberIndex = db.findMember(input.getLine("Name"));
Member placeholder = null;
if(memberIndex[0] == 0){
placeholder = db.getMember(memberIndex[1]);
} else if (memberIndex[0] == 1){
placeholder = db.getCompetitiveSwimmer(memberIndex[1]);
} else if (memberIndex[0] == -1){
System.out.println("Member not found");
}
return placeholder;
}
private CompetitiveSwimmer chooseCompetitiveSwimmer(String actionToDo){
System.out.println("What member would you like to " + actionToDo + "?");
int[] memberIndex = db.findMember(input.getLine("Name"));
CompetitiveSwimmer placeholder = null;
if(memberIndex[0] == 0){
System.out.println("Not a competitive swimmer");
} else if (memberIndex[0] == 1){
placeholder = db.getCompetitiveSwimmer(memberIndex[1]);
} else if (memberIndex[0] == -1){
System.out.println("Member not found");
}
return placeholder;
}
private int chooseProperty(String name, int age, String residence, Boolean membership){
String membershipTitle = "Passive";
if(membership){
membershipTitle = "Active";
}
String[] options = {"What would you like to edit?",
"Name: " + name,
"Age: " + age,
"Residence: " + residence,
"Membership status (Active/Passive): " + membershipTitle};
printOptions(options);
return input.getInt();
}
} | [
"jonas@holm.tech"
] | jonas@holm.tech |
f9613fe3b516189d590c97765442ef95a5bba9cb | 8368f1929c9ab9d0a5a57de2cc9173fc8fa0919e | /src/com/ymj/pattern/code03_prototype/simple/Client.java | 6fcc43aeda6c0e9499969dea24556d08fe798940 | [] | no_license | Asurazzz/DesignPattern | 74f8b5bb019b8384d10eb13d32dac6ce887555ad | fd7939f05921993f6a1e9028b049b899c056edd2 | refs/heads/main | 2021-07-21T21:15:57.696214 | 2021-06-17T03:34:04 | 2021-06-17T03:34:04 | 251,341,520 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package com.ymj.pattern.code03_prototype.simple;
/**
* @Classname Client
* @Description TODO
* @Date 2021/6/8 16:15
* @Created by yemingjie
*/
public class Client {
private Prototype prototype;
public Client(Prototype prototype) {
this.prototype = prototype;
}
public Prototype startClone(Prototype concretPrototype) {
return (Prototype) concretPrototype.clone();
}
}
| [
"2513667783@qq.com"
] | 2513667783@qq.com |
f07962e6331d1e2b74cce8453f9f384a16c6a765 | 5f53b1ea0bbb537188aa6110db524bc7f1926def | /header/src/main/java/org/zstack/header/host/TakeSnapshotOnHypervisorMsg.java | 292afb46540ac0f4848b2c74d72207664b8cc6d4 | [
"Apache-2.0"
] | permissive | dangpf/zstack | 86293e2a5b479cf70c96a903c90523f29e41fd22 | 8db5d96d06f961d366c67c16394f4e4572c02115 | refs/heads/master | 2021-01-18T13:06:11.080079 | 2016-09-01T09:57:37 | 2016-09-01T09:58:40 | 56,648,736 | 1 | 0 | null | 2016-04-20T02:28:56 | 2016-04-20T02:28:55 | null | UTF-8 | Java | false | false | 1,645 | java | package org.zstack.header.host;
import org.zstack.header.core.ApiTimeout;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.volume.APICreateVolumeSnapshotMsg;
import org.zstack.header.volume.VolumeInventory;
@ApiTimeout(apiClasses = {APICreateVolumeSnapshotMsg.class})
public class TakeSnapshotOnHypervisorMsg extends NeedReplyMessage implements HostMessage {
private String hostUuid;
private String vmUuid;
private String snapshotName;
private VolumeInventory volume;
private String installPath;
private boolean fullSnapshot;
public boolean isFullSnapshot() {
return fullSnapshot;
}
public void setFullSnapshot(boolean fullSnapshot) {
this.fullSnapshot = fullSnapshot;
}
public String getSnapshotName() {
return snapshotName;
}
public void setSnapshotName(String snapshotName) {
this.snapshotName = snapshotName;
}
@Override
public String getHostUuid() {
return hostUuid;
}
public void setHostUuid(String hostUuid) {
this.hostUuid = hostUuid;
}
public String getVmUuid() {
return vmUuid;
}
public void setVmUuid(String vmUuid) {
this.vmUuid = vmUuid;
}
public VolumeInventory getVolume() {
return volume;
}
public void setVolume(VolumeInventory volume) {
this.volume = volume;
}
public String getInstallPath() {
return installPath;
}
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
}
| [
"xing5820@gmail.com"
] | xing5820@gmail.com |
b4507f7f9a4d9476be1e2fddd2b9d2279430ac98 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a289/A289751.java | 10d639f2572cfa14b38a2fb227ae74d75b2b15b6 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package irvine.oeis.a289;
// Generated by gen_seq4.pl pfprime 0 4 10 +137 3 at 2019-07-30 14:36
// DO NOT EDIT here!
import irvine.oeis.PowerFactorPrimeSequence;
/**
* A289751 Numbers k such that <code>(4*10^k + 137)/3</code> is prime.
* @author Georg Fischer
*/
public class A289751 extends PowerFactorPrimeSequence {
/** Construct the sequence. */
public A289751() {
super(1, 0, 4, 10, +137, 3);
}
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
312de9b48c1b9dd7b0e22cd0eed2fb978ea25033 | 5643e2dc3946ffb490ac8d9f9e5e27c386656f46 | /app/src/main/java/android/luna/ViewUi/bottombar/OnTabReselectListener.java | ba37e0dae8a2eb487f28856b1b76d4e3ea01b152 | [] | no_license | cremlee/App | c22402df07a3e4ec483eed4ee3575cafd8899b69 | 454d5d43b27328282d18ffb6a66026dd0f0eeddc | refs/heads/master | 2021-06-24T16:43:23.337350 | 2018-08-10T00:09:53 | 2018-08-10T00:09:53 | 143,685,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package android.luna.ViewUi.bottombar;
import android.support.annotation.IdRes;
/*
* BottomBar library for Android
* Copyright (c) 2016 Iiro Krankka (http://github.com/roughike).
*
* 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.
*/
public interface OnTabReselectListener {
/**
* The method being called when currently visible {@link BottomBarTab} is
* reselected. Use this method for scrolling to the top of your content,
* as recommended by the Material Design spec
*
* @param tabId the {@link BottomBarTab} that was reselected.
*/
void onTabReSelected(@IdRes int tabId);
}
| [
"hhjtlee@163.com"
] | hhjtlee@163.com |
8c7c23f851dd71f2be2a221c9e1338144af3b45e | d89d1a5b6e7261412fdf3bd36cc8e24f242ef9d6 | /src/main/java/pl/edu/agh/dropper/proxy/Proxy.java | 06d7e9b565128336d3cc13fdceefc2484a68e0d1 | [] | no_license | fracz/dropper | db1a2533551db9baebef90f581599b896d5afff2 | e82d886e26803cb31d63b2a0ff14396ae552cac4 | refs/heads/master | 2021-01-01T17:21:55.844224 | 2014-01-19T21:17:34 | 2014-01-19T21:17:34 | 13,921,527 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,535 | java | package pl.edu.agh.dropper.proxy;
import java.net.InetAddress;
public interface Proxy {
/**
* Receive next packet sent to the monitored application. This methods MUST be synchronous.
*
* @return packet data that was received from monitored application
*/
Packet receiveSource();
/**
* Receives next packet sent from the destination machine to the monitored application (destination response).
* This methods MUST be synchronous.
*
* @return packet data that was received from destination machine
*/
Packet receiveDestination();
/**
* Sends the given packet to the monitored application.
*
* @param packet packet to send
*/
void sendSource(Packet packet);
/**
* Sends the given packet to the destination address.
*
* @param packet packet to send
*/
void sendDestination(Packet packet);
/**
* Sets the local port to listen.
*
* @param port port to listen for incoming data
*/
void setSourcePort(int port);
/**
* Sets the remote port where the data should be forwarded.
*
* @param port port where the incoming data should be forwarded
*/
void setDestinationPort(int port);
/**
* Sets the remote address where the data should be forwarded.
*
* @param address address where the incoming data should be forwarded
*/
void setDestinationAddress(InetAddress address);
/**
* Starts the proxy.
*/
void startProxy();
}
| [
"wojciech@fracz.pl"
] | wojciech@fracz.pl |
9e63b88ea091f6d5c6eda7272e8e29f142746403 | 8238ff3c0385616190f2f975a30f6e912708468f | /src/main/java/dbstructure/CommonAllTablesDump/dto/IndexDTO.java | 770ef07aaf9ca6deff9a3d6c915d2e60274efaba | [] | no_license | kpavn/DBStructureDump | 31601a583656f558abb91d59be77b1ffa2704a04 | 50d10ee3ee2cc3a99277debb3a35439b1d2435d3 | refs/heads/master | 2020-05-30T14:02:58.976069 | 2013-06-02T09:39:31 | 2013-06-02T09:39:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,212 | java | package dbstructure.CommonAllTablesDump.dto;
import java.util.ArrayList;
import java.util.List;
public final class IndexDTO {
public IndexDTO(final String strIndexName, boolean boolIsPrimaryKey, boolean boolIsUnique, boolean boolIsClustered) {
this.strIndexName = strIndexName;
this.boolIsPrimaryKey = boolIsPrimaryKey;
this.boolIsUnique = boolIsUnique;
this.boolIsClustered = boolIsClustered;
this.columnList = new ArrayList<IndexColumnDTO>();
if (this.boolIsPrimaryKey) {
this.boolIsUnique = true;
}
}
/*
* Add
*/
public void addColumn(final IndexColumnDTO indexColumnDTO) {
columnList.add(indexColumnDTO);
}
/*
* Get
*/
public String getIndexName() {
return strIndexName;
}
public boolean isClustered() {
return boolIsClustered;
}
public boolean isPrimaryKey() {
return boolIsPrimaryKey;
}
public boolean isUnique() {
return boolIsUnique;
}
public List<IndexColumnDTO> getColumnList() {
return columnList;
}
private String strIndexName;
private boolean boolIsPrimaryKey;
private boolean boolIsUnique;
private boolean boolIsClustered;
private List<IndexColumnDTO> columnList;
}
| [
"kpavn@yandex.ru"
] | kpavn@yandex.ru |
0d462ae8235014b9c936c286913a67e19de43e6c | 498dd2daff74247c83a698135e4fe728de93585a | /clients/google-api-services-vision/v1p1beta1/1.30.1/com/google/api/services/vision/v1p1beta1/model/AsyncAnnotateFileResponse.java | 77156c741cca2be1a98e5f7190cf0cc42757b1cc | [
"Apache-2.0"
] | permissive | googleapis/google-api-java-client-services | 0e2d474988d9b692c2404d444c248ea57b1f453d | eb359dd2ad555431c5bc7deaeafca11af08eee43 | refs/heads/main | 2023-08-23T00:17:30.601626 | 2023-08-20T02:16:12 | 2023-08-20T02:16:12 | 147,399,159 | 545 | 390 | Apache-2.0 | 2023-09-14T02:14:14 | 2018-09-04T19:11:33 | null | UTF-8 | Java | false | false | 2,297 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.vision.v1p1beta1.model;
/**
* The response for a single offline file annotation request.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Vision API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class AsyncAnnotateFileResponse extends com.google.api.client.json.GenericJson {
/**
* The output location and metadata from AsyncAnnotateFileRequest.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private OutputConfig outputConfig;
/**
* The output location and metadata from AsyncAnnotateFileRequest.
* @return value or {@code null} for none
*/
public OutputConfig getOutputConfig() {
return outputConfig;
}
/**
* The output location and metadata from AsyncAnnotateFileRequest.
* @param outputConfig outputConfig or {@code null} for none
*/
public AsyncAnnotateFileResponse setOutputConfig(OutputConfig outputConfig) {
this.outputConfig = outputConfig;
return this;
}
@Override
public AsyncAnnotateFileResponse set(String fieldName, Object value) {
return (AsyncAnnotateFileResponse) super.set(fieldName, value);
}
@Override
public AsyncAnnotateFileResponse clone() {
return (AsyncAnnotateFileResponse) super.clone();
}
}
| [
"chingor@google.com"
] | chingor@google.com |
d789a786360700d3020e2c9503ecb3a992fd2547 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/GetMasterAccountResult.java | 85ad18c11b97882aa2424182b8b065c86ba61fda | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 4,108 | java | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetMasterAccount" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetMasterAccountResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* <p>
* A list of details about the Security Hub administrator account for the current member account.
* </p>
*/
private Invitation master;
/**
* <p>
* A list of details about the Security Hub administrator account for the current member account.
* </p>
*
* @param master
* A list of details about the Security Hub administrator account for the current member account.
*/
public void setMaster(Invitation master) {
this.master = master;
}
/**
* <p>
* A list of details about the Security Hub administrator account for the current member account.
* </p>
*
* @return A list of details about the Security Hub administrator account for the current member account.
*/
public Invitation getMaster() {
return this.master;
}
/**
* <p>
* A list of details about the Security Hub administrator account for the current member account.
* </p>
*
* @param master
* A list of details about the Security Hub administrator account for the current member account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetMasterAccountResult withMaster(Invitation master) {
setMaster(master);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getMaster() != null)
sb.append("Master: ").append(getMaster());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetMasterAccountResult == false)
return false;
GetMasterAccountResult other = (GetMasterAccountResult) obj;
if (other.getMaster() == null ^ this.getMaster() == null)
return false;
if (other.getMaster() != null && other.getMaster().equals(this.getMaster()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMaster() == null) ? 0 : getMaster().hashCode());
return hashCode;
}
@Override
public GetMasterAccountResult clone() {
try {
return (GetMasterAccountResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
0bcb1ea447c27eda0a20f715e88ff380141f0f4b | 830c03ca274a8f069109d9a48d13e0e646ef3ab8 | /SpringMvcDemo/src/com/zdcf/tool/Aes.java | 9cdcb50b8654d78d401ba4d159ea33d7d3b89e40 | [] | no_license | huangleisir/albert | ba8e176d2cca66e0d611f28d36402f97d6762068 | d8738b7f41a00ae1f6af672b4eff95f078e24ad5 | refs/heads/master | 2020-12-02T06:28:37.858912 | 2017-07-10T15:32:10 | 2017-07-10T15:32:10 | 96,840,911 | 1 | 0 | null | 2017-07-11T02:18:08 | 2017-07-11T02:18:08 | null | UTF-8 | Java | false | false | 1,838 | java | package com.zdcf.tool;
import java.security.Key;
import java.security.MessageDigest;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
/**
* aes加密算法
* @author 图灵机器人
*
*/
public class Aes {
private Key key;
/**
* AES CBC模式使用的Initialization Vector
*/
private IvParameterSpec iv;
/**
* Cipher 物件
*/
private Cipher cipher;
/**
* 构造方法
* @param strKet
* 密钥
*/
public Aes(String strKey) {
try {
this.key = new SecretKeySpec(getHash("MD5", strKey), "AES");
this.iv = new IvParameterSpec(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 });
this.cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
} catch (final Exception ex) {
throw new RuntimeException(ex.getMessage());
}
}
/**
* 加密方法
*
* 说明:采用128位
*
* @return 加密结果
*/
public String encrypt(String strContent) {
try {
byte[] data = strContent.getBytes("UTF-8");
cipher.init(Cipher.ENCRYPT_MODE, key, iv);
byte[] encryptData = cipher.doFinal(data);
String encryptResult = new String(Base64.encodeBase64(
encryptData), "UTF-8");
return encryptResult;
} catch (Exception ex) {
throw new RuntimeException(ex.getMessage());
}
}
/**
*
* @param algorithm
* @param text
* @return
*/
private static byte[] getHash(String algorithm, String text) {
try {
byte[] bytes = text.getBytes("UTF-8");
final MessageDigest digest = MessageDigest.getInstance(algorithm);
digest.update(bytes);
return digest.digest();
} catch (final Exception ex) {
throw new RuntimeException(ex.getMessage());
}
}
}
| [
"pospospos2007@gmail.com"
] | pospospos2007@gmail.com |
c5f0bda02cdf36e157d4160c176e3268a0923a98 | e67dddc05c8b7c143a35aad37c2ca88ca5aa3637 | /笔试/src/wangwei/t2/Test.java | 41337d13985c39d0a53b8f0feddc4938a145dbee | [] | no_license | Linliquan/java-learn | 886ff104e64b38982d7083a116b399bed847b717 | 4ff318715d9d89c55d93fa230d52115f09e58559 | refs/heads/master | 2022-07-04T07:23:15.042731 | 2021-08-07T09:55:37 | 2021-08-07T09:55:37 | 182,282,157 | 4 | 0 | null | 2022-06-21T04:15:10 | 2019-04-19T15:03:39 | Java | UTF-8 | Java | false | false | 2,535 | java | package wangwei.t2;
import java.util.*;
import java.math.*;
public class Test{
static int maxn=(int)(100+10);
static int n,m;
static BigInteger MOD =new BigInteger("100000");
static String INF="";
static BigInteger[][] map=new BigInteger[maxn][maxn];
static BigInteger base=new BigInteger("2");
static void init() {
for(int i=0;i<=n;i++) {
for(int j=0;j<=n;j++) {
if(i!=j)
map[i][j]=new BigInteger(INF);
else
map[i][j]=new BigInteger("0");
}
}
}
static BigInteger[] dis=new BigInteger[maxn];
static boolean[] vis =new boolean[maxn];
static void dijkstra(int start) {
for(int i=0;i<n;i++) {
dis[i]=map[start][i];
vis[i]=false;
}
dis[start]=new BigInteger("0");
vis[start]=true;
for(int i=0;i<n-1;i++) {
int k=-1;
BigInteger minD=new BigInteger(INF);
for(int j=0;j<n;j++) {
if(!vis[j]&&dis[j].compareTo(minD)<0) {
minD=dis[j];
k=j;
}
}
if(k==-1) break;
vis[k]=true;
for(int j=0;j<n;j++) {
if(!vis[j]&&dis[j].compareTo(dis[k].add(map[k][j]))>0)
dis[j]=dis[k].add(map[k][j]);
}
}
}
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
for(int i=0;i<=160;i++)
INF+="9";
while(cin.hasNext()) {
n=cin.nextInt();
m=cin.nextInt();
init();
for(int k=0;k<m;k++) {
int u=cin.nextInt();
int v=cin.nextInt();
if(!map[u][v].toString().equals(INF)) continue;
map[u][v]=map[v][u]=new BigInteger( base.pow(k).toString());
}
dijkstra(0);
for(int i=1;i<n;i++) {
BigInteger d=dis[i];
if(d.toString().equals(INF))
System.out.println("-1");
else
System.out.println(d.mod(MOD));
}
}
cin.close();
}
}
//import java.util.Scanner;
//
//public class Test {
// public static void main(String[] args) {
// Scanner sc = new Scanner(System.in);
//
// int [] a = new int[36];
// for(int i = 0; i < 36; i++){
// a[i] = sc.nextInt();
// }
//
// }
//}
| [
"1511387837@qq.com"
] | 1511387837@qq.com |
da2f70467bf53f9ccfcac5f9f4f1b5f988b4465b | 712453a48b3ac198460d7143fec3d1e7abf812c2 | /api-gateway/src/main/java/eu/opertusmundi/web/config/OAuthUserInfoDetailResolver.java | b7d826384ea5432e7608e22a7bc6a09a39e2b883 | [
"Apache-2.0"
] | permissive | OpertusMundi/api-gateway-interim | 1c2cdde9f684042c4e69bdfb23474b791520a30b | 6d95a5ac01e30f7bf431c31db2ffc6d790dab081 | refs/heads/master | 2023-02-17T06:07:16.964937 | 2021-01-15T12:08:01 | 2021-01-15T12:08:01 | 302,048,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,109 | java | package eu.opertusmundi.web.config;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConfigurationProperties(prefix = "opertus-mundi.auth")
public class OAuthUserInfoDetailResolver {
private List<String> nameAliases;
private List<String> emailAliases;
private List<String> localeAliases;
private List<String> imageAliases;
public static final String NAME_PROPERTY = "name";
public static final String EMAIL_PROPERTY = "email";
public static final String LOCALE_PROPERTY = "locale";
public static final String IMAGE_PROPERTY = "image";
public List<String> getNameAliases() {
return this.nameAliases;
}
public void setNameAliases(List<String> nameAliases) {
this.nameAliases = nameAliases;
}
public List<String> getEmailAliases() {
return this.emailAliases;
}
public void setEmailAliases(List<String> emailAliases) {
this.emailAliases = emailAliases;
}
public List<String> getLocaleAliases() {
return this.localeAliases;
}
public void setLocaleAliases(List<String> localeAliases) {
this.localeAliases = localeAliases;
}
public List<String> getImageAliases() {
return this.imageAliases;
}
public void setImageAliases(List<String> imageAliases) {
this.imageAliases = imageAliases;
}
public String resolve(String key) {
if (this.nameAliases.stream().anyMatch(alias -> key.trim().equals(alias))) {
return NAME_PROPERTY;
}
if (this.emailAliases.stream().anyMatch(alias -> key.trim().equals(alias))) {
return EMAIL_PROPERTY;
}
if (this.localeAliases.stream().anyMatch(alias -> key.trim().equals(alias))) {
return LOCALE_PROPERTY;
}
if (this.imageAliases.stream().anyMatch(alias -> key.trim().equals(alias))) {
return IMAGE_PROPERTY;
}
return null;
}
}
| [
"yannis.kouvaras@kupa.gr"
] | yannis.kouvaras@kupa.gr |
91bf43d75c989f9c918da6fc467186d4e94ce48e | 2753ab85dca8541eaeebc9c763da69d48285fda4 | /Car Decision/CarCostCalculation.java | 5801d767b2978cef60f3142c82423b337f5f109e | [] | no_license | Ali17560/CS175-01L | a772de65a89c02fb2fc4544e5089c3ebb247da41 | e8dcb5afb99caad5cf87b421811a1ec2da1d8bb7 | refs/heads/master | 2022-04-30T16:14:24.769722 | 2022-03-25T02:38:20 | 2022-03-25T02:38:20 | 238,813,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,475 | java | import java.util.Scanner;
public class CarCostCalculation {
public static void main(String[] args) {
// TODO Auto-generated method stub
//Inputs
Scanner scan=new Scanner(System.in);
System.out.print("Enter the cost of a regular car: ");
double regularCarCost=scan.nextDouble();
System.out.print("Enter the miles per gallon of a regular car: ");
double regularGallonMiles=scan.nextDouble();
System.out.print("Enter the cost of a hybrid car: ");
double hybridCarCost=scan.nextDouble();
System.out.print("Enter the miles per gallon of a hybrid car: ");;
double hybridGallonMiles=scan.nextDouble();
System.out.print("Enter the miles traveled in a year: ");
double travelMiles=scan.nextDouble();
System.out.print("Enter the cost per gallon of gas: ");
double costPerGallon=scan.nextDouble();
//Computations
double yearOne=regularCarCost+(travelMiles/regularGallonMiles)*2.5;
System.out.println("Cost to own after Year 1 for regular car: "+yearOne);
double yearOne1=hybridCarCost+(travelMiles/hybridGallonMiles)*2.5;
System.out.println("Cost to own after Year 1 for hybrid car: "+yearOne1);
double yearTwo=regularCarCost+(travelMiles*(2)/regularGallonMiles)*2.5;
System.out.println("Cost to own after Year 2 for regular car: "+yearTwo);
double yearTwo2=hybridCarCost+(travelMiles*(2)/hybridGallonMiles)*2.5;
System.out.println("Cost to own after Year 2 for hybrid car: "+yearTwo2);
double yearThree=regularCarCost+(travelMiles*(3)/regularGallonMiles)*2.5;
System.out.println("Cost to own after Year 3 for regular car: "+yearThree);
double yearThree3=hybridCarCost+(travelMiles*(3)/hybridGallonMiles)*2.5;
System.out.println("Cost to own after Year 3 for hybrid car: "+yearThree3);
double yearFour=regularCarCost+(travelMiles*(4)/regularGallonMiles)*2.5;
System.out.println("Cost to own after Year 4 for regular car: "+yearFour);
double yearFour4=hybridCarCost+(travelMiles*(4)/hybridGallonMiles)*2.5;
System.out.println("Cost to own after Year 4 for hybrid car: "+yearFour4);
double yearFive=regularCarCost+(travelMiles*(5)/regularGallonMiles)*2.5;
System.out.println("Cost to own after Year 5 for regular car: "+yearFive);
double yearFive5=hybridCarCost+(travelMiles*(5)/hybridGallonMiles)*2.5;
System.out.println("Cost to own after Year 5 for hybrid car: "+yearFive5);
System.out.println("The hybrid car pays back after 5 years");
}
}
| [
"55414347+Ali17560@users.noreply.github.com"
] | 55414347+Ali17560@users.noreply.github.com |
3eb6b47c6a034027a2cd6f4e996a2501e4796875 | cec95e3cdba980d7d000fe5229cad02305605ff9 | /SplitCalculator/src/ArrayCalculator.java | ddea7d074f72cca93e0b800ea87bd103c967a847 | [] | no_license | Kimhyungwoo1/Java | 988d2d4f20489640c0551f1ae29e2fe93a7bfdd2 | e382293ed63eb170fdb1b0fbd07e2ad8f7acbe8c | refs/heads/master | 2021-01-11T19:48:15.111447 | 2017-02-17T07:13:17 | 2017-02-17T07:13:17 | 79,401,237 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 158 | java |
public class ArrayCalculator {
void calculator(int[] points) {
int resulte = points[0] + points[1] + points[2];
System.out.println(resulte);
}
}
| [
"dicjqdlwld@gmail.com"
] | dicjqdlwld@gmail.com |
4b53da592efb7c3b452132b07f1df5595bc11623 | 1e7e6102354bcb0bccd511c4175c08e118fb8d27 | /lind-rs/src/main/java/de/egatlovs/lind/components/structure/entity/constraint/CheckValidRegex.java | e8f3ef53cc1d620f7c8a209071a1189a56c6c70b | [] | no_license | EgatlovS/lind | c63834e9f8a00f0eab7e04e3ac90d414ebc9956b | 6ae538f28ae40251534a5f8b619610e0a04dd42d | refs/heads/master | 2021-06-21T11:08:31.046616 | 2017-08-12T23:43:36 | 2017-08-12T23:43:36 | 95,186,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package de.egatlovs.lind.components.structure.entity.constraint;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class CheckValidRegex implements ConstraintValidator<ValidRegex, String> {
@Override
public void initialize(ValidRegex constraintAnnotation) {
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
try {
Pattern.compile(value);
return true;
} catch (PatternSyntaxException e) {
return false;
}
}
}
| [
"alex.bogner36@googlemail.com"
] | alex.bogner36@googlemail.com |
ef21984d7b67fdbdb457ab1505b6fac65ce6aa51 | c37890750e1cf8db3112efb61596b2c35eeeed6a | /src/main/java/Payments/CardPayment.java | b2d5d6da3d465e23f75d118cde0300fd12a8e009 | [] | no_license | catrionameriel/Venue_ticketing_system | 0ee71408ff525047000d883db029214eae213ca9 | 8616c54b16031e6f9b907e5a4102f63fc11daa04 | refs/heads/master | 2021-05-14T02:27:00.251770 | 2018-01-26T15:35:29 | 2018-01-26T15:35:29 | 116,594,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | package Payments;
public abstract class CardPayment extends PaymentMethod {
private String nameOnCard;
private long cardNumber;
protected CardPayment(String paymentName, double availableFunds, String name, long cardNumber) {
super(paymentName, availableFunds);
nameOnCard = name;
this.cardNumber = cardNumber;
}
public String getNameOnCard(){
return nameOnCard;
}
public long getCardNumber(){
return this.cardNumber;
}
}
| [
"catriona.meriel@gmail.com"
] | catriona.meriel@gmail.com |
388f8e18408f963beac127bc9af68cc447be0f81 | 4b4cf0417fe981f6ee07386eac7e5500c39745ad | /core/src/main/java/org/kobjects/android64/MemoryListener.java | f1a4632eb335810569506dd4ddb0748e996affb8 | [] | no_license | stefanhaustein/android64 | 2a9498beb9f26be4fe4e39d6ce9ac1ed9eee7a02 | f88d1142d764e34d2ab8a07d7cc2ae04fd7752e8 | refs/heads/master | 2023-09-02T09:22:34.693110 | 2019-12-20T12:34:18 | 2019-12-20T12:34:18 | 203,216,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 107 | java | package org.kobjects.android64;
public interface MemoryListener {
void set(int address, int value);
}
| [
"stefan.haustein@gmail.com"
] | stefan.haustein@gmail.com |
fd26c90b5eeb9e944b8f7e4e2e7b0169968ae161 | b79d189fc142f49adc1c34dd9a72bb82926a5a87 | /AcademicoJSF/src/main/java/pe/edu/upeu/ServletInitializer.java | b2194cab3caadee4861d12c343afde39b1af3398 | [] | no_license | davidmp/ProyectJavaArquitecturas | c749fba1bf184167f328d60a2638f2123d805212 | 8c780af50c9930973f870e290674c0cfac110790 | refs/heads/master | 2020-03-26T21:55:08.801988 | 2018-11-21T17:12:08 | 2018-11-21T17:12:08 | 145,417,711 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,057 | java | package pe.edu.upeu;
import java.util.Collections;
import javax.faces.application.ProjectStage;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.primefaces.util.Constants;
import org.springframework.beans.factory.config.CustomScopeConfigurer;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.faces.mvc.JsfView;
//import org.springframework.web.servlet.view.UrlBasedViewResolver;
@Configuration
@EnableAutoConfiguration //(exclude = { JpaConfig.class })
@ComponentScan
@SpringBootApplication
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(AcademicoJsfApplication.class);
}
@Bean
public static CustomScopeConfigurer customScopeConfigurer() {
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.setScopes(Collections.<String, Object>singletonMap(FacesViewScope.NAME, new FacesViewScope()));
return configurer;
}
@Bean
public ServletContextInitializer servletContextCustomizer() {
return new ServletContextInitializer() {
@Override
public void onStartup(ServletContext sc) throws ServletException {
sc.setInitParameter(Constants.ContextParams.THEME, "start");
sc.setInitParameter(Constants.ContextParams.FONT_AWESOME, "true");
sc.setInitParameter(ProjectStage.PROJECT_STAGE_PARAM_NAME, ProjectStage.Development.name());
}
};
}
// @Bean
// public UrlBasedViewResolver setupViewResolver() {
// UrlBasedViewResolver resolver = new UrlBasedViewResolver();
// resolver.setViewClass(JsfView.class);
// resolver.setPrefix("/WEB-INF/modulos/");
// resolver.setSuffix(".xhtml");
//
// return resolver;
// }
@Bean
public MessageSource messageSourceOther() {
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
messageSource.setBasename("messages");
return messageSource;
}
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("/webjars/");
}
}
| [
"mamanipari@gmail.com"
] | mamanipari@gmail.com |
0f3b97a4de5efab0ac3e7915cf53c21019fb9560 | 5acd479fe5aea91e37be83b369915a7eeab5c255 | /src/main/java/com/rahul/Exercise20Aug/Tshirt.java | 62822eb3e5a383a6e7cf394814a39c8cde103da3 | [] | no_license | reclonerk/TestProject | 818019c25ee80050d7667d2ba81a0fce7afac08b | e2fb11cdaa442b219fb496f70229682d47c7055a | refs/heads/master | 2023-07-05T15:12:56.754691 | 2021-08-20T09:16:38 | 2021-08-20T09:16:38 | 398,192,781 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package com.rahul.Exercise20Aug;
public class Tshirt {
private String type;
private int quantity = 10;
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
| [
"rkauraiya1167@gmail.com"
] | rkauraiya1167@gmail.com |
325c75c0f048b42d69bfe0b6a437cfef63659095 | 61af5071032b1cbd47e2898ac8351d8cf9a82edd | /appeon.aje.web.engine/src/appeon/aje/webengine/EngineerBuilder.java | 63300ac59eaf515fec35b261bb5fcbeb4551ec66 | [] | no_license | delez/ssh_scaffold | f181b2dd116219753df671d65abd3ea3859fd6c2 | 4314f1c7ef6f3616e7368d1fc198123d787d4697 | refs/heads/master | 2020-04-12T17:50:44.094489 | 2013-01-16T14:28:32 | 2013-01-16T14:28:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,047 | java | /**
*
*/
package appeon.aje.webengine;
import java.io.IOException;
import java.io.Writer;
import java.util.Properties;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
/**
*
*/
public class EngineerBuilder {
private Context context;
public EngineerBuilder(Context ctx) throws EngineException {
this.context = ctx;
try {
Properties properties = new Properties();
properties.load(EngineerBuilder.class.getResourceAsStream("/velocity.properties"));
Velocity.init(properties);//
} catch (Exception e) {
throw new EngineException(e);
}
}
/**
*
* @param writer
* @param templateFile
* @param model
* @throws EngineException
*/
public void out(Writer writer, String templateFile, Object model)
throws EngineException {
out(writer, templateFile, "model", model);
}
/**
*
* @param writer
* @param templateFile
* @param model
* @throws EngineException
*/
public void out(Writer writer, String templateFile, String name, Object model)
throws EngineException {
VelocityContext vc = new VelocityContext();
vc.put(name, model);
vc.put("context", context);
out(writer, templateFile, vc);
}
/**
*
* @param writer
* @param templateFile
* @param model
* @throws EngineException
*/
public void out(Writer writer, String templateFile, Object model, Sapper sapper)
throws EngineException {
VelocityContext vc = new VelocityContext();
vc.put("model", model);
vc.put("sapper", sapper);
vc.put("context", context);
out(writer, templateFile, vc);
}
public static void out(Writer writer, String templateFile, Properties props){
out(writer, templateFile, new VelocityContext(props));
}
/**
*
* @param writer
* @param templateFile
* @param context
* @throws EngineException
*/
public static void out(Writer writer, String templateFile, VelocityContext context)
throws EngineException {
Template template = null;
try {
template = Velocity.getTemplate(templateFile);
if (template != null)
template.merge(context, writer);
} catch (ResourceNotFoundException rnfe) {
throw new EngineException("error : cannot find template "
+ templateFile + " : " + rnfe);
} catch (ParseErrorException pee) {
throw new EngineException("Syntax error in template "
+ templateFile + ":" + pee);
} catch (MethodInvocationException e) {
throw new EngineException(e);
} catch (Exception e) {
throw new EngineException(e);
}
/*
* flush and cleanup
*/
try {
writer.flush();
} catch (IOException e) {
throw new EngineException("close writer error", e);
}
}
}
| [
"dele.zheng@gmail.com"
] | dele.zheng@gmail.com |
b46317b8f98cd6aba573b0b93bead32ccf4c4e4a | cd647ca576bebe09ac13584d6c8b8008d4ea1523 | /app/src/main/java/com/example/admatic_51/emptytemplate/Activity/Screen7.java | 51588cc48f32c9297dacd9137a87b260d944cfec | [] | no_license | sabarna1604/AutomationDemo | e792199abe37c5b8c6afc909ea029a67e249160e | f0bbad275bca22eb5af3e92c759514dd35fb2b4c | refs/heads/master | 2021-09-10T12:15:32.379220 | 2018-03-26T05:42:21 | 2018-03-26T05:42:21 | 113,031,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.example.admatic_51.emptytemplate.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.admatic_51.emptytemplate.R;
/**
* Created by Admatic-51 on 29-11-2017.
*/
public class Screen7 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen7);
}
}
| [
"sabarnasubramani@gmail.com"
] | sabarnasubramani@gmail.com |
bb546de612ae8338a066695a15431d66987e68a8 | 4550f69306fe18febc0dddf54bbfebfd438a6956 | /src/main/java/fr/ippon/myinvoice/web/filter/gzip/GZipServletFilter.java | 69a1555323635f923178aa69b787f49bc9872cc1 | [] | no_license | BulkSecurityGeneratorProject/sample-cassandra-multi-criteria | 569519427b5693a4a170fb97b602eefa404c4c9f | 57c80bc43d460a2d3a66deb1dd7638eb3803dafb | refs/heads/master | 2022-12-21T00:00:17.813296 | 2015-06-01T16:03:10 | 2015-06-01T16:03:10 | 296,565,024 | 0 | 0 | null | 2020-09-18T08:44:11 | 2020-09-18T08:44:10 | null | UTF-8 | Java | false | false | 4,349 | java | package fr.ippon.myinvoice.web.filter.gzip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.GZIPOutputStream;
public class GZipServletFilter implements Filter {
private Logger log = LoggerFactory.getLogger(GZipServletFilter.class);
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// Nothing to initialize
}
@Override
public void destroy() {
// Nothing to destroy
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
if (!isIncluded(httpRequest) && acceptsGZipEncoding(httpRequest) && !response.isCommitted()) {
// Client accepts zipped content
if (log.isTraceEnabled()) {
log.trace("{} Written with gzip compression", httpRequest.getRequestURL());
}
// Create a gzip stream
final ByteArrayOutputStream compressed = new ByteArrayOutputStream();
final GZIPOutputStream gzout = new GZIPOutputStream(compressed);
// Handle the request
final GZipServletResponseWrapper wrapper = new GZipServletResponseWrapper(httpResponse, gzout);
wrapper.setDisableFlushBuffer(true);
chain.doFilter(request, wrapper);
wrapper.flush();
gzout.close();
// double check one more time before writing out
// repsonse might have been committed due to error
if (response.isCommitted()) {
return;
}
// return on these special cases when content is empty or unchanged
switch (wrapper.getStatus()) {
case HttpServletResponse.SC_NO_CONTENT:
case HttpServletResponse.SC_RESET_CONTENT:
case HttpServletResponse.SC_NOT_MODIFIED:
return;
default:
}
// Saneness checks
byte[] compressedBytes = compressed.toByteArray();
boolean shouldGzippedBodyBeZero = GZipResponseUtil.shouldGzippedBodyBeZero(compressedBytes, httpRequest);
boolean shouldBodyBeZero = GZipResponseUtil.shouldBodyBeZero(httpRequest, wrapper.getStatus());
if (shouldGzippedBodyBeZero || shouldBodyBeZero) {
// No reason to add GZIP headers or write body if no content was written or status code specifies no
// content
response.setContentLength(0);
return;
}
// Write the zipped body
GZipResponseUtil.addGzipHeader(httpResponse);
response.setContentLength(compressedBytes.length);
response.getOutputStream().write(compressedBytes);
} else {
// Client does not accept zipped content - don't bother zipping
if (log.isTraceEnabled()) {
log.trace("{} Written without gzip compression because the request does not accept gzip", httpRequest.getRequestURL());
}
chain.doFilter(request, response);
}
}
/**
* Checks if the request uri is an include. These cannot be gzipped.
*/
private boolean isIncluded(final HttpServletRequest request) {
String uri = (String) request.getAttribute("javax.servlet.include.request_uri");
boolean includeRequest = !(uri == null);
if (includeRequest && log.isDebugEnabled()) {
log.debug("{} resulted in an include request. This is unusable, because"
+ "the response will be assembled into the overrall response. Not gzipping.",
request.getRequestURL());
}
return includeRequest;
}
private boolean acceptsGZipEncoding(HttpServletRequest httpRequest) {
String acceptEncoding = httpRequest.getHeader("Accept-Encoding");
return acceptEncoding != null && acceptEncoding.contains("gzip");
}
}
| [
"julien.dubois@gmail.com"
] | julien.dubois@gmail.com |
4ace1bee7d66da29381c75d904289e4dfd6df367 | 515bc9c5139d0e4e22a3a3c98ee39066eb7c6de4 | /app/src/androidTest/java/com/southman/southmanclient/ExampleInstrumentedTest.java | 630121e3c645e7de4f7491ebc069e27c27c424cd | [] | no_license | mukulraw/southman-client | 215ef46d3727e80bffaa6c29ea56b9606c948f4c | 6f7f77fb4a646a1c2219bcbcb68e451c6a230333 | refs/heads/master | 2020-05-26T15:48:31.634214 | 2020-01-04T06:58:09 | 2020-01-04T06:58:09 | 188,292,989 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 738 | java | package com.southman.southmanclient;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.southman.southmanclient", appContext.getPackageName());
}
}
| [
"mukulraw199517@gmail.com"
] | mukulraw199517@gmail.com |
e2a65a95f9d99743af1e51b4c4f1240fd590a2de | 8c81eeaa4bde7c4f9e402c1647940de5deb146fc | /src/CreateTree.java | f23ae39518e128529bc7e3a9c83a1d6e41334f1b | [] | no_license | Luciwar/Example | f4b51b53eef6189ba18ea7714f5ee38be4287864 | 15b5d4d48e930d75597555b1c9c128b8501812f4 | refs/heads/master | 2020-06-04T23:41:07.098593 | 2018-10-11T15:31:24 | 2018-10-11T15:31:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,450 | java | package Utils;
import java.util.HashMap;
import java.util.Scanner;
/**
* Created by Trung on 10/19/2017.
*/
public class CreateTree {
/**
* Source: GeeksForGeeks.org
* Input format:
* # of edges
* Nodes
*
* Example: For a tree
* 1
* / \
* 2 3
* / \
* 4 5
*
* Input will be:
* 4
* 1 2 L 1 3 R 2 4 L 3 5 R
*
* @return A tree
*/
public static TreeNode readConsole() {
TreeNode root;
Scanner sc = new Scanner(System.in);
HashMap<Integer, TreeNode> m = new HashMap<>();
int n = 0;
if (sc.hasNext())
n = sc.nextInt();
root = null;
while (n > 0 && sc.hasNext()) {
int n1 = sc.nextInt();
int n2 = sc.nextInt();
char lr = sc.next().charAt(0);
// cout << n1 << " " << n2 << " " << (char)lr << endl;
TreeNode parent = m.get(n1);
if (parent == null) {
parent = new TreeNode(n1);
m.put(n1, parent);
if (root == null)
root = parent;
}
TreeNode child = new TreeNode(n2);
if (lr == 'L')
parent.setLeft(child);
else
parent.setRight(child);
m.put(n2, child);
n--;
}
return root;
}
}
| [
"linhhoang13k@gmail.com"
] | linhhoang13k@gmail.com |
eb5787177269706f012334e84569df8217eaac65 | 98ad85b3d919e1f041dd00b966185335539dcf59 | /app/src/main/java/com/icommunicate/apiCall/requestModels/FetchMessageRequest.java | 36638a93d92837bf7b8f399de7fac896d046c5a3 | [] | no_license | BhadreshChavada/iCommunicate | aff9246c44635f7e21f475cec687e066e5e572d7 | 8b983cf5f6655df17de09dd9ca314efc1ccb9675 | refs/heads/master | 2023-02-02T09:51:39.492144 | 2020-12-10T09:24:46 | 2020-12-10T09:24:46 | 287,230,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package com.icommunicate.apiCall.requestModels;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by system-15 on 16/1/20 Timing 14:35.
*/
public class FetchMessageRequest {
@SerializedName("to")
@Expose
private String to;
@SerializedName("from")
@Expose
private String from;
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
}
| [
"bhadresh@techuz.com"
] | bhadresh@techuz.com |
034187cdae80c7801084c23b13e1c415fa086dd7 | 5ea5372d306353fdc6416ac56aeb437f6103fc89 | /test/net/ion/rosetta/query/QueryParser.java | dcb00117493dc1c869a514d3e28370c4b6cdbeae | [] | no_license | nextjava/craken | 3e71e9a86a2fa8657814a8bf3b2e0f3e8b779ef3 | 6ff5401fdc32f30f5a045e10a6a8a1aff81c6fe8 | refs/heads/master | 2021-01-18T07:38:56.203488 | 2013-08-19T00:53:28 | 2013-08-19T00:53:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,124 | java | package net.ion.rosetta.query;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import net.ion.rosetta.OperatorTable;
import net.ion.rosetta.Parser;
import net.ion.rosetta.Parsers;
import net.ion.rosetta.Scanners;
import net.ion.rosetta.Terminals;
import net.ion.rosetta.functors.Binary;
import net.ion.rosetta.functors.Map;
import net.ion.rosetta.pattern.Patterns;
public class QueryParser {
private enum BinaryOperator implements Binary<Filter> {
AND {
public Filter map(Filter a, Filter b) {
return new And(a, b);
}
},
OR {
public Filter map(Filter a, Filter b) {
return new Or(a, b);
}
}
}
public static final Parser<String> SINGLE_QUOTE_STRING = Scanners.pattern(Patterns.regex("((\\\\.)|[^\'\\\\])*"), "quoted string").between(Scanners.isChar('\''), Scanners.isChar('\'')).source();
public static final Map<String, String> SINGLE_QUOTE_STRING_MAP = new Map<String, String>() {
public String map(String text) {
return text.substring(1, text.length() - 1).replace("\\'", "'");
}
@Override
public String toString() {
return "SINGLE_QUOTE_STRING";
}
};
private static final Parser<Filter> TOKEN = Terminals.StringLiteral.PARSER.map(new net.ion.rosetta.functors.Map<String, Filter>() {
public Token map(String s) {
return new Token(s);
}
});
private static final Terminals OPERATORS = Terminals.operators("+", ",", "(", ")");
private static final Parser<Object> TOKENIZER = Parsers.<Object> or(SINGLE_QUOTE_STRING.map(SINGLE_QUOTE_STRING_MAP), OPERATORS.tokenizer());
private static Parser<?> term(String... names) {
return OPERATORS.token(names);
}
private static <T> Parser<T> op(String name, T value) {
return term(name).retn(value);
}
private static Parser<Filter> query(Parser<Filter> atom) {
Parser.Reference<Filter> ref = Parser.newReference();
Parser<Filter> unit = ref.lazy().between(term("("), term(")")).or(atom);
Parser<Filter> parser = new OperatorTable<Filter>().infixl(op(",", BinaryOperator.OR), 10).infixl(op("+", BinaryOperator.AND), 20).build(unit);
ref.set(parser);
return parser;
}
private static Parser<Void> nodelim = Parsers.always();
private static final Parser<Filter> parser = query(TOKEN).from(TOKENIZER, nodelim);
public static Filter parse(String source) {
/*
* String decoded = ""; char[] chars = source.toCharArray(); for (int i = 0; i < chars.length; i++) { if (chars[i] == '%') { int a = chars[++i]; int b = chars[++i]; if (a >= 'A') a = a-'A'; else a = a-'0'; if (b >= 'A') b = b-'A'; else b = b-'0'; decoded += (char)(16*a+b); } decoded += chars[i]; }
*/
source = source.replace("+", "%2B");
try {
source = URLDecoder.decode(source, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
System.out.println(source);
return parser.parse(source);
}
public static void main(String args[]) {
// System.out.println(SINGLE_QUOTE_STRING.parse("'foo'"));
System.out.println(QueryParser.parse("'hi: bye'+'ho!:bo+ o\\\'n'"));
}
}
| [
"bleujin@gmail.com"
] | bleujin@gmail.com |
563bbbbacccdc53aaf8ac087797610a9a253b43d | bf2966abae57885c29e70852243a22abc8ba8eb0 | /aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/transform/DeleteInventoryResultJsonUnmarshaller.java | 937a30644ad6edbb2b0e0d570b9bb254dbedadde | [
"Apache-2.0"
] | permissive | kmbotts/aws-sdk-java | ae20b3244131d52b9687eb026b9c620da8b49935 | 388f6427e00fb1c2f211abda5bad3a75d29eef62 | refs/heads/master | 2021-12-23T14:39:26.369661 | 2021-07-26T20:09:07 | 2021-07-26T20:09:07 | 246,296,939 | 0 | 0 | Apache-2.0 | 2020-03-10T12:37:34 | 2020-03-10T12:37:33 | null | UTF-8 | Java | false | false | 3,380 | java | /*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.simplesystemsmanagement.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.simplesystemsmanagement.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DeleteInventoryResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteInventoryResultJsonUnmarshaller implements Unmarshaller<DeleteInventoryResult, JsonUnmarshallerContext> {
public DeleteInventoryResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DeleteInventoryResult deleteInventoryResult = new DeleteInventoryResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return deleteInventoryResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("DeletionId", targetDepth)) {
context.nextToken();
deleteInventoryResult.setDeletionId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TypeName", targetDepth)) {
context.nextToken();
deleteInventoryResult.setTypeName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("DeletionSummary", targetDepth)) {
context.nextToken();
deleteInventoryResult.setDeletionSummary(InventoryDeletionSummaryJsonUnmarshaller.getInstance().unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return deleteInventoryResult;
}
private static DeleteInventoryResultJsonUnmarshaller instance;
public static DeleteInventoryResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DeleteInventoryResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
5e53f413652c95887cb550d169afc37c47a1534f | 98d006e8483c1d723c609c54535c52901dafbf3d | /src/main/java/com/yh/util/PageInterceptor.java | 19095d94232d71a85a0189a50e01312e803cda09 | [] | no_license | 1030364549/yh-trade | 5ea7686d1a2200a7487904c6a62e47e9803da903 | 55061d3007c74547b5ad4b4d4383b84780aee310 | refs/heads/master | 2022-07-03T20:42:37.281457 | 2019-10-22T08:01:39 | 2019-10-22T08:01:39 | 216,756,637 | 0 | 0 | null | 2022-02-09T22:29:00 | 2019-10-22T08:00:53 | JavaScript | UTF-8 | Java | false | false | 11,892 | java | package com.yh.util;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
import org.apache.ibatis.executor.parameter.ParameterHandler;
import org.apache.ibatis.executor.statement.RoutingStatementHandler;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import com.yh.entity.Page;
import org.apache.ibatis.scripting.defaults.DefaultParameterHandler;
/**
* ************************************
* 分页拦截器,用于拦截需要进行分页查询的操作,然后对其进行分页处理。
*
* @param <T>
* @param <PK> ************************************
*/
@SuppressWarnings("all")
@Intercepts({@Signature(method = "prepare", type = StatementHandler.class, args = {Connection.class, Integer.class})})
public class PageInterceptor implements Interceptor {
private String databaseType;//数据库类型,不同的数据库有不同的分页方法
private String printSql;//控制台输出SQL语句,0不输出,1输出
private String writeSqlLog;//保存sql操作日志
/**
* ************************************
* 拦截后要执行的方法
*
* @param <T>
* @param <PK> ************************************
*/
public Object intercept(Invocation invocation) throws Throwable {
//对于StatementHandler其实只有两个实现类,一个是RoutingStatementHandler,另一个是抽象类BaseStatementHandler,
//BaseStatementHandler有三个子类,分别是SimpleStatementHandler,PreparedStatementHandler和CallableStatementHandler,
//SimpleStatementHandler是用于处理Statement的,PreparedStatementHandler是处理PreparedStatement的,而CallableStatementHandler是
//处理CallableStatement的。Mybatis在进行Sql语句处理的时候都是建立的RoutingStatementHandler,而在RoutingStatementHandler里面拥有一个
//StatementHandler类型的delegate属性,RoutingStatementHandler会依据Statement的不同建立对应的BaseStatementHandler,即SimpleStatementHandler、
//PreparedStatementHandler或CallableStatementHandler,在RoutingStatementHandler里面所有StatementHandler接口方法的实现都是调用的delegate对应的方法。
//我们在PageInterceptor类上已经用@Signature标记了该Interceptor只拦截StatementHandler接口的prepare方法,又因为Mybatis只有在建立RoutingStatementHandler的时候
//是通过Interceptor的plugin方法进行包裹的,所以我们这里拦截到的目标对象肯定是RoutingStatementHandler对象。
RoutingStatementHandler handler = (RoutingStatementHandler) invocation.getTarget();
//通过反射获取到当前RoutingStatementHandler对象的delegate属性
StatementHandler delegate = (StatementHandler) ReflectUtil.getFieldValue(handler, "delegate");
//获取到当前StatementHandler的 boundSql,这里不管是调用handler.getBoundSql()还是直接调用delegate.getBoundSql()结果是一样的,因为之前已经说过了
//RoutingStatementHandler实现的所有StatementHandler接口方法里面都是调用的delegate对应的方法。
BoundSql bounSql = delegate.getBoundSql();
//拿到当前绑定Sql的参数对象,就是我们在调用对应的Mapper映射语句时所传入的参数对象
//获取当前要执行的Sql语句,也就是我们直接在Mapper映射语句中写的Sql语句
String sql = bounSql.getSql();
if ("1".equals("1")) {
System.out.println("----------------------------------------------SQL Print----------------------------------------------");
String beSql = formatSql(sql);
System.out.println(beSql);
System.out.println("-----------------------------------------------------------------------------------------------------");
}
Object obj = bounSql.getParameterObject();
//通过传入的是Page对象 认定它是需要进行分页操作的
if (obj instanceof Page) {
Page page = (Page)obj;
//通过反射获取delegate父类BaseStatementHandler的mappedStatement属性
MappedStatement mappedStatement = (MappedStatement) ReflectUtil.getFieldValue(delegate, "mappedStatement");
//拦截到的prepare方法参数是一个Connection对象
Connection connection = (Connection) invocation.getArgs()[0];
//如果是第一次,那么就统计,接下来翻页将不统计
if (page.getPageNo() == 1) {
this.setTotalRecord(page, mappedStatement, connection);
}
//获取分页SQL语句
String pageSql = this.getPageSql(page, sql);
//利用反射设置当前BoundSql对应的sql属性为我们建立好的分页Sql语句
ReflectUtil.setFieldValue(bounSql, "sql", pageSql);
}
return invocation.proceed();
}
/**
* ************************************
* 拦截器对应的封装原始对象的方法
*
* @param <T>
* @param <PK> ************************************
*/
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
/**
* ************************************
* 设置注册拦截器时设定的属性
*
* @param <T>
* @param <PK> ************************************
*/
public void setProperties(Properties properties) {
this.databaseType = properties.getProperty("databaseType");
this.printSql = properties.getProperty("printSql");
this.writeSqlLog = properties.getProperty("writeSqlLog");
}
/**
* ************************************
* 给当前的参数对象page设置总记录数
*
* @param page Mapper映射语句对应的参数对象
* @param mappedStatement Mapper映射语句
* @param connection 当前的数据库连接
* ************************************
*/
private void setTotalRecord(Page page, MappedStatement mappedStatement, Connection connection) {
//获取对应的BoundSql,这个BoundSql其实跟我们利用StatementHandler获取到的BoundSql是同一个对象。
//delegate里面的boundSql也是通过mappedStatement.getBoundSql(paramObj)方法获取到的。
BoundSql boundSql = mappedStatement.getBoundSql(page);
//获取到我们自己写在Mapper映射语句中对应的Sql语句
String sql = boundSql.getSql();
//通过查询Sql语句获取到对应的计算总记录数的sql语句
String countSql = this.getCountSql(sql);
//通过BoundSql获取对应的参数映射
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
//利用Configuration、查询记录数的Sql语句countSql、参数映射关系parameterMappings和参数对象page建立查询记录数对应的BoundSql对象。
BoundSql countBoundSql = new BoundSql(mappedStatement.getConfiguration(), countSql, parameterMappings, page);
//通过mappedStatement、参数对象page和BoundSql对象countBoundSql建立一个用于设定参数的ParameterHandler对象
ParameterHandler parameterHandler = new DefaultParameterHandler(mappedStatement, page, countBoundSql);
//通过connection建立一个countSql对应的PreparedStatement对象。
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = connection.prepareStatement(countSql);
//通过parameterHandler给PreparedStatement对象设置参数
parameterHandler.setParameters(pstmt);
//之后就是执行获取总记录数的Sql语句和获取结果了
rs = pstmt.executeQuery();
if (rs.next()) {
int totalRecord = rs.getInt(1);
//给当前的参数page对象设置总记录数
page.setTotalRecord(totalRecord);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
/**
* ************************************
* 根据原Sql语句获取对应的查询总记录数的Sql语句
*
* @param sql ************************************
*/
private String getCountSql(String sql) {
String new_sql = "select count(*) from (" + sql + ")";
return new_sql;
}
private String getPageSql(Page page, String sql) {
StringBuffer sqlBuffer = new StringBuffer(sql);
if ("mysql".equalsIgnoreCase(databaseType)) {
return getMySqlPageSql(page, sqlBuffer);
} else if ("oracle".equalsIgnoreCase(databaseType)) {
return getOraclePageSql(page, sqlBuffer);
}
return sqlBuffer.toString();
}
/**
* ************************************
* 获取Mysql数据库的分页查询语句
*
* @param sql ************************************
*/
private String getMySqlPageSql(Page page, StringBuffer sqlBuffer) {
if (page.getOrderField() != null && !page.getOrderField().equals("") && sqlBuffer.indexOf("order by") == -1) {
sqlBuffer.append(" order by ").append(page.getOrderField()).append(" ").append(page.getOrderDirection());
}
//计算第一条记录的位置,Mysql中记录的位置是从0开始的
int offset = (page.getPageNo() - 1) * page.getPageSize();
sqlBuffer.append(" limit ").append(offset).append(",").append(page.getPageSize());
return sqlBuffer.toString();
}
private String getOraclePageSql(Page page, StringBuffer sqlBuffer) {
if (page.getOrderField() != null && !page.getOrderField().equals("") && sqlBuffer.indexOf("order by") == -1) {
sqlBuffer.append(" order by ").append(page.getOrderField()).append(" ").append(page.getOrderDirection());
}
//计算第一条记录的位置,Oracle分页是通过rownum进行的,而rownum是从1开始的
int offset = (page.getPageNo() - 1) * page.getPageSize() + 1;
sqlBuffer.insert(0, "select u.*, rownum r from (").append(") u where rownum < ").append(offset + page.getPageSize());
sqlBuffer.insert(0, "select * from (").append(") where r >= ").append(offset);
System.out.println(sqlBuffer.toString());
return sqlBuffer.toString();
}
/**
* ************************************
* 格式化SQL
*
* @param sql ************************************
*/
private String formatSql(String sql) {
// 输入sql字符串空判断
if (sql == null || sql.length() == 0) {
return "";
}
// 美化sql
sql = beautifySql(sql);
return sql;
}
/**
* ************************************
* 美化SQL
*
* @param sql ************************************
*/
private String beautifySql(String sql) {
sql = sql.replaceAll("[\\s\n ]+", " ");
return sql;
}
}
| [
"1030364549@qq.com"
] | 1030364549@qq.com |
d4505b4f87269a7488cf046d297374daf552f993 | 6c53b2b97e7d6873709ae1106e929bbe181a9379 | /src/java/com/eviware/soapui/support/propertyexpansion/PropertyExpansionDropTarget.java | f72b49205997f68b064803fb0d9f3093738820c5 | [] | no_license | stallewar/soapui- | ca7824f4c4bc268b9a7798383f4f2a141d38214b | 0464f7826945709032964af67906e7d6e61b698a | refs/heads/master | 2023-03-19T05:23:56.746903 | 2011-07-12T08:29:36 | 2011-07-12T08:29:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,305 | java | /*
* soapUI, copyright (C) 2004-2011 eviware.com
*
* soapUI is free software; you can redistribute it and/or modify it under the
* terms of version 2.1 of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* soapUI 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 at gnu.org.
*/
package com.eviware.soapui.support.propertyexpansion;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import javax.swing.text.JTextComponent;
import com.eviware.soapui.SoapUI;
import com.eviware.soapui.model.propertyexpansion.PropertyExpansionImpl;
import com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils;
import com.eviware.soapui.model.tree.nodes.PropertyTreeNode.PropertyModelItem;
import com.eviware.soapui.support.UISupport;
import com.eviware.soapui.support.xml.JXEditTextArea;
import com.eviware.soapui.support.xml.XmlUtils;
public final class PropertyExpansionDropTarget implements DropTargetListener
{
private final PropertyExpansionTarget target;
public PropertyExpansionDropTarget( PropertyExpansionTarget target )
{
this.target = target;
}
public void dragEnter( DropTargetDragEvent dtde )
{
if( !isAcceptable( dtde.getTransferable() ) )
dtde.rejectDrag();
}
public void dragExit( DropTargetEvent dtde )
{
if( dtde.getDropTargetContext().getComponent() instanceof JTextComponent )
( ( JTextComponent )dtde.getDropTargetContext().getComponent() ).getCaret().setVisible( false );
else if( dtde.getDropTargetContext().getComponent() instanceof JXEditTextArea )
( ( JXEditTextArea )dtde.getDropTargetContext().getComponent() ).setCaretVisible( false );
}
public void dragOver( DropTargetDragEvent dtde )
{
if( !isAcceptable( dtde.getTransferable() ) )
dtde.rejectDrag();
if( dtde.getDropTargetContext().getComponent() instanceof JTextComponent )
{
JTextComponent textField = ( JTextComponent )dtde.getDropTargetContext().getComponent();
int pos = textField.viewToModel( dtde.getLocation() );
if( pos != -1 )
{
textField.setCaretPosition( pos );
textField.getCaret().setVisible( true );
}
}
if( dtde.getDropTargetContext().getComponent() instanceof JXEditTextArea )
{
JXEditTextArea textField = ( JXEditTextArea )dtde.getDropTargetContext().getComponent();
int pos = textField.pointToOffset( dtde.getLocation() );
if( pos != -1 )
{
textField.setCaretPosition( pos );
textField.setCaretVisible( true );
}
}
dtde.acceptDrag( dtde.getDropAction() );
}
public void drop( DropTargetDropEvent dtde )
{
if( !isAcceptable( dtde.getTransferable() ) )
dtde.rejectDrop();
else
{
try
{
Transferable transferable = dtde.getTransferable();
Object transferData = transferable.getTransferData( transferable.getTransferDataFlavors()[0] );
if( transferData instanceof PropertyModelItem )
{
dtde.acceptDrop( dtde.getDropAction() );
PropertyModelItem modelItem = ( PropertyModelItem )transferData;
String xpath = modelItem.getXPath();
if( xpath == null && XmlUtils.seemsToBeXml( modelItem.getProperty().getValue() ) )
{
xpath = UISupport.selectXPath( "Create PropertyExpansion", "Select XPath below", modelItem
.getProperty().getValue(), null );
if( xpath != null )
xpath = PropertyExpansionUtils.shortenXPathForPropertyExpansion( xpath, modelItem.getProperty()
.getValue() );
}
target.insertPropertyExpansion( new PropertyExpansionImpl( modelItem.getProperty(), xpath ),
dtde.getLocation() );
dtde.dropComplete( true );
}
}
catch( Exception e )
{
SoapUI.logError( e );
}
if( dtde.getDropTargetContext().getComponent() instanceof JTextComponent )
( ( JTextComponent )dtde.getDropTargetContext().getComponent() ).getCaret().setVisible( false );
else if( dtde.getDropTargetContext().getComponent() instanceof JXEditTextArea )
( ( JXEditTextArea )dtde.getDropTargetContext().getComponent() ).setCaretVisible( false );
}
}
public void dropActionChanged( DropTargetDragEvent dtde )
{
}
public boolean isAcceptable( Transferable transferable )
{
DataFlavor[] flavors = transferable.getTransferDataFlavors();
for( int i = 0; i < flavors.length; i++ )
{
DataFlavor flavor = flavors[i];
if( flavor.isMimeTypeEqual( DataFlavor.javaJVMLocalObjectMimeType ) )
{
try
{
Object modelItem = transferable.getTransferData( flavor );
if( modelItem instanceof PropertyModelItem )
{
return PropertyExpansionUtils.canExpandProperty( target.getContextModelItem(),
( ( PropertyModelItem )modelItem ).getProperty() );
}
}
catch( Exception ex )
{
SoapUI.logError( ex );
}
}
}
return false;
}
}
| [
"oysteigi@bluebear.(none)"
] | oysteigi@bluebear.(none) |
e840f4fc50328ae53e6b8a6582e47aebc03fe605 | 98d9e5fb6f7992bbeaf663dfe28729a22a9c9837 | /CICLO_II/Retos/Reto 5/Soluciones/Reto65/src/controller.java | 794aa8516354c1c6cfce234cdd63e17f77b0751b | [] | no_license | MISIONTIC-UN-2022/CICLO_II | b913f922ad7ae333c67cc04bd813b70e4657c760 | 40b2c1d4fa9efd97600874d4182a352f3b43d992 | refs/heads/master | 2023-07-20T10:46:54.484178 | 2021-08-25T23:34:45 | 2021-08-25T23:34:45 | 399,983,308 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,754 | java | import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
public class controller {
@FXML
private Label bodyOfWaterLabel;
@FXML
private Label nameLabel;
@FXML
private TextField nameTextField;
@FXML
private Label idLabel;
@FXML
private TextField idTextField;
@FXML
private Label typeOfWaterLabel;
@FXML
private TextField typeOfWaterTextField;
@FXML
private Label cityLabel;
@FXML
private TextField cityTextField;
@FXML
private Label bodyOfWaterTypeLabel;
@FXML
private TextField bodyOfWaterTypeTextField;
@FXML
private Label ircaLabel;
@FXML
private TextField ircaTextField;
@FXML
private Button addBodyOfWaterButton;
@FXML
private TextArea textArea1;
@FXML
private TextArea textArea2;
@FXML
private Label pNameLabel;
@FXML
private TextField pNameTextField;
@FXML
private Label pIDLabel;
@FXML
private TextField pIDTextField;
@FXML
private Label populationLabel;
@FXML
private TextField populationTextField;
@FXML
private ListView<DensidadPoblacional> populationDensityList;
@FXML
private TextArea textArea3;
@FXML
private Button addPopulationDensityButton;
@FXML
private Button addPopulationButton;
@FXML
private Button processDataButton;
@FXML
void addBodyOfWaterButtonClick(ActionEvent event) {
String s = String.join(" ", nameTextField.getText(),
idTextField.getText(),
cityTextField.getText(),
bodyOfWaterTypeTextField.getText(),
typeOfWaterTextField.getText(),
ircaTextField.getText());
//System.out.println(s);
textArea1.setText(textArea1.getText() + s + "\n");
nameTextField.setText("");
idTextField.setText("");
cityTextField.setText("");
bodyOfWaterTypeTextField.setText("");
typeOfWaterTextField.setText("");
ircaTextField.setText("");
}
@FXML
void addPopulationButtonClick(ActionEvent event) {
if (!populationTextField.getText().isEmpty()) {
int cantHab = Integer.parseInt(populationTextField.getText());
DensidadPoblacional pd = populationDensityList.getSelectionModel().getSelectedItem();
pd.setCantidadHabitantes(cantHab);
populationTextField.setText("");
}
}
@FXML
void addPopulationDensityButtonClick(ActionEvent event) {
DensidadPoblacional pd = new DensidadPoblacional(Double.parseDouble(pIDTextField.getText()), pNameTextField.getText());
populationDensityList.getItems().add(pd);
pNameTextField.setText("");
pIDTextField.setText("");
}
@FXML
void itemMouseClick(MouseEvent event) {
DensidadPoblacional pd = populationDensityList.getSelectionModel().getSelectedItem();
textArea3.setText("");
textArea3.setText("El nivel de afección en es de tipo: " + String.valueOf(pd.afeccion()));
}
@FXML
void processDataButtonClick(ActionEvent event) {
String datitos = textArea1.getText().strip();
String[] cuerposDeAguasS = datitos.split("\n");
CuerpoDeAgua[] datos = new CuerpoDeAgua[cuerposDeAguasS.length];
for (int i = 0; i < cuerposDeAguasS.length; i++) {
String[] temp = cuerposDeAguasS[i].split(" ");
datos[i] = new CuerpoDeAgua(temp[0], Double.parseDouble(temp[1]),
temp[2], temp[3], temp[4], Double.parseDouble(temp[5]));
}
//Id de cada cuerpo de agua
double id;
for (int i = 0; i < cuerposDeAguasS.length; i++) {
id = datos[i].getId();
System.out.println(id);
TextArea2.setText(TextArea2.getText() + String.format("%.2f", id) +"\n");
}
// Numero de cuerpos de agua con nivel de riesgo entre BAJO y MEDIO
double cont = 0;
for (int i = 0; i < cuerposDeAguasS.length; i++) {
if (datos[i].getIrca() > 5 && datos[i].getIrca() <= 35) {
cont++;
}
}
System.out.println(String.format("%.2f", cont));
TextArea2.setText(TextArea2.getText() + String.format("%.2f", cont) +"\n");
//Nombre de cuerpos de agua con nivel de riesgo MEDIO
double contm = 0;
for (int i = 0; i < cuerposDeAguasS.length; i++) {
if (datos[i].getIrca() > 14 && datos[i].getIrca() <= 35) {
System.out.print(datos[i].getNombre() + " ");
TextArea2.setText(TextArea2.getText() + datos[i].getNombre() + " " + "\n");
contm++;
}
}
if (contm == 0) {
System.out.print("NA");
TextArea2.setText(TextArea2.getText() + "NA" + "\n");
}
//irca mas alto
double max = -1;
for (int i = 0; i < cuerposDeAguasS.length; i++) {
if (datos[i].getIrca() > max) {
max = datos[i].getIrca();
}
}
System.out.println("\n"+String.format("%.2f", max));
TextArea2.setText(TextArea2.getText() + "\n" + String.format("%.2f", max) + "\n");
}
}
| [
"kristellu@uninorte.edu.co"
] | kristellu@uninorte.edu.co |
97f810603e8543998255bab4fd243bfaca773d5d | 14969bca270ed8dd5b90e0cf27f502d725a76f84 | /src/zones/underwater/characters/Whalesknighter.java | 7c08c52c1abef278f834b102902f5b70b0f077e6 | [
"MIT"
] | permissive | didizlatkova/PatternShooter | b20cc506e0dc8591a4397e79b0ab36cc92117610 | 14380b29790e4df538d4f897986e46cdefad1488 | refs/heads/master | 2016-08-11T11:17:44.065902 | 2015-06-18T12:31:32 | 2015-06-18T12:31:32 | 36,864,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package zones.underwater.characters;
import zones.underwater.weapons.Harpoon;
import elements.abstracts.characters.Enemy;
public class Whalesknighter extends Enemy {
public Whalesknighter(int healthPoints) {
super(new Harpoon(), healthPoints);
}
@Override
public String toString() {
return "WK";
}
@Override
public String getName() {
return "Whalesknighter";
}
}
| [
"didi.zlatkova93@gmail.com"
] | didi.zlatkova93@gmail.com |
f7135dbe570d10f037792be41ce922703a1ab09d | c800b6aa137b5b95a52a13501ffc1a563087237a | /src/main/java/cn/com/sky/algorithms/leetcode/easy/LargestPalindromeProduct479.java | 34f5e07083f07c1e2a0213de17e88901f3c4e12c | [] | no_license | git-sky/algorithms | a0b85a550c4605e207a75ba9083b9243cbadf319 | 582faffa813fce70e0e5afbb3d990f07219d3e2d | refs/heads/master | 2021-01-19T00:43:08.133723 | 2018-02-24T05:59:25 | 2018-02-24T05:59:25 | 73,152,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package cn.com.sky.algorithms.leetcode.easy;
/**
* <pre>
*
* 479. Largest Palindrome Product
*
* Find the largest palindrome made from the product of two n-digit numbers.
*
* Since the result could be very large, you should return the largest palindrome mod 1337.
*
* Example:
*
* Input: 2
*
* Output: 987
*
* Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
*
* Note:
*
* The range of n is [1,8].
*
*
* </pre>
*/
public class LargestPalindromeProduct479 {
}
| [
"linkme2008@sina.com"
] | linkme2008@sina.com |
5822e1ef83fad05f32095991a90d0713ea33627a | 1563cdf4f808d9b2844643e787994bbea2ce5c55 | /pinyin/src/com/nillith/pinyin/Pinyin.java | 1b0b0d084cc42e22981a2e8265d1b942be9240be | [
"Apache-2.0"
] | permissive | tsp520/UniPinyin | 7c154cb1a5b8f396b326d5487b144979ee0e3ca9 | 765840c3d627eb417ba644dd4ac78be1c0665e13 | refs/heads/master | 2021-06-01T03:21:50.401810 | 2016-08-08T11:44:04 | 2016-08-08T11:44:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,603 | java | package com.nillith.pinyin;
public class Pinyin {
private static final Dictionary dict = Dictionary.getInstance();
public static Pinyin parsePinyin(String s) {
return new Pinyin((char) Meta.indexOf(s));
}
public static Pinyin getPinyin(char c) {
return new Pinyin(dict.get(c));
}
public static Pinyin[] getPinyin(String str) {
int num = str.length();
Pinyin[] result = new Pinyin[num];
for (int i = 0; i < num; ++i) {
result[i] = getPinyin(str.charAt(i));
}
return result;
}
public static String getPinyinString(char c) {
return getPinyin(c).toString();
}
public static String getPinyinStringAscii(char c) {
return getPinyin(c).toStringAscii();
}
public static String getPinyinStringAsciiNoTone(char c) {
return getPinyin(c).toStringAsciiNoTone();
}
public static String getPinyinString(String str) {
return getPinyinString(str, DELIMITER_DEFAULT, IGNORE_NOT_FOUND);
}
public static String getPinyinStringAscii(String str) {
return getPinyinStringAscii(str, DELIMITER_DEFAULT, IGNORE_NOT_FOUND);
}
public static String getPinyinStringAsciiNoTone(String str) {
return getPinyinStringAsciiNoTone(str, DELIMITER_DEFAULT, IGNORE_NOT_FOUND);
}
static final int PINYIN_LENGTH_AVG = 4;
static final String DELIMITER_DEFAULT = " ";
static final boolean IGNORE_NOT_FOUND = false;
static final int RESULT_DEFAULT = 0;
static final int RESULT_ASCII = 1;
static final int RESULT_ASCII_NO_TONE = 2;
static String getPinyinString(String str, String delimiter, boolean ignoreNotFound, final int resultOption) {
if (null == delimiter) {
delimiter = "";
}
Pinyin pinyin = new Pinyin();
StringBuilder sb = new StringBuilder((PINYIN_LENGTH_AVG + delimiter.length()) * str.length());
char c;
for (int i = 0, end = str.length(); i < end; ++i) {
c = str.charAt(i);
pinyin.data = dict.get(c);
if (0 == pinyin.data) {
if (!ignoreNotFound) {
sb.append(c);
sb.append(delimiter);
}
} else {
switch (resultOption) {
case RESULT_DEFAULT:
sb.append(pinyin.toString());
break;
case RESULT_ASCII:
sb.append(pinyin.toStringAscii());
break;
case RESULT_ASCII_NO_TONE:
sb.append(pinyin.toStringAsciiNoTone());
break;
default:
throw new IllegalArgumentException();
}
sb.append(delimiter);
}
}
return sb.toString().substring(0, sb.length() - delimiter.length());
}
public static String getPinyinString(String str, String delimiter, boolean ignoreNotFound) {
return getPinyinString(str, delimiter, ignoreNotFound, RESULT_DEFAULT);
}
public static String getPinyinStringAscii(String str, String delimiter, boolean ignoreNotFound) {
return getPinyinString(str, delimiter, ignoreNotFound, RESULT_ASCII);
}
public static String getPinyinStringAsciiNoTone(String str, String delimiter, boolean ignoreNotFound) {
return getPinyinString(str, delimiter, ignoreNotFound, RESULT_ASCII_NO_TONE);
}
public static Pinyin[] getPinyinAll(char c) {
Pinyin pinyin = getPinyin(c);
if (pinyin.isMarkedAsHeteronym()) {
char[] extras = dict.getExtras(c);
Pinyin[] pinyins = new Pinyin[extras.length];
pinyins[0] = pinyin;
for (int i = 1; i < pinyins.length; ++i) {
pinyins[i] = new Pinyin(extras[i]);
}
return pinyins;
} else {
return new Pinyin[]{pinyin};
}
}
public String getInitial() {
return getMeta().getInitial();
}
public String getFinal() {
return getMeta().getFinal();
}
public String getFinalAscii() {
return getMeta().getFinalAscii();
}
public int getTone() {
return getMeta().getTone();
}
@Override
public String toString() {
return getMeta().toString();
}
public String toStringAscii() {
return getMeta().toStringAscii();
}
public String toStringAsciiNoTone() {
return getMeta().toStringAsciiNoTone();
}
public Pinyin() {
}
Pinyin(char data) {
this.data = data;
}
public void unsafeSetInternal(char data) {
this.data = data;
}
public char getInternal() {
return data;
}
private Meta getMeta() {
return Meta.ALL[getMetaIndex()];
}
char data;
private static final char IS_HETERONYM = 1;
public static boolean isHeteronym(char c) {
return getPinyin(c).isMarkedAsHeteronym();
}
boolean isMarkedAsHeteronym() {
return getExtra() == IS_HETERONYM;
}
void markAsHeteronym() {
setExtra(IS_HETERONYM);
}
private static final int IDX_BITS = 11;
private static final char IDX_MASK = 0x7ff;
int getMetaIndex() {
int result = data & IDX_MASK;
return result;
}
int getExtra() {
return data >>> IDX_BITS;
}
void setExtra(int extra) {
data = (char) (getMetaIndex() | (extra << IDX_BITS));
}
}
| [
"nillith@outlook.com"
] | nillith@outlook.com |
4180b5f4b99f2c37ecaa61f3b0c47e5ca3612323 | 112e2ca16bef079d24323d6a784442ddf2b1ed79 | /ivt-lab-master/src/main/java/hu/bme/mit/spaceship/TorpedoStore.java | 44a257011db557cd1ef5ed6d074ee659df2e0a9b | [
"MIT"
] | permissive | Hbrndzs/ivt-lab | 4e1fa036e919795ec446a626ef056fbc3d05a9b7 | f35d6cdd634fdda0907bc562e0d95dd77c66bcd4 | refs/heads/master | 2020-03-10T12:52:53.342734 | 2018-04-27T11:37:31 | 2018-04-27T11:37:31 | 129,387,101 | 0 | 0 | null | 2018-04-27T11:42:08 | 2018-04-13T10:28:14 | Java | UTF-8 | Java | false | false | 1,374 | java | package hu.bme.mit.spaceship;
import java.util.Random;
/**
* Class storing and managing the torpedoes of a ship
*/
public class TorpedoStore {
private double torpedoFailtureRate = 0.0;
private int torpedoCount = 0;
private Random generator = new Random();
public TorpedoStore(int numberOfTorpedos){
this.torpedoCount = numberOfTorpedos;
// update failure rate if it was specified in an environment variable
String failureEnv = System.getenv("IVT_RATE");
if (failureEnv != null){
try {
torpedoFailtureRate = Double.parseDouble(failureEnv);
} catch (NumberFormatException nfe) {
torpedoFailtureRate = 0.0;
}
}
}
public boolean fire(int numberOfTorpedos){
if(numberOfTorpedos < 1 || numberOfTorpedos > this.torpedoCount){
throw new IllegalArgumentException("numberOfTorpedos");
}
boolean success = false;
// simulate random overheating of the launcher bay which prevents firing
double r = generator.nextDouble();
if (r >= torpedoFailtureRate) {
// successful firing
this.torpedoCount -= numberOfTorpedos;
success = true;
} else {
// simulated failure
success = false;
}
return success;
}
public boolean isEmpty(){
return this.torpedoCount <= 0;
}
public int getTorpedoCount() {
return this.torpedoCount;
}
}
| [
"andor09@gmail.com"
] | andor09@gmail.com |
920d4a8584d91bc5dd3193e788315addfc7ce1cb | 9aadb0678e182300f43438729bac4e512ea911f2 | /JAVA_Algorithm/disjoint_set/DisjointSetTest.java | 9577b99205ec568af8a32ee39337eaeec7a396d6 | [] | no_license | SeungsoonLeee/ssafy | ef0d6aee50a23764a0dc403bce6a7a8c651cf4c2 | 4a7e9c8b14b590f562f5ba68703afd86aa5dfb06 | refs/heads/master | 2023-01-21T00:11:57.330642 | 2019-11-28T08:40:58 | 2019-11-28T08:40:58 | 194,757,133 | 1 | 1 | null | 2023-01-05T11:14:08 | 2019-07-01T23:47:52 | Java | UTF-8 | Java | false | false | 1,091 | java | package ssafy.com.disjointset;
import java.util.Arrays;
import java.util.Scanner;
public class DisjointSetTest {
static int[] parents;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int count = sc.nextInt();
parents = new int[N];
// 1. set 만들기
Arrays.fill(parents, -1);
for (int i = 0; i < count; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(union(a, b));
}
System.out.println(find(0) + " " + find(1));
System.out.println(find(3) + " " + find(4));
System.out.println(find(2) + " " + find(3));
// 0 3
// 1 4
// 3 4
}
private static boolean union(int a, int b) {
int aRoot = find(a);
int bRoot = find(b);
if (aRoot != bRoot) {
parents[bRoot] = aRoot;
return true;
}
return false;
}
private static int find(int f) {
if (parents[f] < 0) // 음수인 경우 root라는 의미이므로 자기 자신을 리턴
return f;
return parents[f] = find(parents[f]); // path compression
}
}
| [
"cjswosuny01@naver.com"
] | cjswosuny01@naver.com |
ff4db673be14eeb1f7d54d36f0fd7afba49ade3a | a1737bfb0c6a79d05dbaf691a8dfbc9d19b0b61e | /src/com/qianfeng/automarking/service/QABiz.java | 6cef9cabae32fa86f99e87385008cb0bcc4a9f03 | [] | no_license | GitHubAndy80/automarking | a9f0e8120c9e026bf9c4a5597e74fbd495191dfa | 791f662ec8a79d57c0e85d9523e72d97310419bc | refs/heads/master | 2021-01-10T17:43:43.851538 | 2015-12-28T05:17:42 | 2015-12-28T05:17:42 | 48,566,760 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,249 | java | package com.qianfeng.automarking.service;
import java.util.List;
import java.util.Scanner;
import com.qianfeng.automarking.Main;
import com.qianfeng.automarking.context.Session;
import com.qianfeng.automarking.dao.StudentDao;
import com.qianfeng.automarking.entity.Student;
import com.qianfeng.automarking.util.CommonUtil;
/**
* 问答业务
*
* @author HuangGuiZhao
*
*/
public class QABiz {
private static Scanner input = new Scanner(System.in);
private static StudentDao studentDao = new StudentDao();
public static void showLuckyQA() {
System.out.println("常用功能--->>幸运问答");
System.out.println("-------------------");
if (Session.checkIsExits("className")) {
List<Student> list = studentDao.getList(Session.get("className"));
if(list.size()==0){
System.out.println("当前班级不存在学员信息,快去设置学员信息吧");
Main.showMainMenu();
return;
}
String isContinue;
do {
int luckyNum = CommonUtil.getRandom(0, list.size()-1);
String name = list.get(luckyNum).getName();
System.out.println("本次抽中的幸运学员:" + name);
System.out.println("回答是否正确?正确请输入y,其他视为不正确");
String isRight = input.next();
if ("y".equals(isRight)) {
studentDao.saveRightTime(name, Session.get("className"));
list.remove(luckyNum);
System.out.println("恭喜" + name + "同学,答对了,要等到下一轮才有机会回答问题了");
} else {
System.out.println(name + "同学,注意了,下一次有可能还是抽到你");
studentDao.saveWrongTime(name, Session.get("className"));
}
System.out.println("是否继续抽学员回答问题?继续请输入y,其他视为结束");
isContinue = input.next();
} while ("y".equalsIgnoreCase(isContinue));
Main.showMainMenu();
} else {
System.out.println("尚未设置全局班级信息,请设置当前班级:");
boolean result = GlobalSetBiz.setGlobalClasses();
if (result) {
showLuckyQA();
} else {
System.out.println("未成功设置班级信息,将退回到主菜单");
Main.showMainMenu();
}
}
}
public static void showScoreBoard() {
System.out.println("常用功能--->>幸运问答龙虎榜");
System.out.println("------------------------");
if (Session.checkIsExits("className")) {
List<Student> list = studentDao.getList(Session.get("className"));
System.out.println("排行榜规则:");
System.out.println("默认以答对次数来作为首要依据,如果答对次数一样,则答错次数更少的排在前面");
System.out.println("姓名\t答对次数\t答错次数");
for(int i=0;i<list.size();i++){
Student s = list.get(i);
System.out.println(s.getName()+"\t"+s.getRights()+"\t"+s.getErrors());
}
Main.showMainMenu();
} else {
System.out.println("尚未设置全局班级信息,请设置当前班级:");
boolean result = GlobalSetBiz.setGlobalClasses();
if (result) {
showLuckyQA();
} else {
System.out.println("未成功设置班级信息,将退回到主菜单");
Main.showMainMenu();
}
}
}
}
| [
"hgz0101@163.com"
] | hgz0101@163.com |
72d883d3325bb1afabfbc5b731715084c3c9a20b | 5497ce6535fa5c0508f326a94aea380a1ec3d4b6 | /android/app/src/debug/java/com/second_nature_recipes/ReactNativeFlipper.java | 8ec8549ea89dba1f94b3eb66b654ee4d09a0621d | [] | no_license | Marc-Cilliers/react_native_recipes | 99b731769b9787a23e2a4e718c924bdcbbbce269 | e58fcf5f5ec21b273388bd6e532ed00addb0fc46 | refs/heads/master | 2022-11-10T22:17:21.615654 | 2020-07-07T17:18:00 | 2020-07-07T17:18:00 | 277,878,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,276 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.second_nature_recipes;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"mcilliers@arbnco.com"
] | mcilliers@arbnco.com |
685d67648b92680225c7fd4f770d8f6569592d12 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/22/22_758b398893395d5d52d3df897a6772cdc5ccd1d6/Seed/22_758b398893395d5d52d3df897a6772cdc5ccd1d6_Seed_t.java | d8434003d77175aa5e28625a79fbc09bb9786b5d | [] | 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 | 2,553 | java | package EvolvingPlants;
import java.awt.Graphics;
import tools.RandTools;
public class Seed extends PlantPart
{
private Stem[] stems = null;
public boolean germinated = false;
double xMod = 0;
private double energyPerGrow;
public Seed(Plant thisPlant, float x, float y)
{
super(thisPlant, x, y);
energy = thisPlant.genes.seedEnergy;
energyPerGrow = thisPlant.genes.energyTransfer * Math.pow(thisPlant.genes.energyTransfer + 0.2, 1.25);
xMod = RandTools.getDouble(-thisPlant.genes.seedSpread, thisPlant.genes.seedSpread);
}
@Override
public void tick()
{
if (!germinated)
{
if (y < Main.frame.getHeight() - 30)
{
y += 2;
thisPlant.y += 2;
double var = (RandTools.getDouble(-xMod, xMod) / 2);
x += xMod + var;
thisPlant.x += xMod + var;
}
else if (!thisPlant.genes.germinate)
thisPlant.exists = false;
else if (stems == null)
{
germinate();
}
}
else
{
for (Stem s : stems)
{
s.tick();
if (energy > 0)
{
energy -= energyPerGrow;
s.energy += energyPerGrow;
}
}
}
}
@Override
public void render(Graphics g)
{
if (stems != null)
for (Stem s : stems)
s.render(g);
if (Main.world.viewSeeds)
{
g.setColor(thisPlant.seedColour);
int seedSize = (int) (energy / 15);
g.fillOval(Math.round(x - (seedSize / 2)), Math.round(y - (seedSize / 2)), seedSize, seedSize);
}
}
public void germinate()
{
if (energy > thisPlant.genes.seedEnergy / 2)
{
energy -= 0.4;
if (thisPlant.genes.germinate && Main.world.isSpaceToGerminate(thisPlant))
{
germinated = true;
if (thisPlant.parentOne != null && thisPlant.parentTwo != null)
{
thisPlant.parentOne.numGerminatedOffspring++;
thisPlant.parentTwo.numGerminatedOffspring++;
}
int numStems = (int) Math.min(thisPlant.numberOfStemsLeft, thisPlant.genes.numberOfSeedStems);
stems = new Stem[numStems];
for (int i = 0; i < numStems; i++)
stems[i] = new Stem(thisPlant, x, y);
thisPlant.numberOfStemsLeft -= numStems;
}
}
else
thisPlant.exists = false;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
118afaab5a7682bd89330c6acd5df1e2e8420590 | 4c917a0a66f478be281e00bc354fa32c7dc2f9b5 | /telegram-emoji/src/main/java/kani/aitkulov/telegram_emoji/ui/EmojiTextView.java | 2c97a3cdf3c9b64c820b86479066164b91105853 | [] | no_license | kaitkulov/TelegramEmoji | 5c80467b941c409eacd94b38b7251e46dbef4ad1 | 90d4f5fb25300d3a16e3b9de32608907a6f77a3d | refs/heads/master | 2020-04-02T01:50:31.171089 | 2018-02-22T06:06:09 | 2018-02-22T06:06:09 | 83,459,575 | 4 | 1 | null | 2018-02-22T06:06:09 | 2017-02-28T17:17:03 | Java | UTF-8 | Java | false | false | 2,503 | java | /*
* Copyright 2014 Hieu Rocker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kani.aitkulov.telegram_emoji.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;
import kani.aitkulov.telegram_emoji.Emoji;
import kani.aitkulov.telegram_emoji.R;
/**
* @author Kanimet Aitkulov (kani.aitkulov@gmail.com)
*/
public class EmojiTextView extends TextView {
private int mEmojiSize;
private int mEmojiTextSize;
private TextPaint textPaintEmoji;
public EmojiTextView(Context context) {
super(context);
init(null);
}
public EmojiTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public EmojiTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs);
}
private void init(AttributeSet attrs) {
mEmojiTextSize = (int) getTextSize();
if (attrs == null) {
mEmojiSize = (int) getTextSize();
} else {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Emoji);
mEmojiSize = (int) a.getDimension(R.styleable.Emoji_emojiSize, getTextSize());
a.recycle();
}
textPaintEmoji = new TextPaint(Paint.ANTI_ALIAS_FLAG);
textPaintEmoji.setTextSize(mEmojiSize);
setText(getText());
}
@Override
public void setText(CharSequence text, BufferType type) {
if (!TextUtils.isEmpty(text)) {
text = Emoji.replaceEmoji(text, textPaintEmoji.getFontMetricsInt(), mEmojiTextSize, false);
}
super.setText(text, type);
}
public void setEmojiSize(int pixels) {
mEmojiSize = pixels;
textPaintEmoji.setTextSize(mEmojiSize);
super.setText(getText());
}
}
| [
"kani.aitkulov@gmail.com"
] | kani.aitkulov@gmail.com |
4319e430c031f9e8721fc09aec209efb27846147 | 02317d9e4728f0548492132be91b271a84d43b02 | /src/main/java/com/evilsay/ship/Enums/ShopStatusEnum.java | 3fec6f0035a7c5b0b636703daa459bbe9e0eb193 | [] | no_license | zouopen/CampusShopOnline | abe416024ea5f7ba140510be56403f028c8c2812 | ed5e7985c17decfe0156e1a570b2924f4cf0d323 | refs/heads/master | 2022-12-10T15:19:19.656198 | 2019-12-10T12:37:03 | 2019-12-10T12:37:03 | 201,961,559 | 1 | 0 | null | 2022-12-07T04:34:04 | 2019-08-12T15:50:21 | JavaScript | UTF-8 | Java | false | false | 449 | java | package com.evilsay.ship.Enums;
import lombok.Getter;
/**
* @Author: EvilSay
* @Date: 2019/1/21 1:03
*/
@Getter
public enum ShopStatusEnum implements CodeEnum {
ONLINE(0,"营业时间"),
OFFLINE(1,"非营业时间"),
ERROR_CLOSE_SHOP(2,"打烊异常"),
;
private Integer code;
private String message;
ShopStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
}
| [
"360844558@qq.com"
] | 360844558@qq.com |
42632e2b2332bd14eaefa23daf68d117f136a893 | e94283089810516f048bd58590036c88588112cb | /src/S0145BinaryTreePostorderTraversal.java | 2f9d9071fe4c21c139712643fc706eaf1a52ab8a | [] | no_license | camelcc/leetcode | e0839e6267ebda5eef57da065d4adaefecb4b557 | d982b9e71bc475a599df45d66cf2b78cf017594d | refs/heads/master | 2022-07-19T06:24:49.148849 | 2022-07-10T07:00:34 | 2022-07-10T07:00:34 | 135,386,923 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,850 | java | import util.TreeNode;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
public class S0145BinaryTreePostorderTraversal {
public List<Integer> postorderTraversal(TreeNode root) {
List<Integer> res = new ArrayList<>();
if (root == null) {
return res;
}
TreeNode dummy = new TreeNode(0);
dummy.left = new TreeNode(0);
dummy.right = root;
Stack<TreeNode> d = new Stack<>();
d.push(dummy);
d.push(dummy.left);
Stack<Stack<TreeNode>> stacks = new Stack<>();
stacks.push(d);
do {
Stack<TreeNode> outer = stacks.pop();
res.add(outer.pop().val);
if (outer.isEmpty()) {
continue;
}
stacks.push(outer);
if (outer.peek().right == null) {
continue;
}
TreeNode n = outer.peek().right;
Stack<TreeNode> t = new Stack<>();
t.push(n);
while (true) {
if (n.left != null) {
t.push(n.left);
n = n.left;
continue;
}
if (n.right != null) {
stacks.push(t);
t = new Stack<>();
t.push(n.right);
n = n.right;
continue;
}
break;
}
stacks.push(t);
} while (!stacks.isEmpty());
res.remove(0);
res.remove(res.size()-1);
return res;
// if (root.left != null) {
// res.addAll(postorderTraversal(root.left));
// }
// if (root.right != null) {
// res.addAll(postorderTraversal(root.right));
// }
// res.add(root.val);
}
}
| [
"camel.young@gmail.com"
] | camel.young@gmail.com |
3884d4ab9eb404c907dba3c0a39b79efe7f90bfe | be89141cd462631579fbdde5c300eb6139162473 | /practica3-sa/src/main/java/com/practica1/sa/web/app/Logic/Datos.java | 24bbdb076b1f34893ee04e4b047514693717cfed | [] | no_license | jmorejon/practica5SA | 3cb08ba9799b7ff6b645ad2aaf67fd378582cca6 | b998969e60407ff6b6d750bc6164dadcf74a8a52 | refs/heads/master | 2022-12-09T10:22:23.816288 | 2020-09-12T04:17:50 | 2020-09-12T04:17:50 | 294,867,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package com.practica1.sa.web.app.Logic;
import java.util.ArrayList;
import java.util.List;
import com.practica1.sa.web.app.Entity.*;
public class Datos {
public List<Cliente> clientes;
private int contador;
public Datos() {
this.contador =0;
clientes = new ArrayList<>();
clientes.add(new Cliente(1,"Luisa"));
clientes.add(new Cliente(2,"Marina"));
clientes.add(new Cliente(3,"Alba"));
clientes.add(new Cliente(4,"Liliana"));
}
public int getContadorPedidos() {
return contador++;
}
}
| [
"jmorejon@ingenieria.usac.edu.gt"
] | jmorejon@ingenieria.usac.edu.gt |
98c9fcebee66ea7a854d6732e7349b5dbeffae12 | 9c26ad4cb26fcdc5c2f1fd7b501850f6776e8a1c | /MusicFerretCode/src/GenreParrallel.java | de1ea5defcc02754c2d6ee23379bab9f1af34bce | [] | no_license | winstoww/CSCI201FinalProject | c1cb4e2f7d59f8ae703ac127da4643b72c95a74d | 5bc0108b721c374470bf2db1edc0b79ef3ca4669 | refs/heads/master | 2022-04-27T16:54:13.355049 | 2020-04-27T05:36:39 | 2020-04-27T05:36:39 | 251,076,158 | 0 | 3 | null | 2020-04-11T23:59:30 | 2020-03-29T16:17:33 | Java | UTF-8 | Java | false | false | 2,074 | java | import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.concurrent.RecursiveTask;
public class GenreParrallel extends RecursiveTask<Double>{
protected Profile curr;
protected Profile other;
public GenreParrallel(Profile curr, Profile other)
{
this.curr=curr;
this.other = other;
}
public Double compute()
{
ArrayList<Integer> curr_genres= curr.getGenres();
ArrayList<Integer> other_genres= other.getGenres();
// Integer min_index_curr=-1;
// Integer min_index_other=-1;
Double min_score= Double.MAX_VALUE;// will store the value corresponding to most liked genre by the two profiles(an average)
// low values correspond to the user liking the genre more so will be looking for the min value
for(int i=0; i<curr_genres.size();i++)
{
Double temp_score= Math.abs((double) ((curr_genres.get(i) + other_genres.get(i))/2.0) );// getting the average score for each genre
if(temp_score< min_score)
{
min_score= temp_score;// if this score is bettter (lower) than the min, we have found a new min (i.e a new best liked genre)
}
}
;
// using transformations to convert scores to between a range of 0-1
min_score *=2;
min_score -=1;
Double OldValue= min_score;
Double OldMin= new Double(1);
Double NewMin= new Double(0);
Double OldRange = (new Double(10) - new Double(1)) ;
Double NewRange = (new Double(1) - new Double(0)) ;
Double score= ( 1- (((OldValue - OldMin) * NewRange) / OldRange) + NewMin);
System.out.println(other.getName() + "'s genre score= "+ score);
return score;
}
//Formula to calculate distance between current location and destination
public static double distance(double lat1, double lat2, double long1, double long2)
{
double total = 3963.0 * Math.acos(
Math.sin(Math.toRadians(lat1))*Math.sin(Math.toRadians(lat2)) +
Math.cos(Math.toRadians(lat1))*Math.cos(Math.toRadians(lat2))*Math.cos(Math.toRadians(long2 - long1))
);
DecimalFormat df2 = new DecimalFormat("#.#");
return Double.parseDouble(df2.format(total));
}
}
| [
"mitraarj@usc.edu"
] | mitraarj@usc.edu |
83eba4e11e635e3483595ad4107f76419f0b6d3d | 76ffb7d4b7bf48e2553909c76c1edb51be6ead95 | /AttendanceApp/src/edu/upenn/cis350/AttendanceAppActivityTest.java | 641415a0a0bdbf65084b3b7b3677eb04ee35d3a7 | [] | no_license | jkodner05/NetterProject | b65b4069b7a1235e72a96cf447eb7733daab5f23 | 3938985de455bd6da188b30f2d6d87b537001653 | refs/heads/master | 2021-01-15T21:02:50.559741 | 2012-03-10T00:21:02 | 2012-03-10T00:21:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package edu.upenn.cis350;
import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.Button;
import android.widget.ListView;
public class AttendanceAppActivityTest extends
ActivityInstrumentationTestCase2<AttendanceAppActivity>
{
public AttendanceAppActivityTest(Class<AttendanceAppActivity> activityClass)
{
super(activityClass);
}
}
| [
"jkodner05@yahoo.com"
] | jkodner05@yahoo.com |
5c8a73c351b566f8c4e34b83f472387e8804f46b | 7d1ce974b4e0f0a7ab775083c3044b2309eee3ed | /ch07Classloading/BootstrapClassLoader.java | 88e6b453d1cf7e3dd0c2b9c6ad4011f5381568b7 | [] | no_license | 724399396/understanding-the-jvm | 65ef2b06a78c75890e00d59786b17e8578d4fcdb | 5da3a636753f104b8508a6cb701e4ded69290441 | refs/heads/master | 2021-01-10T20:43:32.668563 | 2015-02-15T04:06:19 | 2015-02-15T04:06:19 | 30,784,917 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 901 | java | package ch07Classloading;
import sun.security.util.SecurityConstants;
/**
* Created by liwei on 15-2-13.
*/
public class BootstrapClassLoader {
/**
* Returns the class loader for the class. Some implementations may use null
* to represent the bootstrap class loader. This method will return null in such
* implementations if this class was loaded by the bootstrap class loader.
*/
public ClassLoader getClassLoader() {
ClassLoader cl = getClassLoader();
if (cl == null)
return null;
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
// ClassLoader ccl = ClassLoader.getCallerClassLoader();
// if (ccl != null && ccl != cl && cl.isAncesstor(ccl)) {
// sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
// }
}
return cl;
}
}
| [
"724399396@qq.com"
] | 724399396@qq.com |
0c3d81433fd7d6dd28ce88469066b60577d441b8 | 65b62333d774905e886063db583ff283f2bccffb | /RegMed/Core/src/pojo/File.java | 3ade34e5119192a04014461e5425be0a219c4652 | [] | no_license | mjochab/-Programowanie_zespolowe_2018_gr1 | 0590c7e83aeb4270c0fd32f0f5063dd6dc41ec6c | 0b7010733b88ce12208d5b9874bda058cfd68062 | refs/heads/master | 2021-04-27T00:16:00.482980 | 2018-06-06T14:05:04 | 2018-06-06T14:05:04 | 123,781,756 | 1 | 3 | null | 2018-06-06T14:05:05 | 2018-03-04T11:23:34 | Java | UTF-8 | Java | false | false | 930 | java | package pojo;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class File {
private int id;
private Patient patient;
private Doctor doctor;
private LocalDateTime date;
private String history;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Patient getPatient() {
return patient;
}
public void setPatient(Patient patient) {
this.patient = patient;
}
public Doctor getDoctor() {
return doctor;
}
public void setDoctor(Doctor doctor) {
this.doctor = doctor;
}
public LocalDateTime getDate() {
return date;
}
public void setDate(LocalDateTime date) {
this.date = date;
}
public String getHistory() {
return history;
}
public void setHistory(String history) {
this.history = history;
}
}
| [
"szymus_k4a@wp.pl"
] | szymus_k4a@wp.pl |
f486b586961a8f820fa3b318066ae1bd192e4d20 | b6348b1d326e2ab442c7fb9ef1cec04da1f8f0b7 | /app/src/main/java/com/appavate/motoparking/MapsActivity.java | 42b1df754ec4fd5493ba9d0d8d9f672286dccad9 | [] | no_license | nzjjay/AucklandMotoParking | 8023d709b5e36465f251a8acba4c5f049637e3c9 | c9cb66ee7c91aa2610230fc0530aa2b5146c51eb | refs/heads/master | 2021-05-29T18:09:33.246924 | 2015-09-15T08:47:07 | 2015-09-15T08:47:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,159 | java | package com.appavate.motoparking;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.util.Xml;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import org.xmlpull.v1.XmlPullParser;
import java.io.InputStream;
public class MapsActivity extends ActionBarActivity {
private GoogleMap mMap; // Might be null if Google Play services APK is not available.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
setUpMapIfNeeded();
ManageAd();
}
@Override
protected void onResume() {
super.onResume();
setUpMapIfNeeded();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
// Leave this alone - works
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
/*case R.id.action_add:
Intent aIntent = new Intent(this, Add.class);
startActivity(aIntent);
break;*/
case R.id.action_about:
Intent bIntent = new Intent(this, About.class);
startActivity(bIntent);
break;
}
return true;
}
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker arg0) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
View myContentView = getLayoutInflater().inflate(
R.layout.custommarker, null);
TextView tvTitle = ((TextView) myContentView
.findViewById(R.id.title));
tvTitle.setText(marker.getTitle());
TextView tvSnippet = ((TextView) myContentView
.findViewById(R.id.snippet));
tvSnippet.setText(marker.getSnippet());
return myContentView;
}
});
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
private void setUpMap() {
SetLocation();
try
{
InputStream is = getAssets().open("cbd.xml");
XmlPullParser xpp = Xml.newPullParser();
xpp.setInput(is, null);
int eventType = xpp.getEventType();
String name = "";
String description = "";
// String coordinates = "";
double lat = 0;
double lon = 0;
while (eventType != XmlPullParser.END_DOCUMENT) {
if(eventType == XmlPullParser.START_TAG) {
//We look for "title" tag in XML response
if (xpp.getName().equalsIgnoreCase("name")) {
name = xpp.nextText();
}
if (xpp.getName().equalsIgnoreCase("description")) {
description = xpp.nextText();
}
if (xpp.getName().equalsIgnoreCase("coordinates")) {
String coordinates = xpp.nextText();
String[] separated = coordinates.split(",");
lon = Double.parseDouble(separated[0]);
lat = Double.parseDouble(separated[1]);
}
}
if(!name.equals("") && !description.equals("") && lat != 0 && lon != 0)
{
mMap.addMarker(CreateMarker(lat, lon, name, description));
}
eventType = xpp.next();
}
// indicate app done reading the resource.
// xpp.close();
}
catch (Exception e)
{
Log.d("EXCEPT", "Exception in parsing " + e);
}
// This is where things are added
// mMap.addMarker(CreateMarker(-36.850868, 174.764414, "TEST", "TEST DESCRIPTION"));
}
// WORKS
private MarkerOptions CreateMarker(double lat, double lon, String title, String description)
{
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(new LatLng(lat, lon));
markerOptions.title(title);
markerOptions.snippet(description);
return markerOptions;
}
// WORKS
private void SetLocation()
{
CameraUpdate point = CameraUpdateFactory.newLatLngZoom(new LatLng(-36.8508, 174.76), 15);
// moves camera to coordinates
mMap.moveCamera(point);
// animates camera to coordinates
mMap.animateCamera(point);
}
// JAY - Leave this alone - works
private void ManageAd()
{
// Ads and Payment verification area
AdView adView = (AdView) this.findViewById(R.id.adView);
// ScrollView _scrollView = (ScrollView) this.findViewById(R.id._scrollview);
SharedPreferences myPrefs = getSharedPreferences("Pref", MODE_PRIVATE);
Boolean paid = myPrefs.getBoolean("paid", false);
// Boolean paid = false;
if(paid == false)
{
// Look up the AdView as a resource and load a request.
AdRequest adRequest = new AdRequest.Builder().build();
adView.setVisibility(AdView.VISIBLE);
adView.loadAd(adRequest);
}
else if (paid == true)
{
adView.destroy();
if (adView.getVisibility() == AdView.VISIBLE)
{
adView.setVisibility(AdView.GONE);
// _scrollView.setLayoutParams(new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
}
}
}
}
| [
"jay-j@live.com"
] | jay-j@live.com |
1112a16053f27eeb6fb68945e663dbef6e964d42 | 8432f98324de92cba5f379d27fd7f33053edff33 | /app/src/main/java/com/example/memo/timerdemo/MainActivity.java | 893c96220395af19c747437bb4f4ddd806edee94 | [] | no_license | memocool/Timer | 0d7013e3a8010e540ebda92bbe4bc2a78ef6ed04 | 818ba1a9bc580dfc3619e3777f8861295350df80 | refs/heads/master | 2021-01-01T03:53:01.180469 | 2016-04-20T13:14:41 | 2016-04-20T13:14:41 | 56,688,083 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,260 | java | package com.example.memo.timerdemo;
import android.os.CountDownTimer;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new CountDownTimer(10000, 1000) {
public void onTick(long millesecondsuntildone) {
// when the counting down counting ( every second )
Log.i("Seconds Left" , String.valueOf(millesecondsuntildone / 1000));
}
public void onFinish() {
// when the counter is finished
Log.i("Done", " Count down is finished");
}
}.start();
}
/*final Handler handler = new Handler();
Runnable run = new Runnable() {
@Override
public void run() {
// Insert code to be run every second
Log.i("Runnable has run", "Running");
handler.postDelayed(this , 1000);
}
};
handler.post(run);
}
*/
}
| [
"geek_techno@yahoo.com"
] | geek_techno@yahoo.com |
35eec639076b33e6a4d1b6fa7a5fa38ac6b9a325 | 2668441a255ebb3c229dee35be44a5c97c502dcb | /src/android/CertificateTrustManager.java | d2f3b08628a71207d98465b99b71e2e32f3846de | [
"MIT"
] | permissive | AdorkDean/countly-sdk-js | 817628d5df467c53e78e52ffb6cde14b8689fddf | b9488065761fe7cf98aec4756afeefcbdb399fe5 | refs/heads/master | 2021-06-13T06:34:21.836021 | 2017-02-23T05:55:09 | 2017-02-23T05:55:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,248 | java | package ly.count.android.sdk;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
/**
* Created by artem on 11/06/15. Taken from https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning
*/
// Many thanks to Nikolay Elenkov for feedback.
// Shamelessly based upon Moxie's example code (AOSP/Google did not offer code)
// http://www.thoughtcrime.org/blog/authenticity-is-broken-in-ssl-but-your-app-ha/
public final class CertificateTrustManager implements X509TrustManager {
// DER encoded public key
private final List<byte[]> keys;
public CertificateTrustManager(List<String> certificates) throws CertificateException {
if (certificates == null || certificates.size() == 0) {
throw new IllegalArgumentException("You must specify non-empty keys list");
}
this.keys = new ArrayList<>();
for (String key : certificates) {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Certificate cert = cf.generateCertificate(new ByteArrayInputStream(Base64.decode(key, Base64.DEFAULT)));
this.keys.add(cert.getPublicKey().getEncoded());
}
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
if (chain == null) {
throw new IllegalArgumentException("PublicKeyManager: X509Certificate array is null");
}
if (!(chain.length > 0)) {
throw new IllegalArgumentException("PublicKeyManager: X509Certificate is empty");
}
if (!(null != authType && authType.contains("RSA"))) {
throw new CertificateException("PublicKeyManager: AuthType is not RSA");
}
// Perform customary SSL/TLS checks
TrustManagerFactory tmf;
try {
tmf = TrustManagerFactory.getInstance("X509");
tmf.init((KeyStore) null);
for (TrustManager trustManager : tmf.getTrustManagers()) {
((X509TrustManager) trustManager).checkServerTrusted(chain, authType);
}
} catch (Exception e) {
throw new CertificateException(e);
}
byte server[] = chain[0].getPublicKey().getEncoded();
for (byte[] key : keys) {
if (Arrays.equals(key, server)) {
return;
}
}
throw new CertificateException("Public keys didn't pass checks");
}
public void checkClientTrusted(X509Certificate[] xcs, String string) {
// throw new
// UnsupportedOperationException("checkClientTrusted: Not supported yet.");
}
public X509Certificate[] getAcceptedIssuers() {
// throw new
// UnsupportedOperationException("getAcceptedIssuers: Not supported yet.");
return null;
}
}
| [
"trinisofttechnologies@gmail.com"
] | trinisofttechnologies@gmail.com |
c7f4a82fb5bab9b28a7ab84b7246e673e61031f8 | 048f731b8914fa175eb14c6b95b7ce38eb61eb79 | /microservicios-usuarios/src/main/java/com/example/microserviciosusuarios/client/CursoFeignClient.java | d143eec6f65b180f90b1fbd514761b53118dea0a | [] | no_license | Selphyz/microservicios-spring-eureka | 2fccb2371fb43bc3ed0a297bb35f56f0b639bc35 | f8038fdb14d11e5727f4152fc4f90673eb59d460 | refs/heads/main | 2023-08-11T00:53:43.364651 | 2021-09-13T23:46:42 | 2021-09-13T23:46:42 | 402,212,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.example.microserviciosusuarios.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
@FeignClient(name = "microservicio-cursos")
public interface CursoFeignClient {
@DeleteMapping("/eliminar-alumno/{id}")
public void eliminarCursoAlumnoPorId(@PathVariable Long id);
}
| [
"carlos.dom13@hotmail.com"
] | carlos.dom13@hotmail.com |
9f1742e2ea105b81f6c8d07e9a112f4986787706 | 821dbb3ae4ed9f0f4bca33b86be3e5a2b56b99e3 | /src/com/collection/class27/Demo1.java | aa89e2a017c035f7b4dba6ea387a5770447602ec | [] | no_license | EhsanullahAsim/SDETJavaBatch10 | d267e8c053b0bccb4353473283878e5f53bfe810 | cb04a54b46c8b8d1852e68caf0f31ca684122729 | refs/heads/master | 2023-08-04T09:30:33.261335 | 2021-09-19T19:12:18 | 2021-09-19T19:12:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | package com.collection.class27;
public abstract class Demo1 {
public static void main(String[] args) {
}
}
| [
"asghar@syntaxtech.com"
] | asghar@syntaxtech.com |
6e627bc2ef79885f163e05a1632b3ca7b6947e94 | 3367419e05bc8cb492c2e35603180adfe13073cf | /src/main/java/com/thoughtworks/bank/domain/AbstractAuditingEntity.java | bc55f8482f19cd96b2b3b726802f4574bb79f6b3 | [] | no_license | bharatak/jhipster-demo | 0582844bb13b7f75f61d01dc8c7cb6db37c15e90 | c00f11803cedc9cfa3c31c1d7243fc1b6b45a5aa | refs/heads/master | 2022-12-15T08:52:16.431739 | 2020-09-15T01:17:36 | 2020-09-15T01:19:53 | 295,579,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,175 | java | package com.thoughtworks.bank.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.io.Serializable;
import java.time.Instant;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
/**
* Base abstract class for entities which will hold definitions for created, last modified, created by,
* last modified by attributes.
*/
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@CreatedBy
@Column(name = "created_by", nullable = false, length = 50, updatable = false)
@JsonIgnore
private String createdBy;
@CreatedDate
@Column(name = "created_date", updatable = false)
@JsonIgnore
private Instant createdDate = Instant.now();
@LastModifiedBy
@Column(name = "last_modified_by", length = 50)
@JsonIgnore
private String lastModifiedBy;
@LastModifiedDate
@Column(name = "last_modified_date")
@JsonIgnore
private Instant lastModifiedDate = Instant.now();
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
}
| [
"bharatak@thoughtworks.com"
] | bharatak@thoughtworks.com |
c45f83d5df89bd635cf9427a4f8989a7c3d73ba6 | c019d248921402edc252461845122bfdb6f60b5e | /app/src/main/java/com/example/hungrykya/ui/collection/list/CollectionRestaurantList.java | 6971462ffe2a0a7d376419a4e6fe727c8fb85a02 | [] | no_license | abhishal76/HungryKya | 35116f680709b2f62fe634a83f9235d1a556b4ec | dc2548fe5b01b2cd5e9434c1d23e49f148fd25ac | refs/heads/master | 2022-04-03T15:07:57.342385 | 2019-11-29T19:33:17 | 2019-11-29T19:33:17 | 224,912,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,251 | java | package com.example.hungrykya.ui.collection.list;
import android.content.Intent;
import android.os.Bundle;
import com.example.hungrykya.Modal.modal.Restaurant.Photo;
import com.example.hungrykya.Modal.modal.Restaurant.Restaurant;
import com.example.hungrykya.Modal.modal.Restaurant.RestaurantList;
import com.example.hungrykya.api.ZomataApi;
import com.example.hungrykya.ui.collection.CollectionRestaurantDetailActivity;
import com.example.hungrykya.ui.collection.adapter.CollectionRestaurantListAdapter;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import android.os.Parcelable;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.example.hungrykya.R;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CollectionRestaurantList extends AppCompatActivity {
ZomataApi zomataApi;
ArrayList<Restaurant> restaurantArrayList = new ArrayList<>();
ListView resCollectionListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_collection_restaurant_list);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Intent getCollectionIdIntent = getIntent();
String collectionId =getCollectionIdIntent.getStringExtra("collection_id");
final Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://developers.zomato.com/api/v2.1/")
.addConverterFactory(GsonConverterFactory.create())
.build();
zomataApi = retrofit.create(ZomataApi.class);
resCollectionListView = findViewById(R.id.resCollectionLV);
Call<RestaurantList> collectionRestaurantListCall = zomataApi.getCollectionRestaurant("0a1faec1157469592a4ba67285a7c837", collectionId,
Double.valueOf(getCollectionIdIntent.getStringExtra("lat")) , Double.valueOf(getCollectionIdIntent.getStringExtra("lon")));
collectionRestaurantListCall.enqueue(new Callback<RestaurantList>() {
@Override
public void onResponse(Call<RestaurantList> call, Response<RestaurantList> response) {
if (response.code() == 200){
RestaurantList restaurantList = response.body();
for (int i = 0; i<restaurantList.getRestaurants().size(); i++){
restaurantArrayList.add(restaurantList.getRestaurants().get(i));
}
CollectionRestaurantListAdapter collectionRestaurantListAdapter =
new CollectionRestaurantListAdapter(getApplicationContext(), R.layout.restaurant_collection, restaurantArrayList );
resCollectionListView.setAdapter(collectionRestaurantListAdapter);
resCollectionListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
String resName = restaurantArrayList.get(i).getRestaurant().getName();
String resAddress = restaurantArrayList.get(i).getRestaurant().getLocation().getAddress();
String resLocality = restaurantArrayList.get(i).getRestaurant().getLocation().getLocality();
String resCuisines = restaurantArrayList.get(i).getRestaurant().getCuisines();
String resAverageCost = restaurantArrayList.get(i).getRestaurant().getAverageCostForTwo().toString();
String resTimings = restaurantArrayList.get(i).getRestaurant().getTimings();
ArrayList<String> resHighlights = restaurantArrayList.get(i).getRestaurant().getHighlights();
String resRating = restaurantArrayList.get(i).getRestaurant().getUserRating().getAggregateRating();
ArrayList<Photo> test =restaurantArrayList.get(i).getRestaurant().getPhotos();
Intent collectionRestaurantActivityIntent = new Intent(view.getContext(), CollectionRestaurantDetailActivity.class);
collectionRestaurantActivityIntent.putExtra("resName", resName);
collectionRestaurantActivityIntent.putExtra("resAddress", resAddress);
collectionRestaurantActivityIntent.putExtra("resLocality", resLocality);
collectionRestaurantActivityIntent.putExtra("resCuisines", resCuisines);
collectionRestaurantActivityIntent.putExtra("resAverageCost", resAverageCost);
collectionRestaurantActivityIntent.putExtra("resTimings", resTimings);
collectionRestaurantActivityIntent.putExtra("resRating", resRating);
collectionRestaurantActivityIntent.putStringArrayListExtra("resHighlights", resHighlights);
collectionRestaurantActivityIntent.putExtra("test",(ArrayList<Photo>) test );
startActivity(collectionRestaurantActivityIntent);
}
});
}
else
{
Log.e("RETRY", "retry");
}
}
@Override
public void onFailure(Call<RestaurantList> call, Throwable t) {
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home){
this.finish();
}
return true;
}
}
| [
"asaini@taximagic.com"
] | asaini@taximagic.com |
d74ab3b25325d083189ea83c361840f93c864f88 | e73906122b5a58c9e77420fb69cea7e00584df7a | /InfTech2/src/Doubles/Wort.java | 994ad1e12cb33ed741217f4344bffab92aa2d5b7 | [] | no_license | tbuz/Java-Projects | 2b7916e46dbcd4be850a23bf323d4b7b2e8d498b | c922ec48f74e3c9be9786e530e4d2647eb227152 | refs/heads/master | 2020-12-24T20:52:16.373551 | 2017-06-08T18:17:41 | 2017-06-08T18:17:41 | 56,684,112 | 1 | 0 | null | 2016-04-20T13:19:02 | 2016-04-20T12:16:05 | Java | UTF-8 | Java | false | false | 456 | java |
public class Wort implements Text{
//Klassenattribut wird initialisiert:
private String w;
//Der Konstruktor weist den Parameter dem Attribut zu:
public Wort (String w){
this.w = new String(w);
}
//Getter-Methode fuer w:
public String getText(){
return this.w;
}
//Fuegt w einen weiteren Text hinzu:
public void append(Text txt){
this.w += txt;
}
//toString-Methode wird überschrieben:
public String toString(){
return this.w;
}
}
| [
"buz_tolga@yahoo.de"
] | buz_tolga@yahoo.de |
f84c943fcc5c98f2a60359cf9a61e25f6026f281 | 285127619284cf04c6e8cbd6484dbbb87d699823 | /plugin/src/main/java/git4idea/crlf/GitCrlfUtil.java | 43c6f92098f8cffe208bdaf3a51ac01d7d4048d4 | [
"Apache-2.0"
] | permissive | consulo/consulo-git | c1bc36d8ef053aaed34d991b73e23eafe864bba5 | 39835384bc64a00baadd8a301aa18abd1e051e21 | refs/heads/master | 2023-08-18T23:20:48.918195 | 2023-06-14T06:59:28 | 2023-06-14T06:59:28 | 13,809,557 | 0 | 0 | null | 2015-02-20T22:22:44 | 2013-10-23T17:25:01 | Java | UTF-8 | Java | false | false | 828 | java | /*
* Copyright 2000-2012 JetBrains s.r.o.
*
* 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 git4idea.crlf;
import consulo.application.util.SystemInfo;
/**
* @author Kirill Likhodedov
*/
public class GitCrlfUtil {
public static final String RECOMMENDED_VALUE = SystemInfo.isWindows ? "true" : "input";
}
| [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
977abd1515ae0b0275872ee9f2383ebd7048af8b | 601f5cdd5125a1602ae31ce90bfda4b062e0b4d7 | /app/src/main/java/com/example/android/popularmovies/Utility.java | 8c9da21a3072bfb4da5233a2c1f7c3e346219e15 | [] | no_license | ranjeevmahtani/Popular-Movies | d4f86b79ab561d93ca2d895e596728d786d74511 | b2a0941848dbe9a81fc44fad37bfd96977dae6fa | refs/heads/master | 2021-01-19T13:24:28.628810 | 2015-08-28T23:18:01 | 2015-08-28T23:18:01 | 39,053,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,280 | java | package com.example.android.popularmovies;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
* Created by ranjeevmahtani on 7/27/15.
*/
public class Utility {
final static String LOG_TAG = Utility.class.getSimpleName();
public static URL getSearchQueryUrl(Context context, String query){
try {
String encodedQuery = URLEncoder.encode(query,"UTF-8");
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("api.themoviedb.org")
.appendPath("3")
.appendPath("search")
.appendPath("movie")
.appendQueryParameter("query", encodedQuery)
.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key));
return new URL(builder.build().toString());
} catch (MalformedURLException e) {
Log.e(LOG_TAG,e.getMessage());
} catch (UnsupportedEncodingException e) {
Log.e(LOG_TAG,e.getMessage());
}
return null;
}
public static URL getDiscoveryQueryUrl(Context context, String sortOption) {
try {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("api.themoviedb.org")
.appendPath("3");
if (sortOption.equals(context.getString(R.string.API_param_now_playing))
|| sortOption.equals(context.getString(R.string.API_param_upcoming))) {
builder.appendPath("movie")
.appendPath(sortOption);
} else {
builder.appendPath("discover")
.appendPath("movie")
.appendQueryParameter(context.getString(R.string.API_query_sort_by), sortOption)
.appendQueryParameter("vote_count.gte", "25"); // hard-coded minimum vote count
}
builder.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key));
return new URL(builder.build().toString());
} catch (IOException e) {
Log.e(LOG_TAG, "Error ", e);
return null;
}
}
public static URL getCastQueryUrl(Context context, long movieId) {
try {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("api.themoviedb.org")
.appendPath("3")
.appendPath("movie")
.appendPath(String.valueOf(movieId))
.appendPath("credits")
.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key));
return new URL(builder.build().toString());
} catch (IOException e) {
Log.e(LOG_TAG, "Error ", e);
return null;
}
}
public static URL getVideoQueryUrl(Context context, long movieId) {
try {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("api.themoviedb.org")
.appendPath("3")
.appendPath("movie")
.appendPath(String.valueOf(movieId))
.appendPath("videos")
.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key));
return new URL(builder.build().toString());
} catch (IOException e) {
Log.e(LOG_TAG, "Error ", e);
return null;
}
}
public static URL getReviewQueryUrl(Context context, long movieId) {
final String LOG_TAG = "getReviewQueryUrl(...)";
try {
Uri.Builder builder = new Uri.Builder();
builder.scheme("http")
.authority("api.themoviedb.org")
.appendPath("3")
.appendPath("movie")
.appendPath(String.valueOf(movieId))
.appendPath("reviews")
.appendQueryParameter(context.getString(R.string.API_key_query_param), context.getString(R.string.API_key));
// Log.v(LOG_TAG, builder.build().toString());
return new URL(builder.build().toString());
} catch (IOException e) {
Log.e(LOG_TAG, "Error ", e);
return null;
}
}
public static Movie[] getMovieArrayFromJsonStr(String moviesDataStr) throws JSONException {
// These are the names of the JSON objects that need to be extracted.
final String TMDB_MOVIES_LIST = "results";
final String TMDB_MOVIE_ID = "id";
final String TMDB_TITLE = "original_title";
final String TMDB_POSTER_PATH = "poster_path";
final String TMDB_PLOT_SYNOPSIS = "overview";
final String TMDB_USER_RATING = "vote_average";
final String TMDB_RELEASE_DATE = "release_date";
final String TMDB_VOTE_COUNT = "vote_count";
JSONObject moviesJsonResult = new JSONObject(moviesDataStr);
JSONArray moviesJsonArray = moviesJsonResult.getJSONArray(TMDB_MOVIES_LIST);
//Create an array of movie objects to store relevant details from the JSON results
Movie[] moviesObjectArray = new Movie[moviesJsonArray.length()];
//for each movie in the JSON array, create a Movie object and store the relevant details
for (int i = 0; i < moviesJsonArray.length(); i++) {
Movie movie = new Movie();
// Get the JSON object representing the movie
JSONObject movieJson = moviesJsonArray.getJSONObject(i);
//Set movie details to the movie object
movie.setTmdbId(movieJson.getInt(TMDB_MOVIE_ID));
movie.setMovieTitle(movieJson.getString(TMDB_TITLE));
movie.setMoviePosterPath(movieJson.getString(TMDB_POSTER_PATH));
movie.setMovieSynopsis(movieJson.getString(TMDB_PLOT_SYNOPSIS));
movie.setMovieUserRating(movieJson.getDouble(TMDB_USER_RATING));
movie.setMovieReleaseDate(movieJson.getString(TMDB_RELEASE_DATE));
movie.setVoteCount(movieJson.getInt(TMDB_VOTE_COUNT));
moviesObjectArray[i] = movie;
//Log.v(LOG_TAG,"Movie " + i + ": " + moviesObjectArray[i].getMovieTitle());
}
return moviesObjectArray;
}
public static void saveMovieCastInfo(Movie movie, URL castQueryUrl) throws JSONException {
try {
final String TMDB_CAST_LIST = "cast";
final String TMDB_CAST_NAME_KEY = "name";
String castQueryResponseStr = requestDataFromApi(castQueryUrl);
if (castQueryResponseStr != null && !castQueryResponseStr.equals("")) {
JSONObject castQueryResponseJson = new JSONObject(castQueryResponseStr);
JSONArray castJsonArray = castQueryResponseJson.getJSONArray(TMDB_CAST_LIST);
if (castJsonArray.length() == 0) {
movie.setNoCast();
} else {
int castArraySize = Math.min(3,castJsonArray.length());
String[] movieCast = new String[castArraySize];
for (int i = 0; i < castArraySize; i++) {
String castMember = castJsonArray.getJSONObject(i).getString(TMDB_CAST_NAME_KEY);
movieCast[i] = castMember;
}
movie.setCastArray(movieCast);
}
} else {
movie.setNoCast();
}
} catch (JSONException e) {
Log.e(LOG_TAG, "Error ", e);
}
}
public static void saveMovieVideoInfo(Movie movie, URL videoQueryUrl) throws JSONException {
final String LOG_TAG = "saveMovieVideoInfo(...)";
try {
final String TMDB_VIDEOS_LIST = "results";
final String TMDB_VIDEO_KEY = "key";
final String TMDB_VIDEO_NAME = "name";
String videosQueryResponseStr = requestDataFromApi(videoQueryUrl);
if (videosQueryResponseStr != null && !videosQueryResponseStr.equals("")) {
JSONObject videosQueryResponseJson = new JSONObject(videosQueryResponseStr);
JSONArray videosJsonArray = videosQueryResponseJson.getJSONArray(TMDB_VIDEOS_LIST);
if (videosJsonArray.length() == 0) {
movie.setNoVideos();
} else {
for (int i = 0; i < videosJsonArray.length(); i++) {
JSONObject video = videosJsonArray.getJSONObject(i);
String[] videoInfo = {
video.getString(TMDB_VIDEO_KEY),
video.getString(TMDB_VIDEO_NAME)
};
movie.addVideo(videoInfo);
// Log.v(LOG_TAG, movie.getMovieTitle());
// Log.v(LOG_TAG, movie.getVideos());
}
}
} else {
movie.setNoVideos();
}
} catch (JSONException e) {
Log.e(LOG_TAG, "Error ", e);
}
}
public static void saveMovieReviews(Movie movie, URL reviewsQueryUrl) throws JSONException {
final String LOG_TAG = "saveMovieReviews(...)";
try {
final String TMDB_REVIEWS_LIST = "results";
final String TMDB_REVIEW_AUTHOR = "author";
final String TMDB_REVIEW_CONTENT = "content";
String reviewsQueryResponseStr = requestDataFromApi(reviewsQueryUrl);
if (reviewsQueryResponseStr != null && !reviewsQueryResponseStr.equals("")) {
JSONObject reviewsQueryResponseJson = new JSONObject(reviewsQueryResponseStr);
JSONArray reviewsJsonArray = reviewsQueryResponseJson.getJSONArray(TMDB_REVIEWS_LIST);
if (reviewsJsonArray.length() == 0) {
movie.setNoReviews();
} else {
for (int i = 0; i < reviewsJsonArray.length(); i++) {
JSONObject review = reviewsJsonArray.getJSONObject(i);
String reviewAuthor = review.getString(TMDB_REVIEW_AUTHOR);
if (reviewAuthor == null || reviewAuthor.equals("")) {
reviewAuthor = "anonymous";
}
String[] reviewInfo = {
reviewAuthor,
review.getString(TMDB_REVIEW_CONTENT)
};
movie.addReview(reviewInfo);
// Log.v(LOG_TAG, movie.getMovieTitle());
// Log.v(LOG_TAG, movie.getVideos());
}
}
} else {
movie.setNoReviews();
}
} catch (JSONException e) {
Log.e(LOG_TAG, "Error ", e);
}
}
public static String requestDataFromApi(URL queryURL) {
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String moviesJsonStr = null;
try {
// Create the request to themovieDB, and open the connection
urlConnection = (HttpURLConnection) queryURL.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.connect();
// Read the input stream into a String
InputStream inputStream = urlConnection.getInputStream();
StringBuffer buffer = new StringBuffer();
if (inputStream == null) {
// Nothing to do.
return null;
}
reader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
// Since it's JSON, adding a newline isn't necessary (it won't affect parsing)
// But it does make debugging a *lot* easier if you print out the completed
// buffer for debugging.
buffer.append(line + "\n");
}
if (buffer.length() == 0) {
// Stream was empty. No point in parsing.
return null;
}
moviesJsonStr = buffer.toString();
//Log.v(LOG_TAG, moviesJsonStr);
return moviesJsonStr;
} catch (IOException e) {
Log.e(LOG_TAG, "Error ", e);
// If the code didn't successfully get the movies data, there's no point in attempting
// to parse it.
return null;
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
if (reader != null) {
try {
reader.close();
} catch (final IOException e) {
Log.e(LOG_TAG, "Error closing stream", e);
}
}
}
}
public static Uri getVideoUri(String videoId) {
final String YOUTUBE_BASE_URL = "http://youtube.com/watch?v=";
return Uri.parse(YOUTUBE_BASE_URL + videoId);
}
public static boolean isOnline(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting()) {
return true;
} else {
return false;
}
}
}
| [
"ranjeevmahtani@gmail.com"
] | ranjeevmahtani@gmail.com |
1c07c16109ce2c058b7c9abb2548639637b35ab3 | 3c048d15b17bb465426c8758b488befc6a8f26fd | /src/main/java/com/github/chen0040/leetcode/day17/medium/EvaluateDivision.java | da5fb89f87d3fcab420d07f5fa168ad45cf2315f | [
"MIT"
] | permissive | aspineonxyz/java-leetcode | d6b54565f5042535727a2b8986f13c56b0d010be | 83cc0ab474cb171cb3d6be869209b4a8c96857ea | refs/heads/master | 2020-07-16T04:23:01.528912 | 2017-08-20T03:29:50 | 2017-08-20T03:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,976 | java | package com.github.chen0040.leetcode.day17.medium;
import java.util.*;
/**
* Created by xschen on 12/8/2017.
*
* link: https://leetcode.com/problems/evaluate-division/description/
*/
public class EvaluateDivision {
static class Edge {
boolean inverse = false;
double value;
String from;
String to;
public Edge(String from, String to, double value, boolean inverse) {
this.from = from;
this.to = to;
this.value = value;
this.inverse = inverse;
}
public double compute() {
if(inverse) return 1.0 / value;
return value;
}
public String toString(){
return from + "->" + to;
}
}
static class Graph {
Map<String, List<Edge>> adjList = new HashMap<String, List<Edge>>();
public void addEdge(String from, String to, double value) {
Edge e1 = new Edge(from, to, value, false);
adj(from).add(e1);
Edge e2 = new Edge(to, from, value, true);
adj(to).add(e2);
}
public List<Edge> adj(String v){
List<Edge> adj_v = null;
if(adjList.containsKey(v)) {
adj_v = adjList.get(v);
} else {
adj_v = new ArrayList<Edge>();
adjList.put(v, adj_v);
}
return adj_v;
}
public double search(String s, String t) {
Set<String> marked = new HashSet<String>();
Queue<String> queue = new LinkedList<String>();
Map<String, Edge> edgeTo = new HashMap<String, Edge>();
Map<String, Double> costs = new HashMap<String, Double>();
queue.add(s);
costs.put(s, 0.0);
while(!queue.isEmpty()) {
String v = queue.remove();
marked.add(v);
if(v.equals(t)) {
break;
}
List<Edge> adj_v = adj(v);
for(Edge e : adj_v){
String w = e.to;
if(!costs.containsKey(w) || costs.get(w) > costs.get(v) + 1) {
edgeTo.put(w, e);
costs.put(w, costs.get(v) + 1);
if(!marked.contains(w)) {
queue.add(w);
}
}
}
}
if(marked.contains(t)){
String x = t;
Stack<Edge> stack = new Stack<Edge>();
while(!x.equals(s)) {
Edge e = edgeTo.get(x);
stack.push(e);
x = e.from;
}
List<Edge> path = new ArrayList<Edge>();
while(!stack.isEmpty()) {
path.add(stack.pop());
}
double result = 1.0;
for(int i=0; i < path.size(); ++i) {
result = result * path.get(i).compute();
}
return result;
} else {
return -1.0;
}
}
}
public class Solution {
public double[] calcEquation(String[][] equations, double[] values, String[][] queries) {
Set<String> known = new HashSet<String>();
Graph g = new Graph();
for(int i=0; i < equations.length; ++i) {
String[] equation = equations[i];
String from = equation[0];
String to = equation[1];
known.add(from);
known.add(to);
double value = values[i];
g.addEdge(from, to, value);
}
double[] result = new double[queries.length];
for(int i=0; i < queries.length; ++i) {
String[] query = queries[i];
String from = query[0];
String to = query[1];
if(from.equals(to)) {
if(!known.contains(from)) {
result[i] = -1.0;
} else {
result[i] = 1.0;
}
} else {
result[i] = g.search(from, to);
}
}
return result;
}
}
}
| [
"xs0040@gmail.com"
] | xs0040@gmail.com |
bb39cf360d472c387f96d4dfa28c343c9cf8f5e5 | 9fa866bd96f7d56beb8b8478c49862fbc0c86f7e | /app/src/main/java/co/i014114/www/toolbar/MainActivity.java | 111ab06f8ba46a74e61f2c7aa8c2014ebbd797b1 | [] | no_license | SantiagoAlvarezA/ToolBar | eea7a401e711d54ec16592e1b6f32aef8aad7654 | 9388a96d6513c31dac1fec99880b61d32946fdd0 | refs/heads/master | 2021-07-16T18:06:17.364984 | 2017-10-24T04:38:50 | 2017-10-24T04:38:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,246 | java | package co.i014114.www.toolbar;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.tolbar1);
showToolbar(getResources().getString(R.string.str_tb_p1));
}
public void showToolbar(String titulo) {
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(titulo);
}
@Override
public boolean onCreateOptionsMenu(Menu mimenu) {
getMenuInflater().inflate(R.menu.mimenu, mimenu);
return super.onCreateOptionsMenu(mimenu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
showpantallaDos();
return super.onOptionsItemSelected(item);
}
public void showpantallaDos(){
Intent intent= new Intent(getApplicationContext(), Pantalla2.class );
startActivity(intent);
}
}
| [
"aalvarez3570@gmail.com"
] | aalvarez3570@gmail.com |
dab2412fd37fedf9688aee387cb82e9c5b61ebda | 43d40f5422d69feb79607164581f713830424801 | /src/main/java/com/jojoldu/book/springboot/domain/posts/PostsRepository.java | 582a48c303b6651569089c3f57dbf419c33e7d08 | [] | no_license | syleemk/freelec-springboot2-webservice | e45221a7a431d1a7b6329fb3d858171394fd1412 | 6eba508b394d027245333e3f57e9529f2133dd9a | refs/heads/master | 2022-12-18T01:56:56.673791 | 2020-09-23T15:49:47 | 2020-09-23T15:49:47 | 283,802,525 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package com.jojoldu.book.springboot.domain.posts;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
// 보통 SQL Mapper(MyBatis같은)에서 Dao라고 불리는 DB Layer 접근자
// JPA에서는 Repository 라고 부르며 인터페이스로 생성
// 단순히 인터페이스 생성 후, JpaRepository<Entity 클래스, PK타입>를 상속하면 기본적인 CRUD메소드가 자동으로 생성
// @Repository 추가할 필요 없음
// Entity클래스와 기본 Entity Repository는 가은 위치에 있어야 함
public interface PostsRepository extends JpaRepository<Posts, Long> {
@Query("SELECT p FROM Posts p ORDER BY p.id DESC")
List<Posts> findAllDesc();
}
| [
"syleemk@gmail.com"
] | syleemk@gmail.com |
ffbb96fdb82122afad7c7b30ed46424b5fe03a45 | 87bef9b146288b8b6cd5e36ed1aec9f4aedf1db2 | /src/assignment2/Driver.java | 9fd38e01234862fa06d0c9108092fada97415b75 | [] | no_license | Australix/Mastermind-game | 642a4c22c6b38343bb17dfefe034533bc1bb223c | 3aba59282a9cc6f0372feea580f23b303daec983 | refs/heads/master | 2020-04-07T14:19:27.593336 | 2018-11-20T19:44:06 | 2018-11-20T19:44:06 | 158,442,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | /* * EE422C Project 2 (Mastermind) submission by
* Timberlon Gray
* tg22698
* Slip days used: <0>
* Spring 2017
*/
package assignment2;
import java.util.Scanner;
public class Driver {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
String input = "Y";
System.out.println("Welcome to Mastermind.");
// full game loop
while(input.equals("Y")){
System.out.println("Do you want to play a new game? (Y/N):");
input = keyboard.next();
if(input.equals("Y")) {
boolean cheatEnable;
if(args.length != 0 && args[0].equals("1"))
cheatEnable = true;
else
cheatEnable = false;
Game currentGame = Game.createGame(cheatEnable, keyboard);
currentGame.runGame();
}
}
keyboard.close();
}
}
| [
"graytimberlon@gmail.com"
] | graytimberlon@gmail.com |
67fd906b60b5d9ab6c8d1be23211465e1168c7a0 | 7e4896aaaafea60f29371adb928cf91af9689679 | /2018/proj1b/Palindrome.java | 02ea72f26363384a7c33b95c24150194cb746c52 | [] | no_license | curow/CS61B | cc70e7d06a63d4774f1edee38d3876ef19ccbf2c | 868f479ee088e3ae5b98697f903c5ef2e6d98a39 | refs/heads/master | 2021-01-01T01:36:16.270874 | 2020-03-29T15:57:25 | 2020-03-29T15:57:25 | 239,115,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | public class Palindrome {
public Deque<Character> wordToDeque(String word) {
Deque<Character> res = new LinkedListDeque<>();
for (char ch : word.toCharArray()) {
res.addLast(ch);
}
return res;
}
private boolean isPalindrome(Deque<Character> word,
CharacterComparator cc) {
if (word.isEmpty() || word.size() == 1) {
return true;
} else {
char first = word.removeFirst();
char last = word.removeLast();
return cc.equalChars(first, last) && isPalindrome(word, cc);
}
}
public boolean isPalindrome(String word, CharacterComparator cc) {
Deque<Character> wordDeque = wordToDeque(word);
return isPalindrome(wordDeque, cc);
}
public boolean isPalindrome(String word) {
return isPalindrome(word, (x, y) -> (x == y));
}
}
| [
"TiwazBiu@gmail.com"
] | TiwazBiu@gmail.com |
9c9db155748acb00b9aa1610ac7fb6120f703491 | 61f2cdcab3560712d3617855b83e5b4ddc799a39 | /CCF_Practice/src/cn/com/arith/PAT_1006.java | 757c0fdfab94a19fe5c920bd200c8335a3f7377e | [] | no_license | black111/repository | e66942f62e9581f89fa5ebff7276aed32b31d7dd | 15fadc0a08608f3e09709191f5ac18bbfc627360 | refs/heads/master | 2018-09-02T04:52:24.073247 | 2018-06-11T08:27:01 | 2018-06-11T08:27:01 | 107,487,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 450 | java | package cn.com.arith;
import java.util.Scanner;
public class PAT_1006 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int gewei=n%10;
n/=10;
int shiwei=n%10;
n/=10;
int baiwei=n;
for(int i=0;i<baiwei;i++){
System.out.print("B");
}
for(int i=0;i<shiwei;i++){
System.out.print("S");
}
for(int i=0;i<gewei;i++){
System.out.print(i+1);
}
}
}
| [
"lively0_0@hnu.edu.cn"
] | lively0_0@hnu.edu.cn |
4ca1a9b463118d7d0272a864f27e83bdf4ae3722 | 353d758f4936639c3e111aa02ac20591a86a214d | /src/lab3p2_franciscovilleda_12111170/Coordinador.java | b189c4b4cf9cf52225525ec7df54c46bb2c8f38d | [] | no_license | villefrancisco/Lab3P2_FranciscoVilleda | 856e0ee9868f08b8061dfa3af2245d46c82467fe | b44d83fc8c4a520344c4232825caaa7f8bdaaf12 | refs/heads/master | 2023-08-19T20:06:37.741746 | 2021-10-30T01:18:07 | 2021-10-30T01:18:07 | 422,688,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 615 | java |
package lab3p2_franciscovilleda_12111170;
import java.util.ArrayList;
public class Coordinador extends Entrenador{
ArrayList <Pokemon> pokemones = new ArrayList();
public Coordinador() {
}
public Coordinador(String nombre, String sexo, int edad) {
super(nombre, sexo, edad);
}
public ArrayList<Pokemon> getPokemones() {
return pokemones;
}
public void setPokemones(ArrayList<Pokemon> pokemones) {
this.pokemones = pokemones;
}
@Override
public String toString() {
return "Coordinador{" + "pokemones=" + pokemones + '}';
}
}
| [
"93373305+villefrancisco@users.noreply.github.com"
] | 93373305+villefrancisco@users.noreply.github.com |
9c523bf901855a44c859292a2c32844c877a33db | c42531b0f0e976dd2b11528504e349d5501249ae | /Hartsbourne/MHSystems/app/src/main/java/com/mh/systems/hartsbourne/web/models/CourseDiaryItemsCopy.java | 36831b068b74c19737f81c5fe18d554c132cb399 | [
"MIT"
] | permissive | Karan-nassa/MHSystems | 4267cc6939de7a0ff5577c22b88081595446e09e | a0e20f40864137fff91784687eaf68e5ec3f842c | refs/heads/master | 2021-08-20T05:59:06.864788 | 2017-11-28T08:02:39 | 2017-11-28T08:02:39 | 112,189,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,057 | java | package com.mh.systems.hartsbourne.web.models;
import java.util.ArrayList;
import java.util.List;
/**
* Created by karan@ucreate.co.in to load
* Course diary events items on 04-03-2016.
*/
public class CourseDiaryItemsCopy {
String Message;
String Result;
List<CourseDiaryDataCopy> Data = new ArrayList<>();
/**
* @return The Message
*/
public String getMessage() {
return Message;
}
/**
* @param Message The Message
*/
public void setMessage(String message) {
Message = message;
}
/**
* @return The Result
*/
public String getResult() {
return Result;
}
/**
* @param Result The Result
*/
public void setResult(String result) {
Result = result;
}
/**
* @return The MyAccountData
*/
public List<CourseDiaryDataCopy> getData() {
return Data;
}
/**
* @param Data The MyAccountData
*/
public void setData(List<CourseDiaryDataCopy> data) {
Data = data;
}
}
| [
"nitish@ucreate.co.in"
] | nitish@ucreate.co.in |
2d6a7944197019b398ebd409baf4bdb6621dc332 | 6d179acf22eba88bd3f6e3ab58b74a4a5ce0813c | /app/src/main/java/com/example/teamnaji/mhci/EnvironmentFragment.java | 203d03ec2375b875a4a66845e9b7688a029cbc32 | [] | no_license | gerardward3/mobhci | e7e9def84b5b8a80df7489ea6da925fcd16345f3 | 3bcab6d5c20c1ece39334747769ae17adbb91b62 | refs/heads/master | 2020-04-24T06:54:25.839714 | 2019-03-13T23:07:27 | 2019-03-13T23:07:27 | 171,780,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.example.teamnaji.mhci;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class EnvironmentFragment extends Fragment {
public EnvironmentFragment(){}
public static EnvironmentFragment newInstance(String param1, String param2) {
EnvironmentFragment fragment = new EnvironmentFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = inflater.inflate(R.layout.activity_environment, container, false);
return view;
}
}
| [
"dancristian.cecoi@gmail.com"
] | dancristian.cecoi@gmail.com |
71173f41cd7c299cace8e3d68c1278b501b799a8 | df134b422960de6fb179f36ca97ab574b0f1d69f | /it/unimi/dsi/fastutil/shorts/AbstractShortBigList.java | 6856e153bd81c81ef03ac91034ed375809d4256d | [] | no_license | TheShermanTanker/NMS-1.16.3 | bbbdb9417009be4987872717e761fb064468bbb2 | d3e64b4493d3e45970ec5ec66e1b9714a71856cc | refs/heads/master | 2022-12-29T15:32:24.411347 | 2020-10-08T11:56:16 | 2020-10-08T11:56:16 | 302,324,687 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 30,115 | java | /* */ package it.unimi.dsi.fastutil.shorts;
/* */
/* */ import it.unimi.dsi.fastutil.BigList;
/* */ import it.unimi.dsi.fastutil.BigListIterator;
/* */ import java.io.Serializable;
/* */ import java.util.Collection;
/* */ import java.util.Iterator;
/* */ import java.util.NoSuchElementException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public abstract class AbstractShortBigList
/* */ extends AbstractShortCollection
/* */ implements ShortBigList, ShortStack
/* */ {
/* */ protected void ensureIndex(long index) {
/* 40 */ if (index < 0L)
/* 41 */ throw new IndexOutOfBoundsException("Index (" + index + ") is negative");
/* 42 */ if (index > size64()) {
/* 43 */ throw new IndexOutOfBoundsException("Index (" + index + ") is greater than list size (" + size64() + ")");
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected void ensureRestrictedIndex(long index) {
/* 56 */ if (index < 0L)
/* 57 */ throw new IndexOutOfBoundsException("Index (" + index + ") is negative");
/* 58 */ if (index >= size64()) {
/* 59 */ throw new IndexOutOfBoundsException("Index (" + index + ") is greater than or equal to list size (" +
/* 60 */ size64() + ")");
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void add(long index, short k) {
/* 70 */ throw new UnsupportedOperationException();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean add(short k) {
/* 81 */ add(size64(), k);
/* 82 */ return true;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public short removeShort(long i) {
/* 92 */ throw new UnsupportedOperationException();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public short set(long index, short k) {
/* 102 */ throw new UnsupportedOperationException();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(long index, Collection<? extends Short> c) {
/* */ // Byte code:
/* */ // 0: aload_0
/* */ // 1: lload_1
/* */ // 2: invokevirtual ensureIndex : (J)V
/* */ // 5: aload_3
/* */ // 6: invokeinterface iterator : ()Ljava/util/Iterator;
/* */ // 11: astore #4
/* */ // 13: aload #4
/* */ // 15: invokeinterface hasNext : ()Z
/* */ // 20: istore #5
/* */ // 22: aload #4
/* */ // 24: invokeinterface hasNext : ()Z
/* */ // 29: ifeq -> 54
/* */ // 32: aload_0
/* */ // 33: lload_1
/* */ // 34: dup2
/* */ // 35: lconst_1
/* */ // 36: ladd
/* */ // 37: lstore_1
/* */ // 38: aload #4
/* */ // 40: invokeinterface next : ()Ljava/lang/Object;
/* */ // 45: checkcast java/lang/Short
/* */ // 48: invokevirtual add : (JLjava/lang/Short;)V
/* */ // 51: goto -> 22
/* */ // 54: iload #5
/* */ // 56: ireturn
/* */ // Line number table:
/* */ // Java source line number -> byte code offset
/* */ // #110 -> 0
/* */ // #111 -> 5
/* */ // #112 -> 13
/* */ // #113 -> 22
/* */ // #114 -> 32
/* */ // #115 -> 54
/* */ // Local variable table:
/* */ // start length slot name descriptor
/* */ // 0 57 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList;
/* */ // 0 57 1 index J
/* */ // 0 57 3 c Ljava/util/Collection;
/* */ // 13 44 4 i Ljava/util/Iterator;
/* */ // 22 35 5 retVal Z
/* */ // Local variable type table:
/* */ // start length slot name signature
/* */ // 0 57 3 c Ljava/util/Collection<+Ljava/lang/Short;>;
/* */ // 13 44 4 i Ljava/util/Iterator<+Ljava/lang/Short;>;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(Collection<? extends Short> c) {
/* 126 */ return addAll(size64(), c);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public ShortBigListIterator iterator() {
/* 136 */ return listIterator();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public ShortBigListIterator listIterator() {
/* 147 */ return listIterator(0L);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public ShortBigListIterator listIterator(final long index) {
/* 156 */ ensureIndex(index);
/* 157 */ return new ShortBigListIterator() {
/* 158 */ long pos = index; long last = -1L;
/* */
/* */ public boolean hasNext() {
/* 161 */ return (this.pos < AbstractShortBigList.this.size64());
/* */ }
/* */
/* */ public boolean hasPrevious() {
/* 165 */ return (this.pos > 0L);
/* */ }
/* */
/* */ public short nextShort() {
/* 169 */ if (!hasNext())
/* 170 */ throw new NoSuchElementException();
/* 171 */ return AbstractShortBigList.this.getShort(this.last = this.pos++);
/* */ }
/* */
/* */ public short previousShort() {
/* 175 */ if (!hasPrevious())
/* 176 */ throw new NoSuchElementException();
/* 177 */ return AbstractShortBigList.this.getShort(this.last = --this.pos);
/* */ }
/* */
/* */ public long nextIndex() {
/* 181 */ return this.pos;
/* */ }
/* */
/* */ public long previousIndex() {
/* 185 */ return this.pos - 1L;
/* */ }
/* */
/* */ public void add(short k) {
/* 189 */ AbstractShortBigList.this.add(this.pos++, k);
/* 190 */ this.last = -1L;
/* */ }
/* */
/* */ public void set(short k) {
/* 194 */ if (this.last == -1L)
/* 195 */ throw new IllegalStateException();
/* 196 */ AbstractShortBigList.this.set(this.last, k);
/* */ }
/* */
/* */ public void remove() {
/* 200 */ if (this.last == -1L)
/* 201 */ throw new IllegalStateException();
/* 202 */ AbstractShortBigList.this.removeShort(this.last);
/* */
/* */
/* */
/* */
/* 207 */ if (this.last < this.pos)
/* 208 */ this.pos--;
/* 209 */ this.last = -1L;
/* */ }
/* */ };
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean contains(short k) {
/* 222 */ return (indexOf(k) >= 0L);
/* */ }
/* */
/* */ public long indexOf(short k) {
/* 226 */ ShortBigListIterator i = listIterator();
/* */
/* 228 */ while (i.hasNext()) {
/* 229 */ short e = i.nextShort();
/* 230 */ if (k == e)
/* 231 */ return i.previousIndex();
/* */ }
/* 233 */ return -1L;
/* */ }
/* */
/* */ public long lastIndexOf(short k) {
/* 237 */ ShortBigListIterator i = listIterator(size64());
/* */
/* 239 */ while (i.hasPrevious()) {
/* 240 */ short e = i.previousShort();
/* 241 */ if (k == e)
/* 242 */ return i.nextIndex();
/* */ }
/* 244 */ return -1L;
/* */ }
/* */
/* */ public void size(long size) {
/* 248 */ long i = size64();
/* 249 */ if (size > i) {
/* 250 */ while (i++ < size)
/* 251 */ add((short)0);
/* */ } else {
/* 253 */ while (i-- != size)
/* 254 */ remove(i);
/* */ }
/* */ }
/* */ public ShortBigList subList(long from, long to) {
/* 258 */ ensureIndex(from);
/* 259 */ ensureIndex(to);
/* 260 */ if (from > to)
/* 261 */ throw new IndexOutOfBoundsException("Start index (" + from + ") is greater than end index (" + to + ")");
/* 262 */ return new ShortSubList(this, from, to);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void removeElements(long from, long to) {
/* 273 */ ensureIndex(to);
/* 274 */ ShortBigListIterator i = listIterator(from);
/* 275 */ long n = to - from;
/* 276 */ if (n < 0L)
/* 277 */ throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")");
/* 278 */ while (n-- != 0L) {
/* 279 */ i.nextShort();
/* 280 */ i.remove();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void addElements(long index, short[][] a, long offset, long length) {
/* */ // Byte code:
/* */ // 0: aload_0
/* */ // 1: lload_1
/* */ // 2: invokevirtual ensureIndex : (J)V
/* */ // 5: aload_3
/* */ // 6: lload #4
/* */ // 8: lload #6
/* */ // 10: invokestatic ensureOffsetLength : ([[SJJ)V
/* */ // 13: lload #6
/* */ // 15: dup2
/* */ // 16: lconst_1
/* */ // 17: lsub
/* */ // 18: lstore #6
/* */ // 20: lconst_0
/* */ // 21: lcmp
/* */ // 22: ifeq -> 48
/* */ // 25: aload_0
/* */ // 26: lload_1
/* */ // 27: dup2
/* */ // 28: lconst_1
/* */ // 29: ladd
/* */ // 30: lstore_1
/* */ // 31: aload_3
/* */ // 32: lload #4
/* */ // 34: dup2
/* */ // 35: lconst_1
/* */ // 36: ladd
/* */ // 37: lstore #4
/* */ // 39: invokestatic get : ([[SJ)S
/* */ // 42: invokevirtual add : (JS)V
/* */ // 45: goto -> 13
/* */ // 48: return
/* */ // Line number table:
/* */ // Java source line number -> byte code offset
/* */ // #292 -> 0
/* */ // #293 -> 5
/* */ // #294 -> 13
/* */ // #295 -> 25
/* */ // #296 -> 48
/* */ // Local variable table:
/* */ // start length slot name descriptor
/* */ // 0 49 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList;
/* */ // 0 49 1 index J
/* */ // 0 49 3 a [[S
/* */ // 0 49 4 offset J
/* */ // 0 49 6 length J
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void addElements(long index, short[][] a) {
/* 306 */ addElements(index, a, 0L, ShortBigArrays.length(a));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void getElements(long from, short[][] a, long offset, long length) {
/* */ // Byte code:
/* */ // 0: aload_0
/* */ // 1: lload_1
/* */ // 2: invokevirtual listIterator : (J)Lit/unimi/dsi/fastutil/shorts/ShortBigListIterator;
/* */ // 5: astore #8
/* */ // 7: aload_3
/* */ // 8: lload #4
/* */ // 10: lload #6
/* */ // 12: invokestatic ensureOffsetLength : ([[SJJ)V
/* */ // 15: lload_1
/* */ // 16: lload #6
/* */ // 18: ladd
/* */ // 19: aload_0
/* */ // 20: invokevirtual size64 : ()J
/* */ // 23: lcmp
/* */ // 24: ifle -> 74
/* */ // 27: new java/lang/IndexOutOfBoundsException
/* */ // 30: dup
/* */ // 31: new java/lang/StringBuilder
/* */ // 34: dup
/* */ // 35: invokespecial <init> : ()V
/* */ // 38: ldc 'End index ('
/* */ // 40: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
/* */ // 43: lload_1
/* */ // 44: lload #6
/* */ // 46: ladd
/* */ // 47: invokevirtual append : (J)Ljava/lang/StringBuilder;
/* */ // 50: ldc ') is greater than list size ('
/* */ // 52: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
/* */ // 55: aload_0
/* */ // 56: invokevirtual size64 : ()J
/* */ // 59: invokevirtual append : (J)Ljava/lang/StringBuilder;
/* */ // 62: ldc ')'
/* */ // 64: invokevirtual append : (Ljava/lang/String;)Ljava/lang/StringBuilder;
/* */ // 67: invokevirtual toString : ()Ljava/lang/String;
/* */ // 70: invokespecial <init> : (Ljava/lang/String;)V
/* */ // 73: athrow
/* */ // 74: lload #6
/* */ // 76: dup2
/* */ // 77: lconst_1
/* */ // 78: lsub
/* */ // 79: lstore #6
/* */ // 81: lconst_0
/* */ // 82: lcmp
/* */ // 83: ifeq -> 107
/* */ // 86: aload_3
/* */ // 87: lload #4
/* */ // 89: dup2
/* */ // 90: lconst_1
/* */ // 91: ladd
/* */ // 92: lstore #4
/* */ // 94: aload #8
/* */ // 96: invokeinterface nextShort : ()S
/* */ // 101: invokestatic set : ([[SJS)V
/* */ // 104: goto -> 74
/* */ // 107: return
/* */ // Line number table:
/* */ // Java source line number -> byte code offset
/* */ // #317 -> 0
/* */ // #318 -> 7
/* */ // #319 -> 15
/* */ // #320 -> 27
/* */ // #321 -> 56
/* */ // #322 -> 74
/* */ // #323 -> 86
/* */ // #324 -> 107
/* */ // Local variable table:
/* */ // start length slot name descriptor
/* */ // 0 108 0 this Lit/unimi/dsi/fastutil/shorts/AbstractShortBigList;
/* */ // 0 108 1 from J
/* */ // 0 108 3 a [[S
/* */ // 0 108 4 offset J
/* */ // 0 108 6 length J
/* */ // 7 101 8 i Lit/unimi/dsi/fastutil/shorts/ShortBigListIterator;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void clear() {
/* 332 */ removeElements(0L, size64());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public int size() {
/* 345 */ return (int)Math.min(2147483647L, size64());
/* */ }
/* */ private boolean valEquals(Object a, Object b) {
/* 348 */ return (a == null) ? ((b == null)) : a.equals(b);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int hashCode() {
/* 358 */ ShortIterator i = iterator();
/* 359 */ int h = 1;
/* 360 */ long s = size64();
/* 361 */ while (s-- != 0L) {
/* 362 */ short k = i.nextShort();
/* 363 */ h = 31 * h + k;
/* */ }
/* 365 */ return h;
/* */ }
/* */
/* */ public boolean equals(Object o) {
/* 369 */ if (o == this)
/* 370 */ return true;
/* 371 */ if (!(o instanceof BigList))
/* 372 */ return false;
/* 373 */ BigList<?> l = (BigList)o;
/* 374 */ long s = size64();
/* 375 */ if (s != l.size64())
/* 376 */ return false;
/* 377 */ if (l instanceof ShortBigList) {
/* 378 */ ShortBigListIterator shortBigListIterator1 = listIterator(), shortBigListIterator2 = ((ShortBigList)l).listIterator();
/* 379 */ while (s-- != 0L) {
/* 380 */ if (shortBigListIterator1.nextShort() != shortBigListIterator2.nextShort())
/* 381 */ return false;
/* 382 */ } return true;
/* */ }
/* 384 */ BigListIterator<?> i1 = listIterator(), i2 = l.listIterator();
/* 385 */ while (s-- != 0L) {
/* 386 */ if (!valEquals(i1.next(), i2.next()))
/* 387 */ return false;
/* 388 */ } return true;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int compareTo(BigList<? extends Short> l) {
/* 406 */ if (l == this)
/* 407 */ return 0;
/* 408 */ if (l instanceof ShortBigList) {
/* 409 */ ShortBigListIterator shortBigListIterator1 = listIterator(), shortBigListIterator2 = ((ShortBigList)l).listIterator();
/* */
/* */
/* 412 */ while (shortBigListIterator1.hasNext() && shortBigListIterator2.hasNext()) {
/* 413 */ short e1 = shortBigListIterator1.nextShort();
/* 414 */ short e2 = shortBigListIterator2.nextShort(); int r;
/* 415 */ if ((r = Short.compare(e1, e2)) != 0)
/* 416 */ return r;
/* */ }
/* 418 */ return shortBigListIterator2.hasNext() ? -1 : (shortBigListIterator1.hasNext() ? 1 : 0);
/* */ }
/* 420 */ BigListIterator<? extends Short> i1 = listIterator(), i2 = l.listIterator();
/* */
/* 422 */ while (i1.hasNext() && i2.hasNext()) {
/* 423 */ int r; if ((r = ((Comparable<Object>)i1.next()).compareTo(i2.next())) != 0)
/* 424 */ return r;
/* */ }
/* 426 */ return i2.hasNext() ? -1 : (i1.hasNext() ? 1 : 0);
/* */ }
/* */
/* */ public void push(short o) {
/* 430 */ add(o);
/* */ }
/* */
/* */ public short popShort() {
/* 434 */ if (isEmpty())
/* 435 */ throw new NoSuchElementException();
/* 436 */ return removeShort(size64() - 1L);
/* */ }
/* */
/* */ public short topShort() {
/* 440 */ if (isEmpty())
/* 441 */ throw new NoSuchElementException();
/* 442 */ return getShort(size64() - 1L);
/* */ }
/* */
/* */ public short peekShort(int i) {
/* 446 */ return getShort(size64() - 1L - i);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean rem(short k) {
/* 458 */ long index = indexOf(k);
/* 459 */ if (index == -1L)
/* 460 */ return false;
/* 461 */ removeShort(index);
/* 462 */ return true;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(long index, ShortCollection c) {
/* 473 */ return addAll(index, c);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(long index, ShortBigList l) {
/* 484 */ return addAll(index, l);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(ShortCollection c) {
/* 495 */ return addAll(size64(), c);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean addAll(ShortBigList l) {
/* 506 */ return addAll(size64(), l);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public void add(long index, Short ok) {
/* 519 */ add(index, ok.shortValue());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short set(long index, Short ok) {
/* 532 */ return Short.valueOf(set(index, ok.shortValue()));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short get(long index) {
/* 545 */ return Short.valueOf(getShort(index));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public long indexOf(Object ok) {
/* 558 */ return indexOf(((Short)ok).shortValue());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public long lastIndexOf(Object ok) {
/* 571 */ return lastIndexOf(((Short)ok).shortValue());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short remove(long index) {
/* 584 */ return Short.valueOf(removeShort(index));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public void push(Short o) {
/* 597 */ push(o.shortValue());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short pop() {
/* 610 */ return Short.valueOf(popShort());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short top() {
/* 623 */ return Short.valueOf(topShort());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Deprecated
/* */ public Short peek(int i) {
/* 636 */ return Short.valueOf(peekShort(i));
/* */ }
/* */
/* */ public String toString() {
/* 640 */ StringBuilder s = new StringBuilder();
/* 641 */ ShortIterator i = iterator();
/* 642 */ long n = size64();
/* */
/* 644 */ boolean first = true;
/* 645 */ s.append("[");
/* 646 */ while (n-- != 0L) {
/* 647 */ if (first) {
/* 648 */ first = false;
/* */ } else {
/* 650 */ s.append(", ");
/* 651 */ } short k = i.nextShort();
/* 652 */ s.append(String.valueOf(k));
/* */ }
/* 654 */ s.append("]");
/* 655 */ return s.toString();
/* */ }
/* */
/* */ public static class ShortSubList
/* */ extends AbstractShortBigList
/* */ implements Serializable {
/* */ private static final long serialVersionUID = -7046029254386353129L;
/* */ protected final ShortBigList l;
/* */ protected final long from;
/* */ protected long to;
/* */
/* */ public ShortSubList(ShortBigList l, long from, long to) {
/* 667 */ this.l = l;
/* 668 */ this.from = from;
/* 669 */ this.to = to;
/* */ }
/* */ private boolean assertRange() {
/* 672 */ assert this.from <= this.l.size64();
/* 673 */ assert this.to <= this.l.size64();
/* 674 */ assert this.to >= this.from;
/* 675 */ return true;
/* */ }
/* */
/* */ public boolean add(short k) {
/* 679 */ this.l.add(this.to, k);
/* 680 */ this.to++;
/* 681 */ assert assertRange();
/* 682 */ return true;
/* */ }
/* */
/* */ public void add(long index, short k) {
/* 686 */ ensureIndex(index);
/* 687 */ this.l.add(this.from + index, k);
/* 688 */ this.to++;
/* 689 */ assert assertRange();
/* */ }
/* */
/* */ public boolean addAll(long index, Collection<? extends Short> c) {
/* 693 */ ensureIndex(index);
/* 694 */ this.to += c.size();
/* 695 */ return this.l.addAll(this.from + index, c);
/* */ }
/* */
/* */ public short getShort(long index) {
/* 699 */ ensureRestrictedIndex(index);
/* 700 */ return this.l.getShort(this.from + index);
/* */ }
/* */
/* */ public short removeShort(long index) {
/* 704 */ ensureRestrictedIndex(index);
/* 705 */ this.to--;
/* 706 */ return this.l.removeShort(this.from + index);
/* */ }
/* */
/* */ public short set(long index, short k) {
/* 710 */ ensureRestrictedIndex(index);
/* 711 */ return this.l.set(this.from + index, k);
/* */ }
/* */
/* */ public long size64() {
/* 715 */ return this.to - this.from;
/* */ }
/* */
/* */ public void getElements(long from, short[][] a, long offset, long length) {
/* 719 */ ensureIndex(from);
/* 720 */ if (from + length > size64())
/* 721 */ throw new IndexOutOfBoundsException("End index (" + from + length + ") is greater than list size (" +
/* 722 */ size64() + ")");
/* 723 */ this.l.getElements(this.from + from, a, offset, length);
/* */ }
/* */
/* */ public void removeElements(long from, long to) {
/* 727 */ ensureIndex(from);
/* 728 */ ensureIndex(to);
/* 729 */ this.l.removeElements(this.from + from, this.from + to);
/* 730 */ this.to -= to - from;
/* 731 */ assert assertRange();
/* */ }
/* */
/* */ public void addElements(long index, short[][] a, long offset, long length) {
/* 735 */ ensureIndex(index);
/* 736 */ this.l.addElements(this.from + index, a, offset, length);
/* 737 */ this.to += length;
/* 738 */ assert assertRange();
/* */ }
/* */
/* */ public ShortBigListIterator listIterator(final long index) {
/* 742 */ ensureIndex(index);
/* 743 */ return new ShortBigListIterator() {
/* 744 */ long pos = index; long last = -1L;
/* */
/* */ public boolean hasNext() {
/* 747 */ return (this.pos < AbstractShortBigList.ShortSubList.this.size64());
/* */ }
/* */
/* */ public boolean hasPrevious() {
/* 751 */ return (this.pos > 0L);
/* */ }
/* */
/* */ public short nextShort() {
/* 755 */ if (!hasNext())
/* 756 */ throw new NoSuchElementException();
/* 757 */ return AbstractShortBigList.ShortSubList.this.l.getShort(AbstractShortBigList.ShortSubList.this.from + (this.last = this.pos++));
/* */ }
/* */
/* */ public short previousShort() {
/* 761 */ if (!hasPrevious())
/* 762 */ throw new NoSuchElementException();
/* 763 */ return AbstractShortBigList.ShortSubList.this.l.getShort(AbstractShortBigList.ShortSubList.this.from + (this.last = --this.pos));
/* */ }
/* */
/* */ public long nextIndex() {
/* 767 */ return this.pos;
/* */ }
/* */
/* */ public long previousIndex() {
/* 771 */ return this.pos - 1L;
/* */ }
/* */
/* */ public void add(short k) {
/* 775 */ if (this.last == -1L)
/* 776 */ throw new IllegalStateException();
/* 777 */ AbstractShortBigList.ShortSubList.this.add(this.pos++, k);
/* 778 */ this.last = -1L;
/* 779 */ if (!$assertionsDisabled && !AbstractShortBigList.ShortSubList.this.assertRange()) throw new AssertionError();
/* */ }
/* */
/* */ public void set(short k) {
/* 783 */ if (this.last == -1L)
/* 784 */ throw new IllegalStateException();
/* 785 */ AbstractShortBigList.ShortSubList.this.set(this.last, k);
/* */ }
/* */
/* */ public void remove() {
/* 789 */ if (this.last == -1L)
/* 790 */ throw new IllegalStateException();
/* 791 */ AbstractShortBigList.ShortSubList.this.removeShort(this.last);
/* */
/* */
/* */
/* */
/* 796 */ if (this.last < this.pos)
/* 797 */ this.pos--;
/* 798 */ this.last = -1L;
/* 799 */ assert AbstractShortBigList.ShortSubList.this.assertRange();
/* */ }
/* */ };
/* */ }
/* */
/* */ public ShortBigList subList(long from, long to) {
/* 805 */ ensureIndex(from);
/* 806 */ ensureIndex(to);
/* 807 */ if (from > to)
/* 808 */ throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")");
/* 809 */ return new ShortSubList(this, from, to);
/* */ }
/* */
/* */ public boolean rem(short k) {
/* 813 */ long index = indexOf(k);
/* 814 */ if (index == -1L)
/* 815 */ return false;
/* 816 */ this.to--;
/* 817 */ this.l.removeShort(this.from + index);
/* 818 */ assert assertRange();
/* 819 */ return true;
/* */ }
/* */
/* */ public boolean addAll(long index, ShortCollection c) {
/* 823 */ ensureIndex(index);
/* 824 */ return super.addAll(index, c);
/* */ }
/* */
/* */ public boolean addAll(long index, ShortBigList l) {
/* 828 */ ensureIndex(index);
/* 829 */ return super.addAll(index, l);
/* */ }
/* */ }
/* */ }
/* Location: C:\Users\Josep\Downloads\Decompile Minecraft\tuinity-1.16.3.jar!\i\\unimi\dsi\fastutil\shorts\AbstractShortBigList.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"tanksherman27@gmail.com"
] | tanksherman27@gmail.com |
e07cba4a64fb8d276505ef1faf15fffa1fc27e2c | c2c18c0235ca4073c3d13a21987441335ca9853a | /XooDB/src/com/xoodb/beans/SQLQuery.java | 95eb38b196dd884ac1ea4c0752c0109bdb115eb8 | [] | no_license | dhanoopbhaskar/xoodb | 3d40462187053bf493390de5adfcf4762639e438 | 8c1f1e0215f69ef1e52556f3f2bed113c79178bc | refs/heads/master | 2021-01-21T12:40:56.342455 | 2013-08-14T09:49:21 | 2013-08-14T09:49:21 | 11,561,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.xoodb.beans;
/**
*
* @author dhanoopbhaskar
*/
public interface SQLQuery extends SQLBean {
}
| [
"dhanoopbhaskar@gmail.com"
] | dhanoopbhaskar@gmail.com |
faee4d0a913a0283f55fb9b4e1a211d1fb91339b | 64cbea24e7394c4c647c019d8194f63b4ddc1d5e | /shakyo/slackjoytasq/java/lesson86.java | 1550bcb34df29691c2059b0fa4c8e4c1fb677143 | [] | no_license | karakazeviewview/miniSite3 | 9a524a938e7bc187fb2cf857e566a221e74594b2 | 6f99d85ef9397cd3aa9102d730bfd7d2304eb8b8 | refs/heads/master | 2023-01-24T09:28:20.828703 | 2020-11-27T00:21:24 | 2020-11-27T00:21:24 | 313,658,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | import java.util.*;
public class lesson86{
public static void main(String[] args){
System.out.print("体重を入力してください(kg)>");
int weight=new java.util.Scanner(System.in).nextInt();
System.out.print("身長を入力してください(cm)>");
int height=new java.util.Scanner(System.in).nextInt();
double bmi=calcBMI(weight,height);
System.out.print("体重:"+weight+"身長:"+height+"のBMIは"+bmi+"です");
}
public static double calcBMI(double weightKg,double heightCm){
double heightM=heightCm/100;
double bmi=weightKg/(heightM*heightM);
return bmi;
}
}
| [
"mitsuru.matsuo.great@gmail.com"
] | mitsuru.matsuo.great@gmail.com |
130d320dce7874c8616fa8bbcbbda4cb16c9ac6f | 972b0cf1512ebd17bc18d8d460f34757576eb5c2 | /app/src/main/java/com/jsqix/gxt/app/utils/CityUtils.java | 3af17fc77bb304130ba74cbacd26b74376ac2981 | [] | no_license | a823875383/Gxt | 5b4990682c69ddcefa3bfd757ae6f4d2410ca102 | 2df140179b8935265141eb5e3b155a7d76f3109a | refs/heads/master | 2020-04-15T14:57:04.698645 | 2016-11-07T03:19:21 | 2016-11-07T03:19:21 | 68,093,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,154 | java | package com.jsqix.gxt.app.utils;
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
/**
* @author dq
*/
public class CityUtils {
/**
* 把全国的省市区的信息以json的格式保存,解析完成后赋值为null
*/
private JSONObject mJsonObj;
private Context context;
static CityUtils utils;
public CityUtils() {
}
public CityUtils(Context context) {
this.context = context;
initJsonData();
}
public static CityUtils getInstance(Context context) {
if (utils == null) {
utils = new CityUtils(context);
}
return utils;
}
/**
* 从assert文件夹中读取省市区的json文件,然后转化为json对象
*/
private void initJsonData() {
try {
StringBuffer sb = new StringBuffer();
InputStream is = context.getAssets().open("city.json");
int len = -1;
byte[] buf = new byte[1024];
while ((len = is.read(buf)) != -1) {
sb.append(new String(buf, 0, len, "utf-8"));
}
is.close();
mJsonObj = new JSONObject(sb.toString());
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
public ArrayList<String> getPro() {
ArrayList<String> pros = new ArrayList<String>();
try {
JSONArray jsonArray = mJsonObj.getJSONArray("citylist");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象
String province = jsonP.getString("p");// 省名字
pros.add(province);
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return pros;
}
public ArrayList<ArrayList<String>> getCity() {
ArrayList<ArrayList<String>> cities = new ArrayList<ArrayList<String>>();
try {
JSONArray jsonArray = mJsonObj.getJSONArray("citylist");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象
ArrayList<String> pro = new ArrayList<String>();
JSONArray jsonCs;
try {
/**
* Throws JSONException if the mapping doesn't exist or is
* not a JSONArray.
*/
jsonCs = jsonP.getJSONArray("c");
} catch (Exception e1) {
continue;
}
for (int j = 0; j < jsonCs.length(); j++) {
JSONObject jsonCity = jsonCs.getJSONObject(j);
String city = jsonCity.getString("n");// 市名字
pro.add(city);
}
cities.add(pro);
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return cities;
}
public ArrayList<ArrayList<ArrayList<String>>> getArea() {
ArrayList<ArrayList<ArrayList<String>>> areas = new ArrayList<ArrayList<ArrayList<String>>>();
try {
JSONArray jsonArray = mJsonObj.getJSONArray("citylist");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonP = jsonArray.getJSONObject(i);// 每个省的json对象
ArrayList<ArrayList<String>> pro = new ArrayList<ArrayList<String>>();
JSONArray jsonCs;
try {
/**
* Throws JSONException if the mapping doesn't exist or is
* not a JSONArray.
*/
jsonCs = jsonP.getJSONArray("c");
} catch (Exception e1) {
continue;
}
for (int j = 0; j < jsonCs.length(); j++) {
JSONObject jsonCity = jsonCs.getJSONObject(j);// 每个市的json对象
ArrayList<String> city = new ArrayList<String>();
JSONArray jsonAs;
try {
jsonAs = jsonCity.getJSONArray("a");
} catch (Exception e2) {
continue;
}
for (int k = 0; k < jsonAs.length(); k++) {
JSONObject jsonArea = jsonAs.getJSONObject(k);
String area = jsonArea.getString("s");//区名字
city.add(area);
}
pro.add(city);
}
areas.add(pro);
}
} catch (JSONException e) {
}
return areas;
}
public void destory() {
utils = null;
mJsonObj = null;
}
}
| [
"823875383@qq.com"
] | 823875383@qq.com |
be9b9d614c63cc516c89f2edb74f8c629cc351c4 | 9e98bccb276a8e2b6d899ddd5f75bbb65e8fa9d0 | /src/model/Retina.java | d41c978d61b90695472f9e5bb9b8d2ad29d49a32 | [] | no_license | Lusquino/WisardEmocoes | f5c292d8e98db31ce5fa469680979553ff17deea | b0df2d092f23688b3386e840abebe70cadbfcbde | refs/heads/master | 2021-04-15T02:15:42.951246 | 2018-03-05T23:35:44 | 2018-03-05T23:35:44 | 94,556,506 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,855 | java | package model;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class Retina implements Serializable
{
private static final long serialVersionUID = 1L;
private Map<Integer, Integer> retina;
private OutputStream out;
public Retina(int inputLength)
{
retina = new HashMap<Integer, Integer>();
for(int i = 0; i < inputLength; i++)
{
retina.put(i, i);
}
Random rnd = new Random();
for(int i = 0; i < inputLength; i++)
{
int randomInd = rnd.nextInt(inputLength);
int temp = retina.get(i);
retina.put(i, retina.get(randomInd));
retina.put(randomInd, temp);
}
try {
out = new FileOutputStream(new File("C:/Users/Usuario/Desktop/Mestrado/Dissertação/DatasetMMI/erros.txt"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public List<Boolean> organize(List<Boolean> input) throws IOException
{
List<Boolean> organizedInput = new ArrayList<Boolean>();
// System.out.println("Tamanho do input: "+ input.size());
//System.out.println("Tamanho da retina: "+ retina.keySet().size());
for (int i = 0; i < retina.keySet().size(); i++)
{
//if(i>=retina.size()){System.out.println("Vai dar caoooooooo");}
//out.write((i+"/"+retina.keySet().size()+"/n/n").getBytes());
int temp1 = retina.get(i);
boolean temp2 = input.get(temp1);
organizedInput.add(temp2);
//System.out.println("Adicionei na lista reorganizada: "+ input.get(retina.get(i)));
}
return organizedInput;
}
public List<Boolean> reorganize(List<Boolean> inputOrganizado)
{
List<Boolean> input = inputOrganizado;
double verdadeiro = 0, falso = 0;
for(int i=0;i<inputOrganizado.size();i++)
{
if(inputOrganizado.get(i)){verdadeiro++;}
if(!inputOrganizado.get(i)){falso++;}
}
System.out.println(verdadeiro+";"+falso);
System.out.println("retina:"+retina.keySet().size()+"; lista:"+inputOrganizado.size());
for (int i = 0; i < retina.keySet().size(); i++)
{
input.set(retina.get(i), inputOrganizado.get(i));
}
return input;
}
public List<Boolean> sort(List<Boolean> input)
{
Boolean[] sortedInput = new Boolean[input.size()];
for(int i = 0; i < retina.keySet().size(); i++)
{
sortedInput[retina.get(i)] = input.get(i);
}
return Arrays.asList(sortedInput);
}
} | [
"lusquino@ufrj.br"
] | lusquino@ufrj.br |
597bf88d6817d010f5afdd353fb0a936541d01cb | 89dab002521fda4c2e02563eda300e6f850b0770 | /src/cn/edu/ustc/ttcn/itsec/dao/TestSystemDaoForMysql.java | 69ec860522dd654c6f2e14b1d496e17c8a2ce7d1 | [] | no_license | Grahamlc/itsec | e38db6b8f4867a6a4b9bd2617bd0264a3567890f | 57f8631560aad40a4ac6edba0c1700978e44492a | refs/heads/master | 2020-12-03T00:44:33.705853 | 2017-07-03T06:46:17 | 2017-07-03T06:46:17 | 96,075,554 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,383 | java | package cn.edu.ustc.ttcn.itsec.dao;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.orm.hibernate4.support.HibernateDaoSupport;
import cn.edu.ustc.ttcn.itsec.model.Role;
import cn.edu.ustc.ttcn.itsec.model.Systems;
import cn.edu.ustc.ttcn.itsec.model.TestSystem;
import cn.edu.ustc.ttcn.itsec.model.Tester;
import cn.edu.ustc.ttcn.itsec.model.TesterOfSystem;
public class TestSystemDaoForMysql extends HibernateDaoSupport
implements TestSystemDao{
private TestSystem testSystem;
private TesterOfSystem tos;
private Role role;
private Tester tester;
public TestSystem getTestSystem() {
return testSystem;
}
public void setTestSystem(TestSystem testSystem) {
this.testSystem = testSystem;
}
public TesterOfSystem getTos() {
return tos;
}
public void setTos(TesterOfSystem tos) {
this.tos = tos;
}
public Role getRole() {
return role;
}
public void setRole(Role role) {
this.role = role;
}
public Tester getTester() {
return tester;
}
public void setTester(Tester tester) {
this.tester = tester;
}
@SuppressWarnings("unchecked")
@Override
public void saveTestSys(TestSystem testsystem) {
// TODO Auto-generated method stub
this.getHibernateTemplate().save(testsystem);
}
@Override
public void delTestSys(TestSystem testsystem) {
// TODO Auto-generated method stub
this.getHibernateTemplate().delete(testsystem);
}
@Override
public List<TestSystem> selAllTestSys(int sysId) {
// TODO Auto-generated method stub
String hql = "from TestSystem as it where it.system.autoId = ?";
return (List<TestSystem>) this.getHibernateTemplate().find(hql, sysId);
}
@SuppressWarnings("unchecked")
@Override
public List<TestSystem> selMTestSystem(int testSysId) {
// TODO Auto-generated method stub
String hql = "from TestSystem as it where it.autoId = ?";
return (List<TestSystem>) this.getHibernateTemplate().find(hql, testSysId);
}
@Override
public void update(TestSystem testSystem) {
// TODO Auto-generated method stub
this.getHibernateTemplate().update(testSystem);
}
@Override
public List<TestSystem> selMTestSystems(int proId) {
// TODO Auto-generated method stub
String hql = "from TestSystem as it where it.project.autoId = ?";
return (List<TestSystem>) this.getHibernateTemplate().find(hql, proId);
}
}
| [
"1301922435@qq.com"
] | 1301922435@qq.com |
a1c40aa9db620b42d3fcb92a508cff56f02fb4e4 | 5092b89a965d96ea1283aec9fa7103030b34997d | /src/main/java/com/fh/model/User.java | babfb738d8b4c11423d527bc998b53c299c3a1d5 | [] | no_license | xjjm/user_feihu_springboot | 64cda84efa093bad09c4d2e2239e9931c5e35385 | 23474701617ee32af29196177c8d195ab7b28140 | refs/heads/master | 2022-12-02T23:50:19.012792 | 2020-08-09T13:16:05 | 2020-08-09T13:16:05 | 286,225,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,579 | java | package com.fh.model;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class User {
private Integer id;
private String name;
private String password;
private String realname;
private String imgpath;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date registerdate;
private Integer areaId;
private String areaName;
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
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 getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getImgpath() {
return imgpath;
}
public void setImgpath(String imgpath) {
this.imgpath = imgpath;
}
public Date getRegisterdate() {
return registerdate;
}
public void setRegisterdate(Date registerdate) {
this.registerdate = registerdate;
}
public Integer getAreaId() {
return areaId;
}
public void setAreaId(Integer areaId) {
this.areaId = areaId;
}
}
| [
"2719574514@qq.com"
] | 2719574514@qq.com |
c1298b2b1602eab3a22a3a5fa35afc9aff0ddca9 | 5da5576711dafa986bfc4b16de62ef632ecaa1fd | /app/src/main/java/com/zomato_demo/NetworkManager/BaseManager.java | d6cfe17dfadd032e7bb777c7bdd2e05682e60e59 | [] | no_license | Prajwalpraju3/ZomatoDemo | b72080f1a9a2369bbdcee097a6c20112e56c029d | 75d73a99d19c1cf43b92f79e5efcd16e586d118a | refs/heads/master | 2020-05-24T22:12:08.526552 | 2019-05-24T09:46:06 | 2019-05-24T09:46:06 | 187,493,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,092 | java | package com.zomato_demo.NetworkManager;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.google.gson.Gson;
import com.zomato_demo.Interfaces.DataCallBackListener;
import java.io.IOException;
import androidx.annotation.NonNull;
import okhttp3.Request;
import okhttp3.RequestBody;
import okio.Buffer;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static android.content.ContentValues.TAG;
public class BaseManager<E> implements Callback<E> {
private Context context;
public BaseManager(Context context) {
this.context = context;
}
private DataCallBackListener<E> getDataCallBack;
public synchronized Call<E> sendRequest(Call<E> call, DataCallBackListener<E> getDataCallBack) {
this.getDataCallBack = getDataCallBack;
Request request = call.request();
Log.i(TAG, "sendRequest: url=" + request.url() + " header=" + request.headers()+" body="+bodyToString(request.body()));
call.enqueue(this);
return call;
}
@Override
public void onResponse(@NonNull final Call<E> call, @NonNull Response<E> response) {
try {
getDataCallBack.onResponse(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onFailure(@NonNull Call<E> call, @NonNull Throwable t) {
//error response to handle
try {
Toast.makeText(context, t.getMessage(), Toast.LENGTH_SHORT).show();
getDataCallBack.onError(t);
} catch (Exception e) {
e.printStackTrace();
}
}
private String bodyToString(final RequestBody request) {
try {
final RequestBody copy = request;
final Buffer buffer = new Buffer();
if (copy != null)
copy.writeTo(buffer);
else
return "";
return buffer.readUtf8();
} catch (final IOException e) {
return "did not work";
}
}
}
| [
"praju.coolnature@gmail.com"
] | praju.coolnature@gmail.com |
d785e1d6526eb3fbbb7cd1cd36958c4eb3877995 | f445ac7f2e7963e2a41920d686024f68e7c2278a | /rpc-common/src/main/java/org/cyka/registry/etcd/EtcdServiceRegistry.java | 6b48b4adc9b118b19d36af6aff0a48059728b20a | [
"WTFPL"
] | permissive | 18801284571/nettyAll | dc204ee5da5bf6c0bbc6f6ca5f0c6a31f3e0f903 | 20817a7340703a5d4145bad917990dc6d7e5b1ce | refs/heads/master | 2023-04-14T08:45:43.488995 | 2021-03-25T06:02:16 | 2021-03-25T06:02:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,570 | java | package org.cyka.registry.etcd;
import com.google.common.base.Charsets;
import io.etcd.jetcd.ByteSequence;
import io.etcd.jetcd.Client;
import io.etcd.jetcd.KV;
import io.etcd.jetcd.Lease;
import io.etcd.jetcd.lease.LeaseKeepAliveResponse;
import io.etcd.jetcd.options.DeleteOption;
import io.etcd.jetcd.options.PutOption;
import io.etcd.jetcd.support.CloseableClient;
import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;
import org.cyka.registry.ServiceRegistry;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.MessageFormat;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
/** etcd 键值存储注册中心 */
@Slf4j
public class EtcdServiceRegistry implements ServiceRegistry {
// ---------------------------constant-----------------------------------------
// lease TTL
private static final int LeaseTTL = 60;
// ----------------------------etcd--------------------------------------------
// lease id
private Long leaseId;
// etcd kv client
private final KV kv;
// lease client -- need to get from etcd client
private final Lease lease;
private final Client client;
private CloseableClient keepAliveClient;
@Override
public void register(String serviceName, Integer port) {
register(serviceName, getHostIp(), port);
}
@Override
public void register(String serviceName, String ipAddress, Integer port) {
String strKey =
MessageFormat.format(
"/{0}/{1}/{2}:{3}",
EtcdClientHolder.getRootpath(), serviceName, ipAddress, String.valueOf(port));
ByteSequence key = ByteSequence.from(strKey, Charsets.UTF_8);
ByteSequence val = ByteSequence.from("", Charsets.UTF_8);
// wait for the future
try {
kv.put(key, val, PutOption.newBuilder().withLeaseId(leaseId).build()).get();
} catch (InterruptedException e) {
log.warn("register has bean interrupt: {}", e.getMessage());
} catch (ExecutionException e) {
log.warn("register fail : {}", e.getMessage());
}
}
@Override
public void unRegister(String serviceName, String ipAddress, Integer port) {
String strKey =
MessageFormat.format(
"/{0}/{1}/{2}:{3}",
EtcdClientHolder.getRootpath(), serviceName, ipAddress, String.valueOf(port));
ByteSequence key = ByteSequence.from(strKey, Charsets.UTF_8);
kv.delete(key, DeleteOption.newBuilder().build());
}
@Override
public void disconnect() {
if (Objects.nonNull(keepAliveClient)) {
keepAliveClient.close();
EtcdClientHolder.disconnect();
}
}
// ----------------------------private method-------------------------------------
/**
* get local Ip Address : it may be local area network ip (not the public ip)
*
* @return string
*/
private String getHostIp() {
try {
return InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
log.warn("cannot get the local host ip , using localhost as service ip");
}
return "127.0.0.1";
}
private void keepAliveWithEtcd() {
keepAliveClient =
lease.keepAlive(
leaseId,
new StreamObserver<LeaseKeepAliveResponse>() {
@Override
public void onNext(LeaseKeepAliveResponse leaseKeepAliveResponse) {
log.info(
"lease id :{} ,new lease ttl : {}",
leaseKeepAliveResponse.getID(),
leaseKeepAliveResponse.getTTL());
}
@Override
public void onError(Throwable throwable) {
log.error("keep alive occurs error: {}", throwable.getMessage());
}
@Override
public void onCompleted() {
log.debug("finish keep alive");
}
});
}
// -----------------------constructor---------------------------------------
public EtcdServiceRegistry() {
this(null, LeaseTTL);
}
public EtcdServiceRegistry(String registryAddress) {
this(registryAddress, LeaseTTL);
}
public EtcdServiceRegistry(String registryAddress, int leaseTTL) {
this.client = EtcdClientHolder.getOrCreateClient(registryAddress);
this.kv = client.getKVClient();
this.lease = client.getLeaseClient();
try {
this.leaseId = lease.grant(leaseTTL).get().getID();
} catch (InterruptedException | ExecutionException e) {
log.error(e.getLocalizedMessage());
e.printStackTrace();
}
keepAliveWithEtcd();
}
}
| [
"1354250064mdzz@gmail.com"
] | 1354250064mdzz@gmail.com |
b7d3903e70c03f3dcc63ee853ac803576ed8e986 | 22f0484038cbea21e2d64cfefedd6b518412b21d | /dasa-receituario-rest/src/test/java/br/com/tamanhofamilia/dasa/receituario/services/medicos/ConselhosServiceTest.java | aec2cf2583cabe0dad6cb460f9f3609c6489522a | [] | no_license | luizalbsilva/selecao-dasa | 718c2cd6a8aeb3186e7e67dc41390e1b4a809c74 | 7d39a42f5695867133757364a1f01452cbc1077a | refs/heads/main | 2023-06-07T08:58:58.298494 | 2021-07-05T20:51:14 | 2021-07-05T20:51:14 | 382,742,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,831 | java | package br.com.tamanhofamilia.dasa.receituario.services.medicos;
import br.com.tamanhofamilia.dasa.receituario.daos.medico.ConselhoDao;
import br.com.tamanhofamilia.dasa.receituario.models.medico.Conselho;
import br.com.tamanhofamilia.dasa.receituario.services.DataNotFoundException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.data.domain.Pageable;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
class ConselhosServiceTest {
@InjectMocks
ConselhosService service;
@Mock
ConselhoDao dao;
@Mock
Pageable pageable;
@Test
void findAll() {
service.findAll(pageable);
verify(dao).findAll(pageable);
}
@Test
void create() {
Conselho conselho = Conselho.builder().nome("CFM").build();
when(dao.save(conselho)).thenAnswer(e -> {
Conselho cons = e.getArgument(0);
cons.setIdConselho(1);
return cons;
});
assertSame(1, service.create(conselho));
verify(dao).save(conselho);
}
@Test
void update() throws DataNotFoundException {
final int id = 1;
when(dao.existsById(id)).thenReturn(true);
Conselho conselho = Conselho.builder().idConselho(id).build();
service.update(conselho);
verify(dao).save(conselho);
}
@Test
void updateNotFound() {
Conselho conselho = Conselho.builder().idConselho(1).build();
assertThrows(DataNotFoundException.class, () -> {
service.update(conselho);
});
}
@Test
void getById() {
final int id = 1;
final Optional<Conselho> daoReturn = Optional.empty();
when(dao.findById(id)).thenReturn(daoReturn);
final Optional<Conselho> toCheck = service.getById(id);
assertSame(daoReturn, toCheck);
verify(dao).findById(id);
}
@Test
void delete() throws DataNotFoundException {
final int id = 1;
when(dao.existsById(id))
.thenReturn(true);
service.delete(id);
verify(dao).deleteById(id);
}
@Test
void deleteNotFound() {
assertThrows(DataNotFoundException.class, () -> {
final int id = 1;
when(dao.existsById(id))
.thenReturn(false);
service.delete(id);
});
}
} | [
"luizalbsilva@gmail.com"
] | luizalbsilva@gmail.com |
c609287c341b048c9a35165e8a64910bdedd8bfa | 36b6b363711012d0150e42ca03b9faf66749a11b | /android/app/src/main/java/com/myrn/rnbridge/HelloWorldPackage.java | 3ac0625b4f0e75ee05c9483454c54efba3af6043 | [] | no_license | defghy/my-rn | 4ae8e7f8352cbaef6c0a0e85563fdce96e6a16c6 | 0977653b0b62496e693c28b41643b3363fa6c93a | refs/heads/master | 2023-01-12T12:11:54.458893 | 2019-10-08T10:30:42 | 2019-10-08T10:30:42 | 120,161,057 | 1 | 0 | null | 2022-12-03T05:01:34 | 2018-02-04T06:28:28 | JavaScript | UTF-8 | Java | false | false | 910 | java | // android/app/src/main/java/com/cppreactnative/helloworld/HelloWorldPackage.java
package com.myrn.rnbridge;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class HelloWorldPackage implements ReactPackage {
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new HelloWorld(reactContext)); //this is where we register our module, and any others we may later add
return modules;
}
} | [
"huyu@meicai.cn"
] | huyu@meicai.cn |
15a46e38d5c43427b1350b5a6355eec0d915d465 | 1cc052f06b2044652a36756e7f1a0afa1136590c | /src/main/java/cn/qyl/ssmcrud/pojo/DeptExample.java | eee53afeaedc83c1acffa242ce58698ada975e74 | [] | no_license | qyl544752103/ssm- | 0ee1f6f415c66d3d74f251aabc5e8c81cf036f91 | b82d71ba5613d994ee71cb4617c06eb5813981fa | refs/heads/master | 2020-03-25T05:02:08.765585 | 2018-08-03T12:57:34 | 2018-08-03T12:57:34 | 143,424,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,826 | java | package cn.qyl.ssmcrud.pojo;
import java.util.ArrayList;
import java.util.List;
public class DeptExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public DeptExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andDeptIdIsNull() {
addCriterion("dept_id is null");
return (Criteria) this;
}
public Criteria andDeptIdIsNotNull() {
addCriterion("dept_id is not null");
return (Criteria) this;
}
public Criteria andDeptIdEqualTo(Integer value) {
addCriterion("dept_id =", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotEqualTo(Integer value) {
addCriterion("dept_id <>", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThan(Integer value) {
addCriterion("dept_id >", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThanOrEqualTo(Integer value) {
addCriterion("dept_id >=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThan(Integer value) {
addCriterion("dept_id <", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThanOrEqualTo(Integer value) {
addCriterion("dept_id <=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdIn(List<Integer> values) {
addCriterion("dept_id in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotIn(List<Integer> values) {
addCriterion("dept_id not in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdBetween(Integer value1, Integer value2) {
addCriterion("dept_id between", value1, value2, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotBetween(Integer value1, Integer value2) {
addCriterion("dept_id not between", value1, value2, "deptId");
return (Criteria) this;
}
public Criteria andDeptNameIsNull() {
addCriterion("dept_name is null");
return (Criteria) this;
}
public Criteria andDeptNameIsNotNull() {
addCriterion("dept_name is not null");
return (Criteria) this;
}
public Criteria andDeptNameEqualTo(String value) {
addCriterion("dept_name =", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameNotEqualTo(String value) {
addCriterion("dept_name <>", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameGreaterThan(String value) {
addCriterion("dept_name >", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameGreaterThanOrEqualTo(String value) {
addCriterion("dept_name >=", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameLessThan(String value) {
addCriterion("dept_name <", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameLessThanOrEqualTo(String value) {
addCriterion("dept_name <=", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameLike(String value) {
addCriterion("dept_name like", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameNotLike(String value) {
addCriterion("dept_name not like", value, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameIn(List<String> values) {
addCriterion("dept_name in", values, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameNotIn(List<String> values) {
addCriterion("dept_name not in", values, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameBetween(String value1, String value2) {
addCriterion("dept_name between", value1, value2, "deptName");
return (Criteria) this;
}
public Criteria andDeptNameNotBetween(String value1, String value2) {
addCriterion("dept_name not between", value1, value2, "deptName");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"544752103@qq.com"
] | 544752103@qq.com |
9215cdf66872ad551e1250d6983c7a2742700aa3 | 06801ebd64b8fc7fe2fadf2429ecb3c79db112cc | /leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/RedisObserveTest.java | 22bda2c11e76a35a8436ae76b7fd0762b5ef1c84 | [
"EPL-2.0",
"MPL-1.1",
"LicenseRef-scancode-generic-export-compliance",
"EPL-1.0",
"Apache-2.0",
"Apache-1.1",
"BSD-3-Clause",
"CPL-1.0"
] | permissive | somerb/leshan | dc45e5e812846f26f07fc629868efc364d33889a | 79328743c52f69e74dc9d7729a5cdc87117da38d | refs/heads/master | 2021-04-02T01:58:11.883175 | 2020-05-15T18:44:43 | 2020-05-15T18:44:43 | 248,231,867 | 0 | 0 | BSD-3-Clause | 2020-03-18T12:56:51 | 2020-03-18T12:56:50 | null | UTF-8 | Java | false | false | 913 | java | /*******************************************************************************
* Copyright (c) 2016 Sierra Wireless and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v20.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.html.
*
* Contributors:
* Sierra Wireless - initial API and implementation
*******************************************************************************/
package org.eclipse.leshan.integration.tests;
public class RedisObserveTest extends ObserveTest {
public RedisObserveTest() {
helper = new RedisIntegrationTestHelper();
}
}
| [
"sbernard@sierrawireless.com"
] | sbernard@sierrawireless.com |
d4ac3393ec079057fea52e7fc402a00c61eace87 | 35a918b184fb55d1a47d5678692f5b5ad4d4d477 | /FutureTechGitRepository/InputFromExcel/src/com/excel/input/Main.java | 5acf5d6377fdecaf3c7497b3a4a778185ef67b81 | [] | no_license | haqasad/Sources_FTech | 906e0b3afcafd9e804e86bce9b0c7eb7043ad01e | 2b79cca94a7c8d051f5d3d1afe3cf46f887cff7c | refs/heads/master | 2020-05-20T23:44:52.337927 | 2017-03-14T12:47:15 | 2017-03-14T12:47:15 | 84,548,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,386 | java | package com.excel.input;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class Main {
// @SuppressWarnings("deprecation")
public static void main(String[] args) throws IOException {
/* // TODO Auto-generated method stub
String excelFilePath = "Books.xlsx";
FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(inputStream);
Sheet firstSheet = workbook.getSheetAt(0);
Iterator<Row> iterator = firstSheet.iterator();
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Iterator<Cell> cellIterator = nextRow.cellIterator();
while (cellIterator.hasNext()) {
Cell cell = cellIterator.next();
switch (cell.getCellType()) {
case Cell.CELL_TYPE_STRING:
System.out.print(cell.getStringCellValue());
break;
case Cell.CELL_TYPE_BOOLEAN:
System.out.print(cell.getBooleanCellValue());
break;
case Cell.CELL_TYPE_NUMERIC:
System.out.print(cell.getNumericCellValue());
break;
}
System.out.print(" - ");
}
System.out.println();
}
workbook.close();
inputStream.close();*/
try {
FileInputStream readFile = new FileInputStream("INPUT.xlsx");
Workbook workBook = new XSSFWorkbook(readFile);
Sheet sheet = workBook.getSheet("input_one");
Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
System.out.println(cell.getStringCellValue());
System.out.println(sheet.getLastRowNum());
workBook.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
//return null;
} catch (IOException e) {
e.printStackTrace();
//return null;
}
}
}
| [
"haq.asad000@gmail.com"
] | haq.asad000@gmail.com |
fbcd86418ae3486a4801efd3c877ac19171ead72 | fa1408365e2e3f372aa61e7d1e5ea5afcd652199 | /src/testcases/CWE134_Uncontrolled_Format_String/s01/CWE134_Uncontrolled_Format_String__File_printf_73b.java | 2618fadf0cee4b343c2f01758b6d17b2922c9b8a | [] | no_license | bqcuong/Juliet-Test-Case | 31e9c89c27bf54a07b7ba547eddd029287b2e191 | e770f1c3969be76fdba5d7760e036f9ba060957d | refs/heads/master | 2020-07-17T14:51:49.610703 | 2019-09-03T16:22:58 | 2019-09-03T16:22:58 | 206,039,578 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,847 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__File_printf_73b.java
Label Definition File: CWE134_Uncontrolled_Format_String.label.xml
Template File: sources-sinks-73b.tmpl.java
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: File Read data from file (named c:\data.txt)
* GoodSource: A hardcoded string
* Sinks: printf
* GoodSink: dynamic printf format with string defined
* BadSink : dynamic printf without validation
* Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package
*
* */
package testcases.CWE134_Uncontrolled_Format_String.s01;
import testcasesupport.*;
import java.util.LinkedList;
public class CWE134_Uncontrolled_Format_String__File_printf_73b
{
public void badSink(LinkedList<String> dataLinkedList ) throws Throwable
{
String data = dataLinkedList.remove(2);
if (data != null)
{
/* POTENTIAL FLAW: uncontrolled string formatting */
System.out.printf(data);
}
}
/* goodG2B() - use GoodSource and BadSink */
public void goodG2BSink(LinkedList<String> dataLinkedList ) throws Throwable
{
String data = dataLinkedList.remove(2);
if (data != null)
{
/* POTENTIAL FLAW: uncontrolled string formatting */
System.out.printf(data);
}
}
/* goodB2G() - use BadSource and GoodSink */
public void goodB2GSink(LinkedList<String> dataLinkedList ) throws Throwable
{
String data = dataLinkedList.remove(2);
if (data != null)
{
/* FIX: explicitly defined string formatting */
System.out.printf("%s%n", data);
}
}
}
| [
"bqcuong2212@gmail.com"
] | bqcuong2212@gmail.com |
4126fa91c0e0708073c4b10b6a20c2a760f352b0 | 0b57ce7d4f8dd0cca4a49184db3ac8e09b1a0ef2 | /DriverAssistant/app/src/main/java/consumer/entities/AddAccountInformation/Data.java | 728928e5665bae470294a1aaf9396c5663462a6b | [] | no_license | Deepankur-Sadana/DriverAssistant | 8a9db13676f7c38ff431ac533fcf075fc2947360 | 96ca05163b75826afbcea5e043b83f05601438c0 | refs/heads/master | 2021-01-10T18:00:49.571196 | 2015-11-16T11:29:37 | 2015-11-16T11:29:37 | 46,269,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,383 | java |
package consumer.entities.AddAccountInformation;
import java.util.HashMap;
import java.util.Map;
public class Data {
private Integer account_id;
private String account_name;
private String account_number;
private String account_ifsc_code;
private String account_type;
private String account_branch_name;
private String created_at;
private String updated_at;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
/**
*
* @return
* The account_id
*/
public Integer getAccount_id() {
return account_id;
}
/**
*
* @param account_id
* The account_id
*/
public void setAccount_id(Integer account_id) {
this.account_id = account_id;
}
/**
*
* @return
* The account_name
*/
public String getAccount_name() {
return account_name;
}
/**
*
* @param account_name
* The account_name
*/
public void setAccount_name(String account_name) {
this.account_name = account_name;
}
/**
*
* @return
* The account_number
*/
public String getAccount_number() {
return account_number;
}
/**
*
* @param account_number
* The account_number
*/
public void setAccount_number(String account_number) {
this.account_number = account_number;
}
/**
*
* @return
* The account_ifsc_code
*/
public String getAccount_ifsc_code() {
return account_ifsc_code;
}
/**
*
* @param account_ifsc_code
* The account_ifsc_code
*/
public void setAccount_ifsc_code(String account_ifsc_code) {
this.account_ifsc_code = account_ifsc_code;
}
/**
*
* @return
* The account_type
*/
public String getAccount_type() {
return account_type;
}
/**
*
* @param account_type
* The account_type
*/
public void setAccount_type(String account_type) {
this.account_type = account_type;
}
/**
*
* @return
* The account_branch_name
*/
public String getAccount_branch_name() {
return account_branch_name;
}
/**
*
* @param account_branch_name
* The account_branch_name
*/
public void setAccount_branch_name(String account_branch_name) {
this.account_branch_name = account_branch_name;
}
/**
*
* @return
* The created_at
*/
public String getCreated_at() {
return created_at;
}
/**
*
* @param created_at
* The created_at
*/
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
/**
*
* @return
* The updated_at
*/
public String getUpdated_at() {
return updated_at;
}
/**
*
* @param updated_at
* The updated_at
*/
public void setUpdated_at(String updated_at) {
this.updated_at = updated_at;
}
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"you@example.com"
] | you@example.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.