blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 132
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 28
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
352
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a51d5ba0d500cf27513a3737b87dac2bc0c71686
|
6519ddbb7affb8a6fd65b0333e8cfe8046755fd5
|
/src/main/java/org/scholanova/mealdeliverapi/domain/Menu/Exception/MenuMauvaisTypeException.java
|
4fe4111ac0946a41bbcbb24b95d6b954daf278a8
|
[] |
no_license
|
khasinjy/MealDeliverAPI
|
9d369e6ed1200a91c5c471888ead857c1e358d46
|
ec111b3451fa34297397e1c6db729e9c7d31fde3
|
refs/heads/main
| 2023-03-07T00:16:29.587704
| 2021-02-18T17:18:00
| 2021-02-18T17:18:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 213
|
java
|
package org.scholanova.mealdeliverapi.domain.Menu.Exception;
public class MenuMauvaisTypeException extends RuntimeException {
public MenuMauvaisTypeException(String message) {
super(message);
}
}
|
[
"k.praxele@gmail.com"
] |
k.praxele@gmail.com
|
d37cd9f9ce35b12652e2d28e4db73fb54a4ee6aa
|
fab83ed11714ecd925703c1ad5da8daefb414e15
|
/src/test/java/br/com/fiap/easyinsurance/web/rest/CorretorResourceIT.java
|
a69440b07c864e00a92ae880af21ab3bcb5f655a
|
[] |
no_license
|
ceduardo-roque/easyinsurance-hybrid
|
09bc6e37cbd81bddd5577557048a05eca6f74fe3
|
30da0462ebc8ade557e706a50150ac12faccdb8f
|
refs/heads/main
| 2023-04-25T08:10:07.834277
| 2021-05-11T01:16:31
| 2021-05-11T01:16:31
| 366,198,396
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 20,009
|
java
|
package br.com.fiap.easyinsurance.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import br.com.fiap.easyinsurance.IntegrationTest;
import br.com.fiap.easyinsurance.domain.Corretor;
import br.com.fiap.easyinsurance.repository.CorretorRepository;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
import javax.persistence.EntityManager;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Base64Utils;
/**
* Integration tests for the {@link CorretorResource} REST controller.
*/
@IntegrationTest
@AutoConfigureMockMvc
@WithMockUser
class CorretorResourceIT {
private static final String DEFAULT_NOME_CORRETOR = "AAAAAAAAAA";
private static final String UPDATED_NOME_CORRETOR = "BBBBBBBBBB";
private static final String DEFAULT_USUARIO = "AAAAAAAAAA";
private static final String UPDATED_USUARIO = "BBBBBBBBBB";
private static final LocalDate DEFAULT_DATA_NASCIMENTO = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_DATA_NASCIMENTO = LocalDate.now(ZoneId.systemDefault());
private static final byte[] DEFAULT_FOTO = TestUtil.createByteArray(1, "0");
private static final byte[] UPDATED_FOTO = TestUtil.createByteArray(1, "1");
private static final String DEFAULT_FOTO_CONTENT_TYPE = "image/jpg";
private static final String UPDATED_FOTO_CONTENT_TYPE = "image/png";
private static final String DEFAULT_TELEFONE = "AAAAAAAAAA";
private static final String UPDATED_TELEFONE = "BBBBBBBBBB";
private static final String ENTITY_API_URL = "/api/corretors";
private static final String ENTITY_API_URL_ID = ENTITY_API_URL + "/{id}";
private static Random random = new Random();
private static AtomicLong count = new AtomicLong(random.nextInt() + (2 * Integer.MAX_VALUE));
@Autowired
private CorretorRepository corretorRepository;
@Autowired
private EntityManager em;
@Autowired
private MockMvc restCorretorMockMvc;
private Corretor corretor;
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Corretor createEntity(EntityManager em) {
Corretor corretor = new Corretor()
.nomeCorretor(DEFAULT_NOME_CORRETOR)
.usuario(DEFAULT_USUARIO)
.dataNascimento(DEFAULT_DATA_NASCIMENTO)
.foto(DEFAULT_FOTO)
.fotoContentType(DEFAULT_FOTO_CONTENT_TYPE)
.telefone(DEFAULT_TELEFONE);
return corretor;
}
/**
* Create an updated entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Corretor createUpdatedEntity(EntityManager em) {
Corretor corretor = new Corretor()
.nomeCorretor(UPDATED_NOME_CORRETOR)
.usuario(UPDATED_USUARIO)
.dataNascimento(UPDATED_DATA_NASCIMENTO)
.foto(UPDATED_FOTO)
.fotoContentType(UPDATED_FOTO_CONTENT_TYPE)
.telefone(UPDATED_TELEFONE);
return corretor;
}
@BeforeEach
public void initTest() {
corretor = createEntity(em);
}
@Test
@Transactional
void createCorretor() throws Exception {
int databaseSizeBeforeCreate = corretorRepository.findAll().size();
// Create the Corretor
restCorretorMockMvc
.perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isCreated());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeCreate + 1);
Corretor testCorretor = corretorList.get(corretorList.size() - 1);
assertThat(testCorretor.getNomeCorretor()).isEqualTo(DEFAULT_NOME_CORRETOR);
assertThat(testCorretor.getUsuario()).isEqualTo(DEFAULT_USUARIO);
assertThat(testCorretor.getDataNascimento()).isEqualTo(DEFAULT_DATA_NASCIMENTO);
assertThat(testCorretor.getFoto()).isEqualTo(DEFAULT_FOTO);
assertThat(testCorretor.getFotoContentType()).isEqualTo(DEFAULT_FOTO_CONTENT_TYPE);
assertThat(testCorretor.getTelefone()).isEqualTo(DEFAULT_TELEFONE);
}
@Test
@Transactional
void createCorretorWithExistingId() throws Exception {
// Create the Corretor with an existing ID
corretor.setId(1L);
int databaseSizeBeforeCreate = corretorRepository.findAll().size();
// An entity with an existing ID cannot be created, so this API call must fail
restCorretorMockMvc
.perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isBadRequest());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeCreate);
}
@Test
@Transactional
void checkNomeCorretorIsRequired() throws Exception {
int databaseSizeBeforeTest = corretorRepository.findAll().size();
// set the field null
corretor.setNomeCorretor(null);
// Create the Corretor, which fails.
restCorretorMockMvc
.perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isBadRequest());
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
void checkUsuarioIsRequired() throws Exception {
int databaseSizeBeforeTest = corretorRepository.findAll().size();
// set the field null
corretor.setUsuario(null);
// Create the Corretor, which fails.
restCorretorMockMvc
.perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isBadRequest());
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
void getAllCorretors() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
// Get all the corretorList
restCorretorMockMvc
.perform(get(ENTITY_API_URL + "?sort=id,desc"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(corretor.getId().intValue())))
.andExpect(jsonPath("$.[*].nomeCorretor").value(hasItem(DEFAULT_NOME_CORRETOR)))
.andExpect(jsonPath("$.[*].usuario").value(hasItem(DEFAULT_USUARIO)))
.andExpect(jsonPath("$.[*].dataNascimento").value(hasItem(DEFAULT_DATA_NASCIMENTO.toString())))
.andExpect(jsonPath("$.[*].fotoContentType").value(hasItem(DEFAULT_FOTO_CONTENT_TYPE)))
.andExpect(jsonPath("$.[*].foto").value(hasItem(Base64Utils.encodeToString(DEFAULT_FOTO))))
.andExpect(jsonPath("$.[*].telefone").value(hasItem(DEFAULT_TELEFONE)));
}
@Test
@Transactional
void getCorretor() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
// Get the corretor
restCorretorMockMvc
.perform(get(ENTITY_API_URL_ID, corretor.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.id").value(corretor.getId().intValue()))
.andExpect(jsonPath("$.nomeCorretor").value(DEFAULT_NOME_CORRETOR))
.andExpect(jsonPath("$.usuario").value(DEFAULT_USUARIO))
.andExpect(jsonPath("$.dataNascimento").value(DEFAULT_DATA_NASCIMENTO.toString()))
.andExpect(jsonPath("$.fotoContentType").value(DEFAULT_FOTO_CONTENT_TYPE))
.andExpect(jsonPath("$.foto").value(Base64Utils.encodeToString(DEFAULT_FOTO)))
.andExpect(jsonPath("$.telefone").value(DEFAULT_TELEFONE));
}
@Test
@Transactional
void getNonExistingCorretor() throws Exception {
// Get the corretor
restCorretorMockMvc.perform(get(ENTITY_API_URL_ID, Long.MAX_VALUE)).andExpect(status().isNotFound());
}
@Test
@Transactional
void putNewCorretor() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
// Update the corretor
Corretor updatedCorretor = corretorRepository.findById(corretor.getId()).get();
// Disconnect from session so that the updates on updatedCorretor are not directly saved in db
em.detach(updatedCorretor);
updatedCorretor
.nomeCorretor(UPDATED_NOME_CORRETOR)
.usuario(UPDATED_USUARIO)
.dataNascimento(UPDATED_DATA_NASCIMENTO)
.foto(UPDATED_FOTO)
.fotoContentType(UPDATED_FOTO_CONTENT_TYPE)
.telefone(UPDATED_TELEFONE);
restCorretorMockMvc
.perform(
put(ENTITY_API_URL_ID, updatedCorretor.getId())
.contentType(MediaType.APPLICATION_JSON)
.content(TestUtil.convertObjectToJsonBytes(updatedCorretor))
)
.andExpect(status().isOk());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
Corretor testCorretor = corretorList.get(corretorList.size() - 1);
assertThat(testCorretor.getNomeCorretor()).isEqualTo(UPDATED_NOME_CORRETOR);
assertThat(testCorretor.getUsuario()).isEqualTo(UPDATED_USUARIO);
assertThat(testCorretor.getDataNascimento()).isEqualTo(UPDATED_DATA_NASCIMENTO);
assertThat(testCorretor.getFoto()).isEqualTo(UPDATED_FOTO);
assertThat(testCorretor.getFotoContentType()).isEqualTo(UPDATED_FOTO_CONTENT_TYPE);
assertThat(testCorretor.getTelefone()).isEqualTo(UPDATED_TELEFONE);
}
@Test
@Transactional
void putNonExistingCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If the entity doesn't have an ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(
put(ENTITY_API_URL_ID, corretor.getId())
.contentType(MediaType.APPLICATION_JSON)
.content(TestUtil.convertObjectToJsonBytes(corretor))
)
.andExpect(status().isBadRequest());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void putWithIdMismatchCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If url ID doesn't match entity ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(
put(ENTITY_API_URL_ID, count.incrementAndGet())
.contentType(MediaType.APPLICATION_JSON)
.content(TestUtil.convertObjectToJsonBytes(corretor))
)
.andExpect(status().isBadRequest());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void putWithMissingIdPathParamCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If url ID doesn't match entity ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(put(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isMethodNotAllowed());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void partialUpdateCorretorWithPatch() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
// Update the corretor using partial update
Corretor partialUpdatedCorretor = new Corretor();
partialUpdatedCorretor.setId(corretor.getId());
partialUpdatedCorretor.nomeCorretor(UPDATED_NOME_CORRETOR).telefone(UPDATED_TELEFONE);
restCorretorMockMvc
.perform(
patch(ENTITY_API_URL_ID, partialUpdatedCorretor.getId())
.contentType("application/merge-patch+json")
.content(TestUtil.convertObjectToJsonBytes(partialUpdatedCorretor))
)
.andExpect(status().isOk());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
Corretor testCorretor = corretorList.get(corretorList.size() - 1);
assertThat(testCorretor.getNomeCorretor()).isEqualTo(UPDATED_NOME_CORRETOR);
assertThat(testCorretor.getUsuario()).isEqualTo(DEFAULT_USUARIO);
assertThat(testCorretor.getDataNascimento()).isEqualTo(DEFAULT_DATA_NASCIMENTO);
assertThat(testCorretor.getFoto()).isEqualTo(DEFAULT_FOTO);
assertThat(testCorretor.getFotoContentType()).isEqualTo(DEFAULT_FOTO_CONTENT_TYPE);
assertThat(testCorretor.getTelefone()).isEqualTo(UPDATED_TELEFONE);
}
@Test
@Transactional
void fullUpdateCorretorWithPatch() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
// Update the corretor using partial update
Corretor partialUpdatedCorretor = new Corretor();
partialUpdatedCorretor.setId(corretor.getId());
partialUpdatedCorretor
.nomeCorretor(UPDATED_NOME_CORRETOR)
.usuario(UPDATED_USUARIO)
.dataNascimento(UPDATED_DATA_NASCIMENTO)
.foto(UPDATED_FOTO)
.fotoContentType(UPDATED_FOTO_CONTENT_TYPE)
.telefone(UPDATED_TELEFONE);
restCorretorMockMvc
.perform(
patch(ENTITY_API_URL_ID, partialUpdatedCorretor.getId())
.contentType("application/merge-patch+json")
.content(TestUtil.convertObjectToJsonBytes(partialUpdatedCorretor))
)
.andExpect(status().isOk());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
Corretor testCorretor = corretorList.get(corretorList.size() - 1);
assertThat(testCorretor.getNomeCorretor()).isEqualTo(UPDATED_NOME_CORRETOR);
assertThat(testCorretor.getUsuario()).isEqualTo(UPDATED_USUARIO);
assertThat(testCorretor.getDataNascimento()).isEqualTo(UPDATED_DATA_NASCIMENTO);
assertThat(testCorretor.getFoto()).isEqualTo(UPDATED_FOTO);
assertThat(testCorretor.getFotoContentType()).isEqualTo(UPDATED_FOTO_CONTENT_TYPE);
assertThat(testCorretor.getTelefone()).isEqualTo(UPDATED_TELEFONE);
}
@Test
@Transactional
void patchNonExistingCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If the entity doesn't have an ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(
patch(ENTITY_API_URL_ID, corretor.getId())
.contentType("application/merge-patch+json")
.content(TestUtil.convertObjectToJsonBytes(corretor))
)
.andExpect(status().isBadRequest());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void patchWithIdMismatchCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If url ID doesn't match entity ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(
patch(ENTITY_API_URL_ID, count.incrementAndGet())
.contentType("application/merge-patch+json")
.content(TestUtil.convertObjectToJsonBytes(corretor))
)
.andExpect(status().isBadRequest());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void patchWithMissingIdPathParamCorretor() throws Exception {
int databaseSizeBeforeUpdate = corretorRepository.findAll().size();
corretor.setId(count.incrementAndGet());
// If url ID doesn't match entity ID, it will throw BadRequestAlertException
restCorretorMockMvc
.perform(patch(ENTITY_API_URL).contentType("application/merge-patch+json").content(TestUtil.convertObjectToJsonBytes(corretor)))
.andExpect(status().isMethodNotAllowed());
// Validate the Corretor in the database
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeUpdate);
}
@Test
@Transactional
void deleteCorretor() throws Exception {
// Initialize the database
corretorRepository.saveAndFlush(corretor);
int databaseSizeBeforeDelete = corretorRepository.findAll().size();
// Delete the corretor
restCorretorMockMvc
.perform(delete(ENTITY_API_URL_ID, corretor.getId()).accept(MediaType.APPLICATION_JSON))
.andExpect(status().isNoContent());
// Validate the database contains one less item
List<Corretor> corretorList = corretorRepository.findAll();
assertThat(corretorList).hasSize(databaseSizeBeforeDelete - 1);
}
}
|
[
"ayrtonhe@live.com"
] |
ayrtonhe@live.com
|
5bb15015dcc426d1c47c807d7191c672186e3a46
|
4fb9e38c4c0754edc330a1e563138061c8670b43
|
/kodilla-patterns2/src/main/java/com/kodilla/patterns2/observer/homework/Observer.java
|
9a04eda96144af0fdd774289c8dc75b341214036
|
[] |
no_license
|
piotr-michon/piotr-michon-kodilla-java
|
88b9ce5d0672b6d247be0d5622af176cdd2a3ada
|
ed31cb587183c235c6fa9949edf7ce57b15ab8c7
|
refs/heads/master
| 2020-04-18T22:34:51.042597
| 2019-09-25T22:23:18
| 2019-09-25T22:23:18
| 167,797,864
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 129
|
java
|
package com.kodilla.patterns2.observer.homework;
public interface Observer {
void update(StudentTaskList studentTaskList);
}
|
[
"piotr.michon01@gmail.com"
] |
piotr.michon01@gmail.com
|
4839702f751121dc40dd1dd66630d92b705a985c
|
3a4c510b8ac4601ebc36492986abf2ad0c775ad9
|
/SpringExample/src/main/java/com/class1/spring/MemberPrinter.java
|
58d61fa96e24998379949c10c24e18c4d1e8ffc3
|
[] |
no_license
|
seran-yoon/itwill_spring
|
6746661c8fb8a9ca8b65078bac5af1e998506033
|
72a2abfe2847bfa14a06b155b8a0d5310dab6b6b
|
refs/heads/master
| 2022-12-21T17:36:40.928873
| 2019-12-17T02:44:17
| 2019-12-17T02:44:17
| 228,190,774
| 0
| 0
| null | 2022-12-16T10:32:30
| 2019-12-15T13:41:55
|
Java
|
UTF-8
|
Java
| false
| false
| 315
|
java
|
package com.class1.spring;
public class MemberPrinter {
public void print(Member member) {
System.out.printf("회원정보 [ 아이디 : %d, 이메일 : %s, 이름 : %s, 등록일 : %tF ]\n", member.getId(), member.getEmail(), member.getName(), member.getRegisterDate()); //시간형태는 %tF
}
}
|
[
"user@user-pc"
] |
user@user-pc
|
3040f7c8a1931a367e843017abfd07604a9b739c
|
1074c97cdd65d38c8c6ec73bfa40fb9303337468
|
/rda0105-agl-aus-java-a43926f304e3/xms-dto/src/main/java/com/gms/xms/model/webship/ShipmentInfoModel.java
|
1086578889e2d75dc53125dfbe3105498071760f
|
[] |
no_license
|
gahlawat4u/repoName
|
0361859254766c371068e31ff7be94025c3e5ca8
|
523cf7d30018b7783e90db98e386245edad34cae
|
refs/heads/master
| 2020-05-17T01:26:00.968575
| 2019-04-29T06:11:52
| 2019-04-29T06:11:52
| 183,420,568
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,959
|
java
|
package com.gms.xms.model.webship;
import java.util.List;
/**
* Posted from ShipmentRequestModel
* <p>
* Author HungNT Date Apr 15, 2015
*/
public class ShipmentInfoModel extends ShipmentModel {
private static final long serialVersionUID = -3045561409115987472L;
private AddressModel senderAddress;
private AddressModel receiverAddress;
private String serviceId;
private String shipmentTypeId;
private String contentType;
private String currency;
private List<PieceModel> pieces;
private String bound;
private String isAddPiece;
private String residentialDelivery;
private String residentialPickup;
private List<ServiceAddConModel> addCons;
private String shipperAccount;
private String shipperReference;
private String totalWeight;
private String weightType;
private String selContents;
private List<PieceModel> shipmentRequestPieces;
private String dhInterAccout;
private String dutiesBillTo;
private String dutiesAccount;
private String billingParty;
private String specialDelivery;
private String isSaveSenderAddressBook;
private String isSaveRecipientAddressBook;
private String insuranceUserAmount;
private String packageId;
private String errorMsg;
private String defaultCarrierType;
private String defaultServiceType;
private String defaultPackageType;
public String getIsSaveSenderAddressBook() {
return isSaveSenderAddressBook;
}
public void setIsSaveSenderAddressBook(String isSaveSenderAddressBook) {
this.isSaveSenderAddressBook = isSaveSenderAddressBook;
}
public String getIsSaveRecipientAddressBook() {
return isSaveRecipientAddressBook;
}
public void setIsSaveRecipientAddressBook(String isSaveRecipientAddressBook) {
this.isSaveRecipientAddressBook = isSaveRecipientAddressBook;
}
public String getSpecialDelivery() {
return specialDelivery;
}
public void setSpecialDelivery(String specialDelivery) {
this.specialDelivery = specialDelivery;
}
public String getBillingParty() {
return billingParty;
}
public void setBillingParty(String billingParty) {
this.billingParty = billingParty;
}
public String getDhInterAccout() {
return dhInterAccout;
}
public void setDhInterAccout(String dhInterAccout) {
this.dhInterAccout = dhInterAccout;
}
public String getDutiesBillTo() {
return dutiesBillTo;
}
public void setDutiesBillTo(String dutiesBillTo) {
this.dutiesBillTo = dutiesBillTo;
}
@Override
public String getDutiesAccount() {
return dutiesAccount;
}
@Override
public void setDutiesAccount(String dutiesAccount) {
this.dutiesAccount = dutiesAccount;
}
public AddressModel getSenderAddress() {
return senderAddress;
}
public void setSenderAddress(AddressModel senderAddress) {
this.senderAddress = senderAddress;
}
public AddressModel getReceiverAddress() {
return receiverAddress;
}
public void setReceiverAddress(AddressModel receiverAddress) {
this.receiverAddress = receiverAddress;
}
public String getServiceId() {
return serviceId;
}
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
@Override
public String getShipmentTypeId() {
return shipmentTypeId;
}
@Override
public void setShipmentTypeId(String shipmentTypeId) {
this.shipmentTypeId = shipmentTypeId;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public List<PieceModel> getPieces() {
return pieces;
}
public void setPieces(List<PieceModel> pieces) {
this.pieces = pieces;
}
public String getBound() {
return bound;
}
public void setBound(String bound) {
this.bound = bound;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public String getIsAddPiece() {
return isAddPiece;
}
public void setIsAddPiece(String isAddPiece) {
this.isAddPiece = isAddPiece;
}
public String getResidentialDelivery() {
return residentialDelivery;
}
public void setResidentialDelivery(String residentialDelivery) {
this.residentialDelivery = residentialDelivery;
}
public String getResidentialPickup() {
return residentialPickup;
}
public void setResidentialPickup(String residentialPickup) {
this.residentialPickup = residentialPickup;
}
public List<ServiceAddConModel> getAddCons() {
return addCons;
}
public void setAddCons(List<ServiceAddConModel> addCons) {
this.addCons = addCons;
}
public String getShipperAccount() {
return shipperAccount;
}
public void setShipperAccount(String shipperAccount) {
this.shipperAccount = shipperAccount;
}
public String getShipperReference() {
return shipperReference;
}
public void setShipperReference(String shipperReference) {
this.shipperReference = shipperReference;
}
public String getTotalWeight() {
return totalWeight;
}
public void setTotalWeight(String totalWeight) {
this.totalWeight = totalWeight;
}
public String getWeightType() {
return weightType;
}
public void setWeightType(String weightType) {
this.weightType = weightType;
}
public String getSelContents() {
return selContents;
}
public void setSelContents(String selContents) {
this.selContents = selContents;
}
public List<PieceModel> getShipmentRequestPieces() {
return shipmentRequestPieces;
}
public void setShipmentRequestPieces(List<PieceModel> shipmentRequestPieces) {
this.shipmentRequestPieces = shipmentRequestPieces;
}
@Override
public String toString() {
return "ShipmentInfoModel [senderAddress=" + senderAddress + ", receiverAddress=" + receiverAddress
+ ", serviceId=" + serviceId + ", shipmentTypeId=" + shipmentTypeId + ", contentType=" + contentType
+ ", currency=" + currency + ", pieces=" + pieces + ", bound=" + bound + ", isAddPiece=" + isAddPiece
+ ", residentialDelivery=" + residentialDelivery + ", residentialPickup=" + residentialPickup
+ ", addCons=" + addCons + ", shipperAccount=" + shipperAccount + ", shipperReference="
+ shipperReference + ", totalWeight=" + totalWeight + ", weightType=" + weightType + ", selContents="
+ selContents + ", shipmentRequestPieces=" + shipmentRequestPieces + ", dhInterAccout=" + dhInterAccout
+ ", dutiesBillTo=" + dutiesBillTo + ", dutiesAccount=" + dutiesAccount + ", billingParty="
+ billingParty + ", specialDelivery=" + specialDelivery + ", isSaveSenderAddressBook="
+ isSaveSenderAddressBook + ", isSaveRecipientAddressBook=" + isSaveRecipientAddressBook
+ ", insuranceUserAmount=" + insuranceUserAmount + ", packageId=" + packageId
+ ", errorMsg=" + errorMsg + ", defaultCarrierType=" + defaultCarrierType + ", defaultServiceType="
+ defaultServiceType + ", defaultPackageType=" + defaultPackageType + "]";
}
public String getDefaultServiceType() {
return defaultServiceType;
}
public void setDefaultServiceType(String defaultServiceType) {
this.defaultServiceType = defaultServiceType;
}
public String getDefaultPackageType() {
return defaultPackageType;
}
public void setDefaultPackageType(String defaultPackageType) {
this.defaultPackageType = defaultPackageType;
}
public String getDefaultCarrierType() {
return defaultCarrierType;
}
public void setDefaultCarrierType(String defaultCarrierType) {
this.defaultCarrierType = defaultCarrierType;
}
public String getInsuranceUserAmount() {
return insuranceUserAmount;
}
public void setInsuranceUserAmount(String insuranceUserAmount) {
this.insuranceUserAmount = insuranceUserAmount;
}
@Override
public String getPackageId() {
return packageId;
}
@Override
public void setPackageId(String packageId) {
this.packageId = packageId;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
|
[
"sachin.gahlawat19@gmail.com"
] |
sachin.gahlawat19@gmail.com
|
4800a33357516af098a35e25411ae33aacc562da
|
c50f6aeb7e0c96a9607550df8c0c81fe5228b621
|
/nettydo/src/main/java/com/longdatech/nettydo/timepojoexample/TimeClient.java
|
b18863c5eb95f22d59b9275ff61ca29ff690a3f0
|
[] |
no_license
|
LongYil/springbootdo
|
7514dacfff6e6917d1dcd53f41c2844f7959b794
|
fafdbceca303aac67325b2d4575cc171ff9a3a17
|
refs/heads/master
| 2022-11-21T06:48:01.397642
| 2019-10-26T02:48:23
| 2019-10-26T02:48:23
| 209,526,771
| 0
| 0
| null | 2022-11-16T12:25:29
| 2019-09-19T10:35:04
|
Java
|
UTF-8
|
Java
| false
| false
| 1,481
|
java
|
package com.longdatech.nettydo.timepojoexample;
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;
public class TimeClient {
public static void main(String[] args) throws Exception {
// String host = args[0];
// int port = Integer.parseInt(args[1]);
String host = "localhost";
int port = 8088;
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
Bootstrap b = new Bootstrap(); // (1)
b.group(workerGroup); // (2)
b.channel(NioSocketChannel.class); // (3)
b.option(ChannelOption.SO_KEEPALIVE, true); // (4)
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ch.pipeline().addLast(new TimeDecoder(), new TimeClientHandler());
}
});
// Start the client.
ChannelFuture f = b.connect(host, port).sync(); // (5)
// Wait until the connection is closed.
f.channel().closeFuture().sync();
} finally {
workerGroup.shutdownGracefully();
}
}
}
|
[
"18312884980@163.com"
] |
18312884980@163.com
|
722c9ad0a1b67aaddba85533932a61a0c4614399
|
303846530a495f13fa557240f05f3761f0e9c583
|
/Choose_Your_Social_Network/src/Modelo/DetalleRedes.java
|
cf23bdd9216e16bbef68ae1fe16916a63ffc0f46
|
[] |
no_license
|
CesarsEren/Choose-Your-Social-Network
|
ac463ef57ddc99fa70f0525807d49ee7d58a9c29
|
2ec33f974c629351bf5856c8c1218d024c09a367
|
refs/heads/master
| 2020-04-03T01:22:17.651050
| 2018-10-27T08:36:46
| 2018-10-27T08:36:46
| 154,928,564
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 830
|
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 Modelo;
import java.io.Serializable;
/**
*
* @author cesars
*/
public class DetalleRedes implements Serializable{
int idCliente;
RedesSociales redes;
public DetalleRedes() {
}
public DetalleRedes(int idCliente, RedesSociales redes) {
this.idCliente = idCliente;
this.redes = redes;
}
public int getIdCliente() {
return idCliente;
}
public RedesSociales getRedes() {
return redes;
}
public void setIdCliente(int idCliente) {
this.idCliente = idCliente;
}
public void setRedes(RedesSociales redes) {
this.redes = redes;
}
}
|
[
"cpinedo428@gmail.com"
] |
cpinedo428@gmail.com
|
7ac21c240ef61653bc9bd0c6005655e8a58d4aee
|
339ecf78a2266e3aa4eaf09ef8ea5654faad021b
|
/Person/src/myjava/exercises/Person.java
|
6ebf4ed05f24790e15f0b81ec8e8c17ddbc4541a
|
[] |
no_license
|
Eldraea/Exercises_in_Java
|
4935de0f6e88d0b99f175df90a546dd4ed03f3ee
|
089feba7bafea86eecec8eeecc25684adb9dca60
|
refs/heads/main
| 2023-05-31T15:13:32.184795
| 2021-07-08T17:38:36
| 2021-07-08T17:38:36
| 369,454,014
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,820
|
java
|
/*
Person.java
------------------------------------------------------------------------------------------------------------------------
Created by Eld@e@
------------------------------------------------------------------------------------------------------------------------
The Person class
------------------------------------------------------------------------------------------------------------------------
Created on: 25/05/2021
------------------------------------------------------------------------------------------------------------------------
Last Update on: 25/05/2021
------------------------------------------------------------------------------------------------------------------------
*/
package myjava.exercises;
public class Person {
private String firstName;
private String lastName;
private int age;
public String getFirstName()
{
return this.firstName;
}
public String getLastName()
{
return this.lastName;
}
public int getAge()
{
return this.age;
}
public void setFirstName(String name)
{
this.firstName = name;
}
public void setLastName(String name)
{
this.lastName = name;
}
public void setAge(int age)
{
if(age < 0 || age > 100)
this.age = 0;
else
this.age = age;
}
public boolean isTeen()
{
return (this.age >12 && this.age <20);
}
public String getFullName()
{
if(firstName.isEmpty() && lastName.isEmpty())
return "";
else if(firstName.isEmpty() && !lastName.isEmpty())
return lastName;
else if(!firstName.isEmpty() && lastName.isEmpty())
return firstName;
else
return firstName + " " + lastName;
}
}
|
[
"kjacques709@gmail.com"
] |
kjacques709@gmail.com
|
50b52cc07510acc48feef010fe0f168231beca98
|
af79916025156e3d0cf4986b126fbe7f059753e2
|
/web/dx/renshi/src/main/java/com/renshi/entity/job/JobOrder.java
|
ec7468f110c5b4c65b1d78cd789aa8c93fe0607f
|
[] |
no_license
|
Letmebeawinner/yywt
|
5380680fadb7fc0d4c86fb92234f7c69cb216010
|
254fa0f54c09300d4bdcdf8617d97d75003536bd
|
refs/heads/master
| 2022-12-26T06:17:11.755486
| 2020-02-14T10:04:29
| 2020-02-14T10:04:29
| 240,468,510
| 0
| 0
| null | 2022-12-16T11:36:21
| 2020-02-14T09:08:31
|
Roff
|
UTF-8
|
Java
| false
| false
| 338
|
java
|
package com.renshi.entity.job;
import com.a_268.base.core.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 干部类
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class JobOrder extends BaseEntity{
private static final long serialVersionUID = -6034634689029517111L;
private String name;//序列名称
}
|
[
"448397385@qq.com"
] |
448397385@qq.com
|
01438b6a510e6aa34c4996e6b425bed0d50600c4
|
4a6cf71d0253f8323b9e209a92f6aa4cda6e9984
|
/src/scenario/events/ReportedEvent.java
|
49803b7b0b70fc92f2d1ba658ab26c342f5dec10
|
[] |
no_license
|
technophil98/AMNAM
|
67d6e49d3bdcbf4b358520fee1a3a623da4c599f
|
d8068e9cce75b8316b7fc47c01247bbdd74afa8d
|
refs/heads/master
| 2021-05-09T19:21:33.186594
| 2018-02-23T14:42:52
| 2018-02-23T14:42:52
| 118,640,119
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,334
|
java
|
package scenario.events;
import math.Vecteur;
/**
* Un ReportedEvent est un condensé de {@link VehicleEvent} prenant la moyenne de la position et le premier temps de détection comme valeur de référence.
*
* @author Philippe Rivest
*/
public class ReportedEvent {
private double timestamp;
private Vecteur position;
private EventType type;
/**
* Instancies un nouveau ReportedEvent.
*
* @param vehicleEvent le {@link VehicleEvent} sur lequel se base l'instance
*/
public ReportedEvent(VehicleEvent vehicleEvent) {
this.timestamp = vehicleEvent.getFirstTimestamp();
this.position = vehicleEvent.getPosition();
this.type = vehicleEvent.getEventType();
}
/**
* Retourne le temps de détection.
*
* @return le temps de détection
*/
public double getTimestamp() {
return timestamp;
}
/**
* Mets à jour le temps de détection.
*
* @param timestamp le temps de détection
*/
public void setTimestamp(double timestamp) {
this.timestamp = timestamp;
}
/**
* Retourne la position de l'évènement c'est-à-dire la moyenne des sous-évènements.
*
* @return la position de l'évènement
*/
public Vecteur getPosition() {
return position;
}
/**
* Mets à jour la position de l'évènement.
*
* @param position la position de l'évènement
*/
public void setPosition(Vecteur position) {
this.position = position;
}
/**
* Retourne le type de l'évènement.
*
* @return le type de l'évènement
*/
public EventType getType() {
return type;
}
/**
* Mets à jour le type de l'évènement.
*
* @param type le type de l'évènement
*/
public void setType(EventType type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof ReportedEvent))
return false;
ReportedEvent that = (ReportedEvent) o;
if (Double.compare(that.getTimestamp(), getTimestamp()) != 0)
return false;
if (!getPosition().equals(that.getPosition()))
return false;
return getType() == that.getType();
}
@Override
public int hashCode() {
int result;
long temp;
temp = Double.doubleToLongBits(getTimestamp());
result = (int) (temp ^ (temp >>> 32));
result = 31 * result + getPosition().hashCode();
result = 31 * result + getType().hashCode();
return result;
}
}
|
[
"technophil98@gmail.com"
] |
technophil98@gmail.com
|
932d2d4b1ac8f14fa148a71a30eeba9d17d4254c
|
a645cdd1c929bc0b9c41f5cd04b9a0e8a93f9b2e
|
/PROMO_STT_v3/src/A_Ventas/CapaVisual/A_SeleccionBase.java
|
a28f91870381b96aa315c8a483aeb7336982124a
|
[] |
no_license
|
dxbxa/PROMO_STT_v20
|
75141aca7f521835b430492347720ebaf45b17ae
|
07b36651cf1bd46ab7b5381271a7fadec16d6a5e
|
refs/heads/master
| 2021-01-18T13:47:24.023288
| 2013-10-09T17:41:42
| 2013-10-09T17:41:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,949
|
java
|
package A_Ventas.CapaVisual;
import java.awt.GraphicsEnvironment;
import javax.swing.RowSorter;
import javax.swing.RowSorter.SortKey;
import javax.swing.table.TableRowSorter;
import javax.swing.table.TableModel;
import java.util.*;
public class A_SeleccionBase extends javax.swing.JFrame {
private A_GestorVisual objGestorV;
private List<? extends RowSorter.SortKey> sortKeys;
private TableRowSorter<TableModel> sorter;
private int seleccion;
public A_SeleccionBase(A_GestorVisual pobjGestorV) {
objGestorV=pobjGestorV;
initComponents();
jScrollPane2.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
GraphicsEnvironment env =GraphicsEnvironment.getLocalGraphicsEnvironment();
this.setMaximizedBounds(env.getMaximumWindowBounds());
this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
llenaDatosLista();
}
public void llenaDatosLista(){
try{
String[] encabezadoA={"CEDULA","NOMBRE","BASE","PLAN","METAL","LIMITE","VENCIMIENTO","PROMESA GENERAL","FECHA PROMESA","ESTATUS"};
String[][] contenidoA;
contenidoA=objGestorV.getBaseAsesor();
tblSeleccionBase.setModel(new javax.swing.table.DefaultTableModel(contenidoA,encabezadoA));
tblSeleccionBase.getColumnModel().getColumn(0).setPreferredWidth(100);
tblSeleccionBase.getColumnModel().getColumn(1).setPreferredWidth(250);
tblSeleccionBase.getColumnModel().getColumn(2).setPreferredWidth(100);
tblSeleccionBase.getColumnModel().getColumn(3).setPreferredWidth(100);
tblSeleccionBase.getColumnModel().getColumn(4).setPreferredWidth(350);
tblSeleccionBase.getColumnModel().getColumn(5).setPreferredWidth(100);
tblSeleccionBase.getColumnModel().getColumn(6).setPreferredWidth(100);
tblSeleccionBase.getColumnModel().getColumn(7).setPreferredWidth(250);
tblSeleccionBase.getColumnModel().getColumn(8).setPreferredWidth(150);
tblSeleccionBase.getColumnModel().getColumn(9).setPreferredWidth(100);
try{
System.out.println("INTENTO DE ORDEN");
sorter.setSortKeys(sortKeys);
tblSeleccionBase.setRowSorter(sorter);
tblSeleccionBase.setRowSelectionInterval(seleccion, seleccion);
//tblSeleccionBase.setAutoCreateRowSorter(true);
}catch(Exception ex){
System.out.println("error poniendo orden******************************************"+ex);
}
}catch(Exception ex){
System.out.println("objGestorV.getDatosAuditarPPT:"+ex);
}
}
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
tblSeleccionBase = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jScrollPane2.setPreferredSize(new java.awt.Dimension(10, 10));
tblSeleccionBase.setAutoCreateRowSorter(true);
tblSeleccionBase.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null},
{null, null}
},
new String [] {
"Title 1", "Title 2"
}
));
tblSeleccionBase.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
tblSeleccionBase.setPreferredSize(new java.awt.Dimension(1350, 40000));
jScrollPane2.setViewportView(tblSeleccionBase);
jButton2.setText("Regresar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton4.setText("Consultar");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel1.setText("CARTERA DE CLIENTES");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(70, 70, 70)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(111, 111, 111))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(580, Short.MAX_VALUE)
.addComponent(jLabel1)
.addContainerGap(584, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(42, 42, 42)
.addComponent(jLabel1)
.addGap(38, 38, 38)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 529, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton4))
.addGap(47, 47, 47))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
objGestorV.btn_Regresar_a_Menu(this,2);
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
try{
sorter = new TableRowSorter<TableModel>(tblSeleccionBase.getModel());
sortKeys = tblSeleccionBase.getRowSorter().getSortKeys();
seleccion= tblSeleccionBase.getSelectedRow();
}catch(Exception ex){
System.out.println("Row sorter"+ex);
}
try{
int indice=tblSeleccionBase.getSelectedRow();
String cedula = tblSeleccionBase.getValueAt(indice, 0).toString();
objGestorV.btn_BuscarsELECCION(1, cedula);
}catch(Exception ex){
System.out.println(ex);
}
}//GEN-LAST:event_jButton4ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable tblSeleccionBase;
// End of variables declaration//GEN-END:variables
}
|
[
"dxbxa@hotmail.com"
] |
dxbxa@hotmail.com
|
af1b5852d2243549af5ef93ad64ded81b68d8428
|
6ac18c84c2ec8cda17b1dce4b5f872595c74d177
|
/src/day43_MethodOverriding/Square.java
|
2cb03df938508a45e84b42433f4ee0ae9b1a6af2
|
[] |
no_license
|
Kguler6542/Spring2020B18_Java
|
00b87be7dad8605cc2c87a0e35d53ebadda0af71
|
dbe35b30cd12e2987985b2e1013c75fbb040a38a
|
refs/heads/master
| 2023-04-05T06:18:22.357685
| 2021-04-12T14:47:45
| 2021-04-12T14:47:45
| 271,661,482
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 424
|
java
|
package day43_MethodOverriding;
public class Square extends Shape {
public double side;
public Square (double side){
this.side=side;
}
public void calculateArea(){
area=side*side;
System.out.println( "Area of the square: "+area );
}
public void calculatePerimeter(){
perimeter=side*4;
System.out.println( "Perimeter of the square: "+perimeter );
}
}
|
[
"Kamuranguler2017@gmail.com"
] |
Kamuranguler2017@gmail.com
|
f6203270f22e2835d02bfe509a14cf3131c85b29
|
46f3a8d35d1104ef0a27c65c29a334bf041e67bd
|
/Java/src/main/java/https/CertificateManager.java
|
bc355b978e3f27d4d666786076997ca225704dcc
|
[] |
no_license
|
aiwangzhe/ThinkInJava
|
890aaed0c687615dea062f14a2845942d06f6700
|
0a543938fe6e77fdf67eb561789176b0bf65dae3
|
refs/heads/master
| 2022-10-26T05:05:49.762803
| 2021-10-14T06:43:42
| 2021-10-14T06:43:42
| 158,987,967
| 0
| 0
| null | 2022-10-04T23:56:53
| 2018-11-25T01:32:04
|
Java
|
UTF-8
|
Java
| false
| false
| 9,965
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package https;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import utils.ShellCommandUtil;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.text.MessageFormat;
import java.util.Map;
/**
* Ambari security.
* Manages server and agent certificates
*/
public class CertificateManager {
Configuration configs = new Configuration();
private static final Logger LOG = LoggerFactory.getLogger(CertificateManager.class);
private static final String GEN_SRVR_KEY = "openssl genrsa -des3 " +
"-passout pass:{0} -out {1}" + File.separator + "{2} 4096 ";
private static final String GEN_SRVR_REQ = "openssl req -passin pass:{0} " +
"-new -key {1}" + File.separator + "{2} -out {1}" + File.separator + "{5} -batch";
private static final String SIGN_SRVR_CRT = "openssl ca -create_serial " +
"-out {1}" + File.separator + "{3} -days 365 -keyfile {1}" + File.separator + "{2} -key {0} -selfsign " +
"-extensions jdk8_ca -config {1}" + File.separator + "ca.config -batch " +
"-infiles {1}" + File.separator + "{5}";
private static final String EXPRT_KSTR = "openssl pkcs12 -export" +
" -in {1}" + File.separator + "{3} -inkey {1}" + File.separator + "{2} -certfile {1}" + File.separator + "{3} -out {1}" + File.separator + "{4} " +
"-password pass:{0} -passin pass:{0} \n";
private static final String REVOKE_AGENT_CRT = "openssl ca " +
"-config {0}" + File.separator + "ca.config -keyfile {0}" + File.separator + "{4} -revoke {0}" + File.separator + "{2} -batch " +
"-passin pass:{3} -cert {0}" + File.separator + "{5}";
private static final String SIGN_AGENT_CRT = "openssl ca -config " +
"{0}" + File.separator + "ca.config -in {0}" + File.separator + "{1} -out {0}" + File.separator + "{2} -batch -passin pass:{3} " +
"-keyfile {0}" + File.separator + "{4} -cert {0}" + File.separator + "{5}"; /**
* Verify that root certificate exists, generate it otherwise.
*/
public void initRootCert() {
LOG.info("Initialization of root certificate");
boolean certExists = isCertExists();
LOG.info("Certificate exists:" + certExists);
if (!certExists) {
generateServerCertificate();
}
}
/**
* Checks root certificate state.
* @return "true" if certificate exists
*/
private boolean isCertExists() {
Map<String, String> configsMap = configs.getConfigsMap();
String srvrKstrDir = configsMap.get(Configuration.SRVR_KSTR_DIR_KEY);
String srvrCrtName = configsMap.get(Configuration.SRVR_CRT_NAME_KEY);
File certFile = new File(srvrKstrDir + File.separator + srvrCrtName);
LOG.debug("srvrKstrDir = " + srvrKstrDir);
LOG.debug("srvrCrtName = " + srvrCrtName);
LOG.debug("certFile = " + certFile.getAbsolutePath());
return certFile.exists();
}
/**
* Runs os command
*
* @return command execution exit code
*/
private int runCommand(String command) {
String line = null;
Process process = null;
BufferedReader br= null;
try {
process = Runtime.getRuntime().exec(command);
br = new BufferedReader(new InputStreamReader(
process.getInputStream(), Charset.forName("UTF8")));
while ((line = br.readLine()) != null) {
LOG.info(line);
}
try {
process.waitFor();
ShellCommandUtil.logOpenSslExitCode(command, process.exitValue());
return process.exitValue(); //command is executed
} catch (InterruptedException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
return -1;//some exception occurred
}
private void generateServerCertificate() {
LOG.info("Generation of server certificate");
Map<String, String> configsMap = configs.getConfigsMap();
String srvrKstrDir = configsMap.get(Configuration.SRVR_KSTR_DIR_KEY);
LOG.info("srvrKstrDir: " + srvrKstrDir);
String srvrCrtName = configsMap.get(Configuration.SRVR_CRT_NAME_KEY);
LOG.info("srvrCrtName: " + srvrCrtName);
String srvrCsrName = configsMap.get(Configuration.SRVR_CSR_NAME_KEY);
LOG.info("srvrCsrName: " + srvrCsrName);
String srvrKeyName = configsMap.get(Configuration.SRVR_KEY_NAME_KEY);
LOG.info("srvrKeyName: " + srvrKeyName);
String kstrName = configsMap.get(Configuration.KSTR_NAME_KEY);
LOG.info("kstrName: " + kstrName);
String srvrCrtPass = configsMap.get(Configuration.SRVR_CRT_PASS_KEY);
LOG.info("srvrCrtPass: " + srvrCrtPass);
Object[] scriptArgs = {srvrCrtPass, srvrKstrDir, srvrKeyName,
srvrCrtName, kstrName, srvrCsrName};
String command = MessageFormat.format(GEN_SRVR_KEY,scriptArgs);
runCommand(command);
command = MessageFormat.format(GEN_SRVR_REQ,scriptArgs);
runCommand(command);
command = MessageFormat.format(SIGN_SRVR_CRT,scriptArgs);
runCommand(command);
command = MessageFormat.format(EXPRT_KSTR,scriptArgs);
runCommand(command);
}
/**
* Returns server certificate content
* @return string with server certificate content
*/
public String getServerCert() {
Map<String, String> configsMap = configs.getConfigsMap();
File certFile = new File(configsMap.get(Configuration.SRVR_KSTR_DIR_KEY) +
File.separator + configsMap.get(Configuration.SRVR_CRT_NAME_KEY));
String srvrCrtContent = null;
try {
srvrCrtContent = FileUtils.readFileToString(certFile);
} catch (IOException e) {
LOG.error(e.getMessage());
}
return srvrCrtContent;
}
/**
* Signs agent certificate
* Adds agent certificate to server keystore
* @return string with agent signed certificate content
*/
public synchronized SignCertResponse signAgentCrt(String agentHostname, String agentCrtReqContent, String passphraseAgent) {
SignCertResponse response = new SignCertResponse();
LOG.info("Signing of agent certificate");
LOG.info("Verifying passphrase");
String passphraseSrvr = configs.getConfigsMap().get(Configuration.
PASSPHRASE_KEY).trim();
if (!passphraseSrvr.equals(passphraseAgent.trim())) {
LOG.warn("Incorrect passphrase from the agent");
response.setResult(SignCertResponse.ERROR_STATUS);
response.setMessage("Incorrect passphrase from the agent");
return response;
}
Map<String, String> configsMap = configs.getConfigsMap();
String srvrKstrDir = configsMap.get(Configuration.SRVR_KSTR_DIR_KEY);
String srvrCrtPass = configsMap.get(Configuration.SRVR_CRT_PASS_KEY);
String srvrCrtName = configsMap.get(Configuration.SRVR_CRT_NAME_KEY);
String srvrKeyName = configsMap.get(Configuration.SRVR_KEY_NAME_KEY);
String agentCrtReqName = agentHostname + ".csr";
String agentCrtName = agentHostname + ".crt";
Object[] scriptArgs = {srvrKstrDir, agentCrtReqName, agentCrtName,
srvrCrtPass, srvrKeyName, srvrCrtName};
//Revoke previous agent certificate if exists
File agentCrtFile = new File(srvrKstrDir + File.separator + agentCrtName);
if (agentCrtFile.exists()) {
LOG.info("Revoking of " + agentHostname + " certificate.");
String command = MessageFormat.format(REVOKE_AGENT_CRT, scriptArgs);
int commandExitCode = runCommand(command);
if (commandExitCode != 0) {
response.setResult(SignCertResponse.ERROR_STATUS);
response.setMessage(ShellCommandUtil.getOpenSslCommandResult(command, commandExitCode));
return response;
}
}
File agentCrtReqFile = new File(srvrKstrDir + File.separator +
agentCrtReqName);
try {
FileUtils.writeStringToFile(agentCrtReqFile, agentCrtReqContent);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String command = MessageFormat.format(SIGN_AGENT_CRT, scriptArgs);
LOG.debug(ShellCommandUtil.hideOpenSslPassword(command));
int commandExitCode = runCommand(command); // ssl command execution
if (commandExitCode != 0) {
response.setResult(SignCertResponse.ERROR_STATUS);
response.setMessage(ShellCommandUtil.getOpenSslCommandResult(command, commandExitCode));
//LOG.warn(ShellCommandUtil.getOpenSslCommandResult(command, commandExitCode));
return response;
}
String agentCrtContent = "";
try {
agentCrtContent = FileUtils.readFileToString(agentCrtFile);
} catch (IOException e) {
e.printStackTrace();
LOG.error("Error reading signed agent certificate");
response.setResult(SignCertResponse.ERROR_STATUS);
response.setMessage("Error reading signed agent certificate");
return response;
}
response.setResult(SignCertResponse.OK_STATUS);
response.setSignedCa(agentCrtContent);
//LOG.info(ShellCommandUtil.getOpenSslCommandResult(command, commandExitCode));
return response;
}
}
|
[
"wangzw21@lenovo.com"
] |
wangzw21@lenovo.com
|
5ff0ba2590ff425634d7f0af1db1e671fbaf57c6
|
e1742b978e955ebe5725fa1c2f7d765cdbf58e52
|
/springmvc-annotation/src/main/java/com/zxh/config/RootConfig.java
|
899f3dea736082580a44719cea95629e96b194f9
|
[] |
no_license
|
ZHI-XINHUA/spring-knowledge
|
c3ff0685e90bb2dda06a29b54d296c407bb1a291
|
6b0f3975e34f7674aac55065f4bf0cc45bf1b33f
|
refs/heads/master
| 2022-12-20T10:41:34.793247
| 2020-02-06T01:54:50
| 2020-02-06T01:54:50
| 176,202,567
| 0
| 0
| null | 2022-12-16T08:47:56
| 2019-03-18T04:09:02
|
Java
|
UTF-8
|
Java
| false
| false
| 398
|
java
|
package com.zxh.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
/**
* 不扫描controller
*/
@ComponentScan(value = "com.zxh",excludeFilters = {
@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class})
})
public class RootConfig {
}
|
[
"1960881192@qq.com"
] |
1960881192@qq.com
|
b33fb801a6f508bdcd86521dbbabdc2ec5fb0f2a
|
d1fb3274f0ea046f69ab5cc6d2f7a08de882c9f6
|
/src/lab3/EmptyQueueException.java
|
6b69970054b5aebae3830aed6846946a3b879999
|
[] |
no_license
|
jscanning/CS240-LABS
|
a06f5fe8e72847cefefeff960f2dde9a1987bdec
|
b0ffb9e03fc0da8afd93dbd93691ccbc17321c14
|
refs/heads/master
| 2021-01-22T04:33:39.957782
| 2017-03-13T07:14:44
| 2017-03-13T07:14:44
| 81,555,560
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 356
|
java
|
package lab3;
public class EmptyQueueException extends RuntimeException
{
/**
*
*/
private static final long serialVersionUID = -8715338676573611704L;
public EmptyQueueException()
{
this(null);
} // end default constructor
public EmptyQueueException(String message)
{
super(message);
} // end constructor
} // end EmptyQueueException
|
[
"jscanning@cpp.edu"
] |
jscanning@cpp.edu
|
741a4c9bcfe79998e2805371ea565271524013a6
|
825b8269d60a91d31ccacdc8ec5dd36f4834989b
|
/src/main/java/com/dcn/aaserver/config/DIConfig.java
|
76302577f763a0436835344bd2cff8188f223bc5
|
[] |
no_license
|
doanhcongnguyen/aaserver
|
fc2d001bb15e2e87696042c39de4b39db66c67ca
|
44b7add86a6c93bcfb881aa6105728d014764baa
|
refs/heads/master
| 2021-07-08T17:28:28.132421
| 2021-04-06T06:57:02
| 2021-04-06T06:57:02
| 238,420,264
| 0
| 0
| null | 2020-09-03T09:56:08
| 2020-02-05T10:09:26
|
Java
|
UTF-8
|
Java
| false
| false
| 1,841
|
java
|
package com.dcn.aaserver.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import org.springframework.core.env.Environment;
@Configuration
public class DIConfig {
@Autowired
private Environment env;
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public TokenStore tokenStore() {
return new JwtTokenStore(accessTokenConverter());
}
@Bean
public JwtAccessTokenConverter accessTokenConverter() {
final JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
converter.setSigningKey(env.getProperty("token.converter.signing-key"));
return converter;
}
@Bean
public TokenEnhancer tokenEnhancer() {
return new CustomTokenEnhancer();
}
@Bean
@Primary
public DefaultTokenServices tokenServices() {
final DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore());
defaultTokenServices.setSupportRefreshToken(true);
return defaultTokenServices;
}
}
|
[
"doanh.nguyen@dzsi.com"
] |
doanh.nguyen@dzsi.com
|
6a78e455e62dd7a8122d91362fb1543c8050e12d
|
80373d3dd37cb3c9cd7f311c3375f2739e2dee8f
|
/Lote 02 - Sistemas/Transito/src/Estatistica2015.java
|
a605b50241166dc9d25812796e3ade5e3f1f60eb
|
[] |
no_license
|
william-carvalho12/logicadeprogramacao
|
6e1be42fa8f74e15df91157ed6ec04868fb451d9
|
df65e59eca27fe0c6fbd1d9076dc335fb9ae806c
|
refs/heads/master
| 2020-03-30T08:22:53.742444
| 2019-07-10T01:58:07
| 2019-07-10T01:58:07
| 151,010,561
| 1
| 1
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 1,806
|
java
|
public class Estatistica2015 {
/*
* .Cod Cidade : Nome Cidade : QTD Acidentes : Tipo Veículo .
* .............................................................................
* ....................................................... .int : String : int :
* int .
* .............................................................................
* ......................................................
*/
private int codCidade;
private String cidade;
private int qtdAcidentes;
private int tipoVeiculo;
public Estatistica2015() {
this(0, "", 0, 0);
}
public Estatistica2015(int codCidade, String cidade, int qtdAcidentes, int tipoVeiculo) {
this.codCidade = codCidade;
this.cidade = cidade;
this.qtdAcidentes = qtdAcidentes;
this.tipoVeiculo = tipoVeiculo;
}
public int getCodCidade() {
return codCidade;
}
public void setCodCidade(int codCidade) {
this.codCidade = codCidade;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public int getQtdAcidentes() {
return qtdAcidentes;
}
public void setQtdAcidentes(int qtdAcidentes) {
this.qtdAcidentes = qtdAcidentes;
}
public int getTipoVeiculo() {
return tipoVeiculo;
}
public void setTipoVeiculo(int tipoVeiculo) {
this.tipoVeiculo = tipoVeiculo;
}
@Override
public String toString() {
return "Estatistica2015 [codCidade=" + codCidade + ", cidade=" + cidade + ", qtdAcidentes=" + qtdAcidentes
+ ", tipoVeiculo=" + tipoVeiculo + ", getCodCidade()=" + getCodCidade() + ", getCidade()=" + getCidade()
+ ", getQtdAcidentes()=" + getQtdAcidentes() + ", getTipoVeiculo()=" + getTipoVeiculo()
+ ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
+ "]";
}
}
|
[
"43732623+Bruno-Pallin@users.noreply.github.com"
] |
43732623+Bruno-Pallin@users.noreply.github.com
|
4c5997c385fe771e890fcd57fc98b07a6eb7456e
|
d5f049aa640e34e080a19ed215bacb8337e4099c
|
/src/test/DES.java
|
036d806dcfddc06b0322cbb122486e367ac2aff6
|
[] |
no_license
|
chenlangping/Cipher
|
24c34b31e02a0f7e8fae857b65e42544f8c761d3
|
1387badc3758b47905cc1797065437dd02e57281
|
refs/heads/master
| 2020-04-30T22:48:23.744662
| 2019-03-23T12:30:36
| 2019-03-23T12:30:36
| 177,128,724
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 25,786
|
java
|
package test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class DES extends JDialog implements ActionListener {
static final int WIDTH = 600;// 宽度
static final int HEIGHT = 800;// 高度
String plaintext = "";// 保存及时加密用户输入的明文
String ciphertext = "";// 保存及时加密用户输入的密文
String key = "";// 保存及时加密用户输入的密钥
String fileplaintext = "";
String fileciphertext = "";
String filekey = "";
String encryptionaddress = "";// 加密之后的文件地址
String decryptionaddress = "";// 解密之后的文件地址
JFileChooser fileChooser = null;
JFrame jf = null;
JLabel fileplaintextlabel = null;
JTextField fileplaintextinput = null;
JTextField fileciphertextinput = null;
JTextField filekeyinput = null;
boolean fileplaintextlegal = false;// 如果获取的内容符合要求,则为true
boolean fileciphertextlegal = false;// 如果获取的内容符合要求,则为true
boolean filekeylegal = false;// 如果获取的内容符合要求,则为true
public DES() {
jf = new JFrame("DES密码");
jf.setSize(WIDTH, HEIGHT);
jf.setResizable(false);// 不可调整大小
jf.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
jf.dispose();
}
});// 设置关闭
jf.setVisible(true);// 设置可见
JPanel contentPane = new JPanel();// 放入frame中的中间容器,之后的panels均放在该容器下
jf.setContentPane(contentPane);
contentPane.setLayout(null);// 尝试绝对布局
JTabbedPane tabbedPane1 = new JTabbedPane();// 及时加密tab
JTabbedPane tabbedPane2 = new JTabbedPane();// 文件加密tab
tabbedPane1.setBounds(5, 0, 590, 350);
tabbedPane2.setBounds(5, 400, 590, 350);
JPanel panel1 = new JPanel();// 及时加密
JPanel panel2 = new JPanel();// 文件加密
JPanel panel3 = new JPanel();// 及时加密中west区域布局
JPanel panel4 = new JPanel();// 及时加密中Center区域布局
JPanel panel5 = new JPanel();// 及时加密中south区域布局
JPanel panel6 = new JPanel();// 文件加密中west区域布局
JPanel panel7 = new JPanel();// 文件加密中Center区域布局
JPanel panel8 = new JPanel();// 文件加密中East区域布局
JPanel panel9 = new JPanel();// 文件加密中South区域布局
JPanel panel = new JPanel();
JSeparator jSeparator = new JSeparator();
jSeparator.setOrientation(JSeparator.HORIZONTAL);
/* 及时加密区域布局部分 */
panel1.setLayout(new BorderLayout());
panel3.setLayout(new GridLayout(3, 1));
panel4.setLayout(new GridLayout(3, 1));
panel5.setLayout(new GridLayout(1, 4));
/* 问价加密区域布局部分 */
panel2.setLayout(null);
panel6.setLayout(new GridLayout(3, 1));
panel7.setLayout(new GridLayout(3, 1));
panel8.setLayout(new GridLayout(3, 1));
panel9.setLayout(new GridLayout(1, 4));
/* 设置tab标签 */
tabbedPane1.addTab("及时加密", panel1);
tabbedPane1.setEnabledAt(0, true);
tabbedPane1.setTitleAt(0, "及时加密:");
tabbedPane2.addTab("文件加密", panel2);
tabbedPane2.setEnabledAt(0, true);
tabbedPane2.setTitleAt(0, "文件加密:");
contentPane.add(tabbedPane1);
// contentPane.add(jSeparator);
contentPane.add(tabbedPane2);
/* 及时加密布局 */
panel1.add(panel3, "West");
panel1.add(panel4, "Center");
panel1.add(panel5, "South");
/* 及时加密明文部分 */
JLabel plaintextlabel = new JLabel("明文: ");// 明文标签
panel3.add(plaintextlabel, "West");
JTextArea plaintextinput = new JTextArea();// 明文输入框
plaintextinput.setBackground(null);
plaintextinput.setLineWrap(true);// 自动换行
plaintextinput.setEditable(false);
plaintextinput.setFont(new Font("TimesRoman", Font.PLAIN, 17));// 设置字体风格、大小等
JScrollPane jScrollPane1 = new JScrollPane(plaintextinput);
panel4.add(jScrollPane1);
/* 及时加密密文部分 */
JLabel ciphertextlabel = new JLabel("密文: ");
panel3.add(ciphertextlabel);
JTextArea ciphertextinput = new JTextArea();
ciphertextinput.setBackground(null);
ciphertextinput.setLineWrap(true);
ciphertextinput.setEditable(false);
ciphertextinput.setFont(new Font("TimesRoman", Font.PLAIN, 17));// 设置字体风格、大小等
JScrollPane jScrollPane2 = new JScrollPane(ciphertextinput);
panel4.add(jScrollPane2);
/* 及时加密密钥部分 */
JLabel keytextlabel = new JLabel("密钥: ");
panel3.add(keytextlabel);
JTextArea keyinput = new JTextArea();
keyinput.setBackground(null);
keyinput.setLineWrap(true);
keyinput.setEditable(false);
keyinput.setFont(new Font("TimesRoman", Font.PLAIN, 17));// 设置字体风格、大小等
JScrollPane jScrollPane3 = new JScrollPane(keyinput);
panel4.add(jScrollPane3);
/* 加解密部分 */
JRadioButton encryption = new JRadioButton("加密");
panel5.add(encryption);
JRadioButton decryption = new JRadioButton("解密");
panel5.add(decryption);
ButtonGroup bg = new ButtonGroup();
bg.add(decryption);
bg.add(encryption);
JButton ok1 = new JButton("确定");
panel5.add(ok1);
JButton back = new JButton("返回");
panel5.add(back);
/* 选择加密 */
encryption.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
plaintextinput.setEditable(true);
plaintextinput.setBackground(Color.white);
plaintextinput.setText("");
ciphertextinput.setEditable(false);
ciphertextinput.setBackground(null);
ciphertextinput.setText("");
keyinput.setEditable(true);
keyinput.setBackground(Color.white);
keyinput.setText("");
}
});
/* 选择解密 */
decryption.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
plaintextinput.setEditable(false);
plaintextinput.setBackground(null);
plaintextinput.setText("");
ciphertextinput.setEditable(true);
ciphertextinput.setBackground(Color.white);
ciphertextinput.setText("");
keyinput.setEditable(true);
keyinput.setBackground(Color.white);
keyinput.setText("");
}
});
/* 点击第一个确定发生的事件 */
ok1.addActionListener(new ActionListener() { // 确定事件处理
public void actionPerformed(ActionEvent Event) {
plaintext = plaintextinput.getText();
ciphertext = ciphertextinput.getText();
key = keyinput.getText();
if (encryption.isSelected() == true) {
if (plaintext.equals("") && key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入明文和密钥");
} else if (plaintext.equals("") && !key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入明文");
} else if (!plaintext.equals("") && key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入密钥");
} else if (key.length() != 7) {
JOptionPane.showMessageDialog(jf, "请输入7位长度的密钥");
} else
// 执行加密算法
ciphertextinput.setText(new Encrypt().DES(plaintext, key));
} else if (decryption.isSelected() == true) {
if (ciphertext.equals("") && key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入密文和密钥");
} else if (ciphertext.equals("") && !key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入密文");
} else if (!ciphertext.equals("") && key.equals("")) {
JOptionPane.showMessageDialog(jf, "未输入密钥");
} else if (!Algorithm.isOnlyzeroandone(ciphertext)) {
JOptionPane.showMessageDialog(jf, "密钥中有非法字符!");
} else if (Algorithm.isOnlyzeroandone(ciphertext) && ciphertext.length() % 64 != 0) {
JOptionPane.showMessageDialog(jf, "密钥长度非法!");
} else
// 执行解密算法
plaintextinput.setText(new Decrypt().DES(ciphertext, key));
}
}
});
/* 第一个返回按钮 */
back.addActionListener(new ActionListener() { // 返回事件处理
public void actionPerformed(ActionEvent Event) {
jf.dispose();
}
});
/* 文件加密布局 */
/* 改为绝对布局 */
/* 文件加密明文部分 */
JLabel fileplaintextlabel = new JLabel("明文路径:");
fileplaintextlabel.setFont(new Font("宋体", Font.BOLD, 13));
fileplaintextlabel.setBounds(0, 60, 65, 30);
panel2.add(fileplaintextlabel);
fileplaintextinput = new JTextField(50);
fileplaintextinput.setText(null);
fileplaintextinput.setBounds(70, 60, 400, 30);
fileplaintextinput.setEditable(false);
panel2.add(fileplaintextinput);
/* 文件加密密文部分 */
JLabel fileciphertextlabel = new JLabel("密文路径:");
fileciphertextlabel.setFont(new Font("宋体", Font.BOLD, 13));
fileciphertextlabel.setBounds(0, 120, 65, 30);
panel2.add(fileciphertextlabel);
fileciphertextinput = new JTextField(50);
fileciphertextinput.setText(null);
fileciphertextinput.setBounds(70, 120, 400, 30);
fileciphertextinput.setEditable(false);
panel2.add(fileciphertextinput);
/* 文件加密密钥部分 */
JLabel filekeytextlabel = new JLabel("密钥路径:");
filekeytextlabel.setFont(new Font("宋体", Font.BOLD, 13));
filekeytextlabel.setBounds(0, 180, 65, 30);
panel2.add(filekeytextlabel);
filekeyinput = new JTextField(20);
filekeyinput.setText(null);
filekeyinput.setBounds(70, 180, 400, 30);
filekeyinput.setEditable(false);
panel2.add(filekeyinput);
/* 打开明文文件按钮 */
JButton openplain = new JButton("打开明文文件");
openplain.setBounds(470, 60, 115, 30);
openplain.setEnabled(false);
openplain.addActionListener(this);
/* 打开密文文件按钮 */
JButton opencipher = new JButton("打开密文文件");
opencipher.setBounds(470, 120, 115, 30);
opencipher.setEnabled(false);
opencipher.addActionListener(this);
/* 打开密钥文件按钮 */
JButton openkey = new JButton("打开密钥文件");
openkey.setBounds(470, 180, 115, 30);
openkey.setEnabled(false);
openkey.addActionListener(this);
panel2.add(openplain);
panel2.add(opencipher);
panel2.add(openkey);
/* 文件选取器 */
fileChooser = new JFileChooser("D:\\");
contentPane.add(panel, BorderLayout.SOUTH);
/* 文件加密按钮 */
JRadioButton fileencryption = new JRadioButton("加密");
fileencryption.setBounds(50, 240, 70, 30);
panel2.add(fileencryption);
/* 文件解密按钮 */
JRadioButton filedecryption = new JRadioButton("解密");
filedecryption.setBounds(150, 240, 70, 30);
panel2.add(filedecryption);
ButtonGroup bg2 = new ButtonGroup();
bg2.add(filedecryption);
bg2.add(fileencryption);
JButton ok2 = new JButton("确定");
ok2.setBounds(330, 240, 100, 30);
panel2.add(ok2);
JButton back2 = new JButton("返回");
back2.setBounds(450, 240, 100, 30);
panel2.add(back2);
/* 点击加密按钮 */
fileencryption.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
openplain.setEnabled(true);
opencipher.setEnabled(true);
openkey.setEnabled(true);
fileplaintextinput.setText("");
fileciphertextinput.setText("");
filekeyinput.setText("");
openplain.setText("打开明文文件");
opencipher.setText("密文保存路径");
openkey.setText("打开密钥文件");
}
});
/* 点击解密按钮 */
filedecryption.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
openplain.setEnabled(true);
opencipher.setEnabled(true);
openkey.setEnabled(true);
fileplaintextinput.setText("");
fileciphertextinput.setText("");
filekeyinput.setText("");
openplain.setText("明文保存路径");
opencipher.setText("打开密文文件");
openkey.setText("打开密钥文件");
}
});
/* 点击第二个确定 */
ok2.addActionListener(new ActionListener() { // 确定事件处理
public void actionPerformed(ActionEvent Event) {
if (fileencryption.isSelected() == true) {
// 判断用户是否选择完
if (fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择");
} else if (!fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密文和密钥");
} else if (fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文和密钥");
} else if (fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文和密文");
} else if (!fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密钥");
} else if (!fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密文");
} else if (fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文");
} else if (!fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
fileplaintextlegal = fileplaintext.length() > 0;
filekeylegal = filekey.length() == 7;
if (fileplaintextlegal && filekeylegal) {
// 执行加密算法
fileciphertext = new Encrypt().DES(fileplaintext, filekey);
File file = new File(encryptionaddress);
try {
FileOutputStream out = new FileOutputStream(file);
byte[] byt = fileciphertext.getBytes();
out.write(byt);
} catch (Exception e) {
// 异常处理
}
JOptionPane.showMessageDialog(jf, "创建成功");
} else if (!fileplaintextlegal && filekeylegal) {
JOptionPane.showMessageDialog(jf, "明文长度为0!");
} else if (fileplaintextlegal && !filekeylegal) {
JOptionPane.showMessageDialog(jf, "密钥长度不为7!!");
} else
JOptionPane.showMessageDialog(jf, "明文和密钥长度均非法!");
}
} else if (filedecryption.isSelected() == true) {
// 判断用户是否选择完
if (fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择");
} else if (!fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密文和密钥");
} else if (fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文和密钥");
} else if (fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文和密文");
} else if (!fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密钥");
} else if (!fileplaintextinput.getText().equals("") && fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择密文");
} else if (fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
JOptionPane.showMessageDialog(jf, "未选择明文");
} else if (!fileplaintextinput.getText().equals("") && !fileciphertextinput.getText().equals("")
&& !filekeyinput.getText().equals("")) {
fileciphertextlegal = Algorithm.isOnlyzeroandone(fileciphertext) && fileciphertext.length() % 64 == 0;
filekeylegal = filekey.length() == 7;
if (fileciphertextlegal && filekeylegal) {
fileplaintext = new Decrypt().DES(fileciphertext, filekey);
File file = new File(decryptionaddress);
try {
FileOutputStream out = new FileOutputStream(file);
byte[] byt = fileplaintext.getBytes();
out.write(byt);
} catch (Exception e) {
// 异常处理
}
JOptionPane.showMessageDialog(jf, "创建成功");
} else if (!fileciphertextlegal && filekeylegal) {
JOptionPane.showMessageDialog(jf, "密文不合法!");
} else if (fileciphertextlegal && !filekeylegal) {
JOptionPane.showMessageDialog(jf, "密钥不合法");
} else
JOptionPane.showMessageDialog(jf, "密文和密钥均不合法!");
}
}
}
});
/* 第二个返回 */
back2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent Event) {
jf.dispose();
}
});
}
/* 文件选取器相关 */
public void actionPerformed(ActionEvent e) {
File file = null;
int result = -1;
if (e.getActionCommand().equals("打开明文文件")) {
fileChooser.setApproveButtonText("确定");
fileChooser.setDialogTitle("打开文件");
result = fileChooser.showOpenDialog(jf);
if (result == JFileChooser.APPROVE_OPTION) {
file = fileChooser.getSelectedFile();
fileplaintextinput.setText(file.getAbsolutePath());
try {
FileInputStream in = new FileInputStream(file);
byte[] byt = new byte[1024];
int len = in.read(byt);
fileplaintext = new String(byt, 0, len);
} catch (Exception e2) {
// 异常处理
}
} else if (result == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(jf, "未选择");
}
} else if (e.getActionCommand().equals("打开密文文件")) {
fileChooser.setApproveButtonText("确定");
fileChooser.setDialogTitle("打开文件");
result = fileChooser.showOpenDialog(jf);
if (result == JFileChooser.APPROVE_OPTION) {
file = fileChooser.getSelectedFile();
fileciphertextinput.setText(file.getAbsolutePath());
try {
FileInputStream in = new FileInputStream(file);
byte[] byt = new byte[1024];
int len = in.read(byt);
fileciphertext = new String(byt, 0, len);
} catch (Exception e2) {
// 异常处理
}
} else if (result == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(jf, "未选择");
}
} else if (e.getActionCommand().equals("打开密钥文件")) {
fileChooser.setApproveButtonText("确定");
fileChooser.setDialogTitle("打开文件");
result = fileChooser.showOpenDialog(jf);
if (result == JFileChooser.APPROVE_OPTION) {
file = fileChooser.getSelectedFile();
filekeyinput.setText(file.getAbsolutePath());
try {
FileInputStream in = new FileInputStream(file);
byte[] byt = new byte[1024];
int len = in.read(byt);
filekey = new String(byt, 0, len);
} catch (Exception e2) {
// 异常处理
}
} else if (result == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(jf, "未选择");
}
} else if (e.getActionCommand().equals("密文保存路径")) {
fileChooser.setApproveButtonText("确定");
fileChooser.setDialogTitle("打开文件");
result = fileChooser.showOpenDialog(jf);
if (result == JFileChooser.APPROVE_OPTION) {
file = fileChooser.getSelectedFile();
// 获取路径,并且保存
encryptionaddress = file.getAbsolutePath();
fileciphertextinput.setText(encryptionaddress);
} else if (result == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(jf, "未选择");
}
} else if (e.getActionCommand().equals("明文保存路径")) {
fileChooser.setApproveButtonText("确定");
fileChooser.setDialogTitle("打开文件");
result = fileChooser.showOpenDialog(jf);
if (result == JFileChooser.APPROVE_OPTION) {
file = fileChooser.getSelectedFile();
// 获取路径并且保存
decryptionaddress = file.getAbsolutePath();
fileplaintextinput.setText(decryptionaddress);
} else if (result == JFileChooser.CANCEL_OPTION) {
JOptionPane.showMessageDialog(jf, "未选择");
}
}
}
}
|
[
"328566090@qq.com"
] |
328566090@qq.com
|
5def6621ee32705e4d291d1b1e3f0abc8b7628ee
|
4fee74218f51059338d19d9efd9169a48a1fd157
|
/src/main/java/com/model/Work.java
|
0b1e2396620f076e51e45d48d4ca6cbb433bb55a
|
[] |
no_license
|
chernyavskii/recordBlanks
|
80c1dd677cbf6d4162e7296d25a44043438296d2
|
bfc8ac9027ab351e9541ed3531c0cac035579edd
|
refs/heads/master
| 2021-05-05T00:27:17.187054
| 2019-11-26T10:07:45
| 2019-11-26T10:07:45
| 119,497,857
| 0
| 2
| null | 2019-11-17T08:29:27
| 2018-01-30T07:18:45
|
Java
|
UTF-8
|
Java
| false
| false
| 359
|
java
|
package com.model;
public class Work
{
private String name;
private Double price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
}
|
[
"alexandrshatilo@yandex.ru"
] |
alexandrshatilo@yandex.ru
|
52a80b1a5c7ab9ab70977f3f16cd4db6441cb125
|
b6ef9303f9aa68f6e6488a3945a9b48457ed0f00
|
/dat110-oblig/src/no/hvl/dat110/messaging/Connection.java
|
bd67cdbe989bef3917f600e4b96ecbd3eb01b677
|
[] |
no_license
|
nikitazaicev/Nettverk
|
ebe5fd225e670d05ab254524dc0b14ff4b66e9cb
|
525627137f65d0267dd67cc50c6aa585a2c1ada1
|
refs/heads/master
| 2020-04-20T20:18:52.517940
| 2019-04-26T07:08:11
| 2019-04-26T07:08:11
| 169,073,404
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,687
|
java
|
package no.hvl.dat110.messaging;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
public class Connection {
private DataOutputStream outStream; // for writing bytes to the TCP connection
private DataInputStream inStream; // for reading bytes from the TCP connection
private Socket socket; // socket for the underlying TCP connection
public Connection(Socket socket) {
try {
this.socket = socket;
outStream = new DataOutputStream(socket.getOutputStream());
inStream = new DataInputStream(socket.getInputStream());
} catch (IOException ex) {
System.out.println("Connection: " + ex.getMessage());
ex.printStackTrace();
}
}
public void send(Message message) {
// TODO
// encapsulate the data contained in the message and write to the output stream
try {
outStream.write(message.encapsulate());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public Message receive() {
Message message;
byte[] recvbuf;
// TODO
// read a segment from the input stream and decapsulate into message
message = new Message();
recvbuf = new byte[128];
try {
inStream.read(recvbuf);
message.decapsulate(recvbuf);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return message;
}
// close the connection by closing streams and the underlying socket
public void close() {
try {
outStream.close();
inStream.close();
socket.close();
} catch (IOException ex) {
System.out.println("Connection: " + ex.getMessage());
ex.printStackTrace();
}
}
}
|
[
"mitja@DESKTOP-BSVG9JI"
] |
mitja@DESKTOP-BSVG9JI
|
01d4945c2cba1c484d4ddda6b2d2c553e91c90b2
|
24704b3894acfa5fc6d402336b451a99ff4a4b29
|
/实习3/GUI/src/main/java/DAO.java
|
77f384bebede76c4d0649d47452ac9ec5c2bebbf
|
[] |
no_license
|
fyering/SA
|
36381fab64ce0145066341b8075bc184ce3fac97
|
b4db3411eeabba9cc62f7915de5285169067135a
|
refs/heads/master
| 2022-12-27T08:54:28.241229
| 2019-10-24T12:20:12
| 2019-10-24T12:20:12
| 211,527,156
| 0
| 0
| null | 2022-12-16T05:54:41
| 2019-09-28T16:11:41
|
Java
|
UTF-8
|
Java
| false
| false
| 1,235
|
java
|
import java.sql.ResultSet;
import java.sql.SQLException;
public class DAO {
private Data conn;
public DAO() {
conn=new Data();
}
public boolean searchUser(String user,String ps) throws SQLException, ClassNotFoundException {
String query="select * from user_info";
ResultSet rs =conn.executeSelectQuery(query);
boolean flag=false;
while(rs.next())
{
String name=rs.getString("username");
String pw=rs.getString("password");
if(user.equals(name)&&ps.equals(pw)){
flag=true;
break;
}
}
rs.close();
conn.close();
return flag;
}
public void insertUser(String user,String pw ) throws SQLException, ClassNotFoundException {
String sql="insert into user_info (username,password) values('" + user + "','" + pw + "')";
conn.executeInsertQuery(sql);
conn.close();
}
public ResultSet searchUser1() throws SQLException, ClassNotFoundException {
String query="select * from user_info";
ResultSet rs =conn.executeSelectQuery(query);
rs.close();
conn.close();
return rs;
}
}
|
[
"17754070839@163.com"
] |
17754070839@163.com
|
b60fd20fb942a457575aa0828f73274f8e145fa6
|
f188fc63c597bb8ad6fda79a948943ef6e622ce6
|
/app/src/main/java/com/tylz/wechat/model/request/RegisterRequest.java
|
59b67847d5d0f71374ffee9cc644ad5e0976bf60
|
[] |
no_license
|
tylzcxw/CXWWeChat
|
066480869aa07df88b68f64249d46fe3b01cb7c1
|
6d3639d121c880fc68192296b07ed324ebcbd3e2
|
refs/heads/master
| 2021-08-28T19:28:41.249718
| 2017-12-13T02:45:32
| 2017-12-13T02:45:37
| 114,064,729
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,024
|
java
|
package com.tylz.wechat.model.request;
/**
* Created by AMing on 15/12/23.
* Company RongCloud
*/
public class RegisterRequest {
private String nickname;
private String password;
private String verification_token;
public RegisterRequest(String nickname, String password, String verification_token) {
this.nickname = nickname;
this.password = password;
this.verification_token = verification_token;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getVerification_token() {
return verification_token;
}
public void setVerification_token(String verification_token) {
this.verification_token = verification_token;
}
}
|
[
"tylzcxw@163.com"
] |
tylzcxw@163.com
|
2e3e945e104f2e896d8e38bfd7cdd78dd5d5e60d
|
756dde8009cd4609aaaa036b52c1d8dc78c8a187
|
/profiling/Library_Timing/src/timing_tests/java/lang/jl_ClassLoader_Timings.java
|
fd444602b5b8c418d60b7abe7c6403fbf97073bb
|
[
"MIT"
] |
permissive
|
static-analysis-engineering/CodeHawk-Java-Platform-Summaries
|
d33440abc27223ce4374996423a10dfe432f33da
|
35dcb0b50994f42046100c29a1e128aac64e239e
|
refs/heads/master
| 2022-09-15T06:51:29.861339
| 2020-05-31T18:25:11
| 2020-05-31T18:25:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,724
|
java
|
/*-----------------------------------------------------------------------------
Tool to profile Java library methods
Author: Andrew McGraw
------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2016-2017 Kestrel Technology LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
package Java_Timing;
public class jl_ClassLoader_Timings extends Java_Timings{
public jl_ClassLoader_Timings(boolean verbose) {
super(verbose);
}
public long get_timing(int repeats, String selection, Value_Store values){
double[] nvals = values.numeric_vals;
String[] svals = values.string_vals;
long total_time = 0;
switch(selection) {
case "emptyloop":
total_time = run_emptyloop(repeats);
break;
case "getResourceAsStream_String" :
total_time = run_getResourceAsStream_String(repeats);
break;
case "loadClass_String" :
total_time = run_loadClass_String(repeats);
break;
default:
break;
}
if(selection == "emptyloop")
{
return total_time;
}
else
{
return total_time - get_timing(repeats, "emptyloop", values);
}
}
public static long run_getResourceAsStream_String(int count) {
long start_time, end_time, total_time = 0;
for(int i = 0; i < count; i++) {
start_time = System.nanoTime();
end_time = System.nanoTime();
total_time += end_time - start_time;
}
return total_time / count;
}
public static long run_loadClass_String(int count) {
long start_time, end_time, total_time = 0;
for(int i = 0; i < count; i++) {
start_time = System.nanoTime();
end_time = System.nanoTime();
total_time += end_time - start_time;
}
return total_time / count;
}
}
|
[
"mcgraw4@illinois.edu"
] |
mcgraw4@illinois.edu
|
cbe14e1079e0b6b96eea9685f330a09b2169f832
|
fbaddf7a12d9fc3a3fc621a06252529bca879df3
|
/src/main/java/vo/BoardVo.java
|
004bdfee101db01e8092d205f641a3b2ba2a387f
|
[] |
no_license
|
OhNarae/Spring03
|
2f90d70f64279e2e82d395f95726010cf5368355
|
0f1e5787e908662d25325be7a8cf5f3641a47e9a
|
refs/heads/master
| 2021-05-11T10:25:31.354881
| 2018-02-26T08:17:27
| 2018-02-26T08:17:27
| 118,101,530
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,619
|
java
|
package vo;
import java.sql.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import oracle.sql.DATE;
public class BoardVo {
private int seq;
private String title;
private String writer;
private String content;
private String regdate;
private int cnt;
private int root;
private int step;
private int indent;
public int getRoot() {
return root;
}
public void setRoot(int root) {
this.root = root;
}
public int getStep() {
return step;
}
public void setStep(int step) {
this.step = step;
}
public int getIndent() {
return indent;
}
public void setIndent(int indent) {
this.indent = indent;
}
public int getSeq() {
return seq;
}
public void setSeq(int seq) {
this.seq = seq;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getWriter() {
return writer;
}
public void setWriter(String writer) {
this.writer = writer;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getRegdate() {
return regdate.substring(0, 10);
}
public void setRegdate(String regdate) {
this.regdate = regdate;
}
public int getCnt() {
return cnt;
}
public void setCnt(int cnt) {
this.cnt = cnt;
}
@Override
public String toString() {
return "BoardVo [seq=" + seq + ", title=" + title + ", writer=" + writer + ", content=" + content + ", regdate="
+ regdate + ", cnt=" + cnt + ", root=" + root + ", step=" + step + ", indent=" + indent + "]";
}
}
|
[
"oh@nate.com"
] |
oh@nate.com
|
68a3ed55d76682c193af69d386db8abca8613f9c
|
49d77144894be2ea84215e364ff837a1be3391e9
|
/app/src/main/java/com/usenergysolutions/energybroker/utils/PreferencesUtils.java
|
adfab48171028f140506a659bd0213e33381d88e
|
[] |
no_license
|
eyalmnm/AndAnergyBroker
|
ceef7fa595a5bf453c60ca46da361ea172d08b2e
|
7e81e6e81e5b0dad56ec0c429ea6f6c0b9f333aa
|
refs/heads/master
| 2022-12-25T17:47:49.346465
| 2020-10-11T07:31:20
| 2020-10-11T07:31:20
| 170,902,360
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,352
|
java
|
package com.usenergysolutions.energybroker.utils;
import android.content.Context;
import android.content.SharedPreferences;
public class PreferencesUtils {
private static final String TAG = "PreferencesUtils";
// Shared preferences file name
private static final String PREF_NAME = "energy_broker";
private static PreferencesUtils instance = null;
// Shared preferences access components
private SharedPreferences preferences;
private SharedPreferences.Editor editor;
// Application context
private Context context;
// Shared preferences working mode
private int PRIVATE_MODE = 0;
// Connection properties
private String serverIp = null;
private int serverPort = -1;
private PreferencesUtils(Context context) {
this.context = context;
preferences = this.context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
editor = preferences.edit();
}
public static PreferencesUtils getInstance(Context context) {
if (null == instance) {
instance = new PreferencesUtils(context);
}
return instance;
}
public String getUUID() {
return preferences.getString("uuid", null);
}
public void setUUID(String uuid) throws Exception {
if (!StringUtils.isNullOrEmpty(uuid)) {
editor.putString("uuid", uuid);
editor.commit();
setOffLineUuid(uuid);
} else {
throw new Exception("Invalid UUID");
}
}
public void removeUUID() {
editor.remove("uuid");
editor.commit();
}
public String getOffLineUuid() {
return preferences.getString("offLineUUID", null);
}
public void setOffLineUuid(String uuid) throws Exception {
if (!StringUtils.isNullOrEmpty(uuid)) {
editor.putString("offLineUUID", uuid);
editor.commit();
} else {
throw new Exception("Invalid UUID");
}
}
public boolean isClockIn() {
return preferences.getBoolean("clockIn", false);
}
public void setClockIn(boolean clockIn) {
editor.putBoolean("clockIn", clockIn);
editor.commit();
}
@Override
protected void finalize() throws Throwable {
super.finalize();
editor = null;
preferences = null;
}
}
|
[
"eyal@em-projects.com"
] |
eyal@em-projects.com
|
3bffcf9b251937eaefd43a778b36a5aa1c75241c
|
1a67d17be8fc8358a4cbd04a64d3a11c5f7b2202
|
/app/src/main/java/com/techglee/alphabet/Level2.java
|
da0f5f911b8ae6edc8d24f2a183a13c0c7dd9b85
|
[] |
no_license
|
sauravk90/AlphaBet
|
e29802477f89fc8e112c9b0993b53ab3c8cab99f
|
f7f7f0dc7f33ade88aa64be7855d533d9358ef6e
|
refs/heads/master
| 2020-12-11T22:17:27.878548
| 2015-11-03T19:04:11
| 2015-11-03T19:04:11
| 45,411,501
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 13,081
|
java
|
package com.techglee.alphabet;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.CountDownTimer;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.Switch;
import android.widget.TextView;
import android.util.DisplayMetrics;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Random;
public class Level2 extends Activity implements View.OnClickListener {
//public String input = "SOM";
private CountDownTimer countDownTimer;
private boolean timerHasStarted = false;
private Button startB;
public TextView text,scoreText,timerText;
//private static long NUMBER_MILLIS = 20000;
public long NUMBER_MILLIS;
private static final String MILLISECONDS_FORMAT = "%d";
private int secondsLeft = 0;
public String input;
public int len;
private TextView inputText;
private TextView userText;
private TextView test1;
private TextView test2;
//Button [] buttons = new Button[count];
private Button but1;
private Button but2;
private Button but3;
private Button but4;
private Button but5;
private Button but6;
private Button but7;
ArrayList numbers = new ArrayList();
Random rand=new Random();
Random randWord=new Random();
int[] randNo = new int[1725];
@Override
protected void onCreate(Bundle savedInstanceState) {
///// Set window fullscreen and remove title bar, and force portrit orientation //////
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
//////////////////////end/////////////////////////
String timeLeft = getIntent().getStringExtra("timeLeft").toString();
NUMBER_MILLIS = Long.parseLong(timeLeft)*1000;
Log.d("Saurav","timeleft is --> " +timeLeft);
ArrayList<String> arrayWord= new ArrayList<String>();
//String wordList[] = new String[30];
String s1 ="EXTREM";
String s2 ="AMAZIN";
String s3 ="WONDER", s4="SAURAVV", s5="ELEPHAN";
arrayWord.add(s1);
arrayWord.add(s2);
arrayWord.add(s3);
arrayWord.add(s4);
arrayWord.add(s5);
int randomInt = randWord.nextInt(3);
String wordToDisplay = arrayWord.get(randomInt);
input = wordToDisplay;
int count = input.length();
Button [] buttons = new Button[count];
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
scoreText = (TextView) this.findViewById(R.id.scoreView);
timerText = (TextView) this.findViewById(R.id.timerView);
inputText = (TextView)findViewById(R.id.inputText);
userText = (TextView)findViewById(R.id.userText);
test1 = (TextView)findViewById(R.id.textView);
test2 = (TextView)findViewById(R.id.textView2);
countDownTimer = new MyCountDownTimer(NUMBER_MILLIS, 1);
countDownTimer.start();
inputText.setText(input);
userText.setText("");
int MaxH=1725;
int MinH=0;
int MaxW=970;
int MinW=0;
for (int i = 0; i < count; i++) {
buttons[i] = new Button(this);
RelativeLayout ll = (RelativeLayout)findViewById(R.id.maincontainer);
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
//Random
//buttons[i].setY((int)(Math.random() * ( MaxH - MinH)));
//buttons[i].setX( (int)(Math.random() * ( MaxW - MinW )));
// for (int l=MinH ; l< MaxH;l++) {
int ygenerated = rand.nextInt(1725) + 1;
if(i==0)
{
randNo[0] = ygenerated;
numbers.add(randNo[0]);
buttons[i].setY((int)(Math.random() * ( MaxH - MinH)));
}
else
{
while(numbers.contains(new Integer(ygenerated)))
{
ygenerated = rand.nextInt(1725) + 1;
}
randNo[i] = ygenerated;
numbers.add(randNo[i]);
buttons[i].setY((int)(Math.random() * ( MaxH - MinH)));
}
buttons[i].setX( (int)(Math.random() * ( MaxW - MinW )));
String temp = Character.toString(input.charAt(i));
buttons[i].setText(temp);
buttons[i].setOnClickListener(this);
buttons[i].setId(i);
test1.setText(Integer.toString(buttons[i].getId()));
ll.addView(buttons[i],lp);
ViewGroup.LayoutParams params=buttons[i].getLayoutParams();
params.width=110;
params.height=120;
buttons[i].setLayoutParams(params);
}
if(count==1){
but1 = (Button)findViewById(buttons[0].getId());
}
else if(count==2){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
}
else if(count==3){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
but3 = (Button)findViewById(buttons[2].getId());
}
else if(count==4){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
but3 = (Button)findViewById(buttons[2].getId());
but4 = (Button)findViewById(buttons[3].getId());
}
else if(count==5){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
but3 = (Button)findViewById(buttons[2].getId());
but4 = (Button)findViewById(buttons[3].getId());
but5 = (Button)findViewById(buttons[4].getId());
}
else if(count==6){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
but3 = (Button)findViewById(buttons[2].getId());
but4 = (Button)findViewById(buttons[3].getId());
but5 = (Button)findViewById(buttons[4].getId());
but6 = (Button)findViewById(buttons[5].getId());
}
else if(count==7){
but1 = (Button)findViewById(buttons[0].getId());
but2 = (Button)findViewById(buttons[1].getId());
but3 = (Button)findViewById(buttons[2].getId());
but4 = (Button)findViewById(buttons[3].getId());
but5 = (Button)findViewById(buttons[4].getId());
but6 = (Button)findViewById(buttons[5].getId());
but7 = (Button)findViewById(buttons[6].getId());
}
}
///////////////////////////////////////
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// TODO Auto-generated method stub
super.onWindowFocusChanged(hasFocus);
updateSizeInfo();
}
private void updateSizeInfo() {
RelativeLayout rl_cards_details_card_area = (RelativeLayout) findViewById(R.id.maincontainer);
int w = rl_cards_details_card_area.getWidth();
int h = rl_cards_details_card_area.getHeight();
Log.v("Saurav", "get height --> " +w+"-"+h);
DisplayMetrics displaymetrics = new DisplayMetrics();
displaymetrics = this.getBaseContext().getResources().getDisplayMetrics();
double dpwidth = (w/displaymetrics.density)+0.5;
Log.v("Saurav","dpwidth is --> "+dpwidth);
double dpheight = (h/displaymetrics.density)+0.5;
Log.v("Saurav","dpheight is --> "+dpheight);
Log.v("Saurav","pxhieght===>"+pxToDp(h));
}
//////////////////////////////////////
public int pxToDp(int px) {
DisplayMetrics displayMetrics = this.getBaseContext().getResources().getDisplayMetrics();
//getContext().getResources().getDisplayMetrics();
int dp = Math.round(px / (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
return dp;
}
@Override
public void onClick(View v) {
if(v==but1 ){
test2.setText("button 1 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(0)));
checkCompletion(v);
}
else if(v==but2){
test2.setText("button 2 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(1)));
checkCompletion(v);
}
else if(v==but3){
test2.setText("button 3 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(2)));
checkCompletion(v);
}
else if(v==but4){
test2.setText("button 4 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(3)));
checkCompletion(v);
}
else if(v==but5){
test2.setText("button 5 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(4)));
checkCompletion(v);
}
else if(v==but6){
test2.setText("button 6 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(5)));
checkCompletion(v);
}else if(v==but7){
test2.setText("button 6 was clicked");
userText.setText(userText.getText().toString() + Character.toString(input.charAt(6)));
checkCompletion(v);
}
}
public void checkCompletion(final View v){
if (input.equalsIgnoreCase(userText.getText().toString())) {
//Intent intent = new Intent(v.getContext(),Score.class);
//startActivity(intent);
final String tempScore = scoreText.getText().toString();
userText.setText("Your score is :" + scoreText.getText().toString());
Handler handler = new Handler();
handler.postDelayed(new Runnable(){
@Override
public void run(){
// do something
Intent intent = new Intent(v.getContext(),Level3.class);
intent.putExtra("timeLeft",tempScore);
startActivity(intent);
}
}, 3000);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
//Class defined for Countdown Timer
public class MyCountDownTimer extends CountDownTimer {
public MyCountDownTimer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onFinish() {
scoreText.setText("Time's up!");
// text2.setText(Long.toString(millisUntilFinished / 1000));
}
@Override
public void onTick(long millisUntilFinished) {
// text.setText("" + millisUntilFinished / 1000);
if (Math.round((float) millisUntilFinished / 1000.0f) != secondsLeft) {
secondsLeft = Math.round((float) millisUntilFinished / 1000.0f);
// scoreText.setText(String.valueOf(String.format(MILLISECONDS_FORMAT, millisUntilFinished % 10)));
scoreText.setText(String.valueOf(secondsLeft));
}
long roundMillis = secondsLeft * 1000;
if (roundMillis == NUMBER_MILLIS) {
timerText.setText(secondsLeft
+ "." + String.format(MILLISECONDS_FORMAT, 0));
//text2.setText(Long.toString(millisUntilFinished/1000));
} else {
timerText.setText(secondsLeft
+ "." + String.format(MILLISECONDS_FORMAT, millisUntilFinished % 10));
}
}
}
}
|
[
"saurav.kumar90@hotmail.com"
] |
saurav.kumar90@hotmail.com
|
0bc17113c748a3fe65c7049a181f1968a5444a30
|
535c4527de8b44665468de83831a73542fec4de9
|
/partner/src/test/java/com/tracebucket/x1/partner/integration/test/builder/DefaultEntertainmentCompanyResourceBuilder.java
|
6236ff6aa39117d049a30da52a1aeed5461deafb
|
[] |
no_license
|
cloudloom/x1-integration-tests
|
e85034116ed3c17a53145b656df6e4e6518b7795
|
aab91250f983bad49d2e6a27322b5be6666cbf8a
|
refs/heads/master
| 2021-05-29T07:37:27.725455
| 2015-06-09T06:19:36
| 2015-06-09T06:19:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,223
|
java
|
package com.tracebucket.x1.partner.integration.test.builder;
import com.tracebucket.x1.partner.api.rest.resources.DefaultAddressResource;
import com.tracebucket.x1.partner.api.rest.resources.DefaultEntertainmentCompanyResource;
import com.tracebucket.x1.partner.api.rest.resources.DefaultPersonResource;
import java.util.HashSet;
import java.util.Set;
/**
* Created by sadath on 01-Jun-2015.
*/
public class DefaultEntertainmentCompanyResourceBuilder {
private String name;
private String website;
private String logo;
private Set<DefaultPersonResource> contactPersons = new HashSet<DefaultPersonResource>(0);
private Set<DefaultAddressResource> addresses = new HashSet<DefaultAddressResource>(0);
private DefaultEntertainmentCompanyResourceBuilder() {
}
public static DefaultEntertainmentCompanyResourceBuilder anEntertainmentCompanyBuilder() {
return new DefaultEntertainmentCompanyResourceBuilder();
}
public DefaultEntertainmentCompanyResourceBuilder withName(String name) {
this.name = name;
return this;
}
public DefaultEntertainmentCompanyResourceBuilder withWebsite(String website) {
this.website = website;
return this;
}
public DefaultEntertainmentCompanyResourceBuilder withLogo(String logo) {
this.logo = logo;
return this;
}
public DefaultEntertainmentCompanyResourceBuilder withContactPersons(Set<DefaultPersonResource> contactPersons) {
this.contactPersons = contactPersons;
return this;
}
public DefaultEntertainmentCompanyResourceBuilder withAddresses(Set<DefaultAddressResource> addresses) {
this.addresses = addresses;
return this;
}
public DefaultEntertainmentCompanyResource build() {
DefaultEntertainmentCompanyResource entertainmentCompany = new DefaultEntertainmentCompanyResource();
entertainmentCompany.setName(this.name);
entertainmentCompany.setContactPersons(this.contactPersons);
entertainmentCompany.setLogo(this.logo);
entertainmentCompany.setWebsite(this.website);
entertainmentCompany.setAddresses(this.addresses);
return entertainmentCompany;
}
}
|
[
"firoz.fazil@gmail.com"
] |
firoz.fazil@gmail.com
|
3e3f6161ee90955c3979cf895235f376a4ed83eb
|
30998a3486f3fad0b336cd7aa8e5ab20fa91181e
|
/src/main/java/com/liuqi/business/model/MiningConfigModelDto.java
|
cb67e1d44ebfcf022360e95cc1bace1a2ac34153
|
[] |
no_license
|
radar9494/Radar-Star-admin
|
cbf8c9a0b5b782d2bcc281dfd5ee78ce5b31f086
|
9e4622d3932c2cd2219152814fc91858030cc196
|
refs/heads/main
| 2023-02-24T00:07:03.150304
| 2021-01-26T02:51:38
| 2021-01-26T02:51:38
| 332,949,996
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 464
|
java
|
package com.liuqi.business.model;
import lombok.Data;
@Data
public class MiningConfigModelDto extends MiningConfigModel{
private String currencyName;
private String typeStr;
public String getTypeStr() {
if(super.getType()!=null){
if(super.getType()==0){
typeStr="矿池";
}else{
typeStr="时间戳";
}
}
return typeStr;
}
private String image;
}
|
[
"radar131419@gmail.com"
] |
radar131419@gmail.com
|
a05f821965af6920ccab3c9cc11e6ac04e39fcd5
|
cee6d0534a4b4fda056cacd1738fc7c22223ef06
|
/src/main/java/by/distributionnetwork/service/dto/UserDTO.java
|
17ddf0cad52a5c172b6ed60241bee33fe1c288f1
|
[] |
no_license
|
Topolev/DistributionNetwork_2017_05_31
|
54c0fac9ba8dbdd916dfec27b8348c60d7751840
|
a083f2bf9a64e7bbfe10ad2ea254c04c35f1d7a2
|
refs/heads/master
| 2021-01-23T01:40:32.544847
| 2017-05-31T15:52:36
| 2017-05-31T15:52:42
| 92,882,438
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,192
|
java
|
package by.distributionnetwork.service.dto;
import by.distributionnetwork.config.Constants;
import by.distributionnetwork.domain.Authority;
import by.distributionnetwork.domain.User;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.*;
import java.time.Instant;
import java.util.Set;
import java.util.stream.Collectors;
/**
* A DTO representing a user, with his authorities.
*/
public class UserDTO {
private Long id;
@NotBlank
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
private String login;
@Size(max = 50)
private String firstName;
@Size(max = 50)
private String lastName;
@Email
@Size(min = 5, max = 100)
private String email;
@Size(max = 256)
private String imageUrl;
private boolean activated = false;
@Size(min = 2, max = 5)
private String langKey;
private String createdBy;
private Instant createdDate;
private String lastModifiedBy;
private Instant lastModifiedDate;
private Set<String> authorities;
public UserDTO() {
// Empty constructor needed for Jackson.
}
public UserDTO(User user) {
this(user.getId(), user.getLogin(), user.getFirstName(), user.getLastName(),
user.getEmail(), user.getActivated(), user.getImageUrl(), user.getLangKey(),
user.getCreatedBy(), user.getCreatedDate(), user.getLastModifiedBy(), user.getLastModifiedDate(),
user.getAuthorities().stream().map(Authority::getName)
.collect(Collectors.toSet()));
}
public UserDTO(Long id, String login, String firstName, String lastName,
String email, boolean activated, String imageUrl, String langKey,
String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate,
Set<String> authorities) {
this.id = id;
this.login = login;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.activated = activated;
this.imageUrl = imageUrl;
this.langKey = langKey;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.lastModifiedBy = lastModifiedBy;
this.lastModifiedDate = lastModifiedDate;
this.authorities = authorities;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getEmail() {
return email;
}
public String getImageUrl() {
return imageUrl;
}
public boolean isActivated() {
return activated;
}
public String getLangKey() {
return langKey;
}
public String getCreatedBy() {
return createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public Set<String> getAuthorities() {
return authorities;
}
@Override
public String toString() {
return "UserDTO{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated=" + activated +
", langKey='" + langKey + '\'' +
", createdBy=" + createdBy +
", createdDate=" + createdDate +
", lastModifiedBy='" + lastModifiedBy + '\'' +
", lastModifiedDate=" + lastModifiedDate +
", authorities=" + authorities +
"}";
}
}
|
[
"i.topolev.vladimir@gmail.com"
] |
i.topolev.vladimir@gmail.com
|
3e4f7b22481abb4085ee35e9e4a3aaa7c16d9657
|
88794451b9d21102319739473bc116421451f9ae
|
/podStudio/src/main/java/com/factory/podstudio/studio/model/PageHelper.java
|
8c41e5ffb9bcedf6a30425b198fab2e1403aeaf6
|
[] |
no_license
|
eulyongBak/podstudio
|
ef4668037fc58fe4580eeb753f16f7b1838caf67
|
8a967b4d648f9855f3d764ccf59441aeb543da3f
|
refs/heads/master
| 2020-04-06T07:12:17.265966
| 2016-09-05T07:43:32
| 2016-09-05T07:43:32
| 64,712,536
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 835
|
java
|
package com.factory.podstudio.studio.model;
public class PageHelper {
// 해당 게시글의 첫페이지 설정
private int startPage;
// 게시글 페이지를 한번에 몇개씩 보여줄지 설정
private int linePerPage;
public PageHelper() {
super();
}
public PageHelper(int page, int linePerPage) {
// 한페이지에 몇개 개시글을 줄지 설정
this.linePerPage = linePerPage;
// 몇번째 게시글 부터 보여줄지 첫 페이지 설정
this.startPage = (page - 1) * linePerPage;
}
public int getStartPage() {
return startPage;
}
public void setStartPage(int startPage) {
this.startPage = startPage;
}
public int getLinePerPage() {
return linePerPage;
}
public void setLinePerPage(int linePerPage) {
this.linePerPage = linePerPage;
}
}
|
[
"ksmart-10@ksmart-10-PC"
] |
ksmart-10@ksmart-10-PC
|
18581e2637245c3fd024dcd50d29c2bb69c8788f
|
f331c091d6d8a2aac7b5af11e05ffe7b5cafc6d8
|
/myTasks/src/com/zavitz/mytasks/functions/Encode.java
|
d77c1b2244ac0a426d57f52b3c051c874bb7bbe9
|
[
"MIT"
] |
permissive
|
ianzavitz/blackberry-apps
|
1f1df19d509d55588d3fa822e9284a3eb45d446a
|
c757ee491fb106021b5100c0aa1c1a0de80624b9
|
refs/heads/master
| 2020-04-08T01:45:47.076256
| 2012-02-15T19:50:44
| 2012-02-15T19:50:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,965
|
java
|
package com.zavitz.mytasks.functions;
public class Encode {
public static String decode(String str) {
StringBuffer result = new StringBuffer();
int l = str.length();
for (int i = 0; i < l; ++i) {
char c = str.charAt(i);
if (c == '%' && i + 2 < l) {
char c1 = str.charAt(i + 1);
char c2 = str.charAt(i + 2);
if (isHexit(c1) && isHexit(c2)) {
result.append((char) (hexit(c1) * 16 + hexit(c2)));
i += 2;
} else
result.append(c);
} else
result.append(c);
}
return result.toString();
}
private static boolean isHexit(char c) {
String legalChars = "0123456789abcdefABCDEF";
return (legalChars.indexOf(c) != -1);
}
private static int hexit(char c) {
if (c >= '0' && c <= '9')
return c - '0';
if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
return 0; // shouldn't happen, we're guarded by isHexit()
}
final static String[] hex = { "%00", "%01", "%02", "%03", "%04", "%05",
"%06", "%07", "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e",
"%0f", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
"%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f", "%20",
"%21", "%22", "%23", "%24", "%25", "%26", "%27", "%28", "%29",
"%2a", "%2b", "%2c", "%2d", "%2e", "%2f", "%30", "%31", "%32",
"%33", "%34", "%35", "%36", "%37", "%38", "%39", "%3a", "%3b",
"%3c", "%3d", "%3e", "%3f", "%40", "%41", "%42", "%43", "%44",
"%45", "%46", "%47", "%48", "%49", "%4a", "%4b", "%4c", "%4d",
"%4e", "%4f", "%50", "%51", "%52", "%53", "%54", "%55", "%56",
"%57", "%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f",
"%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", "%68",
"%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f", "%70", "%71",
"%72", "%73", "%74", "%75", "%76", "%77", "%78", "%79", "%7a",
"%7b", "%7c", "%7d", "%7e", "%7f", "%80", "%81", "%82", "%83",
"%84", "%85", "%86", "%87", "%88", "%89", "%8a", "%8b", "%8c",
"%8d", "%8e", "%8f", "%90", "%91", "%92", "%93", "%94", "%95",
"%96", "%97", "%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e",
"%9f", "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
"%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af", "%b0",
"%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7", "%b8", "%b9",
"%ba", "%bb", "%bc", "%bd", "%be", "%bf", "%c0", "%c1", "%c2",
"%c3", "%c4", "%c5", "%c6", "%c7", "%c8", "%c9", "%ca", "%cb",
"%cc", "%cd", "%ce", "%cf", "%d0", "%d1", "%d2", "%d3", "%d4",
"%d5", "%d6", "%d7", "%d8", "%d9", "%da", "%db", "%dc", "%dd",
"%de", "%df", "%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6",
"%e7", "%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef",
"%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7", "%f8",
"%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff" };
public static String encode(int i) {
return encode(String.valueOf(i));
}
public static String encode(long i) {
return encode(String.valueOf(i));
}
public static String encode(String s) {
StringBuffer sbuf = new StringBuffer();
int len = s.length();
for (int i = 0; i < len; i++) {
int ch = s.charAt(i);
if ('A' <= ch && ch <= 'Z') { // 'A'..'Z'
sbuf.append((char) ch);
} else if ('a' <= ch && ch <= 'z') { // 'a'..'z'
sbuf.append((char) ch);
} else if ('0' <= ch && ch <= '9') { // '0'..'9'
sbuf.append((char) ch);
} else if (ch == ' ') { // space
sbuf.append(' ');
} else if (ch <= 0x007f) { // other ASCII
sbuf.append(hex[ch]);
} else if (ch <= 0x07FF) { // non-ASCII <= 0x7FF
sbuf.append(hex[0xc0 | (ch >> 6)]);
sbuf.append(hex[0x80 | (ch & 0x3F)]);
} else { // 0x7FF < ch <= 0xFFFF
sbuf.append(hex[0xe0 | (ch >> 12)]);
sbuf.append(hex[0x80 | ((ch >> 6) & 0x3F)]);
sbuf.append(hex[0x80 | (ch & 0x3F)]);
}
}
return sbuf.toString();
}
}
|
[
"gzavitz@gmail.com"
] |
gzavitz@gmail.com
|
4a85cecb09df482c4f868e98294258f5d59165de
|
f1d26672353e816c71c061afe26f88c0d8ed569c
|
/app/src/main/java/com/jxs/vide/MainActivity.java
|
2ac6e7b35b2a411876dd8d3acf646be1067b86ec
|
[] |
no_license
|
XsJIONG/VIDE
|
344605771b31b549b88067d5fa2e6d8297e3be7a
|
a44b2d80e9d02c9971f815b9e7466859b78ee25e
|
refs/heads/master
| 2020-03-17T23:44:38.129155
| 2012-01-01T13:59:27
| 2012-01-01T13:59:27
| 134,058,377
| 6
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 30,172
|
java
|
package com.jxs.vide;
import android.app.*;
import android.content.*;
import android.content.pm.*;
import android.content.res.*;
import android.graphics.*;
import android.net.*;
import android.os.*;
import android.support.design.widget.*;
import android.support.v4.view.*;
import android.support.v4.widget.*;
import android.support.v7.app.*;
import android.support.v7.graphics.drawable.*;
import android.support.v7.widget.*;
import android.text.*;
import android.util.*;
import android.view.*;
import android.view.View.*;
import android.view.animation.*;
import android.widget.*;
import android.widget.AdapterView.*;
import cn.bmob.v3.*;
import cn.bmob.v3.exception.*;
import cn.bmob.v3.listener.*;
import com.jxs.vapp.program.*;
import com.jxs.vcompat.activity.*;
import com.jxs.vcompat.ui.*;
import com.jxs.vcompat.widget.*;
import java.io.*;
import java.util.*;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;
import android.view.View.OnClickListener;
import static com.jxs.vide.L.get;
public class MainActivity extends VActivity {
public static final int LOGIN_PAGE=0,USERINFO_PAGE=1;
public static final Object LOGOUT_TAG="Logout";
public static final int DRAWER_WIDTH=UI.dp2px(300);
public static MainActivity cx;
private Toolbar Title;
private AppBarLayout TitleLayout;
private DrawerLayout Drawer;
private LinearLayout Content,ItemLayout;
private RelativeLayout Root;
private FloatingActionButton FAB;
private ProjectViewHelper VH;
private SharedPreferences Pref;
@Override
protected void onCreate(Bundle savedInstanceState) {
cx = this;
Pref = getSharedPreferences("Config", MODE_PRIVATE);
super.onCreate(savedInstanceState);
Global.checkBmob(this);
initProjectsView();
initDrawer();
updateUser();
setContentView(Drawer);
//Signature Check
if (getSignature(this) != 1484347571 || getSignature(this) + 5 != 1484347576 || !((getSignature(this) + "").equals("1484347571"))) {
ui.newAlertDialog().setTitle(new String(new byte[]{-24, -83, -90, -27, -111, -118})).setMessage(new String(new byte[]{-28, -67, -96, -26, -119, -128, -28, -72, -117, -24, -67, -67, -25, -102, -124, -24, -67, -81, -28, -69, -74, -26, -104, -81, -24, -94, -85, -23, -121, -115, -25, -83, -66, -27, -112, -115, -28, -65, -82, -26, -108, -71, -25, -102, -124, -25, -101, -105, -25, -119, -120, 10, -24, -81, -73, -24, -127, -108, -25, -77, -69, -28, -67, -100, -24, -128, -123, 81, 81, 50, 53, 48, 56, 53, 49, 48, 52, 56, -26, -99, -91, -24, -114, -73, -27, -113, -106, -26, -83, -93, -25, -119, -120, -24, -67, -81, -28, -69, -74})).setPositiveButton(new String(new byte[]{-25, -95, -82, -27, -82, -102}), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}
}).setOnCancelListener(new VAlertDialog.OnCancelListener() {
@Override
public void onCancel(VAlertDialog dialog) {
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}
}).setCancelable(true).show();
}
try {
Class.forName(new String(new byte[]{99, 99, 46, 98, 105, 110, 109, 116, 46, 115, 105, 103, 110, 97, 116, 117, 114, 101, 46, 80, 109, 115, 72, 111, 111, 107, 65, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110}));
ui.newAlertDialog().setTitle(new String(new byte[]{-24, -83, -90, -27, -111, -118})).setMessage(new String(new byte[]{-28, -67, -96, -27, -66, -120, -27, -92, -87, -25, -100, -97, -27, -107, -118, 10, -28, -67, -96, -25, -100, -97, -25, -102, -124, -24, -82, -92, -28, -72, -70, -27, -113, -86, -23, -100, -128, -24, -90, -127, -25, -108, -88, 77, 84, -25, -82, -95, -25, -112, -122, -27, -103, -88, -27, -123, -115, -25, -83, -66, -27, -112, -115, -23, -86, -116, -24, -81, -127, -27, -80, -79, -27, -113, -81, -28, -69, -91, -25, -96, -76, -24, -89, -93, 86, 73, 68, 69, -27, -112, -105, -17, -68, -97, 10, -27, -81, -71, -28, -70, -114, -25, -108, -88, -26, -120, -73, 10, -28, -67, -96, -26, -119, -128, -28, -67, -65, -25, -108, -88, -25, -102, -124, 86, 73, 68, 69, -26, -104, -81, -24, -94, -85, -28, -69, -106, -28, -70, -70, -28, -65, -82, -26, -108, -71, -24, -65, -121, -25, -102, -124, -25, -101, -105, -25, -119, -120, 10, -24, -81, -73, -24, -127, -108, -25, -77, -69, -28, -67, -100, -24, -128, -123, 81, 81, 50, 53, 48, 56, 53, 49, 48, 52, 56, -26, -99, -91, -24, -114, -73, -27, -113, -106, -26, -83, -93, -25, -119, -120})).setPositiveButton(new String(new byte[]{-25, -95, -82, -27, -82, -102}), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}
}).setOnCancelListener(new VAlertDialog.OnCancelListener() {
@Override
public void onCancel(VAlertDialog dialog) {
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}
}).setCancelable(true).show();
} catch (Exception e) {}
int c=Pref.getInt("Count", 0);
if (c != -1) {
if (c != 0 && (c % 4 == 0)) {
shareMe(this);
Pref.edit().putInt("Count", -1).commit();
c = 0;
}
Pref.edit().putInt("Count", ++c).commit();
}
checkUpdate();
}
public static void shareMe(final VActivity ac) {
ac.ui.newAlertDialog().setTitle(get(L.Please)).setMessage(get(L.ShareApp)).setCancelable(false).setPositiveButton(get(L.Share), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
Intent in=new Intent(Intent.ACTION_SEND);
in.setType("text/plain");
in.putExtra(Intent.EXTRA_SUBJECT, "VIDE");
in.putExtra(Intent.EXTRA_TEXT, get(L.ShareContent));
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ac.startActivity(Intent.createChooser(in, get(L.Share)));
}
}).setNegativeButton(get(L.AppMarket), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
Intent in=new Intent(Intent.ACTION_VIEW);
in.setData(Uri.parse("market://details?id=com.jxs.vide"));
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ac.startActivity(in);
}
}).setNeutralButton(get(L.Nop), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
final Snackbar bar=Snackbar.make(ac.findViewById(android.R.id.content), get(L.Badguy), Snackbar.LENGTH_SHORT);
bar.setAction(get(L.IRepented), new OnClickListener() {
@Override
public void onClick(View v) {
shareMe(ac);
bar.dismiss();
}
});
bar.setActionTextColor(UI.getThemeColor());
bar.show();
}
}).show();
}
public static void onUserStateChanged() {
if (MainActivity.cx != null) MainActivity.cx.updateUser();
}
private void updateUser() {
VUser _User=BmobUser.getCurrentUser(VUser.class);
UserLayout.setVisibility(View.GONE);
LoginLayout.setVisibility(View.GONE);
if (_User == null) {
LoginLayout.setVisibility(View.VISIBLE);
} else {
UserLayout.setVisibility(View.VISIBLE);
_User.downloadIcon(new VUser.IconListener() {
@Override
public void onDone(Bitmap b) {
UserIcon.setTag(0);
UserIcon.setImageBitmap(b);
}
});
UserName.setText(_User.getUsername());
}
}
private ActionBarDrawerToggle DrawerToggle;
private FloatingActionButton FABCreateSimple,FABCreateConsole;
private FloatingActionButton[] AllFAB;
private static final int P=UI.dp2px(32);
private static final int FS=UI.dp2px(64);
private static final int SPLIT=UI.dp2px(12);
private void initProjectsView() {
Root = new RelativeLayout(this);
VH = new ProjectViewHelper(this);
VH.setOnProjectClickListener(new ProjectViewHelper.OnProjectClickListener() {
@Override
public void onClick(Project pro, View view) {
startActivity(new Intent(MainActivity.this, ProjectActivity.class).putExtra("project", pro.getName()));
}
});
Root.addView(VH.getView(), new RelativeLayout.LayoutParams(-1, -1));
FAB = new FloatingActionButton(this);
FABCreateSimple = new FloatingActionButton(this);
FABCreateConsole = new FloatingActionButton(this);
FAB.setImageDrawable(DrawableHelper.getDrawable(R.drawable.v_add, UI.getAccentColor()));
FABCreateSimple.setImageDrawable(DrawableHelper.getDrawable(R.drawable.icon_activity, UI.getAccentColor()));
FABCreateConsole.setImageDrawable(DrawableHelper.getDrawable(R.drawable.icon_console, UI.getAccentColor()));
try {
ColorStateList s=ColorStateList.valueOf(UI.getThemeColor());
FAB.setBackgroundTintList(s);
FABCreateSimple.setBackgroundTintList(s);
FABCreateConsole.setBackgroundTintList(s);
} catch (Exception e) {}
AllFAB = new FloatingActionButton[] {FABCreateSimple,FABCreateConsole};
RelativeLayout.LayoutParams para;
for (int i=0;i < AllFAB.length;i++) {
para = new RelativeLayout.LayoutParams(FS, FS);
para.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
para.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
para.rightMargin = para.bottomMargin = P;
para.bottomMargin += (i + 1) * (FS + SPLIT);
AllFAB[i].setVisibility(View.GONE);
Root.addView(AllFAB[i], para);
}
para = new RelativeLayout.LayoutParams(FS, FS);
para.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
para.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
para.rightMargin = para.bottomMargin = P;
Root.addView(FAB, para);
para = new RelativeLayout.LayoutParams(-1, -1);
para.addRule(RelativeLayout.CENTER_IN_PARENT);
FAB.setOnClickListener(new OnClickListener() {
private boolean Rotate=false;
@Override
public void onClick(View v) {
RotateAnimation ani=new RotateAnimation(Rotate ?225: 0, Rotate ?0: 225, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
ani.setDuration(500);
ani.setFillAfter(true);
ani.setInterpolator(new AccelerateDecelerateInterpolator());
for (int i=0;i < AllFAB.length;i++) {
AlphaAnimation alpha=new AlphaAnimation(Rotate ?1: 0, Rotate ?0: 1);
alpha.setDuration(300);
FAB.startAnimation(ani);
if (!Rotate) AllFAB[i].setVisibility(View.VISIBLE); else alpha.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationEnd(Animation ani) {
FABCreateSimple.setVisibility(View.GONE);
FABCreateConsole.setVisibility(View.GONE);
}
@Override
public void onAnimationStart(Animation ani) {}
@Override
public void onAnimationRepeat(Animation ani) {}
});
AllFAB[i].startAnimation(alpha);
AllFAB[i].setVisibility(View.VISIBLE);
}
Rotate = !Rotate;
}
});
FABCreateSimple.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
createUI(true);
FAB.performClick();
}
});
FABCreateConsole.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
createUI(false);
FAB.performClick();
}
});
}
private LinearLayout LoginLayout;
private RelativeLayout UserLayout;
private void initDrawer() {
Content = new LinearLayout(this);
Content.setOrientation(LinearLayout.VERTICAL);
Title = new Toolbar(this);
Title.setTitle(getResources().getString(R.string.app_name));
setSupportActionBar(Title);
Title.setBackgroundColor(UI.getThemeColor());
Title.setTitleTextColor(UI.getAccentColor());
TitleLayout = new AppBarLayout(this);
TitleLayout.addView(Title);
Content.addView(TitleLayout);
Content.addView(Root, new LinearLayout.LayoutParams(-1, -1));
ViewCompat.setElevation(TitleLayout, 10f);
Drawer = new DrawerLayout(this);
Drawer.addView(Content);
DrawerLayout.LayoutParams para=new DrawerLayout.LayoutParams(DRAWER_WIDTH, -1);
int margin=UI.dp2px(8);
para.setMargins(margin, margin, margin, margin);
para.gravity = Gravity.LEFT;
Drawer.addView(getDrawerView(), para);
DrawerToggle = new ActionBarDrawerToggle(this, Drawer, Title, R.string.drawer_open, R.string.drawer_close);
DrawerToggle.syncState();
Drawer.setDrawerListener(DrawerToggle);
((DrawerArrowDrawable) Title.getNavigationIcon()).setColor(UI.getAccentColor());
}
private GradientView DrawerGradient;
private ImageView UserIcon;
private TextView UserName;
private RelativeLayout InfoLayout;
public static final int ICON_SIZE=UI.dp2px(64);
private View getDrawerView() {
int w=UI.getAccentColor();
RoundLinearLayout layout=new RoundLinearLayout(this);
layout.setRadius(5f);
layout.setBackgroundColor(UI.getThemeColor());
layout.setOrientation(LinearLayout.VERTICAL);
InfoLayout = new RelativeLayout(this);
InfoLayout.setBackgroundResource(R.drawable.drawer_background);
layout.addView(InfoLayout, new LinearLayout.LayoutParams(DRAWER_WIDTH, DRAWER_WIDTH));
DrawerGradient = new GradientView(this);
InfoLayout.addView(DrawerGradient, new RelativeLayout.LayoutParams(-1, -1));
LoginLayout = new LinearLayout(this);
LoginLayout.setOrientation(LinearLayout.VERTICAL);
LoginLayout.setGravity(Gravity.CENTER);
LoginLayout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
});
ImageView UnknownIcon=new ImageView(this);
UnknownIcon.setImageDrawable(ui.tintDrawable(R.drawable.icon_user, w));
LoginLayout.addView(UnknownIcon, new LinearLayout.LayoutParams(ICON_SIZE, ICON_SIZE));
TextView Login=new TextView(this);
Login.setText(get(L.Login));
Login.setGravity(Gravity.CENTER);
Login.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 27);
Login.setTextColor(w);
LinearLayout.LayoutParams LoginTextParams=new LinearLayout.LayoutParams(-1, -2);
LoginTextParams.topMargin = UI.dp2px(20);
LoginLayout.addView(Login, LoginTextParams);
InfoLayout.addView(LoginLayout, new RelativeLayout.LayoutParams(-1, -1));
UserLayout = new RelativeLayout(this);
LinearLayout UserContentLayout = new LinearLayout(this);
UserContentLayout.setGravity(Gravity.CENTER);
UserContentLayout.setOrientation(LinearLayout.VERTICAL);
UserIcon = new ImageView(this);
UserIcon.setTag(-1);
UserIcon.setImageDrawable(ui.tintDrawable(R.drawable.icon_user, w));
UserContentLayout.addView(UserIcon, new LinearLayout.LayoutParams(ICON_SIZE, ICON_SIZE));
UserName = new TextView(this);
UserName.setGravity(Gravity.CENTER);
UserName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 27);
UserName.setTextColor(w);
UserContentLayout.addView(UserName, LoginTextParams);
ImageView Logout=new ImageView(this);
Logout.setImageResource(R.drawable.icon_logout);
Logout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
BmobUser.logOut();
fadeFromUserToLogin();
}
});
UserLayout.addView(UserContentLayout, new RelativeLayout.LayoutParams(-1, -1));
RelativeLayout.LayoutParams LogoutPara=new RelativeLayout.LayoutParams(UI.dp2px(32), UI.dp2px(32));
LogoutPara.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
LogoutPara.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
LogoutPara.rightMargin = LogoutPara.bottomMargin = UI.dp2px(16);
UserLayout.addView(Logout, LogoutPara);
InfoLayout.addView(UserLayout, new RelativeLayout.LayoutParams(-1, -1));
layout.setClickable(true);
ItemLayout = new LinearLayout(this);
ItemLayout.setOrientation(LinearLayout.VERTICAL);
//Items - Start
ItemLayout.addView(newItemView(R.drawable.icon_book, get(L.Title_Learn), new StartActivityListener(LearnListActivity.class)));
ItemLayout.addView(newItemView(R.drawable.icon_news, get(L.Notice), new OnClickListener() {
@Override
public void onClick(View v) {
noticeUi();
}
}));
ItemLayout.addView(newItemView(R.drawable.icon_app, get(L.Title_VApp), new StartActivityListener(VAppActivity.class)));
ItemLayout.addView(newItemView(R.drawable.icon_settings, get(L.Title_Setting), new StartActivityListener(SettingActivity.class)));
ItemLayout.addView(newItemView(R.drawable.v_about, get(L.Title_About), new StartActivityListener(AboutActivity.class)));
ItemLayout.addView(newItemView(R.drawable.icon_exit, get(L.Exit), new OnClickListener() {
@Override
public void onClick(View v) {
killAll();
}
}));
//Items - End
VScrollView ItemScroller=new VScrollView(this);
ItemScroller.setFillViewport(true);
ItemScroller.addView(ItemLayout, new VScrollView.LayoutParams(-1, -1));
layout.addView(ItemScroller, new LinearLayout.LayoutParams(-1, -1));
return layout;
}
private VListView NoticeList;
private NoticeAdapter NoticeAdapter;
private SwipeRefreshLayout NoticeRefresh;
private RelativeLayout NoticeLayout;
private CryView NoticeCry;
private void noticeUi() {
if (NoticeList != null) return;
NoticeLayout = new RelativeLayout(this);
NoticeCry = new CryView(this);
NoticeCry.setText(get(L.HereIsEmpty));
NoticeCry.setVisibility(View.GONE);
NoticeLayout.addView(NoticeCry, -1, -1);
NoticeList = new VListView(this);
NoticeAdapter = new NoticeAdapter(this);
NoticeList.setAdapter(NoticeAdapter);
NoticeList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int pos, long id) {
final NoticeEntity en=NoticeAdapter.get(pos);
ui.newAlertDialog().setTitle(en.Title).setMessage(en.Message).setCancelable(true).setNeutralButton(UI.getColorString(en.Author, Color.GRAY), false, null).setPositiveButton(get(L.OK), null).setNegativeButton(get(L.Copy), new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
((android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE)).setText(en.Message);
ui.print(get(L.Copied));
}
}).show();
}
});
NoticeRefresh = new SwipeRefreshLayout(this);
NoticeRefresh.setColorSchemeColors(new int[]{UI.getThemeColor()});
NoticeRefresh.addView(NoticeList);
NoticeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
loadNoticeData();
}
});
NoticeLayout.addView(NoticeRefresh, -1, -1);
NoticeList.setVisibility(View.GONE);
ui.newAlertDialog().setView(NoticeLayout).setCancelable(true).setOnCancelListener(new VAlertDialog.OnCancelListener() {
@Override
public void onCancel(VAlertDialog dialog) {
NoticeList = null;
NoticeAdapter = null;
NoticeRefresh = null;
NoticeLayout = null;
NoticeCry = null;
}
}).show();
loadNoticeData();
}
private void loadNoticeData() {
if (NoticeList == null) return;
NoticeRefresh.setRefreshing(true);
BmobQuery<NoticeEntity> q=new BmobQuery<>();
q.order("-updatedAt");
q.findObjects(new FindListener<NoticeEntity>() {
@Override
public void done(List<NoticeEntity> data, BmobException e) {
if (NoticeList == null) return;
if (e != null) {
NoticeRefresh.setRefreshing(false);
Global.onBmobErr(ui, e);
return;
}
NoticeAdapter.clear();
NoticeAdapter.addAll(data);
if (data.size() == 0) {
NoticeCry.setVisibility(View.VISIBLE);
NoticeList.setVisibility(View.GONE);
} else {
NoticeCry.setVisibility(View.GONE);
NoticeList.setVisibility(View.VISIBLE);
}
NoticeRefresh.setRefreshing(false);
}
});
}
private static class NoticeAdapter extends BaseAdapter {
private Context cx;
private ArrayList<NoticeEntity> All=new ArrayList<>();
public NoticeAdapter(Context cx) {
this.cx = cx;
}
@Override
public Object getItem(int pos) {
return All.get(pos);
}
@Override
public int getCount() {
return All.size();
}
public void add(NoticeEntity en) {
All.add(en);
notifyDataSetChanged();
}
public void remove(NoticeEntity en) {
All.remove(en);
notifyDataSetChanged();
}
public void remove(int index) {
All.remove(index);
notifyDataSetChanged();
}
public NoticeEntity get(int index) {
return All.get(index);
}
public void addAll(Collection<NoticeEntity> ens) {
All.addAll(ens);
notifyDataSetChanged();
}
public void clear() {
All.clear();
notifyDataSetChanged();
}
@Override
public long getItemId(int pos) {
return pos;
}
@Override
public View getView(int pos, View v, ViewGroup vg) {
int t=UI.dp2px(10);
LinearLayout root=new LinearLayout(cx);
root.setPadding(t, t, t, t);
root.setOrientation(LinearLayout.VERTICAL);
TextView Title=new TextView(cx);
Title.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
Title.setTextSize(30);
TextView Content=new TextView(cx);
Content.setEllipsize(TextUtils.TruncateAt.END);
Content.setMaxLines(3);
NoticeEntity en=All.get(pos);
Title.setText(en.Title);
Content.setText(en.Message);
root.addView(Title);
LinearLayout.LayoutParams para=new LinearLayout.LayoutParams(-1, -1);
para.topMargin = t;
root.addView(Content, para);
CardView Card=new CardView(cx);
Card.setRadius(10);
Card.addView(root);
ViewHolder holder=new ViewHolder();
holder.Card = Card;
holder.Title = Title;
holder.Content = Content;
holder.onThemeChange();
LinearLayout R=new LinearLayout(cx);
R.setTag(holder);
para = new LinearLayout.LayoutParams(-1, -1);
para.topMargin = para.bottomMargin = para.leftMargin = para.rightMargin = t;
R.addView(Card, para);
return R;
}
private static class ViewHolder {
public CardView Card;
public TextView Title,Content;
public void onThemeChange() {
Card.setBackgroundColor(UI.getThemeColor());
Title.setTextColor(UI.getAccentColor());
Content.setTextColor(UI.getAccentColor());
}
}
}
private void fadeFromUserToLogin() {
AlphaAnimation ani=new AlphaAnimation(1, 0);
ani.setDuration(700);
ani.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation ani) {}
@Override
public void onAnimationRepeat(Animation ani) {}
@Override
public void onAnimationEnd(Animation ani) {
UserLayout.setVisibility(View.GONE);
}
});
ani.setFillAfter(false);
UserLayout.startAnimation(ani);
ani = new AlphaAnimation(0, 1);
ani.setDuration(700);
ani.setFillAfter(false);
LoginLayout.setVisibility(View.VISIBLE);
LoginLayout.startAnimation(ani);
}
public static class StartActivityListener implements OnClickListener {
private Class<? extends Activity> _Class=null;
public StartActivityListener(Class<? extends Activity> clz) {
this._Class = clz;
}
@Override
public void onClick(View v) {
MainActivity.cx.startActivity(new Intent(MainActivity.cx, _Class));
}
}
private ArrayList<LinearLayout> Items=new ArrayList<>();
private View newItemView(int id, String title, OnClickListener click) {
int w=UI.getAccentColor();
LinearLayout layout=new LinearLayout(this);
layout.setOrientation(LinearLayout.HORIZONTAL);
layout.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
int p=UI.dp2px(12);
layout.setPadding(p, p, p * 2, p);
ImageView icon=new ImageView(this);
icon.setImageDrawable(DrawableHelper.getDrawable(id, w));
LinearLayout.LayoutParams para=new LinearLayout.LayoutParams(UI.dp2px(24), ui.dp2px(24));
para.rightMargin = UI.dp2px(10);
layout.addView(icon, para);
TextView t=new TextView(this);
t.setGravity(Gravity.LEFT);
t.setTextColor(w);
t.setText(title);
t.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
layout.addView(t);
layout.setClickable(true);
TypedValue value=new TypedValue();
getTheme().resolveAttribute(android.R.attr.selectableItemBackground, value, true);
TypedArray arr=getTheme().obtainStyledAttributes(value.resourceId, new int[] {android.R.attr.selectableItemBackground});
layout.setBackground(arr.getDrawable(0));
arr.recycle();
layout.setOnClickListener(click);
Items.add(layout);
return layout;
}
@Override
public void onThemeChange(String key) {
super.onThemeChange(key);
if (!key.equals(UI.THEME_UI_COLOR)) return;
int w=UI.getAccentColor();
((DrawerArrowDrawable) Title.getNavigationIcon()).setColor(UI.getAccentColor());
Drawer.getChildAt(1).setBackgroundColor(UI.getThemeColor());
ImageView iv;
for (LinearLayout one : Items) {
iv = (ImageView) one.getChildAt(0);
iv.setImageDrawable(UI.tintDrawable(iv.getDrawable(), w));
((TextView) one.getChildAt(1)).setTextColor(w);
}
FAB.setImageDrawable(DrawableHelper.getDrawable(R.drawable.v_add, UI.getAccentColor()));
FABCreateSimple.setImageDrawable(DrawableHelper.getDrawable(R.drawable.icon_activity, UI.getAccentColor()));
FABCreateConsole.setImageDrawable(DrawableHelper.getDrawable(R.drawable.icon_console, UI.getAccentColor()));
try {
ColorStateList cs=ColorStateList.valueOf(UI.getThemeColor());
FAB.setBackgroundTintList(cs);
FABCreateSimple.setBackgroundTintList(cs);
FABCreateConsole.setBackgroundTintList(cs);
} catch (Throwable e) {}
if (DrawerGradient != null) DrawerGradient.onThemeChange();
((ImageView) LoginLayout.getChildAt(0)).setImageDrawable(ui.tintDrawable(R.drawable.icon_user, w));
((TextView) LoginLayout.getChildAt(1)).setTextColor(w);
if (UserIcon.getTag() == -1) UserIcon.setImageDrawable(ui.tintDrawable(R.drawable.icon_user, w));
((TextView) ((ViewGroup) UserLayout.getChildAt(0)).getChildAt(1)).setTextColor(w);
VH.onThemeChange();
if (NoticeList != null) for (int i=0;i < NoticeList.getChildCount();i++) ((NoticeAdapter.ViewHolder) NoticeList.getChildAt(i).getTag()).onThemeChange();
if (NoticeList != null) {
NoticeList.setGlowColor(UI.getThemeColor());
NoticeRefresh.setColorSchemeColors(new int[]{UI.getThemeColor()});
}
}
int viewHeight;
public static int getSignature(Context cx) {
PackageManager pm=cx.getPackageManager();
try {
PackageInfo info=pm.getPackageInfo(cx.getPackageName(), PackageManager.GET_SIGNATURES);
StringBuffer b=new StringBuffer();
for (Signature one : info.signatures) b.append(one.toCharsString());
return b.toString().hashCode();
} catch (PackageManager.NameNotFoundException e) {e.printStackTrace();}
return -1;
}
private void createUI(final boolean app) {
VAlertDialog dialog=new VAlertDialog(this);
dialog.setTitle(get(L.Main_CreateProject)).setCancelable(true);
LinearLayout layout=new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
final VEditText ed=new VEditText(this);
ed.setHint(get(L.Main_AppName));
ed.setSingleLine();
final VEditText ped=new VEditText(this);
ped.setHint(get(L.Main_PackageName));
ped.setSingleLine();
layout.addView(ed);
layout.addView(ped);
dialog.setView(layout);
dialog.setPositiveButton(get(L.OK), false, new VAlertDialog.OnClickListener() {
@Override
public void onClick(VAlertDialog dialog, int pos) {
String name=ed.getText().toString();
String ill=Project.isAppNameValid(name);
if (ill != null) {
ed.setError(ill);
return;
}
String p=ped.getText().toString();
ill = Project.isPackageNameValid(p);
if (ill != null) {
ped.setError(ill);
return;
}
File f=new File(Project.PATH, name);
if (f.exists()) {
ed.setError(get(L.Main_ProjectAlreadyExist));
return;
}
try {
Project pro=Project.getInstance(f, true);
pro.setAppName(name);
pro.setPackageName(p);
Jsc sc=pro.addJs("Main.js", app ?JsExtend.JsVActivity: JsExtend.JsConsole);
pro.setMainJs(sc);
pro.saveManifest();
} catch (Exception e) {
err(e);
}
ui.print(get(L.Main_ProjectCreated));
dialog.dismiss();
VH.loadData();
}
});
dialog.show();
}
public void notifyProjectRename() {
VH.notifyProjectRename();
}
public void checkUpdate() {
try {
int c=getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
BmobQuery<AppEntity> q=new BmobQuery<>();
q.addWhereGreaterThan("VCode", c);
q.order("VCode");
q.findObjects(new FindListener<AppEntity>() {
@Override
public void done(List<AppEntity> data, BmobException e) {
if (e != null) return;
if (data == null || data.size() == 0) return;
final AppEntity en=data.get(0);
final File target=getUpdateFile(en.VName);
VAlertDialog dialog=ui.newAlertDialog();
dialog.setTitle(String.format(get(L.UpdateDes), en.VName))
.setMessage(en.Content)
.setCancelable(!en.Force)
.setNegativeButton(get(L.Cancel), null).setPositiveButton(get(L.Update), false, new VAlertDialog.OnClickListener() {
@Override
public void onClick(final VAlertDialog dialog, int pos) {
if (target.exists()) {
installApk(target);
dialog.dismiss();
}
dialog.setCancelable(false);
dialog.setPositiveButton("0%", false, null);
en.File.download(target, new DownloadFileListener() {
@Override
public void done(String path, BmobException e) {
dialog.dismiss();
if (e != null) {
Global.onBmobErr(ui, e);
return;
}
installApk(target);
}
@Override
public void onProgress(Integer pro, long size) {
dialog.setPositiveButton(pro + "%", false, null);
}
});
}
}).show();
}
});
} catch (Throwable t) {}
}
private void installApk(File f) {
Intent in = new Intent(Intent.ACTION_VIEW);
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
in.setDataAndType(Uri.fromFile(f), "application/vnd.android.package-archive");
}
public static File getUpdateFile(String n) {
File dir=new File(Environment.getExternalStorageDirectory(), "Android/data/com.jxs.vide/Update");
if (!dir.exists()) dir.mkdirs();
File want=new File(dir, n);
for (File one : dir.listFiles())
if (!one.equals(want)) one.delete();
return want;
}
@Override
protected void onDestroy() {
super.onDestroy();
ProjectViewHelper.recycle();
}
}
|
[
"250851048@qq.com"
] |
250851048@qq.com
|
ae10f3549a50a42249e5b748fb2d7d61a42a7c54
|
b295cffc1de37330b0b8d28a4d81faac01de7f22
|
/CODE/android/device/customer/HeranSMARTTV/apps/TV_APK/HTvPlayer/src/com/eostek/tv/player/business/TvDBManager.java
|
4e5b5d196ecbe76ce4d277bfcbd77e4ffde5eefe
|
[] |
no_license
|
windxixi/test
|
fc2487d73a959050d8ad37d718b09a243660ec64
|
278a167c26fb608f700b81656f32e734f536c9f9
|
refs/heads/master
| 2023-03-16T19:59:41.941474
| 2016-07-25T04:18:41
| 2016-07-25T04:18:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,574
|
java
|
package com.eostek.tv.player.business;
import java.util.ArrayList;
import java.util.List;
import com.eostek.tv.player.model.AdInfo;
import com.mstar.android.tv.TvCommonManager;
import com.mstar.android.tvapi.common.vo.ProgramInfo;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
public class TvDBManager {
private final String TAG = TvDBManager.class.getSimpleName();
private static TvDBManager mDbManager;
private Context mContext;
private SQLiteDatabase mDB = null;
private TvDBManager(Context context) {
mContext = context;
mDB = new TvDBHelper(context).getWritableDatabase();
}
public static TvDBManager getInstance(Context context) {
if (mDbManager == null) {
mDbManager = new TvDBManager(context);
}
return mDbManager;
}
/**
* insert one entry to table adinfo
*
* @param AdInfo
* @return
*/
public synchronized void insertAdInfo(AdInfo info) {
ContentValues cv = new ContentValues();
cv.put(TvDBHelper.AD_COLUMN_TITLE, info.getTitle());
cv.put(TvDBHelper.AD_COLUMN_UPDATEDATE, info.getUpdate_date());
cv.put(TvDBHelper.AD_COLUMN_UPDATETIME, info.getUpdate_time());
cv.put(TvDBHelper.AD_COLUMN_PICTURE_URL, info.getPic_url());
cv.put(TvDBHelper.AD_COLUMN_DESCRITPTION, info.getDescription());
cv.put(TvDBHelper.AD_COLUMN_DISMISS_TIME, info.getDismiss_time());
cv.put(TvDBHelper.AD_COLUMN_PROGRAMME_ID, info.getProgramme_id());
cv.put(TvDBHelper.AD_COLUMN_SOURCE, info.getSource());
cv.put(TvDBHelper.AD_COLUMN_WEBVIEW_URL, info.getWebview_url());
cv.put(TvDBHelper.AD_COLUMN_POSITION_X, info.getPos_x());
cv.put(TvDBHelper.AD_COLUMN_POSITION_Y, info.getPos_y());
cv.put(TvDBHelper.AD_COLUMN_SIZE, info.getSiz());
mDB.insert(TvDBHelper.AD_TABLE_NAME, null, cv);
}
/**
* query a list of AdInfo at certain condition
*
* @param selections
* @param whereArgs
* @return
*/
public synchronized List<AdInfo> getAdInfos(String selections, String[] whereArgs) {
List<AdInfo> list = new ArrayList<AdInfo>();
Cursor cursor = mDB.query(TvDBHelper.AD_TABLE_NAME, null, selections, whereArgs, null, null, null);
if (cursor != null) {
Log.i(TAG,"cursor count : " + cursor.getCount());
while (cursor.moveToNext()) {
AdInfo info = new AdInfo();
info.setTitle(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_TITLE)));
info.setUpdate_date(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_UPDATEDATE)));
info.setUpdate_time(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_UPDATETIME)));
info.setPic_url(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_PICTURE_URL)));
info.setDescription(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_DESCRITPTION)));
info.setDismiss_time(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_DISMISS_TIME)));
info.setProgramme_id(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_PROGRAMME_ID)));
info.setSource(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_SOURCE)));
info.setWebview_url(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_WEBVIEW_URL)));
info.setPos_x(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_POSITION_X)));
info.setPos_y(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_POSITION_Y)));
info.setSiz(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_SIZE)));
list.add(info);
}
cursor.close();
cursor = null;
}
return list;
}
/**
* get a list of current adinfos at specified source
*
* @param source : current source
* @param info : current programme info, only used when source is DTV/ATV, set null in other case
* @return
*/
public List<AdInfo> getCurrentAdInfo(int source, ProgramInfo info){
String[] whereArgs = new String[2];
String selections = TvDBHelper.AD_COLUMN_SOURCE + "=? AND " + TvDBHelper.AD_COLUMN_PROGRAMME_ID + "=?";
switch (source) {
case TvCommonManager.INPUT_SOURCE_ATV:
if (info == null)
return null;
whereArgs[0] = "ATV";
whereArgs[1] = String.valueOf(info.number);
Log.i(TAG, "atv info number : " + info.number);
break;
case TvCommonManager.INPUT_SOURCE_DTV:
if (info == null)
return null;
whereArgs[0] = "DTV";
whereArgs[1] = String.valueOf(info.serviceId);
Log.i(TAG, "dtv info serviceId : " + info.serviceId);
break;
case TvCommonManager.INPUT_SOURCE_HDMI:
whereArgs[0] = "HDMI1";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_HDMI2:
whereArgs[0] = "HDMI2";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_HDMI3:
whereArgs[0] = "HDMI3";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_CVBS:
whereArgs[0] = "AV";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_YPBPR:
whereArgs[0] = "YPBPR";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_VGA:
whereArgs[0] = "VGA";
whereArgs[1] = "0";
break;
default:
break;
}
return getAdInfos(selections, whereArgs);
}
/**
* empty data
*
* @param tablename
* @return
*/
public synchronized long emptyData(String tablename) {
return mDB.delete(tablename, null, null);
}
/**
* arbitrary sql
*
* @param sql statement
* @return
*/
public synchronized void execSQL(String sql) {
mDB.execSQL(sql);
}
}
|
[
"gracie.zhou@ieostek.com"
] |
gracie.zhou@ieostek.com
|
c5b142a8889b45f7f69712d80482da9c91aa8a28
|
3091bfc22b4dbf0693756dc487f94f1bec4b0054
|
/src/ctc_arrays_strings/BuySellStocks.java
|
e762211264af8537878b080089f3799e24afa145
|
[] |
no_license
|
nip572/Algorithms
|
f7dbd2e1466e845caa852c6faa26aa27801ad22a
|
34b30f7fa9a33a1927fb3523a97a46ea29b9d9ff
|
refs/heads/master
| 2020-07-03T13:14:57.383747
| 2017-02-22T22:22:54
| 2017-02-22T22:22:54
| 74,169,605
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 726
|
java
|
package ctc_arrays_strings;
/**
* Created by Nipun on 11/4/16.
*/
public class BuySellStocks {
public static int doOperation(int[] arr){
if(arr == null){
return -1;
}
int minElement = arr[0];
int maxDifference = arr[1] - arr[0];
for(int i = 1 ; i < arr.length ; i++){
if(arr[i] - minElement > maxDifference){
maxDifference = arr[i ] - minElement;
}
if(arr[i ] < minElement){
minElement = arr[i];
}
}
return maxDifference;
}
public static void main(String[] args){
int[] arr = {7,9,5,6,3,2};
System.out.println(doOperation(arr));
}
}
|
[
"nipun.ahuja572@gmail.com"
] |
nipun.ahuja572@gmail.com
|
713bada5082c42bedb71a0ff0e91232cd16ec610
|
29b93813623637676db1960490c309d6d3873d6e
|
/app/src/main/java/com/sz/jjj/remoteview/SendRemoteViewActivity.java
|
babeaca2fe2b5fcef36536e7aaae80e2fa0a427e
|
[] |
no_license
|
ewsq/jjjPlus
|
fd7cfc86d259a6abbf449313966095776164aeb2
|
8e1bd90f87fdd789187fead0bad7b6e05d404d14
|
refs/heads/master
| 2022-09-29T06:04:03.613482
| 2020-06-05T03:33:48
| 2020-06-05T03:33:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,786
|
java
|
package com.sz.jjj.remoteview;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.os.Process;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.RemoteViews;
import com.sz.jjj.R;
/**
* @author:jjj
* @data:2018/8/24
* @description:
*/
public class SendRemoteViewActivity extends AppCompatActivity {
public static final String ACTION_CLICK = "com.sz.jjj.remoteview.remote.click";
public static final String ACTION_REMOTE_VIEWS = "action_remote_views";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.notification_layout);
// 不可用
remoteViews.setImageViewResource(R.id.iv_icon, R.drawable.ic_launcher);
remoteViews.setTextViewText(R.id.tv_title, "打开RemoteViewActivity");
remoteViews.setTextViewText(R.id.tv_content, "msg from process:" + Process.myPid() + "\n" +
"打开SendRemoteViewActivity");
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
new Intent(this, RemoteViewActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent pendingIntent2 = PendingIntent.getActivity(this, 0,
new Intent(this, SendRemoteViewActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews.setOnClickPendingIntent(R.id.tv_title, pendingIntent);
remoteViews.setOnClickPendingIntent(R.id.tv_content, pendingIntent2);
Intent intent = new Intent(ACTION_CLICK);
intent.putExtra(ACTION_REMOTE_VIEWS, remoteViews);
sendBroadcast(intent);
}
}
|
[
"jiangjiaojiao@163.com"
] |
jiangjiaojiao@163.com
|
8b47585440c8e4e52f266f791cef5b2a90cf9fdf
|
fb39fdf9dd3131c8890f2728f52327c52d34dfe7
|
/DesignPattern/src/learn/lhb/design/patterns/principle/liskov/Liskov.java
|
cc024e477c00887d068f39c43af2fdc902492e9d
|
[] |
no_license
|
a782272323/Java-Design-patterns
|
ea2ad1addc201b0e1597c9d7b4881261d754a19d
|
a997a9215c75df3e889c01f7b14be4bd3509a43a
|
refs/heads/master
| 2021-03-04T22:16:17.786915
| 2021-02-20T12:04:07
| 2021-02-20T12:04:07
| 246,069,951
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,884
|
java
|
package learn.lhb.design.patterns.principle.liskov;
/**
* 里氏替换原则 案例 1
* 有缺陷,
* 解决方案:
* 1. 原来运行正常的相减功能发生了错误,原因是B类无意中重写类父类(A类)的方法,造成继承A类时,原有功能出错。
* 在实际编程中,常常会通过重写父类的方法完成新的功能,这样写起来虽然简单,但整个继承体系但复用性比较差,耦合也
* 随之增强,特别是运用多态比较频繁时
* 2. 通用但做法是: 把原来但父类(A类)和子类(B类)都继承一个更通俗的基类,原有的继承关系去掉,采用依赖,聚
* 合,组合等关系代替。
*
* @author 梁鸿斌
* @date 2020/3/17.
* @time 23:27
*/
public class Liskov {
public static void main(String[] args) {
A a = new A();
System.out.println("11 - 3 = " + a.func1(11, 3));
System.out.println("1 - 8 = "+ a.func1(1,8));
System.out.println("----------------------------");
B b = new B();
System.out.println("11 - 3 = " + b.func1(11, 3));
System.out.println("1 - 8 = " + b.func1(1, 8));
System.out.println("11 + 3 + 9 = "+ b.func2(11,3));
}
}
/**
* A 类
*/
class A {
/**
* 返回两个数的差
*
* @param num1
* @param num2
* @return
*/
public int func1(int num1, int num2) {
return num1 - num2;
}
}
/**
* B 类继承 A 类
* 增加了一个新的功能,完成两个数的相加,然后和9求和
*/
class B extends A {
/**
* 无意间重写了A类的func1()方法,但调用时没发现重写了父类的方法,导致出错
* @param a
* @param b
* @return
*/
public int func1(int a, int b) {
return a + b;
}
public int func2(int a, int b) {
return func1(a, b) + 9;
}
}
|
[
"782272323@qq.com"
] |
782272323@qq.com
|
f459d8a032def258b773231a5686d64d2e592fc8
|
c6b8061b42fa1e0392a4afe152123309293a15ad
|
/src/test/java/TestCompareEqual.java
|
323ee1931710bfb7d4f521d280832537184596e7
|
[] |
no_license
|
nachogarrone/while
|
71c82b429c8e67b86f85e9d38e71ccce0b9ffac6
|
03c551a3c7153b8ad3ac668fdbb1c9cd59cf74eb
|
refs/heads/master
| 2020-04-24T02:55:43.735910
| 2016-09-15T01:28:20
| 2016-09-15T01:28:20
| 66,890,637
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,561
|
java
|
import examples.while_ut1.ast.Assignment;
import examples.while_ut1.ast.CompareEqual;
import examples.while_ut1.ast.Numeral;
import examples.while_ut1.ast.Stmt;
import examples.while_ut1.parser.Parser;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Random;
/**
* Created by Emanuel Chalela on 31/8/2016.
*/
public class TestCompareEqual {
@Test
public void TestCompareEqualRandom(){
Random rand = new Random();
Assignment num1 = new Assignment("num1", Numeral.generate(rand, 0, 99));
Assert.assertNotNull(num1);
System.out.print("num1 = " + num1.expression + "\n");
Assignment num2 = new Assignment("num2", Numeral.generate(rand, 100, 199));
Assert.assertNotNull(num2);
System.out.print("num2 = " + num2.expression + "\n");
CompareEqual compareEq = new CompareEqual(num1.expression,num2.expression);
Boolean evaluate = (Boolean) compareEq.evaluate(new HashMap<String, Object>());
Assert.assertFalse(evaluate);
}
@Test
public void TestCompareEqual(){
try {
Stmt statement = (Stmt) (Parser.parse("{a = 3; b = 3; if (a == b) then { c = 1;} else { c = 0; }}").value);
HashMap<String, Object> evaluate = statement.evaluate(new HashMap<String, Object>());
Assert.assertEquals(1.0, evaluate.get("c"));
Assert.assertNotEquals(0.0, evaluate.get("c"));
} catch (Exception e) {
e.printStackTrace();
Assert.fail();
}
}
}
|
[
"emanuelchalela@gmail.com"
] |
emanuelchalela@gmail.com
|
46b4f3069200fa1bdd8d37801dba454c14c4c81c
|
88576fee161f49e36be24d7a2b29758601251710
|
/src/main/java/easy/IntegerBreak_343.java
|
8cd3b71563df1573e1543ebcfba0074abddcb677
|
[] |
no_license
|
gaoleigl/leetcode
|
c33f2fb08157624a8f170fb680c2052ba067b4f2
|
f2e78636dcfe3d29fe2c15ccc9a85dab22b21ade
|
refs/heads/master
| 2021-01-16T17:37:36.634779
| 2017-08-16T08:39:09
| 2017-08-16T08:39:09
| 100,009,411
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 364
|
java
|
package easy;
/**
* Created by Administrator on 2016/6/12 0012.
*/
public class IntegerBreak_343 {
public int integerBreak(int n) {
if(n == 2)
return 1;
if(n == 3)
return 2;
int res = 1;
while(n > 4) {
res *= 3;
n -= 3;
}
res *= n;
return res;
}
}
|
[
"gaolei@gegejia.com"
] |
gaolei@gegejia.com
|
f6b6cf88540dc52d5b3b75edc1323bec049834df
|
9ea97d5fbb61f30c44cb811193aa07bf0ff270bc
|
/MostReviewedProducts/src/main/java/com/finalproject/DriverClass.java
|
ca066711ac470bc9581b0461a12bba6151a5cbd2
|
[] |
no_license
|
mishraapoorva/AmazonReviewAnalysis
|
65c71431a64037b135af520855015958f1202d6e
|
7cc999990e90cd19fb1e04d15072e4a436ee1d54
|
refs/heads/master
| 2023-07-17T11:25:37.890164
| 2021-09-05T05:45:15
| 2021-09-05T05:45:15
| 403,211,856
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,437
|
java
|
package com.finalproject;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import java.io.IOException;
// Find the topN reviewed products sorted by count
// Here, secondary sorting technique is used with implementation of comparator class
public class DriverClass {
public static void main(String[] args) throws IOException {
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
try {
Job topNProductsJob = Job.getInstance(conf, "Top N Rated Products");
topNProductsJob.setJarByClass(DriverClass.class);
int N = 10;
topNProductsJob.getConfiguration().setInt("N", N);
topNProductsJob.setInputFormatClass(TextInputFormat.class);
topNProductsJob.setOutputFormatClass(TextOutputFormat.class);
topNProductsJob.setMapperClass(MapperClass.class);
topNProductsJob.setSortComparatorClass(CountComparator.class);
topNProductsJob.setReducerClass(ReducerClass.class);
topNProductsJob.setNumReduceTasks(1);
topNProductsJob.setMapOutputKeyClass(IntWritable.class);
topNProductsJob.setMapOutputValueClass(Text.class);
topNProductsJob.setOutputKeyClass(IntWritable.class);
topNProductsJob.setOutputValueClass(Text.class);
FileInputFormat.setInputPaths(topNProductsJob, new Path(args[0])); // Output file path of totalProducts - MR chaining
FileOutputFormat.setOutputPath(topNProductsJob, new Path(args[1]));
if (fs.exists(new Path(args[1]))) {
fs.delete(new Path(args[1]), true);
}
topNProductsJob.waitForCompletion(true);
} catch (Exception e) {
System.out.println("Something went wrong in main class: ");
e.printStackTrace();
}
}
}
|
[
"mishra.ap@northeastern.edu"
] |
mishra.ap@northeastern.edu
|
e6d3cd7b00992db56f6866212bc0d54b8358b665
|
650d5c9c56a6e004484422bfa4652a1131c420a2
|
/Block223v2/src/ca/mcgill/ecse223/block/model/Game.java
|
508246c875f8f0dc0a0d18d23b285e468ce2463b
|
[] |
no_license
|
mustafain117/Block-Breaker-Game
|
cfc6554cc595b8508e9d8eeacf56a25bafa07713
|
4693803d6bfcf057c48804437e7c6ebc15e31a90
|
refs/heads/master
| 2020-09-27T06:19:22.075701
| 2019-04-10T04:00:47
| 2019-04-10T04:00:47
| 226,450,033
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 23,922
|
java
|
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.29.0.4181.a593105a9 modeling language!*/
package ca.mcgill.ecse223.block.model;
import java.io.Serializable;
import java.util.*;
// line 47 "../../../../../Block223Update.ump"
// line 32 "../../../../../Block223Persistence.ump"
// line 50 "../../../../../Block223-v2.ump"
public class Game implements Serializable
{
//------------------------
// STATIC VARIABLES
//------------------------
public static final int MIN_NR_LEVELS = 1;
/**
* this is somewhat redundant because the max multiplicity is enforced by Umple
*/
public static final int MAX_NR_LEVELS = 99;
/**
* play area is now constant
*/
public static final int PLAY_AREA_SIDE = 390;
public static final int WALL_PADDING = 10;
public static final int COLUMNS_PADDING = 5;
public static final int ROW_PADDING = 2;
private static Map<String, Game> gamesByName = new HashMap<String, Game>();
//------------------------
// MEMBER VARIABLES
//------------------------
//Game Attributes
private boolean isPublished;
private String name;
private int nrBlocksPerLevel;
//Game Associations
private Admin admin;
private List<Block> blocks;
private List<Level> levels;
private List<BlockAssignment> blockAssignments;
private Ball ball;
private Paddle paddle;
private List<GameSession> gameSessions;
private List<Score> scores;
private Block223 block223;
//Helper Variables
private boolean canSetIsPublished;
//------------------------
// CONSTRUCTOR
//------------------------
public Game(String aName, int aNrBlocksPerLevel, Admin aAdmin, Ball aBall, Paddle aPaddle, Block223 aBlock223)
{
// line 67 "../../../../../Block223-v2.ump"
if(aName == null || aName.isEmpty() == true){
throw new RuntimeException("The name of the game must be unique.");
}
// END OF UMPLE BEFORE INJECTION
canSetIsPublished = true;
nrBlocksPerLevel = aNrBlocksPerLevel;
if (!setName(aName))
{
throw new RuntimeException("Cannot create due to duplicate name");
}
boolean didAddAdmin = setAdmin(aAdmin);
if (!didAddAdmin)
{
throw new RuntimeException("Unable to create game due to admin");
}
blocks = new ArrayList<Block>();
levels = new ArrayList<Level>();
blockAssignments = new ArrayList<BlockAssignment>();
if (aBall == null || aBall.getGame() != null)
{
throw new RuntimeException("Unable to create Game due to aBall");
}
ball = aBall;
if (aPaddle == null || aPaddle.getGame() != null)
{
throw new RuntimeException("Unable to create Game due to aPaddle");
}
paddle = aPaddle;
gameSessions = new ArrayList<GameSession>();
scores = new ArrayList<Score>();
boolean didAddBlock223 = setBlock223(aBlock223);
if (!didAddBlock223)
{
throw new RuntimeException("Unable to create game due to block223");
}
}
public Game(String aName, int aNrBlocksPerLevel, Admin aAdmin, int aMinBallSpeedXForBall, int aMinBallSpeedYForBall, double aBallSpeedIncreaseFactorForBall, int aMaxPaddleLengthForPaddle, int aMinPaddleLengthForPaddle, Block223 aBlock223)
{
// line 67 "../../../../../Block223-v2.ump"
if(aName == null || aName.isEmpty() == true){
throw new RuntimeException("The name of the game must be unique.");
}
// END OF UMPLE BEFORE INJECTION
isPublished = false;
name = aName;
nrBlocksPerLevel = aNrBlocksPerLevel;
boolean didAddAdmin = setAdmin(aAdmin);
if (!didAddAdmin)
{
throw new RuntimeException("Unable to create game due to admin");
}
blocks = new ArrayList<Block>();
levels = new ArrayList<Level>();
blockAssignments = new ArrayList<BlockAssignment>();
ball = new Ball(aMinBallSpeedXForBall, aMinBallSpeedYForBall, aBallSpeedIncreaseFactorForBall, this);
paddle = new Paddle(aMaxPaddleLengthForPaddle, aMinPaddleLengthForPaddle, this);
gameSessions = new ArrayList<GameSession>();
scores = new ArrayList<Score>();
boolean didAddBlock223 = setBlock223(aBlock223);
if (!didAddBlock223)
{
throw new RuntimeException("Unable to create game due to block223");
}
}
//------------------------
// INTERFACE
//------------------------
/* Code from template attribute_SetImmutable */
public boolean setIsPublished(boolean aIsPublished)
{
boolean wasSet = false;
if (!canSetIsPublished) { return false; }
canSetIsPublished = false;
isPublished = aIsPublished;
wasSet = true;
return wasSet;
}
public boolean setName(String aName)
{
boolean wasSet = false;
// line 67 "../../../../../Block223-v2.ump"
if(aName == null || aName.isEmpty() == true){
throw new RuntimeException("The name of the game must be unique.");
}
// END OF UMPLE BEFORE INJECTION
String anOldName = getName();
if (hasWithName(aName)) {
return wasSet;
}
name = aName;
wasSet = true;
if (anOldName != null) {
gamesByName.remove(anOldName);
}
gamesByName.put(aName, this);
return wasSet;
}
public boolean setNrBlocksPerLevel(int aNrBlocksPerLevel)
{
boolean wasSet = false;
nrBlocksPerLevel = aNrBlocksPerLevel;
wasSet = true;
return wasSet;
}
public boolean getIsPublished()
{
return isPublished;
}
public String getName()
{
return name;
}
/* Code from template attribute_GetUnique */
public static Game getWithName(String aName)
{
return gamesByName.get(aName);
}
/* Code from template attribute_HasUnique */
public static boolean hasWithName(String aName)
{
return getWithName(aName) != null;
}
public int getNrBlocksPerLevel()
{
return nrBlocksPerLevel;
}
/* Code from template attribute_IsBoolean */
public boolean isIsPublished()
{
return isPublished;
}
/* Code from template association_GetOne */
public Admin getAdmin()
{
return admin;
}
/* Code from template association_GetMany */
public Block getBlock(int index)
{
Block aBlock = blocks.get(index);
return aBlock;
}
public List<Block> getBlocks()
{
List<Block> newBlocks = Collections.unmodifiableList(blocks);
return newBlocks;
}
public int numberOfBlocks()
{
int number = blocks.size();
return number;
}
public boolean hasBlocks()
{
boolean has = blocks.size() > 0;
return has;
}
public int indexOfBlock(Block aBlock)
{
int index = blocks.indexOf(aBlock);
return index;
}
/* Code from template association_GetMany */
public Level getLevel(int index)
{
Level aLevel = levels.get(index);
return aLevel;
}
public List<Level> getLevels()
{
List<Level> newLevels = Collections.unmodifiableList(levels);
return newLevels;
}
public int numberOfLevels()
{
int number = levels.size();
return number;
}
public boolean hasLevels()
{
boolean has = levels.size() > 0;
return has;
}
public int indexOfLevel(Level aLevel)
{
int index = levels.indexOf(aLevel);
return index;
}
/* Code from template association_GetMany */
public BlockAssignment getBlockAssignment(int index)
{
BlockAssignment aBlockAssignment = blockAssignments.get(index);
return aBlockAssignment;
}
public List<BlockAssignment> getBlockAssignments()
{
List<BlockAssignment> newBlockAssignments = Collections.unmodifiableList(blockAssignments);
return newBlockAssignments;
}
public int numberOfBlockAssignments()
{
int number = blockAssignments.size();
return number;
}
public boolean hasBlockAssignments()
{
boolean has = blockAssignments.size() > 0;
return has;
}
public int indexOfBlockAssignment(BlockAssignment aBlockAssignment)
{
int index = blockAssignments.indexOf(aBlockAssignment);
return index;
}
/* Code from template association_GetOne */
public Ball getBall()
{
return ball;
}
/* Code from template association_GetOne */
public Paddle getPaddle()
{
return paddle;
}
/* Code from template association_GetMany */
public GameSession getGameSession(int index)
{
GameSession aGameSession = gameSessions.get(index);
return aGameSession;
}
public List<GameSession> getGameSessions()
{
List<GameSession> newGameSessions = Collections.unmodifiableList(gameSessions);
return newGameSessions;
}
public int numberOfGameSessions()
{
int number = gameSessions.size();
return number;
}
public boolean hasGameSessions()
{
boolean has = gameSessions.size() > 0;
return has;
}
public int indexOfGameSession(GameSession aGameSession)
{
int index = gameSessions.indexOf(aGameSession);
return index;
}
/* Code from template association_GetMany */
public Score getScore(int index)
{
Score aScore = scores.get(index);
return aScore;
}
public List<Score> getScores()
{
List<Score> newScores = Collections.unmodifiableList(scores);
return newScores;
}
public int numberOfScores()
{
int number = scores.size();
return number;
}
public boolean hasScores()
{
boolean has = scores.size() > 0;
return has;
}
public int indexOfScore(Score aScore)
{
int index = scores.indexOf(aScore);
return index;
}
/* Code from template association_GetOne */
public Block223 getBlock223()
{
return block223;
}
/* Code from template association_SetOneToMany */
public boolean setAdmin(Admin aAdmin)
{
boolean wasSet = false;
if (aAdmin == null)
{
return wasSet;
}
Admin existingAdmin = admin;
admin = aAdmin;
if (existingAdmin != null && !existingAdmin.equals(aAdmin))
{
existingAdmin.removeGame(this);
}
admin.addGame(this);
wasSet = true;
return wasSet;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfBlocks()
{
return 0;
}
/* Code from template association_AddManyToOne */
public Block addBlock(int aRed, int aGreen, int aBlue, int aPoints)
{
return new Block(aRed, aGreen, aBlue, aPoints, this);
}
public boolean addBlock(Block aBlock)
{
boolean wasAdded = false;
if (blocks.contains(aBlock)) { return false; }
Game existingGame = aBlock.getGame();
boolean isNewGame = existingGame != null && !this.equals(existingGame);
if (isNewGame)
{
aBlock.setGame(this);
}
else
{
blocks.add(aBlock);
}
wasAdded = true;
return wasAdded;
}
public boolean removeBlock(Block aBlock)
{
boolean wasRemoved = false;
//Unable to remove aBlock, as it must always have a game
if (!this.equals(aBlock.getGame()))
{
blocks.remove(aBlock);
wasRemoved = true;
}
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addBlockAt(Block aBlock, int index)
{
boolean wasAdded = false;
if(addBlock(aBlock))
{
if(index < 0 ) { index = 0; }
if(index > numberOfBlocks()) { index = numberOfBlocks() - 1; }
blocks.remove(aBlock);
blocks.add(index, aBlock);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveBlockAt(Block aBlock, int index)
{
boolean wasAdded = false;
if(blocks.contains(aBlock))
{
if(index < 0 ) { index = 0; }
if(index > numberOfBlocks()) { index = numberOfBlocks() - 1; }
blocks.remove(aBlock);
blocks.add(index, aBlock);
wasAdded = true;
}
else
{
wasAdded = addBlockAt(aBlock, index);
}
return wasAdded;
}
/* Code from template association_IsNumberOfValidMethod */
public boolean isNumberOfLevelsValid()
{
boolean isValid = numberOfLevels() >= minimumNumberOfLevels() && numberOfLevels() <= maximumNumberOfLevels();
return isValid;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfLevels()
{
return 1;
}
/* Code from template association_MaximumNumberOfMethod */
public static int maximumNumberOfLevels()
{
return 99;
}
/* Code from template association_AddMNToOnlyOne */
public Level addLevel()
{
if (numberOfLevels() >= maximumNumberOfLevels())
{
return null;
}
else
{
return new Level(this);
}
}
public boolean addLevel(Level aLevel)
{
boolean wasAdded = false;
if (levels.contains(aLevel)) { return false; }
if (numberOfLevels() >= maximumNumberOfLevels())
{
return wasAdded;
}
Game existingGame = aLevel.getGame();
boolean isNewGame = existingGame != null && !this.equals(existingGame);
if (isNewGame && existingGame.numberOfLevels() <= minimumNumberOfLevels())
{
return wasAdded;
}
if (isNewGame)
{
aLevel.setGame(this);
}
else
{
levels.add(aLevel);
}
wasAdded = true;
return wasAdded;
}
public boolean removeLevel(Level aLevel)
{
boolean wasRemoved = false;
//Unable to remove aLevel, as it must always have a game
if (this.equals(aLevel.getGame()))
{
return wasRemoved;
}
//game already at minimum (1)
if (numberOfLevels() <= minimumNumberOfLevels())
{
return wasRemoved;
}
levels.remove(aLevel);
wasRemoved = true;
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addLevelAt(Level aLevel, int index)
{
boolean wasAdded = false;
if(addLevel(aLevel))
{
if(index < 0 ) { index = 0; }
if(index > numberOfLevels()) { index = numberOfLevels() - 1; }
levels.remove(aLevel);
levels.add(index, aLevel);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveLevelAt(Level aLevel, int index)
{
boolean wasAdded = false;
if(levels.contains(aLevel))
{
if(index < 0 ) { index = 0; }
if(index > numberOfLevels()) { index = numberOfLevels() - 1; }
levels.remove(aLevel);
levels.add(index, aLevel);
wasAdded = true;
}
else
{
wasAdded = addLevelAt(aLevel, index);
}
return wasAdded;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfBlockAssignments()
{
return 0;
}
/* Code from template association_AddManyToOne */
public BlockAssignment addBlockAssignment(int aGridHorizontalPosition, int aGridVerticalPosition, Level aLevel, Block aBlock)
{
return new BlockAssignment(aGridHorizontalPosition, aGridVerticalPosition, aLevel, aBlock, this);
}
public boolean addBlockAssignment(BlockAssignment aBlockAssignment)
{
boolean wasAdded = false;
if (blockAssignments.contains(aBlockAssignment)) { return false; }
Game existingGame = aBlockAssignment.getGame();
boolean isNewGame = existingGame != null && !this.equals(existingGame);
if (isNewGame)
{
aBlockAssignment.setGame(this);
}
else
{
blockAssignments.add(aBlockAssignment);
}
wasAdded = true;
return wasAdded;
}
public boolean removeBlockAssignment(BlockAssignment aBlockAssignment)
{
boolean wasRemoved = false;
//Unable to remove aBlockAssignment, as it must always have a game
if (!this.equals(aBlockAssignment.getGame()))
{
blockAssignments.remove(aBlockAssignment);
wasRemoved = true;
}
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addBlockAssignmentAt(BlockAssignment aBlockAssignment, int index)
{
boolean wasAdded = false;
if(addBlockAssignment(aBlockAssignment))
{
if(index < 0 ) { index = 0; }
if(index > numberOfBlockAssignments()) { index = numberOfBlockAssignments() - 1; }
blockAssignments.remove(aBlockAssignment);
blockAssignments.add(index, aBlockAssignment);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveBlockAssignmentAt(BlockAssignment aBlockAssignment, int index)
{
boolean wasAdded = false;
if(blockAssignments.contains(aBlockAssignment))
{
if(index < 0 ) { index = 0; }
if(index > numberOfBlockAssignments()) { index = numberOfBlockAssignments() - 1; }
blockAssignments.remove(aBlockAssignment);
blockAssignments.add(index, aBlockAssignment);
wasAdded = true;
}
else
{
wasAdded = addBlockAssignmentAt(aBlockAssignment, index);
}
return wasAdded;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfGameSessions()
{
return 0;
}
/* Code from template association_AddManyToOne */
public GameSession addGameSession(Block223 aBlock223)
{
return new GameSession(this, aBlock223);
}
public boolean addGameSession(GameSession aGameSession)
{
boolean wasAdded = false;
if (gameSessions.contains(aGameSession)) { return false; }
Game existingGame = aGameSession.getGame();
boolean isNewGame = existingGame != null && !this.equals(existingGame);
if (isNewGame)
{
aGameSession.setGame(this);
}
else
{
gameSessions.add(aGameSession);
}
wasAdded = true;
return wasAdded;
}
public boolean removeGameSession(GameSession aGameSession)
{
boolean wasRemoved = false;
//Unable to remove aGameSession, as it must always have a game
if (!this.equals(aGameSession.getGame()))
{
gameSessions.remove(aGameSession);
wasRemoved = true;
}
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addGameSessionAt(GameSession aGameSession, int index)
{
boolean wasAdded = false;
if(addGameSession(aGameSession))
{
if(index < 0 ) { index = 0; }
if(index > numberOfGameSessions()) { index = numberOfGameSessions() - 1; }
gameSessions.remove(aGameSession);
gameSessions.add(index, aGameSession);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveGameSessionAt(GameSession aGameSession, int index)
{
boolean wasAdded = false;
if(gameSessions.contains(aGameSession))
{
if(index < 0 ) { index = 0; }
if(index > numberOfGameSessions()) { index = numberOfGameSessions() - 1; }
gameSessions.remove(aGameSession);
gameSessions.add(index, aGameSession);
wasAdded = true;
}
else
{
wasAdded = addGameSessionAt(aGameSession, index);
}
return wasAdded;
}
/* Code from template association_MinimumNumberOfMethod */
public static int minimumNumberOfScores()
{
return 0;
}
/* Code from template association_AddManyToOne */
public Score addScore(int aScore, User aUser, Block223 aBlock223)
{
return new Score(aScore, aUser, this, aBlock223);
}
public boolean addScore(Score aScore)
{
boolean wasAdded = false;
if (scores.contains(aScore)) { return false; }
Game existingGame = aScore.getGame();
boolean isNewGame = existingGame != null && !this.equals(existingGame);
if (isNewGame)
{
aScore.setGame(this);
}
else
{
scores.add(aScore);
}
wasAdded = true;
return wasAdded;
}
public boolean removeScore(Score aScore)
{
boolean wasRemoved = false;
//Unable to remove aScore, as it must always have a game
if (!this.equals(aScore.getGame()))
{
scores.remove(aScore);
wasRemoved = true;
}
return wasRemoved;
}
/* Code from template association_AddIndexControlFunctions */
public boolean addScoreAt(Score aScore, int index)
{
boolean wasAdded = false;
if(addScore(aScore))
{
if(index < 0 ) { index = 0; }
if(index > numberOfScores()) { index = numberOfScores() - 1; }
scores.remove(aScore);
scores.add(index, aScore);
wasAdded = true;
}
return wasAdded;
}
public boolean addOrMoveScoreAt(Score aScore, int index)
{
boolean wasAdded = false;
if(scores.contains(aScore))
{
if(index < 0 ) { index = 0; }
if(index > numberOfScores()) { index = numberOfScores() - 1; }
scores.remove(aScore);
scores.add(index, aScore);
wasAdded = true;
}
else
{
wasAdded = addScoreAt(aScore, index);
}
return wasAdded;
}
/* Code from template association_SetOneToMany */
public boolean setBlock223(Block223 aBlock223)
{
boolean wasSet = false;
if (aBlock223 == null)
{
return wasSet;
}
Block223 existingBlock223 = block223;
block223 = aBlock223;
if (existingBlock223 != null && !existingBlock223.equals(aBlock223))
{
existingBlock223.removeGame(this);
}
block223.addGame(this);
wasSet = true;
return wasSet;
}
public void delete()
{
gamesByName.remove(getName());
Admin placeholderAdmin = admin;
this.admin = null;
if(placeholderAdmin != null)
{
placeholderAdmin.removeGame(this);
}
while (blocks.size() > 0)
{
Block aBlock = blocks.get(blocks.size() - 1);
aBlock.delete();
blocks.remove(aBlock);
}
while (levels.size() > 0)
{
Level aLevel = levels.get(levels.size() - 1);
aLevel.delete();
levels.remove(aLevel);
}
while (blockAssignments.size() > 0)
{
BlockAssignment aBlockAssignment = blockAssignments.get(blockAssignments.size() - 1);
aBlockAssignment.delete();
blockAssignments.remove(aBlockAssignment);
}
Ball existingBall = ball;
ball = null;
if (existingBall != null)
{
existingBall.delete();
}
Paddle existingPaddle = paddle;
paddle = null;
if (existingPaddle != null)
{
existingPaddle.delete();
}
for(int i=gameSessions.size(); i > 0; i--)
{
GameSession aGameSession = gameSessions.get(i - 1);
aGameSession.delete();
}
for(int i=scores.size(); i > 0; i--)
{
Score aScore = scores.get(i - 1);
aScore.delete();
}
Block223 placeholderBlock223 = block223;
this.block223 = null;
if(placeholderBlock223 != null)
{
placeholderBlock223.removeGame(this);
}
}
// line 38 "../../../../../Block223Persistence.ump"
public static void reinitializeUniqueName(List<Game> games){
gamesByName = new HashMap<String, Game>();
for (Game game : games) {
gamesByName.put(game.getName(), game);
}
}
// line 73 "../../../../../Block223-v2.ump"
public Block findBlock(int id){
for(Block block: blocks){
if(id == block.getId()){
return block;
}
}
return null;
}
public String toString()
{
return super.toString() + "["+
"isPublished" + ":" + getIsPublished()+ "," +
"name" + ":" + getName()+ "," +
"nrBlocksPerLevel" + ":" + getNrBlocksPerLevel()+ "]" + System.getProperties().getProperty("line.separator") +
" " + "admin = "+(getAdmin()!=null?Integer.toHexString(System.identityHashCode(getAdmin())):"null") + System.getProperties().getProperty("line.separator") +
" " + "ball = "+(getBall()!=null?Integer.toHexString(System.identityHashCode(getBall())):"null") + System.getProperties().getProperty("line.separator") +
" " + "paddle = "+(getPaddle()!=null?Integer.toHexString(System.identityHashCode(getPaddle())):"null") + System.getProperties().getProperty("line.separator") +
" " + "block223 = "+(getBlock223()!=null?Integer.toHexString(System.identityHashCode(getBlock223())):"null");
}
//------------------------
// DEVELOPER CODE - PROVIDED AS-IS
//------------------------
// line 35 "../../../../../Block223Persistence.ump"
private static final long serialVersionUID = 8896099581655989380L ;
}
|
[
"mustafain.khan@mail.mcgill.ca"
] |
mustafain.khan@mail.mcgill.ca
|
4555bdd9af4cd7b36f1177deea93f9a30d9d4d48
|
c8b70575687ce8726e65a900fb667fb5c8ee0527
|
/app/src/main/java/com/example/firefly/database/dao/AEResultadosDao.java
|
0b75a50b54f0ed9e4947dae5502c61c4adce8f37
|
[] |
no_license
|
Amandab-u/Firefly_lighting
|
0e8e698347bb9d9d1c5cb9b150fbabc91b4273c1
|
fa6f1d8b6895f3dd6f7d698a66ce169767fa159c
|
refs/heads/master
| 2023-08-05T22:13:46.578224
| 2020-10-22T17:46:01
| 2020-10-22T17:46:01
| 306,422,370
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 269
|
java
|
package com.example.firefly.database.dao;
import androidx.room.Dao;
import androidx.room.Insert;
import com.example.firefly.database.entity.AEResultadosEntity;
@Dao
public interface AEResultadosDao {
@Insert
void insertResults(AEResultadosEntity result);
}
|
[
"barriossadl@gmail.com"
] |
barriossadl@gmail.com
|
af4b386ceb229cdb8738fae62ee5c0a506ab006f
|
7275a839a9ec92cf999581265d64e7206f7ae112
|
/app/src/test/java/com/example/hanjing/citytourapp/ExampleUnitTest.java
|
855b0f8f6b672e1a42ca9161bdf260315d01d1e3
|
[] |
no_license
|
nicolehanjing/CityTourApp
|
628822a0a3e8067520b4357a69d9773d48ad5dec
|
a30ad96cfd13db4b3640e06ccc2f361dea7dbafc
|
refs/heads/master
| 2023-01-03T14:39:08.629218
| 2020-10-17T00:13:55
| 2020-10-17T00:13:55
| 85,368,161
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 409
|
java
|
package com.example.hanjing.citytourapp;
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);
}
}
|
[
"hanjing@hanjingdeMacBook-Pro.local"
] |
hanjing@hanjingdeMacBook-Pro.local
|
74e6e0b36ca20cc00d85c28620a919b1cc40d29c
|
d86464ebaaadcbef167c168b10442d29ae7e2cea
|
/app/src/main/java/com/michelle_condon/is4401_finalyearproject/ProductCheck/ProductCheck2.java
|
3f32782880bd4563d9da5b9483c961fba9d8e8b2
|
[
"Apache-2.0"
] |
permissive
|
MichelleCondon/IS4401-FinalYearProject
|
1d38d03a443878443fb962fca3ac223c6a2ca50e
|
15fad85a08338f0fe51dc6a91df3f7f388d89b92
|
refs/heads/main
| 2023-03-25T04:48:36.763754
| 2021-03-26T19:58:58
| 2021-03-26T19:58:58
| 314,020,009
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,937
|
java
|
package com.michelle_condon.is4401_finalyearproject.ProductCheck;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import com.michelle_condon.is4401_finalyearproject.Adapters.HelperAdapter;
import com.michelle_condon.is4401_finalyearproject.BarcodeScanner.BarcodeScanner2;
import com.michelle_condon.is4401_finalyearproject.LoginScreen.MainActivity;
import com.michelle_condon.is4401_finalyearproject.Menus.MainMenu;
import com.michelle_condon.is4401_finalyearproject.Menus.AccountMenu;
import com.michelle_condon.is4401_finalyearproject.Models.FetchData;
import com.michelle_condon.is4401_finalyearproject.R;
import java.util.ArrayList;
import java.util.List;
import static com.michelle_condon.is4401_finalyearproject.BarcodeScanner.BarcodeScanner2.scanResult;
public class ProductCheck2 extends AppCompatActivity implements View.OnClickListener {
//Declare Variables
DatabaseReference mref;
List<FetchData> fetchData;
RecyclerView recyclerView;
HelperAdapter helperAdapter;
TextView txtSearch;
FirebaseAuth firebaseAuth;
FirebaseUser firebaseUser;
Button btnAccount, btnCamera;
String result;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_check2);
//Bottom Navigation Bar
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@SuppressLint("NonConstantResourceId")
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.action_account:
account();
break;
case R.id.action_home:
home();
break;
case R.id.action_signout:
signout();
break;
}
return true;
}
});
//Assigning values to the variables declared above
firebaseAuth = FirebaseAuth.getInstance();
firebaseUser = firebaseAuth.getCurrentUser();
btnAccount = (Button) findViewById(R.id.btnAccount);
btnAccount.setOnClickListener(this);
btnAccount.setText(firebaseUser.getEmail());
btnCamera = (Button) findViewById(R.id.btnCamera);
//Connecion to the Firebase object "Items"
mref = FirebaseDatabase.getInstance().getReference("Items");
recyclerView = findViewById(R.id.ListRecyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
fetchData = new ArrayList<>();
result = scanResult;
txtSearch = (TextView) findViewById(R.id.txtSearch);
txtSearch.setText(result);
searchProduct(result);
ValueEventListener event = new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
};
mref.addListenerForSingleValueEvent(event);
}
//Searching for an product based off the barcode from Firebase using the camera
private void searchProduct(String result) {
Query query = mref.orderByChild("barcode").equalTo(result);
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
for (DataSnapshot ds : snapshot.getChildren()) {
//Calling FetchData class to utilise the getters within the class
FetchData data = ds.getValue(FetchData.class);
fetchData.add(data);
}
//Calls the helper adapter class to manage the layout of the displayed items using a view holder class
helperAdapter = new HelperAdapter(fetchData);
recyclerView.setAdapter(helperAdapter);
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
private void signout() {
startActivity(new Intent(this, MainActivity.class));
}
private void home() {
startActivity(new Intent(this, MainMenu.class));
}
private void account() {
startActivity(new Intent(this, AccountMenu.class));
}
@Override
public void onClick(View v) {
//Java switch statement
//Account button
switch (v.getId()) {
//Account button
case R.id.btnAccount:
startActivity(new Intent(this, AccountMenu.class));
break;
case R.id.btnCamera:
startActivity(new Intent(this, BarcodeScanner2.class));
break;
}
}
}
|
[
"117320951@umail.ucc.ie"
] |
117320951@umail.ucc.ie
|
c538766eff7fc80715f4c1bf394cfdb6fc80c6b0
|
7139a7f7060df08736ae835917df7fe588c3b76d
|
/clients/src/com/lgli/socetclient/TCPClient.java
|
846a8de36b17105809234b91d6c6ed9f4f2b1f59
|
[] |
no_license
|
lgli/soketChat
|
1008514b038a600bcaaee7d764a756805e3b2fb5
|
e637c988d85a2f07bc6173cde9a2ee86d76d6e6a
|
refs/heads/master
| 2022-06-02T06:03:27.760547
| 2020-05-04T12:38:20
| 2020-05-04T12:38:20
| 261,052,869
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,168
|
java
|
package com.lgli.socetclient;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.Scanner;
/**
* TCPClient
* 客户端发送请求连接
* @author lgli
* @since 1.0
*/
public class TCPClient {
public static void main(String[] args) throws Exception{
System.out.println("开始连接localhost服务端......");
Socket socket = new Socket("localhost",8080);
System.out.println("连接localhost服务端成功......");
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
while(true){
//持续输入数据
Scanner scanner = new Scanner(System.in);
String next = scanner.next();
writer.write(next);
writer.newLine();
writer.flush();
//读取服务端发送的数据
String s = reader.readLine();
System.out.println("服务端:"+s);
}
}
}
|
[
"394311464@qq.com"
] |
394311464@qq.com
|
864b0b3f15f332c9ae80c4c65c7ee6b73a7d31cb
|
c62b1c031bfaef2567b52f20bb4448e9b488ab4f
|
/src/test/java/ch/grengine/load/BytecodeClassLoaderConcurrencyTest.java
|
0b418d642f96df89512bf5eeba373dea2e3a8a16
|
[
"Apache-2.0"
] |
permissive
|
hastebrot/grengine
|
2be8bb79c2bde0701c776893d00bf6bd3263348e
|
7f61770824de508f5aa8d675fa4f99310de8569f
|
refs/heads/master
| 2021-01-11T00:09:21.574608
| 2014-10-11T11:47:31
| 2014-10-11T11:47:31
| 25,235,706
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,062
|
java
|
/*
Copyright 2014-now by Alain Stalder. Made in Switzerland.
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 ch.grengine.load;
import static org.junit.Assert.assertFalse;
import java.util.Set;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import ch.grengine.code.Code;
import ch.grengine.code.groovy.DefaultGroovyCompiler;
import ch.grengine.source.DefaultSourceFactory;
import ch.grengine.source.Source;
import ch.grengine.source.SourceFactory;
import ch.grengine.source.SourceUtil;
import ch.grengine.sources.Sources;
import ch.grengine.sources.SourcesUtil;
public class BytecodeClassLoaderConcurrencyTest {
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
private class SlowBytecodeClassLoader extends BytecodeClassLoader {
private final long delayMs;
public SlowBytecodeClassLoader(BytecodeClassLoader loader, long delayMs) {
super(loader.getParent(), loader.getLoadMode(), loader.getCode());
this.delayMs = delayMs;
}
// slow down within the synchronized block where the class is defined
void definePackage(String name) {
String threadName = Thread.currentThread().getName();
System.out.println(threadName + " --- about to sleep " + delayMs + "ms");
try {
Thread.sleep(delayMs);
} catch (InterruptedException e) {
setFailed(true);
}
System.out.println(threadName + " --- done sleeping");
}
}
private volatile boolean failed;
public void setFailed(boolean failed) {
this.failed = failed;
}
@Test
public void testConcurrent() throws Exception {
ClassLoader parent = Thread.currentThread().getContextClassLoader();
LoadMode loadMode = LoadMode.CURRENT_FIRST;
DefaultGroovyCompiler c = new DefaultGroovyCompiler();
SourceFactory f = new DefaultSourceFactory();
Source s1 = f.fromText("class Class1 {}");
Set<Source> sourceSet = SourceUtil.sourceArrayToSourceSet(s1);
Sources sources = SourcesUtil.sourceSetToSources(sourceSet, "test");
Code code = c.compile(sources);
BytecodeClassLoader loader = new BytecodeClassLoader(parent, loadMode, code);
final SlowBytecodeClassLoader slowLoader = new SlowBytecodeClassLoader(loader, 100);
final int nThreads = 5;
Thread[] threads = new Thread[nThreads];
for (int i=0; i<nThreads; i++) {
final int x = i;
threads[i] = new Thread(
new Runnable() {
public void run() {
try {
String threadName = "Thread-" + x;
Thread.currentThread().setName(threadName);
System.out.println(threadName + " about to load...");
slowLoader.loadClass("Class1");
System.out.println(threadName + " loaded.");
} catch (Exception e) {
setFailed(true);
}
}
});
}
for (Thread t : threads) {
t.start();
}
for (Thread t : threads) {
t.join();
}
assertFalse(failed);
}
}
|
[
"jex@jexler.net"
] |
jex@jexler.net
|
8c74623cc62b100492d3b03998f9740a19b6c5ab
|
47b3bf9a5e05464dd495c069f2140ac33bc97e38
|
/src/anime/persistence/PersistenceXStream.java
|
00740db0a53801375b6f5469ab973227aed1162e
|
[] |
no_license
|
patlai/anime-suggest-java
|
d0f1aad5b7ad0e5c0b70edb3a3c9b42d5c0c11b6
|
e5b7d63181e54fe079b775efa5d44fcb11215b71
|
refs/heads/master
| 2020-07-02T07:42:44.849295
| 2017-05-24T14:11:18
| 2017-05-24T14:11:18
| 74,319,601
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,101
|
java
|
package anime.persistence;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import com.thoughtworks.xstream.XStream;
public class PersistenceXStream {
private static XStream xstream = new XStream();
private static String filename = "data.xml";
public static boolean saveToXMLwithXStream(Object obj) {
xstream.setMode(XStream.ID_REFERENCES);
String xml = xstream.toXML(obj); // save our xml file
try {
FileWriter writer = new FileWriter(filename);
writer.write(xml);
writer.close();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
public static Object loadFromXMLwithXStream() {
xstream.setMode(XStream.ID_REFERENCES);
try {
FileReader fileReader = new FileReader(filename); // load our xml file
return xstream.fromXML(fileReader);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
public static void setAlias(String xmlTagName, Class<?> className) {
xstream.alias(xmlTagName, className);
}
public static void setFilename(String fn) {
filename = fn;
}
}
|
[
"patricklai@Patricks-MacBook-Pro.local"
] |
patricklai@Patricks-MacBook-Pro.local
|
b43ee458f32f2892645ee9e7542662950f7c0ad5
|
c3b99ff9421a0e36dcea4b641744d511e9194164
|
/src/patterns/sierra_bates_patterns/observer/weather_station/observer_interfaces/Observer.java
|
a540ca8d62e60f7218133d4c22eb75bec1216d4e
|
[] |
no_license
|
NickMatvienko/matv1
|
ec7f3791663e1067c9fcc12b20536deb5fd93a9d
|
f71ddf01a534614a6669bd8ad200a34a0817b18d
|
refs/heads/master
| 2021-01-13T14:40:10.907506
| 2017-05-03T06:03:03
| 2017-05-03T06:03:03
| 79,710,113
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 215
|
java
|
package patterns.sierra_bates_patterns.observer.weather_station.observer_interfaces;
/**
* Created by a on 13.02.17.
*/
public interface Observer {
void update(float temp, float humidity, float pressure) ;
}
|
[
"matv008@gmail.com"
] |
matv008@gmail.com
|
8973e0aa273374be531c13afa12cc045ef1a3139
|
7a5e508c9314d7037b360207416f1c551820ad11
|
/src/main/java/com/itianyi/core/utils/CacheUtils.java
|
66d5f176ec59e988c280d5e7427befd264c6a392
|
[
"MIT"
] |
permissive
|
a123993930/youngfm
|
1f1e94984e7c9e24fb35fac239e9ce6a9a010733
|
c9df8e7acaa95bc6b9552f85fb3337920d2879ce
|
refs/heads/master
| 2020-03-11T17:10:02.910873
| 2018-04-19T01:05:12
| 2018-04-19T01:05:12
| 130,139,336
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,180
|
java
|
package com.itianyi.core.utils;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
/**
*
* All rights Reserved, Designed By www.jeeweb.cn
* @title: CacheUtils.java
* @package com.itianyi.core.utils
* @description: Cache工具类
* @author
* @date: 2017年6月27日 下午10:41:03
* @version V1.0
* @copyright: 2017 www.jeeweb.cn Inc. All rights reserved.
*
*/
public class CacheUtils {
private static CacheManager cacheManager = ((CacheManager) SpringContextHolder.getBean("ehcacheManager"));
private static final String SYS_CACHE = "sysCache";
/**
* 获取SYS_CACHE缓存
*
* @param key
* @return
*/
public static Object get(String key) {
return get(SYS_CACHE, key);
}
/**
* 写入SYS_CACHE缓存
*
* @param key
* @return
*/
public static void put(String key, Object value) {
put(SYS_CACHE, key, value);
}
/**
* 从SYS_CACHE缓存中移除
*
* @param key
* @return
*/
public static void remove(String key) {
remove(SYS_CACHE, key);
}
/**
* 获取缓存
*
* @param cacheName
* @param key
* @return
*/
public static Object get(String cacheName, String key) {
Element element = getCache(cacheName).get(key);
return element == null ? null : element.getObjectValue();
}
/**
* 写入缓存
*
* @param cacheName
* @param key
* @param value
*/
public static void put(String cacheName, String key, Object value) {
Element element = new Element(key, value);
getCache(cacheName).put(element);
}
/**
* 从缓存中移除
*
* @param cacheName
* @param key
*/
public static void remove(String cacheName, String key) {
getCache(cacheName).remove(key);
}
/**
* 获得一个Cache,没有则创建一个。
*
* @param cacheName
* @return
*/
private static Cache getCache(String cacheName) {
Cache cache = cacheManager.getCache(cacheName);
if (cache == null) {
cacheManager.addCache(cacheName);
cache = cacheManager.getCache(cacheName);
cache.getCacheConfiguration().setEternal(true);
}
return cache;
}
public static CacheManager getCacheManager() {
return cacheManager;
}
}
|
[
"123993930@qq.com"
] |
123993930@qq.com
|
392652ffa9c116bd6185fad65492b15bafd2e601
|
9ee285a479113b20e3552280dce4ef81cd13abef
|
/lockMgr/src/com/lockMgr/service/IViewhistoryService.java
|
8fa2c27fe24b8507e3812b61446a69a679c67866
|
[] |
no_license
|
xiaopohai85707/lockMgr
|
fd71cc80a341e652efafc59250d2136608557f36
|
88eb15ec7938c7eb669541f86b6398704223d4d5
|
refs/heads/master
| 2021-01-13T04:43:31.562532
| 2017-01-18T04:22:15
| 2017-01-18T04:22:15
| 79,210,624
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 173
|
java
|
package com.lockMgr.service;
import com.lockMgr.core.IBaseDao;
import com.lockMgr.pojo.Viewhistory;
public interface IViewhistoryService extends IBaseDao<Viewhistory>{
}
|
[
"liangzaichao@vip.qq.com"
] |
liangzaichao@vip.qq.com
|
390ef7d216b8ba24c2301c8a1f41c5662daa6da7
|
6cce992b8e7b9cd558160e857e73744121c35224
|
/src/main/java/com/github/qlone/parse/annotation/Attr.java
|
d46e06baaa96f7d0087e4b737d97e3767cdf404b
|
[] |
no_license
|
Qlone/retrofit-crawler
|
261b5448ce2a21dc0a2be6a91ded01b9562f93e8
|
b7034da389d8fc01bd4463c488f903cc0d396d76
|
refs/heads/master
| 2023-04-11T02:05:13.720809
| 2021-04-22T12:29:48
| 2021-04-22T12:29:48
| 315,248,321
| 8
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 510
|
java
|
package com.github.qlone.parse.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* @author heweinan
* @date 2020-11-06 15:27
*/
@Documented
@Target(FIELD)
@Retention(RUNTIME)
public @interface Attr{
String value();
String attr();
int skip() default 0;
int size() default Integer.MAX_VALUE;
}
|
[
"heweinan95@cmbchina.com"
] |
heweinan95@cmbchina.com
|
2fc5fe85e878caa57e52eb399d196c209e946590
|
aff0784bd88aa09f1588ae83d4a60977c8ee9327
|
/src/main/java/co/com/paisesmodel/controller/PaisesController.java
|
da951d3e79709e83baa3c0ede67ff4ee9e33f4ec
|
[] |
no_license
|
sisazago/PaisesModel
|
f954eb1930a86bc8896e1bc200de9ca2440d3eb4
|
30785f3b6ed27fb61bd9859ad6b898ea13757050
|
refs/heads/master
| 2021-01-10T03:19:39.919732
| 2015-12-18T03:03:09
| 2015-12-18T03:03:09
| 48,211,395
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 420
|
java
|
package co.com.paisesmodel.controller;
import co.com.paisesmodel.dominio.Paises;
import org.springframework.roo.addon.web.mvc.controller.scaffold.RooWebScaffold;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/paiseses")
@Controller
@RooWebScaffold(path = "paiseses", formBackingObject = Paises.class)
public class PaisesController {
}
|
[
"sebastianisazagomez@gmail.com"
] |
sebastianisazagomez@gmail.com
|
1f530257676f166722dc2d2ba7edaa52ef748978
|
5443cdc9223500dfb4b88d38f38b467691a571ea
|
/src/main/java/com/florist/NetFlorist/model/Provinces.java
|
0c6ab288b8233ef504b35d8418c27da3ba422df2
|
[] |
no_license
|
kaybee2417Dev/NetFlorist-Project
|
c80a9a9cd7687eedf48328e0bb0a0b9e2fb5ef59
|
62e20a706548a9b09d493f60ad2217e1bfc4125e
|
refs/heads/master
| 2021-08-22T20:41:14.865562
| 2017-12-01T07:25:36
| 2017-12-01T07:25:36
| 110,842,096
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,025
|
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 com.florist.NetFlorist.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author User
*/
@Entity
@Table(name = "provinces")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Provinces.findAll", query = "SELECT p FROM Provinces p")
, @NamedQuery(name = "Provinces.findByProvinceID", query = "SELECT p FROM Provinces p WHERE p.provinceID = :provinceID")
, @NamedQuery(name = "Provinces.findByName", query = "SELECT p FROM Provinces p WHERE p.name = :name")})
public class Provinces implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "provinceID")
private Integer provinceID;
@Column(name = "name")
private String name;
public Provinces() {
}
public Provinces(Integer provinceID) {
this.provinceID = provinceID;
}
public Provinces(Integer provinceID, String name) {
this.provinceID = provinceID;
this.name = name;
}
public Integer getProvinceID() {
return provinceID;
}
public void setProvinceID(Integer provinceID) {
this.provinceID = provinceID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
[
"User@RSS31.Reverside.co.za"
] |
User@RSS31.Reverside.co.za
|
fe6411e2ce4a2b6702a991ebb18ffd32fddece21
|
62c92bf622dab007d353862babe48b25b71ba5b1
|
/wljt-boot-web/src/main/java/com/yonyou/wljt/pojo/UserVOExample.java
|
6488c814b7fef467675ae9a8a5e28b1cf83ec611
|
[] |
no_license
|
zhangjbf/ssm
|
2ab62ccf96db8190ce084cfaf12f8a81abea385d
|
e66d14a81d350163b0fb082d683bcff99656b599
|
refs/heads/master
| 2020-03-27T05:58:40.037801
| 2018-10-06T07:16:15
| 2018-10-06T07:16:15
| 146,068,381
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 66,833
|
java
|
package com.yonyou.wljt.pojo;
import java.util.ArrayList;
import java.util.List;
public class UserVOExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserVOExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCuseridIsNull() {
addCriterion("CUSERID is null");
return (Criteria) this;
}
public Criteria andCuseridIsNotNull() {
addCriterion("CUSERID is not null");
return (Criteria) this;
}
public Criteria andCuseridEqualTo(String value) {
addCriterion("CUSERID =", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridNotEqualTo(String value) {
addCriterion("CUSERID <>", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridGreaterThan(String value) {
addCriterion("CUSERID >", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridGreaterThanOrEqualTo(String value) {
addCriterion("CUSERID >=", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridLessThan(String value) {
addCriterion("CUSERID <", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridLessThanOrEqualTo(String value) {
addCriterion("CUSERID <=", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridLike(String value) {
addCriterion("CUSERID like", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridNotLike(String value) {
addCriterion("CUSERID not like", value, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridIn(List<String> values) {
addCriterion("CUSERID in", values, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridNotIn(List<String> values) {
addCriterion("CUSERID not in", values, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridBetween(String value1, String value2) {
addCriterion("CUSERID between", value1, value2, "cuserid");
return (Criteria) this;
}
public Criteria andCuseridNotBetween(String value1, String value2) {
addCriterion("CUSERID not between", value1, value2, "cuserid");
return (Criteria) this;
}
public Criteria andVdef1IsNull() {
addCriterion("VDEF1 is null");
return (Criteria) this;
}
public Criteria andVdef1IsNotNull() {
addCriterion("VDEF1 is not null");
return (Criteria) this;
}
public Criteria andVdef1EqualTo(String value) {
addCriterion("VDEF1 =", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1NotEqualTo(String value) {
addCriterion("VDEF1 <>", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1GreaterThan(String value) {
addCriterion("VDEF1 >", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1GreaterThanOrEqualTo(String value) {
addCriterion("VDEF1 >=", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1LessThan(String value) {
addCriterion("VDEF1 <", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1LessThanOrEqualTo(String value) {
addCriterion("VDEF1 <=", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1Like(String value) {
addCriterion("VDEF1 like", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1NotLike(String value) {
addCriterion("VDEF1 not like", value, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1In(List<String> values) {
addCriterion("VDEF1 in", values, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1NotIn(List<String> values) {
addCriterion("VDEF1 not in", values, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1Between(String value1, String value2) {
addCriterion("VDEF1 between", value1, value2, "vdef1");
return (Criteria) this;
}
public Criteria andVdef1NotBetween(String value1, String value2) {
addCriterion("VDEF1 not between", value1, value2, "vdef1");
return (Criteria) this;
}
public Criteria andUsercodeIsNull() {
addCriterion("USERCODE is null");
return (Criteria) this;
}
public Criteria andUsercodeIsNotNull() {
addCriterion("USERCODE is not null");
return (Criteria) this;
}
public Criteria andUsercodeEqualTo(String value) {
addCriterion("USERCODE =", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeNotEqualTo(String value) {
addCriterion("USERCODE <>", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeGreaterThan(String value) {
addCriterion("USERCODE >", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeGreaterThanOrEqualTo(String value) {
addCriterion("USERCODE >=", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeLessThan(String value) {
addCriterion("USERCODE <", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeLessThanOrEqualTo(String value) {
addCriterion("USERCODE <=", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeLike(String value) {
addCriterion("USERCODE like", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeNotLike(String value) {
addCriterion("USERCODE not like", value, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeIn(List<String> values) {
addCriterion("USERCODE in", values, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeNotIn(List<String> values) {
addCriterion("USERCODE not in", values, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeBetween(String value1, String value2) {
addCriterion("USERCODE between", value1, value2, "usercode");
return (Criteria) this;
}
public Criteria andUsercodeNotBetween(String value1, String value2) {
addCriterion("USERCODE not between", value1, value2, "usercode");
return (Criteria) this;
}
public Criteria andVdef2IsNull() {
addCriterion("VDEF2 is null");
return (Criteria) this;
}
public Criteria andVdef2IsNotNull() {
addCriterion("VDEF2 is not null");
return (Criteria) this;
}
public Criteria andVdef2EqualTo(String value) {
addCriterion("VDEF2 =", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2NotEqualTo(String value) {
addCriterion("VDEF2 <>", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2GreaterThan(String value) {
addCriterion("VDEF2 >", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2GreaterThanOrEqualTo(String value) {
addCriterion("VDEF2 >=", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2LessThan(String value) {
addCriterion("VDEF2 <", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2LessThanOrEqualTo(String value) {
addCriterion("VDEF2 <=", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2Like(String value) {
addCriterion("VDEF2 like", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2NotLike(String value) {
addCriterion("VDEF2 not like", value, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2In(List<String> values) {
addCriterion("VDEF2 in", values, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2NotIn(List<String> values) {
addCriterion("VDEF2 not in", values, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2Between(String value1, String value2) {
addCriterion("VDEF2 between", value1, value2, "vdef2");
return (Criteria) this;
}
public Criteria andVdef2NotBetween(String value1, String value2) {
addCriterion("VDEF2 not between", value1, value2, "vdef2");
return (Criteria) this;
}
public Criteria andVdef3IsNull() {
addCriterion("VDEF3 is null");
return (Criteria) this;
}
public Criteria andVdef3IsNotNull() {
addCriterion("VDEF3 is not null");
return (Criteria) this;
}
public Criteria andVdef3EqualTo(String value) {
addCriterion("VDEF3 =", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3NotEqualTo(String value) {
addCriterion("VDEF3 <>", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3GreaterThan(String value) {
addCriterion("VDEF3 >", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3GreaterThanOrEqualTo(String value) {
addCriterion("VDEF3 >=", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3LessThan(String value) {
addCriterion("VDEF3 <", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3LessThanOrEqualTo(String value) {
addCriterion("VDEF3 <=", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3Like(String value) {
addCriterion("VDEF3 like", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3NotLike(String value) {
addCriterion("VDEF3 not like", value, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3In(List<String> values) {
addCriterion("VDEF3 in", values, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3NotIn(List<String> values) {
addCriterion("VDEF3 not in", values, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3Between(String value1, String value2) {
addCriterion("VDEF3 between", value1, value2, "vdef3");
return (Criteria) this;
}
public Criteria andVdef3NotBetween(String value1, String value2) {
addCriterion("VDEF3 not between", value1, value2, "vdef3");
return (Criteria) this;
}
public Criteria andVdef4IsNull() {
addCriterion("VDEF4 is null");
return (Criteria) this;
}
public Criteria andVdef4IsNotNull() {
addCriterion("VDEF4 is not null");
return (Criteria) this;
}
public Criteria andVdef4EqualTo(String value) {
addCriterion("VDEF4 =", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4NotEqualTo(String value) {
addCriterion("VDEF4 <>", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4GreaterThan(String value) {
addCriterion("VDEF4 >", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4GreaterThanOrEqualTo(String value) {
addCriterion("VDEF4 >=", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4LessThan(String value) {
addCriterion("VDEF4 <", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4LessThanOrEqualTo(String value) {
addCriterion("VDEF4 <=", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4Like(String value) {
addCriterion("VDEF4 like", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4NotLike(String value) {
addCriterion("VDEF4 not like", value, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4In(List<String> values) {
addCriterion("VDEF4 in", values, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4NotIn(List<String> values) {
addCriterion("VDEF4 not in", values, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4Between(String value1, String value2) {
addCriterion("VDEF4 between", value1, value2, "vdef4");
return (Criteria) this;
}
public Criteria andVdef4NotBetween(String value1, String value2) {
addCriterion("VDEF4 not between", value1, value2, "vdef4");
return (Criteria) this;
}
public Criteria andVdef5IsNull() {
addCriterion("VDEF5 is null");
return (Criteria) this;
}
public Criteria andVdef5IsNotNull() {
addCriterion("VDEF5 is not null");
return (Criteria) this;
}
public Criteria andVdef5EqualTo(String value) {
addCriterion("VDEF5 =", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5NotEqualTo(String value) {
addCriterion("VDEF5 <>", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5GreaterThan(String value) {
addCriterion("VDEF5 >", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5GreaterThanOrEqualTo(String value) {
addCriterion("VDEF5 >=", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5LessThan(String value) {
addCriterion("VDEF5 <", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5LessThanOrEqualTo(String value) {
addCriterion("VDEF5 <=", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5Like(String value) {
addCriterion("VDEF5 like", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5NotLike(String value) {
addCriterion("VDEF5 not like", value, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5In(List<String> values) {
addCriterion("VDEF5 in", values, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5NotIn(List<String> values) {
addCriterion("VDEF5 not in", values, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5Between(String value1, String value2) {
addCriterion("VDEF5 between", value1, value2, "vdef5");
return (Criteria) this;
}
public Criteria andVdef5NotBetween(String value1, String value2) {
addCriterion("VDEF5 not between", value1, value2, "vdef5");
return (Criteria) this;
}
public Criteria andVdef6IsNull() {
addCriterion("VDEF6 is null");
return (Criteria) this;
}
public Criteria andVdef6IsNotNull() {
addCriterion("VDEF6 is not null");
return (Criteria) this;
}
public Criteria andVdef6EqualTo(String value) {
addCriterion("VDEF6 =", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6NotEqualTo(String value) {
addCriterion("VDEF6 <>", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6GreaterThan(String value) {
addCriterion("VDEF6 >", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6GreaterThanOrEqualTo(String value) {
addCriterion("VDEF6 >=", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6LessThan(String value) {
addCriterion("VDEF6 <", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6LessThanOrEqualTo(String value) {
addCriterion("VDEF6 <=", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6Like(String value) {
addCriterion("VDEF6 like", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6NotLike(String value) {
addCriterion("VDEF6 not like", value, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6In(List<String> values) {
addCriterion("VDEF6 in", values, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6NotIn(List<String> values) {
addCriterion("VDEF6 not in", values, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6Between(String value1, String value2) {
addCriterion("VDEF6 between", value1, value2, "vdef6");
return (Criteria) this;
}
public Criteria andVdef6NotBetween(String value1, String value2) {
addCriterion("VDEF6 not between", value1, value2, "vdef6");
return (Criteria) this;
}
public Criteria andVdef7IsNull() {
addCriterion("VDEF7 is null");
return (Criteria) this;
}
public Criteria andVdef7IsNotNull() {
addCriterion("VDEF7 is not null");
return (Criteria) this;
}
public Criteria andVdef7EqualTo(String value) {
addCriterion("VDEF7 =", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7NotEqualTo(String value) {
addCriterion("VDEF7 <>", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7GreaterThan(String value) {
addCriterion("VDEF7 >", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7GreaterThanOrEqualTo(String value) {
addCriterion("VDEF7 >=", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7LessThan(String value) {
addCriterion("VDEF7 <", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7LessThanOrEqualTo(String value) {
addCriterion("VDEF7 <=", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7Like(String value) {
addCriterion("VDEF7 like", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7NotLike(String value) {
addCriterion("VDEF7 not like", value, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7In(List<String> values) {
addCriterion("VDEF7 in", values, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7NotIn(List<String> values) {
addCriterion("VDEF7 not in", values, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7Between(String value1, String value2) {
addCriterion("VDEF7 between", value1, value2, "vdef7");
return (Criteria) this;
}
public Criteria andVdef7NotBetween(String value1, String value2) {
addCriterion("VDEF7 not between", value1, value2, "vdef7");
return (Criteria) this;
}
public Criteria andVdef8IsNull() {
addCriterion("VDEF8 is null");
return (Criteria) this;
}
public Criteria andVdef8IsNotNull() {
addCriterion("VDEF8 is not null");
return (Criteria) this;
}
public Criteria andVdef8EqualTo(String value) {
addCriterion("VDEF8 =", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8NotEqualTo(String value) {
addCriterion("VDEF8 <>", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8GreaterThan(String value) {
addCriterion("VDEF8 >", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8GreaterThanOrEqualTo(String value) {
addCriterion("VDEF8 >=", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8LessThan(String value) {
addCriterion("VDEF8 <", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8LessThanOrEqualTo(String value) {
addCriterion("VDEF8 <=", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8Like(String value) {
addCriterion("VDEF8 like", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8NotLike(String value) {
addCriterion("VDEF8 not like", value, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8In(List<String> values) {
addCriterion("VDEF8 in", values, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8NotIn(List<String> values) {
addCriterion("VDEF8 not in", values, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8Between(String value1, String value2) {
addCriterion("VDEF8 between", value1, value2, "vdef8");
return (Criteria) this;
}
public Criteria andVdef8NotBetween(String value1, String value2) {
addCriterion("VDEF8 not between", value1, value2, "vdef8");
return (Criteria) this;
}
public Criteria andVdef9IsNull() {
addCriterion("VDEF9 is null");
return (Criteria) this;
}
public Criteria andVdef9IsNotNull() {
addCriterion("VDEF9 is not null");
return (Criteria) this;
}
public Criteria andVdef9EqualTo(String value) {
addCriterion("VDEF9 =", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9NotEqualTo(String value) {
addCriterion("VDEF9 <>", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9GreaterThan(String value) {
addCriterion("VDEF9 >", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9GreaterThanOrEqualTo(String value) {
addCriterion("VDEF9 >=", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9LessThan(String value) {
addCriterion("VDEF9 <", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9LessThanOrEqualTo(String value) {
addCriterion("VDEF9 <=", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9Like(String value) {
addCriterion("VDEF9 like", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9NotLike(String value) {
addCriterion("VDEF9 not like", value, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9In(List<String> values) {
addCriterion("VDEF9 in", values, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9NotIn(List<String> values) {
addCriterion("VDEF9 not in", values, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9Between(String value1, String value2) {
addCriterion("VDEF9 between", value1, value2, "vdef9");
return (Criteria) this;
}
public Criteria andVdef9NotBetween(String value1, String value2) {
addCriterion("VDEF9 not between", value1, value2, "vdef9");
return (Criteria) this;
}
public Criteria andVdef10IsNull() {
addCriterion("VDEF10 is null");
return (Criteria) this;
}
public Criteria andVdef10IsNotNull() {
addCriterion("VDEF10 is not null");
return (Criteria) this;
}
public Criteria andVdef10EqualTo(String value) {
addCriterion("VDEF10 =", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10NotEqualTo(String value) {
addCriterion("VDEF10 <>", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10GreaterThan(String value) {
addCriterion("VDEF10 >", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10GreaterThanOrEqualTo(String value) {
addCriterion("VDEF10 >=", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10LessThan(String value) {
addCriterion("VDEF10 <", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10LessThanOrEqualTo(String value) {
addCriterion("VDEF10 <=", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10Like(String value) {
addCriterion("VDEF10 like", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10NotLike(String value) {
addCriterion("VDEF10 not like", value, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10In(List<String> values) {
addCriterion("VDEF10 in", values, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10NotIn(List<String> values) {
addCriterion("VDEF10 not in", values, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10Between(String value1, String value2) {
addCriterion("VDEF10 between", value1, value2, "vdef10");
return (Criteria) this;
}
public Criteria andVdef10NotBetween(String value1, String value2) {
addCriterion("VDEF10 not between", value1, value2, "vdef10");
return (Criteria) this;
}
public Criteria andVdef11IsNull() {
addCriterion("VDEF11 is null");
return (Criteria) this;
}
public Criteria andVdef11IsNotNull() {
addCriterion("VDEF11 is not null");
return (Criteria) this;
}
public Criteria andVdef11EqualTo(String value) {
addCriterion("VDEF11 =", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11NotEqualTo(String value) {
addCriterion("VDEF11 <>", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11GreaterThan(String value) {
addCriterion("VDEF11 >", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11GreaterThanOrEqualTo(String value) {
addCriterion("VDEF11 >=", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11LessThan(String value) {
addCriterion("VDEF11 <", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11LessThanOrEqualTo(String value) {
addCriterion("VDEF11 <=", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11Like(String value) {
addCriterion("VDEF11 like", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11NotLike(String value) {
addCriterion("VDEF11 not like", value, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11In(List<String> values) {
addCriterion("VDEF11 in", values, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11NotIn(List<String> values) {
addCriterion("VDEF11 not in", values, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11Between(String value1, String value2) {
addCriterion("VDEF11 between", value1, value2, "vdef11");
return (Criteria) this;
}
public Criteria andVdef11NotBetween(String value1, String value2) {
addCriterion("VDEF11 not between", value1, value2, "vdef11");
return (Criteria) this;
}
public Criteria andVdef12IsNull() {
addCriterion("VDEF12 is null");
return (Criteria) this;
}
public Criteria andVdef12IsNotNull() {
addCriterion("VDEF12 is not null");
return (Criteria) this;
}
public Criteria andVdef12EqualTo(String value) {
addCriterion("VDEF12 =", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12NotEqualTo(String value) {
addCriterion("VDEF12 <>", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12GreaterThan(String value) {
addCriterion("VDEF12 >", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12GreaterThanOrEqualTo(String value) {
addCriterion("VDEF12 >=", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12LessThan(String value) {
addCriterion("VDEF12 <", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12LessThanOrEqualTo(String value) {
addCriterion("VDEF12 <=", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12Like(String value) {
addCriterion("VDEF12 like", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12NotLike(String value) {
addCriterion("VDEF12 not like", value, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12In(List<String> values) {
addCriterion("VDEF12 in", values, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12NotIn(List<String> values) {
addCriterion("VDEF12 not in", values, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12Between(String value1, String value2) {
addCriterion("VDEF12 between", value1, value2, "vdef12");
return (Criteria) this;
}
public Criteria andVdef12NotBetween(String value1, String value2) {
addCriterion("VDEF12 not between", value1, value2, "vdef12");
return (Criteria) this;
}
public Criteria andVdef13IsNull() {
addCriterion("VDEF13 is null");
return (Criteria) this;
}
public Criteria andVdef13IsNotNull() {
addCriterion("VDEF13 is not null");
return (Criteria) this;
}
public Criteria andVdef13EqualTo(String value) {
addCriterion("VDEF13 =", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13NotEqualTo(String value) {
addCriterion("VDEF13 <>", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13GreaterThan(String value) {
addCriterion("VDEF13 >", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13GreaterThanOrEqualTo(String value) {
addCriterion("VDEF13 >=", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13LessThan(String value) {
addCriterion("VDEF13 <", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13LessThanOrEqualTo(String value) {
addCriterion("VDEF13 <=", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13Like(String value) {
addCriterion("VDEF13 like", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13NotLike(String value) {
addCriterion("VDEF13 not like", value, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13In(List<String> values) {
addCriterion("VDEF13 in", values, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13NotIn(List<String> values) {
addCriterion("VDEF13 not in", values, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13Between(String value1, String value2) {
addCriterion("VDEF13 between", value1, value2, "vdef13");
return (Criteria) this;
}
public Criteria andVdef13NotBetween(String value1, String value2) {
addCriterion("VDEF13 not between", value1, value2, "vdef13");
return (Criteria) this;
}
public Criteria andVdef14IsNull() {
addCriterion("VDEF14 is null");
return (Criteria) this;
}
public Criteria andVdef14IsNotNull() {
addCriterion("VDEF14 is not null");
return (Criteria) this;
}
public Criteria andVdef14EqualTo(String value) {
addCriterion("VDEF14 =", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14NotEqualTo(String value) {
addCriterion("VDEF14 <>", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14GreaterThan(String value) {
addCriterion("VDEF14 >", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14GreaterThanOrEqualTo(String value) {
addCriterion("VDEF14 >=", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14LessThan(String value) {
addCriterion("VDEF14 <", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14LessThanOrEqualTo(String value) {
addCriterion("VDEF14 <=", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14Like(String value) {
addCriterion("VDEF14 like", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14NotLike(String value) {
addCriterion("VDEF14 not like", value, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14In(List<String> values) {
addCriterion("VDEF14 in", values, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14NotIn(List<String> values) {
addCriterion("VDEF14 not in", values, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14Between(String value1, String value2) {
addCriterion("VDEF14 between", value1, value2, "vdef14");
return (Criteria) this;
}
public Criteria andVdef14NotBetween(String value1, String value2) {
addCriterion("VDEF14 not between", value1, value2, "vdef14");
return (Criteria) this;
}
public Criteria andVdef15IsNull() {
addCriterion("VDEF15 is null");
return (Criteria) this;
}
public Criteria andVdef15IsNotNull() {
addCriterion("VDEF15 is not null");
return (Criteria) this;
}
public Criteria andVdef15EqualTo(String value) {
addCriterion("VDEF15 =", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15NotEqualTo(String value) {
addCriterion("VDEF15 <>", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15GreaterThan(String value) {
addCriterion("VDEF15 >", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15GreaterThanOrEqualTo(String value) {
addCriterion("VDEF15 >=", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15LessThan(String value) {
addCriterion("VDEF15 <", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15LessThanOrEqualTo(String value) {
addCriterion("VDEF15 <=", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15Like(String value) {
addCriterion("VDEF15 like", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15NotLike(String value) {
addCriterion("VDEF15 not like", value, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15In(List<String> values) {
addCriterion("VDEF15 in", values, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15NotIn(List<String> values) {
addCriterion("VDEF15 not in", values, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15Between(String value1, String value2) {
addCriterion("VDEF15 between", value1, value2, "vdef15");
return (Criteria) this;
}
public Criteria andVdef15NotBetween(String value1, String value2) {
addCriterion("VDEF15 not between", value1, value2, "vdef15");
return (Criteria) this;
}
public Criteria andVdef16IsNull() {
addCriterion("VDEF16 is null");
return (Criteria) this;
}
public Criteria andVdef16IsNotNull() {
addCriterion("VDEF16 is not null");
return (Criteria) this;
}
public Criteria andVdef16EqualTo(String value) {
addCriterion("VDEF16 =", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16NotEqualTo(String value) {
addCriterion("VDEF16 <>", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16GreaterThan(String value) {
addCriterion("VDEF16 >", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16GreaterThanOrEqualTo(String value) {
addCriterion("VDEF16 >=", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16LessThan(String value) {
addCriterion("VDEF16 <", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16LessThanOrEqualTo(String value) {
addCriterion("VDEF16 <=", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16Like(String value) {
addCriterion("VDEF16 like", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16NotLike(String value) {
addCriterion("VDEF16 not like", value, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16In(List<String> values) {
addCriterion("VDEF16 in", values, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16NotIn(List<String> values) {
addCriterion("VDEF16 not in", values, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16Between(String value1, String value2) {
addCriterion("VDEF16 between", value1, value2, "vdef16");
return (Criteria) this;
}
public Criteria andVdef16NotBetween(String value1, String value2) {
addCriterion("VDEF16 not between", value1, value2, "vdef16");
return (Criteria) this;
}
public Criteria andVdef17IsNull() {
addCriterion("VDEF17 is null");
return (Criteria) this;
}
public Criteria andVdef17IsNotNull() {
addCriterion("VDEF17 is not null");
return (Criteria) this;
}
public Criteria andVdef17EqualTo(String value) {
addCriterion("VDEF17 =", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17NotEqualTo(String value) {
addCriterion("VDEF17 <>", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17GreaterThan(String value) {
addCriterion("VDEF17 >", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17GreaterThanOrEqualTo(String value) {
addCriterion("VDEF17 >=", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17LessThan(String value) {
addCriterion("VDEF17 <", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17LessThanOrEqualTo(String value) {
addCriterion("VDEF17 <=", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17Like(String value) {
addCriterion("VDEF17 like", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17NotLike(String value) {
addCriterion("VDEF17 not like", value, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17In(List<String> values) {
addCriterion("VDEF17 in", values, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17NotIn(List<String> values) {
addCriterion("VDEF17 not in", values, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17Between(String value1, String value2) {
addCriterion("VDEF17 between", value1, value2, "vdef17");
return (Criteria) this;
}
public Criteria andVdef17NotBetween(String value1, String value2) {
addCriterion("VDEF17 not between", value1, value2, "vdef17");
return (Criteria) this;
}
public Criteria andVdef18IsNull() {
addCriterion("VDEF18 is null");
return (Criteria) this;
}
public Criteria andVdef18IsNotNull() {
addCriterion("VDEF18 is not null");
return (Criteria) this;
}
public Criteria andVdef18EqualTo(String value) {
addCriterion("VDEF18 =", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18NotEqualTo(String value) {
addCriterion("VDEF18 <>", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18GreaterThan(String value) {
addCriterion("VDEF18 >", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18GreaterThanOrEqualTo(String value) {
addCriterion("VDEF18 >=", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18LessThan(String value) {
addCriterion("VDEF18 <", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18LessThanOrEqualTo(String value) {
addCriterion("VDEF18 <=", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18Like(String value) {
addCriterion("VDEF18 like", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18NotLike(String value) {
addCriterion("VDEF18 not like", value, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18In(List<String> values) {
addCriterion("VDEF18 in", values, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18NotIn(List<String> values) {
addCriterion("VDEF18 not in", values, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18Between(String value1, String value2) {
addCriterion("VDEF18 between", value1, value2, "vdef18");
return (Criteria) this;
}
public Criteria andVdef18NotBetween(String value1, String value2) {
addCriterion("VDEF18 not between", value1, value2, "vdef18");
return (Criteria) this;
}
public Criteria andVdef19IsNull() {
addCriterion("VDEF19 is null");
return (Criteria) this;
}
public Criteria andVdef19IsNotNull() {
addCriterion("VDEF19 is not null");
return (Criteria) this;
}
public Criteria andVdef19EqualTo(String value) {
addCriterion("VDEF19 =", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19NotEqualTo(String value) {
addCriterion("VDEF19 <>", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19GreaterThan(String value) {
addCriterion("VDEF19 >", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19GreaterThanOrEqualTo(String value) {
addCriterion("VDEF19 >=", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19LessThan(String value) {
addCriterion("VDEF19 <", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19LessThanOrEqualTo(String value) {
addCriterion("VDEF19 <=", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19Like(String value) {
addCriterion("VDEF19 like", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19NotLike(String value) {
addCriterion("VDEF19 not like", value, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19In(List<String> values) {
addCriterion("VDEF19 in", values, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19NotIn(List<String> values) {
addCriterion("VDEF19 not in", values, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19Between(String value1, String value2) {
addCriterion("VDEF19 between", value1, value2, "vdef19");
return (Criteria) this;
}
public Criteria andVdef19NotBetween(String value1, String value2) {
addCriterion("VDEF19 not between", value1, value2, "vdef19");
return (Criteria) this;
}
public Criteria andVdef20IsNull() {
addCriterion("VDEF20 is null");
return (Criteria) this;
}
public Criteria andVdef20IsNotNull() {
addCriterion("VDEF20 is not null");
return (Criteria) this;
}
public Criteria andVdef20EqualTo(String value) {
addCriterion("VDEF20 =", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20NotEqualTo(String value) {
addCriterion("VDEF20 <>", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20GreaterThan(String value) {
addCriterion("VDEF20 >", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20GreaterThanOrEqualTo(String value) {
addCriterion("VDEF20 >=", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20LessThan(String value) {
addCriterion("VDEF20 <", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20LessThanOrEqualTo(String value) {
addCriterion("VDEF20 <=", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20Like(String value) {
addCriterion("VDEF20 like", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20NotLike(String value) {
addCriterion("VDEF20 not like", value, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20In(List<String> values) {
addCriterion("VDEF20 in", values, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20NotIn(List<String> values) {
addCriterion("VDEF20 not in", values, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20Between(String value1, String value2) {
addCriterion("VDEF20 between", value1, value2, "vdef20");
return (Criteria) this;
}
public Criteria andVdef20NotBetween(String value1, String value2) {
addCriterion("VDEF20 not between", value1, value2, "vdef20");
return (Criteria) this;
}
public Criteria andDrIsNull() {
addCriterion("DR is null");
return (Criteria) this;
}
public Criteria andDrIsNotNull() {
addCriterion("DR is not null");
return (Criteria) this;
}
public Criteria andDrEqualTo(Long value) {
addCriterion("DR =", value, "dr");
return (Criteria) this;
}
public Criteria andDrNotEqualTo(Long value) {
addCriterion("DR <>", value, "dr");
return (Criteria) this;
}
public Criteria andDrGreaterThan(Long value) {
addCriterion("DR >", value, "dr");
return (Criteria) this;
}
public Criteria andDrGreaterThanOrEqualTo(Long value) {
addCriterion("DR >=", value, "dr");
return (Criteria) this;
}
public Criteria andDrLessThan(Long value) {
addCriterion("DR <", value, "dr");
return (Criteria) this;
}
public Criteria andDrLessThanOrEqualTo(Long value) {
addCriterion("DR <=", value, "dr");
return (Criteria) this;
}
public Criteria andDrIn(List<Long> values) {
addCriterion("DR in", values, "dr");
return (Criteria) this;
}
public Criteria andDrNotIn(List<Long> values) {
addCriterion("DR not in", values, "dr");
return (Criteria) this;
}
public Criteria andDrBetween(Long value1, Long value2) {
addCriterion("DR between", value1, value2, "dr");
return (Criteria) this;
}
public Criteria andDrNotBetween(Long value1, Long value2) {
addCriterion("DR not between", value1, value2, "dr");
return (Criteria) this;
}
public Criteria andUsernameIsNull() {
addCriterion("USERNAME is null");
return (Criteria) this;
}
public Criteria andUsernameIsNotNull() {
addCriterion("USERNAME is not null");
return (Criteria) this;
}
public Criteria andUsernameEqualTo(String value) {
addCriterion("USERNAME =", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotEqualTo(String value) {
addCriterion("USERNAME <>", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThan(String value) {
addCriterion("USERNAME >", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThanOrEqualTo(String value) {
addCriterion("USERNAME >=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThan(String value) {
addCriterion("USERNAME <", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThanOrEqualTo(String value) {
addCriterion("USERNAME <=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLike(String value) {
addCriterion("USERNAME like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotLike(String value) {
addCriterion("USERNAME not like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameIn(List<String> values) {
addCriterion("USERNAME in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameNotIn(List<String> values) {
addCriterion("USERNAME not in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameBetween(String value1, String value2) {
addCriterion("USERNAME between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andUsernameNotBetween(String value1, String value2) {
addCriterion("USERNAME not between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andUserpasswordIsNull() {
addCriterion("USERPASSWORD is null");
return (Criteria) this;
}
public Criteria andUserpasswordIsNotNull() {
addCriterion("USERPASSWORD is not null");
return (Criteria) this;
}
public Criteria andUserpasswordEqualTo(String value) {
addCriterion("USERPASSWORD =", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordNotEqualTo(String value) {
addCriterion("USERPASSWORD <>", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordGreaterThan(String value) {
addCriterion("USERPASSWORD >", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordGreaterThanOrEqualTo(String value) {
addCriterion("USERPASSWORD >=", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordLessThan(String value) {
addCriterion("USERPASSWORD <", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordLessThanOrEqualTo(String value) {
addCriterion("USERPASSWORD <=", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordLike(String value) {
addCriterion("USERPASSWORD like", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordNotLike(String value) {
addCriterion("USERPASSWORD not like", value, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordIn(List<String> values) {
addCriterion("USERPASSWORD in", values, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordNotIn(List<String> values) {
addCriterion("USERPASSWORD not in", values, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordBetween(String value1, String value2) {
addCriterion("USERPASSWORD between", value1, value2, "userpassword");
return (Criteria) this;
}
public Criteria andUserpasswordNotBetween(String value1, String value2) {
addCriterion("USERPASSWORD not between", value1, value2, "userpassword");
return (Criteria) this;
}
public Criteria andPkpsndocIsNull() {
addCriterion("PKPSNDOC is null");
return (Criteria) this;
}
public Criteria andPkpsndocIsNotNull() {
addCriterion("PKPSNDOC is not null");
return (Criteria) this;
}
public Criteria andPkpsndocEqualTo(String value) {
addCriterion("PKPSNDOC =", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocNotEqualTo(String value) {
addCriterion("PKPSNDOC <>", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocGreaterThan(String value) {
addCriterion("PKPSNDOC >", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocGreaterThanOrEqualTo(String value) {
addCriterion("PKPSNDOC >=", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocLessThan(String value) {
addCriterion("PKPSNDOC <", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocLessThanOrEqualTo(String value) {
addCriterion("PKPSNDOC <=", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocLike(String value) {
addCriterion("PKPSNDOC like", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocNotLike(String value) {
addCriterion("PKPSNDOC not like", value, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocIn(List<String> values) {
addCriterion("PKPSNDOC in", values, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocNotIn(List<String> values) {
addCriterion("PKPSNDOC not in", values, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocBetween(String value1, String value2) {
addCriterion("PKPSNDOC between", value1, value2, "pkpsndoc");
return (Criteria) this;
}
public Criteria andPkpsndocNotBetween(String value1, String value2) {
addCriterion("PKPSNDOC not between", value1, value2, "pkpsndoc");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
|
[
"javaboy@javaboy-PC"
] |
javaboy@javaboy-PC
|
a9e730f295a3476cc58e46b40579c00868a4c920
|
e7ec64b9800777c4e0952f0e5e49d600b4ef35fa
|
/org.xtext.example.group16.GreedySnake/src-gen/org/xtext/example/mydsl2/group16/greedySnake/impl/InitialFoodSpecificatinImpl.java
|
4ff3c14cf1dd4b0132da88d22743dc5a788d0bb8
|
[] |
no_license
|
Landy7/MDD
|
d0fcf1ca6eba529a0d7dc799cdb8d135153d6ca4
|
b656f28cd157ede993f387b84a57db5a0ef5bc64
|
refs/heads/main
| 2023-04-11T06:06:46.490724
| 2021-04-15T15:59:53
| 2021-04-15T15:59:53
| 329,847,048
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,492
|
java
|
/**
* generated by Xtext 2.25.0.M1
*/
package org.xtext.example.mydsl2.group16.greedySnake.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.xtext.example.mydsl2.group16.greedySnake.FoodMembers;
import org.xtext.example.mydsl2.group16.greedySnake.GreedySnakePackage;
import org.xtext.example.mydsl2.group16.greedySnake.InitialFoodSpecificatin;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Initial Food Specificatin</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.xtext.example.mydsl2.group16.greedySnake.impl.InitialFoodSpecificatinImpl#getName <em>Name</em>}</li>
* <li>{@link org.xtext.example.mydsl2.group16.greedySnake.impl.InitialFoodSpecificatinImpl#getMembers <em>Members</em>}</li>
* <li>{@link org.xtext.example.mydsl2.group16.greedySnake.impl.InitialFoodSpecificatinImpl#getMultiples <em>Multiples</em>}</li>
* </ul>
*
* @generated
*/
public class InitialFoodSpecificatinImpl extends MinimalEObjectImpl.Container implements InitialFoodSpecificatin
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getMembers() <em>Members</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMembers()
* @generated
* @ordered
*/
protected FoodMembers members;
/**
* The cached value of the '{@link #getMultiples() <em>Multiples</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMultiples()
* @generated
* @ordered
*/
protected EList<InitialFoodSpecificatin> multiples;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InitialFoodSpecificatinImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return GreedySnakePackage.Literals.INITIAL_FOOD_SPECIFICATIN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public FoodMembers getMembers()
{
return members;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMembers(FoodMembers newMembers, NotificationChain msgs)
{
FoodMembers oldMembers = members;
members = newMembers;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS, oldMembers, newMembers);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setMembers(FoodMembers newMembers)
{
if (newMembers != members)
{
NotificationChain msgs = null;
if (members != null)
msgs = ((InternalEObject)members).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS, null, msgs);
if (newMembers != null)
msgs = ((InternalEObject)newMembers).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS, null, msgs);
msgs = basicSetMembers(newMembers, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS, newMembers, newMembers));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<InitialFoodSpecificatin> getMultiples()
{
if (multiples == null)
{
multiples = new EObjectResolvingEList<InitialFoodSpecificatin>(InitialFoodSpecificatin.class, this, GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MULTIPLES);
}
return multiples;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS:
return basicSetMembers(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__NAME:
return getName();
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS:
return getMembers();
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MULTIPLES:
return getMultiples();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__NAME:
setName((String)newValue);
return;
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS:
setMembers((FoodMembers)newValue);
return;
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MULTIPLES:
getMultiples().clear();
getMultiples().addAll((Collection<? extends InitialFoodSpecificatin>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__NAME:
setName(NAME_EDEFAULT);
return;
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS:
setMembers((FoodMembers)null);
return;
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MULTIPLES:
getMultiples().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MEMBERS:
return members != null;
case GreedySnakePackage.INITIAL_FOOD_SPECIFICATIN__MULTIPLES:
return multiples != null && !multiples.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //InitialFoodSpecificatinImpl
|
[
"949103298@qq.com"
] |
949103298@qq.com
|
c86a3b516cc42975c4313b5417959cc6d5b8e435
|
f3f1cfc361eb0b5880a26015819e29df4be9d04c
|
/atcrowdfunding07-member-parent/atcrowdfunding16-member-zuulserver/src/main/java/com/pdsu/wl/crowd/filter/CrowdAccessFilter.java
|
8e887863861bd9bdc30a00240f0a9f2ee178a9d4
|
[] |
no_license
|
weiliang1234/ShangChouWang
|
66d02678983220c6fa10beea153f1ac8ec4bfda1
|
e7d01def70482a0517b27503570d5440aea80885
|
refs/heads/master
| 2023-07-17T17:12:01.666120
| 2021-08-23T09:16:26
| 2021-08-23T09:16:26
| 395,512,243
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,190
|
java
|
package com.pdsu.wl.crowd.filter;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import com.pdsu.wl.crowd.constant.AccessPassResources;
import com.pdsu.wl.crowd.constant.CrowdConstant;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@Component
public class CrowdAccessFilter extends ZuulFilter {
@Override
public String filterType() {
// 这里返回“pre”意思是在目标微服务前执行过滤
return "pre";
}
@Override
public int filterOrder() {
return 0;
}
@Override
public boolean shouldFilter() {
// 1.获取 RequestContext 对象
RequestContext requestContext = RequestContext.getCurrentContext();
// 2.通过 RequestContext 对象获取当前请求对象(框架底层是借助 ThreadLocal 从当前线程上获取事先绑定的 Request 对象)
HttpServletRequest request = requestContext.getRequest();
// 3.获取 servletPath 值
String servletPath = request.getServletPath();
// 4.根据 servletPath 判断当前请求是否对应可以直接放行的特定功能
boolean containsResult = AccessPassResources.PASS_RES_SET.contains(servletPath);
if (containsResult) {
// 5.如果当前请求是可以直接放行的特定功能请求则返回 false 放行
return false;
}
// 5.判断当前请求是否为静态资源
// 工具方法返回 true:说明当前请求是静态资源请求,取反为 false 表示放行不做登录检查
// 工具方法返回 false:说明当前请求不是可以放行的特定请求也不是静态资源,取反为 true 表示需要做登录检查
return !AccessPassResources.judgeCurrentServletPathWetherStaticResource(servletPath);
}
@Override
public Object run() throws ZuulException {
// 1.获取当前请求对象
RequestContext requestContext = RequestContext.getCurrentContext();
HttpServletRequest request = requestContext.getRequest();
// 2.获取当前 Session 对象
HttpSession session = request.getSession();
// 3.尝试从 Session 对象中获取已登录的用户
Object loginMember = session.getAttribute(CrowdConstant.ATTR_NAME_LOGIN_MEMBER);
// 4.判断 loginMember 是否为空
if (loginMember == null) {
// 5.从 requestContext 对象中获取 Response 对象
HttpServletResponse response = requestContext.getResponse();
// 6.将提示消息存入 Session 域
session.setAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_ACCESS_FORBIDEN);
// 7.重定向到 auth-consumer 工程中的登录页面
try {
response.sendRedirect("/auth/member/to/login/page");
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
}
|
[
"2663107564@qq.com"
] |
2663107564@qq.com
|
a2fcdfc36e6bb8169007f0e01531a00891b3d162
|
60e1b50c83af386efa956461b56de2e6986c06c6
|
/src/main/java/ro/agitman/moe/web/controller/prof/ProfReviewController.java
|
fa090168123391b64064ec49cdd21518c273d73b
|
[] |
no_license
|
edigitman/moe2
|
dcc02c05254a24789026d9c078b535d3baa3fb07
|
6b72b6a47ad8dd0d61a09e2dd1da2e1eb4b2d3b4
|
refs/heads/master
| 2020-12-03T23:11:39.867121
| 2016-09-30T11:22:49
| 2016-09-30T11:22:49
| 66,078,389
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 321
|
java
|
package ro.agitman.moe.web.controller.prof;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import ro.agitman.moe.web.controller.AbstractController;
@Controller
@RequestMapping("/review")
public class ProfReviewController extends AbstractController {
}
|
[
"edi.gitman@gmail.com"
] |
edi.gitman@gmail.com
|
396884c248ac4533a92b7de95e1d815a0764df4d
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_72e68e61b02e49c520d242215ab3aa42c54da42a/SimulationDrawerTest/2_72e68e61b02e49c520d242215ab3aa42c54da42a_SimulationDrawerTest_s.java
|
ba146572d9cf4b2691675acf776542e3a3ac2213
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 1,314
|
java
|
package codeplanes;
import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
public class SimulationDrawerTest extends JFrame {
static class TestStrategy implements Strategy {
@Override
public void turn(final Plane plane, final World world, final Move move) {
//move.setAngle(100500);
move.setAngle(Math.random() - Math.random());
move.setFire(true);
}
}
private final BattleDrawer battleDrawer = new BattleDrawer();
SimulationDrawerTest() {
add(battleDrawer);
}
public void setBattle(final Battle battle) {
battle.addHandler(battleDrawer);
}
public static void main(final String[] args) {
final SimulationDrawerTest battleDrawerTest = new SimulationDrawerTest();
final List<Strategy> strategies = new ArrayList<>();
strategies.add( new TestStrategy() );
strategies.add( new TestStrategy() );
final Simulation battle = new Simulation(strategies, 800, 600, 4000);
battleDrawerTest.setBattle(battle);
battleDrawerTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
battleDrawerTest.setVisible(true);
battleDrawerTest.setSize(500,500);
battle.run();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
ffb82f1526386fbceccf5d027f75a137948eddc6
|
11aa78beeaa7d18f9e36a3cac652c8390d3d71d7
|
/duEco/duEco.Android/obj/Debug/81/android/src/mono/MonoPackageManager.java
|
2828610dcc277e64646969981426a151976d511e
|
[] |
no_license
|
JuliiA/duEco-UNLaM
|
0b2d9502c5c59f821b1818cf4da9cba4041e2e81
|
0d2f468cd40f8f6c1e883e19b4ba57675f1983f5
|
refs/heads/master
| 2022-12-12T13:38:53.255098
| 2019-11-24T03:49:27
| 2019-11-24T03:49:27
| 223,688,513
| 0
| 0
| null | 2022-12-08T06:25:50
| 2019-11-24T03:45:18
|
Java
|
UTF-8
|
Java
| false
| false
| 5,052
|
java
|
package mono;
import java.io.*;
import java.lang.String;
import java.util.Locale;
import java.util.HashSet;
import java.util.zip.*;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.res.AssetManager;
import android.util.Log;
import mono.android.Runtime;
public class MonoPackageManager {
static Object lock = new Object ();
static boolean initialized;
static android.content.Context Context;
public static void LoadApplication (Context context, ApplicationInfo runtimePackage, String[] apks)
{
synchronized (lock) {
if (context instanceof android.app.Application) {
Context = context;
}
if (!initialized) {
android.content.IntentFilter timezoneChangedFilter = new android.content.IntentFilter (
android.content.Intent.ACTION_TIMEZONE_CHANGED
);
context.registerReceiver (new mono.android.app.NotifyTimeZoneChanges (), timezoneChangedFilter);
System.loadLibrary("monodroid");
Locale locale = Locale.getDefault ();
String language = locale.getLanguage () + "-" + locale.getCountry ();
String filesDir = context.getFilesDir ().getAbsolutePath ();
String cacheDir = context.getCacheDir ().getAbsolutePath ();
String dataDir = getNativeLibraryPath (context);
ClassLoader loader = context.getClassLoader ();
java.io.File external0 = android.os.Environment.getExternalStorageDirectory ();
String externalDir = new java.io.File (
external0,
"Android/data/" + context.getPackageName () + "/files/.__override__").getAbsolutePath ();
String externalLegacyDir = new java.io.File (
external0,
"../legacy/Android/data/" + context.getPackageName () + "/files/.__override__").getAbsolutePath ();
Runtime.init (
language,
apks,
getNativeLibraryPath (runtimePackage),
new String[]{
filesDir,
cacheDir,
dataDir,
},
loader,
new String[] {
externalDir,
externalLegacyDir
},
MonoPackageManager_Resources.Assemblies,
context.getPackageName ());
mono.android.app.ApplicationRegistration.registerApplications ();
initialized = true;
}
}
}
public static void setContext (Context context)
{
// Ignore; vestigial
}
static String getNativeLibraryPath (Context context)
{
return getNativeLibraryPath (context.getApplicationInfo ());
}
static String getNativeLibraryPath (ApplicationInfo ainfo)
{
if (android.os.Build.VERSION.SDK_INT >= 9)
return ainfo.nativeLibraryDir;
return ainfo.dataDir + "/lib";
}
public static String[] getAssemblies ()
{
return MonoPackageManager_Resources.Assemblies;
}
public static String[] getDependencies ()
{
return MonoPackageManager_Resources.Dependencies;
}
public static String getApiPackageName ()
{
return MonoPackageManager_Resources.ApiPackageName;
}
}
class MonoPackageManager_Resources {
public static final String[] Assemblies = new String[]{
/* We need to ensure that "duEco.Android.dll" comes first in this list. */
"duEco.Android.dll",
"Acr.UserDialogs.dll",
"AndHUD.dll",
"duEco.dll",
"FormsViewGroup.dll",
"Microcharts.dll",
"Microcharts.Droid.dll",
"Microcharts.Forms.dll",
"Newtonsoft.Json.dll",
"Plugin.CurrentActivity.dll",
"Plugin.LocalNotifications.Abstractions.dll",
"Plugin.LocalNotifications.dll",
"Plugin.Media.dll",
"Plugin.Permissions.dll",
"SkiaSharp.dll",
"SkiaSharp.Views.Android.dll",
"SkiaSharp.Views.Forms.dll",
"SQLite-net.dll",
"SQLitePCLRaw.batteries_green.dll",
"SQLitePCLRaw.batteries_v2.dll",
"SQLitePCLRaw.core.dll",
"SQLitePCLRaw.lib.e_sqlite3.dll",
"SQLitePCLRaw.provider.e_sqlite3.dll",
"System.Net.Http.Extensions.dll",
"System.Net.Http.Primitives.dll",
"Xamarin.Android.Arch.Core.Common.dll",
"Xamarin.Android.Arch.Lifecycle.Common.dll",
"Xamarin.Android.Arch.Lifecycle.Runtime.dll",
"Xamarin.Android.Support.Animated.Vector.Drawable.dll",
"Xamarin.Android.Support.Annotations.dll",
"Xamarin.Android.Support.Compat.dll",
"Xamarin.Android.Support.Core.UI.dll",
"Xamarin.Android.Support.Core.Utils.dll",
"Xamarin.Android.Support.Design.dll",
"Xamarin.Android.Support.Fragment.dll",
"Xamarin.Android.Support.Media.Compat.dll",
"Xamarin.Android.Support.Transition.dll",
"Xamarin.Android.Support.v4.dll",
"Xamarin.Android.Support.v7.AppCompat.dll",
"Xamarin.Android.Support.v7.CardView.dll",
"Xamarin.Android.Support.v7.MediaRouter.dll",
"Xamarin.Android.Support.v7.Palette.dll",
"Xamarin.Android.Support.v7.RecyclerView.dll",
"Xamarin.Android.Support.Vector.Drawable.dll",
"Xamarin.Forms.Core.dll",
"Xamarin.Forms.Platform.Android.dll",
"Xamarin.Forms.Platform.dll",
"Xamarin.Forms.Xaml.dll",
"XamForms.Controls.Calendar.dll",
"XamForms.Controls.Calendar.Droid.dll",
};
public static final String[] Dependencies = new String[]{
};
public static final String ApiPackageName = "Mono.Android.Platform.ApiLevel_27";
}
|
[
"yulis.24a6@gmail.com"
] |
yulis.24a6@gmail.com
|
37dadeea9794db5b35c786887b7c095646a01c3d
|
2b7c587542ffb625c92ee0770ae1f164f327096a
|
/z00-Test/ch01-05 Imports/Cat.java
|
cbcb4f242cd9960bcda68bc517161213018506c7
|
[] |
no_license
|
Sabyh11/Java-SE8-OCP-Exam-1Z0-809
|
bf881ea0e218838820022bfe3f6ee078dc0fd6c8
|
52a7c81c840b76f4c149056c71b119b1e5c1e32b
|
refs/heads/master
| 2022-01-20T11:10:47.983033
| 2018-07-07T17:41:00
| 2018-07-07T17:41:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 138
|
java
|
import static java.time.LocalDateTime.now;
class Cat {
public static void main(String[] args) {
System.out.println(now());
}
}
|
[
"mercurylink@gmail.com"
] |
mercurylink@gmail.com
|
557a6169cb2d2e009bb9a2fd87a196abefe70e89
|
515f5b2e90ccc7752882ae32c82915557a7f6b29
|
/src/main/java/com/aaa/controller/UploadController.java
|
d03b00aca97215c3398acb098c41ae1259c32613
|
[] |
no_license
|
ssn9/springboot_319
|
9e45328bd07952ee51a5b2dbb712d023784e9460
|
396f1f97592fe8d7bcf2ac26bbf3f2c4174ea90c
|
refs/heads/master
| 2022-06-24T13:13:32.340799
| 2019-12-13T01:38:37
| 2019-12-13T01:38:37
| 227,723,469
| 0
| 0
| null | 2022-06-21T02:26:05
| 2019-12-13T00:41:11
|
Java
|
UTF-8
|
Java
| false
| false
| 1,851
|
java
|
package com.aaa.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
@Controller
@RequestMapping("upload")
public class UploadController {
@RequestMapping("upload")
public String upload(@RequestParam("photo") MultipartFile photo){
System.out.println("photo:"+photo);
// 获取文件原名
String originalFilename = photo.getOriginalFilename();
System.out.println(originalFilename);
boolean empty = photo.isEmpty();// 判断文件是否为空,文件大小为0
System.out.println("empty:"+empty);
// 判断是否有上传文件
if(!"".equals(originalFilename)){
UUID uuid = UUID.randomUUID();
String savePath = "F:/"+uuid+"_"+originalFilename;
File saveFile = new File(savePath);
// 另存为
try {
photo.transferTo(saveFile);
} catch (IOException e) {
e.printStackTrace();
}
}
return "index";
}
@RequestMapping("upload2")
public String upload2(MultipartFile photo,MultipartFile photo2){
System.out.println(photo.getOriginalFilename());
System.out.println(photo2.getOriginalFilename());
return "index";
}
// 1.多个文件的提交的name值一样;2.必须加@RequestParam
@RequestMapping("upload3")
public String upload3(@RequestParam("photo") MultipartFile[] photo){
System.out.println(photo[0].getOriginalFilename());
System.out.println(photo[1].getOriginalFilename());
return "index";
}
}
|
[
"1415819615@qq.com"
] |
1415819615@qq.com
|
97bc83133d7bcb4a5e386df417efeb23abec8a48
|
15c8c1d5b5fd09c86633214c085d557c7dfb7e9e
|
/app/src/main/java/com/example/device02/cube/MyGLSurfaceView.java
|
5bbae0fbead3e2c0d824eb700005d1b253708ae1
|
[] |
no_license
|
gitsebste/programowanieGier1
|
9863f8cf7aa3539f77c9debc13f2f067f6576e1a
|
56d2043eba40f86480002c30709b7ee8709baab7
|
refs/heads/master
| 2021-09-01T14:49:59.097945
| 2017-12-27T15:14:01
| 2017-12-27T15:14:01
| 115,529,699
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,430
|
java
|
package com.example.device02.cube;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.KeyEvent;
import android.view.MotionEvent;
import java.util.Vector;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
/*
* Custom GL view by extending GLSurfaceView so as
* to override event handlers such as onKeyUp(), onTouchEvent()
*/
public class MyGLSurfaceView extends GLSurfaceView {
MyGLRenderer renderer; // Custom GL Renderer
// For touch event
private final float TOUCH_SCALE_FACTOR = 180.0f / 320.0f;
private float previousX;
private float previousY;
private float verticalAngle;
private float horizontalAngle;
// Constructor - Allocate and set the renderer
public MyGLSurfaceView(Context context) {
super(context);
renderer = new MyGLRenderer(context);
this.setRenderer(renderer);
// Request focus, otherwise key/button won't react
this.requestFocus();
this.setFocusableInTouchMode(true);
}
// Handler for key event
@Override
public boolean onKeyUp(int keyCode, KeyEvent evt) {
switch(keyCode) {
case KeyEvent.KEYCODE_DPAD_LEFT: // Decrease Y-rotational speed
renderer.speedY -= 0.1f;
break;
case KeyEvent.KEYCODE_DPAD_RIGHT: // Increase Y-rotational speed
renderer.speedY += 0.1f;
break;
case KeyEvent.KEYCODE_DPAD_UP: // Decrease X-rotational speed
renderer.speedX -= 0.1f;
break;
case KeyEvent.KEYCODE_DPAD_DOWN: // Increase X-rotational speed
renderer.speedX += 0.1f;
break;
case KeyEvent.KEYCODE_A: // Zoom out (decrease z)
renderer.z -= 0.2f;
break;
case KeyEvent.KEYCODE_Z: // Zoom in (increase z)
renderer.z += 0.2f;
break;
}
return true; // Event handled
}
// Handler for touch event
@Override
public boolean onTouchEvent(final MotionEvent evt) {
float currentX = evt.getX();
float currentY = evt.getY();
int width = this.getResources().getDisplayMetrics().widthPixels;
int height = this.getResources().getDisplayMetrics().heightPixels;
//rotation
if(currentX>width/2)
{
this.horizontalAngle = (width / 4 - currentX);
this.verticalAngle = (height / 2 - currentY);
Vector3 direction = new Vector3((float)(cos(verticalAngle) * sin(horizontalAngle)), (float)(sin(verticalAngle)),(float)(cos(verticalAngle) * cos(horizontalAngle)));
Vector3 right = new Vector3((float)(sin(horizontalAngle - 3.14f/2.0f)), (float)(0),(float)( cos(horizontalAngle - 3.14f/2.0f)));
Vector3 up = Vector3.cross(right,direction);
float deltaX, deltaY;
switch (evt.getAction()) {
case MotionEvent.ACTION_MOVE:
// Modify rotational angles according to movement
deltaX = currentX - previousX;
deltaY = currentY - previousY;
renderer.angleX += deltaY * TOUCH_SCALE_FACTOR;
renderer.angleY += deltaX * TOUCH_SCALE_FACTOR;
}
}
//translation
else
{
float step=0.2f;
Vector3 position = new Vector3();
position.setX(renderer.eyeX);
position.setY(renderer.eyeY);
position.setZ(renderer.eyeZ);
Vector3 look = new Vector3();
look.setX(renderer.centerX);
look.setY(renderer.centerY);
look.setZ(renderer.centerZ);
Vector3 diff = Vector3.sub(look,position);
if(currentY<previousY) {renderer.z += step;
//Vector3 diffPosition = Vector3.scale(diff,step);renderer.eyeX+=diffPosition.getX();renderer.eyeY+=diffPosition.getY();renderer.eyeZ+=diffPosition.getZ();
}
else {renderer.z -= step;
//Vector3 diffPosition = Vector3.scale(diff,-step);renderer.eyeX+=diffPosition.getX();renderer.eyeY+=diffPosition.getY();renderer.eyeZ+=diffPosition.getZ();
}
}
// Save current x, y
previousX = currentX;
previousY = currentY;
return true; // Event handled
}
}
|
[
"seb_email@o2.pl"
] |
seb_email@o2.pl
|
4ca02741b59dbd84ac15bfff40bc641304238533
|
af544e478f4e5b6a721591cd6c6f75b873c8cc88
|
/FDP/T3_A3_PinedoBerumenClaraRuby/src/Ejercicio03_masa_corporal.java
|
605001c6a030b85fc47cfe877e8ce7c3249a3b62
|
[] |
no_license
|
RubyBerumen/1roISC
|
68054885371a59a9e90d62d78a136c2d8f36c09d
|
9078b383f889912d8ba982eb5c39df995e3dfe2f
|
refs/heads/main
| 2023-02-02T14:09:46.987092
| 2020-12-21T16:00:40
| 2020-12-21T16:00:40
| 323,373,475
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 1,139
|
java
|
import java.util.Scanner;
public class Ejercicio03_masa_corporal {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
double imc = 0.0;
System.out.println("Ingresa tu peso: ");
double peso = entrada.nextDouble();
System.out.println("Ingresa tu altura en metros: ");
double altura = entrada.nextDouble();
imc = peso/(Math.pow(altura, 2));
System.out.println("IMC: " + imc);
if(imc<16) {
System.out.println("Criterio de ingreso al hospital");
}else if(imc>=16 && imc<17) {
System.out.println("Infrapeso");
}else if(imc>=17 && imc<18) {
System.out.println("Bajo peso");
}else if(imc>=18 && imc<25) {
System.out.println("Peso normal (saludable)");
}else if(imc>=25 && imc<30) {
System.out.println("Sobrepeso (obesidad de grado I)");
}else if(imc>=30 && imc<35) {
System.out.println("Sobrepeso crónico (obesidad de grado II)");
}else if(imc>=35 && imc<=40) {
System.out.println("Obesidad premórbida (obesidad de grado III)");
}else if(imc>40) {
System.out.println("Obesidad mórbida (obesidad de grado IV)");
}
}
}
|
[
"clararubipb15@gmail.com"
] |
clararubipb15@gmail.com
|
4cad489c9640e0c1ba10bb64e4fceea8cc4d495d
|
d28d9ec87456c7f7a9c8ac298a9b123b77add8bd
|
/src/Propertiesmanager.java
|
cd69a41e8f0b116d66337c1e0fe03ea830f9f0c1
|
[] |
no_license
|
weics/TankWar
|
60688c85e93cc84486b14f6e553750cf1aa6a5fa
|
26d44f7c38a072949d1d77e2420c7a721f7bff3e
|
refs/heads/master
| 2021-01-10T02:14:23.269751
| 2016-02-15T14:54:34
| 2016-02-15T14:54:34
| 51,200,693
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 621
|
java
|
import java.io.IOException;
import java.util.Properties;
/**
* Created by WEI on 2016/2/12.
*/
public class Propertiesmanager {
/**
* 此函数将构造函数私有化,使得其他函数不能对其进行创建
*/
private Propertiesmanager(){}
public static String getProperty(String key){
Properties props = new Properties();
try {
props.load(Propertiesmanager.class.getClassLoader().getResourceAsStream("config/tank.properties"));
} catch (IOException e) {
e.printStackTrace();
}
return props.getProperty(key);
}
}
|
[
"ysweics@gmail.com"
] |
ysweics@gmail.com
|
17fdee56be5045a2d929d6295e6b1ff159475092
|
3767198f93f54d92502e726485a926d7cf7932db
|
/order/order-base/src/main/java/com/sjony/cache/RedisClient.java
|
bebe9b9e1f505a798de9772ec5207e34fa49cdbe
|
[] |
no_license
|
sjony/order
|
9862e38a407f7fc0e0ab972545b8d48f00fe2575
|
c2f12ae9d3fb4a58caabb11b357d488ad02495fc
|
refs/heads/master
| 2021-01-01T15:49:23.889089
| 2018-02-23T05:53:54
| 2018-02-23T05:53:54
| 97,709,804
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 830
|
java
|
package com.sjony.cache;
import org.springframework.data.redis.core.RedisTemplate;
/**
* @Description: redis客户端
* @Create on: 2017/7/18 下午4:52
*
* @author shujiangcheng
*/
public class RedisClient implements CacheClient {
private RedisTemplate redisTemplate;
public RedisClient(RedisTemplate redisTemplate) {
this.redisTemplate = redisTemplate;
}
@Override
public <T> T get(String key) {
return (T) redisTemplate.boundValueOps(key).get();
}
@Override
public void put(String key, Object value) {
put(key, 0, value);
}
@Override
public void put(String key, int exp, Object value) {
redisTemplate.opsForValue().set(key, value, exp);
}
@Override
public void delete(String key) {
redisTemplate.delete(key);
}
}
|
[
"531347745@qq.com"
] |
531347745@qq.com
|
2bde056881c94c51b2f0b53abfe875f3bbad4e94
|
9af7f0ad2b42be5835bfd6ed008a1df885c23d7a
|
/src/com/hnka/ast/Call.java
|
bb7eb4ff5a518a93d2a4dd5c1d27a0cd8aeb98fe
|
[] |
no_license
|
hnka/lexical-analyzer
|
fb6aab3174721c9c9e709e206be087fce3d80aae
|
9ab9fbc499c222897b7b5317d6f95061b8eeb9d9
|
refs/heads/master
| 2021-01-23T04:29:28.854645
| 2017-04-30T03:30:27
| 2017-04-30T03:30:27
| 86,202,870
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 397
|
java
|
package com.hnka.ast;
import com.hnka.visitor.Visitor;
import com.hnka.visitor.TypeVisitor;
public class Call extends Exp {
public Exp e;
public Identifier i;
public ExpList el;
public Call(Exp ae, Identifier ai, ExpList ael) {
e=ae; i=ai; el=ael;
}
public void accept(Visitor v) {
v.visit(this);
}
public Type accept(TypeVisitor v) {
return v.visit(this);
}
}
|
[
"mchma@cin.ufpe.br"
] |
mchma@cin.ufpe.br
|
ae28144169f705c41ebbf6c8b7e4be0611b860f4
|
eaf634a76504c5bc1d726f59b5392f31ca88fa46
|
/src/main/java/cn/urban/system/service/AuthoritiesService.java
|
6fb77ae3ee8c7c39b01445c94237970f8cd24465
|
[] |
no_license
|
ahlgn/UrbanManager
|
0227e84e5a2a955443b2d9a4dca7226af4b5878e
|
6d0eedb8b24a741963d996f19dc5a3b7e9034c2d
|
refs/heads/master
| 2022-06-26T00:07:32.942618
| 2019-11-26T04:26:39
| 2019-11-26T04:26:39
| 224,101,997
| 0
| 0
| null | 2022-06-21T02:18:51
| 2019-11-26T04:26:18
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 377
|
java
|
package cn.urban.system.service;
import cn.urban.system.model.Authorities;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author panda
* @since 2019-11-25
*/
public interface AuthoritiesService extends IService<Authorities> {
List<Authorities> listByUserId(Integer userId);
}
|
[
"ahlgn@foxmail.com"
] |
ahlgn@foxmail.com
|
362bdfeefeadf758d6eae354cb3da193edb6dd60
|
9bcf1689a93afb30a9d75159fcafa2ed9cd4d077
|
/bookmanager/src/main/java/com/lyx/bookmanager/pojo/Record.java
|
f91195136af8648658b30caa617a32079b945a6f
|
[
"Apache-2.0"
] |
permissive
|
hu19891213/bookmanger
|
edee16b929feedcf42f833364e08b9ea0212065b
|
d63aa5c5e864f664c6df6003bf9ed51a5389c978
|
refs/heads/main
| 2023-06-02T08:27:47.132987
| 2021-06-25T05:44:14
| 2021-06-25T05:44:14
| 380,131,354
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,229
|
java
|
package com.lyx.bookmanager.pojo;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class Record {
private long sernum;
private long bookId;
private int readerId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date lendDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date backDate;
public Record() {
super();
}
public Record(long sernum, long bookId, int readerId, Date lendDate, Date backDate) {
super();
this.sernum = sernum;
this.bookId = bookId;
this.readerId = readerId;
this.lendDate = lendDate;
this.backDate = backDate;
}
public long getSernum() {
return sernum;
}
public void setSernum(long sernum) {
this.sernum = sernum;
}
public long getBookId() {
return bookId;
}
public void setBookId(long bookId) {
this.bookId = bookId;
}
public int getReaderId() {
return readerId;
}
public void setReaderId(int readerId) {
this.readerId = readerId;
}
public Date getLendDate() {
return lendDate;
}
public void setLendDate(Date lendDate) {
this.lendDate = lendDate;
}
public Date getBackDate() {
return backDate;
}
public void setBackDate(Date backDate) {
this.backDate = backDate;
}
}
|
[
"191250047_smail_nju_edu_cn"
] |
191250047_smail_nju_edu_cn
|
38df18a99ba379d0930ad27fd5d38b97da192f29
|
1051203e08e56d159be512a5cd2d15af01dcfddf
|
/app/src/main/java/com/example/musicplayer/database/Playlist.java
|
aaef1addc616180d15863418659b36d3b3e5b9f9
|
[] |
no_license
|
vadimarsh/MusicPlayerForIvanRefactored
|
8c18c5725339aef1f3ef7a724e2d4e84c1d5a8c4
|
9964877beefbe698a163029c89322cea4694c55d
|
refs/heads/master
| 2023-04-19T07:31:33.153071
| 2021-05-04T15:51:33
| 2021-05-04T15:51:33
| 364,309,067
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 542
|
java
|
package com.example.musicplayer.database;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity
public class Playlist {
@PrimaryKey
private int id;
private String name;
public Playlist(int id, String name) {
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|
[
"59313785+vadimarsh@users.noreply.github.com"
] |
59313785+vadimarsh@users.noreply.github.com
|
da72581c78ad79f4b127c3883fec4ced74b13784
|
3fb9f7a08101ef8383b9c1db7e6f5c2c248abd99
|
/src/Modelo/M_Cuidador.java
|
fc672fe85822c0ed63c8ee73934ad6b084cdf657
|
[] |
no_license
|
Pantalaimon-Belaqua/MEUS6_projecte
|
776f102b8e6900a4fa0b206a543b369e97356cd8
|
88a161ec517364f14e26c372227cc8a7bdba6a92
|
refs/heads/master
| 2020-05-22T16:21:31.990041
| 2019-05-22T16:33:53
| 2019-05-22T16:33:53
| 186,427,852
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,401
|
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 Modelo;
/**
*
* @author daniel
*/
public class M_Cuidador {
private String DNI;
private String nombre;
private String direccion;
private String telefono;
public M_Cuidador() {
}
public M_Cuidador(String DNI, String nombre, String direccion, String telefono) {
this.DNI = DNI;
this.nombre = nombre;
this.direccion = direccion;
this.telefono = telefono;
}
public String getDNI() {
return DNI;
}
public void setDNI(String DNI) {
this.DNI = DNI;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDireccion() {
return direccion;
}
public void setDireccion(String direccion) {
this.direccion = direccion;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
@Override
public String toString() {
return "M_Cuidador{" + "DNI=" + DNI + ", nombre=" + nombre + ", direccion=" + direccion + ", telefono=" + telefono + '}';
}
}
|
[
"daniel@UBUNTU18"
] |
daniel@UBUNTU18
|
dc7f8a92d0d77c57873689355c291007db86d7ba
|
5a4813690d5afadf696d13ff45c02ba43a076a39
|
/src/tesis/pablosanjuan/tesisqr/Mision1.java
|
d211d75288df0d99b4b86432216696ba397f69c9
|
[] |
no_license
|
pablosanjuan/CMMAppEclipse
|
6197578e4e522a96ce48864d9daff5d9e2a70bc2
|
a1a4ffcef454ce038ab8e212e507c58292a098c7
|
refs/heads/master
| 2021-01-20T19:06:35.655279
| 2016-06-22T21:24:24
| 2016-06-22T21:24:24
| 61,752,488
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,373
|
java
|
package tesis.pablosanjuan.tesisqr;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class Mision1 extends Activity implements OnClickListener {
int REQUEST_CODE = 0;
Button btn_scan;
// TextView txResult;
@Override
protected void onCreate(Bundle savedInstanceState) {
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.mision1);
btn_scan = (Button) findViewById(R.id.btn_scan_m1);
// txResult = (TextView) findViewById(R.id.txt_resultado);
btn_scan.setOnClickListener(this);
Typeface font = Typeface.createFromAsset(getAssets(), "Equal-Regular.otf");
btn_scan.setTypeface(font);
}
@Override
public void onClick(View v) {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
String contenido = intent.getStringExtra("SCAN_RESULT");
validar(contenido);
}
}
}
private void validar(String contenido) {
if (contenido.equals("Scanner configurado correctamente")) {
SharedPreferences preferencias=getSharedPreferences("datos",Context.MODE_PRIVATE);
Editor editor=preferencias.edit();
editor.putBoolean("d_museo1", true);
editor.commit();
finish();
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.toast_personalizado,(ViewGroup) findViewById(R.id.toast_contenedor)); //"inflamos" nuestro layout
TextView text = (TextView) layout.findViewById(R.id.text_toast);
text.setText("Mision 1 - Superada!!!");
Toast toast = new Toast(getApplicationContext());
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
}else{
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.toast_personalizado,(ViewGroup) findViewById(R.id.toast_contenedor)); //"inflamos" nuestro layout
TextView text = (TextView) layout.findViewById(R.id.text_toast);
text.setText("Codigo Incorrecto - Vuelve a Intentarlo");
Toast toast = new Toast(getApplicationContext());
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
}
}
}
|
[
"pablosanjuanm@gmail.com"
] |
pablosanjuanm@gmail.com
|
7aee093a54258e11f2460112f9130aa5a4a02f24
|
1d3a88d6f77f3af5e2562569db56817ac6ec8250
|
/app/src/main/java/com/jyj/video/jyjplayer/event/PlaySettingCloseEvent.java
|
1919ca55797fb5fdcef04a18153298f97aa90266
|
[] |
no_license
|
GitHubZJY/JYJPlayer
|
386e04c0c64bcfa7e644d1b63b2cf7b2d2bf26b3
|
d508a74e16eaa704e19338de322870527b46e856
|
refs/heads/master
| 2020-04-05T10:12:14.447037
| 2019-06-29T15:51:54
| 2019-06-29T15:51:54
| 156,791,611
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 756
|
java
|
package com.jyj.video.jyjplayer.event;
/**
* Created by zhengjiayang on 2017/10/27.
*/
public class PlaySettingCloseEvent {
public static final int SUBTITLE_PANEL = 1;
public static final int SPEED_PANEL = 2;
private int mPanelType;
private String mSrtFileUrl;
public PlaySettingCloseEvent(){
}
public PlaySettingCloseEvent(String srtFileUrl) {
this.mSrtFileUrl = srtFileUrl;
}
public String getSrtFileUrl() {
return mSrtFileUrl;
}
public void setSrtFileUrl(String mSrtFileUrl) {
this.mSrtFileUrl = mSrtFileUrl;
}
public int getPanelType() {
return mPanelType;
}
public void setPanelType(int mPanelType) {
this.mPanelType = mPanelType;
}
}
|
[
"742155745@qq.com"
] |
742155745@qq.com
|
0e5dc8208da122495dfbc6ec63b4f52722e4b5f5
|
d72b41cda5f8b4afe20c4f5c6576f004bbd080a7
|
/src/hw2/Query.java
|
d27640e9f58299eb6ffff4463063a169b6d56e32
|
[] |
no_license
|
BenjaminNewBorn/DataBase_Implements
|
2347baab10d8697d319276c4796db979e7e6ca9d
|
0985195edf7fe34d9b5fe097a7829758691e4764
|
refs/heads/master
| 2022-01-19T05:40:51.536666
| 2019-07-23T07:37:17
| 2019-07-23T07:37:17
| 198,377,615
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,317
|
java
|
package hw2;
import java.util.ArrayList;
import java.util.List;
import hw1.Catalog;
import hw1.Database;
import hw1.HeapFile;
import hw1.TupleDesc;
import hw1.WhereExpressionVisitor;
import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.ExpressionVisitor;
import net.sf.jsqlparser.expression.ExpressionVisitorAdapter;
import net.sf.jsqlparser.expression.LongValue;
import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
import net.sf.jsqlparser.expression.operators.relational.InExpression;
import net.sf.jsqlparser.parser.*;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.schema.Table;
import net.sf.jsqlparser.statement.*;
import net.sf.jsqlparser.statement.select.FromItem;
import net.sf.jsqlparser.statement.select.Join;
import net.sf.jsqlparser.statement.select.PlainSelect;
import net.sf.jsqlparser.statement.select.Select;
import net.sf.jsqlparser.statement.select.SelectBody;
import net.sf.jsqlparser.statement.select.SelectItem;
import net.sf.jsqlparser.statement.select.SelectItemVisitor;
import net.sf.jsqlparser.statement.select.SelectItemVisitorAdapter;
import net.sf.jsqlparser.statement.select.SelectVisitor;
import net.sf.jsqlparser.statement.select.SelectVisitorAdapter;
import net.sf.jsqlparser.util.TablesNamesFinder;
import net.sf.jsqlparser.util.deparser.ExpressionDeParser;
public class Query {
private String q;
public Query(String q) {
this.q = q;
}
public Relation execute() {
Statement statement = null;
try {
statement = CCJSqlParserUtil.parse(q);
} catch (JSQLParserException e) {
System.out.println("Unable to parse query");
e.printStackTrace();
}
Select selectStatement = (Select) statement;
PlainSelect sb = (PlainSelect)selectStatement.getSelectBody();
//your code here
// TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
// List<String> tableList = tablesNamesFinder.getTableList(selectStatement);
//from
FromItem fromItem = sb.getFromItem();
Relation fromRelation = getRelationByName(fromItem.toString());
TupleDesc desc = fromRelation.getDesc();
//Join
List<Join> joins = sb.getJoins();
if(joins != null) {
for(Join join : joins) {
//get join table and condition
Expression joinExpression = join.getOnExpression();
FromItem joinItem = join.getRightItem();
Relation joinRelation = getRelationByName(joinItem.toString());
WhereExpressionVisitor wev = new WhereExpressionVisitor();
joinExpression.accept(wev);
//join relation
String[] rightExpression = wev.getRight().toString().split("\\.");
if (2 == rightExpression.length) {
if(joinItem.toString().toLowerCase().equals(rightExpression[0].toLowerCase())) {
fromRelation = fromRelation.join(joinRelation, fromRelation.getDesc().nameToId(wev.getLeft()), joinRelation.getDesc().nameToId(rightExpression[1]));
}else {
fromRelation = fromRelation.join(joinRelation, fromRelation.getDesc().nameToId(rightExpression[1]), joinRelation.getDesc().nameToId(wev.getLeft()));
}
}
desc = fromRelation.getDesc();
}
}
//where
Expression expression = sb.getWhere();
if(expression != null) {
WhereExpressionVisitor wv = new WhereExpressionVisitor();
expression.accept(wv);
fromRelation = fromRelation.select(desc.nameToId(wv.getLeft()), wv.getOp(), wv.getRight());
}
//select and groupby
List<SelectItem> nodes = sb.getSelectItems();
ArrayList<Integer> projects = new ArrayList<>();
boolean isGroupby = false, isAggregate = false;
ArrayList<Integer> aliasFields = new ArrayList<>();
ArrayList<String> aliasNames = new ArrayList<>();
AggregateOperator o = null;
for(SelectItem node : nodes) {
ColumnVisitor cv = new ColumnVisitor();
node.accept(cv);
String alias = cv.getAlias();
if(alias != null) {
aliasNames.add(alias);
aliasFields.add(desc.nameToId(cv.getColumn()));
}
if(!isAggregate) {
isAggregate = cv.isAggregate();
}
if(isAggregate) {
isGroupby = nodes.size() == 2;
o = cv.getOp();
}
if(cv.getColumn().equals("*")) {
for(int i=0; i<desc.numFields(); i++) {
projects.add(i);
}
break;
}
projects.add(desc.nameToId(cv.getColumn()));
}
if(aliasNames.size() > 0) fromRelation = fromRelation.rename(aliasFields, aliasNames);
fromRelation = fromRelation.project(projects);
if(isAggregate) {
fromRelation = fromRelation.aggregate(o, isGroupby);
}
return fromRelation;
}
public Relation getRelationByName(String tableName){
String fileName = "testfiles/" + tableName + ".txt";
Catalog c = Database.getCatalog();
c.loadSchema(fileName);
int tableId = c.getTableId(tableName);
HeapFile hf = c.getDbFile(tableId);
Relation relation = new Relation(hf.getAllTuples(), hf.getTupleDesc());
return relation;
}
}
|
[
"xuanfan.wu@wustl.edu"
] |
xuanfan.wu@wustl.edu
|
5333d010cd5e3ee05e5b6809525f7f146d068fee
|
a6a272b83d383ddfb22e64802ac7f106bc6c1e5b
|
/app/src/main/java/com/priamm/libvlc/VLCEvent.java
|
f1c1054b5029280eda81bc64d0b367c3b4d952d3
|
[] |
no_license
|
priamm/Vlc
|
d428a8cfe5da0433056263fecd4a57d6e27b8f4c
|
8ac3984c45691d6db21181d8521283bf30d3b085
|
refs/heads/master
| 2021-04-27T00:24:21.183199
| 2018-03-04T16:34:22
| 2018-03-04T16:34:22
| 123,807,409
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,014
|
java
|
/*****************************************************************************
* VLCEvent.java
*****************************************************************************
* Copyright © 2015 VLC authors, VideoLAN and VideoLabs
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package com.priamm.libvlc;
public abstract class VLCEvent {
public final int type;
protected final long arg1;
protected final long arg2;
protected final float argf1;
VLCEvent(int type) {
this.type = type;
this.arg1 = this.arg2 = 0;
this.argf1 = 0.0f;
}
VLCEvent(int type, long arg1) {
this.type = type;
this.arg1 = arg1;
this.arg2 = 0;
this.argf1 = 0.0f;
}
VLCEvent(int type, long arg1, long arg2) {
this.type = type;
this.arg1 = arg1;
this.arg2 = arg2;
this.argf1 = 0.0f;
}
VLCEvent(int type, float argf) {
this.type = type;
this.arg1 = this.arg2 = 0;
this.argf1 = argf;
}
void release() {
/* do nothing */
}
/**
* Listener for libvlc events
*
* @see VLCEvent
*/
public interface Listener<T extends VLCEvent> {
void onEvent(T event);
}
}
|
[
"priamm@mail.ru"
] |
priamm@mail.ru
|
d8fb0ce550189cdb55805a7d56aa744ba059833f
|
56b71d38bbd6a68a15b9d0282647e360b8671114
|
/src/com/esb/jinying/sap/functions/rfc/sap/document/sap_com/ZFM_INT_BW006.java
|
78bebd9d029d155fe0fab8a7bcbb4137f61949d4
|
[] |
no_license
|
BaTianCheng/Gauss-private
|
41c7c8fb58b384b57531f5825526272653d7fea5
|
df98894dd0b9cc548ed4a354d73234920d26ab84
|
refs/heads/master
| 2021-06-29T13:24:04.620226
| 2017-09-17T14:52:38
| 2017-09-17T14:52:38
| 93,713,844
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,805
|
java
|
/**
* ZFM_INT_BW006.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.esb.jinying.sap.functions.rfc.sap.document.sap_com;
public class ZFM_INT_BW006 implements java.io.Serializable {
private java.lang.String COMP_CODE;
private com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE;
private com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB;
public ZFM_INT_BW006() {
}
public ZFM_INT_BW006(
java.lang.String COMP_CODE,
com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE,
com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB) {
this.COMP_CODE = COMP_CODE;
this.PSTNG_DATE = PSTNG_DATE;
this.TAB = TAB;
}
/**
* Gets the COMP_CODE value for this ZFM_INT_BW006.
*
* @return COMP_CODE
*/
public java.lang.String getCOMP_CODE() {
return COMP_CODE;
}
/**
* Sets the COMP_CODE value for this ZFM_INT_BW006.
*
* @param COMP_CODE
*/
public void setCOMP_CODE(java.lang.String COMP_CODE) {
this.COMP_CODE = COMP_CODE;
}
/**
* Gets the PSTNG_DATE value for this ZFM_INT_BW006.
*
* @return PSTNG_DATE
*/
public com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date getPSTNG_DATE() {
return PSTNG_DATE;
}
/**
* Sets the PSTNG_DATE value for this ZFM_INT_BW006.
*
* @param PSTNG_DATE
*/
public void setPSTNG_DATE(com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE) {
this.PSTNG_DATE = PSTNG_DATE;
}
/**
* Gets the TAB value for this ZFM_INT_BW006.
*
* @return TAB
*/
public com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] getTAB() {
return TAB;
}
/**
* Sets the TAB value for this ZFM_INT_BW006.
*
* @param TAB
*/
public void setTAB(com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB) {
this.TAB = TAB;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ZFM_INT_BW006)) return false;
ZFM_INT_BW006 other = (ZFM_INT_BW006) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.COMP_CODE==null && other.getCOMP_CODE()==null) ||
(this.COMP_CODE!=null &&
this.COMP_CODE.equals(other.getCOMP_CODE()))) &&
((this.PSTNG_DATE==null && other.getPSTNG_DATE()==null) ||
(this.PSTNG_DATE!=null &&
this.PSTNG_DATE.equals(other.getPSTNG_DATE()))) &&
((this.TAB==null && other.getTAB()==null) ||
(this.TAB!=null &&
java.util.Arrays.equals(this.TAB, other.getTAB())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getCOMP_CODE() != null) {
_hashCode += getCOMP_CODE().hashCode();
}
if (getPSTNG_DATE() != null) {
_hashCode += getPSTNG_DATE().hashCode();
}
if (getTAB() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getTAB());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getTAB(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ZFM_INT_BW006.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", ">ZFM_INT_BW006"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("COMP_CODE");
elemField.setXmlName(new javax.xml.namespace.QName("", "COMP_CODE"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("PSTNG_DATE");
elemField.setXmlName(new javax.xml.namespace.QName("", "PSTNG_DATE"));
elemField.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", "date"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("TAB");
elemField.setXmlName(new javax.xml.namespace.QName("", "TAB"));
elemField.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", "_-BIC_-AZZCSSJ00"));
elemField.setNillable(false);
elemField.setItemQName(new javax.xml.namespace.QName("", "item"));
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"cheng_wei_njut@163.com"
] |
cheng_wei_njut@163.com
|
0026a6ed013baade752eb71757485d54398820ff
|
a3279a5dbdf60ee5345a6fc55accd2310c7b9f74
|
/src/org/test/chapter1/Duck.java
|
018fb2457f603b675530b33279a6d87b289f19a4
|
[] |
no_license
|
utterson/HeadFirstDesign
|
292e62782b5e9b41f92cfadec59f58cb49c6b9a9
|
43a741e58361625423f2a1a9a07213593044f52b
|
refs/heads/master
| 2016-09-05T17:59:50.798138
| 2014-11-27T19:25:11
| 2014-11-27T19:25:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 516
|
java
|
package org.test.chapter1;
public abstract class Duck {
FlyBehavior flyBehavior;
QuackBehavior quackBehavior;
public Duck() {
}
public abstract void Display();
public void performFly() {
flyBehavior.fly();
}
public void performQuack() {
quackBehavior.quack();
}
public void swim() {
System.out.println("All ducks float, even decoys!");
}
public void setFlyBehavior(FlyBehavior fb) {
flyBehavior = fb;
}
public void setQuackBehavior(QuackBehavior qb) {
quackBehavior = qb;
}
}
|
[
"davidckoch@gmail.com"
] |
davidckoch@gmail.com
|
5b6170138c813f659ea9d0e0d30711d2b33ec9f2
|
6cbfdc6ceb10e4fd7636bb2e1bfc4ae212946613
|
/src/main/java/project/architecture/Architecture.java
|
343921c9cc39a07ac675eb7e21af00211db42245
|
[] |
no_license
|
KarolPetka/Hibernate-Shop
|
e8011bdb05021f9391a4b8ff4a1ee358cca05c34
|
7653301840d54db87be78ea88f94bd00563d5752
|
refs/heads/master
| 2022-12-07T14:05:23.117390
| 2020-08-31T16:02:04
| 2020-08-31T16:02:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,870
|
java
|
package project.architecture;
import project.database.dao.EmployeeDao;
import project.database.dao.LocationDao;
import project.database.dao.LookbookDao;
import project.database.daoImpl.EmployeeDaoImpl;
import project.database.daoImpl.LocationDaoImpl;
import project.database.daoImpl.LookbookDaoImpl;
import project.database.entity.Employee;
import project.database.entity.Location;
import project.database.entity.Lookbook;
import java.util.Scanner;
public class Architecture {
EmployeeDao employeeDao = new EmployeeDaoImpl();
LocationDao locationDao = new LocationDaoImpl();
LookbookDao lookbookDao = new LookbookDaoImpl();
Basket basket = new Basket();
Scanner scanner = new Scanner(System.in);
static String choice;
static boolean isTrue = true;
public void mainMenu() {
System.out.println("+=========================+\n"
+ "|*************************|\n"
+ "|* Welcome to \"The Shop\" *|\n"
+ "|*************************|\n"
+ "+=========================+\n\n"
+ "Select by choosing number\n");
while (isTrue) {
System.out.println("1 - Client Menu\n"
+ "2 - Manager Menu");
choice = scanner.nextLine();
if (choice.equals("1")) {
clientMenu();
isTrue = false;
} else if (choice.equals("2")) {
managerMenu();
isTrue = false;
} else System.out.println("Incorrect choice, try again");
}
}
void clientMenu() {
while (isTrue) {
System.out.println("1 - Shopping\n" +
"2 - Basket\n" +
"0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("1")) {
for (Lookbook lookbook : lookbookDao.findAll()) {
System.out.println(lookbook.toString());
}
while (isTrue) {
System.out.print("\nSelect ID to add to BASKET (0 to quit)\n" +
"ID= ");
choice = scanner.nextLine();
if (choice.equals("0")) {
clientMenu();
} else basket.addToBasket(choice);
}
} else if (choice.equals("2")) {
basket.showBasket();
while (isTrue) {
System.out.println("\n1 - Confirm purchase\n" +
"0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("1")) {
System.out.println("Thank You for purchase!");
basket.basket.clear();
mainMenu();
} else if (choice.equals("0")) {
clientMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("0")) {
mainMenu();
} else System.out.println("Incorrect choice, try again");
}
}
void managerMenu() {
System.out.println("1 - Show employee list\n" +
"2 - Search for employee by ID\n" +
"3 - Add employee\n" +
"4 - Delete employee\n" +
"5 - Show location list\n" +
"6 - Search for location by ID\n" +
"7 - Add location\n" +
"8 - Delete location\n" +
"9 - Show lookbook list\n" +
"10 - Search for products by ID\n" +
"11 - Add product\n" +
"12 - Delete product\n" +
"0 - Go Back");
while (true) {
choice = scanner.nextLine();
if (choice.equals("1")) {
for (Employee employee : employeeDao.findAll()) {
System.out.println(employee.toString());
}
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("2")) {
System.out.print("Provide employee ID to search\n" +
"ID= ");
choice = scanner.nextLine();
System.out.println(employeeDao.findById(Long.parseLong(choice)));
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("3")) {
System.out.print("Provide Employee Name= ");
choice = scanner.nextLine();
Employee employee = new Employee();
employee.setName(choice);
employeeDao.save(employee);
System.out.println("\nEmployee added!\n");
managerMenu();
} else if (choice.equals("4")) {
System.out.print("Provide ID to terminate= ");
choice = scanner.nextLine();
employeeDao.delete(Long.parseLong(choice));
System.out.println("\nEmployee terminated!\n");
managerMenu();
} else if (choice.equals("5")) {
for (Location location : locationDao.findAll()) {
System.out.println(location.toString());
}
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("6")) {
System.out.print("Provide location ID to search\n" +
"ID= ");
choice = scanner.nextLine();
System.out.println(locationDao.findById(Long.parseLong(choice)));
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("7")) {
System.out.print("Provide Location City= ");
choice = scanner.nextLine();
Location location = new Location();
location.setCity(choice);
System.out.print("Provide Location Country= ");
choice = scanner.nextLine();
location.setCountry(choice);
locationDao.save(location);
System.out.println("\nLocation added!\n");
managerMenu();
} else if (choice.equals("8")) {
System.out.print("Provide ID to remove= ");
choice = scanner.nextLine();
locationDao.delete(Long.parseLong(choice));
System.out.println("\nLocation removed!\n");
managerMenu();
} else if (choice.equals("9")) {
for (Lookbook lookbook : lookbookDao.findAll()) {
System.out.println(lookbook.toString());
}
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("10")) {
System.out.print("Provide product ID to search\n" +
"ID= ");
choice = scanner.nextLine();
System.out.println(lookbookDao.findById(Long.parseLong(choice)));
while (isTrue) {
System.out.println("\n0 - Go Back");
choice = scanner.nextLine();
if (choice.equals("0")) {
managerMenu();
} else System.out.println("Incorrect choice, try again");
}
} else if (choice.equals("11")) {
Lookbook lookbook = new Lookbook();
System.out.print("Provide Product Name= ");
choice = scanner.nextLine();
lookbook.setName(choice);
System.out.print("Provide Product Price= ");
choice = scanner.nextLine();
lookbook.setPriceInUSD(Integer.parseInt(choice));
System.out.print("Provide Product Season= ");
choice = scanner.nextLine();
lookbook.setSeason(choice);
lookbookDao.save(lookbook);
System.out.println("\nProduct added!\n");
managerMenu();
} else if (choice.equals("12")) {
System.out.print("Provide ID to remove= ");
choice = scanner.nextLine();
lookbookDao.delete(Long.parseLong(choice));
System.out.println("\nProduct removed!\n");
managerMenu();
} else if (choice.equals("0")) {
mainMenu();
} else System.out.println("Incorrect choice, try again");
}
}
}
|
[
"karolpetka1@gmail.com"
] |
karolpetka1@gmail.com
|
8ce412e1dcbb8492918eb043e1789ed9276b8cb6
|
0f7c1946a755f7619c7268df7568515f1143b4bf
|
/app/src/androidTest/java/com/example/linxsong/wifilight/ExampleInstrumentedTest.java
|
0ac3b3d4a37c023065802a1865529f80167ddbe4
|
[] |
no_license
|
psuxaog/WiFi-Light-Android-App
|
c911a3e8a01f1c1c0f30d289e6724873322a053e
|
08fea3c3249eded26be98d2abbc6598975f42925
|
refs/heads/master
| 2020-04-15T11:46:47.429365
| 2019-01-08T12:28:23
| 2019-01-08T12:28:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 744
|
java
|
package com.example.linxsong.wifilight;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.linxsong.wifilight", appContext.getPackageName());
}
}
|
[
"psuxaog@126.com"
] |
psuxaog@126.com
|
f2f82b70c836f768395c4861b1b3749d408bdfff
|
6ccaef612e5db9b630503c04b99d3441e953a721
|
/src/main/java/com/eksad/latihanspringmvc/repository/ProductRepositoryDAO.java
|
3982cc027f8179fb44245439b646353d8298c3a4
|
[] |
no_license
|
manafharis/latihanspringmvc
|
d98b2811a6b6d322fd5a73db7bf22b88eac2b4b8
|
41668044039c5ae0c19672c92d0df6160ff62b16
|
refs/heads/master
| 2022-01-10T14:49:15.770298
| 2019-07-08T16:50:28
| 2019-07-08T16:50:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 240
|
java
|
package com.eksad.latihanspringmvc.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.eksad.latihanspringmvc.model.Product;
public interface ProductRepositoryDAO extends JpaRepository<Product, Long>{
}
|
[
"harismanaf96@gmail.com"
] |
harismanaf96@gmail.com
|
3a4ef7b220da12d76900d24253a4f89bfe28c8e7
|
64624f404053ee762f404233c2984074092def5e
|
/mybatis_day04_2_Lazy_OneToMany/src/main/java/com/lqh/idao/UserDao.java
|
f93e15653562f5e3bc8538885752f1b4a5b2afd7
|
[] |
no_license
|
bjlqh/mybatis
|
7a6a33cb30a1b8701a8a2b5cef0e48221233c781
|
b35641314b17186d43175e143e0cbcf52d37bb19
|
refs/heads/master
| 2022-07-25T08:38:16.397215
| 2019-06-09T15:54:16
| 2019-06-09T15:54:16
| 191,024,861
| 0
| 0
| null | 2022-06-21T01:15:08
| 2019-06-09T15:43:13
|
Java
|
UTF-8
|
Java
| false
| false
| 212
|
java
|
package com.lqh.idao;
import com.lqh.domain.Account;
import com.lqh.domain.User;
import java.util.List;
public interface UserDao {
/*
查询所有用户
*/
public List<User> findAllUser();
}
|
[
"149975436@qq.com"
] |
149975436@qq.com
|
40b861a4304c409d9c4c570d7b8da609e2681231
|
e0831587277dfa7ce7d4751b5a1f4495ba4142c9
|
/app/src/main/java/shd/com/myapplication/MainActivity.java
|
74ac5f344669f8629bbbdabe5da9c5f0f9434759
|
[] |
no_license
|
mars0925/RecyclerViewRefresh
|
66dcc7370f623f8d1519f91e043a8fded4675d9d
|
4adfd02e10b455607d4339fc19e17e487b445f72
|
refs/heads/master
| 2020-03-23T19:40:26.009149
| 2018-07-23T09:49:53
| 2018-07-23T09:49:53
| 141,994,834
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,270
|
java
|
package shd.com.myapplication;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
private SwipeRefreshLayout s_wipe;
private RecyclerView r_recyclerView;
private ArrayList data = new ArrayList<String>();
private MyAdapter adapter;
private LinearLayoutManager layoutManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initData();
initView();
layoutManager = new LinearLayoutManager(this);
r_recyclerView.setLayoutManager(layoutManager);
r_recyclerView.setAdapter(adapter);
/*設定頂部更新的監聽器*/
s_wipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
updateData();//頂部更新的時候要增加的資料
adapter.notifyDataSetChanged();//更新adapter的資料
s_wipe.setRefreshing(false);//更新完成後,關閉更新的視圖。
}
});
/*有兩種底部加載的方式*/
// /**
// * 1.底部有加載的按鈕,點擊後加載更多資料
// * */
// adapter.setOnItemClickListener(new MyAdapter.OnItemClickLitener() {
// @Override
// public void onItemClick(View view, int position) {
// loadMoreData();
// }
// });
/**
* 2.拉到底部之後自動加載更多資料
* 监听addOnScrollListener这个方法,新建我们的EndLessOnScrollListener
* 在onLoadMore方法中去完成上拉加载的操作
* */
r_recyclerView.addOnScrollListener(new EndLessOnScrollListener(layoutManager) {
@Override
public void onLoadMore(int currentPage) {
Log.d("wnwn","currentPage: " + currentPage);
loadMoreData();
}
});
}
//初始化一开始加载的数据
private void initData(){
for (int i = 0; i < 20; i++){
data.add("Item"+i);
}
}
//初始化界面
private void initView(){
s_wipe = findViewById(R.id.s_wipe);
r_recyclerView = findViewById(R.id.r_recyclerView);
adapter = new MyAdapter(this,data);
//下拉更新轉圈視圖的顏色
s_wipe.setColorSchemeResources(
R.color.red,
R.color.green,
R.color.yello
);
}
private void updateData(){
//我在List最前面加入一条数据
data.add(0, "嘿,我是“下拉刷新”生出来的");
}
//每次底部加载的时候,就加载十条数据到RecyclerView中
private void loadMoreData(){
for (int i =0; i < 10; i++){
data.add("嘿,我是“上拉加载”生出来的"+i);
adapter.notifyDataSetChanged();
}
}
}
|
[
"mars0925@24drs.com"
] |
mars0925@24drs.com
|
8df98f639962dc05176d99e24fc3ebe818dc79e8
|
a2b8b1008dea447c6587374d6688d2bfaf779de3
|
/app/src/main/java/eu/ase/angedasincronizareonline/database/model/User.java
|
9a46ff828d543cdde3d5271388b59bdfe1a69e38
|
[] |
no_license
|
IrisIovu/AgendaAndroid
|
0671a27d63a45aa0aaafb3ad8b77a503fcf0e03a
|
211f91f14481c747bef289c11c794545bae96661
|
refs/heads/master
| 2022-07-21T08:33:36.308205
| 2020-05-20T15:57:28
| 2020-05-20T15:57:28
| 262,748,315
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,980
|
java
|
package eu.ase.angedasincronizareonline.database.model;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
@Entity(tableName = "users")
public class User implements Parcelable {
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id")
private long id;
@ColumnInfo(name = "name")
private String name;
@ColumnInfo(name = "parola")
private String parola;
public User(long id, String name,String parola) {
this.id = id;
this.name = name;
this.parola = parola;
}
@Ignore
public User(String username, String password) {
this.name = username;
this.parola = password;
}
private User(Parcel in) {
this.name = in.readString();
this.parola=in.readString();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParola() {
return parola;
}
public void setParola(String parola) {
this.parola = parola;
}
public static final Creator<User> CREATOR = new Creator<User>() {
@Override
public User createFromParcel(Parcel in) {
return new User(in);
}
@Override
public User[] newArray(int size) {
return new User[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name);
dest.writeString(parola);
}
@Override
public String toString() {
return "User{" +
"name='" + name + '\'' +
", parola='" + parola + '\'' +
'}';
}
public long getId(){
return id;
}
public void setId(long id) {
this.id=id;
}
}
|
[
"iris1607@yahoo.com"
] |
iris1607@yahoo.com
|
34790e91bd16023e8d54505f0322c70837d6a759
|
499f52d6650dfa299c64249e1cf49f99f58c0fe8
|
/src/Vehicle.java
|
cac9ed0cea4f1ea4588d6eeccf2b6959e2f90199
|
[] |
no_license
|
YiShao0829/Chapter4
|
b65bdf511ccf0fb07a2cd84bed6ec95627465f75
|
ae2fed154db10ec2fecfa21619a7d8e7fa6c737b
|
refs/heads/master
| 2023-01-28T12:24:30.102173
| 2020-11-27T18:21:41
| 2020-11-27T18:21:41
| 316,572,348
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 803
|
java
|
abstract class Vehicle
{
protected int speed;
public void setSpeed(int s)
{
speed=s;
System.out.println("將速度設為"+speed+"了");
}
abstract void show();
}
class Car1 extends Vehicle
{
private int num;
private double gas;
public Car1(int n,double g)
{
num=n;
gas=g;
System.out.println("生產了車號為"+num+"汽油量為"+gas+"的車子");
}
public void show()
{
System.out.println("車號是"+num);
System.out.println("汽油量是"+gas);
System.out.println("速度是"+speed);
}
}
class Plane extends Vehicle
{
private int flight;
public Plane(int f)
{
flight=f;
System.out.println("生產了"+flight+"班次的飛機");
}
public void show()
{
System.out.println("飛機的班次是"+flight);
System.out.println("速度是"+speed);
}
}
|
[
"zhouyishao@zhouyisaodeMBP2.mshome.net"
] |
zhouyishao@zhouyisaodeMBP2.mshome.net
|
9daf05cb974b487295f5d4f97e668ed551b8cd12
|
af4671304e1ad2e40fdf33047b45108b4158c5e7
|
/src/admin/web/servlet/AdminDelProductServlet.java
|
852672450030575370da2523e3b19a30f1a809f8
|
[] |
no_license
|
uzxin/xingrenjie
|
f3465de0d163ac6d5821ca957c97fe6bd93e01bf
|
88b809cd57347fd03affb57e108172462d4e7dd3
|
refs/heads/master
| 2020-05-09T04:40:08.049649
| 2019-04-30T14:36:29
| 2019-04-30T14:36:29
| 180,329,097
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,043
|
java
|
package admin.web.servlet;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import admin.service.AdminProductService;
import admin.service.impl.AdminProductServiceImpl;
@WebServlet("/adminDelProduct")
public class AdminDelProductServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//获取要删除的pid
String pid = request.getParameter("pid");
//传递pid到service层
AdminProductService service = new AdminProductServiceImpl();
service.delProductByPid(pid);
response.sendRedirect(request.getContextPath()+"/adminProductList");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
|
[
"125897228@qq.com"
] |
125897228@qq.com
|
83d09ae65f43a0c8f2f002bca29fc39ae25e3b71
|
c590b530d8cf61771dca1edf8a093fcee11c4f30
|
/src/com/triskelion/move/Loader.java
|
69f3263fac7f217b46ac0d1426b06664740eb459
|
[] |
no_license
|
nikolozka/Move.Project
|
6fa2ae16bf78778dd06972bede0c4d98ae5a9c3b
|
5c7065d9128c01395ddd6f1ee8176d024ea412f1
|
refs/heads/master
| 2020-05-19T19:43:20.840381
| 2014-02-02T09:59:01
| 2014-02-02T09:59:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,826
|
java
|
package com.triskelion.move;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
public class Loader extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loader);
if(!checkFirstStart()){
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
SharedPreferences prefs = getPreferences(MODE_PRIVATE);
SharedPreferences.Editor prefEditor = prefs.edit();
prefEditor.putBoolean("Auth", true);
prefEditor.commit();
signInStarter();
}
}, 1000);
}
else{
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
menuStarter();
}
}, 1000);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.loader, menu);
return true;
}
private void signInStarter(){
Intent intent = new Intent(this, SignIn.class);
startActivity(intent);
}
private void menuStarter(){
Intent intent = new Intent(this, StartPage.class);
startActivity(intent);
}
private boolean checkFirstStart(){
SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
boolean auth = sharedPreferences.getBoolean("Auth",false);
return auth;
}
}
|
[
"nikoloz_ka@yahoo.com"
] |
nikoloz_ka@yahoo.com
|
2b6a7f9c23bfac2b11f9fe84ba8b7d26c4d7916f
|
e23130c3b4be8a537723c8b9dd10fa9cc53b6268
|
/app/src/main/java/com/smartbus/heze/fileapprove/module/DepartBudgetWillCheckTypeContract.java
|
a1dddb42f94dab2c17b581b961c9fe79df526438
|
[] |
no_license
|
huysyyrps/joffice_heze
|
cf2ad006b99a5ba6c9ec471d6f3d1ef7df88c9d5
|
170f4a85b554eca5cbbdabacd570b803f73faf42
|
refs/heads/master
| 2021-02-20T18:26:00.267972
| 2020-06-18T03:45:03
| 2020-06-18T03:45:03
| 245,343,572
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 678
|
java
|
package com.smartbus.heze.fileapprove.module;
import com.smartbus.heze.http.base.BaseDSixView;
import com.smartbus.heze.http.base.BasePresenter;
import com.smartbus.heze.oaflow.bean.CheckType;
/**
* Created by Administrator on 2019/4/11.
*/
public interface DepartBudgetWillCheckTypeContract {
interface View extends BaseDSixView<presenter> {
//事故借款修改状态
void setDepartBudgetWillCheckType(CheckType s);
void setDepartBudgetWillCheckTypeMessage(String s);
}
interface presenter extends BasePresenter {
void getDepartBudgetWillCheckType(String runId, String vocationId, String destName, String mycomments);
}
}
|
[
"914036951@qq.com"
] |
914036951@qq.com
|
d91ef5484f4f2ab46c0b472b38adf859118b747e
|
c3dd1f0fc300de3f056fc0e32710876f41757921
|
/ultraGrav2/src/main/java/com/zlscorp/ultragrav/activity/fragment/CalculateFeedbackScaleFragment.java
|
53499e7c4c525dec5f5cdefd5b7ef9882e1fb183
|
[] |
no_license
|
jackw2050/Land_Android
|
53c5de1e06ea626164928af90003183b0e8b2ef6
|
e35b1a4f52d45c3ec42aa876f9de26bd5b8f3af1
|
refs/heads/master
| 2021-01-21T11:23:29.957303
| 2017-03-01T14:42:10
| 2017-03-01T14:42:10
| 83,564,748
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 33,402
|
java
|
package com.zlscorp.ultragrav.activity.fragment;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.logging.Level;
import roboguice.inject.InjectView;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.inject.Inject;
import com.zlscorp.ultragrav.R;
import com.zlscorp.ultragrav.activity.AbstractBaseActivity;
import com.zlscorp.ultragrav.activity.PrivateActivity;
import com.zlscorp.ultragrav.activity.validate.Validator;
import com.zlscorp.ultragrav.activity.validate.Validator.ValidationListener;
import com.zlscorp.ultragrav.activity.widget.ListFragmentPagerAdapter.OnFragmentSelectedListener;
import com.zlscorp.ultragrav.debug.MyDebug;
import com.zlscorp.ultragrav.file.ErrorHandler;
import com.zlscorp.ultragrav.meter.MeterService;
import com.zlscorp.ultragrav.meter.MeterService.EndReadingCallback;
import com.zlscorp.ultragrav.meter.MeterService.GetDutyCycleCallback;
import com.zlscorp.ultragrav.meter.MeterService.ProcessorStateListener;
import com.zlscorp.ultragrav.meter.MeterService.ReadingResponseCallback;
import com.zlscorp.ultragrav.meter.MeterService.SetDutyCycleCallback;
import com.zlscorp.ultragrav.meter.MeterService.StartReadingCallback;
import com.zlscorp.ultragrav.meter.processor.ProcessorState;
import com.zlscorp.ultragrav.model.FeedbackScaleParams;
import com.zlscorp.ultragrav.model.MeterParams;
import com.zlscorp.ultragrav.persist.FeedbackScaleParamsDao;
import com.zlscorp.ultragrav.persist.MeterParamsDao;
import com.zlscorp.ultragrav.type.ObservationType;
//import android.content.Context;
public class CalculateFeedbackScaleFragment extends AbstractBaseFragment
implements OnFragmentSelectedListener {
private static String TAG = "CalculateFeedbackScaleFragment";
@Inject
private FeedbackScaleParamsDao feedbackScaleParamsDao;
@Inject
private MeterParamsDao meterParamsDao;
@Inject
private Validator validator;
@InjectView(R.id.dummyLinearLayout)
private LinearLayout dummyLinearLayout;
@InjectView(R.id.dutyValPreset5Percent)
private Button dutyValPreset5Percent;
@InjectView(R.id.dutyValPreset50Percent)
private Button dutyValPreset50Percent;
@InjectView(R.id.dutyValPreset98Percent)
private Button dutyValPreset98Percent;
@InjectView(R.id.currentDutyCycleText)
private TextView currentDutyCycleText;
@InjectView(R.id.newDutyCycleText)
private EditText newDutyCycleText;
@InjectView(R.id.setDutyCycleButton)
private Button setDutyCycleButton;
@InjectView(R.id.beamFrequencyText)
private TextView beamFrequencyText;
@InjectView(R.id.freqMinus10Text)
private EditText freqMinus10Text;
@InjectView(R.id.freqMinus5Text)
private EditText freqMinus5Text;
@InjectView(R.id.freq0Text)
private EditText freq0Text;
@InjectView(R.id.freqPlus5Text)
private EditText freqPlus5Text;
@InjectView(R.id.freqPlus10Text)
private EditText freqPlus10Text;
@InjectView(R.id.fivePercentMinus10Text)
private EditText fivePercentMinus10Text;
@InjectView(R.id.fivePercentMinus5Text)
private EditText fivePercentMinus5Text;
@InjectView(R.id.fivePercent0Text)
private EditText fivePercent0Text;
@InjectView(R.id.fivePercentPlus5Text)
private EditText fivePercentPlus5Text;
@InjectView(R.id.fivePercentPlus10Text)
private EditText fivePercentPlus10Text;
@InjectView(R.id.nintyEightPercentMinus10Text)
private EditText nintyEightPercentMinus10Text;
@InjectView(R.id.nintyEightPercentMinus5Text)
private EditText nintyEightPercentMinus5Text;
@InjectView(R.id.nintyEightPercent0Text)
private EditText nintyEightPercent0Text;
@InjectView(R.id.nintyEightPercentPlus5Text)
private EditText nintyEightPercentPlus5Text;
@InjectView(R.id.nintyEightPercentPlus10Text)
private EditText nintyEightPercentPlus10Text;
@InjectView(R.id.deltaMinus10Text)
private TextView deltaMinus10Text;
@InjectView(R.id.deltaMinus5Text)
private TextView deltaMinus5Text;
@InjectView(R.id.delta0Text)
private TextView delta0Text;
@InjectView(R.id.deltaPlus5Text)
private TextView deltaPlus5Text;
@InjectView(R.id.deltaPlus10Text)
private TextView deltaPlus10Text;
@InjectView(R.id.c93Text)
private TextView c93Text;
@InjectView(R.id.feedbackScaleText)
private TextView feedbackScaleText;
@InjectView(R.id.ccnmFactorText)
private EditText ccnmFactorText;
@InjectView(R.id.finalFdkScaleText)
private TextView finalFdkScaleText;
@InjectView(R.id.startButton)
private Button startButton;
@InjectView(R.id.clearAllButton)
private Button clearAllButton;
@InjectView(R.id.acceptButton)
private Button acceptButton;
private TextView[] deltaTextArray = new TextView[5];
private EditText[][] feedbackScaleDataTextArray = new EditText[3][5];
private boolean wasStartedByMe;
PrivateActivity parent;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_calculate_feedback_scale, container, false);
parent = (PrivateActivity) getActivity();
return v;
}
String convert(String str)
{
int kind = parent.lankind;
if (kind == 1)
return str.replace(',', '.');
else
return str;
}
@Override
public void setupView(View view, Bundle savedInstanceState) {
feedbackScaleDataTextArray[0][0] = freqMinus10Text;
feedbackScaleDataTextArray[0][1] = freqMinus5Text;
feedbackScaleDataTextArray[0][2] = freq0Text;
feedbackScaleDataTextArray[0][3] = freqPlus5Text;
feedbackScaleDataTextArray[0][4] = freqPlus10Text;
feedbackScaleDataTextArray[1][0] = fivePercentMinus10Text;
feedbackScaleDataTextArray[1][1] = fivePercentMinus5Text;
feedbackScaleDataTextArray[1][2] = fivePercent0Text;
feedbackScaleDataTextArray[1][3] = fivePercentPlus5Text;
feedbackScaleDataTextArray[1][4] = fivePercentPlus10Text;
feedbackScaleDataTextArray[2][0] = nintyEightPercentMinus10Text;
feedbackScaleDataTextArray[2][1] = nintyEightPercentMinus5Text;
feedbackScaleDataTextArray[2][2] = nintyEightPercent0Text;
feedbackScaleDataTextArray[2][3] = nintyEightPercentPlus5Text;
feedbackScaleDataTextArray[2][4] = nintyEightPercentPlus10Text;
deltaTextArray[0] = deltaMinus10Text;
deltaTextArray[1] = deltaMinus5Text;
deltaTextArray[2] = delta0Text;
deltaTextArray[3] = deltaPlus5Text;
deltaTextArray[4] = deltaPlus10Text;
validator.validateAsDouble(newDutyCycleText, MeterParams.DC_LOW_LIMIT,
MeterParams.DC_HIGH_LIMIT);
for (int i = 0 ; i < 5 ; i++) {
validator.validateAsInteger(feedbackScaleDataTextArray[0][i], 1000, 15000);
validator.validateAsDouble(feedbackScaleDataTextArray[1][i], 1000.0, 10000.0);
validator.validateAsDouble(feedbackScaleDataTextArray[2][i], 1000.0, 10000.0);
}
validator.validateAsDouble(ccnmFactorText, 0.0, 2.0);
// validator.validateAsDouble(dutyCycleBufferText);
validator.addValidationListener(new ValidationListener() {
public void onValidation(Object input, boolean inputValid, boolean allInputsValid) {
if (input.equals(newDutyCycleText)) {
setDutyCycleButton.setEnabled(inputValid);
}
}
});
validator.validateAll();
dutyValPreset5Percent.setOnClickListener(new DutyCycle5OnClick());
dutyValPreset50Percent.setOnClickListener(new DutyCycle50OnClick());
dutyValPreset98Percent.setOnClickListener(new DutyCycle98OnClick());
setDutyCycleButton.setOnClickListener(new SetDutyCycleOnClick());
startButton.setOnClickListener(new StartOnClick());
acceptButton.setOnClickListener(new AcceptOnClick());
acceptButton.setEnabled(false);
clearAllButton.setOnClickListener(new ClearAllOnClick());
for (int column = 0 ; column < 5 ; column++) {
DialCounterTextWatcher dialCounterTextWatcher = new DialCounterTextWatcher(column);
feedbackScaleDataTextArray[1][column].addTextChangedListener(dialCounterTextWatcher);
feedbackScaleDataTextArray[2][column].addTextChangedListener(dialCounterTextWatcher);
}
ccnmFactorText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void afterTextChanged(Editable s) {
checkCcnmFactor();
}
});
wasStartedByMe = false;
}
@Override
public void onPause() {
super.onPause();
if (MyDebug.LOG) {
Log.d(TAG, "Fragment Paused");
}
endReading();
}
public class DialCounterTextWatcher implements TextWatcher {
int index;
public DialCounterTextWatcher (int index) {
this.index = index;
}
@Override
public void afterTextChanged(Editable s) {
checkDialValues(index);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}
}
@Override
public void onFragmentSelected() {
if (MyDebug.LOG) {
Log.d(TAG, "Tab selected");
}
// This keeps any real element from getting focus.
dummyLinearLayout.requestFocus();
// set focus on this field and position cursor at right end of line
// newDutyCycleText.requestFocus();
// newDutyCycleText.setSelection(newDutyCycleText.getText().toString().length());
AbstractBaseActivity.fragmentName = this.getClass().getSimpleName();
}
@Override
public void onFragmentUnselected() {
if (MyDebug.LOG) {
Log.d(TAG, "Tab unselected");
}
endReading();
// Hide the soft keyboard before changing tabs.
InputMethodManager imm = (InputMethodManager) getActivity().
getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
}
private void endReading() {
// Stop the reading if it was started in this fragment.
MeterService meter = MeterService.getInstance();
if (meter != null && meter.isReadingInProgress() && wasStartedByMe) {
if (MyDebug.LOG) {
Log.d("EndObsRaceCond", "StopsReadingLineFragment - Sending End Reading command to meter");
}
meter.endReading(new MyEndReadingCallback());
wasStartedByMe = false;
}
currentDutyCycleText.setText("");
beamFrequencyText.setText("");
startButton.setEnabled(true);
}
@Override
public void populateData() {
FeedbackScaleParams feedbackScaleParams = null;
try {
feedbackScaleParams = feedbackScaleParamsDao.queryForDefault();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment.populateData(): " +
"Can't open feedbackScaleParams - " + e,
R.string.feedback_scale_params_file_read_error_title,
R.string.feedback_scale_params_file_read_error_message);
}
if (feedbackScaleParams != null) {
for (int column = 0 ; column < 5 ; column++) {
if (feedbackScaleParams.getFrequencyArray(column) != null) {
feedbackScaleDataTextArray[0][column].setText(convert(feedbackScaleParams.
getFrequencyArray(column).toString()));
}
for (int row = 1 ; row < 3 ; row++) {
if (feedbackScaleParams.getDialCounterArray(row, column) != null) {
feedbackScaleDataTextArray[row][column].setText(convert(feedbackScaleParams.
getDialCounterArray(row, column).toString()));
}
}
}
if (feedbackScaleParams.getCcnmFactor() != null) {
ccnmFactorText.setText(convert(feedbackScaleParams.getCcnmFactor().toString()));
}
}
if (AbstractBaseActivity.fragmentName.equals(this.getClass().getSimpleName())) {
// This keeps any real element from getting focus.
dummyLinearLayout.requestFocus();
// set focus on this field and position cursor at right end of line
// newDutyCycleText.requestFocus();
// newDutyCycleText.setSelection(newDutyCycleText.getText().toString().length());
}
}
private void checkDialValues (int column) {
double fivePercentNum;
double nintyEightPercentNum;
double deltaNum;
double c93Num;
double feedbackScaleNum;
if (validator.isValid(feedbackScaleDataTextArray[1][column]) &&
validator.isValid(feedbackScaleDataTextArray[2][column])) {
fivePercentNum = Double.parseDouble(feedbackScaleDataTextArray[1][column].getText().
toString());
nintyEightPercentNum = Double.parseDouble(feedbackScaleDataTextArray[2][column].getText().
toString());
deltaNum = fivePercentNum - nintyEightPercentNum;
deltaTextArray[column].setText(convert(new DecimalFormat("0.00").format(deltaNum)));
if (column == 2) {
c93Num = deltaNum/.93;
feedbackScaleNum = c93Num/65535;
c93Text.setText(convert(new DecimalFormat("0.00000000").format(c93Num)));
feedbackScaleText.setText(convert(new DecimalFormat("0.#########E0").format(feedbackScaleNum)));
checkCcnmFactor();
}
} else {
deltaTextArray[column].setText("");
if (column == 2) {
c93Text.setText("");
feedbackScaleText.setText("");
finalFdkScaleText.setText("");
acceptButton.setEnabled(false);
}
}
}
private void checkCcnmFactor() {
double ccnmFactorNum;
double finalFeedbackScaleNum;
if (validator.isValid(ccnmFactorText) && feedbackScaleText.getText().toString().length() > 0) {
ccnmFactorNum = Double.parseDouble(ccnmFactorText.getText().toString());
finalFeedbackScaleNum = Double.parseDouble(feedbackScaleText.getText().toString()) *
ccnmFactorNum;
finalFdkScaleText.setText(convert(new DecimalFormat("0.#########E0").format(finalFeedbackScaleNum)));
acceptButton.setEnabled(true);
} else {
finalFdkScaleText.setText("");
acceptButton.setEnabled(false);
}
}
private class StartOnClick implements OnClickListener {
// The StartReading button is used so the app doesn't start communicating with meter
// as soon as the Setup button is tapped. Set Stops and Reading Lines might not be the
// option that the user intends to use.
@Override
public void onClick(View v) {
// Request current DC from meter and display value when received
MeterService meter = MeterService.getInstance();
if (meter != null) {
if (meter.isConnected()) {
meter.getDutyCycle(new MyGetDutyCycleCallback());
} else {
showNoMeterConnectedAlert();
}
} else {
if (MyDebug.LOG) {
Log.e(TAG, "No Meter Service started");
}
showNoMeterConnectedAlert();
}
}
}
private class DutyCycle5OnClick implements OnClickListener {
@Override
public void onClick(View v) {
setDutyCycle(5);
}
}
private class DutyCycle50OnClick implements OnClickListener {
@Override
public void onClick(View v) {
setDutyCycle(50);
}
}
private class DutyCycle98OnClick implements OnClickListener {
@Override
public void onClick(View v) {
setDutyCycle(98);
}
}
private class SetDutyCycleOnClick implements OnClickListener {
@Override
public void onClick(View v) {
if (validator.isValid(newDutyCycleText)) {
setDutyCycle(Double.parseDouble(newDutyCycleText.getText().toString()));
}
}
}
private class ClearAllOnClick implements OnClickListener {
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.confirm_clear_all_alert_title);
builder.setMessage(R.string.confirm_clear_all_alert_message);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
clearAllData();
}
});
builder.setNegativeButton(R.string.no, null);
builder.show();
}
}
private void clearAllData() {
MeterParams meterParams = null;
FeedbackScaleParams feedbackScaleParams = null;
try {
meterParams = meterParamsDao.queryForDefault();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment.clearAllData(): " +
"Can't open meterParams - " + e,
R.string.meter_params_file_open_error_title,
R.string.meter_params_file_open_error_message);
}
if (meterParams != null) {
meterParams.setFeedbackScale(null);
try {
meterParamsDao.update(meterParams);
Toast.makeText(getActivity(), getString(R.string.feedback_scale_value_cleared),
Toast.LENGTH_SHORT).show();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment.clearAllData(): " +
"Can't update meterParams - " + e,
R.string.meter_params_file_update_error_title,
R.string.meter_params_file_update_error_message);
}
}
for (int column = 0 ; column < 5 ; column++) {
for (int row = 0 ; row < 3 ; row++) {
feedbackScaleDataTextArray[row][column].setText("");
}
deltaTextArray[column].setText("");
}
c93Text.setText("");
feedbackScaleText.setText("");
ccnmFactorText.setText("");
finalFdkScaleText.setText("");
try {
feedbackScaleParams = feedbackScaleParamsDao.queryForDefault();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment.clearAllData(): " +
"Can't open feedbackScaleParams - " + e,
R.string.feedback_scale_params_file_open_error_title,
R.string.feedback_scale_params_file_open_error_message);
}
if (feedbackScaleParams != null) {
for (int column = 0 ; column < 5 ; column++) {
feedbackScaleParams.setFrequencyArray(column, null);
for (int row = 1 ; row < 3 ; row++) {
feedbackScaleParams.setDialCounterArray(row, column, null);
}
}
feedbackScaleParams.setCcnmFactor(null);
try {
feedbackScaleParamsDao.update(feedbackScaleParams);
Toast.makeText(getActivity(), getString(R.string.feedback_scale_params_cleared),
Toast.LENGTH_SHORT).show();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment.clearAllData(): " +
"Can't update feedbackScaleParams - " + e,
R.string.feedback_scale_params_file_update_error_title,
R.string.feedback_scale_params_file_update_error_message);
}
}
}
private class AcceptOnClick implements OnClickListener {
@Override
public void onClick(View v) {
MeterParams meterParams = null;
try {
meterParams = meterParamsDao.queryForDefault();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"AcceptOnClick.onClick(): Can't open meterParams - " + e,
R.string.meter_params_file_open_error_title,
R.string.meter_params_file_open_error_message);
}
if (meterParams != null) {
if ((validator.isValid(fivePercent0Text)) && (validator.isValid(nintyEightPercent0Text)) &&
(validator.isValid(ccnmFactorText))) {
meterParams.setFeedbackScale(Double.parseDouble(finalFdkScaleText.getText().
toString()));
}
try {
meterParamsDao.update(meterParams);
Toast.makeText(getActivity(), getString(R.string.feedback_scale_value_saved),
Toast.LENGTH_SHORT).show();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"AcceptOnClick.onClick(): Can't update meterParams - " + e,
R.string.meter_params_file_update_error_title,
R.string.meter_params_file_update_error_message);
}
}
FeedbackScaleParams feedbackScaleParams = null;
try {
feedbackScaleParams = feedbackScaleParamsDao.queryForDefault();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"AcceptOnClick.onClick(): Can't open feedbackScaleParams - " + e,
R.string.feedback_scale_params_file_open_error_title,
R.string.feedback_scale_params_file_open_error_message);
}
if (feedbackScaleParams != null) {
for (int column = 0 ; column < 5 ; column++) {
if (validator.isValid(feedbackScaleDataTextArray[0][column])) {
feedbackScaleParams.setFrequencyArray(column,
Integer.parseInt(feedbackScaleDataTextArray[0][column].
getText().toString()));
}
for (int row = 1 ; row < 3 ; row++) {
if (validator.isValid(feedbackScaleDataTextArray[row][column])) {
feedbackScaleParams.setDialCounterArray(row, column,
Double.parseDouble(feedbackScaleDataTextArray[row][column].
getText().toString()));
}
}
}
if (validator.isValid(ccnmFactorText)) {
feedbackScaleParams.setCcnmFactor(Double.parseDouble(ccnmFactorText.getText().
toString()));
}
try {
feedbackScaleParamsDao.update(feedbackScaleParams);
Toast.makeText(getActivity(), getString(R.string.feedback_scale_params_saved),
Toast.LENGTH_SHORT).show();
} catch (SQLException e) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"AcceptOnClick.onClick(): Can't update feedbackScaleParams - " + e,
R.string.feedback_scale_params_file_update_error_title,
R.string.feedback_scale_params_file_update_error_message);
}
}
}
}
private void setDutyCycle(final double newDutyCycle) {
// Entered as %, in range of 0 - 100 (sort of),
// then converted for meter to the range 65534 - 1.
final int dutyCycle = (int) (655.34 * (100.0 - newDutyCycle));
MeterService meter = MeterService.getInstance();
if (meter != null && meter.isConnected()) {
meter.setDutyCycle(dutyCycle, new SetDutyCycleCallback() {
@Override
public void onSuccess() {
Toast.makeText(getActivity(), getString(R.string.set_duty_cycle_success),
Toast.LENGTH_LONG).show();
currentDutyCycleText.setText(convert(new DecimalFormat("0.0").format(newDutyCycle)));
// position cursor at right end of line
newDutyCycleText.setSelection(newDutyCycleText.getText().length());
}
@Override
public void onFailed(String reason) {
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment." +
"setDutyCycle()$SetDutyCycleCallback.onFailed(): " +
"Can't set duty cycle - " + reason,
R.string.set_duty_cycle_failed_title,
R.string.set_duty_cycle_failed_message);
}
});
} else {
showNoMeterConnectedAlert();
}
}
public void showNoMeterConnectedAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.no_meter_connected_title);
builder.setMessage(R.string.no_meter_connected_message);
builder.setPositiveButton(R.string.ok, null);
builder.show();
}
private class MyStartReadingCallback implements StartReadingCallback {
@Override
public void onSuccess() {
if (MyDebug.LOG) {
Log.d(TAG, "reading stared");
}
// Toast.makeText(getActivity(), getString(R.string.observation_started),
// Toast.LENGTH_SHORT).show();
// Once the reading has begun, disable the Start Reading button.
startButton.setEnabled(false);
wasStartedByMe = true;
// Force the screen to stay on during the reading
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
@Override
public void onFailed(String reason) {
if (MyDebug.LOG) {
Log.d(TAG, reason);
}
// Toast.makeText(getActivity(), reason, Toast.LENGTH_LONG).show();
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"MyStartReadingCallback.onFailed(): " + reason,
R.string.failed_to_start_reading_title,
R.string.failed_to_start_reading_message);
}
}
private class MyReadingResponseCallback implements ReadingResponseCallback {
@Override
public void onFailed(String reason) {
if (MyDebug.LOG) {
Log.d(TAG, reason);
}
Toast.makeText(getActivity(), reason, Toast.LENGTH_LONG).show();
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackFragment$" +
"MyReadingResponseCallback.onFailed(): Error during reading - " + reason,
R.string.interrupted_reading_title,
R.string.interrupted_reading_message);
}
}
private class MyProcessorStateListener implements ProcessorStateListener {
@Override
public void onProcessorState(ProcessorState processorState) {
if (MyDebug.LOG) {
Log.d(TAG, "processor state changed. state=" + processorState);
}
beamFrequencyText.setText(convert(Integer.toString(processorState.getBeamFreq())));
}
@Override
public void onError(String reason) {
Toast.makeText(getActivity(), reason, Toast.LENGTH_LONG).show();
if (MyDebug.LOG) {
Log.d(TAG, "processor state failed. " + reason);
}
}
}
private class MyGetDutyCycleCallback implements GetDutyCycleCallback {
@Override
public void onSuccess(double dutyCycle) {
if (MyDebug.LOG) {
Log.d(TAG, "Duty Cycle from Meter: " + dutyCycle);
}
currentDutyCycleText.setText(convert(new DecimalFormat("0.0").format(dutyCycle)));
MeterService meter = MeterService.getInstance();
if (meter != null && meter.isConnected()) {
meter.startReading(ObservationType.READ_METER, null, null,
new MyStartReadingCallback(), new MyReadingResponseCallback(),
new MyProcessorStateListener());
// This next block was moved to MyStartReadingCallback.onSuccess
// Once the reading has begun, disable the Start Reading button.
// startButton.setEnabled(false);
// wasStartedByMe = true;
// Force the screen to stay on during the reading
// getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
}
@Override
public void onFailed(String reason) {
if (MyDebug.LOG) {
Log.d(TAG, "Get Duty Cycle Failed. " + reason);
}
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"MyGetDutyCycleCallback.onFailed(): Can't get duty cycle - " + reason,
R.string.get_duty_cycle_failed_title,
R.string.get_duty_cycle_failed_message);
}
}
private class MyEndReadingCallback implements EndReadingCallback {
@Override
public void onSuccess() {
if (MyDebug.LOG) {
Log.d(TAG, "reading ended");
}
Toast.makeText(MeterService.getInstance(), getString(R.string.ended_reading_success),
Toast.LENGTH_LONG).show();
}
@Override
public void onFailed(String reason) {
if (MyDebug.LOG) {
Log.d(TAG, "reading end failed. " + reason);
}
// Toast.makeText(MeterService.getInstance(), getString(R.string.ended_reading_failed),
// Toast.LENGTH_LONG).show();
ErrorHandler errorHandler = ErrorHandler.getInstance();
errorHandler.logError(Level.WARNING, "CalculateFeedbackScaleFragment$" +
"MyEndReadingCallback.onFailed(): Can't end reading - " + reason,
R.string.failed_to_end_reading_title,
R.string.failed_to_end_reading_message);
}
}
}
|
[
"jack2050@gmail.com"
] |
jack2050@gmail.com
|
195b403d6e69eaf71e8c3a4034268fdf6d1bcd84
|
19be81da36adec0f3749f75e6a9487feb7a7ad8e
|
/hospitalmanagement/src/main/java/com/hospital/hospitalmanagement/controller/ProvidersController.java
|
c6a87a7030e90b5ef59b674c529dc4cd629be67d
|
[] |
no_license
|
SuriAravind/HospitalSpringBoot
|
8a8f7dde717c25301097b41a88fea2e4ef713d1f
|
c2dcb485d2a3695d19393259cb7f8c96a4208294
|
refs/heads/master
| 2023-05-03T16:43:13.142159
| 2019-07-28T09:33:30
| 2019-07-28T09:33:30
| 195,624,287
| 0
| 1
| null | 2019-07-28T09:33:31
| 2019-07-07T07:47:44
|
Java
|
UTF-8
|
Java
| false
| false
| 2,270
|
java
|
package com.hospital.hospitalmanagement.controller;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.hospital.hospitalmanagement.model.Providers;
import com.hospital.hospitalmanagement.repository.ProvidersRepository;
@RestController
public class ProvidersController
{
@Autowired
private ProvidersRepository providerrepo;
@RequestMapping(value = "/providers/all", method = RequestMethod.GET)
public List<Providers> gettAll() {
return providerrepo.findAll();
}
@GetMapping("/providers/get/{id}")
public Optional<Providers> findById(@PathVariable String id) {
return providerrepo.findById(id);
}
@DeleteMapping(value = "/providers/delete/{id}")
public String deleteById(@PathVariable String id) {
providerrepo.deleteById(id);
return "delete successfully";
}
@PostMapping(value = "/providers/add")
public String addMultiple(@RequestBody Iterable<Providers> provider) {
for (Providers item : provider) {
providerrepo.insert(item);
}
return "insert record successfully";
}
@PutMapping(value = "/providers/update/{id}")
public String updateById(@PathVariable final String id, @RequestBody Providers provider) {
Providers providerDb = null;
Optional<Providers> providerOptional = providerrepo.findById(id);
if (providerOptional.isPresent()) {
providerDb = providerOptional.get();
providerDb.setId(provider.getId());
providerDb.setHospitalName(provider.getHospitalName());
providerDb.setSpecilizationList(provider.getHospitalName());
}
providerDb = providerrepo.save(providerDb);
return "Update Successfully";
}
}
|
[
"Suriya@DESKTOP-JN4T9GH"
] |
Suriya@DESKTOP-JN4T9GH
|
26dffb817164063691eb17100f1842627f1b9e42
|
b7bc39c604f7b83a7d7f0d750240fe86d8df7a5c
|
/java-basic/src/main/java/ch29/i2/X1Car.java
|
3a6edc92e59298577ca4c86ab44fe76edc29debb
|
[] |
no_license
|
ppappikko/bitcamp-java-2018-12
|
e79e023a00c579519ae67ba9f997b615fb539e5c
|
bd2a0b87c20a716d2b1e8cafc2a9cd54f683a37f
|
refs/heads/master
| 2021-08-06T17:31:37.187323
| 2019-07-19T04:55:07
| 2019-07-19T04:55:07
| 163,650,729
| 0
| 0
| null | 2020-04-30T16:14:59
| 2018-12-31T08:01:24
|
Java
|
UTF-8
|
Java
| false
| false
| 1,394
|
java
|
package ch29.i2;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ch29.i.BlackBox;
@Component
public class X1Car {
private String maker;
private String model;
private int cc;
private int valve;
private boolean auto;
private Date createdDate;
@Autowired private BlackBox blackBox;
public X1Car() {
System.out.println("Car()");
}
@Override
public String toString() {
return "Car [maker=" + maker + ", model=" + model + ", cc=" + cc + ", valve=" + valve
+ ", auto=" + auto + ", createdDate=" + createdDate + ", blackBox=" + blackBox + "]";
}
public String getMaker() {
return maker;
}
public void setMaker(String maker) {
this.maker = maker;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public int getCc() {
return cc;
}
public void setCc(int cc) {
this.cc = cc;
}
public int getValve() {
return valve;
}
public void setValve(int valve) {
this.valve = valve;
}
public boolean isAuto() {
return auto;
}
public void setAuto(boolean auto) {
this.auto = auto;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
}
|
[
"sanghyun.dev@gmail.com"
] |
sanghyun.dev@gmail.com
|
6aa97138121e11cc2fcd0e895889c361306eddb5
|
aa34e943e9acf5ffc4bc56502f4c5fa71fb48836
|
/mall-coupon/src/main/java/cn/lhx/mall/coupon/entity/SpuBoundsEntity.java
|
8e626f40187ca700eaad1b53611a35a6bec9642b
|
[] |
no_license
|
leee549/cloud-mall
|
f71aa580df35a814b88e99993a6d2c8ffa951fe5
|
4573da800a62b8a4e3a5e288590764b663e1a36e
|
refs/heads/master
| 2023-03-22T18:43:15.257802
| 2021-03-16T11:18:08
| 2021-03-16T11:18:08
| 291,237,960
| 3
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 788
|
java
|
package cn.lhx.mall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 商品spu积分设置
*
* @author lhx
* @email 1193106371@qq.com
* @date 2020-08-31 18:05:32
*/
@Data
@TableName("sms_spu_bounds")
public class SpuBoundsEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Long id;
/**
* $column.comments
*/
private Long spuId;
/**
* $column.comments
*/
private BigDecimal growBounds;
/**
* $column.comments
*/
private BigDecimal buyBounds;
/**
* $column.comments
*/
private Integer work;
}
|
[
"1193106371@qq.com"
] |
1193106371@qq.com
|
8a7fa0222614fe1a498fecb0f5b86785cec5d35e
|
cf50ae5043d8fda83d1f2c3b32bcc909b7db139c
|
/src/test/java/com/learn/design/ObserverTest.java
|
30eea6ae37c1b54b1393250130b62c025de4097d
|
[] |
no_license
|
CN-ljm/DesignMode
|
24097c8a6fe099f56b8cb96993ea9ea9e89380e2
|
ff29d16e059a5fb4969e2fa31d470794e84f4831
|
refs/heads/master
| 2020-04-09T06:44:36.685379
| 2019-01-24T07:59:28
| 2019-01-24T07:59:28
| 160,125,289
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,506
|
java
|
package com.learn.design;
import com.learn.design.observer.NBAObserverImpl;
import com.learn.design.observer.NBASubjectImpl;
import com.learn.design.observer.StockObserverImpl;
import com.learn.design.observer.StockSubjectImpl;
import org.junit.Test;
public class ObserverTest
{
// @Test
public void testOneSubject()
{
NBAObserverImpl nbaObserver = new NBAObserverImpl("张三");
NBAObserverImpl nbaObserver2 = new NBAObserverImpl("李四");
NBASubjectImpl nbaSubject = new NBASubjectImpl();
nbaSubject.addObserver(nbaObserver);
nbaSubject.addObserver(nbaObserver2);
nbaSubject.notifyObserver();
}
@Test
public void testOneSubject2()
{
NBAObserverImpl nbaObserver = new NBAObserverImpl("张三");
NBAObserverImpl nbaObserver2 = new NBAObserverImpl("李四");
StockObserverImpl stockObserver1 = new StockObserverImpl("王五");
StockObserverImpl stockObserver2 = new StockObserverImpl("赵六");
NBASubjectImpl nbaSubject = new NBASubjectImpl();
StockSubjectImpl stockSubject = new StockSubjectImpl();
stockSubject.addObserver(nbaObserver);
stockSubject.addObserver(nbaObserver2);
stockSubject.addObserver(stockObserver1);
stockSubject.addObserver(stockObserver2);
nbaSubject.addObserver(nbaObserver);
nbaSubject.addObserver(nbaObserver2);
nbaSubject.notifyObserver();
stockSubject.notifyObserver();
}
}
|
[
"liangjiamingliangjiaming@sunline.cn"
] |
liangjiamingliangjiaming@sunline.cn
|
60dcd35d78448989d2657bb53652f438a54bff49
|
1430e774bbbe80383fec90368428d6040ab46506
|
/CRMLeads/app/src/main/java/com/herprogramacion/crmleads/LeadsRepository.java
|
c72a998e16e545aa61a73d8716accc3fb08b52c0
|
[] |
no_license
|
ulisest/ProyectoWeb
|
971bd6afa15e45d9c3d7a7dae65a8714bd472f87
|
9815fbfcf590fb3afd1f01b165cac43d606bd154
|
refs/heads/master
| 2021-01-20T03:04:35.499424
| 2017-09-12T07:06:38
| 2017-09-12T07:06:38
| 101,345,523
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,681
|
java
|
package com.herprogramacion.crmleads;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Repositorio ficticio de leads
*/
public class LeadsRepository {
private static LeadsRepository repository = new LeadsRepository();
private HashMap<String, Lead> leads = new HashMap<>();
public static LeadsRepository getInstance() {
return repository;
}
private LeadsRepository() {
saveLead(new Lead("Alexander Pierrot", "CEO", "Insures S.O.", R.drawable.lead_photo_1));
saveLead(new Lead("Carlos Lopez", "Asistente", "Hospital Blue", R.drawable.lead_photo_2));
saveLead(new Lead("Sara Bonz", "Directora de Marketing", "Electrical Parts ltd", R.drawable.lead_photo_3));
saveLead(new Lead("Liliana Clarence", "Diseñadora de Producto", "Creativa App", R.drawable.lead_photo_4));
saveLead(new Lead("Benito Peralta", "Supervisor de Ventas", "Neumáticos Press", R.drawable.lead_photo_5));
saveLead(new Lead("Juan Jaramillo", "CEO", "Banco Nacional", R.drawable.lead_photo_6));
saveLead(new Lead("Christian Steps", "CTO", "Cooperativa Verde", R.drawable.lead_photo_7));
saveLead(new Lead("Alexa Giraldo", "Lead Programmer", "Frutisofy", R.drawable.lead_photo_8));
saveLead(new Lead("Linda Murillo", "Directora de Marketing", "Seguros Boliver", R.drawable.lead_photo_9));
saveLead(new Lead("Lizeth Astrada", "CEO", "Concesionario Motolox", R.drawable.lead_photo_10));
}
private void saveLead(Lead lead) {
leads.put(lead.getId(), lead);
}
public List<Lead> getLeads() {
return new ArrayList<>(leads.values());
}
}
|
[
"ulisestovar94@gmail.com"
] |
ulisestovar94@gmail.com
|
c29aa259a89cfc2c4b45bbe5b0e1b2da11b74d93
|
bf2e0d83721153686e52f0b98eff8cd2c1087c54
|
/app/src/main/java/com/xunfenqi/model/domain/UserMyTransferSqzrInfo.java
|
8e9d890415b2d43a5bd850997b11d39da4606162
|
[] |
no_license
|
lixuebo0630/XunFenQi
|
19561c737dc5d7d23be18b5abcbb6a33c6a99f41
|
0af99ff5344956f91b51386f40de958214d04ad3
|
refs/heads/master
| 2020-02-26T15:06:42.526958
| 2017-05-23T09:15:18
| 2017-05-23T09:15:18
| 83,567,235
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,003
|
java
|
package com.xunfenqi.model.domain;
/**
*
* @ClassName: UserMyTransferSqzrInfo
* @Description: 用户进入申请转让实体类
* @author Xuebo Li
* @date 2015-12-12 下午2:34:22
*
*/
/**
* @ClassName: UserMyTransferSqzrInfo
* @Description:
* @author Xuebo Li
* @date 2015-12-12 下午2:35:50
*
*/
public class UserMyTransferSqzrInfo {
private String messageType;
private String respCode;
private String respCodeDesc;
private String userId;
private String transferId;
private String xmmc;
private String xmqx;
private String nhll;
private String cybj;
private String ycyts;
private String zrsx;
private String signValue;
private String sxMoney;
private String sxf;
public UserMyTransferSqzrInfo() {
super();
}
public UserMyTransferSqzrInfo(String messageType, String respCode,
String respCodeDesc, String userId, String transferId, String xmmc,
String xmqx, String nhll, String cybj, String ycyts, String zrsx,
String signValue) {
super();
this.messageType = messageType;
this.respCode = respCode;
this.respCodeDesc = respCodeDesc;
this.userId = userId;
this.transferId = transferId;
this.xmmc = xmmc;
this.xmqx = xmqx;
this.nhll = nhll;
this.cybj = cybj;
this.ycyts = ycyts;
this.zrsx = zrsx;
this.signValue = signValue;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getRespCode() {
return respCode;
}
public void setRespCode(String respCode) {
this.respCode = respCode;
}
public String getRespCodeDesc() {
return respCodeDesc;
}
public void setRespCodeDesc(String respCodeDesc) {
this.respCodeDesc = respCodeDesc;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getTransferId() {
return transferId;
}
public void setTransferId(String transferId) {
this.transferId = transferId;
}
public String getXmmc() {
return xmmc;
}
public void setXmmc(String xmmc) {
this.xmmc = xmmc;
}
public String getXmqx() {
return xmqx;
}
public void setXmqx(String xmqx) {
this.xmqx = xmqx;
}
public String getNhll() {
return nhll;
}
public void setNhll(String nhll) {
this.nhll = nhll;
}
public String getCybj() {
return cybj;
}
public void setCybj(String cybj) {
this.cybj = cybj;
}
public String getYcyts() {
return ycyts;
}
public void setYcyts(String ycyts) {
this.ycyts = ycyts;
}
public String getZrsx() {
return zrsx;
}
public void setZrsx(String zrsx) {
this.zrsx = zrsx;
}
public String getSignValue() {
return signValue;
}
public void setSignValue(String signValue) {
this.signValue = signValue;
}
public String getSxMoney() {
return sxMoney;
}
public void setSxMoney(String sxMoney) {
this.sxMoney = sxMoney;
}
public String getSxf() {
return sxf;
}
public void setSxf(String sxf) {
this.sxf = sxf;
}
}
|
[
"18511899797@163.com"
] |
18511899797@163.com
|
370066796d251961750dd080da4a77ab2fa45763
|
16da937a80f24805cc9ead3bd4b0295108ed66af
|
/StringPermutation/src/com/company/Main.java
|
341eaf0a447aeb859f0d850e51552c6bc89cc03e
|
[] |
no_license
|
parthpunkster/crackingthecodinginterview
|
2f9b17d21727480444527775b8453ea4a278ec74
|
bf45c72dc0b6c1dd4eb6e2c4fc05d7eedc55aff4
|
refs/heads/master
| 2021-04-27T14:56:32.099662
| 2018-03-04T02:34:44
| 2018-03-04T02:34:44
| 116,122,970
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 652
|
java
|
package com.company;
public class Main {
public static void permutation (String result, String str) {
int len = str.length();
if (len ==0) {
System.out.println(result);
}
else {
for (int i =0; i < len; i++) {
permutation(result+str.charAt(i),str.substring(0,i) + str.substring(i+1));
}
}
}
public static void main(String[] args) {
// write your code here
// String s = "Parth";
// System.out.println(s.substring(0,3));
permutation("","abc");
// char[] test = new char[] {'a','b','c'};
// swap(test);
}
}
|
[
"parthjain@parthjain.pj1994@gmail.com"
] |
parthjain@parthjain.pj1994@gmail.com
|
6fe123ac9901be60fce93ea765dc1869826e2584
|
749df2d24ecd2ef6b632d70aaeebcd2f750809c8
|
/src/java/controller/RegisterServlet.java
|
9ca98bd8bbe9ed9b6d58bf0d26ff44fad698df56
|
[] |
no_license
|
flavion-dsa/eye-hospital-management
|
516b67f55fd430b3630a8a525746414728061b09
|
39bc464224b19a37f768bc4dec39e6aa1e007a52
|
refs/heads/master
| 2021-01-10T22:53:13.369638
| 2016-10-31T16:04:11
| 2016-10-31T16:04:11
| 70,339,938
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,342
|
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 controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.crce.wtlabs.dto.Patient;
import org.crce.wtlabs.dto.User;
import org.crce.wtlabs.impl.UserDaoImpl;
import org.crce.wtlabs.util.Encrypter;
import org.crce.wtlabs.util.Messenger;
/**
*
* @author Flav
*/
public class RegisterServlet extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
String password = request.getParameter("password");
Encrypter encrypter = new Encrypter();
User u = new User();
u.setName(request.getParameter("email"));
u.setPassword(encrypter.encrypt(password));
u.setType(1);
Random random = new Random();
int vcode = 1000+random.nextInt(8999);
u.setVcode(vcode);
UserDaoImpl uDaoImpl = new UserDaoImpl();
uDaoImpl.addUser(u);
Patient p = new Patient();
p.setFirstName(request.getParameter("first-name"));
p.setLastName(request.getParameter("last-name"));
p.setContact(request.getParameter("phone"));
p.setEmail(request.getParameter("email"));
// Recipient's email ID needs to be mentioned.
String to = request.getParameter("email");
// Sender's email ID needs to be mentioned
String sub = "Hey we just mailed you !";
String text = "and this is crazy\nSo here's your account\nMail us maybe\n\nYour verification code is : " + vcode;
Messenger messenger = new Messenger();
messenger.sendMessage(to,sub,text);
request.getSession().setAttribute("user", u);
request.getSession().setAttribute("patient", p);
RequestDispatcher view = request.getRequestDispatcher("JSP/verify.jsp");
view.forward(request, response);
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
|
[
"flaviondsa@yahoo.in"
] |
flaviondsa@yahoo.in
|
647b6c5fd946ea989ea8e7430796ae58641c7c1c
|
61d05a4a0580c3bce84d99d1d7d93f9a7360f172
|
/src/main/java/by/daryazalevskaya/finalproject/service/dbcreator/UserCreator.java
|
8f9ce4ff3d43be59ce3eeb4d66473c2c0a618300
|
[] |
no_license
|
Pokemon3108/job-search
|
45da7134bebf17739bd84e6e08b89964d90be707
|
54ac227d3f42a39f18100145de85ac09e497b6c5
|
refs/heads/master
| 2023-03-04T15:09:27.740062
| 2021-02-09T21:39:00
| 2021-02-09T21:39:00
| 319,074,139
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 756
|
java
|
package by.daryazalevskaya.finalproject.service.dbcreator;
import by.daryazalevskaya.finalproject.model.User;
import by.daryazalevskaya.finalproject.model.type.Role;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* The type UserCreator creator is used for creation {@code User} object from sql result set
* {@link by.daryazalevskaya.finalproject.model.User}
*/
public class UserCreator extends Creator<User> {
@Override
public User createEntity(ResultSet set) throws SQLException {
return User.builder()
.id(set.getInt("id"))
.email(set.getString("email"))
.password(set.getString("password"))
.role(Role.valueOf(set.getString("role"))).build();
}
}
|
[
"50102121+Pokemon3108@users.noreply.github.com"
] |
50102121+Pokemon3108@users.noreply.github.com
|
edfc88c28a77435219e0134a18601111646ba82f
|
af61521b268d8a8b4237e5efd00e6ec8971df806
|
/Acme-Explorer/src/main/java/controllers/manager/ManagerManagerController.java
|
594ffa7d787dbdfab7ddaa932b1bdbf254f9e8ec
|
[] |
no_license
|
VictoriaCalbet/D11-Group-7
|
04645e8f416f0632915b2c5bf74abbfe4e761aa7
|
59ef8c5780c8a5eaf5ca907802f6ff36552cc0c6
|
refs/heads/master
| 2020-03-12T14:37:47.257617
| 2018-05-09T20:21:29
| 2018-05-09T20:21:29
| 130,671,825
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,513
|
java
|
package controllers.manager;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.Assert;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import services.ManagerService;
import controllers.AbstractController;
import domain.Manager;
@Controller
@RequestMapping("/manager/manager")
public class ManagerManagerController extends AbstractController {
// Services
@Autowired
private ManagerService managerService;
// Constructor
public ManagerManagerController() {
super();
}
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public ModelAndView edit() {
final ModelAndView result;
Manager manager;
manager = this.managerService.findByPrincipal();
Assert.notNull(manager);
result = this.createEditModelAndView(manager);
return result;
}
@RequestMapping(value = "/edit", method = RequestMethod.POST, params = "save")
public ModelAndView save(@Valid final Manager manager, final BindingResult binding) {
ModelAndView result;
boolean bindingError;
if (binding.hasFieldErrors("folders"))
bindingError = binding.getErrorCount() > 1;
else
bindingError = binding.getErrorCount() > 0;
if (bindingError)
result = this.createEditModelAndView(manager);
else
try {
this.managerService.saveFromEditWithEncoding(manager);
result = new ModelAndView("redirect:../..");
} catch (final Throwable oops) {
String messageError = "manager.commit.error";
if (oops.getMessage().contains("message.error"))
messageError = oops.getMessage();
result = this.createEditModelAndView(manager, messageError);
}
return result;
}
// Ancillary methods
protected ModelAndView createEditModelAndView(final Manager manager) {
ModelAndView result;
result = this.createEditModelAndView(manager, null);
return result;
}
protected ModelAndView createEditModelAndView(final Manager manager, final String message) {
ModelAndView result;
result = new ModelAndView("manager/edit");
result.addObject("manager", manager);
result.addObject("message", message);
result.addObject("requestURI", "manager/manager/edit.do");
return result;
}
}
|
[
"guillermo.ag.95@gmail.com"
] |
guillermo.ag.95@gmail.com
|
0eae035556610bd00df4b098565d0e09ce2e6c6f
|
060cca484c932b69dac89b93ced70a4ea3f617b2
|
/dp pattern/decoratorpattern/AbstactFactorypattrnDemo/src/abstactfactorypattrndemo/factoryproducer.java
|
ba5ed1004cdbdb86476fb8db2f0485d53e7bb949
|
[] |
no_license
|
pallavisavaliya/mca-sem-1
|
3a79ef678f05bd83898645db9b1adafae78735fb
|
de735beee288703a1fb3dc9ff01de49c7a5885c4
|
refs/heads/master
| 2023-04-23T17:30:05.898819
| 2021-05-09T06:39:46
| 2021-05-09T06:39:46
| 365,675,437
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 517
|
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 abstactfactorypattrndemo;
/**
*
* @author PALLAVI
*/
public class factoryproducer
{
public static AbstractFactory getfactory(boolean rounded)
{
if(rounded)
{
return new roundedshapefactory();
}
else
{
return new shapefactory();
}
}
}
|
[
"savaliyapallavi64@gmail.com"
] |
savaliyapallavi64@gmail.com
|
02886b9922145423f6452bc46dc5ab2ae04a8f56
|
3419cebbb495e245d6eeddbf289655fb10b6ee3e
|
/JavaEE-ejb/ejbModule/ru/spec/javaee/ejb/aop/LogTime.java
|
6fad078da8c5f2f23a3c811f1a0d39ea6dda162e
|
[
"MIT"
] |
permissive
|
nleva/javaee_2017.02.11
|
73502cf31c0d39fc4283e277e451b1e6608d210e
|
fe069b67321ef3938ffbe75ffe5d68c851612e73
|
refs/heads/master
| 2021-01-19T13:09:17.067003
| 2017-02-25T14:32:53
| 2017-02-25T14:32:53
| 82,391,503
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 357
|
java
|
package ru.spec.javaee.ejb.aop;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Date;
@Retention(RetentionPolicy.RUNTIME)
public @interface LogTime {
int[] value() default 123;
String date() default "";
}
|
[
"admin@10.10.112.86"
] |
admin@10.10.112.86
|
3177665f7ec267f65e65cac187bac54a5222068f
|
9bb65281fa5b84d5cdd7d75ac8214da9c98c61ed
|
/server/src/main/java/tr/com/assignment/department/Department.java
|
e141207ce8273de53da0d32f72aa6444b0130743
|
[] |
no_license
|
yasarkumru/spring-react-example
|
708250caef3d57af908e8663453f94ec6d020f2e
|
fd617bbb449cd8f41c37097dca562ceb6ae93f08
|
refs/heads/master
| 2021-01-23T10:48:43.659972
| 2017-06-01T21:16:18
| 2017-06-01T21:16:18
| 93,099,535
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,952
|
java
|
package tr.com.assignment.department;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.validator.constraints.NotEmpty;
import tr.com.assignment.employee.Employee;
@Entity
@Table(name = "DEPARTMENT")
public class Department implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="DEPARTMENT_ID", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@NotEmpty
@Column(name="NAME", nullable=false)
private String name;
@Column(name="DESCRIPTION")
private String description;
@OneToMany(mappedBy = "departmentId", fetch = FetchType.EAGER)
@Fetch(value = FetchMode.SELECT)
private List<Employee> employees;
public Department() {}
public Department(Integer id, String name, String description) {
this.id = id;
this.name = name;
this.description = description;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Employee> getEmployees() {
return employees;
}
public void setEmployees(List<Employee> employees) {
this.employees = employees;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((employees == null) ? 0 : employees.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Department other = (Department) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (employees == null) {
if (other.employees != null)
return false;
} else if (!employees.equals(other.employees))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
}
|
[
"yasarkumru@gmail.com"
] |
yasarkumru@gmail.com
|
37d879b01fbe3f309ec9108a917191f59d07c452
|
a6b525f10386ca9b5340dbb9f9951fa5dc017051
|
/app/src/main/java/com/dhd/cbmxclient/utils/ShellUtils.java
|
db14d24c975ed40440991bf84af95f7fc207c63e
|
[] |
no_license
|
MartingKing/MVP_develop_structure
|
5ae9d996f7d656cb6f1a9886e9abe6639d6eb108
|
d2c715f6cda8548d27c7849756f8534f4e11bc4b
|
refs/heads/master
| 2021-04-06T19:31:34.631652
| 2018-07-06T03:57:42
| 2018-07-06T03:57:44
| 125,349,400
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,646
|
java
|
package com.dhd.cbmxclient.utils;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2016/8/7
* desc : Shell相关工具类
* </pre>
*/
public class ShellUtils {
private ShellUtils() {
throw new UnsupportedOperationException("u can't instantiate me...");
}
/**
* 是否是在root下执行命令
*
* @param command 命令
* @param isRoot 是否需要root权限执行
* @return CommandResult
*/
public static CommandResult execCmd(String command, boolean isRoot) {
return execCmd(new String[]{command}, isRoot, true);
}
/**
* 是否是在root下执行命令
*
* @param commands 多条命令链表
* @param isRoot 是否需要root权限执行
* @return CommandResult
*/
public static CommandResult execCmd(List<String> commands, boolean isRoot) {
return execCmd(commands == null ? null : commands.toArray(new String[]{}), isRoot, true);
}
/**
* 是否是在root下执行命令
*
* @param commands 多条命令数组
* @param isRoot 是否需要root权限执行
* @return CommandResult
*/
public static CommandResult execCmd(String[] commands, boolean isRoot) {
return execCmd(commands, isRoot, true);
}
/**
* 是否是在root下执行命令
*
* @param command 命令
* @param isRoot 是否需要root权限执行
* @param isNeedResultMsg 是否需要结果消息
* @return CommandResult
*/
public static CommandResult execCmd(String command, boolean isRoot, boolean isNeedResultMsg) {
return execCmd(new String[]{command}, isRoot, isNeedResultMsg);
}
/**
* 是否是在root下执行命令
*
* @param commands 命令链表
* @param isRoot 是否需要root权限执行
* @param isNeedResultMsg 是否需要结果消息
* @return CommandResult
*/
public static CommandResult execCmd(List<String> commands, boolean isRoot, boolean isNeedResultMsg) {
return execCmd(commands == null ? null : commands.toArray(new String[]{}), isRoot, isNeedResultMsg);
}
/**
* 是否是在root下执行命令
*
* @param commands 命令数组
* @param isRoot 是否需要root权限执行
* @param isNeedResultMsg 是否需要结果消息
* @return CommandResult
*/
public static CommandResult execCmd(String[] commands, boolean isRoot, boolean isNeedResultMsg) {
int result = -1;
if (commands == null || commands.length == 0) {
return new CommandResult(result, null, null);
}
Process process = null;
BufferedReader successResult = null;
BufferedReader errorResult = null;
StringBuilder successMsg = null;
StringBuilder errorMsg = null;
DataOutputStream os = null;
try {
process = Runtime.getRuntime().exec(isRoot ? "su" : "sh");
os = new DataOutputStream(process.getOutputStream());
for (String command : commands) {
if (command == null) continue;
os.write(command.getBytes());
os.writeBytes("\n");
os.flush();
}
os.writeBytes("exit\n");
os.flush();
result = process.waitFor();
if (isNeedResultMsg) {
successMsg = new StringBuilder();
errorMsg = new StringBuilder();
successResult = new BufferedReader(new InputStreamReader(process.getInputStream(), "UTF-8"));
errorResult = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8"));
String s;
while ((s = successResult.readLine()) != null) {
successMsg.append(s);
}
while ((s = errorResult.readLine()) != null) {
errorMsg.append(s);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
closeIO(os, successResult, errorResult);
if (process != null) {
process.destroy();
}
}
return new CommandResult(
result,
successMsg == null ? null : successMsg.toString(),
errorMsg == null ? null : errorMsg.toString()
);
}
/**
* 返回的命令结果
*/
public static class CommandResult {
/**
* 结果码
**/
public int result;
/**
* 成功信息
**/
public String successMsg;
/**
* 错误信息
**/
public String errorMsg;
public CommandResult(int result, String successMsg, String errorMsg) {
this.result = result;
this.successMsg = successMsg;
this.errorMsg = errorMsg;
}
}
/**
* 关闭IO
*
* @param closeables closeable
*/
public static void closeIO(Closeable... closeables) {
if (closeables == null) return;
for (Closeable closeable : closeables) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
|
[
"dhd040805@gmail.com"
] |
dhd040805@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.