blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
a0fa28e85e31147d75af57419ab838fc0407c820
936aa88990d1e478491aa66627b0263b5590aaa0
/Platform/mo-6-content/src/content-define/org/mo/cloud/content/define/frame/FFrameService.java
f9fd2cdd7ac7bd39ae7881a7d09b317103b65ae8
[]
no_license
favedit/MoCloud3d
f6d417412c5686a0f043a2cc53cd34214ee35618
ef6116df5b66fbc16468bd5e915ba19bb982d867
refs/heads/master
2021-01-10T12:12:22.837243
2016-02-21T09:05:53
2016-02-21T09:05:53
48,077,310
2
2
null
null
null
null
UTF-8
Java
false
false
2,884
java
package org.mo.cloud.content.define.frame; import org.mo.cloud.content.design.configuration.FContentObject; import org.mo.cloud.content.design.frame.IFrameConsole; import org.mo.cloud.content.design.persistence.EPersistenceMode; import org.mo.com.lang.EResult; import org.mo.com.lang.REnum; import org.mo.com.lang.RString; import org.mo.com.xml.FXmlNode; import org.mo.core.aop.face.ALink; import org.mo.web.protocol.context.IWebContext; import org.mo.web.protocol.context.IWebInput; import org.mo.web.protocol.context.IWebOutput; //============================================================ // <T>内容表单服务。</T> //============================================================ public class FFrameService implements IFrameService { // 存储名称 protected String _storageName = "cloud"; // 内容表单控制台接口 @ALink protected IFrameConsole _frameConsole; //============================================================ // <T>构造内容表单服务。</T> //============================================================ public FFrameService(){ } //============================================================ // <T>查询配置处理。</T> // // @param context 网络环境 // @param input 网络输入 // @param output 网络输出 //============================================================ @Override public EResult query(IWebContext context, IWebInput input, IWebOutput output){ // 获得输入 FXmlNode xinput = input.config(); FXmlNode xoutput = output.config(); EPersistenceMode modeCd = EPersistenceMode.Config; //............................................................ // 参数获取 String frameName = context.parameter("frame"); if(!RString.isEmpty(frameName)){ String mode = context.parameter("mode_cd"); if(!RString.isEmpty(mode)){ modeCd = REnum.parse(EPersistenceMode.class, mode); } FContentObject content = _frameConsole.buildDefine(_storageName, frameName, modeCd); content.set("name", frameName); // 转换数据 FXmlNode xconfig = xoutput.createNode(); content.saveConfig(xconfig); return EResult.Success; } //............................................................ // 内容获取 for(FXmlNode xframe : xinput){ if(xframe.isName("Frame")){ String name = xframe.get("name"); // 查找目录定义 FContentObject content = _frameConsole.buildDefine(_storageName, name, modeCd); content.set("name", name); // 转换数据 FXmlNode xconfig = xoutput.createNode(); content.saveConfig(xconfig); } } return EResult.Success; } }
[ "favedit@hotmail.com" ]
favedit@hotmail.com
6b76bfc29518c6efdbd88cebb3c455a46cdc761f
4348a752de63ef295f141136f78ae583837e4431
/src/com/unika/hibernatemapping/CustomerAccounts.java
3c8ef244b9ff44eb6b8330dc836eed1383dc4dce
[]
no_license
deepakve/UnikaOnline_-_Banking_Management_System-2016-05-17
3205c2b46e3798d6be9ad381091f68e80c31f778
126609b82e11296fc4fdf54f2c62b7a1fdc3c0fe
refs/heads/master
2020-12-24T19:04:09.691132
2016-05-18T05:44:27
2016-05-18T05:44:27
59,063,149
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
java
package com.unika.hibernatemapping; import java.io.Serializable; public class CustomerAccounts implements Serializable { /** * */ private static final long serialVersionUID = 1L; private int customerid; private long accountnumber; private int accountcode; private String branchcode; private double balance; public int getCustomerid() { return customerid; } public void setCustomerid(int customerid) { this.customerid = customerid; } public long getAccountnumber() { return accountnumber; } public void setAccountnumber(long accountnumber) { this.accountnumber = accountnumber; } public int getAccountcode() { return accountcode; } public void setAccountcode(int accountcode) { this.accountcode = accountcode; } public String getBranchcode() { return branchcode; } public void setBranchcode(String branchcode) { this.branchcode = branchcode; } public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } }
[ "deepakdev88@gmail.com" ]
deepakdev88@gmail.com
9990d842a7547d5d8f332fb99a32a78c3a3a76e2
8166b2930ce2462a8cf207b6745f5eb2f4cb6231
/src/axion2014/Axion2014.java
fcac38ec8e5998d2b21fa49a3712b14a6a55f725
[]
no_license
thusithawick/axion-shop-manager
abd0727502b0abd7714cbd047e44e348ef7da9c4
293e7cb302a52100e1ce082c6b5d55228d0d0c4b
refs/heads/master
2023-02-01T03:06:03.460501
2020-12-18T00:35:40
2020-12-18T00:35:40
322,447,282
0
0
null
null
null
null
UTF-8
Java
false
false
922
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package axion2014; import java.sql.ResultSet; /** * * @author user */ public class Axion2014 { public static void main(String[] args) { try { JDBC db = new JDBC(); ResultSet rs1 = db.getData("SELECT * FROM THEMES WHERE ID = '0'"); while(rs1.next()){ if(rs1.getInt("THEME")==0){ new Login().setVisible(true); }else if(rs1.getInt("THEME")==1){ new Login1().setVisible(true); } } } catch (Exception e) { System.out.println(e); } new Login().setVisible(true); } /** * @param args the command line arguments */ }
[ "thusitha1993@gmail.com" ]
thusitha1993@gmail.com
e2727b5ee6b824cc1b99089d9d48dab04de39ce2
4cba86d59bbc5f0a42769694441710d16a790766
/fundamentals_4/fundamentals-4/src/com/manchesterDigital/MethodOverloadingExample.java
facd9bef00f54e0e4f55da1413b729ecf9ca1f4e
[]
no_license
4ndrewHarri5/bootcamp-2019
a935c0d1973c10b0a0d19896afa6c2a3369a8350
a32d5824ffef6cdb8cc7d039e322fb8debf4e39a
refs/heads/master
2021-07-11T21:39:01.930064
2019-10-08T15:19:47
2019-10-08T15:19:47
209,499,258
0
0
null
2020-10-13T16:33:25
2019-09-19T08:14:48
Java
UTF-8
Java
false
false
690
java
package com.manchesterDigital; public class MethodOverloadingExample { //member method since it is a member to the class public int multiply(int a, int b){ return a * b; } public int multiply(int first, int second, int third) { return first * second * third; } public int multiply(int... args) { return args[0]; } public static void main(String[] args) { // MethodOverloadingExample me = new MethodOverloadingExample(); //creating a new instance of a class int result = me.multiply(3, 3); System.out.println("Result: " + result); System.out.println(me.multiply(3,3,3)); } }
[ "4ndrew.harri5@gmail.com" ]
4ndrew.harri5@gmail.com
633e44c00826aaf95e952956c351c3e5d128299a
cf25e52ebab1a4a2e7f01fa9090858e01212568b
/app/src/test/java/ng/codeinn/oaunet/ExampleUnitTest.java
5d1e67bf948c6d1f90fc1a06ac4e9c722630642e
[]
no_license
thejer/OAUNet
7db3ebb47b74f541753f6f59576be16fbd1ced91
ef8c0cff9268708332c49c27e3100e97d8bccaca
refs/heads/master
2021-09-15T00:30:41.800295
2018-05-22T23:17:46
2018-05-22T23:17:46
131,305,721
0
0
null
null
null
null
UTF-8
Java
false
false
378
java
package ng.codeinn.oaunet; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "mokomiab@gmail.com" ]
mokomiab@gmail.com
2e51aaa40fc2d1a339e62b9e06db96d2ce9f7808
d9ed475c3b928adc1feb79e6d316bde03c00c1ea
/src/main/java/io/vandalvnl/utils/Strings.java
3e505e8695d075e857f4160eb4503ec339d04e98
[]
no_license
g4rcez/gandalf
22d31f4fc3f31637391d2ddeab78ca7cf3cff93a
893452c4d2bc839e311d6d65338f2a89be1e2a36
refs/heads/master
2020-03-26T17:09:34.005003
2018-08-20T20:41:09
2018-08-20T20:41:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,282
java
package io.vandalvnl.utils; import java.util.regex.Matcher; import java.util.regex.Pattern; public abstract class Strings { private static final String ALL_SPECIAL_UPPER_CASE = "A-ZÇÁÀÃÂÉÈẼÊÌÍĨÎÕÓÒÔŨÚÙÜÛ."; private static final String ALL_SPECIAL_LOWER_CASE = "a-zçáàãâéèẽêìíĩîõóòôũúùüû."; private static final String REGEX_ALL_UPPER_CASE = "[" + ALL_SPECIAL_UPPER_CASE + "]"; private static final String REGEX_ALL_LOWER_CASE = "[" + ALL_SPECIAL_LOWER_CASE + "]"; public static String replaceNonNumbers(final Object string) { return String.valueOf(string).replaceAll("[^0-9]", ""); } public static boolean regex(Object string, String regex) { return String.valueOf(string).matches(regex); } public static String class2Key(Class clazz) { String[] split = clazz.getName().split("\\."); String string = split[split.length - 1].replaceAll("Rule", ""); return camelCase(string); } public static String pascalCase(String string) { StringBuilder stringBuilder = new StringBuilder(); Matcher matcher = matcher(string); while (matcher.find()) stringBuilder.append(matcher.group(0).substring(0, 1).toUpperCase()) .append(matcher.group(0).substring(1).toLowerCase()); return String.valueOf(stringBuilder).trim(); } public static String camelCase(String string) { String camelCase = pascalCase(string); return camelCase.substring(0, 1).toLowerCase() .concat(camelCase.substring(1)); } private static Matcher matcher(String string) { return Pattern.compile(REGEX_ALL_UPPER_CASE + "{2,}(?=" + REGEX_ALL_UPPER_CASE + REGEX_ALL_LOWER_CASE + "+[0-9]*|\\b)|" + REGEX_ALL_UPPER_CASE + "?" + REGEX_ALL_LOWER_CASE + "+[0-9]*|" + REGEX_ALL_UPPER_CASE + "|[0-9]+").matcher(string); } public static Boolean isLeap(String year, String mouth, String day) { if (mouth.equals("02") && Integer.valueOf(year) % 4 == 0) return Integer.valueOf(day) <= 29; else if (mouth.equals("02") && Integer.valueOf(year) % 4 != 0) return Integer.valueOf(day) <= 28; return true; } }
[ "allan.f.garcez@gmail.com" ]
allan.f.garcez@gmail.com
e892e14bd44160102ee528a712b0c2ad29a3f782
4fdf670bd50226f7629a2cdbbe7803759c0b3481
/app/src/main/java/com/voxtantum/soreader/ui/errors/ApiErrorFragment.java
b082de3632409e876a0bd8463d0ac5c525fb99e7
[]
no_license
kristobalus/stackoverflow-reader
e85cec3422877502b386e326c68a68341b57fa83
beaee8420b697b1086b930cc65d489ef01f60904
refs/heads/master
2021-06-23T11:02:13.419248
2021-05-24T02:05:39
2021-05-24T02:05:39
224,349,518
0
0
null
null
null
null
UTF-8
Java
false
false
2,097
java
package com.voxtantum.soreader.ui.errors; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatButton; import androidx.appcompat.widget.AppCompatTextView; import com.voxtantum.soreader.R; import com.voxtantum.soreader.ReaderApp; import com.voxtantum.soreader.api.base.ApiException; import com.voxtantum.soreader.events.InvalidateDataSourceEvent; import com.voxtantum.soreader.ui.base.BaseFragment; import butterknife.BindView; import butterknife.OnClick; public class ApiErrorFragment extends BaseFragment { private static final String ARG_EXCEPTION = "arg_exception"; public static ApiErrorFragment newInstance(ApiException err) { Bundle args = new Bundle(); args.putSerializable(ARG_EXCEPTION, err); ApiErrorFragment fragment = new ApiErrorFragment(); fragment.setArguments(args); return fragment; } @BindView(R.id.code) AppCompatTextView codeView; @BindView(R.id.message) AppCompatTextView messageView; @BindView(R.id.body) AppCompatTextView bodyView; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_api_error, container, false); } @SuppressWarnings("ConstantConditions") @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ApiException err = (ApiException) getArguments().getSerializable(ARG_EXCEPTION); codeView.setText(String.valueOf(err.httpCode)); bodyView.setText(err.error != null ? err.error.errorMessage : null); messageView.setText(err.message); } @OnClick(R.id.button_retry) public void onRetryClicked(){ ReaderApp.getMessageBus().post(new InvalidateDataSourceEvent()); } }
[ "ildar.tamendarov@gmail.com" ]
ildar.tamendarov@gmail.com
0253aeb79341e9b70994743d22610fecc8bff7be
0f626d77908e93b083700a3f98d43fed66a4ec75
/chapter_004_collections_pro/src/test/java/mskubilov/list/SimpleStackTest.java
09ccbafa583fca1b27361a74682f2247918849f1
[ "Apache-2.0" ]
permissive
MaksimSkubilov/mskubilov
3d2c1a6cbe4051d4b43620acd3e3975b7e06997d
e30f5c5904c6e1a7962f3b5b25eb6211e3f7778a
refs/heads/master
2021-01-09T05:50:25.352889
2017-06-23T10:44:16
2017-06-23T10:44:16
80,840,511
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
package mskubilov.list; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; /** * //курс Петра Арсентьева job4j.ru. * * @author Maksim Skubilov skubilov89@yandex.ru * @version 1.0 * @since 19.04.17 */ public class SimpleStackTest { /** * test of push() and peek() methods of SimpleLinkedArray. */ @Test public void whenPushElementsAndPeekThenItPeeksLast() { SimpleStack<String> ss = new SimpleStack<>(); ss.push("stringOne"); ss.push("stringTwo"); ss.push("stringThree"); String result = ss.peek(); assertThat(result, is("stringThree")); } /** * test of push() and pop() methods of SimpleLinkedArray. */ @Test public void whenPushElementsAndPopThenItPopsAndDeletesLast() { SimpleStack<Integer> ss = new SimpleStack<>(); ss.push(0); ss.push(1); ss.push(2); ss.pop(); ss.pop(); int result = ss.pop(); assertThat(result, is(0)); } }
[ "skubilov89@yandex.ru" ]
skubilov89@yandex.ru
f6c46c7ecdab7644037ba45396e1555369b9f0bb
9e04d6cef1a8f376229a32f2c753d01d92a827c7
/StudentCatalogClient/src/kmv/menu/edit/AdditionListener.java
9e5bb8d407b57a291d6b7337dec972848a08d5fb
[]
no_license
KovalM-archive/InformationCatalog
0c719cf54abe5a89a18e43018b6eafd7aa4856f7
86698d993608e5fae994988f55b5fa59c0bd956d
refs/heads/master
2021-05-31T19:49:41.814334
2016-04-20T20:37:26
2016-04-20T20:37:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,233
java
package kmv.menu.edit; import kmv.controler.ServerController; import kmv.view.MainWindow; import kmv.view.TablePanel; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JTabbedPane; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class AdditionListener implements ActionListener { private ServerController serverController; private JFrame mainWindow; public AdditionListener(ServerController serverController, JFrame mainWindow){ this.serverController = serverController; this.mainWindow = mainWindow; } @Override public void actionPerformed(ActionEvent e) { TablePanel tablePanel = (TablePanel)serverController.getTabbedTab().getSelectedComponent(); JDialog additionStudentFrame = new JDialog(mainWindow, "Addition of student", false); additionStudentFrame.setSize(400, 500); additionStudentFrame.setLocationRelativeTo(tablePanel); additionStudentFrame.setVisible(true); additionStudentFrame.setLayout(new BorderLayout()); AdditionDialogPanel additionDialogPanel = new AdditionDialogPanel(tablePanel); additionStudentFrame.add(additionDialogPanel, BorderLayout.NORTH); } }
[ "m.koval@mail.by" ]
m.koval@mail.by
bfd911c340a016039024aa09a3cfd496d1187b93
816b5e665d315aee920fca44b32c60ec8bfad7db
/domain/net/xidlims/domain/CStaticValue.java
8accdebdda97e1bd2ce59a825a134ba6151c8129
[]
no_license
iqiangzi/ssdutZhangCC
d9c34bde6197f4ccb060cbb1c130713a5663989a
f5f7acd9ef45b5022accbdd7f6f730963fe3dddd
refs/heads/master
2020-08-02T22:07:50.428824
2018-05-13T03:03:04
2018-05-13T03:03:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,321
java
package net.xidlims.domain; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** */ @Entity @NamedQueries({ @NamedQuery(name = "findAllCStaticValues", query = "select myCStaticValue from CStaticValue myCStaticValue"), @NamedQuery(name = "findCStaticValueByCode", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.code = ?1"), @NamedQuery(name = "findCStaticValueByCodeContaining", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.code like ?1"), @NamedQuery(name = "findCStaticValueById", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.id = ?1"), @NamedQuery(name = "findCStaticValueByPrimaryKey", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.id = ?1"), @NamedQuery(name = "findCStaticValueByStaticValue", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.staticValue = ?1"), @NamedQuery(name = "findCStaticValueByStaticValueContaining", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.staticValue like ?1"), @NamedQuery(name = "findCStaticValueByValueName", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.valueName = ?1"), @NamedQuery(name = "findCStaticValueByValueNameContaining", query = "select myCStaticValue from CStaticValue myCStaticValue where myCStaticValue.valueName like ?1") }) @Table(catalog = "xidlims", name = "c_static_value") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(namespace = "xidlims/net/xidlims/domain", name = "CStaticValue") public class CStaticValue implements Serializable { private static final long serialVersionUID = 1L; /** */ @Column(name = "id", nullable = false) @Basic(fetch = FetchType.EAGER) @GeneratedValue(strategy = GenerationType.AUTO) @Id @XmlElement Integer id; /** * �ֵ����� * */ @Column(name = "code") @Basic(fetch = FetchType.EAGER) @XmlElement String code; /** * �ֵ���� * */ @Column(name = "value_name") @Basic(fetch = FetchType.EAGER) @XmlElement String valueName; /** * �ֵ������ * */ @Column(name = "static_value") @Basic(fetch = FetchType.EAGER) @XmlElement String staticValue; /** */ @Column(name = "academy_number") @Basic(fetch = FetchType.EAGER) @XmlElement String academyNumber; public String getAcademyNumber() { return academyNumber; } public void setAcademyNumber(String academyNumber) { this.academyNumber = academyNumber; } /** */ public void setId(Integer id) { this.id = id; } /** */ public Integer getId() { return this.id; } /** * �ֵ����� * */ public void setCode(String code) { this.code = code; } /** * �ֵ����� * */ public String getCode() { return this.code; } /** * �ֵ���� * */ public void setValueName(String valueName) { this.valueName = valueName; } /** * �ֵ���� * */ public String getValueName() { return this.valueName; } /** * �ֵ������ * */ public void setStaticValue(String staticValue) { this.staticValue = staticValue; } /** * �ֵ������ * */ public String getStaticValue() { return this.staticValue; } /** */ public CStaticValue() { } /** * Copies the contents of the specified bean into this bean. * */ public void copy(CStaticValue that) { setId(that.getId()); setCode(that.getCode()); setValueName(that.getValueName()); setStaticValue(that.getStaticValue()); } /** * Returns a textual representation of a bean. * */ public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append("id=[").append(id).append("] "); buffer.append("code=[").append(code).append("] "); buffer.append("valueName=[").append(valueName).append("] "); buffer.append("staticValue=[").append(staticValue).append("] "); return buffer.toString(); } /** */ @Override public int hashCode() { final int prime = 31; int result = 1; result = (int) (prime * result + ((id == null) ? 0 : id.hashCode())); return result; } /** */ public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof CStaticValue)) return false; CStaticValue equalCheck = (CStaticValue) obj; if ((id == null && equalCheck.id != null) || (id != null && equalCheck.id == null)) return false; if (id != null && !id.equals(equalCheck.id)) return false; return true; } }
[ "1501331454@qq.com" ]
1501331454@qq.com
b1703ed239e5599d29c925ab25967e6f9dd3960c
c4cbf18bb224e95bfd53f7b01c08511c55415683
/app/src/main/java/com/agencyemr/milerocker/gpstracker/App.java
bf121cff311219ff2bd728e6ab486cfcdb6e8806
[]
no_license
megurupriyan/MileRocker
d60e64fae1630ebaa41e88b01fe9db8cd730fef0
e2fb581c52a5d356916343526d0530e64c29c73b
refs/heads/master
2020-12-24T12:20:45.879481
2016-11-10T11:43:45
2016-11-10T11:43:45
73,051,519
0
0
null
null
null
null
UTF-8
Java
false
false
1,533
java
package com.agencyemr.milerocker.gpstracker; import android.app.Activity; import android.app.Application; import android.content.Context; import android.support.multidex.MultiDex; import com.agencyemr.milerocker.gpstracker.models.datamodels.DaoMaster; import com.agencyemr.milerocker.gpstracker.models.datamodels.DaoSession; import org.greenrobot.greendao.database.Database; /** * Created by Gurupriyan on 10/18/2016. */ public class App extends Application { /** * A flag to show how easily you can switch from standard SQLite to the encrypted SQLCipher. */ public static final boolean ENCRYPTED = true; Activity currentActivity; private DaoSession daoSession; @Override public void onCreate() { super.onCreate(); // Fabric.with(this, new Crashlytics()); DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, ENCRYPTED ? "milerocker-db-encrypted" : "milerocker-db"); Database db = ENCRYPTED ? helper.getEncryptedWritableDb("super-secret") : helper.getWritableDb(); daoSession = new DaoMaster(db).newSession(); } @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } public Activity getCurrentActivity() { return currentActivity; } public void setCurrentActivity(Activity currentActivity) { this.currentActivity = currentActivity; } public DaoSession getDaoSession() { return daoSession; } }
[ "gurupriyan.ks@rainconcert.in" ]
gurupriyan.ks@rainconcert.in
0d91095b6303dd1fddc460d4fa58d12de22c4656
42754037c1db6fa6d6bf7331eee167241f3f7550
/app/src/main/java/com/journals/ajpbp/model/DashBoardModel.java
c4ff003da3e2e70c6a74e5ad53d6e08dd33ede31
[]
no_license
suresh429/ajpbp
985a6a8447e03cebba536d6e39ab2cbf16b68812
278b3ce5f0a94b2b9d06a0806127de5b92661d93
refs/heads/master
2023-02-09T13:12:11.980434
2020-12-29T06:26:04
2020-12-29T06:26:04
325,204,722
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.journals.ajpbp.model; public class DashBoardModel { private String dashBoardTitle; public DashBoardModel(String dashBoardTitle) { this.dashBoardTitle = dashBoardTitle; } public String getDashBoardTitle() { return dashBoardTitle; } public void setDashBoardTitle(String dashBoardTitle) { this.dashBoardTitle = dashBoardTitle; } }
[ "ksuresh.unique@gmail.com" ]
ksuresh.unique@gmail.com
328535e0906b5a1867aaaf3ebcb37d4024e0abd5
ec0d7bfa17584b081206edd4767fa5b316d0f234
/src/main/java/com/airtel/mongo/service/EmployeeServiceImpl.java
d69083cc4f1af8f0248c73f1a3d474084ce4e43d
[]
no_license
shikharp16/SpringREST-CRUD
56b8940430a024aea68fc43240afcd392237175c
c9f184e3781d166b0f18ef26f1ad66d6397c24f0
refs/heads/master
2022-12-22T01:55:34.878644
2019-07-25T16:56:20
2019-07-25T16:56:20
198,854,816
0
0
null
2022-11-16T03:53:05
2019-07-25T15:15:10
Java
UTF-8
Java
false
false
765
java
package com.airtel.mongo.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.airtel.mongo.dao.EmployeeDao; import com.airtel.mongo.models.Employee; import java.util.List; @Service public class EmployeeServiceImpl implements EmployeeService { // Bean @Autowired EmployeeDao emplDao; public List<Employee> listEmployee() { List<Employee> employees = emplDao.listEmployee(); return employees; } public void add(Employee empl) { emplDao.add(empl); } public void update(Employee empl) { emplDao.update(empl); } public void delete(Employee empl) { emplDao.delete(empl); } public Employee findEmployeeById(String id) { return emplDao.findEmployeeById(id); } }
[ "shikhar16pahadia@gmail.com" ]
shikhar16pahadia@gmail.com
cc1c3de90a782a88962df6446e38d879d0c062b0
25dce335a19a78ddc14f9f7ae5228ec300f91b8e
/projeto/src/main/java/com/apidelivery/apidelivery/Models/ClientModel.java
b71e5e1ef136878dc7ae4afaecf3bdf648c26c20
[]
no_license
ySodias/api-delivery
96205735ef071b3f729117e190725971ab1d0a88
372cd21f94462dd694cfc5021073109d51707f1e
refs/heads/main
2023-04-03T11:37:33.633465
2021-03-31T18:03:40
2021-03-31T18:03:40
353,376,033
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
package com.apidelivery.apidelivery.Models; public class ClientModel { private String name; private String address; private String phone; private boolean active = false; public ClientModel(String name, String address, String phone) { this.name = name; this.address = address; this.phone = phone; } public String getName() { return name; } public String getAddress() { return address; } public String getPhone() { return phone; } public boolean isActive() { return active; } public void active(){ this.active = true; } }
[ "ySodia@gmail.com" ]
ySodia@gmail.com
95edba3fe94c9933b0fc6a2120ea1ad118143030
f222dbc0c70f2372179c01ca9e6f7310ab624d63
/soap/src/java/com/zimbra/soap/account/type/Attr.java
017614c5a21f5853a9b57147f7de11f117e3b46b
[]
no_license
Prashantsurana/zm-mailbox
916480997851f55d4b2de1bc8034c2187ed34dda
2fb9a0de108df9c2cd530fe3cb2da678328b819d
refs/heads/develop
2021-01-23T01:07:59.215154
2017-05-26T09:18:30
2017-05-26T10:36:04
85,877,552
1
0
null
2017-03-22T21:23:04
2017-03-22T21:23:04
null
UTF-8
Java
false
false
6,120
java
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016 Synacor, Inc. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software Foundation, * version 2 of the License. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. * ***** END LICENSE BLOCK ***** */ package com.zimbra.soap.account.type; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlValue; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.zimbra.common.service.ServiceException; import com.zimbra.common.soap.AccountConstants; import com.zimbra.common.zclient.ZClientException; import com.zimbra.soap.base.KeyAndValue; import com.zimbra.soap.type.ZmBoolean; /** * e.g. For element named "attr": * <attr name="{name}" [pd="true"]>{value}</attr> * * Note: where the attribute name is "n" rather than "name" use {@link KeyValuePair} */ public class Attr implements KeyAndValue { public static Function<Attr, Attr> COPY = new Function<Attr, Attr>() { @Override public Attr apply(Attr from) { return new Attr(from); } }; /** * @zm-api-field-tag attr-name * @zm-api-field-description Name of attribute */ @XmlAttribute(name=AccountConstants.A_NAME /* name */, required=true) private String name; // If true, flags that the real value of this attribute has not been provided - i.e. value is set to "" /** * @zm-api-field-tag attr-perm-denied * @zm-api-field-description Flags whether permission has been denied (optional). * <br /> * If <b>1 (true)</b>, flags that the real value of this attribute has not been provided. * <br /> * The value is set to "" */ @XmlAttribute(name=AccountConstants.A_PERM_DENIED /* pd */, required=false) private ZmBoolean permDenied; /** * @zm-api-field-tag attr-value * @zm-api-field-description Value of attribute */ @XmlValue private String value; public Attr() { } public Attr(Attr attr) { name = attr.getName(); value = attr.getValue(); permDenied = ZmBoolean.fromBool(attr.getPermDenied()); } public Attr(String name) { setName(name); } public Attr(String name, String value) { setName(name); setValue(value); } public static Attr forName(String name) { return new Attr(name); } public static Attr forNameAndValue(String name, String value) { return new Attr(name, value); } public static Attr forNameWithPermDenied(String name) { Attr attr = new Attr(name, ""); attr.setPermDenied(true); return attr; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Boolean getPermDenied() { return ZmBoolean.toBool(permDenied); } public void setPermDenied(Boolean permDenied) { this.permDenied = ZmBoolean.fromBool(permDenied); } @Override public String getValue() { return value; } @Override public void setValue(String value) { this.value = value; } @Override public String toString() { return Objects.toStringHelper(this) .add("name", name) .add("value", value) .toString(); } public static Multimap<String, String> toMultimap(List<? extends Attr> attrs) { Multimap<String, String> map = ArrayListMultimap.create(); if (attrs != null) { for (Attr a : attrs) { map.put(a.getName(), a.getValue()); } } return map; } public static List<Attr> fromMultimap(Multimap<String, String> attrMap) { List<Attr> attrs = new ArrayList<Attr>(); if (attrMap != null) { for (Map.Entry<String, String> entry : attrMap.entries()) { attrs.add(new Attr(entry.getKey(), entry.getValue())); } } return attrs; } public static List <Attr> fromMap(Map<String, ? extends Object> attrs) throws ServiceException { List<Attr> newAttrs = Lists.newArrayList(); if (attrs == null) return newAttrs; for (Entry<String, ? extends Object> entry : attrs.entrySet()) { String key = (String) entry.getKey(); Object value = entry.getValue(); if (value == null) { newAttrs.add(new Attr(key, (String) null)); } else if (value instanceof String) { newAttrs.add(new Attr(key, (String) value)); } else if (value instanceof String[]) { String[] values = (String[]) value; if (values.length == 0) { // an empty array == removing the attr newAttrs.add(new Attr(key, (String) null)); } else { for (String v: values) { newAttrs.add(new Attr(key, v)); } } } else { throw ZClientException.CLIENT_ERROR( "invalid attr type: " + key + " " + value.getClass().getName(), null); } } return newAttrs; } @Override public void setKey(String key) { setName(key); } @Override public String getKey() { return getName(); } }
[ "shriram.vishwanathan@synacor.com" ]
shriram.vishwanathan@synacor.com
b4447ce26d5ede6473ca4a17bcffb0d55b0e62d1
ed97d9f28a7e11898b805390f28aaa1b461fae33
/cloud-config-client-3355/src/main/java/org/example/controller/ConfigClientController.java
c69f9170e0f8371ef4b77d1b86d3e1e27349b8bb
[]
no_license
zsy0216/cloud2020
c5e9c417a5a0aab37e2af0b8c8a888f8d224e494
cac5d1dc2ce1f9ef540e2e89226445f62db10817
refs/heads/master
2023-08-08T20:17:59.124798
2020-09-06T01:27:17
2020-09-06T01:27:17
284,171,095
12
3
null
2023-07-24T00:54:44
2020-08-01T02:32:32
Java
UTF-8
Java
false
false
570
java
package org.example.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @author shuaiyin.zhang * @description * @date 2020/08/10 */ @RestController @RefreshScope public class ConfigClientController { @Value("${config.info}") private String configInfo; @GetMapping("/config-info") public String getConfigInfo() { return configInfo; } }
[ "594983498@qq.com" ]
594983498@qq.com
40d0e65fe3109a596716aeb7c62ab063881a0bd2
c02a7557c01bc6632a4853e45ecca0cd6286c816
/icehttp2/src/Solution1.java
e3977c4ad70be1379ea59e278e6f5d0890db42b1
[]
no_license
00Z26/deepbluesea
45a5f42d45011a6ef130fe67ca98d3f39bf3b0b7
e0cd9c005d73c1b3ec0934a01b9529b2514fca2f
refs/heads/master
2021-05-04T03:47:59.924459
2017-11-17T19:42:23
2017-11-17T19:42:23
70,788,852
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
public class Solution1 { public int[] twoSum(int[] nums, int target) { int[] ok = new int[2]; for(int i = 0;i < nums.length-1;i++){ for(int k = i + 1;k < nums.length;k++){ if(nums[i]+nums[k] == target){ ok[0] = i; ok[1] = k; return ok; } } } return null; } } /** * leetcode第一题 * Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. 如果用for-while-for 可不可以不用-1 */
[ "lwlau@qq.com" ]
lwlau@qq.com
b6f16f3beb4f1f962e7b648fc1ad541db530aa39
c3781ac808d1df5fbc866840862ef353d9477693
/1.JavaSyntax/src/com/javarush/task/task04/task0411/Solution.java
edee836db7d000ba95b9f432de34b15248391266
[]
no_license
DmStrelok/JavaRush
d344fe6661688bd9b922eb8a9e8f463232d3f830
aed0567206587ece2a1c2633232de4c5440b00d5
refs/heads/master
2021-09-08T01:00:48.744805
2018-03-04T22:31:44
2018-03-04T22:31:44
123,834,108
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.javarush.task.task04.task0411; /* Времена года на Терре */ public class Solution { public static void main(String[] args) { checkSeason(12); checkSeason(4); checkSeason(7); checkSeason(10); } public static void checkSeason(int month) { //::CODE: if ((month > 0 && month < 3) || (month == 12)) System.out.println("зима"); else if (month > 2 && month < 6) System.out.println("весна"); if (month > 5 && month < 9) System.out.println("лето"); if (month > 8 && month < 12) System.out.println("осень"); } }
[ "trdm555@gmail.com" ]
trdm555@gmail.com
697e1c747b200a1390b44aafac880e5cde32537f
8c5f150734960a541d3fd63954ff767f4c639fbc
/src/java/dto/DatosProgra.java
9c7817fc19a829801bf3e81c40d6aa2c0d33cd2f
[]
no_license
Torvik1/SistemaTutorias
da3d315c3e932ca194d322d769a1c23335b5dd9e
aecff36a7fa7b1124911e5eb47f91f6958ad235c
refs/heads/master
2020-09-15T00:40:06.361902
2017-07-11T04:44:39
2017-07-11T04:44:39
94,476,451
0
0
null
null
null
null
UTF-8
Java
false
false
1,523
java
package dto; public class DatosProgra { int id; int grupo; int id_proceso; String nombre_curso; String nombre_tutor; String apellido_tutor; public DatosProgra() { } public DatosProgra(int id, int grupo, int id_proceso, String nombre_curso, String nombre_tutor) { this.id = id; this.grupo = grupo; this.id_proceso = id_proceso; this.nombre_curso = nombre_curso; this.nombre_tutor = nombre_tutor; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getGrupo() { return grupo; } public void setGrupo(int grupo) { this.grupo = grupo; } public int getId_proceso() { return id_proceso; } public void setId_proceso(int id_proceso) { this.id_proceso = id_proceso; } public String getNombre_curso() { return nombre_curso; } public void setNombre_curso(String nombre_curso) { this.nombre_curso = nombre_curso; } public String getNombre_tutor() { return nombre_tutor; } public void setNombre_tutor(String nombre_tutor) { this.nombre_tutor = nombre_tutor; } public String getApellido_tutor() { return apellido_tutor; } public void setApellido_tutor(String apellido_tutor) { this.apellido_tutor = apellido_tutor; } }
[ "torvikzito@gmail.com" ]
torvikzito@gmail.com
44faeceb2ca40a1ec63669d673594f6a4fd418a6
69aa5831ceb469f926d53c76597ba80ede17f323
/src/com/zhangmengcong/www/service/service/PrintAppealService.java
b71d0eb81ed13edb325de3caf9b03d644c5ec5dd
[]
no_license
Rushmmmc/qg
988c39c0a7813c31bc38fe1b27dc28c5c775daff
a9d050d57fbfb1740e62f70df72ab82b9533ddb1
refs/heads/master
2022-07-17T16:55:38.287645
2020-05-15T07:15:10
2020-05-15T07:15:10
260,598,528
0
0
null
null
null
null
UTF-8
Java
false
false
538
java
package com.zhangmengcong.www.service.service; import com.zhangmengcong.www.po.Appeal; import java.util.List; /** * @author:zmc * @function: 打印申诉信息 * @date: 2020/5/3 19:15 */ public interface PrintAppealService { /** 打印申诉信息 * @param level 根据用户等级打印 若为管理员则管理全部信息 * @param username 筛选出该用户的申诉信息 为null则为管理员打印全部 * @return 返回list */ List<Appeal> printAppealServiceImpl(int level,String username); }
[ "1907779674@qq.com" ]
1907779674@qq.com
3e51304b0ed3a6c32ad63e67c62c7bc668b4449e
e6586594564750198e39cccbce8cace28d8f8716
/application.linux/source/main/ReactionFlow_1_1.java
98583b608dc8b4a68e042fa6fbb2f5b302fb273e
[]
no_license
CreativeCodingLab/ReactionFlow
8b33c29637ea7723d1c104cd45a1edc72f371910
8fed3be987779a9f79d0824b4dc9fedd670da880
refs/heads/master
2021-05-16T02:45:25.369955
2018-05-16T19:31:06
2018-05-16T19:31:06
34,280,654
9
1
null
null
null
null
UTF-8
Java
false
false
13,269
java
package main; /* * DARPA project * * Copyright 2014 by Tuan Dang. * * The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the License. */ import java.awt.FileDialog; import java.awt.Frame; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.biopax.paxtools.io.SimpleIOHandler; import org.biopax.paxtools.model.Model; import org.biopax.paxtools.model.level3.*; import org.biopax.paxtools.model.level3.Process; import processing.core.*; public class ReactionFlow_1_1 extends PApplet { private static final long serialVersionUID = 1L; public String currentFile = "./level3/RAF-Cascade.owl"; // public String currentFile = "./level3_2015/HIV_life_cycle.owl"; public static ButtonBrowse buttonBrowse; public PFont metaBold = loadFont("Arial-BoldMT-18.vlw"); // Contains the location and size of each gene to display public float size=0; public static String message=""; public ThreadLoader1 loader1=new ThreadLoader1(this); public Thread thread1=new Thread(loader1); public ThreadLoader4 loader4=new ThreadLoader4(this); public Thread thread4=new Thread(loader4); // Allow to draw public static float percent = 0; // New to read data public static ReactionView reactionView; // Multiple pathways public static void main(String args[]){ PApplet.main(new String[] { ReactionFlow_1_1.class.getName() }); } public void setup() { textFont(metaBold,14); size(1440, 900); //size(1280, 750); if (frame != null) { frame.setResizable(true); } background(0); frameRate(12); curveTightness(0.7f); smooth(); buttonBrowse = new ButtonBrowse(this); reactionView = new ReactionView(this); //VEN DIAGRAM if (!currentFile.equals("")){ thread1=new Thread(loader1); thread1.start(); } // Loading multiple pathways // thread2=new Thread(loader2); // thread2.start(); // Loading sub pathways in a pathway // thread3=new Thread(loader3); // thread3.start(); // enable the mouse wheel, for zooming addMouseWheelListener(new java.awt.event.MouseWheelListener() { public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { mouseWheel(evt.getWheelRotation()); } }); } public void draw() { background(255); //this.scale(4); /* if (this.keyPressed){ translate(width/3,mouseY); // use translate around scale scale(2.5f); translate(-width/3,-mouseY); // to scale from the center }*/ // Draw try{ // Print message when loading multiple pathways if (percent<=1){ this.fill((this.frameCount*22)%256, 255- (this.frameCount*22)%256,0); this.noStroke(); this.arc(100,this.height-20, 30, 30, 0, PApplet.PI*2*(percent)); this.textSize(12); this.textAlign(PApplet.LEFT); this.text(message, 120,this.height-14); } // Draw file name this.fill(128); this.textAlign(PApplet.LEFT); this.textSize(12); String[] str = currentFile.split("/"); String nameFile = str[str.length-1]; this.text("File: "+nameFile, 80, 16); reactionView.drawReactions(180); buttonBrowse.draw(); } catch (Exception e){ System.out.println(); System.out.println("*******************Catch ERROR*******************"); e.printStackTrace(); return; } } public void mousePressed() { reactionView.mousePressed(); } public void mouseReleased() { reactionView.mouseReleased(); } public void mouseDragged() { reactionView.mouseDragged(); } public void mouseMoved() { ReactionView.popupCausality.mouseMoved(); ReactionView.popupReactionOrder.mouseMoved(); reactionView.checkReactionBrushing(); if (ReactionView.isAllowedDrawing && ReactionView.simulationRectList.size()==0){ reactionView.mouseMoved(); } } public void mouseClicked() { if (buttonBrowse.b>=0){ thread4=new Thread(loader4); thread4.start(); } reactionView.mouseClicked(); } public String loadFile (Frame f, String title, String defDir, String fileType) { FileDialog fd = new FileDialog(f, title, FileDialog.LOAD); fd.setFile(fileType); fd.setDirectory(defDir); fd.setLocation(50, 50); fd.show(); String path = fd.getDirectory()+fd.getFile(); return path; } public void keyPressed() { if (ReactionView.textbox1.b){ ReactionView.textbox1.keyPressed(); return; } } // Thread for Venn Diagram class ThreadLoader1 implements Runnable { PApplet p; public ThreadLoader1(PApplet parent_) { p = parent_; } @SuppressWarnings("unchecked") public void run() { ReactionView.isAllowedDrawing = false; ReactionView.textbox1.searchText=""; File modFile = new File(currentFile); //File outFile = new File("output.txt"); SimpleIOHandler io = new SimpleIOHandler(); Model model; try{ System.out.println(); System.out.println("***************** Load data: "+modFile+" ***************************"); long t1 = System.currentTimeMillis(); model = io.convertFromOWL(new FileInputStream(modFile)); long t2 = System.currentTimeMillis(); System.out.println(t2-t1); ReactionView.mapProteinRDFId = new HashMap<String,String>(); ReactionView.mapSmallMoleculeRDFId = new HashMap<String,String>(); ReactionView.mapComplexRDFId_index = new HashMap<String,Integer>(); Set<Protein> proteinSet = model.getObjects(Protein.class); for (Protein currentProtein : proteinSet){ ReactionView.mapProteinRDFId.put(currentProtein.getRDFId().toString(), currentProtein.getDisplayName()); } System.out.println(proteinSet.size()); Set<SmallMolecule> set = model.getObjects(SmallMolecule.class); for (SmallMolecule currentMolecule : set){ ReactionView.mapProteinRDFId.put(currentMolecule.getRDFId().toString(), currentMolecule.getDisplayName()); ReactionView. mapSmallMoleculeRDFId.put(currentMolecule.getRDFId().toString(), currentMolecule.getDisplayName()); } Set<PhysicalEntity> physicalEntitySet = model.getObjects(PhysicalEntity.class); for (PhysicalEntity current : physicalEntitySet){ if (current.getRDFId().contains("PhysicalEntity")){ ReactionView.mapProteinRDFId.put(current.getRDFId().toString(), current.getDisplayName()); } } Set<Complex> complexSet = model.getObjects(Complex.class); ReactionView.complexList = new ArrayList<Complex>(); int i2=0; for (Complex current : complexSet){ ReactionView.mapComplexRDFId_index.put(current.getRDFId().toString(), i2); ReactionView.complexList.add(current); i2++; } i2=0; // Compute proteins in complexes ReactionView.proteinsInComplex = new ArrayList[complexSet.size()]; for (int i=0; i<ReactionView.complexList.size();i++){ ReactionView.proteinsInComplex[i] = getProteinsInComplexById(i); } // Reaction set ReactionView.reactionSet = model.getObjects(BiochemicalReaction.class); /* Set<PathwayStep> set3 = model.getObjects(PathwayStep.class); i2=0; System.out.println("SET2 ******:"+set3); for (PathwayStep current : set3){ // System.out.println("PathwayStep"+i2+" "+current.getNextStepOf()+" "+current.getPathwayOrderOf()); // System.out.println(" "+current.getNextStep()); i2++; }*/ /* // Figure 1 in the paper i2=0; ReactionView.reactionSet = new HashSet<BiochemicalReaction>(); for (Pathway aPathway : model.getObjects(Pathway.class)){ System.out.println("*"+aPathway.getDisplayName()+"*"); if (aPathway.getDisplayName().contains("Early Phase")){ /// if (aPathway.getDisplayName().equals("ERK1 activation")){ //if (aPathway.getDisplayName().equals("GPCR ligand binding")){ System.out.println("--------------:" +aPathway.getDisplayName()); ArrayList<BiochemicalReaction> b = processPathwayForFigure1(aPathway); for (int i=0;i<b.size();i++){ ReactionView.reactionSet.add(b.get(i)); } } i2++; } for (Pathway aPathway : model.getObjects(Pathway.class)){ System.out.println("--------------*"+aPathway.getDisplayName()); }*/ } catch (FileNotFoundException e){ e.printStackTrace(); javax.swing.JOptionPane.showMessageDialog(p, "File not found: " + modFile.getPath()); return; } System.out.println(); ReactionView.check11.s=true; // Fade small molecule ReactionView.check5.s=false; reactionView.setItems(); ReactionView.isAllowedDrawing = true; //******************* Start drawing ************** } } public ArrayList<BiochemicalReaction> processPathwayForFigure1(Pathway aPathway) { ArrayList<BiochemicalReaction> a = new ArrayList<BiochemicalReaction>(); for (Process aProcess : aPathway.getPathwayComponent()) { if (aProcess instanceof Pathway) { // Dig into the nested structure ArrayList<BiochemicalReaction> b = processPathwayForFigure1((Pathway) aProcess); for (int i=0;i<b.size();i++){ a.add(b.get(i)); } } else if (aProcess instanceof BiochemicalReaction) {// It must be an Interaction a.add((BiochemicalReaction) aProcess); } } return a; } // Thread for grouping class ThreadLoader4 implements Runnable { PApplet parent; public ThreadLoader4(PApplet p) { parent = p; } public void run() { String fileName = loadFile(new Frame(), "Open your file", "..", ".txt"); if (fileName.equals("..null")) return; else{ currentFile = fileName; // Read data for Reaction View thread1=new Thread(loader1); thread1.start(); // Read data for Pathway View // thread3=new Thread(loader3); // thread3.start(); } } } public boolean isContainReaction(ArrayList<BiochemicalReaction> a, String s) { if (a==null || s==null) return false; for (int r=0;r<a.size();r++){ if (a.get(r)==null || a.get(r).getDisplayName()==null) continue; if (a.get(r).getDisplayName().equals(s)) return true; } return false; } // This function returns all the files in a directory as an array of Strings public ArrayList<String> listFileNames(String dir, String imgType) { File file = new File(dir); ArrayList<String> a = new ArrayList<String>(); if (file.isDirectory()) { // Do String names[] = file.list(); for (int i = 0; i < names.length; i++) { ArrayList<String> b = listFileNames(dir + "/" + names[i], imgType); for (int j = 0; j < b.size(); j++) { a.add(b.get(j)); } } } else if (dir.endsWith(imgType)) { a.add(dir); } return a; } public static String getProteinName(String ref){ String s1 = ReactionView.mapProteinRDFId.get(ref); return s1; } public static boolean isSmallMolecule(String name){ if (ReactionView.mapSmallMoleculeRDFId.containsValue(name)) return true; else return false; } public static ArrayList<String> getComplexById(int id){ ArrayList<String> components = new ArrayList<String>(); Complex com = ReactionView.complexList.get(id); Object[] s2 = com.getComponent().toArray(); for (int i=0;i<s2.length;i++){ if (getProteinName(s2[i].toString())!=null) components.add(getProteinName(s2[i].toString())); else components.add(s2[i].toString()); } return components; } public static ArrayList<String> getProteinsInComplexById(int id){ ArrayList<String> components = new ArrayList<String>(); Complex com = ReactionView.complexList.get(id); Object[] s2 = com.getComponent().toArray(); for (int i=0;i<s2.length;i++){ if (getProteinName(s2[i].toString())!=null) components.add(getProteinName(s2[i].toString())); else { if (ReactionView.mapComplexRDFId_index.get(s2[i].toString())==null){ String name = s2[i].toString(); components.add(name); } else{ int id4 = ReactionView.mapComplexRDFId_index.get(s2[i].toString()); ArrayList<String> s4 = getProteinsInComplexById(id4); for (int k=0;k<s4.size();k++){ components.add(s4.get(k)); } } } } return components; } void mouseWheel(int delta) { } }
[ "tdang21@uic.edu" ]
tdang21@uic.edu
ec0f53b9a57472be230d3f2bbdfc385fdf645417
4a42a4fbe89dc4cb3cb5854c1abc9478377bd9eb
/3.JavaMultithreading/src/com/javarush/task/task29/task2909/car/Cabriolet.java
c41427ef12cf2ed49e657a035fbe6e33a9bf7d6b
[]
no_license
lagsterius/JavaRushTasks
f22bf5cd3b7f80c25f9186b51e6a629694e95d66
36f8bcf2ea8fd6d856312d09d70b75627d501d8a
refs/heads/master
2021-07-20T05:15:26.526142
2017-10-27T15:27:56
2017-10-27T15:28:01
108,563,496
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
package com.javarush.task.task29.task2909.car; public class Cabriolet extends Car { public Cabriolet(int numberOfPassengers) { super(Car.CABRIOLET, numberOfPassengers); } @Override public int getMaxSpeed() { return super.MAX_CABRIOLET_SPEED; } }
[ "lagsterius@gmail.com" ]
lagsterius@gmail.com
e072920fe6b00f3bc3128288b0021f762d99e951
cb74bf6e778b36976728831d0b54e65936448bdb
/src/com/wu/androidfileclient/ui/FileItemsListAdapter.java
a4bec9dcf36dfd2859aa687e6349439379975825
[]
no_license
PeterWuMC/AndroidFileClient
df87930db84d7bf44e2426273f8b704c755e3218
71b8ed53468de95784930f7576416bc8e5c02108
refs/heads/master
2021-01-23T16:40:05.351353
2013-01-14T13:26:36
2013-01-14T13:26:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,709
java
package com.wu.androidfileclient.ui; import java.util.ArrayList; import java.util.Date; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import com.wu.androidfileclient.R; import com.wu.androidfileclient.models.ActionItem; import com.wu.androidfileclient.models.BaseListItem; import com.wu.androidfileclient.models.FileItem; import com.wu.androidfileclient.models.FolderItem; import com.wu.androidfileclient.utils.Utilities; public class FileItemsListAdapter extends ArrayAdapter<BaseListItem> { private ArrayList<BaseListItem> objectsList; private Activity context; public FileItemsListAdapter(Activity context, int textViewResourceId, ArrayList<BaseListItem> objectsList) { super(context, textViewResourceId, objectsList); this.context = context; this.objectsList = objectsList; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = vi.inflate(R.layout.file_list_row, null); } BaseListItem listItem = objectsList.get(position); View additionalInfo = view.findViewById(R.id.additional_info); TextView sizeView = (TextView) additionalInfo.findViewById(R.id.size); TextView lastModifiedView = (TextView) additionalInfo.findViewById(R.id.last_modified); if (listItem != null) { int icon = 0; additionalInfo.setVisibility(View.INVISIBLE); sizeView.setText(""); lastModifiedView.setText(""); if (listItem instanceof ActionItem && listItem.name.equalsIgnoreCase("back")) { icon = android.R.drawable.ic_menu_revert; } else if (listItem instanceof FolderItem) { icon = R.drawable.folder; } else if (listItem instanceof FileItem) { additionalInfo.setVisibility(View.VISIBLE); FileItem fileItem = (FileItem) listItem; icon = context.getResources().getIdentifier(fileItem.ext(), "drawable", context.getPackageName()); sizeView.setText("Size: " + Utilities.humanReadableByteCount(fileItem.size, true)); lastModifiedView.setText("Modified: " + Utilities.humanReadableDatesDifferemce(fileItem.last_modified, new Date())); if (icon == 0) icon = R.drawable.unknown; } ImageView typeImage = (ImageView) view.findViewById(R.id.icon); typeImage.setImageResource(icon); TextView nameTextView = (TextView) view.findViewById(R.id.name); nameTextView.setText(listItem.name); } return view; } }
[ "peter.wu@xbridge.com" ]
peter.wu@xbridge.com
9d664c2605bb88ea39ce5a21ff0ee99c048badfb
5f22a228edecb902cc77629e96b8431dde4f933c
/springboot-rabbitmq/src/main/java/com/zk/consumer/UserDefinitionReceiver.java
437197d22948b3d5edb480006e61114c1f395178
[]
no_license
zhukaigit/rabbitmq
e4ccae56ed80c8893b3c1b3cdf0202ddb3535b41
cc99dacfeb443ed42ac79918bc3f023b92a5d327
refs/heads/master
2020-03-21T14:49:16.275730
2019-03-18T15:23:17
2019-03-18T15:23:17
138,677,220
0
0
null
null
null
null
UTF-8
Java
false
false
1,395
java
package com.zk.consumer; import com.zk.config.TopicRabbitConfig; import java.nio.charset.Charset; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Queue; import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.messaging.handler.annotation.Payload; import org.springframework.stereotype.Component; /** * 使用@RabbitListener中的bindings属性,就不需要另外的绑定配置 * * 小结:注解@RabbitListener在项目启动时会被容器发现,并创建相关的Queue和Exchange对象,如果Queue和Exchange对象不存在binding关系,则绑定 * 若已绑定过,则无法改变绑定关系。 */ @Component public class UserDefinitionReceiver { @RabbitHandler @RabbitListener(bindings = @QueueBinding( value = @Queue(value = "status_change_queue", durable = "true"), exchange = @Exchange(value = "status_change_exchange", type = "topic"), key = "status.change.#" )) public void process(Message msg) { byte[] body = msg.getBody(); String s = new String(body, Charset.forName("utf-8")); System.out.println("UserDefinitionReceiver , Receiver : " + s); } }
[ "zhukaixlyx@sina.com" ]
zhukaixlyx@sina.com
1ee3b11b5a4795488692d04e78c1a9982d9e5989
38013b557934a2ca6a93776b14c5827e4a0d76c1
/src/main/java/rain/people/Application.java
f7aabc33e45baaf02e1f27af0487ee700d3e738e
[]
no_license
Rainowy/REST_API
d1e2e8f4e791c95cc89ba3a0f29aa52d661a909e
1a4b7a0b88dcefad7821a6b045d1c0c5abc6448a
refs/heads/master
2023-02-25T00:38:58.419423
2021-02-01T13:50:23
2021-02-01T13:50:23
299,260,222
0
0
null
2021-02-01T13:50:24
2020-09-28T09:36:58
Java
UTF-8
Java
false
false
191
java
package rain.people; import io.micronaut.runtime.Micronaut; public class Application { public static void main(String[] args) { Micronaut.run(Application.class, args); } }
[ "tomasz.czarny.czarnecki@gmail.com" ]
tomasz.czarny.czarnecki@gmail.com
b87f1d396a5607b9b8ac316dec793280dbe25f0d
7d5331309f8bc83982d62f4ec376e8b9f6288e1e
/ListaTarea2/app/src/androidTest/java/com/example/listatarea2/ExampleInstrumentedTest.java
c219f61d3fce9c9b9684a57241aaab42b75e419c
[]
no_license
migboi/Programacion_Multimedia
29921b86d01d692ca843d8ab6878c3d48943298a
2b1debd4e495003902140fa287d8ad735451de64
refs/heads/master
2020-08-10T19:08:49.990060
2020-02-12T23:11:29
2020-02-12T23:11:29
214,402,655
1
0
null
null
null
null
UTF-8
Java
false
false
762
java
package com.example.listatarea2; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.listatarea2", appContext.getPackageName()); } }
[ "migboi@alu.iesserpis.org" ]
migboi@alu.iesserpis.org
ba546e070c22d39c252d1053b75f3bc6cafd8cec
3052d41bd96ec9c0d3361f186dde27d96d235f40
/src/wsclient/GetOnekyRepairPOOL.java
fe3189f013a5975a82aeeba5885731bbfa3d5b9c
[]
no_license
edgaryu201/hello-world
c855383e0a8e1d452f021e2ef580fac2221e8948
deea2850a5e85b361ad349767b9952ab4b230871
refs/heads/master
2020-03-20T08:31:17.038516
2018-06-15T05:47:50
2018-06-15T05:47:50
137,310,976
0
0
null
null
null
null
UTF-8
Java
false
false
1,358
java
package wsclient; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p> * Java class for anonymous complex type. * * <p> * The following schema fragment specifies the expected content contained within * this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="strType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "strType" }) @XmlRootElement(name = "GetOnekyRepair_POOL") public class GetOnekyRepairPOOL { protected String strType; /** * Gets the value of the strType property. * * @return possible object is {@link String } * */ public String getStrType() { return strType; } /** * Sets the value of the strType property. * * @param value * allowed object is {@link String } * */ public void setStrType(String value) { this.strType = value; } }
[ "edgaryu@163.com" ]
edgaryu@163.com
2b944c2835f89043af037ba314aa7fe8ad8a885c
06162ab7626c9d0e5fa83ebb4f25bfd7ae34ec86
/src/com/suarez/Challenge2V2.java
9316bc235c77bb395c09c28cf25c50ab8e8352c9
[]
no_license
GreenhillTeacher/Summer2021
5f6e3625d3fa22f087ba17854412bd65ac4a3c99
c7947077f6190655095c0e7478021ce2a31f3d48
refs/heads/master
2022-12-30T01:28:22.378140
2020-06-15T19:23:15
2020-06-15T19:23:15
270,457,845
0
0
null
null
null
null
UTF-8
Java
false
false
2,229
java
package com.suarez; /*This is the program that will print a mirror We are going to use functions and for loops 06/05/2020 Maria Suarez */ public class Challenge2V2 { public static final int SIZE=5; // Declaring a Global Constant public static void main(String[] args) { //main method // This shows how to print something in a line Line(); Top(); Bottom(); Line(); } public static void Top() // This method prints the top shape { for(int line=1; line <SIZE+1; line++){ System.out.print("|"); //this for loop make the spaces before <> spaceUp(line); System.out.print("<>"); //this for loop make the dots between <> for(int dot =1; dot <= 4*line -SIZE+1; dot++) { System.out.print("."); } System.out.print("<>"); spaceUp(line); //make the spaces after <> System.out.println("|"); } } public static void spaceUp(int line){ for(int space=1; space<=-2*line+2*SIZE; space++){ System.out.print(" "); } } public static void Bottom() // This methods print the upper boxes { for(int line=1; line <SIZE+1; line++){ System.out.print("|"); //this for loop make the spaces before <> for(int space=1; space<=2*line-SIZE/2; space++){ System.out.print(" "); } System.out.print("<>"); //this for loop make the dots between <> for(int dot =1; dot <= -4*line +4*SIZE; dot++) { System.out.print("."); } System.out.print("<>"); //this for loop make the spaces after <> for(int space=1; space<=2*line-SIZE/2; space++){ System.out.print(" "); } System.out.println("|"); } } public static void Line() // This method prints the bottom part of the box { System.out.print("#"); // declare var control value increment for(int dash=0; dash<4*SIZE; dash++){ System.out.print("="); } System.out.println("#"); } }
[ "suarezm@greenhill.org" ]
suarezm@greenhill.org
3e0dcfa96868f8231a2f106a67a63642bdd5adef
ddaef60131be194a3521e976699dd5397983667e
/jrSensorEJB/ejbModule/ch/ffhs/sema/controller/SensorDataBean.java
02dfd54036ea5550ef59c1673c76921d0a5639af
[]
no_license
xivia/jrSensor
70a617ba57f00dba1aa7543b800d2f5ac607e3be
9c4f6fe3f3b33d8787ab3655cf63e5c1e15c0b47
refs/heads/master
2020-05-30T13:09:57.609958
2015-06-03T05:05:53
2015-06-03T05:05:53
34,210,444
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package ch.ffhs.sema.controller; import java.sql.Timestamp; import java.util.Calendar; import java.util.Collection; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; import ch.ffhs.sema.model.SensorData; /** * Session Bean implementation class SensorDataBean */ @Stateless public class SensorDataBean implements SensorDataBeanLocal { @PersistenceContext private EntityManager em; @EJB private SensorBeanLocal sensorBean; @EJB private DataTypeBeanLocal dataTypeBean; /** * Default constructor. */ public SensorDataBean() { } @Override public Collection<SensorData> getList() { return em.createNamedQuery("SensorData.findAll",SensorData.class).getResultList(); } @Override public Collection<SensorData> getListBySensor(Long sensorId) { TypedQuery<SensorData> q = em.createNamedQuery("SensorData.findBySensor", SensorData.class); q.setParameter("sensor", sensorBean.getById(sensorId)); return q.getResultList(); } @Override public SensorData getById(Long id) { return em.find(SensorData.class, new Long(id)); } @Override public Long create(Long sensor, Long dataType, String value) { SensorData sensorData = new SensorData(); sensorData.setSensor(sensorBean.getById(sensor)); sensorData.setDatatype(dataTypeBean.getById(dataType)); sensorData.setValue(Double.parseDouble(value)); // set now() sensorData.setTimestamp(new Timestamp(Calendar.getInstance().getTime().getTime())); em.persist(sensorData); em.flush(); return sensorData.getId(); } @Override public void delete(Long id) { SensorData sensorData = getById(id); if (sensorData != null) em.remove(sensorData); em.flush(); } }
[ "roman.born@xivia.ch" ]
roman.born@xivia.ch
29a65a2a115fcc4b3be2f1a519d28b49ef6d5e7c
37c4a8845dd4790f5017357690de792b477d0865
/src/main/java/com/iktpreobuka/eeeDnevnik/controllers/OcenaController.java
025c8f576f6d8e83170e9365bda2ad1100212769
[]
no_license
stefsarikaya/elektronskiDnevnik
3b449886e7152ec68c44e18527e8b88e002df8cc
993f2a8979a2a93665803d710036784623e4a641
refs/heads/master
2023-06-27T20:20:47.619021
2021-08-02T21:15:56
2021-08-02T21:15:56
391,966,125
0
0
null
null
null
null
UTF-8
Java
false
false
5,152
java
/* package com.iktpreobuka.eeeDnevnik.controllers; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.annotation.JsonView; import com.iktpreobuka.eeeDnevnik.controllers.util.RESTError; import com.iktpreobuka.eeeDnevnik.entities.NastavnikEntity; import com.iktpreobuka.eeeDnevnik.entities.NastavnikPredmetOdeljenjeEntity; import com.iktpreobuka.eeeDnevnik.entities.OcenaEntity; import com.iktpreobuka.eeeDnevnik.entities.PredmetEntity; import com.iktpreobuka.eeeDnevnik.entities.RoditeljEntity; import com.iktpreobuka.eeeDnevnik.entities.UcenikEntity; import com.iktpreobuka.eeeDnevnik.entities.dto.OcenaDto; import com.iktpreobuka.eeeDnevnik.models.EmailObject; import com.iktpreobuka.eeeDnevnik.repositories.KorisnikNalogRepository; import com.iktpreobuka.eeeDnevnik.repositories.NastavnikPredmetOdeljenjeRepository; import com.iktpreobuka.eeeDnevnik.repositories.NastavnikRepository; import com.iktpreobuka.eeeDnevnik.repositories.OcenaRepository; import com.iktpreobuka.eeeDnevnik.repositories.PredmetRepository; import com.iktpreobuka.eeeDnevnik.repositories.RoditeljRepository; import com.iktpreobuka.eeeDnevnik.repositories.UcenikRepository; import com.iktpreobuka.eeeDnevnik.security.Views; import com.iktpreobuka.eeeDnevnik.services.EmailService; import com.iktpreobuka.eeeDnevnik.services.OcenaService; @Controller @RestController @RequestMapping(value= "/project/ocena") public class OcenaController { @Autowired private KorisnikNalogRepository korisnikNalogRepository; @Autowired private OcenaRepository ocenaRepository; @Autowired private UcenikRepository ucenikRepository; @Autowired private NastavnikRepository nastavnikRepository; @Autowired private RoditeljRepository roditeljRepository; @Autowired private PredmetRepository predmetRepository; @Autowired private OcenaService ocenaService; @Autowired private EmailService emailService; @Autowired private NastavnikPredmetOdeljenjeRepository nastavnikPredmetOdeljenjeRepository; @JsonView(Views.nastavnik.class) @RequestMapping(method = RequestMethod.POST, value = "/{id}") public ResponseEntity<?> dodajNovuOcenu(@Valid @RequestBody OcenaDto novaOcena, @PathVariable id) { if (novaOcena == null) { return new ResponseEntity<RESTError>(new RESTError(5, "Nova ocena je prazna."), HttpStatus.BAD_REQUEST); } if (novaOcena.getUcenik() == null && novaOcena.getPredmet() == null && novaOcena.getVrednostOcene() == null && novaOcena.getSemestar() == null) { return new ResponseEntity<RESTError>(new RESTError(5, "Neki od podataka su prazni"), HttpStatus.BAD_REQUEST); } OcenaEntity ocena = new OcenaEntity(); try { UcenikEntity ucenik = ucenikRepository.findByIdAndStatusLike(Integer.parseInt(novaOcena.getUcenik()), 1); if (ucenik==null || ucenik.getStatus()!=1) { return new ResponseEntity<RESTError>(new RESTError(4, "Ucenik nije pronadjen."), HttpStatus.NOT_FOUND); } PredmetEntity predmet = predmetRepository.findByIdAndStatusLike(Integer.parseInt(novaOcena.getPredmet()), 1); return new ResponseEntity<RESTError>(new RESTError(4, "Predmet nije p."), HttpStatus.NOT_FOUND); NastavnikEntity nastavnik = nastavnikRepository.findByIdAndStatusLike(id, 1); NastavnikPredmetOdeljenjeEntity nastavnikOdeljneja = nastavnikPredmetOdeljenjeRepository.getByPredajuciNastavnikAndPredajePredmetAndPredajeOdeljenjeAndPredajeRazred(nastavnik, predmet, ucenik); if (nastavnikOdeljneja==null) { return new ResponseEntity<RESTError>(new RESTError(3, "Greška."), HttpStatus.FORBIDDEN); } ocena = ocenaService.dodajNovuOcenu(nastavnik, ucenik, nastavnikOdeljneja, novaOcena); if (ocena != null) { RoditeljEntity r = new RoditeljEntity(); r=ucenik.getRoditelj(); if (r.getStatus() == 1) { EmailObject email = new EmailObject(r.getEmail(), "Nova ocena ucenika " + ucenik.getIme() + " " + ucenik.getPrezime(), "Ucenik " + ucenik.getIme() + " " + ucenik.getPrezime() + " je dobio ocenu " + ocena.getVrednostOcene().toString() + " iz predmeta " + predmet.getImePredmet() + " kod profesora " + nastavnik.getIme() + " " + nastavnik.getPrezime() + "."); emailService.sendSimpleMessage(email); } } return new ResponseEntity<OcenaEntity>(ocena, HttpStatus.OK); } catch (NumberFormatException e) { return new ResponseEntity<RESTError>(new RESTError(2, "Greška u formatu (brojčana) "+ e.getLocalizedMessage()), HttpStatus.NOT_ACCEPTABLE); } catch (Exception e) { return new ResponseEntity<RESTError>(new RESTError(1, "Došlo je do greške: "+ e.getLocalizedMessage()), HttpStatus.INTERNAL_SERVER_ERROR); } } */
[ "djordjevic.stefan951@gmail.com" ]
djordjevic.stefan951@gmail.com
3d71efe71d7342509ccb0dec05bc510cd763d726
4fab46d451f7c0e1ca2b37c2441bc1405e91fc4a
/TempleAttack/src/view/Main.java
1a7a083bacb244f14c104c097aff8072858415fd
[ "MIT" ]
permissive
goldenc1/TempleAttack
4eeb9e3160b4994aae0203d6b7fb1c2395475580
0eb34217049c6591263db75aa2d770f5449f4e75
refs/heads/master
2021-04-29T18:15:38.515027
2018-05-08T01:27:07
2018-05-08T01:27:07
121,689,564
0
0
null
null
null
null
UTF-8
Java
false
false
1,133
java
package view; import javafx.application.Application; import javafx.stage.Stage; import view.SceneManager; import javafx.scene.Scene; import javafx.scene.Group; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; import javafx.scene.image.Image; import javafx.animation.AnimationTimer; import javafx.event.EventHandler; import javafx.scene.input.MouseEvent; import javafx.scene.layout.StackPane; import java.util.ArrayList; /** * @program Temple Attack * * @author Charles Golden II * * @version 1.0 * * @returns nothing **/ public class Main extends Application{ public static final int SIZE_W = 1050; public static final int SIZE_H = 400; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Temple Attack"); SceneManager sceneManager = new SceneManager(primaryStage); sceneManager.goToMenuScene(sceneManager); } }
[ "zjhaddad@email.arizona.edu" ]
zjhaddad@email.arizona.edu
c1161400cf4d7f58a2b9a8d252f195a6d4b535cb
51a4a6f4155ef99f9742953a34eada0c2f4d3649
/src/com/datax/util/DateUtil.java
6818f07e4c3b2018bb177ccf6da244178c31c3fa
[]
no_license
jiaqiang1026/flume-dc2
946994bf7b9c15f013358ffbefe5f1b1eb70d85c
2f0fb1995628142c4710e66325edbb18b291c872
refs/heads/master
2021-01-19T01:37:10.824011
2016-06-15T05:43:12
2016-06-15T05:43:12
61,180,692
0
0
null
null
null
null
UTF-8
Java
false
false
5,884
java
package com.datax.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; import org.apache.log4j.Logger; /** * 时间处理工具类 * @author jiaqiang * @date 2013.13.23 */ public class DateUtil { private static Logger log = Logger.getLogger(DateUtil.class); /** * 对日期进行格式化 * @param pattern 模式 * @param d 日期 * @return */ public static String format(String pattern, Date d) { String rtn = null; try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); rtn = sdf.format(d); } catch (Exception ex) { log.debug("解析日期异常", ex); ex.printStackTrace(); rtn = null; } return rtn; } public static Date parse(String pattern, String str) { Date d = null; try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); d = sdf.parse(str); } catch (Exception ex) { log.debug("解析日期异常", ex); d = null; } return d; } public static Date parse(String pattern, Locale l, String str) { Date d = null; try { SimpleDateFormat sdf = new SimpleDateFormat(pattern, l); d = sdf.parse(str); } catch (Exception ex) { log.debug("解析日期异常", ex); d = null; } return d; } public static String yesterday(String pattern) { Calendar c = Calendar.getInstance(); c.add(Calendar.DAY_OF_MONTH, -1); return format(pattern, c.getTime()); } public static int getCurrHour() { Calendar c = Calendar.getInstance(); return c.get(Calendar.HOUR_OF_DAY); } //获取日期带小时,格式:"yyyy-MM-dd HH" public static String getDateHour() { return format("yyyy-MM-dd HH", new Date()); } //获取日期带小时,格式:"yyyy-MM-dd HH" public static String getDateHour(Date d) { return format("yyyy-MM-dd HH", d); } //获取日期带小时,格式:"yyyy-MM-dd HH" public static String getDateHour(String pattern, String date) { return format("yyyy-MM-dd HH", parse(pattern,date)); } //获取dateHour对应的下一个 日期小时 //currDateHour格式是yyyy-MM-dd HH public static String nextDateHour(String currDateHour) { Date d = parse("yyyy-MM-dd HH", currDateHour); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.HOUR_OF_DAY, 1); return format("yyyy-MM-dd HH", c.getTime()); } //获取dateHour对应的下一个 日期小时 //currDateHour格式是yyyy-MM-dd HH public static String nextDateHour(String pattern, String currDateHour) { Date d = parse(pattern, currDateHour); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.HOUR_OF_DAY, 1); return format(pattern, c.getTime()); } //获取dateHour对应的下一个 日期小时 //param:currDateHour格式是yyyy-MM-dd HH //param: back后退小时数 public static String backDateHour(String currDateHour, int back) { Date d = parse("yyyy-MM-dd HH", currDateHour); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.HOUR_OF_DAY, -back); return format("yyyy-MM-dd HH", c.getTime()); } //获取dateHour对应的下一个 日期小时 //param:currDateHour格式是yyyy-MM-dd HH //param: back后退小时数 public static String preDateHour(String pattern, String currDateHour, int back) { Date d = parse(pattern, currDateHour); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.HOUR_OF_DAY, -back); return format(pattern, c.getTime()); } /** * 获取currDate的前back天日期, * @param currDate 格式:yyyy-MM-dd * @param back 回退天数 * @return yyyy-MM-dd格式的日期 */ public static String preDate(String currDate, int back) { Date d = parse("yyyy-MM-dd", currDate); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.DAY_OF_MONTH, -back); return format("yyyy-MM-dd", c.getTime()); } /** * 获取currDate的前back天日期 * @param pattern 日期格式 * @param currDate 格式:yyyy-MM-dd * @param back 回退天数 * @return yyyy-MM-dd格式的日期 */ public static String preDate(String pattern, String currDate, int back) { Date d = parse(pattern, currDate); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.DAY_OF_MONTH, -back); return format(pattern, c.getTime()); } //获取date对应的下一个 日期 //currDate格式是yyyy-MM-dd public static String nextDate(String currDate) { Date d = parse("yyyy-MM-dd", currDate); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.DAY_OF_MONTH, 1); return format("yyyy-MM-dd", c.getTime()); } //currDate格式是yyyy-MM-dd public static String nextDate(String pattern, String currDate) { Date d = parse(pattern, currDate); Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.DAY_OF_MONTH, 1); return format(pattern, c.getTime()); } public static void sleep(int seconds) { try { Thread.currentThread().sleep(seconds * 1000); } catch (InterruptedException e) { } } public static void main(String[] args) throws ParseException { // System.out.println(DateUtil.format("yyyy-MM-dd HH", new Date())); // System.out.println(DateUtil.parse("yyyy-MM-dd", "2013-12-23")); // System.out.println(DateUtil.getCurrHour()); // System.out.println(DateUtil.nextDateHour("2014-01-07 23")); //System.out.println(DateUtil.backDateHour("2014-01-07 00", 1)); //System.out.println(DateUtil.format("yyyy-MM-dd HH:mm:ss", new Date())); String s = "25/Nov/2014:18:52:39 +0800"; // String s = "25/Nov/2014:18:52:39"; SimpleDateFormat format = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss", Locale.ENGLISH); // format.setTimeZone(TimeZone.getTimeZone("GMT+8")); Date d = format.parse(s); System.out.println(DateUtil.format("yyyyMMdd HH:mm:ss", d)); } }
[ "jiaqiang1026@sina.com" ]
jiaqiang1026@sina.com
13bef4ef68a3f669810058697171420dbd95825e
4694d36492acad39b6464d153e4d3d3ad47c5c57
/adcom/adbnsptnr.server/src/main/java/org/adorsys/adbnsptnr/jpa/BpPtnrRole.java
6f5c9835f59552ba53b359a6c23c6969a0172bd3
[ "Apache-2.0" ]
permissive
francis-pouatcha/adcom
36ac7ff33eabb351be78b5555c61498b7bc3de6f
0e3ea1ce6c2045d31c7003fc87dbda533c09c767
refs/heads/master
2021-03-27T20:31:45.315016
2015-06-29T09:32:06
2015-06-29T09:32:06
28,821,594
0
0
null
null
null
null
UTF-8
Java
false
false
772
java
package org.adorsys.adbnsptnr.jpa; import org.adorsys.javaext.description.Description; @Description("BpPtnrRole_description") public enum BpPtnrRole { @Description("BpPtnrRole_CUSTOMER_description") CUSTOMER, @Description("BpPtnrRole_SUPPLIER_description") SUPPLIER, @Description("BpPtnrRole_EMPLOYER_description") EMPLOYER, @Description("BpPtnrRole_STAFF_description") STAFF, @Description("BpPtnrRole_MANUFACTURER_description") MANUFACTURER, @Description("BpPtnrRole_GOVERNMENT_description") GOVERNMENT, @Description("BpPtnrRole_BROKER_description") BROKER, @Description("BpPtnrRole_SHAREHOLDER_description") SHAREHOLDER, @Description("BpPtnrRole_BANKER_description") BANKER, @Description("BpPtnrRole_INSURANCE_description") INSURANCE }
[ "francis.pouatcha@adorsys.com" ]
francis.pouatcha@adorsys.com
389b47023684fb07eb22ec6912d094f72925b7b6
63adf52e68af20f62e6ea2e9e784fb11594bef4d
/src/main/java/com/flipdish/apiclient/model/LastPaymentError.java
354db0a4907df05315277f4ae58cd7b489e56165
[]
no_license
flipdishbytes/api-client-java
bb428c9f4e12a04eb5f260e41f1f5ae22796afd9
354530742cb4ac659549e02264d16e1b3e38cc51
refs/heads/master
2023-08-17T03:31:09.637914
2023-08-15T11:07:15
2023-08-15T11:07:15
171,709,047
0
0
null
2022-06-27T07:48:34
2019-02-20T16:29:23
Java
UTF-8
Java
false
false
4,197
java
/* * Flipdish Open API v1.0 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.flipdish.apiclient.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; /** * List&#39;s the issues with the last failed payment intent */ @ApiModel(description = "List's the issues with the last failed payment intent") @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2023-08-15T12:07:08.951+01:00") public class LastPaymentError { @SerializedName("Code") private String code = null; @SerializedName("DeclineCode") private String declineCode = null; @SerializedName("Message") private String message = null; public LastPaymentError code(String code) { this.code = code; return this; } /** * For some errors that could be handled programmatically, a short string indicating the error code reported. * @return code **/ @ApiModelProperty(value = "For some errors that could be handled programmatically, a short string indicating the error code reported.") public String getCode() { return code; } public void setCode(String code) { this.code = code; } public LastPaymentError declineCode(String declineCode) { this.declineCode = declineCode; return this; } /** * For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one. * @return declineCode **/ @ApiModelProperty(value = "For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one.") public String getDeclineCode() { return declineCode; } public void setDeclineCode(String declineCode) { this.declineCode = declineCode; } public LastPaymentError message(String message) { this.message = message; return this; } /** * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. * @return message **/ @ApiModelProperty(value = "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.") public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LastPaymentError lastPaymentError = (LastPaymentError) o; return Objects.equals(this.code, lastPaymentError.code) && Objects.equals(this.declineCode, lastPaymentError.declineCode) && Objects.equals(this.message, lastPaymentError.message); } @Override public int hashCode() { return Objects.hash(code, declineCode, message); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LastPaymentError {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" declineCode: ").append(toIndentedString(declineCode)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "noreply@flipdish.com" ]
noreply@flipdish.com
a75a56139c262e21836f0810622edd1d2faefa1d
d7c0bf34092781a9efb5ce19e28b00db2f029c3d
/src/gamesimulation/weapon/Weapon.java
5f8414c64d637d6e085be98b4b14e79b666627fb
[]
no_license
santiyunikas/GameSimulation
16ec133b670912101513916a1237f4a8fcd49365
931f3430a8e5f2585080e619d0f6d88fc2ea4797
refs/heads/master
2020-05-19T02:41:48.913290
2019-05-03T16:23:54
2019-05-03T16:23:54
184,785,236
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package gamesimulation.weapon; /** * * @author Shanty YS */ public interface Weapon { void pick(); String getName(); }
[ "santiyunikas@gmail.com" ]
santiyunikas@gmail.com
61cf03c615bf41437e6bf9db48ef7a83efcba762
7e0f5925427ebd2f2faf5e613187339ed70e0450
/PicassoSample/app/src/main/java/com/think/linxuanxuan/picassosample/volleybox/CacheDispatcher.java
2fab5a5320c9bd0ba7c5cc1c54660edc73deb2a6
[]
no_license
LxxCaroline/VolleySample
00fe8aace9fafd04b92be450a15376edd5f00a38
ad3586aaa8a2f17edb9ee7306fd44d3564b9ba2a
refs/heads/master
2021-03-12T20:02:49.898111
2015-10-26T03:05:02
2015-10-26T03:05:02
43,275,200
1
0
null
null
null
null
UTF-8
Java
false
false
6,006
java
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.think.linxuanxuan.picassosample.volleybox; import android.os.Process; import java.util.concurrent.BlockingQueue; /** * Provides a thread for performing cache triage on a queue of requests. * * Requests added to the specified cache queue are resolved from cache. * Any deliverable response is posted back to the caller via a * {@link ResponseDelivery}. Cache misses and responses that require * refresh are enqueued on the specified network queue for processing * by a {@link NetworkDispatcher}. */ public class CacheDispatcher extends Thread { private static final boolean DEBUG = VolleyLog.DEBUG; /** The queue of requests coming in for triage. */ private final BlockingQueue<Request<?>> mCacheQueue; /** The queue of requests going out to the network. */ private final BlockingQueue<Request<?>> mNetworkQueue; /** The cache to read from. */ private final Cache mCache; /** For posting responses. */ private final ResponseDelivery mDelivery; /** Used for telling us to die. */ private volatile boolean mQuit = false; /** * Creates a new cache triage dispatcher thread. You must call {@link #start()} * in order to begin processing. * * @param cacheQueue Queue of incoming requests for triage * @param networkQueue Queue to post requests that require network to * @param cache Cache interface to use for resolution * @param delivery Delivery interface to use for posting responses */ public CacheDispatcher(BlockingQueue<Request<?>> cacheQueue, BlockingQueue<Request<?>> networkQueue, Cache cache, ResponseDelivery delivery) { mCacheQueue = cacheQueue; mNetworkQueue = networkQueue; mCache = cache; mDelivery = delivery; } /** * Forces this dispatcher to quit immediately. If any requests are still in * the queue, they are not guaranteed to be processed. */ public void quit() { mQuit = true; interrupt(); } @Override public void run() { if (DEBUG) VolleyLog.v("start new dispatcher"); Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); // Make a blocking call to initialize the cache. mCache.initialize(); while (true) { try { // Get a request from the cache triage queue, blocking until // at least one is available. final Request<?> request = mCacheQueue.take(); request.addMarker("cache-queue-take"); // If the request has been canceled, don't bother dispatching it. if (request.isCanceled()) { request.finish("cache-discard-canceled"); continue; } // Attempt to retrieve this item from cache. Cache.Entry entry = mCache.get(request.getCacheKey()); if (entry == null) { request.addMarker("cache-miss"); // Cache miss; send off to the network dispatcher. mNetworkQueue.put(request); continue; } // If it is completely expired, just send it to the network. if (entry.isExpired()) { request.addMarker("cache-hit-expired"); request.setCacheEntry(entry); mNetworkQueue.put(request); continue; } // We have a cache hit; parse its data for delivery back to the request. request.addMarker("cache-hit"); Response<?> response = request.parseNetworkResponse( new NetworkResponse(entry.data, entry.responseHeaders)); request.addMarker("cache-hit-parsed"); if (!entry.refreshNeeded()) { // Completely unexpired cache hit. Just deliver the response. mDelivery.postResponse(request, response); } else { // Soft-expired cache hit. We can deliver the cached response, // but we need to also send the request to the network for // refreshing. request.addMarker("cache-hit-refresh-needed"); request.setCacheEntry(entry); // Mark the response as intermediate. response.intermediate = true; // Post the intermediate response back to the user and have // the delivery then forward the request along to the network. mDelivery.postResponse(request, response, new Runnable() { @Override public void run() { try { mNetworkQueue.put(request); } catch (InterruptedException e) { // Not much we can do about this. } } }); } } catch (InterruptedException e) { // We may have been interrupted because it was time to quit. if (mQuit) { return; } continue; } } } }
[ "hzlinxuanxuan@copr.netease.com" ]
hzlinxuanxuan@copr.netease.com
475aa067baba07c5e78fd983ad4404532741b7c5
b9f14ab5807b863f07ecb41f772bc87c6255842c
/PostcodeTool/src/main/java/com/ptool/topojson/Topology.java
d0bd979d519c6d18e526a588b9467003c73f0ad3
[]
no_license
ghostwolf300/SalesAnalyzer
fe54566d564ed685c4bb74e022f1ca95efad19d5
7ed0552da7899259bf68703d2f99f2a6065ddd27
refs/heads/master
2020-04-02T16:34:46.346851
2018-10-26T12:51:07
2018-10-26T12:51:07
154,618,858
0
0
null
null
null
null
UTF-8
Java
false
false
92
java
package com.ptool.topojson; public class Topology { private double bbox[]; }
[ "ville.susi@WAUTVANWS476.wihuri.local" ]
ville.susi@WAUTVANWS476.wihuri.local
3be11d5cd3924f5f5e1100286231c96719f051f5
507d56ae2c19b7f0f01d8d54be88e317d8accf1b
/ExpressaoTiny/Expressao.java
d0c12d55b390c72ba57b113ef8df3fb4c90c7e76
[]
no_license
julianogpc/Tiny-Java
f0188033922fe12e8378bd4cd4ee91d207b6cfe2
8342350a55a250002e9f47298086df8ab59eb012
refs/heads/master
2021-01-25T12:08:32.380215
2015-08-31T22:42:59
2015-08-31T22:42:59
41,704,243
0
0
null
null
null
null
UTF-8
Java
false
false
156
java
package ExpressaoTiny; //------------Classe Abstrata Expressao---------------------- public abstract class Expressao { public abstract int intAvalia(); }
[ "julianogpc@gmail.com" ]
julianogpc@gmail.com
1bab4d39e6704688639315918b79ab5eafe65565
e2d6a63b62c819c44fc95a14579f1d1c0cce914d
/app/src/main/java/cms/co/in/kat/fragment/FragmentProfile.java
4c5ca9e20b8ff4df88f177e336dce3f24ccb014f
[]
no_license
TechMohit/NoVersion-kat-0ca79e4cfb2e
1bf6776bb61b64282c886e301722d00f5228a654
6ea2f13300245a73360c101793749f5f550ccef2
refs/heads/master
2020-04-15T04:24:23.631621
2019-01-07T05:31:40
2019-01-07T05:31:55
164,379,709
0
0
null
null
null
null
UTF-8
Java
false
false
10,897
java
package cms.co.in.kat.fragment; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.text.Html; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.cms.kat.cws.R; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Text; import java.util.HashMap; import cms.co.in.kat.activity.ChangePassword; import cms.co.in.kat.activity.ContactUs; import cms.co.in.kat.activity.DashBoardCaseList; import cms.co.in.kat.activity.LoginHome; import cms.co.in.kat.asynchronous.Volley; import cms.co.in.kat.customview.expandablelayout.ExpandableLayout; import cms.co.in.kat.database.DatabaseHandler; import cms.co.in.kat.interfaces.VolleyListner; import cms.co.in.kat.utils.Constant; import cms.co.in.kat.utils.GeneralUtilities; import cms.co.in.kat.utils.InternetCheck; import cms.co.in.kat.utils.ShowDilog; import cms.co.in.kat.utils.URLConstants; import static android.content.Context.MODE_PRIVATE; public class FragmentProfile extends Fragment implements View.OnClickListener { private LoginHome context; private LinearLayout parentLayout; private Button passChange, verify; private TextView txtUserName; private String salutation = "", email = "", middleName = "", firstName = "", lastName = "", state = "", city = "", pincode = "", division = "", adress = "", subDivision = "", mobileNo = "", district = "", taluka = "",userName=""; private EditText etSalutation, etFirstN, etMiddleN, etLastN, etPhone, etEmail, etAdress, etCity, etState, etPincode; private boolean emailVeify = false, mobileVerify = false; @NonNull private URLConstants urlConstants = new URLConstants(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_profile, container, false); //getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); initLayout(v); initListner(); String userid = null; try { SharedPreferences prefs = context.getSharedPreferences(Constant.MY_PREF_PROFILE, MODE_PRIVATE); userid = prefs.getString(Constant.MY_PREF_USERID, null); userName= prefs.getString(Constant.MY_PREF_USERNAME, null); txtUserName.setText(""+userName); } catch (Exception e) { e.printStackTrace(); } HashMap<String, String> params = new HashMap<>(); params.put("userId", userid); Constant.CURRENT_TAG = urlConstants.USER_DETAIL_TAG; volly(Constant.CURRENT_TAG, Request.Method.POST, urlConstants.USER_DETAIL_URL, params); context.toolBarName("My Profile"); return v; } private void initListner() { passChange.setOnClickListener(this); verify.setOnClickListener(this); } private void initLayout(View v) { parentLayout = (LinearLayout) v.findViewById(R.id.parentLayout); passChange = (Button) v.findViewById(R.id.pass_change); verify = (Button) v.findViewById(R.id.btn_verify); etSalutation = (EditText) v.findViewById(R.id.et_salutation); etFirstN = (EditText) v.findViewById(R.id.et_fName); etMiddleN = (EditText) v.findViewById(R.id.et_mName); etLastN = (EditText) v.findViewById(R.id.et_lName); etEmail = (EditText) v.findViewById(R.id.et_email); etPhone = (EditText) v.findViewById(R.id.et_phone); etAdress = (EditText) v.findViewById(R.id.et_adress); etCity = (EditText) v.findViewById(R.id.et_city); etState = (EditText) v.findViewById(R.id.et_state); etPincode = (EditText) v.findViewById(R.id.et_pincode); txtUserName=(TextView)v.findViewById(R.id.txt_user_name); } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof Activity) { this.context = (LoginHome) context; } } @Override public void onDetach() { super.onDetach(); } @Override public void onClick(View v) { if (ShowDilog.internet) { Intent i; switch (v.getId()) { case R.id.pass_change: i = new Intent(context, ChangePassword.class); startActivity(i); break; case R.id.btn_verify: if(!mobileVerify){ // HashMap<String, String> params = new HashMap<>(); // params.put("userId", userid); // Constant.CURRENT_TAG = urlConstants.USER_DETAIL_TAG; // volly(Constant.CURRENT_TAG, Request.Method.POST, urlConstants.USER_DETAIL_URL, params); } break; } } else { GeneralUtilities.showMessage(context, parentLayout, getResources().getString(R.string.internet)); new InternetCheck(context).execute(); } } private void volly(final String tag, int get, String link, HashMap<String, String> params) { Volley vl = new Volley(context); vl.makeStringReq(tag, get, link, params, new VolleyListner() { @Override public void onVolleyRespondJSONObject(JSONObject result) { } @Override public void onVolleyRespondJSONArray(JSONArray result) { } @Override public void onVolleyRespondString(int result, @NonNull String response) { Log.e("*****", "** response profile detail *** " + response); if (tag == urlConstants.USER_DETAIL_TAG) { if (result == 1) { try { JSONArray jArr = new JSONObject(response).getJSONArray("data_result"); try { email = jArr.getJSONObject(0).getJSONObject("email").getString("emailId"); emailVeify = jArr.getJSONObject(0).getJSONObject("email").getBoolean("emailAddressVerfied"); middleName = jArr.getJSONObject(0).getString("middleName"); firstName = jArr.getJSONObject(0).getString("firstName"); lastName = jArr.getJSONObject(0).getString("lastName"); salutation = jArr.getJSONObject(0).getString("salutation"); } catch (JSONException e) { e.printStackTrace(); } try { state = jArr.getJSONObject(0).getString("state"); Log.d("statetest",""+state); pincode = jArr.getJSONObject(0).getString("pincode"); division = jArr.getJSONObject(0).getString("division"); subDivision = jArr.getJSONObject(0).getString("subDivision"); district = jArr.getJSONObject(0).getString("district"); taluka = jArr.getJSONObject(0).getString("taluk"); } catch (Exception e) { e.printStackTrace(); } try { mobileNo = jArr.getJSONObject(0).getJSONObject("mobile").getString("mobileNo"); mobileVerify = jArr.getJSONObject(0).getJSONObject("mobile").getBoolean("otpVerified"); city = jArr.getJSONObject(0).getString("city"); adress = jArr.getJSONObject(0).getString("address"); } catch (Exception e) { e.printStackTrace(); } } catch (Exception e) { e.printStackTrace(); } updateValue(); // GeneralUtilities.showMessage(context, parentLayout, response); } else { GeneralUtilities.showMessage(context, parentLayout, response); } } else { GeneralUtilities.showMessage(context, parentLayout, " Please try again"); } } @Override public void onVolleyError(String result) { GeneralUtilities.showMessage(context, parentLayout, " Please try again"); } }); } private void updateValue() { etSalutation.setText("" + salutation); etEmail.setText("" + email); GeneralUtilities gr = new GeneralUtilities(context); if (mobileVerify) { // verify.setVisibility(View.INVISIBLE); etPhone.setText(Html.fromHtml(gr.colorText(mobileNo, " Verified", getResources().getColor(R.color.green_cs)))); } else { // verify.setVisibility(View.VISIBLE); etPhone.setText(Html.fromHtml(gr.colorText(mobileNo, " NotVerify", getResources().getColor(R.color.red)))); } etFirstN.setText("" + firstName); etLastN.setText("" + lastName); etMiddleN.setText("" + middleName); etAdress.setText("" + adress); etPincode.setText("" + pincode); etCity.setText("" + city); etState.setText("" + state); } // String temp = "{\"message\":\"Success\",\"status\":\"1\",\"data_result\":[{\"middleName\":\"kumar\"," + // "\"lastName\":\"naik\",\"state\":\"karnataka\",\"city\":\"bangalore\",\"pincode\":560201,\"" + // "division\":\"hsr\",\"email\":{\"emailId\":\"subamnaik15@gmail.com\",\"emailAddressVerfied\":true}" + // ",\"address\":\"hsr layout\",\"subDivision\":\"bangalore\",\"firstName\":\"subham\",\"district\"" + // ":\"bangalore\",\"taluk\":\"bangalore\",\"mobile\":{\"otpVerified\":false,\"mobileNo\":\"9632209789\"}}]}\n"; }
[ "mohitraj999@gmail.com" ]
mohitraj999@gmail.com
117a2d4497468bde3920b2be848d920fbba28a3d
4374863ac0bd54a877ada42aacfa7f6849125a86
/keep-account-start/src/test/java/com/bupt/dc/dao/jdbc/MultiDataSourceTest.java
270c8da52ef3181a9e85eb016764a2ed6dcc60db
[]
no_license
dcbupt/keep-account
e8911bd5c66a33a35ac2549ec7e7f674285306a8
e61fe7198fc5271a50eb8e202f3eb4aa84bb2967
refs/heads/master
2022-07-08T23:36:30.671757
2019-10-21T09:58:32
2019-10-21T09:58:32
172,438,313
0
0
null
2022-06-21T00:57:01
2019-02-25T05:10:42
Java
UTF-8
Java
false
false
2,132
java
//package com.bupt.dc.dao.jdbc; // //import com.bupt.dc.start.KeepAccountStartApplication; //import org.junit.Assert; //import org.junit.Before; //import org.junit.Test; //import org.junit.runner.RunWith; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Qualifier; //import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.jdbc.core.JdbcTemplate; //import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; // //import java.util.Date; // //@RunWith(SpringJUnit4ClassRunner.class) //@SpringBootTest(classes = {KeepAccountStartApplication.class}) //public class MultiDataSourceTest { // // @Autowired // @Qualifier("primaryJdbcTemplate") // protected JdbcTemplate jdbcTemplate1; // // @Autowired // @Qualifier("secondaryJdbcTemplate") // protected JdbcTemplate jdbcTemplate2; // // @Before // public void setUp() { // jdbcTemplate1.update("DELETE FROM USER "); // //jdbcTemplate2.update("DELETE FROM USER "); // } // // @Test // public void test() throws Exception { // // // 往第一个数据源中插入两条数据 // jdbcTemplate1.update("insert into user(id,username, password, create_date) values(?, ?, ?, ?)", 1, "aaa", "123", new Date()); // jdbcTemplate1.update("insert into user(id,username, password, create_date) values(?, ?, ?, ?)", 2, "bbb", "456", new Date()); // // // 往第二个数据源中插入一条数据,若插入的是第一个数据源,则会主键冲突报错 // //jdbcTemplate2.update("insert into user(id,name,age,date) values(?, ?, ?, ?)", 1, "aaa", 20, new Date()); // // // 查一下第一个数据源中是否有两条数据,验证插入是否成功 // Assert.assertEquals("2", jdbcTemplate1.queryForObject("select count(1) from user", String.class)); // // // 查一下第一个数据源中是否有两条数据,验证插入是否成功 // //Assert.assertEquals("1", jdbcTemplate2.queryForObject("select count(1) from user", String.class)); // // } // //}
[ "dengcan.dc@alibaba-inc.com" ]
dengcan.dc@alibaba-inc.com
04a30df1b6e6d29789cdf0cfee0426b1975f6363
c572be7c23eade4eb5f0a56710e292c8eaf5e55d
/CloudTesco/src/com/insthub/ecmobile/adapter/C3_DistributionAdapter.java
9ddfe5a3679471edfc7bd5f2de74b08ccc5081b5
[]
no_license
xinlizhang/yunyg_android
ad11e1f8101f918fb5e386bc8d1a3f868d4b646b
eb06224ce810b1930b25e7d1e3fe64d250348918
refs/heads/master
2021-01-22T04:23:46.469411
2017-09-22T12:17:37
2017-09-22T12:17:37
92,461,167
0
0
null
null
null
null
UTF-8
Java
false
false
2,039
java
package com.insthub.ecmobile.adapter; import java.util.HashMap; import java.util.List; import java.util.Map; import com.insthub.ecmobile.R; import com.insthub.ecmobile.activity.F2_EditAddressActivity; import com.insthub.ecmobile.adapter.F0_AddressListAdapter.ViewHolder; import com.insthub.ecmobile.protocol.ADDRESS; import com.insthub.ecmobile.protocol.PAYMENT; import com.insthub.ecmobile.protocol.SHIPPING; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class C3_DistributionAdapter extends BaseAdapter { private Context context; private List<SHIPPING> list; private LayoutInflater inflater; public C3_DistributionAdapter(Context context, List<SHIPPING> list) { this.context = context; this.list = list; inflater = LayoutInflater.from(context); } @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return list.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder holder; if(convertView == null) { holder = new ViewHolder(); convertView = inflater.inflate(R.layout.c2_payment_cell, null); holder.name = (TextView) convertView.findViewById(R.id.payment_item_name); holder.fee = (TextView) convertView.findViewById(R.id.payment_item_fee); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.name.setText(list.get(position).shipping_name); holder.fee.setText(list.get(position).format_shipping_fee); return convertView; } class ViewHolder { private TextView name; private TextView fee; } }
[ "314625896@qq.com" ]
314625896@qq.com
e31b88100872ef67e86cefed8e657f595b0a1891
3b91ed788572b6d5ac4db1bee814a74560603578
/com/tencent/mm/model/c$6.java
a9c94dff02f9789a6c7496e4f6fc1967a4020246
[]
no_license
linsir6/WeChat_java
a1deee3035b555fb35a423f367eb5e3e58a17cb0
32e52b88c012051100315af6751111bfb6697a29
refs/heads/master
2020-05-31T05:40:17.161282
2018-08-28T02:07:02
2018-08-28T02:07:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
202
java
package com.tencent.mm.model; import com.tencent.mm.bt.h.d; import com.tencent.mm.storage.h; class c$6 implements d { c$6() { } public final String[] xb() { return h.diD; } }
[ "707194831@qq.com" ]
707194831@qq.com
0627613f3edd58660f0402ca407347f13e3d4637
ed4a6183318ae0e1236bcd916290ac6f4cf1d2f8
/youlai-gateway/src/main/java/com/youlai/gateway/config/WhiteListConfig.java
a8c0bab463d4474ff55c5cdfa9cf98f760542806
[ "Apache-2.0" ]
permissive
PanPanda/youlai-mall
fdae0fd62f796d9efe9ac75927fac74271aca28c
044bdfb031d14ed8fd8086fae372cd2924544002
refs/heads/master
2023-03-15T07:55:36.521737
2021-03-23T08:27:09
2021-03-23T08:27:09
345,901,318
1
0
Apache-2.0
2021-03-23T08:24:45
2021-03-09T06:07:51
Java
UTF-8
Java
false
false
379
java
package com.youlai.gateway.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; import java.util.List; /** * 白名单配置 */ @Data @Configuration @ConfigurationProperties(prefix = "whitelist") public class WhiteListConfig { private List<String> urls; }
[ "1490493387@qq.com" ]
1490493387@qq.com
bdb15c05defd683cf4fec1e5e9d5e4bf35961bac
82f75099fb6679aef1909a19cba7ed7f49b8ff40
/src/main/java/nl/saxofoonleren/dropitapi/DropitApiApplication.java
3cc2f25adf73f662d01ea03aa937204d540fbc1b
[]
no_license
EdeJ/dropit-api
b275320fc962fdfce68367a54a89d7a9304ff781
1b09287466ade51423213cd42eb9e450b7982f46
refs/heads/master
2023-02-10T11:59:10.072387
2021-01-11T18:51:44
2021-01-11T18:51:44
325,760,373
0
0
null
null
null
null
UTF-8
Java
false
false
325
java
package nl.saxofoonleren.dropitapi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DropitApiApplication { public static void main(String[] args) { SpringApplication.run(DropitApiApplication.class, args); } }
[ "emieldejong@xs4all.nl" ]
emieldejong@xs4all.nl
16d4f7377d2c35f941403c193eb575991a53bbc5
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.ocms-OCMS/sources/com/oculus/android/os/internal/UserHandleInternal.java
b16666121396b33971205fbf100091d4e3487f65
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
786
java
package com.oculus.android.os.internal; import android.os.UserHandle; import com.facebook.infer.annotation.SuppressLint; public class UserHandleInternal { @SuppressLint({"ImprovedNewApi"}) public UserHandle getAll() { return UserHandle.ALL; } @SuppressLint({"ImprovedNewApi"}) public UserHandle getSystem() { return UserHandle.SYSTEM; } @SuppressLint({"InstanceMethodCanBeStatic"}) public UserHandle of(int i) { return UserHandle.of(i); } @SuppressLint({"InstanceMethodCanBeStatic"}) public int getIdentifier(UserHandle userHandle) { return userHandle.getIdentifier(); } @SuppressLint({"InstanceMethodCanBeStatic"}) public int getAppId(int i) { return UserHandle.getAppId(i); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
f6e24e4fe2631211024a2f4c2181134cd0ba7905
f6adfce21fa6ad1b1a26ede927ab9a59bc6ebcef
/src/main/java/com/hwq/fundament/JavaDataStructure/linkedList/DoubleLinkedListDemo.java
3bbc20f3958ed5bba1286f57ace8d27ae350fa52
[ "Apache-2.0" ]
permissive
Evil-king/Fundament
1a992e465d857975d0f90f0cee4f1e39137d1bd4
fed065ae8dde740f008d3f1c97f9ad63f0f539d1
refs/heads/master
2022-10-31T22:05:58.938736
2022-10-21T12:37:50
2022-10-21T12:37:50
154,928,494
1
0
Apache-2.0
2022-06-17T02:00:46
2018-10-27T05:14:02
Java
UTF-8
Java
false
false
6,274
java
package com.hwq.fundament.JavaDataStructure.linkedList; /** * @Auther: Administrator * @Date: 2020/2/26 0026 18:27 * @Description:双向链表 基本思路和单项链表差不多 * 需要注意的有删除 */ public class DoubleLinkedListDemo { public static void main(String[] args) { //创建节点 HeroNode2 heroNode1 = new HeroNode2(1, "宋江", "及时雨"); HeroNode2 heroNode2 = new HeroNode2(2, "吴用", "智多星"); HeroNode2 heroNode3 = new HeroNode2(3, "卢珏易", "玉麒麟"); HeroNode2 heroNode4 = new HeroNode2(4, "林冲", "豹子头"); //创建一个双向链表 DoubleLinkedList doubleLinkedList = new DoubleLinkedList(); doubleLinkedList.add(heroNode1); doubleLinkedList.add(heroNode2); doubleLinkedList.add(heroNode3); doubleLinkedList.add(heroNode4); doubleLinkedList.list(); //修改 HeroNode2 newHeroNode = new HeroNode2(4, "公孙胜", "入云龙"); doubleLinkedList.update(newHeroNode); System.out.println("修改后的链表~~~~"); doubleLinkedList.list(); //删除 doubleLinkedList.delete(4); System.out.println("删除后的链表~~~~"); doubleLinkedList.list(); } static class DoubleLinkedList{ //初始化一个头节点,头节点不要动,不存放具体数据的 private HeroNode2 head = new HeroNode2(0, "", ""); //返回头结点 public HeroNode2 getHead() { return head; } //遍历双向链表的方法 //显示链表[遍历] public void list() { //判断链表是否为空 if (head.next == null) { System.out.println("遍历时链表为空~"); return; } HeroNode2 temp = head.next; while (true) { //判断是否到链表最后 if (temp == null) { break; } //输出节点信息 System.out.println(temp); //将temp后移,一定要记得 temp = temp.next; } } //添加节点到单链表思路(不考虑排序): //1、找到当前节点的最后节点 //2、将最后节点的next指向新的节点 public void add(HeroNode2 heroNode) { //因为头节点不能动,我们需要一个辅助遍历的临时节点temp HeroNode2 temp = head; //遍历链表,找到最后 while (true) { //找到最后 if (temp.next == null) { break; } //如果没有找到,则将temp后移继续找 temp = temp.next; } //当退出while循环时,temp就指向了链表的最后 //形成一个双向链表 =号就相当于指针 temp.next = heroNode; heroNode.pre = temp; } //根据newHeroNode的no 来修改即可 public void update(HeroNode2 newHeroNode) { //判断是否为空 if (head.next == null) { System.out.println("链表为空~"); return; } //定义一个辅助变量 HeroNode2 temp = head.next; //遍历链表 boolean flag = false; while (true) { if (temp == null) { break;//已经遍历完链表 } if (temp.no == newHeroNode.no) { //说明找到了 flag = true; break; } temp = temp.next; } if (flag) { temp.name = newHeroNode.name; temp.nickName = newHeroNode.nickName; } else { System.out.printf("没有找到 编号%d的节点,不能修改\n", newHeroNode.no); } } /** * 从双向链表中删除一个节点 * 说明 * 1、对于双向链表,我们可以直接找到要删除的这个节点 * 2、找到后,自我删除即可 * @param no */ public void delete(int no) { //判断当前链表是否为空 if (head.next == null){ System.out.println("链表为空,无法删除"); return; } HeroNode2 temp = head.next;//辅助变量(指针) boolean flag = false; while (true) { if (temp == null) { //已经到链表最后 break; } if (temp.no == no) { //说明找到了 flag = true; break; } temp = temp.next; } if (flag) { //找到了需要删除的节点,将 temp.next = temp.next.next //temp.next = temp.next.next; //双向链表的删除 temp.pre.next = temp.next; //如果是最后一个节点,就不需要执行下面这句话,否则会出现空指针 if(temp.next != null){ temp.next.pre = temp.pre; } } else { System.out.println("需要删除的节点不存在"); } } } //定义HeroNode,每个HeroNode对象就是一个节点 static class HeroNode2 { private int no; private String name; private String nickName; public HeroNode2 next;//指向下一个节点 默认为null public HeroNode2 pre;//指向前一个节点 默认为null public HeroNode2(int no, String name, String nickname) { this.no = no; this.name = name; this.nickName = nickname; } @Override public String toString() { return "HeroNode{" + "no=" + no + ", name='" + name + '\'' + ", nickName='" + nickName + '\'' + '}'; } } }
[ "hwq8910@163.com" ]
hwq8910@163.com
0742868397746ff0c3546c3ccd3f3e5235707eb0
928355ab6cbbed6efda98a6a4ba9ca52c24bb8ee
/Proyecto-software3/apipersona2021/src/main/java/co/edu/uco/apiparqueadero/servicio/tipodocumento/consulta/impl/ConsultaTipoDocumentoServiceImpl.java
e7437a74715da271a9d939c819d1a4ed176e06d9
[]
no_license
santiago1217/proyectoSoftware
bd7dff46352fc1f37b43727d104785c70ebfee0c
0a171cd18d645abf2228dc0ed877e60d2690b029
refs/heads/master
2023-06-03T01:21:14.978697
2021-06-03T23:24:12
2021-06-03T23:24:12
344,311,951
1
0
null
null
null
null
UTF-8
Java
false
false
677
java
package co.edu.uco.apiparqueadero.servicio.tipodocumento.consulta.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import co.edu.uco.apiparqueadero.model.TipoDocumento; import co.edu.uco.apiparqueadero.repository.TipoDocumentoRepository; import co.edu.uco.apiparqueadero.servicio.tipodocumento.consulta.ConsultaTipoDocumentoService; @Service public class ConsultaTipoDocumentoServiceImpl implements ConsultaTipoDocumentoService{ @Autowired private TipoDocumentoRepository tipoDocumentoRepository; @Override public Iterable<TipoDocumento> findAll() { return tipoDocumentoRepository.findAll(); } }
[ "Santiago@LAPTOP-ICHPKRVS" ]
Santiago@LAPTOP-ICHPKRVS
28e98ab8fa390ed4631dc08cb84cdb9741477922
75379df4cb7af6d072adb1eab1aaa0ade38641b7
/app/src/main/java/com/wafaaelm3andy/loginretrofit/model/User.java
cbfeb4ab32f1dd5da80f16f3d8a688c1cd0d8c33
[]
no_license
wafaaelmaandy/retrofit-example2
4a6db94176b70d08ab91b46e542a403f5a861c0d
808862adb7f381af819f97740b2dd9383137d921
refs/heads/master
2020-03-22T11:19:29.084442
2018-07-06T09:27:52
2018-07-06T09:27:52
139,963,336
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package com.wafaaelm3andy.loginretrofit.model; public class User { String name ,Email; Integer id ; String [] topics ; int age ; public User(String name, String email, String[] topics, int age) { this.name = name; Email = email; this.topics = topics; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return Email; } public void setEmail(String email) { Email = email; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String[] getTopics() { return topics; } public void setTopics(String[] topics) { this.topics = topics; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
[ "wafaa11995@yahoo.com" ]
wafaa11995@yahoo.com
3a2c59a6c73df0d69b8311b41cda2ec8204862ed
2a0ab168a5548ce5a11c6112c8d933b3480c6f4c
/src/main/java/es/soaint/demo/model/dto/DetalleVentaDto.java
38676203f052233cb435a7c7aa446952b5d3f383
[]
no_license
Ever2018/demo
e46b0e12e470068a7dbd6f8a66b96ab67fe2bfda
10f8b773df87ccc360215f3558ae9277eb0c1642
refs/heads/master
2022-12-18T07:36:54.165538
2020-09-20T01:55:08
2020-09-20T01:55:08
296,980,023
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package es.soaint.demo.model.dto; import lombok.*; import java.util.List; @Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor public class DetalleVentaDto { private List<ProductoDto> productos; }
[ "evrchaicha@gmail.com" ]
evrchaicha@gmail.com
fbb20a52ddd5260ce38b68258908bcaa919045ec
f24c62718f9d67a95bb4d65f5244bd81f226df98
/src/main/java/Akarmi.java
a57e1dd530e10c822d917301c4854a70f8dde59f
[]
no_license
Patonai81/gitFixArtifact
1f14fffbcf65dcad8f403f76ef5d56cb88d283f9
34e22ab0e3a094624474f6cc1ffb7aa4ad9f362f
refs/heads/master
2020-04-11T03:58:45.826727
2018-12-12T13:59:38
2018-12-12T13:59:38
161,496,842
0
0
null
null
null
null
UTF-8
Java
false
false
24
java
public class Akarmi { }
[ "patonai.szabolcs@gmail.com" ]
patonai.szabolcs@gmail.com
efad1d6c73bef4888247a94ff0383d9c070fb1bc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_e99ca54a9be338691c93e49fbe79e04694539fa9/MainFrame/4_e99ca54a9be338691c93e49fbe79e04694539fa9_MainFrame_t.java
2f225905f0be46b78bffcbfea3f7aba9a3b45f60
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
19,893
java
/* * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes * * 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 com.dmdirc.addons.ui_swing; import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker; import com.dmdirc.addons.ui_swing.components.desktopPane.DMDircDesktopPane; import com.dmdirc.FrameContainer; import com.dmdirc.Main; import com.dmdirc.ServerManager; import com.dmdirc.actions.ActionManager; import com.dmdirc.actions.CoreActionType; import com.dmdirc.config.IdentityManager; import com.dmdirc.interfaces.ConfigChangeListener; import com.dmdirc.logger.ErrorLevel; import com.dmdirc.logger.Logger; import com.dmdirc.ui.IconManager; import com.dmdirc.ui.WindowManager; import com.dmdirc.ui.interfaces.FrameManager; import com.dmdirc.ui.interfaces.FramemanagerPosition; import com.dmdirc.ui.interfaces.MainWindow; import com.dmdirc.ui.interfaces.Window; import com.dmdirc.addons.ui_swing.components.InputTextFrame; import com.dmdirc.addons.ui_swing.components.MenuBar; import com.dmdirc.addons.ui_swing.components.SnappingJSplitPane; import com.dmdirc.addons.ui_swing.framemanager.tree.TreeFrameManager; import com.dmdirc.ui.CoreUIUtils; import java.awt.Dimension; import java.awt.event.WindowEvent; import java.awt.event.WindowFocusListener; import java.awt.event.WindowListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyVetoException; import java.util.ArrayList; import java.util.List; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.MenuSelectionManager; import javax.swing.WindowConstants; import net.miginfocom.swing.MigLayout; /** * The main application frame. */ public final class MainFrame extends JFrame implements WindowListener, MainWindow, ConfigChangeListener, FrameManager, PropertyChangeListener { /** * A version number for this class. It should be changed whenever the class * structure is changed (or anything else that would prevent serialized * objects being unserialized with the new class). */ private static final long serialVersionUID = 9; /** Whether the internal frames are maximised or not. */ private boolean maximised; /** The main application icon. */ private ImageIcon imageIcon; /** The frame manager that's being used. */ private FrameManager mainFrameManager; /** Dekstop pane. */ private DMDircDesktopPane desktopPane; /** Main panel. */ private JPanel frameManagerPanel; /** Frame manager position. */ private FramemanagerPosition position; /** Show version? */ private boolean showVersion; /** Menu bar. */ private MenuBar menu; /** Top level window list. */ private final List<java.awt.Window> windows; /** * Creates new form MainFrame. */ protected MainFrame() { super(); windows = new ArrayList<java.awt.Window>(); initComponents(); imageIcon = new ImageIcon(IconManager.getIconManager().getImage("icon")); setIconImage(imageIcon.getImage()); CoreUIUtils.centreWindow(this); setVisible(true); addWindowListener(this); showVersion = IdentityManager.getGlobalConfig().getOptionBool("ui", "showversion"); IdentityManager.getGlobalConfig().addChangeListener("ui", "lookandfeel", this); IdentityManager.getGlobalConfig().addChangeListener("ui", "showversion", this); IdentityManager.getGlobalConfig().addChangeListener("icon", "icon", this); addWindowFocusListener(new WindowFocusListener() { /** {@inheritDoc} */ @Override public void windowGainedFocus(WindowEvent e) { //Ignore } /** {@inheritDoc} */ @Override public void windowLostFocus(WindowEvent e) { //TODO: Remove me when we switch to java7 MenuSelectionManager.defaultManager().clearSelectedPath(); } }); setTitle(getTitlePrefix()); } /** {@inheritDoc}. */ @Override public void setActiveFrame(final Window frame) { UIUtilities.invokeLater(new Runnable() { /** {@inheritDoc} */ @Override public void run() { if (frame != null) { if (maximised) { setTitle(getTitlePrefix() + " - " + frame.getTitle()); } ActionManager.processEvent(CoreActionType.CLIENT_FRAME_CHANGED, null, frame.getContainer()); try { ((JInternalFrame) frame).setVisible(true); ((JInternalFrame) frame).setIcon(false); ((JInternalFrame) frame).moveToFront(); ((JInternalFrame) frame).setSelected(true); } catch (PropertyVetoException ex) { Logger.userError(ErrorLevel.LOW, "Unable to set active window"); } } if (frame instanceof InputTextFrame) { ((InputTextFrame) frame).requestInputFieldFocus(); } } }); } /** * Returns the size of the frame manager. * * @return Frame manager size. */ public int getFrameManagerSize() { if (position == FramemanagerPosition.LEFT || position == FramemanagerPosition.RIGHT) { return frameManagerPanel.getWidth(); } else { return frameManagerPanel.getHeight(); } } /** {@inheritDoc}. */ @Override public ImageIcon getIcon() { return imageIcon; } /** * Returns the window that is currently active. * * @return The active window */ public Window getActiveFrame() { if (desktopPane.getSelectedFrame() instanceof Window) { return (Window) desktopPane.getSelectedFrame(); } else { return null; } } /** {@inheritDoc}. */ @Override public void setMaximised(final boolean max) { maximised = max; if (max) { final Window window = getActiveFrame(); if (window != null) { setTitle(getTitlePrefix() + " - " + window.getTitle()); } } else { setTitle(getTitlePrefix()); for (JInternalFrame frame : desktopPane.getAllFrames()) { try { frame.setMaximum(false); } catch (PropertyVetoException ex) { Logger.userError(ErrorLevel.LOW, "Unable to maximise window"); } } } } /** {@inheritDoc}. */ @Override public String getTitlePrefix() { if (showVersion) { return "DMDirc " + IdentityManager.getGlobalConfig().getOption("version", "version"); } else { return "DMDirc"; } } /** {@inheritDoc}. */ @Override public boolean getMaximised() { return maximised; } /** * Returns the desktop pane for the frame. * * @return JDesktopPane for the frame */ public JDesktopPane getDesktopPane() { return desktopPane; } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowOpened(final WindowEvent windowEvent) { //ignore } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowClosing(final WindowEvent windowEvent) { quit(); } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowClosed(final WindowEvent windowEvent) { Main.quit(); } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowIconified(final WindowEvent windowEvent) { ActionManager.processEvent(CoreActionType.CLIENT_MINIMISED, null); } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowDeiconified(final WindowEvent windowEvent) { ActionManager.processEvent(CoreActionType.CLIENT_UNMINIMISED, null); } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowActivated(final WindowEvent windowEvent) { //ignore } /** * {@inheritDoc}. * * @param windowEvent Window event */ @Override public void windowDeactivated(final WindowEvent windowEvent) { //ignore } /** * Adds a top level window to the window list. * * @param source New window */ protected void addTopLevelWindow(final java.awt.Window source) { synchronized (windows) { windows.add(source); } } /** * Deletes a top level window to the window list. * * @param source Old window */ protected void delTopLevelWindow(final java.awt.Window source) { synchronized (windows) { windows.remove(source); } } /** * Returns a list of top level windows. * * @return Top level window list */ public List<java.awt.Window> getTopLevelWindows() { synchronized (windows) { return windows; } } /** Initialiases the frame managers. */ private void initFrameManagers() { final String manager = IdentityManager.getGlobalConfig().getOption("ui", "framemanager"); try { mainFrameManager = (FrameManager) Class.forName(manager). getConstructor().newInstance(); } catch (Exception ex) { // Throws craploads of exceptions and we want to handle them all // the same way, so we might as well catch Exception mainFrameManager = new TreeFrameManager(); } WindowManager.addFrameManager(mainFrameManager); mainFrameManager.setParent(frameManagerPanel); WindowManager.addFrameManager(this); } /** * Initialises the components for this frame. */ private void initComponents() { frameManagerPanel = new JPanel(); desktopPane = new DMDircDesktopPane(); initFrameManagers(); menu = new MenuBar(this); Apple.getApple().setMenuBar(menu); setJMenuBar(menu); setPreferredSize(new Dimension(800, 600)); getContentPane().setLayout(new MigLayout("fill, ins rel, wrap 1, hidemode 2")); getContentPane().add(initSplitPane(), "grow, push"); getContentPane().add(SwingController.getSwingStatusBar(), "hmax 20, wmax 100%-2*rel, wmin 100%-2*rel"); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); setTitle("DMDirc"); pack(); } /** * Initialises the split pane. * * @return Returns the initialised split pane */ private JSplitPane initSplitPane() { final JSplitPane mainSplitPane = new SnappingJSplitPane(SnappingJSplitPane.Orientation.HORIZONTAL); position = FramemanagerPosition.getPosition(IdentityManager.getGlobalConfig(). getOption("ui", "framemanagerPosition")); if (position == FramemanagerPosition.UNKNOWN) { position = FramemanagerPosition.LEFT; } if (!mainFrameManager.canPositionVertically() && (position == FramemanagerPosition.LEFT || position == FramemanagerPosition.RIGHT)) { position = FramemanagerPosition.BOTTOM; } if (!mainFrameManager.canPositionHorizontally() && (position == FramemanagerPosition.TOP || position == FramemanagerPosition.BOTTOM)) { position = FramemanagerPosition.LEFT; } switch (position) { case TOP: mainSplitPane.setTopComponent(frameManagerPanel); mainSplitPane.setBottomComponent(desktopPane); mainSplitPane.setResizeWeight(0.0); mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); frameManagerPanel.setPreferredSize(new Dimension(Integer.MAX_VALUE, IdentityManager.getGlobalConfig(). getOptionInt("ui", "frameManagerSize"))); break; case LEFT: mainSplitPane.setLeftComponent(frameManagerPanel); mainSplitPane.setRightComponent(desktopPane); mainSplitPane.setResizeWeight(0.0); mainSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT); frameManagerPanel.setPreferredSize(new Dimension( IdentityManager.getGlobalConfig().getOptionInt("ui", "frameManagerSize"), Integer.MAX_VALUE)); break; case BOTTOM: mainSplitPane.setTopComponent(desktopPane); mainSplitPane.setBottomComponent(frameManagerPanel); mainSplitPane.setResizeWeight(1.0); mainSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); frameManagerPanel.setPreferredSize(new Dimension(Integer.MAX_VALUE, IdentityManager.getGlobalConfig(). getOptionInt("ui", "frameManagerSize"))); break; case RIGHT: mainSplitPane.setLeftComponent(desktopPane); mainSplitPane.setRightComponent(frameManagerPanel); mainSplitPane.setResizeWeight(1.0); mainSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT); frameManagerPanel.setPreferredSize(new Dimension( IdentityManager.getGlobalConfig().getOptionInt("ui", "frameManagerSize"), Integer.MAX_VALUE)); break; default: break; } return mainSplitPane; } /** {@inheritDoc}. */ @Override public void quit() { if (IdentityManager.getGlobalConfig().getOptionBool("ui", "confirmQuit") && JOptionPane.showConfirmDialog(this, "You are about to quit DMDirc, are you sure?", "Quit confirm", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.YES_OPTION) { return; } new LoggingSwingWorker() { /** {@inheritDoc} */ @Override protected Object doInBackground() throws Exception { ActionManager.processEvent(CoreActionType.CLIENT_CLOSING, null); ServerManager.getServerManager().closeAll(IdentityManager.getGlobalConfig().getOption("general", "closemessage")); IdentityManager.getConfigIdentity().setOption("ui", "frameManagerSize", String.valueOf(getFrameManagerSize())); return null; } /** {@inheritDoc} */ @Override protected void done() { super.done(); dispose(); } }.execute(); } /** {@inheritDoc} */ @Override public void configChanged(final String domain, final String key) { if ("ui".equals(domain)) { if ("lookandfeel".equals(key)) { SwingController.updateLookAndFeel(); } else { showVersion = IdentityManager.getGlobalConfig().getOptionBool("ui", "showversion"); } } else { imageIcon = new ImageIcon(IconManager.getIconManager().getImage("icon")); setIconImage(imageIcon.getImage()); } } /** {@inheritDoc}. */ @Override public void setParent(final JComponent parent) { //Ignore } /** {@inheritDoc}. */ @Override public boolean canPositionVertically() { return true; } /** {@inheritDoc}. */ @Override public boolean canPositionHorizontally() { return true; } /** {@inheritDoc}. */ @Override public void addWindow(final FrameContainer window) { addWindow(window, desktopPane.getAllFrames().length - 1); } /** * Adds a window to this frame manager. * * @param window The server to be added * @param index Index of the window to be added */ public void addWindow(final FrameContainer window, final int index) { final JInternalFrame frame = (JInternalFrame) window.getFrame(); // Add the frame desktopPane.add(frame, index); frame.addPropertyChangeListener("title", this); } /** {@inheritDoc}. */ @Override public void delWindow(FrameContainer window) { if (desktopPane.getAllFrames().length == 1) { setTitle(getTitlePrefix()); } desktopPane.remove((JInternalFrame) window.getFrame()); ((JInternalFrame) window.getFrame()).removePropertyChangeListener("title", this); } /** {@inheritDoc}. */ @Override public void addWindow(final FrameContainer parent, final FrameContainer window) { addWindow(window); } /** {@inheritDoc}. */ @Override public void delWindow(final FrameContainer parent, final FrameContainer window) { delWindow(window); } /** {@inheritDoc}. */ @Override public void propertyChange(PropertyChangeEvent evt) { if (maximised) { if (evt.getSource().equals(getActiveFrame()) && "title".equals(evt.getPropertyName())) { setTitle(getTitlePrefix() + " - " + (String) evt.getNewValue()); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2a85a8f9dc41bdd22718e519061b2a66a4cdf82b
63f579466b611ead556cb7a257d846fc88d582ed
/XDRValidator/src/main/java/generated/IntrasternalRoute.java
943c3aaf61e6a4fb50d0c8d53b71a359c2b40cee
[]
no_license
svalluripalli/soap
14f47b711d63d4890de22a9f915aed1bef755e0b
37d7ea683d610ab05477a1fdb4e329b5feb05381
refs/heads/master
2021-01-18T20:42:09.095152
2014-05-07T21:16:36
2014-05-07T21:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.07 at 05:07:17 PM EDT // package generated; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for IntrasternalRoute. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="IntrasternalRoute"> * &lt;restriction base="{}cs"> * &lt;enumeration value="ISTERINJ"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "IntrasternalRoute") @XmlEnum public enum IntrasternalRoute { ISTERINJ; public String value() { return name(); } public static IntrasternalRoute fromValue(String v) { return valueOf(v); } }
[ "konkapv@NCI-01874632-L.nci.nih.gov" ]
konkapv@NCI-01874632-L.nci.nih.gov
5d572c381e598bb8b9b89a0054d5ef4a3e8dfccd
3eeedbb4be937315a10dd272892e4da36cae9c55
/dbus-keeper/keeper-base/src/main/java/com/creditease/dbus/domain/model/TableVersionColumn.java
f8a19597c554cd17054e25afa7eb91c033ab9c4b
[ "Apache-2.0" ]
permissive
lnnlab/DBus
35c9a6448b8403d1a990d5521af4402789723ec0
4c8ec8c25d3ff5d762975d4d23959271c3b07deb
refs/heads/master
2020-04-27T05:18:25.098429
2019-06-12T01:24:03
2019-06-12T01:24:03
174,077,772
0
0
Apache-2.0
2019-06-12T01:24:04
2019-03-06T05:29:20
Java
UTF-8
Java
false
false
1,868
java
/*- * << * DBus * == * Copyright (C) 2016 - 2018 Bridata * == * 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.creditease.dbus.domain.model; import com.alibaba.fastjson.annotation.JSONField; import java.util.Date; public class TableVersionColumn { private long id; private String columnName; private String dataType; private long dataLength; private long dataScale; private String comments; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getColumnName() { return columnName; } public void setColumnName(String columnName) { this.columnName = columnName; } public String getDataType() { return dataType; } public void setDataType(String dataType) { this.dataType = dataType; } public long getDataLength() { return dataLength; } public void setDataLength(long dataLength) { this.dataLength = dataLength; } public long getDataScale() { return dataScale; } public void setDataScale(long dataScale) { this.dataScale = dataScale; } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } }
[ "haowei6@creditease.cn" ]
haowei6@creditease.cn
3bf340ff5c73beccb60fe5ce0c9b45d4853299cc
54b70e56da306517a3d2665568d4a9483f72460e
/projects/1_tullibee/evosuite-tests/com/ib/client/AnyWrapperMsgGeneratorEvoSuiteTest.java
0884ba9aab48b5239d64f17a76349e3db699e983
[ "LGPL-3.0-only", "MIT" ]
permissive
DeepinSC/Evodoop
eb4f904fc87659fb0466283479a075af7cd8bef6
0e7aea19be1cd74e7c02580dd7dff4ec58427983
refs/heads/master
2020-05-15T20:18:43.991818
2019-05-06T04:27:54
2019-05-06T04:27:54
182,477,372
2
3
MIT
2019-04-21T02:51:58
2019-04-21T02:26:29
Java
UTF-8
Java
false
false
1,455
java
/* * This file was automatically generated by EvoSuite */ package com.ib.client; import org.junit.Test; import org.junit.runner.RunWith; import org.evosuite.junit.EvoSuiteRunner; import static org.junit.Assert.*; import com.ib.client.AnyWrapperMsgGenerator; import org.junit.BeforeClass; @RunWith(EvoSuiteRunner.class) public class AnyWrapperMsgGeneratorEvoSuiteTest { @BeforeClass public static void initEvoSuiteFramework(){ org.evosuite.Properties.REPLACE_CALLS = true; } @Test public void test0() throws Throwable { String string0 = AnyWrapperMsgGenerator.error("UffG}"); assertEquals("UffG}", string0); } @Test public void test1() throws Throwable { AnyWrapperMsgGenerator anyWrapperMsgGenerator0 = new AnyWrapperMsgGenerator(); assertEquals("Connection Closed", anyWrapperMsgGenerator0.connectionClosed()); } @Test public void test2() throws Throwable { String string0 = AnyWrapperMsgGenerator.ioError((Exception) null); assertEquals("Error - null", string0); assertNotNull(string0); } @Test public void test3() throws Throwable { String string0 = AnyWrapperMsgGenerator.error(0, 0, "UffG}"); assertEquals("0 | 0 | UffG}", string0); assertNotNull(string0); } @Test public void test4() throws Throwable { String string0 = AnyWrapperMsgGenerator.connectionClosed(); assertEquals("Connection Closed", string0); } }
[ "654834341@qq.com" ]
654834341@qq.com
8f4dc8ece1a66aeef3c758e0e06948165704019e
f3d7b495fd46c5ac99701188545d2bd9a2b7f502
/src/com/rc/openapi/dao/impl/TPromotionDAOImpl.java
7d0f07a10a82dcd0d984e878768c588491a7b09f
[]
no_license
AdorkDean/111_yao_app_mobile
408067a16d6a6a219b93d37531c58236a93eae49
37bbc9f86977f4c5a803223fc85d022c36228807
refs/heads/master
2020-03-12T19:27:51.592084
2016-12-03T10:11:40
2016-12-03T10:11:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,163
java
package com.rc.openapi.dao.impl; import java.sql.SQLException; import java.util.List; import com.ibatis.sqlmap.client.SqlMapClient; import com.rc.app.framework.webapp.model.page.PageManager; import com.rc.app.framework.webapp.model.page.PageWraper; import com.rc.openapi.dao.TPromotionDAO; import com.rc.openapi.vo.TPromotion; import com.rc.openapi.vo.TPromotionExample; public class TPromotionDAOImpl implements TPromotionDAO { private SqlMapClient sqlMapClient; public void setSqlMapClient(SqlMapClient sqlMapClient) { this.sqlMapClient = sqlMapClient; } public SqlMapClient getSqlMapClient() { return sqlMapClient; } public TPromotionDAOImpl() { super(); } public TPromotionDAOImpl(SqlMapClient sqlMapClient) { super(); this.sqlMapClient = sqlMapClient; } public int countByExample(TPromotionExample example) throws SQLException { Integer count = (Integer) sqlMapClient.queryForObject("t_promotion.ibatorgenerated_countByExample", example); return count.intValue(); } public int deleteByExample(TPromotionExample example) throws SQLException { int rows = sqlMapClient.delete("t_promotion.ibatorgenerated_deleteByExample", example); return rows; } public int deleteByPrimaryKey(Long id) throws SQLException { TPromotion key = new TPromotion(); key.setId(id); int rows = sqlMapClient.delete("t_promotion.ibatorgenerated_deleteByPrimaryKey", key); return rows; } public Long insert(TPromotion record) throws SQLException { return (Long) sqlMapClient.insert("t_promotion.ibatorgenerated_insert", record); } public Long insertSelective(TPromotion record) throws SQLException { return (Long) sqlMapClient.insert("t_promotion.ibatorgenerated_insertSelective", record); } public List selectByExample(TPromotionExample example) throws SQLException { List list = sqlMapClient.queryForList("t_promotion.ibatorgenerated_selectByExample", example); return list; } public TPromotion selectByPrimaryKey(Long id) throws SQLException { TPromotion key = new TPromotion(); key.setId(id); TPromotion record = (TPromotion) sqlMapClient.queryForObject("t_promotion.ibatorgenerated_selectByPrimaryKey", key); return record; } public int updateByExampleSelective(TPromotion record, TPromotionExample example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("t_promotion.ibatorgenerated_updateByExampleSelective", parms); return rows; } public int updateByExample(TPromotion record, TPromotionExample example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("t_promotion.ibatorgenerated_updateByExample", parms); return rows; } public int updateByPrimaryKeySelective(TPromotion record) throws SQLException { int rows = sqlMapClient.update("t_promotion.ibatorgenerated_updateByPrimaryKeySelective", record); return rows; } public int updateByPrimaryKey(TPromotion record) throws SQLException { int rows = sqlMapClient.update("t_promotion.ibatorgenerated_updateByPrimaryKey", record); return rows; } private static class UpdateByExampleParms extends TPromotionExample { private Object record; public UpdateByExampleParms(Object record, TPromotionExample example) { super(example); this.record = record; } public Object getRecord() { return record; } } public PageWraper selectByRepositoryByPage(TPromotionExample example) throws SQLException { PageWraper pw=null; int count=this.countByExample(example); List list = sqlMapClient.queryForList("t_promotion.selectByExampleByPage", example); System.out.println("��Դ��ҳ��ѯlist.size="+list.size()); pw=PageManager.getPageWraper(example.getPageInfo(), list, count); return pw; } }
[ "tzmarlon@163.com" ]
tzmarlon@163.com
b71c38a63cb26c7b07e0e6a02ba8312304e1695d
a4c072b49fda53c13e56523688dae8b0469ec504
/mybatis/generatorTest/src/org/entity/StudentExample.java
ff0fbf042d26078bbd244cabbae0d6535230918f
[]
no_license
doddd-col/Spring-Mybatis
4cd6adf20aaf637ac1af15e971230a37b237a575
7c3b0dd3f4bc09e448458c128dd5f862f8fce811
refs/heads/master
2020-08-28T20:33:35.628149
2019-11-22T07:43:37
2019-11-22T07:43:37
217,813,406
0
0
null
2020-01-08T17:36:20
2019-10-27T06:17:30
Java
UTF-8
Java
false
false
21,972
java
package org.entity; import java.util.ArrayList; import java.util.List; public class StudentExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public StudentExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andSnoIsNull() { addCriterion("SNO is null"); return (Criteria) this; } public Criteria andSnoIsNotNull() { addCriterion("SNO is not null"); return (Criteria) this; } public Criteria andSnoEqualTo(Integer value) { addCriterion("SNO =", value, "sno"); return (Criteria) this; } public Criteria andSnoNotEqualTo(Integer value) { addCriterion("SNO <>", value, "sno"); return (Criteria) this; } public Criteria andSnoGreaterThan(Integer value) { addCriterion("SNO >", value, "sno"); return (Criteria) this; } public Criteria andSnoGreaterThanOrEqualTo(Integer value) { addCriterion("SNO >=", value, "sno"); return (Criteria) this; } public Criteria andSnoLessThan(Integer value) { addCriterion("SNO <", value, "sno"); return (Criteria) this; } public Criteria andSnoLessThanOrEqualTo(Integer value) { addCriterion("SNO <=", value, "sno"); return (Criteria) this; } public Criteria andSnoIn(List<Integer> values) { addCriterion("SNO in", values, "sno"); return (Criteria) this; } public Criteria andSnoNotIn(List<Integer> values) { addCriterion("SNO not in", values, "sno"); return (Criteria) this; } public Criteria andSnoBetween(Integer value1, Integer value2) { addCriterion("SNO between", value1, value2, "sno"); return (Criteria) this; } public Criteria andSnoNotBetween(Integer value1, Integer value2) { addCriterion("SNO not between", value1, value2, "sno"); return (Criteria) this; } public Criteria andNameIsNull() { addCriterion("NAME is null"); return (Criteria) this; } public Criteria andNameIsNotNull() { addCriterion("NAME is not null"); return (Criteria) this; } public Criteria andNameEqualTo(String value) { addCriterion("NAME =", value, "name"); return (Criteria) this; } public Criteria andNameNotEqualTo(String value) { addCriterion("NAME <>", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThan(String value) { addCriterion("NAME >", value, "name"); return (Criteria) this; } public Criteria andNameGreaterThanOrEqualTo(String value) { addCriterion("NAME >=", value, "name"); return (Criteria) this; } public Criteria andNameLessThan(String value) { addCriterion("NAME <", value, "name"); return (Criteria) this; } public Criteria andNameLessThanOrEqualTo(String value) { addCriterion("NAME <=", value, "name"); return (Criteria) this; } public Criteria andNameLike(String value) { addCriterion("NAME like", value, "name"); return (Criteria) this; } public Criteria andNameNotLike(String value) { addCriterion("NAME not like", value, "name"); return (Criteria) this; } public Criteria andNameIn(List<String> values) { addCriterion("NAME in", values, "name"); return (Criteria) this; } public Criteria andNameNotIn(List<String> values) { addCriterion("NAME not in", values, "name"); return (Criteria) this; } public Criteria andNameBetween(String value1, String value2) { addCriterion("NAME between", value1, value2, "name"); return (Criteria) this; } public Criteria andNameNotBetween(String value1, String value2) { addCriterion("NAME not between", value1, value2, "name"); return (Criteria) this; } public Criteria andAgeIsNull() { addCriterion("AGE is null"); return (Criteria) this; } public Criteria andAgeIsNotNull() { addCriterion("AGE is not null"); return (Criteria) this; } public Criteria andAgeEqualTo(Integer value) { addCriterion("AGE =", value, "age"); return (Criteria) this; } public Criteria andAgeNotEqualTo(Integer value) { addCriterion("AGE <>", value, "age"); return (Criteria) this; } public Criteria andAgeGreaterThan(Integer value) { addCriterion("AGE >", value, "age"); return (Criteria) this; } public Criteria andAgeGreaterThanOrEqualTo(Integer value) { addCriterion("AGE >=", value, "age"); return (Criteria) this; } public Criteria andAgeLessThan(Integer value) { addCriterion("AGE <", value, "age"); return (Criteria) this; } public Criteria andAgeLessThanOrEqualTo(Integer value) { addCriterion("AGE <=", value, "age"); return (Criteria) this; } public Criteria andAgeIn(List<Integer> values) { addCriterion("AGE in", values, "age"); return (Criteria) this; } public Criteria andAgeNotIn(List<Integer> values) { addCriterion("AGE not in", values, "age"); return (Criteria) this; } public Criteria andAgeBetween(Integer value1, Integer value2) { addCriterion("AGE between", value1, value2, "age"); return (Criteria) this; } public Criteria andAgeNotBetween(Integer value1, Integer value2) { addCriterion("AGE not between", value1, value2, "age"); return (Criteria) this; } public Criteria andSexIsNull() { addCriterion("SEX is null"); return (Criteria) this; } public Criteria andSexIsNotNull() { addCriterion("SEX is not null"); return (Criteria) this; } public Criteria andSexEqualTo(Short value) { addCriterion("SEX =", value, "sex"); return (Criteria) this; } public Criteria andSexNotEqualTo(Short value) { addCriterion("SEX <>", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThan(Short value) { addCriterion("SEX >", value, "sex"); return (Criteria) this; } public Criteria andSexGreaterThanOrEqualTo(Short value) { addCriterion("SEX >=", value, "sex"); return (Criteria) this; } public Criteria andSexLessThan(Short value) { addCriterion("SEX <", value, "sex"); return (Criteria) this; } public Criteria andSexLessThanOrEqualTo(Short value) { addCriterion("SEX <=", value, "sex"); return (Criteria) this; } public Criteria andSexIn(List<Short> values) { addCriterion("SEX in", values, "sex"); return (Criteria) this; } public Criteria andSexNotIn(List<Short> values) { addCriterion("SEX not in", values, "sex"); return (Criteria) this; } public Criteria andSexBetween(Short value1, Short value2) { addCriterion("SEX between", value1, value2, "sex"); return (Criteria) this; } public Criteria andSexNotBetween(Short value1, Short value2) { addCriterion("SEX not between", value1, value2, "sex"); return (Criteria) this; } public Criteria andHomeaddrssIsNull() { addCriterion("HOMEADDRSS is null"); return (Criteria) this; } public Criteria andHomeaddrssIsNotNull() { addCriterion("HOMEADDRSS is not null"); return (Criteria) this; } public Criteria andHomeaddrssEqualTo(String value) { addCriterion("HOMEADDRSS =", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssNotEqualTo(String value) { addCriterion("HOMEADDRSS <>", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssGreaterThan(String value) { addCriterion("HOMEADDRSS >", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssGreaterThanOrEqualTo(String value) { addCriterion("HOMEADDRSS >=", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssLessThan(String value) { addCriterion("HOMEADDRSS <", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssLessThanOrEqualTo(String value) { addCriterion("HOMEADDRSS <=", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssLike(String value) { addCriterion("HOMEADDRSS like", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssNotLike(String value) { addCriterion("HOMEADDRSS not like", value, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssIn(List<String> values) { addCriterion("HOMEADDRSS in", values, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssNotIn(List<String> values) { addCriterion("HOMEADDRSS not in", values, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssBetween(String value1, String value2) { addCriterion("HOMEADDRSS between", value1, value2, "homeaddrss"); return (Criteria) this; } public Criteria andHomeaddrssNotBetween(String value1, String value2) { addCriterion("HOMEADDRSS not between", value1, value2, "homeaddrss"); return (Criteria) this; } public Criteria andSchooladdrssIsNull() { addCriterion("SCHOOLADDRSS is null"); return (Criteria) this; } public Criteria andSchooladdrssIsNotNull() { addCriterion("SCHOOLADDRSS is not null"); return (Criteria) this; } public Criteria andSchooladdrssEqualTo(String value) { addCriterion("SCHOOLADDRSS =", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssNotEqualTo(String value) { addCriterion("SCHOOLADDRSS <>", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssGreaterThan(String value) { addCriterion("SCHOOLADDRSS >", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssGreaterThanOrEqualTo(String value) { addCriterion("SCHOOLADDRSS >=", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssLessThan(String value) { addCriterion("SCHOOLADDRSS <", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssLessThanOrEqualTo(String value) { addCriterion("SCHOOLADDRSS <=", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssLike(String value) { addCriterion("SCHOOLADDRSS like", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssNotLike(String value) { addCriterion("SCHOOLADDRSS not like", value, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssIn(List<String> values) { addCriterion("SCHOOLADDRSS in", values, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssNotIn(List<String> values) { addCriterion("SCHOOLADDRSS not in", values, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssBetween(String value1, String value2) { addCriterion("SCHOOLADDRSS between", value1, value2, "schooladdrss"); return (Criteria) this; } public Criteria andSchooladdrssNotBetween(String value1, String value2) { addCriterion("SCHOOLADDRSS not between", value1, value2, "schooladdrss"); return (Criteria) this; } public Criteria andCardidIsNull() { addCriterion("CARDID is null"); return (Criteria) this; } public Criteria andCardidIsNotNull() { addCriterion("CARDID is not null"); return (Criteria) this; } public Criteria andCardidEqualTo(Short value) { addCriterion("CARDID =", value, "cardid"); return (Criteria) this; } public Criteria andCardidNotEqualTo(Short value) { addCriterion("CARDID <>", value, "cardid"); return (Criteria) this; } public Criteria andCardidGreaterThan(Short value) { addCriterion("CARDID >", value, "cardid"); return (Criteria) this; } public Criteria andCardidGreaterThanOrEqualTo(Short value) { addCriterion("CARDID >=", value, "cardid"); return (Criteria) this; } public Criteria andCardidLessThan(Short value) { addCriterion("CARDID <", value, "cardid"); return (Criteria) this; } public Criteria andCardidLessThanOrEqualTo(Short value) { addCriterion("CARDID <=", value, "cardid"); return (Criteria) this; } public Criteria andCardidIn(List<Short> values) { addCriterion("CARDID in", values, "cardid"); return (Criteria) this; } public Criteria andCardidNotIn(List<Short> values) { addCriterion("CARDID not in", values, "cardid"); return (Criteria) this; } public Criteria andCardidBetween(Short value1, Short value2) { addCriterion("CARDID between", value1, value2, "cardid"); return (Criteria) this; } public Criteria andCardidNotBetween(Short value1, Short value2) { addCriterion("CARDID not between", value1, value2, "cardid"); return (Criteria) this; } public Criteria andClassidIsNull() { addCriterion("CLASSID is null"); return (Criteria) this; } public Criteria andClassidIsNotNull() { addCriterion("CLASSID is not null"); return (Criteria) this; } public Criteria andClassidEqualTo(Short value) { addCriterion("CLASSID =", value, "classid"); return (Criteria) this; } public Criteria andClassidNotEqualTo(Short value) { addCriterion("CLASSID <>", value, "classid"); return (Criteria) this; } public Criteria andClassidGreaterThan(Short value) { addCriterion("CLASSID >", value, "classid"); return (Criteria) this; } public Criteria andClassidGreaterThanOrEqualTo(Short value) { addCriterion("CLASSID >=", value, "classid"); return (Criteria) this; } public Criteria andClassidLessThan(Short value) { addCriterion("CLASSID <", value, "classid"); return (Criteria) this; } public Criteria andClassidLessThanOrEqualTo(Short value) { addCriterion("CLASSID <=", value, "classid"); return (Criteria) this; } public Criteria andClassidIn(List<Short> values) { addCriterion("CLASSID in", values, "classid"); return (Criteria) this; } public Criteria andClassidNotIn(List<Short> values) { addCriterion("CLASSID not in", values, "classid"); return (Criteria) this; } public Criteria andClassidBetween(Short value1, Short value2) { addCriterion("CLASSID between", value1, value2, "classid"); return (Criteria) this; } public Criteria andClassidNotBetween(Short value1, Short value2) { addCriterion("CLASSID not between", value1, value2, "classid"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "761123576@qq.com" ]
761123576@qq.com
89993ade9cb3b30b29196de5ddf63e5523b8f9d8
bf1c7016681b5b7c6569a5f20d037e9c5db37854
/III_semester/oop_2/estore/core/ShopModel.java
19aefd87c8311e7ce7156cf72b7430f9aa620a42
[ "Beerware" ]
permissive
dainiusjocas/labs
ae62d4672f4c43d27b4e9d23e126fa9fb9cf58a9
25aa0ae2032681dbaf0afd83f3d80bedddea6407
refs/heads/master
2021-01-23T23:03:10.271749
2011-12-13T15:38:48
2011-12-13T15:38:48
6,511,648
1
0
null
null
null
null
UTF-8
Java
false
false
907
java
package estore.core; import java.util.ArrayList; /** * @author hanniph * Interface that Shop class has to implement. This is a contract between shop and its UI clients. */ public interface ShopModel { //Customer information public ArrayList<Customer> getCustomers(); public void setCustomerList(ArrayList<Customer> registeredCustomers); public int getNumberOfCustomers(); public Customer getCustomer(int index); public boolean addCustomer(Customer customer); //Item information public ArrayList<Item> getAvailableItems(); public Item getAvailableItem(int index); public int getNumberOfAvailableItems(); //Stock information public Stock getStock(); public void setStock(Stock stock); //Order information public ArrayList<Order> getCustomersCompletedOrders(Customer customer); public Order getCustomersCurrentOrder(Customer customer); }
[ "hanniph@gmail.com" ]
hanniph@gmail.com
e279c7167f145b323ce744a98148ba942663f1b9
167c6226bc77c5daaedab007dfdad4377f588ef4
/java/ql/test/stubs/javafx-web/javafx/beans/property/ReadOnlyStringProperty.java
2a245ee1b0ad3533fde78d2a8ced4fbf8fd27a95
[ "MIT" ]
permissive
github/codeql
1eebb449a34f774db9e881b52cb8f7a1b1a53612
d109637e2d7ab3b819812eb960c05cb31d9d2168
refs/heads/main
2023-08-20T11:32:39.162059
2023-08-18T14:33:32
2023-08-18T14:33:32
143,040,428
5,987
1,363
MIT
2023-09-14T19:36:50
2018-07-31T16:35:51
CodeQL
UTF-8
Java
false
false
418
java
// Generated automatically from javafx.beans.property.ReadOnlyStringProperty for testing purposes package javafx.beans.property; import javafx.beans.binding.StringExpression; import javafx.beans.property.ReadOnlyProperty; abstract public class ReadOnlyStringProperty extends StringExpression implements ReadOnlyProperty<String> { public ReadOnlyStringProperty(){} public String toString(){ return null; } }
[ "kaeluka@github.com" ]
kaeluka@github.com
30a33f9f3adb3912df82bfc1baf0ffd051475a49
c92e21cc40d0f5e6628e77397c020095e27507f9
/location/src/main/java/com/anywherecat/app/LocationListenerImpl.java
0578f6ac595691283dfc68678e472ed705beb4f3
[]
no_license
Sirhu173977450/MyModuleApplication
ab6721294f7518b7db039d48a4c81d0250a05589
4b181508554ae9b49464a5d2a6f972654e68218a
refs/heads/master
2023-05-08T18:20:06.744701
2021-05-17T01:28:37
2021-05-17T01:28:37
368,021,598
0
0
null
null
null
null
UTF-8
Java
false
false
4,290
java
package com.anywherecat.app; import android.Manifest; import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Build; import android.os.Bundle; import android.provider.Settings; import android.widget.Toast; import androidx.core.app.ActivityCompat; public class LocationListenerImpl implements LocationListener { private static LocationListenerImpl locationListenerImpl; private LocationManager locationManager; private Location location; private Context context; @SuppressLint("WrongConstant") private LocationListenerImpl(Context context) { this.context = context; this.locationManager = (LocationManager) context.getSystemService(SocializeConstants.KEY_LOCATION); } public static LocationListenerImpl a(Context context) { if (locationListenerImpl == null) { locationListenerImpl = new LocationListenerImpl(context); } return locationListenerImpl; } public Location a() { if (!d()) { return null; } if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // TODO: Consider calling // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for ActivityCompat#requestPermissions for more details. return null; } this.locationManager.requestLocationUpdates("gps", 1000, 10.0f, this); this.location = this.locationManager.getLastKnownLocation("gps"); return this.location; } public boolean c() { if (!d()) { Toast.makeText(this.context, "GPS没有开启,请在设置中开启再试!", Toast.LENGTH_LONG).show(); return true; } else if (f()) { return false; } else { Toast.makeText(this.context, "模拟GPS没有开启,请在设置中开启再试!", Toast.LENGTH_LONG).show(); return true; } } public boolean d() { boolean z = true; if (!this.locationManager.getAllProviders().contains("gps")) { Toast.makeText(this.context, "您的机器不支持GPS,无法使用本软件!", Toast.LENGTH_LONG).show(); return true; } else if (Build.VERSION.SDK_INT < 28) { return this.locationManager.isProviderEnabled("gps"); } else { if (!this.locationManager.isProviderEnabled("gps")) { if (!this.locationManager.isProviderEnabled("network")) { z = false; } } return z; } } // public void removeUpdates_b() { public void b() { this.locationManager.removeUpdates(this); } public boolean e() { if (Build.VERSION.SDK_INT >= 28) { return false; } return this.locationManager.isProviderEnabled("network"); } public boolean f() { boolean z = true; if (Build.VERSION.SDK_INT >= 23) { return true; } if (Settings.Secure.getInt(this.context.getContentResolver(), "mock_location", 0) == 0) { z = false; } return z; } @Override public void onLocationChanged(Location location) { this.location = location; } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } }
[ "173977450@qq.com" ]
173977450@qq.com
3a0e82380783211ad8f3c88d647cb465e09de80a
d0b16bbcfaf9658f43158fd572399d33c5e045d2
/jpa_hibernate/src/com/hwh/model/Group.java
4f0e72377487b0fb72c31f94b887dba733655bd3
[ "Apache-2.0" ]
permissive
andrewv587/j2ee
eba30bf4340c720865eac0ae67276bdf7f75e3e4
cfafe9cb9f61d2cbd2ceb6098bbd7ff670cf2014
refs/heads/master
2021-01-11T01:27:51.250640
2019-01-31T11:39:00
2019-01-31T11:39:00
70,700,643
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package com.hwh.model; import java.util.Set; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; @Entity(name="t_group") public class Group { @Id @GeneratedValue private int id; private String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "614047311@qq.com" ]
614047311@qq.com
b37911afdd20fc6736b66e295102503dd9622aa5
ed53ce1f2fec6ca1c99555245ecfd7014453120d
/company1/app/build/generated/ap_generated_sources/debug/out/androidx/databinding/library/baseAdapters/BR.java
82e24279bb47e3393bc2c1b76b291ccd69ffa350
[]
no_license
MorrowChad16/COMS-410
73ea4c7e72a1fac8d4de3ae3359d121168bad0d4
d570f1163ec9f3d0ad3ebe59c16275342b60a22c
refs/heads/master
2023-04-08T09:01:24.893573
2021-04-13T21:16:35
2021-04-13T21:16:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
200
java
package androidx.databinding.library.baseAdapters; public class BR { public static final int _all = 0; public static final int mainViewModel = 1; public static final int userViewModel = 2; }
[ "morrowc@iastate.edu" ]
morrowc@iastate.edu
fba9412eac6b106fa9cbaf6703816921c4fad93d
421ba12e29489a4ad3948eb08008aab33d2c2025
/app/src/main/java/com/example/myapplication/Detaile/DetailData.java
b15d5c6087d48ed5665eef65331889dc9dc90a53
[]
no_license
1316275869/AnimalIdentification
b6e610ab03bf97a89d2dcef1df65d4ca714280f6
8dac6fe55a08da8a7ba0a065d505318e522786f1
refs/heads/master
2022-09-11T09:32:31.471396
2020-05-25T03:13:57
2020-05-25T03:13:57
260,514,453
0
0
null
null
null
null
UTF-8
Java
false
false
814
java
package com.example.myapplication.Detaile; public class DetailData { private String title; private String detail; private String ur; public DetailData(String title, String detail, String ur) { this.title = title; this.detail = detail; this.ur = ur; } public DetailData(String title, String detail) { this.title = title; this.detail = detail; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail; } public String getUr() { return ur; } public void setUr(String ur) { this.ur = ur; } }
[ "1316275869@qq.com" ]
1316275869@qq.com
c96a77510db6ac16fef78097e09f965024984733
f024de355ee80bf70826b6033fb53afbfdd3be3b
/src/main/java/hello/servlet/basic/request/RequestBodyStringServlet.java
b55459aff8ae4c9a252eec1cafc93302d8b7a4c4
[]
no_license
painkill2r/holy-spring-mvc-basic
9557ea597c92cbea818889b4e217f09533a4c32a
6d83e0b41c1bd6559587abb0c9754e08c5b7c9f4
refs/heads/main
2023-06-11T00:39:38.154326
2021-07-04T05:00:55
2021-07-04T05:00:55
380,676,642
0
0
null
null
null
null
UTF-8
Java
false
false
1,105
java
package hello.servlet.basic.request; import org.springframework.util.StreamUtils; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.nio.charset.StandardCharsets; @WebServlet(name = "requestBodyStringServlet", urlPatterns = "/request-body-string") public class RequestBodyStringServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletInputStream inputStream = request.getInputStream(); // Message Body의 내용을 Byte code로 얻어옴. String messageBody = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8); // Spring에서 제공하는 Utility를 사용하여 Byte code를 String으로 변환 System.out.println("messageBody = " + messageBody); response.getWriter().write("ok"); } }
[ "yoman3011@gmail.com" ]
yoman3011@gmail.com
b5659ca96a325d7df327df517a0f9c4f7ec6a0c6
42fedb021c2f9d4d1def936fe760dbf75efb0a06
/JavaRoboticsLib/Utility/Util.java
aa8c573ae15c218d8f717703a9522d68546b2895
[]
no_license
shockwave4488/FRC-2017-Public
f0b3e7b479173bdcadea7a765f878e541448dd15
5cc3a434f7faa0a0044c7377675b73147b11b09f
refs/heads/master
2021-08-31T01:12:25.238111
2017-12-20T03:09:07
2017-12-20T03:09:07
114,721,231
0
0
null
null
null
null
UTF-8
Java
false
false
2,607
java
package JavaRoboticsLib.Utility; import edu.wpi.first.wpilibj.Timer; /** * Provides various mathematical and logical utility functions */ public class Util { /** * Converts degrees to radians * * @param degrees * angle in degrees * @return angle in radians */ public static double toRadians(double degrees) { return degrees * (Math.PI / 180.0); } /** * Converts radians to degrees * * @param radians * angle in radians * @return angle in degrees */ public static double toDegrees(double radians) { return radians * (180.0 / Math.PI); } /** * Limits the value to a low and high threshold * * @param value * value to be limited * @param low * lower limit * @param high * upper limit * @return value coerced to the nearest limit */ public static double limit(double value, double low, double high) { if (value < low) return low; if (value > high) return high; return value; } /** * Waits for a specified time more accurately than Thread.Sleep() * * @param time * Time in seconds to wait */ public static void accurateWaitSeconds(double time) throws InterruptedException { Timer sw = new Timer(); sw.start(); int milliSeconds = ((int) ((time * 1e3))); if (milliSeconds >= 20) { Thread.sleep(milliSeconds - 12); } while (sw.get() < time) ; sw.stop(); } /** * Waits for a specified time more accurately than Thread.Sleep() * * @param time * Time in milliseconds to wait */ public static void accurateWaitMilliseconds(double time) throws InterruptedException { accurateWaitSeconds(time / 1000); } /** * Wraps degrees around -180 to 180 * * @param degrees * @return */ public static double wrapDegrees(double degrees) { degrees %= 360; return (degrees > 180 ? degrees - 360 : degrees); } /** * Wraos radians around -PI and PI * * @param radians * @return */ public static double wrapRadians(double radians) { radians %= Math.PI * 2; return (radians > Math.PI ? radians - (Math.PI * 2) : radians); } /** * Wraps an error value around a maximum and minimum input. * * @param value * @param setpoint * @param min * @param max * @return */ public static double wrapError(double value, double setpoint, double min, double max) { double error = setpoint - value; if (Math.abs(error) <= (max - min) / 2) return error; if (error < 0) { return (max - value) + (setpoint - min); } else { return (min - value) - (max - setpoint); } } }
[ "cobbley.glencoe.robotics@gmail.com" ]
cobbley.glencoe.robotics@gmail.com
0e09b791b9cb82e4070d14905591c197a939d5a7
947fafe7b47c6e0fa1314c67773123695d68e823
/core/src/main/java/net/petafuel/styx/core/xs2a/standards/berlingroup/v1_2/BerlinGroupRequestProvider.java
7ec9aa8d0757a6969f23c619742bde6e5a498de2
[ "Apache-2.0" ]
permissive
petafuel/styx
4339fa6480f47a114836ff1c2f1589497e107588
d975a714c4f0b20e119d23bea75a6d8c4a31ca7a
refs/heads/main
2023-06-29T01:58:52.169074
2022-03-02T12:54:31
2022-03-02T12:54:31
166,198,473
19
2
Apache-2.0
2023-06-13T23:14:51
2019-01-17T09:28:44
Java
UTF-8
Java
false
false
4,807
java
package net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2; import net.petafuel.styx.core.xs2a.contracts.AISRequest; import net.petafuel.styx.core.xs2a.contracts.PISRequest; import net.petafuel.styx.core.xs2a.contracts.SCARequest; import net.petafuel.styx.core.xs2a.factory.XS2ARequestClassProvider; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.CreateConsentRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.DeleteConsentRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.GetConsentRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadAccountDetailsRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadAccountListRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadBalancesRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadTransactionDetailsRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadTransactionsRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.StatusConsentRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.AuthoriseTransactionRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetAuthorisationsRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetSCAStatusRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.PaymentInitiationRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.ReadPaymentRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.ReadPaymentStatusRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.SelectAuthenticationMethodRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.StartAuthorisationRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.UpdatePSUAuthenticationRequest; import net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.UpdatePSUIdentificationRequest; public class BerlinGroupRequestProvider implements XS2ARequestClassProvider { @Override public Class<? extends AISRequest> consentCreation() { return CreateConsentRequest.class; } @Override public Class<? extends AISRequest> consentStatus() { return StatusConsentRequest.class; } @Override public Class<? extends AISRequest> consentRetrieval() { return GetConsentRequest.class; } @Override public Class<? extends AISRequest> consentRemoval() { return DeleteConsentRequest.class; } @Override public Class<? extends AISRequest> accountList() { return ReadAccountListRequest.class; } @Override public Class<? extends AISRequest> accountDetails() { return ReadAccountDetailsRequest.class; } @Override public Class<? extends AISRequest> accountBalances() { return ReadBalancesRequest.class; } @Override public Class<? extends AISRequest> accountTransactionList() { return ReadTransactionsRequest.class; } @Override public Class<? extends AISRequest> accountTransactionDetails() { return ReadTransactionDetailsRequest.class; } @Override public Class<? extends PISRequest> paymentInitiation() { return PaymentInitiationRequest.class; } @Override public Class<? extends PISRequest> paymentStatus() { return ReadPaymentStatusRequest.class; } @Override public Class<? extends PISRequest> paymentRetrieval() { return ReadPaymentRequest.class; } @Override public Class<? extends PISRequest> paymentCancellation() { return null; } @Override public Class<? extends PISRequest> paymentCancellationAuthorisation() { return null; } @Override public Class<? extends SCARequest> scaStart() { return StartAuthorisationRequest.class; } @Override public Class<? extends SCARequest> scaUpdateAuthentication() { return UpdatePSUAuthenticationRequest.class; } @Override public Class<? extends SCARequest> scaUpdateIdentification() { return UpdatePSUIdentificationRequest.class; } @Override public Class<? extends SCARequest> scaUpdateAuthenticationMethod() { return SelectAuthenticationMethodRequest.class; } @Override public Class<? extends SCARequest> scaAuthoriseTransaction() { return AuthoriseTransactionRequest.class; } @Override public Class<? extends SCARequest> scaStatus() { return GetSCAStatusRequest.class; } @Override public Class<? extends SCARequest> scaRetrieval() { return GetAuthorisationsRequest.class; } }
[ "52947253+pF-luis@users.noreply.github.com" ]
52947253+pF-luis@users.noreply.github.com
befd1381c5379ebcd613ed65a41c558561393afd
3d0d5917ebda5abf5b7eb8fe5f24f3b5b42a1f07
/AppDirectChallenge/src/main/java/com/appdirect/challenge/AppInit.java
7f8b58051d4d88fc3945a8efccdd4af5b6a873ff
[ "MIT" ]
permissive
deepakshingavi/DeepakWorkspace
add07c0ce9cbac5cbcc9e740c7d7625969f238a0
cd2b0186d28ffdbfcf9946487673002eb2f83188
refs/heads/master
2021-06-15T16:45:49.447104
2020-07-20T14:40:14
2020-07-20T14:40:14
74,059,953
3
0
null
2021-06-04T01:26:41
2016-11-17T19:25:32
Java
UTF-8
Java
false
false
609
java
package com.appdirect.challenge; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @EnableAutoConfiguration // spring-boot auto-configuration @EnableConfigurationProperties @ComponentScan public class AppInit { public static void main(String[] args) { SpringApplication.run(AppInit.class, args); } }
[ "deepakshingavi@gmail.com" ]
deepakshingavi@gmail.com
db772f27079a99be7d4b79fcad355ef9dd56da7e
ad50e2c2bd017372a21daade1604ad5f17e6639d
/app/src/main/java/com/teamleaf/samplestickerapp/Fragments/homeFragment.java
65f461233d0a34da0f80dda5b579b853a009a86d
[]
no_license
anandkrrai/WhatsappStickrs
36847ba92eca7683bb124bd33bb18a22254d1682
941b4e8505e971e8985c568f4f7d8b745fc22ab3
refs/heads/master
2020-04-05T17:56:49.676646
2018-11-17T18:59:03
2018-11-17T18:59:03
157,082,574
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
package com.teamleaf.samplestickerapp.Fragments; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.teamleaf.samplestickerapp.R; public class homeFragment extends Fragment { public homeFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home, container, false); return view; } }
[ "kumar.anand.rai@gmail.com" ]
kumar.anand.rai@gmail.com
2978923f0c35fbed0e9eedb628fa23599e9b6453
437e17149f5b5d7f13f8492749ea9156d90f8e87
/src/MaxDepth.java
b49d2c5fce2ce5474637df6bc533fd7f02c45cc5
[]
no_license
zhuyongWillem/NewCodeQuestion
126a1307720b5e7017bfdc29b44e90102f8b80de
76532c0084344031f8208affe6e1a28f68465776
refs/heads/master
2023-03-02T07:39:45.367810
2021-02-16T13:44:02
2021-02-16T13:44:02
339,313,575
0
0
null
null
null
null
UTF-8
Java
false
false
751
java
import java.util.LinkedList; import java.util.Queue; /** * description: * author: 朱勇 * time: 2021/2/12 10:42 */ public class MaxDepth { public int maxDepth (TreeNode root) { // write code here Queue<TreeNode> queue = new LinkedList<>(); int depth = 1; queue.offer(root); while (!queue.isEmpty()){ int size = queue.size(); for(int i = 0; i < size; i++){ TreeNode cur = queue.poll(); if(cur.left != null){ queue.offer(cur.left); } if(cur.right != null){ queue.offer(cur.right); } } depth++; } return depth; } }
[ "yong_zzhu@163.com" ]
yong_zzhu@163.com
0d81a3fa14fdc43e1d63a95d72dbca62f3a38f23
e115343bc718ee4a67950f114a2d0b4f6475b5a2
/src/main/java/com/bc/jpa/dao/functions/ConvertToEntityFieldNumberType.java
f567c61b576c161eb20ad4e7e0e877b3e9f11520
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
poshjosh/bcjpadao
366cffa6fb1790f4ee38cd52300cba4c81757218
777d839e49a88a714d7f4b7d49099b94cc2a4d8e
refs/heads/master
2023-01-19T11:20:24.150350
2023-01-06T09:47:13
2023-01-06T09:47:13
66,119,848
0
0
NOASSERTION
2022-01-21T23:43:33
2016-08-20T00:17:59
Java
UTF-8
Java
false
false
2,612
java
/* * Copyright 2018 NUROX Ltd. * * Licensed under the NUROX Ltd Software License (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.looseboxes.com/legal/licenses/software.html * * 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.bc.jpa.dao.functions; import java.io.Serializable; import java.lang.reflect.Field; import java.util.Objects; import java.util.function.BiFunction; import java.util.logging.Level; import java.util.logging.Logger; /** * @author Chinomso Bassey Ikwuagwu on Apr 8, 2018 12:44:00 AM */ public class ConvertToEntityFieldNumberType implements Serializable { private transient static final Logger LOG = Logger.getLogger(ConvertToEntityFieldNumberType.class.getName()); private final BiFunction<Object, Class, Object> toNumber; public ConvertToEntityFieldNumberType() { this.toNumber = new ConvertToNumber(); } public Object apply(Class entityType, String col, Object val, Object outputIfNone) { Objects.requireNonNull(entityType); Objects.requireNonNull(col); Objects.requireNonNull(val); Object ret = null; try{ final Field field = entityType.getDeclaredField(col); if(field != null) { final Class fieldType = field.getType(); final Class valType = val.getClass(); LOG.finer(() -> "Field type: " + fieldType + ", value type: " + valType); if(!Objects.equals(fieldType, valType)) { ret = this.toNumber.apply(val, fieldType); } } }catch(RuntimeException | NoSuchFieldException ignored) { LOG.fine(() -> ignored + "\nAbove exception encountered for: " + entityType.getName() + '#' + col); } if(LOG.isLoggable(Level.FINER)) { LOG.log(Level.FINER, "{0} {1} converted to {2} {3}", new Object[]{val.getClass().getName(), val, ret == null ? null : ret.getClass().getName(), ret}); } return ret == null ? outputIfNone : ret; } }
[ "Josh@Josh-PC" ]
Josh@Josh-PC
7c7f82da2aeff7f1e9c2d4d36a9498d4df24616a
129d230d787fa3a411f0854610f878f9193d2c6c
/src/main/java/by/tc/task01/dao/creation/impl/OvenCreator.java
36bbe67301b897d03a8d6d1fb9743829745c3015
[]
no_license
Olgarudzko/ApplianceSearch
5f2e27c24934dd12cb553cf2a6e004247ce8b04f
08a3cad0f749ad667a526a97c3d11b55bc1bee13
refs/heads/master
2021-07-11T04:36:08.787083
2017-10-12T19:56:08
2017-10-12T19:56:08
106,014,253
0
0
null
null
null
null
UTF-8
Java
false
false
1,346
java
package by.tc.task01.dao.creation.impl; import by.tc.task01.dao.creation.ApplianceCreator; import by.tc.task01.entity.Oven; import by.tc.task01.extra.Strings; public class OvenCreator implements ApplianceCreator { public Oven create(String[] parameters) { Oven oven = new Oven(); for (int j = 1; j < parameters.length; j++) { String[] parsedForResponse = parameters[j].trim().split(Strings.EQUAL); String parameter = parsedForResponse[0]; String value = parsedForResponse[1]; if (parameter.equalsIgnoreCase(Strings.POWER_CONSUMPTION)) { oven.setPowerConsumption(Double.valueOf(value)); } else if (parameter.equalsIgnoreCase(Strings.WEIGHT)) { oven.setWeight(Double.valueOf(value)); } else if (parameter.equalsIgnoreCase(Strings.CAPACITY)) { oven.setCapacity(Double.valueOf(value)); } else if (parameter.equalsIgnoreCase(Strings.DEPTH)) { oven.setDepth(Double.valueOf(value)); } else if (parameter.equalsIgnoreCase(Strings.HEIGHT)) { oven.setHeight(Double.valueOf(value)); } else if (parameter.equalsIgnoreCase(Strings.WIDTH)) { oven.setWidth(Double.valueOf(value)); } } return oven; } }
[ "leta.rudzko@gmail.com" ]
leta.rudzko@gmail.com
c791899de320342656295fbb8793616e5bb0cca2
6fdfcd7830cb30d92dca5584ffe01551dee9d40b
/src/lesson15/equals/User.java
a6ac312232d8896ea2cfbc3d246632533117de39
[]
no_license
dsvths/java-core-grom
7de823d41e396e34264194f4ecb97dfc71d046b7
4a292b9c609aabdbf13a2cd7ff884ee7d4ac3a6b
refs/heads/master
2020-06-01T17:50:10.649022
2017-11-01T11:09:27
2017-11-01T11:09:27
94,081,681
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package lesson15.equals; /** * Created by Savenko on 29.07.2017. */ public class User { private long id; public User(long id) { this.id = id; } }
[ "dsvths@gmail.com" ]
dsvths@gmail.com
c024ec9510897ae9825dd18ad6838dc8f74eab6e
5f07e0f61b2a5beb42621f97fa1470a872b8f184
/src/test/java/indexingTopology/metadata/FilePartitionSchemaManagerTest.java
17f96caa06b5bf9614eba4909cce9f42ed8d0a43
[]
no_license
wangli1426/IndexingTopology
6f1bd68deb59225d4d9bd11486ae34cb8a2ceacb
630c7c123eba002fc0d09968483a5924b66c13a5
refs/heads/master
2020-05-30T13:56:44.373076
2017-05-17T03:13:00
2017-05-17T03:13:00
66,612,834
1
1
null
2017-05-17T02:40:30
2016-08-26T03:16:49
Java
UTF-8
Java
false
false
2,157
java
package indexingTopology.metadata; import org.junit.Test; import static org.junit.Assert.*; /** * Created by acelzj on 12/22/16. */ public class FilePartitionSchemaManagerTest { @Test public void searchInKeyRangeAndTimestampRange() throws Exception { FilePartitionSchemaManager partitionSchemaManager = new FilePartitionSchemaManager(); partitionSchemaManager.add(new FileMetaData("file 1", 50, 100, 20000, 30000)); partitionSchemaManager.add(new FileMetaData("file 2", 20, 100, 22000, 28000)); assertEquals("file 1", partitionSchemaManager.search(60, 61, 20000, 25000).get(0)); assertEquals("file 2", partitionSchemaManager.search(60, 61, 20000, 25000).get(1)); assertEquals(2, partitionSchemaManager.search(60, 61, 20000, 25000).size()); } @Test public void searchNotInKeyRangeButTimestampRange() throws Exception { FilePartitionSchemaManager partitionSchemaManager = new FilePartitionSchemaManager(); partitionSchemaManager.add(new FileMetaData("file 1", 50, 100, 20000, 30000)); partitionSchemaManager.add(new FileMetaData("file 2", 20, 100, 22000, 28000)); assertEquals(0, partitionSchemaManager.search(200, Integer.MAX_VALUE, 20000, 25000).size()); } @Test public void searchNotInTimestampRangeButKeyRange() throws Exception { FilePartitionSchemaManager partitionSchemaManager = new FilePartitionSchemaManager(); partitionSchemaManager.add(new FileMetaData("file 1", 50, 100, 20000, 30000)); partitionSchemaManager.add(new FileMetaData("file 2", 20, 100, 22000, 28000)); assertEquals(0, partitionSchemaManager.search(0, 100, 0, 10000).size()); } @Test public void searchNotInTimestampRangeAndKeyRange() throws Exception { FilePartitionSchemaManager partitionSchemaManager = new FilePartitionSchemaManager(); partitionSchemaManager.add(new FileMetaData("file 1", 50, 100, 20000, 30000)); partitionSchemaManager.add(new FileMetaData("file 2", 20, 100, 22000, 28000)); assertEquals(0, partitionSchemaManager.search(110, 120, 31000, 320000).size()); } }
[ "wslzj40@gmail.com" ]
wslzj40@gmail.com
e614aa977b0ac569b149ac4a9d6982c8159ff547
e242fbe613ea1797bb7a9b7be1b745797b23c7a5
/learn/src/main/java/org/ruogu/learn/lang/object/ObjectTest.java
379b241edb7efb9fc998485f0c1998877c2cc6d0
[ "Apache-2.0" ]
permissive
yintaoxue/learn
9603cae0e5ca0cfb1666a203da151b9c199850bf
35b83a6c5cbf4f15db5ae7c85480228bdde0b854
refs/heads/master
2021-01-10T01:05:49.273333
2016-12-03T10:52:07
2016-12-03T10:52:07
51,134,539
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package org.ruogu.learn.lang.object; /** * ObjectTest * * @author xueyintao 2016年2月6日 上午10:13:33 */ public class ObjectTest { /** * @param args */ public static void main(String[] args) { Object o = new Object(); } }
[ "yintaoxue@gmail.com" ]
yintaoxue@gmail.com
92b39b250803185ca4db3ff6538c52f72436f40e
e3591ef38e2928c69183c1bc0e4d15d7b020751c
/sources/APK_Decompiled_to_java/DSAPK/src/main/java/android/support/v4/graphics/TypefaceCompatUtil.java
90d9dd311d9905213e469af80b600559c51da4ba
[]
no_license
d8ahazard/DreamscreenDocs
ab0695151d501d6f2176b21785eedaa5fc7f6557
225fbe6a279885fb6a54487ac4fe6a5a908878d9
refs/heads/master
2021-06-25T02:49:49.410684
2021-06-07T12:51:11
2021-06-07T12:51:11
225,887,222
6
1
null
null
null
null
UTF-8
Java
false
false
11,067
java
package androidx.core.graphics; import android.content.Context; import android.content.res.Resources; import android.os.Process; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.RestrictTo; import androidx.annotation.RestrictTo.Scope; import android.util.Log; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.FileChannel.MapMode; @RestrictTo({Scope.LIBRARY_GROUP}) public class TypefaceCompatUtil { private static final String CACHE_FILE_PREFIX = ".font"; private static final String TAG = "TypefaceCompatUtil"; private TypefaceCompatUtil() { } @Nullable public static File getTempFile(Context context) { String prefix = CACHE_FILE_PREFIX + Process.myPid() + "-" + Process.myTid() + "-"; int i = 0; while (i < 100) { File file = new File(context.getCacheDir(), prefix + i); try { if (file.createNewFile()) { return file; } i++; } catch (IOException e) { } } return null; } @Nullable @RequiresApi(19) private static ByteBuffer mmap(File file) { Throwable th; try { FileInputStream fis = new FileInputStream(file); Throwable th2 = null; try { FileChannel channel = fis.getChannel(); MappedByteBuffer map = channel.map(MapMode.READ_ONLY, 0, channel.size()); if (fis == null) { return map; } if (0 != 0) { try { fis.close(); return map; } catch (Throwable th3) { th2.addSuppressed(th3); return map; } } else { fis.close(); return map; } } catch (Throwable th4) { Throwable th5 = th4; th = r1; th = th5; } if (fis != null) { if (th != null) { try { fis.close(); } catch (Throwable th6) { th.addSuppressed(th6); } } else { fis.close(); } } throw th; throw th; } catch (IOException e) { return null; } } /* JADX WARNING: Code restructure failed: missing block: B:17:0x0034, code lost: r2 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost: r10.addSuppressed(r2); */ /* JADX WARNING: Code restructure failed: missing block: B:26:0x0041, code lost: if (r2 != null) goto L_0x0043; */ /* JADX WARNING: Code restructure failed: missing block: B:28:?, code lost: r8.close(); */ /* JADX WARNING: Code restructure failed: missing block: B:35:0x004e, code lost: r1 = th; */ /* JADX WARNING: Code restructure failed: missing block: B:36:0x004f, code lost: r2 = r11; */ /* JADX WARNING: Code restructure failed: missing block: B:52:0x0068, code lost: r3 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:53:0x0069, code lost: r2.addSuppressed(r3); */ /* JADX WARNING: Code restructure failed: missing block: B:55:0x0071, code lost: r3 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:57:?, code lost: r2.addSuppressed(r3); */ /* JADX WARNING: Code restructure failed: missing block: B:58:0x0076, code lost: r8.close(); */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Removed duplicated region for block: B:26:0x0041 */ /* JADX WARNING: Removed duplicated region for block: B:35:0x004e A[ExcHandler: all (th java.lang.Throwable), Splitter:B:4:0x000b] */ @androidx.annotation.Nullable @androidx.annotation.RequiresApi(19) /* Code decompiled incorrectly, please refer to instructions dump. */ public static java.nio.ByteBuffer mmap(android.content.Context r13, android.os.CancellationSignal r14, android.net.Uri r15) { /* android.content.ContentResolver r9 = r13.getContentResolver() java.lang.String r1 = "r" android.os.ParcelFileDescriptor r8 = r9.openFileDescriptor(r15, r1, r14) // Catch:{ IOException -> 0x0047 } r11 = 0 java.io.FileInputStream r7 = new java.io.FileInputStream // Catch:{ Throwable -> 0x0039, all -> 0x004e } java.io.FileDescriptor r1 = r8.getFileDescriptor() // Catch:{ Throwable -> 0x0039, all -> 0x004e } r7.<init>(r1) // Catch:{ Throwable -> 0x0039, all -> 0x004e } r10 = 0 java.nio.channels.FileChannel r0 = r7.getChannel() // Catch:{ Throwable -> 0x005a, all -> 0x007a } long r4 = r0.size() // Catch:{ Throwable -> 0x005a, all -> 0x007a } java.nio.channels.FileChannel$MapMode r1 = java.nio.channels.FileChannel.MapMode.READ_ONLY // Catch:{ Throwable -> 0x005a, all -> 0x007a } r2 = 0 java.nio.MappedByteBuffer r1 = r0.map(r1, r2, r4) // Catch:{ Throwable -> 0x005a, all -> 0x007a } if (r7 == 0) goto L_0x002c if (r10 == 0) goto L_0x004a r7.close() // Catch:{ Throwable -> 0x0034, all -> 0x004e } L_0x002c: if (r8 == 0) goto L_0x0033 if (r11 == 0) goto L_0x0056 r8.close() // Catch:{ Throwable -> 0x0051 } L_0x0033: return r1 L_0x0034: r2 = move-exception r10.addSuppressed(r2) // Catch:{ Throwable -> 0x0039, all -> 0x004e } goto L_0x002c L_0x0039: r1 = move-exception throw r1 // Catch:{ all -> 0x003b } L_0x003b: r2 = move-exception r12 = r2 r2 = r1 r1 = r12 L_0x003f: if (r8 == 0) goto L_0x0046 if (r2 == 0) goto L_0x0076 r8.close() // Catch:{ Throwable -> 0x0071 } L_0x0046: throw r1 // Catch:{ IOException -> 0x0047 } L_0x0047: r6 = move-exception r1 = 0 goto L_0x0033 L_0x004a: r7.close() // Catch:{ Throwable -> 0x0039, all -> 0x004e } goto L_0x002c L_0x004e: r1 = move-exception r2 = r11 goto L_0x003f L_0x0051: r2 = move-exception r11.addSuppressed(r2) // Catch:{ IOException -> 0x0047 } goto L_0x0033 L_0x0056: r8.close() // Catch:{ IOException -> 0x0047 } goto L_0x0033 L_0x005a: r1 = move-exception throw r1 // Catch:{ all -> 0x005c } L_0x005c: r2 = move-exception r12 = r2 r2 = r1 r1 = r12 L_0x0060: if (r7 == 0) goto L_0x0067 if (r2 == 0) goto L_0x006d r7.close() // Catch:{ Throwable -> 0x0068, all -> 0x004e } L_0x0067: throw r1 // Catch:{ Throwable -> 0x0039, all -> 0x004e } L_0x0068: r3 = move-exception r2.addSuppressed(r3) // Catch:{ Throwable -> 0x0039, all -> 0x004e } goto L_0x0067 L_0x006d: r7.close() // Catch:{ Throwable -> 0x0039, all -> 0x004e } goto L_0x0067 L_0x0071: r3 = move-exception r2.addSuppressed(r3) // Catch:{ IOException -> 0x0047 } goto L_0x0046 L_0x0076: r8.close() // Catch:{ IOException -> 0x0047 } goto L_0x0046 L_0x007a: r1 = move-exception r2 = r10 goto L_0x0060 */ throw new UnsupportedOperationException("Method not decompiled: android.support.v4.graphics.TypefaceCompatUtil.mmap(android.content.Context, android.os.CancellationSignal, android.net.Uri):java.nio.ByteBuffer"); } @Nullable @RequiresApi(19) public static ByteBuffer copyToDirectBuffer(Context context, Resources res, int id) { ByteBuffer byteBuffer = null; File tmpFile = getTempFile(context); if (tmpFile != null) { try { if (copyToFile(tmpFile, res, id)) { byteBuffer = mmap(tmpFile); tmpFile.delete(); } } finally { tmpFile.delete(); } } return byteBuffer; } public static boolean copyToFile(File file, InputStream is) { FileOutputStream os = null; try { FileOutputStream os2 = new FileOutputStream(file, false); try { byte[] buffer = new byte[1024]; while (true) { int readLen = is.read(buffer); if (readLen != -1) { os2.write(buffer, 0, readLen); } else { closeQuietly(os2); FileOutputStream fileOutputStream = os2; return true; } } } catch (IOException e) { e = e; os = os2; try { Log.e(TAG, "Error copying resource contents to temp file: " + e.getMessage()); closeQuietly(os); return false; } catch (Throwable th) { th = th; closeQuietly(os); throw th; } } catch (Throwable th2) { th = th2; os = os2; closeQuietly(os); throw th; } } catch (IOException e2) { e = e2; Log.e(TAG, "Error copying resource contents to temp file: " + e.getMessage()); closeQuietly(os); return false; } } public static boolean copyToFile(File file, Resources res, int id) { InputStream is = null; try { is = res.openRawResource(id); return copyToFile(file, is); } finally { closeQuietly(is); } } public static void closeQuietly(Closeable c) { if (c != null) { try { c.close(); } catch (IOException e) { } } } }
[ "d8ahazard@gmail.com" ]
d8ahazard@gmail.com
8f6e90cfca6d46c144c736557fd423dcb0ea55eb
e96172bcad99d9fddaa00c25d00a319716c9ca3a
/plugin/src/test/resources/codeInsight/daemonCodeAnalyzer/lambda/graphInference/InferenceFromSiblings.java
1cad86808b98945503938a92c6b370f5fde584cd
[ "Apache-2.0" ]
permissive
consulo/consulo-java
8c1633d485833651e2a9ecda43e27c3cbfa70a8a
a96757bc015eff692571285c0a10a140c8c721f8
refs/heads/master
2023-09-03T12:33:23.746878
2023-08-29T07:26:25
2023-08-29T07:26:25
13,799,330
5
4
Apache-2.0
2023-01-03T08:32:23
2013-10-23T09:56:39
Java
UTF-8
Java
false
false
553
java
import java.util.*; class Main { void test(List<Integer> li) { Fun<Stream<Integer>, Stream<Integer>> f = s -> s.substr(0); foo(li, f, Collections.emptyList()); foo(li, s -> s.substr(0), Collections.emptyList()); } <T, U, S_OUT extends Stream<U>, It extends Iterable<U>> Collection<U> foo(Collection<T> coll, Fun<Stream<T>, S_OUT> f, It it) { return null; } interface Stream<T> { Stream<T> substr(long startingOffset); } interface Fun<T, R> { R _(T t); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
956a5eeba2fa55389474c47ff9773dfb748c114f
0495f96b8ce37e54b78b7af618eaa0781204f31c
/greenfox/Valentin900614/week-01/day-5/src/DrawDiagonal.java
7dcbc4cfaabe3bfc637a3fd18f233ea2f2390256
[]
no_license
green-fox-academy/Valentin900614
867d7dc260cc4115848c58b8a7bbcbd084ae2386
dc977c9a6796edf901e0bfe425bd441de63221ff
refs/heads/master
2020-04-17T00:21:19.087705
2019-04-03T09:06:21
2019-04-03T09:06:21
166,047,367
0
0
null
null
null
null
UTF-8
Java
false
false
970
java
import java.util.Scanner; public class DrawDiagonal { public static void main(String[] args) { // Write a program that reads a number from the standard input, then draws a // square like this: // // // %%%%% // %% % // % % % // % %% // %%%%% // // The square should have as many lines as the number was Scanner scanner = new Scanner(System.in); System.out.println("Gimme a number!"); int a = scanner.nextInt(); for(int i=1;i<=a;i++){ for(int j=1;j<=a;j++){ if(i>1 && i<a && j>1 && j< a){ if(i==j){ System.out.print("*"); }else{ System.out.print(" "); } } else{ System.out.print("*"); } } System.out.println(); } } }
[ "valentin.karoly@gmail.com" ]
valentin.karoly@gmail.com
216155aa257dde68cf770d8c3e6347da06d4c954
1479992551e15290df0d0f9018305eeb540550a8
/src/digital_root/DigitalRootTest.java
709f966e7d5a2cf73690da7ec7b2871aa50daeb3
[ "MIT" ]
permissive
agarner101/CodeWarsJava
52e183395fec03ee9ca8adbdbfcd735ae09f68d4
cf3209b95c86450112d8a753fb1c07e7d9dcbfb3
refs/heads/master
2020-03-06T21:55:52.636074
2018-04-13T16:48:34
2018-04-13T16:48:34
127,090,035
0
0
null
2018-03-28T08:05:30
2018-03-28T05:48:41
Java
UTF-8
Java
false
false
1,669
java
package digital_root; import junit.framework.Assert; import junit.framework.TestCase; /** * Tests for {@link DigitalRoot} * Created by andrewgarner on 4/2/18. */ public class DigitalRootTest extends TestCase { //---- Solution 2 ---- public void testSolve2A() throws Exception { Assert.assertEquals(7, DigitalRoot.solve2(16)); } public void testSolve2B() throws Exception { Assert.assertEquals(6, DigitalRoot.solve2(942)); } public void testSolve2C() throws Exception { Assert.assertEquals(6, DigitalRoot.solve2(132189)); } public void testSolve2D() throws Exception { Assert.assertEquals(2, DigitalRoot.solve2(493193)); } //---- Solution 1 ---- public void testSolve1A() throws Exception { Assert.assertEquals(7, DigitalRoot.solve1(16)); } public void testSolve1B() throws Exception { Assert.assertEquals(6, DigitalRoot.solve1(942)); } public void testSolve1C() throws Exception { Assert.assertEquals(6, DigitalRoot.solve1(132189)); } public void testSolve1D() throws Exception { Assert.assertEquals(2, DigitalRoot.solve1(493193)); } //---- Solution 0 ---- public void testSolve0A() throws Exception { Assert.assertEquals(7, DigitalRoot.solve0(16)); } public void testSolve0B() throws Exception { Assert.assertEquals(6, DigitalRoot.solve0(942)); } public void testSolve0C() throws Exception { Assert.assertEquals(6, DigitalRoot.solve0(132189)); } public void testSolve0D() throws Exception { Assert.assertEquals(2, DigitalRoot.solve0(493193)); } }
[ "andrewgarner101@gmail.com" ]
andrewgarner101@gmail.com
a18afe75dea04872abf1f919b6d9a26f8e9f17fe
11ebccff85b719be419654dea410561cb1b5552f
/javaProgramming/src/ch06/exam14/Calculator3.java
c0a481d4f21f28c8cc0cdbcfac67c4cba6d8050c
[]
no_license
parkhyuntae12/MyRepository
f93433032933324280ef98ed2e3c5455ba2a54ea
bb09eb08c81f66922d3a3157037319579ee20179
refs/heads/master
2020-12-03T10:19:32.432964
2016-12-12T01:44:51
2016-12-12T01:44:51
66,317,335
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package ch06.exam14; public class Calculator3 { //Field final int field2; //Constructor Calculator3(int field2){ this.field2=field2; } //Method public static void main(String[] args){ Calculator3 ca1 = new Calculator3(5); Calculator3 ca2 = new Calculator3(7); } }
[ "Administrator@COM-PC" ]
Administrator@COM-PC
a69cc8af86d50a84adaf8dde730c706e0ac70aea
02d8ecc5267cbe936c94b933f783cad1a889c4cd
/src/main/java/pl/wiktordolecki/Excercise01.java
bf95558e13dfd0256ab9e25211feea6bfc29ca84
[]
no_license
fellipebezerra/epam_evaluation
87dd764ea99def76c12f62b4b43db93fc586d465
1a305c731bad5531be5b09d5fde2fcf71bca7328
refs/heads/master
2021-01-23T00:29:14.694086
2017-03-21T18:19:14
2017-03-21T18:19:14
85,737,663
1
0
null
null
null
null
UTF-8
Java
false
false
1,453
java
package pl.wiktordolecki; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Write a function that for an argument int n * returns a list of positive numbers lesser or equal to n which are divisible by 3 or 5. * List should be sorted in ascending order without repetitions. * For value 0 and all negative values of n return empty list. */ /** * @author Felipe Bezerra */ public class Excercise01 { /** * Your solution should be implemented in this method. * Corresponding test class contains few examples of correct input, output pairs. * * @param n Nonegative integer for inclusive upper bound of list contents * @return List object containing positive integers lesser or equal to n * that are divisible by 3 or 5 */ public static List<Integer> divisibleBy3OR5(int n) { List<Integer> response = new ArrayList<Integer>(); int num = n; int control = 1; while(control <= num){ if (control%3==0){ response.add(control); } if (control%5==0){ response.add(control); } control++; } return response; } /** * BONUS: List of divisors can be passed as additional parameter. */ public static List<Integer> divisibleBy(int n, List<Integer> divisors) { return Collections.emptyList(); } }
[ "t33913895833@nsp136508.DASA.NET" ]
t33913895833@nsp136508.DASA.NET
fe85db03c4239879b436ed8c9cf824ad67186e04
bda3e95a5c8388a80d1b4e0487abf64eb6300549
/finalproject/src/main/java/br/com/management/model/SortingType.java
c53d27784a43bd99aadac15531c27008b4e69dcc
[]
no_license
RenanChagas/ProjectManagement
9d8b6d2210ed0b94157f9541660de36b3696c5dd
3547cbc84fdb0defc7d4a6cf991f90d1a0bcde7b
refs/heads/master
2021-01-20T09:36:31.649022
2017-12-01T23:19:08
2017-12-01T23:19:08
101,600,448
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package br.com.management.model; public enum SortingType { LATEST("Latest"), NEWEST("Newest"), FINISHED("Finished"); String sortingType; SortingType(String sortingType){ this.sortingType = sortingType; } public String getSortingType() { return sortingType; } public void setSortingType(String sortingType) { this.sortingType = sortingType; } }
[ "renanchagasw@gmail.com" ]
renanchagasw@gmail.com
70421ddff1c30b9ee445dcf661ecdabe2195d8e5
b6eddad80943540506a76e488a65eaa00cc5df2e
/src/ecommerce/pos/vew/FCadastro.java
696ca299f980f5b6a82135b543aa32ffe3a4e2ae
[]
no_license
michelFB/POS.ECOMERECE.SWING
8b0752fa666feeeb2ecc1c494b45e75116d27f99
ad91b4023f372f866fd14d63797fa1a27945ca23
refs/heads/master
2022-04-09T05:56:06.325016
2020-03-21T22:12:51
2020-03-21T22:12:51
108,550,876
0
0
null
null
null
null
UTF-8
Java
false
false
33,899
java
package ecommerce.pos.vew; import ecommerce.pos.facade.Facade; import ecommerce.pos.models.Pessoa; import ecommerce.pos.models.PessoaFisica; import ecommerce.pos.models.PessoaJuridica; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; public class FCadastro extends javax.swing.JFrame { /** * */ private static final long serialVersionUID = -6085322963797765162L; private JFrame janelaPai; private JPanel panel; private Pessoa pessoa; private Facade fachada; //construtor public FCadastro(JFrame janelaPai, Facade fachada) { this.janelaPai = janelaPai; this.fachada = fachada; janelaPai.setVisible(false); initComponents(); configurar(); } private void configurar(){ radioGrupo.add(rbPessoaFisica); radioGrupo.add(rbPessoaJuridica); rbPessoaFisica.setSelected(true); tabPanel.setSelectedIndex(0); panel = (JPanel) tabPanel.getComponentAt(1); tabPanel.remove(1); } private void formParaObjeto(){ pessoa = rbPessoaFisica.isSelected() ? new PessoaFisica() : new PessoaJuridica(); if (pessoa instanceof PessoaFisica) { ((PessoaFisica)pessoa).setNome(tfNome.getText()); ((PessoaFisica)pessoa).setCpf(tfCPF.getText()); ((PessoaFisica)pessoa).setDatanascimento(tfData.getText()); }else if (pessoa instanceof PessoaJuridica) { ((PessoaJuridica)pessoa).setNomefantasia(tfNomeFantasia.getText()); ((PessoaJuridica)pessoa).setCnpj(tfCnpj.getText()); ((PessoaJuridica)pessoa).setRazaosocial(tfRazaoSocial.getText()); } pessoa.setLogin(tfLogin.getText()); pessoa.setSenha(tfSenha.getText()); pessoa.getContato().setEmail(tfEmail.getText()); pessoa.getContato().setTelefone(tfTelefone.getText()); pessoa.getEndereco().setEstado(tfUF.getText()); pessoa.getEndereco().setCidade(tfCidade.getText()); pessoa.getEndereco().setLogradouro(tfLogradouro.getText()); pessoa.getEndereco().setNumero(tfNumero.getText()); pessoa.getEndereco().setBairro(tfBairro.getText()); pessoa.getEndereco().setCep(tfCep.getText()); } private void sair(){ setVisible(false); janelaPai.setVisible(true); } /** * 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() { radioGrupo = new javax.swing.ButtonGroup(); tfCadastro = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); tfLogin = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); tfSenha = new javax.swing.JPasswordField(); tabPanel = new javax.swing.JTabbedPane(); pPessoaFisica = new javax.swing.JPanel(); tfNome = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); tfCPF = new javax.swing.JTextField(); tfData = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); pPessoaJuridica = new javax.swing.JPanel(); jLabel14 = new javax.swing.JLabel(); tfCnpj = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); tfRazaoSocial = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); tfNomeFantasia = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); rbPessoaFisica = new javax.swing.JRadioButton(); rbPessoaJuridica = new javax.swing.JRadioButton(); jPanel5 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); tfLogradouro = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); tfCidade = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); tfUF = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); tfNumero = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); tfBairro = new javax.swing.JTextField(); jLabel17 = new javax.swing.JLabel(); tfCep = new javax.swing.JTextField(); jPanel6 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); tfTelefone = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); tfCelular = new javax.swing.JTextField(); jLabel11 = new javax.swing.JLabel(); tfEmail = new javax.swing.JTextField(); tfCadastro1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); tfCadastro.setText("Registrar"); tfCadastro.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfCadastroActionPerformed(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados de Acesso")); jLabel12.setText("Login:"); jLabel13.setText("Senha:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel12) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tfLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tfSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12) .addComponent(tfLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13) .addComponent(tfSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); tabPanel.setName(""); // NOI18N tfNome.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfNomeActionPerformed(evt); } }); jLabel1.setText("Nome:"); jLabel2.setText("CPF:"); tfData.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfDataActionPerformed(evt); } }); jLabel3.setText("Nascimento:"); javax.swing.GroupLayout pPessoaFisicaLayout = new javax.swing.GroupLayout(pPessoaFisica); pPessoaFisica.setLayout(pPessoaFisicaLayout); pPessoaFisicaLayout.setHorizontalGroup( pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pPessoaFisicaLayout.createSequentialGroup() .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pPessoaFisicaLayout.createSequentialGroup() .addContainerGap() .addComponent(jLabel3)) .addGroup(pPessoaFisicaLayout.createSequentialGroup() .addGap(36, 36, 36) .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2) .addComponent(jLabel1)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tfData, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfCPF, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfNome, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(16, Short.MAX_VALUE)) ); pPessoaFisicaLayout.setVerticalGroup( pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pPessoaFisicaLayout.createSequentialGroup() .addContainerGap() .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(tfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaFisicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addContainerGap(14, Short.MAX_VALUE)) ); tabPanel.addTab("Dados Pessoa Física", pPessoaFisica); jLabel14.setText("CNPJ:"); tfCnpj.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfCnpjActionPerformed(evt); } }); jLabel15.setText("Razão Social:"); jLabel16.setText("Fantasia:"); tfNomeFantasia.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfNomeFantasiaActionPerformed(evt); } }); javax.swing.GroupLayout pPessoaJuridicaLayout = new javax.swing.GroupLayout(pPessoaJuridica); pPessoaJuridica.setLayout(pPessoaJuridicaLayout); pPessoaJuridicaLayout.setHorizontalGroup( pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pPessoaJuridicaLayout.createSequentialGroup() .addContainerGap() .addGroup(pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel16) .addComponent(jLabel15) .addComponent(jLabel14)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(tfCnpj, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE) .addComponent(tfRazaoSocial) .addComponent(tfNomeFantasia)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pPessoaJuridicaLayout.setVerticalGroup( pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pPessoaJuridicaLayout.createSequentialGroup() .addContainerGap() .addGroup(pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14) .addComponent(tfCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfRazaoSocial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(pPessoaJuridicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfNomeFantasia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16)) .addContainerGap(14, Short.MAX_VALUE)) ); tabPanel.addTab("Dados Pessoa Física", pPessoaJuridica); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Tipo de Pessoa")); rbPessoaFisica.setText("Pessoa Física"); rbPessoaFisica.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbPessoaFisicaActionPerformed(evt); } }); rbPessoaJuridica.setText("Pessoa Jurídica"); rbPessoaJuridica.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbPessoaJuridicaActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addComponent(rbPessoaFisica) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(rbPessoaJuridica) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(rbPessoaFisica) .addComponent(rbPessoaJuridica)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados de Endereço")); jLabel4.setText("Logradouro:"); jLabel6.setText("Cidade:"); jLabel8.setText("UF:"); tfUF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfUFActionPerformed(evt); } }); jLabel5.setText("Numero:"); tfNumero.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfNumeroActionPerformed(evt); } }); jLabel7.setText("Bairro:"); jLabel17.setText("CEP:"); tfCep.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfCepActionPerformed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addGap(13, 13, 13) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel7) .addComponent(jLabel6) .addComponent(jLabel8) .addComponent(jLabel5) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tfLogradouro) .addComponent(tfCidade) .addComponent(tfBairro) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(tfNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 137, Short.MAX_VALUE)) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(tfUF, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jLabel17) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tfCep))) .addContainerGap()) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel17) .addComponent(tfCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8) .addComponent(tfUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(tfCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(tfLogradouro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(tfNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(tfBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados de Contato")); jLabel9.setText("Telefone:"); jLabel10.setText("Celular:"); jLabel11.setText("E-mail:"); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel11) .addComponent(jLabel10) .addComponent(jLabel9)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tfTelefone, javax.swing.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE) .addComponent(tfCelular) .addComponent(tfEmail)) .addContainerGap()) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9) .addComponent(tfTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel10) .addComponent(tfCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11) .addComponent(tfEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); tfCadastro1.setText("Cancelar"); tfCadastro1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfCadastro1ActionPerformed(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) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(tabPanel, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfCadastro1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(tfCadastro)) .addContainerGap(20, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(11, 11, 11) .addComponent(tabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 32, Short.MAX_VALUE) .addComponent(tfCadastro1)) .addComponent(tfCadastro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void tfNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfNomeActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfNomeActionPerformed private void tfDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfDataActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfDataActionPerformed private void tfNumeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfNumeroActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfNumeroActionPerformed private void tfUFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfUFActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfUFActionPerformed private void tfCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCadastroActionPerformed formParaObjeto(); fachada.cadastrar(pessoa); JOptionPane.showMessageDialog(this, "Cadastro realizado com sucesso!"); sair(); }//GEN-LAST:event_tfCadastroActionPerformed private void tfCnpjActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCnpjActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfCnpjActionPerformed private void tfNomeFantasiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfNomeFantasiaActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfNomeFantasiaActionPerformed private void tfCadastro1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCadastro1ActionPerformed sair(); //dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); }//GEN-LAST:event_tfCadastro1ActionPerformed private void rbPessoaFisicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbPessoaFisicaActionPerformed tabPanel.add(panel); //tabPanel.setSelectedIndex(0); panel = (JPanel) tabPanel.getComponentAt(0); tabPanel.remove(0); }//GEN-LAST:event_rbPessoaFisicaActionPerformed private void rbPessoaJuridicaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbPessoaJuridicaActionPerformed tabPanel.add(panel); //tabPanel.setSelectedIndex(0); panel = (JPanel) tabPanel.getComponentAt(0); tabPanel.remove(0); }//GEN-LAST:event_rbPessoaJuridicaActionPerformed private void tfCepActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCepActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfCepActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JPanel pPessoaFisica; private javax.swing.JPanel pPessoaJuridica; private javax.swing.ButtonGroup radioGrupo; private javax.swing.JRadioButton rbPessoaFisica; private javax.swing.JRadioButton rbPessoaJuridica; private javax.swing.JTabbedPane tabPanel; private javax.swing.JTextField tfBairro; private javax.swing.JTextField tfCPF; private javax.swing.JButton tfCadastro; private javax.swing.JButton tfCadastro1; private javax.swing.JTextField tfCelular; private javax.swing.JTextField tfCep; private javax.swing.JTextField tfCidade; private javax.swing.JTextField tfCnpj; private javax.swing.JTextField tfData; private javax.swing.JTextField tfEmail; private javax.swing.JTextField tfLogin; private javax.swing.JTextField tfLogradouro; private javax.swing.JTextField tfNome; private javax.swing.JTextField tfNomeFantasia; private javax.swing.JTextField tfNumero; private javax.swing.JTextField tfRazaoSocial; private javax.swing.JPasswordField tfSenha; private javax.swing.JTextField tfTelefone; private javax.swing.JTextField tfUF; // End of variables declaration//GEN-END:variables }
[ "michelb@dsobdrobmichelb.redechesf.local" ]
michelb@dsobdrobmichelb.redechesf.local
9c609de3c1efbabe2150de276527dcceb3670ec2
4d43a094e53e6252e8d2b37a5337ce605a2a317e
/app/src/main/java/com/ajou/auction/Main/HotBoardListItem.java
fb71e6771dab6b2f1ae0dabf2ce379fe9e2f3f55
[]
no_license
ohjungsuk/Auction
e64b1de29be40addefd685d263c66a8cec286687
6a21da9b03657494a5e33b4fe08b5390b359892e
refs/heads/main
2023-05-10T01:32:47.411238
2021-06-10T16:46:42
2021-06-10T16:46:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,573
java
package com.ajou.auction.Main; import com.ajou.auction.Category.Model.BettingInfos; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class HotBoardListItem { @SerializedName("auctionDeadline") @Expose private String auctionDeadline; @SerializedName("boardId") @Expose private String boardId; @SerializedName("category") @Expose private String category; @SerializedName("completion") @Expose private String completion; @SerializedName("content") @Expose private String content; @SerializedName("likeNumber") @Expose private String likeNumber; @SerializedName("maxBettingPrice") @Expose private String maxBettingPrice; @SerializedName("s3imageURL") @Expose private String s3imageURL; @SerializedName("startPrice") @Expose private String startPrice; @SerializedName("title") @Expose private String title; @SerializedName("writerId") @Expose private String writerId; @SerializedName("writerNickName") @Expose private String writerNickName; @SerializedName("jwt") @Expose private String jwt; @SerializedName("currentUserLikeThisBoard") @Expose private Boolean currentUserLikeThisBoard; private List<BettingInfos> bettingInfos = null; public HotBoardListItem() { this.auctionDeadline = auctionDeadline; this.boardId = boardId; this.category = category; this.completion = completion; this.content = content; this.likeNumber = likeNumber; this.maxBettingPrice = maxBettingPrice; this.s3imageURL = s3imageURL; this.startPrice = startPrice; this.title = title; this.writerId = writerId; this.writerNickName = writerNickName; this.jwt = jwt; this.currentUserLikeThisBoard = currentUserLikeThisBoard; this.bettingInfos = bettingInfos; } public List<BettingInfos> getBettingInfos() { return bettingInfos; } public void setBettingInfos(List<BettingInfos> bettingInfos) { this.bettingInfos = bettingInfos; } public Boolean getCurrentUserLikeThisBoard() { return currentUserLikeThisBoard; } public void setCurrentUserLikeThisBoard(Boolean currentUserLikeThisBoard) { this.currentUserLikeThisBoard = currentUserLikeThisBoard; } public String getJwt() { return jwt; } public void setJwt(String jwt) { this.jwt = jwt; } public String getAuctionDeadline() { return auctionDeadline; } public void setAuctionDeadline(String auctionDeadline) { this.auctionDeadline = auctionDeadline; } public String getBoardId() { return boardId; } public void setBoardId(String boardId) { this.boardId = boardId; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getCompletion() { return completion; } public void setCompletion(String completion) { this.completion = completion; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getLikeNumber() { return likeNumber; } public void setLikeNumber(String likeNumber) { this.likeNumber = likeNumber; } public String getMaxBettingPrice() { return maxBettingPrice; } public void setMaxBettingPrice(String maxBettingPrice) { this.maxBettingPrice = maxBettingPrice; } public String getS3imageURL() { return s3imageURL; } public void setS3imageURL(String s3imageURL) { this.s3imageURL = s3imageURL; } public String getStartPrice() { return startPrice; } public void setStartPrice(String startPrice) { this.startPrice = startPrice; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getWriterId() { return writerId; } public void setWriterId(String writerId) { this.writerId = writerId; } public String getWriterNickName() { return writerNickName; } public void setWriterNickName(String writerNickName) { this.writerNickName = writerNickName; } }
[ "dtps@ajou.ac.kr" ]
dtps@ajou.ac.kr
f67e38c837b4219e29d2be16fcdc5d1e63157673
00ad2e61e469488ef34a8ab93d1a0c9e68e99caf
/yiranpay/yiranpay-member/src/main/java/com/yiranpay/member/service/impl/MemberTrVerifyEntityServiceImpl.java
338344d3f278064cee25322bbf92f06101c5f9d7
[ "MIT" ]
permissive
panda726548/yiranpay
13e77b620c76ef5778560ad2ef0833ae48555a4a
38523749bd2e00a003637f785289e21f6bf7e6dd
refs/heads/master
2023-07-11T05:48:54.645886
2023-07-02T11:38:48
2023-07-02T11:38:48
285,158,256
81
45
null
null
null
null
UTF-8
Java
false
false
5,929
java
package com.yiranpay.member.service.impl; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.yiranpay.member.mapper.MemberTmMemberMapper; import com.yiranpay.member.mapper.MemberTrVerifyEntityMapper; import com.yiranpay.member.mapper.MemberTrVerifyRefMapper; import com.yiranpay.common.core.text.Convert; import com.yiranpay.member.constant.MaConstant; import com.yiranpay.member.domain.MemberIdentity; import com.yiranpay.member.domain.MemberTmMember; import com.yiranpay.member.domain.MemberTrVerifyEntity; import com.yiranpay.member.domain.MemberTrVerifyRef; import com.yiranpay.member.domain.Verify; import com.yiranpay.member.enums.ResponseCode; import com.yiranpay.member.enums.VerifyStatusEnum; import com.yiranpay.member.enums.VerifyTypeEncryptMappingEnum; import com.yiranpay.member.exception.MaBizException; import com.yiranpay.member.exception.MaIllegalArgumentException; import com.yiranpay.member.service.IMemberTrVerifyEntityService; import com.yiranpay.member.utils.VerifyDomainUtil; /** * 认证实体 服务层实现 * * @author yiran * @date 2019-03-30 */ @Service public class MemberTrVerifyEntityServiceImpl implements IMemberTrVerifyEntityService { private final static int MAX_COUNT = -1; @Autowired private MemberTrVerifyEntityMapper memberTrVerifyEntityMapper; @Autowired private MemberTrVerifyRefMapper memberTrVerifyRefMapper; @Autowired private MemberTmMemberMapper memberTmMemberMapper; /** * 查询认证实体信息 * * @param verifyEntityId 认证实体ID * @return 认证实体信息 */ @Override public MemberTrVerifyEntity selectMemberTrVerifyEntityById(Integer verifyEntityId) { return memberTrVerifyEntityMapper.selectMemberTrVerifyEntityById(verifyEntityId); } /** * 查询认证实体列表 * * @param memberTrVerifyEntity 认证实体信息 * @return 认证实体集合 */ @Override public List<MemberTrVerifyEntity> selectMemberTrVerifyEntityList(MemberTrVerifyEntity memberTrVerifyEntity) { return memberTrVerifyEntityMapper.selectMemberTrVerifyEntityList(memberTrVerifyEntity); } /** * 新增认证实体 * * @param memberTrVerifyEntity 认证实体信息 * @return 结果 */ @Override public int insertMemberTrVerifyEntity(MemberTrVerifyEntity memberTrVerifyEntity) { return memberTrVerifyEntityMapper.insertMemberTrVerifyEntity(memberTrVerifyEntity); } /** * 修改认证实体 * * @param memberTrVerifyEntity 认证实体信息 * @return 结果 */ @Override public int updateMemberTrVerifyEntity(MemberTrVerifyEntity memberTrVerifyEntity) { return memberTrVerifyEntityMapper.updateMemberTrVerifyEntity(memberTrVerifyEntity); } /** * 删除认证实体对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteMemberTrVerifyEntityByIds(String ids) { return memberTrVerifyEntityMapper.deleteMemberTrVerifyEntityByIds(Convert.toStrArray(ids)); } @Override public List<MemberTrVerifyEntity> queryByMember(String memberId, Integer verifyType) { List<MemberTrVerifyEntity> verifys = new ArrayList<MemberTrVerifyEntity>(); //根据会员ID获取认证关系 对象集合 List<MemberTrVerifyRef> verifyRefList = memberTrVerifyRefMapper.selectMemberTrVerifyRefByMemberId(memberId); if(verifyRefList !=null && verifyRefList.size() > 0){ for (MemberTrVerifyRef memberTrVerifyRef : verifyRefList) { List<MemberTrVerifyEntity> verifyQuerys = memberTrVerifyEntityMapper.queryByMemberAndVerifyType( memberTrVerifyRef.getVerifyEntityId(), verifyType); if (!(verifyQuerys == null || verifyQuerys.isEmpty())) { for (MemberTrVerifyEntity item : verifyQuerys) { verifys.add(item); } } } } return verifys; } @Override public void addVerifys(List<MemberTrVerifyEntity> verifys, String memberId) { if (verifys == null || verifys.size() == 0) { return; } //手机和邮箱只能绑定一个会员 for (MemberTrVerifyEntity v : verifys) { checkVerify(v,memberId); int verifyEntityId = memberTrVerifyEntityMapper.insertMemberTrVerifyEntity(v); MemberTrVerifyRef memberTrVerifyRef =new MemberTrVerifyRef(); memberTrVerifyRef.setMemberId(memberId); memberTrVerifyRef.setVerifyEntityId(verifyEntityId); memberTrVerifyRef.setExpireTime(v.getExpireTime()); memberTrVerifyRef.setVerifyImgPath(v.getVerifyImgPath()); memberTrVerifyRef.setVerifiedTime(v.getVerifiedTime()); memberTrVerifyRef.setStatus(VerifyStatusEnum.AUTHENTICATED.getCode().intValue()); memberTrVerifyRefMapper.insertMemberTrVerifyRef(memberTrVerifyRef); } } /* * 手机和邮箱只能绑定一个会员 */ private void checkVerify(MemberTrVerifyEntity verify,String memberId) { //手机号或者邮箱查询是否已经被绑定 MemberTrVerifyEntity v = memberTrVerifyEntityMapper.selectMemberTrVerifyEntityByVerifyEntity(verify.getVerifyEntity()); if(v!=null){ MemberTrVerifyRef vr = memberTrVerifyRefMapper.selectMemberTrVerifyRefByverifyEntityId(v.getVerifyEntityId()); if(memberId.equals(vr.getMemberId())){ throw new MaIllegalArgumentException("该会员已经认证"); } } } @Override public MemberTrVerifyEntity selectMemberTrVerifyEntityById(Integer verifyEntityId, Integer verifyType) { List<MemberTrVerifyEntity> list = memberTrVerifyEntityMapper.queryByMemberAndVerifyType(verifyEntityId,verifyType); if(list.size() > 0){ return list.get(0); } return null; } }
[ "498617606@qq.com" ]
498617606@qq.com
5a1b0062ac2ae21e281e334dd89307c211f04db1
26099a982bad5c9ebb8b179936910711d3f9b1fa
/app/src/main/java/pollub/edu/pl/kolokwium/EditGame.java
0275c12bb5c74ef16c2a73bf817b41d719d6c5c9
[]
no_license
Jarek0/Kolokwium
881203e2d24c4ae0142e483b153409dc2a499af4
d6f3ceea3a6b5ada5312f05bdcf8eda9af463dc8
refs/heads/master
2021-01-20T08:30:34.233955
2017-05-03T15:25:47
2017-05-03T15:25:47
90,156,277
0
0
null
null
null
null
UTF-8
Java
false
false
4,635
java
package pollub.edu.pl.kolokwium; import android.content.ContentUris; import android.content.ContentValues; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import pollub.edu.pl.kolokwium.database.DatabaseContentProvider; import pollub.edu.pl.kolokwium.database.DatabaseHelper; /** * Created by Dell on 2017-05-02. */ public class EditGame extends AppCompatActivity { private long rowId; private EditText titleInput; private EditText kindInput; private EditText yearInput; private EditText ageInput; private Button addGameButton; private final int MODE_ADD=1; private final int MODE_EDIT=0; private int MODE=MODE_ADD; private long editingItemId; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_game); titleInput= (EditText) findViewById(R.id.titleOfGameET); kindInput= (EditText) findViewById(R.id.kindOfGameET); yearInput= (EditText) findViewById(R.id.yearOfGameET); ageInput= (EditText) findViewById(R.id.ageOfGameET); Bundle b=getIntent().getExtras(); if(b!=null){ editingItemId=b.getLong("itemId"); MODE=MODE_EDIT; }else MODE=MODE_ADD; addGameButton= (Button) findViewById(R.id.addGameButton); if(MODE==MODE_EDIT) addGameButton.setText("EDYTUJ GRE W BAZIE"); else addGameButton.setText("DODAJ GRE DO BAZY"); addGameButton.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { String error=validateElements(); if(error.equals("")){ ContentValues gameContentValues=new ContentValues(); gameContentValues.put(DatabaseHelper.TITLE_COLUMN_NAME,titleInput.getText().toString()); gameContentValues.put(DatabaseHelper.KIND_COLUMN_NAME,kindInput.getText().toString()); gameContentValues.put(DatabaseHelper.YEAR_COLUMN_NAME,yearInput.getText().toString()); gameContentValues.put(DatabaseHelper.AGE_COLUMN_NAME,ageInput.getText().toString()); if(MODE==MODE_ADD) getContentResolver().insert(DatabaseContentProvider.CONTENT_URI,gameContentValues); else getContentResolver().update(ContentUris.withAppendedId(DatabaseContentProvider.CONTENT_URI,editingItemId),gameContentValues,null,null); Intent intent = new Intent(); setResult(MODE, intent); finish(); }else{ Toast toast=Toast.makeText(EditGame.this,error,Toast.LENGTH_LONG); toast.show(); } } }); if(MODE==MODE_EDIT){ String[] columnNames=new String[]{DatabaseHelper.ID,DatabaseHelper.TITLE_COLUMN_NAME,DatabaseHelper.YEAR_COLUMN_NAME,DatabaseHelper.AGE_COLUMN_NAME ,DatabaseHelper.KIND_COLUMN_NAME}; Cursor c=getContentResolver().query(ContentUris.withAppendedId(DatabaseContentProvider.CONTENT_URI,editingItemId),columnNames,null,null,null); c.moveToFirst(); titleInput.setText(c.getString(c.getColumnIndex(DatabaseHelper.TITLE_COLUMN_NAME))); yearInput.setText(c.getString(c.getColumnIndex(DatabaseHelper.YEAR_COLUMN_NAME))); kindInput.setText(c.getString(c.getColumnIndex(DatabaseHelper.KIND_COLUMN_NAME))); ageInput.setText(c.getString(c.getColumnIndex(DatabaseHelper.AGE_COLUMN_NAME))); } } private String validateElements(){ String message=""; if(!(titleInput.getText().toString().length()>0 && titleInput.getText().toString().length()<20)){ message+="bledny tytul\n"; } if(!(kindInput.getText().toString().length()>0 && titleInput.getText().toString().length()<20)){ message+="bledny gatunek\n"; } if(!(yearInput.getText().toString().length()>0 && yearInput.getText().toString().matches("^(19|20)[0-9]{2}$"))){ message+="bledny rok\n"; } if(!(ageInput.getText().toString().length()>0 && ageInput.getText().toString().matches("^([1-9]|1[0-8])$"))){ message+="bledny wiek\n"; } message.trim(); return message; } }
[ "jazz.squat@gmail.com" ]
jazz.squat@gmail.com
b0ebaf4391a3cd47f8937a9799d2e1beff97a147
26be627c93464b1c5aa578140a71feb6a284967c
/src/edu/cnm/deepdive/Palindromes.java
b26c9561f1698becc465321c69ec336a895fdeec
[]
no_license
austindewitt13/recursion-intro
77cc51669bef237f71ffcde3f228d671ff1a1a3c
e0295fbf35a1da78f33856b3fee51119bb32f7f5
refs/heads/master
2020-05-31T00:48:14.853816
2019-06-03T20:09:25
2019-06-03T20:09:25
190,041,836
0
0
null
null
null
null
UTF-8
Java
false
false
435
java
package edu.cnm.deepdive; public class Palindromes { public static boolean isPalindrome(String s) { String s2 = s.replaceAll("\\W", ""); s2 = s2.toLowerCase(); char[] chars = s2.toCharArray(); for (int i = 0, j = chars.length -1; i < j; i++, j--) { if (chars [i] != chars [j]) { return false; } } return true; } public static void main(String[] args) { System.out.println(isPalindrome("")); } }
[ "50061410+austindewitt13@users.noreply.github.com" ]
50061410+austindewitt13@users.noreply.github.com
e1da5cc743cecf0bcf515f16d04c867d9421d2f1
3f30ef8700d97b0be765020dffc1d263f6cd78c6
/src/test/java/com/lucky/SecondsKillWebApplicationTests.java
c4b0ebe730c35f83fc57ce65edb4ab62070c863f
[]
no_license
ValjeanShaw/SecondsKillWeb
4aa451664b9b5a231265bced2f9fd6e52a5ae6b4
4158ba61bf2b065a1b336f56aefdc1d61a962173
refs/heads/master
2020-05-15T13:04:09.545972
2019-05-12T09:51:48
2019-05-12T09:51:48
182,287,016
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.lucky; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class SecondsKillWebApplicationTests { @Test public void contextLoads() { } }
[ "ran.xiao@tendcloud.com" ]
ran.xiao@tendcloud.com
578efe7a9619c0ee7d99ad0d60a89d3026c655b8
8dcd6fac592760c5bff55349ffb2d7ce39d485cc
/android/support/v4/app/BackStackRecord.java
fefc870d8786636d421a51401ac59e63c65c7d30
[]
no_license
andrepcg/hikam-android
9e3a02e0ba9a58cf8a17c5e76e2f3435969e4b3a
bf39e345a827c6498052d9df88ca58d8823178d9
refs/heads/master
2021-09-01T11:41:10.726066
2017-12-26T19:04:42
2017-12-26T19:04:42
115,447,829
2
2
null
null
null
null
UTF-8
Java
false
false
49,211
java
package android.support.v4.app; import android.os.Build.VERSION; import android.support.v4.app.FragmentManager.BackStackEntry; import android.support.v4.app.FragmentTransitionCompat21.EpicenterView; import android.support.v4.app.FragmentTransitionCompat21.ViewRetriever; import android.support.v4.util.ArrayMap; import android.support.v4.util.LogWriter; import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver.OnPreDrawListener; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.reflect.Modifier; import java.util.ArrayList; final class BackStackRecord extends FragmentTransaction implements BackStackEntry, Runnable { static final int OP_ADD = 1; static final int OP_ATTACH = 7; static final int OP_DETACH = 6; static final int OP_HIDE = 4; static final int OP_NULL = 0; static final int OP_REMOVE = 3; static final int OP_REPLACE = 2; static final int OP_SHOW = 5; static final boolean SUPPORTS_TRANSITIONS = (VERSION.SDK_INT >= 21); static final String TAG = "FragmentManager"; boolean mAddToBackStack; boolean mAllowAddToBackStack = true; int mBreadCrumbShortTitleRes; CharSequence mBreadCrumbShortTitleText; int mBreadCrumbTitleRes; CharSequence mBreadCrumbTitleText; boolean mCommitted; int mEnterAnim; int mExitAnim; Op mHead; int mIndex = -1; final FragmentManagerImpl mManager; String mName; int mNumOp; int mPopEnterAnim; int mPopExitAnim; ArrayList<String> mSharedElementSourceNames; ArrayList<String> mSharedElementTargetNames; Op mTail; int mTransition; int mTransitionStyle; static final class Op { int cmd; int enterAnim; int exitAnim; Fragment fragment; Op next; int popEnterAnim; int popExitAnim; Op prev; ArrayList<Fragment> removed; Op() { } } public class TransitionState { public EpicenterView enteringEpicenterView = new EpicenterView(); public ArrayList<View> hiddenFragmentViews = new ArrayList(); public ArrayMap<String, String> nameOverrides = new ArrayMap(); public View nonExistentView; } public String toString() { StringBuilder sb = new StringBuilder(128); sb.append("BackStackEntry{"); sb.append(Integer.toHexString(System.identityHashCode(this))); if (this.mIndex >= 0) { sb.append(" #"); sb.append(this.mIndex); } if (this.mName != null) { sb.append(" "); sb.append(this.mName); } sb.append("}"); return sb.toString(); } public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { dump(prefix, writer, true); } public void dump(String prefix, PrintWriter writer, boolean full) { if (full) { writer.print(prefix); writer.print("mName="); writer.print(this.mName); writer.print(" mIndex="); writer.print(this.mIndex); writer.print(" mCommitted="); writer.println(this.mCommitted); if (this.mTransition != 0) { writer.print(prefix); writer.print("mTransition=#"); writer.print(Integer.toHexString(this.mTransition)); writer.print(" mTransitionStyle=#"); writer.println(Integer.toHexString(this.mTransitionStyle)); } if (!(this.mEnterAnim == 0 && this.mExitAnim == 0)) { writer.print(prefix); writer.print("mEnterAnim=#"); writer.print(Integer.toHexString(this.mEnterAnim)); writer.print(" mExitAnim=#"); writer.println(Integer.toHexString(this.mExitAnim)); } if (!(this.mPopEnterAnim == 0 && this.mPopExitAnim == 0)) { writer.print(prefix); writer.print("mPopEnterAnim=#"); writer.print(Integer.toHexString(this.mPopEnterAnim)); writer.print(" mPopExitAnim=#"); writer.println(Integer.toHexString(this.mPopExitAnim)); } if (!(this.mBreadCrumbTitleRes == 0 && this.mBreadCrumbTitleText == null)) { writer.print(prefix); writer.print("mBreadCrumbTitleRes=#"); writer.print(Integer.toHexString(this.mBreadCrumbTitleRes)); writer.print(" mBreadCrumbTitleText="); writer.println(this.mBreadCrumbTitleText); } if (!(this.mBreadCrumbShortTitleRes == 0 && this.mBreadCrumbShortTitleText == null)) { writer.print(prefix); writer.print("mBreadCrumbShortTitleRes=#"); writer.print(Integer.toHexString(this.mBreadCrumbShortTitleRes)); writer.print(" mBreadCrumbShortTitleText="); writer.println(this.mBreadCrumbShortTitleText); } } if (this.mHead != null) { writer.print(prefix); writer.println("Operations:"); String innerPrefix = prefix + " "; Op op = this.mHead; int num = 0; while (op != null) { String cmdStr; switch (op.cmd) { case 0: cmdStr = "NULL"; break; case 1: cmdStr = "ADD"; break; case 2: cmdStr = "REPLACE"; break; case 3: cmdStr = "REMOVE"; break; case 4: cmdStr = "HIDE"; break; case 5: cmdStr = "SHOW"; break; case 6: cmdStr = "DETACH"; break; case 7: cmdStr = "ATTACH"; break; default: cmdStr = "cmd=" + op.cmd; break; } writer.print(prefix); writer.print(" Op #"); writer.print(num); writer.print(": "); writer.print(cmdStr); writer.print(" "); writer.println(op.fragment); if (full) { if (!(op.enterAnim == 0 && op.exitAnim == 0)) { writer.print(prefix); writer.print("enterAnim=#"); writer.print(Integer.toHexString(op.enterAnim)); writer.print(" exitAnim=#"); writer.println(Integer.toHexString(op.exitAnim)); } if (!(op.popEnterAnim == 0 && op.popExitAnim == 0)) { writer.print(prefix); writer.print("popEnterAnim=#"); writer.print(Integer.toHexString(op.popEnterAnim)); writer.print(" popExitAnim=#"); writer.println(Integer.toHexString(op.popExitAnim)); } } if (op.removed != null && op.removed.size() > 0) { for (int i = 0; i < op.removed.size(); i++) { writer.print(innerPrefix); if (op.removed.size() == 1) { writer.print("Removed: "); } else { if (i == 0) { writer.println("Removed:"); } writer.print(innerPrefix); writer.print(" #"); writer.print(i); writer.print(": "); } writer.println(op.removed.get(i)); } } op = op.next; num++; } } } public BackStackRecord(FragmentManagerImpl manager) { this.mManager = manager; } public int getId() { return this.mIndex; } public int getBreadCrumbTitleRes() { return this.mBreadCrumbTitleRes; } public int getBreadCrumbShortTitleRes() { return this.mBreadCrumbShortTitleRes; } public CharSequence getBreadCrumbTitle() { if (this.mBreadCrumbTitleRes != 0) { return this.mManager.mHost.getContext().getText(this.mBreadCrumbTitleRes); } return this.mBreadCrumbTitleText; } public CharSequence getBreadCrumbShortTitle() { if (this.mBreadCrumbShortTitleRes != 0) { return this.mManager.mHost.getContext().getText(this.mBreadCrumbShortTitleRes); } return this.mBreadCrumbShortTitleText; } void addOp(Op op) { if (this.mHead == null) { this.mTail = op; this.mHead = op; } else { op.prev = this.mTail; this.mTail.next = op; this.mTail = op; } op.enterAnim = this.mEnterAnim; op.exitAnim = this.mExitAnim; op.popEnterAnim = this.mPopEnterAnim; op.popExitAnim = this.mPopExitAnim; this.mNumOp++; } public FragmentTransaction add(Fragment fragment, String tag) { doAddOp(0, fragment, tag, 1); return this; } public FragmentTransaction add(int containerViewId, Fragment fragment) { doAddOp(containerViewId, fragment, null, 1); return this; } public FragmentTransaction add(int containerViewId, Fragment fragment, String tag) { doAddOp(containerViewId, fragment, tag, 1); return this; } private void doAddOp(int containerViewId, Fragment fragment, String tag, int opcmd) { Class fragmentClass = fragment.getClass(); int modifiers = fragmentClass.getModifiers(); if (fragmentClass.isAnonymousClass() || !Modifier.isPublic(modifiers) || (fragmentClass.isMemberClass() && !Modifier.isStatic(modifiers))) { throw new IllegalStateException("Fragment " + fragmentClass.getCanonicalName() + " must be a public static class to be properly recreated from" + " instance state."); } fragment.mFragmentManager = this.mManager; if (tag != null) { if (fragment.mTag == null || tag.equals(fragment.mTag)) { fragment.mTag = tag; } else { throw new IllegalStateException("Can't change tag of fragment " + fragment + ": was " + fragment.mTag + " now " + tag); } } if (containerViewId != 0) { if (containerViewId == -1) { throw new IllegalArgumentException("Can't add fragment " + fragment + " with tag " + tag + " to container view with no id"); } else if (fragment.mFragmentId == 0 || fragment.mFragmentId == containerViewId) { fragment.mFragmentId = containerViewId; fragment.mContainerId = containerViewId; } else { throw new IllegalStateException("Can't change container ID of fragment " + fragment + ": was " + fragment.mFragmentId + " now " + containerViewId); } } Op op = new Op(); op.cmd = opcmd; op.fragment = fragment; addOp(op); } public FragmentTransaction replace(int containerViewId, Fragment fragment) { return replace(containerViewId, fragment, null); } public FragmentTransaction replace(int containerViewId, Fragment fragment, String tag) { if (containerViewId == 0) { throw new IllegalArgumentException("Must use non-zero containerViewId"); } doAddOp(containerViewId, fragment, tag, 2); return this; } public FragmentTransaction remove(Fragment fragment) { Op op = new Op(); op.cmd = 3; op.fragment = fragment; addOp(op); return this; } public FragmentTransaction hide(Fragment fragment) { Op op = new Op(); op.cmd = 4; op.fragment = fragment; addOp(op); return this; } public FragmentTransaction show(Fragment fragment) { Op op = new Op(); op.cmd = 5; op.fragment = fragment; addOp(op); return this; } public FragmentTransaction detach(Fragment fragment) { Op op = new Op(); op.cmd = 6; op.fragment = fragment; addOp(op); return this; } public FragmentTransaction attach(Fragment fragment) { Op op = new Op(); op.cmd = 7; op.fragment = fragment; addOp(op); return this; } public FragmentTransaction setCustomAnimations(int enter, int exit) { return setCustomAnimations(enter, exit, 0, 0); } public FragmentTransaction setCustomAnimations(int enter, int exit, int popEnter, int popExit) { this.mEnterAnim = enter; this.mExitAnim = exit; this.mPopEnterAnim = popEnter; this.mPopExitAnim = popExit; return this; } public FragmentTransaction setTransition(int transition) { this.mTransition = transition; return this; } public FragmentTransaction addSharedElement(View sharedElement, String name) { if (SUPPORTS_TRANSITIONS) { String transitionName = FragmentTransitionCompat21.getTransitionName(sharedElement); if (transitionName == null) { throw new IllegalArgumentException("Unique transitionNames are required for all sharedElements"); } if (this.mSharedElementSourceNames == null) { this.mSharedElementSourceNames = new ArrayList(); this.mSharedElementTargetNames = new ArrayList(); } this.mSharedElementSourceNames.add(transitionName); this.mSharedElementTargetNames.add(name); } return this; } public FragmentTransaction setTransitionStyle(int styleRes) { this.mTransitionStyle = styleRes; return this; } public FragmentTransaction addToBackStack(String name) { if (this.mAllowAddToBackStack) { this.mAddToBackStack = true; this.mName = name; return this; } throw new IllegalStateException("This FragmentTransaction is not allowed to be added to the back stack."); } public boolean isAddToBackStackAllowed() { return this.mAllowAddToBackStack; } public FragmentTransaction disallowAddToBackStack() { if (this.mAddToBackStack) { throw new IllegalStateException("This transaction is already being added to the back stack"); } this.mAllowAddToBackStack = false; return this; } public FragmentTransaction setBreadCrumbTitle(int res) { this.mBreadCrumbTitleRes = res; this.mBreadCrumbTitleText = null; return this; } public FragmentTransaction setBreadCrumbTitle(CharSequence text) { this.mBreadCrumbTitleRes = 0; this.mBreadCrumbTitleText = text; return this; } public FragmentTransaction setBreadCrumbShortTitle(int res) { this.mBreadCrumbShortTitleRes = res; this.mBreadCrumbShortTitleText = null; return this; } public FragmentTransaction setBreadCrumbShortTitle(CharSequence text) { this.mBreadCrumbShortTitleRes = 0; this.mBreadCrumbShortTitleText = text; return this; } void bumpBackStackNesting(int amt) { if (this.mAddToBackStack) { if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Bump nesting in " + this + " by " + amt); } for (Op op = this.mHead; op != null; op = op.next) { if (op.fragment != null) { Fragment fragment = op.fragment; fragment.mBackStackNesting += amt; if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Bump nesting of " + op.fragment + " to " + op.fragment.mBackStackNesting); } } if (op.removed != null) { for (int i = op.removed.size() - 1; i >= 0; i--) { Fragment r = (Fragment) op.removed.get(i); r.mBackStackNesting += amt; if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Bump nesting of " + r + " to " + r.mBackStackNesting); } } } } } } public int commit() { return commitInternal(false); } public int commitAllowingStateLoss() { return commitInternal(true); } public void commitNow() { disallowAddToBackStack(); this.mManager.execSingleAction(this, false); } public void commitNowAllowingStateLoss() { disallowAddToBackStack(); this.mManager.execSingleAction(this, true); } int commitInternal(boolean allowStateLoss) { if (this.mCommitted) { throw new IllegalStateException("commit already called"); } if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Commit: " + this); dump(" ", null, new PrintWriter(new LogWriter(TAG)), null); } this.mCommitted = true; if (this.mAddToBackStack) { this.mIndex = this.mManager.allocBackStackIndex(this); } else { this.mIndex = -1; } this.mManager.enqueueAction(this, allowStateLoss); return this.mIndex; } public void run() { if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Run: " + this); } if (!this.mAddToBackStack || this.mIndex >= 0) { bumpBackStackNesting(1); TransitionState state = null; if (SUPPORTS_TRANSITIONS && this.mManager.mCurState >= 1) { SparseArray<Fragment> firstOutFragments = new SparseArray(); SparseArray<Fragment> lastInFragments = new SparseArray(); calculateFragments(firstOutFragments, lastInFragments); state = beginTransition(firstOutFragments, lastInFragments, false); } int transitionStyle = state != null ? 0 : this.mTransitionStyle; int transition = state != null ? 0 : this.mTransition; Op op = this.mHead; while (op != null) { int enterAnim = state != null ? 0 : op.enterAnim; int exitAnim = state != null ? 0 : op.exitAnim; Fragment f; switch (op.cmd) { case 1: f = op.fragment; f.mNextAnim = enterAnim; this.mManager.addFragment(f, false); break; case 2: f = op.fragment; int containerId = f.mContainerId; if (this.mManager.mAdded != null) { for (int i = this.mManager.mAdded.size() - 1; i >= 0; i--) { Fragment old = (Fragment) this.mManager.mAdded.get(i); if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "OP_REPLACE: adding=" + f + " old=" + old); } if (old.mContainerId == containerId) { if (old == f) { f = null; op.fragment = null; } else { if (op.removed == null) { op.removed = new ArrayList(); } op.removed.add(old); old.mNextAnim = exitAnim; if (this.mAddToBackStack) { old.mBackStackNesting++; if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "Bump nesting of " + old + " to " + old.mBackStackNesting); } } this.mManager.removeFragment(old, transition, transitionStyle); } } } } if (f == null) { break; } f.mNextAnim = enterAnim; this.mManager.addFragment(f, false); break; case 3: f = op.fragment; f.mNextAnim = exitAnim; this.mManager.removeFragment(f, transition, transitionStyle); break; case 4: f = op.fragment; f.mNextAnim = exitAnim; this.mManager.hideFragment(f, transition, transitionStyle); break; case 5: f = op.fragment; f.mNextAnim = enterAnim; this.mManager.showFragment(f, transition, transitionStyle); break; case 6: f = op.fragment; f.mNextAnim = exitAnim; this.mManager.detachFragment(f, transition, transitionStyle); break; case 7: f = op.fragment; f.mNextAnim = enterAnim; this.mManager.attachFragment(f, transition, transitionStyle); break; default: throw new IllegalArgumentException("Unknown cmd: " + op.cmd); } op = op.next; } this.mManager.moveToState(this.mManager.mCurState, transition, transitionStyle, true); if (this.mAddToBackStack) { this.mManager.addBackStackState(this); return; } return; } throw new IllegalStateException("addToBackStack() called after commit()"); } private static void setFirstOut(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments, Fragment fragment) { if (fragment != null) { int containerId = fragment.mContainerId; if (containerId != 0 && !fragment.isHidden()) { if (fragment.isAdded() && fragment.getView() != null && firstOutFragments.get(containerId) == null) { firstOutFragments.put(containerId, fragment); } if (lastInFragments.get(containerId) == fragment) { lastInFragments.remove(containerId); } } } } private void setLastIn(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments, Fragment fragment) { if (fragment != null) { int containerId = fragment.mContainerId; if (containerId != 0) { if (!fragment.isAdded()) { lastInFragments.put(containerId, fragment); } if (firstOutFragments.get(containerId) == fragment) { firstOutFragments.remove(containerId); } } if (fragment.mState < 1 && this.mManager.mCurState >= 1) { this.mManager.makeActive(fragment); this.mManager.moveToState(fragment, 1, 0, 0, false); } } } private void calculateFragments(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { if (this.mManager.mContainer.onHasView()) { for (Op op = this.mHead; op != null; op = op.next) { switch (op.cmd) { case 1: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 2: Fragment f = op.fragment; if (this.mManager.mAdded != null) { for (int i = 0; i < this.mManager.mAdded.size(); i++) { Fragment old = (Fragment) this.mManager.mAdded.get(i); if (f == null || old.mContainerId == f.mContainerId) { if (old == f) { f = null; lastInFragments.remove(old.mContainerId); } else { setFirstOut(firstOutFragments, lastInFragments, old); } } } } setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 3: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 4: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 5: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 6: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 7: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; default: break; } } } } public void calculateBackFragments(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { if (this.mManager.mContainer.onHasView()) { for (Op op = this.mTail; op != null; op = op.prev) { switch (op.cmd) { case 1: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 2: if (op.removed != null) { for (int i = op.removed.size() - 1; i >= 0; i--) { setLastIn(firstOutFragments, lastInFragments, (Fragment) op.removed.get(i)); } } setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 3: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 4: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 5: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; case 6: setLastIn(firstOutFragments, lastInFragments, op.fragment); break; case 7: setFirstOut(firstOutFragments, lastInFragments, op.fragment); break; default: break; } } } } public TransitionState popFromBackStack(boolean doStateMove, TransitionState state, SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { if (FragmentManagerImpl.DEBUG) { Log.v(TAG, "popFromBackStack: " + this); dump(" ", null, new PrintWriter(new LogWriter(TAG)), null); } if (SUPPORTS_TRANSITIONS && this.mManager.mCurState >= 1) { if (state == null) { if (!(firstOutFragments.size() == 0 && lastInFragments.size() == 0)) { state = beginTransition(firstOutFragments, lastInFragments, true); } } else if (!doStateMove) { setNameOverrides(state, this.mSharedElementTargetNames, this.mSharedElementSourceNames); } } bumpBackStackNesting(-1); int transitionStyle = state != null ? 0 : this.mTransitionStyle; int transition = state != null ? 0 : this.mTransition; Op op = this.mTail; while (op != null) { int popEnterAnim = state != null ? 0 : op.popEnterAnim; int popExitAnim = state != null ? 0 : op.popExitAnim; Fragment f; switch (op.cmd) { case 1: f = op.fragment; f.mNextAnim = popExitAnim; this.mManager.removeFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); break; case 2: f = op.fragment; if (f != null) { f.mNextAnim = popExitAnim; this.mManager.removeFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); } if (op.removed == null) { break; } for (int i = 0; i < op.removed.size(); i++) { Fragment old = (Fragment) op.removed.get(i); old.mNextAnim = popEnterAnim; this.mManager.addFragment(old, false); } break; case 3: f = op.fragment; f.mNextAnim = popEnterAnim; this.mManager.addFragment(f, false); break; case 4: f = op.fragment; f.mNextAnim = popEnterAnim; this.mManager.showFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); break; case 5: f = op.fragment; f.mNextAnim = popExitAnim; this.mManager.hideFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); break; case 6: f = op.fragment; f.mNextAnim = popEnterAnim; this.mManager.attachFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); break; case 7: f = op.fragment; f.mNextAnim = popEnterAnim; this.mManager.detachFragment(f, FragmentManagerImpl.reverseTransit(transition), transitionStyle); break; default: throw new IllegalArgumentException("Unknown cmd: " + op.cmd); } op = op.prev; } if (doStateMove) { this.mManager.moveToState(this.mManager.mCurState, FragmentManagerImpl.reverseTransit(transition), transitionStyle, true); state = null; } if (this.mIndex >= 0) { this.mManager.freeBackStackIndex(this.mIndex); this.mIndex = -1; } return state; } public String getName() { return this.mName; } public int getTransition() { return this.mTransition; } public int getTransitionStyle() { return this.mTransitionStyle; } public boolean isEmpty() { return this.mNumOp == 0; } private TransitionState beginTransition(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments, boolean isBack) { int i; TransitionState state = new TransitionState(); state.nonExistentView = new View(this.mManager.mHost.getContext()); boolean anyTransitionStarted = false; for (i = 0; i < firstOutFragments.size(); i++) { if (configureTransitions(firstOutFragments.keyAt(i), state, isBack, firstOutFragments, lastInFragments)) { anyTransitionStarted = true; } } for (i = 0; i < lastInFragments.size(); i++) { int containerId = lastInFragments.keyAt(i); if (firstOutFragments.get(containerId) == null && configureTransitions(containerId, state, isBack, firstOutFragments, lastInFragments)) { anyTransitionStarted = true; } } if (anyTransitionStarted) { return state; } return null; } private static Object getEnterTransition(Fragment inFragment, boolean isBack) { if (inFragment == null) { return null; } return FragmentTransitionCompat21.cloneTransition(isBack ? inFragment.getReenterTransition() : inFragment.getEnterTransition()); } private static Object getExitTransition(Fragment outFragment, boolean isBack) { if (outFragment == null) { return null; } return FragmentTransitionCompat21.cloneTransition(isBack ? outFragment.getReturnTransition() : outFragment.getExitTransition()); } private static Object getSharedElementTransition(Fragment inFragment, Fragment outFragment, boolean isBack) { if (inFragment == null || outFragment == null) { return null; } Object sharedElementReturnTransition; if (isBack) { sharedElementReturnTransition = outFragment.getSharedElementReturnTransition(); } else { sharedElementReturnTransition = inFragment.getSharedElementEnterTransition(); } return FragmentTransitionCompat21.wrapSharedElementTransition(sharedElementReturnTransition); } private static Object captureExitingViews(Object exitTransition, Fragment outFragment, ArrayList<View> exitingViews, ArrayMap<String, View> namedViews, View nonExistentView) { if (exitTransition != null) { return FragmentTransitionCompat21.captureExitingViews(exitTransition, outFragment.getView(), exitingViews, namedViews, nonExistentView); } return exitTransition; } private ArrayMap<String, View> remapSharedElements(TransitionState state, Fragment outFragment, boolean isBack) { ArrayMap namedViews = new ArrayMap(); if (this.mSharedElementSourceNames != null) { FragmentTransitionCompat21.findNamedViews(namedViews, outFragment.getView()); if (isBack) { namedViews.retainAll(this.mSharedElementTargetNames); } else { namedViews = remapNames(this.mSharedElementSourceNames, this.mSharedElementTargetNames, namedViews); } } if (isBack) { if (outFragment.mEnterTransitionCallback != null) { outFragment.mEnterTransitionCallback.onMapSharedElements(this.mSharedElementTargetNames, namedViews); } setBackNameOverrides(state, namedViews, false); } else { if (outFragment.mExitTransitionCallback != null) { outFragment.mExitTransitionCallback.onMapSharedElements(this.mSharedElementTargetNames, namedViews); } setNameOverrides(state, namedViews, false); } return namedViews; } private boolean configureTransitions(int containerId, TransitionState state, boolean isBack, SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { View sceneRoot = (ViewGroup) this.mManager.mContainer.onFindViewById(containerId); if (sceneRoot == null) { return false; } final Fragment inFragment = (Fragment) lastInFragments.get(containerId); Fragment outFragment = (Fragment) firstOutFragments.get(containerId); Object enterTransition = getEnterTransition(inFragment, isBack); Object sharedElementTransition = getSharedElementTransition(inFragment, outFragment, isBack); Object exitTransition = getExitTransition(outFragment, isBack); ArrayMap<String, View> namedViews = null; ArrayList<View> sharedElementTargets = new ArrayList(); if (sharedElementTransition != null) { namedViews = remapSharedElements(state, outFragment, isBack); if (namedViews.isEmpty()) { sharedElementTransition = null; namedViews = null; } else { SharedElementCallback callback = isBack ? outFragment.mEnterTransitionCallback : inFragment.mEnterTransitionCallback; if (callback != null) { callback.onSharedElementStart(new ArrayList(namedViews.keySet()), new ArrayList(namedViews.values()), null); } prepareSharedElementTransition(state, sceneRoot, sharedElementTransition, inFragment, outFragment, isBack, sharedElementTargets, enterTransition, exitTransition); } } if (enterTransition == null && sharedElementTransition == null && exitTransition == null) { return false; } ArrayList<View> exitingViews = new ArrayList(); exitTransition = captureExitingViews(exitTransition, outFragment, exitingViews, namedViews, state.nonExistentView); if (!(this.mSharedElementTargetNames == null || namedViews == null)) { View epicenterView = (View) namedViews.get(this.mSharedElementTargetNames.get(0)); if (epicenterView != null) { if (exitTransition != null) { FragmentTransitionCompat21.setEpicenter(exitTransition, epicenterView); } if (sharedElementTransition != null) { FragmentTransitionCompat21.setEpicenter(sharedElementTransition, epicenterView); } } } ViewRetriever c08891 = new ViewRetriever() { public View getView() { return inFragment.getView(); } }; ArrayList<View> enteringViews = new ArrayList(); ArrayMap<String, View> renamedViews = new ArrayMap(); boolean allowOverlap = true; if (inFragment != null) { if (isBack) { allowOverlap = inFragment.getAllowReturnTransitionOverlap(); } else { allowOverlap = inFragment.getAllowEnterTransitionOverlap(); } } Object transition = FragmentTransitionCompat21.mergeTransitions(enterTransition, exitTransition, sharedElementTransition, allowOverlap); if (transition != null) { FragmentTransitionCompat21.addTransitionTargets(enterTransition, sharedElementTransition, exitTransition, sceneRoot, c08891, state.nonExistentView, state.enteringEpicenterView, state.nameOverrides, enteringViews, exitingViews, namedViews, renamedViews, sharedElementTargets); excludeHiddenFragmentsAfterEnter(sceneRoot, state, containerId, transition); FragmentTransitionCompat21.excludeTarget(transition, state.nonExistentView, true); excludeHiddenFragments(state, containerId, transition); FragmentTransitionCompat21.beginDelayedTransition(sceneRoot, transition); FragmentTransitionCompat21.cleanupTransitions(sceneRoot, state.nonExistentView, enterTransition, enteringViews, exitTransition, exitingViews, sharedElementTransition, sharedElementTargets, transition, state.hiddenFragmentViews, renamedViews); } if (transition != null) { return true; } return false; } private void prepareSharedElementTransition(TransitionState state, View sceneRoot, Object sharedElementTransition, Fragment inFragment, Fragment outFragment, boolean isBack, ArrayList<View> sharedElementTargets, Object enterTransition, Object exitTransition) { if (sharedElementTransition != null) { final View view = sceneRoot; final Object obj = sharedElementTransition; final ArrayList<View> arrayList = sharedElementTargets; final TransitionState transitionState = state; final Object obj2 = enterTransition; final Object obj3 = exitTransition; final boolean z = isBack; final Fragment fragment = inFragment; final Fragment fragment2 = outFragment; sceneRoot.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() { public boolean onPreDraw() { view.getViewTreeObserver().removeOnPreDrawListener(this); FragmentTransitionCompat21.removeTargets(obj, arrayList); arrayList.remove(transitionState.nonExistentView); FragmentTransitionCompat21.excludeSharedElementViews(obj2, obj3, obj, arrayList, false); arrayList.clear(); ArrayMap<String, View> namedViews = BackStackRecord.this.mapSharedElementsIn(transitionState, z, fragment); FragmentTransitionCompat21.setSharedElementTargets(obj, transitionState.nonExistentView, namedViews, arrayList); BackStackRecord.this.setEpicenterIn(namedViews, transitionState); BackStackRecord.this.callSharedElementEnd(transitionState, fragment, fragment2, z, namedViews); FragmentTransitionCompat21.excludeSharedElementViews(obj2, obj3, obj, arrayList, true); return true; } }); } } void callSharedElementEnd(TransitionState state, Fragment inFragment, Fragment outFragment, boolean isBack, ArrayMap<String, View> namedViews) { SharedElementCallback sharedElementCallback = isBack ? outFragment.mEnterTransitionCallback : inFragment.mEnterTransitionCallback; if (sharedElementCallback != null) { sharedElementCallback.onSharedElementEnd(new ArrayList(namedViews.keySet()), new ArrayList(namedViews.values()), null); } } void setEpicenterIn(ArrayMap<String, View> namedViews, TransitionState state) { if (this.mSharedElementTargetNames != null && !namedViews.isEmpty()) { View epicenter = (View) namedViews.get(this.mSharedElementTargetNames.get(0)); if (epicenter != null) { state.enteringEpicenterView.epicenter = epicenter; } } } ArrayMap<String, View> mapSharedElementsIn(TransitionState state, boolean isBack, Fragment inFragment) { ArrayMap namedViews = mapEnteringSharedElements(state, inFragment, isBack); if (isBack) { if (inFragment.mExitTransitionCallback != null) { inFragment.mExitTransitionCallback.onMapSharedElements(this.mSharedElementTargetNames, namedViews); } setBackNameOverrides(state, namedViews, true); } else { if (inFragment.mEnterTransitionCallback != null) { inFragment.mEnterTransitionCallback.onMapSharedElements(this.mSharedElementTargetNames, namedViews); } setNameOverrides(state, namedViews, true); } return namedViews; } private static ArrayMap<String, View> remapNames(ArrayList<String> inMap, ArrayList<String> toGoInMap, ArrayMap<String, View> namedViews) { if (namedViews.isEmpty()) { return namedViews; } ArrayMap<String, View> remappedViews = new ArrayMap(); int numKeys = inMap.size(); for (int i = 0; i < numKeys; i++) { View view = (View) namedViews.get(inMap.get(i)); if (view != null) { remappedViews.put(toGoInMap.get(i), view); } } return remappedViews; } private ArrayMap<String, View> mapEnteringSharedElements(TransitionState state, Fragment inFragment, boolean isBack) { ArrayMap<String, View> namedViews = new ArrayMap(); View root = inFragment.getView(); if (root == null || this.mSharedElementSourceNames == null) { return namedViews; } FragmentTransitionCompat21.findNamedViews(namedViews, root); if (isBack) { return remapNames(this.mSharedElementSourceNames, this.mSharedElementTargetNames, namedViews); } namedViews.retainAll(this.mSharedElementTargetNames); return namedViews; } private void excludeHiddenFragmentsAfterEnter(View sceneRoot, TransitionState state, int containerId, Object transition) { final View view = sceneRoot; final TransitionState transitionState = state; final int i = containerId; final Object obj = transition; sceneRoot.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() { public boolean onPreDraw() { view.getViewTreeObserver().removeOnPreDrawListener(this); BackStackRecord.this.excludeHiddenFragments(transitionState, i, obj); return true; } }); } void excludeHiddenFragments(TransitionState state, int containerId, Object transition) { if (this.mManager.mAdded != null) { for (int i = 0; i < this.mManager.mAdded.size(); i++) { Fragment fragment = (Fragment) this.mManager.mAdded.get(i); if (!(fragment.mView == null || fragment.mContainer == null || fragment.mContainerId != containerId)) { if (!fragment.mHidden) { FragmentTransitionCompat21.excludeTarget(transition, fragment.mView, false); state.hiddenFragmentViews.remove(fragment.mView); } else if (!state.hiddenFragmentViews.contains(fragment.mView)) { FragmentTransitionCompat21.excludeTarget(transition, fragment.mView, true); state.hiddenFragmentViews.add(fragment.mView); } } } } } private static void setNameOverride(ArrayMap<String, String> overrides, String source, String target) { if (source != null && target != null) { for (int index = 0; index < overrides.size(); index++) { if (source.equals(overrides.valueAt(index))) { overrides.setValueAt(index, target); return; } } overrides.put(source, target); } } private static void setNameOverrides(TransitionState state, ArrayList<String> sourceNames, ArrayList<String> targetNames) { if (sourceNames != null) { for (int i = 0; i < sourceNames.size(); i++) { setNameOverride(state.nameOverrides, (String) sourceNames.get(i), (String) targetNames.get(i)); } } } private void setBackNameOverrides(TransitionState state, ArrayMap<String, View> namedViews, boolean isEnd) { int count = this.mSharedElementTargetNames == null ? 0 : this.mSharedElementTargetNames.size(); for (int i = 0; i < count; i++) { String source = (String) this.mSharedElementSourceNames.get(i); View view = (View) namedViews.get((String) this.mSharedElementTargetNames.get(i)); if (view != null) { String target = FragmentTransitionCompat21.getTransitionName(view); if (isEnd) { setNameOverride(state.nameOverrides, source, target); } else { setNameOverride(state.nameOverrides, target, source); } } } } private void setNameOverrides(TransitionState state, ArrayMap<String, View> namedViews, boolean isEnd) { int count = namedViews.size(); for (int i = 0; i < count; i++) { String source = (String) namedViews.keyAt(i); String target = FragmentTransitionCompat21.getTransitionName((View) namedViews.valueAt(i)); if (isEnd) { setNameOverride(state.nameOverrides, source, target); } else { setNameOverride(state.nameOverrides, target, source); } } } }
[ "andrepcg@gmail.com" ]
andrepcg@gmail.com
dd66a02664cbf94865412c7bf27b3f9b00a1b52c
f21b41322c3d3ce439972a2044168c038e2dcf15
/src/DAO/ContadorMysql.java
0728848525bdb0516ff701010f0dba30c0a045d7
[]
no_license
LuanMiranda77/GracaSoft-PDV-Gerenciamento
1c27ea791355a6fce41d6ddf7ad1e0108caab041
eebb08f3add08f3225e4fe078f2e4633ca0e613d
refs/heads/main
2023-06-04T13:11:12.894161
2021-07-02T03:18:58
2021-07-02T03:18:58
382,217,609
0
0
null
null
null
null
UTF-8
Java
false
false
3,085
java
package DAO; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import DAO.InterFace.IContador; import DAO.InterFace.IEmitente; import DTO.EmitenteDTO; /** * * @author agemiro * */ public class ContadorMysql implements IContador{ private Connection con = null; PreparedStatement pst = null; private EmitenteDTO emitente; public ContadorMysql() { emitente = new EmitenteDTO(); } @Override public void cadastrar(EmitenteDTO novo){ //codigo pra conexao de banco de daos pSostgre con = ConexaoSingleton.getInstance(); try { pst = con.prepareStatement("INSERT INTO EMITENTE (CNPJ,EST,MUNIC,RAZAO,NOME,RUA,NUM,CEP,BAIRRO,CIDADE,UF,IBGE) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"); pst.setString(1, novo.getCNPJ()); pst.setString(2, novo.getInscEst()); pst.setString(3, novo.getInscMunic()); pst.setString(4, novo.getRazao()); pst.setString(4, novo.getNomeFatasia()); pst.setString(6, novo.getRua()); pst.setString(7, novo.getNum()); pst.setString(8, novo.getCep()); pst.setString(9, novo.getBairro()); pst.setString(10, novo.getCidade()); pst.setString(11, novo.getUF()); pst.setInt(12, novo.getCodIbge()); pst.execute(); }catch (SQLException e) { e.printStackTrace(); } } @Override public void editar(EmitenteDTO novo) { String sql = "UPDATE EMITENTE SET CNPJ=?,EST=?,MUNIC=?,RAZAO=?,NOME=?,RUA=?,NUM=?,CEP=?,BAIRRO=?,CIDADE=?,UF=?,IBGE=?"; con = ConexaoSingleton.getInstance(); try { pst = con.prepareStatement(sql); pst.setString(1, novo.getCNPJ()); pst.setString(2, novo.getInscEst()); pst.setString(3, novo.getInscMunic()); pst.setString(4, novo.getRazao()); pst.setString(4, novo.getNomeFatasia()); pst.setString(6, novo.getRua()); pst.setString(7, novo.getNum()); pst.setString(8, novo.getCep()); pst.setString(9, novo.getBairro()); pst.setString(10, novo.getCidade()); pst.setString(11, novo.getUF()); pst.setInt(12, novo.getCodIbge()); pst.execute(); } catch (SQLException e) { e.printStackTrace(); } System.out.println("editado com sucesso"); } @Override public EmitenteDTO pesquisar() { try { con = ConexaoSingleton.getInstance(); pst = con.prepareStatement("SELECT *FROM EMITENTE"); ResultSet rs=pst.executeQuery(); emitente = new EmitenteDTO(); emitente.setCNPJ(rs.getString("CNPJ")); emitente.setInscEst(rs.getString("EST")); emitente.setInscMunic(rs.getString("MUNIC")); emitente.setRazao(rs.getString("RAZAO")); emitente.setNomeFatasia(rs.getString("NOME")); emitente.setCep(rs.getString("CEP")); emitente.setRua(rs.getString("RUA")); emitente.setNum(rs.getString("NUM")); emitente.setBairro(rs.getString("BAIRRO")); emitente.setCidade(rs.getString("CIDADE")); emitente.setUF(rs.getString("UF")); emitente.setCodIbge(rs.getInt("IBGE")); } catch (SQLException e) { e.printStackTrace(); } return emitente; } }
[ "luanprof30@gmail.com" ]
luanprof30@gmail.com
fa9c3f04d339b7538f700ca1f7c675ccd9b5f910
97343c32af6eb18d853e87e13a4e7c6c066b76b7
/src/lesson_06Arrays/Ex_09_FindTheSum.java
1fa19ce667a8fda67e3b2c5173034c009b389a67
[]
no_license
Stefan-Yonkov/Java-Book-Exercises
c0a37b66b3093a205fc26139836984c55df08409
1d1f5a31fc46237b17a6f436baeac6f2f25937f0
refs/heads/master
2021-03-12T19:36:14.679985
2015-09-17T09:26:20
2015-09-17T09:26:20
42,646,587
0
0
null
null
null
null
UTF-8
Java
false
false
972
java
package lesson_06Arrays; import java.util.Scanner; public class Ex_09_FindTheSum { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the lenght of the arr: "); int n = input.nextInt(); int[] arr = new int[n]; for (int i = 0; i < arr.length; i++) { System.out.printf("Enter arr[%s] = ",i); arr[i] = input.nextInt(); } System.out.print("Enter the sum: "); int bestSum = input.nextInt(); int start = 0; int sum = 0; boolean foundSum = false; for (int i = 0; i < arr.length - 2; i++) { sum = arr[i]; for (int j = i + 1; j < i + 3; j++) { sum += arr[j]; if (sum == bestSum) { foundSum = true; System.out.printf("Sum %s found!",bestSum); System.out.println(); for (int j2 = i; j2 <= j; j2++) { System.out.print(arr[j2] + " "); } System.out.println(); } } } if (!foundSum) { System.out.println("No sum found!"); } } }
[ "stefan.yonkov@yahoo.com" ]
stefan.yonkov@yahoo.com
c404f19cc53d0f216f57f9b6115b0b6a1de74c81
dff3c2081c32f227855b4714ade50dfcc333df37
/app/src/androidTest/java/cn/edu/gdmec/s07150647/camerademo/ApplicationTest.java
ea2d7a0eee66cb2d6bab0949bba71c5501c9df2e
[]
no_license
gdmec07150647/Camerademo
20b8b503c9c77dd02a11e31762a2f2dbc9669b40
95126da0e28165b0cff770674c5cf85223be2a45
refs/heads/master
2021-01-12T07:25:34.203865
2016-12-20T13:08:46
2016-12-20T13:08:46
76,957,418
0
0
null
null
null
null
UTF-8
Java
false
false
364
java
package cn.edu.gdmec.s07150647.camerademo; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "137834133@qq.com" ]
137834133@qq.com
e05b183f873e6c6ce2bc3a93a89872bd5f699a5c
ad358a92067ff1ebce047f06eb3bcff4a375703c
/src/be/intecbrussel/icexception/NoMoreIceCreamException.java
f0f1bd1012fe5476952fcece15b871bcb4de6f43
[]
no_license
FlorianKeisse/IceCreamShop
52b2ed884ed77abaf301c7d93ea3152e7427915a
22f50a4c6ee690a777822d91eccef5649dbd2cd0
refs/heads/main
2023-03-24T05:34:02.036726
2021-03-26T10:26:09
2021-03-26T10:26:09
351,090,083
0
0
null
null
null
null
UTF-8
Java
false
false
227
java
package be.intecbrussel.icexception; public class NoMoreIceCreamException extends Exception { public NoMoreIceCreamException() { } public NoMoreIceCreamException(String message) { super(message); } }
[ "FlorianJoeri.Keisse@student.intecbrussel.be" ]
FlorianJoeri.Keisse@student.intecbrussel.be
06de9de7d8eb6a654a37f6ed8d84c467c53b4d79
52b29e4093e987d4414333554ebf34dfe09e4a79
/LoginPage.java
c187737609a64fd03ccb236fb92a0eb07e8967f2
[]
no_license
i33mr/Property-Rental-Management-System-Using-Java-Swing
9e934f043c3bdd762fd845e82c62eb87814c4859
ebea3534cf6e7422a08ee1d34fa163bb88fda70b
refs/heads/main
2023-06-06T21:14:01.590305
2021-07-05T04:26:26
2021-07-05T04:26:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,093
java
import java.awt.EventQueue; import java.awt.Image; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.JPasswordField; import javax.swing.JLabel; import java.awt.Color; import java.awt.Font; import java.awt.SystemColor; import javax.swing.JButton; import javax.swing.SwingConstants; import javax.swing.BoxLayout; import java.awt.event.ActionListener; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.awt.event.ActionEvent; // login panel public class LoginPage extends JPanel{ private JTextField usernameField; private JPasswordField passwordField; private JLabel errorLabel; private JPanel loginPanel; private JLabel iconLabel; private JLabel usernameLabel; private JLabel passwordLabel; private JButton loginBtn; private JLabel createNewAccountLabel; private JPanel InfoPanel; private JLabel loginSidePic; public LoginPage() { initialize(); } // initialize login panel private void initialize() { setLayout(null); loginPanel = new JPanel(); loginPanel.setBackground(Color.WHITE); loginPanel.setBounds(509, 0, 509, 671); add(loginPanel); loginPanel.setLayout(null); usernameField = new JTextField(); usernameField.setFont(new Font("Tahoma", Font.PLAIN, 30)); usernameField.setBackground(SystemColor.control); usernameField.setBounds(104, 315, 300, 50); loginPanel.add(usernameField); usernameField.setColumns(10); passwordField = new JPasswordField(); passwordField.setFont(new Font("Tahoma", Font.PLAIN, 30)); passwordField.setBackground(SystemColor.control); passwordField.setBounds(104, 409, 300, 50); loginPanel.add(passwordField); iconLabel = new JLabel(); iconLabel.setIcon(loadImage("Images/profile.png",150,150)); iconLabel.setBounds(179, 68, 150, 150); loginPanel.add(iconLabel); usernameLabel = new JLabel("Username"); usernameLabel.setFont(new Font("Source Serif Pro Black", Font.BOLD, 16)); usernameLabel.setBounds(104, 283, 150, 21); loginPanel.add(usernameLabel); passwordLabel = new JLabel("Password"); passwordLabel.setFont(new Font("Source Serif Pro Black", Font.BOLD, 16)); passwordLabel.setBounds(104, 377, 150, 21); loginPanel.add(passwordLabel); loginBtn = new JButton("LOGIN"); loginBtn.setForeground(Color.WHITE); loginBtn.setBackground(new Color(236, 77, 55)); loginBtn.setBounds(200, 512, 100, 50); loginPanel.add(loginBtn); createNewAccountLabel = new JLabel("Create new account"); createNewAccountLabel.setForeground(SystemColor.windowBorder); createNewAccountLabel.setHorizontalAlignment(SwingConstants.CENTER); createNewAccountLabel.setFont(new Font("Source Serif Pro Black", Font.BOLD, 16)); createNewAccountLabel.setBounds(179, 591, 150, 21); loginPanel.add(createNewAccountLabel); errorLabel = new JLabel(); errorLabel.setHorizontalAlignment(SwingConstants.CENTER); errorLabel.setForeground(Color.RED); errorLabel.setBounds(10, 229, 489, 43); loginPanel.add(errorLabel); InfoPanel = new JPanel(); InfoPanel.setBounds(0, 0, 509, 671); add(InfoPanel); InfoPanel.setLayout(null); loginSidePic = new JLabel(); loginSidePic.setBounds(0, 0, 509, 671); loginSidePic.setIcon(loadImage("Images/loginSide.png", 509, 671)); InfoPanel.add(loginSidePic); this.setSize(1024,700); this.setVisible(true); } // used to load images using their path and size private ImageIcon loadImage(String path, int x, int y){ Image image = new ImageIcon(this.getClass().getResource(path)).getImage(); Image scaledImage = image.getScaledInstance(x, y, java.awt.Image.SCALE_SMOOTH); return new ImageIcon(scaledImage); } public JButton getLoginButton() { return loginBtn; } public JTextField getUsernameField() { return usernameField; } public JPasswordField getPasswordField() { return passwordField; } public JLabel getErrorLabel() { return errorLabel; } public JLabel getCreateNewAccountLabel() { return createNewAccountLabel; } }
[ "omarmohmmed0@gmail.com" ]
omarmohmmed0@gmail.com
6a8cb8a4e427d6872a82136498ea2cf447df635f
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project389/src/main/java/org/gradle/test/performance/largejavamultiproject/project389/p1947/Production38953.java
e262bc6e82be0f78293b953bdcdaca4cc48c4f6e
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
package org.gradle.test.performance.largejavamultiproject.project389.p1947; public class Production38953 { private String property0; public String getProperty0() { return property0; } public void setProperty0(String value) { property0 = value; } private String property1; public String getProperty1() { return property1; } public void setProperty1(String value) { property1 = value; } private String property2; public String getProperty2() { return property2; } public void setProperty2(String value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
1683f823c1981de5db7526dc8599f40805ce0956
d33babd16d503b8112f9b35814e8fc64850201e2
/SendProtocol.java
d307386cb476a26ac32d872b7fe4c23f29a145a6
[]
no_license
Ivan-Ershov/Runner
589c2deb312bfa1ea507e73858f6f3a64880f904
f1d7f1ad8cad2989cde45d06cfe96d523efe1627
refs/heads/master
2022-12-27T17:11:01.325888
2020-10-11T15:12:13
2020-10-11T15:12:13
297,392,202
0
0
null
2020-09-23T19:49:13
2020-09-21T16:07:10
Java
UTF-8
Java
false
false
2,556
java
import java.io.*; import java.nio.charset.StandardCharsets; import java.util.Scanner; public class SendProtocol { //private final InputStream in; //private final OutputStream out; private final Scanner inString; private final PrintWriter outString; private String recipient_name; private String sender_name; private static final String path = "C:\\Users\\Public\\Downloads\\"; public SendProtocol (InputStream inputStream, OutputStream outputStream, String recipient_name) throws Exception { //this.in = inputStream; //this.out = outputStream; inString = new Scanner(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); outString = new PrintWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8), true); this.recipient_name = recipient_name; startProtocol(); } private void startProtocol () throws Exception{ outString.println(recipient_name + " version:1.0"); String[] strings = inString.nextLine().split(" "); if(!(strings[1]).equals("version:1.0")){ throw new Exception("Error connect."); } sender_name = strings[0]; } public String getMessage() throws Exception{ String type_message = inString.nextLine(); if (type_message.equals("String message.")) return sender_name + ": " + inString.nextLine(); if (type_message.equals("File message.")) { var filename = path + inString.nextLine(); var new_file = new File(filename); var outputStream = new FileOutputStream(new_file); int lengthFile = Integer.parseInt(inString.nextLine()); for(int i = 0; i < lengthFile; i++) { outputStream.write(Integer.parseInt(inString.nextLine())); outputStream.flush(); } outputStream.close(); return "System: get file " + filename; } throw new Exception("Not follow the protocol."); } public void sendMessage (String massage) { outString.println("String message."); outString.println(massage); } public void sendFile (File file) throws IOException { outString.println("File message."); outString.println(file.getName()); var in = new FileInputStream(file); outString.println(in.available()); while (in.available() > 0) { outString.println(in.read()); outString.flush(); } in.close(); } }
[ "ivan.yershov@users.noreply.github.com" ]
ivan.yershov@users.noreply.github.com
c2d7f42d4337670a79f8b3e8e4ac8fc522dcec7a
a2f1505099e1ef3becc42dcf8a514a4534f9ae45
/calendar/src/main/java/com/smile/calendar/format/DefaultFormatter.java
8e2671d7f23e1abd874b36a2cbaf90f65f4c4df4
[ "Apache-2.0" ]
permissive
KivyGogh/Dicee_calendar_schedule
82eca63d5ef6520bc8aa2cb390dc97b17b0f9547
0f84b25ffbd45ecb86976205256c39cc4968e868
refs/heads/master
2020-09-27T02:43:19.794728
2019-12-06T20:59:41
2019-12-06T20:59:41
226,407,363
0
0
null
null
null
null
UTF-8
Java
false
false
1,873
java
package com.smile.calendar.format; import android.support.annotation.NonNull; import com.smile.calendar.util.CalendarUnit; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; /** * 默认日期格式化 * @author zhaojun (Email:laobadaozjj@gmail.com) * */ public class DefaultFormatter implements Formatter { private final DateTimeFormatter dayFormatter; @SuppressWarnings("unused") private final DateTimeFormatter weekHeaderFormatter; private final DateTimeFormatter monthHeaderFormatter; public DefaultFormatter() { this("E", "'WEEK' w", "M'/ 'yyyy"); } public DefaultFormatter(@NonNull String dayPattern, @NonNull String weekPattern, @NonNull String monthPattern) { dayFormatter = DateTimeFormat.forPattern(dayPattern); weekHeaderFormatter = DateTimeFormat.forPattern(weekPattern); monthHeaderFormatter = DateTimeFormat.forPattern(monthPattern); } @Override public String getDayName(@NonNull LocalDate date) { return date.toString(dayFormatter); } @Override public String getHeaderText(@CalendarUnit.CalendarType int type, @NonNull LocalDate from, @NonNull LocalDate to , @NonNull LocalDate selected) { if (from.isBefore(selected) && to.isAfter(selected) || from.isEqual(selected) || to.isEqual(selected)) { //如果选中日期在开始日期和结束日期之间,header返回选中日期月份 return selected.toString(monthHeaderFormatter); } switch (type) { case CalendarUnit.TYPE_WEEK: //周视图默认显示结束日期月份 return to.toString(monthHeaderFormatter); case CalendarUnit.TYPE_MONTH: //月视图默认显示开始日期月份 return from.toString(monthHeaderFormatter); default: throw new IllegalStateException("Unknown calendar type"); } } }
[ "kaweh@Goudan.local" ]
kaweh@Goudan.local
1f30759b2005991bf4e2e8dab8f28cff27ccc7ef
19490fcc6f396eeb35a9234da31e7b615abf6d04
/JDBrowser/src/jd/http/requests/FormData.java
029f58d52e0908839ab8613f9c572e6092ee1396
[]
no_license
amicom/my-project
ef72026bb91694e74bc2dafd209a1efea9deb285
951c67622713fd89448ffe6e0983fe3f934a7faa
refs/heads/master
2021-01-02T09:15:45.828528
2015-09-06T15:57:01
2015-09-06T15:57:01
41,953,961
0
0
null
null
null
null
UTF-8
Java
false
false
4,726
java
// jDownloader - Downloadmanager // Copyright (C) 2009 JD-Team support@jdownloader.org // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package jd.http.requests; import java.io.File; /** * In many cases, the purpose of an HTML Form is to send data to a server. The server will process the data and then send a response to the * user. Files are a special case with HTML forms. They are binary data—or considered as such—where all others data are text data. Because * HTTP is a text protocol, there are special requirements to handle binary data. This class is simple POJO holding {@link File} reference, * byte[] of data, a type and a name. */ public class FormData { /** * enumeration of FormData types */ public static enum Type { DATA, FILE, VARIABLE } /** default MIME type: {@value #DEFAULT_MIME} */ private static final String DEFAULT_MIME = "application/octet-stream"; /** data byte array */ private byte[] data; /** file */ private File file; /** the Multipurpose Internet Mail Extensions */ private String mime; /** The name. */ private String name; /** The type. */ private final Type type; /** The value. */ private final String value; /** * constructor * * @param name * the name * @param value * the value */ public FormData(final String name, final String value) { this.type = Type.VARIABLE; this.name = name; this.value = value; } /** * constructor * * @param name * the name * @param filename * the filename * @param data * the data */ public FormData(final String name, final String filename, final byte[] data) { this(name, filename, null, data); } /** * constructor * * @param name * the name * @param filename * the filename * @param file * the file */ public FormData(final String name, final String filename, final File file) { this(name, filename, null, file); } /** * constructor * * @param name * the name * @param filename * the filename * @param mime * the mime * @param data * the data */ public FormData(final String name, final String filename, final String mime, final byte[] data) { this.mime = mime == null ? DEFAULT_MIME : mime; this.type = Type.DATA; this.name = name; this.value = filename; this.data = data; } /** * constructor * * @param name * the name * @param filename * the filename * @param mime * the mime * @param file * the file */ public FormData(final String name, final String filename, final String mime, final File file) { this.mime = mime == null ? DEFAULT_MIME : mime; this.type = Type.FILE; this.name = name; this.value = filename; this.file = file; } /** * @return the data byte[] */ public byte[] getData() { return data; } /** * @return the mime data type */ public String getDataType() { return this.mime; } /** * @return the file */ public File getFile() { return file; } /** * @return the name */ public String getName() { return name; } /** * @return the type */ public Type getType() { return type; } /** * @return the value */ public String getValue() { return value; } /** * Sets the name. * * @param name * the new name */ public void setName(final String name) { this.name = name; } }
[ "amicom.pro@gmail.com" ]
amicom.pro@gmail.com
2bdd15b18163209efc5761a3bdaa49a99a1d6ae6
4fb1afe1e48c3cefc35c480cbee2f85920b621e4
/app/src/androidTest/java/cn/com/obseverdemo/ExampleInstrumentedTest.java
759ffc19486369a066ab0c2357c241d431ebcd11
[]
no_license
luofei1999/ObseverDemo
8c95d3e6c39d1b89b07225dee7b546238d0c19f1
b4948f8b73ead516a3d6d915b173d41dea67b909
refs/heads/master
2020-07-03T00:36:35.958759
2019-08-11T06:42:49
2019-08-11T06:42:49
201,728,167
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package cn.com.obseverdemo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("cn.com.obseverdemo", appContext.getPackageName()); } }
[ "37337637+luofei1999@users.noreply.github.com" ]
37337637+luofei1999@users.noreply.github.com
6fc06f152621945bb06ceeaf2ca5f7eb3d6abbf6
ddde0f3b8702752000b260eedbd8c90f2a2d4952
/src/test/java/com/dsky/netty/pvpser/test/client/PVPClientSingleton.java
8cf6fad17d45528627dceab57ba29fec3e08fdb2
[ "Apache-2.0" ]
permissive
Melodylican/pvpserver
6a4ceb3abae72492972e4af92dd8d425e9b4dbdb
28926c00c472769e12fbe40fe78924fd2f45df66
refs/heads/master
2021-01-20T12:37:34.002764
2017-03-08T10:55:52
2017-03-08T10:55:52
82,664,713
0
0
null
null
null
null
UTF-8
Java
false
false
2,574
java
/** * @文件名称: PVPClientSingleton.java * @类路径: com.dsky.netty.pvpser.test.client * @描述: TODO * @作者:chris.li(李灿) * @时间:2017年2月27日 下午2:30:06 * @版本:V1.0 */ package com.dsky.netty.pvpser.test.client; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import com.dsky.netty.pvpser.common.ProtocolCode; import com.dsky.netty.pvpser.protocode.PVPSerProtocol.SocketRequest; import com.dsky.netty.pvpser.protocode.PVPSerProtocol.SocketRequest.Builder; import com.dsky.netty.pvpser.protocode.PVPSerProtocol.SocketResponse; /** * @类功能说明: 单例类 (双重校验锁) * @类修改者: * @修改日期: * @修改说明: * @公司名称:dsky * @作者:chris.li * @创建时间:2017年2月27日 下午2:30:06 * @版本:V1.0 */ public class PVPClientSingleton { private volatile static PVPClientSingleton singleton; private PVPClientSingleton(){} public static PVPClientSingleton getSingleton() { if(singleton == null) { System.out.println("test .."); synchronized(PVPClientSingleton.class) { if(singleton == null) { System.out.println("test 1"); singleton = new PVPClientSingleton(); } } } return singleton; } static final String HOST = System.getProperty("host","127.0.0.1"); static final int PORT = Integer.parseInt(System.getProperty("port","9000")); public static SocketResponse send(SocketRequest socketRequest) throws InterruptedException { EventLoopGroup group = new NioEventLoopGroup(); try{ Bootstrap bootstrap = new Bootstrap(); bootstrap.group(group).channel(NioSocketChannel.class).handler(new PVPClientInitializer()); //创建连接 Channel c = bootstrap.connect(HOST,PORT).sync().channel(); //获取一个handle 来发送消息 PVPClientHandler handle = c.pipeline().get(PVPClientHandler.class); System.out.println("调用了sendRequest 方法 ..."); // 发送请求 c.writeAndFlush(socketRequest); System.out.println("[client] -- 发送的请求信息体是: "+socketRequest.getRequestMsg()); while(true) { SocketResponse resp = handle.sendRequest(); if(resp.getResponseMsg() == null ) return null; else { System.out.println("Got reponse msg from Server : "+resp.getResponseMsg()); //c.close(); return resp; } } } finally { group.shutdownGracefully(); } } }
[ "chris.li@dsky.com" ]
chris.li@dsky.com
2cd065421d8f9aa16e4df25e0e947e5d5eb51328
7f31ba50c2b1f37404d507157058038acccd0a4a
/src/main/java/com/umasuo/product/domain/model/TestUnion.java
8395e1d3d9dfb575b8ff15373839300e55dbd178
[]
no_license
umasuo/product
39b6ed8f301cbed05a14936acf3aeeb72006b237
40d257b6272faae16d04e6e47301f91d447faac7
refs/heads/master
2021-06-22T12:49:26.772222
2017-09-07T07:49:01
2017-09-07T07:49:01
84,195,957
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package com.umasuo.product.domain.model; import lombok.Data; import java.io.Serializable; import javax.persistence.Embeddable; /** * 用于开发测试的unionId和secretKey. */ @Data @Embeddable public class TestUnion implements Serializable{ /** * The serialVersionUID. */ private static final long serialVersionUID = 843509058285040638L; /** * The unionId. */ private String unionId; /** * The secretKey. */ private String secretKey; }
[ "davis.dai@go6d.com" ]
davis.dai@go6d.com
b52d8a1f20bd69be7f521e090503144ca214d40d
5931ff008bcff2f3ee32d589f4280e7c52bafc0e
/jf_IOT/src/main/java/com/jf/jf_iot/device/service/impl/DeviceServiceImpl.java
f86347ee8010f43eacadc71814ddd05d5c9dd864
[]
no_license
zhujianju/jf_IOT
22d785f1802496f8a76c73955167a08a9f7a8323
ee06e04fdbdeee35fe64b468a4e846024fc5befa
refs/heads/master
2022-07-09T00:05:05.432252
2020-03-31T03:22:40
2020-03-31T03:22:40
216,957,091
0
0
null
null
null
null
UTF-8
Java
false
false
7,216
java
package com.jf.jf_iot.device.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.jf.jf_iot.common.entity.PageResult; import com.jf.jf_iot.common.enums.ExceptionEnum; import com.jf.jf_iot.common.exception.IOTException; import com.jf.jf_iot.common.mqtt.MeMqttServer; import com.jf.jf_iot.device.entity.Device; import com.jf.jf_iot.device.entity.DeviceType; import com.jf.jf_iot.device.mapper.DeviceMapper; import com.jf.jf_iot.device.service.DeviceService; import com.jf.jf_iot.device.service.DeviceTypeService; import com.jf.jf_iot.user.entity.User; import com.jf.jf_iot.user.mapper.UserMapper; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import tk.mybatis.mapper.entity.Example; import java.io.IOException; import java.util.Date; import java.util.List; import java.util.UUID; @Service public class DeviceServiceImpl implements DeviceService { @Autowired private DeviceMapper deviceMapper; @Autowired private UserMapper userMapper; @Autowired private DeviceTypeService deviceTypeService; /*定义头主题,公共主题*/ public static final String PUBLICTOPIC="public"; /*订阅地址结尾指定值*/ public static final String SUBSCRIBER="/user/devmsq"; /*发布地址结尾指定值*/ public static final String ISSUE="/user/cloudmsg"; @Override public List<Device> findAll() { return null; } @Override public PageResult findPage(int pageNum, int pageSize, Device device) { return null; } @Override public PageResult findPage(int pageNum, int pageSize, Device device, User user) { //分页 PageHelper.startPage(pageNum,pageSize); Example example=new Example(Device.class); Example.Criteria criteria = example.createCriteria(); //定义集合用于接收查询结果。 List<Device> devices=null; //用户权限判断 if(user== null){ throw new IOTException(ExceptionEnum.USER_NOT_LOGIN); } //1.当前用户没有权限 if (user.getAutho() == null || user.getAutho()==0){ throw new IOTException(ExceptionEnum.USER_NOT_AUTHO); } example.setOrderByClause("createtime DESC"); //2.当前为管理员。可查询所有的设备 if(user.getAutho() == 3){ //设置查询条件 setDeviceExample(device,criteria); devices = deviceMapper.selectByExample(example); //用于设置是否绑定用户 devices=isBindUser(devices); } //3.当前登陆为用户/经销商。 if(user.getAutho() == 1 || user.getAutho() == 2){ if(device == null){//防止报空指针异常 device=new Device(); } devices = deviceMapper.queryDeviceByUserId(user.getId(), device.getTypeid(), device.getName()); //清除devices中的不可以展示数据项 clearDeviceKey(devices); } //没有查询到设备 if(CollectionUtils.isEmpty(devices)){ throw new IOTException(ExceptionEnum.DEVICE_NOT_FOND); } //解析分页对象 PageInfo<Device> info=new PageInfo<>(devices); return new PageResult(info.getTotal(),devices); } /** * 设置查询条件,名称和分类 */ private void setDeviceExample(Device device, Example.Criteria criteria){ //判断查询条件是否为空 if(device !=null){ if(StringUtils.isNotBlank(device.getName())){ criteria.andLike("name","%"+device.getName()+"%"); } if(device.getTypeid() != null){ criteria.andEqualTo("typeid",device.getTypeid()); } } } @Override public Device findOne(Integer id) { return null; } @Override public Device findOne(String id) { Device device=new Device(); device.setId(id); Device de = deviceMapper.selectOne(device); return de; } @Override public int deleteById(String id) { return deviceMapper.deleteByPrimaryKey(id); } @Override public int deleteById(Integer id) { return 0; } @Override public int updateByid(Device device,User user) { if(user != null){ device.setLastUpdateId(user.getId()); } device.setUpdatetime(new Date()); Example example = new Example(Device.class); example.createCriteria().andEqualTo("devicename", device.getDevicename()); return deviceMapper.updateByExample(device,example); } @Override @Transactional public int insert(Device device,User user) { device.setSaleactivate(0);//设置状态未激活 String UUid=UUID.randomUUID().toString().replace("-",""); String productKey=UUid.substring(0,8); String deviceName = UUid.substring(9,16); String deviceSecret = UUid.substring(17,24); device.setProductkey(productKey); device.setDevicename(deviceName); device.setDevicesecret(deviceSecret); device.setIsenable(0);//设置默认未开启 device.setLifecyclewarn(0);//设置为已入库状态 /*查找typeKey*/ DeviceType deivceType = deviceTypeService.findOne(device.getTypeid()); String typekey = deivceType.getTypekey(); /*定制前段,相同值*/ String address="/"+typekey+"/"+productKey+"/"+deviceName; /*生成subscriber订阅地址*/ String subscriber=address; /*生成issue发布地址*/ String issue=address; device.setSubscriber(subscriber); device.setIssue(issue); if(user != null){ device.setCreatorID(user.getId()); } device.setCreatetime(new Date()); return deviceMapper.insert(device); } @Override public List<User> findBindUser(String id) { List<User> users = deviceMapper.findBindUser(id); return users; } /** * 用于设置,设备是否绑定了用户 * @param devices */ private List<Device> isBindUser(List<Device> devices){ for (Device device : devices) { List<User> users = findBindUser(device.getId()); if(users !=null && users.size()>0){ device.setIsBind(true); }else { device.setIsBind(false); } } return devices; } /** * 清空设备中的不可展示的key项。用于清空非管理员的查询项 * @return */ private List<Device> clearDeviceKey(List<Device> devices){ for (Device device : devices) { device.setProductkey(null); device.setDevicename(null); device.setDevicesecret(null); device.setSubscriber(null); device.setIssue(null); } return devices; } }
[ "53325598+bxzr11@users.noreply.github.com" ]
53325598+bxzr11@users.noreply.github.com