blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 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 689M ⌀ | 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 131 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 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4487e74526076581b106ee1082c4ffc1504448bb | d5bcef447e51e55d9999884f942628ba78185427 | /sxcfu/app/src/main/java/com/hz/zdjfu/application/modle/performancelist/PerformanceAdapter.java | a833d11e0037d813736648d819cb77e45f92772e | [] | no_license | heguogui/zdjfu | 4b43095c85c982d7b795cecd4988fb2c5f739c9c | a3e9bd76ae3a09f495d580fd5864fcc8126bdf2b | refs/heads/master | 2020-03-21T22:31:58.836439 | 2018-07-11T09:22:49 | 2018-07-11T09:22:49 | 139,132,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,359 | java | package com.hz.zdjfu.application.modle.performancelist;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.hz.zdjfu.application.R;
import com.hz.zdjfu.application.data.bean.ProductBean;
import com.hz.zdjfu.application.modle.product.productdetail.ProductDetailActivity;
import com.hz.zdjfu.application.utils.AmountUtils;
import com.hz.zdjfu.application.utils.UiUtils;
import com.hz.zdjfu.application.utils.image.ImageLoader;
import com.hz.zdjfu.application.widget.view.CircleProgressView;
import com.hz.zdjfu.application.widget.view.FinancialCDTimeView;
import java.util.List;
/**
* [类功能说明]
* 履约中适配器
* @author HeGuoGui
* @version 2.1.0
* @time 2017/8/28 0028
*/
public class PerformanceAdapter extends RecyclerView.Adapter<PerformanceAdapter.ItemViewHolder> {
private static final String TAG =PerformanceAdapter.class.getName();
private static final int VIEW_TYPE = -1;
private Context mContext;
private List<ProductBean> mLists;
private boolean isRefersh = true;
public PerformanceAdapter(Context context, List<ProductBean> lists) {
this.mLists =lists;
this.mContext = context;
}
public void setIsRefersh(boolean isRefersh) {
this.isRefersh = isRefersh;
}
public void setData(List<ProductBean> lists){
this.mLists =lists;
}
@Override
public int getItemCount() {
return mLists.size() > 0 ?mLists.size() : 1;
}
@Override
public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
LayoutInflater inflater = LayoutInflater.from(mContext);
if (VIEW_TYPE == viewType) {
view = inflater.inflate(R.layout.view_empty_data, parent, false);
return new ItemViewHolder(view);
}
view = inflater.inflate(R.layout.view_performance_item, parent, false);
return new ItemViewHolder(view);
}
@Override
public void onBindViewHolder(ItemViewHolder holder, int position) {
if (mLists != null && mLists.size() > 0) {
ProductBean mBean = mLists.get(position);
holder.bindData(mBean);
holder.itemView.setTag(mBean);
}
}
@Override
public int getItemViewType(int position) {
if (mLists.size() <= 0) {
return VIEW_TYPE;
}
return super.getItemViewType(position);
}
public class ItemViewHolder extends RecyclerView.ViewHolder {
private TextView performance_title;
private TextView performance_data;
private TextView performance_fillrates;
private TextView performance_earning;
private ImageView performance_image;
private TextView performance_amount;
private TextView performance_amount_title;
private ImageView performance_item_other_iv;
private TextView performance_item_type;
private LinearLayout performance_item_main;//点击查看
private RelativeLayout performance_item_earnings_fillrates_rl;
private TextView performance_is_frish;
public ItemViewHolder(View itemView) {
super(itemView);
performance_title =itemView.findViewById(R.id.performance_item_title);
performance_data =itemView.findViewById(R.id.performance_item_data);
performance_fillrates =itemView.findViewById(R.id.performance_item_earnings_fillrates);
performance_earning =itemView.findViewById(R.id.performance_item_earnings);
performance_image =itemView.findViewById(R.id.performance_item_head);
performance_amount=itemView.findViewById(R.id.performance_item_amount_tv);
performance_amount_title =itemView.findViewById(R.id.performance_item_amount_title_tv);
performance_item_other_iv =itemView.findViewById(R.id.performance_item_other_iv);
performance_item_type =itemView.findViewById(R.id.performance_item_type);
performance_item_main =itemView.findViewById(R.id.performance_item_main);
performance_item_earnings_fillrates_rl =itemView.findViewById(R.id.performance_item_earnings_fillrates_rl);
performance_is_frish =itemView.findViewById(R.id.performance_item_isfrish);
}
public void bindData(ProductBean item) {
if (item == null) {
return;
}
//获取头像
if (TextUtils.isEmpty(item.getPhoto())) {
ImageLoader.getInstance().displayCircleImage(mContext, R.mipmap.ic_list_defualt_bg, performance_image);
} else {
if(TextUtils.isEmpty(UiUtils.URLEncoderFileImage(item.getPhoto()))){
ImageLoader.getInstance().displayCircleImage(mContext, R.mipmap.ic_list_defualt_bg, performance_image);
}else{
ImageLoader.getInstance().displayCircleImage(mContext,UiUtils.URLEncoderFileImage(item.getPhoto()),performance_image);
}
}
//名字
performance_title.setText(item.getProduct_code() + "");
//年化率 平台大于0 则年化率减去平台贴息部分 否者直接显示年化率
if (item.getPlatform_interest()==0.0) {
performance_earning.setText(item.getIncome()+"");
performance_item_earnings_fillrates_rl.setVisibility(View.GONE);
} else {
double subIncome = UiUtils.sub(String.valueOf(item.getIncome()),String.valueOf(item.getPlatform_interest()));
performance_earning.setText(subIncome+"");
performance_fillrates.setText("+"+item.getPlatform_interest());
performance_item_earnings_fillrates_rl.setVisibility(View.VISIBLE);
}
//活动标签
if(TextUtils.isEmpty(item.getLabel())){
performance_item_type.setVisibility(View.GONE);
}else {
performance_item_type.setText(item.getLabel());
performance_item_type.setVisibility(View.VISIBLE);
}
//新手
if(item.getIs_fresh()==1){
performance_is_frish.setText("新手");
performance_is_frish.setVisibility(View.VISIBLE);
}else{
performance_is_frish.setVisibility(View.GONE);
}
//天数
performance_data.setText(item.getIncomeDays() + "");
//financial_amount_title 1.编辑中 11.审核中 2.发标中 3.待发布 31.预募集 4.投资中 5.履约中 6.已还款 7.满标 8.流标',
if(item.getStatus()==5||item.getStatus()==7){//履约中
performance_item_other_iv.setBackgroundResource(R.mipmap.lvyuezhong);
performance_amount_title.setText("投资人数");
performance_amount.setText(item.getBuyer_count()+"人");
SpannableString sp = new SpannableString(performance_amount.getText().toString());
//笔数颜色
int mLength =performance_amount.getText().toString().length();
sp.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.gray1)),mLength-1,mLength, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
performance_amount.setText(sp);
}
performance_item_main.setTag(item);
performance_item_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ProductBean mBean= (ProductBean) view.getTag();
Bundle mBundle = new Bundle();
mBundle.putString("PRODUCTID",mBean.getId()+"");
mContext.startActivity(ProductDetailActivity.makeIntent(mContext,mBundle));
}
});
}
}
}
| [
"86100992@qq.com"
] | 86100992@qq.com |
17cd826dbf7e20585f27fb3fb8bf4a0576807878 | 77629bc5c5e16f6c958f7ffdfead2ff332888d3c | /alarm/src/main/java/com/rumberomelo/alarm/IAlarm.java | 9dfb7312e21b81f26d90492422813210d60f4173 | [] | no_license | rumberomelo/microArq | 7176c375744d1c79e0d5fdaf39dbbc05f994774a | d90acce00680cd31996cdbca1dc70883448e0503 | refs/heads/master | 2020-04-10T18:27:24.471808 | 2018-12-13T11:22:34 | 2018-12-13T11:22:34 | 161,205,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package com.rumberomelo.alarm;
import java.util.Set;
import org.springframework.web.bind.annotation.PathVariable;
import com.rumberomelo.Alarm;
public interface IAlarm {
public Set<Alarm> findAlarms(@PathVariable("patern") String patern) ;
}
| [
"rumberomelo@gmail.com"
] | rumberomelo@gmail.com |
566967f08aadd0cf83bbdb2a3c2f147a0818a36c | 1848258c59dd79153b849a968b2a3a7e3b7d3326 | /src/UI/controllers/RepositoryController.java | 85188398d0abb6ca82612f45312cec63d3417235 | [] | no_license | DubAvenXP/Final-Algoritmos-JAVAFX | c9c6ac3e3232c5f309f348c6d361257e35a91932 | 25c3313f0ebb8e62a82fb1f8c1adc66982ee4640 | refs/heads/master | 2023-01-08T00:05:16.184790 | 2020-10-31T04:40:02 | 2020-10-31T04:40:02 | 298,901,426 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 808 | java | package UI.controllers;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import java.net.URL;
import java.util.ResourceBundle;
public class RepositoryController implements Initializable {
@FXML
private WebView web;
/**
* Descripcion: Este metodo se ejecuta al inicializar el fxml y es la sobreescritura
* de un metodo de la interface Initializable
* carga la pagina web del repositorio https://github.com/DubAvenXP/Final-Algoritmos-JAVAFX
* */
@Override
public void initialize(URL location, ResourceBundle resources) {
final WebEngine webEngine = web.getEngine();
String url = "https://github.com/DubAvenXP/Final-Algoritmos-JAVAFX";
webEngine.load(url);
}
}
| [
"alejandrodubon88@gmail.com"
] | alejandrodubon88@gmail.com |
0cf5920648544cdb25b491fe15f12ff047c66c57 | 20cf58ae641e58f72dc31eed03de39299bbf441d | /admin/src/main/java/com/code/server/admin/action/UserAction.java | 94ca4c5289ef1e3cfecd69b9b30a45aa02037617 | [
"MIT"
] | permissive | 1282127821/summer-1 | effe36c59b0a7ddd9cdbf1d75549650e816adc4e | e1b9ca2a67d340b2960175f552604ea3e1936dad | refs/heads/master | 2023-04-24T07:25:46.732818 | 2021-05-12T02:04:40 | 2021-05-12T02:04:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,276 | java | package com.code.server.admin.action;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by sunxianping on 2017/8/14.
*/
@RestController
@EnableAutoConfiguration
@RequestMapping(value ="/user")
public class UserAction {
@RequestMapping(value = "/login")
@ResponseBody
public Object login( HttpServletRequest request,HttpServletResponse response) {
String username = request.getParameter("username");
String password = request.getParameter("password");
System.out.println(username);
System.out.println(password);
Map<String, Object> result = new HashMap<>();
Map<String, Object> data = new HashMap<>();
data.put("token", 1);
result.put("code", 20000);
result.put("data", data);
result.put("result","ok");
return result;
}
@RequestMapping(value = "/info")
@ResponseBody
public Object getInfo( HttpServletRequest request,HttpServletResponse response) {
String token = request.getParameter("token");
System.out.println(token);
Map<String, Object> result = new HashMap<>();
result.put("code", 20000);
Map<String, Object> data = new HashMap<>();
List<String> roles = new ArrayList<>();
roles.add("admin");
data.put("role", roles);
data.put("name", "sun");
data.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
result.put("data", data);
return result;
}
// @RequestMapping(value = "/user", method = RequestMethod.GET)
// public void user( HttpServletRequest request, HttpServletResponse response) {
//// System.out.println(username);
//// System.out.println(password);
// Map<String, Object> result = new HashMap<>();
// result.put("result","ok");
//
// }
}
| [
"redalert3@126.com"
] | redalert3@126.com |
a1d6e29c788595c580ed7322b6dac32b45012042 | 5434e9ddfb41f872b21ace9bf257f41a13c55f3c | /app/src/main/java/com/threehmis/bjaj/api/bean/respon/GetInfoRigistRsp.java | 1f848c4951d9d132a92357fc089ff3292820c2d6 | [] | no_license | zhengchengrong/bjajnow | 501f235a206bdd5638caa7b577ca472e6be1f223 | 2dc9d606bb0e8816d19ed4e58011ad3992644e06 | refs/heads/master | 2021-05-08T12:38:48.942582 | 2018-03-13T10:34:35 | 2018-03-13T10:34:35 | 119,955,137 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,171 | java | package com.threehmis.bjaj.api.bean.respon;
import java.io.Serializable;
import java.util.List;
public class GetInfoRigistRsp implements Serializable {
private static final long serialVersionUID = 1L;
public List<CheckListBean> checkList;
public List<TitleListBean> titleList;
public static class CheckListBean {
/**
* type : 地基基础工程(60分)
* itemName : 复合地基应按要求进行检测,检测报告应齐全(5分)
* checkResult :
* checkFile : null
* baseItemPk : FWST01-01-01
* pk : null
*/
public String type;
public String itemName;
public String checkResult;
public List<CheckFileBean> checkFile;
public String baseItemPk;
public String pk;
public static class CheckFileBean{
public String type;
public String id;
public String url;
}
}
public static class TitleListBean {
/**
* itemName : 地基基础工程(60分)
* pk : FWST01
*/
public String itemName;
public String pk;
}
}
| [
"lin9long@163.com"
] | lin9long@163.com |
56a4ff17263033b930c989488d210802c158e82c | f677f691826ac88417936ee2bb96646494008cb2 | /src/main/java/com/antybeety/map/model/dao/FacilityDetailDAO.java | f98d1d52c7e6fa23e16322a1b06e0eb464711617 | [] | no_license | enaenen/thingbeeways | 0654d887559b2c31c6d59d87a9f49a930ab3195d | f9480526a919f9d55f5878bf5427cf371759f4a2 | refs/heads/master | 2022-12-27T07:44:50.071172 | 2019-08-07T11:59:41 | 2019-08-07T11:59:41 | 200,219,048 | 1 | 0 | null | 2022-12-16T05:42:37 | 2019-08-02T10:54:13 | JavaScript | UTF-8 | Java | false | false | 205 | java | package com.antybeety.map.model.dao;
import com.antybeety.map.model.vo.FacilityDetailVO;
public interface FacilityDetailDAO {
FacilityDetailVO searchDetail(String code);
String getFacilName();
}
| [
"enaenen@naver.com"
] | enaenen@naver.com |
cdf8d24bff49e53ee9c597b3a46c1e1fa064604c | 87af96444ade2eda2adcd39fa8c0fa6246e240f2 | /Android/MainActivity.java | 400f613a148b2c1042903b265408fe2f79c64eae | [] | no_license | luisflr/Procesos-de-Software | 9c577858c900ee557b4c7f374889538487a01e20 | f6719f67577c013e898e940c632e6d48b82fc7e9 | refs/heads/master | 2020-06-18T19:01:11.776007 | 2019-07-11T21:45:03 | 2019-07-11T21:45:03 | 196,410,846 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,544 | java | package com.uprocesos.jm_servac;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
Button siguiente;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
siguiente = (Button)findViewById(R.id.button);
}
public void EnviarOnClick(View v)
{
Thread nt = new Thread(){
EditText et_numero1 = (EditText)findViewById(R.id.edt1);
EditText et_numero2 = (EditText)findViewById(R.id.Contraseña);
String res;
@Override
public void run()
{
String NAMESPACE = "http://tempuri.org/";
String URL = "http://192.168.0.29:45455/WebService1.asmx";
String METHOD_NAME = "Login";
String SOAP_ACTION = "http://tempuri.org/Login";
//Intent siguiente = new Intent(MainActivity.this,Main2Activity.class);
//startActivity(siguiente);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("Usuario", (et_numero1.getText().toString()));
request.addProperty("Password", (et_numero2.getText().toString()));
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE transporte = new HttpTransportSE(URL);
try {
transporte.call(SOAP_ACTION, envelope);
SoapPrimitive resultado_xml = (SoapPrimitive) envelope.getResponse();
res = resultado_xml.toString();
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
runOnUiThread( new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, res, Toast.LENGTH_LONG ).show();
TextView result = (TextView) findViewById(R.id.ttv1);
if (res.equals("null"))
{
res = "no data found";
result.setText(res);
}
else
{
System.out.print(res);
Intent siguiente = new Intent(MainActivity.this, Main2Activity.class);
startActivity(siguiente);
}
}
});
}
};
nt.start();
}
}
| [
"noreply@github.com"
] | luisflr.noreply@github.com |
734516259241e0fb6c47bb0ec83eb1aeb0952e50 | 4a5620d2f4cef73ffd950082c63cbe1d26c826da | /myblog-web/src/main/java/com/xiaoshuai/service/impl/UserLoginServiceImpl.java | b7b1b17df8fd70d52f3aa3b42b86ae0e030d22fb | [] | no_license | mozhijun/BlogV2.0 | 811cb07c2709cd76162066aaab09003ba64c4d09 | cc98dc2938b7643f2abdb4993e147737fbe49e0d | refs/heads/main | 2023-02-20T21:39:00.375531 | 2021-01-21T02:19:10 | 2021-01-21T02:19:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,161 | java | package com.xiaoshuai.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaoshuai.entity.UserLogin;
import com.xiaoshuai.mapper.UserLoginMapper;
import com.xiaoshuai.service.UserLoginService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author xiaoshuai
* @since 2020-11-17
*/
@Service
public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin> implements UserLoginService {
@Override
public IPage<UserLogin> getUserInfoList(Integer current, Integer size, String nickname) {
Page<UserLogin> page = new Page<>(current, size);
QueryWrapper<UserLogin> wrapper=null;
if(nickname!=null && nickname!=""){
wrapper=new QueryWrapper<>();
wrapper.like("nickname", nickname);
}
Page<UserLogin> userLoginPage = this.baseMapper.selectPage(page, wrapper);
return userLoginPage;
}
}
| [
"1766281636@qq.com"
] | 1766281636@qq.com |
e899816227abb0cff01230f949ee710fd602a5d1 | eca87d67124318a14a929a7db5b9d105f9827607 | /src/test/java/hudson/plugins/git/GitSCMUnitTest.java | 8345de24f25fd6bbe5c2d714d3390fcda9edd94e | [
"MIT"
] | permissive | sharon-amir/git-plugin | 4316fd8dcaa83816f957cfda6fe16b6fc4d25edc | c99d18fcbd064bb9c4a4c2d8ec5ce28217042846 | refs/heads/master | 2022-06-03T01:06:57.650337 | 2020-04-20T21:35:23 | 2020-04-20T21:35:23 | 259,326,264 | 1 | 0 | MIT | 2020-04-27T13:15:16 | 2020-04-27T13:15:15 | null | UTF-8 | Java | false | false | 13,641 | java | /*
* The MIT License
*
* Copyright 2017 Mark Waite.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.plugins.git;
import hudson.EnvVars;
import static hudson.plugins.git.GitSCM.createRepoList;
import hudson.plugins.git.browser.GitRepositoryBrowser;
import hudson.plugins.git.browser.GithubWeb;
import hudson.plugins.git.extensions.GitSCMExtension;
import hudson.plugins.git.opt.PreBuildMergeOptions;
import hudson.plugins.git.util.AncestryBuildChooser;
import hudson.plugins.git.util.BuildChooser;
import hudson.plugins.git.util.DefaultBuildChooser;
import hudson.scm.RepositoryBrowser;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.URIish;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
public class GitSCMUnitTest {
private final String gitDir = ".";
private final GitSCM gitSCM = new GitSCM(gitDir);
private final String repoURL = "https://github.com/jenkinsci/git-plugin";
public GitSCMUnitTest() {
}
@Test
public void testGetSubmoduleCfg() {
Collection<SubmoduleConfig> emptySubmoduleConfigList = new ArrayList<>();
assertThat(gitSCM.getSubmoduleCfg(), is(emptySubmoduleConfigList));
}
@Test
public void testSetSubmoduleCfg() {
Collection<SubmoduleConfig> submoduleConfigList = new ArrayList<>();
SubmoduleConfig config = new SubmoduleConfig();
submoduleConfigList.add(config);
gitSCM.setSubmoduleCfg(submoduleConfigList);
assertThat(gitSCM.getSubmoduleCfg(), is(submoduleConfigList));
}
@Test
public void testCreateRepoList() {
String name = null;
String refspec = null;
String credentialsId = null;
List<UserRemoteConfig> expectedRemoteConfigList = new ArrayList<>();
UserRemoteConfig remoteConfig = new UserRemoteConfig(repoURL, name, refspec, credentialsId);
expectedRemoteConfigList.add(remoteConfig);
List<UserRemoteConfig> remoteConfigList = GitSCM.createRepoList(repoURL, credentialsId);
assertUserRemoteConfigListEquals(remoteConfigList, expectedRemoteConfigList);
}
private void assertUserRemoteConfigListEquals(List<UserRemoteConfig> remoteConfigList, List<UserRemoteConfig> expectedRemoteConfigList) {
/* UserRemoteConfig lacks an equals method - ugh */
assertThat(remoteConfigList.toString(), is(expectedRemoteConfigList.toString()));
assertThat(remoteConfigList.get(0).getUrl(), is(expectedRemoteConfigList.get(0).getUrl()));
assertThat(remoteConfigList.get(0).getName(), is(expectedRemoteConfigList.get(0).getName()));
assertThat(remoteConfigList.get(0).getRefspec(), is(expectedRemoteConfigList.get(0).getRefspec()));
assertThat(remoteConfigList.get(0).getCredentialsId(), is(expectedRemoteConfigList.get(0).getCredentialsId()));
assertThat(remoteConfigList.size(), is(1));
}
@Test
public void testGetBrowser() {
assertThat(gitSCM.getBrowser(), is(nullValue()));
}
@Test
public void testSetBrowser() {
GitRepositoryBrowser browser = new GithubWeb(repoURL);
gitSCM.setBrowser(browser);
assertThat(gitSCM.getBrowser(), is(browser));
}
@Test
public void testGuessBrowser() {
/* Well tested in other classes */
RepositoryBrowser result = gitSCM.guessBrowser();
assertThat(result, is(nullValue()));
}
@Test
public void testGetBuildChooser() {
assertThat(gitSCM.getBuildChooser(), is(instanceOf(DefaultBuildChooser.class)));
}
@Test
public void testSetBuildChooser() throws Exception {
BuildChooser ancestryBuildChooser = new AncestryBuildChooser(1, "string");
gitSCM.setBuildChooser(ancestryBuildChooser);
assertThat(gitSCM.getBuildChooser(), is(ancestryBuildChooser));
}
@Test
public void testSetBuildChooserDefault() throws Exception {
BuildChooser ancestryBuildChooser = new AncestryBuildChooser(1, "string");
gitSCM.setBuildChooser(ancestryBuildChooser);
BuildChooser defaultBuildChooser = new DefaultBuildChooser();
gitSCM.setBuildChooser(defaultBuildChooser);
assertThat(gitSCM.getBuildChooser(), is(instanceOf(DefaultBuildChooser.class)));
}
@Test
public void testGetRepositoryByName() throws Exception {
RemoteConfig expected = new RemoteConfig(new Config(), "origin");
expected.addURI(new URIish(gitDir));
assertRemoteConfigEquals(gitSCM.getRepositoryByName("origin"), expected);
}
private void assertRemoteConfigEquals(RemoteConfig remoteConfig, RemoteConfig expected) {
assertThat(remoteConfig.getName(), is(expected.getName()));
assertThat(remoteConfig.getURIs(), is(expected.getURIs()));
}
private void assertRemoteConfigListEquals(List<RemoteConfig> remoteConfigList, List<RemoteConfig> expectedList) {
int expectedIndex = 0;
for (RemoteConfig remoteConfig : remoteConfigList) {
assertRemoteConfigEquals(remoteConfig, expectedList.get(expectedIndex++));
}
}
@Test
public void testGetRepositoryByNameNoSuchName() {
assertThat(gitSCM.getRepositoryByName("no-such-name"), is(nullValue()));
}
@Test
public void testGetRepositoryByNameEmptyName() {
assertThat(gitSCM.getRepositoryByName(""), is(nullValue()));
}
@Test
public void testGetRepositoryByNameNullName() {
assertThat(gitSCM.getRepositoryByName(null), is(nullValue()));
}
@Test
public void testGetUserRemoteConfigs() {
String name = null;
String refspec = null;
String credentialsId = null;
List<UserRemoteConfig> expectedRemoteConfigList = new ArrayList<>();
UserRemoteConfig remoteConfig = new UserRemoteConfig(gitDir, name, refspec, credentialsId);
expectedRemoteConfigList.add(remoteConfig);
assertUserRemoteConfigListEquals(gitSCM.getUserRemoteConfigs(), expectedRemoteConfigList);
}
@Test
public void testGetRepositories() throws Exception {
List<RemoteConfig> expectedRemoteConfigList = new ArrayList<>();
RemoteConfig remoteConfig = new RemoteConfig(new Config(), "origin");
remoteConfig.addURI(new URIish(gitDir));
expectedRemoteConfigList.add(remoteConfig);
assertRemoteConfigListEquals(gitSCM.getRepositories(), expectedRemoteConfigList);
}
@Test
public void testDeriveLocalBranchName() {
assertThat(gitSCM.deriveLocalBranchName("origin/master"), is("master"));
assertThat(gitSCM.deriveLocalBranchName("master"), is("master"));
assertThat(gitSCM.deriveLocalBranchName("origin/feature/xyzzy"), is("feature/xyzzy"));
assertThat(gitSCM.deriveLocalBranchName("feature/xyzzy"), is("feature/xyzzy"));
}
@Test
public void testGetGitTool() {
assertThat(gitSCM.getGitTool(), is(nullValue()));
}
@Test
public void testGetParameterString() {
String original = "${A}/${B} ${A}/${C}";
EnvVars env = new EnvVars();
env.put("A", "A-value");
env.put("B", "B-value");
assertThat(GitSCM.getParameterString(original, env), is("A-value/B-value A-value/${C}"));
}
@Test
public void testRequiresWorkspaceForPolling() {
/* Assumes workspace is required */
assertTrue(gitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingSingleBranch() {
/* Force single-branch use case */
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("master")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertFalse(bigGitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingSingleBranchWithRemoteName() {
/* Force single-branch use case */
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("origin/master")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertFalse(bigGitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingSingleBranchWithWildcardRemoteName() {
/* Force single-branch use case */
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("*/master")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertFalse(bigGitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingSingleBranchWithWildcardSuffix() {
/* Force single-branch use case */
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("master*")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertTrue(bigGitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingMultiBranch() {
/* Multi-branch use case */
List<BranchSpec> branches = new ArrayList<>();
branches.add(new BranchSpec("master"));
branches.add(new BranchSpec("origin/master"));
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
branches,
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertTrue(bigGitSCM.requiresWorkspaceForPolling());
}
@Test
public void testRequiresWorkspaceForPollingEmptyBranchName() {
/* Multi-branch use case */
EnvVars env = new EnvVars();
env.put("A", "");
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("${A}")),
false, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertFalse(bigGitSCM.requiresWorkspaceForPolling(env));
}
@Test
public void testCreateChangeLogParser() {
assertThat(gitSCM.createChangeLogParser(), is(instanceOf(GitChangeLogParser.class)));
}
@Test
public void testIsDoGenerateSubmoduleConfigurations() {
assertFalse(gitSCM.isDoGenerateSubmoduleConfigurations());
}
@Test
public void testIsDoGenerateSubmoduleConfigurationsTrue() {
GitSCM bigGitSCM = new GitSCM(createRepoList(repoURL, null),
Collections.singletonList(new BranchSpec("master")),
true, Collections.<SubmoduleConfig>emptyList(),
null, null, Collections.<GitSCMExtension>emptyList());
assertTrue(bigGitSCM.isDoGenerateSubmoduleConfigurations());
}
@Test
public void testGetBranches() {
List<BranchSpec> expectedBranchList = new ArrayList<>();
expectedBranchList.add(new BranchSpec("**"));
assertBranchSpecListEquals(gitSCM.getBranches(), expectedBranchList);
}
private void assertBranchSpecListEquals(List<BranchSpec> branchList, List<BranchSpec> expectedBranchList) {
int expectedIndex = 0;
for (BranchSpec branchSpec : branchList) {
assertThat(branchSpec.getName(), is(expectedBranchList.get(expectedIndex++).getName()));
}
assertThat(branchList.size(), is(expectedBranchList.size()));
}
@Test
public void testGetKey() {
assertThat(gitSCM.getKey(), is("git " + gitDir));
}
@Test
@Deprecated
public void testGetMergeOptions() throws Exception {
PreBuildMergeOptions expectedMergeOptions = new PreBuildMergeOptions();
PreBuildMergeOptions mergeOptions = gitSCM.getMergeOptions();
assertThat(mergeOptions.getRemoteBranchName(), is(expectedMergeOptions.getRemoteBranchName()));
assertThat(mergeOptions.getMergeTarget(), is(expectedMergeOptions.getMergeTarget()));
}
}
| [
"mark.earl.waite@gmail.com"
] | mark.earl.waite@gmail.com |
bd482e8af87bd5f2c7905a3c5a5182cdb140ca99 | 96ddc113730d72b3c2db2c2125e7d40ca7bab48e | /app/src/main/java/com/startupnationgo/blooddonationapp/MainActivity.java | da2da52e8aba39fc74338dac98bb5e437a032069 | [] | no_license | muskan2408/BloodDonationApp | 5005cc9dfe8cab444a78748929b794643171efca | d0c00be707b8a2d976bdca886389793f0cdf369c | refs/heads/master | 2020-03-27T18:26:33.268223 | 2018-10-30T17:03:32 | 2018-10-30T17:03:32 | 146,922,490 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,288 | java | package com.startupnationgo.blooddonationapp;
import android.app.Dialog;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class MainActivity extends AppCompatActivity {
private FirebaseAuth mAuth;
private ActionBar toolbar;
private static final String TAG="MainActivity";
private static final int ERROR_DAILOG_REQUEST=9001;
BottomNavigationView bottomNavigationView;
private DatabaseReference mUserDatabse;
String mobile;
private FirebaseUser mCurrentUser;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAuth = FirebaseAuth.getInstance();
toolbar = getSupportActionBar();
mobile=getIntent().getStringExtra("mobile");
bottomNavigationView = findViewById(R.id.navigation);
// mUserDatabse= FirebaseDatabase.getInstance().getReference();
// mCurrentUser= FirebaseAuth.getInstance().getCurrentUser();
// String current_user_id=mCurrentUser.getUid();
// mUserDatabse.child("Users").child(current_user_id).child("mobile").setValue(mobile);
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) bottomNavigationView.getLayoutParams();
layoutParams.setBehavior(new BottomNavigationBehavior());
toolbar.setTitle("Maps");
if(isServiceOk()){
loadFragment(new MapsFragment());
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
Fragment fragment;
switch(item.getItemId()){
case R.id.navigation_maps:
// Toast.makeText(MainActivity.this, "Hello profile", Toast.LENGTH_SHORT).show();
toolbar.setTitle("Maps");
fragment = new MapsFragment();
loadFragment(fragment);
return true;
// Toast.makeText(MainActivity.this, "Hello QR", Toast.LENGTH_SHORT).show();
case R.id.navigation_request_Blood:
// Toast.makeText(MainActivity.this, "Hello Maps", Toast.LENGTH_SHORT).show();
toolbar.setTitle("Request Blood");
fragment = new RequestFragment();
loadFragment(fragment);
return true;
case R.id.navigation_history:
toolbar.setTitle("Donation History");
fragment = new DonationHistoryFragment();
loadFragment(fragment);
return true;
}
return false;
}
});
}
}
@Override
public void onBackPressed() {
int count=getSupportFragmentManager().getBackStackEntryCount();
if(count==0)
{
super.onBackPressed();
}
else{
getSupportFragmentManager().popBackStack();
}
}
private void loadFragment(Fragment fragment) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
Bundle bundle=new Bundle();
bundle.putString("mobile",mobile);
// set Fragmentclass Arguments
NotificationFragment fragobj = new NotificationFragment();
RequestFragment req = new RequestFragment();
DonationHistoryFragment donate=new DonationHistoryFragment();
req.setArguments(bundle);
donate.setArguments(bundle);
fragobj.setArguments(bundle);
transaction.replace(R.id.frame_container, fragment);
transaction.addToBackStack(null);
transaction.commit();
}
// @Override
// public void onStart() {
// super.onStart();
// // Check if user is signed in (non-null) and update UI accordingly.
// FirebaseUser currentUser = mAuth.getCurrentUser();
// if(currentUser==null)
// {
// Intent startIntent=new Intent(MainActivity.this, LoginActivity.class) ;
// startActivity(startIntent);
// finish();
// }
// }
public boolean isServiceOk()
{
Log.d(TAG,"isServiceOk: checking google services version");
int available= GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this);
if(available== ConnectionResult.SUCCESS)
{
//everything is fine
Log.d(TAG,"Google play services working properly");
return true;
}
else
{
if(GoogleApiAvailability.getInstance().isUserResolvableError(available)){
Log.d(TAG,"isServiceOk: an error occured but we can fix it");
Dialog dialog=GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this,available,ERROR_DAILOG_REQUEST);
dialog.show();
}
else
{
Toast.makeText(MainActivity.this, "You can't connect to internet", Toast.LENGTH_SHORT).show();
}
return false;
}
}
} | [
"muskankataria2408@gmail.com"
] | muskankataria2408@gmail.com |
1ed62971130e045be7381e4458d28732a7d7e371 | 08750710867a39f741eef1112c0952a38270fba1 | /src/com/epam/task/module4/theSimplestClassesAndObjects/task9/comparator/ComparatorByAuthor.java | 57ed7fea1c8a73155bb803321ab4bbf80fa42600 | [] | no_license | DzmitryTysevich/epam | 834ee579f4e92354a6d1bb0efa3e551b0fddea24 | 849b407f80265540c73a7a0115770811caddb626 | refs/heads/master | 2023-01-28T03:05:41.089680 | 2020-12-09T11:29:04 | 2020-12-09T11:29:04 | 304,849,489 | 3 | 0 | null | 2020-12-09T11:29:05 | 2020-10-17T10:10:03 | Java | UTF-8 | Java | false | false | 372 | java | package com.epam.task.module4.theSimplestClassesAndObjects.task9.comparator;
import com.epam.task.module4.theSimplestClassesAndObjects.task9.Book;
import java.util.Comparator;
public class ComparatorByAuthor implements Comparator<Book> {
@Override
public int compare(Book left, Book right) {
return left.getAuthor().compareTo(right.getAuthor());
}
} | [
"dztysevich@gmail.com"
] | dztysevich@gmail.com |
2d0803ea328d928ed4fcf2e5df1c8a09a74e01b6 | 370b3d633e131a78d7912184a2d764cb811c8bfe | /src/test/java/com/mimbus/security/jwt/JWTFilterTest.java | 20b8b330c8342d5b65b091006a5f8c2aebf3d72a | [] | no_license | jacoracle/nimbus | f65e7de8154f6412537417b490aae351bde634d2 | f34e702a361afdf4ae1e8f817a08bfaee02f0bc5 | refs/heads/master | 2022-12-22T15:55:02.805061 | 2019-11-07T20:40:15 | 2019-11-07T20:40:15 | 220,321,799 | 0 | 0 | null | 2022-12-16T04:40:56 | 2019-11-07T20:18:26 | Java | UTF-8 | Java | false | false | 5,504 | java | package com.mimbus.security.jwt;
import com.mimbus.security.AuthoritiesConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
public class JWTFilterTest {
private TokenProvider tokenProvider;
private JWTFilter jwtFilter;
@BeforeEach
public void setup() {
JHipsterProperties jHipsterProperties = new JHipsterProperties();
tokenProvider = new TokenProvider(jHipsterProperties);
ReflectionTestUtils.setField(tokenProvider, "key",
Keys.hmacShaKeyFor(Decoders.BASE64
.decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8")));
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000);
jwtFilter = new JWTFilter(tokenProvider);
SecurityContextHolder.getContext().setAuthentication(null);
}
@Test
public void testJWTFilter() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user");
assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials().toString()).isEqualTo(jwt);
}
@Test
public void testJWTFilterInvalidToken() throws Exception {
String jwt = "wrong_jwt";
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingAuthorization() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingToken() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer ");
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterWrongScheme() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Basic " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
}
| [
"root@MacBook-Air-de-Apple.local"
] | root@MacBook-Air-de-Apple.local |
2474c70492b8067d0817cca578209922940688ac | 462ed1ad58fa8a9f06949925ae21e5172ade8e1c | /app/src/main/java/com/example/marwe497/passwordstrengthmeter/AbstractPasswordAlgoritm.java | dabd145818b3b9ce708c999e0432d1d53881dcb5 | [] | no_license | MakkeW/PasswordStrengthMeter | fbcc6b183e62073e55c42ed1a3ef05b50093944f | 9c08e45154615e416ff84b754069e752ad21e879 | refs/heads/master | 2022-12-13T19:49:56.196976 | 2018-12-18T08:35:40 | 2018-12-18T08:35:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 397 | java | package com.example.marwe497.passwordstrengthmeter;
public abstract class AbstractPasswordAlgoritm {
/**
* Returns the strength of the passord
* @param password
* the password
* @return
* the strength of the password
*/
public abstract int getStrength(String password);
public static final int MAXVALUE= 100;
public static final int MINVALUE = 0;
}
| [
"marwe497@student.liu.se"
] | marwe497@student.liu.se |
11246b7c9e80f1ab95b8b2fd3d144b5eeec93b18 | f405aea853755e45d50bd7f100690c729f5a5dbe | /src/main/java/domain/db/Reviews.java | 02b7caf2518791521adaa0091b460da12ff9b8cf | [] | no_license | alsvid/reviewservice | a4de3445478b798a9e8459c1dab31be73fb5ce90 | 37a5a5ab6a04e991e1e6eebefe5c6888cefe8d62 | refs/heads/master | 2021-08-30T10:13:58.974955 | 2017-12-17T12:52:58 | 2017-12-17T12:52:58 | 114,497,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java | package domain.db;
import java.util.ArrayList;
import domain.model.Address;
import domain.model.Review;
public class Reviews {
//random comment for pushing purposes
private static Reviews instance = null;
private ArrayList<Review> reviewlist = new ArrayList<Review>();
protected Reviews() {
Review rv1 = new Review("Mr Anderson",3,"Not too bad", new Address("Best Hotel","Leuven","Vlaams-Brabant", "Belgium", "3000", "Brusselsestraat", "15"));
reviewlist.add(rv1);
}
public static Reviews getInstance() {
if (instance == null) {
instance = new Reviews();
}
return instance;
}
public void addReview(Review d) {
if (d == null) throw new IllegalArgumentException("Destination cannot be null");
reviewlist.add(d);
}
public void removeReview(Review d) {
if (d == null) throw new IllegalArgumentException("Destination cannot be null");
for(Review e : reviewlist) {
if (e.equals(d)) {
reviewlist.remove(e);
}
}
}
public ArrayList<Review> getReviewsForDestinationWithName(String name) {
if (name == null || name.trim().isEmpty()) {
throw new IllegalArgumentException();
}
ArrayList<Review> reviewsforname = new ArrayList<Review>();
for (Review e : reviewlist) {
if (e.getLocation().getName().trim().toLowerCase().replaceAll("\\s", "").equals(name.trim().toLowerCase().replaceAll("\\s", ""))) {
reviewsforname.add(e);
}
}
return reviewsforname;
}
}
| [
"alsvid.git@hotmail.com"
] | alsvid.git@hotmail.com |
ca54b2f7913dbfe2db0cc9aa79054ead1fc17407 | 168b81afbbe10e6812ab246492bdfc1232ee2095 | /src/main/java/com/example/demo/hateoas/assemblers/UserDTOModelAssembler.java | 0fde4bf51ab22dfbc822937ac229158eec875e07 | [
"MIT"
] | permissive | shalamike/to-do-app-project | 3cf034bd40e548d112cd28f8ef09a7c5cd8c42d0 | 43fc07df1965a358de8c15ed2f78d3c8691b6a48 | refs/heads/master | 2023-03-26T12:48:53.162912 | 2021-03-22T16:40:07 | 2021-03-22T16:40:07 | 346,687,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package com.example.demo.hateoas.assemblers;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.EntityModel;
import org.springframework.hateoas.server.RepresentationModelAssembler;
import org.springframework.stereotype.Component;
import com.example.demo.DTO.UserDTO;
import com.example.demo.controllers.UserController;
import com.example.demo.mappers.UserMapper;
@Component
public class UserDTOModelAssembler implements RepresentationModelAssembler<UserDTO, EntityModel<UserDTO>> {
private UserMapper userMapper;
@Autowired
public UserDTOModelAssembler(UserMapper userMapper) {
this.userMapper = userMapper;
}
@Override
public EntityModel<UserDTO> toModel(UserDTO entity) {
EntityModel<UserDTO> entityModel = EntityModel.of(entity,
linkTo(methodOn(UserController.class).getUserById(entity.getUserId())).withSelfRel(),
linkTo(methodOn(UserController.class).getAllUsers()).withRel("users")
);
return entityModel;
}
}
| [
"mshala02@dcs.bbk.ac.uk"
] | mshala02@dcs.bbk.ac.uk |
4e2ac264dc324e973163f64623e451a856253a8d | 0a1b1d2c2b32bdee5f4a9cd9d07cf2ebd3319046 | /src/main/java/ru/ivmiit/servlets/ServletCalc.java | 3bef6aeb11871693708e477b1613b2e789d97262 | [] | no_license | alinakuz1/JavaServletT | 8f3ee8d4c10ff8c54db21398c73c0b13a73c95ae | 4eb8642dfd99b7f71c2cefdad628dcf3b48a585d | refs/heads/master | 2020-05-01T16:29:27.332555 | 2019-01-30T15:32:42 | 2019-01-30T15:32:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | package ru.ivmiit.servlets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
public class ServletCalc extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//принимаем из командной строки параметры
String firstArgAsStr=request.getParameter("first");
String secondArgAsStr=request.getParameter("second");
//переводим их из стринга в нужный формат
int firstArg=Integer.parseInt(firstArgAsStr);
int secondArg=Integer.parseInt(secondArgAsStr);
//можно вычислить что нибудь с использованием этих параметров
double result=(firstArg*3.14242)+(secondArg-1);
//выводим результат в виде строки в браузере
PrintWriter writer = response.getWriter();
writer.write("Result:"+result);
}
}
| [
"mr.snow3@yandex.ru"
] | mr.snow3@yandex.ru |
a9a8d23baddbbb09f6528d78937603b0d236708a | c8244a645263b734ab19e8c2f7a729dc43a8156c | /app/src/androidTest/java/com/example/limxiang/login_register/ApplicationTest.java | caa207a9bf34e0dc67d30e7849e8179bc05a9eb2 | [] | no_license | lhx2499/rehab | a449919d07a1e210a168d63819dfb494fa9c486d | 8dea22d7034fd6a4b1813baa1bb75253599c36eb | refs/heads/master | 2020-12-21T21:52:27.553995 | 2016-08-04T13:19:25 | 2016-08-04T13:19:25 | 64,936,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 366 | java | package com.example.limxiang.login_register;
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);
}
} | [
"xiang_lim@hotmal.com"
] | xiang_lim@hotmal.com |
f3a568684ecbbc070ff44ece03b37538ebdc10f1 | 2440141fd96777448165e1227f47a25a9eb68e32 | /src/controller/ExitAction.java | 98c644c1f0f94bda1e99290e826a95366bedfe58 | [] | no_license | KsushaPerepechina/train_schedule | 848eec98eb7a2c32cf2cf4f228db674af420d36a | 90632f6baa2dd85c3a8b83fecb6604bac9c5c3a5 | refs/heads/master | 2020-03-20T02:07:00.327079 | 2018-06-12T16:35:15 | 2018-06-12T16:35:15 | 137,099,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package controller;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class ExitAction implements ActionListener {
public void actionPerformed(ActionEvent event) {
System.exit(0);
}
}; | [
"ksusha.perepechina@gmail.com"
] | ksusha.perepechina@gmail.com |
ada3a196994b8ff51bae31aa71294b02af32a40a | edfc5d6d0616faa147038ec2b11b6a6788073caa | /src/main/java/net/mrscauthd/boss_tools/gui/Tier2mainMenu2GuiWindow.java | 9e85c07d5b98fbe979a59608172c103a5b3ceb9c | [] | no_license | SeagullBoii/Space-Bosstools-old- | a4049e922d7d1e0a6fa76dfa759b49f039b075bb | f5ebe2240054b5c6307d2e7f3f04f7d5409a6672 | refs/heads/master | 2023-07-13T01:00:19.562798 | 2021-07-27T11:25:36 | 2021-07-27T11:25:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,114 | java |
package net.mrscauthd.boss_tools.gui;
import net.mrscauthd.boss_tools.BossToolsMod;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.world.World;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.Minecraft;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.matrix.MatrixStack;
@OnlyIn(Dist.CLIENT)
public class Tier2mainMenu2GuiWindow extends ContainerScreen<Tier2mainMenu2Gui.GuiContainerMod> {
private World world;
private int x, y, z;
private PlayerEntity entity;
public Tier2mainMenu2GuiWindow(Tier2mainMenu2Gui.GuiContainerMod container, PlayerInventory inventory, ITextComponent text) {
super(container, inventory, text);
this.world = container.world;
this.x = container.x;
this.y = container.y;
this.z = container.z;
this.entity = container.entity;
this.xSize = 512;
this.ySize = 512;
}
@Override
public void render(MatrixStack ms, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(ms);
super.render(ms, mouseX, mouseY, partialTicks);
this.renderHoveredTooltip(ms, mouseX, mouseY);
}
@Override
protected void drawGuiContainerBackgroundLayer(MatrixStack ms, float partialTicks, int gx, int gy) {
RenderSystem.color4f(1, 1, 1, 1);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
int Width = Minecraft.getInstance().getMainWindow().getScaledWidth();
int Heigh = Minecraft.getInstance().getMainWindow().getScaledHeight();
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/rocket_menu_background.png"));
this.blit(ms, 0, 0, 0, 0, Width, Heigh, Width, Heigh);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/milky_way.png"));
this.blit(ms, this.guiLeft + 278, this.guiTop + 223, 0, 0, 175, 101, 175, 101);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/sun_main_menu.png"));
this.blit(ms, this.guiLeft + 362, this.guiTop + 270, 0, 0, 8, 8, 8, 8);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/earth_main_menu.png"));
this.blit(ms, this.guiLeft + 328, this.guiTop + 254, 0, 0, 8, 8, 8, 8);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/mars_main_menu.png"));
this.blit(ms, this.guiLeft + 398, this.guiTop + 239, 0, 0, 8, 8, 8, 8);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/mercury.png"));
this.blit(ms, this.guiLeft + 377, this.guiTop + 278, 0, 0, 8, 8, 8, 8);
Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("boss_tools:textures/rocket_menu_list2.png"));
this.blit(ms, this.guiLeft + 43, this.guiTop + 174, 0, 0, 260, 160, 260, 160);
RenderSystem.disableBlend();
}
@Override
public boolean keyPressed(int key, int b, int c) {
if (key == 256) {
this.minecraft.player.closeScreen();
return true;
}
return super.keyPressed(key, b, c);
}
@Override
public void tick() {
super.tick();
}
@Override
protected void drawGuiContainerForegroundLayer(MatrixStack ms, int mouseX, int mouseY) {
this.font.drawString(ms, "CATALOG", 65, 191, -1);
}
@Override
public void onClose() {
super.onClose();
Minecraft.getInstance().keyboardListener.enableRepeatEvents(false);
}
@Override
public void init(Minecraft minecraft, int width, int height) {
super.init(minecraft, width, height);
minecraft.keyboardListener.enableRepeatEvents(true);
this.addButton(new Button(this.guiLeft + 51, this.guiTop + 223, 70, 20, new StringTextComponent("Back"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(0, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 0, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 51, this.guiTop + 246, 70, 20, new StringTextComponent("Overworld"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(1, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 1, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 51, this.guiTop + 269, 70, 20, new StringTextComponent("Moon"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(2, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 2, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 126, this.guiTop + 246, 37, 20, new StringTextComponent("Orbit"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(3, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 3, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 126, this.guiTop + 269, 37, 20, new StringTextComponent("Orbit"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(4, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 4, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 168, this.guiTop + 269, 75, 20, new StringTextComponent("Space Station"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(5, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 5, x, y, z);
}
}));
this.addButton(new Button(this.guiLeft + 168, this.guiTop + 246, 75, 20, new StringTextComponent("Space Station"), e -> {
if (true) {
BossToolsMod.PACKET_HANDLER.sendToServer(new Tier2mainMenu2Gui.ButtonPressedMessage(6, x, y, z));
Tier2mainMenu2Gui.handleButtonAction(entity, 6, x, y, z);
}
}));
}
}
| [
"77861350+Luli252@users.noreply.github.com"
] | 77861350+Luli252@users.noreply.github.com |
c908132a45a108eade5dabf8657f9e94f95c034b | 39c3690de47466a75709ef14806595c2eeef7169 | /src/main/java/com/liudi/game/SnowField.java | 5adfb4f256d4b562581308f1969b3e4d952541ea | [] | no_license | DiJester/tank-war | f5d4319e776de302bfab9438cfb1df4c56565653 | fe5232e376a3de55e9c1f9765772a19fa4b96f11 | refs/heads/main | 2022-12-25T08:43:32.791505 | 2020-10-04T08:54:11 | 2020-10-04T08:54:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package main.java.com.liudi.game;
import java.awt.*;
public class SnowField extends Terrain{
public SnowField(int x, int y) {
super(x, y);
image = ResourceManager.snowfield;
setDimension(image.getWidth(),image.getHeight());
rect = new Rectangle(this.x,this.y,image.getWidth(),image.getHeight());
}
}
| [
"992748712@qq.com"
] | 992748712@qq.com |
a44406d961c31614123f52d0157c7256c9072740 | 2f8ab5dc2d138224731668ab7222a239f2eceab0 | /screenadapter/src/main/java/com/xforg/screenadapter/utils/ScreenUtils.java | e18fa375c710a1e6f9e98d1bd08441fe5fca6534 | [] | no_license | xianfeng92/AndroidScreenAdapter | e43cc776acaae4a83ba3b0dba66e6ead3bb84a34 | fd095f4c79c2a6d3e40ea577c97028082638d6d0 | refs/heads/master | 2020-05-05T09:42:09.512715 | 2019-04-07T03:24:11 | 2019-04-07T03:24:11 | 179,912,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,491 | java | package com.xforg.screenadapter.utils;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Build;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
/**
* Created By zhongxianfeng on 19-2-15
* github: https://github.com/xianfeng92
*/
public class ScreenUtils {
private ScreenUtils() {
throw new IllegalStateException("you can't instantiate me!");
}
public static int getStatusBarHeight() {
int result = 0;
try {
int resourceId = Resources.getSystem().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = Resources.getSystem().getDimensionPixelSize(resourceId);
}
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
return result;
}
/**
* 获取当前的屏幕尺寸
*
* @param context {@link Context}
* @return 屏幕尺寸
*/
public static int[] getScreenSize(Context context) {
int[] size = new int[2];
WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display d = w.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
d.getMetrics(metrics);
size[0] = metrics.widthPixels;
size[1] = metrics.heightPixels;
return size;
}
/**
* 获取原始的屏幕尺寸
*
* @param context {@link Context}
* @return 屏幕尺寸
*/
public static int[] getRawScreenSize(Context context) {
int[] size = new int[2];
WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display d = w.getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
d.getMetrics(metrics);
// since SDK_INT = 1;
int widthPixels = metrics.widthPixels;
int heightPixels = metrics.heightPixels;
// includes window decorations (statusbar bar/menu bar)
if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 17)
try {
widthPixels = (Integer) Display.class.getMethod("getRawWidth").invoke(d);
heightPixels = (Integer) Display.class.getMethod("getRawHeight").invoke(d);
} catch (Exception ignored) {
}
// includes window decorations (statusbar bar/menu bar)
if (Build.VERSION.SDK_INT >= 17)
try {
Point realSize = new Point();
Display.class.getMethod("getRealSize", Point.class).invoke(d, realSize);
widthPixels = realSize.x;
heightPixels = realSize.y;
} catch (Exception ignored) {
}
size[0] = widthPixels;
size[1] = heightPixels;
return size;
}
public static int getHeightOfNavigationBar(Context context) {
//如果小米手机开启了全面屏手势隐藏了导航栏则返回 0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (Settings.Global.getInt(context.getContentResolver(), "force_fsg_nav_bar", 0) != 0) {
return 0;
}
}
int realHeight = getRawScreenSize(context)[1];
int displayHeight = getScreenSize(context)[1];
return realHeight - displayHeight;
}
}
| [
"oppoa1001@hotmail.com"
] | oppoa1001@hotmail.com |
e634f31764cbab23b7b904bd3c165748e2c807d0 | 74d2705d91e9313ac5be48f9d73887f64da52f6a | /src/main/java/designPatterns/creational/builder/com/one/BankAccount.java | d9444e93789869caf60dc57321b14096a3bb1dfc | [] | no_license | prashant146/datastructuresalgorithms | 733b06ee8f33bbea450ef145cdbdd66f1e95c918 | ad5b85867091fc6dfc1b7b31b311519a503346f8 | refs/heads/master | 2021-05-12T11:02:52.444096 | 2020-09-02T15:19:35 | 2020-09-02T15:19:35 | 117,377,419 | 0 | 0 | null | 2020-10-14T00:22:40 | 2018-01-13T20:52:21 | Java | UTF-8 | Java | false | false | 2,124 | java | package designPatterns.behavioural.stateDesign.creational.builder.com.one;
public class BankAccount {
private BankAccount(){
}
private String name;
private String accountNumber;
private String email;
private boolean newsLetters;
@Override
public String toString() {
return "BankAccount{" +
"name='" + name + '\'' +
", accountNumber='" + accountNumber + '\'' +
", email='" + email + '\'' +
", newsLetters=" + newsLetters +
'}';
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public boolean isNewsLetters() {
return newsLetters;
}
public void setNewsLetters(boolean newsLetters) {
this.newsLetters = newsLetters;
}
public static class BankAccountBuilder{
private String name;
private String accountNumber;
private String email;
private boolean newsLetters;
public BankAccountBuilder(String name, String accountNumber){
this.name=name;
this.accountNumber=accountNumber;
}
public BankAccountBuilder withEmail(String email){
this.email=email;
return this;
}
public BankAccountBuilder wantNewsLetters(boolean newsLetters){
this.newsLetters = newsLetters;
return this;
}
public BankAccount build(){
BankAccount bankAccount = new BankAccount();
bankAccount.accountNumber = this.accountNumber;
bankAccount.email=this.email;
bankAccount.name=this.name;
bankAccount.newsLetters=this.newsLetters;
return bankAccount;
}
}
}
| [
"prashant146"
] | prashant146 |
135fc82beecd39922c39990f51af823a4bbcbccf | 539ba72723c7a387452f25f1d0c15e41e4713310 | /src/sms/updateLecture.java | 77ab9bc8061debd508ccd820d388d898c4c02c30 | [] | no_license | smwape/sms | 613f4f84aae7d47d76414e59f384c7a031ad0835 | 8225b7904aa69b880a543d187c2e8e49466cf4eb | refs/heads/master | 2023-08-02T02:01:13.929236 | 2021-10-07T14:34:42 | 2021-10-07T14:34:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,363 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sms;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Stan
*/
public class updateLecture extends javax.swing.JFrame {
Connection conn = null;
PreparedStatement stmt = null;
DefaultTableModel tblModel = null;
/**
* Creates new form updateLecture
*/
public updateLecture() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jPanel1 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
mname = new javax.swing.JTextField();
dob = new javax.swing.JTextField();
lname = new javax.swing.JTextField();
fname = new javax.swing.JTextField();
gender = new javax.swing.JComboBox<>();
jLabel11 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
back = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
email = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
country = new javax.swing.JTextField();
phone = new javax.swing.JTextField();
submit = new javax.swing.JButton();
jLabel10 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
zip = new javax.swing.JTextField();
city = new javax.swing.JTextField();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
lib = new javax.swing.JMenuItem();
lecturers = new javax.swing.JMenuItem();
stud_infor = new javax.swing.JMenuItem();
portal = new javax.swing.JMenu();
jMenu5 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel3.setText("Middle Name:");
jLabel4.setText("Surname:");
jLabel5.setText("Gender:");
gender.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Select One", "Female", "Male", "Other" }));
gender.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
genderActionPerformed(evt);
}
});
jLabel11.setText("Date of Birth:");
jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("UPDATE VALUES");
jLabel7.setText("Name:");
jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 7));
jLabel1.setBackground(new java.awt.Color(255, 255, 255));
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
jLabel1.setText("WELOCME TO THE STAFF MEMBER PAGE");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(148, 148, 148)
.addComponent(jLabel1)
.addContainerGap(181, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addComponent(jLabel1)
.addContainerGap(55, Short.MAX_VALUE))
);
back.setText("BACK");
back.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
backActionPerformed(evt);
}
});
jLabel8.setText("Phone Number:");
jLabel9.setText("Email Address:");
jLabel13.setText("Country:");
submit.setText("SUBMIT");
submit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
submitActionPerformed(evt);
}
});
jLabel10.setText("CITY:");
jLabel14.setText("ZIP:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(back)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 51, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(submit, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(jLabel3)
.addComponent(jLabel7)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel11)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addComponent(jLabel13))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(178, 178, 178)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(mname, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fname, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lname, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(dob, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(127, 127, 127)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(email, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(country, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(178, 178, 178)
.addComponent(phone, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(gender, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(178, 178, 178)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(city, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(zip, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE))))))
.addGap(230, 230, 230))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(398, 398, 398))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(back)
.addGap(8, 8, 8)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37)
.addComponent(jLabel2)
.addGap(56, 56, 56)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(mname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(gender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(dob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(phone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(country, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13))
.addGap(36, 36, 36)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(city, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(zip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(jLabel14)))
.addGap(18, 18, 18)
.addComponent(submit)
.addContainerGap(70, Short.MAX_VALUE))
);
jScrollPane1.setViewportView(jPanel1);
jMenu1.setText("INSTITUTION");
jMenu1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenu1ActionPerformed(evt);
}
});
lib.setText("LIBRARY");
lib.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
libActionPerformed(evt);
}
});
jMenu1.add(lib);
lecturers.setText("LECTURERS");
lecturers.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lecturersMouseClicked(evt);
}
});
lecturers.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lecturersActionPerformed(evt);
}
});
jMenu1.add(lecturers);
stud_infor.setText("STUDENT INFORMATION");
stud_infor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
stud_inforMouseClicked(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
stud_inforMousePressed(evt);
}
});
stud_infor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
stud_inforActionPerformed(evt);
}
});
jMenu1.add(stud_infor);
jMenuBar1.add(jMenu1);
portal.setText("STUDENT PORTAL");
portal.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
portal.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
portalMouseClicked(evt);
}
});
portal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
portalActionPerformed(evt);
}
});
jMenuBar1.add(portal);
jMenu5.setText("E-LEARNING");
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 860, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 822, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void libActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_libActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_libActionPerformed
private void lecturersMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lecturersMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_lecturersMouseClicked
private void lecturersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lecturersActionPerformed
// TODO add your handling code here:
staff_login obj = new staff_login();
obj.setVisible(true);
dispose();
}//GEN-LAST:event_lecturersActionPerformed
private void stud_inforMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_stud_inforMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_stud_inforMouseClicked
private void stud_inforMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_stud_inforMousePressed
}//GEN-LAST:event_stud_inforMousePressed
private void stud_inforActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stud_inforActionPerformed
// TODO add your handling code here:
String url = "jdbc:mysql://localhost:3306/sms";
String un = "root";
String pas = "root";
try {
conn = DriverManager.getConnection(url, un, pas);
} catch (SQLException ex) {
Logger.getLogger(updateLecture.class.getName()).log(Level.SEVERE, null, ex);
}
studentDetails details = new studentDetails();
details.setVisible(true);
dispose();
}//GEN-LAST:event_stud_inforActionPerformed
private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMenu1ActionPerformed
private void portalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_portalMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_portalMouseClicked
private void portalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_portalActionPerformed
// TODO add your handling code here:
studentPortal obj = new studentPortal();
obj.setVisible(true);
dispose();
}//GEN-LAST:event_portalActionPerformed
private void genderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genderActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_genderActionPerformed
private void backActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backActionPerformed
// TODO add your handling code here:
staff_page obj = new staff_page();
obj.setVisible(true);
dispose();
}//GEN-LAST:event_backActionPerformed
private void submitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitActionPerformed
// TODO add your handling code here:
try{
String url = "jdbc:mysql://localhost:3306/sms";
String un = "root";
String pas = "root";
String query = "INSERT INTO register VALUES(?,?,?,?,?,?,?,?,?,?)";
conn = DriverManager.getConnection(url, un, pas);
stmt = conn.prepareStatement(query);
stmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Sumbmitted Successfully");
new createUser().setVisible(true);
dispose();
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_submitActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(updateLecture.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(updateLecture.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(updateLecture.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(updateLecture.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new updateLecture().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton back;
private javax.swing.JTextField city;
private javax.swing.JTextField country;
private javax.swing.JTextField dob;
private javax.swing.JTextField email;
private javax.swing.JTextField fname;
private javax.swing.JComboBox<String> gender;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JMenuItem lecturers;
private javax.swing.JMenuItem lib;
private javax.swing.JTextField lname;
private javax.swing.JTextField mname;
private javax.swing.JTextField phone;
private javax.swing.JMenu portal;
private javax.swing.JMenuItem stud_infor;
private javax.swing.JButton submit;
private javax.swing.JTextField zip;
// End of variables declaration//GEN-END:variables
}
| [
"stanlycheezy@gmail.com"
] | stanlycheezy@gmail.com |
a7f4e280832f63040e7b40c73c7fbd6cd70c4793 | 6c6196a3eb8680e26b3eaf987c029e30addd81c0 | /app/src/main/java/lorteam/mobilelor/HomeIssuerActivity.java | 7e049d11d625409e2a17c4194f2b90cb6ca48672 | [] | no_license | yassabdulrhman/Mobile-LOR | d607424c86762e184c8e266c7e52fd3722e76b13 | d29892c663b81bb3d64c7fc7344b377715b960bc | refs/heads/master | 2022-02-25T23:23:18.431848 | 2019-10-07T09:15:55 | 2019-10-07T09:15:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,871 | java | package lorteam.mobilelor;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
public class HomeIssuerActivity extends AppCompatActivity {
FirebaseAuth firebaseAuth;
DatabaseReference databaseReference ;
Button profile , req, listR, contactus ;
ImageView imageLogout , home;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_issuer);
Toolbar toolbar=(Toolbar)findViewById(R.id.toolbarHeader);
setSupportActionBar(toolbar);
imageLogout=(ImageView)findViewById(R.id.imageLogOut);
home=(ImageView)findViewById(R.id.imageHome);
profile=(Button)findViewById(R.id.btn_profile_i);
listR=(Button)findViewById(R.id.btn_list_i);
contactus=(Button)findViewById(R.id.btn_contactus);
firebaseAuth=FirebaseAuth.getInstance();
home.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent h= new Intent(HomeIssuerActivity.this, HomeIssuerActivity.class);
startActivity(h);
}
});
profile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent p= new Intent(HomeIssuerActivity.this,profileIssuerActivity.class);
startActivity(p);
}
});
imageLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder1 = new AlertDialog.Builder(HomeIssuerActivity.this);
builder1.setMessage("Are you sure to logout ?");
builder1.setCancelable(true);
builder1.setPositiveButton(
"Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Alert
firebaseAuth.signOut();
Intent main = new Intent(HomeIssuerActivity.this,MainActivity.class);
startActivity(main);
dialog.cancel();
}
});
builder1.setNegativeButton(
"No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
});
listR.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent l= new Intent(HomeIssuerActivity.this,listIssActivity.class);
startActivity(l);
}
});
contactus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent c= new Intent(HomeIssuerActivity.this,contactusIActivity.class);
startActivity(c);
}
});
}
}
| [
"yaserabdulrahman@outlook.com"
] | yaserabdulrahman@outlook.com |
d0c327631b18ff122006432272a8a116c5178b74 | c972e352c56e87328fb7653baffa9b0f2c8f44c3 | /Medium/0008-String-to-Integer/Solution2.java | 7ff3111d71f9cf2cdd72ba89b29c3b7f466c7dfa | [] | no_license | Rivers-Shall/LeetCode-Java | 1f9d6be0411be5df90f733b96866758879b93da8 | 75cdfb9bc2557543cba968600739b0b6b4d76ef3 | refs/heads/master | 2020-06-02T14:02:44.686719 | 2020-04-28T01:40:33 | 2020-04-28T01:40:33 | 191,179,784 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | class Solution2 {
public int myAtoi(String str) {
if (str == null) return 0;
char[] charArray = str.toCharArray();
int index = 0;
while (index < charArray.length && charArray[index] == ' ') {
++index;
}
int sign = 1;
if (index < charArray.length && (charArray[index] == '-' || charArray[index] == '+')) {
if (charArray[index] == '-') {
sign = -1;
}
++index;
}
int result = 0;
while (index < charArray.length && Character.isDigit(charArray[index])) {
if (result > Integer.MAX_VALUE / 10 || (result == Integer.MAX_VALUE / 10 && charArray[index] - '0' > 7)) {
return (sign == 1) ? Integer.MAX_VALUE : Integer.MIN_VALUE;
}
result = result * 10 + (charArray[index] - '0');
++index;
}
return (int) (sign * result);
}
} | [
"rivers-shall@qq.com"
] | rivers-shall@qq.com |
2995a864e9324155777b758db784f43f04ddc9fb | d798871ad11562c2f982bd95b8bbfe22f3faeff2 | /player/media/PlaylistItem.java | 05d7729f2704c7b96555949f9fbf771932a2d6d5 | [] | no_license | ivand88/RoosterPlayer | 21ceb7adf497453fce4929f893658085ae3d03ae | ba6dd8a37fda1af7aed4cca7fd3e265226ab06b8 | refs/heads/master | 2020-03-14T08:24:19.073105 | 2018-04-29T20:13:00 | 2018-04-29T20:13:00 | 131,523,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,921 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package roosterplayer.player.media;
import java.io.File;
/**
*
* @author Ivan
*/
public class PlaylistItem {
private String fileName, filePath, fileExtension, type;
private File file;
/**
* @param file the file to set
*/
public PlaylistItem(File file){
this.file = file;
setFilePath(file.getAbsolutePath());
setFileName(file.getName());
setFileExtension();
}
/**
* @return the filePath
*/
public String getFilePath() {
return filePath;
}
/**
* @param filePath the filePath to set
*/
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/**
* @return the extension
*/
public String getFileExtension() {
return fileExtension;
}
/**
* @param
*/
public void setFileExtension() {
int i = fileName.lastIndexOf('.');
if (i > 0) {
this.fileExtension = fileName.substring(i+1);
}
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the file
*/
public File getFile() {
return file;
}
/**
* @param file the file to set
*/
public void setFile(File file) {
this.file = file;
}
/**
* @param fileName the fileName to set
*/
private void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* @return the fileName
*/
public String getFileName() {
return this.fileName;
}
}
| [
"ivan.dabovic88@yahoo.com"
] | ivan.dabovic88@yahoo.com |
e9b4a4e5f438fe49f817b3667ad3b28fc55947c7 | b7ad880c14ba5c149db7ce0fb41c3d2b9c723eac | /online-shoping/user-service/src/main/java/org/evoke/user/model/BaseResponse.java | bde11af7b19838ac1a34a9e8c7de6d99bfc6165f | [] | no_license | rnjava86/SpringMicroServices-Docker | 8ce309f843c93a3320142ecbec290d8ee39c8a25 | 38d0280bffc6703eb4780a3888182c2255b4b8f5 | refs/heads/master | 2020-04-06T14:25:35.791681 | 2018-11-13T07:30:52 | 2018-11-13T07:30:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package org.evoke.user.model;
import java.util.Map;
import org.evoke.user.web.error.ErrorMessage;
public class BaseResponse extends ErrorMessage{
/**
*
*/
private static final long serialVersionUID = 1L;
private Map<String,Object> response;
public Map<String, Object> getResponse() {
return response;
}
public void setResponse(Map<String, Object> response) {
this.response = response;
}
}
| [
"34542905+vvyasabhattu@users.noreply.github.com"
] | 34542905+vvyasabhattu@users.noreply.github.com |
d6c711cac9b5660c8c29e7423ae3ba171ce2b0c9 | 89321ea416dc5c2b405f9f331623bd5def28ce40 | /src/test/java/tdd/NumberNamesTest.java | a28d9fed775aab659c8e042b88ff0c716c161b53 | [] | no_license | DeenaAbdulZaher/tdd-class | edbb0357e825e4a6040c2736b2b464d8a1c5ba47 | 9882491e36afe4d1c02eb87a0e399bc33a850683 | refs/heads/master | 2021-01-24T20:01:17.875882 | 2013-11-17T09:34:01 | 2013-11-17T09:34:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tdd;
import org.hamcrest.Matcher;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import org.mockito.ArgumentMatcher;
/**
*
* @author Gamal Shaban OLC
*/
public class NumberNamesTest {
@Test
public void isReadingOneDigit() throws Exception {
assertThat("one", readNumber(1));
assertThat("nine", readNumber(9));
}
/*@Test
public void isReadingOneDigit2() throws Exception {
}*/
@Test
public void isReadingTwoDigits() throws Exception {
assertThat("twelve", readNumber(12));
}
@Test
public void isReadingThreeDigits() throws Exception {
assertThat("Three Hundred and forty five", readNumber(345));
}
@Test
public void isReadingSixDigits() throws Exception {
assertThat("forty three million, one hundred and twelve thousand, six hundred and three", readNumber(43112603));
}
private Matcher<String> readNumber(final Integer digit) {
return new ArgumentMatcher<String>() {
@Override
public boolean matches(Object argument) {
return NumberNames.read(digit).equalsIgnoreCase(argument.toString());
}
};
}
}
| [
"gemy21ce@gmail.com"
] | gemy21ce@gmail.com |
eb5b8d29f888b8c32a798740a0dd789d1daa75bb | 698cdc00a2fd5343f594e4a48888d0c41d884fb6 | /03_agenda_jpa_patron_dao/src/com/curso/controller/ContactosController.java | 958f5488e953819e39271161cf71dc92b55f6601 | [] | no_license | RamsayBoy/babelcamp5-backend | cda40cbdf268ea2cdb37c2e351024c11dc8d4d37 | 4d73a89c5ede4fca0b1e233bd5ac267c75511675 | refs/heads/master | 2022-04-17T04:26:53.064482 | 2020-03-25T11:20:30 | 2020-03-25T11:20:30 | null | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,334 | java | package com.curso.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.curso.model.Contacto;
import com.curso.service.ContactosService;
@Controller
public class ContactosController {
@Autowired
ContactosService service;
@GetMapping(value="/contactos")
public String recuperarContactos(HttpServletRequest request) {
List<Contacto> lista=service.recuperarContactos();
request.setAttribute("contactos", lista);
return "contactos";
}
@PostMapping(value="/alta")
public String altaContacto(@RequestParam("nombre") String nombre,
@RequestParam("email") String email,
@RequestParam("edad") int edad) {
Contacto contacto=new Contacto(edad,email,nombre);
service.altaContacto(contacto);
return "menu";
}
@GetMapping(value="/eliminar")
public String eliminarContacto(@RequestParam("idContacto") int idContacto) {
service.eliminarContacto(idContacto);
return "forward:/contactos"; //se pasa el control al método asociado a esa url
//return "contactos";
}
}
| [
"ajms66@gmail.com"
] | ajms66@gmail.com |
4e6717f7ca41ee67ba1c87d36e7fdd126f72d04f | f7c3ea89a17f76caa288a256b94a379a19b2b6a8 | /src/com/code/test/problemset/leetcode/Q79_MergeKSortedLists.java | 9db767463fcbb2f37df9597eaea8c890fbc66413 | [] | no_license | charlottetan/algorithms | 9603276e76e323450d5914b77bef9c473bb02b55 | 0b3ce59a6aa48c6d4f681deebd8fb6329d4ded50 | refs/heads/master | 2022-12-01T14:42:20.506914 | 2020-08-12T14:55:36 | 2020-08-12T14:55:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,502 | java | package com.code.test.problemset.leetcode;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
* Merge k Sorted Lists
* Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
* <p>
* Example:
* <p>
* Input:
* [
* 1->4->5,
* 1->3->4,
* 2->6
* ]
* Output: 1->1->2->3->4->4->5->6
* <p>
* https://leetcode.com/problems/merge-k-sorted-lists/
*/
public class Q79_MergeKSortedLists {
static class SolutionA {
static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
// O(M * N): m is number of arrays and N is max length of all arrays
public static ListNode mergeKSortedList(ListNode[] lists) {
if (lists == null || lists.length == 0) {
return null;
}
ListNode head = new ListNode(Integer.MIN_VALUE);
ListNode current = head;
while (true) {
int minInd = -1;
int minVal = Integer.MAX_VALUE;
for (int i = 0; i < lists.length; i++) {
if (lists[i] != null && lists[i].val < minVal) {
minVal = lists[i].val;
minInd = i;
}
}
if (minInd == -1) {
break;
}
current.next = lists[minInd];
lists[minInd] = lists[minInd].next;
current.next.next = null;
current = current.next;
}
return head.next;
}
public static void main(String[] args) {
ListNode n = new ListNode(1);
n.next = new ListNode(4);
n.next.next = new ListNode(5);
ListNode n1 = new ListNode(1);
n1.next = new ListNode(3);
n1.next.next = new ListNode(4);
ListNode n2 = new ListNode(2);
n2.next = new ListNode(6);
mergeKSortedList(new ListNode[]{n, n1, n2});
}
}
static class SolutionB {
static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
/**
* Time: log(k) * n. k is number of list and n is number of total elements.
* In addition, from Java 8 comparator definition can be simplified as the following:
*/
public static ListNode mergeKSortedList(ListNode[] lists) {
if (lists == null || lists.length == 0) {
return null;
}
PriorityQueue<ListNode> queue = new PriorityQueue<>(Comparator.comparingInt(o -> o.val));
for (int i = 0; i < lists.length ; i++) {
if(lists[i] != null)
queue.offer(lists[i]);
}
ListNode head = new ListNode(Integer.MIN_VALUE);
ListNode current = head;
//while heap is not empty
while (!queue.isEmpty()) {
current.next = queue.poll();
current = current.next;
ListNode n = current.next;
current.next = null;
if(n != null)
queue.offer(n);
}
return head.next;
}
public static void main(String[] args) {
mergeKSortedList(new ListNode[]{});
}
}
}
| [
"ali.ismail@booking.com"
] | ali.ismail@booking.com |
982de59b400795a16078b9cb952b76cd84276294 | 900bb7f0759f3f3e1ad17dc8fabb701ffb1dd85f | /src/com/class36/Task1.java | d9e8cfb3c5641f502cf99914d0493d71deb5df88 | [] | no_license | TubaBee/JavaProgrammer | c7e4f6f76280005ada2b2ba6583b9aa0e73d7890 | 1048ce56d88428b9843f5abde54266832dbdf9b7 | refs/heads/master | 2020-09-04T20:54:24.204815 | 2020-02-29T20:21:16 | 2020-02-29T20:21:16 | 219,889,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,005 | java | package com.class36;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
/*Create a Map from array of cities that will sort keys in alphabetical order.
* As a key store the name of the city and as a value store the length of
* the city (Example: Paris=5, Moscow =6, Washington DC=13 etc..).
If any city name is more than 7 characters remove that city ( use Iterator ).
*/
public class Task1 {
public static void main(String[] args) {
Map<String, Integer> map=new TreeMap<>();
map.put("Paris",5);
map.put("Moscow", 10);
map.put("Pakistan",6);
map.put("Turkey", 7);
map.put("dsfj",8);
map.put("ewri", 9);
map.put("mxncmxnmxnc",4);
map.put("laslsla", 3);
System.out.println(map);
Iterator<Entry<String, Integer>> it=map.entrySet().iterator();
while(it.hasNext()) {
Entry<String, Integer> all=it.next();
if(all.getKey().length()<7) {
System.out.println(all.getKey()+":::"+all.getValue());
}
}
}}
| [
"tuba.onslbee@gmail.com"
] | tuba.onslbee@gmail.com |
a759c0fd742e459e8d769984435ae6bb0fd28d65 | 35b710e9bc210a152cc6cda331e71e9116ba478c | /tc-unused/src/main/java/com/topcoder/web/winformula/controller/PredictionsHelper.java | abd058d6658eaa51ae99fca7c13d6d864ba04662 | [] | no_license | appirio-tech/tc1-tcnode | d17649afb38998868f9a6d51920c4fe34c3e7174 | e05a425be705aca8f530caac1da907d9a6c4215a | refs/heads/master | 2023-08-04T19:58:39.617425 | 2016-05-15T00:22:36 | 2016-05-15T00:22:36 | 56,892,466 | 1 | 8 | null | 2022-04-05T00:47:40 | 2016-04-23T00:27:46 | Java | UTF-8 | Java | false | false | 12,512 | java | /*
* Copyright (c) 2001-2008 TopCoder Inc. All Rights Reserved.
*/
package com.topcoder.web.winformula.controller;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.topcoder.server.ejb.TestServices.LongTestResult;
import com.topcoder.shared.dataAccess.DataAccessConstants;
import com.topcoder.shared.dataAccess.DataAccessInt;
import com.topcoder.shared.dataAccess.Request;
import com.topcoder.shared.dataAccess.resultSet.ResultSetContainer;
import com.topcoder.shared.dataAccess.resultSet.ResultSetContainer.ResultSetRow;
import com.topcoder.shared.util.DBMS;
import com.topcoder.shared.util.logging.Logger;
import com.topcoder.web.common.CachedDataAccess;
import com.topcoder.web.common.StringUtils;
import com.topcoder.web.common.TCRequest;
import com.topcoder.web.common.cache.MaxAge;
import com.topcoder.web.common.model.SortInfo;
import com.topcoder.web.winformula.Constants;
import com.topcoder.web.winformula.model.GameResult;
import com.topcoder.web.winformula.model.Prediction;
import com.topcoder.web.winformula.model.PredictionItem;
import com.topcoder.web.winformula.model.PredictionStat;
/**
* Copyright (c) 2001-2008 TopCoder, Inc. All rights reserved.
* Only for use in connection with a TopCoder competition.
*
* @author pulky
* @version $Id: PredictionsHelper.java 72757 2008-09-08 18:58:48Z pwolfus $
* Create Date: Aug 18, 2008
*/
public class PredictionsHelper {
protected static final Logger log = Logger.getLogger(PredictionsHelper.class);
public static final int HOME_TEAM_COLUMN = 1;
public static final int AWAY_TEAM_COLUMN = 2;
public static final int PICKED_WINNER_COLUMN = 3;
public static final int TOTAL_SCORE_VARIANCE_COLUMN = 4;
public static final int VICTORY_MARGIN_VARIANCE_COLUMN = 5;
public static final int POINTS_COLUMN = 6;
public static ResultSetContainer getPredictionsData(long userId, int weekId) throws Exception {
Request r = new Request();
r.setContentHandle("user_predictions");
r.setProperty(Constants.USER_ID, String.valueOf(userId));
r.setProperty(Constants.WEEK_ID, String.valueOf(weekId));
DataAccessInt dai = new CachedDataAccess(MaxAge.FIVE_MINUTES, DBMS.WINFORMULA_DATASOURCE_NAME);
return dai.getData(r).get("user_predictions");
}
@SuppressWarnings("unchecked")
public static void sortResult(TCRequest request, Prediction p) {
if (p.getPredictions().size() == 0) {
return;
}
boolean invert = "desc".equals(request.getParameter(DataAccessConstants.SORT_DIRECTION));
String sortCol = StringUtils.checkNull(request.getParameter(DataAccessConstants.SORT_COLUMN));
// all other columns are already sorted (rank)
if (sortCol.equals(String.valueOf(AWAY_TEAM_COLUMN))) {
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
return arg0.getAwayTeamName().compareTo(arg1.getAwayTeamName());
}
});
} else if (sortCol.equals(String.valueOf(PICKED_WINNER_COLUMN))) {
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
if (arg0.getPickedWinner() == null && arg1.getPickedWinner() != null) {
return 1;
}
if (arg0.getPickedWinner() != null && arg1.getPickedWinner() == null) {
return -1;
}
if (arg0.getPickedWinner() == null && arg1.getPickedWinner() == null) {
return 0;
}
return arg0.getPickedWinner().compareTo(arg1.getPickedWinner());
}
});
} else if (sortCol.equals(String.valueOf(TOTAL_SCORE_VARIANCE_COLUMN))) {
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
if (arg0.getTotalScoreVariance() == null && arg1.getTotalScoreVariance() != null) {
return 1;
}
if (arg0.getTotalScoreVariance() != null && arg1.getTotalScoreVariance() == null) {
return -1;
}
if (arg0.getTotalScoreVariance() == null && arg1.getTotalScoreVariance() == null) {
return 0;
}
return arg0.getTotalScoreVariance().compareTo(arg1.getTotalScoreVariance());
}
});
} else if (sortCol.equals(String.valueOf(VICTORY_MARGIN_VARIANCE_COLUMN))) {
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
if (arg0.getVictoryMarginVariance() == null && arg1.getVictoryMarginVariance() != null) {
return 1;
}
if (arg0.getVictoryMarginVariance() != null && arg1.getVictoryMarginVariance() == null) {
return -1;
}
if (arg0.getVictoryMarginVariance() == null && arg1.getVictoryMarginVariance() == null) {
return 0;
}
return arg0.getVictoryMarginVariance().compareTo(arg1.getVictoryMarginVariance());
}
});
} else if (sortCol.equals(String.valueOf(POINTS_COLUMN))) {
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
if (arg0.getScore() == null && arg1.getScore() != null) {
return 1;
}
if (arg0.getScore() != null && arg1.getScore() == null) {
return -1;
}
if (arg0.getScore() == null && arg1.getScore() == null) {
return 0;
}
return arg0.getScore().compareTo(arg1.getScore());
}
});
} else {
// Default, sort by home team.
Collections.sort(p.getPredictions(), new Comparator<PredictionItem>() {
public int compare(PredictionItem arg0, PredictionItem arg1) {
return arg0.getHomeTeamName().compareTo(arg1.getHomeTeamName());
}
});
}
if (invert) {
Collections.reverse(p.getPredictions());
}
SortInfo s = new SortInfo();
s.addDefault(HOME_TEAM_COLUMN, "asc");
s.addDefault(AWAY_TEAM_COLUMN, "asc");
s.addDefault(PICKED_WINNER_COLUMN, "desc");
s.addDefault(TOTAL_SCORE_VARIANCE_COLUMN, "asc");
s.addDefault(VICTORY_MARGIN_VARIANCE_COLUMN, "asc");
s.addDefault(POINTS_COLUMN, "desc");
request.setAttribute(SortInfo.REQUEST_KEY, s);
}
/**
* Crops the result as specified
*
* @param rsc the resultsetcontainter to crop
* @throws Exception
*/
public static void cropResult(TCRequest request, Prediction p) {
String numRecords = StringUtils.checkNull(request.getParameter(DataAccessConstants.NUMBER_RECORDS));
int sizeBeforeCrop = p.getPredictions().size();
if (!"25".equals(numRecords) &&
!"50".equals(numRecords) &&
!String.valueOf(sizeBeforeCrop).equals(numRecords)) {
numRecords = "10";
}
String numPage = StringUtils.checkNull(request.getParameter(DataAccessConstants.NUMBER_PAGE));
if (numPage.equals("") || Integer.parseInt(numPage) <= 0) {
numPage = "1";
}
request.setAttribute(DataAccessConstants.NUMBER_PAGE, numPage);
request.setAttribute(DataAccessConstants.NUMBER_RECORDS, numRecords);
int startRank = getStartRank(Integer.parseInt(numPage), Integer.parseInt(numRecords));
int endRank = getEndRank(Integer.parseInt(numPage), Integer.parseInt(numRecords));
if (endRank >= sizeBeforeCrop) {
// endRank = sizeBeforeCrop - 1;
endRank = sizeBeforeCrop;
}
if (sizeBeforeCrop > 0) {
p.setPredictions(p.getPredictions().subList(startRank, endRank));
}
log.debug("startRank: " + startRank);
log.debug("startRank: " + endRank);
log.debug("startRank: " + sizeBeforeCrop);
request.setAttribute("croppedDataBefore", new Boolean(startRank > 1));
// request.setAttribute("croppedDataAfter", new Boolean(endRank != sizeBeforeCrop - 1));
request.setAttribute("croppedDataAfter", new Boolean(endRank != sizeBeforeCrop));
request.setAttribute("totalSize", sizeBeforeCrop);
}
private static int getStartRank(int numPage, int numRecords) {
return (numPage - 1) * numRecords;
}
private static int getEndRank(int numPage, int numRecords) {
return numPage * numRecords;
}
public static Integer getNullableIntItem(ResultSetRow rsr, String columnName) {
if (rsr.getItem(columnName).getResultData() == null) {
return null;
} else {
return rsr.getIntItem(columnName);
}
}
public static Double getNullableDoubleItem(ResultSetRow rsr, String columnName) {
if (rsr.getItem(columnName).getResultData() == null) {
return null;
} else {
return rsr.getDoubleItem(columnName);
}
}
public static Boolean getNullableBoolItem(ResultSetRow rsr, String columnName) {
if (rsr.getItem(columnName).getResultData() == null) {
return null;
} else {
return rsr.getBooleanItem(columnName);
}
}
public static LongTestResult processResult(ResultSetContainer rsc, int week) {
if (rsc.size() > 0) {
int total = 0;
int correct = 0;
int score = 0;
List<PredictionItem> lpi = new ArrayList<PredictionItem>(rsc.size());
for (ResultSetRow rsr : rsc) {
Integer gameId = rsr.getIntItem("game_id");
String home = rsr.getStringItem("home");
String visitor = rsr.getStringItem("visitor");
Integer homePred = PredictionsHelper.getNullableIntItem(rsr, "home_pred");
Integer visitorPred = PredictionsHelper.getNullableIntItem(rsr, "visitor_pred");
Integer homeScore = PredictionsHelper.getNullableIntItem(rsr, "home_score");
Integer visitorScore = PredictionsHelper.getNullableIntItem(rsr, "visitor_score");
Integer predictionPoints = PredictionsHelper.getNullableIntItem(rsr, "prediction_detail_points");
Integer totalScoreVariance = PredictionsHelper.getNullableIntItem(rsr, "prediction_detail_total_score_variance");
Integer victoryMarginVariance = PredictionsHelper.getNullableIntItem(rsr, "prediction_detail_victory_margin_variance");
Boolean pickedWinner = PredictionsHelper.getNullableBoolItem(rsr, "prediction_detail_picked_winner");
PredictionItem pi = new PredictionItem(gameId, home, visitor,
(homePred == null || visitorPred == null) ? null : new GameResult(homePred, visitorPred),
(homeScore == null || visitorScore == null) ? null : new GameResult(homeScore, visitorScore),
predictionPoints, totalScoreVariance, victoryMarginVariance, pickedWinner);
lpi.add(pi);
total++;
correct += (pi.getPickedWinner() != null && pi.getPickedWinner()) ? 1 : 0;
score += pi.getScore() == null ? 0 : pi.getScore();
}
Prediction p = new Prediction(week, lpi, score, new PredictionStat(total, correct));
LongTestResult ltr = new LongTestResult();
ltr.setResultObject(p);
return ltr;
} else {
return null;
}
}
}
| [
"dongzhengbin@winterflames-MacBook-Pro.local"
] | dongzhengbin@winterflames-MacBook-Pro.local |
1f56726fc6c178ca24a762419db70a72a7b89ce4 | 7ba69e82aed1607aa23cf585b4c1aff09c9fe0f0 | /MagicPwd_V4.0.0.0/dev/dev/x/docs/srcviewer/SrcViewer.java | 08c6fb41464a02a4d7df1c2d921d67c907a1f649 | [] | no_license | abhay123lp/magicpwd | e0e3d97e6e0a20132f2b78be63ffcede2b03be49 | 8fee2c56bf246f7f081c04db5ab60c366ac48f3f | refs/heads/master | 2021-01-10T14:43:50.428966 | 2011-10-22T05:42:03 | 2011-10-22T05:42:03 | 46,347,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,520 | java | /*
* Copyright (C) 2011 yaoshangwen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* SrcViewer.java
*
* Created on 2011-1-21, 16:21:06
*/
package dev.x.docs.srcviewer;
/**
*
* @author yaoshangwen
*/
public class SrcViewer extends javax.swing.JDialog {
/** Creates new form SrcViewer */
public SrcViewer(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pl_CodeView = new javax.swing.JPanel();
bt_CodeView = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
ep_CodeView = new javax.swing.JEditorPane();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
javax.swing.GroupLayout pl_CodeViewLayout = new javax.swing.GroupLayout(pl_CodeView);
pl_CodeView.setLayout(pl_CodeViewLayout);
pl_CodeViewLayout.setHorizontalGroup(
pl_CodeViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
pl_CodeViewLayout.setVerticalGroup(
pl_CodeViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 291, Short.MAX_VALUE)
);
bt_CodeView.setMnemonic('V');
bt_CodeView.setText("查看(V)");
bt_CodeView.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bt_CodeViewActionPerformed(evt);
}
});
jScrollPane1.setViewportView(ep_CodeView);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(pl_CodeView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt_CodeView))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(pl_CodeView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bt_CodeView)))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void bt_CodeViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_CodeViewActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_bt_CodeViewActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
SrcViewer dialog = new SrcViewer(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bt_CodeView;
private javax.swing.JEditorPane ep_CodeView;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPanel pl_CodeView;
// End of variables declaration//GEN-END:variables
}
| [
"amon.wk@5271e558-d642-11de-9196-2db6e9c7c7ae"
] | amon.wk@5271e558-d642-11de-9196-2db6e9c7c7ae |
e2435004e552481a8e6405dc1f4544226256f2a7 | 2122d24de66635b64ec2b46a7c3f6f664297edc4 | /spring/spring-security/spring-boot-spring-security-third-edition/Chapter13/chapter13.00-calendar/src/main/java/com/packtpub/springsecurity/service/SpringSecurityUserContext.java | 7a8a3d3b0dcb9a7f8725335a6da3c639ea415248 | [] | no_license | yiminyangguang520/Java-Learning | 8cfecc1b226ca905c4ee791300e9b025db40cc6a | 87ec6c09228f8ad3d154c96bd2a9e65c80fc4b25 | refs/heads/master | 2023-01-10T09:56:29.568765 | 2022-08-29T05:56:27 | 2022-08-29T05:56:27 | 92,575,777 | 5 | 1 | null | 2023-01-05T05:21:02 | 2017-05-27T06:16:40 | Java | UTF-8 | Java | false | false | 3,261 | java | package com.packtpub.springsecurity.service;
import com.packtpub.springsecurity.domain.CalendarUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Component;
/**
* An implementation of {@link UserContext} that looks up the {@link CalendarUser} using the Spring Security's {@link Authentication} by principal name.
*
* TODO: How and when does this get called?
*
* @author Rob Winch
*/
@Component
public class SpringSecurityUserContext implements UserContext {
private static final Logger logger = LoggerFactory.getLogger(SpringSecurityUserContext.class);
private final CalendarService calendarService;
private final UserDetailsService userDetailsService;
@Autowired
public SpringSecurityUserContext(final CalendarService calendarService,
final UserDetailsService calendarUserDetailsService) {
if (calendarService == null) {
throw new IllegalArgumentException("calendarService cannot be null");
}
if (calendarUserDetailsService == null) {
throw new IllegalArgumentException("userDetailsService cannot be null");
}
this.calendarService = calendarService;
this.userDetailsService = calendarUserDetailsService;
}
/**
* Get the {@link CalendarUser} by obtaining the currently logged in Spring Security user's {@link Authentication#getName()} and using that to find the {@link
* CalendarUser} by email address (since for our application Spring Security usernames are email addresses).
*/
@Override
public CalendarUser getCurrentUser() {
SecurityContext context = SecurityContextHolder.getContext();
Authentication authentication = context.getAuthentication();
if (authentication == null) {
return null;
}
CalendarUser user = (CalendarUser) authentication.getPrincipal();
String email = user.getEmail();
if (email == null) {
return null;
}
CalendarUser result = calendarService.findUserByEmail(email);
if (result == null) {
throw new IllegalStateException(
"Spring Security is not in synch with CalendarUsers. Could not find user with email " + email);
}
logger.info("CalendarUser: {}", result);
return result;
}
@Override
public void setCurrentUser(CalendarUser user) {
if (user == null) {
throw new IllegalArgumentException("user cannot be null");
}
UserDetails userDetails = userDetailsService.loadUserByUsername(user.getEmail());
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userDetails,
user.getPassword(), userDetails.getAuthorities());
SecurityContextHolder.getContext().setAuthentication(authentication);
}
}
| [
"litz-a@glodon.com"
] | litz-a@glodon.com |
9030faae21200b85859cc0f3e3743400bf1ab636 | e1f433d913f84724ddf3d525144cb0dd5d002603 | /src/main/java/CustomEntityProject/PersistenceManager/MongoDbPersistenceManager.java | c0726c8ba5ee41383071db8bf86615ef3cde9d62 | [] | no_license | askowronski/CustomEntitySolutionPOC | 5b28f6862d94fb673b178244994c9eb26589c5c6 | e20d6a3804983b85a5d06debda8e10bb5b5ab368 | refs/heads/master | 2020-03-18T17:52:49.831056 | 2018-11-12T03:04:07 | 2018-11-12T03:04:07 | 135,057,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,445 | java | package CustomEntityProject.PersistenceManager;
import CustomEntityProject.MorphiaSessionFactory;
import java.util.List;
import java.util.Map;
import org.bson.types.ObjectId;
import org.mongodb.morphia.query.Query;
public class MongoDbPersistenceManager {
public Object saveOrUpdateEntity(Object entity) throws Exception {
try {
MorphiaSessionFactory.getDataStore().save(entity);
return entity;
} catch (Exception e) {
throw e;
}
}
public Object removeEntity(Object entity) throws Exception {
try {
MorphiaSessionFactory.getDataStore().delete(entity);
return entity;
} catch (Exception e) {
throw e;
}
}
public Object getEntityByKey(String key, Class classType) throws Exception {
try {
return MorphiaSessionFactory.getDataStore().createQuery(classType).filter("_id", key).get();
} catch (Exception e) {
throw e;
}
}
public Object getEntityByObjectId(ObjectId key, Class classType) throws Exception {
try {
return MorphiaSessionFactory.getDataStore().createQuery(classType).filter("_id", key).get();
} catch (Exception e) {
throw e;
}
}
public Object getEntityByFilter(String filter,String filterValue, Class classType) throws Exception {
try {
return MorphiaSessionFactory.getDataStore().createQuery(classType).filter(filter, filterValue).get();
} catch (Exception e) {
throw e;
}
}
public List<Object> getEntities(Class classType) throws Exception {
try {
return MorphiaSessionFactory.getDataStore().createQuery(classType).asList();
} catch (Exception e) {
throw e;
}
}
public Query beginQuery(Class classType) {
return MorphiaSessionFactory.getDataStore().find(classType);
}
public Query addRestriction(Query query, String fieldRestricition, String value) {
return query.filter(fieldRestricition,value);
}
public Query addRestrictionToSubField(Query query, String subFieldName, String fieldRestriction, String value) {
return query.filter(subFieldName+fieldRestriction, value);
}
public Object addHasElement(Query query, String fieldName, Object obj) {
return query.field(fieldName).hasThisOne(obj);
}
}
| [
"askowronski@backstopsolutions.com"
] | askowronski@backstopsolutions.com |
302f0b550bcfc8c99cd999745499c9100f204bdb | 337165d744a34601feeafdca8bd32f4f1dff2d36 | /MyEye/app/src/main/java/com/example/renlvda/MyEye/ui/UpdateActivity.java | 36fc904d70f5acd974ed83a3bb9691fc0f04c00a | [] | no_license | ECNUCreate/Eye-ProjecT | 40f74e9847c88e361108aaba22feee669f3df896 | 46bfbf2003c592962d94e638a2858728bd641e90 | refs/heads/master | 2020-03-31T22:03:35.177712 | 2018-10-11T14:23:19 | 2018-10-11T14:23:19 | 152,603,732 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,207 | java | package com.example.renlvda.MyEye.ui;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.widget.TextView;
import com.daimajia.numberprogressbar.NumberProgressBar;
import com.example.renlvda.MyEye.R;
import com.kymjs.rxvolley.RxVolley;
import com.kymjs.rxvolley.client.HttpCallback;
import com.kymjs.rxvolley.client.ProgressListener;
import com.kymjs.rxvolley.http.VolleyError;
import com.kymjs.rxvolley.toolbox.FileUtils;
import java.io.File;
/**
* 项目名: MyEye
* 包名: com.example.renlvda.MyEye.ui
* 文件名: UpdateActivity
* 创建者: 任律达
* 创建时间: 2017/12/2 16:55
* 描述: 下载
*/
public class UpdateActivity extends BaseActivity {
//正在下载
public static final int HANDLER_LODING = 10001;
//下载完成
public static final int HANDLER_OK = 10002;
//下载失败
public static final int HANDLER_ON = 10003;
private TextView tv_size;
private String url;
private String path;
//进度条
private NumberProgressBar number_progress_bar;
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case HANDLER_LODING:
//实时更新进度
Bundle bundle = msg.getData();
long transferredBytes = bundle.getLong("transferredBytes");
long totalSize = bundle.getLong("totalSize");
tv_size.setText(transferredBytes + " / " + totalSize);
//设置进度
number_progress_bar.setProgress ((int) (((float) transferredBytes / (float) totalSize) * 100));
break;
case HANDLER_OK:
tv_size.setText("下载成功");
//启动这个应用安装
startInstallApk();
break;
case HANDLER_ON:
tv_size.setText("下载失败");
break;
}
}
};
//启动安装
private void startInstallApk() {
Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
startActivity(i);
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_update);
initView();
}
private void initView() {
tv_size = (TextView) findViewById(R.id.tv_size);
number_progress_bar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
number_progress_bar.setMax(100);
path = FileUtils.getSDCardPath() + "/" + System.currentTimeMillis() + ".apk";
//下载
url = getIntent().getStringExtra("url");
if (!TextUtils.isEmpty(url)) {
//下载
RxVolley.download(path, url, new ProgressListener() {
@Override
public void onProgress(long transferredBytes, long totalSize) {
//L.i("transferredBytes:" + transferredBytes + "totalSize" + totalSize);
Message msg = new Message();
msg.what = HANDLER_LODING;
Bundle bundle = new Bundle();
bundle.putLong("transferredBytes", transferredBytes);
bundle.putLong("totalSize", totalSize);
msg.setData(bundle);
handler.sendMessage(msg);
}
}, new HttpCallback() {
@Override
public void onSuccess(String t) {
handler.sendEmptyMessage(HANDLER_OK);
}
@Override
public void onFailure(VolleyError error) {
handler.sendEmptyMessage(HANDLER_ON);
}
});
}
}
}
| [
"1041962748@qq.com"
] | 1041962748@qq.com |
4d48f70488281ca6b2170f5d743fa03e6456d94c | 61a4c2969eaf51b22bc4a4cfaab4e108401d7195 | /SWBSocialModel/src/main/java/org/semanticwb/social/base/LifeStageBase.java | 41b4fd3f269133ce173518e0dba779157f954353 | [] | no_license | sicmx/SWBSocialBundle | e0a301c303c480e6d6b91170ad7d2aab7f06aa9c | 3ce90471a5597005e24957d5d377e6a89c965885 | refs/heads/master | 2020-04-10T14:14:14.822046 | 2019-01-09T06:02:21 | 2019-01-09T06:02:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,689 | java | package org.semanticwb.social.base;
/**
* Define las diferentes etapas de la vida de una persona.
*/
public abstract class LifeStageBase extends org.semanticwb.model.SWBClass implements org.semanticwb.model.Traceable,org.semanticwb.model.Descriptiveable
{
/**
* Edad Maxima considerada para la etapa de la vida especificada
*/
public static final org.semanticwb.platform.SemanticProperty social_ls_maxAge=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticProperty("http://www.semanticwebbuilder.org/swb4/social#ls_maxAge");
/**
* Minima edad que debe de cumplir un usuario para estar en una determinada etapa de la vida
*/
public static final org.semanticwb.platform.SemanticProperty social_ls_minAge=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticProperty("http://www.semanticwebbuilder.org/swb4/social#ls_minAge");
/**
* Define las diferentes etapas de la vida de una persona.
*/
public static final org.semanticwb.platform.SemanticClass social_LifeStage=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticClass("http://www.semanticwebbuilder.org/swb4/social#LifeStage");
/**
* The semantic class that represents the currentObject
*/
public static final org.semanticwb.platform.SemanticClass sclass=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticClass("http://www.semanticwebbuilder.org/swb4/social#LifeStage");
public static class ClassMgr
{
/**
* Returns a list of LifeStage for a model
* @param model Model to find
* @return Iterator of org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStages(org.semanticwb.model.SWBModel model)
{
java.util.Iterator it=model.getSemanticObject().getModel().listInstancesOfClass(sclass);
return new org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage>(it, true);
}
/**
* Returns a list of org.semanticwb.social.LifeStage for all models
* @return Iterator of org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStages()
{
java.util.Iterator it=sclass.listInstances();
return new org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage>(it, true);
}
/**
* Gets a org.semanticwb.social.LifeStage
* @param id Identifier for org.semanticwb.social.LifeStage
* @param model Model of the org.semanticwb.social.LifeStage
* @return A org.semanticwb.social.LifeStage
*/
public static org.semanticwb.social.LifeStage getLifeStage(String id, org.semanticwb.model.SWBModel model)
{
return (org.semanticwb.social.LifeStage)model.getSemanticObject().getModel().getGenericObject(model.getSemanticObject().getModel().getObjectUri(id,sclass),sclass);
}
/**
* Create a org.semanticwb.social.LifeStage
* @param id Identifier for org.semanticwb.social.LifeStage
* @param model Model of the org.semanticwb.social.LifeStage
* @return A org.semanticwb.social.LifeStage
*/
public static org.semanticwb.social.LifeStage createLifeStage(String id, org.semanticwb.model.SWBModel model)
{
return (org.semanticwb.social.LifeStage)model.getSemanticObject().getModel().createGenericObject(model.getSemanticObject().getModel().getObjectUri(id,sclass),sclass);
}
/**
* Remove a org.semanticwb.social.LifeStage
* @param id Identifier for org.semanticwb.social.LifeStage
* @param model Model of the org.semanticwb.social.LifeStage
*/
public static void removeLifeStage(String id, org.semanticwb.model.SWBModel model)
{
model.getSemanticObject().getModel().removeSemanticObject(model.getSemanticObject().getModel().getObjectUri(id,sclass));
}
/**
* Returns true if exists a org.semanticwb.social.LifeStage
* @param id Identifier for org.semanticwb.social.LifeStage
* @param model Model of the org.semanticwb.social.LifeStage
* @return true if the org.semanticwb.social.LifeStage exists, false otherwise
*/
public static boolean hasLifeStage(String id, org.semanticwb.model.SWBModel model)
{
return (getLifeStage(id, model)!=null);
}
/**
* Gets all org.semanticwb.social.LifeStage with a determined ModifiedBy
* @param value ModifiedBy of the type org.semanticwb.model.User
* @param model Model of the org.semanticwb.social.LifeStage
* @return Iterator with all the org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStageByModifiedBy(org.semanticwb.model.User value,org.semanticwb.model.SWBModel model)
{
org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage> it=new org.semanticwb.model.GenericIterator(model.getSemanticObject().getModel().listSubjectsByClass(swb_modifiedBy, value.getSemanticObject(),sclass));
return it;
}
/**
* Gets all org.semanticwb.social.LifeStage with a determined ModifiedBy
* @param value ModifiedBy of the type org.semanticwb.model.User
* @return Iterator with all the org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStageByModifiedBy(org.semanticwb.model.User value)
{
org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage> it=new org.semanticwb.model.GenericIterator(value.getSemanticObject().getModel().listSubjectsByClass(swb_modifiedBy,value.getSemanticObject(),sclass));
return it;
}
/**
* Gets all org.semanticwb.social.LifeStage with a determined Creator
* @param value Creator of the type org.semanticwb.model.User
* @param model Model of the org.semanticwb.social.LifeStage
* @return Iterator with all the org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStageByCreator(org.semanticwb.model.User value,org.semanticwb.model.SWBModel model)
{
org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage> it=new org.semanticwb.model.GenericIterator(model.getSemanticObject().getModel().listSubjectsByClass(swb_creator, value.getSemanticObject(),sclass));
return it;
}
/**
* Gets all org.semanticwb.social.LifeStage with a determined Creator
* @param value Creator of the type org.semanticwb.model.User
* @return Iterator with all the org.semanticwb.social.LifeStage
*/
public static java.util.Iterator<org.semanticwb.social.LifeStage> listLifeStageByCreator(org.semanticwb.model.User value)
{
org.semanticwb.model.GenericIterator<org.semanticwb.social.LifeStage> it=new org.semanticwb.model.GenericIterator(value.getSemanticObject().getModel().listSubjectsByClass(swb_creator,value.getSemanticObject(),sclass));
return it;
}
}
public static LifeStageBase.ClassMgr getLifeStageClassMgr()
{
return new LifeStageBase.ClassMgr();
}
/**
* Constructs a LifeStageBase with a SemanticObject
* @param base The SemanticObject with the properties for the LifeStage
*/
public LifeStageBase(org.semanticwb.platform.SemanticObject base)
{
super(base);
}
/**
* Sets the value for the property ModifiedBy
* @param value ModifiedBy to set
*/
public void setModifiedBy(org.semanticwb.model.User value)
{
if(value!=null)
{
getSemanticObject().setObjectProperty(swb_modifiedBy, value.getSemanticObject());
}else
{
removeModifiedBy();
}
}
/**
* Remove the value for ModifiedBy property
*/
public void removeModifiedBy()
{
getSemanticObject().removeProperty(swb_modifiedBy);
}
/**
* Gets the ModifiedBy
* @return a org.semanticwb.model.User
*/
public org.semanticwb.model.User getModifiedBy()
{
org.semanticwb.model.User ret=null;
org.semanticwb.platform.SemanticObject obj=getSemanticObject().getObjectProperty(swb_modifiedBy);
if(obj!=null)
{
ret=(org.semanticwb.model.User)obj.createGenericInstance();
}
return ret;
}
/**
* Gets the Ls_maxAge property
* @return int with the Ls_maxAge
*/
public int getLs_maxAge()
{
return getSemanticObject().getIntProperty(social_ls_maxAge);
}
/**
* Sets the Ls_maxAge property
* @param value long with the Ls_maxAge
*/
public void setLs_maxAge(int value)
{
getSemanticObject().setIntProperty(social_ls_maxAge, value);
}
/**
* Gets the Created property
* @return java.util.Date with the Created
*/
public java.util.Date getCreated()
{
return getSemanticObject().getDateProperty(swb_created);
}
/**
* Sets the Created property
* @param value long with the Created
*/
public void setCreated(java.util.Date value)
{
getSemanticObject().setDateProperty(swb_created, value);
}
/**
* Gets the Updated property
* @return java.util.Date with the Updated
*/
public java.util.Date getUpdated()
{
return getSemanticObject().getDateProperty(swb_updated);
}
/**
* Sets the Updated property
* @param value long with the Updated
*/
public void setUpdated(java.util.Date value)
{
getSemanticObject().setDateProperty(swb_updated, value);
}
/**
* Gets the Description property
* @return String with the Description
*/
public String getDescription()
{
return getSemanticObject().getProperty(swb_description);
}
/**
* Sets the Description property
* @param value long with the Description
*/
public void setDescription(String value)
{
getSemanticObject().setProperty(swb_description, value);
}
public String getDescription(String lang)
{
return getSemanticObject().getProperty(swb_description, null, lang);
}
public String getDisplayDescription(String lang)
{
return getSemanticObject().getLocaleProperty(swb_description, lang);
}
public void setDescription(String description, String lang)
{
getSemanticObject().setProperty(swb_description, description, lang);
}
/**
* Sets the value for the property Creator
* @param value Creator to set
*/
public void setCreator(org.semanticwb.model.User value)
{
if(value!=null)
{
getSemanticObject().setObjectProperty(swb_creator, value.getSemanticObject());
}else
{
removeCreator();
}
}
/**
* Remove the value for Creator property
*/
public void removeCreator()
{
getSemanticObject().removeProperty(swb_creator);
}
/**
* Gets the Creator
* @return a org.semanticwb.model.User
*/
public org.semanticwb.model.User getCreator()
{
org.semanticwb.model.User ret=null;
org.semanticwb.platform.SemanticObject obj=getSemanticObject().getObjectProperty(swb_creator);
if(obj!=null)
{
ret=(org.semanticwb.model.User)obj.createGenericInstance();
}
return ret;
}
/**
* Gets the Title property
* @return String with the Title
*/
public String getTitle()
{
return getSemanticObject().getProperty(swb_title);
}
/**
* Sets the Title property
* @param value long with the Title
*/
public void setTitle(String value)
{
getSemanticObject().setProperty(swb_title, value);
}
public String getTitle(String lang)
{
return getSemanticObject().getProperty(swb_title, null, lang);
}
public String getDisplayTitle(String lang)
{
return getSemanticObject().getLocaleProperty(swb_title, lang);
}
public void setTitle(String title, String lang)
{
getSemanticObject().setProperty(swb_title, title, lang);
}
/**
* Gets the Ls_minAge property
* @return int with the Ls_minAge
*/
public int getLs_minAge()
{
return getSemanticObject().getIntProperty(social_ls_minAge);
}
/**
* Sets the Ls_minAge property
* @param value long with the Ls_minAge
*/
public void setLs_minAge(int value)
{
getSemanticObject().setIntProperty(social_ls_minAge, value);
}
}
| [
"jose.jimenez@infotec.mx"
] | jose.jimenez@infotec.mx |
78397e29aa642523bac2a4363a659bcf65ba9ed6 | 1030f2d4255507270e6ce57bc834cc657899e6e3 | /app/src/main/java/com/york42/criminalintent/CrimeFragment.java | 47f48822bd75a60aef3d20857dec6ff7663c983f | [] | no_license | YorkHe/CriminalIntent | f65eb20d1e5ef279662b54787b0ca2487bd18233 | 9c6df3e538d718dbdf8a0a7c2b86fad8bc566a37 | refs/heads/master | 2021-01-17T17:36:06.511625 | 2016-08-07T13:38:27 | 2016-08-07T13:38:27 | 65,135,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,626 | java | package com.york42.criminalintent;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.telecom.Call;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import java.io.File;
import java.util.Date;
import java.util.UUID;
/**
* Created by 宇 on 2016/8/2.
*/
public class CrimeFragment extends Fragment{
private static final String ARG_CRIME_ID = "crime_id";
private static final String DIALOG_DATE = "DialogDate";
private static final int REQUEST_DATE = 0;
private static final int REQUEST_CONTACT = 1;
private static final int REQUEST_PHOTO = 2;
private Crime mCrime;
private File mPhotoFile;
private EditText mTitleField;
private Button mDateButton;
private CheckBox mSolvedCheckBox;
private Button mReportButton;
private Button mSuspectButton;
private ImageButton mPhotoButton;
private ImageView mPhotoView;
private Callbacks mCallbacks;
public interface Callbacks{
void onCrimeUpdated(Crime crime);
}
public static CrimeFragment newInstance(UUID crimeId){
Bundle args = new Bundle();
args.putSerializable(ARG_CRIME_ID, crimeId);
CrimeFragment fragment = new CrimeFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
mCallbacks = (Callbacks)activity;
}
public void returnResult(){
Intent intent = new Intent();
intent.putExtra(ARG_CRIME_ID, mCrime.getId());
getActivity().setResult(Activity.RESULT_OK, intent);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UUID crimeId = (UUID)getArguments().getSerializable(ARG_CRIME_ID);
mCrime = CrimeLab.get(getActivity()).getCrime(crimeId);
mPhotoFile = CrimeLab.get(getActivity()).getPhotoFile(mCrime);
}
@Override
public void onPause() {
super.onPause();
CrimeLab.get(getActivity()).updateCrime(mCrime);
}
@Override
public void onDetach() {
super.onDetach();
mCallbacks = null;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_crime, container, false);
mTitleField = (EditText) v.findViewById(R.id.crime_title);
mTitleField.setText(mCrime.getTitle());
mTitleField.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
mCrime.setTitle(charSequence.toString());
updateCrime();
}
@Override
public void afterTextChanged(Editable editable) {
}
});
mDateButton = (Button)v.findViewById(R.id.crime_date);
mDateButton.setText(DateFormat.format("E,MMMM dd, yyyy", mCrime.getDate()).toString());
mDateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FragmentManager manager = getFragmentManager();
DatePickerFragment dialog = DatePickerFragment.newInstance(mCrime.getDate());
dialog.setTargetFragment(CrimeFragment.this, REQUEST_DATE);
dialog.show(manager, DIALOG_DATE);
}
});
mSolvedCheckBox = (CheckBox)v.findViewById(R.id.crime_solved);
mSolvedCheckBox.setChecked(mCrime.isSolved());
mSolvedCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
mCrime.setSolved(b);
updateCrime();
}
});
returnResult();
mReportButton = (Button) v.findViewById(R.id.crime_report);
mReportButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TEXT, getCrimeReport());
i.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.crime_report_subject));
i = Intent.createChooser(i, getString(R.string.send_report));
startActivity(i);
}
});
final Intent pickContact = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
mSuspectButton = (Button)v.findViewById(R.id.crime_suspect);
mSuspectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivityForResult(pickContact, REQUEST_CONTACT);
}
});
if (mCrime.getSuspect() != null){
mSuspectButton.setText(mCrime.getSuspect());
}
PackageManager packageManager = getActivity().getPackageManager();
if (packageManager.resolveActivity(pickContact, PackageManager.MATCH_DEFAULT_ONLY) == null){
mSuspectButton.setEnabled(false);
}
mPhotoButton = (ImageButton)v.findViewById(R.id.crime_camera);
mPhotoView = (ImageView) v.findViewById(R.id.crime_photo);
final Intent captureImage = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
boolean canTakePhoto = mPhotoFile != null &&
captureImage.resolveActivity(packageManager) != null;
mPhotoButton.setEnabled(canTakePhoto);
if (canTakePhoto){
Uri uri = Uri.fromFile(mPhotoFile);
captureImage.putExtra(MediaStore.EXTRA_OUTPUT, uri);
}
mPhotoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivityForResult(captureImage, REQUEST_PHOTO);
}
});
updatePhotoView();
return v;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != Activity.RESULT_OK){
return;
}
if (requestCode == REQUEST_DATE){
Date date = (Date)data.getSerializableExtra(DatePickerFragment.EXTRA_DATE);
mCrime.setDate(date);
mDateButton.setText(mCrime.getDate().toString());
updateCrime();
}else if (requestCode == REQUEST_CONTACT && data != null){
Uri contactUri = data.getData();
String[] queryFields = new String[]{
ContactsContract.Contacts.DISPLAY_NAME
};
Cursor c = getActivity().getContentResolver().query(contactUri, queryFields, null, null, null);
try{
if (c.getCount() == 0)
{
return;
}
c.moveToFirst();
String suspect = c.getString(0);
mCrime.setSuspect(suspect);
updateCrime();
mSuspectButton.setText(suspect);
}finally {
c.close();
}
}else if (requestCode == REQUEST_PHOTO){
updateCrime();
updatePhotoView();
}
}
private void updateCrime(){
CrimeLab.get(getActivity()).updateCrime(mCrime);
mCallbacks.onCrimeUpdated(mCrime);
}
private String getCrimeReport(){
String solvedString = null;
if (mCrime.isSolved()){
solvedString = getString(R.string.crime_report_solved);
}else{
solvedString = getString(R.string.crime_report_unsolved);
}
String dateFormat = "EEE, MMM dd";
String dateString = DateFormat.format(dateFormat, mCrime.getDate()).toString();
String suspect = mCrime.getSuspect();
if (suspect == null){
suspect = getString(R.string.crime_report_no_suspect);
}else{
suspect = getString(R.string.crime_report_suspect, suspect);
}
String report = getString(R.string.crime_report, mCrime.getTitle(), dateString, solvedString, suspect);
return report;
}
private void updatePhotoView(){
if (mPhotoFile == null || !mPhotoFile.exists()){
mPhotoView.setImageDrawable(null);
}else{
Bitmap bitmap = PictureUtils.getScaledBitmap(
mPhotoFile.getPath(), getActivity()
);
mPhotoView.setImageBitmap(bitmap);
}
}
}
| [
"kiddmagician@gmail.com"
] | kiddmagician@gmail.com |
4586f50743e32a1938ea24e4442325fef0d38c2d | 33ac29e571ecc79b9837e4dd0b6a9fd957ad36e5 | /src/main/java/bank/client/AddressDefault.java | 2dc927a0a1b8c9c5710730320e72a82dfd25d793 | [] | no_license | Inkvizi/javaschool-project | fc1812c82e89b895676b7ef33ac03715d163a14a | da704b765a09519349a18552dfea04ce2630cfdd | refs/heads/develop | 2023-05-06T14:51:59.441569 | 2021-05-18T09:42:28 | 2021-05-18T09:42:28 | 350,979,975 | 0 | 0 | null | 2021-06-01T14:13:17 | 2021-03-24T07:07:44 | Java | UTF-8 | Java | false | false | 243 | java | package bank.client;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class AddressDefault implements Address {
String country;
String city;
String street;
int house;
int flat;
}
| [
"Marinets.Ev@sberbank.ru"
] | Marinets.Ev@sberbank.ru |
9e7bbc29a8230d4d2a0e63f10301f5e4218694e4 | caeed83ff23118e089edd40b94f51c4c57dae804 | /LeetCode/646MaximumLengthofPairChain.java | b05ef55809913fbd4602fc4f7bf1f13e456a4df8 | [] | no_license | PepperHxH/Algorithms | 82e263d650089ccf0af35a1a3351a1c2f36599d2 | a9f8d753114cc8ef2860fc4f0cb4076c1454e75d | refs/heads/master | 2020-09-12T01:58:55.365100 | 2020-07-09T09:35:01 | 2020-07-09T09:35:01 | 222,262,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | class Solution {
public int findLongestChain(int[][] pairs) {
if(pairs == null || pairs.length == 0) return 0;
int n = pairs.length;
Arrays.sort(pairs, new Comparator<int[]>(){
public int compare(int[] p1, int[] p2) {
return p1[0] - p2[0];
}
});
int[] dp = new int[n];
dp[0] = 1;
for(int i = 1; i < n; i++) {
int max = 1;
for(int j = 0; j < i; j++) {
if(pairs[i][0] > pairs[j][1]) {
max = Math.max(max, dp[j]+1);
}
}
dp[i] = max;
}
int res = 0;
for(int i = 0; i < n; i++) {
res = Math.max(res, dp[i]);
}
return res;
}
} | [
"838245976@qq.com"
] | 838245976@qq.com |
375912aed43c59d7eb046d163d23710bc7f6be0c | 9cc4e1be0a666c5281d75297315c729ae61e9552 | /messaging-actor/src/main/java/com/lockdown/messaging/actor/ActorFactory.java | 2d999f5d5a3232c42d61c3a50f5a50b4dd52f407 | [] | no_license | neo-lock/messaging-toy | dc5b824f8875b9ee1c0462a746f049eed743df4b | 44e0a9130707ddc3965300253b8c359a941a71a0 | refs/heads/master | 2020-04-25T02:35:46.649672 | 2019-03-26T11:28:53 | 2019-03-26T11:28:53 | 172,445,914 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 108 | java | package com.lockdown.messaging.actor;
public interface ActorFactory {
AbstractActor newInstance();
}
| [
"wycoolcool@126.com"
] | wycoolcool@126.com |
5e05416eb0254092ca78fc41654126366da7c8da | a4257915d8dd1babaa8c3f024fb1172d9f24b660 | /CFOS_Capstone/src/main/java/com/capstone/cfos/controller/vm/FeedBackVMResponse.java | cbb5edef41e8f83dd71dc45a8f3c6cb887b0d914 | [] | no_license | softallice/CFOS_Capstone_Project | 129ce755dbd80041ed9efbf8ccd940982dc86b66 | 3342113f8a359ded4a7cfff354291789ad42bf59 | refs/heads/master | 2023-03-22T01:08:32.291999 | 2020-06-01T12:58:42 | 2020-06-01T12:58:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.capstone.cfos.controller.vm;
import lombok.Data;
import java.util.Date;
@Data
public class FeedBackVMResponse {
private Long fbId;
private String fbContent;
private Date fbDate;
private double rate;
}
| [
"soundlound@gmail.com"
] | soundlound@gmail.com |
b8ea2e5aebb0d5de2870cef1bbc532000c67733b | 22404e879ce0b5a1cfe35649d558141046738463 | /java_실습_Kimjw/src/java_실습_Kimjw/test7.java | 119b044f414a1a0007ce4c68a530d5d5416c729c | [] | no_license | rwd117/Hello20.08.10 | e932e0f121430add623daa8bd64ecf2a0189fe4e | 54b91e94a8310cfdc7825cff10acfa1b87b969a4 | refs/heads/master | 2023-02-06T05:21:59.251594 | 2020-12-30T10:34:25 | 2020-12-30T10:34:25 | 286,391,489 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,105 | java | package java_실습_Kimjw;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;
public class test7
{
public static void main(String[] args) throws IOException
{
Random r=new Random();
int computer=Math.abs(r.nextInt()%3);
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
String user;
System.out.print("하나 선택(가위=a,바위=b,보=c):");
user=in.readLine();
if(user.equals("a"))
{ if(computer==0) System.out.println("비김");
if(computer==1) System.out.println("컴터가 이김");
if(computer==2) System.out.println("사람이 이김");
}
else if(user.equals("b"))
{
if(computer==1) System.out.println("비김");
if(computer==2) System.out.println("컴터가 이김");
if(computer==0) System.out.println("사람이 이김");
}
else if(user.equals("c"))
{
if(computer==2) System.out.println("비김");
if(computer==0) System.out.println("컴터가 이김");
if(computer==1) System.out.println("사람이 이김");
}
}
}
| [
"rwd117@naver.com"
] | rwd117@naver.com |
13a2b3594e1355c436e37d093fe9252d3983fc85 | d51a1d350e22db35c5012eb4d31afc5d10432946 | /app/src/main/java/com/example/adopy/Models/GroupModel.java | 20be65805a08d470fa3f8c5089dbf78518f0c4ee | [] | no_license | ShellyAmbar/Adopy | 95bec978db37595854fcacebc01beb2f41f2a2d7 | a235812e3a6f91d5223c85594d3e742c371407e0 | refs/heads/master | 2023-01-15T21:16:05.323955 | 2019-09-19T14:17:19 | 2019-09-19T14:17:19 | 209,524,006 | 0 | 0 | null | 2023-01-09T11:55:54 | 2019-09-19T10:19:17 | Java | UTF-8 | Java | false | false | 1,827 | java | package com.example.adopy.Models;
public class GroupModel {
private String GroupName;
private String OwnerId;
private String OwnerName;
private String GroupId;
private String GroupCreatedTime;
private int NumOfParticipants;
private String PhotoUrl;
public GroupModel(String groupName, String ownerId, String ownerName, String groupId, String groupCreatedTime, int numOfParticipants, String photoUrl) {
GroupName = groupName;
OwnerId = ownerId;
OwnerName = ownerName;
GroupId = groupId;
GroupCreatedTime = groupCreatedTime;
NumOfParticipants = numOfParticipants;
PhotoUrl = photoUrl;
}
public String getGroupName() {
return GroupName;
}
public String getPhotoUrl() {
return PhotoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.PhotoUrl = photoUrl;
}
public void setGroupName(String groupName) {
GroupName = groupName;
}
public String getOwnerId() {
return OwnerId;
}
public void setOwnerId(String ownerId) {
OwnerId = ownerId;
}
public String getOwnerName() {
return OwnerName;
}
public void setOwnerName(String ownerName) {
OwnerName = ownerName;
}
public String getGroupId() {
return GroupId;
}
public void setGroupId(String groupId) {
GroupId = groupId;
}
public String getGroupCreatedTime() {
return GroupCreatedTime;
}
public void setGroupCreatedTime(String groupCreatedTime) {
GroupCreatedTime = groupCreatedTime;
}
public int getNumOfParticipants() {
return NumOfParticipants;
}
public void setNumOfParticipants(int numOfParticipants) {
NumOfParticipants = numOfParticipants;
}
}
| [
"ambarshelly@gmail.com"
] | ambarshelly@gmail.com |
799f73324af1517e6fda5fd461eb9c19fb9c566b | 4c5d0bac03c429fd837e9b157c0a4bba852143e4 | /app/src/main/java/github/chenupt/calendar/persistance/Note.java | 8175c9fd33ab0f53993d7fa63671e809871ba3ef | [] | no_license | 988uhuj/Calendar | a189c4b907188704f67f8b936e80557cb17dd020 | 54846af8c89edb132424482bb9670e6bbb4dd805 | refs/heads/master | 2022-03-18T10:41:42.275845 | 2015-01-27T04:32:17 | 2015-01-27T04:32:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 764 | java | package github.chenupt.calendar.persistance;
import org.litepal.crud.DataSupport;
import java.io.Serializable;
/**
* Created by chenupt@gmail.com on 2015/1/3.
* Description : Note entity
*/
public class Note extends DataSupport implements Serializable{
private long id;
private String content;
private long createTime;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
}
| [
"chenupt@gmail.com"
] | chenupt@gmail.com |
2fa87c666e4627a05247206ffbb2c4d3ebfeba1d | d32a215bb4092d51320e49d667ce0ccf9dfcad31 | /xuesheng/src/main/java/yaoxinyuan/servlet/AbstractBaseServlet.java | 4e8d58e28d9afcd939fada349be0224597286b58 | [] | no_license | XiaoYao-code/stu-info-sys | b2994e5ab4e93f8aa52aeae2e850289e0ed91bd0 | 2cc231a73cd23f4ab491d44c9d0cc5a9a18d0d0a | refs/heads/master | 2022-11-29T06:30:05.297310 | 2020-08-09T15:34:36 | 2020-08-09T15:34:36 | 286,264,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,628 | java | package yaoxinyuan.servlet;
import yaoxinyuan.dao.DictionaryTagDAO;
import yaoxinyuan.model.DictionaryTag;
import yaoxinyuan.model.Response;
import yaoxinyuan.util.JSONUtil;
import yaoxinyuan.util.ThreadLocalHolder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
//写成一个模板方法:参照HttpServlet的service方法和doXXX();service就是一个模板方法
//模板方法是提供一种统一的处理逻辑,在不同条件调用不同的方法(子类重写的方法)
public abstract class AbstractBaseServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req,resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
resp.setContentType("application/json");
PrintWriter pw=resp.getWriter();
Response r=new Response();
//对数据库JDBC的操作一般不要和Servlet混在一起。重新写了一个包dao,专门写JDBC
//HttpServletRequest对象.getParameter()表示接收参数,这里的参数为页面提交的参数。
// 一般包括:
// 1.表单提交的参数,这里的表单是指默认的表单提交方式,表示的是Content-Type字段x-www-form-urlencoded
//get在url中,post在body请求体中,格式是k1=v1&k2=v2;
//如果不采用默认方法,比如手写前端的ajax请求,请求格式为application/json;请求体,转为字符串
// 2.URL重写(就是***?id = 1)传的参数等,
// 因此这个没有设置参数的方法(没有SetParameter),而接收参数的返回是String.
//HttpServlet对象。getInputStream();通过输入流获取?请求体都可以获取到,但是需要解析(依赖代码实现)
try {///这段代码内部可能会出现异常,虽然在DictionaryTagDAO中已经处理,但是现在仍然要处理
Object o=process(req,resp);
r.setSuccess(true);//页面在设计的时候,是根据如果这和success字段是true的时候才进行业务数据的处理。
r.setCode("COK200");
r.setMessage("操作成功");
r.setTotal(ThreadLocalHolder.getTOTAL().get());//不管是否分页操作,都获取当前线程中的Total字段
r.setData(o);
} catch (Exception e) {
r.setCode("ERR500");
r.setMessage(e.getMessage());
StringWriter sw = new StringWriter();//通过输出流获取出现异常的堆栈信息
PrintWriter writer = new PrintWriter(sw);
e.printStackTrace(writer);//异常打印堆栈信息
String stackTrace =sw.toString();
System.err.println(stackTrace);//打印到后台的控制台
r.setStackTrace(stackTrace);//把stackTrace作为异常信息再返回到前端
}finally {
ThreadLocalHolder.getTOTAL().remove();//在线程结束前,一定要记得删除变量,否则存在内存泄露问题
}
pw.println(JSONUtil.write(r));
pw.flush();
}
protected abstract Object process(HttpServletRequest req, HttpServletResponse resp) throws Exception;
}
| [
"1774164628@qq.com"
] | 1774164628@qq.com |
db9dcc11041918efa76aee59b530339dc6383a3f | 510d8b3f85eae5a5d80127a3ce8d3fbd1db48e06 | /my_arrange/src/java/beans/Category.java | 2c4327a67e4106b204ac6e6743fb4352f67ed2b4 | [] | no_license | VASUVINAY/projects | 5e91a937a0150465d9c36279528406d66385f782 | fda36bb41e662834bfb3da5306cbe227a3bec83e | refs/heads/master | 2023-06-14T16:52:54.323850 | 2021-07-04T05:35:46 | 2021-07-04T05:35:46 | 295,325,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 578 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
/**
*
* @author lucky
*/
public class Category {
private int id;
private String name;
public Category() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"vasuvinay246@gmail.com"
] | vasuvinay246@gmail.com |
8b436d5a993fe168f0503a4bdd3e91a0be97e348 | 922fbe75dbca7f44d5f8149bbbb68d8547785fd9 | /src/main/java/com/example/demo/entity/enums/OrderStatus.java | c87c8d06673e0ef1d47f8c52cc10928d1cd6dcd2 | [] | no_license | VladKudryshov/order-back | f39f4cd0579727c90457589fe547bc2281ae7bea | 829825aa440734c38e875ecef870335314b1335a | refs/heads/master | 2020-03-29T16:37:07.583243 | 2018-12-11T13:09:27 | 2018-12-11T13:09:27 | 150,121,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 91 | java | package com.example.demo.entity.enums;
public enum OrderStatus {
WAIT,DONE,DISCARD;
}
| [
"uladzislau.kudrashou@instinctools.ru"
] | uladzislau.kudrashou@instinctools.ru |
2585f7a28e4c473d24d928db78e0296fb91f22d6 | 1f396878cd31458b27b59c98bcbd2eec9538b79a | /src/main/java/com/pixbits/lib/lang/BoolPair.java | bff0cac208dcd8480d76d9ded8bd995396fd0050 | [] | no_license | Jakz/java-pix-lib | 6d2d931ba094f217e5b41e5ae16de4b074ebc013 | b44829e57e6519489da001d1fd31fe8a336c1a70 | refs/heads/master | 2022-05-30T19:30:38.494179 | 2021-12-07T18:54:23 | 2021-12-07T18:54:23 | 72,857,776 | 1 | 1 | null | 2022-05-20T20:52:04 | 2016-11-04T15:01:43 | Java | UTF-8 | Java | false | false | 675 | java | package com.pixbits.lib.lang;
public class BoolPair
{
public final boolean first;
public final boolean second;
public BoolPair(boolean first, boolean second)
{
this.first = first;
this.second = second;
}
public BoolPair and(boolean first, boolean second)
{
return new BoolPair(first && this.first, second && this.second);
}
public BoolPair and(BoolPair other)
{
return and(other.first, other.second);
}
public BoolPair or(boolean first, boolean second)
{
return new BoolPair(first || this.first, second || this.second);
}
public BoolPair or(BoolPair other)
{
return or(other.first, other.second);
}
}
| [
"jack@pixbits.com"
] | jack@pixbits.com |
e2bc6871c7703c6d12d452e6d90b9600cec0a173 | fce3e138ad89dc4e299cee7b69ad31d83e7bf2dc | /base/src/main/java/com/miss/base/toast/ActivityToast.java | 815c50106d8b003506c7032cd066ea7557aa3079 | [] | no_license | bingoloves/mvc-frame | 59b0b5a5b8aa623fe53c60cbb1f050362c5c5a13 | 850edeadf306ed3d250f6e754e505757026f4e16 | refs/heads/master | 2022-04-25T21:43:42.175199 | 2020-04-27T04:25:31 | 2020-04-27T04:25:31 | 259,191,855 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,949 | java | package com.miss.base.toast;
import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.view.WindowManager;
import androidx.annotation.NonNull;
/**
* @Date: 2018/11/20
* @Author: heweizong
* @Description: 只展示在当前Activity的弹窗,不具有跨页面功能, 销毁Activity时需要主动清除相应的ActivityToast, 否则会造成窗口泄漏:/has leaked window/。
* <p>
* 注意:在Activity.onCreate()时展示ActivityToast依然会抛出Unable to add window -- token null is not valid; is your activity running,因为此时Activity尚未进入running状态
*/
public class ActivityToast extends DovaToast {
//context非Activity时会抛出异常:Unable to add window -- token null is not valid; is your activity running?
public ActivityToast(@NonNull Context mContext) {
super(mContext);
}
@Override
public WindowManager.LayoutParams getWMParams() {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
lp.format = PixelFormat.TRANSLUCENT;
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
lp.width = WindowManager.LayoutParams.WRAP_CONTENT;
lp.windowAnimations = android.R.style.Animation_Toast;
// TODO: 2018/11/20 考虑是否需要引入windowToken
// lp.token=((Activity)getContext()).getWindow().getDecorView().getWindowToken();
lp.gravity = getGravity();
lp.x = getXOffset();
lp.y = getYOffset();
return lp;
}
@Override
public WindowManager getWMManager() {
//context非Activity时会抛出异常:Unable to add window -- token null is not valid; is your activity running?
if (mContext instanceof Activity) {
return ((Activity) mContext).getWindowManager();
} else {
return null;
}
}
}
| [
"657952166@qq.com"
] | 657952166@qq.com |
48b140720595200a0c8d3843559d90b0dac3cfd5 | bb6729b58276561f99b1b4022581feec114f44ad | /finalproject/src/main/java/bean/Tweet.java | 80cd7e066e9df7c14d9fc1992b0713319a27b5a8 | [] | no_license | Mordred83/mlws | 41fa4438c17d983c3c6dd321d8f5ae2ab0b44937 | 2b99cb9fa7bc44eb43ecc0da678c8906a3b8a3bc | refs/heads/master | 2020-04-28T14:46:09.613520 | 2014-07-16T15:29:04 | 2014-07-16T15:29:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 869 | java | package bean;
public class Tweet {
private static final String FSTRING = "idStatus:%10d username:%25s tweet:%140s";
public long idStatus;
public String username;
public String tweet;
public Tweet(long idStatus, String username, String tweet) {
this.idStatus=idStatus;
this.username=username;
this.tweet=tweet;
}
public long getIdStatus() {
return idStatus;
}
public void setIdStatus(long idStatus) {
this.idStatus = idStatus;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getTweet() {
return tweet;
}
public void setTweet(String tweet) {
this.tweet = tweet;
}
@Override
public String toString() {
return String.format(FSTRING, idStatus, username, tweet);
}
}
| [
"Manuela@Manu"
] | Manuela@Manu |
9afb7e967153606fd2f9cd37cd3c7932b5093701 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_39242.java | e3361b588ec3ac83d378017ee5d54967680b6013 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | /**
* Changes concatenation mode to AND.
* @return this
*/
public EmailFilter and(){
this.operatorAnd=true;
return this;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
2aa34f1dfe4d953d88f0e3dfd20559a8e808c0bb | 35bf2ba0bc832547fa2b8a3a8db4e72be0001fbb | /src/main/java/SpringBootApplication.java | 9482ef323d463065e84f393ab71e61e8e561157a | [] | no_license | maxTraydakalo/stream-homework | a78cda51ba5890cae3d5158b0a28993222b958b6 | fcf3e19cbf3596623756ad5451b93623fed81cee | refs/heads/master | 2020-12-28T18:26:40.687591 | 2020-03-12T16:03:53 | 2020-03-12T16:03:53 | 238,439,982 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 40 | java |
public class SpringBootApplication {
}
| [
"max.traydakalo@gmail.com"
] | max.traydakalo@gmail.com |
5f2b8ef94ea1832a9e42f948288425fdfe3e667e | c94bdc8d497da131d51f8664eab1d22762536c2f | /src/edu/wpi/first/wpilibj/templates/commands/SpitBall.java | 7b0d6dd48f6d96621a5f28e65a315f0f50b258d3 | [] | no_license | FRCTeam225/OffseasonDemos | 0770433a98ac02d036230e6cadda025c57c2c6ba | de891b00af41889abee7de9747d7e34bb2683c59 | refs/heads/master | 2021-01-22T06:44:32.020254 | 2014-09-13T17:55:40 | 2014-09-13T17:55:40 | 23,264,456 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates.commands;
/**
*
* @author Andrew
*/
public class SpitBall extends CommandBase {
public SpitBall() {
requires(arm);
}
// Called just before this Command runs the first time
protected void initialize() {
arm.setRoller(-1);
arm.set(false);
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
}
// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return !arm.hasBall();
}
// Called once after isFinished returns true
protected void end() {
arm.setRoller(0);
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
end();
}
}
| [
"andrew@lobos.me"
] | andrew@lobos.me |
ade5dbdbac700327824d604f981b3be57d419cd7 | bf2b5fdd0dc3b2043e1c151da6174548bbbc3f3c | /app/src/androidTest/java/com/example/myapplication85/ExampleInstrumentedTest.java | 60b44aed0f9789ce5d0c92dc863f796544da5440 | [] | no_license | ProSanjay/Tic-Tac-toe | 6fc74644fdd733038a01fa481f14157d09338adf | 466a0cc9c12de17bec201c38cc1e2bcd55b0e984 | refs/heads/master | 2023-07-03T11:25:23.096961 | 2021-08-09T10:15:49 | 2021-08-09T10:15:49 | 394,131,870 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package com.example.myapplication85;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.myapplication85", appContext.getPackageName());
}
} | [
"sanjaykushwah412@gmail.com"
] | sanjaykushwah412@gmail.com |
ff2add9ad116dfda990a5bc768f9d6b8d37e6a95 | 16f1174ee9fc9a698e350fff6c2a15dcfdd7272b | /Problems/055_Jump_Game.java | e7dd239a4ea82a0b5410a4177aec771393e14488 | [] | no_license | maheshg23/Leetcode | cca606564313a96f84b30147ecb65682b0571426 | 142c8730ca16c030b6ae38c0b53298c69bd09302 | refs/heads/master | 2022-12-31T03:28:51.365316 | 2020-10-23T21:00:57 | 2020-10-23T21:00:57 | 266,223,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,865 | java | // 55. Jump Game
// https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/531/week-4/3310/
// DP Top-Down
class Solution {
public boolean canJump(int[] nums) {
Character[] memo = new Character[nums.length];
for (int i = 0; i < memo.length; i++) {
memo[i] = 'U';
}
memo[nums.length - 1] = 'G';
return canJumpFrom(0, nums, memo);
}
public boolean canJumpFrom(int pos, int[] nums, Character[] memo) {
if (memo[pos] == 'G')
return true;
else if (memo[pos] == 'B')
return false;
if (pos == nums.length - 1)
return true;
int farJump = Math.min(pos + nums[pos], nums.length - 1);
for (int i = farJump; i > pos; i--) {
if (canJumpFrom(i, nums, memo)) {
memo[pos] = 'G';
return true;
}
}
memo[pos] = 'B';
return false;
}
}
// DP Bottom Up
class Solution {
public boolean canJump(int[] nums) {
Character[] memo = new Character[nums.length];
for (int i = 0; i < memo.length; i++) {
memo[i] = 'U';
}
memo[nums.length - 1] = 'G';
for (int i = nums.length - 2; i >= 0; i--) {
int farJump = Math.min(i + nums[i], nums.length - 1);
for (int j = i + 1; j <= farJump; j++) {
if (memo[j] == 'G') {
memo[i] = 'G';
break;
}
}
}
return memo[0] == 'G';
}
}
// Greedy // Faster
class Solution {
public boolean canJump(int[] nums) {
int lastPos = nums.length - 1;
for (int i = nums.length - 1; i >= 0; i--) {
if (i + nums[i] >= lastPos)
lastPos = i;
}
return lastPos == 0 ? true : false;
}
} | [
"gmn1994@gmail.com"
] | gmn1994@gmail.com |
3c9aa80009814f823730b40bd65ef33f96dd1766 | 5cfd4706443b60132bb83a5ce9c413096b0a04a8 | /spring-jpa-api-demo/src/main/java/com/luv2code/springdemo/dao/jpaEmployeedao.java | eef3cf271bd498d75ef71e394aed03061f392cc5 | [] | no_license | mohamed-amer152/spring | 9ea7f5ed512afc1af71318ac84753204af160e05 | 2249b7ff697effb028330a15fa13fff87e3b6e05 | refs/heads/master | 2023-09-02T07:46:27.125389 | 2021-09-25T12:17:09 | 2021-09-25T12:17:09 | 410,253,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 699 | java | package com.luv2code.springdemo.dao;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.luv2code.springdemo.entity.Employee;
@Repository
public class jpaEmployeedao implements EmployeeDAO {
public jpaEmployeedao() {
// TODO Auto-generated constructor stub
}
@Override
public List<Employee> getEmployees() {
// TODO Auto-generated method stub
return null;
}
@Override
public Employee getEmployee(int id) {
// TODO Auto-generated method stub
return null;
}
@Override
public void save(Employee employee) {
// TODO Auto-generated method stub
}
@Override
public void delete(int EmployeeId) {
// TODO Auto-generated method stub
}
}
| [
"rezk2562@gmail.com"
] | rezk2562@gmail.com |
822f7bac4d8905e946a09d54e5e76c516831532e | b297d5b97f99533f1f5774d1734b4214878b2e5b | /src/main/java/br/edu/ifms/loja/produto/bo/ProdutoBO.java | 8691471acaa373de3c5c9f6815d481e3271f32da | [] | no_license | manuvaz/SistemaDeVendas | 4b800ed06e92752fd594a9682a3de84c22e30074 | cca19ce0a941a9bfd5e1f5f38d4d1c2343f0fd6b | refs/heads/master | 2022-07-09T12:41:43.953640 | 2019-12-07T00:01:12 | 2019-12-07T00:01:12 | 226,431,070 | 0 | 0 | null | 2022-06-21T02:23:50 | 2019-12-07T00:04:51 | Java | UTF-8 | Java | false | false | 1,128 | java |
package br.edu.ifms.loja.produto.bo;
import br.edu.ifms.loja.fornecedor.dao.FornecedorDAO;
import br.edu.ifms.loja.fornecedor.datamodel.Fornecedor;
import br.edu.ifms.loja.produto.dao.ProdutoDao;
import br.edu.ifms.loja.produto.datamodel.Produto;
import java.util.List;
import maruyama.components.mvc.GenericCRUDModel;
/**
*
* @author Manoel
*/
public class ProdutoBO extends GenericCRUDModel<Produto>{
private ProdutoDao dao;
private FornecedorDAO ForDao;
public ProdutoBO() {
dao = new ProdutoDao();
ForDao = new FornecedorDAO();
}
public List<Fornecedor> listar() {
return ForDao.listarTodos();
}
@Override
public void salvarEmBaseDeDados(Produto t) {
dao.persistir(t);
}
@Override
public void removerEmBaseDeDados(Produto t) {
dao.remover(t);
}
@Override
public List<Produto> carregarLista() {
return dao.listarTodos();
}
@Override
public List<Produto> buscar(String string, String string1) {
return null;
}
}
| [
"manu.vaz14@gmail.com"
] | manu.vaz14@gmail.com |
4ae7543e1744874e208cd5239e058821bb496c44 | 79e8187e01ebe84c37d221f15ceb999978e0a2df | /src/main/java/de/servicezombie/csv2qif/util/VbSauerlandQuickenTransformer.java | f04301c99d7d6810055ca62840d165f2bbf0027f | [] | no_license | ckaiser79/csv2qif | ad440756ac0dc5152eb2adc3cf4ad57ffdaf1567 | ca2146440bc685fe235430e6f96d65d9c40db066 | refs/heads/master | 2020-05-07T15:56:03.526305 | 2011-01-04T20:47:53 | 2011-01-04T20:47:53 | 32,329,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,200 | java | package de.servicezombie.csv2qif.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import de.servicezombie.csv2qif.def.ErrorCodes;
import de.servicezombie.csv2qif.vo.QuickenTransaction;
public class VbSauerlandQuickenTransformer implements Transformer<QuickenTransaction> {
private static final Log log = LogFactory.getLog(VbSauerlandQuickenTransformer.class);
private static final SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
private static final String SPACE = " ";
public QuickenTransaction transform(Object from) {
QuickenTransaction qt = new QuickenTransaction();
String buf;
String[] source = (String[]) from;
stripQuotations(source);
qt.setAccountNo(Integer.valueOf(source[0]));
// make number look english
buf = source[19].replace(".", "");
buf = buf.replace(",", ".");
qt.setAmount(Double.valueOf(buf));
//qt.setBankNo(Integer.valueOf(source[]));
try {
Date dt = sdf.parse(source[1]);
qt.setBookingDate(dt);
}
catch(ParseException e) {
throw new ErrorCodeAwareException(e, ErrorCodes.INVALID_DATE, source[1]);
}
qt.setCategory(null);
qt.setCurrency(source[21]);
qt.setPartnerName(source[3]);
qt.setText(buildText(source));
try {
Date dt = sdf.parse(source[2]);
qt.setValueDate(dt);
}
catch(ParseException e) {
throw new ErrorCodeAwareException(e, ErrorCodes.INVALID_DATE, source[2]);
}
if(log.isDebugEnabled()) {
log.debug("<< qt = " + qt);
}
return qt;
}
private void stripQuotations(String[] source) {
for(int i = 0; i < source.length; i++) {
source[i] = source[i].trim();
if (source[i].startsWith("\"") && source[i].endsWith("\"")) {
source[i] = source[i].substring(1, source[i].length() - 1);
}
}
}
private String buildText(String[] source) {
StringBuilder sb = new StringBuilder();
for(int i = 4; i < 19; i++) {
if(!StringUtils.isEmpty(source[i])) {
sb.append(source[i]).append(SPACE);
}
}
return sb.substring(0, sb.length() - 1);
}
}
| [
"barny2k6@ec931204-931c-ff9b-6e38-e379690be952"
] | barny2k6@ec931204-931c-ff9b-6e38-e379690be952 |
14dcf153ef2d725f8c6b3a5a5653e288ecf1e3a9 | 47d62992450e59b057ff79b722319214327486f6 | /Ebook-ProgJava9e/src/chap26_Servlet_JSP/PointBean.java | d81a31a1cac6a46e5a5399289ef4be326c798735 | [] | no_license | egzontina/JavaSE-Demo | 1cc7fe5d930f7a5e0bcf93f0518ef506d734e57e | f983e0e61e3afbb876bf63a88034ac65dcd4c7c6 | refs/heads/master | 2020-04-01T07:55:44.314925 | 2016-10-15T12:55:52 | 2016-10-15T12:55:52 | 153,010,125 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package chap26_Servlet_JSP;
public class PointBean {
public PointBean() {
abs = 0;
ord = 0;
}
public int getAbs() {
return abs;
}
public int getOrd() {
return ord;
}
public void setAbs(int abs) {
this.abs = abs;
}
public void setOrd(int ord) {
this.ord = ord;
}
public double getNorme() {
return Math.sqrt(abs * abs + ord * ord);
}
private int abs, ord;
}
| [
"diop-malick@hotmail.fr"
] | diop-malick@hotmail.fr |
689a8015de7f75ca034d64863a9516f2a8725d87 | 6ba29e5555bfb424b9fc9c46a1bdb65d1f2ec016 | /New folder (2)/src/main/java/com/cognizan/truyum/controller/MenuItemController.java | 712e9d1b234f1422ac482e0fc9861671ba61ea81 | [] | no_license | Amitvikram787/restwith_jpa | 52a86ad66428e143bdd65f7e74177f890f24457d | 4c56eb1cec972e61693b771172180693901f5b72 | refs/heads/master | 2020-09-17T00:26:32.843264 | 2019-12-21T12:07:26 | 2019-12-21T12:07:26 | 223,931,537 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,571 | java | package com.cognizan.truyum.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cognizan.truyum.TruyumConstants;
import com.cognizan.truyum.model.MenuItem;
import com.cognizan.truyum.security.AppUserDetailsService;
import com.cognizan.truyum.service.MenuItemService;
@RestController
@RequestMapping("/menu-items")
public class MenuItemController {
public static Logger LOGGER= LoggerFactory.getLogger(MenuItemController.class);
@Autowired
AppUserDetailsService appUserDetailsService;
@Autowired
private MenuItemService menuItemService;
@GetMapping
public List<MenuItem> getAllMenuItems()
{
LOGGER.debug("Inside All Menu items");
List<MenuItem> menuItemList;
Authentication authentication=SecurityContextHolder.getContext().getAuthentication();
String user=authentication.getName();
LOGGER.debug("Username "+ user);
if(user !="anonymousUser")
{
UserDetails userDetails= appUserDetailsService.loadUserByUsername(user);
LOGGER.debug("userdatails"+ userDetails);
String role = userDetails.getAuthorities().toArray()[0].toString();
TruyumConstants.LOGGER.debug("Role"+ role);
if(role.equals("ADMIN"))
{
LOGGER.debug("Inside Menu ItemList Admin get");
menuItemList=menuItemService.getMenuItemListAdmin();
}
else
{
LOGGER.debug("Inside Menu ItemList Customer get");
menuItemList=menuItemService.getMenuItemListCustomer();
}
}
else
{
LOGGER.debug("Inside Menu ItemList customer get");
menuItemList=menuItemService.getMenuItemListCustomer();
}
return menuItemList;
}
@GetMapping("/{id}")
public MenuItem getMenuItem(@PathVariable long id)
{
return menuItemService.getMenuItem(id);
}
@PutMapping
public void modifyMenuItem(@RequestBody MenuItem menuItem)
{
menuItemService.modifyMenuItem(menuItem);
}
}
| [
"amit.kumar360ad5@cognizant.com"
] | amit.kumar360ad5@cognizant.com |
15d02cea021eb7f54db4ca4098f61e084c73e31a | 7252791ef3897cb3cd057f9e9d301d0a5b78a113 | /src/main/java/com/comdata/backend/comdatapointage/security/SecurityConstants.java | 994219b5519ffb3612b7a7063dce9af87b1420d3 | [] | no_license | taimourya/ComdataBackend | 5ccef36a2457f6a89686c6cab0ee959580c9a21f | a556b4808c9bc29f7662b2a8bed52e2ee67db8d0 | refs/heads/main | 2023-09-01T00:38:00.582147 | 2021-10-15T14:38:37 | 2021-10-15T14:38:37 | 399,868,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package com.comdata.backend.comdatapointage.security;
public class SecurityConstants {
public static final long EXPIRATION_TIME = 864000000; // 10 days
public static final String TOKEN_PREFIX = "Bearer " ;
public static final String HEADER_STRING = "Authorization" ;
public static final String TOKEN_SECRET = "dfg893hjdj-dhjfkgu_jjdjnv?sjjs=r0zhgjf0-9" ;
}
| [
"taimouriya@gmail.com"
] | taimouriya@gmail.com |
2bf1373e531fc376508828bcaa43ff18d9571ee0 | fa00182b4e3c8bb412d14538c86fc42b4be49e2e | /app/src/main/java/Utilidades/variables.java | 11160b5c06382e27a277bf1be89bd86f1bfee8cb | [] | no_license | herdumundo/Estancia_recuento | 9f8381c6c9fdb4bcde9d65597175de251a230e2a | fabc723407fd3bfe43d45bebe79d3da580682227 | refs/heads/master | 2023-06-30T06:57:34.035285 | 2021-08-04T22:40:12 | 2021-08-04T22:40:12 | 385,329,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package Utilidades;
public class variables {
public static String userdb;
public static String idUsuario;
public static String NOMBRE_LOGIN;
}
| [
"hernanjose86@hotmail.com"
] | hernanjose86@hotmail.com |
87a73fea029a78593c4ab7282e71f6189df7f985 | 9b8aaf3bf7a788f19266cbfd3b2955e14241a917 | /igor.krikunov/homework/calc/console_calc_v0.6/console_calc_v0.6/src/com/igor2i/calc/methods/matrix/MatrixFunction.java | 25c8f97d35bfab35ec299cb8e85769832cace010 | [] | no_license | m91snik/java_lessons | de4eba69d40f8998279c67e67a5f54800ffc2072 | e3028a8a7f25a56e13a9d94e2511d4298379f819 | refs/heads/master | 2020-05-26T06:13:48.987946 | 2015-12-21T16:56:38 | 2015-12-21T16:56:38 | 37,031,396 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,322 | java | package com.igor2i.calc.methods.matrix;
import jdk.nashorn.internal.ir.annotations.Immutable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Created by igor2i on 23.07.15.
*/
enum MatrixFunction {
SUMM("+") {
@Override
protected double[][] set(List<List<Double>> inArr1, List<List<Double>> inArr2) {
int max[] = maxLenght(inArr1, inArr2);
double[][] outDoub = new double[max[0]][max[1]];
for (int i = 0; i < inArr1.size(); i++) {
for (int n = 0; n < inArr1.get(i).size(); n++) {
outDoub[i][n] = inArr1.get(i).get(n) + inArr2.get(i).get(n);
}
}
return outDoub;
}
},
MULT("*") {
@Override
protected double[][] set(List<List<Double>> inArr1, List<List<Double>> inArr2) {
int max[] = maxLenght(inArr1, inArr2);
double[][] outDoub = new double[max[0]][max[1]];
for (int i = 0; i < inArr1.size(); i++) {
for (int j = 0; j < inArr1.get(i).size(); j++) {
double s = 0;
for (int k = 0; k < inArr1.size(); k++) {
s += inArr1.get(i).get(k) * inArr2.get(k).get(j);
}
outDoub[i][j] = s;
}
}
return outDoub;
}
},
SUBTR("-") {
@Override
protected double[][] set(List<List<Double>> inArr1, List<List<Double>> inArr2) {
int max[] = maxLenght(inArr1, inArr2);
double[][] outDoub = new double[max[0]][max[1]];
for (int i = 0; i < inArr1.size(); i++) {
for (int n = 0; n < inArr1.get(i).size(); n++) {
outDoub[i][n] = inArr1.get(i).get(n) - inArr2.get(i).get(n);
}
}
return outDoub;
}
},
TRANS("%") {
@Override
protected double[][] set(List<List<Double>> inArr1) {
double[][] temp = new double[inArr1.get(0).size()][inArr1.size()];
for (int i = 0; i < inArr1.size(); i++)
for (int j = 0; j < inArr1.get(0).size(); j++)
temp[j][i] = inArr1.get(i).get(j);
return temp;
}
};
String sim;
MatrixFunction(String sim) {
this.sim = sim;
}
protected String getSim() {
return sim;
}
protected double[][] set(List<List<Double>> inArr1, List<List<Double>> inArr2) {
double nul[][] = {{0}};
return nul;
}
protected double[][] set(List<List<Double>> inArr1){
double nul[][] = {{0}};
return nul;
}
protected int[] maxLenght(List<List<Double>> inArr1, List<List<Double>> inArr2) {
int max[] = new int[2];
if (inArr1.size() > inArr2.size()) {
max[0] = inArr1.size();
} else {
max[0] = inArr2.size();
}
max[1] = 0;
for (List<Double> sip : inArr1) {
if (sip.size() > max[1]) {
max[1] = sip.size();
}
}
for (List<Double> sip : inArr2) {
if (sip.size() > max[1]) {
max[1] = sip.size();
}
}
return max;
}
}
| [
"igor2i.mail@gmail.com"
] | igor2i.mail@gmail.com |
0fb49e21b00f8dcc2546042e65baf64bda0356e9 | e1931dcb2c10c8ea6c3b69fb9fb06ab057f256af | /UIScrollPicture/android/UIScrollPicture/src/com/uzmap/pkg/uzmodules/uzUIScrollPicture/MainLayout.java | 5db55184d123f8f3ea17130e881a855267f1c78a | [
"MIT"
] | permissive | Zhangm1nlong/APICloud-Modules | 5ea0ce70b2ee44d297a080fbd540c9402f829ddf | f43a0528e261149cafeae035e8111228b2a3beb5 | refs/heads/master | 2021-10-26T10:56:07.533912 | 2021-10-25T07:58:24 | 2021-10-25T07:58:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | package com.uzmap.pkg.uzmodules.uzUIScrollPicture;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.MotionEvent;
import android.widget.RelativeLayout;
public class MainLayout extends RelativeLayout {
@SuppressLint("NewApi")
public MainLayout(Context context) {
super(context);
}
}
| [
"1170717506@qq.com"
] | 1170717506@qq.com |
dd6f8988ee9c51b061f3a1be85907aa9801dab82 | 3c8ce798d404299e811ca82210d442f7bee16ae4 | /Model/Aresta.java | 0177530cbbb0dfe3283ba7da0f011c66c5414bae | [] | no_license | marimgabi/trabCG | 84a2610c89003cdbdbf849ac7414da78173176bc | ea0bb1096c95eac33bc42f00103e5ed81e2ada1e | refs/heads/master | 2020-07-16T04:43:18.579354 | 2019-11-29T19:29:45 | 2019-11-29T19:29:45 | 205,722,017 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 970 | java | package Model;
import java.io.Serializable;
public class Aresta implements Serializable {
private Vertice ini;
private Vertice fim;
private Poligono pai1;
private Poligono pai2;
public Aresta() {
}
public Aresta(Vertice ini, Vertice fim) {
this.ini = ini;
this.fim = fim;
}
public Vertice getIni() {
return ini;
}
public void setIni(Vertice ini) {
this.ini = ini;
}
public Vertice getFim() {
return fim;
}
public void setFim(Vertice fim) {
this.fim = fim;
}
public Poligono getPai1() {
return pai1;
}
public void setPai1(Poligono pai1) {
this.pai1 = pai1;
}
public Poligono getPai2() {
return pai2;
}
public void setPai2(Poligono pai2) {
this.pai2 = pai2;
}
public boolean alreadyExist(Vertice a, Vertice b){
return(((a==ini)&&(b==fim))||((a==fim)&&(b==ini)));
}
}
| [
"gabimarim06@gmail.com"
] | gabimarim06@gmail.com |
08b6b4b165db5f62963466cad24e2cfab823d646 | 00571e7c7b5ffd914e05c40d5ff2e1e865a5f777 | /app/src/main/java/com/example/helloword/BannerFragment.java | 80243497bdecc9f31d242abae56f490357f7bbb6 | [] | no_license | Alacazar99/Android_Demo | 54d38c228f73817e1c7983577c130be2bb5bad92 | af4685a542005c9fcec735f793b937ff7603d240 | refs/heads/master | 2023-03-01T16:46:19.351678 | 2021-02-09T01:37:28 | 2021-02-09T01:37:28 | 337,261,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,348 | java | package com.example.helloword;
import android.media.Image;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
/**
* A simple {@link Fragment} subclass.
* Use the {@link BannerFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class BannerFragment extends Fragment {
private int imgRes;
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public BannerFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment BannerFragment.
*/
// TODO: Rename and change types and number of parameters
public static BannerFragment newInstance(String param1, String param2) {
BannerFragment fragment = new BannerFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View inflate = inflater.inflate(R.layout.fragment_banner, container, false);
ImageView iv_banner = inflate.findViewById(R.id.iv_banner);
iv_banner.setImageResource(imgRes);
return inflate;
}
public void serImage(int imgRes){
this.imgRes = imgRes;
}
}
| [
"11788248080@qq.com"
] | 11788248080@qq.com |
67fd98caf15e909748ee1546102103de1de5786f | 0f97f26dcbd81cec5c563abea9acbaf19b42da8a | /app/src/main/java/com/project/loginandregistration/Splashscreen.java | 87cf6a2a60923f273d6aac391850c438228b3cc6 | [] | no_license | maunak/Society1 | 89563aab5c822d6ed7136200969033554567f557 | f66f48f004bad09fee7981406e95f95faacb9a3a | refs/heads/master | 2023-07-14T16:00:00.870230 | 2021-08-08T18:00:12 | 2021-08-08T18:00:12 | 394,033,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,021 | java | package com.project.loginandregistration;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Pair;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
public class Splashscreen extends AppCompatActivity {
private static int SPLASH_SCREEN = 3000;
Animation topAnimation,bottomAnimation;
ImageView image;
TextView logo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_splashscreen);
topAnimation = AnimationUtils.loadAnimation(this,R.anim.top_animation);
bottomAnimation = AnimationUtils.loadAnimation(this,R.anim.bottom_animation);
image = findViewById(R.id.imageView2);
logo = findViewById(R.id.textView2);
image.setAnimation(topAnimation);
logo.setAnimation(bottomAnimation);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(Splashscreen.this,MainActivity.class);
Pair[] pairs = new Pair[2];
pairs[0] = new Pair<View,String>(image,"logo_image");
pairs[1] = new Pair<View,String>(logo,"logo_text");
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(Splashscreen.this,pairs);
startActivity(intent,options.toBundle());
finish();
}
}
},SPLASH_SCREEN);
}
} | [
"maunakelse@gmail.com"
] | maunakelse@gmail.com |
a78f329e2f7be8c0e64d36815c3b40fec6b7e4f8 | b6bd9bc4464b8757cd5eef78d372fd63dfc8882d | /app/src/main/java/com/example/maiajam/medcinealram/util/reciver/BootReciver.java | bb63dc4c0d220c50a7173a1af9c678d19e29e268 | [] | no_license | regina-rombangok/medicine-alarm | c345ea09df70c725e34c4d68d9bcac367dc5bc46 | f18c7075e25e4c246f37754f9dc15e709ca8dd8e | refs/heads/main | 2023-01-06T10:11:09.514347 | 2020-10-30T10:17:09 | 2020-10-30T10:17:09 | 308,381,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 971 | java | package com.example.maiajam.medcinealram.util.reciver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import com.example.maiajam.medcinealram.helper.HelperMethodes;
import com.example.maiajam.medcinealram.util.AlarmService;
import static com.example.maiajam.medcinealram.helper.HelperMethodes.getAllMedicneFromDbAndRefireAlarms;
public class BootReciver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Intent startServiceIntent = new Intent(context, AlarmService.class);
// context.startService(startServiceIntent);
checkIfForBootCompleted(context,intent);
}
private void checkIfForBootCompleted(Context context, Intent intent) {
if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
{
getAllMedicneFromDbAndRefireAlarms(context);
}
}
}
| [
"regina.rombangok@gmail.com"
] | regina.rombangok@gmail.com |
b89beb8c1c0f61c58d0b20a23da85525a41fc92e | c0d85b7c87da724f06d276e64bfe5ff479d7a8d7 | /rMall/Dao/src/main/java/ecommerce/rmall/dao/DaoSupport.java | f71648fc7228266333913240c3ddb56beedac00c | [] | no_license | CapricornZ/RunningMall | 6324f43709631aa6559306f21c0414b1ad8ee6e3 | d6f48467af3626ad420b5ea2f8ea41f00ccbc386 | refs/heads/master | 2021-01-16T21:19:50.380134 | 2015-02-25T07:46:31 | 2015-02-25T07:46:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,427 | java | package ecommerce.rmall.dao;
import static org.hibernate.criterion.Restrictions.eq;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
public class DaoSupport {
@Resource(name="sessionFactory")
private SessionFactory sessionFactory;
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
protected Session getSession() {
return sessionFactory.getCurrentSession();
}
protected void save(Object obj) {
getSession().save(obj);
}
@SuppressWarnings("unchecked")
protected <T> T get(Class<T> clazz, Integer id) {
return (T) getSession().get(clazz, id);
}
@SuppressWarnings("unchecked")
protected <T> List<T> findByProperty(Class<T> clazz, String property, Object value) {
return getSession().createCriteria(clazz).add(eq(property, value)).list();
}
@SuppressWarnings("unchecked")
protected <T> List<T> findAll(Class<T> clazz) {
return getSession().createCriteria(clazz).list();
}
protected void update(Object obj) {
getSession().update(obj);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void delete(Class clazz, Integer id) {
getSession().delete(get(clazz, id));
}
protected void delete(Object obj) {
getSession().delete(obj);
}
} | [
"martin@martin-ThinkPad"
] | martin@martin-ThinkPad |
a2eaba7e58bcfc4efd80de5598df0e4c75b064d3 | 5d82ecff74135e01be9e98979e3399b5787db021 | /src/util/ASTNodeHeightCalculator.java | f80951f9ff3a3534cc1ba1c4aaaf1d5784d6c64f | [] | no_license | sharpFix18/sharpFix | bc26e77beb3a2b9c031dda5e2964815bdd8e5a5a | 1ae7e4b56f5e3eaee904bd72520efaadf3fddf12 | refs/heads/master | 2021-03-31T02:05:48.705608 | 2019-06-24T00:34:26 | 2019-06-24T00:34:26 | 124,471,884 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 20,655 | java | package sharpfix.util;
import org.eclipse.jdt.core.dom.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;
public class ASTNodeHeightCalculator
{
private static int LARGE_HEIGHT = 1000;
public static int calculate(ASTNode node) {
if (node == null) { return 0; }
if (node instanceof AnonymousClassDeclaration) {
return calculate((AnonymousClassDeclaration) node);
}
else if (node instanceof BodyDeclaration) {
return calculate((BodyDeclaration) node);
}
else if (node instanceof CatchClause) {
return calculate((CatchClause) node);
}
else if (node instanceof CompilationUnit) {
return calculate((CompilationUnit) node);
}
else if (node instanceof Expression) {
return calculate((Expression) node);
}
else if (node instanceof ImportDeclaration) {
return calculate((ImportDeclaration) node);
}
else if (node instanceof PackageDeclaration) {
return calculate((PackageDeclaration) node);
}
else if (node instanceof Statement) {
return calculate((Statement) node);
}
else if (node instanceof Type) {
return calculate((Type) node);
}
else if (node instanceof VariableDeclaration) {
return calculate((VariableDeclaration) node);
}
else {
return 1;
}
}
public static int calculate(AnonymousClassDeclaration acd) {
if (acd == null) { return 0; }
int height = 0;
List body_decl_obj_list = acd.bodyDeclarations();
for (Object body_decl_obj : body_decl_obj_list) {
int height0 = calculate((BodyDeclaration) body_decl_obj);
if (height0 > height) {
height = height0;
}
}
return height + 1;
}
public static int calculate(BodyDeclaration bd) {
if (bd == null) { return 0; }
if (bd instanceof AbstractTypeDeclaration) {
return LARGE_HEIGHT;
} else if (bd instanceof AnnotationTypeMemberDeclaration) {
return LARGE_HEIGHT;
} else if (bd instanceof MethodDeclaration) {
return calculate((MethodDeclaration) bd);
} else if (bd instanceof FieldDeclaration) {
return calculate((FieldDeclaration) bd);
} else if (bd instanceof Initializer) {
return calculate((Initializer) bd);
} else if (bd instanceof EnumConstantDeclaration) {
return LARGE_HEIGHT;
} else {
return LARGE_HEIGHT;
}
}
public static int calculate(CompilationUnit cu) {
if (cu == null) { return 0; }
return LARGE_HEIGHT;
}
public static int calculate(MethodDeclaration md) {
if (md == null) { return 0; }
int h0 = calculateSVDList(md.parameters());
int h1 = calculate(md.getBody());
int h2 = calculate(md.getReturnType2());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(FieldDeclaration fd) {
if (fd == null) { return 0; }
int h0 = calculateVDFList(fd.fragments());
int h1 = calculate(fd.getType());
return (h0 >= h1) ? h0 : h1;
}
public static int calculate(Initializer init) {
if (init == null) { return 0; }
return calculate(init.getBody());
}
public static int calculate(CatchClause cc) {
if (cc == null) { return 0; }
int arg_height = calculate(cc.getException());
int body_height = calculate(cc.getBody());
return (arg_height >= body_height) ? arg_height+1 : body_height+1;
}
public static int calculate(Expression exp) {
if (exp == null) { return 0; }
if (exp instanceof Annotation) {
return 1;
}
else if (exp instanceof ArrayAccess) {
return calculate((ArrayAccess) exp);
}
else if (exp instanceof ArrayCreation) {
return calculate((ArrayCreation) exp);
}
else if (exp instanceof ArrayInitializer) {
return calculate((ArrayInitializer) exp);
}
else if (exp instanceof Assignment) {
return calculate((Assignment) exp);
}
else if (exp instanceof BooleanLiteral) {
return 1;
}
else if (exp instanceof CastExpression) {
return calculate((CastExpression) exp);
}
else if (exp instanceof CharacterLiteral) {
return 1;
}
else if (exp instanceof ClassInstanceCreation) {
return calculate((ClassInstanceCreation) exp);
}
else if (exp instanceof ConditionalExpression) {
return calculate((ConditionalExpression) exp);
}
else if (exp instanceof FieldAccess) {
return calculate((FieldAccess) exp);
}
else if (exp instanceof InfixExpression) {
return calculate((InfixExpression) exp);
}
else if (exp instanceof InstanceofExpression) {
return calculate((InstanceofExpression) exp);
}
else if (exp instanceof MethodInvocation) {
return calculate((MethodInvocation) exp);
}
else if (exp instanceof Name) {
return calculate((Name) exp);
}
else if (exp instanceof NullLiteral) {
return 1;
}
else if (exp instanceof NumberLiteral) {
return 1;
}
else if (exp instanceof ParenthesizedExpression) {
return calculate((ParenthesizedExpression) exp);
}
else if (exp instanceof PostfixExpression) {
return calculate((PostfixExpression) exp);
}
else if (exp instanceof PrefixExpression) {
return calculate((PrefixExpression) exp);
}
else if (exp instanceof StringLiteral) {
return 1;
}
else if (exp instanceof SuperFieldAccess) {
return calculate((SuperFieldAccess) exp);
}
else if (exp instanceof SuperMethodInvocation) {
return calculate((SuperMethodInvocation) exp);
}
else if (exp instanceof ThisExpression) {
return calculate((ThisExpression) exp);
}
else if (exp instanceof TypeLiteral) {
return calculate((TypeLiteral) exp);
}
else if (exp instanceof VariableDeclarationExpression) {
return calculate((VariableDeclarationExpression) exp);
}
else {
return 1;
}
}
public static int calculate(ImportDeclaration id) {
if (id == null) { return 0; }
return 1;
}
public static int calculate(PackageDeclaration pd) {
if (pd == null) { return 0; }
return 1;
}
public static int calculate(Statement stmt) {
if (stmt == null) { return 0; }
if (stmt instanceof AssertStatement) {
return calculate((AssertStatement) stmt);
}
else if (stmt instanceof Block) {
return calculate((Block) stmt);
}
else if (stmt instanceof BreakStatement) {
return calculate((BreakStatement) stmt);
}
else if (stmt instanceof ConstructorInvocation) {
return calculate((ConstructorInvocation) stmt);
}
else if (stmt instanceof ContinueStatement) {
return calculate((ContinueStatement) stmt);
}
else if (stmt instanceof DoStatement) {
return calculate((DoStatement) stmt);
}
else if (stmt instanceof EmptyStatement) {
return 0;
}
else if (stmt instanceof EnhancedForStatement) {
return calculate((EnhancedForStatement) stmt);
}
else if (stmt instanceof ExpressionStatement) {
ExpressionStatement es = (ExpressionStatement) stmt;
return calculate(es.getExpression());
}
else if (stmt instanceof ForStatement) {
return calculate((ForStatement) stmt);
}
else if (stmt instanceof IfStatement) {
return calculate((IfStatement) stmt);
}
else if (stmt instanceof LabeledStatement) {
return calculate((LabeledStatement) stmt);
}
else if (stmt instanceof ReturnStatement) {
return calculate((ReturnStatement) stmt);
}
else if (stmt instanceof SuperConstructorInvocation) {
return calculate((SuperConstructorInvocation) stmt);
}
else if (stmt instanceof SwitchCase) {
return calculate((SwitchCase) stmt);
}
else if (stmt instanceof SwitchStatement) {
return calculate((SwitchStatement) stmt);
}
else if (stmt instanceof SynchronizedStatement) {
return calculate((SynchronizedStatement) stmt);
}
else if (stmt instanceof ThrowStatement) {
return calculate((ThrowStatement) stmt);
}
else if (stmt instanceof TryStatement) {
return calculate((TryStatement) stmt);
}
else if (stmt instanceof TypeDeclarationStatement) {
return calculate((TypeDeclarationStatement) stmt);
}
else if (stmt instanceof VariableDeclarationStatement) {
return calculate((VariableDeclarationStatement) stmt);
}
else if (stmt instanceof WhileStatement) {
return calculate((WhileStatement) stmt);
}
else {
return 1;
}
}
public static int calculate(Type type) {
if (type == null) { return 0; }
if (type.isArrayType()) {
ArrayType at = (ArrayType) type;
//return calculate(at.getComponentType()) + 1; //Deprecated after JLS4.
return calculate(at.getElementType()) + at.dimensions().size();
}
else if (type.isParameterizedType()) {
ParameterizedType pt = (ParameterizedType) type;
return calculate(pt.getType());
}
else if (type.isPrimitiveType()) {
return 1;
}
else if (type.isQualifiedType()) {
QualifiedType qt = (QualifiedType) type;
int h0 = calculate(qt.getQualifier());
int h1 = calculate(qt.getName());
return (h0 >= h1) ? h0 : h1;
//return calculate((QualifiedType) type);
}
else if (type.isSimpleType()) {
return 1;
}
else if (type.isUnionType()) {
return 1;
}
else if (type.isWildcardType()) {
return 1;
}
else {
return 1;
}
}
public static int calculate(VariableDeclaration vd) {
if (vd == null) { return 0; }
if (vd instanceof SingleVariableDeclaration) {
return calculate((SingleVariableDeclaration) vd);
}
else if (vd instanceof VariableDeclarationFragment){
return calculate((VariableDeclarationFragment) vd);
}
else {
return 1;
}
}
public static int calculate(SingleVariableDeclaration svd) {
if (svd == null) { return 0; }
int h0 = calculate(svd.getType());
int h1 = calculate(svd.getName());
int h2 = calculate(svd.getInitializer());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(VariableDeclarationFragment vdf) {
if (vdf == null) { return 0; }
int h0 = calculate(vdf.getName());
int h1 = calculate(vdf.getInitializer());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(ArrayAccess aa) {
if (aa == null) { return 0; }
int h0 = calculate(aa.getArray());
int h1 = calculate(aa.getIndex());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(ArrayCreation ac) {
if (ac == null) { return 0; }
int h0 = calculate(ac.getType());
int h1 = calculate(ac.getInitializer());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(ArrayInitializer ai) {
if (ai == null) { return 0; }
List exp_list = ai.expressions();
return calculateExpList(exp_list);
}
public static int calculate(Assignment assign) {
if (assign == null) { return 0; }
int h0 = calculate(assign.getLeftHandSide());
int h1 = 1;
int h2 = calculate(assign.getRightHandSide());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(BooleanLiteral bl) {
if (bl == null) { return 0; }
return 1;
}
public static int calculate(CastExpression ce) {
if (ce == null) { return 0; }
int h0 = calculate(ce.getType());
int h1 = calculate(ce.getExpression());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(CharacterLiteral cl) {
if (cl == null) { return 0; }
return 1;
}
public static int calculate(ClassInstanceCreation cic) {
if (cic == null) { return 0; }
int h0 = calculate(cic.getType());
int h1 = calculate(cic.getExpression());
int h2 = calculate(cic.getAnonymousClassDeclaration());
int h3 = calculateExpList(cic.arguments());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
h = (h >= h3) ? h : h3;
return h + 1;
}
public static int calculate(ConditionalExpression ce) {
if (ce == null) { return 0; }
int h0 = calculate(ce.getElseExpression());
int h1 = calculate(ce.getExpression());
int h2 = calculate(ce.getThenExpression());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(FieldAccess fa) {
if (fa == null) { return 0; }
int h0 = calculate(fa.getExpression());
int h1 = calculate(fa.getName());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(InfixExpression ie) {
if (ie == null) { return 0; }
int h0 = calculate(ie.getLeftOperand());
int h1 = 1;
int h2 = calculate(ie.getRightOperand());
int h3 = calculateExpList(ie.extendedOperands());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
h = (h >= h3) ? h : h3;
return h+1;
}
public static int calculate(InstanceofExpression ie) {
if (ie == null) { return 0; }
int h0 = calculate(ie.getLeftOperand());
int h1 = calculate(ie.getRightOperand());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(MethodInvocation mi) {
if (mi == null) { return 0; }
int h0 = calculate(mi.getExpression());
int h1 = calculate(mi.getName());
int h2 = calculateExpList(mi.arguments());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(Name name) {
if (name == null) { return 0; }
if (name.isSimpleName()) {
return calculate((SimpleName) name);
}
else if (name.isQualifiedName()) {
return calculate((QualifiedName) name);
}
else {
return 1;
}
}
public static int calculate(NullLiteral nl) {
if (nl == null) { return 0; }
return 1;
}
public static int calculate(NumberLiteral nl) {
if (nl == null) { return 0; }
return 1;
}
public static int calculate(ParenthesizedExpression pe) {
if (pe == null) { return 0; }
return calculate(pe.getExpression()) + 1;
}
public static int calculate(PostfixExpression pe) {
if (pe == null) { return 0; }
return calculate(pe.getOperand()) + 1;
}
public static int calculate(PrefixExpression pe) {
if (pe == null) { return 0; }
return calculate(pe.getOperand()) + 1;
}
public static int calculate(StringLiteral sl) {
if (sl == null) { return 0; }
return 1;
}
public static int calculate(SuperFieldAccess sfa) {
if (sfa == null) { return 0; }
int h0 = calculate(sfa.getName());
int h1 = calculate(sfa.getQualifier());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(SuperMethodInvocation smi) {
if (smi == null) { return 0; }
int h0 = calculate(smi.getName());
int h1 = calculate(smi.getQualifier());
int h2 = calculateExpList(smi.arguments());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(ThisExpression te) {
if (te == null) { return 0; }
int h0 = calculate(te.getQualifier());
return h0+1;
}
public static int calculate(TypeLiteral tl) {
if (tl == null) { return 0; }
int h0 = calculate(tl.getType());
return h0+1;
}
public static int calculate(VariableDeclarationExpression vde) {
if (vde == null) { return 0; }
int h0 = calculateVDFList(vde.fragments());
int h1 = calculate(vde.getType());
return (h0 >= h1) ? h0 : h1; //No plus one!!!
}
public static int calculate(SimpleName sname) {
if (sname == null) { return 0; }
return 1;
}
public static int calculate(QualifiedName qname) {
if (qname == null) { return 0; }
int h0 = calculate(qname.getQualifier());
int h1 = calculate(qname.getName());
return (h0 >= h1) ? h0 : h1; //No plus 1!!!
}
public static int calculate(AssertStatement as) {
if (as == null) { return 0; }
return calculate(as.getExpression()) + 1;
}
public static int calculate(Block block) {
if (block == null) { return 0; }
return calculateStmtList(block.statements()); //NO plus one!!!
}
public static int calculate(BreakStatement bs) {
if (bs == null) { return 0; }
return calculate(bs.getLabel()) + 1;
}
public static int calculate(ConstructorInvocation ci) {
if (ci == null) { return 0; }
return calculateExpList(ci.arguments()) + 1;
}
public static int calculate(ContinueStatement cs) {
if (cs == null) { return 0; }
return calculate(cs.getLabel()) + 1;
}
public static int calculate(DoStatement ds) {
if (ds == null) { return 0; }
int h0 = calculate(ds.getBody());
int h1 = calculate(ds.getExpression());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(EnhancedForStatement efs) {
if (efs == null) { return 0; }
int h0 = calculate(efs.getParameter());
int h1 = calculate(efs.getExpression());
int h2 = calculate(efs.getBody());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(ForStatement fs) {
if (fs == null) { return 0; }
int h0 = calculateExpList(fs.initializers());
int h1 = calculate(fs.getExpression());
int h2 = calculateExpList(fs.updaters());
int h3 = calculate(fs.getBody());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
h = (h >= h3) ? h : h3;
return h+1;
}
public static int calculate(IfStatement is) {
if (is == null) { return 0; }
int h0 = calculate(is.getExpression());
int h1 = calculate(is.getThenStatement());
int h2 = calculate(is.getElseStatement());
int h = (h0 >= h1) ? h0 : h1;
h = (h >= h2) ? h : h2;
return h+1;
}
public static int calculate(LabeledStatement ls) {
if (ls == null) { return 0; }
int h0 = calculate(ls.getLabel());
int h1 = calculate(ls.getBody());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(ReturnStatement rs) {
if (rs == null) { return 0; }
return calculate(rs.getExpression()) + 1;
}
public static int calculate(SuperConstructorInvocation sci) {
if (sci == null) { return 0; }
int h0 = calculate(sci.getExpression());
int h1 = calculateExpList(sci.arguments());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(SwitchCase sc) {
if (sc == null) { return 0; }
if (sc.isDefault()) { return 1; }
else { return calculate(sc.getExpression()) + 1; }
}
public static int calculate(SwitchStatement ss) {
if (ss == null) { return 0; }
int h0 = calculate(ss.getExpression());
int h1 = calculateStmtList(ss.statements());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(SynchronizedStatement ss) {
if (ss == null) { return 0; }
int h0 = calculate(ss.getExpression());
int h1 = calculate(ss.getBody());
return (h0 >= h1) ? h0+1 : h1+1;
}
public static int calculate(ThrowStatement ts) {
if (ts == null) { return 0; }
return calculate(ts.getExpression()) + 1;
}
public static int calculate(TryStatement ts) {
if (ts == null) { return 0; }
int h = calculate(ts.getBody());
List cc_list = ts.catchClauses();
for (Object cc_obj : cc_list) {
CatchClause cc = (CatchClause) cc_obj;
int h0 = calculate(cc);
if (h < h0) {
h = h0;
}
}
int h0 = calculate(ts.getFinally());
if (h < h0) {
h = h0;
}
return h+1;
}
public static int calculate(TypeDeclarationStatement tds) {
if (tds == null) { return 0; }
return LARGE_HEIGHT;
}
public static int calculate(VariableDeclarationStatement vds) {
if (vds == null) { return 0; }
int h0 = calculate(vds.getType());
int h1 = calculateVDFList(vds.fragments());
return (h0 >= h1) ? h0 : h1; //No plus one!!!
}
public static int calculate(WhileStatement ws) {
if (ws == null) { return 0; }
int h0 = calculate(ws.getExpression());
int h1 = calculate(ws.getBody());
return (h0 >= h1) ? h0+1 : h1+1;
}
private static int calculateSVDList(List svd_list) {
int height = 0;
for (Object svd_obj : svd_list) {
SingleVariableDeclaration svd = (SingleVariableDeclaration) svd_obj;
int height0 = calculate(svd);
if (height0 > height) {
height = height0;
}
}
return height;
}
private static int calculateVDFList(List vdf_list) {
int height = 0;
for (Object fragment : vdf_list) {
VariableDeclarationFragment vdf = (VariableDeclarationFragment) fragment;
int height0 = calculate(vdf);
if (height0 > height) {
height = height0;
}
}
return height;
}
private static int calculateExpList(List exp_list) {
int height = 0;
for (Object exp_obj : exp_list) {
Expression exp = (Expression) exp_obj;
int height0 = calculate(exp);
if (height0 > height) {
height = height0;
}
}
return height;
}
private static int calculateStmtList(List stmt_list) {
int height = 0;
for (Object stmt_obj : stmt_list) {
Statement stmt = (Statement) stmt_obj;
int height0 = calculate(stmt);
if (height0 > height) {
height = height0;
}
}
return height;
}
}
| [
"qi_xin@yahoo.com"
] | qi_xin@yahoo.com |
e891b509fa0870c43c9b5d1ae4dde98626482560 | 7e74f8e6cf410c476b822b4ca362587fbaa341a1 | /app/src/main/java/com/app/discovergolf/Activity/ScorePopup.java | c90bfc47787e8a33206bb41984d0c740b2cc0b15 | [] | no_license | nisargtrivedi/GolfApp | ecd6d8b3b72297021c92c282c6428019755de933 | ba6e13fcca904f2e9d629d708537ed0d90104f5b | refs/heads/main | 2023-01-08T16:13:09.345463 | 2020-11-10T06:49:16 | 2020-11-10T06:49:16 | 311,570,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 479 | java | package com.app.discovergolf.Activity;
import android.support.v7.widget.RecyclerView;
import com.app.discovergolf.R;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
@EActivity(R.layout.popup_window)
public class ScorePopup extends BaseActivity {
@ViewById
RecyclerView rv_scores;
@AfterViews
public void init() {
loadBaseObject();
}
}
| [
"nisarg.trivedi@vovance.com"
] | nisarg.trivedi@vovance.com |
4754dca6011ebf4c0f97db3c222cde116a9adba7 | d155ad05d3d53c58ffc5d1f6e3468c70a1653bc9 | /LeetCode/src/main/java/leetcode/LeetCode/NumberOfStepsToReduceANumberToZero.java | 3c0b68a295cdbe26b07cb1cd46aa94442640c598 | [
"MIT"
] | permissive | UNDERHMA/LeetCode-with-Unit-Tests | 8e3fb2faf4a9119e19b5c7a9d8e6b051232cb9d3 | ec6abc23303421ec6a3253f3979495c444f441ae | refs/heads/master | 2023-03-07T13:42:39.409953 | 2021-02-22T18:20:02 | 2021-02-22T18:20:02 | 297,705,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package leetcode.LeetCode;
public class NumberOfStepsToReduceANumberToZero {
public int numberOfSteps (int num) {
int steps = 0;
while(num > 0) {
if(num % 2 == 0) num /= 2;
else num--;
steps++;
}
return steps;
}
}
| [
"underhillmason@gmail.com"
] | underhillmason@gmail.com |
d3e4610428eb58a27e3c64023b50dd1881b65228 | c1a652035bad360a0770cda7cf32f97698bcd44a | /src/projeto2/Util.java | 7a575e87b13ec01ba135ac938fa1f7452b7ef668 | [] | no_license | danielcfaria/gestaocinema | 50e83a3d6198a520e7791b2ef27aafac96753792 | 18a1b90a642e7d15d3627a231fd2adce43306442 | refs/heads/master | 2020-03-17T17:50:37.641397 | 2020-02-19T18:05:14 | 2020-02-19T18:05:14 | 133,804,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,272 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package projeto2;
import java.sql.Connection;
import java.sql.DriverManager;
/**
*
* @author miguel
*/
public class Util {
private static Connection conn = null;
public static Connection criarConexao() {
if (conn != null) {
return conn;
} else {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
System.out.println("Oops! Can't find class oracle.jdbc.driver.OracleDriver");
System.exit(-1);
}
try {
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@127.0.0.1:1521:XE", "PROJ1", "123");
//conn.setAutoCommit(false);
} catch (Exception e) {
System.out.println("ERRO " + e.getMessage());
//javax.swing.JOptionPane.showMessageDialog(null,e.getMessage(),"ERRO", javax.swing.JOptionPane.ERROR_MESSAGE);
System.exit(-2);
}
return conn;
}
}
} | [
"gigantediogo002@gmail.com"
] | gigantediogo002@gmail.com |
811bf5403ef6a04efd4fa575435222062d221651 | 48625fb2f7b4f07426e41363c74a0798d2a152a0 | /app/src/main/java/com/example/ajay/wifianalyzer/Properties.java | 6f9d3816685553b95af4d847e482c4a008d8cc36 | [] | no_license | ajkausha161997/Wifi-analyzer | 875cff38cdcd1c646338dcea4505166ce0d0b5e7 | 60e8aa908794d07cb48870122c335c729cef2cb5 | refs/heads/master | 2022-11-13T11:15:23.914031 | 2020-06-30T08:15:30 | 2020-06-30T08:15:30 | 276,027,032 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package com.example.ajay.wifianalyzer;
/**
* Created by Ajay Kaushal
*/
public class Properties {
private String property;
private String value;
public Properties(String p, String v) {
property = p;
value = v;
}
public String getProperty() {
return property;
}
public String getValue() {
return value;
}
}
| [
"ajaykaushal232@gmail.com"
] | ajaykaushal232@gmail.com |
976ae2456b766b69d6576a04bf36178d21cdfaa7 | 853b890c9ee459bdae646aacc6dad2b75d18d5b7 | /src/exceptionassigmment4/InvalidHourException.java | 573ecdb636b2b6885546dd8152cb69c6347bf0dc | [] | no_license | ShaimaZakout/Exception-in-Java | 1379632b3a8bf4abedf7c08d97c77ce2ba711cb7 | 493d425db4de54f5f48df24074f82f245c227060 | refs/heads/main | 2023-02-02T01:05:45.275377 | 2020-12-13T23:52:01 | 2020-12-13T23:52:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package exceptionassigmment4;
/**
*
* @author hp
*/
public class InvalidHourException extends myException {
public InvalidHourException() {
super("Invalid Hour");
}
}
| [
"63237476+shaimaa-zakout@users.noreply.github.com"
] | 63237476+shaimaa-zakout@users.noreply.github.com |
a54b845e536a63884b132a3c6e350e81c583a21b | 315ba223614b611dfa8a87b10eee2e50892bef68 | /src/sk/me/patterns/creational/singleton/SingletonPatternDemo.java | fc69208c98081bf4be83b57ec45ef3f4118861de | [] | no_license | stanley255/design-patterns | 9a2953b3ef35d1118b60e0842155a3bc4109856b | b904cc501687cb4bf8a1a035f482eb2f182b2145 | refs/heads/master | 2020-06-26T09:09:59.713160 | 2019-08-06T09:07:55 | 2019-08-06T09:07:55 | 199,592,136 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 453 | java | package sk.me.patterns.creational.singleton;
public class SingletonPatternDemo {
public static void main(String[] args) {
// Illegal construct
// Compile Time Error: The constructor SingleObject() is not visible
// SingleObject object = new SingleObject();
// Get the only object available
SingleObject object = SingleObject.getInstance();
//show the message
object.showMessage();
}
}
| [
"spekarovic@gmail.com"
] | spekarovic@gmail.com |
aa011da1b95bfadc915e733330fff69f3b56da32 | 54e93273944f1714d74b99bdac762e4d0bed77b3 | /MySportsBook/obj/Release/android/src/mysportsbook/mysportsbook/R.java | 46d252dbce0e30fe1c9c743c67a5b72f3cb9276f | [] | no_license | Akkarthi/MySportsBook-WithAsyncTask | 8a3ffc0bb9ca68deb7aefce405cb0725d605432a | b6bc186acabb2593d17b32abb248004fa02c1ede | refs/heads/master | 2022-12-16T13:13:00.965503 | 2019-01-05T07:59:21 | 2019-01-05T07:59:21 | 163,371,076 | 0 | 0 | null | 2022-12-08T01:49:28 | 2018-12-28T05:47:34 | Java | UTF-8 | Java | false | false | 53,905 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package mysportsbook.mysportsbook;
public final class R {
public static final class array {
public static final int month_array=0x7f080000;
}
public static final class attr {
}
public static final class color {
public static final int ColorPrimary=0x7f040004;
public static final int ColorPrimaryDark=0x7f040005;
public static final int accent=0x7f040006;
/** Menu Drawer
*/
public static final int actionbarbackground=0x7f04000b;
/** Login
*/
public static final int background_Color=0x7f040000;
public static final int labeltext_Color=0x7f040003;
public static final int login_password_color=0x7f040002;
public static final int login_username_color=0x7f040001;
public static final int menu_drawer_background=0x7f040008;
public static final int menu_drawer_margin_line=0x7f040009;
public static final int menu_drawer_textcolor=0x7f04000a;
/** Menu Drawer
*/
public static final int menudrawer_sidemenu_name_background=0x7f040007;
}
public static final class dimen {
public static final int _100sdp=0x7f06009f;
public static final int _101sdp=0x7f0600a0;
public static final int _102sdp=0x7f0600a1;
public static final int _103sdp=0x7f0600a2;
public static final int _104sdp=0x7f0600a3;
public static final int _105sdp=0x7f0600a4;
public static final int _106sdp=0x7f0600a5;
public static final int _107sdp=0x7f0600a6;
public static final int _108sdp=0x7f0600a7;
public static final int _109sdp=0x7f0600a8;
public static final int _10sdp=0x7f060045;
public static final int _110sdp=0x7f0600a9;
public static final int _111sdp=0x7f0600aa;
public static final int _112sdp=0x7f0600ab;
public static final int _113sdp=0x7f0600ac;
public static final int _114sdp=0x7f0600ad;
public static final int _115sdp=0x7f0600ae;
public static final int _116sdp=0x7f0600af;
public static final int _117sdp=0x7f0600b0;
public static final int _118sdp=0x7f0600b1;
public static final int _119sdp=0x7f0600b2;
public static final int _11sdp=0x7f060046;
public static final int _120sdp=0x7f0600b3;
public static final int _121sdp=0x7f0600b4;
public static final int _122sdp=0x7f0600b5;
public static final int _123sdp=0x7f0600b6;
public static final int _124sdp=0x7f0600b7;
public static final int _125sdp=0x7f0600b8;
public static final int _126sdp=0x7f0600b9;
public static final int _127sdp=0x7f0600ba;
public static final int _128sdp=0x7f0600bb;
public static final int _129sdp=0x7f0600bc;
public static final int _12sdp=0x7f060047;
public static final int _130sdp=0x7f0600bd;
public static final int _131sdp=0x7f0600be;
public static final int _132sdp=0x7f0600bf;
public static final int _133sdp=0x7f0600c0;
public static final int _134sdp=0x7f0600c1;
public static final int _135sdp=0x7f0600c2;
public static final int _136sdp=0x7f0600c3;
public static final int _137sdp=0x7f0600c4;
public static final int _138sdp=0x7f0600c5;
public static final int _139sdp=0x7f0600c6;
public static final int _13sdp=0x7f060048;
public static final int _140sdp=0x7f0600c7;
public static final int _141sdp=0x7f0600c8;
public static final int _142sdp=0x7f0600c9;
public static final int _143sdp=0x7f0600ca;
public static final int _144sdp=0x7f0600cb;
public static final int _145sdp=0x7f0600cc;
public static final int _146sdp=0x7f0600cd;
public static final int _147sdp=0x7f0600ce;
public static final int _148sdp=0x7f0600cf;
public static final int _149sdp=0x7f0600d0;
public static final int _14sdp=0x7f060049;
public static final int _150sdp=0x7f0600d1;
public static final int _151sdp=0x7f0600d2;
public static final int _152sdp=0x7f0600d3;
public static final int _153sdp=0x7f0600d4;
public static final int _154sdp=0x7f0600d5;
public static final int _155sdp=0x7f0600d6;
public static final int _156sdp=0x7f0600d7;
public static final int _157sdp=0x7f0600d8;
public static final int _158sdp=0x7f0600d9;
public static final int _159sdp=0x7f0600da;
public static final int _15sdp=0x7f06004a;
public static final int _160sdp=0x7f0600db;
public static final int _161sdp=0x7f0600dc;
public static final int _162sdp=0x7f0600dd;
public static final int _163sdp=0x7f0600de;
public static final int _164sdp=0x7f0600df;
public static final int _165sdp=0x7f0600e0;
public static final int _166sdp=0x7f0600e1;
public static final int _167sdp=0x7f0600e2;
public static final int _168sdp=0x7f0600e3;
public static final int _169sdp=0x7f0600e4;
public static final int _16sdp=0x7f06004b;
public static final int _170sdp=0x7f0600e5;
public static final int _171sdp=0x7f0600e6;
public static final int _172sdp=0x7f0600e7;
public static final int _173sdp=0x7f0600e8;
public static final int _174sdp=0x7f0600e9;
public static final int _175sdp=0x7f0600ea;
public static final int _176sdp=0x7f0600eb;
public static final int _177sdp=0x7f0600ec;
public static final int _178sdp=0x7f0600ed;
public static final int _179sdp=0x7f0600ee;
public static final int _17sdp=0x7f06004c;
public static final int _180sdp=0x7f0600ef;
public static final int _181sdp=0x7f0600f0;
public static final int _182sdp=0x7f0600f1;
public static final int _183sdp=0x7f0600f2;
public static final int _184sdp=0x7f0600f3;
public static final int _185sdp=0x7f0600f4;
public static final int _186sdp=0x7f0600f5;
public static final int _187sdp=0x7f0600f6;
public static final int _188sdp=0x7f0600f7;
public static final int _189sdp=0x7f0600f8;
public static final int _18sdp=0x7f06004d;
public static final int _190sdp=0x7f0600f9;
public static final int _191sdp=0x7f0600fa;
public static final int _192sdp=0x7f0600fb;
public static final int _193sdp=0x7f0600fc;
public static final int _194sdp=0x7f0600fd;
public static final int _195sdp=0x7f0600fe;
public static final int _196sdp=0x7f0600ff;
public static final int _197sdp=0x7f060100;
public static final int _198sdp=0x7f060101;
public static final int _199sdp=0x7f060102;
public static final int _19sdp=0x7f06004e;
public static final int _1sdp=0x7f06003c;
public static final int _200sdp=0x7f060103;
public static final int _201sdp=0x7f060104;
public static final int _202sdp=0x7f060105;
public static final int _203sdp=0x7f060106;
public static final int _204sdp=0x7f060107;
public static final int _205sdp=0x7f060108;
public static final int _206sdp=0x7f060109;
public static final int _207sdp=0x7f06010a;
public static final int _208sdp=0x7f06010b;
public static final int _209sdp=0x7f06010c;
public static final int _20sdp=0x7f06004f;
public static final int _210sdp=0x7f06010d;
public static final int _211sdp=0x7f06010e;
public static final int _212sdp=0x7f06010f;
public static final int _213sdp=0x7f060110;
public static final int _214sdp=0x7f060111;
public static final int _215sdp=0x7f060112;
public static final int _216sdp=0x7f060113;
public static final int _217sdp=0x7f060114;
public static final int _218sdp=0x7f060115;
public static final int _219sdp=0x7f060116;
public static final int _21sdp=0x7f060050;
public static final int _220sdp=0x7f060117;
public static final int _221sdp=0x7f060118;
public static final int _222sdp=0x7f060119;
public static final int _223sdp=0x7f06011a;
public static final int _224sdp=0x7f06011b;
public static final int _225sdp=0x7f06011c;
public static final int _226sdp=0x7f06011d;
public static final int _227sdp=0x7f06011e;
public static final int _228sdp=0x7f06011f;
public static final int _229sdp=0x7f060120;
public static final int _22sdp=0x7f060051;
public static final int _230sdp=0x7f060121;
public static final int _231sdp=0x7f060122;
public static final int _232sdp=0x7f060123;
public static final int _233sdp=0x7f060124;
public static final int _234sdp=0x7f060125;
public static final int _235sdp=0x7f060126;
public static final int _236sdp=0x7f060127;
public static final int _237sdp=0x7f060128;
public static final int _238sdp=0x7f060129;
public static final int _239sdp=0x7f06012a;
public static final int _23sdp=0x7f060052;
public static final int _240sdp=0x7f06012b;
public static final int _241sdp=0x7f06012c;
public static final int _242sdp=0x7f06012d;
public static final int _243sdp=0x7f06012e;
public static final int _244sdp=0x7f06012f;
public static final int _245sdp=0x7f060130;
public static final int _246sdp=0x7f060131;
public static final int _247sdp=0x7f060132;
public static final int _248sdp=0x7f060133;
public static final int _249sdp=0x7f060134;
public static final int _24sdp=0x7f060053;
public static final int _250sdp=0x7f060135;
public static final int _251sdp=0x7f060136;
public static final int _252sdp=0x7f060137;
public static final int _253sdp=0x7f060138;
public static final int _254sdp=0x7f060139;
public static final int _255sdp=0x7f06013a;
public static final int _256sdp=0x7f06013b;
public static final int _257sdp=0x7f06013c;
public static final int _258sdp=0x7f06013d;
public static final int _259sdp=0x7f06013e;
public static final int _25sdp=0x7f060054;
public static final int _260sdp=0x7f06013f;
public static final int _261sdp=0x7f060140;
public static final int _262sdp=0x7f060141;
public static final int _263sdp=0x7f060142;
public static final int _264sdp=0x7f060143;
public static final int _265sdp=0x7f060144;
public static final int _266sdp=0x7f060145;
public static final int _267sdp=0x7f060146;
public static final int _268sdp=0x7f060147;
public static final int _269sdp=0x7f060148;
public static final int _26sdp=0x7f060055;
public static final int _270sdp=0x7f060149;
public static final int _271sdp=0x7f06014a;
public static final int _272sdp=0x7f06014b;
public static final int _273sdp=0x7f06014c;
public static final int _274sdp=0x7f06014d;
public static final int _275sdp=0x7f06014e;
public static final int _276sdp=0x7f06014f;
public static final int _277sdp=0x7f060150;
public static final int _278sdp=0x7f060151;
public static final int _279sdp=0x7f060152;
public static final int _27sdp=0x7f060056;
public static final int _280sdp=0x7f060153;
public static final int _281sdp=0x7f060154;
public static final int _282sdp=0x7f060155;
public static final int _283sdp=0x7f060156;
public static final int _284sdp=0x7f060157;
public static final int _285sdp=0x7f060158;
public static final int _286sdp=0x7f060159;
public static final int _287sdp=0x7f06015a;
public static final int _288sdp=0x7f06015b;
public static final int _289sdp=0x7f06015c;
public static final int _28sdp=0x7f060057;
public static final int _290sdp=0x7f06015d;
public static final int _291sdp=0x7f06015e;
public static final int _292sdp=0x7f06015f;
public static final int _293sdp=0x7f060160;
public static final int _294sdp=0x7f060161;
public static final int _295sdp=0x7f060162;
public static final int _296sdp=0x7f060163;
public static final int _297sdp=0x7f060164;
public static final int _298sdp=0x7f060165;
public static final int _299sdp=0x7f060166;
public static final int _29sdp=0x7f060058;
public static final int _2sdp=0x7f06003d;
public static final int _300sdp=0x7f060167;
public static final int _301sdp=0x7f060168;
public static final int _302sdp=0x7f060169;
public static final int _303sdp=0x7f06016a;
public static final int _304sdp=0x7f06016b;
public static final int _305sdp=0x7f06016c;
public static final int _306sdp=0x7f06016d;
public static final int _307sdp=0x7f06016e;
public static final int _308sdp=0x7f06016f;
public static final int _309sdp=0x7f060170;
public static final int _30sdp=0x7f060059;
public static final int _310sdp=0x7f060171;
public static final int _311sdp=0x7f060172;
public static final int _312sdp=0x7f060173;
public static final int _313sdp=0x7f060174;
public static final int _314sdp=0x7f060175;
public static final int _315sdp=0x7f060176;
public static final int _316sdp=0x7f060177;
public static final int _317sdp=0x7f060178;
public static final int _318sdp=0x7f060179;
public static final int _319sdp=0x7f06017a;
public static final int _31sdp=0x7f06005a;
public static final int _320sdp=0x7f06017b;
public static final int _321sdp=0x7f06017c;
public static final int _322sdp=0x7f06017d;
public static final int _323sdp=0x7f06017e;
public static final int _324sdp=0x7f06017f;
public static final int _325sdp=0x7f060180;
public static final int _326sdp=0x7f060181;
public static final int _327sdp=0x7f060182;
public static final int _328sdp=0x7f060183;
public static final int _329sdp=0x7f060184;
public static final int _32sdp=0x7f06005b;
public static final int _330sdp=0x7f060185;
public static final int _331sdp=0x7f060186;
public static final int _332sdp=0x7f060187;
public static final int _333sdp=0x7f060188;
public static final int _334sdp=0x7f060189;
public static final int _335sdp=0x7f06018a;
public static final int _336sdp=0x7f06018b;
public static final int _337sdp=0x7f06018c;
public static final int _338sdp=0x7f06018d;
public static final int _339sdp=0x7f06018e;
public static final int _33sdp=0x7f06005c;
public static final int _340sdp=0x7f06018f;
public static final int _341sdp=0x7f060190;
public static final int _342sdp=0x7f060191;
public static final int _343sdp=0x7f060192;
public static final int _344sdp=0x7f060193;
public static final int _345sdp=0x7f060194;
public static final int _346sdp=0x7f060195;
public static final int _347sdp=0x7f060196;
public static final int _348sdp=0x7f060197;
public static final int _349sdp=0x7f060198;
public static final int _34sdp=0x7f06005d;
public static final int _350sdp=0x7f060199;
public static final int _351sdp=0x7f06019a;
public static final int _352sdp=0x7f06019b;
public static final int _353sdp=0x7f06019c;
public static final int _354sdp=0x7f06019d;
public static final int _355sdp=0x7f06019e;
public static final int _356sdp=0x7f06019f;
public static final int _357sdp=0x7f0601a0;
public static final int _358sdp=0x7f0601a1;
public static final int _359sdp=0x7f0601a2;
public static final int _35sdp=0x7f06005e;
public static final int _360sdp=0x7f0601a3;
public static final int _361sdp=0x7f0601a4;
public static final int _362sdp=0x7f0601a5;
public static final int _363sdp=0x7f0601a6;
public static final int _364sdp=0x7f0601a7;
public static final int _365sdp=0x7f0601a8;
public static final int _366sdp=0x7f0601a9;
public static final int _367sdp=0x7f0601aa;
public static final int _368sdp=0x7f0601ab;
public static final int _369sdp=0x7f0601ac;
public static final int _36sdp=0x7f06005f;
public static final int _370sdp=0x7f0601ad;
public static final int _371sdp=0x7f0601ae;
public static final int _372sdp=0x7f0601af;
public static final int _373sdp=0x7f0601b0;
public static final int _374sdp=0x7f0601b1;
public static final int _375sdp=0x7f0601b2;
public static final int _376sdp=0x7f0601b3;
public static final int _377sdp=0x7f0601b4;
public static final int _378sdp=0x7f0601b5;
public static final int _379sdp=0x7f0601b6;
public static final int _37sdp=0x7f060060;
public static final int _380sdp=0x7f0601b7;
public static final int _381sdp=0x7f0601b8;
public static final int _382sdp=0x7f0601b9;
public static final int _383sdp=0x7f0601ba;
public static final int _384sdp=0x7f0601bb;
public static final int _385sdp=0x7f0601bc;
public static final int _386sdp=0x7f0601bd;
public static final int _387sdp=0x7f0601be;
public static final int _388sdp=0x7f0601bf;
public static final int _389sdp=0x7f0601c0;
public static final int _38sdp=0x7f060061;
public static final int _390sdp=0x7f0601c1;
public static final int _391sdp=0x7f0601c2;
public static final int _392sdp=0x7f0601c3;
public static final int _393sdp=0x7f0601c4;
public static final int _394sdp=0x7f0601c5;
public static final int _395sdp=0x7f0601c6;
public static final int _396sdp=0x7f0601c7;
public static final int _397sdp=0x7f0601c8;
public static final int _398sdp=0x7f0601c9;
public static final int _399sdp=0x7f0601ca;
public static final int _39sdp=0x7f060062;
public static final int _3sdp=0x7f06003e;
public static final int _400sdp=0x7f0601cb;
public static final int _401sdp=0x7f0601cc;
public static final int _402sdp=0x7f0601cd;
public static final int _403sdp=0x7f0601ce;
public static final int _404sdp=0x7f0601cf;
public static final int _405sdp=0x7f0601d0;
public static final int _406sdp=0x7f0601d1;
public static final int _407sdp=0x7f0601d2;
public static final int _408sdp=0x7f0601d3;
public static final int _409sdp=0x7f0601d4;
public static final int _40sdp=0x7f060063;
public static final int _410sdp=0x7f0601d5;
public static final int _411sdp=0x7f0601d6;
public static final int _412sdp=0x7f0601d7;
public static final int _413sdp=0x7f0601d8;
public static final int _414sdp=0x7f0601d9;
public static final int _415sdp=0x7f0601da;
public static final int _416sdp=0x7f0601db;
public static final int _417sdp=0x7f0601dc;
public static final int _418sdp=0x7f0601dd;
public static final int _419sdp=0x7f0601de;
public static final int _41sdp=0x7f060064;
public static final int _420sdp=0x7f0601df;
public static final int _421sdp=0x7f0601e0;
public static final int _422sdp=0x7f0601e1;
public static final int _423sdp=0x7f0601e2;
public static final int _424sdp=0x7f0601e3;
public static final int _425sdp=0x7f0601e4;
public static final int _426sdp=0x7f0601e5;
public static final int _427sdp=0x7f0601e6;
public static final int _428sdp=0x7f0601e7;
public static final int _429sdp=0x7f0601e8;
public static final int _42sdp=0x7f060065;
public static final int _430sdp=0x7f0601e9;
public static final int _431sdp=0x7f0601ea;
public static final int _432sdp=0x7f0601eb;
public static final int _433sdp=0x7f0601ec;
public static final int _434sdp=0x7f0601ed;
public static final int _435sdp=0x7f0601ee;
public static final int _436sdp=0x7f0601ef;
public static final int _437sdp=0x7f0601f0;
public static final int _438sdp=0x7f0601f1;
public static final int _439sdp=0x7f0601f2;
public static final int _43sdp=0x7f060066;
public static final int _440sdp=0x7f0601f3;
public static final int _441sdp=0x7f0601f4;
public static final int _442sdp=0x7f0601f5;
public static final int _443sdp=0x7f0601f6;
public static final int _444sdp=0x7f0601f7;
public static final int _445sdp=0x7f0601f8;
public static final int _446sdp=0x7f0601f9;
public static final int _447sdp=0x7f0601fa;
public static final int _448sdp=0x7f0601fb;
public static final int _449sdp=0x7f0601fc;
public static final int _44sdp=0x7f060067;
public static final int _450sdp=0x7f0601fd;
public static final int _451sdp=0x7f0601fe;
public static final int _452sdp=0x7f0601ff;
public static final int _453sdp=0x7f060200;
public static final int _454sdp=0x7f060201;
public static final int _455sdp=0x7f060202;
public static final int _456sdp=0x7f060203;
public static final int _457sdp=0x7f060204;
public static final int _458sdp=0x7f060205;
public static final int _459sdp=0x7f060206;
public static final int _45sdp=0x7f060068;
public static final int _460sdp=0x7f060207;
public static final int _461sdp=0x7f060208;
public static final int _462sdp=0x7f060209;
public static final int _463sdp=0x7f06020a;
public static final int _464sdp=0x7f06020b;
public static final int _465sdp=0x7f06020c;
public static final int _466sdp=0x7f06020d;
public static final int _467sdp=0x7f06020e;
public static final int _468sdp=0x7f06020f;
public static final int _469sdp=0x7f060210;
public static final int _46sdp=0x7f060069;
public static final int _470sdp=0x7f060211;
public static final int _471sdp=0x7f060212;
public static final int _472sdp=0x7f060213;
public static final int _473sdp=0x7f060214;
public static final int _474sdp=0x7f060215;
public static final int _475sdp=0x7f060216;
public static final int _476sdp=0x7f060217;
public static final int _477sdp=0x7f060218;
public static final int _478sdp=0x7f060219;
public static final int _479sdp=0x7f06021a;
public static final int _47sdp=0x7f06006a;
public static final int _480sdp=0x7f06021b;
public static final int _481sdp=0x7f06021c;
public static final int _482sdp=0x7f06021d;
public static final int _483sdp=0x7f06021e;
public static final int _484sdp=0x7f06021f;
public static final int _485sdp=0x7f060220;
public static final int _486sdp=0x7f060221;
public static final int _487sdp=0x7f060222;
public static final int _488sdp=0x7f060223;
public static final int _489sdp=0x7f060224;
public static final int _48sdp=0x7f06006b;
public static final int _490sdp=0x7f060225;
public static final int _491sdp=0x7f060226;
public static final int _492sdp=0x7f060227;
public static final int _493sdp=0x7f060228;
public static final int _494sdp=0x7f060229;
public static final int _495sdp=0x7f06022a;
public static final int _496sdp=0x7f06022b;
public static final int _497sdp=0x7f06022c;
public static final int _498sdp=0x7f06022d;
public static final int _499sdp=0x7f06022e;
public static final int _49sdp=0x7f06006c;
public static final int _4sdp=0x7f06003f;
public static final int _500sdp=0x7f06022f;
public static final int _501sdp=0x7f060230;
public static final int _502sdp=0x7f060231;
public static final int _503sdp=0x7f060232;
public static final int _504sdp=0x7f060233;
public static final int _505sdp=0x7f060234;
public static final int _506sdp=0x7f060235;
public static final int _507sdp=0x7f060236;
public static final int _508sdp=0x7f060237;
public static final int _509sdp=0x7f060238;
public static final int _50sdp=0x7f06006d;
public static final int _510sdp=0x7f060239;
public static final int _511sdp=0x7f06023a;
public static final int _512sdp=0x7f06023b;
public static final int _513sdp=0x7f06023c;
public static final int _514sdp=0x7f06023d;
public static final int _515sdp=0x7f06023e;
public static final int _516sdp=0x7f06023f;
public static final int _517sdp=0x7f060240;
public static final int _518sdp=0x7f060241;
public static final int _519sdp=0x7f060242;
public static final int _51sdp=0x7f06006e;
public static final int _520sdp=0x7f060243;
public static final int _521sdp=0x7f060244;
public static final int _522sdp=0x7f060245;
public static final int _523sdp=0x7f060246;
public static final int _524sdp=0x7f060247;
public static final int _525sdp=0x7f060248;
public static final int _526sdp=0x7f060249;
public static final int _527sdp=0x7f06024a;
public static final int _528sdp=0x7f06024b;
public static final int _529sdp=0x7f06024c;
public static final int _52sdp=0x7f06006f;
public static final int _530sdp=0x7f06024d;
public static final int _531sdp=0x7f06024e;
public static final int _532sdp=0x7f06024f;
public static final int _533sdp=0x7f060250;
public static final int _534sdp=0x7f060251;
public static final int _535sdp=0x7f060252;
public static final int _536sdp=0x7f060253;
public static final int _537sdp=0x7f060254;
public static final int _538sdp=0x7f060255;
public static final int _539sdp=0x7f060256;
public static final int _53sdp=0x7f060070;
public static final int _540sdp=0x7f060257;
public static final int _541sdp=0x7f060258;
public static final int _542sdp=0x7f060259;
public static final int _543sdp=0x7f06025a;
public static final int _544sdp=0x7f06025b;
public static final int _545sdp=0x7f06025c;
public static final int _546sdp=0x7f06025d;
public static final int _547sdp=0x7f06025e;
public static final int _548sdp=0x7f06025f;
public static final int _549sdp=0x7f060260;
public static final int _54sdp=0x7f060071;
public static final int _550sdp=0x7f060261;
public static final int _551sdp=0x7f060262;
public static final int _552sdp=0x7f060263;
public static final int _553sdp=0x7f060264;
public static final int _554sdp=0x7f060265;
public static final int _555sdp=0x7f060266;
public static final int _556sdp=0x7f060267;
public static final int _557sdp=0x7f060268;
public static final int _558sdp=0x7f060269;
public static final int _559sdp=0x7f06026a;
public static final int _55sdp=0x7f060072;
public static final int _560sdp=0x7f06026b;
public static final int _561sdp=0x7f06026c;
public static final int _562sdp=0x7f06026d;
public static final int _563sdp=0x7f06026e;
public static final int _564sdp=0x7f06026f;
public static final int _565sdp=0x7f060270;
public static final int _566sdp=0x7f060271;
public static final int _567sdp=0x7f060272;
public static final int _568sdp=0x7f060273;
public static final int _569sdp=0x7f060274;
public static final int _56sdp=0x7f060073;
public static final int _570sdp=0x7f060275;
public static final int _571sdp=0x7f060276;
public static final int _572sdp=0x7f060277;
public static final int _573sdp=0x7f060278;
public static final int _574sdp=0x7f060279;
public static final int _575sdp=0x7f06027a;
public static final int _576sdp=0x7f06027b;
public static final int _577sdp=0x7f06027c;
public static final int _578sdp=0x7f06027d;
public static final int _579sdp=0x7f06027e;
public static final int _57sdp=0x7f060074;
public static final int _580sdp=0x7f06027f;
public static final int _581sdp=0x7f060280;
public static final int _582sdp=0x7f060281;
public static final int _583sdp=0x7f060282;
public static final int _584sdp=0x7f060283;
public static final int _585sdp=0x7f060284;
public static final int _586sdp=0x7f060285;
public static final int _587sdp=0x7f060286;
public static final int _588sdp=0x7f060287;
public static final int _589sdp=0x7f060288;
public static final int _58sdp=0x7f060075;
public static final int _590sdp=0x7f060289;
public static final int _591sdp=0x7f06028a;
public static final int _592sdp=0x7f06028b;
public static final int _593sdp=0x7f06028c;
public static final int _594sdp=0x7f06028d;
public static final int _595sdp=0x7f06028e;
public static final int _596sdp=0x7f06028f;
public static final int _597sdp=0x7f060290;
public static final int _598sdp=0x7f060291;
public static final int _599sdp=0x7f060292;
public static final int _59sdp=0x7f060076;
public static final int _5sdp=0x7f060040;
public static final int _600sdp=0x7f060293;
public static final int _60sdp=0x7f060077;
public static final int _61sdp=0x7f060078;
public static final int _62sdp=0x7f060079;
public static final int _63sdp=0x7f06007a;
public static final int _64sdp=0x7f06007b;
public static final int _65sdp=0x7f06007c;
public static final int _66sdp=0x7f06007d;
public static final int _67sdp=0x7f06007e;
public static final int _68sdp=0x7f06007f;
public static final int _69sdp=0x7f060080;
public static final int _6sdp=0x7f060041;
public static final int _70sdp=0x7f060081;
public static final int _71sdp=0x7f060082;
public static final int _72sdp=0x7f060083;
public static final int _73sdp=0x7f060084;
public static final int _74sdp=0x7f060085;
public static final int _75sdp=0x7f060086;
public static final int _76sdp=0x7f060087;
public static final int _77sdp=0x7f060088;
public static final int _78sdp=0x7f060089;
public static final int _79sdp=0x7f06008a;
public static final int _7sdp=0x7f060042;
public static final int _80sdp=0x7f06008b;
public static final int _81sdp=0x7f06008c;
public static final int _82sdp=0x7f06008d;
public static final int _83sdp=0x7f06008e;
public static final int _84sdp=0x7f06008f;
public static final int _85sdp=0x7f060090;
public static final int _86sdp=0x7f060091;
public static final int _87sdp=0x7f060092;
public static final int _88sdp=0x7f060093;
public static final int _89sdp=0x7f060094;
public static final int _8sdp=0x7f060043;
public static final int _90sdp=0x7f060095;
public static final int _91sdp=0x7f060096;
public static final int _92sdp=0x7f060097;
public static final int _93sdp=0x7f060098;
public static final int _94sdp=0x7f060099;
public static final int _95sdp=0x7f06009a;
public static final int _96sdp=0x7f06009b;
public static final int _97sdp=0x7f06009c;
public static final int _98sdp=0x7f06009d;
public static final int _99sdp=0x7f06009e;
public static final int _9sdp=0x7f060044;
public static final int _minus10sdp=0x7f060009;
public static final int _minus11sdp=0x7f06000a;
public static final int _minus12sdp=0x7f06000b;
public static final int _minus13sdp=0x7f06000c;
public static final int _minus14sdp=0x7f06000d;
public static final int _minus15sdp=0x7f06000e;
public static final int _minus16sdp=0x7f06000f;
public static final int _minus17sdp=0x7f060010;
public static final int _minus18sdp=0x7f060011;
public static final int _minus19sdp=0x7f060012;
public static final int _minus1sdp=0x7f060000;
public static final int _minus20sdp=0x7f060013;
public static final int _minus21sdp=0x7f060014;
public static final int _minus22sdp=0x7f060015;
public static final int _minus23sdp=0x7f060016;
public static final int _minus24sdp=0x7f060017;
public static final int _minus25sdp=0x7f060018;
public static final int _minus26sdp=0x7f060019;
public static final int _minus27sdp=0x7f06001a;
public static final int _minus28sdp=0x7f06001b;
public static final int _minus29sdp=0x7f06001c;
public static final int _minus2sdp=0x7f060001;
public static final int _minus30sdp=0x7f06001d;
public static final int _minus31sdp=0x7f06001e;
public static final int _minus32sdp=0x7f06001f;
public static final int _minus33sdp=0x7f060020;
public static final int _minus34sdp=0x7f060021;
public static final int _minus35sdp=0x7f060022;
public static final int _minus36sdp=0x7f060023;
public static final int _minus37sdp=0x7f060024;
public static final int _minus38sdp=0x7f060025;
public static final int _minus39sdp=0x7f060026;
public static final int _minus3sdp=0x7f060002;
public static final int _minus40sdp=0x7f060027;
public static final int _minus41sdp=0x7f060028;
public static final int _minus42sdp=0x7f060029;
public static final int _minus43sdp=0x7f06002a;
public static final int _minus44sdp=0x7f06002b;
public static final int _minus45sdp=0x7f06002c;
public static final int _minus46sdp=0x7f06002d;
public static final int _minus47sdp=0x7f06002e;
public static final int _minus48sdp=0x7f06002f;
public static final int _minus49sdp=0x7f060030;
public static final int _minus4sdp=0x7f060003;
public static final int _minus50sdp=0x7f060031;
public static final int _minus51sdp=0x7f060032;
public static final int _minus52sdp=0x7f060033;
public static final int _minus53sdp=0x7f060034;
public static final int _minus54sdp=0x7f060035;
public static final int _minus55sdp=0x7f060036;
public static final int _minus56sdp=0x7f060037;
public static final int _minus57sdp=0x7f060038;
public static final int _minus58sdp=0x7f060039;
public static final int _minus59sdp=0x7f06003a;
public static final int _minus5sdp=0x7f060004;
public static final int _minus60sdp=0x7f06003b;
public static final int _minus6sdp=0x7f060005;
public static final int _minus7sdp=0x7f060006;
public static final int _minus8sdp=0x7f060007;
public static final int _minus9sdp=0x7f060008;
}
public static final class drawable {
public static final int addicon=0x7f020000;
public static final int alertdialogstyle=0x7f020001;
public static final int amounttextboxborder=0x7f020002;
public static final int bg=0x7f020003;
public static final int boxlight=0x7f020004;
public static final int button_small=0x7f020005;
public static final int buttonborder=0x7f020006;
public static final int buttonstyle=0x7f020007;
public static final int checkbox=0x7f020008;
public static final int checkbox_tick=0x7f020009;
public static final int checkboxstyle=0x7f02000a;
public static final int checked=0x7f02000b;
public static final int edittextboxborder=0x7f02000c;
public static final int feedbacklistitem=0x7f02000d;
public static final int icon=0x7f02000e;
public static final int location=0x7f02000f;
public static final int menu=0x7f020010;
public static final int minus=0x7f020011;
public static final int passwordicon=0x7f020012;
public static final int plus=0x7f020013;
public static final int progress=0x7f020014;
public static final int search=0x7f020015;
public static final int unchecked=0x7f020016;
public static final int userlisticon=0x7f020017;
public static final int userlistitemborder=0x7f020018;
public static final int usernameicon=0x7f020019;
public static final int venue=0x7f02001a;
}
public static final class id {
public static final int Picker_Date=0x7f090056;
public static final int ScrollView01=0x7f090058;
public static final int ScrollViewBody=0x7f09001b;
public static final int bodyLayout=0x7f0900b2;
public static final int btnAddPlayer=0x7f090037;
public static final int btnBatchCountCancel=0x7f09002f;
public static final int btnBatchCountSubmit=0x7f09002e;
public static final int btnCancel=0x7f09003a;
public static final int btnDone=0x7f09001e;
public static final int btnLogin=0x7f0900b7;
public static final int btnNewEnquiry=0x7f09006c;
public static final int btnPaste=0x7f090008;
public static final int btnSubmit=0x7f09000d;
public static final int buttonDone=0x7f090057;
public static final int buttonLayout=0x7f0900b6;
public static final int editTextBookingMessage=0x7f09000b;
public static final int editTextEnquiryComment=0x7f090064;
public static final int editTextEnquiryGames=0x7f090062;
public static final int editTextEnquiryMobile=0x7f09005f;
public static final int editTextEnquiryName=0x7f09005d;
public static final int editTextInvoiceDiscountName=0x7f090097;
public static final int editTextInvoiceLateName=0x7f090099;
public static final int editTextInvoicePayingAmount=0x7f090095;
public static final int editTextInvoiceRemarks=0x7f09009d;
public static final int editTextInvoiceTotalAmount=0x7f090093;
public static final int editTextSearchEnquiryUser=0x7f09006b;
public static final int editTextSearchInvoiceUser=0x7f0900a1;
public static final int editTextSearchPlayer=0x7f09001a;
public static final int gridBatch=0x7f090025;
public static final int imgActionBarLocation=0x7f090054;
public static final int imgGameUnchecked=0x7f090085;
public static final int imgGamechecked=0x7f090086;
public static final int imgIcon=0x7f09003e;
public static final int imgMinus=0x7f09002a;
public static final int imgPlayerUnchecked=0x7f090043;
public static final int imgPlayerchecked=0x7f090044;
public static final int imgPlus=0x7f09002c;
public static final int imgSearch=0x7f090018;
public static final int lblAppname=0x7f0900da;
public static final int lblBatchCount=0x7f090023;
public static final int lblBatchName=0x7f090022;
public static final int lblCourtName=0x7f090049;
public static final int lblEnquiryFeedbackDate=0x7f09007d;
public static final int lblEnquiryUserFeedbackComment=0x7f09007e;
public static final int lblEnquiryUserMobile=0x7f090074;
public static final int lblEnquiryUserName=0x7f090073;
public static final int lblGameName=0x7f090084;
public static final int lblLoginMessage=0x7f0900b3;
public static final int lblPhone=0x7f090041;
public static final int lblPlayerName=0x7f090040;
public static final int lblRememberMe=0x7f0900ba;
public static final int lblSlot=0x7f090026;
public static final int lblSportName=0x7f0900d0;
public static final int lblVenueName=0x7f0900d8;
public static final int lblheader=0x7f090006;
public static final int left_fragment_container=0x7f090001;
public static final int left_fragment_drawer=0x7f090002;
public static final int linearLayout1=0x7f090055;
public static final int linearProgressBar=0x7f09000e;
public static final int llActionBarNameContainer=0x7f09004e;
public static final int llActionBarVenueCodeContainer=0x7f090051;
public static final int llActionBarVenueImgContainer=0x7f090053;
public static final int llAlertDialogButton=0x7f090014;
public static final int llAlertDialogContainer=0x7f090010;
public static final int llAlertDialogMainContainer=0x7f090011;
public static final int llAttendance=0x7f090034;
public static final int llAttendanceAddList=0x7f09001c;
public static final int llBatchPlayer=0x7f09003f;
public static final int llBatchPlayerList=0x7f090038;
public static final int llBatchesList=0x7f090032;
public static final int llCommentContainer=0x7f090065;
public static final int llCourt=0x7f090048;
public static final int llCourtList=0x7f09004c;
public static final int llEnquiryFeedbackContainer=0x7f090067;
public static final int llEnquiryFollowUpList=0x7f090076;
public static final int llEnquiryGameList=0x7f090088;
public static final int llEnquiryUser=0x7f090072;
public static final int llEnquiryUserDetails=0x7f090077;
public static final int llEnquiryUserFeedback=0x7f09007c;
public static final int llEnquiryUserList=0x7f09006d;
public static final int llEnquiryViewContainer=0x7f090059;
public static final int llGame=0x7f090083;
public static final int llInvoiceCollectionFirstViewContainer=0x7f09008b;
public static final int llInvoiceCollectionSecondViewContainer=0x7f09008e;
public static final int llInvoiceUserContainer=0x7f0900a5;
public static final int llInvoiceUserFirstContainer=0x7f0900a7;
public static final int llInvoiceUserList=0x7f0900a2;
public static final int llInvoiceUserSecondContainer=0x7f0900ae;
public static final int llInvoiceUserSecondContainer1=0x7f0900ab;
public static final int llInvoiceUserThirdContainer=0x7f0900ad;
public static final int llMenuDrawerMainContainer=0x7f0900bb;
public static final int llPasteContainer=0x7f090007;
public static final int llSearchEnquiryUser=0x7f090069;
public static final int llSearchInvoiceUser=0x7f09009f;
public static final int llSearchPlayers=0x7f090017;
public static final int llSlot=0x7f090024;
public static final int llSport=0x7f0900cf;
public static final int llSportList=0x7f0900d2;
public static final int llVenue=0x7f0900d7;
public static final int llVenueList=0x7f0900db;
public static final int lstAttendanceAddPlayer=0x7f09001d;
public static final int lstBatchPlayer=0x7f090039;
public static final int lstCourt=0x7f09004d;
public static final int lstEnquiryUser=0x7f09006e;
public static final int lstEnquiryUserFollowUpList=0x7f090078;
public static final int lstGames=0x7f090089;
public static final int lstInvoiceUser=0x7f0900a3;
public static final int lstSport=0x7f0900d3;
public static final int lstVenue=0x7f0900dc;
public static final int myMenuDrawer=0x7f090000;
public static final int nav_FeedBack=0x7f0900e0;
public static final int nav_about=0x7f0900df;
public static final int nav_home=0x7f0900dd;
public static final int nav_messages=0x7f0900de;
public static final int parentContainer=0x7f0900b0;
public static final int progressring=0x7f09000f;
public static final int rlActionBarLocationContainer=0x7f090050;
public static final int rlAddUserMainContainer=0x7f09004a;
public static final int rlAppname=0x7f090005;
public static final int rlAttendanceAddMainContainer=0x7f090016;
public static final int rlBatchContainer=0x7f090020;
public static final int rlBatchCountContainer=0x7f090029;
public static final int rlBatchCountHeader=0x7f090027;
public static final int rlBatchItemMainContainer=0x7f09001f;
public static final int rlBatchPlayerContainer=0x7f09003c;
public static final int rlBatchPlayerItemMainContainer=0x7f09003b;
public static final int rlBatchPlayerLeftImage=0x7f09003d;
public static final int rlBatchPlayerMainContainer=0x7f090033;
public static final int rlBatchPlayerRightImage=0x7f090042;
public static final int rlBatchSubmitButtonContainer=0x7f09002d;
public static final int rlBatchesContainer=0x7f090031;
public static final int rlBatchesMainContainer=0x7f090030;
public static final int rlBodyContainer=0x7f090009;
public static final int rlBookingMainContainer=0x7f090003;
public static final int rlBottomButtonContainer=0x7f09000c;
public static final int rlCourtContainer=0x7f090046;
public static final int rlCourtItemMainContainer=0x7f090045;
public static final int rlCourtLeftImage=0x7f090047;
public static final int rlEnquiryUserContainer=0x7f090070;
public static final int rlEnquiryUserDetailMainContainer=0x7f090075;
public static final int rlEnquiryUserFeedbackContainer=0x7f09007b;
public static final int rlEnquiryUserFeedbackItemMainContainer=0x7f09007a;
public static final int rlEnquiryUserItemMainContainer=0x7f09006f;
public static final int rlEnquiryUserLeftImage=0x7f090071;
public static final int rlEnquiryUserMainContainer=0x7f090068;
public static final int rlGameContainer=0x7f090080;
public static final int rlGameItemMainContainer=0x7f09007f;
public static final int rlGameMainContainer=0x7f090087;
public static final int rlGameRightImage=0x7f090082;
public static final int rlHeader=0x7f090004;
public static final int rlInvoiceCollectionMainContainer=0x7f09008a;
public static final int rlInvoiceUserItemMainContainer=0x7f0900a4;
public static final int rlInvoiceUserLeftImage=0x7f0900a6;
public static final int rlInvoiceUserMainContainer=0x7f09009e;
public static final int rlRememberMe=0x7f0900b8;
public static final int rlSearchView=0x7f09004b;
public static final int rlSportContainer=0x7f0900cd;
public static final int rlSportItemMainContainer=0x7f0900cc;
public static final int rlSportLeftImage=0x7f0900ce;
public static final int rlSportMainContainer=0x7f0900d1;
public static final int rlVenueContainer=0x7f0900d5;
public static final int rlVenueItemMainContainer=0x7f0900d4;
public static final int rlVenueLeftImage=0x7f0900d6;
public static final int rlVenueMainContainer=0x7f0900d9;
public static final int rl_GameContainer=0x7f090081;
public static final int rl_center=0x7f090021;
public static final int rrLeftMenuAttendanceContainer=0x7f0900c0;
public static final int rrLeftMenuBatchAvailabiltyContainer=0x7f0900bc;
public static final int rrLeftMenuBatchContainer=0x7f0900be;
public static final int rrLeftMenuBookingMessageContainer=0x7f0900c6;
public static final int rrLeftMenuEnquiryContainer=0x7f0900c2;
public static final int rrLeftMenuEnquiryUserContainer=0x7f0900c4;
public static final int rrLeftMenuInvoiceContainer=0x7f0900c8;
public static final int rrLeftMenuLogOutContainer=0x7f0900ca;
public static final int saveLoginCheckBox=0x7f0900b9;
public static final int spinnerEnquiryGame=0x7f090061;
public static final int spinnerInvoiceModeOfPayment=0x7f09009b;
public static final int spinnerInvoiceMonth=0x7f090091;
public static final int txtActionBarAppName=0x7f09004f;
public static final int txtActionBarVenueCode=0x7f090052;
public static final int txtAlertDialogButton=0x7f090015;
public static final int txtAlertDialogHeading=0x7f090012;
public static final int txtAlertDialogMessage=0x7f090013;
public static final int txtAttendance=0x7f090035;
public static final int txtAttendanceMenu=0x7f0900c1;
public static final int txtBatchAvailability=0x7f0900bd;
public static final int txtBatchCount=0x7f09002b;
public static final int txtBatchHeader=0x7f090028;
public static final int txtBatchMenu=0x7f0900bf;
public static final int txtBookingHeading=0x7f09000a;
public static final int txtBookingMenu=0x7f0900c7;
public static final int txtCommentHeader=0x7f090066;
public static final int txtEnquiryComment=0x7f090063;
public static final int txtEnquiryFeedBack=0x7f090079;
public static final int txtEnquiryGame=0x7f090060;
public static final int txtEnquiryMenu=0x7f0900c3;
public static final int txtEnquiryMobile=0x7f09005e;
public static final int txtEnquiryName=0x7f09005c;
public static final int txtEnquiryUserMenu=0x7f0900c5;
public static final int txtInvoiceCollection=0x7f0900c9;
public static final int txtInvoiceDiscountAmount=0x7f090096;
public static final int txtInvoiceLateAmount=0x7f090098;
public static final int txtInvoiceModeOfPayment=0x7f09009a;
public static final int txtInvoiceMonth=0x7f090090;
public static final int txtInvoicePayingAmount=0x7f090094;
public static final int txtInvoiceRemarks=0x7f09009c;
public static final int txtInvoiceTotalAmount=0x7f090092;
public static final int txtInvoiceUserAmount=0x7f0900af;
public static final int txtInvoiceUserBatch=0x7f0900aa;
public static final int txtInvoiceUserMobile=0x7f0900a9;
public static final int txtInvoiceUserMobile1=0x7f0900ac;
public static final int txtInvoiceUserName=0x7f0900a8;
public static final int txtLogOut=0x7f0900cb;
public static final int txtName=0x7f0900b1;
public static final int txtPassword=0x7f0900b5;
public static final int txtSearchEnquiryUser=0x7f09006a;
public static final int txtSearchInvoiceUser=0x7f0900a0;
public static final int txtSearchPlayers=0x7f090019;
public static final int txtSelectDate=0x7f090036;
public static final int txtUsername=0x7f0900b4;
public static final int txtViewEnquiryMobile=0x7f09005b;
public static final int txtViewEnquiryName=0x7f09005a;
public static final int txtViewInvoiceBatch=0x7f09008f;
public static final int txtViewInvoiceMobile=0x7f09008d;
public static final int txtViewInvoiceName=0x7f09008c;
}
public static final class integer {
public static final int lines=0x7f050000;
public static final int loginhelp_layout_weight=0x7f050003;
public static final int max_lines=0x7f050001;
public static final int user_maxlength=0x7f050002;
}
public static final class layout {
public static final int addbooking=0x7f030000;
public static final int alert_dialog=0x7f030001;
public static final int attendanceaddplayer=0x7f030002;
public static final int batch=0x7f030003;
public static final int batch_item=0x7f030004;
public static final int batchcountupdatepopup=0x7f030005;
public static final int batches=0x7f030006;
public static final int batchplayer=0x7f030007;
public static final int batchplayer_item=0x7f030008;
public static final int court_item=0x7f030009;
public static final int courtlist=0x7f03000a;
public static final int customactionbar=0x7f03000b;
public static final int datepicker_dialog=0x7f03000c;
public static final int enquiryform=0x7f03000d;
public static final int enquiryuser=0x7f03000e;
public static final int enquiryuser_item=0x7f03000f;
public static final int enquiryuserdetail=0x7f030010;
public static final int enquiryuserfeedback_item=0x7f030011;
public static final int game_item=0x7f030012;
public static final int games=0x7f030013;
public static final int invoicecollectionform=0x7f030014;
public static final int invoiceuser=0x7f030015;
public static final int invoiceuser_item=0x7f030016;
public static final int login=0x7f030017;
public static final int main=0x7f030018;
public static final int menu_drawer=0x7f030019;
public static final int progressbar=0x7f03001a;
public static final int sport_item=0x7f03001b;
public static final int sports=0x7f03001c;
public static final int venue_item=0x7f03001d;
public static final int venues=0x7f03001e;
}
public static final class string {
public static final int Close_Drawer=0x7f070003;
public static final int Open_Drawer=0x7f070002;
public static final int app_name=0x7f070000;
public static final int month_prompt=0x7f070001;
}
}
| [
"karthianbu1989@gmail.com"
] | karthianbu1989@gmail.com |
f3b2491cc79bcaff64ecdafc0dd94d0215b8f97b | 51d07cc990dec25704f46fec78ff7c3c456b5eea | /NewsManagement/src/main/java/com/yusys/service/NewsCommentServiceImpl.java | c53b9b83c0154a7dbf811250f44d9ace2aea76f8 | [] | no_license | zuixiaoyao001/myStudy | 3af5133b63bc0bec2b0706cad727476c74132e9b | 1142635dcd7e3151f81bc640e97ffb0aa6b5b0c5 | refs/heads/master | 2020-03-12T04:02:36.387689 | 2018-10-13T08:25:36 | 2018-10-13T08:25:36 | 130,436,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.yusys.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yusys.dao.NewsCommentMapper;
import com.yusys.entity.NewsComment;
import com.yusys.entity.NewsDetail;
@Service
public class NewsCommentServiceImpl implements NewsCommentService {
@Autowired
NewsCommentMapper newsCommentMapper;
/* (non-Javadoc)
* @see com.yusys.service.NewsCommentService#getAllByNewsId(com.yusys.entity.NewsDetail)
*/
@Override
public List<NewsComment> getAllByNewsId(NewsDetail newsDetail){
return newsCommentMapper.getAllCommentByNewsDetailId(newsDetail);
}
public void addComment(NewsComment newsComment){
newsCommentMapper.addComment(newsComment);
}
}
| [
"1248375279@qq.com"
] | 1248375279@qq.com |
28c46e4b63658179c3c1bd4328609eab12516bb8 | 20291dce22fb5c95d62c3e784ae3dad6929ab440 | /src/main/java/com/everis/alicante/becajava/services/implementaciones/ParkingPlaceServiceImpl.java | 25a7be5d76982cdbf6fafd28091073112a5cd3cc | [] | no_license | salvatv/garageTest | 50c915978d2b6c3690ac4ea97d124c0e7ff5656c | f0175b39789d0fcc3dc807d87a11c89ffa435f6e | refs/heads/master | 2021-01-22T19:41:25.163785 | 2017-08-18T15:24:51 | 2017-08-18T15:24:51 | 100,715,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 913 | java | package com.everis.alicante.becajava.services.implementaciones;
import java.util.List;
import com.everis.alicante.becajava.domain.Parkingplace;
import com.everis.alicante.becajava.interfaces.ParkingPlaceDAO;
import com.everis.alicante.becajava.services.ParkingPlaceService;
public class ParkingPlaceServiceImpl implements ParkingPlaceService {
ParkingPlaceDAO parkingPlaceDao;
public ParkingPlaceServiceImpl(ParkingPlaceDAO parkingPlaceDao) {
super();
this.parkingPlaceDao = parkingPlaceDao;
}
@Override
public List<Parkingplace> list() {
return parkingPlaceDao.findAll();
}
@Override
public Parkingplace getFreePlace() {
List<Parkingplace> places=parkingPlaceDao.findFreeParkingPlace();
return parkingPlaceDao.readById(places.get(0).getIdparkingplace());
}
@Override
public List<Parkingplace> listFreePlaces() {
return parkingPlaceDao.findFreeParkingPlaces();
}
}
| [
"noreply@github.com"
] | salvatv.noreply@github.com |
a32f9abe0021549e8a889cc2f92dc73a67271f92 | ccf7ce38a7a415b04ece559a3c8e58fe54204178 | /spring&datasource/src/aop_jdk/MyAspect.java | 6975e1800e271ba24ba1070f9a4d8a9d13502e6a | [] | no_license | zhanglijie0401/J2EE | a461182d24e5ff0ccdefaa73d14d21a5f84516b4 | bb1d53843b1b213f31dd6bec4adb726456993ae3 | refs/heads/master | 2021-10-09T09:29:59.919607 | 2018-12-25T07:18:28 | 2018-12-25T07:18:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package aop_jdk;
public class MyAspect {
public void before() {
System.out.println("before");
}
public void after() {
System.out.println("after");
}
}
| [
"454592297@qq.com"
] | 454592297@qq.com |
db231a1ab3c2c8e54e55d0bbb6ba7ed21c1e6daf | 6caae499c8d3f9dfd834963f5a650861776572d0 | /Pin/app/src/main/java/com/pin/highton/wad/datainfo/Acount.java | 3804a5f3785b9dcbbb34a035775a36b1fa3dcc44 | [] | no_license | SeungYongSon/Highthon-Pin-Wad | c982c7e57986842eba4da124c3e35c9ca7a2c236 | 1b54b5a21c3f67efc9d6e1d02787a855e6af3f1d | refs/heads/master | 2021-05-01T17:41:58.965032 | 2018-02-11T13:53:17 | 2018-02-11T13:53:17 | 120,994,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 157 | java | package com.pin.highton.wad.datainfo;
/**
* Created by Seungyong Son on 2018-02-10.
*/
public class Acount {
String pw, name, phone, schools[];
}
| [
"space010127@gmail.com"
] | space010127@gmail.com |
c80e7087c77757c7a8f9931d5f4c9cdfbdfdc740 | f3c137cb2e99174a5acb4b55c31afae0f4f84dc3 | /src/main/java/controller/DetalleFacturaController.java | 19f13c429e4f5aa25696fb222e3155cb2a1502aa | [] | no_license | Arley0107/progra3VFINAL | 1653bd7f70084f354af845782555a309600f0830 | a8bb3ab103404a4b38264e24c9296aeaa4abbd26 | refs/heads/master | 2023-04-23T23:58:25.576881 | 2021-04-25T20:05:35 | 2021-04-25T20:05:35 | 362,275,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java |
package controller;
import gestion.DetalleFacturaGestion;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import model.DetalleFactura;
@Named(value = "detalleFacturaController")
@SessionScoped
public class DetalleFacturaController extends DetalleFactura implements Serializable {
public DetalleFacturaController() {
}
public List<DetalleFactura> getDetalleFacturas() {
return DetalleFacturaGestion.getDetalleFacturas();
}
public String insertaDetalleFactura() {
if (DetalleFacturaGestion.insertDetalleFactura(this)) {
return "confirmacion.xhtml";
} else {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Error", "Posiblemente el usuario se encuentre duplicado.");
FacesContext.getCurrentInstance().addMessage("ingresaUsuarioForm:identificacion", msg);
return "registroUsuario.xhtml";
}
}
}
| [
"User@LAPTOP-H55D7MQE"
] | User@LAPTOP-H55D7MQE |
a822b344d58679898753c487ae424edb49759b34 | 68f3d0875b55d5fc80867b8dd1b8f7d14b18af77 | /core/src/com/mygdx/game/Dungeon/Rooms/DungeonRoomFactory.java | 12a2cf09c9084b62a3bb1a4620d30c144bd4f213 | [
"Apache-2.0"
] | permissive | Tatskaari/DungeonCrawler | f985958bfd89c9644c02c48197585518cc1443e4 | 26be1a018a4fef30c8d4351893a30917523628fc | refs/heads/master | 2021-06-03T21:04:11.556261 | 2018-01-02T20:28:54 | 2018-01-02T20:28:54 | 28,535,912 | 3 | 1 | Apache-2.0 | 2018-01-02T20:28:55 | 2014-12-27T12:08:53 | Java | UTF-8 | Java | false | false | 1,361 | java | package com.mygdx.game.Dungeon.Rooms;
import com.badlogic.gdx.math.MathUtils;
import com.mygdx.game.Dungeon.Dungeon;
import com.mygdx.game.Utils.RouletteSelector;
public class DungeonRoomFactory implements RoomFactory {
private static RouletteSelector<RoomFactory> factoryWheel = new RouletteSelector<>();
private static final int ROOM_MAX_SIZE = 15;
private static final int ROOM_MIN_SIZE = 7;
static {
factoryWheel.add(DungeonRoomFactory::createPrisonRoom, 0.1f);
factoryWheel.add(DungeonRoomFactory::createPlainRoom, 1.0f);
}
@Override
public Room create(Dungeon dungeon) {
return factoryWheel.selectAtRandom()
.create(dungeon);
}
private static PrisonRoom createPrisonRoom(Dungeon dungeon) {
int x = MathUtils.random(dungeon.getMapWidth() - 13);
int y = MathUtils.random(dungeon.getMapHeight() - 11);
return new PrisonRoom(x, y, dungeon);
}
private static PlainRoom createPlainRoom(Dungeon dungeon) {
int width = MathUtils.random(ROOM_MIN_SIZE, ROOM_MAX_SIZE);
int height = MathUtils.random(ROOM_MIN_SIZE, ROOM_MAX_SIZE);
int x = MathUtils.random(dungeon.getMapWidth() - width);
int y = MathUtils.random(dungeon.getMapHeight() - height);
return new PlainRoom(x, y, width, height, dungeon);
}
}
| [
"jonfpoole@gmail.com"
] | jonfpoole@gmail.com |
85520e78c0696167dc16934ff5617f812a8f6eb7 | 4e85a847d36a851843a606c21da543fe1d26df52 | /src/org/apache/commons/codec/binary/Base32InputStream.java | f1ee289571cd99d4ae3890937e89feca4d518bb2 | [
"MIT"
] | permissive | SubtypeZero/TOTP | 59be17d54b1c25edf9388bfdac5bb9b176d249be | 7f80d73b4fa332762c60567e41a82ffffe5017c9 | refs/heads/master | 2021-01-25T07:07:15.390191 | 2017-02-02T08:52:14 | 2017-02-02T08:52:14 | 80,704,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | /* */ package org.apache.commons.codec.binary;
/* */
/* */ import java.io.InputStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Base32InputStream
/* */ extends BaseNCodecInputStream
/* */ {
/* */ public Base32InputStream(InputStream in)
/* */ {
/* 48 */ this(in, false);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Base32InputStream(InputStream in, boolean doEncode)
/* */ {
/* 61 */ super(in, new Base32(false), doEncode);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Base32InputStream(InputStream in, boolean doEncode, int lineLength, byte[] lineSeparator)
/* */ {
/* 82 */ super(in, new Base32(lineLength, lineSeparator), doEncode);
/* */ }
/* */ }
/* Location: C:\Users\Admin\Dropbox\TOTP.jar!\org\apache\commons\codec\binary\Base32InputStream.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"subtypezero@gmail.com"
] | subtypezero@gmail.com |
6ce0ebd2a9fc2d83aa333adf4f969d0b26485bea | 44ba86e470634e43d17e0cb0b684c331e5866231 | /app/src/main/java/com/doomshell/property_bull/Splash.java | 85346aa0096e58e279f680575b83cd22f12f1aa0 | [] | no_license | CodeEraTech/PropertyBull | e4420cee2ef506ba43ee7462d97f26dae288656d | 54e7c0a588fd8f9a3b0bb47059178d74611ef0ac | refs/heads/master | 2020-09-11T01:33:06.105646 | 2019-11-15T10:01:39 | 2019-11-15T10:01:39 | 221,895,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,233 | java | package com.doomshell.property_bull;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;
public class Splash extends Activity {
RelativeLayout relativeLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
relativeLayout=(RelativeLayout)findViewById(R.id.RelativeLayout1);
Animation animation= AnimationUtils.loadAnimation(Splash.this,R.anim.fade_in);
relativeLayout.setAnimation(animation);
Handler handler = new Handler();
Runnable r = new Runnable() {
public void run() {
redirectview();
}
};
handler.postDelayed(r, 2000);
}
public void redirectview() {
// Intent GoTonext = new Intent(this, RegnLogin_Main.class);
Intent GoTonext = new Intent(this, RegnLogin_Main.class);
startActivity(GoTonext);
overridePendingTransition(R.anim.fade_in, R.anim.zoom_out);
finish();
}
} | [
"codeeratecxh@gmail.com"
] | codeeratecxh@gmail.com |
5eefb36796685b58da7901b3e71865d844c339c4 | f272cbba288db637e6a334b3258442d15c284655 | /src/main/java/br/com/pucgo/perguntaai/repositories/UserRepository.java | 7aa42a4a9835befe26655fe54098f2fe1d0ca1b2 | [] | no_license | LaraCotrim/pergunta-ai-backend | 2ff96ae18e297ee38a8e7d8e28abfc0f7b7e78fa | 76ef6332295cd9b1ca3794f4653ab746ddc33f9c | refs/heads/main | 2023-08-22T06:00:01.349481 | 2021-09-30T23:26:49 | 2021-09-30T23:26:49 | 412,248,378 | 0 | 0 | null | 2021-09-30T22:33:32 | 2021-09-30T22:33:31 | null | UTF-8 | Java | false | false | 376 | java | package br.com.pucgo.perguntaai.repositories;
import br.com.pucgo.perguntaai.models.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findByEmail(String email);
}
| [
"alexandrepontesgyn@gmail.com"
] | alexandrepontesgyn@gmail.com |
a1333543569e6062c3ff57cb02b0146064c4baad | 7c4337b1a1da1c81e112c310e04f120d862b33f4 | /src/main/java/com/github/cassandra/jdbc/cql/SqlToCqlTranslator.java | 17155340dd291fad898388c0f16b6076cfa24c5b | [
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"MIT",
"GPL-2.0-only",
"Apache-2.0"
] | permissive | narendrans/cassandra-jdbc-driver | dc9ebbe839c39f9812292127d2206ed9525ef46a | 42c5f839b259384be61f44e0dee8ee4cce555820 | refs/heads/master | 2020-03-19T03:44:56.395361 | 2018-06-06T13:43:30 | 2018-06-06T13:43:30 | 135,758,233 | 0 | 0 | Apache-2.0 | 2018-06-01T19:57:55 | 2018-06-01T19:57:54 | null | UTF-8 | Java | false | false | 11,130 | java | /**
* Copyright (C) 2015-2017, Zhichun Wu
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.github.cassandra.jdbc.cql;
import com.github.cassandra.jdbc.CassandraCqlStmtConfiguration;
import net.sf.jsqlparser.expression.*;
import net.sf.jsqlparser.expression.operators.arithmetic.*;
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
import net.sf.jsqlparser.expression.operators.relational.*;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.schema.Table;
import net.sf.jsqlparser.statement.select.*;
import java.util.List;
public class SqlToCqlTranslator implements SelectVisitor, FromItemVisitor,
SelectItemVisitor, ExpressionVisitor {
private final CassandraCqlStmtConfiguration config;
public SqlToCqlTranslator(CassandraCqlStmtConfiguration config) {
this.config = config;
}
public void visit(Addition addition) {
// throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(AllColumns allColumns) {
}
public void visit(AllComparisonExpression allComparisonExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(AllTableColumns allTableColumns) {
}
public void visit(AnalyticExpression aexpr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(WithinGroupExpression wgexpr) {
}
public void visit(AndExpression andExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(AnyComparisonExpression anyComparisonExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Between between) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(BitwiseAnd bitwiseAnd) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(BitwiseOr bitwiseOr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(BitwiseXor bitwiseXor) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(CaseExpression caseExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(CastExpression cast) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Column tableColumn) {
if (tableColumn.getTable() != null) {
tableColumn.setTable(null);
}
}
public void visit(Concat concat) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(DateValue dateValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Division division) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(DoubleValue doubleValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(EqualsTo equalsTo) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(ExistsExpression existsExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(ExtractExpression eexpr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Function function) {
}
public void visit(GreaterThan greaterThan) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(GreaterThanEquals greaterThanEquals) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(InExpression inExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(IntervalExpression iexpr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(IsNullExpression isNullExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(JdbcNamedParameter jdbcNamedParameter) {
}
public void visit(JdbcParameter jdbcParameter) {
}
public void visit(LateralSubSelect lateralSubSelect) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(LikeExpression likeExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(LongValue longValue) {
// throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(HexValue hexValue) {
}
public void visit(Matches matches) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(MinorThan minorThan) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(MinorThanEquals minorThanEquals) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Modulo modulo) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Multiplication multiplication) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(NotEqualsTo notEqualsTo) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(NullValue nullValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(OracleHierarchicalExpression oexpr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(OrExpression orExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Parenthesis parenthesis) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(PlainSelect plainSelect) {
if (plainSelect.getIntoTables() != null
|| plainSelect.getGroupByColumnReferences() != null
|| plainSelect.getJoins() != null
//|| plainSelect.getFromItem() == null
|| plainSelect.getSelectItems() == null) {
throw new UnsupportedOperationException("Not supported yet.");
}
FromItem selectFrom = plainSelect.getFromItem();
if (selectFrom != null) {
selectFrom.accept(this);
}
List<SelectItem> items = plainSelect.getSelectItems();
int index = 0;
for (SelectItem item : items) {
if (item instanceof AllTableColumns) {
AllTableColumns atc = (AllTableColumns) item;
if (atc.getTable() != null) {
items.set(index, new AllColumns());
}
} else {
item.accept(this);
}
index++;
}
long rowLimit = config.getConnectionConfig().getRowLimit();
if (config.noLimit()) {
plainSelect.setLimit(null);
} else if (rowLimit > 0) {
Limit limit = plainSelect.getLimit();
if (limit == null) {
limit = new Limit();
limit.setRowCount(rowLimit);
plainSelect.setLimit(limit);
} else {
// turn off not supported features
limit.setLimitAll(false);
limit.setOffsetJdbcParameter(false);
limit.setOffset(-1);
// apply default limits
if (limit.getRowCount() <= 0) {
limit.setRowCount(rowLimit);
}
}
}
}
public void visit(RegExpMatchOperator rexpr) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(JsonExpression jsonExpr) {
}
public void visit(RegExpMySQLOperator regExpMySQLOperator) {
}
public void visit(UserVariable var) {
}
public void visit(NumericBind bind) {
}
public void visit(KeepExpression aexpr) {
}
public void visit(MySQLGroupConcat groupConcat) {
}
public void visit(RowConstructor rowConstructor) {
}
public void visit(OracleHint hint) {
}
public void visit(TimeKeyExpression timeKeyExpression) {
}
public void visit(DateTimeLiteralExpression literal) {
}
public void visit(SelectExpressionItem selectExpressionItem) {
selectExpressionItem.getExpression().accept(this);
}
public void visit(SetOperationList setOpList) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(SignedExpression signedExpression) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(StringValue stringValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(SubJoin subjoin) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(SubSelect subSelect) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Subtraction subtraction) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(Table tableName) {
if (tableName.getAlias() != null) {
tableName.setAlias(null);
}
}
public void visit(TimestampValue timestampValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(TimeValue timeValue) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(ValuesList valuesList) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(TableFunction tableFunction) {
}
public void visit(WhenClause whenClause) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void visit(WithItem withItem) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
| [
"zhicwu@gmail.com"
] | zhicwu@gmail.com |
e5ecdebcb560b2effe6a1b900458c4f7739e2461 | 32e679e260affdb5af313369104a1b949bd7fee2 | /src/lk/ijse/foodcitysystem/controller/ItemController.java | 95668ea7e09ef22339e5b92825c858236621a9ed | [] | no_license | Tharu96/Foodcity-Management-System | 967a620f2fd6e3f41b51dcf92a8e7326aeea13d9 | aa4ab89479f023b6bf9fd4532162092f83637147 | refs/heads/master | 2022-11-19T04:12:59.021816 | 2020-07-19T17:35:35 | 2020-07-19T17:35:35 | 279,632,468 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,287 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lk.ijse.foodcitysystem.controller;
import java.util.ArrayList;
import lk.ijse.foodcitysystem.core.dto.ItemDTO;
import lk.ijse.foodcitysystem.dao.DAOFactory;
import lk.ijse.foodcitysystem.dao.custom.ItemDAO;
/**
*
* @author Lenovo™
*/
public class ItemController {
public static ItemDAO itemDAO=(ItemDAO)DAOFactory.getInstance().getDAO(DAOFactory.DAOTypes.ITEM);
public static boolean addItem(ItemDTO item) throws Exception{
boolean result=itemDAO.add(item);
return result;
}
public static boolean updateItem(ItemDTO item) throws Exception{
boolean result=itemDAO.update(item);
return result;
}
public static boolean deleteItem(ItemDTO item)throws Exception{
boolean result = itemDAO.delete(item);
return result;
}
public static ItemDTO searchItem(ItemDTO item) throws Exception{
ItemDTO searchedItem = itemDAO.search(item);
return searchedItem;
}
public static ArrayList<ItemDTO> getAllItems()throws Exception{
return itemDAO.getAll();
}
}
| [
"warnasiri1996@gmail.com"
] | warnasiri1996@gmail.com |
5d5103a87ced7dc0dc6279c4c0bd9467cae2647a | 211426babdd1f7e3080b1ae8f2be184e7db3073a | /app/src/main/java/com/example/myfirstapp/DisplayMessageActivity.java | d9810c9ee15285e6240372c9fc13a37340b0b802 | [] | no_license | tirzafidela/ElderlyCare | cd082215fb8864584828c404716f2a0b2bae7a88 | da029deccb3f9d39646eb42923876a1e6c70ba1b | refs/heads/master | 2020-03-27T08:30:10.135465 | 2018-08-27T07:25:55 | 2018-08-27T07:25:55 | 146,261,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,544 | java | package com.example.myfirstapp;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
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 com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import java.util.concurrent.TimeUnit;
public class DisplayMessageActivity extends AppCompatActivity {
EditText editPhone, editCode;
FirebaseAuth mAuth;
String code;
Button reg_button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_message);
Intent intent = getIntent();
String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
TextView textView = new TextView(this);
textView.setTextSize(40);
textView.setText(message);
editPhone = (EditText) findViewById(R.id.phone_field);
editCode = (EditText) findViewById(R.id.verification_field);
mAuth = FirebaseAuth.getInstance();
reg_button = (Button)findViewById(R.id.regist);
ViewGroup layout = (ViewGroup) findViewById(R.id.activity_display_message);
layout.addView(textView);
findViewById(R.id.send_code).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendVerificationCode();
}
});
reg_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//verifyCode();
Intent intent1 = new Intent(v.getContext(), MainActivity.class);
startActivity(intent1);
}
});
}
private void verifyCode() {
String inputcode = editCode.getText().toString();
PhoneAuthCredential cre = PhoneAuthProvider.getCredential(code, inputcode);
signInWithPhoneAuthCredential(cre);
}
private void signInWithPhoneAuthCredential(PhoneAuthCredential credential) {
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Toast.makeText(getApplicationContext(), "Login Success!", Toast.LENGTH_LONG).show();
} else {
if (task.getException() instanceof FirebaseAuthInvalidCredentialsException) {
Toast.makeText(getApplicationContext(), "Wrong Code!", Toast.LENGTH_LONG).show();
}
}
}
});
}
private void sendVerificationCode() {
String ph = editPhone.getText().toString();
if(ph.isEmpty() || (ph.length() <10)) {
editPhone.setError("Phone number is required");
editPhone.requestFocus();
return;
}
PhoneAuthProvider.getInstance().verifyPhoneNumber(
ph, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
this, // Activity (for callback binding)
mCallbacks); // OnVerificationStateChangedCallbacks
}
PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
}
@Override
public void onVerificationFailed(FirebaseException e) {
}
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
code = s;
}
};
}
| [
"tirzafidbernadus@gmail.com"
] | tirzafidbernadus@gmail.com |
7bccd84e6829962ec76e3451ae1723c6be8d4a06 | 4e2f605c74da3059a4a1d874aa64828ea6bac635 | /src/main/java/com/problems/jianZhiOffer/TurretAttack.java | bd74a9487db30cd0fc8479534ae50bc8841350d1 | [] | no_license | koujx/study-kou | 67e8996d5f454ebbcd30a84aa555677882598937 | bb14c3ffc5fa62c1983003052b3ac77524206dcf | refs/heads/master | 2023-06-06T14:07:10.287028 | 2021-06-28T12:43:00 | 2021-06-28T12:43:00 | 381,026,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,064 | java | package com.problems.jianZhiOffer;
import java.util.Scanner;
/**
* Created by 902 on 2016/3/22.
* 炮台攻击
* 兰博教训提莫之后,然后和提莫讨论起约德尔人,谈起约德尔人,自然少不了一个人,那就是黑默丁格------约德尔人历史上最伟大的科学家.
* 提莫说,黑默丁格最近在思考一个问题:黑默丁格有三个炮台,炮台能攻击到距离它R的敌人 (两点之间的距离为两点连续的距离,例如(3,0),(0,4)之间的距离是5),
* 如果一个炮台能攻击到敌人,那么就会对敌人造成1×的伤害.黑默丁格将三个炮台放在N*M方格中的点上,并且给出敌人的坐标.
* 问:那么敌人受到伤害会是多大?
* <p/>
* 输入描述:
* 第一行9个整数,R,x1,y1,x2,y2,x3,y3,x0,y0.R代表炮台攻击的最大距离,(x1,y1),(x2,y2),
* (x3,y3)代表三个炮台的坐标.(x0,y0)代表敌人的坐标.
* <p/>
* 输出描述:
* 输出一行,这一行代表敌人承受的最大伤害,(如果每个炮台都不能攻击到敌人,输出0×)
* <p/>
* 输入例子:
* 1 1 1 2 2 3 3 1 2
* <p/>
* 输出例子:
* 2x
*/
public class TurretAttack {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (input.hasNext()) {
int range = input.nextInt();
int[][] turrets = new int[3][2];
for (int i = 0; i < 3; i++) {
turrets[i][0] = input.nextInt();
turrets[i][1] = input.nextInt();
}
int[] enemy = {input.nextInt(), input.nextInt()};
TurretAttack.solution(range, turrets, enemy);
}
}
public static void solution(int range, int[][] turrets, int[] enemy) {
int attack = 0;
for (int i = 0; i < 3; i++) {
double l1 = Math.pow(turrets[i][0] - enemy[0], 2);
double l2 = Math.pow(turrets[i][1] - enemy[1], 2);
double l3 = Math.pow(range, 2);
if (l1 + l2 <= l3) attack++;
}
System.out.println(attack + "x");
}
}
| [
"koujiaxing@meituan.com"
] | koujiaxing@meituan.com |
b405d0eb5fd0173352528cf0094cfacad280fe0f | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a212/A212668Test.java | 523ccb446f8027f073dd7378875d36d7d798eb59 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a212;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A212668Test extends AbstractSequenceTest {
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
586863d56a49291c9a78d74d307e99e209e18ca1 | 7b4dc34c668f4c8a9052820deb45aa121fca59d9 | /graduate_design_plugin/src/buaa/sei/xyb/lda/jgibblda/Document.java | 536016342583ff9e2020243caaf8cc824bd8a164 | [] | no_license | xuyebing/xyb-graduate-design-plugin | 8593818c35fec95c2aa7da75195be1274346c64a | dacfbc4748d5ec9742ad08d43a6729b7bd6d269c | refs/heads/master | 2021-01-10T21:11:49.976910 | 2012-11-27T06:14:13 | 2012-11-27T06:14:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,480 | java | /*
* Copyright (C) 2007 by
*
* Xuan-Hieu Phan
* hieuxuan@ecei.tohoku.ac.jp or pxhieu@gmail.com
* Graduate School of Information Sciences
* Tohoku University
*
* Cam-Tu Nguyen
* ncamtu@gmail.com
* College of Technology
* Vietnam National University, Hanoi
*
* JGibbsLDA is a free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* JGibbsLDA is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with JGibbsLDA; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
package buaa.sei.xyb.lda.jgibblda;
import java.util.Vector;
public class Document {
//----------------------------------------------------
//Instance Variables
//----------------------------------------------------
public int [] words;
public String rawStr;
public int length;
//----------------------------------------------------
//Constructors
//----------------------------------------------------
public Document(){
words = null;
rawStr = "";
length = 0;
}
public Document(int length){
this.length = length;
rawStr = "";
words = new int[length];
}
public Document(int length, int [] words){
this.length = length;
rawStr = "";
this.words = new int[length];
for (int i =0 ; i < length; ++i){
this.words[i] = words[i];
}
}
public Document(int length, int [] words, String rawStr){
this.length = length;
this.rawStr = rawStr;
this.words = new int[length];
for (int i =0 ; i < length; ++i){
this.words[i] = words[i];
}
}
public Document(Vector<Integer> doc){
this.length = doc.size();
rawStr = "";
this.words = new int[length];
for (int i = 0; i < length; i++){
this.words[i] = doc.get(i);
}
}
public Document(Vector<Integer> doc, String rawStr){
this.length = doc.size();
this.rawStr = rawStr;
this.words = new int[length];
for (int i = 0; i < length; ++i){
this.words[i] = doc.get(i);
}
}
}
| [
"yebingxu@gmail.com"
] | yebingxu@gmail.com |
974b3e88ec928ebe3bcca4d91ca9ec53451072ec | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2018/4/SchemaConstraintsIT.java | 2b4cac328676b860921693640ed4d9b8c828740b | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 10,450 | java | /*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.rest;
import org.junit.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.neo4j.function.Factory;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.schema.ConstraintDefinition;
import org.neo4j.graphdb.schema.ConstraintType;
import org.neo4j.kernel.impl.annotations.Documented;
import org.neo4j.server.rest.domain.JsonParseException;
import org.neo4j.test.GraphDescription;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;
import static org.neo4j.graphdb.Label.label;
import static org.neo4j.helpers.collection.MapUtil.map;
import static org.neo4j.server.rest.domain.JsonHelper.createJsonFrom;
import static org.neo4j.server.rest.domain.JsonHelper.jsonToList;
import static org.neo4j.server.rest.domain.JsonHelper.jsonToMap;
import static org.neo4j.test.mockito.matcher.Neo4jMatchers.containsOnly;
import static org.neo4j.test.mockito.matcher.Neo4jMatchers.getConstraints;
import static org.neo4j.test.mockito.matcher.Neo4jMatchers.isEmpty;
public class SchemaConstraintsIT extends AbstractRestFunctionalTestBase
{
@Documented( "Create uniqueness constraint.\n" +
"Create a uniqueness constraint on a property." )
@Test
@GraphDescription.Graph( nodes = {} )
public void createPropertyUniquenessConstraint() throws JsonParseException
{
data.get();
String labelName = labels.newInstance();
String propertyKey = properties.newInstance();
Map<String, Object> definition = map( "property_keys", singletonList( propertyKey ) );
String result = gen.get().expectedStatus( 200 ).payload( createJsonFrom( definition ) ).post(
getSchemaConstraintLabelUniquenessUri( labelName ) ).entity();
Map<String, Object> serialized = jsonToMap( result );
Map<String, Object> constraint = new HashMap<>( );
constraint.put( "type", ConstraintType.UNIQUENESS.name() );
constraint.put( "label", labelName );
constraint.put( "property_keys", singletonList( propertyKey ) );
assertThat( serialized, equalTo( constraint ) );
}
@Documented( "Get a specific uniqueness constraint.\n" +
"Get a specific uniqueness constraint for a label and a property." )
@Test
@GraphDescription.Graph( nodes = {} )
public void getLabelUniquenessPropertyConstraint() throws JsonParseException
{
data.get();
String labelName = labels.newInstance();
String propertyKey = properties.newInstance();
createLabelUniquenessPropertyConstraint( labelName, propertyKey );
String result = gen.get().expectedStatus( 200 ).get(
getSchemaConstraintLabelUniquenessPropertyUri( labelName, propertyKey ) ).entity();
List<Map<String, Object>> serializedList = jsonToList( result );
Map<String, Object> constraint = new HashMap<>( );
constraint.put( "type", ConstraintType.UNIQUENESS.name() );
constraint.put( "label", labelName );
constraint.put( "property_keys", singletonList( propertyKey ) );
assertThat( serializedList, hasItem( constraint ) );
}
@SuppressWarnings( "unchecked" )
@Documented( "Get all uniqueness constraints for a label." )
@Test
@GraphDescription.Graph( nodes = {} )
public void getLabelUniquenessPropertyConstraints() throws JsonParseException
{
data.get();
String labelName = labels.newInstance();
String propertyKey1 = properties.newInstance();
String propertyKey2 = properties.newInstance();
createLabelUniquenessPropertyConstraint( labelName, propertyKey1 );
createLabelUniquenessPropertyConstraint( labelName, propertyKey2 );
String result = gen.get().expectedStatus( 200 ).get( getSchemaConstraintLabelUniquenessUri( labelName ) ).entity();
List<Map<String, Object>> serializedList = jsonToList( result );
Map<String, Object> constraint1 = new HashMap<>( );
constraint1.put( "type", ConstraintType.UNIQUENESS.name() );
constraint1.put( "label", labelName );
constraint1.put( "property_keys", singletonList( propertyKey1 ) );
Map<String, Object> constraint2 = new HashMap<>( );
constraint2.put( "type", ConstraintType.UNIQUENESS.name() );
constraint2.put( "label", labelName );
constraint2.put( "property_keys", singletonList( propertyKey2 ) );
assertThat( serializedList, hasItems( constraint1, constraint2 ) );
}
@SuppressWarnings( "unchecked" )
@Documented( "Get all constraints for a label." )
@Test
@GraphDescription.Graph( nodes = {} )
public void getLabelPropertyConstraints() throws JsonParseException
{
data.get();
String labelName = labels.newInstance();
String propertyKey1 = properties.newInstance();
createLabelUniquenessPropertyConstraint( labelName, propertyKey1 );
String result = gen.get().expectedStatus( 200 ).get( getSchemaConstraintLabelUri( labelName ) ).entity();
List<Map<String, Object>> serializedList = jsonToList( result );
Map<String, Object> constraint1 = new HashMap<>( );
constraint1.put( "type", ConstraintType.UNIQUENESS.name() );
constraint1.put( "label", labelName );
constraint1.put( "property_keys", singletonList( propertyKey1 ) );
assertThat( serializedList, hasItems( constraint1 ) );
}
@SuppressWarnings( "unchecked" )
@Documented( "Get all constraints." )
@Test
@GraphDescription.Graph( nodes = {} )
public void get_constraints() throws JsonParseException
{
data.get();
String labelName1 = labels.newInstance();
String propertyKey1 = properties.newInstance();
createLabelUniquenessPropertyConstraint( labelName1, propertyKey1 );
String result = gen.get().expectedStatus( 200 ).get( getSchemaConstraintUri() ).entity();
List<Map<String,Object>> serializedList = jsonToList( result );
Map<String, Object> constraint1 = new HashMap<>();
constraint1.put( "type", ConstraintType.UNIQUENESS.name() );
constraint1.put( "label", labelName1 );
constraint1.put( "property_keys", singletonList( propertyKey1 ) );
assertThat( serializedList, hasItems( constraint1 ) );
}
@Documented( "Drop uniqueness constraint.\n" +
"Drop uniqueness constraint for a label and a property." )
@Test
@GraphDescription.Graph( nodes = {} )
public void drop_constraint()
{
data.get();
String labelName = labels.newInstance();
String propertyKey = properties.newInstance();
ConstraintDefinition constraintDefinition = createLabelUniquenessPropertyConstraint( labelName, propertyKey );
assertThat( getConstraints( graphdb(), label( labelName ) ), containsOnly( constraintDefinition ) );
gen.get().expectedStatus( 204 ).delete( getSchemaConstraintLabelUniquenessPropertyUri( labelName, propertyKey ) ).entity();
assertThat( getConstraints( graphdb(), label( labelName ) ), isEmpty() );
}
/**
* Create an index for a label and property key which already exists.
*/
@Test
public void create_existing_constraint()
{
String labelName = labels.newInstance();
String propertyKey = properties.newInstance();
createLabelUniquenessPropertyConstraint( labelName, propertyKey );
Map<String, Object> definition = map( "property_keys", singletonList( propertyKey ) );
gen.get().expectedStatus( 409 ).payload( createJsonFrom( definition ) )
.post( getSchemaConstraintLabelUniquenessUri( labelName ) ).entity();
}
@Test
public void drop_non_existent_constraint()
{
String labelName = labels.newInstance();
String propertyKey = properties.newInstance();
gen.get().expectedStatus( 404 )
.delete( getSchemaConstraintLabelUniquenessPropertyUri( labelName, propertyKey ) );
}
@Test
public void create_compound_schema_index()
{
Map<String,Object> definition = map( "property_keys",
asList( properties.newInstance(), properties.newInstance() ) );
gen.get().expectedStatus( 200 )
.payload( createJsonFrom( definition ) ).post( getSchemaIndexLabelUri( labels.newInstance() ) );
}
@Test
public void create_compound_schema_constraint()
{
Map<String,Object> definition = map( "property_keys",
asList( properties.newInstance(), properties.newInstance() ) );
gen.get().expectedStatus( 405 )
.payload( createJsonFrom( definition ) ).post( getSchemaConstraintLabelUri( labels.newInstance() ) );
}
private ConstraintDefinition createLabelUniquenessPropertyConstraint( String labelName, String propertyKey )
{
try ( Transaction tx = graphdb().beginTx() )
{
ConstraintDefinition constraintDefinition = graphdb().schema().constraintFor( label( labelName ) )
.assertPropertyIsUnique( propertyKey ).create();
tx.success();
return constraintDefinition;
}
}
private final Factory<String> labels = UniqueStrings.withPrefix( "label" );
private final Factory<String> properties = UniqueStrings.withPrefix( "property" );
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
4fdae0b18f5ada2fb4e9254bcb2c74a068dadbdb | c0ebc3be02857f0c9b5217cfbf4239d0d081ecdb | /src/main/java/com/summer/ioc/AutoInjection.java | da09484ed59712ba1a5954f067ef0d0f76a7b4fc | [] | no_license | Debri/Summer | 8fb2a62627d9981dfb2dc93bdf49f544d394d0e2 | 324683d47723c8f4458bace2d18a99718e9cf12b | refs/heads/master | 2021-01-20T10:53:52.190304 | 2017-09-01T14:43:10 | 2017-09-01T14:43:10 | 101,653,756 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,114 | java | package com.summer.ioc;
import com.summer.ioc.annotation.Autowired;
import com.summer.ioc.annotation.MyBean;
import com.summer.core.GetClass;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Liuqi
*
* @date: 2017/8/28.
* @author: liuqi
* @version: v1.0.0
*/
public class AutoInjection {
public static void automaticInjection(String key, Map mmp) {
try {
// List<Class> list = GetClass.getClassList(key);
List<Class> list = GetClass.getClassList(key);
for (Class classes : list) {
//注册
Map<String, Object> judgeMap = new HashMap<String, Object>();
//注入
injection(mmp, classes, judgeMap);
}
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
//注入并判断是否循环依赖
private static void injection(Map mmp, Class classes, Map judgeMap)
throws Exception {
boolean isExist = classes.isAnnotationPresent(MyBean.class);
//如果该注解存在
if (isExist) {
MyBean myBean = (MyBean) classes.getAnnotation(MyBean.class);
String beanName = myBean.value(); //获得bean名称
if (null == judgeMap.get(beanName))
judgeMap.put(beanName, true);
else { //又返回依赖他
throw new Exception("循环依赖");
}
if (null == mmp.get(beanName)) { //还没有被注入
Object beanObj = classes.newInstance(); //获得bean实例
Field[] fields = classes.getDeclaredFields();
boolean fieldExist;
for (Field field : fields) {
fieldExist = field.isAnnotationPresent(Autowired.class);
if (fieldExist) {
String classtype = field.getGenericType().toString();
Class fieldClass = Class.forName(classtype.substring(6));
//强制设置值 破坏了封装性
field.setAccessible(true);
if (fieldClass.isAnnotationPresent(MyBean.class)) {//该属性依赖其它Bean
MyBean tbean = (MyBean) fieldClass.getAnnotation(MyBean.class);
injection(mmp, fieldClass, judgeMap);
field.set(beanObj, mmp.get(tbean.value()));
} else { //该属性不依赖其它Bean
Object object = fieldClass.newInstance();
field.set(beanObj, object);
}
}
}
mmp.put(beanName, beanObj);
}
}
}
public static void reinjection(Map mmp, Class classes, Object obj) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
Field[] fields = classes.getDeclaredFields();
boolean fieldExist;
for (Field field : fields) {
fieldExist = field.isAnnotationPresent(Autowired.class);
if (fieldExist) {
String classType = field.getGenericType().toString();
Class fieldClass = Class.forName(classType.substring(6));
field.setAccessible(true);
//强制设置值 破坏了封装性
field.setAccessible(true);
if (fieldClass.isAnnotationPresent(MyBean.class)) { //该属性依赖其它Bean
MyBean tbean = (MyBean) fieldClass.getAnnotation(MyBean.class);
field.set(obj, mmp.get(tbean.value()));
} else { //该属性不依赖其它Bean
Object object = fieldClass.newInstance();
field.set(obj, object);
}
}
}
}
}
| [
"18908356464@163.com"
] | 18908356464@163.com |
44a976c74cc2e58afcc4c819a569da227541c75a | f2ec1514cee5a3023ff076b81e6487628406e3f2 | /src/Negocio/NMateria.java | c8c683c688d630857f461183e1f3f669eb693aa1 | [] | no_license | hunterlh4/Biblioteca | c31faf39d701a46a389a8bf8f397146f5ac9db18 | bba4af4cb6ad0634bc9c0e563e53e1edc3b9e481 | refs/heads/master | 2020-07-28T23:30:03.984781 | 2019-09-19T14:49:44 | 2019-09-19T14:51:25 | 209,579,084 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,524 | java | package Negocio;
import java.sql.ResultSet;
import java.util.List;
import Entidad.EMateria;
import Interface.INegocio;
import Utilidad.Inicializador;
public class NMateria implements INegocio<EMateria> {
@Override
public int Agregar(EMateria Obj) {
// TODO Auto-generated method stub
try {
ResultSet r = NConexion.Ejecutar(Obj, "SP_AGREGAR_Materia");
r.first();
return r.getInt("lid");
} catch (Exception e) {
System.out.println("Error al Agregar Materia: " + e.getMessage());
return 0;
}
}
@Override
public boolean Modificar(EMateria Obj) {
// TODO Auto-generated method stub
try {
int afectados = NConexion.EjecutarActualizacion(Obj, "SP_MODIFICAR_Materia");
return afectados > 0;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public boolean Eliminar(EMateria Obj) {
// TODO Auto-generated method stub
try {
int afectados = NConexion.EjecutarActualizacion(Obj, "SP_ELIMINAR_Materia");
return afectados > 0;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public List<EMateria> Listar() {
List<EMateria> Lista = null;
// TODO Auto-generated method stub
try {
ResultSet r = NConexion.Ejecutar(new EMateria(), "SP_LISTAR_USUARIO");
Lista = (List<EMateria>) (List<?>) Inicializador.IniciarlizarArrayObjetos(r, new EMateria());
} catch (Exception e) {
e.printStackTrace();
}
return Lista;
}
}
| [
"Alex@Alex-PC"
] | Alex@Alex-PC |
0f03f3ad3fd115fb40bf96bf6247f73b3f2a8271 | 6ed178dde7113c053e00148d56baae43963b4a02 | /app/src/main/java/mx/mobiles/adapters/ViewPagerAdapter.java | 8086c893ddc966bff76628863ca830ad919ae66b | [
"Apache-2.0"
] | permissive | CarlosJJR/junamex-2015 | 0a55173dff5647bc08ae04a93f592cb0cda72244 | 35fe0ec64829a365cda3d14c4010c6c6241940df | refs/heads/master | 2021-01-01T05:40:31.851548 | 2015-07-17T16:21:36 | 2015-07-17T16:21:36 | 28,980,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,334 | java | package mx.mobiles.adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.text.DateFormatSymbols;
import mx.mobiles.junamex.ScheduleFragment;
/**
* Created by desarrollo16 on 22/01/15.
*/
public class ViewPagerAdapter extends FragmentPagerAdapter {
String[] namesOfDays;
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
namesOfDays = DateFormatSymbols.getInstance().getWeekdays();
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return ScheduleFragment.newInstance(ScheduleFragment.WED);
case 1:
return ScheduleFragment.newInstance(ScheduleFragment.THUR);
case 2:
return ScheduleFragment.newInstance(ScheduleFragment.FRI);
case 3:
return ScheduleFragment.newInstance(ScheduleFragment.SAT);
default:
return ScheduleFragment.newInstance(ScheduleFragment.WED);
}
}
@Override
public int getCount() {
return ScheduleFragment.DAYS_OF_JUNAMEX;
}
@Override
public CharSequence getPageTitle(int position) {
return namesOfDays[position + 4];
}
}
| [
"carlos.jjr25@gmail.com"
] | carlos.jjr25@gmail.com |
3bb658dad32ac108f7daf24d4cdb9cc09c786530 | 36d098e9a5f7fdd2b48b82e5d861739b41cdaa82 | /src/main/java/uk/gov/ons/ctp/response/kirona/drs/message/ActionInstructionReceiver.java | 53a1d8d402d352e16bcc6069e571f7b20539b9e5 | [] | no_license | pilif42/projectTotestTaskExecutorPauses | 01234137252e2e1024c9bcc1c27e788f6458c5b5 | 9685cb31ce566d9e2898c2353a21bbac0793ee5c | refs/heads/master | 2021-01-22T19:15:07.243100 | 2017-03-22T10:30:28 | 2017-03-22T10:30:28 | 85,185,206 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package uk.gov.ons.ctp.response.kirona.drs.message;
import uk.gov.ons.ctp.response.action.message.instruction.ActionInstruction;
/**
* The service that reads ActionInstructions from the inbound channel
*/
public interface ActionInstructionReceiver {
/**
* To process ActionInstructions from the input channel actionInstructionTransformed
* @param instruction the ActionInstruction to be processed
*/
void processInstruction(ActionInstruction instruction);
}
| [
"philippe.brossier@ons.gov.uk"
] | philippe.brossier@ons.gov.uk |
f3a585006e7db7e081906ee9f60783757d0f64e3 | a58d51d3cbf4d92e0a1a7ce8c793148843c0fb52 | /src/mapeditor/MapEditor.java | 2ba52ca639bfdb32d962888976f730c8a19a96ba | [
"MIT"
] | permissive | AgostonSzepessy/tilemap-editor | 32cf1e5a53a28b19d12a66f3f0d71a21014bd32c | ffa44e6f8f8073667b4d7a3133f3020e8ec78772 | refs/heads/master | 2021-01-13T00:45:29.366947 | 2015-10-10T01:22:35 | 2015-10-10T01:22:35 | 43,981,431 | 4 | 1 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mapeditor;
import javax.swing.JFrame;
/**
*
* @author agoston
*/
public class MapEditor {
private static JFrame window;
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
window = new JFrame();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.add(new MapEditorPanel());
window.setTitle("Map Editor");
window.pack();
window.setVisible(true);
}
}
| [
"agoston@localhost.localdomain"
] | agoston@localhost.localdomain |
80aee02128f99162218b567a8762eaa7f397a45c | 851285e56702e56c911626624e98be04c695acc2 | /bootic-android/bootic-android/app/src/main/java/com/w3engineers/ecommerce/bootic/ui/splashScreen/SplashActivity.java | 9ee8cc52f1e32ceb0d7051911ea54ec771655f8b | [] | no_license | abhinavjha98/ecommerce-app | f069c27f0836544c35d012a83a9a57f45dd116ba | 66ee6b2c465ee994e7f0d77e814a3d45576d6647 | refs/heads/master | 2021-01-05T23:47:30.044060 | 2020-02-20T18:15:11 | 2020-02-20T18:15:11 | 241,169,396 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 9,210 | java | package com.w3engineers.ecommerce.bootic.ui.splashScreen;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.Toast;
import com.airbnb.lottie.LottieAnimationView;
import com.droidnet.DroidListener;
import com.droidnet.DroidNet;
import com.w3engineers.ecommerce.bootic.R;
import com.w3engineers.ecommerce.bootic.data.helper.base.BaseActivity;
import com.w3engineers.ecommerce.bootic.data.helper.models.Slider;
import com.w3engineers.ecommerce.bootic.data.helper.response.MainProductResponse;
import com.w3engineers.ecommerce.bootic.data.helper.response.SettingsResponse;
import com.w3engineers.ecommerce.bootic.data.provider.retrofit.RetrofitClient;
import com.w3engineers.ecommerce.bootic.data.util.Constants;
import com.w3engineers.ecommerce.bootic.data.util.CustomSharedPrefs;
import com.w3engineers.ecommerce.bootic.data.util.NetworkHelper;
import com.w3engineers.ecommerce.bootic.data.util.SharedPref;
import com.w3engineers.ecommerce.bootic.ui.main.MainActivity;
import java.net.HttpURLConnection;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class SplashActivity extends BaseActivity<SplashMvpView, SplashPresenter> implements SplashMvpView, DroidListener {
private ImageView ivSplashImage;
private Intent mainIntent;
private long startTime, endTime;
private DroidNet mDroidNet;
private LottieAnimationView mLottieAnimationView;
private ConstraintLayout mLayoutNoNetConnectionText;
@Override
protected int getLayoutId() {
return R.layout.activity_splash;
}
@Override
protected void startUI() {
mainIntent = new Intent(SplashActivity.this, MainActivity.class);
ivSplashImage = findViewById(R.id.image_view_logo);
mLayoutNoNetConnectionText = findViewById(R.id.layout_no_net_connection_text);
mLottieAnimationView = findViewById(R.id.view_loading_star);
Animation transition = AnimationUtils.loadAnimation(this, R.anim.transition_alfa);
ivSplashImage.startAnimation(transition);
startTime = System.currentTimeMillis();
// getSettingCredential(this);
mDroidNet = DroidNet.getInstance();
mDroidNet.addInternetConnectivityListener(this);
}
/**
* getting setting credential
*
* @param context context
*/
public void getSettingCredential(final Context context) {
if (NetworkHelper.hasNetworkAccess(context)) {
RetrofitClient.getApiService().hitSetting(Constants.ServerUrl.API_TOKEN).enqueue(new Callback<SettingsResponse>() {
@Override
public void onResponse(@NonNull Call<SettingsResponse> call, @NonNull Response<SettingsResponse> response) {
if(response.body() != null){
presenter.settingProductPagination(SplashActivity.this, "1", CustomSharedPrefs.getLoggedInUserId(SplashActivity.this), "");
Log.d("currency",response.body().settingsModel.currencyFont);
CustomSharedPrefs.setCurrency(context, response.body().settingsModel.currencyFont);
SharedPref.getSharedPref(context).write(Constants.Preferences.TAX, response.body().settingsModel.tax);
SharedPref.getSharedPref(context).write(Constants.Preferences.MERCHANT_ID,
response.body().settingsModel.paymentModel.merchantId);
SharedPref.getSharedPref(context).write(Constants.Preferences.ENVIRONMENT,
response.body().settingsModel.paymentModel.environment);
SharedPref.getSharedPref(context).write(Constants.Preferences.PUBLIC_KEY,
response.body().settingsModel.paymentModel.publicKey);
SharedPref.getSharedPref(context).write(Constants.Preferences.PRIVATE_KEY,
response.body().settingsModel.paymentModel.privateKey);
SharedPref.getSharedPref(context).write(Constants.Preferences.COMPANY_NAME,
response.body().settingsModel.addressModel.companyName);
String companyAddress="";
if (response.body().settingsModel.addressModel.addressLine2==null){
companyAddress=response.body().settingsModel.addressModel.addressLine1+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.city+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.zipCode+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.state+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.country;
}else {
companyAddress=response.body().settingsModel.addressModel.addressLine1+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.addressLine1+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.city+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.zipCode+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.state+context.getResources().getString(R.string.coma)+
response.body().settingsModel.addressModel.country;
}
SharedPref.getSharedPref(context).write(Constants.Preferences.COMPANY_ADDRESS,companyAddress);
SharedPref.getSharedPref(context).write(Constants.Preferences.CURRENCY_POSITION,
response.body().settingsModel.currencyPosition);
}
}
@Override
public void onFailure(@NonNull Call<SettingsResponse> call,@NonNull Throwable t) {
Toast.makeText(context, getResources().getString(R.string.error), Toast.LENGTH_SHORT).show();
}
});
}
}
@Override
protected void stopUI() {
}
@Override
protected SplashPresenter initPresenter() {
return new SplashPresenter();
}
@Override
public void onProductListSuccess(MainProductResponse response) {
endTime = System.currentTimeMillis();
if (response.statusCode == HttpURLConnection.HTTP_OK) {
response.isOkay = response.dataModel != null;
} else {
response.isOkay = false;
}
CustomSharedPrefs.setMainResponse(this, response);
if (response.dataModel.mSliderMains!=null){
Slider slider=new Slider();
slider.mSliderMains=response.dataModel.mSliderMains;
CustomSharedPrefs.setSlider(this,slider );
}
checkTimeToFinish(endTime);
}
private void checkTimeToFinish(long endTime) {
double differenceInSec = (double) (endTime - startTime) / 1000;
if (differenceInSec >= 2.5) {
startActivity(mainIntent);
finish();
} else if (differenceInSec >= 2 && differenceInSec < 2.5) {
new Handler().postDelayed(() -> {
startActivity(mainIntent);
finish();
}, 1000);
} else if (differenceInSec >= 0 && differenceInSec <= 1.9) {
new Handler().postDelayed(() -> {
startActivity(mainIntent);
finish();
}, 2000);
}
}
@Override
public void onProductListError(String errorMessage) {
MainProductResponse response = new MainProductResponse();
response.isOkay = false;
CustomSharedPrefs.setMainResponse(this, response);
endTime = System.currentTimeMillis();
checkTimeToFinish(endTime);
}
@Override
public void onInternetConnectivityChanged(boolean isConnected) {
if (isConnected) {
//do Stuff with internet
netIsOn();
} else {
//no internet
netIsOff();
}
}
private void netIsOn(){
mLayoutNoNetConnectionText.setVisibility(View.GONE);
mLottieAnimationView.setVisibility(View.VISIBLE);
getSettingCredential(this);
}
private void netIsOff(){
mLayoutNoNetConnectionText.setVisibility(View.VISIBLE);
mLottieAnimationView.setVisibility(View.GONE);
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
}
| [
"abhinavjha98ald@gmail.com"
] | abhinavjha98ald@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.