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
1337a542140304cc69136e5b77ac8af1da685758
a8310e0430c4a2696ff2c8d8492d8d67cbe2f296
/HaRo_GmbH/src/Erzeugnisse.java
008088576ac60c9761dec6cc29d5809dc177c5a4
[]
no_license
imsch/Java_Schule
b44963fad68ff5cc4ba026cea0e19bf130637547
604e41066c2c6be30058f107727b667f45a4d05f
refs/heads/master
2020-04-25T20:55:58.283550
2015-03-03T15:10:32
2015-03-03T15:10:32
31,364,703
0
1
null
null
null
null
UTF-8
Java
false
false
664
java
public class Erzeugnisse extends HauptArtikel { private double herstellungskosten; public Erzeugnisse(double artikelNummer, String bezeichnung, double bestand, double herstellungskosten, double verkaufspreis,boolean vermindert) { super(artikelNummer, bezeichnung, bestand, verkaufspreis,vermindert); this.herstellungskosten = herstellungskosten; } public double getHerstellungsKosten() { return herstellungskosten; } public void setHerstellungsKosten(double herstellungskosten) { this.herstellungskosten = herstellungskosten; } public void print() { super.print(); System.out.println("Herstellungskosten: " + herstellungskosten); } }
[ "jannis.schmitt92@gmail.com" ]
jannis.schmitt92@gmail.com
dec41dd0dc7ab6adfe3323070d45624a894586db
a460f72864631d9470ca49fc44cc30371947e439
/src/main/java/pl/coderslab/Airport.java
d70baf40abd9a83987f5fe3cdcab8b847111ccd7
[ "MIT" ]
permissive
MarekSpojda/Homework_04
8f98c919015186296a3511c186c84f09b5c9e78b
bf74e615275a2985bec418ae20b3150c7a003f90
refs/heads/master
2020-05-04T07:25:25.538219
2019-04-05T13:41:16
2019-04-05T13:41:16
179,027,295
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package pl.coderslab; public class Airport { private String name; private String code; private String timezone; public Airport(String name, String code, String timezone) { this.name = name; this.code = code; this.timezone = timezone; } public String getName() { return name; } public String getCode() { return code; } public String getTimezone() { return timezone; } }
[ "marek.spojda@o2.pl" ]
marek.spojda@o2.pl
ae1bbc37ce1905dca060abe95cfd68b66c7e1377
109463c071c24331207253cbc88e5124b03cbced
/pet-clinic-data/src/main/java/guru/springframework/sfgpetclinic/model/Visit.java
e43a9c97c896e1e30c899ea99cc25ac2f0b1ec64
[]
no_license
brasovanconstantin/sfg-pet-clinic
7ba543ca0f878bc64d61e56364c3133dd3d5598a
dddb41bf9352720d95b26bd89661f79b5fa00c9d
refs/heads/master
2020-03-30T10:45:17.370830
2018-12-07T14:19:38
2018-12-07T14:19:38
151,134,521
0
0
null
2018-11-27T14:31:09
2018-10-01T18:05:42
Java
UTF-8
Java
false
false
716
java
package guru.springframework.sfgpetclinic.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.time.LocalDate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @Setter @Getter @NoArgsConstructor @AllArgsConstructor @Builder @Entity @Table(name = "visits") public class Visit extends BaseEntity { @Column(name = "date") private LocalDate date; @Column(name = "description") private String description; @ManyToOne @JoinColumn(name = "pet_id") private Pet pet; }
[ "constantin.brasovan@endava.com" ]
constantin.brasovan@endava.com
1976b711bdaa2796de746aa145018c889a0e2527
fab899e48def2dea7dd9b6eea56ae3480f47e16b
/src/main/java/de/debitorlp/server/survivalgames/listener/FoodLevelChangeListener.java
90710a156285c8896988bcf283e43d4f50c63317
[]
no_license
BukkitFabo/survivalgames
7ad828a2e67bac852b0eeef57610a7ed384ae735
3fcefca9ad2f42b4829ab805c2fc011039eb3806
refs/heads/master
2021-01-02T23:02:20.331362
2017-04-23T13:10:10
2017-04-23T13:10:10
99,448,524
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package de.debitorlp.server.survivalgames.listener; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.FoodLevelChangeEvent; import de.debitorlp.server.survivalgames.Main; import de.debitorlp.server.survivalgames.enm.GameStatus; public class FoodLevelChangeListener implements Listener { @EventHandler public void onFoodLevelChange(FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); if (Main.getSurvivalGames().getGameStatus() == GameStatus.INGAME || Main.getSurvivalGames().getGameStatus() == GameStatus.DEATHMATCH) { if (!Main.getSurvivalGames().isAlive(player)) { event.setCancelled(true); } } else { event.setCancelled(true); } } } }
[ "Markusdick98@googlemail.com" ]
Markusdick98@googlemail.com
f64c7e244e5084c5bcea048d9089c2e39396370d
7b6cca9f0908fe899f12bc4386db5952b5af4ade
/app/src/main/java/com/whr/user/governmentscheme/GovernmentSchemeActivity.java
6efda44b86cf415d9ba60e704c6ca51a6850b368
[]
no_license
chandrakant96/chandrakant
451a11f9d025930635df542b35321111420188de
6727d7c1df871e3a3330db53754aa6640f2abf3e
refs/heads/master
2020-08-07T05:59:58.066802
2019-10-07T08:52:30
2019-10-07T08:52:30
213,324,532
0
0
null
null
null
null
UTF-8
Java
false
false
5,282
java
package com.whr.user.governmentscheme; import android.content.Context; import android.content.Intent; import android.support.design.widget.CoordinatorLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.balysv.materialripple.MaterialRippleLayout; import com.google.gson.Gson; import com.whr.user.R; import com.whr.user.activities.LocationFindActivity; import com.whr.user.activities.NevigationDrawerDashBordActivity; import com.whr.user.activities.NoInternetConnectionActivity; import com.whr.user.com.WHR.Utils.ConnectionDector; import com.whr.user.com.WHR.Utils.CustomJSONObjectRequest; import com.whr.user.com.WHR.Utils.CustomStringRequest; import com.whr.user.com.WHR.Utils.CustomVolleyRequestQueue; import com.whr.user.com.WHR.Utils.PreferenceUtils; import com.whr.user.com.WHR.Utils.VolleyErrorHelper; import com.whr.user.first_aid.activities.FirstAidActivity; import com.whr.user.first_aid.adapters.FirstAidAdapter; import com.whr.user.first_aid.model.FirstAidPojo; import com.whr.user.governmentscheme.adapter.GovermentSchemeAdapter; import com.whr.user.governmentscheme.models.GovernmentSchemePojo; import com.whr.user.pojo.GlobalVar; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; public class GovernmentSchemeActivity extends AppCompatActivity { private MaterialRippleLayout imgBack; private TextView title; private Context context; String TAG = getClass().getSimpleName(); private List<GovernmentSchemePojo> list; private ConnectionDector dector; private GovermentSchemeAdapter adapter; private RequestQueue mQueue; private RecyclerView recyclerView; private LinearLayoutManager lLayout; private CoordinatorLayout coordinatorLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_government_scheme); context = GovernmentSchemeActivity.this; list = new ArrayList<>(); mQueue = CustomVolleyRequestQueue.getInstance(context).getRequestQueue(); dector = new ConnectionDector(context); recyclerView = findViewById(R.id.recyclerviewScheme); adapter = new GovermentSchemeAdapter(context, list); lLayout = new LinearLayoutManager(context); recyclerView.setLayoutManager(lLayout); recyclerView.setAdapter(adapter); init(); } public void init() { imgBack = findViewById(R.id.imgBack); title = findViewById(R.id.title); coordinatorLayout = findViewById(R.id.coordinatorLayout); title.setText("Government Scheme"); imgBack.setOnClickListener(v -> { onBackPressed(); }); if (dector.isConnectingToInternet()) { getData(); } else { startActivityForResult(new Intent(context, NoInternetConnectionActivity.class), GlobalVar.NO_INTERNET_REQUEST_CODE); } } private void getData() { String url = GlobalVar.ServerAddress + "user/GetGovernmentScheme"; GlobalVar.showProgressDialog(this, "Loading.....", true); JSONObject obj = new JSONObject(); GlobalVar.errorLog(TAG, "obj", obj.toString()); GlobalVar.errorLog(TAG, "url", url); final CustomJSONObjectRequest jsonRequest = new CustomJSONObjectRequest(Request.Method.GET, url, obj, response -> { GlobalVar.errorLog(TAG, "GetList", response.toString()); GlobalVar.hideProgressDialog(); Gson gson = new Gson(); list.clear(); JSONArray jsonArray1 = null; try { jsonArray1 = response.getJSONArray("GovernmentScheme"); if (jsonArray1 != null && jsonArray1.length() > 0) { for (int i = 0; i < jsonArray1.length(); i++) { JSONObject json = jsonArray1.getJSONObject(i); GovernmentSchemePojo pojo = gson.fromJson(json.toString(), GovernmentSchemePojo.class); list.add(pojo); } adapter.notifyDataSetChanged(); } else { showSnackBar(getString(R.string.NoDataAvailable)); } } catch (JSONException e) { e.printStackTrace(); } }, error -> { GlobalVar.hideProgressDialog(); showSnackBar(VolleyErrorHelper.getMessage(error, context)); }); jsonRequest.setTag("get"); mQueue.add(jsonRequest); } private void showSnackBar(String message) { GlobalVar.showSnackBar(coordinatorLayout, message, context, R.color.red); } }
[ "chandu.whr@gmail.com" ]
chandu.whr@gmail.com
d5f691512eff312127ba66b9637da69a95ce6459
950aafa50a115a7351e4dd35474df4291a1fd535
/cloud-consumerconsul-order80/src/main/java/org/example/OrderConsulMain80.java
b592ecaf86ec6934437e87e8f3b2cd2a55317225
[]
no_license
wangyouzhan/spring-cloud-shangguigu
e017ef089869428342ae3259550d784d428b5afe
32612993254695a527ccf2ee7b8e2062058072d8
refs/heads/main
2023-06-15T05:57:22.164406
2021-07-13T03:22:16
2021-07-13T03:22:16
379,101,512
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
package org.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @SpringBootApplication @EnableDiscoveryClient public class OrderConsulMain80 { public static void main(String[] args) { SpringApplication.run(OrderConsulMain80.class, args); } }
[ "936804097@qq.com" ]
936804097@qq.com
e9eaa9870280d9bfa4e3f53c1d5987647300bcfb
c018dd8ec0668a9becdd8b1222e8f8d81849e56e
/fortune/src/main/java/com/jhobor/fortune/interfaces/IService.java
1f94a83c9b43ae515362766f7cc575eae6eedd12
[]
no_license
z376368673/Android1
69db13eecf1f80688d28bb7f02fe85886d35d373
a9ed78a3cde5cad020414b5a569cf4d65ceadb3e
refs/heads/master
2020-03-07T08:52:46.504504
2018-07-04T08:58:40
2018-07-04T08:58:40
127,391,336
1
0
null
null
null
null
UTF-8
Java
false
false
18,038
java
package com.jhobor.fortune.interfaces; import java.math.BigDecimal; import java.util.List; import okhttp3.MultipartBody; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.Multipart; import retrofit2.http.POST; import retrofit2.http.Part; import retrofit2.http.Query; /** * Created by Administrator on 2017/4/5. */ public interface IService { /** * 注册 * * @param mobile * @param loginPwd * @param name * @param phone * @return */ @FormUrlEncoded @POST("userInfo/register") Call<ResponseBody> register(@Field("name") String name,@Field("mobile") String mobile, @Field("loginPwd") String loginPwd, @Field("phone") String phone); /** * 登录 * * @param mobile * @param loginPwd * @return */ @POST("userInfo/login") Call<ResponseBody> login(@Query("mobile") String mobile, @Query("loginPwd") String loginPwd); /** * 查询首页我的盈亏额,理财条目数据 * * @param token * @return */ @POST("order/myFortune.do") Call<ResponseBody> myFortune(@Query("uuid") String token); /** * 查询理财条目详情 * * @param token * @param orderId * @return */ @POST("collection/collectionDetail.do") Call<ResponseBody> fortuneDetails(@Query("uuid") String token, @Query("orderId") int orderId); /** * 添加理财 * * @param token * @param money * @return */ @POST("order/add.do") Call<ResponseBody> manageProperty(@Query("uuid") String token, @Query("money") int money); /** * 我的团队 * * @param token * @return http://tz.1yuanpf.com/rentalcarUsb/groupInfo/myGroupInfo */ @POST("groupInfo/myGroupInfo.do") Call<ResponseBody> myLower(@Query("uuid") String token); /** * 我的团队 * 查询下级团队 * @param token * @return http://tz.1yuanpf.com/rentalcarUsb/groupInfo/myGroupInfo */ @POST("groupInfo/queryLowerLevel.do") Call<ResponseBody> queryLowerLevel(@Query("uuid") String token,@Query("mobile") String mobile); /** * 钱包金额及下线金额 * * @param token * @return */ @POST("userInfo/myInvest.do") Call<ResponseBody> myInvest(@Query("uuid") String token); /** * 钱包明细,收益明细 * * @param token * @param pageIndex * @return */ @POST("record/myRecord.do") Call<ResponseBody> walletsDetails(@Query("uuid") String token, @Query("pageIndex") int pageIndex); /** * 个人页面信息 * * @param token * @return */ @POST("userInfo/mine.do") Call<ResponseBody> mine(@Query("uuid") String token); /** * 收款方式信息 * * @param token * @return */ @POST("optionMode/myOptionMode.do") Call<ResponseBody> receiptWay(@Query("uuid") String token); /** * 添加银联卡信息 * * @param token * @param bankName * @param name * @param account * @return */ @FormUrlEncoded @POST("optionMode/add.do") Call<ResponseBody> addAccountInfo(@Field("uuid") String token, @Field("bankName") String bankName, @Field("name") String name, @Field("account") String account, @Field("type") String type); /** * 删除银行卡 * @param token * @return */ @POST("bankCard/delete") Call<ResponseBody> delBank(@Query("uuid") String token, @Query("bankCardId") int bankCardId ); /** * 我的账户 银行卡列表 * @param token * @return */ @POST("bankCard/list") Call<ResponseBody> myBankList(@Query("uuid") String token); /** * 添加银行卡 * * @param token * @param name * @param bankName 银行类型 名称 * @param bankNo 卡号 * @return */ @FormUrlEncoded @POST("bankCard/add") Call<ResponseBody> addBank(@Field("uuid") String token, @Field("name") String name, @Field("identityCard") String identityCard, @Field("bankName") String bankName, @Field("bankNo") String bankNo, @Field("subbranch") String subbranch ); @FormUrlEncoded @POST("optionMode/edit.do") Call<ResponseBody> changedAccountInfo(@Field("id") String id, @Field("uuid") String token, @Field("bankName") String bankName, @Field("name") String name, @Field("account") String account, @Field("type") String type); /** * 交易记录 * * @param token * @return */ @POST("order/fortuneRecord.do") Call<ResponseBody> tradeRecord(@Query("uuid") String token); /** * 提现记录 * * @param token * @param pageIndex * @return */ @POST("withdraw/myWithdraw.do") Call<ResponseBody> withdrawRecord(@Query("uuid") String token, @Query("pageIndex") int pageIndex); /** * 可用金额,提现前查询 * * @param token * @return */ @POST("withdraw/withdrawWay.do") Call<ResponseBody> myBalance(@Query("uuid") String token); /** * 提交提现申请 * * @param token * @param money * @param optionModeId * @return */ @POST("withdraw/add.do") Call<ResponseBody> withdraw(@Query("uuid") String token, @Query("money") int money, @Query("optionModeId") int optionModeId); /** * 修改密码 * * @param token * @param loginPwd * @param oldPwd * @return */ @POST("userInfo/update.do") Call<ResponseBody> updatePass(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("oldPwd") String oldPwd); /** * 重置密码 * * @param mobile * @param loginPwd * @return */ @POST("userInfo/forgetPwd") Call<ResponseBody> resetPass(@Query("mobile") String mobile, @Query("loginPwd") String loginPwd); /** * 手机号码存在于数据库的验证码获取 * * @param mobile * @return */ @POST("userInfo/otherVerify") Call<ResponseBody> otherVerify(@Query("mobile") String mobile); /** * 手机号码不存在于数据库的验证码获取接口 * * @param mobile * @return */ @POST("userInfo/registerVerify") Call<ResponseBody> registerVerify(@Query("mobile") String mobile); /** * 交易查看页面,从首页进 * * @param token * @return */ @POST("help/myHelp.do") Call<ResponseBody> tradeDetails(@Query("uuid") String token); /** * 提供帮助 或 获得帮助 * * @param token * @param money * @param tag * @return */ @POST("help/add.do") Call<ResponseBody> help(@Query("uuid") String token, @Query("money") int money, @Query("tag") int tag, @Query("omId") int omId); /** * 从奖金钱包提现 * * @param token * @param money * @param omId * @return */ @POST("help/addMarker.do") Call<ResponseBody> withdrawFromPrize(@Query("uuid") String token, @Query("money") int money, @Query("omId") int omId); /** * 静态钱包、冻结钱包明细 * * @param token * @param tag * @return */ @POST("help/helpList.do") Call<ResponseBody> balanceRecord(@Query("uuid") String token, @Query("tag") int tag); /** * 冻结钱包-利息记录 * * @param token * @param pageIndex * @return */ @POST("interestInfo/myInterestInfo.do") Call<ResponseBody> myInterestInfo(@Query("uuid") String token, @Query("pageIndex") int pageIndex); /** * 排单详情 * * @param token * @param helpId * @param tag * @return */ @POST("help/detail.do") Call<ResponseBody> boodingDetails(@Query("uuid") String token, @Query("helpId") int helpId, @Query("tag") int tag); /** * 上传凭证 * * @param partList * @return */ @Multipart @POST("help/editHelp.do") Call<ResponseBody> uploadCertificate(@Part List<MultipartBody.Part> partList); /** * 确认得到帮助 * * @param token * @param helpId * @return */ @POST("help/update.do") Call<ResponseBody> confirmGetHelp(@Query("uuid") String token, @Query("helpId") int helpId); @POST("help/myHelpRecord.do") Call<ResponseBody> tradeRecordHelp(@Query("uuid") String token, @Query("tag") int tag); /** * 获取排单币 * * @param token * @return */ @POST("userInfo/myCoin.do") Call<ResponseBody> myCoin(@Query("uuid") String token); /** * 转让排单币 * * @param token * @param count * @param mobile * @return */ @POST("userInfo/editCoin.do") //@POST("bonusRecord/transfer.do") Call<ResponseBody> transferCoin(@Query("uuid") String token, @Query("count") int count, @Query("mobile") String mobile); /** * 获取可用的提现方式 * * @param token * @return */ @POST("userInfo/myOm.do") Call<ResponseBody> myOm(@Query("uuid") String token); /** * 激活用户账号 * * @param uuid * @return */ @POST("userInfo/activation.do") Call<ResponseBody> account(@Query("uuid") String uuid); /** * 激活用户账号 * * @param uuid * @return */ @POST("bonusRecord/list.do") Call<ResponseBody> dynmic(@Query("uuid") String uuid); /** * 转让激活码 * * @param token * @param count * @param mobile * @return */ //@POST("bonusRecord/transfer.do") @POST("userInfo/transfer.do") Call<ResponseBody> transferActiveCode(@Query("uuid") String token, @Query("count") int count, @Query("mobile") String mobile); //@POST("bonusRecord/transfer.do") @POST("help/addMarker.do") Call<ResponseBody> getOmList(@Query("uuid") String token, @Query("money") int money, @Query("tag") String tag, @Query("omId") String omId); /** * @param uuid * @return */ @POST("userInfo/userHome") Call<ResponseBody> getMain(@Query("uuid") String uuid); @POST("userInfo/myReport") Call<ResponseBody> getmyReport(@Query("uuid") String uuid); /** *获取积分记录 * @param uuid * @param tag * @return */ @POST("integralRecord/list") Call<ResponseBody> getIntegralList(@Query("uuid") String uuid,@Query("tag") int tag); /** *获取微积分记录 * @param uuid * @param tag * @return */ @POST("calculusRecord/list") Call<ResponseBody> getalculusRecordList(@Query("uuid") String uuid,@Query("tag") int tag); @POST("amountRecord/list") Call<ResponseBody> getRecordlList(@Query("uuid") String uuid,@Query("tag") int tag); @POST("userInfo/addCapital") Call<ResponseBody> addMoney(@Query("uuid") String uuid, @Query("money") double bigDecimal); /** * 积分提现接口 * @param token * @param loginPwd * @param bankCardId * @param money * @return */ @POST("withdraw/add") Call<ResponseBody> withdrawMoney(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("bankCardId") String bankCardId, @Query("money") BigDecimal money); /** * 电商积分提现接口 * @param token * @param loginPwd * @param bankCardId * @param money * @return */ @POST("calculusWithdraw/add") Call<ResponseBody> myWithdrawMoney(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("bankCardId") String bankCardId, @Query("calculus") BigDecimal money); /** * 服务积分提现接口 * @param token * @param loginPwd * @param bankCardId * @param money * @return */ @POST("billWithdraw/add") Call<ResponseBody> ReportWithdrawMoney(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("bankCardId") String bankCardId, @Query("billIntegral") BigDecimal money); /** * 积分转让接口 * @param token * @param loginPwd * @param mobile * @param omId * @return */ @POST("userInfo/integralTransfer") Call<ResponseBody> integralTransfer(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("mobile") String mobile, @Query("integral") BigDecimal omId); /** * 微积分转让接口 * @param token * @param loginPwd * @param mobile * @param omId * @return */ @POST("userInfo/calculusTransfer") Call<ResponseBody> calculusTransfer(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("mobile") String mobile, @Query("calculus") BigDecimal omId); /** * 服务分转让接口 * @param token * @param loginPwd * @param mobile * @param omId * @return */ @POST("userInfo/billIntegralTransfer") Call<ResponseBody> reportTransfer(@Query("uuid") String token, @Query("loginPwd") String loginPwd, @Query("mobile") String mobile, @Query("billIntegral") BigDecimal omId); /** * 意见反馈 * @param token * @return */ @POST("userInfo/myQrCode") Call<ResponseBody> share(@Query("uuid") String token, @Query("str") String str); /** * 关于我们 * @param uuid * @return */ @POST("aboutWe/list") Call<ResponseBody> aboutWe(@Query("uuid") String uuid); /*** * 意见反馈 * @param uuid * @param content * @return */ @POST("feedback/add") Call<ResponseBody> feedback(@Query("uuid") String uuid, @Query("content") String content); /*** * 分享产品界面的接口 * @param token * @return */ @POST("product/list") Call<ResponseBody> shareProduct(@Query("uuid") String token); /*** * 分享界面的接口 * @param token * @return */ @POST("userInfo/myQrCode") Call<ResponseBody> share(@Query("uuid") String token); @Multipart @POST("userInfo/updateImg") Call<ResponseBody> uploadheadImg(@Part List<MultipartBody.Part> partList); /** * 查询服务中心的状态 * * @param token * @return status:msg为1时返回,判断状态0.不是,1.是,2审核中 */ @POST("billCenter/isBillCenter") Call<ResponseBody> isBillCenter(@Query("uuid") String token); /** * 服务中心 获取下属数量和投资金额 * * @param token * @return http://tz.1yuanpf.com/rentalcarUsb/groupInfo/myGroupInfo */ @POST("billCenter/application") Call<ResponseBody> applyChecked(@Query("uuid") String token); /** * 申请加入服务中心 * * @param token * @return http://tz.1yuanpf.com/rentalcarUsb/groupInfo/myGroupInfo */ @POST("billCenter/add") Call<ResponseBody> applyAdd(@Query("uuid") String token); /** * 服务中心首页 * * @param token * @return */ @POST("billCenter/billCenterHome") Call<ResponseBody> billCenterHome(@Query("uuid") String token); /** * 服务中心首页之旗下服务中心 * * @param token * @return */ @POST("billCenter/childBillCenter") Call<ResponseBody> childBillCenter(@Query("uuid") String token); /** * 服务中心首页之非服务中心 * * @param token * @return */ @POST("billCenter/notBillCenter") Call<ResponseBody> notBillCenter(@Query("uuid") String token); /** * 服务中心-服务积分增长记录 * * @param token * @return */ @POST("billCenter/billIntegralRecord") Call<ResponseBody> billIntegralRecord(@Query("uuid") String token); /** * 团队投资明细-增资记录 * * @param token * @return */ @POST("billCenter/groupInvestRecord") Call<ResponseBody> groupInvestRecord(@Query("uuid") String token); /** * 团队投资明细-未投资记录 * * @param token * @return */ @POST("billCenter/noInvestRecord") Call<ResponseBody> noInvestRecord(@Query("uuid") String token); /** *获取服务积分记录 * @param uuid * @param tag * @return */ @POST("billIntegralRecord/list") Call<ResponseBody> billIntegralRecord(@Query("uuid") String uuid,@Query("tag") int tag); }
[ "376368673@qq.com" ]
376368673@qq.com
088b67405a2db1886bce8fef57992b170708056f
f8cf6b3416f05b19f256b3f34892d71dccf4d3ea
/src/main/java/sdut/jk1717/hospital/po/Examination.java
f1445552a1adfb86630228c7110f48cf18be45bc
[ "Apache-2.0" ]
permissive
chaoes/chaoes_hospatil
2f9a1d605f5fed9d6eeee5a97f8ed4ffd1a87a0e
962c32e61d9aaace71b1ed3636125e7defa89cac
refs/heads/master
2023-02-17T02:18:16.021532
2021-01-07T13:21:18
2021-01-07T13:21:18
318,815,964
2
1
null
null
null
null
UTF-8
Java
false
false
790
java
package sdut.jk1717.hospital.po; import lombok.Data; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.*; import java.io.Serializable; import java.util.Date; /** * @auther:chaoe * @date:2020/12/5 **/ @Entity @Table(name = "examination") @Getter @Setter @NoArgsConstructor public class Examination implements Serializable { @Id @GeneratedValue private Long id; private String content; private Float price; private boolean isfinished=false; @Temporal(TemporalType.DATE) private Date checkTime; @Temporal(TemporalType.DATE) private Date creatTime = new Date(System.currentTimeMillis()); @ManyToOne private Patient patient; }
[ "wangtongc21@gmail.com" ]
wangtongc21@gmail.com
067bf880fc2a04297d6b1f5b0f4df4893eaf69c0
4be09de4b667c84184ea1ce88237b6a87afb1b73
/src/main/java/com/troytech/oca11/part2/Q7.java
ba41d62a42828069322094d0dae6c30421615836
[]
no_license
jdanieldeveloper/oca-11-java-se-programmer-exercises
3ee506e0f434fb48f6d14734c837073ce6d8d494
140c939153248ec472d48fb15c4d9bd38679e03e
refs/heads/master
2021-06-25T04:36:49.810364
2020-11-13T11:28:07
2020-11-13T11:28:07
152,159,577
0
2
null
null
null
null
UTF-8
Java
false
false
237
java
package com.troytech.oca11.part2; /** * A.12 * B.01 * C.11 * D.22 * * Answer: A * */ public class Q7 { public static void main(String[] args) { int a = 0; a++; System.out.printIn(a++); System.out.printIn(a); } }
[ "dcarvajals.imagemaker@bancochile.cl" ]
dcarvajals.imagemaker@bancochile.cl
8a44415f094ffeb8a66cab4f0d1460cd08c30a32
03930e2dcabd076b101f5d9aebb00dc88b664623
/result/Validator/traditional_mutants/java.lang.String_toRoman(java.lang.String)/ROR_116/Validator.java
dee737740325f3cc4ed253bbda4d7ab60e2674f2
[]
no_license
pedromoraesh/MuClipse-Example
39b46ab65542af96f4e8bef3841fd5c8b3968431
90ce9e417ae252c61949f0c47b33640dc4f7c52e
refs/heads/master
2021-07-09T01:39:13.770410
2017-10-07T04:09:25
2017-10-07T04:09:25
106,070,464
1
0
null
null
null
null
UTF-8
Java
false
false
3,831
java
// This is mutant program. // Author : ysma public class Validator { public static int whatKindOfNumber( java.lang.String toConvert ) { int[] inteiros = new int[]{ 73, 86, 88, 76, 67, 68, 77 }; int letters = 0; int numbers = 0; java.lang.String validString = toConvert.toUpperCase(); for (int i = 0; i < validString.length(); i++) { if (validString.charAt( i ) >= 48 && validString.charAt( i ) <= 57) { numbers += 1; } } for (int i = 0; i < validString.length(); i++) { for (int j = 0; j < inteiros.length; j++) { if (validString.charAt( i ) == inteiros[j]) { letters += 1; } } } if (letters + numbers == validString.length()) { if (letters > 0 && numbers == 0) { return 1; } if (numbers > 0 && letters == 0) { return 2; } else { return 3; } } else { return 4; } } public static int arabicEquivalent( char roman ) { if (roman == 'I') { return 1; } if (roman == 'V') { return 5; } if (roman == 'X') { return 10; } if (roman == 'L') { return 50; } if (roman == 'C') { return 100; } if (roman == 'D') { return 500; } if (roman == 'M') { return 1000; } return 0; } public static boolean isValidNumber( int number ) { return number > 0 && number <= 1000; } public static int toArabic( java.lang.String roman ) { int arabicEquivalent = 0; int left; int right; boolean signalLastCharacter = true; java.lang.String romanUpperCase = roman.toUpperCase(); if (whatKindOfNumber( romanUpperCase ) == 1) { for (int i = romanUpperCase.length() - 1; i > 0; i--) { left = arabicEquivalent( romanUpperCase.charAt( i - 1 ) ); right = arabicEquivalent( romanUpperCase.charAt( i ) ); if (right > left) { arabicEquivalent += right - left; if (i == 1) { signalLastCharacter = false; } i--; } else { arabicEquivalent += right; } } if (signalLastCharacter == true) { arabicEquivalent += arabicEquivalent( romanUpperCase.charAt( 0 ) ); } } if (isValidNumber( arabicEquivalent )) { return arabicEquivalent; } else { return 0; } } public static java.lang.String toRoman( java.lang.String arabic ) { if (whatKindOfNumber( arabic ) == 2) { int num = Integer.parseInt( arabic ); if (isValidNumber( num )) { java.lang.StringBuilder sb = new java.lang.StringBuilder(); int vezes = 0; java.lang.String[] romanos = new java.lang.String[]{ "I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M" }; int[] inteiros = new int[]{ 1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000 }; for (int i = inteiros.length - 1; i != 0; i--) { vezes = num / inteiros[i]; num %= inteiros[i]; while (vezes > 0) { sb.append( romanos[i] ); vezes--; } } return sb.toString(); } } return ""; } }
[ "pedro_hmoraes@hotmail.com" ]
pedro_hmoraes@hotmail.com
67c5fb5074893d4a240c58fe9b6fb021c7f2ebfe
6e33fe07ee2c841c697aa6077c55f15e7cb0a028
/guli_parent/common/common-utils/src/main/java/com/alex/commonutils/ResultCode.java
9062d3174515be04f9bbe41f73e1c2840d8fbdb4
[]
no_license
Alex-LiWenhao/InstituteOfGrain
a8b361a1a3f2d20903d8e8007ca507dac3e7e7b2
5d4065dc43f068767fcdb4d33709a79651b5d358
refs/heads/master
2023-02-23T15:12:05.697327
2021-02-01T02:20:19
2021-02-01T02:20:19
313,969,369
2
0
null
null
null
null
UTF-8
Java
false
false
260
java
package com.alex.commonutils; /** * @ClassName ResultCode * @Description TODO : * @Author Alex * @Date 2020/11/9 22:10 * @Version 1.0 */ public interface ResultCode { public static Integer SUCCESS = 20000; public static Integer ERROR = 20001; }
[ "1343845235@qq.com" ]
1343845235@qq.com
afb624ba036dcb6136b197f46ba423f9e5680172
faea77a6a4fcb7b5755939d757423317535bda96
/stubsA123/Driver.java
b7839c2440a5a3b60ab9aa7e3730afbfd19b5fa9
[]
no_license
kshitijalwadhi/DynamicMemoryAllocation
bf8cb5626e13e0c0b8c8cfa5e3d4d197d2dbd839
99a1b1a07e932aabde469ae417f4fb0400f94422
refs/heads/main
2023-01-14T21:13:02.431324
2020-11-30T09:24:57
2020-11-30T09:24:57
311,416,597
0
0
null
null
null
null
UTF-8
Java
false
false
1,454
java
import java.util.Scanner; public class Driver { public static void main(String args[]) { int numTestCases; Scanner sc = new Scanner(System.in); numTestCases = sc.nextInt(); while (numTestCases-- > 0) { int size; size = sc.nextInt(); A2DynamicMem obj = new A2DynamicMem(size, 2); int numCommands = sc.nextInt(); while (numCommands-- > 0) { String command; command = sc.next(); int argument; int result = -5; switch (command) { case "Allocate": argument = sc.nextInt(); result = obj.Allocate(argument); break; case "Free": argument = sc.nextInt(); result = obj.Free(argument); break; case "Defragment": obj.Defragment(); result = -10; break; default: break; } assert obj.freeBlk.sanity(); assert obj.allocBlk.sanity(); if (result != -10) System.out.println(result); else System.out.println("Defragmented"); } } } }
[ "kshitijalwadhi@gmail.com" ]
kshitijalwadhi@gmail.com
5266587900608ab4a5eead05f7836c43d4ee8af4
e70d0a980eac99a76cda20b07b23d35316a781af
/src/test/java/hellocucumber/Stepdefs.java
c30af2c34b0ed8478d6fe64b12b9e907b77b0ada
[]
no_license
tsamridh86/cucumber-test
297a771256aa07bb078c77e1aba3b1a3f7b72c03
7c7a8d7d92ba599764512cbd9a46d29374f593c7
refs/heads/master
2021-07-11T02:33:51.947462
2019-09-11T17:04:45
2019-09-11T17:04:45
207,957,664
0
0
null
2020-10-13T15:59:07
2019-09-12T03:34:09
Java
UTF-8
Java
false
false
936
java
package hellocucumber; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import static org.junit.Assert.*; public class Stepdefs { private String today; private String answer; @Given("I am logged in") public void loggedIn(){ System.out.println("background task"); } @Given("today is {string}") public void today_is_day(String day) { System.out.println("step1"); today = day; } @When("I ask whether it's Friday yet") public void i_ask_whether_it_s_Friday_yet() { System.out.println("step2"); if("Friday".equals(today)){ answer = "Yes"; }else{ answer = "Nope"; } } @Then("I should be told {string}") public void i_should_be_told(String string) { System.out.println("step3"); assertEquals(string, answer); } }
[ "t.samridh.86@gmail.com" ]
t.samridh.86@gmail.com
6740651c9a271af83917f68247c6abb8776dd72c
78916bcbd8a7a0d958e3a1027f19417fad51f193
/MySuperJumper/MySuperJumper/src/com/me/mygdxgame/HelpScreen4.java
0772ea41486c5f2499b780bf067ad9108732fafa
[]
no_license
ganzhiruyi/AndroidGame
fabd70c67a4da6272aaa44790b4bfe3eb2a7b06a
5186a502eb6c2c3ef4978d5c208c8bc3c9829f84
refs/heads/master
2016-08-05T08:22:02.784591
2013-11-26T05:45:56
2013-11-26T05:45:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,938
java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * 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.me.mygdxgame; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.GLCommon; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector3; public class HelpScreen4 implements Screen { Game game; OrthographicCamera guiCam; SpriteBatch batcher; Rectangle nextBounds; Vector3 touchPoint; Texture helpImage; TextureRegion helpRegion; public HelpScreen4 (Game game) { this.game = game; guiCam = new OrthographicCamera(320, 480); guiCam.position.set(320 / 2, 480 / 2, 0); nextBounds = new Rectangle(320 - 64, 0, 64, 64); touchPoint = new Vector3(); batcher = new SpriteBatch(); helpImage = Assets.loadTexture("data/help4.png"); helpRegion = new TextureRegion(helpImage, 0, 0, 320, 480); } public void update (float deltaTime) { if (Gdx.input.justTouched()) { guiCam.unproject(touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0)); if (OverlapTester.pointInRectangle(nextBounds, touchPoint.x, touchPoint.y)) { Assets.playSound(Assets.clickSound); game.setScreen(new HelpScreen5(game)); return; } } } public void draw (float deltaTime) { GLCommon gl = Gdx.gl; gl.glClear(GL10.GL_COLOR_BUFFER_BIT); guiCam.update(); batcher.setProjectionMatrix(guiCam.combined); batcher.disableBlending(); batcher.begin(); batcher.draw(helpRegion, 0, 0, 320, 480); batcher.end(); batcher.enableBlending(); batcher.begin(); batcher.draw(Assets.arrow, 320, 0, -64, 64); batcher.end(); gl.glDisable(GL10.GL_BLEND); } @Override public void render (float delta) { update(delta); draw(delta); } @Override public void resize (int width, int height) { } @Override public void show () { } @Override public void hide () { } @Override public void pause () { helpImage.dispose(); } @Override public void resume () { } @Override public void dispose () { } }
[ "ganzhiruyi0@gmail.com" ]
ganzhiruyi0@gmail.com
53ddb7297bd129c2b9bbc852d1ccc10175a990e8
dab3986fadcbd3726f55c2856f12c32ad1989399
/src/main/java/com/cn/juc/unsafe/ListTest.java
64fba4921ed6e23fcf78dd81b6b2c5a2bacccf16
[]
no_license
foryou1234/juc
4f3a9a8311c70401c30d0fdcf2fff7968354dded
c5092229fc99b4603b5bbb22baae313790869e37
refs/heads/master
2023-07-13T00:46:14.072984
2021-08-12T07:10:04
2021-08-12T07:10:04
380,642,319
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package com.cn.juc.unsafe; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; public class ListTest { public static void main(String[] args) { // List<String> list = new Vector<>(); // List<String> list = Collections.synchronizedList(new ArrayList<>()); List<String> list = new CopyOnWriteArrayList<>(); for (int i = 0; i < 10000; i++) { new Thread(()->{ list.add(UUID.randomUUID().toString().substring(0,5)); System.out.println(list); },String.valueOf(i)).start(); } } }
[ "942485580@qq.com" ]
942485580@qq.com
68d26d8e707220059ce844ab5e916dc103b60d24
9675cdfb6755ea44219f3a838cf95b59c8830c9e
/Algorithms/Problem119/Solution.java
a5e640874b8662c2861aac78d9b68ae22bff7c09
[]
no_license
Kite1717/LeetCode
5617377901ccfbf31fd4062bc75367b1d99d098f
68a5ed3aba166de9ce0c2abdf0ccffd81d2bb4c6
refs/heads/master
2021-08-06T03:42:36.301320
2020-05-17T19:10:30
2020-05-17T19:10:30
175,958,838
0
0
null
null
null
null
UTF-8
Java
false
false
1,022
java
class Solution { /* Runtime: 1 ms, faster than 89.13% of Java online submissions for Pascal's Triangle II. Memory Usage: 33.9 MB, less than 6.17% of Java online submissions for Pascal's Triangle II. */ public List<Integer> getRow(int rowIndex) { List<Integer> prev = new ArrayList<>(); List<Integer> current = new ArrayList<>(); List<Integer> next; prev.add(1); if(rowIndex == 0) return prev; current.add(1); current.add(1); if(rowIndex == 1) return current; for(int i = 2; i <= rowIndex ; i++) { next = new ArrayList<>(); next.add(1); for(int j = 0 ; j < current.size() ;j++) { if(j != current.size() -1){ next.add(current.get(j) + current.get(j+1)); } } next.add(1); prev = current; current = next; } return current; } }
[ "mustafafirat.yilmaz@ogr.deu.edu.tr" ]
mustafafirat.yilmaz@ogr.deu.edu.tr
6866c38b251417f25346dfe515965e311f1b326f
14e3aed69ccc655f1856aa80d331fd724379358b
/app/src/main/java/xin/shengnan/helper/fragment/FragmentGPS.java
58bb75b2afe63b4384ca15836e83283d72acf16c
[]
no_license
wojiuailan/Helper
d00e3009d483e546cf82237b02820b0d1d4988ec
a5edfd87eef1c873819681255a9b25b2a67d2e52
refs/heads/master
2021-04-06T18:19:21.737489
2018-03-11T03:56:57
2018-03-11T03:56:57
124,721,206
0
0
null
null
null
null
UTF-8
Java
false
false
7,398
java
package xin.shengnan.helper.fragment; import android.annotation.SuppressLint; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.support.annotation.Nullable; import android.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import org.json.JSONException; import org.json.JSONObject; import xin.shengnan.helper.R; import xin.shengnan.helper.local.Config; import xin.shengnan.helper.net.GetFamilyGPS; import xin.shengnan.helper.service.ServiceGPS; public class FragmentGPS extends Fragment { private LocationManager mLocationManager; private SharedPreferences mSharedPreferences; private TextView mTVLongitude, mTVLatitude, mTVSpeed, mTVHeight; private TextView mTVFamilyLongitude, mTVFamilyLatitude; private EditText mETFamilyName; private Context mContext; private boolean firstRLU = true; public FragmentGPS() { } @SuppressLint("ValidFragment") public FragmentGPS(Context context) { this(); mSharedPreferences = context.getSharedPreferences(Config.CONFIG, Context.MODE_PRIVATE); mContext = context; mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTVFamilyLongitude = view.findViewById(R.id.tv_family_longitude); mTVFamilyLatitude = view.findViewById(R.id.tv_family_latitude); mETFamilyName = view.findViewById(R.id.et_gps_family_name); mTVHeight = view.findViewById(R.id.tv_height); mTVSpeed = view.findViewById(R.id.tv_speed); mTVLatitude = view.findViewById(R.id.tv_latitude); mTVLongitude = view.findViewById(R.id.tv_longitude); Button mBtnFlushEveryTime = view.findViewById(R.id.btn_every_time_flush_gps); Button mBtnFamilySelect = view.findViewById(R.id.btn_get_family_gps); mBtnFamilySelect.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String familyName = mETFamilyName.getText().toString(); if (familyName.isEmpty()) { return; } new GetFamilyGPS(mSharedPreferences.getString(Config.USERNAME, null), mSharedPreferences.getString(Config.TOKEN, null), familyName, new Config.SuccessCallback() { public void successDo(String msg) { String status = Config.getParam(".*" + Config.STATUS + "=", msg); String location; int s = Integer.valueOf(status); if (2 == s) { mHandler.sendEmptyMessage(MyHandler.SHOW_RELATION_ERROR); } else if (1 == s) { location = Config.getParam(".*" + Config.LOCATION + "=", msg); Message m = new Message(); Bundle b = new Bundle(); b.putString(Config.LOCATION, location); m.setData(b); m.what = MyHandler.FLUSH_UI; mHandler.sendMessage(m); } } }, null); } }); mBtnFlushEveryTime.setOnClickListener(new View.OnClickListener() { @SuppressLint("MissingPermission") public void onClick(View v) { Location mLocation; String providerLocation = LocationManager.GPS_PROVIDER; if (null == (mLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER))) { mLocation = mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); providerLocation = LocationManager.NETWORK_PROVIDER; } if (null != mLocation) { setTextView(mLocation); if (firstRLU) { firstRLU = false; mLocationManager.requestLocationUpdates(providerLocation, 1000, 10, new LocationListener() { @Override public void onLocationChanged(Location mLocation) { setTextView(mLocation); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } }); } } } }); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_gps, container, false); } private MyHandler mHandler = new MyHandler(); @SuppressLint("HandlerLeak") class MyHandler extends Handler { static final int SHOW_RELATION_ERROR = 1; static final int FLUSH_UI = 2; @SuppressLint("SetTextI18n") public void handleMessage(Message msg) { switch (msg.what) { case SHOW_RELATION_ERROR: Toast.makeText(mContext, R.string.not_is_family, Toast.LENGTH_SHORT).show(); break; case FLUSH_UI: String location = msg.getData().getString(Config.LOCATION); try { if (location != null) { JSONObject j = new JSONObject(location); mTVFamilyLongitude.setText(getString(R.string.location_longitude) + j.getString("longitude")); mTVFamilyLatitude.setText(getString(R.string.location_latitude) + j.getString("latitude")); } } catch (JSONException e) { e.printStackTrace(); } break; } } } @SuppressLint("SetTextI18n") public void setTextView(Location mLocation) { mTVLongitude.setText(getString(R.string.location_longitude) + mLocation.getLongitude()); mTVLatitude.setText(getString(R.string.location_latitude) + mLocation.getLatitude()); mTVSpeed.setText(getString(R.string.location_speed) + mLocation.getSpeed()); mTVHeight.setText(getString(R.string.location_height) + mLocation.getAltitude()); } }
[ "1826248452@qq.com" ]
1826248452@qq.com
a27b984f88c02e7dcacf4d8a0b976660cd9ccea5
6839e7abfa2e354becd034ea46f14db3cbcc7488
/src/com/sinosoft/schema/OtProductInfoSet.java
8cebe4c01a0cee861fe13d6468a1ae34332f1a6c
[]
no_license
trigrass2/wj
aa2d310baa876f9e32a65238bcd36e7a2440b8c6
0d4da9d033c6fa2edb014e3a80715c9751a93cd5
refs/heads/master
2021-04-19T11:03:25.609807
2018-01-12T09:26:11
2018-01-12T09:26:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package com.sinosoft.schema; import com.sinosoft.schema.OtProductInfoSchema; import com.sinosoft.framework.orm.SchemaSet; public class OtProductInfoSet extends SchemaSet { public OtProductInfoSet() { this(10,0); } public OtProductInfoSet(int initialCapacity) { this(initialCapacity,0); } public OtProductInfoSet(int initialCapacity,int capacityIncrement) { super(initialCapacity,capacityIncrement); TableCode = OtProductInfoSchema._TableCode; Columns = OtProductInfoSchema._Columns; NameSpace = OtProductInfoSchema._NameSpace; InsertAllSQL = OtProductInfoSchema._InsertAllSQL; UpdateAllSQL = OtProductInfoSchema._UpdateAllSQL; FillAllSQL = OtProductInfoSchema._FillAllSQL; DeleteSQL = OtProductInfoSchema._DeleteSQL; } protected SchemaSet newInstance(){ return new OtProductInfoSet(); } public boolean add(OtProductInfoSchema aSchema) { return super.add(aSchema); } public boolean add(OtProductInfoSet aSet) { return super.add(aSet); } public boolean remove(OtProductInfoSchema aSchema) { return super.remove(aSchema); } public OtProductInfoSchema get(int index) { OtProductInfoSchema tSchema = (OtProductInfoSchema) super.getObject(index); return tSchema; } public boolean set(int index, OtProductInfoSchema aSchema) { return super.set(index, aSchema); } public boolean set(OtProductInfoSet aSet) { return super.set(aSet); } }
[ "liyinfeng0520@163.com" ]
liyinfeng0520@163.com
f415f219344d06281df94ec67140a8c910c4e218
93d5db418c72c32eb66bdf0349d7e6728a0c95ba
/app/src/androidTest/java/com/example/administrator/photopicker/ApplicationTest.java
e957ed32c1f18f7c82b349cf0b40cb7fcf972ffb
[]
no_license
walaa-assy/PhotoPicker
f46bbfafcdc91667d251408c1cef7e858c8abb13
9ec50e127d860fe7bae4480d35a4e1e41b5acb17
refs/heads/master
2021-01-09T20:20:24.246276
2016-08-04T06:46:12
2016-08-04T06:46:12
64,865,288
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package com.example.administrator.photopicker; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "walaa" ]
walaa
d16f94aaf929ada1609a1f615a118142337fa51f
710bee56f5536af7b116a8e9c28b915d1065a340
/Utillization/src/kr/co/infopub/chapter/s095/BillboardMain8.java
a5672b306046b013a76780109fcd679616548677
[]
no_license
jiyeong1004/JAVA200_Utillization
5ea167971ec8f3495396d21c9c6b0ca5b56905c5
54d0907b6e90db4321555cf32d08f5f32383b9b9
refs/heads/master
2023-07-18T18:57:13.634111
2021-09-15T14:39:14
2021-09-15T14:39:14
353,721,146
1
0
null
null
null
null
UHC
Java
false
false
1,218
java
// 095. 빌보드 차트 정보를 JSON으로 저장하고 읽기 package kr.co.infopub.chapter.s095; import org.json.JSONArray; import org.json.JSONObject; import java.io.BufferedReader; import java.io.FileReader; // json public class BillboardMain8 { public static void main(String[] args) { BufferedReader br = null; try { br = new BufferedReader(new FileReader("billboard\\2018-06-02.json")); StringBuffer sb = new StringBuffer(); String msg = ""; while((msg = br.readLine()) != null) { sb.append(msg); } JSONObject billboards = new JSONObject(sb.toString()); JSONArray bills = billboards.getJSONArray("billboard"); for(int i = 0; i < bills.length(); i++) { System.out.println("------------------------------"); JSONObject bill = bills.getJSONObject(i); String rank = bill.getString("rank"); String song = bill.getString("song"); String lastweek = bill.getString("lastweek"); String imagesrc = bill.getString("imagesrc"); String artist = bill.getString("artist"); String sf = String.format("%s, %s, %s, %s, %s", rank, song, lastweek, imagesrc, artist); System.out.println(sf); } } catch(Exception e) { System.out.println(e); } } }
[ "s2019s28@e-mirim.hs.kr" ]
s2019s28@e-mirim.hs.kr
2f4cbe090593f91dcc17fd7ada110f913a5e9df5
c4352bde96e74d997be29e31517aa5f1f54e9795
/JavaOOP_2019/OOP_Exams/Hell_Exam_Tests/src/main/java/hell/interfaces/Inventory.java
45f5f977dc0d791642a177c684ef3a0182bf3f2e
[]
no_license
chmitkov/SoftUni
b0f4ec10bb89a7dc350c063a02a3535ef9e901b4
52fd6f85718e07ff492c67d8166ed5cfaf5a58ff
refs/heads/master
2022-11-29T01:06:51.947775
2019-10-12T12:29:03
2019-10-12T12:29:03
138,323,012
1
0
null
2022-11-24T09:42:25
2018-06-22T16:09:50
Java
UTF-8
Java
false
false
309
java
package hell.interfaces; public interface Inventory { long getTotalStrengthBonus(); long getTotalAgilityBonus(); long getTotalIntelligenceBonus(); long getTotalHitPointsBonus(); long getTotalDamageBonus(); void addCommonItem(Item item); void addRecipeItem(Recipe recipe); }
[ "ch.mitkov@gmail.com" ]
ch.mitkov@gmail.com
5324219cec593a37a798690de55fc173212a7448
98d313cf373073d65f14b4870032e16e7d5466f0
/gradle-open-labs/example/src/main/java/se/molybden/Class9154.java
7488a0b92c4c1e52f7b2115ee138bd7f38afbf66
[]
no_license
Molybden/gradle-in-practice
30ac1477cc248a90c50949791028bc1cb7104b28
d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3
refs/heads/master
2021-06-26T16:45:54.018388
2016-03-06T20:19:43
2016-03-06T20:19:43
24,554,562
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
public class Class9154{ public void callMe(){ System.out.println("called"); } }
[ "jocce.nilsson@gmail.com" ]
jocce.nilsson@gmail.com
35619d6dc3ea9b51c0d826f4ca28c4f75b95ab05
987b4a0e2124d2c308e886115ff7bda347e820f7
/后端/backstage/java/javas1/demo1/java_IDE/day1/src/day2/DemoDate2.java
31ab81d02c906440422ec3b495ab44bce3d00ce3
[ "MIT" ]
permissive
togethter/learnDic
48606e0afbb08b77c49c135cdd4238f0011fcfc9
f1d0623ff96e24d67aa150ea45862d1cf52b75f3
refs/heads/master
2021-06-13T06:08:08.235217
2021-03-14T15:45:09
2021-03-14T15:45:09
163,981,843
0
0
MIT
2019-06-21T14:37:03
2019-01-03T14:15:27
null
UTF-8
Java
false
false
1,040
java
package day2; import java.util.Date; public class DemoDate2 { public static void main(String[] args) { demo03(); } /* Date类的成员方法 Long getTime() 把日期转换称毫秒 返回子1970-01-01-00:00:00 以来次Date代表的毫秒数 */ private static void demo03() { Date date = new Date(); long time = date.getTime(); System.out.println(time); // 1594200207872 } /* Date类的带参数构造方法 Date(long date) 传递毫秒值,把毫秒转换为date日期 */ private static void demo02() { Date d1 = new Date(0L); Date d2 = new Date(158111111111L); System.out.println(d1);// Thu Jan 01 08:00:00 CST 1970 System.out.println(d2);// Sun Jan 05 07:45:11 CST 1975 } /* Date 类空参数构造方法 Date() 获取当前的系统时间 */ public static void demo01() { Date date = new Date(); System.out.println(date); // Wed Jul 08 17:12:32 CST 2020 } }
[ "814508196@qq.com" ]
814508196@qq.com
899735d1b84d6ff92d62599d49d1dfc77b3ea6bf
0789c53e14da3d1416d662652145acfeb768edfa
/app/src/main/java/com/techjd/pickingimage/MainActivity.java
01c806d8847f5d18bfb58258033411acd4b29d00
[]
no_license
techjd/DOUBT-SOLVER-ML-KIT
2f803f42206598c128bd92e0823167e0a793a51f
e044df871c555ff45e25423c07ad36df51105402
refs/heads/master
2022-07-31T03:29:00.773462
2020-05-22T20:24:58
2020-05-22T20:24:58
266,200,600
0
0
null
null
null
null
UTF-8
Java
false
false
4,453
java
package com.techjd.pickingimage; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.ml.vision.FirebaseVision; import com.google.firebase.ml.vision.common.FirebaseVisionImage; import com.google.firebase.ml.vision.text.FirebaseVisionText; //import com.google.firebase.ml.vision.text.FirebaseVisionTextDetector; import com.google.firebase.ml.vision.text.FirebaseVisionTextDetector; import com.squareup.picasso.Picasso; import java.io.IOException; import java.util.List; public class MainActivity extends AppCompatActivity { //private static final int PICK_IMAGE_REQUEST = 1; private static final int REQUEST_IMAGE_CAPTURE = 1; final int PIC_CROP = 2; private Bitmap imageBitmap; private Button mButtonChooseImage; private Button mButtonUpload; private TextView txtview; private EditText mEditTextFileName; private ImageView mImageView; private ProgressBar mProgressBar; private String visionText; private Uri mImageUri; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mButtonChooseImage = findViewById(R.id.button_choose_image); mButtonUpload = findViewById(R.id.button_upload); txtview = findViewById(R.id.txt); mImageView = findViewById(R.id.image_view); mButtonChooseImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openFileChooser(); } }); mButtonUpload.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { openActivity(); } }); } private void openFileChooser() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { Bundle extras = data.getExtras(); imageBitmap = (Bitmap) extras.get("data"); mImageView.setImageBitmap(imageBitmap); } } private void openActivity() { Intent intent = new Intent(MainActivity.this, SearchActivity.class); intent.putExtra("TEXT", visionText); FirebaseVisionImage firebaseVisionImage = FirebaseVisionImage.fromBitmap(imageBitmap); FirebaseVisionTextDetector firebaseVisionTextDetector = FirebaseVision.getInstance().getVisionTextDetector(); firebaseVisionTextDetector.detectInImage(firebaseVisionImage).addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() { @Override public void onSuccess(FirebaseVisionText firebaseVisionText) { List<FirebaseVisionText.Block> blockList = firebaseVisionText.getBlocks(); if (blockList.size() == 0){ System.out.println("No text found"); } else { for (FirebaseVisionText.Block block : firebaseVisionText.getBlocks()){ visionText = block.getText(); } } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(MainActivity.this,"Message " + e.getMessage(),Toast.LENGTH_LONG).show(); } }); startActivity(intent); } }
[ "jaydeepparmar253@gmail.com" ]
jaydeepparmar253@gmail.com
d2daa783773c71e53c7b619eba6c3725832d288e
9216b9c9b2c90a8e0e84e65fcef5947968851db8
/BlazeRouter/src/main/java/com/fico/blaze/service/BlazeRouterConfiguration.java
4e860c8a13152ffdd91eedc54598edaa7919a226
[]
no_license
Steven1230/BlazeRouter
410f3233e21de723ef8cd3c45d601967bb3c18c4
12c6fedd81c8e6da6c88b4717c33d4b104df8b4e
refs/heads/master
2023-01-24T22:50:13.718023
2020-12-08T09:08:17
2020-12-08T09:08:17
283,186,326
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package com.fico.blaze.service; import org.springframework.context.annotation.Configuration; @Configuration public class BlazeRouterConfiguration { }
[ "yxb841230@126.com" ]
yxb841230@126.com
c0b86f4b5b29918d8f4d5c4cb9e307ab382247f1
9297bb49f890eff28541d9416f410295009e9a9c
/GradeSystem/src/ncu/cs/agile/GradeSystems.java
58fbb7c8db26c510590a41e92dcf397f57708202
[]
no_license
ariel055132/Agile_Method
43b78e7ef8021b6b215cf8d626d4e58e32017a3f
788cd17f1d7efd5e876b038ff52d4da42cf079ad
refs/heads/master
2021-10-27T04:30:13.089850
2021-10-25T14:36:12
2021-10-25T14:36:12
247,224,756
0
0
null
null
null
null
UTF-8
Java
false
false
19,095
java
/** *************************************************** class GradeSystems aGradeSystem儲存a tree of anEntry objects with key ID and value aGrade containID (ID) //看aGradeSystem有否含此ID getName(ID) //取得ID的name GradeSystems () //建構 aGradeSystem showGrade (ID) showRank (ID) updateWeights () ********************************************************/ package ncu.cs.agile; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; import java.util.Set; import java.util.TreeMap; import java.io.File; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; public class GradeSystems { /* double[5] weights; //初始值 lab1 0.1, lab2 0.1, lab3 0.1, midTerm 0.3, finalExam 0.4 //注意weights 之和須等於1.0 TreeMap <String, Grades> aTree; //String is the KEY (ID) class; Grades is the VALUE class /*用TreeMap class的object叫aTree來儲存anEntry objects. 它對應 KEY (ID) 到 VALUE (aGrade object),見下面設計草圖*/ /* 1. 開檔 input file “gradeInput.txt” 2. 用Java TreeMap建構a tree of anEntry(key, value) objects叫 aTree 3. read line 4. while not endOfFile 1. call Grades() 建構aGrade 2. call Entry() 建構 anEntry 3. 用Java Scanner scan line,ID存key 其餘存aGrade(value) (key,value)即anEntry 4. aGrade call calculateTotalGrade(weights) return aTotalGrade把它存入aGrade 5. 把 anEntry 存入 aTree end while*/ /*------------------------------------------------------------------------------------------------------------- containID(ID) 看aGradeSystem是否含此ID parameter: ID a user ID ex: 123456789 exception: IDExceptions3 print “無這ID 錯了!” return: boolean time: O(log n) n is aGradeSystem 內全班人數 -----------------------------------------------------------------------------------------------------------------*/ /*1.for anEntry in aTree if ID等於 ID of anEntry then return true end if end for 2.throw an IDExceptions3 object*/ /*---------------------------------------------------------------------------------------------------------------------------- showGrade(ID) show 此 ID 的 total grade ----------------------------------------------------------------------------------------------------------------------------*/ /* for anEntry in aTree if ID等於 ID of anEntry then return totalGrade end if end for*/ /*---------------------------------------------------------------------------------------------------------------------------- showRank(ID) show 此 ID的 rank ----------------------------------------------------------------------------------------------------------------------------*/ /*1. 取得這 ID 的 theTotalGrade 2. 令rank 為 1 3. for anEntry in aTree if aTotalGrade > theTotalGrade then rank加1(退1名) end if end for 4. return rank 註:showGrade(ID) showRank(ID) 也可放在UI class,那將是另一種設計,軟體設計無唯一, 但你是初次學習,所以請遵”守”此設計 (記得”守破離”?)。 /*---------------------------------------------------------------------------------------------------------------------------- updateWeights () 更新weights return boolean ----------------------------------------------------------------------------------------------------------------------------*/ /*1. showOldWeights() //注意:此三個為private methods,故不需做 test code 2. getNewWeights() 3. setWeights(weights) 4. for anEntry in aGradeSystem calculateTotalGrade(weights) & save it end for 5. return true end class GradeSystems*/ /*----------------------------------------------------------------------------------------------------------------------------- getName(ID) 取得該ID的同學姓名 -----------------------------------------------------------------------------------------------------------------------------*/ /* for anEntry in aTree if ID等於 ID of anEntry then return name end if end for */ /*----------------------------------------------------------------------------------------------------------------------------- ModifyGrade() 修改該ID的同學分数 -----------------------------------------------------------------------------------------------------------------------------*/ /* Input Student ID show the name and the mark of the input student id Ask user need to edit the mark (lab1, lab2, lab3, mid-term, final exam)? if yes, enter the new mark. if no, continue the program until finish. */ /*----------------------------------------------------------------------------------------------------------------------------- AddStudent() 加新的同學的姓名,分数 -----------------------------------------------------------------------------------------------------------------------------*/ /* Input Student ID Input the name of the student Input the grade of the student (lab1, lab2, lab3, mid-term, final-exam) Show the grade you input. Ask you whether the record is correct. if yes, the record will be saved. Otherwise, nothing happened. */ /*----------------------------------------------------------------------------------------------------------------------------- DeleteStudent() 删除同學的姓名,分数 -----------------------------------------------------------------------------------------------------------------------------*/ /* Input Student ID Ask you whether the ID is correct. if yes, the corresponding record will be deleted. Otherwise, nothing happened. */ double[] weights = {0.1, 0.1, 0.1, 0.3, 0.4}; TreeMap <String, Grades> aTree; public GradeSystems() throws IOException { String pathname = "./gradeinput.txt"; /*TreeMap <String, Grades> aTree = null;*/ aTree = new TreeMap<String, Grades>(); File filename = new File(pathname); InputStreamReader reader = new InputStreamReader(new FileInputStream(filename)); BufferedReader br = new BufferedReader(reader); String line = ""; line = br.readLine(); while (line != null) { Grades aGrade = new Grades(); Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); //Entry<String, Grades> anEntry = new Entry<>(); String[] token = line.split("\\s+"); aGrade.name = token[1]; //System.out.println(token[1]); aGrade.lab1 = Integer.parseInt(token[2]); aGrade.lab2 = Integer.parseInt(token[3]); aGrade.lab3 = Integer.parseInt(token[4]); aGrade.midtermExam = Integer.parseInt(token[5]); aGrade.finalExam = Integer.parseInt(token[6]); aGrade.totalGrade = aGrade.calculateTotalGrade(weights); aTree.put(token[0], aGrade); line = br.readLine(); } } public boolean containID(String ID) throws IDExceptions3 { Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); for (Map.Entry<String, Grades> it: anEntry) { //System.out.println(it.getKey() + "\n"); if(ID.equals(it.getKey())) return true; } throw new IDExceptions3(); } public String getName(String ID) { Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); for (Map.Entry<String, Grades> it: anEntry) { //System.out.println(it.getValue().name); if(ID.equals(it.getKey())) return it.getValue().name; } return ID; } public int showGrade(String ID) { Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); for (Map.Entry<String, Grades> it: anEntry) { if(ID.equals(it.getKey())) { //it.getValue().totalGrade = it.getValue().calculateTotalGrade(weights[0], weights[1], weights[2], weights[3], weights[4]); System.out.println(it.getValue().name + " 成績:lab1: " + it.getValue().lab1); System.out.println(" lab2: " + it.getValue().lab2); System.out.println(" lab3: " + it.getValue().lab3); System.out.println(" midterm exam: " + it.getValue().midtermExam); System.out.println(" final exam: " + it.getValue().finalExam); System.out.println(" total grade: " + it.getValue().totalGrade); System.out.print("\n"); return it.getValue().totalGrade; } } return 0; } public int showRank(String ID) { int TotalGrade = aTree.get(ID).totalGrade, rank = 1; Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); for (Map.Entry<String, Grades> it: anEntry) if(it.getValue().totalGrade > TotalGrade) rank ++; System.out.println(aTree.get(ID).name + "排名第" + rank); System.out.print("\n"); return rank; } // new function: modify the scores of the student public boolean modifyGrade() { Scanner scanner = new Scanner(System.in); String confirm, id, name = null; // edit the marks?, student id, student name int score = 0; // new scores Grades aGrade = new Grades(); // calculate totalGrade of student System.out.print("輸入更改分數學生的ID "); id = scanner.next(); name = getName(id); System.out.println("姓名 " + name); showGrade(id); System.out.print("更改" + name + "Lab1 分數? (yes/no)"); confirm = scanner.next(); if (confirm.equals("yes")) { System.out.print("輸入" + name + "Lab1新分數 "); score = scanner.nextInt(); aGrade.lab1 = score; aTree.get(id).lab1 = score; } else { aGrade.lab1 = aTree.get(id).lab1; } System.out.print("更改" + name + "Lab2 分數? (yes/no)"); confirm = scanner.next(); if (confirm.equals("yes")) { System.out.print("輸入" + name + "Lab2新分數 "); score = scanner.nextInt(); aGrade.lab2 = score; aTree.get(id).lab2 = score; } else { aGrade.lab2 = aTree.get(id).lab2; } System.out.print("更改" + name + "Lab3 分數? (yes/no)"); confirm = scanner.next(); if (confirm.equals("yes")) { System.out.print("輸入" + name + "Lab3新分數 "); score = scanner.nextInt(); aGrade.lab3 = score; aTree.get(id).lab3 = score; } else { aGrade.lab3 = aTree.get(id).lab3; } System.out.print("更改" + name + "Mid-term 分數? (yes/no)"); confirm = scanner.next(); if (confirm.equals("yes")) { System.out.print("輸入" + name + "Mid-term新分數 "); score = scanner.nextInt(); aGrade.midtermExam = score; aTree.get(id).midtermExam = score; } else { aGrade.midtermExam = aTree.get(id).midtermExam; } System.out.print("更改" + name + "Final Exam 分數? (yes/no)"); confirm = scanner.next(); if (confirm.equals("yes")) { System.out.print("輸入" + name + "Final Exam新分數 "); score = scanner.nextInt(); aGrade.finalExam = score; aTree.get(id).finalExam = score; } else { aGrade.finalExam = aTree.get(id).finalExam; } // TotalGrade cannot be updated int totalGrade = aGrade.calculateTotalGrade(weights); aTree.get(id).totalGrade = totalGrade; System.out.println("更改分數" + id + getName(id) + "完成了"); // check whether the score is edit or not = = //showGrade(id); return true; } public boolean deleteStudent() throws IDExceptions3 { Scanner scanner = new Scanner(System.in); String id = null; // the student id you want to delete String confirm = null; // confirm delete or not System.out.print("刪減學生的ID "); id = scanner.next(); if (containID(id) == true) { String name = getName(id); System.out.print("確認刪減學生 " + id + " " + name + " (yes/no) "); confirm = scanner.next(); if (confirm.equals("yes")) { aTree.remove(id); // Print the tree map to observe the operation is correctly done //System.out.println("New Map is: " + aTree); System.out.println("刪減學生" + id + " " + name + "完成了"); } else if (confirm.equals("no")) { //System.out.println("New Map is: " + aTree); return false; } } return true; } public boolean addStudent() { Scanner scanner = new Scanner(System.in); String id, name, confirm = null; int lab1, lab2, lab3, mid_exam, final_exam = 0; System.out.print("新增學生的ID "); id = scanner.next(); System.out.println("輸入ID" + id + "的姓名及成績"); System.out.print("姓名 "); name = scanner.next(); System.out.print("Lab1 "); lab1 = scanner.nextInt(); System.out.print("Lab2 "); lab2 = scanner.nextInt(); System.out.print("Lab3 "); lab3 = scanner.nextInt(); System.out.print("Mid-term "); mid_exam = scanner.nextInt(); System.out.print("Final exam "); final_exam = scanner.nextInt(); System.out.println("確認新增學生" + id + "的姓名及成績"); System.out.println("姓名 " + name); System.out.println("Lab1 " + lab1); System.out.println("Lab2 " + lab2); System.out.println("Lab3 " + lab3); System.out.println("Mid-term " + mid_exam); System.out.println("Final exam " + final_exam + "(yes/no)") ; confirm = scanner.next(); if (confirm.equals("yes")) { Grades aGrade = new Grades(); Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); aGrade.name = name; aGrade.lab1 = lab1; aGrade.lab2 = lab2; aGrade.lab3 = lab3; aGrade.midtermExam = mid_exam; aGrade.finalExam = final_exam; aGrade.totalGrade = aGrade.calculateTotalGrade(weights); aTree.put(id, aGrade); System.out.println("新增學生 " + id + " " + name + " 完成了"); //System.out.println(aTree); } else if (confirm.equals("no")) { return false; } return true; } public boolean writeFile() throws IOException { Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); FileWriter fstream = new FileWriter("./gradeinput.txt"); BufferedWriter writer = new BufferedWriter(fstream); for (Map.Entry<String, Grades> it: anEntry) { String str = it.getKey() + " " + it.getValue().name + " " + it.getValue().lab1 + " " +it.getValue().lab2 + " " + it.getValue().lab3 + " " + it.getValue().midtermExam + " " + it.getValue().finalExam + "\n"; // C:\Users\adrian\eclipse-workspace\GradeSystem //BufferedWriter writer = new BufferedWriter(new FileWriter("./gradeinput1.txt")); writer.write(str); writer.flush(); } writer.close(); return true; } public boolean updateWeights() throws IDExceptions1 { String confirm = null; int i; double[] oldweights = new double[5]; for(i = 0 ; i < 5 ; i ++) oldweights[i] = weights[i]; boolean check = false; showOldWeights(); while(check == false) { getNewWeights(); setWeights(weights); Scanner scanner = new Scanner(System.in); System.out.print("以上正確嗎? Y (Yes) 或 N (No)\n"); System.out.print("使用者輸入: "); confirm = scanner.next(); while(!confirm.equals("Y") && !confirm.equals("N")) { confirm = scanner.next(); } if(confirm.equals("Y")) check = true; else for(i = 0 ; i < 5 ; i ++) weights[i] = oldweights[i]; } Set<Map.Entry<String, Grades>> anEntry = aTree.entrySet(); for (Map.Entry<String, Grades> it: anEntry) it.getValue().totalGrade = it.getValue().calculateTotalGrade(weights); System.out.print("\n"); return true; } private void showOldWeights() { System.out.println("舊配分"); System.out.println("lab1 " + (int)(weights[0]*100)+ "%"); System.out.println("lab2 " + (int)(weights[1]*100)+ "%"); System.out.println("lab3 " + (int)(weights[2]*100)+ "%"); System.out.println("midterm exam " + (int)(weights[3]*100)+ "%"); System.out.println("final exam " + (int)(weights[4]*100)+ "%"); } private void getNewWeights() { int i; boolean check = false; Scanner scanner = new Scanner(System.in); String grade; do { check = false; System.out.println("輸入新配分"); System.out.print("lab1 "); grade = scanner.next(); for(i = 0 ; i < grade.length() ; i ++) if(grade.charAt(i) >= 'a' && grade.charAt(i) <= 'z' || (grade.charAt(i) >= 'A' && grade.charAt(i) <= 'Z')) { System.out.println("這分數含字母 錯了!"); check = true; break; } if(check == true) continue; weights[0] = Double.parseDouble(grade); //System.out.print("\n"); System.out.print("lab2 "); grade = scanner.next(); for(i = 0 ; i < grade.length() ; i ++) if(grade.charAt(i) >= 'a' && grade.charAt(i) <= 'z' || (grade.charAt(i) >= 'A' && grade.charAt(i) <= 'Z')) { System.out.println("這分數含字母 錯了!"); check = true; break; } if(check == true) continue; weights[1] = Double.parseDouble(grade); //System.out.print("\n"); System.out.print("lab3 "); grade = scanner.next(); for(i = 0 ; i < grade.length() ; i ++) if(grade.charAt(i) >= 'a' && grade.charAt(i) <= 'z' || (grade.charAt(i) >= 'A' && grade.charAt(i) <= 'Z')) { System.out.println("這分數含字母 錯了!"); check = true; break; } if(check == true) continue; weights[2] = Double.parseDouble(grade); //System.out.print("\n"); System.out.print("midterm exam "); grade = scanner.next(); for(i = 0 ; i < grade.length() ; i ++) if(grade.charAt(i) >= 'a' && grade.charAt(i) <= 'z' || (grade.charAt(i) >= 'A' && grade.charAt(i) <= 'Z')) { System.out.println("這分數含字母 錯了!"); check = true; break; } if(check == true) continue; weights[3] = Double.parseDouble(grade); //System.out.print("\n"); System.out.print("final exam "); grade = scanner.next(); for(i = 0 ; i < grade.length() ; i ++) if(grade.charAt(i) >= 'a' && grade.charAt(i) <= 'z' || (grade.charAt(i) >= 'A' && grade.charAt(i) <= 'Z')) { System.out.println("這分數含字母 錯了!"); check = true; break; } if(check == true) continue; weights[4] = Double.parseDouble(grade); //System.out.print("\n"); }while(check == true); } private void setWeights(double[] weights) { weights[0] *= 0.01; weights[1] *= 0.01; weights[2] *= 0.01; weights[3] *= 0.01; weights[4] *= 0.01; System.out.println("請確認新配分"); System.out.println("lab1 " + (int)(weights[0]*100)+ "%"); System.out.println("lab2 " + (int)(weights[1]*100)+ "%"); System.out.println("lab3 " + (int)(weights[2]*100)+ "%"); System.out.println("midterm exam " + (int)(weights[3]*100)+ "%"); System.out.println("final exam " + (int)(weights[4]*100)+ "%"); } }
[ "appleadrian100000@gmail.com" ]
appleadrian100000@gmail.com
696234eaa668a9cf92690b3922f2c5a76778ad84
d068cad969b8cd9ad0815dd651364e53d7930dac
/BookStoreUserManagement-1/src/main/java/com/capgemini/controller/UserManagementController.java
2b682ce79ec3025b55c2a7fd8ecacb975e86bb07
[]
no_license
BootcampOnlineBookStore/BookStore-UserManagement
30c2d5869228deb064cc84eff6dee9c1de09b8b3
0702cf8c856ddf136f1982b14d4cbfaa2c21e498
refs/heads/master
2022-12-28T08:55:30.108824
2020-10-16T04:47:13
2020-10-16T04:47:13
302,004,242
0
0
null
null
null
null
UTF-8
Java
false
false
3,569
java
package com.capgemini.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import com.capgemeni.dto.SuccessMessage; import com.capgemeni.dto.UserManagementForm; import com.capgemini.entity.User; import com.capgemini.exceptions.ListIsEmptyException; import com.capgemini.exceptions.LoginException; import com.capgemini.exceptions.UserNotFoundException; import com.capgemini.service.UserManagementService; import com.cg.util.CgConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @RestController public class UserManagementController { @Autowired public UserManagementService userService; @SuppressWarnings("unused") @Autowired private RestTemplate rt; Logger logger = LoggerFactory.getLogger(UserManagementController.class); @PostMapping(CgConstants.CREATE_USER_URL) public SuccessMessage createUser(@RequestHeader(name="tokenId",required=false) String tokenId, @RequestBody UserManagementForm userForm) throws LoginException { logger.info(CgConstants.TOKEN_ID+ tokenId); @SuppressWarnings("unused") String email=userService.validateTokenInAdminLoginService(tokenId); String userId=userService.createUser(userForm); return new SuccessMessage(CgConstants.USER_CREATED+userId); } @PutMapping(CgConstants.EDIT_USER_URL) public SuccessMessage edituser(@RequestHeader(name="tokenId",required=false) String tokenId,@RequestBody User user) throws UserNotFoundException, LoginException { logger.info(CgConstants.TOKEN_ID+ tokenId); @SuppressWarnings("unused") String email=userService.validateTokenInAdminLoginService(tokenId); String userId=userService.editUser(user); return new SuccessMessage(userId+CgConstants.EDITING_COMPLETED); } @DeleteMapping(CgConstants.DELETE_USER_URL) public SuccessMessage deleteUser(@RequestHeader(name="tokenId",required=false) String tokenId, @PathVariable("emailid") String emailId) throws UserNotFoundException, LoginException { logger.info(CgConstants.TOKEN_ID+ tokenId); @SuppressWarnings("unused") String email=userService.validateTokenInAdminLoginService(tokenId); String emailId1=userService.removeUser(emailId); return new SuccessMessage(emailId1+CgConstants.USER_DELETED_SUCCESSFULLY) ; } @GetMapping(CgConstants.LIST_ALL_USERS_URL) public List<User> getListOfUsers(@RequestHeader(name="tokenId",required=false) String tokenId) throws ListIsEmptyException, LoginException{ logger.info(CgConstants.TOKEN_ID+ tokenId); @SuppressWarnings("unused") String email=userService.validateTokenInAdminLoginService(tokenId); List<User> userList=userService.viewAllUsers(); return userList; } @GetMapping(CgConstants.VIEW_USER_BY_ID_URL) public User viewUserById(@RequestHeader(name="tokenId",required=false) String tokenId,@PathVariable("emailId") String emailId) throws UserNotFoundException, LoginException{ logger.info(CgConstants.TOKEN_ID+ tokenId); @SuppressWarnings("unused") String email=userService.validateTokenInAdminLoginService(tokenId); User user=userService.viewUserById(emailId); return user; } { } }
[ "*sais11604@gmail.com*" ]
*sais11604@gmail.com*
05df3365319fe013ddc929a9910bcda9c80fbc65
f913b5c42f2e6f9432f3d47388d736d57a9a19ba
/telesync/pippin/binder/BinderUtilities.java
d05d7bff2d7d63dd0a4facfc48e2a2ef00c5d268
[]
no_license
thirdeyesoftware/thirdeye
596ed5930d2765dada4a51e03182f3e4d4a75ca1
ebab84aa98863160987166e9d79bad9c5b7e08ca
refs/heads/master
2022-02-21T12:25:01.212248
2019-10-21T13:04:14
2019-10-21T13:04:14
104,084,837
0
0
null
null
null
null
UTF-8
Java
false
false
2,905
java
// // // Joseph A. Dudar, Inc (C) 1999 - 2001 // // //// package pippin.binder; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.border.*; /** */ public class BinderUtilities { static private BlockingKeymap cTFKeymap; static private BlockingKeymap cPWKeymap; static { JTextField f = new JTextField(); KeyStroke cr = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false); Keymap km = f.getKeymap(); // km.removeKeyStrokeBinding(cr); cTFKeymap = new BlockingKeymap("no-cr JTextField", km); cTFKeymap.blockKeyStrokeBinding(cr); JPasswordField pf = new JPasswordField(); km = pf.getKeymap(); // km.removeKeyStrokeBinding(cr); cPWKeymap = new BlockingKeymap("no-cr JPasswordField", km); cPWKeymap.blockKeyStrokeBinding(cr); } static public Keymap getTextFieldKeymap() { return cTFKeymap; } static public Keymap getPasswordFieldKeymap() { return cPWKeymap; } static public JTextField createNoCRTextField() { JTextField tf = new JTextField(); tf.setKeymap(getTextFieldKeymap()); return tf; } public static void initProperties() { System.out.println("initProperties()"); Color c; if (System.getProperty("java.version").startsWith("1.4")) { c = new Color(102,102,153); } else { c = new JLabel().getForeground(); } try { UIManager.put("pippin.colors.labelFG", c); UIManager.put("pippin.colors.titlePanelBG", c.brighter().brighter()); UIManager.put("pippin.colors.lpsPurple2", c.brighter().brighter()); UIManager.put("pippin.colors.lpsPurple1", c.brighter()); UIManager.put("pippin.colors.lpsPurple0", c); UIManager.put("pippin.colors.selectionYellow", new Color(255, 255, 204)); UIManager.put("pippin.colors.selectionBlue", new Color(132, 151, 218)); UIManager.put("pippin.colors.indicatorBlue", UIManager.getColor("pippin.colors.selectionBlue").brighter()); UIManager.put("pippin.colors.alertRed", new Color(255, 204, 204)); UIManager.put("pippin.colors.goGreen", new Color(204, 255, 204)); UIManager.put("pippin.fonts.smaller", new Font("SansSerif", Font.PLAIN, 10)); UIManager.put("pippin.fonts.plain", new Font("SansSerif", Font.PLAIN, 12)); UIManager.put("pippin.fonts.notice", new Font("SansSerif", Font.PLAIN, 16)); UIManager.put("pippin.fonts.herald", new Font("SansSerif", Font.BOLD + Font.ITALIC, 18)); UIManager.put("pippin.fonts.fixed", new Font("Monospaced", Font.PLAIN, 11)); UIManager.put("pippin.fonts.fixed12", new Font("Monospaced", Font.PLAIN, 12)); UIManager.put("pippin.fonts.small", new Font("SansSerif", Font.PLAIN, 10)); } catch (Exception e) { e.printStackTrace(); } } }
[ "jeff_s_blau@homedepot.com" ]
jeff_s_blau@homedepot.com
ada92bd21776cd6924571261af89a342f9e63e61
33564397ef8b4744287605b25094ae5113fe8614
/core/src/main/java/com/jungle/spring/core/io/DefaultResourceLoader.java
734b8a05652a5a9b7dd5211edd50841d38860e99
[]
no_license
dgjungleP/MySpring
c29fbc686112be6d603038c62336406dc5422aff
710c78faf7c1f592e660eabc7a564e77f5309df5
refs/heads/main
2023-07-06T17:07:41.183284
2021-08-12T08:01:51
2021-08-12T08:01:51
394,878,060
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.jungle.spring.core.io; import cn.hutool.core.lang.Assert; import java.net.MalformedURLException; import java.net.URL; /** * 默认资源加载器 */ public class DefaultResourceLoader implements ResourceLoader { @Override public Resource getResource(String location) { Assert.notNull(location, "Location must not be null"); if (location.startsWith(CLASSPATH_URL_PREFIX)) { return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length())); } else { try { URL url = new URL(location); return new UrlResource(url); } catch (MalformedURLException e) { return new FileSystemResource(location); } } } }
[ "dgJungle_c@163.com" ]
dgJungle_c@163.com
b53c60619aabfe4f50c1e0ef3b72c9d21fc9f9ee
1e1f212fa16a624bc29f15bf0cd0a886d03fbe2d
/DarasaLecturer/app/src/main/java/com/job/darasalecturer/ui/auth/AccountSetupActivity.java
1252317dcfa2e12034d967b7243512e5dd2c1620
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
mobileappz007/Darasa-IEEEMadC
ce711e1c9335cf2c740ccea3955d043d790154f7
3a95da82375a43eca7761e3d7558c3251583b46b
refs/heads/master
2020-09-22T04:54:43.139156
2019-04-30T16:11:41
2019-04-30T16:11:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,303
java
package com.job.darasalecturer.ui.auth; import android.arch.lifecycle.Observer; import android.arch.lifecycle.ViewModelProviders; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.TextInputLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.FirebaseFirestore; import com.job.darasalecturer.R; import com.job.darasalecturer.model.LecUser; import com.job.darasalecturer.ui.newlesson.AddClassActivity; import com.job.darasalecturer.util.AppStatus; import com.job.darasalecturer.util.DoSnack; import com.job.darasalecturer.viewmodel.AccountSetupViewModel; import java.util.HashMap; import java.util.Map; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import cn.pedant.SweetAlert.SweetAlertDialog; import static com.job.darasalecturer.util.Constants.FIRST_NAME_PREF_NAME; import static com.job.darasalecturer.util.Constants.LAST_NAME_PREF_NAME; import static com.job.darasalecturer.util.Constants.LECUSERCOL; public class AccountSetupActivity extends AppCompatActivity { @BindView(R.id.setup_toolbar) Toolbar setupToolbar; @BindView(R.id.setup_firstname) TextInputLayout setupFirstname; @BindView(R.id.setup_lastname) TextInputLayout setupLastname; @BindView(R.id.setup_school) TextInputLayout setupSchool; @BindView(R.id.setup_department) TextInputLayout setupDepartment; @BindView(R.id.setup_btn) TextView setupBtn; private DoSnack doSnack; private SharedPreferences mSharedPreferences; private SharedPreferences.Editor editor; private FirebaseAuth mAuth; private FirebaseFirestore mFirestore; private AccountSetupViewModel model; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_account_setup); ButterKnife.bind(this); setSupportActionBar(setupToolbar); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowCustomEnabled(true); getSupportActionBar().setHomeAsUpIndicator(getResources().getDrawable(R.drawable.ic_back)); //firebase mAuth = FirebaseAuth.getInstance(); mFirestore = FirebaseFirestore.getInstance(); doSnack = new DoSnack(this, AccountSetupActivity.this); mSharedPreferences = getSharedPreferences(getApplicationContext().getPackageName(),MODE_PRIVATE); editor = getSharedPreferences(getApplicationContext().getPackageName(),MODE_PRIVATE).edit(); // View model AccountSetupViewModel.Factory factory = new AccountSetupViewModel.Factory( AccountSetupActivity.this.getApplication(), mAuth, mFirestore); model = ViewModelProviders.of(AccountSetupActivity.this, factory) .get(AccountSetupViewModel.class); //ui observer uiObserver(); } @OnClick(R.id.setup_btn) public void onViewClicked() { if (!AppStatus.getInstance(getApplicationContext()).isOnline()) { doSnack.showSnackbar("You're offline", "Retry", new View.OnClickListener() { @Override public void onClick(View view) { onViewClicked(); } }); return; } if (validate()) { final SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE); pDialog.getProgressHelper().setBarColor(Color.parseColor("#FF5521")); pDialog.setTitleText("Just a moment..."); pDialog.setCancelable(false); pDialog.show(); String fname = setupFirstname.getEditText().getText().toString(); String lname = setupLastname.getEditText().getText().toString(); String school = setupSchool.getEditText().getText().toString(); String dept = setupDepartment.getEditText().getText().toString(); Map<String, Object> lecMap = new HashMap<>(); lecMap.put("firstname", fname); lecMap.put("lastname", lname); lecMap.put("school", school); lecMap.put("department", dept); setPrefs(fname, lname); // Set the value of 'Users' DocumentReference usersRef = mFirestore.collection(LECUSERCOL).document(mAuth.getCurrentUser().getUid()); usersRef.update(lecMap) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE); pDialog.setCancelable(true); pDialog.setTitleText("Saved Successfully"); pDialog.setContentText("You're now set"); pDialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() { @Override public void onClick(SweetAlertDialog sDialog) { sDialog.dismissWithAnimation(); sendToSetClass(); } }); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { pDialog.dismiss(); doSnack.errorPrompt("Oops...", e.getMessage()); } }); } } private void sendToSetClass() { Intent aIntent = new Intent(this, AddClassActivity.class); startActivity(aIntent); finish(); } private boolean validate() { boolean valid = true; String fname = setupFirstname.getEditText().getText().toString(); String lname = setupLastname.getEditText().getText().toString(); String school = setupSchool.getEditText().getText().toString(); String dept = setupDepartment.getEditText().getText().toString(); if (fname.isEmpty()) { setupFirstname.setError("enter name"); valid = false; } else { setupFirstname.setError(null); } if (lname.isEmpty()) { setupLastname.setError("enter name"); valid = false; } else { setupLastname.setError(null); } if (school.isEmpty()) { setupSchool.setError("enter school"); valid = false; } else { setupSchool.setError(null); } if (dept.isEmpty()) { setupDepartment.setError("enter dept"); valid = false; } else { setupDepartment.setError(null); } return valid; } private void uiObserver() { model.getLecUserMediatorLiveData().observe(this, new Observer<LecUser>() { @Override public void onChanged(@Nullable LecUser lecUser) { if (lecUser != null) { setupFirstname.getEditText().setText(lecUser.getFirstname()); setupLastname.getEditText().setText(lecUser.getLastname()); setupSchool.getEditText().setText(lecUser.getSchool()); setupDepartment.getEditText().setText(lecUser.getDepartment()); } } }); } private void setPrefs(String fName,String lName){ editor.putString(FIRST_NAME_PREF_NAME,fName); editor.putString(LAST_NAME_PREF_NAME,lName); editor.apply(); } }
[ "getabujob@gmail.com" ]
getabujob@gmail.com
aebf1220b1cf1fc85dcb32737c669914532216fc
13271d246c158f642681a1a5195235b27756687a
/business/src/main/java/com/kevinguanchedarias/owgejava/configurations/DbSchedulerConfiguration.java
8df753420fa7029833bfee8f75c76eabee1c27a9
[]
no_license
KevinGuancheDarias/owge
7024249c48e39f2b332ea3fa78cf273252f2ba96
d2e65dd75b642945d43e1538373462589a29b759
refs/heads/master
2023-09-01T22:41:17.327197
2023-08-22T22:41:08
2023-08-23T11:04:00
178,665,214
4
3
null
2023-06-20T23:16:29
2019-03-31T09:04:57
Java
UTF-8
Java
false
false
706
java
package com.kevinguanchedarias.owgejava.configurations; import com.github.kagkarlsson.scheduler.task.Task; import com.github.kagkarlsson.scheduler.task.helper.Tasks; import com.kevinguanchedarias.owgejava.job.DbSchedulerRealizationJob; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class DbSchedulerConfiguration { @Bean Task<Void> missionProcessingTask(DbSchedulerRealizationJob dbSchedulerRealizationJob) { return Tasks.oneTime(DbSchedulerRealizationJob.BASIC_ONE_TIME_TASK) .execute((instance, ctx) -> dbSchedulerRealizationJob.execute(Long.parseLong(instance.getId()))); } }
[ "kevin@kevinguanchedarias.com" ]
kevin@kevinguanchedarias.com
d6ca3c4357411edf2c0fdc46ee6eac10562a635f
65909779f910d5b9450c8be6688f0a7bd3f03d50
/app/src/main/java/com/furqoncreative/submission5/view/activity/DetailMovieActivity.java
79601a84affc5fe092669de78e319e9715ef49c3
[]
no_license
furqoncreative/MovieCatalogueFinal
2f1b342737b3d4b5257e22064650485bccd4ef56
788b72cffdba350dc8d8244b82b74bf1ec2dba21
refs/heads/master
2020-07-04T04:20:32.762340
2019-08-19T10:50:31
2019-08-19T10:50:31
202,153,776
1
0
null
null
null
null
UTF-8
Java
false
false
8,990
java
package com.furqoncreative.submission5.view.activity; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import com.furqoncreative.submission5.R; import com.furqoncreative.submission5.database.FavoriteHelper; import com.furqoncreative.submission5.model.favorite.Favorite; import com.furqoncreative.submission5.model.movie.Movie; import com.furqoncreative.submission5.viewmodel.MovieViewModel; import com.wang.avi.AVLoadingIndicatorView; import java.util.Locale; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.BACKDROP; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.CATEGORY; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.CONTENT_URI; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.ID; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.OVERVIEW; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.POSTER; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.RATING; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.RELEASE_DATE; import static com.furqoncreative.submission5.database.DatabaseContract.FavoriteColumns.TITLE; import static com.furqoncreative.submission5.util.ApiUtils.IMAGE_URL; import static com.furqoncreative.submission5.widget.FavoriteWidget.sendRefreshBroadcast; @SuppressWarnings("ALL") public class DetailMovieActivity extends AppCompatActivity { public static final String MID = "movie_id"; public static final String GENRE = "genre"; @BindView(R.id.error_layout) LinearLayout errorLayout; @BindView(R.id.avi) AVLoadingIndicatorView avi; @BindView(R.id.imgBackdrop) ImageView imgBackdrop; @BindView(R.id.imgPoster) ImageView imgPoster; @BindView(R.id.txtReleaseDate) TextView txtReleaseDate; @BindView(R.id.imgRating) ImageView imgRating; @BindView(R.id.imgBack) ImageView imgBack; @BindView(R.id.txtTitle) TextView txtTitle; @BindView(R.id.txtRating) TextView txtRating; @BindView(R.id.labelOverview) TextView labelOverview; @BindView(R.id.txtOverview) TextView txtOverview; @BindView(R.id.imgFavorite) ImageView imgFavorite; private MovieViewModel movieViewModel; private int MOVIE_ID; private String MOVIE_GENRE; private int id, mId; private FavoriteHelper helper; private String backdropPath, title, releaseDate, overview, poster, rating, category; private final Observer<Movie> getMovie = new Observer<Movie>() { @Override public void onChanged(Movie movie) { if (movie != null) { showLoading(); imgBack.setVisibility(View.VISIBLE); imgFavorite.setVisibility(View.VISIBLE); imgBackdrop.setVisibility(View.VISIBLE); Glide.with(DetailMovieActivity.this) .load(IMAGE_URL + movie.getBackdropPath()) .apply(RequestOptions.placeholderOf(R.color.colorPrimary)) .into(imgBackdrop); imgPoster.setVisibility(View.VISIBLE); Glide.with(DetailMovieActivity.this) .load(IMAGE_URL + movie.getPosterPath()) .apply(RequestOptions.placeholderOf(R.color.colorPrimary)) .into(imgPoster); txtTitle.setText(movie.getTitle()); txtReleaseDate.setVisibility(View.VISIBLE); txtReleaseDate.setText(movie.getReleaseDate()); imgRating.setVisibility(View.VISIBLE); txtRating.setText(movie.getRating().toString()); labelOverview.setVisibility(View.VISIBLE); mId = movie.getId(); title = movie.getTitle(); poster = movie.getPosterPath(); backdropPath = movie.getBackdropPath(); releaseDate = movie.getReleaseDate(); rating = movie.getRating().toString(); overview = movie.getOverview(); checkFavorite(); if (movie.getOverview().length() == 0) { txtOverview.setText(getResources().getString(R.string.not_found)); } else { txtOverview.setText(movie.getOverview()); } } } }; private Favorite favorite = new Favorite(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail_movie); ButterKnife.bind(this); checkConnection(); setupViewModeL(); setupData(); } private void checkConnection() { ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { } else { showLoading(); showError(); } } private void setupData() { helper = new FavoriteHelper(getApplicationContext()); helper.open(); MOVIE_ID = getIntent().getIntExtra(MID, MOVIE_ID); String LANGUANGE = Locale.getDefault().toString(); if (LANGUANGE.equals("in_ID")) { LANGUANGE = "id_ID"; } movieViewModel.setMovie(MOVIE_ID, LANGUANGE); } private void setupViewModeL() { movieViewModel = ViewModelProviders.of(this).get(MovieViewModel.class); movieViewModel.getMovie().observe(this, getMovie); } private void showLoading() { if (false) { avi.smoothToShow(); } else { avi.smoothToHide(); } } private void showError() { errorLayout.setVisibility(View.VISIBLE); } @OnClick({R.id.imgBack}) public void doBack(View view) { finish(); } @OnClick({R.id.imgFavorite}) public void doFavorite(View view) { if (checkFavorite()) { Uri uri = Uri.parse(CONTENT_URI + "/" + id); int i = getContentResolver().delete(uri, null, null); imgFavorite.setImageResource(R.drawable.ic_unfavorite); Toast.makeText(this, getString(R.string.unfavorite), Toast.LENGTH_SHORT).show(); } else { favorite.setmId(mId); favorite.setTitle(title); favorite.setPoster(poster); favorite.setBackdrop(backdropPath); favorite.setRating(rating); favorite.setReleaseDate(releaseDate); favorite.setOverview(overview); favorite.setCategoty("movie"); ContentValues values = new ContentValues(); values.put(ID, mId); values.put(TITLE, title); values.put(POSTER, poster); values.put(BACKDROP, backdropPath); values.put(RATING, rating); values.put(RELEASE_DATE, releaseDate); values.put(OVERVIEW, overview); values.put(CATEGORY, "movie"); if (getContentResolver().insert(CONTENT_URI, values) != null) { Toast.makeText(this, title + " " + getString(R.string.favorite), Toast.LENGTH_SHORT).show(); imgFavorite.setImageResource(R.drawable.ic_favorite); } else { Toast.makeText(this, title + " " + getString(R.string.favorite_error), Toast.LENGTH_SHORT).show(); } } sendRefreshBroadcast(getApplicationContext()); } private boolean checkFavorite() { Uri uri = Uri.parse(CONTENT_URI + ""); boolean favorite = false; Cursor cursor = getContentResolver().query(uri, null, null, null, null); int getmId; if (cursor.moveToFirst()) { do { getmId = cursor.getInt(1); if (getmId == mId) { id = cursor.getInt(0); imgFavorite.setImageResource(R.drawable.ic_favorite); favorite = true; } } while (cursor.moveToNext()); } return favorite; } }
[ "akunkhusu42@gmail.com" ]
akunkhusu42@gmail.com
669bdb49e1e33cc9b2e63d933839996b8ae78de6
5888a540e60944fea414ea045122e70e18e69500
/src/co/grandcircus/lab11/UsedCar.java
c437bb5772600e37b971d277b23a073a2f4fce17
[]
no_license
foleya/grand-circus-lab-11
8994038b1891c2770b9d77c47d33179b8b5c56c6
36cd5c32de75a8a6610652188e919b331ad1a85e
refs/heads/master
2020-03-24T21:05:46.041048
2018-07-31T12:53:08
2018-07-31T12:53:08
143,013,272
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package co.grandcircus.lab11; public class UsedCar extends Car { private double mileage; public UsedCar() { super(); } public UsedCar(String make, String model, int year, double price, double mileage) { super(make, model, year, price); this.mileage = mileage; } public double getMileage() { return mileage; } public void setMileage(double mileage) { this.mileage = mileage; } @Override public String toString() { return String.format("%-10s%-15s%-8d$%-10.2f%.1f miles", getMake(), getModel(), getYear(), getPrice(), mileage); } }
[ "andrew@clicktutor.io" ]
andrew@clicktutor.io
712ae6ab46a8c5fab014ce1b2faad0e0d467fdd9
45bbbfbd871f6b996fcbdea858cfe088a9c3aa47
/src/main/java/com/hivetech/mvc/service/INewService.java
ac172f4366018b5d0dd7aa969d86e9727efeb817
[]
no_license
doanhieucodegym/config_mvc
b0beab9b24684a73c5c4848d9c49b41507c39ec0
c0f87a7d6e3016261adbce900c8ea84faec377b3
refs/heads/master
2023-01-14T09:47:00.335799
2020-11-15T12:37:51
2020-11-15T12:37:51
286,098,831
0
0
null
null
null
null
UTF-8
Java
false
false
166
java
package com.hivetech.mvc.service; import com.hivetech.mvc.model.NewModel; import java.util.List; public interface INewService { List<NewModel> findAll(); }
[ "doanhieu.bl.hn@gmail.com" ]
doanhieu.bl.hn@gmail.com
8ef93cf9ee8e221384b4fe66883f189f008367e2
89cc88ef5f5707bfe89c0ae149e65df4e87c019b
/src/dspace-jspui/src/globus/java/org/dspace/app/webui/servlet/admin/GroupEditServlet.java
7e86badf38f6570d8035bfe40c86c93499f7a795
[ "Apache-2.0" ]
permissive
globus/globus-publish-dspace
239b7b05e93c664e48fbc2d50c2ccd11a9d17677
ed3cc2e6b522ecb60fb6a16ab6bf365690dce04e
refs/heads/master
2020-09-24T01:25:12.623716
2019-07-24T19:08:21
2019-07-24T19:08:21
65,923,406
1
3
NOASSERTION
2019-04-10T18:44:46
2016-08-17T16:22:51
Java
UTF-8
Java
false
false
17,797
java
/** * This file is a modified version of a DSpace file. * All modifications are subject to the following copyright and license. * * Copyright 2016 University of Chicago. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.app.webui.servlet.admin; import java.io.IOException; import java.sql.SQLException; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.dspace.app.webui.servlet.DSpaceServlet; import org.dspace.app.webui.util.JSPManager; import org.dspace.app.webui.util.UIUtil; import org.dspace.authorize.AuthorizeException; import org.dspace.authorize.AuthorizeManager; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.core.Constants; import org.dspace.core.Context; import org.dspace.eperson.EPerson; import org.dspace.eperson.Group; import org.dspace.globus.Globus; import org.dspace.globus.GlobusWebAppIntegration; import org.dspace.handle.HandleManager; /** * Servlet for editing groups * * @author dstuve * @version $Revision$ */ public class GroupEditServlet extends DSpaceServlet { /** log4j logger */ private static Logger log = Logger .getLogger(GroupEditServlet.class); protected void doDSGet(Context c, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { doDSPost(c, request, response); } protected void doDSPost(Context c, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { // Find out if there's a group parameter int groupID = UIUtil.getIntParameter(request, "group_id"); Group group = null; log.info("Group edit for " + groupID); // check if this is a Globus selection callback boolean globusCallback = (request.getParameter("globusCallback") != null); // see if this is coming from a community or collection link String collectionHandle = request.getParameter("collection_handle"); String communityHandle = request.getParameter("community_handle"); // added to skip this page boolean skipGroupsPage = (request.getParameter("skipGroupsPage") != null); String redirectURL = request.getRequestURL().toString(); if (redirectURL.endsWith(".jsp")){ redirectURL = redirectURL.substring(0, redirectURL.lastIndexOf('.')); } if (groupID >= 0) { group = Group.find(c, groupID); } // group is set if (group != null) { // is this user authorized to edit this group? AuthorizeManager.authorizeAction(c, group, Constants.ADD); boolean submit_edit = (request.getParameter("submit_edit") != null); boolean submit_group_update = (request.getParameter("submit_group_update") != null); boolean submit_group_delete = (request.getParameter("submit_group_delete") != null); boolean submit_confirm_delete = (request.getParameter("submit_confirm_delete") != null); boolean submit_cancel_delete = (request.getParameter("submit_cancel_delete") != null); if (globusCallback && !submit_group_update && !submit_group_delete){ // If its a Globus callback create the new placeholder Globus group // and add to members // We only allow a single group to be selected String [] globusGroupIds = request.getParameterValues("groupUuid[0]"); String [] globusGroupNames = request.getParameterValues("groupName[0]"); log.info("Globus groups selected: "+ globusGroupIds); // if its a globus callback we need to set current group members if (globusGroupIds != null){ Set<Integer>memberSet = new HashSet<Integer>(); Group[] membergroups = group.getMemberGroups(); log.info("Member groups: " + membergroups); // Delete existing members (we only allow a single globus group child) // process members, removing any that aren't in eperson_ids for (int x = 0; x < membergroups.length; x++){ Group g = membergroups[x]; group.removeMember(g); } for (int i=0; i < globusGroupIds.length; i++){ try{ String globusGroupName = Globus.getPrefixedGroupName(globusGroupIds[i], globusGroupNames[i]); Group newGroup = Group.findByName(c, globusGroupName); if (newGroup == null){ newGroup = Group.create(c); newGroup.setName(globusGroupName); newGroup.update(); } group.addMember(Group.find(c, newGroup.getID())); memberSet.add(newGroup.getID()); }catch (Exception ex){ log.error("Error adding Globus Group " + globusGroupIds[i]); } } } group.update(); request.setAttribute("group", group); request.setAttribute("members", group.getMembers()); request.setAttribute("membergroups", group.getMemberGroups()); request.setAttribute("collection_handle", collectionHandle); request.setAttribute("community_handle", communityHandle); if (skipGroupsPage){ String queryString = ""; Collection collection = null; if (collectionHandle != null) { collection = (Collection) HandleManager.resolveToObject(c, collectionHandle); if (collection != null) { queryString += "?action=" + EditCommunitiesServlet.START_EDIT_COLLECTION + "&collection_id=" + collection.getID(); } } Community community = null; if (communityHandle != null) { community = (Community) HandleManager.resolveToObject(c, communityHandle); if (community != null) { queryString += "?action=" + EditCommunitiesServlet.START_EDIT_COMMUNITY + "&community_id=" + community.getID(); } } response.sendRedirect(request.getContextPath() + "/tools/edit-communities" + queryString); } else { JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); } c.complete(); // just chosen a group to edit - get group and pass it to // group-edit.jsp }else if (submit_edit && !submit_group_update && !submit_group_delete) { request.setAttribute("group", group); request.setAttribute("members", group.getMembers()); request.setAttribute("membergroups", group.getMemberGroups()); request.setAttribute("collection_handle", collectionHandle); request.setAttribute("community_handle", communityHandle); if (skipGroupsPage){ response.sendRedirect(GlobusWebAppIntegration. getGroupSelectionUrl(groupID, redirectURL, collectionHandle, communityHandle, true)); } else { JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); } } // update the members of the group else if (submit_group_update) { // first off, did we change the group name? String newName = request.getParameter("group_name"); if (newName != null && !newName.equals(group.getName())) { group.setName(newName); group.update(); } int[] eperson_ids = UIUtil.getIntParameters(request, "eperson_id"); int[] group_ids = UIUtil.getIntParameters(request, "group_ids"); // now get members, and add new ones and remove missing ones EPerson[] members = group.getMembers(); Group[] membergroups = group.getMemberGroups(); if (eperson_ids != null) { // some epeople were listed, now make group's epeople match // given epeople Set memberSet = new HashSet(); Set epersonIDSet = new HashSet(); // add all members to a set for (int x = 0; x < members.length; x++) { Integer epersonID = Integer.valueOf(members[x].getID()); memberSet.add(epersonID); } // now all eperson_ids are put in a set for (int x = 0; x < eperson_ids.length; x++) { epersonIDSet.add(Integer.valueOf(eperson_ids[x])); } // process eperson_ids, adding those to group not already // members Iterator i = epersonIDSet.iterator(); while (i.hasNext()) { Integer currentID = (Integer) i.next(); if (!memberSet.contains(currentID)) { group.addMember(EPerson.find(c, currentID .intValue())); } } // process members, removing any that aren't in eperson_ids for (int x = 0; x < members.length; x++) { EPerson e = members[x]; if (!epersonIDSet.contains(Integer.valueOf(e.getID()))) { group.removeMember(e); } } } else { // no members found (ids == null), remove them all! for (int y = 0; y < members.length; y++) { group.removeMember(members[y]); } } if (group_ids != null) { // some groups were listed, now make group's member groups // match given group IDs Set memberSet = new HashSet(); Set groupIDSet = new HashSet(); // add all members to a set for (int x = 0; x < membergroups.length; x++) { Integer myID = Integer.valueOf(membergroups[x].getID()); memberSet.add(myID); } // now all eperson_ids are put in a set for (int x = 0; x < group_ids.length; x++) { groupIDSet.add(Integer.valueOf(group_ids[x])); } // process group_ids, adding those to group not already // members Iterator i = groupIDSet.iterator(); while (i.hasNext()) { Integer currentID = (Integer) i.next(); if (!memberSet.contains(currentID)) { group .addMember(Group.find(c, currentID .intValue())); } } // process members, removing any that aren't in eperson_ids for (int x = 0; x < membergroups.length; x++) { Group g = membergroups[x]; if (!groupIDSet.contains(Integer.valueOf(g.getID()))) { group.removeMember(g); } } } else { // no members found (ids == null), remove them all! for (int y = 0; y < membergroups.length; y++) { group.removeMember(membergroups[y]); } } group.update(); request.setAttribute("group", group); request.setAttribute("members", group.getMembers()); request.setAttribute("membergroups", group.getMemberGroups()); request.setAttribute("collection_handle", collectionHandle); request.setAttribute("community_handle", communityHandle); JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); c.complete(); } else if (submit_group_delete) { // direct to a confirmation step request.setAttribute("group", group); JSPManager.showJSP(request, response, "/dspace-admin/group-confirm-delete.jsp"); } else if (submit_confirm_delete) { // phony authorize, only admins can do this AuthorizeManager.authorizeAction(c, group, Constants.WRITE); // delete group, return to group-list.jsp group.delete(); showMainPage(c, request, response); } else if (submit_cancel_delete) { // show group list showMainPage(c, request, response); } else { // unknown action, show edit page request.setAttribute("group", group); request.setAttribute("members", group.getMembers()); request.setAttribute("membergroups", group.getMemberGroups()); request.setAttribute("collection_handle", collectionHandle); request.setAttribute("community_handle", communityHandle); if (skipGroupsPage){ response.sendRedirect(GlobusWebAppIntegration. getGroupSelectionUrl(groupID, redirectURL, collectionHandle, communityHandle, true)); } else { JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); } //JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); } } else // no group set { // want to add a group - create a blank one, and pass to // group_edit.jsp String button = UIUtil.getSubmitButton(request, "submit"); if (button.equals("submit_add")) { group = Group.create(c); group.setName("new group" + group.getID()); group.update(); request.setAttribute("group", group); request.setAttribute("members", group.getMembers()); request.setAttribute("membergroups", group.getMemberGroups()); request.setAttribute("collection_handle", collectionHandle); request.setAttribute("community_handle", communityHandle); JSPManager.showJSP(request, response, "/tools/group-edit.jsp"); c.complete(); } else { // show the main page (select groups) showMainPage(c, request, response); } } } private void showMainPage(Context c, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { Group[] groups = Group.findAll(c, Group.NAME); // if( groups == null ) { System.out.println("groups are null"); } // else System.out.println("# of groups: " + groups.length); request.setAttribute("groups", groups); JSPManager.showJSP(request, response, "/tools/group-list.jsp"); c.complete(); } }
[ "pruyne@uchicago.edu" ]
pruyne@uchicago.edu
57d9311d10e6923fe9521608d880f3bf210f4787
3a35bf2898bdf2d5af6bcf740b9c18f625062a30
/clean-bt-core/src/main/java/me/zzhen/bt/bencode/DecoderException.java
9c5367f0718093edeb7b48d694a18646bb005948
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
zhenzou/clean-bt
55ff9104fe63a937c130522e470d6b73b864bce4
2cad5d2b76e9fedf13932c58e080e8e041037b5a
refs/heads/master
2020-04-11T22:34:06.558340
2018-12-17T14:11:12
2018-12-17T14:11:12
162,140,610
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package me.zzhen.bt.bencode; /** * @author zzhen zzzhen1994@gmail.com * Create Time: 2016/10/16. */ public class DecoderException extends RuntimeException { public DecoderException() { super("not a legal ben coding input"); } public DecoderException(String msg) { super(msg); } }
[ "zzzhen1994@gmail.com" ]
zzzhen1994@gmail.com
bef496fd7ab0c488189df60c2eb07ad248afca05
f34e4912ff3eae96fc2df4632d92f91036cd52e2
/src/test/java/com/nbcuni/test/nbcidx/member/logout/errorcodes/TC4326_MemberLogout_Error_401.java
eb31f526f25e47b6fb6426752f20dbb100f2cf05
[]
no_license
RaghuRashmi/test-project
08593431ed0f7a557b4c557af296daf12236bed5
89fa25b46919a272babace4d3f001a3616b9b3cd
refs/heads/master
2021-01-15T14:11:09.007512
2014-09-26T22:03:33
2014-09-26T22:03:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,477
java
package com.nbcuni.test.nbcidx.member.logout.errorcodes; import static org.testng.AssertJUnit.fail; import java.net.Proxy; import org.testng.Reporter; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import com.mongodb.DBObject; import com.nbcuni.test.nbcidx.AppLib; import com.nbcuni.test.nbcidx.MemberAPIs; import com.nbcuni.test.webdriver.API; import com.nbcuni.test.webdriver.CustomWebDriver; /************************************************************************** * NBCIDX Member.Logout API - TC4326_MemberLogout_Error_401. Copyright. * * @author Rashmi Sale * @version 1.0 Date: Aug 18, 2014 **************************************************************************/ public class TC4326_MemberLogout_Error_401 { private CustomWebDriver cs; private AppLib al; private API api; private MemberAPIs ma; private Proxy proxy=null; /** * Instantiate the TestNG Before Class Method. * * @param sEnv - environment * @throws Exception - error */ @BeforeClass(alwaysRun = true) @Parameters("Environment") public void startEnvironment(String sEnv) { try { cs = null; al = new AppLib(cs); al.setEnvironmentInfo(sEnv); proxy = al.getHttpProxy(); api = new API(); api.setProxy(proxy); ma = new MemberAPIs(); } catch (Exception e) { fail(e.toString()); } } /** * Instantiate the TestNG Test Method. * * @throws Exception - error */ @Test(groups = {"full"}) public void memberLogout_error401() throws Exception { String name=TC4325_MemberLogout_Error_400.randomMemberName; //Generate the Content Type for POST. String myContentType = "application/x-www-form-urlencoded"; Reporter.log(""); Reporter.log("1) Member.logout with invalid API_KEY : "); Reporter.log(""); Reporter.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MEMBER.LOGOUT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Reporter.log("Validating API call Response"); Reporter.log(""); //Generate the API call for member.put. String apicall = al.getApiURL()+"/member/logout?API_KEY=abc#&BRAND_ID="+al.getSurfBrandId(); String myJsonBody ="id="+name; //Generate the JSON Body in proper format. Reporter.log("POST Body= " +myJsonBody); //Send member.put POST Request. int myResponseCode = al.postHTTPReponseCode(apicall, myJsonBody, myContentType); if(myResponseCode == 401) Reporter.log("Member.logout Response code ="+myResponseCode); else fail("Member.logout Response code ="+myResponseCode); Reporter.log("-- X --"); Reporter.log(""); Reporter.log("2) Member.logout with empty API_KEY : "); Reporter.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MEMBER.LOGOUT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Reporter.log("Validating API call Response"); Reporter.log(""); apicall = al.getApiURL()+"/member/logout?API_KEY=&BRAND_ID="+al.getSurfBrandId(); myJsonBody ="id="+name; //Generate the JSON Body in proper format. Reporter.log("POST Body= " +myJsonBody); //Send member.put POST Request. myResponseCode = al.postHTTPReponseCode(apicall, myJsonBody, myContentType); if(myResponseCode == 401) Reporter.log("Member.logout Response code ="+myResponseCode); else fail("Member.logout Response code ="+myResponseCode); Reporter.log("-- X --"); Reporter.log(""); } }
[ "206424426@5TS206424426L7.tfayd.com" ]
206424426@5TS206424426L7.tfayd.com
23328fe75a1dc535f6f1dc1814b5bf919b40bae7
7d7d6b79e9c43fe41222b52cc87f71f901f6da33
/src/main/java/in/nareshit/raghu/SpringBoot2WebMvcCrudExApplication.java
db6f87351460f01c16b12843fd5943191ffbb1f6
[]
no_license
javabyraghu/SpringBoot2WebMvcCrudEx
98c943d9b64bc05b7974726cf4e8df5fb3e86b28
d2dedfa9d529f1dc512fa357c6b6b367b6a5461c
refs/heads/main
2023-08-30T15:41:58.617578
2021-10-11T04:13:01
2021-10-11T04:13:01
415,775,117
1
2
null
null
null
null
UTF-8
Java
false
false
344
java
package in.nareshit.raghu; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBoot2WebMvcCrudExApplication { public static void main(String[] args) { SpringApplication.run(SpringBoot2WebMvcCrudExApplication.class, args); } }
[ "sample2025nit@gmail.com" ]
sample2025nit@gmail.com
d76f7a2ba1979f8803a57d43a82ff94e6a804df1
9e3298ade03e047bfa7cbf16ea7ee0ea59f438d9
/java/phoenix/jpetstore/service/AccountService.java
4f201ba29f1297426f5e06bf0e9bfa3f091a5566
[]
no_license
z2sonee/spring-project-1
7181de3ee8c690b8ce9f47badab1a15894af621f
8473d04ec49422cd312612f14096a082f381d05f
refs/heads/master
2022-12-22T02:55:27.620131
2021-02-22T07:28:59
2021-02-22T07:28:59
205,644,707
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package phoenix.jpetstore.service; import phoenix.jpetstore.domain.Account; public interface AccountService { void insert(int userId, String email, String userName, String address, String phone, String grade, int point, String loginId, String password); int loginCheck(Account account); }
[ "jisun4789@naver.com" ]
jisun4789@naver.com
7ab0d5113867d709b06f5b53972975096f7fbb07
9939b8ea54f538fc9a0406bf7ae7aca6b467a3a0
/src/test/java/io/github/jhipster/application/web/rest/JobResourceIntTest.java
20e61bf1a303f04734df87c771b5861569f21335
[]
no_license
irakov/jhipster-sample-application
7084c68243eb42aa0de43e810ed9acba4f465fcc
98ee556286e3564c06a19aa5aea309b5322595b5
refs/heads/master
2020-04-20T10:27:06.296778
2019-02-02T03:53:29
2019-02-02T03:53:29
168,790,297
1
0
null
2019-02-02T03:53:30
2019-02-02T03:31:12
Java
UTF-8
Java
false
false
11,636
java
package io.github.jhipster.application.web.rest; import io.github.jhipster.application.JhipsterIgorApplicationApp; import io.github.jhipster.application.domain.Job; import io.github.jhipster.application.repository.JobRepository; import io.github.jhipster.application.web.rest.errors.ExceptionTranslator; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.Validator; import javax.persistence.EntityManager; import java.util.ArrayList; import java.util.List; import static io.github.jhipster.application.web.rest.TestUtil.createFormattingConversionService; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the JobResource REST controller. * * @see JobResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterIgorApplicationApp.class) public class JobResourceIntTest { private static final String DEFAULT_JOB_TITLE = "AAAAAAAAAA"; private static final String UPDATED_JOB_TITLE = "BBBBBBBBBB"; private static final Long DEFAULT_MIN_SALARY = 1L; private static final Long UPDATED_MIN_SALARY = 2L; private static final Long DEFAULT_MAX_SALARY = 1L; private static final Long UPDATED_MAX_SALARY = 2L; @Autowired private JobRepository jobRepository; @Mock private JobRepository jobRepositoryMock; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private EntityManager em; @Autowired private Validator validator; private MockMvc restJobMockMvc; private Job job; @Before public void setup() { MockitoAnnotations.initMocks(this); final JobResource jobResource = new JobResource(jobRepository); this.restJobMockMvc = MockMvcBuilders.standaloneSetup(jobResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter) .setValidator(validator).build(); } /** * Create an entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Job createEntity(EntityManager em) { Job job = new Job() .jobTitle(DEFAULT_JOB_TITLE) .minSalary(DEFAULT_MIN_SALARY) .maxSalary(DEFAULT_MAX_SALARY); return job; } @Before public void initTest() { job = createEntity(em); } @Test @Transactional public void createJob() throws Exception { int databaseSizeBeforeCreate = jobRepository.findAll().size(); // Create the Job restJobMockMvc.perform(post("/api/jobs") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(job))) .andExpect(status().isCreated()); // Validate the Job in the database List<Job> jobList = jobRepository.findAll(); assertThat(jobList).hasSize(databaseSizeBeforeCreate + 1); Job testJob = jobList.get(jobList.size() - 1); assertThat(testJob.getJobTitle()).isEqualTo(DEFAULT_JOB_TITLE); assertThat(testJob.getMinSalary()).isEqualTo(DEFAULT_MIN_SALARY); assertThat(testJob.getMaxSalary()).isEqualTo(DEFAULT_MAX_SALARY); } @Test @Transactional public void createJobWithExistingId() throws Exception { int databaseSizeBeforeCreate = jobRepository.findAll().size(); // Create the Job with an existing ID job.setId(1L); // An entity with an existing ID cannot be created, so this API call must fail restJobMockMvc.perform(post("/api/jobs") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(job))) .andExpect(status().isBadRequest()); // Validate the Job in the database List<Job> jobList = jobRepository.findAll(); assertThat(jobList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void getAllJobs() throws Exception { // Initialize the database jobRepository.saveAndFlush(job); // Get all the jobList restJobMockMvc.perform(get("/api/jobs?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(job.getId().intValue()))) .andExpect(jsonPath("$.[*].jobTitle").value(hasItem(DEFAULT_JOB_TITLE.toString()))) .andExpect(jsonPath("$.[*].minSalary").value(hasItem(DEFAULT_MIN_SALARY.intValue()))) .andExpect(jsonPath("$.[*].maxSalary").value(hasItem(DEFAULT_MAX_SALARY.intValue()))); } @SuppressWarnings({"unchecked"}) public void getAllJobsWithEagerRelationshipsIsEnabled() throws Exception { JobResource jobResource = new JobResource(jobRepositoryMock); when(jobRepositoryMock.findAllWithEagerRelationships(any())).thenReturn(new PageImpl(new ArrayList<>())); MockMvc restJobMockMvc = MockMvcBuilders.standaloneSetup(jobResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter).build(); restJobMockMvc.perform(get("/api/jobs?eagerload=true")) .andExpect(status().isOk()); verify(jobRepositoryMock, times(1)).findAllWithEagerRelationships(any()); } @SuppressWarnings({"unchecked"}) public void getAllJobsWithEagerRelationshipsIsNotEnabled() throws Exception { JobResource jobResource = new JobResource(jobRepositoryMock); when(jobRepositoryMock.findAllWithEagerRelationships(any())).thenReturn(new PageImpl(new ArrayList<>())); MockMvc restJobMockMvc = MockMvcBuilders.standaloneSetup(jobResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter).build(); restJobMockMvc.perform(get("/api/jobs?eagerload=true")) .andExpect(status().isOk()); verify(jobRepositoryMock, times(1)).findAllWithEagerRelationships(any()); } @Test @Transactional public void getJob() throws Exception { // Initialize the database jobRepository.saveAndFlush(job); // Get the job restJobMockMvc.perform(get("/api/jobs/{id}", job.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.id").value(job.getId().intValue())) .andExpect(jsonPath("$.jobTitle").value(DEFAULT_JOB_TITLE.toString())) .andExpect(jsonPath("$.minSalary").value(DEFAULT_MIN_SALARY.intValue())) .andExpect(jsonPath("$.maxSalary").value(DEFAULT_MAX_SALARY.intValue())); } @Test @Transactional public void getNonExistingJob() throws Exception { // Get the job restJobMockMvc.perform(get("/api/jobs/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateJob() throws Exception { // Initialize the database jobRepository.saveAndFlush(job); int databaseSizeBeforeUpdate = jobRepository.findAll().size(); // Update the job Job updatedJob = jobRepository.findById(job.getId()).get(); // Disconnect from session so that the updates on updatedJob are not directly saved in db em.detach(updatedJob); updatedJob .jobTitle(UPDATED_JOB_TITLE) .minSalary(UPDATED_MIN_SALARY) .maxSalary(UPDATED_MAX_SALARY); restJobMockMvc.perform(put("/api/jobs") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(updatedJob))) .andExpect(status().isOk()); // Validate the Job in the database List<Job> jobList = jobRepository.findAll(); assertThat(jobList).hasSize(databaseSizeBeforeUpdate); Job testJob = jobList.get(jobList.size() - 1); assertThat(testJob.getJobTitle()).isEqualTo(UPDATED_JOB_TITLE); assertThat(testJob.getMinSalary()).isEqualTo(UPDATED_MIN_SALARY); assertThat(testJob.getMaxSalary()).isEqualTo(UPDATED_MAX_SALARY); } @Test @Transactional public void updateNonExistingJob() throws Exception { int databaseSizeBeforeUpdate = jobRepository.findAll().size(); // Create the Job // If the entity doesn't have an ID, it will throw BadRequestAlertException restJobMockMvc.perform(put("/api/jobs") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(job))) .andExpect(status().isBadRequest()); // Validate the Job in the database List<Job> jobList = jobRepository.findAll(); assertThat(jobList).hasSize(databaseSizeBeforeUpdate); } @Test @Transactional public void deleteJob() throws Exception { // Initialize the database jobRepository.saveAndFlush(job); int databaseSizeBeforeDelete = jobRepository.findAll().size(); // Delete the job restJobMockMvc.perform(delete("/api/jobs/{id}", job.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<Job> jobList = jobRepository.findAll(); assertThat(jobList).hasSize(databaseSizeBeforeDelete - 1); } @Test @Transactional public void equalsVerifier() throws Exception { TestUtil.equalsVerifier(Job.class); Job job1 = new Job(); job1.setId(1L); Job job2 = new Job(); job2.setId(job1.getId()); assertThat(job1).isEqualTo(job2); job2.setId(2L); assertThat(job1).isNotEqualTo(job2); job1.setId(null); assertThat(job1).isNotEqualTo(job2); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d332782a0f1520b93ec5e848fda32f8f9b01c588
d1cb9aa8bd03ae5fcdcf3c7d914c4286c59a2703
/src/polymorphism/AbstractClass/Vehicle.java
21cde97931dc40593c54a15cbda1b901d10ab48a
[]
no_license
OrangIPA/tugaspolymorphism
771bc359cf9f4b7dfa93e172b205b1833aefb325
207ae232c2cd8417558e188cca81bfe190138b9f
refs/heads/master
2023-05-02T23:32:31.640693
2021-05-28T15:45:03
2021-05-28T15:45:03
371,747,024
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package polymorphism.AbstractClass; public abstract class Vehicle{ public void function(){ System.out.println("Transportation tools"); } abstract public void fuel(); public abstract void walk(); }
[ "alanabahana102@gmail.com" ]
alanabahana102@gmail.com
e7ad4f7dbbe1c3dfabd1aec384eea542edd24092
1ab25df49ed381fbadb8f6a708938afb18562258
/src/week4/Week4.java
918bc588df01ce729cbacdd2218f4c2aac6f7b61
[]
no_license
AshleyCS101/IntermediateJavaSp21
5de16bb5a32133ddcc429982310340fe9aa5a5af
2360f6de80b1b1000ac2089df33fb9a58b8524ce
refs/heads/main
2023-05-15T10:22:19.788876
2021-06-05T18:58:31
2021-06-05T18:58:31
336,507,164
0
0
null
null
null
null
UTF-8
Java
false
false
1,933
java
package week4; public class Week4 { public static void main(String[] args) { Dog myDog = new Dog("Rascal", 5); // myDog stores an object of type Dog, with name "Rascal" and age 5 Dog dog1 = new Dog("Dollie", 9); // dog1 stores an object of type Dog, with name "Dollie" and age 9 // call methods on an object with '.' dot operator dog1.bark(); // different objects can store different data System.out.println(myDog.getName()); // prints "Rascal" System.out.println(dog1.getName()); // prints "Dollie" // Changing an object's data System.out.println(dog1.getName()); // prints "Dollie" dog1.setName("Doll"); // now dog1 has the name "Doll" System.out.println(dog1.getName()); // prints "Doll" // ------------------------------------------------------------------------------------ // Warm-up: what's the output? // System.out.println(getBirthdayMessage("Julie", 3)); // variable scope: exists between closest enclosing brackets, after initialized } public static String getBirthdayMessage(String name, int age) { return "Happy " + getOrdinalForm(age) + " birthday, " + name + "!"; } // returns a String representing the ordinal form of a given int private static String getOrdinalForm(int n) { String suffix = "th"; int lastTwo = n %100; if(lastTwo <10 || lastTwo >=20) { int lastDigit = n %10; if(lastDigit == 1) { suffix = "st"; } else if (lastDigit == 2) { suffix = "nd"; } else if (lastDigit == 3) { suffix = "rd"; } } return n + suffix; } }
[ "Ashley Luty@LAPTOP-GS8OU5DR.home" ]
Ashley Luty@LAPTOP-GS8OU5DR.home
c89889c544c3b4d875ba2f06607fb459ebc36b91
086f2d1f7e4d39b4a817a34ae81e6e5422fba4c3
/library/src/main/java/com/tylersuehr/chips/data/ListChipDataSource.java
c83ae70076d3375dc678bc57a61230fdfd16a816
[ "MIT" ]
permissive
MyLadder/chips-input-layout
8a9ffc5ec95d8cacfd69d3efac85fe520d0a3877
9a3f86f1269dee69bc46dbe99b6f07cab5571862
refs/heads/master
2021-07-16T08:56:42.624083
2017-10-18T23:15:49
2017-10-18T23:15:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,563
java
package com.tylersuehr.chips.data; import android.support.annotation.VisibleForTesting; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Copyright © 2017 Tyler Suehr * * Subclass of {@link ObservableChipDataSource} that stores chips using an {@link ArrayList}. * * @author Tyler Suehr * @version 1.0 */ public class ListChipDataSource extends ObservableChipDataSource { /* Stores all the original chips */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) List<Chip> originalChips; /* Stores all the filtered chips, that are not selected by the user */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) List<Chip> filteredChips; /* Stores all the selected chips, selected by the user */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) List<Chip> selectedChips; /* Construct with all empty lists */ public ListChipDataSource() { this.originalChips = new ArrayList<>(); this.filteredChips = new ArrayList<>(); this.selectedChips = new ArrayList<>(); } @Override public List<Chip> getSelectedChips() { return selectedChips; } @Override public List<Chip> getFilteredChips() { return filteredChips; } @Override public List<Chip> getOriginalChips() { return originalChips; } @Override public Chip getFilteredChip(int position) { return filteredChips.get(position); } @Override public Chip getSelectedChip(int position) { return selectedChips.get(position); } @Override public void setFilterableChips(List<? extends Chip> chips) { if (chips == null) { throw new NullPointerException("Chips cannot be null!"); } // Instantiate our chip lists with the size of the given list this.originalChips = new ArrayList<>(chips.size()); this.filteredChips = new ArrayList<>(chips.size()); this.selectedChips = new ArrayList<>(chips.size()); // Only copy the data from our chips into the original and filtered lists for (Chip chip : chips) { chip.setFilterable(true); this.originalChips.add(chip); this.filteredChips.add(chip); } // Sort the lists Collections.sort(originalChips, Chip.getComparator()); Collections.sort(filteredChips, Chip.getComparator()); // Tell our observers! notifyDataSourceChanged(); } @Override public void addFilteredChip(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } chip.setFilterable(true); this.originalChips.add(chip); this.filteredChips.add(chip); notifyDataSourceChanged(); } @Override public void addSelectedChip(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } this.selectedChips.add(chip); notifyDataSourceChanged(); notifyChipSelected(chip); } @Override public void takeChip(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } // Check if chip is filterable if (chip.isFilterable()) { // Check if chip is actually in the filtered list if (filteredChips.contains(chip)) { this.originalChips.remove(chip); this.filteredChips.remove(chip); this.selectedChips.add(chip); } else { throw new IllegalArgumentException("Chip is not in filtered chip list!"); } } else { throw new IllegalArgumentException("Cannot take a non-filterable chip!"); } notifyDataSourceChanged(); notifyChipSelected(chip); } @Override public void takeChip(int position) { final Chip foundChip = filteredChips.get(position); if (foundChip == null) { throw new NullPointerException("Chip cannot be null; not found in filtered chip list!"); } // Check if chip is filterable if (foundChip.isFilterable()) { // Since the child isn't null, we know it's in the filtered list this.originalChips.remove(foundChip); this.filteredChips.remove(foundChip); this.selectedChips.add(foundChip); } else { // Just add it to the selected list only this.selectedChips.add(foundChip); } notifyDataSourceChanged(); notifyChipSelected(foundChip); } @Override public void replaceChip(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } // Check if chip is actually selected if (selectedChips.contains(chip)) { this.selectedChips.remove(chip); // Check if the chip is filterable if (chip.isFilterable()) { this.filteredChips.add(chip); this.originalChips.add(chip); } notifyDataSourceChanged(); notifyChipUnselected(chip); } else { throw new IllegalArgumentException("Chip is not in selected chip list!"); } } @Override public void replaceChip(int position) { final Chip foundChip = selectedChips.get(position); if (foundChip == null) { throw new NullPointerException("Chip cannot be null; not found in selected chip list!"); } // Since not null, we know the chip is selected this.selectedChips.remove(foundChip); // Check if the chip is filterable if (foundChip.isFilterable()) { this.filteredChips.add(foundChip); this.originalChips.add(foundChip); } notifyDataSourceChanged(); notifyChipUnselected(foundChip); } @Override public void clearFilteredChips() { this.originalChips.clear(); this.filteredChips.clear(); notifyDataSourceChanged(); } @Override public void clearSelectedChips() { // Since we want to tell observers that chips have been unselected, // we need to store a clone of the selected list of chips final List<Chip> clone = new ArrayList<>(selectedChips); this.selectedChips.clear(); // Let's notify our change observers first (so internal components can // instantly get notified of the data source change notifyDataSourceChanged(); // Now let's tell our selection observers! for (Chip chip : clone) { notifyChipUnselected(chip); } } @Override public boolean existsInFiltered(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } return filteredChips.contains(chip); } @Override public boolean existsInSelected(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } return selectedChips.contains(chip); } @Override public boolean existsInDataSource(Chip chip) { if (chip == null) { throw new NullPointerException("Chip cannot be null!"); } return (originalChips.contains(chip) || filteredChips.contains(chip) || selectedChips.contains(chip)); } }
[ "tylersuehr@gmail.com" ]
tylersuehr@gmail.com
a9e9be20dc56d6045e197562d8f93681e1989677
dac16792b6ecc013ba3ddbbb229af9df3c48c06a
/Team9_AndriodCA/Team9_AndriodCA/app/src/main/java/iss/workshop/team9_andriodca/SoundPlayer.java
f0296ec52c806c97460f432822abbce85864cf80
[ "MIT" ]
permissive
chanjianliu/picture_matching_android_app
500868362aabbf03dbd98193ca1e0f34ffa310d0
e16ace583de49b5443e30b928a1213669edf67e6
refs/heads/main
2023-02-22T00:48:12.745358
2021-01-23T09:40:22
2021-01-23T09:40:22
332,173,194
1
0
null
null
null
null
UTF-8
Java
false
false
2,019
java
package iss.workshop.team9_andriodca; import android.content.Context; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.SoundPool; import android.os.Build; public class SoundPlayer { private SoundPool soundPool; private int clickSound; private int clickSound1; private int clickSound2; private int clickSound3; private int clapping; private int poor; public SoundPlayer(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //if phone uses Lollipop and above, use SoundPool.Builder AudioAttributes audioAttr = new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_GAME) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .build(); soundPool = new SoundPool.Builder().setAudioAttributes(audioAttr).setMaxStreams(2).build(); } else { soundPool = new SoundPool(2, AudioManager.STREAM_MUSIC, 0); } clickSound = soundPool.load(context, R.raw.match, 1); clickSound1 = soundPool.load(context, R.raw.lose, 1); clickSound2 = soundPool.load(context, R.raw.complete, 2); clickSound3 = soundPool.load(context, R.raw.click1, 2); clapping = soundPool.load(context, R.raw.clapping, 2); poor = soundPool.load(context, R.raw.poorgrade, 2); } public void match(){ soundPool.play(clickSound,1.0f,1.0f,1,0,1.0f); } public void noMatch(){ soundPool.play(clickSound1,1.0f,1.0f,1,0,1.0f); } public void complete(){ soundPool.play(clickSound2,1.0f,1.0f,1,0,1.0f); } public void click(){ soundPool.play(clickSound3,1.0f,1.0f,1,0,1.0f); } public void clapping(){ soundPool.play(clapping, 1.0f,1.0f,1,0,1.0f); } public void poorGrade(){ soundPool.play(poor, 1.0f,1.0f,1,0,1.0f); } }
[ "cjlspk3@hotmail.com" ]
cjlspk3@hotmail.com
d574ef4eda19607085c1c788e5d3f382d44931c1
f5668583f85ffb514e62389ee2a8fcfb39a20035
/src/main/java/ru/vez/Main.java
b6634bb31fb0cb3084dd20ebca8b6759ced43a8a
[]
no_license
vzateychuk/pdf-itext
c9db6e1502156937bb3b987cc7829669bb354442
c71e22750511768a95a5c7ac5e6e603422d01d0a
refs/heads/main
2023-01-22T15:21:44.051522
2020-12-08T17:40:45
2020-12-08T17:40:45
318,852,342
0
0
null
null
null
null
UTF-8
Java
false
false
2,266
java
package ru.vez; import com.itextpdf.kernel.colors.Color; import com.itextpdf.kernel.colors.ColorConstants; import com.itextpdf.kernel.font.PdfFont; import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfPage; import com.itextpdf.kernel.pdf.PdfReader; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.kernel.pdf.canvas.PdfCanvas; import java.io.IOException; import java.util.List; public class Main { private static final String SRC_FILE = "/home/osboxes/tmp/page.pdf"; private static final String DEST_FILE = "/home/osboxes/tmp/merged.pdf"; private static final String STAMP_IMG = "/home/osboxes/tmp/stamp.png"; public static void main(String[] args) throws Exception { manipulatePdf(SRC_FILE, DEST_FILE, STAMP_IMG); } public static void manipulatePdf(String src, String dest, String imgSrc) throws Exception { PdfDocument pdfDoc = new PdfDocument(new PdfReader(src), new PdfWriter(dest)); PdfPage page = pdfDoc.getFirstPage(); PdfCanvas canvas = drawCanvas(page, List.of("Большой директор:", "Владимир Затейчук")); pdfDoc.close(); canvas.release(); } private static PdfCanvas drawCanvas(PdfPage page, List<String> strings) throws IOException { PdfCanvas canvas = new PdfCanvas(page); Color blueColor = ColorConstants.BLUE; canvas.setLineWidth(5f).setStrokeColor(blueColor).setColor(blueColor, true); final float leftX = 20f; final float leftY = 20f; canvas.moveTo(leftX,leftY) .lineTo(150f, leftY) .lineTo(150f, 80f) .lineTo(leftX, 80f) .lineTo(leftX, leftY).stroke(); canvas.beginText() .setFontAndSize(getPdfFont(), 12) .setLeading(12*1.2f) .moveText(leftX+5f, leftY+50f); for (String string : strings) { canvas.newlineShowText(string); } return canvas.endText(); } private static PdfFont getPdfFont() throws IOException { return PdfFontFactory.createFont( "/home/osboxes/tmp/freesans.otf", "CP1251", true ); } }
[ "vzateychuk@iqubecompany.com" ]
vzateychuk@iqubecompany.com
fc1f8909735b00e02b0433a9e12e7f117fcac6f3
de39eacf5996fa9548fa4ed56cd7e4c7ce0488c1
/jyf_admin/src/main/java/cn/mixpay/admin/action/merchant/MerchantAppAction.java
2547191bf1bd41288a18da93d9f3b4b4332c96a4
[]
no_license
likunpeng06/juyifu
88e8c2c35ec4bc1b537a9ec9f24bd639d34c32f5
a9b8cf60870df18f35aa01b3f226a3a9227114ce
refs/heads/master
2020-12-24T06:14:52.553308
2013-12-19T07:31:41
2013-12-19T07:31:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,418
java
package cn.mixpay.admin.action.merchant; import cn.mixpay.admin.action.BaseAction; import cn.mixpay.admin.service.merchant.MerchantAppService; import cn.mixpay.admin.service.merchant.MerchantService; import cn.mixpay.admin.utils.PageUtils; import cn.mixpay.core.entity.merchant.Merchant; import cn.mixpay.core.entity.merchant.MerchantApp; import cn.mixpay.core.status.EnableDisableStatus; import org.apache.struts2.ServletActionContext; import org.hibernate.criterion.Order; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.List; /** * Created by qatang on 13-12-11. */ public class MerchantAppAction extends BaseAction { private MerchantService merchantService; private MerchantAppService merchantAppService; private Merchant merchant; private MerchantApp merchantApp; private List<MerchantApp> merchantAppList; private Integer statusValue; public String handle() { logger.info("进入查询商户app"); HttpServletRequest request = ServletActionContext.getRequest(); merchant = merchantService.findById(merchantApp.getMerchantId()); merchantAppList = merchantAppService.findByExample(merchantApp, this.getPageBean(), Order.desc("id")); this.setPageString(PageUtils.getPageString(request, merchantAppService.getPageBean(merchantApp, this.getPageBean()))); logger.info("查询商户app结束"); return "list"; } public String manage() { logger.info("进入更新商户app信息"); if (merchantApp == null) { this.errorForward(FAILURE, "非法请求"); } this.emptyCheck(merchantApp.getName(), FAILURE, "商户app姓名不能为空"); if (merchantApp.getId() == null) { // 通过检验,开始添加商户app merchantApp.setStatus(EnableDisableStatus.get(statusValue)); merchantApp.setCreatedTime(new Date()); merchantApp.setUpdatedTime(merchantApp.getCreatedTime()); merchantAppService.save(merchantApp); } else { MerchantApp updateMerchantApp = merchantAppService.findById(merchantApp.getId()); // 通过检验,开始修改商户app updateMerchantApp.setName(merchantApp.getName()); updateMerchantApp.setStatus(EnableDisableStatus.get(statusValue)); updateMerchantApp.setUpdatedTime(new Date()); merchantAppService.update(updateMerchantApp); } super.setSuccessMessage("更新成功"); super.setForwardUrl("/merchant/merchantApp.do?merchantApp.merchantId=" + merchantApp.getMerchantId()); logger.info("更新商户app信息结束"); return "success"; } /** * 转向添加/修改商户app */ public String input() { if (merchantApp == null) { merchantApp = new MerchantApp(); } if (merchantApp.getId() != null) { merchantApp = merchantAppService.findById(merchantApp.getId()); statusValue = merchantApp.getStatus().getValue(); if (merchantApp == null) { this.errorForward(FAILURE, "要编辑的商户app不存在"); } } return "inputForm"; } public String view() { logger.info("进入查看商户app详情"); this.emptyCheck(merchantApp, FAILURE, "非法请求"); this.emptyCheck(merchantApp.getId(), FAILURE, "非法请求"); merchantApp = merchantAppService.findById(merchantApp.getId()); merchant = merchantService.findById(merchantApp.getMerchantId()); this.emptyCheck(merchantApp, FAILURE, "商户app不存在"); logger.info("查看商户app详情结束"); return "view"; } public String del() { merchantApp = merchantAppService.findById(merchantApp.getId()); merchantAppService.delete(merchantApp.getId()); Long merchantId = merchantApp.getMerchantId(); merchantApp = new MerchantApp(); merchantApp.setMerchantId(merchantId); return handle(); } public List<EnableDisableStatus> getEnableDisableStatusList() { return EnableDisableStatus.list(); } public MerchantService getMerchantService() { return merchantService; } public void setMerchantService(MerchantService merchantService) { this.merchantService = merchantService; } public Merchant getMerchant() { return merchant; } public void setMerchant(Merchant merchant) { this.merchant = merchant; } public Integer getStatusValue() { return statusValue; } public void setStatusValue(Integer statusValue) { this.statusValue = statusValue; } public MerchantAppService getMerchantAppService() { return merchantAppService; } public void setMerchantAppService(MerchantAppService merchantAppService) { this.merchantAppService = merchantAppService; } public MerchantApp getMerchantApp() { return merchantApp; } public void setMerchantApp(MerchantApp merchantApp) { this.merchantApp = merchantApp; } public List<MerchantApp> getMerchantAppList() { return merchantAppList; } public void setMerchantAppList(List<MerchantApp> merchantAppList) { this.merchantAppList = merchantAppList; } }
[ "qatang@gmail.com" ]
qatang@gmail.com
0930adb53e13ab8ae91ab753ad6d8f3054586085
8a303cb63a68a5fa299b770988203d44d09eca2d
/data-prep/dataprep-simple/src/test/java/de/hpi/isg/dataprep/preparators/ChangeTableEncodingTest.java
2b19d96844466db6742a8ff3fb1a8e9d625af384
[]
no_license
Blaidd-Drwg/data-knoller
57f1680fafae4af134aa2ce6c924da23b35efed4
88c0f3a44a85d8c5cadc2e3aa7da1e0b962f6966
refs/heads/master
2020-04-06T14:16:14.608562
2019-03-15T17:53:08
2019-03-15T18:01:39
157,534,564
1
0
null
2018-11-14T10:51:35
2018-11-14T10:51:34
null
UTF-8
Java
false
false
7,758
java
package de.hpi.isg.dataprep.preparators; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.logging.Level; import java.util.logging.Logger; import de.hpi.isg.dataprep.DialectBuilder; import de.hpi.isg.dataprep.components.Pipeline; import de.hpi.isg.dataprep.components.Preparation; import de.hpi.isg.dataprep.context.DataContext; import de.hpi.isg.dataprep.load.FlatFileDataLoader; import de.hpi.isg.dataprep.load.SparkDataLoader; import de.hpi.isg.dataprep.model.dialects.FileLoadDialect; import de.hpi.isg.dataprep.model.target.system.AbstractPreparator; import de.hpi.isg.dataprep.preparators.define.ChangeTableEncoding; import de.hpi.isg.dataprep.preparators.implementation.EncodingUnmixer; public class ChangeTableEncodingTest { private static final String CSV_DIR = "./src/test/resources/encoding/"; private static final String NO_ERRORS_URL = CSV_DIR + "no_encoding_error.csv"; private static final String IN_CSV_URL = CSV_DIR + "error_character.csv"; private static final String ERRORS_URL = CSV_DIR + "encoding_error.csv"; private static final String ERRORS_AND_IN_CSV_URL = CSV_DIR + "both_error_and_error_character.csv"; private static final String MIXED_CSV_URL = CSV_DIR + "telefonbuchalpha_merged.csv"; private static final String SINGLE_LINE_URL = CSV_DIR + "one_line.csv"; private static final String NON_EXISTENT_URL = CSV_DIR + "list_of_all_the_friends_i_have.csv"; private static final String ENCODING = "UTF-8"; private static DialectBuilder dialectBuilder; @BeforeClass public static void setUp() { Logger.getLogger("org").setLevel(Level.OFF); Logger.getLogger("akka").setLevel(Level.OFF); dialectBuilder = new DialectBuilder() .hasHeader(true) .inferSchema(true) .encoding(ENCODING); } /* * calApplicability tests */ @Test public void testNoErrors() { DataContext context = load(NO_ERRORS_URL); Assert.assertEquals(0, calApplicability(context), 0); } @Test public void testErrorCharsAlreadyInCSV() { DataContext context = load(IN_CSV_URL); Assert.assertEquals(0, calApplicability(context), 0); } @Test public void testWithErrors() { DataContext context = load(ERRORS_URL); Assert.assertTrue(calApplicability(context) > 0); } @Test public void testErrorsAndAlreadyInCSV() { DataContext context = load(ERRORS_AND_IN_CSV_URL); Assert.assertTrue(calApplicability(context) > 0); } @Test public void testMixedCSV() { DataContext context = load(MIXED_CSV_URL); Assert.assertTrue(calApplicability(context) > 0); } /* * preparator tests */ @Test public void testGetCSVPath() { DataContext context = load(MIXED_CSV_URL); Assert.assertEquals(MIXED_CSV_URL, getCSVPath(context)); } @Test public void testGetCurrentEncoding() { DataContext context = load(MIXED_CSV_URL); Assert.assertEquals("UTF-8", getCurrentEncoding(context)); } /* * impl tests */ @Test(expected = FileNotFoundException.class) public void testFileNotFoundHandling() throws Exception { DataContext context = load(ERRORS_URL); Pipeline pipeline = new Pipeline(context); pipeline.getMetadataRepository().reset(); FileLoadDialect newDialect = dialectBuilder.url(NON_EXISTENT_URL).buildDialect(); pipeline.setDialect(newDialect); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); pipeline.executePipeline(); } @Test public void testWrongEncodingInCSV() throws Exception { DataContext context = load(ERRORS_URL); Pipeline pipeline = new Pipeline(context); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); pipeline.executePipeline(); Assert.assertEquals("WINDOWS-1252", pipeline.getDialect().getEncoding()); Assert.assertEquals(0, preparator.calApplicability(null, pipeline.getDataset(), null), 0); } /* * unmixer tests */ @Test public void testMixedEncodingInCSV() throws IOException { FileLoadDialect dialect = dialectBuilder.url(MIXED_CSV_URL).buildDialect(); long previousRecordCount = new FlatFileDataLoader(dialect).load().getDataFrame().count(); FileLoadDialect unmixedDialect = new EncodingUnmixer(MIXED_CSV_URL).unmixEncoding(dialect); DataContext context = new FlatFileDataLoader(unmixedDialect).load(); Pipeline pipeline = new Pipeline(context); pipeline.initMetadataRepository(); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); try { Assert.assertEquals("UTF-8", unmixedDialect.getEncoding()); Assert.assertEquals(0, preparator.calApplicability(null, pipeline.getDataset(), null), 0); Assert.assertEquals(0, preparator.countReplacementChars(unmixedDialect.getUrl()), 0); Assert.assertEquals(previousRecordCount, pipeline.getDataset().count()); } finally { Files.delete(Paths.get(unmixedDialect.getUrl())); } } @Test public void testSingleLine() throws IOException { FileLoadDialect dialect = dialectBuilder.url(SINGLE_LINE_URL).buildDialect(); FileLoadDialect unmixedDialect = new EncodingUnmixer(SINGLE_LINE_URL).unmixEncoding(dialect); DataContext context = new FlatFileDataLoader(unmixedDialect).load(); Pipeline pipeline = new Pipeline(context); pipeline.initMetadataRepository(); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); try { Assert.assertEquals(0, preparator.calApplicability(null, pipeline.getDataset(), null), 0); Assert.assertEquals(0, preparator.countReplacementChars(unmixedDialect.getUrl()), 0); } finally { Files.delete(Paths.get(unmixedDialect.getUrl())); } } /* * helpers */ private float calApplicability(DataContext context) { Pipeline pipeline = new Pipeline(context); pipeline.initMetadataRepository(); AbstractPreparator preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); return preparator.calApplicability(null, pipeline.getDataset(), null); } private String getCSVPath(DataContext context) { Pipeline pipeline = new Pipeline(context); pipeline.initMetadataRepository(); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); return preparator.getCsvPath().get(); } private String getCurrentEncoding(DataContext context) { Pipeline pipeline = new Pipeline(context); pipeline.initMetadataRepository(); ChangeTableEncoding preparator = new ChangeTableEncoding(); pipeline.addPreparation(new Preparation(preparator)); return preparator.getCurrentEncoding().get(); } private DataContext load(String url) { FileLoadDialect dialect = dialectBuilder.url(url).buildDialect(); SparkDataLoader dataLoader = new FlatFileDataLoader(dialect); return dataLoader.load(); } }
[ "jianglan1350@gmail.com" ]
jianglan1350@gmail.com
cba132262ca890db2d40e1d670795644b9962d07
e605e3e9e6af318e581e8934d0a73b11cf40328d
/TTAndroidClient/mgttlibs/src/com/squareup/picasso/StatsSnapshot.java
1d16d62bf10318254017af58028ca8263468e3d6
[]
no_license
alpha2z/TeamTalk
a2fc73d9006c9034ef55d140bbdccf271b1b043e
61efb126da58283c75eb384b32963728ccc7abfe
refs/heads/master
2021-03-27T19:13:52.183078
2014-11-14T02:40:50
2014-11-14T02:40:50
26,350,931
0
3
null
null
null
null
UTF-8
Java
false
false
5,024
java
/* * Copyright (C) 2013 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.squareup.picasso; import java.io.PrintWriter; import java.io.StringWriter; /** * Represents all stats for a {@link Picasso} instance at a single point in * time. */ public class StatsSnapshot { @SuppressWarnings("unused") private static final String TAG = "Picasso"; public final int maxSize; public final int size; public final long cacheHits; public final long cacheMisses; public final long totalDownloadSize; public final long totalOriginalBitmapSize; public final long totalTransformedBitmapSize; public final long averageDownloadSize; public final long averageOriginalBitmapSize; public final long averageTransformedBitmapSize; public final int downloadCount; public final int originalBitmapCount; public final int transformedBitmapCount; public final long timeStamp; public StatsSnapshot(int maxSize, int size, long cacheHits, long cacheMisses, long totalDownloadSize, long totalOriginalBitmapSize, long totalTransformedBitmapSize, long averageDownloadSize, long averageOriginalBitmapSize, long averageTransformedBitmapSize, int downloadCount, int originalBitmapCount, int transformedBitmapCount, long timeStamp) { this.maxSize = maxSize; this.size = size; this.cacheHits = cacheHits; this.cacheMisses = cacheMisses; this.totalDownloadSize = totalDownloadSize; this.totalOriginalBitmapSize = totalOriginalBitmapSize; this.totalTransformedBitmapSize = totalTransformedBitmapSize; this.averageDownloadSize = averageDownloadSize; this.averageOriginalBitmapSize = averageOriginalBitmapSize; this.averageTransformedBitmapSize = averageTransformedBitmapSize; this.downloadCount = downloadCount; this.originalBitmapCount = originalBitmapCount; this.transformedBitmapCount = transformedBitmapCount; this.timeStamp = timeStamp; } /** Prints out this {@link StatsSnapshot} into log. */ public void dump() { StringWriter logWriter = new StringWriter(); dump(new PrintWriter(logWriter)); // Log.i(TAG, logWriter.toString()); } /** * Prints out this {@link StatsSnapshot} with the the provided * {@link PrintWriter}. */ public void dump(PrintWriter writer) { writer.println("===============BEGIN PICASSO STATS ==============="); writer.println("Memory Cache Stats"); writer.print(" Max Cache Size: "); writer.println(maxSize); writer.print(" Cache Size: "); writer.println(size); writer.print(" Cache % Full: "); writer.println((int) Math.ceil((float) size / maxSize * 100)); writer.print(" Cache Hits: "); writer.println(cacheHits); writer.print(" Cache Misses: "); writer.println(cacheMisses); writer.println("Network Stats"); writer.print(" Download Count: "); writer.println(downloadCount); writer.print(" Total Download Size: "); writer.println(totalDownloadSize); writer.print(" Average Download Size: "); writer.println(averageDownloadSize); writer.println("Bitmap Stats"); writer.print(" Total Bitmaps Decoded: "); writer.println(originalBitmapCount); writer.print(" Total Bitmap Size: "); writer.println(totalOriginalBitmapSize); writer.print(" Total Transformed Bitmaps: "); writer.println(transformedBitmapCount); writer.print(" Total Transformed Bitmap Size: "); writer.println(totalTransformedBitmapSize); writer.print(" Average Bitmap Size: "); writer.println(averageOriginalBitmapSize); writer.print(" Average Transformed Bitmap Size: "); writer.println(averageTransformedBitmapSize); writer.println("===============END PICASSO STATS ==============="); writer.flush(); } @Override public String toString() { return "StatsSnapshot{" + "maxSize=" + maxSize + ", size=" + size + ", cacheHits=" + cacheHits + ", cacheMisses=" + cacheMisses + ", downloadCount=" + downloadCount + ", totalDownloadSize=" + totalDownloadSize + ", averageDownloadSize=" + averageDownloadSize + ", totalOriginalBitmapSize=" + totalOriginalBitmapSize + ", totalTransformedBitmapSize=" + totalTransformedBitmapSize + ", averageOriginalBitmapSize=" + averageOriginalBitmapSize + ", averageTransformedBitmapSize=" + averageTransformedBitmapSize + ", originalBitmapCount=" + originalBitmapCount + ", transformedBitmapCount=" + transformedBitmapCount + ", timeStamp=" + timeStamp + '}'; } }
[ "240581469@qq.com" ]
240581469@qq.com
05fb5772f554c0c530e00d9adcedfbc065a3b4d7
34d94f981f8002ac39916806bb05632c1ac34468
/Company/Tencent/Test1.java
845030fd4e3c8fc576d9d7d0d1d26cb518a41a86
[]
no_license
MrLeedom/My_Interview_Algorithm
f53320411329c3fd1b54d912d03ef8f0b5742bb3
353d891b056414e8577fa997e8bff2b8c46a4970
refs/heads/master
2020-05-18T01:26:53.207371
2019-09-23T12:07:55
2019-09-23T12:07:55
184,090,943
1
0
null
null
null
null
UTF-8
Java
false
false
1,444
java
package Tencent; import java.util.Scanner; /*************************************************************************** @description : 1.判断字符串与11的大小,分成三类情况讨论 2.对于第三种情况,主要关注8出现的位置,和字符串与11的差值比较大小 @author : caoshipeng @copyright : 华为技术有限公司(C),版权所有 2019-2020 @modified : 2019-09-20 20:05 caoshipeng create ****************************************************************************/ public class Test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i++) { int tmp = sc.nextInt(); sc.nextLine(); String str = sc.nextLine(); judgeNumberEight(str, tmp); } } private static void judgeNumberEight(String str, int tmp) { if(tmp < 11) { System.out.println("NO"); }else if(tmp == 11) { if(str.startsWith("8")) { System.out.println("YES"); }else{ System.out.println("NO"); } }else{ int gap = tmp - 11; int index = str.indexOf("8"); if(gap >= index) { System.out.println("YES"); }else{ System.out.println("NO"); } } } }
[ "cspenggary@163.com" ]
cspenggary@163.com
14e89f4f0dc864ee5fb11cfbb059a2a8072808f5
bc987d8706ad555c735a3cc0865d82167932bfb3
/src/main/java/ezbake/services/provenance/idgenerator/ZookeeperIdProvider.java
073e57ed4f7bb3230f89efcdbad3055c2c843ff8
[ "Apache-2.0" ]
permissive
ezbake/ezbake-provenance
7ad5bd40731531d95f3eef3a87b1f354ff8b3377
824497bfbc43311d8d889a63f143bdb58d03a979
refs/heads/master
2021-01-10T20:10:30.911322
2014-11-24T20:37:24
2014-11-24T20:37:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,598
java
/* Copyright (C) 2013-2014 Computer Sciences Corporation * * 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 ezbake.services.provenance.idgenerator; import ezbake.services.provenance.graph.GraphDb; import ezbakehelpers.ezconfigurationhelpers.zookeeper.ZookeeperConfigurationHelper; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.recipes.atomic.AtomicValue; import org.apache.curator.framework.recipes.atomic.DistributedAtomicLong; import org.apache.curator.framework.recipes.atomic.PromotedToLock; import org.apache.curator.retry.RetryNTimes; import java.util.Properties; import java.util.concurrent.TimeUnit; /** * Created with IntelliJ IDEA. * User: dev * Date: 9/18/14 * Time: 1:53 PM * To change this template use File | Settings | File Templates. */ public class ZookeeperIdProvider implements IdProvider { private final CuratorFramework curator; private DistributedAtomicLong document; private DistributedAtomicLong rule; private DistributedAtomicLong purge; public final String documentZkPath; public final String documentLockZkPath; public final String ruleZkPath; public final String ruleLockZkPath; public final String purgeZkPath; public final String purgeLockZkPath; public ZookeeperIdProvider(final Properties properties) { String indexName = GraphDb.getElasticIndexName(properties); documentZkPath = String.format("/ezbake/%s/document/counter", indexName); documentLockZkPath = String.format("/ezbake/%s/document/lock", indexName); ruleZkPath = String.format("/ezbake/%s/rule/counter", indexName); ruleLockZkPath = String.format("/ezbake/%s/rule/lock", indexName); purgeZkPath = String.format("/ezbake/%s/purge/counter", indexName); purgeLockZkPath = String.format("/ezbake/%s/purge/lock", indexName); ZookeeperConfigurationHelper zc = new ZookeeperConfigurationHelper(properties); curator = CuratorFrameworkFactory.builder() .connectString(zc.getZookeeperConnectionString()) .retryPolicy(new RetryNTimes(5, 1000)) .build(); if (curator.getState() == CuratorFrameworkState.LATENT) { curator.start(); } document = new DistributedAtomicLong(curator, documentZkPath, curator.getZookeeperClient().getRetryPolicy(), PromotedToLock.builder() .lockPath(documentLockZkPath) .timeout(250, TimeUnit.MILLISECONDS) .build()); rule = new DistributedAtomicLong(curator, ruleZkPath, curator.getZookeeperClient().getRetryPolicy(), PromotedToLock.builder() .lockPath(ruleLockZkPath) .timeout(250, TimeUnit.MILLISECONDS) .build()); purge = new DistributedAtomicLong(curator, purgeZkPath, curator.getZookeeperClient().getRetryPolicy(), PromotedToLock.builder() .lockPath(purgeLockZkPath) .timeout(250, TimeUnit.MILLISECONDS) .build()); } @Override public void shutdown() { if (curator != null) { curator.close(); } } @Override public long getNextId(ID_GENERATOR_TYPE type) throws IdGeneratorException { DistributedAtomicLong atomic = null; switch (type) { case DocumentType: atomic = document; break; case AgeOffRule: atomic = rule; break; case PurgeEvent: atomic = purge; break; default: throw new IdGeneratorException("Not supported ID Generator Type: " + type); } try { AtomicValue<Long> current = atomic.increment(); if (!current.succeeded()) { throw new IdGeneratorException("Failed to increment id in zookeeper for type " + type); } return current.postValue(); }catch (Exception ex) { throw new IdGeneratorException(ex); } } @Override public long getNextNId(ID_GENERATOR_TYPE type, long delta) throws IdGeneratorException { DistributedAtomicLong atomic = null; switch (type) { case DocumentType: atomic = document; break; case AgeOffRule: atomic = rule; break; case PurgeEvent: atomic = purge; break; default: throw new IdGeneratorException("Not supported ID Generator Type: " + type); } try { AtomicValue<Long> current = atomic.add(delta); if (!current.succeeded()) { throw new IdGeneratorException(String.format("Failed to increment id in zookeeper for type %s by %d", type, delta)); } return current.postValue(); }catch (Exception ex) { throw new IdGeneratorException(ex); } } @Override public long getCurrentValue(ID_GENERATOR_TYPE type) throws IdGeneratorException { DistributedAtomicLong atomic = null; switch (type) { case DocumentType: atomic = document; break; case AgeOffRule: atomic = rule; break; case PurgeEvent: atomic = purge; break; default: throw new IdGeneratorException("Not supported ID Generator Type: " + type); } try { AtomicValue<Long> current = atomic.get(); if (!current.succeeded()) { throw new IdGeneratorException("Failed to get id in zookeeper for type " + type); } return current.postValue(); }catch (Exception ex) { throw new IdGeneratorException(ex); } } @Override public void setCurrentValue(ID_GENERATOR_TYPE type, long value) throws IdGeneratorException { DistributedAtomicLong atomic = null; switch (type) { case DocumentType: atomic = document; break; case AgeOffRule: atomic = rule; break; case PurgeEvent: atomic = purge; break; default: throw new IdGeneratorException("Not supported ID Generator Type: " + type); } try { AtomicValue<Long> current = atomic.trySet(value); if (!current.succeeded()) { throw new IdGeneratorException("Failed to set current id for type " + type); } }catch (Exception ex) { throw new IdGeneratorException(ex); } } }
[ "jhastings@42six.com" ]
jhastings@42six.com
afafc9a051ff3f9584a086eabaed4f27dc17bd8d
67e74d4685016f01ce3e857ac7043dfcd5d12f87
/src/com/chinasofti/meeting/vo/Employee.java
909045fb041729e6621fe74ee6312b0a9b0a4e23
[]
no_license
azurehu/conference-system
f4f02be77090d5b757fcd39b0e074e3450c83768
b0a576cbeef67c0d66154953c1fb41905fd18598
refs/heads/master
2021-01-21T05:28:46.570667
2017-02-26T07:39:59
2017-02-26T07:39:59
83,191,601
1
1
null
null
null
null
UTF-8
Java
false
false
2,977
java
package com.chinasofti.meeting.vo; public class Employee { private Integer employeeid; private String employeename; private String username; private String password; private Integer departmentid; private String email; private String phone; // status表示员工的状态,0表示正在审核,1表示审核通过,2表示审核未通过,默认为正在审核 private String status="0"; // role表示员工的角色,1表示为管理员,2表示为员工 private String role="2"; public Employee() { super(); } public Employee(String username, String password, String role) { super(); this.username = username; this.password = password; this.role = role; } public Employee(String employeename, String username, String password, Integer departmentid, String email, String phone, String status, String role) { super(); this.employeename = employeename; this.username = username; this.password = password; this.departmentid = departmentid; this.email = email; this.phone = phone; this.status = status; this.role = role; } public Employee(Integer employeeid, String employeename, String username, String password, Integer departmentid, String email, String phone, String status, String role) { super(); this.employeeid = employeeid; this.employeename = employeename; this.username = username; this.password = password; this.departmentid = departmentid; this.email = email; this.phone = phone; this.status = status; this.role = role; } public Integer getEmployeeid() { return employeeid; } public void setEmployeeid(Integer employeeid) { this.employeeid = employeeid; } public String getEmployeename() { return employeename; } public void setEmployeename(String employeename) { this.employeename = employeename; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Integer getDepartmentid() { return departmentid; } public void setDepartmentid(Integer departmentid) { this.departmentid = departmentid; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } // 覆盖toString方法,方便代码测试过程中,打印输出Employee对象查看 @Override public String toString() { // TODO Auto-generated method stub return "employeeid: "+employeeid+" username: "+username+" password: "+password+" " + "status: "+status+" role: "+role; } }
[ "azurehu@qq.com" ]
azurehu@qq.com
4c5226bc20542c78b1d006a9b4f04138738c4ab8
68b92ecfce63cfedfa01aab3a05813860ba21d90
/Part II. Chapter 6. Anonimniy i abstraktniy klass/Tracker/src/main/java/ru/shestakov/models/FilterByName.java
50c4d736ce65e2a0bd41092383cc41b711483298
[ "Apache-2.0" ]
permissive
savspit/java-a-to-z
5d0a2f52e56b4d1d64094e2059142f4a971aa85a
b7aba94184748f848457b1b19d227436f7785bf8
refs/heads/master
2021-01-21T04:50:32.925042
2016-07-16T12:16:00
2016-07-16T12:16:00
55,403,246
0
2
null
null
null
null
UTF-8
Java
false
false
294
java
package ru.shestakov.models; public class FilterByName implements Filter { final private String name; public FilterByName(String name) { this.name = name; } public boolean check(Item item) { return (item != null) && (item.getName().contains(name)); } }
[ "savspit@gmail.com" ]
savspit@gmail.com
951d4a886bcf1691299185917ba216a18c6aaf09
8e03a2d3a5554a7193a5fdb22afdcefe634878cb
/Spring-boot/util/ContentCachingRequestWrapper.java
801a089ef51a00cac9902416162c8e66afe55478
[]
no_license
iathanasy/notes
586ae05f0f270307e87e1be8ed009bfa30bb67a7
e6eced651f86759ed881a4145b71f340a0493688
refs/heads/master
2023-08-03T00:58:16.035557
2021-09-29T02:01:11
2021-09-29T02:01:11
414,809,012
1
0
null
2021-10-08T01:33:56
2021-10-08T01:33:56
null
GB18030
Java
false
false
248
java
# ContentCachingRequestWrapper * 可以重用读取流的 HttpServletRequest 包装类 * 必须保证在包装之前, HttpServletRequest 没读取过流, 也就是没执行过 getInputStream() 方法 * 方法 byte[] getContentAsByteArray()
[ "747692844@qq.com" ]
747692844@qq.com
40585068b00255bc0f045757d1b00d6fef3bb033
a02876d402fd8809ecccec544f9138c5a42f6114
/src/com/ATM/ATM.java
a89403a9b5f8879a050d7066291ec7a3b32f40e2
[]
no_license
dengshun1025/Demo
0bb9a3f77c8ca5af9ddb90ddb3525532add7014f
b26cb6e81d4dbbe405f2035de1e1e13ff46d0b56
refs/heads/master
2020-04-12T06:42:33.569665
2016-09-12T07:53:22
2016-09-12T07:53:22
65,721,454
0
0
null
null
null
null
GB18030
Java
false
false
2,596
java
package com.ATM; /** * 邓舜 */ import java.util.ArrayList; import java.util.Scanner; public class ATM { public static Scanner scanner; private Person person1; private Person person2; private ArrayList<Person> al; public ATM() { scanner=new Scanner(System.in); al=new ArrayList<>(); person1=new Person("dengshun", "001", 10000); al.add(person1); person2=new Person("xpjian", "002", 10000); al.add(person2); } public void run() { while(true) { System.out.println("1.查询。"); System.out.println("2.取款。"); System.out.println("3.转账。"); System.out.println("4.退出。"); int i=scanner.nextInt(); switch(i) { case 1: { System.out.println("输入姓名:"); String name=scanner.next(); System.out.println("输入密码:"); String no=scanner.next(); if(person1.getName().equals(name)) { person1.getAccount().query(person1, no); } else if(person2.getName().equals(name)) { person1.getAccount().query(person2, no); } else { System.out.println("用户不存在!"); } } break; case 2: { System.out.println("输入姓名:"); String name=scanner.next(); System.out.println("输入密码:"); String no=scanner.next(); System.out.println("取款金额:"); double fee=scanner.nextDouble(); if(person1.getName().equals(name)) { person1.getAccount().draw(person1, no,fee); } else if(person2.getName().equals(name)) { person1.getAccount().draw(person2, no,fee); } else { System.out.println("用户不存在!"); } break; } case 3: { System.out.println("输入转出人姓名:"); String name1=scanner.next(); System.out.println("输入密码:"); String no=scanner.next(); System.out.println("输入转入人姓名:"); String name2=scanner.next(); System.out.println("转出金额:"); double fee=scanner.nextDouble(); if(person1.getName().equals(name1)) { if(person2.getName().equals(name2)) person1.getAccount().tran(person1, no,person2,fee); } else if(person2.getName().equals(name1)) { if(person1.getName().equals(name1)) person1.getAccount().tran(person2, no,person2,fee); } else { System.out.println("转账错误"); } break; } case 4: System.exit(0); } } } public static void main(String[] args) { ATM atm=new ATM(); atm.run(); } }
[ "ds1025158146@hotmail.com" ]
ds1025158146@hotmail.com
4a0397d15d6cd54ba669a919d3e52a4f173fd191
5c009ccdde089a427bd2e3a5684ccb9b759896d9
/src/main/java/com/wemsuser/app/Response/UserLoginTokenData.java
0d1e37fb0c35e3d1429bbfac03bf2f5a4eb3c116
[]
no_license
UmraoNidhi/iparknidhi
062e12fd0e919dab89de0178c912d1c6ffbfff27
5c660ffefd783816ca2a1d390e2ff2b1b2e2057a
refs/heads/master
2022-12-08T14:55:12.126549
2020-01-29T13:36:21
2020-01-29T13:36:21
288,910,023
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.wemsuser.app.Response; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class UserLoginTokenData { @SerializedName("login_token") @Expose private String loginToken; public String getLoginToken() { return loginToken; } public void setLoginToken(String loginToken) { this.loginToken = loginToken; } }
[ "vivek@algosoftech.in" ]
vivek@algosoftech.in
1f45d5f8491241cf6404ff6d08b7040846fa7510
c94848000f44a215f0de96b37a20739b62037836
/src/main/java/ontology/impl/DefaultMotorbike.java
326a9ffdcb767c09a93c6c9b0c4fc9cdbc9c1c7e
[]
no_license
michalbarczyk/waymo-to-ontology-mapper
551165e2b33d3f044c651d511aaa7c6700bb027d
039e7116b927f952d73ae25f7ed616810e50a7c8
refs/heads/master
2022-08-25T02:55:40.921470
2020-05-28T00:03:04
2020-05-28T00:03:04
267,451,569
0
0
null
2023-09-14T20:35:07
2020-05-28T00:02:33
Java
UTF-8
Java
false
false
16,326
java
package ontology.impl; import ontology.*; import java.net.URI; import java.util.Collection; import javax.xml.datatype.XMLGregorianCalendar; import org.protege.owl.codegeneration.WrappedIndividual; import org.protege.owl.codegeneration.impl.WrappedIndividualImpl; import org.protege.owl.codegeneration.inference.CodeGenerationInference; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLOntology; /** * Generated by Protege (http://protege.stanford.edu).<br> * Source Class: DefaultMotorbike <br> * @version generated on Tue May 26 21:59:27 CEST 2020 by Michał Barczyk */ public class DefaultMotorbike extends WrappedIndividualImpl implements Motorbike { public DefaultMotorbike(CodeGenerationInference inference, IRI iri) { super(inference, iri); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_at_the_back */ public Collection<? extends Entity> getHas_at_the_back() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_AT_THE_BACK, DefaultEntity.class); } public boolean hasHas_at_the_back() { return !getHas_at_the_back().isEmpty(); } public void addHas_at_the_back(Entity newHas_at_the_back) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_AT_THE_BACK, newHas_at_the_back); } public void removeHas_at_the_back(Entity oldHas_at_the_back) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_AT_THE_BACK, oldHas_at_the_back); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_in_the_front */ public Collection<? extends Entity> getHas_in_the_front() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_IN_THE_FRONT, DefaultEntity.class); } public boolean hasHas_in_the_front() { return !getHas_in_the_front().isEmpty(); } public void addHas_in_the_front(Entity newHas_in_the_front) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_IN_THE_FRONT, newHas_in_the_front); } public void removeHas_in_the_front(Entity oldHas_in_the_front) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_IN_THE_FRONT, oldHas_in_the_front); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_on_the_left */ public Collection<? extends Entity> getHas_on_the_left() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_LEFT, DefaultEntity.class); } public boolean hasHas_on_the_left() { return !getHas_on_the_left().isEmpty(); } public void addHas_on_the_left(Entity newHas_on_the_left) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_LEFT, newHas_on_the_left); } public void removeHas_on_the_left(Entity oldHas_on_the_left) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_LEFT, oldHas_on_the_left); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_on_the_right */ public Collection<? extends Entity> getHas_on_the_right() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_RIGHT, DefaultEntity.class); } public boolean hasHas_on_the_right() { return !getHas_on_the_right().isEmpty(); } public void addHas_on_the_right(Entity newHas_on_the_right) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_RIGHT, newHas_on_the_right); } public void removeHas_on_the_right(Entity oldHas_on_the_right) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_ON_THE_RIGHT, oldHas_on_the_right); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_within_close_distance */ public Collection<? extends Entity> getHas_within_close_distance() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_CLOSE_DISTANCE, DefaultEntity.class); } public boolean hasHas_within_close_distance() { return !getHas_within_close_distance().isEmpty(); } public void addHas_within_close_distance(Entity newHas_within_close_distance) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_CLOSE_DISTANCE, newHas_within_close_distance); } public void removeHas_within_close_distance(Entity oldHas_within_close_distance) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_CLOSE_DISTANCE, oldHas_within_close_distance); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_within_far_distance */ public Collection<? extends Entity> getHas_within_far_distance() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_FAR_DISTANCE, DefaultEntity.class); } public boolean hasHas_within_far_distance() { return !getHas_within_far_distance().isEmpty(); } public void addHas_within_far_distance(Entity newHas_within_far_distance) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_FAR_DISTANCE, newHas_within_far_distance); } public void removeHas_within_far_distance(Entity oldHas_within_far_distance) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_FAR_DISTANCE, oldHas_within_far_distance); } /* *************************************************** * Object Property http://webprotege.stanford.edu/has_within_very_close_distance */ public Collection<? extends Entity> getHas_within_very_close_distance() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_VERY_CLOSE_DISTANCE, DefaultEntity.class); } public boolean hasHas_within_very_close_distance() { return !getHas_within_very_close_distance().isEmpty(); } public void addHas_within_very_close_distance(Entity newHas_within_very_close_distance) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_VERY_CLOSE_DISTANCE, newHas_within_very_close_distance); } public void removeHas_within_very_close_distance(Entity oldHas_within_very_close_distance) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_HAS_WITHIN_VERY_CLOSE_DISTANCE, oldHas_within_very_close_distance); } /* *************************************************** * Object Property http://webprotege.stanford.edu/vehicle_autonomy */ public Collection<? extends WrappedIndividual> getVehicle_autonomy() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_AUTONOMY, WrappedIndividualImpl.class); } public boolean hasVehicle_autonomy() { return !getVehicle_autonomy().isEmpty(); } public void addVehicle_autonomy(WrappedIndividual newVehicle_autonomy) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_AUTONOMY, newVehicle_autonomy); } public void removeVehicle_autonomy(WrappedIndividual oldVehicle_autonomy) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_AUTONOMY, oldVehicle_autonomy); } /* *************************************************** * Object Property http://webprotege.stanford.edu/vehicle_has_driver */ public Collection<? extends Driver> getVehicle_has_driver() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_DRIVER, DefaultDriver.class); } public boolean hasVehicle_has_driver() { return !getVehicle_has_driver().isEmpty(); } public void addVehicle_has_driver(Driver newVehicle_has_driver) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_DRIVER, newVehicle_has_driver); } public void removeVehicle_has_driver(Driver oldVehicle_has_driver) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_DRIVER, oldVehicle_has_driver); } /* *************************************************** * Object Property http://webprotege.stanford.edu/vehicle_has_location */ public Collection<? extends Location> getVehicle_has_location() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_LOCATION, DefaultLocation.class); } public boolean hasVehicle_has_location() { return !getVehicle_has_location().isEmpty(); } public void addVehicle_has_location(Location newVehicle_has_location) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_LOCATION, newVehicle_has_location); } public void removeVehicle_has_location(Location oldVehicle_has_location) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_LOCATION, oldVehicle_has_location); } /* *************************************************** * Object Property http://webprotege.stanford.edu/vehicle_has_passenger */ public Collection<? extends Passenger> getVehicle_has_passenger() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_PASSENGER, DefaultPassenger.class); } public boolean hasVehicle_has_passenger() { return !getVehicle_has_passenger().isEmpty(); } public void addVehicle_has_passenger(Passenger newVehicle_has_passenger) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_PASSENGER, newVehicle_has_passenger); } public void removeVehicle_has_passenger(Passenger oldVehicle_has_passenger) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_PASSENGER, oldVehicle_has_passenger); } /* *************************************************** * Object Property http://webprotege.stanford.edu/vehicle_has_type */ public Collection<? extends Van> getVehicle_has_type() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_TYPE, DefaultVan.class); } public boolean hasVehicle_has_type() { return !getVehicle_has_type().isEmpty(); } public void addVehicle_has_type(Van newVehicle_has_type) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_TYPE, newVehicle_has_type); } public void removeVehicle_has_type(Van oldVehicle_has_type) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.OBJECT_PROPERTY_VEHICLE_HAS_TYPE, oldVehicle_has_type); } /* *************************************************** * Data Property http://webprotege.stanford.edu/autonomy_level */ public Collection<? extends Integer> getAutonomy_level() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.DATA_PROPERTY_AUTONOMY_LEVEL, Integer.class); } public boolean hasAutonomy_level() { return !getAutonomy_level().isEmpty(); } public void addAutonomy_level(Integer newAutonomy_level) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.DATA_PROPERTY_AUTONOMY_LEVEL, newAutonomy_level); } public void removeAutonomy_level(Integer oldAutonomy_level) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.DATA_PROPERTY_AUTONOMY_LEVEL, oldAutonomy_level); } /* *************************************************** * Data Property http://webprotege.stanford.edu/vehicle_has_speed_km/h */ public Collection<? extends Integer> getVehicle_has_speed_kmph() { return getDelegate().getPropertyValues(getOwlIndividual(), Vocabulary.DATA_PROPERTY_VEHICLE_HAS_SPEED_KMPH, Integer.class); } public boolean hasVehicle_has_speed_kmph() { return !getVehicle_has_speed_kmph().isEmpty(); } public void addVehicle_has_speed_kmph(Integer newVehicle_has_speed_kmph) { getDelegate().addPropertyValue(getOwlIndividual(), Vocabulary.DATA_PROPERTY_VEHICLE_HAS_SPEED_KMPH, newVehicle_has_speed_kmph); } public void removeVehicle_has_speed_kmph(Integer oldVehicle_has_speed_kmph) { getDelegate().removePropertyValue(getOwlIndividual(), Vocabulary.DATA_PROPERTY_VEHICLE_HAS_SPEED_KMPH, oldVehicle_has_speed_kmph); } }
[ "barczykmt@gmail.com" ]
barczykmt@gmail.com
971eff5804b6fbf1d1d9372b6c86408e32822d59
3f1200009a2a4dea25400dab955e83b5ea763f20
/src/main/java/com/ncu/edu/happychat/service/GroupsService.java
4688cb31ca6ad8dc45cbfef64bc408365d30261d
[]
no_license
hellosaferide/ncuchat
1ca7cd6bd33e853490538d5bdf26a0bebba4ecfc
8c3f25e8b6658b67f3e3baa0374a1614cc31f883
refs/heads/master
2020-04-12T08:26:10.886791
2018-12-23T08:14:51
2018-12-23T08:14:51
162,383,730
1
0
null
null
null
null
UTF-8
Java
false
false
765
java
package com.ncu.edu.happychat.service; import com.ncu.edu.happychat.dao.GroupsDao; import com.ncu.edu.happychat.entity.Groups; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class GroupsService { @Autowired private GroupsDao groupsDao; public List<Groups> findAll(){ return groupsDao.findAll(); } public void saveGroups(Groups groups) { groupsDao.save(groups); } public void deleteGroups(Groups groups) { groupsDao.delete(groups); } public void updateGroups(Groups groups) { if (groupsDao.findById(groups.getGroupId()).isPresent()){ groupsDao.save(groups); } } }
[ "740440614@qq.com" ]
740440614@qq.com
3c57429b74f07e25b859784c2f464d5a8281d569
c590a6f416a0e51549bd81b6bc6d1836de8dd974
/src/main/java/com/places/manager/db/PlacesDatabase.java
223a8727d4f6205d9a2b1e96b0e549157eb3f6bf
[]
no_license
EdilsonDiasAlves/quero-ser-clickbus
06d46e550b7785b1065e13069bfc8df91586cca9
2e5a38466b1f3c5a3cd0e8e0dd66fff0e023e03d
refs/heads/master
2020-07-15T18:34:14.042309
2019-09-03T06:47:57
2019-09-03T06:47:57
205,624,473
0
0
null
2019-09-01T03:29:06
2019-09-01T03:29:06
null
UTF-8
Java
false
false
2,671
java
package com.places.manager.db; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.springframework.stereotype.Component; import com.places.manager.model.Place; @Component public class PlacesDatabase { private static Map<Integer, Place> placesDatabase = new HashMap<>(); private static Integer id = 0; static { System.out.println("Initializing places simulated database..."); Place festival = new Place(); festival.setId(++id); festival.setName("Sarah's Festival"); festival.setSlug("California St 06"); festival.setState("Ohio"); festival.setCity("Columbus"); festival.setCreatedAt(LocalDateTime.now()); Place museum = new Place(); museum.setId(++id); museum.setName("Robot Museum"); museum.setSlug("Tech St 25"); museum.setState("Arizona"); museum.setCity("Phoenix"); museum.setCreatedAt(LocalDateTime.now()); Place hotel = new Place(); hotel.setId(++id); hotel.setName("Bates Hotel"); hotel.setSlug("Trinity St 25"); hotel.setState("Texas"); hotel.setCity("Houston"); hotel.setCreatedAt(LocalDateTime.now()); placesDatabase.put(festival.getId(), festival); placesDatabase.put(museum.getId() , museum); placesDatabase.put(hotel.getId(), hotel); } public List<Place> selectAll(){ List<Place> returnedPlaces = new ArrayList<>(); for (Entry<Integer, Place> placeTuple : placesDatabase.entrySet()) { Place place = placeTuple.getValue(); place.setId(placeTuple.getKey()); returnedPlaces.add(place); } return returnedPlaces; } public List<Place> selectAllPlacesWherePlaceNameLike(String placeName) { List<Place> returnedPlacesFilteredByName = new ArrayList<>(); for (Place place : placesDatabase.values()) { if (place.getName().toLowerCase().contains(placeName.toLowerCase())) { returnedPlacesFilteredByName.add(place); } } return returnedPlacesFilteredByName; } public Integer insertPlace(Place newPlace) { Integer numberOfRowsInserted = 0; if(newPlace != null) { newPlace.setId(++id); placesDatabase.put(newPlace.getId(), newPlace); numberOfRowsInserted = 1; } return numberOfRowsInserted; } public Place updatePlace(Place placeToBeEdited) { if(placeToBeEdited != null) { placesDatabase.put(placeToBeEdited.getId(), placeToBeEdited); } return placesDatabase.get(placeToBeEdited.getId()); } public Place selectPlaceWhereIdEquals(Integer id){ return placesDatabase.get(id); } }
[ "p000emoizinho@prservicos.com.br" ]
p000emoizinho@prservicos.com.br
aaccd63c2c8c2b3fca7cfc99901c62b6d114d123
a2fc50d433a57f49c471731a42c2944366c5e164
/src/java/view/ViewInteractionsHandler.java
55cf79c38b87184bd05979296b6f2da49b1d54ef
[]
no_license
Alireza-Jamali/Excel-to-HTML-ApachiPoi
d41b11b249c6208dc68f8edaa67f08171c88ecf8
6e96d20f6925145bb2a665c2f92166bc16974320
refs/heads/master
2020-03-11T14:46:22.181936
2018-04-18T13:30:57
2018-04-18T13:30:57
130,064,461
0
0
null
null
null
null
UTF-8
Java
false
false
3,256
java
package view; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.primefaces.event.FileUploadEvent; import search.Entity; import search.Reader; import search.Processor; @ManagedBean @ViewScoped public class ViewInteractionsHandler { private List<InputSharhList> inputSharhList; @PostConstruct public void init() { inputSharhList = new ArrayList<>(); } public void remove(InputSharhList in) { inputSharhList.remove(in); } public void add() { inputSharhList.add(new InputSharhList()); } public List<InputSharhList> getInputSharhList() { return inputSharhList; } public String sharhResult = ""; public String yaddashtCode; private Reader reader = new Reader(); private Processor processor = new Processor(); private ArrayList<Entity> entityList; public ArrayList<Entity> tableList; public ArrayList<Entity> getTableList() { return tableList; } public void setTableList(ArrayList<Entity> tableList) { this.tableList = tableList; } public String getYaddashtCode() { return yaddashtCode; } public void setYaddashtCode(String yaddashtCode) { this.yaddashtCode = yaddashtCode; } public String getSharhResult() { return sharhResult; } public void setSharhResult(String sharhResult) { this.sharhResult = sharhResult; } public void handleFileUpload(FileUploadEvent event) { sharhResult = ""; FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, message); FileInputStream in = null; try { in = (FileInputStream) event.getFile().getInputstream(); excelToEntities(in); } catch (IOException | InvalidFormatException ex) { ex.printStackTrace(); } } private void excelToEntities(FileInputStream fin) throws IOException, InvalidFormatException { entityList = reader.readFromExcel(fin); tableList = entityList; } public void reset() { tableList = entityList; sharhResult = ""; inputSharhList.clear(); yaddashtCode = ""; } public void handleSharh() { try { sharhResult = processor.sumBardashtFromSharh(entityList, inputSharhList); tableList = processor.getBardashtList(); inputSharhList.clear(); } catch (Exception e) { e.printStackTrace(); } } public void handleYaddasht() { if (yaddashtCode == null || yaddashtCode.equals("")) { tableList = entityList; }else { tableList = processor.getEntityFromYaddasht(entityList, yaddashtCode); } } }
[ "aagun01@gmail.com" ]
aagun01@gmail.com
826749fcf877557ebdd8ef22a119ed9db1f90138
7607d7330ceb43ea95218071414e7b3d1db31e37
/src/main/java/com/evolutionaryenterprisesllc/map/web/rest/AuditResource.java
3aee9c641337c152346c699b1ae30c3f8a089e88
[]
no_license
BulkSecurityGeneratorProject/map
4cc468dc53782ebbba842236c0dc3831226d0d37
5b625839594cd0e908c1d23109662a332839acbc
refs/heads/master
2022-12-18T12:57:05.696170
2016-12-27T19:28:06
2016-12-27T19:28:06
296,551,594
0
0
null
2020-09-18T07:49:03
2020-09-18T07:49:02
null
UTF-8
Java
false
false
3,315
java
package com.evolutionaryenterprisesllc.map.web.rest; import com.evolutionaryenterprisesllc.map.service.AuditEventService; import com.evolutionaryenterprisesllc.map.web.rest.util.PaginationUtil; import io.swagger.annotations.ApiParam; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.inject.Inject; import java.net.URISyntaxException; import java.time.LocalDate; import java.util.List; /** * REST controller for getting the audit events. */ @RestController @RequestMapping("/management/audits") public class AuditResource { private AuditEventService auditEventService; @Inject public AuditResource(AuditEventService auditEventService) { this.auditEventService = auditEventService; } /** * GET /audits : get a page of AuditEvents. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of AuditEvents in body * @throws URISyntaxException if there is an error to generate the pagination HTTP headers */ @GetMapping public ResponseEntity<List<AuditEvent>> getAll(@ApiParam Pageable pageable) throws URISyntaxException { Page<AuditEvent> page = auditEventService.findAll(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/management/audits"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } /** * GET /audits : get a page of AuditEvents between the fromDate and toDate. * * @param fromDate the start of the time period of AuditEvents to get * @param toDate the end of the time period of AuditEvents to get * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of AuditEvents in body * @throws URISyntaxException if there is an error to generate the pagination HTTP headers */ @GetMapping(params = {"fromDate", "toDate"}) public ResponseEntity<List<AuditEvent>> getByDates( @RequestParam(value = "fromDate") LocalDate fromDate, @RequestParam(value = "toDate") LocalDate toDate, @ApiParam Pageable pageable) throws URISyntaxException { Page<AuditEvent> page = auditEventService.findByDates(fromDate.atTime(0, 0), toDate.atTime(23, 59), pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/management/audits"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } /** * GET /audits/:id : get an AuditEvent by id. * * @param id the id of the entity to get * @return the ResponseEntity with status 200 (OK) and the AuditEvent in body, or status 404 (Not Found) */ @GetMapping("/{id:.+}") public ResponseEntity<AuditEvent> get(@PathVariable Long id) { return auditEventService.find(id) .map((entity) -> new ResponseEntity<>(entity, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); } }
[ "mac.feliciano@gmail.com" ]
mac.feliciano@gmail.com
774490441b1f83e5d08b88050662b1b809c30d82
41412a9e3664c57206f8d1c63287aa3baae2d93c
/app/src/main/java/com/cqupt/travelhelper/adapter/SearchAdapter.java
de38eacaea90cf8b783af78326a0a5674f703133
[]
no_license
chenls/TravelHelper
dddd73d06ce173e08755cfe09c4e3eeb0214a69e
260f4d23d2f7b4bca7239694a079f453ebfc3aaf
refs/heads/master
2021-01-01T04:01:09.163704
2016-05-03T11:48:38
2016-05-03T11:48:38
57,101,305
1
0
null
null
null
null
UTF-8
Java
false
false
9,255
java
package com.cqupt.travelhelper.adapter; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.cqupt.travelhelper.R; import com.cqupt.travelhelper.activity.AttractionDetailsActivity; import com.cqupt.travelhelper.activity.StrategyDetailsActivity; import com.cqupt.travelhelper.activity.TravelsDetailsActivity; import com.cqupt.travelhelper.module.Attraction; import com.cqupt.travelhelper.module.MyUser; import com.cqupt.travelhelper.module.Strategy; import com.cqupt.travelhelper.module.Travels; import java.util.Map; public class SearchAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private Map<Integer, Object> searchMap; private Context mContext; private final int TYPE_TITLE = 0; private final int TYPE_ATTRACTION = 1; private final int TYPE_TRAVELS = 2; private final int TYPE_STRATEGY = 3; private final int TYPE_BUTTON = 4; public SearchAdapter(Context mContext) { this.mContext = mContext; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == TYPE_ATTRACTION) { return new AttractionViewHolder( LayoutInflater.from(mContext).inflate(R.layout.fragment_attraction, parent, false)); } else if (viewType == TYPE_TRAVELS) { return new TravelsViewHolder( LayoutInflater.from(mContext).inflate(R.layout.fragment_travles, parent, false)); } else if (viewType == TYPE_STRATEGY) { return new StrategyViewHolder( LayoutInflater.from(mContext).inflate(R.layout.fragment_strategy, parent, false)); } else if (viewType == TYPE_TITLE) { return new TitleViewHolder( LayoutInflater.from(mContext).inflate(R.layout.search_title, parent, false)); } else if (viewType == TYPE_BUTTON) { return new ButtonViewHolder( LayoutInflater.from(mContext).inflate(R.layout.search_button, parent, false)); } return null; } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder instanceof AttractionViewHolder) { final Attraction attraction = (Attraction) searchMap.get(position); final Context context = holder.itemView.getContext(); Glide.with(context) .load(attraction.getPicture().getFileUrl(context)) .placeholder(R.mipmap.loading) .into(((AttractionViewHolder) holder).picture); ((AttractionViewHolder) holder).name.setText(attraction.getName()); ((AttractionViewHolder) holder).mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(context, AttractionDetailsActivity.class); Bundle bundle = new Bundle(); attraction.setMyId(attraction.getObjectId()); bundle.putParcelable("attraction", attraction); intent.putExtras(bundle); context.startActivity(intent); } }); } else if (holder instanceof TravelsViewHolder) { final Travels travels = (Travels) searchMap.get(position); final MyUser myUser = travels.getMyUser(); final Context context = holder.itemView.getContext(); Glide.with(context) .load(travels.getPicture().getFileUrl(context)) .placeholder(R.mipmap.loading) .into(((TravelsViewHolder) holder).picture); ((TravelsViewHolder) holder).description.setText(travels.getDescription()); if (myUser != null) { Glide.with(context) .load(myUser.getPic().getFileUrl(context)) .placeholder(R.mipmap.loading) .into(((TravelsViewHolder) holder).user_pic); ((TravelsViewHolder) holder).user_name.setText(myUser.getUsername()); } ((TravelsViewHolder) holder).mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(context, TravelsDetailsActivity.class); Bundle bundle = new Bundle(); travels.setMyId(travels.getObjectId()); bundle.putParcelable("travels", travels); intent.putExtras(bundle); context.startActivity(intent); } }); } else if (holder instanceof StrategyViewHolder) { final Strategy strategy = (Strategy) searchMap.get(position); final Context context = holder.itemView.getContext(); Glide.with(context) .load(strategy.getPicture().getFileUrl(context)) .placeholder(R.mipmap.loading) .into(((StrategyViewHolder) holder).picture); ((StrategyViewHolder) holder).name.setText(strategy.getName()); ((StrategyViewHolder) holder).mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(context, StrategyDetailsActivity.class); Bundle bundle = new Bundle(); strategy.setMyId(strategy.getObjectId()); bundle.putParcelable("strategy", strategy); intent.putExtras(bundle); context.startActivity(intent); } }); } else if (holder instanceof TitleViewHolder) { ((TitleViewHolder) holder).title.setText((String) searchMap.get(position)); } else if (holder instanceof ButtonViewHolder) { ((ButtonViewHolder) holder).button.setText((String) searchMap.get(position)); } } @Override public int getItemCount() { return searchMap == null ? 0 : searchMap.size(); } @Override public int getItemViewType(int position) { Object object = searchMap.get(position); if (object instanceof Attraction) { return TYPE_ATTRACTION; } else if (object instanceof Travels) { return TYPE_TRAVELS; } else if (object instanceof Strategy) { return TYPE_STRATEGY; } else { if (object instanceof String) if (((String) object).contains("查看更多")) return TYPE_BUTTON; } return TYPE_TITLE; } public void setSearchMap(Map<Integer, Object> searchMap) { this.searchMap = searchMap; notifyDataSetChanged(); } public class AttractionViewHolder extends RecyclerView.ViewHolder { public final View mView; public final ImageView picture; public final TextView name; public AttractionViewHolder(View view) { super(view); mView = view; picture = (ImageView) view.findViewById(R.id.picture); name = (TextView) view.findViewById(R.id.description); } } public class TravelsViewHolder extends RecyclerView.ViewHolder { public final View mView; public final ImageView picture, user_pic; public final TextView description, user_name; public TravelsViewHolder(View view) { super(view); mView = view; picture = (ImageView) view.findViewById(R.id.picture); description = (TextView) view.findViewById(R.id.description); user_pic = (ImageView) view.findViewById(R.id.user_pic); user_name = (TextView) view.findViewById(R.id.user_name); } } public class StrategyViewHolder extends RecyclerView.ViewHolder { public final View mView; public final ImageView picture; public final TextView name; public StrategyViewHolder(View view) { super(view); mView = view; picture = (ImageView) view.findViewById(R.id.picture); name = (TextView) view.findViewById(R.id.description); } } public class TitleViewHolder extends RecyclerView.ViewHolder { public final View mView; public final TextView title; public TitleViewHolder(View view) { super(view); mView = view; title = (TextView) view.findViewById(R.id.title); } } public class ButtonViewHolder extends RecyclerView.ViewHolder { public final View mView; public final TextView button; public ButtonViewHolder(View view) { super(view); mView = view; button = (TextView) view.findViewById(R.id.button); } } }
[ "923847753@qq.com" ]
923847753@qq.com
d65a58af7ab559b7c37010efbcad1d6a80c1b775
70c0a1a75eb4da6c2859bbb8b93e736b373ccf33
/src/main/java/com/fpe/quiz/service/impl/EtudiantQuizParcourServiceImp.java
1db38d01c443fc5dffcfc5e158c69aa9e97f98db
[]
no_license
mohamederrajy/QuizService
e52d2a54acc08c048977f3e7c00bfbff3d689f75
5d83353f51b01ff4b30953420870ce895caf2f87
refs/heads/master
2023-05-31T18:59:01.609533
2021-06-23T00:22:16
2021-06-23T00:22:16
376,816,326
0
0
null
null
null
null
UTF-8
Java
false
false
1,724
java
package com.fpe.quiz.service.impl; import com.fpe.quiz.Dao.EtudiantQuizParcourDao; import com.fpe.quiz.Dao.QuizParcourDao; import com.fpe.quiz.model.EtudiantQuizParcour; import com.fpe.quiz.model.QuizParcour; import com.fpe.quiz.service.EtudiantQuizParcourService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; @Service public class EtudiantQuizParcourServiceImp implements EtudiantQuizParcourService { @Autowired EtudiantQuizParcourDao etudiantQuizParcourDao; @Autowired QuizParcourDao quizParcourDao ; @Override public int save(EtudiantQuizParcour etudiantQuizParcour, Long idetudiant, Long Idquiz) { QuizParcour quizParcour = quizParcourDao.findById(Idquiz).get(); if(etudiantQuizParcour!=null && idetudiant!=null && quizParcour!=null){ etudiantQuizParcour.setIdetudiant(idetudiant); etudiantQuizParcour.setQuizParcour(quizParcour); etudiantQuizParcour.setDatedepass(new Date()); etudiantQuizParcourDao.save(etudiantQuizParcour); return 1; } return 0; } @Override public List<EtudiantQuizParcour> findAll() { return etudiantQuizParcourDao.findAll(); } @Override public EtudiantQuizParcour findById(long id) { return etudiantQuizParcourDao.findById(id).get(); } @Override public void deleteById(Long id) { etudiantQuizParcourDao.deleteById(id); } @Override public EtudiantQuizParcour findEtudiantQuizCourByEtudiant(long id) { return etudiantQuizParcourDao.findEtudiantQuizCourByIdetudiant(id); } }
[ "errajy@DESKTOP-59B7N37" ]
errajy@DESKTOP-59B7N37
c7e84be9fc44a15454564d211281e0a7f1e24eb4
bf4fe14865f1fcfec43730aa2cbc80ad1ce22d92
/Toast/dene/Renkler/gen/com/esc/renkler/BuildConfig.java
3355726d19d18b8454e2d92c8c24eaa6f02b8395
[]
no_license
esrazngn/Android
09e876988770170e0112697f5d9a173c55829ca8
fc681e186bd4658d6650aec7309342719e3db640
refs/heads/master
2021-01-18T14:48:56.438992
2014-02-25T20:31:04
2014-02-25T20:31:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
157
java
/** Automatically generated file. DO NOT MODIFY */ package com.esc.renkler; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "esra.zengin@bil.omu.edu.tr" ]
esra.zengin@bil.omu.edu.tr
cd19e6b07055d06d6cec5da121b372ac8d749bde
86d08fe0a26f5cd72036abfb2f4a3766a625783a
/service-user/src/main/java/com/meizhi/config/SwaggerConfig.java
6fcaa75420a50a65a9acc356647a473b65dbefec
[]
no_license
xq85782621/springcloud-demo
f1be558b899187acb25348f88031d708b1d21849
cf6f6e9d64a4b160b139d187a4908ccdaac4b53f
refs/heads/master
2021-06-21T08:02:22.112986
2019-11-28T08:02:43
2019-11-28T08:02:43
223,077,574
0
0
null
2021-06-04T22:04:58
2019-11-21T03:11:29
Java
UTF-8
Java
false
false
1,212
java
package com.meizhi.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage("com.meizhi")) .paths(PathSelectors.any()) .build(); } // 创建api的基本信息 private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("集成Swagger2构建RESTful APIs") .description("集成Swagger2构建RESTful APIs") .version("1.0.0") .build(); } }
[ "85782621@qq.com" ]
85782621@qq.com
5cf288bc28ffe74395c6890b3a981edfc7cbfafc
c11a838e3224316b826a7a77fae4155c53e7b8a5
/AndroidProjects/Eclipse/E-Commerce Android App/src/com/solodroid/ecommerce/ActivityMenuDetail.java
b4dab5d991de5771ecdecc1d75f87f735556cecc
[]
no_license
pimenlabs/EcommerceAndroidApp
b28b5a35580a2ab5b2f8401d74e18aa99ea623b2
52939b3f21a06936ff00fa5c702367e3f0faa1a3
refs/heads/master
2021-01-01T05:12:06.492952
2016-04-14T18:07:34
2016-04-14T18:07:34
56,259,316
5
2
null
null
null
null
UTF-8
Java
false
false
10,548
java
package com.solodroid.ecommerce; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.text.DecimalFormat; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.HttpConnectionParams; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; import android.database.SQLException; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Bundle; import android.text.InputFilter; import android.text.InputType; import android.util.DisplayMetrics; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebView; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.ScrollView; import android.widget.TextView; public class ActivityMenuDetail extends Activity { ImageView imgPreview; TextView txtText, txtSubText; WebView txtDescription; Button btnAdd; ScrollView sclDetail; ProgressBar prgLoading; TextView txtAlert; // declare dbhelper object static DBHelper dbhelper; // declare ImageLoader object ImageLoader imageLoader; // declare variables to store menu data String Menu_image, Menu_name, Menu_serve, Menu_description; double Menu_price; int Menu_quantity; long Menu_ID; String MenuDetailAPI; int IOConnect = 0; // create price format DecimalFormat formatData = new DecimalFormat("#.##"); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu_detail); ActionBar bar = getActionBar(); bar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.header))); bar.setTitle("Detail Menu"); bar.setDisplayHomeAsUpEnabled(true); bar.setHomeButtonEnabled(true); imgPreview = (ImageView) findViewById(R.id.imgPreview); txtText = (TextView) findViewById(R.id.txtText); txtSubText = (TextView) findViewById(R.id.txtSubText); txtDescription = (WebView) findViewById(R.id.txtDescription); btnAdd = (Button) findViewById(R.id.btnAdd); sclDetail = (ScrollView) findViewById(R.id.sclDetail); prgLoading = (ProgressBar) findViewById(R.id.prgLoading); txtAlert = (TextView) findViewById(R.id.txtAlert); // get screen device width and height DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int wPix = dm.widthPixels; int hPix = wPix / 2 + 50; // change menu image width and height LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(wPix, hPix); imgPreview.setLayoutParams(lp); imageLoader = new ImageLoader(ActivityMenuDetail.this); dbhelper = new DBHelper(this); // get menu id that sent from previous page Intent iGet = getIntent(); Menu_ID = iGet.getLongExtra("menu_id", 0); // Menu detail API url MenuDetailAPI = Constant.MenuDetailAPI+"?accesskey="+Constant.AccessKey+"&menu_id="+Menu_ID; // call asynctask class to request data from server new getDataTask().execute(); // event listener to handle add button when clicked btnAdd.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // TODO Auto-generated method stub // show input dialog inputDialog(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_detail, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. switch (item.getItemId()) { case R.id.cart: // refresh action Intent iMyOrder = new Intent(ActivityMenuDetail.this, ActivityCart.class); startActivity(iMyOrder); overridePendingTransition (R.anim.open_next, R.anim.close_next); return true; case android.R.id.home: // app icon in action bar clicked; go home this.finish(); overridePendingTransition(R.anim.open_main, R.anim.close_next); return true; default: return super.onOptionsItemSelected(item); } } // method to show number of order form void inputDialog(){ // open database first try{ dbhelper.openDataBase(); }catch(SQLException sqle){ throw sqle; } AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(R.string.order); alert.setMessage(R.string.number_order); alert.setCancelable(false); final EditText edtQuantity = new EditText(this); int maxLength = 3; edtQuantity.setFilters(new InputFilter[] {new InputFilter.LengthFilter(maxLength)}); edtQuantity.setInputType(InputType.TYPE_CLASS_NUMBER); alert.setView(edtQuantity); alert.setPositiveButton("Add", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { String temp = edtQuantity.getText().toString(); int quantity = 0; // when add button clicked add menu to order table in database if(!temp.equalsIgnoreCase("")){ quantity = Integer.parseInt(temp); if(dbhelper.isDataExist(Menu_ID)){ dbhelper.updateData(Menu_ID, quantity, (Menu_price*quantity)); }else{ dbhelper.addData(Menu_ID, Menu_name, quantity, (Menu_price*quantity)); } }else{ dialog.cancel(); } } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // when cancel button clicked close dialog dialog.cancel(); } }); alert.show(); } // asynctask class to handle parsing json in background public class getDataTask extends AsyncTask<Void, Void, Void>{ // show progressbar first getDataTask(){ if(!prgLoading.isShown()){ prgLoading.setVisibility(0); txtAlert.setVisibility(8); } } @Override protected Void doInBackground(Void... arg0) { // TODO Auto-generated method stub // parse json data from server in background parseJSONData(); return null; } @Override protected void onPostExecute(Void result) { // TODO Auto-generated method stub // when finish parsing, hide progressbar prgLoading.setVisibility(8); // if internet connection and data available show data // otherwise, show alert text if((Menu_name != null) && IOConnect == 0){ sclDetail.setVisibility(0); imageLoader.DisplayImage(Constant.AdminPageURL+Menu_image, imgPreview); txtText.setText(Menu_name); txtSubText.setText("Price : " +Menu_price+" "+ActivityMenuList.Currency+"\n"+"Status : "+Menu_serve+"\n"+"Stock : "+Menu_quantity); txtDescription.loadDataWithBaseURL("", Menu_description, "text/html", "UTF-8", ""); txtDescription.setBackgroundColor(Color.parseColor("#e7e7e7")); }else{ txtAlert.setVisibility(0); } } } // method to parse json data from server public void parseJSONData(){ try { // request data from menu detail API HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), 15000); HttpConnectionParams.setSoTimeout(client.getParams(), 15000); HttpUriRequest request = new HttpGet(MenuDetailAPI); HttpResponse response = client.execute(request); InputStream atomInputStream = response.getEntity().getContent(); BufferedReader in = new BufferedReader(new InputStreamReader(atomInputStream)); String line; String str = ""; while ((line = in.readLine()) != null){ str += line; } // parse json data and store into tax and currency variables JSONObject json = new JSONObject(str); JSONArray data = json.getJSONArray("data"); // this is the "items: [ ] part for (int i = 0; i < data.length(); i++) { JSONObject object = data.getJSONObject(i); JSONObject menu = object.getJSONObject("Menu_detail"); Menu_image = menu.getString("Menu_image"); Menu_name = menu.getString("Menu_name"); Menu_price = Double.valueOf(formatData.format(menu.getDouble("Price"))); Menu_serve = menu.getString("Serve_for"); Menu_description = menu.getString("Description"); Menu_quantity = menu.getInt("Quantity"); } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block IOConnect = 1; e.printStackTrace(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // close database before back to previous page @Override public void onBackPressed() { // TODO Auto-generated method stub super.onBackPressed(); dbhelper.close(); finish(); overridePendingTransition(R.anim.open_main, R.anim.close_next); } @Override protected void onDestroy() { // TODO Auto-generated method stub //imageLoader.clearCache(); super.onDestroy(); } @Override public void onConfigurationChanged(final Configuration newConfig) { // Ignore orientation change to keep activity from restarting super.onConfigurationChanged(newConfig); } }
[ "pimenlabs@gmail.com" ]
pimenlabs@gmail.com
03d0921f063a789f7580f4080a1433d1b2b9308b
3a48cbf50e65b386c4d42559ca3e00a40e822359
/S2HShop/src/main/java/com/ssh/shop/entity/FileImage.java
8efe6b9b50cfee21cf5758c09ff3b45b08ec6e1e
[]
no_license
TangZhong/donald
ef5401985385e163a5b25fcb43c3f8bde48c7340
a86073eb0ea807169f837d0997443e7da9b7ce83
refs/heads/master
2022-12-24T12:13:30.090997
2019-07-17T10:09:51
2019-07-17T10:09:51
49,957,749
0
0
null
2022-12-16T09:59:11
2016-01-19T14:24:05
Java
UTF-8
Java
false
false
865
java
package com.ssh.shop.entity; import java.io.File; public class FileImage { private File file; private String contentType; private String filename; public File getFile() { return file; } public String getContentType() { return contentType; } public void setFilename(String filename) { this.filename = filename; } public String getFilename() { return filename; } public void setUpload(File file) { //set方法可以不用和属性名一样,但是前台传进来时的参数得和set方法名相同。即前台传的参数为fileImage.upload this.file = file; } public void setUploadContentType(String contentType) { this.contentType = contentType; } public void setUploadFileName(String filename) { this.filename = filename; } }
[ "zhong_tang@tom.com" ]
zhong_tang@tom.com
f94ba8d3c4bbd8ec8975cc49425a0619cb787005
41f280c6e1927807c265bb92182d8f699c41cf35
/hwork-security-app/src/main/java/com/hwork/app/authentication/CustomAuthenticationSuccessHandler.java
a7d76e205ed93946bd99ded93ddff67b62ff574f
[]
no_license
yangshengju/hwork-security
500a6628b35213020c5b40852250b222a8ecf3c7
943b3bf412db14f85705baf64065dc964b13fa65
refs/heads/master
2020-06-06T02:21:40.615855
2020-04-20T09:20:22
2020-04-20T09:20:22
192,611,874
0
0
null
2023-09-08T12:20:26
2019-06-18T20:59:53
Java
UTF-8
Java
false
false
4,655
java
package com.hwork.app.authentication; import com.fasterxml.jackson.databind.ObjectMapper; import com.hwork.core.properties.SecurityProperties; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.core.Authentication; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException; import org.springframework.security.oauth2.provider.*; import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices; import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; import org.springframework.stereotype.Component; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Base64; @Component("customAuthenticationSuccessHandler") @Slf4j public class CustomAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { private final ObjectMapper objectMapper; private final SecurityProperties securityProperties; private final ClientDetailsService clientDetailsService; private final AuthorizationServerTokenServices defaultAuthorizationServerTokenServices; private final PasswordEncoder passwordEncoder; @Autowired public CustomAuthenticationSuccessHandler(ObjectMapper objectMapper, SecurityProperties securityProperties, ClientDetailsService clientDetailsService, AuthorizationServerTokenServices defaultAuthorizationServerTokenServices, PasswordEncoder passwordEncoder) { this.objectMapper = objectMapper; this.securityProperties = securityProperties; this.clientDetailsService = clientDetailsService; this.defaultAuthorizationServerTokenServices = defaultAuthorizationServerTokenServices; this.passwordEncoder = passwordEncoder; } @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { log.info("认证成功,enter onAuthenticationSuccess method..."); String header = request.getHeader("Authorization"); if (header == null || !header.startsWith("Basic ")) { throw new UnapprovedClientAuthenticationException("请求头中无client信息"); } String[] tokens = extractAndDecodeHeader(header, request); assert tokens.length == 2; String clientId = tokens[0]; String clientSecret = tokens[1]; ClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId); if (clientDetails == null) { throw new UnapprovedClientAuthenticationException("clientId对应的配置信息不存在:" + clientId); } else if (!passwordEncoder.matches(clientSecret,clientDetails.getClientSecret())) { throw new UnapprovedClientAuthenticationException("clientSecret不匹配:" + clientId); } TokenRequest tokenRequest = new TokenRequest(MapUtils.EMPTY_SORTED_MAP, clientId, clientDetails.getScope(), "custom"); OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(clientDetails); OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(oAuth2Request, authentication); OAuth2AccessToken token = defaultAuthorizationServerTokenServices.createAccessToken(oAuth2Authentication); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(objectMapper.writeValueAsString(token)); } private String[] extractAndDecodeHeader(String header, HttpServletRequest request) throws IOException { byte[] base64Token = header.substring(6).getBytes("UTF-8"); byte[] decoded; try { decoded = Base64.getDecoder().decode(base64Token); } catch (IllegalArgumentException e) { throw new BadCredentialsException("Failed to decode basic authentication token"); } String token = new String(decoded, "UTF-8"); int delim = token.indexOf(":"); if (delim == -1) { throw new BadCredentialsException("Invalid basic authentication token"); } return new String[] { token.substring(0, delim), token.substring(delim + 1) }; } }
[ "yangshengju@jsh.com" ]
yangshengju@jsh.com
2f2389e5df4c97a2767ac5eaa37894ede6c604e3
547bcc712dd4eac9b3f6a2c2df3155e30d864080
/BIZ_hong/src/programing_10강/Examtable_2.java
91a5274c8fc5d8333eea6e4bed5bbc5997eb2881
[]
no_license
betodo/polytech
d01cfccb076df289d6a879101b555e7e5ac13660
69979786b85d8595e56f586fe087e64c9a1823bd
refs/heads/master
2020-08-04T06:47:38.758235
2019-10-01T08:07:12
2019-10-01T08:07:12
212,043,733
0
0
null
null
null
null
UHC
Java
false
false
803
java
package programing_10강; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class Examtable_2 { public static void main(String[] args) throws ClassNotFoundException, SQLException { // TODO Auto-generated method stub Class.forName("com.mysql.cj.jdbc.Driver"); //jdbc드라이버를 호출(java와 db connector) Connection conn = DriverManager.getConnection //("jdbc:mysql://192.168.23.96:3306/songdb","root","1234"); 에러 ("jdbc:mysql://192.168.56.102:3306/songdb","root","1234"); //커넥션 놓는 위치 설정 즉 db와 연결 Statement stmt = conn.createStatement(); //명령창호출 stmt.execute("drop table examtable;");//테이블 지우기 stmt.close(); conn.close(); } }
[ "betodo03@gamil.com" ]
betodo03@gamil.com
edaad475f6f9bf198c58eb4d0ab5ce62bc34c4d7
e909209c914de34dc84bd801c13a94a388bd79b8
/src/main/java/com/imqk/spark/api/java/Sql/SparSQLdbc2ThriftServer.java
62453d0daf61145383a48cd691dac7c451d4e64e
[]
no_license
ShellMount/StudySparkV3
259b48a0a54c6be897c4c8964c34ba62cf60ac59
74509d43d581f8251492e3902d46b3ed6d68aee1
refs/heads/master
2021-01-25T04:41:50.713588
2017-06-06T02:05:45
2017-06-06T02:05:45
93,465,170
1
0
null
null
null
null
UTF-8
Java
false
false
1,938
java
package com.imqk.spark.api.java.Sql; import java.sql.*; /** * 用编程的方式,通过JDBC的方式访问 Thrift Server,进而访问HIVE数据,并处理数据 * 这是企业中常用的方式 * Thrift Server 是个桥梁,但它比存HIVE命令行中操作更快(如 count 等操作时) * * 跟我们平常访问 HIVE 及数据操作相当不同哟,连 SparkContext 都不需要了 * * 本代码不能跑在本地。 * Created by 428900 on 2017/5/12. */ public class SparSQLdbc2ThriftServer { public static void main(String[] args) { // 注意,使用JDBC连接服务器的时候,服务器端需用如下方式启动 // $ ./start-thriftserver.sh --master spark://sparkmaster:7077 --hiveconf hive.server2.transport.mode=http --hiveconf hive.server2.thrift.http.path=cliservice String sqlText = "SELECT COUNT(*) FROM if0000 WHERE Open > ?"; Connection conn = null; ResultSet resultSet = null; try { Class.forName("org.apache.hive.jdbc.HiveDriver"); conn = DriverManager.getConnection("jdbc:hive2://master:10001/datatick?" + "hive.server2.transport.mode=http;hive.server2.thrift.http.path=cliservice", "root", ""); PreparedStatement prepareStatement = conn.prepareStatement(sqlText); // prepareStatement: 本方式连接可防SQL注入 prepareStatement.setInt(1, 20); resultSet = prepareStatement.executeQuery(); while(resultSet.next()){ System.out.println(resultSet.getString(1)); // 此处的数据可保存到 parquet 中 } } catch (Exception e) { e.printStackTrace(); } finally { try { resultSet.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
[ "xieyie@qq.com" ]
xieyie@qq.com
63247ca4e4cc7e41478a41fe1a808399caeb3a12
a75c4005543a34f799d56521dc51f80a321c710c
/src/main/java/com/apihackathon/TeamsparksApplication.java
1c671bfd3a722dace683ea2853aeb5dc353e8894
[]
no_license
techlearner/apihakathon-teamsparks
2d8600137110a8f5c09c811beca7ba5485499301
8ddfb2f3b18b59c579f80405818e51be177b61f5
refs/heads/master
2021-01-10T02:52:04.119225
2015-12-12T12:50:57
2015-12-12T12:50:57
47,868,964
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.apihackathon; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class TeamsparksApplication { public static void main(String[] args) { SpringApplication.run(TeamsparksApplication.class, args); } }
[ "ssenthilkumar.cs@gmail.com" ]
ssenthilkumar.cs@gmail.com
082092d5080e23aeae32313f118af33c70477612
396a17dd5368e5c585f1633c14aa1c6ca9c5a658
/app/src/androidTest/java/com/example/nurad/acivitydanfragment/ExampleInstrumentedTest.java
33a47b406734fe05aa481265e7e12cebd39c6e2f
[]
no_license
mmnuradityo/Tugas_Fragment
2d4cf8af5972bf7a1e9b57f2547fdc96e10688c0
594e6503f4df52c581c470f1e18bcad46fde257c
refs/heads/master
2020-03-29T22:21:50.295841
2018-09-26T14:57:13
2018-09-26T14:57:13
150,416,369
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.example.nurad.acivitydanfragment; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.nurad.acivitydanfragment", appContext.getPackageName()); } }
[ "nuradityo@gmail.com" ]
nuradityo@gmail.com
90ebac6710497edc71cd3c5b9670a13d97721f46
34519301a349d84ead70eca116c7a71fc9605450
/Music/src/main/java/com/niit/Music/controller/CartResources.java
9e97f1629fbe1b1b64bdee728928604513c0ef46
[]
no_license
Supratik07/Project_1
d36bf774c5959ff3b024432593b20fb7710a6013
12a04861edbabf437e7f075d9c8792538f397d1c
refs/heads/master
2020-12-31T07:41:48.457811
2017-04-01T13:40:57
2017-04-01T13:40:57
86,543,910
0
0
null
null
null
null
UTF-8
Java
false
false
3,548
java
package com.niit.Music.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.core.userdetails.User; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import com.niit.Music.model.Cart; import com.niit.Music.model.CartItem; import com.niit.Music.model.Customer; import com.niit.Music.model.Product; import com.niit.Music.service.CartItemService; import com.niit.Music.service.CartService; import com.niit.Music.service.CustomerService; import com.niit.Music.service.ProductService; import java.util.List; @Controller @RequestMapping("/rest/cart") public class CartResources { @Autowired private CartService cartService; @Autowired private CartItemService cartItemService; @Autowired private CustomerService customerService; @Autowired private ProductService productService; @RequestMapping("/{cartId}") public @ResponseBody Cart getCartById(@PathVariable(value = "cartId") int cartId){ return cartService.getCartById(cartId); } @RequestMapping(value = "/add/{productId}", method = RequestMethod.PUT) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void addItem (@PathVariable(value = "productId") int productId, @AuthenticationPrincipal User activeUser){ Customer customer = customerService.getCustomerByUsername(activeUser.getUsername()); Cart cart = customer.getCart(); Product product = productService.getProductById(productId); List<CartItem> cartItems = cart.getCartItems(); for (int i=0; i < cartItems.size(); i++){ if(product.getProductId() == cartItems.get(i).getProduct().getProductId()){ CartItem cartItem = cartItems.get(i); cartItem.setQuantity(cartItem.getQuantity() + 1); cartItem.setTotalPrice(product.getProductPrice()*cartItem.getQuantity()); cartItemService.addCartItem(cartItem); return; } } CartItem cartItem = new CartItem(); cartItem.setProduct(product); cartItem.setQuantity(1); cartItem.setTotalPrice(product.getProductPrice()*cartItem.getQuantity()); cartItem.setCart(cart); cartItemService.addCartItem(cartItem); } @RequestMapping(value = "/remove/{productId}", method = RequestMethod.PUT) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void removeItem(@PathVariable(value = "productId") int productId){ CartItem cartItem = cartItemService.getCartItemByProductId(productId); cartItemService.removeCartItem(cartItem); } @RequestMapping(value = "/{cartId}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void clearCart(@PathVariable(value = "cartId") int cartId){ Cart cart = cartService.getCartById(cartId); cartItemService.removeAllCartItems(cart); } @ExceptionHandler(IllegalArgumentException.class) @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "Illegal request, please verify your payload") public void handleClientErrors (Exception ex){ } @ExceptionHandler(Exception.class) @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR, reason = "Internal Server Error") public void handleServerErrors (Exception ex){ } } // The End of Class;
[ "supratik2pyne@gmail.com" ]
supratik2pyne@gmail.com
bafa183172cfbfb356fdae125445ba80a088bf5b
1d7cd4981c57da24968246d003041cb583275c1d
/app/src/main/java/com/inved/go4lunch/view/WorkmatesAdapter.java
81a65e0192a4e558d22c0ab7334c2b9255c63c99
[]
no_license
inveders/Go4lunch
4611a7db0f6591a82d12d8982bb766a57d8d13a0
34446bb8636e28976e232fa972513e858fc7c812
refs/heads/master1
2023-01-21T07:01:13.673855
2019-11-20T08:45:25
2019-11-20T08:45:25
190,248,459
0
0
null
2023-01-09T11:57:55
2019-06-04T17:26:07
Java
UTF-8
Java
false
false
1,959
java
package com.inved.go4lunch.view; import android.content.Context; import android.view.LayoutInflater; import android.view.ViewGroup; import androidx.annotation.NonNull; import com.bumptech.glide.RequestManager; import com.firebase.ui.firestore.FirestoreRecyclerAdapter; import com.firebase.ui.firestore.FirestoreRecyclerOptions; import com.inved.go4lunch.R; import com.inved.go4lunch.controller.activity.RestaurantActivity; import com.inved.go4lunch.controller.activity.ViewPlaceActivity; import com.inved.go4lunch.firebase.User; public class WorkmatesAdapter extends FirestoreRecyclerAdapter<User, WorkmatesViewHolder> { private Context context; public interface Listener { void onDataChanged(); } //FOR DATA private final RequestManager glide; //FOR COMMUNICATION private Listener callback; public WorkmatesAdapter(@NonNull FirestoreRecyclerOptions<User> options, RequestManager glide, Listener callback, Context context) { super(options); this.glide = glide; this.callback = callback; this.context=context; } @Override protected void onBindViewHolder(@NonNull WorkmatesViewHolder workmatesViewHolder, int position, @NonNull User user) { if(context.getClass().equals(ViewPlaceActivity.class) ){ workmatesViewHolder.updateWithWorkmatesJoining(user, this.glide); } else if(context.getClass().equals(RestaurantActivity.class)) { workmatesViewHolder.updateWithUsers(user, this.glide); } } @NonNull @Override public WorkmatesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new WorkmatesViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.fragment_people_item, parent, false)); } @Override public void onDataChanged(){ super.onDataChanged(); this.callback.onDataChanged(); } }
[ "alexandra.gnimadi@gmail.com" ]
alexandra.gnimadi@gmail.com
b80b1de566df504557ec9c3edcf7570c5c001240
fff8d45864fdca7f43e6d65acbe4c1f469531877
/erp_ejb_resources/lib/persistence/jboss/respaldo/hibernate-validator-3.1.0.GA-sources/org/hibernate/validator/CreditCardNumber.java
ec68dd3cb61a801fb429c6081f0cf4bf34c0ea71
[ "Apache-2.0" ]
permissive
jarocho105/pre2
26b04cc91ff1dd645a6ac83966a74768f040f418
f032fc63741b6deecdfee490e23dfa9ef1f42b4f
refs/heads/master
2020-09-27T16:16:52.921372
2016-09-01T04:34:56
2016-09-01T04:34:56
67,095,806
1
0
null
null
null
null
UTF-8
Java
false
false
796
java
//$Id: CreditCardNumber.java 15133 2008-08-20 10:05:57Z hardy.ferentschik $ package org.hibernate.validator; import java.lang.annotation.Documented; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * The annotated element has to represent a valid * credit card number. This is the Luhn algorithm implementation * which aims to check for user mistake, not credit card validity! * * @author Emmanuel Bernard */ @Documented @ValidatorClass( CreditCardNumberValidator.class) @Target({ElementType.METHOD, ElementType.FIELD}) @Retention( RetentionPolicy.RUNTIME ) public @interface CreditCardNumber { String message() default "{validator.creditCard}"; }
[ "byrondanilo10@hotmail.com" ]
byrondanilo10@hotmail.com
8fa1e3c529967690ce925205c8af09a5f3c3c05b
5aa59ec05e9b5c3c9009fc18331fd83828001f5e
/app/src/main/java/cay/com/xiaowei/Activity/RegisterActivity.java
28e6fe8efdfd49447168a2a7576c4c7094b3ae4d
[]
no_license
Cay-chen/XiaoWei
be85affd8818a92e9b8d2f670ff0519dfa662050
47f6c4489174f355627fabeec5dfb0c671cf45d0
refs/heads/master
2021-01-17T17:40:30.938966
2016-10-18T07:27:31
2016-10-18T07:27:31
64,890,606
0
0
null
null
null
null
UTF-8
Java
false
false
9,202
java
package cay.com.xiaowei.Activity; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.alibaba.fastjson.JSON; import java.io.IOException; import cay.com.xiaowei.Bean.Person; import cay.com.xiaowei.R; import okhttp3.Call; import okhttp3.Callback; import okhttp3.FormBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; /** * Created by Cay on 2016/9/14. */ public class RegisterActivity extends AppCompatActivity { private final static String url = "http://118.192.157.178:8080/XiaoWei/servlet/Ycode"; private final static String urlLogin = "http://118.192.157.178:8080/XiaoWei/servlet/SingUp"; private EditText eMail;//邮箱账号输入 private EditText ePassword;//密码输入 private EditText erPpasswprd;//二次密码输入 private TextView eTextView;//返回登陆 private EditText eNikeName;//昵称输入 private Button reButton;//注册按钮 private String mail = null;//获得邮箱 private String pwd = null;//获得密码 private String rpwd = null;//再次获得密码 private String nikeName = null;//获得昵称 private TextView tvMail;//发送显示邮箱号 private LinearLayout llLogin;//注册界面 private LinearLayout llCode;//验证码界面 private LinearLayout llScueess;//注册成功界面 private Person person; private Button mLoginNextButton;//验证码 按钮 private EditText mCode;//验证码输入 private String yCode;//获取到的验证码 private Button btnBackLogin;//注册成功返回登陆 //发送注册Handler private Handler codeHandler = new Handler() { @Override public void handleMessage(Message msg) { String resuloy = msg.obj.toString(); person = JSON.parseObject(resuloy,Person.class); if (person.resCode.equals("30001")) { llLogin.setVisibility(View.GONE); llCode.setVisibility(View.GONE); llScueess.setVisibility(View.VISIBLE); } else if (person.resCode.equals("30002")) { Toast.makeText(RegisterActivity.this, "验证码错误", Toast.LENGTH_LONG).show(); } else if (person.resCode.equals("30003")) { Toast.makeText(RegisterActivity.this, "验证码过期", Toast.LENGTH_LONG).show(); } else if (person.resCode.equals("30004")) { Toast.makeText(RegisterActivity.this, "账号已注册成功", Toast.LENGTH_LONG).show(); } else { Toast.makeText(RegisterActivity.this, "系统异常", Toast.LENGTH_LONG).show(); } } }; //发送验证码Handler private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { String resuloy = msg.obj.toString(); person = JSON.parseObject(resuloy, Person.class); if (person.resCode.equals("10001")) { llLogin.setVisibility(View.GONE); llCode.setVisibility(View.VISIBLE); tvMail.setText(mail); } else if (person.resCode.equals("10002")) { Toast.makeText(RegisterActivity.this, "该账号已经被注册", Toast.LENGTH_LONG).show(); } else { Toast.makeText(RegisterActivity.this, "系统异常", Toast.LENGTH_LONG).show(); } } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); initViews(); reButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mail = eMail.getText().toString(); pwd = ePassword.getText().toString(); rpwd = erPpasswprd.getText().toString(); nikeName = eNikeName.getText().toString(); Log.i("TAG", "onClick: " + mail); if (!(mail.equals("")) && !(pwd.equals("")) && !(rpwd.equals("")) && !(nikeName.equals(""))) { if (pwd.equals(rpwd)) { OkHttpClient loginHttpClient = new OkHttpClient(); RequestBody requestBody = new FormBody.Builder().add("mail", mail).build(); Request request = new Request.Builder().url(url).post(requestBody).build(); Call call = loginHttpClient.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { } @Override public void onResponse(Call call, Response response) throws IOException { String result = response.body().string(); Message message = new Message(); message.obj = result; handler.sendMessage(message); } }); } else { Toast.makeText(RegisterActivity.this, "两次密码不一样", Toast.LENGTH_LONG).show(); } } else { if (mail.equals("")) { Toast.makeText(RegisterActivity.this, "请输入邮箱", Toast.LENGTH_LONG).show(); } else { if (nikeName.equals("")) { Toast.makeText(RegisterActivity.this, "请输入昵称", Toast.LENGTH_LONG).show(); } else { if (pwd.equals("")) { Toast.makeText(RegisterActivity.this, "请输入密码", Toast.LENGTH_LONG).show(); } else { if (rpwd.equals("")) { Toast.makeText(RegisterActivity.this, "请再次输入密码", Toast.LENGTH_LONG).show(); } } } } } } }); eTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); mLoginNextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Register(urlLogin); } }); btnBackLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); } /** * 初始化所有的按钮 */ private void initViews() { eMail = (EditText) findViewById(R.id.register_mail); ePassword = (EditText) findViewById(R.id.register_pwd); erPpasswprd = (EditText) findViewById(R.id.register_rpwd); reButton = (Button) findViewById(R.id.btn_register); eNikeName = (EditText) findViewById(R.id.register_nikeName); eTextView = (TextView) findViewById(R.id.tvLogin); llCode = (LinearLayout) findViewById(R.id.ll_code); llLogin = (LinearLayout) findViewById(R.id.ll_login); llScueess = (LinearLayout) findViewById(R.id.ll_login_success); tvMail = (TextView) findViewById(R.id.tv_mail); mLoginNextButton = (Button) findViewById(R.id.btn_loginNext); mCode = (EditText) findViewById(R.id.code); btnBackLogin = (Button) findViewById(R.id.btn_fLogin); } private void Register(String url) { yCode = mCode.getText().toString(); if (!(yCode.equals(""))) { OkHttpClient httpClient = new OkHttpClient(); RequestBody requestBody = new FormBody.Builder().add("mail", mail).add("password", pwd).add("nikeName", nikeName).add("yCode", yCode).build(); Request request = new Request.Builder().url(url).post(requestBody).build(); Call call = httpClient.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { } @Override public void onResponse(Call call, Response response) throws IOException { String result = response.body().string(); Message message = new Message(); message.obj = result; codeHandler.sendMessage(message); } }); } else { Toast.makeText(RegisterActivity.this, "请输入验证码", Toast.LENGTH_LONG).show(); } } }
[ "276495166@qq.com" ]
276495166@qq.com
4f172bb271b3c291983d87e81af6d8788d0c791b
30210f640ac2e0f0236471c23c464f8c78240840
/src/cs380/othello/OthelloMinimaxPlayer_ShangqiWu.java
9b718ef7baf000b88c6873f810b4a28bd577783b
[]
no_license
krrk2102/CS510_IntroAI_HW4
f9bf23cb31e64d7ef5561fa7b62b25374816b1e6
4eedd3b2639c42fbcbf4c2c474f420bfb0dc66dd
refs/heads/master
2021-01-10T07:59:41.206710
2015-10-23T21:05:28
2015-10-23T21:05:28
44,838,488
1
0
null
null
null
null
UTF-8
Java
false
false
3,209
java
package cs380.othello; import java.util.List; public class OthelloMinimaxPlayer_ShangqiWu extends OthelloPlayer { int depth_bound; int player_number; public OthelloMinimaxPlayer_ShangqiWu(int _depth_bound, int _player_number) { if (_depth_bound > 0) { depth_bound = _depth_bound; } else throw new IllegalArgumentException("Depth boundary for OthelloMinimaxPlayer constructor should be a positive integer.\n"); if (_player_number == 0 || _player_number == 1) { player_number = _player_number; } else throw new IllegalArgumentException("Player number for OthelloMinimaxPlayer constructor should be either 0 or 1.\n"); } /* * Inherited method, return search result of minimax algorithm under the required depth boundary. Also displays running time of the search. */ public OthelloMove getMove(OthelloState state) { long StartTime = System.currentTimeMillis(); OthelloMove minimax = minimaxMove(state); long EndTime = System.currentTimeMillis(); System.out.println("Time duration for this step of a OthelloMinimaxPlayer with depth boundary " + depth_bound + " is: " + (EndTime-StartTime) +" ms."); return minimax; } /* * Entry of minimax search, selecting max value from min-Value */ public OthelloMove minimaxMove(OthelloState _state) { int minimaxIndex = 0; Integer minimaxValue = new Integer(Integer.MIN_VALUE); List<OthelloMove> minimaxMove = _state.generateMoves(); if (!minimaxMove.isEmpty()) { for (int i = 0; i < minimaxMove.size(); i++) { Integer FromMin = MinValue(_state.applyMoveCloning(minimaxMove.get(i)), 0); if (minimaxValue < FromMin) { minimaxValue = FromMin; minimaxIndex = i; } } } else return null; return minimaxMove.get(minimaxIndex); } /* * Following are min-Value & max-Value functions. Terminal state is reaching the depth boundary or game over. */ private Integer MinValue(OthelloState _min_state, int _min_depth) { _min_depth++; Integer minValue = new Integer(Integer.MAX_VALUE); if (_min_depth < depth_bound && !_min_state.gameOver()) { // For each action in successors states, v = MIN(v, max-Value(state) List<OthelloMove> minMove = _min_state.generateMoves(); for (int i = 0; i < minMove.size(); i++) { Integer fromMaxValue = MaxValue(_min_state.applyMoveCloning(minMove.get(i)), _min_depth); if (minValue > fromMaxValue) { minValue = fromMaxValue; } } } else { // If terminal-test(state), return utility value. minValue = _min_state.score(); if (player_number == 1) { minValue = -minValue; } } return minValue; } private Integer MaxValue(OthelloState _max_state, int _max_depth) { _max_depth++; Integer maxValue = new Integer(Integer.MIN_VALUE); if (_max_depth < depth_bound && !_max_state.gameOver()) { List<OthelloMove> maxMove = _max_state.generateMoves(); for (int i = 0; i < maxMove.size(); i++) { Integer fromMinValue = MinValue(_max_state.applyMoveCloning(maxMove.get(i)), _max_depth); if (maxValue < fromMinValue) { maxValue = fromMinValue; } } } else { maxValue = _max_state.score(); if (player_number == 1) { maxValue = -maxValue; } } return maxValue; } }
[ "wushangqi@gmail.com" ]
wushangqi@gmail.com
d986850fd29b28f77b2b5874e3ca4b9f565c8e8f
353be9b017083c89c0e2101dce0e649dbd7cbadf
/e3mall-parent/e3mall-manager/e3mall-dao/src/main/java/cn/gdou/e3mall/mapper/TbOrderItemMapper.java
467b625d1173557b9a1f63fee3d1729e11a49936
[]
no_license
Hill1126/E3mall
beb100d7040cd1aefe5bbd6499b6858c0f46dc20
0f3673c0ee2910c2c7f8df66a73be97847d58793
refs/heads/master
2020-05-21T15:35:05.995582
2019-05-11T06:18:44
2019-05-11T06:18:44
186,094,474
0
0
null
null
null
null
UTF-8
Java
false
false
904
java
package cn.gdou.e3mall.mapper; import cn.gdou.e3mall.pojo.TbOrderItem; import cn.gdou.e3mall.pojo.TbOrderItemExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface TbOrderItemMapper { int countByExample(TbOrderItemExample example); int deleteByExample(TbOrderItemExample example); int deleteByPrimaryKey(String id); int insert(TbOrderItem record); int insertSelective(TbOrderItem record); List<TbOrderItem> selectByExample(TbOrderItemExample example); TbOrderItem selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") TbOrderItem record, @Param("example") TbOrderItemExample example); int updateByExample(@Param("record") TbOrderItem record, @Param("example") TbOrderItemExample example); int updateByPrimaryKeySelective(TbOrderItem record); int updateByPrimaryKey(TbOrderItem record); }
[ "1015599722@qq.com" ]
1015599722@qq.com
202fedb4b76bd2e34cc2ad63c9928065cbabfa19
2f64574b4a60e5e1ee150a1d8b69baeb0e89adc3
/BDLCompilerSource/gen/BoardParser.java
7903322b1d9be19435b5acb4fa0ea60034b6c3ab
[]
no_license
Unn4m3DD/BDL-Board-Description-Language
2f6fc93402fe714e47ffc247dc883d82add46616
9c7aeafda806fd1dd8ee73e65356b2356273ec81
refs/heads/master
2021-02-03T22:34:29.061815
2020-10-29T09:24:25
2020-10-29T09:24:25
243,559,692
3
2
null
2020-03-07T12:32:29
2020-02-27T16:14:57
Java
UTF-8
Java
false
false
81,633
java
// Generated from C:/dev/BDL-Board-Description-Language/CompilerSource/src\Board.g4 by ANTLR 4.8 import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; import java.util.Iterator; import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class BoardParser extends Parser { static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); } protected static final DFA[] _decisionToDFA; protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, INT=37, BOOL=38, EXPLICIT=39, ID=40, WS=41; public static final int RULE_game = 0, RULE_ruleSet = 1, RULE_ruleDef = 2, RULE_pieceDescriptions = 3, RULE_pieceDescription = 4, RULE_moves = 5, RULE_move = 6, RULE_moveFunction = 7, RULE_kills = 8, RULE_descriptionModifier = 9, RULE_endReachedAlternatives = 10, RULE_initialPiecePositions = 11, RULE_initialPiecePosition = 12, RULE_positions = 13, RULE_positionModifier = 14, RULE_invariantList = 15, RULE_invariant = 16, RULE_finish = 17, RULE_finishingRules = 18, RULE_vector = 19, RULE_interval = 20, RULE_explicitParsed = 21; private static String[] makeRuleNames() { return new String[] { "game", "ruleSet", "ruleDef", "pieceDescriptions", "pieceDescription", "moves", "move", "moveFunction", "kills", "descriptionModifier", "endReachedAlternatives", "initialPiecePositions", "initialPiecePosition", "positions", "positionModifier", "invariantList", "invariant", "finish", "finishingRules", "vector", "interval", "explicitParsed" }; } public static final String[] ruleNames = makeRuleNames(); private static String[] makeLiteralNames() { return new String[] { null, "'rules'", "'{'", "'}'", "'first_player'", "':'", "'width'", "'height'", "'coloring'", "'alternate'", "'player_change'", "'pieces'", "'moves'", "'horizontal'", "'('", "','", "')'", "'vertical'", "'diagonal'", "'kills'", "'can_jump'", "'mirrored'", "'on_end_reached'", "'spawn'", "'initial_piece_position'", "'positions'", "'owner'", "'invariants'", "'cant_risk'", "'protect_piece'", "'pawn_movement'", "'finish'", "'no_moves_available'", "'x'", "'y'", "'['", "']'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "INT", "BOOL", "EXPLICIT", "ID", "WS" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); /** * @deprecated Use {@link #VOCABULARY} instead. */ @Deprecated public static final String[] tokenNames; static { tokenNames = new String[_SYMBOLIC_NAMES.length]; for (int i = 0; i < tokenNames.length; i++) { tokenNames[i] = VOCABULARY.getLiteralName(i); if (tokenNames[i] == null) { tokenNames[i] = VOCABULARY.getSymbolicName(i); } if (tokenNames[i] == null) { tokenNames[i] = "<INVALID>"; } } } @Override @Deprecated public String[] getTokenNames() { return tokenNames; } @Override public Vocabulary getVocabulary() { return VOCABULARY; } @Override public String getGrammarFileName() { return "Board.g4"; } @Override public String[] getRuleNames() { return ruleNames; } @Override public String getSerializedATN() { return _serializedATN; } @Override public ATN getATN() { return _ATN; } public BoardParser(TokenStream input) { super(input); _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); } public static class GameContext extends ParserRuleContext { public RuleSetContext ruleSet() { return getRuleContext(RuleSetContext.class,0); } public PieceDescriptionsContext pieceDescriptions() { return getRuleContext(PieceDescriptionsContext.class,0); } public InitialPiecePositionsContext initialPiecePositions() { return getRuleContext(InitialPiecePositionsContext.class,0); } public InvariantListContext invariantList() { return getRuleContext(InvariantListContext.class,0); } public FinishContext finish() { return getRuleContext(FinishContext.class,0); } public TerminalNode EOF() { return getToken(BoardParser.EOF, 0); } public GameContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_game; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterGame(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitGame(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitGame(this); else return visitor.visitChildren(this); } } public final GameContext game() throws RecognitionException { GameContext _localctx = new GameContext(_ctx, getState()); enterRule(_localctx, 0, RULE_game); try { enterOuterAlt(_localctx, 1); { setState(44); ruleSet(); setState(45); pieceDescriptions(); setState(46); initialPiecePositions(); setState(47); invariantList(); setState(48); finish(); setState(49); match(EOF); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class RuleSetContext extends ParserRuleContext { public List<RuleDefContext> ruleDef() { return getRuleContexts(RuleDefContext.class); } public RuleDefContext ruleDef(int i) { return getRuleContext(RuleDefContext.class,i); } public RuleSetContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_ruleSet; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterRuleSet(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitRuleSet(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitRuleSet(this); else return visitor.visitChildren(this); } } public final RuleSetContext ruleSet() throws RecognitionException { RuleSetContext _localctx = new RuleSetContext(_ctx, getState()); enterRule(_localctx, 2, RULE_ruleSet); int _la; try { enterOuterAlt(_localctx, 1); { setState(51); match(T__0); setState(52); match(T__1); setState(56); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << T__5) | (1L << T__6) | (1L << T__7) | (1L << T__9))) != 0)) { { { setState(53); ruleDef(); } } setState(58); _errHandler.sync(this); _la = _input.LA(1); } setState(59); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class RuleDefContext extends ParserRuleContext { public RuleDefContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_ruleDef; } public RuleDefContext() { } public void copyFrom(RuleDefContext ctx) { super.copyFrom(ctx); } } public static class RulePropContext extends RuleDefContext { public TerminalNode INT() { return getToken(BoardParser.INT, 0); } public RulePropContext(RuleDefContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterRuleProp(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitRuleProp(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitRuleProp(this); else return visitor.visitChildren(this); } } public static class RuleColoringContext extends RuleDefContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public RuleColoringContext(RuleDefContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterRuleColoring(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitRuleColoring(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitRuleColoring(this); else return visitor.visitChildren(this); } } public static class RulePlayerChangeContext extends RuleDefContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public RulePlayerChangeContext(RuleDefContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterRulePlayerChange(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitRulePlayerChange(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitRulePlayerChange(this); else return visitor.visitChildren(this); } } public final RuleDefContext ruleDef() throws RecognitionException { RuleDefContext _localctx = new RuleDefContext(_ctx, getState()); enterRule(_localctx, 4, RULE_ruleDef); try { setState(82); _errHandler.sync(this); switch (_input.LA(1)) { case T__3: _localctx = new RulePropContext(_localctx); enterOuterAlt(_localctx, 1); { setState(61); match(T__3); setState(62); match(T__4); setState(63); match(INT); } break; case T__5: _localctx = new RulePropContext(_localctx); enterOuterAlt(_localctx, 2); { setState(64); match(T__5); setState(65); match(T__4); setState(66); match(INT); } break; case T__6: _localctx = new RulePropContext(_localctx); enterOuterAlt(_localctx, 3); { setState(67); match(T__6); setState(68); match(T__4); setState(69); match(INT); } break; case T__7: _localctx = new RuleColoringContext(_localctx); enterOuterAlt(_localctx, 4); { setState(70); match(T__7); setState(71); match(T__4); setState(74); _errHandler.sync(this); switch (_input.LA(1)) { case T__8: { setState(72); match(T__8); } break; case EXPLICIT: { setState(73); explicitParsed(); } break; default: throw new NoViableAltException(this); } } break; case T__9: _localctx = new RulePlayerChangeContext(_localctx); enterOuterAlt(_localctx, 5); { setState(76); match(T__9); setState(77); match(T__4); setState(80); _errHandler.sync(this); switch (_input.LA(1)) { case T__8: { setState(78); match(T__8); } break; case EXPLICIT: { setState(79); explicitParsed(); } break; default: throw new NoViableAltException(this); } } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class PieceDescriptionsContext extends ParserRuleContext { public List<PieceDescriptionContext> pieceDescription() { return getRuleContexts(PieceDescriptionContext.class); } public PieceDescriptionContext pieceDescription(int i) { return getRuleContext(PieceDescriptionContext.class,i); } public PieceDescriptionsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_pieceDescriptions; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPieceDescriptions(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPieceDescriptions(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPieceDescriptions(this); else return visitor.visitChildren(this); } } public final PieceDescriptionsContext pieceDescriptions() throws RecognitionException { PieceDescriptionsContext _localctx = new PieceDescriptionsContext(_ctx, getState()); enterRule(_localctx, 6, RULE_pieceDescriptions); int _la; try { enterOuterAlt(_localctx, 1); { setState(84); match(T__10); setState(85); match(T__1); setState(89); _errHandler.sync(this); _la = _input.LA(1); while (_la==EXPLICIT || _la==ID) { { { setState(86); pieceDescription(); } } setState(91); _errHandler.sync(this); _la = _input.LA(1); } setState(92); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class PieceDescriptionContext extends ParserRuleContext { public PieceDescriptionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_pieceDescription; } public PieceDescriptionContext() { } public void copyFrom(PieceDescriptionContext ctx) { super.copyFrom(ctx); } } public static class PieceDescriptionExplicitContext extends PieceDescriptionContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public PieceDescriptionExplicitContext(PieceDescriptionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPieceDescriptionExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPieceDescriptionExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPieceDescriptionExplicit(this); else return visitor.visitChildren(this); } } public static class PieceIdPlusMovesContext extends PieceDescriptionContext { public TerminalNode ID() { return getToken(BoardParser.ID, 0); } public MovesContext moves() { return getRuleContext(MovesContext.class,0); } public List<DescriptionModifierContext> descriptionModifier() { return getRuleContexts(DescriptionModifierContext.class); } public DescriptionModifierContext descriptionModifier(int i) { return getRuleContext(DescriptionModifierContext.class,i); } public PieceIdPlusMovesContext(PieceDescriptionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPieceIdPlusMoves(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPieceIdPlusMoves(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPieceIdPlusMoves(this); else return visitor.visitChildren(this); } } public final PieceDescriptionContext pieceDescription() throws RecognitionException { PieceDescriptionContext _localctx = new PieceDescriptionContext(_ctx, getState()); enterRule(_localctx, 8, RULE_pieceDescription); int _la; try { setState(106); _errHandler.sync(this); switch (_input.LA(1)) { case ID: _localctx = new PieceIdPlusMovesContext(_localctx); enterOuterAlt(_localctx, 1); { setState(94); match(ID); setState(95); match(T__1); setState(96); moves(); setState(100); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << EXPLICIT))) != 0)) { { { setState(97); descriptionModifier(); } } setState(102); _errHandler.sync(this); _la = _input.LA(1); } setState(103); match(T__2); } break; case EXPLICIT: _localctx = new PieceDescriptionExplicitContext(_localctx); enterOuterAlt(_localctx, 2); { setState(105); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class MovesContext extends ParserRuleContext { public List<MoveContext> move() { return getRuleContexts(MoveContext.class); } public MoveContext move(int i) { return getRuleContext(MoveContext.class,i); } public MovesContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_moves; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoves(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoves(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoves(this); else return visitor.visitChildren(this); } } public final MovesContext moves() throws RecognitionException { MovesContext _localctx = new MovesContext(_ctx, getState()); enterRule(_localctx, 10, RULE_moves); int _la; try { enterOuterAlt(_localctx, 1); { setState(108); match(T__11); setState(109); match(T__1); setState(113); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__12) | (1L << T__16) | (1L << T__17) | (1L << T__32) | (1L << EXPLICIT))) != 0)) { { { setState(110); move(); } } setState(115); _errHandler.sync(this); _la = _input.LA(1); } setState(116); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class MoveContext extends ParserRuleContext { public MoveContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_move; } public MoveContext() { } public void copyFrom(MoveContext ctx) { super.copyFrom(ctx); } } public static class MoveExplicitContext extends MoveContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public MoveExplicitContext(MoveContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveExplicit(this); else return visitor.visitChildren(this); } } public static class MoveVectorContext extends MoveContext { public VectorContext vector() { return getRuleContext(VectorContext.class,0); } public KillsContext kills() { return getRuleContext(KillsContext.class,0); } public MoveVectorContext(MoveContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveVector(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveVector(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveVector(this); else return visitor.visitChildren(this); } } public static class MoveFunctionDescriptionContext extends MoveContext { public MoveFunctionContext moveFunction() { return getRuleContext(MoveFunctionContext.class,0); } public KillsContext kills() { return getRuleContext(KillsContext.class,0); } public MoveFunctionDescriptionContext(MoveContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveFunctionDescription(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveFunctionDescription(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveFunctionDescription(this); else return visitor.visitChildren(this); } } public final MoveContext move() throws RecognitionException { MoveContext _localctx = new MoveContext(_ctx, getState()); enterRule(_localctx, 12, RULE_move); int _la; try { setState(127); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: _localctx = new MoveVectorContext(_localctx); enterOuterAlt(_localctx, 1); { setState(118); vector(); setState(120); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__14 || _la==T__18) { { setState(119); kills(); } } } break; case 2: _localctx = new MoveFunctionDescriptionContext(_localctx); enterOuterAlt(_localctx, 2); { setState(122); moveFunction(); setState(124); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__14 || _la==T__18) { { setState(123); kills(); } } } break; case 3: _localctx = new MoveExplicitContext(_localctx); enterOuterAlt(_localctx, 3); { setState(126); explicitParsed(); } break; } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class MoveFunctionContext extends ParserRuleContext { public MoveFunctionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_moveFunction; } public MoveFunctionContext() { } public void copyFrom(MoveFunctionContext ctx) { super.copyFrom(ctx); } } public static class MoveFunctionDiagonalContext extends MoveFunctionContext { public Token e1; public Token e2; public List<TerminalNode> INT() { return getTokens(BoardParser.INT); } public TerminalNode INT(int i) { return getToken(BoardParser.INT, i); } public MoveFunctionDiagonalContext(MoveFunctionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveFunctionDiagonal(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveFunctionDiagonal(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveFunctionDiagonal(this); else return visitor.visitChildren(this); } } public static class MoveFunctionExplicitContext extends MoveFunctionContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public MoveFunctionExplicitContext(MoveFunctionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveFunctionExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveFunctionExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveFunctionExplicit(this); else return visitor.visitChildren(this); } } public static class MoveFunctionHorizontalContext extends MoveFunctionContext { public Token e1; public Token e2; public List<TerminalNode> INT() { return getTokens(BoardParser.INT); } public TerminalNode INT(int i) { return getToken(BoardParser.INT, i); } public MoveFunctionHorizontalContext(MoveFunctionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveFunctionHorizontal(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveFunctionHorizontal(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveFunctionHorizontal(this); else return visitor.visitChildren(this); } } public static class MoveFunctionVerticalContext extends MoveFunctionContext { public Token e1; public Token e2; public List<TerminalNode> INT() { return getTokens(BoardParser.INT); } public TerminalNode INT(int i) { return getToken(BoardParser.INT, i); } public MoveFunctionVerticalContext(MoveFunctionContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterMoveFunctionVertical(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitMoveFunctionVertical(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitMoveFunctionVertical(this); else return visitor.visitChildren(this); } } public final MoveFunctionContext moveFunction() throws RecognitionException { MoveFunctionContext _localctx = new MoveFunctionContext(_ctx, getState()); enterRule(_localctx, 14, RULE_moveFunction); int _la; try { setState(160); _errHandler.sync(this); switch (_input.LA(1)) { case T__12: _localctx = new MoveFunctionHorizontalContext(_localctx); enterOuterAlt(_localctx, 1); { setState(129); match(T__12); setState(130); match(T__13); setState(132); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(131); ((MoveFunctionHorizontalContext)_localctx).e1 = match(INT); } } setState(134); match(T__14); setState(136); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(135); ((MoveFunctionHorizontalContext)_localctx).e2 = match(INT); } } setState(138); match(T__15); } break; case T__16: _localctx = new MoveFunctionVerticalContext(_localctx); enterOuterAlt(_localctx, 2); { setState(139); match(T__16); setState(140); match(T__13); setState(142); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(141); ((MoveFunctionVerticalContext)_localctx).e1 = match(INT); } } setState(144); match(T__14); setState(146); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(145); ((MoveFunctionVerticalContext)_localctx).e2 = match(INT); } } setState(148); match(T__15); } break; case T__17: _localctx = new MoveFunctionDiagonalContext(_localctx); enterOuterAlt(_localctx, 3); { setState(149); match(T__17); setState(150); match(T__13); setState(152); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(151); ((MoveFunctionDiagonalContext)_localctx).e1 = match(INT); } } setState(154); match(T__14); setState(156); _errHandler.sync(this); _la = _input.LA(1); if (_la==INT) { { setState(155); ((MoveFunctionDiagonalContext)_localctx).e2 = match(INT); } } setState(158); match(T__15); } break; case EXPLICIT: _localctx = new MoveFunctionExplicitContext(_localctx); enterOuterAlt(_localctx, 4); { setState(159); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class KillsContext extends ParserRuleContext { public TerminalNode BOOL() { return getToken(BoardParser.BOOL, 0); } public KillsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_kills; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterKills(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitKills(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitKills(this); else return visitor.visitChildren(this); } } public final KillsContext kills() throws RecognitionException { KillsContext _localctx = new KillsContext(_ctx, getState()); enterRule(_localctx, 16, RULE_kills); int _la; try { enterOuterAlt(_localctx, 1); { setState(163); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__14) { { setState(162); match(T__14); } } setState(165); match(T__18); setState(166); match(T__4); setState(167); match(BOOL); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class DescriptionModifierContext extends ParserRuleContext { public DescriptionModifierContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_descriptionModifier; } public DescriptionModifierContext() { } public void copyFrom(DescriptionModifierContext ctx) { super.copyFrom(ctx); } } public static class DescriptionModifierCanJumpContext extends DescriptionModifierContext { public TerminalNode BOOL() { return getToken(BoardParser.BOOL, 0); } public DescriptionModifierCanJumpContext(DescriptionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterDescriptionModifierCanJump(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitDescriptionModifierCanJump(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitDescriptionModifierCanJump(this); else return visitor.visitChildren(this); } } public static class DescriptionModifierExplicitContext extends DescriptionModifierContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public DescriptionModifierExplicitContext(DescriptionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterDescriptionModifierExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitDescriptionModifierExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitDescriptionModifierExplicit(this); else return visitor.visitChildren(this); } } public static class DescriptionModifierOnEndReachedContext extends DescriptionModifierContext { public EndReachedAlternativesContext endReachedAlternatives() { return getRuleContext(EndReachedAlternativesContext.class,0); } public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public DescriptionModifierOnEndReachedContext(DescriptionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterDescriptionModifierOnEndReached(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitDescriptionModifierOnEndReached(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitDescriptionModifierOnEndReached(this); else return visitor.visitChildren(this); } } public static class DescriptionModifierMirroredContext extends DescriptionModifierContext { public TerminalNode BOOL() { return getToken(BoardParser.BOOL, 0); } public DescriptionModifierMirroredContext(DescriptionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterDescriptionModifierMirrored(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitDescriptionModifierMirrored(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitDescriptionModifierMirrored(this); else return visitor.visitChildren(this); } } public final DescriptionModifierContext descriptionModifier() throws RecognitionException { DescriptionModifierContext _localctx = new DescriptionModifierContext(_ctx, getState()); enterRule(_localctx, 18, RULE_descriptionModifier); int _la; try { setState(186); _errHandler.sync(this); switch (_input.LA(1)) { case T__19: _localctx = new DescriptionModifierCanJumpContext(_localctx); enterOuterAlt(_localctx, 1); { setState(169); match(T__19); setState(172); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__4) { { setState(170); match(T__4); setState(171); match(BOOL); } } } break; case T__20: _localctx = new DescriptionModifierMirroredContext(_localctx); enterOuterAlt(_localctx, 2); { setState(174); match(T__20); setState(177); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__4) { { setState(175); match(T__4); setState(176); match(BOOL); } } } break; case T__21: _localctx = new DescriptionModifierOnEndReachedContext(_localctx); enterOuterAlt(_localctx, 3); { setState(179); match(T__21); setState(180); match(T__4); setState(183); _errHandler.sync(this); switch (_input.LA(1)) { case T__22: { setState(181); endReachedAlternatives(); } break; case EXPLICIT: { setState(182); explicitParsed(); } break; default: throw new NoViableAltException(this); } } break; case EXPLICIT: _localctx = new DescriptionModifierExplicitContext(_localctx); enterOuterAlt(_localctx, 4); { setState(185); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class EndReachedAlternativesContext extends ParserRuleContext { public List<TerminalNode> ID() { return getTokens(BoardParser.ID); } public TerminalNode ID(int i) { return getToken(BoardParser.ID, i); } public EndReachedAlternativesContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_endReachedAlternatives; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterEndReachedAlternatives(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitEndReachedAlternatives(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitEndReachedAlternatives(this); else return visitor.visitChildren(this); } } public final EndReachedAlternativesContext endReachedAlternatives() throws RecognitionException { EndReachedAlternativesContext _localctx = new EndReachedAlternativesContext(_ctx, getState()); enterRule(_localctx, 20, RULE_endReachedAlternatives); int _la; try { enterOuterAlt(_localctx, 1); { setState(188); match(T__22); setState(189); match(T__13); setState(190); match(ID); setState(195); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__14) { { { setState(191); match(T__14); setState(192); match(ID); } } setState(197); _errHandler.sync(this); _la = _input.LA(1); } setState(198); match(T__15); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class InitialPiecePositionsContext extends ParserRuleContext { public List<InitialPiecePositionContext> initialPiecePosition() { return getRuleContexts(InitialPiecePositionContext.class); } public InitialPiecePositionContext initialPiecePosition(int i) { return getRuleContext(InitialPiecePositionContext.class,i); } public InitialPiecePositionsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_initialPiecePositions; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInitialPiecePositions(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInitialPiecePositions(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInitialPiecePositions(this); else return visitor.visitChildren(this); } } public final InitialPiecePositionsContext initialPiecePositions() throws RecognitionException { InitialPiecePositionsContext _localctx = new InitialPiecePositionsContext(_ctx, getState()); enterRule(_localctx, 22, RULE_initialPiecePositions); int _la; try { enterOuterAlt(_localctx, 1); { setState(200); match(T__23); setState(201); match(T__1); setState(205); _errHandler.sync(this); _la = _input.LA(1); while (_la==EXPLICIT || _la==ID) { { { setState(202); initialPiecePosition(); } } setState(207); _errHandler.sync(this); _la = _input.LA(1); } setState(208); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class InitialPiecePositionContext extends ParserRuleContext { public TerminalNode ID() { return getToken(BoardParser.ID, 0); } public List<PositionsContext> positions() { return getRuleContexts(PositionsContext.class); } public PositionsContext positions(int i) { return getRuleContext(PositionsContext.class,i); } public List<PositionModifierContext> positionModifier() { return getRuleContexts(PositionModifierContext.class); } public PositionModifierContext positionModifier(int i) { return getRuleContext(PositionModifierContext.class,i); } public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public InitialPiecePositionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_initialPiecePosition; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInitialPiecePosition(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInitialPiecePosition(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInitialPiecePosition(this); else return visitor.visitChildren(this); } } public final InitialPiecePositionContext initialPiecePosition() throws RecognitionException { InitialPiecePositionContext _localctx = new InitialPiecePositionContext(_ctx, getState()); enterRule(_localctx, 24, RULE_initialPiecePosition); int _la; try { setState(221); _errHandler.sync(this); switch (_input.LA(1)) { case ID: enterOuterAlt(_localctx, 1); { setState(210); match(ID); setState(211); match(T__1); setState(216); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__20) | (1L << T__24) | (1L << T__25))) != 0)) { { setState(214); _errHandler.sync(this); switch (_input.LA(1)) { case T__24: { setState(212); positions(); } break; case T__20: case T__25: { setState(213); positionModifier(); } break; default: throw new NoViableAltException(this); } } setState(218); _errHandler.sync(this); _la = _input.LA(1); } setState(219); match(T__2); } break; case EXPLICIT: enterOuterAlt(_localctx, 2); { setState(220); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class PositionsContext extends ParserRuleContext { public List<VectorContext> vector() { return getRuleContexts(VectorContext.class); } public VectorContext vector(int i) { return getRuleContext(VectorContext.class,i); } public PositionsContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_positions; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPositions(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPositions(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPositions(this); else return visitor.visitChildren(this); } } public final PositionsContext positions() throws RecognitionException { PositionsContext _localctx = new PositionsContext(_ctx, getState()); enterRule(_localctx, 26, RULE_positions); int _la; try { enterOuterAlt(_localctx, 1); { setState(223); match(T__24); setState(224); match(T__1); setState(228); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__32) { { { setState(225); vector(); } } setState(230); _errHandler.sync(this); _la = _input.LA(1); } setState(231); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class PositionModifierContext extends ParserRuleContext { public PositionModifierContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_positionModifier; } public PositionModifierContext() { } public void copyFrom(PositionModifierContext ctx) { super.copyFrom(ctx); } } public static class PositionModifierMirroredContext extends PositionModifierContext { public TerminalNode BOOL() { return getToken(BoardParser.BOOL, 0); } public PositionModifierMirroredContext(PositionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPositionModifierMirrored(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPositionModifierMirrored(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPositionModifierMirrored(this); else return visitor.visitChildren(this); } } public static class PositionModifierOwnerContext extends PositionModifierContext { public TerminalNode INT() { return getToken(BoardParser.INT, 0); } public PositionModifierOwnerContext(PositionModifierContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterPositionModifierOwner(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitPositionModifierOwner(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitPositionModifierOwner(this); else return visitor.visitChildren(this); } } public final PositionModifierContext positionModifier() throws RecognitionException { PositionModifierContext _localctx = new PositionModifierContext(_ctx, getState()); enterRule(_localctx, 28, RULE_positionModifier); int _la; try { setState(241); _errHandler.sync(this); switch (_input.LA(1)) { case T__20: _localctx = new PositionModifierMirroredContext(_localctx); enterOuterAlt(_localctx, 1); { setState(233); match(T__20); setState(236); _errHandler.sync(this); _la = _input.LA(1); if (_la==T__4) { { setState(234); match(T__4); setState(235); match(BOOL); } } } break; case T__25: _localctx = new PositionModifierOwnerContext(_localctx); enterOuterAlt(_localctx, 2); { setState(238); match(T__25); setState(239); match(T__4); setState(240); match(INT); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class InvariantListContext extends ParserRuleContext { public List<InvariantContext> invariant() { return getRuleContexts(InvariantContext.class); } public InvariantContext invariant(int i) { return getRuleContext(InvariantContext.class,i); } public InvariantListContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_invariantList; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInvariantList(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInvariantList(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInvariantList(this); else return visitor.visitChildren(this); } } public final InvariantListContext invariantList() throws RecognitionException { InvariantListContext _localctx = new InvariantListContext(_ctx, getState()); enterRule(_localctx, 30, RULE_invariantList); int _la; try { enterOuterAlt(_localctx, 1); { setState(243); match(T__26); setState(244); match(T__1); setState(248); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << EXPLICIT))) != 0)) { { { setState(245); invariant(); } } setState(250); _errHandler.sync(this); _la = _input.LA(1); } setState(251); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class InvariantContext extends ParserRuleContext { public InvariantContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_invariant; } public InvariantContext() { } public void copyFrom(InvariantContext ctx) { super.copyFrom(ctx); } } public static class InvariantProtectPieceContext extends InvariantContext { public List<TerminalNode> ID() { return getTokens(BoardParser.ID); } public TerminalNode ID(int i) { return getToken(BoardParser.ID, i); } public InvariantProtectPieceContext(InvariantContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInvariantProtectPiece(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInvariantProtectPiece(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInvariantProtectPiece(this); else return visitor.visitChildren(this); } } public static class InvariantPawnMovementContext extends InvariantContext { public List<TerminalNode> ID() { return getTokens(BoardParser.ID); } public TerminalNode ID(int i) { return getToken(BoardParser.ID, i); } public InvariantPawnMovementContext(InvariantContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInvariantPawnMovement(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInvariantPawnMovement(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInvariantPawnMovement(this); else return visitor.visitChildren(this); } } public static class InvariantExplicitContext extends InvariantContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public InvariantExplicitContext(InvariantContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInvariantExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInvariantExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInvariantExplicit(this); else return visitor.visitChildren(this); } } public static class InvariantCantRiskContext extends InvariantContext { public List<TerminalNode> ID() { return getTokens(BoardParser.ID); } public TerminalNode ID(int i) { return getToken(BoardParser.ID, i); } public InvariantCantRiskContext(InvariantContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterInvariantCantRisk(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitInvariantCantRisk(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitInvariantCantRisk(this); else return visitor.visitChildren(this); } } public final InvariantContext invariant() throws RecognitionException { InvariantContext _localctx = new InvariantContext(_ctx, getState()); enterRule(_localctx, 32, RULE_invariant); int _la; try { setState(287); _errHandler.sync(this); switch (_input.LA(1)) { case T__27: _localctx = new InvariantCantRiskContext(_localctx); enterOuterAlt(_localctx, 1); { setState(253); match(T__27); setState(254); match(T__13); setState(255); match(ID); setState(260); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__14) { { { setState(256); match(T__14); setState(257); match(ID); } } setState(262); _errHandler.sync(this); _la = _input.LA(1); } setState(263); match(T__15); } break; case T__28: _localctx = new InvariantProtectPieceContext(_localctx); enterOuterAlt(_localctx, 2); { setState(264); match(T__28); setState(265); match(T__13); setState(266); match(ID); setState(271); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__14) { { { setState(267); match(T__14); setState(268); match(ID); } } setState(273); _errHandler.sync(this); _la = _input.LA(1); } setState(274); match(T__15); } break; case T__29: _localctx = new InvariantPawnMovementContext(_localctx); enterOuterAlt(_localctx, 3); { setState(275); match(T__29); setState(276); match(T__13); setState(277); match(ID); setState(282); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__14) { { { setState(278); match(T__14); setState(279); match(ID); } } setState(284); _errHandler.sync(this); _la = _input.LA(1); } setState(285); match(T__15); } break; case EXPLICIT: _localctx = new InvariantExplicitContext(_localctx); enterOuterAlt(_localctx, 4); { setState(286); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class FinishContext extends ParserRuleContext { public List<FinishingRulesContext> finishingRules() { return getRuleContexts(FinishingRulesContext.class); } public FinishingRulesContext finishingRules(int i) { return getRuleContext(FinishingRulesContext.class,i); } public FinishContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_finish; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterFinish(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitFinish(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitFinish(this); else return visitor.visitChildren(this); } } public final FinishContext finish() throws RecognitionException { FinishContext _localctx = new FinishContext(_ctx, getState()); enterRule(_localctx, 34, RULE_finish); int _la; try { enterOuterAlt(_localctx, 1); { setState(289); match(T__30); setState(290); match(T__1); setState(294); _errHandler.sync(this); _la = _input.LA(1); while (_la==T__31 || _la==EXPLICIT) { { { setState(291); finishingRules(); } } setState(296); _errHandler.sync(this); _la = _input.LA(1); } setState(297); match(T__2); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class FinishingRulesContext extends ParserRuleContext { public FinishingRulesContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_finishingRules; } public FinishingRulesContext() { } public void copyFrom(FinishingRulesContext ctx) { super.copyFrom(ctx); } } public static class FinishingNoMovesAvailableContext extends FinishingRulesContext { public FinishingNoMovesAvailableContext(FinishingRulesContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterFinishingNoMovesAvailable(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitFinishingNoMovesAvailable(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitFinishingNoMovesAvailable(this); else return visitor.visitChildren(this); } } public static class FinishingExplicitContext extends FinishingRulesContext { public ExplicitParsedContext explicitParsed() { return getRuleContext(ExplicitParsedContext.class,0); } public FinishingExplicitContext(FinishingRulesContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterFinishingExplicit(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitFinishingExplicit(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitFinishingExplicit(this); else return visitor.visitChildren(this); } } public final FinishingRulesContext finishingRules() throws RecognitionException { FinishingRulesContext _localctx = new FinishingRulesContext(_ctx, getState()); enterRule(_localctx, 36, RULE_finishingRules); try { setState(301); _errHandler.sync(this); switch (_input.LA(1)) { case T__31: _localctx = new FinishingNoMovesAvailableContext(_localctx); enterOuterAlt(_localctx, 1); { setState(299); match(T__31); } break; case EXPLICIT: _localctx = new FinishingExplicitContext(_localctx); enterOuterAlt(_localctx, 2); { setState(300); explicitParsed(); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class VectorContext extends ParserRuleContext { public IntervalContext e1; public IntervalContext e2; public List<IntervalContext> interval() { return getRuleContexts(IntervalContext.class); } public IntervalContext interval(int i) { return getRuleContext(IntervalContext.class,i); } public VectorContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_vector; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterVector(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitVector(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitVector(this); else return visitor.visitChildren(this); } } public final VectorContext vector() throws RecognitionException { VectorContext _localctx = new VectorContext(_ctx, getState()); enterRule(_localctx, 38, RULE_vector); try { enterOuterAlt(_localctx, 1); { setState(303); match(T__32); setState(304); match(T__4); setState(305); ((VectorContext)_localctx).e1 = interval(); setState(306); match(T__14); setState(307); match(T__33); setState(308); match(T__4); setState(309); ((VectorContext)_localctx).e2 = interval(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class IntervalContext extends ParserRuleContext { public IntervalContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_interval; } public IntervalContext() { } public void copyFrom(IntervalContext ctx) { super.copyFrom(ctx); } } public static class DegenIntervalContext extends IntervalContext { public TerminalNode INT() { return getToken(BoardParser.INT, 0); } public DegenIntervalContext(IntervalContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterDegenInterval(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitDegenInterval(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitDegenInterval(this); else return visitor.visitChildren(this); } } public static class FullIntervalContext extends IntervalContext { public List<TerminalNode> INT() { return getTokens(BoardParser.INT); } public TerminalNode INT(int i) { return getToken(BoardParser.INT, i); } public FullIntervalContext(IntervalContext ctx) { copyFrom(ctx); } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterFullInterval(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitFullInterval(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitFullInterval(this); else return visitor.visitChildren(this); } } public final IntervalContext interval() throws RecognitionException { IntervalContext _localctx = new IntervalContext(_ctx, getState()); enterRule(_localctx, 40, RULE_interval); try { setState(317); _errHandler.sync(this); switch (_input.LA(1)) { case T__34: _localctx = new FullIntervalContext(_localctx); enterOuterAlt(_localctx, 1); { { setState(311); match(T__34); setState(312); match(INT); setState(313); match(T__14); setState(314); match(INT); setState(315); match(T__35); } } break; case INT: _localctx = new DegenIntervalContext(_localctx); enterOuterAlt(_localctx, 2); { setState(316); match(INT); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static class ExplicitParsedContext extends ParserRuleContext { public TerminalNode EXPLICIT() { return getToken(BoardParser.EXPLICIT, 0); } public ExplicitParsedContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_explicitParsed; } @Override public void enterRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).enterExplicitParsed(this); } @Override public void exitRule(ParseTreeListener listener) { if ( listener instanceof BoardListener ) ((BoardListener)listener).exitExplicitParsed(this); } @Override public <T> T accept(ParseTreeVisitor<? extends T> visitor) { if ( visitor instanceof BoardVisitor ) return ((BoardVisitor<? extends T>)visitor).visitExplicitParsed(this); else return visitor.visitChildren(this); } } public final ExplicitParsedContext explicitParsed() throws RecognitionException { ExplicitParsedContext _localctx = new ExplicitParsedContext(_ctx, getState()); enterRule(_localctx, 42, RULE_explicitParsed); try { enterOuterAlt(_localctx, 1); { setState(319); match(EXPLICIT); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; } public static final String _serializedATN = "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3+\u0144\4\2\t\2\4"+ "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\3\2\3\2\3\2\3\2\3\2"+ "\3\2\3\2\3\3\3\3\3\3\7\39\n\3\f\3\16\3<\13\3\3\3\3\3\3\4\3\4\3\4\3\4\3"+ "\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4M\n\4\3\4\3\4\3\4\3\4\5\4S\n\4\5"+ "\4U\n\4\3\5\3\5\3\5\7\5Z\n\5\f\5\16\5]\13\5\3\5\3\5\3\6\3\6\3\6\3\6\7"+ "\6e\n\6\f\6\16\6h\13\6\3\6\3\6\3\6\5\6m\n\6\3\7\3\7\3\7\7\7r\n\7\f\7\16"+ "\7u\13\7\3\7\3\7\3\b\3\b\5\b{\n\b\3\b\3\b\5\b\177\n\b\3\b\5\b\u0082\n"+ "\b\3\t\3\t\3\t\5\t\u0087\n\t\3\t\3\t\5\t\u008b\n\t\3\t\3\t\3\t\3\t\5\t"+ "\u0091\n\t\3\t\3\t\5\t\u0095\n\t\3\t\3\t\3\t\3\t\5\t\u009b\n\t\3\t\3\t"+ "\5\t\u009f\n\t\3\t\3\t\5\t\u00a3\n\t\3\n\5\n\u00a6\n\n\3\n\3\n\3\n\3\n"+ "\3\13\3\13\3\13\5\13\u00af\n\13\3\13\3\13\3\13\5\13\u00b4\n\13\3\13\3"+ "\13\3\13\3\13\5\13\u00ba\n\13\3\13\5\13\u00bd\n\13\3\f\3\f\3\f\3\f\3\f"+ "\7\f\u00c4\n\f\f\f\16\f\u00c7\13\f\3\f\3\f\3\r\3\r\3\r\7\r\u00ce\n\r\f"+ "\r\16\r\u00d1\13\r\3\r\3\r\3\16\3\16\3\16\3\16\7\16\u00d9\n\16\f\16\16"+ "\16\u00dc\13\16\3\16\3\16\5\16\u00e0\n\16\3\17\3\17\3\17\7\17\u00e5\n"+ "\17\f\17\16\17\u00e8\13\17\3\17\3\17\3\20\3\20\3\20\5\20\u00ef\n\20\3"+ "\20\3\20\3\20\5\20\u00f4\n\20\3\21\3\21\3\21\7\21\u00f9\n\21\f\21\16\21"+ "\u00fc\13\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\7\22\u0105\n\22\f\22\16"+ "\22\u0108\13\22\3\22\3\22\3\22\3\22\3\22\3\22\7\22\u0110\n\22\f\22\16"+ "\22\u0113\13\22\3\22\3\22\3\22\3\22\3\22\3\22\7\22\u011b\n\22\f\22\16"+ "\22\u011e\13\22\3\22\3\22\5\22\u0122\n\22\3\23\3\23\3\23\7\23\u0127\n"+ "\23\f\23\16\23\u012a\13\23\3\23\3\23\3\24\3\24\5\24\u0130\n\24\3\25\3"+ "\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u0140"+ "\n\26\3\27\3\27\3\27\2\2\30\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \""+ "$&(*,\2\2\2\u015e\2.\3\2\2\2\4\65\3\2\2\2\6T\3\2\2\2\bV\3\2\2\2\nl\3\2"+ "\2\2\fn\3\2\2\2\16\u0081\3\2\2\2\20\u00a2\3\2\2\2\22\u00a5\3\2\2\2\24"+ "\u00bc\3\2\2\2\26\u00be\3\2\2\2\30\u00ca\3\2\2\2\32\u00df\3\2\2\2\34\u00e1"+ "\3\2\2\2\36\u00f3\3\2\2\2 \u00f5\3\2\2\2\"\u0121\3\2\2\2$\u0123\3\2\2"+ "\2&\u012f\3\2\2\2(\u0131\3\2\2\2*\u013f\3\2\2\2,\u0141\3\2\2\2./\5\4\3"+ "\2/\60\5\b\5\2\60\61\5\30\r\2\61\62\5 \21\2\62\63\5$\23\2\63\64\7\2\2"+ "\3\64\3\3\2\2\2\65\66\7\3\2\2\66:\7\4\2\2\679\5\6\4\28\67\3\2\2\29<\3"+ "\2\2\2:8\3\2\2\2:;\3\2\2\2;=\3\2\2\2<:\3\2\2\2=>\7\5\2\2>\5\3\2\2\2?@"+ "\7\6\2\2@A\7\7\2\2AU\7\'\2\2BC\7\b\2\2CD\7\7\2\2DU\7\'\2\2EF\7\t\2\2F"+ "G\7\7\2\2GU\7\'\2\2HI\7\n\2\2IL\7\7\2\2JM\7\13\2\2KM\5,\27\2LJ\3\2\2\2"+ "LK\3\2\2\2MU\3\2\2\2NO\7\f\2\2OR\7\7\2\2PS\7\13\2\2QS\5,\27\2RP\3\2\2"+ "\2RQ\3\2\2\2SU\3\2\2\2T?\3\2\2\2TB\3\2\2\2TE\3\2\2\2TH\3\2\2\2TN\3\2\2"+ "\2U\7\3\2\2\2VW\7\r\2\2W[\7\4\2\2XZ\5\n\6\2YX\3\2\2\2Z]\3\2\2\2[Y\3\2"+ "\2\2[\\\3\2\2\2\\^\3\2\2\2][\3\2\2\2^_\7\5\2\2_\t\3\2\2\2`a\7*\2\2ab\7"+ "\4\2\2bf\5\f\7\2ce\5\24\13\2dc\3\2\2\2eh\3\2\2\2fd\3\2\2\2fg\3\2\2\2g"+ "i\3\2\2\2hf\3\2\2\2ij\7\5\2\2jm\3\2\2\2km\5,\27\2l`\3\2\2\2lk\3\2\2\2"+ "m\13\3\2\2\2no\7\16\2\2os\7\4\2\2pr\5\16\b\2qp\3\2\2\2ru\3\2\2\2sq\3\2"+ "\2\2st\3\2\2\2tv\3\2\2\2us\3\2\2\2vw\7\5\2\2w\r\3\2\2\2xz\5(\25\2y{\5"+ "\22\n\2zy\3\2\2\2z{\3\2\2\2{\u0082\3\2\2\2|~\5\20\t\2}\177\5\22\n\2~}"+ "\3\2\2\2~\177\3\2\2\2\177\u0082\3\2\2\2\u0080\u0082\5,\27\2\u0081x\3\2"+ "\2\2\u0081|\3\2\2\2\u0081\u0080\3\2\2\2\u0082\17\3\2\2\2\u0083\u0084\7"+ "\17\2\2\u0084\u0086\7\20\2\2\u0085\u0087\7\'\2\2\u0086\u0085\3\2\2\2\u0086"+ "\u0087\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u008a\7\21\2\2\u0089\u008b\7"+ "\'\2\2\u008a\u0089\3\2\2\2\u008a\u008b\3\2\2\2\u008b\u008c\3\2\2\2\u008c"+ "\u00a3\7\22\2\2\u008d\u008e\7\23\2\2\u008e\u0090\7\20\2\2\u008f\u0091"+ "\7\'\2\2\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\3\2\2\2\u0092"+ "\u0094\7\21\2\2\u0093\u0095\7\'\2\2\u0094\u0093\3\2\2\2\u0094\u0095\3"+ "\2\2\2\u0095\u0096\3\2\2\2\u0096\u00a3\7\22\2\2\u0097\u0098\7\24\2\2\u0098"+ "\u009a\7\20\2\2\u0099\u009b\7\'\2\2\u009a\u0099\3\2\2\2\u009a\u009b\3"+ "\2\2\2\u009b\u009c\3\2\2\2\u009c\u009e\7\21\2\2\u009d\u009f\7\'\2\2\u009e"+ "\u009d\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a3\7\22"+ "\2\2\u00a1\u00a3\5,\27\2\u00a2\u0083\3\2\2\2\u00a2\u008d\3\2\2\2\u00a2"+ "\u0097\3\2\2\2\u00a2\u00a1\3\2\2\2\u00a3\21\3\2\2\2\u00a4\u00a6\7\21\2"+ "\2\u00a5\u00a4\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a8"+ "\7\25\2\2\u00a8\u00a9\7\7\2\2\u00a9\u00aa\7(\2\2\u00aa\23\3\2\2\2\u00ab"+ "\u00ae\7\26\2\2\u00ac\u00ad\7\7\2\2\u00ad\u00af\7(\2\2\u00ae\u00ac\3\2"+ "\2\2\u00ae\u00af\3\2\2\2\u00af\u00bd\3\2\2\2\u00b0\u00b3\7\27\2\2\u00b1"+ "\u00b2\7\7\2\2\u00b2\u00b4\7(\2\2\u00b3\u00b1\3\2\2\2\u00b3\u00b4\3\2"+ "\2\2\u00b4\u00bd\3\2\2\2\u00b5\u00b6\7\30\2\2\u00b6\u00b9\7\7\2\2\u00b7"+ "\u00ba\5\26\f\2\u00b8\u00ba\5,\27\2\u00b9\u00b7\3\2\2\2\u00b9\u00b8\3"+ "\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00bd\5,\27\2\u00bc\u00ab\3\2\2\2\u00bc"+ "\u00b0\3\2\2\2\u00bc\u00b5\3\2\2\2\u00bc\u00bb\3\2\2\2\u00bd\25\3\2\2"+ "\2\u00be\u00bf\7\31\2\2\u00bf\u00c0\7\20\2\2\u00c0\u00c5\7*\2\2\u00c1"+ "\u00c2\7\21\2\2\u00c2\u00c4\7*\2\2\u00c3\u00c1\3\2\2\2\u00c4\u00c7\3\2"+ "\2\2\u00c5\u00c3\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6\u00c8\3\2\2\2\u00c7"+ "\u00c5\3\2\2\2\u00c8\u00c9\7\22\2\2\u00c9\27\3\2\2\2\u00ca\u00cb\7\32"+ "\2\2\u00cb\u00cf\7\4\2\2\u00cc\u00ce\5\32\16\2\u00cd\u00cc\3\2\2\2\u00ce"+ "\u00d1\3\2\2\2\u00cf\u00cd\3\2\2\2\u00cf\u00d0\3\2\2\2\u00d0\u00d2\3\2"+ "\2\2\u00d1\u00cf\3\2\2\2\u00d2\u00d3\7\5\2\2\u00d3\31\3\2\2\2\u00d4\u00d5"+ "\7*\2\2\u00d5\u00da\7\4\2\2\u00d6\u00d9\5\34\17\2\u00d7\u00d9\5\36\20"+ "\2\u00d8\u00d6\3\2\2\2\u00d8\u00d7\3\2\2\2\u00d9\u00dc\3\2\2\2\u00da\u00d8"+ "\3\2\2\2\u00da\u00db\3\2\2\2\u00db\u00dd\3\2\2\2\u00dc\u00da\3\2\2\2\u00dd"+ "\u00e0\7\5\2\2\u00de\u00e0\5,\27\2\u00df\u00d4\3\2\2\2\u00df\u00de\3\2"+ "\2\2\u00e0\33\3\2\2\2\u00e1\u00e2\7\33\2\2\u00e2\u00e6\7\4\2\2\u00e3\u00e5"+ "\5(\25\2\u00e4\u00e3\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6"+ "\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9\u00ea\7\5"+ "\2\2\u00ea\35\3\2\2\2\u00eb\u00ee\7\27\2\2\u00ec\u00ed\7\7\2\2\u00ed\u00ef"+ "\7(\2\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f4\3\2\2\2\u00f0"+ "\u00f1\7\34\2\2\u00f1\u00f2\7\7\2\2\u00f2\u00f4\7\'\2\2\u00f3\u00eb\3"+ "\2\2\2\u00f3\u00f0\3\2\2\2\u00f4\37\3\2\2\2\u00f5\u00f6\7\35\2\2\u00f6"+ "\u00fa\7\4\2\2\u00f7\u00f9\5\"\22\2\u00f8\u00f7\3\2\2\2\u00f9\u00fc\3"+ "\2\2\2\u00fa\u00f8\3\2\2\2\u00fa\u00fb\3\2\2\2\u00fb\u00fd\3\2\2\2\u00fc"+ "\u00fa\3\2\2\2\u00fd\u00fe\7\5\2\2\u00fe!\3\2\2\2\u00ff\u0100\7\36\2\2"+ "\u0100\u0101\7\20\2\2\u0101\u0106\7*\2\2\u0102\u0103\7\21\2\2\u0103\u0105"+ "\7*\2\2\u0104\u0102\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104\3\2\2\2\u0106"+ "\u0107\3\2\2\2\u0107\u0109\3\2\2\2\u0108\u0106\3\2\2\2\u0109\u0122\7\22"+ "\2\2\u010a\u010b\7\37\2\2\u010b\u010c\7\20\2\2\u010c\u0111\7*\2\2\u010d"+ "\u010e\7\21\2\2\u010e\u0110\7*\2\2\u010f\u010d\3\2\2\2\u0110\u0113\3\2"+ "\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0114\3\2\2\2\u0113"+ "\u0111\3\2\2\2\u0114\u0122\7\22\2\2\u0115\u0116\7 \2\2\u0116\u0117\7\20"+ "\2\2\u0117\u011c\7*\2\2\u0118\u0119\7\21\2\2\u0119\u011b\7*\2\2\u011a"+ "\u0118\3\2\2\2\u011b\u011e\3\2\2\2\u011c\u011a\3\2\2\2\u011c\u011d\3\2"+ "\2\2\u011d\u011f\3\2\2\2\u011e\u011c\3\2\2\2\u011f\u0122\7\22\2\2\u0120"+ "\u0122\5,\27\2\u0121\u00ff\3\2\2\2\u0121\u010a\3\2\2\2\u0121\u0115\3\2"+ "\2\2\u0121\u0120\3\2\2\2\u0122#\3\2\2\2\u0123\u0124\7!\2\2\u0124\u0128"+ "\7\4\2\2\u0125\u0127\5&\24\2\u0126\u0125\3\2\2\2\u0127\u012a\3\2\2\2\u0128"+ "\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129\u012b\3\2\2\2\u012a\u0128\3\2"+ "\2\2\u012b\u012c\7\5\2\2\u012c%\3\2\2\2\u012d\u0130\7\"\2\2\u012e\u0130"+ "\5,\27\2\u012f\u012d\3\2\2\2\u012f\u012e\3\2\2\2\u0130\'\3\2\2\2\u0131"+ "\u0132\7#\2\2\u0132\u0133\7\7\2\2\u0133\u0134\5*\26\2\u0134\u0135\7\21"+ "\2\2\u0135\u0136\7$\2\2\u0136\u0137\7\7\2\2\u0137\u0138\5*\26\2\u0138"+ ")\3\2\2\2\u0139\u013a\7%\2\2\u013a\u013b\7\'\2\2\u013b\u013c\7\21\2\2"+ "\u013c\u013d\7\'\2\2\u013d\u0140\7&\2\2\u013e\u0140\7\'\2\2\u013f\u0139"+ "\3\2\2\2\u013f\u013e\3\2\2\2\u0140+\3\2\2\2\u0141\u0142\7)\2\2\u0142-"+ "\3\2\2\2):LRT[flsz~\u0081\u0086\u008a\u0090\u0094\u009a\u009e\u00a2\u00a5"+ "\u00ae\u00b3\u00b9\u00bc\u00c5\u00cf\u00d8\u00da\u00df\u00e6\u00ee\u00f3"+ "\u00fa\u0106\u0111\u011c\u0121\u0128\u012f\u013f"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); } } }
[ "guerreiroapatacas@gmail.com" ]
guerreiroapatacas@gmail.com
0e7e408c76d95b710d160934166781094afef878
3dcfd130abf93d4804db44a29c60d994c4bc8317
/src/main/java/com/github/t1/deployer/app/package-info.java
c19a74f2a60d29ca1b26e8b999cfe5f7d82b6522
[ "Apache-2.0" ]
permissive
derzufall/deployer
3fc50b868aef253bfa30f53c5ab38b752016171b
bb8c723579d4efb41e569935ddc5e9a3046b7084
refs/heads/master
2021-06-29T04:47:37.132788
2017-09-23T13:10:49
2017-09-23T13:10:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
@DependsUpon(packagesOf = { com.github.t1.deployer.container.Container.class, com.github.t1.deployer.repository.Repository.class, com.github.t1.deployer.model.Checksum.class, com.github.t1.deployer.tools.FileWatcher.class, com.github.t1.problem.ProblemDetail.class, com.fasterxml.jackson.annotation.JacksonAnnotation.class, com.fasterxml.jackson.core.JsonGenerator.class, com.fasterxml.jackson.core.base.GeneratorBase.class, com.fasterxml.jackson.databind.ObjectMapper.class, com.fasterxml.jackson.dataformat.yaml.YAMLFactory.class, }) package com.github.t1.deployer.app; import com.github.t1.testtools.DependsUpon;
[ "snackbox@sinntr.eu" ]
snackbox@sinntr.eu
1dfb5ff81346b7a7338f1db08f8d0b0579f5265f
839a3c73fab57a36831a6fa103ec69dee4ad460c
/src/com/liang/reusing/CADSystem.java
4f0ca6421b1c2ad03f229f343aeeed01edb3b6d8
[]
no_license
mrliliang/ThinkingInJava
dcd177daebded605950548fdfd0291fbf486dc3f
3aeac25795102cd72587d0937dec729643a1fd48
refs/heads/master
2021-04-07T14:09:38.655344
2018-07-18T05:38:03
2018-07-18T05:38:03
125,451,201
0
0
null
null
null
null
UTF-8
Java
false
false
1,717
java
package com.liang.reusing; import static com.liang.util.Print.print; class Shape { Shape(int i) { print("Shape constructor"); } void dispose() { print("Shape dispose"); } } class Circle extends Shape { Circle(int i) { super(i); print("Drawing Circle"); } void dispose() { print("Erasing Circle"); super.dispose(); } } class Triangle extends Shape { Triangle(int i) { super(i); print("Drawing Triangle"); } void dispose() { print("Erasing Triangle"); super.dispose(); } } class Line extends Shape { private int start, end; Line(int start, int end) { super(start); this.start = start; this.end = end; print("Drawing Line: " + start + ", " + end); } void dispose() { print("Erasing Line: " + start + ", " + end); super.dispose(); } } public class CADSystem extends Shape { private Circle c; private Triangle t; private Line[] lines = new Line[3]; CADSystem(int i) { super(i + 1); for (int j = 0; j < lines.length; j++) { lines[j] = new Line(j, j * j); } c = new Circle(1); t = new Triangle(1); print("Combined constructor"); } public void dispose() { print("CADSystem.dispose()"); t.dispose(); c.dispose(); for (int i = lines.length - 1; i >= 0; i--) { lines[i].dispose(); } super.dispose(); } public static void main(String[] args) { CADSystem x = new CADSystem(47); try { } finally { x.dispose(); } } }
[ "llzgz@qq.com" ]
llzgz@qq.com
c05392fccbe04ba82941101b08fc44784607c633
51aceb548221eb607ed26f4e6248e92a2115fd84
/hw10-hibernate/src/main/java/hw10/hibernate/sessionmanager/DatabaseSessionHibernate.java
52cfaca16e4c2984c8a62ec4c7b6af5159bcb54b
[ "MIT" ]
permissive
valachedi/otus_java_2020_03
6892beb8215fa93058d258598269a42a83380a28
fadebe300522e4356ccf17a5f122b403441725bc
refs/heads/master
2021-05-19T12:24:17.702689
2020-09-01T21:10:27
2020-09-01T21:10:27
251,696,714
0
0
MIT
2020-09-01T21:11:20
2020-03-31T18:32:45
Java
UTF-8
Java
false
false
735
java
package hw10.hibernate.sessionmanager; import org.hibernate.Session; import org.hibernate.Transaction; import hw10.core.sessionmanager.DatabaseSession; public class DatabaseSessionHibernate implements DatabaseSession { private final Session session; private final Transaction transaction; DatabaseSessionHibernate(Session session) { this.session = session; this.transaction = session.beginTransaction(); } public Session getHibernateSession() { return session; } public Transaction getTransaction() { return transaction; } public void close() { if (transaction.isActive()) { transaction.commit(); } session.close(); } }
[ "varavavv@nspk.ru" ]
varavavv@nspk.ru
466f6268b072c18e93e4a4939b1ee537b4f0bdbb
e86c7fcbceb5be226af7e12ff30b49a4de42ce35
/app/src/main/java/com/chat/uchat/Module_DataModel/MDL_Room.java
3139c401c55e28a29ebf201b7c94c5d28cce942b
[]
no_license
ashokas058/Uchat
bfb892c42803a688afe6f679cc391dc27c416e68
914f2800587b16fdc19fc5ac7ca14feb95df3f00
refs/heads/master
2023-04-25T01:24:38.086384
2021-05-21T03:17:30
2021-05-21T03:17:30
368,021,204
1
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.chat.uchat.Module_DataModel; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class MDL_Room { public ArrayList<String> member; public Map<String, String> groupInfo; public MDL_Room(){ member = new ArrayList<>(); groupInfo = new HashMap<String, String>(); } }
[ "ashokas058" ]
ashokas058
f450ab771093ea66deccc76ddbbf0289464b3629
12c72ef96cdda523d54298950f83b78abc343c37
/src/NestedLayout.java
eebedab6195a74903b44fef1fc8264cca3e57f10
[]
no_license
MulderPu/miniature-octo-carnival
91b5c49cc4aa025efb48522d6ba36bf61f636cb7
71cddb01ef1fc5e24931c6a1a7779072a03b4a01
refs/heads/master
2020-12-24T21:22:01.189579
2016-05-03T11:14:53
2016-05-03T11:14:53
57,209,743
0
0
null
null
null
null
UTF-8
Java
false
false
2,158
java
import java.awt.*; import javax.swing.*; import javax.swing.border.*; /** * Project Name : miniature-octo-carnival * Created by Mulder on 5/2/2016. */ public class NestedLayout { public static JLabel getLabel(String text) { return getLabel(text, SwingConstants.LEFT); } public static JLabel getLabel(String text, int alignment) { JLabel l = new JLabel(text, alignment); l.setBorder(new LineBorder(Color.RED, 2)); return l; } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JPanel p = new JPanel(new GridLayout(1,2,4,4)); p.setBackground(Color.black); p.setBorder(new EmptyBorder(4,4,4,4)); JPanel border = new JPanel(new BorderLayout()); border.add(getLabel( "Border", SwingConstants.CENTER), BorderLayout.CENTER); p.add(border); // JPanel gridbag = new JPanel(new GridBagLayout()); // gridbag.add(getLabel("GridBag")); // p.add(gridbag); // JPanel grid = new JPanel(new GridLayout()); // grid.add(getLabel("Grid", SwingConstants.CENTER)); // p.add(grid); // from @0verbose JPanel box = new JPanel(); box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS )); box.add(Box.createHorizontalGlue()); box.add(getLabel("Box")); box.add(Box.createHorizontalGlue()); p.add(box); JFrame f = new JFrame("Streeeetch me.."); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setContentPane(p); f.pack(); f.setLocationByPlatform(true); f.setVisible(true); } }); } }
[ "mulderpu@gmail.com" ]
mulderpu@gmail.com
e7c22a6ef54abeecca80988e5bf95df0206248ce
3a6aadf8350d4a24649af4d0c56fd207bcbdf77e
/src/main/java/pl/patrycja/game/doubleValues/DoubleNumber.java
a5691073461263e4d0e3c56f305945afafb62246
[]
no_license
patkaProgramuje/Zgadula
c07281d2ac951f393d59d4aa06f5c261ea71311f
e5c3cfac80ab0c7ad2bdedcd2fdb2efdf3841b72
refs/heads/master
2020-09-29T06:52:16.785771
2019-12-09T22:22:05
2019-12-09T22:22:05
226,831,833
0
0
null
null
null
null
UTF-8
Java
false
false
333
java
package pl.patrycja.game.doubleValues; import pl.patrycja.game.BaseNumber; public class DoubleNumber extends BaseNumber { public DoubleNumber(double value) { super(value); } @Override protected int compare(Number o1, Number o2) { return Double.compare(o1.doubleValue(), o2.doubleValue()); } }
[ "patrycja.hyjek@gmail.com" ]
patrycja.hyjek@gmail.com
83ae9b33c5c3a3311eea84eaca314b304a7f1a7f
605dc9c30222306e971a80519bd1405ae513a381
/old_work/svn/gems/branches/ind_branch_2.X/ems/src/main/java/com/ems/model/Gateway.java
485780d14024913e73275b58effdff066e91af2d
[]
no_license
rgabriana/Work
e54da03ff58ecac2e2cd2462e322d92eafd56921
9adb8cd1727fde513bc512426c1588aff195c2d0
refs/heads/master
2021-01-21T06:27:22.073100
2017-02-27T14:31:59
2017-02-27T14:31:59
83,231,847
2
0
null
null
null
null
UTF-8
Java
false
false
18,077
java
package com.ems.model; import java.io.Serializable; import java.util.Date; import java.util.Set; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.ems.types.DeviceType; /** * * @author pankaj kumar chauhan * */ @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class Gateway extends Device implements Serializable { private static final long serialVersionUID = -417271237512093198L; private String uniqueIdentifierId; @XmlElement(name = "status") private boolean status; @XmlElement(name = "commissioned") private boolean commissioned; private Set<Fixture> fixtures; private String campusName; // Not saving this value in database.View only private String buildingName; // Not saving this value in database.View only private String floorName; // Not saving this value in database.View only @XmlElement(name = "ipaddress") private String ipAddress; @XmlElement(name = "port") private Short port; @XmlElement(name = "snapaddress") private String snapAddress; @XmlElement(name = "gatewaytype") private Short gatewayType; private Short serialPort; @XmlElement(name = "channel") private Integer channel; // 0 - 15 @XmlElement(name = "aeskey") private String aesKey; // not used. private String userName; private String password; @XmlElement(name = "wirelessnetworkid") private Integer wirelessNetworkId; @XmlElement(name = "wirelessencrypttype") private Integer wirelessEncryptType; @XmlElement(name = "wirelessencryptkey") private String wirelessEncryptKey; @XmlElement(name = "wirelessradiorate") private Integer wirelessRadiorate; // 0 or 2 private Integer ethSecType; // none = 0, AuthOnly, AuthAndEncrypt private Integer ethSecIntegrityType; // MD5 = 0 or SHA1 private Integer ethSecEncryptType; // none = 0, AES-56 or AES-128 private String ethSecKey; private Integer ethIpaddrType; // static = 0 or locallink @XmlElement(name = "app1version") private String app1Version; @XmlElement(name = "app2version") private String app2Version; @XmlElement(name = "lastconnectivityat") private Date lastConnectivityAt; private Date lastStatsRcvdTime; private String subnetMask; private String defaultGw; @XmlElement(name = "noofsensors") private Integer noOfSensors; @XmlElement(name = "noofactivesensors") private Integer noOfActiveSensors; @XmlElement(name = "upgradestatus") private String upgradeStatus; @XmlElement(name = "bootloaderversion") private String bootLoaderVersion; @XmlElement(name = "curruptime") private Long currUptime; private Long currNoPktsFromGems; private Long currNoPktsToGems; private Long currNoPktsToNodes; private Long currNoPktsFromNodes; @XmlElement(name = "noofwds") private Integer noOfWds; public Gateway() { this.type = DeviceType.Gateway.getName(); } /** * @return the id */ public Long getId() { return id; } /** * @param id * the id to set */ public void setId(Long id) { this.id = id; } /** * @return the macAddress */ public String getMacAddress() { return macAddress; } /** * @param macAddress the macAddress to set */ public void setMacAddress(String macAddress) { this.macAddress = macAddress; } /** * @return the floor */ public Floor getFloor() { return floor; } /** * @param floor * the floor to set */ public void setFloor(Floor floor) { this.floor = floor; } /** * @return the campusId */ public Long getCampusId() { return campusId; } /** * @param campusId * the campusId to set */ public void setCampusId(Long campusId) { this.campusId = campusId; } /** * @return the buildingId */ public Long getBuildingId() { return buildingId; } /** * @param buildingId * the buildingId to set */ public void setBuildingId(Long buildingId) { this.buildingId = buildingId; } /** * @return the uniqueIdentifierId */ public String getUniqueIdentifierId() { return uniqueIdentifierId; } /** * @param uniqueIdentifierId * the uniqueIdentifierId to set */ public void setUniqueIdentifierId(String uniqueIdentifierId) { this.uniqueIdentifierId = uniqueIdentifierId; } /** * @return the status */ public boolean isStatus() { return status; } /** * @param status * the status to set */ public void setStatus(boolean status) { this.status = status; } /** * @return the commissioned * */ public boolean isCommissioned() { return commissioned; } /** * @param commissioned * the commissioned to set */ public void setCommissioned(boolean commissioned) { this.commissioned = commissioned; } public Set<Fixture> getFixtures() { return fixtures; } /** * @param fixtures * the fixtures to set */ public void setFixtures(Set<Fixture> fixtures) { this.fixtures = fixtures; } /** * @return the campusName */ public String getCampusName() { return campusName; } /** * @param campusName * the campusName to set */ public void setCampusName(String campusName) { this.campusName = campusName; } /** * @return the buildingName */ public String getBuildingName() { return buildingName; } /** * @param buildingName * the buildingName to set */ public void setBuildingName(String buildingName) { this.buildingName = buildingName; } /** * @return the floorName */ public String getFloorName() { return floorName; } /** * @param floorName * the floorName to set */ public void setFloorName(String floorName) { this.floorName = floorName; } /** * @return the ipAddress */ public String getIpAddress() { return ipAddress; } /** * @param ipAddress * the ipAddress to set */ public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } /** * @return the port */ public Short getPort() { return port; } /** * @param port * the port to set */ public void setPort(Short port) { this.port = port; } /** * @return the snapAddress */ public String getSnapAddress() { return snapAddress; } /** * @param snapAddress * the snapAddress to set */ public void setSnapAddress(String snapAddress) { this.snapAddress = snapAddress; } /** * @return the gatewayType */ public Short getGatewayType() { return gatewayType; } /** * @param gatewayType * the gatewayType to set */ public void setGatewayType(Short gatewayType) { this.gatewayType = gatewayType; } /** * @return the serialPort */ public Short getSerialPort() { return serialPort; } /** * @param serialPort * the serialPort to set */ public void setSerialPort(Short serialPort) { this.serialPort = serialPort; } /** * @param channel * the channel to set */ public void setChannel(Integer channel) { this.channel = channel; } /** * @return the channel */ public Integer getChannel() { return channel; } /** * @param aesKey * the aesKey to set */ public void setAesKey(String aesKey) { this.aesKey = aesKey; } /** * @return the aesKey */ public String getAesKey() { return aesKey; } /** * @param userName * the userName to set */ public void setUserName(String userName) { this.userName = userName; } /** * @return the userName */ public String getUserName() { return userName; } /** * @param password * the password to set */ public void setPassword(String password) { this.password = password; } /** * @return the password */ public String getPassword() { return password; } /** * @param gatewayName * the gatewayName to set */ public void setGatewayName(String gatewayName) { this.name = gatewayName; } /** * @return the gatewayName */ public String getGatewayName() { return name; } /** * @param wirelessNetworkId * the wirelessNetworkId to set */ public void setWirelessNetworkId(Integer wirelessNetworkId) { this.wirelessNetworkId = wirelessNetworkId; } /** * @return the wirelessNetworkId */ public Integer getWirelessNetworkId() { return wirelessNetworkId; } /** * @param wirelessEncryptType * the wirelessEncryptType to set */ public void setWirelessEncryptType(Integer wirelessEncryptType) { this.wirelessEncryptType = wirelessEncryptType; } /** * @return the wirelessEncryptType */ public Integer getWirelessEncryptType() { return wirelessEncryptType; } /** * @param wirelessEncryptKey * the wirelessEncryptKey to set */ public void setWirelessEncryptKey(String wirelessEncryptKey) { this.wirelessEncryptKey = wirelessEncryptKey; } /** * @return the wirelessEncryptKey */ public String getWirelessEncryptKey() { return wirelessEncryptKey; } /** * @param wirelessRadiorate * the wirelessRadiorate to set */ public void setWirelessRadiorate(Integer wirelessRadiorate) { this.wirelessRadiorate = wirelessRadiorate; } /** * @return the wirelessRadiorate */ public Integer getWirelessRadiorate() { return wirelessRadiorate; } /** * @param ethSecType * the ethSecType to set */ public void setEthSecType(Integer ethSecType) { this.ethSecType = ethSecType; } /** * @return the ethSecType */ public Integer getEthSecType() { return ethSecType; } /** * @param ethSecIntegrityType * the ethSecIntegrityType to set */ public void setEthSecIntegrityType(Integer ethSecIntegrityType) { this.ethSecIntegrityType = ethSecIntegrityType; } /** * @return the ethSecIntegrityType */ public Integer getEthSecIntegrityType() { return ethSecIntegrityType; } /** * @param ethSecEncryptType * the ethSecEncryptType to set */ public void setEthSecEncryptType(Integer ethSecEncryptType) { this.ethSecEncryptType = ethSecEncryptType; } /** * @return the ethSecEncryptType */ public Integer getEthSecEncryptType() { return ethSecEncryptType; } /** * @param ethSecKey * the ethSecKey to set */ public void setEthSecKey(String ethSecKey) { this.ethSecKey = ethSecKey; } /** * @return the ethSecKey */ public String getEthSecKey() { return ethSecKey; } /** * @param ethIpaddrType * the ethIpaddrType to set */ public void setEthIpaddrType(Integer ethIpaddrType) { this.ethIpaddrType = ethIpaddrType; } /** * @return the ethIpaddrType */ public Integer getEthIpaddrType() { return ethIpaddrType; } /** * @param app1Version * the app1Version to set */ public void setApp1Version(String app1Version) { this.app1Version = app1Version; } /** * @return the app1Version */ public String getApp1Version() { return app1Version; } public void setVersion(String version) { super.setVersion(version); app2Version = version; } /** * @param app2Version * the app2Version to set */ public void setApp2Version(String app2Version) { this.app2Version = app2Version; } /** * @return the app2Version */ public String getApp2Version() { return version; } /** * @return the currUptime */ public Long getCurrUptime() { return currUptime; } /** * @param currUptime * the currUptime to set */ public void setCurrUptime(Long currUptime) { this.currUptime = currUptime; } /** * @return the currNoPktsFromGems */ public Long getCurrNoPktsFromGems() { return currNoPktsFromGems; } /** * @param currNoPktsFromGems * the currNoPktsFromGems to set */ public void setCurrNoPktsFromGems(Long currNoPktsFromGems) { this.currNoPktsFromGems = currNoPktsFromGems; } /** * @return the currnoPktsToGems */ public Long getCurrNoPktsToGems() { return currNoPktsToGems; } /** * @param currnoPktsToGems * the currnoPktsToGems to set */ public void setCurrNoPktsToGems(Long currnoPktsToGems) { this.currNoPktsToGems = currnoPktsToGems; } /** * @return the currNoPktsToNodes */ public Long getCurrNoPktsToNodes() { return currNoPktsToNodes; } /** * @param currNoPktsToNodes * the currNoPktsToNodes to set */ public void setCurrNoPktsToNodes(Long currNoPktsToNodes) { this.currNoPktsToNodes = currNoPktsToNodes; } /** * @return the currNoPktsFromNodes */ public Long getCurrNoPktsFromNodes() { return currNoPktsFromNodes; } /** * @param currNoPktsFromNodes * the currNoPktsFromNodes to set */ public void setCurrNoPktsFromNodes(Long currNoPktsFromNodes) { this.currNoPktsFromNodes = currNoPktsFromNodes; } /** * @return last stats recvd time */ public Date getLastStatsRcvdTime() { return lastStatsRcvdTime; } public void setLastStatsRcvdTime(Date lastStatsRcvdTime) { this.lastStatsRcvdTime = lastStatsRcvdTime; } /** * @return last connectivity */ public Date getLastConnectivityAt() { return lastConnectivityAt; } public void setLastConnectivityAt(Date lastConnectivityAt) { this.lastConnectivityAt = lastConnectivityAt; } /** * @param subnetMask * the subnetMask to set */ public void setSubnetMask(String subnetMask) { this.subnetMask = subnetMask; } /** * @return the subnetMask */ public String getSubnetMask() { return subnetMask; } /** * @param defaultGw * the defaultGw to set */ public void setDefaultGw(String defaultGw) { this.defaultGw = defaultGw; } /** * @return the defaultGw */ public String getDefaultGw() { return defaultGw; } /** * @param noOfSensors * the noOfSensors to set */ public void setNoOfSensors(int noOfSensors) { this.noOfSensors = noOfSensors; } /** * @return the noOfSensors */ public int getNoOfSensors() { return noOfSensors; } public void setUpgradeStatus(String upgradeStatus) { this.upgradeStatus = upgradeStatus; } /** * @return upgradeStatus */ public String getUpgradeStatus() { return upgradeStatus; } public void setBootLoaderVersion(String bootLoaderVersion) { this.bootLoaderVersion = bootLoaderVersion; } /** * @return bootLoaderVersion */ public String getBootLoaderVersion() { return bootLoaderVersion; } /** * @return the hexNetworkId */ public String getHexWirelessNetworkId() { return Integer.toHexString(this.wirelessNetworkId) ; } public Integer getNoOfActiveSensors() { return noOfActiveSensors; } public void setNoOfActiveSensors(Integer noOfActiveSensors) { this.noOfActiveSensors = noOfActiveSensors; } /** * @return the noOfWds */ public Integer getNoOfWds() { return noOfWds; } /** * @param noOfWds the noOfWds to set */ public void setNoOfWds(Integer noOfWds) { this.noOfWds = noOfWds; } }
[ "rolando.gabriana@gmail.com" ]
rolando.gabriana@gmail.com
fc7bf7508215e35d2f326a3e81185f9af877cc6c
8c81d8ebdcb46574ba5c09c28166b4e17ea9c5ff
/branches/SemMedNHLBINewPrototype/src/gov/nih/nlm/semmed/summarization/SaliencyFilter.java
23d8dd979ac961ab6e56807b16a83753c7713568
[]
no_license
lhncbc/skr-semmed
bd8aa9e3040bed9432402d023faa7191634a2d76
570bb7943221cacd06688f74a7f0381e4d6d3b4b
refs/heads/master
2020-06-11T23:51:41.338595
2019-06-28T14:13:08
2019-06-28T14:13:08
194,127,111
0
0
null
null
null
null
UTF-8
Java
false
false
2,137
java
package gov.nih.nlm.semmed.summarization; import gov.nih.nlm.semmed.model.APredication; // import gov.nih.nlm.semmed.model.summarization.SaliencyUtil; import gov.nih.nlm.semmed.util.Constants; import gov.nih.nlm.semmed.util.GraphUtils; import java.util.List; import java.util.Map; import java.util.ArrayList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author rodriguezal * */ public abstract class SaliencyFilter implements Filter { private static Log log = LogFactory.getLog(SaliencyFilter.class); protected abstract List<APredication> postProcessing(List<APredication> preds, List<APredication> relPreds, Map<String,Boolean> sc1Map); public List<APredication> filter(List<APredication> preliminaryList, String[] predicateList, List<APredication> listIn, String seed) { List<APredication> outList = new ArrayList<APredication>(); Map<String,Integer> conceptCountMap = SaliencyUtil.computeConceptCountMap(listIn); double avgActivationWeight = SaliencyUtil.computeAvgActivationWeight(conceptCountMap); log.debug("avgActivationWeight for Concepts : " + avgActivationWeight); log.debug("Concept Map size : " + conceptCountMap.size()); Map<String,Boolean> sc1Map = SaliencyUtil.computeSC1Map(conceptCountMap, avgActivationWeight); // for(String s: sc1Map.keySet()){ // if (sc1Map.get(s)) { // log.debug("SC1: TRUE concept: " + s); // } // } //TODO [Alejandro] do we really want an integer for the second argument? // Map<String,Double> avgSumOtherMap = SaliencyUtil.computeAvgSumOtherMap(conceptCountMap, (int)(avgActivationWeight * conceptCountMap.size())); // Map<String,Boolean> sc2Map = SaliencyUtil.computeSC2Map(conceptCountMap, avgSumOtherMap); Map<String,Boolean> sc3Map = SaliencyUtil.computeSC3MapA(listIn); // for(String s: sc3Map.keySet()){ // if (sc3Map.get(s)) { // log.debug("SC3: TRUE concept: " + s); // } //} //conceptSaliency !! List<APredication> salientConcPredications = SaliencyUtil.incorporateSCRulesA(listIn, sc1Map, sc3Map); return postProcessing(listIn, salientConcPredications,sc1Map); } }
[ "dongwookshin@hotmail.com" ]
dongwookshin@hotmail.com
d0991cc990cb1f6f29f5b4091a3db4a808dac83a
e1a45db8e398c613fe36817d649d6ebcfe0c7840
/app/src/main/java/battery/zmx/car/com/zmxbattery/map/BasicMapActivity.java
aa466603ae0dd337878be7ac70b68bdb01034d15
[]
no_license
MebisLi/Battery
2ae54added24307b9b3fc60e9e707aaca40d1d02
98b23ce3be67a7497e37fc922726d249773701d8
refs/heads/master
2016-08-12T17:15:17.842789
2016-02-18T02:38:39
2016-02-18T02:38:39
50,340,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,540
java
package battery.zmx.car.com.zmxbattery.map; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import com.amap.api.maps2d.AMap; import com.amap.api.maps2d.MapView; import battery.zmx.car.com.zmxbattery.R; public class BasicMapActivity extends AppCompatActivity { private MapView mapView; private AMap aMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_basic_map); mapView = (MapView) findViewById(R.id.map); mapView.onCreate(savedInstanceState); aMap = mapView.getMap(); init(); Button button1 = (Button) findViewById(R.id.button_1); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(BasicMapActivity.this , LocationActivity.class); startActivityForResult(intent , 1); } }); } private void init() { if (aMap == null) aMap = mapView.getMap(); } @Override protected void onResume() { super.onResume(); mapView.onResume(); } @Override protected void onPause() { super.onPause(); mapView.onPause(); } @Override protected void onDestroy() { super.onDestroy(); mapView.onDestroy(); } }
[ "zhangmengxi@aliyun.com" ]
zhangmengxi@aliyun.com
95d35ce1aa047b91bf87f70073697ad58b2a2dff
f9020a778c8a22209098ac3b4036a86b09773c9d
/app/src/main/java/com/xxx/handnote/adapter/BaseRecyclerViewAdapter.java
9b2f2e89c3b6a8c5ffc477d6fa7f164daa3bc30c
[]
no_license
niuapp/youhonggang_hn
bde729d609ce4cddbf7465f575edf40b967aa746
510a5c3fcc7fcfed3ee86fac46a7759870ddea57
refs/heads/master
2021-01-17T08:38:41.339046
2016-07-12T10:20:45
2016-07-12T10:22:19
62,880,761
0
0
null
null
null
null
UTF-8
Java
false
false
9,643
java
package com.xxx.handnote.adapter; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; import android.view.View; import android.view.ViewGroup; import com.xxx.handnote.R; import com.xxx.handnote.base.OnItemClickListener; import com.xxx.handnote.utils.LogUtils; import com.xxx.handnote.utils.UIUtils; /** * --> 加载更多 可配置的 RecyclerView */ public abstract class BaseRecyclerViewAdapter extends RecyclerView.Adapter<BaseRecyclerViewAdapter.ViewHolder> { protected final int HEAD_TYPE = -2; protected final int FOOT_TYPE = -3; protected final int NULL_TYPE = -1; //加载更多的标记 protected boolean isLoadMore = false; protected boolean isError = false; protected RecyclerView currentRecyclerView; @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { //不同类型的Item View itemView = null; if (viewType == HEAD_TYPE) { //头 if (mHeadView != null) { itemView = mHeadView; } else { itemView = UIUtils.inflate(R.layout.nullview); mHeadView = itemView; } } else if (viewType == FOOT_TYPE) { //脚 if (mFootView != null) { itemView = mFootView; } else { itemView = UIUtils.inflate(R.layout.item_foot_loadingview); mFootView = itemView; } } else if (viewType == NULL_TYPE) { itemView = UIUtils.inflate(R.layout.nullview); } else { //其他条目 itemView = adapterCreateView(parent, viewType); } //不同类型的Item if (itemView == null) { itemView = UIUtils.inflate(R.layout.nullview); } itemView.setTag(viewType);//记录当前条目类型 return getChildViewHolder(itemView); } /** * 获取当前RecyclerView * * @return */ public RecyclerView getCurrentRecyclerView() { return currentRecyclerView; } /** * 自己的ViewHolder * * @param itemView * @return */ protected abstract ViewHolder getChildViewHolder(View itemView); /** * 创建ViewHolder的itemView * * @param parent * @param viewType * @return */ protected abstract View adapterCreateView(ViewGroup parent, int viewType); /** * 加载更多 */ protected void loadMore() { } @Override public int getItemViewType(int position) { if (position == 0) { return HEAD_TYPE; } else if (position == getItemCount() - 1) { return FOOT_TYPE; } else { //内容条目,不同的类型 position = fixPosition(position); //子类设置条目类型 return getAdapterItemType(position); } } /** * 返回条目类型 * * @param position * @return */ protected abstract int getAdapterItemType(int position); /** * 条目个数 不带头脚布局 * @return */ public abstract int getAdapterItemCount(); /** * 在头布局设置数据时 */ protected void bindViewHolder_HEAD_TYPE() { } /** * 在脚布局设置数据时 */ protected void bindViewHolder_FOOT_TYPE() { } @Override public void onBindViewHolder(final ViewHolder holder, int position) { int itemType = getItemViewType(position); if (itemType == HEAD_TYPE) { bindViewHolder_HEAD_TYPE(); return;//头设置 } if (itemType == FOOT_TYPE) { bindViewHolder_FOOT_TYPE(); loadMore(); //加载更多 return;//脚设置 } if (itemType == NULL_TYPE) { return;//空布局 } //修正position position = fixPosition(position); if (onAdapterBindViewHolder(holder, position, itemType)) { //点击回调 holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (onItemClickListener != null) { onItemClickListener.onItemClick(v, holder); } } }); } } /** * 绑定条目数据 * * @param holder * @param position * @param itemType * @return 是否使用点击回调 */ protected abstract boolean onAdapterBindViewHolder(ViewHolder holder, int position, int itemType); @Override public int getItemCount() { return getAdapterItemCount() + 2; // + 头脚布局 } public class ViewHolder extends RecyclerView.ViewHolder { public ViewHolder(View itemView) { super(itemView); } } protected View mHeadView;//头布局 protected View mFootView;//脚布局 /** * 设置头布局 * * @param headView */ public void setHeadView(View headView) { this.mHeadView = headView; notifyItemInserted(0); } public View getmHeadView() { return mHeadView; } /** * 设置脚布局 * * @param footView */ public void setFootView(View footView) { this.mFootView = footView; mFootView.setVisibility(View.VISIBLE); notifyItemInserted(getItemCount() - 1); } public View getmFootView() { return mFootView; } /** * 与此Adapter相关联的RecyclerView * * @param currentRecyclerView */ public void setCurrentRecyclerView(final RecyclerView currentRecyclerView) { this.currentRecyclerView = currentRecyclerView; // RecyclerView 滚动监听,上拉加载更多 currentRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { if (true || newState == RecyclerView.SCROLL_STATE_IDLE || newState == RecyclerView.SCROLL_STATE_SETTLING) {//true 临时添加 待 try { if (mFootView != null && currentRecyclerView != null) { // mFootView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0)); boolean flag = false; if (currentRecyclerView.getLayoutManager() instanceof StaggeredGridLayoutManager) { int[] lastVisibleItemPositions = ((StaggeredGridLayoutManager) currentRecyclerView.getLayoutManager()).findLastVisibleItemPositions(null);//最后一个显示的条目 int lastVisibleItemPosition = -1; if (lastVisibleItemPositions.length == 2) { lastVisibleItemPosition = Math.max(lastVisibleItemPositions[0], lastVisibleItemPositions[1]); } flag = (lastVisibleItemPosition == (getItemCount() - 1)); } else if (currentRecyclerView.getLayoutManager() instanceof LinearLayoutManager) { flag = ((LinearLayoutManager) currentRecyclerView.getLayoutManager()).findLastVisibleItemPosition() == (getItemCount() - 1); } if (flag) { if (isError) { if (isCanFullScreen()){ //判断RecyclerView中的条目是否可以占满一个屏幕 可以才回弹 int bottom = currentRecyclerView.getHeight() - mFootView.getTop(); // LogUtils.d(" bottom --> " + bottom); currentRecyclerView.smoothScrollBy(0, -bottom); mFootView.setVisibility(View.GONE); } } else { loadMore(); } } } } catch (Exception e) { e.printStackTrace(); } } } }); } /** * RecyclerView有效条目是否可以填充屏幕 * @return */ private boolean isCanFullScreen(){ if (currentRecyclerView == null) return false; View firstView = currentRecyclerView.getChildAt(0); if (firstView != null){ LogUtils.d("top --> " + firstView.getTop()); if (firstView.getTop() == 0){ return false; }else { return true; } }else { return false; } } /** * 修正position * * @param position * @return */ private int fixPosition(int position) { //脚布局不影响,不加入修正 return position - 1; } //=============== 条目点击回调 =============== private OnItemClickListener onItemClickListener; public void setOnItemClickListener(OnItemClickListener onItemClickListener) { this.onItemClickListener = onItemClickListener; } //=========================================== }
[ "niuhongyi@iyuntoo.com" ]
niuhongyi@iyuntoo.com
091c6c711b77e4141755c00f3896d7d2ab7000f0
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/CreateImageBuilderStreamingURLRequest.java
e4d2f1a156e7d5278dc301aee3f05788326380ae
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
5,663
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.appstream.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateImageBuilderStreamingURL" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateImageBuilderStreamingURLRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of the image builder. * </p> */ private String name; /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> */ private Long validity; /** * <p> * The name of the image builder. * </p> * * @param name * The name of the image builder. */ public void setName(String name) { this.name = name; } /** * <p> * The name of the image builder. * </p> * * @return The name of the image builder. */ public String getName() { return this.name; } /** * <p> * The name of the image builder. * </p> * * @param name * The name of the image builder. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageBuilderStreamingURLRequest withName(String name) { setName(name); return this; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @param validity * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. */ public void setValidity(Long validity) { this.validity = validity; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @return The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. */ public Long getValidity() { return this.validity; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @param validity * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageBuilderStreamingURLRequest withValidity(Long validity) { setValidity(validity); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getValidity() != null) sb.append("Validity: ").append(getValidity()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateImageBuilderStreamingURLRequest == false) return false; CreateImageBuilderStreamingURLRequest other = (CreateImageBuilderStreamingURLRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getValidity() == null ^ this.getValidity() == null) return false; if (other.getValidity() != null && other.getValidity().equals(this.getValidity()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getValidity() == null) ? 0 : getValidity().hashCode()); return hashCode; } @Override public CreateImageBuilderStreamingURLRequest clone() { return (CreateImageBuilderStreamingURLRequest) super.clone(); } }
[ "" ]
49b92e04137dc7541ee8cb6bf09d1eae58d6eaa0
036b13f99c161e13ca9a3f3c5262db38544131f7
/1_java/Chapter12_pattern/src/strategy/step5/modularization/SuperRobot.java
7ae40de55b525253ed526e52275c304228c63767
[]
no_license
highwindLeos/Webstudy-In-TheJoeun
4e442c1ad500232ad69ae11c2a9faa8634ca8ed3
06b779765551e617cf37499336d6741720f23fa8
refs/heads/master
2022-12-22T10:46:37.241449
2020-07-28T09:54:03
2020-07-28T09:54:03
132,757,543
0
0
null
2022-12-16T01:05:47
2018-05-09T13:00:52
HTML
UHC
Java
false
false
432
java
package strategy.step5.modularization; import strategy.step5.inter.*; public class SuperRobot extends Robot { public SuperRobot() { setFly(new FlyYes()); setMissile(new MissileYes()); setKnife(new KnifeLazer()); //fly = new FlyYes(); //missile = new MissileYes(); //knife = new KnifeLazer(); } @Override public void shape() { System.out.println("SuperRobot입니다. 외형은 팔다리몸통머리."); } }
[ "highwind26@gmail.com" ]
highwind26@gmail.com
421b672bf7e6e3943df46917cfae164083d94e9f
e701669d135803b8ff1c632cc0f9f11f2001de6e
/src/fr/charlito33/skriptutils/httputils/effects/EffSendHTTPPostRequest.java
6cd47ef8eb5d1f05762733fd5e76e3c7a82bfef9
[]
no_license
Charlito33/SkriptUtils
073f3376845c4ce8ef389413c32463fc9f5198e9
c2192aad7107511dc398075193c0d3611720fc82
refs/heads/master
2023-01-20T09:04:38.179360
2020-11-28T12:30:43
2020-11-28T12:30:43
316,220,703
0
0
null
null
null
null
UTF-8
Java
false
false
2,913
java
package fr.charlito33.skriptutils.httputils.effects; import ch.njol.skript.lang.Effect; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.SkriptParser; import ch.njol.util.Kleenean; import fr.charlito33.skriptutils.httputils.utils.HTTPRequestSaver; import fr.charlito33.skriptutils.utils.Logger; import org.bukkit.ChatColor; import org.bukkit.event.Event; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class EffSendHTTPPostRequest extends Effect { private Expression<String> url; private Expression<String> payload; @Override protected void execute(Event e) { try { HttpURLConnection connection = (HttpURLConnection) new URL("http://charlito33.fr.nf/api/get-content-from-url.php?type=POST&url=" + url.getSingle(e) + "&payload=" + payload.getSingle(e)).openConnection(); connection.setRequestMethod("GET"); //Default is : GET -> Optionnal //connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"); //connection.setRequestProperty("Content-Type", "application/json"); //connection.setInstanceFollowRedirects(true); int responseCode = connection.getResponseCode(); if (responseCode == 200) { HTTPRequestSaver.saveResponseCode(responseCode); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = bufferedReader.readLine()) != null) { response.append(inputLine); } HTTPRequestSaver.saveResponseContent(response.toString()); bufferedReader.close(); } else { Logger.info(ChatColor.RED + "Response code unexpected : " + responseCode + ", expected : 200"); } } catch (MalformedURLException malformedURLException) { Logger.info(ChatColor.RED + "Bad Url : " + url.getSingle(e) + " (maybe try add \"http://\" ?)."); } catch (IOException ioException) { Logger.info(ChatColor.RED + "IOException, can't connect to \"" + url.getSingle(e) + "\"."); } } @Override public String toString(Event e, boolean b) { return "send an http get request to %string%"; } @SuppressWarnings("unchecked") @Override public boolean init(Expression<?>[] expr, int i, Kleenean kleenean, SkriptParser.ParseResult parseResult) { url = (Expression<String>) expr[0]; payload = (Expression<String>) expr[1]; return true; } }
[ "37224242+Charlito33@users.noreply.github.com" ]
37224242+Charlito33@users.noreply.github.com
aefd98c761df24a26f42936ac9947a1447777676
478ced27207309780a425d2b468182899089f3d6
/src/main/java/com/unique/frame/DesktopApplication1.java
31366fd32245dad9e637e8dfa757392a207e55e3
[]
no_license
djimenezc/UniqueSystem
c0e81607aaf906b274f1f06bdce93c4335dcad24
04c3c3c24ee9665b53bbab6e1667017c36f31e7a
refs/heads/master
2021-01-19T15:38:30.239816
2015-08-18T09:13:17
2015-08-18T09:13:17
40,962,278
0
0
null
null
null
null
UTF-8
Java
false
false
1,720
java
/* * DesktopApplication1.java */ package com.unique.frame; import javax.swing.JFrame; import org.jdesktop.application.Application; import org.jdesktop.application.SingleFrameApplication; import com.unique.controller.Controller; import com.unique.controller.ControllerImpl; import com.unique.facade.FacadeUnique; import com.unique.facade.FacadeUniqueImpl; /** * The main class of the application. */ public class DesktopApplication1 extends SingleFrameApplication { private FacadeUnique facadeUnique; /** * A convenient static getter for the application instance. * * @return the instance of DesktopApplication1 */ public static DesktopApplication1 getApplication() { return Application.getInstance(DesktopApplication1.class); } /** * Main method launching the application. */ public static void main(final String[] args) { launch(DesktopApplication1.class, args); } /** * This method is to initialize the specified window by injecting resources. * Windows shown in our application come fully initialized from the GUI * builder, so this additional configuration is not needed. */ @Override protected void configureWindow(final java.awt.Window root) { } /** * At startup create and show the main frame of the application. */ @Override protected void startup() { final Controller controllerImpl = ControllerImpl.getInstance(); final JFrame mainFrame = new UniqueFrame(controllerImpl.getTableModel()); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); controllerImpl.addView("UniqueFrame", mainFrame); facadeUnique = new FacadeUniqueImpl(); setMainFrame(mainFrame); show(mainFrame); } }
[ "david.jimenez19@gmail.com" ]
david.jimenez19@gmail.com
19fd3734d4fe50e8e2747b9f2fcae6f7803bf6ee
2eed8ec57425fc8d528277eef27fe65364f5fe0a
/e3mallV1/e3_search_web/src/main/java/cn/e3mall/search/controller/SearchController.java
afc57ea47d5fbf087f99877bdda2013e6e711232
[]
no_license
B-Tigo/Mall_project
5a470121515a54da75d68f56debb6334bfb67d2b
557142e4b6487c72edd0ee952a52c073cacaa13a
refs/heads/master
2022-12-22T23:46:44.796033
2019-10-23T05:18:53
2019-10-23T05:18:53
216,969,767
0
0
null
2022-12-16T07:15:46
2019-10-23T04:44:42
JavaScript
UTF-8
Java
false
false
1,612
java
package cn.e3mall.search.controller; import cn.e3mall.common.pojo.SearchResult; import cn.e3mall.search.service.SearchService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; /** * 商品搜索controller */ @Controller public class SearchController { @Autowired private SearchService searchService; @Value("${SEARCH_RESULT_ROWS}") private Integer SEARCH_RESULT_ROWS; @RequestMapping("/search") public String SearchItemList(String keyword, @RequestParam(defaultValue = "1") Integer page, Model model) throws Exception { keyword = new String(keyword.getBytes("iso_8859-1"), "utf-8"); //查询商品列表 SearchResult searchResult = searchService.search(keyword, page, SEARCH_RESULT_ROWS); //把结果传递给页面 model.addAttribute("query", keyword); model.addAttribute("totalPages", searchResult.getTotalPage()); model.addAttribute("page", page); model.addAttribute("recordCount", searchResult.getRecordCount()); model.addAttribute("itemList", searchResult.getItemList()); //异常测试 // int a = 1/0; //返回逻辑视图 return "search"; } }
[ "B_Tigo@outlook.com" ]
B_Tigo@outlook.com
dd0f3e916311b69453e7cea5ca0dd820ccd46120
1d681dd7182323de7a28739b3ef99f16ac3e7f0c
/src/test/java/com/cloudht/testDemo/TestAliyun.java
20d688d746e2b8190aa0cd29c3d75a44e88b5d17
[]
no_license
yuxueling/ftcsp-client
6ea01847c5dd1c8ac789f6b90b899cb6de4ed928
4a8a037fb08fcae6ab55a67e3abb940428ae7a48
refs/heads/master
2020-03-18T19:18:55.352746
2018-07-10T13:05:20
2018-07-10T13:05:20
135,147,140
0
0
null
null
null
null
UTF-8
Java
false
false
3,143
java
package com.cloudht.testDemo; import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.IAcsClient; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.http.MethodType; import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; public class TestAliyun { public static void main(String[] args) throws ClientException { //设置超时时间-可自行调整 System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); System.setProperty("sun.net.client.defaultReadTimeout", "10000"); //初始化ascClient需要的几个参数 final String product = "Dysmsapi";//短信API产品名称(短信产品名固定,无需修改) final String domain = "dysmsapi.aliyuncs.com";//短信API产品域名(接口地址固定,无需修改) //替换成你的AK final String accessKeyId = "yourAccessKeyId";//你的accessKeyId,参考本文档步骤2 final String accessKeySecret = "yourAccessKeySecret";//你的accessKeySecret,参考本文档步骤2 //初始化ascClient,暂时不支持多region(请勿修改) IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret); DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); IAcsClient acsClient = new DefaultAcsClient(profile); //组装请求对象 SendSmsRequest request = new SendSmsRequest(); //使用post提交 request.setMethod(MethodType.POST); //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式;发送国际/港澳台消息时,接收号码格式为00+国际区号+号码,如“0085200000000” request.setPhoneNumbers("18635098085"); //必填:短信签名-可在短信控制台中找到 request.setSignName("云通信"); //必填:短信模板-可在短信控制台中找到 request.setTemplateCode("SMS_1000000"); //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 //友情提示:如果JSON中需要带换行符,请参照标准的JSON协议对换行符的要求,比如短信内容中包含\r\n的情况在JSON中需要表示成\\r\\n,否则会导致JSON在服务端解析失败 request.setTemplateParam("{\"name\":\"Tom\", \"code\":\"123\"}"); //可选-上行短信扩展码(扩展码字段控制在7位或以下,无特殊需求用户请忽略此字段) //request.setSmsUpExtendCode("90997"); //可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者 request.setOutId("yourOutId"); //请求失败这里会抛ClientException异常 SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); if(sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) { //请求成功 } } }
[ "Hzof@DESKTOP-TVVV7ID" ]
Hzof@DESKTOP-TVVV7ID
ecf5ccf0d0fae67b37b0c718ba8f31be3e91f1c5
a230d4995afa9833d7f70152eba1baf528afb583
/mpi_java/org/mpich/exceptions/MPI_Rma_shared_exception.java
4558d91e424e7b68c59c126ad3083ebbb9b87b05
[]
no_license
niksanElements/javampi
bda77b52f416579944dee92c8914961ba346783b
df376cbde141a09526922f235595d45659d5a746
refs/heads/master
2020-09-28T00:17:20.560184
2020-02-25T13:43:47
2020-02-25T13:43:47
226,643,517
0
0
null
null
null
null
UTF-8
Java
false
false
219
java
package org.mpich.exceptions; public class MPI_Rma_shared_exception extends Exception { public static final long serialVersionUID = 1; public MPI_Rma_shared_exception(String txt){ super(txt); } }
[ "niksan9411@gmail.com" ]
niksan9411@gmail.com
70657a74c66f1a1383792c052477ab934cff73f6
81c7067c8170e3e61530522835577fd5e58527c1
/app/src/main/java/com/zjzy/morebit/main/contract/NoticeContract.java
9aae7643b6103f0adbe498c42eee21956962b493
[ "Apache-2.0" ]
permissive
Lchenghui/morebit-android-app
7806295750770f8fb55483797f621bc88054d259
c889f6c3efdc3b96fbff48a23b0d01a65d6b8aa5
refs/heads/master
2023-02-26T18:31:51.575690
2020-09-14T09:35:00
2020-09-14T09:35:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.zjzy.morebit.main.contract; import com.zjzy.morebit.Module.common.Activity.BaseActivity; import com.zjzy.morebit.mvp.base.base.BasePresenter; import com.zjzy.morebit.mvp.base.base.BaseRcView; import com.zjzy.morebit.pojo.ImageInfo; import java.util.List; /** * @Author: wuchaowen * @Description: **/ public class NoticeContract { public interface View extends BaseRcView { //刷新数据 void refreshData(List<ImageInfo> data); //加载更多数据 void moreData(List<ImageInfo> data); //没有数据 void showNoData(); void refreshDateFail(); } public interface Present extends BasePresenter { void getNoticeList(BaseActivity activity,boolean isRefresh,int type); } }
[ "liuhaiping@hzyushi.cn" ]
liuhaiping@hzyushi.cn
21cb4a1e46eb6181aa6bea76f97dbc52b1cdf4eb
3699b45d47014fb71a9cd9d50159eb55bb637cb3
/src/main/java/com/sphenon/basics/many/ObjectExistenceCheck.java
a30d5d02965f76ca69ca25e4f440f3cbd3c2aa8b
[ "Apache-2.0" ]
permissive
616c/java-com.sphenon.components.basics.many
0d78a010db033e54a46d966123ed2d15f72a5af4
918e6e1e1f2ef4bdae32a8318671500ed20910bb
refs/heads/master
2020-03-22T05:45:56.259576
2018-07-06T16:19:40
2018-07-06T16:19:40
139,588,622
0
0
null
null
null
null
UTF-8
Java
false
false
4,736
java
package com.sphenon.basics.many; /**************************************************************************** Copyright 2001-2018 Sphenon GmbH 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. *****************************************************************************/ import com.sphenon.basics.context.*; import com.sphenon.basics.context.classes.*; import com.sphenon.basics.configuration.*; import com.sphenon.basics.message.*; import com.sphenon.basics.exception.*; import com.sphenon.basics.notification.*; import com.sphenon.basics.customary.*; import java.lang.Iterable; import java.util.Iterator; import java.util.Arrays; import java.util.Collection; public class ObjectExistenceCheck { protected CallContext context; protected Object object; protected Object other_object; public ObjectExistenceCheck (CallContext context, Object object) { this.context = context; this.object = object; } public ObjectExistenceCheck (CallContext context, Object object, Object other_object) { this.context = context; this.object = object; this.other_object = other_object; } public boolean exists(CallContext context) { return ( this.object != null && ( (this.object instanceof Voidable) == false || ((Voidable) this.object).isVoid(context) == false ) ); } public boolean notexists(CallContext context) { return ! exists(context); } public boolean isvalid(CallContext context) { if (this.exists(context) == false) { return false; } if (this.object instanceof Boolean) { return ((Boolean) this.object); } if (this.object instanceof Short) { return ((Short) this.object) != 0; } if (this.object instanceof Integer) { return ((Integer) this.object) != 0; } if (this.object instanceof Long) { return ((Long) this.object) != 0; } return false; } public boolean isinvalid(CallContext context) { return ! isvalid(context); } public boolean empty(CallContext context) { if (this.exists(context) == false) { return true; } if (this.object instanceof GenericIterable) { Iterator iterator = ((GenericIterable) this.object).getIterator(context); if (iterator == null) { return true; } if ( ! iterator.hasNext()) { return true; } return false; } if (this.object instanceof Iterable) { Iterator iterator = ((Iterable) this.object).iterator(); if (iterator == null) { return true; } if ( ! iterator.hasNext()) { return true; } return false; } if (this.object instanceof String) { String s = (String) object; return (s == null || s.length() == 0 || s.matches("\\s*")); } if (this.object instanceof Short) { Short s = (Short) object; return (s == null || s == 0); } if (this.object instanceof Integer) { Integer i = (Integer) object; return (i == null || i == 0); } if (this.object instanceof Long) { Long l = (Long) object; return (l == null || l == 0); } if (this.object.getClass().isArray()) { return (java.lang.reflect.Array.getLength(object) == 0 ? true : false); } return true; } public boolean notempty(CallContext context) { return ! empty(context); } public boolean element(CallContext context) { if (this.other_object == null) { return false; } if (this.other_object.getClass().isArray()) { return Arrays.asList((Object[]) this.other_object).contains(this.object); } if (this.other_object instanceof Collection) { return ((Collection) this.other_object).contains(this.object); } return false; } public boolean notelement(CallContext context) { return ! element(context); } public Object getValue(CallContext context) { return this.object; } }
[ "adev@leue.net" ]
adev@leue.net
be6c504ade955b984483672affaec4db2273ed7b
a33e85313a45bebfb82f9f2fee2bb85a9da97939
/src/main/java/pageEvents/HomePageEvents.java
3b639e3ecbc3e2c03f121d71e479641dad867b7d
[]
no_license
AbhilashBarekare/sampleFramework
cb2d2230be76350aa79b6a980c2a0424d62626ce
49d05a73b84da6424118250ac14de1514ff4469d
refs/heads/master
2023-08-27T23:17:47.321800
2021-11-11T10:56:04
2021-11-11T10:56:04
426,966,758
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package pageEvents; import newframework.BaseTest; import pageObjects.HomePageElements; import utils.ElementFetch; public class HomePageEvents { public void signInButton() { ElementFetch elementFetch=new ElementFetch(); BaseTest.logger.info("Clicking on Signin button on HomePage"); elementFetch.getWebElement("XPATH", HomePageElements.signingButton).click(); } }
[ "abhilashbr94@gmail.com" ]
abhilashbr94@gmail.com
3eac64d4df551775a5eb09a0eeb3726977ab0f07
a24b7c34120d2f5174eef81888e93113e189a12c
/app/src/main/java/com/example/protos/Adapter/SearchAdapter.java
077682a7f129c0eabc0a1e091284ba2635a5f96a
[]
no_license
stefan12an/Protos
da06d7ede70836ab645a6c85d78e926b9d59c7a1
2d7eb9abe0d93cae4376f42ba98aa4dba08f2625
refs/heads/main
2023-07-15T01:14:35.705115
2021-08-24T10:12:41
2021-08-24T10:12:41
384,541,555
0
0
null
2021-08-24T10:12:41
2021-07-09T20:13:13
Java
UTF-8
Java
false
false
4,240
java
package com.example.protos.Adapter; import android.app.ActivityOptions; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.SearchView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; import com.example.protos.Model.Posts; import com.example.protos.Model.Users; import com.example.protos.R; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import org.jetbrains.annotations.NotNull; import java.util.List; import de.hdodenhof.circleimageview.CircleImageView; public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchViewHolder> { private List<Users> mList; private Context context; private FirebaseAuth mAuth; private StorageReference mPostStorageRef; private StorageReference mUserStorageRef; private DatabaseReference UsersDatabaseReference; private DatabaseReference PostsDatabaseReference; OnSearchItemClickListener mOnSearchItemClickListener; public SearchAdapter(Context context, List<Users> mList, OnSearchItemClickListener onSearchItemClickListener){ this.mList = mList; this.context = context; this.mOnSearchItemClickListener = onSearchItemClickListener; } @NonNull @NotNull @Override public SearchViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) { View v = LayoutInflater.from(context).inflate(R.layout.user_card, parent, false); return new SearchViewHolder(v, mOnSearchItemClickListener); } @Override public void onBindViewHolder(@NonNull @NotNull SearchViewHolder holder, int position) { mAuth = FirebaseAuth.getInstance(); mPostStorageRef = FirebaseStorage.getInstance().getReference("PostPics"); mUserStorageRef = FirebaseStorage.getInstance().getReference("ProfilePic"); UsersDatabaseReference = FirebaseDatabase.getInstance("https://protos-dde67-default-rtdb.europe-west1.firebasedatabase.app/").getReference("Users"); PostsDatabaseReference = FirebaseDatabase.getInstance("https://protos-dde67-default-rtdb.europe-west1.firebasedatabase.app/").getReference("Posts"); Users user = mList.get(position); holder.setProfile_pic(user.getProfile_pic()); holder.setSearchUsername(user.getUsername()); holder.setDescription(user.getDate_of_birth()); } @Override public int getItemCount() { return mList.size(); } public class SearchViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ OnSearchItemClickListener mOnSearchItemClickListener; CircleImageView profile_pic; TextView username,description; View mView; public SearchViewHolder(@NonNull @NotNull View itemView, OnSearchItemClickListener mOnSearchItemClickListener) { super(itemView); mView = itemView; this.mOnSearchItemClickListener = mOnSearchItemClickListener; itemView.setOnClickListener(this); } public void setProfile_pic(String urlPic) { profile_pic = mView.findViewById(R.id.searchProfilePic); Glide.with(context).load(urlPic).into(profile_pic); } public void setSearchUsername(String user){ username = mView.findViewById(R.id.searchUsername); username.setText(user); } public void setDescription(String description){ this.description = mView.findViewById(R.id.searchDescription); this.description.setText(description); } @Override public void onClick(View v) { mOnSearchItemClickListener.OnSearchItemClick(getAbsoluteAdapterPosition()); } } public interface OnSearchItemClickListener { void OnSearchItemClick(int position); } }
[ "vms1238@gmail.com" ]
vms1238@gmail.com
ce92b8bfe30dc4677eb87d4e0dc127a6fee9f19e
475667042fc3f4271035fe14671b7c9009e15945
/src/main/java/co/com/lunchdelivery/drone/DroneDirectionsEnum.java
8e8033bde1d963eaa32f8959ad5dae8db82cea0f
[]
no_license
cristianhoyos66/LunchDelivery
1116c805a5c9aa8a19967f0adf33bb788e77ba73
09eddfbb35f321662aeff097de65cf313f42bab1
refs/heads/master
2022-11-05T13:38:09.190181
2020-06-21T02:17:12
2020-06-21T02:17:12
273,819,413
0
0
null
null
null
null
UTF-8
Java
false
false
240
java
package co.com.lunchdelivery.drone; import lombok.AllArgsConstructor; import lombok.Getter; @Getter @AllArgsConstructor public enum DroneDirectionsEnum { N("North"), E("East"), W("West"), S("South"); private String direction; }
[ "cristianhoyos66@hotmail.com" ]
cristianhoyos66@hotmail.com