blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
d0b14b0e709ae9b95a707911063b5cfc6844b9a1
e7d5fefca795150cef4373a848d6f83a46b2144f
/src/main/java/br/com/exemplo/config/ElasticsearchConfiguration.java
9e2f5bcbbb0df1445987cf882cf2b841a4bfc964
[]
no_license
zucolottomaxson/sample-application
b4797c4e08aa000053fffbba772ed7bfd5b7a88d
202a7dcae2628d04a6acd61880e84aed1561134d
refs/heads/master
2022-12-11T20:40:39.344017
2020-08-30T19:01:36
2020-08-30T19:01:36
291,533,610
0
0
null
null
null
null
UTF-8
Java
false
false
3,657
java
package br.com.exemplo.config; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.github.vanroy.springdata.jest.JestElasticsearchTemplate; import com.github.vanroy.springdata.jest.mapper.DefaultJestResultsMapper; import io.searchbox.client.JestClient; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.EntityMapper; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.mapping.MappingException; @Configuration @EnableConfigurationProperties(ElasticsearchProperties.class) public class ElasticsearchConfiguration { private ObjectMapper mapper; public ElasticsearchConfiguration(ObjectMapper mapper) { this.mapper = mapper; } @Bean public EntityMapper getEntityMapper() { return new CustomEntityMapper(mapper); } @Bean @Primary public ElasticsearchOperations elasticsearchTemplate( JestClient jestClient, ElasticsearchConverter elasticsearchConverter, SimpleElasticsearchMappingContext mappingContext, EntityMapper entityMapper ) { return new JestElasticsearchTemplate( jestClient, elasticsearchConverter, new DefaultJestResultsMapper(mappingContext, entityMapper) ); } public class CustomEntityMapper implements EntityMapper { private ObjectMapper objectMapper; public CustomEntityMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); objectMapper.configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, true); objectMapper.configure(SerializationFeature.INDENT_OUTPUT, false); objectMapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, true); } @Override public String mapToString(Object object) throws IOException { return objectMapper.writeValueAsString(object); } @Override public <T> T mapToObject(String source, Class<T> clazz) throws IOException { return objectMapper.readValue(source, clazz); } @Override public Map<String, Object> mapObject(Object source) { try { return objectMapper.readValue(mapToString(source), HashMap.class); } catch (IOException e) { throw new MappingException(e.getMessage(), e); } } @Override public <T> T readObject(Map<String, Object> source, Class<T> targetType) { try { return mapToObject(mapToString(source), targetType); } catch (IOException e) { throw new MappingException(e.getMessage(), e); } } } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
2436ac62c138b2c17cc3c94bcc37cd107358b6fb
5b53982ebf5b7f5c52afd78de65893c74ec603a8
/Sem04/DemoMVC/src/pe/egcc/eureka/controller/AppController.java
69a1dfc9dd31bfe47ad43322bb5862daa362cc3d
[]
no_license
gcoronelc/USIL_TPW_2017_2_TM
a40b18b9e0ce8d6a45c4ca45f53dccbd8ad0d130
ec08b3450155daf43e5e9f26c5d90239dc483fa0
refs/heads/master
2021-08-22T17:20:23.388166
2017-11-30T18:13:38
2017-11-30T18:13:38
100,329,571
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package pe.egcc.eureka.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class AppController { @RequestMapping(value="index.htm", method=RequestMethod.GET) public String index(){ return "index"; } }
[ "gcoronelc@gmail.com" ]
gcoronelc@gmail.com
76e6b320da029ab9473f36428568953a956a8f82
1e8a5381b67b594777147541253352e974b641c5
/com/google/android/gms/internal/zzes.java
25a7ca538cada91b2df0a80c44bee04b3f487db8
[]
no_license
jramos92/Verify-Prueba
d45f48829e663122922f57720341990956390b7f
94765f020d52dbfe258dab9e36b9bb8f9578f907
refs/heads/master
2020-05-21T14:35:36.319179
2017-03-11T04:24:40
2017-03-11T04:24:40
84,623,529
1
0
null
null
null
null
UTF-8
Java
false
false
1,340
java
package com.google.android.gms.internal; import android.location.Location; import com.google.android.gms.ads.mediation.MediationAdRequest; import java.util.Date; import java.util.Set; @zzgr public final class zzes implements MediationAdRequest { private final Date zzaT; private final Set<String> zzaV; private final boolean zzaW; private final Location zzaX; private final int zzsR; private final int zzzI; public zzes(Date paramDate, int paramInt1, Set<String> paramSet, Location paramLocation, boolean paramBoolean, int paramInt2) { this.zzaT = paramDate; this.zzsR = paramInt1; this.zzaV = paramSet; this.zzaX = paramLocation; this.zzaW = paramBoolean; this.zzzI = paramInt2; } public Date getBirthday() { return this.zzaT; } public int getGender() { return this.zzsR; } public Set<String> getKeywords() { return this.zzaV; } public Location getLocation() { return this.zzaX; } public boolean isTesting() { return this.zzaW; } public int taggedForChildDirectedTreatment() { return this.zzzI; } } /* Location: C:\Users\julian\Downloads\Veryfit 2 0_vV2.0.28_apkpure.com-dex2jar.jar!\com\google\android\gms\internal\zzes.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ramos.marin92@gmail.com" ]
ramos.marin92@gmail.com
ff89e779e2548a034686df7b9dc3c3da26d0d6cd
e4e3dc49a1e92195d97f61c5c8f36178214e12c2
/src/net/wit/service/impl/UnionServiceImpl.java
f009e604dd49e19d2970ef63922122b26e6fe46e
[]
no_license
pologood/FMCG
1a393fcc4c7942ca932a2ee5c169c3bf630145e0
690cb06da198fb6a3dec98c1ed7b4886b716a40b
refs/heads/master
2021-01-09T20:08:09.461153
2017-02-06T09:27:48
2017-02-06T09:27:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
package net.wit.service.impl; import javax.annotation.Resource; import net.wit.Page; import net.wit.Pageable; import net.wit.dao.UnionDao; import net.wit.entity.Tenant; import net.wit.entity.Union; import net.wit.service.UnionService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * 货郎联盟 * @author Administrator * */ @Service("unionServiceImpl") public class UnionServiceImpl extends BaseServiceImpl<Union,Long> implements UnionService{ @Resource(name = "unionDaoImpl") public void setBaseDao(UnionDao unionDao) { super.setBaseDao(unionDao); } @Resource(name = "unionDaoImpl") private UnionDao unionDao; @Transactional(readOnly = true) public Page<Union> findPage(Pageable pageable){ return unionDao.findPage(pageable); } @Transactional(readOnly = true) public Page<Union> findPage(String keyword, Pageable pageable){ return unionDao.findPage(keyword,pageable); } @Transactional(readOnly = true) public Page<Tenant> findTenant(Union union, Pageable pageable){ return unionDao.findTenant(union,pageable); } }
[ "hujun519191086@163.com" ]
hujun519191086@163.com
eb0934365696634858ad8d6e7d0cae9620374093
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/11/org/jfree/data/statistics/HistogramType_readResolve_134.java
a6c8e09932b842c803eb3fbd13ff60c8081a7d15
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
674
java
org jfree data statist creat constant repres histogram type bloch' tip effect 'effect java' histogram type histogramtyp serializ ensur serial return uniqu instanc object object stream except objectstreamexcept problem object read resolv readresolv object stream except objectstreamexcept equal histogram type histogramtyp frequenc histogram type histogramtyp frequenc equal histogram type histogramtyp rel frequenc histogram type histogramtyp rel frequenc equal histogram type histogramtyp scale area histogram type histogramtyp scale area
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
3539153790a35e7d252b19eb75346bf7c6688dba
7754ba2134a7c3875e1abead9116d2116fe719e7
/src/main/java/com/xavier/theordersapi/service/exception/BusnessException.java
90de75389cf2669bb2320f6d60e1e5d81851b998
[]
no_license
fxavier/theordersapi
9a17cc32361edf80f3d90676a3bbd20953fc1a26
ecccd9a0ff1c99563414fbee3f7766f41a9a998a
refs/heads/master
2020-09-29T17:31:42.650424
2020-01-07T13:57:49
2020-01-07T13:57:49
227,084,213
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package com.xavier.theordersapi.service.exception; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @RequiredArgsConstructor @Getter public class BusnessException extends RuntimeException { private final String code; private final HttpStatus status; }
[ "xavierfrancisco353@gmail.com" ]
xavierfrancisco353@gmail.com
d851b70c232d442eb5c11a472e73db61ba39c504
f417dbb7856d987373c1588014b9aed059235015
/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/ComposedSpringExtensionTests.java
8fb028a8bc8ac5f3c3a9d025904a587109f91b3a
[ "Apache-2.0" ]
permissive
MonsterCodingJ/spring-framework
975c0bc44247cfbd367bdb35da67146c0d7e3971
5f152cb1530ea88485efef115e0ff05687301792
refs/heads/master
2022-12-05T04:43:08.831380
2020-08-28T00:47:56
2020-08-28T00:47:56
290,420,347
0
0
null
null
null
null
UTF-8
Java
false
false
2,734
java
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.context.junit.jupiter; import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.SpringJUnitJupiterTestSuite; import org.springframework.test.context.junit.jupiter.comics.Person; import static org.junit.jupiter.api.Assertions.*; /** * Integration tests which demonstrate the composability of annotations from * JUnit Jupiter and the Spring TestContext Framework. * * <p>Note that {@link SpringJUnitConfig @SpringJUnitConfig} is meta-annotated * with JUnit Jupiter's {@link ExtendWith @ExtendWith} <b>and</b> Spring's * {@link ContextConfiguration @ContextConfiguration}. * * <p>To run these tests in an IDE that does not have built-in support for the JUnit * Platform, simply run {@link SpringJUnitJupiterTestSuite} as a JUnit 4 test. * * @author Sam Brannen * @since 5.0 * @see SpringExtension * @see SpringJUnitConfig * @see SpringExtensionTests */ @SpringJUnitConfig(TestConfig.class) @DisplayName("@SpringJUnitConfig Tests") class ComposedSpringExtensionTests { @Autowired Person dilbert; @Autowired List<Person> people; @Test @DisplayName("ApplicationContext injected into method") void applicationContextInjected(ApplicationContext applicationContext) { assertNotNull(applicationContext, "ApplicationContext should have been injected into method by Spring"); assertEquals(dilbert, applicationContext.getBean("dilbert", Person.class)); } @Test @DisplayName("Spring @Beans injected into fields") void springBeansInjected() { assertNotNull(dilbert, "Person should have been @Autowired by Spring"); assertEquals("Dilbert", dilbert.getName(), "Person's name"); assertEquals(2, people.size(), "Number of Person objects in context"); } }
[ "459997077@qq.com" ]
459997077@qq.com
89bd368ea4b597c05f41246206af6f6b1a62a2da
c2bf5b82f209f41746d3b56b593db4a457e8bbd3
/src/main/java/br/com/travelmate/model/Formapagamento_.java
948865abd4aae4ca122df197983e868ed7a9531e
[]
no_license
julioizidoro/systm-com
93d008f4d291bc2e1eda33ec32abdbc537388795
ecf99caebbf59adc2bda33c7a3925794f796980d
refs/heads/master
2020-03-27T10:52:17.319659
2018-08-29T19:59:32
2018-08-29T19:59:32
146,450,606
0
0
null
null
null
null
UTF-8
Java
false
false
1,172
java
package br.com.travelmate.model; import javax.annotation.Generated; import javax.persistence.metamodel.ListAttribute; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="Dali", date="2018-03-01T21:10:40.117-0300") @StaticMetamodel(Formapagamento.class) public class Formapagamento_ { public static volatile SingularAttribute<Formapagamento, Integer> idformaPagamento; public static volatile SingularAttribute<Formapagamento, String> condicao; public static volatile SingularAttribute<Formapagamento, Float> valorOrcamento; public static volatile SingularAttribute<Formapagamento, String> possuiJuros; public static volatile SingularAttribute<Formapagamento, Float> valorJuros; public static volatile SingularAttribute<Formapagamento, Float> valorTotal; public static volatile SingularAttribute<Formapagamento, String> observacoes; public static volatile SingularAttribute<Formapagamento, Float> valordesconto; public static volatile ListAttribute<Formapagamento, Parcelamentopagamento> parcelamentopagamentoList; public static volatile SingularAttribute<Formapagamento, Vendas> vendas; }
[ "julioizidoro@192.168.100.17" ]
julioizidoro@192.168.100.17
d1f21b6b739dc2f769aed423dc1ae4ce691fcfef
8700fa500c760a8049c65df590632783cd64940a
/testjava/TIJ4-code/gui/SubmitLabelManipulationTask.java
88f89f67caee64897a07409f11a9dca655cd03ef
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
SrikanthParsha14/test
8ebac746f31d450b39eca1001525961497d962ba
8cee69e09c8557d53d8d30382cec8ea5c1f82f6e
refs/heads/master
2020-06-05T06:54:36.274446
2017-08-03T08:39:43
2017-08-03T08:39:43
192,351,172
1
0
MIT
2019-06-17T13:20:39
2019-06-17T13:20:38
null
UTF-8
Java
false
false
671
java
//: gui/SubmitLabelManipulationTask.java package gui; /* Added by Eclipse.py */ import javax.swing.*; import java.util.concurrent.*; public class SubmitLabelManipulationTask { public static void main(String[] args) throws Exception { JFrame frame = new JFrame("Hello Swing"); final JLabel label = new JLabel("A Label"); frame.add(label); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 100); frame.setVisible(true); TimeUnit.SECONDS.sleep(1); SwingUtilities.invokeLater(new Runnable() { public void run() { label.setText("Hey! This is Different!"); } }); } } ///:~
[ "quchunguang@gmail.com" ]
quchunguang@gmail.com
efed00c8d14036837866fd153f6beeac1b036791
d9228de643a450e04c4f186ae0651329b2b1076f
/ex10/src/ex10/MetodoBabilonico.java
44d83df5db0a6d7d08ebd96f35bae052e800cf4f
[]
no_license
LucasAMiranda/Java-Learning
fdf0d3defc78364f93b6eaeef49e78f0d6266173
c3463f102cf14cb33f9a279cc4a7f14c4000113c
refs/heads/master
2023-01-22T08:19:18.648209
2020-12-01T20:43:52
2020-12-01T20:43:52
317,661,868
0
0
null
null
null
null
ISO-8859-1
Java
false
false
544
java
package ex10; import java.util.Scanner; public class MetodoBabilonico { public static void main(String[] args) { Scanner numero = new Scanner(System.in); int entrada; double resultado; double soma; double divisao; System.out.println("Digite um número e retorne sua raiz quadrada "); entrada = numero.nextInt(); resultado = Math.sqrt(entrada); System.out.println(resultado); soma = entrada + resultado; System.out.println(soma); divisao = entrada / resultado; System.out.println(divisao); } }
[ "you@example.com" ]
you@example.com
7326d6ad8729084e13e64f83f8be7b8e1e927a97
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.browser-base/sources/defpackage/C4951tg1.java
8ae649aed7fd2b37ed406f436ac406b62f1ccb25
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
549
java
package defpackage; /* renamed from: tg1 reason: default package and case insensitive filesystem */ /* compiled from: chromium-OculusBrowser.apk-stable-281887347 */ public final class C4951tg1 extends AbstractC4340q31 { public static final CC[] b; public static final CC c; static { CC[] ccArr = {new CC(8, 0)}; b = ccArr; c = ccArr[0]; } public C4951tg1() { super(8, 0); } @Override // defpackage.AbstractC4340q31 public final void a(C1648aL aLVar) { aLVar.x(c); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
1302be2cca7e930f318197f92f5a8f6cd2df975a
9cee874d8f65a4d915b2053dd22f47bd0d222f36
/2.Behavioral Design Pattern/src/commandPattern/CutCommand.java
4c8c29d2219d69ae5332c578ca1fcd96eccceed2
[]
no_license
AkashMaharana/Design_Pattern_JAVA
c465b38360ecc3906ae57a9a73fba91279cdec07
4b58ca78a710fd074c8c2ebf4bf1f4a826bc16b0
refs/heads/main
2023-06-19T01:00:27.994013
2021-07-19T16:57:39
2021-07-19T16:57:39
387,515,486
0
0
null
null
null
null
UTF-8
Java
false
false
705
java
package commandPattern; public class CutCommand extends Command { public CutCommand(Editor editor) { super(editor); } @Override public boolean execute() { if (this.getEditor().textField.getSelectedText().isEmpty()) { return false; } backup(); String source = this.getEditor().textField.getText(); this.getEditor().clipboard = this.getEditor().textField.getSelectedText(); this.getEditor().textField.setText(cutString(source)); return true; } private String cutString(String source) { String start = source.substring(0, this.getEditor().textField.getSelectionStart()); String end = source.substring(this.getEditor().textField.getSelectionEnd()); return start + end; } }
[ "akashmaharana93@gmail.com" ]
akashmaharana93@gmail.com
3620d0935301346a32671d2310952fbf92484d2c
0301343f34c097e0209bdbec60571880e482820a
/src/database/models/active/Feedback.java
c109d87e54d3c6316b15cba1b53d2dc6b5f061e6
[]
no_license
Jinx009/pro_new_jgy
41f65e2c8f7955a4a63aadd45b3eafab96256934
fa1f4d0e4e416150b3b5c3a6ff302e58e1ec6de1
refs/heads/master
2021-01-22T03:22:23.893760
2018-06-13T09:36:19
2018-06-13T09:36:19
92,374,149
0
0
null
null
null
null
UTF-8
Java
false
false
1,786
java
package database.models.active; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="feedback_jgy") public class Feedback { @Id @Column(unique=true, nullable=false) @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name = "nick_name") private String nickName; @Column(name = "user_id") private Integer userId; @Column(name = "content") private String content; @Column(name = "add_time") private Date addTime; @Column(name = "phone") private String phone; @Column(name = "score") private Integer score; @Column private String type; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNickName() { return nickName; } public void setNickName(String nickName) { this.nickName = nickName; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getAddTime() { return addTime; } public void setAddTime(Date addTime) { this.addTime = addTime; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public Integer getScore() { return score; } public void setScore(Integer score) { this.score = score; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
[ "jinxlovejinx@vip.qq.com" ]
jinxlovejinx@vip.qq.com
ec81e6ee217ea379abcbc01a6c5bd39d56a94f42
6a95484a8989e92db07325c7acd77868cb0ac3bc
/modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201405/TextValue.java
4e452cb4bb57fbab0a8fff2b86130f33a3091046
[ "Apache-2.0" ]
permissive
popovsh6/googleads-java-lib
776687dd86db0ce785b9d56555fe83571db9570a
d3cabb6fb0621c2920e3725a95622ea934117daf
refs/heads/master
2020-04-05T23:21:57.987610
2015-03-12T19:59:29
2015-03-12T19:59:29
33,672,406
1
0
null
2015-04-09T14:06:00
2015-04-09T14:06:00
null
UTF-8
Java
false
false
3,751
java
/** * TextValue.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.dfp.axis.v201405; /** * Contains a string value. */ public class TextValue extends com.google.api.ads.dfp.axis.v201405.Value implements java.io.Serializable { /* The string value. */ private java.lang.String value; public TextValue() { } public TextValue( java.lang.String valueType, java.lang.String value) { super( valueType); this.value = value; } /** * Gets the value value for this TextValue. * * @return value * The string value. */ public java.lang.String getValue() { return value; } /** * Sets the value value for this TextValue. * * @param value * The string value. */ public void setValue(java.lang.String value) { this.value = value; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TextValue)) return false; TextValue other = (TextValue) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && ((this.value==null && other.getValue()==null) || (this.value!=null && this.value.equals(other.getValue()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); if (getValue() != null) { _hashCode += getValue().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(TextValue.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201405", "TextValue")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("value"); elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201405", "value")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "cseeley@google.com" ]
cseeley@google.com
dd7bb6f29c0d27fe09cbef62a968b85514e1d264
8f87065bc3cb6d96ea2e398a98aacda4fc4bbe43
/src/Class00000632Better.java
d80b9fdc0c1ebf9b0d616707b86ca2822c6cb465
[]
no_license
fracz/code-quality-benchmark
a243d345441582473532f9b013993f77d59e19ae
c23e76fe315f43bea899beabb856e61348c34e09
refs/heads/master
2020-04-08T23:40:36.408828
2019-07-31T17:54:53
2019-07-31T17:54:53
159,835,188
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
// original filename: 00052526.txt // before public class Class00000632Better { protected Set<TokenType> getCustomizedInsertKeywords() { return Collections.emptySet(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
ff21cacae61cd84ded0d62014c0218d80415468d
939bc9b579671de84fb6b5bd047db57b3d186aca
/java.xml/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java
b2e0d198906657ef40b835e2b755eba6fe4b433d
[]
no_license
lc274534565/jdk11-rm
509702ceacfe54deca4f688b389d836eb5021a17
1658e7d9e173f34313d2e5766f4f7feef67736e8
refs/heads/main
2023-01-24T07:11:16.084577
2020-11-16T14:21:37
2020-11-16T14:21:37
313,315,578
1
1
null
null
null
null
UTF-8
Java
false
false
4,733
java
/* * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ /* * 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 com.sun.org.apache.xalan.internal.xsltc.dom; import com.sun.org.apache.xalan.internal.xsltc.DOM; import com.sun.org.apache.xalan.internal.xsltc.Translet; import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; /** * @author Jacek Ambroziak * @author Santiago Pericas-Geertsen */ public abstract class AnyNodeCounter extends NodeCounter { public AnyNodeCounter(Translet translet, DOM document, DTMAxisIterator iterator) { super(translet, document, iterator); } public AnyNodeCounter(Translet translet, DOM document, DTMAxisIterator iterator, boolean hasFrom) { super(translet, document, iterator, hasFrom); } public NodeCounter setStartNode(int node) { _node = node; _nodeType = _document.getExpandedTypeID(node); return this; } public String getCounter() { int result; if (_value != Integer.MIN_VALUE) { //See Errata E24 if (_value == 0) return "0"; else if (Double.isNaN(_value)) return "NaN"; else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity"; else if (Double.isInfinite(_value)) return "Infinity"; else return formatNumbers((int)_value); } else { int next = _node; final int root = _document.getDocument(); result = 0; while (next >= root && !matchesFrom(next)) { if (matchesCount(next)) { ++result; } next--; //%HZ%: Is this the best way of finding the root? Is it better to check //%HZ%: parent(next)? /* if (next == root) { break; } else { --next; } */ } } return formatNumbers(result); } public static NodeCounter getDefaultNodeCounter(Translet translet, DOM document, DTMAxisIterator iterator) { return new DefaultAnyNodeCounter(translet, document, iterator); } static class DefaultAnyNodeCounter extends AnyNodeCounter { public DefaultAnyNodeCounter(Translet translet, DOM document, DTMAxisIterator iterator) { super(translet, document, iterator); } public String getCounter() { int result; if (_value != Integer.MIN_VALUE) { //See Errata E24 if (_value == 0) return "0"; else if (Double.isNaN(_value)) return "NaN"; else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity"; else if (Double.isInfinite(_value)) return "Infinity"; else result = (int) _value; } else { int next = _node; result = 0; final int ntype = _document.getExpandedTypeID(_node); final int root = _document.getDocument(); while (next >= 0) { if (ntype == _document.getExpandedTypeID(next)) { result++; } //%HZ%: Is this the best way of finding the root? Is it better to check //%HZ%: parent(next)? if (next == root) { break; } else { --next; } } } return formatNumbers(result); } } }
[ "274534565@qq.com" ]
274534565@qq.com
bf325a0bf3964ea63c2fd96677109580110dd2f6
182d84979231402306a5c65e018d29fc1f601983
/src/main/java/com/leon/leetcodeleon/q000/q062/Q062UniquePaths.java
1c65e21b503f6c8340bb34fefcc6352f7ab77a2b
[]
no_license
severalfly/leetcode-leon
b5aaa97dc1c6f14ce21ff7c1856593d9383f9078
d625e0977e78600215886db5d28e21bd835b9183
refs/heads/master
2021-07-08T05:25:25.599102
2020-11-23T14:40:02
2020-11-23T14:40:02
210,115,589
1
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
package com.leon.leetcodeleon.q000.q062; import com.leon.leetcodeleon.util.ObjectUtils; import org.junit.Test; public class Q062UniquePaths { @Test public void test() { assert uniquePaths(10, 1) == 1; assert uniquePaths(1, 10) == 1; assert uniquePaths(1, 2) == 1; assert uniquePaths(7, 3) == 28; assert uniquePaths(3, 7) == 28; assert uniquePaths(3, 2) == 3; assert uniquePaths(4, 4) == 20; } public int uniquePaths(int m, int n) { if (m <= 0 || n <= 0) { return 0; } int[][] rs = new int[m][n]; for (int i = 0; i < n; i++) { rs[0][i] = 1; } for (int j = 0; j < m; j++) { rs[j][0] = 1; } int i = 1; int j = 1; while (i < m || j < n) { if (j >= n) { j = n - 1; } if (i >= m) { i = m - 1; } for (int k = 1; k < i && j > 0; k++) { rs[k][j] = rs[k - 1][j] + rs[k][j - 1]; } for (int k = 1; k < j && i > 0; k++) { rs[i][k] = rs[i - 1][k] + rs[i][k - 1]; } rs[i][j] = (i > 0 ? rs[i - 1][j] : 0) + (j > 0 ? rs[i][j - 1] : 0); if (i < m) i++; if (j < n) j++; } ObjectUtils.print(rs); return rs[m - 1][n - 1]; } }
[ "zhangsmile90@gmail.com" ]
zhangsmile90@gmail.com
d646e9a8af78af0e03f20a9eae84e30caf0e0254
91de42350a0c1ae23cefb866e02976b48b441b83
/src/com/asiainfo/chapter5/exercise/Exercise_13.java
b6e004eaf99005a281e90bed126ff73cdbcfed84
[]
no_license
zhangzhiwang/ThinkingInJava
05996f1fb93331ada3bfdb1cded4e7d37f2d9c78
3aae2d5583dc7b6d5f1a93660d5ac2132c38e564
refs/heads/master
2020-04-06T07:04:59.236348
2016-07-31T23:49:51
2016-07-31T23:49:51
38,598,285
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
772
java
package com.asiainfo.chapter5.exercise; /** * p97Á·Ï°13 * * @author zhangzw8@asiainfo.com\n 2015Äê8ÔÂ5ÈÕ */ public class Exercise_13 { // private static Tables t1 = new Tables(1); // private static Tables t2 = new Tables(2); public static void main(String[] args) { // new Tables(1); Tables.num++; // System.out.println(Tables.num); } } class Cups { public Cups(int i) { System.out.println("Cups " + i); } } class Tables { public static Cups c1; public static Cups c2; public Cups c3 = new Cups(3); public static int num; static { c1 = new Cups(1); c2 = new Cups(2); num = 1; } public Tables(int i) { System.out.println("Tables " + i); System.out.println("---------------"); } }
[ "934109401@qq.com" ]
934109401@qq.com
7571548f7eada69044500ef9ee4b5fe2ccc7516a
c0e7c5eded29011d76e73d38c674ad2be53b3417
/src/main/java/com/rusty/wsdemo/security/jwt/JWTConfigurer.java
c7b05d978ff23a439fb267aa4c494475ffda53a7
[]
no_license
wprusty/wsdemo
1e704b51a45c25ff9b69f45e048f336791dab3a1
4d77154117d16541a6197c4a42c88cd079e55e19
refs/heads/master
2021-08-22T05:55:40.404005
2017-11-29T12:17:53
2017-11-29T12:17:53
112,471,776
0
0
null
null
null
null
UTF-8
Java
false
false
928
java
package com.rusty.wsdemo.security.jwt; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JWTConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { public static final String AUTHORIZATION_HEADER = "Authorization"; private TokenProvider tokenProvider; public JWTConfigurer(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void configure(HttpSecurity http) throws Exception { JWTFilter customFilter = new JWTFilter(tokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
608079266324141f628e3adf797133d9bab98e26
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_f95f8c23d50628e094dd33a2b801d0cdb1b3172f/QuickPrefsActivity/35_f95f8c23d50628e094dd33a2b801d0cdb1b3172f_QuickPrefsActivity_t.java
6e3de6251107e9610e5e93b0ca9a6ea5053e13a7
[]
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
4,926
java
/** * Copyright (C) 2013 Jonathan Gillett, Joseph Heron * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.tinfoil.sms.settings; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.preference.EditTextPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; import android.view.Menu; import android.view.MenuItem; import com.tinfoil.sms.R; import com.tinfoil.sms.utility.SMSUtility; public class QuickPrefsActivity extends PreferenceActivity { public static final String ENABLE_SETTING_KEY = "enable"; public static final String NATIVE_SAVE_SETTING_KEY = "native_save_settings"; public static final String MESSAGE_LIMIT_SETTING_KEY = "message_limit"; public static final String IMPORT_CONTACT_SETTING_KEY = "import_contacts"; public static final String MANAGE_CONTACTS_SETTING_KEY = "manage_contacts"; public static final String SHOW_ENCRYPT_SETTING_KEY = "show_encrypt"; public static final String PUBLIC_KEY_SETTING_KEY = "public_key"; public static final String NOTIFICATION_BAR_SETTING_KEY = "notification_bar"; public static final String VIBRATE_SETTING_KEY = "vibrate"; public static final String VIBRATE_LENGTH_SETTING_KEY = "vibrate_length_settings"; public static final String RINGTONE_SETTING_KEY = "ringtone_settings"; public static final String BUGSENSE_ENABLE_SETTING_KEY = "bugsense_enable"; public static final String SOURCE_CODE_SETTING_KEY = "source_code"; public static final String REVERSE_MESSAGE_ORDERING_KEY = "list_order"; //public static final String messageLimitKey = /** * Things done when the preference menu is created * Left as default */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* * Add preferences from the options.xml file. */ addPreferencesFromResource(R.xml.options); PreferenceScreen sourceCode = (PreferenceScreen)findPreference(SOURCE_CODE_SETTING_KEY); sourceCode.setOnPreferenceClickListener(new OnPreferenceClickListener(){ @Override public boolean onPreferenceClick(Preference preference) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(QuickPrefsActivity.this.getString(R.string.tinfoil_sms_github))); QuickPrefsActivity.this.startActivity(i); return true; } }); EditTextPreference vibrateLength = (EditTextPreference)findPreference(VIBRATE_LENGTH_SETTING_KEY); vibrateLength.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){ @Override public boolean onPreferenceChange(Preference preference, Object newValue) { boolean ret = false; try{ if(SMSUtility.isASmallNumber(newValue.toString()) && Integer.valueOf(newValue.toString()) > 0) { ret = true; } } catch(NumberFormatException e) { e.printStackTrace(); } return ret; } }); //TODO implement the OnPreferenceChangeListener for the other preferences that use numbers only EditTextPreference messageLimit = (EditTextPreference)findPreference(MESSAGE_LIMIT_SETTING_KEY); messageLimit.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { boolean ret = false; try{ if(SMSUtility.isASmallNumber(newValue.toString()) && Integer.valueOf(newValue.toString()) > 0) { ret = true; } } catch(NumberFormatException e) { e.printStackTrace(); } return ret; } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(Menu.NONE, 0, 0, "Show current settings"); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c52194fba976111403013f3d05a30d23640edb03
48403b4e1e3efa5b880d72989790ac09e2b9729d
/oxygen-core/src/test/java/vip/justlive/oxygen/core/util/FileUtilsTest.java
fb500f70747deceb06f1178c9051e7cd032bc73f
[ "Apache-2.0" ]
permissive
yangmain/oxygen
a10a6030a8218d28c2521ce02ce4d9bb5b0b9bf9
ec3440c7cafbd9a7a3524d7393602c76c98b54ad
refs/heads/master
2020-12-10T06:43:23.509323
2020-01-11T08:00:08
2020-01-11T08:00:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,724
java
/* * Copyright (C) 2019 justlive1 * * 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 vip.justlive.oxygen.core.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.function.Predicate; import org.junit.Test; public class FileUtilsTest { @Test public void mkdirs1() { String name = "/tmp/a/1/1"; File file = new File(name); FileUtils.mkdirs(file); assertTrue(file.exists()); assertTrue(file.isDirectory()); name = "/tmp/a/2/2"; file = new File(name); FileUtils.mkdirs(name); assertTrue(file.exists()); assertTrue(file.isDirectory()); name = "/tmp/a/3/3"; file = new File(name); FileUtils.mkdirs(Paths.get(name)); assertTrue(file.exists()); assertTrue(file.isDirectory()); file = new File("/tmp/a"); assertEquals(0, FileUtils.countFiles(file)); assertEquals(7, FileUtils.countDirs(file)); assertEquals(7, FileUtils.delete(file)); } @Test public void mkdirs2() { String parent = "/tmp/a/4"; FileUtils.mkdirs(parent, "1", "2"); File file = new File(parent + "/1/2"); assertTrue(file.exists()); assertTrue(file.isDirectory()); assertEquals(4, FileUtils.delete(new File("/tmp/a"))); } @Test public void mkdirsForFile() { FileUtils.mkdirsForFile(new File("/tmp/a/5/a.log")); File file = new File("/tmp/a/5"); assertTrue(file.exists()); assertTrue(file.isDirectory()); assertEquals(2, FileUtils.delete(new File("/tmp/a"))); } @Test public void touch() { FileUtils.touch("/tmp/a/6/a.log"); File file = new File("/tmp/a/6/a.log"); assertTrue(file.exists()); assertTrue(file.isFile()); assertEquals(3, FileUtils.delete(new File("/tmp/a"))); } @Test public void extension() { assertEquals("txt", FileUtils.extension("a.txt")); } @Test public void t0() { Predicate<File> filter = file -> file.getName().endsWith(".log"); assertEquals(0, FileUtils.countDirs(new File("/tmp/a/7"))); assertEquals(0, FileUtils.countFiles(new File("/tmp/a/7"))); FileUtils.mkdirs("/tmp/a/7"); assertEquals(1, FileUtils.countDirs(new File("/tmp/a/7"))); assertEquals(0, FileUtils.countDirs(new File("/tmp/a/7"), filter)); assertEquals(0, FileUtils.countFiles(new File("/tmp/a/7"))); FileUtils.touch("/tmp/a/7/a.log"); assertEquals(0, FileUtils.countDirs(new File("/tmp/a/7/a.log"))); assertEquals(1, FileUtils.countFiles(new File("/tmp/a/7/a.log"))); assertEquals(0, FileUtils.countFiles(new File("/tmp/a/7/a.log"), filter.negate())); assertEquals(3, FileUtils.delete(new File("/tmp/a"))); assertEquals(0, FileUtils.delete(null)); assertEquals(0, FileUtils.deleteFile(null)); assertEquals(0, FileUtils.deleteDir(null)); FileUtils.touch("/tmp/a/7/a.log"); assertEquals(1, FileUtils.delete(new File("/tmp/a/7/a.log"))); FileUtils.delete(new File("/tmp/a")); } @Test public void t1() { assertFalse(FileUtils.isRoot(null)); assertFalse(FileUtils.isRoot(new File("."))); assertTrue(FileUtils.isRoot(new File("d:/"))); assertFalse(FileUtils.isSamePath(new File("/tmp/a"), new File("/tmp/a/b"))); assertTrue(FileUtils.isSamePath(new File("/tmp/a"), new File("/tmp/a/b/.."))); } @Test public void t2() { FileUtils.mkdirs((File) null); FileUtils.mkdirs((String) null); FileUtils.mkdirs((Path) null); FileUtils.mkdirsForFile(null); FileUtils.mkdirs("/tmp/a/8"); FileUtils.mkdirs("/tmp/a/8"); FileUtils.touch((Path) null); FileUtils.touch((String) null); FileUtils.touch(Paths.get("/tmp/a/8/a.log")); FileUtils.touch(Paths.get("/tmp/a/8/a.log")); FileUtils.delete(new File("/tmp/a")); } @Test public void testDownload() throws IOException { File file = new File("/tmp/baidu.png"); FileUtils.download("https://www.baidu.com/img/bd_logo1.png", file); FileUtils.deleteFile(file); file = FileUtils.download("https://www.baidu.com/img/bd_logo1.png"); FileUtils.deleteFile(file); } }
[ "qq11419041@163.com" ]
qq11419041@163.com
65987ecdc1b2b83a3cbdd40ed071013751909044
8d9293642d3c12f81cc5f930e0147a9d65bd6efb
/src/main/java/net/minecraft/client/model/BeeModel.java
50b919d97e91d9629fea4e0441dfac09c32bf18e
[]
no_license
NicholasBlackburn1/Blackburn-1.17
7c086591ac77cf433af248435026cf9275223daa
fd960b995b33df75ce61865ba119274d9b0e4704
refs/heads/main
2022-07-28T03:27:14.736924
2021-09-23T15:55:53
2021-09-23T15:55:53
399,960,376
5
0
null
null
null
null
UTF-8
Java
false
false
6,920
java
package net.minecraft.client.model; import com.google.common.collect.ImmutableList; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.CubeDeformation; import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.LayerDefinition; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; import net.minecraft.util.Mth; import net.minecraft.world.entity.animal.Bee; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class BeeModel<T extends Bee> extends AgeableListModel<T> { private static final float BEE_Y_BASE = 19.0F; private static final String BONE = "bone"; private static final String STINGER = "stinger"; private static final String LEFT_ANTENNA = "left_antenna"; private static final String RIGHT_ANTENNA = "right_antenna"; private static final String FRONT_LEGS = "front_legs"; private static final String MIDDLE_LEGS = "middle_legs"; private static final String BACK_LEGS = "back_legs"; private final ModelPart bone; private final ModelPart rightWing; private final ModelPart leftWing; private final ModelPart frontLeg; private final ModelPart midLeg; private final ModelPart backLeg; private final ModelPart stinger; private final ModelPart leftAntenna; private final ModelPart rightAntenna; private float rollAmount; public BeeModel(ModelPart p_170439_) { super(false, 24.0F, 0.0F); this.bone = p_170439_.getChild("bone"); ModelPart modelpart = this.bone.getChild("body"); this.stinger = modelpart.getChild("stinger"); this.leftAntenna = modelpart.getChild("left_antenna"); this.rightAntenna = modelpart.getChild("right_antenna"); this.rightWing = this.bone.getChild("right_wing"); this.leftWing = this.bone.getChild("left_wing"); this.frontLeg = this.bone.getChild("front_legs"); this.midLeg = this.bone.getChild("middle_legs"); this.backLeg = this.bone.getChild("back_legs"); } public static LayerDefinition createBodyLayer() { float f = 19.0F; MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); PartDefinition partdefinition1 = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(0.0F, 19.0F, 0.0F)); PartDefinition partdefinition2 = partdefinition1.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-3.5F, -4.0F, -5.0F, 7.0F, 7.0F, 10.0F), PartPose.ZERO); partdefinition2.addOrReplaceChild("stinger", CubeListBuilder.create().texOffs(26, 7).addBox(0.0F, -1.0F, 5.0F, 0.0F, 1.0F, 2.0F), PartPose.ZERO); partdefinition2.addOrReplaceChild("left_antenna", CubeListBuilder.create().texOffs(2, 0).addBox(1.5F, -2.0F, -3.0F, 1.0F, 2.0F, 3.0F), PartPose.offset(0.0F, -2.0F, -5.0F)); partdefinition2.addOrReplaceChild("right_antenna", CubeListBuilder.create().texOffs(2, 3).addBox(-2.5F, -2.0F, -3.0F, 1.0F, 2.0F, 3.0F), PartPose.offset(0.0F, -2.0F, -5.0F)); CubeDeformation cubedeformation = new CubeDeformation(0.001F); partdefinition1.addOrReplaceChild("right_wing", CubeListBuilder.create().texOffs(0, 18).addBox(-9.0F, 0.0F, 0.0F, 9.0F, 0.0F, 6.0F, cubedeformation), PartPose.offsetAndRotation(-1.5F, -4.0F, -3.0F, 0.0F, -0.2618F, 0.0F)); partdefinition1.addOrReplaceChild("left_wing", CubeListBuilder.create().texOffs(0, 18).mirror().addBox(0.0F, 0.0F, 0.0F, 9.0F, 0.0F, 6.0F, cubedeformation), PartPose.offsetAndRotation(1.5F, -4.0F, -3.0F, 0.0F, 0.2618F, 0.0F)); partdefinition1.addOrReplaceChild("front_legs", CubeListBuilder.create().addBox("front_legs", -5.0F, 0.0F, 0.0F, 7, 2, 0, 26, 1), PartPose.offset(1.5F, 3.0F, -2.0F)); partdefinition1.addOrReplaceChild("middle_legs", CubeListBuilder.create().addBox("middle_legs", -5.0F, 0.0F, 0.0F, 7, 2, 0, 26, 3), PartPose.offset(1.5F, 3.0F, 0.0F)); partdefinition1.addOrReplaceChild("back_legs", CubeListBuilder.create().addBox("back_legs", -5.0F, 0.0F, 0.0F, 7, 2, 0, 26, 5), PartPose.offset(1.5F, 3.0F, 2.0F)); return LayerDefinition.create(meshdefinition, 64, 64); } public void prepareMobModel(T p_102232_, float p_102233_, float p_102234_, float p_102235_) { super.prepareMobModel(p_102232_, p_102233_, p_102234_, p_102235_); this.rollAmount = p_102232_.getRollAmount(p_102235_); this.stinger.visible = !p_102232_.hasStung(); } public void setupAnim(T p_102237_, float p_102238_, float p_102239_, float p_102240_, float p_102241_, float p_102242_) { this.rightWing.xRot = 0.0F; this.leftAntenna.xRot = 0.0F; this.rightAntenna.xRot = 0.0F; this.bone.xRot = 0.0F; boolean flag = p_102237_.isOnGround() && p_102237_.getDeltaMovement().lengthSqr() < 1.0E-7D; if (flag) { this.rightWing.yRot = -0.2618F; this.rightWing.zRot = 0.0F; this.leftWing.xRot = 0.0F; this.leftWing.yRot = 0.2618F; this.leftWing.zRot = 0.0F; this.frontLeg.xRot = 0.0F; this.midLeg.xRot = 0.0F; this.backLeg.xRot = 0.0F; } else { float f = p_102240_ * 120.32113F * ((float)Math.PI / 180F); this.rightWing.yRot = 0.0F; this.rightWing.zRot = Mth.cos(f) * (float)Math.PI * 0.15F; this.leftWing.xRot = this.rightWing.xRot; this.leftWing.yRot = this.rightWing.yRot; this.leftWing.zRot = -this.rightWing.zRot; this.frontLeg.xRot = ((float)Math.PI / 4F); this.midLeg.xRot = ((float)Math.PI / 4F); this.backLeg.xRot = ((float)Math.PI / 4F); this.bone.xRot = 0.0F; this.bone.yRot = 0.0F; this.bone.zRot = 0.0F; } if (!p_102237_.isAngry()) { this.bone.xRot = 0.0F; this.bone.yRot = 0.0F; this.bone.zRot = 0.0F; if (!flag) { float f1 = Mth.cos(p_102240_ * 0.18F); this.bone.xRot = 0.1F + f1 * (float)Math.PI * 0.025F; this.leftAntenna.xRot = f1 * (float)Math.PI * 0.03F; this.rightAntenna.xRot = f1 * (float)Math.PI * 0.03F; this.frontLeg.xRot = -f1 * (float)Math.PI * 0.1F + ((float)Math.PI / 8F); this.backLeg.xRot = -f1 * (float)Math.PI * 0.05F + ((float)Math.PI / 4F); this.bone.y = 19.0F - Mth.cos(p_102240_ * 0.18F) * 0.9F; } } if (this.rollAmount > 0.0F) { this.bone.xRot = ModelUtils.rotlerpRad(this.bone.xRot, 3.0915928F, this.rollAmount); } } protected Iterable<ModelPart> headParts() { return ImmutableList.of(); } protected Iterable<ModelPart> bodyParts() { return ImmutableList.of(this.bone); } }
[ "nickblackburn02@gmail.com" ]
nickblackburn02@gmail.com
02b37ac9a547fbab278740245d98b85b941d597a
d532995b2899b6c8b3feb368c6183b15ff83cddb
/com/williamfiset/algorithms/datastructures/suffixarray/SuffixArrayMed.java
cdf45f9100feaa8638b80f2074d666d3a2aa69f4
[ "MIT" ]
permissive
ujjwal3067/Algorithms
460c0c08ec05c3d1b11a6dba45507d623a9da9a9
35bb91e939b3b7c6c31e2cd288f4f409297624b7
refs/heads/master
2020-12-20T21:00:18.001359
2020-01-24T01:59:04
2020-01-24T01:59:04
236,208,691
2
0
MIT
2020-01-25T18:05:53
2020-01-25T18:05:52
null
UTF-8
Java
false
false
3,659
java
/** * Medium speed suffix array implementation. Time Complexity: O(nlog^2(n)) * * @author William Fiset, william.alexandre.fiset@gmail.com */ package com.williamfiset.algorithms.datastructures.suffixarray; import java.util.*; public class SuffixArrayMed extends SuffixArray { // Wrapper class to help sort suffix ranks static class SuffixRankTuple implements Comparable<SuffixRankTuple> { int firstHalf, secondHalf, originalIndex; // Sort Suffix ranks first on the first half then the second half @Override public int compareTo(SuffixRankTuple other) { int cmp = Integer.compare(firstHalf, other.firstHalf); if (cmp == 0) return Integer.compare(secondHalf, other.secondHalf); return cmp; } @Override public String toString() { return originalIndex + " -> (" + firstHalf + ", " + secondHalf + ")"; } } public SuffixArrayMed(String text) { super(toIntArray(text)); } public SuffixArrayMed(int[] text) { super(text); } // Construct a suffix array in O(nlog^2(n)) @Override protected void construct() { sa = new int[N]; // Maintain suffix ranks in both a matrix with two rows containing the // current and last rank information as well as some sortable rank objects int[][] suffixRanks = new int[2][N]; SuffixRankTuple[] ranks = new SuffixRankTuple[N]; // Assign a numerical value to each character in the text for (int i = 0; i < N; i++) { suffixRanks[0][i] = T[i]; ranks[i] = new SuffixRankTuple(); } // O(log(n)) for (int pos = 1; pos < N; pos *= 2) { for (int i = 0; i < N; i++) { SuffixRankTuple suffixRank = ranks[i]; suffixRank.firstHalf = suffixRanks[0][i]; suffixRank.secondHalf = i + pos < N ? suffixRanks[0][i + pos] : -1; suffixRank.originalIndex = i; } // O(nlog(n)) java.util.Arrays.sort(ranks); int newRank = 0; suffixRanks[1][ranks[0].originalIndex] = 0; for (int i = 1; i < N; i++) { SuffixRankTuple lastSuffixRank = ranks[i - 1]; SuffixRankTuple currSuffixRank = ranks[i]; // If the first half differs from the second half if (currSuffixRank.firstHalf != lastSuffixRank.firstHalf || currSuffixRank.secondHalf != lastSuffixRank.secondHalf) newRank++; suffixRanks[1][currSuffixRank.originalIndex] = newRank; } // Place top row (current row) to be the last row suffixRanks[0] = suffixRanks[1]; // Optimization to stop early if (newRank == N - 1) break; } // Fill suffix array for (int i = 0; i < N; i++) { sa[i] = ranks[i].originalIndex; ranks[i] = null; } // Cleanup suffixRanks[0] = suffixRanks[1] = null; suffixRanks = null; ranks = null; } public static void main(String[] args) { // String[] strs = { "AAGAAGC", "AGAAGT", "CGAAGC" }; // String[] strs = { "abca", "bcad", "daca" }; // String[] strs = { "abca", "bcad", "daca" }; // String[] strs = { "AABC", "BCDC", "BCDE", "CDED" }; // String[] strs = { "abcdefg", "bcdefgh", "cdefghi" }; // String[] strs = { "xxx", "yyy", "zzz" }; // TreeSet <String> lcss = SuffixArrayMed.lcs(strs, 2); // System.out.println(lcss); // SuffixArrayMed sa = new SuffixArrayMed("abracadabra"); // System.out.println(sa); // System.out.println(java.util.Arrays.toString(sa.sa)); // System.out.println(java.util.Arrays.toString(sa.lcp)); SuffixArrayMed sa = new SuffixArrayMed("ABBABAABAA"); // SuffixArrayMed sa = new SuffixArrayMed("GAGAGAGAGAGAG"); System.out.println(sa); } }
[ "fisetwill@gmail.com" ]
fisetwill@gmail.com
f29a524af637a295558597c0bd0f1d31dd6685e2
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/19/org/apache/commons/lang3/reflect/TypeUtils_mapTypeVariablesToArguments_737.java
d112c1599ede608272e10d1de598cffdfad0da1e
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,914
java
org apach common lang3 reflect util method focus type inspect regard gener version type util typeutil perform map type variabl param gener type question param cl question param parameter type parameterizedtyp parameter type param type var assign typevarassign map fill map type variabl argument maptypevariablestoargu class cl parameter type parameterizedtyp parameter type parameterizedtyp map type variabl typevari type type var assign typevarassign captur type variabl owner type assign type owner type ownertyp parameter type parameterizedtyp owner type getownertyp owner type ownertyp parameter type parameterizedtyp recurs make owner' owner type process map type variabl argument maptypevariablestoargu cl parameter type parameterizedtyp owner type ownertyp type var assign typevarassign parameter type parameterizedtyp gener owner hierarchi implement extend cl find type variabl cl type argument parameter type parameterizedtyp type type arg typearg parameter type parameterizedtyp actual type argument getactualtypeargu cls' type variabl argument parameter type parameterizedtyp find determin type' argument type variabl typevari type var typevar raw type getrawtyp parameter type parameterizedtyp type paramet gettypeparamet list view type paramet cl method list type variabl typevari class type var list typevarlist arrai list aslist cl type paramet gettypeparamet type arg typearg length type variabl typevari type var typevar type var typevar type type arg typearg type arg typearg argument parameter type parameterizedtyp type variabl cl type var list typevarlist type arg typearg type variabl parameter type parameterizedtyp assign type type var assign typevarassign kei containskei type var typevar map assign cls' type variabl type var assign typevarassign put type variabl typevari type arg typearg type var assign typevarassign type var typevar
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
f622672651d16be8a5af67d4a79c33208f76ab53
94d91903819947c4fb2598af40cf53344304dbac
/wssmall_1.2.0/base_module/base/src/main/zj_inf/.svn/pristine/fe/feb83cb29744cf0b0bb552b7414aac90a92f6fc3.svn-base
42d28c70b7d0a0bffcf8d6cdebff261663ffda94
[]
no_license
lichao20000/Union
28175725ad19733aa92134ccbfb8c30570f4795a
a298de70065c5193c98982dacc7c2b3e2d4b5d86
refs/heads/master
2023-03-07T16:24:58.933965
2021-02-22T12:34:05
2021-02-22T12:34:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,675
/** * */ package zte.net.ecsord.params.ecaop.req.vo; import java.io.Serializable; import java.util.List; import org.apache.commons.lang3.StringUtils; /** * @author ZX * @version 2015-05-05 * @see 客户信息 * */ public class OpenDealApplyCustomerInfoVo implements Serializable { private String authTag; // Y 鉴权标识 0:未鉴权 1:已鉴权 private String realNameType; // Y 客户实名标识 0:实名 1:匿名 private String custType; // Y 新老客户标识 0:新增客户 1:老客户 private String custId; // N 老客户ID private List<OpenDealApplyNewCustomerInfoVo> newCustomerInfo; // 新客户信息 public String getAuthTag() { if (StringUtils.isBlank(authTag)) return null; return authTag; } public void setAuthTag(String authTag) { this.authTag = authTag; } public String getRealNameType() { if (StringUtils.isBlank(realNameType)) return null; return realNameType; } public void setRealNameType(String realNameType) { this.realNameType = realNameType; } public String getCustType() { if (StringUtils.isBlank(custType)) return null; return custType; } public void setCustType(String custType) { this.custType = custType; } public String getCustId() { if (StringUtils.isBlank(custId)) return null; return custId; } public void setCustId(String custId) { this.custId = custId; } public List<OpenDealApplyNewCustomerInfoVo> getNewCustomerInfo() { if (newCustomerInfo==null || newCustomerInfo.size()<=0) return null; return newCustomerInfo; } public void setNewCustomerInfo( List<OpenDealApplyNewCustomerInfoVo> newCustomerInfo) { this.newCustomerInfo = newCustomerInfo; } }
[ "hxl971230.outlook.com" ]
hxl971230.outlook.com
10633e0c8d03cb53cf0f7fbca1f97cf76c455159
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13457-16-29-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/web/ExportAction_ESTest_scaffolding.java
3f31c615b64619b37797edded3228ccdd5e56946
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 06 00:22:40 UTC 2020 */ package com.xpn.xwiki.web; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class ExportAction_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
caf5ea5d06ce475bbccbdcf6adf75b834284b720
db6e498dd76a6ce78d83e1e7801674783230a90d
/thirdlib/base-protocol/protocol/src/main/java/pb4client/MakeCityRtOrBuilder.java
455543349e2c54a8e9df50670f181af9480819d4
[]
no_license
daxingyou/game-4
3d78fb460c4b18f711be0bb9b9520d3e8baf8349
2baef6cebf5eb0991b1f5c632c500b522c41ab20
refs/heads/master
2023-03-19T15:57:56.834881
2018-10-10T06:35:57
2018-10-10T06:35:57
null
0
0
null
null
null
null
UTF-8
Java
false
true
419
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: client2server.proto package pb4client; public interface MakeCityRtOrBuilder extends // @@protoc_insertion_point(interface_extends:client2server.MakeCityRt) com.google.protobuf.MessageOrBuilder { /** * <code>required int32 rt = 1;</code> */ boolean hasRt(); /** * <code>required int32 rt = 1;</code> */ int getRt(); }
[ "weiwei.witch@gmail.com" ]
weiwei.witch@gmail.com
69d1baf964372f980bed9b43aa60ecc35f604174
65837af44ec11163d302d4b104518c9fa373af2b
/app/src/main/java/com/wxxiaomi/ming/retrofitexception/api/HttpMethods.java
5cb9255f5eb4877dcde64d5ce9a6fc31d341e45a
[]
no_license
whaoming/Retorfit_RxJava_Exception
a4e0c618e93e8b18eb744b880408c7af8299fbdf
4395e81a5474347e9755895424754345d123a41d
refs/heads/master
2021-06-16T02:49:42.942029
2017-04-04T14:17:19
2017-04-04T14:17:19
61,261,495
87
18
null
null
null
null
UTF-8
Java
false
false
3,417
java
package com.wxxiaomi.ming.retrofitexception.api; import com.wxxiaomi.ming.retrofitexception.api.service.DemoService; import com.wxxiaomi.ming.retrofitexception.bean.format.InitUserInfo; import com.wxxiaomi.ming.retrofitexception.bean.format.Login; import com.wxxiaomi.ming.retrofitexception.bean.format.common.Result; import com.wxxiaomi.ming.retrofitexception.api.exception.ExceptionEngine; import com.wxxiaomi.ming.retrofitexception.api.exception.ServerException; import retrofit2.Retrofit; import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Func1; import rx.schedulers.Schedulers; /** * Created by 12262 on 2016/5/31. */ public class HttpMethods { public static final String BASE_URL = "http://192.168.56.1:8080/ElectricBicycleServer/"; private static final int DEFAULT_TIMEOUT = 5; private Retrofit retrofit; private DemoService demoService; //构造方法私有 private HttpMethods() { retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .build(); demoService = retrofit.create(DemoService.class); } //在访问HttpMethods时创建单例 private static class SingletonHolder{ private static final HttpMethods INSTANCE = new HttpMethods(); } //获取单例 public static HttpMethods getInstance(){ return SingletonHolder.INSTANCE; } /** * 用于获取豆瓣电影Top250的数据 */ public Observable<InitUserInfo> getTopMovie(String username, String password){ return demoService.initUserInfo(username, password) .map(new ServerResultFunc<InitUserInfo>()) .onErrorResumeNext(new Func1<Throwable, Observable<? extends InitUserInfo>>() { @Override public Observable<? extends InitUserInfo> call(Throwable throwable) { return Observable.error(ExceptionEngine.handleException(throwable)); } }) .subscribeOn(Schedulers.io()) .unsubscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()); } public Observable<Login> login(String username, String password){ return demoService.readBaidu(username, password) .map(new ServerResultFunc<Login>()) .onErrorResumeNext(new HttpResultFunc<Login>()) .subscribeOn(Schedulers.io()) .unsubscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()); } private class ServerResultFunc<T> implements Func1<Result<T>, T> { @Override public T call(Result<T> httpResult) { if (httpResult.state != 200) { throw new ServerException(httpResult.state,httpResult.error); } return httpResult.infos; } } private class HttpResultFunc<T> implements Func1<Throwable, Observable<T>> { @Override public Observable<T> call(Throwable throwable) { return Observable.error(ExceptionEngine.handleException(throwable)); } } }
[ "122627018@qq.com" ]
122627018@qq.com
2ecc6e5ba7002c6afdb9560cf5a8dfe7edc5229e
b23f4fb8323a223abb26da107b589245142fce33
/src/com/leozzy/ten/Sequence.java
631552e8abb158758801f39f93a75a132f30dc8c
[]
no_license
leozhiyu/thinking-in-java
d9f61ccf6657026ae223c36aeb2a5e9a62c24b20
72440f4b4a11022adfa14dd839770843f59079db
refs/heads/master
2021-09-08T02:27:34.035030
2018-03-06T00:54:58
2018-03-06T00:54:58
112,142,580
1
0
null
null
null
null
UTF-8
Java
false
false
2,094
java
package com.leozzy.ten; /** * Created by Leo */ interface Selector{ boolean end(); Object current(); void next(); } public class Sequence { private Object[] items; private int next = 0; public Sequence(int size){ items = new Object[size]; } public void add(Object x){ if (next < items.length){ items[next++] = x; } } private class SequenceSelector implements Selector{ private int i = 0; @Override public boolean end(){ return i == items.length; } @Override public Object current() { return items[i]; } @Override public void next(){ if (i < items.length){ i++; } } } private class SequenceReverseSelector implements Selector{ private int i = items.length-1; @Override public boolean end() { return i == 0; } @Override public Object current() { return items[i]; } @Override public void next() { if (i >= 0){ i--; } } } public Selector selector(){ return new SequenceSelector(); } public SequenceReverseSelector reverseSelector(){ return new SequenceReverseSelector(); } public static void main(String[] args) { Sequence sequence = new Sequence(10); for(int i = 0;i < 10;i++){ sequence.add(Integer.toString(i)); } Selector selector = sequence.selector(); while(!selector.end()){ System.out.print(selector.current() + " "); selector.next(); } Selector reverseSelector = sequence.reverseSelector(); System.out.println(); while (!reverseSelector.end()){ System.out.print(reverseSelector.current() + " "); reverseSelector.next(); } } }
[ "18779775257@163.com" ]
18779775257@163.com
6398e03d224db8208fb9b0e71e671e9e7c7ffc6c
2a040f5cb47915a58ff47e3a95fbb8e53ce09b5a
/app/src/main/java/com/media/MediaChooser.java
06287858fe04197cb1277bb46428fd00e9770719
[]
no_license
githubwithme/farm
7ad23f520f289de716c76baa93e9b6f8427da5ce
34827ce4eb2db66c5057c384cc79344d91c85710
refs/heads/master
2020-12-12T13:56:05.409508
2016-02-26T08:03:37
2016-02-26T08:03:37
48,423,210
0
0
null
null
null
null
UTF-8
Java
false
false
3,319
java
/* * Copyright 2013 - learnNcode (learnncode@gmail.com) * * 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.media; public class MediaChooser { /** * Video file selected broadcast action. */ public static final String VIDEO_SELECTED_ACTION_FROM_MEDIA_CHOOSER = "lNc_videoSelectedAction"; /** * Image file selected broadcast action. */ public static final String IMAGE_SELECTED_ACTION_FROM_MEDIA_CHOOSER = "lNc_imageSelectedAction"; /** * Image file selected broadcast action. */ public static final String LUYIN_SELECTED_ACTION_FROM_MEDIA_CHOOSER = "lNc_luyinSelectedAction"; /** * Set folder Name * * @param folderName * default folder name is learnNcode. */ public static void setFolderName(String folderName) { if (folderName != null) { MediaChooserConstants.folderName = folderName; } } /** * To set visibility of camera/video button. * * @param showCameraVideo * boolean value.To set visibility of camera/video button. * default its visible. */ public static void showCameraVideoView(boolean showCameraVideo) { MediaChooserConstants.showCameraVideo = showCameraVideo; } /** * To set file size limit for image selection. * * @param size * int file size in mb. default is set to 20 mb. */ public static void setImageSize(int size) { MediaChooserConstants.SELECTED_IMAGE_SIZE_IN_MB = size; } /** * To set file size limit for video selection. * * @param size * int file size in mb. default is set to 20 mb. */ public static void setVideoSize(int size) { MediaChooserConstants.SELECTED_VIDEO_SIZE_IN_MB = size; } /** * To set number of items that can be selected. * * @param limit * int value. Default is 100. */ public static void setSelectionLimit(int limit) { MediaChooserConstants.MAX_MEDIA_LIMIT = limit; } /** * To set already selected file count. * * @param count * int value. */ public static void setSelectedMediaCount(int count) { MediaChooserConstants.SELECTED_MEDIA_COUNT = count; } /** * Get selected media file count. * * @return count. */ public static int getSelectedMediaCount() { return MediaChooserConstants.SELECTED_MEDIA_COUNT; } /** * To display images only. */ public static void showOnlyImageTab() { MediaChooserConstants.showImage = true; MediaChooserConstants.showVideo = false; } /** * To display video and images. */ public static void showImageVideoTab() { MediaChooserConstants.showImage = true; MediaChooserConstants.showVideo = true; } /** * To display videos only. */ public static void showOnlyVideoTab() { MediaChooserConstants.showImage = false; MediaChooserConstants.showVideo = true; } }
[ "1655815015@qq.com" ]
1655815015@qq.com
5111e01d95214ee804560773de27622d80e6e896
87b1c2bf78babc04de4939d227c9570fa02f10a6
/src/main/java/com/simibubi/create/foundation/block/CustomRenderItemBakedModel.java
6e22c106a43096354d547b9eeca1b813a57a6be5
[ "MIT" ]
permissive
fuzzyweapon/Create
00f2a8a8c55c564e547ceef3694ee0692e522123
385a3f449708dfde9ee2036d19839eb0d805d75e
refs/heads/master
2020-11-27T05:13:47.816815
2019-11-11T09:21:10
2019-11-11T09:21:10
229,317,879
1
0
MIT
2019-12-20T18:39:39
2019-12-20T18:39:38
null
UTF-8
Java
false
false
819
java
package com.simibubi.create.foundation.block; import com.simibubi.create.Create; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ModelRotation; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.ModelBakeEvent; public abstract class CustomRenderItemBakedModel extends WrappedBakedModel { public CustomRenderItemBakedModel(IBakedModel template) { super(template); } public abstract CustomRenderItemBakedModel loadPartials(ModelBakeEvent event); @Override public boolean isBuiltInRenderer() { return true; } protected static IBakedModel loadCustomModel(ModelBakeEvent event, String name) { return event.getModelLoader().func_217845_a(new ResourceLocation(Create.ID, "item/" + name), ModelRotation.X0_Y0); } }
[ "31564874+simibubi@users.noreply.github.com" ]
31564874+simibubi@users.noreply.github.com
9719cc2cd2b3fdd57374275b4ef7c1a1f6638b50
fe3c80e69288fd2b13985ed8a7d82da3fb25c7ef
/JavaEE Basic Web Projects - JSF, JSP/JSF/Casebook/src/main/java/app/domain/models/service/UserServiceModel.java
3db70ed08b9bcf42be05b05589e47f71ae0974a1
[]
no_license
Stefanov97/SoftUni
d3091e1da7ca13c4d94287658d9f6f33ed31c2ea
f6d0dd45ca953f15cd78b875604abcde27242880
refs/heads/master
2022-07-07T01:15:36.921400
2020-04-23T10:51:02
2020-04-23T10:51:02
213,201,039
1
0
null
2022-06-21T03:13:06
2019-10-06T16:16:31
Java
UTF-8
Java
false
false
1,047
java
package app.domain.models.service; import app.domain.entities.Gender; import app.domain.entities.User; import java.util.List; public class UserServiceModel { private String username; private String password; private String gender; List<UserServiceModel> friends; public UserServiceModel() { } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public List<UserServiceModel> getFriends() { return friends; } public void setFriends(List<UserServiceModel> friends) { this.friends = friends; } public void addFriend(UserServiceModel user){ this.getFriends().add(user); } }
[ "pavelstefanovv@gmail.com" ]
pavelstefanovv@gmail.com
4dab66aad74f4a6090a03ffd98c299875962b582
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/XWIKI-12919-2-23-Single_Objective_GGA-WeightedSum-BasicBlockCoverage-opt/org/xwiki/query/jpql/internal/JPQLParser_ESTest.java
8788eb920fdf60a39cf26b8dd76898f146e802c0
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
1,088
java
/* * This file was automatically generated by EvoSuite * Wed Oct 27 13:54:03 UTC 2021 */ package org.xwiki.query.jpql.internal; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.xwiki.query.jpql.internal.JPQLParser; import org.xwiki.query.jpql.parser.ParserException; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class JPQLParser_ESTest extends JPQLParser_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { JPQLParser jPQLParser0 = new JPQLParser(); JPQLParser jPQLParser1 = new JPQLParser(); String string0 = ""; try { jPQLParser0.parse(""); fail("Expecting exception: ParserException"); } catch(ParserException e) { // // [1,1] expecting: select // verifyException("org.xwiki.query.jpql.parser.Parser", e); } } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
f040b0297e9726d0fecbed8b7059aa6989a69bdf
0d4a2464c0fec2288f868cc19f76bc377c9ad24f
/shopping_protal/shopping_bean/src/main/java/com/alibaba/shopping/shopping_bean/bean/shopentity/domain/StoreGradeLog.java
d50de7a286251e96e5af7a1ebb8dc2c142df6b8d
[]
no_license
albertmaxwell/NewShopping
b940b07b9457d690a610f3dca07e78f97eb26637
c5ded1845404c7de1c53e57b8cb9be302c3911e1
refs/heads/master
2022-07-16T09:03:37.686020
2019-12-20T10:37:34
2019-12-20T10:37:34
202,852,094
0
0
null
2022-06-29T17:37:08
2019-08-17T07:51:39
HTML
UTF-8
Java
false
false
1,416
java
package com.alibaba.shopping.shopping_bean.bean.shopentity.domain; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.ManyToOne; import javax.persistence.Table; @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @Entity @Table(name = "wemall_storegrade_log") public class StoreGradeLog extends IdEntity { //店铺 @ManyToOne(fetch = FetchType.LAZY) private Store store; //店铺等级状态 private int store_grade_status; //店铺等级信息 private String store_grade_info; //编辑记录 private boolean log_edit; public boolean isLog_edit(){ return this.log_edit; } public void setLog_edit(boolean log_edit){ this.log_edit = log_edit; } public Store getStore(){ return this.store; } public void setStore(Store store){ this.store = store; } public int getStore_grade_status(){ return this.store_grade_status; } public void setStore_grade_status(int store_grade_status){ this.store_grade_status = store_grade_status; } public String getStore_grade_info(){ return this.store_grade_info; } public void setStore_grade_info(String store_grade_info){ this.store_grade_info = store_grade_info; } }
[ "jhy..1008611" ]
jhy..1008611
acdaa094ec9aead80ede2a04c6678716542049b6
44b03bdbceae2c21df62c622b6fa5a62eede902c
/hasoffer.core/src/test/java/hasoffer/core/test/m/StatDeviceTest.java
d6fa26bb4ceb92ade8026a60a0be609b836df439
[]
no_license
hakeyHL/xinghezhixing
f87ae4c01c0e37a45922c5bddd50b58fe64512da
86e19625b1921dbf7d703d00b86c2213345599c3
refs/heads/master
2020-12-04T16:57:13.177139
2016-09-03T17:11:40
2016-09-03T17:11:40
67,301,937
2
3
null
null
null
null
UTF-8
Java
false
false
2,814
java
package hasoffer.core.test.m; import hasoffer.base.utils.TimeUtils; import hasoffer.core.persistence.dbm.nosql.IMongoDbManager; import hasoffer.core.persistence.dbm.osql.IDataBaseManager; import hasoffer.core.persistence.po.urm.UrmDevice; import hasoffer.core.user.IDeviceService; import org.apache.commons.io.FileUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.annotation.Resource; import java.io.File; import java.util.*; /** * Date : 2016/3/30 * Function : */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:spring-beans.xml") public class StatDeviceTest { private static final String Q_DEVICE = "SELECT t FROM UrmDevice t " + " WHERE t.shopApp is not null " + " AND t.shopApp <> '' " + " AND t.createTime >= ?0 " + " AND t.createTime < ?1 " + " AND t.brand = 'samsung' "; @Resource IDeviceService deviceService; @Resource IDataBaseManager dbm; @Resource IMongoDbManager mdm; @Test public void testStat() { Map<String, Long> modelCountMap = new LinkedHashMap<String, Long>(); final String TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; Date startDate = TimeUtils.stringToDate("2016-02-09 00:00:00", TIME_PATTERN); Date endDate = TimeUtils.stringToDate("2016-04-15 00:00:00", TIME_PATTERN); // list device by date List<UrmDevice> devices = dbm.query(Q_DEVICE, 1, Integer.MAX_VALUE, Arrays.asList(startDate, endDate)); for (UrmDevice device : devices) { if (device.getBrand().equalsIgnoreCase("samsung")) { String dname = device.getDeviceName(); String[] bms = dname.split(" "); if (bms[1].startsWith("SM") || bms[1].startsWith("SPH") || bms[1].startsWith("GT")) { if (modelCountMap.containsKey(bms[1])) { modelCountMap.put(bms[1], modelCountMap.get(bms[1]) + 1); } else { modelCountMap.put(bms[1], 1L); } } } } StringBuilder sb = new StringBuilder(); for (Map.Entry<String, Long> kv : modelCountMap.entrySet()) { sb.append(kv.getValue() + "\t" + kv.getKey() + "\n"); } File file = new File("d:/TMP/out.txt"); if(file.exists()){ file.delete(); } try{ file.createNewFile(); FileUtils.writeByteArrayToFile(file, sb.toString().getBytes()); }catch (Exception e){ } } }
[ "zjyjyhl@163.com" ]
zjyjyhl@163.com
34099eaaf44773f8b86a3e3f191e6e832efb34b2
5fa4fa9b5a8eaf1609f112e5a778935d98e65985
/app/src/main/java/com/letv/leauto/ecolink/adapter/SeconPageAdapter.java
fa591f4c95d6b32c3624f51802345c721dc6d65e
[]
no_license
xingfeng2010/LinkProject
fbde6052101626a87b164ac20e501c69ed6771e0
7fc5b1f451cf609cc919e2d8280c2393f8e6449f
refs/heads/master
2021-01-22T13:03:18.510617
2017-09-16T12:57:52
2017-09-16T12:57:52
102,362,315
0
2
null
null
null
null
UTF-8
Java
false
false
6,985
java
package com.letv.leauto.ecolink.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.letv.leauto.ecolink.R; import com.letv.leauto.ecolink.cfg.GlobalCfg; import com.letv.leauto.ecolink.database.model.AppInfo; import com.letv.leauto.ecolink.utils.DensityUtils; import com.letv.leauto.ecolink.utils.Trace; import java.util.List; /** * Created by lishixing on 2016/9/6. */ public class SeconPageAdapter extends BaseAdapter { private List<AppInfo> mAppInfoList; private LayoutInflater mLayoutInflater; public static boolean isDelete=false; Context mContext; public SeconPageAdapter(List<AppInfo> list, Context context) { mAppInfoList = list; mLayoutInflater = LayoutInflater.from(context); mContext=context; // mContext.getResources().updateConfiguration(); } deleteAPPListener mDeleteAPPListener; public void setDeleteAPPListener(deleteAPPListener mDeleteAPPListener) { this.mDeleteAPPListener = mDeleteAPPListener; } // public void setDataList(List<AppInfo> list) { // //mAppInfoList = list; // this.notifyDataSetChanged(); // } @Override public int getCount() { return mAppInfoList.size(); } @Override public Object getItem(int position) { return mAppInfoList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { Holder holder; int parentHeight; int parentWidth; if (GlobalCfg.IS_POTRAIT){ parentHeight= DensityUtils.getScreenHeight(mContext)-DensityUtils.dp2px(mContext,40)-DensityUtils.dp2px(mContext,14)-DensityUtils.dp2px(mContext,49)-DensityUtils.dp2px(mContext,20)-mContext.getResources().getDrawable(R.mipmap.player_page_nor).getMinimumHeight(); parentWidth= DensityUtils.getScreenWidth(mContext)-DensityUtils.dp2px(mContext,40)-DensityUtils.dp2px(mContext,14)-DensityUtils.dp2px(mContext,49)-DensityUtils.dp2px(mContext,20)-mContext.getResources().getDrawable(R.mipmap.player_page_nor).getMinimumHeight(); }else { parentHeight= DensityUtils.getScreenHeight(mContext)-DensityUtils.dp2px(mContext,40)-DensityUtils.dp2px(mContext,20)-DensityUtils.dp2px(mContext,49)-DensityUtils.dp2px(mContext,20)-mContext.getResources().getDrawable(R.mipmap.player_page_nor).getMinimumHeight(); parentWidth= DensityUtils.getScreenWidth(mContext)-DensityUtils.dp2px(mContext,40)-DensityUtils.dp2px(mContext,20)-DensityUtils.dp2px(mContext,49)-DensityUtils.dp2px(mContext,20)-mContext.getResources().getDrawable(R.mipmap.player_page_nor).getMinimumHeight(); } if (convertView == null) { holder = new Holder(); if (GlobalCfg.IS_POTRAIT){ int itemheight=parentHeight/4; convertView = mLayoutInflater.inflate(R.layout.added_app_gridview_item, null); if (itemheight>0){ AbsListView.LayoutParams param = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemheight); convertView.setLayoutParams(param); } }else { int itemheight; if (parentHeight<parentWidth){ itemheight=parentHeight/2; }else{ itemheight=parentWidth/2; } convertView = mLayoutInflater.inflate(R.layout.added_app_gridview_item_1, null); if (itemheight>0){ AbsListView.LayoutParams param = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemheight); convertView.setLayoutParams(param);}else{ AbsListView.LayoutParams param = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); convertView.setLayoutParams(param); } } holder.imageView = (ImageView) convertView.findViewById(R.id.item_img); holder.textView = (TextView) convertView.findViewById(R.id.item_tv); holder.deleteView = (ImageView) convertView.findViewById(R.id.item_delete_img); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); } holder.imageView.setImageDrawable(mAppInfoList.get(position).getAppIcon()); holder.imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mDeleteAPPListener!=null){ mDeleteAPPListener.imageClick(position); } } }); holder.imageView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (mDeleteAPPListener!=null){ mDeleteAPPListener.imageLongClick(position); } return true; } }); holder.textView.setText(mAppInfoList.get(position).getAppName()); if (isDelete){ holder.deleteView.setVisibility(View.VISIBLE); holder.deleteView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mDeleteAPPListener!=null){ mDeleteAPPListener.deleteClick(position); } } }); if (!mAppInfoList.get(position).getCouldDelete()) { holder.deleteView.setVisibility(View.INVISIBLE); } }else{ holder.deleteView.setVisibility(View.INVISIBLE); } return convertView; } public void destroy() { mContext=null; } public interface deleteAPPListener{ void deleteClick(int position); void imageClick(int position); void imageLongClick(int position); } private static class Holder { public ImageView imageView; public TextView textView; public ImageView deleteView; } public void removeApp(int position) { mAppInfoList.remove(position); this.notifyDataSetChanged(); } public void addApp(AppInfo appInfo) { mAppInfoList.add(appInfo); this.notifyDataSetChanged(); } public void setDelete(boolean delete){ isDelete=delete; } }
[ "583354000@qq.com" ]
583354000@qq.com
067a46e6dd7ff73fd7beb0e0d6e31f12d6c35537
78fa3f9899934b95aacd43a6f3d27682e33c01a8
/src/com/shangdingdai/fragment/SbtzMoneyFragment.java
a40830a9f0786c0df17ccc8387bb3388783662f0
[]
no_license
Mersens/sdd
f19291136db8631f2340bbb9aac389034b30c4f8
f958b1683477e9571b970a0d725f7d72c1cb6747
refs/heads/master
2021-01-10T16:20:23.921980
2015-10-26T07:15:41
2015-10-26T07:15:41
44,951,513
1
0
null
null
null
null
UTF-8
Java
false
false
5,727
java
package com.shangdingdai.fragment; import java.util.ArrayList; import java.util.EventListener; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.gson.Gson; import com.shangdingdai.activity.BiaoDetailedActivity; import com.shangdingdai.adapter.XszxAdapter; import com.shangdingdai.applcation.Constants; import com.shangdingdai.bean.BiaoBean; import com.shangdingdai.bean.XszxBean; import com.shangdingdai.utils.HttpPostUtils; import com.shangdingdai.utils.NetworkUtils; import com.shangdingdai.view.R; import com.shangdingdai.view.XListView; import com.shangdingdai.view.XListView.IXListViewListener; import android.annotation.SuppressLint; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.AdapterView.OnItemClickListener; public class SbtzMoneyFragment extends FragmentBase implements OnClickListener, IXListViewListener, EventListener { private ProgressBar progressBar; private XListView mListView; private XszxAdapter adapter; private List<BiaoBean> list; private List<BiaoBean> lists=new ArrayList<BiaoBean>(); private XszxBean bean; public static String GETINFO_URL = Constants.SERVICE_ADDRESS+"biao/getBiaoList"; public static final int SUCCESS = 0X01; public static final int REFRESH = 0X00; public static final int LOADMORE = 0X10; public static int page = 1; public static int pagesize = 10; public boolean isRefresh = false; public boolean isLoadMore = false; public boolean isFirst = false; private MyAnsyTask mt; private LinearLayout layout_no_msg; @SuppressLint("InflateParams") @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.layout_sbtz_je, null); initViews(v); if (!NetworkUtils.isNetworkAvailable(getActivity() .getApplicationContext())) { ShowToast(R.string.tv_network_available); layout_no_msg.setVisibility(View.VISIBLE); } else { progressBar.setVisibility(View.VISIBLE); mt = new MyAnsyTask(); String params[] = { page + "", pagesize + "", "loanjine", "0" }; mt.execute(params); } return v; } @Override public void onPause() { // TODO Auto-generated method stub super.onPause(); if(mt!=null && mt.getStatus()==AsyncTask.Status.RUNNING){ mt.cancel(true); } } private void initEvents() { lists.addAll(list); adapter = new XszxAdapter(list, getActivity().getApplicationContext()); mListView.setAdapter(adapter); progressBar.setVisibility(View.GONE); mListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { BiaoBean bean= lists.get(position-1); String biaoid=bean.getBiaoid(); Intent intent=new Intent(getActivity(),BiaoDetailedActivity.class); intent.putExtra("biaoid", biaoid); startActivity(intent); getActivity().overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); } }); } private void initViews(View v) { isFirst = true; mListView = (XListView) v.findViewById(R.id.listView); progressBar=(ProgressBar) v.findViewById(R.id.progressBar); mListView.setPullLoadEnable(true); // 允许下拉 mListView.setPullRefreshEnable(false); mListView.setXListViewListener(this); layout_no_msg=(LinearLayout) v.findViewById(R.id.layout_no_msg); } class MyAnsyTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { if(isCancelled()){ return null; } Map<String, String> map = new HashMap<String, String>(); map.put("page", params[0]); map.put("pagesize", params[1]); map.put("ordertype", params[2]); map.put("isnewer", params[3]); String result = HttpPostUtils.doPost(GETINFO_URL, map); return result; } @Override protected void onPostExecute(String result) { super.onPostExecute(result); if(isCancelled()){ return ; } Gson gson = new Gson(); bean = gson.fromJson(result, XszxBean.class); if (bean != null) { list = bean.getBiaolist(); } else { list = new ArrayList<BiaoBean>(); } if (isFirst) { isFirst = false; initEvents(); } else if (isRefresh) { isRefresh = false; refresh(); mListView.setEnabled(true); } else if (isLoadMore) { isLoadMore = false; loadMore(); mListView.setEnabled(true); } } } private void loadMore() { mListView.setPullRefreshEnable(true); lists.addAll(list); adapter.addAll(list); adapter.notifyDataSetChanged(); mListView.stopLoadMore(); } private void refresh() { lists.clear(); adapter.setList(list); lists.addAll(list); adapter.notifyDataSetChanged(); mListView.stopRefresh(); } @Override public void onRefresh() { mListView.setEnabled(false); isRefresh = true; page = 1; mt = new MyAnsyTask(); String params[] = { page + "", pagesize + "", "loanjine", "0" }; mt.execute(params); } @Override public void onLoadMore() { mListView.setEnabled(false); isLoadMore = true; page = page + 1; mt = new MyAnsyTask(); String params[] = { page + "", pagesize + "", "loanjine", "0" }; mt.execute(params); } @Override public void onClick(View v) { } }
[ "626168564@qq.com" ]
626168564@qq.com
631ec67212ffe7df4895d4899d0d151d2f31443e
9b9c3236cc1d970ba92e4a2a49f77efcea3a7ea5
/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/communitybbs/BB/Forum.java
17e238e3c921f1547239daa8e5080c13dcb66147
[]
no_license
BETAJIb/ikol
73018f8b7c3e1262266b6f7d0a7f6bbdf284621d
f3709ea10be2d155b0bf1dee487f53c723f570cf
refs/heads/master
2021-01-05T10:37:17.831153
2019-12-24T22:23:02
2019-12-24T22:23:02
240,993,482
0
0
null
null
null
null
UTF-8
Java
false
false
6,321
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2jmobius.gameserver.communitybbs.BB; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.communitybbs.Manager.ForumsBBSManager; import org.l2jmobius.gameserver.communitybbs.Manager.TopicBBSManager; public class Forum { // Types public static final int ROOT = 0; public static final int NORMAL = 1; public static final int CLAN = 2; public static final int MEMO = 3; public static final int MAIL = 4; // Permissions public static final int INVISIBLE = 0; public static final int ALL = 1; public static final int CLANMEMBERONLY = 2; public static final int OWNERONLY = 3; private static Logger LOGGER = Logger.getLogger(Forum.class.getName()); private final List<Forum> _children; private final Map<Integer, Topic> _topic; private final int _forumId; private String _forumName; private int _forumType; private int _forumPost; private int _forumPerm; private final Forum _fParent; private int _ownerID; private boolean _loaded = false; /** * @param Forumid * @param FParent */ public Forum(int Forumid, Forum FParent) { _forumId = Forumid; _fParent = FParent; _children = new ArrayList<>(); _topic = new HashMap<>(); } /** * @param name * @param parent * @param type * @param perm * @param OwnerID */ public Forum(String name, Forum parent, int type, int perm, int OwnerID) { _forumName = name; _forumId = ForumsBBSManager.getInstance().getANewID(); _forumType = type; _forumPost = 0; _forumPerm = perm; _fParent = parent; _ownerID = OwnerID; _children = new ArrayList<>(); _topic = new HashMap<>(); parent._children.add(this); ForumsBBSManager.getInstance().addForum(this); _loaded = true; } private void load() { try (Connection con = DatabaseFactory.getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT * FROM forums WHERE forum_id=?"); statement.setInt(1, _forumId); ResultSet result = statement.executeQuery(); if (result.next()) { _forumName = result.getString("forum_name"); _forumPost = result.getInt("forum_post"); _forumType = result.getInt("forum_type"); _forumPerm = result.getInt("forum_perm"); _ownerID = result.getInt("forum_owner_id"); } result.close(); statement.close(); } catch (Exception e) { LOGGER.warning("Data error on Forum " + _forumId + " : " + e); } try (Connection con = DatabaseFactory.getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT * FROM topic WHERE topic_forum_id=? ORDER BY topic_id DESC"); statement.setInt(1, _forumId); ResultSet result = statement.executeQuery(); while (result.next()) { Topic t = new Topic(Topic.ConstructorType.RESTORE, result.getInt("topic_id"), result.getInt("topic_forum_id"), result.getString("topic_name"), result.getLong("topic_date"), result.getString("topic_ownername"), result.getInt("topic_ownerid"), result.getInt("topic_type"), result.getInt("topic_reply")); _topic.put(t.getID(), t); if (t.getID() > TopicBBSManager.getInstance().getMaxID(this)) { TopicBBSManager.getInstance().setMaxID(t.getID(), this); } } result.close(); statement.close(); } catch (Exception e) { LOGGER.warning("Data error on Forum " + _forumId + " : " + e); } } private void getChildren() { try (Connection con = DatabaseFactory.getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT forum_id FROM forums WHERE forum_parent=?"); statement.setInt(1, _forumId); ResultSet result = statement.executeQuery(); while (result.next()) { final Forum f = new Forum(result.getInt("forum_id"), this); _children.add(f); ForumsBBSManager.getInstance().addForum(f); } result.close(); statement.close(); } catch (Exception e) { LOGGER.warning("Data error on Forum (children): " + e); } } public int getTopicSize() { vload(); return _topic.size(); } public Topic getTopic(int j) { vload(); return _topic.get(j); } public void addTopic(Topic t) { vload(); _topic.put(t.getID(), t); } public int getID() { return _forumId; } public String getName() { vload(); return _forumName; } public int getType() { vload(); return _forumType; } /** * @param name * @return */ public Forum getChildByName(String name) { vload(); for (Forum f : _children) { if (f.getName().equals(name)) { return f; } } return null; } public void rmTopicByID(int id) { _topic.remove(id); } public void insertIntoDb() { try (Connection con = DatabaseFactory.getConnection()) { PreparedStatement statement = con.prepareStatement("INSERT INTO forums (forum_id,forum_name,forum_parent,forum_post,forum_type,forum_perm,forum_owner_id) values (?,?,?,?,?,?,?)"); statement.setInt(1, _forumId); statement.setString(2, _forumName); statement.setInt(3, _fParent.getID()); statement.setInt(4, _forumPost); statement.setInt(5, _forumType); statement.setInt(6, _forumPerm); statement.setInt(7, _ownerID); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.warning("Error while saving new Forum to db " + e); } } public void vload() { if (!_loaded) { load(); getChildren(); _loaded = true; } } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
b655ac3cc10872b737246a3be884502f19ced05b
f83802db681343526c4bec8a1048c74c44b1f6af
/src/main/java/com/RandomBeer/sampleApp/service/BeerDetailServiceImpl.java
9637438f5ba5407833ddea72fd43ee9323eac55e
[]
no_license
RenjithKI/SpringBootTaskSolution
37e8f7459d29d0d0939bc40cb1e737c22095c0f1
f34905d8b93a6828c83145822521275eb6b43cdb
refs/heads/master
2020-03-17T04:34:37.852255
2018-05-13T23:07:36
2018-05-13T23:07:36
133,280,826
1
0
null
null
null
null
UTF-8
Java
false
false
787
java
package com.RandomBeer.sampleApp.service; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.RandomBeer.sampleApp.dao.BeerDetailDao; import com.RandomBeer.sampleApp.domain.Beer; @Service public class BeerDetailServiceImpl implements BeerDetailService { @Autowired private BeerDetailDao beerDetailDao; @Override public List<Beer> getBeerList() { return beerDetailDao.getBeerList(); } @Override public Beer getBeer(int id) { return beerDetailDao.getBeer(id); } @Override public Map<Integer, Beer> getBeerMap(){ return beerDetailDao.getBeerMap(); } @Override public Beer getRandomBeer() { return beerDetailDao.getRandomBeer(); } }
[ "renjith.kachappilly@gmail.com" ]
renjith.kachappilly@gmail.com
c8fb6f02c37bf476a6439b9a8d2db29f637609c6
1fde7abbd55319ea78d70d9164bea0674ca30037
/src/main/java/org/example/observer/demo01/Notifier.java
b5703f7067cb52a6d9b560fb8824bbb6b9e296ee
[]
no_license
yuanchaowhut/DesignPattern
94a578be00bef9c7adc2b5262196271b1acfe9e2
94efdd2ffe22366a4cd09b2f38b2074fbe5a48ab
refs/heads/master
2022-03-09T08:29:37.429566
2022-03-07T01:13:50
2022-03-07T01:13:50
130,173,917
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
package org.example.observer.demo01; import java.util.ArrayList; import java.util.List; /** * Created by yuanchao on 2018/6/7. */ public abstract class Notifier { List<Observer> list = new ArrayList<>(); public void attach(Observer observer) { if (!list.contains(observer)) { list.add(observer); } } public void detach(Observer observer) { if (list.contains(observer)) { list.remove(observer); } } public void notice() { for (Observer observer : list) { observer.update(); } } public abstract String getCurState(); }
[ "yuanchao@egova.com.cn" ]
yuanchao@egova.com.cn
d524e85e8672660516eceebdf184723d15a0d0bb
33fc833a508006235853f56849b34680e482d0c5
/hedera-node/src/test/java/com/hedera/services/records/RecordCacheFactoryTest.java
5a89c8a63f41d8c507a2ee6a7dd7472aa2ad7298
[ "Apache-2.0" ]
permissive
LVBK/hedera-services
cfa4780f39219365cc200eac8f91bd683ae1da01
a24d4e91ff3985ceaef05b2d7e7d05ea1f3ebaab
refs/heads/master
2023-07-25T17:08:17.392929
2021-08-13T19:21:39
2021-08-13T19:21:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,112
java
package com.hedera.services.records; /*- * ‌ * Hedera Services Node * ​ * Copyright (C) 2018 - 2021 Hedera Hashgraph, LLC * ​ * 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. * ‍ */ import com.hedera.services.context.properties.PropertySource; import com.hederahashgraph.api.proto.java.TransactionID; import org.junit.jupiter.api.Test; import static com.hedera.services.utils.SleepingPause.SLEEPING_PAUSE; import static com.hedera.test.utils.IdUtils.asAccount; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.mock; class RecordCacheFactoryTest { private TransactionID txnIdA = TransactionID.newBuilder() .setAccountID(asAccount("0.0.2")) .build(); private TransactionID txnIdB = TransactionID.newBuilder() .setAccountID(asAccount("2.2.0")) .build(); private PropertySource properties; private RecordCacheFactory subject; @Test void hasExpectedExpiry() { // setup: properties = mock(PropertySource.class); subject = new RecordCacheFactory(properties); given(properties.getIntProperty("cache.records.ttl")).willReturn(1); // when: var cache = subject.getRecordCache(); cache.put(txnIdA, RecordCache.MARKER); // then: assertEquals(RecordCache.MARKER, cache.getIfPresent(txnIdA)); assertNull(cache.getIfPresent(txnIdB)); SLEEPING_PAUSE.forMs(50L); assertEquals(RecordCache.MARKER, cache.getIfPresent(txnIdA)); SLEEPING_PAUSE.forMs(1000L); assertNull(cache.getIfPresent(txnIdA)); } }
[ "michael.tinker@hedera.com" ]
michael.tinker@hedera.com
7ecf2930cc7f775eadc2aee64b7bb5cf41708d50
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_12032.java
1a8a9a4bb953a9fb5edbe1a27a895a110a990338
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
616
java
private void validateNoTypeParameterOnType(Type type,List<Throwable> errors){ if (type instanceof TypeVariable<?>) { errors.add(new Exception("Method " + method.getName() + "() contains unresolved type variable " + type)); } else if (type instanceof ParameterizedType) { validateNoTypeParameterOnParameterizedType((ParameterizedType)type,errors); } else if (type instanceof WildcardType) { validateNoTypeParameterOnWildcardType((WildcardType)type,errors); } else if (type instanceof GenericArrayType) { validateNoTypeParameterOnGenericArrayType((GenericArrayType)type,errors); } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
d83f8466098ece6df328ee215dcc8ae89b1ba50c
5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b
/com/planet_ink/coffee_mud/core/collections/SafeFeedbackListIterator.java
fcc0e51c46bb60225d457b318eaa00666b7f8dc7
[ "Apache-2.0" ]
permissive
bozimmerman/CoffeeMud
5da8b5b98c25b70554ec9a2a8c0ef97f177dc041
647864922e07572b1f6c863de8f936982f553288
refs/heads/master
2023-09-04T09:17:12.656291
2023-09-02T00:30:19
2023-09-02T00:30:19
5,267,832
179
122
Apache-2.0
2023-04-30T11:09:14
2012-08-02T03:22:12
Java
UTF-8
Java
false
false
2,106
java
package com.planet_ink.coffee_mud.core.collections; import java.util.ListIterator; import java.util.concurrent.atomic.AtomicBoolean; /* Copyright 2015-2023 Bo Zimmerman 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. */ public class SafeFeedbackListIterator<K> implements ListIterator<K> { private final ListIterator<K> iter; private final SafeCollectionHost collection; private final AtomicBoolean returned = new AtomicBoolean(false); public SafeFeedbackListIterator(final ListIterator<K> iter, final SafeCollectionHost collection) { this.iter = iter; this.collection = collection; this.collection.submitIterator(this); } @Override public void finalize() throws Throwable { if(!returned.get()) { collection.returnIterator(this); returned.set(true); } super.finalize(); } @Override public boolean hasNext() { return iter.hasNext(); } @Override public K next() { return iter.next(); } @Override public void remove() { throw new java.lang.UnsupportedOperationException(); } @Override public boolean hasPrevious() { return iter.hasPrevious(); } @Override public K previous() { return iter.previous(); } @Override public int nextIndex() { return iter.nextIndex(); } @Override public int previousIndex() { return iter.previousIndex(); } @Override public void set(final K e) { throw new java.lang.UnsupportedOperationException(); } @Override public void add(final K e) { throw new java.lang.UnsupportedOperationException(); } }
[ "bo@zimmers.net" ]
bo@zimmers.net
4af89ed02f89348d78159e523bbbb64ed20e8fa1
5b82e2f7c720c49dff236970aacd610e7c41a077
/QueryReformulation-master 2/data/processed/ViewerSetProperty.java
54901aab795ee9e83efa181f56b5bf601056756d
[]
no_license
shy942/EGITrepoOnlineVersion
4b157da0f76dc5bbf179437242d2224d782dd267
f88fb20497dcc30ff1add5fe359cbca772142b09
refs/heads/master
2021-01-20T16:04:23.509863
2016-07-21T20:43:22
2016-07-21T20:43:22
63,737,385
0
0
null
null
null
null
UTF-8
Java
false
false
1,676
java
/***/ package org.eclipse.jface.databinding.viewers; import org.eclipse.core.databinding.observable.Realm; import org.eclipse.core.databinding.observable.set.IObservableSet; import org.eclipse.core.databinding.property.set.SimpleSetProperty; import org.eclipse.jface.databinding.swt.DisplayRealm; import org.eclipse.jface.internal.databinding.viewers.ViewerObservableSetDecorator; import org.eclipse.jface.viewers.Viewer; /** * Abstract set property implementation for {@link Viewer} properties. This * class implements some basic behavior that viewer properties are generally * expected to have, namely: * <ul> * <li>Calling {@link #observe(Object)} should create the observable on the * display realm of the viewer's control, rather than the current default realm * <li>All <code>observe()</code> methods should return an * {@link IViewerObservableSet} * </ul> * * @since 1.3 */ public abstract class ViewerSetProperty extends SimpleSetProperty implements IViewerSetProperty { @Override public IObservableSet observe(Object source) { if (source instanceof Viewer) { return observe((Viewer) source); } return super.observe(source); } @Override public IObservableSet observe(Realm realm, Object source) { IObservableSet observable = super.observe(realm, source); if (source instanceof Viewer) return new ViewerObservableSetDecorator(observable, (Viewer) source); return observable; } @Override public IViewerObservableSet observe(Viewer viewer) { return (IViewerObservableSet) observe(DisplayRealm.getRealm(viewer.getControl().getDisplay()), viewer); } }
[ "muktacseku@gmail.com" ]
muktacseku@gmail.com
32f34ada892b44af0ad3a96bb3a7deab0d319623
6500848c3661afda83a024f9792bc6e2e8e8a14e
/gp_JADX/com/google/android/finsky/setup/C4180m.java
e8a2b354d43784bc54575caa2886356064c86972
[]
no_license
enaawy/gproject
fd71d3adb3784d12c52daf4eecd4b2cb5c81a032
91cb88559c60ac741d4418658d0416f26722e789
refs/heads/master
2021-09-03T03:49:37.813805
2018-01-05T09:35:06
2018-01-05T09:35:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
229
java
package com.google.android.finsky.setup; import com.google.android.finsky.accounts.C0988c; public final class C4180m { public final C0988c f21101a; public C4180m(C0988c c0988c) { this.f21101a = c0988c; } }
[ "genius.ron@gmail.com" ]
genius.ron@gmail.com
0b65d4208d500c4ea002e9d2cce7866bdf3b16aa
9d2809ee4669e3701884d334c227c68a24c5787f
/suppliercenter/supplier-core/src/main/java/com/mockuai/suppliercenter/core/filter/FilterChain.java
df734fc67e77b7249bac0cebd76d469f8481b21b
[]
no_license
vinfai/hy_project
5370367876fe6bcb4109f2af9391b9d817c320b5
8fd99f23cf83b1b3f7bec9560fbd2edc46621d0b
refs/heads/master
2021-01-19T00:58:26.436196
2017-03-01T16:47:22
2017-03-01T16:49:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
975
java
package com.mockuai.suppliercenter.core.filter; import com.mockuai.suppliercenter.common.api.SupplierResponse; import com.mockuai.suppliercenter.core.exception.SupplierException; import com.mockuai.suppliercenter.core.service.RequestContext; import java.util.List; public interface FilterChain { /** * 在拦截操作方法之前调用,如果所有filter成功调用,则返回true * 否则返回false * * @param ctx 当前请求上下文容器 * @throws SupplierException 处理异常时抛出 */ public SupplierResponse before(RequestContext ctx) throws SupplierException; /** * 在拦截方法后调用 * 调用成功返回true, 失败返回false * * @param ctx 当前请求上下文容器 * @throws SupplierException 处理异常时抛出 */ public SupplierResponse after(RequestContext ctx) throws SupplierException; public List<Filter> getFilters() throws SupplierException; }
[ "1147478866@qq.com" ]
1147478866@qq.com
c3c2530a07ccafe95b135b6354a7eaab84e177a1
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/52_lagoon-nu.staldal.lagoon.core.AuthenticationException-1.0-10/nu/staldal/lagoon/core/AuthenticationException_ESTest_scaffolding.java
3b76e7c7e7887f6abf1e526dad8a80a6a603e7b6
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 26 01:53:47 GMT 2019 */ package nu.staldal.lagoon.core; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class AuthenticationException_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
8fef6feeb43fb6e002814a28c7e061fbcd597ba0
6c7e279a45b37d597297f999d5ee0c5adde8a29e
/src/main/java/com/alipay/api/response/KoubeiMarketingToolPointsUpdateResponse.java
4e91331de5b9fd62a118a9a2f60b2caf02e3aeda
[]
no_license
tomowork/alipay-sdk-java
a09fffb8a48c41561b36b903c87bdf5e881451f6
387489e4a326c27a7b9fb6d38ee0b33aa1a3568f
refs/heads/master
2021-01-18T03:55:00.944718
2017-03-22T03:52:16
2017-03-22T03:59:16
85,776,800
1
2
null
2017-03-22T03:59:18
2017-03-22T02:37:45
Java
UTF-8
Java
false
false
644
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: koubei.marketing.tool.points.update response. * * @author auto create * @since 1.0, 2016-11-15 18:49:47 */ public class KoubeiMarketingToolPointsUpdateResponse extends AlipayResponse { private static final long serialVersionUID = 8726154976519228273L; /** * 集点变更流水号 */ @ApiField("point_log_no") private String pointLogNo; public void setPointLogNo(String pointLogNo) { this.pointLogNo = pointLogNo; } public String getPointLogNo( ) { return this.pointLogNo; } }
[ "zlei.huang@tomowork.com" ]
zlei.huang@tomowork.com
697b34f79cb505416b586142cb786ac8aef99c34
413a584d7123872cc04b2d1bb1141310cefa7b48
/db/db-impl/ext/src/java/org/sakaiproject/springframework/orm/hibernate/impl/AdditionalHibernateMappingsImpl.java
e7cf9b5fbd43188dbfc1ec08489bbc7028ac0980
[ "ECL-1.0", "Apache-2.0" ]
permissive
etudes-inc/etudes-lms
31bc2b187cafc629c8b2b61be92aa16bb78aca99
38a938e2c74d86fc3013642b05914068a3a67af3
refs/heads/master
2020-06-03T13:49:45.997041
2017-10-25T21:25:58
2017-10-25T21:25:58
94,132,665
0
0
null
null
null
null
UTF-8
Java
false
false
2,700
java
/********************************************************************************** * $URL: https://source.etudes.org/svn/etudes/source/trunk/db/db-impl/ext/src/java/org/sakaiproject/springframework/orm/hibernate/impl/AdditionalHibernateMappingsImpl.java $ * $Id: AdditionalHibernateMappingsImpl.java 3 2008-10-20 18:44:42Z ggolden $ *********************************************************************************** * * Copyright (c) 2005, 2006 The Sakai Foundation. * * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php * * 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.sakaiproject.springframework.orm.hibernate.impl; import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.MappingException; import org.hibernate.cfg.Configuration; import org.sakaiproject.springframework.orm.hibernate.AdditionalHibernateMappings; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; public class AdditionalHibernateMappingsImpl implements AdditionalHibernateMappings, Comparable { protected final transient Log logger = LogFactory.getLog(getClass()); private Resource[] mappingLocations; private Integer sortOrder = new Integer(Integer.MAX_VALUE); public void setMappingResources(String[] mappingResources) { this.mappingLocations = new Resource[mappingResources.length]; for (int i = 0; i < mappingResources.length; i++) { this.mappingLocations[i] = new ClassPathResource(mappingResources[i].trim()); } } public Resource[] getMappingLocations() { return mappingLocations; } public void processConfig(Configuration config) throws IOException, MappingException { for (int i = 0; i < this.mappingLocations.length; i++) { config.addInputStream(this.mappingLocations[i].getInputStream()); } } public int compareTo(Object o) { return getSortOrder().compareTo(((AdditionalHibernateMappingsImpl) o).getSortOrder()); } public Integer getSortOrder() { return sortOrder; } public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; } }
[ "ggolden@etudes.org" ]
ggolden@etudes.org
cf48483b94d9ed84a502de024151cbb0f69be904
637817184196b8d73130958fc1fc0b27833d8d92
/aprint-gervill/src/main/java/gervill/ModelOscillator.java
46da43c71b5ebb76a74ea25f7fdcc3a8bc5772b6
[]
no_license
barrelorgandiscovery/aprintproject
daad59e1e52e6e8e4187f943de95b79622827c81
ebc932c50d3116a4bbe9802910eac097151b1625
refs/heads/master
2023-06-28T03:11:25.779074
2023-05-08T12:15:27
2023-05-08T12:15:27
258,808,541
2
0
null
2023-05-08T09:50:33
2020-04-25T15:24:59
Java
UTF-8
Java
false
false
1,600
java
/* * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package gervill; /** * This interface is used for oscillators. * See example in ModelDefaultOscillator which is a wavetable oscillator. * * @author Karl Helgason */ public interface ModelOscillator { public int getChannels(); /** * Attenuation is in cB. * @return */ public float getAttenuation(); public ModelOscillatorStream open(float samplerate); }
[ "frett27@gmail.com" ]
frett27@gmail.com
b08379db292baff283855c9903527caeb553cdc5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/1/1_6626988e731c0053148b275e2b9f795e66f23da6/CloudWatchExample/1_6626988e731c0053148b275e2b9f795e66f23da6_CloudWatchExample_s.java
e9add2fe78e6672d9c2052a53929bc5e14976197
[]
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
2,369
java
/* * #%L * servo-cloudwatch * %% * Copyright (C) 2011 - 2012 Netflix * %% * 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. * #L% */ package com.netflix.servo.examples; import com.amazonaws.auth.PropertiesCredentials; import com.netflix.servo.*; import com.netflix.servo.monitor.Monitors; import com.netflix.servo.publish.BasicMetricFilter; import com.netflix.servo.publish.MonitorRegistryMetricPoller; import com.netflix.servo.publish.PollCallable; import com.netflix.servo.publish.cloudwatch.CloudWatchMetricObserver; import com.netflix.servo.tag.InjectableTag; import com.netflix.servo.tag.Tag; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Sample of publishing the SimpleSample to CloudWatch */ public class CloudWatchExample { public static void main(String[] args) throws Exception { if(args.length != 1){ System.err.println("Please specify the path to a properties file with your amazon keys."); return; } CloudWatchMetricObserver observer = new CloudWatchMetricObserver("SampleObserver", "SampleDomain", new PropertiesCredentials(new File(args[0]))); List<Tag> tags = new ArrayList<Tag>(2); tags.add(InjectableTag.HOSTNAME); tags.add(InjectableTag.IP); BasicExample example = new BasicExample(tags); DefaultMonitorRegistry.getInstance().register(Monitors.newObjectMonitor(example)); PollCallable poller = new PollCallable(new MonitorRegistryMetricPoller(), BasicMetricFilter.MATCH_ALL); while(true){ example.counter.incrementAndGet(); example.setSampleGauge(Math.round(Math.random() * 1000)); observer.update(poller.call()); Thread.sleep(60000); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
fef4869465c7beb32611b7a803b0f1a863a486fc
ea2aeb37ac80c9b3a4a8c85bdbf5cf05ab850b18
/src/org/jdna/bmt/web/client/ui/util/binder/TextBinder.java
b3a7b8befbf8f288700a82b338cd0c685d34c519
[]
no_license
stuckless/sagetv-bmtweb
abc34133a6ffbfe4a92bf824753f5713e2d624f9
0d4567bd6491781f45ebd1ac5729537b48ef483c
refs/heads/master
2022-11-19T15:34:02.612161
2022-07-04T11:51:45
2022-07-04T11:51:45
63,011,570
0
1
null
2022-11-09T18:20:43
2016-07-10T17:56:01
Java
UTF-8
Java
false
false
812
java
package org.jdna.bmt.web.client.ui.util.binder; import org.jdna.bmt.web.client.util.Property; import com.google.gwt.user.client.ui.HasText; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.Widget; public class TextBinder extends FieldBinder<String> { public TextBinder(HasText w, Property<String> prop) { super((Widget)w, prop); } public TextBinder(Property<String> prop) { this(new TextBox(), prop); } public void updateField() { ((HasText) getWidget()).setText((String)getProp().get()); } public void updateProperty() { getProp().set(((HasText)getWidget()).getText()); } @Override public String getText() { return ((HasText) getWidget()).getText(); } @Override public void setText(String text) { ((HasText) getWidget()).setText(text); } }
[ "sean.stuckless@gmail.com" ]
sean.stuckless@gmail.com
84a1542b0ebd6e3686ed4c126ae99b49c735c57f
f537eaaee279085ff7e7b7e72b1b2324635129dc
/src/main/java/com/yikangyiliao/pension/manager/AreaManager.java
af2041f0ce9a5e4ddee2428a6a425763f37d592a
[]
no_license
yikangmc/yikangService
c74124b059e643ef412228bac8a0d58ef75ee21f
4b756554cd8a97df9b7c50f37887e8f228d7ef8a
refs/heads/master
2021-01-23T14:06:18.771321
2016-11-15T05:53:12
2016-11-15T05:53:12
56,838,269
2
1
null
null
null
null
UTF-8
Java
false
false
681
java
package com.yikangyiliao.pension.manager; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.yikangyiliao.pension.dao.AreaDao; import com.yikangyiliao.pension.entity.Area; /** * @author liushuaic * @date 2015/08/27 14:42 * */ @Component public class AreaManager { @Autowired private AreaDao areaDao; public int insertSelective(Area area){ return areaDao.insertSelective(area); } /** * @author liushuaic * @date 2015/08/27 15:52 * @desc 查询城市列表 * */ public Map<String,Object> getAreaCityDistrict(){ return areaDao.getAreaCityDistrict(); } }
[ "lavedream@hotmail.com" ]
lavedream@hotmail.com
906a67ca719a0861c87451beffac5e0c2480d8c5
343c983e497e39e9f41dae6edf990b112a0d7320
/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/impl/LDAPElementFactoryProvider.java
18d94372a4a786f8bf6ec81bc3451c926da3d2f5
[]
no_license
svenreimers/hg-netbeans-org-community-soa
8857c31aa333cd3a3a393838e78df60268e7cedf
deac77f78021b64866d60965585dcb7efccb8f71
refs/heads/master
2023-03-09T11:51:16.023114
2011-09-28T10:01:59
2011-09-28T10:01:59
342,031,636
0
0
null
null
null
null
UTF-8
Java
false
false
3,156
java
/* * The contents of this file are subject to the terms of the Common Development * and Distribution License (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at http://www.netbeans.org/cddl.html * or http://www.netbeans.org/cddl.txt. * * When distributing Covered Code, include this CDDL Header Notice in each file * and include the License file at http://www.netbeans.org/cddl.txt. * If applicable, add the following below the CDDL Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * The Original Software is NetBeans. The Initial Developer of the Original * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.wsdlextensions.ldap.impl; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Set; import javax.xml.namespace.QName; import org.netbeans.modules.xml.wsdl.model.WSDLComponent; import org.netbeans.modules.wsdlextensions.ldap.LDAPQName; import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory; import org.w3c.dom.Element; /** ** @author */ public class LDAPElementFactoryProvider { public static class BindingFactory extends ElementFactory { public Set<QName> getElementQNames() { return Collections.singleton(LDAPQName.BINDING.getQName()); } public WSDLComponent create(WSDLComponent context, Element element) { return new LDAPBindingImpl(context.getModel(), element); } } public static class AddressFactory extends ElementFactory { public Set<QName> getElementQNames() { return Collections.singleton(LDAPQName.ADDRESS.getQName()); } public WSDLComponent create(WSDLComponent context, Element element) { return new LDAPAddressImpl(context.getModel(), element); } } public static class OperationFactory extends ElementFactory { public Set<QName> getElementQNames() { return Collections.singleton(LDAPQName.OPERATION.getQName()); } public WSDLComponent create(WSDLComponent context, Element element) { return new LDAPOperationImpl(context.getModel(), element); } } public static class InputFactory extends ElementFactory { public Set<QName> getElementQNames() { return Collections.singleton(LDAPQName.INPUT.getQName()); } public WSDLComponent create(WSDLComponent context, Element element) { return new LDAPOperationInputImpl(context.getModel(), element); } } public static class OutputFactory extends ElementFactory { public Set<QName> getElementQNames() { return Collections.singleton(LDAPQName.OUTPUT.getQName()); } public WSDLComponent create(WSDLComponent context, Element element) { return new LDAPOperationOutputImpl(context.getModel(), element); } } }
[ "yaroslavskiy@netbeans.org" ]
yaroslavskiy@netbeans.org
f1762b9831a90b2afb2ef0037dde0a7ecd6f0c3e
2b5aaaf43b5a5b3602e20c948c0f2d58583860ed
/mstar-server-dao/src/main/java/com/wincom/mstar/dao/mapper/CZNotifyLevelMapper.java
f6176060fcb04535b96e075f18ccf7aa87d86448
[ "Apache-2.0" ]
permissive
xtwxy/cassandra-tests
2bb2350bf325eba9353d6d632ffe3e4076e213e4
346023aad17d37f1d140879b6808092e04d0e1eb
refs/heads/master
2021-01-19T11:34:27.120908
2017-04-17T21:31:12
2017-04-17T21:31:12
82,253,594
0
0
null
null
null
null
UTF-8
Java
false
false
2,198
java
package com.wincom.mstar.dao.mapper; import com.wincom.mstar.domain.CZNotifyLevel; import com.wincom.mstar.domain.CZNotifyLevelExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface CZNotifyLevelMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int countByExample(CZNotifyLevelExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int deleteByExample(CZNotifyLevelExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int insert(CZNotifyLevel record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int insertSelective(CZNotifyLevel record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ List<CZNotifyLevel> selectByExample(CZNotifyLevelExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int updateByExampleSelective(@Param("record") CZNotifyLevel record, @Param("example") CZNotifyLevelExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table nfjd502.dbo.CZNotifyLevel * * @mbggenerated Thu Mar 02 11:23:21 CST 2017 */ int updateByExample(@Param("record") CZNotifyLevel record, @Param("example") CZNotifyLevelExample example); }
[ "xtwxy@hotmail.com" ]
xtwxy@hotmail.com
319719a17d5a789da4f4cdff6a5f7e5d61119147
f084ac7daedd88b5d5771e742c42be97135a0f3c
/src/main/java/com/ly/seckill/service/SeckillService.java
dca50234e979ef81f48f0e89077ca21f6940167c
[]
no_license
gloomysun/seckill
e12524cdff415ea881b5cd20159c18ab0445a6c0
6d9b1f4912ac32dcec494567bd652eeeb5eafd38
refs/heads/master
2020-04-02T04:45:38.575332
2018-10-28T17:59:47
2018-10-28T17:59:47
154,033,491
0
0
null
null
null
null
UTF-8
Java
false
false
8,163
java
package com.ly.seckill.service; import com.alibaba.fastjson.JSON; import com.ly.seckill.common.Constant; import com.ly.seckill.domain.OrderInfo; import com.ly.seckill.domain.SeckillGoods; import com.ly.seckill.domain.SeckillOrder; import com.ly.seckill.exception.GlobalException; import com.ly.seckill.exception.SeckillException; import com.ly.seckill.queue.rabbitmq.RabbitSender; import com.ly.seckill.queue.rabbitmq.SeckillMsg; import com.ly.seckill.redis.RedisService; import com.ly.seckill.result.CodeMsg; import com.ly.seckill.result.SeckillResult; import com.ly.seckill.vo.SeckillGoodsVo; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class SeckillService implements InitializingBean { @Autowired private GoodsService goodsService; @Autowired private OrderService orderService; @Autowired private SeckillOrderService seckillOrderService; @Autowired private RedisService redisService; @Autowired private RabbitSender rabbitSender; private Map<Long, Boolean> localOverMap = new HashMap(); /** * 初始化数据库数据 */ public void initSeckill(long seckillId) { redisService.set(Constant.STOCK_PREFIX, "1000", 100, -1); goodsService.initSeckillGoods(seckillId); orderService.deleteOrder(); seckillOrderService.deleteSeckillOrder(); localOverMap.put(seckillId, false); } /** * 加载库存到redis * * @throws Exception */ @Override public void afterPropertiesSet() throws Exception { List<SeckillGoodsVo> goodsVoList = goodsService.listGoodsVo(); if (goodsVoList == null) return; for (SeckillGoodsVo goodsVo : goodsVoList) { redisService.set(Constant.STOCK_PREFIX, Long.toString(goodsVo.getSeckillId()), goodsVo.getStockCount(), -1); localOverMap.put(goodsVo.getSeckillId(), false); } } /** * 秒杀逻辑1: * 1、减库存 * 2、写入秒杀订单 * 3、下订单 * Jmeter windows 下测试并发 */ @Transactional public SeckillResult seckill(long userId, long seckillId) { //第三步:减库存 int count = goodsService.reduceStock(seckillId); if (count > 0) { //第四步:必须减库存成功后,写入秒杀订单 //注意插入语句要写insert into 加ignore 忽略插入时抛的重复主键异常 SeckillOrder successOrder = seckillOrderService.createSeckillOrder(userId, seckillId); if (successOrder != null) { //写入秒杀订单成功 然后写入订单 SeckillGoodsVo seckillGoodsVo = goodsService.getGoodsVoBySeckillId(seckillId); OrderInfo order = orderService.createOrder(userId, seckillGoodsVo); return SeckillResult.success(order); } else { //插入秒杀订单失败,说明一个用户的两次秒杀请求都走到这导致主键重复 //抛异常回滚 return SeckillResult.error(CodeMsg.SECKILL_OVER); } } else { //判断库存的时候有,线程走到减库存时没了 return SeckillResult.error(CodeMsg.SECKILL_OVER); } } /** * 秒杀逻辑2 * 逻辑层面优化: 先插入秒杀订单,再减库存 * 1、插入秒杀订单 * 2、插入成功后再减库存,减库存失败后回滚 * 3、创建订单 * <p> * 经测试并发比方案1低? */ @Transactional public SeckillResult seckill2(long userId, long seckillId) { //第一步:创建秒杀订单 SeckillOrder seckillOrder = seckillOrderService.createSeckillOrder(userId, seckillId); if (seckillOrder != null) { //写入秒杀订单成功后 //2、减库存 int count = goodsService.reduceStock(seckillId); if (count > 0) { //减库存成功 //3.写入订单 SeckillGoodsVo seckillGoodsVo = goodsService.getGoodsVoBySeckillId(seckillId); OrderInfo orderInfo = orderService.createOrder(userId, seckillGoodsVo); return SeckillResult.success(orderInfo); } else { return SeckillResult.error(CodeMsg.SECKILL_OVER); //减库存失败 // throw new SeckillException(CodeMsg.SECKILL_OVER); } } else { return SeckillResult.error(CodeMsg.SECKILL_OVER); //创建秒杀订单失败 // throw new SeckillException(CodeMsg.SECKILL_REPEAT); } } //乐观锁 @Transactional public SeckillResult seckill_Three(long userId, long seckillId) { try { SeckillGoods seckillGoods = goodsService.getSeckillGoodsBySeckillId(seckillId); if (seckillGoods.getStockCount() > 0) { int count = goodsService.reduceStockByVersion(seckillGoods); if (count > 0) { SeckillOrder successOrder = seckillOrderService.createSeckillOrder(userId, seckillId); if (successOrder != null) { //写入秒杀订单成功 然后写入订单 SeckillGoodsVo seckillGoodsVo = goodsService.getGoodsVoBySeckillId(seckillId); OrderInfo order = orderService.createOrder(userId, seckillGoodsVo); return SeckillResult.success(order); } else { return SeckillResult.error(CodeMsg.SECKILL_OVER); } } else { return SeckillResult.error(CodeMsg.SECKILL_OVER); } } else { return SeckillResult.error(CodeMsg.SECKILL_OVER); } } catch (SeckillException e) { throw e; } } /** * 将库存写入redis * * @param userId * @param seckillId * @return */ @Transactional public SeckillResult seckillRedis(long userId, long seckillId) { //内存标记,减少redis访问 if (localOverMap.get(seckillId)) { return SeckillResult.error(CodeMsg.SECKILL_OVER); } long stock = redisService.decr(Constant.STOCK_PREFIX, Long.toString(seckillId)); if (stock < 0) { localOverMap.put(seckillId, true);//秒杀完毕记为ftrue; return SeckillResult.error(CodeMsg.SECKILL_OVER); } //下面同方案1 return this.seckill(userId, seckillId); } /** * 异步秒杀 * * @param userId * @param seckillId * @return */ @Transactional public SeckillResult seckillMq(long userId, long seckillId) { //内存标记,减少redis访问 if (localOverMap.get(seckillId)) { return SeckillResult.error(CodeMsg.SECKILL_OVER); } long stock = redisService.decr(Constant.STOCK_PREFIX, Long.toString(seckillId)); if (stock < 0) { localOverMap.put(seckillId, true);//秒杀完毕记为ftrue; return SeckillResult.error(CodeMsg.SECKILL_OVER); } //判断是否已经秒杀到 SeckillOrder seckillOrder = seckillOrderService.getSeckillOrderByUserIdSeckillId(userId, seckillId); if (seckillOrder != null) { return SeckillResult.error(CodeMsg.SECKILL_REPEAT); } //入队 SeckillMsg seckillMsg = new SeckillMsg(); seckillMsg.setUserId(userId); seckillMsg.setSeckillId(seckillId); rabbitSender.sendSeckillMsg(JSON.toJSONString(seckillMsg)); //给前端一个排队中的loading图,然后通过ajax轮询其他接口返回给用户结果 return SeckillResult.success(0); } }
[ "409575046@qq.com" ]
409575046@qq.com
d33ed7bd082ea56ae64dbe78ea1ed6c0323cd500
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/24/24_87bb1267b9ca450a2a7edfc63016dd46b9c779d6/DrMemoryBuildAction/24_87bb1267b9ca450a2a7edfc63016dd46b9c779d6_DrMemoryBuildAction_t.java
637579e5a4331a8b618609acf8376309a5ef8fde
[]
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
7,155
java
package net.praqma.jenkins.plugin.drmemory; import java.awt.BasicStroke; import java.awt.Color; import java.io.File; import java.io.IOException; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.FileUtils; import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.category.LineAndShapeRenderer; import org.jfree.chart.title.LegendTitle; import org.jfree.data.category.CategoryDataset; import org.jfree.ui.RectangleEdge; import org.jfree.ui.RectangleInsets; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import net.praqma.drmemory.DrMemoryResult; import net.praqma.jenkins.plugin.drmemory.graphs.AbstractGraph; import net.praqma.jenkins.plugin.drmemory.graphs.AllLeaksGraph; import net.praqma.jenkins.plugin.drmemory.graphs.TotalLeaksGraph; import hudson.model.AbstractBuild; import hudson.model.Action; import hudson.model.Result; import hudson.util.ChartUtil; import hudson.util.ColorPalette; import hudson.util.DataSetBuilder; import hudson.util.ShiftedCategoryAxis; public class DrMemoryBuildAction implements Action { private static final Logger logger = Logger.getLogger( DrMemoryBuildAction.class.getName() ); public enum GraphType { TOTAL_LEAK } private DrMemoryResult result; private final AbstractBuild<?, ?> build; private DrMemoryPublisher publisher; private DrMemoryBuilder builder; public DrMemoryBuildAction( AbstractBuild<?, ?> build, DrMemoryBuilder builder ) { this.build = build; this.builder = builder; } public void setPublisher( DrMemoryPublisher publisher ) { this.publisher = publisher; } public DrMemoryPublisher getPublisher() { return publisher; } public void setResult( DrMemoryResult result ) { this.result = result; } public DrMemoryBuilder getBuilder() { return builder; } @Override public String getDisplayName() { return "DrMemory"; } @Override public String getIconFileName() { return "graph.gif"; } @Override public String getUrlName() { return "drmemory"; } public DrMemoryResult getResult() { return result; } public void doIndex( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { File dm = new File( build.getRootDir(), "drmemory.txt" ); Calendar t = build.getTimestamp(); if( dm.exists() ) { rsp.serveFile( req, FileUtils.openInputStream( dm ), t.getTimeInMillis(), dm.getTotalSpace(), "drmemory.txt" ); } else { rsp.sendError( HttpServletResponse.SC_NO_CONTENT ); } } static DrMemoryBuildAction getPreviousResult( AbstractBuild<?, ?> start ) { AbstractBuild<?, ?> b = start; while( true ) { b = b.getPreviousBuild(); if( b == null ) { return null; } DrMemoryBuildAction r = b.getAction( DrMemoryBuildAction.class ); if( r != null && r.getResult() == null ) { r = null; } if( r != null ) { return r; } } } public DrMemoryBuildAction getPreviousResult() { return getPreviousResult( build ); } public void doGraph( StaplerRequest req, StaplerResponse rsp ) throws IOException { String type = req.getParameter( "type" ); logger.fine( "Graphing " + type ); int width = 500, height = 200; String w = req.getParameter( "width" ); String h = req.getParameter( "height" ); if( w != null && w.length() > 0 ) { width = Integer.parseInt( w ); } if( h != null && h.length() > 0 ) { height = Integer.parseInt( h ); } if( type == null ) { throw new IOException( "No type given" ); } if( ChartUtil.awtProblemCause != null ) { // not available. send out error message rsp.sendRedirect2( req.getContextPath() + "/images/headless.png" ); return; } Calendar t = build.getTimestamp(); if( req.checkIfModified( t, rsp ) ) { return; // up to date } DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel> dsb = new DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel>(); boolean latest = true; String yaxis = "???"; float min = 999999999; float max = 0; AbstractGraph g = publisher.getGraphTypes().get( type ); if( g == null ) { rsp.sendError( 1 ); return; } /* For each build, moving backwards */ for( DrMemoryBuildAction a = this; a != null; a = a.getPreviousResult() ) { logger.finest( "Build " + a.getDisplayName() ); /* Make the x-axis label */ ChartUtil.NumberOnlyBuildLabel label = new ChartUtil.NumberOnlyBuildLabel( a.build ); float[] ns = g.getNumber( a ); g.addX( dsb, ns, label ); for( float n : ns ) { if( n > max ) { max = n; } if( n < min ) { min = n; } if( latest ) { yaxis = g.getYAxis(); } } latest = false; } ChartUtil.generateGraph( req, rsp, createChart( dsb.build(), g.getTitle(), yaxis, (int)max, (int)min ), width, height ); } private JFreeChart createChart( CategoryDataset dataset, String title, String yaxis, int max, int min ) { final JFreeChart chart = ChartFactory.createLineChart( title, // chart // title null, // unused yaxis, // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... final LegendTitle legend = chart.getLegend(); chart.setBackgroundPaint( Color.white ); final CategoryPlot plot = chart.getCategoryPlot(); // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0)); plot.setBackgroundPaint( Color.WHITE ); plot.setOutlinePaint( null ); plot.setRangeGridlinesVisible( true ); plot.setRangeGridlinePaint( Color.black ); CategoryAxis domainAxis = new ShiftedCategoryAxis( null ); plot.setDomainAxis( domainAxis ); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_90 ); domainAxis.setLowerMargin( 0.0 ); domainAxis.setUpperMargin( 0.0 ); domainAxis.setCategoryMargin( 0.0 ); final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits( NumberAxis.createIntegerTickUnits() ); rangeAxis.setUpperBound( max ); rangeAxis.setLowerBound( min ); final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); renderer.setBaseStroke( new BasicStroke( 2.0f ) ); ColorPalette.apply( renderer ); // crop extra space around the graph plot.setInsets( new RectangleInsets( 5.0, 0, 0, 5.0 ) ); return chart; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a095bb144189a8659e60ade152cdec3a643f7e0a
484c7ae73cfa0aa8263fdd484236c2fe91d3ac4a
/kafka/order-processing-flow/order-invoicer/src/main/java/com/github/wesleyegberto/orderinvoicer/business/order/invoicing/service/OrderInvoicer.java
c24a2a0e4ce3a1c72ecf65b8787791426ea784cf
[ "MIT" ]
permissive
wesleyegberto/spring-study
07e25737e75823d1da5880d391774109fbb0775f
1714fad96d45f6aada2fd1c95ccf9a1fb5c6c83c
refs/heads/master
2022-12-25T11:00:21.153544
2022-11-26T20:13:27
2022-11-26T20:13:33
131,788,908
5
3
MIT
2022-12-16T03:01:15
2018-05-02T02:42:45
Java
UTF-8
Java
false
false
936
java
package com.github.wesleyegberto.orderinvoicer.business.order.invoicing.service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.wesleyegberto.orderinvoicer.business.order.invoicing.entity.Order; import com.github.wesleyegberto.orderinvoicer.business.order.shipping.producer.OrderShippingProducer; @Service public class OrderInvoicer { private static final Logger LOG = LoggerFactory.getLogger(OrderInvoicer.class); private OrderShippingProducer orderInvoicingSender; @Autowired public OrderInvoicer(OrderShippingProducer orderInvoicingSender) { this.orderInvoicingSender = orderInvoicingSender; } public void invoice(Order order) { LOG.info("Invoicing order {}", order.getId()); LOG.info("Credit card invoiced..."); orderInvoicingSender.sendOrderToShipping(order); } }
[ "wesleyegberto@gmail.com" ]
wesleyegberto@gmail.com
a54619d7f51a3735f5bc644a4b88532977b58652
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE319_Cleartext_Tx_Sensitive_Info/CWE319_Cleartext_Tx_Sensitive_Info__listen_tcp_kerberosKey_81_base.java
0d3a4ad941911f1829456ea5d9a19badeb0a441e
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
950
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE319_Cleartext_Tx_Sensitive_Info__listen_tcp_kerberosKey_81_base.java Label Definition File: CWE319_Cleartext_Tx_Sensitive_Info.label.xml Template File: sources-sinks-81_base.tmpl.java */ /* * @description * CWE: 319 Cleartext Transmission of Sensitive Information * BadSource: listen_tcp Read password using a listening tcp connection * GoodSource: Set password to a hardcoded value (one that was not sent over the network) * Sinks: kerberosKey * GoodSink: Decrypt password before using in KerberosKey() * BadSink : Use password directly in KerberosKey() * Flow Variant: 81 Data flow: data passed in a parameter to an abstract method * * */ package testcases.CWE319_Cleartext_Tx_Sensitive_Info; import testcasesupport.*; public abstract class CWE319_Cleartext_Tx_Sensitive_Info__listen_tcp_kerberosKey_81_base { public abstract void action(String password ) throws Throwable; }
[ "you@example.com" ]
you@example.com
cbf7bd1dccc432290adac2a9861df0343ba6f73e
0e4756fbda5832b02258425dd0e94382fdcb40d1
/ctoedu-jap-example/one-to-one-primarykey/src/main/java/cn/ctoedu/jpa/JpaApplication.java
4de758c396c39ea6030ab4dedffac47371d09541
[]
no_license
bobobokey/learndemo
d1da80636864825a8d1a6e6fe1168b599de119d9
24d6200e39d49362ce37023367627f536ecfa814
refs/heads/master
2022-04-28T14:44:17.970284
2022-04-28T04:33:01
2022-04-28T04:33:01
486,090,706
0
0
null
2022-04-28T04:33:02
2022-04-27T07:30:09
null
UTF-8
Java
false
false
364
java
package cn.ctoedu.jpa; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * Created on 2018/2/5. * * * @since 1.0 */ @SpringBootApplication public class JpaApplication { public static void main(String[] args) { SpringApplication.run(JpaApplication.class, args); } }
[ "32060663+csy512889371@users.noreply.github.com" ]
32060663+csy512889371@users.noreply.github.com
bebfc949c722fb02fe9e68ae1bff7b3a73ebd973
412eb1db94abe074a81c581b59389e0dcd5617ff
/biz.ganttproject.impex.ical/src/biz/ganttproject/impex/ical/IcsFileImporter.java
353003772d7f1554b063594cedecc70d8097a377
[]
no_license
gijsdewit/ganttproject
65a71eca79cedb513a19acf2335f807094602ff4
1724f7946df7e9b03a2aba28568d1e65568dfa05
refs/heads/master
2021-01-16T22:06:35.429352
2014-11-07T01:19:53
2014-11-07T01:19:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,996
java
/* Copyright 2013 BarD Software s.r.o This file is part of GanttProject, an opensource project management tool. GanttProject 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. GanttProject 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 GanttProject. If not, see <http://www.gnu.org/licenses/>. */ package biz.ganttproject.impex.ical; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.List; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import net.fortuna.ical4j.data.CalendarBuilder; import net.fortuna.ical4j.data.ParserException; import net.fortuna.ical4j.data.UnfoldingReader; import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.Component; import net.fortuna.ical4j.model.Date; import net.fortuna.ical4j.model.Property; import net.fortuna.ical4j.model.Recur; import net.fortuna.ical4j.model.component.VEvent; import net.fortuna.ical4j.model.property.RRule; import net.sourceforge.ganttproject.GPLogger; import net.sourceforge.ganttproject.calendar.CalendarEditorPanel; import net.sourceforge.ganttproject.importer.ImporterBase; import net.sourceforge.ganttproject.wizard.AbstractWizard; import net.sourceforge.ganttproject.wizard.WizardPage; import biz.ganttproject.core.calendar.CalendarEvent; import biz.ganttproject.core.calendar.GPCalendarCalc; import biz.ganttproject.core.time.TimeDuration; import biz.ganttproject.core.time.impl.GPTimeUnitStack; import com.google.common.collect.Lists; /** * Implements an import wizard plugin responsible for importing ICS files. * This plugin adds file chooser page (2nd in the wizard) and calendar editor page (3rd in the wizard) * * @author dbarashev */ public class IcsFileImporter extends ImporterBase { private final CalendarEditorPage myEditorPage; public IcsFileImporter() { super("impex.ics"); myEditorPage = new CalendarEditorPage(); } @Override public String getFileNamePattern() { return "ics"; } @Override public void run() { getUiFacade().getUndoManager().undoableEdit("Import", new Runnable() { @Override public void run() { List<CalendarEvent> events = myEditorPage.getEvents(); if (events != null) { getProject().getActiveCalendar().setPublicHolidays(events); } } }); } @Override public WizardPage getCustomPage() { return myEditorPage; } @Override public boolean isReady() { return super.isReady() && myEditorPage.getEvents() != null; } @Override public void setFile(File file) { super.setFile(file); myEditorPage.setFile(file); if (file != null && file.exists() && file.canRead()) { myEditorPage.setEvents(readEvents(file)); } } /** * Calendar editor page which wraps a {@link CalendarEditorPanel} instance */ static class CalendarEditorPage implements WizardPage { private File myFile; private JPanel myPanel = new JPanel(); private List<CalendarEvent> myEvents; private void setFile(File f) { myFile = f; } void setEvents(List<CalendarEvent> events) { myEvents = events; } List<CalendarEvent> getEvents() { return myEvents; } public String getTitle() { return "Edit calendar"; } public JComponent getComponent() { return myPanel; } public void setActive(AbstractWizard wizard) { if (wizard != null) { myPanel.removeAll(); if (myFile != null && myFile.exists() && myFile.canRead()) { if (myEvents != null) { myPanel.add(new CalendarEditorPanel(wizard.getUIFacade(), myEvents, null).createComponent()); return; } } myPanel.add(new JLabel(String.format("File %s is not readable", myFile.getAbsolutePath()))); } } } /** * Reads calendar events from file * @return a list of events if file was parsed successfully or null otherwise */ private static List<CalendarEvent> readEvents(File f) { try { CalendarBuilder builder = new CalendarBuilder(); List<CalendarEvent> gpEvents = Lists.newArrayList(); Calendar c = builder.build(new UnfoldingReader(new FileReader(f))); for (Component comp : (List<Component>)c.getComponents()) { if (comp instanceof VEvent) { VEvent event = (VEvent) comp; Date eventStartDate = event.getStartDate().getDate(); Date eventEndDate = event.getEndDate().getDate(); TimeDuration oneDay = GPTimeUnitStack.createLength(GPTimeUnitStack.DAY, 1); if (eventEndDate != null) { java.util.Date startDate = GPTimeUnitStack.DAY.adjustLeft(eventStartDate); java.util.Date endDate = GPTimeUnitStack.DAY.adjustLeft(eventEndDate); RRule recurrenceRule = (RRule) event.getProperty(Property.RRULE); boolean recursYearly = false; if (recurrenceRule != null) { recursYearly = Recur.YEARLY.equals(recurrenceRule.getRecur().getFrequency()) && 1 == recurrenceRule.getRecur().getInterval(); } while (startDate.before(endDate)) { gpEvents.add(CalendarEvent.newEvent(startDate, recursYearly, CalendarEvent.Type.HOLIDAY, event.getSummary().getValue(), null)); startDate = GPCalendarCalc.PLAIN.shiftDate(startDate, oneDay); } } } } return gpEvents; } catch (IOException | ParserException e) { GPLogger.log(e); return null; } } }
[ "none@none" ]
none@none
b3bad205056f28d524991f93397a6e4c6f4922f2
9970f82227c273116a141921fcf5a84abbb548d2
/app/src/main/java/com/dlwx/onedrop/views/MyINiceVideoPlayer.java
e65571d1892387564370c67874b8b032ecc3e9cb
[]
no_license
wch2219/onedrop
e11e10699ce94a5178a2b57199a5a9cc74f78eae
081d2cb725269112bb716ff65bee43ea375271f2
refs/heads/master
2021-09-01T13:03:05.805637
2017-12-27T04:37:12
2017-12-27T04:37:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,075
java
package com.dlwx.onedrop.views; import java.util.Map; public interface MyINiceVideoPlayer { void setUp(String var1, Map<String, String> var2); void start(); void start(long var1); void restart(); void pause(); void seekTo(long var1); void setVolume(int var1); void setSpeed(float var1); void continueFromLastPosition(boolean var1); boolean isIdle(); boolean isPreparing(); boolean isPrepared(); boolean isBufferingPlaying(); boolean isBufferingPaused(); boolean isPlaying(); boolean isPaused(); boolean isError(); boolean isCompleted(); boolean isFullScreen(); boolean isTinyWindow(); boolean isNormal(); int getMaxVolume(); int getVolume(); long getDuration(); long getCurrentPosition(); int getBufferPercentage(); float getSpeed(float var1); long getTcpSpeed(); void enterFullScreen(); boolean exitFullScreen(); void enterTinyWindow(); boolean exitTinyWindow(); void releasePlayer(); void release(); }
[ "wangchonghui2219@126.com" ]
wangchonghui2219@126.com
4d8137e64b6de2c832fd9c4bdfd412b48b3b8517
b9a71bb2805d5f0d5ac98c59d984246463285d34
/testing/PhotoNoter-master/app/src/main/java/com/yydcdut/note/mvp/v/setting/impl/FeedbackActivity.java
fc1ae2f4f33a0603fd02ef35afd2a1cf736db14c
[ "MIT" ]
permissive
rokn/Count_Words_2015
486f3b292954adc76c9bcdbf9a37eb07421ddd2a
e07f6fc9dfceaf773afc0c3a614093e16a0cde16
refs/heads/master
2021-01-10T04:23:49.999237
2016-01-11T19:53:31
2016-01-11T19:53:31
48,538,207
1
1
null
null
null
null
UTF-8
Java
false
false
6,720
java
package com.yydcdut.note.mvp.v.setting.impl; import android.graphics.Color; import android.graphics.PointF; import android.os.Handler; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.view.View; import android.view.animation.AnimationUtils; import android.view.animation.DecelerateInterpolator; import android.widget.EditText; import com.nineoldandroids.animation.Animator; import com.nineoldandroids.animation.AnimatorListenerAdapter; import com.nineoldandroids.animation.TypeEvaluator; import com.nineoldandroids.animation.ValueAnimator; import com.yydcdut.note.NoteApplication; import com.yydcdut.note.R; import com.yydcdut.note.injector.component.DaggerActivityComponent; import com.yydcdut.note.injector.module.ActivityModule; import com.yydcdut.note.mvp.p.setting.impl.FeedbackPresenterImpl; import com.yydcdut.note.mvp.v.BaseActivity; import com.yydcdut.note.mvp.v.setting.IFeedbackView; import com.yydcdut.note.utils.AppCompat; import com.yydcdut.note.utils.Const; import com.yydcdut.note.view.CircleProgressBarLayout; import com.yydcdut.note.view.RevealView; import javax.inject.Inject; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; /** * Created by yuyidong on 15/11/3. */ public class FeedbackActivity extends BaseActivity implements IFeedbackView { @Bind(R.id.et_feedback_content) EditText mContentText; @Bind(R.id.et_feedback_email) EditText mEmailText; @Bind(R.id.layout_progress) CircleProgressBarLayout mProgressLayout; @Bind(R.id.reveal_feedback) RevealView mRevealView; @Bind(R.id.img_feedback_ok) View mOkView; @Bind(R.id.fab_send) FloatingActionButton mFab; @Bind(R.id.toolbar) Toolbar mToolbar; @Inject FeedbackPresenterImpl mFeedbackPresenter; @Override public boolean setStatusBar() { return true; } @Override public int setContentView() { return R.layout.activity_feedback; } @Override public void initInjector() { mActivityComponent = DaggerActivityComponent.builder() .activityModule(new ActivityModule(this)) .applicationComponent(((NoteApplication) getApplication()).getApplicationComponent()) .build(); mActivityComponent.inject(this); } @Override public void initUiAndListener() { ButterKnife.bind(this); mFeedbackPresenter.bindData(getIntent().getIntExtra( mFeedbackPresenter.TYPE, mFeedbackPresenter.TYPE_FEEDBACK)); initToolBarUI(); mFeedbackPresenter.attachView(this); initProgressBar(); } private void initToolBarUI() { setSupportActionBar(mToolbar); mToolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); AppCompat.setElevation(mToolbar, getResources().getDimension(R.dimen.ui_elevation)); } private void initProgressBar() { mProgressLayout.getCircleProgressBar().setCircleBackgroundEnabled(false); mProgressLayout.getCircleProgressBar().setColorSchemeColors(Color.WHITE); } @Override public String getEmail() { return mEmailText.getText().toString(); } @Override public String getContent() { return mContentText.getText().toString(); } @Override public void showFeedbackTitle() { mToolbar.setTitle(getResources().getString(R.string.feedback)); } @Override public void showContactTitle() { mToolbar.setTitle(getResources().getString(R.string.about_contact)); } @Override public void showLoading() { mProgressLayout.show(); } @Override public void hideLoadingAndFinish() { mProgressLayout.hide(); mOkView.setVisibility(View.VISIBLE); mOkView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.anim_scale_small_2_big)); new Handler().postDelayed(new Runnable() { @Override public void run() { finish(); } }, 600); } @Override public void showSnackBar(String message) { Snackbar.make(findViewById(R.id.cl_feedback), message, Snackbar.LENGTH_SHORT).show(); } private void startSendingAnimation(final RevealView.RevealAnimationListener listener) { final int width = mFab.getLeft(); final int height = mFab.getTop(); ValueAnimator valueAnimator = new ValueAnimator(); valueAnimator.setDuration(Const.DURATION / 2); valueAnimator.setObjectValues(new PointF(0, 0)); valueAnimator.setInterpolator(new DecelerateInterpolator()); valueAnimator.setEvaluator(new TypeEvaluator<PointF>() { @Override public PointF evaluate(float fraction, PointF startValue, PointF endValue) { PointF point = new PointF(); point.x = (width) * (1 - fraction / 2); point.y = (height) - 0.85f * (height) * (fraction / 2) * (fraction / 2); return point; } }); valueAnimator.start(); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { PointF point = (PointF) animation.getAnimatedValue(); mFab.setX(point.x); mFab.setY(point.y); } }); valueAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); mRevealView.reveal((int) mFab.getX() + mFab.getWidth() / 2, (int) mFab.getY() + mFab.getHeight() / 2, getThemeColor(), Const.RADIUS, Const.DURATION, listener); } }); } @Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); break; } return true; } @OnClick(R.id.fab_send) public void clickSendFeedback(View v) { boolean wannaStartAnimation = mFeedbackPresenter.checkFeendback(); if (wannaStartAnimation) { startSendingAnimation(new RevealView.RevealAnimationListener() { @Override public void finish() { mFeedbackPresenter.sendFeedback(mEmailText.getText().toString(), mContentText.getText().toString()); } }); } } }
[ "marto_dimitrov@mail.bg" ]
marto_dimitrov@mail.bg
d9bfa21c8a6eb8ba0794eca670108e0ac5930437
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_72a9ca3c1cadb5bec56c75a50e56b844492b5ed5/Rule/34_72a9ca3c1cadb5bec56c75a50e56b844492b5ed5_Rule_t.java
e7de9ddf1b5c0d6ce9ce4e6e68632e9ec823d4ae
[]
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
6,347
java
package models; import java.io.Serializable; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.regex.Matcher; import javax.annotation.Nonnull; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import com.google.appengine.api.datastore.*; import com.google.appengine.api.datastore.Query.FilterOperator; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; import play.Logger; import rules.RuleType; import rules.RuleUtils; import controllers.Login; /** * A sorting rule that allows files to be moved to a specified * location when certain criteria are met. * * @author mustpax * @author syyang */ public class Rule implements Serializable { public static final String KIND = "Rule"; public static final Function<Entity, Key> TO_KEY = new Function<Entity, Key>() { @Override public Key apply(Entity entity) { return entity.getKey(); } }; private static final Function<Entity, Rule> TO_RULE = new Function<Entity, Rule>() { @Override public Rule apply(Entity entity) { return new Rule(entity); } }; public Long id; public RuleType type; public String pattern; public String dest; public Integer rank; public Long owner; public Rule() {} public Rule(RuleType type, String pattern, String dest, Integer rank, Long owner) { this.type = type; this.pattern = pattern; this.dest = dest; this.rank = rank; this.owner = owner; } public Rule(Entity entity) { this.id = entity.getKey().getId(); this.type = RuleType.fromDbValue((String) entity.getProperty("type")); this.pattern = (String) entity.getProperty("pattern"); this.dest = (String) entity.getProperty("dest"); this.rank = ((Long) entity.getProperty("rank")).intValue(); this.owner = (Long) entity.getProperty("owner"); } public Entity toEntity(User owner) { Entity entity = new Entity(KIND, owner.getKey()); entity.setProperty("type", type.getDbValue()); entity.setProperty("pattern", pattern); entity.setProperty("dest", dest); entity.setProperty("rank", rank); entity.setProperty("owner", owner.id); return entity; } public static Rule findById(User owner, Long id) { Preconditions.checkNotNull(id); DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); try { Key key = KeyFactory.createKey(owner.getKey(), KIND, id); return new Rule(ds.get(key)); } catch (EntityNotFoundException e) { return null; } } public static Iterator<Rule> findByOwner(User owner) { Preconditions.checkNotNull(owner); DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); Query q = new Query(KIND).setAncestor(owner.getKey()); PreparedQuery pq = ds.prepare(q); return Iterators.transform(pq.asIterator(), TO_RULE); } public boolean matches(String fileName) { return type.matches(this.pattern, fileName); } public @Nonnull List<RuleError> validate() { List<RuleError> ret = Lists.newLinkedList(); if (type == null) { ret.add(new RuleError("type", "Missing or invalid type.")); } if (owner == null) { ret.add(new RuleError("owner", "Missing rule owner.")); } if (StringUtils.isBlank(pattern)) { ret.add(new RuleError("pattern", "Pattern cannot be empty.")); } else if (pattern.contains("/")) { ret.add(new RuleError("pattern", "Pattern cannot contain slashes (/).")); } // Extensions may not include periods else if ((type == RuleType.EXT_EQ) && pattern.contains(".")) { ret.add(new RuleError("pattern", "Extensions cannot contain periods.")); } if (StringUtils.isBlank(dest)) { ret.add(new RuleError("dest", "Destination directory cannot be empty.")); } else if (! dest.startsWith("/")) { ret.add(new RuleError("dest", "Destination directory must start with a slash (/).")); } // TODO check dest is not a file return ret; } @Override public int hashCode() { HashCodeBuilder hash = new HashCodeBuilder() .append(this.id) .append(this.type) .append(this.pattern) .append(this.dest) .append(this.rank) .append(this.owner); return hash.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; Rule other = (Rule) obj; EqualsBuilder eq = new EqualsBuilder() .append(this.id, other.id) .append(this.type, other.type) .append(this.pattern, other.pattern) .append(this.dest, other.dest) .append(this.rank, other.rank) .append(this.owner, other.owner); return eq.isEquals(); } @Override public String toString() { return Objects.toStringHelper(Rule.class) .add("id", id) .add("rule type", type) .add("pattern", pattern) .add("dest", dest) .add("rank", rank) .add("owner", owner) .toString(); } public static class RuleError { public final String field; public final String msg; public RuleError(String field, String msg) { this.field = field; this.msg = msg; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1163fbff23026c0e0dbd5745d5b6bc45a32ede8a
3ceab28bcfb9df4e0a4a1e7cf81ee719de5b551f
/commontemplate/src/main/java/org/commontemplate/standard/operator/compare/GreaterEqualOperatorHandler.java
e2383afc414d6925d231b50745e9c6dead89322b
[ "Apache-2.0" ]
permissive
draem0507/commontemplate
14f063025f35826b20bad51498cd175478edbb48
6c3b3c0c10a2aa50fbb237d2c7e6d9b02a09d9e9
refs/heads/master
2016-09-10T18:48:54.147050
2015-08-17T06:43:05
2015-08-17T06:43:05
40,870,240
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package org.commontemplate.standard.operator.compare; import org.commontemplate.standard.operator.BinaryOperatorHandlerSupport; /** * 大于或等于比较操作符: ">="<br/> * 如: $if{num1 >= num2}<br/> * * @see java.lang.Comparable * @author liangfei0201@163.com * */ public class GreaterEqualOperatorHandler extends BinaryOperatorHandlerSupport { private static final long serialVersionUID = 1L; public GreaterEqualOperatorHandler() { super(Comparable.class, Comparable.class); } public Object doEvaluate(Object leftOperand, Object rightOperand) throws Exception { return Boolean.valueOf(((Comparable)leftOperand).compareTo(rightOperand) >= 0); } }
[ "liangfei0201@8dadb90d-c23f-0410-a79a-e763b8a9fd85" ]
liangfei0201@8dadb90d-c23f-0410-a79a-e763b8a9fd85
164bdaa887dacfbbac776c4319704395ad9475ce
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/14/14_29afaa98bc553564c553ab42b221a124bd9a26b4/MRUBundleFileList/14_29afaa98bc553564c553ab42b221a124bd9a26b4_MRUBundleFileList_t.java
3b27a792baf05e8196e75d8cb13f260d3c1db7b7
[]
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
7,864
java
/******************************************************************************* * Copyright (c) 2005, 2009 IBM Corporation and others. * 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: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.osgi.baseadaptor.bundlefile; import java.io.IOException; import java.util.Map; import org.eclipse.osgi.framework.eventmgr.*; /** * A simple/quick/small implementation of an MRU (Most Recently Used) list to keep * track of open BundleFiles. The MRU will use the file limit specified by the property * &quot;osgi.bundlefile.limit&quot; by default unless the MRU is constructed with a specific * file limit. * @since 3.2 */ public class MRUBundleFileList implements EventDispatcher { private static final String PROP_FILE_LIMIT = "osgi.bundlefile.limit"; //$NON-NLS-1$ private static final int MIN = 10; private static final int PROP_FILE_LIMIT_VALUE; private static final ThreadLocal closingBundleFile = new ThreadLocal(); static { int propValue = 100; // enable to 100 open files by default try { String prop = BundleFile.secureAction.getProperty(PROP_FILE_LIMIT); if (prop != null) propValue = Integer.parseInt(prop); } catch (NumberFormatException e) { //MRU will be disabled } PROP_FILE_LIMIT_VALUE = propValue; } // list of open bundle files final private BundleFile[] bundleFileList; // list of open bundle files use stamps final private long[] useStampList; // the limit of open files to allow before least used bundle file is closed final private int fileLimit; // value < MIN will disable MRU final private EventManager bundleFileCloserManager; final private Map bundleFileCloser; // the current number of open bundle files private int numOpen = 0; // the current use stamp private long curUseStamp = 0; // used to work around bug 275166 private boolean firstDispatch = true; public MRUBundleFileList() { this(PROP_FILE_LIMIT_VALUE); } public MRUBundleFileList(int fileLimit) { // only enable the MRU if the initFileLimit is > MIN this.fileLimit = fileLimit; if (fileLimit >= MIN) { this.bundleFileList = new BundleFile[fileLimit]; this.useStampList = new long[fileLimit]; this.bundleFileCloserManager = new EventManager("Bundle File Closer"); //$NON-NLS-1$ this.bundleFileCloser = new CopyOnWriteIdentityMap(); this.bundleFileCloser.put(this, this); } else { this.bundleFileList = null; this.useStampList = null; this.bundleFileCloserManager = null; this.bundleFileCloser = null; } } /** * Adds a BundleFile which is about to be opened to the MRU list. If * the number of open BundleFiles == the fileLimit then the least * recently used BundleFile is closed. * @param bundleFile the bundle file about to be opened. */ public void add(BundleFile bundleFile) { if (fileLimit < MIN) return; // MRU is disabled BundleFile toRemove = null; synchronized (this) { if (bundleFile.getMruIndex() >= 0) return; // do nothing; someone is trying add a bundleFile that is already in an MRU list int index = 0; // default to the first slot if (numOpen < fileLimit) { // numOpen does not exceed the fileLimit // find the first null slot to use in the MRU for (int i = 0; i < fileLimit; i++) if (bundleFileList[i] == null) { index = i; break; } } else { // numOpen has reached the fileLimit // find the least recently used bundleFile and close it // and use it slot for the new bundleFile to be opened. index = 0; for (int i = 1; i < fileLimit; i++) if (useStampList[i] < useStampList[index]) index = i; toRemove = bundleFileList[index]; if (toRemove.getMruIndex() != index) throw new IllegalStateException("The BundleFile has the incorrect mru index: " + index + " != " + toRemove.getMruIndex()); //$NON-NLS-1$//$NON-NLS-2$ removeInternal(toRemove); } // found an index to place to bundleFile to be opened bundleFileList[index] = bundleFile; bundleFile.setMruIndex(index); incUseStamp(index); numOpen++; } // must not close the toRemove bundle file while holding the lock of another bundle file (bug 161976) // This queues the bundle file for close asynchronously. closeBundleFile(toRemove); } /** * Removes a bundle file which is about to be closed * @param bundleFile the bundle file about to be closed * @return true if the bundleFile existed in the MRU; false otherwise */ public boolean remove(BundleFile bundleFile) { if (fileLimit < MIN) return false; // MRU is disabled synchronized (this) { int index = bundleFile.getMruIndex(); if ((index >= 0 && index < fileLimit) && bundleFileList[index] == bundleFile) { removeInternal(bundleFile); return true; } } return false; } // must be called while synchronizing "this" private void removeInternal(BundleFile bundleFile) { int index = bundleFile.getMruIndex(); bundleFile.setMruIndex(-1); bundleFileList[index] = null; useStampList[index] = -1; numOpen--; } /** * Increments the use stamp of a bundle file * @param bundleFile the bundle file to increment the use stamp for */ public void use(BundleFile bundleFile) { if (fileLimit < MIN) return; // MRU is disabled synchronized (this) { int index = bundleFile.getMruIndex(); if ((index >= 0 && index < fileLimit) && bundleFileList[index] == bundleFile) incUseStamp(index); } } // must be called while synchronizing "this" private void incUseStamp(int index) { if (curUseStamp == Long.MAX_VALUE) { // we hit the curUseStamp max better reset all the stamps for (int i = 0; i < fileLimit; i++) useStampList[i] = 0; curUseStamp = 0; } useStampList[index] = ++curUseStamp; } public final void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, Object eventObject) { if (firstDispatch) { // used to work around bug 275166; we don't want to leak the TCCL in this thread. Thread.currentThread().setContextClassLoader(null); firstDispatch = false; } try { closingBundleFile.set(eventObject); ((BundleFile) eventObject).close(); } catch (IOException e) { // TODO should log ?? } finally { closingBundleFile.set(null); } } private void closeBundleFile(BundleFile toRemove) { if (toRemove == null) return; /* queue to hold set of listeners */ ListenerQueue queue = new ListenerQueue(bundleFileCloserManager); /* add bundle file closer to the queue */ queue.queueListeners(bundleFileCloser.entrySet(), this); /* dispatch event to set of listeners */ queue.dispatchEventAsynchronous(0, toRemove); } /** * Closes the bundle file closer thread for the MRU list */ public void shutdown() { if (bundleFileCloserManager != null) bundleFileCloserManager.close(); } /** * Returns true if this MRUBundleFileList is currently closing the specified bundle file on the current thread. * @param bundleFile the bundle file * @return true if the bundle file is being closed on the current thread */ public boolean isClosing(BundleFile bundleFile) { if (fileLimit < MIN) return false; // MRU is disabled // check the thread local variable return closingBundleFile.get() == bundleFile; } public boolean isEnabled() { return fileLimit >= MIN; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1f7446051e4c65d9fc357779ade7784cd1e1328f
6a95484a8989e92db07325c7acd77868cb0ac3bc
/modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201405/CompanyServiceInterfacecreateCompanies.java
52533072dd65847d06605051edd79272cd590466
[ "Apache-2.0" ]
permissive
popovsh6/googleads-java-lib
776687dd86db0ce785b9d56555fe83571db9570a
d3cabb6fb0621c2920e3725a95622ea934117daf
refs/heads/master
2020-04-05T23:21:57.987610
2015-03-12T19:59:29
2015-03-12T19:59:29
33,672,406
1
0
null
2015-04-09T14:06:00
2015-04-09T14:06:00
null
UTF-8
Java
false
false
2,194
java
package com.google.api.ads.dfp.jaxws.v201405; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * Creates new {@link Company} objects. * * @param companies the companies to create * @return the created companies with their IDs filled in * * * <p>Java class for createCompanies element declaration. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;element name="createCompanies"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="companies" type="{https://www.google.com/apis/ads/publisher/v201405}Company" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "companies" }) @XmlRootElement(name = "createCompanies") public class CompanyServiceInterfacecreateCompanies { protected List<Company> companies; /** * Gets the value of the companies property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the companies property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCompanies().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Company } * * */ public List<Company> getCompanies() { if (companies == null) { companies = new ArrayList<Company>(); } return this.companies; } }
[ "cseeley@google.com" ]
cseeley@google.com
90fe37142e3a4d2899470fe025c5ab9fc78ce0d9
ff2683777d02413e973ee6af2d71ac1a1cac92d3
/src/main/java/com/alipay/api/domain/AlipayOfflineMarketShopSummaryBatchqueryModel.java
c5c6e429e88e2b51cf7642079a0a48845f5aacf7
[ "Apache-2.0" ]
permissive
weizai118/alipay-sdk-java-all
c30407fec93e0b2e780b4870b3a71e9d7c55ed86
ec977bf06276e8b16c4b41e4c970caeaf21e100b
refs/heads/master
2020-05-31T21:01:16.495008
2019-05-28T13:14:39
2019-05-28T13:14:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,793
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 门店摘要信息批量查询接口 * * @author auto create * @since 1.0, 2018-11-23 15:50:08 */ public class AlipayOfflineMarketShopSummaryBatchqueryModel extends AlipayObject { private static final long serialVersionUID = 7198336544635844782L; /** * 品牌名 */ @ApiField("brand_name") private String brandName; /** * 城市编码,国标码,如:120100表示天津市 */ @ApiField("city_code") private String cityCode; /** * 区域编码,如:120104表示南开区 */ @ApiField("district_code") private String districtCode; /** * 表示接口业务的调用方身份:ISV、 服务商身份标识。传入ISV代表系统集成商身份。传入PROVIDER代表服务商。 */ @ApiField("op_role") private String opRole; /** * 页码,留空标示第一页,默认 20个结果为一页 */ @ApiField("page_no") private Long pageNo; /** * 每页记录数,默认20,最大 100 */ @ApiField("page_size") private Long pageSize; /** * 省份编码,国标码,如:120000表示天津 */ @ApiField("province_code") private String provinceCode; /** * 门店数据查询类型,根据类型可以返回指定的门店数据,目前支持的类型如下: BRAND_RELATION : 品牌商关联店铺 MALL_SELF :MALL自己的门店 MALL_RELATION:MALL关联下的门店 MERCHANT_SELF:商户自己的门店 KB_PROMOTER:口碑客推广者 */ @ApiField("query_type") private String queryType; /** * query_type查询类型下所关联的商户PID */ @ApiField("related_partner_id") private String relatedPartnerId; /** * 门店ID */ @ApiField("shop_id") private String shopId; /** * 门店状态,传入多个状态,多个状态使用英文逗号隔开,例如:PAUSED,OPEN 店铺状态:OPEN(营业)、PAUSED(暂停)、INIT(初始)、FREEZE(冻结)、CLOSED(关店) */ @ApiField("shop_status") private String shopStatus; public String getBrandName() { return this.brandName; } public void setBrandName(String brandName) { this.brandName = brandName; } public String getCityCode() { return this.cityCode; } public void setCityCode(String cityCode) { this.cityCode = cityCode; } public String getDistrictCode() { return this.districtCode; } public void setDistrictCode(String districtCode) { this.districtCode = districtCode; } public String getOpRole() { return this.opRole; } public void setOpRole(String opRole) { this.opRole = opRole; } public Long getPageNo() { return this.pageNo; } public void setPageNo(Long pageNo) { this.pageNo = pageNo; } public Long getPageSize() { return this.pageSize; } public void setPageSize(Long pageSize) { this.pageSize = pageSize; } public String getProvinceCode() { return this.provinceCode; } public void setProvinceCode(String provinceCode) { this.provinceCode = provinceCode; } public String getQueryType() { return this.queryType; } public void setQueryType(String queryType) { this.queryType = queryType; } public String getRelatedPartnerId() { return this.relatedPartnerId; } public void setRelatedPartnerId(String relatedPartnerId) { this.relatedPartnerId = relatedPartnerId; } public String getShopId() { return this.shopId; } public void setShopId(String shopId) { this.shopId = shopId; } public String getShopStatus() { return this.shopStatus; } public void setShopStatus(String shopStatus) { this.shopStatus = shopStatus; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
d617fc96b6b3ed723808f79e6980c1998d5dbc66
75ae440466edf001ab811878619d9abab9e64e3a
/Investigacion/Investigacion-ejb/src/java/ec/edu/espe_ctt_investigacion/session/ParametrosGlobales.java
442267c88d973eeb14a8f2a2fcb88388f3902763
[]
no_license
developerJhonAlon/ProyectosSociales
deefdbd3a5f512a11439c1cc53d785032d9a8133
70100377499be092460e0578478b9ceefa92464b
refs/heads/master
2020-03-26T03:54:33.641829
2020-03-22T02:20:12
2020-03-22T02:20:12
144,476,444
0
0
null
null
null
null
UTF-8
Java
false
false
359
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 ec.edu.espe_ctt_investigacion.session; /** * * @author PC1 */ public class ParametrosGlobales { public final static Boolean AMBIENTE_PRODUCCION1=true; }
[ "jhonalonjami@gmail.com" ]
jhonalonjami@gmail.com
3ea9174ea0510a6a28b6ea257b179427386a6b1a
52200d130d75d2c1f225ca709d9de270ec2b1d2b
/src/main/java/me/prismskey/rpgcore/DataManager/PartyInvitation.java
1c7becbbfd88b77915ec72a8ce443dd4e08c9f80
[ "MIT" ]
permissive
ItzAmirreza/DSCore
81f45d94f34f70c16ecf37e28cab4e99eb1ed2f8
3d75a36e2ebedbae9ddc75cb07f28f1a4492a585
refs/heads/main
2023-04-18T11:51:58.797976
2021-05-03T20:35:45
2021-05-03T20:35:45
364,026,057
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
package me.prismskey.rpgcore.DataManager; import org.bukkit.entity.Player; import java.util.ArrayList; public class PartyInvitation { public String invited; public Party party; public int timeTillExpiry; public final int EXPIRATION_TIME = 20 * 60; public static ArrayList<PartyInvitation> partyInvitations = new ArrayList<>(); public PartyInvitation(String invited, Party party) { this.invited = invited; this.party = party; timeTillExpiry = EXPIRATION_TIME; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
d2e5f4dacd6521d29e78486428cdc5ffaaa53127
5573f95f0979e5b8fe93fc4515203d6352506f7d
/gate-ldap-data/src/main/java/com/github/jimsp/gate/ldap/repositories/LdapGateGroupRepository.java
22a530e328b5323700307ebc6911b5a991bdfe0e
[]
no_license
JimSP/gate
5f73a4a69176c83067efdbe84b39c098fe165a94
71579f290aa387e10ea2b54ad20b84aebf7d29d2
refs/heads/master
2021-05-01T13:04:45.687097
2018-02-13T22:26:05
2018-02-13T22:26:05
121,070,108
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package com.github.jimsp.gate.ldap.repositories; import javax.naming.Name; import org.springframework.data.ldap.repository.LdapRepository; import org.springframework.stereotype.Repository; import com.github.jimsp.gate.ldap.entities.LdapGateGroup; @Repository("ldapGateGroupRepository") public interface LdapGateGroupRepository extends LdapRepository<LdapGateGroup> { public LdapGateGroup findByDn(final Name name); public LdapGateGroup findByName(final String value); }
[ "alexandre.msl@gmail.com" ]
alexandre.msl@gmail.com
6a7678c2fa7a17c1f3710289eec5ce0cf3b1e279
04a12720462c0cfce091e25b8cdaedb13f921b61
/javaAdvance/day12-Socket网络编程、NIO,AIO/04_代码/day12/src/com/itheima/demo8_BS服务器程序/Server.java
09b8105bc9ed483bff2ee0ec3fd551259a37398c
[]
no_license
haoxiangjiao/Java20210921
31662732e44b248208b21f6f1aaf18e6335b398c
6edcbd081d33bace427fdc6041e9eeaac89def8a
refs/heads/main
2023-07-19T03:42:17.498075
2021-09-25T15:06:11
2021-09-25T15:06:11
409,024,583
0
0
null
2021-09-22T01:19:43
2021-09-22T01:19:43
null
UTF-8
Java
false
false
3,260
java
package com.itheima.demo8_BS服务器程序; import java.io.*; import java.net.ServerSocket; import java.net.Socket; /** * @Author:pengzhilin * @Date: 2021/4/17 12:19 */ public class Server { public static void main(String[] args) throws Exception { // 思路: //1.创建ServerSocket对象,指定服务器的端口号8888 ServerSocket ss = new ServerSocket(8888); // 循环接收请求--->请求html页面,还会请求该页面上的图片 while (true) { //2.调用accept()方法接收请求,建立连接,返回Socket对象 Socket socket = ss.accept(); // 浏览器工作原理是遇到图片会开启一个线程进行单独的访问,因此在服务器端加入线程技术。 new Thread(new Runnable() { @Override public void run() { try { //3.通过Socket获得字节输入流对象,关联连接通道 InputStream is = socket.getInputStream(); //4.使用字节输入流对象读取连接通道中的数据 //byte[] bys = new byte[8192]; //int len = is.read(bys); //System.out.println(new String(bys,0,len)); // 把is字节输入流转换为字符输入流 InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = br.readLine(); System.out.println("line:" + line); //5.筛选数据,得到要请求的页面的路径 String path = line.split(" ")[1].substring(1); System.out.println("path:" + path);// day12/web/index.html //6.创建字节输入流对象,关联页面路径 FileInputStream fis = new FileInputStream(path); //7.通过Socket对象获得字节输出流对象,关联连接通道 OutputStream os = socket.getOutputStream(); //8.定义一个byte数组,用来存储读取到的字节数据 byte[] bys = new byte[8192]; //9.定义一个int变量,用来存储读取到的字节个数 int len; os.write("HTTP/1.1 200 OK\r\n".getBytes()); os.write("Content-Type:text/html\r\n".getBytes()); os.write("\r\n".getBytes()); //10.循环读取字节数据 while ((len = fis.read(bys)) != -1) { //11.在循环中,写出字节数据 os.write(bys, 0, len); } //12.释放资源 os.close(); fis.close(); //ss.close(); } catch (Exception e) { } } }).start(); } } }
[ "70306977+liufanpy@users.noreply.github.com" ]
70306977+liufanpy@users.noreply.github.com
2eaa8d6d1ee651d771c4e9f1d494b3d6d2b13eac
ba7fdd337b05f7c5b719ffb377303766fe8e1726
/ProgramacionJava/Leccion15/EjemploClasesAbstractasN2/src/Persona.java
3876ab57e933ed8374e349afad036e8c1d60a816
[]
no_license
RicardoPavezCatrileo/JavaNetBeans
a8149701d934369fb97271c41f07a308274f6bbe
717c6854a9548746e1a9eeebc1c150fc74fbca9a
refs/heads/master
2021-04-27T01:07:24.134153
2018-06-26T16:20:20
2018-06-26T16:20:20
122,668,436
0
0
null
null
null
null
UTF-8
Java
false
false
501
java
//SuperClase //Una Clase Abstracta contiene al menos un metodo que no ha sido //especificado, es decir, este sera heredado para sobreescribirse //Haciendo la clase abstracta para evitar que sea instanciada public abstract class Persona { String nombre; int edad; //Metodo Constructor con dos parametros public Persona(String nom,int ed){ this.nombre=nom; this.edad=ed; } //Creando el Metodo Abstracto abstract public void verDatos(); }
[ "john@sample.com" ]
john@sample.com
b0abeb593594e997adafc3fd71382d3730dee0c1
a90cc77fd5dbce39ebb643e41fa6dc1f4ebfb04f
/src/task/task04/task0432/Solution.java
ccd6ca20fc9bd56e5e4b1ad2f518e77a5b30ad28
[]
no_license
Borislove/JavaRush
e8b6e43ece6b18323dff75086d845f18f33894a5
76600418cf8e590f6c96493e02b71769a9fcab52
refs/heads/master
2021-05-26T10:20:30.262452
2020-06-17T18:41:54
2020-06-17T18:41:54
254,093,677
0
0
null
null
null
null
UTF-8
Java
false
false
1,343
java
package task.task04.task0432; /*Ввести с клавиатуры строку и число N больше 0. Вывести на экран строку N раз используя цикл while. Каждое значение с новой строки. Пример ввода: абв 2 Пример вывода: абв абв Требования: • Программа должна считывать текст c клавиатуры. • Программа должна выводить текст на экран. • Каждое значение должно быть выведено с новой строки. • Программа должна выводить на экран строку N раз. • В программе должен использоваться цикл while.*/ /* Хорошего много не бывает */ import java.io.BufferedReader; import java.io.InputStreamReader; public class Solution { public static void main(String[] args) throws Exception { //напишите тут ваш код BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String str = reader.readLine(); int a = Integer.parseInt(reader.readLine()); while (a > 0) { System.out.println(str); a--; } } }
[ "abirme@yandex.ru" ]
abirme@yandex.ru
9c4ca06e5c044174b04fe7e7a2b9060680174b61
d638361cb42e70a7371acc3ff8439dc5520b3b1e
/src/main/java/com/example/criteriaapidemo/repository/PersonSpecs.java
9ed1ef4b28fb70c76d77364a8e3d0907a075f699
[]
no_license
andifalk/criteria-api-demo
0e23d7391731817728b9fe78c8318fa68abd783e
c9a4a6eeba9e3ae4d98599afc5df05356be21859
refs/heads/master
2021-01-15T23:22:04.010983
2017-08-10T14:30:56
2017-08-10T14:30:56
99,932,282
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
package com.example.criteriaapidemo.repository; import com.example.criteriaapidemo.model.Address; import com.example.criteriaapidemo.model.Address_; import com.example.criteriaapidemo.model.Person; import com.example.criteriaapidemo.model.Person_; import org.springframework.data.jpa.domain.Specification; import javax.persistence.criteria.ListJoin; public final class PersonSpecs { private PersonSpecs() { } public static Specification<Person> hasFirstName(String firstName) { return (root, query, builder) -> builder.equal(root.get(Person_.firstname), firstName); } public static Specification<Person> hasLastName(String lastName) { return (root, query, builder) -> builder.equal(root.get(Person_.lastname), lastName); } public static Specification<Person> isLivingInStreet(String street) { return (root, query, builder) -> { ListJoin<Person, Address> addressListJoin = root.join(Person_.addresses); return builder.equal(addressListJoin.get(Address_.street), street); }; } }
[ "andreas.falk@novatec-gmbh.de" ]
andreas.falk@novatec-gmbh.de
34aff4d06ed07a04451b3400255280a2a33df308
bb302c89db6cd4a4d9ab7571796368c35445c2cd
/libs11/src/main/java/com/course/business/controller/web/KaptchaController.java
b6b55f063fe616f61a95aa74f1b9473050577ce7
[]
no_license
seasunny1229/SpringCloud
ee008c0114bdeb8f297db54261b324855275991c
5c87263df9c59d895784318aa6126bb0221edf71
refs/heads/master
2023-03-21T03:32:14.584007
2021-03-14T14:48:40
2021-03-14T14:48:40
302,620,471
0
0
null
null
null
null
UTF-8
Java
false
false
3,299
java
package com.course.business.controller.web; import com.google.code.kaptcha.impl.DefaultKaptcha; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.util.concurrent.TimeUnit; /** * * 给前端发送验证码图片 * */ @RestController @RequestMapping("/web/kaptcha") public class KaptchaController { @Qualifier("getWebKaptcha") @Autowired DefaultKaptcha defaultKaptcha; @Autowired public StringRedisTemplate redisTemplate; /** * * 生成验证码 * * redis缓存 * imageCodeToken --> imageCode * * 发送验证码到前端 * * * @param imageCodeToken 前端生成的imageCodeToken * * @param request httpServletRequest (servlet参数) * * @param httpServletResponse httpServletResponse (servlet参数) * * @throws Exception */ @GetMapping("/image-code/{imageCodeToken}") public void imageCode(@PathVariable(value = "imageCodeToken") String imageCodeToken, HttpServletRequest request, HttpServletResponse httpServletResponse) throws Exception{ ByteArrayOutputStream jpegOutputStream = new ByteArrayOutputStream(); try { // 生成验证码字符串 String createText = defaultKaptcha.createText(); // 将生成的验证码放入会话缓存中,后续验证的时候用到 // request.getSession().setAttribute(imageCodeToken, createText); // 将生成的验证码放入redis缓存中,后续验证的时候用到 redisTemplate.opsForValue().set(imageCodeToken, createText, 300, TimeUnit.SECONDS); // 使用验证码字符串生成验证码图片 BufferedImage challenge = defaultKaptcha.createImage(createText); ImageIO.write(challenge, "jpg", jpegOutputStream); } catch (IllegalArgumentException e) { httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND); return; } // 定义response输出类型为image/jpeg类型,使用response输出流输出图片的byte数组 byte[] captchaChallengeAsJpeg = jpegOutputStream.toByteArray(); httpServletResponse.setHeader("Cache-Control", "no-store"); httpServletResponse.setHeader("Pragma", "no-cache"); httpServletResponse.setDateHeader("Expires", 0); httpServletResponse.setContentType("image/jpeg"); ServletOutputStream responseOutputStream = httpServletResponse.getOutputStream(); responseOutputStream.write(captchaChallengeAsJpeg); responseOutputStream.flush(); responseOutputStream.close(); } }
[ "sea_sunny1229@163.com" ]
sea_sunny1229@163.com
0933bad4f7ad6cc024a495a6f6246b03dc324f13
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/WorldConfigurationBuilder.java
cdfe1bec75510f579ee39494ac943b8ec2e714d4
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,782
java
25 https://raw.githubusercontent.com/Sauilitired/Hyperverse/master/Core/src/main/java/se/hyperver/hyperverse/world/WorldConfigurationBuilder.java // // Hyperverse - A Minecraft world management plugin // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // package se.hyperver.hyperverse.world; import se.hyperver.hyperverse.util.SeedUtil; /** * Builder for {@link WorldConfiguration} */ public class WorldConfigurationBuilder { private String name; private WorldType type = WorldType.OVER_WORLD; private WorldFeatures worldFeatures = WorldFeatures.NORMAL; private String settings = ""; private long seed = SeedUtil.randomSeed(); private WorldStructureSetting generateStructures = WorldStructureSetting.GENERATE_STRUCTURES; private String generator = ""; private String generatorArg = ""; public WorldConfigurationBuilder setName(String name) { this.name = name; return this; } public WorldConfigurationBuilder setType(WorldType type) { this.type = type; return this; } public WorldConfigurationBuilder setSettings(String settings) { this.settings = settings; return this; } public WorldConfigurationBuilder setSeed(long seed) { this.seed = seed; return this; } public WorldConfigurationBuilder setGenerateStructures(WorldStructureSetting generateStructures) { this.generateStructures = generateStructures; return this; } public WorldConfigurationBuilder setGenerator(String generator) { this.generator = generator; return this; } public WorldConfigurationBuilder setGeneratorArg(String generatorArg) { this.generatorArg = generatorArg; return this; } public WorldConfigurationBuilder setWorldFeatures(WorldFeatures worldFeatures) { this.worldFeatures = worldFeatures; return this; } public WorldConfiguration createWorldConfiguration() { return new WorldConfiguration(name, type, worldFeatures, settings, seed, generateStructures == WorldStructureSetting.GENERATE_STRUCTURES, generator, generatorArg); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
e030f54cc17251acc9c84291c530460eb7effdb2
4545f8351ff5c61d66912a538f2b1741fa6e3e14
/3(mar)/src/mar13/Person3.java
781ae5f5eda7434bd7ad2955b0174b07dc70d9b0
[]
no_license
amandeep-verma/java_learning
9765a15e93113f10eb6f11a09cc8ac47b1185079
160a29b8a462b0e26517a42f00e0da32578a0231
refs/heads/master
2023-02-20T14:52:50.720416
2021-01-21T00:30:10
2021-01-21T00:30:10
265,697,926
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package mar13; // class Person only with 1 constructor which has 2 parameters public class Person3 { String name; int age; Person3(String name,int age) { this.name=name; this.age=age; } void PersonInfo() { System.out.println("Name "+name); System.out.println("Age "+age); } }
[ "39786879+amandeep-verma@users.noreply.github.com" ]
39786879+amandeep-verma@users.noreply.github.com
75b985baea1660a98b9c9e7198c6167c4b0cfe51
c99bebb2a9694540d9275a542c2434c7931c4dd3
/src/main/java/io/ebeanservice/elastic/update/UpdateNested.java
8bfa1cf9785214c7cd33f61567a94e5997414442
[ "Apache-2.0" ]
permissive
liuyinyin/ebean-elastic
cac16163033f34e2326b10a621084e51f4cf281b
f0940b1eca3733c2ed9fc26a73e4cf7172f495c6
refs/heads/master
2020-06-07T15:55:46.726310
2019-06-21T07:41:00
2019-06-21T07:41:00
193,052,860
0
0
Apache-2.0
2019-06-21T07:32:52
2019-06-21T07:32:50
null
UTF-8
Java
false
false
710
java
package io.ebeanservice.elastic.update; import java.util.ArrayList; import java.util.List; /** * A group of nested updates for a given path. * <p> * We group these together to process in batch/bulk. * </p> */ public class UpdateNested { private final String path; private final List<Object> ids = new ArrayList<Object>(); /** * Construct given the path. */ public UpdateNested(String path) { this.path = path; } /** * Return the path. */ public String getPath() { return path; } /** * Return the Ids. */ public List<Object> getIds() { return ids; } /** * Add an Id to the list. */ public void addId(Object id) { ids.add(id); } }
[ "robin.bygrave@gmail.com" ]
robin.bygrave@gmail.com
0e01551055f7c38fc2a90de45eb2a1aea612ad5c
b360b7be30c70ada1fa9aa47bbe232f9bbc68035
/src/test/java/org/fest/assertions/api/DateAssert_isWithinMonth_Test.java
d725dd7bfbf3ed09271989d789d783b07f0e8bcc
[ "Apache-2.0" ]
permissive
astubbs/fest-assert-2.x
fb77a8f76cb396ffe8db962abffb52c07168f38a
15fe43a7e6a0a898c5632b70c2febdb1d2a2abaf
refs/heads/master
2023-07-09T12:35:13.665653
2012-08-08T20:28:12
2012-08-08T20:28:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,222
java
/* * Created on Dec 21, 2010 * * 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. * * Copyright @2010-2011 the original author or authors. */ package org.fest.assertions.api; import static org.mockito.Mockito.verify; /** * Tests for <code>{@link DateAssert#isWithinMonth(int)}</code>. * * @author Joel Costigliola */ public class DateAssert_isWithinMonth_Test extends AbstractDateAssertWithOneIntArg_Test { @Override protected DateAssert assertionInvocationWithOneIntArg() { return assertions.isWithinMonth(intArg); } @Override protected void verifyAssertionInvocation() { verify(dates).assertIsWithinMonth(assertions.info, assertions.actual, intArg); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
1c96452035807744de848250616ecfd483dee0d1
7dbbe21b902fe362701d53714a6a736d86c451d7
/BzenStudio-5.6/Source/com/zend/ide/cb/a/hd.java
c5e790a05897f414f0e48a5b6b5710d9050ae283
[]
no_license
HS-matty/dev
51a53b4fd03ae01981549149433d5091462c65d0
576499588e47e01967f0c69cbac238065062da9b
refs/heads/master
2022-05-05T18:32:24.148716
2022-03-20T16:55:28
2022-03-20T16:55:28
196,147,486
0
0
null
null
null
null
UTF-8
Java
false
false
2,789
java
package com.zend.ide.cb.a; import com.zend.ide.util.ct; import java.awt.Color; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JToolBar; import javax.swing.SpinnerModel; class hd extends JPanel { private ke a; private JToolBar b; private JToolBar c; private JButton d; private JButton e; private JButton f; private JButton g; private JButton h; private JButton i; final v j; public hd(v paramv) { a(); } private void a() { setLayout(new GridLayout(1, 2)); v.a(this.j, new rd(this.j, this.j.j(), 1, 3000, 50)); this.a = new ke(v.a(this.j), 4); this.a.getModel().addChangeListener(new ge(this)); JFormattedTextField localJFormattedTextField = this.a.a(); localJFormattedTextField.addKeyListener(new w(this, localJFormattedTextField)); this.b = new JToolBar("limitsToolbar", 0); this.c = new JToolBar("navigationToolbar", 0); this.b.setRollover(true); this.c.setRollover(true); this.c.setLayout(new FlowLayout(2)); this.b.setLayout(new FlowLayout(0)); this.b.setFloatable(false); this.c.setFloatable(false); this.b.add(new JLabel(ct.a(1491))); this.b.add(this.a); this.e = new JButton(new jc(this.j)); this.d = new JButton(new ic(this.j)); this.f = new JButton(new kc(this.j)); this.g = new JButton(new lc(this.j)); this.h = new JButton(new gc(this.j)); this.i = new JButton(new hc(this.j)); this.e.setToolTipText(ct.a(588)); this.d.setToolTipText(ct.a(589)); this.f.setToolTipText(ct.a(354)); this.g.setToolTipText(ct.a(1492)); this.h.setToolTipText(ct.a(1493)); this.i.setToolTipText(ct.a(1494)); this.c.add(this.g); this.c.add(this.f); this.c.add(this.e); this.c.add(this.d); add(this.b); add(this.c); this.b.setBackground(getBackground()); this.c.setBackground(getBackground()); a(false); } public void a(boolean paramBoolean) { this.h.setEnabled(paramBoolean); this.i.setEnabled(paramBoolean); } public void setBackground(Color paramColor) { super.setBackground(paramColor); if ((this.b != null) && (this.c != null)) { this.b.setBackground(paramColor); this.c.setBackground(paramColor); } } public void b(boolean paramBoolean) { this.d.setEnabled(paramBoolean); } public void c(boolean paramBoolean) { this.e.setEnabled(paramBoolean); } public void d(boolean paramBoolean) { this.g.setEnabled(paramBoolean); } } /* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar * Qualified Name: com.zend.ide.cb.a.hd * JD-Core Version: 0.6.0 */
[ "byqdes@gmail.com" ]
byqdes@gmail.com
485382ae691af8f4ebbb6b928de9cb8e749b0ea1
afb86ad517d87b0cd95902a3c9e79682f9527e94
/data-dao/src/main/java/com/kf/data/mybatis/mapper/tdx/TdxCompanyTaxArrearsMapper.java
7c265776a6b8d3596d016cf868fe5953ea5a34b2
[]
no_license
liangyangtao/datasync
10e8eb2c0be73db749fd9be96e1e9f6e4b5170ef
d3e0470c645adc5f77e50346df8a80f1a3456767
refs/heads/master
2020-03-06T15:17:46.759358
2018-03-27T08:53:11
2018-03-27T08:53:11
126,953,079
0
0
null
2018-03-27T08:53:12
2018-03-27T08:19:26
Java
UTF-8
Java
false
false
3,431
java
package com.kf.data.mybatis.mapper.tdx; import com.kf.data.mybatis.entity.tdx.TdxCompanyTaxArrears; import com.kf.data.mybatis.entity.tdx.TdxCompanyTaxArrearsExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface TdxCompanyTaxArrearsMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int countByExample(TdxCompanyTaxArrearsExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int deleteByExample(TdxCompanyTaxArrearsExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int insert(TdxCompanyTaxArrears record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int insertSelective(TdxCompanyTaxArrears record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ List<TdxCompanyTaxArrears> selectByExample(TdxCompanyTaxArrearsExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ TdxCompanyTaxArrears selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int updateByExampleSelective(@Param("record") TdxCompanyTaxArrears record, @Param("example") TdxCompanyTaxArrearsExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int updateByExample(@Param("record") TdxCompanyTaxArrears record, @Param("example") TdxCompanyTaxArrearsExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int updateByPrimaryKeySelective(TdxCompanyTaxArrears record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table tdx_company_tax_arrears * * @mbggenerated Thu Mar 22 11:27:20 CST 2018 */ int updateByPrimaryKey(TdxCompanyTaxArrears record); }
[ "liangyt@kaifengdata.com" ]
liangyt@kaifengdata.com
7c34ed5f3e3ef64669735efb121090fd330acfc5
773c0b952ffd12ee95559ddfe96d3e5928f43cfa
/app/src/main/java/com/alexsen/dialogfragmetns/Fragment1.java
ea2c7ebcbb4913f73fa88a6666d649d7fd82f0e9
[]
no_license
AlexMacSen/SimpleChronometer
99f689243ff2c42269586d6ff06bc51c96f792f6
76c08edf63e8a30bd47bfdb902eecc60ce4d6bec
refs/heads/master
2021-01-13T03:40:04.712401
2017-05-20T21:30:36
2017-05-20T21:30:36
77,252,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,510
java
package com.alexsen.dialogfragmetns; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.os.Bundle; import com.alexsen.chronometer.ChronometerActivity; import com.alexsen.chronometer.R; @SuppressLint("ValidFragment") public class Fragment1 extends DialogFragment { public Fragment1(String title) { Bundle args = new Bundle(); args.putString("title", title); setArguments(args); } @Override // create custom Dialog object public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString("title"); return new AlertDialog.Builder(getActivity()) .setTitle(title) .setPositiveButton(getString(R.string.menu_ok), new DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int whichButton) { ((ChronometerActivity) getActivity()).doPositiveClick(); } }) .setNegativeButton(getString(R.string.menu_cancel), new DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int whichButton) { ((ChronometerActivity) getActivity()).doNegativeClick(); } }).create(); } }
[ "user" ]
user
f5e75e7591a45c13406a4225488962d01216f82b
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE113_HTTP_Response_Splitting/CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b.java
6b3d7139e35c235100151de19d20c6455fbc4b82
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
2,265
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b.java Label Definition File: CWE113_HTTP_Response_Splitting.label.xml Template File: sources-sinks-74b.tmpl.java */ /* * @description * CWE: 113 HTTP Response Splitting * BadSource: Property Read data from a system property * GoodSource: A hardcoded string * Sinks: addCookieServlet * GoodSink: URLEncode input * BadSink : querystring to addCookie() * Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package * * */ package testcases.CWE113_HTTP_Response_Splitting; import testcasesupport.*; import java.util.HashMap; import javax.servlet.http.*; import java.net.URLEncoder; public class CWE113_HTTP_Response_Splitting__Property_addCookieServlet_74b { public void bad_sink(HashMap<Integer,String> data_hashmap , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = data_hashmap.get(2); if (data != null) { Cookie cookieSink = new Cookie("lang", data); /* POTENTIAL FLAW: Input not verified before inclusion in the cookie */ response.addCookie(cookieSink); } } /* goodG2B() - use GoodSource and BadSink */ public void goodG2B_sink(HashMap<Integer,String> data_hashmap , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = data_hashmap.get(2); if (data != null) { Cookie cookieSink = new Cookie("lang", data); /* POTENTIAL FLAW: Input not verified before inclusion in the cookie */ response.addCookie(cookieSink); } } /* goodB2G() - use BadSource and GoodSink */ public void goodB2G_sink(HashMap<Integer,String> data_hashmap , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = data_hashmap.get(2); if (data != null) { Cookie cookieSink = new Cookie("lang", URLEncoder.encode(data, "UTF-8")); /* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */ response.addCookie(cookieSink); } } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
9149a0ae8d63068d22b307f2065779f926d06e3a
d579b25070df5010c6f04c26928354cbc2f067ef
/benchmarks/generation/sling_4982/Mckoi-01/src/main/java/com/mckoi/database/TableAccessState.java
7d0fd7f1c53492d5a47d4f4d45ec502269d83bb6
[]
no_license
Spirals-Team/itzal-experiments
b9714f7a340ef9a2e4e748b5b723789592ea1cd5
87be2e8c554462ef38e7574dbdd5b28dadb52421
refs/heads/master
2022-04-07T22:45:06.765973
2020-03-03T06:18:03
2020-03-03T06:18:03
113,832,374
0
0
null
2020-03-03T06:18:05
2017-12-11T08:26:25
null
UTF-8
Java
false
false
3,319
java
/** * com.mckoi.database.TableAccessState 13 Sep 1998 * * Mckoi SQL Database ( http://www.mckoi.com/database ) * Copyright (C) 2000, 2001 Diehl and Associates, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * Version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License Version 2 for more details. * * You should have received a copy of the GNU General Public License * Version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Change Log: * * */ package com.mckoi.database; /** * This class provides very limited access to a Table object. The purpose of * this object is to define the functionality of a table when the root table(s) * are locked via the 'Table.lockRoot(int)' method, and when the Table is no * longer READ or WRITE locked via the 'LockingMechanism' system. During these * conditions, the table is in a semi-volatile state, so this class provides * a safe way to access the table without having to worry about using some * functionality of Table which isn't supported at this time. * <p> * @author Tobias Downer */ public final class TableAccessState { /** * The underlying Table object. */ private Table table; /** * Set to true when the table is first locked. */ private boolean been_locked; /** * The Constructor. */ TableAccessState(Table table) { this.table = table; been_locked = false; } /** * Returns the cell at the given row/column coordinates in the table. * This method is valid because it doesn't use any of the SelectableScheme * information in any of its parent tables which could change at any time * when there is no READ or WRITE lock on the table. */ public DataCell getCellContents(int column, int row) { return table.getCellContents(column, row); } /** * Returns the TableField object of the given column. * This information is constant per table. */ public TableField getFieldAt(int column) { return table.getFieldAt(column); } /** * Returns a fully resolved name of the given column. */ public String getResolvedColumnName(int column) { return table.getResolvedColumnName(column); } /** * Locks the root rows of the table. * This method is a bit of a HACK - why should the contract include being * able to lock the root rows? * This method only permits the roots to be locked once. */ public void lockRoot(int key) { if (!been_locked) { table.lockRoot(key); been_locked = true; } } /** * Unlocks the root rows of the table. */ public void unlockRoot(int key) { if (been_locked) { // && table.hasRootsLocked()) { table.unlockRoot(key); been_locked = false; } else { throw new RuntimeException("The root rows aren't locked."); } } }
[ "martin.monperrus@gnieh.org" ]
martin.monperrus@gnieh.org
72fc8a4f52ea427e67e24a4c6837ae6f0eac19f7
51bf065171e3dcecd79ad3fc37206d99e21c9773
/GuiceExample/src/main/java/CreditCardProcessorFactory.java
88417a15e932b905b4030995382e71db7b811938
[]
no_license
marymafa/Java
9491d66e1b9c2add50294ecec61df8bc1b8918a6
ae86fececfcf7f0a16c06a889e7cfb5f8e7c86ef
refs/heads/master
2020-04-25T08:55:30.360811
2019-05-31T11:13:19
2019-05-31T11:13:19
172,662,640
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
public class CreditCardProcessorFactory { private static CreditCardProcessor instance; public static void setInstance(CreditCardProcessor processor) { instance = processor; } public static CreditCardProcessor getInstance() { if (instance == null) { return new SquareCreditCardProcessor() { }; } return instance; } }
[ "you@example.com" ]
you@example.com
67edf0375d4767bd8f42d236aeadc1597ed230ae
98ccbb4f41669dbdfcae08c3709a404131f54f05
/2021/src/M0408/두배열의합.java
2f9b54298b938bca11f445476b6ea85c97f6e533
[ "MIT" ]
permissive
KimJaeHyun94/CodingTest
fee6f14b3320c85670bdab7e9dbe97f429a31d9c
f153879ac0ac1cf45de487afd9a4a94c9ffbe10d
refs/heads/main
2023-04-22T15:27:46.325475
2021-05-16T15:02:27
2021-05-16T15:02:27
330,885,734
0
0
null
null
null
null
UTF-8
Java
false
false
2,083
java
package M0408; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.StringTokenizer; public class 두배열의합 { static long T; static int N, M; static int A[], B[]; static ArrayList<Long> sumA, sumB; public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); T = Long.parseLong(br.readLine()); N = Integer.parseInt(br.readLine()); A = new int[N]; sumA = new ArrayList<>(); StringTokenizer st = new StringTokenizer(br.readLine()); for (int i = 0; i < N; i++) { A[i] = Integer.parseInt(st.nextToken()); } M = Integer.parseInt(br.readLine()); B = new int[M]; sumB = new ArrayList<>(); st = new StringTokenizer(br.readLine()); for (int i = 0; i < M; i++) { B[i] = Integer.parseInt(st.nextToken()); } for (int i = 0; i < N; i++) { long sum = 0; for (int j = i; j < N; j++) { sum += A[j]; sumA.add(sum); } } for (int i = 0; i < M; i++) { long sum = 0; for (int j = i; j < M; j++) { sum += B[j]; sumB.add(sum); } } Collections.sort(sumA); Collections.sort(sumB); long cnt = 0; for (int i = 0; i < sumA.size(); i++) { long target = T - sumA.get(i); cnt += upper_bound(0, target) - lower_bound(0, target); } System.out.println(cnt); } private static int lower_bound(int left, long target) { int right = sumB.size(); while (left < right) { int mid = (left + right) >> 1; if (sumB.get(mid) < target) { left = mid + 1; } else { right = mid; } } return right; } private static int upper_bound(int left, long target) { int right = sumB.size(); while (left < right) { int mid = (left + right) >> 1; if (sumB.get(mid) <= target) { left = mid + 1; } else { right = mid; } } return right; } }
[ "ru6300@naver.com" ]
ru6300@naver.com
9d3f3010421bfdd1e6964a12953e73c13eee5fd4
f6286ac3462cb103b9d5de3937345d362e1e9cec
/src_infoextra/com/uniwin/webkey/infoExtra/core/ServerPush.java
a5dd55d12ea0c9c54fd4d055679a0f1a0a53a73f
[]
no_license
hebut/Collection
55fb4a8a781b01e9ef0624feb4d013e297301ad7
d5e10dda8fdf1123e8995851b5a8473ba7323d33
refs/heads/master
2016-09-05T15:41:35.899529
2014-01-19T06:16:37
2014-01-19T06:16:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,475
java
package com.uniwin.webkey.infoExtra.core; /** * 结果暂存里的动态显示 */ import java.util.List; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.DesktopUnavailableException; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Listbox; import org.zkoss.zul.Listcell; import org.zkoss.zul.Listitem; import org.zkoss.zul.Tabbox; import org.zkoss.zul.Tabpanel; import org.zkoss.zul.Tabpanels; import com.uniwin.webkey.infoExtra.model.WkTExtractask; import com.uniwin.webkey.infoExtra.model.WkTGuidereg; import com.uniwin.webkey.infoExtra.model.WkTPickreg; import com.uniwin.webkey.infoExtra.task.Reader; public class ServerPush extends Thread{ private Tabbox _box; private Listcell cListcell; private final Desktop _desktop; private boolean _ceased; private Listbox _lisListbox; private WkTExtractask _extract; private List<WkTPickreg> _pList; private List<WkTGuidereg> _gList; String _encond; LinkCollection linkCollection; public ServerPush(Tabbox box){ this._box=box; _desktop=box.getDesktop(); } public void run() { infoPick pick; String[] extractResult; String visitUrl; int count=linkCollection.getunVisitedUrlNum(); while ( !_ceased && !linkCollection.unVisitedUrlsEmpty() && linkCollection.getVisitedUrlNum()<=1000) { /*try { Thread.sleep(100); } catch (InterruptedException e1) { e1.printStackTrace(); } */ try { Executions.activate(_desktop); } catch (DesktopUnavailableException e) { e.printStackTrace(); } catch (InterruptedException e) { System.out.println("中断"); } try { visitUrl=linkCollection.unVisitedUrlDeQueue(); extractResult=new String[_pList.size()]; pick=new infoPick(); extractResult=pick.extractByTags(visitUrl,_extract,_encond,_pList,_gList.get(_gList.size()-1)); linkCollection.addVisitedUrl(visitUrl); if(extractResult!=null && !extractResult.equals("")){ Listitem item=new Listitem(); item.setHeight("20px"); Listcell cell; for(int i=0;i<_pList.size();i++){ cell=new Listcell(); if(extractResult[i]!=null && extractResult[i].trim().length()>=40){ String cc=extractResult[i].substring(0, 40)+"..."; cell.setLabel(cc); cell.setTooltiptext(extractResult[i]); cell.setValue(extractResult[i]); }else{ if(extractResult[i]!=null){ cell.setLabel(extractResult[i]); cell.setValue(extractResult[i]); } } item.appendChild(cell); final String cellValue; if(cell.getValue()==null){ cellValue=""; }else{ cellValue=cell.getValue().toString(); } cell.addEventListener(Events.ON_DOUBLE_CLICK, new EventListener(){ public void onEvent(Event arg0) throws Exception { Reader reader=(Reader)Executions.createComponents("/apps/infoExtra/content/task/reader.zul", null, null); reader.initWindow(cellValue); reader.doHighlighted(); } }); } _lisListbox.appendChild(item); } } catch (RuntimeException ex) { throw ex; } catch (Error ex) { throw ex; } finally { count--; if(count==0){ cListcell.setStyle("color:red"); cListcell.setLabel(_extract.END); } Executions.deactivate(_desktop); } }//while linkCollection.getUnVisitedUrl().deleteAll(); linkCollection.getVisitedUrl().clear(); System.out.println("采集结束!"); } public void setDone(){ _ceased = true; } public void initData(LinkCollection linkCollection,String encond,WkTExtractask extractask,List<WkTPickreg> pList,List<WkTGuidereg> gList,Listcell cell) { this.linkCollection=linkCollection; this._encond=encond; this._extract=extractask; this._pList=pList; this._gList=gList; this.cListcell=cell; Executions.getCurrent().getDesktop().enableServerPush(true); Tabpanels tabpanels=(Tabpanels)_box.getTabpanels(); Tabpanel tabpanel=(Tabpanel) tabpanels.getFirstChild(); Listbox lbox=(Listbox)tabpanel.getFirstChild(); this._lisListbox=lbox; } }
[ "770506199@qq.com" ]
770506199@qq.com
b0e381f425d44febbaf713cc083a023a77bbf05d
7705dd182d8918aecd86e419b6bb5fca6b914ef1
/math/src/maths/Operation.java
78f0c53f50bf8430e9087b382d42ee401330e251
[]
no_license
WE-hai/java_practice
577a997d84303f41771d354ebf95ef33f8a2fb0c
02d3c02b67fcfdeb04bfd7fa14109b5ef7067eec
refs/heads/master
2022-11-27T16:54:20.795612
2020-11-29T09:14:36
2020-11-29T09:14:36
208,614,729
0
0
null
2022-11-16T08:34:02
2019-09-15T15:29:35
JavaScript
UTF-8
Java
false
false
1,747
java
package maths; import java.io.*; public abstract class Operation { protected int op1,op2,remainder,usersRemainder,n,correctAnswer,usersAnswer,maxInt=1; protected String ch; protected long minRange,maxRange; public Operation(String ch,int n) { super(); this.ch = ch; this.n = n; } public abstract void operation(); public abstract void isNumRight(); public abstract void setRange(); protected void getRanNum() { op1 = (int)(Math.random()*Math.pow(10,n)); op2 = (int)(Math.random()*Math.pow(10,n)); } public void setUsersAnswer(int usersAnswer,int usersRemainder) { this.usersAnswer = usersAnswer; this.usersRemainder = usersRemainder; } public void setUsersAnswer(int usersAnswer) { setUsersAnswer(usersAnswer,0); } public String isCorrect() { if(usersAnswer == correctAnswer) return "回答正确"; else return "回答错误"; } public String printQuestion() { getRanNum(); isNumRight(); return op1+" "+ch+" "+op2+" = "; } public String ptintQA() { operation(); return "答案:"+op1+" "+ch+" "+op2+" = "+correctAnswer; } public void writeToFile(File aFile) { try { PrintWriter out = new PrintWriter(new FileWriter(aFile,true)); out.println("题目:"+op1+" "+ch+" "+op2); out.println("你的答案:"+usersAnswer + " "+ "正确答案:"+correctAnswer); out.close(); }catch(FileNotFoundException e){ System.err.println("File not found!" ); }catch(IOException e2){ e2.printStackTrace(); } } }
[ "943239470@qq.com" ]
943239470@qq.com
60e7ac09a409e54a3f0dade3270328b8afc93f66
8dbf821417cbc74ad75be2328255b147abd42c5e
/org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/App.java
ec4107ed0a9bf05f35f0dabef66d09944fdea325
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jerryshano/vars-annotation
9d2f34b7f8c7d08a2e621938ea469869e199cddb
ea3ca39073c3f97817a3fc18a8b54c6f2f7bbeef
refs/heads/master
2023-03-16T15:19:14.904988
2021-02-27T00:03:49
2021-02-27T00:03:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,069
java
package org.mbari.vars.ui; import com.google.common.collect.Lists; import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Label; import javafx.stage.Stage; import org.mbari.vars.ui.commands.CommandManager; import org.mbari.vars.core.util.ActiveAppBeacon; import org.mbari.vars.core.util.ActiveAppPinger; import org.mbari.vars.ui.util.JFXUtilities; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collection; import java.util.List; import java.util.logging.LogManager; /** * This is the main entry point for the vars-annotation application * */ public class App extends Application { private UIToolBox toolBox; private static final Collection<Integer> BEACON_PORTS = Lists.newArrayList(4002, 4121, 5097, 6238, 6609, 7407, 8169, 9069, 9669, 16569); private static final String BEACON_MESSAGE = "VARS Annotation (M3)"; private static ActiveAppBeacon activeAppBeacon; private static Logger log; private AppController appController; private CommandManager commandManager; private static final String WIDTH_KEY = "stage-width"; private static final String HEIGHT_KEY = "stage-height"; public static void main(String[] args) throws Exception { System.getProperties().setProperty("user.timezone", "UTC"); setupLogging(); log = LoggerFactory.getLogger(App.class); //Log uncaught Exceptions Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> { log.error("Exception in thread [" + thread.getName() + "]", ex); }); launch(args); } @Override public void init() throws Exception { super.init(); toolBox = Initializer.getToolBox(); appController = new AppController(toolBox); commandManager = new CommandManager(); } @Override public void start(final Stage primaryStage) throws Exception { if (ActiveAppPinger.pingAll(BEACON_PORTS, BEACON_MESSAGE)) { // Must show stage before showing alert primaryStage.setScene(new Scene(new Label("VARS ..."))); primaryStage.show(); Alert alert = new Alert(Alert.AlertType.WARNING); alert.initOwner(primaryStage); // TODO alert params should be in i18n prop file alert.setTitle("VARS Information"); alert.setHeaderText("VARS is already running"); alert.setContentText("An instance of VARS is already running. Exiting ..."); alert.getDialogPane().getStylesheets().addAll(toolBox.getStylesheets()); alert.showAndWait(); Platform.exit(); System.exit(0); } else if (Initializer.getSettingsDirectory() == null) { // Must show stage before showing alert primaryStage.setScene(new Scene(new Label("VARS ..."))); primaryStage.show(); Alert alert = new Alert(Alert.AlertType.ERROR); alert.initOwner(primaryStage); // TODO alert params should be in i18n prop file alert.setTitle("VARS Error"); alert.setHeaderText("Unable to create a settings directory "); alert.setContentText("VARS failed to create a directory for writing temporary information."); alert.getDialogPane().getStylesheets().addAll(toolBox.getStylesheets()); alert.showAndWait(); Platform.exit(); System.exit(-1); } else { activeAppBeacon = new ActiveAppBeacon(BEACON_PORTS, BEACON_MESSAGE); } primaryStage.setScene(appController.getScene()); toolBox.primaryStageProperty().set(primaryStage); final Class clazz = getClass(); // Load size from local prefs JFXUtilities.loadStageSize(primaryStage, clazz); primaryStage.setOnCloseRequest(e -> { // Save size on exit JFXUtilities.saveStageSize(primaryStage, clazz); Platform.exit(); System.exit(0); }); primaryStage.show(); } private static void setupLogging() { // COnfigure JDK logging try (InputStream is = App.class.getResourceAsStream("/logging.properties")) { LogManager.getLogManager().readConfiguration(is); } catch (Exception e){ System.err.println("Failed to initialize logging: " + e.getClass() + " -> " + e.getLocalizedMessage()); } // Create directory to write logs to var varsDir = Initializer.getSettingsDirectory(); var varsLogDir = Paths.get(varsDir.normalize().toString(), "logs"); var createdDir = Initializer.createDirectory(varsLogDir); if (createdDir == null) { log.warn("Failed to create " + varsLogDir); } } }
[ "bschlining@gmail.com" ]
bschlining@gmail.com
d65c16b91004efe339e0e226c21c47ca398b7d9b
ea15dd949654ce96f389a1a5e316b0dea6f23aef
/spring-boot-tips/src/test/java/com/jojoldu/blogcode/springboot/tips/RequestDtoSetterControllerTest.java
fe4177ee2a960cfe10b592cf2a6bb58b4ef60a41
[]
no_license
develophil/blog-code
865f5666713f0eeeeed3cc5b0ab059b728946245
1b5d40dc3de5318226dd99c90f54561bda335e89
refs/heads/master
2022-06-01T00:40:57.936555
2020-04-26T09:14:21
2020-04-26T09:14:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,727
java
/* * This Java source file was generated by the Gradle 'init' task. */ package com.jojoldu.blogcode.springboot.tips; import com.fasterxml.jackson.databind.ObjectMapper; import com.jojoldu.blogcode.springboot.tips.setter.RequestDtoSetterController; import com.jojoldu.blogcode.springboot.tips.setter.RequestSetterDto; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import java.time.LocalDate; import java.util.Arrays; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @WebMvcTest(RequestDtoSetterController.class) public class RequestDtoSetterControllerTest { @Autowired private MockMvc mvc; @Autowired private ObjectMapper objectMapper; @Test public void RequestBody에서는_setter가_없어도된다() throws Exception { String content = objectMapper.writeValueAsString(new RequestSetterDto("jojoldu", 1000L)); mvc .perform(post("/request/setter") .content(content) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(content)); } @Test public void Get에서는_setter가_없어도된다() throws Exception { String content = objectMapper.writeValueAsString(new RequestSetterDto("jojoldu", 1000L, LocalDate.of(2019,2,22), RequestSetterDto.RequestType.GET)); MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); params.put("name", Arrays.asList("jojoldu")); params.put("amount", Arrays.asList("1000")); params.put("date", Arrays.asList("2019-02-22")); params.put("requestType", Arrays.asList("GET")); mvc .perform(get("/request/setter") .params(params) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(content)); } @Test public void initBinder는_다양한_타입도_허용한다() throws Exception{ String content = objectMapper.writeValueAsString(new RequestSetterDto("jojoldu", 1000L, LocalDate.of(2019,2,22), RequestSetterDto.RequestType.GET)); MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); params.put("name", Arrays.asList("jojoldu")); params.put("amount", Arrays.asList("1000")); params.put("date", Arrays.asList("2019-02-22")); params.put("requestType", Arrays.asList("GET")); mvc .perform(get("/request/setter") .params(params) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().json(content)); } }
[ "jojoldu@gmail.com" ]
jojoldu@gmail.com
8326f37f5be588d6678aa566f93fc266cabc4da0
11192e2b4de5af51730a29be36ab9af815c10fdd
/app/src/main/java/com/hywy/luanhzt/activity/DownloadToInstallActivity.java
b0bf6014f51dd90ffcd01970bc535749bd3abf2c
[]
no_license
Sususuperman/LuanDemo
2627f8508171c804db567d7d526c5352876e8035
51aa8ad4411479b583022a7023471a0502526265
refs/heads/master
2020-03-31T11:15:41.108795
2019-01-14T06:17:15
2019-01-14T06:17:15
152,169,495
0
0
null
null
null
null
UTF-8
Java
false
false
4,088
java
package com.hywy.luanhzt.activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Window; import com.cs.common.utils.IToast; import com.hywy.luanhzt.entity.Upgrade; import com.hywy.luanhzt.utils.UpgradeUtils; import java.io.File; public class DownloadToInstallActivity extends AppCompatActivity { private Intent mIntent; private Upgrade upgrade; public static final int INSTALL_OK = 11; @Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); //传入下载保存路径 mIntent = getIntent(); upgrade = (Upgrade)getIntent().getSerializableExtra("upgrade"); String apkPath = UpgradeUtils.getApkPath(upgrade.getUrl()); if(apkPath == null || apkPath.trim().equals("")){ IToast.toast("文件不存在!"); finish(); }else{ File downFile = new File(apkPath); if (downFile.exists()){ /* 打开文件进行安装 */ openFile(downFile); }else{ IToast.toast("文件不存在!"); finish(); } } } // 在手机上打开文件的method private void openFile(File f){ Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Intent.ACTION_VIEW); // 调用getMIMEType()来取得MimeType String type = getMIMEType(f); // 设定intent的file与MimeType intent.setDataAndType(Uri.fromFile(f), type); startActivity(intent); } // 判断文件MimeType的method private String getMIMEType(File f){ String type = ""; String fName = f.getName(); // 取得扩展名 String end = fName.substring(fName.lastIndexOf(".") + 1, fName.length()).toLowerCase(); // 按扩展名的类型决定MimeType if (end.equals("m4a") || end.equals("mp3") || end.equals("mid") || end.equals("xmf") || end.equals("ogg") || end.equals("wav")) { type = "audio"; } else if (end.equals("3gp") || end.equals("mp4")) { type = "video"; } else if (end.equals("jpg") || end.equals("gif") || end.equals("png") || end.equals("jpeg") || end.equals("bmp")) { type = "image"; } else if (end.equals("apk")) { // android.permission.INSTALL_PACKAGES type = "application/vnd.android.package-archive"; } else if(end.equals("pdf")) { type = "pdf"; }else { type = "*"; } // 如果无法直接打开,就跳出软件清单给使用者选择 if (!end.equals("apk")) { type += "/*"; } return type; } @Override protected void onRestart() { updateUpgrade(); super.onRestart(); } @Override protected void onResume() { //防止用户点击取消按钮,之后停留在该界面,显示为黑屏 if(!mIntent.hasExtra("upgrade")){ finish(); }else { mIntent.removeExtra("upgrade"); } super.onResume(); } private void updateUpgrade(){ if(upgrade != null){ if(UpgradeUtils.isInStall(upgrade, this)){ // updateFlag(); } } } /** // * 更新数据库升级状态 // */ // private void updateFlag(){ // if(upgrade != null){ // UpgradeDao dao = new UpgradeDao(this); // upgrade.setUpgrdeFlag(Upgrade.NO_Upgrde); // dao.updateFlag(upgrade); // Intent intent = new Intent(this,MainActivity.class); // intent.putExtra("upgrade", upgrade); // setResult(INSTALL_OK, intent); // } // } }
[ "chaoisgoodman@163.com" ]
chaoisgoodman@163.com
6f8e6146c9a52dd640573c47fbf9037428b2a8df
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/c/c/a/Calc_1_2_2200.java
6186a1e5d6efcc799e5345c5e87cbece2d89152b
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
131
java
package c.c.a; public class Calc_1_2_2200 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
801d3380acf845c4db3f1053aa7df7ddf6c37a1e
6c75d64557f71f20291e4191d4081c0c3e4795e8
/Proyectos/cinedayz/src/main/java/pe/joedayz/ejemplos/cinedayz/dominio/ShopCart.java
a99e774ced25ff249c02407c827c7efc2d57cd10
[]
no_license
andrepin29/faces
afbbc1780f9d4cbaaf50f736c002ce25af27d5cc
fbba871b35da47d898888ed9d1bc4c21eb796a8c
refs/heads/master
2020-03-27T18:42:37.404212
2017-06-15T17:54:47
2017-06-15T17:54:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package pe.joedayz.ejemplos.cinedayz.dominio; import java.util.Date; public class ShopCart { Integer shopFactura; Date shopFecha; String shopCliente; String shopTipoPago; Double shopSubtotal; Double shopTax; Double shopTotal; Cliente cliente; public ShopCart() { } public Integer getShopFactura() { return shopFactura; } public void setShopFactura(Integer shopFactura) { this.shopFactura = shopFactura; } public Date getShopFecha() { return shopFecha; } public void setShopFecha(Date shopFecha) { this.shopFecha = shopFecha; } public String getShopCliente() { return shopCliente; } public void setShopCliente(String shopCliente) { this.shopCliente = shopCliente; } public String getShopTipoPago() { return shopTipoPago; } public void setShopTipoPago(String shopTipoPago) { this.shopTipoPago = shopTipoPago; } public Double getShopSubtotal() { return shopSubtotal; } public void setShopSubtotal(Double shopSubtotal) { this.shopSubtotal = shopSubtotal; } public Double getShopTax() { return shopTax; } public void setShopTax(Double shopTax) { this.shopTax = shopTax; } public Double getShopTotal() { return shopTotal; } public void setShopTotal(Double shopTotal) { this.shopTotal = this.shopSubtotal+this.shopTax; } public Cliente getCliente() { return cliente; } public void setCliente(Cliente cliente) { this.cliente = cliente; } }
[ "jose.diaz@joedayz.pe" ]
jose.diaz@joedayz.pe
032a2c93032791d478ba8c5e4ac09c1fa53cda5a
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/opensearch-20171225/src/main/java/com/aliyun/opensearch20171225/models/DescribeUserAnalyzerRequest.java
5a585bb2d06368fe54d1a8d817f79f66d5a60fe1
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
678
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.opensearch20171225.models; import com.aliyun.tea.*; public class DescribeUserAnalyzerRequest extends TeaModel { /** * <p>all</p> */ @NameInMap("with") public String with; public static DescribeUserAnalyzerRequest build(java.util.Map<String, ?> map) throws Exception { DescribeUserAnalyzerRequest self = new DescribeUserAnalyzerRequest(); return TeaModel.build(map, self); } public DescribeUserAnalyzerRequest setWith(String with) { this.with = with; return this; } public String getWith() { return this.with; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
78fe4d001753444cc74bb3ace9df3d1815c1a6a6
27511a2f9b0abe76e3fcef6d70e66647dd15da96
/src/com/instagram/y/b/a.java
a53a9a250058e26f42fcd2c671df740819fd1eaa
[]
no_license
biaolv/com.instagram.android
7edde43d5a909ae2563cf104acfc6891f2a39ebe
3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de
refs/heads/master
2022-05-09T15:05:05.412227
2016-07-21T03:48:36
2016-07-21T03:48:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,204
java
package com.instagram.y.b; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import com.a.a.a.e; import com.a.a.a.i; import com.instagram.a.b.b; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class a { private static final Class<?> c = a.class; private static a d; HashMap<String, Long> a; List<String> b; a() { b(); } public static a a() { Object localObject; if (d == null) { localObject = aa.getString("seen_state", null); } try { localObject = com.instagram.common.h.a.a.a((String)localObject); ((i)localObject).a(); d = k.parseFromJson((i)localObject); return d; } catch (Exception localException) { for (;;) { d = new a(); } } } private void b() { if (a == null) { a = new HashMap(); } if (b == null) { b = new ArrayList(); } } public final long a(String paramString) { b(); if (a.containsKey(paramString)) { return ((Long)a.get(paramString)).longValue(); } return 0L; } public final void a(String paramString, long paramLong) { b(); if ((a.containsKey(paramString)) && (paramLong <= ((Long)a.get(paramString)).longValue())) { return; } if (b.size() >= 1000) { b.remove(b.size() - 1); } b.remove(paramString); b.add(0, paramString); a.put(paramString, Long.valueOf(paramLong)); try { paramString = b.a(); Object localObject = new StringWriter(); com.a.a.a.k localk = com.instagram.common.h.a.a.a((Writer)localObject); k.a(localk, this); localk.close(); localObject = ((StringWriter)localObject).toString(); a.edit().putString("seen_state", (String)localObject).apply(); return; } catch (IOException paramString) { com.facebook.e.a.a.b(c, "failed to save LocalSeenState json", paramString); } } } /* Location: * Qualified Name: com.instagram.y.b.a * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
10efb641813bb5f6c50c59712ebab1139501c836
4536078b4070fc3143086ff48f088e2bc4b4c681
/v1.0.4/decompiled/no/simula/corona/SplashActivity.java
b7edac893c7b885cb81302374a9e44d47679e334
[]
no_license
olealgoritme/smittestopp_src
485b81422752c3d1e7980fbc9301f4f0e0030d16
52080d5b7613cb9279bc6cda5b469a5c84e34f6a
refs/heads/master
2023-05-27T21:25:17.564334
2023-05-02T14:24:31
2023-05-02T14:24:31
262,846,147
0
0
null
null
null
null
UTF-8
Java
false
false
3,237
java
package no.simula.corona; import android.app.Activity; import android.app.AlertDialog.Builder; import android.app.NotificationManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; import d.b.a.h; import h.e; import j.b.a.a0; import j.b.a.e0.a; import j.b.a.y; import j.b.a.z; public final class SplashActivity extends a { public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); setContentView(2131558433); paramBundle = Build.FINGERPRINT; h.k.b.g.a(paramBundle, "Build.FINGERPRINT"); if (!h.o.g.a(paramBundle, "generic", false, 2)) { paramBundle = Build.FINGERPRINT; h.k.b.g.a(paramBundle, "Build.FINGERPRINT"); if (!h.o.g.a(paramBundle, "unknown", false, 2)) { paramBundle = Build.MODEL; h.k.b.g.a(paramBundle, "Build.MODEL"); if (!h.o.g.a(paramBundle, "google_sdk", false, 2)) { paramBundle = Build.MODEL; h.k.b.g.a(paramBundle, "Build.MODEL"); if (!h.o.g.a(paramBundle, "Emulator", false, 2)) { paramBundle = Build.MODEL; h.k.b.g.a(paramBundle, "Build.MODEL"); if ((!h.o.g.a(paramBundle, "Android SDK built for x86", false, 2)) && (!h.k.b.g.a(Build.BOARD, "QC_Reference_Phone"))) { paramBundle = Build.MANUFACTURER; h.k.b.g.a(paramBundle, "Build.MANUFACTURER"); if (!h.o.g.a(paramBundle, "Genymotion", false, 2)) { paramBundle = Build.BRAND; h.k.b.g.a(paramBundle, "Build.BRAND"); if (h.o.g.a(paramBundle, "generic", false, 2)) { paramBundle = Build.DEVICE; h.k.b.g.a(paramBundle, "Build.DEVICE"); if (h.o.g.a(paramBundle, "generic", false, 2)) {} } else if (!h.k.b.g.a("google_sdk", Build.PRODUCT)) { i = 0; break label211; } } } } } } } int i = 1; label211: if (i != 0) { paramBundle = new AlertDialog.Builder(this); paramBundle.setTitle(2131886111); paramBundle.setMessage("This app cannot run on this system"); paramBundle.setPositiveButton(2131886196, new y(this)); paramBundle.setOnDismissListener(new z(this)); paramBundle.create(); paramBundle.show(); return; } paramBundle = new SplashActivity.a(this); long l; if (a0.i(this)) { l = 2000L; } else { l = 1000L; } paramBundle.sendEmptyMessageDelayed(0, l); paramBundle = getSystemService("notification"); if (paramBundle != null) { NotificationManager localNotificationManager = (NotificationManager)paramBundle; paramBundle = CoronaApp.z; if (paramBundle != null) { y = false; } localNotificationManager.cancel(13); return; } throw new e("null cannot be cast to non-null type android.app.NotificationManager"); } } /* Location: * Qualified Name: base.no.simula.corona.SplashActivity * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "olealgoritme@gmail.com" ]
olealgoritme@gmail.com
f8f8ca219e1d56134dcfe5f6d75d7ed27ab743bc
429c9be33131f67c641f224b72b552fc8778395c
/src/_06ReflectionExercises/_02BlackBoxInteger/com/peshoslav/BlackBoxInt.java
6cf2c50a3416ab92a76715553a32694097f8661c
[]
no_license
plamen911/java-oop-advanced
afad63f5668f94870c8c853b1c3f1af226f75e65
d5e3f4cc40d4a2074e30e1cfd3fce970cb85fd6c
refs/heads/master
2020-05-26T11:54:50.161150
2017-03-31T05:56:54
2017-03-31T05:56:54
84,996,774
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package _06ReflectionExercises._02BlackBoxInteger.com.peshoslav; public class BlackBoxInt { private static final int DEFFAULT_VALUE = 0; private int innerValue; private BlackBoxInt(int innerValue) { this.innerValue = innerValue; } private BlackBoxInt() { this.innerValue = DEFFAULT_VALUE; } private void add(int addend) { this.innerValue += addend; } private void subtract(int subtrahend) { this.innerValue -= subtrahend; } private void multiply(int multiplier) { this.innerValue *= multiplier; } private void divide(int divider) { this.innerValue /= divider; } private void leftShift(int shifter) { this.innerValue <<= shifter; } private void rightShift(int shifter) { this.innerValue >>= shifter; } }
[ "1" ]
1
987c4796199b03d917ef1237a3942027c8b52d24
8b27f0d905f724cb6a18e75fc5b082c18d24b203
/app/src/main/java/com/dawoo/lotterybox/bean/BBetParamForm.java
ca277c33aa69146c4489a84c138dc9c8fa859bb6
[]
no_license
easyGuyLyn/lt_b_pai
96a03989e6075dc731e76d5f83bfbb93a8664c50
a63853d73cf1e2b3a8a0e002af08a54d632f4990
refs/heads/master
2023-04-04T11:48:20.736794
2021-04-05T04:31:32
2021-04-05T04:31:32
140,645,815
1
0
null
null
null
null
UTF-8
Java
false
false
1,605
java
package com.dawoo.lotterybox.bean; import java.util.List; /** * Created by archar on 18-3-12. * 本地数据承接 */ public class BBetParamForm { private String code; private String quantity; private String totalMoney; private String playModel="tradition"; private String expect; public String getPlayModel() { return playModel; } public void setPlayModel(String playModel) { this.playModel = playModel; } private List<BetOrdersListBean> betOrders; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getQuantity() { return quantity; } public void setQuantity(String quantity) { this.quantity = quantity; } public String getTotalMoney() { return totalMoney; } public void setTotalMoney(String totalMoney) { this.totalMoney = totalMoney; } public List<BetOrdersListBean> getBetOrders() { return betOrders; } public void setBetOrders(List<BetOrdersListBean> betOrders) { this.betOrders = betOrders; } @Override public String toString() { return "BBetParamForm{" + ", code='" + code + '\'' + ", quantity='" + quantity + '\'' + ", totalMoney='" + totalMoney + '\'' + ", betOrders=" + betOrders + '}'; } public String getExpect() { return expect; } public void setExpect(String expect) { this.expect = expect; } }
[ "archar@dawoo.com" ]
archar@dawoo.com
61ba32861ff7b73e4b2d9da6918f20fddd50e96e
9ddee94233726ffe9f4899e8c3a6c66d1c36e170
/Fvhr.platform/src/dean/ds/program/fvhr/domain/N_TRAINING_ITEM.java
f020fd92504f647f228ed56cb446b34a75d813cd
[]
no_license
tuankhoi2206/Freetrend
315e9f99d3213763d38ef2c068d47e148223b7ff
4b8124b0b0c8ea20081f8fe119f7dec0ad58bc29
refs/heads/master
2020-09-03T19:34:26.734722
2019-11-04T16:42:23
2019-11-04T16:42:23
219,545,899
0
1
null
null
null
null
UTF-8
Java
false
false
4,910
java
package ds.program.fvhr.domain; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Id; import dsc.util.hibernate.validator.NotBlank; import org.hibernate.validator.Length; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Column; import dsc.echo2app.program.Config; /** * **/ @Entity @Table(name = "N_TRAINING_ITEM") public class N_TRAINING_ITEM { private java.lang.String EMPSN; private String ID_KHOA; private String ID_MON; private java.util.Date BDATE; //NGAY BD HOC MH A CUA KHOC B CUA NV, <=NGAY BD CUA KHOA HOC private java.util.Date EDATE; //NGAY KT HOC MH A CUA KHOC B CUA NV <= NGAY KT CUA KHOA HOC private java.lang.String TRAINING_TYPE; private java.lang.String NOTE; private java.lang.String ID_TRAINING; //ID TU PHAT SINH LA SO THE CONG VOI SO LAN DUOC HUAN LUYEN private String EMPSN_HL; //CB HL MON HOC /** * @return EMPSN */ @NotBlank @Length(max = 8) @Column(name = "EMPSN") @Config(key = "N_TRAINING_ITEM.EMPSN") public java.lang.String getEMPSN() { return EMPSN; } /** * @param EMPSN */ public void setEMPSN(java.lang.String EMPSN) { this.EMPSN = EMPSN; } /** * @return ID_KHOA */ @NotBlank @Length(max = 5) @Column(name = "ID_KHOA") @Config(key = "N_TRAINING_ITEM.ID_KHOA") public String getID_KHOA() { return ID_KHOA; } /** * @param ID_KHOA */ public void setID_KHOA(String ID_KHOA) { this.ID_KHOA = ID_KHOA; } /** * @return ID_MON */ @NotBlank @Length(max = 6) @Column(name = "ID_MON") @Config(key = "N_TRAINING_ITEM.ID_MON") public String getID_MON() { return ID_MON; } /** * @param ID_MON */ public void setID_MON(String ID_MON) { this.ID_MON = ID_MON; } /** * 取得NGAY BD HOC MH A CUA KHOC B CUA NV, <=NGAY BD CUA KHOA HOC * @return BDATE NGAY BD HOC MH A CUA KHOC B CUA NV, <=NGAY BD CUA KHOA HOC */ @NotBlank @Temporal(TemporalType.DATE) @Column(name = "BDATE") @Config(key = "N_TRAINING_ITEM.BDATE") public java.util.Date getBDATE() { return BDATE; } /** * 設定NGAY BD HOC MH A CUA KHOC B CUA NV, <=NGAY BD CUA KHOA HOC * @param BDATE NGAY BD HOC MH A CUA KHOC B CUA NV, <=NGAY BD CUA KHOA HOC */ public void setBDATE(java.util.Date BDATE) { this.BDATE = BDATE; } /** * 取得NGAY KT HOC MH A CUA KHOC B CUA NV <= NGAY KT CUA KHOA HOC * @return EDATE NGAY KT HOC MH A CUA KHOC B CUA NV <= NGAY KT CUA KHOA HOC */ @NotBlank @Temporal(TemporalType.DATE) @Column(name = "EDATE") @Config(key = "N_TRAINING_ITEM.EDATE") public java.util.Date getEDATE() { return EDATE; } /** * 設定NGAY KT HOC MH A CUA KHOC B CUA NV <= NGAY KT CUA KHOA HOC * @param EDATE NGAY KT HOC MH A CUA KHOC B CUA NV <= NGAY KT CUA KHOA HOC */ public void setEDATE(java.util.Date EDATE) { this.EDATE = EDATE; } /** * @return TRAINING_TYPE */ @Length(max = 20) @Column(name = "TRAINING_TYPE") @Config(key = "N_TRAINING_ITEM.TRAINING_TYPE") public java.lang.String getTRAINING_TYPE() { return TRAINING_TYPE; } /** * @param TRAINING_TYPE */ public void setTRAINING_TYPE(java.lang.String TRAINING_TYPE) { this.TRAINING_TYPE = TRAINING_TYPE; } /** * @return NOTE */ @Length(max = 30) @Column(name = "NOTE") @Config(key = "N_TRAINING_ITEM.NOTE") public java.lang.String getNOTE() { return NOTE; } /** * @param NOTE */ public void setNOTE(java.lang.String NOTE) { this.NOTE = NOTE; } /** * 取得ID TU PHAT SINH LA SO THE CONG VOI SO LAN DUOC HUAN LUYEN * @return ID_TRAINING ID TU PHAT SINH LA SO THE CONG VOI SO LAN DUOC HUAN LUYEN */ @Id @NotBlank @Column(name = "ID_TRAINING") @Config(key = "N_TRAINING_ITEM.ID_TRAINING") public java.lang.String getID_TRAINING() { return ID_TRAINING; } /** * 設定ID TU PHAT SINH LA SO THE CONG VOI SO LAN DUOC HUAN LUYEN * @param ID_TRAINING ID TU PHAT SINH LA SO THE CONG VOI SO LAN DUOC HUAN LUYEN */ public void setID_TRAINING(java.lang.String ID_TRAINING) { this.ID_TRAINING = ID_TRAINING; } /** * 取得CB HL MON HOC * @return EMPSN_HL CB HL MON HOC */ @Length(max = 8) @Column(name = "EMPSN_HL") @Config(key = "N_TRAINING_ITEM.EMPSN_HL") public String getEMPSN_HL() { return EMPSN_HL; } /** * 設定CB HL MON HOC * @param EMPSN_HL CB HL MON HOC */ public void setEMPSN_HL(String EMPSN_HL) { this.EMPSN_HL = EMPSN_HL; } }
[ "tuankhoi2206@gmail.com" ]
tuankhoi2206@gmail.com