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
de3a68c0091dd9b6fcc29cb9533fc6dbc1dcf587
879c7c01b1d3cd98fbc40768001ebcd3c94bcc52
/src/combit/ListLabel24/Dom/PropertyPrintableArea.java
6c44db6f840198620d666927da2025c2c8294469
[]
no_license
Javonet-io-user/7d825c3a-6d32-4c9b-9e58-43c503f77adb
c63f350b2754ef6c7fbdf42c9b8fa2a7ab45faf8
e5826d95ac9e013f9907aa75e16cec840d6ef276
refs/heads/master
2020-04-21T08:01:21.991093
2019-02-06T13:06:19
2019-02-06T13:06:19
169,407,296
0
0
null
null
null
null
UTF-8
Java
false
false
1,906
java
package combit.ListLabel24.Dom; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import combit.ListLabel24.Dom.*; public class PropertyPrintableArea extends DomItem { protected NObject javonetHandle; /** GetProperty */ public PropertyReadOnlySize getExtent() { try { Object res = javonetHandle.<NObject>get("Extent"); if (res == null) return null; return new PropertyReadOnlySize((NObject) res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } /** GetProperty */ public PropertyReadOnlySize getOffset() { try { Object res = javonetHandle.<NObject>get("Offset"); if (res == null) return null; return new PropertyReadOnlySize((NObject) res); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); return null; } } public PropertyPrintableArea(NObject handle) { super(handle); this.javonetHandle = handle; } public void setJavonetHandle(NObject handle) { this.javonetHandle = handle; } static { try { Activation.initializeJavonet(); } catch (java.lang.Exception e) { e.printStackTrace(); } } }
[ "support@javonet.com" ]
support@javonet.com
664423878c2ed83ea7dbbdd68e122f9f1b8e3727
e658b48ddb5424ce768f25e6cc92ff87b66feff8
/MyApplication/app/src/main/java/com/example/silencew/test/list2.java
e79ef414320d4ace686a889af735c7d963f7ad71
[]
no_license
Zohar727/KuaiJiZhang
329543eda7a59e2b0c07f975e3a5de5b4b5bc225
71cae170d57dd9b7b2050a547054e136c2b9abcd
refs/heads/master
2020-05-22T21:17:10.743838
2017-03-24T03:22:06
2017-03-24T03:22:06
84,725,351
0
0
null
null
null
null
UTF-8
Java
false
false
6,218
java
package com.example.silencew.test; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.os.Vibrator; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; import android.view.View; import android.widget.Toast; import com.example.silencew.test.bean.Income; import com.example.silencew.test.bean.Spend; import com.example.silencew.test.dao.AllBillDao; import com.example.silencew.test.dao.IncomeDao; import java.util.List; /** * Created by silence.w on 2016-12-13. * 所有账单 */ public class list2 extends AppCompatActivity { private RecyclerView mRecyclerview; private List<Spend> mDatas; //数据库操作类 private AllBillDao dao; private int id=1; private MySimpleAdapter2 mAdapter; private ItemTouchHelper itemTouchHelper;//用于拖拽,滑动 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list2); initDatas(); initView(); dao = new AllBillDao(this); mDatas=dao.queryAll(); mAdapter = new MySimpleAdapter2(this, mDatas); mRecyclerview.setAdapter(mAdapter); //设置RecyclerView的布局管理 LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); mRecyclerview.setLayoutManager(linearLayoutManager); //设置点击事件 mAdapter.setOnItemClickListener(new MySimpleAdapter2.onItemClickListener() { @Override public void onItemClick(View view, int position) { // Toast.makeText(list2.this,"click:"+position+"",Toast.LENGTH_SHORT).show(); final Spend a = mDatas.get(position); int oId = a.getId(); double oMoney = a.getMoney(); String oTime = a.getTime(); int oType = a.getType(); String oMark = a.getMark(); String omType=a.getmType(); int tabNum; if(omType.equals("spend")){ tabNum = 0; }else { tabNum = 1; } Bundle bundle = new Bundle(); bundle.putInt("id",oId); bundle.putDouble("money",oMoney); bundle.putString("time",oTime); bundle.putInt("type",oType); bundle.putString("mark",oMark); bundle.putInt("tabNum",tabNum); Intent intent = new Intent(list2.this,Jizhang.class); intent.putExtras(bundle); startActivity(intent); finish(); } @Override public void onItemLongClick(View view, int position) { // Toast.makeText(list2.this,"Long click:"+position+"",Toast.LENGTH_SHORT).show(); } }); itemTouchHelper = new ItemTouchHelper(new ItemTouchHelper.Callback(){ //设置移动方式 @Override public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { final int dragFlags;//拖动标志 final int swipeFlags;//滑动标志 if (recyclerView.getLayoutManager() instanceof GridLayoutManager) { dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN | ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT; swipeFlags = 0; } else { dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN; swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END; } return makeMovementFlags(dragFlags, swipeFlags); } //移动过程中调用 @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { // int fromPosition = viewHolder.getAdapterPosition(); // int toPosition = target.getAdapterPosition(); // data.add(toPosition, data.remove(fromPosition)); // adapter.notifyItemMoved(fromPosition, toPosition); return false; } //侧滑过程中调用 @Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { int position = viewHolder.getAdapterPosition(); final Spend a= mDatas.get(position); mAdapter.notifyItemRemoved(position); mDatas.remove(position); dao.delete(a.getId(),a.getmType()); } //是否可以拖拽移动位置 @Override public boolean isLongPressDragEnabled() { return false; } //当长按的时候调用 @Override public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) { if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) { viewHolder.itemView.setBackgroundColor(Color.LTGRAY); } //震动提示 Vibrator vibrator = (Vibrator) list2.this.getSystemService(VIBRATOR_SERVICE); vibrator.vibrate(35); super.onSelectedChanged(viewHolder, actionState); } //当手指松开的时候调用 @Override public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { super.clearView(recyclerView, viewHolder); viewHolder.itemView.setBackgroundColor(Color.parseColor("#ffffff")); } }); itemTouchHelper.attachToRecyclerView(mRecyclerview); } private void initView() { mRecyclerview = (RecyclerView) findViewById(R.id.id_recyclerview2); } private void initDatas() { } }
[ "wuzhihao1996727@qq.com" ]
wuzhihao1996727@qq.com
9a0ae60d3b3426a41b9ea4170b4f0e710519a88c
a99d16714bf3b2c98450b1941afce38cfafa1b82
/app/src/main/java/com/transo/realmexample/model/Book.java
3db3a88e75ce089254a5f3a432cc6a1ea8101cd4
[]
no_license
aayazkhan/AndroidRealmExample
07750e436771bf3cbaaf763cb6b70bbfa5e5303e
148db6d9ca0e02f2b1b6b6c36b024fe5420add9a
refs/heads/master
2020-07-22T14:21:02.442775
2019-09-09T05:37:16
2019-09-09T05:37:16
207,231,755
0
0
null
null
null
null
UTF-8
Java
false
false
1,518
java
package com.transo.realmexample.model; import android.view.View; import java.util.Date; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; public class Book extends RealmObject { @PrimaryKey private String id; private String title; private String description; private Date addedOn; private Date modifiledOn; public Book() { } public Book(String id, String title, Date addedOn) { this.id = id; this.title = title; this.addedOn = addedOn; } public String getId() { return id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Date getAddedOn() { return addedOn; } public void setAddedOn(Date addedOn) { this.addedOn = addedOn; } public Date getModifiledOn() { return modifiledOn; } public void setModifiledOn(Date modifiledOn) { this.modifiledOn = modifiledOn; } public interface OnViewClickListner { void onClick(View v, int position, Book book); } public interface OnEditClickListner { void onClick(View v, int position, Book book); } public interface OnDeleteClickListner { void onClick(View v, int position, Book book); } }
[ "development@transovative.com" ]
development@transovative.com
8b5c13c20809a5018c8277bd1d08aa55b43dc621
6d3bd01fbdffb42af00d11eee1ad4b209db7064c
/BioStar2Android/BioStar2Client/src/main/java/com/supremainc/biostar2/setting/PreferenceFragmentLayout.java
fdc4d6ca4a3ddbe5ff91a0f8da04a9ae34717754
[ "Apache-2.0" ]
permissive
uisuk/BioStar2Android
ed3db107c5f59f382c266ff8fd07d9ceb92eda56
a8faec3359e0b7750303b7600725466745526349
refs/heads/master
2020-05-20T19:31:08.009123
2016-04-26T08:44:08
2016-04-26T08:44:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,224
java
/* * Copyright 2015 Suprema(biostar2@suprema.co.kr) * * 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.supremainc.biostar2.setting; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import com.supremainc.biostar2.R; import com.supremainc.biostar2.base.BaseFragment; import com.supremainc.biostar2.base.BaseFragmentLayout; import com.supremainc.biostar2.widget.OnSingleClickListener; import com.supremainc.biostar2.widget.StyledTextView; import com.supremainc.biostar2.widget.SwitchView; import java.util.ArrayList; public class PreferenceFragmentLayout extends BaseFragmentLayout { private final String TAG = getClass().getSimpleName(); private PreferenceFragmentLayoutEvent mLayoutEvent; private StyledTextView mDateFormat; private LinearLayout mNotification; private ArrayList<SwitchView> mSwitchViewList; private StyledTextView mTimeFormat; private OnSingleClickListener mClickListener = new OnSingleClickListener() { @Override public void onSingleClick(View v) { if (mLayoutEvent == null) { return; } switch (v.getId()) { case R.id.go_version_mobile: mLayoutEvent.onClickUpdate(); break; case R.id.go_date: mLayoutEvent.onClickDate(); break; case R.id.go_time: mLayoutEvent.onClickTime(); break; } } }; public PreferenceFragmentLayout(BaseFragment fragment, PreferenceFragmentLayoutEvent layoutEvent) { super(fragment); mLayoutEvent = layoutEvent; } public void addSwitchView(String description, boolean subscribed, String type) { if (mSwitchViewList == null) { mSwitchViewList = new ArrayList<SwitchView>(); } LinearLayout mainLayout = (LinearLayout) mLayoutInflater.inflate(R.layout.view_push_switch, null); StyledTextView descrptionView = (StyledTextView) mainLayout.findViewById(R.id.descrption); setTextView(descrptionView, description); SwitchView switchView = (SwitchView) mainLayout.findViewById(R.id.push_switch); switchView.init(mActivity, null, false); switchView.setSwitch(subscribed); switchView.setTag(type); mSwitchViewList.add(switchView); mNotification.addView(mainLayout); } public String getDateFormat() { return (String) getTag(mDateFormat); } public void setDateFormat(String content) { setTag(mDateFormat, content); } public ArrayList<SwitchView> getSwitchViewList() { return mSwitchViewList; } public String getTimeFormat() { return (String) getTag(mTimeFormat); } public void setTimeFormat(String content) { setTag(mTimeFormat, content); } public View initView(BaseFragment fragment, LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = super.initView(fragment, inflater, container, savedInstanceState, R.layout.fragment_prefernce); mNotification = (LinearLayout) v.findViewById(R.id.notification); mDateFormat = (StyledTextView) v.findViewById(R.id.dateformat); mTimeFormat = (StyledTextView) v.findViewById(R.id.timeformat); int[] ids = {R.id.go_version_mobile, R.id.go_date, R.id.go_time}; for (int i : ids) { v.findViewById(i).setOnClickListener(mClickListener); } return v; } public void setAppVersion(String content) { setTextView(R.id.version_mobile, content); } public void setDateDevider(String content) { setTextView(R.id.devider_date, content); } public void setDateFormatName(String content) { setTextView(mDateFormat, content); } public void setNewVersion() { mRootView.findViewById(R.id.version_mobile_new).setVisibility(View.VISIBLE); } public void setTimeFormatName(String content) { setTextView(mTimeFormat, content); } public void setTimezone(String content) { setTextView(R.id.timezone, content); } public void showNotification(boolean isVisible) { int visible; if (isVisible) { visible = View.VISIBLE; } else { visible = View.GONE; } mNotification.setVisibility(visible); } public interface PreferenceFragmentLayoutEvent { public void onClickDate(); public void onClickTime(); public void onClickUpdate(); } }
[ "isbaek@suprema.co.kr" ]
isbaek@suprema.co.kr
ed66f5a1bf1423f29ee850e68c182581b16a64cd
1a875efcabfb7cc1ef0b3107090829a64b1224a9
/code/src/com/sail/cot/domain/CotFinacegiven.java
18391e982b2efc9b60776cb49482bf1435de96e6
[]
no_license
achui1980/wolly_new
7f7255b54d3c47a99fb49e3a98e7045104fe1e06
09345d694565d5c0287387da122eb15c1dcd7e64
refs/heads/master
2016-09-05T10:19:26.810556
2015-05-12T06:17:11
2015-05-12T06:17:11
32,016,250
0
0
null
null
null
null
UTF-8
Java
false
false
5,157
java
package com.sail.cot.domain; import java.util.Date; import java.util.HashSet; import java.util.Set; /** * CotFinacegiven entity. * * @author MyEclipse Persistence Tools */ public class CotFinacegiven implements java.io.Serializable { // Fields private Integer id; private String finaceNo; private String finaceName; private Date finaceRecvDate; private Double amount; private Double bankFee; private Double realAmount; private Double remainAmount; private String finaceRemark; private Integer payTypeid; private Integer factoryId; private Integer bankId; private Integer currencyId; private Date addTime; private Integer finaceStatus; private String orderNo; private Integer fkId; private String source; private Integer companyId; private Integer givenPerson; private Integer addPerson; private Set cotFinacegivenDetails = new HashSet(0); private String op; // Constructors /** default constructor */ public CotFinacegiven() { } /** full constructor */ public CotFinacegiven(String finaceNo, Date finaceRecvDate, Double amount, Double bankFee, Double realAmount, Double remainAmount, String finaceRemark, Integer payTypeid, Integer factoryId, Integer bankId, Integer currencyId, Date addTime, Integer finaceStatus, String orderNo, Integer fkId, String source, Integer companyId, Set cotFinacegivenDetails) { this.finaceNo = finaceNo; this.finaceRecvDate = finaceRecvDate; this.amount = amount; this.bankFee = bankFee; this.realAmount = realAmount; this.remainAmount = remainAmount; this.finaceRemark = finaceRemark; this.payTypeid = payTypeid; this.factoryId = factoryId; this.bankId = bankId; this.currencyId = currencyId; this.addTime = addTime; this.finaceStatus = finaceStatus; this.orderNo = orderNo; this.fkId = fkId; this.source = source; this.companyId = companyId; this.cotFinacegivenDetails = cotFinacegivenDetails; } // Property accessors public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public String getFinaceNo() { return this.finaceNo; } public void setFinaceNo(String finaceNo) { this.finaceNo = finaceNo; } public Date getFinaceRecvDate() { return this.finaceRecvDate; } public void setFinaceRecvDate(Date finaceRecvDate) { this.finaceRecvDate = finaceRecvDate; } public Double getAmount() { return this.amount; } public void setAmount(Double amount) { this.amount = amount; } public Double getBankFee() { return this.bankFee; } public void setBankFee(Double bankFee) { this.bankFee = bankFee; } public Double getRealAmount() { return this.realAmount; } public void setRealAmount(Double realAmount) { this.realAmount = realAmount; } public Double getRemainAmount() { return this.remainAmount; } public void setRemainAmount(Double remainAmount) { this.remainAmount = remainAmount; } public String getFinaceRemark() { return this.finaceRemark; } public void setFinaceRemark(String finaceRemark) { this.finaceRemark = finaceRemark; } public Integer getPayTypeid() { return this.payTypeid; } public void setPayTypeid(Integer payTypeid) { this.payTypeid = payTypeid; } public Integer getFactoryId() { return this.factoryId; } public void setFactoryId(Integer factoryId) { this.factoryId = factoryId; } public Integer getBankId() { return this.bankId; } public void setBankId(Integer bankId) { this.bankId = bankId; } public Integer getCurrencyId() { return this.currencyId; } public void setCurrencyId(Integer currencyId) { this.currencyId = currencyId; } public Date getAddTime() { return this.addTime; } public void setAddTime(Date addTime) { this.addTime = addTime; } public Integer getFinaceStatus() { return this.finaceStatus; } public void setFinaceStatus(Integer finaceStatus) { this.finaceStatus = finaceStatus; } public String getOrderNo() { return this.orderNo; } public void setOrderNo(String orderNo) { this.orderNo = orderNo; } public Integer getFkId() { return this.fkId; } public void setFkId(Integer fkId) { this.fkId = fkId; } public String getSource() { return this.source; } public void setSource(String source) { this.source = source; } public Integer getCompanyId() { return this.companyId; } public void setCompanyId(Integer companyId) { this.companyId = companyId; } public Set getCotFinacegivenDetails() { return this.cotFinacegivenDetails; } public void setCotFinacegivenDetails(Set cotFinacegivenDetails) { this.cotFinacegivenDetails = cotFinacegivenDetails; } public String getFinaceName() { return finaceName; } public void setFinaceName(String finaceName) { this.finaceName = finaceName; } public Integer getGivenPerson() { return givenPerson; } public void setGivenPerson(Integer givenPerson) { this.givenPerson = givenPerson; } public Integer getAddPerson() { return addPerson; } public void setAddPerson(Integer addPerson) { this.addPerson = addPerson; } public String getOp() { return op; } public void setOp(String op) { this.op = op; } }
[ "achui_1980@163.com" ]
achui_1980@163.com
2c36ffd5837f61f73d7d62189b0f5001b5703677
891ea7b92cc9bd3c60c6276008f5fab5a2f4d261
/jpa-demo-three/src/main/java/com/example/jpa/three/controller/TestController.java
189f01d715acb93a2ffebf9554a2d547074de15c
[]
no_license
newlyfei/jpa-demo
fd27dc175429ed45567a2ca6390465268f54a9cb
77f757dee2b34d6e07c62624a66be081dbc5655d
refs/heads/master
2020-04-10T21:00:40.207392
2018-12-11T06:44:34
2018-12-11T06:44:34
161,285,422
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package com.example.jpa.three.controller; import com.example.jpa.three.repository.domain.DataList; import com.example.jpa.three.service.TestService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(value = "/test") public class TestController { @Autowired private TestService testService; @ResponseBody @RequestMapping(value = "/{id}",method = RequestMethod.GET) public DataList test(){ DataList dataList=testService.getOne(1l); System.out.println(dataList.getUsername()); return dataList; } }
[ "lyf1986@foxmail.com" ]
lyf1986@foxmail.com
4515266b90929baa4aa07c37d9d5af90d4c10467
3a2fd700a3c225525ac8f1388b50a7c686165c43
/app/src/main/java/com/aihao/shortvideojava/ui/detail/ImageViewHandler.java
a8c6f8f89fbcd8fb859f114417321d23d992ff57
[]
no_license
q707172686/shortVideoJava
409111a3e749ccf995f2686262fa66bb330d0c1b
a8320941c8894ad17da9abefd5507c85dffcb3af
refs/heads/master
2022-11-11T02:38:50.423606
2020-05-19T04:52:38
2020-05-19T04:52:38
256,108,315
0
0
null
null
null
null
UTF-8
Java
false
false
2,205
java
package com.aihao.shortvideojava.ui.detail; import android.view.LayoutInflater; import android.view.View; import androidx.annotation.NonNull; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.RecyclerView; import com.aihao.shortvideojava.R; import com.aihao.shortvideojava.databinding.ActivityFeedDetailTypeImageBinding; import com.aihao.shortvideojava.databinding.LayoutFeedDetailTypeImageHeaderBinding; import com.aihao.shortvideojava.model.Feed; import com.aihao.shortvideojava.view.PPImageView; public class ImageViewHandler extends ViewHandler { protected ActivityFeedDetailTypeImageBinding mImageBinding; protected LayoutFeedDetailTypeImageHeaderBinding mHeaderBinding; public ImageViewHandler(FragmentActivity activity) { super(activity); mImageBinding = DataBindingUtil.setContentView(activity, R.layout.activity_feed_detail_type_image); mInateractionBinding = mImageBinding.interactionLayout; mRecyclerView = mImageBinding.recyclerView; } @Override public void bindInitData(Feed feed) { super.bindInitData(feed); mImageBinding.setFeed(mFeed); mHeaderBinding = LayoutFeedDetailTypeImageHeaderBinding.inflate(LayoutInflater.from(mActivity), mRecyclerView, false); mHeaderBinding.setFeed(mFeed); PPImageView headerImage = mHeaderBinding.headerImage; headerImage.bindData(mFeed.width, mFeed.height, mFeed.width > mFeed.height ? 0 : 16, mFeed.cover); listAdapter.addHeaderView(mHeaderBinding.getRoot()); mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); boolean visible = mHeaderBinding.getRoot().getTop() <= -mImageBinding.titleLayout.getMeasuredHeight(); mImageBinding.authorInfoLayout.getRoot().setVisibility(visible ? View.VISIBLE : View.GONE); mImageBinding.title.setVisibility(visible ? View.GONE : View.VISIBLE); } }); } }
[ "jiajia6662008@gmail.com" ]
jiajia6662008@gmail.com
f4c55d5ab0fcac1597fc5d64e79f6399c124e7d3
55f5f5496262d02d8ed4a25925ad6c043af1c800
/src/main/java/webdev/services/ModuleService.java
1d66d9c09b72d01b5dfe7ca84b5200a57960ad22
[]
no_license
suji106/webdev-1-summer1-web-server-sarram
b06eccd28f0b6801d07f6746e6146ade11b6c209
0c66a238c30a5847ee3e934a20a457a5ad1e4d27
refs/heads/master
2020-03-17T02:41:28.956238
2018-06-19T00:33:29
2018-06-19T00:33:29
133,200,926
0
0
null
null
null
null
UTF-8
Java
false
false
2,972
java
package webdev.services; import java.util.Date; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import webdev.models.Course; import webdev.models.Module; import webdev.repositories.CourseRepository; import webdev.repositories.ModuleRepository; @RestController @CrossOrigin(origins = "*", maxAge = 3600) public class ModuleService { @Autowired(required = true) CourseRepository courseRepository; @Autowired(required = true) ModuleRepository moduleRepository; @PostMapping("/api/course/{courseId}/module") public Module createModule( @PathVariable("courseId") int courseId, @RequestBody Module newModule) { Optional<Course> data = courseRepository.findById(courseId); if(data.isPresent()) { Course course = data.get(); newModule.setCourse(course); changeModifiedCourse(course, newModule.getModified()); return moduleRepository.save(newModule); } return null; } @PutMapping("/api/course/module") public Course updateModule(@RequestBody Module newModule) { Course course = changeModifiedCourse(newModule.getCourse(), newModule.getModified()); return course; } @GetMapping("/api/course/{courseId}/module") public List<Module> findAllModulesForCourse( @PathVariable("courseId") int courseId) { Optional<Course> data = courseRepository.findById(courseId); if(data.isPresent()) { Course course = data.get(); return course.getModules(); } return null; } @GetMapping("/api/module/{moduleId}") public Optional<Module> getModule(@PathVariable("moduleId") String module_id) { int moduleId = Integer.parseInt(module_id); return moduleRepository.findById(moduleId); } @DeleteMapping("/api/module/{moduleId}") public void deleteModule(@PathVariable("moduleId") String module_id) { int moduleId = Integer.parseInt(module_id); List<Course> courseIds = (List<Course>) moduleRepository.findCourseByModelId(moduleId); Date modified = new Date(); moduleRepository.deleteById(moduleId); changeModifiedCourse(courseRepository.findById(courseIds.get(0).getId()).get(), modified); } public Course changeModifiedCourse(Course course, Date modified) { course.setModified(modified); Course newCourse = new Course(); newCourse.setCreated(course.getCreated()); newCourse.setId(course.getId()); newCourse.setModified(modified); newCourse.setTitle(course.getTitle()); newCourse.setModules(course.getModules()); return newCourse; } }
[ "suji.srivardhan@gmail.com" ]
suji.srivardhan@gmail.com
9aeb0f1433e9b026cbb93883304ec804d7fdc91c
bad5b4ba2e253d10737a06c7df88f19340aa829f
/lesson_5/Task_4_5_6.java
2f39808a23911318a08e902a3efac570d8e29482
[]
no_license
AnnaDubininaV/javaintro
a11c78cc97a79f6c3b9f2a69727d04d0143280c3
c3e3e0b2af886017c26fb288c028bcc4664b7538
refs/heads/master
2020-04-18T23:01:32.370284
2019-04-20T14:15:14
2019-04-20T14:15:14
167,685,387
0
0
null
null
null
null
UTF-8
Java
false
false
1,772
java
package lesson_5; public class Task_4_5_6 { public static void main(String[] args) { int[] myArray = new int[]{15, 8, 2, 1, 22, 5, 108, 23}; // Задание 4 // Найти максимальный элемент в массиве. // int maxElement = findMaxElement(myArray); // System.out.println("Максимальный элемент в массиве: " + maxElement); // Задание 5 // Вывести все элементы на консоль по порядку в формате [1,2,3,4,5] // printArray(myArray); // Task_6 // Тоже самое только в обратном int [] reversedArray = reversArray(myArray); printArray(reversedArray); // int[]newArray = new int[myArray.length]; // for(int i=0, j = newArray.length-1; i<myArray.length; i++, j--){ // newArray [j] = myArray [i]; // } ; } public static int findMaxElement(int[] arr) { int max = arr[0]; for (int i = 0; i < arr.length; i++) { if (arr[i] > arr[0]) { max = arr[i]; } i++; } return max; } public static void printArray (int[] arrayToPrint) { System.out.print("["); for (int i = 0; i <arrayToPrint.length; i++) { if (i==arrayToPrint.length-1){ System.out.print(arrayToPrint[i] + "]"); break; } else System.out.print ( arrayToPrint[i] + "," ); } } public static int[] reversArray(int[] arr) { int[] newArray = new int[arr.length]; for (int i = 0, j = newArray.length - 1; i < arr.length; i++, j--) { newArray[j] = arr[i]; }return newArray; } }
[ "anna.dybinina.1@gmail.com" ]
anna.dybinina.1@gmail.com
3cece98edc0ecda6962416ca0f16deb057796ccd
07b68fc944fbbb4c2e4762f0d495c0b769971825
/java/Dddml.Wms.JavaCommon/src/generated/java/org/dddml/wms/domain/shipment/ShipmentCommands.java
5c8383729942ca3557f8f56c70d5f12c50fa27c9
[]
no_license
uwitec/wms-8
de6971975b3e209f295e745a8647e0075f4b0654
957cce2dc75be4c73ba35464942f33d9dec55cba
refs/heads/master
2020-03-27T17:47:44.335027
2018-08-31T07:57:20
2018-08-31T07:57:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
31,785
java
package org.dddml.wms.domain.shipment; import java.util.*; import java.util.Date; import org.dddml.wms.domain.*; public class ShipmentCommands { private ShipmentCommands() { } public static class Import implements ShipmentCommand { public String getCommandType() { return "Import"; } public void setCommandType(String commandType) { //do nothing } /** * Shipment Type Id */ private String shipmentTypeId; public String getShipmentTypeId() { return this.shipmentTypeId; } public void setShipmentTypeId(String shipmentTypeId) { this.shipmentTypeId = shipmentTypeId; } /** * Primary Order Id */ private String primaryOrderId; public String getPrimaryOrderId() { return this.primaryOrderId; } public void setPrimaryOrderId(String primaryOrderId) { this.primaryOrderId = primaryOrderId; } /** * Primary Return Id */ private String primaryReturnId; public String getPrimaryReturnId() { return this.primaryReturnId; } public void setPrimaryReturnId(String primaryReturnId) { this.primaryReturnId = primaryReturnId; } /** * Bill of lading */ private String bolNumber; public String getBolNumber() { return this.bolNumber; } public void setBolNumber(String bolNumber) { this.bolNumber = bolNumber; } /** * Vehicle Id */ private String vehicleId; public String getVehicleId() { return this.vehicleId; } public void setVehicleId(String vehicleId) { this.vehicleId = vehicleId; } /** * Seal Number */ private String sealNumber; public String getSealNumber() { return this.sealNumber; } public void setSealNumber(String sealNumber) { this.sealNumber = sealNumber; } /** * External Order Number */ private String externalOrderNumber; public String getExternalOrderNumber() { return this.externalOrderNumber; } public void setExternalOrderNumber(String externalOrderNumber) { this.externalOrderNumber = externalOrderNumber; } /** * Carrier */ private String carrier; public String getCarrier() { return this.carrier; } public void setCarrier(String carrier) { this.carrier = carrier; } /** * Date Shipped */ private java.sql.Timestamp dateShipped; public java.sql.Timestamp getDateShipped() { return this.dateShipped; } public void setDateShipped(java.sql.Timestamp dateShipped) { this.dateShipped = dateShipped; } /** * Estimated Ready Date */ private java.sql.Timestamp estimatedReadyDate; public java.sql.Timestamp getEstimatedReadyDate() { return this.estimatedReadyDate; } public void setEstimatedReadyDate(java.sql.Timestamp estimatedReadyDate) { this.estimatedReadyDate = estimatedReadyDate; } /** * Estimated Ship Date */ private java.sql.Timestamp estimatedShipDate; public java.sql.Timestamp getEstimatedShipDate() { return this.estimatedShipDate; } public void setEstimatedShipDate(java.sql.Timestamp estimatedShipDate) { this.estimatedShipDate = estimatedShipDate; } /** * Estimated Arrival Date */ private java.sql.Timestamp estimatedArrivalDate; public java.sql.Timestamp getEstimatedArrivalDate() { return this.estimatedArrivalDate; } public void setEstimatedArrivalDate(java.sql.Timestamp estimatedArrivalDate) { this.estimatedArrivalDate = estimatedArrivalDate; } /** * Latest Cancel Date */ private java.sql.Timestamp latestCancelDate; public java.sql.Timestamp getLatestCancelDate() { return this.latestCancelDate; } public void setLatestCancelDate(java.sql.Timestamp latestCancelDate) { this.latestCancelDate = latestCancelDate; } /** * Estimated Ship Cost */ private java.math.BigDecimal estimatedShipCost; public java.math.BigDecimal getEstimatedShipCost() { return this.estimatedShipCost; } public void setEstimatedShipCost(java.math.BigDecimal estimatedShipCost) { this.estimatedShipCost = estimatedShipCost; } /** * Currency Uom Id */ private String currencyUomId; public String getCurrencyUomId() { return this.currencyUomId; } public void setCurrencyUomId(String currencyUomId) { this.currencyUomId = currencyUomId; } /** * Handling Instructions */ private String handlingInstructions; public String getHandlingInstructions() { return this.handlingInstructions; } public void setHandlingInstructions(String handlingInstructions) { this.handlingInstructions = handlingInstructions; } /** * Origin Facility Id */ private String originFacilityId; public String getOriginFacilityId() { return this.originFacilityId; } public void setOriginFacilityId(String originFacilityId) { this.originFacilityId = originFacilityId; } /** * Destination Facility Id */ private String destinationFacilityId; public String getDestinationFacilityId() { return this.destinationFacilityId; } public void setDestinationFacilityId(String destinationFacilityId) { this.destinationFacilityId = destinationFacilityId; } /** * Party Id To */ private String partyIdTo; public String getPartyIdTo() { return this.partyIdTo; } public void setPartyIdTo(String partyIdTo) { this.partyIdTo = partyIdTo; } /** * Party Id From */ private String partyIdFrom; public String getPartyIdFrom() { return this.partyIdFrom; } public void setPartyIdFrom(String partyIdFrom) { this.partyIdFrom = partyIdFrom; } /** * Additional Shipping Charge */ private java.math.BigDecimal additionalShippingCharge; public java.math.BigDecimal getAdditionalShippingCharge() { return this.additionalShippingCharge; } public void setAdditionalShippingCharge(java.math.BigDecimal additionalShippingCharge) { this.additionalShippingCharge = additionalShippingCharge; } /** * Addtl Shipping Charge Desc */ private String addtlShippingChargeDesc; public String getAddtlShippingChargeDesc() { return this.addtlShippingChargeDesc; } public void setAddtlShippingChargeDesc(String addtlShippingChargeDesc) { this.addtlShippingChargeDesc = addtlShippingChargeDesc; } /** * Shipment Items */ private List<ImportingShipmentItem> shipmentItems; public List<ImportingShipmentItem> getShipmentItems() { return this.shipmentItems; } public void setShipmentItems(List<ImportingShipmentItem> shipmentItems) { this.shipmentItems = shipmentItems; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class Ship implements ShipmentCommand { public String getCommandType() { return "Ship"; } public void setCommandType(String commandType) { //do nothing } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class ReceiveItem implements ShipmentCommand { public String getCommandType() { return "ReceiveItem"; } public void setCommandType(String commandType) { //do nothing } /** * Shipment Item Seq Id */ private String shipmentItemSeqId; public String getShipmentItemSeqId() { return this.shipmentItemSeqId; } public void setShipmentItemSeqId(String shipmentItemSeqId) { this.shipmentItemSeqId = shipmentItemSeqId; } /** * Attribute Set Instance */ private java.util.Map<String, Object> attributeSetInstance; public java.util.Map<String, Object> getAttributeSetInstance() { return this.attributeSetInstance; } public void setAttributeSetInstance(java.util.Map<String, Object> attributeSetInstance) { this.attributeSetInstance = attributeSetInstance; } /** * Rejection Reason Id */ private String rejectionReasonId; public String getRejectionReasonId() { return this.rejectionReasonId; } public void setRejectionReasonId(String rejectionReasonId) { this.rejectionReasonId = rejectionReasonId; } /** * Damage Status Ids */ private List<String> damageStatusIds; public List<String> getDamageStatusIds() { return this.damageStatusIds; } public void setDamageStatusIds(List<String> damageStatusIds) { this.damageStatusIds = damageStatusIds; } /** * Damage Reason Id */ private String damageReasonId; public String getDamageReasonId() { return this.damageReasonId; } public void setDamageReasonId(String damageReasonId) { this.damageReasonId = damageReasonId; } /** * Accepted Quantity */ private java.math.BigDecimal acceptedQuantity; public java.math.BigDecimal getAcceptedQuantity() { return this.acceptedQuantity; } public void setAcceptedQuantity(java.math.BigDecimal acceptedQuantity) { this.acceptedQuantity = acceptedQuantity; } /** * Rejected Quantity */ private java.math.BigDecimal rejectedQuantity; public java.math.BigDecimal getRejectedQuantity() { return this.rejectedQuantity; } public void setRejectedQuantity(java.math.BigDecimal rejectedQuantity) { this.rejectedQuantity = rejectedQuantity; } /** * Damaged Quantity */ private java.math.BigDecimal damagedQuantity; public java.math.BigDecimal getDamagedQuantity() { return this.damagedQuantity; } public void setDamagedQuantity(java.math.BigDecimal damagedQuantity) { this.damagedQuantity = damagedQuantity; } /** * Item Description */ private String itemDescription; public String getItemDescription() { return this.itemDescription; } public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class AddItemAndReceipt implements ShipmentCommand { public String getCommandType() { return "AddItemAndReceipt"; } public void setCommandType(String commandType) { //do nothing } /** * Receipt Seq Id */ private String receiptSeqId; public String getReceiptSeqId() { return this.receiptSeqId; } public void setReceiptSeqId(String receiptSeqId) { this.receiptSeqId = receiptSeqId; } /** * Product Id */ private String productId; public String getProductId() { return this.productId; } public void setProductId(String productId) { this.productId = productId; } /** * Attribute Set Instance */ private java.util.Map<String, Object> attributeSetInstance; public java.util.Map<String, Object> getAttributeSetInstance() { return this.attributeSetInstance; } public void setAttributeSetInstance(java.util.Map<String, Object> attributeSetInstance) { this.attributeSetInstance = attributeSetInstance; } /** * Rejection Reason Id */ private String rejectionReasonId; public String getRejectionReasonId() { return this.rejectionReasonId; } public void setRejectionReasonId(String rejectionReasonId) { this.rejectionReasonId = rejectionReasonId; } /** * Damage Status Ids */ private List<String> damageStatusIds; public List<String> getDamageStatusIds() { return this.damageStatusIds; } public void setDamageStatusIds(List<String> damageStatusIds) { this.damageStatusIds = damageStatusIds; } /** * Damage Reason Id */ private String damageReasonId; public String getDamageReasonId() { return this.damageReasonId; } public void setDamageReasonId(String damageReasonId) { this.damageReasonId = damageReasonId; } /** * Accepted Quantity */ private java.math.BigDecimal acceptedQuantity; public java.math.BigDecimal getAcceptedQuantity() { return this.acceptedQuantity; } public void setAcceptedQuantity(java.math.BigDecimal acceptedQuantity) { this.acceptedQuantity = acceptedQuantity; } /** * Rejected Quantity */ private java.math.BigDecimal rejectedQuantity; public java.math.BigDecimal getRejectedQuantity() { return this.rejectedQuantity; } public void setRejectedQuantity(java.math.BigDecimal rejectedQuantity) { this.rejectedQuantity = rejectedQuantity; } /** * Damaged Quantity */ private java.math.BigDecimal damagedQuantity; public java.math.BigDecimal getDamagedQuantity() { return this.damagedQuantity; } public void setDamagedQuantity(java.math.BigDecimal damagedQuantity) { this.damagedQuantity = damagedQuantity; } /** * Item Description */ private String itemDescription; public String getItemDescription() { return this.itemDescription; } public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class IssueItem implements ShipmentCommand { public String getCommandType() { return "IssueItem"; } public void setCommandType(String commandType) { //do nothing } /** * Shipment Item Seq Id */ private String shipmentItemSeqId; public String getShipmentItemSeqId() { return this.shipmentItemSeqId; } public void setShipmentItemSeqId(String shipmentItemSeqId) { this.shipmentItemSeqId = shipmentItemSeqId; } /** * Order Id */ private String orderId; public String getOrderId() { return this.orderId; } public void setOrderId(String orderId) { this.orderId = orderId; } /** * Order Item Seq Id */ private String orderItemSeqId; public String getOrderItemSeqId() { return this.orderItemSeqId; } public void setOrderItemSeqId(String orderItemSeqId) { this.orderItemSeqId = orderItemSeqId; } /** * Ship Group Seq Id */ private String shipGroupSeqId; public String getShipGroupSeqId() { return this.shipGroupSeqId; } public void setShipGroupSeqId(String shipGroupSeqId) { this.shipGroupSeqId = shipGroupSeqId; } /** * Product Id */ private String productId; public String getProductId() { return this.productId; } public void setProductId(String productId) { this.productId = productId; } /** * Locator Id */ private String locatorId; public String getLocatorId() { return this.locatorId; } public void setLocatorId(String locatorId) { this.locatorId = locatorId; } /** * Attribute Set Instance */ private java.util.Map<String, Object> attributeSetInstance; public java.util.Map<String, Object> getAttributeSetInstance() { return this.attributeSetInstance; } public void setAttributeSetInstance(java.util.Map<String, Object> attributeSetInstance) { this.attributeSetInstance = attributeSetInstance; } /** * Quantity */ private java.math.BigDecimal quantity; public java.math.BigDecimal getQuantity() { return this.quantity; } public void setQuantity(java.math.BigDecimal quantity) { this.quantity = quantity; } /** * Cancel Quantity */ private java.math.BigDecimal cancelQuantity; public java.math.BigDecimal getCancelQuantity() { return this.cancelQuantity; } public void setCancelQuantity(java.math.BigDecimal cancelQuantity) { this.cancelQuantity = cancelQuantity; } /** * Item Description */ private String itemDescription; public String getItemDescription() { return this.itemDescription; } public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class AddItemAndIssuance implements ShipmentCommand { public String getCommandType() { return "AddItemAndIssuance"; } public void setCommandType(String commandType) { //do nothing } /** * Order Id */ private String orderId; public String getOrderId() { return this.orderId; } public void setOrderId(String orderId) { this.orderId = orderId; } /** * Order Item Seq Id */ private String orderItemSeqId; public String getOrderItemSeqId() { return this.orderItemSeqId; } public void setOrderItemSeqId(String orderItemSeqId) { this.orderItemSeqId = orderItemSeqId; } /** * Ship Group Seq Id */ private String shipGroupSeqId; public String getShipGroupSeqId() { return this.shipGroupSeqId; } public void setShipGroupSeqId(String shipGroupSeqId) { this.shipGroupSeqId = shipGroupSeqId; } /** * Item Issuance Seq Id */ private String itemIssuanceSeqId; public String getItemIssuanceSeqId() { return this.itemIssuanceSeqId; } public void setItemIssuanceSeqId(String itemIssuanceSeqId) { this.itemIssuanceSeqId = itemIssuanceSeqId; } /** * Product Id */ private String productId; public String getProductId() { return this.productId; } public void setProductId(String productId) { this.productId = productId; } /** * Locator Id */ private String locatorId; public String getLocatorId() { return this.locatorId; } public void setLocatorId(String locatorId) { this.locatorId = locatorId; } /** * Attribute Set Instance */ private java.util.Map<String, Object> attributeSetInstance; public java.util.Map<String, Object> getAttributeSetInstance() { return this.attributeSetInstance; } public void setAttributeSetInstance(java.util.Map<String, Object> attributeSetInstance) { this.attributeSetInstance = attributeSetInstance; } /** * Quantity */ private java.math.BigDecimal quantity; public java.math.BigDecimal getQuantity() { return this.quantity; } public void setQuantity(java.math.BigDecimal quantity) { this.quantity = quantity; } /** * Cancel Quantity */ private java.math.BigDecimal cancelQuantity; public java.math.BigDecimal getCancelQuantity() { return this.cancelQuantity; } public void setCancelQuantity(java.math.BigDecimal cancelQuantity) { this.cancelQuantity = cancelQuantity; } /** * Item Description */ private String itemDescription; public String getItemDescription() { return this.itemDescription; } public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class ConfirmAllItemsReceived implements ShipmentCommand { public String getCommandType() { return "ConfirmAllItemsReceived"; } public void setCommandType(String commandType) { //do nothing } /** * Destination Locator Id */ private String destinationLocatorId; public String getDestinationLocatorId() { return this.destinationLocatorId; } public void setDestinationLocatorId(String destinationLocatorId) { this.destinationLocatorId = destinationLocatorId; } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } public static class ConfirmAllItemsIssued implements ShipmentCommand { public String getCommandType() { return "ConfirmAllItemsIssued"; } public void setCommandType(String commandType) { //do nothing } /** * Shipment Id */ private String shipmentId; public String getShipmentId() { return this.shipmentId; } public void setShipmentId(String shipmentId) { this.shipmentId = shipmentId; } /** * Version */ private Long version; public Long getVersion() { return this.version; } public void setVersion(Long version) { this.version = version; } /** * Command Id */ private String commandId; public String getCommandId() { return this.commandId; } public void setCommandId(String commandId) { this.commandId = commandId; } /** * Requester Id */ private String requesterId; public String getRequesterId() { return this.requesterId; } public void setRequesterId(String requesterId) { this.requesterId = requesterId; } } }
[ "yangjiefeng@gmail.com" ]
yangjiefeng@gmail.com
c8e67755bff65f418611eaf676335aec27356d04
e31c2e5a4aaa0a7cf91d1450bcc06d308d1425e4
/android/dbapp/app/src/main/java/com/example/eom/dbapp/network/JustStringTask.java
8bb0f9badb312c8ed8a6d6962eceefa74287e3c6
[]
no_license
kyung2/cau_DB02
1e69a691d16561abff7c0e813fa353fcd0d10592
205c84ce1ee50b27a0e54f8a12e95c3a05114dd2
refs/heads/master
2021-06-17T08:19:07.929853
2017-06-09T04:24:14
2017-06-09T04:24:14
90,011,056
0
0
null
null
null
null
UTF-8
Java
false
false
1,534
java
package com.example.eom.dbapp.network; import android.os.AsyncTask; import android.util.Log; import org.json.JSONArray; import org.json.JSONObject; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import static com.example.eom.dbapp.network.NetworkManager.setupConnection; /** * Created by dhtpr on 2017-06-08. */ public abstract class JustStringTask extends AsyncTask<String, Void,String> { String murl; int id; protected JustStringTask(String url) { this.murl=url; } @Override protected String doInBackground(String... params) { InputStream inputStream; String strResult = ""; String result = null; try { URL url = new URL(NetworkManager.serverIP + murl); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); JSONObject jsonObject = new JSONObject(); jsonObject.put("id",id); String strJson = "data=" + jsonObject.toString(); Log.d("parsestring", strJson); setupConnection(strJson, urlConnection); inputStream = urlConnection.getInputStream(); if (inputStream != null) strResult = NetworkManager.convertInputStreamToString(inputStream); else strResult = "Did not work!"; Log.d("parsestring", strResult); return strResult; } catch (Exception e) { e.printStackTrace(); } return ""; } }
[ "sangwon0001@gmail.com" ]
sangwon0001@gmail.com
e85cf1e01e923e152a7234e184cf5731bd699cdc
a8ec302b28752614b53d814ce2c131d6b7b03109
/java/com/example/android/bluetoothlegatt/SampleGattAttributes.java
e5f53ea055ec2e3f9f31966cf2f2438fb8c9e2c8
[]
no_license
jtrfid/BluetoothLeGattSampleV2
bde3d5af9d4e058d1a2badcfa9536a0a195db990
1707d63f4e63fdb19a60dc99e6398d5e9decb0f3
refs/heads/master
2021-01-10T20:57:35.483984
2015-08-03T00:48:34
2015-08-03T00:48:34
40,098,588
0
0
null
null
null
null
UTF-8
Java
false
false
3,628
java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.bluetoothlegatt; import java.util.HashMap; /** * This class includes a small subset of standard GATT attributes for demonstration purposes. */ public class SampleGattAttributes { private static HashMap<String, String> attributes = new HashMap(); public static String HEART_RATE_MEASUREMENT = "00002a37-0000-1000-8000-00805f9b34fb"; public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb"; static { // Sample Services. attributes.put("0000180d-0000-1000-8000-00805f9b34fb", "Heart Rate Service"); attributes.put("0000180a-0000-1000-8000-00805f9b34fb", "Device Information Service"); // Sample Characteristics. attributes.put(HEART_RATE_MEASUREMENT, "Heart Rate Measurement"); attributes.put("00002a29-0000-1000-8000-00805f9b34fb", "Manufacturer Name String"); // Services attributes.put("0000191a-0000-1000-8000-00805f9b34fb","VOLIAM_SERVICE"); // Characteristics,00 00 00 00 00 00 attributes.put("00002b23-0000-1000-8000-00805f9b34fb","SYSTEM_ID_UUID"); // 可连接设备地址。保证模块在部署后,只有指定的蓝牙设备才能连接并修改参数。防止模块被恶意连接,并消耗电量。 attributes.put("00002b24-0000-1000-8000-00805f9b34fb","LOGIN_UUID"); // 当前时间 attributes.put("00002b25-0000-1000-8000-00805f9b34fb","DATETIME_UUID"); // iBeacon技术中的MajorID,MinorID attributes.put("00002b26-0000-1000-8000-00805f9b34fb","MAJOR_UUID"); attributes.put("00002b27-0000-1000-8000-00805f9b34fb","MINOR_UUID"); attributes.put("00002b28-0000-1000-8000-00805f9b34fb","SOFTWARE_REVISION_UUID"); // 固件版本号 attributes.put("00002b29-0000-1000-8000-00805f9b34fb","FIRMWARE_REVISION_UUID"); // iBeacon技术中公告时间间隔。可设定在100毫秒~10秒之间。 attributes.put("00002b2a-0000-1000-8000-00805f9b34fb","ADV_INT_UUID"); //发射功率(TXPower),可设定在65~225之间的值 attributes.put("00002b2b-0000-1000-8000-00805f9b34fb","TXPOWER_UUID"); // 工作时间段设定 attributes.put("00002b2c-0000-1000-8000-00805f9b34fb","WORK_TIME_UUID"); attributes.put("00002b2e-0000-1000-8000-00805f9b34fb","NAME_UUID"); attributes.put("00002b2f-0000-1000-8000-00805f9b34fb","未识别特征"); // Services attributes.put("0000180f-0000-1000-8000-00805f9b34fb","BATTERY_SERVICE"); //Characteristics,电池电量信息。可读取30~100%的电量值 attributes.put("00002a19-0000-1000-8000-00805f9b34fb","BATTERY_UUID"); } public static String lookup(String uuid, String defaultName) { String name = attributes.get(uuid); return name == null ? defaultName : name; } }
[ "jtrfid@qq.com" ]
jtrfid@qq.com
87bd8f174d11366d63c68e32e154166a6e8c7e4e
6030b5e16c65ff7b3fbd4e5ea001c7b6d49defec
/src/MainMenu.java
024222f05467bfcbae4f3187ed8a0d6261feff00
[]
no_license
Andrew-Seo/Snake-Game-
21fabc09377ca5a70fab5038f1fcf67a3eaef7c9
69486d5b7e2830da842a530557108976b9448ee2
refs/heads/master
2020-05-20T19:17:01.782151
2017-03-17T01:51:27
2017-03-17T01:51:27
84,511,934
0
0
null
2017-03-10T02:45:29
2017-03-10T02:45:29
null
UTF-8
Java
false
false
70
java
import javax.swing.JPanel; public class MainMenu extends JPanel { }
[ "league@iMac.attlocal.net" ]
league@iMac.attlocal.net
24d0c44544804df4e45b8638d55b4e0e7fa1be20
154a0920152d50cae9b6168a7aa9cf438316c9a4
/src/com/googlecode/utterlyidle/undertow/RestServer.java
8b781ed53beef6739e4a9e7616d6c25dcb1b7e1d
[]
no_license
theangrydev/utterlyidle
7fe5a8f0e9284f4489ab40b71b1e123a9a582aad
897d224235004dca1b35f1ee4a1ad4d25fac5b8a
refs/heads/master
2021-01-14T13:48:30.700213
2015-10-10T12:21:55
2015-10-10T12:21:55
44,527,561
0
0
null
2015-10-19T10:32:04
2015-10-19T10:32:04
null
UTF-8
Java
false
false
3,950
java
package com.googlecode.utterlyidle.undertow; import com.googlecode.totallylazy.Option; import com.googlecode.totallylazy.Sequences; import com.googlecode.totallylazy.io.Uri; import com.googlecode.utterlyidle.Application; import com.googlecode.utterlyidle.ApplicationBuilder; import com.googlecode.utterlyidle.ServerConfiguration; import com.googlecode.utterlyidle.examples.HelloWorldApplication; import com.googlecode.utterlyidle.services.Service; import io.undertow.Undertow; import java.io.IOException; import java.lang.reflect.Field; import java.net.ServerSocket; import java.util.List; import static com.googlecode.totallylazy.Option.none; import static com.googlecode.totallylazy.Option.option; import static com.googlecode.totallylazy.functions.Time0.calculateMilliseconds; import static com.googlecode.utterlyidle.ServerConfiguration.defaultConfiguration; import static java.lang.String.format; import static java.lang.System.nanoTime; public class RestServer implements com.googlecode.utterlyidle.Server { private final Application application; private final Undertow server; private Uri uri; public RestServer(Application application, ServerConfiguration configuration) throws Exception { this.application = application; server = startApp(application, configuration); } @Override public Application application() { return application; } @Override public Uri uri() { return uri; } @Override public void close() throws IOException { server.stop(); } public static void main(String[] args) throws Exception { ApplicationBuilder.application(HelloWorldApplication.class).start(defaultConfiguration().port(8002)); } private Undertow startApp(Application application, ServerConfiguration configuration) throws Exception { long start = nanoTime(); Undertow server = startUpServer(application, configuration); System.out.println(format("Listening on %s, started Undertow in %s msecs", uri, calculateMilliseconds(start, nanoTime()))); Service.functions.start().callConcurrently(this.application); return server; } private Undertow startUpServer(Application application, ServerConfiguration configuration) throws Exception { Undertow server = Undertow.builder() .addHttpListener(configuration.port(), configuration.bindAddress().getHostAddress()) .setWorkerThreads(configuration.maxThreadNumber()) .setHandler(new RestHttpHandler(application)) .build(); server.start(); uri = configuration.port(findPortInUse(server)).toUrl(); return server; } private int findPortInUse(Undertow server) { return declaredField(server, "channels") .map(field -> listValueOf(field, server)) .map(Sequences::sequence) .flatMap(channels -> channels .flatMap(this::portFrom) .headOption()) .getOrThrow(new IllegalStateException("Cannot find port from Undertow")); } private Option<Integer> portFrom(Object channel) throws Exception { return declaredField(channel, "socket") .map(socketField -> (ServerSocket) socketField.get(channel)) .map(ServerSocket::getLocalPort); } private List<Object> listValueOf(Field field, Object object) { try { return (List<Object>) field.get(object); } catch (IllegalAccessException e) { return null; } } private Option<Field> declaredField(Object object, String fieldName) { try { Field field = object.getClass().getDeclaredField(fieldName); field.setAccessible(true); return option(field); } catch (NoSuchFieldException e) { return none(); } } }
[ "james@infernus.org" ]
james@infernus.org
8eabf8061517ad7dba6207f02ef2e734b35fe6f9
95bec9ea0a0e3b84f1722cd6bf1aa19349e6099e
/src/main/java/org/mockito/internal/stubbing/answers/package-info.java
0596aa0b27cb9ecf6169ffd8e6e9ee0c1d79cae9
[ "MIT" ]
permissive
yangfancoming/mockito
fab90dbe69faf8958fc840208ed3e4a8801d7911
5aa9df3d4ffab02339081d1cf1a8fe691d1be20a
refs/heads/master
2020-06-13T21:21:25.181334
2019-07-02T05:39:51
2019-07-02T05:39:51
194,789,228
0
0
null
null
null
null
UTF-8
Java
false
false
87
java
/** * Answers for stubbed calls. */ package org.mockito.internal.stubbing.answers;
[ "34465021+jwfl724168@users.noreply.github.com" ]
34465021+jwfl724168@users.noreply.github.com
52665a2e0f0d610929d53bfa9857d9ba2a7d7931
7d5ebdee1ee000a04351f4a33176b78f16ac94a6
/src/Example/lucene/SearchNHilight.java
bb41cdcedb9f31dfb39ba1041cd0f6aec8550592
[]
no_license
cynner/WebAnalyse
3d7cfcb72459c4f7981f5c34b9c77e4fb6a2b1bc
d48faa646039dfc0f6b17e47591b054d21dc8306
refs/heads/master
2020-06-26T19:49:11.768742
2014-05-08T08:57:07
2014-05-08T08:57:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,460
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Example.lucene; import java.io.File; import java.io.IOException; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.th.ThaiAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.queryparser.classic.MultiFieldQueryParser; import org.apache.lucene.queryparser.classic.ParseException; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.highlight.Highlighter; import org.apache.lucene.search.highlight.InvalidTokenOffsetsException; import org.apache.lucene.search.highlight.QueryScorer; import org.apache.lucene.search.highlight.SimpleHTMLFormatter; import org.apache.lucene.search.highlight.TextFragment; import org.apache.lucene.search.highlight.TokenSources; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.util.Version; /** * * @author malang */ public class SearchNHilight { public static void main(String[] args) throws IOException, ParseException, InvalidTokenOffsetsException { //... Above, create documents with two fields, one with term vectors (tv) and one without (notv) Analyzer analyzer = new ThaiAnalyzer(Version.LUCENE_45); Directory index = FSDirectory.open(new File("data/indexing")); String querystr = args.length > 0 ? args[0] : "golf user"; // the "title" arg specifies the default field to use // when no field is explicitly specified in the query. Query query = new MultiFieldQueryParser(Version.LUCENE_45, new String[] {"content"}, analyzer).parse(querystr); // 3. search int hitsPerPage = 10; IndexReader reader = DirectoryReader.open(index); IndexSearcher searcher = new IndexSearcher(reader); TopDocs hits = searcher.search(query, 10); SimpleHTMLFormatter htmlFormatter = new SimpleHTMLFormatter(); Highlighter highlighter = new Highlighter(htmlFormatter, new QueryScorer(query)); String Preview; for (int i = 0; i < 10; i++) { int id = hits.scoreDocs[i].doc; Document doc = searcher.doc(id); String text; Preview = ""; System.out.println(doc.get("url")); System.out.println(doc.get("title")); text = doc.get("content"); TokenStream tokenStream = TokenSources.getAnyTokenStream(searcher.getIndexReader(), id, "content", analyzer); TextFragment[] frag = highlighter.getBestTextFragments(tokenStream, text, false, 10);//highlighter.getBestFragments(tokenStream, text, 3, "..."); int k=0; for (TextFragment frag1 : frag) { if ((frag1 != null) && (frag1.getScore() > 0)) { Preview += (frag1.toString()) + "...<br>"; k++; // Get 2 Line Preview if(k>=2) break; } } //Term vector System.out.println("-------------"); } } }
[ "princeofvamp@gmail.com" ]
princeofvamp@gmail.com
aea6dd3a4b3a7536cbd47338e8ba639d31c3b5e1
96ef541e7480866c0a4de65d32d926e8968113e9
/ten-square-article/src/main/java/com/ten/square/article/pojo/Column.java
5a54621bfeca76c3e81f4887ebfe1998f5e6b8c0
[]
no_license
limaob/ten-square-parent
02db40f64236db94edaeed8792184744412af39d
2637568f89d1f37e5b59c175e0c4b520a97b4caf
refs/heads/master
2020-05-02T21:04:31.014874
2019-05-10T09:30:27
2019-05-10T09:30:27
178,209,845
0
0
null
null
null
null
UTF-8
Java
false
false
1,432
java
package com.ten.square.article.pojo; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import java.io.Serializable; /** * column实体类 * @author Administrator * */ @Entity @Table(name="tb_column") public class Column implements Serializable{ @Id private String id;//ID private String name;//专栏名称 private String summary;//专栏简介 private String userid;//用户ID private java.util.Date createtime;//申请日期 private java.util.Date checktime;//审核日期 private String state;//状态 public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String getUserid() { return userid; } public void setUserid(String userid) { this.userid = userid; } public java.util.Date getCreatetime() { return createtime; } public void setCreatetime(java.util.Date createtime) { this.createtime = createtime; } public java.util.Date getChecktime() { return checktime; } public void setChecktime(java.util.Date checktime) { this.checktime = checktime; } public String getState() { return state; } public void setState(String state) { this.state = state; } }
[ "502483163@qq.com" ]
502483163@qq.com
38b7e8482589dd0c9dd078cafaa1c7292d344c28
cf529fa8df5f78211be9d9ddd2f491d2c0e9592c
/src/main/java/com/gs/reusebook/bean/Evaluation.java
4cb45bf79a2ec82c21e33a7c3c6713b1acba20d4
[]
no_license
DaDaDouDouer/atschool
d6b043772145aa7a235d9005b15e7e0c4a0495e7
18624c2827b1b0ed53f3da2fe0dce3ceb27fccad
refs/heads/master
2021-09-08T08:10:58.716501
2018-03-08T13:58:57
2018-03-08T13:58:57
113,050,236
20
0
null
2018-03-08T13:58:57
2017-12-04T14:05:51
Java
UTF-8
Java
false
false
1,205
java
package com.gs.reusebook.bean; import java.util.Date; /** * 对某个商品的评价 * * @author IceAsh * */ public class Evaluation { private String id; private String goodsId; private String sellername; private String userId; private String username; private String content; private Date createTime; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getGoodsId() { return goodsId; } public void setGoodsId(String goodsId) { this.goodsId = goodsId; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public void setUsername(String username) { this.username = username; } public String getUsername() { return username; } public String getSellername() { return sellername; } public void setSellername(String sellername) { this.sellername = sellername; } }
[ "rache21431@outlook.com" ]
rache21431@outlook.com
150ed8385645925337b90d89673bf44781991b22
b1823f878becf426996de27bc23d535769c671b9
/src/datetype_operator/operator07/AssigningOperator.java
cf23d02040afb2a3978a971624515f64441102b7
[]
no_license
huangxinjian/base-java
e80f918e15f330f81a97581ce7fabb8f8a15863d
885f2058be2e2a2da159f6a897ea415b6c62e9d5
refs/heads/master
2020-04-18T08:31:24.920073
2019-03-02T02:53:43
2019-03-02T02:53:43
167,399,285
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package datetype_operator.operator07; /** * @Author: huangxinjian * @Description: 赋值运算符以及赋值扩展运算符 * @Date: Created in 23:39 2019/1/25 * @Modified By: */ public class AssigningOperator { public static void main(String[] args) { /* 赋值运算符为 : = */ int a1 = 3; //把整形常量 3 赋值给 int 类型的变量 a1 /* 扩展运算符有: +=、-=、*=、/=、%= */ int a=3; int b=4; a+=b;//相当于a=a+b; System.out.println("a="+a+"\nb="+b); a=3; a*=b+3;//相当于a=a*(b+3) System.out.println("a="+a+"\nb="+b); } }
[ "924168702@qq.com" ]
924168702@qq.com
2306424a6d7f4a59148b9b18c7f515552e3420cd
4ee39e438d0767fcf2193bb332f2e23f1efef2df
/app/src/main/java/cn/leo/tcp/file/ReceiveFileListener.java
edde4dbc0abd6442fa42bbd77c32ec842401c12c
[]
no_license
jarryleo/ApkInstallClient
04a6ad4206de6b24ad5171f1dde4c1dfe4f13be1
009b2f7541dcfafaab19b23d1f6b5b1bca388a3a
refs/heads/master
2020-04-22T08:31:58.582660
2019-07-25T12:17:15
2019-07-25T12:17:15
170,245,351
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
package cn.leo.tcp.file; import java.util.Map; /** * @author : Jarry Leo * @date : 2019/1/26 14:33 */ public interface ReceiveFileListener { /** * 新文件传输请求 * * @param request */ void onNewFile(FileInfo fileInfo, NewFileRequest request); /** * 文件传输进度 * * @param fileProgressMap 文件名对应进度集合 */ void onFilesProgress(Map<String, Integer> fileProgressMap); /** * 文件传输出错 */ void onFileReceiveFailed(String fileName); /** * 接受文件成功 */ void onFileReceiveSuccess(String fileName); }
[ "liujiarui@ship56.net" ]
liujiarui@ship56.net
e4b3df604e94723e1cd085dc5ea3a76c9869f96a
a303f5c57ddb78c4828383b560fde01bd4cf9108
/Proiektua_denda/src/proiektua_denda/Proiektua_denda.java
cd4d08f846ec7b4f74ef0c602c3b23289ed4770d
[]
no_license
oaxpe/V2.0
1c233756fdd4e001e42360f9546a5a577a43b0ea
f6a485331f0567580184e0f2e6a82d1eba5b0232
refs/heads/master
2020-03-20T07:03:53.836870
2018-03-07T21:44:45
2018-03-07T21:44:45
137,269,682
0
0
null
null
null
null
UTF-8
Java
false
false
3,685
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package proiektua_denda; import gestioa.Metodoak; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static proiektua_denda.LangBezDenKudeatu.langBezDenKudeatu; import static proiektua_denda.prodKudMain.eskaeraKudMain; import static proiektua_denda.prodKudMain.horniKudMain; import static proiektua_denda.prodKudMain.prodKudMain; /** * * @author Oihane Axpe * @version 2.0 */ public class Proiektua_denda { /** * @param args the command line arguments */ public static void main(String[] args) { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); int aukera = 0; do { menuNagusia(); try { aukera = Integer.parseInt(br.readLine()); } catch (NumberFormatException datuOkerrak) { System.out.println(Metodoak.printGorriz("Zenbaki bat sartu behar zenuen.")); } catch (IOException gaizki) { System.out.println(Metodoak.printGorriz("Arazoak daude datuak sartzerakoan.")); } System.out.println(); switch (aukera) { //0.- Irten case 0: System.exit(0); // 1.- Langileak, bezeroak eta denda kudeatu. case 1: langBezDenKudeatu(); break; // 2.- Produktuak kudeatu. case 2: prodKudMain(); break; // 3.- Hornitzaileak kudeatu. case 3: horniKudMain(); break; // 4.- Eskaerak kudeatu. case 4: eskaeraKudMain(); break; default: System.out.println(Metodoak.printGorriz("Zenbaki okerra sartu duzu! Irakurri ondo aukerak eta aukeratu.")); pausa(); break; } } while (aukera!=0); } // PAUSA bat egiteko funtzioa public static void pausa() { try { System.out.println("\nSakatu 'Enter' jarraitzeko..."); System.in.read(); } catch (IOException gaizki) { System.out.println(Metodoak.printGorriz("Arazoak daude datuak sartzerakoan.")); } } public static void menuNagusia() { System.out.print("" + "'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n" + "'' MENU NAGUSIA ''\n" + "'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n" + "'' Zer egin nahi duzu? ''\n" + "'' 0.- Irten. ''\n" + "'' 1.- Langileak, bezeroak eta denda kudeatu. ''\n" + "'' 2.- Produktuak kudeatu. ''\n" + "'' 3.- Hornitzaileak kudeatu. ''\n" + "'' 4.- Eskaerak kudeatu. ''\n" + "'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n" + " Aukeratu: "); } }
[ "dm3-1-05.17@uni.eus" ]
dm3-1-05.17@uni.eus
7f4b8d7b24a03e414b5fadc28a5dde4d6954ead8
9493103efab08c8e683b3dddecbee5eb84ab3eee
/blossom-plan/src/main/java/cn/net/xyan/blossom/plan/service/JobRunner.java
6ca9ba2c7bcd1238256eb5caf62d2386395c8426
[]
no_license
zarraxx/blossom
c91bfa5852121197f03ee75dfdb66d00ee23e759
7df0e5b7b663a3efe24adbc498fa8a784c239361
refs/heads/master
2020-04-12T09:06:49.877073
2017-05-24T07:11:40
2017-05-24T07:11:40
61,516,080
0
0
null
null
null
null
UTF-8
Java
false
false
2,194
java
package cn.net.xyan.blossom.plan.service; import cn.net.xyan.blossom.core.exception.StatusAndMessageError; import cn.net.xyan.blossom.core.utils.ApplicationContextUtils; import cn.net.xyan.blossom.core.utils.ExceptionUtils; import cn.net.xyan.blossom.core.utils.JsonUtils; import com.fasterxml.jackson.databind.JavaType; import org.quartz.Job; import org.quartz.JobDataMap; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * Created by zarra on 16/6/16. */ public abstract class JobRunner implements Job { static public final String KeyTarget = "KeyTarget"; static public final String KeyAppContextBeans = "KeyAppContextBeans"; public Logger logger = LoggerFactory.getLogger(JobRunner.class); public abstract void runJob(String target, Map<String,Object> context); @Override public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap dataMap = context.getJobDetail().getJobDataMap(); String target = dataMap.getString(KeyTarget); String contextStringValue = dataMap.getString(KeyAppContextBeans); JavaType mapType = JsonUtils.mapType(String.class); try { Map<String,String> jobContext = JsonUtils.objectMapper().readValue(contextStringValue,mapType); Map<String,Object> runContext = new HashMap<>(); for (String key:jobContext.keySet()){ String value = jobContext.get(key); Object bean = ApplicationContextUtils.getBean(value); runContext.put(key,bean); } for (String key:dataMap.keySet()){ if (!KeyTarget.equals(key) && !KeyAppContextBeans.equals(key)) { Object v = dataMap.get(key); runContext.put(key,v); } } runJob(target,runContext); } catch (IOException e) { ExceptionUtils.traceError(e,logger); throw new StatusAndMessageError(-9,e); } } }
[ "zarrax@163.com" ]
zarrax@163.com
e2a4fc39db82f08692af74cfc2419a1e5459492e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/20/20_b6e6e42003a8baeca6fba75ff24bd6650cae0c67/ControllerAuth/20_b6e6e42003a8baeca6fba75ff24bd6650cae0c67_ControllerAuth_s.java
0c087595882b710bf74025bc948d9fe25e6300cc
[]
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
30,493
java
package elw.webauth; import com.google.common.base.Strings; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.io.CharStreams; import elw.web.core.W; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.openid4java.association.AssociationException; import org.openid4java.consumer.ConsumerException; import org.openid4java.consumer.ConsumerManager; import org.openid4java.consumer.VerificationResult; import org.openid4java.discovery.DiscoveryException; import org.openid4java.discovery.DiscoveryInformation; import org.openid4java.discovery.Identifier; import org.openid4java.discovery.yadis.YadisResolver; import org.openid4java.message.AuthRequest; import org.openid4java.message.AuthSuccess; import org.openid4java.message.MessageException; import org.openid4java.message.ParameterList; import org.openid4java.message.ax.AxMessage; import org.openid4java.message.ax.FetchRequest; import org.openid4java.message.ax.FetchResponse; import org.openid4java.server.RealmVerifier; import org.openid4java.server.RealmVerifierFactory; import org.openid4java.util.HttpFetcherFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpMethod; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import javax.mail.*; import javax.mail.Message; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.*; import java.util.*; import java.util.concurrent.TimeUnit; public abstract class ControllerAuth { private static final Logger log = LoggerFactory.getLogger(ControllerAuth.class); public static final String SESSION_SUCCESS_REDIRECT = "SUCCESS_REDIRECT"; protected static final String SESSION_OID_DISCOVERY = "OID_DISCOVERY"; protected static final String SESSION_OID_CONSUMER = "OID_CONSUMER"; protected static final String OID_ENDPOINT_YAHOO = "https://me.yahoo.com"; protected static final String OID_ENDPOINT_GOOGLE = "https://www.google.com/accounts/o8/id"; protected static final String OID_ENDPOINT_GOOGLE_PROFILES = "http://www.google.com/profiles/"; protected static final String OID_ENDPOINT_YANDEX = "http://openid.yandex.ru"; protected static final String OID_ENDPOINT_MAILRU = "http://openid.mail.ru/mail/"; protected static final String OID_REDIR_BODY_TARGETURL = "${targetUrl}"; protected static final String OID_REDIR_BODY_PARAMS = "${paramsGoHere}"; protected static final String OID_REDIR_PARAMKEY = "${parameter.key}"; protected static final String OID_REDIR_PARAMVAL = "${parameter.value}"; /** * Not all endpoints are reporting confirmed emails, * so we have to white-list them. */ protected static final List<String> OID_ENDPOINT_TRUSTED = Collections.unmodifiableList( Arrays.asList( OID_ENDPOINT_YAHOO, OID_ENDPOINT_GOOGLE, OID_ENDPOINT_GOOGLE_PROFILES, OID_ENDPOINT_YANDEX, OID_ENDPOINT_MAILRU ) ); protected static RealmVerifierFactory realmVerifierFactory = // what the heck, I did not see anything like that in the docs?.. new RealmVerifierFactory( new YadisResolver( new HttpFetcherFactory() ) ); // the most simple way to get base64 of binary hash (no additional libs) private final ObjectMapper mapper = new ObjectMapper(); private final ServerConfigAuth serverConfig; private final Cache<String, Long> srcAddrToStamp; public ControllerAuth(ServerConfigAuth serverConfig) { this.serverConfig = serverConfig; Security.addProvider(new BouncyCastleProvider()); final CacheBuilder<Object, Object> caches = CacheBuilder.newBuilder() .concurrencyLevel(3) .expireAfterWrite( 2 * serverConfig.getMailSourceDelayMillis(), TimeUnit.MILLISECONDS ); this.srcAddrToStamp = caches.build(); } public static void storeSuccessRedirect( HttpServletRequest req ) { final String reqUri = req.getRequestURI(); if (!Strings.isNullOrEmpty(req.getQueryString())) { req.getSession(true).setAttribute( SESSION_SUCCESS_REDIRECT, reqUri + "?" + req.getQueryString() ); } else { req.getSession(true).setAttribute( SESSION_SUCCESS_REDIRECT, reqUri ); } } @RequestMapping( value = "smtpchallenge", method = RequestMethod.GET ) public ModelAndView do_smtpchallengeGet( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { final String emailParam = req.getParameter("email"); if (emailParam == null || emailParam.trim().length() == 0) { resp.sendError( HttpServletResponse.SC_BAD_REQUEST, "email parameter not set" ); return null; } final String remoteAddress = W.resolveRemoteAddress(req); final long forcedDelayMillis = serverConfig.getMailSourceDelayMillis(); final Long lastStamp = srcAddrToStamp.getIfPresent(remoteAddress); final long currentMillis = System.currentTimeMillis(); if (lastStamp != null && lastStamp + forcedDelayMillis > currentMillis) { resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, "your IP is requesting smtp auth too often" ); return null; } srcAddrToStamp.put(remoteAddress, currentMillis); final String email = emailParam.trim(); final String smtpChallengeToken; try { smtpChallengeToken = registerChallengeToken(req, email); } catch (AuthException e) { log.warn("failed on smtpchallenge", e); resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage() ); return null; } final Session session = setupSmtpSession(); try { Message message = createMessage( session, req, email, smtpChallengeToken ); final Transport transport = session.getTransport(serverConfig.getMailProtocol()); transport.connect( serverConfig.getSmtpHost(), serverConfig.getSmtpPort(), serverConfig.getSmtpUser(), serverConfig.getSmtpPass() ); transport.sendMessage( message, message.getRecipients(Message.RecipientType.TO) ); } catch (MessagingException e) { log.warn("failed on smtpchallenge", e); resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage() ); return null; } final StringBuilder responseBuilder = generateSmtpResponseBody(email); sendBody(resp, responseBuilder); return null; } protected StringBuilder generateSmtpResponseBody(final String email) { final StringBuilder responseBuilder = new StringBuilder(serverConfig.getMailResponseForm()); replace( responseBuilder, "${targetUrl}", serverConfig.getBaseUrl() + "auth/smtpresponse" ); replace( responseBuilder, "${email}", email ); return responseBuilder; } protected Message createMessage( final Session session, final HttpServletRequest req, final String emailAddress, final String smtpChallengeToken ) throws MessagingException, UnsupportedEncodingException { final String mailBody = generateMailBody(req, emailAddress, smtpChallengeToken); final Message message = new MimeMessage(session); message.setSentDate(new Date()); message.setFrom(new InternetAddress(serverConfig.getSmtpFrom())); message.setRecipients( Message.RecipientType.TO, InternetAddress.parse(emailAddress) ); message.setSubject(serverConfig.getSmtpSubject()); message.setText( mailBody); return message; } protected String generateMailBody( final HttpServletRequest req, final String emailAddress, final String smtpChallengeToken ) throws UnsupportedEncodingException { final StringBuilder mailBodyBuilder = new StringBuilder(serverConfig.getMailBody()); replace( mailBodyBuilder, "${smtpAuth.sourceAddr}", W.resolveRemoteAddress(req) ); replace( mailBodyBuilder, "${smtpAuth.token}", smtpChallengeToken ); replace( mailBodyBuilder, "${smtpAuth.responseUrl}", serverConfig.getBaseUrl() + "auth/smtpresponse?" + "email=" + URLEncoder.encode(emailAddress, "UTF-8") + "&" + "token=" + URLEncoder.encode(smtpChallengeToken, "UTF-8") ); return mailBodyBuilder.toString(); } protected abstract String registerChallengeToken( final HttpServletRequest req, String emailAddress ) throws AuthException; protected String challengeToken( final String email, final Long stamp, final String sessionId ) throws AuthException { final String superSecretSalt = serverConfig.getMailTokenSalt(); try { final MessageDigest mda = MessageDigest.getInstance( "SHA-1", "BC" ); final String challengeData = email + " " + stamp + " " + sessionId + " " + superSecretSalt; final byte[] digest = mda.digest(challengeData.getBytes()); // drop some bytes to avoid padding char final byte[] digestPadded = new byte[digest.length - digest.length % 3]; System.arraycopy(digest, 0, digestPadded, 0, digestPadded.length); final String base64Quoted = mapper.writeValueAsString(digestPadded); final String base64 = base64Quoted.substring(1, base64Quoted.length() - 1); // switch to URL-safe variant return base64.replace("+", "-").replace("/", "_"); } catch (NoSuchAlgorithmException e) { throw new AuthException("BouncyCastle/SHA-1'd been abducted", e); } catch (java.security.NoSuchProviderException e) { throw new AuthException("BouncyCastle took off and flew away", e); } catch (JsonMappingException e) { throw new AuthException("Jackson doesn't", e); } catch (JsonGenerationException e) { throw new AuthException("Jackson didn't", e); } catch (IOException e) { throw new AuthException("Jackson would rather not", e); } } protected Session setupSmtpSession() { final Properties props = new Properties(); props.put( "mail.smtp.auth", serverConfig.getSmtpAuth() ); props.put( "mail.smtp.starttls.enable", String.valueOf(serverConfig.getSmtpStartTls()) ); props.put( "mail.smtp.host", serverConfig.getSmtpHost() ); props.put( "mail.smtp.port", serverConfig.getSmtpPort() ); props.put( "mail.smtp.socketFactory.port", serverConfig.getSmtpPort() ); props.put( "mail.smtp.socketFactory.class", serverConfig.getSmtpSocketFactory() ); props.put( "mail.smtp.socketFactory.fallback", "false" ); final Session session = Session.getInstance( props, new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication( serverConfig.getSmtpUser(), serverConfig.getSmtpPass() ); } } ); session.setDebug(serverConfig.isSmtpDebug()); return session; } @RequestMapping( value = "smtpresponse", method = RequestMethod.GET ) public ModelAndView do_smtpresponseGet( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { return do_smtpresponsePost(req, resp); } @RequestMapping( value = "smtpresponse", method = RequestMethod.POST ) public ModelAndView do_smtpresponsePost( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { final String emailParam = req.getParameter("email"); if (emailParam == null || emailParam.trim().length() == 0) { resp.sendError( HttpServletResponse.SC_BAD_REQUEST, "email parameter not set" ); return null; } final String email = emailParam.trim(); final String tokenParam = req.getParameter("token"); if (tokenParam == null || tokenParam.trim().length() == 0) { resp.sendError( HttpServletResponse.SC_BAD_REQUEST, "tokenParam parameter not set" ); return null; } final String token = tokenParam.trim(); try { if (!activateAuth(req, email, token)) { resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, "failed to activate token" ); return null; } } catch (AuthException e) { resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, "failed to activate token: " + e.getMessage() ); return null; } processAuth( req, resp, req.getSession(true), Collections.singletonList(email), Collections.<String>emptyList() ); return null; } protected abstract boolean activateAuth( final HttpServletRequest req, final String email, final String token ) throws AuthException; @RequestMapping( value = "oidchallenge", method = RequestMethod.GET ) public ModelAndView do_oidchallengeGet( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { final String oidIdent = req.getParameter("openid_identifier"); if (oidIdent == null || oidIdent.trim().length() == 0) { resp.sendError( HttpServletResponse.SC_BAD_REQUEST, "openid_identifier not set" ); return null; } final OpenIdChallengeResult challengeResult; try { challengeResult = oidchallenge( req, oidIdent, serverConfig.getBaseUrl() + "auth/oidresponse" ); } catch (AuthException e) { log.warn("failed on oidchallenge", e); resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage() ); return null; } if (challengeResult.method == HttpMethod.GET) { resp.sendRedirect(challengeResult.targetUrl); return null; } final StringBuilder responseBody = generateFormRedirectBody(challengeResult); sendBody(resp, responseBody); return null; } protected void sendBody( final HttpServletResponse resp, final StringBuilder responseBody ) throws IOException { resp.setContentType("text/html; charset=UTF-8"); resp.setCharacterEncoding("UTF-8"); resp.setHeader("Pragma", "no-cache"); resp.setHeader("Cache-Control", "no-cache"); resp.setDateHeader("Expires", System.currentTimeMillis()); CharStreams.copy( new StringReader(responseBody.toString()), resp.getWriter() ); } protected StringBuilder generateFormRedirectBody( OpenIdChallengeResult challengeResult ) { final StringBuilder params = new StringBuilder(); for (Object key : challengeResult.parameterMap.keySet()) { params.append(serverConfig.getFormRedirectParam()); replace( params, OID_REDIR_PARAMKEY, String.valueOf(key) ); replace( params, OID_REDIR_PARAMVAL, String.valueOf(challengeResult.parameterMap.get(key)) ); } final StringBuilder responseBody = new StringBuilder(serverConfig.getFormRedirect()); replace( responseBody, OID_REDIR_BODY_TARGETURL, challengeResult.targetUrl ); replace( responseBody, OID_REDIR_BODY_PARAMS, params.toString() ); return responseBody; } protected static StringBuilder replace( final StringBuilder content, final String search, final String replace ) { int replaces = 16; int targetIndex; while (replaces-- > 0 && (targetIndex = content.indexOf(search)) >= 0) { content.replace( targetIndex, targetIndex + search.length(), replace ); } return content; } @RequestMapping( value = "oidresponse", method = RequestMethod.GET ) public ModelAndView do_oidresponseGet( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { return do_oidresponsePost(req, resp); } @RequestMapping( value = "oidresponse", method = RequestMethod.POST ) public ModelAndView do_oidresponsePost( final HttpServletRequest req, final HttpServletResponse resp ) throws IOException { try { final HttpSession session = req.getSession(true); final OpenIdResponseResult openIdResponseResult = oidresponse(req, session); final List<String> emails = openIdResponseResult.emails; final List<String> openIds = openIdResponseResult.openIds; return processAuth(req, resp, session, emails, openIds); } catch (AuthException e) { log.warn("failed on oidresponse", e); resp.sendError( HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage() ); return null; } } protected ModelAndView processAuth( final HttpServletRequest req, final HttpServletResponse resp, final HttpSession session, final List<String> emails, final List<String> openIds ) throws IOException { processAuthInfo(req, session, emails, openIds); return processAuthSuccess(req, resp); } protected ModelAndView processAuthSuccess( HttpServletRequest req, HttpServletResponse resp ) throws IOException { final HttpSession session = req.getSession(true); final Object successRedirSession = session.getAttribute(SESSION_SUCCESS_REDIRECT); final String successRedir; if (successRedirSession == null) { successRedir = serverConfig.getBaseUrl(); } else { successRedir = String.valueOf(successRedirSession); } resp.sendRedirect(successRedir); session.removeAttribute(SESSION_SUCCESS_REDIRECT); return null; } protected abstract void processAuthInfo( HttpServletRequest req, HttpSession session, List<String> emails, List<String> openIds ); public OpenIdChallengeResult oidchallenge( final HttpServletRequest request, final String oidIdent, final String responseUrl ) throws AuthException { // adding some extra code for exception handling try { return oidChallenge_unsafe(request, oidIdent, responseUrl); } catch (DiscoveryException e) { throw new AuthException("OpenID auth failed", e); } catch (MessageException e) { throw new AuthException("OpenID auth failed", e); } catch (ConsumerException e) { throw new AuthException("OpenID auth failed", e); } } protected OpenIdChallengeResult oidChallenge_unsafe( final HttpServletRequest request, final String oidIdent, final String responseUrl ) throws DiscoveryException, MessageException, ConsumerException { final HttpSession session = request.getSession(true); // coding this up this just like the QuickStart sample says, see: // http://code.google.com/p/openid4java/wiki/QuickStart // perform discovery on the user-supplied identifier final ConsumerManager oidConsumer = oidConsumer(session, true); final List discoveries = oidConsumer.discover(oidIdent); // attempt to associate with the OpenID provider // and retrieve one service endpoint for authentication final DiscoveryInformation discovered = oidConsumer.associate(discoveries); // store the discovery information in the user's session for later use // leave out for stateless operation / if there is no session session.setAttribute(SESSION_OID_DISCOVERY, discovered); // obtain a AuthRequest message to be sent to the OpenID provider final AuthRequest authReq = oidConsumer.authenticate( discovered, responseUrl ); FetchRequest fetch = FetchRequest.createFetchRequest(); if (OID_ENDPOINT_GOOGLE.equals(oidIdent)) { fetch.addAttribute( "email", "http://axschema.org/contact/email", true ); } else if (OID_ENDPOINT_YAHOO.equals(oidIdent)) { fetch.addAttribute( "email", "http://axschema.org/contact/email", true ); } else { //works for myOpenID fetch.addAttribute( "email", "http://schema.openid.net/contact/email", true ); } if (!fetch.getAttributes().isEmpty()) { authReq.addExtension(fetch); } if (discovered.isVersion2()) { return new OpenIdChallengeResult( HttpMethod.POST, authReq.getDestinationUrl(false), authReq.getParameterMap() ); } return new OpenIdChallengeResult( HttpMethod.GET, authReq.getDestinationUrl(true), Collections.EMPTY_MAP ); } public OpenIdResponseResult oidresponse( final HttpServletRequest request, final HttpSession session ) throws AuthException { final ConsumerManager oidConsumer = oidConsumer(session, false); if (oidConsumer == null) { throw new AuthException( "no ConsumerManager in session", new IllegalStateException() ); } try { return oidresponse_unsafe(request, session, oidConsumer); } catch (MessageException e) { throw new AuthException("OpenID auth failed", e); } catch (DiscoveryException e) { throw new AuthException("OpenID auth failed", e); } catch (AssociationException e) { throw new AuthException("OpenID auth failed", e); } finally { session.removeAttribute(SESSION_OID_DISCOVERY); session.removeAttribute(SESSION_OID_CONSUMER); } } protected OpenIdResponseResult oidresponse_unsafe( final HttpServletRequest request, final HttpSession session, final ConsumerManager oidConsumer ) throws MessageException, DiscoveryException, AssociationException, AuthException { // extract the parameters from the authentication response // (which comes in as a HTTP request from the OpenID provider) final ParameterList openidResp = new ParameterList(request.getParameterMap()); // retrieve the previously stored discovery information final DiscoveryInformation discovered = (DiscoveryInformation) session.getAttribute(SESSION_OID_DISCOVERY); // extract the receiving URL from the HTTP request final StringBuffer receivingURL = request.getRequestURL(); final String queryString = request.getQueryString(); if (queryString != null && queryString.length() > 0) receivingURL.append("?").append(request.getQueryString()); // verify the response final VerificationResult verification = oidConsumer.verify( receivingURL.toString(), openidResp, discovered ); // examine the verification result and extract the verified identifier final Identifier verified = verification.getVerifiedId(); if (verified == null) { throw new AuthException( "OpenID authentication failed", new IllegalStateException() ); } final List<String> emails = new ArrayList<String>(); final AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse(); if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) { final FetchResponse fetchResp = (FetchResponse) authSuccess.getExtension( AxMessage.OPENID_NS_AX ); List emailsRaw = fetchResp.getAttributeValues("email"); for (Object emailRaw : emailsRaw) { emails.add(String.valueOf(emailRaw)); } } boolean trustedEmails = false; for (String trustedEndpoint : OID_ENDPOINT_TRUSTED) { if (authSuccess.getOpEndpoint().startsWith(trustedEndpoint)) { trustedEmails = true; } } // success final List<String> emptyEmails = Collections.emptyList(); final List<String> emailsEffective = trustedEmails ? emails : emptyEmails; return new OpenIdResponseResult( emailsEffective, Collections.singletonList(verified.getIdentifier()) ); } protected ConsumerManager oidConsumer( final HttpSession session, final boolean create ) { final Object existing = session.getAttribute(SESSION_OID_CONSUMER); if (existing != null || !create) { return (ConsumerManager) existing; } final ConsumerManager created = new ConsumerManager(); if (created.getRealmVerifier() == null) { RealmVerifier rv = realmVerifierFactory.getRealmVerifierForConsumer(); rv.setEnforceRpId(serverConfig.isRelyingPartyIdent()); created.setRealmVerifier(rv); } else { created.getRealmVerifier().setEnforceRpId( serverConfig.isRelyingPartyIdent() ); } session.setAttribute(SESSION_OID_CONSUMER, created); return created; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d2c9f4188fe19dbfc8f1b367e285e53d1c86bdff
2b5139c507a9cb8e4dd4dad2ed84e3b3bcbbbe44
/springmvctest1/src/main/java/org/kosta/dashduowork/model/service/InnService.java
27e9a78c70790606a4f8592e361f56c01d3c818d
[]
no_license
eunsikkim/testduo
a4c78609abd5da2802304c8b33904477d90d407e
5561fa047ec35e743b6f16cbbf512469a8641af4
refs/heads/master
2020-05-17T05:19:16.127051
2015-06-16T09:30:46
2015-06-16T09:30:46
37,177,460
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
package org.kosta.dashduowork.model.service; import java.util.List; import org.kosta.dashduowork.model.vo.AmenityVO; import org.kosta.dashduowork.model.vo.FilterVO; import org.kosta.dashduowork.model.vo.InnListVO; import org.kosta.dashduowork.model.vo.InnVO; import org.kosta.dashduowork.model.vo.SearchVO; public interface InnService { public List<InnVO> findInnByCheckedAmenity(AmenityVO vo); // public List<InnVO> findInnByCityAndAcceptableNo(SearchVO vo); // public List<InnVO> findInnByCityAndDateAndAcceptableNo(SearchVO vo); public InnListVO findInnByCityAndAcceptableNo(SearchVO vo); public InnListVO findInnByCityAndDateAndAcceptableNo(SearchVO vo); //6/15일 추가 // public List<InnVO> findInnByCityAndDateAndAcceptableNoWithFilter(FilterVO vo); // public List<InnVO> findInnByCityAndAcceptableNoWithFilter(FilterVO vo); public InnListVO findInnByCityAndDateAndAcceptableNoWithFilter(FilterVO vo); public InnListVO findInnByCityAndAcceptableNoWithFilter(FilterVO vo); }
[ "KOSTA@KOSTA-HP" ]
KOSTA@KOSTA-HP
b1fdb97fec132da6d4a495e0bc0f23cf623d234c
0d9e54adcfbffa99fa52a21148e3d9abe3b44010
/src/main/Menu.java
a7923953f9bf2fb3d2f832a7adc5d6dc0a9da835
[]
no_license
devThiLoretti/zeldaProject
55fa1b5e59744d24350011533505768e0cb37eba
93da385fdf6bda66aa9889fc6f29745b8b5b6df2
refs/heads/master
2023-09-01T00:52:36.727090
2021-10-26T23:54:57
2021-10-26T23:54:57
415,718,600
0
0
null
null
null
null
UTF-8
Java
false
false
4,519
java
package main; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import com.dForceStudio.main.Game; import com.dForceStudio.world.World; public class Menu implements KeyListener { public String[] options = { "New game", "Load game", "Exit game" }; public int curOption = 0; public int maxOption = options.length - 1; public boolean up, down, enter; public static boolean pause = false; public static boolean saveExists = false; public static boolean saveGame = false; public static String loadGame(int encode) { String line = ""; File file = new File("save.txt"); if(file.exists()) { try { String singleLine = null; BufferedReader br = new BufferedReader(new FileReader("save.txt")); try { while((singleLine = br.readLine()) != null) { String[] trans = singleLine.split(":"); char[] val = trans[1].toCharArray(); trans[1] = ""; for(int i = 0; i <val.length; i++) { val[i] -= encode; trans[1] += val[i]; } line += trans[0]; line += ":"; line += trans[1]; line += "/"; } }catch(IOException e) {} }catch(FileNotFoundException e) {} } return line; } public static void applySave(String str) { String[] spl = str.split("/"); for(int i = 0; i < spl.length; i++) { String[]spl2 = spl[i].split(":"); switch(spl2[0]) { case "level" : World.restartGame("level" + spl2[1] + ".png"); Game.gameState = "NORMAL"; break; } } } public static void saveGame(String[] val1, int[] val2, int encode) { BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter("save.txt")); } catch(IOException e) { e.printStackTrace(); } for(int i = 0; i < val1.length; i++) { String current = val1[i]; current += ":"; char[] value = Integer.toString(val2[i]).toCharArray(); for(int n = 0; n < value.length; n++) { value[n] += encode; current += value[n]; } try { bw.write(current); if(i < val1.length-1) { bw.newLine(); } } catch(IOException e) { e.printStackTrace(); } try { bw.flush(); bw.close(); } catch(IOException e) { e.printStackTrace(); } } } public void tick() { File file = new File("save.txt"); if(file.exists()) { saveExists = true; } else { saveExists = false; } if (up) { up = false; curOption--; if (curOption < 0) { curOption = maxOption; } } if (down) { down = false; curOption++; if (curOption > maxOption) { curOption = 0; } } if(enter) { enter = false; if(options[curOption] == "New game" || options[curOption] == "Continue") { Game.gameState = "NORMAL"; pause = false; } else if(options[curOption] == "Load game") { file = new File("save.txt"); if(file.exists()) { String saver = loadGame(10); applySave(saver); } } } } public void render(Graphics g) { g.setColor(Color.black); g.fillRect(0, 0, Game.WIDTH * Game.SCALE, Game.HEIGHT * Game.SCALE); g.setColor(Color.green); g.setFont(new Font("arial", Font.BOLD, 36)); g.drawString(">Zelda: a link to Loretti<", (Game.WIDTH * Game.SCALE) / 2 - 200, (Game.HEIGHT * Game.SCALE) / 2 - 160); g.setColor(Color.white); g.setFont(new Font("arial", Font.BOLD, 24)); g.drawString("New Game", 430, (Game.HEIGHT * Game.SCALE) / 2 - 100); g.drawString("Load Game", 430, (Game.HEIGHT * Game.SCALE) / 2 - 70); g.drawString("Exit Game", 430, (Game.HEIGHT * Game.SCALE) / 2 - 40); if (options[curOption] == "New game") { g.drawString(">", 400, (Game.HEIGHT * Game.SCALE) / 2 - 100); } else if (options[curOption] == "Load game") { g.drawString(">", 400, (Game.HEIGHT * Game.SCALE) / 2 - 70); } else if (options[curOption] == "Exit game") { g.drawString(">", 400, (Game.HEIGHT * Game.SCALE) / 2 - 40); } } @Override public void keyTyped(KeyEvent e) { if(options[curOption] == "New game" && e.getKeyCode() == KeyEvent.VK_ENTER) { Game.gameState = "NORMAL"; } } @Override public void keyPressed(KeyEvent e) { // TODO Auto-generated method stub } @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } }
[ "thiagoloretti@outlook.com" ]
thiagoloretti@outlook.com
484ab1d0a91186ed50190c00c3d1be30d6b5b1d0
c9e1a187d3dc446722739560fb8aa1b39cd00ff8
/src/main/java/usecases/api/teleportplayerstolobby/TeleportPlayersToLobby.java
b20a140f46eaca836b967ecfd32d688ddc26c0e3
[]
no_license
SimonAtelier/VillagerHockey
b047103958a296cbc8e5e608b9d082448937f7b5
02b9168946a2445a18b7ed72031eb58ec137b5e2
refs/heads/master
2021-07-12T08:29:47.734324
2021-05-15T20:12:44
2021-05-15T20:12:44
121,252,224
0
2
null
2021-05-15T20:12:45
2018-02-12T13:50:55
Java
UTF-8
Java
false
false
460
java
package usecases.api.teleportplayerstolobby; import java.util.List; import java.util.UUID; import entities.Location; import gateways.GameGateway; public interface TeleportPlayersToLobby { void execute(String game, TeleportPlayersToLobbyResponse response); void setGameGateway(GameGateway gameGateway); public interface TeleportPlayersToLobbyResponse { void presentLocation(List<UUID> players, Location location); } }
[ "simon_atelier@web.de" ]
simon_atelier@web.de
d561c3acc838def603530d1c62ac14b0513777ca
29f1b34b53f2a3b3f28e13f5830fb44a3f178671
/JavaCollections/task37/task3702/FactoryProducer.java
aed1b878bb32bae5b4cdd73c953aa726f8ce7038
[]
no_license
YaroslavMifit/JavaRush
ce69af9d1a187de2ddf714bf4d8e0e1e631fc208
da46dfe1ab6a1353fb08a949531edae1ea8468f9
refs/heads/master
2021-05-07T14:03:33.425977
2017-12-12T10:52:58
2017-12-12T10:52:58
109,816,421
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.javarush.task.task37.task3702; import com.javarush.task.task37.task3702.female.FemaleFactory; import com.javarush.task.task37.task3702.male.MaleFactory; /** * Created by ЯРОСЛАВ on 26.09.2017. */ public class FactoryProducer { public static enum HumanFactoryType{ MALE, FEMALE; } public static AbstractFactory getFactory(HumanFactoryType humanFactoryType){ if(humanFactoryType.equals(humanFactoryType.MALE)) return new MaleFactory(); return new FemaleFactory(); } }
[ "Sprafka24@gmail.com" ]
Sprafka24@gmail.com
15fa39c5539fa3aa2c08fdf378b379a87c1e0014
24e3d5c5f66eb30afe144a331806d0774239f623
/src/main/java/upcafe/utils/TimeUtils.java
51310a8d30f8ed99e3404d574997059f63be66f3
[]
no_license
sidorchukandrew/upcafe-api
a2e4761bb6380463bbe754951a7cfb9b9d5e811b
b6cd7a9ceeef70916b4573605fa8da203e1d8cf1
refs/heads/master
2022-11-30T16:44:00.392914
2020-07-31T22:15:37
2020-07-31T22:15:37
274,425,682
0
0
null
null
null
null
UTF-8
Java
false
false
2,112
java
package upcafe.utils; import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAdjusters; public class TimeUtils { private final static DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("H:mm"); private final static DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("EEE MMM dd yyyy"); public static LocalTime getTime(String time) { return LocalTime.parse(time, TIME_FORMATTER); } public static LocalTime getTimeNow() { LocalDateTime fullNow = LocalDateTime.now().minusHours(4); System.out.println("NOW : " + fullNow); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm"); String now = formatter.format(fullNow); return LocalTime.parse(now, formatter); } public static LocalTime getTimeNowWithIntervalPadding(int interval) { LocalTime now = getTimeNow(); LocalTime nowWithPadding = now.plusMinutes(interval); return nowWithPadding; } public static LocalTime getTimeWithNegativePadding(int interval, LocalTime time) { LocalTime timeWithPadding = time.minusMinutes(interval); return timeWithPadding; } public static String getTimeString(LocalTime time) { return TIME_FORMATTER.format(time); } public static LocalDate getMondayOfWeek(LocalDate dateRequest) { System.out.println("Checking if " + dateRequest + " is a Monday"); if (dateRequest.get(ChronoField.DAY_OF_WEEK) == 1) { System.out.println("It is a Monday!"); return dateRequest; } LocalDate previousMonday = dateRequest.with(TemporalAdjusters.previous(DayOfWeek.MONDAY)); System.out.println("It's not a Monday. Here's the Monday of this date : " + previousMonday); return previousMonday; } public static LocalDate toLocalDate(String date) { return LocalDate.parse(date, DATE_FORMATTER); } }
[ "36050911+sidorchukandrew@users.noreply.github.com" ]
36050911+sidorchukandrew@users.noreply.github.com
fdeb0ed196d8bb215f9e55195f0308aab71344b3
59c4077b97d90098eb0d19948982276ac8f87658
/day10/容器1/src/cn/imcore/test/Person.java
7aa700825181307c7a9634b84c9f5ebf1f76c8af
[]
no_license
sonyi/java
4b267e9cb554bb51f3770149f070ec812388cb8b
fbe2c2f7ae36bbbb4333bd567fb063daf507c8fc
refs/heads/master
2021-01-01T16:30:36.907998
2014-05-25T15:13:11
2014-05-25T15:13:11
19,110,091
2
0
null
null
null
null
UTF-8
Java
false
false
445
java
package cn.imcore.test; public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return name + " " + age; } }
[ "wxy15105957760" ]
wxy15105957760
63227fb04bc0925830e0b56567dbd4f8da36e37f
5991e79f258bbfc8b7404fb0fd782c3ce3174f35
/src/main/java/iot/project/dbModel/Data.java
bfde2013bfc9ceb5751580e8ab87191b1e1115b4
[]
no_license
GhidaMaalouf/autorrigateIot-BE
0a0033022b5e62bf51ff52f98fc727e0c2b0a804
0ca4bff73d75a171546a5d9fcb55cd4dfa43e227
refs/heads/master
2023-02-15T21:36:44.952265
2021-01-05T20:53:39
2021-01-05T20:53:39
327,115,064
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package iot.project.dbModel; import javax.persistence.*; import java.util.Date; import java.util.UUID; @Entity @Table(name="data") public class Data { @Id @GeneratedValue(strategy = GenerationType.AUTO) private UUID id; @Column(name="date") private Date date; @Column(name="moisture") private double moisture; @Column(name="rain") private double rain; @Column(name="ultrasonic") private double ultrasonic; public Data(UUID id, double moisture, double rain, double ultrasonic) { this.id = id; this.moisture = moisture; this.rain = rain; this.ultrasonic = ultrasonic; } public void setId(UUID id) { this.id = id; } public void setMoisture(double moisture) { this.moisture = moisture; } public void setRain(double rain) { this.rain = rain; } public void setUltrasonic(double ultrasonic) { this.ultrasonic = ultrasonic; } public UUID getId() { return id; } public double getMoisture() { return moisture; } public double getRain() { return rain; } public double getUltrasonic() { return ultrasonic; } }
[ "ghida_dm@hotmail.co.uk" ]
ghida_dm@hotmail.co.uk
e2ab7a8bba920967670bb5750eac73b2bdfd2e03
432a1b7a5068c814bea1806848f74955054cf834
/Cafeteria2/app/src/main/java/com/example/ash_rob_01_computer/cafeteria2/HistoryFragment.java
5ce81da4c6a76da11ccd069d3d010aa10b4c46ff
[]
no_license
lydiakemumakinyari/mwc_onga_group7
426e4cc19896e77c9df41ed4e310d494afafe0ef
ac4327996d2bdffe1e150e8e3413d0d18634e4e7
refs/heads/master
2021-01-24T19:51:48.713919
2015-11-18T23:11:06
2015-11-18T23:11:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,119
java
package com.example.ash_rob_01_computer.cafeteria2; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.TextView; import com.example.ash_rob_01_computer.cafeteria2.dummy.DummyContent; /** * A fragment representing a list of Items. * <p/> * Large screen devices (such as tablets) are supported by replacing the ListView * with a GridView. * <p/> * Activities containing this fragment MUST implement the {@link OnFragmentInteractionListener} * interface. */ public class HistoryFragment extends Fragment implements AbsListView.OnItemClickListener { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; /** * The fragment's ListView/GridView. */ private AbsListView mListView; /** * The Adapter which will be used to populate the ListView/GridView with * Views. */ private ListAdapter mAdapter; OnFragmentInteractionListener onFragmentInteractionListener; // TODO: Rename and change types of parameters public static HistoryFragment newInstance(String param1, String param2) { HistoryFragment fragment = new HistoryFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } /** * Mandatory empty constructor for the fragment manager to instantiate the * fragment (e.g. upon screen orientation changes). */ public HistoryFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } // TODO: Change Adapter to display your content mAdapter = new ArrayAdapter<DummyContent.DummyItem>(getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, DummyContent.ITEMS); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_history, container, false); // Set the adapter mListView = (AbsListView) view.findViewById(android.R.id.list); ((AdapterView<ListAdapter>) mListView).setAdapter(mAdapter); // Set OnItemClickListener so we can be notified on item clicks mListView.setOnItemClickListener(this); return view; } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mListener = (OnFragmentInteractionListener) activity; } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mListener.onFragmentInteraction(DummyContent.ITEMS.get(position).id); } } /** * The default content for this Fragment has a TextView that is shown when * the list is empty. If you would like to change the text, call this method * to supply the text it should use. */ public void setEmptyText(CharSequence emptyText) { View emptyView = mListView.getEmptyView(); if (emptyView instanceof TextView) { ((TextView) emptyView).setText(emptyText); } } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p/> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name public void onFragmentInteraction(String id); } }
[ "adjoa.maison@gmail.com" ]
adjoa.maison@gmail.com
52cba1ab0d23ee44724b404a279e9a20479a8407
a8f24025f50339e486d193c66d1077ea4971d06b
/EvenOut/src/test/java/com/munfirma/evenout/common/EvenOutJUnitPersonTest.java
f96d5c637c43f64ea49c2a57f6f4bd21b771689e
[]
no_license
vuolleko/EvenOut
565a479556b3af05fddb9977574172b7775f3d5c
0e2946f1eb72f506307cd8c0741d2519add6ab34
refs/heads/master
2016-08-04T04:40:38.378836
2014-12-12T19:31:45
2014-12-12T19:31:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.munfirma.evenout.common; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author vuolleko */ public class EvenOutJUnitPersonTest { Person person; public EvenOutJUnitPersonTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { String name = "TestPerson"; person = new Person(name); } @After public void tearDown() { } @Test public void newPersonVerifyName() { String name = "TestPerson"; assertThat(person.getName(), is(name)); String otherName = "TestPerson2"; assertThat(person.getName(), is(not(otherName))); } @Test public void testNoDebt() { assertThat(person.getBalance(new Person("TP2")), is((long)0)); } @Test public void testDebt() { Person person2 = new Person("TestPerson 2"); person.addCredit(person2, 1000); person.addDebt(person2, 3000); assertThat(person.getBalance(person2), is((long) (1000-3000))); } }
[ "henri.vuollekoski@helsinki.fi" ]
henri.vuollekoski@helsinki.fi
02fb0e4ba57aa47703fc9e7f760f9b1ceb873838
09163df576d50617869e7c4d4dc3928ddbefd55f
/app/src/androidTest/java/com/yinyxn/qqlogin/ApplicationTest.java
ad236ebe4e71d9cb42a3d7cf9067d0288d3633ba
[]
no_license
woals/QQLogin
c71d2c521a1fa11ada8a4a8e218d8872b0841299
709b60eff600c8d7d345c616980b3f57c0a39630
refs/heads/master
2021-01-01T04:39:55.553187
2016-04-15T06:34:14
2016-04-15T06:34:14
56,296,152
0
0
null
null
null
null
UTF-8
Java
false
false
349
java
package com.yinyxn.qqlogin; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "798041778@qq.com" ]
798041778@qq.com
e89357f845b12bc62f2ec91a28357dfe2789725b
41e13741ea1c1d09c0fed4945408e33583b112f9
/BinarySearchTree/src/PreOrderVisitor.java
0067f41c4efef42d58f0e6682f6a0b46ddfd207a
[]
no_license
ARandomGithubAppeared/BinarySearchTree
ae75116ebbfae7a75fbfb988d928367f4c7931f1
70cd0e3abb8f73f5aa4f0c5a88c56fa08ceb35aa
refs/heads/master
2021-01-13T07:20:14.007205
2016-11-10T05:11:49
2016-11-10T05:11:49
71,363,935
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
public class PreOrderVisitor implements Visitor { @Override public void visit(BinarySearchTreeNode node) { System.out.println(node.getElt()); if (node.getLeft() != null) { visit(node.getLeft()); } if (node.getRight() != null) { visit(node.getRight()); } } }
[ "Shelby Huston@SatansEyepiece" ]
Shelby Huston@SatansEyepiece
4abf020657ef9bd0a3c906517b7603a073117d7a
0722631229c39018f62375194b1b14438dcd4df8
/javamodule/src/main/java/com/muletutorial/StockQuoteService.java
7a5ef11ab56121cda1c60b1bd7a75a564971b50c
[]
no_license
kaarthikgurram/Mulesoft
ac9cc3fbe89ebf0458b82eda95c91c9a8c41e1e9
d0e8afbc0046f462e8053b81fdb4abdff1ce3a37
refs/heads/master
2022-11-27T18:11:17.051738
2020-08-09T06:07:51
2020-08-09T06:07:51
286,177,466
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.muletutorial; public class StockQuoteService { public static String sayHello(String name, String country) { return "Hello " +name +" from " + country; } public String getStockPrice(String stockSymbol) { if(stockSymbol.equals("Microsoft")) { return "100"; }else if(stockSymbol.equals("Google")) { return "200"; }else { return "Stock doesn't exist"; } } }
[ "66755858+kaarthikgurram@users.noreply.github.com" ]
66755858+kaarthikgurram@users.noreply.github.com
5faa41fff74d860706a050e19bc4415c80373b60
5c2a40c914d18f793812f7bdfc1b53445b9d93da
/app/src/main/java/com/lyftoxi/lyftoxi/UserListingRecyclerAdapter.java
845483f0094e1554ff3aded00bd016b36cd15141
[]
no_license
lyftoxi/LyftOxi_app
d33114d9789b37357643022148562868bb524d61
a08fc4b9999cd3cdd2c53cbb2e18678ca16038f0
refs/heads/master
2020-05-21T22:35:40.399602
2016-11-30T18:20:02
2016-11-30T18:20:02
61,977,979
0
1
null
null
null
null
UTF-8
Java
false
false
8,036
java
package com.lyftoxi.lyftoxi; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.support.v4.util.LruCache; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.storage.StorageReference; import com.lyftoxi.lyftoxi.util.Constants; import com.lyftoxi.lyftoxi.util.LyftoxiFirebase; import com.lyftoxi.lyftoxi.util.RoundImage; import java.util.Date; import java.util.List; public class UserListingRecyclerAdapter extends RecyclerView.Adapter<UserListingRecyclerAdapter.UserViewHolder>{ private List<UserInfo> users; private LruCache<String, Bitmap> mMemoryCache; public class UserViewHolder extends RecyclerView.ViewHolder { ImageView userImage; TextView name; TextView age; TextView gender; TextView phone; ImageButton call; ImageButton msg; public UserViewHolder(View v) { super(v); userImage = (ImageView) v.findViewById(R.id.userListingUserImage); name = (TextView) v.findViewById(R.id.userListingName); phone = (TextView) v.findViewById(R.id.userListingPhone); age = (TextView) v.findViewById(R.id.userListingAge); gender = (TextView) v.findViewById(R.id.userListingGender); call = (ImageButton) v.findViewById(R.id.userListingCall); msg = (ImageButton) v.findViewById(R.id.userListingMsg); } } public UserListingRecyclerAdapter(List<UserInfo> users) { this.users = users; final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); final int cacheSize = maxMemory / 8; mMemoryCache = new LruCache<String, Bitmap>(cacheSize) { @Override protected int sizeOf(String key, Bitmap bitmap) { return bitmap.getByteCount() / 1024; } }; } @Override public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.user_listing, parent, false); return new UserViewHolder(itemView); } @Override public void onBindViewHolder(UserViewHolder holder, int position) { final UserInfo i = users.get(position); if (i != null) { Bitmap bm = BitmapFactory.decodeResource(holder.userImage.getContext().getResources(), R.drawable.sample_profile_pic); RoundImage roundedImage = new RoundImage(bm); if(null==bm) Log.d("lyftoxi.debug","bm is null"); if(null!=holder.userImage) holder.userImage.setImageDrawable(roundedImage); downloadUserProfilePic(i.getUID(), holder.userImage); holder.name.setText(i.getName()); holder.phone.setText(i.getPhNo()); if(null!=i.getDob()){ holder.age.setText((new Date().getYear() - i.getDob().getYear())+" years");} holder.gender.setText(Constants.genderLookup.get(i.getSex())); holder.call.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:" + i.getPhNo())); view.getContext().startActivity(intent); } }); holder.msg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { StringBuffer sb = new StringBuffer(); sb.append("Hi "); sb.append(i.getName()); sb.append(" are you interested to take a ride with me? "); sb.append(" Shared through http://www.lyftoxi.com APP"); Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.putExtra("address", i.getPhNo()); sendIntent.putExtra("sms_body", sb.toString()); sendIntent.setType("vnd.android-dir/mms-sms"); view.getContext().startActivity(sendIntent); } }); } } @Override public int getItemCount() { return users.size(); } public void addBitmapToMemoryCache(String key, Bitmap bitmap) { if (getBitmapFromMemCache(key) == null) { mMemoryCache.put(key, bitmap); } } public Bitmap getBitmapFromMemCache(String key) { return mMemoryCache.get(key); } private void downloadUserProfilePic(String userId, final ImageView userListingUserImage) { if(null==userId || userId.trim().equals("")) { return; } final String profilePicFileName = userId+"_profile_pic.jpg"; final String profilePicThumbFileName = userId+"_profile_pic_thumb.jpg"; Bitmap bm = getBitmapFromMemCache(profilePicFileName); if (bm != null) { RoundImage roundedImage = new RoundImage(bm); userListingUserImage.setImageDrawable(roundedImage); } else { Log.d("gog.debug ","profilePicFileName "+profilePicFileName); final StorageReference storageRef = LyftoxiFirebase.storageRef; StorageReference profileImageThumbRef = storageRef.child("userProfilePicThumbs/"+profilePicThumbFileName); final long SIZE = 100 * 100; profileImageThumbRef.getBytes(SIZE).addOnSuccessListener(new OnSuccessListener<byte[]>() { @Override public void onSuccess(byte[] bytes) { Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); bitmap = Bitmap.createScaledBitmap(bitmap, 100, 100, false); RoundImage roundedImage = new RoundImage(bitmap); addBitmapToMemoryCache(profilePicFileName, bitmap); userListingUserImage.setImageDrawable(roundedImage); notifyDataSetChanged(); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception exception) { Log.d("lyftoxi.debug","Firebase: profile pic thumnail download failed"); StorageReference profileImageRef = storageRef.child("userProfilePics/"+profilePicFileName); final long ONE_MEGABYTE = 500 * 500; profileImageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() { @Override public void onSuccess(byte[] bytes) { Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); bitmap = Bitmap.createScaledBitmap(bitmap, 100, 100, false); RoundImage roundedImage = new RoundImage(bitmap); addBitmapToMemoryCache(profilePicFileName, bitmap); userListingUserImage.setImageDrawable(roundedImage); notifyDataSetChanged(); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(Exception exception) { Log.d("lyftoxi.debug","Firebase: profile pic download failed"); } }); } }); } } }
[ "sharingride123@gmail.com" ]
sharingride123@gmail.com
915dbd8f3175226e7d64f58d02138072f0ba22a9
db9cfa966fa3849e89e71157d6cb74eca113f3f8
/code/Module13/src/Radios.java
ac54011e88edbec550ce01c04b27c856abdb1fae
[]
no_license
Vijaykumar765p/Selenium_Package
fbbf4f5c7dce62c29e484b4271bce4b5505c7bf3
b62691508ba990017aafac0a935dfce7333aef94
refs/heads/master
2021-05-11T22:51:49.041840
2018-01-15T05:32:01
2018-01-15T05:32:01
117,500,934
0
0
null
null
null
null
UTF-8
Java
false
false
1,413
java
import java.io.File; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Radios { public static void main(String[] args) throws IOException { WebDriver driver = new FirefoxDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.get("http://www.echoecho.com/htmlforms10.htm"); File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(scrFile, new File("F:\\xyz.jpg")); List<WebElement> allRadios = driver.findElements(By.name("group1")); System.out.println("Total -" + allRadios.size()); System.out.println(allRadios.get(0).getAttribute("checked")); System.out.println(allRadios.get(1).getAttribute("checked")); System.out.println(allRadios.get(2).getAttribute("checked")); allRadios.get(0).click(); System.out.println("-------------"); System.out.println(allRadios.get(0).getAttribute("checked")); System.out.println(allRadios.get(1).getAttribute("checked")); System.out.println(allRadios.get(2).getAttribute("checked")); } }
[ "vijay.p@credenceis.local" ]
vijay.p@credenceis.local
d037b5f212dc23fe6f718b043f1c44fa919bf191
8cc48c116ef4cc7fe91efec0606e3c667e150edc
/Nutz-Aop-Cglib/src/org/nutz/dao/impl/NutDao.java
d85cc277053d9ab851c43838e74ec6dc99e0abed
[]
no_license
chengjf0526/nutzlib
d70e67791819544196c9b19ca219b09fd4a317e6
ca891069f81feba7bfbac7a2ff651649aa465302
refs/heads/master
2020-12-27T00:19:51.691696
2011-03-08T13:32:07
2011-03-08T13:32:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,911
java
package org.nutz.dao.impl; import java.lang.reflect.Field; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.List; import javax.sql.DataSource; import org.nutz.castor.Castors; import org.nutz.dao.Condition; import org.nutz.dao.ConnCallback; import org.nutz.dao.ConnectionHolder; import org.nutz.dao.Dao; import org.nutz.dao.DaoException; import org.nutz.dao.DatabaseMeta; import org.nutz.dao.FieldMatcher; import org.nutz.dao.pager.DefaultPagerMaker; import org.nutz.dao.pager.Pager; import org.nutz.dao.pager.PagerMaker; import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.SqlMaker; import org.nutz.dao.SqlManager; import org.nutz.dao.DaoUtils; import org.nutz.dao.Chain; import org.nutz.dao.entity.Entity; import org.nutz.dao.entity.EntityField; import org.nutz.dao.entity.EntityHolder; import org.nutz.dao.entity.EntityMaker; import org.nutz.dao.entity.Link; import org.nutz.dao.entity.impl.DefaultEntityMaker; import org.nutz.lang.Lang; import org.nutz.lang.Mirror; import org.nutz.trans.Atom; import org.nutz.trans.Trans; public class NutDao implements Dao { private DataSource dataSource; private SqlMaker sqlMaker; private PagerMaker pagerMaker; private SqlManager sqls; private EntityHolder entities; private DatabaseMeta meta; private Class<? extends EntityMaker> entityMaker; /* ========================================================== */ public NutDao() { this.sqlMaker = new SqlMaker(); this.pagerMaker = new DefaultPagerMaker(); } public NutDao(DataSource dataSource) { this(); this.setDataSource(dataSource); } public NutDao(DataSource dataSource, SqlManager sqlManager) { this(); this.setDataSource(dataSource); this.setSqlManager(sqlManager); } /* ========================================================== */ private static <T> EntityField checkIdField(Entity<T> en) { EntityField idField = en.getIdField(); if (idField == null) { throw Lang .makeThrow("Entity<T> [%] need @Id field", en.getMirror().getType().getName()); } return idField; } private static <T> EntityField checkNameField(Entity<T> en) { EntityField nameField = en.getNameField(); if (nameField == null) { throw Lang.makeThrow("Entity<T> [%s] need @Name field", en.getMirror().getType() .getName()); } return nameField; } /* ========================================================== */ public DataSource getDataSource() { return dataSource; } /** * 'databaseProductName' | 'driverName' * * <pre> * psql: 'PostgreSQL' |'PostgreSQL Native Driver' * MySQL: 'MySQL' |'MySQL-AB JDBC Driver' * Oracle: 'Oracle' |'Oracle JDBC driver' * db2: 'DB2/NT' |'IBM DB2 JDBC Universal Driver Architecture' * SQLServer: 'Microsoft SQL Serve' |'SQL Serve' * </pre> */ public void setDataSource(DataSource dataSource) { entities = new EntityHolder(null == entityMaker ? DefaultEntityMaker.class : entityMaker); this.dataSource = dataSource; } private synchronized void checkDatabase() { meta = new DatabaseMeta(); this.run(new ConnCallback() { public void invoke(Connection conn) throws Exception { DatabaseMetaData dmd = conn.getMetaData(); meta.setProductName(dmd.getDatabaseProductName()); meta.setVersion(dmd.getDatabaseProductVersion()); } }); } public DatabaseMeta meta() { if (null == meta) { checkDatabase(); } return meta; } public Pager createPager(int pageNumber, int pageSize) { return pagerMaker.make(meta(), pageNumber, pageSize); } public PagerMaker getPagerMaker() { return pagerMaker; } public void setPagerMaker(PagerMaker pagerMaker) { this.pagerMaker = pagerMaker; } public void setSqlManager(SqlManager sqlManager) { this.sqls = sqlManager; } public SqlMaker getSqlMaker() { return sqlMaker; } public void setSqlMaker(SqlMaker sqlMaker) { this.sqlMaker = sqlMaker; } public SqlManager sqls() { return this.sqls; } public void execute(final Sql... sqls) { run(new ConnCallback() { public void invoke(Connection conn) throws Exception { for (int i = 0; i < sqls.length; i++) { if (null != sqls[i]) sqls[i].execute(conn); } } }); } public void run(ConnCallback callback) { ConnectionHolder ch = DaoUtils.getConnection(getDataSource()); try { ch.invoke(callback); } catch (Throwable e) { try { ch.rollback(); } catch (SQLException e1) {} if (e instanceof RuntimeException) throw (RuntimeException) e; else throw new RuntimeException(e); } finally { DaoUtils.releaseConnection(ch); } } public int count(Class<?> classOfT) { return count(classOfT, null); } public int count(Class<?> classOfT, Condition condition) { Entity<?> entity = getEntity(classOfT); Sql sql = sqlMaker.func(entity.getTableName(), "COUNT", "*").setCondition(condition); execute(sql); return sql.getInt(); } public int count(String tableName) { return count(tableName, null); } public int count(String tableName, Condition condition) { Sql sql = sqlMaker.func(tableName, "COUNT", "*").setCondition(condition); execute(sql); return sql.getInt(); } public <T> void clear(Class<T> classOfT) { this.clear(classOfT, null); } public void clear(String tableName) { this.clear(tableName, null); } public <T> void clear(Class<T> classOfT, Condition condition) { Entity<?> entity = getEntity(classOfT); Sql sql; if (null == condition) { sql = sqlMaker.truncate(entity.getTableName()); } else { sql = sqlMaker.clear(entity).setCondition(condition); } execute(sql); } public void clear(String tableName, Condition condition) { Sql sql; if (null == condition) { sql = sqlMaker.truncate(tableName); } else { sql = sqlMaker.clear(tableName).setCondition(condition); } execute(sql); } public <T> T clearLinks(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final NutDao dao = this; Trans.exec(new Atom() { public void run() { lns.walkManys(new LinkWalker() { void walk(Link link) { if (link.getReferField() == null) { dao.clear(link.getTargetClass(), null); } else { Object value = entity.getMirror().getValue(obj, link.getReferField()); Entity<?> ta = dao.getEntity(link.getTargetClass()); Sql sql = dao.getSqlMaker().clear_links(ta, link, value); dao.execute(sql); } } }); lns.walkManyManys(new LinkWalker() { void walk(Link link) { Object value = entity.getMirror().getValue(obj, link.getReferField()); Sql sql = dao.getSqlMaker().clear_links(link.getRelation(), link.getFrom(), link.getFrom()); sql.params().set(link.getFrom(), value); dao.execute(sql); } }); lns.walkOnes(new LinkWalker() { void walk(Link link) { Object value = entity.getMirror().getValue(obj, link.getReferField()); Entity<?> ta = dao.getEntity(link.getTargetClass()); Sql sql = dao.getSqlMaker().clear_links(ta, link, value); dao.execute(sql); } }); } }); } return obj; } public <T> void delete(Class<T> classOfT, long id) { Entity<?> entity = getEntity(classOfT); EntityField ef = checkIdField(entity); Sql sql = sqlMaker.delete(entity, ef); sql.params().set(ef.getFieldName(), id); execute(sql); } public <T> void delete(Class<T> classOfT, String name) { Entity<?> entity = getEntity(classOfT); EntityField ef = checkNameField(entity); Sql sql = sqlMaker.delete(entity, ef); sql.params().set(ef.getFieldName(), name); execute(sql); } void _deleteSelf(Entity<?> entity, Object obj) { if (null != obj) { EntityField idnf = entity.getIdentifiedField(); if (null == idnf) throw DaoException.create(obj, "$IdentifiedField", "delete(Object obj)", null); if (idnf.isId()) { int id = Castors.me().castTo(idnf.getValue(obj), Integer.class); delete(obj.getClass(), id); } else if (idnf.isName()) { String name = idnf.getValue(obj).toString(); delete(obj.getClass(), name); } else { throw DaoException.create(obj, "$IdentifiedField", "delete(Object obj)", new Exception("Wrong identified field")); } } } public void delete(Object obj) { if (null != obj) { Entity<?> entity = getEntity(obj.getClass()); _deleteSelf(entity, obj); } } public <T> void deleteWith(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final NutDao dao = this; Trans.exec(new Atom() { public void run() { lns.invokeManys(new DeleteManyInvoker(dao)); lns.invokeManyManys(new DeleteManyManyInvoker(dao)); _deleteSelf(entity, obj); lns.invokeOnes(new DeleteOneInvoker(dao)); } }); } } public <T> void deleteLinks(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final NutDao dao = this; Trans.exec(new Atom() { public void run() { lns.invokeManys(new DeleteManyInvoker(dao)); lns.invokeManyManys(new DeleteManyManyInvoker(dao)); lns.invokeOnes(new DeleteOneInvoker(dao)); } }); } } public <T> T fetch(Class<T> classOfT, long id) { Entity<T> entity = getEntity(classOfT); return fetch(entity, id); } public <T> T fetch(Entity<T> entity, long id) { EntityField ef = checkIdField(entity); Sql sql = sqlMaker.fetch(entity, ef); sql.params().set(ef.getFieldName(), id); execute(sql); return sql.getObject(entity.getType()); } public <T> T fetch(Class<T> classOfT, String name) { Entity<T> entity = getEntity(classOfT); return fetch(entity, name); } public <T> T fetch(Entity<T> entity, String name) { EntityField ef = checkNameField(entity); Sql sql = sqlMaker.fetch(entity, ef); sql.params().set(ef.getFieldName(), name); execute(sql); return sql.getObject(entity.getType()); } public <T> T fetch(Class<T> classOfT, Condition condition) { Entity<T> entity = getEntity(classOfT); return fetch(entity, condition); } public <T> T fetch(Entity<T> entity, Condition condition) { List<T> list = this.query(entity, condition, this.createPager(1, 1)); if (list.size() == 0) return null; return list.get(0); } public <T> T fetch(Class<T> classOfT) { return fetch(classOfT, (Condition) null); } @SuppressWarnings("unchecked") public <T> T fetch(T obj) { if (null != obj) { Entity<?> entity = (Entity) getEntity(obj.getClass()); EntityField ef = entity.getIdentifiedField(); Sql sql = sqlMaker.fetch(entity, ef); sql.params().set(ef.getFieldName(), ef.getValue(obj)); execute(sql); return sql.getObject((Class<T>) entity.getType()); } return null; } public <T> T fetchLinks(final T obj, String regex) { if (null != obj && null != regex) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final Mirror<?> mirror = Mirror.me(obj.getClass()); final Dao dao = this; // Many lns.walkManys(new LinkWalker() { void walk(Link link) { Condition c = null; if (link.getReferField() != null) { Object value = mirror.getValue(obj, link.getReferField()); c = new ManyCondition(link, value); } List<?> list = query(link.getTargetClass(), c, null); mirror.setValue(obj, link.getOwnField(), Castors.me().cast(list, list.getClass(), link.getOwnField().getType(), link.getMapKeyField())); } }); // ManyMany lns.walkManyManys(new LinkWalker() { void walk(Link link) { ManyManyCondition mmc = new ManyManyCondition(dao, link, obj); List<?> list = query(link.getTargetClass(), mmc, null); mirror.setValue(obj, link.getOwnField(), Castors.me().cast(list, list.getClass(), link.getOwnField().getType(), link.getMapKeyField())); } }); // one lns.walkOnes(new LinkWalker() { void walk(Link link) { Object one; Field ownField = link.getReferField(); Mirror<?> ownType = Mirror.me(ownField.getType()); if (ownType.isStringLike()) { String name = mirror.getValue(obj, ownField).toString(); one = fetch(link.getTargetClass(), name); } else { long id = ((Number) mirror.getValue(obj, ownField)).longValue(); one = fetch(link.getTargetClass(), id); } mirror.setValue(obj, link.getOwnField(), one); } }); } return obj; } public <T> Entity<T> getEntity(Class<T> classOfT) { return entities.getEntity(classOfT, meta()); } public int getMaxId(Class<?> classOfT) { Entity<?> entity = getEntity(classOfT); EntityField ef = checkIdField(entity); // Sql sql = maker.create(maker.ptn.MAX, // entity.getTableName()).setEntity(entity); Sql sql = sqlMaker.func(entity.getTableName(), "MAX", ef.getColumnName()); execute(sql); return sql.getInt(); } @SuppressWarnings("unchecked") public <T> T getObject(Class<T> classOfT, ResultSet rs, FieldMatcher fm) { return (T) getEntity(classOfT).getObject(rs, fm); } private <T> T _insertSelf(Entity<?> entity, T obj) { Sql sql = sqlMaker.insert(entity, obj); // Evaluate fetchId SQL Sql fetchIdSql = null; if (null != entity.getIdField() && entity.getIdField().isSerial()) fetchIdSql = entity.getIdField().getSerialQuerySql(); // Execute SQL execute(sql, fetchIdSql); // Update Id field if need if (null != fetchIdSql) try { entity.getIdField().setValue(obj, fetchIdSql.getResult()); } catch (Exception e) { throw Lang.wrapThrow(e); } return obj; } public <T> T insert(T obj) { if (null != obj) { Entity<?> entity = getEntity(obj.getClass()); return _insertSelf(entity, obj); } return null; } public void insert(String tableName, Chain chain) { if (null != chain) { Sql sql = sqlMaker.insertChain(tableName, chain); execute(sql); } } public void insert(Class<?> classOfT, Chain chain) { Entity<?> en = getEntity(classOfT); if (null != chain) { Sql sql = sqlMaker.insertChain(en.getTableName(), chain); sql.setEntity(en); execute(sql); } } public <T> T insertWith(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final Mirror<?> mirror = Mirror.me(obj.getClass()); final Dao dao = this; Trans.exec(new Atom() { public void run() { lns.invokeOnes(new InsertOneInvoker(dao, obj, mirror)); _insertSelf(entity, obj); lns.invokeManys(new InsertManyInvoker(dao, obj, mirror)); lns.invokeManyManys(new InsertManyManyInvoker(dao, obj, mirror)); } }); } return obj; } public <T> T insertLinks(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final Mirror<?> mirror = Mirror.me(obj.getClass()); final Dao dao = this; Trans.exec(new Atom() { public void run() { lns.invokeOnes(new InsertOneInvoker(dao, obj, mirror)); lns.invokeManys(new InsertManyInvoker(dao, obj, mirror)); lns.invokeManyManys(new InsertManyManyInvoker(dao, obj, mirror)); } }); } return obj; } public <T> List<T> query(Class<T> classOfT, Condition condition, Pager pager) { return query(getEntity(classOfT), condition, pager); } @SuppressWarnings("unchecked") public <T> List<T> query(Entity<?> entity, Condition condition, Pager pager) { // QuerySql<T> sql = maker.makeQuerySQL(entity, pager); Sql sql = sqlMaker.query(entity, condition, pager); execute(sql); return sql.getList((Class<T>) entity.getType()); } public int update(Object obj) { if (null == obj) return -1; Sql sql = sqlMaker.update(getEntity(obj.getClass()), obj); execute(sql); return sql.getUpdateCount(); } public int update(Class<?> classOfT, Chain chain, Condition condition) { Entity<?> en = getEntity(classOfT); Sql sql = sqlMaker.updateBatch(en.getTableName(), chain).setCondition(condition); sql.setEntity(en); execute(sql); return sql.getUpdateCount(); } public int update(String tableName, Chain chain, Condition condition) { Sql sql = sqlMaker.updateBatch(tableName, chain).setCondition(condition); execute(sql); return sql.getUpdateCount(); } public void updateRelation( Class<?> classOfT, String regex, final Chain chain, final Condition condition) { final Links lns = new Links(null, getEntity(classOfT), regex); Trans.exec(new Atom() { public void run() { lns.walkManyManys(new LinkWalker() { void walk(Link link) { Sql sql = sqlMaker.updateBatch(link.getRelation(), chain).setCondition( condition); execute(sql); } }); } }); } public <T> T updateWith(final T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final Dao dao = this; Trans.exec(new Atom() { public void run() { update(obj); lns.invokeAll(new UpdateInvokder(dao)); } }); } return obj; } public <T> T updateLinks(T obj, String regex) { if (null != obj) { final Entity<?> entity = getEntity(obj.getClass()); final Links lns = new Links(obj, entity, regex); final Dao dao = this; Trans.exec(new Atom() { public void run() { lns.invokeAll(new UpdateInvokder(dao)); } }); } return obj; } public boolean exists(Class<?> classOfT) { return exists(getEntity(classOfT).getTableName()); } public boolean exists(final String tableName) { final boolean[] ee = {false}; this.run(new ConnCallback() { public void invoke(Connection conn) { Statement stat = null; ResultSet rs = null; try { stat = conn.createStatement(); String sql = "SELECT COUNT(*) FROM " + tableName; rs = stat.executeQuery(sql); if (rs.next()) ee[0] = true; } catch (SQLException e) {} finally { try { if (null != rs) rs.close(); } catch (SQLException e) {} try { if (null != stat) stat.close(); } catch (SQLException e) {} } } }); return ee[0]; } public int func(Class<?> classOfT, String funcName, String fieldName) { Entity<?> entity = getEntity(classOfT); EntityField ef = entity.getField(fieldName); if (null == ef) return func(entity.getTableName(), funcName, fieldName); return func(entity.getTableName(), funcName, ef.getColumnName()); } public int func(String tableName, String funcName, String fieldName) { Sql sql = sqlMaker.func(tableName, funcName, fieldName); execute(sql); return sql.getInt(); } }
[ "wendal1985@gmail.com" ]
wendal1985@gmail.com
442560da7d79c138ee2e2dd409c9eb2fb229bb88
4981fc0e1e82dc9226116aa8f0a29413c947b0ec
/Build/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java
03608ec1ddf034b57153044a29e20e49ee0c32bb
[ "MIT", "W3C", "GPL-1.0-or-later", "SAX-PD", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-unknown" ]
permissive
Mayo-WE01051879/mayosapp
7e33d4b73b20e6f58f0ae593ae7c9ac10afff20c
4c678635cfd2823c2df6937165e102fdac72cb86
refs/heads/master
2022-12-10T01:22:54.629304
2021-02-24T20:16:36
2021-02-24T20:16:36
16,258,006
0
0
MIT
2022-12-05T23:23:59
2014-01-26T17:50:40
Java
UTF-8
Java
false
false
31,255
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.tools.ant.filters; import java.io.IOException; import java.io.Reader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.types.EnumeratedAttribute; /** * Converts text to local OS formatting conventions, as well as repair text * damaged by misconfigured or misguided editors or file transfer programs. * <p> * This filter can take the following arguments: * <ul> * <li>eof * <li>eol * <li>fixlast * <li>javafiles * <li>tab * <li>tablength * </ul> * None of which are required. * <p> * This version generalises the handling of EOL characters, and allows for * CR-only line endings (the standard on Mac systems prior to OS X). Tab * handling has also been generalised to accommodate any tabwidth from 2 to 80, * inclusive. Importantly, it can leave untouched any literal TAB characters * embedded within Java string or character constants. * <p> * <em>Caution:</em> run with care on carefully formatted files. This may * sound obvious, but if you don't specify asis, presume that your files are * going to be modified. If "tabs" is "add" or "remove", whitespace characters * may be added or removed as necessary. Similarly, for EOLs, eol="asis" * actually means convert to your native O/S EOL convention while eol="crlf" or * cr="add" can result in CR characters being removed in one special case * accommodated, i.e., CRCRLF is regarded as a single EOL to handle cases where * other programs have converted CRLF into CRCRLF. * * <P> * Example: * * <pre> * &lt;&lt;fixcrlf tab=&quot;add&quot; eol=&quot;crlf&quot; eof=&quot;asis&quot;/&gt; * </pre> * * Or: * * <pre> * &lt;filterreader classname=&quot;org.apache.tools.ant.filters.FixCrLfFilter&quot;&gt; * &lt;param eol=&quot;crlf&quot; tab=&quot;asis&quot;/&gt; * &lt;/filterreader&gt; * </pre> * */ public final class FixCrLfFilter extends BaseParamFilterReader implements ChainableReader { private static final int DEFAULT_TAB_LENGTH = 8; private static final int MIN_TAB_LENGTH = 2; private static final int MAX_TAB_LENGTH = 80; private static final char CTRLZ = '\u001A'; private int tabLength = DEFAULT_TAB_LENGTH; private CrLf eol; private AddAsisRemove ctrlz; private AddAsisRemove tabs; private boolean javafiles = false; private boolean fixlast = true; private boolean initialized = false; /** * Constructor for "dummy" instances. * * @see BaseFilterReader#BaseFilterReader() */ public FixCrLfFilter() { super(); } /** * Create a new filtered reader. * * @param in * A Reader object providing the underlying stream. Must not be * <code>null</code>. * @throws IOException on error. */ public FixCrLfFilter(final Reader in) throws IOException { super(in); } // Instance initializer: Executes just after the super() call in this // class's constructor. { tabs = AddAsisRemove.ASIS; if (Os.isFamily("mac") && !Os.isFamily("unix")) { ctrlz = AddAsisRemove.REMOVE; setEol(CrLf.MAC); } else if (Os.isFamily("dos")) { ctrlz = AddAsisRemove.ASIS; setEol(CrLf.DOS); } else { ctrlz = AddAsisRemove.REMOVE; setEol(CrLf.UNIX); } } /** * Create a new FixCrLfFilter using the passed in Reader for instantiation. * * @param rdr * A Reader object providing the underlying stream. Must not be * <code>null</code>. * * @return a new filter based on this configuration, but filtering the * specified reader. */ public Reader chain(final Reader rdr) { try { FixCrLfFilter newFilter = new FixCrLfFilter(rdr); newFilter.setJavafiles(getJavafiles()); newFilter.setEol(getEol()); newFilter.setTab(getTab()); newFilter.setTablength(getTablength()); newFilter.setEof(getEof()); newFilter.setFixlast(getFixlast()); newFilter.initInternalFilters(); return newFilter; } catch (IOException e) { throw new BuildException(e); } } /** * Get how DOS EOF (control-z) characters are being handled. * * @return values: * <ul> * <li>add: ensure that there is an eof at the end of the file * <li>asis: leave eof characters alone * <li>remove: remove any eof character found at the end * </ul> */ public AddAsisRemove getEof() { // Return copy so that the call must call setEof() to change the state // of fixCRLF return ctrlz.newInstance(); } /** * Get how EndOfLine characters are being handled. * * @return values: * <ul> * <li>asis: convert line endings to your O/S convention * <li>cr: convert line endings to CR * <li>lf: convert line endings to LF * <li>crlf: convert line endings to CRLF * </ul> */ public CrLf getEol() { // Return copy so that the call must call setEol() to change the state // of fixCRLF return eol.newInstance(); } /** * Get whether a missing EOL be added to the final line of the stream. * * @return true if a filtered file will always end with an EOL */ public boolean getFixlast() { return fixlast; } /** * Get whether the stream is to be treated as though it contains Java * source. * <P> * This attribute is only used in association with the &quot;<i><b>tab</b></i>&quot; * attribute. Tabs found in Java literals are protected from changes by this * filter. * * @return true if whitespace in Java character and string literals is * ignored. */ public boolean getJavafiles() { return javafiles; } /** * Return how tab characters are being handled. * * @return values: * <ul> * <li>add: convert sequences of spaces which span a tab stop to * tabs * <li>asis: leave tab and space characters alone * <li>remove: convert tabs to spaces * </ul> */ public AddAsisRemove getTab() { // Return copy so that the caller must call setTab() to change the state // of fixCRLF. return tabs.newInstance(); } /** * Get the tab length to use. * * @return the length of tab in spaces */ public int getTablength() { return tabLength; } private static String calculateEolString(CrLf eol) { // Calculate the EOL string per the current config if (eol == CrLf.CR || eol == CrLf.MAC) { return "\r"; } if (eol == CrLf.CRLF || eol == CrLf.DOS) { return "\r\n"; } // assume (eol == CrLf.LF || eol == CrLf.UNIX) return "\n"; } /** * Wrap the input stream with the internal filters necessary to perform the * configuration settings. */ private void initInternalFilters() { // If I'm removing an EOF character, do so first so that the other // filters don't see that character. in = (ctrlz == AddAsisRemove.REMOVE) ? new RemoveEofFilter(in) : in; // Change all EOL characters to match the calculated EOL string. If // configured to do so, append a trailing EOL so that the file ends on // a EOL. if (eol != CrLf.ASIS) { in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast()); } if (tabs != AddAsisRemove.ASIS) { // If filtering Java source, prevent changes to whitespace in // character and string literals. if (getJavafiles()) { in = new MaskJavaTabLiteralsFilter(in); } // Add/Remove tabs in = (tabs == AddAsisRemove.ADD) ? (Reader) new AddTabFilter(in, getTablength()) : (Reader) new RemoveTabFilter(in, getTablength()); } // Add missing EOF character in = (ctrlz == AddAsisRemove.ADD) ? new AddEofFilter(in) : in; initialized = true; } /** * Return the next character in the filtered stream. * * @return the next character in the resulting stream, or -1 if the end of * the resulting stream has been reached. * * @exception IOException * if the underlying stream throws an IOException during * reading. */ public synchronized int read() throws IOException { if (!initialized) { initInternalFilters(); } return in.read(); } /** * Specify how DOS EOF (control-z) characters are to be handled. * * @param attr * valid values: * <ul> * <li>add: ensure that there is an eof at the end of the file * <li>asis: leave eof characters alone * <li>remove: remove any eof character found at the end * </ul> */ public void setEof(AddAsisRemove attr) { ctrlz = attr.resolve(); } /** * Specify how end of line (EOL) characters are to be handled. * * @param attr * valid values: * <ul> * <li>asis: convert line endings to your O/S convention * <li>cr: convert line endings to CR * <li>lf: convert line endings to LF * <li>crlf: convert line endings to CRLF * </ul> */ public void setEol(CrLf attr) { eol = attr.resolve(); } /** * Specify whether a missing EOL will be added to the final line of input. * * @param fixlast * if true a missing EOL will be appended. */ public void setFixlast(boolean fixlast) { this.fixlast = fixlast; } /** * Indicate whether this stream contains Java source. * * This attribute is only used in assocation with the &quot;<i><b>tab</b></i>&quot; * attribute. * * @param javafiles * set to true to prevent this filter from changing tabs found in * Java literals. */ public void setJavafiles(boolean javafiles) { this.javafiles = javafiles; } /** * Specify how tab characters are to be handled. * * @param attr * valid values: * <ul> * <li>add: convert sequences of spaces which span a tab stop to * tabs * <li>asis: leave tab and space characters alone * <li>remove: convert tabs to spaces * </ul> */ public void setTab(AddAsisRemove attr) { tabs = attr.resolve(); } /** * Specify tab length in characters. * * @param tabLength * specify the length of tab in spaces. Valid values are between * 2 and 80 inclusive. The default for this parameter is 8. * @throws IOException on error. */ public void setTablength(int tabLength) throws IOException { if (tabLength < MIN_TAB_LENGTH || tabLength > MAX_TAB_LENGTH) { throw new IOException( "tablength must be between " + MIN_TAB_LENGTH + " and " + MAX_TAB_LENGTH); } this.tabLength = tabLength; } /** * This filter reader redirects all read I/O methods through its own read() * method. * * <P> * The input stream is already buffered by the copy task so this doesn't * significantly impact performance while it makes writing the individual * fix filters much easier. * </P> */ private static class SimpleFilterReader extends Reader { private static final int PREEMPT_BUFFER_LENGTH = 16; private Reader in; private int[] preempt = new int[PREEMPT_BUFFER_LENGTH]; private int preemptIndex = 0; public SimpleFilterReader(Reader in) { this.in = in; } public void push(char c) { push((int) c); } public void push(int c) { try { preempt[preemptIndex++] = c; } catch (ArrayIndexOutOfBoundsException e) { int[] p2 = new int[preempt.length * 2]; System.arraycopy(preempt, 0, p2, 0, preempt.length); preempt = p2; push(c); } } public void push(char[] cs, int start, int length) { for (int i = start + length - 1; i >= start;) { push(cs[i--]); } } public void push(char[] cs) { push(cs, 0, cs.length); } /** * Does this filter want to block edits on the last character returned * by read()? */ public boolean editsBlocked() { return in instanceof SimpleFilterReader && ((SimpleFilterReader) in).editsBlocked(); } public int read() throws java.io.IOException { return preemptIndex > 0 ? preempt[--preemptIndex] : in.read(); } public void close() throws java.io.IOException { in.close(); } public void reset() throws IOException { in.reset(); } public boolean markSupported() { return in.markSupported(); } public boolean ready() throws java.io.IOException { return in.ready(); } public void mark(int i) throws java.io.IOException { in.mark(i); } public long skip(long i) throws java.io.IOException { return in.skip(i); } public int read(char[] buf) throws java.io.IOException { return read(buf, 0, buf.length); } public int read(char[] buf, int start, int length) throws java.io.IOException { int count = 0; int c = 0; // CheckStyle:InnerAssignment OFF - leave alone while (length-- > 0 && (c = this.read()) != -1) { buf[start++] = (char) c; count++; } // if at EOF with no characters in the buffer, return EOF return (count == 0 && c == -1) ? -1 : count; } } private static class MaskJavaTabLiteralsFilter extends SimpleFilterReader { private boolean editsBlocked = false; private static final int JAVA = 1; private static final int IN_CHAR_CONST = 2; private static final int IN_STR_CONST = 3; private static final int IN_SINGLE_COMMENT = 4; private static final int IN_MULTI_COMMENT = 5; private static final int TRANS_TO_COMMENT = 6; private static final int TRANS_FROM_MULTI = 8; private int state; public MaskJavaTabLiteralsFilter(Reader in) { super(in); state = JAVA; } public boolean editsBlocked() { return editsBlocked || super.editsBlocked(); } public int read() throws IOException { int thisChar = super.read(); // Mask, block from being edited, all characters in constants. editsBlocked = (state == IN_CHAR_CONST || state == IN_STR_CONST); switch (state) { case JAVA: // The current character is always emitted. switch (thisChar) { case '\'': state = IN_CHAR_CONST; break; case '"': state = IN_STR_CONST; break; case '/': state = TRANS_TO_COMMENT; break; default: // Fall tru } break; case IN_CHAR_CONST: switch (thisChar) { case '\'': state = JAVA; break; default: // Fall tru } break; case IN_STR_CONST: switch (thisChar) { case '"': state = JAVA; break; default: // Fall tru } break; case IN_SINGLE_COMMENT: // The current character is always emitted. switch (thisChar) { case '\n': case '\r': // EOL state = JAVA; break; default: // Fall tru } break; case IN_MULTI_COMMENT: // The current character is always emitted. switch (thisChar) { case '*': state = TRANS_FROM_MULTI; break; default: // Fall tru } break; case TRANS_TO_COMMENT: // The current character is always emitted. switch (thisChar) { case '*': state = IN_MULTI_COMMENT; break; case '/': state = IN_SINGLE_COMMENT; break; case '\'': state = IN_CHAR_CONST; break; case '"': state = IN_STR_CONST; break; default: state = JAVA; } break; case TRANS_FROM_MULTI: // The current character is always emitted. switch (thisChar) { case '/': state = JAVA; break; default: // Fall tru } break; default: // Fall tru } return thisChar; } } private static class NormalizeEolFilter extends SimpleFilterReader { private boolean previousWasEOL; private boolean fixLast; private int normalizedEOL = 0; private char[] eol = null; public NormalizeEolFilter(Reader in, String eolString, boolean fixLast) { super(in); eol = eolString.toCharArray(); this.fixLast = fixLast; } public int read() throws IOException { int thisChar = super.read(); if (normalizedEOL == 0) { int numEOL = 0; boolean atEnd = false; switch (thisChar) { case CTRLZ: int c = super.read(); if (c == -1) { atEnd = true; if (fixLast && !previousWasEOL) { numEOL = 1; push(thisChar); } } else { push(c); } break; case -1: atEnd = true; if (fixLast && !previousWasEOL) { numEOL = 1; } break; case '\n': // EOL was "\n" numEOL = 1; break; case '\r': numEOL = 1; int c1 = super.read(); int c2 = super.read(); if (c1 == '\r' && c2 == '\n') { // EOL was "\r\r\n" } else if (c1 == '\r') { // EOL was "\r\r" - handle as two consecutive "\r" and // "\r" numEOL = 2; push(c2); } else if (c1 == '\n') { // EOL was "\r\n" push(c2); } else { // EOL was "\r" push(c2); push(c1); } default: // Fall tru } if (numEOL > 0) { while (numEOL-- > 0) { push(eol); normalizedEOL += eol.length; } previousWasEOL = true; thisChar = read(); } else if (!atEnd) { previousWasEOL = false; } } else { normalizedEOL--; } return thisChar; } } private static class AddEofFilter extends SimpleFilterReader { private int lastChar = -1; public AddEofFilter(Reader in) { super(in); } public int read() throws IOException { int thisChar = super.read(); // if source is EOF but last character was NOT ctrl-z, return ctrl-z if (thisChar == -1) { if (lastChar != CTRLZ) { lastChar = CTRLZ; return lastChar; } } else { lastChar = thisChar; } return thisChar; } } private static class RemoveEofFilter extends SimpleFilterReader { private int lookAhead = -1; public RemoveEofFilter(Reader in) { super(in); try { lookAhead = in.read(); } catch (IOException e) { lookAhead = -1; } } public int read() throws IOException { int lookAhead2 = super.read(); // If source at EOF and lookAhead is ctrl-z, return EOF (NOT ctrl-z) if (lookAhead2 == -1 && lookAhead == CTRLZ) { return -1; } // Return current look-ahead int i = lookAhead; lookAhead = lookAhead2; return i; } } private static class AddTabFilter extends SimpleFilterReader { private int columnNumber = 0; private int tabLength = 0; public AddTabFilter(Reader in, int tabLength) { super(in); this.tabLength = tabLength; } public int read() throws IOException { int c = super.read(); switch (c) { case '\r': case '\n': columnNumber = 0; break; case ' ': columnNumber++; if (!editsBlocked()) { int colNextTab = ((columnNumber + tabLength - 1) / tabLength) * tabLength; int countSpaces = 1; int numTabs = 0; scanWhitespace: while ((c = super.read()) != -1) { switch (c) { case ' ': if (++columnNumber == colNextTab) { numTabs++; countSpaces = 0; colNextTab += tabLength; } else { countSpaces++; } break; case '\t': columnNumber = colNextTab; numTabs++; countSpaces = 0; colNextTab += tabLength; break; default: push(c); break scanWhitespace; } } while (countSpaces-- > 0) { push(' '); columnNumber--; } while (numTabs-- > 0) { push('\t'); columnNumber -= tabLength; } c = super.read(); switch (c) { case ' ': columnNumber++; break; case '\t': columnNumber += tabLength; break; default: // Fall tru } } break; case '\t': columnNumber = ((columnNumber + tabLength - 1) / tabLength) * tabLength; break; default: columnNumber++; } return c; } } private static class RemoveTabFilter extends SimpleFilterReader { private int columnNumber = 0; private int tabLength = 0; public RemoveTabFilter(Reader in, int tabLength) { super(in); this.tabLength = tabLength; } public int read() throws IOException { int c = super.read(); switch (c) { case '\r': case '\n': columnNumber = 0; break; case '\t': int width = tabLength - columnNumber % tabLength; if (!editsBlocked()) { for (; width > 1; width--) { push(' '); } c = ' '; } columnNumber += width; break; default: columnNumber++; } return c; } } /** * Enumerated attribute with the values "asis", "add" and "remove". */ public static class AddAsisRemove extends EnumeratedAttribute { private static final AddAsisRemove ASIS = newInstance("asis"); private static final AddAsisRemove ADD = newInstance("add"); private static final AddAsisRemove REMOVE = newInstance("remove"); /** {@inheritDoc}. */ public String[] getValues() { return new String[] {"add", "asis", "remove"}; } /** * Equality depending in the index. * @param other the object to test equality against. * @return true if the object has the same index as this. */ public boolean equals(Object other) { return other instanceof AddAsisRemove && getIndex() == ((AddAsisRemove) other).getIndex(); } /** * Hashcode depending on the index. * @return the index as the hashcode. */ public int hashCode() { return getIndex(); } AddAsisRemove resolve() throws IllegalStateException { if (this.equals(ASIS)) { return ASIS; } if (this.equals(ADD)) { return ADD; } if (this.equals(REMOVE)) { return REMOVE; } throw new IllegalStateException("No replacement for " + this); } // Works like clone() but doesn't show up in the Javadocs private AddAsisRemove newInstance() { return newInstance(getValue()); } /** * Create an instance of this enumerated value based on the string value. * @param value the value to use. * @return an enumerated instance. */ public static AddAsisRemove newInstance(String value) { AddAsisRemove a = new AddAsisRemove(); a.setValue(value); return a; } } /** * Enumerated attribute with the values "asis", "cr", "lf" and "crlf". */ public static class CrLf extends EnumeratedAttribute { private static final CrLf ASIS = newInstance("asis"); private static final CrLf CR = newInstance("cr"); private static final CrLf CRLF = newInstance("crlf"); private static final CrLf DOS = newInstance("dos"); private static final CrLf LF = newInstance("lf"); private static final CrLf MAC = newInstance("mac"); private static final CrLf UNIX = newInstance("unix"); /** * @see EnumeratedAttribute#getValues */ /** {@inheritDoc}. */ public String[] getValues() { return new String[] {"asis", "cr", "lf", "crlf", "mac", "unix", "dos"}; } /** * Equality depending in the index. * @param other the object to test equality against. * @return true if the object has the same index as this. */ public boolean equals(Object other) { return other instanceof CrLf && getIndex() == ((CrLf) other).getIndex(); } /** * Hashcode depending on the index. * @return the index as the hashcode. */ public int hashCode() { return getIndex(); } CrLf resolve() { if (this.equals(ASIS)) { return ASIS; } if (this.equals(CR) || this.equals(MAC)) { return CR; } if (this.equals(CRLF) || this.equals(DOS)) { return CRLF; } if (this.equals(LF) || this.equals(UNIX)) { return LF; } throw new IllegalStateException("No replacement for " + this); } // Works like clone() but doesn't show up in the Javadocs private CrLf newInstance() { return newInstance(getValue()); } /** * Create an instance of this enumerated value based on the string value. * @param value the value to use. * @return an enumerated instance. */ public static CrLf newInstance(String value) { CrLf c = new CrLf(); c.setValue(value); return c; } } }
[ "delapaz.mayo@gmail.com" ]
delapaz.mayo@gmail.com
4fa69300e5089834081ba0b88be463185f8a11b6
3d49489e40610294d594ed7ba009ab768c06bb24
/src/test/java/inventoryapi/TestUtil.java
7022671a463ff4b981cd490596bf46cd6a9d0ecf
[]
no_license
abdullahhamid/SpringInventoryAPI
731590b8ca06202103534441a405605915c10fb0
272697b77314217fe80fe9e66c047504679c996f
refs/heads/master
2021-01-11T06:54:11.610440
2016-11-01T00:03:33
2016-11-01T00:03:33
72,357,805
0
0
null
null
null
null
UTF-8
Java
false
false
676
java
package inventoryapi; import java.io.IOException; import java.nio.charset.Charset; import org.springframework.http.MediaType; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.annotation.JsonInclude; public class TestUtil { public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(MediaType.APPLICATION_JSON.getType(), MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8")); public static byte[] convertObjectToJsonBytes(Object object) throws IOException { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); return mapper.writeValueAsBytes(object); } }
[ "abdullahroshan17@gmail.com" ]
abdullahroshan17@gmail.com
f3f5f8ad5dd58a79bc6b0648f5a66cd4e029a720
0bd4a3bd7b5a27b2f6ab2e9eb841de7d764bae4d
/src/org/nschmidt/ldparteditor/enums/ObjectMode.java
89a31cd9f4cddc9fa3a8edfffe3e98799140512e
[ "MIT" ]
permissive
VB6Hobbyst7/ldparteditor
d1945e18efc33b776cf77d2119d0dff6252b4167
e31c5b3c46b73d05bd813937061abdf4f66c3601
refs/heads/master
2023-08-19T04:52:50.504319
2019-12-31T10:22:35
2019-12-31T10:26:28
236,895,403
0
0
MIT
2021-05-08T11:38:28
2020-01-29T03:29:15
null
UTF-8
Java
false
false
1,273
java
/* MIT - License Copyright (c) 2012 - this year, Nils Schmidt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package org.nschmidt.ldparteditor.enums; /** * A enum class for different the object modes * * @author nils * */ public enum ObjectMode { VERTICES, SUBFILES, LINES, FACES }
[ "nilsschmidt1337@users.noreply.github.com" ]
nilsschmidt1337@users.noreply.github.com
55cffe7fc276eda6f0337a6270addc43075e96fe
4e9c06ff59fe91f0f69cb3dd80a128f466885aea
/src/o/abb.java
b4b78fd1c35889345f9af4bdd418d6524ffebb2d
[]
no_license
reverseengineeringer/com.eclipsim.gpsstatus2
5ab9959cc3280d2dc96f2247c1263d14c893fc93
800552a53c11742c6889836a25b688d43ae68c2e
refs/heads/master
2021-01-17T07:26:14.357187
2016-07-21T03:33:07
2016-07-21T03:33:07
63,834,134
0
0
null
null
null
null
UTF-8
Java
false
false
777
java
package o; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Set; public final class abb extends di<abb> { public Map<Integer, Double> aLp = new HashMap(4); public final String toString() { HashMap localHashMap = new HashMap(); Iterator localIterator = aLp.entrySet().iterator(); while (localIterator.hasNext()) { Map.Entry localEntry = (Map.Entry)localIterator.next(); String str = String.valueOf(localEntry.getKey()); localHashMap.put(String.valueOf(str).length() + 6 + "metric" + str, localEntry.getValue()); } return ˎ(localHashMap); } } /* Location: * Qualified Name: o.abb * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
3215f9ef6bcbd0a7585d61f88eba7d1948c0735b
c474cf5b53785a75c6d7558b4a5f3d1b8a98b5bb
/com.bpcbt.svfe/src/com/bpcbt/svfe/eclipse/ConvertToSVFECommandHandler.java
d45b6844fcfaa1f296848250694c7a9b6677ef4d
[]
no_license
thedimitrius/svfe
b27ff8ffd0e76f7525c1d93264faa5c2c2bcd034
f6423ce477545fe611d410dee1a1b3e9f31332a1
refs/heads/master
2021-01-18T14:09:36.996022
2013-12-30T11:11:35
2013-12-30T11:11:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,302
java
package com.bpcbt.svfe.eclipse; import java.util.Iterator; import org.eclipse.core.commands.*; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.handlers.HandlerUtil; import com.bpcbt.svfe.SVFEActivator; import com.bpcbt.svfe.system.ProjectsList; public class ConvertToSVFECommandHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); ProjectsList projects; Object element; IProject project; if (selection instanceof IStructuredSelection) { for (Iterator<?> it = ((IStructuredSelection) selection).iterator(); it .hasNext();) { element = it.next(); project = null; if (element instanceof IProject) project = (IProject) element; else if (element instanceof IAdaptable) project = (IProject) ((IAdaptable) element).getAdapter(IProject.class); if (project != null) { projects = SVFEActivator.getDefault().getProjectsList(); projects.convertProjectToSVFE(project); } } } return null; } }
[ "Papka@PAPKA.bpc.in" ]
Papka@PAPKA.bpc.in
f4951bd6ab8a4d771d7fdf3c03db93a1a14cb179
416ed26975cc93982e9895da5f2f447383bc5d9f
/main/boofcv-geo/test/boofcv/alg/geo/robust/TestGenerateHomographyLinear.java
63fde8f7abb1ba4e86d2553b62a21ecb634ce23d
[ "LicenseRef-scancode-takuya-ooura", "Apache-2.0" ]
permissive
jmankhan/BoofCV
4cb99fbe19afcd35197003fc967c998e9c4875de
afbb6b1bf360092b3ee6e3ed5d0d2f9710d0e2da
refs/heads/SNAPSHOT
2021-01-20T03:29:46.088886
2017-05-06T18:13:40
2017-05-06T18:13:40
89,549,111
1
0
null
2017-04-27T02:54:45
2017-04-27T02:54:45
null
UTF-8
Java
false
false
3,146
java
/* * Copyright (c) 2011-2017, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package boofcv.alg.geo.robust; import boofcv.struct.geo.AssociatedPair; import georegression.struct.homography.Homography2D_F64; import georegression.struct.point.Point2D_F64; import georegression.transform.homography.HomographyPointOps_F64; import org.ddogleg.fitting.modelset.ModelFitter; import org.ddogleg.fitting.modelset.ModelGenerator; import org.junit.Test; import java.util.List; import java.util.Random; /** * @author Peter Abeles */ public class TestGenerateHomographyLinear implements ModelTestingInterface<Homography2D_F64,AssociatedPair> { Random rand = new Random(234); @Test public void fitModel() { StandardModelFitterTests<Homography2D_F64,AssociatedPair> alg = new StandardModelFitterTests<Homography2D_F64,AssociatedPair>(this,4) { @Override public ModelFitter<Homography2D_F64,AssociatedPair> createAlg() { return new GenerateHomographyLinear(true); } }; alg.allTest(); } @Test public void modelGenerator() { StandardModelGeneratorTests<Homography2D_F64,AssociatedPair> alg = new StandardModelGeneratorTests<Homography2D_F64,AssociatedPair>(this,4) { @Override public ModelGenerator<Homography2D_F64,AssociatedPair> createAlg() { return new GenerateHomographyLinear(true); } @Override public Homography2D_F64 createModelInstance() { return new Homography2D_F64(); } }; alg.allTest(); } @Override public Homography2D_F64 createRandomModel() { Homography2D_F64 model = new Homography2D_F64(); model.a11 = rand.nextDouble(); model.a12 = rand.nextDouble(); model.a13 = rand.nextDouble(); model.a21 = rand.nextDouble(); model.a22 = rand.nextDouble(); model.a23 = rand.nextDouble(); model.a31 = rand.nextDouble(); model.a32 = rand.nextDouble(); model.a33 = rand.nextDouble(); return model; } @Override public AssociatedPair createRandomPointFromModel(Homography2D_F64 transform) { AssociatedPair ret = new AssociatedPair(); ret.p1.x = rand.nextDouble()*10; ret.p1.y = rand.nextDouble()*10; HomographyPointOps_F64.transform(transform, ret.p1, ret.p2); return ret; } @Override public boolean doPointsFitModel(Homography2D_F64 transform, List<AssociatedPair> dataSet) { Point2D_F64 expected = new Point2D_F64(); for( AssociatedPair p : dataSet ) { HomographyPointOps_F64.transform(transform, p.p1, expected); if( expected.distance(p.p2) > 0.01 ) return false; } return true; } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
8239f80e67d813f4622bde0b15378b509a09c2d0
8d264dd0f5e53029d16a6601c3e9a408da2980b5
/src/node/AMoinsExp3.java
354bfecbbc7fcb3f18d974c21e74e26b949376ce
[]
no_license
Loic17/compilationl3-public
499119bedcd9e8fd8c5ba35114c49e7ec4de77b9
fabc30d3e2f257a48773dccc495a48ccd9c9470b
refs/heads/master
2020-12-20T09:38:29.637604
2020-04-10T08:48:55
2020-04-10T08:48:55
236,031,524
0
0
null
2020-01-24T15:48:10
2020-01-24T15:48:09
null
UTF-8
Java
false
false
3,434
java
/* This file was generated by SableCC (http://www.sablecc.org/). */ package node; import analysis.*; @SuppressWarnings("nls") public final class AMoinsExp3 extends PExp3 { private PExp3 _exp3_; private TMoins _moins_; private PExp4 _exp4_; public AMoinsExp3() { // Constructor } public AMoinsExp3( @SuppressWarnings("hiding") PExp3 _exp3_, @SuppressWarnings("hiding") TMoins _moins_, @SuppressWarnings("hiding") PExp4 _exp4_) { // Constructor setExp3(_exp3_); setMoins(_moins_); setExp4(_exp4_); } @Override public Object clone() { return new AMoinsExp3( cloneNode(this._exp3_), cloneNode(this._moins_), cloneNode(this._exp4_)); } @Override public void apply(Switch sw) { ((Analysis) sw).caseAMoinsExp3(this); } public PExp3 getExp3() { return this._exp3_; } public void setExp3(PExp3 node) { if(this._exp3_ != null) { this._exp3_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._exp3_ = node; } public TMoins getMoins() { return this._moins_; } public void setMoins(TMoins node) { if(this._moins_ != null) { this._moins_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._moins_ = node; } public PExp4 getExp4() { return this._exp4_; } public void setExp4(PExp4 node) { if(this._exp4_ != null) { this._exp4_.parent(null); } if(node != null) { if(node.parent() != null) { node.parent().removeChild(node); } node.parent(this); } this._exp4_ = node; } @Override public String toString() { return "" + toString(this._exp3_) + toString(this._moins_) + toString(this._exp4_); } @Override void removeChild(@SuppressWarnings("unused") Node child) { // Remove child if(this._exp3_ == child) { this._exp3_ = null; return; } if(this._moins_ == child) { this._moins_ = null; return; } if(this._exp4_ == child) { this._exp4_ = null; return; } throw new RuntimeException("Not a child."); } @Override void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild) { // Replace child if(this._exp3_ == oldChild) { setExp3((PExp3) newChild); return; } if(this._moins_ == oldChild) { setMoins((TMoins) newChild); return; } if(this._exp4_ == oldChild) { setExp4((PExp4) newChild); return; } throw new RuntimeException("Not a child."); } }
[ "loiclaporte17@gmail.com" ]
loiclaporte17@gmail.com
634e99f495b7d2911e072dd02f88460bd179db87
d5274db54cb42ae509cf0424554e374227cddc24
/src/pl/glonojad/pvpgamesmanager/util/WeaponsManager.java
d74797331914dd48ad8f0d48710ac3596a4931e5
[]
no_license
itsMatoosh/PvPGamesManager
745699d9c0df54b8e790056d23170811d282d49f
62c328be39289b7b777432fa950f64a418f007f5
refs/heads/master
2021-01-23T10:54:35.460117
2018-03-27T20:09:25
2018-03-27T20:09:25
93,101,431
0
0
null
null
null
null
UTF-8
Java
false
false
3,433
java
package pl.glonojad.pvpgamesmanager.util; import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import pl.glonojad.pvpgamesmanager.player.GamePlayer; import pl.glonojad.pvpgamesmanager.util.configuration.Configuration; import com.shampaggon.crackshot.CSUtility; public class WeaponsManager { public static CSUtility crackshot; public static Boolean gunsMode; public static Configuration gunsUpgrades; public static void enableGuns() { //Disabling actual guns' plugin. Bukkit.getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin("CrackShot")); crackshot = new CSUtility(); gunsMode = true; initialize(); } public static void initialize() { gunsUpgrades = FileManager.getGunsUpgrades(); } public static void disableGuns() { //Enabling actual guns' plugin. Bukkit.getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin("CrackShot")); gunsMode = false; } public static void givePlayerGun(GamePlayer p, String gunName, int amount) { boolean foundGun = false; for(String gun : gunsUpgrades.getConfigurationPart("Guns").getKeys(false)) { if(gun.equals(gunName)) { foundGun = true; //Checking which upgrade to give player. String chosenUpgrade = null; for(String upgradeName : gunsUpgrades.getConfigurationPart("Guns." + gunName).getKeys(false)) { if(gunsUpgrades.getInt("Guns." + gunName + "." + upgradeName + ".requiredLevel") < p.getLevel() || gunsUpgrades.getInt("Guns." + gunName + "." + upgradeName + ".requiredLevel") == p.getLevel()) { chosenUpgrade = upgradeName; } } //Giving player an upgraded upgrade. crackshot.giveWeapon(Bukkit.getPlayer(p.getName()), chosenUpgrade, amount); return; } } if(foundGun == false) { crackshot.giveWeapon(p.getVanillaPlayer(), gunName, amount); } } public static ItemStack getPlayerGun(GamePlayer p, String gunName) { boolean foundGun = false; for(String gun : gunsUpgrades.getConfigurationPart("Guns").getKeys(false)) { if(gun.equals(gunName)) { foundGun = true; //Checking which upgrade to give player. String chosenUpgrade = null; for(String upgradeName : gunsUpgrades.getConfigurationPart("Guns." + gunName).getKeys(false)) { if(gunsUpgrades.getInt("Guns." + gunName + "." + upgradeName + ".requiredLevel") < p.getLevel() || gunsUpgrades.getInt("Guns." + gunName + "." + upgradeName + ".requiredLevel") == p.getLevel()) { chosenUpgrade = upgradeName; } } //Giving player an upgraded upgrade. return crackshot.generateWeapon(chosenUpgrade); } } if(foundGun == false) { return crackshot.generateWeapon(gunName); } return null; } public static ArrayList<String> checkPlayerNewUpgrades(GamePlayer p) { ArrayList<String> unlockedGuns = new ArrayList<String>(); for(String gun : gunsUpgrades.getConfigurationPart("Guns").getKeys(false)) { for(String upgradeName : gunsUpgrades.getConfigurationPart("Guns." + gun).getKeys(false)) { if(gunsUpgrades.getInt("Guns." + gun + "." + upgradeName + ".requiredLevel") == p.getLevel()) { //Player just unlocked this weapon! //Adding it to the unlockedGuns. unlockedGuns.add(ChatColor.translateAlternateColorCodes('$', gunsUpgrades.getString("Guns." + gun + "." + upgradeName + ".displayName"))); } } } return unlockedGuns; } }
[ "matirebacz@op.pl" ]
matirebacz@op.pl
686fcfd3dc9164c7d7894a5547128f2e7282132b
59e7b359e12d6c1e17d176dca255b94b2dfdcf52
/src/limelight/styles/attributes/TopRightBorderColorAttribute.java
b37783b579b20588a96e4da07da7f8f051e68dcc
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
mgill283/limelight
b2b8f8a846bd4b37fe17804fc123762969a75e20
2e8db684771587422d55a9329e895481e9b56a26
refs/heads/master
2021-01-17T12:37:41.770538
2012-08-28T17:07:31
2012-08-28T17:07:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved. //- Limelight and all included source files are distributed under terms of the MIT License. package limelight.styles.attributes; import limelight.styles.StyleAttribute; public class TopRightBorderColorAttribute extends StyleAttribute { public TopRightBorderColorAttribute() { super("Top Right Border Color", "color", "#000000ff"); } }
[ "micah@8thlight.com" ]
micah@8thlight.com
16151266282c342b9cdadef4d576cf9a189e3d09
9d51a4b7a737c66bae34eb75acb8a193b9f40fb4
/app/src/main/java/tim/project/travellerapp/activities/RegisterActivity.java
e041293cc6c4d7cb85b705e84329a92233599489
[]
no_license
damiantchon/traveller-app
180e84230d578be8f72b0f6a2d3aa9f314bacbec
f729304fb2c40b147c43cf2e06c27ba80e263ba2
refs/heads/master
2020-03-11T19:44:07.678689
2019-11-08T21:55:14
2019-11-08T21:55:14
130,216,459
0
0
null
null
null
null
UTF-8
Java
false
false
3,363
java
package tim.project.travellerapp.activities; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import tim.project.travellerapp.Constants; import tim.project.travellerapp.R; import tim.project.travellerapp.clients.ApiClient; import tim.project.travellerapp.helpers.ApiHelper; import tim.project.travellerapp.models.User; public class RegisterActivity extends AppCompatActivity { private ProgressBar progressBar; private EditText username; private EditText password; private EditText re_password; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); final TextView textView = (TextView) findViewById(R.id.textView2); username = (EditText) findViewById(R.id.input_login); password = (EditText) findViewById(R.id.input_password); re_password = (EditText) findViewById(R.id.input_re_password); Button signUpButton = (Button) findViewById(R.id.sign_up_button); } public void onRegisterClick(View view) { User user = new User( username.getText().toString(), password.getText().toString() ); if(!password.getText().toString().equals(re_password.getText().toString())) { Toast.makeText(RegisterActivity.this,"Passwords are not matching!",Toast.LENGTH_SHORT).show(); } else{ registerUser(user); } } public void onBackClick(View view) { finish(); } private void registerUser(User user) { ApiClient client = ApiHelper.getApiClient(); Call<Void> call = client.createAccount(user); call.enqueue(new Callback<Void>() { @Override public void onResponse(@NonNull Call<Void> call, @NonNull Response<Void> response) { if(response.code() == 409){ Toast.makeText(RegisterActivity.this, getString(R.string.user_duplicate),Toast.LENGTH_SHORT).show(); } else if (response.code() == 200){ Toast.makeText(RegisterActivity.this, getString(R.string.user_created),Toast.LENGTH_SHORT).show(); gotoLogin(); } } @Override public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) { Toast.makeText(RegisterActivity.this,getString(R.string.no_server_connection),Toast.LENGTH_SHORT).show(); } }); } private void gotoLogin() { Intent intent = new Intent(this, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); } @Override public void finish() { super.finish(); overridePendingTransition(R.transition.slide_in_left, R.transition.slide_out_right); } }
[ "damtch@gmail.com" ]
damtch@gmail.com
fd026d6965b8858b04590b80bf140fb4fd310221
9310225eb939f9e4ac1e3112190e6564b890ac63
/sitestats/sitestats-api/src/java/org/sakaiproject/sitestats/api/SummaryVisitsTotals.java
7cac3dca30085971ef748b6ae19648e5f65e1f37
[ "ECL-2.0" ]
permissive
deemsys/version-1.0
89754a8acafd62d37e0cdadf680ddc9970e6d707
cd45d9b7c5633915a18bd75723c615037a4eb7a5
refs/heads/master
2020-06-04T10:47:01.608886
2013-06-15T11:01:28
2013-06-15T11:01:28
10,705,153
1
0
null
null
null
null
UTF-8
Java
false
false
1,718
java
/** * $URL: https://source.sakaiproject.org/svn/sitestats/branches/sitestats-2.3.x/sitestats-api/src/java/org/sakaiproject/sitestats/api/SummaryVisitsTotals.java $ * $Id: SummaryVisitsTotals.java 72172 2009-09-23 00:48:53Z arwhyte@umich.edu $ * * Copyright (c) 2006-2009 The Sakai Foundation * * Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.sakaiproject.sitestats.api; public interface SummaryVisitsTotals { public double getLast30DaysVisitsAverage(); public void setLast30DaysVisitsAverage(double last30DaysVisitsAverage); public double getLast365DaysVisitsAverage(); public void setLast365DaysVisitsAverage(double last365DaysVisitsAverage); public double getLast7DaysVisitsAverage(); public void setLast7DaysVisitsAverage(double last7DaysVisitsAverage); public double getPercentageOfUsersThatVisitedSite(); public void setPercentageOfUsersThatVisitedSite(double percentageOfUsersThatVisitedSite); public long getTotalUniqueVisits(); public void setTotalUniqueVisits(long totalUniqueVisits); public int getTotalUsers(); public void setTotalUsers(int totalUsers); public long getTotalVisits(); public void setTotalVisits(long totalVisits); }
[ "sangee1229@gmail.com" ]
sangee1229@gmail.com
e6eebdf76557eaa868d73c6642645be5c8db448d
d3afed913f92ca939057be02e09fbc63433c6762
/Home/FrontDoor/JettyEmbedded/src/main/java/com/netstal/automation/jettyEmbedded/demoServlets/TestServlet.java
5ffe5d200e914483d38b222558b01229a0f34cc9
[]
no_license
mnemonia/robotix
5981ee62c3e727a3ece0aaa00fca91ad3dbbb495
8d9d745872f3509baf9e764d1e8be1b5e63732a4
refs/heads/master
2021-01-23T16:36:31.182773
2017-08-07T19:29:37
2017-08-07T19:29:37
3,083,936
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
package com.netstal.automation.jettyEmbedded.demoServlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class TestServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().write("Dies ist ein normales Servlet"); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { super.doPost(req, resp); } }
[ "birkeland@gmx.net" ]
birkeland@gmx.net
f4d4309adc06cb5dacaa39826a8e26f3fd267eef
dacac372cf650406ab3189bf59b558a89285fdae
/src/main/java/kg/DiscountPlatform/dto/networkCategories/NetworkCategoriesFilter.java
dc3e5ad8595d509bd404b852c9e71a6c4f95ea7b
[]
no_license
KulataevKanat/DiscountPlatform
4eb921079f1dbc5e9944bffc6b834b1861396201
1a57e98b0df075f9e3927acca6b328382c97db16
refs/heads/master
2020-05-27T04:42:04.416264
2020-03-22T18:06:44
2020-03-22T18:06:44
239,280,838
5
0
null
null
null
null
UTF-8
Java
false
false
652
java
package kg.DiscountPlatform.dto.networkCategories; import kg.DiscountPlatform.entity.NetworkCategories; public class NetworkCategoriesFilter { private Long id; private String name; private Long categoriesId; public NetworkCategoriesFilter(NetworkCategories networkCategories) { this.id = networkCategories.getId(); this.name = networkCategories.getName(); this.categoriesId = networkCategories.getCategories().getId(); } public Long getId() { return id; } public String getName() { return name; } public Long getCategoriesId() { return categoriesId; } }
[ "RaketaEnot4466@gmail.com" ]
RaketaEnot4466@gmail.com
5d1f28a478dde39302cc2eeb4d5a7366af571af3
19b1801dc1b1eb65db07d2af9cb7f15fca8adb23
/dz8/src/main/java/ru/otus/library/service/BookServiceImpl.java
b50db7fc033472412ad7f32a58ec11e4109ae86a
[]
no_license
ROCKep/2020-05-otus-spring-Golovin
00ab5862a85229bbbcf163fadf7829e878646740
742b4530d994638a53d7800c02b147eecc765f4d
refs/heads/master
2023-07-21T13:57:33.391291
2021-05-03T16:39:25
2021-05-03T16:39:25
267,148,260
0
0
null
2023-07-12T12:50:00
2020-05-26T20:45:06
Java
UTF-8
Java
false
false
3,175
java
package ru.otus.library.service; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import ru.otus.library.domain.Author; import ru.otus.library.domain.Book; import ru.otus.library.domain.Genre; import ru.otus.library.repository.AuthorRepository; import ru.otus.library.repository.BookRepository; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class BookServiceImpl implements BookService { private final IOService ioService; private final BookRepository bookRepo; private final AuthorRepository authorRepo; @Override @Transactional(readOnly = true) public void listAllBooks() { ioService.outputLine("Listing all books:"); List<Book> books = bookRepo.findAll(); books.forEach(book -> ioService.outputLine(getBookShortString(book))); } @Override @Transactional(readOnly = true) public void getBookDetails(String id) { ioService.outputLine("Book details:"); Book book = bookRepo.getById(id); ioService.outputLine(getBookLongString(book)); } @Override @Transactional public void addNewBook() { ioService.output("input name: "); String name = ioService.inputLine(); ioService.output("input release year: "); int releaseYear = ioService.inputInteger(); ioService.output("input author name: "); String authorName = ioService.inputLine(); ioService.output("input genre names: "); String genreNames = ioService.inputLine(); Author author = authorRepo.findByName(authorName); List<Genre> genres = Arrays.stream(genreNames.split(", ")) .map(Genre::new) .collect(Collectors.toList()); Book book = new Book(name, releaseYear, genres, author); book = bookRepo.save(book); ioService.outputLine("inserted book"); ioService.outputLine(getBookLongString(book)); } @Override @Transactional public void deleteBook(String id) { bookRepo.deleteById(id); ioService.outputLine(String.format("deleted book with id %s", id)); } String getBookShortString(Book book) { StringBuilder builder = new StringBuilder(); builder.append(String.format("%s. %s", book.getId(), book.getName())); if (book.getReleaseYear() != null) { builder.append(String.format(" (%d)", book.getReleaseYear())); } return builder.toString(); } String getBookLongString(Book book) { StringBuilder builder = new StringBuilder(); builder.append(String.format("%s%n", getBookShortString(book))); builder.append(String.format("\tAuthor: %s%n", book.getAuthor().getName())); if (!book.getGenres().isEmpty()) { builder.append(String.format("\tGenres: %s", book.getGenres().stream() .map(Genre::getName).collect(Collectors.joining(", ")))); } return builder.toString(); } }
[ "mr.igor.golovin@gmail.com" ]
mr.igor.golovin@gmail.com
eb986cf2b6feaa033a696113ff679a2176b19685
5778f27712f9a198b462172057e7e9aae372fc4b
/BabyTracker/app/src/main/java/com/example/babytracker/DataParser.java
d2830dd17c9473bcee2e6f3c4e2725888a582d18
[]
no_license
jjblues86/babyTracker
0c0806b1241209896fb0859ed0e971a9a4099f36
153b1893bcc5b6fa867d7e151a77467c2e00bef8
refs/heads/master
2021-02-18T23:08:42.379412
2020-03-16T15:53:38
2020-03-16T15:53:38
245,249,610
0
2
null
2020-03-15T05:23:23
2020-03-05T19:25:41
Java
UTF-8
Java
false
false
2,582
java
package com.example.babytracker; import android.widget.LinearLayout; import com.apollographql.apollo.json.JsonDataException; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class DataParser { private HashMap<String, String> getSingleNearbyPlace(JSONObject googlePlaceJSON) { HashMap<String, String> googlePlaceMap = new HashMap<>(); String NameOfPlace = "-NA"; String vicinity = "-NA"; String latitude = "-NA"; String longitude = "-NA"; String reference = "-NA"; try { if (!googlePlaceJSON.isNull("name")) { NameOfPlace = googlePlaceJSON.getString("name"); } if (!googlePlaceJSON.isNull("vicinity")) { NameOfPlace = googlePlaceJSON.getString("vicinity"); } latitude = googlePlaceJSON.getJSONObject("geometry").getJSONObject("location").getString("lat"); longitude = googlePlaceJSON.getJSONObject("geometry").getJSONObject("location").getString("lng"); reference = googlePlaceJSON.getString("reference"); googlePlaceMap.put("place_name", NameOfPlace); googlePlaceMap.put("vicinity", vicinity); googlePlaceMap.put("lat", latitude); googlePlaceMap.put("lng", longitude); googlePlaceMap.put("reference", reference); } catch (JSONException e) { e.printStackTrace(); } return googlePlaceMap; } private List<HashMap<String, String>> getAllNearbyPlaces(JSONArray jsonArray) { int counter = jsonArray.length(); List<HashMap<String, String>> NearbyPlacesList = new ArrayList<>(); HashMap<String, String> NearbyPlaceMap = null; for (int i = 0; i < counter; i++) { try { NearbyPlaceMap = getSingleNearbyPlace((JSONObject) jsonArray.get(i)); NearbyPlacesList.add(NearbyPlaceMap); } catch (JSONException e) { e.printStackTrace(); } } return NearbyPlacesList; } public List<HashMap<String, String>> parse(String jsonData) { JSONArray jsonArray = null; JSONObject jsonObject; try { jsonObject = new JSONObject(jsonData); jsonArray = jsonObject.getJSONArray("results"); } catch (JSONException e) { e.printStackTrace(); } return getAllNearbyPlaces(jsonArray); } }
[ "sergvoytov@gmail.com" ]
sergvoytov@gmail.com
2b37d6a3b84f3f88daba33582c99989bc6caec7e
9781d778dae91c809de0dbead1bab5c28edad756
/src/frontend/Login/app/build/outputs/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/lifecycle/service/R.java
1a173d528f079838c6f29ddf2f79c42978b5db4f
[ "MIT" ]
permissive
sjtu-ee-summer/summer-scenary-app
a318562b707fb521b8e63fd463df381721d8f0e7
a32f841c0fd941762034f19a9728e7cd6382a44f
refs/heads/master
2020-05-25T23:33:46.181792
2019-09-10T08:00:39
2019-09-10T08:00:39
188,026,521
2
2
MIT
2019-09-10T08:00:40
2019-05-22T11:39:26
TSQL
UTF-8
Java
false
false
266
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 androidx.lifecycle.service; public final class R { private R() {} }
[ "kmykoh97@gmail.com" ]
kmykoh97@gmail.com
b378e2fa914d99b8836f4aa297f9d4fdb001288d
4804a8033b7c43a787faf39cd4ce33bc874bad68
/app/src/main/java/com/example/dpchat_app/DataActivity.java
0ba02dab045d156909ad9ac92342ab5d377193a1
[]
no_license
BUIQUOCDAT1281997/Dpchat
57048bd9e8f3d6b5e90e1c74c9c39bc91159342d
7398c1183b6453c9cda496b45792d3a57641290e
refs/heads/master
2020-05-04T01:39:48.060633
2019-04-01T17:26:27
2019-04-01T17:26:27
178,840,354
0
0
null
null
null
null
UTF-8
Java
false
false
2,758
java
package com.example.dpchat_app; import android.app.ProgressDialog; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; public class DataActivity extends AppCompatActivity { private Toolbar toolbar; private EditText editText; private Button button; private DatabaseReference databaseReference; private ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_data); FirebaseUser current_user = FirebaseAuth.getInstance().getCurrentUser(); String uid = current_user.getUid(); databaseReference = FirebaseDatabase.getInstance().getReference().child("users").child(uid); // anh xa button = findViewById(R.id.data_button_save); editText = findViewById(R.id.data_edittext); toolbar = findViewById(R.id.data_toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle("Sinh nhật"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { progressDialog = new ProgressDialog(DataActivity.this); progressDialog.setMessage("Please wait..."); progressDialog.show(); // viet phan co ban databaseReference.child("namSinh").setValue(editText.getText().toString()).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()){ progressDialog.dismiss(); Toast.makeText(DataActivity.this,"Thông tin của bạn đã được tải lên server",Toast.LENGTH_LONG).show(); Intent intent = new Intent(DataActivity.this, SettingActivity.class); startActivity(intent); finish(); } } }); } }); } }
[ "31703769+BUIQUOCDAT1281997@users.noreply.github.com" ]
31703769+BUIQUOCDAT1281997@users.noreply.github.com
6dac8d52b4e9c29236bb25fb5723de487f7f68fe
0b7fb3e0c18989087b1c73aa740e6ff5766e71f5
/src/main/java/com/ex28/AddingNumbers.java
020db91e14249891d84550c337cf9fa8bfe39a32
[]
no_license
Enoc-Mena/mena-cop3330-assignment2Ex28
4838dccd1d15304b51b1b6299235e85db01cc3c9
598104d45963f560449bdbe265a633ad3af7d54f
refs/heads/master
2023-05-22T10:01:30.859104
2021-06-09T17:52:48
2021-06-09T17:52:48
375,444,380
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
/* * UCF COP3330 Summer 2021 Assignment 2 Solution * Copyright 2021 Enoc Mena */ package com.ex28; import java.util.Scanner; public class AddingNumbers { static void addingNumbers() { int userIn; int sum = 0; int i = 0; while(i < 5) { Scanner input = new Scanner(System.in); System.out.print("Enter a number: "); userIn = input.nextInt(); sum += userIn; i++; } System.out.println(""); System.out.print("The total is: " + sum); System.out.println(""); } public static void main(String[] args) { //Call method addingNumbers(); } }
[ "enocschool@Enocs-iMac.local" ]
enocschool@Enocs-iMac.local
21d9b7b15df8a955d3969c93a9f5ff2b7801ee1b
d0e9c082e38713da0bfa70ca6bf8ace992138841
/app/src/main/java/com/example/android/cop1803/CopData.java
ff29ccbb6ba7fcd77f6eabbc97851689cdb0063b
[]
no_license
neuerj/COP1803e
ef998943007e4aecbabd4744ad3cab8cba5fe66f
0899f3c8929ba73a820983c054a69502483cc17e
refs/heads/master
2020-03-28T05:10:32.449933
2019-02-28T02:45:53
2019-02-28T02:45:53
147,760,477
0
0
null
null
null
null
UTF-8
Java
false
false
115,596
java
package com.example.android.cop1803; /** * Created by Neuer home on 11/26/2017. */ import java.util.ArrayList; public class CopData { public static ArrayList<CopListdata> LoadDataCopButton(String foodclass) { ArrayList<CopListdata> data = new ArrayList<CopListdata>(); switch (foodclass) { case "MainCOPbtn": data.add(new CopListdata("Protein","Beef","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Chicken","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Game","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Goose and Gosling","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Protein","Guinea Hen Fowl","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Protein","Lamb","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Organ Meats - Offal Meats","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Ostrich","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Pork","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Poussin/Cornish Game Hen","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Protein","Squab","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Protein","Turkey","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Veal","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Venison","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","*** Fish ***","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Protein","Cephalopods","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Flat Fish","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Miscellaneous","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Non-Bony Fish","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Poke","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Round Fish","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Protein","Shellfish","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","*** Dairy and Eggs ***","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dairy","Butter","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","Cheese","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","Cream","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","Eggs","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","Milk","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dairy","Yogurt","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","*** Vegetables ***","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Artichoke","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Asparagus","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Avocados","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Bean Sprouts","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beans-Edible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beans-Inedible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beet","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Bell Pepper","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Breadfruit","1","120","0","29",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Broccoli","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Brussel Sprouts","3","40","0","7",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Cabbage","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Carrot","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Cauliflower","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Celeriac/Celery Root","2","48","0","10",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Celery Green, Giant Pascal","2","16","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Chard Swiss, Multicolored","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Chili Peppers Fresh And Dry \n 9Listed In Order of Scoville Units","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Collard Greens","2","28","0","5",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Corn","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Cucumber","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Dandelion","3","48","1","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Dried Beans/Peas/Lentils/Flageolet","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Edamame","9","124","0","23",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Eggplant","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Escarole","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Fennel","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Garlic","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Kale","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Kohlrabi","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Leafy Greens","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Leek/Baby Leek","1","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Legume and Seed Shoots","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Lettuce","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Lotus Root","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Microgreens","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Mushrooms","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","New Mexican 6-4 Heritage","","1786","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Okra Red/Green","2","36","0","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Onion","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Oyster Plant","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Parsnip","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Peas-Edible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Peas-Inedible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Radicchio","0","6","0","2",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Radishes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Roots and Tubers","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Salsify Black/White","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Sea Vegetables","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Shallot","1","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Shoots and Stems","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Sorrel","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Spinach","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Summer Squash","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Sweet Potatoes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Tomatillo","0","44","0","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Tomato","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Truffles","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Turnip","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Water Chestnut","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Winter Squash","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","*** Fruits ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Apples","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Apricots","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Banana","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Berries","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Cherimoya","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Cherries","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Currants","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Dates","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Dragon Fruit","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Feijoa","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Figs","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Grapefruit","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Grapes","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Guava","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Kiwi","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Kumquat","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Lemons","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Limes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Lychee","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Mango","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Mangostene","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Medlar","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Melons","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Minneola","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Murcott","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Nectarines","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Olives","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Oranges","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Papayas","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Passion Fruit","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Peaches","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Pears","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Persimmon","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Physallis/Cape Gooseberry","1","52","0","12",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Pineapple","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Plums","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Pomegranate","1","108","0","25",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Pomelo","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Prickly Pear","","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Quince","0","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Rhubarb","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Sapodilla/Mexican Pear","1","64","0","16",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Star Fruit/Carambola","1","41","0","9",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Tamarillo/New Zealand","3","42","1","5",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Tangerine/Mandarin","1","48","0","11",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Ugly/Spanish Citrus","1","40","0","9",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Watermelon","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","*** Starches Grains ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Arrowroot","0","228","0","57",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Asian Style Noodles","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Bao Buns","0","160","2","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Barley Pot, Pearl","0","208","0","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bean Products","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Beans","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Bran","0","125","2","37",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bread","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Buckwheat","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bulgar","0","210","1","40",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Buns","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Corn ","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Corn Bread","0","188","6","29",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Cornstarch","0","244","0","58",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Couscous","0","200","1","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Farina","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","File’","0","192","5","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Flatbread","0","192","5","41",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Flour","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Garden Peas","0","210","0.5","19",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Germ","0","207","5","28",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Lentils","0","210","0.5","19",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Matzo Ball","0","96","3","12",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Millet","0","228","2","44",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Modified Food Starch","0","0","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oat Bran","0","154","4","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oatmeal","0","204","4","38",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oats","0","204","4","38",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Pasta","7","200","1","41",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Potatoes","0","58.1","0.1","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Quinoa","0","222","3.5","39",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Rice","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Rice Paper","0","228","0","50",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Rye","0","202","1.5","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Semolina","0","200","1","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Sorghum","0","202","2","44",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Tapioca","0","2226","0","54",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Wheat Whole Cracked","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Yams/Kumara","0","57","0","13",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","*** Nuts and Seeds ***","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Almonds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Brazil Nuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Candlenuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Cashews","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Chestnuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Chocolate","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Coconuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Gingko Nuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Hazelnut","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Linseed","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Lotus Nuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Lupin Seeds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Macadamias","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Peanuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Pecans","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Pine Nuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Pistachios","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Poppy Seeds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Pumpkin Seeds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Sesame Seeds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Sunflower Seeds","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Tiger Nuts","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Nuts","Walnuts","","","","",R.drawable.mic_done_black_24dp)); break; // button btnx21 Breadings Crusts coatings Wraps case "btnx21": data.add(new CopListdata("Crust/Coatings","Batters","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Bean/Legume Pastes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Bread Crumbs","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Chopped Nuts","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Crushed Root Chip Crumbs","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Dried Fruit","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Dried Vegetables","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Edible Flowers","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Flour","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Fruit Paste","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Grain and Starch Flours","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Grains and Starches","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Mushroom Crumbs","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Mushroom Flours","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Nut Flours","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Other","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Potato Crumbs","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Seeds","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Spices","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Sugar","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Crust/Coatings","Tortilla Crumbs","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","*** Wraps ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Cabbage Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Corn Tortillas","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Dried Fruit Leathers","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Dried Vegetable Sheets","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Edible Bowls","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Flour Tortillas","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Grape Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Indian Fry Bread/Navajo Taco","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Lettuce Leaves","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Nori or Dried Seaweed Paper","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Pastry Sheets","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Pastry Dough","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Phyllo Dough","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Potato Sheets","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Wraps","Puff Pastry Dough","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Rice Paper/Spreing Roll Wrappers","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Wraps","Won Ton Wrapper","","","","",R.drawable.mic_done_black_24dp)); break; // button btnx22 Manipulation case "btnx22": data.add(new CopListdata("Manipulation","Batonnet","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Bias","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Blanching","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Blending","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Brunoise","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Channel Cut","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Chiffonade","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Chopping","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Cutting","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Diagonal Bias","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Dice","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Manipulation","Emulsifying","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Fanning","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Filet","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Fine Julienne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Fluting","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Folding","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Grinding","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Julienne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Kabob","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Kneading","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Mashing","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Medallions","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Mince","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Minced","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Parisienne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Paysanne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Pounding","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Pulverizing","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Puree","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Rolling","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Rondelle","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Skewer","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Slicing","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Suprémes","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Tenderizing","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Tossing","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Tourne′","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Whipping","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Manipulation","Zesting","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); break; // button btnx23 Dry Rubs and stuffing case "btnx23": data.add(new CopListdata("Dry Rub","**** Dry Rubs ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Asian \n 9Ginger Root, Garlic, Crushed Red Pepper, Five Spice Powder, Coriander","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Aztec \n 9Cocoa Powder, Cumin, Chili Powder, Dehydrated Onion, Garlic, Cayenne Pepper, Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","BBQ \n 9Paprika, Chili Powder, Salt, Black Pepper, Sugar, MSG, Cayenne Pepper, Celery Seed","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Cajun \n 9Cayenne Pepper, Black Pepper, White Pepper, Jalapeno Pepper, Filé Powder, Salt, Sugar, Paprika, Chili Powder, Brown Sugar, Garlic, Dehydrated Onion, Celery Seed","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Creole \n 9Cayenne Pepper, Jalapeno Pepper, Filé Powder, Salt, Brown Sugar, Dehydrated Onion, Garlic, Celery Seed, Black Pepper, Fennel Seed","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Creole-alt \n 9Thyme, Paprika, Black Pepper, Garlic, Onion, Cayenne, White Pepper, Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Dried Fruit Rub \n 9Dried Cherries, Applies, Cranberries, Sugar, Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Dried Vegetable Rub \n 9Sun Dried Tomatoes, Garlic, Onion, Carrot, Celery, Mushrooms, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Fab Four \n 9Salt, Pepper, MSG, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Garlic \n 9Granulated Garlic, Salt, Pepper, MSG, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Herb \n 9Basil, Parsley, Oregano, Tarragon, Salt, Black Pepper, Parmesan, Rosemary, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Jamaican Jerk \n 9All Spice, Cinnamon, Nutmeg, Chives, Thyme, Dehydrated Onion, Salt, Black Pepper, Cayenne Pepper, Brown Sugar, Paprika, Cloves, Parsley","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Mesquite \n 9Paprika, Mesquite Seasoning, Black Pepper, Salt, Brown Sugar, Garlic, Cumin Seed","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Mustard \n 9Mustard Powder, Sugar, Salt, Coriander, Nutmeg, Dill, Turmeric","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Peppercorn \n 9Pink Peppercorn, Green, White, Black and Red, Salt, Sugar, Thyme, Sage","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Rock Crystals \n 9Dehydrated Sweet and, or Savory Stocks that Yield Crystals after Dehydration","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Salt","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Dry Rub","Salt and Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Spicy Mustard \n 9Mustard Powder, Cayenne, Black Pepper, Chili Powder, Alum, Cracked Mustard Seed, Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Spicy Rub \n 9Chili Powder, Cumin, Garlic, Oregano, Cayenne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","West Indies \n 9Curry, Turmeric, Cardamom, Nutmeg, Cinnamon, Cumin, Salt, Black Pepper, White Pepper, Cayenne Pepper, Coriander, Ginger, Achiote","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Dry Rub","Wild Mushroom Rub \n 9Shiitake, Enoki, Moral, Chanterelles and Button Flours, Salt and Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","*** Stuffings ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Berry Stuffing \n 9Bread Cubes, Strawberries, Blackberries, Gooseberries, Raspberries, Eggs, Cream, Salt, Pepper, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Breads \n 9Brioche, Croissant, Multigrain, Baguette","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Corn Bread Stuffing \n 9Corn Bread, Butter, Onions, Carrots, Celery, Eggs, Garlic, Stock, Salt, Pepper, Sugar, Hot Sauce, Thyme, Sage, Parsley","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Dried Flowers","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Dried Fruits","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Dried Vegetables","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Fresh Flowers","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Fresh Fruits","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Fresh Vegetables","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Mousselines \n 9Caviar, King Salmon, Oyster","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Mousses \n 9Salmon, Shellfish, Pork Fillet","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Mushroom Stuffing \n 9Mushroom Duxelle, White Wine, Bread Crumbs, Eggs, Stock, Salt, Pepper, Sugar, Thyme, Sage, Parsley","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Oyster Stuffing \n 9Smoked Oysters, Sashimi Tuna, Bread Cubes, Oyster Sauce, Soy Sauce, Rice Wine, Eggs, Red Chili Paste, Ginger","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Stuffings","Sweet Breads \n 9Pumpkin, Banana, Blueberry","0","0","0","0",R.drawable.mic_done_black_24dp)); break; // button btnx24 Herb and spice pastes case "btnx24": data.add(new CopListdata("Spice Pastes","*** Spice Pastes *** ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Achiote/Annatto Seed Paste \n 9Annatto Seed Paste, Olive Oil, Cumin, Chili Powder, Cayenne Pepper, Salt, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Bases ","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spice Pastes","Basil Pesto \n 9Olive Oil, Basil, Garlic, Parmesan, Pine Nuts, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","BBQ \n 9Tomato Catsup, Red Wine Vinegar, Brown Sugar, Paprika, Chili Powder, Cumin, Black Pepper, Hot Sauce, Liquid Smoke, Salt, Worcestershire Sauce","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Cilantro Pesto \n 9Cilantro, Toasted Pecans, Garlic, Walnut Oil, Sesame Oil, Salt, Pepper, and Asiago","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Green Curry Paste \n 9Green Chilies, Purple Shallots, Garlic, Cilantro, Lemon Grass, Galangal, Coriander, Cumin, Peppercorns, Turmeric, Shrimp Paste and Oil","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Gremolata \n 9Parsley, Lemon Peel, Black Pepper and Garlic","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Herb and Oil \n 9Basil, Rosemary, Oregano, Chives, Olive Oil, Walnut Oil, Salt, Pepper, Cayenne Pepper, Garlic","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Htipiti \n 9Feta Cheese and Oregano Paste","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Korean Soybean Pastes Hot and Sweet \n 9Fermented Pulverized Soy Beans, Sugar, Salt, Monosodium Glutamate, Red Chile, Soy Sauce","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Massaman Curry Paste \n 9Chilies, Oil, Onion, Garlic, Shrimp Paste, Lemon Grass, Galangal, Coriander, Cumin, Fennel, Cinnamon, Cardamom, Nutmeg, and Cloves named after India’s Muslims","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Melitzanosalata \n 9Puree of Eggplant, Garlic, Lemon and Olive Oil","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Red Curry Paste \n 9Red Chilies, Purple Shallots, Garlic, Lemon Grass, Galangal, Kaffir Lime Rind and Leaves Oil, Shrimp Pasted, Coriander, Seeds, Cumin, Peppercorns, Paprika, and Turmeric","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Sage Pesto \n 9Sage, Toasted Walnuts, Walnut Oil, Garlic, Olive Oil, Red Wine, Salt, Pepper and Romano Cheese","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Savory Paste \n 9Worcestershire Sauce, Salt, Pepper, Paprika, Oyster Sauce, Chili Powder, Sugar, Thyme, Dried Onion, Garlic, Cayenne Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Shichimi \n 9Japanese Chili Spice Blend","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Sweet Paste \n 9Honey, Olive Oil, Basil, Cumin, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Tandoori \n 9Annatto Paste, Yogurt, Chili Powder, Cayenne, Paprika, Garlic, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Taramasalata \n 9Fish Roe Spread","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Tzatziki \n 9Greek Sauce Puree of Cucumber, Yogurt, Garlic and Dill","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spice Pastes","Yellow Curry Paste \n 9Chilies, Coriander Seeds, Caraway Seeds, Cinnamon, Cloves, Red Onion, Garlic, Lemon Grass, Salt, Curry and Dry Mustard","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","*** Herbs *** ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Agustache/Korean Mint/Anise Hyssop","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Angelica","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Basil","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Bay Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Bergamot","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Catnip","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Celery","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Chervil","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Chives","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Cilantro","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Cilantro/Coriander","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Cilantro/Shado Beni","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Citronella","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Claytonia/Purslane","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Coriander","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Curry Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Dill","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Fennel","","0","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Fenugreek","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Garlic Chives","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Geranium","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Horseradish","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Houttuynia Asian Cilantro","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Hyssop","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Kaffir Lime Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Ku Chai Chinese Chives","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Lavender","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Lemon Grass","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Lemon Thyme","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Lemon Verbena","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Lovage","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Marigold","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Marjoram","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Micromeria","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Mint","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Mugwort","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Myrtle","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Oregano","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Pandan/Screwpine/South Pacific Grass","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Parsley","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Peppermint","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Perilla/Chinese Mint-Basil","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Rice Paddy Herb","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Rosemary","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Sage","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Salad Burnet","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Sassafras","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Sassafrass Leaf File Powder","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Savory","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Sorrel","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Spearmint","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Sweet Cicely","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Tarragon","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Thyme","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Herbs","Wasabi","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Herbs","Woodruff","0","0","0","0",R.drawable.mic_done_black_24dp)); break; // button btnx25 Marinades and Brines ***missing some of other marinades case "btnx25": data.add(new CopListdata("Broths","*** Broths ***","0","","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","Beef Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","Chicken Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","Fish Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","Red Wine Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","Saffron Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Broths","White Wine Broth ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas"," *** Salsas ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Berry Kiwi Salsa \n 9Kiwi Puree, Strawberries, Black Berries, Blueberries, Raspberries, Parsley, Scallion,","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Creole Salsa \n 9Tomato Salsa, Celery, Onion, Green Pepper, Cilantro Hot Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Cucumber Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Green Chile Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Mango Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Onion Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Pineapple Salsa \n 9Pineapple, Mango, Red Onion, Garlic, Lime Juice, Sugar, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Tomatillo Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Tomato Salsa ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salsas","Tropical Fruit Salsa \n 9Guava, Mango, Papaya, Passion, Red Pepper Puree, Scallions, Olive Oil, Cilantro, Lime","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vinaigrettes","*** Vinaigrettes ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vinaigrettes","Vinaigrette \n 9Olive Oil, Balsamic Vinegar, Salt, Pepper, \n Sugar, Oregano","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Marinades","*** Other Marinades ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Almond ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Asian \n 9Fish Sauce Soy Sauce, Oyster Sauce, Teriyaki, Ginger, Garlic, Leek, Rice","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Banana Sauce \n 9Puree of Bananas, Red Chilies, Corn Syrup, Vinegar, Salt and Black Peppe","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Beer ","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Marinades","Black Bean \n 9Black Beans, Corn, Red Onion, Garlic, Tomatoes, Bacon, Cayenne, Black Pe","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Canola ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Caribbean \n 9Papaya, Mango, Passion Fruit Juices, Chives, Cayenne, Allspice, Cinnamon","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Coconut ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Four Onion \n 9Olive Oil, Red Onions, Yellow Onions, Scallions, Leeks, Honey Dijon Dres","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Four Onion Marmalade \n 9Olive Oil, Red Onion, Yellow Onion, Scallions, Leeks, Honey, Dijon Musta","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Fruit Infused ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Golden Gate \n 9Mayonnaise, Country Mustard, Chives, Orange Rind, Rosemary, Red Wine, Bl","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Grape Seed ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Herb \n 9Olive Oil, Red Wine Vinegar, Balsamic Vinegar, Basil, Oregano, Fennel Se","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Herb Infused ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Hickory Smoke \n 9Oil, Vinegar, Smoke Flavor, Salt, Pepper, Brown Sugar, Celery Seed, Garl","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Honey Mustard \n 9Honey, Dijon Mustard, Nutmeg, Curry, Mayonnaise","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Italian \n 9Olive Oil, Oregano, Basil, Red Wine Vinegar, Salt, Black Pepper, Red Pep","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Lard ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Lemon Garlic \n 9Olive Oil, Lemon Juice Oregano, Garlic, Cumin, Black Pepper, Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Oils and Infused Oils","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Marinades","Palm Kernel ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Peanut ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Pesto Cream Dressing \n 9Mayonnaise, Minced Garlic, Parsley Basil, Parmesan, Buttermilk, Cracked","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Rape Seed ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Red Pepper \n 9Roasted Red Pepper Puree, Olive Oil, Red Onion Honey, Salt, Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Red Pepper, Garlic \n 9Mayonnaise, Roasted Red Pepper Puree, Lemon Juice, Minced Garlic, Cayenn","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Red Wine \n 9Red Wine, Red Wine Vinegar, Dijon Mustard, Sugar, Salt, Pepper","","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Safflower ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Sesame ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Seviche \n 9Lemon Juice, Lime Juice, White Wine, Salt, Pepper, Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Smoky White Bean \n 9Cooked White Beans, Red Onion, Lemon Vinaigrette, Bacon Bits, Parsley","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Soy \n 9Soy Sauce, Cayenne, Sesame Oil, Ginger, Garlic, Leek","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Sunflower ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Sweet Chile \n 9Corn Syrup, Pineapple Juice, Raspberry Vinegar, Crushed Red Pepper, Onio","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Tallow ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Teriyaki \n 9Soy Sauce, Honey, Ginger, Garlic","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Tex-Mex \n 9Chili Oil, Ketchup, Red Wine Vinegar, Cilantro, Crushed Red Pepper, Blac","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Vegetable ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Vegetable Infused ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Walnut ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Marinades","Wine \n 9White Wine, Red Wine, Oyster Sauce, Worcestershire, Hot Sauce, Sugar","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","*** Sauces ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Apricot and Ginger Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Asparagus and Cheddar Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Béchamel/White Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Bitter Sweet Chocolate Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Caramel Scotch Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Demi-Glace Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Espagnole/Brown Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Hollandaise Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Sorrel Mushroom Cream Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Strawberry Rhubarb Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Three Mushroom Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Tomato Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Veloute Sauce ","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","*** Brines ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","Exotic Brine \n 9Himalayan Salt, Filtered Water, Vermont Maple Syrup","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","French Brine \n 9Fleur de Sel, Avian Water, Herb des Provence, Alpine Honey","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","Polynesian Brine \n 9Ginger, Soy Sauce, Cane Sugar, Fijian Spring Water, Black Kona Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","South of the Border Brine \n 9Agave Syrup, Poblano Chili Puree, Cerveza, Sea Salt","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","Thai Brine \n 9Lemongrass Water, Fish Sauce, Lime Juice, Rock Sugar, Ginger, Garlic}","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","Traditional Brine \n 9Water, Salt, and possibly Sugar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Brines","Vegetarian Brine \n 9Vegetable Juice/V8, Kosher Salt, Fruit Juice, Honey, Soy Sauce","0","0","0","0",R.drawable.mic_done_black_24dp)); break; // button btn26 Spices and Spice Crusts case "btnx26": data.add(new CopListdata("Spices","*** Spices ***","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Akudjua/Australian Bush Tomato","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Allspice","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Amchoor/Indian Mango Evergreen Fruit","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Anise","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Annatto","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Aromatic Leaves","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Asafetida/Middle Eastern Fennel","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Barberry","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Capers","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Caraway","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cardamom","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cassia","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cayenne","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Celery Seed","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Chiles","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Chili Powder","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Cinnamon","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Citrus","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cloves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Coriander","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Coriander Seeds","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cubeb/Java Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Cumin","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Curry Leaves","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Dill Seeds","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Fennel Seeds","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Fenugreek","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Galangal","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Ginger","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Grains of Paradise/Guinea Pepper/Melegueta/Alligator Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Horseradish","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Indonesian Kencur","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Juniper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Kaffir Lime","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Kokam/Indian Evergreen Fruit","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Lemon Grass","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Lemon Myrtle","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Licorice","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Mace","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Mahlab/Middle East Sour Cherry Stones","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Mastic/Greek Evergreen Resin","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Middle East Za’atar","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Mountain Pepper/Australian Black Pepper","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Mustard","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Nigella","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Nutmeg","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Paprika Spanish, Hungarian","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Pepper","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Poppy","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Rose","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Safflower","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Saffron","0","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Spices","Salt","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Star Anise","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Surgar","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Sumac","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Tamarind","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Turmeric","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Vanilla","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Wattle/Acacia/Australian","0","0","0","0",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Spices","Zeodary","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); break; // button btnx31 Cooking Techniques case "btnx31": data.add(new CopListdata("Cooking Technique","Baked","0","0","0","0", R.drawable .mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Beurre Manie","0","0","0","0", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Boiled","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Braised","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Caramelize","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Carbonyl Amine Browning (Protein Browning)","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Cold Smoked","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Cooking Technique","Deep Fried","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Dry Saute","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Emulsification","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","En Papillote","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Fricasseed","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Microwaved","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Pan Fried","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Pan Seared","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Pan Smoked","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Pan Stewed","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Pan Toast","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Plank Broiled","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Plank Smoked","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Poached ","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Roasted","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Salt Block Roasted","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Saute","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Shallow Poacched","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Simmer","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Slurry","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Smoke Roasted","","","","", R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Cooking Technique","Sous Vide","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Steamed","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Stewed","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Suspension","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Sweat","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Toasting","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Water Bath Baking","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Wok Fry","","","","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Cooking Technique","Wood Plank Roasted","","","","", R.drawable.mic_done_black_24dp)); break; // button btnx41 Salads Relishes case "btnx41": data.add(new CopListdata("Salads","*** Salads ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Asian Pear","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Blood Orange Mozzarella","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Bread and Fruit","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Cabbage/Cole Slaw","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Cesar","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Champagne Baby Green","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Chicken Mango","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Chickpea","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Creole Green Bean","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Dilled Egg","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Egg","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Fruit","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Gelatin and Whipped Cream","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Gelatin/Aspic","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Grain","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Greek Cucumber","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Kim Chee","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Leafy Greens","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Salads","Meat","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Meat/Protein","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Olive","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Pasta","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Salads","Potatoes","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Salads","Prosciutto Melon","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Seared Tuna","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Southwest Cobb","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Spicy Carrot","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Spinach","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Squash Orzo","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Three Bean","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Tomato","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Tomato Mint","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Tomato-Peach","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Tuna","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Salads","Vegetables","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Salads","Watercress Fruit","0","0","0","", R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes","*** Relishes ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes"," Baba Ghanoush","0","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes"," Jardiniere","0","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes"," Pesto","0","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes"," Pickle","0","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Relishes"," Salsa","0","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Relishes"," Tapenade","0","","","",R.drawable.mic_done_black_24dp)); break; // button btnx42 Starches and Grains case "btnx42": data.add(new CopListdata("Starches Grains","*** Starches Grains ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Arrowroot","0","228","0","57",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Asian Style Noodles","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Bao Buns","0","160","2","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Barley Pot, Pearl","0","208","0","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bean Products","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Beans","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Bran","0","125","2","37",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bread","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Buckwheat","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Bulgar","0","210","1","40",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Buns","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Corn","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Corn Bread","0","188","6","29",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Cornstarch","0","244","0","58",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Couscous","0","200","1","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Farina","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","File’","0","192","5","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Flatbread","0","192","5","41",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Flour","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Garden Peas","0","210","0.5","19",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Germ","0","207","5","28",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Lentils","0","210","0.5","19",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Matzo Ball","0","96","3","12",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Millet","0","228","2","44",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Modified Food Starch","0","0","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oat Bran","0","154","4","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oatmeal","0","204","4","38",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Oats","0","204","4","38",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Pasta","7","200","1","41",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Potatoes","0","58.1","0.1","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Quinoa","0","222","3.5","39",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Rice","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Starches Grains","Rice Paper","0","228","0","50",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Rye","0","202","1.5","42",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Semolina","0","200","1","41",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Sorghum","0","202","2","44",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Tapioca","0","2226","0","54",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Wheat Whole Cracked","0","208","2","26",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Starches Grains","Yams/Kumara","0","57","0","13",R.drawable.mic_done_black_24dp)); break; // button btnx43 "Garnishes" - Garnishes case "btnx43": data.add(new CopListdata("Garnishes","Brunoise","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Capers","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Cheese","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Chiffonade","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Cornichon","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Croquettes","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Croutes","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Croutons","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Duxelles","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Fried Starch Skins/Won Ton Skins/Wraps","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Fritters","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Fruit Coulis","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Fruit Oil Emulsion","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Gelatin/Aspic","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Gremolata","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Herb Oil Emulsion","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Herbs","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Julienne","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Matiganon","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Mirepoix","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Pasta","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Pickles","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Pico de Gallo","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Potatoes","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Profiterolles","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Quenelles","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Royale","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Salpicon","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Sauces","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Threaded Eggs","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Tuilles","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Garnishes","Vegetable Coulis","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Garnishes","Vegetable Oil Emulsion","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); break; // button btnx44 "Sauces Salsa" - Sauces/Salsas case "btnx44": data.add(new CopListdata("Sauces","*** Sauces ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Alfredo","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Andalouse","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Asian","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Au Po′ivre","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Aurora Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Barbecue","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Basil","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Béchamel","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Beer Reduction","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Beer","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Bercy Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Beurre Blanc","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Beurre Rouge","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Bolognese","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Bonito Broth","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Chimichurri","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Chocolate","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Classic Tomate/Tomato","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Cream Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Demi Glace","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Espagnole","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Fish Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Fonds","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Fruit Coulis","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Fruit Oil Emulsion","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Gastrique","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Espagnole","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Gravy","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Harissa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Herb","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Herb Seafood Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Hollandaise","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Hot Sauce","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Hungarian Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Italian","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Jus Lié","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Kale","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Ketchup/Catsup/Tomato Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Liquor Reduction","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Mayonnaise","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Mignonette","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Miso Broth","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Mushroom Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Mustard","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Normandy Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Oyster Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Peanut","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Peanut Butter","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Pesto","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Poulette Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Rémoulade","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Rouille","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Seafood Fumet","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Shrimp Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Soy Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Spinach","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Supréme","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Teriyaki","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Tomato","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Vegetables Coulis","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Veg Oil Emulsion","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Velouté","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Vinaigrette \n 9Olive Oil, Balsamic Vinegar, Salt, Pepper,Sugar,Oregano","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Vinegar Reduction","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Vinegar","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","Whipped, Compound, and Emulsified Butter","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Wine","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Wine Reduction","0","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Sauces","*** Salsas ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Berry Kiwi Salsa \n 9Pineapple, Mango, Red Onion, Garlic, Lime Juice, Sugar, Salt, Pepper","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Creole Salsa \n 9Tomato Salsa, Celery, Onion, Green Pepper, Cilantro Hot Sauce","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Cucumber Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Green Chile Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Mango Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Onion Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Pineapple Salsa \n 9Pineapple, Mango, Red Onion, Garlic, Lime Juice, Sugar, Salt, Pepper","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Tomatillo Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Tomato Salsa","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Sauces","Tropical Fruit Salsa \n 9Guava, Mango, Papaya, Passion, Red Pepper, Scallions, Olive Oil, Cilantro, Lime Juice, Crushed Red Pepper, Black Pepper, Salt","0","0","0","",R.drawable.mic_done_black_24dp)); break; // button btnx45 "Vegetables Fruits case "btnx45": data.add(new CopListdata("Vegetables","*** Vegetables ***","","","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Artichoke","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Asparagus","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Avocados","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Bean Sprouts","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beans-Edible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beans-Inedible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Beet","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Bell Pepper","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Breadfruit","1","120","0","29",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Broccoli","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Brussel Sprouts","3","40","0","7",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Cabbage","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Carrot","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Cauliflower","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Celeriac/Celery Root","2","48","0","10",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Celery Green, Giant Pascal","2","16","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Chard Swiss, Multicolored","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Chili Peppers Fresh And Dry \n 9Listed In Order of Scoville Units","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Collard Greens","2","28","0","5",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Corn","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Cucumber","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Dandelion","3","48","1","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Dried Beans/Peas/Lentils/Flageolet","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Edamame","9","124","0","23",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Eggplant","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Escarole","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Fennel","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Garlic","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Kale","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Kohlrabi","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Leafy Greens","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Leek/Baby Leek","1","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Legume and Seed Shoots","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Lettuce","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Lotus Root","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Microgreens","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Mushrooms","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","New Mexican 6-4 Heritage","","1786","","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Okra Red/Green","2","36","0","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Onion","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Oyster Plant","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Parsnip","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Peas-Edible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Peas-Inedible","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Radicchio","0","6","0","2",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Radishes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Roots and Tubers","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Salsify Black/White","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Sea Vegetables","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Shallot","1","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Shoots and Stems","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Sorrel","2","24","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Spinach","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Summer Squash","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Sweet Potatoes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Tomatillo","0","44","0","8",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Tomato","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Truffles","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Turnip","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Vegetables","Water Chestnut","0","18","0","4",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Vegetables","Winter Squash","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","*** Fruits ***","0","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Apples","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Apricots","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Banana","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Berries","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Cherimoya","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Cherries","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Currants","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Dates","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Dragon Fruit","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Feijoa","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Figs","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Grapefruit","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Grapes","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Guava","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Kiwi","","0","0","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Kumquat","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Lemons","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Limes","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Lychee","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Mango","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Mangostene","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Medlar","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Melons","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Minneola","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Murcott","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Nectarines","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Olives","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Oranges","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Papayas","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Passion Fruit","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Peaches","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Pears","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Persimmon","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Physallis/Cape Gooseberry","1","52","0","12",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Pineapple","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Plums","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Pomegranate","1","108","0","25",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Pomelo","","0","0","",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Prickly Pear","","0","0","0",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Quince","0","64","0","14",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Rhubarb","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); data.add(new CopListdata("Fruits","Sapodilla/Mexican Pear","1","64","0","16",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Star Fruit/Carambola","1","41","0","9",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Tamarillo/New Zealand","3","42","1","5",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Tangerine/Mandarin","1","48","0","11",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Ugly/Spanish Citrus","1","40","0","9",R.drawable.mic_done_black_24dp)); data.add(new CopListdata("Fruits","Watermelon","","","","",R.drawable.ic_keyboard_arrow_right_black_24dp)); break; } return data; } }
[ "jim.neuer@gmail.com" ]
jim.neuer@gmail.com
495d006e52cdc52d1461a19d2d6e15fcce550f2c
1f0f2a86a9d2a772f8ac01e34f751aba787f6240
/src/main/java/com/jbgroup/tuogubao/util/ContactJSONMapper.java
4ba2b654f3a24f339a78c27e15a3d4b16dd8e329
[]
no_license
MosaicFeifei/Tuogubao
fb138ff79004747a90703f3e3e06b66858625f05
5f4fbc9adbb05ff6380303f1df423a37a5a3d704
refs/heads/master
2022-12-14T07:41:37.366754
2020-09-08T19:34:23
2020-09-08T19:34:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,140
java
package com.jbgroup.tuogubao.util; import com.jbgroup.tuogubao.model.Contact; import com.jbgroup.tuogubao.model.ContactInfo; import com.jbgroup.tuogubao.model.Message; import org.json.JSONArray; import org.json.JSONObject; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import static com.jbgroup.tuogubao.util.StringUtil.getSetter; public class ContactJSONMapper implements IJSONMapper<Contact, Contact.Builder> { private String jsonStr; private Contact result; public ContactJSONMapper(String jsonStr) { this.jsonStr = jsonStr; } @Override public Contact parse() { if(jsonStr == null) throw new IllegalArgumentException("no json string detected"); JSONObject jsonObject = new JSONObject(jsonStr); this.result = analyzeJSON(jsonObject); return this.result; } private Contact analyzeJSON(JSONObject jsonObject) { Contact.Builder builder = new Contact.Builder(); String[] pbfields = new Contact().pbFields; for(String field: pbfields) { if(jsonObject.has(field)) { String setterName = getSetter(field); Method setterMethod = null; try { setterMethod = Contact.Builder.class.getMethod(setterName, String.class); setterMethod.invoke(builder, jsonObject.get(field)); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } // customized fields if(jsonObject.has("contactInfos")) { JSONArray infos = (JSONArray) jsonObject.get("contactInfos"); Iterator iterator = infos.iterator(); List<ContactInfo> contactInfos = new ArrayList(); while(iterator.hasNext()) { JSONMapper<ContactInfo, ContactInfo> cimapper = new JSONMapper<>(ContactInfo.class, iterator.next().toString()); ContactInfo ci = cimapper.parse(); contactInfos.add(ci); } builder.setContactInfos(contactInfos); } if(jsonObject.has("messages")) { JSONArray ms = (JSONArray) jsonObject.get("messages"); Iterator iterator = ms.iterator(); List<Message> messages = new ArrayList(); while(iterator.hasNext()) { JSONMapper<Message, Message> mmapper = new JSONMapper<>(Message.class, iterator.next().toString()); Message m = mmapper.parse(); messages.add(m); } builder.setMessages(messages); } return builder.build(); } @Override public void setJsonStr(String jsonStr) { this.jsonStr = jsonStr; } }
[ "biatbang@163.com" ]
biatbang@163.com
edfeccd62e5eb71cdce6116f85d3239f86fc7d17
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/31/31_fa13482fa4c8ed6c3ce864305d740b0080668b93/UserManager/31_fa13482fa4c8ed6c3ce864305d740b0080668b93_UserManager_s.java
8ff1b76ff24985ea00e8488ddce7636fe82f7a11
[]
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
499
java
package com.exadel.borsch.managers; import com.exadel.borsch.dao.User; import java.util.List; import java.util.UUID; /** * @author Andrey Zhilka */ public interface UserManager { User getUserById(UUID userId); User getUserByName(String name); void deleteUserById(UUID userId); void updateUser(User toUpdate); User getUserByHash(String hashId); void deleteUserByHash(String hashId); void addUsers(List<User> toAdd); List<User> getAllUsers(); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
52fe4a101b75c5ac545b15cad85a08643791abb2
11e5de9206d5c1ad3f21dab959dbc8944ce152cd
/app/src/main/java/course/labs/todomanager/ToDoManagerActivity.java
1b321a258b5ddffb085d79eb366a27d5c1117e45
[]
no_license
lvncnt/ToDoManager
5dfdf5b8c5739e56e7ee184a7b407e451618fb42
efe65da0a9a4ec78c687307d5f9c7332abb6efaf
refs/heads/master
2016-09-05T11:51:06.492838
2015-05-01T00:05:29
2015-05-01T00:05:29
34,882,269
0
0
null
null
null
null
UTF-8
Java
false
false
5,803
java
package course.labs.todomanager; import android.app.ListActivity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.text.ParseException; import java.util.Date; import java.util.HashMap; import java.util.List; public class ToDoManagerActivity extends ListActivity { private ToDoListAdapter toDoListAdapter; private final static int ADD_TODO_ITEM_REQUEST = 0; private final static String TAG = "Lab-UserInterface"; private static final String FILE_NAME = "TodoManagerActivityData.txt"; // IDs for menu items private static final int MENU_DELETE = Menu.FIRST; private static final int MENU_DUMP = Menu.FIRST + 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create a new TodoListAdapter for ToDoManagerActivity's ListView toDoListAdapter = new ToDoListAdapter(getApplicationContext()); // Put divider between ToDoItems and FooterView getListView().setFooterDividersEnabled(true); TextView footerView = (TextView) getLayoutInflater().inflate(R.layout.footer_view, null); ListView listView = getListView(); listView.addFooterView(footerView); footerView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(ToDoManagerActivity.this, AddToDoActivity.class); startActivityForResult(intent, ADD_TODO_ITEM_REQUEST); } }); // Attach the adapter to this ListActivity's ListView getListView().setAdapter(toDoListAdapter); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // Check result code and request code if(resultCode == RESULT_OK && requestCode == ADD_TODO_ITEM_REQUEST){ Bundle bundle = data.getExtras(); ToDoItem toDoItem = new ToDoItem(data); toDoListAdapter.add(toDoItem); } } @Override public void onResume() { super.onResume(); if (toDoListAdapter.getCount() == 0) loadItems(); } @Override protected void onPause() { super.onPause(); saveItems(); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, MENU_DELETE, Menu.NONE, "Delete all"); menu.add(Menu.NONE, MENU_DUMP, Menu.NONE, "Dump to log"); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_DELETE: toDoListAdapter.clear(); return true; case MENU_DUMP: dump(); return true; default: return super.onOptionsItemSelected(item); } } private void dump() { for (int i = 0; i < toDoListAdapter.getCount(); i++) { String data = ((ToDoItem) toDoListAdapter.getItem(i)).toLog(); Log.i(TAG, "Item " + i + ": " + data.replace(ToDoItem.ITEM_SEP, ",")); } } // Load stored ToDoItems private void loadItems() { BufferedReader reader = null; try { FileInputStream fis = openFileInput(FILE_NAME); reader = new BufferedReader(new InputStreamReader(fis)); String title = null; String priority = null; String status = null; Date date = null; while (null != (title = reader.readLine())) { priority = reader.readLine(); status = reader.readLine(); date = ToDoItem.FORMAT.parse(reader.readLine()); toDoListAdapter.add(new ToDoItem(title, ToDoItem.Priority.valueOf(priority), ToDoItem.Status.valueOf(status), date)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } finally { if (null != reader) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } } } // Save ToDoItems to file private void saveItems() { PrintWriter writer = null; try { FileOutputStream fos = openFileOutput(FILE_NAME, MODE_PRIVATE); writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter( fos))); for (int idx = 0; idx < toDoListAdapter.getCount(); idx++) { writer.println(toDoListAdapter.getItem(idx)); } } catch (IOException e) { e.printStackTrace(); } finally { if (null != writer) { writer.close(); } } } }
[ "fengxliu@gmail.com" ]
fengxliu@gmail.com
b95f8070202acd1d9d58434a8416582f8712cdc5
e319f31e0d0afe2d1f675ae8d61aae7c7d451d59
/SmokeHoot/app/src/main/java/net/br/smokehoot/Adapter.java
185d5dea1644a6c483991ae5174833481bbfd97f
[]
no_license
gabrielmarcolino/GitProjeto
9e8b6e0354cb288461ad5edcb9331b4d53ecfc75
3740ee3b64c910b7103496d8a10a7590cc433bfb
refs/heads/master
2020-05-19T16:14:43.580575
2019-05-09T14:23:56
2019-05-09T14:23:56
185,102,204
0
0
null
null
null
null
UTF-8
Java
false
false
1,318
java
package net.br.smokehoot; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import java.util.List; public class Adapter extends RecyclerView.Adapter<Adapter.myViewHolder> { Context mContext; List<item> mData; public Adapter(Context mContext, List<item> mData) { this.mContext = mContext; this.mData = mData; } @Override public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(mContext); View v = inflater.inflate(R.layout.content_activity_galeria,parent, false); return new myViewHolder(v); } @Override public void onBindViewHolder(myViewHolder holder, int position) { holder.background_img.setImageResource(mData.get(position).getBackground()); } @Override public int getItemCount() { return mData.size(); } public class myViewHolder extends RecyclerView.ViewHolder { ImageView background_img; public myViewHolder(View itemView) { super(itemView); background_img = itemView.findViewById(R.id.card_background); } } }
[ "gabriel.amarcolino@senacsp.edu.br" ]
gabriel.amarcolino@senacsp.edu.br
3b63ae6f9496d730b0a216f61b836f7adb3292aa
1c5e8605c1a4821bc2a759da670add762d0a94a2
/src/dahua/fdc/basedata/StandardIndexEnum.java
48e5fe986382544f533bf4ab47140e080281fcf4
[]
no_license
shxr/NJG
8195cfebfbda1e000c30081399c5fbafc61bb7be
1b60a4a7458da48991de4c2d04407c26ccf2f277
refs/heads/master
2020-12-24T06:51:18.392426
2016-04-25T03:09:27
2016-04-25T03:09:27
19,804,797
0
3
null
null
null
null
UTF-8
Java
false
false
2,708
java
/** * output package name */ package com.kingdee.eas.fdc.basedata; import java.util.Map; import java.util.List; import java.util.Iterator; import com.kingdee.util.enums.StringEnum; /** * output class name */ public class StandardIndexEnum extends StringEnum { public static final String MAN_VALUE = "0MAN"; public static final String BUILDAREA_VALUE = "1BUILDAREA"; public static final String SELLAREA_VALUE = "2SELLAREA"; public static final String CONTAINAREA_VALUE = "3CONTAINAREA"; public static final String CUBAGERATE_VALUE = "4CUBAGERATE"; public static final String PRODUCTRATE_VALUE = "5PRODUCTRATE"; public static final String UNITAREA_VALUE = "6UNITAREA"; public static final String UNITS_VALUE = "7UNITS"; public static final String DOORS_VALUE = "8DOORS"; public static final StandardIndexEnum MAN = new StandardIndexEnum("MAN", MAN_VALUE); public static final StandardIndexEnum BUILDAREA = new StandardIndexEnum("BUILDAREA", BUILDAREA_VALUE); public static final StandardIndexEnum SELLAREA = new StandardIndexEnum("SELLAREA", SELLAREA_VALUE); public static final StandardIndexEnum CONTAINAREA = new StandardIndexEnum("CONTAINAREA", CONTAINAREA_VALUE); public static final StandardIndexEnum CUBAGERATE = new StandardIndexEnum("CUBAGERATE", CUBAGERATE_VALUE); public static final StandardIndexEnum PRODUCTRATE = new StandardIndexEnum("PRODUCTRATE", PRODUCTRATE_VALUE); public static final StandardIndexEnum UNITAREA = new StandardIndexEnum("UNITAREA", UNITAREA_VALUE); public static final StandardIndexEnum UNITS = new StandardIndexEnum("UNITS", UNITS_VALUE); public static final StandardIndexEnum DOORS = new StandardIndexEnum("DOORS", DOORS_VALUE); /** * construct function * @param String standardIndexEnum */ private StandardIndexEnum(String name, String standardIndexEnum) { super(name, standardIndexEnum); } /** * getEnum function * @param String arguments */ public static StandardIndexEnum getEnum(String standardIndexEnum) { return (StandardIndexEnum)getEnum(StandardIndexEnum.class, standardIndexEnum); } /** * getEnumMap function */ public static Map getEnumMap() { return getEnumMap(StandardIndexEnum.class); } /** * getEnumList function */ public static List getEnumList() { return getEnumList(StandardIndexEnum.class); } /** * getIterator function */ public static Iterator iterator() { return iterator(StandardIndexEnum.class); } }
[ "shxr_code@126.com" ]
shxr_code@126.com
17dc1b3aa8594c3af5ee3b092cce75bc0c1845bb
5b48102999354594c06abfb69ac46eec0d5d5348
/3ANO/ExerciciosEstrutura/src/exer/b3/n8/Main.java
56575453515320fead5b5bde81a40e627e9e5b38
[]
no_license
lucassabreu/UNIVILLE
45601635eadcb4933233b33c113a408fae280130
e23595f739fb7dfd49b779a5cc80b91531135c4c
refs/heads/master
2021-01-17T08:07:52.824732
2016-10-08T14:04:06
2016-10-08T14:04:06
8,988,471
2
1
null
null
null
null
UTF-8
Java
false
false
1,987
java
package exer.b3.n8; import exer.b3.n8.queue.Queue; import exer.b3.n8.queue.linked.SLinkedQueue; public class Main { public static void main(String[] args) { testQueue(new SLinkedQueue<Integer>()); } public static void testQueue(Queue<Integer> queue) { System.out.println("\nSequencia do slide: \n"); System.out.printf("Operação | Saída | frente <- Q <- fim\n"); queue.enqueue(5); System.out.printf("queue.enqueue(5) | %5s | %s \n", "", queue); queue.enqueue(3); System.out.printf("queue.enqueue(3) | %5s | %s \n", "", queue); System.out.printf("queue.dequeue() | %5d | %s \n", queue.dequeue(), queue); queue.enqueue(7); System.out.printf("queue.enqueue(7) | %5s | %s \n", "", queue); queue.enqueue(9); System.out.printf("queue.enqueue(9) | %5s | %s \n", "", queue); System.out.printf("queue.dequeue() | %5d | %s \n", queue.dequeue(), queue); queue.enqueue(4); System.out.printf("queue.enqueue(4) | %5s | %s \n", "", queue); queue.enqueue(2); System.out.printf("queue.enqueue(2) | %5s | %s \n", "", queue); System.out.printf("queue.dequeue() | %5d | %s \n", queue.dequeue(), queue); queue.enqueue(1); System.out.printf("queue.enqueue(1) | %5s | %s \n", "", queue); queue.enqueue(8); System.out.printf("queue.enqueue(8) | %5s | %s \n", "", queue); System.out.printf("queue.dequeue() | %5d | %s \n", queue.dequeue(), queue); queue.enqueue(3); System.out.printf("queue.enqueue(3) | %5s | %s \n", "", queue); try { queue.enqueue(6); System.out.printf("queue.enqueue(6) | %5s | %s \n", "", queue); } catch (Exception e) { System.out.printf("queue.enqueue(6) | %5s | %s \n", "error", queue); } System.out.printf("queue.dequeue() | %5d | %s \n", queue.dequeue(), queue); } }
[ "lucas.s.abreu@gmail.com" ]
lucas.s.abreu@gmail.com
81d250bbe4001a8d7f46b140d0616ed913bc6db8
273b98cae7bff30a1efa761d5f9a7c1169ef2aa8
/hystrix-dashboard/src/main/java/com/example/hystrixdashboard/HystrixDashboardApplication.java
205755f71b36cc90c3baf511fe8c5fb41fa0a737
[]
no_license
973203075/spring-cloud-test
715d2a8cc393b94fdd54c30bff35132b0931011c
15bd7712d637ab33304dda2241cb1558f3a08195
refs/heads/master
2020-04-09T21:29:22.665354
2018-12-06T02:07:15
2018-12-06T02:07:15
160,603,730
0
0
null
null
null
null
UTF-8
Java
false
false
522
java
package com.example.hystrixdashboard; import org.springframework.boot.SpringApplication; import org.springframework.cloud.client.SpringCloudApplication; import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; import org.springframework.cloud.netflix.turbine.EnableTurbine; @EnableHystrixDashboard @EnableTurbine @SpringCloudApplication public class HystrixDashboardApplication { public static void main(String[] args) { SpringApplication.run(HystrixDashboardApplication.class, args); } }
[ "Tiankuokuo@icibei.com" ]
Tiankuokuo@icibei.com
61b7238b186f02f539c42391ec52e455195be561
b12ae319a3b715fd7236874b86929022e4000e5e
/kodilla-testing2/src/main/java/com/kodilla/testing2/google/GoogleTestingApp.java
c2557f65b694112f666fa3e9a6669b56ef962a3d
[]
no_license
Norbert2711/Norbert-Obarzanek-Kodilla-java-plus-2019-09
5e69a1cf5e88b7838c21d9bd6c777588a5203cca
324c2cc22cf353edcd5bbdf3fa63feca3e0bbed5
refs/heads/master
2020-08-30T05:32:25.748302
2020-05-19T17:43:41
2020-05-19T17:43:41
218,277,657
1
0
null
null
null
null
UTF-8
Java
false
false
608
java
package com.kodilla.testing2.google; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import com.kodilla.testing2.config.WebDriverConfig; public class GoogleTestingApp { // public static final String SEARCHFIELD = "lst-ib"; public static void main(String[] args) { WebDriver driver = WebDriverConfig.getDriver(WebDriverConfig.FIREFOX); driver.get("https://www.google.com"); WebElement searchField = driver.findElement(By.name("q")); searchField.sendKeys("Kodilla"); searchField.submit(); } }
[ "norbertu2711@gmail.com" ]
norbertu2711@gmail.com
200817877f628badf678a3ed9328b406ddf2e3ab
a4d25182713cee1bfa40c6f03d9567a836c4f949
/src/main/java/frc/robot/subsystems/ControlPanel.java
705aaeb5a9b6e31fdbca2207b1449ac5d3dbb7b5
[]
no_license
Team2530/RobotCode2020
d9c8652fed439df4553b1b04de323554f450948d
334f92c8bacd370d6d7bf45d672ce1ef15e01ea6
refs/heads/master
2020-12-05T18:46:14.418648
2020-03-14T16:42:18
2020-03-14T16:42:18
232,212,710
1
0
null
null
null
null
UTF-8
Java
false
false
2,270
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; import com.revrobotics.ColorMatch; import com.revrobotics.ColorMatchResult; import com.revrobotics.ColorSensorV3; import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.util.Color; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class ControlPanel extends SubsystemBase { /** * Creates a new ControlPanel. */ private final ColorSensorV3 colorSensor = new ColorSensorV3(I2C.Port.kOnboard); private final Color kBlueTarget = ColorMatch.makeColor(0.143, 0.427, 0.429); private final Color kGreenTarget = ColorMatch.makeColor(0.197, 0.561, 0.240); private final Color kRedTarget = ColorMatch.makeColor(0.561, 0.232, 0.114); private final Color kYellowTarget = ColorMatch.makeColor(0.361, 0.524, 0.113); private final ColorMatch m_colorMatcher = new ColorMatch(); private String color; public ControlPanel() { m_colorMatcher.addColorMatch(kBlueTarget); m_colorMatcher.addColorMatch(kGreenTarget); m_colorMatcher.addColorMatch(kRedTarget); m_colorMatcher.addColorMatch(kYellowTarget); } @Override public void periodic() { // This method will be called once per scheduler run Color detectedColor = colorSensor.getColor(); ColorMatchResult match = m_colorMatcher.matchClosestColor(detectedColor); if (match.color == kBlueTarget) { color = "Blue"; } else if (match.color == kRedTarget) { color = "Red"; } else if (match.color == kGreenTarget) { color = "Green"; } else if (match.color == kYellowTarget) { color = "Yellow"; } else { color = "Unknown"; } } public String getColor() { return color; } }
[ "spencerrsivertson@gmail.com" ]
spencerrsivertson@gmail.com
e20de0d9733fe94e0749389b9b10f400b4d0687e
930c207e245c320b108e9699bbbb036260a36d6a
/BRICK-Jackson-JsonLd/generatedCode/src/main/java/brickschema/org/schema/_1_0_2/Brick/ICWS_Chilled_Water_Pump_Differential_Pressure_Integration_Time_Setpoint.java
7a00274def9f7452c3660dbecee88d8b9bce9ea8
[]
no_license
InnovationSE/BRICK-Generated-By-OLGA
24d278f543471e1ce622f5f45d9e305790181fff
7874dfa450a8a2b6a6f9927c0f91f9c7d2abd4d2
refs/heads/master
2021-07-01T14:13:11.302860
2017-09-21T12:44:17
2017-09-21T12:44:17
104,251,784
1
0
null
null
null
null
UTF-8
Java
false
false
1,439
java
/** * This file is automatically generated by OLGA * @author OLGA * @version 1.0 */ package brickschema.org.schema._1_0_2.Brick; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldId; import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldProperty; import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldType; import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldLink; import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldPropertyType; import brick.jsonld.util.RefId; import brickschema.org.schema._1_0_2.Brick.IChilled_Water_Pump_Differential_Pressure_Integration_Time_Setpoint; import brickschema.org.schema._1_0_2.Brick.IDifferential_Pressure_Integral_Time_Setpoint; import brickschema.org.schema._1_0_2.Brick.ICWS_Chilled_Water_Differential_Pressure_Setpoint; public interface ICWS_Chilled_Water_Pump_Differential_Pressure_Integration_Time_Setpoint extends IChilled_Water_Pump_Differential_Pressure_Integration_Time_Setpoint, IDifferential_Pressure_Integral_Time_Setpoint, ICWS_Chilled_Water_Differential_Pressure_Setpoint { /** * @return RefId */ @JsonIgnore public RefId getRefId(); }
[ "Andre.Ponnouradjane@non.schneider-electric.com" ]
Andre.Ponnouradjane@non.schneider-electric.com
e3aa57c21b805896708ce4ee5f2669ec2401c859
79643928fc321df6d718c0e84947b5d3171843c4
/AndroidExampleForTheGroup/app/src/main/java/com/example/user/myapplication/DetailActivity.java
3e87a6f2103b09380809df81e9c6e746372f8795
[]
no_license
ysh212/Hong
8c23833082fdf7e0a089dbb2c80fb7c59208e019
aebf53261af0752f247eff80153d6379010c4e44
refs/heads/master
2021-05-08T04:39:44.596209
2017-10-26T02:30:08
2017-10-26T02:30:08
108,351,461
0
0
null
null
null
null
UTF-8
Java
false
false
4,274
java
package com.example.user.myapplication; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import com.example.user.myapplication.domain.Tourist; import com.example.user.myapplication.domain.TouristInfo; import com.example.user.myapplication.presenter.DetailPresenter; import com.example.user.myapplication.presenter.IDetailPresenter; import com.example.user.myapplication.view.IDetailView; import com.skp.Tmap.TMapData; import com.skp.Tmap.TMapPoint; import com.skp.Tmap.TMapPolyLine; import com.skp.Tmap.TMapView; import org.xml.sax.SAXException; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; /** * Created by USER on 2017-10-16. */ public class DetailActivity extends AppCompatActivity implements IDetailView{ private Button checkBtn, cancelBtn; TextView detailContents, tv; Spinner spinner; TMapView tMapView; Tourist tourist = new Tourist(); private IDetailPresenter detailPresenter; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); //확인 버튼 checkBtn = (Button) findViewById(R.id.checkBtn); //취소 버튼 cancelBtn = (Button) findViewById(R.id.cancelBtn); //ListItem 목록에서 선택된 항목에 대한 상세정보를 출력 detailContents = (TextView) findViewById(R.id.detailContents); tv = (TextView) findViewById(R.id.textView5); //자동차를 타고 갈지, 도보로 갈지 정함 spinner = (Spinner) findViewById(R.id.spinner); final String [] trans ={"자가용", "도보"}; //drop 박스 형태로 관공서들을 보여주기 ArrayAdapter<String> adapter; adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, trans); spinner.setAdapter(adapter); tMapView = (TMapView) findViewById(R.id.tMap); detailPresenter = new DetailPresenter(this); detailPresenter.loadMap(tMapView); detailPresenter.getInfo(); /* tMapPoint1 = new TMapPoint(35.5025595, 126.8423617); tMapPoint2 = new TMapPoint(35.509, 126.8423617); //자동차 경로 요청- 매개변수(이동수단, 출발지 좌표, 도착지좌표, 탐색옵션(교통최적 + 추천(기본값))) try { tMapPolyLine = tMapData.findPathDataWithType(TMapData.TMapPathType.CAR_PATH, tMapPoint1, tMapPoint2, null, 0); } catch (IOException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } */ //보행자 경로 요청 //tMapPolyLine = tMapData.findPathDataWithType(TMapData.TMapPathType.PEDESTRIAN_PATH, point1, point2, 0); //확인 버튼 누르면 서버로 데이터 전송 checkBtn.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ } }); //취소 버튼 누르면 이전 페이지로 이동 cancelBtn.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { } }); } @Override public void detailContents() { Intent intent = getIntent(); TouristInfo touristInfo = (TouristInfo)intent.getSerializableExtra("selectedItem"); detailContents.setText("주소: " + touristInfo.getAddress() + ", 거리: " + touristInfo.getDistance() + ", 언어: " + touristInfo.getTourist().getLang()); Log.d("tourist123: ", touristInfo.getTourist().toString()); } @Override public void loadMap() { } @Override public void addTourist() { } @Override public void removeTourist() { } }
[ "burukan212@gmail.com" ]
burukan212@gmail.com
321e9f0f54bc935be5a3ebc1ae31fcf74e5c0768
6845487751780e913e02a7dfd566e38bacedd6f4
/loanmanagement-api/src/main/java/com/rabo/loan/management/repository/UserRepository.java
c6fa9fbde5a2282ef49ecbd750cc8a2b1a49b55f
[]
no_license
chandrajavalab/LoanManagementSystem
f3fae5b97884db7140dc6c40d3118b2dc9c8847f
cc16bd0ec2ff135db7cea01e5c440827a421a8a7
refs/heads/master
2022-11-24T01:40:39.830538
2020-07-28T06:00:52
2020-07-28T06:00:52
278,586,030
0
0
null
null
null
null
UTF-8
Java
false
false
454
java
package com.rabo.loan.management.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.rabo.loan.management.enity.User; @Repository public interface UserRepository extends JpaRepository<User, Integer> { public User findByUserNameAndPassword(String userName, String password); public User findByUserName(String userName); public User findByUserId(int userId); }
[ "ctsjava107@iiht.tech" ]
ctsjava107@iiht.tech
90ce4f88fa8e891b973c26e4a5fef7d6a00e3db8
447520f40e82a060368a0802a391697bc00be96f
/apks/apks_from_phone/data_app_com_monefy_app_lite-2/source/com/dropbox/core/v2/sharing/ListSharedLinksArg.java
c2528c15f7fec7977898b4569d38e3d5624cd1cb
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
6,792
java
package com.dropbox.core.v2.sharing; import com.dropbox.core.stone.StoneSerializer; import com.dropbox.core.stone.StoneSerializers; import com.dropbox.core.stone.StructSerializer; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import java.util.Arrays; import java.util.regex.Pattern; class ListSharedLinksArg { protected final String cursor; protected final Boolean directOnly; protected final String path; public ListSharedLinksArg() { this(null, null, null); } public ListSharedLinksArg(String paramString1, String paramString2, Boolean paramBoolean) { if ((paramString1 != null) && (!Pattern.matches("(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)", paramString1))) { throw new IllegalArgumentException("String 'path' does not match pattern"); } this.path = paramString1; this.cursor = paramString2; this.directOnly = paramBoolean; } public static Builder newBuilder() { return new Builder(); } public boolean equals(Object paramObject) { if (paramObject == this) {} do { return true; if (!paramObject.getClass().equals(getClass())) { break; } paramObject = (ListSharedLinksArg)paramObject; } while (((this.path == paramObject.path) || ((this.path != null) && (this.path.equals(paramObject.path)))) && ((this.cursor == paramObject.cursor) || ((this.cursor != null) && (this.cursor.equals(paramObject.cursor)))) && ((this.directOnly == paramObject.directOnly) || ((this.directOnly != null) && (this.directOnly.equals(paramObject.directOnly))))); return false; return false; } public String getCursor() { return this.cursor; } public Boolean getDirectOnly() { return this.directOnly; } public String getPath() { return this.path; } public int hashCode() { return Arrays.hashCode(new Object[] { this.path, this.cursor, this.directOnly }); } public String toString() { return Serializer.INSTANCE.serialize(this, false); } public String toStringMultiline() { return Serializer.INSTANCE.serialize(this, true); } public static class Builder { protected String cursor = null; protected Boolean directOnly = null; protected String path = null; protected Builder() {} public ListSharedLinksArg build() { return new ListSharedLinksArg(this.path, this.cursor, this.directOnly); } public Builder withCursor(String paramString) { this.cursor = paramString; return this; } public Builder withDirectOnly(Boolean paramBoolean) { this.directOnly = paramBoolean; return this; } public Builder withPath(String paramString) { if ((paramString != null) && (!Pattern.matches("(/(.|[\\r\\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)", paramString))) { throw new IllegalArgumentException("String 'path' does not match pattern"); } this.path = paramString; return this; } } static class Serializer extends StructSerializer<ListSharedLinksArg> { public static final Serializer INSTANCE = new Serializer(); Serializer() {} public ListSharedLinksArg deserialize(JsonParser paramJsonParser, boolean paramBoolean) { Object localObject4 = null; if (!paramBoolean) { expectStartObject(paramJsonParser); } for (Object localObject1 = readTag(paramJsonParser);; localObject1 = null) { if (localObject1 == null) { Object localObject3 = null; Object localObject2 = null; localObject1 = localObject4; if (paramJsonParser.getCurrentToken() == JsonToken.FIELD_NAME) { localObject4 = paramJsonParser.getCurrentName(); paramJsonParser.nextToken(); if ("path".equals(localObject4)) { localObject4 = (String)StoneSerializers.nullable(StoneSerializers.string()).deserialize(paramJsonParser); localObject2 = localObject3; localObject3 = localObject4; } for (;;) { localObject4 = localObject3; localObject3 = localObject2; localObject2 = localObject4; break; if ("cursor".equals(localObject4)) { localObject4 = (String)StoneSerializers.nullable(StoneSerializers.string()).deserialize(paramJsonParser); localObject3 = localObject2; localObject2 = localObject4; } else if ("direct_only".equals(localObject4)) { localObject1 = (Boolean)StoneSerializers.nullable(StoneSerializers.boolean_()).deserialize(paramJsonParser); localObject4 = localObject2; localObject2 = localObject3; localObject3 = localObject4; } else { skipValue(paramJsonParser); localObject4 = localObject2; localObject2 = localObject3; localObject3 = localObject4; } } } localObject1 = new ListSharedLinksArg(localObject2, localObject3, (Boolean)localObject1); if (!paramBoolean) { expectEndObject(paramJsonParser); } return localObject1; } throw new JsonParseException(paramJsonParser, "No subtype found that matches tag: \"" + (String)localObject1 + "\""); } } public void serialize(ListSharedLinksArg paramListSharedLinksArg, JsonGenerator paramJsonGenerator, boolean paramBoolean) { if (!paramBoolean) { paramJsonGenerator.writeStartObject(); } if (paramListSharedLinksArg.path != null) { paramJsonGenerator.writeFieldName("path"); StoneSerializers.nullable(StoneSerializers.string()).serialize(paramListSharedLinksArg.path, paramJsonGenerator); } if (paramListSharedLinksArg.cursor != null) { paramJsonGenerator.writeFieldName("cursor"); StoneSerializers.nullable(StoneSerializers.string()).serialize(paramListSharedLinksArg.cursor, paramJsonGenerator); } if (paramListSharedLinksArg.directOnly != null) { paramJsonGenerator.writeFieldName("direct_only"); StoneSerializers.nullable(StoneSerializers.boolean_()).serialize(paramListSharedLinksArg.directOnly, paramJsonGenerator); } if (!paramBoolean) { paramJsonGenerator.writeEndObject(); } } } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
22851d77d48eccd588c3c7f703fe1822467f15c8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_8eb8eed712bae385ecfe6c81d500cb8a1b6a6a0c/E4Dialog/25_8eb8eed712bae385ecfe6c81d500cb8a1b6a6a0c_E4Dialog_s.java
0e048a1d194841755ae5d48d03e7c6e7aa0f8813
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,170
java
/** * Copyright 2004-2013 Riccardo Solmi. All rights reserved. * This file is part of the Whole Platform. * * The Whole Platform is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The Whole Platform is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the Whole Platform. If not, see <http://www.gnu.org/licenses/>. */ package org.whole.lang.e4.ui.dialogs; import static org.whole.lang.e4.ui.api.IUIConstants.*; import javax.inject.Inject; import javax.inject.Named; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.e4.core.commands.ECommandService; import org.eclipse.e4.core.commands.EHandlerService; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.ui.bindings.EBindingService; import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.services.IServiceConstants; import org.eclipse.e4.ui.workbench.modeling.EModelService; import org.eclipse.e4.ui.workbench.modeling.ESelectionService; import org.eclipse.gef.ContextMenuProvider; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.bindings.keys.KeySequence; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.whole.lang.e4.ui.actions.ActionRegistry; import org.whole.lang.e4.ui.actions.E4KeyHandler; import org.whole.lang.e4.ui.api.IUIProvider; import org.whole.lang.e4.ui.handler.HandlersBehavior; import org.whole.lang.e4.ui.menu.JFaceMenuBuilder; import org.whole.lang.e4.ui.menu.PopupMenuProvider; import org.whole.lang.e4.ui.util.E4Utils; import org.whole.lang.e4.ui.viewers.E4GraphicalViewer; import org.whole.lang.model.IEntity; import org.whole.lang.queries.reflect.QueriesTemplateManager; import org.whole.lang.reflect.ReflectionFactory; /** * @author Enrico Persiani */ @SuppressWarnings("restriction") public class E4Dialog extends Dialog { protected E4GraphicalViewer viewer; protected ActionRegistry actionRegistry; protected IUIProvider<IMenuManager> contextMenuProvider; @Inject public E4Dialog(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) { super(shell); } @Inject IEclipseContext context; @Inject ESelectionService selectionService; @Inject EHandlerService handlerService; @Inject ECommandService commandService; @Inject EModelService modelService; @Inject MApplication application; @Inject EBindingService bindingService; @Override protected Control createDialogArea(Composite parent) { //FIXME workaround due to an eclipse compatibility layer bug // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=386329 // safely delete the following line of code as soon as the compatibility layer is removed context = context.getParent(); selectionService = context.get(ESelectionService.class); handlerService = context.get(EHandlerService.class); bindingService = context.get(EBindingService.class); IEntity entity = QueriesTemplateManager.instance().create("FileArtifact generator"); viewer = new E4GraphicalViewer(parent); viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); viewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { selectionService.setSelection(E4Utils.createSelectionBindings(event)); } }); viewer.getControl().addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent e) { } @Override public void focusGained(FocusEvent e) { context.set(E4GraphicalViewer.class, viewer); } }); viewer.setKeyHandler(new E4KeyHandler()); viewer.setContents(entity); viewer.setInteractive(entity, true, true, true); viewer.flush(); ReflectionFactory.getHistoryManager(entity).setHistoryEnabled(true); context.set(E4GraphicalViewer.class, viewer); actionRegistry = createActionRegistry(); HandlersBehavior.registerHandlers(handlerService); contextMenuProvider = new PopupMenuProvider<IContributionItem, IMenuManager>(new JFaceMenuBuilder(context, actionRegistry)); viewer.setContextMenu(new ContextMenuProvider(viewer) { @Override public void buildContextMenu(IMenuManager menuManager) { contextMenuProvider.populate(menuManager); } }); return parent; } protected ActionRegistry createActionRegistry() { ActionRegistry actionRegistry = new ActionRegistry(context, getShell()); IAction undoAction = actionRegistry.getAction(EDIT_UNDO); ParameterizedCommand command = commandService.createCommand(EDIT_UNDO, null); viewer.getKeyHandler().put((KeySequence) bindingService.getBestSequenceFor(command), true, undoAction); IAction redoAction = actionRegistry.getAction(EDIT_REDO); command = commandService.createCommand(EDIT_REDO, null); viewer.getKeyHandler().put((KeySequence) bindingService.getBestSequenceFor(command), true, redoAction); IAction deleteAction = actionRegistry.getAction(EDIT_DELETE); command = commandService.createCommand(EDIT_DELETE, null); viewer.getKeyHandler().put((KeySequence) bindingService.getBestSequenceFor(command), true, deleteAction); return actionRegistry; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
dba5242473bcdd8d9450da81f92254c94834a6ff
0fbc355624b91c47f9d47a6918c8259605dfcc6c
/SWTKal.SwingGUI/src/swtkal/swing/elements/person/EditAllUser.java
4d4e5b201cfce721f64f23990ced374cd935e35c
[]
no_license
Bierwolf/SWT-DBI-PT
475a3b21640b002adb9f54cca8cb4465d1b79cc7
c4bb63b884924bd43b7305fa6932864e3b5157e2
refs/heads/master
2018-09-10T02:01:15.442600
2018-07-24T17:56:01
2018-07-24T17:56:01
111,411,982
0
1
null
2017-11-22T11:13:58
2017-11-20T13:10:21
Java
ISO-8859-2
Java
false
false
3,346
java
package swtkal.swing.elements.person; // Achtung: Klasse im Wesentlichen unveraendert aus Calendarium uebernommen import java.awt.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; import swtkal.domain.Person; import swtkal.server.Server; import swtkal.swing.ListenerForActions; import swtkal.swing.elements.person.SelectListEntry; //////////////////////////////////////////////////////////////////////////////////////////// // EditAllUser // EditAllUser // EditAllUser // EditAllUser // EditAllUser // EditAllUser // //////////////////////////////////////////////////////////////////////////////////////////// public class EditAllUser extends ListenerForActions implements ListSelectionListener { // graphical Representation private JInternalFrame gui = new JInternalFrame("Benutzer verwalten", true, true, false, true); // Liste zur Personenauswahl private SelectListEntry selectUser; // Buttons private JButton btn[] = new JButton[3]; private Server server; public EditAllUser(Server server) { this.server = server; gui.setSize(370, 300); gui.setPreferredSize(gui.getSize()); gui.getContentPane().setLayout(new BorderLayout()); // InternalFrameListener gui.addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent e) { gui.setVisible(false); } }); selectUser = new SelectListEntry(false, server); selectUser.addListSelectionListener(this); create(); } void create() { Dimension size; JPanel editPane = new JPanel(); editPane.setLayout(new BorderLayout(10, 0)); editPane.setBorder(new EmptyBorder(10, 10, 10, 10)); JPanel buttons = new JPanel(); buttons.setLayout(new BoxLayout(buttons, BoxLayout.Y_AXIS)); btn[0] = new JButton("Benutzer hinzufuegen"); size = btn[0].getMaximumSize(); size.width = 10000; btn[0].setMaximumSize(size); btn[0].setMnemonic('h'); btn[0].setActionCommand("new"); btn[0].addActionListener(this); btn[1] = new JButton("Benutzer löschen"); btn[1].setMaximumSize(size); btn[1].setEnabled(false); btn[1].setMnemonic('l'); btn[1].setActionCommand("delete"); btn[1].addActionListener(this); btn[2] = new JButton("Benutzer bearbeiten"); btn[2].setMaximumSize(size); btn[2].setEnabled(false); btn[2].setMnemonic('b'); btn[2].setActionCommand("edit"); btn[2].addActionListener(this); buttons.add(Box.createVerticalStrut(60)); buttons.add(btn[0]); buttons.add(Box.createVerticalStrut(5)); buttons.add(btn[1]); buttons.add(Box.createVerticalStrut(5)); buttons.add(btn[2]); buttons.add(Box.createVerticalGlue()); editPane.add("Center", selectUser.getGUI()); editPane.add("East", buttons); gui.getContentPane().add("Center", editPane); } JInternalFrame getGUI() { return gui; } Person getSelectedPerson() { return (Person) selectUser.mListBox.getSelectedValue(); } void update() { selectUser.createModel(server); selectUser.mListBox.validate(); } // ListSelectionListener // ListSelectionListener // ListSelectionListener // // ListSelectionListener // public void valueChanged(ListSelectionEvent e) { if (getSelectedPerson() != null) { btn[1].setEnabled(true); btn[2].setEnabled(true); } else { btn[1].setEnabled(false); btn[2].setEnabled(false); } } }
[ "l.bierwolf@web.de" ]
l.bierwolf@web.de
a296d16fcdc299ed49f11e813f8b16bd4e40f169
359de742426f5f4c97dba9fcf41b7620c25fab15
/src/main/java/hello/hellospring_2/repository/MemoryMemberRepository.java
20580583e92c6633bbff5502be3202239e53b283
[]
no_license
sangwookp9591/hello-spring
e623e659117ee41693d5c9657a8640f45e1db58c
ce958a70512a5f183785fc88b92bbbc6e9bbff34
refs/heads/master
2023-02-22T20:05:42.965282
2021-01-19T14:04:53
2021-01-19T14:04:53
328,652,141
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
package hello.hellospring_2.repository; import hello.hellospring_2.domain.Member; import org.springframework.stereotype.Repository; import java.util.*; //@Repository public class MemoryMemberRepository implements MemberRepository{ private static Map<Long,Member> store = new HashMap<>(); private static long sequence = 0L; @Override public Member save(Member member) { member.setId(++sequence); store.put(member.getId(),member); return member; } @Override public Optional<Member> findById(Long id) { return Optional.ofNullable(store.get(id)); } @Override public Optional<Member> findByName(String name) { return store.values() .stream() .filter(member -> member.getName().equals(name)) .findAny(); } @Override public List<Member> findAll() { return new ArrayList<>(store.values()); } public void clearStore() { store.clear(); } }
[ "sangwookp9591@gmail.com" ]
sangwookp9591@gmail.com
7d9a51b942f3a4b19fa2468318e3c84cc77a6523
405522dea72ba340dbf3ad6f1d50aecf5789143f
/nowcode/src/test/java/com/yht/nowcode/linkedlist/TestCopyListWithRandom.java
4bbec884a4fa64b30c7a5f1ed2515896fdbb65e5
[]
no_license
yanghaitao0410/thinkingInJava
963786074ed4a32f7df21e402ba2c1f0b162cb02
b288e98d98247458aad42afe5ae7c694ccd4f2f1
refs/heads/master
2022-06-26T17:10:09.470745
2021-01-12T07:20:29
2021-01-12T07:20:29
128,611,161
0
0
null
2022-06-17T03:12:04
2018-04-08T07:16:28
Java
UTF-8
Java
false
false
2,545
java
package com.yht.nowcode.linkedlist; import org.junit.Before; import org.junit.Test; public class TestCopyListWithRandom { RandomNode head = null; @Before public void before() { RandomNode node = new RandomNode(1); RandomNode node2 = new RandomNode(2); RandomNode node3 = new RandomNode(3); node.next = node2; node2.next = node3; node.random = node3; node2.random = node; head = node; } @Test public void testCopyListWithRandom1() { RandomNode newNode = CopyListWithRandom.copyRandomList1(head); RandomNode curNode = newNode; while(curNode != null) { System.out.print("curNode.nodeNumber : " + curNode.value + " "); System.out.print(curNode.next != null ? "curNode.next.nodeNumber : " + curNode.next.value + " " : "curNode.next.nodeNumber : null "); System.out.print(curNode.random != null ? "curNode.random.nodeNumber : " + curNode.random.value + " " : "curNode.random.nodeNumber : null "); curNode = curNode.next; System.out.println(); } /* 输出结果: curNode.nodeNumber : 1 curNode.next.nodeNumber : 2 curNode.random.nodeNumber : 3 curNode.nodeNumber : 2 curNode.next.nodeNumber : 3 curNode.random.nodeNumber : 1 curNode.nodeNumber : 3 curNode.next.nodeNumber : null curNode.random.nodeNumber : null */ } @Test public void testCopyListWithRandom2() { RandomNode newNode = CopyListWithRandom.copyRandomList2(head); RandomNode curNode = newNode; while(curNode != null) { System.out.print("curNode.nodeNumber : " + curNode.value + " "); System.out.print(curNode.next != null ? "curNode.next.nodeNumber : " + curNode.next.value + " " : "curNode.next.nodeNumber : null "); System.out.print(curNode.random != null ? "curNode.random.nodeNumber : " + curNode.random.value + " " : "curNode.random.nodeNumber : null "); curNode = curNode.next; System.out.println(); } /* 输出结果: curNode.nodeNumber : 1 curNode.next.nodeNumber : 2 curNode.random.nodeNumber : 3 curNode.nodeNumber : 2 curNode.next.nodeNumber : 3 curNode.random.nodeNumber : 1 curNode.nodeNumber : 3 curNode.next.nodeNumber : null curNode.random.nodeNumber : null */ } }
[ "1454385822@qq.com" ]
1454385822@qq.com
0f71336955545becf2ca5ce210a5476af1dce72d
f2322ae4cc02529efe15749b26a0c6833a650511
/src/main/java/com/example/springbootstarter/lesson/Lesson.java
900bff16264a7aa3f8e5ac814fcf6d51bf3822be
[]
no_license
sxh19911230/springboottutorial
69572af203a7741fc6362ea1dcddb9c8f8090403
374a5b4103eeacc73b74229efba56059a6a5ce6b
refs/heads/master
2021-01-20T05:48:04.019165
2017-04-29T20:05:13
2017-04-29T20:05:13
89,807,770
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
package com.example.springbootstarter.lesson; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToOne; import com.example.springbootstarter.course.Course; @Entity public class Lesson { @Id private String id; private String description; @ManyToOne private Course course; public Course getCourse() { return course; } public void setCourse(Course course) { this.course = course; } public Lesson() {} public Lesson(String id, String description, String courseId) { super(); this.id = id; this.description = description; this.course = new Course(courseId, "", "", ""); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "sxh19911230@gmail" ]
sxh19911230@gmail
a8c1c5aa0c1fe626766a017288f2e8714d41429f
787cf48ae397e901833af99156b0107d252b674b
/src/com/jpuyo/deathnote/activities/playerinfo/investigations/InvestigationsListFragment.java
0c4ca0105fd45305d71bac8cc731dbed027ddec7
[]
no_license
jpgpuyo/DeathNote
f39d23afcce73f01339a5401129f142871ca3318
1972eb01ac2a9f1afc59e5b5ee87db7a48369d3c
refs/heads/master
2021-01-10T09:24:23.849657
2015-10-02T01:22:11
2015-10-02T01:22:11
43,529,391
0
0
null
null
null
null
UTF-8
Java
false
false
3,468
java
package com.jpuyo.deathnote.activities.playerinfo.investigations; import java.util.ArrayList; import java.util.List; import android.content.Intent; import android.util.SparseBooleanArray; import android.view.MenuItem; import android.view.View; import android.widget.AbsListView; import android.widget.ListView; import com.jpuyo.deathnote.R; import com.jpuyo.deathnote.activities.playerinfo.BaseSectionFragment; import com.jpuyo.deathnote.activities.playerinfo.investigations.edit.EditInvestigationActivity; import com.jpuyo.deathnote.database.models.Investigation; public class InvestigationsListFragment extends BaseSectionFragment{ InvestigationAdapter investigationAdapter; private final static int REQUEST_EDIT_INVESTIGATION = 0; public static final InvestigationsListFragment newInstance() { InvestigationsListFragment instance = new InvestigationsListFragment(); instance.fragmentLayout = R.layout.player_info_activity_investigations_list_fragment; return instance; } @Override protected void showSectionContent(){ List<Investigation> playerInvestigations = getInvestigationService().getAllInvestigationsFromPlayer(playerId); populateInvestigationsListView(playerInvestigations); } private void populateInvestigationsListView(List<Investigation> playerInvestigations) { investigationAdapter = new InvestigationAdapter(getActivity().getApplicationContext(), R.layout.player_info_activity_investigation_adapter, playerInvestigations); InvestigationChoiceModeListener listener = new InvestigationChoiceModeListener(this, getListView()); setListAdapter(investigationAdapter); getListView().setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE_MODAL); getListView().setMultiChoiceModeListener(listener); } @Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); l.setItemChecked(position, true); } public boolean performActions(MenuItem item) { if (item.getItemId() == R.id.edit_investigation) { editInvestigation(); return true; } else if (item.getItemId() == R.id.delete_investigations) { deleteInvestigations(); return true; } return false; } private void editInvestigation() { ArrayList<Investigation> selectedInvestigations = getSelectedInvestigations(); Investigation investigation = selectedInvestigations.iterator().next(); Long rowId = investigation.getRowId(); Intent intent = new Intent(getActivity(), EditInvestigationActivity.class); intent.putExtra("operation","update"); intent.putExtra("player", playerId); intent.putExtra("rowId", rowId); startActivityForResult(intent,REQUEST_EDIT_INVESTIGATION); } private void deleteInvestigations() { ArrayList<Investigation> selectedInvestigations = getSelectedInvestigations(); getInvestigationService().removeInvestigations(selectedInvestigations); refresh(); } private ArrayList<Investigation> getSelectedInvestigations() { SparseBooleanArray checked=getListView().getCheckedItemPositions(); ArrayList<Investigation> selectedInvestigations = new ArrayList<Investigation>(); for (int i = 0; i < checked.size(); i++) { int position = checked.keyAt(i); if (checked.valueAt(i)){ Investigation investigation=investigationAdapter.getItem(position); selectedInvestigations.add(investigation); } } return selectedInvestigations; } }
[ "jpgpuyo@msn.com" ]
jpgpuyo@msn.com
eb759de696faa74b974813ffca06afc040001213
fd469e66b07464ff17dae9ac989d83f3eb0fae10
/app/src/main/java/com/yoneya1014/datepickerfragment/DatePickFragment.java
f95771c7defd1305ddbbea8bc5a375ddcad695f4
[]
no_license
yoneya1014/DatePickerDialog_On_Android
ff7a66e64bd5262515772606f0b49873c4cf8ab3
e8961f3297e440426d2a4edd95f64c4db0ef5f12
refs/heads/master
2020-05-17T09:28:56.559016
2019-04-26T13:36:36
2019-04-26T13:36:36
183,634,648
0
0
null
null
null
null
UTF-8
Java
false
false
900
java
package com.yoneya1014.datepickerfragment; import android.app.DatePickerDialog; import android.app.Dialog; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.widget.DatePicker; import java.util.Calendar; public class DatePickFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { @Override @NonNull public Dialog onCreateDialog(Bundle savedInstanceState) { Calendar calender = Calendar.getInstance(); int year = calender.get(Calendar.YEAR); int month = calender.get(Calendar.MONTH); int day = calender.get(Calendar.DAY_OF_MONTH); return new DatePickerDialog(getActivity(), (MainActivity) getActivity(), year, month, day); } @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { } }
[ "yoneya1014@gmail.com" ]
yoneya1014@gmail.com
28260d66e21cb569ff2b661c315026c538e6840b
ab53a4610ac4278ee9f73ef5a8bdec7b86b2f615
/Core/src/org/store/carriers/fedex/sr/FedexShipResponse.java
d185c3dea235cf0e294d89a3c2109d3247602a76
[]
no_license
jason19659/osjavacommerce
2ffcd4d42bae706ea4d81215d1adaabb88f0bdec
b632d1a28c76dcc11b1a43c35856ffb14498df72
refs/heads/master
2022-02-14T06:38:56.989735
2019-03-06T15:32:07
2019-03-06T15:32:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,073
java
package org.store.carriers.fedex.sr; import org.apache.commons.codec.binary.Base64; import org.apache.commons.digester.Digester; import org.apache.log4j.Logger; import org.xml.sax.SAXException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; /** * Created by IntelliJ IDEA. * User: Rogelio Caballero Justo * Date: 20-nov-2006 */ public class FedexShipResponse { public static Logger log = Logger.getLogger(FedexShipResponse.class); private String errorCode; private String errorDescription; private String trackingNumber; private String trackingFormId; private Double baseCharge; private Double totalDiscount; private Double totalSurcharge; private Double netCharge; private Double totalRebate; private String outboundLabel; public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorDescription() { return errorDescription; } public void setErrorDescription(String errorDescription) { this.errorDescription = errorDescription; } public String getTrackingNumber() { return trackingNumber; } public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; } public String getTrackingFormId() { return trackingFormId; } public void setTrackingFormId(String trackingFormId) { this.trackingFormId = trackingFormId; } public Double getBaseCharge() { return baseCharge; } public void setBaseCharge(Double baseCharge) { this.baseCharge = baseCharge; } public Double getTotalDiscount() { return totalDiscount; } public void setTotalDiscount(Double totalDiscount) { this.totalDiscount = totalDiscount; } public Double getTotalSurcharge() { return totalSurcharge; } public void setTotalSurcharge(Double totalSurcharge) { this.totalSurcharge = totalSurcharge; } public Double getNetCharge() { return netCharge; } public void setNetCharge(Double netCharge) { this.netCharge = netCharge; } public Double getTotalRebate() { return totalRebate; } public void setTotalRebate(Double totalRebate) { this.totalRebate = totalRebate; } public String getOutboundLabel() { return outboundLabel; } public void setOutboundLabel(String outboundLabel) { this.outboundLabel = outboundLabel; } public FedexShipResponse(InputStream stream) throws IOException, SAXException { /* FileWriter fw = new FileWriter("d:\\fedex_ship.txt"); InputStreamReader isr = new InputStreamReader(stream); BufferedReader br = new BufferedReader(isr); String line=null; while ( (line = br.readLine()) != null) { fw.write(line); } fw.close(); br.close(); isr.close(); */ Digester digester = new Digester(); digester.push(this); digester.addCallMethod("FDXShipReply/Tracking", "addTracking", 2); digester.addCallParam("FDXShipReply/Tracking/TrackingNumber", 0); digester.addCallParam("FDXShipReply/Tracking/FormID", 1); digester.addCallMethod("FDXShipReply/EstimatedCharges/DiscountedCharges", "addDiscountedCharges", 5); digester.addCallParam("FDXShipReply/EstimatedCharges/DiscountedCharges/BaseCharge", 0); digester.addCallParam("FDXShipReply/EstimatedCharges/DiscountedCharges/TotalDiscount", 1); digester.addCallParam("FDXShipReply/EstimatedCharges/DiscountedCharges/TotalSurcharge", 2); digester.addCallParam("FDXShipReply/EstimatedCharges/DiscountedCharges/NetCharge", 3); digester.addCallParam("FDXShipReply/EstimatedCharges/DiscountedCharges/TotalRebate", 4); digester.addCallMethod("FDXShipReply/Labels", "addLabel", 1); digester.addCallParam("FDXShipReply/Labels/OutboundLabel", 0); digester.addCallMethod("FDXShipReply/Error", "addError", 2); digester.addCallParam("FDXShipReply/Error/Code", 0); digester.addCallParam("FDXShipReply/Error/Message", 1); digester.addCallMethod("Error", "addError", 2); digester.addCallParam("Error/Code", 0); digester.addCallParam("Error/Message", 1); digester.parse(stream); } public void addTracking(String trackNumber, String formId) { trackingNumber = trackNumber; trackingFormId = formId; } public void addDiscountedCharges(String bc, String td, String ts, String nc, String tr) { baseCharge = strToDouble(bc); totalDiscount = strToDouble(td); totalSurcharge = strToDouble(ts); netCharge = strToDouble(nc); totalRebate = strToDouble(tr); } public void addLabel(String img) { outboundLabel = img; } public void addError(String code, String desc) { setErrorCode(code); setErrorDescription(desc); } public boolean hasError() { return errorCode != null && !"".equals(errorCode); } public boolean saveGraphicImage(String fileName) { try { byte[] encodeBytes = outboundLabel.getBytes(); byte[] decodeBytes = Base64.decodeBase64(encodeBytes); FileOutputStream fos = new FileOutputStream(fileName); fos.write(decodeBytes, 0, decodeBytes.length); fos.close(); return true; } catch (IOException e) { log.error(e.getMessage(), e); } return false; } private Double strToDouble(String cad) { if (cad == null) return null; Double res; try { res = Double.parseDouble(cad); } catch (NumberFormatException nfe) { res = null; } return res; } }
[ "rcjusto@yahoo.com" ]
rcjusto@yahoo.com
8d89f7156888731b23ab366dc494edc6102870a1
6c3490745decd44d3628714d385ebaf3901ade03
/src/main/java/com/example/mp/handler/MyMetaObjectHandler.java
d62b23c99af8491d537f96e3f29bcb2edac587ee
[]
no_license
xiaoailiang/mp
2dc4c0c113f8e05758e1cc410d701a740624d7a3
2b472849ae271512a8f6382a130fc0c08578b6a8
refs/heads/master
2023-01-12T16:21:41.782693
2020-11-17T06:23:50
2020-11-17T06:23:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
package com.example.mp.handler; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; import org.apache.ibatis.reflection.MetaObject; import org.springframework.stereotype.Component; import java.util.Date; @Component public class MyMetaObjectHandler implements MetaObjectHandler { @Override public void insertFill(MetaObject metaObject) { this.setFieldValByName("createTime",new Date(),metaObject); this.setFieldValByName("updateTime",new Date(),metaObject); // this.setFieldValByName("version",new Date(),metaObject); } @Override public void updateFill(MetaObject metaObject) { this.setFieldValByName("updateTime",new Date(),metaObject); } }
[ "louiswangzhiqiang@didiglobal.com" ]
louiswangzhiqiang@didiglobal.com
a01dee312c59dddaf69709e1019f3fc5b964ddde
7a9b2975750bfec4724da5d29d5f008e1f869ebd
/src/exsort/Ex3.java
6e305f856478b31451827245de12c422495cf865
[]
no_license
dblee0128/algorithm
0b44a45eadd96fb2c2174f7331eb1bb46bb8e54d
bc83e4e89c4a3732f7920dff20d546bcc51d1b6a
refs/heads/main
2023-02-12T02:46:59.283529
2021-01-03T18:26:26
2021-01-03T18:26:26
325,043,898
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package exsort; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; // Arrays.sort()를 이용하되, 시간을 단축하기 위해 // BufferedReader, StringBuilder 사용 public class Ex3 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int n = Integer.parseInt(br.readLine()); int[] arr = new int[n]; for(int i = 0; i < n; i++) { arr[i] = Integer.parseInt(br.readLine()); } Arrays.sort(arr); for(int i = 0; i < n; i++) { sb.append(arr[i]).append('\n'); } System.out.println(sb); } }
[ "dblee0128@gmail.com" ]
dblee0128@gmail.com
4293afd3ef7685c550298a7cf1cd8af8ba0073d9
8d22a86d1e4473504b7e50c26d873021dae64bc8
/ArunDemo/src/main/java/com/example/as/Hystrixdashboard.java
8aa4ae6afa45f228f44afd38dbc61b3dec976dec
[]
no_license
arunachalamg/ArunDemo
fee0de81130d9285bed8fb0f95d7d2ac84489681
577ec5d7fd5014294a341abe51f9ba74e91e165d
refs/heads/master
2021-10-01T01:02:14.819968
2017-10-26T20:00:06
2017-10-26T20:00:06
108,455,660
0
0
null
null
null
null
UTF-8
Java
false
false
3,056
java
package com.example.as; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.springframework.stereotype.Service; import com.netflix.hystrix.metric.consumer.HystrixDashboardStream; import com.netflix.hystrix.serial.SerialHystrixDashboardData; import rx.Observable; import rx.Subscriber; import rx.Subscription; import rx.functions.Func1; import rx.schedulers.Schedulers; /** * * @author AXG8965 * */ @Service public class Hystrixdashboard{ private Observable<String> getHystrixProperties() { Observable<String> sampleStreamObj = null; sampleStreamObj = HystrixDashboardStream.getInstance().observe().concatMap(new Func1<HystrixDashboardStream.DashboardData, Observable<String>>() { @Override public Observable<String> call(HystrixDashboardStream.DashboardData dashboardData) { return Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData)); } }); return sampleStreamObj; } /** * get Dash board data. * * @param list */ public void getDashBoardData(List<String> list,int count) throws Exception{ Subscription sampleSubscription = null; final AtomicBoolean moreDataWillBeSent = new AtomicBoolean(true); final AtomicInteger countLoop = new AtomicInteger(0); try { sampleSubscription = getHystrixProperties() .observeOn(Schedulers.io()) .subscribe(new Subscriber<String>() { @Override public void onCompleted() { System.out.println("HystrixSampleSseServlet: ({}) received unexpected OnCompleted from sample stream : "+ getClass().getSimpleName()); moreDataWillBeSent.set(false); } @Override public void onError(Throwable e) { moreDataWillBeSent.set(false); } @Override public void onNext(String sampleDataAsString) { if (sampleDataAsString != null) { try { list.add(sampleDataAsString); } catch (Exception ex) { moreDataWillBeSent.set(false); } } } }); while (moreDataWillBeSent.get()) { try { Thread.sleep(500); if(countLoop.getAndIncrement()>count) { moreDataWillBeSent.set(false); } } catch (Exception ex) { moreDataWillBeSent.set(false); } } }finally { if (sampleSubscription != null && !sampleSubscription.isUnsubscribed()) { sampleSubscription.unsubscribe(); } } } }
[ "arunachalam.gr@gmail.com" ]
arunachalam.gr@gmail.com
04a43f1431f1402a597294393d59208ccf48c09a
15be44cbd74d203d28769413c6feb5d13c76b5cc
/jpa/odata-jpa-test/src/main/java/com/sap/olingo/jpa/processor/core/errormodel/AdministrativeInformation.java
e965295f8e081b68914e2b6d812d1bace1aa2948
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
GustavHeinz/olingo-jpa-processor-v4
8b7fad7c50b9c3e83bce5001be517a07d378f653
7b22c3c68e6368d5739874259e4483c08abcce83
refs/heads/develop
2020-08-05T00:23:26.911526
2019-10-31T10:01:59
2019-10-31T10:03:41
212,330,193
0
1
Apache-2.0
2019-10-11T11:08:20
2019-10-02T12:05:56
Java
UTF-8
Java
false
false
1,452
java
package com.sap.olingo.jpa.processor.core.errormodel; import java.sql.Timestamp; import java.util.Date; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Embedded; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; @Embeddable public class AdministrativeInformation { @Embedded @AttributeOverrides({ @AttributeOverride(name = "by", column = @Column(name = "\"CreatedBy\"")), @AttributeOverride(name = "at", column = @Column(name = "\"CreatedAt\"")) }) private ChangeInformation created; @Embedded @AttributeOverrides({ @AttributeOverride(name = "by", column = @Column(name = "\"UpdatedBy\"")), @AttributeOverride(name = "at", column = @Column(name = "\"UpdatedAt\"")) }) private ChangeInformation updated; public ChangeInformation getCreated() { return created; } public ChangeInformation getUpdated() { return updated; } public void setCreated(ChangeInformation created) { this.created = created; } public void setUpdated(ChangeInformation updated) { this.updated = updated; } @PrePersist void onCreate() { created = new ChangeInformation("99", new Timestamp(new Date().getTime())); } @PreUpdate void onUpdate() { updated = new ChangeInformation("99", new Timestamp(new Date().getTime())); } }
[ "oliver.grande@sap.com" ]
oliver.grande@sap.com
ca8b7a46ae89ff24358b35f7f802a0c7f37eadc2
90aef94756aab2021e013c632afe8b6a5faa8a6f
/LBS-aprovisionamiento/src/main/java/com/btg/claro/LBS/aprovisionamiento/service/impl/MantenimientoBacklist.java
c8007fad8d377ee4b1db68e38074483bbeef2518
[]
no_license
Pattycol/jhonattandeveloper-pruebas
0ff5850d6e24c052f2c731d3691bcfe8b450e01c
2b2582f7a2e636aa7d8ef4b0d3f7969307b156fe
refs/heads/master
2021-01-10T16:03:22.179128
2012-11-20T23:44:08
2012-11-20T23:44:08
45,144,158
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package com.btg.claro.LBS.aprovisionamiento.service.impl; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.btg.claro.LBS.aprovisionamiento.dao.BlacklistDAO; import com.btg.claro.LBS.aprovisionamiento.dao.UsuarioDAO; import com.btg.claro.LBS.aprovisionamiento.service.MantenimientoBlacklistService; import com.btg.claro.LBS.aprovisionamiento.service.ProcesoAuditoriaService; import com.btg.claro.LBS.aprovisionamiento.util.Constantes; import com.btg.claro.LBS.domain.Blacklist; import com.btg.claro.LBS.domain.Usuario; @Service("MantenimientoBlaklistService") public class MantenimientoBacklist implements MantenimientoBlacklistService{ @Autowired private BlacklistDAO blacklistDAO; @Autowired private UsuarioDAO usuarioDAO; @Autowired private ProcesoAuditoriaService auditoriaService; public List<Blacklist> getBlacklists(){ return blacklistDAO.getTodos(); } @Transactional public void guardarBlacklist(Blacklist blacklist,String numero,Usuario usuario){ Usuario bloqueado=usuarioDAO.buscarPorNumero(numero); if(bloqueado!=null){ blacklist.setUsuario(bloqueado); } if(blacklist.getEstado()==null){ blacklist.setEstado(Constantes.ESTADO_INACTIVO); } if(blacklist.getId()==null){ blacklist.setFechaCreacion(new Date()); blacklistDAO.guardar(blacklist); auditoriaService.registrarNuevoObjeto(blacklist,usuario); } else{ Blacklist existente=blacklistDAO.get(blacklist.getId()); auditoriaService.registrarModificacionObjeto(existente,blacklist,usuario); existente.setFechaFin(blacklist.getFechaFin()); existente.setUsuario(existente.getUsuario()); existente.setEstado(blacklist.getEstado()); blacklistDAO.guardar(existente); } } public Blacklist buscarBlacklist(int id){ return blacklistDAO.get(id); } public boolean existeBlacklist(String numero){ return blacklistDAO.buscarBlacklistPorNumero(numero)!=null; } public boolean existeUsuario(String numero){ return usuarioDAO.buscarPorNumero(numero)!=null; } }
[ "JSaldana999@gmail.com" ]
JSaldana999@gmail.com
c8b9dc6d141fba9a94d0bdccf8c652f13e4516c1
629fa50662bd5e2e61802095c9327980048d7758
/src/interfaces/Hashable.java
3dc8dce07274eea855b717383caaa54e42329131
[]
no_license
AlejandroFCasas/JavaGrafo
2a3317eb47805e7e36ea2d6dc8f21ddaafdb990b
62c842582962cf447d67917b10f6c8de9f28dfa5
refs/heads/master
2022-12-24T13:41:16.808568
2020-09-29T10:44:52
2020-09-29T10:44:52
299,585,776
0
0
null
null
null
null
UTF-8
Java
false
false
71
java
package interfaces; public interface Hashable { String hashStr(); }
[ "AlejandroFCasas@gmail.com" ]
AlejandroFCasas@gmail.com
a825a89925aa96504db750a0977b86db8246d643
aa7f4dd0be2a76cffc0c4b51365cb1b24e6dda73
/src/ReverseNumber.java
30f28cde6f69bc707b8efb884ed3feff072138aa
[]
no_license
krishnatvl88/Java
f8afd1c099fd872740ffc7e812b338bdb41a846d
745ee80b460fb454c176af95a2a4b9561248d3c7
refs/heads/master
2021-10-20T02:37:31.956773
2019-02-25T05:38:58
2019-02-25T05:38:58
112,193,268
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
public class ReverseNumber { public long doInvert(long number) { long invert = 0; while (number != 0) { invert = (invert * 10) + (number % 10); number = number / 10; } return invert; } public static void main(String args[]) { long lnum = 544; ReverseNumber input = new ReverseNumber(); System.out.println("Input value : " + lnum); System.out.println("Inverted value : " + input.doInvert(lnum)); } }
[ "kris@doctoralliance.com" ]
kris@doctoralliance.com
526e3fc63a217ecb4b7f4be4ae7aa84420621209
ad262989b358b91aae4abd9c829dc279818d27b8
/src/main/java/com/clc/gpm/dao/common/annotation/PrimaryKey.java
b246ac6cc157c3b246fde6849c18e6913ababa83
[]
no_license
truongdxhaui/gpmHAUI
081980c7e53753749025c9fc0619739308247eeb
7ac1ea1378d621767d6ad160a6b6250e630f0a2c
refs/heads/master
2021-05-05T13:05:37.760201
2018-04-23T21:39:25
2018-04-23T21:39:25
118,315,496
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
package com.clc.gpm.dao.common.annotation; import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * The interface Primary key. */ @Retention(RUNTIME) public @interface PrimaryKey { /** * Name string. * * @return the string */ String name() default "N/A"; }
[ "truonghauiclck9q@gmail.com" ]
truonghauiclck9q@gmail.com
a80dcba9676cbe89d03692af8eb1b12fc5ed0c96
5e1fe8f1145ae2fb5b83d110639a7d90903c92cc
/JAVA/workspace/Chatting_Project/src/chat/client/ClientUi.java
c3724f83c3635ff13d32e173f6aadd80794721c6
[]
no_license
ljs30671/TIL
d1c5e4df18f6c2c55baa7b67ff65a2af76bd1e4b
13b216690a89981aeada6c9f8ec504501f6570a3
refs/heads/master
2023-03-12T17:05:52.933845
2021-03-02T09:54:06
2021-03-02T09:54:06
334,885,727
0
0
null
null
null
null
UTF-8
Java
false
false
4,030
java
package chat.client; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.Socket; import java.net.UnknownHostException; public class ClientUi { TextArea ta; TextField tf; DataOutputStream out; DataInputStream in; String chatId; class ClientThread extends Thread { @Override public void run() { while (true) { try { ta.append(in.readUTF()+"\n");// 채팅 메세지 읽기 } catch (IOException e) { e.printStackTrace(); } } } } public void chatMsg() { // 채팅 메세지 전송 String msg = tf.getText(); try { out.writeUTF(chatId+msg); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } tf.setText(""); } public void onCreate() { Frame f = new Frame("나의 채팅"); Panel p = new Panel(); Button b1 = new Button("채팅"); tf = new TextField(20); ta = new TextArea(); MenuBar mb = new MenuBar(); Menu file_menu = new Menu("파일"); Menu edit_menu = new Menu("편집"); MenuItem open_item = new MenuItem("열기"); MenuItem save_item = new MenuItem("저장"); file_menu.add(open_item); file_menu.add(save_item); mb.add(file_menu); mb.add(edit_menu); f.setMenuBar(mb); save_item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { FileDialog save = new FileDialog(f, "저장 창", FileDialog.SAVE); save.setVisible(true); FileWriter fw = null; try { fw = new FileWriter(save.getDirectory() + save.getFile()); fw.write(ta.getText()); } catch (IOException e) { e.printStackTrace(); } finally { try { if (fw != null) fw.close(); } catch (IOException e) { e.printStackTrace(); } } } }); open_item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent a) { System.out.println("file open?"); FileDialog open = new FileDialog(f, "열기 창", FileDialog.LOAD); open.setVisible(true); FileReader fr = null; BufferedReader br = null; try { fr = new FileReader(open.getDirectory() + open.getFile()); br = new BufferedReader(fr); String oneLine = ""; ta.setText(""); while ((oneLine = br.readLine()) != null) { ta.append(oneLine + "\n"); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try { if (br != null) br.close(); if (fr != null) fr.close(); } catch (IOException e) { } } } }); f.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); b1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // 채팅 서버 연결 chatId = "["+tf.getText()+"]"; ta.setText(chatId + "님이 채팅을 시작합니다\n"); try { Socket s = new Socket("localhost", 9999); out = new DataOutputStream(s.getOutputStream()); in=new DataInputStream(s.getInputStream()); ClientThread t=new ClientThread(); t.start(); ta.append("연결 성공\n"); tf.setText(""); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } }); tf.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { chatMsg(); } }); f.add(ta, BorderLayout.CENTER); f.add(p, BorderLayout.SOUTH); p.add(tf); p.add(b1); p.setBackground(Color.gray); // Color bgColor=new Color(123,24,56); f.setBackground(Color.GREEN); f.setLocation(800, 200); f.setSize(400, 500); f.setVisible(true); } public static void main(String[] args) { ClientUi ui = new ClientUi(); ui.onCreate(); }// end main }// end ClientUi
[ "ljs30671@naver.com" ]
ljs30671@naver.com
b8f408a4242f2355c016b32ab7afc4714ab56f6b
f07754ac1a83b5896bc0227ae781a70b92402317
/thinkinjava/src/main/java/proxy/DemoMethodInterceptor.java
0991ed2299ca4f2bab01ad346165522cb4feb972
[]
no_license
nullbull/Study
285d2076eb39c101fa17a185c35f74f880321894
d90a034847c7ddb7c6ff8dd5ecd64cec4c9b86e7
refs/heads/master
2021-06-05T20:06:50.002976
2020-07-17T15:27:38
2020-07-17T15:27:38
142,563,405
0
0
null
2021-06-04T02:10:40
2018-07-27T10:26:39
Java
UTF-8
Java
false
false
1,090
java
//package test; // //import net.sf.cglib.proxy.Enhancer; //import net.sf.cglib.proxy.MethodInterceptor; //import net.sf.cglib.proxy.MethodProxy; // //import java.lang.reflect.Method; // ///** // * @Auth justinniu // * @Date 2018/8/23 // * @Desc // */ //public class DemoMethodInterceptor implements MethodInterceptor { // public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable { // System.out.println("before "); // Object result = null; // try { // result = proxy.invokeSuper(obj, args); // // } catch (Exception e) { // System.out.println(e.getMessage()); // } finally { // System.out.println("after"); // } // return result; // } // // public static void main(String[] args) { // Enhancer enhancer = new Enhancer(); // enhancer.setSuperclass(RealSubject.class); // enhancer.setCallback(new DemoMethodInterceptor()); // RealSubject realSubject = (RealSubject) enhancer.create(); // realSubject.hello(); // } //}
[ "1129114837@qq.com" ]
1129114837@qq.com
d5bc91e9b78b7177449c6a30735ec8e3f16157c2
9cadf6c1a8aa505b31c33758f546dcb041db6c6a
/src/main/com/hua/observer/DisplayElement.java
1e5224012b79a3df74011a81e4ec12aa10951633
[]
no_license
manhphv/design-pattern
a041989ad119da7bbf7781800033bfabfdbf5441
b7fec84f6da6e3d5ff324334ba746a0b17127b57
refs/heads/master
2021-01-25T14:09:54.399133
2018-03-02T09:40:34
2018-03-02T09:40:34
123,657,340
0
0
null
null
null
null
UTF-8
Java
false
false
129
java
package com.hua.observer; /** * Created by limenghua on 2017/4/18. */ public interface DisplayElement { void display(); }
[ "android.hua@gmail.com" ]
android.hua@gmail.com
b37bb71c5c28c865394ae20567b8ef162b1a1daa
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_59_buggy/mutated/914/Parser.java
b9c5da312e5316dbc5b98d919dfab953331efc9d
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,291
java
package org.jsoup.parser; import org.jsoup.helper.Validate; import org.jsoup.nodes.*; import java.util.LinkedList; /** Parses HTML into a {@link Document}. Generally best to use one of the more convenient parse methods in {@link org.jsoup.Jsoup}. @author Jonathan Hedley, jonathan@hedley.net */ public class Parser { private static final String SQ = "'"; private static final String DQ = "\""; private static final Tag htmlTag = Tag.valueOf("html"); private static final Tag headTag = Tag.valueOf("head"); private static final Tag bodyTag = Tag.valueOf("body"); private static final Tag titleTag = Tag.valueOf("title"); private static final Tag textareaTag = Tag.valueOf("textarea"); private final LinkedList<Element> stack; private final TokenQueue tq; private final Document doc; private String baseUri; private boolean relaxed = false; private Parser(String html, String baseUri, boolean isBodyFragment) { Validate.notNull(html); Validate.notNull(baseUri); stack = new LinkedList<Element>(); tq = new TokenQueue(html); this.baseUri = baseUri; if (isBodyFragment) { doc = Document.createShell(baseUri); stack.add(doc.body()); } else { doc = new Document(baseUri); stack.add(doc); } } /** Parse HTML into a Document. @param html HTML to parse @param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs. @return parsed Document */ public static Document parse(String html, String baseUri) { Parser parser = new Parser(html, baseUri, false); return parser.parse(); } /** Parse a fragment of HTML into the {@code body} of a Document. @param bodyHtml fragment of HTML @param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs. @return Document, with empty head, and HTML parsed into body */ public static Document parseBodyFragment(String bodyHtml, String baseUri) { Parser parser = new Parser(bodyHtml, baseUri, true); return parser.parse(); } /** Parse a fragment of HTML into the {@code body} of a Document, with relaxed parsing enabled. Relaxed, in this context, means that implicit tags are not automatically created when missing. @param bodyHtml fragment of HTML @param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs. @return Document, with empty head, and HTML parsed into body */ public static Document parseBodyFragmentRelaxed(String bodyHtml, String baseUri) { Parser parser = new Parser(bodyHtml, baseUri, true); parser.relaxed = true; return parser.parse(); } private Document parse() { while (!tq.isEmpty()) { if (tq.matchesStartTag()) { parseStartTag(); } else if (tq.matchesCS("</")) { parseEndTag(); } else if (tq.matchesCS("<!--")) { parseComment(); } else if (tq.matches("<![CDATA[")) { parseCdata(); } else if (tq.matchesCS("<?") || tq.matchesCS("<!")) { parseXmlDecl(); } else { parseTextNode(); } } return doc.normalise(); } private void parseComment() { tq.consume("<!--"); String data = tq.chompTo("->"); if (data.endsWith("-")) // i.e. was --> data = data.substring(0, data.length()-1); Comment comment = new Comment(data, baseUri); last().appendChild(comment); } private void parseXmlDecl() { tq.consume("<"); Character firstChar = tq.consume(); // <? or <!, from initial match. boolean procInstr = firstChar.toString().equals("!"); String data = tq.chompTo(">"); XmlDeclaration decl = new XmlDeclaration(data, baseUri, procInstr); last().appendChild(decl); } private void parseEndTag() { tq.consume("</"); String tagName = tq.consumeTagName(); tq.chompTo(">"); if (tagName.length() != 0) { Tag tag = Tag.valueOf(tagName); if (!last().tag().isIgnorableEndTag(tag)) // skips </tr> if in <table> popStackToClose(tag); } } private void parseStartTag() { tq.consume("<"); String tagName = tq.consumeTagName(); Validate.notEmpty(tagName, "Unexpectedly empty tagname. (This should not occur, please report!)"); tq.consumeWhitespace(); Attributes attributes = new Attributes(); while (!tq.matchesAny("<", "/>", ">") && !tq.isEmpty()) { Attribute attribute = parseAttribute(); if (attribute != null) attributes.put(attribute); } Tag tag = Tag.valueOf(tagName); Element child = new Element(tag, baseUri, attributes); boolean isEmptyElement = tag.isEmpty(); // empty element if empty tag (e.g. img) or self-closed el (<div/> if (tq.matchChomp("/>")) { // close empty element or tag isEmptyElement = true; if (!tag.isKnownTag()) // if unknown and a self closed, allow it to be self closed on output. this doesn't force all instances to be empty tag.setSelfClosing(); } else { tq.matchChomp(">"); } addChildToParent(child, isEmptyElement); // pc data only tags (textarea, script): chomp to end tag, add content as text node if (tag.isData()) { String data = tq.chompToIgnoreCase("</" + tagName); tq.chompTo(">"); popStackToClose(tag); Node dataNode; if (tag.equals(titleTag) || tag.equals(textareaTag)) // want to show as text, but not contain inside tags (so not a data tag?) dataNode = TextNode.createFromEncoded(data, baseUri); else dataNode = new DataNode(data, baseUri); // data not encoded but raw (for " in script) child.appendChild(dataNode); } // <base href>: update the base uri if (child.tagName().equals("base")) { String href = child.absUrl("href"); if (href.length() != 0) { // ignore <base target> etc baseUri = href; doc.setBaseUri(href); // set on the doc so doc.createElement(Tag) will get updated base } } } private Attribute parseAttribute() { tq.consumeWhitespace(); String key = tq.consumeAttributeKey(); String value = ""; tq.consumeWhitespace(); if (tq.matchChomp("=")) { tq.consumeWhitespace(); if (tq.matchChomp(SQ)) { value = tq.chompTo(SQ); } else if (tq.matchChomp(DQ)) { value = tq.chompTo(DQ); } else { StringBuilder valueAccum = new StringBuilder(); // no ' or " to look for, so scan to end tag or space (or end of stream) while (!tq.matchesAny("<", "/>", ">") && !tq.matchesWhitespace() && !tq.isEmpty()) { valueAccum.append(tq.consume()); } value = valueAccum.toString(); } tq.consumeWhitespace(); } if (key.length() != 0) return Attribute.createFromEncoded(key, value); else { if (value.length() == 0) // no key, no val; unknown char, keep popping so not get stuck tq.advance(); return null; } } private void parseTextNode() { TextNode textNode; // special case: handle string like "hello < there". first char will be "<", because of matchStartTag if (tq.peek().equals('<')) { tq.advance(); textNode = new TextNode("<", baseUri); } else { String text = tq.consumeTo("<"); doc = new org.jsoup.nodes.Document(baseUri) } last().appendChild(textNode); } private void parseCdata() { tq.consume("<![CDATA["); String rawText = tq.chompTo("]]>"); TextNode textNode = new TextNode(rawText, baseUri); // constructor does not escape last().appendChild(textNode); } private Element addChildToParent(Element child, boolean isEmptyElement) { Element parent = popStackToSuitableContainer(child.tag()); Tag childTag = child.tag(); boolean validAncestor = stackHasValidParent(childTag); if (!validAncestor && !relaxed) { // create implicit parent around this child Tag parentTag = childTag.getImplicitParent(); Element implicit = new Element(parentTag, baseUri); // special case: make sure there's a head before putting in body if (child.tag().equals(bodyTag)) { Element head = new Element(headTag, baseUri); implicit.appendChild(head); } implicit.appendChild(child); // recurse to ensure somewhere to put parent Element root = addChildToParent(implicit, false); if (!isEmptyElement) stack.addLast(child); return root; } parent.appendChild(child); if (!isEmptyElement) stack.addLast(child); return parent; } private boolean stackHasValidParent(Tag childTag) { if (stack.size() == 1 && childTag.equals(htmlTag)) return true; // root is valid for html node if (childTag.requiresSpecificParent()) return stack.getLast().tag().isValidParent(childTag); // otherwise, look up the stack for valid ancestors for (int i = stack.size() -1; i >= 0; i--) { Element el = stack.get(i); Tag parent2 = el.tag(); if (parent2.isValidAncestor(childTag)) { return true; } } return false; } private Element popStackToSuitableContainer(Tag tag) { while (!stack.isEmpty()) { if (last().tag().canContain(tag)) return last(); else stack.removeLast(); } return null; } private Element popStackToClose(Tag tag) { // first check to see if stack contains this tag; if so pop to there, otherwise ignore int counter = 0; Element elToClose = null; for (int i = stack.size() -1; i > 0; i--) { counter++; Element el = stack.get(i); Tag elTag = el.tag(); if (elTag.equals(bodyTag) || elTag.equals(htmlTag)) { // once in body, don't close past body break; } else if (elTag.equals(tag)) { elToClose = el; break; } } if (elToClose != null) { for (int i = 0; i < counter; i++) { stack.removeLast(); } } return elToClose; } private Element last() { return stack.getLast(); } }
[ "justinwm@163.com" ]
justinwm@163.com
9c17e52e390ab52b14d42464bfdcd356cf549099
d5c4ab8567c43e1e77e7822cabf43ca3b0fab64f
/src/main/java/xyz/springabc/web/back/UserAndAdminC.java
932fad304a15ae33f3da862bdba1918631b63346
[ "MIT" ]
permissive
moobsky/spring-abc
6ae8e3f6438c2ac3887db3d8c49a5ce1f7dc6f55
4369367322402fb7dfeb7647d0bcaf66a88cf22a
refs/heads/master
2022-09-12T16:44:45.740999
2022-08-26T10:26:15
2022-08-26T10:26:15
67,147,493
1
1
null
2016-09-01T16:19:08
2016-09-01T16:19:06
null
UTF-8
Java
false
false
3,939
java
package xyz.springabc.web.back; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.Errors; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import xyz.springabc.domin.User; import xyz.springabc.error.ValidateError; import xyz.springabc.repository.UserRepo; import xyz.springabc.service.UploadFileServ; import xyz.springabc.service.UserServ; @Controller @RequestMapping("/back/users") public class UserAndAdminC { @Autowired private UserServ userServ; @Autowired private UploadFileServ uploadFileServ; @RequestMapping("/admin") public String admin(@RequestParam(value="p",defaultValue="1") int p, Model model){ Page<User> userPage=userServ.getByRole(UserServ.ROLE_ADMIIN,p); model.addAttribute("users",userPage.getContent()); model.addAttribute("page",userPage); return "/BACK/users/admin"; } @RequestMapping("/all") public String all(@RequestParam(value="p",defaultValue="1") int p, Model model){ Page<User> userPage=userServ.getAll(p); model.addAttribute("users",userPage.getContent()); model.addAttribute("page",userPage); return "/BACK/users/all"; } @RequestMapping("/search") public String search(@RequestParam(value="p",defaultValue="1") int p, String someThing,Model model){ Page<User> userPage=userServ.getByNickLike(someThing,p); model.addAttribute("users",userPage.getContent()); model.addAttribute("page",userPage); return "/BACK/users/all"; } @RequestMapping("/{id}/edit") public String edit(@PathVariable("id") int id, Model model){ User user=userServ.getByUserId(id); model.addAttribute("user",user); return "/BACK/users/edit"; } @RequestMapping(value="/update",method=RequestMethod.POST) public String updateInfomatio(@Validated User user, Errors errors, MultipartFile file, HttpServletRequest request, Model model){ User oldUser=(User)request.getSession().getAttribute("user"); String avatar=""; if(!file.isEmpty()){//判断有没有上传了头像 try { avatar=uploadFileServ.upload(file).url; avatar=oldUser.getAvatar();//没有上传新头像就用回原来的 } catch (Exception e1) { model.addAttribute("error","头像上传失败"); return "/BACK/users/edit"; } } avatar=oldUser.getAvatar();//没有上传新头像就用回原来的 user.setAvatar(avatar); User newUser = userServ.update(oldUser,user,errors); if(errors.hasErrors()){ model.addAttribute("error",errors.getAllErrors()); return "/BACK/users/edit"; } request.getSession().setAttribute("user", newUser); model.addAttribute("msg","信息已更新"); return "/BACK/users/edit"; } @RequestMapping("/admin/add") public String add(String nick, RedirectAttributes attributes){ User user=userServ.getUserByNickOrEmailOrUsername(nick); if(user==null){ attributes.addFlashAttribute("error","用户不存在"); }else{ userServ.changeRole(user, UserServ.ROLE_ADMIIN); attributes.addFlashAttribute("msg","用户已添加"); } return "redirect:/back/users/admin"; } @RequestMapping("/admin/{id}/remove") public String remove(@PathVariable("id") int id,RedirectAttributes attributes){ User user=userServ.getByUserId(id); userServ.changeRole(user, UserServ.ROLE_MENBER); return "redirect:/back/users/admin"; } }
[ "zh.h@outlook.com" ]
zh.h@outlook.com
20e4c091be46812f9eedf5620f2f2b567ac423cd
81c06074f367fd2eefbeb079257d9f28625b319d
/src/org/pesc/sector/academicrecord/v1_7/EmploymentType.java
ebf08bb6f8593999fec5ed4d115da7c0c5e78796
[]
no_license
rgehbauer/cdsWebserver
f1a461718caff9d1094945c771bd8a223ac3c018
a787d3d369dec70df4c1ff12c8d948a342274864
refs/heads/master
2021-01-18T10:59:42.715030
2014-06-27T23:05:31
2014-06-27T23:05:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,394
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.01.23 at 05:40:47 PM PST // package org.pesc.sector.academicrecord.v1_7; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; /** * <p>Java class for EmploymentType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="EmploymentType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Employer" type="{urn:org:pesc:sector:AcademicRecord:v1.7.0}OrganizationType" minOccurs="0"/> * &lt;element name="EmploymentBeginDate" type="{urn:org:pesc:core:CoreMain:v1.12.0}EmploymentBeginDateType" minOccurs="0"/> * &lt;element name="EmploymentEndDate" type="{urn:org:pesc:core:CoreMain:v1.12.0}EmploymentEndDateType" minOccurs="0"/> * &lt;element name="PositionTitle" type="{urn:org:pesc:core:CoreMain:v1.12.0}PositionTitleType" minOccurs="0"/> * &lt;element name="NoteMessage" type="{urn:org:pesc:core:CoreMain:v1.12.0}NoteMessageType" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EmploymentType", propOrder = { "employer", "employmentBeginDate", "employmentEndDate", "positionTitle", "noteMessage" }) public class EmploymentType { @XmlElement(name = "Employer") protected OrganizationType employer; @XmlElement(name = "EmploymentBeginDate") protected XMLGregorianCalendar employmentBeginDate; @XmlElement(name = "EmploymentEndDate") protected XMLGregorianCalendar employmentEndDate; @XmlElement(name = "PositionTitle") protected String positionTitle; @XmlElement(name = "NoteMessage") protected List<String> noteMessage; /** * Gets the value of the employer property. * * @return * possible object is * {@link OrganizationType } * */ public OrganizationType getEmployer() { return employer; } /** * Sets the value of the employer property. * * @param value * allowed object is * {@link OrganizationType } * */ public void setEmployer(OrganizationType value) { this.employer = value; } /** * Gets the value of the employmentBeginDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getEmploymentBeginDate() { return employmentBeginDate; } /** * Sets the value of the employmentBeginDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setEmploymentBeginDate(XMLGregorianCalendar value) { this.employmentBeginDate = value; } /** * Gets the value of the employmentEndDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getEmploymentEndDate() { return employmentEndDate; } /** * Sets the value of the employmentEndDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setEmploymentEndDate(XMLGregorianCalendar value) { this.employmentEndDate = value; } /** * Gets the value of the positionTitle property. * * @return * possible object is * {@link String } * */ public String getPositionTitle() { return positionTitle; } /** * Sets the value of the positionTitle property. * * @param value * allowed object is * {@link String } * */ public void setPositionTitle(String value) { this.positionTitle = value; } /** * Gets the value of the noteMessage property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the noteMessage property. * * <p> * For example, to add a new item, do as follows: * <pre> * getNoteMessage().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getNoteMessage() { if (noteMessage == null) { noteMessage = new ArrayList<String>(); } return this.noteMessage; } }
[ "jhamidi@bccampus.ca" ]
jhamidi@bccampus.ca
576f29e52c31a6488e27391bb26528c6e97bade0
c538cd9c91c2a873be073aab978f0a547edf2400
/src/Hometask1/TestGenArray.java
39fc1cebde170c249c6e3bcfc6a0c7ef407eb61e
[]
no_license
MaratKhusyainov/Java3_Homework
1c260e8f91670f336e96fc695107e5eea5a80c6c
6790b974df36431d32bf37314b048cbb64870507
refs/heads/master
2023-04-01T15:15:16.822131
2021-04-08T20:48:16
2021-04-08T20:48:16
281,661,664
0
0
null
2020-07-22T11:59:10
2020-07-22T11:42:08
Java
UTF-8
Java
false
false
1,204
java
package Hometask1; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class TestGenArray { public static void main(String[] args) { Integer[] intArr = {1,2,3,4,5}; String[] strArr = {"one", "two", "three"}; System.out.println("First array 'intArr' : " + Arrays.toString(intArr)); System.out.println("Second array 'strArr' : " + Arrays.toString(strArr)); GenArray<Integer> intGenArr = new GenArray<>(); intGenArr.swapElements(intArr,2,5); intGenArr.swapElemWithIndex(intArr,0,2); GenArray<String> stringGenArr = new GenArray<>(); stringGenArr.swapElements(strArr,"one", "two"); System.out.println("'intArr' after swapping some elements: " + Arrays.toString(intArr)); System.out.println("'strArr' after swapping some elements: " + Arrays.toString(strArr)); List<Integer> intArrayList = intGenArr.toArrayList(intArr); System.out.println("ArayList from 'intArr' array: " + intArrayList.toString()); List<String> arrayList = stringGenArr.toArrayList(strArr); System.out.println("ArayList from 'strArr' array: " + arrayList.toString()); } }
[ "khusyainov.mar@yandex.ru" ]
khusyainov.mar@yandex.ru
db4754b4d57347f99d0fe1b777bd3ee2cdccb923
2937e29ae02d953807d924d27fd832a11c7ac6ee
/java-project2-server/src28/main/java/com/eomcs/lms/ServerApp.java
ff65a64c908ac8d96e9b5901e252dd8a457723fe
[]
no_license
jeonjinwook/bitcamp-java-2018-12
ebbcc5732bd42fa3547b74d6591e415aac4c63de
d6bd2e2721bb18ce7be7bdc24f30cdd6f0073dfc
refs/heads/master
2021-08-06T18:46:42.587398
2019-10-23T14:00:25
2019-10-23T14:00:25
163,650,666
0
0
null
2020-04-30T12:44:13
2018-12-31T08:00:39
Java
UTF-8
Java
false
false
10,464
java
// 28단계: Log4J 1.x 적용하기 // => 애플리케이션을 실행하는 중에 내부 상태를 확인할 목적으로 // 기록을 남기는 것을 로깅(logging)이라 한다. // => 로깅은 애플리케이션을 실행하는 콘솔창으로 출력할 수도 있고, // 파일이나 네트웍으로도 출력할 수 있다. // => 보통 실무에서는 파일로 기록을 남긴다. // => 로깅 작업을 도와주는 대표적인 라이브러리가 log4j 이다. // 출력 레벨에 따라 로깅을 조절할 수 있어 편리한다. // // 작업 // 1) log4j 1.x 라이브러리를 추가한다. // => mvnrepository.com 에서 log4j 검색 // => build.gradle 에 라이브러리 추가한다. // => gradle eclipse 실행한다. // => 이클립스 프로젝트 갱신한다. // 2) Log4J 설정 파일 준비한다. // => CLASSPATH 루트 패키지에 log4j.properties 파일을 생성한다. // 예) src/main/resources/log4j.properties // 3) Mybatis에서 사용할 로깅 라이브러리 지정하기 // => SqlSessionFactory 객체를 생성할 때 어떤 로깅 라이브러리를 사용할 지 지정한다. // => MybatisConfig.java 에서 SqlSessionFactory 생성하는 메서드 안에 다음 코드 추가한다. // LogFactory.useLog4JLogging(); // Log4J 설정법 // => CLASSPATh 루트 패키지에 log4j.properties 이름으로 설정 파일을 둔다. // 1) 출력 등급 설정 // => log4j.rootLogger=DEBUG, ... // - rootLogger 에 설정하면 모든 클래스에 대해 적용된다. // => log4j.logger.com.eomcs.lms.service = ERROR // - com.eomcs.lms.service 패키지에 대해서서는 ERROR 레벨을 적용한다. // - 즉 rootLogger 에 기본 출력 등급을 설정하고, // 특정 패키지 전체나 특정 클래스에 대해 등급을 바꿀 때 사용한다. // => 다음과 같이 등급을 조절할 수 있다. // rootLogger = DEBUF // com.eomcs.lms.dao = ERROR // com.eomcs.lms.service = FATAL // com.eomcs.lms.handler = INFO // 따로 지정하지 않으면 rootLogger의 출력 등급을 적용한다. // => 등급 // FATAL : 애플리케이션을 중지할 만큼 치명적인 오류일 경우 ex) DBMS 연결안됨. // ERROR : 계속 애플리케이션을 실행해도 되는 오류일 경우 es) 날짜 형식이 잘못되어 형변환 오류가 발생 // WARN : 잠재적인 위험을 안고 있는 경우. 예) 서버와의 소켓 연결을 close() 하지 못햇을 때, // INFO : 애플리케이션의 주요 실행 정보. 예) 어떤 IP의 클라이언트의 정속 정보 // DEBUG : 애플리케이션의 내부 실행 상태를 추적해 볼 수 있는 정보. // 예) Mybatis가 실행하는 SQL, SQL을 실행할 때 in-parameter에 설정되는 값. // TRACE : 디버그 보다 더 상세한 정보 // 예) IoC 컨테이너가 생성한 객체 목록 // // => 등급에 따른 출력제어 // FATAL > ERROR > WARN > INFO > DEBUG > TRACE // - 지정된 등급 이상의 로그는 모두 출력된다. // - 즉 INFO 등급의 로그만 출력하도록 했으면, // INFO 보다 큰 레벨(WARN, DRROR, FATAL)의 로그도 // // 2) 출력 담당자 지정 // => 어디로 출력한 것인지 지정한다. // => log4j.rootLogger=출력등급, 담당자이름 // log4j.appender.담당자이름=담당자가 출력하기 위해 사용할 도구(패키지명을 포함한 클래스명) // 예) // log4j.rootLogger=DEBUG, A // log4j.appender.A=org.apache.log4j.ConsoleAppender // => 출력도구 // org.apache.log4j.ConsoleAppender : 콘솔 창으로 출력. 즉 System.out/System.err 객체를 사용하여 출력 // org.apache.log4j.Fileappender : 지정한 파일로 출력. // org.apache.log4j.net.SocketAppender : 네트워크의 다른 컴퓨터로 출력 // 3) 출력 형식 지정 // => 출력할 문자열의 형식을 지정할 수 있다. // => log4j.appender.담당자명.layout=출력형식을 다룰 클래스(패키지명을 포함) // 예) log4j.appender.stdout.layout=org.apache.log4j.PatternLayout // => 출력 형식을 다룰 클래스 // - org.apache.log4j.SimpleLayout : 단순 문자열 출력. // - org.apache.log4j.HTMLLayout : HTML 태그로 출력. // - org.apache.log4j.PatternLayout : 설정 파일에 지정된 형식에 맞춰 출력 // - org.apache.log4j.xml.XMLLayout : XML 태그로 출력. // 4) 출력 형식의 패턴 설정하기 // => PatternLayout을 사용하여 출력할 때 설정하는 방법. // => 문법 // %p - 출력 등급. 예) FATAL, ERROR, WARN, INFO, DEBUG, TRACE // %자릿수p - 출력 문자열의 자릿수를 지정할 수 있다. // %t - 스레드 이름. 서버인 경우 동시에 여러 클라이언트가 요청을 한다. // 따라서 클라이언트 요청을 처리하는 스레드가 다를 수 있다. // %m - 로그 메세지. // %n - 줄 바꿈 명령 // %d{yyyy-MM-dd HH:mm:ss} - 년-월-일 시간:분:초 를 출력. // %c - 분류명 출력. 분류명을 따로 지정하지 않으면 클래스명이 사용된다. // %C - 클래스명 출력 // %C{개수} - 클래스명을 포함하여 패키지명 개수 지정할 수 있다. // %M - 로그를 출력하는 메서드명. // // Log4j를 코드에서 사용하기 // 1) 특정 클래스로 로그 남기기 // Logger logger = LogManager.getLogger(클래스 타입); // 2) 특정 분류명으로 로그 남기기 // => 여러 클래스의 로그를 하나로 묶어 표현하고 싶을 때 // Logger logger = LogManager.getLogger("분류명"); // package com.eomcs.lms; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StringWriter; import java.net.ServerSocket; import java.net.Socket; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import com.eomcs.lms.context.RequestMappingHandlerMapping; import com.eomcs.lms.context.RequestMappingHandlerMapping.RequestMappingHandler; import com.eomcs.lms.handler.Response; public class ServerApp { // Command 객체와 그와 관련된 객체를 보관하고 있는 빈 컨테이너 ApplicationContext iocContainer; // 클라이언트 요청을 처리할 메서드 정보가 들어 있는 객체 RequestMappingHandlerMapping handlerMapping; // 보통 클래스에서 사용할 로그 출력 객체는 클래스의 스태틱 멤버로 선언한다. final static Logger logger = LogManager.getLogger(ServerApp.class); public void service() { try (ServerSocket ss = new ServerSocket(8888)) { logger.info("서버 실행 중..."); // Spring IoC 컨테이너 준비 iocContainer = new AnnotationConfigApplicationContext(AppConfig.class); printBeans(); // Spring IoC 컨테이너에서 RequestMappingHandlerMapping 객체를 꺼낸다. // 이 객체에 클라이언트 요청을 처리할 메서드 정보가 들어 있다. handlerMapping = (RequestMappingHandlerMapping) iocContainer.getBean(RequestMappingHandlerMapping.class); while (true) { new RequestHandlerThread(ss.accept()).start(); } // while } catch (Exception e) { e.printStackTrace(); } // try(ServerSocket) } public static void main(String[] args) throws Exception { ServerApp app = new ServerApp(); // App 을 실행한다. app.service(); } // 바깥 클래스(ServerApp)의 인스턴스 필드를 사용해야 한다면 // Inner 클래스(non-static nested class)로 정의하라! // class RequestHandlerThread extends Thread { Socket socket; public RequestHandlerThread(Socket socket) { this.socket = socket; } @Override public void run() { logger.info("클라이언트 연결되었음."); try (Socket socket = this.socket; BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream())); PrintWriter out = new PrintWriter(socket.getOutputStream())) { // 클라이언트의 요청 읽기 String request = in.readLine(); // 클라이언트에게 응답하기 // => 클라이언트 요청을 처리할 메서드를 꺼낸다. RequestMappingHandler requestHandler = handlerMapping.get(request); if (requestHandler == null) { out.println("실행할 수 없는 명령입니다."); out.println("!end!"); out.flush(); return; } try { // 클라이언트 요청을 처리할 메서드를 찾았다면 호출한다. requestHandler.method.invoke( requestHandler.bean, // 메서드를 호출할 때 사용할 인스턴스 new Response(in, out)); // 메서드 파라미터 값 } catch (Exception e) { out.printf("실행 오류! : %s\n", e.getMessage()); e.printStackTrace(); } out.println("!end!"); out.flush(); } catch (Exception e) { logger.error("명령어 실행 중 오류 발생 : " + e.toString()); StringWriter strWriter = new StringWriter(); PrintWriter out = new PrintWriter(strWriter); e.printStackTrace(out); logger.error(strWriter.toString()); } logger.info("클라이언트와 연결 종료."); } } private void printBeans() { // 개발하는 동안 참고할 로그는 보통 debug 등급으로 출력한다. logger.debug("-----------------------------------------------------"); String[] names = iocContainer.getBeanDefinitionNames(); for (String name : names) { logger.debug(String.format("빈 생성 됨 (객체명=%s, ===> 클래스명=%s)", name, iocContainer.getBean(name).getClass().getName())); } logger.debug("-----------------------------------------------------"); } }
[ "sambosoft@naver.com" ]
sambosoft@naver.com
4fb59785375368ff7d0e4b1bce93a6a2ef5dd276
341eec9c387a8bf85051b3c32e814dcc5e2ec0d8
/src/main/java/com/bookings/ticket/service/TicketService.java
9d3bdca0435b502a22aa817a32b800a5a2f02d0c
[]
no_license
varanasiaditya/ticket-service
63b34f7dacaa0f840a6f3689acf2b81782bd26d5
7d8ce309261dfbcea983cfefd36d5793d1a8304e
refs/heads/master
2021-07-20T11:28:56.809051
2017-10-30T04:00:54
2017-10-30T04:00:54
108,796,845
1
0
null
null
null
null
UTF-8
Java
false
false
1,129
java
/* * Java filename TicketServiceImpl.java for service layer interface * * */ package com.bookings.ticket.service; import java.util.UUID; import com.bookings.ticket.model.SeatHold; public interface TicketService { /** * The number of seats in the venue that are neither held nor reserved * * @return the number of tickets available in the venue */ int numSeatsAvailable(); /** * Find and hold the best available seats for a customer * * @param numSeats * the number of seats to find and hold * @param customerEmail * unique identifier for the customer * @return a SeatHold object identifying the specific seats and related * information */ SeatHold findAndHoldSeats(int numSeats, String customerEmail); /** * Commit seats held for a specific customer * * @param seatHoldId * the seat hold identifier * @param customerEmail * the email address of the customer to which the seat hold is * assigned * @return a reservation confirmation code */ String reserveSeats(UUID seatHoldId, String customerEmail); }
[ "varanasiaditya@gmail.com" ]
varanasiaditya@gmail.com
1ee3f704d3e8174c1c4937ab38aa11b5120f83d7
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module878/src/main/java/module878packageJava0/Foo3.java
eda0a45a19e86270c4cae76ea87a0758ae6a53e4
[ "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
387
java
package module878packageJava0; import java.lang.Integer; public class Foo3 { Integer int0; Integer int1; public void foo0() { new module878packageJava0.Foo2().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
f506a85f03002eb4422e8a0d1ae58293446646bc
4e3aaef5f06da7dfe2b0082554d4f433e40fa529
/IntelliJ IDEA 2018.1.5/workplace/funnyswap/funnyswap-orderserv/funnyswap-orderserv-service/src/main/java/com/funnyswap/service/OrderServServiceImpl.java
674a9adacfdaf2c19e32da87307036da3272b872
[]
no_license
Donxy7979/funnyswap
40dd17d8478b1a7ddc0deb66a811178e2edf82af
09e80689792f7040fd290ec251b2e241da21b165
refs/heads/master
2020-04-10T04:39:56.310149
2018-12-07T09:53:50
2018-12-07T09:53:51
160,805,116
0
0
null
2018-12-11T10:02:58
2018-12-07T09:54:30
Java
UTF-8
Java
false
false
155
java
package com.funnyswap.service; import org.springframework.stereotype.Service; @Service public class OrderServServiceImpl implements OrderServService { }
[ "jasonzhang@bf.com" ]
jasonzhang@bf.com
bf10f6f9a250dd9437887e95d6ca7f38945cf6e4
8bee00c03108a3841eddbc370a949fb5125e61c5
/PesquisaSolicitacao/src/main/java/br/com/lemontech/selfbooking/wsselfbooking/services/request/InserirItemDespesaRequest.java
8deeb0f8d773f4743031342c227af64403759268
[]
no_license
lucess/fullstack-java-teste
8976fd20e3b3c152e15dbed22494371b7b64accd
d282687a43214eaa08257a490084a0e13555a4e2
refs/heads/master
2021-01-01T16:36:32.729766
2017-07-20T20:08:46
2017-07-20T20:08:46
97,772,305
0
0
null
2017-07-20T00:15:25
2017-07-20T00:15:25
null
UTF-8
Java
false
false
12,325
java
/** * InserirItemDespesaRequest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package br.com.lemontech.selfbooking.wsselfbooking.services.request; public class InserirItemDespesaRequest implements java.io.Serializable { private int idSolicitacaoRef; private java.lang.String tipoDespesa; private double valor; private br.com.lemontech.selfbooking.wsselfbooking.beans.types.Moeda moeda; private java.lang.String imagem; private br.com.lemontech.selfbooking.wsselfbooking.beans.Deslocamento deslocamento; private java.lang.String observacao; private java.lang.String identificadorExterno; public InserirItemDespesaRequest() { } public InserirItemDespesaRequest( int idSolicitacaoRef, java.lang.String tipoDespesa, double valor, br.com.lemontech.selfbooking.wsselfbooking.beans.types.Moeda moeda, java.lang.String imagem, br.com.lemontech.selfbooking.wsselfbooking.beans.Deslocamento deslocamento, java.lang.String observacao, java.lang.String identificadorExterno) { this.idSolicitacaoRef = idSolicitacaoRef; this.tipoDespesa = tipoDespesa; this.valor = valor; this.moeda = moeda; this.imagem = imagem; this.deslocamento = deslocamento; this.observacao = observacao; this.identificadorExterno = identificadorExterno; } /** * Gets the idSolicitacaoRef value for this InserirItemDespesaRequest. * * @return idSolicitacaoRef */ public int getIdSolicitacaoRef() { return idSolicitacaoRef; } /** * Sets the idSolicitacaoRef value for this InserirItemDespesaRequest. * * @param idSolicitacaoRef */ public void setIdSolicitacaoRef(int idSolicitacaoRef) { this.idSolicitacaoRef = idSolicitacaoRef; } /** * Gets the tipoDespesa value for this InserirItemDespesaRequest. * * @return tipoDespesa */ public java.lang.String getTipoDespesa() { return tipoDespesa; } /** * Sets the tipoDespesa value for this InserirItemDespesaRequest. * * @param tipoDespesa */ public void setTipoDespesa(java.lang.String tipoDespesa) { this.tipoDespesa = tipoDespesa; } /** * Gets the valor value for this InserirItemDespesaRequest. * * @return valor */ public double getValor() { return valor; } /** * Sets the valor value for this InserirItemDespesaRequest. * * @param valor */ public void setValor(double valor) { this.valor = valor; } /** * Gets the moeda value for this InserirItemDespesaRequest. * * @return moeda */ public br.com.lemontech.selfbooking.wsselfbooking.beans.types.Moeda getMoeda() { return moeda; } /** * Sets the moeda value for this InserirItemDespesaRequest. * * @param moeda */ public void setMoeda(br.com.lemontech.selfbooking.wsselfbooking.beans.types.Moeda moeda) { this.moeda = moeda; } /** * Gets the imagem value for this InserirItemDespesaRequest. * * @return imagem */ public java.lang.String getImagem() { return imagem; } /** * Sets the imagem value for this InserirItemDespesaRequest. * * @param imagem */ public void setImagem(java.lang.String imagem) { this.imagem = imagem; } /** * Gets the deslocamento value for this InserirItemDespesaRequest. * * @return deslocamento */ public br.com.lemontech.selfbooking.wsselfbooking.beans.Deslocamento getDeslocamento() { return deslocamento; } /** * Sets the deslocamento value for this InserirItemDespesaRequest. * * @param deslocamento */ public void setDeslocamento(br.com.lemontech.selfbooking.wsselfbooking.beans.Deslocamento deslocamento) { this.deslocamento = deslocamento; } /** * Gets the observacao value for this InserirItemDespesaRequest. * * @return observacao */ public java.lang.String getObservacao() { return observacao; } /** * Sets the observacao value for this InserirItemDespesaRequest. * * @param observacao */ public void setObservacao(java.lang.String observacao) { this.observacao = observacao; } /** * Gets the identificadorExterno value for this InserirItemDespesaRequest. * * @return identificadorExterno */ public java.lang.String getIdentificadorExterno() { return identificadorExterno; } /** * Sets the identificadorExterno value for this InserirItemDespesaRequest. * * @param identificadorExterno */ public void setIdentificadorExterno(java.lang.String identificadorExterno) { this.identificadorExterno = identificadorExterno; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof InserirItemDespesaRequest)) return false; InserirItemDespesaRequest other = (InserirItemDespesaRequest) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && this.idSolicitacaoRef == other.getIdSolicitacaoRef() && ((this.tipoDespesa==null && other.getTipoDespesa()==null) || (this.tipoDespesa!=null && this.tipoDespesa.equals(other.getTipoDespesa()))) && this.valor == other.getValor() && ((this.moeda==null && other.getMoeda()==null) || (this.moeda!=null && this.moeda.equals(other.getMoeda()))) && ((this.imagem==null && other.getImagem()==null) || (this.imagem!=null && this.imagem.equals(other.getImagem()))) && ((this.deslocamento==null && other.getDeslocamento()==null) || (this.deslocamento!=null && this.deslocamento.equals(other.getDeslocamento()))) && ((this.observacao==null && other.getObservacao()==null) || (this.observacao!=null && this.observacao.equals(other.getObservacao()))) && ((this.identificadorExterno==null && other.getIdentificadorExterno()==null) || (this.identificadorExterno!=null && this.identificadorExterno.equals(other.getIdentificadorExterno()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; _hashCode += getIdSolicitacaoRef(); if (getTipoDespesa() != null) { _hashCode += getTipoDespesa().hashCode(); } _hashCode += new Double(getValor()).hashCode(); if (getMoeda() != null) { _hashCode += getMoeda().hashCode(); } if (getImagem() != null) { _hashCode += getImagem().hashCode(); } if (getDeslocamento() != null) { _hashCode += getDeslocamento().hashCode(); } if (getObservacao() != null) { _hashCode += getObservacao().hashCode(); } if (getIdentificadorExterno() != null) { _hashCode += getIdentificadorExterno().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(InserirItemDespesaRequest.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://lemontech.com.br/selfbooking/wsselfbooking/services/request", "inserirItemDespesaRequest")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("idSolicitacaoRef"); elemField.setXmlName(new javax.xml.namespace.QName("", "idSolicitacaoRef")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("tipoDespesa"); elemField.setXmlName(new javax.xml.namespace.QName("", "tipoDespesa")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("valor"); elemField.setXmlName(new javax.xml.namespace.QName("", "valor")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("moeda"); elemField.setXmlName(new javax.xml.namespace.QName("", "moeda")); elemField.setXmlType(new javax.xml.namespace.QName("http://lemontech.com.br/selfbooking/wsselfbooking/beans/types", "moeda")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("imagem"); elemField.setXmlName(new javax.xml.namespace.QName("", "imagem")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("deslocamento"); elemField.setXmlName(new javax.xml.namespace.QName("", "deslocamento")); elemField.setXmlType(new javax.xml.namespace.QName("http://lemontech.com.br/selfbooking/wsselfbooking/beans", "deslocamento")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("observacao"); elemField.setXmlName(new javax.xml.namespace.QName("", "observacao")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("identificadorExterno"); elemField.setXmlName(new javax.xml.namespace.QName("", "identificadorExterno")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "lucian.schirmer@outlook.com" ]
lucian.schirmer@outlook.com
15e56850e45c6fdc6a1ab7f54d5dd13d49d518a3
9a91a04ef7c1a59b308362726caf875e29e8fe94
/qimaService/src/main/java/com/qima/college/core/consts/domain/ConstsSiteCarousel.java
cfad870a6853c15fc3b3ee9a6cef312244c7d189
[]
no_license
Qimatech/qimaProject
9f7ed0ad7fe4e4600ca87980275c8ba2eb173549
4a0546f0cdc350ac3653b9814b1a9d4961357b88
refs/heads/master
2020-03-09T14:21:18.169216
2018-04-09T21:53:20
2018-04-09T21:53:20
128,832,535
0
0
null
null
null
null
UTF-8
Java
false
false
1,005
java
package com.qima.college.core.consts.domain; import com.qima.college.common.orm.BaseEntity; public class ConstsSiteCarousel extends BaseEntity{ private static final long serialVersionUID = -68528406716367757L; /** *名称 **/ private String name; /** *图片 **/ private String picture; /** *链接 **/ private String url; /** *权重 **/ private Integer weight; /** * 是否可用 */ private Integer enable; public String getName(){ return name; } public void setName(String name){ this.name = name; } public String getPicture(){ return picture; } public void setPicture(String picture){ this.picture = picture; } public String getUrl(){ return url; } public void setUrl(String url){ this.url = url; } public Integer getWeight(){ return weight; } public void setWeight(Integer weight){ this.weight = weight; } public Integer getEnable() { return enable; } public void setEnable(Integer enable) { this.enable = enable; } }
[ "m18721632613_1@163.com" ]
m18721632613_1@163.com
ee10c142510a352fd1f01958982382ad4f9cfad4
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java
ebe4e7d61cc8c49f271b6c49cdb0f802f3a7394a
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,616
java
/** * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.actuate.mongo; import Status.DOWN; import Status.UP; import com.mongodb.MongoException; import org.bson.Document; import org.junit.Test; import org.mockito.BDDMockito; import org.mockito.Mockito; import org.springframework.boot.actuate.health.Health; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.data.mongodb.core.MongoTemplate; /** * Tests for {@link MongoHealthIndicator}. * * @author Christian Dupuis */ public class MongoHealthIndicatorTests { private AnnotationConfigApplicationContext context; @Test public void mongoIsUp() { Document commandResult = Mockito.mock(Document.class); BDDMockito.given(commandResult.getString("version")).willReturn("2.6.4"); MongoTemplate mongoTemplate = Mockito.mock(MongoTemplate.class); BDDMockito.given(mongoTemplate.executeCommand("{ buildInfo: 1 }")).willReturn(commandResult); MongoHealthIndicator healthIndicator = new MongoHealthIndicator(mongoTemplate); Health health = healthIndicator.health(); assertThat(health.getStatus()).isEqualTo(UP); assertThat(health.getDetails().get("version")).isEqualTo("2.6.4"); Mockito.verify(commandResult).getString("version"); Mockito.verify(mongoTemplate).executeCommand("{ buildInfo: 1 }"); } @Test public void mongoIsDown() { MongoTemplate mongoTemplate = Mockito.mock(MongoTemplate.class); BDDMockito.given(mongoTemplate.executeCommand("{ buildInfo: 1 }")).willThrow(new MongoException("Connection failed")); MongoHealthIndicator healthIndicator = new MongoHealthIndicator(mongoTemplate); Health health = healthIndicator.health(); assertThat(health.getStatus()).isEqualTo(DOWN); assertThat(((String) (health.getDetails().get("error")))).contains("Connection failed"); Mockito.verify(mongoTemplate).executeCommand("{ buildInfo: 1 }"); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr