blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
2
382
src_encoding
stringclasses
34 values
length_bytes
int64
9
3.8M
score
float64
1.5
4.94
int_score
int64
2
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
9
3.8M
download_success
bool
1 class
87e87a209012452c78ede2fd6c7bb40ef32e725a
Java
iosdouble/support-admin
/ruoyi-admin/src/main/java/com/zk/web/controller/kaquan/WxkqLaunchCardController.java
UTF-8
2,730
1.960938
2
[ "MIT" ]
permissive
package com.zk.web.controller.kaquan; import com.zk.common.core.controller.BaseController; import com.zk.common.core.domain.AjaxResult; import com.zk.common.utils.http.HttpClientUtil; import com.zk.common.utils.json.JsonUtil; import com.zk.system.domain.weixin.accesstoken.AccessToken; import com.zk.system.domain.weixin.accesstoken.WeixinGetToken; import com.zk.system.domain.weixin.domain.bean.entity.CardItem; import com.zk.system.domain.weixin.domain.req.CardShopRsq; import org.aspectj.weaver.loadtime.Aj; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.List; /** * @Classname WxkqLaunchCardController * @Description TODO 投放卡券相关内容 * @Date 2020/8/18 6:25 PM * @Created by nihui * @Version 1.0 * @Description WxkqLaunchCardController @see ruoyi */ @RestController public class WxkqLaunchCardController extends BaseController { @Autowired private WeixinGetToken weixinGetToken; /** * 生成微信卡券货架 */ @PostMapping("/initCardShop") public AjaxResult createCardShop(){ AccessToken token = weixinGetToken.getToken(); String url = "https://api.weixin.qq.com/card/landingpage/create?access_token=" + token.getAccess_token(); CardShopRsq cardShopRsq = new CardShopRsq(); cardShopRsq.setBanner("http://mmbiz.qpic.cn/mmbiz_png/B3zBXUpXXBX3y9ibfqWvN7NerZ86CtjT960IjMMOaiaEaNHjBPBicaGo6tMtIn0rqUJp4wuR24PjcO5WgLbNlJORQ/0"); cardShopRsq.setCan_share(true); cardShopRsq.setPage_title("普惠服务"); cardShopRsq.setScene("SCENE_NEAR_BY"); CardItem cardItem = new CardItem("pWHBzsx2ZPlC64IvXYe9t4iKNwm0","null"); CardItem cardItem1 = new CardItem("pWHBzsyP1l8p7_Szp15SH5nv3UC4","null"); CardItem cardItem2 = new CardItem("pWHBzs9bUHwU56R8idTgwyV62gXM","null"); CardItem cardItem3 = new CardItem("pWHBzs5NLhP0MYMn4Ia1IUdrbN6s","null"); List<CardItem> cardItemList = new ArrayList<>(); cardItemList.add(cardItem); cardItemList.add(cardItem1); cardItemList.add(cardItem2); cardItemList.add(cardItem3); cardShopRsq.setCard_list(cardItemList); String s = HttpClientUtil.sendPostJsonBody(url, JsonUtil.toJson(cardShopRsq)); System.out.println(s); return AjaxResult.success("OK"); } /** * 获取到微信页面方式展示的卡券列表 */ @GetMapping("/getCardList") public AjaxResult getSelfCardShopList(){ return AjaxResult.success("OK"); } }
true
6ced87ca328e6e647beb348cdbf980bc27ebaa43
Java
miqreh/pandocreondivinae
/src/vue/VueTexte.java
UTF-8
671
2.59375
3
[]
no_license
package vue; import java.awt.Color; import javax.swing.BoxLayout; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import modele.Partie; public class VueTexte extends JPanel{ private Partie partie; private JScrollPane jsp; public VueTexte(Partie partie){ this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); this.partie=partie; jsp = new JScrollPane(); this.add(jsp); } public Partie getPartie() { return partie; } public void setPartie(Partie partie) { this.partie = partie; } public JScrollPane getJsp() { return jsp; } public void setJsp(JScrollPane jsp) { this.jsp = jsp; } }
true
6333fd7fdae0847624a7557be6b7d9cac3e13b01
Java
camilomolina/plcbus-app
/src/common/src/main/java/cl/bennu/plcbus/common/domain/MovementActionDetail.java
UTF-8
998
2.15625
2
[]
no_license
package cl.bennu.plcbus.common.domain; import cl.bennu.plcbus.common.enums.MovementActionTypeEnum; /** * Created with IntelliJ IDEA. * User: _Camilo * Date: 08-07-13 * Time: 08:41 AM */ public class MovementActionDetail extends BaseDomain { private MovementAction movementAction; private Device device; private MovementActionTypeEnum movementActionTypeEnum; public MovementAction getMovementAction() { return movementAction; } public void setMovementAction(MovementAction movementAction) { this.movementAction = movementAction; } public Device getDevice() { return device; } public void setDevice(Device device) { this.device = device; } public MovementActionTypeEnum getMovementActionTypeEnum() { return movementActionTypeEnum; } public void setMovementActionTypeEnum(MovementActionTypeEnum movementActionTypeEnum) { this.movementActionTypeEnum = movementActionTypeEnum; } }
true
7bf408494b42713b6370fd00c86c0a57b841815a
Java
skltp-anpassningstjanster/riv.insuranceprocess.healthreporting.ForsakringskassanAdapterService
/FkEintygAdapterIC-validator/src/main/java/se/skl/skltpservices/adapter/fk/sendmedcertanswer/VardRequest2FkValidator.java
UTF-8
5,108
1.859375
2
[]
no_license
/** * Copyright (c) 2014 Inera AB, <http://inera.se/> * * This file is part of SKLTP. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package se.skl.skltpservices.adapter.fk.sendmedcertanswer; import static se.skl.skltpservices.adapter.fk.util.ValidatorUtil.getValidationErrors; import static se.skl.skltpservices.adapter.fk.util.ValidatorUtil.validateAdressVard; import static se.skl.skltpservices.adapter.fk.util.ValidatorUtil.validateLakarutlatande; import java.util.ArrayList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import se.inera.ifv.insuranceprocess.healthreporting.qa.v1.Amnetyp; import se.inera.ifv.insuranceprocess.healthreporting.qa.v1.LakarutlatandeEnkelType; import se.inera.ifv.insuranceprocess.healthreporting.qa.v1.VardAdresseringsType; import se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateanswerresponder.v1.AnswerToFkType; import se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateanswerresponder.v1.SendMedicalCertificateAnswerType; public class VardRequest2FkValidator { private final Logger logger = LoggerFactory.getLogger(getClass()); public void validateRequest(SendMedicalCertificateAnswerType parameters) throws Exception { // List of validation errors ArrayList<String> validationErrors = new ArrayList<String>(); // Validate incoming request try { // Check that we got any data at all if (parameters == null) { validationErrors.add("No SendMedicalCertificateAnswer found in incoming data!"); throw new Exception(); } // Check that we got an answer element if (parameters.getAnswer() == null) { validationErrors.add("No Answer element found in incoming request data!"); throw new Exception(); } AnswerToFkType inAnswer = parameters.getAnswer(); /** * Check meddelande data + lakarutlatande reference */ // Meddelande id vården - mandatory if (inAnswer.getVardReferensId() == null || inAnswer.getVardReferensId().length() < 1) { validationErrors.add("No vardReferens-id found!"); } // Meddelande id FK - mandatory if (inAnswer.getFkReferensId() == null || inAnswer.getFkReferensId().length() < 1) { validationErrors.add("No fkReferens-id found!"); } // Ämne - mandatory Amnetyp inAmne = inAnswer.getAmne(); if (inAmne == null) { validationErrors.add("No Amne element found!"); } /** * Check that we got a question */ if (inAnswer.getFraga() == null) { validationErrors.add("No Answer fraga element found!"); throw new Exception(); } if (inAnswer.getFraga().getMeddelandeText() == null || inAnswer.getFraga().getMeddelandeText().length() < 1) { validationErrors.add("No Answer fraga meddelandeText elements found or set!"); } if (inAnswer.getFraga().getSigneringsTidpunkt() == null) { validationErrors.add("No Answer fraga signeringsTidpunkt elements found or set!"); } /** * Check that we got an answer */ if (inAnswer.getSvar() == null) { validationErrors.add("No Answer svar element found!"); throw new Exception(); } if (inAnswer.getSvar().getMeddelandeText() == null || inAnswer.getSvar().getMeddelandeText().length() < 1) { validationErrors.add("No Answer svar meddelandeText elements found or set!"); } if (inAnswer.getSvar().getSigneringsTidpunkt() == null) { validationErrors.add("No Answer svar signeringsTidpunkt elements found or set!"); } // Avsänt tidpunkt - mandatory if (inAnswer.getAvsantTidpunkt() == null) { validationErrors.add("No or wrong avsantTidpunkt found!"); } LakarutlatandeEnkelType inLakarUtlatande = inAnswer.getLakarutlatande(); validateLakarutlatande(validationErrors, inLakarUtlatande); /** * Check avsändar data. */ VardAdresseringsType inAddressVard = inAnswer.getAdressVard(); validateAdressVard(validationErrors, inAddressVard); // Check if we got any validation errors that not caused an // Exception if (validationErrors.size() > 0) { logger.error("Validate exception:" + getValidationErrors(validationErrors)); throw new Exception(); } // No validation errors! } catch (Exception e) { throw new Exception(getValidationErrors(validationErrors)); } } }
true
f65ae33f62857dcb645e130b13c15db309ed7935
Java
lastfreeacc/try-event-proc
/consumer/src/main/java/ru/lastfreeacc/consumer/Runner.java
UTF-8
705
2.0625
2
[]
no_license
package ru.lastfreeacc.consumer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Runner implements CommandLineRunner { private final LogConsumer logConsumer; @Autowired public Runner(LogConsumer logConsumer) { this.logConsumer = logConsumer; } public static void main(String[] args) { SpringApplication.run(Runner.class, args); } @Override public void run(String... args) throws Exception { logConsumer.consume(); } }
true
2df6281fa602a22f0c491ab25553ab4ac0db7b55
Java
RomainChrfz/GestionBudgetApp
/app/src/main/java/fr/romaincharfaz/mapremiereapp/controleur/Dashboard.java
UTF-8
17,856
1.648438
2
[ "MIT" ]
permissive
package fr.romaincharfaz.mapremiereapp.controleur; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.ListPopupWindow; import androidx.core.content.ContextCompat; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.graphics.Canvas; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.NumberPicker; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.snackbar.Snackbar; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import fr.romaincharfaz.mapremiereapp.R; import fr.romaincharfaz.mapremiereapp.model.Gain; import fr.romaincharfaz.mapremiereapp.view.CategoryAdapter; import fr.romaincharfaz.mapremiereapp.view.CategoryItem; import fr.romaincharfaz.mapremiereapp.view.GainAdapter; import fr.romaincharfaz.mapremiereapp.view.GainViewModel; import it.xabaras.android.recyclerview.swipedecorator.RecyclerViewSwipeDecorator; import static java.lang.Math.abs; public class Dashboard extends AppCompatActivity { public static final String CURRENT_LIVRET = "fr.romaincharfaz.mapremiereapp.controleur.Dashboard.CURRENT_LIVRET"; public static final String CURRENT_LIVRET_NAME = "fr.romaincharfaz.mapremiereapp.controleur.Dashboard.CURRENT_LIVRET_NAME"; public static final String CURRENT_USER = "fr.romaincharfaz.mapremiereapp.controleur.Dashboard.CURRENT_USER"; private GainViewModel gainViewModel; private ArrayList<CategoryItem> mCategoryList; public static boolean edit; public static boolean expense; public static int categoryselected = 0; private Gain deletedGain; private Gain modifiedGain; private long currentLivret; private String currentUser; private TextView perc_txt; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //requestWindowFeature(1); //getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); //getWindow().setStatusBarColor(Color.TRANSPARENT); setContentView(R.layout.activity_dashboard); Intent intent = getIntent(); currentUser = intent.getStringExtra(CURRENT_USER); currentLivret = intent.getLongExtra(CURRENT_LIVRET,-1); String currentLivretName = intent.getStringExtra(CURRENT_LIVRET_NAME); setTitle(currentLivretName); initList(); perc_txt = findViewById(R.id.txt_percentage); progressBar = findViewById(R.id.progressBar); ImageView add_expense = findViewById(R.id.add_expense_btn); ImageView add_income = findViewById(R.id.add_income_btn); add_expense.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { edit = false; expense = true; categoryselected = 0; Gain gainclicked = new Gain(0.0,"",0,0,0,0,"",0,""); bottomsheetconfiguration(gainclicked); } }); add_income.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { edit = false; expense = false; categoryselected = 10; Gain gainclicked = new Gain(0.0,"",0,0,0,0,"",0,""); bottomsheetconfiguration(gainclicked); } }); final RecyclerView recyclerView_expense = findViewById(R.id.recycler_expense); recyclerView_expense.setLayoutManager(new LinearLayoutManager(this)); recyclerView_expense.setHasFixedSize(true); final RecyclerView recyclerView_income = findViewById(R.id.recycler_income); recyclerView_income.setLayoutManager(new LinearLayoutManager(this)); //recyclerView_income.setHasFixedSize(true); final GainAdapter adapter_expense = new GainAdapter(); final GainAdapter adapter_income = new GainAdapter(); recyclerView_income.setAdapter(adapter_income); adapter_income.setOnItemClickListener(new GainAdapter.OnItemClickListener() { @Override public void OnItemClick(int position) { Gain gainclicked = adapter_income.getGainAt(position); edit = true; expense = false; categoryselected = gainclicked.getCategory(); bottomsheetconfiguration(gainclicked); } @Override public void OnCatClick(int position, View view) { } }); recyclerView_expense.setAdapter(adapter_expense); adapter_expense.setOnItemClickListener(new GainAdapter.OnItemClickListener() { @Override public void OnItemClick(int position) { Gain gainclicked = adapter_expense.getGainAt(position); edit = true; expense = true; categoryselected = gainclicked.getCategory(); bottomsheetconfiguration(gainclicked); } @Override public void OnCatClick(int position, View view) { modifiedGain = adapter_expense.getGainAt(position); showPopup(view); } }); gainViewModel = new ViewModelProvider(Dashboard.this).get(GainViewModel.class); gainViewModel.getAllGains(currentLivret,currentUser).observe(this, new Observer<List<Gain>>() { @Override public void onChanged(List<Gain> gains) { List<Gain> gain_pos = new ArrayList<>(); List<Gain> gain_neg = new ArrayList<>(); for (int i=0; i<gains.size(); i++) { Gain currentGain = gains.get(i); if (currentGain.getGainValue() >= 0) { gain_pos.add(currentGain); }else { gain_neg.add(currentGain); } } adapter_expense.submitList(gain_neg); adapter_income.submitList(gain_pos); total_calcul(gains); } }); new ItemTouchHelper((new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { @Override public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { return false; } @Override public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) { int position = viewHolder.getAdapterPosition(); switch (direction) { case ItemTouchHelper.LEFT : deletedGain = adapter_expense.getGainAt(position); gainViewModel.delete(deletedGain); Snackbar.make(recyclerView_expense, getString(R.string.expense_deleted), Snackbar.LENGTH_LONG).setAction(getString(R.string.undo), new View.OnClickListener() { @Override public void onClick(View v) { gainViewModel.insert(deletedGain); } }).show(); break; } } @Override public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { new RecyclerViewSwipeDecorator.Builder(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) .addSwipeLeftBackgroundColor(ContextCompat.getColor(Dashboard.this,R.color.red)) .addSwipeLeftActionIcon(R.drawable.ic_delete_sweep_white) .addSwipeLeftLabel(getString(R.string.delete)) .setSwipeLeftLabelColor(Color.WHITE) .create() .decorate(); super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); } })).attachToRecyclerView(recyclerView_expense); new ItemTouchHelper((new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { @Override public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { return false; } @Override public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) { int position = viewHolder.getAdapterPosition(); switch (direction) { case ItemTouchHelper.LEFT : deletedGain = adapter_income.getGainAt(position); gainViewModel.delete(deletedGain); Snackbar.make(recyclerView_income, getString(R.string.expense_deleted), Snackbar.LENGTH_LONG).setAction(getString(R.string.undo), new View.OnClickListener() { @Override public void onClick(View v) { gainViewModel.insert(deletedGain); } }).show(); break; } } @Override public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { new RecyclerViewSwipeDecorator.Builder(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) .addSwipeLeftBackgroundColor(ContextCompat.getColor(Dashboard.this,R.color.red)) .addSwipeLeftActionIcon(R.drawable.ic_delete_sweep_white) .addSwipeLeftLabel(getString(R.string.delete)) .setSwipeLeftLabelColor(Color.WHITE) .create() .decorate(); super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); } })).attachToRecyclerView(recyclerView_income); } //@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private void showPopup(View view) { final ListPopupWindow listPopupWindow = new ListPopupWindow(this); initList(); CategoryAdapter mAdapter = new CategoryAdapter(this, mCategoryList); listPopupWindow.setAdapter(mAdapter); listPopupWindow.setAnchorView(view); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { listPopupWindow.setBackgroundDrawable(getDrawable(R.drawable.custom_spinner)); } listPopupWindow.setContentWidth(800); listPopupWindow.setModal(true); listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try { Gain gain = new Gain(modifiedGain.getGainValue(), modifiedGain.getDescription(), modifiedGain.getDay(), modifiedGain.getMonth(), modifiedGain.getYear(), position, modifiedGain.getUrlJustif(), modifiedGain.getUserId(), modifiedGain.getUsernameId()); gain.setId(modifiedGain.getId()); gainViewModel.update(gain); listPopupWindow.dismiss(); }catch (Exception e){ Toast.makeText(Dashboard.this, e.toString(), Toast.LENGTH_LONG).show(); } } }); listPopupWindow.show(); } private void initList() { mCategoryList = new ArrayList<>(); mCategoryList.add(new CategoryItem(getString(R.string.cat_base), R.drawable.ic_cat_unknown)); mCategoryList.add(new CategoryItem(getString(R.string.cat_courses), R.drawable.ic_cat_courses)); mCategoryList.add(new CategoryItem(getString(R.string.cat_fuel), R.drawable.ic_cat_fuel)); mCategoryList.add(new CategoryItem(getString(R.string.cat_gift), R.drawable.ic_cat_gift)); mCategoryList.add(new CategoryItem(getString(R.string.cat_phone), R.drawable.ic_cat_phone)); mCategoryList.add(new CategoryItem(getString(R.string.cat_transport_commun), R.drawable.ic_cat_transport_commun)); mCategoryList.add(new CategoryItem(getString(R.string.cat_trip), R.drawable.ic_cat_trip)); mCategoryList.add(new CategoryItem(getString(R.string.cat_diy), R.drawable.ic_cat_diy)); mCategoryList.add(new CategoryItem(getString(R.string.cat_cinema), R.drawable.ic_cat_cinema)); mCategoryList.add(new CategoryItem(getString(R.string.cat_restaurant), R.drawable.ic_cat_restaurant)); } private void bottomsheetconfiguration(final Gain gainclicked) { final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(Dashboard.this, R.style.BottomSheetDialogTheme); final View bottomSheetView = LayoutInflater.from(getApplicationContext()).inflate(R.layout.layout_bottom_sheet, (LinearLayout) findViewById(R.id.bottom_sheet_container)); final NumberPicker day = bottomSheetView.findViewById(R.id.day_picker); final EditText mDescription = bottomSheetView.findViewById(R.id.et_description); final EditText mValue = bottomSheetView.findViewById(R.id.et_valeur); day.setFormatter(new NumberPicker.Formatter() { @Override public String format(int value) { return String.format("%02d",value); } }); final NumberPicker month = bottomSheetView.findViewById(R.id.month_picker); final NumberPicker year = bottomSheetView.findViewById(R.id.year_picker); final String[] months = new String[]{"jan.","fév.","mar.","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."}; day.setMinValue(1); day.setMaxValue(31); month.setDisplayedValues(months); month.setMinValue(0); month.setMaxValue(months.length-1); year.setMinValue(1789); year.setMaxValue(2100); Calendar c = Calendar.getInstance(); if(edit) { day.setValue(gainclicked.getDay()); month.setValue(gainclicked.getMonth()); year.setValue(gainclicked.getYear()); mDescription.setText(gainclicked.getDescription()); mValue.setText(String.valueOf(abs(gainclicked.getGainValue()))); }else { day.setValue(c.get(Calendar.DAY_OF_MONTH)); month.setValue(c.get(Calendar.MONTH)); year.setValue(c.get(Calendar.YEAR)); } bottomSheetView.findViewById(R.id.btn_valider).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String description = mDescription.getText().toString().trim(); String value = mValue.getText().toString().trim(); if (description.isEmpty() || value.isEmpty()) { Toast.makeText(Dashboard.this,"Ces champs ne peuvent pas être vide",Toast.LENGTH_SHORT).show(); return; } double nvalue = Double.parseDouble(value); if (expense) { nvalue = - nvalue; } Gain newGain = new Gain(nvalue, description, day.getValue(), month.getValue(),year.getValue(),categoryselected, "", currentLivret,currentUser); if (edit) { newGain.setId(gainclicked.getId()); gainViewModel.update(newGain); }else{ gainViewModel.insert(newGain); } bottomSheetDialog.dismiss(); } }); bottomSheetDialog.setContentView(bottomSheetView); bottomSheetDialog.show(); } private void total_calcul(List<Gain> totgain) { double tot = 0.0; double pos = 0.0; for (int i=0; i<totgain.size(); i++) { double val = totgain.get(i).getGainValue(); tot += val; if(val >= 0.0) { pos += val; } } tot = Math.round(tot * 100d) / 100d; pos = Math.round(pos * 100d) / 100d; int percentage = (int) (tot*100/pos); String tot_ss = String.valueOf(tot); SpannableString ss = new SpannableString(tot_ss); if (tot >= 0) { ForegroundColorSpan fcsg = new ForegroundColorSpan(Color.GREEN); ss.setSpan(fcsg,0,tot_ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); }else { ForegroundColorSpan fcsr = new ForegroundColorSpan(Color.RED); ss.setSpan(fcsr,0,tot_ss.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } progressBar.setProgress(percentage); perc_txt.setText("Reste : " + ss + " | " + percentage + " %"); } }
true
a3933edd5890e96f2ce4d0d9be6e13e3ff1a90c8
Java
abdelmonaimsalhaoui/Java_Revision
/RuntimePolymorphism/src/example/OverloadingError.java
UTF-8
510
2.984375
3
[]
no_license
package example; public class OverloadingError { public static void aMethod(byte a) { System.out.println("byte"); } public static void aMethod(short b) { System.out.println("short"); } public static void aMethod(double c) { System.out.println("double"); } public static void aMethod(int a, long b) { System.out.println("int, long"); } public static void aMethod(long a, int b) { System.out.println("long, int"); } public static void main(String[] args) { aMethod(9); } }
true
5fc3423427950000258c3f3d63485e74bdccd6c7
Java
AaronMelcher/IndividualWork
/src/objectOrientedProgramming/GreeterTest.java
UTF-8
245
2.9375
3
[]
no_license
package objectOrientedProgramming; public class GreeterTest { public static void main(String[] args) { // TODO Auto-generated method stub Greeter bob = new Greeter(); bob.setAge(99); System.out.print(bob.getAge()); } }
true
88e9f71a936e871a1c65d14ba665683085862c83
Java
CocoaK/java-project-source
/smarthome-web_lqh/src/main/java/com/biencloud/smarthome/web/log/service/impl/ClientLogServiceImpl.java
UTF-8
3,974
1.929688
2
[]
no_license
package com.biencloud.smarthome.web.log.service.impl; import java.util.Date; import java.util.List; import com.biencloud.smarthome.web.base.service.BaseService; import com.biencloud.smarthome.web.common.util.DateTimeUtil; import com.biencloud.smarthome.web.common.util.MapUtil; import com.biencloud.smarthome.web.common.vo.PagingVO; import com.biencloud.smarthome.web.hdfstask.vo.HdfsTaskVO; import com.biencloud.smarthome.web.log.service.IClientLogService; import com.biencloud.smarthome.web.log.vo.ClientLogVO; import com.biencloud.smarthome.web.wsclient.stub.ClientLog; import com.biencloud.smarthome.web.wsclient.stub.Paging; /** * * 类名称:ClientLogServiceImpl 类描述:终端日志业务接口实现类 * * @author: kouy * @version: 0.1 * @date: 2012-7-24 下午4:15:52 */ public class ClientLogServiceImpl extends BaseService<ClientLogVO> implements IClientLogService { @Override public PagingVO<ClientLogVO> queryClientLogForPaging(int pageNum, int pageSize, ClientLogVO clientLogVO) { PagingVO<ClientLogVO> pv = new PagingVO<ClientLogVO>(); MapUtil.clearMap(); String hql = null; List<Object> list = null; if (clientLogVO != null) { if (!"".equals(clientLogVO.getDataType()) && clientLogVO.getDataType() != null) { MapUtil.addKeyValueToMap("dataType like", "%"+ clientLogVO.getDataType().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } if (!"".equals(clientLogVO.getAreaName()) && clientLogVO.getAreaName() != null) { MapUtil.addKeyValueToMap("areaName like", "%" + clientLogVO.getAreaName().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } if (!"".equals(clientLogVO.getDeviceName())&& clientLogVO.getDeviceName() != null) { MapUtil.addKeyValueToMap("deviceName like", "%" + clientLogVO.getDeviceName().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } if (!"".equals(clientLogVO.getDeviceMac()) && clientLogVO.getDeviceMac() != null) { MapUtil.addKeyValueToMap("deviceMac like", "%" + clientLogVO.getDeviceMac().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } if (!"".equals(clientLogVO.getDeviceNo()) && clientLogVO.getDeviceNo() != null) { MapUtil.addKeyValueToMap("deviceNo like", "%" + clientLogVO.getDeviceNo().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } if (!"".equals(clientLogVO.getIp()) && clientLogVO.getIp() != null) { MapUtil.addKeyValueToMap("ip like", "%" + clientLogVO.getIp().trim().replace("%", "\\%").replace("_", "\\_") + "%"); } hql = MapUtil.covertMapKeyToCondition(); list = MapUtil.covertMapValueToObjectList(); } pv = this.queryClientLogForPaging(pageNum, pageSize, hql, "addTime", "desc", list); return pv; } /** * * 方法的描述: 分页查询 * @author: kouy * @version: 0.1 * @date: 2012-7-24 下午4:23:48 * @param pageNum * @param pageSize * @param condition * @param orderString * @param orderBy * @param conditionValue * @return */ public PagingVO<ClientLogVO> queryClientLogForPaging(int pageNum, int pageSize, String condition, String orderString, String orderBy, List<Object> conditionValue) { String order = null; if (orderString != null && orderBy != null) { order = " order by " + orderString + " " + orderBy; } Paging paging = getSmartHomeService().queryClientLogForPaging(pageNum, pageSize, condition, order, conditionValue); PagingVO<ClientLogVO> pv = super.convertToPagingVO(paging, "addTime"); return pv; } @Override public ClientLogVO queryClientLogById(Long id) { ClientLogVO clv=null; ClientLog cl=getSmartHomeService().queryClientLogById(id); if(cl!=null) { clv=new ClientLogVO(cl.getId(), cl.getDeviceNo(), cl.getDeviceMac(), cl.getDeviceName(), cl.getDataType(), cl.getDataContent(),DateTimeUtil.convertXMLGregorianCalendarToDate(cl.getAddTime(), "yyyy-MM-dd HH:mm:ss"), cl.getIp(), cl.getAreaName(),cl.getLaunch()); } return clv; } }
true
6619f6d92698b63f5fd728610ad13d83a8428ea1
Java
crismdq22/Compiler
/src/CodigoIntermedio/ConvertidorAssembler.java
UTF-8
7,476
2.578125
3
[]
no_license
package CodigoIntermedio; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import AnalizadorLexico.TablaSimbolos; public class ConvertidorAssembler { public static final String labelDivCero = "LabelDivCero"; public static final String labelOverflow = "LabelOverflow"; public static final String labelFueraRango = "LabelIndiceFueraDeRango"; private String archivo; static ControladorTercetos controladorTercetos; static TablaSimbolos tablaSimb; static File arch; public ConvertidorAssembler( ControladorTercetos controladorTercetos ) throws IOException { ConvertidorAssembler.controladorTercetos = controladorTercetos; tablaSimb = null; } public void setTablaSimb(TablaSimbolos tablaSimb) { ConvertidorAssembler.tablaSimb = tablaSimb; } public void setArchivo(String archivo) { this.archivo=archivo; } public void generarAssembler () throws IOException{ arch = new File(archivo.substring(0,archivo.length()-4)+".asm"); writeFile1(); String comc = "cmd /c .\\masm32\\bin\\ml /c /Zd /coff"+archivo.substring(0,archivo.length()-4)+ ".asm"; Process ptasm32 = Runtime.getRuntime().exec(comc); ptasm32.getInputStream(); String coml = "cmd /c \\masm32\\bin\\Link /SUBSYSTEM:CONSOLE"+archivo.substring(0,archivo.length()-4)+".obj "; Process ptlink32 = Runtime.getRuntime().exec(coml); ptlink32.getInputStream(); } public static void writeFile1() throws IOException { FileOutputStream fos = new FileOutputStream(arch); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos)); bw.write(".386" + System.lineSeparator() + ".model flat, stdcall" + System.lineSeparator() + "option casemap :none" + System.lineSeparator() + "include \\masm32\\include\\windows.inc" + System.lineSeparator() + "include \\masm32\\include\\kernel32.inc" + System.lineSeparator() + "include \\masm32\\include\\user32.inc" + System.lineSeparator() + "includelib \\masm32\\lib\\kernel32.lib" + System.lineSeparator() + "includelib \\masm32\\lib\\user32.lib" + System.lineSeparator() + "include \\masm32\\include\\masm32rt.inc"+ System.lineSeparator() + "dll_dllcrt0 PROTO C"+ System.lineSeparator() + "printf PROTO C :VARARG"+ System.lineSeparator() +".data" + System.lineSeparator()); String data = tablaSimb.getAssembler() ; data = data + "@param DWORD ?"+System.lineSeparator(); data = data + "@retI DW ?"+System.lineSeparator(); data = data + "@retD QWORD ?"+System.lineSeparator(); data = data + "@printI DWORD ?"+System.lineSeparator(); data = data + "@printD QWORD ?"+System.lineSeparator(); data = data + "@maxD QWORD 1.7976931348623157D308"+System.lineSeparator(); data = data + "@minD QWORD 2.2250738585072014D-308"+System.lineSeparator(); data = data + controladorTercetos.getPrintsAssembler(); data = data + "DividirCero db \"Error al dividir por cero!\", 0" + System.lineSeparator(); data = data + "errorOverflow db \"Se produce overflow en una multiplicacion\", 0" + System.lineSeparator(); data = data + "FueraRango db \"Se intento acceder a una posicion de coleccion fuera de rango!\", 0" + System.lineSeparator(); data = data + "estado DW ? "+System.lineSeparator(); data = data + System.lineSeparator() + ".code"+ System.lineSeparator(); bw.write( data ); //Inicia el codigo String code = "start:" + System.lineSeparator() + (String) controladorTercetos.generarAssembler(); code = code + "invoke ExitProcess, 0" + System.lineSeparator(); bw.write( code ); String errores = getErroresRunTime(); bw.write(errores); bw.write( "end start" ); bw.close(); } private static String getErroresRunTime() { StringBuilder errores =new StringBuilder(labelDivCero + ":" + System.lineSeparator()); errores.append( "invoke MessageBox, NULL, addr DividirCero, addr DividirCero, MB_OK" + System.lineSeparator()); errores.append("invoke ExitProcess, 0" + System.lineSeparator()); errores.append(labelOverflow + ":" + System.lineSeparator()); errores.append("invoke MessageBox, NULL, addr errorOverflow, addr errorOverflow, MB_OK" + System.lineSeparator()); errores.append("invoke ExitProcess, 0" + System.lineSeparator()); errores.append(labelFueraRango + ":" + System.lineSeparator()); errores.append("invoke MessageBox, NULL, addr FueraRango, addr FueraRango, MB_OK" + System.lineSeparator()); errores.append( "invoke ExitProcess, 0" + System.lineSeparator()); errores.append("@FUNCTION_FirstI:"+System.lineSeparator() +"MOV EAX, @param"+System.lineSeparator() +"MOV CX, [EAX+2]"+System.lineSeparator() +"MOV @retI, CX"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append("@FUNCTION_FirstD:"+System.lineSeparator() +"MOV EAX, @param"+System.lineSeparator() +"FLD QWORD PTR [EAX+8]"+System.lineSeparator() +"FSTP @retD"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append( "@FUNCTION_LastI:"+System.lineSeparator() +"CALL @FUNCTION_LengthI"+System.lineSeparator() +"MOV AX, @retI"+System.lineSeparator() +"MOVZX EAX, AX"+System.lineSeparator() +"IMUL EAX, 2"+System.lineSeparator() +"ADD EAX, @param"+System.lineSeparator() +"MOV CX, [EAX]"+System.lineSeparator() +"MOV @retI, CX"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append("@FUNCTION_LastD:"+System.lineSeparator() +"CALL @FUNCTION_LengthD"+System.lineSeparator() +"MOV AX, @retI"+System.lineSeparator() +"MOVZX EAX, AX"+System.lineSeparator() +"IMUL EAX, 8"+System.lineSeparator() +"ADD EAX, @param"+System.lineSeparator() +"FLD QWORD PTR [EAX]"+System.lineSeparator() +"FSTP @retD"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append("@FUNCTION_LengthI:"+System.lineSeparator()+ "MOV EAX, @param"+System.lineSeparator() +"MOV CX, [EAX]"+System.lineSeparator() +"MOV @retI, CX"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append("@FUNCTION_LengthD:"+System.lineSeparator()+ "MOV EAX, @param"+System.lineSeparator() + "FLD QWORD PTR [EAX]"+System.lineSeparator() +"FISTP @retI"+System.lineSeparator() +"RET"+System.lineSeparator()); errores.append("@FUNCTION_MulCheck:"+System.lineSeparator()); errores.append("FTST "+System.lineSeparator()); errores.append("FSTSW estado "+System.lineSeparator()); errores.append("MOV AX,estado "+System.lineSeparator()); errores.append("SAHF "+System.lineSeparator()); errores.append("JE LabelZero"+System.lineSeparator()); errores.append("FABS"+System.lineSeparator()); errores.append("FCOM @maxD"+System.lineSeparator()); errores.append("FSTSW estado "+System.lineSeparator()); errores.append("MOV AX,estado "+System.lineSeparator()); errores.append("SAHF "+System.lineSeparator()); errores.append("JA "+ ConvertidorAssembler.labelOverflow+ System.lineSeparator()); errores.append("FCOM @minD"+System.lineSeparator()); errores.append("FSTSW estado "+System.lineSeparator()); errores.append("MOV AX,estado "+System.lineSeparator()); errores.append("SAHF "+System.lineSeparator()); errores.append("JB "+ ConvertidorAssembler.labelOverflow+ System.lineSeparator()); errores.append("LabelZero:"+System.lineSeparator()); errores.append("FCOMPP"+System.lineSeparator()); errores.append("RET"+System.lineSeparator()); return errores.toString(); } }
true
2afa279f71ca41f282416a8468d7cbb39e024db9
Java
AlvaroZapata/Dominos
/src/main/java/pizzas/propertyeditors/IngredientePropertyEditor.java
UTF-8
609
2.359375
2
[]
no_license
package pizzas.propertyeditors; import java.beans.PropertyEditorSupport; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import pizzas.modelo.entidades.Ingredientes; import pizzas.modelo.repositorio.IngredienteRepositorio; @Component public class IngredientePropertyEditor extends PropertyEditorSupport{ @Autowired private IngredienteRepositorio repo; @Override public void setAsText(String text) { long idIngrediente = Long.parseLong(text); Ingredientes ingrediente = repo.findOne(idIngrediente); setValue(ingrediente); } }
true
054edb561203d10028787cb762a7bcbadde45105
Java
Celicath/CopycatMod
/src/main/java/TheCopycat/cards/monster/SummonMonsterCard.java
UTF-8
6,288
2.078125
2
[ "MIT" ]
permissive
package TheCopycat.cards.monster; import TheCopycat.CopycatModMain; import TheCopycat.actions.SummonCopycatMinionAction; import TheCopycat.friendlyminions.MirrorMinion; import TheCopycat.utils.GameLogicUtils; import TheCopycat.utils.MonsterCardMoveInfo; import basemod.AutoAdd; import basemod.helpers.TooltipInfo; import com.megacrit.cardcrawl.actions.animations.TalkAction; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.core.AbstractCreature; import com.megacrit.cardcrawl.core.CardCrawlGame; import com.megacrit.cardcrawl.localization.CardStrings; import com.megacrit.cardcrawl.monsters.AbstractMonster; import com.megacrit.cardcrawl.monsters.beyond.SnakeDagger; import com.megacrit.cardcrawl.monsters.city.BronzeOrb; import com.megacrit.cardcrawl.monsters.city.TorchHead; import com.megacrit.cardcrawl.monsters.exordium.*; import java.util.ArrayList; import java.util.List; @AutoAdd.Seen public class SummonMonsterCard extends AbstractMonsterCard { private static final String RAW_ID = "SummonMonsterCard"; public static final String ID = CopycatModMain.makeID(RAW_ID); private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID); public static final String NAME = cardStrings.NAME; public static final String DESCRIPTION = cardStrings.DESCRIPTION; public static final String[] EXTENDED_DESCRIPTION = cardStrings.EXTENDED_DESCRIPTION; private static final int COST = 1; private static final CardType TYPE = CardType.SKILL; private static final CardRarity RARITY = CardRarity.SPECIAL; private static final CardTarget TARGET = CardTarget.SELF; public String summonID = null; public String summonName = null; public int baseCost; public boolean initialized = false; public boolean smallFont = false; ArrayList<TooltipInfo> tooltips = new ArrayList<>(); public SummonMonsterCard() { super(ID, NAME, COST, DESCRIPTION, TYPE, RARITY, TARGET); exhaust = true; } public static AbstractMonster makeMonster(String ID) { if (ID == null) { return null; } switch (ID) { case AcidSlime_M.ID: return new AcidSlime_M(0.0f, 0.0f); case AcidSlime_L.ID: return new AcidSlime_L(0.0f, 0.0f); case SpikeSlime_M.ID: return new SpikeSlime_M(0.0f, 0.0f); case SpikeSlime_L.ID: return new SpikeSlime_L(0.0f, 0.0f); case GremlinWarrior.ID: return new GremlinWarrior(0.0f, 0.0f); case GremlinFat.ID: return new GremlinFat(0.0f, 0.0f); case GremlinThief.ID: return new GremlinThief(0.0f, 0.0f); case GremlinTsundere.ID: return new GremlinTsundere(0.0f, 0.0f); case GremlinWizard.ID: return new GremlinWizard(0.0f, 0.0f); case SnakeDagger.ID: return new SnakeDagger(0.0f, 0.0f); case BronzeOrb.ID: return new BronzeOrb(0.0f, 0.0f, 0); case TorchHead.ID: return new TorchHead(0.0f, 0.0f); default: return null; } } @Override public void use(AbstractPlayer p, AbstractMonster m) { AbstractMonster summon = makeMonster(summonID); if (summon == null) { addToBot(new TalkAction(true, "This minion is not supported. Please ask Celicath to add this monster.", 0.5f, 4.0f)); } else { addToBot(new SummonCopycatMinionAction(new MirrorMinion(summon.name, summon, magicNumber))); } } public void calculateMonsterCardID() { ArrayList<String> result = new ArrayList<>(); result.add(ID); result.add(originalName); result.add(String.valueOf(summonID)); result.add(String.valueOf(summonName)); result.add(String.valueOf(baseCost)); result.add(String.valueOf(baseMagicNumber)); result.add(String.valueOf(smallFont)); monsterCardID = String.join(GameLogicUtils.metricIdSeparator, result); } public void updateDescriptionAndInitialize() { rawDescription = EXTENDED_DESCRIPTION[1] + summonName.replaceAll("(?<=\\s|^)(\\S+)(?=\\s|$)", "*$1") + EXTENDED_DESCRIPTION[2]; initializeDescription(); initialized = true; tooltips.clear(); tooltips.add(new TooltipInfo(summonName, EXTENDED_DESCRIPTION[3])); rarity = CardRarity.COMMON; } @Override public List<TooltipInfo> getCustomTooltipsTop() { return tooltips; } @Override public void loadFromTokens(String[] tokens) { if (tokens.length >= 7) { try { int shouldUpgrade = 0; if (upgraded) { upgraded = false; shouldUpgrade = timesUpgraded > 0 ? timesUpgraded : 1; } originalName = name = tokens[1]; summonID = tokens[2]; summonName = tokens[3]; baseCost = cost = costForTurn = Integer.parseInt(tokens[4]); baseMagicNumber = magicNumber = Integer.parseInt(tokens[5]); smallFont = tokens[6].equals("true"); updateDescriptionAndInitialize(); for (int i = 0; i < shouldUpgrade; i++) { upgrade(); } } catch (Exception e) { e.printStackTrace(); } } } public void setName(String cardName, AbstractMonster m) { if (cardName == null) { originalName = name = EXTENDED_DESCRIPTION[0] + m.name; smallFont = true; } else { originalName = name = cardName; smallFont = false; } } public void setSummon(AbstractMonster m, int cost, int hp) { summonID = m.id; summonName = m.name; baseCost = this.cost = costForTurn = cost; baseMagicNumber = magicNumber = hp; updateDescriptionAndInitialize(); } @Override public AbstractCard makeCopy() { SummonMonsterCard c = new SummonMonsterCard(); if (initialized) { c.loadFromMonsterCardID(monsterCardID); c.loadTexture(monsterModelID); } return c; } @Override public float getTitleFontSize() { if (smallFont) { return 20; } else { return super.getTitleFontSize(); } } @Override public void upgrade() { if (!upgraded) { upgradeName(); upgradeMagicNumber(4); } } @Override public MonsterCardMoveInfo createMoveInfo(boolean isAlly) { return new MonsterCardMoveInfo(AbstractMonster.Intent.UNKNOWN, this); } @Override public void monsterTakeTurn(AbstractMonster owner, AbstractCreature target, boolean isAlly) { if (isAlly) { AbstractMonster summon = makeMonster(summonID); if (summon != null) { addToBot(new SummonCopycatMinionAction(new MirrorMinion(summon.name, summon, magicNumber))); } } else { // TODO: what happens if an enemy uses this card?? } } }
true
6abf60ef6f0b1c960fee6b7dd7fcbb7be9cf62dc
Java
tgrundtvig/LegoWiFiTrainProject
/NetbeansProject/LegoWiFiTrainProjectV1.1/src/legotrainproject/locomotive/LocomotiveListener.java
UTF-8
258
1.882813
2
[]
no_license
/* * Not licensed yet, use at your own risk, no warrenties! */ package legotrainproject.locomotive; /** * * @author Tobias Grundtvig <tgrundtvig@gmail.com> */ public interface LocomotiveListener { public void onPositionChange(Locomotive loco, int pos, int magnetTime); }
true
f6aec79e4205d48cc2b801799e9a4bc7db8f0b69
Java
doep-manual/CMON-App
/cmon-app-portlet/docroot/WEB-INF/service/org/oep/cmon/dao/report/model/Lephi_tonghopSoap.java
UTF-8
3,648
1.875
2
[ "Apache-2.0" ]
permissive
/** * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package org.oep.cmon.dao.report.model; import org.oep.cmon.dao.report.service.persistence.Lephi_tonghopPK; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * This class is used by SOAP remote services. * * @author VIENPN * @generated */ public class Lephi_tonghopSoap implements Serializable { public static Lephi_tonghopSoap toSoapModel(Lephi_tonghop model) { Lephi_tonghopSoap soapModel = new Lephi_tonghopSoap(); soapModel.setNHOMTHUTUCHANHCHINHID(model.getNHOMTHUTUCHANHCHINHID()); soapModel.setTONGHOSO(model.getTONGHOSO()); soapModel.setLEPHI(model.getLEPHI()); soapModel.setPHIHOSO(model.getPHIHOSO()); soapModel.setTONGLEPHI(model.getTONGLEPHI()); soapModel.setTHANGNHAN(model.getTHANGNHAN()); return soapModel; } public static Lephi_tonghopSoap[] toSoapModels(Lephi_tonghop[] models) { Lephi_tonghopSoap[] soapModels = new Lephi_tonghopSoap[models.length]; for (int i = 0; i < models.length; i++) { soapModels[i] = toSoapModel(models[i]); } return soapModels; } public static Lephi_tonghopSoap[][] toSoapModels(Lephi_tonghop[][] models) { Lephi_tonghopSoap[][] soapModels = null; if (models.length > 0) { soapModels = new Lephi_tonghopSoap[models.length][models[0].length]; } else { soapModels = new Lephi_tonghopSoap[0][0]; } for (int i = 0; i < models.length; i++) { soapModels[i] = toSoapModels(models[i]); } return soapModels; } public static Lephi_tonghopSoap[] toSoapModels(List<Lephi_tonghop> models) { List<Lephi_tonghopSoap> soapModels = new ArrayList<Lephi_tonghopSoap>(models.size()); for (Lephi_tonghop model : models) { soapModels.add(toSoapModel(model)); } return soapModels.toArray(new Lephi_tonghopSoap[soapModels.size()]); } public Lephi_tonghopSoap() { } public Lephi_tonghopPK getPrimaryKey() { return new Lephi_tonghopPK(_NHOMTHUTUCHANHCHINHID, _THANGNHAN); } public void setPrimaryKey(Lephi_tonghopPK pk) { setNHOMTHUTUCHANHCHINHID(pk.NHOMTHUTUCHANHCHINHID); setTHANGNHAN(pk.THANGNHAN); } public int getNHOMTHUTUCHANHCHINHID() { return _NHOMTHUTUCHANHCHINHID; } public void setNHOMTHUTUCHANHCHINHID(int NHOMTHUTUCHANHCHINHID) { _NHOMTHUTUCHANHCHINHID = NHOMTHUTUCHANHCHINHID; } public String getTONGHOSO() { return _TONGHOSO; } public void setTONGHOSO(String TONGHOSO) { _TONGHOSO = TONGHOSO; } public String getLEPHI() { return _LEPHI; } public void setLEPHI(String LEPHI) { _LEPHI = LEPHI; } public String getPHIHOSO() { return _PHIHOSO; } public void setPHIHOSO(String PHIHOSO) { _PHIHOSO = PHIHOSO; } public String getTONGLEPHI() { return _TONGLEPHI; } public void setTONGLEPHI(String TONGLEPHI) { _TONGLEPHI = TONGLEPHI; } public String getTHANGNHAN() { return _THANGNHAN; } public void setTHANGNHAN(String THANGNHAN) { _THANGNHAN = THANGNHAN; } private int _NHOMTHUTUCHANHCHINHID; private String _TONGHOSO; private String _LEPHI; private String _PHIHOSO; private String _TONGLEPHI; private String _THANGNHAN; }
true
767be1ab5eccdbf5af73dd16799bc898fb992dde
Java
cha63506/CompSecurity
/JC-Penney/src/com/jcp/activities/SameDayPickUpCustomerServiceWebView.java
UTF-8
2,301
1.585938
2
[]
no_license
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.jcp.activities; import android.app.ActionBar; import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.TextView; import butterknife.ButterKnife; import com.jcp.b.b; // Referenced classes of package com.jcp.activities: // an, bk public class SameDayPickUpCustomerServiceWebView extends an { private ProgressDialog a; protected TextView headerTitle; protected WebView mWebView; public SameDayPickUpCustomerServiceWebView() { } static ProgressDialog a(SameDayPickUpCustomerServiceWebView samedaypickupcustomerservicewebview) { return samedaypickupcustomerservicewebview.a; } static ProgressDialog a(SameDayPickUpCustomerServiceWebView samedaypickupcustomerservicewebview, ProgressDialog progressdialog) { samedaypickupcustomerservicewebview.a = progressdialog; return progressdialog; } protected String a() { return "SAMEDAYPICKUPCUSTOMERSERVICEWEBVIEW"; } public void onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return; } else { super.onBackPressed(); return; } } protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(0x7f03005c); ButterKnife.inject(this); if (getActionBar() != null) { getActionBar().hide(); } mWebView.setVisibility(8); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(new bk(this, null)); if (getIntent().getExtras().getInt("ITEM_OPTION", 1) == 1) { headerTitle.setText(getResources().getString(0x7f070420)); mWebView.loadUrl(b.R()); return; } else { headerTitle.setText(getResources().getString(0x7f0701cf)); mWebView.loadUrl(b.S()); return; } } }
true
ff5a31cb15a0b1e73324d933517a2f8d95a4caae
Java
mswiderski/qs-playground
/jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/LightProcessRuntimeServiceProvider.java
UTF-8
1,229
2.109375
2
[ "Apache-2.0" ]
permissive
package org.jbpm.process.instance; import java.util.Optional; import org.jbpm.process.instance.impl.DefaultProcessInstanceManager; import org.kie.services.signal.LightSignalManager; import org.kie.services.signal.SignalManager; import org.kie.services.time.TimerService; import org.kie.services.time.impl.JDKTimerService; public class LightProcessRuntimeServiceProvider implements ProcessRuntimeServiceProvider { private final TimerService timerService; private final ProcessInstanceManager processInstanceManager; private final SignalManager signalManager; public LightProcessRuntimeServiceProvider() { timerService = new JDKTimerService(); processInstanceManager = new DefaultProcessInstanceManager(); signalManager = new LightSignalManager( id -> Optional.ofNullable( processInstanceManager.getProcessInstance(id))); } @Override public TimerService getTimerService() { return timerService; } @Override public ProcessInstanceManager getProcessInstanceManager() { return processInstanceManager; } @Override public SignalManager getSignalManager() { return signalManager; } }
true
99e0aaee2abb695f9d114d617a15eceb46a4928c
Java
nevella/alcina
/framework/gwt/src/cc/alcina/framework/gwt/persistence/client/KeyValueStore.java
UTF-8
1,451
2.21875
2
[]
no_license
package cc.alcina.framework.gwt.persistence.client; import java.util.List; import com.google.gwt.user.client.rpc.AsyncCallback; import cc.alcina.framework.common.client.logic.reflection.Registration; import cc.alcina.framework.common.client.logic.reflection.registry.Registry; @Registration.Singleton public class KeyValueStore { public static KeyValueStore createNonStandardKeyValueStore(PersistenceObjectStore delegate) { KeyValueStore store = new KeyValueStore(); store.registerDelegate(delegate); return store; } public static KeyValueStore get() { return Registry.impl(KeyValueStore.class); } protected PersistenceObjectStore objectStore; public KeyValueStore() { super(); } public void get(String key, AsyncCallback<String> valueCallback) { this.objectStore.get(key, valueCallback); } public void getKeysPrefixedBy(String keyPrefix, AsyncCallback<List<String>> completedCallback) { this.objectStore.getKeysPrefixedBy(keyPrefix, completedCallback); } public PersistenceObjectStore getObjectStore() { return this.objectStore; } public void put(String key, String value, AsyncCallback<Integer> idCallback) { this.objectStore.put(key, value, idCallback); } public void registerDelegate(PersistenceObjectStore objectStore) { this.objectStore = objectStore; } public void remove(String key, AsyncCallback<Integer> completedCallback) { this.objectStore.remove(key, completedCallback); } }
true
a8f650ce4ee03113ffa78ab4e5c12c6477854c24
Java
boris9264/concurrent
/src/main/java/com/boris/learn/concurrent/part1/demo06/render/ImageInfo.java
UTF-8
796
3.140625
3
[]
no_license
package com.boris.learn.concurrent.part1.demo06.render; public class ImageInfo { private String imgName; private ImageData imageData; public ImageInfo(String imgName, ImageData imageData) { this.imgName = imgName; this.imageData = imageData; } public String getImgName() { return imgName; } public void setImgName(String imgName) { this.imgName = imgName; } public ImageData getImageData() { try { Thread.sleep(5000); System.out.println(Thread.currentThread() + " init...."); } catch (InterruptedException e) { e.printStackTrace(); } return imageData; } public void setImageData(ImageData imageData) { this.imageData = imageData; } }
true
2b21322c3b2893924e29def8f43e955d3eca0a10
Java
dnkilic/android-karabasan
/app/src/main/java/com/dnkilic/karabasan/Candidate.java
UTF-8
514
2.46875
2
[]
no_license
package com.dnkilic.karabasan; public class Candidate { String name; Integer age; Integer height; public String getName() { return name; } public void setName(String name) { this.name = name; } public void setAge(Integer age) { this.age = age; } public Integer getAge() { return age; } public void setHeight(Integer height) { this.height = height; } public Integer getHeight() { return height; } }
true
3afaf08380e2e7ab8f8dfb9a32ab82881c5aeada
Java
Antonisiy/ListTaskAndroid
/app/src/main/java/com/example/anton/listtask/SectionListView.java
UTF-8
616
2.34375
2
[]
no_license
package com.example.anton.listtask; import android.app.ListActivity; import android.os.Bundle; public class SectionListView extends ListActivity { private CustomAdapter mAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* mAdapter = new CustomAdapter(this); for (int i = 1; i < 30; i++) { mAdapter.addItem("Row Item #" + i); if (i % 4 == 0) { mAdapter.addSectionHeaderItem("Section #" + i); } } setListAdapter(mAdapter);*/ } }
true
a7a3087b3a08172d157c80eeaba5ff7863cb324a
Java
led-os/SeexLove
/app/src/main/java/com/chat/seecolove/widget/CustomAttachment.java
UTF-8
1,372
2.40625
2
[]
no_license
package com.chat.seecolove.widget; import com.netease.nimlib.sdk.msg.attachment.MsgAttachment; import org.json.JSONException; import org.json.JSONObject; import com.chat.seecolove.constants.Constants; public class CustomAttachment implements MsgAttachment { private int type = 0; private String data = null; public CustomAttachment(String jsonObject,int type){ this.data = jsonObject; this.type = type; try { JSONObject json = new JSONObject(this.data); if(type== Constants.GIFT_ORTHER){ json.put("conmbCount","1"); this.data = json.toString(); } } catch (JSONException e) { e.printStackTrace(); } } @Override public String toJson(boolean b) { return CustomAttachParser.packData(type,data); } public int getType() { return type; } public void setType(int type) { this.type = type; } public JSONObject getData() { JSONObject jsonObject = null; try { jsonObject = new JSONObject(this.data); } catch (JSONException e) { e.printStackTrace(); } return jsonObject; } public void setData(String data) { this.data = data; } }
true
e276edb64b21d46a3886bffba240e547b805617c
Java
mjparrott/Lumines
/src/Lumines.java
UTF-8
326
2.546875
3
[]
no_license
/** * Name: Michael Parrott * Date: June 17, 2011 * Course code: ICS4U1 * Title: Lumines * Description: A Lumines game coded in Java * Notes: * * @author Michael Parrott */ public class Lumines { public static void main( String[] args ) throws Exception { LuminesGUI game = new LuminesGUI(); //Run the game game.run(); } }
true
9eec7d6dd59972d520c625fe53197ba3bfbb7142
Java
jesushernandez/MapReduceQoS
/src/scheduler/SimulatorConfig.java
UTF-8
2,629
2.859375
3
[]
no_license
package scheduler; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; import java.util.Random; import com.thoughtworks.xstream.XStream; public class SimulatorConfig { // XStream for object (de)serialization private static XStream xstream; /** * Writes configuration file. Only for testing purposes. Creates two * simulations with the same clients and nodes. */ private static void writeConfigurationFile(String simulationName, int numberOfClients, int numberOfNodes, int clientQos) { Simulation simulation = null; List<Client> clients = new ArrayList<Client>(); List<Node> nodes = new ArrayList<Node>(); QoSSpec qos = null; Client client = null; Node node = null; Random randomGenerator = new Random(); if (clientQos == 0) { int randomQos; for (int i = 0; i < numberOfClients; i++) { randomQos = randomGenerator.nextInt(3) + 1; qos = new QoSSpec(randomQos); client = new Client(i, qos); clients.add(client); } } else { for (int i = 0; i < numberOfClients; i++) { qos = new QoSSpec(clientQos); client = new Client(i, qos); clients.add(client); } } for (int i = 0; i < numberOfNodes; i++) { node = new Node(i); nodes.add(node); } simulation = new Simulation(1, clients, nodes); try { FileOutputStream fs = new FileOutputStream("./config.xml"); xstream.toXML(simulation, fs); } catch (FileNotFoundException e) { e.printStackTrace(); } } /** * Configures the XStream object */ private static void configureXStream() { xstream = new XStream(); xstream.alias("simulation", Simulation.class); xstream.alias("client", Client.class); xstream.alias("qos", QoSSpec.class); xstream.alias("nodes", Node.class); xstream.alias("nodequeue", NodeQueue.class); xstream.alias("joblist", java.util.concurrent.ConcurrentLinkedQueue.class); } /** * @param args */ public static void main(String[] args) { configureXStream(); // args[0] - filename // args[1] - number of clients // args[2] - number of nodes // args[3] - QoS specs (0 for random) if (args.length > 4) { if (args[4].contains("duration=")) { Task.setDuration(Integer.parseInt(args[4].split("=")[1])); } if (args[4].contains("nTasks=")) { Simulator.setMeanTasks(Integer.parseInt(args[4].split("=")[1])); } } writeConfigurationFile(args[0], Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3])); } }
true
3a93de6bb2062a1909949c630b61aac74eb981f3
Java
richiejk/VT
/app/src/main/java/com/richiejk/voyagetales/api/APIManager.java
UTF-8
2,364
2.25
2
[]
no_license
package com.richiejk.voyagetales.api; import android.content.Context; import android.util.Log; import com.richiejk.voyagetales.common.Finals; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; /** * Created by richie on 1/16/14. */ public class APIManager { Context APIcontext; APIListener mListener; public APIManager(Context context) { this.APIcontext = context; } public JSONObject loginAPI(String posturl){ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(Finals.BASE_URL); try { httppost.setEntity(new StringEntity(posturl)); HttpResponse resp = httpclient.execute(httppost); HttpEntity ent = resp.getEntity(); // Log.i("loginresp1",EntityUtils.toString(ent)); String jsonString= convertStreamToString(ent.getContent()); Log.i("loginresp", jsonString); JSONObject jsonObject=new JSONObject(jsonString); return jsonObject; } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; } catch (JSONException e) { e.printStackTrace(); return null; } // adasdas return null; } //asdasdasdsdasdasddasd public static String convertStreamToString(InputStream is) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; //dfsd while ((line = reader.readLine()) != null) { sb.append(line); } is.close(); return sb.toString().trim(); } }
true
0ec406094aa1caadb753373167c23d02f8f900ce
Java
vmarpadge/SGPA-Calculator
/sgpa.java
UTF-8
642
3.171875
3
[]
no_license
import java.util.Scanner; public class sgpa { public static void main(String[] args){ System.out.println("Welcome To The SGPA Calculator"); Scanner scanner = new Scanner(System.in); System.out.println("Enter The Number OF Credit Elements"); int x = scanner.nextInt(); double sum =0; System.out.println("Enter the Credit Points"); int[] arr =new int[x]; for(int i=0;i<x;i++){ int y = scanner.nextInt(); arr[i]= y; sum += arr[i]; } System.out.println("Enter The Credit points Earned"); double z = scanner.nextDouble(); double sgpa =(sum/z); System.out.println("your SGPA Is "+sgpa); } }
true
0c04f31f240edefabd7d435eb1f07e4ecf02e65e
Java
zanikolov/KalafcheRepo
/KalafcheBackend/src/main/java/com/kalafche/model/PastPeriodSaleReport.java
UTF-8
2,109
2.25
2
[]
no_license
package com.kalafche.model; import java.util.List; public class PastPeriodSaleReport { Integer selectedMonthDay; Integer selectedMonthMonth; Integer selectedMonthYear; Integer prevMonthDay; Integer prevMonthMonth; Integer prevMonthYear; Integer prevYearDay; Integer prevYearMonth; Integer prevYearYear; List<PastPeriodTurnover> pastPeriodTurnovers; public Integer getSelectedMonthDay() { return selectedMonthDay; } public void setSelectedMonthDay(Integer selectedMonthDay) { this.selectedMonthDay = selectedMonthDay; } public Integer getSelectedMonthMonth() { return selectedMonthMonth; } public void setSelectedMonthMonth(Integer selectedMonthMonth) { this.selectedMonthMonth = selectedMonthMonth; } public Integer getSelectedMonthYear() { return selectedMonthYear; } public void setSelectedMonthYear(Integer selectedMonthYear) { this.selectedMonthYear = selectedMonthYear; } public Integer getPrevMonthDay() { return prevMonthDay; } public void setPrevMonthDay(Integer prevMonthDay) { this.prevMonthDay = prevMonthDay; } public Integer getPrevMonthMonth() { return prevMonthMonth; } public void setPrevMonthMonth(Integer prevMonthMonth) { this.prevMonthMonth = prevMonthMonth; } public Integer getPrevMonthYear() { return prevMonthYear; } public void setPrevMonthYear(Integer prevMonthYear) { this.prevMonthYear = prevMonthYear; } public Integer getPrevYearDay() { return prevYearDay; } public void setPrevYearDay(Integer prevYearDay) { this.prevYearDay = prevYearDay; } public Integer getPrevYearMonth() { return prevYearMonth; } public void setPrevYearMonth(Integer prevYearMonth) { this.prevYearMonth = prevYearMonth; } public Integer getPrevYearYear() { return prevYearYear; } public void setPrevYearYear(Integer prevYearYear) { this.prevYearYear = prevYearYear; } public List<PastPeriodTurnover> getPastPeriodTurnovers() { return pastPeriodTurnovers; } public void setPastPeriodTurnovers(List<PastPeriodTurnover> pastPeriodTurnovers) { this.pastPeriodTurnovers = pastPeriodTurnovers; } }
true
38003729e2682ca90f026579e8b35207c10e55bf
Java
jdayih/RecipebookAPI
/src/main/java/com/example/demo/rest/RecipeController.java
UTF-8
1,619
2.203125
2
[]
no_license
package com.example.demo.rest; import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.example.demo.domain.Recipe; import com.example.demo.service.RecipeService; @RestController public class RecipeController { private RecipeService service; public RecipeController(RecipeService service) { super(); this.service = service; } @PostMapping("/createRecipe") public ResponseEntity<Recipe> createPenguin(@RequestBody Recipe recipe) { return new ResponseEntity<Recipe>(this.service.createRecipe(recipe), HttpStatus.CREATED); } @GetMapping("/getRecipes") public ResponseEntity<List<Recipe>> getRecipe() { return ResponseEntity.ok(this.service.getRecipes()); } @GetMapping("/getRecipeById/{id}") public Recipe getRecipeById(@PathVariable long id) { return this.service.getRecipeById(id); } @DeleteMapping("/removeRecipe/{id}") public boolean removeRecipe(@PathVariable long id) { return this.service.removeRecipe(id); } @PutMapping("/updateRecipe/{id}") public Recipe updateRecipe(@PathVariable Long id, @RequestBody Recipe newRecipe) { return this.service.updateRecipe(id, newRecipe); } }
true
a9535d195984905651319bc79c2f37941032fd50
Java
FlorianPatzer/symp_analysis_hub
/src/main/java/de/fraunhofer/iosb/svs/analysishub/data/service/PhaseService.java
UTF-8
2,928
2.578125
3
[ "MIT" ]
permissive
package de.fraunhofer.iosb.svs.analysishub.data.service; import de.fraunhofer.iosb.svs.analysishub.URIUtil; import de.fraunhofer.iosb.svs.analysishub.data.entity.Phase; import de.fraunhofer.iosb.svs.analysishub.exceptions.ResourceNotFoundException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.List; import static de.fraunhofer.iosb.svs.analysishub.data.entity.PolicyBasedAnalysis.POLICY_BASED_ANALYSIS_NAMESPACE; /** * A service handling the phase nodes. * <p> * Phases are the already 6 set phases plus one phase for "any phase". Therefore no phase generation is needed. * The given phases are represented as the {@link StaticPhase} enum. */ @Service public class PhaseService { private final PhaseRepository phaseRepository; @Autowired public PhaseService(PhaseRepository phaseRepository) { this.phaseRepository = phaseRepository; } public List<Phase> getPhases() { return phaseRepository.findAll(); } /** * Given a static phase return the real phase node. */ public Phase getPhaseByStaticPhase(StaticPhase staticPhase) { return phaseRepository.findByUri(URIUtil.assemble(POLICY_BASED_ANALYSIS_NAMESPACE, staticPhase.getLocalName())) .orElseThrow(() -> new ResourceNotFoundException("Phase not found. This should not be possible")); } /** * Given a real phase node get the static phase. */ public StaticPhase getStaticPhaseByPhase(Phase phase) { if (phase != null) { return Arrays.stream(StaticPhase.values()).filter(staticPhase -> phase.getLocalName().equals(staticPhase.getLocalName())) .findAny() .orElseThrow(() -> new ResourceNotFoundException("Phase not found. This should not be possible")); } return null; } public Phase getPhaseByUri(String uri) { return phaseRepository.findByUri(uri).orElseThrow(() -> new ResourceNotFoundException("Phase not found")); } /** * An enum containing the local names and uris of all 7 phases. */ public enum StaticPhase { KNOWLEDGE_COLLECTION("KnowledgeCollection"), KNOWLEDGE_FUSION("KnowledgeFusion"), MODEL_CLEANING("ModelCleaning"), STATIC_KNOWLEDGE_EXTENSION("StaticKnowledgeExtension"), DYNAMIC_KNOWLEDGE_EXTENSION("DynamicKnowledgeExtension"), ANALYSIS("Analysis"), ANY_PHASE("AnyPhase"); private final String uri; private final String localName; StaticPhase(String localName) { this.localName = localName; this.uri = POLICY_BASED_ANALYSIS_NAMESPACE + localName; } public String getUri() { return uri; } public String getLocalName() { return localName; } } }
true
7a49671c60d7a8e85f33f2765407d328d34297c1
Java
JavaAdore/Restaurant-Management-System
/src/main/java/com/itigeeks/restaurant/dataaccess/dao/ResUserDAO.java
UTF-8
1,508
1.960938
2
[]
no_license
package com.itigeeks.restaurant.dataaccess.dao; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import com.itigeeks.restaurant.common.entity.schema.ResUser; import com.itigeeks.restaurant.common.enums.QueryConjunctionType; /** * * @author ITI GEEKS * */ @Repository public interface ResUserDAO { public void delete(ResUser resUser); public ResUser saveOrUpdate(ResUser resUser); public ResUser load(Long id); public List<ResUser> loadAll(); public List<ResUser> loadAll(Integer startPage, Integer pageSize); public List<ResUser> loadByNamedQuery(String queryName); public List<ResUser> loadByNamedQuery(String queryName, Map<String, Object> queryParameters); public List<ResUser> load(Map<String, Object> criteria); public List<ResUser> load(Map<String, Object> criteria, QueryConjunctionType queryConjunctionType); public List<ResUser> load(Map<String, Object> criteria, Integer firstPage, Integer pageSize); public List<ResUser> load(Map<String, Object> criteria, Integer startPage, Integer pageSize, QueryConjunctionType conjuncationType); public List<ResUser> load(Map<String, Object> criteria, Integer startPage, Integer pageSize, String sortField, Boolean ascending, QueryConjunctionType conjuncationType); public Integer countAll(); public Integer getCount(Map<String, Object> criteria); public Integer getCount(Map<String, Object> criteria, QueryConjunctionType conjuncationType); }
true
ea49b4d0ded6a82522c57af7d21c86aeb8f4e9d7
Java
jasonzhoumj/lac3
/lac3/lac3-web/src/main/java/com/linkallcloud/web/face/processor/PackageXmlProcessor.java
UTF-8
764
2.015625
2
[]
no_license
package com.linkallcloud.web.face.processor; import java.lang.reflect.Type; import com.linkallcloud.web.face.annotation.Face; import com.linkallcloud.core.exception.BaseException; import com.linkallcloud.core.face.message.FaceMessage; public class PackageXmlProcessor extends PackageRequestProcessor { public PackageXmlProcessor() { super(); } @Override protected FaceMessage doConvert2RealRequest(String xmlMessagePkg, Type type, Face faceAnno) throws BaseException { // TODO convert xmlMessagePkg to FaceMessage return null; } @Override public Object packageResult(Object message, Face faceAnno) throws BaseException { // TODO Auto-generated method stub return null; } }
true
fe94013b030cf77f11a76bbfc0ce4b7b91cd4a99
Java
tdk928/futureAngularProject
/future/src/main/java/softuni/shop/future/product/controller/TagController.java
UTF-8
1,199
2.1875
2
[]
no_license
package softuni.shop.future.product.controller; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; import softuni.shop.future.product.service.api.TagService; @RestController public class TagController { private final TagService tagService; public TagController(TagService tagService) { this.tagService = tagService; } @GetMapping("/product/allGenres") public ResponseEntity<?> getAllUsers() { return new ResponseEntity<>(this.tagService.getAllGenres(), HttpStatus.OK); } @GetMapping("/product/tags/{id}") public ResponseEntity<?> getTagsForCurrentProduct(@PathVariable("id") String id) { return new ResponseEntity<>(this.tagService.getAllTagsForProduct(id), HttpStatus.OK); } @GetMapping("/product/colors/{id}") public ResponseEntity<?> getColorsForCurrentProduct(@PathVariable("id") String id) { return new ResponseEntity<>(this.tagService.getAllColorsForProduct(id), HttpStatus.OK); } }
true
cb1b0e5f16db3660cc3937a13ce92ead1461ec7f
Java
iluoyi/datastr-algorithms
/src/leetcode/SwapNodesInPairs.java
UTF-8
995
3.546875
4
[]
no_license
package leetcode; public class SwapNodesInPairs { public ListNode swapPairs(ListNode head) { return reverseKGroup(head, 2); } public ListNode reverseKGroup(ListNode head, int k) { if (head == null || k <= 0) { return head; } int len = 0; // the length of the list ListNode crt = head; ListNode next, pre, last, newHead; while (crt != null) { len++; crt = crt.next; } int iteration = len / k; newHead = null; if (iteration > 0) { last = null; for (int i = 0; i < iteration; i++) { crt = head; next = crt.next; head.next = null; for (int j = 0; j < k - 1; j++) { pre = crt; crt = next; next = crt.next; crt.next = pre; } if (last != null) { last.next = crt; } last = head; head = next; if (i == 0) { newHead = crt; } } if (head != null) { // if there are remaining nodes last.next = head; } return newHead; } else { return head; } } }
true
bf8b40521c238964c36ba75c1b803c4ab8da6ad2
Java
FaraRashid/lesson
/src/ATMPackage/MainATM.java
UTF-8
2,251
3.15625
3
[]
no_license
/* * 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 ATMPackage; import ATMPackage.ATM; import java.util.Scanner; import javax.swing.JOptionPane; /** * * @author izyan rosni */ public class MainATM { public static void main(String[] args) { //Make two bank accounts Account account1 = new Account("NURIZYAN AMIRA BT ROSNI", 12345); Account account2 = new Account("NAIM BIN TARMIZI", 67891); Account account3 = new Account("NAIM BIN ROSLAN", 43345); //Set the balance of account1 and account2 account1.setBalance(20000); account2.setBalance(30000); account3.setBalance(40000); //account number account1.setAccountnumber(123439943); account2.setAccountnumber(454563445); account3.setAccountnumber(232463249); //Set the annual interest rate of account1 and account2 account1.setAnnualInterestRate(5); account2.setAnnualInterestRate(5); account3.setAnnualInterestRate(5); String s1; int id = 1; while (true) { s1 = JOptionPane.showInputDialog("Enter an account ID: "); try { id = Integer.parseInt(s1); // id = Integer.parseInt(s1); ATM atm = new ATM(); //The ID has to be 67891, 12345, and 43345 if (id == 12345) { atm.displayMenu(account1); } else if (id == 67891) { atm.displayMenu(account2); } else if (id == 43345) { atm.displayMenu(account3); } else { //If the customer input number is not 101 or 102, JOptionPane.showMessageDialog(null,"\n*******Please enter a valid number*******"); } //Catch the input is not a number. } catch (Exception ex) { JOptionPane.showMessageDialog(null, "\n*******Please enter a valid number*******"); } } } }
true
9910ce23d82b09997db4495352ce6e7a83c119f5
Java
RationaleEmotions/SimpleSe
/src/main/java/com/rationaleemotions/page/WebElementType.java
UTF-8
1,631
3.203125
3
[ "Apache-2.0" ]
permissive
package com.rationaleemotions.page; /** * Represents the types of webelements that are supported by this library. */ public enum WebElementType { /** * Represents a button. */ BUTTON("button"), /** * Represents a checkbox */ CHECKBOX("checkbox"), /** * Represents a form element. */ FORM("form"), /** * Represents any other element that is not mentioned here (for e.g., div/td/tr) */ GENERIC("generic"), /** * Represents an image */ IMAGE("image"), /** * Represents a label */ LABEL("label"), /** * Represents a link */ LINK("link"), /** * Represents a radio button */ RADIO("radio"), /** * Represents a select list */ SELECT("select"), /** * Represents a textbox */ TEXTFIELD("text"); WebElementType(String type) { this.type = type; } private String type; @Override public String toString() { return type; } /** * A factory method that helps with parsing a type into a recognized {@link WebElementType} * * @param type - The raw text that needs to be parsed. * @return - A {@link WebElementType} that represents the recognized type. If an unrecognized * value is encountered (or) a null value (or) an empty string the type gets identified as {@link * WebElementType#GENERIC} */ public static WebElementType identifyType(String type) { if (type == null || type.trim().isEmpty()) { return GENERIC; } for (WebElementType each : WebElementType.values()) { if (each.type.equalsIgnoreCase(type)) { return each; } } return GENERIC; } }
true
40369dde294952adc018ec4c94bcb0f2e5117d09
Java
craigenn/CS2004
/CS2004_Lab12/src/CS2004.java
UTF-8
2,814
3.25
3
[]
no_license
import java.util.*; import java.io.*; //Some useful code that we will probably reuse in later laboratories... public class CS2004 { static String filename = "1000Primes.txt"; public static void main(String args[]) { ArrayList<Double> res = new ArrayList<Double>(); //relative file path since it is in the project directory //System.out.println(ScalesSolution.RandomBinaryString(10)); //System.out.println("done"); //above code was done to quickly check it was working correctly //changed method to public when checking //the below is the original code supplied moved into its own method //original(); //the below will create a new solution to the Scales problem of 5 weights //called x with the odd weights on the right hand side of the scales //and the even weights on the left hand side. //Scales(); //the below method inputs a nonbinary so it gets replaced //Scalesbreak(); // res = ReadNumberFile(filename); // checkread(res); } public static void original() { for(int i=0;i<10;++i) { int x = CS2004.UI(-1, 1); System.out.println(x); } } //Shared random object static private Random rand; //Create a uniformly distributed random integer between aa and bb inclusive static public int UI(int aa,int bb) { int a = Math.min(aa,bb); int b = Math.max(aa,bb); if (rand == null) { rand = new Random(); rand.setSeed(System.nanoTime()); } int d = b - a + 1; int x = rand.nextInt(d) + a; return(x); } //Create a uniformly distributed random double between a and b inclusive static public double UR(double a,double b) { if (rand == null) { rand = new Random(); rand.setSeed(System.nanoTime()); } return((b-a)*rand.nextDouble()+a); } //This method reads in a text file and parses all of the numbers in it //This code is not very good and can be improved! //But it should work!!! //It takes in as input a string filename and returns an array list of Doubles static public ArrayList<Double> ReadNumberFile(String filename) { ArrayList<Double> res = new ArrayList<Double>(); Reader r; try { r = new BufferedReader(new FileReader(filename)); StreamTokenizer stok = new StreamTokenizer(r); stok.parseNumbers(); stok.nextToken(); while (stok.ttype != StreamTokenizer.TT_EOF) { if (stok.ttype == StreamTokenizer.TT_NUMBER) { res.add(stok.nval); } stok.nextToken(); } } catch(Exception E) { System.out.println("+++ReadFile: "+E.getMessage()); } return(res); } static public void checkread(ArrayList<Double> res) { for(int i=0;i<res.size();i++) { System.out.print(res.get(i) + ", "); } } }
true
f311cfebf8661b0c1bf0e30a1bbc6f2fb7084044
Java
hiivenky/labbook
/JpaLabbook/src/main/java/com/cg/jpalabbook/dao/BookDaoImpl.java
UTF-8
1,986
2.640625
3
[]
no_license
package com.cg.jpalabbook.dao; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import com.cg.jpalabbook.dto.Author; import com.cg.jpalabbook.dto.Book; public class BookDaoImpl implements BookDao{ private static EntityManagerFactory emf; private static EntityManager em; static { emf = Persistence.createEntityManagerFactory("jpalabbook"); em = emf.createEntityManager(); } @Override public Book addBook(Book book) { // TODO Auto-generated method stub Author author = em.find(Author.class, book.getAuthor().getAuthorId()); EntityTransaction trans = em.getTransaction(); trans.begin(); if(author!=null) { book.setAuthor(author); } em.persist(book); trans.commit(); return book; } @Override public Book deleteBook(Integer bookId) { // TODO Auto-generated method stub Book book = em.find(Book.class, bookId); if(book!=null) { em.remove(book); return book; } return null; } public List<Book> getBooks(Integer authorId){ Author author = em.find(Author.class, authorId); if(author!=null) { return author.getBooks(); } return null; } @Override public List<Book> getBooks(Double min, Double max) { // TODO Auto-generated method stub String sql="from Book b where b.cost >= :first AND b.cost <= :second"; Query query = em.createQuery(sql); query.setParameter("first", min); query.setParameter("second", max); return query.getResultList(); } public Author getAuthor(Integer bookId) { Book book = em.find(Book.class, bookId); if(book!=null) { return book.getAuthor(); } return null; } public List<Book> getBooks(){ String sql = "select b from Book b"; Query query = em.createQuery(sql); return query.getResultList(); } }
true
eed8c9b2e9739b65c1c12a2a35874ede31f84bdb
Java
belonesox/stas-candlepin
/common/src/test/java/org/candlepin/common/config/MapConfigurationTest.java
UTF-8
11,604
2.234375
2
[]
no_license
/** * Copyright (c) 2009 - 2012 Red Hat, Inc. * * This software is licensed to you under the GNU General Public License, * version 2 (GPLv2). There is NO WARRANTY for this software, express or * implied, including the implied warranties of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 * along with this software; if not, see * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. * * Red Hat trademarks are not licensed under GPLv2. No permission is * granted to use or replicate Red Hat trademarks that are incorporated * in this software or its documentation. */ package org.candlepin.common.config; import static org.junit.Assert.*; import org.candlepin.common.config.Configuration.TrimMode; import org.hamcrest.core.IsInstanceOf; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.NoSuchElementException; import java.util.Properties; import java.util.Set; /** * MapConfigurationTest */ @RunWith(MockitoJUnitRunner.class) public class MapConfigurationTest { @SuppressWarnings("checkstyle:visibilitymodifier") @Rule public ExpectedException ex = ExpectedException.none(); private MapConfiguration config; @Before public void init() { config = new MapConfiguration(); } @Test public void testSubset() { config.setProperty("x.1", "y"); config.setProperty("x.2", "y"); config.setProperty("x.3", "y"); config.setProperty("a.1", "b"); config.setProperty("a.2", "b"); config.setProperty("a.3", "b"); Configuration newConfig = config.subset("x"); config.clear(); Set<String> keySet = (Set<String>) newConfig.getKeys(); assertEquals(new HashSet<String>(Arrays.asList("x.1", "x.2", "x.3")), keySet); } public void testNullInHashMapProhibited() { ex.expect(RuntimeException.class); ex.expectCause(IsInstanceOf.<Throwable>instanceOf(ConfigurationException.class)); HashMap<String, String> m = new HashMap<String, String>(); m.put(null, "x"); m.put("hello", "world"); assertTrue(m.containsKey(null)); new MapConfiguration(m); } @Test public void testStrippedSubset() { config.setProperty("a.b.a.b", "value"); config.setProperty("a.b.c.d", "value"); config.setProperty("a.c.a.b", "value"); config.setProperty("a.d.a.b", "value"); Configuration stripped = config.strippedSubset("a.b."); assertFalse(stripped.containsKey("a.b.a.b")); assertTrue(stripped.containsKey("a.b")); assertTrue(stripped.containsKey("c.d")); assertFalse(stripped.containsKey("a.c.a.b")); assertFalse(stripped.containsKey("a.d.a.b")); } @Test public void testMerge() { config.setProperty("x.1", "y"); config.setProperty("x.2", "y"); Configuration config2 = new MapConfiguration(); config2.setProperty("a.1", "b"); // Add a conflicting property; config will trump config2 config2.setProperty("x.1", "b"); Configuration mergedConfig = MapConfiguration.merge(config, config2); assertNotSame(config, mergedConfig); Set<String> keySet = (Set<String>) mergedConfig.getKeys(); assertEquals(new HashSet<String>(Arrays.asList("x.1", "x.2", "a.1")), keySet); assertEquals("y", mergedConfig.getProperty("x.1")); } @Test public void testIsEmpty() { assertTrue(config.isEmpty()); config.setProperty("x", "y"); assertFalse(config.isEmpty()); } @Test public void testContainsKey() { assertFalse(config.containsKey("x")); config.setProperty("x", "y"); assertTrue(config.containsKey("x")); } @Test public void testSetProperty() { config.setProperty("x", "y"); assertTrue(config.containsKey("x")); assertEquals("y", config.getProperty("x")); } @Test public void testClear() { config.setProperty("x", "y"); config.setProperty("a", "b"); assertTrue(config.containsKey("x")); assertTrue(config.containsKey("a")); config.clear(); assertFalse(config.containsKey("x")); assertFalse(config.containsKey("a")); } @Test public void testClearProperty() { config.setProperty("x", "y"); config.setProperty("a", "b"); assertTrue(config.containsKey("x")); assertTrue(config.containsKey("a")); config.clearProperty("x"); assertFalse(config.containsKey("x")); assertTrue(config.containsKey("a")); } @Test public void testGetKeys() { config.setProperty("x", "y"); config.setProperty("a", "b"); Set<String> keySet = (Set<String>) config.getKeys(); assertEquals(new HashSet<String>(Arrays.asList("x", "a")), keySet); } @Test public void testGetBoolean() { config.setProperty("x", "true"); config.setProperty("bar", "false"); config.setProperty("bar1", "1"); config.setProperty("bar2", "yes"); config.setProperty("no", "n"); assertTrue(config.getBoolean("x")); assertTrue(config.getBoolean("bar1")); assertTrue(config.getBoolean("bar2")); assertFalse(config.getBoolean("bar")); assertFalse(config.getBoolean("no")); } @Test public void testGetMissingBoolean() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getBoolean("x"); } @Test public void testGetBooleanWithDefault() { assertFalse(config.getBoolean("missing", Boolean.FALSE)); } @Test public void testGetInteger() { config.setProperty("x", "1"); assertEquals(1, config.getInt("x")); } @Test public void testGetMissingInteger() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getInt("x"); } @Test public void testGetIntWithDefault() { config.setProperty("threshold", "10"); assertEquals(5, config.getInt("nothere", 5)); assertEquals(10, config.getInt("threshold", 5)); } @Test public void testGetLong() { config.setProperty("x", "1"); assertEquals(1L, config.getLong("x")); } @Test public void testGetMissingLong() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getLong("x"); } @Test public void testGetLongWithDefault() { assertEquals(1L, config.getLong("x", 1L)); } @Test public void testGetString() { config.setProperty("x", "y"); assertEquals("y", config.getString("x")); } @Test public void testGetMissingString() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getString("x"); } @Test public void testGetStringWithDefault() { assertEquals("y", config.getString("x", "y")); } @Test public void testGetStringTrimsByDefault() { config.setProperty("x", "\t y \t"); assertEquals("y", config.getString("x")); } @Test public void testGetStringTrims() { config.setProperty("x", "\t y \t"); assertEquals("y", config.getString("x", null, TrimMode.TRIM)); } @Test public void testGetStringWithNoTrim() { config.setProperty("x", "\t y \t"); assertEquals("\t y \t", config.getString("x", null, TrimMode.NO_TRIM)); } @Test public void testGetList() { config.setProperty("x", "a, b, c"); assertEquals(Arrays.asList("a", "b", "c"), config.getList("x")); } @Test public void testGetMissingList() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getList("x"); } @Test public void testGetListWithDefault() { assertEquals(null, config.getList("x", null)); } @Test public void testGetMissingProperty() { ex.expect(NoSuchElementException.class); ex.expectMessage(config.doesNotMapMessage("x")); config.getProperty("x"); } @Test public void testGetPropertyWithDefault() { assertEquals("z", config.getProperty("x", "z")); } @SuppressWarnings("serial") @Test public void toPropertiesWithDefaults() { Map<String, String> defaults = new HashMap<String, String>(); defaults.put("a", "defaultvalue"); defaults.put("z", "should have a value"); config.setProperty("a", "value1"); config.setProperty("b", "value2"); config.setProperty("c", "value3"); config.setProperty("d", "value4"); Properties p = config.toProperties(defaults); assertEquals(5, p.size()); assertTrue(p.containsKey("a")); assertTrue(p.containsKey("b")); assertTrue(p.containsKey("c")); assertTrue(p.containsKey("d")); assertEquals("value1", p.getProperty("a")); assertEquals("should have a value", p.getProperty("z")); } @SuppressWarnings("serial") @Test public void returnAllKeysWithAPrefixFromTail() { config.setProperty("a.b.a.b", "value"); config.setProperty("a.b.c.d", "value"); config.setProperty("a.c.a.b", "value"); config.setProperty("a.c.c.d", "value"); config.setProperty("a.c.e.f", "value"); Map<String, String> withPrefix = config.subsetMap("a.c"); assertEquals(3, withPrefix.size()); assertTrue(withPrefix.containsKey("a.c.a.b")); assertTrue(withPrefix.containsKey("a.c.c.d")); assertTrue(withPrefix.containsKey("a.c.e.f")); } @SuppressWarnings("serial") @Test public void returnAllKeysWithAPrefixInTheMiddle() { config.setProperty("a.b.a.b", "value"); config.setProperty("a.b.c.d", "value"); config.setProperty("a.c.a.b", "value"); config.setProperty("a.c.c.d", "value"); config.setProperty("a.c.e.f", "value"); config.setProperty("a.d.a.b", "value"); Map<String, String> withPrefix = config.subsetMap("a.c"); assertEquals(3, withPrefix.size()); assertTrue(withPrefix.containsKey("a.c.a.b")); assertTrue(withPrefix.containsKey("a.c.c.d")); assertTrue(withPrefix.containsKey("a.c.e.f")); } @Test public void returnAllKeysWithAPrefixFromHead() { config.setProperty("a.b.a.b", "value"); config.setProperty("a.b.c.d", "value"); config.setProperty("a.b.e.f", "value"); config.setProperty("a.c.a.a", "value"); Map<String, String> withPrefix = config.subsetMap("a.b"); assertEquals(3, withPrefix.size()); assertTrue(withPrefix.containsKey("a.b.a.b")); assertTrue(withPrefix.containsKey("a.b.c.d")); assertTrue(withPrefix.containsKey("a.b.e.f")); } @Test public void testTrimSpaces() { config.setProperty("good", "good"); config.setProperty("bad", " bad "); assertEquals("good", config.getString("good")); assertEquals("bad", config.getString("bad")); } }
true
92cb021c25d9361e4f1b053deaa050145ed8e986
Java
deshamtejasvi/NJITmoodle
/src/update.java
UTF-8
3,124
2.390625
2
[]
no_license
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.ServletException; import java.io.*; public class update extends HttpServlet { /** * */ private static final long serialVersionUID = 1L; Connection connection = null; Statement statement = null; Statement statement1 = null; Connection connection1 = null; String[] courseName = null; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("hi"); //DataBaseConnect dataBaseConnect = new DataBaseConnect(); String url = "jdbc:mysql://localhost:3306/score_card"; //String url = "jdbc:mysql://sql9.000webhost.com/"; /** * The MySQL user. */ String user = "root"; //String user="a5137510_andrdu2"; /** * Password for the above MySQL user. If no password has been * set (as is the default for the root user in XAMPP's MySQL), * an empty string can be used. */ String password = ""; //String password="P3000webhost"; try{ Class.forName("com.mysql.jdbc.Driver").newInstance(); //Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); // STEP 3: Open a connection System.out.println("Connecting to database..."); connection = DriverManager.getConnection(url, user, password); System.out.println("Creating statement..."); statement = connection.createStatement(); String userid=request.getParameter("type"); System.out.println(userid); String password1=request.getParameter("password1"); //System.out.println(userid); //HttpSession session1=request.getSession(); //request.getSession().setAttribute("userName", userid); //System.out.println(password1); ResultSet rs=statement.executeQuery("Select count(user_id) as count,designation from user_login where user_name='"+userid+"' and password='"+password1+"'"); //System.out.println("login check"); while(rs.next()){ if (rs.getInt("count") == 0){ request.setAttribute("errorMessage", "Invalid username and password"); request.getRequestDispatcher("/testFile.jsp").forward(request, response); }else{ String designation = rs.getString("designation"); System.out.println(designation); if(designation.equals("student")){ System.out.println("student profile"); request.getRequestDispatcher("/marks.jsp").forward(request, response); } else{ //System.out.println("proceed to login"); //System.out.println(userid); //MyCourse course = new MyCourse(userid); request.getRequestDispatcher("/frame.jsp").forward(request, response); //String courseName=MyCourse(userid); } } } statement.close(); connection.close(); }catch(Exception e){ e.printStackTrace(); } } }
true
2e875042efea51c3ee2d49e271a101493876866e
Java
Xia-24/MyFlinkDemo
/src/main/java/com/meituan/flinkdemo/MafkaOrKafka/LocalKafakProducer.java
UTF-8
1,854
2.578125
3
[]
no_license
package com.meituan.flinkdemo.MafkaOrKafka; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import java.util.Properties; import java.util.Random; public class LocalKafakProducer { private Random r = new Random(); public static final String[] HBDM = {"BEF", "CNY", "DEM", "EUR", "HKD", "USD", "ITL"}; public static void main(String[] args) throws InterruptedException { Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); KafkaProducer<String, String> producer = new KafkaProducer<>(props); // ProducerRecord<String, String> record = new ProducerRecord<>(“Kafka”, “Kafka_Products”, “测试”);//Topic Key Value int hbdmindex = 0; int num = 0; int cnt = 0; String msg; try { while (true) { //ProducerRecord有多个构造器,这里使用了三个参数的,topic、key、value。 Thread.sleep(1000); if (cnt < 100) { cnt++; msg = String.format("%d,%s,%d", System.currentTimeMillis(), HBDM[hbdmindex], num); } else { cnt = 0; hbdmindex = (hbdmindex + 1) % 7; num = (num + 1) % 10; msg = String.format("%d,%s,%d", System.currentTimeMillis(), HBDM[hbdmindex], num); } producer.send(new ProducerRecord<String, String>("test", "key", msg)); } } catch (Exception e) { producer.close(); } } }
true
23fe61cf956504530c733a7043a79d3a315f4ee9
Java
Kevine97/Prograamacion-en-JAVA
/POO_Sistematico/src/poo_sistematico/POO_Sistematico.java
UTF-8
8,219
3.4375
3
[]
no_license
package poo_sistematico; import java.util.Scanner; public class POO_Sistematico { //Metodo para verificar si el numero de cuenta existe public static int buscarCuenta(Cuenta t[], int numeroCuenta, int contadorCuenta) { int indice = 0; boolean encontrado = false; for (int i = 0; i < contadorCuenta; i++) { if (t[i].getNumeroCuenta() == numeroCuenta) { indice = i; encontrado = true; } } if (encontrado == false) { indice = -1; } return indice; } public static void main(String[] args) { Scanner entrada = new Scanner(System.in); String nombre, dni, sexo; double saldo, cantidad, cantidad1; int numeroCuenta, opc, opc1; int contador = 0, edad; int contadorPersona = 0; int indiceCuenta; //Clase menu Menus menu = new Menus(); Persona persona = new Persona(); Cuenta cuenta[] = new Cuenta[60]; Persona persona2[] = new Persona[60]; try { do { menu.menu(); menu.consultar1(); menu.menu2(); opc = entrada.nextInt(); switch (opc) { case 1: menu.cliente(); entrada.nextLine(); System.out.print("\n\t\tIngrese el Nombre: "); nombre = entrada.nextLine(); System.out.print("\t\tIngrese DNI: "); dni = entrada.nextLine(); System.out.print("\t\tIngrese Edad: "); edad = entrada.nextInt(); if (persona.mayorEdad(edad) == true) { entrada.nextLine(); System.out.print("\t\tIngrese el Sexo(H-M): "); sexo = entrada.nextLine(); menu.cuenta1(); System.out.print("\n\t\tNumero de cuenta: "); numeroCuenta = entrada.nextInt(); System.out.print("\t\tSaldo a depositar: "); saldo = entrada.nextDouble(); cuenta[contador++] = new Cuenta(saldo, numeroCuenta); persona2[contadorPersona] = new Persona(nombre, edad, dni, sexo, cuenta); System.out.println("\n\t\t═════════════════════════════════════"); System.out.println("\t\t\tRealizado correctamente ..."); System.out.println("\t\t\tSaldo: " + persona2[contadorPersona].consultarSaldo(contadorPersona)); System.out.println("\t\t═════════════════════════════════════"); contadorPersona++; } else { System.out.println("\t\tNo es mayor de edad para crear una cuenta"); } break; case 2: menu.cuenta(); for (int i = 0; i < contador; i++) { System.out.println("Cuenta: " + (i + 1)); System.out.println(cuenta[i].mostrarCuenta()); System.out.println(persona2[i].persona()); System.out.println("\t═════════════════════════════════"); } break; case 3: menu.consultar1(); menu.menu3(); opc1 = entrada.nextInt(); System.out.print("\t\tIngrese el numero de cuenta: "); numeroCuenta = entrada.nextInt(); indiceCuenta = buscarCuenta(cuenta, numeroCuenta, contador); if (indiceCuenta == -1) { System.out.println("\t\tNumero de cuenta incorrecto"); } else { switch (opc1) { case 1: menu.ingresar(); System.out.print("\n\n\t\tSaldo a ingresar: "); cantidad = entrada.nextDouble(); persona2[indiceCuenta].ingresarDinero(indiceCuenta, cantidad); System.out.println("\n\t\t═════════════════════════════════════"); System.out.println("\t\t\tRealizado correctamente ..."); System.out.println("\t\t\tSaldo: " + persona2[indiceCuenta].consultarSaldo(indiceCuenta)); System.out.println("\t\t═════════════════════════════════════"); break; case 2: menu.retirar(); System.out.print("\n\n\t\tSaldo a retirar: "); cantidad1 = entrada.nextDouble(); if (cantidad1 > persona2[indiceCuenta].consultarSaldo(indiceCuenta)) { System.out.println("\n\t\t S A L D O I N S U F I C I E N T E"); } else { persona2[indiceCuenta].retirarDinero(indiceCuenta, cantidad1); System.out.println("\n\t\t═════════════════════════════════════"); System.out.println("\t\t\tRealizado correctamente ..."); System.out.println("\t\t\tSaldo: " + persona2[indiceCuenta].consultarSaldo(indiceCuenta)); System.out.println("\t\t═════════════════════════════════════"); } break; case 3: menu.consultar(); System.out.println("\n\t\t═════════════════════════════════════"); System.out.println("\t\t\tRealizado correctamente ..."); System.out.println("\t\t\tSaldo: " + persona2[indiceCuenta].consultarSaldo(indiceCuenta)); System.out.println("\t\t═════════════════════════════════════"); break; case 4: break; default: System.out.println("\t\tOpcion Incorrecta"); } break; } case 4: break; default: System.out.println("Opcion Incorrecta"); } system("pause"); } while (opc != 4); } catch (Exception e) { System.out.println("Error: " + e); } } public static void system(String command) { try { new ProcessBuilder("cmd", "/c", command) .inheritIO().start().waitFor(); } catch (Exception e) { } } }
true
43445238614f2aca36e7b10460d9331c0b6302a0
Java
gengrz/standard
/src/com/fox/FollowTest.java
UTF-8
906
2.4375
2
[]
no_license
package com.fox; import java.util.HashSet; import java.util.List; import java.util.Set; import com.alibaba.fastjson.JSONObject; import cn.hutool.core.io.FileUtil; public class FollowTest { public static void main(String[] args) { String listStr = FileUtil.readString("./follow.json", "utf-8"); List<PhoneData> pd = JSONObject.parseArray(listStr, PhoneData.class); pd.sort((o1, o2) -> o1.getDataTime() .compareTo(o2.getDataTime())); System.out.println(pd.size()); int id = 0; for (PhoneData phoneData : pd) { System.out.println(phoneData.toString()); phoneData.setId(id); id++; } // for (PhoneData phoneData : pd) { // System.out.println(phoneData.getId() ); // } // for (PhoneData phoneData : pd) { // System.out.println( phoneData.getLatitude() ); // } // for (PhoneData phoneData : pd) { // System.out.println(phoneData.getLongitude()); // } } }
true
46b8780700bb188c846960e423db5fc2c03ec62d
Java
GuoEH/WRichEditor-Android
/library/src/main/java/cn/carbs/wricheditor/library/utils/ParserUtil.java
UTF-8
15,183
2.046875
2
[ "Apache-2.0" ]
permissive
package cn.carbs.wricheditor.library.utils; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import org.json.JSONArray; import org.json.JSONObject; import java.util.ArrayList; import java.util.LinkedList; import java.util.regex.Matcher; import java.util.regex.Pattern; import cn.carbs.wricheditor.library.WRichEditor; import cn.carbs.wricheditor.library.WEditTextWrapperView; import cn.carbs.wricheditor.library.interfaces.BaseCellData; import cn.carbs.wricheditor.library.interfaces.IRichCellData; import cn.carbs.wricheditor.library.interfaces.IRichCellView; import cn.carbs.wricheditor.library.models.cell.AudioCellData; import cn.carbs.wricheditor.library.models.cell.ImageCellData; import cn.carbs.wricheditor.library.models.cell.LineCellData; import cn.carbs.wricheditor.library.models.cell.NetDiskCellData; import cn.carbs.wricheditor.library.models.cell.RichCellData; import cn.carbs.wricheditor.library.models.cell.VideoCellData; import cn.carbs.wricheditor.library.providers.CustomViewProvider; import cn.carbs.wricheditor.library.types.RichType; import cn.carbs.wricheditor.library.views.RichAudioView; import cn.carbs.wricheditor.library.views.RichImageView; import cn.carbs.wricheditor.library.views.RichLineView; import cn.carbs.wricheditor.library.views.RichNetDiskView; import cn.carbs.wricheditor.library.views.RichVideoView; public class ParserUtil { public static final String P_JSON_PREV = "["; public static final String P_JSON_POST = "]"; public static final String P_TAG_PREV = "<p>"; public static final String P_TAG_POST = "</p>"; public static final String PATTERN_BODY_STR = "<body>.*</body>"; public static final Pattern PATTERN_BODY = Pattern.compile(PATTERN_BODY_STR); public static final String PATTERN_DIV_CELL_VIEW_STR = "<div richType=\".*?</div>"; public static final Pattern PATTERN_DIV_CELL_VIEW = Pattern.compile(PATTERN_DIV_CELL_VIEW_STR); public static final String PATTERN_DIV_RICH_TYPE_STR = "<div richType=\".*?\">"; public static final Pattern PATTERN_DIV_RICH_TYPE = Pattern.compile(PATTERN_DIV_RICH_TYPE_STR); public static StringBuilder parseToHtml(WRichEditor scrollView) { StringBuilder out = new StringBuilder(); if (scrollView == null || scrollView.getContainerView() == null) { return out; } ViewGroup containerView = scrollView.getContainerView(); int childCount = containerView.getChildCount(); ArrayList<IRichCellData> dataList = new ArrayList<>(childCount); for (int i = 0; i < childCount; i++) { View childView = containerView.getChildAt(i); if (childView instanceof IRichCellView) { IRichCellView richCellView = (IRichCellView) childView; IRichCellData iRichCellData = richCellView.getCellData(); if (iRichCellData == null) { continue; } dataList.add(iRichCellData); } } for (IRichCellData richCellData : dataList) { out.append(P_TAG_PREV + richCellData.toHtml() + P_TAG_POST); } return out; } public static StringBuilder parseToJson(WRichEditor scrollView) { StringBuilder out = new StringBuilder(); if (scrollView == null || scrollView.getContainerView() == null) { return out; } ViewGroup containerView = scrollView.getContainerView(); int childCount = containerView.getChildCount(); ArrayList<IRichCellData> dataList = new ArrayList<>(childCount); for (int i = 0; i < childCount; i++) { View childView = containerView.getChildAt(i); if (childView instanceof IRichCellView) { IRichCellView richCellView = (IRichCellView) childView; IRichCellData iRichCellData = richCellView.getCellData(); if (iRichCellData == null) { continue; } dataList.add(iRichCellData); } } int listCount = dataList.size(); out.append(P_JSON_PREV); for (int j = 0; j < listCount; j++) { out.append(dataList.get(j).toJson()); if (j < listCount - 1) { out.append(","); } } out.append(P_JSON_POST); return out; } // TODO 由html转换回富文本编辑器比较复杂,因此先使用json的方式 public static void inflateFromHtml(Context context, WRichEditor scrollView, String html, CustomViewProvider provider) { if (html == null || html.trim().length() == 0 || scrollView == null) { return; } String bodyContent; Matcher matcherBody = PATTERN_BODY.matcher(html); if (matcherBody.find()) { String bodyHtml = matcherBody.group(0); bodyContent = getBodyContent(bodyHtml); } else { bodyContent = html; } ArrayList<String> cellStringList = new ArrayList<>(); Matcher matcherCellView = PATTERN_DIV_CELL_VIEW.matcher(bodyContent); while (matcherCellView.find()) { for (int i = 0; i <= matcherCellView.groupCount(); i++) { // <div richType="NONE">文字</div> // <div richType="IMAGE"><picture><img src="https://xx.com/xx.jpg"></picture></div> String cellString = matcherCellView.group(i); cellStringList.add(cellString); } } for (String cellString : cellStringList) { IRichCellView cellView = inflateCellViewByCellHtml(context, cellString, provider); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); scrollView.addRichCell(cellView, lp, -1); } scrollView.addNoneTypeTailOptionally(); } // TODO 由html转换回富文本编辑器比较复杂,因此先使用json的方式 public static void inflateFromJson(Context context, WRichEditor scrollView, String json, CustomViewProvider provider) { if (json == null || json.trim().length() == 0 || scrollView == null) { return; } LinkedList<BaseCellData> cellDataList = new LinkedList<>(); try { JSONArray jsonArray = new JSONArray(json); int length = jsonArray.length(); for (int i = 0; i < length; i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); BaseCellData cellData = getCellDataByJSONObject(jsonObject); if (cellData != null) { cellDataList.add(cellData); } } } catch (Exception e) { e.printStackTrace(); } for (BaseCellData cellData : cellDataList) { IRichCellView cellView = inflateCellViewByCellData(context, cellData, provider); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); scrollView.addRichCell(cellView, lp, -1); } scrollView.addNoneTypeTailOptionally(); } private static BaseCellData getCellDataByJSONObject(JSONObject jsonObject) { BaseCellData cellData = null; try { String type = jsonObject.getString(BaseCellData.JSON_KEY_TYPE); RichType richType = RichType.valueOf(type); if (richType == RichType.NONE) { cellData = new RichCellData(); } else if (richType == RichType.QUOTE) { cellData = new RichCellData(); } else if (richType == RichType.LIST_UNORDERED) { cellData = new RichCellData(); } else if (richType == RichType.LIST_ORDERED) { cellData = new RichCellData(); } else if (richType == RichType.IMAGE) { cellData = new ImageCellData(); } else if (richType == RichType.VIDEO) { cellData = new VideoCellData(); } else if (richType == RichType.AUDIO) { cellData = new AudioCellData(); } else if (richType == RichType.NETDISK) { cellData = new NetDiskCellData(); } else if (richType == RichType.LINE) { cellData = new LineCellData(); } if (cellData != null) { // 数据填充 cellData.fromJson(jsonObject); } } catch (Exception e) { e.printStackTrace(); } return cellData; } private static String getBodyContent(String bodyHtml) { if (bodyHtml == null) { return ""; } try { return bodyHtml.substring(6, bodyHtml.length() - 7); } catch (Exception e) { e.printStackTrace(); } return ""; } private static IRichCellView inflateCellViewByCellHtml(Context context, String cellHtml, CustomViewProvider provider) { int[] cellContentHtmlStart = new int[1]; RichType cellRichType = getRichTypeByCellHtml(cellHtml, cellContentHtmlStart); return inflateCellViewByRichTypeAndHtml(context, cellRichType, cellHtml, cellContentHtmlStart[0], provider); } private static IRichCellView inflateCellViewByCellData(Context context, BaseCellData cellData, CustomViewProvider provider) { RichType richType = cellData.getRichType(); if (richType == null || context == null) { return null; } IRichCellView iRichCellView = null; if (richType == RichType.NONE) { // 普通的富文本 iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.QUOTE) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.LIST_UNORDERED) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.LIST_ORDERED) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.IMAGE) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichImageView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.LINE) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichLineView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.VIDEO) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichVideoView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.AUDIO) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichAudioView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.NETDISK) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichNetDiskView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } // 这里为View填充数据 iRichCellView.setCellData(cellData); return iRichCellView; } // 注册自定义 CellView private static IRichCellView inflateCellViewByRichTypeAndHtml(Context context, RichType richType, String cellHtml, int contentStart, CustomViewProvider provider) { if (richType == null || context == null) { return null; } IRichCellView iRichCellView = null; if (richType == RichType.NONE) { // 普通的富文本 iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.QUOTE) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.LIST_UNORDERED) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.LIST_ORDERED) { iRichCellView = new WEditTextWrapperView(context); } else if (richType == RichType.IMAGE) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichImageView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.LINE) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichLineView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.VIDEO) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichVideoView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.AUDIO) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichAudioView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } else if (richType == RichType.NETDISK) { if (provider == null || provider.getCellViewByRichType(richType) == null) { iRichCellView = new RichNetDiskView(context); } else { iRichCellView = provider.getCellViewByRichType(richType); } } // 去掉div iRichCellView.setHtmlData(richType, cellHtml.substring(contentStart, cellHtml.length() - 6)); return iRichCellView; } private static RichType getRichTypeByCellHtml(String cellHtml, int[] start) { // <div richType="IMAGE"> Matcher matcherRichType = PATTERN_DIV_RICH_TYPE.matcher(cellHtml); if (matcherRichType.find()) { // <div richType="NONE">文字</div> // <div richType="IMAGE"><picture><img src="https://xx.com/xx.jpg"></picture></div> String cellRichTypeDivStr = matcherRichType.group(0); start[0] = cellRichTypeDivStr.length(); if (cellRichTypeDivStr != null) { String richTypeStr = cellRichTypeDivStr.substring(15, cellRichTypeDivStr.length() - 2); return RichType.valueOf(richTypeStr); } } return null; } }
true
ce60340176143aa314c0e7038dce4caa5734766a
Java
apache/lucene
/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
UTF-8
5,231
2.875
3
[ "Apache-2.0", "MIT", "NAIST-2003", "BSD-3-Clause", "BSD-2-Clause", "LicenseRef-scancode-unicode", "LGPL-2.0-or-later", "ICU", "LicenseRef-scancode-unicode-mappings", "CC-BY-SA-3.0", "Python-2.0", "LicenseRef-scancode-other-copyleft" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.lucene.util; import java.util.Arrays; /** * Represents long[], as a slice (offset + length) into an existing long[]. The {@link #longs} * member should never be null; use {@link #EMPTY_LONGS} if necessary. * * @lucene.internal */ public final class LongsRef implements Comparable<LongsRef>, Cloneable { /** An empty long array for convenience */ public static final long[] EMPTY_LONGS = new long[0]; /** The contents of the LongsRef. Should never be {@code null}. */ public long[] longs; /** Offset of first valid long. */ public int offset; /** Length of used longs. */ public int length; /** Create a LongsRef with {@link #EMPTY_LONGS} */ public LongsRef() { longs = EMPTY_LONGS; } /** * Create a LongsRef pointing to a new array of size <code>capacity</code>. Offset and length will * both be zero. */ public LongsRef(int capacity) { longs = new long[capacity]; } /** This instance will directly reference longs w/o making a copy. longs should not be null */ public LongsRef(long[] longs, int offset, int length) { this.longs = longs; this.offset = offset; this.length = length; assert isValid(); } /** * Returns a shallow clone of this instance (the underlying longs are <b>not</b> copied and will * be shared by both the returned object and this object. * * @see #deepCopyOf */ @Override public LongsRef clone() { return new LongsRef(longs, offset, length); } @Override public int hashCode() { final int prime = 31; int result = 0; final long end = (long) offset + length; for (int i = offset; i < end; i++) { result = prime * result + (int) (longs[i] ^ (longs[i] >>> 32)); } return result; } @Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof LongsRef) { return this.longsEquals((LongsRef) other); } return false; } public boolean longsEquals(LongsRef other) { return Arrays.equals( this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } /** Signed int order comparison */ @Override public int compareTo(LongsRef other) { return Arrays.compare( this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append('['); final long end = (long) offset + length; for (int i = offset; i < end; i++) { if (i > offset) { sb.append(' '); } sb.append(Long.toHexString(longs[i])); } sb.append(']'); return sb.toString(); } /** * Creates a new LongsRef that points to a copy of the longs from <code>other</code> * * <p>The returned IntsRef will have a length of other.length and an offset of zero. */ public static LongsRef deepCopyOf(LongsRef other) { return new LongsRef( ArrayUtil.copyOfSubArray(other.longs, other.offset, other.offset + other.length), 0, other.length); } /** Performs internal consistency checks. Always returns true (or throws IllegalStateException) */ public boolean isValid() { if (longs == null) { throw new IllegalStateException("longs is null"); } if (length < 0) { throw new IllegalStateException("length is negative: " + length); } if (length > longs.length) { throw new IllegalStateException( "length is out of bounds: " + length + ",longs.length=" + longs.length); } if (offset < 0) { throw new IllegalStateException("offset is negative: " + offset); } if (offset > longs.length) { throw new IllegalStateException( "offset out of bounds: " + offset + ",longs.length=" + longs.length); } if (offset + length < 0) { throw new IllegalStateException( "offset+length is negative: offset=" + offset + ",length=" + length); } if (offset + length > longs.length) { throw new IllegalStateException( "offset+length out of bounds: offset=" + offset + ",length=" + length + ",longs.length=" + longs.length); } return true; } }
true
1ee20ff566e5f0d646477abd8a37b2b3a74206fc
Java
HsuJv/Note
/Code/Java/Se2/Chapter 03/Exercise 01/Solution/TaskProcessor.java
UTF-8
199
2.4375
2
[]
no_license
package chapter03; public class TaskProcessor<X> { private X value; public TaskProcessor(X v) { value = v; } public X getTaskP() { return value; } }
true
66f8e8f7c1d11a2d4415b9b0e116a0af0c4db43a
Java
JarekSobczak/fileToDataBaseManager
/src/main/java/pl/brite/ownProject/fileToDb/service/JsonService.java
UTF-8
807
2.328125
2
[]
no_license
package pl.brite.ownProject.fileToDb.service; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import pl.brite.ownProject.fileToDb.model.Customer; import java.io.File; import java.io.IOException; import java.util.List; public class JsonService { private List<Customer> customers; public JsonService(List<Customer> customers) { this.customers = customers; } void mapJson(File file) { ObjectMapper om = new ObjectMapper(); om.registerModule(new JavaTimeModule()); try { customers.addAll(om.readValue(file, new com.fasterxml.jackson.core.type.TypeReference<List<Customer>>() { })); } catch (IOException e) { e.printStackTrace(); } } }
true
0c0c603c601244ee1fbac28b6666879301ee603e
Java
gbonk/HermesJMS
/src/java/org/objectweb/joram/client/jms/admin/Subscription.java
UTF-8
332
1.523438
2
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
package org.objectweb.joram.client.jms.admin; public class Subscription { public Object getTopicId() { // TODO Auto-generated method stub return null; } public String getName() { // TODO Auto-generated method stub return null; } public String isDurable() { // TODO Auto-generated method stub return null; } }
true
ce63d05923adc9a735f3c88694e58ecb6b2e5ed0
Java
tahametal/HR-Manager
/src/main/java/com/sqli/rh_manager/entities/Bu.java
UTF-8
1,561
2.1875
2
[]
no_license
package com.sqli.rh_manager.entities; // Generated Dec 19, 2013 6:37:54 PM by Hibernate Tools 3.2.1.GA import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; /** * Bu generated by hbm2java */ @Entity @Table(name="bu" ,catalog="rh_manager" ) public class Bu implements java.io.Serializable { private int id; private String bu; private Set<Collaborateur> collaborateurs = new HashSet<Collaborateur>(0); public Bu() { } public Bu(int id) { this.id = id; } public Bu(int id, String bu, Set<Collaborateur> collaborateurs) { this.id = id; this.bu = bu; this.collaborateurs = collaborateurs; } @Id @Column(name="Id", unique=true, nullable=false) public int getId() { return this.id; } public void setId(int id) { this.id = id; } @Column(name="BU", length=254) public String getBu() { return this.bu; } public void setBu(String bu) { this.bu = bu; } @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="bu") public Set<Collaborateur> getCollaborateurs() { return this.collaborateurs; } public void setCollaborateurs(Set<Collaborateur> collaborateurs) { this.collaborateurs = collaborateurs; } }
true
daecaa36d9c7e52db7c2a0d782757d54905b7930
Java
wjW901314/ERP
/src/main/java/com/wd/erp/service/impl/BasisUserRoleServiceImpl.java
UTF-8
2,391
2.171875
2
[]
no_license
package com.wd.erp.service.impl; import com.wd.erp.mapper.BasisUserRoleMapper; import com.wd.erp.model.BasisUserRole; import com.wd.erp.model.ResultJson; import com.wd.erp.service.BasisUserRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; import java.util.List; @Service public class BasisUserRoleServiceImpl implements BasisUserRoleService { @Autowired BasisUserRoleMapper basisUserRoleMapper; @Override public ResultJson addUserRole(BasisUserRole recode) { ResultJson resultJson = new ResultJson(); resultJson.setCode(-1); resultJson.setSuccess(false); resultJson.setMsg("添加用户角色失败!"); if(StringUtils.isEmpty(recode.getLoginName())){ resultJson.setMsg("用户名不能为空!"); return resultJson; } int i = basisUserRoleMapper.insert(recode); if(i == 1){ resultJson.setCode(0); resultJson.setSuccess(true); resultJson.setMsg("添加用户角色成功!"); resultJson.setData(i); } return resultJson; } @Override public ResultJson getAll() { ResultJson resultJson = new ResultJson(); resultJson.setCode(-1); resultJson.setMsg("查询失败!"); resultJson.setSuccess(false); List<BasisUserRole> list = basisUserRoleMapper.getAll(); if(list.size() >= 0){ resultJson.setCode(0); resultJson.setSuccess(true); resultJson.setMsg("查询成功!"); resultJson.setData(list); } return resultJson; } @Override public ResultJson deleteUserRole(String id) { ResultJson resultJson = new ResultJson(); resultJson.setCode(-1); resultJson.setSuccess(false); resultJson.setMsg("删除用户角色失败!"); if(StringUtils.isEmpty(id)){ resultJson.setMsg("id不能为空!"); return resultJson; } int i = basisUserRoleMapper.deleteByPrimaryKey(id); if(i == 1){ resultJson.setCode(0); resultJson.setSuccess(true); resultJson.setMsg("删除用户角色成功!"); resultJson.setData(i); } return resultJson; } }
true
70ad9d5fb464df2f0e488069af37e7ed46d37829
Java
termxz/LiveReport
/src/main/java/io/termxz/bungee/LiveBridge.java
UTF-8
1,180
2.21875
2
[]
no_license
package io.termxz.bungee; import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.event.EventHandler; public class LiveBridge extends Plugin implements Listener { private static final String CHANNEL_NAME_IN = "livereport:bungee"; private static final String CHANNEL_NAME_OUT = "livereport:spigot"; @Override public void onEnable() { getProxy().registerChannel(CHANNEL_NAME_IN); getProxy().registerChannel(CHANNEL_NAME_OUT); getProxy().getPluginManager().registerListener(this, this); } @Override public void onDisable() { getProxy().unregisterChannel(CHANNEL_NAME_IN); getProxy().registerChannel(CHANNEL_NAME_OUT); } /* Data Received & Distributed: 0 SERVER_NAME 1 REPORTER 2 OFFENDER 3 REASON 4 TYPE */ @EventHandler public void onReceive(PluginMessageEvent e) { if(!e.getTag().equals(CHANNEL_NAME_IN)) return; getProxy().getServers().values().forEach(serverInfo -> serverInfo.sendData(CHANNEL_NAME_OUT, e.getData(), true)); } }
true
4276af7283af57483fd96e343177a8741f496a7c
Java
NicoCometta/TP1_AlgoBay_java
/src/fiuba/algo3/AlgoBay/AlgoBay.java
UTF-8
1,760
2.953125
3
[]
no_license
package fiuba.algo3.AlgoBay; import com.sun.org.apache.regexp.internal.RE; import java.util.ArrayList; /** * Created by nico on 29/10/17. */ public class AlgoBay { private ArrayList<Producto> listaProductos; public AlgoBay(){ this.listaProductos = new ArrayList<>(); } public int getCantidadDeProductos() { return this.listaProductos.size(); } public Producto agregarProductoConPrecio(String nombreProducto, double precioProducto) { Producto nuevoProducto = new Producto(nombreProducto, precioProducto); this.listaProductos.add(nuevoProducto); return nuevoProducto; } public Producto getProducto(String nombreProducto) { for (Producto unProducto: this.listaProductos) { if (unProducto.Eres(nombreProducto)) return unProducto; } return null; } public Compra crearNuevaCompra() { return Compra.crearCompraSimple(); } public void agregarProductoEnCompra(Producto unProducto, Compra unaCompra) { unaCompra.agregarProducto(unProducto); } public double getPrecioTotalDe(Compra unaCompra) { return unaCompra.getPrecio(); } public Compra crearNuevaCompraConEnvio() { return Compra.crearCompraConEnvio(); } public Compra crearNuevaCompraConGarantia() { return Compra.crearCompraConGarantia(); } public Compra crearNuevaCompraConEnvioYGarantia() { return Compra.crearCompraConGarantiaYEnvio(); } public Cupon crearCuponConPorcentaje(int unDescuento) { return (new Cupon(unDescuento)); } public void agregarCuponEnCompra(Cupon unCupon, Compra unaCompra) { unaCompra.agregarCupon(unCupon); } }
true
f29d2698e0b9287c7488e897be92d41fd1d1aae7
Java
pcieszynski/tablettop-rpg
/src/main/java/com/ender/tablettop/service/dto/PlayerMessageDTO.java
UTF-8
2,840
2.484375
2
[]
no_license
package com.ender.tablettop.service.dto; import java.io.Serializable; import java.util.Objects; import javax.persistence.Lob; /** * A DTO for the PlayerMessage entity. */ public class PlayerMessageDTO implements Serializable { private Long id; @Lob private String message; private String attack; private Integer heal; private Integer difficulty; private Boolean success; private String attribute; private Long playerId; private Long eventId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getAttack() { return attack; } public void setAttack(String attack) { this.attack = attack; } public Integer getHeal() { return heal; } public void setHeal(Integer heal) { this.heal = heal; } public Integer getDifficulty() { return difficulty; } public void setDifficulty(Integer difficulty) { this.difficulty = difficulty; } public Boolean isSuccess() { return success; } public void setSuccess(Boolean success) { this.success = success; } public String getAttribute() { return attribute; } public void setAttribute(String attribute) { this.attribute = attribute; } public Long getPlayerId() { return playerId; } public void setPlayerId(Long playerId) { this.playerId = playerId; } public Long getEventId() { return eventId; } public void setEventId(Long eventId) { this.eventId = eventId; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PlayerMessageDTO playerMessageDTO = (PlayerMessageDTO) o; if (playerMessageDTO.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), playerMessageDTO.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "PlayerMessageDTO{" + "id=" + getId() + ", message='" + getMessage() + "'" + ", attack='" + getAttack() + "'" + ", heal=" + getHeal() + ", difficulty=" + getDifficulty() + ", success='" + isSuccess() + "'" + ", attribute='" + getAttribute() + "'" + ", player=" + getPlayerId() + ", event=" + getEventId() + "}"; } }
true
5fea233b097ff9edc5685c7e060b20ae5979e813
Java
miguellysanchez/realmexamples
/app/src/main/java/com/example/realmexample/part2/realmobjects/DogRO.java
UTF-8
690
2.625
3
[]
no_license
package com.example.realmexample.part2.realmobjects; import io.realm.RealmObject; import io.realm.annotations.PrimaryKey; /** * Created by miguellysanchez on 8/7/17. */ public class DogRO extends RealmObject { @PrimaryKey private String name; private String breed; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBreed() { return breed; } public void setBreed(String breed) { this.breed = breed; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
true
98f1e6263111d3fd85a0f3ada284d889ab2d535d
Java
apotukareon/hibersap
/hibersap-core/src/main/java/org/hibersap/configuration/xml/Property.java
UTF-8
3,039
2.1875
2
[ "Apache-2.0" ]
permissive
/* * Copyright (c) 2008-2019 akquinet tech@spree GmbH * * This file is part of Hibersap. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.hibersap.configuration.xml; import java.io.Serializable; import javax.annotation.Generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public class Property implements Serializable { @XmlAttribute(required = true) protected String name; @XmlAttribute(required = true) protected String value; @SuppressWarnings({"UnusedDeclaration"}) public Property() { } public Property(final String name, final String value) { this.name = name; this.value = value; } /** * Gets the value of the name properties. * * @return possible object is * {@link String } */ public String getName() { return name; } /** * Sets the value of the name properties. * * @param value allowed object is * {@link String } */ public void setName(final String value) { this.name = value; } /** * Gets the value of the value properties. * * @return possible object is * {@link String } */ public String getValue() { return value; } /** * Sets the value of the value properties. * * @param value allowed object is * {@link String } */ public void setValue(final String value) { this.value = value; } @Override public String toString() { return "(" + name + " => " + value + ")"; } @Override @Generated("") public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Property property = (Property) o; if (name != null ? !name.equals(property.name) : property.name != null) { return false; } if (value != null ? !value.equals(property.value) : property.value != null) { return false; } return true; } @Override @Generated("") public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (value != null ? value.hashCode() : 0); return result; } }
true
622cf2cfc24e77fd2cd0b5650b519ef77bac29d2
Java
percussion/percussioncms
/projects/sitemanage/src/main/java/com/percussion/sitemanage/data/PSSiteImportCtx.java
UTF-8
6,337
1.875
2
[ "LicenseRef-scancode-dco-1.1", "Apache-2.0", "OFL-1.1", "LGPL-2.0-or-later" ]
permissive
/* * Copyright 1999-2023 Percussion Software, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. */ package com.percussion.sitemanage.data; import com.percussion.sitemanage.importer.IPSSiteImportLogger; import com.percussion.sitesummaryservice.service.IPSSiteImportSummaryService; import com.percussion.theme.data.PSThemeSummary; import java.util.Map; /** * @author LucasPiccoli * */ public class PSSiteImportCtx { String siteUrl; PSSite site; IPSSiteImportLogger logger; IPSSiteImportSummaryService summaryService; Map<IPSSiteImportSummaryService.SiteImportSummaryTypeEnum, Integer> summaryStats; PSThemeSummary themeSummary; String themesRootDirectory; String templateId = null; String pageName; String catalogedPageId; String templateName; String statusMessagePrefix; String userAgent; boolean isCanceled = false; /** * @return the siteUrl */ public String getSiteUrl() { return siteUrl; } /** * @param siteUrl the siteUrl to set */ public void setSiteUrl(String siteUrl) { this.siteUrl = siteUrl; } /** * @return the site */ public PSSite getSite() { return site; } /** * @param site the site to set */ public void setSite(PSSite site) { this.site = site; } /** * Set logger on the context. * * @param logger The logger, never <code>null</code> */ public void setLogger(IPSSiteImportLogger logger) { this.logger = logger; } /** * Get the current logger. * * @return The logger, never <code>null</code>. * @throws IllegalStateException if no logger has been set. */ public IPSSiteImportLogger getLogger() { if (logger == null) throw new IllegalStateException("logger has not been set"); return logger; } public IPSSiteImportSummaryService getSummaryService() { return summaryService; } public void setSummaryService(IPSSiteImportSummaryService summaryService) { this.summaryService = summaryService; } /** * @return the theme summary */ public PSThemeSummary getThemeSummary() { return themeSummary; } /** * @param themeSummary the new summary to assign */ public void setThemeSummary(PSThemeSummary themeSummary) { this.themeSummary = themeSummary; } /** * @return the themes root directory absolute path */ public String getThemesRootDirectory() { return themesRootDirectory; } /** * @param themesRootDirectory the themes root directory absolute path */ public void setThemesRootDirectory(String themesRootDirectory) { this.themesRootDirectory = themesRootDirectory; } /** * Get the id of the template if one was created during the import process. * * @return The id, or <code>null</code> if a template was not created. */ public String getTemplateId() { return templateId; } /** * Set the id of the template if one was created during the import process, must * be called in order for an import log to be saved. * * @param templateId The template id. */ public void setTemplateId(String templateId) { this.templateId = templateId; } /** * @return the pageName */ public String getPageName() { return pageName; } /** * @param pageName the pageName to set */ public void setPageName(String pageName) { this.pageName = pageName; } /** * @return the templateName */ public String getTemplateName() { return templateName; } /** * @param templateName the templateName to set */ public void setTemplateName(String templateName) { this.templateName = templateName; } /** * @return the statusMessagePrefix */ public String getStatusMessagePrefix() { return statusMessagePrefix; } /** * @param statusMessagePrefix the statusMessagePrefix to set */ public void setStatusMessagePrefix(String statusMessagePrefix) { this.statusMessagePrefix = statusMessagePrefix; } /** * @return the userAgent */ public String getUserAgent() { return userAgent; } /** * @param userAgent the userAgent to set */ public void setUserAgent(String userAgent) { this.userAgent = userAgent; } /** * Used when importing cataloged pages. Is the id of the page being * imported. * * @return {@link String} may be <code>null</code>. */ public String getCatalogedPageId() { return catalogedPageId; } public void setCatalogedPageId(String catalogedPageId) { this.catalogedPageId = catalogedPageId; } public void setCanceled(boolean cancelFlag) { isCanceled = cancelFlag; } /** * Determines if the current import process has been canceled. * * @return <code>true</code> if the import process has been canceled. */ public boolean isCanceled() { return isCanceled; } /** * @return May be null if not set. */ public Map<IPSSiteImportSummaryService.SiteImportSummaryTypeEnum, Integer> getSummaryStats() { return summaryStats; } public void setSummaryStats(Map<IPSSiteImportSummaryService.SiteImportSummaryTypeEnum, Integer> summaryStats) { this.summaryStats = summaryStats; } }
true
eca53c9debdc0f1a31ef40d48eebdea81e0c9278
Java
cpchu/heps-db-param_list
/src/java/heps/db/param_list/ejb/ReferenceFacade.java
UTF-8
1,708
2.375
2
[]
no_license
/* * 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 heps.db.param_list.ejb; import static heps.db.param_list.ejb.UnitFacade.em; import heps.db.param_list.entity.Reference; import heps.db.param_list.entity.Unit; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceUnit; import javax.persistence.Query; /** * * @author Lvhuihui */ @Stateless public class ReferenceFacade { @PersistenceUnit static EntityManagerFactory emf = Persistence.createEntityManagerFactory("param_listPU"); static EntityManager em = emf.createEntityManager(); @PersistenceContext public void setReference(String title, String author, String publication, String url, String keywords) { Reference r = new Reference(); r.setTitle(title); r.setAuthor(author); r.setPublication(publication); r.setUrl(url); r.setKeywords(keywords); em.getTransaction().begin(); em.persist(r); em.getTransaction().commit(); } public Reference getReferenceByTitle(String title) { Query q; q = em.createNamedQuery("Reference.findByTitle").setParameter("title", title); List<Reference> l = q.getResultList(); if (l.isEmpty()) { return null; } else { return l.get(0); } } }
true
2af89a6e10d3321d74020cfd50609d267c346f12
Java
haikelei/ChaoKe
/app/src/main/java/luyuan/tech/com/chaoke/activity/AddHouseActivity.java
UTF-8
6,709
1.835938
2
[]
no_license
package luyuan.tech.com.chaoke.activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.ImageView; import com.zhouyou.http.callback.SimpleCallBack; import com.zhouyou.http.exception.ApiException; import com.zhouyou.http.request.PostRequest; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import luyuan.tech.com.chaoke.R; import luyuan.tech.com.chaoke.base.BaseActivity; import luyuan.tech.com.chaoke.bean.ItemBean; import luyuan.tech.com.chaoke.bean.StringDataResponse; import luyuan.tech.com.chaoke.bean.XiaoQuBean; import luyuan.tech.com.chaoke.net.HttpManager; import luyuan.tech.com.chaoke.net.NetParser; import luyuan.tech.com.chaoke.utils.T; import luyuan.tech.com.chaoke.utils.UserInfoUtils; import luyuan.tech.com.chaoke.widget.InputLayout; import luyuan.tech.com.chaoke.widget.SelectDialogFragment; import luyuan.tech.com.chaoke.widget.SelectLayout; import static com.zhouyou.http.EasyHttp.getContext; /** * @author: lujialei * @date: 2019/6/10 * @describe: */ public class AddHouseActivity extends BaseActivity { @BindView(R.id.iv_back) ImageView ivBack; @BindView(R.id.sl_unity_name) SelectLayout slUnityName; @BindView(R.id.input_unity_address) InputLayout inputUnityAddress; @BindView(R.id.sl_house_from) SelectLayout slHouseFrom; @BindView(R.id.sl_house_state) SelectLayout slHouseState; @BindView(R.id.input_host_name) InputLayout inputHostName; @BindView(R.id.input_host_tel) InputLayout inputHostTel; @BindView(R.id.btn_next) Button btnNext; @BindView(R.id.input_lou) InputLayout inputLou; @BindView(R.id.input_danyuan) InputLayout inputDanyuan; @BindView(R.id.input_hao) InputLayout inputHao; @BindView(R.id.sl_chuzufangshi) SelectLayout slChuzufangshi; private String houseId; private XiaoQuBean bean; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_house); ButterKnife.bind(this); String[] arr = {"中介合作", "转介绍", "老客户", "网络端口", "地推", "房东上门", "名单获取", "销冠", "其他"}; setSelectLListener(slHouseFrom,arr); String[] arr1 = {"业主待租", "非自营在租", "业主自用"}; setSelectLListener(slHouseState,arr1); String[] arr2 = {"整租", "分租"}; setSelectLListener(slChuzufangshi,arr2); } @OnClick({R.id.iv_back, R.id.sl_unity_name, R.id.btn_next}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.iv_back: onBackPressed(); break; case R.id.sl_unity_name: startActivityForResult(new Intent(getActivity(),XuanZeXiaoQuActivity.class),133); break; case R.id.btn_next: loadData(); break; } } private void loadData() { if (!checkEmptyInfo()) { return; } PostRequest postRequest = HttpManager.post(HttpManager.FABUONE) .params("token", UserInfoUtils.getInstance().getToken()) .params("address", inputUnityAddress.getText().toString().trim()) .params("source", getValue(slHouseFrom)) .params("rent_state", getValue(slHouseState)) .params("landlady_name", inputHostName.getText().toString().trim()) .params("mode",getValue(slChuzufangshi)) .params("floor_count",inputLou.getText().toString().trim()) .params("unit",inputDanyuan.getText().toString().trim()) .params("number",inputHao.getText().toString().trim()) .params("landlady_phone", inputHostTel.getText().toString().trim()); if (bean!=null){ postRequest.params("rid", bean.getId()+""); } if (!TextUtils.isEmpty(houseId)) { postRequest.params("first_id", houseId); } postRequest.execute(new SimpleCallBack<String>() { @Override public void onError(ApiException e) { T.showShort(getContext(), e.getMessage()); } @Override public void onSuccess(String s) { if (NetParser.isOk(s)) { StringDataResponse response = NetParser.parse(s, StringDataResponse.class); houseId = response.getData(); if (!TextUtils.isEmpty(response.getMsg())){ T.showShort(getActivity(),response.getMsg()); return; } Intent intent = new Intent(getBaseContext(), AddHouseOtherInfoActivity.class); intent.putExtra("id", houseId); startActivityForResult(intent, 199); }else { StringDataResponse dataResponse = NetParser.parse(s,StringDataResponse.class); T.showShort(getActivity(),dataResponse.getMsg()); } } }); } private void createDialog(String[] arr, final SelectLayout sl) { ArrayList<ItemBean> datas = new ArrayList<>(); for (int i = 0; i < arr.length; i++) { ItemBean itemBean = new ItemBean(); itemBean.setTitle(arr[i]); itemBean.setChecked(sl.getText().equals(arr[i])); datas.add(itemBean); } SelectDialogFragment dialogFragment = SelectDialogFragment.create(datas); dialogFragment.show(getSupportFragmentManager()); dialogFragment.setOnSelectListener(new SelectDialogFragment.OnSelectListener() { @Override public void onSelect(String s) { sl.setText(s); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 199) { if (resultCode == RESULT_OK) { setResult(RESULT_OK); finish(); } }else if (requestCode==133){ if (resultCode == RESULT_OK) { bean = (XiaoQuBean) data.getSerializableExtra("data"); slUnityName.setText(bean.getReside_name()); } } } }
true
56d8f4f2dc097ef87d708b13abc8c88c19a9016b
Java
ljsnake/RSERP
/src/com/fudan/rserp/module/yhgl/YhglService.java
UTF-8
3,037
2
2
[]
no_license
package com.fudan.rserp.module.yhgl; import java.util.List; import com.fudan.rserp.config.model.TbErpUser; import com.fudan.rserp.module.base.BaseGetSessionValue; import com.fudan.rserp.util.PageSet; import com.hp.ipg.security.PasswordManager; import com.hp.ipg.security.PasswordManagerException; public class YhglService { private YhglDao dao; public PageSet getYhList(PageSet ps,ListCondition lc){ if(ps==null){ ps = new PageSet(); } ps = dao.getYhList(ps, lc); return ps; } public int addUser(TbErpUser user){ if(user!=null){ if(user.getLoginName()!=null&&!"".equals(user.getLoginName())){ if(dao.checkPropertyInEntityHasExist("TbErpUser","loginName",user.getLoginName())){ return 2;//登录名已存在 } if(user.getPassword()!=null&&!"".equals(user.getPassword())){ try { user.setPassword(PasswordManager.encryptAndEncodeString(user.getPassword())); } catch (PasswordManagerException e) { e.printStackTrace(); return 10;//异常 } } dao.saveOrUpdateObject(user); return 0;//操作成功. } } return 1;//传入参数不合法. } public TbErpUser getUser(TbErpUser uservo){ if(uservo!=null){ return (TbErpUser)dao.getObjectById(TbErpUser.class, uservo.getId()); } return uservo; } public TbErpUser getUserById(Integer id){ return (TbErpUser)dao.getObjectById(TbErpUser.class, id); } public void updateUser(TbErpUser uservo){ TbErpUser user = (TbErpUser)dao.getObjectById(TbErpUser.class, uservo.getId()); user.setName(uservo.getName()); user.setEmail(uservo.getEmail()); if(uservo.getPassword()!=null&&!"".equals(uservo.getPassword())){ try { user.setPassword(PasswordManager.encryptAndEncodeString(uservo.getPassword())); } catch (PasswordManagerException e) { e.printStackTrace(); } } dao.updateObject(user); } public int updatePassword(TbErpUser uservo,String passwordold){ if(uservo==null || passwordold==null || "".equals(passwordold) ||uservo.getPassword()==null || "".equals(uservo.getPassword())){ return 1;//传入值不合法或旧密码为空. } try { passwordold = PasswordManager.encryptAndEncodeString(passwordold); String loginName = BaseGetSessionValue.getUserLoginName(); if(loginName!=null&&!"".equals(loginName)){ List<?> ls = dao.checkUserLoginNamePasswordExist(loginName,passwordold); if(ls==null||ls.size()<1){ return 2;//原密码错误. } } String id = BaseGetSessionValue.getUserId(); if(id!=null&&!"".equals(id)){ TbErpUser user = (TbErpUser)dao.getObjectById(TbErpUser.class, id); try { user.setPassword(PasswordManager.encryptAndEncodeString(uservo.getPassword())); dao.updateObject(user); return 0;//操作成功. } catch (PasswordManagerException e) { e.printStackTrace(); } } } catch (PasswordManagerException e) { e.printStackTrace(); } return 10;//异常. } public YhglDao getDao() { return dao; } public void setDao(YhglDao dao) { this.dao = dao; } }
true
54cb2b4662f09165e1c245d52bae39fd93fcc390
Java
StandCN/Project-M
/service/user/src/main/java/com/hellcat/user/UserApplication.java
UTF-8
720
1.695313
2
[ "Apache-2.0" ]
permissive
package com.hellcat.user; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.data.mongodb.repository.config.EnableReactiveMongoRepositories; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.web.reactive.config.EnableWebFlux; @SpringBootApplication @EnableReactiveMongoRepositories @EnableTransactionManagement @EnableWebFlux @EnableAspectJAutoProxy public class UserApplication { public static void main(String[] args) { SpringApplication.run(UserApplication.class, args); } }
true
aaa4a361384c04c5524cfcd94d4bdc010f83cae2
Java
aysenurcelik/NorthWindFinal
/northWindProject/src/main/java/com/northWind/northWindProject/entities/conretes/Cart.java
UTF-8
821
2.125
2
[]
no_license
package com.northWind.northWindProject.entities.conretes; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import com.northWind.northWindProject.entities.abstracts.IEntity; import lombok.Data; @Entity @Table(name="cart") @Data public class Cart implements IEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="cart_id") int cartId; @Column(name="product_id") int prodcutId; @Column(name="customer_id") String customerId; public int custId = Integer.parseInt(customerId); @Column(name="quantity") int quantity; @Column(name="item_cost") String cartItemCost; @Column(name ="item_name") String itemName; }
true
fc2513b334d258f879bc900e1bed00354f6c62f1
Java
cengizgoren/facebook_apk_crack
/app/com/facebook/katana/activity/media/vault/VaultOptInControlFragment.java
UTF-8
787
1.570313
2
[]
no_license
package com.facebook.katana.activity.media.vault; import android.os.Bundle; import android.text.Html; import android.view.View; import android.widget.TextView; import com.facebook.orca.common.util.StringLocaleUtil; public class VaultOptInControlFragment extends VaultSimpleOptInFragment { public void d(Bundle paramBundle) { super.d(paramBundle); String str1 = "<b><u>" + e(2131363601) + "</u></b>"; String str2 = StringLocaleUtil.b(e(2131363600), new Object[] { str1 }); ((TextView)A().findViewById(2131297948)).setText(Html.fromHtml(str2)); } } /* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar * Qualified Name: com.facebook.katana.activity.media.vault.VaultOptInControlFragment * JD-Core Version: 0.6.0 */
true
adc3ff2c8c8736729b60983610d661c190bc483f
Java
zuzya/proxyTest
/src/me/proxy/storage/impl/DBStorageReader.java
UTF-8
3,976
2.265625
2
[]
no_license
package me.proxy.storage.impl; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.sql.Blob; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.DateFormat; import java.text.SimpleDateFormat; import me.proxy.storage.common.StorageReader; public class DBStorageReader extends StorageReader { public DBStorageReader(OutputStream streamFrom, boolean isRequest) { super(streamFrom, isRequest); } protected InputStream inputStream; protected ByteArrayOutputStream outputStream; private static final String DB_DRIVER = "com.mysql.jdbc.Driver"; private static final String DB_CONNECTION = "jdbc:mysql://localhost:3306/proxydb"; private static final String DB_USER = "root"; private static final String DB_PASSWORD = ""; private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @Override public InputStream readRow() { Connection dbConnection = null; PreparedStatement preparedStatement = null; Statement statement = null; ResultSet rs = null; InputStream stream = null; outputStream = new ByteArrayOutputStream(); String tableName = null; if(isRequest){ tableName = "REQUEST"; } else { tableName = "ANSWER"; } String insertTableSQL = "SELECT * FROM proxydb." +tableName+ " r WHERE r.Readed = 0 ORDER BY r.DATE "; try { dbConnection = getDBConnection(); preparedStatement = dbConnection.prepareStatement(insertTableSQL,ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); while(true){ // execute insert SQL stetement rs = preparedStatement.executeQuery(); if(rs.isBeforeFirst()) break; } while(rs.next()){ int id = rs.getInt(1); byte[] body = rs.getBytes(3); // Blob blob = rs.getBlob(3); // stream = blob.getBinaryStream(); // // stream = new ByteArrayInputStream(body); try { outputStream.write(body); } catch (IOException e1) { e1.printStackTrace(); } System.out.println("Body: "); System.out.println(new String(body)); boolean b = rs.getBoolean(5); rs.updateBoolean("Readed", true); rs.updateRow(); } System.out.println("Record is readed into REQUEST table!"); return new ByteArrayInputStream(outputStream.toByteArray()); } catch (SQLException e) { System.out.println(e.getMessage()); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (dbConnection != null) { try { dbConnection.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } return new ByteArrayInputStream(outputStream.toByteArray()); } private static Connection getDBConnection() { Connection dbConnection = null; try { Class.forName(DB_DRIVER); } catch (ClassNotFoundException e) { System.out.println(e.getMessage()); } try { dbConnection = DriverManager.getConnection( DB_CONNECTION, DB_USER,DB_PASSWORD); return dbConnection; } catch (SQLException e) { System.out.println(e.getMessage()); } return dbConnection; } private static String getCurrentTimeStamp() { java.util.Date today = new java.util.Date(); return dateFormat.format(today.getTime()); } }
true
07397b073768c30bcce266eb015d86cf85a86366
Java
salmawardha/Pemrograman-1
/flipLines.java
UTF-8
502
3.109375
3
[]
no_license
import java.io.*; import java.util.*; public class flipLines { public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File("fliplines.txt")); flipLines(input); } public static void flipLines(Scanner input) { while (input.hasNextLine()) { String line = input.nextLine(); if (input.hasNextLine()) { System.out.println(input.nextLine()); } System.out.println(line); } } }
true
6a2280f53f66905f2110280fafe9bc9fc2b15fdd
Java
Zumbalamambo/PullLayout
/app/src/main/java/com/d/pulllayout/pull/activity/RecyclerViewActivity.java
UTF-8
1,392
2.25
2
[ "Apache-2.0" ]
permissive
package com.d.pulllayout.pull.activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import com.d.pulllayout.R; import com.d.pulllayout.pull.adapter.RecyclerAdapter; import java.util.ArrayList; import java.util.List; /** * RecyclerViewActivity * Created by D on 2018/5/31. */ public class RecyclerViewActivity extends AppCompatActivity { private RecyclerView rv_list; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pull_recyclerview); rv_list = (RecyclerView) findViewById(R.id.rv_list); init(); } private void init() { LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); rv_list.setLayoutManager(layoutManager); rv_list.setAdapter(new RecyclerAdapter(this, getDatas(), R.layout.adapter_item)); } @NonNull private List<String> getDatas() { List<String> datas = new ArrayList<>(); for (int i = 0; i < 20; i++) { datas.add("" + i); } return datas; } }
true
81a12a48c10ea1555f095596ad5a727126f1dda8
Java
3ntropia/ProgramacionIII
/TP1/src/indiceN/MainIndiceN.java
UTF-8
543
3.015625
3
[]
no_license
package indiceN; import Implementaciones.Vector; import TDA.VectorTDA; /** * @author martinh * */ public class MainIndiceN { public static void main(String[] args) { try { VectorTDA<Integer> vec = new Vector<Integer>(); vec.inicializarVector(50); for (int i = 0; i < 50; i++) { vec.agregarElemento(i, i + 1); } vec.agregarElemento(20, 20); int a = Metodo.indiceNatural(vec, 0, 50); System.out.print(a); } catch ( Exception e) { System.out.print(e.getMessage()); } } }
true
cbabc4c1c064a697af743d24cf39963395adb2c0
Java
SpongePowered/SpongeAPI
/src/main/java/org/spongepowered/api/entity/EntitySnapshot.java
UTF-8
6,257
1.78125
2
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.spongepowered.api.entity; import org.spongepowered.api.Game; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.DataHolderBuilder; import org.spongepowered.api.data.persistence.DataBuilder; import org.spongepowered.api.util.Transform; import org.spongepowered.api.world.LocatableSnapshot; import org.spongepowered.api.world.World; import org.spongepowered.api.world.schematic.Schematic; import org.spongepowered.api.world.server.ServerLocation; import org.spongepowered.api.world.server.storage.ServerWorldProperties; import org.spongepowered.api.world.storage.WorldProperties; import org.spongepowered.math.vector.Vector3d; import org.spongepowered.math.vector.Vector3i; import java.util.Optional; import java.util.UUID; import java.util.function.Supplier; /** * Represents a snapshot of an {@link Entity} and all of it's related data in * the form of {@link org.spongepowered.api.data.DataManipulator.Immutable}s and {@link org.spongepowered.api.data.value.Value.Immutable}s. * While an {@link Entity} is a live instance and resides in a * {@link World}, an {@link EntitySnapshot} may be snapshotted of a * {@link World} that is not currently loaded, or may not exist any longer. * * <p>All data associated with the {@link EntitySnapshot} should be separated * from the {@link Game} instance such that external processing, building, * and manipulation can take place.</p> */ public interface EntitySnapshot extends LocatableSnapshot<EntitySnapshot> { /** * Creates a new {@link Builder} to build an {@link EntitySnapshot}. * * @return The new builder */ static Builder builder() { return Sponge.game().builderProvider().provide(Builder.class); } /** * Gets an {@link Optional} containing the {@link UUID} of the * {@link Entity} that this {@link EntitySnapshot} is representing. If the * {@link Optional} is {@link Optional#empty()}, then this snapshot must * have been created by an {@link Builder} without an {@link Entity} as a * source. * * @return The Optional where the UUID may be present */ Optional<UUID> uniqueId(); /** * Gets the {@link Transform} as an {@link Optional} as the {@link ServerLocation} * may be undefined if this {@link EntitySnapshot} was built without a * location. This method is linked to {@link #location()} such that if * there is a {@link ServerLocation}, there is usually a {@link Transform}. * * @return The transform, if available */ Optional<Transform> transform(); /** * Gets the {@link EntityType}. * * @return The EntityType */ EntityType<?> type(); /** * Restores the {@link EntitySnapshot} to the {@link ServerLocation} stored within * the snapshot. If the {@link ServerLocation} is not available, the snapshot will * not be restored. * * @return the restored entity if successful */ Optional<Entity> restore(); /** * Creates a new {@link EntityArchetype} for use with {@link Schematic}s and * placing the archetype in multiple locations. * * @return The created archetype for re-creating this entity */ EntityArchetype createArchetype(); /** * An {@link org.spongepowered.api.data.DataHolderBuilder.Immutable} for building {@link EntitySnapshot}s. The * requirements */ interface Builder extends DataHolderBuilder.Immutable<EntitySnapshot, Builder>, DataBuilder<EntitySnapshot> { /** * Sets the {@link WorldProperties} for this {@link EntitySnapshot}. * * <p>This is used to grab the {@link UUID} of the World for this * snapshot.</p> * * @param worldProperties The WorldProperties * @return This builder, for chaining */ Builder world(ServerWorldProperties worldProperties); /** * Sets the {@link EntityType} for this {@link EntitySnapshot}. * * @param entityType The EntityType * @return This builder, for chaining */ default Builder type(Supplier<? extends EntityType<?>> entityType) { return this.type(entityType.get()); } /** * Sets the {@link EntityType} for this {@link EntitySnapshot}. * * @param entityType The EntityType * @return This builder, for chaining */ Builder type(EntityType<?> entityType); /** * Sets the coordinates of this {@link EntitySnapshot} from a * {@link Vector3i}. * * @param position The Vector3i representing the coordinates * @return This builder, for chaining */ Builder position(Vector3d position); /** * Copies over data from an {@link Entity}. * * @param entity The Entity * @return This builder, for chaining */ Builder from(Entity entity); } }
true
bba6542ae66d079608a9d53629e38351c622af12
Java
FaNaTiKoRn/SB
/src/sb_jtorres/DBConnect.java
UTF-8
3,803
2.515625
3
[]
no_license
/* * 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. */ /* In general, to process any SQL statement with JDBC, you follow these steps: 1.- Establishing a connection. 2.- Create a statement. 3.- Execute the query. 4.- Process the ResultSet object. 5.- Close the connection. */ package sb_jtorres; import java.sql.*; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Icon; import javax.swing.ImageIcon; /* import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; */ import javax.swing.JOptionPane; /** * * @author FaNaTiKoRn */ public class DBConnect { /*private String db = "CaC"; private String url = "WOLVERINE\\SQLEXPRESS:1433"+db; private String user = "sa"; private String pass = "sa2017"; */ public String Conectar() throws ClassNotFoundException, SQLException{ //Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); //Para SQLServer Class.forName("com.mysql.jdbc.Driver"); //Para MySQL //String server = "WOLVERINE\\MSSQL14.SQLEXPRESS:1433"; // MsSQL SERVER String db = "SB_JTorres"; String server = "127.0.0.1/" + db; // MySQL SERVER //Servidor + DB String user = "root"; //'sa' para MsSQLServer //'adm' (abc123) para PHPMySQLServer // bejerman (tiMCLmu27qtQwD) para ambas plataformas String pass = ""; //String connectionURL = "jdbc:sqlserver://" + server + ";databaseName=" + db + ";user=" + user + ";password=" + pass + ";"; //Conexión a MsSQLServer String connectionURL = "jdbc:mysql://" + server; //Conexión a PHPMySQLServer Connection cnx = DriverManager.getConnection(connectionURL,user,pass);//Conectado //cnx.setAutoCommit(false); //cnx.commit(); //cnx.rollback(); Statement st = null; st = cnx.createStatement(); ResultSet rs = st.executeQuery("select * from usu"); /* // o bien... Connection cnx = null; cnx = DriverManager.getConnection(url, user, pass); */ while (rs.next()) { int usu_id = rs.getInt(1); String usu_codigo = rs.getString(2); String usu_clave = rs.getString(3); String usu_nombre = rs.getString(4); int usu_status = rs.getInt(5); System.out.println("ID:" + usu_id + " - Nombre:" + usu_nombre + " - Código:" + usu_codigo + " - clave:" + usu_clave + " - Estado:" + usu_status); } //st = cnx.createStatement(); rs.close(); cnx.close(); return db; } public void Desconectar() { /* public void cierraConexion() { try { Conector.close(); } catch (SQLException sqle) { JOptionPane.showMessageDialog(null, "Error al cerrar conexion", "Error", JOptionPane.ERROR_MESSAGE); Logger.getLogger(ConexionDAO.class.getName()).log(Level.SEVERE, null, sqle); } } */ /* public void cierraConsultas() { try { if (Rs != null) { Rs.close(); } if (St != null) { St.close(); } if (Conector != null) { Conector.close(); } } catch (SQLException sqle) { JOptionPane.showMessageDialog(null, "Error cerrando la conexion!", "Error", JOptionPane.ERROR_MESSAGE); Logger.getLogger(LicoreriasDAO.class.getName()).log(Level.SEVERE, null, sqle); } } */ } }
true
e0f6ce12de624d849177b1f54489bb92944f399b
Java
fmisiarz/kodilla-testing
/kodilla-testing/src/main/java/com/kodilla/testing/collection/OddNumbersExterminator.java
UTF-8
417
3.046875
3
[]
no_license
package com.kodilla.testing.collection; import java.util.ArrayList; public class OddNumbersExterminator { public ArrayList<Integer> exterminate(ArrayList<Integer> number) { ArrayList<Integer> numbers2 = new ArrayList<Integer>(); for (Integer numbers : number) { if (numbers % 2 == 0) { numbers2.add(numbers); } } return numbers2; } }
true
ab82202b0d53a66a14402c3f8ef98b1e711b090f
Java
vishal1975/ATM
/AtmMachine/src/atm/Account.java
UTF-8
1,206
2.984375
3
[]
no_license
package atm; public class Account { private int AccountNo; private int age; private String name; private int CurrentAmount; private int password; Account(int AccountNo,int age,String name,int CurrentAmount,int password){ this.AccountNo=AccountNo; this.age=age; this.CurrentAmount=CurrentAmount; this.name=name; this.password=password; } public String toString() { String s=" "; s=s+"YOUR ACCOUNT NO: "+ getAccountNo() +"\n"; s+="YOUR AGE : " + getAge() +"\n"; s+="YOUR NAME : " + getName() +"\n"; s+="YOUR CURRENTAMOUNT : " + getCurrentAmount()+"\n"; return s; } public int getAccountNo() { return AccountNo; } public void setAccountNo(int accountNo) { AccountNo = accountNo; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getCurrentAmount() { return CurrentAmount; } public void setCurrentAmount(int currentAmount) { CurrentAmount = currentAmount; } public int getPassword() { return password; } public void setPassword(int password) { this.password = password; } }
true
dc0c98951e3a7c85592380a28eb792fb0420862d
Java
wasadmin/ewallet
/CentralSwitchClient/src/zw/co/esolutions/ewallet/merchantservices/service/ObjectFactory.java
UTF-8
74,890
1.609375
2
[]
no_license
// // Generated By:JAX-WS RI IBM 2.1.6 in JDK 6 (JAXB RI IBM JAXB 2.1.10 in JDK 6) // package zw.co.esolutions.ewallet.merchantservices.service; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the zw.co.esolutions.ewallet.merchantservices.service package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber"); private final static QName _ApproveCustomerMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveCustomerMerchantResponse"); private final static QName _GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus"); private final static QName _ApproveMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveMerchantResponse"); private final static QName _DeleteCustomerMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteCustomerMerchant"); private final static QName _ApproveBankMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveBankMerchant"); private final static QName _FindCustomerMerchantById_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findCustomerMerchantById"); private final static QName _GetBankMerchantByBankIdAndMerchantIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankIdAndMerchantIdResponse"); private final static QName _DeleteMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteMerchant"); private final static QName _FindMerchantById_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findMerchantById"); private final static QName _GetCustomerMerchantByCustomerIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerIdResponse"); private final static QName _GetMerchantByCustomerIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByCustomerIdResponse"); private final static QName _GetCustomerMerchantByBankId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankId"); private final static QName _GetCustomerMerchantByStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByStatus"); private final static QName _GetCustomerMerchantByCustomerAccountNumberResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerAccountNumberResponse"); private final static QName _GetMerchantByStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByStatus"); private final static QName _GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse"); private final static QName _GetAllMerchants_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getAllMerchants"); private final static QName _ApproveMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveMerchant"); private final static QName _GetBankMerchantByBankIdAndMerchantId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankIdAndMerchantId"); private final static QName _ApproveCustomerMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveCustomerMerchant"); private final static QName _GetCustomerMerchantByCustomerId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerId"); private final static QName _GetMerchantByCustomerId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByCustomerId"); private final static QName _EditBankMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editBankMerchantResponse"); private final static QName _Exception_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "Exception"); private final static QName _DisapproveBankMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveBankMerchantResponse"); private final static QName _GetCustomerMerchantByCustomerAccountNumber_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerAccountNumber"); private final static QName _CreateBankMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createBankMerchantResponse"); private final static QName _GetBankMerchantByMerchantIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByMerchantIdResponse"); private final static QName _GetBankMerchantByStatusAndBankIdAndMerchantIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByStatusAndBankIdAndMerchantIdResponse"); private final static QName _DeleteBankMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteBankMerchantResponse"); private final static QName _FindBankMerchantByIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findBankMerchantByIdResponse"); private final static QName _EditCustomerMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editCustomerMerchantResponse"); private final static QName _GetBankMerchantByBankIdAndShortNameAndStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankIdAndShortNameAndStatusResponse"); private final static QName _GetMerchantByShortNameResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByShortNameResponse"); private final static QName _GetCustomerMerchantByBankMerchantIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankMerchantIdResponse"); private final static QName _EditMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editMerchantResponse"); private final static QName _EditBankMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editBankMerchant"); private final static QName _DisapproveMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveMerchantResponse"); private final static QName _GetBankMerchantByBankIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankIdResponse"); private final static QName _GetBankMerchantByStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByStatusResponse"); private final static QName _CreateMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createMerchantResponse"); private final static QName _DisapproveCustomerMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveCustomerMerchantResponse"); private final static QName _CreateBankMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createBankMerchant"); private final static QName _GetMerchantByNameResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByNameResponse"); private final static QName _DisapproveBankMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveBankMerchant"); private final static QName _CreateCustomerMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createCustomerMerchantResponse"); private final static QName _GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus"); private final static QName _GetBankMerchantByMerchantId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByMerchantId"); private final static QName _FindMerchantByIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findMerchantByIdResponse"); private final static QName _DeleteMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteMerchantResponse"); private final static QName _GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse"); private final static QName _EditCustomerMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editCustomerMerchant"); private final static QName _GetBankMerchantByBankIdAndShortNameAndStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankIdAndShortNameAndStatus"); private final static QName _FindCustomerMerchantByIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findCustomerMerchantByIdResponse"); private final static QName _EditMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "editMerchant"); private final static QName _ApproveBankMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "approveBankMerchantResponse"); private final static QName _DeleteCustomerMerchantResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteCustomerMerchantResponse"); private final static QName _GetCustomerMerchantByBankMerchantId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankMerchantId"); private final static QName _GetMerchantByShortName_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByShortName"); private final static QName _GetBankMerchantByStatusAndBankIdAndMerchantId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByStatusAndBankIdAndMerchantId"); private final static QName _FindBankMerchantById_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "findBankMerchantById"); private final static QName _DeleteBankMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "deleteBankMerchant"); private final static QName _GetBankMerchantByBankId_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByBankId"); private final static QName _GetMerchantByStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByStatusResponse"); private final static QName _GetCustomerMerchantByBankIdResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByBankIdResponse"); private final static QName _CreateMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createMerchant"); private final static QName _DisapproveCustomerMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveCustomerMerchant"); private final static QName _GetCustomerMerchantByStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByStatusResponse"); private final static QName _DisapproveMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "disapproveMerchant"); private final static QName _GetMerchantByName_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getMerchantByName"); private final static QName _GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse"); private final static QName _GetAllMerchantsResponse_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getAllMerchantsResponse"); private final static QName _CreateCustomerMerchant_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "createCustomerMerchant"); private final static QName _GetBankMerchantByStatus_QNAME = new QName("http://service.merchantservices.ewallet.esolutions.co.zw/", "getBankMerchantByStatus"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: zw.co.esolutions.ewallet.merchantservices.service * */ public ObjectFactory() { } /** * Create an instance of {@link GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus } * */ public GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus createGetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus() { return new GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus(); } /** * Create an instance of {@link GetAllMerchantsResponse } * */ public GetAllMerchantsResponse createGetAllMerchantsResponse() { return new GetAllMerchantsResponse(); } /** * Create an instance of {@link DeleteMerchant } * */ public DeleteMerchant createDeleteMerchant() { return new DeleteMerchant(); } /** * Create an instance of {@link GetBankMerchantByStatusAndBankIdAndMerchantIdResponse } * */ public GetBankMerchantByStatusAndBankIdAndMerchantIdResponse createGetBankMerchantByStatusAndBankIdAndMerchantIdResponse() { return new GetBankMerchantByStatusAndBankIdAndMerchantIdResponse(); } /** * Create an instance of {@link GetBankMerchantByStatusResponse } * */ public GetBankMerchantByStatusResponse createGetBankMerchantByStatusResponse() { return new GetBankMerchantByStatusResponse(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse } * */ public GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse createGetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse() { return new GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse(); } /** * Create an instance of {@link CreateCustomerMerchant } * */ public CreateCustomerMerchant createCreateCustomerMerchant() { return new CreateCustomerMerchant(); } /** * Create an instance of {@link FindBankMerchantByIdResponse } * */ public FindBankMerchantByIdResponse createFindBankMerchantByIdResponse() { return new FindBankMerchantByIdResponse(); } /** * Create an instance of {@link CreateMerchantResponse } * */ public CreateMerchantResponse createCreateMerchantResponse() { return new CreateMerchantResponse(); } /** * Create an instance of {@link CreateMerchant } * */ public CreateMerchant createCreateMerchant() { return new CreateMerchant(); } /** * Create an instance of {@link Merchant } * */ public Merchant createMerchant() { return new Merchant(); } /** * Create an instance of {@link GetBankMerchantByStatusAndBankIdAndMerchantId } * */ public GetBankMerchantByStatusAndBankIdAndMerchantId createGetBankMerchantByStatusAndBankIdAndMerchantId() { return new GetBankMerchantByStatusAndBankIdAndMerchantId(); } /** * Create an instance of {@link GetBankMerchantByStatus } * */ public GetBankMerchantByStatus createGetBankMerchantByStatus() { return new GetBankMerchantByStatus(); } /** * Create an instance of {@link DisapproveCustomerMerchant } * */ public DisapproveCustomerMerchant createDisapproveCustomerMerchant() { return new DisapproveCustomerMerchant(); } /** * Create an instance of {@link DisapproveCustomerMerchantResponse } * */ public DisapproveCustomerMerchantResponse createDisapproveCustomerMerchantResponse() { return new DisapproveCustomerMerchantResponse(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerAccountNumber } * */ public GetCustomerMerchantByCustomerAccountNumber createGetCustomerMerchantByCustomerAccountNumber() { return new GetCustomerMerchantByCustomerAccountNumber(); } /** * Create an instance of {@link GetAllMerchants } * */ public GetAllMerchants createGetAllMerchants() { return new GetAllMerchants(); } /** * Create an instance of {@link EditCustomerMerchant } * */ public EditCustomerMerchant createEditCustomerMerchant() { return new EditCustomerMerchant(); } /** * Create an instance of {@link GetBankMerchantByMerchantIdResponse } * */ public GetBankMerchantByMerchantIdResponse createGetBankMerchantByMerchantIdResponse() { return new GetBankMerchantByMerchantIdResponse(); } /** * Create an instance of {@link GetBankMerchantByBankIdAndMerchantIdResponse } * */ public GetBankMerchantByBankIdAndMerchantIdResponse createGetBankMerchantByBankIdAndMerchantIdResponse() { return new GetBankMerchantByBankIdAndMerchantIdResponse(); } /** * Create an instance of {@link DisapproveMerchantResponse } * */ public DisapproveMerchantResponse createDisapproveMerchantResponse() { return new DisapproveMerchantResponse(); } /** * Create an instance of {@link GetCustomerMerchantByBankIdResponse } * */ public GetCustomerMerchantByBankIdResponse createGetCustomerMerchantByBankIdResponse() { return new GetCustomerMerchantByBankIdResponse(); } /** * Create an instance of {@link GetCustomerMerchantByBankMerchantId } * */ public GetCustomerMerchantByBankMerchantId createGetCustomerMerchantByBankMerchantId() { return new GetCustomerMerchantByBankMerchantId(); } /** * Create an instance of {@link GetCustomerMerchantByStatus } * */ public GetCustomerMerchantByStatus createGetCustomerMerchantByStatus() { return new GetCustomerMerchantByStatus(); } /** * Create an instance of {@link ApproveCustomerMerchantResponse } * */ public ApproveCustomerMerchantResponse createApproveCustomerMerchantResponse() { return new ApproveCustomerMerchantResponse(); } /** * Create an instance of {@link GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse } * */ public GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse createGetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse() { return new GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse(); } /** * Create an instance of {@link GetMerchantByName } * */ public GetMerchantByName createGetMerchantByName() { return new GetMerchantByName(); } /** * Create an instance of {@link GetMerchantByShortNameResponse } * */ public GetMerchantByShortNameResponse createGetMerchantByShortNameResponse() { return new GetMerchantByShortNameResponse(); } /** * Create an instance of {@link GetBankMerchantByBankIdAndShortNameAndStatusResponse } * */ public GetBankMerchantByBankIdAndShortNameAndStatusResponse createGetBankMerchantByBankIdAndShortNameAndStatusResponse() { return new GetBankMerchantByBankIdAndShortNameAndStatusResponse(); } /** * Create an instance of {@link DeleteCustomerMerchantResponse } * */ public DeleteCustomerMerchantResponse createDeleteCustomerMerchantResponse() { return new DeleteCustomerMerchantResponse(); } /** * Create an instance of {@link EditBankMerchant } * */ public EditBankMerchant createEditBankMerchant() { return new EditBankMerchant(); } /** * Create an instance of {@link EditMerchant } * */ public EditMerchant createEditMerchant() { return new EditMerchant(); } /** * Create an instance of {@link GetBankMerchantByBankIdResponse } * */ public GetBankMerchantByBankIdResponse createGetBankMerchantByBankIdResponse() { return new GetBankMerchantByBankIdResponse(); } /** * Create an instance of {@link Exception } * */ public Exception createException() { return new Exception(); } /** * Create an instance of {@link DeleteBankMerchant } * */ public DeleteBankMerchant createDeleteBankMerchant() { return new DeleteBankMerchant(); } /** * Create an instance of {@link ApproveBankMerchantResponse } * */ public ApproveBankMerchantResponse createApproveBankMerchantResponse() { return new ApproveBankMerchantResponse(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerIdResponse } * */ public GetCustomerMerchantByCustomerIdResponse createGetCustomerMerchantByCustomerIdResponse() { return new GetCustomerMerchantByCustomerIdResponse(); } /** * Create an instance of {@link GetBankMerchantByBankIdAndMerchantId } * */ public GetBankMerchantByBankIdAndMerchantId createGetBankMerchantByBankIdAndMerchantId() { return new GetBankMerchantByBankIdAndMerchantId(); } /** * Create an instance of {@link ApproveMerchant } * */ public ApproveMerchant createApproveMerchant() { return new ApproveMerchant(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse } * */ public GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse createGetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse() { return new GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse(); } /** * Create an instance of {@link FindMerchantById } * */ public FindMerchantById createFindMerchantById() { return new FindMerchantById(); } /** * Create an instance of {@link GetCustomerMerchantByStatusResponse } * */ public GetCustomerMerchantByStatusResponse createGetCustomerMerchantByStatusResponse() { return new GetCustomerMerchantByStatusResponse(); } /** * Create an instance of {@link ApproveCustomerMerchant } * */ public ApproveCustomerMerchant createApproveCustomerMerchant() { return new ApproveCustomerMerchant(); } /** * Create an instance of {@link FindCustomerMerchantByIdResponse } * */ public FindCustomerMerchantByIdResponse createFindCustomerMerchantByIdResponse() { return new FindCustomerMerchantByIdResponse(); } /** * Create an instance of {@link EditBankMerchantResponse } * */ public EditBankMerchantResponse createEditBankMerchantResponse() { return new EditBankMerchantResponse(); } /** * Create an instance of {@link CreateBankMerchant } * */ public CreateBankMerchant createCreateBankMerchant() { return new CreateBankMerchant(); } /** * Create an instance of {@link FindBankMerchantById } * */ public FindBankMerchantById createFindBankMerchantById() { return new FindBankMerchantById(); } /** * Create an instance of {@link DisapproveMerchant } * */ public DisapproveMerchant createDisapproveMerchant() { return new DisapproveMerchant(); } /** * Create an instance of {@link DeleteMerchantResponse } * */ public DeleteMerchantResponse createDeleteMerchantResponse() { return new DeleteMerchantResponse(); } /** * Create an instance of {@link GetMerchantByCustomerIdResponse } * */ public GetMerchantByCustomerIdResponse createGetMerchantByCustomerIdResponse() { return new GetMerchantByCustomerIdResponse(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerId } * */ public GetCustomerMerchantByCustomerId createGetCustomerMerchantByCustomerId() { return new GetCustomerMerchantByCustomerId(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerAccountNumberResponse } * */ public GetCustomerMerchantByCustomerAccountNumberResponse createGetCustomerMerchantByCustomerAccountNumberResponse() { return new GetCustomerMerchantByCustomerAccountNumberResponse(); } /** * Create an instance of {@link GetMerchantByNameResponse } * */ public GetMerchantByNameResponse createGetMerchantByNameResponse() { return new GetMerchantByNameResponse(); } /** * Create an instance of {@link DeleteCustomerMerchant } * */ public DeleteCustomerMerchant createDeleteCustomerMerchant() { return new DeleteCustomerMerchant(); } /** * Create an instance of {@link GetMerchantByStatusResponse } * */ public GetMerchantByStatusResponse createGetMerchantByStatusResponse() { return new GetMerchantByStatusResponse(); } /** * Create an instance of {@link GetCustomerMerchantByBankMerchantIdResponse } * */ public GetCustomerMerchantByBankMerchantIdResponse createGetCustomerMerchantByBankMerchantIdResponse() { return new GetCustomerMerchantByBankMerchantIdResponse(); } /** * Create an instance of {@link FindMerchantByIdResponse } * */ public FindMerchantByIdResponse createFindMerchantByIdResponse() { return new FindMerchantByIdResponse(); } /** * Create an instance of {@link CreateBankMerchantResponse } * */ public CreateBankMerchantResponse createCreateBankMerchantResponse() { return new CreateBankMerchantResponse(); } /** * Create an instance of {@link GetBankMerchantByBankIdAndShortNameAndStatus } * */ public GetBankMerchantByBankIdAndShortNameAndStatus createGetBankMerchantByBankIdAndShortNameAndStatus() { return new GetBankMerchantByBankIdAndShortNameAndStatus(); } /** * Create an instance of {@link GetMerchantByStatus } * */ public GetMerchantByStatus createGetMerchantByStatus() { return new GetMerchantByStatus(); } /** * Create an instance of {@link ApproveBankMerchant } * */ public ApproveBankMerchant createApproveBankMerchant() { return new ApproveBankMerchant(); } /** * Create an instance of {@link DisapproveBankMerchant } * */ public DisapproveBankMerchant createDisapproveBankMerchant() { return new DisapproveBankMerchant(); } /** * Create an instance of {@link GetMerchantByCustomerId } * */ public GetMerchantByCustomerId createGetMerchantByCustomerId() { return new GetMerchantByCustomerId(); } /** * Create an instance of {@link GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber } * */ public GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber createGetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber() { return new GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber(); } /** * Create an instance of {@link EditMerchantResponse } * */ public EditMerchantResponse createEditMerchantResponse() { return new EditMerchantResponse(); } /** * Create an instance of {@link EditCustomerMerchantResponse } * */ public EditCustomerMerchantResponse createEditCustomerMerchantResponse() { return new EditCustomerMerchantResponse(); } /** * Create an instance of {@link CustomerMerchant } * */ public CustomerMerchant createCustomerMerchant() { return new CustomerMerchant(); } /** * Create an instance of {@link ApproveMerchantResponse } * */ public ApproveMerchantResponse createApproveMerchantResponse() { return new ApproveMerchantResponse(); } /** * Create an instance of {@link DisapproveBankMerchantResponse } * */ public DisapproveBankMerchantResponse createDisapproveBankMerchantResponse() { return new DisapproveBankMerchantResponse(); } /** * Create an instance of {@link CreateCustomerMerchantResponse } * */ public CreateCustomerMerchantResponse createCreateCustomerMerchantResponse() { return new CreateCustomerMerchantResponse(); } /** * Create an instance of {@link BankMerchant } * */ public BankMerchant createBankMerchant() { return new BankMerchant(); } /** * Create an instance of {@link GetBankMerchantByBankId } * */ public GetBankMerchantByBankId createGetBankMerchantByBankId() { return new GetBankMerchantByBankId(); } /** * Create an instance of {@link GetMerchantByShortName } * */ public GetMerchantByShortName createGetMerchantByShortName() { return new GetMerchantByShortName(); } /** * Create an instance of {@link FindCustomerMerchantById } * */ public FindCustomerMerchantById createFindCustomerMerchantById() { return new FindCustomerMerchantById(); } /** * Create an instance of {@link GetBankMerchantByMerchantId } * */ public GetBankMerchantByMerchantId createGetBankMerchantByMerchantId() { return new GetBankMerchantByMerchantId(); } /** * Create an instance of {@link GetCustomerMerchantByBankId } * */ public GetCustomerMerchantByBankId createGetCustomerMerchantByBankId() { return new GetCustomerMerchantByBankId(); } /** * Create an instance of {@link DeleteBankMerchantResponse } * */ public DeleteBankMerchantResponse createDeleteBankMerchantResponse() { return new DeleteBankMerchantResponse(); } /** * Create an instance of {@link GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus } * */ public GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus createGetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus() { return new GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber") public JAXBElement<GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber> createGetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber(GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber value) { return new JAXBElement<GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber>(_GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber_QNAME, GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumber.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveCustomerMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveCustomerMerchantResponse") public JAXBElement<ApproveCustomerMerchantResponse> createApproveCustomerMerchantResponse(ApproveCustomerMerchantResponse value) { return new JAXBElement<ApproveCustomerMerchantResponse>(_ApproveCustomerMerchantResponse_QNAME, ApproveCustomerMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus") public JAXBElement<GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus> createGetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus(GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus value) { return new JAXBElement<GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus>(_GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus_QNAME, GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatus.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveMerchantResponse") public JAXBElement<ApproveMerchantResponse> createApproveMerchantResponse(ApproveMerchantResponse value) { return new JAXBElement<ApproveMerchantResponse>(_ApproveMerchantResponse_QNAME, ApproveMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteCustomerMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteCustomerMerchant") public JAXBElement<DeleteCustomerMerchant> createDeleteCustomerMerchant(DeleteCustomerMerchant value) { return new JAXBElement<DeleteCustomerMerchant>(_DeleteCustomerMerchant_QNAME, DeleteCustomerMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveBankMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveBankMerchant") public JAXBElement<ApproveBankMerchant> createApproveBankMerchant(ApproveBankMerchant value) { return new JAXBElement<ApproveBankMerchant>(_ApproveBankMerchant_QNAME, ApproveBankMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindCustomerMerchantById }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findCustomerMerchantById") public JAXBElement<FindCustomerMerchantById> createFindCustomerMerchantById(FindCustomerMerchantById value) { return new JAXBElement<FindCustomerMerchantById>(_FindCustomerMerchantById_QNAME, FindCustomerMerchantById.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankIdAndMerchantIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankIdAndMerchantIdResponse") public JAXBElement<GetBankMerchantByBankIdAndMerchantIdResponse> createGetBankMerchantByBankIdAndMerchantIdResponse(GetBankMerchantByBankIdAndMerchantIdResponse value) { return new JAXBElement<GetBankMerchantByBankIdAndMerchantIdResponse>(_GetBankMerchantByBankIdAndMerchantIdResponse_QNAME, GetBankMerchantByBankIdAndMerchantIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteMerchant") public JAXBElement<DeleteMerchant> createDeleteMerchant(DeleteMerchant value) { return new JAXBElement<DeleteMerchant>(_DeleteMerchant_QNAME, DeleteMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindMerchantById }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findMerchantById") public JAXBElement<FindMerchantById> createFindMerchantById(FindMerchantById value) { return new JAXBElement<FindMerchantById>(_FindMerchantById_QNAME, FindMerchantById.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerIdResponse") public JAXBElement<GetCustomerMerchantByCustomerIdResponse> createGetCustomerMerchantByCustomerIdResponse(GetCustomerMerchantByCustomerIdResponse value) { return new JAXBElement<GetCustomerMerchantByCustomerIdResponse>(_GetCustomerMerchantByCustomerIdResponse_QNAME, GetCustomerMerchantByCustomerIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByCustomerIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByCustomerIdResponse") public JAXBElement<GetMerchantByCustomerIdResponse> createGetMerchantByCustomerIdResponse(GetMerchantByCustomerIdResponse value) { return new JAXBElement<GetMerchantByCustomerIdResponse>(_GetMerchantByCustomerIdResponse_QNAME, GetMerchantByCustomerIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankId") public JAXBElement<GetCustomerMerchantByBankId> createGetCustomerMerchantByBankId(GetCustomerMerchantByBankId value) { return new JAXBElement<GetCustomerMerchantByBankId>(_GetCustomerMerchantByBankId_QNAME, GetCustomerMerchantByBankId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByStatus") public JAXBElement<GetCustomerMerchantByStatus> createGetCustomerMerchantByStatus(GetCustomerMerchantByStatus value) { return new JAXBElement<GetCustomerMerchantByStatus>(_GetCustomerMerchantByStatus_QNAME, GetCustomerMerchantByStatus.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerAccountNumberResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerAccountNumberResponse") public JAXBElement<GetCustomerMerchantByCustomerAccountNumberResponse> createGetCustomerMerchantByCustomerAccountNumberResponse(GetCustomerMerchantByCustomerAccountNumberResponse value) { return new JAXBElement<GetCustomerMerchantByCustomerAccountNumberResponse>(_GetCustomerMerchantByCustomerAccountNumberResponse_QNAME, GetCustomerMerchantByCustomerAccountNumberResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByStatus") public JAXBElement<GetMerchantByStatus> createGetMerchantByStatus(GetMerchantByStatus value) { return new JAXBElement<GetMerchantByStatus>(_GetMerchantByStatus_QNAME, GetMerchantByStatus.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse") public JAXBElement<GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse> createGetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse(GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse value) { return new JAXBElement<GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse>(_GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse_QNAME, GetCustomerMerchantByBankMerchantIdAndCustomerIdAndCustomerAccountNumberResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetAllMerchants }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getAllMerchants") public JAXBElement<GetAllMerchants> createGetAllMerchants(GetAllMerchants value) { return new JAXBElement<GetAllMerchants>(_GetAllMerchants_QNAME, GetAllMerchants.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveMerchant") public JAXBElement<ApproveMerchant> createApproveMerchant(ApproveMerchant value) { return new JAXBElement<ApproveMerchant>(_ApproveMerchant_QNAME, ApproveMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankIdAndMerchantId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankIdAndMerchantId") public JAXBElement<GetBankMerchantByBankIdAndMerchantId> createGetBankMerchantByBankIdAndMerchantId(GetBankMerchantByBankIdAndMerchantId value) { return new JAXBElement<GetBankMerchantByBankIdAndMerchantId>(_GetBankMerchantByBankIdAndMerchantId_QNAME, GetBankMerchantByBankIdAndMerchantId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveCustomerMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveCustomerMerchant") public JAXBElement<ApproveCustomerMerchant> createApproveCustomerMerchant(ApproveCustomerMerchant value) { return new JAXBElement<ApproveCustomerMerchant>(_ApproveCustomerMerchant_QNAME, ApproveCustomerMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerId") public JAXBElement<GetCustomerMerchantByCustomerId> createGetCustomerMerchantByCustomerId(GetCustomerMerchantByCustomerId value) { return new JAXBElement<GetCustomerMerchantByCustomerId>(_GetCustomerMerchantByCustomerId_QNAME, GetCustomerMerchantByCustomerId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByCustomerId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByCustomerId") public JAXBElement<GetMerchantByCustomerId> createGetMerchantByCustomerId(GetMerchantByCustomerId value) { return new JAXBElement<GetMerchantByCustomerId>(_GetMerchantByCustomerId_QNAME, GetMerchantByCustomerId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditBankMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editBankMerchantResponse") public JAXBElement<EditBankMerchantResponse> createEditBankMerchantResponse(EditBankMerchantResponse value) { return new JAXBElement<EditBankMerchantResponse>(_EditBankMerchantResponse_QNAME, EditBankMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link Exception }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "Exception") public JAXBElement<Exception> createException(Exception value) { return new JAXBElement<Exception>(_Exception_QNAME, Exception.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveBankMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveBankMerchantResponse") public JAXBElement<DisapproveBankMerchantResponse> createDisapproveBankMerchantResponse(DisapproveBankMerchantResponse value) { return new JAXBElement<DisapproveBankMerchantResponse>(_DisapproveBankMerchantResponse_QNAME, DisapproveBankMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerAccountNumber }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerAccountNumber") public JAXBElement<GetCustomerMerchantByCustomerAccountNumber> createGetCustomerMerchantByCustomerAccountNumber(GetCustomerMerchantByCustomerAccountNumber value) { return new JAXBElement<GetCustomerMerchantByCustomerAccountNumber>(_GetCustomerMerchantByCustomerAccountNumber_QNAME, GetCustomerMerchantByCustomerAccountNumber.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateBankMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createBankMerchantResponse") public JAXBElement<CreateBankMerchantResponse> createCreateBankMerchantResponse(CreateBankMerchantResponse value) { return new JAXBElement<CreateBankMerchantResponse>(_CreateBankMerchantResponse_QNAME, CreateBankMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByMerchantIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByMerchantIdResponse") public JAXBElement<GetBankMerchantByMerchantIdResponse> createGetBankMerchantByMerchantIdResponse(GetBankMerchantByMerchantIdResponse value) { return new JAXBElement<GetBankMerchantByMerchantIdResponse>(_GetBankMerchantByMerchantIdResponse_QNAME, GetBankMerchantByMerchantIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByStatusAndBankIdAndMerchantIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByStatusAndBankIdAndMerchantIdResponse") public JAXBElement<GetBankMerchantByStatusAndBankIdAndMerchantIdResponse> createGetBankMerchantByStatusAndBankIdAndMerchantIdResponse(GetBankMerchantByStatusAndBankIdAndMerchantIdResponse value) { return new JAXBElement<GetBankMerchantByStatusAndBankIdAndMerchantIdResponse>(_GetBankMerchantByStatusAndBankIdAndMerchantIdResponse_QNAME, GetBankMerchantByStatusAndBankIdAndMerchantIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteBankMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteBankMerchantResponse") public JAXBElement<DeleteBankMerchantResponse> createDeleteBankMerchantResponse(DeleteBankMerchantResponse value) { return new JAXBElement<DeleteBankMerchantResponse>(_DeleteBankMerchantResponse_QNAME, DeleteBankMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindBankMerchantByIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findBankMerchantByIdResponse") public JAXBElement<FindBankMerchantByIdResponse> createFindBankMerchantByIdResponse(FindBankMerchantByIdResponse value) { return new JAXBElement<FindBankMerchantByIdResponse>(_FindBankMerchantByIdResponse_QNAME, FindBankMerchantByIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditCustomerMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editCustomerMerchantResponse") public JAXBElement<EditCustomerMerchantResponse> createEditCustomerMerchantResponse(EditCustomerMerchantResponse value) { return new JAXBElement<EditCustomerMerchantResponse>(_EditCustomerMerchantResponse_QNAME, EditCustomerMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankIdAndShortNameAndStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankIdAndShortNameAndStatusResponse") public JAXBElement<GetBankMerchantByBankIdAndShortNameAndStatusResponse> createGetBankMerchantByBankIdAndShortNameAndStatusResponse(GetBankMerchantByBankIdAndShortNameAndStatusResponse value) { return new JAXBElement<GetBankMerchantByBankIdAndShortNameAndStatusResponse>(_GetBankMerchantByBankIdAndShortNameAndStatusResponse_QNAME, GetBankMerchantByBankIdAndShortNameAndStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByShortNameResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByShortNameResponse") public JAXBElement<GetMerchantByShortNameResponse> createGetMerchantByShortNameResponse(GetMerchantByShortNameResponse value) { return new JAXBElement<GetMerchantByShortNameResponse>(_GetMerchantByShortNameResponse_QNAME, GetMerchantByShortNameResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankMerchantIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankMerchantIdResponse") public JAXBElement<GetCustomerMerchantByBankMerchantIdResponse> createGetCustomerMerchantByBankMerchantIdResponse(GetCustomerMerchantByBankMerchantIdResponse value) { return new JAXBElement<GetCustomerMerchantByBankMerchantIdResponse>(_GetCustomerMerchantByBankMerchantIdResponse_QNAME, GetCustomerMerchantByBankMerchantIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editMerchantResponse") public JAXBElement<EditMerchantResponse> createEditMerchantResponse(EditMerchantResponse value) { return new JAXBElement<EditMerchantResponse>(_EditMerchantResponse_QNAME, EditMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditBankMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editBankMerchant") public JAXBElement<EditBankMerchant> createEditBankMerchant(EditBankMerchant value) { return new JAXBElement<EditBankMerchant>(_EditBankMerchant_QNAME, EditBankMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveMerchantResponse") public JAXBElement<DisapproveMerchantResponse> createDisapproveMerchantResponse(DisapproveMerchantResponse value) { return new JAXBElement<DisapproveMerchantResponse>(_DisapproveMerchantResponse_QNAME, DisapproveMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankIdResponse") public JAXBElement<GetBankMerchantByBankIdResponse> createGetBankMerchantByBankIdResponse(GetBankMerchantByBankIdResponse value) { return new JAXBElement<GetBankMerchantByBankIdResponse>(_GetBankMerchantByBankIdResponse_QNAME, GetBankMerchantByBankIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByStatusResponse") public JAXBElement<GetBankMerchantByStatusResponse> createGetBankMerchantByStatusResponse(GetBankMerchantByStatusResponse value) { return new JAXBElement<GetBankMerchantByStatusResponse>(_GetBankMerchantByStatusResponse_QNAME, GetBankMerchantByStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createMerchantResponse") public JAXBElement<CreateMerchantResponse> createCreateMerchantResponse(CreateMerchantResponse value) { return new JAXBElement<CreateMerchantResponse>(_CreateMerchantResponse_QNAME, CreateMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveCustomerMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveCustomerMerchantResponse") public JAXBElement<DisapproveCustomerMerchantResponse> createDisapproveCustomerMerchantResponse(DisapproveCustomerMerchantResponse value) { return new JAXBElement<DisapproveCustomerMerchantResponse>(_DisapproveCustomerMerchantResponse_QNAME, DisapproveCustomerMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateBankMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createBankMerchant") public JAXBElement<CreateBankMerchant> createCreateBankMerchant(CreateBankMerchant value) { return new JAXBElement<CreateBankMerchant>(_CreateBankMerchant_QNAME, CreateBankMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByNameResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByNameResponse") public JAXBElement<GetMerchantByNameResponse> createGetMerchantByNameResponse(GetMerchantByNameResponse value) { return new JAXBElement<GetMerchantByNameResponse>(_GetMerchantByNameResponse_QNAME, GetMerchantByNameResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveBankMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveBankMerchant") public JAXBElement<DisapproveBankMerchant> createDisapproveBankMerchant(DisapproveBankMerchant value) { return new JAXBElement<DisapproveBankMerchant>(_DisapproveBankMerchant_QNAME, DisapproveBankMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateCustomerMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createCustomerMerchantResponse") public JAXBElement<CreateCustomerMerchantResponse> createCreateCustomerMerchantResponse(CreateCustomerMerchantResponse value) { return new JAXBElement<CreateCustomerMerchantResponse>(_CreateCustomerMerchantResponse_QNAME, CreateCustomerMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus") public JAXBElement<GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus> createGetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus(GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus value) { return new JAXBElement<GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus>(_GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus_QNAME, GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatus.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByMerchantId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByMerchantId") public JAXBElement<GetBankMerchantByMerchantId> createGetBankMerchantByMerchantId(GetBankMerchantByMerchantId value) { return new JAXBElement<GetBankMerchantByMerchantId>(_GetBankMerchantByMerchantId_QNAME, GetBankMerchantByMerchantId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindMerchantByIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findMerchantByIdResponse") public JAXBElement<FindMerchantByIdResponse> createFindMerchantByIdResponse(FindMerchantByIdResponse value) { return new JAXBElement<FindMerchantByIdResponse>(_FindMerchantByIdResponse_QNAME, FindMerchantByIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteMerchantResponse") public JAXBElement<DeleteMerchantResponse> createDeleteMerchantResponse(DeleteMerchantResponse value) { return new JAXBElement<DeleteMerchantResponse>(_DeleteMerchantResponse_QNAME, DeleteMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse") public JAXBElement<GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse> createGetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse(GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse value) { return new JAXBElement<GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse>(_GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse_QNAME, GetCustomerMerchantByCustomerIdAndMerchantShortNameAndStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditCustomerMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editCustomerMerchant") public JAXBElement<EditCustomerMerchant> createEditCustomerMerchant(EditCustomerMerchant value) { return new JAXBElement<EditCustomerMerchant>(_EditCustomerMerchant_QNAME, EditCustomerMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankIdAndShortNameAndStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankIdAndShortNameAndStatus") public JAXBElement<GetBankMerchantByBankIdAndShortNameAndStatus> createGetBankMerchantByBankIdAndShortNameAndStatus(GetBankMerchantByBankIdAndShortNameAndStatus value) { return new JAXBElement<GetBankMerchantByBankIdAndShortNameAndStatus>(_GetBankMerchantByBankIdAndShortNameAndStatus_QNAME, GetBankMerchantByBankIdAndShortNameAndStatus.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindCustomerMerchantByIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findCustomerMerchantByIdResponse") public JAXBElement<FindCustomerMerchantByIdResponse> createFindCustomerMerchantByIdResponse(FindCustomerMerchantByIdResponse value) { return new JAXBElement<FindCustomerMerchantByIdResponse>(_FindCustomerMerchantByIdResponse_QNAME, FindCustomerMerchantByIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EditMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "editMerchant") public JAXBElement<EditMerchant> createEditMerchant(EditMerchant value) { return new JAXBElement<EditMerchant>(_EditMerchant_QNAME, EditMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ApproveBankMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "approveBankMerchantResponse") public JAXBElement<ApproveBankMerchantResponse> createApproveBankMerchantResponse(ApproveBankMerchantResponse value) { return new JAXBElement<ApproveBankMerchantResponse>(_ApproveBankMerchantResponse_QNAME, ApproveBankMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteCustomerMerchantResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteCustomerMerchantResponse") public JAXBElement<DeleteCustomerMerchantResponse> createDeleteCustomerMerchantResponse(DeleteCustomerMerchantResponse value) { return new JAXBElement<DeleteCustomerMerchantResponse>(_DeleteCustomerMerchantResponse_QNAME, DeleteCustomerMerchantResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankMerchantId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankMerchantId") public JAXBElement<GetCustomerMerchantByBankMerchantId> createGetCustomerMerchantByBankMerchantId(GetCustomerMerchantByBankMerchantId value) { return new JAXBElement<GetCustomerMerchantByBankMerchantId>(_GetCustomerMerchantByBankMerchantId_QNAME, GetCustomerMerchantByBankMerchantId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByShortName }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByShortName") public JAXBElement<GetMerchantByShortName> createGetMerchantByShortName(GetMerchantByShortName value) { return new JAXBElement<GetMerchantByShortName>(_GetMerchantByShortName_QNAME, GetMerchantByShortName.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByStatusAndBankIdAndMerchantId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByStatusAndBankIdAndMerchantId") public JAXBElement<GetBankMerchantByStatusAndBankIdAndMerchantId> createGetBankMerchantByStatusAndBankIdAndMerchantId(GetBankMerchantByStatusAndBankIdAndMerchantId value) { return new JAXBElement<GetBankMerchantByStatusAndBankIdAndMerchantId>(_GetBankMerchantByStatusAndBankIdAndMerchantId_QNAME, GetBankMerchantByStatusAndBankIdAndMerchantId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link FindBankMerchantById }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "findBankMerchantById") public JAXBElement<FindBankMerchantById> createFindBankMerchantById(FindBankMerchantById value) { return new JAXBElement<FindBankMerchantById>(_FindBankMerchantById_QNAME, FindBankMerchantById.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DeleteBankMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "deleteBankMerchant") public JAXBElement<DeleteBankMerchant> createDeleteBankMerchant(DeleteBankMerchant value) { return new JAXBElement<DeleteBankMerchant>(_DeleteBankMerchant_QNAME, DeleteBankMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByBankId }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByBankId") public JAXBElement<GetBankMerchantByBankId> createGetBankMerchantByBankId(GetBankMerchantByBankId value) { return new JAXBElement<GetBankMerchantByBankId>(_GetBankMerchantByBankId_QNAME, GetBankMerchantByBankId.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByStatusResponse") public JAXBElement<GetMerchantByStatusResponse> createGetMerchantByStatusResponse(GetMerchantByStatusResponse value) { return new JAXBElement<GetMerchantByStatusResponse>(_GetMerchantByStatusResponse_QNAME, GetMerchantByStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByBankIdResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByBankIdResponse") public JAXBElement<GetCustomerMerchantByBankIdResponse> createGetCustomerMerchantByBankIdResponse(GetCustomerMerchantByBankIdResponse value) { return new JAXBElement<GetCustomerMerchantByBankIdResponse>(_GetCustomerMerchantByBankIdResponse_QNAME, GetCustomerMerchantByBankIdResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createMerchant") public JAXBElement<CreateMerchant> createCreateMerchant(CreateMerchant value) { return new JAXBElement<CreateMerchant>(_CreateMerchant_QNAME, CreateMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveCustomerMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveCustomerMerchant") public JAXBElement<DisapproveCustomerMerchant> createDisapproveCustomerMerchant(DisapproveCustomerMerchant value) { return new JAXBElement<DisapproveCustomerMerchant>(_DisapproveCustomerMerchant_QNAME, DisapproveCustomerMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByStatusResponse") public JAXBElement<GetCustomerMerchantByStatusResponse> createGetCustomerMerchantByStatusResponse(GetCustomerMerchantByStatusResponse value) { return new JAXBElement<GetCustomerMerchantByStatusResponse>(_GetCustomerMerchantByStatusResponse_QNAME, GetCustomerMerchantByStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DisapproveMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "disapproveMerchant") public JAXBElement<DisapproveMerchant> createDisapproveMerchant(DisapproveMerchant value) { return new JAXBElement<DisapproveMerchant>(_DisapproveMerchant_QNAME, DisapproveMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetMerchantByName }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getMerchantByName") public JAXBElement<GetMerchantByName> createGetMerchantByName(GetMerchantByName value) { return new JAXBElement<GetMerchantByName>(_GetMerchantByName_QNAME, GetMerchantByName.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse") public JAXBElement<GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse> createGetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse(GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse value) { return new JAXBElement<GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse>(_GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse_QNAME, GetCustomerMerchantByCustomerIdAndBankMerchantIdAndStatusResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetAllMerchantsResponse }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getAllMerchantsResponse") public JAXBElement<GetAllMerchantsResponse> createGetAllMerchantsResponse(GetAllMerchantsResponse value) { return new JAXBElement<GetAllMerchantsResponse>(_GetAllMerchantsResponse_QNAME, GetAllMerchantsResponse.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link CreateCustomerMerchant }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "createCustomerMerchant") public JAXBElement<CreateCustomerMerchant> createCreateCustomerMerchant(CreateCustomerMerchant value) { return new JAXBElement<CreateCustomerMerchant>(_CreateCustomerMerchant_QNAME, CreateCustomerMerchant.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link GetBankMerchantByStatus }{@code >}} * */ @XmlElementDecl(namespace = "http://service.merchantservices.ewallet.esolutions.co.zw/", name = "getBankMerchantByStatus") public JAXBElement<GetBankMerchantByStatus> createGetBankMerchantByStatus(GetBankMerchantByStatus value) { return new JAXBElement<GetBankMerchantByStatus>(_GetBankMerchantByStatus_QNAME, GetBankMerchantByStatus.class, null, value); } }
true
07267c6c8f3d425ca0dee853c3766d78eb3ee7ad
Java
smaharjan99/coffee
/CollectionDEMO/src/com/cubic/training/collectionexercise/PriorityQueueDemo.java
UTF-8
696
3.234375
3
[]
no_license
package com.cubic.training.collectionexercise; import java.util.PriorityQueue; public class PriorityQueueDemo { public static void main(String[] args) { PriorityQueue<String> pq = new PriorityQueue<String>(); pq.add("abid"); pq.add("azeem"); pq.add("lokesh"); pq.add("brad"); //pq.add("abid"); System.out.println("Head element is - "+ pq.element()); System.out.println("Head element is - "+ pq.peek()); System.out.println("Iterating"); for(String s:pq){ System.out.println(s); } pq.remove(); pq.poll(); System.out.println("After removing two elements"); System.out.println("Iterating"); for(String s:pq){ System.out.println(s); } } }
true
e80ba6d1934ecf08d0cff1be88ce041a30c88f24
Java
t051506/alloy-common
/alloy-common-sentinel/src/main/java/com/alloy/cloud/common/sentinel/handle/CloudUrlBlockHandler.java
UTF-8
1,260
2.015625
2
[]
no_license
package com.alloy.cloud.common.sentinel.handle; import cn.hutool.http.ContentType; import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler; import com.alibaba.csp.sentinel.slots.block.BlockException; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alloy.cloud.common.core.base.R; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * sentinel统一降级限流策略 * <p> * {@link com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.DefaultBlockExceptionHandler} */ @Slf4j public class CloudUrlBlockHandler implements BlockExceptionHandler { @Override public void handle(HttpServletRequest request, HttpServletResponse response, BlockException e) throws Exception { log.error("sentinel 降级 资源名称{}", e.getRule().getResource(), e); response.setContentType(ContentType.JSON.toString()); response.setStatus(HttpStatus.TOO_MANY_REQUESTS.value()); response.getWriter().print(JSON.toJSONString(R.failed("sentinel denied."+ e.getMessage()), SerializerFeature.WriteNullStringAsEmpty)); } }
true
5bf0c04de1bf96cc98910350fa571bb73869a0a6
Java
AHeartMan/simple-java
/simple-java-nio/src/main/java/com/alsace/simplejavanio/blockingnio/Main.java
UTF-8
308
2
2
[]
no_license
package com.alsace.simplejavanio.blockingnio; /** * <p> * * </p> * * @author sangmingming * @since 2019/10/25 0025 */ public class Main { public static void main(String[] args) throws Exception { TestBlockingNio blockingNio = new TestBlockingNio(); blockingNio.client(); } }
true
9de9eed952eafa942e2032f7b529f056fff0e16f
Java
honglou2001/ejb1
/ejbpro1/src/com/watch/ejb/LocElectfenceBean.java
UTF-8
17,392
2.21875
2
[]
no_license
package com.watch.ejb; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.logging.Logger; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; /** * <p> * Title: ejb title * </p> * <p> * Description: t_loc_electfence EJB Interface Bean 处理类 * </p> * * @author yangqinxu 电话:137****5317 * @version 1.0 时间 2015-6-25 9:51:03 */ @Stateless(mappedName = "LocElectfenceService") public class LocElectfenceBean implements LocElectfenceService { private final static Logger logger = Logger.getLogger(LocElectfenceBean.class.getName()); @PersistenceContext(unitName = "ejbpro1") private EntityManager manager; @Override public void Add(LocElectfence locElectfenceInfo) { locElectfenceInfo.setFlocfenid(UUID.randomUUID().toString()); manager.persist(locElectfenceInfo); } @Override public void Update(LocElectfence locElectfenceInfo) { manager.merge(locElectfenceInfo); } @Override public void Delete(String id) { LocElectfence locElectfenceInfo = manager.find(LocElectfence.class, id); manager.remove(locElectfenceInfo); } @Override public LocElectfence find(String id) { LocElectfence locElectfenceInfo = manager.find(LocElectfence.class, id); return locElectfenceInfo; } private String GetWhere(HashMap<String, String> map) { String where = ""; // queryMap.put("serialNumber", serialNumber); // queryMap.put("areaNumber", areaNumber); // queryMap.put("areaName", areaName); if (map != null && map.size() > 0) { if (map.containsKey("serialNumber") && map.get("serialNumber") != null && !map.get("serialNumber").toString().equals("")) { where += " and a.FSerialnumber = '" + map.get("serialNumber") + "' "; } if (map.containsKey("areaNumber") && map.get("areaNumber") != null && !map.get("areaNumber").toString().equals("")) { where += " and b.id = " + map.get("areaNumber") + " "; } if (map.containsKey("areaName") && map.get("areaName") != null && !map.get("areaName").toString().equals("")) { where += " and b.name like '%" + map.get("areaName") + "%' "; } // a.FUpdateTime>='2015-02-12 22:12:23' and FUpdateTime<='2015-08-12 22:12:23' if (map.containsKey("startTime") && map.get("startTime") != null && !map.get("startTime").toString().equals("")) { where += " and a.FUpdateTime >= '" + map.get("startTime") + "' "; } if (map.containsKey("endTime") && map.get("endTime") != null && !map.get("endTime").toString().equals("")) { where += " and a.FUpdateTime <= '" + map.get("endTime") + "' "; } if (map.containsKey("fdatastatus") && map.get("fdatastatus") != null && !map.get("fdatastatus").toString().equals("")) { where += " and a.fdatastatus = " + map.get("fdatastatus") + " "; } if (map.containsKey("frecordcount") && map.get("frecordcount") != null && map.get("frecordcount").toString().equals("frecordcount=1")) { where += " and a.frecordcount = 1 "; } } return where; } @Override public int GetCount(HashMap<String, String> map) { String where = GetWhere(map); StringBuffer sql = new StringBuffer(); sql.append(" SELECT count(*) "); sql.append(" FROM T_LOC_ELECTFENCE a left join electfence b on a.FEltFenceID = b.id "); sql.append(" WHERE 1 = 1 "); sql.append(where); Query query = manager.createNativeQuery(sql.toString()); int total = (new Integer(query.getSingleResult().toString())); return total; // String hql = "select count(*) from LocElectfence"; // Query query = manager.createQuery(hql); // int total = (new Integer(query.getSingleResult().toString())); // return total; } private List<Electfence> GetSerialAreaList(HashMap<String, String> map) { //String where = "and a.serialnumber='" + serialnumber + "'"; String where = ""; if (map.containsKey("serialNumber") && map.get("serialNumber") != null && !map.get("serialNumber").toString().equals("")) { where += " and a.serialnumber = '" + map.get("serialNumber") + "' "; } if (map.containsKey("areaNumber") && map.get("areaNumber") != null && !map.get("areaNumber").toString().equals("")) { where += " and a.id = " + map.get("areaNumber") + " "; } StringBuffer sql = new StringBuffer(); sql.append(" SELECT a.id,a.serialnumber,a.areanum,a.name,a.locationbd,a.locationgd,a.model,a.scope,a.createtime,a.updatetime,a.status "); sql.append(" FROM ELECTFENCE a "); sql.append(" WHERE 1 = 1 "); sql.append(where); Query query = manager.createNativeQuery(sql.toString()); List rows = query.getResultList(); List<Electfence> LocElectfences = new ArrayList<Electfence>(); for (Object row : rows) { Object[] cells = (Object[]) row; Electfence item = new Electfence(); item.setAreanum((Integer) cells[0]); LocElectfences.add(item); } return LocElectfences; } private List<LocElectfence> getTop1ByElectfence(HashMap<String, String> map) { String where = ""; if (map.containsKey("serialNumber") && map.get("serialNumber") != null && !map.get("serialNumber").toString().equals("")) { where += " and a.FSerialnumber = '" + map.get("serialNumber") + "' "; } if (map.containsKey("areaNumber") && map.get("areaNumber") != null && !map.get("areaNumber").toString().equals("")) { where += " and b.id = " + map.get("areaNumber") + " "; } StringBuffer sql = new StringBuffer(); sql.append(" SELECT a.FLocFenID,a.FIncreaseID,a.FEltFenceID,a.FSerialnumber,a.FDataStatus,a.FFieldStatus,a.FEltLongitude,a.FEltLatitude,a.FEltScope,a.FEltAddress,a.FLongitude,a.FLatitude,a.FAddress,a.FDistance,a.FAddTime,a.FUpdateTime,a.FRemark "); sql.append(" ,a.FReadCount,b.id,b.name "); // sql.append(" ,IFNULL(b.areanum,0),IFNULL(b.name,'') "); sql.append(" FROM T_LOC_ELECTFENCE a inner join electfence b on a.FEltFenceID = b.id "); sql.append(" WHERE 1 = 1 "); sql.append(where); sql.append(" order by a.FIncreaseID desc "); sql.append("limit 0,1"); Query query = manager.createNativeQuery(sql.toString()); List rows = query.getResultList(); List<LocElectfence> LocElectfences = new ArrayList<LocElectfence>(); for (Object row : rows) { Object[] cells = (Object[]) row; LocElectfence item = new LocElectfence(); item.setFlocfenid((String) cells[0]); item.setFincreaseid((Integer) cells[1]); item.setFeltfenceid((Integer) cells[2]); item.setFserialnumber((String) cells[3]); item.setFdatastatus((Integer) cells[4]); item.setFfieldstatus((Integer) cells[5]); item.setFeltlongitude((String) cells[6]); item.setFeltlatitude((String) cells[7]); item.setFeltscope((Double) cells[8]); item.setFeltaddress((String) cells[9]); item.setFlongitude((String) cells[10]); item.setFlatitude((String) cells[11]); item.setFaddress((String) cells[12]); item.setFdistance((Double) cells[13]); item.setFaddtime((java.sql.Timestamp) cells[14]); item.setFupdatetime((java.sql.Timestamp) cells[15]); item.setFremark((String) cells[16]); // if(cells[17]!=null && !cells[17].toString().equals("")) // { // // } item.setFreadCount((Integer) cells[17]); item.setFareanumber((Integer) cells[18]); item.setFareaname((String) cells[19]); LocElectfences.add(item); //更新读写次数 String updateSql = "update T_LOC_ELECTFENCE set FReadCount=FReadCount+1 WHERE FLocFenID= :FLocFenID "; Query updateQuery = manager.createNativeQuery(updateSql); updateQuery.setParameter("FLocFenID", item.getFlocfenid()); updateQuery.executeUpdate(); } return LocElectfences; } @Override public List<LocElectfence> ListLocElectfenceTop1(int offset, int length, HashMap<String, String> map) { List<LocElectfence> locEltReturn = new ArrayList<LocElectfence>(); if(map == null || map.size()==0) { return locEltReturn; } if(map.get("serialNumber") ==null || map.get("serialNumber").toString().equals("")) { return locEltReturn; } List<Electfence> elct = this.GetSerialAreaList(map); if (elct != null && elct.size() > 0) { for (int i = 0; i < elct.size(); i++) { Electfence item = elct.get(i); HashMap<String, String> map1 = new HashMap<String, String>(); map1.put("serialNumber", map.get("serialNumber")); map1.put("areaNumber", item.getAreanum().toString()); List<LocElectfence> locelts = this.getTop1ByElectfence(map1); if (locelts != null && locelts.size() > 0) { locEltReturn.add(locelts.get(0)); } } } return locEltReturn; } @Override public List<LocElectfence> ListLocElectfence(int offset, int length, HashMap<String, String> map) { String where = GetWhere(map); String ordersc = " desc "; if(map!=null && map.size()>0){ if (map.containsKey("frecordcount") && map.get("frecordcount") != null && map.get("frecordcount").toString().equals("frecordcount=1")) { ordersc = " asc "; } } StringBuffer sql = new StringBuffer(); sql.append(" SELECT a.FLocFenID,a.FIncreaseID,a.FEltFenceID,a.FSerialnumber,a.FDataStatus,a.FFieldStatus,a.FEltLongitude,a.FEltLatitude,a.FEltScope,a.FEltAddress,a.FLongitude,a.FLatitude,a.FAddress,a.FDistance,a.FAddTime,a.FUpdateTime,a.FRemark "); sql.append(" ,b.id,b.name "); sql.append(" FROM T_LOC_ELECTFENCE a left join electfence b on a.FEltFenceID = b.id "); sql.append(" WHERE 1 = 1 "); sql.append(where); sql.append(" order by a.FIncreaseID "+ordersc); sql.append("limit "+offset+"," + length + ""); Query query = manager.createNativeQuery(sql.toString()); List rows = query.getResultList(); List<LocElectfence> LocElectfences = new ArrayList<LocElectfence>(); for (Object row : rows) { Object[] cells = (Object[]) row; LocElectfence item = new LocElectfence(); item.setFlocfenid((String) cells[0]); item.setFincreaseid((Integer) cells[1]); item.setFeltfenceid((Integer) cells[2]); item.setFserialnumber((String) cells[3]); item.setFdatastatus((Integer) cells[4]); item.setFfieldstatus((Integer) cells[5]); item.setFeltlongitude((String) cells[6]); item.setFeltlatitude((String) cells[7]); item.setFeltscope((Double) cells[8]); item.setFeltaddress((String) cells[9]); item.setFlongitude((String) cells[10]); item.setFlatitude((String) cells[11]); item.setFaddress((String) cells[12]); item.setFdistance((Double) cells[13]); item.setFaddtime((java.sql.Timestamp) cells[14]); item.setFupdatetime((java.sql.Timestamp) cells[15]); item.setFremark((String) cells[16]); item.setFareanumber((Integer) cells[17]); item.setFareaname((String) cells[18]); LocElectfences.add(item); } return LocElectfences; } private List<UserWatch> ListUser(int offset, int length,HashMap<String, String> map) { String where = " "; if(map!=null && map.size() > 0) { // if(map.containsKey("funiqueid") && map.get("funiqueid")!=null && !map.get("funiqueid").toString().equals("")) // { // where += " and a.funiqueid = '"+map.get("funiqueid")+"' "; // } // if (map.containsKey("user.funiqueid") && map.get("user.funiqueid") != null && !map.get("user.funiqueid").toString().equals("")) { where += " and a.funiqueid = '" + map.get("user.funiqueid") + "' "; } } StringBuffer sql = new StringBuffer(); sql.append(" SELECT a.funiqueid,a.id,c.serialnumber,a.username,a.phone,a.password,a.sex,a.status,a.createtime,a.fmobile,a.nickname,a.birthday,a.height,a.weight,a.picture,a.flogcount,a.floglasttime,a.floglaspip,a.fienabled,a.fdatastatus,a.fremark,a.femail,a.furl,a.faddress "); sql.append(" FROM USER a inner join t_user_snrelate b "); sql.append(" on a.funiqueid=b.FUserIDStr inner join serialnumber c on c.funiqueid = b.FSNIDStr "); sql.append(" WHERE b.FDataStatus=1 | b.FDataStatus "); sql.append(where); Query query = manager.createNativeQuery(sql.toString()); List rows = query.getResultList(); List<UserWatch> Users = new ArrayList<UserWatch>(); for (Object row : rows) { Object[] cells = (Object[]) row; UserWatch item = new UserWatch(); item.setFuniqueid((String)cells[0]); item.setId((Integer)cells[1]); item.setSerialnumber((String)cells[2]); item.setUsername((String)cells[3]); item.setPhone((String)cells[4]); item.setPassword((String)cells[5]); item.setSex((String)cells[6]); item.setStatus((String)cells[7]); item.setCreatetime((String)cells[8]); item.setFmobile((String)cells[9]); item.setNickname((String)cells[10]); item.setBirthday((String)cells[11]); item.setHeight((String)cells[12]); item.setWeight((String)cells[13]); item.setPicture((String)cells[14]); item.setFlogcount((Integer)cells[15]); item.setFloglasttime((java.sql.Timestamp)cells[16]); item.setFloglaspip((String)cells[17]); item.setFienabled((Integer)cells[18]); item.setFdatastatus((Integer)cells[19]); item.setFremark((String)cells[20]); item.setFemail((String)cells[21]); item.setFurl((String)cells[22]); item.setFaddress((String)cells[23]); Users.add(item); } return Users; } private List<LocElectfence> ListLatestLocaltion1(HashMap<String, String> map) { String where = ""; if (map.containsKey("user.funiqueid") && map.get("user.funiqueid") != null && !map.get("user.funiqueid").toString().equals("")) { where += " and e.funiqueid = '" + map.get("user.funiqueid") + "' "; } if (map.containsKey("serialnumber") && map.get("serialnumber") != null && !map.get("serialnumber").toString().equals("")) { where += " and c.serialnumber = '" + map.get("serialnumber") + "' "; if(where.equals("")) { where = " and 1=0 "; } } StringBuffer sql = new StringBuffer(); sql.append(" SELECT a.FLocFenID,a.FIncreaseID,a.FEltFenceID,a.FSerialnumber,a.FDataStatus,a.FFieldStatus,a.FEltLongitude,a.FEltLatitude,a.FEltScope,a.FEltAddress,a.FLongitude,a.FLatitude,a.FAddress,a.FDistance,a.FAddTime,a.FUpdateTime,a.FRemark "); sql.append(" ,b.id,b.name,c.fpicture,f.battery "); sql.append(" FROM T_LOC_ELECTFENCE a left join electfence b on a.FEltFenceID = b.id and a.FFieldStatus=1 "); sql.append(" inner join serialnumber c on c.serialnumber = a.FSerialnumber "); sql.append(" inner join t_user_snrelate d on d.FSNIDStr = c.funiqueid "); sql.append(" inner join user e on d.FUserIDStr = e.funiqueid "); sql.append(" left join locationinfo f on f.serialnumber = c.serialnumber "); sql.append(" WHERE 1 = 1 "); sql.append(where); sql.append(" order by a.FIncreaseID desc "); sql.append("limit 0,1"); Query query = manager.createNativeQuery(sql.toString()); List rows = query.getResultList(); List<LocElectfence> LocElectfences = new ArrayList<LocElectfence>(); for (Object row : rows) { Object[] cells = (Object[]) row; LocElectfence item = new LocElectfence(); item.setFlocfenid((String) cells[0]); item.setFincreaseid((Integer) cells[1]); item.setFeltfenceid((Integer) cells[2]); item.setFserialnumber((String) cells[3]); item.setFdatastatus((Integer) cells[4]); item.setFfieldstatus((Integer) cells[5]); item.setFeltlongitude((String) cells[6]); item.setFeltlatitude((String) cells[7]); item.setFeltscope((Double) cells[8]); item.setFeltaddress((String) cells[9]); item.setFlongitude((String) cells[10]); item.setFlatitude((String) cells[11]); item.setFaddress((String) cells[12]); item.setFdistance((Double) cells[13]); item.setFaddtime((java.sql.Timestamp) cells[14]); item.setFupdatetime((java.sql.Timestamp) cells[15]); item.setFremark((String) cells[16]); item.setFareanumber((Integer) cells[17]); item.setFareaname((String) cells[18]); item.setFpicture((String) cells[19]); item.setBattery((String) cells[20]); LocElectfences.add(item); } return LocElectfences; } @Override public List<LocElectfence> ListLatestLocaltion(HashMap<String, String> map) { List<UserWatch> listUser =this.ListUser(0, 100,map); List<LocElectfence> listData = new ArrayList<LocElectfence>(); if(listUser!=null && listUser.size()>0) { for(int i=0;i<listUser.size();i++){ HashMap<String, String> map1 = new HashMap<String, String>(); map1.put("user.funiqueid", listUser.get(i).getFuniqueid()); map1.put("serialnumber", listUser.get(i).getSerialnumber()); // logger.info(String.format("yang info funiqueid:%s,serialnumber:%s", listUser.get(i).getFuniqueid(),listUser.get(i).getSerialnumber())); List<LocElectfence> childloc = this.ListLatestLocaltion1(map1); listData.addAll(childloc); } } return listData; } }
true
485613810274083d277d424e00b8b99bead1ea70
Java
noatmc-archived/jigokusense-leak
/botnet/auth/jigokusense/manager/RotationManager.java
UTF-8
2,654
2.375
2
[]
no_license
//Deobfuscated with https://github.com/SimplyProgrammer/Minecraft-Deobfuscator3000 using mappings "C:\Users\autty\Downloads\Minecraft-Deobfuscator3000-master\Minecraft-Deobfuscator3000-master\1.12 stable mappings"! /* * Decompiled with CFR 0.151. * * Could not load the following classes: * net.minecraft.entity.player.EntityPlayer * net.minecraft.network.play.client.CPacketPlayer * net.minecraftforge.common.MinecraftForge */ package botnet.auth.jigokusense.manager; import botnet.auth.jigokusense.event.events.PacketEvent; import botnet.auth.jigokusense.util.Global; import java.util.function.Predicate; import me.zero.alpine.listener.EventHandler; import me.zero.alpine.listener.Listener; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.play.client.CPacketPlayer; import net.minecraftforge.common.MinecraftForge; public class RotationManager implements Global { private float yaw = 0.0f; private float pitch = 0.0f; private boolean shouldRotate = false; @EventHandler private final Listener<PacketEvent.Send> receiveListener = new Listener<PacketEvent.Send>(event -> { if (event.getPacket() instanceof CPacketPlayer) { CPacketPlayer packet = (CPacketPlayer)event.getPacket(); if (this.shouldRotate) { packet.yaw = this.yaw; packet.pitch = this.pitch; } } }, new Predicate[0]); public RotationManager() { MinecraftForge.EVENT_BUS.register((Object)this); } public void reset() { this.shouldRotate = false; if (RotationManager.mc.player == null) { return; } this.yaw = RotationManager.mc.player.rotationYaw; this.pitch = RotationManager.mc.player.rotationPitch; } public void rotate(double x, double y, double z) { if (RotationManager.mc.player == null) { return; } Double[] v = this.calculateLookAt(x, y, z, (EntityPlayer)RotationManager.mc.player); this.shouldRotate = true; this.yaw = v[0].floatValue(); this.pitch = v[1].floatValue(); } private Double[] calculateLookAt(double px, double py, double pz, EntityPlayer me) { double dirx = me.posX - px; double diry = me.posY - py; double dirz = me.posZ - pz; double len = Math.sqrt(dirx * dirx + diry * diry + dirz * dirz); double pitch = Math.asin(diry /= len); double yaw = Math.atan2(dirz /= len, dirx /= len); pitch = pitch * 180.0 / Math.PI; yaw = yaw * 180.0 / Math.PI; return new Double[]{yaw += 90.0, pitch}; } }
true
3620a22a3cc0a9fe4a74e703459b664d01fd2b2f
Java
sopiseiro/pdv
/src/pdvjonatas/buscar_cliente.java
UTF-8
8,422
2.09375
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * buscar_cliente.java * * Created on 13/08/2011, 09:32:02 */ package pdvjonatas; import utilitarios.bd; import utilitarios.mySql; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; import javax.swing.AbstractAction; import javax.swing.DefaultListModel; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.KeyStroke; import javax.swing.table.DefaultTableModel; import javax.swing.text.AttributeSet; import javax.swing.text.PlainDocument; /** * * @author AGENCIA GLOBO */ public class buscar_cliente extends javax.swing.JDialog { public String nome, cpf, codigo; /** Creates new form buscar_cliente */ public buscar_cliente(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); busca.requestFocus(); busca.setDocument( new PlainDocument(){ @Override protected void insertUpdate( DefaultDocumentEvent chng, AttributeSet attr ){ super.insertUpdate( chng, attr ); DefaultTableModel model = ((DefaultTableModel)clientes.getModel()); model.setNumRows(0); bd b = new bd(); b.connect(); mySql f = new mySql(b.conn); String sql = "Select * FROM CLIENTE WHERE nome LIKE '%"+busca.getText().toLowerCase()+"%' OR nome LIKE '%"+busca.getText().toUpperCase()+"%' OR cnpj_cnpf = '"+busca.getText() +"' OR codigo ='"+busca.getText()+"' ORDER BY nome ASC"; f.open(sql); while (f.next()){ model.addRow(new Object [] {f.fieldbyname("codigo"), f.fieldbyname("nome"),f.fieldbyname("cnpj_cnpf")} ); } } }); } public String getNome(){ return nome; } public String getCpf(){ return cpf; } public String getCodigo(){ return codigo; } /** 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() { jLabel1 = new javax.swing.JLabel(); busca = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); clientes = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jLabel1.setText("Nome ou CPF:"); clientes.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Código", "Nome", "CPF" } ) { boolean[] canEdit = new boolean [] { false, false, true }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); clientes.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { clientesMouseClicked(evt); } }); jScrollPane1.setViewportView(clientes); jButton1.setText("Selecionar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(busca)) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(busca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton1) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(14, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void clientesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clientesMouseClicked if (evt.getClickCount() == 2){ DefaultTableModel model = ((DefaultTableModel)clientes.getModel()); try{ nome = model.getValueAt(clientes.getSelectedRow(), 1).toString(); cpf = model.getValueAt(clientes.getSelectedRow(), 2).toString(); codigo = model.getValueAt(clientes.getSelectedRow(), 0).toString(); }catch (Exception e){ nome = model.getValueAt(clientes.getSelectedRow(), 1).toString(); cpf = ""; codigo = model.getValueAt(clientes.getSelectedRow(), 0).toString(); } dispose(); } }//GEN-LAST:event_clientesMouseClicked private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed DefaultTableModel model = ((DefaultTableModel)clientes.getModel()); try{ nome = model.getValueAt(clientes.getSelectedRow(), 1).toString(); cpf = model.getValueAt(clientes.getSelectedRow(), 2).toString(); codigo = model.getValueAt(clientes.getSelectedRow(), 0).toString(); dispose(); }catch (Exception e){ nome = model.getValueAt(clientes.getSelectedRow(), 1).toString(); cpf = ""; codigo = model.getValueAt(clientes.getSelectedRow(), 0).toString(); } }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { buscar_cliente dialog = new buscar_cliente(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.JTextField busca; private javax.swing.JTable clientes; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane1; // End of variables declaration//GEN-END:variables }
true
c79836c0e7c6f66817dcecb503ee11344b584175
Java
tian-qingzhao/design-pattern
/src/main/java/com/tqz/pattern/decorator/batterback/v2/BaseBattercake.java
UTF-8
298
2.46875
2
[]
no_license
package com.tqz.pattern.decorator.batterback.v2; /** * @Author: tian * @Date: 2020/4/22 21:26 * @Desc: */ public class BaseBattercake extends Battercake { @Override public String msg() { return "煎饼"; } @Override public int price() { return 5; } }
true
b5ce9e2047697d59209909e65b71c908bbd12e2a
Java
RevatureRobert/pet-tribble-lopezjronald
/src/main/java/net/revature/enterprise/pettribble/service/PetTribbleImpl.java
UTF-8
7,122
2.796875
3
[]
no_license
package net.revature.enterprise.pettribble.service; import net.revature.enterprise.pettribble.model.PetTribble; import java.sql.*; import java.util.ArrayList; import java.util.Scanner; public class PetTribbleImpl implements PetTribbleDao { public static final String COLUMN_ID = "id"; public static final String COLUMN_NAME = "name"; public static final String TABLE_NAME = "tribble"; /* Query to retrieve Pet Tribble by id */ public static final String QUERY_SEARCH_ID = "SELECT " + COLUMN_ID + ", " + COLUMN_NAME + " FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = ?"; /* Query to retrieve all pet tribble by name */ public static final String QUERY_SEARCH_NAME = "SELECT " + COLUMN_ID + ", " + COLUMN_NAME + " FROM " + TABLE_NAME + " WHERE " + COLUMN_NAME + " = ? ORDER BY " + COLUMN_NAME; public static final String QUERY_GET_ALL_PET_TRIBBLES = "SELECT " + COLUMN_ID + ", " + COLUMN_NAME + " FROM " + TABLE_NAME; /* GET ALL PET TRIBBLE */ public static final String QUERY_DELETE_BY_ID = "DELETE FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = ?"; /* QUERY TO DELETE BY ID */ public static final String QUERY_CREATE = "INSERT INTO " + TABLE_NAME + " (" + COLUMN_NAME + ") VALUES (?)"; /* CREATE A NEW PET tribble */ public final static Scanner scanner = new Scanner(System.in); public static Integer id; @Override public PetTribble getById(int id, Connection connection) { try { PetTribble petTribble = new PetTribble(); PreparedStatement preparedStatement = connection.prepareStatement(QUERY_SEARCH_ID); preparedStatement.setInt(1, id); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet != null) { while (resultSet.next()) { petTribble.setId(resultSet.getInt(1)); petTribble.setName(resultSet.getString(2)); } resultSet.close(); } preparedStatement.close(); return petTribble; } catch (SQLException e) { System.out.println("There was a problem with your transaction"); return null; } catch (Exception e) { System.out.println("ID does not exist or is no longer in the system."); return null; } } @Override public ArrayList<PetTribble> getByName(Connection connection, String name) { try { ArrayList<PetTribble> petTribbles = new ArrayList<>(); PreparedStatement preparedStatement = connection.prepareStatement(QUERY_SEARCH_NAME); preparedStatement.setString(1, name.toLowerCase().trim()); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet != null) { while (resultSet.next()) { PetTribble petTribble = new PetTribble(); petTribble.setId(resultSet.getInt(1)); petTribble.setName(resultSet.getString(2)); petTribbles.add(petTribble); } resultSet.close(); } preparedStatement.close(); return petTribbles; } catch (SQLException e) { System.out.println("Name does not exist or is no longer in the system"); } return null; } @Override public ArrayList<PetTribble> getAllPetTribbles(Connection connection) { try { ArrayList<PetTribble> petTribbles = new ArrayList<>(); PreparedStatement preparedStatement = connection.prepareStatement(QUERY_GET_ALL_PET_TRIBBLES); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet != null) { while (resultSet.next()) { PetTribble petTribble = new PetTribble(); petTribble.setId(resultSet.getInt(1)); petTribble.setName(resultSet.getString(2)); petTribbles.add(petTribble); } resultSet.close(); } preparedStatement.close(); return petTribbles; } catch (SQLException e) { return new ArrayList<>(); } } @Override public int deleteById(Connection connection, int id) { try { connection.setAutoCommit(false); PreparedStatement preparedStatement = connection.prepareStatement(QUERY_DELETE_BY_ID); int result = -1; preparedStatement.setInt(1, id); try { result = preparedStatement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } if (result != 0) { connection.commit(); System.out.println("Deletion of ID: " + id + " was successful."); preparedStatement.close(); } else { connection.rollback(); System.out.println("ID #: " + id + " does not exist or is no longer available."); } connection.setAutoCommit(true); return result; } catch (SQLException e) { System.out.println("ID #: " + id + " does not exist or is no longer available."); return -1; } } @Override public PetTribble createPetTribble(Connection connection, String name) { try { while (true) { name = name.trim(); if (name != "" || name != null) { break; } else { System.out.print("Invalid entry. Please enter a first name: "); } } PreparedStatement preparedStatement = connection.prepareStatement(QUERY_CREATE, Statement.RETURN_GENERATED_KEYS); int result = -1; preparedStatement.setString(1, name.trim().toLowerCase()); try { result = preparedStatement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } ResultSet resultSet = preparedStatement.getGeneratedKeys(); PetTribble petTribble = new PetTribble(); if (resultSet.next()) { petTribble = getById(resultSet.getInt(1), connection); } if (result != 0) { System.out.println("Entry was successful"); preparedStatement.close(); return petTribble; } else { System.out.println("ID #: " + id + " does not exist or is no longer available."); return new PetTribble(); } } catch (SQLException e) { System.out.println("Sorry, unable to create the query due to syntax."); return null; } } }
true
941e4d114daa537e6245b16458dc6a15e213a51a
Java
jczapiewski/Design-Patterns
/src/main/java/co/devfoundry/designpatterns/command/Main.java
UTF-8
881
2.59375
3
[]
no_license
package co.devfoundry.designpatterns.command; import co.devfoundry.designpatterns.command.command.MusicPlayerRemote; import co.devfoundry.designpatterns.command.command.PlayFirstTrack; import co.devfoundry.designpatterns.command.command.PlayNextTrack; import co.devfoundry.designpatterns.command.command.PlayRandomTrack; public class Main { public static void main(String[] args) { MusicPlayer player = new MusicPlayer(); MusicPlayerRemote remote = new MusicPlayerRemote(); remote.setCommand(new PlayFirstTrack(player)); remote.pressButton(); remote.setCommand(new PlayNextTrack(player)); remote.pressButton(); remote.pressButton(); remote.pressButton(); remote.pressButton(); remote.setCommand(new PlayRandomTrack(player)); remote.pressButton(); remote.pressButton(); } }
true
1ef738f32d0fbef2204d575d88ab2878c593dd97
Java
GerardoUPM/dsvp-rest
/src/main/java/edu/ctb/upm/midas/client_modules/extraction/wikipedia/texts_extraction/api_response/WikipediaTextsExtractionService.java
UTF-8
763
1.921875
2
[]
no_license
package edu.ctb.upm.midas.client_modules.extraction.wikipedia.texts_extraction.api_response; import edu.ctb.upm.midas.model.extraction.wikipedia.texts_extraction.request.Request; import edu.ctb.upm.midas.model.extraction.common.request.RequestJSON; import edu.ctb.upm.midas.model.extraction.common.response.Response; /** * Created by gerardo on 12/02/2018. * * @author Gerardo Lagunes G. ${EMAIL} * @version ${<VERSION>} * @project dgsvp-rest * @className MayoClinicTextsExtractionService * @see */ public interface WikipediaTextsExtractionService { Response getTexts(Request request); Response getResources(Request request); Response getWikipediaTextsByJSON( RequestJSON request); Response getWikipediaResourcesByJSON( RequestJSON request); }
true
6312c141cb57461dcb34dd632e9bf09054df6e66
Java
N-Ibrahimi/Java
/Tree/BinarySearchTree.java
UTF-8
2,130
3.5625
4
[]
no_license
package binarysearchtree; public class tre { public Node root; public int nelms; public tre(){ root = null; nelms = 0; } public void display(){ inorder(root); } public void inorder(Node c){ if(c != null){ inorder(c.left); System.out.println(c.data); inorder(c.right); } } public void insertelement(int val){ Node newnode = new Node(val); Node cur = root; Node parent = null; if(cur == null){ root = newnode; } while(cur != null){ parent = cur; if(newnode.data < cur.data){ cur = cur.left; } else{ cur = cur.right; } } if(parent == null){ root = newnode; } else if(newnode.data < parent.data){ parent.left = newnode; } else{ parent.right = newnode; } nelms++; } public int successor(Node x){ Node cur = root; Node parent = cur; while(cur.data != x.data){ parent = cur; if(x.data < cur.data){ cur = cur.left; } else{ cur = cur.right; } } if(cur.right != null ){ Node n = cur.right; while(n.left != null && n.data > x.data){ n = n.left; } return n.data; } return parent.data; } public int deleteNode(int val){ Node cur = root; Node parent = null; while(cur != null ){ parent = cur; if(val < cur.data && val != cur.data){ cur = cur.left; } else{ cur = cur.right; } } cur = root; Node suc = null; while(cur != null && cur.data != val){ suc = cur; } suc.left = null; suc.right = null; return val; } public int totalelements(){ return nelms; } public static void main(String[] args){ tre btr = new tre(); btr.insertelement(15); btr.insertelement(6); btr.insertelement(18); btr.insertelement(3); btr.insertelement(7); btr.insertelement(17); btr.insertelement(20); btr.insertelement(2); btr.insertelement(4); btr.insertelement(13); btr.insertelement(9); Node x = new Node(9); //System.out.println(btr.totalelements()); //btr.display(); System.out.println("Sucessor " + btr.successor(x)); System.out.println("deleted element is " + btr.deleteNode(x.data)); btr.display(); } }
true
c34da563f0958bcf773e8a532cee4ad75b2574e0
Java
37bhushan/Google-Applied-CS-With-Android-Exercises
/Ghost Single Player/ghost_starter/app/src/main/java/com/google/engedu/ghost/TrieNode.java
UTF-8
1,754
2.953125
3
[]
no_license
package com.google.engedu.ghost; import java.util.LinkedList; public class TrieNode { char content; boolean isEnd; int count; LinkedList<TrieNode> childList; // private HashMap<String, TrieNode> children; //private boolean isWord; public TrieNode(char c) { // children = new HashMap<>(); // isWord = false; childList = new LinkedList<TrieNode>(); isEnd = false; content = c; count = 0; } public TrieNode subNode(char c) { // if (childList != null) // for (TrieNode eachChild : childList) // if (eachChild.content == c) // return eachChild; return null; } public void add(String s) { // HashMap<String,TrieNode>child = this.children; // for (int i= 0 ; i<s.length();i++){ // char chr = s.charAt(i); // TrieNode t; // if (children.containsKey(chr)){ // t = children.get(String.valueOf(chr)); // }else{ // t = new TrieNode(); // children.put(String.valueOf(chr),t); // } // child = t.children; // } } public String Search(String string){ // HashMap<String,TrieNode>child = this.children; // for (int i=0 ;i<string.length();i++){ // char chr = string.charAt(i); // TrieNode t; // // } return null; } public boolean isWord(String s) { return false; } public String getAnyWordStartingWith(String s) { return null; } public String getGoodWordStartingWith(String s) { return null; } }
true
438fc88ed4762a6c6c870267e6e8e6f4f87343c0
Java
ripulca/lgtuch
/prog1/src/com/company/Shape.java
UTF-8
147
2.390625
2
[]
no_license
package com.company; public abstract class Shape { public abstract double getSurfaceSquare(); public abstract double getVolume(); }
true
e9ebb25afdc1b9107af855c6f155f27495b281cd
Java
cherryperuri1/brdfiles
/BRD-FILERESOURCES/Brd Notepad files/Brd1notepad/Routine1/EMIMAIN.txt
UTF-8
2,306
3.28125
3
[]
no_license
package Brd1; import java.util.Scanner; public class EmiMain { public static void main(String[] args) { double p; double r;// rate of interest int n;// no of installments for the tenure int t;// no of installments per year int m;// no of years|period double x ;// installment amount int rec = 1, hi; Scanner sc = new Scanner(System.in); OUT: do { System.out.println("Please enter the following details:\nLoan amount:"); p = sc.nextDouble(); System.out.println("Rate of interest in percent:"); r = sc.nextDouble(); System.out.println("Period or tenure of loan in months:"); m = sc.nextInt(); for (; m < 0;) { System.out.println("Months can't be negative right! Please enter positive number of months "); m = sc.nextInt(); } r = r / 100; System.out.println("Enter the number of payments for year:"); t = sc.nextInt(); // t=12; n = (m * t) / 12; if (n == 0) { System.out.printf("The installment for the given values is:%f\n", (p + p * r)); // System.exit(0); continue OUT; } System.out.println( "Enter one among the following options:\n1.Calculate Installment for given conditions\n2.Want to know the principal component and interest component\n3.Installment for a given break up period:"); hi = sc.nextInt(); switch (hi) { case 1: {// x = installment(p, r, n, t); // calculation emi System.out.println(x); break; } case 2: { int bc = 0; double x1 = installment(p, r, n, t); IPComponent ip = new IPComponent(p, r, t, m, x1); ip.component(bc); break; } case 3: { double x1 = installment(p, r, n, t); System.out.println("Enter the month for which break up is required"); int bc = sc.nextInt(); IPComponent ip = new IPComponent(p, r, t, m, x1); ip.component(bc); break; } } System.out.println("\nDo you want to calculate for some other loan parameter values:\n1.yes\n2.no"); rec = sc.nextInt(); // for(int ni=0;ni<30;ni++)System.out.println(); System.out.flush(); } while (rec == 1); } static double installment(double p, double r, int n, int t) { double x1; x1 = (p * (r / t)) / (1 - 1 / Math.pow((1 + r / t), n)); return x1; } }
true
5794451834a03369776dab019ffb5f7baa4e7f10
Java
AnaTeresaQR/ejerciciosPatronesExamen12016
/ExerciseCreationalPatterns/src/exercise7/ConcreteBuilderProfesorInterino.java
UTF-8
1,216
2.890625
3
[]
no_license
package exercise7; import java.util.Date; /** * * @author Ana Teresa */ public class ConcreteBuilderProfesorInterino { ProfesorInterino profInterino; public ConcreteBuilderProfesorInterino() { } public void createProf() { profInterino = new ProfesorInterino(); } public void createFechaIn_Fin(Date fechaIn, Date fechaFin) throws ExcepcionPersonalizada { if (fechaIn.after(fechaIn)) { profInterino.setFechainicio(fechaIn); profInterino.setFechaFin(fechaFin); } else { throw new ExcepcionPersonalizada("Las fecha no son correctas"); } } private boolean createPerson(Persona person) throws ExcepcionPersonalizada { if (person == null) { throw new ExcepcionPersonalizada("La persona no puede ser creada porque no existe"); } else { String name = person.getNombre(); int edad = person.getEdad(); if ((name != null && !name.equals("")) && edad != 0) { return true; } else { throw new ExcepcionPersonalizada("La personas no puede ser creada"); } } } }
true
8afde4daeb9c6a823fc3a70a6755e7634d8ae677
Java
jmiedzinski/databucket-app
/src/main/java/pl/databucket/DatabucketApplication.java
UTF-8
823
1.953125
2
[ "Apache-2.0" ]
permissive
package pl.databucket; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import pl.databucket.service.DatabucketServiceIm; @SpringBootApplication public class DatabucketApplication { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(DatabucketServiceIm.class); try { SpringApplication.run(DatabucketApplication.class, args); } catch (Exception e) { logger.info("\n\n\n--------------------------------------------------------------------"); logger.error("Problem with starting Databucket application. Check if the database server is started."); logger.info("--------------------------------------------------------------------"); } } }
true
1dfb44dfbfff6e7954626ee11a3df20eb1c084c5
Java
xiw9/regex-filter
/src/com/wandsea/antispammer/TraditionalActivity.java
UTF-8
4,134
2.203125
2
[ "WTFPL" ]
permissive
package com.wandsea.antispammer; import java.util.ArrayList; import com.wandsea.antispammer.R; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; public class TraditionalActivity extends Activity { /** Called when the activity is first created. */ ListView list = null; ArrayList<String> listItem=null; ArrayAdapter<String> adapter=null; int itemselect=0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.traditional); list = (ListView) findViewById(R.id.traditional_listView1); listItem = SmsFilter.gettfilter(getApplicationContext()); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_single_choice, listItem); list.setItemsCanFocus(true); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setAdapter(adapter); list.setItemChecked(0, true); list.setOnItemLongClickListener(new ListView.OnItemLongClickListener() { public boolean onItemLongClick(AdapterView<?> arg0, View arg1, final int arg2, long arg3) { if (arg2==0) return false; AlertDialog dlg=new AlertDialog.Builder(TraditionalActivity.this) .setMessage("是否删除该条过滤器?") .setPositiveButton("确定", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { SmsFilter.modifytfilter(getApplicationContext(),listItem.get(arg2),""); listItem = SmsFilter.gettfilter(getApplicationContext()); adapter = new ArrayAdapter<String>(TraditionalActivity.this, android.R.layout.simple_list_item_single_choice, listItem); list.setItemsCanFocus(true); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setAdapter(adapter); list.setItemChecked(0, true); } }).setNegativeButton("取消",null).create(); dlg.show(); return false; }} ); list.setOnItemClickListener(new ListView.OnItemClickListener(){ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { itemselect=arg2; EditText edittext= (EditText)findViewById(R.id.traditional_editText1); Button button1 = (Button) findViewById(R.id.traditional_button1); if(itemselect==0){ button1.setText("Add"); edittext.setText(""); }else{ button1.setText("Edit"); edittext.setText(listItem.get(itemselect)); } } }); Button button1 = (Button) findViewById(R.id.traditional_button1); button1.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg0) { EditText edittext= (EditText)findViewById(R.id.traditional_editText1); if(itemselect==0){ SmsFilter.createtfilter(getApplicationContext(),edittext.getText().toString()); edittext.setText(""); }else{ SmsFilter.modifytfilter(getApplicationContext(),listItem.get(itemselect),edittext.getText().toString()); } listItem = SmsFilter.gettfilter(getApplicationContext()); adapter = new ArrayAdapter<String>(TraditionalActivity.this, android.R.layout.simple_list_item_single_choice, listItem); list.setItemsCanFocus(true); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setAdapter(adapter); list.setItemChecked(itemselect, true); } }); } }
true
a95e408ee21cbe7b2b41a72fef04f50a526a444e
Java
heartforest/yc-case-report
/src/main/java/com/ycmvp/casereport/entity/ccase/TabCaseUser.java
UTF-8
2,073
1.601563
2
[]
no_license
package com.ycmvp.casereport.entity.ccase; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @Data public class TabCaseUser implements Serializable { private static final long serialVersionUID = 1L; private String id; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate caseDate; private String userid; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private java.time.LocalDateTime optTime; private String strokeDest; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate strokeDateGo; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate strokeDateBack; private String strokeDescription; private String bodySign; private String bodycase; private String doctorSign; private String hospital; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate doctorTime; private String dectorInfo; private String caseExplain; private String userCity; private String userCommunity; private String userBuilding; private String userCallCommunity; private String touchingSign; private String strokeVia; private String userMeet; private String userPubPlace; private String bodyTemperature; private String isolationTag; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate isolationDate; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") private java.time.LocalDate unisolationDate; private String isolationStatus; private String isolationDescription; private String workStatus; private Integer epidemicCommunityCount; private String strandedSign; private String examineName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") private java.time.LocalDateTime examineTime; private String examineUserid; }
true
cc7d6821e6ded993496d9f9037a2699bfa6d6956
Java
sufadi/decompile-hw
/decompile/app/HwSystemManager/src/main/java/com/huawei/harassmentinterception/engine/HwEngineCallerManager.java
UTF-8
780
2.53125
3
[]
no_license
package com.huawei.harassmentinterception.engine; public class HwEngineCallerManager { private static HwEngineCallerManager sInstance = null; private HwEngineCaller mCaller = null; public static synchronized HwEngineCallerManager getInstance() { HwEngineCallerManager hwEngineCallerManager; synchronized (HwEngineCallerManager.class) { if (sInstance == null) { sInstance = new HwEngineCallerManager(); } hwEngineCallerManager = sInstance; } return hwEngineCallerManager; } public synchronized HwEngineCaller getEngineCaller() { return this.mCaller; } public synchronized void setEngineCaller(HwEngineCaller caller) { this.mCaller = caller; } }
true
22eabad34cbe221e96c473c388374c23a61307a4
Java
ZYYBOSS/1
/shop/src/main/java/com/java2/web/entity/AddressEntity.java
UTF-8
1,048
2.4375
2
[]
no_license
package com.java2.web.entity; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(name = "address") public class AddressEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String address; @ManyToOne(fetch=FetchType.EAGER) @JoinColumn(name="user_id") //忽略某个元素,不加会死循环不停读取list @JsonIgnore private UserEntity userEntity; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public UserEntity getUser() { return userEntity; } public void setUser(UserEntity user) { this.userEntity = user; } }
true
f61ce7a57e17cb7ed8e255e8ecd2e874f5bce022
Java
borisemoreno/mutant-hunter
/src/main/java/com/xmen/mutanthunter/repository/DnaVerificationsRepository.java
UTF-8
711
2.015625
2
[]
no_license
package com.xmen.mutanthunter.repository; import com.xmen.mutanthunter.model.StatsDto; import com.xmen.mutanthunter.model.db.DnaVerifications; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import java.util.List; import java.util.Optional; import java.util.UUID; public interface DnaVerificationsRepository extends CrudRepository<DnaVerifications, UUID> { @Query(value = "FROM DnaVerifications d where d.dna = ?1") Optional<DnaVerifications> findByDna(String dna); @Query(value = "select new com.xmen.mutanthunter.model.StatsDto(count(d.id), d.mutant) from DnaVerifications d group by d.mutant") List<StatsDto> getStats(); }
true
f70231ac285caaa27e82019bccaba7aa5bb46500
Java
crashtheparty/EnchantmentSolution
/src/org/ctp/enchantmentsolution/events/player/PlayerChangeCoordsEvent.java
UTF-8
992
2.359375
2
[]
no_license
package org.ctp.enchantmentsolution.events.player; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; public class PlayerChangeCoordsEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); public static HandlerList getHandlerList() { return handlers; } @Override public HandlerList getHandlers() { return handlers; } private final Location fromLoc, toLoc; private boolean cancelled; public PlayerChangeCoordsEvent(Player who, Location fromLoc, Location toLoc) { super(who); this.fromLoc = fromLoc; this.toLoc = toLoc; } public Location getFrom() { return fromLoc; } public Location getTo() { return toLoc; } @Override public boolean isCancelled() { return cancelled; } @Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } }
true
92ca27b7fc5d40a15533c8c7cda385de7f326d3e
Java
AlessioMercuriali/QBorrow
/src/main/java/it/quix/academy/qborrow/core/model/QborrowUserContext.java
UTF-8
1,746
2.03125
2
[]
no_license
package it.quix.academy.qborrow.core.model; import java.util.ArrayList; import it.quix.framework.core.model.Language; import it.quix.framework.core.model.Organization; import it.quix.framework.core.model.Role; import it.quix.framework.core.model.User; import it.quix.framework.core.model.UserContext; import it.quix.puma.core.PumaFinderException; /** * Inserire all'interno di questa classe le proprieta' e i metodi * che si vogliono associare all'utente dell'applicazione */ public class QborrowUserContext extends UserContext { private static final long serialVersionUID = 1L; public QborrowUserContext() { super(); } @Override public Boolean authCodeLogin(String arg0) throws PumaFinderException { // TODO Auto-generated method stub return null; } @Override public String getCodCompany() { // TODO Auto-generated method stub return null; } @Override public Language getLanguageForSysAttribute() { // TODO Auto-generated method stub return null; } @Override public Organization getOrganizationForSysSysAttribute() { // TODO Auto-generated method stub return null; } @Override public void login(String user) throws Exception { final String userId = user; User userMode1 = new User() { public String getPassword() { return null; } public String getName() { return null; } public String getDn() { return null; } }; super.login(userMode1, new ArrayList<Role>()); } }
true
3c0101add0450a9356180da8d2bc85b0a533906b
Java
Tongqinwei/hhlab_ser2
/src/com/servlet/CreateSessionServlet.java
UTF-8
4,125
2.53125
3
[]
no_license
package com.servlet; import com.Login.Bean.SessionUser; import com.Login.Handler.MyJsonParser; import com.Login.Handler.WechatSessionHandler; import com.Login.Sessions.SessionManager; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; /** * Created by lee on 2017/6/17. * * @author: lee * create time: 下午1:43 */ @WebServlet(name = "CreateSessionServlet") public class CreateSessionServlet extends HttpServlet { public static String getBody(HttpServletRequest request) throws IOException { // get the body of the request object to a string String body = null; StringBuilder stringBuilder = new StringBuilder(); BufferedReader bufferedReader = null; try { InputStream inputStream = request.getInputStream(); if (inputStream != null) { bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); char[] charBuffer = new char[128]; int bytesRead = -1; while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { stringBuilder.append(charBuffer, 0, bytesRead); } } else { stringBuilder.append(""); } } catch (IOException ex) { throw ex; } finally { if (bufferedReader != null) { try { bufferedReader.close(); } catch (IOException ex) { throw ex; } } } body = stringBuilder.toString(); return body; } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // get the request pay load String session_code = getBody(request); // get response writer Writer out = response.getWriter(); response.setContentType("application/json"); if(!session_code.contentEquals("")){ // if the code is not send return the error json session_code = MyJsonParser.CodeJsonToString(session_code); log("receive session code from js is " + session_code); if(session_code.contentEquals("")){ // failed to parse out.write(MyJsonParser.GetSessionError()); } else { // session code get success String result = WechatSessionHandler.getSessionKey(session_code); log("receive from weChat server " + result); JsonObject jsonObject = MyJsonParser.String2Json(result); JsonElement element = jsonObject.get("openid"); if(element != null){ // 成功调用到微信的状态,为用户建立一个session 对象 方便进行管理 log("receive session key success! "); SessionUser user = new SessionUser(); element = jsonObject.get("openid"); user.setOpenID(element.getAsString()); element = jsonObject.get("session_key"); user.setSessionKey(element.getAsString()); SessionManager manager = SessionManager.getInstance(); manager.AddUser(user); // 返回成功的json out.write(MyJsonParser.GetSessionSuccess(user.getSessionID(),user.getOpenID())); } else { out.write(MyJsonParser.GetSessionError()); } } } else { out.write(MyJsonParser.GetSessionError()); } out.flush(); response.flushBuffer(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendError(404); } }
true
262f3d6cf9a076d9e3bc0f90afd3600c23c76fed
Java
RaviThejaGoud/hospital
/hms-common/src/main/java/com/hyniva/sms/ws/vo/cashbook/CashBookVO.java
UTF-8
5,044
2.0625
2
[]
no_license
package com.hyniva.sms.ws.vo.cashbook; import java.util.Date; public class CashBookVO { public long id; public Date transactionDate; public long accountId; public String accountName; public String place; public String narration; public String vocherNumber; public String transactionType; public double amount; /*This are dummy variables to manipulate trail balance sheet */ public double crAmount; public String crTtransactionType; public String transactionDateStr; public long clientId; public String entryType; /*C - Cash, D - DD , CH - Cheque, BD - Bank Deposit*/ protected String paymentType; protected String branchName; protected String chequeNumber; protected String ddNumber; protected long bankId; protected String bookType; protected String transactionNumber; protected String accountNumber; public String getAccountNumber() { return accountNumber; } public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } public String getTransactionNumber() { return transactionNumber; } public void setTransactionNumber(String transactionNumber) { this.transactionNumber = transactionNumber; } public String getBookType() { return bookType; } public void setBookType(String bookType) { this.bookType = bookType; } public String getPaymentType() { return paymentType; } public void setPaymentType(String paymentType) { this.paymentType = paymentType; } public String getBranchName() { return branchName; } public void setBranchName(String branchName) { this.branchName = branchName; } public String getChequeNumber() { return chequeNumber; } public void setChequeNumber(String chequeNumber) { this.chequeNumber = chequeNumber; } public String getDdNumber() { return ddNumber; } public void setDdNumber(String ddNumber) { this.ddNumber = ddNumber; } public long getBankId() { return bankId; } public void setBankId(long bankId) { this.bankId = bankId; } public String getEntryType() { return entryType; } public void setEntryType(String entryType) { this.entryType = entryType; } public double getCrAmount() { return crAmount; } public void setCrAmount(double crAmount) { this.crAmount = crAmount; } public String getCrTtransactionType() { return crTtransactionType; } public void setCrTtransactionType(String crTtransactionType) { this.crTtransactionType = crTtransactionType; } /** * @return the id */ public long getId() { return id; } /** * @param id the id to set */ public void setId(long id) { this.id = id; } /** * @return the transactionDate */ public Date getTransactionDate() { return transactionDate; } /** * @param transactionDate the transactionDate to set */ public void setTransactionDate(Date transactionDate) { this.transactionDate = transactionDate; } /** * @return the accountNumber */ public long getAccountId() { return accountId; } /** * @param accountNumber the accountNumber to set */ public void setAccountId(long accountId) { this.accountId = accountId; } /** * @return the accountName */ public String getAccountName() { return accountName; } /** * @param accountName the accountName to set */ public void setAccountName(String accountName) { this.accountName = accountName; } /** * @return the place */ public String getPlace() { return place; } /** * @param place the place to set */ public void setPlace(String place) { this.place = place; } /** * @return the narration */ public String getNarration() { return narration; } /** * @param narration the narration to set */ public void setNarration(String narration) { this.narration = narration; } /** * @return the vocherNumber */ public String getVocherNumber() { return vocherNumber; } /** * @param vocherNumber the vocherNumber to set */ public void setVocherNumber(String vocherNumber) { this.vocherNumber = vocherNumber; } /** * @return the transactionType */ public String getTransactionType() { return transactionType; } /** * @param transactionType the transactionType to set */ public void setTransactionType(String transactionType) { this.transactionType = transactionType; } /** * @return the amount */ public double getAmount() { return amount; } /** * @param amount the amount to set */ public void setAmount(double amount) { this.amount = amount; } public String getTransactionDateStr() { return transactionDateStr; } public void setTransactionDateStr(String transactionDateStr) { this.transactionDateStr = transactionDateStr; } public long getClientId() { return clientId; } public void setClientId(long clientId) { this.clientId = clientId; } }
true
59398b63fca8b3539348ae17e36bcdba7c46c0a5
Java
damnedGod/Indonesia_Que
/app/src/main/java/com/example/android/indonesiaqu/WelcomeScreen.java
UTF-8
989
1.96875
2
[]
no_license
package com.example.android.indonesiaqu; import android.content.Intent; import android.content.pm.ActivityInfo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class WelcomeScreen extends AppCompatActivity { public Button startButton; public void init(){ startButton=(Button)findViewById(R.id.start_button); startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent tombol = new Intent(WelcomeScreen.this,MainActivity.class); startActivity(tombol); } }); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_welcome_screen); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); init(); } }
true
5bbc4efeb38b44b45db9b25d57478c9a851e01b7
Java
drmmx/MVPAndroidLang
/app/src/main/java/com/example/dev3rema/mvpandroidlang/data/source/local/dao/LangDao.java
UTF-8
754
2.0625
2
[]
no_license
package com.example.dev3rema.mvpandroidlang.data.source.local.dao; import android.arch.persistence.room.Dao; import android.arch.persistence.room.Delete; import android.arch.persistence.room.Insert; import android.arch.persistence.room.OnConflictStrategy; import android.arch.persistence.room.Query; import com.example.dev3rema.mvpandroidlang.data.entity.Lang; import java.util.List; @Dao public interface LangDao { @Insert(onConflict = OnConflictStrategy.REPLACE) void saveLang(Lang lang); @Insert void insertAll(Lang... langs); @Delete void deleteLang(Lang lang); @Query("SELECT * FROM android_lang") List<Lang> getLangs(); @Query("SELECT * FROM android_lang WHERE id = :id") Lang getLangById(int id); }
true
de7ba2c8db5d7c0f53b60242f402b3f824230e81
Java
cckmit/event-manager
/src/main/java/ob1/eventmanager/service/CategoryService.java
UTF-8
325
1.804688
2
[]
no_license
package ob1.eventmanager.service; import ob1.eventmanager.entity.CategoryEntity; import java.util.List; import java.util.Optional; public interface CategoryService { List<CategoryEntity> getCategories(); Optional<CategoryEntity> getById(long id); Optional<CategoryEntity> getCategoryByName(String name); }
true
726a2cec437874e8812ce969422aae9596ce8562
Java
uNouss/ap
/td8/Morpion.java
UTF-8
6,947
2.84375
3
[]
no_license
//import extensions.*; class Morpion extends Program { final int TAILLE = 5; final char O = 'O'; final char X = 'X'; final char V = ' '; final String PROMPT = "$: "; char [][] grille = new char[TAILLE][TAILLE]; void testInitalize(){ initialize(); char[][] grilleVide = new char[TAILLE][]; for(int idxL = 0; idxL < length(grilleVide, 1); idxL++){ grilleVide[idxL] = new char[length(grilleVide, 1)]; for(int idxC = 0; idxC < length(grilleVide[idxL]); idxC++){ grilleVide[idxL][idxC] = V; } } assertArrayEquals(grilleVide, grille); } void initialize(){ for(int idxL = 0; idxL < length(grille, 1); idxL++) for(int idxC = 0; idxC < length(grille, 2); idxC++) grille[idxL][idxC] = V; } void testSet(){ set(1, 2, O); assertEquals(O, grille[1][2]); set(1, 1, X); assertEquals(X, grille[1][1]); set(2, 2, O); assertEquals(O, grille[2][2]); } void set(int idxL, int idxC, char car){ grille[idxL][idxC] = car; } void testIsAlignement(){ initialize(); set(0,0,X); set(1,1,X); set(2,2,X); //println();printGrid(); assertTrue(isAlignement()); initialize(); set(0,2,O); set(1,1,O); set(2,0,O); //println();printGrid(); assertTrue(isAlignement()); initialize(); set(0,2,O); set(0,1,O); set(0,0,O); //println();printGrid(); assertTrue(isAlignement()); initialize(); set(0,2,O); set(1,2,O); set(2,2,O); //println();printGrid(); assertTrue(isAlignement()); initialize(); set(0,2,O); set(1,2,X); set(2,2,O); //println();printGrid(); assertFalse(isAlignement()); } boolean isAlignement(){ char current, next = V, nextNext = V; for(int idxL = 0; idxL < length(grille,1); idxL++){ for(int idxC = 0; idxC < length(grille,2); idxC++){ current = grille[idxL][idxC]; if(current != V){ if(idxL+1 < length(grille, 1)){ next = grille[idxL+1][idxC]; if(idxL+2 < length(grille, 1)){ nextNext = grille[idxL+2][idxC]; if( current == next && next == nextNext) return true; } } if(idxC+1 < length(grille, 2)){ next = grille[idxL][idxC+1]; if(idxC+2 < length(grille, 2)){ nextNext = grille[idxL][idxC+2]; if( current == next && next == nextNext) return true; } } if(idxL+1 < length(grille,1) && idxC+1 < length(grille, 2)){ next = grille[idxL+1][idxC+1]; if(idxL+2 < length(grille, 1) && idxC+2 < length(grille, 2)){ nextNext = grille[idxL+2][idxC+2]; if( current == next && next == nextNext) return true; } } if(idxL+1 < length(grille,1) && idxC-1 >= 0){ next = grille[idxL+1][idxC-1]; if(idxL+2 < length(grille,1) && idxC-2 >= 0){ nextNext = grille[idxL+2][idxC-2]; if( current == next && next == nextNext) return true; } } //if( current == next && next == nextNext) return true; } } } return false; } void testIsFilled(){ initialize(); char[][] uneGrille = new char[TAILLE][]; for(int idxL = 0; idxL < length(uneGrille, 1); idxL++){ uneGrille[idxL] = new char[length(uneGrille, 1)]; for(int idxC = 0; idxC < length(uneGrille[idxL]); idxC++){ uneGrille[idxL][idxC] = ((int)(random()*2)==1)?O:X; } } grille = uneGrille; println();printGrid(); assertTrue(isFilled()); initialize(); assertFalse(isFilled()); set(2,0,O); assertFalse(isFilled()); grille = uneGrille; set(1,1,V); assertFalse(isFilled()); } boolean isFilled(){ for(int idxL = 0; idxL < length(grille, 1); idxL++) for(int idxC = 0; idxC < length(grille, 2); idxC++) if(grille[idxL][idxC] == V) return false; return true; } void testSwap(){ assertEquals('X', swap('O')); assertEquals('O', swap('X')); } char swap(char c){ return ( c == X) ? O: X; } void printGrid(){ afficherEntete(length(grille, 2)); for(int idxL = 0; idxL < length(grille, 1); idxL++){ afficheSeparateur(length(grille, 2)); for(int idxC = 0; idxC < length(grille, 2); idxC++){ //print(grille[idxL][idxC] + " "); print(String.format("|%3s", grille[idxL][idxC]+" ")); } println("| " + idxL); } afficheSeparateur(length(grille,1)); println(); } void afficherEntete(int n){ for (int i = 0; i < n; i++){ print(" "+i+" "); } println(" "); } void afficheSeparateur(int n) { for (int i = 0; i < n; i++){ print("+---"); } println("+"); } // verification de la valider du jeu boolean isValid(int row, int col){ return row >= 0 && row < length(grille, 1) && col >= 0 && col < length(grille, 2) && grille[row][col] == V; } void jouer(char player){ int row; int col; do{ print("JOUEUR_[" + player + "] , num_case [1; " + (TAILLE*TAILLE) + "] : "); int numCase = readInt();// utiliser la division et le modulo pour trouver les coordonnées row = (numCase - 1)/length(grille, 1); col = (numCase - 1) % length(grille, 1); //est-ce que je peux jouer à cette case ? }while(!isValid(row, col)); set(row, col, player); } void algorithm(){ initialize(); //Image ihm = newImage(640,640); char player = ((int)(random()*2)==1)?O:X; // tirage au sort du debutant do{ printGrid(); jouer(player); player = swap(player); }while(!isFilled() && ! isAlignement()); printGrid(); //show(ihm); //readString(); if(isAlignement()) println(swap(player) + " gagne"); // il faut swaper pour avoir le bon gagnant ? else println("match nul"); } }
true
240b8456dfee29cbaf53bcf7e5b7283b0ea48565
Java
busipallavi-reddy/cmpe202
/lab8/inputmask/src/main/java/CreditCardNum.java
UTF-8
813
2.71875
3
[]
no_license
/* (c) Copyright 2018 Paul Nguyen. All Rights Reserved */ public class CreditCardNum implements IDisplayComponent, IKeyEventHandler { private IKeyEventHandler nextHandler ; private IDisplayFormatter number = new CardNumDisplayDecorator(new DisplayFormatter()) ; public void setNext( IKeyEventHandler next) { this.nextHandler = next ; } public String display() { return number.display(); } public void key(String ch, int cnt) { if ( cnt <= 16 ) number.addKey(ch); else if ( nextHandler != null ) nextHandler.key(ch, cnt) ; } @Override public void removeKey(int cnt) { if (cnt <= 15) { number.removeLastKey(); } else if ( nextHandler != null ) { nextHandler.removeKey(cnt); } } public void addSubComponent( IDisplayComponent c ) { return ; // do nothing } }
true
9d0c45c674013ca9f57e689762c32ce971b3fe30
Java
Leirach/BdDPF
/app/src/main/java/itesm/mx/bddpf/TicketAdapter.java
UTF-8
1,369
2.421875
2
[]
no_license
package itesm.mx.bddpf; import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.ArrayList; public class TicketAdapter extends ArrayAdapter<Ticket> { public TicketAdapter(Context context, ArrayList<Ticket> tickets) { super(context, 0, tickets); } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { Ticket ticket = getItem(position); convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_tickets, parent, false); TextView tvTicket = convertView.findViewById(R.id.text_ticket); TextView tvPassenger = convertView.findViewById(R.id.text_passenger); TextView tvReservation = convertView.findViewById(R.id.text_reservation); TextView tvPrice = convertView.findViewById(R.id.text_price); tvPassenger.setText(ticket.getPassenger()); tvPrice.setText(Double.toString(ticket.getPrice())); tvTicket.setText(ticket.getTicketNumber()); tvReservation.setText(ticket.getReservation()); return convertView; } }
true