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
ee0658ccf7ac0460cab526273ffff8e32f51c476
060d61cb219eb20a7b11abaa914def74d4605c50
/onlineMall-dev-pojo/src/main/java/com/heweixing/pojo/bo/SubmitOrderBO.java
7d02e0652ba048d9f3663095528e3525c078d1f4
[]
no_license
starheweixing/onlineMall
410e2269bd5967578c0382235ce5e933a173c82c
bee9b6919d674719226b6d85aea8100b12c0785d
refs/heads/master
2023-05-15T02:30:57.941287
2021-05-31T15:17:32
2021-05-31T15:17:32
353,915,791
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
package com.heweixing.pojo.bo; public class SubmitOrderBO { /** * 用于创建订单的bo对象 */ private String userId; private String ItemSpecIds; private String addressId; private Integer payMethod; private String leftMsg; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getItemSpecIds() { return ItemSpecIds; } public void setItemSpecIds(String itemSpecIds) { ItemSpecIds = itemSpecIds; } public String getAddressId() { return addressId; } public void setAddressId(String addressId) { this.addressId = addressId; } public Integer getPayMethod() { return payMethod; } public void setPayMethod(Integer payMethod) { this.payMethod = payMethod; } public String getLeftMsg() { return leftMsg; } public void setLeftMsg(String leftMsg) { this.leftMsg = leftMsg; } @Override public String toString() { return "SubmitOrderBO{" + "userId='" + userId + '\'' + ", ItemSpecIds='" + ItemSpecIds + '\'' + ", addressId='" + addressId + '\'' + ", payMethod=" + payMethod + ", leftMsg='" + leftMsg + '\'' + '}'; } }
[ "767209548@qq.com" ]
767209548@qq.com
d4706556107dffcb0edee8cc9b8f423e5fb3a780
525dd1ab6c6ec23fbbfc58a3213c6947bfcf55e4
/src/TreeVector/NewickParser.java
009d7f5fac9cd8b5acc296340a09c16891b40a76
[]
no_license
gatechatl/STRAW
312f92f0f8c4bd70b5f5422e612ef8762cbda85a
f2f054ba51bcf4be937c17c70c9fc4f82690ad03
refs/heads/master
2021-06-26T12:36:00.754838
2020-12-25T20:20:05
2020-12-25T20:20:05
75,668,076
0
0
null
null
null
null
UTF-8
Java
false
false
10,385
java
package TreeVector; import java.util.Stack; import java.io.*; /** * A Parser for the Newick format of tree topologies. * Contains methods to parse to internal format or output as XML. * Uses Node objects for internal data structure. * * @author Ralph Pethica * @version 11/08/2006 */ public class NewickParser { private String newick; private Stack <Node> currentnode; private Node node; private int position; private boolean firstpass; /** * Constructor for objects of class NewickParser */ public NewickParser() { newick = new String(); position = 0; currentnode = new Stack<Node>(); node = new Node(); currentnode.push(node); firstpass = true; } /** * Main parser, should be used once the newick string is loaded. * Can be loaded using readFile or setString methods. * Possibly change this to several constructors later. * @param void * @return void(for now) */ public void parseTree() { if (newick == null || newick.equals("")){ //Check tree variable has been filled System.out.println("Please load a tree before using the parsetree method"); System.exit(1); } if (checkBrackets() == false){ //Check brackets for pre loaded newick tree System.out.println("There is a ')' in the wrong place in this tree"); System.exit(1); } String noblanks = newick.replace(" ", ""); newick = noblanks; //Get rid of blanks between chars for easier parsing int i=newick.length(); char c = newick.charAt(i-1); if(c != ';'){ System.out.println("Tree does not end in a ';'"); System.exit(1); } scanNode(); } /** * Reads the next node in the newick string * * @param void * @return void */ private void scanNode() { if (getCurrentChar() == '('){ //if the char is a ( then we must have hit an internal node scanInternalNode(); //System.out.println("Internal Node Found"); } else if (getCurrentChar() != ';'){ //if char is anything else, then it must be a leaf node label getLeafLabel(); //System.out.println("Leaf Label Found"); } else { //Else must be a ; so report error System.out.println("Found a ; in the wrong place in tree"); System.exit(1); } } /** * Reads an internal node of the newick string * * @param void * @return void */ private void scanInternalNode() { position++; if (firstpass == true){ //This statement is here to make sure a node is not added as a descendant first time round firstpass = false; //Once set to false a child node is always added to the stack } else{ Node node = new Node(); //We now make a new node Node topnode = currentnode.pop(); //get the last node from stack topnode.addChild(node); //add new node as child of last node currentnode.push(topnode); //push lastnode back currentnode.push(node); //push new node back } scanNode(); //Read the first node while (getCurrentChar() != ')'){ if (getCurrentChar() == ','){ //if character is a , then move to next char position++; //System.out.println("Found a , in while loop and incremented position to: " + position + " char at pos = " + newick.charAt(position)); } scanNode(); } position++; if (getCurrentChar() != ',' && getCurrentChar() != ')' && getCurrentChar() != ';'){ //label found //System.out.println("About to get label in scanInternalNode method"); Node tempnode = currentnode.pop(); tempnode.setName(getLabel()); currentnode.push(tempnode); } if (getCurrentChar() == ':'){ //length found position++; Node lengthnode = currentnode.pop(); //pop last node lengthnode.setLength(getLength()); //set the length to double from getlength method currentnode.push(lengthnode); //push back on stack } currentnode.pop(); } /** * Gets the label from a string using the next end character as a mark * * @param void * @return String */ private String getLabel() { String label = new String(); int end = getNodeEnd(); //find the next end character int colon = newick.indexOf( ':',position); if (colon >=0 && colon < end){ //activate when length calculator sorted end = colon; } label = newick.substring(position, end); // get all characters between current position and located end char position = end; // once done, set the position to end return label; } private void getLeafLabel() { String label = getLabel(); Node childnode = new Node(); childnode.setName(label); childnode.setType("leaf"); if (getCurrentChar() == ':'){ position++; childnode.setLength(getLength()); //set the length to double from getlength method } Node tempnode = currentnode.pop(); tempnode.addChild(childnode); currentnode.push(tempnode); //System.out.println("Leaf label found looks like: " + label); //System.out.println("Char at position now is: " + newick.charAt(position)); } private double getLength() { int end = getNodeEnd(); double length = 0; String stringlength = newick.substring(position, end); try { length = Double.valueOf(stringlength); } catch (Exception e){ System.out.println("Error reading branch length"); System.exit(1); } position = end; ///May want to add check that end is valid before doing this //System.out.println("Length found is: " + length); return length; } /** * Uses the position int to calculate the int location in the newick char array(string) of a end of label character such as , * * @param void * @return int location */ public int getNodeEnd() { int comma = newick.indexOf(',',position); //if nothing found a -1 value is returned, and must be checked for later int semicolon = newick.indexOf(';',position); int rightbracket = newick.indexOf(')',position); int leftbracket = newick.indexOf('(',position); int location = newick.length(); //position of current end char if (comma >= 0){ //if there is a comma coming up location = comma; //location of the comma is the current position in string plus distance of comma } if(semicolon >= 0 && semicolon < location){ //if there is a semicolon before comma, then use that as end location = semicolon; } if (rightbracket >= 0 && rightbracket < location){ //if there is a right bracket before semicolon, then use that as end location = rightbracket; } if (leftbracket >= 0 && leftbracket < location) { System.out.println("Found opening bracket in wrong place when detecting node end"); System.exit(1); } return location; } /** * Gets the char in the newick string at the location of the position counter int * * @param void * @return char */ private char getCurrentChar() { if (position>newick.length()){ System.out.println("Position counter off scale of tree string"); System.exit(1); } char c = newick.charAt(position); return c; } /** * Reads a Newick Tree from a file and loads to main string variable * * @param String filename * @return void(for now) */ public void readFile(String filename) { try { BufferedReader in= new BufferedReader(new FileReader(filename)); String line; String tree = new String(); while ((line = in.readLine()) != null) { tree = tree + line; } in.close(); newick = tree; //System.out.println(tree); } catch (Exception e) { System.err.println("File input error, please make sure file name is the first arguement"); } } /** * Loads main variable directly a with newick string * * @param String tree * @return void(for now) */ public void setString(String tree) { newick = tree; } private boolean checkBrackets() //Checks the bracket numbers for a string returns true if OK { int bracketcounter = 0; for (int i=0; i<newick.length();i++){ char c = newick.charAt(i); if(c == '('){ bracketcounter++; } else if(c==')'){ bracketcounter--; } if (bracketcounter < 0){ //If there is an closing bracket before the next opening return false; } } if (bracketcounter > 0){ //If the number of brackets of each type is not equal return false; } return true; } /** * Returns the main (parsed) node of the root of tree * * @param void * @return Node node */ public Node getNode() { return node; } }
[ "gatechatl@gmail.com" ]
gatechatl@gmail.com
013615f9c4ae26accea39704a1715e001ed68ad8
7c1430c53b4d66ad0e96dd9fc7465a5826fdfb77
/uims-support/src/cn/edu/sdu/uims/itms/task/ITaskBase.java
c2c64adf1c97819a10ed90a56f450fa4ca131cbc
[]
no_license
wang3624270/online-learning-server
ef97fb676485f2bfdd4b479235b05a95ad62f841
2d81920fef594a2d0ac482efd76669c8d95561f1
refs/heads/master
2020-03-20T04:33:38.305236
2019-05-22T06:31:05
2019-05-22T06:31:05
137,187,026
1
0
null
null
null
null
UTF-8
Java
false
false
1,037
java
package cn.edu.sdu.uims.itms.task; import java.awt.Graphics; import java.util.EventObject; import cn.edu.sdu.uims.itms.def.ITaskTemplate; import cn.edu.sdu.uims.itms.handler.IHandler; import cn.edu.sdu.uims.trans.UFPoint; public class ITaskBase { protected ITaskTemplate taskTemplate; protected IHandler handler; protected ISubTask owner; public ITaskBase() { } public void init() { } // public void start() { // // } public void start(String enterStatusFlag, UFPoint firstP) { } public void setTemplate(ITaskTemplate temp) { taskTemplate = temp; } public ITaskTemplate getTemplate() { return taskTemplate; } public void setHandler(IHandler handler) { this.handler = handler; } public IHandler getHandler() { return handler; } public int processEvent(String eventName, EventObject e) { return -1; } public void setParaData(Object data) { } public void setCurrentPoint(UFPoint p) { // } public void setOwner(ISubTask o) { owner = o; } public void drawCursor(Graphics dc) { } }
[ "3624270@qq.com" ]
3624270@qq.com
9f04930cea39aaf2b1cbd0275a6ae057ac0ef70c
58cd5a5c2ac064f6117bcc0b9241a96fa213adf3
/src/main/java/net/madicorp/smartinvestplus/stockexchange/domain/StockExchangeWithSecurities.java
7912a419e45dc0cb6e7aebcb3e1a02be4f41d2d0
[]
no_license
madicorp/smartinvestplus-back
98dc1c960d34db6bbd8a395fd8799a260f9cd7df
d0a9c76db97b7a321df62a507ff792b4f1bee0f0
refs/heads/master
2021-01-17T19:00:45.484868
2016-08-07T09:58:37
2016-08-07T20:17:03
62,477,335
0
0
null
2016-08-03T00:01:49
2016-07-03T02:02:00
Java
UTF-8
Java
false
false
1,215
java
package net.madicorp.smartinvestplus.stockexchange.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.*; import org.jongo.marshall.jackson.oid.MongoId; import org.springframework.cloud.cloudfoundry.com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.data.mongodb.core.mapping.Document; import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; /** * User: sennen * Date: 02/07/2016 * Time: 00:08 */ @Document(collection = "stock_exchanges") @Getter @Setter @NoArgsConstructor @EqualsAndHashCode(of = {"stockExchange"}) @ToString(of = {"stockExchange"}) public class StockExchangeWithSecurities { @JsonIgnore private StockExchange stockExchange = new StockExchange(); private List<Security> securities = new ArrayList<>(); public void setSymbol(String symbol) { stockExchange.setSymbol(symbol); } @NotNull @MongoId public String getSymbol() { return stockExchange.getSymbol(); } public void setName(String name) { stockExchange.setName(name); } @NotNull @JsonProperty public String getName() { return stockExchange.getName(); } }
[ "ekougs@gmail.com" ]
ekougs@gmail.com
3e1ebd56a9ef1db47ccbdadb96e9ebf01fc2233d
64cc0c69946d673cd6c9624a009dde8213de06e3
/src/test/java/com/aidriveall/cms/web/rest/AuthorityResourceIT.java
bcfc1ff470530442889021459ac65dbc86c2fac5
[ "MIT" ]
permissive
luhai1/jhi-ant-vue
5d46a5dbf0f1133edb63a049909e960f7053c66c
e0aba8370ea1f9c8804bf1e3cfb319ee2ed29666
refs/heads/master
2023-03-21T11:42:40.672265
2020-10-09T08:51:15
2020-10-09T08:51:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
35,046
java
package com.aidriveall.cms.web.rest; import com.aidriveall.cms.JhiAntVueApp; import com.aidriveall.cms.domain.Authority; import com.aidriveall.cms.domain.Authority; import com.aidriveall.cms.domain.User; import com.aidriveall.cms.domain.ViewPermission; import com.aidriveall.cms.repository.AuthorityRepository; import com.aidriveall.cms.service.AuthorityService; import com.aidriveall.cms.service.dto.AuthorityDTO; import com.aidriveall.cms.service.mapper.AuthorityMapper; import com.aidriveall.cms.web.rest.errors.ExceptionTranslator; import com.aidriveall.cms.service.dto.AuthorityCriteria; import com.aidriveall.cms.service.AuthorityQueryService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.Validator; import javax.persistence.EntityManager; import java.util.ArrayList; import java.util.List; import static com.aidriveall.cms.web.rest.TestUtil.createFormattingConversionService; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Integration tests for the {@link AuthorityResource} REST controller. */ @SpringBootTest(classes = JhiAntVueApp.class) public class AuthorityResourceIT { private static final String DEFAULT_NAME = "AAAAAAAAAA"; private static final String UPDATED_NAME = "BBBBBBBBBB"; private static final String DEFAULT_CODE = "AAAAAAAAAA"; private static final String UPDATED_CODE = "BBBBBBBBBB"; private static final String DEFAULT_INFO = "AAAAAAAAAA"; private static final String UPDATED_INFO = "BBBBBBBBBB"; private static final Integer DEFAULT_ORDER = 1; private static final Integer UPDATED_ORDER = 2; private static final Integer SMALLER_ORDER = 1 - 1; private static final Boolean DEFAULT_DISPLAY = false; private static final Boolean UPDATED_DISPLAY = true; @Autowired private AuthorityRepository authorityRepository; @Mock private AuthorityRepository authorityRepositoryMock; @Autowired private AuthorityMapper authorityMapper; @Mock private AuthorityService authorityServiceMock; @Autowired private AuthorityService authorityService; @Autowired private AuthorityQueryService authorityQueryService; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private EntityManager em; @Autowired private Validator validator; private MockMvc restAuthorityMockMvc; private Authority authority; @BeforeEach public void setup() { MockitoAnnotations.initMocks(this); final AuthorityResource authorityResource = new AuthorityResource(authorityService, authorityQueryService); this.restAuthorityMockMvc = MockMvcBuilders.standaloneSetup(authorityResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter) .setValidator(validator).build(); } /** * 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 Authority createEntity(EntityManager em) { Authority authority = new Authority() .name(DEFAULT_NAME) .code(DEFAULT_CODE) .info(DEFAULT_INFO) .order(DEFAULT_ORDER) .display(DEFAULT_DISPLAY); return authority; } /** * 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 Authority createUpdatedEntity(EntityManager em) { Authority authority = new Authority() .name(UPDATED_NAME) .code(UPDATED_CODE) .info(UPDATED_INFO) .order(UPDATED_ORDER) .display(UPDATED_DISPLAY); return authority; } @BeforeEach public void initTest() { authority = createEntity(em); } @Test @Transactional public void createAuthority() throws Exception { int databaseSizeBeforeCreate = authorityRepository.findAll().size(); // Create the Authority AuthorityDTO authorityDTO = authorityMapper.toDto(authority); restAuthorityMockMvc.perform(post("/api/authorities") .contentType(TestUtil.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(authorityDTO))) .andExpect(status().isCreated()); // Validate the Authority in the database List<Authority> authorityList = authorityRepository.findAll(); assertThat(authorityList).hasSize(databaseSizeBeforeCreate + 1); Authority testAuthority = authorityList.get(authorityList.size() - 1); assertThat(testAuthority.getName()).isEqualTo(DEFAULT_NAME); assertThat(testAuthority.getCode()).isEqualTo(DEFAULT_CODE); assertThat(testAuthority.getInfo()).isEqualTo(DEFAULT_INFO); assertThat(testAuthority.getOrder()).isEqualTo(DEFAULT_ORDER); assertThat(testAuthority.isDisplay()).isEqualTo(DEFAULT_DISPLAY); } @Test @Transactional public void createAuthorityWithExistingId() throws Exception { int databaseSizeBeforeCreate = authorityRepository.findAll().size(); // Create the Authority with an existing ID authority.setId(1L); AuthorityDTO authorityDTO = authorityMapper.toDto(authority); // An entity with an existing ID cannot be created, so this API call must fail restAuthorityMockMvc.perform(post("/api/authorities") .contentType(TestUtil.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(authorityDTO))) .andExpect(status().isBadRequest()); // Validate the Authority in the database List<Authority> authorityList = authorityRepository.findAll(); assertThat(authorityList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void getAllAuthorities() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList restAuthorityMockMvc.perform(get("/api/authorities?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(authority.getId().intValue()))) .andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME))) .andExpect(jsonPath("$.[*].code").value(hasItem(DEFAULT_CODE))) .andExpect(jsonPath("$.[*].info").value(hasItem(DEFAULT_INFO))) .andExpect(jsonPath("$.[*].order").value(hasItem(DEFAULT_ORDER))) .andExpect(jsonPath("$.[*].display").value(hasItem(DEFAULT_DISPLAY.booleanValue()))); } @SuppressWarnings({"unchecked"}) public void getAllAuthoritiesWithEagerRelationshipsIsEnabled() throws Exception { AuthorityResource authorityResource = new AuthorityResource(authorityServiceMock, authorityQueryService); when(authorityServiceMock.findAllWithEagerRelationships(any())).thenReturn(new PageImpl(new ArrayList<>())); MockMvc restAuthorityMockMvc = MockMvcBuilders.standaloneSetup(authorityResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter).build(); restAuthorityMockMvc.perform(get("/api/authorities?eagerload=true")) .andExpect(status().isOk()); verify(authorityServiceMock, times(1)).findAllWithEagerRelationships(any()); } @SuppressWarnings({"unchecked"}) public void getAllAuthoritiesWithEagerRelationshipsIsNotEnabled() throws Exception { AuthorityResource authorityResource = new AuthorityResource(authorityServiceMock, authorityQueryService); when(authorityServiceMock.findAllWithEagerRelationships(any())).thenReturn(new PageImpl(new ArrayList<>())); MockMvc restAuthorityMockMvc = MockMvcBuilders.standaloneSetup(authorityResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setControllerAdvice(exceptionTranslator) .setConversionService(createFormattingConversionService()) .setMessageConverters(jacksonMessageConverter).build(); restAuthorityMockMvc.perform(get("/api/authorities?eagerload=true")) .andExpect(status().isOk()); verify(authorityServiceMock, times(1)).findAllWithEagerRelationships(any()); } @Test @Transactional public void getAuthority() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get the authority restAuthorityMockMvc.perform(get("/api/authorities/{id}", authority.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.id").value(authority.getId().intValue())) .andExpect(jsonPath("$.name").value(DEFAULT_NAME)) .andExpect(jsonPath("$.code").value(DEFAULT_CODE)) .andExpect(jsonPath("$.info").value(DEFAULT_INFO)) .andExpect(jsonPath("$.order").value(DEFAULT_ORDER)) .andExpect(jsonPath("$.display").value(DEFAULT_DISPLAY.booleanValue())); } @Test @Transactional public void getAuthoritiesByIdFiltering() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); Long id = authority.getId(); defaultAuthorityShouldBeFound("id.equals=" + id); defaultAuthorityShouldNotBeFound("id.notEquals=" + id); defaultAuthorityShouldBeFound("id.greaterThanOrEqual=" + id); defaultAuthorityShouldNotBeFound("id.greaterThan=" + id); defaultAuthorityShouldBeFound("id.lessThanOrEqual=" + id); defaultAuthorityShouldNotBeFound("id.lessThan=" + id); } @Test @Transactional public void getAllAuthoritiesByNameIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name equals to DEFAULT_NAME defaultAuthorityShouldBeFound("name.equals=" + DEFAULT_NAME); // Get all the authorityList where name equals to UPDATED_NAME defaultAuthorityShouldNotBeFound("name.equals=" + UPDATED_NAME); } @Test @Transactional public void getAllAuthoritiesByNameIsNotEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name not equals to DEFAULT_NAME defaultAuthorityShouldNotBeFound("name.notEquals=" + DEFAULT_NAME); // Get all the authorityList where name not equals to UPDATED_NAME defaultAuthorityShouldBeFound("name.notEquals=" + UPDATED_NAME); } @Test @Transactional public void getAllAuthoritiesByNameIsInShouldWork() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name in DEFAULT_NAME or UPDATED_NAME defaultAuthorityShouldBeFound("name.in=" + DEFAULT_NAME + "," + UPDATED_NAME); // Get all the authorityList where name equals to UPDATED_NAME defaultAuthorityShouldNotBeFound("name.in=" + UPDATED_NAME); } @Test @Transactional public void getAllAuthoritiesByNameIsNullOrNotNull() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name is not null defaultAuthorityShouldBeFound("name.specified=true"); // Get all the authorityList where name is null defaultAuthorityShouldNotBeFound("name.specified=false"); } @Test @Transactional public void getAllAuthoritiesByNameContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name contains DEFAULT_NAME defaultAuthorityShouldBeFound("name.contains=" + DEFAULT_NAME); // Get all the authorityList where name contains UPDATED_NAME defaultAuthorityShouldNotBeFound("name.contains=" + UPDATED_NAME); } @Test @Transactional public void getAllAuthoritiesByNameNotContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where name does not contain DEFAULT_NAME defaultAuthorityShouldNotBeFound("name.doesNotContain=" + DEFAULT_NAME); // Get all the authorityList where name does not contain UPDATED_NAME defaultAuthorityShouldBeFound("name.doesNotContain=" + UPDATED_NAME); } @Test @Transactional public void getAllAuthoritiesByCodeIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code equals to DEFAULT_CODE defaultAuthorityShouldBeFound("code.equals=" + DEFAULT_CODE); // Get all the authorityList where code equals to UPDATED_CODE defaultAuthorityShouldNotBeFound("code.equals=" + UPDATED_CODE); } @Test @Transactional public void getAllAuthoritiesByCodeIsNotEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code not equals to DEFAULT_CODE defaultAuthorityShouldNotBeFound("code.notEquals=" + DEFAULT_CODE); // Get all the authorityList where code not equals to UPDATED_CODE defaultAuthorityShouldBeFound("code.notEquals=" + UPDATED_CODE); } @Test @Transactional public void getAllAuthoritiesByCodeIsInShouldWork() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code in DEFAULT_CODE or UPDATED_CODE defaultAuthorityShouldBeFound("code.in=" + DEFAULT_CODE + "," + UPDATED_CODE); // Get all the authorityList where code equals to UPDATED_CODE defaultAuthorityShouldNotBeFound("code.in=" + UPDATED_CODE); } @Test @Transactional public void getAllAuthoritiesByCodeIsNullOrNotNull() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code is not null defaultAuthorityShouldBeFound("code.specified=true"); // Get all the authorityList where code is null defaultAuthorityShouldNotBeFound("code.specified=false"); } @Test @Transactional public void getAllAuthoritiesByCodeContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code contains DEFAULT_CODE defaultAuthorityShouldBeFound("code.contains=" + DEFAULT_CODE); // Get all the authorityList where code contains UPDATED_CODE defaultAuthorityShouldNotBeFound("code.contains=" + UPDATED_CODE); } @Test @Transactional public void getAllAuthoritiesByCodeNotContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where code does not contain DEFAULT_CODE defaultAuthorityShouldNotBeFound("code.doesNotContain=" + DEFAULT_CODE); // Get all the authorityList where code does not contain UPDATED_CODE defaultAuthorityShouldBeFound("code.doesNotContain=" + UPDATED_CODE); } @Test @Transactional public void getAllAuthoritiesByInfoIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info equals to DEFAULT_INFO defaultAuthorityShouldBeFound("info.equals=" + DEFAULT_INFO); // Get all the authorityList where info equals to UPDATED_INFO defaultAuthorityShouldNotBeFound("info.equals=" + UPDATED_INFO); } @Test @Transactional public void getAllAuthoritiesByInfoIsNotEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info not equals to DEFAULT_INFO defaultAuthorityShouldNotBeFound("info.notEquals=" + DEFAULT_INFO); // Get all the authorityList where info not equals to UPDATED_INFO defaultAuthorityShouldBeFound("info.notEquals=" + UPDATED_INFO); } @Test @Transactional public void getAllAuthoritiesByInfoIsInShouldWork() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info in DEFAULT_INFO or UPDATED_INFO defaultAuthorityShouldBeFound("info.in=" + DEFAULT_INFO + "," + UPDATED_INFO); // Get all the authorityList where info equals to UPDATED_INFO defaultAuthorityShouldNotBeFound("info.in=" + UPDATED_INFO); } @Test @Transactional public void getAllAuthoritiesByInfoIsNullOrNotNull() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info is not null defaultAuthorityShouldBeFound("info.specified=true"); // Get all the authorityList where info is null defaultAuthorityShouldNotBeFound("info.specified=false"); } @Test @Transactional public void getAllAuthoritiesByInfoContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info contains DEFAULT_INFO defaultAuthorityShouldBeFound("info.contains=" + DEFAULT_INFO); // Get all the authorityList where info contains UPDATED_INFO defaultAuthorityShouldNotBeFound("info.contains=" + UPDATED_INFO); } @Test @Transactional public void getAllAuthoritiesByInfoNotContainsSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where info does not contain DEFAULT_INFO defaultAuthorityShouldNotBeFound("info.doesNotContain=" + DEFAULT_INFO); // Get all the authorityList where info does not contain UPDATED_INFO defaultAuthorityShouldBeFound("info.doesNotContain=" + UPDATED_INFO); } @Test @Transactional public void getAllAuthoritiesByOrderIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order equals to DEFAULT_ORDER defaultAuthorityShouldBeFound("order.equals=" + DEFAULT_ORDER); // Get all the authorityList where order equals to UPDATED_ORDER defaultAuthorityShouldNotBeFound("order.equals=" + UPDATED_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsNotEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order not equals to DEFAULT_ORDER defaultAuthorityShouldNotBeFound("order.notEquals=" + DEFAULT_ORDER); // Get all the authorityList where order not equals to UPDATED_ORDER defaultAuthorityShouldBeFound("order.notEquals=" + UPDATED_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsInShouldWork() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order in DEFAULT_ORDER or UPDATED_ORDER defaultAuthorityShouldBeFound("order.in=" + DEFAULT_ORDER + "," + UPDATED_ORDER); // Get all the authorityList where order equals to UPDATED_ORDER defaultAuthorityShouldNotBeFound("order.in=" + UPDATED_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsNullOrNotNull() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order is not null defaultAuthorityShouldBeFound("order.specified=true"); // Get all the authorityList where order is null defaultAuthorityShouldNotBeFound("order.specified=false"); } @Test @Transactional public void getAllAuthoritiesByOrderIsGreaterThanOrEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order is greater than or equal to DEFAULT_ORDER defaultAuthorityShouldBeFound("order.greaterThanOrEqual=" + DEFAULT_ORDER); // Get all the authorityList where order is greater than or equal to UPDATED_ORDER defaultAuthorityShouldNotBeFound("order.greaterThanOrEqual=" + UPDATED_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsLessThanOrEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order is less than or equal to DEFAULT_ORDER defaultAuthorityShouldBeFound("order.lessThanOrEqual=" + DEFAULT_ORDER); // Get all the authorityList where order is less than or equal to SMALLER_ORDER defaultAuthorityShouldNotBeFound("order.lessThanOrEqual=" + SMALLER_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsLessThanSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order is less than DEFAULT_ORDER defaultAuthorityShouldNotBeFound("order.lessThan=" + DEFAULT_ORDER); // Get all the authorityList where order is less than UPDATED_ORDER defaultAuthorityShouldBeFound("order.lessThan=" + UPDATED_ORDER); } @Test @Transactional public void getAllAuthoritiesByOrderIsGreaterThanSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where order is greater than DEFAULT_ORDER defaultAuthorityShouldNotBeFound("order.greaterThan=" + DEFAULT_ORDER); // Get all the authorityList where order is greater than SMALLER_ORDER defaultAuthorityShouldBeFound("order.greaterThan=" + SMALLER_ORDER); } @Test @Transactional public void getAllAuthoritiesByDisplayIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where display equals to DEFAULT_DISPLAY defaultAuthorityShouldBeFound("display.equals=" + DEFAULT_DISPLAY); // Get all the authorityList where display equals to UPDATED_DISPLAY defaultAuthorityShouldNotBeFound("display.equals=" + UPDATED_DISPLAY); } @Test @Transactional public void getAllAuthoritiesByDisplayIsNotEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where display not equals to DEFAULT_DISPLAY defaultAuthorityShouldNotBeFound("display.notEquals=" + DEFAULT_DISPLAY); // Get all the authorityList where display not equals to UPDATED_DISPLAY defaultAuthorityShouldBeFound("display.notEquals=" + UPDATED_DISPLAY); } @Test @Transactional public void getAllAuthoritiesByDisplayIsInShouldWork() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where display in DEFAULT_DISPLAY or UPDATED_DISPLAY defaultAuthorityShouldBeFound("display.in=" + DEFAULT_DISPLAY + "," + UPDATED_DISPLAY); // Get all the authorityList where display equals to UPDATED_DISPLAY defaultAuthorityShouldNotBeFound("display.in=" + UPDATED_DISPLAY); } @Test @Transactional public void getAllAuthoritiesByDisplayIsNullOrNotNull() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); // Get all the authorityList where display is not null defaultAuthorityShouldBeFound("display.specified=true"); // Get all the authorityList where display is null defaultAuthorityShouldNotBeFound("display.specified=false"); } @Test @Transactional public void getAllAuthoritiesByChildrenIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); Authority children = AuthorityResourceIT.createEntity(em); em.persist(children); em.flush(); authority.addChildren(children); authorityRepository.saveAndFlush(authority); Long childrenId = children.getId(); // Get all the authorityList where children equals to childrenId defaultAuthorityShouldBeFound("childrenId.equals=" + childrenId); // Get all the authorityList where children equals to childrenId + 1 defaultAuthorityShouldNotBeFound("childrenId.equals=" + (childrenId + 1)); } @Test @Transactional public void getAllAuthoritiesByUsersIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); User users = UserResourceIT.createEntity(em); em.persist(users); em.flush(); authority.addUsers(users); authorityRepository.saveAndFlush(authority); Long usersId = users.getId(); // Get all the authorityList where users equals to usersId defaultAuthorityShouldBeFound("usersId.equals=" + usersId); // Get all the authorityList where users equals to usersId + 1 defaultAuthorityShouldNotBeFound("usersId.equals=" + (usersId + 1)); } @Test @Transactional public void getAllAuthoritiesByViewPermissionIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); ViewPermission viewPermission = ViewPermissionResourceIT.createEntity(em); em.persist(viewPermission); em.flush(); authority.addViewPermission(viewPermission); authorityRepository.saveAndFlush(authority); Long viewPermissionId = viewPermission.getId(); // Get all the authorityList where viewPermission equals to viewPermissionId defaultAuthorityShouldBeFound("viewPermissionId.equals=" + viewPermissionId); // Get all the authorityList where viewPermission equals to viewPermissionId + 1 defaultAuthorityShouldNotBeFound("viewPermissionId.equals=" + (viewPermissionId + 1)); } @Test @Transactional public void getAllAuthoritiesByParentIsEqualToSomething() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); Authority parent = AuthorityResourceIT.createEntity(em); em.persist(parent); em.flush(); authority.setParent(parent); authorityRepository.saveAndFlush(authority); Long parentId = parent.getId(); // Get all the authorityList where parent equals to parentId defaultAuthorityShouldBeFound("parentId.equals=" + parentId); // Get all the authorityList where parent equals to parentId + 1 defaultAuthorityShouldNotBeFound("parentId.equals=" + (parentId + 1)); } /** * Executes the search, and checks that the default entity is returned. */ private void defaultAuthorityShouldBeFound(String filter) throws Exception { restAuthorityMockMvc.perform(get("/api/authorities?sort=id,desc&" + filter)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(authority.getId().intValue()))) .andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME))) .andExpect(jsonPath("$.[*].code").value(hasItem(DEFAULT_CODE))) .andExpect(jsonPath("$.[*].info").value(hasItem(DEFAULT_INFO))) .andExpect(jsonPath("$.[*].order").value(hasItem(DEFAULT_ORDER))) .andExpect(jsonPath("$.[*].display").value(hasItem(DEFAULT_DISPLAY.booleanValue()))); // Check, that the count call also returns 1 restAuthorityMockMvc.perform(get("/api/authorities/count?sort=id,desc&" + filter)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("1")); } /** * Executes the search, and checks that the default entity is not returned. */ private void defaultAuthorityShouldNotBeFound(String filter) throws Exception { restAuthorityMockMvc.perform(get("/api/authorities?sort=id,desc&" + filter)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$").isArray()) .andExpect(jsonPath("$").isEmpty()); // Check, that the count call also returns 0 restAuthorityMockMvc.perform(get("/api/authorities/count?sort=id,desc&" + filter)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("0")); } @Test @Transactional public void getNonExistingAuthority() throws Exception { // Get the authority restAuthorityMockMvc.perform(get("/api/authorities/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateAuthority() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); int databaseSizeBeforeUpdate = authorityRepository.findAll().size(); // Update the authority Authority updatedAuthority = authorityRepository.findById(authority.getId()).get(); // Disconnect from session so that the updates on updatedAuthority are not directly saved in db em.detach(updatedAuthority); updatedAuthority .name(UPDATED_NAME) .code(UPDATED_CODE) .info(UPDATED_INFO) .order(UPDATED_ORDER) .display(UPDATED_DISPLAY); AuthorityDTO authorityDTO = authorityMapper.toDto(updatedAuthority); restAuthorityMockMvc.perform(put("/api/authorities") .contentType(TestUtil.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(authorityDTO))) .andExpect(status().isOk()); // Validate the Authority in the database List<Authority> authorityList = authorityRepository.findAll(); assertThat(authorityList).hasSize(databaseSizeBeforeUpdate); Authority testAuthority = authorityList.get(authorityList.size() - 1); assertThat(testAuthority.getName()).isEqualTo(UPDATED_NAME); assertThat(testAuthority.getCode()).isEqualTo(UPDATED_CODE); assertThat(testAuthority.getInfo()).isEqualTo(UPDATED_INFO); assertThat(testAuthority.getOrder()).isEqualTo(UPDATED_ORDER); assertThat(testAuthority.isDisplay()).isEqualTo(UPDATED_DISPLAY); } @Test @Transactional public void updateNonExistingAuthority() throws Exception { int databaseSizeBeforeUpdate = authorityRepository.findAll().size(); // Create the Authority AuthorityDTO authorityDTO = authorityMapper.toDto(authority); // If the entity doesn't have an ID, it will throw BadRequestAlertException restAuthorityMockMvc.perform(put("/api/authorities") .contentType(TestUtil.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(authorityDTO))) .andExpect(status().isBadRequest()); // Validate the Authority in the database List<Authority> authorityList = authorityRepository.findAll(); assertThat(authorityList).hasSize(databaseSizeBeforeUpdate); } @Test @Transactional public void deleteAuthority() throws Exception { // Initialize the database authorityRepository.saveAndFlush(authority); int databaseSizeBeforeDelete = authorityRepository.findAll().size(); // Delete the authority restAuthorityMockMvc.perform(delete("/api/authorities/{id}", authority.getId()) .accept(TestUtil.APPLICATION_JSON)) .andExpect(status().isNoContent()); // Validate the database contains one less item List<Authority> authorityList = authorityRepository.findAll(); assertThat(authorityList).hasSize(databaseSizeBeforeDelete - 1); } }
[ "wangxinxx@163.com" ]
wangxinxx@163.com
55f90c3dbf340dd659864b987ad3a67d1d975f09
9289419e7980d2d668fad259cec88317f4696e54
/maven-confluence-core/src/main/java/org/bsc/confluence/ConfluenceServiceFactory.java
f2199e354aa48fb1ae8924abf60f5f75569ca203
[ "NTP", "RSA-MD", "LicenseRef-scancode-pcre", "Apache-2.0", "MIT", "LicenseRef-scancode-rsa-1990", "Beerware", "LicenseRef-scancode-other-permissive", "Spencer-94", "BSD-3-Clause", "LicenseRef-scancode-rsa-md4", "metamail", "HPND-sell-variant", "LicenseRef-scancode-zeusbench" ]
permissive
dmytro-sydorenko/maven-confluence-plugin
084cd5aec41e6ca91c48476be7e41045c6edbc25
79285dd8030766c7cbefd98df7f6159d2030d221
refs/heads/master
2020-08-07T20:03:48.397743
2019-10-01T09:43:29
2019-10-01T09:43:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,689
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 org.bsc.confluence; import static java.lang.String.format; import static org.bsc.confluence.xmlrpc.XMLRPCConfluenceServiceImpl.createInstanceDetectingVersion; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.json.JsonObjectBuilder; import org.bsc.confluence.ConfluenceService.Credentials; import org.bsc.confluence.rest.RESTConfluenceServiceImpl; import org.bsc.confluence.rest.model.Page; import org.bsc.confluence.xmlrpc.XMLRPCConfluenceServiceImpl; import org.bsc.ssl.SSLCertificateInfo; /** * * @author bsorrentino */ public class ConfluenceServiceFactory { private static class MixedConfluenceService implements ConfluenceService { final XMLRPCConfluenceServiceImpl xmlrpcService; final RESTConfluenceServiceImpl restService; public MixedConfluenceService(String endpoint, Credentials credentials, ConfluenceProxy proxyInfo, SSLCertificateInfo sslInfo) throws Exception { this.xmlrpcService = createInstanceDetectingVersion(endpoint, credentials, proxyInfo, sslInfo); final String restEndpoint = new StringBuilder() .append(ConfluenceService.Protocol.XMLRPC.removeFrom(endpoint)) .append(ConfluenceService.Protocol.REST.path()) .toString(); this.restService = new RESTConfluenceServiceImpl(restEndpoint, credentials, sslInfo); } @Override public Credentials getCredentials() { return xmlrpcService.getCredentials(); } @Override public Model.PageSummary findPageByTitle(String parentPageId, String title) throws Exception { return xmlrpcService.findPageByTitle(parentPageId, title); } @Override public CompletableFuture<Boolean> removePage(Model.Page parentPage, String title) { return xmlrpcService.removePage(parentPage, title); } @Override public CompletableFuture<Model.Page> createPage(Model.Page parentPage, String title) { return xmlrpcService.createPage(parentPage, title); } @Override public CompletableFuture<Model.Attachment> addAttachment(Model.Page page, Model.Attachment attachment, InputStream source) { return xmlrpcService.addAttachment(page, attachment, source); } @Override public CompletableFuture<Model.Page> storePage(Model.Page page) { return xmlrpcService.storePage(page); } @Override public CompletableFuture<Model.Page> storePage(Model.Page page, Storage content) { if( Storage.Representation.STORAGE == content.rapresentation ) { if( page.getId()==null ) { final JsonObjectBuilder inputData = restService.jsonForCreatingPage(page.getSpace(), Integer.valueOf(page.getParentId()), page.getTitle()); restService.jsonAddBody(inputData, content); return CompletableFuture.supplyAsync( () -> restService.createPage(inputData.build()).map(Page::new).get() ); } return restService.storePage(page, content); } return xmlrpcService.storePage(page, content); } @Override public boolean addLabelByName(String label, long id) throws Exception { return xmlrpcService.addLabelByName(label, id); } @Override public Model.Attachment createAttachment() { return xmlrpcService.createAttachment(); } @Override public CompletableFuture<Optional<Model.Attachment>> getAttachment(String pageId, String name, String version) { return xmlrpcService.getAttachment(pageId, name, version); } @Override public CompletableFuture<Optional<Model.Page>> getPage(String spaceKey, String pageTitle) { return xmlrpcService.getPage(spaceKey, pageTitle); } @Override public CompletableFuture<Optional<Model.Page>> getPage(String pageId) { return xmlrpcService.getPage(pageId); } @Override public String toString() { return xmlrpcService.toString(); } @Override public List<Model.PageSummary> getDescendents(String pageId) throws Exception { return xmlrpcService.getDescendents(pageId); } @Override public void removePage(String pageId) throws Exception { xmlrpcService.removePage(pageId); } @Override public void exportPage(String url, String spaceKey, String pageTitle, ExportFormat exfmt, File outputFile) throws Exception { xmlrpcService.exportPage(url, spaceKey, pageTitle, exfmt, outputFile); } /* (non-Javadoc) * @see java.io.Closeable#close() */ @Override public void close() throws IOException { xmlrpcService.logout(); } } /** * return XMLRPC based Confluence services * * @param endpoint * @param credentials * @param proxyInfo * @param sslInfo * @return XMLRPC based Confluence services * @throws Exception */ public static ConfluenceService createInstance( String endpoint, Credentials credentials, ConfluenceProxy proxyInfo, SSLCertificateInfo sslInfo) throws Exception { if( ConfluenceService.Protocol.XMLRPC.match(endpoint)) { return new MixedConfluenceService(endpoint, credentials, proxyInfo, sslInfo); } if( ConfluenceService.Protocol.REST.match(endpoint)) { return new RESTConfluenceServiceImpl(endpoint, credentials /*, proxyInfo*/, sslInfo); } throw new IllegalArgumentException( format("endpoint doesn't contain a valid API protocol\nIt must be '%s' or '%s'", ConfluenceService.Protocol.XMLRPC.path(), ConfluenceService.Protocol.REST.path()) ); } }
[ "bartolomeo.sorrentino@gmail.com" ]
bartolomeo.sorrentino@gmail.com
c24680efbc3f51f3c7d2a283f5da343744fb4596
7b9cb42995cd6d61560c8c0e67f3c7ef3cdeb3bc
/src/com/cody/service/sys/ItemService.java
dceba595c825a5f25cdd07c817c9593b5806ce88
[]
no_license
visket/xmsb
28fbe7ca490f32798ef6a209729821470d601399
17ec00e439f6a9c853ae091fa4c5891718c338f2
refs/heads/master
2021-01-18T04:44:20.741738
2017-03-08T13:58:32
2017-03-08T13:58:32
84,274,237
0
0
null
2017-03-08T13:58:32
2017-03-08T03:28:34
JavaScript
UTF-8
Java
false
false
1,291
java
package com.cody.service.sys; import java.util.List; import com.cody.common.utils.PageInfo; import com.cody.entity.sys.Item; public interface ItemService { /** * 删除 * * @param id * @return */ int deleteByPrimaryKey(String id); /** * 添加 * * @param record * @return */ int insert(Item record); /** * 添加 * * @param record * @return */ int insertSelective(Item record); /** * 查找 * * @param id * @return */ Item selectByPrimaryKey(String id); /** * 修改 * * @param record * @return */ int updateByPrimaryKeySelective(Item record); /** * 修改 * * @param record * @return */ int updateByPrimaryKey(Item record); /** * 分页 * * @param pageInfo */ void find(PageInfo pageInfo); /** * 通过父字典的 代号 找出所有的子字典项 * * @param dictionarycode * @return */ List<Item> findByDictionarycode(String dictionarycode); /** * 通过子字典的代号查询子字典对象 * * @param itemcode * @return */ Item findByCode(String itemcode); /** * 用来过滤查询 单位等级的 * * @return */ List<Item> findToGradetype(); /** * 批量删除 * * @param ids * @return */ int deleteByPrimaryKeys(String[] ids); }
[ "visket@2008.sina.com" ]
visket@2008.sina.com
cc4e949c2424db37affde6d1cb83e214b129420b
b5de44cfce82705858e71f95b51c85d955156c6f
/src/main/java/edu/stanford/crypto/cs251/miners/CompliantMiner.java
51700a1e7d6bdac7f7010150c1927c23ff23a769
[]
no_license
fordneild/mining-strats
924686c245e6e14e0646f0813af645f892c7f17f
494b4e9294b0adbb513bae3074414316de673536
refs/heads/main
2023-03-26T07:29:14.744533
2021-03-24T00:42:28
2021-03-24T00:42:28
348,377,043
0
0
null
2021-03-23T19:46:37
2021-03-16T14:24:24
Java
UTF-8
Java
false
false
1,250
java
package edu.stanford.crypto.cs251.miners; import edu.stanford.crypto.cs251.blockchain.Block; import edu.stanford.crypto.cs251.blockchain.NetworkStatistics; public class CompliantMiner extends BaseMiner implements Miner { private Block currentHead; public CompliantMiner(String id, int hashRate, int connectivity) { super(id, hashRate, connectivity); } @Override public Block currentlyMiningAt() { return currentHead; } @Override public Block currentHead() { return currentHead; } @Override public void blockMined(Block block, boolean isMinerMe) { if(isMinerMe) { if (block.getHeight() > currentHead.getHeight()) { this.currentHead = block; } } else{ if (currentHead == null) { currentHead = block; } else if (block != null && block.getHeight() > currentHead.getHeight()) { this.currentHead = block; } } } @Override public void initialize(Block genesis, NetworkStatistics networkStatistics) { this.currentHead = genesis; } @Override public void networkUpdate(NetworkStatistics statistics) { } }
[ "hanfordn35@gmail.com" ]
hanfordn35@gmail.com
46e9066ccb561876c4a7e3d480d4a3be2cf78ad0
dff2417b6d1281c5d287c888d58bbe7aea163e8c
/core/src/com/mygdx/game/GameOrganize/Controller.java
40244792a9c15d7cedfb5b8be8080b90ef715a4f
[]
no_license
913x100/Flyer
c8dd47fd7b8c9821e8fa75a13d63d3cc6d0c94f1
eaf7d1f5c0c183437bddffd03137e505f3afdc17
refs/heads/master
2021-08-30T12:47:58.092474
2017-12-18T01:52:04
2017-12-18T01:52:04
112,700,592
0
0
null
null
null
null
UTF-8
Java
false
false
1,246
java
package com.mygdx.game.GameOrganize; import com.badlogic.gdx.InputProcessor; import com.mygdx.game.GameObjects.Player; import com.mygdx.game.GameWorld.GameWorld; public class Controller implements InputProcessor { private Player player; private GameWorld world; public Controller(GameWorld world) { this.world = world; player = world.getPlayer(); } public boolean touchDown(int screenX, int screenY, int pointer, int button) { if (world.isReady()) { world.start(); } player.onTap(); if (world.isGameOver()) { world.restart(); } return true; } public boolean keyDown(int keycode) { return false; } public boolean keyUp(int keycode) { return false; } public boolean keyTyped(char character) { return false; } public boolean touchUp(int screenX, int screenY, int pointer, int button) { return false; } public boolean touchDragged(int screenX, int screenY, int pointer) { return false; } public boolean mouseMoved(int screenX, int screenY) { return false; } public boolean scrolled(int amount) { return false; } }
[ "kititnut.iam@gmail.com" ]
kititnut.iam@gmail.com
06ada0e2831785d3d0d023f55cba2bf44b6c1c27
285396012d8bc255da379de7d9a153b576480c1f
/app/src/main/java/com/hani/android/retrofitexample/adapter/RecyclerviewAdapter.java
2f62ad56b5c6ee9e80d5c6e2508c5711f8f24874
[]
no_license
Hani-Patel/Retrofitexample
16b1b5e84ddd3e41047f3d80e187b25b70e2986e
b5ead4a8685f345e06371a7a13e7d4b71342b3e8
refs/heads/master
2021-01-20T14:42:46.360435
2017-05-08T16:50:06
2017-05-08T16:50:06
90,651,421
0
0
null
null
null
null
UTF-8
Java
false
false
1,271
java
package com.hani.android.retrofitexample.adapter; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.hani.android.retrofitexample.R; import com.hani.android.retrofitexample.model.User; import com.hani.android.retrofitexample.viewholder.RecyclerViewholder; import java.util.List; /** * Created by SURBHI PATEL on 09-04-2017. */ public class RecyclerviewAdapter extends RecyclerView.Adapter<RecyclerViewholder> { private List<User> itemlist; public RecyclerviewAdapter(List<User> itemlist) { this.itemlist = itemlist; } @Override public RecyclerViewholder onCreateViewHolder(ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_row,null); RecyclerViewholder recyclerViewholder=new RecyclerViewholder(view); return recyclerViewholder; } @Override public void onBindViewHolder(RecyclerViewholder holder, int position) { holder.name.setText(itemlist.get(position).getName()); holder.hobby.setText(itemlist.get(position).getHobby()); } @Override public int getItemCount() { return itemlist.size(); } }
[ "Honey" ]
Honey
f03daaa72f2786f0c30bd70db5fd45b6ae75f32b
e3cdf168fd96b1512fdd57bfba6abfb81d76f162
/Jam.Guess/src/main/Jam/Guess/Jam/Guess/rmi/ClientManager.java
073ff918725c32b8f44ed664ffcfeb606c0abab0
[]
no_license
Heikum/Jam.Guess
59686a05cef6173bfc008647301ac31cfba0f8ea
3a0821eb0bb2e5d41c42681e69e6e053b955fb75
refs/heads/master
2021-09-04T04:38:48.038600
2018-01-15T23:00:33
2018-01-15T23:00:33
114,888,440
0
0
null
null
null
null
UTF-8
Java
false
false
3,771
java
package main.Jam.Guess.Jam.Guess.rmi; import main.Jam.Guess.IGUIController; import main.Jam.Guess.Jam.Guess.IGameManager; import main.Jam.Guess.Jam.Guess.User; import main.Jam.Guess.Jam.Guess.audioplayer.AudioPlayer ; import main.Jam.Guess.Jam.Guess.fontyspublisher.IRemotePropertyListener ; import main.Jam.Guess.Jam.Guess.fontyspublisher.IRemotePublisherForListener ; import main.Jam.Guess.Jam.Guess.log.Logger ; import uk.co.caprica.vlcj.component.AudioMediaPlayerComponent; import uk.co.caprica.vlcj.discovery.NativeDiscovery; import main.Jam.Guess.IPlayer; import java.beans.PropertyChangeEvent; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.logging.Level; public class ClientManager extends UnicastRemoteObject implements IRemotePropertyListener { private IRemotePublisherForListener publisher; private IGameManager server; private IGUIController guiController; private User registeredUser; private static IPlayer player; private static ExecutorService pool = Executors.newFixedThreadPool(3); private Logger logger; private static final String MSG_NOT_IN_PARTY = "You're not in a party"; private static final String MSG_NOT_LOGGED_IN = "You're not logged in"; private static final String MSG_ALREADY_LOGGED_IN = "You're already logged in"; public ClientManager(IRemotePublisherForListener publisher, IGameManager server) throws RemoteException { logger = new Logger("ClientManager", Level.ALL, Level.SEVERE); this.publisher = publisher; this.server = server; (new NativeDiscovery()).discover(); player = new AudioPlayer(pool, new AudioMediaPlayerComponent()); } @Override public synchronized void propertyChange(PropertyChangeEvent evt) throws RemoteException { // System.out.println(currentParty.getPartyMessage()); if (guiController != null){ guiController.update(); } } public void setGuiController(IGUIController controller){ guiController = controller; } public User login(String username, String password) throws RemoteException { if (getUser() != null) { //return MSG_ALREADY_LOGGED_IN; return null; } User user = server.login(username, password); if (user == null) { logger.log(Level.WARNING, String.format("%s tried to login", username)); //return "Incorrect username or password."; return null; } registeredUser = (User) user; logger.log(Level.INFO, String.format("%s logged in", user.getUsername())); return registeredUser; //return String.format("You logged in as: %s", user.getNickname()); } public String logout() throws RemoteException { if (getUser() == null) { return MSG_NOT_LOGGED_IN; } String partyKey = ""; User u = getUser(); server.logout(u); logger.log(Level.INFO, String.format("%s logged out", u.getUsername())); return "You logged out."; } public void resumePlaying(){ player.play(); } public void pause(){ player.pause(); } public void stop(){ player.stop(); } public String play() throws RemoteException { User user = getUser(); if (user == null) { return MSG_NOT_LOGGED_IN; } return "This action is not allowed."; } public User getUser() { if (registeredUser != null) { return registeredUser; } else return null; } }
[ "dhrlaaboudi@gmail.com" ]
dhrlaaboudi@gmail.com
329c917c74b992ba708184b68772837f8de19aa1
e5327b5c93e3fad9f3382724b7f4075648e90696
/app/src/main/java/com/lab4u/hannahchen/teacherlogin/ServiceGenerator.java
346d40740d28d75e58a96fb0cd21eff0c276c12c
[]
no_license
hannahmei15/login
1133aed9658ebb70c755ac09539d74fa1b45083e
e4e8b1710bf164afff764444e4d88526c699befc
refs/heads/master
2021-01-20T22:14:49.782884
2016-07-01T19:57:27
2016-07-01T19:57:27
61,892,274
0
0
null
null
null
null
UTF-8
Java
false
false
1,559
java
package com.lab4u.hannahchen.teacherlogin; import android.util.Base64; import com.squareup.okhttp.OkHttpClient; import retrofit.Callback; import retrofit.RequestInterceptor; import retrofit.RestAdapter; import retrofit.client.OkClient; /** * Created by hannahchen on 6/24/16. */ public class ServiceGenerator { public static final String API_BASE_URL = "http://10.0.1.18:9001"; private static RestAdapter.Builder builder = new RestAdapter.Builder() .setEndpoint(API_BASE_URL) .setLogLevel(RestAdapter.LogLevel.FULL) .setClient(new OkClient(new OkHttpClient())); public static <S> S createService(Class<S> serviceClass) { builder.setRequestInterceptor(new RequestInterceptor() { @Override public void intercept(RequestFacade request) { request.addHeader("X-ZUMO-APPLICATION", "XzqZNtYMEpTSljpfGytdLootHaOhvG73"); } }); RestAdapter adapter = builder.build(); return adapter.create(serviceClass); } public static <S> S createService(Class<S> serviceClass, final String authToken) { if (authToken != null) { builder.setRequestInterceptor(new RequestInterceptor() { @Override public void intercept(RequestFacade request) { request.addHeader("Authorization", authToken); } }); } RestAdapter adapter = builder.build(); return adapter.create(serviceClass); } }
[ "hannah@lab4u.co" ]
hannah@lab4u.co
f6adcc95f148c2dcde4370bac6004a4886166e94
a251d4d36b0e296866be8f0cc4d66d97dbdfdbec
/app/src/main/java/so/wih/android/jjewatch/ui/fragment/ContactFragment.java
68228a2211b3cf567ddaebe6beccf0985b19fdbb
[]
no_license
GoldenStrawberry/JJEWatch
f02b606c664fe49a77985ad48d5c16458a407139
bff87a71693984c85b17e4b0e26e993a89d14cd2
refs/heads/master
2021-01-20T00:53:19.647242
2017-04-24T06:40:29
2017-04-24T06:40:57
89,206,524
1
0
null
null
null
null
UTF-8
Java
false
false
1,281
java
package so.wih.android.jjewatch.ui.fragment; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import so.wih.android.jjewatch.R; import so.wih.android.jjewatch.ui.activity.ContactsActivity; /** * 联系人主界面 * Created by Administrator on 2016/11/22. */ public class ContactFragment extends Fragment { private View view; private ImageView contactImageView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.inflate(R.layout.contact_fragment, null); //初始化控件 initView(); return view; } /** * 初始化控件 */ private void initView() { contactImageView = (ImageView) view.findViewById(R.id.contact_image); contactImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), ContactsActivity.class); startActivity(intent); } }); } }
[ "huwei1213@foxmail.com" ]
huwei1213@foxmail.com
cdfae2beaa053fcd46852f3df9e262ff3a9acccb
56ef36eb19786046b42ea0ec78dc47d2c17df7d5
/EDD/practica4/src/mx/unam/ciencias/edd/ArbolBinario.java
fdca2c9dbde4bc84f1da6beeaa5a779b27e687dc
[]
no_license
acasanova009/UNAM
b05be40834615b03742b5fe5c5c99eb7df11e964
9e628aebe601098ecb8d786991f17685018f6bb5
refs/heads/master
2021-05-29T11:10:04.847601
2015-09-03T02:14:20
2015-09-03T02:14:20
41,837,786
1
0
null
null
null
null
UTF-8
Java
false
false
11,535
java
package mx.unam.ciencias.edd; import java.util.NoSuchElementException; import java.lang.Math; /** * <p>Clase abstracta para árboles binarios genéricos.</p> * * <p>La clase proporciona las operaciones básicas para árboles * binarios, pero deja la implementación de varios en manos de las * clases concretas.</p> */ public abstract class ArbolBinario<T> implements Iterable<T> { /** * Clase interna protegida para vértices. */ protected class Vertice<T> implements VerticeArbolBinario<T> { /** El elemento del vértice. */ public T elemento; /** El padre del vértice. */ public Vertice<T> padre; /** El izquierdo del vértice. */ public Vertice<T> izquierdo; /** El derecho del vértice. */ public Vertice<T> derecho; /** * Constructor único que recibe un elemento. * @param elemento el elemento del vértice. */ public Vertice(T elem) { //Aquí va su código. padre = izquierdo = derecho = null; this.elemento = elem; } /** * Regresa una representación en cadena del vértice. * @return una representación en cadena del vértice. */ public String toString() { // Aquí va su código. return elemento.toString(); } /** * Nos dice si el vértice tiene un padre. * @return <tt>true</tt> si el vértice tiene padre, * <tt>false</tt> en otro caso. */ @Override public boolean hayPadre() { // Aquí va su código. // Aquí va su código. boolean hayDichoElemento = false; if (padre != null) hayDichoElemento = true; return hayDichoElemento; } /** * Nos dice si el vértice tiene un izquierdo. * @return <tt>true</tt> si el vértice tiene izquierdo, * <tt>false</tt> en otro caso. */ @Override public boolean hayIzquierdo() { // Aquí va su código. // Aquí va su código. boolean hayDichoElemento = false; if (izquierdo!= null) hayDichoElemento = true; return hayDichoElemento; } /** * Nos dice si el vértice tiene un derecho. * @return <tt>true</tt> si el vértice tiene derecho, * <tt>false</tt> en otro caso. */ @Override public boolean hayDerecho() { // Aquí va su código. boolean hayDichoElemento = false; if (derecho != null) hayDichoElemento = true; return hayDichoElemento; } /** * Regresa el padre del vértice. * @return el padre del vértice. * @throws NoSuchElementException si el vértice no tiene padre. */ @Override public VerticeArbolBinario<T> getPadre() { // Aquí va su código. if (hayPadre()) return padre; else throw new NoSuchElementException("No hay padre"); } /** * Regresa el izquierdo del vértice. * @return el izquierdo del vértice. * @throws NoSuchElementException si el vértice no tiene izquierdo. */ @Override public VerticeArbolBinario<T> getIzquierdo() { if (hayIzquierdo()) return izquierdo; else throw new NoSuchElementException("No hay elemnto izquierdo"); // Aquí va su código. } /** * Regresa el derecho del vértice. * @return el derecho del vértice. * @throws NoSuchElementException si el vértice no tiene derecho. */ @Override public VerticeArbolBinario<T> getDerecho() { if (hayDerecho()) return derecho; else throw new NoSuchElementException("No hay elemnto derecho"); // Aquí va su código. } /** * Regresa el elemento al que apunta el vértice. * @return el elemento al que apunta el vértice. */ @Override public T get() { return elemento; // Aquí va su código. } } /** La raíz del árbol. */ protected Vertice<T> raiz; /** El número de elementos */ protected int elementos; /** * Construye un árbol con cero elementos. */ public ArbolBinario() { // Aquí va su código. raiz = null; elementos = 0; } /** * Regresa la profundidad del árbol. La profundidad de un árbol * es la longitud de la ruta más larga entre la raíz y una hoja. * @return la profundidad del árbol. */ public int profundidad() { return profundidad(raiz); } private int profundidad(Vertice<T> ver ) { if (ver == null || (!ver.hayIzquierdo() && !ver.hayDerecho())) return 0; return (1 + Math.max(profundidad(ver.izquierdo), profundidad(ver.derecho))); } /** * Regresa el número de elementos en el árbol. El número de * elementos es el número de elementos que se han agregado al * árbol. * @return el número de elementos en el árbol. */ public int getElementos() { return getElementos(raiz); } private int getElementos(Vertice<T> ver) { if (ver == null) return 0; else return (1 + getElementos(ver.izquierdo) + getElementos(ver.derecho)); } /** * Agrega un elemento al árbol. * @param elemento el elemento a agregar al árbol. * @return el vértice agregado al árbol que contiene el * elemento. */ public abstract VerticeArbolBinario<T> agrega(T elemento); /** * Elimina un elemento del árbol. * @param elemento el elemento a eliminar. */ public abstract void elimina(T elemento); /** * Busca un elemento en el árbol. Si lo encuentra, regresa el * vértice que lo contiene; si no, regresa <tt>null</tt>. * @param elemento el elemento a buscar. * @return un vértice que contiene el elemento buscado si lo * encuentra; <tt>null</tt> en otro caso. */ public VerticeArbolBinario<T> busca(T elemento) { // return null; return busquedaDFS(raiz, elemento); } private VerticeArbolBinario<T> busquedaDFS(Vertice<T> v, T e) { VerticeArbolBinario<T> verticeEncontrado = null; if (v != null) if (v.elemento.equals(e)) verticeEncontrado = v; else { verticeEncontrado = busquedaDFS(v.izquierdo, e); if (verticeEncontrado == null) verticeEncontrado = busquedaDFS(v.derecho, e); } return verticeEncontrado; } /** * Regresa el vértice que contiene la raíz del árbol. * @return el vértice que contiene la raíz del árbol. * @throws NoSuchElementException si el árbol es vacío. */ public VerticeArbolBinario<T> raiz() { return raiz; // Aquí va su código. } /** * Regresa una representación en cadena del árbol. * @return una representación en cadena del árbol. */ @Override public String toString() { /* Necesitamos la profundidad para saber cuántas ramas puede haber. */ if (elementos == 0) return ""; int p = profundidad() + 1; /* true == dibuja rama, false == dibuja espacio. */ boolean[] rama = new boolean[p]; for (int i = 0; i < p; i++) /* Al inicio, no dibujamos ninguna rama. */ rama[i] = false; String s = aCadena(raiz, 0, rama); return s.substring(0, s.length()-1); } /* Método auxiliar recursivo que hace todo el trabajo. */ private String aCadena(Vertice<T> vertice, int nivel, boolean[] rama) { /* Primero que nada agregamos el vertice a la cadena. */ String s = vertice + "\n"; /* A partir de aquí, dibujamos rama en este nivel. */ rama[nivel] = true; if (vertice.izquierdo != null && vertice.derecho != null) { /* Si hay vertice izquierdo Y derecho, dibujamos ramas o * espacios. */ s += espacios(nivel, rama); /* Dibujamos el conector al hijo izquierdo. */ s += "├─›"; /* Recursivamente dibujamos el hijo izquierdo y sus descendientes. */ s += aCadena(vertice.izquierdo, nivel+1, rama); /* Dibujamos ramas o espacios. */ s += espacios(nivel, rama); /* Dibujamos el conector al hijo derecho. */ s += "└─»"; /* Como ya dibujamos el último hijo, ya no hay rama en este nivel. */ rama[nivel] = false; /* Recursivamente dibujamos el hijo derecho y sus descendientes. */ s += aCadena(vertice.derecho, nivel+1, rama); } else if (vertice.izquierdo != null) { /* Dibujamos ramas o espacios. */ s += espacios(nivel, rama); /* Dibujamos el conector al hijo izquierdo. */ s += "└─›"; /* Como ya dibujamos el último hijo, ya no hay rama en este nivel. */ rama[nivel] = false; /* Recursivamente dibujamos el hijo izquierdo y sus descendientes. */ s += aCadena(vertice.izquierdo, nivel+1, rama); } else if (vertice.derecho != null) { /* Dibujamos ramas o espacios. */ s += espacios(nivel, rama); /* Dibujamos el conector al hijo derecho. */ s += "└─»"; /* Como ya dibujamos el último hijo, ya no hay rama en este nivel. */ rama[nivel] = false; /* Recursivamente dibujamos el hijo derecho y sus descendientes. */ s += aCadena(vertice.derecho, nivel+1, rama); } return s; } /* Dibuja los espacios (incluidas las ramas, de ser necesarias) que van antes de un vértice. */ private String espacios(int n, boolean[] rama) { String s = ""; for (int i = 0; i < n; i++) if (rama[i]) /* Rama: dibújala. */ s += "│ "; else /* No rama: dibuja espacio. */ s += " "; return s; } /** * Convierte el vértice (visto como instancia de {@link * VerticeArbolBinario}) en vértice (visto como instancia de * {@link Vertice}). Método auxililar para hacer esta audición * en un único lugar. * @param verticeArbolBinario el vértice de árbol binario que queremos * como vértice. * @return el vértice recibido visto como vértice. * @throws ClassCastException si el vértice no es instancia de * {@link Vertice}. */ protected Vertice<T> vertice(VerticeArbolBinario<T> verticeArbolBinario) { /* Tenemos que suprimir advertencias. */ @SuppressWarnings("unchecked") Vertice<T> n = (Vertice<T>)verticeArbolBinario; return n; } }
[ "al.chevere@icloud.com" ]
al.chevere@icloud.com
0ad7337ed80647391080208b1b32e6d121c420f4
e2c9c5041db56f6ca85733da44e6f82bb3696da5
/src/broadreach/Clinician/ViewPatientMedHistory.java
e2af0342ff495226ffa4bc5c49ef259c9ffb38c5
[]
no_license
GullianvdWalt/BroadReach
32ad1c13ad1fe93a1016253691da9a85e2540d8e
b28f529cc210559e0f822aa5a6d438c5418c9889
refs/heads/master
2023-01-10T12:34:06.612700
2020-11-10T10:14:11
2020-11-10T10:14:11
264,821,970
0
0
null
null
null
null
UTF-8
Java
false
false
19,998
java
/** * * @author Gullian Van Der Walt * H5G8YT7X3 * ITDA301 - Project 2020 * Pearson Pretoria * BSC IT Level 3 * * * * This Is The Patient Medical History View * * */ package broadreach.Clinician; public class ViewPatientMedHistory extends javax.swing.JFrame { /** * Creates new form ViewPatientMedHistory */ public ViewPatientMedHistory() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { patientMedHistPanel = new javax.swing.JPanel(); headPanel1 = new javax.swing.JPanel(); headSubPanel2 = new javax.swing.JPanel(); homeBtnDiagnosis1 = new javax.swing.JButton(); headSubPanel3 = new javax.swing.JPanel(); medHistoryIcon = new javax.swing.JLabel(); patientMedHistoryLbl = new javax.swing.JLabel(); subheadingLbl = new javax.swing.JLabel(); headSubPanel4 = new javax.swing.JPanel(); exitBtn = new javax.swing.JButton(); bodyPanel = new javax.swing.JPanel(); subBodyPanel = new javax.swing.JPanel(); filterPanel = new javax.swing.JPanel(); filterIcon = new javax.swing.JLabel(); pNameLbl = new javax.swing.JLabel(); pNameTxtFld = new javax.swing.JTextField(); pSurnameLbl = new javax.swing.JLabel(); pSurnameTxtFld = new javax.swing.JTextField(); saIDLbl = new javax.swing.JLabel(); saIDTxtFld = new javax.swing.JTextField(); pastTestDBPane = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); patientMedHistTbl = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BroadReach - Patient Medical History"); setName("patientMedHistoryFrame"); // NOI18N patientMedHistPanel.setBackground(new java.awt.Color(255, 255, 255)); patientMedHistPanel.setMaximumSize(new java.awt.Dimension(1920, 1080)); patientMedHistPanel.setMinimumSize(new java.awt.Dimension(1920, 1080)); patientMedHistPanel.setPreferredSize(new java.awt.Dimension(1920, 1080)); headPanel1.setBackground(new java.awt.Color(0, 46, 93)); headPanel1.setMaximumSize(new java.awt.Dimension(1920, 227)); headPanel1.setMinimumSize(new java.awt.Dimension(1440, 227)); headPanel1.setPreferredSize(new java.awt.Dimension(1920, 225)); headPanel1.setLayout(new java.awt.GridLayout(1, 1)); headSubPanel2.setBackground(new java.awt.Color(0, 46, 93)); headSubPanel2.setPreferredSize(new java.awt.Dimension(640, 227)); homeBtnDiagnosis1.setBackground(new java.awt.Color(0, 46, 93)); homeBtnDiagnosis1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/home.png"))); // NOI18N homeBtnDiagnosis1.setBorderPainted(false); homeBtnDiagnosis1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); homeBtnDiagnosis1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { homeBtnDiagnosis1ActionPerformed(evt); } }); javax.swing.GroupLayout headSubPanel2Layout = new javax.swing.GroupLayout(headSubPanel2); headSubPanel2.setLayout(headSubPanel2Layout); headSubPanel2Layout.setHorizontalGroup( headSubPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(headSubPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(homeBtnDiagnosis1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(524, Short.MAX_VALUE)) ); headSubPanel2Layout.setVerticalGroup( headSubPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headSubPanel2Layout.createSequentialGroup() .addContainerGap(109, Short.MAX_VALUE) .addComponent(homeBtnDiagnosis1) .addContainerGap()) ); headPanel1.add(headSubPanel2); headSubPanel3.setBackground(new java.awt.Color(0, 46, 93)); headSubPanel3.setPreferredSize(new java.awt.Dimension(640, 227)); medHistoryIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/clinic_Logo.png"))); // NOI18N patientMedHistoryLbl.setFont(new java.awt.Font("Constantia", 1, 36)); // NOI18N patientMedHistoryLbl.setForeground(new java.awt.Color(255, 255, 255)); patientMedHistoryLbl.setText("Patient Medical History"); patientMedHistoryLbl.setToolTipText(""); patientMedHistoryLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP); subheadingLbl.setFont(new java.awt.Font("Constantia", 1, 36)); // NOI18N subheadingLbl.setForeground(new java.awt.Color(255, 255, 255)); subheadingLbl.setText("BroadReach Clinic"); subheadingLbl.setToolTipText(""); subheadingLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP); javax.swing.GroupLayout headSubPanel3Layout = new javax.swing.GroupLayout(headSubPanel3); headSubPanel3.setLayout(headSubPanel3Layout); headSubPanel3Layout.setHorizontalGroup( headSubPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(headSubPanel3Layout.createSequentialGroup() .addContainerGap(66, Short.MAX_VALUE) .addComponent(medHistoryIcon) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(headSubPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(patientMedHistoryLbl) .addComponent(subheadingLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(67, 67, 67)) ); headSubPanel3Layout.setVerticalGroup( headSubPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(headSubPanel3Layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(subheadingLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE) .addGroup(headSubPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headSubPanel3Layout.createSequentialGroup() .addComponent(medHistoryIcon) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headSubPanel3Layout.createSequentialGroup() .addComponent(patientMedHistoryLbl) .addGap(27, 27, 27)))) ); headPanel1.add(headSubPanel3); headSubPanel4.setBackground(new java.awt.Color(0, 46, 93)); headSubPanel4.setPreferredSize(new java.awt.Dimension(640, 227)); exitBtn.setBackground(new java.awt.Color(0, 46, 93)); exitBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit_icon.png"))); // NOI18N exitBtn.setToolTipText("Exit BroadReach"); exitBtn.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); exitBtn.setBorderPainted(false); exitBtn.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); exitBtn.setDefaultCapable(false); exitBtn.setPreferredSize(new java.awt.Dimension(97, 97)); exitBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitBtnActionPerformed(evt); } }); javax.swing.GroupLayout headSubPanel4Layout = new javax.swing.GroupLayout(headSubPanel4); headSubPanel4.setLayout(headSubPanel4Layout); headSubPanel4Layout.setHorizontalGroup( headSubPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headSubPanel4Layout.createSequentialGroup() .addContainerGap(533, Short.MAX_VALUE) .addComponent(exitBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); headSubPanel4Layout.setVerticalGroup( headSubPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headSubPanel4Layout.createSequentialGroup() .addContainerGap(117, Short.MAX_VALUE) .addComponent(exitBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); headPanel1.add(headSubPanel4); patientMedHistPanel.add(headPanel1); bodyPanel.setBackground(new java.awt.Color(255, 255, 255)); bodyPanel.setForeground(new java.awt.Color(0, 46, 93)); bodyPanel.setMinimumSize(new java.awt.Dimension(1920, 853)); bodyPanel.setPreferredSize(new java.awt.Dimension(1920, 853)); subBodyPanel.setBackground(new java.awt.Color(255, 255, 255)); subBodyPanel.setMinimumSize(new java.awt.Dimension(900, 853)); subBodyPanel.setPreferredSize(new java.awt.Dimension(1650, 750)); filterPanel.setBackground(new java.awt.Color(255, 255, 255)); filterPanel.setPreferredSize(new java.awt.Dimension(1625, 160)); java.awt.FlowLayout flowLayout1 = new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 20, 5); flowLayout1.setAlignOnBaseline(true); filterPanel.setLayout(flowLayout1); filterIcon.setFont(new java.awt.Font("Constantia", 0, 24)); // NOI18N filterIcon.setForeground(new java.awt.Color(0, 46, 93)); filterIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/filter.png"))); // NOI18N filterPanel.add(filterIcon); pNameLbl.setFont(new java.awt.Font("Constantia", 0, 24)); // NOI18N pNameLbl.setForeground(new java.awt.Color(0, 46, 93)); pNameLbl.setText("Patient Name:"); filterPanel.add(pNameLbl); pNameTxtFld.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N pNameTxtFld.setToolTipText(""); pNameTxtFld.setActionCommand("<Not Set>"); pNameTxtFld.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 46, 93), 2, true)); pNameTxtFld.setPreferredSize(new java.awt.Dimension(232, 45)); pNameTxtFld.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pNameTxtFldActionPerformed(evt); } }); filterPanel.add(pNameTxtFld); pSurnameLbl.setFont(new java.awt.Font("Constantia", 0, 24)); // NOI18N pSurnameLbl.setForeground(new java.awt.Color(0, 46, 93)); pSurnameLbl.setText("Patient Surname:"); filterPanel.add(pSurnameLbl); pSurnameTxtFld.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N pSurnameTxtFld.setToolTipText(""); pSurnameTxtFld.setActionCommand("<Not Set>"); pSurnameTxtFld.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 46, 93), 2, true)); pSurnameTxtFld.setPreferredSize(new java.awt.Dimension(232, 45)); pSurnameTxtFld.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pSurnameTxtFldActionPerformed(evt); } }); filterPanel.add(pSurnameTxtFld); saIDLbl.setFont(new java.awt.Font("Constantia", 0, 24)); // NOI18N saIDLbl.setForeground(new java.awt.Color(0, 46, 93)); saIDLbl.setText("SA ID:"); filterPanel.add(saIDLbl); saIDTxtFld.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N saIDTxtFld.setToolTipText(""); saIDTxtFld.setActionCommand("<Not Set>"); saIDTxtFld.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 46, 93), 2, true)); saIDTxtFld.setPreferredSize(new java.awt.Dimension(232, 45)); saIDTxtFld.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saIDTxtFldActionPerformed(evt); } }); filterPanel.add(saIDTxtFld); subBodyPanel.add(filterPanel); pastTestDBPane.setBackground(new java.awt.Color(255, 255, 255)); pastTestDBPane.setPreferredSize(new java.awt.Dimension(1625, 570)); patientMedHistTbl.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6", "Title 7", "Title 8", "Title 9", "Title 10", "Title 11", "Title 12" } )); jScrollPane1.setViewportView(patientMedHistTbl); javax.swing.GroupLayout pastTestDBPaneLayout = new javax.swing.GroupLayout(pastTestDBPane); pastTestDBPane.setLayout(pastTestDBPaneLayout); pastTestDBPaneLayout.setHorizontalGroup( pastTestDBPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pastTestDBPaneLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1605, Short.MAX_VALUE) .addContainerGap()) ); pastTestDBPaneLayout.setVerticalGroup( pastTestDBPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pastTestDBPaneLayout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE) .addContainerGap()) ); subBodyPanel.add(pastTestDBPane); bodyPanel.add(subBodyPanel); patientMedHistPanel.add(bodyPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(patientMedHistPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(patientMedHistPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 1028, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents //Home Button private void homeBtnDiagnosis1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeBtnDiagnosis1ActionPerformed new ClinicianHome().setVisible(true); this.setVisible(false); }//GEN-LAST:event_homeBtnDiagnosis1ActionPerformed //Exit Button private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitBtnActionPerformed System.exit(0); }//GEN-LAST:event_exitBtnActionPerformed private void pNameTxtFldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pNameTxtFldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_pNameTxtFldActionPerformed private void pSurnameTxtFldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pSurnameTxtFldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_pSurnameTxtFldActionPerformed private void saIDTxtFldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saIDTxtFldActionPerformed // TODO add your handling code here: }//GEN-LAST:event_saIDTxtFldActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(ViewPatientMedHistory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(ViewPatientMedHistory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(ViewPatientMedHistory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(ViewPatientMedHistory.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ViewPatientMedHistory().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel bodyPanel; private javax.swing.JButton exitBtn; private javax.swing.JLabel filterIcon; private javax.swing.JPanel filterPanel; private javax.swing.JPanel headPanel1; private javax.swing.JPanel headSubPanel2; private javax.swing.JPanel headSubPanel3; private javax.swing.JPanel headSubPanel4; private javax.swing.JButton homeBtnDiagnosis1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel medHistoryIcon; private javax.swing.JLabel pNameLbl; private javax.swing.JTextField pNameTxtFld; private javax.swing.JLabel pSurnameLbl; private javax.swing.JTextField pSurnameTxtFld; private javax.swing.JPanel pastTestDBPane; private javax.swing.JPanel patientMedHistPanel; private javax.swing.JTable patientMedHistTbl; private javax.swing.JLabel patientMedHistoryLbl; private javax.swing.JLabel saIDLbl; private javax.swing.JTextField saIDTxtFld; private javax.swing.JPanel subBodyPanel; private javax.swing.JLabel subheadingLbl; // End of variables declaration//GEN-END:variables }
[ "51962834+GullianvdWalt@users.noreply.github.com" ]
51962834+GullianvdWalt@users.noreply.github.com
107bfb78abb4ef90a07ae6c4ce43d9d4c6f429e7
49104ac40fc4b9839a076a28462e6130b3de00c3
/src/main/java/pages/ElementsPage.java
c6bd60f8c2f69eb56163e1c826eb12efe5d963f3
[]
no_license
sholm73/demoqa
b6195bf50f61d290031fe06d67f2d79e7c39ec03
9cafeed28e1d8072bb9c1f111e429534b1eb9cbd
refs/heads/master
2023-07-18T04:51:38.195980
2021-09-06T22:07:12
2021-09-06T22:07:12
401,426,697
0
0
null
2021-09-06T22:07:13
2021-08-30T17:18:03
Java
UTF-8
Java
false
false
655
java
package pages; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class ElementsPage extends ParentPage{ public ElementsPage(WebDriver webDriver) { super(webDriver); } public ElementsPage openElementsPage(){ try { webDriver.get(baseURL); webDriver.findElement(By.xpath(".//*/h5[text()='Elements']")).click(); logger.info("Elements Page was opened"); } catch (Exception e){ logger.error("Can`t work with Elements Page"); Assert.fail("Can`t work with Elements Page"); } return this; } }
[ "sholm73@gmail.com" ]
sholm73@gmail.com
e2e568bad75f3a06729b6a96ed55c64519a5f05c
faec30ec90321902f33049ba0c5441daaebed387
/ManyToMany/src/main/java/com/manytomany/JoinedEntity/unidirectional/compositeprimary/Entity/USCBookPublisher.java
9193848877995ef9241d84098e09887ec4e77cf8
[]
no_license
chiraglucky/jpa-hibernate
cc94b5936d3496ce3f4f6f24829860cbcdcfca9f
1750c7e54b9a6adf7f986b4bb789b15baf05f3df
refs/heads/main
2023-07-13T16:10:23.386621
2021-08-24T14:06:09
2021-08-24T14:06:09
399,360,914
0
0
null
null
null
null
UTF-8
Java
false
false
1,003
java
package com.manytomany.JoinedEntity.unidirectional.compositeprimary.Entity; import lombok.*; import javax.persistence.*; import java.util.Date; //create bookpublisher as JoinedEntity with Composite primary key as BSCBookPublisherId @Data @AllArgsConstructor @NoArgsConstructor @Getter @Setter @Entity public class USCBookPublisher { @EmbeddedId private USCBookPublisherId id; private Date publisherDate; @ManyToOne(cascade = CascadeType.ALL) @MapsId("uscBookId") @JoinColumn(name = "book_id") private USCBook USCBook; @ManyToOne(cascade = CascadeType.ALL) @MapsId("uscPublisherId") @JoinColumn(name = "publisher_id") private USCPublisher USCPublisher; public USCBookPublisher(Date publisherDate, USCBook USCBook, USCPublisher USCPublisher) { this.id=new USCBookPublisherId(USCBook.getId(), USCPublisher.getId()); this.publisherDate = publisherDate; this.USCBook = USCBook; this.USCPublisher = USCPublisher; } }
[ "chiragdale0@gmail.com" ]
chiragdale0@gmail.com
8437baaae762c098c8c4b5a8650616c8f58669e1
092d184b84865e942ed0d00779faa1deca0252e8
/app/src/main/java/com/example/chatapp/FriendsActivity.java
d34adce7356535f4a218a8441d89fc4bf94c7337
[]
no_license
KaranParwani1116/ChatApp
9f23c8eb43721e8135353b586f9a73be60a18216
df0e05a6e817817798a572bb6b400652e7524073
refs/heads/master
2020-07-16T03:54:17.295125
2019-12-30T14:58:31
2019-12-30T14:58:31
205,713,007
0
1
null
null
null
null
UTF-8
Java
false
false
3,791
java
package com.example.chatapp; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.widget.Toolbar; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.firebase.ui.database.FirebaseRecyclerOptions; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.squareup.picasso.Picasso; import de.hdodenhof.circleimageview.CircleImageView; public class FriendsActivity extends AppCompatActivity { private RecyclerView recyclerView; private DatabaseReference usersref; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_friends); recyclerView=(RecyclerView)findViewById(R.id.find_friends_recyclerlist); recyclerView.setLayoutManager(new LinearLayoutManager(this)); usersref= FirebaseDatabase.getInstance().getReference().child("User"); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setTitle("Find Friends"); } @Override protected void onStart() { super.onStart(); FirebaseRecyclerOptions<Contacts> options= new FirebaseRecyclerOptions.Builder<Contacts>() .setQuery(usersref,Contacts.class) .build(); FirebaseRecyclerAdapter<Contacts,FindFriendViewHolder>adapter=new FirebaseRecyclerAdapter<Contacts, FindFriendViewHolder>(options) { @Override protected void onBindViewHolder(@NonNull FindFriendViewHolder findFriendViewHolder, final int i, @NonNull Contacts contacts) { findFriendViewHolder.username.setText(contacts.getName()); findFriendViewHolder.userstatus.setText(contacts.getStatus()); Picasso.get().load(contacts.getImage()).placeholder(R.drawable.profile_image).fit().into(findFriendViewHolder.userprofilephoto); findFriendViewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String visit_user_id=getRef(i).getKey(); Intent intent=new Intent(FriendsActivity.this,ProfileActivity.class); intent.putExtra("visit_user_id",visit_user_id); startActivity(intent); } }); } @NonNull @Override public FindFriendViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.users_view,parent,false); FindFriendViewHolder viewHolder=new FindFriendViewHolder(view); return viewHolder; } }; recyclerView.setAdapter(adapter); adapter.startListening(); } public static class FindFriendViewHolder extends RecyclerView.ViewHolder{ TextView username,userstatus; CircleImageView userprofilephoto; public FindFriendViewHolder(@NonNull View itemView) { super(itemView); username=(itemView).findViewById(R.id.user_name); userstatus=(itemView).findViewById(R.id.user_status); userprofilephoto=(itemView).findViewById(R.id.users_profile_image); } } }
[ "karanparwani.parwani102@gmail.com" ]
karanparwani.parwani102@gmail.com
c6bd60ca6d3af197a335ddf913adb93dc73dd29c
9af7ff6b77b9e1aac67d7cf9f49b695511d94310
/MultiProcessSysWebService_Thread_Online_1.3/src/ServiceInterface/ServiceImpl.java
2d697466ac035b78ce725308d15a4315ae6d55dc
[]
no_license
zjmeixinyanzhi/MultipleDatacenterCollaborativeProcessSystem
bc5e30d27d23b0d1455207eddf90b63f1b2c9939
36e28e145eff16d9f7c80c5c5af684aac4f5370a
refs/heads/master
2021-01-09T21:55:31.022679
2017-04-05T14:00:26
2017-04-05T14:00:26
54,820,368
0
0
null
null
null
null
UTF-8
Java
false
false
1,719
java
/** * ServiceImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package ServiceInterface; public interface ServiceImpl extends java.rmi.Remote { public java.lang.String orderRSDataPlan(java.lang.String strRequesXML) throws java.rmi.RemoteException; public java.lang.String systemMonitorInfo(java.lang.String strRequesIP) throws java.rmi.RemoteException; public java.lang.String commonProductRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String rnDataService(java.lang.String strRequestXML, java.lang.String serviceType) throws java.rmi.RemoteException; public java.lang.String validationOrderSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String dataProductSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String commonProductOrderSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String faProducRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String dataProductQuery(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String faProductRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String dataProductViewDetail(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String dataPrdouctQuery(java.lang.String strRequestXML) throws java.rmi.RemoteException; public java.lang.String taskStatus(java.lang.String strRequestXML) throws java.rmi.RemoteException; }
[ "zhangjiewanwansui@gmail.com" ]
zhangjiewanwansui@gmail.com
9aa5e96e8810c75174146da47e6e9b7edb5244d6
764cd47e9a2ce2c02835a18481cffb0ed5f905db
/server/src/main/java/server/service/FollowerServiceImpl.java
00d0a44226b8b10d0a75f9e18d8e43a4909d8bd5
[]
no_license
MortalMachine/Tweeter
4c14c319f2ea4fdc97eab0142a9b3e59dab61893
610692b35b1a8c4836d5238b491c094354372ea3
refs/heads/master
2022-04-22T05:31:59.161019
2020-04-16T22:18:28
2020-04-16T22:18:28
256,341,048
0
0
null
null
null
null
UTF-8
Java
false
false
1,946
java
package server.service; import java.util.ArrayList; import java.util.List; import server.dto.FollowsDTO; import model.domain.User; import model.service.FollowerService; import request.FollowersRequest; import response.FollowersResponse; import server.dao.follows.FollowsDynamoDAO; import server.dao.follows.IFollowsDAO; import server.dao.user.IUserDAO; import server.dao.user.UserDynamoDAO; import server.dto.UserDTO; import server.s3.S3AO; public class FollowerServiceImpl implements FollowerService { @Override public FollowersResponse getFollowers(FollowersRequest request) { IFollowsDAO followsDAO = new FollowsDynamoDAO(); IUserDAO userDAO = new UserDynamoDAO(); S3AO s3AO = new S3AO(); User followee = request.getFollowee(); /* Query user's followers from follows table */ try { FollowsDTO followsDTO = followsDAO.getFollowers(followee.getAlias(), request.getLastFollower()); List<User> followers = followsDTO.getUsers(); /* Fill list of followers for page */ for (User follower : followers) { UserDTO userDTO = userDAO.getUserItem(follower.getAlias(), follower.getFirstName()); User followerFromUserTable = userDTO.getUser(); String imageUrl = s3AO.getProfilePicFromS3(followerFromUserTable.getImageUrl()); /* follower has a null lastname and imageurl needs to change the s3 file path to a client-friendly url */ follower.setLastName(followerFromUserTable.getLastName()); follower.setImageUrl(imageUrl); } System.out.println("Sending followers response"); return new FollowersResponse(followers, followsDTO.hasMorePages()); } catch (Exception e) { System.err.println(e.getMessage()); return new FollowersResponse(e.getMessage()); } } }
[ "jordanrjenkins@outlook.com" ]
jordanrjenkins@outlook.com
b71274cb925a02638507f0769d42357ef9ec7264
52b967c6ae1ec8e40d395de03b7a493a3351a4fc
/lee338_CountBits_medium.java
d5d65280556d65987c4ac038e02be21ae05a6de3
[]
no_license
abcdddxy/LeetCode
bec0c1dfbee11937d18e8f62a7eb3ce1a73ec500
b9c1f7282fdd6976df40308eb0df35fbca501f72
refs/heads/master
2020-03-28T07:18:56.727578
2019-03-29T08:33:22
2019-03-29T08:33:22
147,455,214
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
public class lee338_CountBits_medium { //暴力搜索 public int[] countBits(int num) { int[] res = new int[num + 1]; for (int i = 1; i <= num; i++) { res[i] = numOfOne(i); } return res; } private int numOfOne(int num) { int res = 0; while (num >= 1) { if (num % 2 == 1) res += 1; num /= 2; } return res; } //dp public int[] countBits2(int num) { int[] res = new int[num + 1]; int idx = 1; for (int i = 0; i <= num; i++) { if(i == idx * 2) idx *= 2; res[i] = res[i - idx] + 1; } return res; } }
[ "kfc00m@126.com" ]
kfc00m@126.com
08a7719598f92d96749efd28c090fe939ccd251e
9fb02ba460aaad7040a792f79825e5b89b4451d3
/app/src/test/java/com/lifeistech/android/myapplication/ExampleUnitTest.java
a1cae6d650442de7fc8d8713d61aa4b2dd63d25a
[]
no_license
TsukasaMaruyama/app426
0ef95d98b50cb6232357a4b072338276099db513
a44cb7d700f0ff034498d497e53e934ab2aed85d
refs/heads/master
2020-03-13T08:13:48.565016
2018-04-25T17:03:34
2018-04-25T17:03:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
414
java
package com.lifeistech.android.myapplication; 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); } }
[ "tsukasa.php@gmail.com" ]
tsukasa.php@gmail.com
62b7828c21b9adc82379e91395182bda188c817c
4ea1c43893200c86cc9dbaaa311ae052568e84fa
/src/exAula49/Ex01.java
a330302f3d494d14c8474e3660f7f76acf81598b
[]
no_license
uluizeduardo/exerciciosJava
b0a97c1c133fa5d948de972cedf0135b0b519972
c1dcaa122ed1cb24f8bdb9c47cd41fbe28229614
refs/heads/main
2023-06-02T19:11:27.614983
2021-06-21T18:56:02
2021-06-21T18:56:02
373,830,547
0
0
null
null
null
null
UTF-8
Java
false
false
1,082
java
/*Escreva um programa que repita a leitura de uma senha até que ela seja válida. Para cada leitura de senha incorreta informada, escrever a mensagem "Senha Invalida". Quando a senha for informada corretamente deve ser impressa a mensagem "Acesso Permitido" e o algoritmo encerrado. Considere que a senha correta é o valor 2002. Exemplo: Entrada: Saída 2200 Senha Invalida 1020 Senha Invalida 2022 Senha Invalida 2002 Acesso Permitido */ package exAula49; import java.util.Scanner; public class Ex01 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //Variável double senha; //Entrada de dados System.out.println("Informe a senha: "); senha = scan.nextInt(); //Condicional while (senha != 2002){ System.out.println("Senha inválida "); System.out.println("Informe a senha: "); senha = scan.nextInt(); } System.out.println("Acesso permitido"); } }
[ "luiz.analistadesistemas@gmail.com" ]
luiz.analistadesistemas@gmail.com
a9a2ccd15ed3b3167f20163923173f17888d4f33
63488e907632b2ab39edcf8d1ffc6db9658d6794
/src/com/mercury/flows/Flow_Passengers.java
509ad9795f9644a55ce25470a87b3c4d7000a26b
[]
no_license
Irwog19/Demo2
b6cd7f6111651e7ac8a5e2823c5a539fef0f4999
311215b1e49fa8c49aaf69ced83f32fa9901365b
refs/heads/master
2022-11-08T10:19:41.668519
2020-07-03T10:29:04
2020-07-03T10:29:04
276,871,945
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package com.mercury.flows; import java.io.IOException; import com.mercury.basedriver.Basedriver; import com.mercury.pages.Page_Passengers; public class Flow_Passengers extends Basedriver { Page_Passengers pp = new Page_Passengers(); public void passengers_flow() throws IOException, InterruptedException { pp.passenger1(); pp.passenger2(); } }
[ "gowrikoyada@gmail.com" ]
gowrikoyada@gmail.com
0d51f0c405f2dd093cd4a8cbe93643219f466066
1a6411754950de9eb8c3d8e3f75b6a8470829b16
/SpringTemplate/src/test/java/com/fesco/SpringTemplate/AppTest.java
d4af23a50abd2e25b35c65ee48e8a361ee65af8c
[]
no_license
ijfessey/tester
b3533c7a54c725e9071a9042ec5e21f7d7890bcd
5e313e7e8cec9301a49ee8ecfa9e3d828230e58d
refs/heads/master
2020-11-25T13:24:58.946180
2016-09-06T20:09:57
2016-09-06T20:09:57
67,541,521
0
0
null
null
null
null
UTF-8
Java
false
false
692
java
package com.fesco.SpringTemplate; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "ijfessey@hotmail.com" ]
ijfessey@hotmail.com
61688891e969cbb456c19707437fbf6e38213e91
d1d45741205fa19e92e58404533e0d28228d9fd5
/src/main/java/onedarray/Solution.java
8af0486a33ac36e3478b434c03b9c446f78ac966
[]
no_license
federico-ravagli/hackerrank-java
898901cf95eef63ea0510246f029a6e0f41f12bc
69f9e848ac0a5ea6a08b61870cfb1c14c6ec98e2
refs/heads/master
2022-02-21T03:27:45.297837
2019-09-20T17:55:45
2019-09-20T17:55:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,088
java
package onedarray; import java.util.Scanner; public class Solution { private static int leap; private static int[] game; private static boolean canWin(int leap, int[] game) { Solution.leap = leap; Solution.game = game; return canMove(0); } private static boolean canMove(int start) { if (start < 0 || game[start] == 1) return false; else if (start == game.length - 1 || start + leap >= game.length) return true; game[start] = 1; return canMove(start + 1) || canMove(start - 1) || canMove(start + leap); } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int q = scan.nextInt(); while (q-- > 0) { int n = scan.nextInt(); int leap = scan.nextInt(); int[] game = new int[n]; for (int i = 0; i < n; i++) { game[i] = scan.nextInt(); } System.out.println( (canWin(leap, game)) ? "YES" : "NO" ); } scan.close(); } }
[ "Maksim_Levin@epam.com" ]
Maksim_Levin@epam.com
c7c2efdc5faaee6666df8f3778ec7fa1b288ec72
1b3b77970bca925f3e5c4d510a03ad5f64e0681c
/http/src/main/java/io/cantor/http/BoundHttpResponseEncoder.java
bf3216dbdf3b16452b5f8b96283a1b2ff8d2c7a6
[ "Apache-2.0" ]
permissive
zhiwuya/cantor
dec78776065c5424ae85c0a21fea2a7e0918bd88
0fce472b419c35d387557dcc5acb0f787c3b0627
refs/heads/master
2020-03-30T05:38:47.477626
2018-09-26T07:54:40
2018-09-26T07:54:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
643
java
package io.cantor.http; import java.util.List; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.HttpResponseEncoder; class BoundHttpResponseEncoder extends HttpResponseEncoder { private ChannelHandlerContext context; @Override protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception { super.encode(context, msg, out); } @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { context = PooledDirectByteBufAllocator.forceDirectAllocator(ctx); super.handlerAdded(context); } }
[ "yuqian.wang@56qq.com" ]
yuqian.wang@56qq.com
d8e3f76e3128175e262e5cf22f3bbcea5bd5102c
28234ced7a13cc6ebae3252eb51bed3af91349c3
/src/test/java/de/essig/adventofcode/aoc2019/Day11.java
ee1f2b3830323343fbe7e3025d913ab531d63d27
[]
no_license
essigt/aoc-2019
6b335aea51ebf2b17cdf4455f8567d71df3ccdff
6501096cf0e297997fac68010a52f20ed2737948
refs/heads/master
2020-09-28T03:14:51.020400
2019-12-26T07:54:47
2019-12-26T07:54:47
226,674,858
0
0
null
null
null
null
UTF-8
Java
false
false
19,041
java
package de.essig.adventofcode.aoc2019; import org.junit.jupiter.api.Test; import java.util.*; import java.util.stream.Collectors; import static de.essig.adventofcode.aoc2019.Day11Data.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class Day11 { private long relativeBase = 0; private Map<Tile, Long> hull = new HashMap<>(); private enum Direction {LEFT, UP, RIGHT, DOWN}; @Test void partOne() { int posX = 0; int posY = 0; Direction currentDirection = Direction.UP; boolean halt = false; long instructionPointer = 0; Map<Long, Long> programmAsInt = parseProgramm(PROGRAM); while(!halt) { ArrayList<Long> input = new ArrayList<>(); input.add(getColor(posX, posY)); Context context = runProgramm(programmAsInt, instructionPointer, input); System.out.println("Output: " + context.getOutput()); if(context.isHalted()) { break; } long color = context.getOutput().get(0); long direction = context.getOutput().get(1); // Paint hull.put(new Tile(posX, posY), color); // Turne if(direction == 0) { //Turn left if(currentDirection == Direction.UP) { currentDirection = Direction.LEFT; } else if(currentDirection == Direction.LEFT) { currentDirection = Direction.DOWN; } else if(currentDirection == Direction.DOWN) { currentDirection = Direction.RIGHT; } else { currentDirection = Direction.UP; } } else { //Turn right if(currentDirection == Direction.UP) { currentDirection = Direction.RIGHT; } else if(currentDirection == Direction.LEFT) { currentDirection = Direction.UP; } else if(currentDirection == Direction.DOWN) { currentDirection = Direction.LEFT; } else { currentDirection = Direction.DOWN; } } // Move if(currentDirection == Direction.UP) { posY++; } else if(currentDirection == Direction.LEFT) { posX--; } else if(currentDirection == Direction.DOWN) { posY--; } else { posX++; } halt = context.isHalted(); programmAsInt = context.getProgrammAsIntEnd(); instructionPointer = context.getInstructionPointer(); //System.out.println("Painted at leased once: " + hull.size()); } System.out.println("Painted at leased once: " + hull.size()); assertThat(hull.size(), is(1985)); paintHull(); } @Test void partTwo() { int posX = 0; int posY = 0; Direction currentDirection = Direction.UP; boolean halt = false; long instructionPointer = 0; Map<Long, Long> programmAsInt = parseProgramm(PROGRAM); hull.put(new Tile(posX,posY), 1L); while(!halt) { ArrayList<Long> input = new ArrayList<>(); input.add(getColor(posX, posY)); Context context = runProgramm(programmAsInt, instructionPointer, input); if(context.isHalted()) { System.out.println("Output: " + context.getOutput()); break; } if(context.getOutput().size() < 2) { System.out.println("Output: " + context.getOutput()); System.out.println("Unexpected No Output"); break; } long color = context.getOutput().get(0); long direction = context.getOutput().get(1); // Paint hull.remove(new Tile(posX,posY)); hull.put(new Tile(posX, posY), color); // Turn if(direction == 0) { //Turn left if(currentDirection == Direction.UP) { currentDirection = Direction.LEFT; } else if(currentDirection == Direction.LEFT) { currentDirection = Direction.DOWN; } else if(currentDirection == Direction.DOWN) { currentDirection = Direction.RIGHT; } else { currentDirection = Direction.UP; } } else { //Turn right if(currentDirection == Direction.UP) { currentDirection = Direction.RIGHT; } else if(currentDirection == Direction.LEFT) { currentDirection = Direction.UP; } else if(currentDirection == Direction.DOWN) { currentDirection = Direction.LEFT; } else { currentDirection = Direction.DOWN; } } // Move if(currentDirection == Direction.UP) { posY++; } else if(currentDirection == Direction.LEFT) { posX--; } else if(currentDirection == Direction.DOWN) { posY--; } else { posX++; } halt = context.isHalted(); programmAsInt = context.getProgrammAsIntEnd(); instructionPointer = context.getInstructionPointer(); } paintHull(); // Answer = BLCZCJLZ } private void paintHull() { int xMin = hull.keySet().stream().mapToInt(Tile::getX).min().orElse(0); int xMax = hull.keySet().stream().mapToInt(Tile::getX).max().orElse(0); int yMin = hull.keySet().stream().mapToInt(Tile::getY).min().orElse(0); int yMax = hull.keySet().stream().mapToInt(Tile::getY).max().orElse(0); for(int y = yMax; y >= yMin; y--) { for(int x = xMin; x <= xMax; x++) { System.out.print(getColor(x,y) == 1 ? "X" : " "); } System.out.println(); } } private Long getColor(int x, int y) { return hull.getOrDefault(new Tile(x,y), 0L); } private Context runProgramm(Map<Long, Long> programmAsInt, long instructionPointer, List<Long> inputs) { Context context = new Context(programmAsInt, inputs); boolean stop = false; while (!stop) { int instruction = getOpCode(programmAsInt.get(instructionPointer)); if (instruction == 99) { context.setHalted(true); stop = true; } else if (instruction == 1) { // ADD printCommand(programmAsInt, instructionPointer, 4); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long value2 = getParamAccordingToMode(programmAsInt, instructionPointer, 1); long destination = getJumpGoalAccordingToMode(programmAsInt, instructionPointer, 2); long sum = value1 + value2; programmAsInt.put(destination, sum); instructionPointer += 4; } else if (instruction == 2) { // MUL printCommand(programmAsInt, instructionPointer, 4); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long value2 = getParamAccordingToMode(programmAsInt, instructionPointer, 1); long destination = getJumpGoalAccordingToMode(programmAsInt, instructionPointer, 2); long sum = value1 * value2; programmAsInt.put(destination, sum); instructionPointer += 4; } else if (instruction == 3) { // INPUT printCommand(programmAsInt, instructionPointer, 2); long destination = getJumpGoalAccordingToMode(programmAsInt, instructionPointer, 0); long input = inputs.remove(0); //System.out.println("Input Value " + input + " at " + destination); programmAsInt.put(destination, input); instructionPointer += 2; } else if (instruction == 4) { // OUTPUT printCommand(programmAsInt, instructionPointer, 2); long output = getParamAccordingToMode(programmAsInt, instructionPointer, 0); context.getOutput().add(output); // Finish when two outputs are collected if(context.getOutput().size() == 2) { stop=true; } instructionPointer += 2; } else if (instruction == 5) { // jump-if-true printCommand(programmAsInt, instructionPointer, 3); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long jumpGoal = getParamAccordingToMode(programmAsInt, instructionPointer, 1); if (value1 != 0) { instructionPointer = jumpGoal; } else { instructionPointer += 3; } } else if (instruction == 6) { // jump-if-false printCommand(programmAsInt, instructionPointer, 3); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long jumpGoal = getParamAccordingToMode(programmAsInt, instructionPointer, 1); if (value1 == 0) { instructionPointer = jumpGoal; } else { instructionPointer += 3; } } else if (instruction == 7) { // less-then printCommand(programmAsInt, instructionPointer, 4); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long value2 = getParamAccordingToMode(programmAsInt, instructionPointer, 1); long resultGoal = getJumpGoalAccordingToMode(programmAsInt, instructionPointer, 2); if (value1 < value2) { programmAsInt.put(resultGoal, 1L); } else { programmAsInt.put(resultGoal, 0L); } instructionPointer += 4; } else if (instruction == 8) { // equals printCommand(programmAsInt, instructionPointer, 4); long value1 = getParamAccordingToMode(programmAsInt, instructionPointer, 0); long value2 = getParamAccordingToMode(programmAsInt, instructionPointer, 1); long resultGoal = getJumpGoalAccordingToMode(programmAsInt, instructionPointer, 2); if (value1 == value2) { programmAsInt.put(resultGoal, 1L); } else { programmAsInt.put(resultGoal, 0L); } instructionPointer += 4; } else if (instruction == 9) { // set relative base printCommand(programmAsInt, instructionPointer, 2); relativeBase += getParamAccordingToMode(programmAsInt, instructionPointer, 0); //System.out.println("Relativ Base=" + relativeBase); instructionPointer += 2; } else { System.err.println("FATAL: Unknown Instruction " + instruction + "@" + instructionPointer); break; } } context.setProgrammAsIntEnd(programmAsInt); context.setInstructionPointer(instructionPointer); return context; } private void printCommand(Map<Long, Long> programmAsInt, long instructionPointer, int length) { for(int i = 0; i< length; i++) { System.out.print(programmAsInt.getOrDefault(instructionPointer+i, 0L) + ","); } System.out.println(); } long getJumpGoalAccordingToMode(Map<Long, Long> programmAsInt, long instructionPointer, int param) { if (param == 0) { if (getFirstParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 1, 0L); return relativeBase + relativPart; //throw new IllegalArgumentException("Relative mode not implemented"); } else { return programmAsInt.get(instructionPointer + 1 ); } } else if (param == 1) { if (getSecondParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 2, 0L); return relativeBase + relativPart; } else { return programmAsInt.get(instructionPointer + 2 ); } } else if (param == 2) { if (getThirdParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 3, 0L); return relativeBase + relativPart; } else { return programmAsInt.get(instructionPointer + 3 ); } } else { throw new IllegalArgumentException("Not implemented"); } } long getParamAccordingToMode(Map<Long, Long> programmAsInt, long instructionPointer, int param) { if (param == 0) { if (getFirstParamMode(programmAsInt.get(instructionPointer)) == 0) { // POSITION MODE return programmAsInt.getOrDefault(programmAsInt.get(instructionPointer + 1), 0L); } else if (getFirstParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 1,0L); return programmAsInt.getOrDefault( relativeBase + relativPart, 0L); } else { return programmAsInt.getOrDefault(instructionPointer + 1, 0L); } } else if (param == 1) { if (getSecondParamMode(programmAsInt.get(instructionPointer)) == 0) { // POSITION MODE return programmAsInt.getOrDefault(programmAsInt.get(instructionPointer + 2),0L ); } else if (getSecondParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 2, 0L); return programmAsInt.getOrDefault( relativeBase + relativPart, 0L); } else { return programmAsInt.getOrDefault(instructionPointer + 2, 0L); } } else if (param == 2) { if (getThirdParamMode(programmAsInt.get(instructionPointer)) == 0) { // POSITION MODE return programmAsInt.getOrDefault(programmAsInt.get(instructionPointer + 3),0L ); } else if (getThirdParamMode(programmAsInt.get(instructionPointer)) == 2) { // Relative MODE long relativPart = programmAsInt.getOrDefault(instructionPointer + 3, 0L); return programmAsInt.getOrDefault( relativeBase + relativPart, 0L); } else { return programmAsInt.getOrDefault(instructionPointer + 3, 0L); } } else { throw new IllegalArgumentException("Not implemented"); } } @Test void testOps() { assertThat(getOpCode(10002), is(2)); assertThat(getFirstParamMode(11022), is(0)); assertThat(getFirstParamMode(20122), is(1)); assertThat(getSecondParamMode(21022), is(1)); assertThat(getSecondParamMode(10122), is(0)); assertThat(getThirdParamMode(11022), is(1)); assertThat(getThirdParamMode(1122), is(0)); assertThat(getFirstParamMode(21202), is(2)); assertThat(getSecondParamMode(2022), is(2)); assertThat(getThirdParamMode(21122), is(2)); } int getOpCode(long instruction) { return (int) instruction % 100; } int getFirstParamMode(long instruction) { return (int) (instruction / 100L) % 10; } int getSecondParamMode(long instruction) { return (int) (instruction / 1000L) % 10; } int getThirdParamMode(long instruction) { return (int)(instruction / 10000L) % 10; } private Map<Long, Long> parseProgramm(String input) { Map<Long, Long> programm = new HashMap<>(); String[] split = input.split(","); long pos = 0; for (String instruction : split) { programm.put(pos, Long.valueOf(instruction)); pos++; } return programm; } private String prettyPrint(Context context) { return context.getProgrammAsIntEnd().values().stream().map(String::valueOf).collect(Collectors.joining(",")); } private class Context { Map<Long, Long> programmAsIntOriginal; Map<Long, Long> programmAsIntEnd; List<Long> input; List<Long> output; private boolean halted; private long instructionPointer; public Context(Map<Long, Long> programmAsIntOriginal, List<Long> input) { this.programmAsIntOriginal = new HashMap<>(programmAsIntOriginal); this.input = input; this.output = new ArrayList<>(); } public boolean isHalted() { return halted; } public void setHalted(boolean halted) { this.halted = halted; } public long getInstructionPointer() { return instructionPointer; } public void setInstructionPointer(long instructionPointer) { this.instructionPointer = instructionPointer; } public Map<Long, Long> getProgrammAsIntEnd() { return programmAsIntEnd; } public void setProgrammAsIntEnd(Map<Long, Long> programmAsIntEnd) { this.programmAsIntEnd = new HashMap<>(programmAsIntEnd); } public Map<Long, Long> getProgrammAsIntOriginal() { return programmAsIntOriginal; } public List<Long> getInputs() { return input; } public List<Long> getOutput() { return output; } } private static class Tile{ private int x; private int y; public Tile(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Tile tile = (Tile) o; return x == tile.x && y == tile.y; } @Override public int hashCode() { return Objects.hash(x, y); } } }
[ "t.essig@essignetz.de" ]
t.essig@essignetz.de
72c614ecae4b1338125f9e7dfca7c168d8b0dada
6e8fd46f50e2ba8a59d8cd1fb8830f1dbeb3e02e
/src/com/kant/design/patterns/state/StateToggle.java
e5b6858171c50fcc7c16b9e57216dfdfc8c4e5dd
[ "MIT" ]
permissive
thekant/myCodeRepo
f41bfa1e0901536714517a831e95148507d882a8
41f53a11a07b0e0eaa849fe8119e5c21960e7593
refs/heads/master
2020-05-21T17:54:53.149716
2017-07-05T16:11:58
2017-07-05T16:11:58
65,477,480
3
1
null
null
null
null
UTF-8
Java
false
false
1,392
java
package com.kant.design.patterns.state; /** * * @author shaskant * */ import java.io.*; class Button { // stores context private State current; public Button() { current = OFF.instance(); } public void setCurrent(State s) { current = s; } public void push() { current.push(this); } } // 4. The "wrappee" hierarchy abstract class State { // 5. Default behavior can go in the base class public abstract void push(Button b); } class ON extends State { private static ON inst = new ON(); private ON() { } public static State instance() { return inst; } /** * Current state is ON , so set state to OFF. */ public void push(Button b) { b.setCurrent(OFF.instance()); System.out.println(" turning OFF"); } } class OFF extends State { private static OFF inst = new OFF(); private OFF() { } public static State instance() { return inst; } /** * Current state is OFF , so set state to ON. */ public void push(Button b) { b.setCurrent(ON.instance()); System.out.println(" turning ON"); } } /** * * @author shaskant * */ public class StateToggle { public static void main(String[] args) throws IOException { InputStreamReader is = new InputStreamReader(System.in); int ch; Button btn = new Button(); while (true) { System.out.print("Press 'Enter'"); ch = is.read(); ch = is.read(); btn.push(); } } }
[ "shaskant@oradev.oraclecorp.com" ]
shaskant@oradev.oraclecorp.com
6f56b68e33a9b6dc9327c3f01232318a3548c78a
7d8236d87119493601f83d93ae4a36c29be3f8bc
/src/test/java/io/github/jhipster/application/web/rest/AuditResourceIntTest.java
004ad669c89004ea9a55a0334ca804ea6dfdb268
[]
no_license
scarabetta/jhipsterSample2
e4808cdbeda4482aa507814e406d36bdef1ae8e2
f5155176eb5b6c334dec9ab94728addea3c9c470
refs/heads/master
2021-04-28T13:34:14.329505
2018-02-19T19:03:34
2018-02-19T19:03:34
122,107,341
0
0
null
null
null
null
UTF-8
Java
false
false
6,053
java
package io.github.jhipster.application.web.rest; import io.github.jhipster.application.JhipsterSample2App; import io.github.jhipster.application.config.audit.AuditEventConverter; import io.github.jhipster.application.domain.PersistentAuditEvent; import io.github.jhipster.application.repository.PersistenceAuditEventRepository; import io.github.jhipster.application.service.AuditEventService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.format.support.FormattingConversionService; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import java.time.Instant; import java.time.format.DateTimeFormatter; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the AuditResource REST controller. * * @see AuditResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterSample2App.class) @Transactional public class AuditResourceIntTest { private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z"); private static final long SECONDS_PER_DAY = 60 * 60 * 24; @Autowired private PersistenceAuditEventRepository auditEventRepository; @Autowired private AuditEventConverter auditEventConverter; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private FormattingConversionService formattingConversionService; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; private PersistentAuditEvent auditEvent; private MockMvc restAuditMockMvc; @Before public void setup() { MockitoAnnotations.initMocks(this); AuditEventService auditEventService = new AuditEventService(auditEventRepository, auditEventConverter); AuditResource auditResource = new AuditResource(auditEventService); this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setConversionService(formattingConversionService) .setMessageConverters(jacksonMessageConverter).build(); } @Before public void initTest() { auditEventRepository.deleteAll(); auditEvent = new PersistentAuditEvent(); auditEvent.setAuditEventType(SAMPLE_TYPE); auditEvent.setPrincipal(SAMPLE_PRINCIPAL); auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); } @Test public void getAllAudits() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get all the audits restAuditMockMvc.perform(get("/management/audits")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getAudit() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL)); } @Test public void getAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will contain the audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10); String toDate = SAMPLE_TIMESTAMP.plusSeconds(SECONDS_PER_DAY).toString().substring(0,10); // Get the audit restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getNonExistingAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will not contain the sample audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(2*SECONDS_PER_DAY).toString().substring(0,10); String toDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10); // Query audits but expect no results restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(header().string("X-Total-Count", "0")); } @Test public void getNonExistingAudit() throws Exception { // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
f49acb6a309327a8777e7f7e8e902e13c79090d0
32ec32edfe65f192c0886b1de7825d03b60fadec
/DI-XML-Setter/src/test/java/com/bridgeit/DI_XML_Setter/AppTest.java
44859bba67829d9406d15e1ab952d97be74aba8f
[]
no_license
sunil965/Spring
5470d0356160e0c20285f7ab7f3a617e58b7cbf1
d40d3928578a7d8dcd1d04ac22c718d81d8e45fb
refs/heads/master
2021-01-25T09:21:48.998316
2017-06-23T07:48:45
2017-06-23T07:48:45
93,826,525
0
1
null
null
null
null
UTF-8
Java
false
false
654
java
package com.bridgeit.DI_XML_Setter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "sunilkumar192114@gmail.com" ]
sunilkumar192114@gmail.com
f239c6b09b2eaeecb0535e6121e938810ee11e98
d2288b31f82408f9251a4a851802916e1da0c7b1
/src/main/java/net/lshift/lee/jaxb/pojo/Grandchild.java
018a3fbbc32da04b6dda72b3b2b3271f78aa4be5
[]
no_license
ljcoomber/jaxb-nested-adapters
e9c4656528486a1fd317565101e3b084ac35a259
0d97378392b7368813d42426e81dac0c5222173a
refs/heads/master
2020-06-04T22:23:50.335953
2012-12-14T13:55:56
2012-12-14T13:55:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
432
java
package net.lshift.lee.jaxb.pojo; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import net.lshift.lee.jaxb.xml.adapter.GrandchildAdapter; @XmlJavaTypeAdapter(GrandchildAdapter.class) public class Grandchild { private final String grandchildName; public Grandchild(String grandchildName) { this.grandchildName = grandchildName; } public String getGrandchildName() { return grandchildName; } }
[ "lee@lshift.net" ]
lee@lshift.net
97c2a5ddf0bc75c36db85d3c75179fabdf373587
6385b72cf9d68587c63677d46fa431bc33f2f44f
/src/main/java/com/ph/lease/converter/DateConverter.java
887fc5f4f5915674b6f67c9662f419f029029a42
[]
no_license
wowpH/Lease
eef4ce2acb17d1c15c23d58365a90ce1dc9a9911
a3054dde909c8ce54f4ae6e9157599010ebf73cc
refs/heads/master
2023-03-08T20:14:47.651725
2022-08-30T17:20:21
2022-08-30T17:20:21
261,090,160
24
8
null
2023-02-22T08:28:52
2020-05-04T05:41:50
Java
UTF-8
Java
false
false
614
java
package com.ph.lease.converter; import org.springframework.core.convert.converter.Converter; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; /** * @author PengHao */ public class DateConverter implements Converter<String, Date> { private static final SimpleDateFormat DEFAULT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public Date convert(String s) { Date date = null; try { date = DEFAULT.parse(s); } catch (ParseException e) { e.printStackTrace(); } return date; } }
[ "929450073@qq.com" ]
929450073@qq.com
0bdd7c7930bab07890f9df815bd9dcf371d61037
0f0e5747898e74e20274ef5fd5b30a981b18b96c
/JPAOneToOne-Bi/src/com/lti/model/Student.java
946ea0ec7ce36939cf9c4b2a8d1283d7d1bc1f5e
[]
no_license
anerishah1997/JPA_Day3
ac6b6b4c7a82dfc686670a5d2f1197281d731a00
61179e0ab6420b62b92b509e9c8fddd8bba0b1d3
refs/heads/master
2020-09-06T15:29:50.077800
2019-11-08T12:51:34
2019-11-08T12:51:34
220,465,775
0
0
null
null
null
null
UTF-8
Java
false
false
2,644
java
package com.lti.model; import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; @Entity @Table(name="student") @SequenceGenerator(name="seq", sequenceName="seq_student", initialValue=1, allocationSize=1) public class Student implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seq") private int studentId; private int rollNumber; private String studentName; private double avgScore; @Transient private String dob; @OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER) // Bidirectional reln (Owner side) as Student's reference is created in Address. // cascadeType indicates when owner enitty is persisted then automatically child entity is persisted //when type is ALL,which do all things(persist,merge,find,remove) in child auto. @JoinColumn(name="addressId") private Address address; public Student(int rollNumber, String studentName, double avgScore) { super(); this.rollNumber = rollNumber; this.studentName = studentName; this.avgScore = avgScore; } public Student() { super(); } public int getStudentId() { return studentId; } public void setStudentId(int studentId) { this.studentId = studentId; } public int getRollNumber() { return rollNumber; } public void setRollNumber(int rollNumber) { this.rollNumber = rollNumber; } public String getStudentName() { return studentName; } public void setStudentName(String studentName) { this.studentName = studentName; } public double getAvgScore() { return avgScore; } public void setAvgScore(double avgScore) { this.avgScore = avgScore; } public String getDob() { return dob; } public void setDob(String dob) { this.dob = dob; } public Address getAddress() { return address; } /*@Override public String toString() { return "Student [studentId=" + studentId + ", rollNumber=" + rollNumber + ", studentName=" + studentName + ", avgScore=" + avgScore + ", dob=" + dob + ", address=" + address + "]"; }*/ public void setAddress(Address address) { this.address = address; } @Override public String toString() { return "Student [studentId=" + studentId + ", rollNumber=" + rollNumber + ", studentName=" + studentName + ", avgScore=" + avgScore + ", dob=" + dob + "]"; } }
[ "aneri.shah1997@gmail.com" ]
aneri.shah1997@gmail.com
c9e34a1b2bf51ec6e3012444d7720cdcce3d5562
f3c21a8d125f72498687f5ff24af0d7dafe74d5b
/09/src/Test3.java
5d7970b88addf69e1a66ff1c1530d39730900a5d
[]
no_license
Saxphone1/Java_BigData
ccbd89ef4f1922144095eb91160034f4faba26b4
fe560d1de3d5a48d46242f799c452fe60d1e72bc
refs/heads/master
2020-05-24T19:24:54.456678
2019-03-31T03:20:27
2019-03-31T03:20:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,165
java
import java.util.*; //import java.util.function.Consumer; public class Test3 { public static void main(String[] args) { Vector<String> v = new Vector<>(); v.add("Tom"); v.add("jack"); v.add("lose"); v.add("lily"); // iterator(v); // enumeration(v); foreach1(v); } public static void foreach1(Collection<String> c){ // Consumer<String> cc = (String str)->{ // System.out.println(str); // }; // c.forEach(str-> System.out.println(str)); // c.forEach(System.out::println); } public static void foreach(Collection<String> c){ for(String s:c){ System.out.println(s); } } public static void enumeration(Vector<String> v){ Enumeration<String> e = v.elements(); while (e.hasMoreElements()){ System.out.println(e.nextElement()); } } public static void iterator(Collection<String> c){ Iterator<String> it = c.iterator(); while (it.hasNext()){ System.out.println(it.next()); } } }
[ "wuy_123@126.com" ]
wuy_123@126.com
0b50677a813c14968fd58751171f88d2e363482c
4e643854a9e29ff706536170e8c4ac626eab8d95
/src/main/java/be/Balor/Manager/Commands/Server/ServerCommand.java
ec403d4b1296cc51eccb42b4bc475a4574793f04
[]
no_license
Belphemur/AdminCmd
4fddbd3b43ac84486b691be8202c521bb4cea81a
8e5c0e3af7c226a510e635aea84d1a0136fefd80
refs/heads/master
2021-01-13T02:06:48.308382
2014-05-30T20:11:17
2014-05-30T20:11:17
1,555,007
5
8
null
2014-05-30T20:09:14
2011-04-01T10:08:40
Java
UTF-8
Java
false
false
1,481
java
/************************************************************************ * This file is part of AdminCmd. * * AdminCmd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * AdminCmd is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AdminCmd. If not, see <http://www.gnu.org/licenses/>. ************************************************************************/ package be.Balor.Manager.Commands.Server; import be.Balor.Manager.Commands.CoreCommand; /** * @author Balor (aka Antoine Aflalo) * */ public abstract class ServerCommand extends CoreCommand { /** * */ public ServerCommand() { super(); this.permParent = plugin.getPermissionLinker().getPermParent( "admincmd.server.*"); } /** * @param string * @param string2 */ public ServerCommand(final String cmd, final String permNode) { super(cmd, permNode); this.permParent = plugin.getPermissionLinker().getPermParent( "admincmd.server.*"); } }
[ "antoineaf@gmail.com" ]
antoineaf@gmail.com
c088da63d1c577ac13b86427601fed2affacdcca
d1826ed222933423cdab83a8a0f5995a6cf3c12a
/Desarrollo/TP4-Grafos/src/test/TestIndice.java
30281c48d7e008b1f3fb1430a94ee38fda0e72bd
[]
no_license
Grupo-de-4/TP4
055676669ce907d809bbdd8a9fd33497d454612b
5299f999450d87ffc369e93e14a5639813e01a25
refs/heads/master
2021-05-08T01:42:04.839166
2017-11-08T03:11:55
2017-11-08T03:11:55
107,900,213
0
0
null
null
null
null
UTF-8
Java
false
false
1,109
java
package test; import org.junit.Assert; import org.junit.jupiter.api.Test; import matrizSimetrica.MatrizSimetrica; /** * Tests para verificar que la creacion de la matriz simetrica funciona correctamente. * Verificamos que las posiciones en el vector correspondan a la de la matriz. * @author avorraim * */ class TestIndice { private MatrizSimetrica matriz; /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (0,1) */ @Test public void testIndiceCero() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(0, 1), 0); } /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (0,2) */ @Test public void testIndiceUno() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(0, 2), 1); } /** * Testeo de la Matriz Simetrica. Evaluamos que el indice interno del vector sea * el correcto para (1,2) */ @Test public void testIndiceDos() { matriz = new MatrizSimetrica(3); Assert.assertEquals(matriz.getIndice(1, 2), 2); } }
[ "maximiliano.rdl@gmail.com" ]
maximiliano.rdl@gmail.com
779c4dc8cf802fa4a3ee5b9d8e07f5c9f6d423ef
7cf147fa4269cc3fb5465ebf351a4d5bd24188e6
/app/src/main/java/com/future_melody/net/request/AddFollowRequest.java
7f5608154a20ae3a98516983bdd57569095fe165
[]
no_license
gyingg/music
1528dc08960e50963ee88dafd2899f15e49d122e
547f819fd42d092d10837ed60c4142f34de49edc
refs/heads/master
2020-04-11T21:33:36.696393
2018-12-17T10:06:41
2018-12-17T10:06:41
162,093,105
0
0
null
null
null
null
UTF-8
Java
false
false
367
java
package com.future_melody.net.request; /** * Created by Y on 2018/5/30. */ public class AddFollowRequest { private String bg_userid;// 被关注人的id private String g_userid;// 关注人的id public AddFollowRequest(String bg_userid, String g_userid) { this.bg_userid = bg_userid; this.g_userid = g_userid; } }
[ "gyingg" ]
gyingg
28527d3a24fb9cf9f6d524e0bec0508e31464638
f14d53fc595fb264ff99de428c6db3e25609f677
/src/main/java/com/tidi/restaurant/domain/Table.java
6e751ec1adf0a2419c07803c209b1c59d4e306bf
[]
no_license
daniel-1321/restaurant
efbf0c7b10f8d1b7e8a5777d05fc71ff3a0f572d
84144caabebf4feb41f4a6fe066f85ba7911917e
refs/heads/master
2021-07-21T03:07:58.118068
2019-11-04T11:23:26
2019-11-04T11:23:26
219,399,048
0
0
null
2020-10-13T17:11:26
2019-11-04T02:15:20
Java
UTF-8
Java
false
false
963
java
package com.tidi.restaurant.domain; /** * @author HO_TRONG_DAI * @date Oct 30, 2019 * @tag */ public class Table { private int table_id; private String table_name; private String table_type; public Table(int table_id, String table_name, String table_type) { super(); this.table_id = table_id; this.table_name = table_name; this.table_type = table_type; } public Table() { super(); } public int getTable_id() { return table_id; } public void setTable_id(int table_id) { this.table_id = table_id; } public String getTable_name() { return table_name; } public void setTable_name(String table_name) { this.table_name = table_name; } public String getTable_type() { return table_type; } public void setTable_type(String table_type) { this.table_type = table_type; } @Override public String toString() { return "Table [table_id=" + table_id + ", table_name=" + table_name + ", table_type=" + table_type + "]"; } }
[ "hotrongdai1011@gmail.com" ]
hotrongdai1011@gmail.com
6f0ececa0cde80c81f9c93be82ceb51b9a93feed
327debc56fc944b1028a0751f6bd4505d8867b6b
/desktop/src/com/koalio/game/desktop/DesktopLauncher.java
5e9a0c27b9ed2a6a4fc4a0661d8a5a2aefb6fcf7
[]
no_license
mitoo95/Examen-2-Lab
e882fafba32a983ab78016ddafd5f93c332b20cb
64e3f5b1cd30e10f55f3bff4ef6af78602fa6931
refs/heads/master
2021-01-20T10:55:13.300310
2016-04-01T20:48:54
2016-04-01T20:48:54
55,261,351
0
0
null
null
null
null
UTF-8
Java
false
false
407
java
package com.koalio.game.desktop; import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import com.koalio.game.MyKoalioGame; public class DesktopLauncher { public static void main (String[] arg) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); new LwjglApplication(new MyKoalioGame(), config); } }
[ "Mito Santos" ]
Mito Santos
6fba9fad70330eb24396cdb052090ca76d85ba8e
8723fbfb119513a1983f4c3e50f870aac59eb374
/src/question49/Study.java
342fc9b676d7b07cdf981b5a2363fbc37ca74759
[]
no_license
engchina/oracle-java-1Z0-808
210484cb8c10533c3414f510f275a7e9464485eb
85d9a78dc6aee59cafa848d2bf446d641a6ecd8a
refs/heads/master
2022-12-05T15:27:10.733108
2020-07-11T01:33:34
2020-07-11T01:33:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
236
java
package question49; public class Study { public static void main(String[] args) { // double discount = 0; int qty = Integer.parseInt(args[0]); // line n1 discount = (qty >= 90) ? 0.5 : (qty > 80) ? 0.2 : 0; } }
[ "atjapan2015@yahoo.co.jp" ]
atjapan2015@yahoo.co.jp
6fe0d4e0d78ea809e202e34aab15394adfeef41a
97a6b6cfb01861469e3407b45dd8783ea3c190bf
/src/main/java/com/zs/pms/po/TUser.java
3bf89c6a86d7581902dfc536434689fed4ce2d4c
[]
no_license
lishuai1030/code
8d6edb4851471e21eef99328b729c78073c626c5
10760e1573e23c94a0684d2b1c8dfdb7c2c8a845
refs/heads/master
2020-04-24T01:59:36.835713
2019-02-20T07:34:30
2019-02-20T07:34:30
171,620,589
0
0
null
null
null
null
GB18030
Java
false
false
2,772
java
package com.zs.pms.po; import java.io.Serializable; import java.util.Date; import com.zs.pms.utils.DateUtil; public class TUser implements Serializable{ /** * 序列号 */ private static final long serialVersionUID = 5293214558214995122L; private int id; private String loginname; private String password; private String sex; private Date birthday; private String email; private TDep dept; private String realname; private int creator; private Date creatime; private int updator; private Date updatime; private int isenabled; private String pic; private String isenabledTxt; private String birthdayTxt; public String getIsenabledTxt() { if (isenabled==1) { return "可用"; } else { return "不可用"; } } public void setIsenabledTxt(String isenabledTxt) { this.isenabledTxt = isenabledTxt; } public String getBirthdayTxt() { return DateUtil.getStrDate(); } public void setBirthdayTxt(String birthdayTxt) { this.birthdayTxt = birthdayTxt; } public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLoginname() { return loginname; } public void setLoginname(String loginname) { this.loginname = loginname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public TDep getDept() { return dept; } public void setDept(TDep dept) { this.dept = dept; } public String getRealname() { return realname; } public void setRealname(String realname) { this.realname = realname; } public Date getCreatime() { return creatime; } public void setCreatime(Date creatime) { this.creatime = creatime; } public Date getUpdatime() { return updatime; } public void setUpdatime(Date updatime) { this.updatime = updatime; } public int getCreator() { return creator; } public void setCreator(int creator) { this.creator = creator; } public int getUpdator() { return updator; } public void setUpdator(int updator) { this.updator = updator; } public int getIsenabled() { return isenabled; } public void setIsenabled(int isenabled) { this.isenabled = isenabled; } }
[ "764850159@qq.com" ]
764850159@qq.com
9f4d2dc6eafbc612a733a9a5e8c1cac210bc686e
d4f894bdeeea7caf9daddb2e9930d894ce1b0c6d
/gomall-order/src/main/java/online/icode/gomall/order/service/OrderOperateHistoryService.java
497590e9a2e3b2cfbba2cc47b3cd53a6707d6167
[]
no_license
AnonyStar/gomall
29c3a42310c3526fffadaef393d4897d2b76fd43
036ba0199c80a792adfed0035806e44e44163d0a
refs/heads/master
2023-02-19T04:19:52.118830
2021-01-14T08:21:11
2021-01-14T08:21:11
311,891,565
0
0
null
null
null
null
UTF-8
Java
false
false
516
java
package online.icode.gomall.order.service; import com.baomidou.mybatisplus.extension.service.IService; import online.icode.gomall.common.utils.PageUtils; import online.icode.gomall.order.entity.OrderOperateHistoryEntity; import java.util.Map; /** * 订单操作历史记录 * * @author AnonyStar * @email AnonyStarCode@gmail.com * @date 2020-12-23 14:55:46 */ public interface OrderOperateHistoryService extends IService<OrderOperateHistoryEntity> { PageUtils queryPage(Map<String, Object> params); }
[ "zcx950216" ]
zcx950216
353b7c33aa3b3857bce920f827eb16e77d355800
1d7c0fd46baff3ed4b07aee1290a1edda6f04de9
/app/src/main/java/com/lirunlong/storyofdark/HttpUtils.java
50833d5b2100ad2bb9ede32a82f0bec2d856538d
[]
no_license
redTreeOnWall/storyOfDark
4bde789f03e44371c464a0418ccbb25e093e92e9
e03035884ec79656e952bfb790ab4ae73ae02e0b
refs/heads/master
2022-12-06T15:10:39.423816
2020-08-27T09:39:54
2020-08-27T09:39:54
289,403,640
0
0
null
null
null
null
UTF-8
Java
false
false
2,206
java
package com.lirunlong.storyofdark; import android.os.Build; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URL; import java.util.concurrent.CompletableFuture; import androidx.appcompat.view.menu.ShowableListMenu; public class HttpUtils { static void AskHttp(String urlStr,OnHttpFinished finished){ Thread askThreed = new Thread(() ->{ HttpURLConnection connection = null; BufferedReader reader = null; try { URL url = new URL(urlStr); connection = (HttpURLConnection) url.openConnection(); //设置请求方法 connection.setRequestMethod("GET"); //设置连接超时时间(毫秒) connection.setConnectTimeout(5000); //设置读取超时时间(毫秒) connection.setReadTimeout(5000); //返回输入流 InputStream in = connection.getInputStream(); //读取输入流 reader = new BufferedReader(new InputStreamReader(in)); StringBuilder result = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { result.append(line); } // show(result.toString()); finished.onOk(true,result.toString()); } catch (Exception e) { finished.onOk(true,e.toString()); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } if (connection != null) {//关闭连接 connection.disconnect(); } } } ); askThreed.start(); } public interface OnHttpFinished{ void onOk( boolean isSuc,String result); } }
[ "lirunlong.com@gmail.com" ]
lirunlong.com@gmail.com
837adef0db6affc780c4c63fe24c6af8bc427577
358588de52a2ad83dc30418b0b022ba121d060db
/src/main/java/com/victormeng/leetcode/analyze_user_website_visit_pattern/Solution2.java
55ab85948e1b996ab263a609af26dac86383496c
[ "MIT" ]
permissive
victormeng24/LeetCode-Java
c53e852ea47049328397e4896319edd0ce0cf48a
16bc2802e89d5c9d6450d598f0f41a7f6261d7b6
refs/heads/master
2023-08-05T02:33:18.990663
2021-02-04T13:31:48
2021-02-04T13:31:48
327,479,246
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
/** * Leetcode - analyze_user_website_visit_pattern */ package com.victormeng.leetcode.analyze_user_website_visit_pattern; import java.util.*; import com.ciaoshen.leetcode.util.*; /** * log instance is defined in Solution interface * this is how slf4j will work in this class: * ============================================= * if (log.isDebugEnabled()) { * log.debug("a + b = {}", sum); * } * ============================================= */ class Solution2 implements Solution { public List<String> mostVisitedPattern(String[] username, int[] timestamp, String[] website) { return null; } }
[ "victormeng24@gmail.com" ]
victormeng24@gmail.com
3c0d21853b3e49168c2af5fe9cfa5c78d5c20f0a
56d6fa60f900fb52362d4cce950fa81f949b7f9b
/aws-sdk-java/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountPasswordPolicyRequest.java
942df4c3f6817408f3a6b979784153f41b7d1eee
[ "JSON", "Apache-2.0" ]
permissive
TarantulaTechnology/aws
5f9d3981646e193c89f1c3fa746ec3db30252913
8ce079f5628334f83786c152c76abd03f37281fe
refs/heads/master
2021-01-19T11:14:53.050332
2013-09-15T02:37:02
2013-09-15T02:37:02
12,839,311
1
0
null
null
null
null
UTF-8
Java
false
false
2,342
java
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.identitymanagement.model; import com.amazonaws.AmazonWebServiceRequest; import java.io.Serializable; /** * Container for the parameters to the {@link com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest) GetAccountPasswordPolicy operation}. * <p> * Retrieves the password policy for the AWS account. For more information about using a password policy, go to <a * href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html"> Managing an IAM Password Policy </a> . * </p> * * @see com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest) */ public class GetAccountPasswordPolicyRequest extends AmazonWebServiceRequest implements Serializable { /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyRequest == false) return false; GetAccountPasswordPolicyRequest other = (GetAccountPasswordPolicyRequest)obj; return true; } }
[ "TarantulaTechnology@users.noreply.github.com" ]
TarantulaTechnology@users.noreply.github.com
89f3a610e95ddda6ad6f216de984bf2bdc426340
b1beedff0ecfe9d5502381650aa8913fd5b81e92
/src/sample/Controller.java
37fd06646eb13fd44c47e6e0d9d8c4a32292807f
[]
no_license
ShaneMaglangit/PathfindingVisualizer
e6e4ddf956493d4989ad4645e6a252bd68cd7507
b0f74e1389874a0db5ae1910e8de63b9e77ef953
refs/heads/master
2021-05-16T19:55:44.333105
2020-09-02T14:16:12
2020-09-02T14:16:12
250,447,372
1
0
null
null
null
null
UTF-8
Java
false
false
2,138
java
package sample; import java.util.List; public class Controller { public void setStartNode(Visualizer visualizer, List<Integer> next) { if(!visualizer.getPathfindingRun().isRunning() && !visualizer.getEnd().equals(next)) { Node[][] nodes = visualizer.getNodes(); List<Integer> start = visualizer.getStart(); nodes[start.get(0)][start.get(1)].changeState(NodeState.DEFAULT); nodes[next.get(0)][next.get(1)].changeState(NodeState.START); visualizer.setStart(next); } } public void setEndNode(Visualizer visualizer, List<Integer> next) { if(!visualizer.getPathfindingRun().isRunning() && !visualizer.getStart().equals(next)) { Node[][] nodes = visualizer.getNodes(); List<Integer> end = visualizer.getEnd(); nodes[end.get(0)][end.get(1)].changeState(NodeState.DEFAULT); nodes[next.get(0)][next.get(1)].changeState(NodeState.END); visualizer.setEnd(next); } } public void setNodeAsBlocked(Visualizer visualizer, List<Integer> next) { Node node = visualizer.getNodes()[next.get(0)][next.get(1)]; if(!visualizer.getPathfindingRun().isRunning() && node.getState().equals(NodeState.DEFAULT)) { node.changeState(NodeState.BLOCKED); } } public void addWeight(Visualizer visualizer, List<Integer> next) { Node node = visualizer.getNodes()[next.get(0)][next.get(1)]; if(!visualizer.getPathfindingRun().isRunning() && node.getState().equals(NodeState.DEFAULT)) { node.addWeight(1); } } public void visualize(Visualizer visualizer, PathfindingRun pathfindingRun) { if(pathfindingRun.isRunning()) { pathfindingRun.setRunning(false); visualizer.resetNodes(); } else { pathfindingRun.setRunning(true); new Thread(pathfindingRun).start(); } } public void clearBoard(Visualizer visualizer, PathfindingRun pathfindingRun) { pathfindingRun.setRunning(false); visualizer.createNodes(); } }
[ "shanedmaglangit@gmail.com" ]
shanedmaglangit@gmail.com
26a1a51ca0191d4216663a31d0a1326e16dc90eb
3f7149eb1efdbeba1f6ae3665a66cbef06411442
/vbox-app/src/com/kedzie/vbox/app/AccordianPageTransformer.java
c43e2fb275896c9689dbb0830967bf0d086bd8d1
[]
no_license
zeroyou/VBoxManager
7aa96915c85102c94e06a99b065d65475fbce7cf
a291b442f6de9ea1f8b8e14f75fbbee3fe96729f
refs/heads/master
2020-04-16T10:43:43.398965
2013-07-19T16:02:56
2013-07-19T16:02:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
638
java
package com.kedzie.vbox.app; import com.nineoldandroids.view.ViewHelper; import android.support.v4.view.ViewPager.PageTransformer; import android.view.View; /** * Performs an accordian animation. */ public class AccordianPageTransformer implements PageTransformer { @Override public void transformPage(View view, float position) { ViewHelper.setTranslationX(view, -1*view.getWidth()*position); if(position < 0) ViewHelper.setPivotX(view, 0f); else if(position > 0) ViewHelper.setPivotX(view, view.getWidth()); ViewHelper.setScaleX(view, 1-Math.abs(position)); } }
[ "mark.kedzierski@gmail.com" ]
mark.kedzierski@gmail.com
5ae42db3f8ef53988605a1b13e3f2f636ab0ac7d
4980c68e46747e1d8d156daaf18390c825d23464
/src/main/java/com/yxz/apps/cms/po/hibernate/Car.java
428284c99744c17dd82d158c70caf64d430d9024
[]
no_license
superproxy/car-maintenance-system
5798eb49b86bddb6589ad8d80805ae7a43053bed
2195b9a7834934d5d989017d421377275374d6f7
refs/heads/master
2021-01-22T02:48:14.592754
2015-09-15T15:09:53
2015-09-15T15:09:53
42,527,112
0
0
null
null
null
null
UTF-8
Java
false
false
3,048
java
package com.yxz.apps.cms.po.hibernate; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import java.sql.Timestamp; /** * Created with IntelliJ IDEA. * User: wmj * Date: 13-8-3 * Time: 下午10:37 * To change this template use File | Settings | File Templates. */ @Entity public class Car { private String carCard; private Integer carOwnerId; private String carType; private Timestamp inputTime; private String carOwnerName; @Column(name = "carCard", nullable = false, insertable = true, updatable = true, length = 10, precision = 0) @Id public String getCarCard() { return carCard; } public void setCarCard(String carCard) { this.carCard = carCard; } @Column(name = "carOwnerId", nullable = true, insertable = true, updatable = true, length = 10, precision = 0) @Basic public Integer getCarOwnerId() { return carOwnerId; } public void setCarOwnerId(Integer carOwnerId) { this.carOwnerId = carOwnerId; } @Column(name = "carType", nullable = true, insertable = true, updatable = true, length = 10, precision = 0) @Basic public String getCarType() { return carType; } public void setCarType(String carType) { this.carType = carType; } @Column(name = "InputTime", nullable = true, insertable = true, updatable = true, length = 19, precision = 0) @Basic public Timestamp getInputTime() { return inputTime; } public void setInputTime(Timestamp inputTime) { this.inputTime = inputTime; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Car car = (Car) o; if (carCard != null ? !carCard.equals(car.carCard) : car.carCard != null) return false; if (carOwnerId != null ? !carOwnerId.equals(car.carOwnerId) : car.carOwnerId != null) return false; if (carType != null ? !carType.equals(car.carType) : car.carType != null) return false; if (inputTime != null ? !inputTime.equals(car.inputTime) : car.inputTime != null) return false; return true; } @Override public int hashCode() { int result = carCard != null ? carCard.hashCode() : 0; result = 31 * result + (carOwnerId != null ? carOwnerId.hashCode() : 0); result = 31 * result + (carType != null ? carType.hashCode() : 0); result = 31 * result + (inputTime != null ? inputTime.hashCode() : 0); return result; } @Column(name = "carOwnerName", nullable = true, insertable = true, updatable = true, length = 255, precision = 0) @Basic public String getCarOwnerName() { return carOwnerName; } public void setCarOwnerName(String carOwnerName) { this.carOwnerName = carOwnerName; } }
[ "sharpcoder@qq.com" ]
sharpcoder@qq.com
c57bd89a8e40215ed3ebaa340efbb9cac7a7f030
77d4a51dc57c012ad4c4580cad3083a3150d63e8
/src/main/java/com/ilioadriano/Domain/Presidiario.java
9f4dd9980460add7b052ea354358d0daffb777a2
[]
no_license
iliojunior/code-it-test
bb5f56fa915f7513b6728422fd995f371d8cff38
77f9b6abbe7bc5e284164faa39f41209042b04f1
refs/heads/master
2020-11-24T03:58:51.399666
2019-12-14T02:42:21
2019-12-14T02:42:21
227,955,812
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
package com.ilioadriano.Domain; import com.ilioadriano.Abstract.Tripulante; public class Presidiario extends Tripulante { public Presidiario(String nome) { super(nome); } }
[ "ilioadriano@live.com" ]
ilioadriano@live.com
ae94f03cf0c6ae0d6a63d5625a9b4b54ffb12902
3317b37d7e3493d3dca87720594ef2d6bfbc1fd5
/src/main/java/com/p6/qa/pages/ResourcesPage.java
4f9c546ba6705e447d29aae91840c0dbb08a1de5
[]
no_license
cvaramcse/P6WebTest
124278e19510e6722561f256185d1426afff51e3
52ddc8ec03638b7effedad2c823850b5425d1896
refs/heads/master
2020-12-19T01:50:04.161386
2020-01-22T16:45:53
2020-01-22T16:45:53
235,584,741
0
0
null
null
null
null
UTF-8
Java
false
false
107
java
package com.p6.qa.pages; import com.p6.qa.base.TestBase; public class ResourcesPage extends TestBase{ }
[ "60125568+cvaramcse@users.noreply.github.com" ]
60125568+cvaramcse@users.noreply.github.com
946fdc8ad77b9cdc066d0d07bd713ab33de1f525
323c723bdbdc9bdf5053dd27a11b1976603609f5
/nssicc/nssicc_service/src/main/java/biz/belcorp/ssicc/service/sisicc/impl/InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl.java
528f58e4f3492704fc663770dbd72fa754869f8a
[]
no_license
cbazalar/PROYECTOS_PROPIOS
adb0d579639fb72ec7871334163d3fef00123a1c
3ba232d1f775afd07b13c8246d0a8ac892e93167
refs/heads/master
2021-01-11T03:38:06.084970
2016-10-24T01:33:00
2016-10-24T01:33:00
71,429,267
0
0
null
null
null
null
UTF-8
Java
false
false
3,326
java
package biz.belcorp.ssicc.service.sisicc.impl; import java.util.HashMap; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import biz.belcorp.ssicc.dao.Constants; import biz.belcorp.ssicc.dao.sisicc.InterfazPRYDAO; import biz.belcorp.ssicc.service.SapConnectorService; import biz.belcorp.ssicc.service.sisicc.framework.beans.InterfazParams; import biz.belcorp.ssicc.service.sisicc.framework.exception.InterfazException; import biz.belcorp.ssicc.service.sisicc.framework.impl.BaseInterfazSalidaStoredProcedureAbstractService; /** * Service del envio de datos para la Proyeccion Parcial de la Interfaz PRY. * * @author <a href="">Jose Luis Rodriguez</a> */ @Service("sisicc.interfazPRYEnviarInformacionVentaProyeccionParcialCentroService") @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class) public class InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl extends BaseInterfazSalidaStoredProcedureAbstractService { @Resource(name="sisicc.sapConnectorService") private SapConnectorService sapConnectorService; @Resource(name="sisicc.interfazPRYDAO") private InterfazPRYDAO interfazPRYDAO; /* (non-Javadoc) * @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazSalidaStoredProcedureAbstractService#executeStoreProcedure(java.util.Map) */ protected void executeStoreProcedure(Map params) { interfazPRYDAO.executeEnvioInformacionVentaProyeccionParcialCentro(params); } /* (non-Javadoc) * @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazAbstractService#afterProcessInterfaz(biz.belcorp.ssicc.sisicc.service.framework.beans.InterfazParams) */ protected void afterProcessInterfaz(InterfazParams interfazParams) throws InterfazException { Map result = null; Map inputParams = new HashMap(); Map queryParams = interfazParams.getQueryParams(); String invocarFuncionSAP = MapUtils.getString(queryParams, "invocarFuncionSAP", Constants.NO); String funcionSAP = MapUtils.getString(queryParams, "funcionSAP"); String nombreParametro = MapUtils.getString(queryParams, "nombreParametro"); String valorParametro = MapUtils.getString(queryParams, "valorParametro"); // Validamos si el parametro que determina si se invoca o no a SAP esta activo if (StringUtils.equals(invocarFuncionSAP, Constants.SI)) { if (log.isDebugEnabled()) { log.debug("Invocando a la funcion SAP: " + funcionSAP); log.debug(nombreParametro + "=" + valorParametro); } if(StringUtils.isNotBlank(nombreParametro)) { inputParams.put(nombreParametro, valorParametro); } try { result = sapConnectorService.execute(funcionSAP, inputParams, null); } catch (Exception e) { log.warn(e.getMessage()); throw new InterfazException(e.getMessage()); } if (log.isDebugEnabled()) { log.debug("result SAP=" + result); } } else { log.info("La interfaz esta configurada para NO invocar a la funcion SAP"); } } }
[ "cbazalarlarosa@gmail.com" ]
cbazalarlarosa@gmail.com
c42801118d62f634473aceb616c287925b6f35c6
ea6fb26b1f99762edeb51c86dde7a853c9b66f17
/src/main/java/driver/Driver.java
2df0989399f53aaf63c52adcdcfc79e69d4504c7
[]
no_license
nurdan-turan/ImageCount
e98443f7603c537f4cd0be3b7a816e4dba228468
f971900a9dcb87b31a99c059c7873d0755b79718
refs/heads/master
2023-07-18T23:28:34.676436
2021-09-17T19:39:19
2021-09-17T19:39:19
382,595,885
1
0
null
null
null
null
UTF-8
Java
false
false
806
java
package driver; import com.thoughtworks.gauge.AfterSuite; import com.thoughtworks.gauge.BeforeSuite; import org.openqa.selenium.WebDriver; //import org.testng.annotations.AfterSuite; //import org.testng.annotations.BeforeSuite; public class Driver { // Holds the WebDriver instance public static WebDriver webDriver; // Initialize a webDriver instance of required browser // Since this does not have a significance in the application's business domain, the BeforeSuite hook is used to instantiate the webDriver @BeforeSuite public void initializeDriver(){ webDriver = DriverFactory.getDriver(); webDriver.manage().window().maximize(); } // Close the webDriver instance @AfterSuite public void closeDriver(){ webDriver.quit(); } }
[ "nurdanturan97@gmail.com" ]
nurdanturan97@gmail.com
edb5e34ab2d195fbd0695b8472b00e251a6af813
32ca19ca241bb75292abf08f0b935c26fe07d9c4
/src/main/java/spring/spring_web_service/web/dto/PostsSaveRequestDto.java
015596f04bec58500664027f38742ce70b59ccfc
[]
no_license
JMine97/spring_web_service
dc0bcb100303ac13c82430759a0dd3290c5edc76
f281cb0ddb0a76632a8b75f296f0e4bac62543d4
refs/heads/master
2023-04-27T17:16:23.393239
2021-04-30T10:13:55
2021-04-30T10:13:55
347,047,114
0
0
null
null
null
null
UTF-8
Java
false
false
691
java
package spring.spring_web_service.web.dto; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import spring.spring_web_service.domain.posts.Posts; @Getter @NoArgsConstructor public class PostsSaveRequestDto { private String title; private String content; private String author; @Builder public PostsSaveRequestDto(String title, String content, String author){ this.title=title; this.content=content; this.author=author; } public Posts toEntity(){ return Posts.builder() .title(title) .content(content) .author(author) .build(); } }
[ "chlwjdals98@gmail.com" ]
chlwjdals98@gmail.com
c32d267ff2b41228f94d9341eaed6b969454820d
7596caa6006b6fdee3531c7ce16f450771012487
/src/test/java/services/BroadcastAdminServiceTest.java
f76d48e6fc3cba3fbf419aab5c75aebea5991784
[]
no_license
DaviidGilB/dp2-fourth-project
354c077f7c5b71e505e5d325970b8fe68f3514c5
0d23f35c13329c43ef4ba991a0ec295b43e8259d
refs/heads/master
2022-08-09T01:07:00.809266
2019-06-30T14:23:59
2019-06-30T14:23:59
194,524,754
0
0
null
2022-07-07T22:53:26
2019-06-30T14:23:20
Java
UTF-8
Java
false
false
4,821
java
package services; import java.util.Date; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import utilities.AbstractTest; import domain.Actor; import domain.Message; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:spring/junit.xml" }) @Transactional public class BroadcastAdminServiceTest extends AbstractTest { @Autowired private MessageService messageService; @Autowired private AdminService adminService; @Autowired private ActorService actorService; /** * We are going to test Requirement 24.1 * * 24. An actor who is authenticated as an administrator must be able to: * * 1. Broadcast a message to all actors * */ /** * Coverage: In broadcastMessage, we have the positive case and the Assert to * check that you are logged as admin The Message constrains are checked in * SendMessageTest Positive tes + Constratins = 2 Total test = 3 Coverage = 3/2 * = 1.5 = 150% */ /** * Sentence Coverage: * AdminService: 14.4% * */ @Test public void driverUpdateMessage() { Object testingData[][] = { { // Positive test "admin1", "admin1", "subject", "body", null }, { // Negative test, broadcasting with a non admin actor "member1", "member1", "subject", "body", IllegalArgumentException.class }, { // Negative test, not logged actor "", "member1", "subject", "body", IllegalArgumentException.class } }; for (int i = 0; i < testingData.length; i++) this.templateSendMessage((String) testingData[i][0], (String) testingData[i][1], (String) testingData[i][2], (String) testingData[i][3], (Class<?>) testingData[i][4]); } protected void templateSendMessage(String username, String usernameVerification, String subject, String body, Class<?> expected) { Class<?> caught = null; try { // En cada iteracion comenzamos una transaccion, de esta manera, no se toman // valores residuales de otros test this.startTransaction(); super.authenticate(username); Date thisMoment = new Date(); thisMoment.setTime(thisMoment.getTime() - 1000); Message message = this.messageService.create(); Actor sender = this.actorService.getActorByUsername(usernameVerification); Actor receiverActor = this.actorService.getActorByUsername(usernameVerification); message.setMoment(thisMoment); message.setSubject(subject); message.setBody(body); message.setReceiver(receiverActor.getUserAccount().getUsername()); message.setSender(sender.getUserAccount().getUsername()); this.adminService.broadcastMessage(message); this.messageService.flush(); super.authenticate(null); } catch (Throwable oops) { caught = oops.getClass(); } finally { // Se fuerza el rollback para que no de ningun problema la siguiente iteracion this.rollbackTransaction(); } super.checkExceptions(expected, caught); } /** * We are going to test Requirement 4.1 * * 4.An actor who is authenticated as an administrator must be able to: * 1.Run a procedure to notify the existing users of the rebranding. The system must guarantee that the process is run only once. * */ /** * Coverage: BroadcastRebrandingTest Positive test + Constraints = 2 Total test = 2 Coverage = 2/2 = 100% * Data coverage: 92.9% */ @Test public void driverBroadcastRebranding() { Object testingData[][] = { // Positive test { "admin1", null }, // Negative test: Trying to send a broadcast rebranding with a different role { "company1", IllegalArgumentException.class } }; for (int i = 0; i < testingData.length; i++) this.templateBroadcastRebranding((String) testingData[i][0], (Class<?>) testingData[i][1]); } private void templateBroadcastRebranding(String username, Class<?> expected) { Class<?> caught = null; try { this.startTransaction(); this.authenticate(username); Message message = this.messageService.create(); message.setBody( "We inform that we changed our name from 'Acme-Hacker-Rank' to 'Acme-Rookie' for legal reasons/ Se informa que nuestra empresa ha pasado de llamarse 'Acme-Hacker-Rank' a 'Acme-Rookie' por temas legales."); message.setSubject("REBRANDING NOTIFICATION / NOTIFICACION DE CAMBIO DE NOMBRE"); message.setTags("NOTIFICATION, SYSTEM, IMPORTANT"); this.adminService.broadcastMessageRebranding(message); } catch (Throwable oops) { caught = oops.getClass(); } super.checkExceptions(expected, caught); this.unauthenticate(); this.rollbackTransaction(); } }
[ "davidgil.univ@gmail.com" ]
davidgil.univ@gmail.com
3985319dc421c0773980fc3bbbec77fc66d970ae
29f78bfb928fb6f191b08624ac81b54878b80ded
/SPGenerator/lib/ca.uwaterloo.gp_.fmp_0.7.0/src/ca/uwaterloo/gp/fmp/system/NodeIdDictionary.java
1fc8a8ee5faad131247d0effebf12bcc0ed54347
[]
no_license
MSPL4SOA/MSPL4SOA-tool
8a78e73b4ac7123cf1815796a70f26784866f272
9f3419e416c600cba13968390ee89110446d80fb
refs/heads/master
2020-04-17T17:30:27.410359
2018-07-27T14:18:55
2018-07-27T14:18:55
66,304,158
0
1
null
null
null
null
UTF-8
Java
false
false
6,934
java
/************************************************************************************** * Copyright (c) 2005, 2006 Generative Software Development Lab, University of Waterloo * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * 1. Generative Software Development Lab, University of Waterloo, * http://gp.uwaterloo.ca - initial API and implementation **************************************************************************************/ package ca.uwaterloo.gp.fmp.system; import java.util.Dictionary; import java.util.Hashtable; import java.util.Iterator; import ca.uwaterloo.gp.fmp.Feature; import ca.uwaterloo.gp.fmp.Node; /** * Michal: NodeIdDictionary is always recreated when FmpEditor loads the model (regardless if the model * was just created by new model wizard or is an existing model). * * Keeping the model and the NodeIdDictionary synchronized: * 1. create element * compute new id within the context. For feature, from name; for others use reference* and featureGroup* * (with suffixes). Update NodeIdDictionary. * 2. remove element * remove ids of the element, of all its children and of all its configurations from the NodeIdDictionary * 3. move element * a) within the tree of the same root -> do nothing, * b) to other tree -> remove element and than create it in the new location. * 4. clone feature * see. create element * 5. manually change id of element * remove element from dictionary, reinsert with new id. * update id of all 'confs' of element (synchronize change, otherwise rules won't work) * * @author Chang Hwan Peter Kim <chpkim@swen.uwaterloo.ca>, * Michal Antkiewicz <mantkiew@swen.uwaterloo.ca> */ public class NodeIdDictionary { public static NodeIdDictionary INSTANCE = new NodeIdDictionary(); // used to append numbers to generate the next id public static final String DELIMITER = "_"; protected long currentId = 0; protected Dictionary dictionary = new Hashtable(); public Dictionary getRootDictionary(Feature rootFeature) { Dictionary rootDictionary = (Dictionary)dictionary.get(rootFeature); if(rootDictionary == null) { rootDictionary = new Hashtable(); dictionary.put(rootFeature, rootDictionary); } return rootDictionary; } public void putRootDictionary(Feature rootFeature, Dictionary rootDictionary) { dictionary.put(rootFeature, rootDictionary); } public Node getNode(Feature rootFeature, String id) { // Get the dictionary associated with the rootFeature (an id belongs to the dictionary of a given root) Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); return (Node)rootFeatureDictionary.get(id); } public void putNode(Feature rootFeature, String id, Node node) { Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); rootFeatureDictionary.put(id, node); } public String getNextAvailableId(String id, Node node) { // Below code doesn't work because _ is not recognized by XPath scanner //StringTokenizer st = new StringTokenizer(id, DELIMITER); //String newId = st.nextToken() + DELIMITER + String.valueOf(currentId++); String newId = null; int indexOfDigit = -1; for(int i = 0; i < id.length(); i++) { if(id.substring(i).matches("\\d{" + String.valueOf(id.length()-i) + "}")) { indexOfDigit = i; break; } } // if integer was found at the end, take it and replace it by adding 1 to it if(indexOfDigit != -1) newId = id.substring(0, indexOfDigit) + String.valueOf(Integer.parseInt(id.substring(indexOfDigit))+1); // otherwise, append a number at the end else newId = id + "0"; return newId; } public void visit(Node node) { visit(null, node); } public void visit(String prefix, Node node) { if (node == null) throw new IllegalArgumentException("NodeIdDictionary.visit(): node must not be null"); Feature rootFeature = ModelNavigation.INSTANCE.navigateToRootFeature(node); // TODO: maybe we should put IDs on features above root features if(rootFeature != null) { Dictionary rootFeatureDictionary = getRootDictionary(rootFeature); // Get an id that can be used in the construction of propositional formula String newId = ModelManipulation.INSTANCE.getValidId((prefix != null? prefix : "") + node.getId()); // there is a node in the dictionary while((Node)rootFeatureDictionary.get(newId) != null) newId = NodeIdDictionary.INSTANCE.getNextAvailableId(newId, node); node.setId(newId); rootFeatureDictionary.put(newId, node); } for(Iterator nodeChildren = node.getChildren().iterator(); nodeChildren.hasNext();) visit(prefix, (Node)nodeChildren.next()); if(node instanceof Feature) { for(Iterator configurationsIterator = ((Feature)node).getConfigurations().iterator(); configurationsIterator.hasNext();) visit(prefix, (Feature)configurationsIterator.next()); } } // /** // * Returns an id generated from a name - removes illegal characters // * @param string // * @return // */ // public String getIdForName(String name) { // String id = ""; // // for(int i = 0; i < name.length(); i++) // { // if(Character.isLetterOrDigit(name.charAt(i))) // id += name.substring(i, i+1); // } // // if(id.length() > 0) // { // // first character cannot be a digit // if(Character.isDigit(id.charAt(0))) // id = "a" + id; // } // else // id = "feature"; // // return id.substring(0,1).toLowerCase() + id.substring(1); // } // /** // * Michal: removes non-alphanumeric characters and // * ensures name doesn't start with a digit // */ // public String getJavaNameForName(String name) { // StringBuffer newName = new StringBuffer(); // // for(int i = 0; i < name.length(); i++) { // char c = name.charAt(i); // if(Character.isLetterOrDigit(c)) // newName.append(c); // else if (Character.isWhitespace(c)) // newName.append('_'); // } // // if(newName.length() > 0) { // // first character cannot be a digit // if(Character.isDigit(newName.charAt(0))) // newName.insert(0, '_'); // } // else // newName.append("feature"); // return newName.toString(); // } /** * Michal: remove existing dictionaries for the root feature and all of its configurations * @param rootFeature */ public void removeDictionaries(Feature rootFeature) { putRootDictionary(rootFeature, new Hashtable()); for (Iterator i = rootFeature.getConfigurations().iterator(); i.hasNext(); ) removeDictionaries((Feature) i.next()); } }
[ "akram.kamoun@gmail.com" ]
akram.kamoun@gmail.com
d796b007012cf93008f36e643c6379726f807005
92d229534cf099a97ecfc780105c66fcc305fcf6
/src/main/java/org/agilewiki/incdes/PAInteger.java
959721c34e407ed2854a6931f4436b631a4d7d00
[]
no_license
x-jv/JAOsgi
259598cff4626aacb66d37f231311a4824ec0077
11499f4ec62b4b21a867207e7d8d0a835e41e629
refs/heads/master
2021-01-21T03:02:59.681184
2013-04-18T02:35:10
2013-04-18T02:35:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package org.agilewiki.incdes; import org.agilewiki.pactor.Request; public interface PAInteger extends IncDes { Request<Integer> getIntegerReq(); Integer getValue(); Request<Void> setIntegerReq(final Integer _v); void setValue(final Integer _v) throws Exception; }
[ "laforge49@gmail.com" ]
laforge49@gmail.com
b1fb5ade128559498a55c2fa047eb2a2b0e544f3
d215d8ca2fa3ed88946f59ef935df273069df6a0
/src/gz/itcast/biz/admin/type/dao/TypeDaoImpl.java
788e75e7c5ba545bea3a6be927776e25c6bd27e2
[]
no_license
CodeRabbit-G/bookstore
6d4e281329c5d50853e39e421bc6da1761360ddc
572e6eba397e1d7c95beaeea7da984183aa3aea4
refs/heads/master
2023-03-18T02:50:06.741765
2021-03-11T04:06:05
2021-03-11T04:06:05
346,573,529
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,187
java
package gz.itcast.biz.admin.type.dao; import gz.itcast.entity.Types; import gz.itcast.util.BaseDao; import gz.itcast.util.JdbcUtil; import java.sql.SQLException; import java.util.List; import java.util.UUID; import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.handlers.BeanListHandler; public class TypeDaoImpl extends BaseDao<Types> implements TypeDao { public List<Types> queryTypes(){ try { String sql = "select * from types"; QueryRunner run = new QueryRunner(JdbcUtil.getDataSource()); List<Types> types = (List<Types>)run.query(sql,new BeanListHandler(Types.class)); return types; } catch (SQLException e) { e.printStackTrace(); throw new RuntimeException(e); } } /** * Ìí¼Ó·ÖÀà */ public Types add(Types types){ try { String sql = "insert into types(id,name,descr) values(?,?,?)"; types.setId(UUID.randomUUID().toString().replace("-", "")); QueryRunner run = new QueryRunner(JdbcUtil.getDataSource()); run.update(sql,new Object[]{types.getId(),types.getName(),types.getDescr()}); return types; } catch (SQLException e) { e.printStackTrace(); throw new RuntimeException(e); } } }
[ "gsy971204@126.com" ]
gsy971204@126.com
6f5b4e349e5ac0f687ce68d3ba39ceacc87e20eb
a4f182c714397b2097f20498497c9539fa5a527f
/app/src/main/java/com/lzyyd/hsq/transform/BannerTransform.java
fd35c282d0d4833765f8ee8bfd222ef9837a99d5
[]
no_license
lilinkun/lzy
de36d9804603c293ffcb62c64c50afea88679192
80a646a16cf605795940449108fd848c0b0ecd17
refs/heads/master
2023-02-19T06:15:51.089562
2021-01-13T08:52:30
2021-01-13T08:52:30
288,416,310
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.lzyyd.hsq.transform; import android.view.View; import com.xw.banner.transformer.ABaseTransformer; /** * Create by liguo on 2020/7/15 * Describe: */ public class BannerTransform extends ABaseTransformer { @Override protected void onTransform(View page, float position) { } @Override protected boolean isPagingEnabled() { return true; } }
[ "294561531@qq.com" ]
294561531@qq.com
16e47ee02f2780afc8322b2134f3fdc63f5ffc68
cfc3cdad47e5de2f525842647f0186c3e6737327
/app/src/main/java/com/ysdc/coffee/exception/WrongEmailException.java
a53441a0d4aced01eafec4b10f2c09bda80c5eda
[]
no_license
djohannot/android-coffee-pf
3cb6c3da06bb0bdac0b2c2b1306145a19ea875b4
9b3a68c5c3acd9bf9220378beeb4199e328a6719
refs/heads/master
2020-03-29T03:48:13.892140
2018-09-23T11:34:29
2018-09-23T11:34:29
149,501,428
0
0
null
2018-09-23T11:34:30
2018-09-19T19:26:01
Java
UTF-8
Java
false
false
91
java
package com.ysdc.coffee.exception; public class WrongEmailException extends Exception { }
[ "david.johannot@proertyfinder.ae" ]
david.johannot@proertyfinder.ae
1ef19b20c512a3fbde948f0b4c610c8c95a91f6f
2da3812e8ab5535300a8e0318c65687709132f7e
/day19/src/com/atguigu/java1/URLTest1.java
ee2e7a23f4c8a00bb22a3b23b81eb7af5bb7b2b5
[]
no_license
BMDACMER/javase
307385e2d0541293c96a091fbeb7486ba5c6ad15
3f396cfdc83a93894e27bf622086b865d658f10d
refs/heads/master
2021-01-06T13:59:46.136704
2020-03-16T06:29:39
2020-03-16T06:29:39
241,508,025
4
1
null
null
null
null
UTF-8
Java
false
false
1,557
java
package com.atguigu.java1; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class URLTest1 { public static void main(String[] args) { HttpURLConnection urlConnection = null; InputStream is = null; FileOutputStream fos = null; try { URL url = new URL("http://localhost:8080/examples/beauty.jpg"); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.connect(); is = urlConnection.getInputStream(); fos = new FileOutputStream("day19\\beauty3.jpg"); byte[] buffer = new byte[1024]; int len; while((len = is.read(buffer)) != -1){ fos.write(buffer,0,len); } System.out.println("下载完成"); } catch (IOException e) { e.printStackTrace(); } finally { //关闭资源 if(is != null){ try { is.close(); } catch (IOException e) { e.printStackTrace(); } } if(fos != null){ try { fos.close(); } catch (IOException e) { e.printStackTrace(); } } if(urlConnection != null){ urlConnection.disconnect(); } } } }
[ "1163753605@qq.com" ]
1163753605@qq.com
bde8ec802581340f2c0005d6d9f71e076a03fce1
a4362e54260c3bdb6cc38a3e540377a0b5320b1e
/app/src/main/java/com/arhamtechnolabs/homesalonapp/ui/send/SendViewModel.java
84f1cdd8696874bf194b24f8aff6fad2270132cf
[]
no_license
mobileapp2/HomeSalonApp
b7c8e147e1b080b24ad76bf755a9e9b6aef84dda
c6d329b87848f596468612b01af9584ca5eb7822
refs/heads/master
2022-04-05T16:56:28.028590
2020-02-21T14:43:48
2020-02-21T14:43:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package com.arhamtechnolabs.homesalonapp.ui.send; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class SendViewModel extends ViewModel { private MutableLiveData<String> mText; public SendViewModel() { mText = new MutableLiveData<>(); mText.setValue("This is send fragment"); } public LiveData<String> getText() { return mText; } }
[ "adarshagrawal38@gmail.com" ]
adarshagrawal38@gmail.com
e49b7b1998169115884b21fb84568ceb253f33b6
f8e7cd7d5367bf6fd34985bbb387315783d744b2
/src/test/java/org/jusecase/poe/gateways/ResourceItemGatewayTest.java
b72f9b2879eb2aa32a35562e1c1c4319d65a127b
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
iCodeIN/poe-stash-buddy
eb6a263e8468ae840d9dea6f319e74824fcd67ec
a2ecc1dc773afbd37f1bbd723857ed2b83ba0910
refs/heads/master
2023-03-11T16:10:38.511421
2021-02-19T00:28:09
2021-02-19T00:28:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,595
java
package org.jusecase.poe.gateways; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.jusecase.inject.ComponentTest; import org.jusecase.poe.entities.Item; import org.jusecase.poe.entities.ItemType; import org.jusecase.poe.plugins.ImageHashPlugin; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; class ResourceItemGatewayTest implements ComponentTest { ResourceItemGateway gateway; private ImageHashPlugin imageHashPlugin; @BeforeEach void setUp() { givenDependency(imageHashPlugin = new ImageHashPlugin()); gateway = new ResourceItemGateway(); } @Test void currenciesAreLoadedFromResources() { List<Item> currencies = gateway.getAll(); assertThat(currencies.size()).isEqualTo(55 + 1 + 104 + 2 * 156 + 15); assertThat(currencies.get(0).imageHash.features).isNotEmpty(); assertThat(currencies.get(0).imageHash.colors1).isNotEmpty(); assertThat(currencies.get(0).imageHash.colors2).isNotEmpty(); assertThat(currencies.get(0).type).isEqualTo(ItemType.CURRENCY); assertThat(currencies.get(55).type).isEqualTo(ItemType.CARD); assertThat(currencies.get(55 + 1).type).isEqualTo(ItemType.ESSENCE); assertThat(currencies.get(55 + 1 + 104).type).isEqualTo(ItemType.MAP); assertThat(currencies.get(55 + 1 + 104 + 2 * 156).type).isEqualTo(ItemType.FRAGMENT); } @Test void noItemConflicts() { SoftAssertions s = new SoftAssertions(); List<Item> allItems = gateway.getAll(); for (int i = 0; i < allItems.size(); ++i) { Item item = allItems.get(i); for (int j = i + 1; j < allItems.size(); ++j) { Item otherItem = allItems.get(j); if (item.type != otherItem.type) { String assertDescription = ""; boolean similar = imageHashPlugin.isSimilar(item.imageHash, otherItem.imageHash); if (similar) { assertDescription = "expecting " + item + " not to be similar to item " + otherItem + "\n" + imageHashPlugin.describeDistance(item.imageHash, otherItem.imageHash); } s.assertThat(similar).describedAs(assertDescription).isFalse(); } } } s.assertAll(); } @Test void scrollOfWisdom() { Item scrollOfWisdom = gateway.getScrollOfWisdom(); assertThat(scrollOfWisdom).isNotNull(); } }
[ "andy@mazebert.com" ]
andy@mazebert.com
f90e8c25f32dc641292a32bb4c783e7d5de58aec
29b8180c1f07558121ec8c326e8ea45ed8161d26
/1904-april1-java-master/Week1Java/1904Week1Examples/src/com/revature/accessmod2/Driver.java
50fbd1b18fdd0869f8cc7999a56fee842e18db33
[]
no_license
renjika19/shiny-carnival
0711331d5b7e6592469730522310f0908267e160
9e4cec694017b595da5f56d36ee9631609a247fd
refs/heads/master
2023-06-04T03:48:40.184331
2021-06-14T17:58:58
2021-06-14T17:58:58
376,877,606
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.revature.accessmod2; import com.revature.accessmod1.Modifiers; public class Driver extends Modifiers{ public static void main(String[] args) { Modifiers mod = new Modifiers(); System.out.println("==ACCESSING FIELDS==="); System.out.println(mod.pub); System.out.println(Modifiers.stat); // System.out.println(mod.def); //different package, not ok // System.out.println(mod.priv);// different class, not ok Driver driver = new Driver(); System.out.println(driver.pub); System.out.println(driver.prot);// child class, so ok } }
[ "f.opesanmi@gmail.com" ]
f.opesanmi@gmail.com
50530c324c3f9de0c93afdcd47a3ad85ca406ed6
6143527a45c18cea6ce3d6070ef8580d45a14486
/app/src/main/java/dark/ash/com/soulmusicplayer/utils/TimeUtils.java
1432bbd06154446e56317275c4c96f4740132bec
[]
no_license
Krrish0/SoulMusic_Player
d64b4fd14211133bb88ab82ce7b112c98bacf041
fe6d6f30eb47740e380accedb9c6c812c98b97c4
refs/heads/master
2020-03-17T19:01:36.707210
2018-05-22T10:49:35
2018-05-22T10:49:35
133,843,328
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package dark.ash.com.soulmusicplayer.utils; import java.util.concurrent.TimeUnit; /** * Created by hp on 24-03-2018. */ public class TimeUtils { public static String longToTime(long time) { long min = TimeUnit.MILLISECONDS.toMinutes(time); long sec = TimeUnit.MILLISECONDS.toSeconds(time) % 60; String dateString = min + ":" + sec; return dateString; } }
[ "roykrrish0@gmail.com" ]
roykrrish0@gmail.com
1089b4c69647bf9a22e6cca186a072cac7889369
b1438ac3bd20ed76f36efa072b7b69fc6a2d4cb9
/Peak Element.java
0c150a223b91ca6915ca83da82543663a92f8977
[]
no_license
Sumesh-H/Binary-Search-2
13d031825efc22445c979c3c800bbd569aa7ad60
4d5b5bbc0ff675f8aecdfc0fc11ecd67307a6700
refs/heads/master
2022-09-28T19:41:44.261160
2020-05-29T03:12:52
2020-05-29T03:12:52
267,346,489
0
0
null
2020-05-27T14:47:42
2020-05-27T14:47:41
null
UTF-8
Java
false
false
893
java
// Time Complexity : O(log n) where n is the size of the input array // Space Complexity : O(1) // Did this code successfully run on Leetcode : Yes // Any problem you faced while coding this : No // Your code here along with comments explaining your approach // Followed the lecture class Solution { public int findPeakElement(int[] nums) { //edge if(nums == null || nums.length == 0) return -1; int low = 0; int high = nums.length - 1; while (low <= high){ int mid = low + (high - low)/2; if((mid == 0 || nums[mid] > nums [mid-1]) && (mid == nums.length - 1 || nums[mid] > nums [mid +1])){ return mid; } else if (mid > 0 && nums[mid - 1] > nums[mid]){ high = mid - 1; }else { low = mid + 1; } } return -1; } }
[ "harale.s@husky.neu.edu" ]
harale.s@husky.neu.edu
a754216478f73d1f7a65216094cfad4ada3d9538
7f449f276ba74d8bed143e9c41f3d189677075eb
/Java/src/main/java/queue/QueueImp.java
aa9cb6ea633f4ffb10ee429afe002d17c5a04393
[]
no_license
jsphdnl/Algorithms
1c8821d49a5adb0dbeca69d0af5e434495c7089b
dfc669587fffddb93c566848fdfd2c80280ac6af
refs/heads/master
2020-04-06T07:06:15.770675
2016-08-07T06:37:47
2016-08-07T06:37:47
64,687,718
2
2
null
2016-08-27T12:55:36
2016-08-01T17:32:10
Java
UTF-8
Java
false
false
662
java
package queue; import doublylinkedlist.DoublyLinkedList; /** * Created by mamu on 8/4/16. */ public class QueueImp<T> implements Queue<T> { private DoublyLinkedList<T> queue; private int size; public QueueImp() { queue = new DoublyLinkedList<>(); size = 0; } @Override public int size() { return size; } @Override public T dequeue() { T data = null; if (size != 0){ data = queue.removeAtHead(); size --; } return data; } @Override public void enqueue(T data) { queue.addAtHead(data); size++; } @Override public boolean isEmpty() { return size == 0 ? true : false; } }
[ "jsphdnl@gmail.com" ]
jsphdnl@gmail.com
90743b318f8e3bc5577bf77a3d7b18e7021b6652
a2156f6ad8ea698a86bfcc1d4ae36e82e0b75070
/src/test/java/algoritms/SortableTest.java
8b1c9b01ec2b973fb3dacd1dcc0b108bdbe6edd9
[]
no_license
OlegMaksimov/algoritms
cf07d5312957ac93ed0e97758d70b17a281bfd41
ac037ebb4f3070a153588849fc858a4d1e963b7b
refs/heads/master
2022-12-06T12:56:13.193490
2020-08-22T15:28:29
2020-08-22T15:28:29
282,472,313
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package algoritms; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class SortableTest { int[] arr; @Before public void setUp() throws Exception { arr = generate(2); } @Test public void swap() { Shaker shaker = new Shaker(arr); System.out.println(shaker.toString(arr)); shaker.swap(arr, 0, 1); System.out.println(shaker.toString(arr)); } private static int[] generate(int size) { int[] arr = new int[size]; for (int i = 0; i < size; i++) { arr[i] = (int) Math.round(Math.random() * 100); } return arr; } }
[ "Maksimov.O.E@sberbank.ru" ]
Maksimov.O.E@sberbank.ru
80b5584c2414d7af6cab8b83a3750ca9cd107e05
d1adda5fbe3d830d508a31d4701cd1075c82fab7
/task4/src/Task4.java
a5a7dcb12eff356c990f552cdc176b301b12adf8
[]
no_license
Scalpel87/PerformanceLab
b4e24d4a1f943223705f49a99b643be2956e58f9
6597ce46b9692e1c0e6565e32521beae290e28c9
refs/heads/master
2023-07-03T14:07:57.455986
2021-08-12T17:38:11
2021-08-12T17:38:11
394,203,777
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; public class Task4 { public static void main(String[] args) throws IOException { if (args.length == 0) args = new String[]{"c://1.txt"}; BufferedReader reader = new BufferedReader(new FileReader(args[0])); ArrayList<Integer> num = new ArrayList<Integer>(); while (reader.ready()){ num.add(Integer.parseInt(reader.readLine()));//Строки файла должны иметь вид: "4" } ArrayList<Integer> count = new ArrayList<Integer>(); for (int i = 0; i < num.size(); i++) { int tempc = 0; for (int j = 0; j < num.size(); j++) { if (i != j) tempc += Math.abs(num.get(i) - num.get(j)); } count.add(tempc); } Collections.sort(count); System.out.println(count.get(0)); } }
[ "72673135+Scalpel87@users.noreply.github.com" ]
72673135+Scalpel87@users.noreply.github.com
8353d1cbd2da4ea2918347c7a05237f1941c720b
61775d5ab720aaba9280f8bd3cc327498c10d96e
/src/com.mentor.nucleus.bp.debug.ui/src/com/mentor/nucleus/bp/debug/ui/BPLineBreakpointAdapter.java
6247df5f81deb69fd92457d9aad320f5066b92e5
[ "Apache-2.0" ]
permissive
NDGuthrie/bposs
bf1cbec3d0bd5373edecfbe87906417b5e14d9f1
2c47abf74a3e6fadb174b08e57aa66a209400606
refs/heads/master
2016-09-05T17:26:54.796391
2014-11-17T15:24:00
2014-11-17T15:24:00
28,010,057
1
0
null
null
null
null
UTF-8
Java
false
false
5,192
java
//======================================================================== // //File: $RCSfile$ //Version: $Revision$ //Modified: $Date$ // //(c) Copyright 2006-2014 by Mentor Graphics Corp. All rights reserved. // //======================================================================== // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations under // the License. //======================================================================== // package com.mentor.nucleus.bp.debug.ui; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.ILineBreakpoint; import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchPart; import com.mentor.nucleus.bp.debug.ui.model.BPLineBreakpoint; import com.mentor.nucleus.bp.ui.text.activity.ActivityEditor; /** * Adapter to create breakpoints. */ public class BPLineBreakpointAdapter implements IToggleBreakpointsTarget { /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { ActivityEditor textEditor = getEditor(part); if (textEditor != null) { IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IFile.class); ITextSelection textSelection = (ITextSelection) selection; int lineNumber = textSelection.getStartLine(); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IBPDebugUIPluginConstants.PLUGIN_ID); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (resource.equals(breakpoint.getMarker().getResource())) { if (((ILineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1)) { // remove breakpoint.delete(); return; } } } // create line breakpoint (doc line numbers start at 0) int validLine = BPLineBreakpoint.getValidLine(resource, lineNumber + 1); if ( validLine != -1 ) { BPLineBreakpoint lineBreakpoint = new BPLineBreakpoint(resource, validLine); DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint); } } } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) { return getEditor(part) != null; } /** * Returns the editor being used to edit an activity, associated with the * given part, or <code>null</code> if none. * * @param part workbench part * @return the editor being used to edit an activity, associated with the * given part, or <code>null</code> if none */ private ActivityEditor getEditor(IWorkbenchPart part) { if (part instanceof ActivityEditor) { ActivityEditor editorPart = (ActivityEditor) part; IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IFile.class); if (resource != null) { return editorPart; } } return null; } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) { return false; } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException { } /* (non-Javadoc) * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) */ public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) { return false; } }
[ "keith_brown@mentor.com" ]
keith_brown@mentor.com
be1852cfc3d659913e08bfe139f68eb970ec58e1
87b03b6b4a838ffa57dd118bbceb58553de23ccd
/WhereaboutTest/src/jp/yattom/android/whereabout/test/MainActivityTest.java
4c1823524ac686dbb0e9d8c26ca09c755a30056c
[ "MIT" ]
permissive
yattom/whereabout
7f622fb7ca1f8e79b6082c4b2055dc4b751f8678
1b66e15974ca5d33c55a8b926cae7e231cce7e32
refs/heads/master
2016-08-05T03:54:39.698993
2013-09-10T05:58:40
2013-09-10T05:58:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package jp.yattom.android.whereabout.test; import jp.yattom.android.whereabout.MainActivity; import android.content.Intent; import android.test.ActivityUnitTestCase; public class MainActivityTest extends ActivityUnitTestCase<MainActivity> { public MainActivityTest() { super(MainActivity.class); } public void test起動する() { Intent intent = new Intent(); startActivity(intent, null, null); assertNotNull(getActivity()); assertFalse(isFinishCalled()); } }
[ "tsutomu.yasui@gmail.com" ]
tsutomu.yasui@gmail.com
4218086ac64cd529aab727304e2deb93d62dce15
58c4089b2c2d5b20928ca708e92be1df724b115f
/src/main/java/com/k10ud/certs/IItemDumper.java
bff77d07353c3e0927ae1d31129ea037c8237880
[ "MIT" ]
permissive
antik10ud/xray509
a5a944fe342be6cb9084debd9419c0f1bc78dd7b
b10864d47ce772eb2be96e0b8a2fbd92a3c30abf
refs/heads/master
2021-11-28T06:23:05.447677
2021-11-22T11:57:03
2021-11-22T11:57:03
218,955,027
4
0
MIT
2021-11-22T11:35:54
2019-11-01T09:28:08
Java
UTF-8
Java
false
false
1,245
java
/* * Copyright (c) 2019 David Castañón <antik10ud@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.k10ud.certs; public interface IItemDumper { String toString(byte[] src,Item item); }
[ "dcastannon@safecreative.org" ]
dcastannon@safecreative.org
795870158ee0bca8e800b82ead59190379571835
8fd83cd38a3869091f39ccf3e97adf799314adfe
/src/main/java/org/apache/hadoop/hive/solr/SolrStorageHandler.java
9bde11fc6a9ef7884db00245beee58e544beaac8
[ "Apache-2.0" ]
permissive
amitjaspal/solr-storagehandler
15bac5df59c1e7e1952b4cfbc152c164c31c984c
2fc0981ac06eebe41df3afb5f7d44d95c323ea44
refs/heads/master
2021-01-10T19:27:11.455694
2014-08-22T22:59:14
2014-08-22T22:59:14
24,241,657
4
1
null
null
null
null
UTF-8
Java
false
false
4,427
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 org.apache.hadoop.hive.solr; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.metastore.HiveMetaHook; import org.apache.hadoop.hive.ql.index.IndexPredicateAnalyzer; import org.apache.hadoop.hive.ql.index.IndexSearchCondition; import org.apache.hadoop.hive.ql.metadata.HiveStorageHandler; import org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler; import org.apache.hadoop.hive.ql.plan.ExprNodeDesc; import org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc; import org.apache.hadoop.hive.ql.plan.TableDesc; import org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider; import org.apache.hadoop.hive.serde2.Deserializer; import org.apache.hadoop.hive.serde2.SerDe; import org.apache.hadoop.mapred.InputFormat; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.OutputFormat; import org.apache.log4j.Logger; /* * SolrStorageHandler implements HiveStorageHandler, HiveStoragePredicateHandler interfaces. * It can be used to plug-in SOLR backed data into HIVE, data can be read from and written * to a SOLR collection using SolrStorageHandler */ public class SolrStorageHandler implements HiveStorageHandler, HiveStoragePredicateHandler{ private static final Logger LOG = Logger.getLogger(ExternalTableProperties.class.getName()); private Configuration conf; @Override public Configuration getConf(){ return this.conf; } @Override public void setConf(Configuration conf){ this.conf = conf; } @Override public Class<? extends InputFormat> getInputFormatClass(){ return SolrInputFormat.class; } @Override public Class<? extends OutputFormat> getOutputFormatClass(){ return SolrOutputFormat.class; } @Override public HiveMetaHook getMetaHook(){ return new SolrMetaHook(); } @Override public Class<? extends SerDe> getSerDeClass(){ return SolrSerDe.class; } @Override public HiveAuthorizationProvider getAuthorizationProvider(){ return null; } @Override public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ Properties externalTableProperties = tableDesc.getProperties(); new ExternalTableProperties().initialize(externalTableProperties, jobProperties, tableDesc); } @Override public void configureOutputJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ Properties externalTableProperties = tableDesc.getProperties(); new ExternalTableProperties().initialize(externalTableProperties, jobProperties, tableDesc); } @Override public void configureJobConf(TableDesc tableDesc, JobConf jobConf){ // do nothing; } @Override public void configureTableJobProperties(TableDesc tableDesc, Map<String, String> jobProperties){ // do nothing; } @Override public DecomposedPredicate decomposePredicate(JobConf entries, Deserializer deserializer, ExprNodeDesc exprNodeDesc ){ IndexPredicateAnalyzer analyzer = PredicateAnalyzer.getPredicateAnalyzer(); List<IndexSearchCondition> searchConditions = new ArrayList<IndexSearchCondition>(); ExprNodeDesc residualPredicate = analyzer.analyzePredicate(exprNodeDesc, searchConditions); DecomposedPredicate decomposedPredicate = new DecomposedPredicate(); decomposedPredicate.pushedPredicate = analyzer.translateSearchConditions(searchConditions); decomposedPredicate.residualPredicate = (ExprNodeGenericFuncDesc) residualPredicate; return decomposedPredicate; } }
[ "amit.jaspal@cloudera.com" ]
amit.jaspal@cloudera.com
cad19b474a838beffd687c06023cca7090fa9981
18a62711edfc7ab0f29f4a64a0db5db4b3e47988
/chori/src/main/java/com/chori/controller/BrandController.java
893fde59ecc64fbc71955aee225abd4c09dbc1ba
[]
no_license
15110081/Chori
ec1d4777158625b4d963db0eca70c0ccc4c42f45
6506b605814912ad8fb1e00f2734767c0764cf2a
refs/heads/master
2020-04-28T08:30:30.309932
2019-03-12T03:48:44
2019-03-12T03:48:44
175,129,917
0
0
null
null
null
null
UTF-8
Java
false
false
2,431
java
package com.chori.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.chori.model.BrandModel; import com.chori.model.PiModel; import com.chori.service.BrandService; @RestController @RequestMapping(value="/") public class BrandController { private static final Log log = LogFactory.getLog(BrandController.class); @Autowired BrandService service; @RequestMapping(value = "/brand/list", produces = "application/json", method = RequestMethod.GET) @ResponseBody public Map<String, Object> getAllStatus() { log.info(String.format("getAllStatus in class %s", getClass())); try { log.debug("getting list of all brand and return json"); Map<String, Object> result = new HashMap<String, Object>(); List<BrandModel> ls = service.getAllBrandModel(); result.put("status", "ok"); result.put("list", ls); log.debug("getAllBrand successful"); return result; } catch (Exception e) { log.error(String.format("getAllBrand in class %s has error: %s", getClass(), e.getMessage())); throw e; } } @RequestMapping(value = "/brand/detail/{brandCode}", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody public Map<String, Object> getBrandDetail(@PathVariable int brandCode) { log.info(String.format("getBrandDetail with param 'brandCode' in class: %s", getClass())); try { log.debug("getting brand's detail by its brandCode and return json"); Map<String, Object> result = new HashMap<String, Object>(); BrandModel en = service.findBrandById(brandCode); result.put("currentbrand", en); result.put("status", "ok"); log.debug("getbrandDetail successful"); return result; } catch (Exception e) { log.error(String.format("getBrandDetail with param 'lotNumber' in class %s has error: %s", getClass(), e.getMessage())); throw e; } } }
[ "nhaminh.congnghephanmem@gmail.com" ]
nhaminh.congnghephanmem@gmail.com
ccbe303d715ac316c857d26aa84f34616518f455
7d12d290c3cd8b01740e485f55ce63e3dfa8a8cd
/src/main/java/ru/customs/entity/ClaimEntity.java
9ed3aa39699bdf15930798435e96c4d4a7ae5197
[]
no_license
alexni/customs
3ccc513ebf6fda3d6ae2b812e32863f3891d0572
4a875761930f0bdf73718cdaf24ed0fb267581c1
refs/heads/master
2020-05-16T17:59:49.170119
2019-11-24T14:24:06
2019-11-24T14:24:06
183,211,142
0
0
null
null
null
null
UTF-8
Java
false
false
8,838
java
package ru.customs.entity; import ru.customs.dto.NewClaimRequest; import javax.persistence.*; import java.util.*; @Entity @Table(name = "claims") public class ClaimEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String surname; private String name; private String secondName; private String phone; private String birthdate; private String passportPrefix; private String passportNumber; private String passportDate; private OperationType operationType; private String trackNumber; private String trailerNumber; private String checkPoint; private String payer; private String contractNumber; private String carrier; private String comment; @ElementCollection @CollectionTable(name = "documenta", joinColumns = @JoinColumn(name = "claim_id")) @Column(name = "document") private Set<String> documents = new HashSet<>(); @ElementCollection @CollectionTable(name = "operation_types", joinColumns = @JoinColumn(name = "claim_id")) @Column(name = "operation_type") private Set<OperationType> operationTypes = new HashSet<>(); private ClaimState state; private Long timestamp; private Long managerId; private boolean haveNewMessages; public ClaimEntity() { } public ClaimEntity(Long id, String surname, String name, String secondName, String phone, String birthdate, String passportPrefix, String passportNumber, String passportDate, OperationType operationType, String trackNumber, String trailerNumber, String checkPoint, String payer, String carrier, String comment, Set<String> documents, Set<OperationType> operationTypes, String contractNumber, ClaimState state, Long timestamp, Long managerId, boolean haveNewMessages) { this.id = id; this.surname = surname; this.name = name; this.secondName = secondName; this.phone = phone; this.birthdate = birthdate; this.passportPrefix = passportPrefix; this.passportNumber = passportNumber; this.passportDate = passportDate; this.operationType = operationType; this.trackNumber = trackNumber; this.trailerNumber = trailerNumber; this.checkPoint = checkPoint; this.payer = payer; this.carrier = carrier; this.comment = comment; this.documents = documents; this.state = state; this.timestamp = timestamp; this.managerId = managerId; this.haveNewMessages = haveNewMessages; this.operationTypes = operationTypes; this.contractNumber = contractNumber; } public ClaimEntity(NewClaimRequest other){ this.surname = other.getSurname(); this.name = other.getName(); this.secondName = other.getSecondName(); this.phone = other.getPhone(); this.birthdate = other.getBirthdate(); this.passportDate = other.getPassportDate(); this.passportPrefix = other.getPassportPrefix(); this.passportNumber = other.getPassportNumber(); this.operationType = other.getOperationType(); this.trackNumber = other.getTrackNumber(); this.trailerNumber = other.getTrailerNumber(); this.checkPoint = other.getCheckPoint(); this.payer = other.getPayer(); this.carrier = other.getCarrier(); this.comment = other.getComment(); this.documents = other.getDocuments(); this.state = ClaimState.Start; this.timestamp = new Date().getTime(); this.managerId = 0L; this.haveNewMessages = false; this.operationTypes= other.getOperationTypes(); this.contractNumber = other.getContractNumber(); } public ClaimEntity(String surname, String name, String secondName, String phone, String birthdate, String passportPrefix, String passportNumber, String passportDate, OperationType operationType, String trackNumber, String trailerNumber, String checkPoint, String payer, String carrier, String comment, Set<String> documents, ClaimState state, Long timestamp, Long managerId, boolean haveNewMessages, Set<OperationType> operationTypes, String contractNumber) { this.surname = surname; this.name = name; this.secondName = secondName; this.phone = phone; this.birthdate = birthdate; this.passportPrefix = passportPrefix; this.passportNumber = passportNumber; this.passportDate = passportDate; this.operationType = operationType; this.trackNumber = trackNumber; this.trailerNumber = trailerNumber; this.checkPoint = checkPoint; this.payer = payer; this.carrier = carrier; this.comment = comment; this.documents = documents; this.state = state; this.timestamp = timestamp; this.managerId = managerId; this.haveNewMessages = haveNewMessages; this.operationTypes = operationTypes; this.contractNumber = contractNumber; } public Long getId() { return id; } public String getSurname() { return surname; } public String getName() { return name; } public String getSecondName() { return secondName; } public String getPhone() { return phone; } public String getBirthdate() { return birthdate; } public String getPassportPrefix() { return passportPrefix; } public String getPassportNumber() { return passportNumber; } public String getPassportDate() { return passportDate; } public OperationType getOperationType() { return operationType; } public String getTrackNumber() { return trackNumber; } public String getTrailerNumber() { return trailerNumber; } public String getCheckPoint() { return checkPoint; } public String getPayer() { return payer; } public String getCarrier() { return carrier; } public String getComment() { return comment; } public Set<String> getDocuments() { return documents; } public ClaimState getState() { return state; } public Long getTimestamp() { return timestamp; } public Long getManagerId() { return managerId; } public boolean isHaveNewMessages() { return haveNewMessages; } public void setId(Long id) { this.id = id; } public void setSurname(String surname) { this.surname = surname; } public void setName(String name) { this.name = name; } public void setSecondName(String secondName) { this.secondName = secondName; } public void setPhone(String phone) { this.phone = phone; } public void setBirthdate(String birthdate) { this.birthdate = birthdate; } public void setPassportPrefix(String passportPrefix) { this.passportPrefix = passportPrefix; } public void setPassportNumber(String passportNumber) { this.passportNumber = passportNumber; } public void setPassportDate(String passportDate) { this.passportDate = passportDate; } public void setOperationType(OperationType operationType) { this.operationType = operationType; } public void setTrackNumber(String trackNumber) { this.trackNumber = trackNumber; } public void setTrailerNumber(String trailerNumber) { this.trailerNumber = trailerNumber; } public void setCheckPoint(String checkPoint) { this.checkPoint = checkPoint; } public void setPayer(String payer) { this.payer = payer; } public void setCarrier(String carrier) { this.carrier = carrier; } public void setComment(String comment) { this.comment = comment; } public void setDocuments(Set<String> documents) { this.documents = documents; } public void setState(ClaimState state) { this.state = state; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public void setManagerId(Long managerId) { this.managerId = managerId; } public void setHaveNewMessages(boolean haveNewMessages) { this.haveNewMessages = haveNewMessages; } public String getContractNumber() { return contractNumber; } public void setContractNumber(String contractNumber) { this.contractNumber = contractNumber; } public Set<OperationType> getOperationTypes() { return operationTypes; } public void setOperationTypes(Set<OperationType> operationTypes) { this.operationTypes = operationTypes; } }
[ "izmalych@gmail.com" ]
izmalych@gmail.com
e8841ab56377b6de95f0d7c8283c688da4f9852b
28e43d16dee2671aa2b74516bc893dbd43d3494a
/app/src/main/java/com/dabudabu/samsatnotif/adapter/EventAdapter.java
4358c15c4af73ead8e99d938bfd8657e90cf8e7e
[]
no_license
muktiwbowo/SamsatNotif
ed4a4e1582d2f0e798d5453b12f3a233ccc86d7c
304f1b6efffaaf84749d6a66093c582fb07fc4bf
refs/heads/master
2020-03-17T06:28:47.299117
2018-05-14T12:29:18
2018-05-14T12:29:18
133,357,508
0
0
null
null
null
null
UTF-8
Java
false
false
1,879
java
package com.dabudabu.samsatnotif.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.dabudabu.samsatnotif.R; import com.dabudabu.samsatnotif.model.ItemEvent; import java.util.List; public class EventAdapter extends RecyclerView.Adapter<EventAdapter.HolderEvent> { private List<ItemEvent> events; private Context context; public EventAdapter(List<ItemEvent> events, Context context) { this.events = events; this.context = context; } @Override public EventAdapter.HolderEvent onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.list_event, parent, false); return new HolderEvent(view); } @Override public void onBindViewHolder(EventAdapter.HolderEvent holder, int position) { ItemEvent itemEvent = events.get(position); holder.titleEvent.setText(itemEvent.getTitle()); holder.contentEvent.setText(itemEvent.getContent()); Glide.with(context) .load(itemEvent.getImageurl()) .into(holder.imgEvent); } @Override public int getItemCount() { return events.size(); } class HolderEvent extends RecyclerView.ViewHolder{ private TextView titleEvent, contentEvent; private ImageView imgEvent; public HolderEvent(View itemView) { super(itemView); titleEvent = itemView.findViewById(R.id.titleevent); contentEvent = itemView.findViewById(R.id.contentevent); imgEvent = itemView.findViewById(R.id.imgevent); } } }
[ "muktiwbowo@gmail.com" ]
muktiwbowo@gmail.com
87f722f09cfcddca9796d5e48f9f0be93d32ab54
dba670bfcdf716fbe3627ebf2a32b3aa5e35cb5b
/src/main/java/m3/jstat/data/Corpus.java
1ba7c11a2cc1ce9fd220508f08511f18ea61258b
[ "Apache-2.0" ]
permissive
kamir/WikiExplorer.NG
429cbe1d0b251a0a81667f3f93d28d16d9886c3e
7b56e3d1e638d760fe238dfd66d3775404335ff4
refs/heads/master
2022-07-14T23:14:19.547932
2018-12-21T13:00:31
2018-12-21T13:00:31
55,048,356
0
0
Apache-2.0
2022-07-01T17:39:27
2016-03-30T09:00:26
HTML
UTF-8
Java
false
false
7,371
java
/** * The core data container for textanalysis. */ package m3.jstat.data; import m3.io.CorpusFile2; import m3.io.CorpusFilePlainContentPerPage; import m3.io.CorpusFileXML; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.net.URLEncoder; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Text; import org.crunchts.store.TSB; import m3.wikipedia.corpus.extractor.iwl.ExtractIWLinkCorpus; import m3.wikipedia.explorer.data.WikiNode; import org.etosha.core.sc.connector.external.Wiki; /** * @author root */ public class Corpus { private static String studie = "DEFAULT.Studie"; public Corpus() {} public Corpus(String studie) { this.docs = new Vector<Document>(); this.studie = studie; // corpusFilePath = TSB.getAspectFolder( "corpus" , studie ).getAbsolutePath(); } // public Corpus(boolean loadPC) { // this("DEFAULT_ignoreLoadPC"); // // // this.loadPageContent = loadPC; // // System.out.println("##### WARNING ##### IGNORE loadPC PROP in constructor Corpus() !!! "); // } public static final int mode_XML = 0; public static final int mode_SEQ = 1; private static String _listfile_pfad = TSB.getFolderForTimeSeriesMetadata().getAbsolutePath(); private static String corpusFilePath = null; // TSB.getAspectFolder( "corpus.xml" , studie ).getAbsolutePath(); public static String getCorpusFilePath() { return corpusFilePath; } public static String getListfilePath() { return _listfile_pfad; } // public static void setListfile_pfad(String _listfile_pfad) { // Corpus._listfile_pfad = _listfile_pfad; // } public static Corpus loadCorpus(String name, int mode) throws IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException { if (mode == mode_SEQ) { return CorpusFile2.loadFromLocalFS(name); } else if (mode == mode_XML) { return CorpusFileXML.loadFromLocalFS(name); } else { return null; } } public static void storeCorpus(Corpus corpus, String name, int mode) throws IOException, URISyntaxException { System.out.println("*** " + name + " *** mode:" + mode + " *** studie:" + studie ); if (mode == mode_SEQ) { CorpusFile2.createCorpusFile(".", name, corpus); } else if (mode == mode_XML) { CorpusFileXML._createCorpusFile(".", name, corpus, studie); } CorpusFilePlainContentPerPage._createCorpusFile(".", name, corpus, studie); } final boolean loadPageContent = true; public void addDocument(Document doc) { docs.add(doc); } public Vector<Document> docs = null; public void _addWikiNodes(Vector<WikiNode> t, String acM) { System.out.println("*** " + t.size() + "=>" + acM + " loadPageContent: " + loadPageContent); long vol = 0; for (WikiNode wn : t) { String html = ""; try { Document doc = new Document(ExtractIWLinkCorpus.getUrl(wn.wiki, wn.page), html); doc.group = acM; doc.wn = wn; if (loadPageContent) { html = ExtractIWLinkCorpus.getHTML(wn); vol = vol + html.length(); doc.wn.pageVolume = html.length(); doc.html = html; } else { System.out.println( "###### SKIP LOAD PAGE #####"); } System.out.println( doc.group + " : " + doc.wn.pageVolume ); addDocument(doc); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } System.out.println("***" + t.size() + "=>" + acM + " volume: " + vol ); } public void addWikiNode(WikiNode wn, String b) { String html; try { html = ExtractIWLinkCorpus.getHTML(wn); Document doc = new Document(ExtractIWLinkCorpus.getUrl(wn.wiki, wn.page), html); doc.group = b; doc.wn = wn; addDocument(doc); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } public Vector<WikiNode> _getWikiNodes(String cN) { Vector<WikiNode> d = new Vector<WikiNode>(); for (Document doc : docs) { if (doc.group.equals(cN)) { d.add(doc.wn); } } return d; } public void writeWikiNodeKeyFile(WikiNode wn, String sdm_name) throws UnsupportedEncodingException { // String page = wn.page; if (page.contains("/")) { page = page.replaceAll("/", "_"); } if (page.contains("'")) { page = page.replaceAll("'", "_"); } String fnPart = URLEncoder.encode( page, "UTF8"); String listFILE = "listfile_" + sdm_name + "_" + wn.wiki + "_" + fnPart + ".lst"; try { BufferedWriter bw = new BufferedWriter(new FileWriter(_listfile_pfad + "/"+ listFILE)); int i = 0; for (Document doc : docs) { WikiDocumentKey k = new WikiDocumentKey(doc); bw.write(k + "\n"); i++; } System.out.println(i + " Docs gespeichert."); bw.flush(); bw.close(); } catch (IOException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } } private String ENCODE_FN(String wiki, String pn) throws IOException { Wiki wiki1 = new Wiki(wiki + ".wikipedia.org"); String l = pn; try { l = URLEncoder.encode( wiki1.normalize(pn), "UTF-8"); } catch (UnsupportedEncodingException ex) { Logger.getLogger(Corpus.class.getName()).log(Level.SEVERE, null, ex); } return l; } public String getTextStatistikLine() { String hl = "STUDIE LANG Page z.CN z.IWL z.AL z.BL vol.CN vol.IWL vol.A.L vol.B.L volCN / volAL volIWL / volBL ( volCN + volIWL) / (volAL + volBL)"; return hl; } public void exportCorpusToSequenceFile( SequenceFile.Writer writer ) throws IOException, URISyntaxException { int c = 0; for ( Document doc : docs ) { c++; Text key = new Text( new WikiDocumentKey( doc ).toString() ); Text val = new Text( doc.html ); writer.append( key, val ); } } }
[ "mirko.kaempf@gmail.com" ]
mirko.kaempf@gmail.com
6c8ac5c7261911a616ec755b57047f882f4185e4
c6d4872031fe7f9d20c6a5c01eb07c92aab3a205
/tests/src/test/java/de/quantummaid/mapmaid/specs/examples/serializedobjects/conflicting/asymetric/array_to_map/ARequest.java
654719d287f682df0c8ce3acd72746963f12ff5e
[ "Apache-2.0" ]
permissive
quantummaid/mapmaid
22cae89fa09c7cab1d1f73e20f2b92718f59bd49
348ed54a2dd46ffb66204ae573f242a01acb73c5
refs/heads/master
2022-12-24T06:56:45.809221
2021-08-03T09:56:58
2021-08-03T09:56:58
228,895,012
5
1
Apache-2.0
2022-12-14T20:53:54
2019-12-18T18:01:43
Java
UTF-8
Java
false
false
1,661
java
/* * Copyright (c) 2020 Richard Hauswald - https://quantummaid.de/. * * 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 de.quantummaid.mapmaid.specs.examples.serializedobjects.conflicting.asymetric.array_to_map; import de.quantummaid.mapmaid.specs.examples.customprimitives.success.normal.example1.Name; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; import lombok.ToString; import java.util.Map; import static java.util.Arrays.stream; import static java.util.stream.Collectors.toMap; @ToString @EqualsAndHashCode @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public final class ARequest { public final Map<Name, Name> names; public static ARequest aRequest(final Name[] names) { final Map<Name, Name> map = stream(names) .collect(toMap(x -> x, x -> x)); return new ARequest(map); } }
[ "developer@quantummaid.de" ]
developer@quantummaid.de
05daed6e835ffa4bbf90d9610373220c28c38a1e
aeba540c9bcd0ceda24e999f547923916a26df92
/GeoModel/app/src/main/java/com/king/geomodel/model/serializable/SUserInfo.java
aeb3f220d4fc126f4be25ff1c86cf3e353d90523
[]
no_license
beyondwxin/geomodel
186fb34785c90f8b3f20f4e6ae524018b4ade16e
eea288f88e44889833efadc896c0b6bbf62ce0df
refs/heads/master
2020-12-30T17:51:20.484271
2017-05-11T06:24:50
2017-05-11T06:24:50
90,933,592
2
0
null
2017-05-11T06:07:46
2017-05-11T03:31:58
Java
UTF-8
Java
false
false
684
java
package com.king.geomodel.model.serializable; import com.king.geomodel.base.BaseApplication; import com.king.geomodel.tinker.SampleApplicationLike; import com.king.geomodel.utils.CommonValues; import com.king.geomodel.utils.SharedPreferencesUtil; import com.king.greenDAO.bean.User; import java.io.Serializable; /** * 序列化用户信息 * Created by king on 2016/10/9. */ public class SUserInfo implements Serializable { private static User userInfo; public static User getUserInfoInstance() { userInfo = (User) SharedPreferencesUtil.readObject(SampleApplicationLike.getInstance().getApplication(), CommonValues.USERINFO); return userInfo; } }
[ "king782515516@163.com" ]
king782515516@163.com
d5af1a3dea896eb7df6161a00f83fde2192541f6
4a5f24baf286458ddde8658420faf899eb22634b
/aws-java-sdk-alexaforbusiness/src/main/java/com/amazonaws/services/alexaforbusiness/model/SearchDevicesResult.java
0924bbf217d5f973cdd9c431feef5a056d9e8733
[ "Apache-2.0" ]
permissive
gopinathrsv/aws-sdk-java
c2876eaf019ac00714724002d91d18fadc4b4a60
97b63ab51f2e850d22e545154e40a33601790278
refs/heads/master
2021-05-14T17:18:16.335069
2017-12-29T19:49:30
2017-12-29T19:49:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,048
java
/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.alexaforbusiness.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/alexaforbusiness-2017-11-09/SearchDevices" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchDevicesResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> */ private java.util.List<DeviceData> devices; /** * <p> * The token returned to indicate that there is more data available. * </p> */ private String nextToken; /** * <p> * The total number of devices returned. * </p> */ private Integer totalCount; /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @return The devices that meet the specified set of filter criteria, in sort order. */ public java.util.List<DeviceData> getDevices() { return devices; } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. */ public void setDevices(java.util.Collection<DeviceData> devices) { if (devices == null) { this.devices = null; return; } this.devices = new java.util.ArrayList<DeviceData>(devices); } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDevices(java.util.Collection)} or {@link #withDevices(java.util.Collection)} if you want to override * the existing values. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withDevices(DeviceData... devices) { if (this.devices == null) { setDevices(new java.util.ArrayList<DeviceData>(devices.length)); } for (DeviceData ele : devices) { this.devices.add(ele); } return this; } /** * <p> * The devices that meet the specified set of filter criteria, in sort order. * </p> * * @param devices * The devices that meet the specified set of filter criteria, in sort order. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withDevices(java.util.Collection<DeviceData> devices) { setDevices(devices); return this; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @param nextToken * The token returned to indicate that there is more data available. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @return The token returned to indicate that there is more data available. */ public String getNextToken() { return this.nextToken; } /** * <p> * The token returned to indicate that there is more data available. * </p> * * @param nextToken * The token returned to indicate that there is more data available. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** * <p> * The total number of devices returned. * </p> * * @param totalCount * The total number of devices returned. */ public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; } /** * <p> * The total number of devices returned. * </p> * * @return The total number of devices returned. */ public Integer getTotalCount() { return this.totalCount; } /** * <p> * The total number of devices returned. * </p> * * @param totalCount * The total number of devices returned. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchDevicesResult withTotalCount(Integer totalCount) { setTotalCount(totalCount); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDevices() != null) sb.append("Devices: ").append(getDevices()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()).append(","); if (getTotalCount() != null) sb.append("TotalCount: ").append(getTotalCount()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchDevicesResult == false) return false; SearchDevicesResult other = (SearchDevicesResult) obj; if (other.getDevices() == null ^ this.getDevices() == null) return false; if (other.getDevices() != null && other.getDevices().equals(this.getDevices()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; if (other.getTotalCount() == null ^ this.getTotalCount() == null) return false; if (other.getTotalCount() != null && other.getTotalCount().equals(this.getTotalCount()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDevices() == null) ? 0 : getDevices().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getTotalCount() == null) ? 0 : getTotalCount().hashCode()); return hashCode; } @Override public SearchDevicesResult clone() { try { return (SearchDevicesResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "" ]
7bd0d07ac552b2a0566101b5c7dab6ad326b1184
7e69df92710270b037e3576a609eaffd8d51dd6e
/src/main/java/com/codinginterview/hackerrank/array/ArraysLeftRotation.java
023c088678fc77ee514cc2cf757b372756e3dc69
[]
no_license
dogwang94/codinginterview2020
b981cc67e12a4a8d0e4b3993bec17fd1357a9209
a28a2abcb29020cbfc7ca113f3455bc0d0b2cdfe
refs/heads/master
2021-04-14T08:19:58.167959
2020-03-22T23:26:12
2020-03-22T23:26:12
249,218,565
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package com.codinginterview.hackerrank.array; import java.util.Arrays; public class ArraysLeftRotation { public static void main(String[] args) { int[] a = {1,2,3,4,5}; int n = 5; System.out.println(Arrays.toString(rotleft(a, n))); } static int[] rotleft(int[]a, int d) { int size = a.length; int[] rotated_arr = new int[size]; int i = 0; int rotate_index = d; while (rotate_index < size) { rotated_arr[i] = a[rotate_index]; i++; rotate_index++; } rotate_index = 0; while (rotate_index <d) { rotated_arr[i] = a[rotate_index]; i++; rotate_index++; } return rotated_arr; } }
[ "dogwang94@gmail.com" ]
dogwang94@gmail.com
24047ed08cd38595099f5c20349349954addbf9c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd/Messages/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd_Messages_s.java
49b92c9337bac1e2144da4a866230aae8634c21a
[]
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
3,159
java
package com.ibm.sbt.services.client.connections.profiles.utils; /** * Class used to retrieve translatable message values from the associated properties file. * * @author Swati Singh */ public class Messages { public static String InvalidArgument_1 = "Required input parameter is missing : id"; public static String InvalidArgument_2 = "Required input parameter is missing : connectionId"; public static String InvalidArgument_3 = "Invalid Input : Profile passed is null"; public static String InvalidArgument_4 = "Required input parameter is missing : source id is missing"; public static String InvalidArgument_5 = "Required input parameter is missing : target id is missing"; public static String InvalidArgument_6 = "Invalid Input : Connection passed is null"; public static String ProfileServiceException_1 = "Exception occurred in method"; public static String ProfileException = "Error getting profile with identifier : {0}"; public static String SearchException = "Problem occurred while searching profiles"; public static String ColleaguesException = "Problem occurred while getting colleagues of user with identifier : {0}"; public static String CheckColleaguesException = "Problem occurred in checking if two users are colleagues"; public static String CommonColleaguesException = "Problem occurred in getting common colleagues of users {0} and {1}"; public static String ReportingChainException = "Problem occurred in getting report chain of user with identifier : {0}"; public static String DirectReportsException = "Problem occurred in getting direct reports of user with identifier : {0}"; public static String ConnectionsByStatusException = "Problem occurred while getting connections by status for user with identifier : {0}"; public static String SendInviteException = "Problem occurred in sending Invite to user with identifier : {0}, please check if there is already a pending invite for this user"; public static String SendInvitePayloadException = "Error creating Send Invite Payload"; public static String SendInviteMsg = "Please accept this invitation to be in my network of Connections colleagues."; public static String AcceptInviteException = "Problem occurred in accepting Invite with connection Id : {0}"; public static String AcceptInvitePayloadException = "Error creating Accept Invite Payload"; public static String DeleteInviteException = "Problem occurred in deleting Invite with connection Id : {0}"; public static String UpdateProfilePhotoException = "Problem occurred in Updating Profile Photo"; public static String UpdateProfileException = "Problem occurred in Updating Profile "; public static String DeleteProfileException = "Problem occurred in deleting Profile of user with identifier : {0}"; public static String CreateProfileException = "Problem occurred in creating Profile , please check if profile already and you are logged in as administrator"; public static String CreateProfilePayloadException = "Error in create Profile Payload"; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
06878502ad35e8a58428f138851583276811fa6a
1374237fa0c18f6896c81fb331bcc96a558c37f4
/java/com/winnertel/em/standard/snmp/gui/formatter/HundredPercentFormatter.java
50fdc7d8c9d598bb8a28f53f290b8ae4f78ffe83
[]
no_license
fangniude/lct
0ae5bc550820676f05d03f19f7570dc2f442313e
adb490fb8d0c379a8b991c1a22684e910b950796
refs/heads/master
2020-12-02T16:37:32.690589
2017-12-25T01:56:32
2017-12-25T01:56:32
96,560,039
0
0
null
null
null
null
UTF-8
Java
false
false
848
java
package com.winnertel.em.standard.snmp.gui.formatter; import com.winnertel.em.framework.IApplication; import com.winnertel.em.framework.model.snmp.SnmpMibBean; import com.winnertel.em.framework.model.util.MibBeanUtil; public class HundredPercentFormatter extends SnmpFieldFormatter { public HundredPercentFormatter(IApplication anApplication) { super(anApplication); } // BridgeIdFormatter public Object format(SnmpMibBean aMibBean, String aProperty) throws Exception { Integer value = (Integer) MibBeanUtil.getSimpleProperty(aMibBean, aProperty); if (value == null) { return null; } StringBuffer result = new StringBuffer(); result.append((((float) value.intValue()) / 100.0)); result.append("%"); return result.toString(); } } // BridgeIdFormatter
[ "fangniude@gmail.com" ]
fangniude@gmail.com
2fc81db5ddefe8d95db485d57b3448a2db1dd319
ee03a8c09d2c34c73e13f87b63bcaa8cd3f6a337
/Exercicios/Interfaces_2/Interfaces_2/src/interfaces_2/Tributavel.java
1c87725283e80299c6ad86b77ef44db313c4c4e0
[]
no_license
FelipeNascimentods/Programa-o-Orientada-Objetos
c81e5ddb6d7efbc4282b04fc1a5f82713de0908b
a659116a6e18e5835f405afdfcc9b81326a55aa4
refs/heads/master
2020-09-12T21:07:28.865365
2019-11-18T22:30:00
2019-11-18T22:30:00
222,556,660
0
0
null
null
null
null
UTF-8
Java
false
false
85
java
package interfaces_2; public interface Tributavel { double calculaTributos(); }
[ "felipesaj22@hotmail.com" ]
felipesaj22@hotmail.com
a777b88ad15b36633dca506421bdc6be5c89e136
b5c485493f675bcc19dcadfecf9e775b7bb700ed
/jee-utility/src/main/java/org/cyk/utility/scope/AbstractScopeImpl.java
1958931f7c7449fca7c6326b7bbe51acd76382c5
[]
no_license
devlopper/org.cyk.utility
148a1aafccfc4af23a941585cae61229630b96ec
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
refs/heads/master
2023-03-05T23:45:40.165701
2021-04-03T16:34:06
2021-04-03T16:34:06
16,252,993
1
0
null
2022-10-12T20:09:48
2014-01-26T12:52:24
Java
UTF-8
Java
false
false
275
java
package org.cyk.utility.scope; import java.io.Serializable; import org.cyk.utility.__kernel__.object.dynamic.AbstractObject; public abstract class AbstractScopeImpl extends AbstractObject implements Scope,Serializable{ private static final long serialVersionUID = 1L; }
[ "kycdev@gmail.com" ]
kycdev@gmail.com
e9b550e5282f5d3f92e424fb23450cc6000ad0c8
13cf2b591624a7c4baaac61f54e5b81b4b160790
/src/main/java/ilpme/xhail/core/Buildable.java
1fa789c924bcf82d5120c9efb41b73398b1f3bf1
[]
no_license
ari9dam/ILPME
d96ccf94adc204a19fd6b28cbafd8d5bd4e4cd9f
e028744e96d7efcf9c105a0162f765bf63365ce6
refs/heads/master
2021-07-19T14:46:05.896447
2019-08-24T04:29:46
2019-08-24T04:29:46
84,487,374
1
3
null
2021-04-26T17:57:53
2017-03-09T20:49:58
Java
UTF-8
Java
false
false
248
java
/** * */ package ilpme.xhail.core; /** * @author stefano * */ public interface Buildable<T> { /** * Returns the equivalent instance of <code>T</code>. * * @return the equivalent instance of <code>T</code> */ public T build(); }
[ "Anisha Mazumder@192.168.0.51" ]
Anisha Mazumder@192.168.0.51
45ac461494432b1614ed8d7fa11d56fa6b3b2af3
c42f08c1da1564b5e90ceb6853656f71d33bb628
/Helper/src/main/java/com/jiqu/helper/data/RecommendFindingsItemPicInfo.java
7ac336c0e6623c9e865b3d65683f6957dd75617c
[]
no_license
xwhPanda/MyApplication
1901b342a1cf1d4d9d5e9314fbf7ea73ca727e8d
35ad2f974395dab62c7947cd71377770ef4a0f3f
refs/heads/master
2020-04-06T06:58:23.599836
2016-09-02T10:03:28
2016-09-02T10:03:28
64,209,768
0
0
null
null
null
null
UTF-8
Java
false
false
2,287
java
package com.jiqu.helper.data; /** * Created by xiongweihua on 2016/7/27. */ public class RecommendFindingsItemPicInfo { /** * url : http://koi.77gamebox.com/index.php/Art/News/show/id/29.html * id : 29 * rotate_pic : http://koi.77gamebox.com/Upload/Rotate/2016-07-21/579067b57db99.jpg * favorite : 222 * from : 应用内容精选 * rotate_title : 大闹三国 * rotate_intro : 最新最好玩 * type : 3 * siteID : 1 * statisticsID : 10 */ private String url; private String id; private String rotate_pic; private String favorite; private String from; private String rotate_title; private String rotate_intro; private String type; private String siteID; private String statisticsID; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRotate_pic() { return rotate_pic; } public void setRotate_pic(String rotate_pic) { this.rotate_pic = rotate_pic; } public String getFavorite() { return favorite; } public void setFavorite(String favorite) { this.favorite = favorite; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getRotate_title() { return rotate_title; } public void setRotate_title(String rotate_title) { this.rotate_title = rotate_title; } public String getRotate_intro() { return rotate_intro; } public void setRotate_intro(String rotate_intro) { this.rotate_intro = rotate_intro; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getSiteID() { return siteID; } public void setSiteID(String siteID) { this.siteID = siteID; } public String getStatisticsID() { return statisticsID; } public void setStatisticsID(String statisticsID) { this.statisticsID = statisticsID; } }
[ "1152046774@qq.com" ]
1152046774@qq.com
93fab3a6ea0ecbce587f097b4da2d928d986d109
a86df356ef494eab1870ad7fdba2e4e1f4a20f56
/src/main/java/com/guo/j8/Chapter2/Chapter1_1.java
dd9ed685a363f687d16e32fe7892a2ae788b5efd
[]
no_license
lair101/Java8InAction
d8b3862b38af498ae689adda0d7c80d697be8c32
8861be392b8030714b266e92d2d935fbd5616368
refs/heads/master
2020-03-20T06:28:19.262950
2018-08-16T23:06:25
2018-08-16T23:06:25
137,249,928
0
0
null
null
null
null
UTF-8
Java
false
false
1,618
java
package com.guo.j8.Chapter2; import lombok.Data; import org.junit.jupiter.api.Test; import java.util.*; public class Chapter1_1{ List<Apple> inventory = new ArrayList<Apple>(); /*** * old way to sort a list is to implement a Comparator method for sort() * This need more code and Object casting */ public void oldSort(){ Apple a = new Apple(); a.setWeight(1); Apple b = new Apple(); b.setWeight(2); inventory.add(a); inventory.add(b); Collections.sort(inventory, new Comparator<Apple>() { @Override public int compare(Apple o1, Apple o2) { return o1.getWeight()-o2.getWeight(); } }); } /** * First Java 8 way to write sort * use arraylist sort with lambda expression to implement comparator */ public void newSort(){ Apple a = new Apple(); a.setWeight(1); Apple b = new Apple(); b.setWeight(2); inventory.add(a); inventory.add(b); inventory.sort((Apple o1, Apple o2) -> {return o1.getWeight()- o2.getWeight();}); } @Test public void test1(){ long lStartTime = System.nanoTime(); oldSort(); long lEndTime = System.nanoTime(); System.out.println("Old sort time consume :" + (lEndTime - lStartTime)); lStartTime = System.nanoTime(); newSort(); lEndTime = System.nanoTime(); System.out.println("New sort time consume :" + (lEndTime - lStartTime)); } } @Data class Apple{ int weight; }
[ "hlguo@ca.ibm.com" ]
hlguo@ca.ibm.com
9576c7d507fdfa1c503fe3d968a8aa485d515f6b
2f581cc54d31f37e7883197715eb3cb4d9fd81a5
/src/cn/probuing/utils/MD5Utils.java
9e82897359c878d7f622b8fbcd59ada82b72bd33
[]
no_license
neetsan123/ex_mallshop_j2ee
7706bfec0da8cd3b0d25b4cea31b77071a7fa77c
2e2887ec27130dd739eb181c6cea8ee5f3f09883
refs/heads/master
2020-06-07T12:43:16.480024
2018-04-27T07:58:05
2018-04-27T07:58:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package cn.probuing.utils; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MD5Utils { /** * ʹ��md5���㷨���м��� */ public static String md5(String plainText) { byte[] secretBytes = null; try { secretBytes = MessageDigest.getInstance("md5").digest( plainText.getBytes()); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("û��md5����㷨��"); } String md5code = new BigInteger(1, secretBytes).toString(16);// 16�������� // �����������δ��32λ����Ҫǰ�油0 for (int i = 0; i < 32 - md5code.length(); i++) { md5code = "0" + md5code; } return md5code; } public static void main(String[] args) { System.out.println(md5("123")); } }
[ "330261819@qq.com" ]
330261819@qq.com
6227c352c8f06d2d677109f43b2b6e86f1ef96d0
2a4e23bf58f32d8a76235854e0ef5c33af6a0024
/app/src/main/java/id/co/bale_it/kliksahabat/adapter2/MyHolder2.java
f518cd2c7004b13c4901fa0a86ab3c799e5f47be
[]
no_license
Wahyunirizkianti/Project_klikshbt
fc6fb62bfd17323d924c1fd342f9054987819154
b72bef23ab9c62d024c991642e6571d546cc56af
refs/heads/master
2020-03-18T22:03:49.210984
2018-05-29T16:18:16
2018-05-29T16:18:16
135,322,084
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package id.co.bale_it.kliksahabat.adapter2; /** * Created by Satria on 9/30/2017. */ import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import id.co.bale_it.kliksahabat.R; import id.co.bale_it.kliksahabat.adapter.ItemClickListener; public class MyHolder2 extends RecyclerView.ViewHolder implements View.OnClickListener { TextView nameTxt; ImageView img; private ItemClickListener itemClickListener; public MyHolder2(View itemView) { super(itemView); nameTxt= (TextView) itemView.findViewById(R.id.nameTxt); img= (ImageView) itemView.findViewById(R.id.playerImage); itemView.setOnClickListener(this); } @Override public void onClick(View v) { this.itemClickListener.onItemClick(v,getLayoutPosition()); } public void setItemClickListener(ItemClickListener ic) { this.itemClickListener=ic; } }
[ "wahyuni.rizki6895@gmail.com" ]
wahyuni.rizki6895@gmail.com
55c225e780d1db66d45cdc4dda31024d79eaefaf
1bfa1b90d5b99879c1c8df637364767fd8737db0
/app/src/main/java/com/ihsinformatics/korona/model/partners/BasePartners.java
7730670101d4f059295caefa48ef8213e375ddad
[]
no_license
InteractiveHealthSolutions/korona-screening-mobile
c6df309e3ef43db52da5d4725ba8fbc8ceb36885
5450892b07160e50392311aaba827a0f4150b9ef
refs/heads/master
2023-08-30T23:21:06.078035
2020-06-19T09:48:58
2020-06-19T09:48:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,248
java
package com.ihsinformatics.korona.model.partners; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class BasePartners { @SerializedName("uuid") @Expose private String uuid; @SerializedName("isVoided") @Expose private Boolean isVoided; @SerializedName("dateCreated") @Expose private String dateCreated; @SerializedName("reasonVoided") @Expose private Object reasonVoided; @SerializedName("partnerId") @Expose private Integer partnerId; @SerializedName("partnerName") @Expose private String partnerName; @SerializedName("shortName") @Expose private String shortName; @SerializedName("logoUrl") @Expose private String logoUrl; @SerializedName("website") @Expose private String url; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Boolean getIsVoided() { return isVoided; } public void setIsVoided(Boolean isVoided) { this.isVoided = isVoided; } public String getDateCreated() { return dateCreated; } public void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } public Object getReasonVoided() { return reasonVoided; } public void setReasonVoided(Object reasonVoided) { this.reasonVoided = reasonVoided; } public Integer getPartnerId() { return partnerId; } public void setPartnerId(Integer partnerId) { this.partnerId = partnerId; } public String getPartnerName() { return partnerName; } public void setPartnerName(String partnerName) { this.partnerName = partnerName; } public String getShortName() { return shortName; } public void setShortName(String shortName) { this.shortName = shortName; } public String getLogoUrl() { return logoUrl; } public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
[ "moiz.ahmed@ihsinformatics.com" ]
moiz.ahmed@ihsinformatics.com
3407dda94c1aa9a2d44b823a7ef59dad96c3f4da
0b3885c6ab684c34762c48c3cc9da971dbc0962a
/Java/src/Thread/Text3.java
79fd12574ce4f10554286a71e20adfa86b69288d
[]
no_license
y928qx/warehouseYqx
811fb5437c04ae9af7d7f248841a42c332365e3c
0bbd14a8f1d8a55e84905a22dbcbf5128d42f935
refs/heads/master
2021-01-11T10:37:27.269138
2017-02-16T02:24:22
2017-02-16T02:24:22
76,341,631
0
0
null
null
null
null
UTF-8
Java
false
false
899
java
package Thread; public class Text3 { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); if (i == 30) { Runnable myRunnable = new MyRunnable(); Thread thread = new MyThread(myRunnable); thread.start(); } } } } class MyRunnable implements Runnable { private int i = 0; @Override public void run() { System.out.println("in MyRunnable run"); for (i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } } class MyThread extends Thread { private int i = 0; public MyThread(Runnable runnable) { super(runnable); } @Override public void run() { System.out.println("in MyThread run"); for (i = 0; i < 100; i++) { System.out.println(Thread.currentThread().getName() + " " + i); } } }
[ "1471128428@qq.com" ]
1471128428@qq.com
4d27ccb5f3005f0525f22acc1143bd1fbd1a5648
caccd6fd464dab9b33d18d95f87e2114a41b922a
/gen/com/grayhound/CriminalIntent/BuildConfig.java
ca1cf68cc58cc7c3403c78d683f2bab508613c66
[]
no_license
dontsova/CriminalIntent
ef90c31793bbe448b357ec2275b794553bf30d28
89f3627b88283ce85a6c2d5ec0492bb88b87e815
refs/heads/master
2021-01-22T06:03:09.900167
2015-07-21T14:23:12
2015-07-21T14:23:12
32,023,451
0
1
null
null
null
null
UTF-8
Java
false
false
270
java
/*___Generated_by_IDEA___*/ package com.grayhound.CriminalIntent; /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ public final class BuildConfig { public final static boolean DEBUG = Boolean.parseBoolean(null); }
[ "v.koroliev@gmail.com" ]
v.koroliev@gmail.com
84c46c188b8579d81f8371bb8e490fc04dd5bf98
08d3aa021d99753cb8daf707f32e29b8579b667c
/app/src/main/java/com/example/myapplication/sonradan_acilan.java
c8aa63beed7a0739ebc46f5aac66f38c41c080d3
[]
no_license
EnginAltuntas/Android_BEUN_ogrenci_bilgilendirme
ac34a43a6f40f1d8415f43c0732772afe5acd84c
40e675ed120d1d10b06b252d7fee09915b063526
refs/heads/master
2022-12-08T13:56:11.224168
2020-08-23T14:44:31
2020-08-23T14:44:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,075
java
package com.example.myapplication; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.util.ArrayList; import java.util.List; public class sonradan_acilan extends AppCompatActivity { List<Broadcast> yazi = new ArrayList<Broadcast>(); List<String> eng = new ArrayList<>(); public int gcc=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sonradan_acilan); new Thread(new Runnable() { @Override public void run() { String gelen = getIntent().getStringExtra("mesaj"); gelen="https://"+gelen; // textView.setText(gelen); try { Document document = Jsoup.connect(gelen).get(); Elements links = document.select("p"); for (Element link : links) { eng.add(link.text()); gcc++; } } catch (Exception e) { e.printStackTrace(); } runOnUiThread(new Runnable() { @Override public void run() { ListView liste = findViewById(R.id.listView61); ArrayAdapter<String> veriadaptor = new ArrayAdapter<>(sonradan_acilan.this, android.R.layout.simple_list_item_1, android.R.id.text1, eng); liste.setAdapter(veriadaptor); /* textView.setText(eng.get(0)+"\n\n"+ eng.get(1)+"\n\n"+ eng.get(2)+"\n\n"+ eng.get(3));*/ } }); } }).start(); } }
[ "61109013+EnginAltuntas@users.noreply.github.com" ]
61109013+EnginAltuntas@users.noreply.github.com
1820e1a14570e3d6f1ddf1ae11b722ac43bf9d9f
e6d8ca0907ff165feb22064ca9e1fc81adb09b95
/src/main/java/com/vmware/vim25/ProfileDeferredPolicyOptionParameter.java
30fcffaf256a0de10174b37da96e0906c0aa2965
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
incloudmanager/incloud-vijava
5821ada4226cb472c4e539643793bddeeb408726
f82ea6b5db9f87b118743d18c84256949755093c
refs/heads/inspur
2020-04-23T14:33:53.313358
2019-07-02T05:59:34
2019-07-02T05:59:34
171,236,085
0
1
BSD-3-Clause
2019-02-20T02:08:59
2019-02-18T07:32:26
Java
UTF-8
Java
false
false
2,258
java
/*================================================================================ Copyright (c) 2013 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class ProfileDeferredPolicyOptionParameter extends DynamicData { public ProfilePropertyPath inputPath; public KeyAnyValue[] parameter; public ProfilePropertyPath getInputPath() { return this.inputPath; } public KeyAnyValue[] getParameter() { return this.parameter; } public void setInputPath(ProfilePropertyPath inputPath) { this.inputPath=inputPath; } public void setParameter(KeyAnyValue[] parameter) { this.parameter=parameter; } }
[ "sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1" ]
sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1
4dfda19e41f9479a4c17da1ac2a1dbadefd19d34
39029cfbf2dbf8c7b3578963a526ffee7ff50944
/app/src/main/java/com/omnitech/blooddonationnetwork/MainActivity.java
541b9646966b3aa2961f44846c029d548ab33505
[]
no_license
FawwazFaisal/BloodDotNet
18c61045373fa3e87f1162f91809a0857b6605fd
179994b026dff69073c637cc7805a8c811107e19
refs/heads/master
2022-11-11T01:16:25.347455
2020-06-23T21:57:21
2020-06-23T21:57:21
274,460,531
0
0
null
null
null
null
UTF-8
Java
false
false
11,744
java
package com.omnitech.blooddonationnetwork; import android.Manifest; import android.app.Dialog; import android.app.ProgressDialog; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.location.LocationManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.Settings; import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayout; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.omnitech.blooddonationnetwork.Adapter.LoginViewAdapter; import com.omnitech.blooddonationnetwork.Fragments.Login; import com.omnitech.blooddonationnetwork.Fragments.Register; public class MainActivity extends AppCompatActivity { public static final int REQUEST_CODE = 1; public static final String ID = "ID"; public static final String Age = "Age"; public static final String Gender = "Gender"; public static final String Contact = "Contact"; public static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION; public static final String COARSE_LOCATION = Manifest.permission.ACCESS_COARSE_LOCATION; private static final String Email = "Email"; private static final String Name = "Name"; public static final String isDonator = "isDonator"; public static final String isRequester = "isRequester"; public static final String activeID = "activeID"; private static final int ERROR_DIALOGUE_REQUEST = 102; ViewPager viewPager; TabLayout tabLayout; Toolbar toolbar; ProgressDialog progressDialog; boolean isValid = true; public FirebaseAuth firebaseAuth; public FirebaseAuth.AuthStateListener mAuthStateListener; private boolean mLocationPermissionGranted = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = findViewById(R.id.toolbar_main); tabLayout = findViewById(R.id.tablayout_main); viewPager = findViewById(R.id.view_pager_main); getLocationPermissions(); firebaseAuth = FirebaseAuth.getInstance(); mAuthStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { FirebaseUser mfirebaseUser = firebaseAuth.getCurrentUser(); if (mfirebaseUser != null) { if (isServicesOK() && mLocationPermissionGranted) { Intent intent = new Intent(MainActivity.this, Flags.class); startActivity(intent); } else if (!mLocationPermissionGranted) Toast.makeText(getApplicationContext(), "Please Enable Location Permission First", Toast.LENGTH_SHORT).show(); getLocationPermissions(); return; } } }; setSupportActionBar(toolbar); viewPager.setAdapter(setAdapter()); tabLayout.setupWithViewPager(viewPager); } private PagerAdapter setAdapter() { LoginViewAdapter adapter = new LoginViewAdapter(getSupportFragmentManager()); adapter.addFragment(new Login(), "Login"); adapter.addFragment(new Register(), "Register"); return adapter; } public boolean CheckConnectivity(View view) { boolean netState; ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); netState = networkInfo != null && networkInfo.isConnected(); if (!netState) { Snackbar.make(view, "Please connect to the internet", Snackbar.LENGTH_LONG) .setAction("CLOSE", new View.OnClickListener() { @Override public void onClick(View view) { EnableWifi(view); } }) .setActionTextColor(getResources().getColor(android.R.color.holo_red_light)) .show(); return false; } if (!mLocationPermissionGranted) { Toast.makeText(getApplicationContext(), "Please Allow Location Permission First", Toast.LENGTH_SHORT).show(); getLocationPermissions(); return false; } else { return true; } } private void EnableWifi(View view) { Snackbar.make(view, "Please connect to the internet", Snackbar.LENGTH_INDEFINITE) .setAction("ENABLE", new View.OnClickListener() { @Override public void onClick(View view) { startActivityForResult(new Intent(Settings.ACTION_WIFI_SETTINGS), 2); } }) .setActionTextColor(getResources().getColor(android.R.color.holo_red_light)) .show(); } public boolean SignInUser(String email, String pass) { progressDialog = new ProgressDialog(this); progressDialog.setMessage("..Please wait.."); progressDialog.setCanceledOnTouchOutside(false); progressDialog.show(); firebaseAuth.signInWithEmailAndPassword(email, pass).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (!task.isSuccessful()) { progressDialog.dismiss(); isValid = false; } else if(task.isSuccessful() && mLocationPermissionGranted){ FirebaseFirestore.getInstance().collection("Users").document(firebaseAuth.getUid()).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if (task.isSuccessful()) { DocumentSnapshot doc = task.getResult(); if (doc.exists()) { SharedPreferences sharedPreferences = PreferenceManager .getDefaultSharedPreferences(MainActivity.this); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(Name, doc.getString("name")); editor.putString(Contact, doc.getString("contact")); editor.putString(Email, doc.getString("email")); editor.putString(Age, doc.getString("age")); editor.putString(Gender, doc.getString("gender")); editor.putString(ID, doc.getId()); editor.putString(isDonator, doc.getString("isDonator")); editor.putString(isRequester, doc.getString("isRequester")); editor.putString(activeID, doc.getString("activeID")); editor.apply(); if (isServicesOK()) { Intent intent = new Intent(MainActivity.this, Flags.class); progressDialog.dismiss(); startActivity(intent); } } } } }); } else if(!mLocationPermissionGranted){ getLocationPermissions(); } } }); return isValid; } public boolean isServicesOK() { int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this); if (available == ConnectionResult.SUCCESS) { //everything is fine and user can make map request return true; } else if (GoogleApiAvailability.getInstance().isUserResolvableError(available)) { Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this, available, ERROR_DIALOGUE_REQUEST); dialog.show(); } else { Toast.makeText(this, "you cant make map request", Toast.LENGTH_SHORT).show(); } return false; } @Override protected void onStart() { super.onStart(); if (isServicesOK() && mLocationPermissionGranted) { firebaseAuth.addAuthStateListener(mAuthStateListener); } } public void getLocationPermissions() { String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; if (ContextCompat.checkSelfPermission(this.getApplicationContext(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.checkSelfPermission(this.getApplicationContext(), COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mLocationPermissionGranted = true; } } else { ActivityCompat.requestPermissions(this, permissions, REQUEST_CODE); } } public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == REQUEST_CODE) { if (grantResults.length > 0) { for (int i = 0; i < grantResults.length; i++) { if (grantResults[i] != PackageManager.PERMISSION_GRANTED) { return; } else mLocationPermissionGranted = true; } } } } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 2) { ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (networkInfo.isConnected() && networkInfo != null) { startActivity(new Intent(MainActivity.this, MainActivity.class)); } } } }
[ "m.fawwaz.faisal@gmail.com" ]
m.fawwaz.faisal@gmail.com
538b49309491708ee557e72135a7b85cde79175b
816d66df43033ab1d9d8f1ae0bc97c0734e74a58
/Programming/day5/Link.java
eaf46a09abaef8987885ad2b1a78b6090a5d8977
[]
no_license
CaseRegan/CP222
3afac55ad8978ea8430cbc4f72823c35d83e73e3
1aac22c2aae52f152a69ecef0e44c94bb67cedf7
refs/heads/master
2021-08-31T00:50:07.698045
2017-12-20T02:11:23
2017-12-20T02:11:23
112,227,739
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
public class Link<T> { private T value; private Link<T> next; public Link(T v, Link<T> n) { value = v; next = n; } public void setValue(T v) { value = v; } public T getValue() { return value; } public void setNext(Link<T> n) { next = n; } public Link<T> getNext() { return next; } }
[ "loaner@localccs-MacBook-Pro.local" ]
loaner@localccs-MacBook-Pro.local
d92565d7bdfc03f75c1eeafe736fc667110e9a3c
0b5964830c0da0608a14311df939001a43091f0c
/tutor-it-services/tutor-it-book/src/main/java/com/lz/read/service/ChildService.java
2e3c73c9d3afad9a2a0b22aa35a4daf876f241a2
[]
no_license
ring2/micro-tutor-it
af337ba860b5d4ca1a5ad778f17b178a3a695a75
a997a0392e2b8de5f1728a0675a5fae55c2521ff
refs/heads/master
2022-12-12T08:19:05.871615
2020-09-08T13:54:06
2020-09-08T13:54:06
293,824,357
0
0
null
null
null
null
UTF-8
Java
false
false
160
java
package com.lz.read.service; /** * @author : lz * @date : 2020/4/1 23:55 * description: **/ public interface ChildService{ }
[ "ring2977@163.com" ]
ring2977@163.com
9459416f16490ebbdff928b5d4abd9cabae424ae
55876a3fe02485c1d524054ecb2573804f234626
/src/main/java/com/altas/erp/eds/entity/AccountBankStatementImportEntityWithBLOBs.java
7a66932702484915425053572cae6eb9cec286e8
[]
no_license
enjoy0924/sample-tars
b427ceac64b2ec99369d2dc29e7b474f5008632c
e08ef487ea939c492e136e06f19393b6ebd83382
refs/heads/master
2021-09-11T01:22:45.694774
2018-04-05T15:19:30
2018-04-05T15:19:32
119,140,029
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package com.altas.erp.eds.entity; public class AccountBankStatementImportEntityWithBLOBs extends AccountBankStatementImportEntity { /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ private byte[] dataFile; /** * * This field was generated by MyBatis Generator. * This field corresponds to the database column account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ private String filename; /** * This method was generated by MyBatis Generator. * This method returns the value of the database column account_bank_statement_import.data_file * * @return the value of account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public byte[] getDataFile() { return dataFile; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column account_bank_statement_import.data_file * * @param dataFile the value for account_bank_statement_import.data_file * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public void setDataFile(byte[] dataFile) { this.dataFile = dataFile; } /** * This method was generated by MyBatis Generator. * This method returns the value of the database column account_bank_statement_import.filename * * @return the value of account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public String getFilename() { return filename; } /** * This method was generated by MyBatis Generator. * This method sets the value of the database column account_bank_statement_import.filename * * @param filename the value for account_bank_statement_import.filename * * @mbg.generated Thu Apr 05 20:29:43 CST 2018 */ public void setFilename(String filename) { this.filename = filename == null ? null : filename.trim(); } }
[ "enjoy0924@163.com" ]
enjoy0924@163.com
df4e24ebf5a5fb00cb8987d22bf45faaf1700b81
f5cb08ec1b56ac4a4bb3081e020db3f05d347212
/TP4-Carnet/src/DAO/CsvDAO.java
3cb0e4411b8b7ea080ae9f4c5f44cca1028dd772
[]
no_license
fornito2u/DP-ACL-TP-2018
565c915191e6163c4292523c2bcfcd7dfad407b5
c9e6cd576b7fe189817cc4060022ba1b506a4a71
refs/heads/master
2020-04-01T13:22:32.070415
2018-11-09T13:55:07
2018-11-09T13:55:07
153,249,966
0
0
null
null
null
null
UTF-8
Java
false
false
2,003
java
package DAO; import Annuaire.Annuaire; import Personne.Personne; import java.io.*; public class CsvDAO implements ContactDAO { private String pathToFile; public CsvDAO(String pathToFile){ config(pathToFile); } public void config(String pathToFile){ this.pathToFile = pathToFile; } @Override public boolean save(Annuaire annuaire) { try { FileWriter writer = new FileWriter(pathToFile); String csvSeparator = ","; for(Personne p : annuaire){ writer.append(p.parse(csvSeparator)); writer.append('\n'); writer.flush(); } writer.close(); return true; } catch(IOException e) { } return false; } @Override public boolean load(Annuaire annuaire) { BufferedReader br = null; String line; //séparateur du CSV String csvSeparator = ","; System.out.println("CSV Loader"); try { br = new BufferedReader(new FileReader(pathToFile)); int i=0; //on boucle sur chaque ligne du fichier while ((line = br.readLine()) != null) { i++; // on récupère la ligne que l'on découpe en fonction du séparateur, on // obtient un tableau de chaînes de caractères (pour chaque ligne) String[] contacts = line.split(csvSeparator); //Affichage dans la foulée pour montrer le résultat System.out.println("Contact #"+i+" : " + contacts[1] + " " + contacts[0] + " (" + contacts[2]+ ")"); annuaire.add(new Personne(contacts[0],contacts[1],contacts[2])); // on aurait pu stocker les informations dans une autre structure de // données un peu plus optimale, bien évidemment (List, Map, etc.) } return true; } catch (FileNotFoundException e) { System.out.println("FILE NOT FOUND CsvDAO."); } catch (IOException e) { System.out.println("IOException CsvDAO"); } finally { if (br != null) { try { br.close(); } catch (IOException e) { } } } return false; } }
[ "marvin.fornito@gmail.com" ]
marvin.fornito@gmail.com