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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4edd9d6b7704af2ecf5e7933d9ae6d00dbbf4f1e | b96ce6d875adf1e0a02d30de246d5409ae06f8da | /src/day34_Inheritance/Isci.java | 5d65ea57b34115449086b1d806eedd6ca79814b4 | [] | no_license | Adnancan02/JavaDersleri | dc08803cab9bc251cc76f057492c391c884be492 | 8c052036116f59611534e6c03ed5e047a60c8517 | refs/heads/master | 2023-04-07T00:39:30.712655 | 2021-04-14T11:20:25 | 2021-04-14T11:20:25 | 357,877,951 | 0 | 0 | null | null | null | null | ISO-8859-9 | Java | false | false | 1,024 | java | package day34_Inheritance;
public class Isci extends Muhasebe {
public static void main(String[] args) {
Isci isci1= new Isci();
isci1.isim= "Omer";
isci1.soyisim="Aydın";
isci1.id= 1001;
isci1.izindeMi=false;
isci1.saatUcreti=10;
isci1.statu= "Isci";
isci1.maas=isci1.maasHesaola();
System.out.println(isci1.id+" "+isci1.isim+ " "+isci1.soyisim+" "+isci1.statu+ " "+ isci1.maas + " tl");
// Bu derse kadar hangi class da bilgi elde etmek istiyorsak o class tan obje olustururuz
// INheritance ile bu mecburiyet ortadan kalktı.
// Child class da olusturdugum obje ile tum parent class larda
// bulunan variable ve method ları inherit edebilirim.
Isci isci2= new Isci();
isci2.isim= "Esad";
isci2.soyisim="Okumus";
isci2.id= 1002;
isci2.izindeMi=false;
isci2.saatUcreti=15;
isci2.statu= "Isci";
isci2.maas=isci2.maasHesaola();
System.out.println(isci2.id+" "+isci2.isim+ " "+isci2.soyisim+" "+isci2.statu+ " "+ isci2.maas + " tl");
}
}
| [
"canadn02@gmail.com"
] | canadn02@gmail.com |
4af82fa9c35e90913fe1df1954c911112ca2eb40 | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.ui/5643.java | bfb058a2a937f2cfb5f364ed3faac3b3996056bd | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 713 | java | package p;
import java.util.*;
class Cell<T> {
List<T> t;
public void setT(AbstractList<T> t) {
this.t = t;
}
public Collection<T> getT() {
return t;
}
}
class CellTest {
public static void main(String[] args) {
ArrayList booleanList = new ArrayList();
booleanList.add(Boolean.FALSE);
Cell c1 = new Cell();
c1.t = booleanList;
c1.setT(booleanList);
Iterable t = c1.t;
Iterator iter = (Iterator) c1.t.iterator();
Iterator iter2 = c1.t.iterator();
boolean bool = (Boolean) c1.t.iterator().next();
Cell c2 = new Cell();
c2.t = booleanList;
}
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
103616fbdf38173fe87344fdb30833ac70d92a22 | 52a0351165c9f480d8676b7fb15e5b878fa37f22 | /src/main/java/indi/xp/coachview/mapper/MatchTeamMemberInfoMapper.java | 21bf344d3d594eb175cd3c54683fba548f567741 | [] | no_license | februay/coach_view | 9523f6553174ae289f07c9797b705198588e191e | b1fa3f8290e0258162f1755a5d120c959d3fa8fb | refs/heads/master | 2020-03-23T17:28:34.453237 | 2018-10-18T04:11:56 | 2018-10-18T04:11:56 | 141,861,676 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,850 | java | package indi.xp.coachview.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import indi.xp.coachview.model.MatchTeamMemberInfo;
@Mapper
public interface MatchTeamMemberInfoMapper {
public MatchTeamMemberInfo getById(@Param("id") String id,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public List<MatchTeamMemberInfo> findByIdList(@Param("idList") List<String> idList,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public List<MatchTeamMemberInfo> findList(@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public void add(@Param("entity") MatchTeamMemberInfo matchTeamMemberInfo);
public void update(@Param("entity") MatchTeamMemberInfo matchTeamMemberInfo,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public void delete(@Param("id") String id, @Param("authFilterMap") Map<String, Object[]> authFilterMap);
public void batchDelete(@Param("idList") List<String> idList,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public MatchTeamMemberInfo getByWhere(@Param("paramMap") Map<String, Object[]> paramMap,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public List<MatchTeamMemberInfo> findByWhere(@Param("paramMap") Map<String, Object[]> paramMap,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public Integer queryCount(@Param("paramMap") Map<String, Object[]> paramMap,
@Param("authFilterMap") Map<String, Object[]> authFilterMap);
public void updateByWhere(@Param("updateMap") Map<String, Object> updateMap,
@Param("paramMap") Map<String, Object[]> paramMap, @Param("authFilterMap") Map<String, Object[]> authFilterMap);
}
| [
"809229821@qq.com"
] | 809229821@qq.com |
9b32289362fd9d26e214b3cc674cc2d2782d86c3 | 2ba865ef43a15e30d3bff27d8492cbc3572c26b4 | /app/src/main/java/me/arulnadhan/androidultimate/TextSurface/activities/ShapeReveal.java | 39a5f95afd94b563115efc123546da9b89bdbfa8 | [] | no_license | Kimger/AndroidTemplate | c92c036a197d6fb5504ef29b2293a5ae83e0fe28 | 97828b43e906e8b37b7917da0218d63048c13386 | refs/heads/master | 2020-09-14T08:19:50.745234 | 2018-10-19T06:31:36 | 2018-10-19T06:31:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,470 | java | package me.arulnadhan.androidultimate.TextSurface.activities;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import me.arulnadhan.androidultimate.R;
import me.arulnadhan.textsurface.Debug;
import me.arulnadhan.textsurface.Text;
import me.arulnadhan.textsurface.TextBuilder;
import me.arulnadhan.textsurface.TextSurface;
import me.arulnadhan.textsurface.animations.Alpha;
import me.arulnadhan.textsurface.animations.AnimationsSet;
import me.arulnadhan.textsurface.animations.Circle;
import me.arulnadhan.textsurface.animations.Delay;
import me.arulnadhan.textsurface.animations.Rotate3D;
import me.arulnadhan.textsurface.animations.SideCut;
import me.arulnadhan.textsurface.animations.Slide;
import me.arulnadhan.textsurface.animations.TransSurface;
import me.arulnadhan.textsurface.contants.Axis;
import me.arulnadhan.textsurface.contants.Direction;
import me.arulnadhan.textsurface.contants.Pivot;
import me.arulnadhan.textsurface.contants.Side;
import me.arulnadhan.textsurface.contants.TYPE;
public class ShapeReveal extends AppCompatActivity {
private TextSurface textSurface;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_textsurface);
textSurface = (TextSurface) findViewById(R.id.text_surface);
textSurface.postDelayed(new Runnable() {
@Override
public void run() {
show();
}
}, 1000);
findViewById(R.id.btn_refresh).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
show();
}
});
CheckBox checkDebug = (CheckBox) findViewById(R.id.check_debug);
checkDebug.setChecked(Debug.ENABLED);
checkDebug.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Debug.ENABLED = isChecked;
textSurface.invalidate();
}
});
}
private void show() {
textSurface.reset();
Text textA = TextBuilder.create("Hey Guys,").setPosition(me.arulnadhan.textsurface.contants.Align.SURFACE_CENTER).setSize(28).build();
Text textB = TextBuilder.create("How are you?").setPosition(me.arulnadhan.textsurface.contants.Align.BOTTOM_OF | me.arulnadhan.textsurface.contants.Align.CENTER_OF, textA).setSize(28).build();
Text textC = TextBuilder.create("Thanks for taking a look at ").setPosition(me.arulnadhan.textsurface.contants.Align.BOTTOM_OF | me.arulnadhan.textsurface.contants.Align.CENTER_OF, textB).setSize(24).build();
Text textD = TextBuilder.create("Android Ultimate").setPosition(me.arulnadhan.textsurface.contants.Align.BOTTOM_OF | me.arulnadhan.textsurface.contants.Align.CENTER_OF, textC).setSize(28).build();
final int flash = 1500;
textSurface.play(TYPE.SEQUENTIAL,
Rotate3D.showFromCenter(textA, 500, Direction.CLOCK, Axis.X),
new AnimationsSet(TYPE.PARALLEL,
me.arulnadhan.textsurface.animations.ShapeReveal.create(textA, flash, SideCut.hide(Side.LEFT), false),
new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(flash / 4), me.arulnadhan.textsurface.animations.ShapeReveal.create(textA, flash, SideCut.show(Side.LEFT), false))
),
new AnimationsSet(TYPE.PARALLEL,
Rotate3D.showFromSide(textB, 500, Pivot.TOP),
new TransSurface(500, textB, Pivot.CENTER)
),
Delay.duration(500),
new AnimationsSet(TYPE.PARALLEL,
Slide.showFrom(Side.TOP, textC, 500),
new TransSurface(1000, textC, Pivot.CENTER)
),
Delay.duration(500),
new AnimationsSet(TYPE.PARALLEL,
me.arulnadhan.textsurface.animations.ShapeReveal.create(textD, 500, Circle.show(Side.CENTER, Direction.OUT), false),
new TransSurface(1500, textD, Pivot.CENTER)
),
Delay.duration(500),
new AnimationsSet(TYPE.PARALLEL,
new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textD, 700), me.arulnadhan.textsurface.animations.ShapeReveal.create(textD, 1000, SideCut.hide(Side.LEFT), true)),
new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(500), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textC, 700), me.arulnadhan.textsurface.animations.ShapeReveal.create(textC, 1000, SideCut.hide(Side.LEFT), true))),
new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(1000), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textB, 700), me.arulnadhan.textsurface.animations.ShapeReveal.create(textB, 1000, SideCut.hide(Side.LEFT), true))),
new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(1500), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textA, 700), me.arulnadhan.textsurface.animations.ShapeReveal.create(textA, 1000, SideCut.hide(Side.LEFT), true))),
new TransSurface(4000, textA, Pivot.CENTER)
)
);
}
}
| [
"zhan9kun@qq.com"
] | zhan9kun@qq.com |
aeea3ec575967d091a62d8b151b267b619b3f43d | e9e577e7f2618f9267148fa1eeb30df771934bd6 | /app/src/main/java/com/tech20/mobiledelivery/activities/ActivityOrders.java | 1d7b2c19824c7798ca8ae683f3929bc6b365a200 | [] | no_license | punampawar27/OrdersDelivery | f975baaa1bb403b99e4d65e85fe58646faf9ce96 | 3aa115880fddfa249895d31b5f03db2507b8f158 | refs/heads/master | 2021-05-09T19:21:13.552156 | 2018-01-23T16:42:43 | 2018-01-23T16:42:43 | 118,638,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,015 | java | package com.tech20.mobiledelivery.activities;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.tech20.mobiledelivery.R;
import com.tech20.mobiledelivery.adapters.AdapterOrders;
import com.tech20.mobiledelivery.contracts.ContractOrders;
import com.tech20.mobiledelivery.contracts.ContractOrders.IViewOrders;
import com.tech20.mobiledelivery.database.DatabaseHouse;
import com.tech20.mobiledelivery.database.dataentities.DbModelOrders;
import com.tech20.mobiledelivery.enums.EnumOrderStatus;
import com.tech20.mobiledelivery.enums.EnumPushNotificationType;
import com.tech20.mobiledelivery.helpers.Constants;
import com.tech20.mobiledelivery.helpers.NetworkHelper;
import com.tech20.mobiledelivery.helpers.PreferenceUtils;
import com.tech20.mobiledelivery.helpers.ToastUtils;
import com.tech20.mobiledelivery.helpers.UtilDateFormat;
import com.tech20.mobiledelivery.presenter.PresneterOrders;
import com.tech20.mobiledelivery.retrofitclient.ErrorMessage;
import com.tech20.mobiledelivery.retrofitclient.ordersclient.Order;
import com.tech20.mobiledelivery.retrofitclient.ordersclient.OrdersResponse;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class ActivityOrders extends BaseActivity implements IViewOrders {
//Database not implementedyet for Orders
private ContractOrders.IPresenterOrders iPresenterOrders = null;
private RecyclerView recyclerView = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_orders);
initView();
getOrders();
}
private void initView(){
setupToolbar(findViewById(R.id.detail_toolbar),getString(R.string.title_deliveries));
iPresenterOrders = new PresneterOrders();
iPresenterOrders.attach(this);
recyclerView = findViewById(R.id.recyclerViewOrders);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new DividerItemDecoration(this,LinearLayoutManager.VERTICAL));
}
private void getOrders(){
if(NetworkHelper.isOnline(this)){
PreferenceUtils.getINSTANCE(getApplicationContext()).putBoolean(Constants.PreferenceConstants.IS_ORDER_REFRESHED,false);
iPresenterOrders.getOrders(DatabaseHouse.getSingleTon(getApplicationContext()),
PreferenceUtils.getINSTANCE(getApplicationContext()),
getTodayDateString());
}else{
ToastUtils.showSnackBar(findViewById(android.R.id.content),getString(R.string.err_network));
}
}
private void startOrderDetail(DbModelOrders order){
Intent intent = new Intent(this,ActivityOrderDetails.class);
intent.putExtra(ActivityOrderDetails.EXTRA_ORDER,order);
startActivity(intent);
}
private String getTodayDateString(){
return UtilDateFormat.format(UtilDateFormat.yyyy_MM_dd_T_HH_mm_ss,
Calendar.getInstance().getTime());
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
onBackPressed();
break;
case R.id.action_refresh:
getOrders();
break;
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_orders,menu);
return true;
}
@Override
public void onOrdersLoadedSuccess(List<DbModelOrders> listOrders) {
Log.d(Constants.LogConstants.TAG_WASTE,"Number of Orders : "+(listOrders!=null?listOrders.size():0));
recyclerView.setAdapter(new AdapterOrders(onClick,this,(listOrders!=null)?listOrders:new ArrayList <>()));
}
@Override
public void onOrdersLoadedFail(ErrorMessage errorMessage) {
ToastUtils.showSnackBar(findViewById(android.R.id.content), TextUtils.isEmpty(errorMessage.getMessage())?getString(R.string.err_network):errorMessage.getMessage());
}
private View.OnClickListener onClick = (View v)->{
DbModelOrders orders = null;
switch (v.getId()){
case R.id.imgCall:
orders = ((AdapterOrders)recyclerView.getAdapter()).getItem(Integer.parseInt(String.valueOf(v.getTag())));
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + orders.getContactNumber()));
startActivity(intent);
break;
case R.id.imgMap:
orders = ((AdapterOrders)recyclerView.getAdapter()).getItem(Integer.parseInt(String.valueOf(v.getTag())));
showAddressOnMap(orders.getShippingAddress());
break;
case R.id.relParent:
orders = ((AdapterOrders)recyclerView.getAdapter()).getItem(Integer.parseInt(String.valueOf(v.getTag())));
//Only show order details if order is assigned or placed
if(orders.getStatus() == EnumOrderStatus.Assigned.getValue() ||
orders.getStatus() == EnumOrderStatus.Placed.getValue() ||
orders.getStatus() == EnumOrderStatus.UnDelivered.getValue()){
startOrderDetail(orders);
}
break;
}
};
private void showAddressOnMap(String shippingAddress){
String uri = Constants.MAPCONST.MAP_STRING + shippingAddress;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);
}
@Override
protected void onResume() {
super.onResume();
if(PreferenceUtils.getINSTANCE(this).getBoolean(Constants.PreferenceConstants.IS_ORDER_REFRESHED)){
getOrders();
}
register();
}
@Override
protected void onPause() {
super.onPause();
unRegister();
}
private void register(){
registerReceiver(receiverPushNotificationBroadcast,new IntentFilter(Constants.INTENTACTIONS.ACTION_PUSH_RECEIVED));
}
private void unRegister(){
unregisterReceiver(receiverPushNotificationBroadcast);
}
private BroadcastReceiver receiverPushNotificationBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
//Constants.INTENTEXTRAS.EXTRA_PUSHNOTIFICATOIN_FLAG
getOrders();
}
};
}
| [
"punam.pawar.fidel@gmail.com"
] | punam.pawar.fidel@gmail.com |
6afab49f9a602ae356401220f3e9f56651921f06 | 7c46a44f1930b7817fb6d26223a78785e1b4d779 | /soap/src/java/com/zimbra/soap/admin/message/GetDomainInfoResponse.java | f543e478ecfc6be4c007b949cc086bd6d2b0fb3c | [] | no_license | Zimbra/zm-mailbox | 20355a191c7174b1eb74461a6400b0329907fb02 | 8ef6538e789391813b65d3420097f43fbd2e2bf3 | refs/heads/develop | 2023-07-20T15:07:30.305312 | 2023-07-03T06:44:00 | 2023-07-06T10:09:53 | 85,609,847 | 67 | 128 | null | 2023-09-14T10:12:10 | 2017-03-20T18:07:01 | Java | UTF-8 | Java | false | false | 1,659 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2010, 2012, 2013, 2014, 2016 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.soap.admin.message;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.zimbra.common.soap.AdminConstants;
import com.zimbra.soap.admin.type.DomainInfo;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name=AdminConstants.E_GET_DOMAIN_INFO_RESPONSE)
@XmlType(propOrder = {})
public class GetDomainInfoResponse {
/**
* @zm-api-field-description Information about domain
*/
@XmlElement(name=AdminConstants.E_DOMAIN, required=false)
private DomainInfo domain;
public GetDomainInfoResponse() {
}
public void setDomain(DomainInfo domain) {
this.domain = domain;
}
public DomainInfo getDomain() {
return domain;
}
}
| [
"shriram.vishwanathan@synacor.com"
] | shriram.vishwanathan@synacor.com |
c8c9bcc41a62528827f7b75402ef3d73d46d8bc8 | 24ebe2de93d6f9d7e3c188fc4654b57ee64dcd7e | /src/main/java/edu/dlnu/oa/peopleSend/controller/PeopleSendController.java | 53cc355410f82ce068ab8e7c82f24bf0eccc8d58 | [
"MIT"
] | permissive | DLNUOA/OA | 27545f886ef3fa5bfcefa79012a2752fb195cc77 | f6716408f978347d32fcffa10e5e2d9568f37bfa | refs/heads/master | 2022-07-16T15:51:00.474458 | 2020-01-07T12:51:50 | 2020-01-07T12:51:50 | 228,975,799 | 3 | 0 | MIT | 2022-06-29T17:53:16 | 2019-12-19T04:37:03 | JavaScript | UTF-8 | Java | false | false | 1,870 | java | package edu.dlnu.oa.peopleSend.controller;
import edu.dlnu.oa.peopleSend.pojo.ComSendPeople;
import edu.dlnu.oa.peopleSend.service.PeopleSendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import static org.springframework.web.bind.annotation.RequestMethod.*;
/**
* 外派人才管理
*/
@RestController
@RequestMapping("api")
public class PeopleSendController {
@Autowired
private PeopleSendService service;
//查询所有外派人员信息
@RequestMapping(value = "/send/query", method = GET)
public List<ComSendPeople> query() { return service.queryCsp(); }
//添加外派人员信息
@RequestMapping(value = "/send/add", method = POST)
public int add(@RequestBody ComSendPeople csp) { return service.addCsp(csp); }
//根据ID查人员信息
@RequestMapping(value = "/send/queryById/{spId}", method = GET)
public ComSendPeople queryById(@PathVariable int spId) { return service.queryCspId(spId); }
//根据姓名模糊查询人员信息
@RequestMapping(value = "/send/queryByName", method = POST)
public List<ComSendPeople> queryByName(@RequestBody Map<String,String> map) { return service.queryCspName(map.get("spName")); }
//删除人员信息
@RequestMapping(value = "/send/delete/{spId}", method = DELETE)
public int delete(@PathVariable int spId) { return service.deleteCsp(spId); }
//更改人员信息
@RequestMapping(value = "/send/update", method = POST)
public int update(@RequestBody Map<String,Object> csp) { return service.updateCsp(csp); }
}
| [
"1641421642@qq.com"
] | 1641421642@qq.com |
f2a5364ae6ed3ad572dd646e6b1211169daa8035 | 281a9c8dca9fa50a25c56af5c4834b01262fd597 | /app/src/main/java/com/example/student_management/Student.java | ffb8db0db68f5012f7c3f6dd34d5245b3d70a195 | [] | no_license | dungnguyenhuu/Student_Management | 20905711bebefd7d196b392574e75b1a7cea3d7b | e173b3d9b344971aa89739e2248fa95cdc151519 | refs/heads/master | 2022-12-25T00:06:21.297068 | 2020-09-23T14:29:31 | 2020-09-23T14:29:31 | 272,986,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,147 | java | package com.example.student_management;
import java.io.Serializable;
public class Student implements Serializable {
private int code;
private String name;
private String date;
private String email;
private String address;
public Student(int code, String name, String date, String email, String address) {
this.code = code;
this.name = name;
this.date = date;
this.email = email;
this.address = address;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
| [
"dung99xcyd@gmail.com"
] | dung99xcyd@gmail.com |
8ab44de495faecf67df37d231edead58cffdf84a | fb1da37bbb61b861de230d55efed09b816c96dbc | /extranet/src/main/java/com/gruppo/isc/extranet/service/AvanzamentoServiceImp.java | a3d213c9f83e7cd85db57a8b43bb459bd51d0ed2 | [] | no_license | Minfrey/Git_Extranet | c47a086de9141d7cb6add512357f89a7bf80f68d | 52598423f7c1b74102094fdf9ad8e0f1bc891d1d | refs/heads/main | 2023-03-20T04:14:33.201880 | 2021-03-09T09:41:39 | 2021-03-09T09:41:39 | 332,261,207 | 0 | 0 | null | 2021-03-08T17:20:43 | 2021-01-23T16:55:27 | Java | UTF-8 | Java | false | false | 11,233 | java | package com.gruppo.isc.extranet.service;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import com.gruppo.isc.extranet.model.Attivita;
import com.gruppo.isc.extranet.model.Avanzamento;
import com.gruppo.isc.extranet.model.Commessa;
import com.gruppo.isc.extranet.model.TipoAvanzamento;
import com.gruppo.isc.extranet.repository.AttivitaRepoImp;
import com.gruppo.isc.extranet.repository.AvanzamentoRepoImp;
import com.gruppo.isc.extranet.repository.CommessaRepoImp;
@Service
public class AvanzamentoServiceImp implements AvanzamentoService
{
@Autowired
AvanzamentoRepoImp arr;
@Autowired
CommessaRepoImp cri;
@Override
@Transactional
public String setAvanzamento(Avanzamento a)
{
Calendar alfa = new GregorianCalendar();
alfa.set(a.getAnno().getNumero(), (a.getMese().getId_mese()-1), 15);
java.sql.Date javaSqlDate = new java.sql.Date(alfa.getTime().getTime());
a.setData(javaSqlDate);
System.out.println(a.getData());
Integer percentualelocale = a.getPercentuale();
Double valore = a.getAttivita().getValore();
Double valoreava = (valore*percentualelocale)/100;
a.setValore(valoreava);
String messaggio="";
java.sql.Date inizio = a.getAttivita().getCommessa().getInizio();
System.out.println(inizio);
java.sql.Date fine = a.getAttivita().getCommessa().getFine();
System.out.println(fine);
if(inizio.before(a.getData()) && fine.after(a.getData()))
{
if(arr.controlloDuplicatiInserimento(a).size()==0)
{
if(a.getTipoAvanzamento().getId_tipo_avanzamento()==2 || a.getTipoAvanzamento().getId_tipo_avanzamento()==3)
{
List controllo = arr.controlloInserimento(a);
if(controllo.size()>=1 && a.getTipoAvanzamento().getId_tipo_avanzamento()==2)
{
messaggio = ("\"Sono già stati inseriti i ricavi di questa attività\"");
}
else if(controllo.size()>=1 && a.getTipoAvanzamento().getId_tipo_avanzamento()==3)
{
messaggio = ("\"È già stato inserito un preventivo per i ricavi di questa attività\"");
}
else
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
arr.setAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
if(a.getTipoAvanzamento().getId_tipo_avanzamento()==2)
{
// prendo id della commessa e inserisco il valore dell'attivita nel fatturato essendo id 2 il computo dei ricavi
// aggiungere fattura
cri.fatturatoCommessa(a.getAttivita().getValore(), a.getAttivita().getCommessa().getId_commessa());
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
//se esite un avanzamento dello stesso tipo con lo stesso nome della stessa commessa allora errore
else
{
/////////////////////////////////////////
boolean controlloprec = false;
List<Avanzamento> percent = arr.controlloPercentuale(a);
Avanzamento massimominimo = new Avanzamento();
Avanzamento minimomassimo = new Avanzamento();
for(int i=0;i<percent.size();i++)
{
if(a.getData().before(percent.get(i).getData())/* && a.getPercentuale()<percent.get(i).getPercentuale()*/)
{
if(minimomassimo.getData()==null)
{
minimomassimo = percent.get(i);
}
else if(minimomassimo.getData().after(percent.get(i).getData())/*&& minimomassimo.getPercentuale()>percent.get(i).getPercentuale()*/)
{
minimomassimo = percent.get(i);
}
}
else if(a.getData().after(percent.get(i).getData())/* && a.getPercentuale()>percent.get(i).getPercentuale()*/)
{
if(massimominimo.getData()==null)
{
massimominimo = percent.get(i);
}
else if(massimominimo.getData().before(percent.get(i).getData())/*&& massimominimo.getPercentuale()<percent.get(i).getPercentuale()*/)
{
massimominimo = percent.get(i);
}
}
}
System.out.println("estremo inferiore "+massimominimo.getData()+" "+massimominimo.getPercentuale());
System.out.println("inserito "+a.getData()+" "+a.getPercentuale());
System.out.println("estremo superiore "+minimomassimo.getData()+" "+minimomassimo.getPercentuale());
if(massimominimo.getData()==null && minimomassimo.getData()==null)
{
System.out.println("liberoooooooooooooooooooo");
arr.setAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else if(massimominimo.getData()==null && a.getData().before(minimomassimo.getData()) && a.getPercentuale()<minimomassimo.getPercentuale() )
{
System.out.println("estremo inferiore nulloooooooooooo");
arr.setAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else if(minimomassimo.getData()==null && a.getData().after(massimominimo.getData()) && a.getPercentuale()>massimominimo.getPercentuale())
{
System.out.println("estremo superiore nulloooooooooooo");
arr.setAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
///////////////////////////////
else if (massimominimo.getData()!=null
&& massimominimo.getData().before(a.getData())
&& minimomassimo.getData()!=null
&& a.getData().before(minimomassimo.getData())
&& massimominimo.getPercentuale()<a.getPercentuale()
&& a.getPercentuale()<minimomassimo.getPercentuale())
{
System.out.println("nessuno e nulloooooooooo");
arr.setAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else
{
System.out.println(massimominimo.getData().before(a.getData()));
// System.out.println(a.getData().before(minimomassimo.getData()));
System.out.println(massimominimo.getPercentuale()<a.getPercentuale());
// System.out.println(a.getPercentuale()<minimomassimo.getPercentuale());
messaggio = ("\"Errore\"");
}
}
}
else
{
messaggio= ("\"Attivita Duplicata\"");
}
}
else
{
messaggio="\"Data non corretta\"";
}
return messaggio;
}
@Override
@Transactional
public String modAvanzamento(Avanzamento a)
{
String messaggio="";
Avanzamento consolid = arr.getAvanzamentoByID(a.getId_avanzamento());
if(consolid.getConsolida()==null)
{
Calendar alfa = new GregorianCalendar();
alfa.set(a.getAnno().getNumero(), (a.getMese().getId_mese()-1), 15);
java.sql.Date javaSqlDate = new java.sql.Date(alfa.getTime().getTime());
a.setData(javaSqlDate);
//calcola valore da percentuale
Integer percentualelocale = a.getPercentuale();
Double valore = a.getAttivita().getValore();
Double valoreava = (valore*percentualelocale)/100;
a.setValore(valoreava);
/////////////////////////////////////////
boolean controlloprec = false;
List<Avanzamento> percent = arr.controlloPercentuale(a);
Avanzamento massimominimo = new Avanzamento();
Avanzamento minimomassimo = new Avanzamento();
for(int i=0;i<percent.size();i++)
{
if(a.getMese().getId_mese()==percent.get(i).getMese().getId_mese() && a.getAnno().getId_anno()==percent.get(i).getAnno().getId_anno())
{
continue;
}
if(a.getData().before(percent.get(i).getData())/* && a.getPercentuale()<percent.get(i).getPercentuale()*/)
{
if(minimomassimo.getData()==null)
{
minimomassimo = percent.get(i);
}
else if(minimomassimo.getData().after(percent.get(i).getData())/*&& minimomassimo.getPercentuale()>percent.get(i).getPercentuale()*/)
{
minimomassimo = percent.get(i);
}
}
else if(a.getData().after(percent.get(i).getData())/* && a.getPercentuale()>percent.get(i).getPercentuale()*/)
{
if(massimominimo.getData()==null)
{
massimominimo = percent.get(i);
}
else if(massimominimo.getData().before(percent.get(i).getData())/*&& massimominimo.getPercentuale()<percent.get(i).getPercentuale()*/)
{
massimominimo = percent.get(i);
}
}
}
System.out.println("estremo inferiore "+massimominimo.getData()+" "+massimominimo.getPercentuale());
System.out.println("inserito "+a.getData()+" "+a.getPercentuale());
System.out.println("estremo superiore "+minimomassimo.getData()+" "+minimomassimo.getPercentuale());
if(massimominimo.getData()==null && minimomassimo.getData()==null)
{
System.out.println("liberoooooooooooooooooooo");
arr.modAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else if(massimominimo.getData()==null && a.getData().before(minimomassimo.getData()) && a.getPercentuale()<minimomassimo.getPercentuale() )
{
System.out.println("estremo inferiore nulloooooooooooo");
arr.modAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else if(minimomassimo.getData()==null && a.getData().after(massimominimo.getData()) && a.getPercentuale()>massimominimo.getPercentuale())
{
System.out.println("estremo superiore nulloooooooooooo");
arr.modAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
///////////////////////////////
else if (massimominimo.getData().before(a.getData())
&& a.getData().before(minimomassimo.getData())
&& massimominimo.getPercentuale()<a.getPercentuale()
&& a.getPercentuale()<minimomassimo.getPercentuale())
{
System.out.println("nessuno e nulloooooooooo");
arr.modAvanzamento(a);
messaggio = ("\"Attivita Inserita\"");
}
else
{
System.out.println(massimominimo.getData().before(a.getData()));
System.out.println(a.getData().before(minimomassimo.getData()));
System.out.println(massimominimo.getPercentuale()<a.getPercentuale());
System.out.println(a.getPercentuale()<minimomassimo.getPercentuale());
messaggio = ("\"Errore\"");
}
}
else
{
messaggio = ("\"Avanzamento consolidato non e possibile modificarlo\"");
}
return messaggio;
}
public List<Avanzamento> getListAvanzamento()
{
return arr.getAvanzamentoList();
}
public List<Avanzamento> getAvanzamentoByAttivita2(int id)
{
List<Avanzamento> a = arr.getAvanzamentoByAttivita2(id);
System.out.println(a.get(0).getAnno().getNumero());
return arr.getAvanzamentoByAttivita2(id);
}
public List<Avanzamento> getAvanzamentoByCommessaType(int id, int idt)
{
return arr.getAvanzamentoByCommessaType(id, idt);
}
@Transactional
public String consolidaav(Avanzamento a)
{
String messaggio = "";
Avanzamento b = arr.consolidav(a);
Integer numcom = a.getAttivita().getCommessa().getId_commessa();
if(a.getTipoAvanzamento().getId_tipo_avanzamento()==3)
{
cri.previsionefatturatoCommessa(a.getAttivita().getValore(), numcom);
}
if(b.getConsolida()!=null)
{
messaggio="\"Consolidato\"";
}
else
{
messaggio="\"Non Consolidato\"";
}
return messaggio;
}
}
| [
"fabio.coluccia93@gmail.com"
] | fabio.coluccia93@gmail.com |
d4b03602b038ce2a26bb13b8cd21dca098fe8d03 | 42f345cf266712da06f7a5205ebb92ac8d6db5ed | /ssm-demo/src/main/java/com/zhougl/algo/HeapIfy.java | 18d2bb52029183eea97b1286c2e85bf416d483a0 | [] | no_license | zhouguanglong1/ssm-maven | e648797029e6754cc075307701039496ca9c42d6 | 658a675709be8533ec978c87928934cc130c0088 | refs/heads/master | 2022-11-25T06:59:09.998682 | 2020-10-30T03:53:18 | 2020-10-30T03:53:18 | 142,732,040 | 0 | 0 | null | 2022-11-16T10:26:32 | 2018-07-29T04:57:44 | Java | UTF-8 | Java | false | false | 2,857 | java | package com.zhougl.algo;
import lombok.Data;
import java.util.Arrays;
/**
* 堆是一个完全二叉树(除了最后一层,其他层的节点都是满的,且最后一层的子节点都靠左排列)可以使用数组存储
* 堆中每个节点的值,都大于等于(小于等于)左右子节点的值
*
* @author zhougl
* @version v1.0.0
* @since 2020/8/29 15:05
*/
@Data
public class HeapIfy {
/**
* 存放数据的数组
*/
private int[] a;
/**
* 数组最大存放的个数
*/
private int n;
/**
* 数组当前存放的个数
*/
private int count;
public HeapIfy(int capacity){
a = new int[capacity + 1];
n = capacity;
count = 0;
}
/**
* 往堆中插入数据,从下往上堆化
* @param data
*/
public void insert(int data){
if(count >= n){
return;
}
count ++;
a[count] = data;
int i = count;
while(i/2 > 0 && a[i/2] < a[i]){
swap(a,i,i/2);
i = i/2;
}
}
private void swap(int[] a,int i,int j) {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
public void removeMax(){
if(count == 0){
return;
}
a[1] = a[count];
-- count;
heapIfy(a,count,1);
}
/**
* 从上往下堆化
*/
private void heapIfy(int[] a,int n,int i) {
while (true){
int maxPos = i;
if(i*2 <= n && a[i] < a[i*2]){
maxPos = maxPos *2;
}
else if(i*2+1 <= n && a[i] < a[i * 2 + 1]){
maxPos = maxPos * 2 + 1;
}
if(maxPos == i){
break;
}
swap(a,i,maxPos);
i = maxPos;
}
}
public static void main(String[] args) {
HeapIfy heapIfy = new HeapIfy(10);
heapIfy.insert(3);
heapIfy.insert(7);
heapIfy.insert(1);
heapIfy.insert(2);
heapIfy.insert(5);
heapIfy.insert(4);
heapIfy.insert(6);
heapIfy.insert(8);
heapIfy.insert(10);
heapIfy.insert(9);
Arrays.stream(heapIfy.getA()).forEach(System.out::println);
System.out.println("===============================");
heapIfy.removeMax();
Arrays.stream(heapIfy.getA()).forEach(System.out::println);
int[] nums = {2,2,1};
int i = singleNumber(nums);
System.out.println(i);
int a = 10;
a = a += a -= a*= 10;
System.out.println(a);
}
public static int singleNumber(int[] nums) {
if(nums.length == 0){
return -1;
}
for(int i=1;i<nums.length;i++){
nums[0] ^= nums[i];
}
return nums[0];
}
}
| [
"zhouguanglong@deepexi.com"
] | zhouguanglong@deepexi.com |
eff04ac7161234f65a1922f04fdf1a482c332a52 | 7e5f5708c9ea46094f38be0076dca2d6457567fa | /Rozszerzone Systemy Informatyczne - Java/REST/RestWeb_Client/build/generated-sources/jaxb/classes/Message.java | d96a94357c79f9ff28f9473e652c8018a7ac88ff | [] | no_license | isiemaszko/2k21---semesters- | fa6191cca5c1f27a7fd1422b48c15db36f076d6b | f3593cfcfb3f265b035dbea6724e3477bc118702 | refs/heads/master | 2023-07-12T06:50:27.693990 | 2021-08-18T17:41:58 | 2021-08-18T17:41:58 | 397,684,596 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,607 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.05.23 at 08:40:14 PM CEST
//
package classes;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for message complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="message">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
* <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "message", propOrder = {
"author",
"id",
"message"
})
public class Message {
protected String author;
protected long id;
protected String message;
/**
* Gets the value of the author property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAuthor() {
return author;
}
/**
* Sets the value of the author property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAuthor(String value) {
this.author = value;
}
/**
* Gets the value of the id property.
*
*/
public long getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(long value) {
this.id = value;
}
/**
* Gets the value of the message property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMessage() {
return message;
}
/**
* Sets the value of the message property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMessage(String value) {
this.message = value;
}
}
| [
"izabela.siemaszko@onet.pl"
] | izabela.siemaszko@onet.pl |
08d09a0b0d03ab5dabfe6d27645440c0d647b4eb | 46786b383a16fff9c5d57b6b197b905e56a40dba | /xcloud/xcloud-vijava/src/main/java/com/vmware/vim25/AlarmEvent.java | 6be98c705ee77169b443c6feeb32b1b6137a1d74 | [] | no_license | yiguotang/x-cloud | feeb9c6288e01a45fca82648153238ed85d4069e | 2b255249961efb99d48a0557f7d74ce3586918fe | refs/heads/master | 2020-04-05T06:18:30.750373 | 2016-08-03T06:48:35 | 2016-08-03T06:48:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,990 | java | /*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class AlarmEvent extends Event {
public AlarmEventArgument alarm;
public AlarmEventArgument getAlarm() {
return this.alarm;
}
public void setAlarm(AlarmEventArgument alarm) {
this.alarm=alarm;
}
}
| [
"waddy87@gmail.com"
] | waddy87@gmail.com |
1cf3a9143f2302401e74c366a628ffacd0769781 | 093d1c914076656bf89936046f1aeae9ff9cb0f7 | /pilot-hsqldb/src/main/java/com/nicecredit/pilot/hsqldb/DBRepository.java | a980927a2f73ffc7665d5520f1a8ea2914acede7 | [] | no_license | OpenSourceConsulting/drools-pilot | 26d5799311006d6c23b97fb5d694e8dab0c16ad1 | 8f9c68e6d10821c9686359b1dc64861abd540ca4 | refs/heads/master | 2021-03-24T09:36:21.381440 | 2018-05-15T01:33:58 | 2018-05-15T01:33:58 | 43,865,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | package com.nicecredit.pilot.hsqldb;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <pre>
*
* </pre>
* @author BongJin Kwon
*/
public class DBRepository {
private static final Logger LOGGER = LoggerFactory.getLogger(DBRepository.class);
public static DBRepository INSTANCE;
private EntityManagerFactory emFactory;
private EntityManagerFactory emFactoryHsql;
/**
* <pre>
*
* </pre>
*/
private DBRepository() {
emFactory = Persistence.createEntityManagerFactory( "org.hibernate.nice.jpa" );
emFactoryHsql = Persistence.createEntityManagerFactory( "org.hibernate.nice.hsql" );
}
public static DBRepository getInstance() {
if (INSTANCE == null) {
synchronized (DBRepository.class) {
if (INSTANCE == null) {
INSTANCE = new DBRepository();
}
}
}
return INSTANCE;
}
/**
* <pre>
* for hibernate
* </pre>
* @return
*/
public EntityManager createEntityManager() {
return emFactory.createEntityManager();
}
/**
* <pre>
* for hibernate (HSQL)
* </pre>
* @return
*/
public EntityManager createEntityManagerHsql() {
return emFactoryHsql.createEntityManager();
}
public static void close() {
if (INSTANCE != null) {
synchronized (DBRepository.class) {
if (INSTANCE != null) {
INSTANCE.doClose();
INSTANCE = null;
}
}
}
}
private void doClose() {
if (emFactory != null) {
emFactory.close();
emFactory = null;
}
if (emFactoryHsql != null) {
emFactoryHsql.close();
emFactoryHsql = null;
}
LOGGER.info("all EntityManagerFactory closed!!");
}
}
//end of DBRepository.java | [
"idkbj@osci.kr"
] | idkbj@osci.kr |
8d7c6fcc7a6f6472fe7409fb9d53f4ea3735d7c3 | a3ccd61096fe2a5a77cc8d11ec93f8fdea0b558f | /guineCore/src/main/java/com/guinea/communications/netty/webSocket/PlanTaskNettyInitialzer.java | 1e54c1e1def5d9fb3642e1eb01696d440e87be0e | [] | no_license | skyjasper/guineFox | b94e5bc6a41dcefc1976a4b835796ad79fc8521b | 355ed03d0e72861feb4cef783bd4fc7f7ea32b77 | refs/heads/master | 2021-01-10T04:13:08.159295 | 2018-03-21T15:29:40 | 2018-03-21T15:29:40 | 49,559,376 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,440 | java | package com.guinea.communications.netty.webSocket;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;
import io.netty.handler.stream.ChunkedWriteHandler;
/**
* @title
* @author: shiky
* @describe:
* @date: 2016/7/7
*/
public class PlanTaskNettyInitialzer extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
// e.pipeline().addLast("frameDecoder", new
// LengthFieldBasedFrameDecoder(64, 0, 8,0,8));
// e.pipeline().addLast("frameEncoder", new LengthFieldPrepender(8));
// e.pipeline().addLast("frameDecoder", new
// DelimiterBasedFrameDecoder(1000, false,
// new ByteBuf[]{Unpooled.wrappedBuffer(new byte[]{'#'}),}));
// 用于解析http报文的handler
pipeline.addLast("decoder", new HttpRequestDecoder());
// 用于将解析出来的数据封装成http对象,httprequest什么的
pipeline.addLast("aggregator", new HttpObjectAggregator(256));
// 用于将response编码成httpresponse报文发送
pipeline.addLast("encoder", new HttpResponseEncoder());
/***
* HttpServerCodec它会将HTTP客户端请求转成HttpRequest对象,
* 将HttpResponse对象编码成HTTP响应发送给客户端
* (用了HttpRequestDecoder,HttpResponseEncoder就不用此方法)
*/
// e.pipeline().addLast("http-codec", new HttpServerCodec());
/***
* ChunkedWriteHandler 这个handler主要用于处理大数据流,
* 比如一个1G大小的文件如果你直接传输肯定会撑暴jvm内存的,增加ChunkedWriteHandler
* 这个handler我们就不用考虑这个问题了.
*/
pipeline.addLast("http-chunked", new ChunkedWriteHandler());
/***
* cp.addLast("writeTimeout", new WriteTimeoutHandler(new
* HashedWheelTimer(),10));
*/
// e.pipeline().addLast("writeTimeout", new WriteTimeoutHandler(10));
/***
* 自定义hander
*/
pipeline.addLast("handler", new PlanTaskNettyServerHandler());
}
}
| [
"ubhname@sina.com"
] | ubhname@sina.com |
fdfe558091bbcfad6397e59714492b7570cc7070 | ddd38972d2e73c464ee77024f6ba4d6e11aac97b | /platform/arcus-containers/scheduler-service/src/main/java/com/iris/service/scheduler/model/TimeOfDayScheduledCommand.java | 02e043812a1bd54628790004d457e86e3a7de913 | [
"Apache-2.0"
] | permissive | arcus-smart-home/arcusplatform | bc5a3bde6dc4268b9aaf9082c75482e6599dfb16 | a2293efa1cd8e884e6bedbe9c51bf29832ba8652 | refs/heads/master | 2022-04-27T02:58:20.720270 | 2021-09-05T01:36:12 | 2021-09-05T01:36:12 | 168,190,985 | 104 | 50 | Apache-2.0 | 2022-03-10T01:33:34 | 2019-01-29T16:49:10 | Java | UTF-8 | Java | false | false | 6,087 | java | /*
* Copyright 2019 Arcus 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.iris.service.scheduler.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.iris.common.rule.time.TimeOfDay;
import com.iris.common.time.DayOfWeek;
import com.iris.messages.errors.Errors;
import com.iris.messages.type.TimeOfDayCommand;
public class TimeOfDayScheduledCommand extends ScheduledCommand {
public enum Mode {
ABSOLUTE,
SUNRISE,
SUNSET;
}
public static TimeOfDayScheduledCommand fromMap(Map<String, Object> attributes) {
TimeOfDayCommand raw = new TimeOfDayCommand(attributes);
TimeOfDayScheduledCommand command = new TimeOfDayScheduledCommand();
command.setId(raw.getId());
command.setScheduleId(raw.getScheduleId());
if(!StringUtils.isEmpty(raw.getMessageType())) {
command.setMessageType(raw.getMessageType());
}
if(raw.getAttributes() != null) {
command.setAttributes(raw.getAttributes());
}
if(raw.getDays() != null) {
command.setDays(toDays(raw.getDays()));
}
if(!StringUtils.isEmpty(raw.getMode())) {
command.setMode(Mode.valueOf(raw.getMode()));
}
if(!StringUtils.isEmpty(raw.getTime())) {
command.setTime(TimeOfDay.fromString(raw.getTime()));
}
if(raw.getOffsetMinutes() != null) {
command.setOffsetMinutes(raw.getOffsetMinutes());
}
return command;
}
private static Set<DayOfWeek> toDays(Set<String> days) {
EnumSet<DayOfWeek> values = EnumSet.noneOf(DayOfWeek.class);
if(days == null || days.isEmpty()) {
return values;
}
for(String day: days) {
values.add(DayOfWeek.fromAbbr(day));
}
return values;
}
private Set<DayOfWeek> days;
private Mode mode;
private TimeOfDay time;
private Integer offsetMinutes;
public TimeOfDayScheduledCommand() {
// TODO Auto-generated constructor stub
}
/**
* @return the days
*/
public Set<DayOfWeek> getDays() {
return days;
}
/**
* @param days the days to set
*/
public void setDays(Set<DayOfWeek> days) {
this.days = days;
}
/**
* @return the mode
*/
public Mode getMode() {
return mode;
}
/**
* @param mode the mode to set
*/
public void setMode(Mode mode) {
this.mode = mode;
}
public boolean isAbsolute() {
return mode == Mode.ABSOLUTE;
}
/**
* @return the time
*/
public TimeOfDay getTime() {
return time;
}
/**
* @param time the time to set
*/
public void setTime(TimeOfDay time) {
this.time = time;
}
/**
* @return the offsetMinutes
*/
public Integer getOffsetMinutes() {
return offsetMinutes;
}
/**
* @param offsetMinutes the offsetMinutes to set
*/
public void setOffsetMinutes(Integer offsetMinutes) {
this.offsetMinutes = offsetMinutes;
}
public void validate() {
Errors.assertRequiredParam(this.getScheduleId(), TimeOfDayCommand.ATTR_SCHEDULEID);
if(this.getMode() == null || this.getMode() == Mode.ABSOLUTE) {
Errors.assertRequiredParam(this.getTime(), TimeOfDayCommand.ATTR_TIME);
Errors.assertValidRequest(this.getOffsetMinutes() == null || this.getOffsetMinutes() == 0, "May not specify non-zero offsetMinutes when mode is ABSOLUTE or unspecified.");
}
else {
Errors.assertRequiredParam(this.getOffsetMinutes(), TimeOfDayCommand.ATTR_OFFSETMINUTES);
Errors.assertValidRequest(this.getTime() == null, "May not specify time when mode is SUNRISE / SUNSET.");
}
Errors.assertRequiredParam(this.getDays(), TimeOfDayCommand.ATTR_DAYS);
Errors.assertRequiredParam(this.getAttributes(), TimeOfDayCommand.ATTR_ATTRIBUTES);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "TimeOfDayScheduledCommand [days=" + days + ", mode=" + mode
+ ", time=" + time + ", offsetMinutes=" + offsetMinutes + "]";
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((days == null) ? 0 : days.hashCode());
result = prime * result + ((mode == null) ? 0 : mode.hashCode());
result = prime * result
+ ((offsetMinutes == null) ? 0 : offsetMinutes.hashCode());
result = prime * result + ((time == null) ? 0 : time.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
TimeOfDayScheduledCommand other = (TimeOfDayScheduledCommand) obj;
if (days == null) {
if (other.days != null) return false;
}
else if (!days.equals(other.days)) return false;
if (mode != other.mode) return false;
if (offsetMinutes == null) {
if (other.offsetMinutes != null) return false;
}
else if (!offsetMinutes.equals(other.offsetMinutes)) return false;
if (time == null) {
if (other.time != null) return false;
}
else if (!time.equals(other.time)) return false;
return true;
}
}
| [
"b@yoyo.com"
] | b@yoyo.com |
6b5a85b2897ee46a078b8c5663ae1dc0ff6aeddd | 0cac9980ec4e2f852d8cbb92654a54f17d1c3aab | /ribbon/src/test/java/ribbon/service/RibbonApplicationTests.java | 87780972b63b1e3de3277994a4b8aa1ea3fec885 | [] | no_license | lishuper/springclouddemo | 45ea441c601ee72cfcba5252cbaa926c0b9f9264 | 2ddbe7d90243309e3c7dc771ca14c9f45edbfdb6 | refs/heads/master | 2020-05-17T18:41:05.267774 | 2019-05-08T09:10:16 | 2019-05-08T09:10:16 | 183,891,596 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package ribbon.service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class RibbonApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"xiaobin.wang@marketin.cn"
] | xiaobin.wang@marketin.cn |
79ee5712eae0dd9089886ad8309e3dc893543310 | 8421eaa5b1f7678dac49b7056df4cf5dba31d0f0 | /src/view/ResultListViewItem.java | c65af58cbf944796ae25e266a46a64f98cfc86ed | [] | no_license | stefanGT44/Concurrent-Word-Distribution-Tool | 7f3ba6aba77d0902d6616e99d19d03f7951a1aeb | ded7c08c292faa5680837cb3b12c57815cb9497d | refs/heads/master | 2022-12-20T19:40:24.043795 | 2020-09-15T23:09:53 | 2020-09-15T23:09:53 | 292,297,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | package view;
public class ResultListViewItem {
private String name;
public ResultListViewItem(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return this.name;
}
}
| [
"stefan@stefan"
] | stefan@stefan |
567ae6e6705060357c70d01675ac86ef51fdd54b | 90e305db5a991a927db29f18d5de1344f880b08b | /src/test/java/com/testdatabuilder/ParqueaderoTestDatabuilder.java | 02af1e69c37da22a9c5f484dc1eff5d3c7bcfe1d | [] | no_license | CarlosLopez900528/PracticaCeibaDos | ec591d1b489bbda701e847feba0dc6236d5631d6 | d2b855333f721abb70fe493391bea4d5a2d8d237 | refs/heads/master | 2021-07-11T15:42:26.078569 | 2017-10-10T03:07:59 | 2017-10-10T03:07:59 | 105,787,247 | 0 | 0 | null | 2017-10-10T03:08:00 | 2017-10-04T15:49:33 | Java | UTF-8 | Java | false | false | 1,327 | java | package com.testdatabuilder;
import java.util.Calendar;
import com.entities.Parqueo;
public class ParqueaderoTestDatabuilder {
private static final int IDCLASEVEHICULO = 1;
private static final String PLACAVEHICULO = "CJA083";
private static final int CILINDRAJE = 1800;
private static final Calendar FECHA_PARQUEO = Calendar.getInstance();;
private int idClaseVehiculo;
private String placaVehiculo;
private int cilindraje;
private Calendar fechaParqueo;
public ParqueaderoTestDatabuilder() {
this.idClaseVehiculo = IDCLASEVEHICULO;
this.placaVehiculo = PLACAVEHICULO;
this.cilindraje = CILINDRAJE;
this.fechaParqueo = FECHA_PARQUEO;
}
public ParqueaderoTestDatabuilder conidClaseVehiculo(int idClaseVehiculo) {
this.idClaseVehiculo = idClaseVehiculo;
return this;
}
public ParqueaderoTestDatabuilder conplacaVehiculo(String placaVehiculo) {
this.placaVehiculo = placaVehiculo;
return this;
}
public ParqueaderoTestDatabuilder concilindraje(int cilindraje) {
this.cilindraje = cilindraje;
return this;
}
public ParqueaderoTestDatabuilder confechaParqueo(Calendar fechaParqueo) {
this.fechaParqueo = fechaParqueo;
return this;
}
public Parqueo build() {
return new Parqueo(this.idClaseVehiculo, this.placaVehiculo, this.cilindraje, this.fechaParqueo);
}
}
| [
"carlos.lopez@ceiba.com.co"
] | carlos.lopez@ceiba.com.co |
d8e474574bfb421d909cbb4e80742666a665b325 | 9604db615d0a1b2e20dd7b42933abce6e72564a5 | /JavaAdvanced/16.FunctionalProgramming-Exercises/src/P08_SmallestElement.java | d33548f8a010a6f7c136cdf112096bbb7a968f8a | [] | no_license | mrindzhov/Software-University | 131bb27ef897e9748030a9473f70af63d920b248 | 6ee1ca55003ee02663793ab7e42d4ee84282f403 | refs/heads/master | 2020-03-19T01:19:19.597378 | 2018-05-31T22:09:06 | 2018-05-31T22:09:06 | 135,537,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;
public class P08_SmallestElement {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
List<Integer> integers = new ArrayList<>();
String line = scanner.nextLine();
scanner = new Scanner(line);
while (scanner.hasNextInt()) {
integers.add(scanner.nextInt());
}
Function<List<Integer>, Integer> smallestNum = elements -> {
int min=Integer.MAX_VALUE;
int index = 0;
for (int i = 0; i < elements.size(); i++) {
if(elements.get(i)<=min){
min=elements.get(i);
index=i;
}
}
return index;
};
System.out.println(smallestNum.apply(integers));
}
}
| [
"mrindzhov@gmail.com"
] | mrindzhov@gmail.com |
5f121a499563e6eb1de82d26be57b437cb8fd473 | 235e4ededf737d2835d365a7a1eacdd5ea2acfdc | /XSACore/src/org/bibalex/sdxe/suggest/model/particle/SugtnSequenceNode.java | b2f03f8bcf4785dbdef24860a7c8dfe082b11934 | [] | no_license | timeleft--/WAMCP | b29672dfbab7057abb0094568f6e92b6f2cf63fb | 4d172ab80aed3acd21590f89c2067bcd53e3fc92 | refs/heads/master | 2021-01-16T21:57:21.287247 | 2013-07-24T11:27:47 | 2013-07-24T11:27:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,248 | java | // Copyright 2013 Bibliotheca Alexandrina, Wellcome Trust Library
//
// 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.bibalex.sdxe.suggest.model.particle;
/**
* Class represents particle node of type SEQUENCE
*
*/
@SuppressWarnings("serial")
public class SugtnSequenceNode extends SugtnParticleNode {
/**
* Constructs a particle node of type SEQUENCE and sets user object to "Sequence"
*/
SugtnSequenceNode() {
super();
this.setUserObject("Sequence");
}
/**
* Invite method of the visitor design pattern.
*
* @param visitor
* Particle node visitor interface.
*
*/
@Override
public void invite(ISugtnParticleNodeVisitor visitor) {
visitor.sequenceNode(this);
}
}
| [
"michael.atef@bibalex.org"
] | michael.atef@bibalex.org |
fb71c860f9adb3e632e5815f45bd67092220b1ad | dfd3b94c341aa781f1c5be266080d03915226630 | /src/com/luv2code/springdemo/SetterDemoApp.java | ec95177aa851d8e46a2520e9b3ca2e2c4d502392 | [] | no_license | emadhanna/spring-demo-one | 3015bed3e00d0a9249082a4c8c857f39f091724d | e255a2ee98c386a493ad8b6258ad9d222e00fe85 | refs/heads/master | 2020-09-11T13:51:37.055157 | 2020-05-13T06:21:00 | 2020-05-13T06:21:00 | 222,069,920 | 0 | 0 | null | 2019-11-16T10:41:41 | 2019-11-16T08:33:04 | null | UTF-8 | Java | false | false | 741 | java | package com.luv2code.springdemo;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SetterDemoApp {
public static void main(String[] args) {
//Load the spring configuration file
ClassPathXmlApplicationContext theContext =
new ClassPathXmlApplicationContext("applicationContext.xml");
//Retrieve bean from spring container
CricketCoach theCoach = theContext.getBean("myCricketCoach", CricketCoach.class);
//Call methods on the bean
System.out.println(theCoach.getDailyWorkout());
System.out.println(theCoach.getDailyFortune());
System.out.println(theCoach.getEmailAddress());
System.out.println(theCoach.getTeam());
//Close the context
theContext.close();
}
}
| [
"Emad_Hanna@cable.comcast.com"
] | Emad_Hanna@cable.comcast.com |
bd1e8ecb37750fceeb542a5999acfefde3fb4a93 | 7ea61ee7003c5d8e27b9f02d0fc004f0bbe44562 | /lib/src/main/java/com/sd/lib/utils/FHandlerManager.java | 61adc8d960badad5f67d7dc3e41073dcada042b4 | [] | no_license | zj565061763/utils | c0bd1845a0255c268faa8f31733e98b71d2f0a13 | 3d0507184f9e4bd6f222224c73e077a9da98065c | refs/heads/master | 2021-06-03T14:06:18.425693 | 2021-05-26T07:55:37 | 2021-05-26T07:55:37 | 114,324,750 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package com.sd.lib.utils;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
/**
* Handler管理类
*/
public class FHandlerManager
{
private static final HandlerThread HANDLER_THREAD = new HandlerThread("HandlerThread");
static
{
HANDLER_THREAD.start();
}
private static final Handler MAIN_HANDLER = new Handler(Looper.getMainLooper());
private static final Handler BACKGROUND_HANDLER = new Handler(HANDLER_THREAD.getLooper());
private FHandlerManager()
{
}
/**
* 获得主线程Handler
*
* @return
*/
public final static Handler getMainHandler()
{
return MAIN_HANDLER;
}
/**
* 获得后台线程Handler
*
* @return
*/
public final static Handler getBackgroundHandler()
{
return BACKGROUND_HANDLER;
}
/**
* Ui线程执行
*
* @param runnable
*/
public static void runOnUiThread(Runnable runnable)
{
if (runnable == null)
return;
if (Looper.myLooper() == Looper.getMainLooper())
runnable.run();
else
MAIN_HANDLER.post(runnable);
}
}
| [
"565061763@qq.com"
] | 565061763@qq.com |
d056230f919d98e7d50618990b75a8147d479bad | b65304eb64570b73df8878f371bd5fe740dc1a62 | /app/src/main/java/com/angkorcab/fragments/ProfileFragment.java | 323e8512bf4dbbcad6d5c91ff438b867fb46511e | [] | no_license | ersalye/mobite-taxi | 8895bad4d466383724af8d60c6cafb559fd08541 | e2e6c4b686c6567ac83dee5f6bd1ed137e7bcfcc | refs/heads/master | 2021-06-11T23:33:07.206058 | 2017-02-13T11:03:38 | 2017-02-13T11:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,542 | java | package com.angkorcab.fragments;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.widget.ProgressBar;
import com.angkorcab.taxi.MainActivity;
import com.angkorcab.taxi.R;
import com.angkorcab.constants.ProjectURls;
import com.angkorcab.helper.MyWebViewClient;
import com.angkorcab.login.LoginDetails;
import com.angkorcab.utils.SharedPreferencesUtility;
public class ProfileFragment extends BaseFragment {
private Handler mHandler = new Handler();
WebView profile_web_view;
ProgressBar profileProgressupdateProfile;
Context context;
private static final String TAG = "ProfileFragment";
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_profile, null);
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(getResources().getString(R.string.item_one));
context = getActivity();
try {
Log.i(TAG,"working...");
Log.i(TAG, ProjectURls.getProfileUrl(SharedPreferencesUtility.loadUserEmail(context),
SharedPreferencesUtility.loadUserType(context)));
profileProgressupdateProfile = (ProgressBar) root.findViewById(R.id.progressBarupdateprofile);
profile_web_view = (WebView) root.findViewById(R.id.profile_webview);
MyWebViewClient.enableWebViewSettings(profile_web_view);
profile_web_view.addJavascriptInterface(new DemoJavaScriptInterface(context), "uploadpic");
profileProgressupdateProfile.setVisibility(View.GONE);
profile_web_view.setVisibility(View.VISIBLE);
profile_web_view.setWebViewClient(new MyWebViewClient(context));
profile_web_view.loadUrl(ProjectURls.getProfileUrl(SharedPreferencesUtility.loadUserEmail(context),
SharedPreferencesUtility.loadUserType(context)));
} catch (Exception e) {
e.printStackTrace();
}
return root;
}
final class DemoJavaScriptInterface {
DemoJavaScriptInterface(Context c) {
}
@JavascriptInterface
public void clickOnUploadPic() {
mHandler.post(new Runnable() {
public void run() {
replaceFragment(context, new UpdateProfilePictureFragment());
}
});
}
@JavascriptInterface
public void clickOnDriver(String fullname, String contact,
String cab_type, String cab_number) {
LoginDetails.CabType = Integer.parseInt(cab_number);
SharedPreferencesUtility.saveCabType(context, LoginDetails.CabType);
mHandler.post(new Runnable() {
public void run() {
}
});
}
}
@Override
protected void backPressed() {
try {
context.startActivity(new Intent(context, MainActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK));
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"phuongphally@gmail.com"
] | phuongphally@gmail.com |
468ff8044557d93a5f1fcdd22f2a6706b4a44deb | b71ac6338bb8b52564f48447936cc30972ff8bdb | /src/main/java/net/totaldarkness/ChestHistory/Main.java | d5314c8d337ead02cff354f3ece3a4b6515014fc | [
"Unlicense"
] | permissive | TotalDarkness-NRF/ChestHistory | 528599e6863b3a547ff40eeee44fd1a7ab69f066 | 6c0f2217090f8eea4cd5e8685e34414100b1f413 | refs/heads/main | 2023-03-22T02:51:02.364363 | 2021-03-06T04:36:40 | 2021-03-06T04:36:40 | 339,275,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,347 | java | package net.totaldarkness.ChestHistory;
import net.totaldarkness.ChestHistory.client.gui.ChestHistory;
import net.totaldarkness.ChestHistory.client.services.ChestGuiService;
import net.totaldarkness.ChestHistory.client.services.RenderEventService;
import net.totaldarkness.ChestHistory.client.events.KeyboardEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = "chesthistory", name = "Chest History", version = "0.0.1", acceptedMinecraftVersions = MinecraftForge.MC_VERSION, clientSideOnly = true)
public class Main {
@EventHandler
public void preInit(FMLPreInitializationEvent event) {}
@EventHandler
public void init(FMLInitializationEvent event) {
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new KeyboardEvent());
MinecraftForge.EVENT_BUS.register(new RenderEventService());
MinecraftForge.EVENT_BUS.register(new ChestHistory());
MinecraftForge.EVENT_BUS.register(new ChestGuiService());
}
} | [
"totaldarknesofficial@gmail.com"
] | totaldarknesofficial@gmail.com |
671f0938207dcf58dde6aed68148dbf4059a0221 | 348de4c617d1db7c8d697e717e0a21bce50cb995 | /haikudepotserver-webapp/src/test/java/org/haikuos/haikudepotserver/IntegrationTestSupportService.java | bb26a3af3150cf0d81a10dbf89d7a47cbf4f9a3a | [
"MIT"
] | permissive | diversys/haikudepotserver | c25409bfc9a48c13f533fe2467ca9281970482ea | 8dbd4090dae16f1810d66c610bd5f850a1c2b2fb | refs/heads/master | 2021-01-20T19:13:38.781356 | 2015-03-16T18:51:09 | 2015-03-16T18:51:09 | 32,403,687 | 0 | 0 | null | 2015-03-17T15:55:16 | 2015-03-17T15:55:16 | null | UTF-8 | Java | false | false | 16,003 | java | /*
* Copyright 2014-2015, Andrew Lindesay
* Distributed under the terms of the MIT License.
*/
package org.haikuos.haikudepotserver;
import com.google.common.base.Strings;
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.configuration.server.ServerRuntime;
import org.haikuos.haikudepotserver.dataobjects.*;
import org.haikuos.haikudepotserver.pkg.PkgOrchestrationService;
import org.haikuos.haikudepotserver.security.AuthenticationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.Collections;
/**
* <p>This class is designed to help out with creating some common test data that can be re-used between tests.</p>
*/
@Service
public class IntegrationTestSupportService {
protected static Logger LOGGER = LoggerFactory.getLogger(IntegrationTestSupportService.class);
@Resource
ServerRuntime serverRuntime;
@Resource
PkgOrchestrationService pkgOrchestrationService;
@Resource
PkgOrchestrationService pkgService;
@Resource
protected AuthenticationService authenticationService;
private ObjectContext objectContext = null;
public ObjectContext getObjectContext() {
if(null==objectContext) {
objectContext = serverRuntime.getContext();
}
return objectContext;
}
private PkgScreenshot addPkgScreenshot(ObjectContext objectContext, Pkg pkg) {
try (InputStream inputStream = IntegrationTestSupportService.class.getResourceAsStream("/sample-320x240.png")) {
return pkgService.storePkgScreenshotImage(inputStream, objectContext, pkg);
}
catch(Exception e) {
throw new IllegalStateException("an issue has arisen loading a sample screenshot into a test package",e);
}
}
private void addPngPkgIcon(ObjectContext objectContext, Pkg pkg, int size) {
try (InputStream inputStream = this.getClass().getResourceAsStream(String.format("/sample-%dx%d.png", size, size))) {
pkgService.storePkgIconImage(
inputStream,
MediaType.getByCode(objectContext, com.google.common.net.MediaType.PNG.toString()).get(),
size,
objectContext,
pkg);
}
catch(Exception e) {
throw new IllegalStateException("an issue has arisen loading an icon",e);
}
}
private void addHvifPkgIcon(ObjectContext objectContext, Pkg pkg) {
try (InputStream inputStream = this.getClass().getResourceAsStream("/sample.hvif")) {
pkgService.storePkgIconImage(
inputStream,
MediaType.getByCode(objectContext, MediaType.MEDIATYPE_HAIKUVECTORICONFILE).get(),
null,
objectContext,
pkg);
}
catch(Exception e) {
throw new IllegalStateException("an issue has arisen loading an icon",e);
}
}
private void addPkgIcons(ObjectContext objectContext, Pkg pkg) {
addPngPkgIcon(objectContext, pkg, 16);
addPngPkgIcon(objectContext, pkg, 32);
addHvifPkgIcon(objectContext, pkg);
}
public void addDummyLocalization(ObjectContext context, PkgVersion pkgVersion) {
PkgVersionLocalization pkgVersionLocalization = context.newObject(PkgVersionLocalization.class);
pkgVersionLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get());
pkgVersionLocalization.setDescription("sample description");
pkgVersionLocalization.setSummary("sample summary");
pkgVersion.addToManyTarget(PkgVersion.PKG_VERSION_LOCALIZATIONS_PROPERTY, pkgVersionLocalization, true);
}
public StandardTestData createStandardTestData() {
LOGGER.info("will create standard test data");
String platformTmpDirPath = System.getProperty("java.io.tmpdir");
if (Strings.isNullOrEmpty(platformTmpDirPath)) {
throw new IllegalStateException("unable to get the java temporary directory");
}
ObjectContext context = getObjectContext();
StandardTestData result = new StandardTestData();
Prominence prominence = Prominence.getByOrdering(context, Prominence.ORDERING_LAST).get();
Architecture x86 = Architecture.getByCode(context, "x86").get();
Architecture x86_gcc2 = Architecture.getByCode(context, "x86_gcc2").get();
Architecture any = Architecture.getByCode(context, "any").get();
result.repository = context.newObject(Repository.class);
result.repository.setActive(Boolean.TRUE);
result.repository.setCode("testrepository");
result.repository.setArchitecture(x86);
result.repository.setUrl("file://" + platformTmpDirPath + "/repository");
result.pkg1 = context.newObject(Pkg.class);
result.pkg1.setActive(true);
result.pkg1.setName("pkg1");
result.pkg1.setDerivedRating(3.5f);
result.pkg1.setDerivedRatingSampleSize(4);
result.pkg1.setProminence(prominence);
{
PkgPkgCategory pkgPkgCategory = context.newObject(PkgPkgCategory.class);
result.pkg1.addToManyTarget(Pkg.PKG_PKG_CATEGORIES_PROPERTY, pkgPkgCategory, true);
pkgPkgCategory.setPkgCategory(PkgCategory.getByCode(context, "graphics").get());
}
{
PkgLocalization pkgLocalization = context.newObject(PkgLocalization.class);
pkgLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get());
pkgLocalization.setTitle("Package 1");
pkgLocalization.setPkg(result.pkg1);
}
{
PkgLocalization pkgLocalization = context.newObject(PkgLocalization.class);
pkgLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_GERMAN).get());
pkgLocalization.setTitle("Packet 1");
pkgLocalization.setPkg(result.pkg1);
}
{
PkgLocalization pkgLocalization = context.newObject(PkgLocalization.class);
pkgLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_SPANISH).get());
pkgLocalization.setTitle("Ping 1");
pkgLocalization.setPkg(result.pkg1);
}
addPkgScreenshot(context,result.pkg1);
addPkgScreenshot(context,result.pkg1);
addPkgScreenshot(context,result.pkg1);
addPkgIcons(context, result.pkg1);
result.pkg1Version1x86 = context.newObject(PkgVersion.class);
result.pkg1Version1x86.setActive(Boolean.FALSE);
result.pkg1Version1x86.setArchitecture(x86);
result.pkg1Version1x86.setMajor("1");
result.pkg1Version1x86.setMicro("2");
result.pkg1Version1x86.setRevision(3);
result.pkg1Version1x86.setIsLatest(false);
result.pkg1Version1x86.setPkg(result.pkg1);
result.pkg1Version1x86.setRepository(result.repository);
addDummyLocalization(context, result.pkg1Version1x86);
result.pkg1Version2x86 = context.newObject(PkgVersion.class);
result.pkg1Version2x86.setActive(Boolean.TRUE);
result.pkg1Version2x86.setArchitecture(x86);
result.pkg1Version2x86.setMajor("1");
result.pkg1Version2x86.setMicro("2");
result.pkg1Version2x86.setRevision(4);
result.pkg1Version2x86.setIsLatest(true);
result.pkg1Version2x86.setPkg(result.pkg1);
result.pkg1Version2x86.setRepository(result.repository);
{
PkgVersionLocalization pkgVersionLocalization = context.newObject(PkgVersionLocalization.class);
pkgVersionLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get());
pkgVersionLocalization.setDescription("pkg1Version2DescriptionEnglish_rockmelon");
pkgVersionLocalization.setSummary("pkg1Version2SummaryEnglish_persimon");
result.pkg1Version2x86.addToManyTarget(PkgVersion.PKG_VERSION_LOCALIZATIONS_PROPERTY, pkgVersionLocalization, true);
}
{
PkgVersionLocalization pkgVersionLocalization = context.newObject(PkgVersionLocalization.class);
pkgVersionLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_SPANISH).get());
pkgVersionLocalization.setDescription("pkg1Version2DescriptionSpanish_mango");
pkgVersionLocalization.setSummary("pkg1Version2SummarySpanish_feijoa");
result.pkg1Version2x86.addToManyTarget(PkgVersion.PKG_VERSION_LOCALIZATIONS_PROPERTY, pkgVersionLocalization, true);
}
result.pkg1Version2x86_gcc2 = context.newObject(PkgVersion.class);
result.pkg1Version2x86_gcc2.setActive(Boolean.TRUE);
result.pkg1Version2x86_gcc2.setArchitecture(x86_gcc2);
result.pkg1Version2x86_gcc2.setMajor("1");
result.pkg1Version2x86_gcc2.setMicro("2");
result.pkg1Version2x86_gcc2.setRevision(4);
result.pkg1Version2x86_gcc2.setIsLatest(true);
result.pkg1Version2x86_gcc2.setPkg(result.pkg1);
result.pkg1Version2x86_gcc2.setRepository(result.repository);
// this is the same as the x86 version so that comparisons with English will happen.
{
PkgVersionLocalization pkgVersionLocalization = context.newObject(PkgVersionLocalization.class);
pkgVersionLocalization.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get());
pkgVersionLocalization.setDescription("pkg1Version2DescriptionEnglish_guava");
pkgVersionLocalization.setSummary("pkg1Version2SummaryEnglish_apple");
result.pkg1Version2x86_gcc2.addToManyTarget(PkgVersion.PKG_VERSION_LOCALIZATIONS_PROPERTY, pkgVersionLocalization, true);
}
result.pkg2 = context.newObject(Pkg.class);
result.pkg2.setActive(true);
result.pkg2.setName("pkg2");
result.pkg2.setProminence(prominence);
result.pkg2Version1 = context.newObject(PkgVersion.class);
result.pkg2Version1.setActive(Boolean.TRUE);
result.pkg2Version1.setArchitecture(x86);
result.pkg2Version1.setMajor("1");
result.pkg2Version1.setMinor("1");
result.pkg2Version1.setMicro("2");
result.pkg2Version1.setRevision(3);
result.pkg2Version1.setIsLatest(true);
result.pkg2Version1.setPkg(result.pkg2);
result.pkg2Version1.setRepository(result.repository);
addDummyLocalization(context, result.pkg2Version1);
result.pkg3 = context.newObject(Pkg.class);
result.pkg3.setActive(true);
result.pkg3.setName("pkg3");
result.pkg3.setProminence(prominence);
result.pkg3Version1 = context.newObject(PkgVersion.class);
result.pkg3Version1.setActive(Boolean.TRUE);
result.pkg3Version1.setArchitecture(x86);
result.pkg3Version1.setMajor("1");
result.pkg3Version1.setMinor("1");
result.pkg3Version1.setMicro("2");
result.pkg3Version1.setRevision(3);
result.pkg3Version1.setIsLatest(true);
result.pkg3Version1.setPkg(result.pkg3);
result.pkg3Version1.setRepository(result.repository);
addDummyLocalization(context, result.pkg3Version1);
result.pkgAny = context.newObject(Pkg.class);
result.pkgAny.setActive(true);
result.pkgAny.setName("pkgany");
result.pkgAny.setProminence(prominence);
result.pkgAnyVersion1 = context.newObject(PkgVersion.class);
result.pkgAnyVersion1.setActive(Boolean.TRUE);
result.pkgAnyVersion1.setArchitecture(any);
result.pkgAnyVersion1.setMajor("123");
result.pkgAnyVersion1.setMicro("123");
result.pkgAnyVersion1.setRevision(3);
result.pkgAnyVersion1.setIsLatest(true);
result.pkgAnyVersion1.setPkg(result.pkgAny);
result.pkgAnyVersion1.setRepository(result.repository);
addDummyLocalization(context, result.pkgAnyVersion1);
context.commitChanges();
LOGGER.info("did create standard test data");
return result;
}
public User createBasicUser(ObjectContext context, String nickname, String password) {
User user = context.newObject(User.class);
user.setNickname(nickname);
user.setPasswordSalt(); // random
user.setPasswordHash(authenticationService.hashPassword(user, password));
user.setNaturalLanguage(NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get());
context.commitChanges();
return user;
}
/**
* <p>This will create a known user and a known set of user ratings that can be tested against.
* This method expected that the standard test data has already been introduced into the
* environment prior.</p>
*/
public void createUserRatings() {
ObjectContext context = serverRuntime.getContext();
Pkg pkg = Pkg.getByName(context, "pkg3").get();
Architecture x86 = Architecture.getByCode(context, "x86").get();
PkgVersion pkgVersion = pkgOrchestrationService.getLatestPkgVersionForPkg(context, pkg, Collections.singletonList(x86)).get();
NaturalLanguage english = NaturalLanguage.getByCode(context, NaturalLanguage.CODE_ENGLISH).get();
{
User user = createBasicUser(context, "urtest1", "password");
{
UserRating userRating = context.newObject(UserRating.class);
userRating.setRating((short) 5);
userRating.setUser(user);
userRating.setNaturalLanguage(english);
userRating.setPkgVersion(pkgVersion);
userRating.setComment("Southern hemisphere winter");
userRating.setCode("ABCDEF"); // known code that can be used for reference later
}
}
{
User user = createBasicUser(context, "urtest2", "password");
{
UserRating userRating = context.newObject(UserRating.class);
userRating.setRating((short) 3);
userRating.setUser(user);
userRating.setNaturalLanguage(english);
userRating.setPkgVersion(pkgVersion);
userRating.setComment("Winter banana apples");
userRating.setCode("GHIJKL"); // known code that can be used for reference later
userRating.setUserRatingStability(UserRatingStability.getByCode(context, UserRatingStability.CODE_UNSTABLEBUTUSABLE).get());
}
}
{
User user = createBasicUser(context, "urtest3", "password");
{
UserRating userRating = context.newObject(UserRating.class);
userRating.setRating((short) 1);
userRating.setUser(user);
userRating.setActive(false);
userRating.setNaturalLanguage(english);
userRating.setPkgVersion(pkgVersion);
userRating.setComment("Kingston black apples");
userRating.setCode("MNOPQR"); // known code that can be used for reference later
}
}
context.commitChanges();
}
/**
* <p>This class is a container that carries some basic test-case data.</p>
*/
public static class StandardTestData {
public Repository repository;
public Pkg pkg1;
public PkgVersion pkg1Version1x86;
public PkgVersion pkg1Version2x86;
public PkgVersion pkg1Version2x86_gcc2;
public Pkg pkg2;
public PkgVersion pkg2Version1;
public Pkg pkg3;
public PkgVersion pkg3Version1;
public Pkg pkgAny;
public PkgVersion pkgAnyVersion1;
}
}
| [
"apl@lindesay.co.nz"
] | apl@lindesay.co.nz |
881c24b147c38cdc5b2d0b6df689c1dbfdaeb6b5 | 64e88841921c6280608ca77fcc4b757bfa6768bd | /SpringBootCRUD/src/main/java/com/springbootproject/ProductRepository.java | d0db15292fd04e711ca6e59065a72e4e1856696c | [] | no_license | irya29/TesRespository | 83c88dcf5a70b5f9f2c0c4125cf127f7efd8e3cd | 7c9945722d1677504ee8232a9bdb364ecb18cb64 | refs/heads/master | 2020-08-27T00:58:48.000117 | 2019-10-24T03:02:31 | 2019-10-24T03:02:31 | 217,199,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package com.springbootproject;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ProductRepository extends JpaRepository<Product, Long>{
}
| [
"training@TRAINING7"
] | training@TRAINING7 |
8d0bde7d693c68750e62c88495c5b43e42937721 | 0dbff67032029495d1fce23dff122eeb4806fa2e | /src/kankan/wheel/widget/.svn/text-base/ArrayWheelAdapter.java.svn-base | fa01ddb42e4b744e29658c8fa639ee08ea3202de | [] | no_license | liuyijiang1994/znufe_app | 2d1273231b3238589850e813fac35f8468f67ef8 | 46f76edc857d470065e094639e27c8f3b5750784 | refs/heads/master | 2020-12-25T15:17:39.997906 | 2019-06-19T08:01:12 | 2019-06-19T08:01:12 | 65,866,458 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | /*
* Copyright 2010 Yuri Kanivets
*
* 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 kankan.wheel.widget;
/**
* The simple Array wheel adapter
* @param <T> the element type
*/
public class ArrayWheelAdapter<T> implements WheelAdapter {
/** The default items length */
public static final int DEFAULT_LENGTH = -1;
// items
private T items[];
// length
private int length;
/**
* Constructor
* @param items the items
* @param length the max items length
*/
public ArrayWheelAdapter(T items[], int length) {
this.items = items;
this.length = length;
}
/**
* Contructor
* @param items the items
*/
public ArrayWheelAdapter(T items[]) {
this(items, DEFAULT_LENGTH);
}
@Override
public String getItem(int index) {
if (index >= 0 && index < items.length) {
return items[index].toString();
}
return null;
}
@Override
public int getItemsCount() {
return items.length;
}
@Override
public int getMaximumLength() {
return length;
}
}
| [
"etwxyet2"
] | etwxyet2 | |
2522da23063371556f13c8ebbb4290f2d31a4b94 | a8c5b7b04eace88b19b5a41a45f1fb030df393e3 | /projects/core/src/test/java/com/opengamma/core/convention/ConventionTypeTest.java | 7b5cc06bf06d7b15f98121da85cfa1ec73a1db49 | [
"Apache-2.0"
] | permissive | McLeodMoores/starling | 3f6cfe89cacfd4332bad4861f6c5d4648046519c | 7ae0689e06704f78fd9497f8ddb57ee82974a9c8 | refs/heads/master | 2022-12-04T14:02:00.480211 | 2020-04-28T17:22:44 | 2020-04-28T17:22:44 | 46,577,620 | 4 | 4 | Apache-2.0 | 2022-11-24T07:26:39 | 2015-11-20T17:48:10 | Java | UTF-8 | Java | false | false | 1,343 | java | /**
* Copyright (C) 2018 - present McLeod Moores Software Limited. All rights reserved.
*/
package com.opengamma.core.convention;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import org.testng.annotations.Test;
import com.opengamma.util.test.TestGroup;
/**
* Tests for {@link ConventionType}.
*/
@Test(groups = TestGroup.UNIT)
public class ConventionTypeTest {
private static final String NAME = "NAME";
/**
* Tests the object.
*/
@Test
public void test() {
final ConventionType type = ConventionType.of(NAME);
assertEquals(type, type);
assertNotEquals(null, type);
assertNotEquals(NAME, type);
assertEquals(type.getName(), NAME);
assertEquals(type.toString(), NAME);
ConventionType other = ConventionType.of(NAME);
assertEquals(type, other);
assertEquals(type.hashCode(), other.hashCode());
other = ConventionType.of(NAME.substring(1));
assertNotEquals(type, other);
}
/**
* Tests the compareTo method.
*/
@Test
public void testCompareTo() {
final ConventionType type = ConventionType.of(NAME);
assertEquals(type.compareTo(ConventionType.of(NAME)), 0);
assertNotEquals(type.compareTo(ConventionType.of("a" + NAME)), 0);
assertNotEquals(type.compareTo(ConventionType.of("z" + NAME)), 0);
}
}
| [
"em.mcleod@gmail.com"
] | em.mcleod@gmail.com |
623f76a9bb2c7f2b05ca1ce027b3dfce2f529eb6 | e5a11b5fd86bc6d4a4c18ec7ab4e20f2976d82d9 | /Design principles Practice Check/DP Practice check 1/src/com/practicecheck/abstractfactory/IndiaCarFactory.java | ebcf49ad7c3e96f3b41232a05a81bf616f3b222e | [] | no_license | G-16-17/Gowthami_Bankuru_921629_16 | 24ef6a9e0a9560c330cf6864bb35c70691853451 | 338b173e9405cf816bcf63f2163c2511d8a8fb98 | refs/heads/main | 2023-08-24T06:38:34.883496 | 2021-09-29T09:05:46 | 2021-09-29T09:05:46 | 395,289,945 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package com.practicecheck.abstractfactory;
public class IndiaCarFactory {
public Car buildCar(CarType carType) {
switch (carType) {
case LUXURY:
return new LuxuryCar(Location.INDIA);
case MINI:
return new MiniCar(Location.INDIA);
case MICRO:
return new MicroCar(Location.INDIA);
}
return null;
}
}
| [
"83955297+Gowthami98@users.noreply.github.com"
] | 83955297+Gowthami98@users.noreply.github.com |
d655b2878b7e5f6332ee9aea457bd9bf61f034da | 594c8f2ceaba206714692086b2426e13e0be929a | /src/main/java/com/example/chain/FaceFilter.java | 8e5bab1dd50c4f3229468a2def5f99ccd835bf1f | [] | no_license | haohaodiniyao/design_pattern | fa16bf939b62a4d27960129bed4800518a4e7487 | 088071e76be29c2549905b65896dec73c0d6a54b | refs/heads/master | 2020-08-31T07:46:55.706058 | 2017-07-06T06:59:45 | 2017-07-06T06:59:45 | 94,394,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.example.chain;
/**
* Created by yaokai on 2017/6/16.
*/
public class FaceFilter implements Filter{
public void doFilter(Request request, Response response, FilterChain filterChain) {
request.setRequestStr(request.getRequestStr().replace(":):","^V^")+"####FaceFilter()");
filterChain.doFilter(request,response,filterChain);
response.setResponseStr(response.getResponseStr()+"####FaceFilter()");
}
}
| [
"yaokaiabc@gmail.com"
] | yaokaiabc@gmail.com |
11558a9198c13ebdb43810600d243083c3085ec1 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Csv-8/org.apache.commons.csv.CSVFormat/BBC-F0-opt-60/tests/14/org/apache/commons/csv/CSVFormat_ESTest.java | fa65f290323f0684c929c316195308e412d46c47 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 76,527 | java | /*
* This file was automatically generated by EvoSuite
* Wed Oct 20 21:44:56 GMT 2021
*/
package org.apache.commons.csv;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.io.Reader;
import java.io.StringReader;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.Quote;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class CSVFormat_ESTest extends CSVFormat_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withDelimiter('?');
CSVFormat cSVFormat2 = cSVFormat1.withCommentStart(';');
cSVFormat2.validate();
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isNullHandling());
assertEquals(';', (char)cSVFormat2.getCommentStart());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat1.isQuoting());
assertEquals('?', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test001() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
Character character0 = Character.valueOf('%');
CSVFormat cSVFormat1 = cSVFormat0.withEscape(character0);
assertFalse(cSVFormat1.isCommentingEnabled());
cSVFormat1.validate();
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertEquals('%', (char)cSVFormat1.getEscape());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test002() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.RFC4180.withRecordSeparator('9');
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isEscaping());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(boolean0);
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals("9", cSVFormat1.getRecordSeparator());
assertFalse(cSVFormat1.isNullHandling());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test003() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("z 7Y~Q7AwON=d!");
CSVFormat cSVFormat2 = cSVFormat1.withSkipHeaderRecord(false);
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertEquals("\r\n", cSVFormat2.getRecordSeparator());
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat2.isEscaping());
assertEquals("z 7Y~Q7AwON=d!", cSVFormat2.getNullString());
}
@Test(timeout = 4000)
public void test004() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('R');
CSVFormat cSVFormat2 = cSVFormat1.withSkipHeaderRecord(false);
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertEquals('R', (char)cSVFormat2.getCommentStart());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isNullHandling());
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
}
@Test(timeout = 4000)
public void test005() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
CSVFormat cSVFormat2 = cSVFormat1.withRecordSeparator("");
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat2.isEscaping());
assertEquals(',', cSVFormat1.getDelimiter());
assertEquals("\r\n", cSVFormat1.getRecordSeparator());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals("", cSVFormat1.getNullString());
}
@Test(timeout = 4000)
public void test006() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('l');
CSVFormat cSVFormat2 = cSVFormat1.withRecordSeparator('l');
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.equals((Object)cSVFormat1));
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
assertFalse(cSVFormat2.isNullHandling());
assertEquals('l', (char)cSVFormat2.getCommentStart());
assertEquals("l", cSVFormat2.getRecordSeparator());
}
@Test(timeout = 4000)
public void test007() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withRecordSeparator('=');
assertEquals("=", cSVFormat2.getRecordSeparator());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.equals((Object)cSVFormat1));
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isCommentingEnabled());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isNullHandling());
}
@Test(timeout = 4000)
public void test008() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('z');
CSVFormat cSVFormat1 = cSVFormat0.withNullString(":Td8q?O4uX_68{-r");
Quote quote0 = Quote.ALL;
CSVFormat cSVFormat2 = cSVFormat1.withQuotePolicy(quote0);
assertTrue(cSVFormat2.isNullHandling());
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertEquals('z', cSVFormat2.getDelimiter());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test009() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Quote quote0 = Quote.ALL;
CSVFormat cSVFormat1 = cSVFormat0.withQuotePolicy(quote0);
assertFalse(cSVFormat1.isQuoting());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('\t', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test010() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = new Character('C');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart(character0);
Quote quote0 = Quote.ALL;
CSVFormat cSVFormat2 = cSVFormat1.withQuotePolicy(quote0);
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isEscaping());
assertEquals('C', (char)cSVFormat2.getCommentStart());
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test011() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar((Character) null);
assertTrue(cSVFormat1.equals((Object)cSVFormat0));
}
@Test(timeout = 4000)
public void test012() throws Throwable {
Character character0 = Character.valueOf('z');
CSVFormat cSVFormat0 = CSVFormat.newFormat('z');
CSVFormat cSVFormat1 = cSVFormat0.withNullString(":Td8q?O4uX_68{-r");
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar(character0);
assertEquals('z', cSVFormat2.getDelimiter());
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertTrue(cSVFormat2.isNullHandling());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test013() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Character character0 = new Character('1');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('C');
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar(character0);
assertEquals('\t', cSVFormat1.getDelimiter());
assertEquals('\\', (char)cSVFormat2.getEscape());
assertEquals('C', (char)cSVFormat2.getCommentStart());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('1', (char)cSVFormat2.getQuoteChar());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test014() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
Character character0 = Character.valueOf('z');
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar(character0);
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isEscaping());
}
@Test(timeout = 4000)
public void test015() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('3');
CSVFormat cSVFormat1 = cSVFormat0.withNullString("@U1=rw8)y~w-_o");
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar('3');
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertEquals('3', (char)cSVFormat2.getQuoteChar());
assertEquals('3', cSVFormat2.getDelimiter());
assertTrue(cSVFormat2.isNullHandling());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test016() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withNullString((String) null);
assertTrue(cSVFormat1.equals((Object)cSVFormat0));
}
@Test(timeout = 4000)
public void test017() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withNullString("");
assertEquals("", cSVFormat2.getNullString());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals("\r\n", cSVFormat2.getRecordSeparator());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.isCommentingEnabled());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat2.isQuoting());
}
@Test(timeout = 4000)
public void test018() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreSurroundingSpaces(true);
assertTrue(cSVFormat2.getIgnoreSurroundingSpaces());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.equals((Object)cSVFormat1));
assertTrue(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test019() throws Throwable {
Character character0 = new Character('1');
CSVFormat cSVFormat0 = CSVFormat.newFormat('1');
CSVFormat cSVFormat1 = cSVFormat0.withEscape(character0);
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreEmptyLines(false);
assertTrue(cSVFormat2.isEscaping());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isQuoting());
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertEquals('1', cSVFormat2.getDelimiter());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test020() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('3');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('3');
CSVFormat cSVFormat2 = cSVFormat1.withNullString("@U1=rw8)y~w-_o");
CSVFormat cSVFormat3 = cSVFormat2.withIgnoreEmptyLines(false);
assertTrue(cSVFormat3.equals((Object)cSVFormat2));
assertFalse(cSVFormat3.isQuoting());
assertTrue(cSVFormat3.isCommentingEnabled());
assertTrue(cSVFormat3.isNullHandling());
assertEquals('3', (char)cSVFormat3.getCommentStart());
assertFalse(cSVFormat3.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat3.isEscaping());
assertEquals('3', cSVFormat3.getDelimiter());
assertFalse(cSVFormat3.getIgnoreEmptyLines());
assertFalse(cSVFormat3.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test021() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar('Y');
Quote quote0 = Quote.NONE;
CSVFormat cSVFormat3 = cSVFormat2.withQuotePolicy(quote0);
CSVFormat cSVFormat4 = cSVFormat3.withIgnoreEmptyLines(false);
assertTrue(cSVFormat4.equals((Object)cSVFormat3));
assertTrue(cSVFormat4.isQuoting());
assertTrue(cSVFormat4.getSkipHeaderRecord());
assertFalse(cSVFormat4.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat4.isNullHandling());
assertFalse(cSVFormat4.isCommentingEnabled());
assertFalse(cSVFormat4.isEscaping());
assertEquals('Y', (char)cSVFormat4.getQuoteChar());
assertFalse(cSVFormat4.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test022() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
String[] stringArray0 = new String[5];
CSVFormat cSVFormat2 = cSVFormat1.withHeader(stringArray0);
assertEquals("\r\n", cSVFormat2.getRecordSeparator());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals("", cSVFormat2.getNullString());
}
@Test(timeout = 4000)
public void test023() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('l');
CSVFormat cSVFormat2 = cSVFormat1.withHeader((String[]) null);
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertFalse(cSVFormat2.isEscaping());
assertEquals('l', (char)cSVFormat2.getCommentStart());
assertTrue(cSVFormat2.isQuoting());
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
assertFalse(cSVFormat2.isNullHandling());
}
@Test(timeout = 4000)
public void test024() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
String[] stringArray0 = new String[6];
CSVFormat cSVFormat2 = cSVFormat1.withHeader(stringArray0);
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test025() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreEmptyLines(true);
Character character0 = Character.valueOf('%');
CSVFormat cSVFormat3 = cSVFormat2.withEscape(character0);
assertFalse(cSVFormat3.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat3.equals((Object)cSVFormat2));
assertTrue(cSVFormat2.isQuoting());
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertEquals("", cSVFormat3.getNullString());
assertEquals(',', cSVFormat3.getDelimiter());
assertEquals("\r\n", cSVFormat3.getRecordSeparator());
assertFalse(cSVFormat3.getSkipHeaderRecord());
assertFalse(cSVFormat3.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test026() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withEscape((Character) null);
assertTrue(cSVFormat2.getSkipHeaderRecord());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(cSVFormat2.isCommentingEnabled());
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test027() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
Character character0 = new Character('b');
CSVFormat cSVFormat1 = cSVFormat0.withEscape(character0);
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.isEscaping());
assertEquals('b', (char)cSVFormat1.getEscape());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\t', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test028() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreEmptyLines(true);
CSVFormat cSVFormat3 = cSVFormat2.withEscape(':');
assertTrue(cSVFormat3.isEscaping());
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertFalse(cSVFormat3.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat3.isCommentingEnabled());
assertEquals("\r\n", cSVFormat3.getRecordSeparator());
assertTrue(cSVFormat2.isQuoting());
assertEquals("", cSVFormat3.getNullString());
assertEquals(',', cSVFormat3.getDelimiter());
assertEquals(':', (char)cSVFormat3.getEscape());
assertFalse(cSVFormat3.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test029() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withEscape('y');
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('y', (char)cSVFormat1.getEscape());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test030() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("pr&r1}H");
CSVFormat cSVFormat2 = cSVFormat1.withDelimiter('/');
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals("pr&r1}H", cSVFormat2.getNullString());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isCommentingEnabled());
assertEquals('/', cSVFormat2.getDelimiter());
assertEquals("\r\n", cSVFormat2.getRecordSeparator());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test031() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('{');
CSVFormat cSVFormat2 = cSVFormat1.withDelimiter('{');
assertFalse(cSVFormat2.isEscaping());
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals('{', cSVFormat2.getDelimiter());
assertEquals('{', (char)cSVFormat2.getCommentStart());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isNullHandling());
assertTrue(cSVFormat2.isQuoting());
}
@Test(timeout = 4000)
public void test032() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withDelimiter('^');
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertEquals('^', cSVFormat2.getDelimiter());
assertFalse(cSVFormat2.isQuoting());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.isNullHandling());
}
@Test(timeout = 4000)
public void test033() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withDelimiter('e');
assertEquals('e', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test034() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('z');
CSVFormat cSVFormat1 = cSVFormat0.withNullString(":Td8q?O4uX_68{-r");
CSVFormat cSVFormat2 = cSVFormat1.withCommentStart((Character) null);
assertTrue(cSVFormat2.isNullHandling());
assertTrue(cSVFormat2.equals((Object)cSVFormat1));
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals('z', cSVFormat2.getDelimiter());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test035() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
Character character0 = new Character('l');
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withCommentStart(character0);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertEquals('\t', cSVFormat1.getDelimiter());
assertEquals('\\', (char)cSVFormat1.getEscape());
assertTrue(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test036() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
Character character0 = new Character('?');
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar(character0);
Quote quote0 = Quote.NON_NUMERIC;
CSVFormat cSVFormat3 = cSVFormat2.withQuotePolicy(quote0);
CSVFormat cSVFormat4 = cSVFormat3.withCommentStart(character0);
assertFalse(cSVFormat3.getIgnoreEmptyLines());
assertFalse(cSVFormat3.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat3.isCommentingEnabled());
assertTrue(cSVFormat3.getSkipHeaderRecord());
assertFalse(cSVFormat4.isNullHandling());
assertFalse(cSVFormat4.isEscaping());
assertEquals(',', cSVFormat3.getDelimiter());
assertTrue(cSVFormat3.isQuoting());
}
@Test(timeout = 4000)
public void test037() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("`&f<`.3t$UR");
CSVFormat cSVFormat2 = cSVFormat1.withRecordSeparator('d');
CSVFormat cSVFormat3 = cSVFormat2.withCommentStart(')');
assertTrue(cSVFormat3.getIgnoreEmptyLines());
assertTrue(cSVFormat3.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat3.isEscaping());
assertFalse(cSVFormat3.getSkipHeaderRecord());
assertEquals(')', (char)cSVFormat3.getCommentStart());
assertEquals("`&f<`.3t$UR", cSVFormat3.getNullString());
assertEquals("d", cSVFormat3.getRecordSeparator());
assertEquals('\t', cSVFormat3.getDelimiter());
}
@Test(timeout = 4000)
public void test038() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
CSVFormat cSVFormat2 = cSVFormat1.withCommentStart('0');
CSVFormat cSVFormat3 = cSVFormat2.withRecordSeparator((String) null);
CSVFormat cSVFormat4 = cSVFormat3.withEscape('0');
assertEquals(',', cSVFormat3.getDelimiter());
assertEquals('0', (char)cSVFormat4.getEscape());
assertEquals('\"', (char)cSVFormat4.getQuoteChar());
assertTrue(cSVFormat3.getSkipHeaderRecord());
assertFalse(cSVFormat3.isEscaping());
assertFalse(cSVFormat3.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat3.equals((Object)cSVFormat2));
assertFalse(cSVFormat2.isNullHandling());
assertEquals('0', (char)cSVFormat4.getCommentStart());
assertFalse(cSVFormat3.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test039() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
String[] stringArray0 = new String[0];
CSVFormat cSVFormat1 = cSVFormat0.withHeader(stringArray0);
StringReader stringReader0 = new StringReader("H1GW\"*[B)}!poj7C_");
cSVFormat1.parse(stringReader0);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.isEscaping());
}
@Test(timeout = 4000)
public void test040() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withSkipHeaderRecord(true);
boolean boolean0 = cSVFormat1.getSkipHeaderRecord();
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isQuoting());
assertTrue(boolean0);
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
}
@Test(timeout = 4000)
public void test041() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator((String) null);
cSVFormat1.getRecordSeparator();
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test042() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
Quote quote0 = Quote.ALL;
CSVFormat cSVFormat1 = cSVFormat0.withQuotePolicy(quote0);
CSVFormat cSVFormat2 = cSVFormat1.withNullString("");
cSVFormat2.getQuotePolicy();
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isCommentingEnabled());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isEscaping());
assertTrue(cSVFormat2.isQuoting());
assertEquals("\r\n", cSVFormat2.getRecordSeparator());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals("", cSVFormat2.getNullString());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test043() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
Character character0 = cSVFormat0.getQuoteChar();
assertEquals('\"', (char)character0);
}
@Test(timeout = 4000)
public void test044() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar('9');
Character character0 = cSVFormat1.getQuoteChar();
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertNotNull(character0);
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('9', (char)character0);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test045() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar('O');
Character character0 = cSVFormat1.getQuoteChar();
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertEquals('O', (char)character0);
assertEquals('\\', (char)cSVFormat1.getEscape());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertNotNull(character0);
}
@Test(timeout = 4000)
public void test046() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("z(8J@6#hc!U$~Rg");
cSVFormat1.getNullString();
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test047() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
String string0 = cSVFormat1.getNullString();
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals("", string0);
assertFalse(cSVFormat1.isEscaping());
assertTrue(cSVFormat1.isQuoting());
assertEquals(',', cSVFormat1.getDelimiter());
assertEquals("\r\n", cSVFormat1.getRecordSeparator());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test048() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
boolean boolean0 = cSVFormat0.getIgnoreSurroundingSpaces();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test049() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.TDF.withRecordSeparator((String) null);
boolean boolean0 = cSVFormat1.getIgnoreEmptyLines();
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(boolean0);
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.isEscaping());
}
@Test(timeout = 4000)
public void test050() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
String[] stringArray0 = new String[7];
CSVFormat cSVFormat1 = cSVFormat0.withHeader(stringArray0);
cSVFormat1.getHeader();
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isQuoting());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test051() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Character character0 = cSVFormat0.getEscape();
assertEquals('\\', (char)character0);
}
@Test(timeout = 4000)
public void test052() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withEscape('0');
Character character0 = cSVFormat1.getEscape();
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertFalse(cSVFormat1.isNullHandling());
assertEquals(',', cSVFormat1.getDelimiter());
assertNotNull(character0);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('0', (char)character0);
}
@Test(timeout = 4000)
public void test053() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withEscape('B');
Character character0 = cSVFormat1.getEscape();
assertEquals('B', (char)character0);
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isQuoting());
assertNotNull(character0);
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('\t', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test054() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('6');
char char0 = cSVFormat0.getDelimiter();
assertFalse(cSVFormat0.getIgnoreEmptyLines());
assertEquals('6', char0);
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat0.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test055() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('N');
char char0 = cSVFormat0.getDelimiter();
assertEquals('N', char0);
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat0.getSkipHeaderRecord());
assertFalse(cSVFormat0.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test056() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = Character.valueOf('|');
CSVFormat cSVFormat1 = cSVFormat0.TDF.withCommentStart(character0);
Character character1 = cSVFormat1.getCommentStart();
assertFalse(cSVFormat1.isEscaping());
assertEquals('|', (char)character1);
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isNullHandling());
}
@Test(timeout = 4000)
public void test057() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('0');
Character character0 = cSVFormat1.getCommentStart();
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('0', (char)character0);
assertFalse(cSVFormat1.isEscaping());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
}
@Test(timeout = 4000)
public void test058() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withCommentStart('N');
Character character0 = cSVFormat1.getCommentStart();
assertFalse(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertNotNull(character0);
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\\', (char)cSVFormat1.getEscape());
assertFalse(cSVFormat1.isNullHandling());
assertEquals('N', (char)character0);
assertTrue(cSVFormat1.isEscaping());
}
@Test(timeout = 4000)
public void test059() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
// Undeclared exception!
try {
cSVFormat0.withQuoteChar('\r');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The quoteChar cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test060() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
// Undeclared exception!
try {
cSVFormat0.EXCEL.withEscape('\r');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The escape character cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test061() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
// Undeclared exception!
try {
cSVFormat0.withCommentStart('\n');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The comment start character cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test062() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
// Undeclared exception!
try {
cSVFormat0.parse((Reader) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Parameter 'reader' must not be null!
//
verifyException("org.apache.commons.csv.Assertions", e);
}
}
@Test(timeout = 4000)
public void test063() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
boolean boolean0 = cSVFormat0.isQuoting();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test064() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withSkipHeaderRecord(true);
boolean boolean0 = cSVFormat1.isQuoting();
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(cSVFormat1.isEscaping());
assertFalse(boolean0);
assertFalse(cSVFormat1.isNullHandling());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test065() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
boolean boolean0 = cSVFormat0.isNullHandling();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test066() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
boolean boolean0 = cSVFormat0.isEscaping();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test067() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
boolean boolean0 = cSVFormat0.isEscaping();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test068() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('=');
boolean boolean0 = cSVFormat0.isCommentingEnabled();
assertFalse(boolean0);
assertFalse(cSVFormat0.getIgnoreEmptyLines());
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertEquals('=', cSVFormat0.getDelimiter());
assertFalse(cSVFormat0.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test069() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('7');
cSVFormat0.getHeader();
assertEquals('7', cSVFormat0.getDelimiter());
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat0.getIgnoreEmptyLines());
assertFalse(cSVFormat0.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test070() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
boolean boolean0 = cSVFormat0.getIgnoreSurroundingSpaces();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test071() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
cSVFormat0.getQuotePolicy();
}
@Test(timeout = 4000)
public void test072() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Character character0 = cSVFormat0.getQuoteChar();
assertNull(character0);
}
@Test(timeout = 4000)
public void test073() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
String string0 = cSVFormat0.getNullString();
assertNull(string0);
}
@Test(timeout = 4000)
public void test074() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = cSVFormat0.getCommentStart();
assertNull(character0);
}
@Test(timeout = 4000)
public void test075() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
boolean boolean0 = cSVFormat0.getIgnoreEmptyLines();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test076() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
String string0 = cSVFormat0.getRecordSeparator();
assertEquals("\r\n", string0);
}
@Test(timeout = 4000)
public void test077() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
Character character0 = cSVFormat0.getEscape();
assertNull(character0);
}
@Test(timeout = 4000)
public void test078() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
char char0 = cSVFormat0.getDelimiter();
assertEquals(',', char0);
}
@Test(timeout = 4000)
public void test079() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = Character.valueOf('\r');
// Undeclared exception!
try {
cSVFormat0.withQuoteChar(character0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The quoteChar cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test080() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = Character.valueOf('\r');
// Undeclared exception!
try {
cSVFormat0.MYSQL.withEscape(character0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The escape character cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('6');
String[] stringArray0 = new String[3];
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withHeader(stringArray0);
// Undeclared exception!
try {
cSVFormat1.format(stringArray0);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The header contains duplicate names: [null, null, null]
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test082() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
String[] stringArray0 = new String[0];
CSVFormat cSVFormat1 = cSVFormat0.withHeader(stringArray0);
assertFalse(cSVFormat1.isCommentingEnabled());
cSVFormat1.format(stringArray0);
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isQuoting());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test083() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
Quote quote0 = Quote.NONE;
CSVFormat cSVFormat1 = cSVFormat0.withQuotePolicy(quote0);
Object[] objectArray0 = new Object[2];
// Undeclared exception!
try {
cSVFormat1.format(objectArray0);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// No quotes mode set but no escape character is set
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test084() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('7');
Character character0 = Character.valueOf('7');
CSVFormat cSVFormat2 = cSVFormat1.withEscape(character0);
Object[] objectArray0 = new Object[5];
// Undeclared exception!
try {
cSVFormat2.format(objectArray0);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The comment start and the escape character cannot be the same ('7')
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test085() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('4');
CSVFormat cSVFormat2 = cSVFormat1.withQuoteChar('4');
try {
cSVFormat2.validate();
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The comment start character and the quoteChar cannot be the same ('4')
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('$');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('$');
StringReader stringReader0 = new StringReader("Escape=<");
// Undeclared exception!
try {
cSVFormat1.parse(stringReader0);
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The comment start character and the delimiter cannot be the same ('$')
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test087() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('{');
CSVFormat cSVFormat2 = cSVFormat1.withRecordSeparator((String) null);
// Undeclared exception!
try {
cSVFormat2.format((Object[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.csv.CSVPrinter", e);
}
}
@Test(timeout = 4000)
public void test088() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withDelimiter('/');
CSVFormat cSVFormat2 = cSVFormat1.withEscape('/');
try {
cSVFormat2.validate();
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The escape character and the delimiter cannot be the same ('/')
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test089() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Character character0 = Character.valueOf('+');
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar(character0);
CSVFormat cSVFormat2 = cSVFormat1.withDelimiter('+');
try {
cSVFormat2.validate();
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// The quoteChar character and the delimiter cannot be the same ('+')
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test090() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('1');
String string0 = cSVFormat0.toString();
assertEquals("Delimiter=<1> SkipHeaderRecord:false", string0);
}
@Test(timeout = 4000)
public void test091() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("");
String string0 = cSVFormat1.toString();
assertEquals("Delimiter=<,> QuoteChar=<\"> NullString=<> RecordSeparator=<\r\n> SkipHeaderRecord:false", string0);
}
@Test(timeout = 4000)
public void test092() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
Character character0 = new Character(':');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart(character0);
String string0 = cSVFormat1.toString();
assertEquals("Delimiter=<,> QuoteChar=<\"> CommentStart=<:> RecordSeparator=<\r\n> SkipHeaderRecord:false", string0);
}
@Test(timeout = 4000)
public void test093() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("YH]bI[.n6^1r1WP");
boolean boolean0 = cSVFormat1.isNullHandling();
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals("\r\n", cSVFormat1.getRecordSeparator());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertEquals("YH]bI[.n6^1r1WP", cSVFormat1.getNullString());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test094() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
String[] stringArray0 = new String[0];
CSVFormat cSVFormat1 = cSVFormat0.MYSQL.withHeader(stringArray0);
String string0 = cSVFormat1.toString();
assertEquals("Delimiter=<\t> Escape=<\\> RecordSeparator=<\n> SkipHeaderRecord:false Header:[]", string0);
}
@Test(timeout = 4000)
public void test095() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('7');
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('?');
boolean boolean0 = cSVFormat1.isCommentingEnabled();
assertTrue(boolean0);
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat0.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat0.getSkipHeaderRecord());
assertEquals('?', (char)cSVFormat1.getCommentStart());
assertFalse(cSVFormat1.isQuoting());
assertEquals('7', cSVFormat0.getDelimiter());
}
@Test(timeout = 4000)
public void test096() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
String string0 = cSVFormat0.toString();
assertEquals("Delimiter=<\t> QuoteChar=<\"> RecordSeparator=<\r\n> EmptyLines:ignored SurroundingSpaces:ignored SkipHeaderRecord:false", string0);
}
@Test(timeout = 4000)
public void test097() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('C');
cSVFormat0.hashCode();
assertFalse(cSVFormat0.getSkipHeaderRecord());
assertEquals('C', cSVFormat0.getDelimiter());
assertFalse(cSVFormat0.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test098() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
cSVFormat1.hashCode();
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isEscaping());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isNullHandling());
}
@Test(timeout = 4000)
public void test099() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
cSVFormat0.hashCode();
}
@Test(timeout = 4000)
public void test100() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("`&f<`.3t$UR");
cSVFormat1.hashCode();
assertTrue(cSVFormat1.isEscaping());
assertEquals("\n", cSVFormat1.getRecordSeparator());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test101() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.RFC4180.withCommentStart('.');
cSVFormat1.hashCode();
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.isQuoting());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertTrue(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('.', (char)cSVFormat1.getCommentStart());
}
@Test(timeout = 4000)
public void test102() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Quote quote0 = Quote.ALL;
CSVFormat cSVFormat1 = cSVFormat0.withQuotePolicy(quote0);
cSVFormat1.hashCode();
assertTrue(cSVFormat1.isQuoting());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test103() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
String[] stringArray0 = new String[0];
CSVFormat cSVFormat1 = cSVFormat0.withHeader(stringArray0);
cSVFormat1.getHeader();
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.isCommentingEnabled());
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\t', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test104() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator((String) null);
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertTrue(cSVFormat1.isQuoting());
assertFalse(boolean0);
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test105() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator((String) null);
CSVFormat cSVFormat2 = cSVFormat1.withDelimiter('{');
CSVFormat cSVFormat3 = cSVFormat2.withIgnoreSurroundingSpaces(false);
boolean boolean0 = cSVFormat3.equals(cSVFormat2);
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertTrue(cSVFormat3.isQuoting());
assertFalse(cSVFormat3.isCommentingEnabled());
assertFalse(cSVFormat3.getSkipHeaderRecord());
assertEquals('{', cSVFormat3.getDelimiter());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.equals((Object)cSVFormat3));
assertFalse(cSVFormat3.equals((Object)cSVFormat1));
assertTrue(boolean0);
assertFalse(cSVFormat3.isEscaping());
}
@Test(timeout = 4000)
public void test106() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(boolean0);
assertFalse(cSVFormat1.isCommentingEnabled());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test107() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
CSVFormat cSVFormat1 = CSVFormat.DEFAULT;
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test108() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("`&f<`.3t$UR");
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreSurroundingSpaces(false);
boolean boolean0 = cSVFormat2.equals(cSVFormat1);
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat2.isCommentingEnabled());
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertFalse(boolean0);
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals("`&f<`.3t$UR", cSVFormat2.getNullString());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat2.isEscaping());
}
@Test(timeout = 4000)
public void test109() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("`&f<`.3t$UR");
CSVFormat cSVFormat2 = CSVFormat.MYSQL;
boolean boolean0 = cSVFormat2.equals(cSVFormat1);
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isQuoting());
assertEquals("`&f<`.3t$UR", cSVFormat1.getNullString());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(boolean0);
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals("\n", cSVFormat1.getRecordSeparator());
}
@Test(timeout = 4000)
public void test110() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withNullString("z(8J@6#hc!U$~Rg");
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isQuoting());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(boolean0);
assertFalse(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test111() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
CSVFormat cSVFormat1 = cSVFormat0.withEscape('L');
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals('L', (char)cSVFormat1.getEscape());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(boolean0);
assertTrue(cSVFormat1.isQuoting());
assertEquals(',', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test112() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('%');
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(boolean0);
assertTrue(cSVFormat1.isQuoting());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isNullHandling());
assertEquals(',', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertEquals('%', (char)cSVFormat1.getCommentStart());
}
@Test(timeout = 4000)
public void test113() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('e');
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
assertEquals('e', (char)cSVFormat1.getCommentStart());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test114() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar('?');
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat0.equals((Object)cSVFormat1));
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.isCommentingEnabled());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\t', cSVFormat1.getDelimiter());
assertEquals('?', (char)cSVFormat1.getQuoteChar());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test115() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator("");
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.isCommentingEnabled());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test116() throws Throwable {
Character character0 = Character.valueOf('s');
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withQuoteChar(character0);
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('s', (char)cSVFormat1.getQuoteChar());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(boolean0);
assertEquals('\\', (char)cSVFormat1.getEscape());
assertEquals('\t', cSVFormat1.getDelimiter());
}
@Test(timeout = 4000)
public void test117() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = Character.valueOf('s');
CSVFormat cSVFormat1 = cSVFormat0.withEscape(character0);
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('s', (char)cSVFormat1.getEscape());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.isNullHandling());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(boolean0);
assertEquals('\"', (char)cSVFormat1.getQuoteChar());
}
@Test(timeout = 4000)
public void test118() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
Character character0 = new Character('1');
CSVFormat cSVFormat1 = cSVFormat0.withDelimiter(':');
CSVFormat cSVFormat2 = cSVFormat0.withQuoteChar(character0);
boolean boolean0 = cSVFormat2.equals(cSVFormat1);
assertFalse(cSVFormat2.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat2.getIgnoreEmptyLines());
assertFalse(cSVFormat1.equals((Object)cSVFormat0));
assertFalse(cSVFormat0.equals((Object)cSVFormat1));
assertEquals(':', cSVFormat1.getDelimiter());
assertTrue(cSVFormat2.isQuoting());
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertFalse(cSVFormat2.isCommentingEnabled());
assertFalse(cSVFormat2.isNullHandling());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test119() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
Object object0 = new Object();
boolean boolean0 = cSVFormat0.equals(object0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test120() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
boolean boolean0 = cSVFormat0.equals((Object) null);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test121() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.EXCEL;
boolean boolean0 = cSVFormat0.equals(cSVFormat0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test122() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Character character0 = new Character('\r');
// Undeclared exception!
try {
cSVFormat0.withCommentStart(character0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The comment start character cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test123() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
// Undeclared exception!
try {
cSVFormat0.withDelimiter('\r');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The delimiter cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test124() throws Throwable {
// Undeclared exception!
try {
CSVFormat.newFormat('\n');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// The delimiter cannot be a line break
//
verifyException("org.apache.commons.csv.CSVFormat", e);
}
}
@Test(timeout = 4000)
public void test125() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator(':');
assertFalse(cSVFormat1.isQuoting());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals(":", cSVFormat1.getRecordSeparator());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
}
@Test(timeout = 4000)
public void test126() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
String[] stringArray0 = new String[0];
CSVFormat cSVFormat1 = cSVFormat0.withHeader(stringArray0);
boolean boolean0 = cSVFormat1.equals(cSVFormat0);
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertEquals('\t', cSVFormat1.getDelimiter());
assertFalse(boolean0);
assertFalse(cSVFormat1.isQuoting());
assertTrue(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
}
@Test(timeout = 4000)
public void test127() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withIgnoreEmptyLines(true);
assertTrue(cSVFormat1.equals((Object)cSVFormat0));
}
@Test(timeout = 4000)
public void test128() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.RFC4180;
Object[] objectArray0 = new Object[5];
String string0 = cSVFormat0.format(objectArray0);
assertEquals("\"\",,,,", string0);
}
@Test(timeout = 4000)
public void test129() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withCommentStart('{');
CSVFormat cSVFormat2 = cSVFormat1.withIgnoreSurroundingSpaces(false);
boolean boolean0 = cSVFormat2.equals(cSVFormat1);
assertFalse(cSVFormat2.isEscaping());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertEquals('{', (char)cSVFormat2.getCommentStart());
assertTrue(boolean0);
assertTrue(cSVFormat2.getIgnoreEmptyLines());
assertFalse(cSVFormat2.getSkipHeaderRecord());
assertFalse(cSVFormat2.equals((Object)cSVFormat0));
assertFalse(cSVFormat2.isNullHandling());
assertEquals('\"', (char)cSVFormat2.getQuoteChar());
}
@Test(timeout = 4000)
public void test130() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
Quote quote0 = Quote.NON_NUMERIC;
CSVFormat cSVFormat1 = cSVFormat0.withQuotePolicy(quote0);
boolean boolean0 = cSVFormat0.equals(cSVFormat1);
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(boolean0);
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isNullHandling());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertFalse(cSVFormat1.getSkipHeaderRecord());
assertFalse(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test131() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.DEFAULT;
CSVFormat cSVFormat1 = cSVFormat0.withRecordSeparator("");
String string0 = cSVFormat1.getRecordSeparator();
assertFalse(cSVFormat1.isNullHandling());
assertFalse(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isCommentingEnabled());
assertFalse(cSVFormat1.isEscaping());
assertNotNull(string0);
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals(',', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.getSkipHeaderRecord());
}
@Test(timeout = 4000)
public void test132() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.TDF;
CSVFormat cSVFormat1 = cSVFormat0.withSkipHeaderRecord(true);
assertTrue(cSVFormat1.getIgnoreSurroundingSpaces());
assertFalse(cSVFormat1.isNullHandling());
assertTrue(cSVFormat1.getIgnoreEmptyLines());
assertEquals('\t', cSVFormat1.getDelimiter());
assertTrue(cSVFormat1.getSkipHeaderRecord());
assertTrue(cSVFormat1.isQuoting());
assertFalse(cSVFormat1.isEscaping());
assertFalse(cSVFormat1.isCommentingEnabled());
}
@Test(timeout = 4000)
public void test133() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.newFormat('7');
boolean boolean0 = cSVFormat0.getSkipHeaderRecord();
assertFalse(boolean0);
assertFalse(cSVFormat0.getIgnoreEmptyLines());
assertFalse(cSVFormat0.getIgnoreSurroundingSpaces());
assertEquals('7', cSVFormat0.getDelimiter());
}
@Test(timeout = 4000)
public void test134() throws Throwable {
CSVFormat cSVFormat0 = CSVFormat.MYSQL;
StringReader stringReader0 = new StringReader("H1GW\"*[B)}!poj7C_");
CSVParser cSVParser0 = cSVFormat0.parse(stringReader0);
assertEquals(0L, cSVParser0.getRecordNumber());
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
0db49d1faab4f50deed920678da9386ea7557e5f | 02f14b4d2fee6364bec06fba7158aa19d20d3b51 | /src/main/java/org/sourcelab/storm/spout/redis/client/Consumer.java | c9f412024b0ab1bdd0ccf21be997cce99d8b7c00 | [
"MIT"
] | permissive | SourceLabOrg/RedisStreams-StormSpout | 52696c5c5e86b8e78a6db9aa0be97a7a7f62b0c5 | dc5e997c1de6d33409c90e37b8d37032810b6012 | refs/heads/master | 2022-12-13T03:46:41.749588 | 2020-07-24T01:19:41 | 2020-07-24T01:19:41 | 278,319,295 | 4 | 0 | MIT | 2020-07-24T01:08:45 | 2020-07-09T09:20:19 | Java | UTF-8 | Java | false | false | 3,183 | java | package org.sourcelab.storm.spout.redis.client;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sourcelab.storm.spout.redis.Message;
import org.sourcelab.storm.spout.redis.RedisStreamSpoutConfig;
import org.sourcelab.storm.spout.redis.funnel.ConsumerFunnel;
import java.util.List;
import java.util.Objects;
/**
* Background Processing Thread handling Consuming from a Redis Stream Client.
*/
public class Consumer implements Runnable {
private static final Logger logger = LoggerFactory.getLogger(Consumer.class);
/**
* Configuration properties for the client.
*/
private final RedisStreamSpoutConfig config;
/**
* The underlying Redis Client.
*/
private final Client redisClient;
/**
* For thread safe communication between this client thread and the spout thread.
*/
private final ConsumerFunnel funnel;
/**
* Protected constructor for injecting a RedisClient instance, typically for tests.
* @param config Spout configuration properties.
* @param redisClient RedisClient instance.
* @param funnel Funnel instance.
*/
public Consumer(final RedisStreamSpoutConfig config, final Client redisClient, final ConsumerFunnel funnel) {
this.config = Objects.requireNonNull(config);
this.redisClient = Objects.requireNonNull(redisClient);
this.funnel = Objects.requireNonNull(funnel);
}
/**
* Intended to be run by a background processing Thread.
* This will continue running and not return until the Funnel has notified
* this thread to stop.
*/
@Override
public void run() {
// Connect
redisClient.connect();
// flip running flag.
funnel.setIsRunning(true);
logger.info("Starting to consume new messages from {}", config.getStreamKey());
while (!funnel.shouldStop()) {
final List<Message> messages = redisClient.nextMessages();
// Loop over each message
messages
// Push into the funnel.
// This operation can block if the queue is full.
.forEach(funnel::addMessage);
// process acks
String msgId = funnel.nextAck();
while (msgId != null) {
// Confirm that the message has been processed using XACK
redisClient.commitMessage(msgId);
// Grab next msg to ack.
msgId = funnel.nextAck();
}
// If configured with a delay
if (config.getConsumerDelayMillis() > 0) {
// Small delay.
try {
Thread.sleep(config.getConsumerDelayMillis());
} catch (final InterruptedException exception) {
logger.info("Caught interrupt, stopping consumer", exception);
break;
}
}
}
logger.info("Spout Requested Shutdown...");
// Close our connection and shutdown.
redisClient.disconnect();
// Flip running flag to false to signal to spout.
funnel.setIsRunning(false);
}
}
| [
"stephen.powis@gmail.com"
] | stephen.powis@gmail.com |
29c0713158d436a9e1610bea12e6edc30ea81d73 | e302e1f7c812c816bfde01bab06f13a2482e1274 | /src/main/java/ejercicio3static/Nota2.java | c4354a85b70151d0f243c8fa78090e455e83de44 | [] | no_license | SergiusxD/Presentar | 8a1693a1521030b63da97b3c1a80d5ba9bb8da1e | 36de52c522e4b65213b342d36d3e71f6328c7f85 | refs/heads/master | 2022-04-17T22:39:42.252080 | 2020-04-14T14:28:59 | 2020-04-14T14:28:59 | 255,631,102 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | package ejercicio3static;
public class Nota2 {
public Nota2(){ }
public String reconocimiento(int nota){
String msg="Regular Rendimiento";
if (ValidatorStatic.isValid(nota,1,100)){
if (nota >= 80 && nota < 90){
msg="Bueno ";
}
if (nota >= 90 && nota < 100){
msg="Muy Bueno ";
}
if (nota == 100){
msg="Excelente ";
}
}
return msg + nota;
}
} | [
"sbellott@hotmail.com"
] | sbellott@hotmail.com |
14612b9631c764746ce555882e5db85f31040f40 | 712fb350624fc67dc5af3c329f4520084480f79e | /src/main/java/com/github/andavid/ds/algorithm/divideandconquer/CountInversePairs.java | 10e6b6ed2bcb4ca66fff58c53a390a590220f36c | [] | no_license | blank-1/ds-algo-java | 114a115320fd29b9a8b0ef39de280dc0750b49a8 | e5d011b2abb6305ddba52a6b021e47f4919151df | refs/heads/master | 2022-12-29T05:00:48.790412 | 2020-06-09T15:23:24 | 2020-06-09T15:23:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | package com.github.andavid.ds.algorithm.divideandconquer;
public class CountInversePairs {
private int num = 0;
/**
* 输入一个数组,求出这个数组中的逆序对总数。
* 采用分治算法,利用二路归并排序实现。
*/
public int count(int[] data) {
if (data == null || data.length < 2) {
return 0;
}
num = 0;
mergeSort(data, 0, data.length - 1);
return num;
}
public void mergeSort(int[] data, int low, int high) {
if (low >= high) return;
int mid = low + (high - low) / 2;
mergeSort(data, low, mid);
mergeSort(data, mid + 1, high);
merge(data, low, mid, high);
}
public void merge(int[] data, int low, int mid, int high) {
int[] temp = new int[high - low + 1];
int left = low;
int right = mid + 1;
int index = 0;
while (left <= mid && right <= high) {
if (data[left] > data[right]) {
// 合并两个有序数组过程中,right 存在逆序对数量为 left 到 mid 的元素数量
num += mid - left + 1;
temp[index++] = data[right++];
} else {
temp[index++] = data[left++];
}
}
while (left <= mid) {
temp[index++] = data[left++];
}
while (right <= high) {
temp[index++] = data[right++];
}
for (int i = low; i <= high; i++) {
data[i] = temp[i - low];
}
}
}
| [
"jiankedai@gmail.com"
] | jiankedai@gmail.com |
8441ebf14f1113ce37d438e8018b83cd2fa3579a | 1a79d6c1be6ddf9cd09e3c777258fd53793dd9a5 | /src/main/java/com/javaetmoi/core/batch/item/EsDocument.java | d34833825742bc7e8ad0db497813dbe58dde5791 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | achretien/musicbrainz-elasticsearch | 1a49cd6356ddd4fd22051f5f86c50efbc2ce6e0e | f5f236b7c5ead1369d5087f8685a3a516d2d4c88 | refs/heads/master | 2021-01-18T13:40:25.074362 | 2014-06-29T19:58:07 | 2014-06-29T19:58:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,614 | java | /**
* Copyright 2013 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 com.javaetmoi.core.batch.item;
import org.elasticsearch.common.xcontent.XContentBuilder;
/**
* JSON document which is stored in Elasticsearch.
*
* <p>
* A document is stored in an <b>index</b> and has a <b>type</b> and an <b>id</b>.<br>
* If no id is provided, Elasticsearch well auto-generated one.<br>
* A document indexed in elasticsearch could be versioned.
* </p>
*/
public class EsDocument {
private String id;
private String type;
private Long version;
private XContentBuilder contentBuilder;
/**
* EsDocument constructor.
*
* @param type
* type of the Elasticsearch document
* @param contentBuilder
* Elasticsearch helper to generate JSON content.
*/
public EsDocument(String type, XContentBuilder contentBuilder) {
this.type = type;
this.contentBuilder = contentBuilder;
}
protected String getId() {
return id;
}
/**
* Set the ID of a document which identifies a document.
*
* @param id
* ID of a document (may be <code>null</code>)
*/
public void setId(String id) {
this.id = id;
}
protected XContentBuilder getContentBuilder() {
return contentBuilder;
}
protected String getType() {
return type;
}
/**
* Sets the version, which will cause the index operation to only be performed if a matching
* version exists and no changes happened on the doc since then.
*
* @param version
* version of a document
* @see http://www.elasticsearch.org/blog/versioning/
*/
protected void setVersion(Long version) {
this.version = version;
}
protected boolean isVersioned() {
return version !=null;
}
public Long getVersion() {
return version;
}
}
| [
"antoine.rey@gmail.com"
] | antoine.rey@gmail.com |
c5a9ade0e2e78fb2440cb255fe45e308a2daa843 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_619947c20452908a000946982f70ec8e2b948bf8/QueryLookupController/2_619947c20452908a000946982f70ec8e2b948bf8_QueryLookupController_s.java | 7576f08addcdccde2acfea0585027d1e0984530e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,824 | java | package com.mpower.controller;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.support.PagedListHolder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import com.mpower.domain.QueryLookup;
import com.mpower.service.QueryLookupService;
import com.mpower.service.SessionServiceImpl;
public class QueryLookupController implements Controller {
/** Logger for this class and subclasses */
protected final Log logger = LogFactory.getLog(getClass());
private QueryLookupService queryLookupService;
public void setQueryLookupService(QueryLookupService queryLookupService) {
this.queryLookupService = queryLookupService;
}
@SuppressWarnings("unchecked")
@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, String> queryParams = new HashMap<String, String>();
Enumeration<String> enu = request.getParameterNames();
while (enu.hasMoreElements()) {
String param = enu.nextElement();
String paramValue = StringUtils.trimToNull(request.getParameter(param));
if (paramValue != null && !param.equalsIgnoreCase("fieldDef") && !param.equalsIgnoreCase("view")) {
queryParams.put(param, paramValue);
}
}
// List<String> displayColumns = new ArrayList<String>();
// displayColumns.add("lastName");
// displayColumns.add("firstName");
String fieldDef = StringUtils.trimToNull(request.getParameter("fieldDef"));
QueryLookup queryLookup = queryLookupService.readQueryLookup(SessionServiceImpl.lookupUserSiteName(), fieldDef);
List<Object> objects = queryLookupService.executeQueryLookup(SessionServiceImpl.lookupUserSiteName(), fieldDef,
queryParams);
ModelAndView mav = new ModelAndView("queryLookup");
mav.addObject("objects", objects);
PagedListHolder pagedListHolder = new PagedListHolder(objects);
pagedListHolder.setMaxLinkedPages(3);
pagedListHolder.setPageSize(50);
String page = request.getParameter("page");
Integer pg = 0;
if (!StringUtils.isBlank(page)) {
pg = Integer.valueOf(page);
}
pagedListHolder.setPage(pg);
mav.addObject("pagedListHolder", pagedListHolder);
mav.addObject("queryLookup", queryLookup);
// mav.addObject("displayColumns", displayColumns);
// mav.addObject("parameterMap", request.getParameterMap());
return mav;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
10fc1628cf3b6c437c1a4ed7dfcaf3e1eb165c1f | 5ca2fb2edcbdab200a8650f1c785de56c040126d | /JSP_study/27_iBatis/src/controller/UserController.java | fe9fd5fb8ae50996fd67a2ed72648bc7de0905e4 | [] | no_license | MainDuke/mainduke-portfolioList | f4acb6cef861fbf96c3d099df5d323793c778b00 | 0410f201d8819c4fe437322773593b5299d17b1f | refs/heads/master | 2020-04-17T18:32:39.544859 | 2019-01-21T15:20:35 | 2019-01-21T15:20:35 | 166,830,888 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 3,337 | java | package controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.jws.WebParam.Mode;
import model.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import user.service.UserDaoImplService;
@Controller
@RequestMapping("/user")
public class UserController {
private ApplicationContext ct = new ClassPathXmlApplicationContext("/config/applicationContext.xml");
private UserDaoImplService dao=(UserDaoImplService)ct.getBean("userService"); //빈 얻기
//http://컨텍스트:port/user/list.do
@RequestMapping("/list.do")
public ModelAndView listUser(){
//DAO 로 부터 모든 데이터 얻기
List<User> userList = this.dao.getList();
return new ModelAndView("list","userList",userList);
//모델 생성
/*
* Map<String, Object> model = new HashMap<String, Object>();
* model.put("userList",userList);
*
*반환값인 ModelAndView 인스턴스를 생성
*ModelAndView modelandView = new ModelAndView();
*modelandView.setViewName("list");
*modelandView.addAllObject(model);
* return modelandView;
*
* */
}//----------------------
//입력 폼, GET방식 요청 처리
//insert
@RequestMapping("/write.do")
public String userWrite(){
return "write";// 뷰
}
//insert
@RequestMapping(value="/write.do", method=RequestMethod.POST)
public String userWritePro(@ModelAttribute("User") User user){
this.dao.writeUser(user);
return "redirect:list.do";
//redirect는 reponse.sendRedirect("list.jsp");
}
//글 내용 보기
@RequestMapping(value="/content.do")
public ModelAndView contentUser(String userId){
User user=this.dao.getUser(userId);
return new ModelAndView("content", "user", user);
}
//글 수정 폼
@RequestMapping(value="/update.do", method=RequestMethod.GET)
public ModelAndView updateUser(String userId){
User user=this.dao.getUser(userId);
return new ModelAndView("update", "user", user);
}
//글 수정
@RequestMapping(value="/update.do", method=RequestMethod.POST)
public String updatePro(User user){
this.dao.modifyUser(user);
return "redirect:list.do";
//redirect 는 http://를 새로 연결한다.
}
//글 삭제 폼
@RequestMapping(value="/delete.do", method=RequestMethod.GET)
public ModelAndView deleteUser(){
String id="아이디를 입력하시오.";
String pwd="암호를 입력하시오";
Map<String, String> map = new HashMap<String, String>();
map.put("id",id);
map.put("pwd",pwd);
return new ModelAndView("delete", "map", map);//뷰
//redirect 는 http://를 새로 연결한다.
}
//글 삭제
@RequestMapping(value="/delete.do", method=RequestMethod.POST)
public String deletePro(String userId){
this.dao.deleteUser(userId);
return "redirect:list.do";
//redirect 는 http://를 새로 연결한다.
}
}//class end
| [
"enigmatic_duke@naver.com"
] | enigmatic_duke@naver.com |
143ed249ca696a512f816024c2f07fae6ba50044 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/36_schemaspy-net.sourceforge.schemaspy.view.HtmlRelationshipsPage-1.0-5/net/sourceforge/schemaspy/view/HtmlRelationshipsPage_ESTest.java | a769ea711ca69f495ad4675caf3e9e8823d2aa54 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | /*
* This file was automatically generated by EvoSuite
* Fri Oct 25 19:59:00 GMT 2019
*/
package net.sourceforge.schemaspy.view;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class HtmlRelationshipsPage_ESTest extends HtmlRelationshipsPage_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
8f0322e5c930f2a035f1bb2de956cc93ed0894f7 | 646a50af9130798b52b0dd1313249708dba92819 | /src/main/java/html/SecurityAnalyzer.java | 3099c0e86568ae3165b876990eba728c065d74dd | [] | no_license | ReggieYang/VulnerabilitySearch | 53a27fc6008efbf551df2ae3de991308f2d0523a | d67fd37d401832f8462346271b311f609ee176e0 | refs/heads/master | 2020-04-07T11:02:23.462145 | 2018-12-08T04:08:17 | 2018-12-08T04:08:17 | 158,310,333 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 541 | java | package html;
import java.util.ArrayList;
import java.util.List;
public class SecurityAnalyzer {
public List<String> getAllVersion(String html, String id) {
List<String> result = new ArrayList<>();
String[] arr = html.split("\n");
boolean foundSearchWord = false;
for (int i = 0; i < arr.length; i++) {
if(!foundSearchWord && arr[i].contains("Description")){
foundSearchWord = true;
result.add(arr[i]);
}
}
return result;
}
}
| [
"gydbd06@hotmail.com"
] | gydbd06@hotmail.com |
2e56220156b38595716cc1de3176f0066835c613 | 9387f41bac2c392bc2d6814e36408f795674817b | /Gajenje_Ovaca/src/main/java/app/services/OvcaService.java | 3be41b4f71da71c37603bee773f85045495c4b82 | [] | no_license | tadic/Ovcar | e9c6a146a20a4d6e49a95afa3915312da2d88c31 | 9ca7e2f562f28bd5a016d985dafd9fbd8f34cc99 | refs/heads/master | 2021-01-17T09:25:38.115959 | 2016-04-02T09:15:22 | 2016-04-02T09:15:22 | 21,502,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,072 | java | package app.services;
import app.model.Ovca;
import app.model.Parenje;
import com.avaje.ebean.EbeanServer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class OvcaService {
private EbeanServer server;
public OvcaService(EbeanServer server){
this.server = server;
}
public List<Ovca> getAllSheep() {
List<Ovca> list = server.find(Ovca.class).findList();
for(Ovca o:list){
o.getOtac();
o.getMajka();
}
return list;
}
public Ovca getOvca(int id) {
Ovca o = server.find(Ovca.class, id);
o.getOtac();
o.getMajka();
return o;
}
public Ovca getOvca(String oznaka) {
return server.find(Ovca.class).where().like("oznaka", oznaka).findUnique();
}
public void saveSheep(Ovca sheep) {
sheep.getOtac();
linkToFather(sheep);
sheep.getMajka();// povezi ovcu sa ocem i majkom iz baze
linkToMother(sheep);
if (sheep.getId()!=null){ // ako je ovca vec postojala u bazi, pronadji original i uskladi data
Ovca o = server.find(Ovca.class, sheep.getId());
setSheep(o,sheep);
// System.out.println("Trenutak pre snimanja novi otac :" + o.getOtac().getOznaka());
server.save(o);
//server.save(o.getOtac()); //????????????? ne znam sto ovo mora!?!?!?!?
// System.err.println("novi otac id:" + o.getOtac().getId());
return;
}
server.save(sheep);
}
private void linkToMother(Ovca sheep){
// System.out.println("Majka: " + sheep.getMajka());
if (sheep.getMajka().getOznaka()!= null){ //ako je oznaka uneta kroz formu
Ovca majka = server.find(Ovca.class).where().like("oznaka", sheep.getMajka().getOznaka().toString()).findUnique();
if (majka==null){
sheep.getMajka().setPol('ž');// ako majka nije postojala u bazi
Ovca defaultOtac = server.find(Ovca.class).where().like("oznaka", "nepoznat").findUnique();
Ovca defaultMajka = server.find(Ovca.class).where().like("oznaka", "nepoznata").findUnique();
sheep.getMajka().setMajka(defaultMajka);
sheep.getMajka().setOtac(defaultOtac);
server.save(sheep.getMajka()); // snimi majku kao 'nepoznatu' i uzmi njen id
majka = server.find(Ovca.class).where().like("oznaka", sheep.getMajka().getOznaka().toString()).findUnique();
}
sheep.setMajka(majka);
proveriStaruMajku(sheep);
}
}
private void linkToFather(Ovca sheep){
// System.out.println("novi Otac: " + sheep.getOtac().getOznaka());
if (sheep.getOtac().getOznaka()!= null){ //ako je oznaka vec uneta kroz formular
Ovca otac = server.find(Ovca.class).where().like("oznaka", sheep.getOtac().getOznaka().toString()).findUnique();
if (otac==null){ // ako otac nije postojala u bazi
sheep.getOtac().setPol('m');
Ovca defaultOtac = server.find(Ovca.class).where().like("oznaka", "nepoznat").findUnique();
Ovca defaultMajka = server.find(Ovca.class).where().like("oznaka", "nepoznata").findUnique();
sheep.getOtac().setMajka(defaultMajka);
sheep.getOtac().setOtac(defaultOtac);
server.save(sheep.getOtac()); // snimi oca kao 'nepoznatu' i uzmi njen id
otac = server.find(Ovca.class).where().like("oznaka", sheep.getOtac().getOznaka().toString()).findUnique();
// System.out.println("Kreiran je novi otac oznake" + otac.getOznaka());
}
sheep.setOtac(otac);
//System.out.println("ponovo" + sheep.getOtac().getOznaka());
proveriStarogOca(sheep);
}
}
private void proveriStarogOca(Ovca sheep){
if (sheep.getId()!=null){
// System.out.println("step 1");
Ovca staraOvca = server.find(Ovca.class, sheep.getId());
Ovca stariOtac = staraOvca.getOtac();
//System.out.println("Stari otac: " + stariOtac.getOznaka() + " id: " + stariOtac.getId());
//System.out.println("Novi otac: " + sheep.getOtac().getOznaka() + " id: " + sheep.getOtac().getId());
//System.out.println("Isti: " + stariOtac.equals(sheep.getOtac()));
if (stariOtac==null || (stariOtac.equals(sheep.getOtac()))){
return;
}
ocistiOca(stariOtac);
}
}
private void proveriStaruMajku(Ovca sheep){
if (sheep.getId()!=null){
Ovca staraOvca = server.find(Ovca.class, sheep.getId());
Ovca staraMajka = staraOvca.getMajka();
// System.out.println("step 2, status: " + staraMajka.getStatus());
if (staraMajka==null || (staraMajka.equals(sheep.getMajka()))){
return;
}
ocistiMajku(staraMajka);
}
}
private void setSheep(Ovca ovca1, Ovca ovca2){
ovca1.setDatumRodjenja(ovca2.getDatumRodjenja());
ovca1.setNadimak(ovca2.getNadimak());
ovca1.setPracenje(ovca2.getPracenje());
ovca1.setLinija(ovca2.getLinija());
ovca1.setOpis(ovca2.getOpis());
ovca1.setOznaka(ovca2.getOznaka());
ovca1.setProcenatR(ovca2.getProcenatR());
ovca1.setPoreklo(ovca2.getPoreklo());
ovca1.setLeglo(ovca2.getLeglo());
ovca1.setPol(ovca2.getPol());
ovca1.setOtac(ovca2.getOtac());
ovca1.setMajka(ovca2.getMajka());
ovca1.setAktuelno(ovca2.getAktuelno());
ovca1.setTezinaNaRodjenju(ovca2.getTezinaNaRodjenju());
ovca1.setTezinaDvaMeseca(ovca2.getTezinaDvaMeseca());
ovca1.setTezinaCetiriMeseca(ovca2.getTezinaCetiriMeseca());
}
public List<Ovca> getOvceZaJagnjenje() {
List<Ovca> list = server.find(Ovca.class).where().like("status", "na farmi").like("pol", "ž").findList();
if (list!=null){
return list;
}
return new ArrayList<Ovca>();
}
public List<Ovca> listaOvnova() {
List<Ovca> list = server.find(Ovca.class).where().like("pol", "m").findList();
if (list!=null){
return list;
}
return new ArrayList<Ovca>();
}
public List<Ovca> getSvaZivaGrla() {
return server.find(Ovca.class).where().like("status", "na farmi").findList();
}
public void undoStatus(Ovca ovca){
Ovca o = server.find(Ovca.class, ovca.getId());
if (o!=null){
if (o.getProdaja()!=null){
o.setStatus("prodato");
} else if (o.getUginuce()!=null){
o.setStatus("uginulo");
} else if (o.getRodjenje()==null && o.getNabavka()==null){ // ako nikad nije ni bio na farmi
o.setStatus("zamisljena");
} else {
o.setStatus("na farmi");
}
server.save(o);
}
}
public void setStatus(Ovca ovca, String status){
Ovca o = server.find(Ovca.class, ovca.getId());
if (o!=null){
o.setStatus(status);
server.save(o);
}
}
public void deleteSheep(Ovca o){
ocistiMajku(o.getMajka());
ocistiOca(o.getOtac());
server.delete(o);
}
private void ocistiMajku(Ovca o){
if (o.getStatus()!=null && o.getStatus().equals("zamisljena")){
List<Ovca> listaPotomaka = server.find(Ovca.class).where().like("majka_id", o.getId().toString()).findList();
if (listaPotomaka.size()==1){ // ako je stari otac zamisljen i bio je otac samo ovoj ovci - izbrisi ga
server.delete(o);
}
}
}
private void ocistiOca(Ovca o){
if (o.getStatus()!=null && o.getStatus().equals("zamisljena")){
List<Ovca> listaPotomaka = server.find(Ovca.class).where().like("otac_id", o.getId().toString()).findList();
if (listaPotomaka.size()==1){ // ako je stari otac zamisljen i bio je otac samo ovoj ovci - izbrisi ga
server.delete(o);
}
}
}
public void saveSheepStatus(Ovca sheep, String status){
Ovca o = server.find(Ovca.class, sheep.getId());
o.setStatus(status);
server.save(o);
}
public void updateOvcaFromList(Ovca o) {
Ovca stara = server.find(Ovca.class, o.getId());
stara.setAktuelno(o.getAktuelno());
stara.setOznaka(o.getOznaka());
stara.setNadimak(o.getNadimak());
System.out.println(o.getId());
server.save(stara);
}
public List<Ovca> getSveOvnove() {
return server.find(Ovca.class).where().like("status", "na farmi").like("pol", "m").findList();
}
public void resetAktuelno(Ovca ovca){
Ovca o = server.find(Ovca.class, ovca.getId());
o.setAktuelno("");
server.save(o);
}
public void saveAktuelno(Ovca ovca){
Ovca o = server.find(Ovca.class, ovca.getId());
o.setAktuelno(ovca.getAktuelno());
server.save(o);
}
public List<Parenje> getZadnjaParenja(Ovca ovan) {
List<Parenje> lista = new ArrayList<Parenje>();
for (Ovca o: getAllSheep()){
if (o.getPol()=='ž' && o.getParenja()!=null && !o.getParenja().isEmpty()){
List<Parenje> parenja = o.getParenja();
Collections.sort(parenja);
Parenje zadnjeParenje = parenja.get(parenja.size()-1);
if (!zadnjeParenje.getTip().equals("Odvajanje") && zadnjeParenje.getOvan().equals(ovan)){
lista.add(zadnjeParenje);
}
}
}
return lista;
}
}
| [
"ivantadic014@gmail.com"
] | ivantadic014@gmail.com |
c0d8e403dd1be78b55adab5c16c91e4ac3748885 | b4307ca2f116a822b9ce8f70878364fbe784b98f | /pep/src/trees/GenericClient.java | bdd78ed147cd50e7d71723fdb3c8c68d236dc5f2 | [] | no_license | anandkrrai/CompetitiveCoding | b5683d4d1e6f37ba9a4f2fd4a92f7f4668b740ce | 63347ee9d571f862bc3ff938b5d96e7fb009764a | refs/heads/master | 2023-01-03T06:42:34.054882 | 2020-10-30T21:25:40 | 2020-10-30T21:25:40 | 115,263,952 | 1 | 7 | null | 2020-10-30T21:25:41 | 2017-12-24T13:17:22 | Java | UTF-8 | Java | false | false | 53 | java | package trees;
public class GenericClient {
}
| [
"kumar.anand.rai@gmail.com"
] | kumar.anand.rai@gmail.com |
d42f94c629cc7885898616e225ea4e7418620423 | 5c2dcd99caac9e3af9e259f1d2150ec1971aaf1f | /app/src/main/java/id/diaz/com/sourcewebviewer/MainActivity.java | a98030f6f1821ae3d8b725086d69583226b77842 | [] | no_license | diazaulia/SourceCodeWebViewer | 37c11b2dcf42715ba5758923c2aeea075cc6d231 | 4d583478e172ad59075ca195cc792a8a7d5019d5 | refs/heads/master | 2021-07-16T22:10:51.348016 | 2017-10-22T16:18:44 | 2017-10-22T16:18:44 | 107,865,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,385 | java | package id.diaz.com.sourcewebviewer;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private String[] spinnerValue;
getSourceTask c1;
static TextView showSource;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.spinnerValue = new String[]{
"http://",
"https://"
};
Spinner prot = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, spinnerValue);
prot.setAdapter(adapter);
showSource = (TextView) findViewById(R.id.showSource);
showSource.setMovementMethod(new ScrollingMovementMethod());
}
public Boolean isOnline() {
try {
Process p1 = java.lang.Runtime.getRuntime().exec("ping -c 1 www.google.com");
int returnVal = p1.waitFor();
boolean reachable = (returnVal==0);
return true;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
public void eksekusibos(View view) {
Spinner protokol = (Spinner) findViewById(R.id.spinner1);
String protokols = protokol.getSelectedItem().toString();
EditText addressnyaom = (EditText) findViewById(R.id.address);
String iniaddressnya = addressnyaom.getText().toString();
if(isOnline() == true) {
c1 = new getSourceTask(this);
c1.execute(protokols+""+iniaddressnya);
} else {
Toast.makeText(this, "Internet Tidak Terkoneksi", Toast.LENGTH_LONG).show();
}
//c1 = new getSourceTask(this);
//c1.execute(protokols+""+iniaddressnya);
}
}
| [
"diaz@grombyang.or.id"
] | diaz@grombyang.or.id |
a906a0dbed4150e48db264f0793f5c539032d3ed | a5a7c6814a41bc3d74c59072eb739cad8a714b33 | /src/main/src/org/omg/CORBA/UShortSeqHelper.java | 8aa71aa1ec9fa3d84d36177f73fdfc8a66457b64 | [
"Apache-2.0"
] | permissive | as543343879/myReadBook | 3dcbbf739c184a84b32232373708c73db482f352 | 5f3af76e58357a0b2b78cc7e760c1676fe19414b | refs/heads/master | 2023-09-01T16:09:21.287327 | 2023-08-23T06:44:46 | 2023-08-23T06:44:46 | 139,959,385 | 3 | 3 | Apache-2.0 | 2023-06-14T22:31:32 | 2018-07-06T08:54:15 | Java | UTF-8 | Java | false | false | 2,587 | java | /*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.omg.CORBA;
/**
* The Helper for <tt>UShortSeq</tt>. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/UShortSeqHelper.java
* Generated by the IDL-to-Java compiler (portable), version "3.0"
* from streams.idl
* 13 May 1999 22:41:36 o'clock GMT+00:00
*
* The class definition has been modified to conform to the following
* OMG specifications :
* <ul>
* <li> ORB core as defined by CORBA 2.3.1
* (<a href="http://cgi.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
* </li>
*
* <li> IDL/Java Language Mapping as defined in
* <a href="http://cgi.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
* </li>
* </ul>
*/
public abstract class UShortSeqHelper
{
private static String _id = "IDL:omg.org/CORBA/UShortSeq:1.0";
public static void insert (org.omg.CORBA.Any a, short[] that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static short[] extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort);
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.UShortSeqHelper.id (), "UShortSeq", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static short[] read (org.omg.CORBA.portable.InputStream istream)
{
short value[] = null;
int _len0 = istream.read_long ();
value = new short[_len0];
istream.read_ushort_array (value, 0, _len0);
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, short[] value)
{
ostream.write_long (value.length);
ostream.write_ushort_array (value, 0, value.length);
}
}
| [
"543343879@qq.com"
] | 543343879@qq.com |
beeaa80d5e42e4ea8be8fc473a10d973c6f27644 | fe2645e9f55fc64b58aef2a06905b054bbbb7fe6 | /src/main/java/tutorial/springdata/controller/AddressController.java | 8825383d0373540dbca653b3875e783046d997cf | [] | no_license | dineshbabu/SpringDataJpaBootGradleMySQLFlywaySwaggerEntityRelationships | 38294f18d31482348b2c3bd83ef2604c620edcc5 | ea800cff769a7dc9cd23c2175d80d8e1297ea8b3 | refs/heads/master | 2020-03-23T03:11:37.769134 | 2018-07-15T11:12:42 | 2018-07-15T11:12:42 | 141,015,402 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 914 | java | package tutorial.springdata.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import tutorial.springdata.entities.onetomany.Address;
import tutorial.springdata.service.AddressService;
/**
* Created by dineshbabu on 27/06/2017.
*/
@RequestMapping(path = "/address")
@RestController
public class AddressController {
@Autowired
private AddressService addressService;
@RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public Address createAddress(@RequestBody Address address){
return addressService.createAddress(address);
}
}
| [
"dineshbabu_kp@yahoo.com"
] | dineshbabu_kp@yahoo.com |
b9ba5236ff24070f29c113c3b51a43913521066e | 29b44914aab18c441cf13c0b0d57743ea86d5c2a | /summer-report/src/main/java/net/myspring/report/modules/future/dto/ProductMonthPriceDetailDto.java | acaa0b57622be1a08f278ef4294d198cec17036e | [] | no_license | Joker2333/dlsmonastery | 3ff1c6cab50d8c863fcaff994eedca614da7ea86 | 73900401016968bb74806df2100af4fbb2c532ca | refs/heads/master | 2020-07-02T23:53:08.394593 | 2017-08-19T09:20:41 | 2017-08-19T09:20:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | package net.myspring.report.modules.future.dto;
import net.myspring.common.dto.DataDto;
import java.math.BigDecimal;
public class ProductMonthPriceDetailDto extends DataDto{
private BigDecimal price2;
private BigDecimal price3;
private BigDecimal baokaPrice;
private String productTypeId;
private String productMonthPriceId;
public BigDecimal getPrice2() {
return price2;
}
public void setPrice2(BigDecimal price2) {
this.price2 = price2;
}
public BigDecimal getPrice3() {
return price3;
}
public void setPrice3(BigDecimal price3) {
this.price3 = price3;
}
public BigDecimal getBaokaPrice() {
return baokaPrice;
}
public void setBaokaPrice(BigDecimal baokaPrice) {
this.baokaPrice = baokaPrice;
}
public String getProductTypeId() {
return productTypeId;
}
public void setProductTypeId(String productTypeId) {
this.productTypeId = productTypeId;
}
public String getProductMonthPriceId() {
return productMonthPriceId;
}
public void setProductMonthPriceId(String productMonthPriceId) {
this.productMonthPriceId = productMonthPriceId;
}
}
| [
"wangzm@12456"
] | wangzm@12456 |
a4c5fe35b6987f1444b2b8fd39080eeb85b139ec | 02570607edea101396ff231025498056ece3df31 | /app/src/main/java/com/walton/filebrowser/adapter/UsbItemAdapter.java | 8e91f6663a222053b8244b5c1aeaa80f10b7c3bb | [] | no_license | SKToukir/FileBrowser-TV | 978048f6d172224522d57b06a2282b2f9fd922ea | 25b6d2f19bd76d7933f143744d1b01a40958f2ef | refs/heads/master | 2023-03-05T15:12:25.861913 | 2021-02-18T04:41:21 | 2021-02-18T04:41:21 | 334,580,130 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,200 | java | package com.walton.filebrowser.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.walton.filebrowser.R;
import com.walton.filebrowser.business.data.BaseData;
import com.walton.filebrowser.util.StorageSpaceCount;
import com.walton.filebrowser.util.USB;
import java.util.ArrayList;
import java.util.List;
public class UsbItemAdapter extends BaseAdapter {
private static final String TAG = "UsbItemAdapter";
private List<BaseData> list = new ArrayList<>();
private LayoutInflater mInflater;
private int[] pockets_image = {R.drawable.sys_pocket_one, R.drawable.sys_pocket_four, R.drawable.sys_pocket_three};//,R.drawable.sys_pocket_four};
private int[] pockets_round_image = {R.drawable.circle_back_one, R.drawable.circle_back_four, R.drawable.circle_back_three};//,R.drawable.circle_back_four};
private Context mContext;
private int pocketIndex;
public UsbItemAdapter(List<BaseData> list, Context mContext) {
this.list = list;
this.mContext = mContext;
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
UsbViewHolder viewHolder = null;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.usb_item, parent, false);
convertView.setTag(new UsbViewHolder(convertView));
}
viewHolder = (UsbViewHolder) convertView.getTag();
bindViewData(position, viewHolder);
return convertView;
}
private void bindViewData(int position, UsbViewHolder viewHolder) {
BaseData usb = list.get(position);
Log.d(TAG, "bindViewData: USB name " + usb.getName());
if (position % pockets_image.length == 0) {
viewHolder.rlItemHolder.setBackgroundResource(pockets_image[0]);
// viewHolder.rlItemHolder.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlItemHolder.setBackgroundResource(pockets_image[0]);
// }
// });
viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[0]);
// viewHolder.rlPocketRound.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[0]);
// }
// });
} else if (position % pockets_image.length == 1) {
viewHolder.rlItemHolder.setBackgroundResource(pockets_image[1]);
// viewHolder.rlItemHolder.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlItemHolder.setBackgroundResource(pockets_image[1]);
// }
// });
viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[1]);
// viewHolder.rlPocketRound.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[1]);
// }
// });
} else if (position % pockets_image.length == 2) {
viewHolder.rlItemHolder.setBackgroundResource(pockets_image[2]);
// viewHolder.rlItemHolder.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlItemHolder.setBackgroundResource(pockets_image[2]);
// }
// });
viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[2]);
// viewHolder.rlPocketRound.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[2]);
// }
// });
} else if (position % pockets_image.length == 3) {
viewHolder.rlItemHolder.setBackgroundResource(pockets_image[3]);
// viewHolder.rlItemHolder.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlItemHolder.setBackgroundResource(pockets_image[3]);
// }
// });
viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[3]);
// viewHolder.rlPocketRound.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.rlPocketRound.setBackgroundResource(pockets_round_image[3]);
// }
// });
}
Log.d(TAG, "bindViewData: Position:" + position);
if (position == 0) {
viewHolder.txt_storage_name.setText("Local Storage");
// viewHolder.txt_storage_name.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.txt_storage_name.setText("Local Storage");
// }
// });
viewHolder.imgUsbDisk.setImageResource(R.drawable.system_storage);
viewHolder.imgUsbDisk.setScaleType(ImageView.ScaleType.FIT_CENTER);
// viewHolder.imgUsbDisk.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.imgUsbDisk.setImageResource(R.drawable.system_storage);
// viewHolder.imgUsbDisk.setScaleType(ImageView.ScaleType.FIT_CENTER);
// }
// });
} else {
viewHolder.txt_storage_name.setText(usb.getName());
Log.d(TAG, "run: What the hell is hapenning " + usb.getName());
// viewHolder.txt_storage_name.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.txt_storage_name.setText(usb.getName());
// Log.d(TAG, "run: What the hell is hapenning "+usb.getName());
// }
// });
viewHolder.imgUsbDisk.setImageResource(R.drawable.usb);
viewHolder.imgUsbDisk.setScaleType(ImageView.ScaleType.FIT_CENTER);
// viewHolder.imgUsbDisk.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.imgUsbDisk.setImageResource(R.drawable.usb);
// viewHolder.imgUsbDisk.setScaleType(ImageView.ScaleType.FIT_CENTER);
// }
// });
}
if (Integer.parseInt(usb.getStorageUses()) > 85){
viewHolder.pbarSystem.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.progressbar_low_space));
}else {
viewHolder.pbarSystem.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.progress_bar_horizontal));
}
viewHolder.pbarSystem.setSecondaryProgress(100);
viewHolder.pbarSystem.setProgress(Integer.parseInt(usb.getStorageUses()));
// viewHolder.pbarSystem.post(new Runnable() {
// @Override
// public void run() {
// viewHolder.pbarSystem.setSecondaryProgress(100);
// viewHolder.pbarSystem.setProgress(Integer.parseInt(usb.getStorageUses()));
// }
// });
viewHolder.txtSystemStorageSizeAvilable.setText(usb.getStorageFree() + " free of " + usb.getStorageTotal());
// viewHolder.txtSystemStorageSizeAvilable.post(new Runnable() {
// @SuppressLint("SetTextI18n")
// @Override
// public void run() {
// viewHolder.txtSystemStorageSizeAvilable.setText(usb.getStorageFree() + " free of " + usb.getStorageTotal());
// }
// });
}
class UsbViewHolder {
private ImageView imgUsbDisk;
private ProgressBar pbarSystem;
private RelativeLayout rlSysPocket, rlItemHolder, rlPocketRound;
private TextView txt_storage_name, txtSystemStorageSizeAvilable;
public UsbViewHolder(View view) {
imgUsbDisk = view.findViewById(R.id.imgUsbDisk);
pbarSystem = view.findViewById(R.id.pbarSystem);
rlSysPocket = view.findViewById(R.id.rlSysPocket);
rlItemHolder = view.findViewById(R.id.rlItemHolder);
rlPocketRound = view.findViewById(R.id.rlPocketRound);
txt_storage_name = view.findViewById(R.id.txt_storage_name);
txtSystemStorageSizeAvilable = view.findViewById(R.id.txtSystemStorageSizeAvilable);
}
}
}
| [
"toukirsk@gmail.com"
] | toukirsk@gmail.com |
9547a699b7db428d07174be4e6d05afb12503614 | 5832134be6eea906cfc2f364dcdd1837634a67ba | /trunk/spikes/mikes-workspace/de.berlios.rcpviewer.gui/src/de/berlios/rcpviewer/gui/GuiPlugin.java | bcc18cbecd85c239e87221a7ecf0a2b3656edf0d | [] | no_license | BackupTheBerlios/rcpviewer-svn | 61c0ea77a3c2e3639656338623f61cb02135112c | eb63faba1c5e9c812a99df389acf2ec31ec60745 | refs/heads/master | 2020-06-04T07:12:21.899064 | 2006-02-28T22:34:19 | 2006-02-28T22:34:19 | 40,805,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,208 | java | package de.berlios.rcpviewer.gui;
import java.text.DateFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.apache.log4j.Logger;
import org.apache.log4j.net.SocketAppender;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.ecore.ETypedElement;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
import de.berlios.rcpviewer.domain.runtime.IDomainBootstrap;
import de.berlios.rcpviewer.gui.fieldbuilders.FieldBuilderFactory;
import de.berlios.rcpviewer.gui.fieldbuilders.IFieldBuilder;
import de.berlios.rcpviewer.gui.jobs.DomainBootstrapJob;
import de.berlios.rcpviewer.gui.jobs.ObjectStoreBootstrapJob;
import de.berlios.rcpviewer.gui.jobs.SessionBootstrapJob;
import de.berlios.rcpviewer.persistence.IObjectStore;
/**
* The main plugin class for base GUI functionality.
*/
public class GuiPlugin extends AbstractUIPlugin {
/**
* Common formatting for all dates.
*/
public static final DateFormat DATE_FORMATTER
= DateFormat.getDateInstance(DateFormat.SHORT);
// the shared instance.
private static GuiPlugin __plugin = null;
// fields
private FieldBuilderFactory _fieldBuilderFactory = null;
private UniversalLabelProvider _universalLabelProvider = null;
private PackageAdmin _packageAdmin = null;
/* static methods */
/**
* Returns the shared instance.
*/
public static GuiPlugin getDefault() {
return __plugin;
}
/**
* Returns the string from the plugin's resource bundle,
* or the key value if not found.
* <br>Note that this implementation is <b>not</b> the default given
* by the plugin creation wizard but instead accesses resources
* via the Plugin's OSGI bundle.
*/
public static String getResourceString(String key) {
ResourceBundle bundle
= Platform.getResourceBundle( getDefault().getBundle() );
try {
return (bundle != null) ? bundle.getString(key) : key;
}
catch (MissingResourceException e) {
return key;
}
}
/* lifecycle methods */
/**
* The constructor.
*/
public GuiPlugin() {
super();
__plugin = this;
}
/**
* Initialises the domain and gui factories - any errors cause a
* <code>CoreException</code> to be thrown and the bundle will not be started.
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
* @see org.eclipse.core.runtime.CoreException
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
SocketAppender socketAppender = new SocketAppender("localhost", 4445); //$NON-NLS-1$
socketAppender.setLocationInfo(true);
Logger.getRootLogger().addAppender(socketAppender);
// Logger.getLogger(GuiPlugin.class).info( "Logging started" ); //$NON-NLS-1$
// domain initialisation
IDomainBootstrap bootstrap = DomainBootstrapFactory.createBootstrap();
DomainBootstrapJob domainJob = new DomainBootstrapJob( bootstrap );
domainJob.schedule();
// object store initialisation
IObjectStore store = ObjectStoreFactory.createObjectStore();
ObjectStoreBootstrapJob storeJob = new ObjectStoreBootstrapJob( store );
storeJob.schedule();
// session initialisation (default domain & store for now )
SessionBootstrapJob sessionJob = new SessionBootstrapJob( store );
sessionJob.schedule();
// instantiate fields
_fieldBuilderFactory = new FieldBuilderFactory();
_universalLabelProvider = new UniversalLabelProvider();
ServiceReference ref = context.getServiceReference(
PackageAdmin.class.getName());
_packageAdmin = (PackageAdmin)context.getService( ref );
// effectively running jobs synchronously
waitForJob( domainJob );
waitForJob( sessionJob );
}
/**
* Clears all references
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
__plugin = null;
}
/* public accessors */
/**
* Accessor to field builders
* @param element
* @return field builder
*/
public IFieldBuilder getFieldBuilder( ETypedElement element ) {
return _fieldBuilderFactory.getFieldBuilder( element );
}
/**
* Accessor to universal label providers
* @return Returns the label provider
*/
public ILabelProvider getLabelProvider() {
return _universalLabelProvider;
}
/**
* Accessor to platform utility class.
* @return
*/
public PackageAdmin getPackageAdmin() {
assert _packageAdmin != null;
return _packageAdmin;
}
/* private methods */
// as it says
private void waitForJob( Job job ) throws InterruptedException, CoreException {
assert job != null;
job.join();
if ( !job.getResult().isOK() ) {
getLog().log( job.getResult() );
throw new CoreException( job.getResult() );
}
}
}
| [
"dkhaywood@20aa5975-49f2-0310-8bfd-f14d13945a73"
] | dkhaywood@20aa5975-49f2-0310-8bfd-f14d13945a73 |
032505b218089c9a71f2316246494598b818c7a7 | 1728dbc0c7d09d6eae6473ad4ba4ff020090f148 | /day08_File/src/org/bigjava/servlet/UploadServlet.java | 38286b7b0dc58fd866e9cea6cee40b7fc44d4c5c | [] | no_license | hualong-hu/JavaWeb | d0cb681b4181e3b3f2bc96dd6a4aad8134c971d7 | 4a5ad3e404898d7ae93ac3e6d1c0924c2da15ded | refs/heads/master | 2023-01-22T13:08:18.750139 | 2020-12-06T05:27:59 | 2020-12-06T05:27:59 | 318,958,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,626 | java | package org.bigjava.servlet;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* @ProjectName: JavaWeb
* @ClassName: UploadServlet
* @Description: TODO
* @Author: 洛笙
* @Date: 2020-06-03 10:40
* @Version v1.0
*/
public class UploadServlet extends HttpServlet {
/**
* 用于处理上传数据
* @data: 2020-06-03-10:43
* @User: 洛笙
* @method: doPost
* @params: [req, resp]
* @return: void
* @Description: 描述
*/
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
//1.判断上传的数据是否为多段数据(只有多段的数据才是文件上传)
if (ServletFileUpload.isMultipartContent(req)){
//创建FileItemFactory工厂实现类
FileItemFactory fileItemFactory = new DiskFileItemFactory();
//创建用于解析上传数据的工具类ServletFileUpload类
ServletFileUpload servletFileUpload = new ServletFileUpload(fileItemFactory);
//解析上传的数据,得到每一个表单项FileItem
List<FileItem> list = servletFileUpload.parseRequest(req);
//循环判断,每一个表单项是普通类型,还是上传的文件
for (FileItem fileItem : list){
if (fileItem.isFormField()){
//普通表单项
System.out.println("表单项的name属性值:"+fileItem.getFieldName());
//参数utf-8解决乱码问题
System.out.println("表单项的value属性值:"+fileItem.getString("UTF-8"));
}else {
//上传的文件
System.out.println("表单项的name属性值:"+fileItem.getFieldName());
System.out.println("上传的文件名:"+ fileItem.getName());
fileItem.write(new File("d:\\"+fileItem.getName()));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"luosheng_glb@qq.com"
] | luosheng_glb@qq.com |
e406075469850ecbcc4b914c5f5abc5aff7f42a3 | 88fad1e25f3707ff08c117c76917cffcc1af6513 | /aspa/src/main/java/com/lori/aspa/api/AuthorizationApi.java | ca9d5af5ac1584e21bb7304749328ca24f480bc7 | [] | no_license | brunolori/aspa | 9f8e06230cb26a58aed745dda31b1bfb9263f4f6 | 5aff65f431fcb11e20c0e61722720b9e3d0701f2 | refs/heads/master | 2020-03-13T04:57:38.231617 | 2018-06-21T12:08:07 | 2018-06-21T12:08:07 | 130,972,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,688 | java | package com.lori.aspa.api;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.lori.aspa.api.req.AuthorizationReq;
import com.lori.aspa.dto.ApprovalHistoryDTO;
import com.lori.aspa.dto.AuthorizationDTO;
import com.lori.aspa.dto.UserDTO;
import com.lori.aspa.exceptions.AppException;
import com.lori.aspa.model.MyDashboardDTO;
import com.lori.aspa.security.TokenUtil;
import com.lori.aspa.services.AuthorizationService;
import com.lori.aspa.services.PdfExporter;
import com.lori.aspa.services.UserService;
@RestController
@RequestMapping("/api/authorization")
public class AuthorizationApi {
@Autowired
AuthorizationService authorizationService;
@Autowired
UserService userService;
@Autowired
PdfExporter pdfExporter;
@RequestMapping(value = "/findAuthorization/{id}", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> findAuthorization(@PathVariable(name = "id") Integer authorizationId) {
AuthorizationDTO auth = authorizationService.findAuthorizationById(authorizationId);
if (auth == null) {
return new ResponseEntity<String>(new String("Nuk u gjend autorizimi"), HttpStatus.NOT_FOUND);
}
return new ResponseEntity<>(auth, HttpStatus.OK);
}
@RequestMapping(value = "/searchAuthorization", method = RequestMethod.POST, produces = "application/json")
public ResponseEntity<?> searchAuthorization(@RequestHeader(value = "Authorization") String token,
@RequestBody AuthorizationReq req) {
List<AuthorizationDTO> auths = authorizationService.searchAuthorization(req);
return new ResponseEntity<>(auths, HttpStatus.OK);
}
@RequestMapping(value = "/myDashboard", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> getMyDashboard(@RequestHeader(value = "Authorization") String token) {
String uname = TokenUtil.getUsername(token);
MyDashboardDTO dash = authorizationService.getMydashboard(uname);
return new ResponseEntity<>(dash, HttpStatus.OK);
}
@RequestMapping(value = "/register", method = RequestMethod.POST, produces = { "application/json" })
public ResponseEntity<?> registerAuthorization(@RequestHeader(value = "Authorization") String token,
@RequestBody AuthorizationDTO dto) {
try {
String uname = TokenUtil.getUsername(token);
UserDTO u = userService.findUserByUsername(uname);
dto.setUserId(u.getId());
AuthorizationDTO auth = authorizationService.registerAuthorization(dto);
return new ResponseEntity<>(auth, HttpStatus.OK);
} catch (AppException e) {
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
}
}
@RequestMapping(value = "/modify", method = RequestMethod.POST, produces = { "application/json" })
public ResponseEntity<?> modifyAuthorization(@RequestHeader(value = "Authorization") String token,
@RequestBody AuthorizationDTO dto) {
try {
String uname = TokenUtil.getUsername(token);
AuthorizationDTO auth = authorizationService.modifyAuthorization(dto, uname);
return new ResponseEntity<>(auth, HttpStatus.OK);
} catch (AppException e) {
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
}
}
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = { "application/json" })
public ResponseEntity<?> delete(@RequestHeader(value = "Authorization") String token,
@RequestBody AuthorizationDTO dto) {
AuthorizationDTO auth = authorizationService.delete(dto);
return new ResponseEntity<>(auth, HttpStatus.OK);
}
@RequestMapping(value = "/decide", method = RequestMethod.POST, produces = { "application/json" })
public ResponseEntity<?> decide(@RequestHeader(value = "Authorization") String token,
@RequestBody ApprovalHistoryDTO dto) {
try {
String uname = TokenUtil.getUsername(token);
authorizationService.decide(dto, uname);
return new ResponseEntity<>(HttpStatus.OK);
} catch (AppException e) {
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
}
}
@RequestMapping(value = "/getAuthHistory/{auth_id}", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> getVerifiedAuths(@RequestHeader(value = "Authorization") String token,
@PathVariable(name = "auth_id") Integer authId) {
List<ApprovalHistoryDTO> histories = authorizationService.getAuthHistory(authId);
return new ResponseEntity<>(histories, HttpStatus.OK);
}
@RequestMapping(value = "/getAuthorizationsToVerify", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> getAuthsToVerify(@RequestHeader(value = "Authorization") String token) {
String uname = TokenUtil.getUsername(token);
List<AuthorizationDTO> auths = authorizationService.getAuthsToVerify(uname);
return new ResponseEntity<>(auths, HttpStatus.OK);
}
@RequestMapping(value = "/getVerifiedAuths", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> getVerifiedAuths(@RequestHeader(value = "Authorization") String token) {
String uname = TokenUtil.getUsername(token);
List<AuthorizationDTO> auths = authorizationService.getVerifiedAuths(uname);
return new ResponseEntity<>(auths, HttpStatus.OK);
}
@RequestMapping(value = "/pdfAuth/{auth_id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_PDF_VALUE)
public ResponseEntity<InputStreamResource> pdfExporter(@PathVariable(name = "auth_id") Integer authorizationId)
throws IOException {
AuthorizationDTO authorization = authorizationService.findAuthorizationById(authorizationId);
InputStream bis = pdfExporter.authorizationPdf(authorization);
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Disposition", "inline; filename=authorization.pdf");
return ResponseEntity.ok().headers(headers).contentType(MediaType.APPLICATION_PDF)
.body(new InputStreamResource(bis));
}
}
| [
"lorela.shehu@DTI-PROGRAM-25.ASP.gov.al"
] | lorela.shehu@DTI-PROGRAM-25.ASP.gov.al |
548dcbb691f64c2afc37d3621cc850806ed72876 | 0917a6cefcc3c3d6766080e58e83cd027522d0a8 | /src/main/java/socket/TCPEchoClient.java | 28aac640b9e3421f035d9c0af7e9dee0ff518a2e | [] | no_license | lyk4411/untitled1_intellij | 19bb583c8e631c4fab5826573fe30a61dff9d2d4 | 7a3e9ff784faa03c04a40cfdc0ba53af3344bb09 | refs/heads/master | 2022-12-22T13:58:32.218291 | 2020-01-22T08:58:04 | 2020-01-22T08:58:04 | 62,300,156 | 0 | 0 | null | 2022-12-16T03:16:30 | 2016-06-30T09:56:05 | Java | UTF-8 | Java | false | false | 1,686 | java | package socket;
/**
* Created by lyk on 2016/7/8.
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.SocketException;
public class TCPEchoClient {
public static void main(String[] args) throws IOException {
if ((args.length < 2) || (args.length > 3)) // Test for correct # of args
throw new IllegalArgumentException("Parameter(s): <Server> <Word> [<Port>]");
String server = args[0]; // Server name or IP address
// Convert argument String to bytes using the default character encoding
byte[] data = args[1].getBytes();
int servPort = (args.length == 3) ? Integer.parseInt(args[2]) : 7;
// Create socket that is connected to server on specified port
Socket socket = new Socket(server, servPort);
System.out.println("Connected to server...sending echo string");
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
out.write(data); // Send the encoded string to the server
// Receive the same string back from the server
int totalBytesRcvd = 0; // Total bytes received so far
int bytesRcvd; // Bytes received in last read
while (totalBytesRcvd < data.length) {
if ((bytesRcvd = in.read(data, totalBytesRcvd, data.length - totalBytesRcvd)) == -1)
throw new SocketException("Connection closed prematurely");
totalBytesRcvd += bytesRcvd;
} // data array is full
System.out.println("Received: " + new String(data));
socket.close(); // Close the socket and its streams
}
} | [
"moneyflying_2006@hotmail.com"
] | moneyflying_2006@hotmail.com |
928f51e6712e648bc85b2bde752c85809bc0c2d9 | fc90d25de2b2de1fe88316bf6d0028b57b820f05 | /src/com/skilldistillery/jets/entity/Cessna172Skyhawk.java | 35365cbd447150c88324053b32090fa08b09ddfc | [] | no_license | CWRiddle/Jets | 9bb45e881329dfb67a4eb523ecbecab0bdbb48f5 | ff55a86b7d25de1d1d869421abf0430713ab23c0 | refs/heads/main | 2023-05-06T23:58:42.358172 | 2021-06-01T14:25:40 | 2021-06-01T14:25:40 | 372,670,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package com.skilldistillery.jets.entity;
public class Cessna172Skyhawk extends CivilianAircraft {
public Cessna172Skyhawk(){
super("Cessna 172 Skyhawk", 583, 3452.338, 90000000.00);
}
public Cessna172Skyhawk(String name, int speed, double range, double price) {
super(name, speed, range, price);
}
@Override
public void loadCargo() {
System.out.println("Loaded [blank] pounds of cargo into the Cessna 172 Skyhawk.");
}
@Override
public void loadPassengers() {
System.out.println("Loaded [blank] passengers in the Cessna 172 Skyhawk.");
}
}
| [
"cwriddle5@gmail.com"
] | cwriddle5@gmail.com |
d8fccc2a5781053593654af09293aae36ccaf8a7 | 5f8c256f5085bc053dd01a0ea75122ec43c090d1 | /src/main/java/com/zongb/sm/entity/OcParameter.java | a5476263c21d00f7081410890c4d448a19111bca | [] | no_license | heichong/sm | b4ffeb11805d5e817e81086cf33ecc6717f2fb5b | 1aebec032d9fadebea8f2ecd949ad14bbbd19e15 | refs/heads/master | 2016-09-10T14:03:59.844231 | 2014-01-04T07:28:47 | 2014-01-04T07:28:47 | 13,403,067 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,481 | java | package com.zongb.sm.entity;
import java.util.HashMap;
import java.util.Map;
public class OcParameter {
private String urlPath ;
private int languageEn ;
private int languageCn ;
private String imageDataPath ;//opencart的image的全路径<br/>路径截止到data文件夹
private String productTypeCode ;//您为当前商品自定义的编码
private int productSeqStart = 1 ;//商品序列的初始值
private int brandId ;//商品所属的品牌id<br/>参考[商品->链接->品牌]
private int minNumDiff ;//商品描述的默认tag标签
private float productPriceTime ;//商品价格与实际价格的倍数
private String desItemType ;//商品描述的Item Type
private String descTags ;//商品描述的默认tag标签
private String [] categorys ;//所属目录id
private String style ;//其他描述html
private String braceletType ;//其他描述html
private String otherHtml ;//其他描述html
private Integer storeId = 0 ;//商店id
private Boolean isDownloadImage = false ;//是否下载产品图片
private Boolean onlyGetCurrentPage = false ;//是否只抽取当前页面的产品
/**
* 常用计量单位名称与opencart系统中计量单位id的对应关系
*/
public static Map<String,Integer> unitMap = null ;
static{
unitMap = new HashMap<String,Integer>() ;
unitMap.put("CM",1) ;//厘米
unitMap.put("MM",2) ;//毫米
unitMap.put("G",2) ;//克
unitMap.put("克",2) ;//克
unitMap.put("KG",1) ;//千克
unitMap.put("千克",1) ;//千克
}
public Boolean getOnlyGetCurrentPage() {
return onlyGetCurrentPage;
}
public void setOnlyGetCurrentPage(Boolean onlyGetCurrentPage) {
this.onlyGetCurrentPage = onlyGetCurrentPage;
}
public Boolean getIsDownloadImage() {
return isDownloadImage;
}
public void setIsDownloadImage(Boolean isDownloadImage) {
this.isDownloadImage = isDownloadImage;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getBraceletType() {
return braceletType;
}
public void setBraceletType(String braceletType) {
this.braceletType = braceletType;
}
public static Map<String, Integer> getUnitMap() {
return unitMap;
}
public static void setUnitMap(Map<String, Integer> unitMap) {
OcParameter.unitMap = unitMap;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getOtherHtml() {
return otherHtml;
}
public void setOtherHtml(String otherHtml) {
this.otherHtml = otherHtml;
}
public String getUrlPath() {
return urlPath;
}
public void setUrlPath(String urlPath) {
this.urlPath = urlPath;
}
public int getLanguageEn() {
return languageEn;
}
public void setLanguageEn(int languageEn) {
this.languageEn = languageEn;
}
public int getLanguageCn() {
return languageCn;
}
public void setLanguageCn(int languageCn) {
this.languageCn = languageCn;
}
public String getImageDataPath() {
return imageDataPath;
}
public void setImageDataPath(String imageDataPath) {
this.imageDataPath = imageDataPath;
}
public String getProductTypeCode() {
return productTypeCode;
}
public void setProductTypeCode(String productTypeCode) {
this.productTypeCode = productTypeCode;
}
public int getProductSeqStart() {
return productSeqStart;
}
public void setProductSeqStart(int productSeqStart) {
this.productSeqStart = productSeqStart;
}
public int getBrandId() {
return brandId;
}
public void setBrandId(int brandId) {
this.brandId = brandId;
}
public int getMinNumDiff() {
return minNumDiff;
}
public void setMinNumDiff(int minNumDiff) {
this.minNumDiff = minNumDiff;
}
public float getProductPriceTime() {
return productPriceTime;
}
public void setProductPriceTime(float productPriceTime) {
this.productPriceTime = productPriceTime;
}
public String getDesItemType() {
return desItemType;
}
public void setDesItemType(String desItemType) {
this.desItemType = desItemType;
}
public String getDescTags() {
return descTags;
}
public void setDescTags(String descTags) {
this.descTags = descTags;
}
public String[] getCategorys() {
return categorys;
}
public void setCategorys(String[] categorys) {
this.categorys = categorys;
}
}
| [
"hnzb521@126.com"
] | hnzb521@126.com |
de23eac94c1f29d6d64efe36ac1364942636e9f7 | 805c02a6968c5b88cca6e0c9e7af7a88e8e3ead9 | /src/protocol/Chat.java | dbf29a4185a9642c06c5efba941663c8e31341aa | [] | no_license | ZolaBaksa/javachat | ca291d10a5a0dd0052c856065c31492093279e1c | 2de7ac8255d8c57d8e788a086077948824ae5254 | refs/heads/main | 2023-01-29T03:27:44.563082 | 2020-12-03T02:35:37 | 2020-12-03T02:35:37 | 318,051,534 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 174 | java | package protocol;
//public final static 생략가능
public interface Chat {
String ALL = "ALL"; //전체
String MSG = "MSG"; //귓속말
String ID = "ID"; //아이디
}
| [
"ssar@nate.com"
] | ssar@nate.com |
517cee0267b8b32c7e9bc99ab8e163ad12fa0d57 | 2adf0d1b5e9413a566f8069c7346d0c3e0736266 | /Day 9/Address Book System/src/Sample.java | c372ded22c32125bd096639a92a705f58fdd97ff | [] | no_license | sajan19/Fellowship_BridgeLabz | 71b5c55c1f59c27058d73c142d476629f66ba37e | 479c43f47c5b78f474de9f0d647438db71c5e458 | refs/heads/master | 2023-07-27T05:41:49.688322 | 2021-09-04T06:57:22 | 2021-09-04T06:57:22 | 396,930,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,181 | java | import java.util.Scanner;
public class Sample {
String firstName;
String lastName;
public static void ContactBook(){
System.out.println("Address Book Details: ");
Scanner sc = new Scanner(System.in);
System.out.println("Enter First Name");
String firstName = sc.next();
// System.out.println("First Name: "+ firstName);
System.out.println("Enter Last Name");
String lastName = sc.next();
System.out.println("First Name: "+ firstName +","+" Last Name: "+ lastName);
}
// class Demo extends AddressBookSystem{
public static void newContact(){
boolean bravo = false;
System.out.println("Want to Enter New Contact Details?");
Scanner c = new Scanner(System.in);
bravo=c.nextBoolean();
if (bravo) {
System.out.println("Enter New Contact Details ");
ContactBook();
}
else{
System.out.println("Have a Good Day!");
}
}
public static void main(String[] args) {
ContactBook();
newContact();
// AddressBookSystem hell = new demo();
// hell.newContact();
}
}
| [
"sajanmhatre29@gmail.com"
] | sajanmhatre29@gmail.com |
fcbfb9b1a459b742c919f2ce88ad067b40ec45bc | b65df13009525f3a32dcbd760aeaa32479af2c7d | /TheRecipe/src/main/java/com/increpas/therecipe/util/BlankChange.java | f8ac93a1f84c4704a09beeb7c07bf093cb390dc5 | [] | no_license | Increpas19gi-Team3/TheRecipe | 860de770eaee6f81f951a43186cf6f93dac866bc | 26dc79354dc6545e4154c54938c09fa22932a194 | refs/heads/master | 2021-08-30T14:02:31.989408 | 2017-12-18T07:50:51 | 2017-12-18T07:50:51 | 111,801,199 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,346 | java | package com.increpas.therecipe.util;
/**
* Blank 값 처리하는 클래스
* @author 손가연
*
*/
public class BlankChange {
/**
* "" 데이터가 들어오면 "0" 값으로 돌려보내기
* @param data
* @return data == "" → "0" /
* data != "" → data
*/
public static String doStringZero(String data){
if(data.equals("")) return "0";
else return data;
}
/**
* "" 데이터가 들어오면 0 값으로 돌려보내기
* @param data
* @return data == "" → 0 /
* data != "" → Integer.parseInt(data)
*/
public static int doIntegerZero(String data){
if(data.equals("")) return 0;
else return Integer.parseInt(data);
}
/**
* "" 데이터가 들어오면 number 값으로 돌려보내기
* @param data
* @return data == "" → number /
* data != "" → data
*/
public static String doStringNumber(String data, String number){
if(data.equals("")) return number;
else return data;
}
/**
* "" 데이터가 들어오면 0 값으로 돌려보내기
* @param data
* @return data == "" → number /
* data != "" → Integer.parseInt(data)
*/
public static int doIntegerNumber(String data, int number){
if(data.equals("")) return number;
else return Integer.parseInt(data);
}
}
| [
"cyp0507@gmail.com"
] | cyp0507@gmail.com |
fa39ef1bed7de9433c7ccf2d39c0a3b696420a33 | 88efa77e6da0b36dd85525251e9502023ea5a7a4 | /src/main/java/com/andrei/accela/codingexercise/service/AddressService.java | 6883cee26064fcf603db1bceae17f02b88046757 | [] | no_license | abalzan/codingexercise | 7faaf7f3d73f1392452850c48d93564256cb4db6 | 855692c5f5beed980a851f89552eb7d29f7968ad | refs/heads/master | 2023-03-07T22:22:50.507241 | 2021-02-20T14:19:51 | 2021-02-20T14:19:51 | 340,667,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package com.andrei.accela.codingexercise.service;
import com.andrei.accela.codingexercise.dto.AddressDto;
import com.andrei.accela.codingexercise.dto.PersonDto;
import com.andrei.accela.codingexercise.model.Address;
import com.andrei.accela.codingexercise.model.Person;
import java.util.List;
import java.util.Set;
import java.util.UUID;
public interface AddressService {
List<AddressDto> getAllAddresses();
PersonDto save(UUID personId, AddressDto addressDto);
void saveAddressList(Person person, Set<AddressDto> addressDto);
Address getAddressById(UUID id);
AddressDto update(UUID addressId, AddressDto addressDto);
void delete(UUID personId, UUID addressId);
Set<Address>getAllPersonAddresses(Person person);
}
| [
"andreibalzan@gmail.com"
] | andreibalzan@gmail.com |
eb758a810ae3eafb05e61d7c75b50f80b62c65cd | 979b9f90f551d2551baaa78379aba616dde85d34 | /src/Ejercicios_asociaciones_triangulo/prueba.java | 1f5420601728f62988332bf47471160702dff687 | [] | no_license | jgarnicaa/animacionC | c2b1d576771e78fa751c95c6509aa19aaf1284dd | da0b56c87e5e6cedaf89f40e8d7651da98f6d607 | refs/heads/master | 2020-06-05T21:21:20.955370 | 2019-06-18T13:51:44 | 2019-06-18T13:51:44 | 192,549,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | 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 Ejercicios_asociaciones_triangulo;
import java.util.*;
/**
*
* @author usuario
*/
public class prueba {
public static void main(String[]arg){
color f = new color(10,10,30);
color c = new color(20,20,10);
vertices v1 = new vertices(10,10);
vertices v2= new vertices (20,30);
vertices v3 = new vertices (0, 5);
triangulo t= new triangulo(v1,v2,v3,c,f);
double area=t.calcularArea();
System.out.println(area);
}
}
| [
"usuario@BE453S203C4ING.unal.loc"
] | usuario@BE453S203C4ING.unal.loc |
9a96cb5db8f8702919f671b309137a9099c61c40 | 2bf15be3d6d83e4fb4bad9868e60e79261353b54 | /SourceCode/Server/Quiz_App/src/model/notification/Notification_Body.java | f0e36c1732fe0653351cf9c5ef5073149b9facde | [] | no_license | OpticWafare/Quiz_App | 23746e243780fb6c0ceeb7ffd51d344d58332500 | 1c2c2124bf615dfe2600c16c1b152b3aef3d1cb5 | refs/heads/master | 2020-04-24T14:28:00.210006 | 2019-03-27T07:13:47 | 2019-03-27T07:13:47 | 172,021,746 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 587 | java | package model.notification;
/**
* Für Android Push Notifications
* Repräsentiert die Daten, die in der
* Notification angezeigt werden sollen
* (Titel und Inhalt)
*
*/
public class Notification_Body {
/** Titeltext der Notification */
private String title;
/** Inhalt der Notification */
private String body;
/**
* Konstruktor
* @param title Titeltext der Notification
* @param body Inhalt der Notification
*/
public Notification_Body(String title, String body)
{
this.title = title;
this.body = body;
}
}
| [
"eller.martin29mail.com"
] | eller.martin29mail.com |
370a42d1155f7d4e22d6a3885ca3da523de7e766 | f2444e57d834bee559dcea6b335701ccb92693f4 | /src/main/java/Objects/Wall.java | 18ad5fe06b8a31b79c2e7b21ffcac1ab56c624fd | [] | no_license | MYIIIKET/NeuralNetwork | d6c5b7cdfc05aec1b9467bfaf8d16581e22276c8 | c623461e719109cdd19d4c61ac7873c0be682ba2 | refs/heads/master | 2021-01-02T22:55:18.605223 | 2017-08-21T07:22:23 | 2017-08-21T07:22:23 | 99,423,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package Objects;
import java.awt.*;
public class Wall extends Element {
private int width;
private int height;
public Wall(int x, int y, int width, int height) {
this.width = width;
this.height = height;
setLayout(null);
setBounds(x, y, width, height);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLACK);
g.fillRect(0, 0, width, height);
}
}
| [
"Evgenii_Sidorenko@epam.com"
] | Evgenii_Sidorenko@epam.com |
849d23416bbbec63669b74618e48fe4908955966 | b6eb0ecadbb70ed005d687268a0d40e89d4df73e | /feilong-lib/feilong-lib-ognl/src/main/java/com/feilong/lib/javassist/tools/reflect/Metalevel.java | 689e9e2b757f28ccd800a82312b482042b8d3876 | [
"Apache-2.0"
] | permissive | ifeilong/feilong | b175d02849585c7b12ed0e9864f307ed1a26e89f | a0d4efeabc29503b97caf0c300afe956a5caeb9f | refs/heads/master | 2023-08-18T13:08:46.724616 | 2023-08-14T04:30:34 | 2023-08-14T04:30:34 | 252,767,655 | 97 | 28 | Apache-2.0 | 2023-04-17T17:47:44 | 2020-04-03T15:14:35 | Java | UTF-8 | Java | false | false | 1,268 | java | /*
* Javassist, a Java-bytecode translator toolkit.
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. Alternatively, the contents of this file may be used under
* the terms of the GNU Lesser General Public License Version 2.1 or later,
* or the Apache License Version 2.0.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*/
package com.feilong.lib.javassist.tools.reflect;
/**
* An interface to access a metaobject and a class metaobject.
* This interface is implicitly implemented by the reflective
* class.
*/
public interface Metalevel{
/**
* Obtains the class metaobject associated with this object.
*/
ClassMetaobject _getClass();
/**
* Obtains the metaobject associated with this object.
*/
Metaobject _getMetaobject();
/**
* Changes the metaobject associated with this object.
*/
void _setMetaobject(Metaobject m);
}
| [
"venusdrogon@163.com"
] | venusdrogon@163.com |
e9c94dc789a6d589ebee0b53a93b3329be1d2c13 | 5e4af3eb976ec9abaf6b9c9bc9b4d6ab38b5cb0d | /salvo2/src/main/java/com/codeoftheweb/salvo/models/Player.java | 574544f4d029db4177e841114c98f2a7c912a157 | [] | no_license | MJ-25/Salvo2 | 9c1be0070efc7b8f33e08a5c9c8bc1351cb6b285 | 90256f01bdd7e23fb15c93f166a0ac035fdf1496 | refs/heads/master | 2020-08-06T15:55:41.671323 | 2019-10-07T19:05:26 | 2019-10-07T19:05:26 | 213,065,698 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,024 | java | package com.codeoftheweb.salvo.models;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
@Entity
public class Player {
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "native")
@GenericGenerator(name = "native", strategy = "native")
private long id;
private String userName;
@OneToMany(mappedBy = "player", fetch = FetchType.EAGER)
Set<GamePlayer> gamePlayers;
@OneToMany(mappedBy = "player", fetch = FetchType.EAGER)
Set<Score> scores;
private String password;
public Player() {
}
public Player(String userName, String password) {
this.userName = userName;
this.password = password;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Set<GamePlayer> getGamePlayers() {
return gamePlayers;
}
public long getId() {
return id;
}
public void setGamePlayers(Set<GamePlayer> gamePlayers) {
this.gamePlayers = gamePlayers;
}
public Set<Score> getScores() {
return scores;
}
public void setScores(Set<Score> scores) {
this.scores = scores;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Map<String, Object> makePlayerDetail() {
Map<String, Object> dto = new LinkedHashMap<>();
dto.put("Id", this.getId());
dto.put("email", this.getUserName());
return dto;
}
public Map<String,Object> makePlayerScoreDTO() {
Map<String, Object> dto = new LinkedHashMap<>();
dto.put("id", this.getId());
dto.put("email", this.getUserName());
dto.put("score", mapaDeScores2());
return dto;
}
public Map <String, Object> mapaDeScores2() {
Map<String, Object> dto = new LinkedHashMap<>();
dto.put("won",this.getWins());
dto.put("tied",this.getTies());
dto.put("lost",this.getLoses());
dto.put("total",this.getTotal());
dto.put("gamesPlayed",this.getGamesPlayed());
return dto;
}
public long getWins(){
return this.getScores().stream()
.filter(score -> score.getScore() == 1)
.count();
}
public long getTies(){
return this.getScores().stream()
.filter(score -> score.getScore() == 0.5)
.count();
}
public long getLoses(){
return this.getScores().stream()
.filter(score -> score.getScore() == 0)
.count();
}
public double getTotal(){
return this.getWins() + getTies()*0.5;
}
public long getGamesPlayed(){
return this.getWins() + this.getTies() + this.getLoses();
}
} | [
"53352542+MJ-25@users.noreply.github.com"
] | 53352542+MJ-25@users.noreply.github.com |
ec9ca01d82fc5dda6b1a872b0e908af0f9a2f09a | 24b545967adf26e2079661e3c4bb334dea5d597d | /app/src/main/java/com/yangy/wechatrecyclerview/util/UrlUtils.java | 1255ab05f3b489e8b38edbcc36918464c08ff78a | [] | no_license | qiushanyueyy/WeChatRecyclerView | 8ba3ce3f1276ba4300409ce905c237efc878b65f | 883f6f0415ba567a5d61442d629e361df361ba2d | refs/heads/master | 2021-01-20T14:24:02.556421 | 2017-07-26T07:18:19 | 2017-07-26T07:18:19 | 90,605,782 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,499 | java | package com.yangy.wechatrecyclerview.util;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.view.View;
import com.yangy.wechatrecyclerview.WebViewActivity;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 检索文本中的url和手机号码
* Created by yangy on 2017/05/12
*/
public class UrlUtils {
public static SpannableStringBuilder formatUrlString(String contentStr) {
SpannableStringBuilder sp;
if (!TextUtils.isEmpty(contentStr)) {
sp = new SpannableStringBuilder(contentStr);
try {
//处理url匹配
Pattern urlPattern = Pattern.compile("(http|https|ftp|svn)://([a-zA-Z0-9]+[/?.?])" +
"+[a-zA-Z0-9]*\\??([a-zA-Z0-9]*=[a-zA-Z0-9]*&?)*");
Matcher urlMatcher = urlPattern.matcher(contentStr);
while (urlMatcher.find()) {
final String url = urlMatcher.group();
if (!TextUtils.isEmpty(url)) {
sp.setSpan(new SpannableClickable() {
@Override
public void onClick(View widget) {
Context context = widget.getContext();
/**打开手机自带的浏览器显示*/
// Uri uri = Uri.parse(url);
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
// intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
// context.startActivity(intent);
/**使用自定义的WebView显示*/
Intent intent = new Intent(context, WebViewActivity.class);
intent.putExtra("url", url);
context.startActivity(intent);
}
}, urlMatcher.start(), urlMatcher.end(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
//处理电话匹配
Pattern phonePattern = Pattern.compile("[1][34578][0-9]{9}");
Matcher phoneMatcher = phonePattern.matcher(contentStr);
while (phoneMatcher.find()) {
final String phone = phoneMatcher.group();
if (!TextUtils.isEmpty(phone)) {
sp.setSpan(new SpannableClickable() {
@Override
public void onClick(View widget) {
Context context = widget.getContext();
//用intent启动拨打电话
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}, phoneMatcher.start(), phoneMatcher.end(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
} catch (Exception e) {
e.printStackTrace();
}
} else {
sp = new SpannableStringBuilder();
}
return sp;
}
}
| [
"qiushanyueyy@sina.com"
] | qiushanyueyy@sina.com |
e4b8d03b1f6653db691c55e6c7ebf1565a83969b | fb14cf2d843987adfaa7e34d67b65ce8dd280ca8 | /Hello/src/main/java/com/helloworld/main/Client.java | f1f3885c67ca6dc7bea96c0ae847991bfafa4a4b | [] | no_license | sumanreddy99/java | 48e0ef7d665d7300b0094a47d9d9476d9e003705 | 19569b68f3f0996ff3cd42d196f80b6c0b0c261a | refs/heads/master | 2022-12-16T09:15:04.285561 | 2020-06-30T11:26:25 | 2020-06-30T11:26:25 | 189,870,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 573 | java | package com.helloworld.main;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.helloworld.Hellodomain.Hello;
public class Client {
public static void main(String[] args) {
// TODO Auto-generated method stub
//Resource resource=new ClassPathResource("spring.xml");
ApplicationContext applicationContext=new ClassPathXmlApplicationContext("resources/applicationContext.xml");
Object o=applicationContext.getBean("hello");
Hello h=(Hello)o;
h.hello();
}
}
| [
"m.suman.reddy@live.com"
] | m.suman.reddy@live.com |
084fc0aa425eda88cda618d703114a77d4ef78d5 | 2d9bd0fc6fd3e788b0cff0d17bc6d74c55d51671 | /Sprint17_repush/referentiel/referentiel-business/src/main/java/dz/gov/mesrs/sii/referentiel/business/model/dto/RefFiliereLmdDto.java | f6b05ce54992457c2d671af2f038e8141643683b | [] | no_license | kkezzar/code2 | 952de18642d118d9dae9b10acc3b15ef7cfd709e | ee7bd0908ac7826074d26e214ef07c594e8a9706 | refs/heads/master | 2016-09-06T04:17:06.896511 | 2015-03-10T13:41:04 | 2015-03-10T13:41:04 | 31,958,723 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 13,369 | java | package dz.gov.mesrs.sii.referentiel.business.model.dto;
import java.io.Serializable;
import java.util.Date;
import javax.xml.bind.annotation.XmlRootElement;
/**
* @author BELBRIK Oualid on : 21 avr. 2014 10:06:12
*/
@XmlRootElement(name = "RefFiliereLmdDto")
public class RefFiliereLmdDto implements Serializable{
/**
* serialVersionUID
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:44
*/
private static final long serialVersionUID = 1L;
private Integer id;
private String identifiant;
private String lcFiliereArabe;
private String lcFiliere;
private String llFiliereArabe;
private String llFiliere;
private String descriptionFiliereArabe;
private String descriptionFiliere;
private Boolean isPremiereInscription;
//private Nomenclature niveauRecrutement;
private Integer niveauRecrutementId;
private String niveauRecrutementLibelleLongFr;
private String niveauRecrutementLibelleLongAr;
private String niveauRecrutementLibelleCourtFr;
private String niveauRecrutementLibelleCourtAr;
private String niveauRecrutementCode;
/*** Current Situation **/
private Date dateSituation;
private String llSituationAr;
private String llSituationFr;
/***** Domaine ******/
private String identifiantDomaine;
private Integer idDomaine;
private String lcDomaine;
private String lcDomaineArabe;
private String llDomaine;
private String llDomaineArabe;
/**
* [RefFiliereLmdDto.id] Getter
* @author MAKERRI Sofiane on : 8 mai 2014 11:56:09
* @return the id
*/
public Integer getId() {
return id;
}
/**
* [RefFiliereLmdDto.id] Setter
* @author MAKERRI Sofiane on : 8 mai 2014 11:56:09
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* [RefFiliereLmdDto.identifiant] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the identifiant
*/
public String getIdentifiant() {
return identifiant;
}
/**
* [RefFiliereLmdDto.identifiant] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param identifiant the identifiant to set
*/
public void setIdentifiant(String identifiant) {
this.identifiant = identifiant;
}
/**
* [RefFiliereLmdDto.lcFiliereArabe] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the lcFiliereArabe
*/
public String getLcFiliereArabe() {
return lcFiliereArabe;
}
/**
* [RefFiliereLmdDto.lcFiliereArabe] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param lcFiliereArabe the lcFiliereArabe to set
*/
public void setLcFiliereArabe(String lcFiliereArabe) {
this.lcFiliereArabe = lcFiliereArabe;
}
/**
* [RefFiliereLmdDto.lcFiliere] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the lcFiliere
*/
public String getLcFiliere() {
return lcFiliere;
}
/**
* [RefFiliereLmdDto.lcFiliere] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param lcFiliere the lcFiliere to set
*/
public void setLcFiliere(String lcFiliere) {
this.lcFiliere = lcFiliere;
}
/**
* [RefFiliereLmdDto.llFiliereArabe] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llFiliereArabe
*/
public String getLlFiliereArabe() {
return llFiliereArabe;
}
/**
* [RefFiliereLmdDto.llFiliereArabe] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llFiliereArabe the llFiliereArabe to set
*/
public void setLlFiliereArabe(String llFiliereArabe) {
this.llFiliereArabe = llFiliereArabe;
}
/**
* [RefFiliereLmdDto.llFiliere] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llFiliere
*/
public String getLlFiliere() {
return llFiliere;
}
/**
* [RefFiliereLmdDto.llFiliere] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llFiliere the llFiliere to set
*/
public void setLlFiliere(String llFiliere) {
this.llFiliere = llFiliere;
}
/**
* [RefFiliereLmdDto.descriptionFiliereArabe] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the descriptionFiliereArabe
*/
public String getDescriptionFiliereArabe() {
return descriptionFiliereArabe;
}
/**
* [RefFiliereLmdDto.descriptionFiliereArabe] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param descriptionFiliereArabe the descriptionFiliereArabe to set
*/
public void setDescriptionFiliereArabe(String descriptionFiliereArabe) {
this.descriptionFiliereArabe = descriptionFiliereArabe;
}
/**
* [RefFiliereLmdDto.descriptionFiliere] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the descriptionFiliere
*/
public String getDescriptionFiliere() {
return descriptionFiliere;
}
/**
* [RefFiliereLmdDto.descriptionFiliere] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param descriptionFiliere the descriptionFiliere to set
*/
public void setDescriptionFiliere(String descriptionFiliere) {
this.descriptionFiliere = descriptionFiliere;
}
/**
* [RefFiliereLmdDto.dateSituation] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the dateSituation
*/
public Date getDateSituation() {
return dateSituation;
}
/**
* [RefFiliereLmdDto.dateSituation] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param dateSituation the dateSituation to set
*/
public void setDateSituation(Date dateSituation) {
this.dateSituation = dateSituation;
}
/**
* [RefFiliereLmdDto.llSituationAr] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llSituationAr
*/
public String getLlSituationAr() {
return llSituationAr;
}
/**
* [RefFiliereLmdDto.llSituationAr] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llSituationAr the llSituationAr to set
*/
public void setLlSituationAr(String llSituationAr) {
this.llSituationAr = llSituationAr;
}
/**
* [RefFiliereLmdDto.llSituationFr] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llSituationFr
*/
public String getLlSituationFr() {
return llSituationFr;
}
/**
* [RefFiliereLmdDto.llSituationFr] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llSituationFr the llSituationFr to set
*/
public void setLlSituationFr(String llSituationFr) {
this.llSituationFr = llSituationFr;
}
/**
/**
* [RefFiliereLmdDto.identifiantDomaine] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the identifiantDomaine
*/
public String getIdentifiantDomaine() {
return identifiantDomaine;
}
/**
* [RefFiliereLmdDto.identifiantDomaine] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param identifiantDomaine the identifiantDomaine to set
*/
public void setIdentifiantDomaine(String identifiantDomaine) {
this.identifiantDomaine = identifiantDomaine;
}
/**
* [RefFiliereLmdDto.lcDomaine] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the lcDomaine
*/
public String getLcDomaine() {
return lcDomaine;
}
/**
* [RefFiliereLmdDto.lcDomaine] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param lcDomaine the lcDomaine to set
*/
public void setLcDomaine(String lcDomaine) {
this.lcDomaine = lcDomaine;
}
/**
* [RefFiliereLmdDto.lcDomaineArabe] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the lcDomaineArabe
*/
public String getLcDomaineArabe() {
return lcDomaineArabe;
}
/**
* [RefFiliereLmdDto.lcDomaineArabe] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param lcDomaineArabe the lcDomaineArabe to set
*/
public void setLcDomaineArabe(String lcDomaineArabe) {
this.lcDomaineArabe = lcDomaineArabe;
}
/**
* [RefFiliereLmdDto.llDomaine] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llDomaine
*/
public String getLlDomaine() {
return llDomaine;
}
/**
* [RefFiliereLmdDto.llDomaine] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llDomaine the llDomaine to set
*/
public void setLlDomaine(String llDomaine) {
this.llDomaine = llDomaine;
}
/**
* [RefFiliereLmdDto.llDomaineArabe] Getter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @return the llDomaineArabe
*/
public String getLlDomaineArabe() {
return llDomaineArabe;
}
/**
* [RefFiliereLmdDto.llDomaineArabe] Setter
* @author BELBRIK Oualid on : 21 avr. 2014 11:56:38
* @param llDomaineArabe the llDomaineArabe to set
*/
public void setLlDomaineArabe(String llDomaineArabe) {
this.llDomaineArabe = llDomaineArabe;
}
/**
* [RefFiliereLmdDto.idDomaine] Getter
* @author MAKERRI Sofiane on : 15 mai 2014 17:19:28
* @return the idDomaine
*/
public Integer getIdDomaine() {
return idDomaine;
}
/**
* [RefFiliereLmdDto.idDomaine] Setter
* @author MAKERRI Sofiane on : 15 mai 2014 17:19:28
* @param idDomaine the idDomaine to set
*/
public void setIdDomaine(Integer idDomaine) {
this.idDomaine = idDomaine;
}
/**
* [RefFiliereLmdDto.isPremiereInscription] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the isPremiereInscription
*/
public Boolean getIsPremiereInscription() {
return isPremiereInscription;
}
/**
* [RefFiliereLmdDto.isPremiereInscription] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param isPremiereInscription the isPremiereInscription to set
*/
public void setIsPremiereInscription(Boolean isPremiereInscription) {
this.isPremiereInscription = isPremiereInscription;
}
/**
* [RefFiliereLmdDto.niveauRecrutementId] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementId
*/
public Integer getNiveauRecrutementId() {
return niveauRecrutementId;
}
/**
* [RefFiliereLmdDto.niveauRecrutementId] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementId the niveauRecrutementId to set
*/
public void setNiveauRecrutementId(Integer niveauRecrutementId) {
this.niveauRecrutementId = niveauRecrutementId;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleLongFr] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementLibelleLongFr
*/
public String getNiveauRecrutementLibelleLongFr() {
return niveauRecrutementLibelleLongFr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleLongFr] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementLibelleLongFr the niveauRecrutementLibelleLongFr to set
*/
public void setNiveauRecrutementLibelleLongFr(
String niveauRecrutementLibelleLongFr) {
this.niveauRecrutementLibelleLongFr = niveauRecrutementLibelleLongFr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleLongAr] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementLibelleLongAr
*/
public String getNiveauRecrutementLibelleLongAr() {
return niveauRecrutementLibelleLongAr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleLongAr] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementLibelleLongAr the niveauRecrutementLibelleLongAr to set
*/
public void setNiveauRecrutementLibelleLongAr(
String niveauRecrutementLibelleLongAr) {
this.niveauRecrutementLibelleLongAr = niveauRecrutementLibelleLongAr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleCourtFr] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementLibelleCourtFr
*/
public String getNiveauRecrutementLibelleCourtFr() {
return niveauRecrutementLibelleCourtFr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleCourtFr] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementLibelleCourtFr the niveauRecrutementLibelleCourtFr to set
*/
public void setNiveauRecrutementLibelleCourtFr(
String niveauRecrutementLibelleCourtFr) {
this.niveauRecrutementLibelleCourtFr = niveauRecrutementLibelleCourtFr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleCourtAr] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementLibelleCourtAr
*/
public String getNiveauRecrutementLibelleCourtAr() {
return niveauRecrutementLibelleCourtAr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementLibelleCourtAr] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementLibelleCourtAr the niveauRecrutementLibelleCourtAr to set
*/
public void setNiveauRecrutementLibelleCourtAr(
String niveauRecrutementLibelleCourtAr) {
this.niveauRecrutementLibelleCourtAr = niveauRecrutementLibelleCourtAr;
}
/**
* [RefFiliereLmdDto.niveauRecrutementCode] Getter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @return the niveauRecrutementCode
*/
public String getNiveauRecrutementCode() {
return niveauRecrutementCode;
}
/**
* [RefFiliereLmdDto.niveauRecrutementCode] Setter
* @author BELBRIK Oualid on : 16 sept. 2014 17:16:33
* @param niveauRecrutementCode the niveauRecrutementCode to set
*/
public void setNiveauRecrutementCode(String niveauRecrutementCode) {
this.niveauRecrutementCode = niveauRecrutementCode;
}
}
| [
"root@lhalid-pc"
] | root@lhalid-pc |
62a0e73999197a1acfc42b5dd27795b46a0c9d61 | 7731416ca9afff3e69141d5d0087c193ca3e7180 | /src/CAL_Runtime/src/org/openquark/cal/internal/runtime/lecc/RTCAF.java | fe11d33548efb71bdfeb31e8445efbe33f6935d2 | [] | no_license | rdwebster/Open-Quark | 288d38f823e21ec2e338adb2d05f3e05b027f603 | 86397b53eea2518851b4995edae2aa687f8d8812 | refs/heads/master | 2021-01-20T15:50:03.540743 | 2014-07-23T18:11:37 | 2014-07-23T18:11:37 | 481,429 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,548 | java | /*
* Copyright (c) 2007 BUSINESS OBJECTS SOFTWARE LIMITED
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Business Objects nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* RTCAF
* Created: July 29th, 2003 11:24:48 AM
* By: RCypher
*/
package org.openquark.cal.internal.runtime.lecc;
/**
* @author Raymond Cypher
*
* This class is the base class for constant applicative forms (CAFs).
* A CAF is a zero arity function that will return the same value each time
* it is reduced. Currently CAFs are zero arity non-foreign CAL functions.
*/
public abstract class RTCAF extends RTSupercombinator {
// At this point in time RTCAF is primarily a place holder.
// It allows the generated code to differentiate between
// constant applicative forms and general supercombinators.
// This is mostly used to make freeing cached results easier.
// I also allows a location for future functionality that is
// specific to CAFs and not applicable to zero arity functions
// in general.
}
| [
"luke@eversosoft.com"
] | luke@eversosoft.com |
fd4b861d71a236d283d1d28419c7d9fdaace0f8e | e27b2bb15db66e98bee2ce0e8ca6b1e0c5656d23 | /Decompiler/src/nb/decompiler/action/compile/CompileViewListener.java | 5035ac7829d7497b934834ba104ab93b616de003 | [] | no_license | acedamace/jd-netbeans | 6924210f62cf53802de73b15847a2d6c413f09ec | d5f5bd5e9048f9ebed837704b3d733e84e7270ae | refs/heads/master | 2022-05-06T09:58:12.214091 | 2012-12-09T21:33:20 | 2012-12-09T21:33:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 942 | java | package nb.decompiler.action.compile;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.loaders.DataObject;
import org.openide.util.NbBundle.Messages;
@ActionID(
category = "Source",
id = "nb.decompiler.action.compile.CompileViewListener")
@ActionRegistration(
iconBase = "nb/decompiler/action/compile/jd-src.png",
displayName = "#CTL_CompileViewListener")
@ActionReference(path = "Toolbars/Build", position = -120)
@Messages("CTL_CompileViewListener=Compile View")
public final class CompileViewListener implements ActionListener {
private final DataObject context;
public CompileViewListener(DataObject context) {
this.context = context;
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO implement action body
}
}
| [
"mail@christian-moser.ch"
] | mail@christian-moser.ch |
2a602cf395c4fbef22a49ea9ce0806e18c829f83 | 601a0ac3c62bd3c7a727ff73437d7234aa422596 | /src/main/java/com/virsec/webservices/rest/TestPolicyGeneration.java | f2bbc680c17b1f1e86c2fb74caedebfe276cacaa | [] | no_license | sm2226/TestPolicyGeneration | 949cca99411c6e6597e99592c15179f6b3d4ae97 | 1feb9a9bf777bb60a9c0ff3e3e90fc268557200d | refs/heads/master | 2020-03-25T00:40:17.542166 | 2018-08-01T21:22:21 | 2018-08-01T21:22:21 | 143,198,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,950 | java | package com.virsec.webservices.rest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.util.List;
import java.util.UUID;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.MediaType;
@Path("/xml")
public class TestPolicyGeneration {
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces("application/xml")
public String createMessage(@FormParam("policyID") String policyID,
@FormParam("policyName") String policyName,
@FormParam("policy_desc") String policy_desc,
@FormParam("vstig_version") String vstig_version,
@FormParam("severity") String severity,
@FormParam("platform_id") String platform_id,
@FormParam("crud_id") List<String> crud_id,
@FormParam("policy_operand") List<String> policy_operand,
@FormParam("process_operands") List<String> process_operands,
@FormParam("PO_value") List<String> PO_value,
@FormParam("procSelect") String procSelect,
@FormParam("procValue") String procValue,
@FormParam("procCond") List<String> procCond,
@FormParam("procCondValue") List<String> procCondValue,
@FormParam("procPA") String procPA,
@FormParam("PAproc_operands") List<String> PAproc_operands,
@FormParam("PAPO_value") List<String> PAPO_value,
@FormParam("PAprocSelect") String PAprocSelect,
@FormParam("PAprocValue") String PAprocValue,
@FormParam("PAprocCond") List<String> PAprocCond,
@FormParam("PAprocCondValue") List<String> PAprocCondValue,
@FormParam("registry_operands") List<String> registry_operands,
@FormParam("RO_value") List<String> RO_value,
@FormParam("regSelect") String regSelect,
@FormParam("regValue") String regValue,
@FormParam("regCond") List<String> regCond,
@FormParam("regCondValue") List<String> regCondValue,
@FormParam("regPA") String regPA,
@FormParam("PAreg_operands") List<String> PAreg_operands,
@FormParam("PARO_value") List<String> PARO_value,
@FormParam("PAregSelect") String PAregSelect,
@FormParam("PAregValue") String PAregValue,
@FormParam("PAregCond") List<String> PAregCond,
@FormParam("PAregCondValue") List<String> PAregCondValue,
@FormParam("file_operands") List<String> file_operands,
@FormParam("FO_value") List<String> FO_value,
@FormParam("fileSelect") String fileSelect,
@FormParam("fileValue") String fileValue,
@FormParam("fileCond") List<String> fileCond,
@FormParam("fileCondValue") List<String> fileCondValue,
@FormParam("filePA") String filePA,
@FormParam("PAfile_operands") List<String> PAfile_operands,
@FormParam("PAFO_value") List<String> PAFO_value,
@FormParam("PAfileSelect") String PAfileSelect,
@FormParam("PAfileValue") String PAfileValue,
@FormParam("PAfileCond") List<String> PAfileCond,
@FormParam("PAfileCondValue") List<String> PAfileCondValue) {
Document document = DocumentHelper.createDocument();
Element root = document.addElement( "policy" )
.addAttribute("Policy_id", policyID);
Element PolicyNameElement = root.addElement("policy_name");
PolicyNameElement.addText(policyName);
Element PolicyDescElement = root.addElement("policy_desc");
PolicyDescElement.addText(policy_desc);
Element vSTIGPriorityElement = root.addElement( "Severity" );
vSTIGPriorityElement.addText(severity);
Element vSTIGVersionElement = root.addElement( "vSTIGVersion" );
vSTIGVersionElement.addText(vstig_version);
Element platformIDElement = root.addElement( "platformID" );
platformIDElement.addText(platform_id);
Element crudElement = root.addElement("crudOperations");
for(int j=0; j<crud_id.size(); j++) {
crudElement.addElement("CRUDOperation")
.addText(crud_id.get(j));
}
for(int k=0; k<policy_operand.size();k++) {
if(policy_operand.get(k).equals("process")) {
Element PORuleElement = root.addElement("Rule");
Element processOperandsElement = PORuleElement.addElement("ProcessOperands");
for(int a=0; a<process_operands.size(); a++) {
Element processOperandElement = processOperandsElement.addElement("ProcessOperand");
processOperandElement.addElement("OperandType")
.addText(process_operands.get(a));
processOperandElement.addElement("OperandValue")
.addText(PO_value.get(a));
}
Element procActionOnOperandsElement = PORuleElement.addElement("TaskOnOperands");
procActionOnOperandsElement.addElement("Task")
.addText(procSelect);
procActionOnOperandsElement.addElement("TaskVariable")
.addText(procValue);
Element procCondElements = PORuleElement.addElement("ConditionElements");
for(int a=0; a<procCond.size(); a++) {
Element procCondElement = procCondElements.addElement("ConditionElement");
procCondElement.addElement("Condition")
.addText(procCond.get(a));
procCondElement.addElement("ConditionValue")
.addText(procCondValue.get(a));
}
Element procProtectionActionElement = root.addElement("ProtectionAction");
procProtectionActionElement.addElement("Action")
.addText(procPA);
Element PAProcOperandsElement = procProtectionActionElement.addElement("ProcessOperands");
for(int a=0; a<PAproc_operands.size(); a++) {
Element PAProcOperandElement = PAProcOperandsElement.addElement("ProcessOperand");
PAProcOperandElement.addElement("OperandType")
.addText(PAproc_operands.get(a));
PAProcOperandElement.addElement("OperandValue")
.addText(PAPO_value.get(a));
}
Element PAProcActionOnOperandsElement = procProtectionActionElement.addElement("TaskOnOperands");
PAProcActionOnOperandsElement.addElement("Task")
.addText(PAprocSelect);
if(PAprocValue != null) {
PAProcActionOnOperandsElement.addElement("TaskVariable")
.addText(PAprocValue);
}
Element PAProcCondElements = procProtectionActionElement.addElement("ConditionElements");
for(int a=0; a<PAprocCond.size(); a++) {
Element PAProcCondElement = PAProcCondElements.addElement("ConditionElement");
PAProcCondElement.addElement("Condition")
.addText(PAprocCond.get(a));
PAProcCondElement.addElement("ConditionValue")
.addText(PAprocCondValue.get(a));
}
}
else if(policy_operand.get(k).equals("registry")) {
Element RORuleElement = root.addElement("Rule");
Element regOperandsElement = RORuleElement.addElement("RegistryOperands");
//int b=flogicalOp.size();
for(int a=0; a<registry_operands.size(); a++) {
Element regOperandElement = regOperandsElement.addElement("RegistryOperand");
regOperandElement.addElement("OperandType")
.addText(registry_operands.get(a));
regOperandElement.addElement("OperandValue")
.addText(RO_value.get(a));
}
Element regActionOnOperandsElement = RORuleElement.addElement("TaskOnOperands");
regActionOnOperandsElement.addElement("Task")
.addText(regSelect);
regActionOnOperandsElement.addElement("TaskVariable")
.addText(regValue);
Element regCondElements = RORuleElement.addElement("ConditionElements");
for(int a=0; a<regCond.size(); a++) {
Element regCondElement = regCondElements.addElement("ConditionElement");
regCondElement.addElement("Condition")
.addText(regCond.get(a));
regCondElement.addElement("ConditionValue")
.addText(regCondValue.get(a));
}
Element regProtectionActionElement = root.addElement("ProtectionAction");
regProtectionActionElement.addElement("Action")
.addText(regPA);
Element PARegOperandsElement = regProtectionActionElement.addElement("RegistryOperands");
//int b=flogicalOp.size();
for(int a=0; a<PAreg_operands.size(); a++) {
Element PARegOperandElement = PARegOperandsElement.addElement("RegistryOperand");
PARegOperandElement.addElement("OperandType")
.addText(PAreg_operands.get(a));
PARegOperandElement.addElement("OperandValue")
.addText(PARO_value.get(a));
}
Element PARegActionOnOperandsElement = regProtectionActionElement.addElement("TaskOnOperands");
PARegActionOnOperandsElement.addElement("Task")
.addText(PAregSelect);
PARegActionOnOperandsElement.addElement("TaskVariable")
.addText(PAregValue);
Element PARegCondElements = regProtectionActionElement.addElement("ConditionElements");
for(int a=0; a<PAregCond.size(); a++) {
Element PARegCondElement = PARegCondElements.addElement("ConditionElement");
PARegCondElement.addElement("Condition")
.addText(PAregCond.get(a));
PARegCondElement.addElement("ConditionValue")
.addText(PAregCondValue.get(a));
}
}
else {
Element FORuleElement = root.addElement("Rule");
Element fileOperandsElement = FORuleElement.addElement("FileOperands");
//int b=flogicalOp.size();
for(int a=0; a<file_operands.size(); a++) {
Element fileOperandElement = fileOperandsElement.addElement("FileOperand");
fileOperandElement.addElement("OperandType")
.addText(file_operands.get(a));
fileOperandElement.addElement("OperandValue")
.addText(FO_value.get(a));
}
Element actionOnOperandsElement = FORuleElement.addElement("TaskOnOperands");
actionOnOperandsElement.addElement("Task")
.addText(fileSelect);
actionOnOperandsElement.addElement("TaskVariable")
.addText(fileValue);
Element fileCondElements = FORuleElement.addElement("ConditionElements");
for(int a=0; a<fileCond.size(); a++) {
Element fileCondElement = fileCondElements.addElement("ConditionElement");
fileCondElement.addElement("Condition")
.addText(fileCond.get(a));
fileCondElement.addElement("ConditionValue")
.addText(fileCondValue.get(a));
}
Element ProtectionActionElement = root.addElement("ProtectionAction");
ProtectionActionElement.addElement("Action")
.addText(filePA);
Element PAfileOperandsElement = ProtectionActionElement.addElement("FileOperands");
//int b=flogicalOp.size();
for(int a=0; a<PAfile_operands.size(); a++) {
Element PAfileOperandElement = PAfileOperandsElement.addElement("FileOperand");
PAfileOperandElement.addElement("OperandType")
.addText(PAfile_operands.get(a));
PAfileOperandElement.addElement("OperandValue")
.addText(PAFO_value.get(a));
}
Element PAactionOnOperandsElement = ProtectionActionElement.addElement("TaskOnOperands");
PAactionOnOperandsElement.addElement("Task")
.addText(PAfileSelect);
if(PAfileValue != null) {
PAactionOnOperandsElement.addElement("TaskVariable")
.addText(PAfileValue);
}
Element PAfileCondElements = ProtectionActionElement.addElement("ConditionElements");
for(int a=0; a<PAfileCond.size(); a++) {
Element PAfileCondElement = PAfileCondElements.addElement("ConditionElement");
PAfileCondElement.addElement("Condition")
.addText(PAfileCond.get(a));
PAfileCondElement.addElement("ConditionValue")
.addText(PAfileCondValue.get(a));
}
}
}
String text = document.asXML();
System.out.println("This is my XML: " +text);
return text;
}
}
| [
"sm2226@njit.edu"
] | sm2226@njit.edu |
7b149ab5b1462c62498cc854e43756693f23d1ee | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Jsoup_43_buggy/mutated/919/HtmlTreeBuilderState.java | 8d2e4e8cde795a040dd5f40f373787bae165dd1b | [] | 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 | 68,259 | java | package org.jsoup.parser;
import org.jsoup.helper.DescendableLinkedList;
import org.jsoup.helper.StringUtil;
import org.jsoup.nodes.*;
import java.util.Iterator;
import java.util.LinkedList;
/**
* The Tree Builder's current state. Each state embodies the processing for the state, and transitions to other states.
*/
enum HtmlTreeBuilderState {
Initial {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return true; // ignore whitespace
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
// todo: parse error check on expected doctypes
// todo: quirk state check on doctype ids
Token.Doctype d = t.asDoctype();
DocumentType doctype = new DocumentType(d.getName(), d.getPublicIdentifier(), d.getSystemIdentifier(), tb.getBaseUri());
tb.getDocument().appendChild(doctype);
if (d.isForceQuirks())
tb.getDocument().quirksMode(Document.QuirksMode.quirks);
tb.transition(BeforeHtml);
} else {
// todo: check not iframe srcdoc
tb.transition(BeforeHtml);
return tb.process(t); // re-process token
}
return true;
}
},
BeforeHtml {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (isWhitespace(t)) {
return true; // ignore whitespace
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
tb.insert(t.asStartTag());
tb.transition(BeforeHead);
} else if (t.isEndTag() && (StringUtil.in(t.asEndTag().name(), "head", "body", "html", "br"))) {
return anythingElse(t, tb);
} else if (t.isEndTag()) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.insert("html");
tb.transition(BeforeHead);
return tb.process(t);
}
},
BeforeHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return true;
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return InBody.process(t, tb); // does not transition
} else if (t.isStartTag() && t.asStartTag().name().equals("head")) {
Element head = tb.insert(t.asStartTag());
tb.setHeadElement(head);
tb.transition(InHead);
} else if (t.isEndTag() && (StringUtil.in(t.asEndTag().name(), "head", "body", "html", "br"))) {
tb.process(new Token.StartTag("head"));
return tb.process(t);
} else if (t.isEndTag()) {
tb.error(this);
return false;
} else {
tb.process(new Token.StartTag("head"));
return tb.process(t);
}
return true;
}
},
InHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
return true;
}
switch (t.type) {
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
return false;
case StartTag:
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html")) {
return InBody.process(t, tb);
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "command", "link")) {
Element el = tb.insertEmpty(start);
// jsoup special: update base the frist time it is seen
if (name.equals("base") && el.hasAttr("href"))
tb.maybeSetBaseUri(el);
} else if (name.equals("meta")) {
Element meta = tb.insertEmpty(start);
// todo: charset switches
} else if (name.equals("title")) {
handleRcData(start, tb);
} else if (StringUtil.in(name, "noframes", "style")) {
handleRawtext(start, tb);
} else if (name.equals("noscript")) {
// else if noscript && scripting flag = true: rawtext (jsoup doesn't run script, to handle as noscript)
tb.insert(start);
tb.transition(InHeadNoscript);
} else if (name.equals("script")) {
// skips some script rules as won't execute them
tb.insert(start);
tb.tokeniser.transition(TokeniserState.ScriptData);
tb.markInsertionMode();
tb.transition(Text);
} else if (name.equals("head")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
break;
case EndTag:
Token.EndTag end = t.asEndTag();
name = end.name();
if (name.equals("head")) {
tb.pop();
tb.transition(AfterHead);
} else if (StringUtil.in(name, "body", "html", "br")) {
return anythingElse(t, tb);
} else {
tb.error(this);
return false;
}
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, TreeBuilder tb) {
tb.process(new Token.EndTag("head"));
return tb.process(t);
}
},
InHeadNoscript {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isDoctype()) {
tb.error(this);
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("noscript")) {
tb.pop();
tb.transition(InHead);
} else if (isWhitespace(t) || t.isComment() || (t.isStartTag() && StringUtil.in(t.asStartTag().name(),
"basefont", "bgsound", "link", "meta", "noframes", "style"))) {
return tb.process(t, InHead);
} else if (t.isEndTag() && t.asEndTag().name().equals("br")) {
return anythingElse(t, tb);
} else if ((t.isStartTag() && StringUtil.in(t.asStartTag().name(), "head", "noscript")) || t.isEndTag()) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
tb.process(new Token.EndTag("noscript"));
return tb.process(t);
}
},
AfterHead {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
} else if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html")) {
return tb.process(t, InBody);
} else if (name.equals("body")) {
tb.insert(startTag);
tb.framesetOk(false);
tb.transition(InBody);
} else if (name.equals("frameset")) {
tb.insert(startTag);
tb.transition(InFrameset);
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title")) {
tb.error(this);
Element head = tb.getHeadElement();
tb.push(head);
tb.process(t, InHead);
tb.removeFromStack(head);
} else if (name.equals("head")) {
tb.error(this);
return false;
} else {
anythingElse(t, tb);
}
} else if (t.isEndTag()) {
if (StringUtil.in(t.asEndTag().name(), "body", "html")) {
anythingElse(t, tb);
} else {
tb.error(this);
return false;
}
} else {
anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.process(new Token.StartTag("body"));
tb.framesetOk(true);
return tb.process(t);
}
},
InBody {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
// todo confirm that check
tb.error(this);
return false;
} else tb.process(new org.jsoup.parser.Token.StartTag("form"));
if (isWhitespace(c)) {
tb.reconstructFormattingElements();
tb.insert(c);
} else {
tb.reconstructFormattingElements();
tb.insert(c);
tb.framesetOk(false);
}
break;
}
case Comment: {
tb.insert(t.asComment());
break;
}
case Doctype: {
tb.error(this);
return false;
}
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html")) {
tb.error(this);
// merge attributes onto real html
Element html = tb.getStack().getFirst();
for (Attribute attribute : startTag.getAttributes()) {
if (!html.hasAttr(attribute.getKey()))
html.attributes().put(attribute);
}
} else if (StringUtil.in(name, "base", "basefont", "bgsound", "command", "link", "meta", "noframes", "script", "style", "title")) {
return tb.process(t, InHead);
} else if (name.equals("body")) {
tb.error(this);
LinkedList<Element> stack = tb.getStack();
if (stack.size() == 1 || (stack.size() > 2 && !stack.get(1).nodeName().equals("body"))) {
// only in fragment case
return false; // ignore
} else {
tb.framesetOk(false);
Element body = stack.get(1);
for (Attribute attribute : startTag.getAttributes()) {
if (!body.hasAttr(attribute.getKey()))
body.attributes().put(attribute);
}
}
} else if (name.equals("frameset")) {
tb.error(this);
LinkedList<Element> stack = tb.getStack();
if (stack.size() == 1 || (stack.size() > 2 && !stack.get(1).nodeName().equals("body"))) {
// only in fragment case
return false; // ignore
} else if (!tb.framesetOk()) {
return false; // ignore frameset
} else {
Element second = stack.get(1);
if (second.parent() != null)
second.remove();
// pop up to html element
while (stack.size() > 1)
stack.removeLast();
tb.insert(startTag);
tb.transition(InFrameset);
}
} else if (StringUtil.in(name,
"address", "article", "aside", "blockquote", "center", "details", "dir", "div", "dl",
"fieldset", "figcaption", "figure", "footer", "header", "hgroup", "menu", "nav", "ol",
"p", "section", "summary", "ul")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (StringUtil.in(name, "h1", "h2", "h3", "h4", "h5", "h6")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
if (StringUtil.in(tb.currentElement().nodeName(), "h1", "h2", "h3", "h4", "h5", "h6")) {
tb.error(this);
tb.pop();
}
tb.insert(startTag);
} else if (StringUtil.in(name, "pre", "listing")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
// todo: ignore LF if next token
tb.framesetOk(false);
} else if (name.equals("form")) {
if (tb.getFormElement() != null) {
tb.error(this);
return false;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
Element form = tb.insert(startTag);
tb.setFormElement(form);
} else if (name.equals("li")) {
tb.framesetOk(false);
LinkedList<Element> stack = tb.getStack();
for (int i = stack.size() - 1; i > 0; i--) {
Element el = stack.get(i);
if (el.nodeName().equals("li")) {
tb.process(new Token.EndTag("li"));
break;
}
if (tb.isSpecial(el) && !StringUtil.in(el.nodeName(), "address", "div", "p"))
break;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (StringUtil.in(name, "dd", "dt")) {
tb.framesetOk(false);
LinkedList<Element> stack = tb.getStack();
for (int i = stack.size() - 1; i > 0; i--) {
Element el = stack.get(i);
if (StringUtil.in(el.nodeName(), "dd", "dt")) {
tb.process(new Token.EndTag(el.nodeName()));
break;
}
if (tb.isSpecial(el) && !StringUtil.in(el.nodeName(), "address", "div", "p"))
break;
}
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
} else if (name.equals("plaintext")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.PLAINTEXT); // once in, never gets out
} else if (name.equals("button")) {
if (tb.inButtonScope("button")) {
// close and reprocess
tb.error(this);
tb.process(new Token.EndTag("button"));
tb.process(startTag);
} else {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.framesetOk(false);
}
} else if (name.equals("a")) {
if (tb.getActiveFormattingElement("a") != null) {
tb.error(this);
tb.process(new Token.EndTag("a"));
// still on stack?
Element remainingA = tb.getFromStack("a");
if (remainingA != null) {
tb.removeFromActiveFormattingElements(remainingA);
tb.removeFromStack(remainingA);
}
}
tb.reconstructFormattingElements();
Element a = tb.insert(startTag);
tb.pushActiveFormattingElements(a);
} else if (StringUtil.in(name,
"b", "big", "code", "em", "font", "i", "s", "small", "strike", "strong", "tt", "u")) {
tb.reconstructFormattingElements();
Element el = tb.insert(startTag);
tb.pushActiveFormattingElements(el);
} else if (name.equals("nobr")) {
tb.reconstructFormattingElements();
if (tb.inScope("nobr")) {
tb.error(this);
tb.process(new Token.EndTag("nobr"));
tb.reconstructFormattingElements();
}
Element el = tb.insert(startTag);
tb.pushActiveFormattingElements(el);
} else if (StringUtil.in(name, "applet", "marquee", "object")) {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.insertMarkerToFormattingElements();
tb.framesetOk(false);
} else if (name.equals("table")) {
if (tb.getDocument().quirksMode() != Document.QuirksMode.quirks && tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insert(startTag);
tb.framesetOk(false);
tb.transition(InTable);
} else if (StringUtil.in(name, "area", "br", "embed", "img", "keygen", "wbr")) {
tb.reconstructFormattingElements();
tb.insertEmpty(startTag);
tb.framesetOk(false);
} else if (name.equals("input")) {
tb.reconstructFormattingElements();
Element el = tb.insertEmpty(startTag);
if (!el.attr("type").equalsIgnoreCase("hidden"))
tb.framesetOk(false);
} else if (StringUtil.in(name, "param", "source", "track")) {
tb.insertEmpty(startTag);
} else if (name.equals("hr")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.insertEmpty(startTag);
tb.framesetOk(false);
} else if (name.equals("image")) {
// we're not supposed to ask.
startTag.name("img");
return tb.process(startTag);
} else if (name.equals("isindex")) {
// how much do we care about the early 90s?
tb.error(this);
if (tb.getFormElement() != null)
return false;
tb.tokeniser.acknowledgeSelfClosingFlag();
tb.process(new Token.StartTag("form"));
if (startTag.attributes.hasKey("action")) {
Element form = tb.getFormElement();
form.attr("action", startTag.attributes.get("action"));
}
tb.process(new Token.StartTag("hr"));
tb.process(new Token.StartTag("label"));
// hope you like english.
String prompt = startTag.attributes.hasKey("prompt") ?
startTag.attributes.get("prompt") :
"This is a searchable index. Enter search keywords: ";
tb.process(new Token.Character(prompt));
// input
Attributes inputAttribs = new Attributes();
for (Attribute attr : startTag.attributes) {
if (!StringUtil.in(attr.getKey(), "name", "action", "prompt"))
inputAttribs.put(attr);
}
inputAttribs.put("name", "isindex");
tb.process(new Token.StartTag("input", inputAttribs));
tb.process(new Token.EndTag("label"));
tb.process(new Token.StartTag("hr"));
tb.process(new Token.EndTag("form"));
} else if (name.equals("textarea")) {
tb.insert(startTag);
// todo: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.)
tb.tokeniser.transition(TokeniserState.Rcdata);
tb.markInsertionMode();
tb.framesetOk(false);
tb.transition(Text);
} else if (name.equals("xmp")) {
if (tb.inButtonScope("p")) {
tb.process(new Token.EndTag("p"));
}
tb.reconstructFormattingElements();
tb.framesetOk(false);
handleRawtext(startTag, tb);
} else if (name.equals("iframe")) {
tb.framesetOk(false);
handleRawtext(startTag, tb);
} else if (name.equals("noembed")) {
// also handle noscript if script enabled
handleRawtext(startTag, tb);
} else if (name.equals("select")) {
tb.reconstructFormattingElements();
tb.insert(startTag);
tb.framesetOk(false);
HtmlTreeBuilderState state = tb.state();
if (state.equals(InTable) || state.equals(InCaption) || state.equals(InTableBody) || state.equals(InRow) || state.equals(InCell))
tb.transition(InSelectInTable);
else
tb.transition(InSelect);
} else if (StringUtil.in("optgroup", "option")) {
if (tb.currentElement().nodeName().equals("option"))
tb.process(new Token.EndTag("option"));
tb.reconstructFormattingElements();
tb.insert(startTag);
} else if (StringUtil.in("rp", "rt")) {
if (tb.inScope("ruby")) {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals("ruby")) {
tb.error(this);
tb.popStackToBefore("ruby"); // i.e. close up to but not include name
}
tb.insert(startTag);
}
} else if (name.equals("math")) {
tb.reconstructFormattingElements();
// todo: handle A start tag whose tag name is "math" (i.e. foreign, mathml)
tb.insert(startTag);
tb.tokeniser.acknowledgeSelfClosingFlag();
} else if (name.equals("svg")) {
tb.reconstructFormattingElements();
// todo: handle A start tag whose tag name is "svg" (xlink, svg)
tb.insert(startTag);
tb.tokeniser.acknowledgeSelfClosingFlag();
} else if (StringUtil.in(name,
"caption", "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
tb.reconstructFormattingElements();
tb.insert(startTag);
}
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (name.equals("body")) {
if (!tb.inScope("body")) {
tb.error(this);
return false;
} else {
// todo: error if stack contains something not dd, dt, li, optgroup, option, p, rp, rt, tbody, td, tfoot, th, thead, tr, body, html
tb.transition(AfterBody);
}
} else if (name.equals("html")) {
boolean notIgnored = tb.process(new Token.EndTag("body"));
if (notIgnored)
return tb.process(endTag);
} else if (StringUtil.in(name,
"address", "article", "aside", "blockquote", "button", "center", "details", "dir", "div",
"dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "listing", "menu",
"nav", "ol", "pre", "section", "summary", "ul")) {
// todo: refactor these lookups
if (!tb.inScope(name)) {
// nothing to close
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (name.equals("form")) {
Element currentForm = tb.getFormElement();
tb.setFormElement(null);
if (currentForm == null || !tb.inScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
// remove currentForm from stack. will shift anything under up.
tb.removeFromStack(currentForm);
}
} else if (name.equals("p")) {
if (!tb.inButtonScope(name)) {
tb.error(this);
tb.process(new Token.StartTag(name)); // if no p to close, creates an empty <p></p>
return tb.process(endTag);
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (name.equals("li")) {
if (!tb.inListItemScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (StringUtil.in(name, "dd", "dt")) {
if (!tb.inScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
}
} else if (StringUtil.in(name, "h1", "h2", "h3", "h4", "h5", "h6")) {
if (!tb.inScope(new String[]{"h1", "h2", "h3", "h4", "h5", "h6"})) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags(name);
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose("h1", "h2", "h3", "h4", "h5", "h6");
}
} else if (name.equals("sarcasm")) {
// *sigh*
return anyOtherEndTag(t, tb);
} else if (StringUtil.in(name,
"a", "b", "big", "code", "em", "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u")) {
// Adoption Agency Algorithm.
OUTER:
for (int i = 0; i < 8; i++) {
Element formatEl = tb.getActiveFormattingElement(name);
if (formatEl == null)
return anyOtherEndTag(t, tb);
else if (!tb.onStack(formatEl)) {
tb.error(this);
tb.removeFromActiveFormattingElements(formatEl);
return true;
} else if (!tb.inScope(formatEl.nodeName())) {
tb.error(this);
return false;
} else if (tb.currentElement() != formatEl)
tb.error(this);
Element furthestBlock = null;
Element commonAncestor = null;
boolean seenFormattingElement = false;
LinkedList<Element> stack = tb.getStack();
for (int si = 0; si < stack.size(); si++) {
Element el = stack.get(si);
if (el == formatEl) {
commonAncestor = stack.get(si - 1);
seenFormattingElement = true;
} else if (seenFormattingElement && tb.isSpecial(el)) {
furthestBlock = el;
break;
}
}
if (furthestBlock == null) {
tb.popStackToClose(formatEl.nodeName());
tb.removeFromActiveFormattingElements(formatEl);
return true;
}
// todo: Let a bookmark note the position of the formatting element in the list of active formatting elements relative to the elements on either side of it in the list.
// does that mean: int pos of format el in list?
Element node = furthestBlock;
Element lastNode = furthestBlock;
INNER:
for (int j = 0; j < 3; j++) {
if (tb.onStack(node))
node = tb.aboveOnStack(node);
if (!tb.isInActiveFormattingElements(node)) { // note no bookmark check
tb.removeFromStack(node);
continue INNER;
} else if (node == formatEl)
break INNER;
Element replacement = new Element(Tag.valueOf(node.nodeName()), tb.getBaseUri());
tb.replaceActiveFormattingElement(node, replacement);
tb.replaceOnStack(node, replacement);
node = replacement;
if (lastNode == furthestBlock) {
// todo: move the aforementioned bookmark to be immediately after the new node in the list of active formatting elements.
// not getting how this bookmark both straddles the element above, but is inbetween here...
}
if (lastNode.parent() != null)
lastNode.remove();
node.appendChild(lastNode);
lastNode = node;
}
if (StringUtil.in(commonAncestor.nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
if (lastNode.parent() != null)
lastNode.remove();
tb.insertInFosterParent(lastNode);
} else {
if (lastNode.parent() != null)
lastNode.remove();
commonAncestor.appendChild(lastNode);
}
Element adopter = new Element(Tag.valueOf(name), tb.getBaseUri());
Node[] childNodes = furthestBlock.childNodes().toArray(new Node[furthestBlock.childNodes().size()]);
for (Node childNode : childNodes) {
adopter.appendChild(childNode); // append will reparent. thus the clone to avvoid concurrent mod.
}
furthestBlock.appendChild(adopter);
tb.removeFromActiveFormattingElements(formatEl);
// todo: insert the new element into the list of active formatting elements at the position of the aforementioned bookmark.
tb.removeFromStack(formatEl);
tb.insertOnStackAfter(furthestBlock, adopter);
}
} else if (StringUtil.in(name, "applet", "marquee", "object")) {
if (!tb.inScope("name")) {
if (!tb.inScope(name)) {
tb.error(this);
return false;
}
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
tb.clearFormattingElementsToLastMarker();
}
} else if (name.equals("br")) {
tb.error(this);
tb.process(new Token.StartTag("br"));
return false;
} else {
return anyOtherEndTag(t, tb);
}
break;
case EOF:
// todo: error if stack contains something not dd, dt, li, p, tbody, td, tfoot, th, thead, tr, body, html
// stop parsing
break;
}
return true;
}
boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {
String name = t.asEndTag().name();
DescendableLinkedList<Element> stack = tb.getStack();
Iterator<Element> it = stack.descendingIterator();
while (it.hasNext()) {
Element node = it.next();
if (node.nodeName().equals(name)) {
tb.generateImpliedEndTags(name);
if (!name.equals(tb.currentElement().nodeName()))
tb.error(this);
tb.popStackToClose(name);
break;
} else {
if (tb.isSpecial(node)) {
tb.error(this);
return false;
}
}
}
return true;
}
},
Text {
// in script, style etc. normally treated as data tags
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isCharacter()) {
tb.insert(t.asCharacter());
} else if (t.isEOF()) {
tb.error(this);
// if current node is script: already started
tb.pop();
tb.transition(tb.originalState());
return tb.process(t);
} else if (t.isEndTag()) {
// if: An end tag whose tag name is "script" -- scripting nesting level, if evaluating scripts
tb.pop();
tb.transition(tb.originalState());
}
return true;
}
},
InTable {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isCharacter()) {
tb.newPendingTableCharacters();
tb.markInsertionMode();
tb.transition(InTableText);
return tb.process(t);
} else if (t.isComment()) {
tb.insert(t.asComment());
return true;
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("caption")) {
tb.clearStackToTableContext();
tb.insertMarkerToFormattingElements();
tb.insert(startTag);
tb.transition(InCaption);
} else if (name.equals("colgroup")) {
tb.clearStackToTableContext();
tb.insert(startTag);
tb.transition(InColumnGroup);
} else if (name.equals("col")) {
tb.process(new Token.StartTag("colgroup"));
return tb.process(t);
} else if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
tb.clearStackToTableContext();
tb.insert(startTag);
tb.transition(InTableBody);
} else if (StringUtil.in(name, "td", "th", "tr")) {
tb.process(new Token.StartTag("tbody"));
return tb.process(t);
} else if (name.equals("table")) {
tb.error(this);
boolean processed = tb.process(new Token.EndTag("table"));
if (processed) // only ignored if in fragment
return tb.process(t);
} else if (StringUtil.in(name, "style", "script")) {
return tb.process(t, InHead);
} else if (name.equals("input")) {
if (!startTag.attributes.get("type").equalsIgnoreCase("hidden")) {
return anythingElse(t, tb);
} else {
tb.insertEmpty(startTag);
}
} else if (name.equals("form")) {
tb.error(this);
if (tb.getFormElement() != null)
return false;
else {
Element form = tb.insertEmpty(startTag);
tb.setFormElement(form);
}
} else {
return anythingElse(t, tb);
}
} else if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (name.equals("table")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.popStackToClose("table");
}
tb.resetInsertionMode();
} else if (StringUtil.in(name,
"body", "caption", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
} else if (t.isEOF()) {
if (tb.currentElement().nodeName().equals("html"))
tb.error(this);
return true; // stops parsing
}
return anythingElse(t, tb);
}
boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
boolean processed = true;
if (StringUtil.in(tb.currentElement().nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
tb.setFosterInserts(true);
processed = tb.process(t, InBody);
tb.setFosterInserts(false);
} else {
processed = tb.process(t, InBody);
}
return processed;
}
},
InTableText {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character:
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
} else {
tb.getPendingTableCharacters().add(c);
}
break;
default:
if (tb.getPendingTableCharacters().size() > 0) {
for (Token.Character character : tb.getPendingTableCharacters()) {
if (!isWhitespace(character)) {
// InTable anything else section:
tb.error(this);
if (StringUtil.in(tb.currentElement().nodeName(), "table", "tbody", "tfoot", "thead", "tr")) {
tb.setFosterInserts(true);
tb.process(character, InBody);
tb.setFosterInserts(false);
} else {
tb.process(character, InBody);
}
} else
tb.insert(character);
}
tb.newPendingTableCharacters();
}
tb.transition(tb.originalState());
return tb.process(t);
}
return true;
}
},
InCaption {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isEndTag() && t.asEndTag().name().equals("caption")) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals("caption"))
tb.error(this);
tb.popStackToClose("caption");
tb.clearFormattingElementsToLastMarker();
tb.transition(InTable);
}
} else if ((
t.isStartTag() && StringUtil.in(t.asStartTag().name(),
"caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr") ||
t.isEndTag() && t.asEndTag().name().equals("table"))
) {
tb.error(this);
boolean processed = tb.process(new Token.EndTag("caption"));
if (processed)
return tb.process(t);
} else if (t.isEndTag() && StringUtil.in(t.asEndTag().name(),
"body", "col", "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr")) {
tb.error(this);
return false;
} else {
return tb.process(t, InBody);
}
return true;
}
},
InColumnGroup {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
return true;
}
switch (t.type) {
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
break;
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("html"))
return tb.process(t, InBody);
else if (name.equals("col"))
tb.insertEmpty(startTag);
else
return anythingElse(t, tb);
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (name.equals("colgroup")) {
if (tb.currentElement().nodeName().equals("html")) { // frag case
tb.error(this);
return false;
} else {
tb.pop();
tb.transition(InTable);
}
} else
return anythingElse(t, tb);
break;
case EOF:
if (tb.currentElement().nodeName().equals("html"))
return true; // stop parsing; frag case
else
return anythingElse(t, tb);
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, TreeBuilder tb) {
boolean processed = tb.process(new Token.EndTag("colgroup"));
if (processed) // only ignored in frag case
return tb.process(t);
return true;
}
},
InTableBody {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case StartTag:
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (name.equals("tr")) {
tb.clearStackToTableBodyContext();
tb.insert(startTag);
tb.transition(InRow);
} else if (StringUtil.in(name, "th", "td")) {
tb.error(this);
tb.process(new Token.StartTag("tr"));
return tb.process(startTag);
} else if (StringUtil.in(name, "caption", "col", "colgroup", "tbody", "tfoot", "thead")) {
return exitTableBody(t, tb);
} else
return anythingElse(t, tb);
break;
case EndTag:
Token.EndTag endTag = t.asEndTag();
name = endTag.name();
if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
} else {
tb.clearStackToTableBodyContext();
tb.pop();
tb.transition(InTable);
}
} else if (name.equals("table")) {
return exitTableBody(t, tb);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html", "td", "th", "tr")) {
tb.error(this);
return false;
} else
return anythingElse(t, tb);
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean exitTableBody(Token t, HtmlTreeBuilder tb) {
if (!(tb.inTableScope("tbody") || tb.inTableScope("thead") || tb.inScope("tfoot"))) {
// frag case
tb.error(this);
return false;
}
tb.clearStackToTableBodyContext();
tb.process(new Token.EndTag(tb.currentElement().nodeName())); // tbody, tfoot, thead
return tb.process(t);
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InTable);
}
},
InRow {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isStartTag()) {
Token.StartTag startTag = t.asStartTag();
String name = startTag.name();
if (StringUtil.in(name, "th", "td")) {
tb.clearStackToTableRowContext();
tb.insert(startTag);
tb.transition(InCell);
tb.insertMarkerToFormattingElements();
} else if (StringUtil.in(name, "caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr")) {
return handleMissingTr(t, tb);
} else {
return anythingElse(t, tb);
}
} else if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (name.equals("tr")) {
if (!tb.inTableScope(name)) {
tb.error(this); // frag
return false;
}
tb.clearStackToTableRowContext();
tb.pop(); // tr
tb.transition(InTableBody);
} else if (name.equals("table")) {
return handleMissingTr(t, tb);
} else if (StringUtil.in(name, "tbody", "tfoot", "thead")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
}
tb.process(new Token.EndTag("tr"));
return tb.process(t);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html", "td", "th")) {
tb.error(this);
return false;
} else {
return anythingElse(t, tb);
}
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InTable);
}
private boolean handleMissingTr(Token t, TreeBuilder tb) {
boolean processed = tb.process(new Token.EndTag("tr"));
if (processed)
return tb.process(t);
else
return false;
}
},
InCell {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isEndTag()) {
Token.EndTag endTag = t.asEndTag();
String name = endTag.name();
if (StringUtil.in(name, "td", "th")) {
if (!tb.inTableScope(name)) {
tb.error(this);
tb.transition(InRow); // might not be in scope if empty: <td /> and processing fake end tag
return false;
}
tb.generateImpliedEndTags();
if (!tb.currentElement().nodeName().equals(name))
tb.error(this);
tb.popStackToClose(name);
tb.clearFormattingElementsToLastMarker();
tb.transition(InRow);
} else if (StringUtil.in(name, "body", "caption", "col", "colgroup", "html")) {
tb.error(this);
return false;
} else if (StringUtil.in(name, "table", "tbody", "tfoot", "thead", "tr")) {
if (!tb.inTableScope(name)) {
tb.error(this);
return false;
}
closeCell(tb);
return tb.process(t);
} else {
return anythingElse(t, tb);
}
} else if (t.isStartTag() &&
StringUtil.in(t.asStartTag().name(),
"caption", "col", "colgroup", "tbody", "td", "tfoot", "th", "thead", "tr")) {
if (!(tb.inTableScope("td") || tb.inTableScope("th"))) {
tb.error(this);
return false;
}
closeCell(tb);
return tb.process(t);
} else {
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
return tb.process(t, InBody);
}
private void closeCell(HtmlTreeBuilder tb) {
if (tb.inTableScope("td"))
tb.process(new Token.EndTag("td"));
else
tb.process(new Token.EndTag("th")); // only here if th or td in scope
}
},
InSelect {
boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character:
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
} else {
tb.insert(c);
}
break;
case Comment:
tb.insert(t.asComment());
break;
case Doctype:
tb.error(this);
return false;
case StartTag:
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html"))
return tb.process(start, InBody);
else if (name.equals("option")) {
tb.process(new Token.EndTag("option"));
tb.insert(start);
} else if (name.equals("optgroup")) {
if (tb.currentElement().nodeName().equals("option"))
tb.process(new Token.EndTag("option"));
else if (tb.currentElement().nodeName().equals("optgroup"))
tb.process(new Token.EndTag("optgroup"));
tb.insert(start);
} else if (name.equals("select")) {
tb.error(this);
return tb.process(new Token.EndTag("select"));
} else if (StringUtil.in(name, "input", "keygen", "textarea")) {
tb.error(this);
if (!tb.inSelectScope("select"))
return false; // frag
tb.process(new Token.EndTag("select"));
return tb.process(start);
} else if (name.equals("script")) {
return tb.process(t, InHead);
} else {
return anythingElse(t, tb);
}
break;
case EndTag:
Token.EndTag end = t.asEndTag();
name = end.name();
if (name.equals("optgroup")) {
if (tb.currentElement().nodeName().equals("option") && tb.aboveOnStack(tb.currentElement()) != null && tb.aboveOnStack(tb.currentElement()).nodeName().equals("optgroup"))
tb.process(new Token.EndTag("option"));
if (tb.currentElement().nodeName().equals("optgroup"))
tb.pop();
else
tb.error(this);
} else if (name.equals("option")) {
if (tb.currentElement().nodeName().equals("option"))
tb.pop();
else
tb.error(this);
} else if (name.equals("select")) {
if (!tb.inSelectScope(name)) {
tb.error(this);
return false;
} else {
tb.popStackToClose(name);
tb.resetInsertionMode();
}
} else
return anythingElse(t, tb);
break;
case EOF:
if (!tb.currentElement().nodeName().equals("html"))
tb.error(this);
break;
default:
return anythingElse(t, tb);
}
return true;
}
private boolean anythingElse(Token t, HtmlTreeBuilder tb) {
tb.error(this);
return false;
}
},
InSelectInTable {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isStartTag() && StringUtil.in(t.asStartTag().name(), "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th")) {
tb.error(this);
tb.process(new Token.EndTag("select"));
return tb.process(t);
} else if (t.isEndTag() && StringUtil.in(t.asEndTag().name(), "caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th")) {
tb.error(this);
if (tb.inTableScope(t.asEndTag().name())) {
tb.process(new Token.EndTag("select"));
return (tb.process(t));
} else
return false;
} else {
return tb.process(t, InSelect);
}
}
},
AfterBody {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
return tb.process(t, InBody);
} else if (t.isComment()) {
tb.insert(t.asComment()); // into html node
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("html")) {
if (tb.isFragmentParsing()) {
tb.error(this);
return false;
} else {
tb.transition(AfterAfterBody);
}
} else if (t.isEOF()) {
// chillax! we're done
} else {
tb.error(this);
tb.transition(InBody);
return tb.process(t);
}
return true;
}
},
InFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag()) {
Token.StartTag start = t.asStartTag();
String name = start.name();
if (name.equals("html")) {
return tb.process(start, InBody);
} else if (name.equals("frameset")) {
tb.insert(start);
} else if (name.equals("frame")) {
tb.insertEmpty(start);
} else if (name.equals("noframes")) {
return tb.process(start, InHead);
} else {
tb.error(this);
return false;
}
} else if (t.isEndTag() && t.asEndTag().name().equals("frameset")) {
if (tb.currentElement().nodeName().equals("html")) { // frag
tb.error(this);
return false;
} else {
tb.pop();
if (!tb.isFragmentParsing() && !tb.currentElement().nodeName().equals("frameset")) {
tb.transition(AfterFrameset);
}
}
} else if (t.isEOF()) {
if (!tb.currentElement().nodeName().equals("html")) {
tb.error(this);
return true;
}
} else {
tb.error(this);
return false;
}
return true;
}
},
AfterFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (isWhitespace(t)) {
tb.insert(t.asCharacter());
} else if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype()) {
tb.error(this);
return false;
} else if (t.isStartTag() && t.asStartTag().name().equals("html")) {
return tb.process(t, InBody);
} else if (t.isEndTag() && t.asEndTag().name().equals("html")) {
tb.transition(AfterAfterFrameset);
} else if (t.isStartTag() && t.asStartTag().name().equals("noframes")) {
return tb.process(t, InHead);
} else if (t.isEOF()) {
// cool your heels, we're complete
} else {
tb.error(this);
return false;
}
return true;
}
},
AfterAfterBody {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype() || isWhitespace(t) || (t.isStartTag() && t.asStartTag().name().equals("html"))) {
return tb.process(t, InBody);
} else if (t.isEOF()) {
// nice work chuck
} else {
tb.error(this);
tb.transition(InBody);
return tb.process(t);
}
return true;
}
},
AfterAfterFrameset {
boolean process(Token t, HtmlTreeBuilder tb) {
if (t.isComment()) {
tb.insert(t.asComment());
} else if (t.isDoctype() || isWhitespace(t) || (t.isStartTag() && t.asStartTag().name().equals("html"))) {
return tb.process(t, InBody);
} else if (t.isEOF()) {
// nice work chuck
} else if (t.isStartTag() && t.asStartTag().name().equals("noframes")) {
return tb.process(t, InHead);
} else {
tb.error(this);
return false;
}
return true;
}
},
ForeignContent {
boolean process(Token t, HtmlTreeBuilder tb) {
return true;
// todo: implement. Also; how do we get here?
}
};
private static String nullString = String.valueOf('\u0000');
abstract boolean process(Token t, HtmlTreeBuilder tb);
private static boolean isWhitespace(Token t) {
if (t.isCharacter()) {
String data = t.asCharacter().getData();
// todo: this checks more than spec - "\t", "\n", "\f", "\r", " "
for (int i = 0; i < data.length(); i++) {
char c = data.charAt(i);
if (!StringUtil.isWhitespace(c))
return false;
}
return true;
}
return false;
}
private static void handleRcData(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rcdata);
tb.markInsertionMode();
tb.transition(Text);
}
private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rawtext);
tb.markInsertionMode();
tb.transition(Text);
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
6273271c73caee3f0b0243bc7735fa6d3d237c85 | 2568c6b060a0c3f788868b95949d8365e34dfaff | /src/test/java/AutomationPractice/Martin/SignUpLogin.java | 4fa09725ff11cfd0f57845e081b0933f4ad1dbca | [] | no_license | tjurkovsky/SeleniumProject | 239a441e245e64bd38a778ff18f78f88daa19a99 | 3fb7d54249f3edac24fc1b4f0d295874c0b65781 | refs/heads/master | 2021-05-04T05:53:47.187442 | 2016-10-16T17:35:42 | 2016-10-16T17:35:42 | 71,076,150 | 0 | 0 | null | 2016-10-16T20:44:43 | 2016-10-16T20:44:43 | null | UTF-8 | Java | false | false | 6,506 | java | package AutomationPractice.Martin;
/**
* Created by Jerry on 16.10.2016.
*/
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class SignUpLogin {
private static ChromeDriver driver;
WebElement element;
@BeforeClass
public static void openBrowser() {
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@Before
public void goToHomePage(){
driver.get("http://automationpractice.com/index.php");
try{
element = driver.findElement(By.className("logout"));
if (element != null){
element.click();
}
}
catch (Exception e){
}
}
@Test
public void invalidEmailFormatLogin(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email")).sendKeys("random.com");
driver.findElement(By.id("passwd")).click();
try {
element = driver.findElement(By.xpath("//div[@class='form-group form-error']"));
}
catch (Exception e){
}
Assert.assertNotNull("Error of wrong email format has not been shown!",element);
} //checks if error shows up if wrong email format is provided
@Test
public void validEmailFormatLogin(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email")).sendKeys("random@email.com");
driver.findElement(By.id("passwd")).click();
try {
element = driver.findElement(By.xpath("//div[@class='form-group form-ok']"));
}
catch (Exception e){
}
Assert.assertNotNull("Ok sign has not been shown up!",element);
} //checks if OK sign shows up if right email format is provided
@Test
public void invalidLoginData(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email")).sendKeys("random@email.com");
driver.findElement(By.id("passwd")).sendKeys("random");
driver.findElement(By.id("passwd")).submit();
try {
element = driver.findElement(By.xpath("//div[@class='alert alert-danger']"));
}
catch (Exception e){
}
Assert.assertNotNull("No error has been shown up,after non existing user tried to login!",element);
} //checks if error shows up,after non existing user tries to login
@Test
public void validLoginData(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email")).sendKeys("jerrywoodburn@seznam.cz");
driver.findElement(By.id("passwd")).sendKeys("kiklop");
driver.findElement(By.id("SubmitLogin")).click();
try {
element = element.findElement(By.className("logout"));
}
catch (Exception e){
}
Assert.assertNotNull("User has not been signed up,even with correct login data!",element);
} // checks if login works. Tries to login with correct login data
@Test
public void invalidEmailFormatSignUp(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email_create")).sendKeys("random.com");
driver.findElement(By.id("email_create")).submit();
try {
element = driver.findElement(By.id("create_account_error"));
}
catch (Exception e){
}
Assert.assertNotNull("Error of wrong email format has not been shown!",element);
} //checks if error shows up if wrong email format is provided
@Test
public void validEmailFormatSignUp(){
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email_create")).sendKeys("random@email.cz");
driver.findElement(By.id("email_create")).submit();
try {
element = driver.findElement(By.id("customer_firstname"));
}
catch (Exception e){
}
Assert.assertNotNull("Even though,right email has been provided,error has been shown!",element);
} //checks if OK sign shows up if right email format is provided
@Test
public void signUp(){
Random rand = new Random();
int value = rand.nextInt(100000);
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id("email_create")).sendKeys("woodburn"+value+"@seznam.cz");
driver.findElement(By.id("email_create")).submit();
try{
driver.findElement(By.id("id_gender1")).click();
driver.findElement(By.id("customer_firstname")).sendKeys("Jerry");
driver.findElement(By.id("customer_lastname")).sendKeys("Woodburn");
driver.findElement(By.id("passwd")).sendKeys("kiklop");
Select selectDays = new Select(driver.findElement(By.xpath("//select[@id='days']")));
selectDays.selectByValue("25");
Select selectMonths = new Select(driver.findElement(By.xpath("//select[@id='months']")));
selectMonths.selectByValue("8");
Select selectYears = new Select(driver.findElement(By.xpath("//select[@id='years']")));
selectYears.selectByValue("1994");
driver.findElement(By.id("newsletter")).click();
driver.findElement(By.id("optin")).click();
driver.findElement(By.id("address1")).sendKeys("Jablonova 100");
driver.findElement(By.id("city")).sendKeys("Brno");
Select selectState = new Select(driver.findElement(By.xpath("//select[@name='id_state']")));
selectState.selectByValue("8");
driver.findElement(By.id("postcode")).sendKeys("85496");
driver.findElement(By.id("phone")).sendKeys("854965785");
driver.findElement(By.id("submitAccount")).click();
element = driver.findElement(By.className("info-account"));
}
catch (Exception e){
}
Assert.assertEquals("user has not beed succesfuly signed up!",element.getAttribute("innerText"),"Welcome to your account. Here you can manage all of your personal information and orders.");
} //tries to create a new client
@AfterClass
public static void goBackAgain(){
driver.quit();
}
}
| [
"mstancl@email.cz"
] | mstancl@email.cz |
4a2fe048bd7efd8a1dc1457b44eb7203bc90c8d4 | 24e4becb0ebbe69b3080ab0bedea0bf760c78d6a | /src/com/javarush/test/level06/lesson11/bonus03/Solution.java | 77a70733e7d3657b09a5bb41424d54c994729b2c | [] | no_license | MMauz/JavaRushHomeWork | 7831c305c7cfdfb36cf72d3dcfcd883a9412305c | be20a9e68906e121196c8bdef6e776f4a25d23a6 | refs/heads/master | 2020-04-06T03:38:35.304068 | 2016-08-08T11:48:35 | 2016-08-08T11:48:35 | 64,384,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,021 | java | package com.javarush.test.level06.lesson11.bonus03;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
/* Задача по алгоритмам
Задача: Написать программу, которая вводит с клавиатуры 5 чисел и выводит их в возрастающем порядке.
Пример ввода:
3
2
15
6
17
Пример вывода:
2
3
6
15
17
*/
public class Solution
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
//напишите тут ваш код
for (int i = 0; i < 5; i++){
int x = Integer.parseInt(reader.readLine());
list.add(x);
}
Collections.sort(list);
for (int i = 0; i < 5; i++)
System.out.println(list.get(i));
}
}
| [
"2756903@gmail.com"
] | 2756903@gmail.com |
79ee000b1cb81eeec2081bfccd933861fa938509 | 807c05324f4ab03af5339435a96ef77586b2ca2f | /src/main/java/net/exathunk/jereal/base/functional/ResFunc3.java | b0a46624628b735e65182720df55d69d14570fd3 | [] | no_license | ejconlon/jerial | fd03b3dd6d09b753cbd3cc3311d6fd8dbedc3cf6 | 031154160b5c388c2dc6024cafb771001fb488cc | refs/heads/master | 2021-01-02T08:31:53.674801 | 2012-11-14T01:50:15 | 2012-11-14T01:50:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package net.exathunk.jereal.base.functional;
/**
* charolastra 10/28/12 12:06 AM
*/
public interface ResFunc3<A, B, C, Z> {
Z runResFunc(A a, B b, C c);
}
| [
"ejconlon@gmail.com"
] | ejconlon@gmail.com |
4522733fbca8753faba32fe7d6428f6e9a579262 | aa6997aba1475b414c1688c9acb482ebf06511d9 | /src/org/omg/IOP/CodecPackage/FormatMismatchHelper.java | db10dc22168f7179e0d372b45e4093dcb43c2963 | [] | no_license | yueny/JDKSource1.8 | eefb5bc88b80ae065db4bc63ac4697bd83f1383e | b88b99265ecf7a98777dd23bccaaff8846baaa98 | refs/heads/master | 2021-06-28T00:47:52.426412 | 2020-12-17T13:34:40 | 2020-12-17T13:34:40 | 196,523,101 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,233 | java | package org.omg.IOP.CodecPackage;
/**
* org/omg/IOP/CodecPackage/FormatMismatchHelper.java . Generated by the IDL-to-Java compiler
* (portable), version "3.2" from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u60/4407/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl
* Tuesday, August 4, 2015 11:07:53 AM PDT
*/
abstract public class FormatMismatchHelper {
private static String _id = "IDL:omg.org/IOP/Codec/FormatMismatch:1.0";
public static void insert(org.omg.CORBA.Any a, org.omg.IOP.CodecPackage.FormatMismatch that) {
org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
a.type(type());
write(out, that);
a.read_value(out.create_input_stream(), type());
}
public static org.omg.IOP.CodecPackage.FormatMismatch extract(org.omg.CORBA.Any a) {
return read(a.create_input_stream());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
private static boolean __active = false;
synchronized public static org.omg.CORBA.TypeCode type() {
if (__typeCode == null) {
synchronized (org.omg.CORBA.TypeCode.class) {
if (__typeCode == null) {
if (__active) {
return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
}
__active = true;
org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember[0];
org.omg.CORBA.TypeCode _tcOf_members0 = null;
__typeCode = org.omg.CORBA.ORB.init()
.create_exception_tc(org.omg.IOP.CodecPackage.FormatMismatchHelper.id(),
"FormatMismatch", _members0);
__active = false;
}
}
}
return __typeCode;
}
public static String id() {
return _id;
}
public static org.omg.IOP.CodecPackage.FormatMismatch read(
org.omg.CORBA.portable.InputStream istream) {
org.omg.IOP.CodecPackage.FormatMismatch value = new org.omg.IOP.CodecPackage.FormatMismatch();
// read and discard the repository ID
istream.read_string();
return value;
}
public static void write(org.omg.CORBA.portable.OutputStream ostream,
org.omg.IOP.CodecPackage.FormatMismatch value) {
// write the repository ID
ostream.write_string(id());
}
}
| [
"yueny09@163.com"
] | yueny09@163.com |
ea19b44840348aeb0521bb9fa16b03190bd7a38f | 33120f4aae69393f9e10ff2394e795ec2ca7ee75 | /yiboweb-boot/src/main/java/cn/yibo/boot/common/annotation/IgnoredLog.java | cec139395e4bed85d127dc6786cda4bed823ac44 | [] | no_license | Wyiwan/yibo-mqces-common | 9fd4df60b770cbdcd4e8ef5aa01ebe10d1ee8c4b | e37bd20eb12ce2c8459a1e0352d8658193e13a38 | refs/heads/master | 2022-06-22T14:14:38.546461 | 2019-11-15T09:07:35 | 2019-11-15T09:07:35 | 221,885,308 | 0 | 0 | null | 2022-06-17T02:37:54 | 2019-11-15T09:02:30 | Java | UTF-8 | Java | false | false | 1,252 | java | /*
{*****************************************************************************
{ 广州医博-基础框架 v1.0
{ 版权信息 (c) 2018-2020 广州医博信息技术有限公司. 保留所有权利.
{ 创建人: 高云
{ 审查人:
{ 模块:日志记录模块
{ 功能描述:
{
{ ---------------------------------------------------------------------------
{ 维护历史:
{ 日期 维护人 维护类型
{ ---------------------------------------------------------------------------
{ 2019-01-11 高云 新建
{
{ ---------------------------------------------------------------------------
{ 注:本模块代码为底层基础框架封装的系统模块
{*****************************************************************************
*/
package cn.yibo.boot.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 忽略日志记录注解
* @author 高云
* @since 2019-01-11
* @version v1.0
*/
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface IgnoredLog {
boolean ignore() default true;
}
| [
"Wyiwan126@126.com"
] | Wyiwan126@126.com |
bbe45ac84bdc390b76ee9e99326de7cb503a576f | 6632563ded5b150ce4571a3047489406a67b628d | /server/src/main/java/nu/aron/peerjuke/server/Dirlist.java | 7f5ca690e90be58295eacdcd93e9a2d7cd8c12a2 | [
"Apache-2.0"
] | permissive | andreasaronsson/peerjuke | f8427b38ed9fae8ee2dc33e3aeadd35aacce40a2 | e39960580aa4ca5d005ba8b7aef3eb8df6227b6b | refs/heads/master | 2021-07-06T18:19:46.412906 | 2020-10-13T05:25:33 | 2020-10-15T15:55:35 | 34,893,992 | 0 | 0 | Apache-2.0 | 2020-10-15T15:56:18 | 2015-05-01T07:48:18 | Java | UTF-8 | Java | false | false | 534 | java | package nu.aron.peerjuke.server;
import static java.util.stream.Collectors.toList;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
class Dirlist {
List<String> dirList(String path) {
try {
return Files.list(Paths.get(path.replaceAll("%2F", "/"))).map(p -> p.toString()).collect(toList());
} catch (IOException e) {
e.printStackTrace();
return Collections.emptyList();
}
}
}
| [
"aron@aron.nu"
] | aron@aron.nu |
e6d15ce615ce0aa7209fa9a12d03036eea2cb7eb | caad3f7cfe5aff4155a7cb9d6629c5f4c00100dd | /SRV_CONF_DynamicConf/src/main/java/com/telefonica/gal/dynamicconf/unica/bu/dto/RoutingKey_UNICA_BU.java | cc8d1ac50e893847039c072814c5357d99c20451 | [] | no_license | AlfonsoMartinezBern/00230056-gal-plus | b670c58c041dbb9e9c4742422468ca1234b1d55a | 06707df547231fcaaeb05d17153a5052f14a48d2 | refs/heads/main | 2023-07-12T01:56:22.310541 | 2021-07-24T16:27:22 | 2021-07-24T16:27:22 | 389,085,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 991 | java | package com.telefonica.gal.dynamicconf.unica.bu.dto;
public class RoutingKey_UNICA_BU {
private String instanceID;
private String platformID;
private String operation;
public RoutingKey_UNICA_BU(String instanceID, String platformID, String operation) {
this.instanceID = instanceID;
this.platformID = platformID;
this.operation = operation;
}
public String getInstanceID() {
return instanceID;
}
public void setInstanceID(String instanceID) {
this.instanceID = instanceID;
}
public String getPlatformID() {
return platformID;
}
public void setPlatformID(String platformID) {
this.platformID = platformID;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
@Override
public String toString() {
return "RoutingKey_UNICA_BU{" +
"instanceID='" + instanceID + '\'' +
", platformID='" + platformID + '\'' +
", operation='" + operation + '\'' +
'}';
}
}
| [
"alfonso.martinez.ext@entelgy.com"
] | alfonso.martinez.ext@entelgy.com |
693f93d99cb98e0cf4f17abf7e72fa6569779238 | 1fbf1205f0435a5f8ecde1fa4cf9852013959177 | /src/main/java/com/jw/shop/service/UserServiceImpl.java | 42861bba90ebd78b871447e20cfa4b26883c36a3 | [
"Apache-2.0"
] | permissive | JWwwwww/shop | 4bb783ea03fc5203c2bb23e7a778f72e0a6ec994 | ae624fbd8ed413f9a5dc0f334e98a5cc7833793b | refs/heads/master | 2020-03-28T01:35:24.244853 | 2018-09-11T06:43:03 | 2018-09-11T06:43:03 | 147,515,676 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,058 | java | package com.jw.shop.service;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import com.jw.shop.mapper.OrderMapper;
import com.jw.shop.mapper.ProductMapper;
import com.jw.shop.mapper.UserMapper;
@Service
public class UserServiceImpl implements UserService {
@Autowired
UserMapper umapper;
@Autowired
ProductMapper pmapper;
@Autowired
OrderMapper omapper;
@Override
public User login(int id, String password) {
User user = umapper.query(id, password);
return user;
}
@Override
public void register(User user) {
umapper.add(user);
}
@Override
public List<Product> all() {
List<Product> list = pmapper.all();
return list;
}
@Override
public void oadd(Order order) {
omapper.oadd(order);
}
@Override
public void oupdata(Order order) {
omapper.oupdata(order);
}
@Override
public Order oquery(Order order) {
Order order2 = omapper.oquery(order);
return order2;
}
@Override
public List<OrderInfo> oall(OrderInfo info) {
List<OrderInfo> list = omapper.oall(info);
return list;
}
@Override
public void delete(OrderInfo info) {
omapper.delete(info);
}
@Override
public List<User> alluser() {
List<User> list = umapper.alluser();
return list;
}
@Override
public void ud(User user) {
umapper.ud(user);
}
@Override
public void pd(Product product) {
pmapper.pd(product);
}
@Override
public void uxg(User user) {
umapper.uxg(user);
}
@Override
public void pxg(Product product) {
pmapper.pxg(product);
}
@Override
public void padd(Product product) {
pmapper.padd(product);
}
@Override
public void tj(Order order) {
omapper.tj(order);
}
@Override
public List<Product> ser(String pname) {
List<Product> list = pmapper.ser(pname);
return list;
}
@Override
public Product pslt(OrderInfo orderInfo) {
Product product = omapper.pslt(orderInfo);
return product;
}
}
| [
"40692522+JWwwwww@users.noreply.github.com"
] | 40692522+JWwwwww@users.noreply.github.com |
d68742e8263d019d9e87233500dc1c3500c31b7a | faf4e97b109f5c173596650848d18978a220929b | /app/src/main/java/ais/co/th/readsecret/MainActivity.java | e281bb4c72d367c24af7a949908804a3d4f44d4c | [] | no_license | casanovapick/ReadSecret | 0a807154ada002261b506ab53daf99684532dfee | e3bbb5c86ef24d39e46bafbd1a623b5686098773 | refs/heads/master | 2020-05-31T08:30:19.145851 | 2015-03-18T07:58:37 | 2015-03-18T07:58:37 | 32,298,251 | 0 | 1 | null | 2015-03-18T08:24:38 | 2015-03-16T03:08:04 | Java | UTF-8 | Java | false | false | 2,446 | java | package ais.co.th.readsecret;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends ActionBarActivity {
Button btnGET;
TextView txtSecret;
Button btnOut;
SharedPreferences prefs;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
btnGET = (Button) findViewById(R.id.btn_get);
btnOut = (Button) findViewById(R.id.btn_logout);
txtSecret = (TextView) findViewById(R.id.txt_secret);
btnGET.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setComponent(new ComponentName("ais.co.th.writesecret", "ais.co.th.writesecret.ConfirmActivity"));
startActivityForResult(intent,200);
}
});
btnOut.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
prefs.edit().putString("Secret","").apply();
finish();
}
});
if(prefs.getString("Secret","").matches("")){
btnOut.setVisibility(View.GONE);
btnGET.setVisibility(View.VISIBLE);
}else{
txtSecret.setText("Login with "+prefs.getString("Secret",""));
btnGET.setVisibility(View.GONE);
btnOut.setVisibility(View.VISIBLE);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (200 == requestCode) {
if (resultCode == RESULT_OK) {
txtSecret.setText("Login with "+data.getStringExtra("Secret"));
prefs.edit().putString("Secret", data.getStringExtra("Secret")).apply();
btnGET.setVisibility(View.GONE);
btnOut.setVisibility(View.VISIBLE);
}
}
}
}
| [
"jirachai_h1@hotmail.com"
] | jirachai_h1@hotmail.com |
ead2ed6bd9fe6f5893af31c3c86380e4a672ced1 | 4e3751b8b44069fd3ac6e42d7a3629ce12f076df | /IA/src/datamining/Database.java | 2c8b397b2a8a66d8910bb5f261e4491569b7b153 | [] | no_license | Nikkunemufr/Java | 6ab307bc3bd604e41b5a1749681c133bcedc0723 | c4b5326b527723c5bdcd09370ecb3860ea8e7b75 | refs/heads/master | 2023-01-02T19:28:39.149706 | 2020-10-22T08:29:42 | 2020-10-22T08:29:42 | 112,723,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,042 | java | package datamining;
import representations.Variable;
import java.util.*;
/**
* @author Vincent DEMENEZES, Alexis MORTELIER, Alexandre LELOUTRE
*/
public class Database {
private List<Variable> listVariable;
private List<Map<Variable, String>> listTransactions;
/**
* Constructeur instanciant une database
*
* @param listVariable liste des variables appartenant a la database
* @param listTransactions liste des transactions appartenant a la database
*/
public Database(List<Variable> listVariable, List<Map<Variable, String>> listTransactions) {
this.listVariable = listVariable;
this.listTransactions = listTransactions;
}
/**
* Transforme une database non booléenne en une database booléenne
*
* @return database transformé en database booléenne
*/
public BooleanDatabase toBooleanDatabase() {
List<Variable> listVariableBoolean = new ArrayList<>();
List<Map<Variable, String>> listTransactionsBoolean = new ArrayList<>();
HashSet<String> bool = new HashSet<>();
bool.add("0");
bool.add("1");
// Transformation des variables non boolean en variable boolean
for (Variable var : listVariable) {
for (String value : var.getDomaine()) {
listVariableBoolean.add(new Variable(var.getNom() + "_" + value, bool));
}
}
// Transformation des transactions non boolean en transactions boolean
for (Map<Variable, String> transaction : listTransactions) {
Map<Variable, String> mapTransactionBoolean = new HashMap<>();
// Initialisation de toute les variables boolean
for (Variable var : listVariableBoolean) {
mapTransactionBoolean.put(var, "0");
}
// Pour chaque variable étant dans une transaction on passe sa valeur à vrai
for (Map.Entry mapEntry : transaction.entrySet()) {
Variable key = (Variable) mapEntry.getKey();
for (Variable var : listVariableBoolean) {
if (var.getNom().equals(key.getNom() + "_" + transaction.get(key))) {
mapTransactionBoolean.put(var, "1");
}
}
}
// Ajout de la transaction boolean a la liste de toute les transactions boolean
listTransactionsBoolean.add(mapTransactionBoolean);
}
return new BooleanDatabase(listVariableBoolean, listTransactionsBoolean);
}
/**
* Methode permettant d'acceder à la liste des variables passé au constructeur
*
* @return liste des variables
*/
public List<Variable> getListVariable() {
return listVariable;
}
/**
* Methode permettant d'acceder à la liste des transactions passé au constructeur
*
* @return liste des transactions
*/
public List<Map<Variable, String>> getListTransactions() {
return listTransactions;
}
} | [
"alexis.brink@laposte.net"
] | alexis.brink@laposte.net |
c7ffe18852c36b1b3d0f3cfb81281ae11486c2eb | e5ca704cfff43c93974f7c99961eb24305d609c9 | /catmos_gui/workspace/CapabilityOverTime.editor/src/CapOverTime/presentation/CapOverTimeActionBarContributor.java | 2a4dc6f36ff3e74992500f98bfaa8cde9c294425 | [] | no_license | Frankablu/CATMOS | f4369bbdf41b9cfc30aa98a295935df07a21a224 | 8c8b33cc2f0297fd5ffe184b76fb954eac3c81ed | refs/heads/master | 2021-01-19T00:25:50.447735 | 2015-01-15T04:23:52 | 2015-01-15T04:23:52 | 21,400,436 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,898 | java | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package CapOverTime.presentation;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.action.ValidateAction;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.SubContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
/**
* This is the action bar contributor for the CapOverTime model editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CapOverTimeActionBarContributor
extends EditingDomainActionBarContributor
implements ISelectionChangedListener
{
/**
* This keeps track of the active editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IEditorPart activeEditorPart;
/**
* This keeps track of the current selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ISelectionProvider selectionProvider;
/**
* This action opens the Properties view.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction showPropertiesViewAction =
new Action(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item"))
{
@Override
public void run()
{
try
{
getPage().showView("org.eclipse.ui.views.PropertySheet");
}
catch (PartInitException exception)
{
CapOverTimeEditorPlugin.INSTANCE.log(exception);
}
}
};
/**
* This action refreshes the viewer of the current editor if the editor
* implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IAction refreshViewerAction =
new Action(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item"))
{
@Override
public boolean isEnabled()
{
return activeEditorPart instanceof IViewerProvider;
}
@Override
public void run()
{
if (activeEditorPart instanceof IViewerProvider)
{
Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
if (viewer != null)
{
viewer.refresh();
}
}
}
};
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createChildActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateChild actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createChildMenuManager;
/**
* This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
* generated for the current selection by the item provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> createSiblingActions;
/**
* This is the menu manager into which menu contribution items should be added for CreateSibling actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IMenuManager createSiblingMenuManager;
/**
* This creates an instance of the contributor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CapOverTimeActionBarContributor()
{
super(ADDITIONS_LAST_STYLE);
loadResourceAction = new LoadResourceAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
}
/**
* This adds Separators for editor additions to the tool bar.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToToolBar(IToolBarManager toolBarManager)
{
toolBarManager.add(new Separator("capovertime-settings"));
toolBarManager.add(new Separator("capovertime-additions"));
}
/**
* This adds to the menu bar a menu and some separators for editor additions,
* as well as the sub-menus for object creation items.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void contributeToMenu(IMenuManager menuManager)
{
super.contributeToMenu(menuManager);
IMenuManager submenuManager = new MenuManager(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_CapOverTimeEditor_menu"), "CapOverTimeMenuID");
menuManager.insertAfter("additions", submenuManager);
submenuManager.add(new Separator("settings"));
submenuManager.add(new Separator("actions"));
submenuManager.add(new Separator("additions"));
submenuManager.add(new Separator("additions-end"));
// Prepare for CreateChild item addition or removal.
//
createChildMenuManager = new MenuManager(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
submenuManager.insertBefore("additions", createChildMenuManager);
// Prepare for CreateSibling item addition or removal.
//
createSiblingMenuManager = new MenuManager(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
submenuManager.insertBefore("additions", createSiblingMenuManager);
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener
(new IMenuListener()
{
public void menuAboutToShow(IMenuManager menuManager)
{
menuManager.updateAll(true);
}
});
addGlobalActions(submenuManager);
}
/**
* When the active editor changes, this remembers the change and registers with it as a selection provider.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setActiveEditor(IEditorPart part)
{
super.setActiveEditor(part);
activeEditorPart = part;
// Switch to the new selection provider.
//
if (selectionProvider != null)
{
selectionProvider.removeSelectionChangedListener(this);
}
if (part == null)
{
selectionProvider = null;
}
else
{
selectionProvider = part.getSite().getSelectionProvider();
selectionProvider.addSelectionChangedListener(this);
// Fake a selection changed event to update the menus.
//
if (selectionProvider.getSelection() != null)
{
selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
}
}
}
/**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void selectionChanged(SelectionChangedEvent event)
{
// Remove any menu items for old selection.
//
if (createChildMenuManager != null)
{
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null)
{
depopulateManager(createSiblingMenuManager, createSiblingActions);
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1)
{
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions(newChildDescriptors, selection);
createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
if (createChildMenuManager != null)
{
populateManager(createChildMenuManager, createChildActions, null);
createChildMenuManager.update(true);
}
if (createSiblingMenuManager != null)
{
populateManager(createSiblingMenuManager, createSiblingActions, null);
createSiblingMenuManager.update(true);
}
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection)
{
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null)
{
for (Object descriptor : descriptors)
{
actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
* and returns the collection of these actions.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection)
{
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null)
{
for (Object descriptor : descriptors)
{
actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
}
}
return actions;
}
/**
* This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
* by inserting them before the specified contribution item <code>contributionID</code>.
* If <code>contributionID</code> is <code>null</code>, they are simply added.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID)
{
if (actions != null)
{
for (IAction action : actions)
{
if (contributionID != null)
{
manager.insertBefore(contributionID, action);
}
else
{
manager.add(action);
}
}
}
}
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions)
{
if (actions != null)
{
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++)
{
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem)
{
contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem)
{
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (actions.contains(action))
{
manager.remove(contributionItem);
}
}
}
}
}
/**
* This populates the pop-up menu before it appears.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void menuAboutToShow(IMenuManager menuManager)
{
super.menuAboutToShow(menuManager);
MenuManager submenuManager = null;
submenuManager = new MenuManager(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
populateManager(submenuManager, createChildActions, null);
menuManager.insertBefore("edit", submenuManager);
submenuManager = new MenuManager(CapOverTimeEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
populateManager(submenuManager, createSiblingActions, null);
menuManager.insertBefore("edit", submenuManager);
}
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void addGlobalActions(IMenuManager menuManager)
{
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
/**
* This ensures that a delete action will clean up all references to deleted objects.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean removeAllReferencesOnDelete()
{
return true;
}
} | [
"frankablu@gmail.com"
] | frankablu@gmail.com |
754cc6194ae6721da0e3923255ccb58ab7158f91 | 87b28aa75b499cf8930d0340ee0e0091e33185e3 | /objectify_simple/src/objectify_simple/OfyHelper.java | 573c9aba58c4a963249ca2d1b26f708f5a9bd339 | [] | no_license | learn9/objectify_trial | 28a06aa1deba66468b67647b1aa3c040af6701a7 | ec9e6875a83a46f72c0585e07cfaadb344e89aa0 | refs/heads/master | 2021-01-10T09:16:04.807839 | 2015-12-09T14:10:19 | 2015-12-09T14:10:19 | 47,623,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package objectify_simple;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyFactory;
import com.googlecode.objectify.ObjectifyService;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
/**
* OfyHelper, a ServletContextListener, is setup in web.xml to run before a JSP is run. This is
* required to let JSP's access Ofy.
**/
public class OfyHelper implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
// This will be invoked as part of a warmup request, or the first user request if no warmup
// request.
ObjectifyService.register(Car.class);
}
public void contextDestroyed(ServletContextEvent event) {
// App Engine does not currently invoke this method.
}
} | [
"apiswswsw@gmail.com"
] | apiswswsw@gmail.com |
2ce6d7b560be7bd595d096089beb62f07b75f716 | 3507b514f50835fea377235419575aa76a13411c | /src/main/java/com/sschudakov/gui/Perspective.java | 9c0889be83ca0676312c6ce92bac8932ccfa5a13 | [] | no_license | SChudakov/OOPLab | 303a8d7f7bb7af0c7d9a30c2e5aa8284602a40b1 | 180fba6f056658c25b6e3fb75e1f69f4e57595f8 | refs/heads/master | 2021-09-16T07:17:45.207665 | 2018-06-18T12:06:20 | 2018-06-18T12:06:20 | 105,442,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package com.sschudakov.gui;
/**
* Created by Semen Chudakov on 20.09.2017.
*/
public enum Perspective {
FileManager(),
FileRedactor();
Perspective(){
}
}
| [
"css-99@i.ua"
] | css-99@i.ua |
70dd36b49f7d685994befbfa6c9de7d6c9c462d7 | 623ef934bf74b4ab4c51feef9e1405f69208ea34 | /src/model/EstUnFilm.java | f1a578ea458f711aa2fc4eb2c2f69fd57c6ddd3a | [] | no_license | AndriyParkho/Klex_BDD | 5281b657d247f9d30b112801e4ffee0495ddd61c | 7bade220036c87556e836b22dacca0c6b00389c7 | refs/heads/master | 2023-03-01T22:25:11.895736 | 2020-12-11T17:08:42 | 2020-12-11T17:08:42 | 339,063,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,004 | java | package model;
import java.sql.Date;
public class EstUnFilm {
private long idFichier;
private String titreFilm;
private Date anneeSortie;
public EstUnFilm(long idFichier, String titreFilm, Date anneeSortie) {
this.idFichier = idFichier;
this.titreFilm = titreFilm;
this.anneeSortie = anneeSortie;
}
public long getIdFichier() {
return idFichier;
}
public void setIdFichier(long idFichier) {
this.idFichier = idFichier;
}
public String getTitreFilm() {
return titreFilm;
}
public void setTitreFilm(String titreFilm) {
this.titreFilm = titreFilm;
}
public Date getAnneeSortie() {
return anneeSortie;
}
public void setAnneeSortie(Date anneeSortie) {
this.anneeSortie = anneeSortie;
}
@Override
public String toString() {
return "EstUnFilm [anneeSortie=" + anneeSortie + ", idFichier=" + idFichier + ", titreFilm=" + titreFilm + "]";
}
}
| [
"samy.vincent10@gmail.com"
] | samy.vincent10@gmail.com |
4e7d80bee254b7dba12f25baabfccce083eb5f13 | 2834bf025b9d5a92c828f09dbf15b3d2991fa04a | /finalproject/src/main/java/com/finalproject/domain/Company.java | 873b2e42494b903b8dfb7aefb9831a54151b13dc | [
"MIT"
] | permissive | bricedjilo/CS4125_database_models | 475053f85d0e0a3e71f9ea6af063542c03feb9a8 | de68fd0bafddf70324bb02c0930a1bcbc91a509e | refs/heads/master | 2021-01-10T12:52:32.563412 | 2015-12-01T18:24:29 | 2015-12-01T18:24:29 | 43,833,402 | 1 | 0 | null | 2015-12-01T18:24:30 | 2015-10-07T17:38:38 | Java | UTF-8 | Java | false | false | 1,023 | java | package com.finalproject.domain;
public class Company {
private int compId;
private String name;
private String primarySector;
private String website;
public Company(String name, String primarySector, String website) {
this.name = name;
this.primarySector = primarySector;
this.website = website;
}
public Company() {
}
public int getCompId() {
return compId;
}
public void setCompId(int compId) {
this.compId = compId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrimarySector() {
return primarySector;
}
public void setPrimarySector(String primarySector) {
this.primarySector = primarySector;
}
public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.website = website;
}
@Override
public String toString() {
return "Company [compId=" + compId + ", name=" + name + ", primarySector=" + primarySector + ", website="
+ website + "]";
}
}
| [
"dbrice@uno.edu"
] | dbrice@uno.edu |
9a8444cb80300f8031ff3bad5f8baac4eed7245a | ae444bc7e74e7555921543301b9668b0279761c4 | /Student_Test_System/src/Student/Student_login.java | e67a794f260b700f60e619d793f05d97b6b191df | [] | no_license | SaifUrRehman21/Student_Test_System | b4f3b0014006066c78147556786519357e1a2068 | a5fe3194bc2fe868f95783175cda293c550793fa | refs/heads/master | 2020-04-19T09:16:41.574778 | 2019-01-29T08:17:42 | 2019-01-29T08:17:42 | 168,105,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,417 | java | package Student;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.SoftBevelBorder;
import TestSystem.Admin_SignUp;
import TestSystem.Admin_login;
import TestSystem.Admin_panel;
import TestSystem.Select_Panel;
public class Student_login extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JPasswordField passwordField;
private JLabel lblClickHere;
private JLabel lblForgetPassword;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Student_login frame = new Student_login();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Student_login() {
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 518, 538);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
textField = new JTextField();
textField.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
textField.setFont(new Font("Tahoma", Font.PLAIN, 15));
textField.setBounds(140, 156, 273, 29);
contentPane.add(textField);
textField.setColumns(10);
passwordField = new JPasswordField();
passwordField.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
passwordField.setFont(new Font("Tahoma", Font.PLAIN, 15));
passwordField.setBounds(140, 218, 273, 29);
contentPane.add(passwordField);
JButton btnCreateAccount = new JButton("");
btnCreateAccount.setIcon(new ImageIcon(Select_Panel.class.getResource("/Images/CreateAccount_Button.jpg")));
btnCreateAccount.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Admin_login a=new Admin_login();
a.setVisible(false);
Admin_SignUp b=new Admin_SignUp();
b.setVisible(true);
}
});
btnCreateAccount.setBounds(48, 360, 427, 70);
contentPane.add(btnCreateAccount);
JButton btnLogin = new JButton("");
btnLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
{
String user=textField.getText();
String pass=passwordField.getText();
if (user.isEmpty() ||pass.isEmpty())
{
JOptionPane.showConfirmDialog(null, "Username & Password must not be empty.");
}
else
{
try
{
Class.forName("com.mysql.jdbc.Driver");
String URL="jdbc:mysql://localhost/studenttestsystem";
Connection con=DriverManager.getConnection(URL,"root","");
Statement st=con.createStatement();
PreparedStatement pst = con.prepareStatement("select * from Student_Signup where Username=? and Password=?");
pst.setString(1, user);
pst.setString(2, pass);
ResultSet rs = pst.executeQuery();
if (rs.next())
{
JOptionPane.showConfirmDialog(null, "Login Successfull");
textField.setText("");
passwordField.setText("");
Student_login a=new Student_login();
a.setVisible(false);
Start_Test b=new Start_Test();
b.setVisible(true);
}
else
{
JOptionPane.showConfirmDialog(null, "Login Unsuccessfull");
textField.setText("");
passwordField.setText("");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
}
});
btnLogin.setIcon(new ImageIcon(Select_Panel.class.getResource("/Images/Login_Button.jpg")));
btnLogin.setBounds(48, 279, 427, 70);
contentPane.add(btnLogin);
lblClickHere = new JLabel("Click Here");
lblClickHere.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
JOptionPane.showConfirmDialog(null, "Successfully! Remember your password and Try again");
}
});
lblClickHere.setForeground(new Color(0, 0, 255));
lblClickHere.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblClickHere.setBounds(282, 430, 93, 38);
contentPane.add(lblClickHere);
lblForgetPassword = new JLabel("Forget Password?");
lblForgetPassword.setFont(new Font("Tahoma", Font.PLAIN, 13));
lblForgetPassword.setBounds(180, 430, 102, 38);
contentPane.add(lblForgetPassword);
JLabel label = new JLabel("");
label.setBackground(Color.YELLOW);
label.setIcon(new ImageIcon(Student_login.class.getResource("/Images/Student_login.jpg")));
label.setBounds(0, 0, 514, 514);
contentPane.add(label);
}
}
| [
"saifurrehmankhan21@outlook.com"
] | saifurrehmankhan21@outlook.com |
c5d25c0c45efcbb1238d1b26c9f1ae99570d4d20 | 6fe54233321a486eafd5ea8721e5f22d68e1d972 | /LapTrinhMang/D7HN_2/src/Cau1/Rmi_Interface.java | 569f5560c0d5c0a8041b7c8f8c499debe1975fbf | [] | no_license | z3r0k3n/codebasic | 2df5e8c4e58db7a572c0c2fc7ba34c07bc5ce6d9 | a30286f696c37e6d377781d6f9c5d728b623140c | refs/heads/master | 2020-04-14T07:22:06.539430 | 2019-05-15T23:17:38 | 2019-05-15T23:17:38 | 163,710,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | 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 Cau1;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
*
* @author Zero Ken
*/
public interface Rmi_Interface extends Remote{
public String tamgiac (int a,int b,int c) throws RemoteException;
}
| [
"46290110+z3r0k3n@users.noreply.github.com"
] | 46290110+z3r0k3n@users.noreply.github.com |
49d8d3aba4bf2d44c6735862a28e35083ee1c9a9 | c10b91aa00852b138f3ca7d79cf2d2d0577ab9e0 | /Client/SocketClient/gen/acer/com/socketclient/R.java | 38f7db163dab97a85796ee4be410c3fb2e401ec7 | [] | no_license | weihsiang-lin/Smart-Lock | df5fdaf37a1d6b667d7c4941c26319132fbb9c24 | 0006b6802920e24979b35a1bf72c371a571663f7 | refs/heads/master | 2020-05-30T00:15:58.166639 | 2014-02-25T06:31:00 | 2014-02-25T06:31:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,592 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package acer.com.socketclient;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f050000;
public static final int activity_vertical_margin=0x7f050001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f090001;
public static final int textView1=0x7f090000;
}
public static final class layout {
public static final int socketclient=0x7f030000;
}
public static final class menu {
public static final int socket_client=0x7f080000;
}
public static final class string {
public static final int action_settings=0x7f060001;
public static final int app_name=0x7f060000;
public static final int hello_world=0x7f060002;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070001;
}
public static final class xml {
public static final int nfc_tech_filter=0x7f040000;
}
}
| [
"weihsiang.lin@gmail.com"
] | weihsiang.lin@gmail.com |
07029af2b72deeb106115025118a93bf48852e0c | 7c9e49474a29f7e79955f721945dcda22ec03099 | /Dynamo/src/net/dynamo/Dao/UAVMapDAO.java | 230b695bc857ba026e07192a7a9afbc4899ec43b | [] | no_license | CS698/Dynamo | 0ee17d791be6261a203adf7cf7c1fafe0d270213 | b1a9bdb0e7101517f3baf24975dc354a9f0ccc1d | refs/heads/master | 2021-01-17T07:04:14.793684 | 2016-05-23T21:42:07 | 2016-05-23T21:42:07 | 51,626,422 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package net.dynamo.Dao;
import java.util.List;
import java.util.Map;
public interface UAVMapDAO {
public abstract Map uavToMap(int counter);
}
| [
"S1048861@monmouth.edu"
] | S1048861@monmouth.edu |
5a26a49b99670c2033ff77b830d060153c939b38 | 260a3dc0eee02ee175c19d7b6aaebb258819decc | /study/lose/src/com/ssh/lose/dao/impl/LetterDAOImpl.java | 928431b5b8fa88c022e3a17aac18fd1be6841b41 | [] | no_license | nkkadmin/study | 9d811b6efe0ca8c11829c20da9ed15a68bdb7089 | 98a094901574e30c5bf500622c712bba90a7265e | refs/heads/master | 2020-04-05T14:38:58.506005 | 2017-11-08T10:11:02 | 2017-11-08T10:11:02 | 94,728,536 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package com.ssh.lose.dao.impl;
import org.springframework.stereotype.Repository;
import com.ssh.lose.dao.LetterDAO;
import com.ssh.lose.po.Letter;
@Repository
public class LetterDAOImpl extends BaseDAOImpl<Letter> implements LetterDAO {
}
| [
"694143695@qq.com"
] | 694143695@qq.com |
51b88d8525e95e1713c57302f810698667b0faa9 | 8ec2cbabd6125ceeb00e0c6192c3ce84477bdde6 | /com.alcatel.as.utils/src/alcatel/tess/hometop/gateways/utils/NxTimerDurationException.java | b0db727f9c59428686c5ab568b3ccdb165bf5a7c | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nokia/osgi-microfeatures | 2cc2b007454ec82212237e012290425114eb55e6 | 50120f20cf929a966364550ca5829ef348d82670 | refs/heads/main | 2023-08-28T12:13:52.381483 | 2021-11-12T20:51:05 | 2021-11-12T20:51:05 | 378,852,173 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 510 | java | // Copyright 2000-2021 Nokia
//
// Licensed under the Apache License 2.0
// SPDX-License-Identifier: Apache-2.0
//
package alcatel.tess.hometop.gateways.utils;
/**
Exception thrown when a timer duration is out of range
*/
public class NxTimerDurationException extends Exception {
/**
Constructor without message.
*/
public NxTimerDurationException() {
super();
}
/**
Constructor with user message.
*/
public NxTimerDurationException(String message) {
super(message);
}
}
| [
"pierre.de_rop@nokia.com"
] | pierre.de_rop@nokia.com |
4a0e49a680061f8de5dab216da04e9e444c47f4c | f6ef0182d1ad5290ad9c2b07d182c1f2f1ae31af | /src/main/java/pl/zut/gui/TableObject.java | 510e52d6ba4d2c2720628241ddb3719335179f9f | [] | no_license | Piotr-Retman/OptimizationFX | 22529ac547dbb670148c5e5d3cb7bb9b9a480453 | 384417179823909e139129196bd30705f626c26f | refs/heads/master | 2021-01-18T21:43:17.980822 | 2016-05-20T11:30:13 | 2016-05-20T11:30:13 | 55,133,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package pl.zut.gui;
/**
* Obiekt tablicowy do GUI
*/
public class TableObject {
public TableObject(String order, String makeOrderTime, String deadlineOrderTime) {
this.order = order;
this.makeOrderTime = makeOrderTime;
this.deadlineOrderTime = deadlineOrderTime;
}
private String order;
private String makeOrderTime;
private String deadlineOrderTime;
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public String getMakeOrderTime() {
return makeOrderTime;
}
public void setMakeOrderTime(String makeOrderTime) {
this.makeOrderTime = makeOrderTime;
}
public String getDeadlineOrderTime() {
return deadlineOrderTime;
}
public void setDeadlineOrderTime(String deadlineOrderTime) {
this.deadlineOrderTime = deadlineOrderTime;
}
}
| [
"obywatel23@gmail.com"
] | obywatel23@gmail.com |
b9725c132c4d2cc36f9a1e77c9ce381319cc6180 | 9bc0387b1c85cb678495b5279c666154a37db19b | /src/controller/base/AdminController.java | 2f48dcac31749ec7cc6ef1ea6c7f3a3002536e23 | [] | no_license | kang9067/part | 750b1d8c561f00866138e1e774f9556b367bc906 | b79cf281da78cf21bf765f98d7bb22a75110a539 | refs/heads/master | 2020-07-29T11:56:10.917664 | 2016-11-24T07:12:52 | 2016-11-24T07:12:52 | 73,669,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 699 | java | package controller.base;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
public class AdminController extends BaseController{
@Override
protected ModelAndView createView(String path, ModelMap modelMap) {
return super.createView("/admin/"+path, modelMap);
}
protected ModelAndView createView(String path){
return super.createView("/admin/"+path, modelMap);
}
@RequestMapping("{html}.html")
public ModelAndView html(@PathVariable("html") String html){
return this.createView(html,null);
}
}
| [
"tjoker1234@outlook.com"
] | tjoker1234@outlook.com |
a50901eaadc107893af3e7a7baeaf34f86c38a48 | cf70b04f98fb450687ef7ef44f7b869d63ae5a22 | /FileManagementAssistant/app/src/main/java/com/example/administrator/filemanagementassistant/util/ScrollAwareFABBehavior.java | c7e37104e3eb0c9001555b6e8c94a02dfbfff500 | [
"Apache-2.0"
] | permissive | haibowen/MyGraduationProject | 91e1f8bbcbb0d7a8d850d8b9aed40123e8c42886 | 53962dd3e4b61fff91672b81a6c2636b3fefad8e | refs/heads/master | 2021-06-22T04:32:51.831750 | 2020-12-27T02:25:45 | 2020-12-27T02:25:45 | 159,469,172 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,320 | java | package com.example.administrator.filemanagementassistant.util;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.LinearInterpolator;
import com.getbase.floatingactionbutton.FloatingActionsMenu;
public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior<FloatingActionsMenu> {
private static final android.view.animation.Interpolator INTERPOLATOR = new FastOutSlowInInterpolator();
private boolean mIsAnimatingOut = false;
public ScrollAwareFABBehavior(Context context, AttributeSet attrs) {
super();
}
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionsMenu child, View directTargetChild, View target, int nestedScrollAxes) {
//处理垂直方向上的滚动事件
return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}
@Override
public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionsMenu child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);
if (dyConsumed > 0) { // 向下滑动
//如果是展开的话就先收回去
if (child.isExpanded()) {
child.collapse();
}
animateOut(child);
} else if (dyConsumed < 0) { // 向上滑动
animateIn(child);
}
}
private void animateOut(final FloatingActionsMenu button) {
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) button.getLayoutParams();
int bottomMargin = layoutParams.bottomMargin;
button.animate().translationY(button.getHeight() + bottomMargin).setInterpolator(new LinearInterpolator()).start();
}
private void animateIn(FloatingActionsMenu button) {
button.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
}
}
| [
"1461154748@qq.com"
] | 1461154748@qq.com |
cbaae30b7d6f99122b46e53107c82e8c1b7c510a | 1ac08035abcbe559bc5d6362557b91e3db44b783 | /rabbitmq-springcloudstream-producer/src/main/java/com/ziyin/rabbitmq/springcloudstream/producer/RabbitmqSpringcloudstreamProducerApplication.java | f3ee4241f1f144a8491a71fd9274885eb7b1765e | [] | no_license | ziyinjava/rabbitmq | 4eeb2999769d8691d11e1497d8f879e10b9891bf | 2f92870896f27ff1ad72c6432916a337ab4bcbe1 | refs/heads/master | 2022-06-24T01:55:26.709840 | 2019-09-21T06:25:14 | 2019-09-21T06:25:14 | 209,936,100 | 0 | 0 | null | 2022-06-17T02:32:25 | 2019-09-21T06:23:56 | Java | UTF-8 | Java | false | false | 392 | java | package com.ziyin.rabbitmq.springcloudstream.producer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RabbitmqSpringcloudstreamProducerApplication {
public static void main(String[] args) {
SpringApplication.run(RabbitmqSpringcloudstreamProducerApplication.class, args);
}
}
| [
"ziyinjava@163.com"
] | ziyinjava@163.com |
41e8501150d02cc23e0e73c71f7ab711d9446b2e | e9604b8d885383682ab37375f586c9759b443e63 | /src/main/java/com/jessica/mc/domain/Cliente.java | b054c7cb34744cbc39d3ea99cb60ff32aa3f43f2 | [] | no_license | jlzimmerhansl/cursomc | 3c7c9573e0a4801c87ad6fbceef66eae8e2d9db6 | 982b28c1943d847d19e6a58da3cd475e2646f927 | refs/heads/master | 2023-03-25T17:22:36.743646 | 2021-02-23T19:05:08 | 2021-02-23T19:05:08 | 335,032,450 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,901 | java | package com.jessica.mc.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CollectionTable;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jessica.mc.domain.enums.TipoCliente;
@Entity
public class Cliente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String nome;
private String email;
private String cpfOuCnpj;
private Integer tipo;
@OneToMany(mappedBy = "cliente")
private List<Endereco> enderecos = new ArrayList<>();
@ElementCollection
@CollectionTable(name="TELEFONE")
private Set<String> telefones = new HashSet<>();
@JsonIgnore
@OneToMany(mappedBy = "cliente")
private List<Pedido> pedidos = new ArrayList<>();
public Cliente() {}
public Cliente(Integer id, String nome, String email, String cpfOuCnpj, TipoCliente tipo) {
super();
this.id = id;
this.nome = nome;
this.email = email;
this.cpfOuCnpj = cpfOuCnpj;
this.tipo = tipo.getCode();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCpfOuCnpj() {
return cpfOuCnpj;
}
public void setCpfOuCnpj(String cpfOuCnpj) {
this.cpfOuCnpj = cpfOuCnpj;
}
public TipoCliente getTipo() {
return TipoCliente.toEnum(tipo);
}
public void setTipo(TipoCliente tipo) {
this.tipo = tipo.getCode();
}
public List<Endereco> getEnderecos() {
return enderecos;
}
public void setEnderecos(List<Endereco> enderecos) {
this.enderecos = enderecos;
}
public Set<String> getTelefones() {
return telefones;
}
public void setTelefones(Set<String> telefones) {
this.telefones = telefones;
}
public List<Pedido> getPedidos() {
return pedidos;
}
public void setPedidos(List<Pedido> pedidos) {
this.pedidos = pedidos;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cliente other = (Cliente) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
| [
"jlzimmerhansl@gmail.com"
] | jlzimmerhansl@gmail.com |
53d450b0885235261dfd3ec56065c54474f03aac | 6377712f58b113de13a36bbdfaeda8747b463798 | /app/src/main/java/com/ysh/testopengl/ShaderUtils.java | a95d3cbd0156bd6bc69214d344b02aed3020b403 | [] | no_license | SHLURENJIA/OpenGLTestPractice | a6c65267f724012c9580a9848114a308a9748a24 | 6c2b05bd7e1e13ef3cdc5b7144862d0df12d9843 | refs/heads/master | 2020-04-24T14:12:38.018064 | 2019-03-01T01:39:57 | 2019-03-01T01:39:57 | 172,012,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,450 | java | package com.ysh.testopengl;
import android.content.res.Resources;
import android.opengl.GLES20;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* 作者:create by @author{ YSH } on 2019/2/21
* 描述:着色器辅助工具类
* 修改备注:
*/
public class ShaderUtils {
/**
* 创建着色器程序
*
* @param vertexShader
* @param fragmentShader
* @return
*/
public static int createProgram(String vertexShader, String fragmentShader) {
//加载顶点着色器
int vertexShaderId = loadShader(GLES20.GL_VERTEX_SHADER, vertexShader);
if (vertexShaderId == 0) {
return 0;
}
//加载片元着色器
int fragShaderId = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShader);
if (fragShaderId == 0) {
return 0;
}
//创建着色器程序
int program = GLES20.glCreateProgram();
//在程序中加入顶点着色器和片元着色器
if (program != 0) {
//加入顶点着色器
GLES20.glAttachShader(program, vertexShaderId);
checkGlError("glAttachShader");
//加入片元着色器
GLES20.glAttachShader(program, fragShaderId);
checkGlError("glAttachShader");
//链接程序
GLES20.glLinkProgram(program);
//存放成功的程序
int[] linkStatus = new int[1];
//获取program链接情况
GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
if (linkStatus[0] != GLES20.GL_TRUE) {
//链接失败,删除程序
Log.e("ES20_ERROR", "Could not link program: ");
Log.e("ES20_ERROR", GLES20.glGetProgramInfoLog(program));
GLES20.glDeleteProgram(program);
return 0;
}
}
return program;
}
/**
* 加载着色器,编译着色器
*
* @param type 着色器类型 GLES20.GL_VERTEX_SHADER GLES20.GL_FRAGMENT_SHADER
* @param shaderString 着色器程序内容文本字符串
* @return 着色器程序id
*/
private static int loadShader(int type, String shaderString) {
//创建着色器对象
int shaderid = GLES20.glCreateShader(type);
if (shaderid != 0) {//创建成功
//加载着色器代码到着色器对象
GLES20.glShaderSource(shaderid, shaderString);
//编译着色器
GLES20.glCompileShader(shaderid);
//存放编译成功Shader数量数组
int[] compileStatus = new int[1];
//获取shader编译情况
GLES20.glGetShaderiv(shaderid, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
if (compileStatus[0] == 0) {
//编译失败,显示日志并删除该对象
Log.e("GLES20", "Could not compile shader " + type + ":");
Log.e("GLES20", GLES20.glGetShaderInfoLog(shaderid));
GLES20.glDeleteShader(shaderid);
return 0;
}
}
return shaderid;
}
/**
* 从 assets 资源文件夹中读取着色器内容
*
* @param fname 着色器文件名称
* @param r
* @return 着色器内容
*/
public static String loadFromAssetsFile(String fname, Resources r) {
String result = null;
try {
InputStream in = r.getAssets().open(fname);
int ch = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while ((ch = in.read()) != -1) {
baos.write(ch);
}
byte[] buff = baos.toByteArray();
baos.close();
in.close();
result = new String(buff, "UTF-8");
result.replaceAll("\\r\\n", "\n");
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
/**
* 检查每一步操作是否有错误方法
*
* @param op
*/
public static void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e("ES20_ERROR", op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
}
| [
"SH_LURENJIA@163.com"
] | SH_LURENJIA@163.com |
ab7c3423c3dbe502b5f7461656317c07cce6a647 | fc49733b483e25105ed1a30c99641e4d4b8de065 | /gomall-product/src/main/java/cn/jinterest/product/controller/SpuCommentController.java | 0c22b1eb954b46db8b0c92f006c54c78e7dc526e | [] | no_license | Jaredhi/GoMall | a1c8da9b0305992d94264828d05c430686f5d765 | 5f6ec50f799023c9390559681812b5d862a0c702 | refs/heads/master | 2023-04-16T08:50:33.796354 | 2021-04-30T05:22:52 | 2021-04-30T05:22:52 | 308,263,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,234 | java | package cn.jinterest.product.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.jinterest.product.entity.SpuCommentEntity;
import cn.jinterest.product.service.SpuCommentService;
import cn.jinterest.common.utils.PageUtils;
import cn.jinterest.common.utils.R;
/**
* 商品评价
*
* @author JInterest
* @email hwj2586@163.com
* @date 2020-10-29 21:09:50
*/
@RestController
@RequestMapping("product/spucomment")
public class SpuCommentController {
@Autowired
private SpuCommentService spuCommentService;
/**
* 列表
*/
@RequestMapping("/list")
//@RequiresPermissions("product:spucomment:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = spuCommentService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
//@RequiresPermissions("product:spucomment:info")
public R info(@PathVariable("id") Long id){
SpuCommentEntity spuComment = spuCommentService.getById(id);
return R.ok().put("spuComment", spuComment);
}
/**
* 保存
*/
@RequestMapping("/save")
//@RequiresPermissions("product:spucomment:save")
public R save(@RequestBody SpuCommentEntity spuComment){
spuCommentService.save(spuComment);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
//@RequiresPermissions("product:spucomment:update")
public R update(@RequestBody SpuCommentEntity spuComment){
spuCommentService.updateById(spuComment);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
//@RequiresPermissions("product:spucomment:delete")
public R delete(@RequestBody Long[] ids){
spuCommentService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
| [
"hwj2586@163.com"
] | hwj2586@163.com |
0e09bcba9f5bf159df5889bbe43c65cb6d4aab37 | e33e76e2ac73c7646a2757cdb51874ee1cd586d6 | /app/src/main/java/qfpay/wxshop/listener/MaijiaxiuUploadListener.java | 36cb60fa718c19b9affb03b8611a9a2a75f279bc | [] | no_license | dengjiaping/mmwd | 9f55239125a25ade7482c4b71dfeb23985becd9c | e10020be640572e51f5a18a2ba21c32d3bc87f56 | refs/heads/master | 2021-07-14T17:06:55.528125 | 2017-10-18T11:10:25 | 2017-10-18T11:10:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | package qfpay.wxshop.listener;
import java.io.Serializable;
import qfpay.wxshop.data.beans.BuyerResponseWrapper.BuyerShowBean;
public interface MaijiaxiuUploadListener extends Serializable{
// 上传进度
void onUpload(int progress);
// 上传成功
void onSuccess(boolean add, int index, BuyerShowBean bean);
// 上传失败
void onUploadFaild();
// 上传初始化progress
void onInitProgress(int count, BuyerShowBean bean, boolean isWb, boolean isTwb, boolean isQzone, boolean isEdit);
}
| [
"wcgebxtim@hotmail.com"
] | wcgebxtim@hotmail.com |
053ce7cc476953aa45fcb55cd1fc92f10a0ee76a | 6b3bfb61415ee7f521623f7b54bcd00b98c68d8c | /src/main/java/info/zznet/znms/base/rrd/exception/RrdExistsException.java | a62e3bad30080800fff041a91fb35eb892707694 | [] | no_license | 15000854736/znms | b1ddef89b26f9e90cf3052d6d52200e82ad50773 | 75e098cdd63291d0dd32ee76d0ecb8283abd0594 | refs/heads/master | 2021-08-22T22:50:10.884942 | 2017-12-01T14:07:04 | 2017-12-01T14:07:04 | 103,738,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package info.zznet.znms.base.rrd.exception;
public class RrdExistsException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1378485549104047673L;
public RrdExistsException(){
super();
}
public RrdExistsException(String msg){
super(msg);
}
} | [
"15000854736@163.com"
] | 15000854736@163.com |
d66dfc3de9a833b52dd25ffcaf1f22e7c1c0e4b8 | da049f1efd756eaac6f40a4f6a9c4bdca7e16a06 | /KoobeeCenter/KoobeeCenter_music_logo_new_name8.0/src/com/koobee/koobeecenter/utils/CTelephoneInfo.java | 672c65bec57c3f1d1d7617eea601ba06f53804f3 | [] | no_license | evilhawk00/AppGroup | c22e693320039f4dc7b384976a513f94be5bccbe | a22714c1e6b9f5c157bebb2c5dbc96b854ba949a | refs/heads/master | 2022-01-11T18:04:27.481162 | 2018-04-19T03:02:26 | 2018-04-19T03:02:26 | 420,370,518 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,494 | java | package com.koobee.koobeecenter.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.content.Context;
import android.telephony.PhoneNumberUtils;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
public class CTelephoneInfo {
private static final String TAG = CTelephoneInfo.class.getSimpleName();
private String imeiSIM1;// IMEI
private String imeiSIM2;// IMEI
private String iNumeric1;// sim1 code number
private String iNumeric2;// sim2 code number
private boolean isSIM1Ready;// sim1
private boolean isSIM2Ready;// sim2
private String iDataConnected1 = "0";// sim1 0 no, 1 connecting, 2
// connected, 3 suspended.
private String iDataConnected2 = "0";// sim2
private static CTelephoneInfo CTelephoneInfo;
private static Context mContext;
private static SubscriptionManager mSubscriptionManager;
private CTelephoneInfo() {
}
public synchronized static CTelephoneInfo getInstance(Context context) {
if (CTelephoneInfo == null) {
CTelephoneInfo = new CTelephoneInfo();
}
mContext = context;
// mSubscriptionManager = SubscriptionManager.from(mContext);
return CTelephoneInfo;
}
public String getImeiSIM1() {
return imeiSIM1;
}
public String getImeiSIM2() {
return imeiSIM2;
}
public boolean isSIM1Ready() {
return isSIM1Ready;
}
public boolean isSIM2Ready() {
return isSIM2Ready;
}
public boolean isDualSim() {
return imeiSIM2 != null;
}
// public boolean isDataConnected1() {
// if (TextUtils.equals(iDataConnected1, "2")
// || TextUtils.equals(iDataConnected1, "1"))
// return true;
// else
// return false;
// }
//
// public boolean isDataConnected2() {
// if (TextUtils.equals(iDataConnected2, "2")
// || TextUtils.equals(iDataConnected2, "1"))
// return true;
// else
// return false;
// }
public String getINumeric1() {
return iNumeric1;
}
public String getINumeric2() {
return iNumeric2;
}
public String getINumeric() {
if (imeiSIM2 != null) {
if (iNumeric1 != null && iNumeric1.length() > 1)
return iNumeric1;
if (iNumeric2 != null && iNumeric2.length() > 1)
return iNumeric2;
}
return iNumeric1;
}
public void setCTelephoneInfo() {
TelephonyManager telephonyManager = ((TelephonyManager) mContext
.getSystemService(Context.TELEPHONY_SERVICE));
CTelephoneInfo.imeiSIM1 = telephonyManager.getDeviceId();
;
CTelephoneInfo.imeiSIM2 = null;
try {
CTelephoneInfo.imeiSIM1 = getOperatorBySlot(mContext,
"getDeviceIdGemini", 0);
CTelephoneInfo.imeiSIM2 = getOperatorBySlot(mContext,
"getDeviceIdGemini", 1);
// CTelephoneInfo.iNumeric1 = getOperatorBySlot(mContext,
// "getSimOperatorGemini", 0);
// CTelephoneInfo.iNumeric2 = getOperatorBySlot(mContext,
// "getSimOperatorGemini", 1);
// CTelephoneInfo.iDataConnected1 = getOperatorBySlot(mContext,
// "getDataStateGemini", 0);
// CTelephoneInfo.iDataConnected2 = getOperatorBySlot(mContext,
// "getDataStateGemini", 1);
} catch (GeminiMethodNotFoundException e) {
e.printStackTrace();
try {
CTelephoneInfo.imeiSIM1 = getOperatorBySlot(mContext,
"getDeviceId", 0);
CTelephoneInfo.imeiSIM2 = getOperatorBySlot(mContext,
"getDeviceId", 1);
// CTelephoneInfo.iNumeric1 = getOperatorBySlot(mContext,
// "getSimOperator", 0);
// CTelephoneInfo.iNumeric2 = getOperatorBySlot(mContext,
// "getSimOperator", 1);
// CTelephoneInfo.iDataConnected1 = getOperatorBySlot(mContext,
// "getDataState", 0);
// CTelephoneInfo.iDataConnected2 = getOperatorBySlot(mContext,
// "getDataState", 1);
} catch (GeminiMethodNotFoundException e1) {
// Call here for next manufacturer's predicted method name if
// you wish
e1.printStackTrace();
}
}
// CTelephoneInfo.isSIM1Ready = telephonyManager.getSimState() ==
// TelephonyManager.SIM_STATE_READY;
// CTelephoneInfo.isSIM2Ready = false;
//
// try {
// CTelephoneInfo.isSIM1Ready = getSIMStateBySlot(mContext,
// "getSimStateGemini", 0);
// CTelephoneInfo.isSIM2Ready = getSIMStateBySlot(mContext,
// "getSimStateGemini", 1);
// } catch (GeminiMethodNotFoundException e) {
// e.printStackTrace();
// try {
// CTelephoneInfo.isSIM1Ready = getSIMStateBySlot(mContext,
// "getSimState", 0);
// CTelephoneInfo.isSIM2Ready = getSIMStateBySlot(mContext,
// "getSimState", 1);
// } catch (GeminiMethodNotFoundException e1) {
// // Call here for next manufacturer's predicted method name if
// // you wish
// e1.printStackTrace();
// }
// }
// mSlotId = extras.getInt(SimSettings.EXTRA_SLOT_ID, -1);
}
private static String getOperatorBySlot(Context context,
String predictedMethodName, int slotID)
throws GeminiMethodNotFoundException {
String inumeric = null;
TelephonyManager telephony = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class<?> telephonyClass = Class.forName(telephony.getClass()
.getName());
Class<?>[] parameter = new Class[1];
parameter[0] = int.class;
Method getSimID = telephonyClass.getMethod(predictedMethodName,
parameter);
Object[] obParameter = new Object[1];
obParameter[0] = slotID;
Object ob_phone = getSimID.invoke(telephony, obParameter);
if (ob_phone != null) {
inumeric = ob_phone.toString();
}
} catch (Exception e) {
e.printStackTrace();
throw new GeminiMethodNotFoundException(predictedMethodName);
}
return inumeric;
}
private static SubscriptionInfo mSubInfoRecord;
public static String getPhonenumber(Context context){
/* // TelephonyManager manager = (TelephonyManager)context. getSystemService(Context.TELEPHONY_SERVICE);
Class clazz = manager.getClass();
try {
Method getPhoneNumber=clazz.getDeclaredMethod("getLine1NumberForSubscriber",int.class);
Object yy= getPhoneNumber.invoke(manager, 1);
// te=te+ yy.toString();
te=te+ (String) getPhoneNumber.invoke(manager, 0);
te=te+(String) getPhoneNumber.invoke(manager, 1);
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
TelephonyManager telephony = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String te1 = telephony.getLine1Number();//
return te;
*/
String number="";
mSubscriptionManager = SubscriptionManager.from(mContext);
mSubInfoRecord = mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(0);
if(mSubInfoRecord==null){
mSubInfoRecord = mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(1);
if(mSubInfoRecord==null){
return number;
}else{
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
Context.TELEPHONY_SERVICE);
// TextView numberView = (TextView)mDialogLayout.findViewById(R.id.number);
String rawNumber = tm.getLine1NumberForSubscriber(
mSubInfoRecord.getSubscriptionId());
if (TextUtils.isEmpty(rawNumber)) {
// numberView.setText(res.getString(com.android.internal.R.string.unknownName));
} else {
number= PhoneNumberUtils.formatNumber(rawNumber);
// number="+86 13027911580";
number=number.substring(number.length()-11,number.length());
// numberView.setText(PhoneNumberUtils.formatNumber(rawNumber));
}
}
}else{
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
Context.TELEPHONY_SERVICE);
// TextView numberView = (TextView)mDialogLayout.findViewById(R.id.number);
String rawNumber = tm.getLine1NumberForSubscriber(
mSubInfoRecord.getSubscriptionId());
if (TextUtils.isEmpty(rawNumber)) {
// numberView.setText(res.getString(com.android.internal.R.string.unknownName));
} else {
number= PhoneNumberUtils.formatNumber(rawNumber);
// a=a.Substring(a.Length-2,2);
number="+86 13027911580";
number=number.substring(number.length()-11,number.length());
// numberView.setText(PhoneNumberUtils.formatNumber(rawNumber));
}
}
return number;
}
private static boolean getSIMStateBySlot(Context context,
String predictedMethodName, int slotID)
throws GeminiMethodNotFoundException {
boolean isReady = false;
TelephonyManager telephony = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String te1 = telephony.getLine1Number();//
String te2=telephony.getLine1NumberForSubscriber(0);
try {
Class<?> telephonyClass = Class.forName(telephony.getClass()
.getName());
Class<?>[] parameter = new Class[1];
parameter[0] = int.class;
Method getSimStateGemini = telephonyClass.getMethod(
predictedMethodName, parameter);
Object[] obParameter = new Object[1];
obParameter[0] = slotID;
Object ob_phone = getSimStateGemini.invoke(telephony, obParameter);
if (ob_phone != null) {
int simState = Integer.parseInt(ob_phone.toString());
if (simState == TelephonyManager.SIM_STATE_READY) {
isReady = true;
}
}
} catch (Exception e) {
e.printStackTrace();
throw new GeminiMethodNotFoundException(predictedMethodName);
}
return isReady;
}
private static class GeminiMethodNotFoundException extends Exception {
/**
*
*/
private static final long serialVersionUID = -3241033488141442594L;
public GeminiMethodNotFoundException(String info) {
super(info);
}
}
/**
*
* getSerialNumber
*
* @return result is same to Build.SERIAL
*/
public static String getSerialNumber() {
String serial = null;
try {
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
serial = (String) get.invoke(c, "ro.serialno");
} catch (Exception e) {
e.printStackTrace();
}
return serial;
}
}
| [
"649830103@qq.com"
] | 649830103@qq.com |
db23bd677e6858b0b80fef88c2c498de8cf54185 | c509aaa82416276aa100ff1c1f45b871fc7144cc | /command/src/main/java/v2/Main.java | 57cf445798ae3c935156c4ceeba81a85a007ca9f | [] | no_license | risiblefish/gof23 | e42b1bff3baac4ef049c9b57f725d7ebe014a80f | e654285f9cfe7594695ee6eb45c5c1d1305ff279 | refs/heads/master | 2023-01-12T00:41:05.134917 | 2020-11-12T08:16:33 | 2020-11-12T08:16:33 | 308,046,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,915 | java | package v2;
import java.util.ArrayList;
import java.util.List;
/**
* v1 问题: 如何实现一连串的undo?
*
* v2 : 使用cor
*
* 下面的实现是一次性做完所有do和undo, 】
* 如果要更灵活, 可以将所有command放到一个链表里,
* 每次执行新的command,实际的操作是(先将command加到链表里,再执行command的doit)
* 每次执行undo,实际操作是(从链表中取出最后一个command,执行该command的undo),然后将这个command移出链表
*
* @author Sean Yu
* @date 2020/11/2 11:38
*/
public class Main {
public static void main(String[] args) {
Content c = new Content();
Chain chain = new Chain().add(new InsertCommand(c)).add(new CopyCommand(c)).add(new DeleteCommand(c));
chain.doit(chain);
chain.undo(chain);
}
}
abstract class Command {
Content c;
public abstract void doit(Chain chain);
public abstract void undo(Chain chain);
}
class Content {
String msg = "hello from sean";
}
class InsertCommand extends Command {
String strToInsert = "InsertStr";
public InsertCommand(Content c) {
this.c = c;
}
@Override
public void doit(Chain chain) {
c.msg = c.msg + strToInsert;
System.out.println(c.msg);
chain.doit(chain);
}
@Override
public void undo(Chain chain) {
c.msg = c.msg.substring(0, c.msg.length() - strToInsert.length());
System.out.println(c.msg);
chain.undo(chain);
}
}
class DeleteCommand extends Command {
String deleted;
public DeleteCommand(Content c) {
this.c = c;
}
@Override
public void doit(Chain chain) {
deleted = c.msg.substring(0, 5);
c.msg = c.msg.substring(5, c.msg.length());
System.out.println(c.msg);
chain.doit(chain);
}
@Override
public void undo(Chain chain) {
c.msg = deleted + c.msg;
System.out.println(c.msg);
chain.undo(chain);
}
}
class CopyCommand extends Command {
public CopyCommand(Content c) {
this.c = c;
}
@Override
public void doit(Chain chain) {
c.msg = c.msg + c.msg;
System.out.println(c.msg);
chain.doit(chain);
}
@Override
public void undo(Chain chain) {
c.msg = c.msg.substring(0, c.msg.length() / 2);
System.out.println(c.msg);
chain.undo(chain);
}
}
class Chain {
List<Command> commands = new ArrayList<>();
int index = 0;
public Chain add(Command c) {
commands.add(c);
return this;
}
public void doit(Chain chain) {
if (index == commands.size()) {
return;
}
commands.get(index++).doit(chain);
}
public void undo(Chain chain) {
if (index == 0) {
return;
}
commands.get(--index).undo(chain);
}
} | [
"526556235@qq.com"
] | 526556235@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.