blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
7e9e7f02d46c972cef03ccc7569be1e96e695653
e6a4ada39b5489bb318ef3aa35b81af34748b5a7
/app/src/main/java/nami/testproject/ui/RoomsActivity.java
3b5ead5cb7237e8b41eb54f817a544e2fba65293
[]
no_license
Namiii/TestApplication
8408f49a47958ab78cc095d34ddde7f9ad906930
888bbdfa69cce7d5d9c38b1039f18b6d834bc4e9
refs/heads/master
2021-01-12T07:49:59.688897
2016-12-21T08:59:14
2016-12-21T08:59:14
77,035,085
0
0
null
null
null
null
UTF-8
Java
false
false
6,184
java
package nami.testproject.ui; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.text.Spannable; import android.text.Spanned; import android.text.style.StrikethroughSpan; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.Collections; import nami.testproject.R; import nami.testproject.models.RoomModel; import static nami.testproject.R.string.total; public class RoomsActivity extends AppCompatActivity { private ArrayList<RoomModel> rooms; private LinearLayout roomsContainer; private static final String ROOM_NIGHT_TEXT = "1 room * 1 night"; private static final StrikethroughSpan STRIKE_THROUGH_SPAN = new StrikethroughSpan(); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.room_activity_layout); roomsContainer = (LinearLayout) findViewById(R.id.rooms_container); setTitle("Room Types"); createDummyData(); displayRooms(); } private void displayRooms() { if (roomsContainer.getChildCount() > 0) { roomsContainer.removeAllViews(); } View infoView = getLayoutInflater().inflate(R.layout.info_cell, roomsContainer, false); roomsContainer.addView(infoView); for (final RoomModel roomModel : rooms) { View rootView = getLayoutInflater().inflate(R.layout.room_cell_6, roomsContainer, false); TextView roomTitle = (TextView) rootView.findViewById(R.id.room_name_tv); TextView roomPrice = (TextView) rootView.findViewById(R.id.room_price_tv); LinearLayout notesContainer = (LinearLayout) rootView.findViewById(R.id.room_details_container); TextView roomLeftCount = (TextView) rootView.findViewById(R.id.room_count_tv); Button roomSelectButton = (Button) rootView.findViewById(R.id.room_select_btn); TextView roomNight = (TextView) rootView.findViewById(R.id.room_night_tv); TextView totalLabel = (TextView) rootView.findViewById(R.id.room_price_label_tv); TextView barPrice = (TextView) rootView.findViewById(R.id.room_bar_price_tv); roomTitle.setText(roomModel.name); String roomsLeftText = getString(R.string.rooms_left) + " " + roomModel.roomsLeft; roomLeftCount.setText(roomsLeftText); displayNotes(notesContainer, roomModel); String roomPriceText; if (totalLabel != null) { roomPriceText = roomModel.price; } else { roomPriceText = getString(total) + " " + roomModel.price; } if (barPrice != null) { setStrikeThrough(barPrice, roomModel.price); } roomPrice.setText(roomPriceText); if (roomNight != null) { roomNight.setText(getRoomNightText()); } roomSelectButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(RoomsActivity.this, "Boo Yaaah", Toast.LENGTH_SHORT).show(); } }); roomsContainer.addView(rootView); } } private void displayNotes(LinearLayout notesContainer, RoomModel roomModel) { for (String note : roomModel.notes) { View rootView = getLayoutInflater().inflate(R.layout.room_note_layout, notesContainer, false); TextView noteTV = (TextView) rootView.findViewById(R.id.room_details_tv); if (note.equals("Breakfast Included")) { noteTV.setTextColor(ContextCompat.getColor(this, R.color.green)); } String noteText = "\u2022 " + note; noteTV.setText(noteText); notesContainer.addView(rootView); } } private void createDummyData() { if (rooms == null) { rooms = new ArrayList<>(); } rooms.add(createRoom("Normal Room Normal Room Normal Room", "1200THB", "Breakfast excluded,This room can comfortably sleep two guests,no cancellation", 5, true)); rooms.add(createRoom("Normal Room", "1400THB", "Breakfast Included,This room can comfortably sleep two guests,no cancellation", 2, false)); rooms.add(createRoom("Deluxe Room", "2100THB", "Breakfast Included,This room can comfortably sleep three guests,cancel before 48 hours", 3, false)); rooms.add(createRoom("Master Suite", "8000THB", "Breakfast Included,This room can comfortably sleep five guests, no cancellation", 1, false)); } private RoomModel createRoom(String roomName, String roomPrice, String roomDescription, int roomsLeft, boolean isSelected) { RoomModel room = new RoomModel(); room.name = roomName; room.price = roomPrice; room.notes = getDescriptionArray(roomDescription); room.roomsLeft = roomsLeft; room.isSelected = isSelected; return room; } private ArrayList<String> getDescriptionArray(String roomDescription) { ArrayList<String> notes = new ArrayList<>(); String[] noteStrings = roomDescription.split(","); Collections.addAll(notes, noteStrings); return notes; } private String getRoomNightText() { return ROOM_NIGHT_TEXT; } private void setStrikeThrough(TextView tv, String text) { tv.setText(text, TextView.BufferType.SPANNABLE); Spannable spannable = (Spannable) tv.getText(); spannable.setSpan(STRIKE_THROUGH_SPAN, 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } }
8e31bae363506e9e3a00c09ddd7fbfd1afdc75d0
19490fcc6f396eeb35a9234da31e7b615abf6d04
/JDownloader/src/org/jdownloader/extensions/streaming/mediaarchive/prepare/ffmpeg/StreamTags.java
b0273a2316e9ad702422ca0c7ef196b3906e202a
[]
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
822
java
package org.jdownloader.extensions.streaming.mediaarchive.prepare.ffmpeg; import org.appwork.storage.Storable; public class StreamTags implements Storable { public StreamTags(/* storable */) { } private String creation_time; public String getCreation_time() { return creation_time; } public void setCreation_time(String creation_time) { this.creation_time = creation_time; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public String getHandler_name() { return handler_name; } public void setHandler_name(String handler_name) { this.handler_name = handler_name; } private String language; private String handler_name; }
509120b666cba8231a388b26837fb8b968d4aca6
9afee3dd7df6ffcc134abf7dfa8adfd008bcfdec
/src/main/Transform.java
f52acdb6169098b0e885d641a2daafab5c729ba7
[]
no_license
garnetgrimm/Voxel2D3DConverter
17d1cf4fb7a194cab2c45501703a2b7cc42c5299
883f5723427628a7e124f38f98afa2baee6a802c
refs/heads/master
2022-04-21T12:25:39.476103
2020-04-14T22:32:30
2020-04-14T22:32:30
255,742,546
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package main; import States.StartUpState; public class Transform { public static String translate(String pos, double x, double y) { String[] values = pos.substring(2, pos.length()).split(" "); int[] xyz = new int[values.length]; try { for(int i = 0; i < values.length; i++) { xyz[i] = Integer.parseInt(values[i].substring(0, values[i].length() - 7)); } } catch(Exception e) { System.out.println("Not a Valid Loc"); } xyz[0] += x; xyz[1] += y; return "v " + xyz[0] + " " + (xyz[1] + StartUpState.cat.getHeight())+ " 0.000000"; } }
b34d6095fd82ef3d9737bff49b78e1772b60c9e5
195fff0a2b41dacf74f3f2233f2a3dd8929d56a2
/android/app/src/main/java/com/testpronto/MainApplication.java
af0dad71534ecef11267ecae42331cb286089d7a
[]
no_license
Eramirez06/TestPronto
f9a0ff85fa799c9079ab68fbb279a437352bec0f
af7f0785ea9fe9f48a6a7a441aab6fcce1a1e727
refs/heads/master
2020-05-09T21:08:29.273490
2019-04-15T07:31:36
2019-04-15T07:31:36
181,432,872
0
0
null
null
null
null
UTF-8
Java
false
false
1,135
java
package com.testpronto; import android.app.Application; import com.facebook.react.ReactApplication; import com.oblador.vectoricons.VectorIconsPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new VectorIconsPackage() ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
3631320e257dfcd8ad66f1f0a1cc7b75dfaf936d
f4949361db93e302e0a5e2203b0eff58191c9644
/lazy-tcc-core/src/main/java/com/lazy/tcc/core/repository/support/AbstractDataSourceRepository.java
44da60aebb9426b7475ee99b0af6cb5e829d8ff0
[]
no_license
lazy-share/lazy-tcc
3bbd92e70eb607ddff861d30a31a13ba41f4ed81
e8b3d355799c67ab611eaa77839eb731040f33a5
refs/heads/master
2020-04-10T16:08:01.383335
2019-05-16T11:52:33
2019-05-16T11:52:33
161,134,217
1
0
null
null
null
null
UTF-8
Java
false
false
2,256
java
package com.lazy.tcc.core.repository.support; import com.lazy.tcc.core.entity.support.BasicEntity; import com.lazy.tcc.core.exception.ConnectionIOException; import com.lazy.tcc.core.exception.TransactionCrudException; import com.lazy.tcc.core.logger.Logger; import com.lazy.tcc.core.logger.LoggerFactory; import com.lazy.tcc.core.repository.Repository; import com.lazy.tcc.core.serializer.Serialization; import com.lazy.tcc.core.serializer.SerializationFactory; import javax.sql.DataSource; import java.io.Serializable; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * <p> * AbstractDataSourceRepository Definition * </p> * * @author laizhiyuan * @since 2018/12/17. */ public abstract class AbstractDataSourceRepository<E extends BasicEntity, ID extends Serializable> implements Repository<E, ID> { private DataSource dataSource; protected static final Serialization serialization = SerializationFactory.create(); public DataSource getDataSource() { return dataSource; } public AbstractDataSourceRepository<E, ID> setDataSource(DataSource dataSource) { this.dataSource = dataSource; return this; } protected Connection getConnection() { try { return this.dataSource.getConnection(); } catch (SQLException e) { throw new ConnectionIOException(e); } } protected void releaseConnection(Connection con) { try { if (con != null && !con.isClosed()) { con.close(); } } catch (SQLException e) { throw new TransactionCrudException(e); } } protected void closeStatement(Statement stmt) { // try { // if (stmt != null && !stmt.isClosed()) { // stmt.close(); // } // } catch (Exception ex) { // throw new TransactionCrudException(ex); // } } protected void closeResultSet(ResultSet rst) { // try { // if (rst != null && !rst.isClosed()) { // rst.close(); // } // } catch (Exception ex) { // throw new TransactionCrudException(ex); // } } }
9a93fa5910903c72c1431fb8c12cf82410002f32
bc1fbf89595dc5ddac694e2dde366ec405639567
/diagnosis-exam-service/src/main/java/com/eedu/diagnosis/exam/eventListener/EventListener.java
655b35e061a5c5ea7c6225e949323a0057188953
[]
no_license
dingran9/b2b-diagnosis
5bd9396b45b815fa856d8f447567e81425e67b9e
147f7bb2ef3f0431638f076281cd74a9489f9c26
refs/heads/master
2021-05-06T07:47:14.230444
2017-12-18T09:44:08
2017-12-18T09:44:08
113,966,212
0
0
null
null
null
null
UTF-8
Java
false
false
13,950
java
package com.eedu.diagnosis.exam.eventListener; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.eedu.auth.beans.AuthGroupBean; import com.eedu.auth.beans.AuthUserBean; import com.eedu.auth.service.AuthGroupService; import com.eedu.diagnosis.common.enumration.ArtTypeEnum; import com.eedu.diagnosis.common.enumration.DiagnosisTypeEnum; import com.eedu.diagnosis.common.enumration.EventSourceEnum; import com.eedu.diagnosis.common.enumration.ExamTypeEnum; import com.eedu.diagnosis.exam.api.dto.DiagnosisRecordDetailDto; import com.eedu.diagnosis.exam.api.dto.ReleaseDiagnosisDto; import com.eedu.diagnosis.exam.api.dto.SchoolDto; import com.eedu.diagnosis.exam.api.enumeration.DiagnosisStausEnum; import com.eedu.diagnosis.exam.api.enumeration.MarkPaperStatusEnum; import com.eedu.diagnosis.exam.api.enumeration.PaperSourceEnum; import com.eedu.diagnosis.exam.persist.po.DiagnosisRecordStudentPo; import com.eedu.diagnosis.exam.persist.po.DiagnosisRecordTeacherPo; import com.eedu.diagnosis.exam.service.DiagnosisRecordStudentService; import com.eedu.diagnosis.paper.api.dto.DiagnosisComplexPaperRelationDto; import com.eedu.diagnosis.paper.api.openService.BasePaperOpenService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import java.util.*; import java.util.stream.Collectors; /** * Created by dqy on 2017/3/16. */ @Component public class EventListener implements ApplicationListener<DiagnosisEvent> { Logger log = LoggerFactory.getLogger(EventListener.class); private static final int[] LIBERAL_SUBJECTS = {7, 8, 9};//文科独有学科 private static final int[] SCIENCE_SUBJECTS = {4, 5, 6};//理科独有学科 @Autowired private DiagnosisRecordStudentService diagnosisRecordStudentService; @Autowired private AuthGroupService authGroupService; @Autowired private BasePaperOpenService basePaperOpenService; @Async @Override public void onApplicationEvent(DiagnosisEvent diagnosisEvent) { EventSourceHandler source = diagnosisEvent.getSourceHandler(); String jsonBody = source.getJsonBody(); EventSourceEnum sourceEnum = source.getSource(); switch (sourceEnum) { case SAVE_STUDENT_DIAGNOSIS_RECORDS: try { Map map = JSONArray.parseObject(jsonBody, Map.class); List<Integer> classCodes = (List<Integer>) map.get("classCodes"); String drtpJson = (String) map.get("drtd"); DiagnosisRecordTeacherPo drtd = JSONObject.parseObject(drtpJson, DiagnosisRecordTeacherPo.class); //调用组织权限接口获取学生list List<AuthUserBean> students = authGroupService.getStudentByClassLists(classCodes); List<AuthGroupBean> classes = authGroupService.getGroupByIds(classCodes); Map<Integer, List<AuthGroupBean>> classMap = classes.stream().collect(Collectors.groupingBy(AuthGroupBean::getGroupId)); List<DiagnosisRecordStudentPo> drsp = getDiagnosisRecordStudentPos(drtd, students,classMap); diagnosisRecordStudentService.saveList(drsp); } catch (Exception e) { //保存失败,补偿措施。 log.error("EventListener error" + e.getMessage()); } break; case NEW_SAVE_STUDENT_DIAGNOSIS_RECORDS: try { Map map = JSONArray.parseObject(jsonBody, Map.class); List<Integer> classCodes = (List<Integer>) map.get("classCodes"); String reDtoJson = (String) map.get("reDto"); ReleaseDiagnosisDto releaseDiagnosisDto = JSONObject.parseObject(reDtoJson, ReleaseDiagnosisDto.class); List<AuthUserBean> students = authGroupService.getStudentByClassLists(classCodes); Map<Integer, List<AuthUserBean>> studentMap = students.stream().collect(Collectors.groupingBy(AuthUserBean::getSchoolId)); List<AuthGroupBean> classes = authGroupService.getGroupByIds(classCodes); Map<Integer, List<AuthGroupBean>> classMap = classes.stream().collect(Collectors.groupingBy(AuthGroupBean::getGroupId)); List<SchoolDto> schools = JSONArray.parseArray(releaseDiagnosisDto.getSchools(), SchoolDto.class); //各科考试详情 List<DiagnosisRecordDetailDto> detailModels = JSONArray.parseArray(releaseDiagnosisDto.getDetailModels(), DiagnosisRecordDetailDto.class); List<DiagnosisRecordStudentPo> drsp = new ArrayList<>(); for (SchoolDto school : schools) { List<AuthUserBean> authUserBeans = studentMap.get(Integer.parseInt(school.getSchoolCode())); for (AuthUserBean authUserBean : authUserBeans) { for (DiagnosisRecordDetailDto detailModel : detailModels) { if((releaseDiagnosisDto.getGradeCode().equals(32) || releaseDiagnosisDto.getGradeCode().equals(32)) && detailModel.getSubjectCode().equals(2)){ if (detailModel.getArtType().equals(authUserBean.getArtType())) { drsp.add(getStudentPo(releaseDiagnosisDto, classMap, school, authUserBean, detailModel)); } }else { drsp.add(getStudentPo(releaseDiagnosisDto, classMap, school, authUserBean, detailModel)); } } } } diagnosisRecordStudentService.saveList(drsp); } catch (Exception e) { //保存失败,补偿措施。 log.error("EventListener error" + e.getMessage()); } } } private DiagnosisRecordStudentPo getStudentPo(ReleaseDiagnosisDto releaseDiagnosisDto, Map<Integer, List<AuthGroupBean>> classMap, SchoolDto school, AuthUserBean authUserBean, DiagnosisRecordDetailDto detailModel) throws Exception{ DiagnosisRecordStudentPo po = new DiagnosisRecordStudentPo(); po.setDiagnosisTeacherRecordCode(releaseDiagnosisDto.getCode()); po.setSchoolCode(Integer.parseInt(school.getSchoolCode())); po.setSchoolName(school.getSchoolName()); po.setClassCode(authUserBean.getClassId()); po.setClassName(classMap.get(authUserBean.getClassId()).get(0).getGroupName()); po.setStudentCode(authUserBean.getUserId()); po.setStudentName(authUserBean.getUserName()); po.setArtType(authUserBean.getArtType()); po.setDiagnosisName(releaseDiagnosisDto.getDiagnosisName()); po.setGradeCode(releaseDiagnosisDto.getGradeCode()); po.setStageCode(releaseDiagnosisDto.getStageCode()); po.setSubjectCode(detailModel.getSubjectCode()); po.setStartTime(detailModel.getStartTime()); po.setEndTime(detailModel.getEndTime()); po.setDiagnosisPaperName(detailModel.getDiagnosisPaperName()); po.setDiagnosisPaperCode(detailModel.getDiagnosisPaperCode()); po.setExamType(releaseDiagnosisDto.getExamType()); po.setDiagnosisStatus(DiagnosisStausEnum.RELEASE.getValue()); po.setDiagnosisType(releaseDiagnosisDto.getDiagnosisType()); po.setMarkStatus(MarkPaperStatusEnum.NOTMARK.getValue()); return po; } private List<DiagnosisRecordStudentPo> getDiagnosisRecordStudentPos(DiagnosisRecordTeacherPo drtd, List<AuthUserBean> students,Map<Integer, List<AuthGroupBean>> classMap) throws Exception { List<DiagnosisRecordStudentPo> drsp = new ArrayList<>(); //如果是全科 if (!ExamTypeEnum.UNIT.getCode().equals(drtd.getExamType())) { DiagnosisComplexPaperRelationDto dcpr = new DiagnosisComplexPaperRelationDto(); dcpr.setComplexPaperCode(drtd.getDiagnosisPaperCode()); List<DiagnosisComplexPaperRelationDto> diagnosisComplexPaperRelationList = basePaperOpenService.getDiagnosisComplexPaperRelationList(dcpr); if (!diagnosisComplexPaperRelationList.isEmpty()) { for (AuthUserBean authUserBean : students) { for (DiagnosisComplexPaperRelationDto dto : diagnosisComplexPaperRelationList) { DiagnosisRecordStudentPo po = new DiagnosisRecordStudentPo(); po.setDiagnosisTeacherRecordCode(drtd.getCode()); po.setSchoolCode(drtd.getSchoolCode()); po.setSchoolName(drtd.getSchoolName()); po.setClassCode(authUserBean.getClassId()); po.setClassName(classMap.get(authUserBean.getClassId()).get(0).getGroupName()); po.setStudentCode(authUserBean.getUserId()); po.setStudentName(authUserBean.getUserName()); po.setArtType(authUserBean.getArtType()); po.setDiagnosisName(drtd.getDiagnosisName()); po.setGradeCode(drtd.getGradeCode()); po.setStageCode(drtd.getStageCode()); po.setStartTime(drtd.getStartTime()); po.setEndTime(drtd.getEndTime()); po.setExamType(drtd.getExamType()); po.setResourceType(PaperSourceEnum.DIAGNOSIS.getValue()); po.setDiagnosisStatus(DiagnosisStausEnum.RELEASE.getValue()); po.setDiagnosisType(DiagnosisTypeEnum.COMPLEX.getValue()); po.setMarkStatus(MarkPaperStatusEnum.NOTMARK.getValue()); if (32 == drtd.getGradeCode() || 33 == drtd.getGradeCode()) {//高二 高三 分文理 数学卷也分文理科 po = formatPoSubjectAndPaper(po, authUserBean, dto); if (null == po) continue; } else { po = formatData(po, dto); } drsp.add(po); } } } } else {//单科的直接分配 students.forEach(authUserBean -> { DiagnosisRecordStudentPo po = new DiagnosisRecordStudentPo(); po.setDiagnosisTeacherRecordCode(drtd.getCode()); po.setSchoolCode(drtd.getSchoolCode()); po.setSchoolName(drtd.getSchoolName()); po.setClassCode(authUserBean.getClassId()); po.setClassName(classMap.get(authUserBean.getClassId()).get(0).getGroupName()); po.setStudentCode(authUserBean.getUserId()); po.setStudentName(authUserBean.getUserName()); po.setDiagnosisPaperCode(drtd.getDiagnosisPaperCode()); po.setDiagnosisPaperName(drtd.getDiagnosisPaperName()); po.setDiagnosisName(drtd.getDiagnosisName()); po.setGradeCode(drtd.getGradeCode()); po.setSubjectCode(drtd.getSubjectCode()); po.setStageCode(drtd.getStageCode()); po.setStartTime(drtd.getStartTime()); po.setEndTime(drtd.getEndTime()); po.setExamType(drtd.getExamType()); po.setDiagnosisStatus(DiagnosisStausEnum.RELEASE.getValue()); po.setResourceType(PaperSourceEnum.HOMEWORK.getValue()); po.setDiagnosisType(DiagnosisTypeEnum.SINGLE.getValue()); po.setMarkStatus(MarkPaperStatusEnum.NOTMARK.getValue()); po.setArtType(authUserBean.getArtType()); po.setCreateTime(new Date()); drsp.add(po); }); } return drsp; } private DiagnosisRecordStudentPo formatPoSubjectAndPaper(DiagnosisRecordStudentPo po, AuthUserBean authUserBean, DiagnosisComplexPaperRelationDto dto) { //如果是语文或者英语 直接分配 if (1 == dto.getSubjectCode() || 3 == dto.getSubjectCode()) { return formatData(po, dto); } //高二高三的 理科生 if (ArtTypeEnum.SCIENCE.getValue() == authUserBean.getArtType()) { //将数学的理科卷分配给该生 if ((2 == dto.getSubjectCode() && ArtTypeEnum.SCIENCE.getValue() == dto.getArtsType()) || Arrays.asList(SCIENCE_SUBJECTS).contains(dto.getSubjectCode())) { po = formatData(po, dto); } else { return null; } } //文科生 else if (ArtTypeEnum.LIBERAL.getValue() == authUserBean.getArtType()) { //将数学的文科卷分配给该生 if ((2 == dto.getSubjectCode() && ArtTypeEnum.LIBERAL.getValue() == dto.getArtsType()) || Arrays.asList(LIBERAL_SUBJECTS).contains(dto.getSubjectCode())) { po = formatData(po, dto); } else { return null; } } else { return null; } return po; } private DiagnosisRecordStudentPo formatData(DiagnosisRecordStudentPo po, DiagnosisComplexPaperRelationDto dto) { po.setDiagnosisPaperCode(dto.getDiagnosisPaperCode()); po.setDiagnosisPaperName(dto.getDiagnosisPaperName()); po.setSubjectCode(dto.getSubjectCode()); return po; } }
acfc9cd3cd57415975d0d2c059734e7e8287fb15
ed2c7a3adeb96cd19e1ef65a783a552b993ef980
/hashmap/HashNode.java
c75bc7568b7869adfc238068d5b11a976361bf7a
[]
no_license
ivibhanshuvaibhav/data-structures
892388d4e29a6e8ea539dda56488dc2021b8c0bb
bb45717088e04e0d312db5c3909617cdd2a7f258
refs/heads/master
2021-01-22T21:37:42.232381
2018-02-10T21:21:21
2018-02-10T21:21:21
84,851,415
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
package hashmap; public class HashNode<K, V> { K key; V value; HashNode<K, V> next; public HashNode(K key, V value){ this.key = key; this.value = value; this.next = null; } }
9109d60102cea35ae1dc198504410a231a58ef5c
815b2880fb38a357e9fbb99a1b1e33d40fb0b8f5
/src/edu/kvcc/cis298/weigel/abstractions/modules/execution/ExecutionModule.java
1f0c0f1478b4dbb87a88999158d02cc29335a9a0
[]
no_license
Kloranthy/ModularApplication
c374297c0a54baa5a9f305668ce61ed0db693eaa
35b419804c93c8ee4f475818e0353332e2ef255e
refs/heads/master
2021-01-12T12:20:40.115271
2016-11-13T23:51:55
2016-11-13T23:51:55
72,445,550
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package edu.kvcc.cis298.weigel.abstractions.modules.execution; import edu.kvcc.cis298.weigel.abstractions.module.Module; import edu.kvcc.cis298.weigel.abstractions.task.Task; public abstract class ExecutionModule extends Module { public ExecutionModule() { super( "execution" ); } public abstract void executeTask( Task task ); }
d5b3e08fbafa04164d5322932d4419906b12e677
2c9cd0e012ec041d9500844e365aa6311aa50822
/Murali SRClass/src/com/collection/ScoreAnalyzer.java
4e76f42402338ac8864991fe116b6b1fa950e679
[]
no_license
nmr999/backend-coronalice
842703f81053ef12fbfaf04dc720a94e0a0241b9
f15fb9cc6bbd47bbc5e02f9b5d10eb7f19d1d4ea
refs/heads/main
2023-04-14T10:43:25.496041
2020-12-05T16:44:55
2020-12-05T16:44:55
361,683,501
0
0
null
null
null
null
UTF-8
Java
false
false
54
java
package com.collection;public class ScoreAnalyzer { }
4882da411ecaf551b4e439513d5b400ebb085562
eb3d376d5409ad2d1ccc216b6a4857e092db3a06
/src/com/jdo/PMFSingleton.java
c3e0e0afc819fd0c57ec9f47e2ca4fa75aabe6f6
[]
no_license
Solomon-m/webanalytics
8712007381270f88f5137840d265cf1180fa01d5
9dd235d00b479475939f1e3f8f0d6265e90a6aea
refs/heads/master
2021-01-21T10:59:51.044058
2017-03-01T04:36:25
2017-03-01T04:36:25
83,511,862
0
0
null
null
null
null
UTF-8
Java
false
false
463
java
package com.jdo; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; public final class PMFSingleton { public PMFSingleton() { // TODO Auto-generated constructor stub } private static final PersistenceManagerFactory pmfInstance= JDOHelper.getPersistenceManagerFactory("transactions-optional"); public static PersistenceManagerFactory getPMF(){ System.out.println("Inside PMFSingleton().getPMF method.."); return pmfInstance; } }
bc896ee7e7531a6c1e12a148627bf015fab27b6c
b41eb24416ac008b5f537c9e15049eb7527538db
/src/com/rs/game/activites/ZarosGodwars.java
739826be201a712aae1738ace41437c5f09b7af6
[]
no_license
kennethrsps/helwyrrsps
7cf9ce2919e56ef5f1f85260caf50b23a8e99475
05b6383f674b06f0680525e6740d8cd425e7cbf4
refs/heads/master
2021-04-03T04:59:27.974804
2018-03-13T11:13:01
2018-03-13T11:13:01
125,036,605
0
0
null
null
null
null
UTF-8
Java
false
false
5,038
java
package com.rs.game.activites; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; import com.rs.cores.CoresManager; import com.rs.game.Animation; import com.rs.game.Entity; import com.rs.game.ForceTalk; import com.rs.game.Graphics; import com.rs.game.World; import com.rs.game.WorldTile; import com.rs.game.npc.godwars.zaros.Nex; import com.rs.game.npc.godwars.zaros.Nex.NexPhase; import com.rs.game.npc.godwars.zaros.NexMinion; import com.rs.game.player.Player; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.utils.Utils; public class ZarosGodwars { private static final Animation START = new Animation(17412), SECOND_START = new Animation(17413), THIRD_START = new Animation(17414); private static WorldTile[] MINION_SPAWNS = { new WorldTile(2913, 5215, 0), new WorldTile(2937, 5215, 0), new WorldTile(2937, 5191, 0), new WorldTile(2913, 5191, 0) }; private static Graphics[] MINION_GRAPHICS = { new Graphics(3359), new Graphics(3361), new Graphics(3358), new Graphics(3360) }; public static final int[] STAT_DRAIN = { 0, 1, 2, 4, 6 }; public static final int[] HIT_SOUNDS = { 3326, 3324, 3320, 3319, 3318, 3315, 3311, 3309, 3305, 3301, 3300, 3297 }; private static final List<Player> players = new LinkedList<Player>(); public static Nex nex; public static void addPlayer(final Player player) { synchronized (players) { players.add(player); if (players.size() == 1) start(); } } public static void removePlayer(Player player) { synchronized (players) { players.remove(player); if (players.size() == 0) end(); } } public static Entity getRandomNexTarget() { synchronized (players) { if (players.isEmpty()) return null; return players.get(Utils.random(players.size())); } } public static int TASK_UID; public static void start() { TASK_UID++; WorldTasksManager.schedule(new WorldTask() { int stage = 0; @Override public void run() { if (players.isEmpty() || (nex != null && nex.getTaskUID() != TASK_UID)) { stop(); return; } if (stage == 0) { World.spawnNPC(13447, new WorldTile(2924, 5202, 0), -1, true, true); sendBeginningAction(NexPhase.values()[stage]); } else if (stage < 5) { NexMinion nexMinion = (NexMinion) World.spawnNPC(13450 + stage, MINION_SPAWNS[stage - 1], 0, true, true); if (nex != null) nex.setMinion(stage - 1, nexMinion); nexMinion.setNextAnimation(new Animation(17403)); nexMinion.setNextGraphics(MINION_GRAPHICS[stage - 1]); sendBeginningAction(NexPhase.values()[stage]); } else if (stage == 5) incrementStage(NexPhase.START); else if (stage == 6) { stop(); if (nex != null) nex.start(); } stage++; } }, 4, 3); } public static void end() { synchronized (players) { if (nex != null) { for (NexMinion minion : nex.nexMinions) { if (minion == null || minion.isDead()) continue; minion.finish(); } nex.finish(); nex = null; } if (players.isEmpty()) return; CoresManager.slowExecutor.schedule(new Runnable() { @Override public void run() { try { if (players.isEmpty() || (nex != null && nex.getTaskUID() != TASK_UID)) return; start(); } catch (Throwable e) { e.printStackTrace(); } } }, 1, TimeUnit.MINUTES); } } public static void incrementStage(final NexPhase lastPhase) { NexPhase phase = NexPhase.values()[lastPhase.getPhaseValue() + 1]; nex.setCurrentPhase(phase); nex.setFirstStageAttack(true); nex.setNextForceTalk(phase.getMessage()); nex.playSoundEffect(phase.getSecondSound()); nex.setCapDamage(Utils.random(801, 999)); if (lastPhase == NexPhase.SMOKE) nex.removeInfectedPlayers(); else if (lastPhase == NexPhase.SHADOW) nex.removeShadow(); else if (lastPhase == NexPhase.BLOOD) nex.killBloodReavers(); if (phase == NexPhase.ZAROS) nex.sendFinalStage(); if (phase != NexPhase.ZAROS) World.sendProjectile(nex.getMinion(phase.getPhaseValue() - 1), nex, 2244, 18, 18, 60, 30, 0, 0); } public static void sendBeginningAction(NexPhase phase) { nex.setNextForceTalk(new ForceTalk(phase.getMinionName())); nex.setNextAnimation((phase == NexPhase.SHADOW || phase == NexPhase.ICE) ? THIRD_START : phase == NexPhase.START ? START : SECOND_START); if (phase == NexPhase.START) nex.setNextGraphics(new Graphics(3353)); nex.playSoundEffect(phase.getFirstSound()); if (phase.getPhaseValue() == 0) return; NexMinion nexMinion = nex.getMinion(phase.getPhaseValue() - 1); if (nexMinion != null) { World.sendProjectile(nex, nexMinion, 2244, 18, 18, 60, 30, 0, 0); nexMinion.faceEntity(nex); nexMinion.setCantInteract(false); nex.faceEntity(nexMinion); } } public static List<Player> getPlayers() { return players; } }
c29397d2ffd00ed19e4a61ed2ebb571d3dc546fb
e3b9a7e2b8bea99a1b4c46b27abccb4f241ba881
/app/src/androidTest/java/com/example/scontz/khontravel/ApplicationTest.java
0c257df45692758577c9fbbc30eddbb201c727af
[]
no_license
loosamza/KhonTravel
ccc031745c2f7e691fb4500f5d255e0319a0fa6d
5d64a5f777ab080dd5d38b51e3d5be97b3672344
refs/heads/master
2021-01-12T17:44:51.363975
2016-11-06T14:24:52
2016-11-06T14:24:52
71,637,618
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package com.example.scontz.khontravel; 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); } }
4a9ee31fd8bfb0f76f88565acc5887ff5b0be708
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/transform/GetCloudFormationStackRecordsResultJsonUnmarshaller.java
4efd92904805ed07282ece46330a41039ca047d8
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
3,433
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.lightsail.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.lightsail.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * GetCloudFormationStackRecordsResult JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetCloudFormationStackRecordsResultJsonUnmarshaller implements Unmarshaller<GetCloudFormationStackRecordsResult, JsonUnmarshallerContext> { public GetCloudFormationStackRecordsResult unmarshall(JsonUnmarshallerContext context) throws Exception { GetCloudFormationStackRecordsResult getCloudFormationStackRecordsResult = new GetCloudFormationStackRecordsResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return getCloudFormationStackRecordsResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("cloudFormationStackRecords", targetDepth)) { context.nextToken(); getCloudFormationStackRecordsResult.setCloudFormationStackRecords(new ListUnmarshaller<CloudFormationStackRecord>( CloudFormationStackRecordJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("nextPageToken", targetDepth)) { context.nextToken(); getCloudFormationStackRecordsResult.setNextPageToken(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return getCloudFormationStackRecordsResult; } private static GetCloudFormationStackRecordsResultJsonUnmarshaller instance; public static GetCloudFormationStackRecordsResultJsonUnmarshaller getInstance() { if (instance == null) instance = new GetCloudFormationStackRecordsResultJsonUnmarshaller(); return instance; } }
[ "" ]
07a941005aab8dde5e7073436ac8162a9bf34486
052613ebfd1b859360cce3d272e9a5d69f60dcd8
/centit-stat-module/src/main/java/com/centit/stat/resource/service/impl/DataResourceServiceImpl.java
ee6606f6a2165526b6cf2a009322122e2ca19354
[]
no_license
8899man/centit-stat
a0693fcf089ffe16a254a3a783e949af6d5ea3e3
db9c30f50c53dd9dcc58c9e739f39fc3bb383878
refs/heads/master
2020-04-25T19:54:22.943018
2019-02-25T00:45:31
2019-02-25T00:45:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,901
java
package com.centit.stat.resource.service.impl; import com.alibaba.fastjson.JSONArray; import com.centit.framework.common.ObjectException; import com.centit.framework.ip.po.DatabaseInfo; import com.centit.framework.ip.service.IntegrationEnvironment; import com.centit.stat.resource.dao.DataResourceColumnDao; import com.centit.stat.resource.dao.DataResourceDao; import com.centit.stat.resource.po.DataResource; import com.centit.stat.resource.po.DataResourceColumn; import com.centit.stat.resource.service.DataResourceService; import com.centit.support.database.utils.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @Service @Transactional public class DataResourceServiceImpl implements DataResourceService { private final Logger logger = LoggerFactory.getLogger(DataResourceServiceImpl.class); @Autowired private DataResourceDao dataResourceDao; @Autowired private DataResourceColumnDao resourceColumnDao; @Autowired private IntegrationEnvironment integrationEnvironment; @Override public void createDataResource(DataResource dataResource) { dataResourceDao.saveNewObject(dataResource); dataResourceDao.saveObjectReferences(dataResource); } @Override public void updateDataResource(DataResource dataResource) { dataResourceDao.updateObject(dataResource); dataResourceDao.saveObjectReferences(dataResource); } @Override public void deleteDataResource(String resourceId) { DataResource dataResource = dataResourceDao.getObjectById(resourceId); dataResourceDao.deleteObjectById(resourceId); dataResourceDao.deleteObjectReferences(dataResource); } @Override public List<DataResource> listDataResource(Map<String, Object> params, PageDesc pageDesc) { return dataResourceDao.listObjectsByProperties(params, pageDesc); } @Override public DataResource getDataResource(String resourceId) { return dataResourceDao.getObjectWithReferences(resourceId); } @Override public List<DataResourceColumn> generateColumn(String databaseCode, String sql) { List<DataResourceColumn> columns = new ArrayList<>(); List<String> fields = QueryUtils.getSqlFiledNames(sql); for(String field : fields){ columns.add(new DataResourceColumn(field, ""));//todo 根据列名从元数据获取中文名 } return columns; } @Override public JSONArray queryData(String databaseCode, String sql, Map<String, Object> params) { DatabaseInfo databaseInfo = integrationEnvironment.getDatabaseInfo(databaseCode); QueryAndParams qap = QueryAndParams.createFromQueryAndNamedParams(new QueryAndNamedParams(sql, params)); try (Connection connection = DbcpConnectPools.getDbcpConnect( new DataSourceDescription(databaseInfo.getDatabaseUrl(), databaseInfo.getUsername(), databaseInfo.getClearPassword()))){ return DatabaseAccess.findObjectsAsJSON(connection, qap.getQuery(), qap.getParams()); }catch (SQLException | IOException e){ logger.error("执行查询出错,SQL:{},Param:{}", qap.getQuery(), qap.getParams()); throw new ObjectException("执行查询出错!"); } } @Override public Set<String> generateParam(String sql) { return QueryUtils.getSqlTemplateParameters(sql); } @Override public void updateResourceColumn(DataResourceColumn column) { resourceColumnDao.updateObject(column); } }
55a9d9b78b670b659cd0b81834098a48f651f594
56af94bc5a0458f08070ebfc656c5aedb8f5156e
/src/main/java/com/shekhar/projector/rest/UserREST.java
4fd398109332f841af4f18da2361ab282e60dee1
[]
no_license
shekharkumargupta/projector
5ec9e6961f2a162213f26d04cb2f29b49dc2b09f
ab1b3f026a8fb96eded3e5b244e4e303870e4a04
refs/heads/master
2022-01-23T16:37:45.670744
2019-07-25T10:48:34
2019-07-25T10:48:34
162,996,549
0
0
null
2022-01-21T23:23:08
2018-12-24T14:06:49
Java
UTF-8
Java
false
false
713
java
package com.shekhar.projector.rest; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * Created by shekhar.kumar on 10/26/2018. */ @RestController @RequestMapping("user-rest") public class UserREST { @GetMapping(value = "/ping", produces = "application/json") public String ping(){ return "OK"; } @GetMapping(value = "/hello/{name}", produces = "application/json") public String hello(@PathVariable String name){ return "Hello "+name+"!"; } }
6948c75ed30855f0463ed62b023dc62a32dc3684
95d5d3956f5fa0dfa4b006ac4f8ddf0ea87fcb25
/app/src/main/java/pe/geekadvice/zzleep/adapters/ZzleepPlaceAdapter.java
7781ef2ed7a5f04ae1a03b609fda93d32ccb169e
[]
no_license
zzleepBitperfect/zzleep
e16b3096bfaddbf89d0d59e4c964a2e9d784ad5d
7f886eb7b914ae410c4130abf33e8305d0684cac
refs/heads/master
2021-01-16T00:42:49.303468
2017-08-11T00:09:13
2017-08-11T00:09:13
99,974,281
0
0
null
null
null
null
UTF-8
Java
false
false
1,380
java
package pe.geekadvice.zzleep.adapters; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.TextView; import java.util.List; import pe.geekadvice.zzleep.R; /** * Created by gerson on 18/12/16. */ public class ZzleepPlaceAdapter extends ArrayAdapter<ZzleepPlace> { public ZzleepPlaceAdapter(Context context, int resource, List<ZzleepPlace> objects) { super(context, resource, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { // Get the data item for this position ZzleepPlace place = getItem(position); // Check if an existing view is being reused, otherwise inflate the view if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.place_item, parent, false); } // Lookup view for data population TextView tvName = (TextView) convertView.findViewById(R.id.placeName); TextView tvHome = (TextView) convertView.findViewById(R.id.placeAddress); // Populate the data into the template view using the data object tvName.setText(place.getName()); tvHome.setText(place.getAddress()); // Return the completed view to render on screen return convertView; } }
a981108250d53838c6b7093d724c0d089cd269b0
d5f394d1a4478fb9cb1a2456744b2226409224ca
/app/src/main/java/com/example/claude/interactivestory/model/Story.java
19c2358fcf6f7213c0ce7e87c1223d14bca36b50
[]
no_license
claude-lee/InteractiveStory
43f592268e53c6294b32fec0653e75aa63723ca1
7a5467a85f376f390c3c0d982f184aade17e96eb
refs/heads/master
2016-09-16T13:11:32.861351
2015-03-28T13:00:28
2015-03-28T13:00:28
32,892,034
0
0
null
null
null
null
UTF-8
Java
false
false
3,321
java
package com.example.claude.interactivestory.model; import com.example.claude.interactivestory.R; /** * Created by claude on 3/26/15. */ public class Story { private Page[] mPages; public Story(){ mPages = new Page[7]; mPages[0] = new Page( R.drawable.page0, "On your return trip from studying Saturn's rings, you hear a distress signal that seems to be coming from the surface of Mars. It's strange because there hasn't been a colony there in years. Even stranger, it's calling you by name: \"Help me, %1$s, you're my only hope.\"", new Choice("Stop and investigate", 1), new Choice("Continue home to Earth", 2)); mPages[1] = new Page( R.drawable.page1, "You deftly land your ship near where the distress signal originated. You didn't notice anything strange on your fly-by, but there is a cave in front of you. Behind you is an abandoned rover from the early 21st century.", new Choice("Explore the cave", 3), new Choice("Explore the rover", 4)); mPages[2] = new Page( R.drawable.page2, "You continue your course to Earth. Two days later, you receive a transmission from HQ saying that they have detected some sort of anomaly on the surface of Mars near an abandoned rover. They ask you to investigate, but ultimately the decision is yours because your mission has already run much longer than planned and supplies are low.", new Choice("Head back to Mars to investigate", 4), new Choice("Continue home to Earth", 6)); mPages[3] = new Page( R.drawable.page3, "Your EVA suit is equipped with a headlamp, which you use to navigate the cave. After searching for a while your oxygen levels are starting to get pretty low. You know you should go refill your tank, but there's a very faint light up ahead.", new Choice("Refill at ship and explore the rover", 4), new Choice("Continue towards the faint light", 5)); mPages[4] = new Page( R.drawable.page4, "The rover is covered in dust and most of the solar panels are broken. But you are quite surprised to see the on-board system booted up and running. In fact, there is a message on the screen: \"%1$s, come to 28.543436, -81.369031.\" Those coordinates aren't far, but you don't know if your oxygen will last there and back.", new Choice("Explore the coordinates", 5), new Choice("Return to Earth", 6)); mPages[5] = new Page( R.drawable.page5, "After a long walk slightly uphill, you end up at the top of a small crater. You look around, and are overjoyed to see your favorite android, %1$s-S1124. It had been lost on a previous mission to Mars! You take it back to your ship and fly back to Earth."); mPages[6] = new Page( R.drawable.page6, "You arrive home on Earth. While your mission was a success, you forever wonder what was sending that signal. Perhaps a future mission will be able to investigate..."); } public Page getPage(int pageNumber){ return mPages[pageNumber]; } }
8e0c1c0b01ba75291bf3f0421ddcaa0fd92b14c4
db97ce70bd53e5c258ecda4c34a5ec641e12d488
/src/main/java/com/alipay/api/domain/AntMerchantExpandAssetdeliveryAssignQueryModel.java
c8cb0854d37d608597e2caad036165a027cb3717
[ "Apache-2.0" ]
permissive
smitzhang/alipay-sdk-java-all
dccc7493c03b3c937f93e7e2be750619f9bed068
a835a9c91e800e7c9350d479e84f9a74b211f0c4
refs/heads/master
2022-11-23T20:32:27.041116
2020-08-03T13:03:02
2020-08-03T13:03:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
641
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 获取配送指令 * * @author auto create * @since 1.0, 2020-06-11 19:59:48 */ public class AntMerchantExpandAssetdeliveryAssignQueryModel extends AlipayObject { private static final long serialVersionUID = 3694414746386764815L; /** * 每次拉取最大记录数量,可选值为[1,200] ; */ @ApiField("page_size") private Long pageSize; public Long getPageSize() { return this.pageSize; } public void setPageSize(Long pageSize) { this.pageSize = pageSize; } }
c5e2f47585af07493a43363ae667cb205b5f8428
8fd7c18e663829f783eb22bcff0754add2501f75
/app/src/test/java/com/example/administrator/coolweather_mvp/ExampleUnitTest.java
ad32d4c720948b7e69656195f96ba36258d09420
[ "Apache-2.0" ]
permissive
mr-shitou/CoolWeather-MVP
28129a4ccb3691f489573a0a5b21b74ec5e616d1
aeb692a8e7e4362c97b17c540b6419a299e96829
refs/heads/master
2020-03-07T16:43:30.875025
2018-04-03T12:57:48
2018-04-03T12:57:48
127,591,254
1
1
null
null
null
null
UTF-8
Java
false
false
419
java
package com.example.administrator.coolweather_mvp; 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() throws Exception { assertEquals(4, 2 + 2); } }
e9e4e78b24da338c935b6447bf91f8923a9018b1
aca2fc1b053c78dd4005f320b7ec94b26c8c05df
/alias/src/test/java/software/amazon/kms/alias/UpdateHandlerTest.java
d8b91411e55b0d72c159c27cb07bc573083fb80d
[ "Apache-2.0" ]
permissive
tijianaws/aws-cloudformation-resource-providers-kms
0cf395b8a830c4776f3881419f595640364793a9
386c3afdebbc79ef4a40f0810ac11d4c3d184e0c
refs/heads/master
2023-03-30T08:42:49.595689
2021-04-02T17:23:38
2021-04-02T17:23:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,021
java
package software.amazon.kms.alias; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import java.time.Duration; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import software.amazon.awssdk.services.kms.KmsClient; import software.amazon.cloudformation.proxy.AmazonWebServicesClientProxy; import software.amazon.cloudformation.proxy.OperationStatus; import software.amazon.cloudformation.proxy.ProgressEvent; import software.amazon.cloudformation.proxy.ProxyClient; import software.amazon.cloudformation.proxy.ResourceHandlerRequest; @ExtendWith(MockitoExtension.class) public class UpdateHandlerTest extends AbstractTestBase { @Mock private KmsClient kms; @Mock private AliasHelper aliasHelper; private UpdateHandler handler; private ResourceModel model; private AmazonWebServicesClientProxy proxy; private ProxyClient<KmsClient> proxyKmsClient; private ResourceHandlerRequest<ResourceModel> request; @BeforeEach public void setup() { handler = new UpdateHandler(aliasHelper); model = ResourceModel.builder() .aliasName("alias/aliasName1") .targetKeyId("keyId") .build(); request = ResourceHandlerRequest.<ResourceModel>builder() .desiredResourceState(model) .build(); proxy = new AmazonWebServicesClientProxy(logger, MOCK_CREDENTIALS, () -> Duration.ofSeconds(600).toMillis()); proxyKmsClient = MOCK_PROXY(proxy, kms); } @AfterEach public void post_execute() { verify(kms, atLeastOnce()).serviceName(); verifyNoMoreInteractions(proxyKmsClient.client()); verifyNoMoreInteractions(aliasHelper); } @Test public void handleRequest_PartiallyPropagate() { final ProgressEvent<ResourceModel, CallbackContext> response = handler.handleRequest(proxy, request, new CallbackContext(), proxyKmsClient, logger); verify(aliasHelper) .updateAlias(eq(Translator.updateAliasRequest(model)), eq(proxyKmsClient)); assertThat(response).isNotNull(); assertThat(response.getStatus()).isEqualTo(OperationStatus.IN_PROGRESS); assertThat(response.getCallbackContext()).isNotNull(); assertThat(response.getCallbackDelaySeconds()).isEqualTo(60); assertThat(response.getCallbackContext().propagated).isEqualTo(true); assertThat(response.getResourceModel()).isEqualTo(request.getDesiredResourceState()); assertThat(response.getResourceModels()).isNull(); assertThat(response.getMessage()).isNull(); assertThat(response.getErrorCode()).isNull(); } @Test public void handleRequest_SimpleSuccess() { final CallbackContext callbackContext = new CallbackContext(); callbackContext.setPropagated(true); final ProgressEvent<ResourceModel, CallbackContext> response = handler.handleRequest(proxy, request, callbackContext, proxyKmsClient, logger); verify(aliasHelper) .updateAlias(eq(Translator.updateAliasRequest(model)), eq(proxyKmsClient)); assertThat(response).isNotNull(); assertThat(response.getStatus()).isEqualTo(OperationStatus.SUCCESS); assertThat(response.getCallbackContext()).isNull(); assertThat(response.getCallbackDelaySeconds()).isEqualTo(0); assertThat(response.getResourceModel()).isEqualTo(request.getDesiredResourceState()); assertThat(response.getResourceModels()).isNull(); assertThat(response.getMessage()).isNull(); assertThat(response.getErrorCode()).isNull(); } }
d1622455b6bea6c861caf6f7af87ec4ab281d30e
2a2e4b81efbf5ad263b835b8c717155e61f31c4b
/Mesh4j/branches/Mesh4jEktooClient_Iteration_1.3/src/org/mesh4j/ektoo/model/MsAccessModel.java
33fdddf5e19b83e9d2d6e500852edc196c381f3b
[]
no_license
ptyagi108/mesh4x
0c9f68a5048362ed2853dd3de4b90dfadef6ebe0
c7d360d703b51d87f0795101a07d9dcf99ef8d19
refs/heads/master
2021-01-13T02:37:05.390793
2010-10-12T13:31:40
2010-10-12T13:31:40
33,174,471
0
0
null
null
null
null
UTF-8
Java
false
false
1,040
java
package org.mesh4j.ektoo.model; import org.mesh4j.ektoo.controller.MsAccessUIController; /** * @author Bhuiyan Mohammad Iklash * */ public class MsAccessModel extends AbstractModel { // MODEL VARIABLES private String databaseName = null; private String [] tableNames = null; // BUSINESS METHODS public MsAccessModel(String databaseName){ super(); this.databaseName = databaseName; } public void setDatabaseName(String databaseName) { firePropertyChange(MsAccessUIController.DATABASE_NAME_PROPERTY, this.databaseName, this.databaseName = databaseName); } public String getDatabaseName() { return databaseName; } public void setTableNames(String [] tableNames) { firePropertyChange( MsAccessUIController.TABLE_NAME_PROPERTY, this.tableNames, this.tableNames = tableNames); } public String[] getTableNames() { return tableNames; } public String toString(){ return "Ms Access | " + getDatabaseName() + " | " + getTableNames().toString(); } }
[ "saiful.raju@8593f39d-8f4b-0410-bdb6-4f53e344ee92" ]
saiful.raju@8593f39d-8f4b-0410-bdb6-4f53e344ee92
e30f95f93e761bc15b610bd9305de5faf7fe220e
64bd15542741274838efba1c894d04d0489efd61
/labs/Lab6/Problem9_1.java
e395d4ec839adf8d2d2a611c67a2f31c4b6e2b7e
[]
no_license
jenna-daly/cmpt220Daly
98b0cc94cc911326100957dd22a15e52a92b63d3
0c91b43f279787347cea6bf4d8cacdcdf1cba301
refs/heads/master
2021-01-11T19:47:28.689203
2017-05-09T19:47:05
2017-05-09T19:47:05
79,397,914
0
0
null
null
null
null
UTF-8
Java
false
false
1,453
java
/** * file: Problem9_1.java * author: Jenna Daly * course: CMPT 220 * assignment: lab 6 * due date: April 17, 2017 * version: 1.3 * * This file contains the declaration of the * Problem9_1 abstract data type. */ /** * Problem9_1 * * This class is designed to represent a rectangle. */ public class Problem9_1 { public static void main(String[] args) { Rectangle data1 = new Rectangle(4, 40); Rectangle data2 = new Rectangle(3.5, 35.9); System.out.println("For rectangle 1: the width is " + data1.width + ", the height is " +data1.height + ", the area is " + data1.getArea() + " and the perimeter is " + data1.getPerimeter()); System.out.println("For rectangle 2: the width is " + data2.width + ", the height is " +data2.height + ", the area is " + data2.getArea() + " and the perimeter is " + data2.getPerimeter()); } } class Rectangle { //data fields double width = 1; double height = 1; //constructors Rectangle(){ } Rectangle(double newWidth, double newHeight) { width = newWidth; height = newHeight; } //methods double getArea() { return width*height; } double getPerimeter() { return width + width + height + height; } } /* UML Diagram Rectangle ----------- width: double height: double ----------- Rectangle() Rectangle(newWidth: double, newHeight: double) getArea(): double getPerimeter(): double */
6700494ddeb62153fc1a04d9d7733970918482d1
1ff5eef9d90c98696a7b06c662a059926a04da30
/Bingo/src/componenteGrid/MarcadorBoton.java
5a9765b69e34fb4b14227a153b3825320be076ad
[]
no_license
Ezko-Wolf/Bingo
f22634ce462a7ce050294ca432c8fa9a7d56d8b6
998fb8b73b8be9b80262c431cfd8d25d6cfb9e27
refs/heads/main
2023-05-28T17:23:06.350081
2021-06-17T23:11:12
2021-06-17T23:11:12
376,191,123
0
0
null
2021-06-17T23:11:13
2021-06-12T03:12:37
Java
UTF-8
Java
false
false
732
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 componenteGrid; /** * * @author Dario */ public interface MarcadorBoton { /** * @return el texto a renderizar para un dato. */ public String getTexto(Object dato); /** * @return true si dato se encuentra marcado. */ public boolean marcar(Object dato); /** * @return un String contextual referido al dato. */ public String getTextoAyuda(Object dato); /** * Implementa la accion a ejecutar cuando se hace click en un dato. */ public void click(Object dato); }
1df88538562e7ca687d09e9061f5f1175908406f
32072bf80206f033f3a65f77d26d86c0478315a9
/src/main/java/org/kyojo/schemaOrg/m3n3/doma/pending/container/GeospatiallyCoversConverter.java
dc73d2ef27a1d1e2fcaad7653d86a8088e3d7835
[ "Apache-2.0" ]
permissive
covernorgedi/nagoyakaICT
76613d014dc70479f4b4364e51e7ba002ba1f5af
b375db53216eaa54f9797549a36e7c79f66b44c0
refs/heads/master
2021-04-09T14:21:23.670598
2018-03-20T10:43:37
2018-03-20T10:43:37
125,742,242
0
0
null
null
null
null
UTF-8
Java
false
false
632
java
package org.kyojo.schemaOrg.m3n3.doma.pending.container; import org.seasar.doma.ExternalDomain; import org.seasar.doma.jdbc.domain.DomainConverter; import org.kyojo.schemaOrg.m3n3.pending.impl.GEOSPATIALLY_COVERS; import org.kyojo.schemaOrg.m3n3.pending.Container.GeospatiallyCovers; @ExternalDomain public class GeospatiallyCoversConverter implements DomainConverter<GeospatiallyCovers, String> { @Override public String fromDomainToValue(GeospatiallyCovers domain) { return domain.getNativeValue(); } @Override public GeospatiallyCovers fromValueToDomain(String value) { return new GEOSPATIALLY_COVERS(value); } }
40c6d2dbcbcfccaa342abe8abe4f3f99a2e27309
528334ac5660840812697f102ce32fd024d292bd
/src/main/java/org/wso2/sample/exception/AdminServicesOperationException.java
5af0f36fce5692ab2976f7b9fd5330f4211cdffd
[ "Apache-2.0" ]
permissive
firzhan/idp_sp_import_export_tool
bc05608f9b0838cbd1c15569a824209b682d4e86
7b441f4c26aacedee9d4b62692324a97438b2af5
refs/heads/master
2020-05-07T15:54:30.851245
2019-06-12T14:26:56
2019-06-12T14:26:56
180,658,686
1
0
null
null
null
null
UTF-8
Java
false
false
360
java
package org.wso2.sample.exception; public class AdminServicesOperationException extends RuntimeException { private static final long serialVersionUID = 234L; public AdminServicesOperationException(String message) { super(message); } public AdminServicesOperationException( String message, Exception ex) { super(ex); } }
d03ceeb9b2c2be7212bd8a73806ff1b27163fa9d
6431b668292313c7f94c618452219e5460cab35c
/leetcode/L_69.java
9badd1058007b4b9eea92cf91fb1711dcd622623
[]
no_license
Nideesh1/Algo
9fe0720b0abdce7caa7049cc8d3107cc9f185c3e
4777b89bba7da9077c0296d30639102109cbda1d
refs/heads/master
2023-04-04T07:03:26.837145
2023-03-28T01:12:51
2023-03-28T01:12:51
168,574,552
77
46
null
2020-10-03T17:06:36
2019-01-31T18:27:40
Java
UTF-8
Java
false
false
390
java
class Solution { public int mySqrt(int x) { if(x == 0){return x;} int i = 1; int j = x; int ans = 0; while(i <= j){ int m = i + (j - i)/2; if(m *m == x){return m;} if(m >= x/m){ j = m-1; } if(m<= x/m){ i = m + 1; ans = m;} } return ans; } } //https://leetcode.com/problems/sqrtx/description/
2faae5a1e3bb3592dc6cd3c370cb2ee9552804a4
9b457ed4a36999f1532d367674a55e82bb69d552
/src/Anagrams.java
5304febd341eb229a688d90d3b1cd7e71f930992
[]
no_license
erik-duindam/imforeverwise
2da30d69f433f028475ab07adc695e084eb3ad70
7400cd926425686e13d0fbcf9d31ad4e50cc8033
refs/heads/master
2021-01-12T02:18:02.644406
2017-01-11T00:56:36
2017-01-11T00:56:36
78,496,015
0
0
null
null
null
null
UTF-8
Java
false
false
6,016
java
import java.util.ArrayList; /** * Created by erik on 1/9/17. */ public class Anagrams { /** * Please ignore this function and look at the explanations below, and possibly run the tests (JUnit 4). * * @param args */ public static void main(String[] args) { explainHashmapSolution(); explainTrieSolution(); explain100MSolution(); } /** * The most straightforward way of finding anagrams is by using one big HashMap to store arrays of anagrams at * an alphabetically sorted key. Lookups and inserts will generally cost O(1) time. * * There are two downsides to this approach: * 1. A lot of natural words contain the same (starting) characters, which means the HashMap will have a lot of * redundant starting characters that take space. This means you'll need quite a bit of memory for large maps. * 2. Java HashMaps cannot use primitive values (like ints/chars) as keys, which means there's quite a lot of memory * overhead due to the fact that Java has to store objects on the heap. */ public static void explainHashmapSolution() { AnagramMap map = new AnagramMap(); map.insert("erik"); map.insert("kire"); map.insert("eer"); ArrayList<String> anagrams = map.findAnagrams("erik"); System.out.println(anagrams); } /** * An alternative way to find anagrams is to create an alphabetically ordered Trie. The main benefit is saving * space for the lookup keys, and thus for memory. This method would be a lot more beneficial if we were only interested * in the number of anagrams (the count) instead of the actual words. We can further optimize memory usage by * implementing radix tries instead of plain tries. Additionally, we can strongly optimize the solution by limiting * the input data to a predefined set of characters (i.e. 26 characters of the alphabet) and use plain arrays with * integer indexes to store the actual words. * * The main downside of this approach is the O(log n) lookup and insert time. */ public static void explainTrieSolution() { AnagramTrie trie = new AnagramTrie(); trie.insert("erik"); trie.insert("kire"); trie.insert("eer"); ArrayList<String> anagrams = trie.findAnagrams("erik"); System.out.println(anagrams); } /** * If you would have a set of hundreds of millions of dictionary words, storing all of these in memory is not going * to be efficient (or even possible). If you'd still want to use a manual HashMap or Trie approach, you'd have to * persist separate maps/tries based on the input word length, or based on the first characters. You would end up with * many smaller maps or tries instead of 1 big one. It's conceptually the same as creating a database index. * However, there's no point in building this manually, since there are great tools out there for database indexing. * * The better solution is to use proven database software. If the set is indeed 100M records, any decent database system * should still be able to handle this on one server without sharding. It wouldn't matter that much whether you'd use * MySQL, PostgreSQL, MongoDB or something else. You would create a table or collection with an INDEX on the alphabetical key. * * A more complicated question would be how you would scale this to a 10B word dictionary, or a 100M word dictionary * that's being updated every second. In that case, you'd need a database system that's able to handle a lot of reads * and writes while scaling over multiple servers. Due to the O(1) lookup nature of anagrams, you might still be able * to do this on any common database system. But, if you want to scale this even further, you'll have to find a database * system that's capable of handling billions of records without effort. * * One great tool for this would be a column store like Cassandra. Cassandra partitions data over multiple * nodes (servers) automatically based on your partition key per table. If we'd use the anagram key's length and first * characters in the partition key, we can partition our dictionary distributed on many servers without manual sharding * or manual replication overhead. * * Cassandra model: * CREATE TABLE anagrams ( * a_key text, * length int, * first_char text, * anagrams list<text>, * * PRIMARY KEY ((length, first_char), a_key) * ); * * Example data: * INSERT INTO anagrams (a_key, length, first_char, anagrams) VALUES ('eikr', 4, 'e', ['erik', 'kire']); * * Example selection: * SELECT * FROM anagrams WHERE length = 4 AND first_char = 'e' AND a_key = 'eikr'; * * The partition key is (length, first_char), which means the partitions of anagrams are split up in all combinations of * key length and first character. Assuming around 26 alphabet characters and a max word length of 35, the keys * are partitioned over 26 x 35 = 910 partitions. Cassandra could write each partition on a different server, with * replication on a per-partition basis. This is potentially scalable over hundreds or even thousands of servers. * * Cassandra is able to do 1M reads/writes per second on a pretty common server setup (3 relatively large servers). * Given the fact that we break up our problem in (max) 910 parts, we should be able to scale this to Facebook * proportions. If 910 parts is not enough, we could partition on the first 2 characters instead, which would give * us a huge number of extra partitions. In all of these cases, our select queries would be in the order of tens * or hundreds of ms. * * Alternatively, we can just use a cloud service like DynamoDB :-) */ public static void explain100MSolution() { } }
3ebb28e8e3c8b35f03fbc421174ec23bcb2e6c19
4110216db92f7360b91d86c2cf898aafc6e15686
/provider/src/main/java/com/demo/cn/provider/feign/TTTC.java
d48039914f5fbf34f07795525eb0112ff315d051
[]
no_license
youjief/backup
bffbfbb820f316633177594f473b2ca9b929228c
b610ae16ba2419aa97fa791f724bc3661b5cb7c5
refs/heads/master
2022-07-16T11:01:50.493598
2020-03-13T09:54:28
2020-03-13T09:54:28
247,039,173
0
0
null
2022-06-29T18:00:50
2020-03-13T09:55:36
Java
UTF-8
Java
false
false
243
java
package com.demo.cn.provider.feign; import com.demo.cn.provider.server.TTT; /** * Created with IntelliJ IDEA. * User: Administrator * Date: 2019/11/20 * Time: 15:56 * Description: No Description */ public class TTTC implements TTT { }
b5f9db8eb3601c728ec534f6b0b764176c6e184d
6938b530230e8d7a3d92a01b3b144caac9492a96
/SurveyBack/src/main/java/com/example/demo/data_tables/mapping/Column.java
996c40679b45afd616d6757e4952c14c11ef5da5
[]
no_license
Alba007/AppSurvey
45c946fb92d3a45341c521e3b6310b029ad15261
cfc4973b0cf9c3b57f45e64ef2e345727f35e86e
refs/heads/master
2023-03-29T12:07:17.062171
2020-08-04T14:31:08
2020-08-04T14:31:08
285,006,118
0
0
null
null
null
null
UTF-8
Java
false
false
1,582
java
package com.example.demo.data_tables.mapping; import lombok.Data; import org.springframework.util.StringUtils; import javax.validation.constraints.NotBlank; @Data public class Column { @NotBlank private String data; private String name; private boolean searchable = false; private boolean orderable = true; private Search search; private String type ; private Filter filter = null; public boolean hasValidSearch() { boolean isSearchValid = false; if (this.searchable) { if (this.search != null) { if (StringUtils.hasLength(this.search.getValue())) { isSearchValid = true; } } } return isSearchValid; } public Column() { } public Column(@NotBlank String data, String name, boolean searchable, boolean orderable, Search search, String type, Filter filter) { this.data = data; this.name = name; this.searchable = searchable; this.orderable = orderable; this.search = search; this.type = type; this.filter = filter; } public String getData() { return data; } public String getName() { return name; } public boolean isSearchable() { return searchable; } public boolean isOrderable() { return orderable; } public Search getSearch() { return search; } public String getType() { return type; } public Filter getFilter() { return filter; } }
[ "test" ]
test
52a1f46f28ee1545247be14783518ac204fd0de9
691ba1a39d12988d53eeafa38461a4c3b3686066
/src/model/collision/BehaviourIterator.java
4d5d5609ff6a6788340aa40cdf660050473877f7
[]
no_license
LepilkinaElena/zbitnev-kalinin-arcanoid
e88df350560bf93cd2884e720c5e82139d116f8e
fdca4d5ad97c48051f30e19703d7516ae66808a2
refs/heads/master
2021-01-17T08:13:26.720699
2015-05-31T14:30:34
2015-05-31T14:30:34
33,496,933
0
0
null
2015-04-06T18:07:06
2015-04-06T18:07:05
null
UTF-8
Java
false
false
1,270
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 model.collision; import java.util.ArrayList; import java.util.Iterator; /** * Класс итератора для кнтйнера с поведениями * * @author Елена */ public class BehaviourIterator implements Iterator<CollisionBehaviour> { /** Итератор для внутреннего массива*/ private Iterator<CollisionBehaviour> _collisionBehaviourIterator; /** * Создать итератор * * @param list список с поведениями */ public BehaviourIterator(ArrayList<CollisionBehaviour> list) { _collisionBehaviourIterator = list.iterator(); } @Override public boolean hasNext() { return _collisionBehaviourIterator.hasNext(); } @Override public CollisionBehaviour next() { return _collisionBehaviourIterator.next(); } /** * Удалить элемент по итератору * */ public void remove() { _collisionBehaviourIterator.remove(); } }
cf7eee32daa153f7f96f6664ab1c1131d7ce852a
ec587261ec4a99ca51f617928eeb71ef0b999cfa
/src/test/java/pages_cucumberIntegration/MyViewPage1.java
6a54ea4520dc8ed0aae0d2843fa8558487887d33
[]
no_license
ManikandaprabhuGunasekaran/Mani_Sel
0461f0e297c8d6dd1544e222a08894db5b36bd48
e54798dd4013ebc00a5aa1dbd7cca6f8e1c5923e
refs/heads/master
2020-03-23T16:17:55.757152
2018-07-21T10:26:14
2018-07-21T10:26:14
141,802,936
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
package pages_cucumberIntegration; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import cucumber.api.java.en.And; import cucumber.api.java.en.Then; import lib.selenium.WebDriverServiceImpl; public class MyViewPage1 extends WebDriverServiceImpl { @FindBy(id="viewLead_companyName_sp") WebElement eleVerifyCmpyName; @FindBy(id="viewLead_firstName_sp") WebElement eleVerifyFirstName; @FindBy(id="viewLead_lastName_sp") WebElement eleVerifySecondName; public MyViewPage1(/*EventFiringWebDriver driver, ExtentTest test,String leadid*/) { /*this.driver=driver; this.test=test; */ //System.out.println(leadid); PageFactory.initElements(driver, this); } @Then ("Verify CompanyName (.*)") public MyViewPage1 VerifyCompanyName(String expectedText) { verifyPartialText(eleVerifyCmpyName, expectedText); return this; } @And ("Verify FirstName (.*)") public MyViewPage1 VerifyFirstName(String expectedText) { verifyExactText(eleVerifyFirstName, expectedText); return this; } @And ("Verify LastName (.*)") public MyViewPage1 VerifyLastName(String expectedText) { verifyExactText(eleVerifySecondName, expectedText); return this; } /* verifyExactText(eleVerifyCmpyName, expectedText); verifyExactText(eleVerifyFirstName, expectedText); verifyExactText(eleVerifySecondName, expectedText); */ }
[ "kalai@Prabhu" ]
kalai@Prabhu
aa168eaff2cc30a1c6e61cb9e296b5d047e85a01
ea4d16d54527f77138aed1c236405d860895dae4
/arrays/easy/q18/Main.java
2ea2c4e6b5bc1aea8b968cd0a1e18dec1378dd05
[]
no_license
ghozt777/DSA-Bootcamp-Java-Solutions
62e0d64d1f08c8716e332f041bccd1fef51e9e0b
6d9b0c600c89704aca86f6cde8e0c2a1ca4658df
refs/heads/main
2023-08-18T17:03:46.359200
2021-10-10T08:34:02
2021-10-10T08:34:02
399,632,653
0
1
null
2021-10-10T08:34:02
2021-08-24T23:38:05
Java
UTF-8
Java
false
false
2,674
java
import java.util.Arrays; import java.util.Scanner; import java.util.ArrayList; import java.util.List; import java.lang.String; public class Main { public static void main(String[] args) { int n; Scanner in = new Scanner(System.in); n = in.nextInt(); int[] digits = new int[n]; for(int i=0;i<n;i++) digits[i] = in.nextInt(); int k = in.nextInt(); List<Integer> ans = new ArrayList<Integer>(addToArrayForm(digits,k)); System.out.print(Arrays.toString(ans.toArray())); } static List<Integer> addToArrayForm(int[] num, int k){ // copying the elements of num array into a List of type Integer and this is going to be the List returend from the function as a answer List<Integer> ans = new ArrayList<Integer>(); for(int i : num) ans.add(i); // the add array is going to cantain every digit of k int[] add = new int[String.valueOf(k).length()]; for(int i=0;i<add.length;i++){ add[add.length-i-1] = k%10; k /= 10; } // addding individual digits of ans and add in a synchronized manner // initially ptr points to the last digit of ans List // initially i points to the last digit of add array int ptr = ans.size()-1; for(int i=add.length-1;i>=0;i--){ // checking if there are no digits in the ans List then append 0s at the front if(ptr<0){ ans.add(0,0); ptr++; } // adding indivial digits of ans and add ans.set(ptr,ans.get(ptr)+add[i]); ptr--; } // this loop is to check if an individual digits is greater than 9 or not // if it is then add 1 to the previous digit and subtract 10 from the current digit // the loop iterates from the end to the index 1 as for 0 i-1 = -1 and it will give a out of bounds error for(int i=ans.size()-1;i>=1;i--){ if(ans.get(i)>9){ ans.set(i-1,ans.get(i-1)+1); ans.set(i,(ans.get(i))-10); } } // since the prev loop runs only till 1 index 0th index is not checked and there can be a situation where ans.get(0) or the first digit in the ans List is greater than 10 // In that case append a 1 at the begging and this will increase its size by 1 and then size 0th posiiton now caontains a 1 subtract 10 from the original digit that is now at the 1st position if(ans.get(0)>9){ ans.add(0,1); ans.set(1,ans.get(1)-10); } return ans; } }
a1ad6c6f281f15ef97b571401e3f891165944514
17ae33de1551b1ffade4ae8203181bd22dff14fb
/newdeal-project-49/src/main/java/com/eomcs/lms/dao/impl/MariaDBMemberDao.java
f6a2adf5fa562df9e4a8ed3e3dc2920a4507ef0a
[]
no_license
hohe12/newdeal-20181127
ebdb4d1249fd2a33418e927e5ac044be2be0df41
22c2c6d73c49ea52f2e0f0bb744d812798a0b44c
refs/heads/master
2020-04-08T11:05:40.129680
2018-12-13T08:23:28
2018-12-13T08:23:28
159,293,147
0
0
null
null
null
null
UTF-8
Java
false
false
837
java
package com.eomcs.lms.dao.impl; import java.util.HashMap; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import com.eomcs.lms.dao.MemberDao; import com.eomcs.lms.domain.Member; public class MariaDBMemberDao implements MemberDao { SqlSessionFactory sqlSessionFactory; public MariaDBMemberDao(SqlSessionFactory sqlSessionFactory) { this.sqlSessionFactory = sqlSessionFactory; } @Override public Member findByEmailPassword(String email, String password) throws Exception { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { HashMap<String,Object> params = new HashMap<>(); params.put("email", email); params.put("password",password); return sqlSession.selectOne("MemberDao.findByEmailPassword",params); } } }
b56940a9620dc54d08e796e66fac85cbf17fea0a
f356f6387ecfce1bb8e9d0cb51dc301b2de66ebc
/GraphEngine_Backend/src/test/java/TestSuite.java
d7d70ede00f731c3b8c470df1e257699db390db0
[]
no_license
enterstudio/GenericGraphEngine
4103cd37a6811df5a62b34eb143386deb1708406
62ebae9861e0a5097383bb46dbfc18e54bec3838
refs/heads/master
2020-12-31T07:10:37.431617
2015-04-17T11:46:17
2015-04-17T11:46:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
184
java
import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({TypeTest.class, NodeTest.class, EdgeTest.class}) public class TestSuite{ }
64c33e10b6a07999dd27d87d3210ea5cfcc39690
cd42c206dd8e16411c1e33ddac50de99bcdf7f53
/src/main/java/com/clearcapital/oss/cassandra/codecs/HashSetCodec.java
333bd65c5c2b159df934206b0a6406cc9978d344
[ "MIT" ]
permissive
ofiesh/oss-cassandra-helpers
8d21e2cfe600e351dac741f58835189efdc6b463
a2fc3c907a00c54cbaf00808eb4805e04c19313a
refs/heads/master
2021-01-22T13:57:23.693812
2016-05-08T15:24:41
2016-05-08T15:24:41
59,515,656
0
0
null
2016-05-23T20:21:00
2016-05-23T20:21:00
null
UTF-8
Java
false
false
251
java
package com.clearcapital.oss.cassandra.codecs; import java.util.HashSet; public class HashSetCodec extends CollectionCodec { @Override Class<?> getCollectionClass() { Class<?> result = HashSet.class; return result; } }
1453c4fddd633a36492a10f070576db69256507f
1af8836f8b5e9fef36ca68e0ff82a9acba3ee9b0
/안드로이드/Ex09_MyAlert/src/com/study/ex09_myalert/MainActivity.java
e752c200b880d1e9c6f0e9b6dc2161c9386963a1
[]
no_license
kimsibaek/cocos2d-x-work
6ec42a62321fc3c1da5ba0ab9c65a588b468e205
3649396cc6447ec4e4472cf2c98699bc7f424216
refs/heads/master
2021-01-21T13:52:39.032926
2016-06-03T06:49:39
2016-06-03T06:49:39
54,363,192
0
0
null
null
null
null
UHC
Java
false
false
2,822
java
package com.study.ex09_myalert; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; import com.study.util.CustomProgressDialog; import com.study.util.MyUtil; public class MainActivity extends Activity { public static CustomProgressDialog progressDialog = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); Button button1 = (Button)findViewById(R.id.button1); button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { MyUtil.AlertShow(MainActivity.this, "아이디를 입력해 주세요", "알림"); } }); Button button2 = (Button)findViewById(R.id.button2); button2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { MyUtil.AlertShow(MainActivity.this, "아이디를 입력해 주세요"); } }); Button button3 = (Button)findViewById(R.id.button3); button3.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setMessage("앱을 종료하시겠습니까?") .setIcon(android.R.drawable.ic_dialog_alert) .setTitle("알림") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(), "ID value is " + Integer.toString(id), Toast.LENGTH_SHORT).show(); dialog.cancel(); } }) .setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(), "ID value is " + Integer.toString(id), Toast.LENGTH_SHORT).show(); dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); } }); Button button4 = (Button)findViewById(R.id.button4); button4.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if(progressDialog == null || !progressDialog.isShowing()){ progressDialog = CustomProgressDialog.show(MainActivity.this, "", "처리중입니다", true, true, null); } } }); } public boolean onKeyDown(int keyCode, KeyEvent event){ return super.onKeyDown(keyCode, event); } }
d689c9c7dc0911a9451b444c48e4cd034623edb3
9134a3921cefb40d11aa0dca776aac750bd39f24
/utils/src/main/java/de/uni_potsdam/hpi/utils/CollectionUtils.java
0e17c06ba9dc0a9603f350bcb6a9358cd50d3323
[ "Apache-2.0" ]
permissive
HPI-Information-Systems/metanome-algorithms
63e869172fafb5f4687dd938b3b9abe06f80c1a7
54383fc2d6df31d42687179dba6284330b01e6f9
refs/heads/master
2023-05-27T07:58:35.471828
2022-06-15T11:42:43
2022-06-15T11:42:43
113,425,021
50
30
Apache-2.0
2023-05-15T15:03:00
2017-12-07T08:44:16
Java
UTF-8
Java
false
false
7,433
java
package de.uni_potsdam.hpi.utils; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.longs.LongArrayList; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Set; public class CollectionUtils { public static <T> int countNull(Collection<T> objects) { int count = 0; for (Object o : objects) if (o == null) count++; return count; } public static <T> int countNotNull(Collection<T> objects) { return objects.size() - countNull(objects); } public static int countN(int[] numbers, int numberToCount) { int count = 0; for (int number : numbers) if (number == numberToCount) count++; return count; } public static int countNotN(int[] numbers, int numberNotToCount) { return numbers.length - countN(numbers, numberNotToCount); } public static int countN(LongArrayList numbers, int numberToCount) { int count = 0; for (long number : numbers) if (number == numberToCount) count++; return count; } public static int countNotN(LongArrayList numbers, int numberNotToCount) { return numbers.size() - countN(numbers, numberNotToCount); } // Simply concatenate the elements of a collection public static String concat(Iterable<String> strings, String separator) { if (strings == null) return ""; StringBuilder buffer = new StringBuilder(); for (String string : strings) { buffer.append(string); buffer.append(separator); } if (buffer.length() > separator.length()) buffer.delete(buffer.length() - separator.length(), buffer.length()); return buffer.toString(); } // Simply concatenate the elements of an IntArrayList public static String concat(IntArrayList integers, String separator) { if (integers == null) return ""; StringBuilder buffer = new StringBuilder(); for (int integer : integers) { buffer.append(integer); buffer.append(separator); } if (buffer.length() > separator.length()) buffer.delete(buffer.length() - separator.length(), buffer.length()); return buffer.toString(); } // Simply concatenate the elements of an IntArrayList public static String concat(LongArrayList longs, String separator) { if (longs == null) return ""; StringBuilder buffer = new StringBuilder(); for (long longValue : longs) { buffer.append(longValue); buffer.append(separator); } if (buffer.length() > separator.length()) buffer.delete(buffer.length() - separator.length(), buffer.length()); return buffer.toString(); } // Simply concatenate the elements of an array public static String concat(Object[] objects, String separator) { if (objects == null) return ""; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < objects.length; i++) { buffer.append(objects[i].toString()); if ((i + 1) < objects.length) buffer.append(separator); } return buffer.toString(); } // Simply concatenate the elements of an array public static String concat(int[] numbers, String separator) { if (numbers == null) return ""; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < numbers.length; i++) { buffer.append(numbers[i]); if ((i + 1) < numbers.length) buffer.append(separator); } return buffer.toString(); } // Simply concatenate the elements of an array public static String concat(boolean[] booleans, String separator) { if (booleans == null) return ""; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < booleans.length; i++) { buffer.append(booleans[i]); if ((i + 1) < booleans.length) buffer.append(separator); } return buffer.toString(); } // Concatenate the elements of the arrays and the whole list public static String concat(List<int[]> numbersList, String innerSeparator, String outerSeparator) { if (numbersList == null) return ""; StringBuilder buffer = new StringBuilder(); Iterator<int[]> iterator = numbersList.iterator(); while (iterator.hasNext()) { int[] numbers = iterator.next(); for (int i = 0; i < numbers.length; i++) { buffer.append(numbers[i]); if ((i + 1) < numbers.length) buffer.append(innerSeparator); } if (iterator.hasNext()) buffer.append(outerSeparator); } return buffer.toString(); } // Concatenate the elements of an array extending each element by a given prefix and suffix public static String concat(String[] strings, String prefix, String suffix, String separator) { if (strings == null) return ""; StringBuilder buffer = new StringBuilder(); for (int i = 0; i < strings.length; i++) { buffer.append(prefix + strings[i] + suffix); if ((i + 1) < strings.length) buffer.append(separator); } return buffer.toString(); } // Concatenate the same string multiple times public static String concat(int times, String string, String separator) { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < times; i++) { buffer.append(string); if ((i + 1) < times) buffer.append(separator); } return buffer.toString(); } // Interleave and concatenate the two arrays public static String concat(String[] stringsA, String[] stringsB, String separatorStrings, String separatorPairs) { if ((stringsA == null) || (stringsB == null)) return ""; StringBuilder buffer = new StringBuilder(); int times = Math.max(stringsA.length, stringsB.length); for (int i = 0; i < times; i++) { if (stringsA.length > i) buffer.append(stringsA[i]); if ((stringsA.length > i) && (stringsB.length > i)) buffer.append(separatorStrings); if (stringsB.length > i) buffer.append(stringsB[i]); if ((i + 1) < times) buffer.append(separatorPairs); } return buffer.toString(); } public static String concat(ObjectArrayList<int[][]> samples, String separator) { if (samples == null) return ""; StringBuilder buffer = new StringBuilder(); for (int[][] sample : samples) buffer.append(sample.length + separator); return buffer.substring(0, buffer.length() - 1); } // Removes all values that occur in both sets from both sets public static boolean removeIntersectionFrom(Set<String> first, Set<String> second) { // TODO: test: Set<String> intersection = Sets.intersection(first, second); Set<String> intersection = new ObjectOpenHashSet<String>(first); intersection.retainAll(second); first.removeAll(intersection); second.removeAll(intersection); return !intersection.isEmpty(); } public static int max(int[] values) { if (values == null) throw new RuntimeException("The maximum of null is not defined!"); if (values.length == 0) throw new RuntimeException("The maximum of an empty list is not defined!"); int max = values[0]; for (int i = 1; i < values.length; i++) if (max < values[i]) max = values[i]; return max; } public static int min(int[] values) { if (values == null) throw new RuntimeException("The minimum of null is not defined!"); if (values.length == 0) throw new RuntimeException("The minimum of an empty list is not defined!"); int min = values[0]; for (int i = 1; i < values.length; i++) if (min > values[i]) min = values[i]; return min; } }
091031eac77e6d657523728a7b0f4ddd085e0154
fe224b669cfd0e05567c9e116a75fc1953f1ed23
/src/main/java/cc/sgee/visualoperation/service/impl/WebSiteServiceImpl.java
005bdf0f00274aae33b044830335ecf6a5447dc1
[]
no_license
ThornClub/visualoperation
a65f6c8c640c1f347684315119c3f88fc77c40f7
994c8499553580a3dcae4f6d08d57f86d8a9b70e
refs/heads/master
2023-05-27T05:18:34.443506
2021-06-06T01:41:16
2021-06-06T01:41:16
356,750,092
0
0
null
null
null
null
UTF-8
Java
false
false
2,913
java
package cc.sgee.visualoperation.service.impl; import cc.sgee.visualoperation.common.utils.ExecuteShell; import cc.sgee.visualoperation.service.WebSiteService; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @program: visualoperation * @description: 网站页面服务实现类 * @author: Thorn * @create: 2021-05-07 21:21 **/ @Service public class WebSiteServiceImpl implements WebSiteService { @Override public List<Map<String, String>> getInfo() { List<Map<String,String>> info = null; try { info = new ArrayList<>(); Map<String,String> mapInfo = new HashMap<>(); String result = ExecuteShell.GetResult("./sh/GetNginxInfo.sh"); String nginxStatus; if ("0".equals(result.split(" ")[0])) { nginxStatus = "Running"; } else { nginxStatus = "Stopped"; } mapInfo.put("nginxStatus",nginxStatus); mapInfo.put("nginxVersion",result.split(" ")[1]); info.add(mapInfo); } catch (Exception e) { e.printStackTrace(); } return info; } @Override public void operate(String operate) { switch (operate){ case "Start": ExecuteShell.Shell("service nginx start"); break; case "Stop": ExecuteShell.Shell("service nginx stop"); break; case "Restart": ExecuteShell.Shell("service nginx restart"); break; default: } } @Override public void add(String domain, String port) { try { ExecuteShell.Shell("./sh/AddWeb.sh " + domain + " " + port); } catch (Exception e) { e.printStackTrace(); } } @Override public List<Map<String, String>> getWebInfo() { List<Map<String,String>> info = new ArrayList<>(); String result = ExecuteShell.GetResult("./sh/GetWebInfo.sh"); if (!result.equals("")) { String[] res = result.split(" "); for (int i = 0; i < res.length; i++) { Map<String,String> map_info = new HashMap<>(); map_info.put("ssl",res[i].split(",")[0]); map_info.put("domain",res[i].split(",")[1]); map_info.put("port",res[i].split(",")[2]); map_info.put("root",res[i].split(",")[3]); info.add(map_info); } } return info; } @Override public void del(String domain, String root) { ExecuteShell.Shell("./sh/delWeb.sh " + domain + " " + root); } }
5ae1724da94eae245277814e3f9b19b84c3e0fd3
d7ffb3e639cb8588ff7732be59ef0a3de479bdb6
/src/main/java/com/oreon/cerebrum/web/action/encounter/EncounterAction.java
ee31fb7e1961b649b071fd37ea1f8cae1cfcc6f1
[]
no_license
techflash/cerebrumehr
79817d3cad3739f2710fd747cc0f4c71fe5d54f6
25c0c128bebc1a9f3c2c218a0257c8c192f308f1
refs/heads/master
2021-01-19T09:20:54.541308
2015-05-01T15:53:00
2015-05-01T15:53:00
34,910,497
1
0
null
2015-05-01T15:55:10
2015-05-01T15:55:09
null
UTF-8
Java
false
false
2,307
java
package com.oreon.cerebrum.web.action.encounter; import java.util.ArrayList; import java.util.List; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import org.witchcraft.exceptions.BusinessException; import org.witchcraft.seam.action.UserUtilAction; import com.oreon.cerebrum.codes.SimpleCode; import com.oreon.cerebrum.prescription.Prescription; import com.oreon.cerebrum.web.action.employee.PhysicianAction; import com.oreon.cerebrum.web.action.patient.PatientAction; import com.oreon.cerebrum.web.action.prescription.PrescriptionAction; //@Scope(ScopeType.CONVERSATION) @Name("encounterAction") public class EncounterAction extends EncounterActionBase implements java.io.Serializable { @In(create = true) PhysicianAction physicianAction; @In(create = true) UserUtilAction userUtilAction; @In(create = true) PrescriptionAction prescriptionAction; @In(create=true) PatientAction patientAction; private List<SimpleCode> selectedSimpleCodes = new ArrayList<SimpleCode>(); public EncounterAction() { super(); /* * Encounter encounter = getInstance(); if(isNew() && * encounter.getListReasons().isEmpty()){ * encounter.getListReasons().add(new Reason()); } */ } @Override public String save(boolean endConversation) { instance.setCreator(userUtilAction.getCurrentLoggedInEmployee()); if (getInstance().getPatient() == null) { if (patientAction.getInstance() == null || patientAction.getInstance().getId() == null) throw new BusinessException("Must Select a patient"); getInstance().setPatient(patientAction.getInstance()); } Prescription prescription = prescriptionAction.getInstance(); if (!prescription.getPrescriptionItems().isEmpty()) { prescription.setPatient(instance.getPatient()); prescriptionAction.save(); instance.setPrescription(prescription); } /* * patientAction.setInstance(instance.getPatient()); * patientAction.save(endConversation); */ // getInstance().setCreatedByUser(userUtilAction.getCurrentUser()); return super.save(endConversation); } public void setSelectedSimpleCodes(List<SimpleCode> selectedSimpleCodes) { this.selectedSimpleCodes = selectedSimpleCodes; } public List<SimpleCode> getSelectedSimpleCodes() { return selectedSimpleCodes; } }
479a31d5d95bb8d70419b6db4ec3a92aad9c56d5
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/textstatus/PluginTextStatus$i.java
d7241ad584c2827f18de73d5e89cc3ea0962e780
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
815
java
package com.tencent.mm.plugin.textstatus; import com.tencent.matrix.trace.core.AppMethodBeat; import kotlin.Metadata; import kotlin.g.b.u; @Metadata(d1={""}, d2={"<anonymous>", "Lcom/tencent/mm/plugin/textstatus/conversation/config/TextStatusPrivateMsgConfig;"}, k=3, mv={1, 5, 1}, xi=48) final class PluginTextStatus$i extends u implements kotlin.g.a.a<com.tencent.mm.plugin.textstatus.conversation.c.a> { public static final i TbC; static { AppMethodBeat.i(289630); TbC = new i(); AppMethodBeat.o(289630); } PluginTextStatus$i() { super(0); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes3.jar * Qualified Name: com.tencent.mm.plugin.textstatus.PluginTextStatus.i * JD-Core Version: 0.7.0.1 */
fd9884ee0bdb179f86d0dac1765a6a26e78a57f8
616c5a840b82070a8e99b3a2ca24e9b51d4ac12b
/app/src/main/java/com/bleizing/parkirqyu/models/Kendaraan.java
657820e3c388dbbcacc1e27a4aae1bc6c633c053
[]
no_license
bleizing/parkirqyu_android
bde4a9c4db98fca4935b46190765dc307635d42f
a4f8c371087aa92249a8243fe30f088f496c50f3
refs/heads/master
2020-06-03T04:54:16.967293
2019-08-06T06:26:24
2019-08-06T06:26:24
191,446,671
0
0
null
null
null
null
UTF-8
Java
false
false
3,860
java
package com.bleizing.parkirqyu.models; import android.os.Parcel; import android.os.Parcelable; public class Kendaraan implements Parcelable { private int kendaraanId; private String nomorRegistrasi; private String nama; private String alamat; private String merk; private String type; private String tahunPembuatan; private String nomorRangka; private String nomorMesin; private String vehicleType; public Kendaraan(int kendaraanId, String nomorRegistrasi, String nama, String alamat, String merk, String type, String tahunPembuatan, String nomorRangka, String nomorMesin, String vehicleType) { this.kendaraanId = kendaraanId; this.nomorRegistrasi = nomorRegistrasi; this.nama = nama; this.alamat = alamat; this.merk = merk; this.type = type; this.tahunPembuatan = tahunPembuatan; this.nomorRangka = nomorRangka; this.nomorMesin = nomorMesin; this.vehicleType = vehicleType; } protected Kendaraan(Parcel in) { kendaraanId = in.readInt(); nomorRegistrasi = in.readString(); nama = in.readString(); alamat = in.readString(); merk = in.readString(); type = in.readString(); tahunPembuatan = in.readString(); nomorRangka = in.readString(); nomorMesin = in.readString(); vehicleType = in.readString(); } public static final Creator<Kendaraan> CREATOR = new Creator<Kendaraan>() { @Override public Kendaraan createFromParcel(Parcel in) { return new Kendaraan(in); } @Override public Kendaraan[] newArray(int size) { return new Kendaraan[size]; } }; public void setNomorRegistrasi(String nomorRegistrasi) { this.nomorRegistrasi = nomorRegistrasi; } public String getAlamat() { return alamat; } public void setAlamat(String alamat) { this.alamat = alamat; } public String getNama() { return nama; } public void setNama(String nama) { this.nama = nama; } public String getMerk() { return merk; } public void setMerk(String merk) { this.merk = merk; } public String getNomorMesin() { return nomorMesin; } public void setNomorMesin(String nomorMesin) { this.nomorMesin = nomorMesin; } public String getNomorRangka() { return nomorRangka; } public void setNomorRangka(String nomorRangka) { this.nomorRangka = nomorRangka; } public String getNomorRegistrasi() { return nomorRegistrasi; } public void setTahunPembuatan(String tahunPembuatan) { this.tahunPembuatan = tahunPembuatan; } public String getTahunPembuatan() { return tahunPembuatan; } public void setType(String type) { this.type = type; } public String getType() { return type; } public void setVehicleType(String vehicleType) { this.vehicleType = vehicleType; } public String getVehicleType() { return vehicleType; } public int getKendaraanId() { return kendaraanId; } public void setKendaraanId(int kendaraanId) { this.kendaraanId = kendaraanId; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(kendaraanId); dest.writeString(nomorRegistrasi); dest.writeString(nama); dest.writeString(alamat); dest.writeString(merk); dest.writeString(type); dest.writeString(tahunPembuatan); dest.writeString(nomorRangka); dest.writeString(nomorMesin); dest.writeString(vehicleType); } }
228295849fe19776da44ac2b4ef7e258e71b2f6b
7bb29da2794a801b05cbe4ddb3d90c02ed4d4be3
/sdk/src/test/java/io/opentelemetry/sdk/tags/internal/CurrentTagMapUtilsTest.java
60eaac8c8cde8e23810f88afae0c37865f4bd256
[ "Apache-2.0" ]
permissive
c24t/opentelemetry-java
a52ec4f44bdabe33e68963b9066e75a61444d64f
8b1865303ae46ff419a7dc803fcd4e2552b45314
refs/heads/master
2020-05-19T22:41:51.110666
2019-05-06T18:27:26
2019-05-06T18:27:26
185,251,615
0
0
Apache-2.0
2019-05-06T18:37:23
2019-05-06T18:37:22
null
UTF-8
Java
false
false
2,947
java
/* * Copyright 2019, OpenTelemetry Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.opentelemetry.sdk.tags.internal; import static com.google.common.truth.Truth.assertThat; import io.grpc.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.tags.EmptyTagMap; import io.opentelemetry.tags.TagMap; import io.opentelemetry.tags.unsafe.ContextUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** Unit tests for {@link CurrentTagMapUtils}. */ @RunWith(JUnit4.class) public class CurrentTagMapUtilsTest { @Mock private TagMap tagMap; @Before public void setUp() { MockitoAnnotations.initMocks(this); } @Test public void testGetCurrentTagMap_DefaultContext() { assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(EmptyTagMap.INSTANCE); } @Test public void testGetCurrentTagMap_ContextSetToNull() { Context orig = ContextUtils.withValue(Context.current(), null).attach(); try { TagMap tags = CurrentTagMapUtils.getCurrentTagMap(); assertThat(tags).isNotNull(); assertThat(tags.getIterator().hasNext()).isFalse(); } finally { Context.current().detach(orig); } } @Test public void testWithTagMap() { assertThat(CurrentTagMapUtils.getCurrentTagMap().getIterator().hasNext()).isFalse(); try (Scope wtm = CurrentTagMapUtils.withTagMap(tagMap)) { assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(tagMap); } assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(EmptyTagMap.INSTANCE); } @Test public void testWithTagMapUsingWrap() { Runnable runnable; try (Scope wtm = CurrentTagMapUtils.withTagMap(tagMap)) { assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(tagMap); runnable = Context.current() .wrap( new Runnable() { @Override public void run() { assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(tagMap); } }); } assertThat(CurrentTagMapUtils.getCurrentTagMap()).isSameInstanceAs(EmptyTagMap.INSTANCE); // When we run the runnable we will have the TagMap in the current Context. runnable.run(); } }
c4eb41c9ea08ef05b32e81e12b5784485731a1be
89ca0ccd949bd2ce4f35d3ee4390d5ea672d94f9
/src/org/commoncrawl/async/CallbackWithResult.java
5680b8550017333603ec9994c9d629db25f62138
[]
no_license
joskid/commoncrawl-crawler
522c135c74bfaae288b7ee87aea8589fa5aeb360
904be6e8bf97c127fd8cf982df80b7530d01317b
refs/heads/master
2021-01-17T22:49:05.917027
2012-04-23T23:35:05
2012-04-23T23:35:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
850
java
/** * Copyright 2008 - CommonCrawl Foundation * * CommonCrawl licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.commoncrawl.async; /** * A callback with a result * * @author rana * * @param <ResultType> */ public interface CallbackWithResult<ResultType> { public void execute(ResultType result); }
3a637e5fe5313405626e358fe854cde5586602d5
dbdbdd14c1f09111874685836e9256e9c14ad74b
/BatchManagement/src/com/batchManagement/servlet/GetTopper.java
1a1df93660767daece6b3f88990ecd6228004f30
[]
no_license
Amol2709/Batch-Management-JSP
4a39615d40241e16c7236831f33979ad4efcd017
90382b078f40c3452fdd6550d4c997af23096098
refs/heads/main
2023-02-19T21:13:18.699835
2021-01-23T13:04:00
2021-01-23T13:04:00
332,210,665
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.batchManagement.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/GetTopper") public class GetTopper extends HttpServlet { private static final long serialVersionUID = 1L; public GetTopper() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
f550ba44e9a1a6993e34268ce1bfbba4dd99e9ef
9633324216599db0cf1146770c62da8123dc1702
/src/fractalzoomer/gui/InColoringFormulaDialog.java
5ed5510df089005cddc9d2c9350af3060788acd6
[]
no_license
avachon100501/Fractal-Zoomer
fe3287371fd8716aa3239dd6955239f2c5d161cd
d21c173b8b12f11108bf844b53e09bc0d55ebeb5
refs/heads/master
2022-10-05T21:42:07.433545
2020-06-05T11:19:17
2020-06-05T11:19:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,241
java
/* * Copyright (C) 2020 hrkalona2 * * 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 fractalzoomer.gui; import fractalzoomer.main.MainWindow; import fractalzoomer.main.app_settings.Settings; import fractalzoomer.parser.ParserException; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.ImageIcon; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.SwingConstants; import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE; /** * * @author hrkalona2 */ public class InColoringFormulaDialog extends JDialog { private MainWindow ptra; private JOptionPane optionPane; public InColoringFormulaDialog(MainWindow ptr, Settings s, int oldSelected, JRadioButtonMenuItem[] in_coloring_modes) { super(ptr); ptra = ptr; setTitle("User In Coloring Method"); setModal(true); setIconImage(getIcon("/fractalzoomer/icons/mandel2.png").getImage()); JTabbedPane tabbedPane = new JTabbedPane(); //tabbedPane.setPreferredSize(new Dimension(550, 210)); tabbedPane.setPreferredSize(new Dimension(495, 190)); tabbedPane.setFocusable(false); JTextField field_formula = new JTextField(MainWindow.runsOnWindows ? 50 : 45);//48 field_formula.setText(s.fns.incoloring_formula); JPanel formula_panel = new JPanel(); formula_panel.setLayout(new FlowLayout()); formula_panel.add(new JLabel("in =")); formula_panel.add(field_formula); tabbedPane.addTab("Normal", formula_panel); JPanel formula_panel_cond1 = new JPanel(); formula_panel_cond1.setLayout(new GridLayout(2, 2)); JTextField field_condition = new JTextField(24); field_condition.setText(s.fns.user_incoloring_conditions[0]); JTextField field_condition2 = new JTextField(24); field_condition2.setText(s.fns.user_incoloring_conditions[1]); formula_panel_cond1.add(new JLabel("Left operand:", SwingConstants.HORIZONTAL)); formula_panel_cond1.add(new JLabel("Right operand:", SwingConstants.HORIZONTAL)); formula_panel_cond1.add(field_condition); formula_panel_cond1.add(field_condition2); JTextField field_formula_cond1 = new JTextField(MainWindow.runsOnWindows ? 45 : 40);//35 field_formula_cond1.setText(s.fns.user_incoloring_condition_formula[0]); JTextField field_formula_cond2 = new JTextField(MainWindow.runsOnWindows ? 45 : 40);//35 field_formula_cond2.setText(s.fns.user_incoloring_condition_formula[1]); JTextField field_formula_cond3 = new JTextField(MainWindow.runsOnWindows ? 45 : 40);//35 field_formula_cond3.setText(s.fns.user_incoloring_condition_formula[2]); JPanel formula_panel_cond11 = new JPanel(); formula_panel_cond11.add(new JLabel("left > right, in =")); formula_panel_cond11.add(field_formula_cond1); JPanel formula_panel_cond12 = new JPanel(); formula_panel_cond12.add(new JLabel("left < right, in =")); formula_panel_cond12.add(field_formula_cond2); JPanel formula_panel_cond13 = new JPanel(); formula_panel_cond13.add(new JLabel("left = right, in =")); formula_panel_cond13.add(field_formula_cond3); JPanel panel_cond = new JPanel(); panel_cond.setLayout(new FlowLayout()); panel_cond.add(formula_panel_cond1); panel_cond.add(formula_panel_cond11); panel_cond.add(formula_panel_cond12); panel_cond.add(formula_panel_cond13); tabbedPane.addTab("Conditional", panel_cond); Object[] labels3 = ptra.createUserFormulaLabels("z, c, s, p, pp, n, maxn, bail, cbail, center, size, sizei, v1 - v30, point"); tabbedPane.setSelectedIndex(s.fns.user_in_coloring_algorithm); Object[] message3 = { labels3, " ", "Set the in coloring formula. Only the real component of the complex number will be used.", tabbedPane,}; optionPane = new JOptionPane(message3, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { optionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION)); } }); optionPane.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) { Object value = optionPane.getValue(); if (value == JOptionPane.UNINITIALIZED_VALUE) { //ignore reset return; } //Reset the JOptionPane's value. //If you don't do this, then if the user //presses the same button next time, no //property change event will be fired. optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE); if ((Integer) value == JOptionPane.CANCEL_OPTION || (Integer) value == JOptionPane.NO_OPTION || (Integer) value == JOptionPane.CLOSED_OPTION) { in_coloring_modes[oldSelected].setSelected(true); s.fns.in_coloring_algorithm = oldSelected; dispose(); return; } try { if (tabbedPane.getSelectedIndex() == 0) { s.parser.parse(field_formula.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the in formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail() ) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else { s.parser.parse(field_condition.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the left condition formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail()) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } s.parser.parse(field_condition2.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the right condition formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail()) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } s.parser.parse(field_formula_cond1.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the left > right in formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail()) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } s.parser.parse(field_formula_cond2.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the left < right in formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail()) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } s.parser.parse(field_formula_cond3.getText()); if(s.parser.foundR()) { JOptionPane.showMessageDialog(ptra, "The variable: r cannot be used in the left = right in formula.", "Error!", JOptionPane.ERROR_MESSAGE); return; } if (s.isConvergingType()) { if (s.parser.foundBail()) { JOptionPane.showMessageDialog(ptra, "The variable: bail can only be used in escaping type fractals.", "Error!", JOptionPane.ERROR_MESSAGE); return; } } else if (s.parser.foundCbail()) { JOptionPane.showMessageDialog(ptra, "The variable: cbail can only be used in converging type fractals\n(Root finding methods, Nova, User converging formulas).", "Error!", JOptionPane.ERROR_MESSAGE); return; } } s.fns.user_in_coloring_algorithm = tabbedPane.getSelectedIndex(); if (s.fns.user_in_coloring_algorithm == 0) { s.fns.incoloring_formula = field_formula.getText(); } else { s.fns.user_incoloring_conditions[0] = field_condition.getText(); s.fns.user_incoloring_conditions[1] = field_condition2.getText(); s.fns.user_incoloring_condition_formula[0] = field_formula_cond1.getText(); s.fns.user_incoloring_condition_formula[1] = field_formula_cond2.getText(); s.fns.user_incoloring_condition_formula[2] = field_formula_cond3.getText(); } ptra.setUserInColoringModePost(); } catch (ParserException ex) { JOptionPane.showMessageDialog(ptra, ex.getMessage(), "Error!", JOptionPane.ERROR_MESSAGE); return; } dispose(); ptra.setInColoringModePost(); } } }); //Make this dialog display it. setContentPane(optionPane); pack(); setResizable(false); setLocation((int) (ptra.getLocation().getX() + ptra.getSize().getWidth() / 2) - (getWidth() / 2), (int) (ptra.getLocation().getY() + ptra.getSize().getHeight() / 2) - (getHeight() / 2)); setVisible(true); } private ImageIcon getIcon(String path) { return new ImageIcon(getClass().getResource(path)); } }
1047d17ab9f122576f31e6f2fe50f19720f262c6
59a413406f10f302f9334a2c022eefa78a40f929
/src/test/java/org/example/sorter/impl/SimpleHandValueDeciderTest.java
d44cf957e4e97a6fe5f8b59ada94003ec08abc06
[]
no_license
sejoshua/poker-hand-sorter
007814fd0878f6bd0da2bda2b97ce0c87032b6de
2feb449a873e45575388d8688909d04f1703e1ab
refs/heads/master
2023-07-20T08:49:28.390603
2021-08-28T05:55:42
2021-08-28T05:55:42
399,417,434
0
0
null
null
null
null
UTF-8
Java
false
false
5,085
java
package org.example.sorter.impl; import org.example.model.Card; import org.example.model.Combination; import org.example.model.HandValue; import org.example.util.TestUtil; import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.*; /** * @author Joshua Xing */ class SimpleHandValueDeciderTest { @Test void getHandValueTest() { List<Card> cards1 = TestUtil.from(List.of("AH", "2C", "3H", "4D", "5S")); List<Card> cards2 = TestUtil.from(List.of("AH", "2C", "2D", "KS", "9D")); List<Card> cards3 = TestUtil.from(List.of("AH", "2C", "2D", "KS", "KD")); List<Card> cards4 = TestUtil.from(List.of("AH", "2C", "2D", "2S", "9D")); List<Card> cards5 = TestUtil.from(List.of("5H", "8C", "4D", "7S", "6D")); List<Card> cards6 = TestUtil.from(List.of("AC", "2C", "3C", "KC", "9C")); List<Card> cards7 = TestUtil.from(List.of("AH", "2C", "2D", "AS", "AD")); List<Card> cards8 = TestUtil.from(List.of("2H", "2C", "2D", "KS", "2S")); List<Card> cards9 = TestUtil.from(List.of("QD", "JD", "9D", "KD", "TD")); List<Card> cards10 = TestUtil.from(List.of("AH", "KH", "TH", "QH", "JH")); SimpleHandValueDecider decider = new SimpleHandValueDecider(); assertHandValue(Combination.HIGH_CARD, 0, 0, decider.getHandValue(cards1)); assertHandValue(Combination.PAIR, 2, 0, decider.getHandValue(cards2)); assertHandValue(Combination.TWO_PAIRS, 13, 2, decider.getHandValue(cards3)); assertHandValue(Combination.THREE_OF_A_KIND, 2, 0, decider.getHandValue(cards4)); assertHandValue(Combination.STRAIGHT, 0, 0, decider.getHandValue(cards5)); assertHandValue(Combination.FLUSH, 0, 0, decider.getHandValue(cards6)); assertHandValue(Combination.FULL_HOUSE, 14, 0, decider.getHandValue(cards7)); assertHandValue(Combination.FOUR_OF_A_KIND, 2, 0, decider.getHandValue(cards8)); assertHandValue(Combination.STRAIGHT_FLUSH, 0, 0, decider.getHandValue(cards9)); assertHandValue(Combination.ROYAL_FLUSH, 0, 0, decider.getHandValue(cards10)); } @Test void isTheSameSuitTest() { List<Card> cards1 = TestUtil.from(List.of("AH", "2H", "5H", "QH", "8H")); List<Card> cards2 = TestUtil.from(List.of("KS", "4S", "JS", "8S", "6S")); List<Card> cards3 = TestUtil.from(List.of("3C", "7C", "TC", "9C", "JC")); List<Card> cards4 = TestUtil.from(List.of("6D", "QD", "9D", "TD", "KD")); List<Card> cards5 = TestUtil.from(List.of("6D", "QC", "9D", "TD", "QD")); List<Card> cards6 = TestUtil.from(List.of("6H", "QD", "9S", "TD", "QD")); List<Card> cards7 = TestUtil.from(List.of("6C", "QS", "9D", "TH", "QD")); List<Card> cards8 = TestUtil.from(List.of("6C", "QS", "9C", "TH", "QD")); assertTrue(SimpleHandValueDecider.isTheSameSuit(cards1)); assertTrue(SimpleHandValueDecider.isTheSameSuit(cards2)); assertTrue(SimpleHandValueDecider.isTheSameSuit(cards3)); assertTrue(SimpleHandValueDecider.isTheSameSuit(cards4)); assertFalse(SimpleHandValueDecider.isTheSameSuit(cards5)); assertFalse(SimpleHandValueDecider.isTheSameSuit(cards6)); assertFalse(SimpleHandValueDecider.isTheSameSuit(cards7)); assertFalse(SimpleHandValueDecider.isTheSameSuit(cards8)); } @Test void isStraight() { List<Card> cards1 = TestUtil.from(List.of("2H", "3H", "4H", "5H", "6H")); List<Card> cards2 = TestUtil.from(List.of("7S", "8S", "9S", "TS", "JS")); List<Card> cards3 = TestUtil.from(List.of("TC", "JC", "QC", "KC", "AC")); List<Card> cards4 = TestUtil.from(List.of("5D", "6S", "7C", "8D", "9H")); List<Card> cards5 = TestUtil.from(List.of("6D", "QC", "9D", "TD", "QD")); List<Card> cards6 = TestUtil.from(List.of("6H", "7D", "8S", "9D", "5D")); List<Card> cards7 = TestUtil.from(List.of("AC", "2S", "3D", "4H", "5D")); List<Card> cards8 = TestUtil.from(List.of("6D", "QD", "9D", "TD", "QD")); assertTrue(SimpleHandValueDecider.isStraight(cards1)); assertTrue(SimpleHandValueDecider.isStraight(cards2)); assertTrue(SimpleHandValueDecider.isStraight(cards3)); assertTrue(SimpleHandValueDecider.isStraight(cards4)); assertFalse(SimpleHandValueDecider.isStraight(cards5)); assertFalse(SimpleHandValueDecider.isStraight(cards6)); assertFalse(SimpleHandValueDecider.isStraight(cards7)); assertFalse(SimpleHandValueDecider.isStraight(cards8)); } private void assertHandValue(Combination expectedCombination, int expectedPrimaryValue, int expectedSecondaryValue, HandValue actualHandValue) { assertEquals(expectedCombination, actualHandValue.getCombination()); assertEquals(expectedPrimaryValue, actualHandValue.getPrimaryValue()); assertEquals(expectedSecondaryValue, actualHandValue.getSecondaryValue()); } }
1e7139633aeb5a236d3ab5a50160479973d1bf0d
0ac0cdd00046b93d922d5c00afbfab5cd9b80901
/sentinel-adapter/sentinel-quarkus-adapter/sentinel-native-image-quarkus-adapter-runtime/src/main/java/com/alibaba/csp/sentinel/nativeimage/SentinelRecorder.java
8d17e54800500b5e06bee600fcd54d6f58ae65b0
[ "Apache-2.0" ]
permissive
kangyuanjia/Sentinel
af2425b2996450f402138c5d4f25c08a10ed8c3d
d59d2d3071ca679973a957eec78b308eb72bdeb7
refs/heads/master
2022-10-18T03:20:54.176683
2020-06-16T04:01:52
2020-06-16T04:01:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,297
java
/* * Copyright 1999-2020 Alibaba Group Holding Ltd. * * 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 * * https://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.alibaba.csp.sentinel.nativeimage; import com.alibaba.csp.sentinel.command.vo.NodeVo; import com.alibaba.csp.sentinel.slots.block.authority.AuthorityRule; import com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule; import com.alibaba.csp.sentinel.slots.block.flow.FlowRule; import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowRule; import com.alibaba.csp.sentinel.slots.system.SystemRule; import com.alibaba.fastjson.parser.ParserConfig; import com.alibaba.fastjson.serializer.SerializeConfig; import io.quarkus.runtime.annotations.Recorder; /** * @author sea */ @Recorder public class SentinelRecorder { /** * register fastjson serializer deserializer class info */ public void init() { SerializeConfig.getGlobalInstance().getObjectWriter(NodeVo.class); SerializeConfig.getGlobalInstance().getObjectWriter(FlowRule.class); SerializeConfig.getGlobalInstance().getObjectWriter(SystemRule.class); SerializeConfig.getGlobalInstance().getObjectWriter(DegradeRule.class); SerializeConfig.getGlobalInstance().getObjectWriter(AuthorityRule.class); SerializeConfig.getGlobalInstance().getObjectWriter(ParamFlowRule.class); ParserConfig.getGlobalInstance().getDeserializer(NodeVo.class); ParserConfig.getGlobalInstance().getDeserializer(FlowRule.class); ParserConfig.getGlobalInstance().getDeserializer(SystemRule.class); ParserConfig.getGlobalInstance().getDeserializer(DegradeRule.class); ParserConfig.getGlobalInstance().getDeserializer(AuthorityRule.class); ParserConfig.getGlobalInstance().getDeserializer(ParamFlowRule.class); } }
3086068e3b65a514ef4eb99b4069fa3ff4932878
5e33e40c11d8c5674ed226e630b03a0c0f1ef619
/data-structures/src/main/java/ch03/queue/QueueTest.java
0444dbf60de78ae0124d631c1284edfba310ebcf
[]
no_license
whjpyy/dataStructures_algorithms
3668c73e2ec8b54a830340de511340acc49b3081
f5eac5986ecbbf9921a6da2966d8a6724034af2d
refs/heads/master
2020-08-01T10:51:17.538426
2019-11-13T14:36:41
2019-11-13T14:36:41
210,973,961
0
0
null
null
null
null
UTF-8
Java
false
false
1,204
java
package ch03.queue; import ch04.link.LinkedListQueue; import java.util.Random; /** * @author carl.z.chen * @Date 2019/9/26 */ public class QueueTest { private static double testQueue(Queue<Integer> q, int optCount){ long start1 = System.nanoTime(); Random random = new Random(); for (int i = 0; i < optCount; i++) { q.enquque(random.nextInt(Integer.MAX_VALUE)); } for (int i = 0; i < optCount; i++) { q.dequeue(); } long start2 = System.nanoTime(); return (start2 - start1) / 1000000000.0; } public static void main(String[] args) { int optCount = 100000; Queue<Integer> arrayQueue = new ArrayQueue<>(); double time1 = testQueue(arrayQueue, optCount); System.out.println("ArrayQueue time:" + time1); Queue<Integer> loopQueue = new LoopQueue<>(); double time2 = testQueue(loopQueue, optCount); System.out.println("LoopQueue time:" + time2); Queue<Integer> linkedListQueue = new LinkedListQueue<>(); double time3 = testQueue(linkedListQueue, optCount); System.out.println("linkedListQueue time:" + time3); } }
7e6b1304ee960df98d615c119c9fd62ef3461deb
f1fa6f66d1b3939b074fba38d4ef2843c399117b
/Notes/app/src/main/java/com/example/notes/MainActivity.java
39c40f449cb03bf1da590c1cdcd94c81dd74bc1b
[]
no_license
abhi2404/retrofit
2f41d91c63c666bc62076f3deff1fecc9c8e27df
5c83672a4c3b09ff91f6a0c2f0dfa4b894dc11f3
refs/heads/master
2022-12-09T07:13:59.295946
2020-08-29T20:13:41
2020-08-29T20:13:41
291,339,923
0
0
null
null
null
null
UTF-8
Java
false
false
5,735
java
package com.example.notes; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class MainActivity extends AppCompatActivity { ArrayList<notesData>mExampleList; private RecyclerView recyclerView; private NotesAdapter notesAdapter; private RecyclerView.LayoutManager mLayoutManager; FloatingActionButton button; @Override protected void onStart(){ super.onStart(); } @Override protected void onStop(){ super.onStop(); } @Override protected void onDestroy(){ super.onDestroy(); } @Override protected void onPause(){ super.onPause(); } @Override protected void onResume(){ super.onResume(); } @Override protected void onRestart(){ super.onRestart(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); loadData(); buildRecyclerView(); FloatingActionButton save=(FloatingActionButton)findViewById(R.id.Save); save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { savedata(); } private void savedata() { SharedPreferences sharedPreferences = getSharedPreferences("pref", MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); Gson gson = new Gson(); String json = gson.toJson(mExampleList); editor.putString("tasklist", json); editor.apply(); Toast toast = Toast.makeText(getApplicationContext(), "Notes Saved", Toast.LENGTH_SHORT); toast.show(); } }); button=(FloatingActionButton) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { openNewActivity(); } }); } private void buildRecyclerView() { recyclerView = findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); mLayoutManager = new LinearLayoutManager(this); notesAdapter = new NotesAdapter(mExampleList); recyclerView.setAdapter(notesAdapter); recyclerView.setLayoutManager(mLayoutManager); Bundle bundle = getIntent().getExtras(); if (bundle != null) { String edit1 = bundle.getString("title"); String edit2 = bundle.getString("body"); insertItem(edit1, edit2); } ItemTouchHelper helper=new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0,ItemTouchHelper.RIGHT|ItemTouchHelper.LEFT) { @Override public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { return false; } @Override public void onSwiped(@NonNull RecyclerView.ViewHolder target, int i) { Toast toast=Toast.makeText(getApplicationContext(),"Note Deleted",Toast.LENGTH_SHORT); toast.show(); int position=target.getAdapterPosition(); mExampleList.remove(position); notesAdapter.notifyDataSetChanged(); save(); } }); helper.attachToRecyclerView(recyclerView); } private void save() { SharedPreferences sharedPreferences=getSharedPreferences("pref",MODE_PRIVATE); SharedPreferences.Editor editor=sharedPreferences.edit(); Gson gson=new Gson(); String json=gson.toJson(mExampleList); editor.putString("tasklist",json); editor.apply(); } private void insertItem(String edit1, String edit2) { //Intent i=getIntent(); //String edit1=i.getStringExtra("title"); //String edit2=i.getStringExtra("body"); mExampleList.add(new notesData(edit1,edit2)); notesAdapter.notifyItemInserted(mExampleList.size()); } private void loadData() { SharedPreferences sharedPreferences=getSharedPreferences("pref",MODE_PRIVATE); Gson gson=new Gson(); String json= sharedPreferences.getString("tasklist",null); Type type = new TypeToken<ArrayList<notesData>>() {}.getType(); mExampleList=gson.fromJson(json,type); if (mExampleList==null){ mExampleList=new ArrayList<>(); } } public void openNewActivity(){ Intent i; i = new Intent(this,NewActivity.class); startActivity(i); } @Override public void onBackPressed(){ Intent a=new Intent(Intent.ACTION_MAIN); a.addCategory(Intent.CATEGORY_HOME); a.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(a); } }
581ffd26d9516d166abc76cf306261429be4fa8c
546544db188e825f7898dda2bc06bada692ace33
/mraid/src/main/java/com/jumpraw/mraid/internal/MRAIDParser.java
6401dce0f14df39bd952121d435c4369f74c53a1
[]
no_license
KKWinter/ValidationProject
04a73086f2897670f2879b1668a0e2e2871b3176
fc1280b501bc02bb1157d5516d4d7031be43eeda
refs/heads/master
2021-07-21T08:52:13.008847
2020-05-09T10:56:03
2020-05-09T10:56:03
154,787,472
0
0
null
null
null
null
UTF-8
Java
false
false
3,493
java
package com.jumpraw.mraid.internal; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class MRAIDParser { private final static String TAG = "MRAIDParser"; public Map<String, String> parseCommandUrl(String commandUrl) { // The command is a URL string that looks like this: // // mraid://command?param1=val1&param2=val2&... // // We need to parse out the command and create a map containing it and // its the parameters and their associated values. MRAIDLog.d(TAG, "parseCommandUrl " + commandUrl); // Remove mraid:// prefix. String s = commandUrl.substring(8); String command; Map<String, String> params = new HashMap<String, String>(); // Check for parameters, parse them if found int idx = s.indexOf('?'); if (idx != -1) { command = s.substring(0, idx); String paramStr = s.substring(idx + 1); String[] paramArray = paramStr.split("&"); for (String param : paramArray) { idx = param.indexOf('='); String key = param.substring(0, idx); String val = param.substring(idx + 1); params.put(key, val); } } else { command = s; } // Check for valid command. if (!isValidCommand(command)) { MRAIDLog.w("command " + command + " is unknown"); return null; } // Check for valid parameters for the given command. if (!checkParamsForCommand(command, params)) { MRAIDLog.w("command URL " + commandUrl + " is missing parameters"); return null; } Map<String, String> commandMap = new HashMap<String, String>(); commandMap.put("command", command); commandMap.putAll(params); return commandMap; } private boolean isValidCommand(String command) { final String[] commands = { "close", "createCalendarEvent", "expand", "open", "playVideo", "resize", "setOrientationProperties", "setResizeProperties", "storePicture", "useCustomClose" }; return (Arrays.asList(commands).contains(command)); } private boolean checkParamsForCommand(String command, Map<String, String> params) { if (command.equals("createCalendarEvent")) { return params.containsKey("eventJSON"); } else if (command.equals("open") || command.equals("playVideo") || command.equals("storePicture")) { return params.containsKey("url"); } else if (command.equals("setOrientationProperties")) { return params.containsKey("allowOrientationChange") && params.containsKey("forceOrientation"); } else if (command.equals("setResizeProperties")) { return params.containsKey("width") && params.containsKey("height") && params.containsKey("offsetX") && params.containsKey("offsetY") && params.containsKey("customClosePosition") && params.containsKey("allowOffscreen"); } else if (command.equals("useCustomClose")) { return params.containsKey("useCustomClose"); } return true; } }
1e982137c4e892c710c6472051becc968edce010
6463c62969279cda766139499c02e071d07143dc
/src/main/java/ph/parcs/rmhometiles/config/SQLiteDialect.java
b1fed4574164ff3ac1fce4ab39039eb5870e26c8
[]
no_license
ianparcs/inventory-sales-system
cf2796a47fd6dfa614aff272c0f6c7afebce0790
b07d23f235138c47aa7c3e0e813fa043fa88a59a
refs/heads/master
2023-01-22T19:41:18.864264
2023-01-13T10:07:47
2023-01-13T10:07:47
238,365,749
0
0
null
null
null
null
UTF-8
Java
false
false
4,535
java
package ph.parcs.rmhometiles.config; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.function.SQLFunctionTemplate; import org.hibernate.dialect.function.StandardSQLFunction; import org.hibernate.dialect.function.VarArgsSQLFunction; import org.hibernate.type.StringType; import java.sql.Types; public class SQLiteDialect extends Dialect { public SQLiteDialect() { registerColumnType(Types.BIT, "integer"); registerColumnType(Types.TINYINT, "tinyint"); registerColumnType(Types.SMALLINT, "smallint"); registerColumnType(Types.INTEGER, "integer"); registerColumnType(Types.BIGINT, "bigint"); registerColumnType(Types.FLOAT, "float"); registerColumnType(Types.REAL, "real"); registerColumnType(Types.DOUBLE, "double"); registerColumnType(Types.NUMERIC, "numeric"); registerColumnType(Types.DECIMAL, "decimal"); registerColumnType(Types.CHAR, "char"); registerColumnType(Types.VARCHAR, "varchar"); registerColumnType(Types.LONGVARCHAR, "longvarchar"); registerColumnType(Types.DATE, "date"); registerColumnType(Types.TIME, "time"); registerColumnType(Types.TIMESTAMP, "timestamp"); registerColumnType(Types.BINARY, "blob"); registerColumnType(Types.VARBINARY, "blob"); registerColumnType(Types.LONGVARBINARY, "blob"); // registerColumnType(Types.NULL, "null"); registerColumnType(Types.BLOB, "blob"); registerColumnType(Types.CLOB, "clob"); registerColumnType(Types.BOOLEAN, "integer"); registerFunction("concat", new VarArgsSQLFunction(StringType.INSTANCE, "", "||", "")); registerFunction("mod", new SQLFunctionTemplate(StringType.INSTANCE, "?1 % ?2")); registerFunction("substr", new StandardSQLFunction("substr", StringType.INSTANCE)); registerFunction("substring", new StandardSQLFunction("substr", StringType.INSTANCE)); } public boolean supportsIdentityColumns() { return true; } public boolean hasDataTypeInIdentityColumn() { return false; // As specify in NHibernate dialect } public String getIdentityColumnString() { // return "integer primary key autoincrement"; return "integer"; } public String getIdentitySelectString() { return "select last_insert_rowid()"; } public boolean supportsLimit() { return true; } protected String getLimitString(String query, boolean hasOffset) { return new StringBuffer(query.length() + 20).append(query).append(hasOffset ? " limit ? offset ?" : " limit ?") .toString(); } public boolean supportsTemporaryTables() { return true; } public String getCreateTemporaryTableString() { return "create temporary table if not exists"; } public boolean dropTemporaryTableAfterUse() { return false; } public boolean supportsCurrentTimestampSelection() { return true; } public boolean isCurrentTimestampSelectStringCallable() { return false; } public String getCurrentTimestampSelectString() { return "select current_timestamp"; } public boolean supportsUnionAll() { return true; } public boolean hasAlterTable() { return false; // As specify in NHibernate dialect } public boolean dropConstraints() { return false; } public String getAddColumnString() { return "add column"; } public String getForUpdateString() { return ""; } public boolean supportsOuterJoinForUpdate() { return false; } public String getDropForeignKeyString() { throw new UnsupportedOperationException("No drop foreign key syntax supported by SQLiteDialect"); } public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey) { throw new UnsupportedOperationException("No add foreign key syntax supported by SQLiteDialect"); } public String getAddPrimaryKeyConstraintString(String constraintName) { throw new UnsupportedOperationException("No add primary key syntax supported by SQLiteDialect"); } public boolean supportsIfExistsBeforeTableName() { return true; } public boolean supportsCascadeDelete() { return false; } }
1c3ca8ee95277d5537d6b0f9058b559b8f3b5bcd
7dae80b8f75cb3618f22fc66b38064c22a2f91f0
/src/main/java/za/co/ajk/notification/ApplicationWebXml.java
be8c553e4e4d196f3f0c71b5315229edaf8e90fa
[]
no_license
kappaj2/IM-NotificationModule
44a2297aee90e683816ee2d7057942f3601c6b45
c0070c479f66c523681cf1b4acbc6502b679cb84
refs/heads/master
2021-04-30T13:22:33.683015
2018-03-26T17:54:31
2018-03-26T17:54:31
118,444,933
0
0
null
2018-01-28T19:54:27
2018-01-22T10:54:39
Java
UTF-8
Java
false
false
838
java
package za.co.ajk.notification; import za.co.ajk.notification.config.DefaultProfileUtil; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; /** * This is a helper Java class that provides an alternative to creating a web.xml. * This will be invoked only when the application is deployed to a servlet container like Tomcat, JBoss etc. */ public class ApplicationWebXml extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { /** * set a default to use when no profile is configured. */ DefaultProfileUtil.addDefaultProfile(application.application()); return application.sources(NotificationModuleApp.class); } }
aecd88025baf6f1d1f6dd2f7775fbdfec48a6665
df99b60c4b2097ac6dcebcafbd374c0de5fc6629
/src/test/java/com/primary/example/collection/list/ArraysTest.java
f7509449dc4cb9257d46704e40799d910ddd098c
[]
no_license
a601942905git/java-primary-example
8180a3539d60dec1f1b027b11801216d0c6b7898
75a3cccecd60734eb6c1b8e85e9b02417b20dea1
refs/heads/master
2022-12-25T14:19:01.486376
2022-11-30T09:56:51
2022-11-30T09:56:51
168,785,855
0
0
null
2019-11-02T20:07:13
2019-02-02T02:30:45
Java
UTF-8
Java
false
false
1,319
java
package com.primary.example.collection.list; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * com.primary.example.collection.list.ArraysTest * * @author lipeng * @date 2019-08-16 11:06 */ public class ArraysTest { @Test public void test() { List<Integer> numbers = Arrays.asList(1, 6, 8, 2, 7, 9); // 报java.lang.UnsupportedOperationException异常 // 抛异常的原因是Arrays.asList返回的ArrayList是Arrays内部定义的ArrayList,并非java.util.ArrayList // Arrays内部的ArrayList的add方法直接调用父类AbstractList.add(int, E),该方法直接抛出UnsupportedOperationException异常 numbers.add(3); } @Test public void test1() { // 解决方案一 List<Integer> numbers = new ArrayList<>(Arrays.asList(1, 6, 8, 2, 7, 9)); numbers.add(666); numbers.stream().forEach(System.out::println); } @Test public void test2() { // 解决方案二 Integer[] numbers = new Integer[]{1, 6, 8, 2, 7, 9}; List<Integer> list = new ArrayList<>(numbers.length); Collections.addAll(list, numbers); list.add(888); list.stream().forEach(System.out::println); } }
fb1617d00d1dbb4c9a94795811c7e7776cf4be07
fd34bc57a54757fd6c29980347eb0a22213f5430
/protons/android/src/it/mate/protons/plugin/NativePropertiesPlugin.java
22a8a413206671b065a01ce931d7b8301126b95d
[]
no_license
urazovm/marcelatelab
7b64c1c3f6bad786590964e5115d811787bc91a2
b9e264ecb4fe99b8966a8e4babc588b4aec4725f
refs/heads/master
2021-06-01T06:25:35.860311
2016-04-29T12:22:07
2016-04-29T12:22:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,051
java
package it.mate.protons.plugin; import it.mate.protons.R; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.content.res.Resources; public class NativePropertiesPlugin extends CordovaPlugin { private final static String ACTION_GET_PROPERTIES = "getProperties"; private final static String ACTION_GET_PROPERTIES_AS_STRING = "getPropertiesAsString"; @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { if (ACTION_GET_PROPERTIES.equals(action)) { getProperties(callbackContext); return true; } else if (ACTION_GET_PROPERTIES_AS_STRING.equals(action)) { getPropertiesAsString(callbackContext); return true; } return false; } private synchronized void getProperties(CallbackContext callbackContext) { Resources res = cordova.getActivity().getResources(); try { JSONArray results = new JSONArray(); JSONObject entry = new JSONObject(); entry.put("name", "helloWorld"); entry.put("value", "helloWorld"); results.put(entry); callbackContext.success(results); } catch (JSONException e) { callbackContext.error(e.getMessage()); } } private synchronized void getPropertiesAsString(CallbackContext callbackContext) { Resources res = cordova.getActivity().getResources(); try { String results = ""; results += "appName=" + res.getString(R.string.app_name); /* results += "|helloWorld=" + res.getString(R.string.hello_world); results += "|cupFacadeModuleUrl=" + res.getString(R.string.cupFacadeModuleUrl); results += "|cupFacadeRelativeUrl=" + res.getString(R.string.cupFacadeRelativeUrl); */ callbackContext.success(results); } catch (Exception e) { callbackContext.error(e.getMessage()); } } }
ebf8a7b32d0ef06013f4d3a2a3beca2979d3bdc4
884bffd3a232b16bbf75faab89a96cac5468b0ca
/app/src/main/java/com/jakeesveld/pokedex/models/MoveLearnMethod.java
88804d3f0f5d1687d215197931ae9775da7b37c2
[ "MIT" ]
permissive
JakeEsveldDevelopment/PokeDex
da5453d6b2eaf3759ec2a792ff9176a558f4256f
cb23ef4a9cd3d41648b580d07c0c0df20a93cd4b
refs/heads/master
2020-11-24T16:13:11.130089
2019-12-19T20:14:02
2019-12-19T20:14:02
228,237,483
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package com.jakeesveld.pokedex.models; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class MoveLearnMethod { @SerializedName("name") @Expose private String name; @SerializedName("url") @Expose private String url; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
fcf42912cdbdbf81ba2009d406bc112631ef2c0f
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/26/org/jfree/data/time/ohlc/OHLCSeriesCollection_getLowValue_298.java
5bc756330ea329b08470ccf2e5019dc416a57ac3
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
720
java
org jfree data time ohlc collect link ohlc seri ohlcseri object ohlc seri ohlcseri ohlc seri collect ohlcseriescollect abstract dataset abstractxydataset return low item seri param seri seri index param item item index low low getlowvalu seri item ohlc seri ohlcseri ohlc seri ohlcseri data seri ohlc item ohlcitem ohlc item ohlcitem data item getdataitem item low getlowvalu
ba890796545cdce604517acd35039e2ed0001b29
880807e61e4009c9e94a478e44af7a5eee373abf
/bloomz-ui-automation/src/test/java/com/net/bloomz/pages/web/WebCalendarSettingsImportCalendarPage.java
e448efbfce96a630c2a8d0d6d57d2eb2e249b631
[]
no_license
umadeviksp/test-automation-dev
71d371ed6526fd7b3926c919c5d027b0dccba862
db02206f2e92ac5cd25f234b0c63896ab6e96f36
refs/heads/master
2021-08-31T19:41:33.115234
2017-12-22T15:43:07
2017-12-22T15:43:07
109,996,686
0
0
null
null
null
null
UTF-8
Java
false
false
534
java
package com.net.bloomz.pages.web; import com.net.bloomz.appium.pagefactory.framework.browser.Browser; import com.net.bloomz.pages.CalendarSettingsImportCalendarPage; import com.net.bloomz.pages.interfaces.CalendarSettingsImportCalendarPageActions; public class WebCalendarSettingsImportCalendarPage extends CalendarSettingsImportCalendarPage implements CalendarSettingsImportCalendarPageActions { public WebCalendarSettingsImportCalendarPage(Browser<?> browser) { super(browser); // TODO Auto-generated constructor stub } }
b79a2d84f191192f4acb3779f54bd95000c5d8f1
d149c8e99189b9b6d3abf9f806fe7d4d60d3af3e
/QcConnection/src/main/java/com/cognizant/cognizantits/qcconnection/qcupdation/IAuditable.java
282b87f03f3c6bc9d973c5583a5413659f924625
[ "Apache-2.0" ]
permissive
CognizantQAHub/Cognizant-Intelligent-Test-Scripter
f7e3733b0b76e5e006e40164172b197103e8996c
828506dbc5bc1e6ff78bfe75e6871b29c6a9ad33
refs/heads/master
2023-04-30T11:26:49.347645
2023-04-20T06:44:15
2023-04-20T06:44:15
91,552,889
98
102
Apache-2.0
2021-11-09T06:56:10
2017-05-17T08:34:28
Java
UTF-8
Java
false
false
671
java
package com.cognizant.cognizantits.qcconnection.qcupdation; import com4j.Com4jObject; import com4j.DISPID; import com4j.IID; import com4j.NativeType; import com4j.ReturnValue; import com4j.VTID; @IID("{3DE03C28-EC6B-4953-96C2-E3216051C907}") public abstract interface IAuditable extends Com4jObject { @DISPID(1) @VTID(7) @ReturnValue(type=NativeType.Dispatch) public abstract Com4jObject auditRecordFactory(); @DISPID(2) @VTID(8) @ReturnValue(type=NativeType.Dispatch) public abstract Com4jObject auditPropertyFactory(); } /* Location: D:\Prabu\jars\QC.jar * Qualified Name: qcupdation.IAuditable * JD-Core Version: 0.7.0.1 */
fcd3dc1b4fabf8ce1b9c20bbb43457b535c76f57
08ddfa8153c7d34dee42861aa190f318a73de0c6
/src/main/java/ua/nure/kn/voroniuk/db/DaoFactoryImpl.java
949d5b505c8cb7932c0421439614f12f3174e797
[]
no_license
NUREKN17-JAVA/krystyna.voroniuk
896fb320014e31c45b22b71fb0a40f8aba20758c
c80ba29b82352ef7b6c3e4e253ad8fa75517a594
refs/heads/master
2020-09-08T18:01:11.938538
2019-12-27T22:01:35
2019-12-27T22:01:35
212,541,790
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package ua.nure.kn.voroniuk.db; public class DaoFactoryImpl extends DaoFactory { @Override public Dao getUserDao() throws ReflectiveOperationException { Dao result = null; try { Class hsqldbUserDaoClass = Class.forName(properties.getProperty(USER_DAO)); result = (Dao) hsqldbUserDaoClass.newInstance(); result.setConnectionFactory(createConnection()); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new ReflectiveOperationException(e); } return result; } }
92cb6bb2e80a719f65a286fb06d84c363659194d
8f5ebda11490161399fb03fe3190b47cf52f9a22
/app/main/java/com/example/placealarm/TermsAndConditions.java
7f3e2ede1edb63ea8633687e44f4818c3ecc9721
[]
no_license
YagnikBavishi/PlaceAlarm
9539d7e28c910a792c3235058e24792149311f57
0f4e87646fac67eb37a09a89558e0d1b2de7a815
refs/heads/master
2023-01-13T16:10:36.267874
2020-11-19T13:34:47
2020-11-19T13:34:47
299,258,370
1
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.example.placealarm; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class TermsAndConditions extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_terms_and_conditions); } }
1b55efa555b631b1fc77de7acba50166bc6a736b
29e0d37ff00a0272e043aaee5d8f37ede4e1b692
/fxpt/fxpt.main/src/main/java/com/cntest/fxpt/repository/impl/ITemDaoImpl.java
c1f8efde6d8ee2f4e70fc9b2e4b15d9c1db66b56
[]
no_license
SelfImpr001/seaskyland
2704a1c178604a7b2d1d4b4c637ccb64748aaa51
8ab1f011807363d95baf523523b7349a815970f2
refs/heads/master
2020-03-11T13:08:47.339552
2018-07-31T06:40:10
2018-07-31T06:40:10
130,016,742
0
0
null
null
null
null
UTF-8
Java
false
false
5,901
java
/* * @(#)com.cntest.fxpt.repository.impl.ITemDaoImpl.java 1.0 2014年5月22日:下午4:18:28 * * Copyright 2014 seasky land, Inc. All rights reserved. */ package com.cntest.fxpt.repository.impl; import java.util.ArrayList; import java.util.List; import org.hibernate.Query; import org.hibernate.SQLQuery; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Repository; import com.cntest.common.repository.AbstractHibernateDao; import com.cntest.fxpt.bean.UploadFileContentInfo; import com.cntest.fxpt.domain.AnalysisTestpaper; import com.cntest.fxpt.domain.Item; import com.cntest.fxpt.domain.ItemMessage; import com.cntest.fxpt.repository.IITemDao; /** * <Pre> * </Pre> * * @author 刘海林 2014年5月22日 下午4:18:28 * @version 1.0 */ @Repository("IITemDao") public class ITemDaoImpl extends AbstractHibernateDao<Item, Long> implements IITemDao { private static final Logger log = LoggerFactory .getLogger(ITemDaoImpl.class); /* * (non-Javadoc) * * @see com.cntest.fxpt.repository.IITemDao#deleteByTestPaperId(int) */ @Override public int deleteItem(Long testPaperId) { String hql = "delete from Item where testPaper.id=?"; Query query = getSession().createQuery(hql); query.setLong(0, testPaperId); return query.executeUpdate(); } /* * (non-Javadoc) * * @see com.cntest.fxpt.repository.IITemDao#listByTestPaperId(int) */ @Override public List<Item> list(Long testPaperId) { log.debug("执行获取小题信息的dao"); String hql = "from Item as i left join fetch i.subject left join fetch i.testPaper as tp where tp.id=? order by sortNum"; List<Item> items = findByHql(hql, testPaperId); log.debug("执行完毕获取小题信息的dao"); return items; } @Override protected Class<Item> getEntityClass() { return Item.class; } @Override public int updateItemAnaysisTestPaperId(AnalysisTestpaper analysisTestpaper) { String hql = "update Item set analysisTestpaper.id=? where testPaper.id=? AND subject.id=?"; Query query = getSession().createQuery(hql); query.setLong(0, analysisTestpaper.getId()); query.setLong(1, analysisTestpaper.getTestPaper().getId()); query.setLong(2, analysisTestpaper.getSubject().getId()); return query.executeUpdate(); } @Override public List<Item> listByAnlaysisTestPaperId(Long AnlaysisTestPaperId) { String hql = "from Item where analysisTestpaper.id=?"; return findByHql(hql, AnlaysisTestPaperId); } @Override public String findPaperByItemId(Long itemId,Long examid,String studentid){ String sql = "SELECT paper FROM dw_dim_item ddi WHERE ddi.id=?"; SQLQuery sqlQuery = getSession().createSQLQuery(sql); sqlQuery.setParameter(0, itemId); Object obj = sqlQuery.uniqueResult(); if(obj==null){ return ""; } return obj.toString(); } @Override public String findOptionTypeByItemId(Long itemId,Long examid,String studentid){ String sql = "SELECT optionType FROM dw_dim_item ddi WHERE ddi.id=?"; SQLQuery sqlQuery = getSession().createSQLQuery(sql); sqlQuery.setParameter(0, itemId); Object obj = sqlQuery.uniqueResult(); if(obj==null){ return ""; } return obj.toString(); } @Override public String findPaperTotalScoreByItemId(Long examid, String studentid, Long testpaperid,String paper) { String sql = "SELECT SUM(score) FROM dw_itemcj_fact WHERE examid=? AND studentid=? AND testpaperid=? AND paper=?"; SQLQuery sqlQuery = getSession().createSQLQuery(sql); sqlQuery.setParameter(0, examid); sqlQuery.setParameter(1, studentid); sqlQuery.setParameter(2, testpaperid); sqlQuery.setParameter(3, paper); Object obj = sqlQuery.uniqueResult(); if(obj==null){ return ""; } return obj.toString(); } @Override public String findRespectiveScoreByItemId(Long testpaperid,Long examid,String optiontype,String studentid,String paper){ String sql = ""; if("".equals(paper)){ sql = " SELECT SUM(score) FROM dw_itemcj_fact dif " + "INNER JOIN dw_dim_item ddi ON dif.itemid = ddi.id " + "WHERE dif.examid = ? AND ddi.optiontype IN (?) AND dif.testpaperid=? AND dif.studentid=?"; }else{ sql = " SELECT SUM(score) FROM dw_itemcj_fact dif " + "INNER JOIN dw_dim_item ddi ON dif.itemid = ddi.id " + "WHERE dif.examid = ? AND ddi.optiontype IN (?) AND dif.testpaperid=? AND dif.studentid=? AND dif.paper=?"; } SQLQuery sqlQuery = getSession().createSQLQuery(sql); sqlQuery.setParameter(0, examid); sqlQuery.setParameter(1, optiontype); sqlQuery.setParameter(2, testpaperid); sqlQuery.setParameter(3, studentid); if(!"".equals(paper)){ sqlQuery.setParameter(4, paper); } Object obj = sqlQuery.uniqueResult(); if(obj==null){ return ""; } return obj.toString(); } @Override public List<Item> findAllQk(Long examId,Long testPaperId) { //查询所有的选做题 String hql ="From Item where ischoice=1 and examId=? and testPaperId=?"; List<Item> itemList = findByHql(hql,examId,testPaperId); return itemList; } public boolean isContainABpaper(Long examId,Long testPaperId){ String sql = "SELECT GROUP_CONCAT(DISTINCT( paper)) FROM dw_dim_item ddi WHERE ddi.testpaperid=? AND ddi.examid = ?"; SQLQuery sqlQuery = getSession().createSQLQuery(sql); sqlQuery.setParameter(0, testPaperId); sqlQuery.setParameter(1, examId); Object obj = sqlQuery.uniqueResult(); if(obj!=null){ if(obj.toString().equals("A,B")){ return true; }else{ return false; } }else{ return false; } } @Override public boolean validate(String subjectName, String examId) { boolean flag=false; String sql = "SELECT it.* FROM dw_dim_item it LEFT JOIN kn_subject su ON su.id=it.subjectid " + "WHERE it.examid="+examId+" AND su.name='"+subjectName+"'"; SQLQuery sqlQuery = getSession().createSQLQuery(sql); flag=sqlQuery.list().size()>0?true:false; return flag; } }
70227dd229865a95c39bbf416f4d639970a8d015
5818a8adebe57cca76af3e0e25ecfde1f62edcd9
/src/my/framework/FormPostBody.java
5ae41417dcc1362c3fd584efbdb384ea71729a15
[]
no_license
chancedream/FirePig
101c29248f2154dbaafe39864ebd34ed3c9f8e22
5546f9d35b6dad3ef0a24f01488956e50483caa6
refs/heads/master
2021-01-22T18:14:21.678265
2012-01-09T01:55:08
2012-01-09T01:55:08
2,952,997
0
0
null
null
null
null
UTF-8
Java
false
false
5,696
java
package my.framework; import java.io.File; import java.io.FileNotFoundException; import java.io.UnsupportedEncodingException; import java.net.URI; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.http.HttpHeaders; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.utils.URIUtils; import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.ContentBody; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.message.BasicNameValuePair; import org.apache.log4j.Logger; public class FormPostBody implements PostBody { private class Part { public String key, value; public int type; public Part(int type, String key, String value) { this.type = type; this.key = key; this.value = value; } public String getKey() { return key; } public Object getObject() throws UnsupportedEncodingException { switch (type) { case STRING_PART: return new StringBody(value, Charset.forName(charset)); case FILE_PART: { String contentType = "text/plain"; if (value == null) { return null; } value = value.toLowerCase(); if (value.endsWith("jpg") || value.endsWith("jpeg")) { contentType = "image/jpeg"; } else if (value.endsWith("gif")) { contentType = "image/gif"; } else if (value.endsWith("txt")) { contentType = "text/plain"; } return new FileBody(new File(value), contentType, charset); } case NAME_VALUE_PAIR: return new BasicNameValuePair(key, value); } return null; } } private static final int FILE_PART = 1; private static final Logger logger = Logger.getLogger(FormPostBody.class); private static final int NAME_VALUE_PAIR = 2; private static final String BOUNDARY = "---------------------------16336183371278"; private static final int STRING_PART = 0; private String charset = "ISO-8859-1"; private Map<String, Object> context; private boolean multipart = false; private String referer; private List<Part> parts = new ArrayList<Part>(); public void addFile(String name, String filename) throws FileNotFoundException { assert multipart; parts.add(new Part(FILE_PART, name, filename)); } public void addParam(String name, String value) { if (value == null) return; if (multipart) { parts.add(new Part(STRING_PART, name, value)); } else { try { name = new String(name.getBytes(charset), "ISO-8859-1"); value = new String(value.getBytes(charset), "ISO-8859-1"); } catch (UnsupportedEncodingException e) {} parts.add(new Part(NAME_VALUE_PAIR, name, value)); } } public HttpGet createGetMethod() { assert !multipart; HttpGet method = new HttpGet(); List<NameValuePair> params = new ArrayList<NameValuePair>(); URI uri; try { for (int i = 0; i < parts.size(); i++) { Part part = parts.get(i); params.add((BasicNameValuePair)part.getObject()); } uri = URIUtils.createURI("http", "", -1, "", URLEncodedUtils.format(params, "UTF-8"), null); method.setURI(uri); parts.clear(); } catch (Exception e) { e.printStackTrace(); } return method; } public HttpPost createPostMethod() { HttpPost method = null; try { method = _createPostMethod(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } parts.clear(); return method; } // public String getContent() { // updateParts(); // HttpPost method = _createPostMethod(); // ByteArrayOutputStream out = new ByteArrayOutputStream(); // try { // method.getRequestEntity().writeRequest(out); // out.close(); // return out.toString(charset); // } catch (IOException e) { // logger.error("", e); // return null; // } // } // public void setCharset(String charset) { this.charset = charset; } public void setContext(Map<String, Object> context) { this.context = context; } public void setMultipart(boolean multipart) { this.multipart = multipart; } public void setReferer(String referer) { this.referer = referer; } private HttpPost _createPostMethod() throws UnsupportedEncodingException { HttpPost method = new HttpPost(); if (multipart) { MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE, BOUNDARY, null); for (int i = 0; i < parts.size(); i++) { Part part = parts.get(i); if (part != null) { entity.addPart(part.getKey(), (ContentBody)part.getObject()); } } method.setEntity(entity); } else { List<NameValuePair> params = new ArrayList<NameValuePair>(); for (Iterator<Part> it = parts.iterator(); it.hasNext(); ) { Part part = it.next(); NameValuePair param = (NameValuePair)part.getObject(); params.add(param); } method.setEntity(new UrlEncodedFormEntity(params, charset)); } if (referer != null) method.setHeader(HttpHeaders.REFERER, referer); return method; } private String valueOf(Object object) { return object == null ? null : object.toString(); } }
232c85e276b544a24699884581c892d5d8f055f4
07544e192195bcd84b69ae288dbad02f29af539c
/src/main/java/seriallze/examplesubpub/SubReqClient.java
294710869b7d77be6bb1a8cf91071f628b0d9639
[]
no_license
lantian0802/study_netty
cf24bc29af71da6a35a8620bd06005411644c811
32b28be8f190cc80262134044c8a980749d63ff3
refs/heads/master
2020-07-02T03:08:57.318094
2015-08-27T15:51:17
2015-08-27T15:51:17
29,864,290
0
0
null
null
null
null
UTF-8
Java
false
false
2,000
java
package seriallze.examplesubpub; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.serialization.ClassResolvers; import io.netty.handler.codec.serialization.ObjectDecoder; import io.netty.handler.codec.serialization.ObjectEncoder; /** * Created by jianying.wcj on 2015/2/5 0005. */ public class SubReqClient { public void connect(int port,String host) throws Exception { EventLoopGroup group = new NioEventLoopGroup(); try { Bootstrap b = new Bootstrap(); b.group(group).channel(NioSocketChannel.class) .option(ChannelOption.TCP_NODELAY,true) .handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new ObjectDecoder(1024, ClassResolvers.cacheDisabled(this.getClass().getClassLoader()))); ch.pipeline().addLast(new ObjectEncoder()); ch.pipeline().addLast(new SubReqClientHandler()); } }); ChannelFuture f = b.connect(host,port).sync(); } finally { group.shutdownGracefully(); } } public static void main(String[] args) throws Exception { int port = 8080; if(args != null && args.length > 0) { try { port = Integer.valueOf(args[0]); } catch(NumberFormatException e) { //ignore } } new SubReqClient().connect(port,"127.0.0.1"); } }
89dd2e4415e57dce1ef32e58cafca5c57d0029fa
d46a4f484c4ded71471f49364d09867f3ae5ee78
/app/src/main/java/ValidatoriFireBase/validatorPacientFireBase.java
fb867f531b6b65a7ea526fcd30214040f05b1884
[]
no_license
radufx/UniHack2020-HealthNow
d78ab0cfb04e454eddc3e0a7e85e1f4279120f28
b67d875c95d6cbfefeab4450ce80675aeec6ff41
refs/heads/master
2023-01-21T05:50:35.585566
2020-11-22T11:26:29
2020-11-22T11:26:29
315,015,099
0
0
null
null
null
null
UTF-8
Java
false
false
1,865
java
package ValidatoriFireBase; import java.util.Date; public class validatorPacientFireBase { public void validate (String nume, String prenume, String adresa, String cnp){ String errors = ""; errors += valid_numee(nume); errors += valid_prenumee(prenume); errors += valid_adresaa(adresa); errors += valid_cnpp(cnp); } public String valid_numee(String Nume) { String s = ""; if(Nume == "" || Nume.matches("[a-zA-Z\\s,.]+") == false) s = "Nume invalid!\n"; return s; } public String valid_prenumee(String Prenume) { String s = ""; if(Prenume == "" || Prenume.matches("[a-zA-Z\\s,.]+") == false) s = "Prenume invalid!\n"; return s; } public String valid_adresaa(String Adresa) { String s = ""; if(Adresa == "" || Adresa.matches("[a-zA-Z0-9\\s,.]+") == false) s = "Adresa invalida!\n"; return s; } public String valid_cnpp(String Cnp) { String s = ""; if (Cnp.length() != 13) s = "Cnp invalid!\n"; else { if (Cnp.matches("[0-9]+") == false) s = "Cnp invalid!\n"; else { if (Cnp.charAt(0) <= '0' && Cnp.charAt(0) > '6') s = "Cnp invalid!\n"; else { int sum = 0, cc; int[] a = {2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9}; for (int i = 0; i < 13; ++i) sum += (Cnp.charAt(i) - '0') * a[i]; if (sum % 11 <= 10) cc = sum % 11; else cc = 1; if (cc + '0' != Cnp.charAt(12)) s = "Cnp invalid!\n"; } } } return s; } }
acbc265bed1de1c3fd8262927614832359f8bc89
1cca09e87d081c43664d7596c2b4fd863a5d8d04
/java+DSA/getting_started/allprimestilln.java
6c905fc955814c0560c139a3c34f1a8a29e519e5
[]
no_license
hardik1125/DSA_JAVA
631cd38ead3c3ec0a179276ff6048388d29f4f75
6b0bdc89189e774b5d8798dde650e95f6deada87
refs/heads/master
2023-04-14T11:45:28.901083
2021-04-20T21:11:31
2021-04-20T21:11:31
357,888,329
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int low = scn.nextInt(); int high = scn.nextInt(); for (int i = low; i <= high; i++) { int count = 0; for (int div = 2; div * div <= i; div++) { if (i % div == 0) { count++; break; } } if (count == 0) { System.out.println(i); } } } }
20cfa37a292524904ad2c5ca997d42c0c20d53c5
3ccb61c2a3a1f02db5bc1c2673ee23379cef407b
/HM/src/com/vn/hm/fragment/BmiHistoryFragment.java
70c011f98ec775e07df42fc77eac644fda02195f
[]
no_license
dodanhhieu/F6
961e187615f430ea46e87c93112e92c31a22100c
7017061febf67b31bada9cd269a114d94399aac2
refs/heads/master
2016-08-04T21:13:33.508705
2015-06-13T08:19:44
2015-06-13T08:19:44
33,989,469
0
0
null
null
null
null
UTF-8
Java
false
false
4,064
java
package com.vn.hm.fragment; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import com.activeandroid.query.Select; import com.d3.base.BaseFragment; import com.d3.base.D3Utils; import com.d3.base.db.BmiTable; import com.vn.hm.MainActivity; import com.vn.hm.R; public class BmiHistoryFragment extends BaseFragment { private String TAG = "BmiHistoryFragment"; private TextView txtRecommend; private ListView listview; private String msgRecommend; private ArrayList<BmiTable> listData; private float bmiMin,bmiMax; @Override public int getlayout() { return R.layout.bmi_history_layout; } @Override public void initView(View view) { MainActivity.updateTitleHeader(D3Utils.SCREEN.BMI); txtRecommend = (TextView)view.findViewById(R.id.txt_msg_id); listview = (ListView)view.findViewById(R.id.history_id); // get all data in db Select select = new Select(); listData = select.all().from(BmiTable.class).execute(); Collections.reverse(listData); Log.i(TAG, "Size data = " + listData.size()); if (listData.size() > 0) { BmiHistoryAdapter adapter = new BmiHistoryAdapter(getActivity(), listData); listview.setAdapter(adapter); msgRecommend = getRecommendMsg(); txtRecommend.setText(msgRecommend); } } private String getRecommendMsg(){ bmiMin = 20.0f; bmiMax = 25.0f; int count = listData.size(); float bmi1 = listData.get(1).bmiIndex; float bmi2 = listData.get(0).bmiIndex; for (int i = 0; i < count; i++) { Log.i(TAG, "BMI i = " + i+" :" + listData.get(i).bmiIndex); } Log.i(TAG, "BMI 1 = "+(count-2) +" :" + bmi1); Log.i(TAG, "BMI 2 = " +(count-1) +" :"+ bmi2); if (bmi1 > bmiMax && bmi2 > bmiMax) { // user need to lose weight if (bmi2 < bmi1) { // good msgRecommend = "GOOD! YOU NEED TO TRYUP TO GET GOOD BODY"; }else{ // bad msgRecommend = "BAD! YOU WERE NOT DO WORKOUT HARDWORK :("; } }else if(bmi1 < bmiMin && bmi2 < bmiMin){ // user need to up weight if (bmi2 > bmi1) { // good msgRecommend = "GOOD! YOU NEED TO TRYUP TO GET GOOD BODY"; }else{ // bad msgRecommend = "BAD! YOU WERE NOT DO WORKOUT HARDWORK :("; } }else if(bmi2 >= bmiMin && bmi2 <= bmiMax){ // good body msgRecommend = "GOOD! YOU HAVE GOOD BODY"; } return msgRecommend; } private class BmiHistoryAdapter extends BaseAdapter{ private Context mContext; private List<BmiTable> data; public BmiHistoryAdapter(Context context, List<BmiTable> list) { this.mContext = context; this.data = list; } @Override public int getCount() { return data.size(); } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return data.get(arg0); } @Override public long getItemId(int arg0) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View converView, ViewGroup arg2) { View view = converView; Holder holder; if (view == null) { holder = new Holder(); LayoutInflater inf = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inf.inflate(R.layout.bmi_item, null); holder.txtBmi = (TextView)view.findViewById(R.id.bmi_item_index_id); holder.txtDate = (TextView)view.findViewById(R.id.bmi_item_date_id); view.setTag(holder); }else{ holder = (Holder)view.getTag(); } holder.txtBmi.setText(String.valueOf(data.get(position).bmiIndex)); holder.txtDate.setText(data.get(position).date); if (position == 0 ) { holder.txtBmi.setTextColor(getResources().getColor(R.color.red_color)); holder.txtBmi.setTextSize(20); } return view; } } private class Holder{ private TextView txtBmi; private TextView txtDate; } }
6071d03a3f2cef9b16089f478af7e03f582ee01c
4950b0412d5a764075af0d6bdfb95c1a6fcc971a
/core/src/main/java/com/alibaba/alink/params/timeseries/ArimaAlgoParams.java
478c722c3f90feee767b33ae79d0415d45926f53
[ "Apache-2.0" ]
permissive
zhu1971/Alink
7cae17e0fad1ca3efd940299e76042e22df9611a
d600bbf215c16b710d99b9b2404fc3da3e508997
refs/heads/master
2023-08-29T20:06:12.148089
2021-11-02T03:55:42
2021-11-02T03:55:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
935
java
package com.alibaba.alink.params.timeseries; import org.apache.flink.ml.api.misc.param.ParamInfo; import org.apache.flink.ml.api.misc.param.ParamInfoFactory; import com.alibaba.alink.params.timeseries.holtwinters.HasSeasonalPeriod; public interface ArimaAlgoParams<T> extends HasEstmateMethod <T>, HasSeasonalPeriod <T> { ParamInfo <int[]> ORDER = ParamInfoFactory .createParamInfo("order", int[].class) .setDescription("p,d,q") .setRequired() .build(); default int[] getOrder() { return get(ORDER); } default T setOrder(int[] value) { return set(ORDER, value); } ParamInfo <int[]> SEASONAL_ORDER = ParamInfoFactory .createParamInfo("seasonalOrder", int[].class) .setDescription("p,d,q") .setOptional() .setHasDefaultValue(null) .build(); default int[] getSeasonalOrder() { return get(SEASONAL_ORDER); } default T setSeasonalOrder(int[] value) { return set(SEASONAL_ORDER, value); } }
5ff36ccae45eeed905f3f79805abb05b4d833ae2
f6c3ed58a6967d208f1ed225ad8a42f70796d209
/MSI/src/mx/com/invex/msi/model/Producto.java
694effcbe9619cc41a2e2b5b2e3631f567b49707
[]
no_license
fEscami11a/desarrollo_repo
7c5fd7b800f7a402acc86b6ea2b0f6dd32d7fb59
7efde0b45f4ab882e382ad0db86c83047cc84414
refs/heads/master
2016-08-11T06:33:46.200193
2016-02-26T19:16:34
2016-02-26T19:16:34
48,443,536
0
0
null
null
null
null
UTF-8
Java
false
false
1,412
java
package mx.com.invex.msi.model; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; @Entity @Table(name="MATRIZ_PRODUCTOS",schema="USR_CATALOGOS") public class Producto implements Serializable{ /** * */ private static final long serialVersionUID = 1L; @Id @Column(name="ID_AGENTE") private Integer id; @Column(name="BIN_BANCO") private String bin; @Column(name="U_CODE3_ACT") private String ucode3; private String campania; @ManyToMany(fetch = FetchType.LAZY, mappedBy = "productos") private Set<Campania> campanias = new HashSet<Campania>(); public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getBin() { return bin; } public void setBin(String bin) { this.bin = bin; } public String getUcode3() { return ucode3; } public void setUcode3(String ucode3) { this.ucode3 = ucode3; } public String getCampania() { return campania; } public void setCampania(String campania) { this.campania = campania; } public Set<Campania> getCampanias() { return campanias; } public void setCampanias(Set<Campania> campanias) { this.campanias = campanias; } }
a877a4a6f4aec065387c53116cbb6e90f3815bba
340deca4cc4acf78150dfd783bb87ec5518c80fa
/bplustree.java
947cd76baca885d0d72d9c8763171f013bfca869
[]
no_license
ChaningHwang/Bplus-tree
14b361b32aa1f638a17c607ebffeefbce86c0169
3d1af8e21cf04fbee1973826360dabf91c88ee5e
refs/heads/master
2022-10-13T19:03:45.315327
2020-06-09T04:16:23
2020-06-09T04:16:23
270,899,747
0
0
null
null
null
null
UTF-8
Java
false
false
14,948
java
//import all the package which need to use here import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.*; import java.util.regex.*; import java.io.*; //use generics PECS principle to define the class bplustree //extend to get, super to insert put public class bplustree<K extends Comparable<? super K>, V> { private static final int Default_MaxNumOfChild = 128; //set a default m-1(m means the order of tree) private int MaxNumOfChild; //set a variable m-1, integer type private Node root; //set the root node of the B Plus Tree //define the public class bplustree here public bplustree() { this.MaxNumOfChild = Default_MaxNumOfChild; } //define a public function initialize function here //to execute initialize function, which is necessary //for constructing a B Plus Tree public void initialize(int MaxNumOfChild) { if (MaxNumOfChild <= 2) throw new IllegalArgumentException("Illegal branching factor: " + MaxNumOfChild); this.MaxNumOfChild = MaxNumOfChild; root = new LeafNode(); } //define a public function key search here public V search(K key) { return root.getValue(key); } //make public the search range function defined later here //return the getRange function result public List<V> searchRange(K key1, K key2) { return root.getRange(key1, key2); } public void insert(K key, V value) { root.insertValue(key, value); } public void delete(K key) { root.deleteValue(key); } //Make the linked list, as what B+ tree required. public String toString() { Queue<List<Node>> queue = new LinkedList<List<Node>>(); queue.add(Arrays.asList(root)); StringBuilder sb = new StringBuilder(); while (!queue.isEmpty()) { Queue<List<Node>> nextQueue = new LinkedList<List<Node>>(); while (!queue.isEmpty()) { List<Node> nodes = queue.remove(); sb.append('{'); Iterator<Node> it = nodes.iterator(); while (it.hasNext()) { Node node = it.next(); sb.append(node.toString()); if (it.hasNext()) sb.append(", "); if (node instanceof bplustree.InternalNode) nextQueue.add(((InternalNode) node).children); } sb.append('}'); if (!queue.isEmpty()) sb.append(", "); else sb.append('\n'); } queue = nextQueue; } return sb.toString(); } //Define an abstract class Node private abstract class Node { List<K> keys; //Define keys as List int keyNumber() { return keys.size(); } abstract V getValue(K key); abstract void deleteValue(K key); abstract void insertValue(K key, V value); abstract K getFirstLeafKey(); abstract List<V> getRange(K key1, K key2); abstract void merge(Node sibling); abstract Node split(); abstract boolean isOverflow(); abstract boolean isUnderflow(); public String toString() { return keys.toString(); } } //Define a private class Internal Node here private class InternalNode extends Node { List<Node> children; //Use a dynamic list children to store internal node //Initialze a keys dynamic list and children dynamic list. InternalNode() { this.keys = new ArrayList<K>(); this.children = new ArrayList<Node>(); } //Return value according to key V getValue(K key) { return getChild(key).getValue(key); } //Define deleteValue function here to execute Delete(key) command. void deleteValue(K key) { Node child = getChild(key); child.deleteValue(key); if (child.isUnderflow()) { Node childLeftSibling = getChildLeftSibling(key); Node childRightSibling = getChildRightSibling(key); Node left = childLeftSibling != null ? childLeftSibling : child; Node right = childLeftSibling != null ? child : childRightSibling; left.merge(right); deleteChild(right.getFirstLeafKey()); if (left.isOverflow()) { //check whether the number of left is >m-1 Node sibling = left.split(); //if it is >m-1, then move the first leaf key to be a child insertChild(sibling.getFirstLeafKey(), sibling); } if (root.keyNumber() == 0) //check whether the root is deleted root = left; //if it is the case, set the node left to be the root } } //Insert the key into the keys list, and check whether other nodes need to move //Since it is the internal node class, as B+ tree required, only store keys, not values. void insertValue(K key, V value) { Node child = getChild(key); child.insertValue(key, value); if (child.isOverflow()) { Node sibling = child.split(); insertChild(sibling.getFirstLeafKey(), sibling); } if (root.isOverflow()) { Node sibling = split(); InternalNode newRoot = new InternalNode(); newRoot.keys.add(sibling.getFirstLeafKey()); newRoot.children.add(this); newRoot.children.add(sibling); root = newRoot; } } //Return the first leaf key K getFirstLeafKey() { return children.get(0).getFirstLeafKey(); } List<V> getRange(K key1, K key2) { return getChild(key1).getRange(key1, key2); } //Merge the sibling void merge(Node sibling) { InternalNode node = (InternalNode) sibling; keys.add(node.getFirstLeafKey()); keys.addAll(node.keys); children.addAll(node.children); } //Define a command split, to separate the left and right sibling Node split() { int from = keyNumber() / 2 + 1, to = keyNumber(); InternalNode sibling = new InternalNode(); sibling.keys.addAll(keys.subList(from, to)); sibling.children.addAll(children.subList(from, to + 1)); keys.subList(from - 1, to).clear(); children.subList(from, to + 1).clear(); return sibling; //return the sibling } //Check whether overflow boolean isOverflow() { return children.size() > MaxNumOfChild; } //Check whether underflow boolean isUnderflow() { return children.size() < (MaxNumOfChild + 1) / 2; } //Find the index of given key in keys list use binarySearch. //childIndex set to loc+1 if result>=0, otherwise set to -loc-1. //return the children node in children list use the childIndex. Node getChild(K key) { int loc = Collections.binarySearch(keys, key); int childIndex = loc >= 0 ? loc + 1 : -loc - 1; return children.get(childIndex); } //Define a function deleteChild here. //Use binarySearch to find the location of specific node //remove the value according to key void deleteChild(K key) { int loc = Collections.binarySearch(keys, key); if (loc >= 0) { keys.remove(loc); children.remove(loc + 1); } } //Insert given key and child to specific position. void insertChild(K key, Node child) { int loc = Collections.binarySearch(keys, key); int childIndex = loc >= 0 ? loc + 1 : -loc - 1; if (loc >= 0) { children.set(childIndex, child); } else { keys.add(childIndex, key); children.add(childIndex + 1, child); } } //Use binarySearch to check whether there is already has the given key number //If there is already one, return the corresponding element in the list children. Node getChildLeftSibling(K key) { int loc = Collections.binarySearch(keys, key); int childIndex = loc >= 0 ? loc + 1 : -loc - 1; if (childIndex > 0) return children.get(childIndex - 1); return null; } Node getChildRightSibling(K key) { int loc = Collections.binarySearch(keys, key); int childIndex = loc >= 0 ? loc + 1 : -loc - 1; if (childIndex < keyNumber()) return children.get(childIndex + 1); return null; } } //Define a private class LeafNode private class LeafNode extends Node { List<V> values; LeafNode next; LeafNode() { keys = new ArrayList<K>(); values = new ArrayList<V>(); } //Get the value of the given key //Use binarySearch function here to find the index of the specific key V getValue(K key) { int loc = Collections.binarySearch(keys, key); return loc >= 0 ? values.get(loc) : null; } void deleteValue(K key) { int loc = Collections.binarySearch(keys, key); if (loc >= 0) { keys.remove(loc); values.remove(loc); } } //Define insertValue function here void insertValue(K key, V value) { int loc = Collections.binarySearch(keys, key); int valueIndex = loc >= 0 ? loc : -loc - 1; if (loc >= 0) { values.set(valueIndex, value); } else { keys.add(valueIndex, key); values.add(valueIndex, value); } if (root.isOverflow()) { Node sibling = split(); InternalNode newRoot = new InternalNode(); newRoot.keys.add(sibling.getFirstLeafKey()); newRoot.children.add(this); newRoot.children.add(sibling); root = newRoot; } } //Return the first element in keys List. K getFirstLeafKey() { return keys.get(0); } //Define a getRange function here use to execute range search. //The function finally return every value whose key is key1<=key<=key2 in the List format. //import package ahead to use relative function of Iterator //use while to check every node //use iterator() to ask the container to return Iterator //use hasNext() to check whether there is any element in kIt //use next() to get the next element in the sequence List<V> getRange(K key1, K key2) { List<V> result = new LinkedList<V>(); LeafNode node = this; while (node != null) { Iterator<K> kIt = node.keys.iterator(); Iterator<V> vIt = node.values.iterator(); while (kIt.hasNext()) { K key = kIt.next(); V value = vIt.next(); int cmp1 = key.compareTo(key1); int cmp2 = key.compareTo(key2); if ((cmp1 >= 0) && (cmp2 <= 0)) result.add(value); else if (cmp2 > 0) return result; } node = node.next; } return result; } void merge(Node sibling) { LeafNode node = (LeafNode) sibling; keys.addAll(node.keys); //Add list to list values.addAll(node.values); next = node.next; } //Split the sibling Node split() { LeafNode sibling = new LeafNode(); int from = (keyNumber() + 1) / 2, to = keyNumber(); sibling.keys.addAll(keys.subList(from, to)); sibling.values.addAll(values.subList(from, to)); keys.subList(from, to).clear(); values.subList(from, to).clear(); sibling.next = next; next = sibling; return sibling; } //Use boolean store result of whether the number of values exceed m-1 //m is the tree order, the number of children should not be larger than m-1 //which is one of the rule of B+ TREE. boolean isOverflow() { return values.size() > MaxNumOfChild - 1; } //Same reasons as above. boolean isUnderflow() { return values.size() < MaxNumOfChild / 2; } } public static void main(String[] args) { try{ String filePath = args[0]; FileInputStream fin = new FileInputStream(filePath); InputStreamReader reader = new InputStreamReader(fin); BufferedReader buffReader = new BufferedReader(reader); String strTmp = ""; BufferedWriter out = new BufferedWriter(new FileWriter("output_file.txt")); //to initialize the B Plus Tree String str = buffReader.readLine(); Integer instart = null; Integer inend = null; for (int i=0; i<str.length(); i++) { if (str.substring(i).startsWith("(")) { instart = i + 1; } else if (str.substring(i).startsWith(")")) { inend = i; } } String incontent = str.substring(instart, inend); Integer treeorder = Integer.parseInt(incontent) + 1; bplustree<Integer, Double> bpt = new bplustree<Integer, Double>(); bpt.initialize(treeorder); //System.out.println(treeorder); while((strTmp = buffReader.readLine())!=null){ // System.out.println(strTmp); //insert command if (strTmp.startsWith("Insert")) { int insertlen = strTmp.length(); Integer istartnum = null; Integer isendnum = null; for (int i=0; i < insertlen; i++) { if (strTmp.substring(i).startsWith("(")) { istartnum = i + 1; } else if (strTmp.substring(i).startsWith(")")) { isendnum = i; } } String iscontent = strTmp.substring(istartnum, isendnum); String iscSplit[] = iscontent.split(","); String istr1 = iscSplit[0].trim(); String istr2 = iscSplit[1].trim(); Integer ikey = Integer.parseInt(istr1); Double ivalue = Double.parseDouble(istr2); bpt.insert(ikey, ivalue); //insert to the tree }//end of insert command //search command else if (strTmp.startsWith("Search")) { boolean status = strTmp.contains(","); if (status) { //search range function here Integer srstart = null; Integer srend = null; for (int i=0; i < strTmp.length(); i++) { if (strTmp.substring(i).startsWith("(")) { srstart = i + 1; } else if (strTmp.substring(i).startsWith(")")) { srend = i; } } String srcontent = strTmp.substring(srstart, srend); String srcSplit[] = srcontent.split(","); Integer srkey1 = Integer.parseInt(srcSplit[0].trim()); Integer srkey2 = Integer.parseInt(srcSplit[1].trim()); List<Double> srresult = bpt.searchRange(srkey1, srkey2); //List to string StringBuilder sb = new StringBuilder(); for(int i = 0; i < srresult.size(); i++) { sb.append(srresult.get(i)).append(","); } String realstr = sb.toString().substring(0, sb.toString().length()-1); //System.out.println(realstr); out.write(realstr); out.write("\n"); } else { Integer sstart = null; Integer send = null; for (int i=0; i < strTmp.length(); i++) { if (strTmp.substring(i).startsWith("(")) { sstart = i + 1; } else if (strTmp.substring(i).startsWith(")")) { send = i; } } String scontent = strTmp.substring(sstart, send); Integer skey = Integer.parseInt(scontent.trim()); Double searchresult = bpt.search(skey); if (searchresult != null) { //System.out.println(searchresult); String chresult = Double.toString(searchresult); out.write(chresult); out.write("\n"); } else { //System.out.println("Null"); out.write("Null"); out.write("\n"); } } } //Delete command else if (strTmp.startsWith("Delete")) { Integer dstart = null; Integer dend = null; for (int i=0; i < strTmp.length(); i++) { if (strTmp.substring(i).startsWith("(")) { dstart = i + 1; } else if (strTmp.substring(i).startsWith(")")) { dend = i; } } String dcontent = strTmp.substring(dstart, dend); Integer dkey = Integer.parseInt(dcontent); bpt.delete(dkey); } } buffReader.close(); out.close(); } catch (Exception e) { e.printStackTrace(); } } }
5ebc0806b2c52d1628c4a4b2f74ebe440fe63fce
9660baa89cb3217cf359cab47794af3918072f91
/20181226_02/app/src/main/java/com/example/a10_g/a20181226_02/MainActivity.java
ecd9fe36b5f2205bccce962bf062abeb72033215
[]
no_license
vincenttang1227/Android-Studio
8a776e38bb00fba427106a0c16535cdf2df20c74
cd4eca7a8c721870d0610c64fd9c8a65da02ab37
refs/heads/master
2020-04-09T07:39:43.201702
2018-12-27T09:14:45
2018-12-27T09:14:45
160,165,131
1
0
null
null
null
null
UTF-8
Java
false
false
1,614
java
package com.example.a10_g.a20181226_02; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.MediaController; import android.widget.Toast; import android.widget.VideoView; public class MainActivity extends AppCompatActivity implements MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener { private VideoView mVideoView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mVideoView = findViewById(R.id.videoView); MediaController mediaController = new MediaController(this); mVideoView.setMediaController(mediaController); mVideoView.setOnCompletionListener(this); mVideoView.setOnErrorListener(this); Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video); mVideoView.setVideoURI(uri); } @Override protected void onResume() { mVideoView.start(); super.onResume(); } @Override protected void onPause() { mVideoView.stopPlayback(); super.onPause(); } @Override public void onCompletion(MediaPlayer mediaPlayer) { Toast.makeText(MainActivity.this, "播放完畢!",Toast.LENGTH_LONG).show(); } @Override public boolean onError(MediaPlayer mediaPlayer, int what, int extra){ Toast.makeText(MainActivity.this, "發生錯誤!",Toast.LENGTH_LONG).show(); return true; } }
4cd330af6cfac5b2ad6c01e8dc25da8166bdb2ac
48a73a0ba850ac2925118dd304baa8f7b2874582
/Java/source/com/CxWave/Wave/Framework/Core/Messages/WaveObjectManagerRegisterEventListenerMessage.java
6d0e2b1819fe1f3995fd668bfbad448f526b5ed6
[ "Apache-2.0" ]
permissive
cxvisa/Wave
5e66dfbe32c85405bc2761c509ba8507ff66f8fe
1aca714933ff1df53d660f038c76ca3f2202bf4a
refs/heads/master
2021-05-03T15:00:49.991391
2018-03-31T23:06:40
2018-03-31T23:06:40
56,774,204
2
1
null
null
null
null
UTF-8
Java
false
false
2,178
java
package com.CxWave.Wave.Framework.Core.Messages; import com.CxWave.Wave.Framework.Messaging.Local.WaveMessage; import com.CxWave.Wave.Framework.ObjectModel.FrameworkOpCodes; import com.CxWave.Wave.Framework.Type.LocationId; import com.CxWave.Wave.Framework.Type.UI32; import com.CxWave.Wave.Framework.Type.WaveServiceId; public class WaveObjectManagerRegisterEventListenerMessage extends WaveMessage { private UI32 m_operationCodeToListenFor; private WaveServiceId m_listenerWaveServiceId; private LocationId m_listenerLocationId; public WaveObjectManagerRegisterEventListenerMessage () { super (WaveServiceId.NullServiceId, FrameworkOpCodes.WAVE_OBJECT_MANAGER_REGISTER_EVENT_LISTENER); } public WaveObjectManagerRegisterEventListenerMessage (final WaveServiceId serviceCode) { super (serviceCode, FrameworkOpCodes.WAVE_OBJECT_MANAGER_REGISTER_EVENT_LISTENER); } public WaveObjectManagerRegisterEventListenerMessage (final WaveServiceId serviceCode, final UI32 operationCodeToListenFor, final WaveServiceId listenerWaveServiceId, final LocationId listenerLocationId) { super (serviceCode, FrameworkOpCodes.WAVE_OBJECT_MANAGER_REGISTER_EVENT_LISTENER); m_operationCodeToListenFor = operationCodeToListenFor; m_listenerWaveServiceId = listenerWaveServiceId; m_listenerLocationId = listenerLocationId; } public UI32 getOperationCodeToListenFor () { return m_operationCodeToListenFor; } public void setOperationCodeToListenFor (final UI32 operationCodeToListenFor) { m_operationCodeToListenFor = operationCodeToListenFor; } public WaveServiceId getListenerWaveServiceId () { return m_listenerWaveServiceId; } public void setListenerWaveServiceId (final WaveServiceId listenerWaveServiceId) { m_listenerWaveServiceId = listenerWaveServiceId; } public LocationId getListenerLocationId () { return m_listenerLocationId; } public void setListenerLocationId (final LocationId listenerLocationId) { m_listenerLocationId = listenerLocationId; } }
b9dad31fdefbfa6f245fb182f2046aef880c809f
95f858fef69642a2013715796fcc4d5c9d0f056e
/bos-parent/bos-web/src/main/java/com/zhp/bos/web/bc/action/DecidedzoneAction.java
c77481e774505ff3d8da5e6d595f71db488a0e85
[]
no_license
meak1102/bos
6484e8db49641d516cb4307c6181c149a2af3579
e76529bc18d82f07bd021c3e8cbafa7046a60653
refs/heads/master
2021-06-23T10:02:44.225132
2017-08-02T05:20:22
2017-08-02T05:20:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,875
java
package com.zhp.bos.web.bc.action; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Join; import javax.persistence.criteria.JoinType; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.apache.commons.lang3.StringUtils; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.springframework.context.annotation.Scope; import org.springframework.data.domain.Page; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Controller; import com.zhp.bos.entity.bc.Decidedzone; import com.zhp.bos.entity.bc.Staff; import com.zhp.bos.entity.customer.Customers; import com.zhp.bos.web.base.action.BaseAction; @Controller @Scope("prototype") @Namespace("/") @ParentPackage("bosManager") public class DecidedzoneAction extends BaseAction<Decidedzone> { @Action(value = "decidedzoneAction_save", results = { @Result(name = "save", type = "redirectAction", location = "page_base_decidedzone") }) public String save() { String[] sids = getRequest().getParameterValues("sid"); // 页面提交为input标签,没有数据时为空字符串,保存时会出现保存外键异常 if (StringUtils.isBlank(model.getStaff().getId())) { model.setStaff(null); } facadeService.getDecidedzoneService().save(model, sids); return "save"; } /** * 远程查询指定定区关联的客户 * * @return */ @Action(value = "decidedzoneAction_getAssociationCustomersByDecided", results = { @Result(name = "getAssociationCustomersByDecided", type = "fastJson") }) public String getAssociationCustomersByDecided() { Collection<? extends Customers> collection = facadeService.getDecidedzoneService() .getAssociationCustomersByDecided(model.getId()); if (collection == null) {// 返回为null时页面数据表格异常,而从数据库查询不会为null,只会为空 push(new ArrayList<>()); } else { push(collection); } return "getAssociationCustomersByDecided"; } /** * 远程查询未被关联的客户 * * @return */ @Action(value = "decidedzoneAction_getNoAssociationCustomers", results = { @Result(name = "getNoAssociationCustomers", type = "fastJson") }) public String getNoAssociationCustomers() { Collection<? extends Customers> collection = facadeService.getDecidedzoneService().getNoAssociationCustomers(); if (collection == null) {// 返回为null时页面数据表格异常,而从数据库查询不会为null,只会为空 push(new ArrayList<>()); } else { push(collection); } return "getNoAssociationCustomers"; } /** * 远程查询未被关联的客户 * * @return */ @Action(value = "decidedzoneAction_assignedCustomerToDecidedZone", results = { @Result(name = "assignedCustomerToDecidedZone", type = "redirectAction", location = "page_base_decidedzone") }) public String assignedCustomerToDecidedZone() { String[] cids = getRequest().getParameterValues("customerIds"); facadeService.getDecidedzoneService().assignedCustomerToDecidedZone(model.getId(), cids); return "assignedCustomerToDecidedZone"; } /** * 检验定区id * * @return */ @Action(value = "decidedzoneAction_checkdecidedzoneId", results = { @Result(name = "checkdecidedzoneId", type = "fastJson") }) public String checkdecidedzoneId() { System.out.println(model.getId()); Decidedzone decidedzone = facadeService.getDecidedzoneService().checkdecidedzoneId(model); if (decidedzone == null) { push(false); } else { push(true); } return "checkdecidedzoneId"; } // 区域删除 @Action(value = "decidedAction_delete", results = { @Result(name = "delete", type = "json") }) public String delete() { String idString = (String) getParameter("ids"); try { if (StringUtils.isNotBlank(idString)) { String[] idsarr = idString.split(","); facadeService.getDecidedzoneService().delete(idsarr); push(true); } else { push(false); } } catch (Exception e) { push(false); e.printStackTrace(); } return "delete"; } // 条件分页查询 @Action(value = "decidedzoneAction_pageQuery") public String pageQuery() { Page<Decidedzone> pages = facadeService.getDecidedzoneService().pageQuery(getSpecification(), getPageRequest()); setPageData(pages); return "pageQuery"; } // 查询条件封装 public Specification<Decidedzone> getSpecification() { return new Specification<Decidedzone>() { @Override public Predicate toPredicate(Root<Decidedzone> root, CriteriaQuery<?> query, CriteriaBuilder cb) { List<Predicate> list = new ArrayList<Predicate>(); if (StringUtils.isNotBlank(model.getId())) { list.add(cb.like(root.get("id").as(String.class), "%" + model.getId() + "%")); } if (model.getStaff() != null && StringUtils.isNotBlank(model.getStaff().getStation())) { Join<Decidedzone, Staff> staffJoin = root .join(root.getModel().getSingularAttribute("staff", Staff.class), JoinType.LEFT); list.add(cb.like(staffJoin.get("station").as(String.class), "%" + model.getStaff().getStation() + "%")); } String isAssociationSubarea = (String) getParameter("isAssociationSubarea"); if ("1".equals(isAssociationSubarea)) { list.add(cb.isNotEmpty(root.get("subareas").as(Set.class))); } else if ("0".equals(isAssociationSubarea)) { list.add(cb.isEmpty(root.get("subareas").as(Set.class))); } Predicate[] p = new Predicate[list.size()]; return cb.and(list.toArray(p)); } }; } }
d480d172e11a708a0ea4c750670dcbd080a33097
8e0f603fb476bf5568fbdda2f0013c838272db6c
/LeXiang-pojo/src/main/java/com/LeXiang/pojo/Auditlog.java
cbb90245933dba5d3a710d1b006ef6ed3c4dc463
[]
no_license
13399182359/LeXiang
8b1d1b5dd2762174016edbcc3ef4259051cb4e11
7c88fdf29f9e85ce3452686de07896961a61f4f7
refs/heads/master
2022-12-21T10:00:48.297708
2019-09-22T19:36:44
2019-09-22T19:36:44
207,739,574
0
0
null
2022-12-16T07:15:23
2019-09-11T06:30:06
JavaScript
UTF-8
Java
false
false
2,069
java
package com.LeXiang.pojo; import java.io.Serializable; import java.util.Date; public class Auditlog implements Serializable { private Long id; private Date createddate; private Date lastmodifieddate; private Long version; private String action; private String detail; private String ip; private String requesturl; private Long userId; private String parameters; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Date getCreateddate() { return createddate; } public void setCreateddate(Date createddate) { this.createddate = createddate; } public Date getLastmodifieddate() { return lastmodifieddate; } public void setLastmodifieddate(Date lastmodifieddate) { this.lastmodifieddate = lastmodifieddate; } public Long getVersion() { return version; } public void setVersion(Long version) { this.version = version; } public String getAction() { return action; } public void setAction(String action) { this.action = action == null ? null : action.trim(); } public String getDetail() { return detail; } public void setDetail(String detail) { this.detail = detail == null ? null : detail.trim(); } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip == null ? null : ip.trim(); } public String getRequesturl() { return requesturl; } public void setRequesturl(String requesturl) { this.requesturl = requesturl == null ? null : requesturl.trim(); } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public String getParameters() { return parameters; } public void setParameters(String parameters) { this.parameters = parameters == null ? null : parameters.trim(); } }
cd6204f50dddfd4e02f954846f0b4ff0f96779ca
ebe60e24ec05af26b7769fe33022864fda38743d
/android/app/build/generated/not_namespaced_r_class_sources/debug/r/com/facebook/nativeimagetranscoder/R.java
f8ca5f3e9ddbf85c8fadd62dd8b2bec85ad6150a
[]
no_license
davibs22/foodappmobile
aff9fd7e531e583d8c37dfcfeb43b9285e31686b
d1023ad9bdb63f2e7c43a65a36ee6fb1b2742f5b
refs/heads/master
2022-12-22T19:38:34.094433
2020-09-27T22:20:28
2020-09-27T22:20:28
298,887,478
0
0
null
null
null
null
UTF-8
Java
false
false
10,465
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package com.facebook.nativeimagetranscoder; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f03002b; public static final int font = 0x7f030123; public static final int fontProviderAuthority = 0x7f030125; public static final int fontProviderCerts = 0x7f030126; public static final int fontProviderFetchStrategy = 0x7f030127; public static final int fontProviderFetchTimeout = 0x7f030128; public static final int fontProviderPackage = 0x7f030129; public static final int fontProviderQuery = 0x7f03012a; public static final int fontStyle = 0x7f03012b; public static final int fontVariationSettings = 0x7f03012c; public static final int fontWeight = 0x7f03012d; public static final int ttcIndex = 0x7f030278; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f0500b1; public static final int notification_icon_bg_color = 0x7f0500b2; public static final int ripple_material_light = 0x7f0500bd; public static final int secondary_text_default_material_light = 0x7f0500bf; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f060053; public static final int compat_button_inset_vertical_material = 0x7f060054; public static final int compat_button_padding_horizontal_material = 0x7f060055; public static final int compat_button_padding_vertical_material = 0x7f060056; public static final int compat_control_corner_material = 0x7f060057; public static final int compat_notification_large_icon_max_height = 0x7f060058; public static final int compat_notification_large_icon_max_width = 0x7f060059; public static final int notification_action_icon_size = 0x7f06012e; public static final int notification_action_text_size = 0x7f06012f; public static final int notification_big_circle_margin = 0x7f060130; public static final int notification_content_margin_start = 0x7f060131; public static final int notification_large_icon_height = 0x7f060132; public static final int notification_large_icon_width = 0x7f060133; public static final int notification_main_column_padding_top = 0x7f060134; public static final int notification_media_narrow_margin = 0x7f060135; public static final int notification_right_icon_size = 0x7f060136; public static final int notification_right_side_padding_top = 0x7f060137; public static final int notification_small_icon_background_padding = 0x7f060138; public static final int notification_small_icon_size_as_large = 0x7f060139; public static final int notification_subtext_size = 0x7f06013a; public static final int notification_top_pad = 0x7f06013b; public static final int notification_top_pad_large_text = 0x7f06013c; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f070096; public static final int notification_bg = 0x7f070097; public static final int notification_bg_low = 0x7f070098; public static final int notification_bg_low_normal = 0x7f070099; public static final int notification_bg_low_pressed = 0x7f07009a; public static final int notification_bg_normal = 0x7f07009b; public static final int notification_bg_normal_pressed = 0x7f07009c; public static final int notification_icon_background = 0x7f07009d; public static final int notification_template_icon_bg = 0x7f07009e; public static final int notification_template_icon_low_bg = 0x7f07009f; public static final int notification_tile_bg = 0x7f0700a0; public static final int notify_panel_notification_icon_bg = 0x7f0700a1; } public static final class id { private id() {} public static final int action_container = 0x7f080039; public static final int action_divider = 0x7f08003b; public static final int action_image = 0x7f08003c; public static final int action_text = 0x7f080042; public static final int actions = 0x7f080043; public static final int async = 0x7f08004b; public static final int blocking = 0x7f08004e; public static final int chronometer = 0x7f08005d; public static final int forever = 0x7f08008d; public static final int icon = 0x7f080097; public static final int icon_group = 0x7f080098; public static final int info = 0x7f08009c; public static final int italic = 0x7f08009d; public static final int line1 = 0x7f0800a3; public static final int line3 = 0x7f0800a4; public static final int normal = 0x7f0800cb; public static final int notification_background = 0x7f0800cc; public static final int notification_main_column = 0x7f0800cd; public static final int notification_main_column_container = 0x7f0800ce; public static final int right_icon = 0x7f0800dd; public static final int right_side = 0x7f0800de; public static final int tag_transition_group = 0x7f08011a; public static final int tag_unhandled_key_event_manager = 0x7f08011b; public static final int tag_unhandled_key_listeners = 0x7f08011c; public static final int text = 0x7f08011f; public static final int text2 = 0x7f080120; public static final int time = 0x7f08012a; public static final int title = 0x7f08012b; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f090017; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0b004a; public static final int notification_action_tombstone = 0x7f0b004b; public static final int notification_template_custom_big = 0x7f0b0052; public static final int notification_template_icon_group = 0x7f0b0053; public static final int notification_template_part_chronometer = 0x7f0b0057; public static final int notification_template_part_time = 0x7f0b0058; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0e0095; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0f0161; public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0162; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f0164; public static final int TextAppearance_Compat_Notification_Time = 0x7f0f0167; public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0169; public static final int Widget_Compat_NotificationActionContainer = 0x7f0f0251; public static final int Widget_Compat_NotificationActionText = 0x7f0f0252; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f03002b }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f030125, 0x7f030126, 0x7f030127, 0x7f030128, 0x7f030129, 0x7f03012a }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f030123, 0x7f03012b, 0x7f03012c, 0x7f03012d, 0x7f030278 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
0fd4a76c6e4353eacd84204156f4c888d53d7457
0840bf2d33fad816e72874e4c4b79f9966a721ae
/src/Somme.java
cc178d18a4c06cc74bf63498cab59768633b84d8
[]
no_license
ropi59/introductionPoo
f3828332562e35e30ac7c752f4d66f369ff7fffe
65de8f9a77c05e2343c8547ff6da5d88dace7fef
refs/heads/main
2023-09-05T20:56:27.905874
2021-10-13T07:54:21
2021-10-13T07:54:21
416,628,744
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
public class Somme { public int nombre1; public int nombre2; public Somme() { } public Somme(int nombre1, int nombre2) { this.nombre1 = nombre1; this.nombre2 = nombre2; } public int sum() { int somme = nombre1 + nombre2; return somme; } @Override public String toString() { return "Somme [nombre1=" + nombre1 + ", nombre2=" + nombre2 + "]"; } }
c706f82c428096d87dc29996d3da641d935f4391
ce1703e9da67115cc3030ccecd02b5efb2a2b0d9
/src/main/java/com/sunlearning/messanger/service/InstantMessageService.java
25b1c2f078cdb4077a4765624ae4cd0082a2c211
[]
no_license
zhu-ysh/messageTest
06fc4ed528f617e02535285afc2c1f5a8e306131
db91019c35a8b642a8b414a7a4987e53187075df
refs/heads/master
2023-03-11T23:32:02.006172
2019-03-18T03:05:12
2019-03-18T03:05:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,434
java
package com.sunlearning.messanger.service; import com.sunlearning.messanger.pojo.AuthInfo; import com.sunlearning.messanger.pojo.CommandInfo; import com.sunlearning.messanger.pojo.DeptInfo; import com.sunlearning.messanger.pojo.GroupInfo; import com.sunlearning.messanger.pojo.GroupMemberInfo; import com.sunlearning.messanger.pojo.MessageStoreInfo; import com.sunlearning.messanger.pojo.UserInfo; import java.util.List; public interface InstantMessageService { AuthInfo login(String userCode, String password); UserInfo getUser(String userCode); List<UserInfo> getUserList(); List<DeptInfo> getDeptList(); String insertGroup(GroupInfo info, UserInfo user); int updateGroup(GroupInfo info); int deleteGroup(String groupId); int insertGroupMemberList(List<GroupMemberInfo> members); int deleteGroupMember(String groupId, String userCode); GroupInfo getGroup(String groupCode); List<GroupInfo> getGroupListByUser(String userCode); List<GroupInfo> queryGroupListByKey(String searchKey); int insertHistoryMessage(MessageStoreInfo info); int insertWaitingMessage(MessageStoreInfo info); int deleteWaitingMessage(String messageId); List<MessageStoreInfo> getWaitingMessageListByUser(String userCode); MessageStoreInfo getMessage(String messageId); int insertCommand(CommandInfo info); int deleteCommand(CommandInfo info); List<CommandInfo> getCommandList(String userCode); }
01f50ed4bd44dfe90d45b6c107514407803a5cc7
e31c625d792ea325672d945bbe072ee94d2ce145
/aws-rds-dbproxyendpoint/src/test/java/software/amazon/rds/dbproxyendpoint/Matchers.java
60e6e0b6005f742da82f99bc6c48752bd1c0706d
[ "Apache-2.0" ]
permissive
zhuyibo-amzn/aws-cloudformation-resource-providers-rds-proxy
1abf9fb9c0d2a9fd2f1596d829099187cab9a409
b17b6fb51b9958537b2676bcf1777afba2877c42
refs/heads/master
2023-09-03T07:37:28.109081
2021-10-13T21:19:24
2021-10-13T21:25:32
414,746,279
0
0
null
null
null
null
UTF-8
Java
false
false
1,220
java
package software.amazon.rds.dbproxyendpoint; import static org.assertj.core.api.Assertions.assertThat; import com.amazonaws.services.rds.model.DBProxyEndpoint; public class Matchers { public static void assertThatModelsAreEqual(final Object rawModel, final DBProxyEndpoint sdkModel) { assertThat(rawModel).isInstanceOf(ResourceModel.class); ResourceModel model = (ResourceModel)rawModel; assertThat(model.getDBProxyEndpointName()).isEqualTo(sdkModel.getDBProxyEndpointName()); assertThat(model.getDBProxyEndpointArn()).isEqualTo(sdkModel.getDBProxyEndpointArn()); assertThat(model.getDBProxyName()).isEqualTo(sdkModel.getDBProxyName()); assertThat(model.getVpcId()).isEqualTo(sdkModel.getVpcId()); assertThat(model.getVpcSecurityGroupIds()).isEqualTo(sdkModel.getVpcSecurityGroupIds()); assertThat(model.getVpcSubnetIds()).isEqualTo(sdkModel.getVpcSubnetIds()); assertThat(model.getEndpoint()).isEqualTo(sdkModel.getEndpoint()); assertThat(model.getTargetRole()).isEqualTo(sdkModel.getTargetRole()); assertThat(model.getIsDefault()).isEqualTo(sdkModel.getIsDefault()); } }
f8a134b4311761d81958b95ce1bf1515861c8142
60ecf689f7acfcc807b5b9ab214ed77384afa891
/1605_07_code_final/recipe0701/src/main/java/cookbook/HomePage.java
76e1e1139a0ae4793c7463103e1415022c46915a
[]
no_license
pavel-pereguda/WicketCookBook
f4cd52f7f51da268af2c76ed2e7a57f6e8bcfddd
bfbbaff48abaa787ce074edcc0597534d57c6bcb
refs/heads/master
2021-09-10T17:02:06.324554
2018-03-29T20:58:02
2018-03-29T20:58:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,331
java
package cookbook; import org.apache.wicket.Component; import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.Model; import org.apache.wicket.validation.validator.StringValidator; public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { final Component feedback = new FeedbackPanel("feedback") .setOutputMarkupId(true); add(feedback); Form<?> form = new Form<Void>("form"); add(form); form.add(new TextField<String>("username", Model.of("")).setRequired( true).add(StringValidator.minimumLength(6))); form.add(new PasswordTextField("password", Model.of("")) .setRequired(true)); form.add(new AjaxButton("submit") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { target.addComponent(feedback); } @Override protected void onError(AjaxRequestTarget target, Form<?> form) { target.addComponent(feedback); } }); } }
9e5e8ac0c9250f9b7a322dddf254e01092ba1ab5
91653b8ca734cb9c781b4b124189404e3dd2e06d
/VIsle-Mobile-App/app/src/main/java/com/akshit/graphle/CreateSessionRequest.java
55c6202560a6d0642241ddb9d3d983190d3106d6
[]
no_license
IshaanOhri/Visle
b4cefbfd167b6272e40fe08f9d6ac1850fae461d
9aa75ef7b7097e8b5161f1f8f2cf406a3ea6c005
refs/heads/master
2023-01-01T22:22:44.825869
2020-10-25T16:48:49
2020-10-25T16:48:49
302,869,787
6
1
null
null
null
null
UTF-8
Java
false
false
305
java
package com.akshit.graphle; public class CreateSessionRequest { private String channelName; private String instructorName; public CreateSessionRequest(String channelName, String instructorName) { this.channelName = channelName; this.instructorName = instructorName; } }
b41562428e9a8d5867f8c75b8e58b1b92e782a4e
7195cfaef338a18c655700c01279ece4b023c740
/lemon/src/main/java/me/apon/lemon/core/Disposable.java
a709733e59b6f9d33d645dbdf9b34c3b3c33a50c
[ "Apache-2.0" ]
permissive
zkbqhuang/lemon
0b799c2ec973ae50af6dddf73aeb42dee3404721
0fc01ff65dd5106d712724393891624786167f49
refs/heads/master
2021-09-27T01:34:16.380123
2018-11-05T11:41:30
2018-11-05T11:41:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package me.apon.lemon.core; /** * Created by yaopeng([email protected]) on 2018/11/2. */ public interface Disposable { void dispose(); boolean isDisposed(); }
35d856ce5b342057ca59bb72264484e3fb9824fe
c13f289ee178097e75bc253ee55b7261ee23fb53
/Magnets.java
b1619fbfbe33aca644afba9ca18d40b1183fc85b
[]
no_license
Luciferved/Codeforces
84e2d97ad1abe9433b4eb6079299f7a503283ed5
6b3010bdc6caf4c1216b63a930c8c9aec307b534
refs/heads/master
2021-01-10T16:56:55.134471
2016-03-06T17:59:12
2016-03-06T17:59:12
53,268,092
2
0
null
null
null
null
UTF-8
Java
false
false
461
java
import java.util.*; import java.io.*; public class Magnets { public static void main(String args[])throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int a[] = new int[n]; int last = 0; int count = 0; for(int i=0;i<a.length;i++) { a[i] = Integer.parseInt(br.readLine()); if(a[i] != last) count++; last = a[i]; } System.out.println(count); } }
635f03fcf4c8642d433512dfc319f9f8402d0290
5a1ef36056876177acf2db21c9e8f70e1c5a0cae
/app/src/main/java/com/yxld/yxchuangxin/ui/activity/rim/presenter/RimPublicOrderListPresenter.java
6920a44b4520649df01276e911190c95cad64e12
[]
no_license
afjzwed/xinshequ
c9473bb01722ccae42e5cebe1c4002fdea2f5202
7b5e2cdf942c00c1ad941fc6e3aa59a12508e96b
refs/heads/master
2021-06-29T14:07:49.765564
2019-04-15T05:51:53
2019-04-15T05:51:53
132,833,339
1
1
null
null
null
null
UTF-8
Java
false
false
11,572
java
package com.yxld.yxchuangxin.ui.activity.rim.presenter; import android.os.Bundle; import android.support.annotation.NonNull; import com.socks.library.KLog; import com.yxld.yxchuangxin.Utils.ToastUtil; import com.yxld.yxchuangxin.base.BaseEntityService; import com.yxld.yxchuangxin.data.api.HttpAPIWrapper; import com.yxld.yxchuangxin.entity.RimDeleteOrderBean; import com.yxld.yxchuangxin.entity.SJComplain; import com.yxld.yxchuangxin.entity.SJOrder; import com.yxld.yxchuangxin.ui.activity.rim.contract.RimPublicOrderListContract; import java.util.LinkedHashMap; import javax.inject.Inject; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Action; import io.reactivex.functions.Consumer; /** * @author wwx * @Package com.yxld.yxchuangxin.ui.activity.rim * @Description: presenter of RimPublicOrderListFragment * @date 2017/06/17 */ public class RimPublicOrderListPresenter implements RimPublicOrderListContract .RimPublicOrderListContractPresenter { HttpAPIWrapper httpAPIWrapper; private final RimPublicOrderListContract.View mView; private CompositeDisposable mCompositeDisposable; @Inject public RimPublicOrderListPresenter(@NonNull HttpAPIWrapper httpAPIWrapper, @NonNull RimPublicOrderListContract.View view) { mView = view; this.httpAPIWrapper = httpAPIWrapper; mCompositeDisposable = new CompositeDisposable(); } @Override public void subscribe() { } @Override public void unsubscribe() { if (!mCompositeDisposable.isDisposed()) { mCompositeDisposable.dispose(); } } @Override public void getRimOrderList(LinkedHashMap<String, String> data, boolean isRefresh) { Disposable disposable = httpAPIWrapper.getRimOrderList(data) .subscribe(new Consumer<SJOrder>() { @Override public void accept(SJOrder order) throws Exception { //这里接收数据项 KLog.i("成功的回调" + order.toString()); // if (order == null || order.getTotal() == 0) { // mView.setError(); // } // mView.setData(order); if (order.getSuccess().equals("1")) { if (isRefresh) { mView.setData(true, order); } else { mView.setData(false, order); } } else { mView.setError(); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { //这里接收onError KLog.i("onError的回调"); mView.setError(); } }, new Action() { @Override public void run() throws Exception { //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } @Override public void requestConfirOrder(LinkedHashMap<String, String> data) { Disposable disposable = httpAPIWrapper.requestConfirOrder(data) .subscribe(new Consumer<BaseEntityService>() { @Override public void accept(BaseEntityService order) throws Exception { //这里接收数据项 KLog.i("成功的回调" + order.toString()); if (order.getStatus() == 1) { mView.requestFinish("确认订单成功", true); mView.jump(1); } else { mView.requestFinish(order.getMsg(), false); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { //这里接收onError KLog.i("onError的回调"); mView.requestFinish("确认订单失败", false); } }, new Action() { @Override public void run() throws Exception { //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } @Override public void requestCancelOrder(LinkedHashMap<String, String> data) { mView.showProgressDialog(); Disposable disposable = httpAPIWrapper.rimCancelOrder(data) .subscribe(new Consumer<BaseEntityService>() { @Override public void accept(BaseEntityService data) throws Exception { mView.closeProgressDialog(); //这里接收数据项 KLog.i("成功的回调" + data.toString()); if (data.getStatus() == 1) { mView.statusChange(); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { mView.closeProgressDialog(); //这里接收onError KLog.i("onError的回调"); // mView.getRimComplainDetailFinish("确认订单失败",false); } }, new Action() { @Override public void run() throws Exception { mView.closeProgressDialog(); //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } @Override public void getRimComplainDetail(LinkedHashMap<String, String> data, Bundle bundle) { mView.showProgressDialog(); Disposable disposable = httpAPIWrapper.getRimComplainDetail(data) .subscribe(new Consumer<SJComplain>() { @Override public void accept(SJComplain data) throws Exception { mView.closeProgressDialog(); if (data.getStatus() == 1) { //这里接收数据项 if (null == data.getData() || data.getData().size() == 0) {//未投诉 mView.getRimComplainDetailFinish(false, bundle, null); } else {//已投诉 mView.getRimComplainDetailFinish(true, bundle, data); } KLog.i("成功的回调" + data.toString()); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { mView.closeProgressDialog(); //这里接收onError KLog.i("onError的回调"); // mView.getRimComplainDetailFinish("确认订单失败",false); } }, new Action() { @Override public void run() throws Exception { mView.closeProgressDialog(); //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } @Override public void deleteRimOrder(LinkedHashMap<String, String> data) { mView.showProgressDialog(); Disposable disposable = httpAPIWrapper.deleteRimOrder(data) .subscribe(new Consumer<RimDeleteOrderBean>() { @Override public void accept(RimDeleteOrderBean data) throws Exception { mView.closeProgressDialog(); //这里接收数据项 KLog.i("成功的回调" + data.toString()); if (data.getStatus() == 1) { mView.requestFinish("删除订单成功", true); } else { mView.requestFinish("删除订单失败,请稍后重试", false); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { mView.closeProgressDialog(); //这里接收onError KLog.i("onError的回调"); // mView.getRimComplainDetailFinish("确认订单失败",false); } }, new Action() { @Override public void run() throws Exception { mView.closeProgressDialog(); //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } @Override public void getOrderBuyCheck(LinkedHashMap<String, String> data) { mView.showProgressDialog(); Disposable disposable = httpAPIWrapper.getOrderBayCheck(data) .subscribe(new Consumer<BaseEntityService>() { @Override public void accept(BaseEntityService data) throws Exception { mView.closeProgressDialog(); //这里接收数据项 KLog.i("成功的回调" + data.toString()); if (data.getStatus() == 1) { mView.selectPaymentMethod(); } else { ToastUtil.showShort(data.getMsg()); } } }, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) throws Exception { mView.closeProgressDialog(); //这里接收onError KLog.i("onError的回调"); // mView.getRimComplainDetailFinish("确认订单失败",false); } }, new Action() { @Override public void run() throws Exception { mView.closeProgressDialog(); //这里接收onComplete。 KLog.i("run的回调"); } }); mCompositeDisposable.add(disposable); } }
3dbddb666827c8e9e5c24fb051f5a4c7ffb3c055
8f45135d5f33ec12746699fb911f608d2158a95d
/Homework lab1/BT ứng dụng/Bài 1/Cardealer/src/test/java/Cardealer/CardealerApplicationTests.java
25965e90cb4c667efcb9a834850607fec2d2bfc7
[]
no_license
HungDuc1710/Homework_Springboot
8fb8aae2051fa780290e400103fc66c5781332dd
6593af195c834340f985344eae5eeff2f68a0ee5
refs/heads/main
2023-04-16T18:49:25.882504
2021-04-22T16:35:16
2021-04-22T16:35:16
357,853,858
0
0
null
null
null
null
UTF-8
Java
false
false
204
java
package Cardealer; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CardealerApplicationTests { @Test void contextLoads() { } }
503654df9e380a3dccaa9091c506be034ec8d28a
845e44da24afd187033af4ae37b1502531cc5b3b
/Hashcat.javaproj/src/application/jwt.java
00f9960ee8cb9f2b02d855a24cea68b2ea613592
[]
no_license
NorbertSomogyi/MoodernizeExamples
df75c2bdedfca30204e0717c057d90e989586c67
caaf0107200454eec36aeff1d97f7a669b1feedb
refs/heads/master
2022-12-27T23:33:27.112210
2020-10-04T22:31:51
2020-10-04T22:31:51
216,872,605
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package application; public class jwt { private Object[] salt_buf; private Object salt_len; private Object signature_len; public jwt(Object[] salt_buf, Object salt_len, Object signature_len) { setSalt_buf(salt_buf); setSalt_len(salt_len); setSignature_len(signature_len); } public jwt() { } public Object[] getSalt_buf() { return salt_buf; } public void setSalt_buf(Object[] newSalt_buf) { salt_buf = newSalt_buf; } public Object getSalt_len() { return salt_len; } public void setSalt_len(Object newSalt_len) { salt_len = newSalt_len; } public Object getSignature_len() { return signature_len; } public void setSignature_len(Object newSignature_len) { signature_len = newSignature_len; } }
2438a265a8871eadd0e5be10f095a400f0431b30
e58a9067bcf6089e2b1e8e323d8873a73a9b644d
/Login.java
b3735139c810d59fe692e1affbb5d6fd3c34b5d4
[]
no_license
ch0chi/Mock-Wedding-Tracker
76a13d7905b7f43c44b3eeefe6f298e600dc3ebf
c8650b57d1bd742f86b407151f642a4ac2796e0a
refs/heads/master
2021-01-10T13:37:33.881235
2016-03-15T20:38:58
2016-03-15T20:38:58
53,976,470
0
0
null
null
null
null
UTF-8
Java
false
false
22,564
java
package dbgui; import java.io.IOException; import java.io.PrintStream; import java.net.URL; import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.ResourceBundle; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.control.TableColumn.CellEditEvent; import javafx.scene.control.TableView.TableViewSelectionModel; import javafx.scene.control.cell.TextFieldTableCell; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; import javafx.util.Callback; /** * Created by Michael's Account on 11/14/2015. */ public class Login implements Initializable { //need to add a seperate class(like the employee class) @FXML private AnchorPane loginPane; @FXML private TextField username; @FXML private TextField password; @FXML private Button login; @FXML private Label result; @FXML private Button populateList; @FXML private Button addCustomer; @FXML private TableView<Vendors> vendorsTable = new TableView(); @FXML private TableColumn<Vendors,String> vendorName = new TableColumn(); @FXML private TableColumn<Vendors, String> vendorID = new TableColumn(); @FXML private TableView<Weddings> weddingTable = new TableView(); @FXML private TableColumn<Weddings, String> weddingID; @FXML private TableColumn<Weddings, String> weddingName; @FXML private TableColumn<Weddings,String> weddingPrice; @FXML private TableColumn<Weddings,String> amountPaid; @FXML private TableColumn<Weddings,String> extraCosts; @FXML private TableView<Supplies> suppliesTable= new TableView(); @FXML private TableColumn<Supplies, String> suppliesID; @FXML private TableColumn<Supplies, String> suppliesName; @FXML private TableView<Price> priceTable = new TableView(); @FXML private TableColumn<Price, String> vendorIDPrice; @FXML private TableColumn<Price, String> suppliesIDPrice; @FXML private TableColumn<Price, String> price; @FXML private TableView<Employee> EmployeeTable = new TableView(); @FXML private TableColumn<Employee, String> employeeID; @FXML private TableColumn<Employee, String> firstName; @FXML private TableColumn<Employee, String> lastName; @FXML private TableColumn<Employee, String> street; @FXML private TableView<WeddingDetails> weddingDetailTable; @FXML private TableColumn<WeddingDetails, String> weddingDetailSupplies; @FXML private TableColumn<WeddingDetails, String> amount; @FXML private TableColumn<WeddingDetails, String> vendNameDetail; @FXML private TableColumn<WeddingDetails,String> priceDetail; @FXML private TableColumn<WeddingDetails,String> totalDetail; @FXML private Button refreshWeddingDetail; @FXML private Label wName; @FXML private Label weddingCost; @FXML private Label paidFull; @FXML private Label notPaid; @FXML private Label wedDate; @FXML private TextField newFirstName; @FXML private TextField newLastName; @FXML private TextField newStreet; @FXML private TextField newCity; @FXML private Label alreadyInDatabase; @FXML private Tab vendorsTab; @FXML private Tab weddingTab; @FXML private Tab suppliesTab; @FXML private Tab priceTab; @FXML private Tab employeeTab; @FXML private TextField searchWeddings; @FXML private Button btnSearch; @FXML private String newCell; private EditDatabase edit; private Connection conn = null; private Connection connect = null; private ArrayList<String> ids; private ArrayList<String> fName; private ArrayList<String> lName; private ArrayList<String> cCity; private ArrayList<String> cStreet; private String usern; private String pass; private boolean loginAuth = false; private user user1 = new user(); private user passUser; private static int lastID; private ResultSet results; private boolean checkIfExecutedProperly=false; private fetchTableData ftd; private Vendors v; private Supplies s; private Weddings w; private Employee e; private static String searchQuery = ""; @Override public void initialize(URL url, ResourceBundle rb) { } public Login() { try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } ftd = new fetchTableData(); } public boolean setLogon() throws IOException, SQLException { usern = username.getText(); user.setUserName(usern); pass = password.getText(); user.setPassword(pass); try { String dbName = "db/database"; String jdbcUrl = "jdbc:hsqldb:file:" + dbName; System.out.println(jdbcUrl); user.setJdbcUrl(jdbcUrl); conn = DriverManager.getConnection(user.getJdbcUrl(), user.getUserName(), user.getPassword()); dbgui.user.setConn(conn); System.out.println(conn); System.out.println("Connected to database as: " + usern); loginAuth = true; setAuth(true); } catch (SQLException ex) { System.err.println("Couldn't connect to database"); username.clear(); password.clear(); } return loginAuth; } public void setAuth(boolean flag){ this.loginAuth=flag; } public boolean getAuth(){ return loginAuth; } public void newVendorView() throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("addVendor.fxml")); Stage stage = new Stage(); stage.setTitle("Add New Vendor"); stage.setScene(new Scene(viewDB)); stage.show(); } @FXML void displayNewVendorView(ActionEvent event) throws SQLException, IOException{ newVendorView(); } public void newSupplyView() throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("addSupplies.fxml")); Stage stage = new Stage(); stage.setTitle("Add New Supply"); stage.setScene(new Scene(viewDB)); stage.show(); } @FXML void displayNewSupplyView(ActionEvent event)throws SQLException,IOException{ //need to add this to button newSupplyView(); } public void newWeddingView() throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("newWedding.fxml")); Stage stage = new Stage(); stage.setTitle("Add New Wedding"); stage.setScene(new Scene(viewDB)); stage.show(); } @FXML public void displayNewWeddingView(ActionEvent event)throws SQLException,IOException{ newWeddingView(); } public void newEmployeeView() throws IOException { Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("addNewEmployee.fxml")); Stage stage = new Stage(); stage.setTitle("Add New User"); stage.setScene(new Scene(viewDB)); stage.show(); } @FXML void displayEmployeeView(ActionEvent event) throws SQLException, IOException { //add to fxml menu item newEmployeeView(); } public void viewDatabase() throws IOException { Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("viewDatabase.fxml")); Stage stage = new Stage(); stage.setTitle("Database View"); stage.setScene(new Scene(viewDB)); stage.show(); vendorsTable.setEditable(true); } public void viewUnpaidWeddings() throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("unpaidWedding.fxml")); Stage stage = new Stage(); stage.setTitle("Unpaid Weddings"); stage.setScene(new Scene(viewDB)); stage.show(); } public void viewUnfinishedWeddings() throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("notFinishedWeddings.fxml")); Stage stage = new Stage(); stage.setTitle("Unfinished Weddings"); stage.setScene(new Scene(viewDB)); stage.show(); ftd.fetchWeddingsData(); } public void viewPriceCompare()throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("priceCompare.fxml")); Stage stage = new Stage(); stage.setTitle("Price Comparison"); stage.setScene(new Scene(viewDB)); stage.show(); } public void viewWeddingDetails()throws IOException{ Parent viewDB; viewDB = FXMLLoader.load(getClass().getResource("weddingDetails.fxml")); Stage stage = new Stage(); stage.setTitle("Wedding Details"); stage.setScene(new Scene(viewDB)); stage.show(); } @FXML void buttonLogon() throws IOException, SQLException { if (setLogon()) { viewDatabase(); } else { result.setText("Wrong username/password!"); } } @FXML void getTableRefresh() throws SQLException, IOException { EmployeeTable.setItems(ftd.fetchEmployeeData()); vendorsTable.setItems(ftd.fetchVendorData()); weddingTable.setItems(ftd.fetchWeddingsData()); suppliesTable.setItems(ftd.fetchSuppliesData()); priceTable.setItems(ftd.fetchPriceData()); editCell(); } //called in the menu //called in the menu public Tab getCurrentTab() throws IOException, SQLException { if(vendorsTab.isSelected()){ return vendorsTab; }else if(weddingTab.isSelected()){ return weddingTab; }else if(suppliesTab.isSelected()){ return suppliesTab; }else if(employeeTab.isSelected()){ return employeeTab; } return vendorsTab; } public ObservableList<WeddingDetails> fetchWeddingDetails() throws IOException, SQLException { ObservableList<WeddingDetails> data = FXCollections.observableArrayList(); String query = "SELECT weddingName,weddingDate,weddingDate,suppliesname,vendorname,price, count(*) AS Iterations ,(price*count(*)) as ItemCostTotal,weddingprice,amountpaid FROM weddingsupplies JOIN price\n" + "ON weddingsupplies.suppliesID=price.suppliesID JOIN weddings ON weddingsupplies.weddingid=weddings.weddingID JOIN supplies ON weddingSupplies.suppliesID=supplies.suppliesID JOIN vendors\n" + "ON price.vendorID=vendors.vendorID \n" + "GROUP BY weddingName,weddingDate,weddingID,suppliesID,suppliesname,vendorname,price,weddingprice,amountpaid,weddingDate\n" + "HAVING count(*)>0 AND weddingname IN(select weddingname FROM weddings WHERE weddingname LIKE '%"+getSelectedWeddingName()+"%')"; PreparedStatement stmt; try { stmt = user.getConn().prepareStatement(query); //stmt.setString(1,getSelectedWeddingName()); results = stmt.executeQuery(); while(results.next()){ String wedName=results.getString("weddingName"); String supplyName = results.getString("suppliesName"); String vendName = results.getString("vendorName"); Date weddDate = results.getDate("weddingDate"); Double weddPrice = results.getDouble("weddingprice"); Double amtPaid = results.getDouble("amountpaid"); Double prc = results.getDouble("price"); int iterations = results.getInt("Iterations"); int total = results.getInt("ItemCostTotal"); System.out.println(prc); //convert variables to string for display String strWedPrice = Double.toString(weddPrice); DateFormat df = new SimpleDateFormat("yyyy/MM/dd"); String strDate = df.format(weddDate); System.out.println(getSelectedWeddingName()); WeddingDetails wd = new WeddingDetails(wedName,supplyName,prc,vendName,iterations,total,weddDate,weddPrice); wName.setText(wd.getWedName()); weddingCost.setText(strWedPrice); wedDate.setText(strDate); //check if wedding cost is >= amount paid. if(amtPaid>weddPrice){ paidFull.setVisible(true); notPaid.setVisible(false); }else if(weddPrice>amtPaid){ paidFull.setVisible(false); notPaid.setVisible(true); } System.out.println(wd.getWedName()); System.out.println(wd.getWedName()); data.add(wd); } stmt.close(); results.close(); }catch(SQLException ex){ ex.printStackTrace(); } return data; } @FXML public void searchWeddings(KeyEvent event) throws IOException, SQLException { if (event.getCode() == KeyCode.ENTER && getSelectedWeddingName() != null) { //getSelectedWeddingName(); System.out.println(getSelectedWeddingName()); //fetchWeddingDetails(); weddingDetailTable.setItems(fetchWeddingDetails()); } } @FXML public void searchWeddingsOnClick(MouseEvent event)throws IOException,SQLException{ if(event.getSource()==btnSearch && getSelectedWeddingName()!=null){ System.out.println(getSelectedWeddingName()); } } public String getSelectedWeddingName() throws IOException,SQLException{ searchQuery=searchWeddings.getText(); return searchQuery; } @FXML void buttonDelete() throws IOException, SQLException { if(getCurrentTab()==vendorsTab){ deleteVendorFromDatabase(); getTableRefresh(); }else if(getCurrentTab()==weddingTab){ deleteWeddingFromDatabase(); getTableRefresh(); }else if(getCurrentTab()==suppliesTab){ deleteSuppliesFromDatabase(); getTableRefresh(); }else if(getCurrentTab()==employeeTab){ deleteEmployeeFromDatabase(); getTableRefresh(); } } public void deleteEmployeeFromDatabase() throws IOException, SQLException { e = EmployeeTable.getSelectionModel().getSelectedItem(); try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } PreparedStatement stmt; try { String delete = "DELETE FROM Employee WHERE EmployeeID=?;"; stmt = user.getConn().prepareStatement(delete); stmt.setInt(1, e.getEmployeeId()); stmt.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } } public void deleteVendorFromDatabase() throws IOException, SQLException{ v= vendorsTable.getSelectionModel().getSelectedItem(); try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } PreparedStatement stmt; try { String delete = "DELETE FROM Vendors WHERE VendorID=?;"; stmt = user.getConn().prepareStatement(delete); System.out.println("lol"); stmt.setInt(1, v.getID()); stmt.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } } public void deleteSuppliesFromDatabase() throws IOException, SQLException{ s = suppliesTable.getSelectionModel().getSelectedItem(); try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } PreparedStatement stmt; try { String delete = "DELETE FROM Supplies WHERE SuppliesID=?;"; stmt = user.getConn().prepareStatement(delete); stmt.setInt(1, s.getID()); stmt.executeUpdate(); stmt.close(); } catch (Exception e) { e.printStackTrace(); } } public void deleteWeddingFromDatabase() throws IOException,SQLException{ w = weddingTable.getSelectionModel().getSelectedItem(); try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } PreparedStatement stmt; try { String delete = "DELETE FROM Weddings WHERE WeddingID=?;"; stmt = user.getConn().prepareStatement(delete); stmt.setInt(1, w.getWeddingID()); stmt.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } } //Edit cells public int setSelectRowID() throws IOException, SQLException { //get current selected cell if(getCurrentTab()==vendorsTab){ v=vendorsTable.getSelectionModel().getSelectedItem(); return v.getID(); }else if(getCurrentTab()==weddingTab){ w=weddingTable.getSelectionModel().getSelectedItem(); return w.getWeddingID(); }else if(getCurrentTab()==suppliesTab){ s=suppliesTable.getSelectionModel().getSelectedItem(); return s.getID(); }else if(getCurrentTab()==employeeTab){ e=EmployeeTable.getSelectionModel().getSelectedItem(); return e.getEmployeeId(); } return 6; } public void getSelectRowID(MouseEvent click) throws IOException, SQLException { setSelectRowID(); } public String getNewCell() { return newCell; } public void setNewCell(String newCell){ this.newCell=newCell; } public void editCell() throws IOException, SQLException { //calls the sql methods during to edit editVendorName(); } //*******Edit Vendors******** public void editVendorName() throws IOException, SQLException { this.vendorsTable.setEditable(true); Callback cellFactory = p -> new EditingCell(); try { Class.forName("org.hsqldb.jdbc.JDBCDriver"); } catch (ClassNotFoundException ex) { System.err.println("Couldn't load the driver class."); System.exit(1); } try { String update = "UPDATE Vendors SET VendorName=? WHERE VendorID=?;"; final PreparedStatement stmt = user.getConn().prepareStatement(update); this.vendorName.setCellFactory(cellFactory); this.vendorName.setOnEditCommit(t -> { ((Vendors)t.getTableView().getItems().get(t .getTablePosition().getRow())) .setVendorName((String)t .getNewValue()); Login.this.setNewCell((String)t.getNewValue()); try { stmt.setString(1, Login.this.getNewCell()); stmt.setInt(2, Login.this.setSelectRowID()); stmt.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } t.consume(); }); } catch (SQLException e1) { e1.printStackTrace(); } } class EditingCell extends TableCell<Vendors, String> { private TextField textField; public EditingCell() {} public void startEdit() { super.startEdit(); if (this.textField == null) { createTextField(); } setGraphic(this.textField); setContentDisplay(ContentDisplay.GRAPHIC_ONLY); this.textField.selectAll(); } public void cancelEdit() { super.cancelEdit(); setText(String.valueOf(getItem())); setContentDisplay(ContentDisplay.TEXT_ONLY); } public void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (empty) { setText(null); setGraphic(null); } else if (isEditing()) { if (this.textField != null) { this.textField.setText(getString()); } setGraphic(this.textField); setContentDisplay(ContentDisplay.GRAPHIC_ONLY); } else { setText(getString()); setContentDisplay(ContentDisplay.TEXT_ONLY); } } private void createTextField() { this.textField = new TextField(getString()); this.textField.setMinWidth(getWidth() - getGraphicTextGap() * 2.0D); this.textField.setOnKeyPressed(t -> { if (t.getCode() == KeyCode.ENTER) { EditingCell.this.commitEdit(EditingCell.this.textField.getText()); } else if (t.getCode() == KeyCode.ESCAPE) { EditingCell.this.cancelEdit(); } }); } private String getString() { return getItem() == null ? "" : ((String)getItem()).toString(); } } }
960a3030e77eec8548d57a682e66d9bb9c48f1d7
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes7.dex_source_from_JADX/com/facebook/feed/rows/sections/attachments/AlbumAttachmentHScrollPartDefinition.java
fe2c5fcf06a9652e663402a2aeadeaa84a4a42fe
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
7,104
java
package com.facebook.feed.rows.sections.attachments; import android.content.Context; import com.facebook.common.propertybag.PropertyBag; import com.facebook.common.util.SizeUtil; import com.facebook.feed.environment.HasContext; import com.facebook.feed.environment.HasPersistentState; import com.facebook.feed.environment.HasPositionInformation; import com.facebook.feed.rows.core.binding.StoryKeyUtil; import com.facebook.feed.rows.core.parts.MultiRowSinglePartDefinition; import com.facebook.feed.rows.core.props.AttachmentProps; import com.facebook.feed.rows.core.props.FeedProps; import com.facebook.feed.rows.sections.hscrollrecyclerview.HScrollRecyclerViewRowType; import com.facebook.feed.rows.sections.hscrollrecyclerview.PageStyle; import com.facebook.feed.rows.sections.hscrollrecyclerview.PageStyleFactory; import com.facebook.feed.rows.sections.hscrollrecyclerview.PageSubParts; import com.facebook.feed.rows.sections.hscrollrecyclerview.PersistentRecyclerPartDefinition; import com.facebook.feed.rows.sections.hscrollrecyclerview.PersistentRecyclerPartDefinition.Props; import com.facebook.feed.rows.sections.hscrollrecyclerview.SimpleCallbacks; import com.facebook.feed.rows.styling.BackgroundPartDefinition; import com.facebook.feed.rows.styling.BackgroundPartDefinition.StylingData; import com.facebook.feed.rows.styling.PaddingStyle; import com.facebook.feed.ui.imageloader.FeedImageLoader; import com.facebook.feed.ui.imageloader.FeedImageLoader.FeedImageType; import com.facebook.graphql.model.GraphQLStory; import com.facebook.graphql.model.GraphQLStoryAttachment; import com.facebook.graphql.model.VisibleItemHelper; import com.facebook.inject.ContextScope; import com.facebook.inject.ContextScoped; import com.facebook.inject.InjectorLike; import com.facebook.inject.InjectorThreadStack; import com.facebook.inject.ProvisioningException; import com.facebook.inject.ScopeSet; import com.facebook.multirow.api.AnyEnvironment; import com.facebook.multirow.api.SubParts; import com.facebook.multirow.api.ViewType; import com.facebook.widget.hscrollrecyclerview.HScrollRecyclerView; import com.google.common.collect.ImmutableList; import javax.inject.Inject; @ContextScoped /* compiled from: [createActor] Invalid actorId */ public class AlbumAttachmentHScrollPartDefinition<E extends HasPositionInformation & HasPersistentState & HasContext> extends MultiRowSinglePartDefinition<FeedProps<GraphQLStoryAttachment>, Void, E, HScrollRecyclerView> { private static final PaddingStyle f20481a = PageStyle.a; private static AlbumAttachmentHScrollPartDefinition f20482h; private static final Object f20483i = new Object(); private final Context f20484b; private final PersistentRecyclerPartDefinition<Object, E> f20485c; public final AlbumAttachmentPagePartDefinition f20486d; private final BackgroundPartDefinition f20487e; private final FeedImageLoader f20488f; private final PageStyleFactory f20489g; private static AlbumAttachmentHScrollPartDefinition m23568b(InjectorLike injectorLike) { return new AlbumAttachmentHScrollPartDefinition((Context) injectorLike.getInstance(Context.class), BackgroundPartDefinition.a(injectorLike), PersistentRecyclerPartDefinition.a(injectorLike), AlbumAttachmentPagePartDefinition.a(injectorLike), FeedImageLoader.a(injectorLike), PageStyleFactory.b(injectorLike)); } public final Object m23570a(SubParts subParts, Object obj, AnyEnvironment anyEnvironment) { final FeedProps feedProps = (FeedProps) obj; float c = (float) SizeUtil.c(this.f20484b, (float) this.f20488f.a(FeedImageType.Album)); GraphQLStory c2 = AttachmentProps.c(feedProps); subParts.a(this.f20487e, new StylingData(null, f20481a)); subParts.a(this.f20485c, new Props(this.f20489g.a(c + 8.0f, f20481a, true), c2.ac_(), new SimpleCallbacks<E>(this) { final /* synthetic */ AlbumAttachmentHScrollPartDefinition f20480b; public final void m23566c(int i) { VisibleItemHelper.a(AttachmentProps.c(feedProps), i); } public final void m23565a(PageSubParts<E> pageSubParts) { ImmutableList x = ((GraphQLStoryAttachment) feedProps.a).x(); int size = x.size(); for (int i = 0; i < size; i++) { pageSubParts.a(this.f20480b.f20486d, feedProps.a((GraphQLStoryAttachment) x.get(i))); } } }, StoryKeyUtil.a(c2), c2)); return null; } @Inject public AlbumAttachmentHScrollPartDefinition(Context context, BackgroundPartDefinition backgroundPartDefinition, PersistentRecyclerPartDefinition persistentRecyclerPartDefinition, AlbumAttachmentPagePartDefinition albumAttachmentPagePartDefinition, FeedImageLoader feedImageLoader, PageStyleFactory pageStyleFactory) { this.f20484b = context; this.f20485c = persistentRecyclerPartDefinition; this.f20486d = albumAttachmentPagePartDefinition; this.f20487e = backgroundPartDefinition; this.f20488f = feedImageLoader; this.f20489g = pageStyleFactory; } public static AlbumAttachmentHScrollPartDefinition m23567a(InjectorLike injectorLike) { ScopeSet a = ScopeSet.a(); byte b = a.b((byte) 8); try { Context b2 = injectorLike.getScopeAwareInjector().b(); if (b2 == null) { throw new ProvisioningException("Called context scoped provider outside of context scope"); } AlbumAttachmentHScrollPartDefinition b3; ContextScope contextScope = (ContextScope) injectorLike.getInstance(ContextScope.class); PropertyBag a2 = ContextScope.a(b2); synchronized (f20483i) { AlbumAttachmentHScrollPartDefinition albumAttachmentHScrollPartDefinition; if (a2 != null) { albumAttachmentHScrollPartDefinition = (AlbumAttachmentHScrollPartDefinition) a2.a(f20483i); } else { albumAttachmentHScrollPartDefinition = f20482h; } if (albumAttachmentHScrollPartDefinition == null) { InjectorThreadStack injectorThreadStack = injectorLike.getInjectorThreadStack(); contextScope.a(b2, injectorThreadStack); try { b3 = m23568b(injectorThreadStack.e()); if (a2 != null) { a2.a(f20483i, b3); } else { f20482h = b3; } } finally { ContextScope.a(injectorThreadStack); } } else { b3 = albumAttachmentHScrollPartDefinition; } } return b3; } finally { a.c(b); } } public final ViewType m23569a() { return HScrollRecyclerViewRowType.a; } public final boolean m23571a(Object obj) { return true; } }
3d5ec3bf024b9016bd39ec8c142ee31230b4b4e5
97101f3922ef73fcfb80a0a3f5e420f84ab4d132
/design-patterns/src/main/java/com/sda/patterns/solid/open_closed/after/Subraction.java
e8b90d95b8332be29764cff32ae0092540efd0dd
[]
no_license
cristian-hum/Spring-si-recapiturare
27deb99a7ce5bd490d3ecac2f912b8e1d0f9e377
0be61d6e681bee7fd8718e33fe155b093c05f3d6
refs/heads/master
2023-08-13T23:56:56.303296
2021-10-09T09:45:10
2021-10-09T09:45:10
410,203,653
1
0
null
null
null
null
UTF-8
Java
false
false
986
java
package com.sda.patterns.solid.open_closed.after; public class Subraction implements IOperation { private double firstOperand; private double secondOperand; private double result = 0.0; public Subraction(double firstOperand, double secondOperand) { this.firstOperand = firstOperand; this.secondOperand = secondOperand; } public double getFirstOperand() { return firstOperand; } public void setFirstOperand(double firstOperand) { this.firstOperand = firstOperand; } public double getSecondOperand() { return secondOperand; } public void setSecondOperand(double secondOperand) { this.secondOperand = secondOperand; } public double getResult() { return result; } public void setResult(double result) { this.result = result; } @Override public void performOperation() { this.result = this.firstOperand - this.secondOperand; } }
11b911f7fe9548578e47715d83669c92362a81cb
ab3f5643e3c744915cbc053e4b2d79984e86d59e
/src/main/java/com/netposapi/client/service/PersonService.java
90da5b6f1e0f3c1b226e6e197e9fb9658e2e95ad
[]
no_license
PedroCardenete/client-api
bca0c177db3d471bdc24fa1ffa01285e5de401dc
d09491ff9776516dadd371104cea907ab8185ee9
refs/heads/master
2023-05-27T01:03:00.872268
2020-07-14T13:09:07
2020-07-14T13:09:07
278,756,679
0
0
null
2021-06-04T22:12:09
2020-07-11T00:07:06
Java
UTF-8
Java
false
false
2,424
java
package com.netposapi.client.service; import java.util.List; import java.util.Optional; import com.netposapi.client.models.Person; import com.netposapi.client.models.request.JwtRequest; import com.netposapi.client.repository.PersonRepository; import com.netposapi.client.service.impl.PersonServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.web.server.ResponseStatusException; @Service public class PersonService implements PersonServiceImpl { @Autowired PersonRepository personRepository; @Autowired private PasswordEncoder passwordEncoder; @Override public List<Person> list() { return personRepository.findAll(); } @Override public List<Person> search(String key) { return personRepository.findByUserNameStartingWith(key); } @Override public Optional<Person> getPersonEmail(String email) { if (emailExist(email)) { return personRepository.findByUserName(email); } throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Email não cadastrado", null); } @Override public Person savePerson(JwtRequest personRequest) { if (emailExist(personRequest.getUsername())) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Email já cadastrado", null); } Person person = new Person(); person.setUserName(personRequest.getUsername()); person.setPassword(passwordEncoder.encode(personRequest.getPassword())); return personRepository.save(person); } @Override public boolean emailExist(String email) { return true;// personRepository.existsByUserName(email); } @Override public boolean checkPassword(JwtRequest personRequest) { if (!emailExist(personRequest.getUsername())) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Email não cadastrado", null); } Optional<Person> person = personRepository.findById(1); if (!passwordEncoder.matches(personRequest.getPassword(), person.get().getPassword())) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Password/Email Inválido", null); } return true; } }
9263d5e59c09fac40c67d66fb04a51554f358ff6
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes10.dex_source_from_JADX/com/facebook/commerce/storefront/ui/ProductTileViewHolder.java
6108f25a9a49b36030266b033018357f20c31e83
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
1,209
java
package com.facebook.commerce.storefront.ui; import android.support.v7.widget.RecyclerView.ViewHolder; import com.facebook.analytics.logger.AnalyticsLogger; import com.facebook.commerce.core.analytics.CommerceAnalytics.CommerceProductSectionType; import com.facebook.commerce.core.ui.ProductItemWithPriceOverlayView; import com.facebook.commerce.core.util.CommerceNavigationUtil; import com.facebook.commerce.storefront.behaviours.ProductTileOnClickListener; /* compiled from: core_graph_show_requests_banner */ public class ProductTileViewHolder extends ViewHolder { public ProductItemWithPriceOverlayView f15805l; public ProductTileOnClickListener f15806m; public ProductTileViewHolder(ProductItemWithPriceOverlayView productItemWithPriceOverlayView, CommerceNavigationUtil commerceNavigationUtil, AnalyticsLogger analyticsLogger) { super(productItemWithPriceOverlayView); this.f15805l = productItemWithPriceOverlayView; this.f15806m = new ProductTileOnClickListener(productItemWithPriceOverlayView.getContext(), commerceNavigationUtil, analyticsLogger, CommerceProductSectionType.STOREFRONT_COLLECTION); this.f15805l.setOnClickListener(this.f15806m); } }
b08e1984befe29206ef4b40e6f6eb84e0bef544b
2aea873eabbf826de90218755e0292d219f0b793
/app/src/main/java/ru/coyul/simpleloginapp/di/ConfigPersistent.java
9cc0aea5fc038aebe3054e488151db7d3e41c357
[]
no_license
coyul/SimpleLoginApp
0b6b82b895f90094c2071081f60dc5dcf6586eef
a43ffa1dab175b2cfb8301796a178ee07a95e82c
refs/heads/master
2020-03-19T07:04:06.909257
2018-06-04T20:53:20
2018-06-04T20:53:20
136,081,990
0
0
null
null
null
null
UTF-8
Java
false
false
265
java
package ru.coyul.simpleloginapp.di; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Scope; /** * @author Koenova Yulia */ @Scope @Retention(RetentionPolicy.RUNTIME) public @interface ConfigPersistent { }
f0422538d1e2ab968fb3ac3261f377a5a186a012
063b8c729684f894001a4cb0564ca743a427055e
/_leetcode/java/src/_567/Sort/Solution.java
0115e533f439c18a8192a8209cae5bff5fcc2551
[]
no_license
Rollingkeyboard/all-in-one
790737de6d7c5e86c720375a9b5beb587f73f399
b40aa3c03f84c551c6df52daaa024a4fe0bbc60a
refs/heads/master
2023-09-06T03:14:47.310607
2021-11-14T13:46:41
2021-11-14T13:46:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package _567.Sort; import java.util.Arrays; public class Solution { public boolean checkInclusion(String s1, String s2) { String s1s = helper(s1); for (int i = 0; i <= s2.length() - s1s.length(); i++) { String sub = helper(s2.substring(i, i + s1s.length())); if (sub.equals(s1s)) { return true; } } return false; } private String helper(String s) { char[] arr = s.toCharArray(); Arrays.sort(arr); return new String(arr); } }
505e5f4efe35d2e10432fc477a16d3909ab259b5
2ea1e216a88d125260c7f3dca05f5a4e8ccb9704
/src/com/wy/parking/controller/web/userCenter/admin/selfInfo/ChangePassGetAction.java
22be27b3479a78432228131d20ab64b9f9600feb
[]
no_license
yuanyuanwang1/com.parking
03c5b9169f08da45efe87f1c24243fdf8ce25502
3a1d00f25b07968ed381880c1e0630c4a7321338
refs/heads/master
2021-05-05T07:08:52.173132
2018-03-22T01:30:31
2018-03-22T01:30:31
118,851,243
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
/** * */ package com.wy.parking.controller.web.userCenter.admin.selfInfo; import org.apache.log4j.Logger; import com.wy.superClass.SuperAction; /** * @author Administrator * */ public class ChangePassGetAction extends SuperAction { private Logger logger = Logger.getLogger(ChangePassGetAction.class); }
10db890c01f3e5d0c5a73ef5023b75861d57acc9
e9ec93b5341eea8209135ecdcb9a0547e1112001
/Server/src/util/DBCon.java
69e50988a963bdf43d7360fcad50501e0e85f03a
[]
no_license
WxhKeepFighting/BackCode
c5d522feed8370cf768a3a9059094cc730db8d39
aac5b2cbf1703af2f913195212f5db867ea7898b
refs/heads/master
2022-07-01T09:24:17.706476
2019-12-23T03:19:38
2019-12-23T03:19:38
217,871,586
0
0
null
2022-06-17T03:28:19
2019-10-27T15:01:20
Java
UTF-8
Java
false
false
1,958
java
package util; import java.sql.*; public class DBCon { private static Connection connection = null; private static PreparedStatement preparedStatement = null; private static Statement statement = null; private static Connection getConnection() { try { Class.forName("com.mysql.jdbc.Driver"); long start = System.currentTimeMillis(); connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&useSSL=false", "root", "123456"); long end = System.currentTimeMillis(); System.out.println("建立连接耗时:" + (end - start) + "ms 毫秒"); } catch (SQLException | ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return connection; } public static Statement getStatement() { Connection connection = DBCon.getConnection(); if (connection != null) { try { statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); } catch (SQLException e) { e.printStackTrace(); } } return statement; } public static PreparedStatement getPreparedStatement(String sql) throws SQLException { Connection connection = DBCon.getConnection(); if (connection != null) { preparedStatement = connection.prepareStatement(sql); } return preparedStatement; } public static void close() { try { if (connection != null) { connection.close(); } if (preparedStatement != null) { preparedStatement.close(); } if (statement != null){ statement.close(); } } catch (SQLException e) { e.printStackTrace(); } } }
d8cdf8accb9d4ec40d020d76f6350e5978e47a31
3a1415392a91ecb6e73164eeb4ea6137c75c4f11
/generators/app/templates/src/main/java/threewks/framework/controller/dto/ComponentErrorDto.java
af0c98036acbfb93613fd29981398556b1b31ff0
[ "MIT" ]
permissive
mondo-mob/generator-spring-gae-react
ea51f778f096041f6bac806b934c773aeb4bd558
0f49a110748e3494d4cf754a1a7960ab1b9f79aa
refs/heads/master
2023-01-11T01:38:23.756818
2020-03-10T22:03:47
2020-03-10T22:03:47
253,367,536
0
0
MIT
2023-01-05T10:49:40
2020-04-06T01:25:54
Java
UTF-8
Java
false
false
250
java
package threewks.framework.controller.dto; public class ComponentErrorDto extends ErrorDto { private String componentStack; public ComponentErrorDto() { } public String getComponentStack() { return componentStack; } }
6ef0ea86449224f5096f6c1028a63c1271988e55
2bce9eebed4bff05367588e6cff2b4f25352a633
/app/src/main/java/com/ruiqin/umengdemo/util/SpanUtils.java
257ce8c3e6246311591a062fda4a3d3cdc0cbfe0
[ "Apache-2.0" ]
permissive
jianesrq0724/UMengDemo
d79338c87e0ebefc5b16ade797b98e235f56ac91
8d4acc8560c8f17bd8672ab6048591e23de34a5a
refs/heads/master
2020-12-02T22:56:12.259492
2017-07-05T06:39:25
2017-07-05T06:39:25
96,206,874
1
0
null
null
null
null
UTF-8
Java
false
false
982
java
package com.ruiqin.umengdemo.util; import android.support.v4.content.ContextCompat; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import com.ruiqin.umengdemo.App; import com.ruiqin.umengdemo.R; /** * Created by ruiqin.shen * 类说明: */ public class SpanUtils { /** * 更新字体颜色 * * @return */ public static SpannableString updateFontColor(String content, String[] redTipFonts) { SpannableString spannableString = new SpannableString(content); for (int i = 0; i < redTipFonts.length; i++) { int startIndex = content.lastIndexOf(redTipFonts[i]); int endIndex = startIndex + redTipFonts[i].length(); spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(App.getContext(), R.color.text_red)), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return spannableString; } }
4ab03d219f92305bfc4609db2545b4c22ff3552b
9de2a92935eaadeb1188e18837f8a31edf65bb00
/tesla-config-server/src/main/java/com/tesla/cloud/example/ConfigServerApplication.java
338a319b96d437376d4e33845ffe468a1d706b57
[]
no_license
scottdu/tesla-spring-cloud-example
e2ac4933528f58830411304e7e7b11f8f6fce131
540b9bd7cbe78f2cea7421ac65024ea39663e507
refs/heads/master
2021-01-18T15:37:05.877243
2017-03-30T01:46:22
2017-03-30T01:46:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
515
java
package com.tesla.cloud.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.config.server.EnableConfigServer; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @EnableEurekaClient @EnableConfigServer @SpringBootApplication public class ConfigServerApplication { public static void main( String[] args ) { SpringApplication.run(ConfigServerApplication.class,args); } }
7bedbe508c49501cacacfff37b8bf6912a68ca60
f2a965dd0d51728f0a395b5a663891ea57878d45
/core/src/com/lozada/fitthecircle/MenuScreen.java
df87b81fa3c5d44528cbf7b019d46c6ffd58db80
[]
no_license
Lozadadev/Fit-The-Circle
14bad8cff3bfe79613be8238ae1c466971172a61
009b0b3837aba7bedbc0cea7e5738e65a294e6e6
refs/heads/master
2021-01-19T19:48:24.085197
2017-04-22T04:30:10
2017-04-22T04:30:10
88,442,737
0
0
null
null
null
null
UTF-8
Java
false
false
3,171
java
package com.lozada.fitthecircle; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.utils.viewport.FitViewport; class MenuScreen extends BaseScreen { /** The stage where all the buttons are added. */ private Stage stage; /** The skin that we use to set the style of the buttons. */ private Skin skin; MenuScreen(final Main game) { super(game); // Create a new stage, as usual. stage = new Stage(new FitViewport(640, 960)); // Load the skin file. The skin file contains information about the skins. It can be // passed to any widget in Scene2D UI to set the style. It just works, amazing. skin = new Skin(Gdx.files.internal("skin/uiskin.json")); // For instance, here you see that I create a new button by telling the label of the // button as well as the skin file. The background image for the button is in the skin // file. /* The play button you use to jump to the game screen. */ TextButton play = new TextButton("Play", skin); // Add capture listeners. Capture listeners have one method, changed, that is executed // when the button is pressed or when the user interacts somehow with the widget. They are // cool because they let you execute some code when you press them. play.addCaptureListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { // Take me to the game screen! game.setScreen(game.gameScreen); } }); play.setSize(200, 80); play.setPosition(40, 140); // Do not forget to add actors to the stage or we wouldn't see anything. stage.addActor(play); } @Override public void show() { // Now this is important. If you want to be able to click the button, you have to make // the Input system handle input using this Stage. Stages are also InputProcessors. By // making the Stage the default input processor for this game, it is now possible to // click on buttons and even to type on input fields. Gdx.input.setInputProcessor(stage); } @Override public void hide() { // When the screen is no more visible, you have to remember to unset the input processor. // Otherwise, input might act weird, because even if you aren't using this screen, you are // still using the stage for handling input. Gdx.input.setInputProcessor(null); } @Override public void dispose() { // Dispose assets. stage.dispose(); skin.dispose(); } @Override public void render(float delta) { Gdx.gl.glClearColor(0.2f, 0.3f, 0.5f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(); stage.draw(); } }
fde76a30cbf976b9f5044fbf76f9504eb85935e4
2ddcb4a63d4df07245b61cbad7c185deaacfd687
/src/main/java/com/library/model/Book.java
fa16fb6ff77c728d7cf38befb724e35efa8f2f22
[]
no_license
vitorbenedito/library
674901391a0bf902ad2e906c8c7c6f6b9de4ed67
eb226568ef1369a7d307e6e822b9fc2f3f0549bc
refs/heads/master
2021-01-01T05:16:54.932770
2016-05-03T00:53:57
2016-05-03T00:53:57
57,411,158
0
0
null
null
null
null
UTF-8
Java
false
false
1,137
java
package com.library.model; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(name = "BOOK") public class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String title; private String author; @JsonIgnore @OneToMany(cascade = CascadeType.ALL, mappedBy="book") private Set<BookLoan> bookLoans; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public Set<BookLoan> getBookLoans() { return bookLoans; } public void setBookLoans(Set<BookLoan> bookLoans) { this.bookLoans = bookLoans; } }
039243e4be6475683ea027b2c21617f9663e9a49
d6f153ac2d76ee4f606b5058b9ea01f699ad7c95
/src/main/java/io/obejctstream/Student.java
a40c4bd3daec418dee0365ca4d2ffdb140ed6bca
[ "Apache-2.0" ]
permissive
Ecloss/Java-EE
4290613fe6f85273e4c97ee5ef6602d74a5dfb11
e56279576b2c41cdc296f19efcaed42f00d84137
refs/heads/master
2020-03-23T06:58:01.648491
2019-01-14T15:20:56
2019-01-14T15:20:56
141,240,280
0
0
Apache-2.0
2018-11-15T06:07:13
2018-07-17T06:13:55
Java
UTF-8
Java
false
false
892
java
package io.obejctstream; import java.io.Serializable; /** * @author 余修文 * @date 2018/7/29 15:09 */ public class Student implements Serializable { private static final long serialVersionUID = 2625448595481309975L; private String name; // transient没有被序列化 private transient Integer age; public Student() { } public Student(String name, Integer age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", age=" + age + '}'; } }
4143859b6900c793f67d3945a8425e9f5287aaa3
73ca64ddbcfb68cd9f4715513952400451970036
/server/src/main/java/com/moyu/nicespring/entity/Admin.java
5d71777ce507469e856bf21693b0660029ac6b92
[]
no_license
857193874/DMS
3dca67cce0ff258c37dc78fad5a85e010c00b2fc
45b9af4ba674f676bab1d143ebd6312774fc97c1
refs/heads/master
2022-12-16T19:46:30.892838
2019-07-29T13:50:49
2019-07-29T13:50:49
199,411,434
3
3
null
2022-12-09T20:14:42
2019-07-29T08:29:49
JavaScript
UTF-8
Java
false
false
1,411
java
package com.moyu.nicespring.entity; public class Admin { private Integer adminId; private String adminUsername; private String adminPassword; private String adminName; private String adminSex; private String adminTel; public Integer getAdminId() { return adminId; } public void setAdminId(Integer adminId) { this.adminId = adminId; } public String getAdminUsername() { return adminUsername; } public void setAdminUsername(String adminUsername) { this.adminUsername = adminUsername == null ? null : adminUsername.trim(); } public String getAdminPassword() { return adminPassword; } public void setAdminPassword(String adminPassword) { this.adminPassword = adminPassword == null ? null : adminPassword.trim(); } public String getAdminName() { return adminName; } public void setAdminName(String adminName) { this.adminName = adminName == null ? null : adminName.trim(); } public String getAdminSex() { return adminSex; } public void setAdminSex(String adminSex) { this.adminSex = adminSex == null ? null : adminSex.trim(); } public String getAdminTel() { return adminTel; } public void setAdminTel(String adminTel) { this.adminTel = adminTel == null ? null : adminTel.trim(); } }