blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
2a5952f8b4b2003cfbb52b5d68b23772f90b5303
f2aa1abcc14f7a64e6ad5ac95b8acb1594eef70d
/secondWorldd/src/co/yedam/common/Employee.java
7181655f27e7047e87935d4cf7e42241695d8e23
[]
no_license
Hi-Judy/secondWorldd
1ed646b936dd241ac4d411aff56af9cd41f4b580
c5e0989c0ee74146a25d5306a61814c881d9b578
refs/heads/master
2023-08-15T04:00:49.196751
2021-10-11T02:17:41
2021-10-11T02:17:41
414,599,168
0
0
null
null
null
null
UTF-8
Java
false
false
839
java
package co.yedam.common; public class Employee { private int employeeId; private String lastName; private String email; private String jobId; private String hireDate; public int getEmployeeId() { return employeeId; } public void setEmployeeId(int employeeId) { this.employeeId = employeeId; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getJobId() { return jobId; } public void setJobId(String jobId) { this.jobId = jobId; } public String getHireDate() { return hireDate; } public void setHireDate(String hireDate) { this.hireDate = hireDate; } }
[ "CHOI JUHEE@DESKTOP-4URRTKC" ]
CHOI JUHEE@DESKTOP-4URRTKC
fecc9f2ebdec4f38c63bbb97644ea77959f96acb
d486569a398cb04943501b6e4328a5026c8a3bbe
/14_cuadrado_sumas/src/com/company/Main.java
7ca6b5ba5b3ad2a0da77d3f7e50bee80ffd5192d
[ "Apache-2.0" ]
permissive
mikelAretxabaleta/ud2-elementos-programa
402216648aba9fb35f965846bf379a276f2011a1
5419b5292c114c6e38c4cafdfac16afe6ebef4d6
refs/heads/master
2021-05-15T21:48:55.693172
2017-10-25T19:53:41
2017-10-25T19:53:41
106,597,248
0
0
null
2017-10-11T19:04:18
2017-10-11T19:04:12
null
UTF-8
Java
false
false
604
java
package com.company; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Introduce un número: "); int numero = Integer.parseInt(br.readLine()); int i = numero; int a = 0; int cuadrado=0; do { cuadrado += numero; a += 1; } while (a != i); System.out.println(cuadrado); } }
64695441c6282b121330e9ccdbcd0f4fcad86b96
c0aa15dfb3630355de579a2ae441c00a78712046
/src/test/java/tkv/LocalImplTest.java
a153083b13540f8c8c489dc9a1fae6333de1bbe5
[]
no_license
hangchow/tkv
ea39e7966516ee043012282e839dd61a8ecf48c6
53c7975b586b4d79850b23c68b1bf73f4f1a784f
refs/heads/master
2022-03-11T19:41:13.892969
2019-05-01T04:23:38
2019-05-01T04:23:38
3,495,081
2
0
null
null
null
null
UTF-8
Java
false
false
3,469
java
/** * */ package tkv; import java.io.File; import java.io.IOException; import junit.framework.Assert; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import tkv.LocalImpl; import tkv.Record; /** * @author sean.wang * @since Nov 17, 2011 */ public class LocalImplTest { LocalImpl tkv; File dbFile; /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { } /** * @throws java.lang.Exception */ @AfterClass public static void tearDownAfterClass() throws Exception { } /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { dbFile = new File("/tmp/tkvtest.db"); dbFile.delete(); tkv = new LocalImpl(dbFile); } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { tkv.close(); tkv.delete(); } /** * Test method for {@link tkv.LocalImpl#get(java.lang.String)}. * * @throws IOException */ @Test public void testPut() throws IOException { String key = "01234567"; String value = "ayellowdog"; String[] tags = new String[] { "dog", "pet" }; tkv.put(key, value.getBytes(), tags); Assert.assertEquals(4 + 4 + 4 + key.length() + value.length(), +7 + 1, dbFile.length()); // assert tkv Assert.assertEquals(value, new String(tkv.get(key))); } @Test public void testGetTagRecord() throws IOException { String key = "01234567"; String value = "ayellowdog"; String[] tags = new String[] { "dog", "pet" }; tkv.put(key, value.getBytes(), tags); String key2 = "01"; String value2 = "baby"; String[] tags2 = new String[] { "bird", "pet" }; tkv.put(key2, value2.getBytes(), tags2); String key3 = "0145jy"; String value3 = "brown"; String[] tags3 = new String[] { "pet" }; tkv.put(key3, value3.getBytes(), tags3); Record r = tkv.getRecord(key2, "pet"); Record rNext = tkv.getRecord(r.nextKey(), "pet"); Assert.assertEquals(key3, rNext.getKey()); Assert.assertEquals(value3, new String(rNext.getValue())); Record rPrevious = tkv.getRecord(r.priviousKey(), "pet"); Assert.assertEquals(key, rPrevious.getKey()); Assert.assertEquals(value, new String(rPrevious.getValue())); } /** * Test method for {@link tkv.LocalImpl#get(java.lang.String)}. * * @throws IOException */ @Test public void testDeserial() throws IOException { // String key = "01234567"; // String value = "0123456789"; // String key2 = "01234568"; // String value2 = "0123456780"; // fkv.put(key, value); // fkv.put(key2, value2); // fkv.delete(key2); // fkv.close(); // Assert.assertEquals(size * (keyLength + valueLength + 2), dbFile.length()); // // deserial // fkv = new TkvImpl(dbFile, 10000, 8, 10); // Assert.assertEquals(1, fkv.size()); // Assert.assertEquals(1, fkv.getDeletedSize()); // Assert.assertEquals(fkv.getRecordLength() * 2, fkv.getEndIndex()); // Assert.assertEquals(null, fkv.get(key2)); // key2 is deleted // Assert.assertEquals(value, fkv.get(key)); // Assert.assertEquals(0, fkv.getRecord(key).getIndex()); // Assert.assertEquals(value, fkv.getRecord(key).getStringValue()); // fkv.put(key, value2); // Assert.assertEquals(value2, fkv.get(key)); // fkv.put(key2, value2); // Assert.assertEquals(value2, fkv.get(key2)); // Assert.assertEquals(2, fkv.size()); // Assert.assertEquals(0, fkv.getDeletedSize()); } }
5b2bb9f9e9887f96ad78d64148084fe45f043a61
536c6ae32642863b5d8e695d963ee52bcabe1942
/AndroidShaders/src/shaders/ReflectionShader.java
ced8597d31d8e945070b6c8ab9f817bfa5c2ba37
[]
no_license
campeloal/monografia_opengles
532ef14f8ba892cdb2802d6ad6b55975d402ec85
b7ecf4ec959854d16fb5bd0cd3530373f0e761dc
refs/heads/master
2020-05-18T09:19:04.504959
2014-04-29T04:29:00
2014-04-29T04:29:00
16,750,957
1
0
null
null
null
null
UTF-8
Java
false
false
2,485
java
package shaders; import graphics.shaders.R; import java.nio.FloatBuffer; import java.util.Hashtable; import android.annotation.TargetApi; import android.opengl.GLES20; import android.os.Build; @TargetApi(Build.VERSION_CODES.FROYO) public class ReflectionShader extends Shader{ private static final int FLOAT_SIZE_BYTES = 4; private static final int TRIANGLE_VERTICES_DATA_NOR_OFFSET = 3; private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 8 * FLOAT_SIZE_BYTES; private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0; private int sTextureAddr; private int aNormalAddr; private int mMVMatrixAddr; private int normalMatrixAddr; private int uMVPMatrix; private int aPositionAddr; public ReflectionShader() { super.vID = R.raw.reflection_vs; super.fID = R.raw.reflection_ps; } public void initShaderParams(@SuppressWarnings("rawtypes") Hashtable params) { GLES20.glUniformMatrix4fv(uMVPMatrix, 1, false, (float[]) params.get("mMVPMatrix"), 0); ((FloatBuffer) params.get("vertex buffer")).position(TRIANGLE_VERTICES_DATA_NOR_OFFSET); GLES20.glVertexAttribPointer(aNormalAddr, 3, GLES20.GL_FLOAT, false, TRIANGLE_VERTICES_DATA_STRIDE_BYTES, ((FloatBuffer) params.get("vertex buffer"))); GLES20.glEnableVertexAttribArray(aNormalAddr); GLES20.glActiveTexture ( GLES20.GL_TEXTURE0 ); GLES20.glBindTexture ( GLES20.GL_TEXTURE_CUBE_MAP, (Integer) params.get("reflectText") ); // send to the shader GLES20.glUniform1i(sTextureAddr, 0); GLES20.glUniformMatrix4fv(mMVMatrixAddr, 1, false, (float[]) params.get("mMVMatrix"), 0); GLES20.glUniformMatrix4fv(normalMatrixAddr, 1, false, (float[]) params.get("normalMatrix"), 0); // the vertex coordinates ((FloatBuffer) params.get("vertex buffer")).position(TRIANGLE_VERTICES_DATA_POS_OFFSET); GLES20.glVertexAttribPointer(aPositionAddr, 3, GLES20.GL_FLOAT, false, TRIANGLE_VERTICES_DATA_STRIDE_BYTES, ((FloatBuffer) params.get("vertex buffer"))); GLES20.glEnableVertexAttribArray(aPositionAddr); } public void getParamsLocations() { aNormalAddr = GLES20.glGetAttribLocation(_program, "aNormal"); sTextureAddr = GLES20.glGetUniformLocation(_program, "s_texture"); mMVMatrixAddr = GLES20.glGetUniformLocation(_program, "MVMatrix"); normalMatrixAddr = GLES20.glGetUniformLocation(_program, "NMatrix"); uMVPMatrix = GLES20.glGetUniformLocation(_program, "uMVPMatrix"); aPositionAddr = GLES20.glGetAttribLocation(_program, "aPosition"); } }
d3995573dc1119b66f1d23816de189f7aab58ca9
2859a107aff432ac3bbc2a6119656c68436bd50e
/src/main/java/logging/SLF4JExample.java
9a9aa79ee5e13ed51d655f499f4669a55c8ddaba
[]
no_license
john9yang/sample9
e32dcbc2fd8faa09df4076d30ce80e2892c10d19
1f6a65cc3f6cd9b001c27ccf597070d940bc9242
refs/heads/master
2022-07-30T22:55:07.198196
2022-03-24T14:21:33
2022-03-24T14:21:33
184,183,893
0
0
null
2022-06-10T20:03:43
2019-04-30T03:19:53
Java
UTF-8
Java
false
false
508
java
package logging; import ClassLoaderTest.AgentPath; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SLF4JExample { public static void main(String[] args) { //Creating the Logger object Logger logger = LoggerFactory.getLogger(AgentPath.class); //Logging the information logger.info("Hi This is my first SLF4J program"); //package name Logger logger1 = LoggerFactory.getLogger("logging"); logger1.warn("logging log"); } }
6e0c782da8d0a0ceb90515bb64201ec51323eacd
a81aeede6defee6ad99f10ca9d2d25a8cf36bd83
/storm/src/main/java/examples/WordCount.java
14e57410caaa6bc5bd9a40ed42dec6798fc1cdb7
[]
no_license
Branor/streaming-examples
8298d7697db8d029ec158811b91bc7d02c169a07
9d5f8eb022bb5abd483f5236c34ef91bbdc76fd9
refs/heads/master
2021-05-02T12:35:52.390077
2018-03-09T02:50:57
2018-03-09T02:50:57
55,896,363
0
0
null
null
null
null
UTF-8
Java
false
false
946
java
package examples; import backtype.storm.topology.BasicOutputCollector; import backtype.storm.topology.OutputFieldsDeclarer; import backtype.storm.topology.base.BaseBasicBolt; import backtype.storm.tuple.Fields; import backtype.storm.tuple.Tuple; import backtype.storm.tuple.Values; import java.util.HashMap; import java.util.Map; /** * Created by davido on 4/10/16. */ public class WordCount extends BaseBasicBolt { Map<String, Integer> counts = new HashMap<>(); @Override public void execute(Tuple tuple, BasicOutputCollector collector) { String word = tuple.getString(0); Integer count = counts.get(word); if (count == null) count = 0; count++; counts.put(word, count); collector.emit(new Values(word, count)); } @Override public void declareOutputFields(OutputFieldsDeclarer declarer) { declarer.declare(new Fields("word", "count")); } }
2e9da5d1e0958349f690dc20623f2c4851e46607
1a9c346b7cfec6dfc7d7941645635159d9d2ef9e
/src/main/java/zup/com/br/casadocodigotreino/Pais/PaisForm.java
458a930f13e6b50c0bb07a6368318c26602966f8
[ "Apache-2.0" ]
permissive
MatheusHudson/orange-talents-03-template-casa-do-codigo
38729c3c3f2f25a18b01037756b8481a2d7838b3
35b277f889a0da38bffa89d2dff29cc8b0f8b800
refs/heads/main
2023-03-22T15:58:56.973163
2021-03-19T14:27:02
2021-03-19T14:27:02
348,114,600
0
0
Apache-2.0
2021-03-15T20:33:47
2021-03-15T20:33:46
null
UTF-8
Java
false
false
404
java
package zup.com.br.casadocodigotreino.Pais; import javax.validation.constraints.NotEmpty; import zup.com.br.casadocodigotreino.Validation.UniqueValue; public class PaisForm { @NotEmpty @UniqueValue(domainClass = Pais.class, fieldName = "nome") private String nome; public String getNome() { return nome; } public Pais toModel(PaisForm form) { return new Pais(nome); } }
b640473a8d78ce7e400a3f8d3e210aaaee98b267
eac0b43bd7bf55f9c59c6867cc52706f5a8b9c1c
/FQ/src/main/java/learn/servlet3/整合spring/HelloService.java
e65681198d1352240ce944bd7782062a1d027d1d
[]
no_license
fengqing90/Learn
b017fa9d40cb0592ee63f77f620a8a8f39f046b9
396f48eddb5b78a4fdb880d46ea1f2b109b707e4
refs/heads/master
2022-11-22T01:44:05.803929
2021-08-04T03:57:26
2021-08-04T03:57:26
144,801,377
0
3
null
2022-11-16T06:59:58
2018-08-15T03:29:15
Java
UTF-8
Java
false
false
271
java
package learn.servlet3.整合spring; import org.springframework.stereotype.Service; /** * TODO * * @author fengqing * @date 2021/6/21 16:18 */ @Service public class HelloService { public String sayHello(String name) { return "Hello, " + name; } }
d50be07e685eca7da2863fb9229ca5482807ed55
3ed132ef4aced4ae95eb03096b51d6651da89926
/第七题《斐波那契数列》/代码/problem07/Solution.java
45f507b6bba21562e8d091c916c1cdb70e78a12e
[]
no_license
JackidSAMA/NOWCODER.com-Offer-JAVA_Solution
8e64bb4a1624954790f6979b86a80202db57ed79
95b481acc52eb76ef13af6a61b4169bf5e585cb2
refs/heads/master
2020-04-25T14:01:13.864230
2019-06-22T16:56:37
2019-06-22T16:56:37
172,826,928
1
0
null
null
null
null
GB18030
Java
false
false
665
java
package problem07; /** * @author Jackid * JDK-version:1.8 * Problem:牛客网-剑指offer《斐波那契数列》 * Result:已通过了所有的测试用例 */ /*题目描述: 大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0)。 n<=39*/ // 迭代问题 public class Solution { public int Fibonacci(int n) { int array[] = { 0, 1 }; if (n < 2) { return array[n]; } int temporary = 0; for (int i = 2; i <= n; i++) {// 循环用于计次数 temporary = array[0] + array[1]; array[0] = array[1]; array[1] = temporary; } return temporary; } }
27f3c4e642197f4f59a63e98805f8d417c951f59
a60e6d4f2a9834e3f7c510cef5e54698d5446570
/ParticleEffect.java
6fa329e2346cf31ae001556ae8043ddf05a713ad
[]
no_license
ColinGJohnson/desert-escape-game
13d470b3afadb80c1ca823aa2a8134dafefe987f
ac7f29dd1fac0c80bf11c29ad4f7683b0e2954a3
refs/heads/master
2023-02-01T21:04:47.479494
2023-01-16T05:46:44
2023-01-16T05:46:44
92,526,743
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
import java.awt.Color; import java.awt.Graphics2D; import java.util.ArrayList; public class ParticleEffect { int x; int y; int dx; int dy; double variation; Color effectColor; int life; int numParticles; String type; private ArrayList<Particle> effectParticles = new ArrayList<Particle>(); public ParticleEffect(int x, int y, int dx, int dy, Color effectColor, int life, int numParticles, String type, int size) { this.x = x; this.y = y; this.effectColor = effectColor; this.numParticles = numParticles; this.type = type; this.dy = dy; this.dx = dx; this.life = life; // create new particles for (int i = 0; i < numParticles; i++) { effectParticles.add(new Particle(x, y, dx, dy, size, life, effectColor, 0)); } } // ParticleEffect public void update() { for (int i = 0; i < effectParticles.size(); i++) { effectParticles.get(i).update(); } } // update public void draw(Graphics2D g) { for (int i = 0; i < effectParticles.size(); i++) { effectParticles.get(i).draw(g); } } // draw } // ParticleEffects
ba2ea9beb3f06e03e098c26f477bf58fc651a8aa
4ac299386a32d535aadb8fa0386e7cb778247070
/lombard/src/main/java/com/example/optics/security/SecurityUser.java
c01782dee36461f36b9e58fd6d36ab332a3bac55
[]
no_license
OneForces/courseWork
83c949f23f49599787611c66d678c05422520db2
0d3026ba9f1a95406b806354c2687dfd4a51deb9
refs/heads/master
2023-04-30T17:17:55.314410
2021-04-28T14:40:11
2021-04-28T14:40:11
351,168,692
1
0
null
null
null
null
UTF-8
Java
false
false
1,559
java
package com.example.optics.security; import com.example.optics.models.Users; import lombok.AllArgsConstructor; import lombok.Data; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; import java.util.List; @Data @AllArgsConstructor public class SecurityUser implements UserDetails { private final String userName; private final String password; private final List<SimpleGrantedAuthority> authorities; @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities; } @Override public String getPassword() { return password; } @Override public String getUsername() { return userName; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } public static UserDetails fromUser(Users users) { return new org.springframework.security.core.userdetails.User( users.getEmail(), users.getPassword(), true, true, true, true, users.getRole().getAuthorities() ); } }
e9b712100375d7f2756fa9b28cb9f48af8058761
db480d44a13236b943a40aa291a84e096afb59e6
/java101/src/donguler/TekSayiToplami.java
91467299a671c6dc68314b94120c704dcd05b696
[]
no_license
betul-sahin/patika-java-backend-web-development
5294c8992b032c5cec040ff6158e73c231b03c1b
8b51a7be3a7cca96922f358f69feb6a806bdb873
refs/heads/main
2023-07-17T14:47:15.480919
2021-09-08T16:54:41
2021-09-08T16:54:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package donguler; import java.util.Scanner; public class TekSayiToplami { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int sayi; int sum = 0; do{ System.out.print("Sayi giriniz : "); sayi = scanner.nextInt(); if(sayi % 4 == 0){ sum += sayi; } }while(sayi % 2 == 0 ); System.out.println("Toplami : " + sum); } }
3b16e23ed26c7abcadd944a53fc3667b268ce070
96aaca3a14f63192c85ac5b1b8d7554660c10e77
/java-basic/src/main/java/bitcamp/java100/ch20/ex1/Test4.java
f8bc7626610867aede27b79b9aacb304d18df1f1
[]
no_license
sehyun94/bitcamp
6b46c51df9f15dc4c45d49f3f380d3af4537ec6d
f408cc8113a8b191c5c28f6b1481b31e03d23258
refs/heads/master
2018-12-25T17:01:02.866040
2018-10-19T01:30:42
2018-10-19T01:30:42
104,423,407
1
0
null
null
null
null
UTF-8
Java
false
false
1,672
java
package bitcamp.java100.ch20.ex1; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class Test4 { @Bean("str1") // 스프링 Ioc 컨테이너가 호출해야 할 메ㅓ드 표시! // 이 메서드의 리턴 값은 컨테이너에 표시 String getString1() { return new String(); } @Bean("str2") String getString2() { return new String("Hello!"); } public static void main(String[] args) { //1) 클래스의 애노테이션을 정보를 참고하여 빈을 관리하는 컨테이너 준비 // => 빈의 정보는 XML 파일에 없다. // => 생성자에 지젛안 클래스에 에노테이션이로 존재한다. AnnotationConfigApplicationContext appCtx = new AnnotationConfigApplicationContext(Test4.class); // 2) bean container에 보관된 객체 조회하기 System.out.printf("빈 개수 = %d\n", appCtx.getBeanDefinitionCount()); String[] names = appCtx.getBeanDefinitionNames(); for (String name : names) { System.out.printf("%s\n -----> %s\n", name, appCtx.getBean(name).getClass().getName() ); } System.out.println("-------------------------------"); //3) 빈 값 꺼내서 출력하기 String s1 = (String) appCtx.getBean("str1"); String s2 = (String) appCtx.getBean("str2"); System.out.println(s1); System.out.println(s2); } }
ee2b793618ec3027cf451824601bdc3fd50bc7ee
ec329a30c7f58ffdc89795329b2a4e4372c170e9
/src/main/java/com/usecase/service/BookAmazonS3ClientService.java
a363e0bd6395e6475d5371dc24c71ca30cb790ee
[]
no_license
kbsaxena/book-service
1ba269836715ea378113376a8e6093101ccaec26
9c124b04d232c89f5976410ab05ad46810bc9d8b
refs/heads/master
2023-02-17T17:44:19.228488
2021-01-07T12:58:31
2021-01-07T12:58:31
321,993,327
0
0
null
null
null
null
UTF-8
Java
false
false
3,355
java
package com.usecase.service; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.PutObjectRequest; import com.amazonaws.services.s3.model.S3Object; import com.google.common.io.Files; import com.usecase.entity.Book; import com.usecase.AmazonS3Config; @Service public class BookAmazonS3ClientService { private Logger logger = LoggerFactory.getLogger(BookAmazonS3ClientService.class); @Autowired private AmazonS3 s3Client; @Autowired private AmazonS3Config amazons3Config; @SuppressWarnings("unchecked") public List<Book> readBooksFromS3() { List<Book> books = new ArrayList<>(); try { if (s3Client.doesObjectExist(amazons3Config.getAWSS3AudioBucket(), "books.txt")) { S3Object s3object = s3Client.getObject(amazons3Config.getAWSS3AudioBucket(), "books.txt"); ObjectInputStream inputStream = new ObjectInputStream(s3object.getObjectContent()); books = (List<Book>) inputStream.readObject(); inputStream.close(); } } catch(IOException | ClassNotFoundException e) { logger.error("Error While reading books from s3 to local"); } return books; } public void saveBookRecordsToS3(List<Book> books) { File booksFile = new File(getFullFilePath("books.txt")); try (FileOutputStream fileOutputStream = new FileOutputStream(booksFile); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) { Files.touch(booksFile); objectOutputStream.writeObject(books); uploadFile("books.txt", booksFile); } catch (IOException e) { logger.error("Error While writing books list to s3"); } } public synchronized long getID() { long id = 1; File idFile = new File(getFullFilePath("last-book-id.txt")); try (FileOutputStream outputStream = new FileOutputStream(idFile)) { Files.touch(idFile); if (s3Client.doesObjectExist(amazons3Config.getAWSS3AudioBucket(), "last-book-id.txt")) { S3Object s3object = s3Client.getObject(amazons3Config.getAWSS3AudioBucket(), "last-book-id.txt"); String idString = IOUtils.toString(s3object.getObjectContent(), StandardCharsets.UTF_8); id = Long.parseLong(idString) + 1; } outputStream.write(String.valueOf(id).getBytes()); uploadFile("last-book-id.txt", idFile); } catch (IOException e) { logger.error("Error Occurred while reading/writing the id file"); } return id; } private void uploadFile(String fileName, File file) { PutObjectRequest putObjectRequest = new PutObjectRequest(amazons3Config.getAWSS3AudioBucket(), fileName, file); s3Client.putObject(putObjectRequest); } private String getFullFilePath(String fileName) { StringBuilder builder = new StringBuilder(); builder.append(amazons3Config.getLocalFolderPath()); builder.append("/"); builder.append(fileName); return builder.toString(); } }
e43ec37831e681aac10b6f3e721d80b5400fdfc7
65e6c8d79f89eab2b0be41b18f998b1aaab33959
/zz91/ast1949-persist/src/main/java/com/ast/ast1949/persist/company/CrmCompanySvrDao.java
5f64c9580426a46855b9490e747ebcfeddd64e2c
[]
no_license
cash2one/91
14eeb47d22c7e561d2a718489cbc99409d6abd07
525b49860cd5e92ef012b474df6c9dc4f8256756
refs/heads/master
2021-01-19T11:20:46.930263
2016-06-28T02:36:26
2016-06-28T02:37:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,088
java
package com.ast.ast1949.persist.company; import java.util.Date; import java.util.List; import com.ast.ast1949.domain.company.CrmCompanySvr; import com.ast.ast1949.dto.PageDto; import com.ast.ast1949.dto.analysis.AnalysisCsRenewalDto; import com.ast.ast1949.dto.company.CrmCompanySvrDto; public interface CrmCompanySvrDao { public Integer insertCompanySvr(CrmCompanySvr companySvr); /** * 查找结果包含服务开通历史和服务名称 */ public List<CrmCompanySvrDto> queryCompanySvr(Integer companyId, Date expiredDate); /** * 查找某个服务的所有申请公司 * 返回的信息包含公司基本信息 * * */ public List<CrmCompanySvrDto> queryApplyCompany(String svrCode, String applyStatus,Integer companyId, PageDto<CrmCompanySvrDto> page); public Integer queryApplyCompanyCount(String svrCode, String applyStatus,Integer companyId); /** * 根据开通服务组查找待开通的所有客户信息 * 返回值包含服务名称 */ public List<CrmCompanySvrDto> queryApplyByGroup(String applyGroup); /** * 查找某公司某服务的历史开通情况 */ public List<CrmCompanySvr> querySvrHistory(Integer companyId, String svrCode); /** * */ public Integer updateSvrStatusByGroup(String applyGroup, String status); /** * 更新基本的服务申请信息 * 允许更新的字段:gmt_pre_start,gmt_pre_end,gmt_signed,gmt_start,gmt_end,category,remark * @param svr * @return */ public Integer updateBaseSvr(CrmCompanySvr svr); public CrmCompanySvr queryCompanySvrById(Integer id); public Integer countSvrYears(Integer companyId, String svrCode); public Integer countApplyByGroup(String applyGroup, String applyStatus); public List<CrmCompanySvr> queryRecentSvr(Integer companyId, String svrCode, Date expiredDate); public CrmCompanySvr queryRecentHistory(String svrCode, Integer companyId, Integer companySvrId); public Integer updateSvrStatusById(Integer svrId, String status); public Integer sumYear(Integer companyId, String svrCode); public Integer period(Integer companyId, String svrCode); @Deprecated public List<AnalysisCsRenewalDto> monthExpiredCount(Date start, Date end); /** * 根据服务code 统计过期服务的客户数量 * @param start * @param end * @param code * @return */ public List<AnalysisCsRenewalDto> monthExpiredCountBySvrCode(Date start, Date end,String code); /** * 检索最新再生通服务开通 company_id * @param size * @return */ public List<Integer> queryLatestOpen(Integer size); /** * 查找公司未过期的服务 * @param companyId * @return */ public List<CrmCompanySvr> querySvrByCompanyId(Integer companyId); /** * 查找公司未过期服务的服务结束时间 * @param companyId * @return */ public List<Date> queryGmtendByCompanyId(Integer companyId); /** * 查找公司是否开通过会员服务zhengrp * @param companyId * @param svrCode * @return */ public Integer history(Integer companyId, String svrCode); }
42d17ac0b15d6b6b9b4fe29cc33d9bf7f9beef99
417f99b8d41d23e957063552eb6496ea3b4a2561
/src/BinaryTree/UniqueBST/N96.java
9519a3dd432f4e6928c7e556eca761e91223a501
[]
no_license
goushikun6021003/Leetcode
b000ecbf85bfaa1937d238e0c6659e5cc90ab78d
4a4c0b604f5b60d6c76c67bfbb207a4056bea4a4
refs/heads/master
2023-02-18T02:31:38.251684
2021-01-17T09:13:15
2021-01-17T09:13:15
291,492,098
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package BinaryTree.UniqueBST; public class N96 { public int numTrees(int n) { int[] res = new int[n+1]; res[0]=res[1]=1; for(int i=2;i<res.length;i++){ for(int j=0,k=i-1;j<i;j++,k--){ res[i]+=res[j]*res[k]; } } return res[n]; } }
c1ed0398a11a648eab995c0de49dd66029ee5962
ee5a7ab750bb2670bd6a1501ec3dc113cad854bb
/Calculadora Uno/SumaWS/src/main/java/beans/ServicioSumarImp.java
96508201fcb0e83e2dda550f7a0ddcd184ca945e
[]
no_license
mateocgomez/JAX-WS-CALCULATOR
b353e39a07ff8d5dd8ec2a6d1b76f8b44e98d549
8e7d61c3e3c006c7f28a4604b14cff7fa3e6d6ae
refs/heads/master
2020-03-17T04:28:19.644885
2018-05-13T21:45:55
2018-05-13T21:45:55
133,276,725
0
0
null
null
null
null
UTF-8
Java
false
false
723
java
package beans; import javax.ejb.Stateless; import javax.jws.WebService; @Stateless @WebService(endpointInterface = "beans.ServicioSumarWS") public class ServicioSumarImp implements ServicioSumarWS { @Override public int sumar(int a, int b) { return a + b; } @Override public int restar(int a, int b){ return a - b; } @Override public int multiplicar(int a, int b){ return a * b; } @Override public int dividir(int a, int b){ return a / b; } @Override public int porcentaje(int a, int b){ return (a + b)*100; } @Override public int promedio(int a, int b){ return (a+b)/2; } }
14d831281e275ed45cc51220001b2514b348f816
9db6b3eb83fc896c05a65dc9bef3880ceeda2e4b
/week-03/day-2/src/Logs.java
68d2feeedfbfb99033b81beb36b86e430e199544
[]
no_license
green-fox-academy/torokattila
4542e5fdfc8f654dd54a18ee5148a4dd49dfd36c
a25558ee1995bcac25fce3d4bc40910d3e21437e
refs/heads/master
2020-06-11T09:40:35.871397
2019-09-08T09:07:36
2019-09-08T09:07:36
193,919,772
1
0
null
null
null
null
UTF-8
Java
false
false
839
java
import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; public class Logs { public static void main(String[] args) { List<String> lines = new ArrayList<>(); try { Path filePath = Paths.get("C:/Users/atti_/Desktop/log.txt"); lines = Files.readAllLines(filePath); } catch (Exception ex) { } System.out.println(Arrays.toString(getIpAddress(lines))); } public static String[] getIpAddress(List<String> file) { HashSet<String> unique = new HashSet<>(); for(int i = 0; i < file.size(); i++) { String[] split = file.get(i).split(" "); unique.add(split[1]); } String[] strArray = unique.toArray(new String[unique.size()]); return strArray; } }
75a09804d6152cf53afab8d95e07998a594f0538
6ded5dc2f5b597a549e31d96b672e0989fe44f32
/src/test/java/projectApp/steps/REBNYListingsSteps.java
433348e7a788ae13cf1b4d90464d2e74a8508ce1
[]
no_license
antonzenkevich/travisAndroid
efb4f148a02f7069ca1c5a8bc683babeefd3077e
8c9a70681aa84f21f9e3a85898474acd8be4cff4
refs/heads/master
2022-06-16T09:38:34.927431
2019-06-11T13:36:41
2019-06-11T13:36:41
177,132,119
0
0
null
null
null
null
UTF-8
Java
false
false
641
java
package projectApp.steps; import net.thucydides.core.annotations.Step; import net.thucydides.core.steps.ScenarioSteps; import projectApp.pages.AnalyticsPage; import projectApp.pages.REBNYListingsPage; public class REBNYListingsSteps extends ScenarioSteps { REBNYListingsPage rebnyListingsPage; AnalyticsPage analyticsPage; @Step public void addREBNYListingsAskingPriceChart() { rebnyListingsPage.addREBNYListingsAskingPriceChart(); } @Step public void addChartFromREBNYSection() { analyticsPage.rebnyListingsButtonClick(); rebnyListingsPage.addREBNYListingsAskingPriceChart(); } }
f58ccd9d7dd2ad17ef168019104c2ceaa3cbd2a9
ce17d70ee3ec73ce41df451b1e71095ce984617b
/src/main/java/returnProject/admin/service/AdminService.java
bbeb56b58b4a4454f7411f08501f071fe0f78a6e
[]
no_license
heavylyns/returnBySpring
0598b80616352a619ed6a9a63ef70c2721349f71
18accfea82f43294ffca4f186b7ff3d1a10d8051
refs/heads/master
2020-03-22T05:03:48.673938
2018-07-03T06:39:30
2018-07-03T06:39:30
139,539,313
0
0
null
null
null
null
UTF-8
Java
false
false
885
java
package returnProject.admin.service; import egovframework.com.cop.bbs.service.BoardVO; import egovframework.com.uss.umt.service.MberManageVO; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.ibatis.annotations.Param; public interface AdminService { /** * 관리자 로그인을 처리한다. * @param vo * @return * @throws Exception */ public AdminVO adminLogin(AdminVO vo) throws Exception; public List<AdminRoleVO> getAdminRole(String id) throws Exception; public AdminBoardVO boardCnt (String boardCode) throws Exception; public List<AdminVO> getRecentVisitor() throws Exception; public List<AdminVO> monthlyVisitor(HttpServletRequest request) throws Exception; public void visitorCounter() throws Exception; }
d1656697f33c0c128c10a724810213fd6f5ad7a8
694d574b989e75282326153d51bd85cb8b83fb9f
/google-ads/src/test/java/com/google/ads/googleads/v4/services/ProductGroupViewServiceClientTest.java
124a7a7bc860d651d581819bfccb8b011bc3ec30
[ "Apache-2.0" ]
permissive
tikivn/google-ads-java
99201ef20efd52f884d651755eb5a3634e951e9b
1456d890e5c6efc5fad6bd276b4a3cd877175418
refs/heads/master
2023-08-03T13:02:40.730269
2020-07-17T16:33:40
2020-07-17T16:33:40
280,845,720
0
0
Apache-2.0
2023-07-23T23:39:26
2020-07-19T10:51:35
null
UTF-8
Java
false
false
25,068
java
/* * Copyright 2020 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.ads.googleads.v4.services; import com.google.ads.googleads.v4.resources.ProductGroupView; import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; import com.google.api.gax.grpc.testing.LocalChannelProvider; import com.google.api.gax.grpc.testing.MockGrpcService; import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.protobuf.AbstractMessage; import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @javax.annotation.Generated("by GAPIC") public class ProductGroupViewServiceClientTest { private static MockAccountBudgetProposalService mockAccountBudgetProposalService; private static MockAccountBudgetService mockAccountBudgetService; private static MockAccountLinkService mockAccountLinkService; private static MockAdGroupAdAssetViewService mockAdGroupAdAssetViewService; private static MockAdGroupAdLabelService mockAdGroupAdLabelService; private static MockAdGroupAdService mockAdGroupAdService; private static MockAdGroupAudienceViewService mockAdGroupAudienceViewService; private static MockAdGroupBidModifierService mockAdGroupBidModifierService; private static MockAdGroupCriterionLabelService mockAdGroupCriterionLabelService; private static MockAdGroupCriterionService mockAdGroupCriterionService; private static MockAdGroupCriterionSimulationService mockAdGroupCriterionSimulationService; private static MockAdGroupExtensionSettingService mockAdGroupExtensionSettingService; private static MockAdGroupFeedService mockAdGroupFeedService; private static MockAdGroupLabelService mockAdGroupLabelService; private static MockAdGroupService mockAdGroupService; private static MockAdGroupSimulationService mockAdGroupSimulationService; private static MockAdParameterService mockAdParameterService; private static MockAdScheduleViewService mockAdScheduleViewService; private static MockAdService mockAdService; private static MockAgeRangeViewService mockAgeRangeViewService; private static MockAssetService mockAssetService; private static MockBatchJobService mockBatchJobService; private static MockBiddingStrategyService mockBiddingStrategyService; private static MockBillingSetupService mockBillingSetupService; private static MockCampaignAudienceViewService mockCampaignAudienceViewService; private static MockCampaignBidModifierService mockCampaignBidModifierService; private static MockCampaignBudgetService mockCampaignBudgetService; private static MockCampaignCriterionService mockCampaignCriterionService; private static MockCampaignCriterionSimulationService mockCampaignCriterionSimulationService; private static MockCampaignDraftService mockCampaignDraftService; private static MockCampaignExperimentService mockCampaignExperimentService; private static MockCampaignExtensionSettingService mockCampaignExtensionSettingService; private static MockCampaignFeedService mockCampaignFeedService; private static MockCampaignLabelService mockCampaignLabelService; private static MockCampaignService mockCampaignService; private static MockCampaignSharedSetService mockCampaignSharedSetService; private static MockCarrierConstantService mockCarrierConstantService; private static MockChangeStatusService mockChangeStatusService; private static MockClickViewService mockClickViewService; private static MockConversionActionService mockConversionActionService; private static MockConversionAdjustmentUploadService mockConversionAdjustmentUploadService; private static MockConversionUploadService mockConversionUploadService; private static MockCurrencyConstantService mockCurrencyConstantService; private static MockCustomInterestService mockCustomInterestService; private static MockCustomerClientLinkService mockCustomerClientLinkService; private static MockCustomerClientService mockCustomerClientService; private static MockCustomerExtensionSettingService mockCustomerExtensionSettingService; private static MockCustomerFeedService mockCustomerFeedService; private static MockCustomerLabelService mockCustomerLabelService; private static MockCustomerManagerLinkService mockCustomerManagerLinkService; private static MockCustomerNegativeCriterionService mockCustomerNegativeCriterionService; private static MockCustomerService mockCustomerService; private static MockDetailPlacementViewService mockDetailPlacementViewService; private static MockDisplayKeywordViewService mockDisplayKeywordViewService; private static MockDistanceViewService mockDistanceViewService; private static MockDomainCategoryService mockDomainCategoryService; private static MockDynamicSearchAdsSearchTermViewService mockDynamicSearchAdsSearchTermViewService; private static MockExpandedLandingPageViewService mockExpandedLandingPageViewService; private static MockExtensionFeedItemService mockExtensionFeedItemService; private static MockFeedItemService mockFeedItemService; private static MockFeedItemTargetService mockFeedItemTargetService; private static MockFeedMappingService mockFeedMappingService; private static MockFeedPlaceholderViewService mockFeedPlaceholderViewService; private static MockFeedService mockFeedService; private static MockGenderViewService mockGenderViewService; private static MockGeoTargetConstantService mockGeoTargetConstantService; private static MockGeographicViewService mockGeographicViewService; private static MockGoogleAdsFieldService mockGoogleAdsFieldService; private static MockGoogleAdsService mockGoogleAdsService; private static MockGroupPlacementViewService mockGroupPlacementViewService; private static MockHotelGroupViewService mockHotelGroupViewService; private static MockHotelPerformanceViewService mockHotelPerformanceViewService; private static MockIncomeRangeViewService mockIncomeRangeViewService; private static MockInvoiceService mockInvoiceService; private static MockKeywordPlanAdGroupKeywordService mockKeywordPlanAdGroupKeywordService; private static MockKeywordPlanAdGroupService mockKeywordPlanAdGroupService; private static MockKeywordPlanCampaignKeywordService mockKeywordPlanCampaignKeywordService; private static MockKeywordPlanCampaignService mockKeywordPlanCampaignService; private static MockKeywordPlanIdeaService mockKeywordPlanIdeaService; private static MockKeywordPlanService mockKeywordPlanService; private static MockKeywordViewService mockKeywordViewService; private static MockLabelService mockLabelService; private static MockLandingPageViewService mockLandingPageViewService; private static MockLanguageConstantService mockLanguageConstantService; private static MockLocationViewService mockLocationViewService; private static MockManagedPlacementViewService mockManagedPlacementViewService; private static MockMediaFileService mockMediaFileService; private static MockMerchantCenterLinkService mockMerchantCenterLinkService; private static MockMobileAppCategoryConstantService mockMobileAppCategoryConstantService; private static MockMobileDeviceConstantService mockMobileDeviceConstantService; private static MockOfflineUserDataJobService mockOfflineUserDataJobService; private static MockOperatingSystemVersionConstantService mockOperatingSystemVersionConstantService; private static MockPaidOrganicSearchTermViewService mockPaidOrganicSearchTermViewService; private static MockParentalStatusViewService mockParentalStatusViewService; private static MockPaymentsAccountService mockPaymentsAccountService; private static MockProductBiddingCategoryConstantService mockProductBiddingCategoryConstantService; private static MockProductGroupViewService mockProductGroupViewService; private static MockReachPlanService mockReachPlanService; private static MockRecommendationService mockRecommendationService; private static MockRemarketingActionService mockRemarketingActionService; private static MockSearchTermViewService mockSearchTermViewService; private static MockSharedCriterionService mockSharedCriterionService; private static MockSharedSetService mockSharedSetService; private static MockShoppingPerformanceViewService mockShoppingPerformanceViewService; private static MockThirdPartyAppAnalyticsLinkService mockThirdPartyAppAnalyticsLinkService; private static MockTopicConstantService mockTopicConstantService; private static MockTopicViewService mockTopicViewService; private static MockUserDataService mockUserDataService; private static MockUserInterestService mockUserInterestService; private static MockUserListService mockUserListService; private static MockUserLocationViewService mockUserLocationViewService; private static MockVideoService mockVideoService; private static MockServiceHelper serviceHelper; private ProductGroupViewServiceClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { mockAccountBudgetProposalService = new MockAccountBudgetProposalService(); mockAccountBudgetService = new MockAccountBudgetService(); mockAccountLinkService = new MockAccountLinkService(); mockAdGroupAdAssetViewService = new MockAdGroupAdAssetViewService(); mockAdGroupAdLabelService = new MockAdGroupAdLabelService(); mockAdGroupAdService = new MockAdGroupAdService(); mockAdGroupAudienceViewService = new MockAdGroupAudienceViewService(); mockAdGroupBidModifierService = new MockAdGroupBidModifierService(); mockAdGroupCriterionLabelService = new MockAdGroupCriterionLabelService(); mockAdGroupCriterionService = new MockAdGroupCriterionService(); mockAdGroupCriterionSimulationService = new MockAdGroupCriterionSimulationService(); mockAdGroupExtensionSettingService = new MockAdGroupExtensionSettingService(); mockAdGroupFeedService = new MockAdGroupFeedService(); mockAdGroupLabelService = new MockAdGroupLabelService(); mockAdGroupService = new MockAdGroupService(); mockAdGroupSimulationService = new MockAdGroupSimulationService(); mockAdParameterService = new MockAdParameterService(); mockAdScheduleViewService = new MockAdScheduleViewService(); mockAdService = new MockAdService(); mockAgeRangeViewService = new MockAgeRangeViewService(); mockAssetService = new MockAssetService(); mockBatchJobService = new MockBatchJobService(); mockBiddingStrategyService = new MockBiddingStrategyService(); mockBillingSetupService = new MockBillingSetupService(); mockCampaignAudienceViewService = new MockCampaignAudienceViewService(); mockCampaignBidModifierService = new MockCampaignBidModifierService(); mockCampaignBudgetService = new MockCampaignBudgetService(); mockCampaignCriterionService = new MockCampaignCriterionService(); mockCampaignCriterionSimulationService = new MockCampaignCriterionSimulationService(); mockCampaignDraftService = new MockCampaignDraftService(); mockCampaignExperimentService = new MockCampaignExperimentService(); mockCampaignExtensionSettingService = new MockCampaignExtensionSettingService(); mockCampaignFeedService = new MockCampaignFeedService(); mockCampaignLabelService = new MockCampaignLabelService(); mockCampaignService = new MockCampaignService(); mockCampaignSharedSetService = new MockCampaignSharedSetService(); mockCarrierConstantService = new MockCarrierConstantService(); mockChangeStatusService = new MockChangeStatusService(); mockClickViewService = new MockClickViewService(); mockConversionActionService = new MockConversionActionService(); mockConversionAdjustmentUploadService = new MockConversionAdjustmentUploadService(); mockConversionUploadService = new MockConversionUploadService(); mockCurrencyConstantService = new MockCurrencyConstantService(); mockCustomInterestService = new MockCustomInterestService(); mockCustomerClientLinkService = new MockCustomerClientLinkService(); mockCustomerClientService = new MockCustomerClientService(); mockCustomerExtensionSettingService = new MockCustomerExtensionSettingService(); mockCustomerFeedService = new MockCustomerFeedService(); mockCustomerLabelService = new MockCustomerLabelService(); mockCustomerManagerLinkService = new MockCustomerManagerLinkService(); mockCustomerNegativeCriterionService = new MockCustomerNegativeCriterionService(); mockCustomerService = new MockCustomerService(); mockDetailPlacementViewService = new MockDetailPlacementViewService(); mockDisplayKeywordViewService = new MockDisplayKeywordViewService(); mockDistanceViewService = new MockDistanceViewService(); mockDomainCategoryService = new MockDomainCategoryService(); mockDynamicSearchAdsSearchTermViewService = new MockDynamicSearchAdsSearchTermViewService(); mockExpandedLandingPageViewService = new MockExpandedLandingPageViewService(); mockExtensionFeedItemService = new MockExtensionFeedItemService(); mockFeedItemService = new MockFeedItemService(); mockFeedItemTargetService = new MockFeedItemTargetService(); mockFeedMappingService = new MockFeedMappingService(); mockFeedPlaceholderViewService = new MockFeedPlaceholderViewService(); mockFeedService = new MockFeedService(); mockGenderViewService = new MockGenderViewService(); mockGeoTargetConstantService = new MockGeoTargetConstantService(); mockGeographicViewService = new MockGeographicViewService(); mockGoogleAdsFieldService = new MockGoogleAdsFieldService(); mockGoogleAdsService = new MockGoogleAdsService(); mockGroupPlacementViewService = new MockGroupPlacementViewService(); mockHotelGroupViewService = new MockHotelGroupViewService(); mockHotelPerformanceViewService = new MockHotelPerformanceViewService(); mockIncomeRangeViewService = new MockIncomeRangeViewService(); mockInvoiceService = new MockInvoiceService(); mockKeywordPlanAdGroupKeywordService = new MockKeywordPlanAdGroupKeywordService(); mockKeywordPlanAdGroupService = new MockKeywordPlanAdGroupService(); mockKeywordPlanCampaignKeywordService = new MockKeywordPlanCampaignKeywordService(); mockKeywordPlanCampaignService = new MockKeywordPlanCampaignService(); mockKeywordPlanIdeaService = new MockKeywordPlanIdeaService(); mockKeywordPlanService = new MockKeywordPlanService(); mockKeywordViewService = new MockKeywordViewService(); mockLabelService = new MockLabelService(); mockLandingPageViewService = new MockLandingPageViewService(); mockLanguageConstantService = new MockLanguageConstantService(); mockLocationViewService = new MockLocationViewService(); mockManagedPlacementViewService = new MockManagedPlacementViewService(); mockMediaFileService = new MockMediaFileService(); mockMerchantCenterLinkService = new MockMerchantCenterLinkService(); mockMobileAppCategoryConstantService = new MockMobileAppCategoryConstantService(); mockMobileDeviceConstantService = new MockMobileDeviceConstantService(); mockOfflineUserDataJobService = new MockOfflineUserDataJobService(); mockOperatingSystemVersionConstantService = new MockOperatingSystemVersionConstantService(); mockPaidOrganicSearchTermViewService = new MockPaidOrganicSearchTermViewService(); mockParentalStatusViewService = new MockParentalStatusViewService(); mockPaymentsAccountService = new MockPaymentsAccountService(); mockProductBiddingCategoryConstantService = new MockProductBiddingCategoryConstantService(); mockProductGroupViewService = new MockProductGroupViewService(); mockReachPlanService = new MockReachPlanService(); mockRecommendationService = new MockRecommendationService(); mockRemarketingActionService = new MockRemarketingActionService(); mockSearchTermViewService = new MockSearchTermViewService(); mockSharedCriterionService = new MockSharedCriterionService(); mockSharedSetService = new MockSharedSetService(); mockShoppingPerformanceViewService = new MockShoppingPerformanceViewService(); mockThirdPartyAppAnalyticsLinkService = new MockThirdPartyAppAnalyticsLinkService(); mockTopicConstantService = new MockTopicConstantService(); mockTopicViewService = new MockTopicViewService(); mockUserDataService = new MockUserDataService(); mockUserInterestService = new MockUserInterestService(); mockUserListService = new MockUserListService(); mockUserLocationViewService = new MockUserLocationViewService(); mockVideoService = new MockVideoService(); serviceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.<MockGrpcService>asList( mockAccountBudgetProposalService, mockAccountBudgetService, mockAccountLinkService, mockAdGroupAdAssetViewService, mockAdGroupAdLabelService, mockAdGroupAdService, mockAdGroupAudienceViewService, mockAdGroupBidModifierService, mockAdGroupCriterionLabelService, mockAdGroupCriterionService, mockAdGroupCriterionSimulationService, mockAdGroupExtensionSettingService, mockAdGroupFeedService, mockAdGroupLabelService, mockAdGroupService, mockAdGroupSimulationService, mockAdParameterService, mockAdScheduleViewService, mockAdService, mockAgeRangeViewService, mockAssetService, mockBatchJobService, mockBiddingStrategyService, mockBillingSetupService, mockCampaignAudienceViewService, mockCampaignBidModifierService, mockCampaignBudgetService, mockCampaignCriterionService, mockCampaignCriterionSimulationService, mockCampaignDraftService, mockCampaignExperimentService, mockCampaignExtensionSettingService, mockCampaignFeedService, mockCampaignLabelService, mockCampaignService, mockCampaignSharedSetService, mockCarrierConstantService, mockChangeStatusService, mockClickViewService, mockConversionActionService, mockConversionAdjustmentUploadService, mockConversionUploadService, mockCurrencyConstantService, mockCustomInterestService, mockCustomerClientLinkService, mockCustomerClientService, mockCustomerExtensionSettingService, mockCustomerFeedService, mockCustomerLabelService, mockCustomerManagerLinkService, mockCustomerNegativeCriterionService, mockCustomerService, mockDetailPlacementViewService, mockDisplayKeywordViewService, mockDistanceViewService, mockDomainCategoryService, mockDynamicSearchAdsSearchTermViewService, mockExpandedLandingPageViewService, mockExtensionFeedItemService, mockFeedItemService, mockFeedItemTargetService, mockFeedMappingService, mockFeedPlaceholderViewService, mockFeedService, mockGenderViewService, mockGeoTargetConstantService, mockGeographicViewService, mockGoogleAdsFieldService, mockGoogleAdsService, mockGroupPlacementViewService, mockHotelGroupViewService, mockHotelPerformanceViewService, mockIncomeRangeViewService, mockInvoiceService, mockKeywordPlanAdGroupKeywordService, mockKeywordPlanAdGroupService, mockKeywordPlanCampaignKeywordService, mockKeywordPlanCampaignService, mockKeywordPlanIdeaService, mockKeywordPlanService, mockKeywordViewService, mockLabelService, mockLandingPageViewService, mockLanguageConstantService, mockLocationViewService, mockManagedPlacementViewService, mockMediaFileService, mockMerchantCenterLinkService, mockMobileAppCategoryConstantService, mockMobileDeviceConstantService, mockOfflineUserDataJobService, mockOperatingSystemVersionConstantService, mockPaidOrganicSearchTermViewService, mockParentalStatusViewService, mockPaymentsAccountService, mockProductBiddingCategoryConstantService, mockProductGroupViewService, mockReachPlanService, mockRecommendationService, mockRemarketingActionService, mockSearchTermViewService, mockSharedCriterionService, mockSharedSetService, mockShoppingPerformanceViewService, mockThirdPartyAppAnalyticsLinkService, mockTopicConstantService, mockTopicViewService, mockUserDataService, mockUserInterestService, mockUserListService, mockUserLocationViewService, mockVideoService)); serviceHelper.start(); } @AfterClass public static void stopServer() { serviceHelper.stop(); } @Before public void setUp() throws IOException { serviceHelper.reset(); channelProvider = serviceHelper.createChannelProvider(); ProductGroupViewServiceSettings settings = ProductGroupViewServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) .setCredentialsProvider(NoCredentialsProvider.create()) .build(); client = ProductGroupViewServiceClient.create(settings); } @After public void tearDown() throws Exception { client.close(); } @Test @SuppressWarnings("all") public void getProductGroupViewTest() { String resourceName2 = "resourceName2625949903"; ProductGroupView expectedResponse = ProductGroupView.newBuilder().setResourceName(resourceName2).build(); mockProductGroupViewService.addResponse(expectedResponse); String formattedResourceName = ProductGroupViewServiceClient.formatProductGroupViewName( "[CUSTOMER]", "[PRODUCT_GROUP_VIEW]"); ProductGroupView actualResponse = client.getProductGroupView(formattedResourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockProductGroupViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetProductGroupViewRequest actualRequest = (GetProductGroupViewRequest) actualRequests.get(0); Assert.assertEquals(formattedResourceName, actualRequest.getResourceName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); } @Test @SuppressWarnings("all") public void getProductGroupViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockProductGroupViewService.addException(exception); try { String formattedResourceName = ProductGroupViewServiceClient.formatProductGroupViewName( "[CUSTOMER]", "[PRODUCT_GROUP_VIEW]"); client.getProductGroupView(formattedResourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } }
e7c2c07f483d0741387de91c64c77b7d3d78cc5f
20860da07ad991732951b22b88d83178a5d61653
/live-doctor/src/main/java/com/doctor/controller/NotificationHandlerController.java
95b95b4d71a529e6731b1b4d034ff93e176fab95
[]
no_license
NistorNicu/live-doctor
4737953c8afea5596a48b13a6c0014723c1f0540
8d0584299733c54579ea2cebafdcbd16313cceab
refs/heads/master
2020-05-29T15:40:58.497250
2016-07-03T16:19:02
2016-07-03T16:19:02
60,984,337
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.doctor.controller; import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.stereotype.Controller; @Controller public class NotificationHandlerController { @MessageMapping("consultations") public String proccesMessage(String mess){ return mess.toUpperCase(); } }
42c2d5b217e3647a2bf76ea815ab2d85f0e6caa6
4c3ff03ad152d19d2d9f87fe12898ed06423a145
/src/niuke4/BallJump.java
308fbe5297cde490167fa6bc7b51fd8686df2db5
[]
no_license
Yangxiaoxiao10/Code
0b319d19d15d532680d622e3936456dd8972d2e7
16a5b0bdf5ce5392d3d9dba5283c05d8d54a11d4
refs/heads/master
2022-05-22T01:37:54.079432
2020-04-27T04:24:37
2020-04-27T04:24:37
259,202,420
0
0
null
null
null
null
UTF-8
Java
false
false
618
java
package niuke4; import com.sun.org.apache.bcel.internal.generic.FLOAD; import java.util.Scanner; /** * @Author 杨晓晓 * @Date 2020/3/27 0:33 * @Version 1.0 */ public class BallJump { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()){ int h = sc.nextInt(); double sum = h; double height = h; for (int i = 1; i < 5; i++) { height /=2; sum += height*2; } System.out.println(sum); System.out.println(height); } } }
c2049df4d3821869d2a9d6e4f889d21ce73e4e26
fec345bfcd47f5c2cf09b78d45bb173d008627bb
/app/src/main/java/com/aroraaman/myshopify/dagger/ViewModelKey.java
e2b1fabadc04e5b6bbc37e5ef1ec8db27a8b2e15
[]
no_license
arora-aman/MyShopify
6b7a4c2c7680fcc244adbfc985e847d1e3883797
6f54c44054e84b14c60892ae564246ed3686ba72
refs/heads/master
2021-06-30T02:27:18.775175
2020-05-17T22:40:17
2020-05-17T22:40:17
100,769,301
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
package com.aroraaman.myshopify.dagger; import android.arch.lifecycle.ViewModel; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import dagger.MapKey; @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @MapKey public @interface ViewModelKey { Class<? extends ViewModel> value(); }
2cf18cb35171923b8f50a9492ffc041e5c3d7acb
565e0bf342074a4ad65bd12b440c2f5c73a494c6
/Aula07/src/Ataques/Hyperfang.java
8cfb21cfa8e96f0d47a7f55833bbb891cf47c687
[]
no_license
Carechio/Simula-o-Pokemon
293f0972137ed11730ee727f454a1df3d192f2a4
57ecbede2ed18ca2dc12a3b5eaced96a01d2219e
refs/heads/master
2021-01-01T05:03:01.752084
2016-04-29T23:03:51
2016-04-29T23:03:51
57,415,576
0
0
null
null
null
null
UTF-8
Java
false
false
138
java
package Ataques; import Exercicio01.Ataque; public class Hyperfang extends Ataque{ public Hyperfang() { super("Hyperfang", 90); } }
cc25a4994714bcc08ab0f39ff590d704a5bf81b8
ea8d520e306557ce903115d28dad8ac1cf2a1a1b
/Android/AndroidGesture1.2/src/com/android/fastdtw/dtw/Point.java
d00b45100378f23dcd7619073fbd6a387ff1d723
[]
no_license
viviancwy/m19404
9f535ad13609f87b6c89e988791a2437d0b8d291
33bac9bb091948f9170c1f5d9307db5075f73205
refs/heads/master
2021-01-10T01:30:34.411340
2013-11-23T20:38:19
2013-11-23T20:38:19
55,335,634
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package com.android.fastdtw.dtw; import java.io.Serializable; public class Point implements Serializable { public double x, y; public Point() { x=0;y=0; } public double getX() { return x; } public double getY() { return y; } public Point(double x, double y) { this.x = x; this.y = y; } public void copy(Point src) { x = src.x; y = src.y; } }
fbb59fff106835826c4d4920507351cffe230082
6da88a90701fc1edc4b23fd0fb50c9690dcec9e6
/src/view/Drawable.java
09f11b5f5f00a7c98e1e0c4631711c4c03649525
[]
no_license
pcrdoo/smart-wars
7aa42c1871e766b2fbdad25730ba92f9d7c1a18e
6ce9881ad6c28593280bf6167b7a18c5f372d953
refs/heads/master
2021-08-26T08:39:36.484747
2017-11-22T17:49:50
2017-11-22T17:49:50
108,657,971
0
0
null
null
null
null
UTF-8
Java
false
false
100
java
package view; import java.awt.Graphics2D; public interface Drawable { void draw(Graphics2D g); }
aa3f49312fb0d798b93086329368e7535cdbd538
11ce1835e67d4ef077b99a7e2ebc303f0b9d75c4
/Spring/spring-security-demo/src/main/java/com/springsecurity/demo/config/SecurityWebApplicationInitializer.java
479f7d1d7e8e4a32eaa5759e6c6c44f5177c94bf
[]
no_license
bibhas-abhishek/projects
7003c0bb0639b153105ec230144f2d029df9d19c
f769a61670bd9f889970fc5eb0f104be81183b35
refs/heads/master
2022-12-23T12:59:45.922213
2021-11-26T20:34:28
2021-11-26T20:34:28
96,638,662
4
1
null
2022-12-16T00:41:34
2017-07-08T19:06:12
Java
UTF-8
Java
false
false
234
java
package com.springsecurity.demo.config; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { }
759e6145e285fd3a0481a9ab7fb6804151ae94b4
7e547e99e9dbb7f0ce6880c4cd3117004ebac112
/TowerDefense/app/src/main/java/csc133/towerdefense/game/gameobject/enemy/SpeedGradeAlienBuilder.java
7eb9baa68d6207c6d008f294e44a2342fa138b22
[]
no_license
cddavidson20/CSC133
91ff80afc25b4d88ea8dd3e0443b36759416e133
558982503364546c0c7c240bcbb3681ef7575d46
refs/heads/master
2020-12-31T09:40:26.107326
2020-05-13T16:41:28
2020-05-13T16:41:28
238,982,299
0
1
null
2020-05-13T06:13:58
2020-02-07T17:10:00
Java
UTF-8
Java
false
false
1,698
java
package csc133.towerdefense.game.gameobject.enemy; import java.util.Random; import csc133.towerdefense.game.movepath.MovePath; public class SpeedGradeAlienBuilder implements IEnemyBuilder { static final float SIZE = 30; static final float HEALTH_MAX = 15; static final float SPEED = 9; private Enemy enemy; public SpeedGradeAlienBuilder() { this.enemy = new Enemy(); } public void newEnemy() { this.enemy = new Enemy(); } public void setStart(float x, float y) { this.enemy.x = x; this.enemy.y = y; } public void setHealth() { this.enemy.healthMax = HEALTH_MAX; this.enemy.health = HEALTH_MAX; } public void setGoldValue() { this.enemy.goldValue = 25; } public void setSpeed() { this.enemy.speed = SPEED; } public void setSize() { this.enemy.width = SIZE; this.enemy.height = SIZE; } // Makes enemies have slightly different pathing points so they're not all single file. public void setOffset() { Random random = new Random(); float randX = (random.nextBoolean() ? 1 : -1) * ((float) Math.random() * this.enemy.path.width / 2 - SIZE / 2); float randY = (random.nextBoolean() ? 1 : -1) * ((float) Math.random() * this.enemy.path.width / 2 - SIZE / 2); this.enemy.offsetX = randX; this.enemy.offsetY = randY; this.enemy.x += randX; this.enemy.y += randY; } public void setPath(MovePath path) { this.enemy.setPath(path); } public Enemy getEnemy() { return enemy; } }
a78fb5e86f09159d99d5acc1e3ca1e705aa19d96
b63ee06a9b15bc980a4fe1693ee088d87cb6a8ba
/app/src/main/java/com/teamtreehouse/friendlyforecast/db/ForecastDataSource.java
b31ab35d4356b80dcc669d3e8b7d3dddaa769842
[]
no_license
AdityaShirole/SQLite-tutorial
91bf951b4218c51a5cefd8bf556c3e56d95ec90f
035a9339d4c0665e42849d97f367553177e06a3f
refs/heads/master
2016-09-01T15:03:37.828548
2015-05-28T19:08:43
2015-05-28T19:08:43
36,459,689
0
0
null
null
null
null
UTF-8
Java
false
false
2,979
java
package com.teamtreehouse.friendlyforecast.db; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.teamtreehouse.friendlyforecast.services.Forecast; import java.sql.SQLException; /** * Created by Aditya Shirole on 5/28/2015. */ public class ForecastDataSource { private SQLiteDatabase mDatabase; private ForecastHelper mForecastHelper; private Context mContext; public ForecastDataSource(Context context){ mContext = context; mForecastHelper = new ForecastHelper(mContext); } //open public void open() throws SQLException{ mDatabase = mForecastHelper.getWritableDatabase(); } //close public void close(){ mDatabase.close(); } //insert public void insertForecast(Forecast forecast){ mDatabase.beginTransaction(); try { for (Forecast.HourData hour : forecast.hourly.data) { ContentValues contentValues = new ContentValues(); contentValues.put(ForecastHelper.COL_TEMPERATURE, hour.temperature); mDatabase.insert(ForecastHelper.TABLE_TEMPERATURES, null, contentValues); } mDatabase.setTransactionSuccessful(); } finally { mDatabase.endTransaction(); } } //select public Cursor selectAllTemperatures() { Cursor cursor = mDatabase.query( ForecastHelper.TABLE_TEMPERATURES, //table new String[] { ForecastHelper.COL_TEMPERATURE }, //column names null, //where clause null, //where parameters null, //group by null, //having null //order by ); return cursor; } public Cursor selectTempsGreaterThan(String minTemp) { String whereClause = ForecastHelper.COL_TEMPERATURE + " > ?"; //? is parameter Cursor cursor = mDatabase.query( ForecastHelper.TABLE_TEMPERATURES, //table new String[] { ForecastHelper.COL_TEMPERATURE }, //column names whereClause, //where clause new String[] { minTemp }, //where parameters null, //group by null, //having null //order by ); return cursor; } //update public int updateTemperature(double newTemp) { ContentValues values = new ContentValues(); values.put(ForecastHelper.COL_TEMPERATURE,newTemp); int rowsUpdated = mDatabase.update(ForecastHelper.TABLE_TEMPERATURES, values, null, null); return rowsUpdated; } //delete public void deleteAll() { mDatabase.delete( ForecastHelper.TABLE_TEMPERATURES, null, null ); } }
932aa04b151d87fec8f0c0626adc647c5981b5a7
b474398887fd3f2fbebd29ccc580c5fb293e252d
/src/org/omg/PortableServer/POAManagerPackage/AdapterInactive.java
209ae51770a34ebb41659e50d93eaec6ccf5a810
[ "MIT" ]
permissive
AndyChenIT/JDKSourceCode1.8
65a27e356debdcedc15642849602174c6ea286aa
4aa406b5b52e19ef8a323f9f829ea1852105d18b
refs/heads/master
2023-09-02T15:14:37.857475
2021-11-19T10:13:31
2021-11-19T10:13:31
428,856,994
0
0
MIT
2021-11-17T00:26:30
2021-11-17T00:26:29
null
UTF-8
Java
false
false
662
java
package org.omg.PortableServer.POAManagerPackage; /** * org/omg/PortableServer/POAManagerPackage/AdapterInactive.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u201/12322/corba/src/share/classes/org/omg/PortableServer/poa.idl * Saturday, December 15, 2018 6:38:40 PM PST */ public final class AdapterInactive extends org.omg.CORBA.UserException { public AdapterInactive () { super(AdapterInactiveHelper.id()); } // ctor public AdapterInactive (String $reason) { super(AdapterInactiveHelper.id() + " " + $reason); } // ctor } // class AdapterInactive
d08f5c6578f6469b6076a03c4ad92c4ed760021c
5410e5956d7c1ce3ffee2383d07a956ea637daee
/src/main/java/com/sparkfinance/model/SalaryResults.java
a66c1ea1f3c05ab68ad91ff3c91734b9604f4682
[]
no_license
connerT/SparkFinance
874371bf729ca524dd0357da1b71456b9f9b9afc
96fec6a26ba03f0ed710c6f0fa0e0a9cc7de5f27
refs/heads/master
2021-01-10T13:13:48.751179
2016-04-01T20:55:29
2016-04-01T20:55:29
54,714,341
0
0
null
null
null
null
UTF-8
Java
false
false
2,443
java
package com.sparkfinance.model; import java.math.BigDecimal; public class SalaryResults { private BigDecimal federalTax; private BigDecimal fedTaxRate; private BigDecimal stateTax; private BigDecimal realIncome; private BigDecimal salary; private BigDecimal fourOoneKpercentage; private boolean success; private String reason; private String filingStatus; private String state; private String year; private String timePeriod; public BigDecimal getRealIncome() { return realIncome; } public void setRealIncome(BigDecimal realIncome) { this.realIncome = realIncome; } public BigDecimal getStateTax() { return stateTax; } public void setStateTax(BigDecimal stateTax) { this.stateTax = stateTax; } public BigDecimal getFederalTax() { return federalTax; } public void setFederalTax(BigDecimal federalTax) { this.federalTax = federalTax; } public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public BigDecimal getSalary() { return salary; } public void setSalary(BigDecimal salary) { this.salary = salary; } public BigDecimal getFedTaxRate() { return fedTaxRate; } public void setFedTaxRate(BigDecimal fedTaxRate) { this.fedTaxRate = fedTaxRate; } public String getFilingStatus() { return filingStatus; } public void setFilingStatus(String filingStatus) { this.filingStatus = filingStatus; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getYear() { return year; } public void setYear(String year) { this.year = year; } public String getTimePeriod() { return timePeriod; } public void setTimePeriod(String timePeriod) { this.timePeriod = timePeriod; } public BigDecimal getFourOoneKpercentage() { return fourOoneKpercentage; } public void setFourOoneKpercentage(BigDecimal fourOoneKpercentage) { this.fourOoneKpercentage = fourOoneKpercentage; } }
75518f8b828ae5457a5aba0841b8e0c5784b74fb
a7b868c8c81984dbcb17c1acc09c0f0ab8e36c59
/src/main/java/com/alipay/api/response/AlipayOpenAppAraterRatestatusModifyResponse.java
c77e80c7e5f1e14bd57b17e71b4883ba6f54311c
[ "Apache-2.0" ]
permissive
1755616537/alipay-sdk-java-all
a7ebd46213f22b866fa3ab20c738335fc42c4043
3ff52e7212c762f030302493aadf859a78e3ebf7
refs/heads/master
2023-02-26T01:46:16.159565
2021-02-02T01:54:36
2021-02-02T01:54:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.open.app.arater.ratestatus.modify response. * * @author auto create * @since 1.0, 2020-07-02 17:30:50 */ public class AlipayOpenAppAraterRatestatusModifyResponse extends AlipayResponse { private static final long serialVersionUID = 7182734557921137615L; /** * 是否更惨成功 */ @ApiField("success") private Boolean success; public void setSuccess(Boolean success) { this.success = success; } public Boolean getSuccess( ) { return this.success; } }
dc8e439a2758b5363e0d607eca4ddf83e0ffcf2f
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a172/A172228Test.java
374377f03b565ff3a59b06d5cea1e5477911ef3e
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a172; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A172228Test extends AbstractSequenceTest { }
f27a309a9081ec6a5198034ceaded233a634fc18
0febc4804e61061f8d7c22a3f8aab7890d6029fc
/app/src/main/java/project/astix/com/parasorder/model/TblStoreSomeProdQuotePriceMstr.java
d47bb9cb06451b615487c6a25704f8318c6ef33c
[]
no_license
AstixIntelligenceManagementSystem/ParasOrderSalesApp
bf68dc1c52091b07b968447259201820e6d88218
022076f137a1a3424a5c8bc4e96e2e620e929665
refs/heads/master
2020-03-27T23:09:37.355318
2018-10-10T12:04:23
2018-10-10T12:04:23
147,296,254
0
0
null
null
null
null
UTF-8
Java
false
false
1,696
java
package project.astix.com.parasorder.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class TblStoreSomeProdQuotePriceMstr { @SerializedName("PrdId") @Expose private Integer prdId; @SerializedName("StoreId") @Expose private Integer storeId; @SerializedName("QPBT") @Expose private Double qPBT; @SerializedName("QPAT") @Expose private Double qPAT; @SerializedName("QPTaxAmt") @Expose private Double qPTaxAmt; @SerializedName("MinDlvryQty") @Expose private Integer minDlvryQty; @SerializedName("UOMID") @Expose private Integer uOMID; public Integer getPrdId() { return prdId; } public void setPrdId(Integer prdId) { this.prdId = prdId; } public Integer getStoreId() { return storeId; } public void setStoreId(Integer storeId) { this.storeId = storeId; } public Double getQPBT() { return qPBT; } public void setQPBT(Double qPBT) { this.qPBT = qPBT; } public Double getQPAT() { return qPAT; } public void setQPAT(Double qPAT) { this.qPAT = qPAT; } public Double getQPTaxAmt() { return qPTaxAmt; } public void setQPTaxAmt(Double qPTaxAmt) { this.qPTaxAmt = qPTaxAmt; } public Integer getMinDlvryQty() { return minDlvryQty; } public void setMinDlvryQty(Integer minDlvryQty) { this.minDlvryQty = minDlvryQty; } public Integer getUOMID() { return uOMID; } public void setUOMID(Integer uOMID) { this.uOMID = uOMID; } }
7d57510cdeb7a9eb1f201e84aec4c0e06a53749c
9328eebca6477eafa0aeae70a8b85e361231a4f6
/cloud-provider-hystrix-payment8001/src/main/java/com/atguigu/springcloud/alibaba/controller/PaymentController.java
444c8d525dd68a1f13dea61b7d20f18c57a57283
[]
no_license
qkillq/springcloud2020
a89832faaa7a02a2305ba1264cca2b6cdfcbca71
f6ad699650a90895603dbaf3c0af72132d1b7d5c
refs/heads/master
2022-11-18T08:19:40.712056
2020-07-13T17:23:34
2020-07-13T17:23:34
279,363,078
0
0
null
null
null
null
UTF-8
Java
false
false
1,308
java
package com.atguigu.springcloud.alibaba.controller; import com.atguigu.springcloud.alibaba.service.PaymentService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; @RestController @Slf4j public class PaymentController { @Autowired private PaymentService paymentService; @Value("${server.port}") private String serverPort; @GetMapping("/payment/hystrix/ok/{id}") public String paymentInfo_OK(@PathVariable("id") Integer id){ String result = paymentService.paymentInfo_OK(id); log.info("****result" + result); return result; } @GetMapping("/payment/hystrix/timeout/{id}") public String paymentInfo_Timeout(@PathVariable("id") Integer id){ String result = paymentService.paymentInfo_Timeout(id); log.info("****result" + result); return result; } @GetMapping("/payment/circuit/{id}") public String paymentCircuitBreaker(@PathVariable("id") Integer id){ return paymentService.paymentCircuitBreaker(id); } }
f62b19fb0cc2b9ff7da8d62f16cb7805d06235d3
80c4eaaf07039d4ac2cc00e1cddfd641f2667c89
/app/src/main/java/com/woniukeji/jianguo/http/MethodInterface.java
ac136ca7e9b6282af9cda222e6532b5f1ad3bac0
[ "Apache-2.0" ]
permissive
woniukeji/jianguo
828d6818ff36f27199bc7bbae58c4c580f2d7b86
279fec1ea6298f0d3a4c02494c388be0ef2273b7
refs/heads/master
2020-04-04T04:10:34.563125
2016-08-04T08:16:39
2016-08-04T08:16:39
52,862,624
5
0
null
null
null
null
UTF-8
Java
false
false
4,349
java
package com.woniukeji.jianguo.http; import com.woniukeji.jianguo.entity.Balance; import com.woniukeji.jianguo.entity.CityCategory; import com.woniukeji.jianguo.entity.HttpResult; import com.woniukeji.jianguo.entity.PushMessage; import com.woniukeji.jianguo.entity.RxJobDetails; import com.woniukeji.jianguo.entity.User; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Query; import rx.Observable; /** * Created by invinjun on 2016/6/1. */ public interface MethodInterface { @POST("I_user_login_Insert_Servlet") Observable<User> Register(@Query("only") String only, @Query("phone") String phone, @Query("password") String password, @Query("sms_code") String sms_code); /** *获取短信验证码 */ @GET("I_SMS_Servlet") Observable<HttpResult<String>> getSMS(@Query("only") String only, @Query("phone") String phone); /** *手机号码密码登陆 */ @GET("I_user_login_Login_Servlet") Observable<User> Login(@Query("only") String only, @Query("phone") String phone, @Query("password") String password); /** *更换手机号码 *@author invinjun *created at 2016/7/19 10:57 */ @POST("T_user_login_ChangeTel_Servlet") Observable<HttpResult<String>> changeTel(@Query("only") String only,@Query("login_id") String login_id,@Query("tel") String tel,@Query("sms_code") String sms_code); /** *兼职详情获取 */ // @GET("T_Job_info_Select_JobId_Servlet") @GET("T_Job_info_Select_Servlet") Observable<RxJobDetails> getJobDetail(@Query("only") String only, @Query("login_id") String login_id, @Query("job_id") String job_id); /** *拉取城市和兼职类型(兼职列表界面使用) */ @GET("T_Job_Area_City_List_User_Servlet") Observable<HttpResult<CityCategory>> getCityCategory(@Query("only") String only); /** *微信绑定账户接口 */ @POST("T_user_wx_Insert_Servlet") Observable<HttpResult<String>> postWX(@Query("only") String only, @Query("login_id") String login_id,@Query("openid") String openid,@Query("nickname") String nickname ,@Query("sex") String sex,@Query("province") String provice,@Query("city") String city,@Query("headimgurl") String headimgurl, @Query("unionid") String unionid ); @GET("T_user_money_LoginId_Servlet") Observable<Balance> getWallet(@Query("only") String only, @Query("login_id") String login_id); /** *报名接口 *@author invinjun *created at 2016/7/26 16:43 */ @GET("T_enroll_Insert_Servlet") Observable<HttpResult<String>> postSign(@Query("only") String only, @Query("login_id") String login_id,@Query("job_id") String job_id); /** *查询推送记录接口】、 *@author invinjun *created at 2016/7/26 16:44 */ @GET("T_push_List_Servlet") Observable<HttpResult<PushMessage>> getPush(@Query("only") String only, @Query("login_id") String login_id); /** *实名认证 */ @GET("T_user_realname_Insert_Servlet") Observable<HttpResult<String>> postRealName(@Query("only") String only, @Query("login_id") String login_id, @Query("front_image") String front_image, @Query("behind_image") String behind_image, @Query("realname") String realname, @Query("id_number") String id_number, @Query("sex") String sex); /** *个人资料上传 */ @POST("T_user_resume_Update_Servlet") Observable<HttpResult<String>> postResume(@Query("only") String only, @Query("login_id") String login_id, @Query("name") String name, @Query("nickname") String nickname, @Query("school") String school, @Query("height") String height, @Query("student") String student, @Query("name_image") String name_image, @Query("intoschool_date") String intoschool_date, @Query("birth_date") String birth_date, @Query("shoe_size") String shoe_size, @Query("clothing_size") String clothing_size, @Query("sex") String sex); }
b12e1feae9d3ca0fdec47e0dd77f2bfc7b4363fd
f321db1ace514d08219cc9ba5089ebcfff13c87a
/generated-tests/dynamosa/tests/s1032/27_math/evosuite-tests/org/apache/commons/math3/ode/nonstiff/EmbeddedRungeKuttaIntegrator_ESTest.java
bef62fbdc3a07e5032e7c37aaee9f013cfcf413a
[]
no_license
sealuzh/dynamic-performance-replication
01bd512bde9d591ea9afa326968b35123aec6d78
f89b4dd1143de282cd590311f0315f59c9c7143a
refs/heads/master
2021-07-12T06:09:46.990436
2020-06-05T09:44:56
2020-06-05T09:44:56
146,285,168
2
2
null
null
null
null
UTF-8
Java
false
false
15,140
java
/* * This file was automatically generated by EvoSuite * Fri Jul 05 03:20:38 GMT 2019 */ package org.apache.commons.math3.ode.nonstiff; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.math3.ode.ExpandableStatefulODE; import org.apache.commons.math3.ode.FirstOrderConverter; import org.apache.commons.math3.ode.FirstOrderDifferentialEquations; import org.apache.commons.math3.ode.SecondOrderDifferentialEquations; import org.apache.commons.math3.ode.nonstiff.DormandPrince54Integrator; import org.apache.commons.math3.ode.nonstiff.DormandPrince853Integrator; import org.apache.commons.math3.ode.nonstiff.HighamHall54Integrator; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class EmbeddedRungeKuttaIntegrator_ESTest extends EmbeddedRungeKuttaIntegrator_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { double[] doubleArray0 = new double[6]; HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-646.07076166), 2566.34, doubleArray0, doubleArray0); highamHall54Integrator0.setSafety((-207.542)); double double0 = highamHall54Integrator0.getSafety(); assertEquals((-207.542), double0, 0.01); } @Test(timeout = 4000) public void test01() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9); highamHall54Integrator0.getOrder(); assertEquals(10.0, highamHall54Integrator0.getMaxGrowth(), 0.01); assertEquals(0.2, highamHall54Integrator0.getMinReduction(), 0.01); assertEquals(0.9, highamHall54Integrator0.getSafety(), 0.01); } @Test(timeout = 4000) public void test02() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-222.89165750273983), (-222.89165750273983), 56.8926694213, 56.8926694213); assertEquals(0.9, highamHall54Integrator0.getSafety(), 0.01); highamHall54Integrator0.setSafety(0.0); assertEquals(10.0, highamHall54Integrator0.getMaxGrowth(), 0.01); } @Test(timeout = 4000) public void test03() throws Throwable { double[] doubleArray0 = new double[5]; DormandPrince54Integrator dormandPrince54Integrator0 = new DormandPrince54Integrator(0.0, 0.0, doubleArray0, doubleArray0); assertEquals(0.2, dormandPrince54Integrator0.getMinReduction(), 0.01); dormandPrince54Integrator0.setMinReduction(0.0); assertEquals(10.0, dormandPrince54Integrator0.getMaxGrowth(), 0.01); } @Test(timeout = 4000) public void test04() throws Throwable { double[] doubleArray0 = new double[6]; HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(0.0, 0.0, doubleArray0, doubleArray0); highamHall54Integrator0.setMinReduction(2148.667845933); assertEquals(2148.667845933, highamHall54Integrator0.getMinReduction(), 0.01); } @Test(timeout = 4000) public void test05() throws Throwable { double[] doubleArray0 = new double[0]; DormandPrince54Integrator dormandPrince54Integrator0 = new DormandPrince54Integrator(0.0, 0.0, doubleArray0, doubleArray0); assertEquals(10.0, dormandPrince54Integrator0.getMaxGrowth(), 0.01); dormandPrince54Integrator0.setMaxGrowth(0.0); assertEquals(0.2, dormandPrince54Integrator0.getMinReduction(), 0.01); } @Test(timeout = 4000) public void test06() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9); assertEquals(10.0, highamHall54Integrator0.getMaxGrowth(), 0.01); highamHall54Integrator0.setMaxGrowth(1.3057724436551892E-9); assertEquals(0.9, highamHall54Integrator0.getSafety(), 0.01); } @Test(timeout = 4000) public void test07() throws Throwable { double[] doubleArray0 = new double[0]; DormandPrince54Integrator dormandPrince54Integrator0 = new DormandPrince54Integrator(0.0, 0.0, doubleArray0, doubleArray0); SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(1).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); try { dormandPrince54Integrator0.integrate(expandableStatefulODE0, 0.0); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // 2 != 0 // verifyException("org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator", e); } } @Test(timeout = 4000) public void test08() throws Throwable { double[] doubleArray0 = new double[0]; SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(0).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(1685.327683251277, (-1.2479264502054702E-8), doubleArray0, doubleArray0); highamHall54Integrator0.setMaxEvaluations(686); try { highamHall54Integrator0.integrate(expandableStatefulODE0, (-2235.4552)); fail("Expecting exception: IllegalStateException"); } catch(IllegalStateException e) { // // illegal state: maximal count (686) exceeded // verifyException("org.apache.commons.math3.util.Incrementor$1", e); } } @Test(timeout = 4000) public void test09() throws Throwable { double[] doubleArray0 = new double[0]; SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(754).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(754, 754, doubleArray0, doubleArray0); try { highamHall54Integrator0.integrate(expandableStatefulODE0, 6.999732437141968E-10); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // 1,508 != 0 // verifyException("org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator", e); } } @Test(timeout = 4000) public void test10() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator(1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9, 1.3057724436551892E-9); // Undeclared exception! try { highamHall54Integrator0.integrate((ExpandableStatefulODE) null, (-1235.65)); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.math3.ode.AbstractIntegrator", e); } } @Test(timeout = 4000) public void test11() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-222.89165750273983), (-222.89165750273983), 56.8926694213, 56.8926694213); highamHall54Integrator0.setSafety(25.1); assertEquals(25.1, highamHall54Integrator0.getSafety(), 0.01); } @Test(timeout = 4000) public void test12() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-1.7645702540162507), (-1.7645702540162507), (-1.7645702540162507), (-1.7645702540162507)); assertEquals(10.0, highamHall54Integrator0.getMaxGrowth(), 0.01); highamHall54Integrator0.setMaxGrowth((-1.7645702540162507)); double double0 = highamHall54Integrator0.getMaxGrowth(); assertEquals((-1.7645702540162507), double0, 0.01); } @Test(timeout = 4000) public void test13() throws Throwable { DormandPrince853Integrator dormandPrince853Integrator0 = new DormandPrince853Integrator((-3452.176691), (-2117.1957568), (-3452.176691), (-2117.1957568)); assertEquals(0.2, dormandPrince853Integrator0.getMinReduction(), 0.01); dormandPrince853Integrator0.setMinReduction((-2117.1957568)); double double0 = dormandPrince853Integrator0.getMinReduction(); assertEquals((-2117.1957568), double0, 0.01); } @Test(timeout = 4000) public void test14() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-1469.0), (-1469.0), (-1469.0), (-1469.0)); SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(0).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); expandableStatefulODE0.setTime((-1469.0)); highamHall54Integrator0.integrate(expandableStatefulODE0, (-2610.114)); assertEquals(8, highamHall54Integrator0.getEvaluations()); } @Test(timeout = 4000) public void test15() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-1469.0), (-1469.0), (-1469.0), (-1469.0)); SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(0).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); expandableStatefulODE0.setTime((-1469.0)); highamHall54Integrator0.integrate(expandableStatefulODE0, (-379.82770945)); assertEquals(8, highamHall54Integrator0.getEvaluations()); } @Test(timeout = 4000) public void test16() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-1.7645702540162507), (-1.7645702540162507), (-1.7645702540162507), (-1.7645702540162507)); SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(124).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); // Undeclared exception! highamHall54Integrator0.integrate(expandableStatefulODE0, (-1.7645702540162507)); } @Test(timeout = 4000) public void test17() throws Throwable { DormandPrince54Integrator dormandPrince54Integrator0 = new DormandPrince54Integrator((-1257.24798602), (-1257.24798602), 1647.3748880056075, (-1235.65)); SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(0).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); ExpandableStatefulODE expandableStatefulODE0 = new ExpandableStatefulODE(firstOrderConverter0); // Undeclared exception! dormandPrince54Integrator0.integrate(expandableStatefulODE0, (-1257.24798602)); } @Test(timeout = 4000) public void test18() throws Throwable { double[] doubleArray0 = new double[0]; SecondOrderDifferentialEquations secondOrderDifferentialEquations0 = mock(SecondOrderDifferentialEquations.class, new ViolatedAssumptionAnswer()); doReturn(0).when(secondOrderDifferentialEquations0).getDimension(); FirstOrderConverter firstOrderConverter0 = new FirstOrderConverter(secondOrderDifferentialEquations0); HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-730.382462296871), 1685.327683251277, doubleArray0, doubleArray0); double[] doubleArray1 = new double[0]; // Undeclared exception! highamHall54Integrator0.integrate((FirstOrderDifferentialEquations) firstOrderConverter0, (-730.382462296871), doubleArray0, 1685.327683251277, doubleArray1); } @Test(timeout = 4000) public void test19() throws Throwable { DormandPrince54Integrator dormandPrince54Integrator0 = new DormandPrince54Integrator(967.02980428404, 2590.884, 10.0, 3345.209822950048); double double0 = dormandPrince54Integrator0.getMinReduction(); assertEquals(10.0, dormandPrince54Integrator0.getMaxGrowth(), 0.01); assertEquals(0.9, dormandPrince54Integrator0.getSafety(), 0.01); assertEquals(0.2, double0, 0.01); } @Test(timeout = 4000) public void test20() throws Throwable { double[] doubleArray0 = new double[0]; DormandPrince853Integrator dormandPrince853Integrator0 = new DormandPrince853Integrator(1369.34, 1369.34, doubleArray0, doubleArray0); double double0 = dormandPrince853Integrator0.getSafety(); assertEquals(10.0, dormandPrince853Integrator0.getMaxGrowth(), 0.01); assertEquals(0.2, dormandPrince853Integrator0.getMinReduction(), 0.01); assertEquals(0.9, double0, 0.01); } @Test(timeout = 4000) public void test21() throws Throwable { HighamHall54Integrator highamHall54Integrator0 = new HighamHall54Integrator((-1469.0), (-1469.0), (-1469.0), (-1469.0)); double double0 = highamHall54Integrator0.getMaxGrowth(); assertEquals(10.0, double0, 0.01); assertEquals(0.2, highamHall54Integrator0.getMinReduction(), 0.01); assertEquals(0.9, highamHall54Integrator0.getSafety(), 0.01); } }
29180bead45058a76357d781c30c41226c0ff481
33bbfe514cbc70939018ae97ef95fce7989218f7
/shiXun/Calculator.java
d2464755caa0d9533968104a2c27a98b4f482892
[]
no_license
zhoutengteng/java
1b72d2c582e56eec1ab4a10f5ff81f3e086c2a89
19466d8703a49e6a915c4f1eac046cf2aec64841
refs/heads/master
2020-04-06T04:55:39.211109
2015-08-27T05:27:11
2015-08-27T05:27:11
40,858,503
0
0
null
null
null
null
UTF-8
Java
false
false
8,667
java
import javax.swing.*; import java.awt.*; import java.util.regex.*; import java.awt.event.*; import java.util.Vector; public class Calculator { final private JButton v_jb[]; final private JTextField v_jt[]; final private int trueInt[]; private JFrame jFrame; private Container contentpane; public Calculator() { v_jb = new JButton[5]; v_jt = new JTextField[5]; trueInt = new int [5]; for (int i = 0; i < 5; i++) { trueInt[i] = 0; } String te1[] = {"","","","=",""}; for (int i = 0; i < 5; i++) { v_jt[i] = new JTextField(te1[i]); v_jt[i].setFont(new Font("Arial",Font.ITALIC,20)); v_jt[i].setHorizontalAlignment(JTextField.CENTER); } v_jt[4].setHorizontalAlignment(JTextField.RIGHT); String te[] = {"+","-","*","/","OK"}; for (int i = 0; i < 5; i++) { v_jb[i] = new JButton(te[i]); v_jb[i].setFont(new Font("Arial",Font.ITALIC,20)); } jFrame = new JFrame("Calculator"); contentpane = jFrame.getContentPane(); contentpane.setLayout(new GridLayout(2,5,10,10)); for (int i = 0; i < 5; i++) { contentpane.add(v_jt[i]); } for (int i = 0; i < 5; i++) { contentpane.add(v_jb[i]); } jFrame.setSize(500,200); jFrame.setVisible(true); } public void go() { if (trueInt[0] == 0 || trueInt[1] == 0|| trueInt[2] == 0) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(true); } v_jt[0].addFocusListener(new FocusAdapter(){ public void focusGained(FocusEvent e) { // System.out.println("你正在编辑第 一个数字"); } }); v_jt[0].addMouseListener(new MouseAdapter(){ public void mouseExited(MouseEvent e) { String str = ((JTextField)e.getComponent()).getText(); //Pattern p = Pattern.compile("((-|/+)[0-9]+$)|([0-9]+$)|([0-9](/.))"); Pattern p = Pattern.compile("((-|/+)[0-9]+$)|([0-9]+$)|^(-?/d+)(/./d+)?$"); Matcher m = p.matcher(str); boolean b = m.matches(); // boolean b = Pattern.matches("a*b", "aaaaab"); if (b) { //System.out.println("first num is a right format"); trueInt[0] = 1; v_jt[0].setBorder(BorderFactory.createLineBorder(Color.green,10)); } else { trueInt[0] = 0; // System.out.println("first num is a false format"); v_jt[0].setBorder(BorderFactory.createLineBorder(Color.red,10)); } if (v_jt[0].getText().equals("") || v_jt[1].getText().equals("")|| v_jt[2].getText().equals("")) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(false); } if (trueInt[0] == 0 || trueInt[1] == 0|| trueInt[2] == 0) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(true); } } }); v_jt[2].addFocusListener(new FocusAdapter(){ public void focusGained(FocusEvent e) { // System.out.println("你正在编辑第二个数字"); } }); v_jt[2].addMouseListener(new MouseAdapter(){ public void mouseExited(MouseEvent e) { String str = ((JTextField)e.getComponent()).getText(); Pattern p = Pattern.compile("((-|/+)[0-9]+$)|([0-9]+$)|([0-9]*/.[0-9]+)"); Matcher m = p.matcher(str); boolean b = m.matches(); // boolean b = Pattern.matches("a*b", "aaaaab"); if (b) { trueInt[2] = 1; // System.out.println("second num is a right format"); v_jt[2].setBorder(BorderFactory.createLineBorder(Color.green,10)); } else { trueInt[2] = 0; // System.out.println("second num is a false format"); v_jt[2].setBorder(BorderFactory.createLineBorder(Color.red,10)); } if (v_jt[0].getText().equals("") || v_jt[1].getText().equals("")|| v_jt[2].getText().equals("")) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(false); } if (trueInt[0] == 0 || trueInt[1] == 0|| trueInt[2] == 0) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(true); } } }); v_jt[1].setEnabled(false); v_jt[1].setBackground(Color.gray); v_jt[1].setBorder(BorderFactory.createLineBorder(Color.green,10)); //v_jt[1].setBorder(BorderFactory.createBevelBorder(0)); v_jt[3].setEnabled(false); v_jt[3].setBackground(Color.gray); v_jt[3].setBorder(BorderFactory.createLineBorder(Color.green,10)); v_jt[4].setEnabled(false); v_jt[4].setBackground(Color.gray); v_jt[4].setBorder(BorderFactory.createLineBorder(Color.green,10)); for (int i = 0; i < 5; i++) { v_jb[i].addMouseListener(new MouseAdapter(){ public void mouseClicked(MouseEvent e) { trueInt[1] = 1; switch ((((JButton)e.getComponent()).getText()).charAt(0)) { case '+': v_jt[1].setText((((JButton)e.getComponent()).getText())); break; case '-': v_jt[1].setText((((JButton)e.getComponent()).getText())); break; case '*': v_jt[1].setText((((JButton)e.getComponent()).getText())); break; case '/': v_jt[1].setText((((JButton)e.getComponent()).getText())); break; default: if (v_jt[0].getText().equals("") || v_jt[1].getText().equals("")|| v_jt[2].getText().equals("")) { break; } else { char x = (v_jt[1].getText()).charAt(0); double a = Double.parseDouble(v_jt[0].getText()); double b = Double.parseDouble(v_jt[2].getText()); double c = 0; //System.out.println(a); // System.out.println(b); // System.out.println(x); if (x == '+') { c = a + b; } if (x == '-') { c = a - b; } if (x == '*') { c = a * b; } if (x == '/') { c = a / b; } v_jt[4].setText(Double.toString(c)); } break; } if (trueInt[0] == 0 || trueInt[1] == 0|| trueInt[2] == 0) { v_jb[4].setEnabled(false); } else { v_jb[4].setEnabled(true); } } }); } jFrame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { System.exit(0); } }); } public static void main(String[] argv){ Calculator ca = new Calculator(); ca.go(); } }
e8c259ebc33effa966ebeafccab78ce0abf5575b
24d95b6df2e92b7c248dcbd54a269f474b68a1ed
/java/src/lesson2/Helloworld.java
b689fa7cec2a962efc6d6a385a2ecd467bdd491e
[ "MIT" ]
permissive
lijingwei1209/javaStudy
a97a8eade02579e5f5a16ca16a08eed4bf9ba414
39eafba8519eeb79254a4700c54c9d0da641bda1
refs/heads/master
2021-09-15T10:57:11.099649
2018-05-31T06:40:48
2018-05-31T06:40:48
110,915,359
0
1
null
null
null
null
UTF-8
Java
false
false
594
java
package lesson2; public class Helloworld { // 外部类中的静态变量score private static int scores = 84; // 创建静态内部类 public static class SInner{ // 内部类中的变量score int score = 91; public void show() { System.out.println("访问外部类中的score:" + scores ); System.out.println("访问内部类中的score:" + score); } } // 测试静态内部类 public static void main(String[] args) { // 直接创建内部类的对象 SInner si = new SInner(); // 调用show方法 si.show(); } }
036e6df0a830833415f67b57a40a6662126f3c05
22805ce8b41067f99e312355d47d9ed500f64b63
/java17/lec01/work14base.java
667938685ae5405ddbe0d138e413243c78f2764f
[]
no_license
e1b16079/datebank
d1e8e0fd10f4f2457193b93ca45bd01a4f15fd07
c87b057282572e2855deb62591c1617030f3328f
refs/heads/master
2021-02-13T05:30:10.376824
2020-03-03T15:07:18
2020-03-03T15:07:18
244,665,908
0
0
null
null
null
null
UTF-8
Java
false
false
645
java
import java.awt.*; import java.applet.*; public class work14 extends Applet { public void paint(Graphics g){ g.fillRect(0,0,250,150 ); // 1 段め g.fillRect(25,15,50,40); g.fillRect(75,15,50,40); g.fillRect(125,15,50,40); g.fillRect(175,15,50,40); // 2 段め g.fillRect(25,55,50,40); g.fillRect(75,55,50,40); g.fillRect(125,55,50,40); g.fillRect(175,55,50,40); // 3 段め g.fillRect(25,95,50,40); g.fillRect(75,95,50,40); g.fillRect(125,95,50,40); g.fillRect(175,95,50,40); } }
6d405bfeadc7fc8f77f816227b3debc305355f93
6cf4a3c9eeb5af6e57d613dfabb80e47c4226f47
/TestRadius.java
fc6c25390ef69909f640e16815e417e3276e4389
[]
no_license
kornwika1003/week8
c43b96b834b65875cdf48e3319d9e894101743c1
64e00d39300666454f1871cf704b6a197c433844
refs/heads/master
2021-01-17T08:17:50.247540
2015-10-09T17:28:49
2015-10-09T17:28:49
43,936,250
0
0
null
2015-10-09T06:08:43
2015-10-09T06:08:43
null
UTF-8
Java
false
false
163
java
public class TestRadius { public static void main(String[] args) { Radius s = new Radius(); s.setRadius(10); System.out.println(s.Area()); } }
2d1b418ea1765fe909531e4d67254fea19f93552
82710a31ffae20c017a771a88098fdaf322ca151
/ATaxi.java
18b90919ff6c39c10e2ae0ce38d65aa636f27bf9
[]
no_license
dextergemellus/ataxi
c0cf957863be7af32450a66c0336a3e3bcb6f64e
e3938d509d0e2d159d628e06038bace32787422e
refs/heads/master
2020-06-13T19:51:50.827736
2016-12-04T20:05:08
2016-12-04T20:05:08
75,560,203
0
0
null
null
null
null
UTF-8
Java
false
false
13,331
java
/****************************************************************************** * Name: Evan Wood and Elizabeth Haile * Class: ORF467 * * * Description: Autonomous taxi simulation * ******************************************************************************/ import edu.princeton.cs.algs4.In; import edu.princeton.cs.algs4.Queue; import edu.princeton.cs.algs4.StdOut; public class ATaxi { private static final int TRIP_ARRAY_WIDTH = 19+1+4; private Queue<double[]> vehicleTrips; public ATaxi() { // read in file In in = new In("aTaxi1.csv"); In in1 = new In("aTaxi1.csv"); in.readLine(); in1.readLine(); // initialize queue vehicleTrips = new Queue<double[]>(); String save = in.readLine(); while (in.hasNextLine()) { // read in origin pixel for this tripArray String[] parsedStrings = save.split(","); int OXcoord = Integer.parseInt(parsedStrings[8]); int OYcoord = Integer.parseInt(parsedStrings[9]); int count = 1; while (in.hasNextLine()) { String line = in.readLine(); save = line; parsedStrings = line.split(","); int a = Integer.parseInt(parsedStrings[8]); int b = Integer.parseInt(parsedStrings[9]); if (OXcoord == a && OYcoord == b) { count++; } else { break; // breaks out of while loop } } tripArray(count, in1); } } private void tripArray(int count, In in) { String[][] tripArray = new String[count][TRIP_ARRAY_WIDTH]; for (int i = 0; i < count; i++) { String line1 = in.readLine(); String[] parsedStrings1 = line1.split(","); for (int j = 0; j < parsedStrings1.length; j++) { tripArray[i][j] = parsedStrings1[j]; } tripArray[i][parsedStrings1.length] = "not assigned"; } int anchor = 0; // initial index of anchor row for (int i = 0; i < count; i++) { if (tripArray[anchor][19] == "assigned") { int other = 1; // index of other row double anchorTime = Double.parseDouble(tripArray[anchor][10]); // start time of anchor trip double otherTime = Double.POSITIVE_INFINITY; if (anchor + other < count) { otherTime = Double.parseDouble(tripArray[anchor + other][10]); // start time of other trip } int passengerCount = 1; String assignment; // anchor destination coordinates int a = Integer.parseInt(tripArray[anchor][16]); int b = Integer.parseInt(tripArray[anchor][17]); // initialize aTaxi trip double[] aTaxiTrip = new double[7]; aTaxiTrip[0] = Double.parseDouble(tripArray[anchor][8]); // aTaxiTrip[0] = origin x-coord aTaxiTrip[1] = Double.parseDouble(tripArray[anchor][9]); // aTaxiTrip[1] = origin y-coord aTaxiTrip[2] = (double) a; // aTaxiTrip[0] = final destination x coordinate aTaxiTrip[3] = (double) b; // aTaxiTrip[1] = final y coordinate aTaxiTrip[4] = anchorTime + 300.00; // aTaxiTrip[2] = depart time aTaxiTrip[5] = Double.parseDouble(tripArray[anchor][18]); // aTaxiTrip[3] = distance of path to final destination while (otherTime - anchorTime < 300.0) { int c = Integer.parseInt(tripArray[anchor + other][16]); int d = Integer.parseInt(tripArray[anchor + other][17]); assignment = tripArray[anchor + other][19]; // check if trip is in walking distance (i.e. same origin, dest. pixel) if (c == Integer.parseInt(tripArray[anchor + other][8]) && d == Integer.parseInt(tripArray[anchor + other][9])) { } else { // 3 destinations already associated w/ given aTaxi trip if (tripArray[anchor][19 + 3] != null) { int x = Integer.parseInt(tripArray[anchor][20]); int y = Integer.parseInt(tripArray[anchor][21]); int x1 = Integer.parseInt(tripArray[anchor][22]); int y1 = Integer.parseInt(tripArray[anchor][23]); if (c == a && d == b && assignment == "not assigned" || c == x && d == y && assignment == "not assigned" || c == x1 && d == y1 && assignment == "not assigned") { tripArray[anchor][19] = "assigned"; // passenger count: increment // update departure time of aTaxi //aTaxiTrip[2] = Double.parseDouble(tripArray[anchor + other][18]); } } // 2 destinations already associated w/ given aTaxi trip else if (tripArray[anchor][19 + 1] != null) { int x = Integer.parseInt(tripArray[anchor][20]); int y = Integer.parseInt(tripArray[anchor][21]); if (a == c && b == d && assignment == "not assigned" || c == x && d == y && assignment == "not assigned" || withinCircuity(anchor, tripArray, aTaxiTrip, a, b, x, y, c, d, 0.25) && assignment == "not assigned") { // mark this trip as having been taken care of tripArray[anchor][19] = "assigned"; // update tripArray with 3rd destination tripArray[anchor][22] = String.valueOf(c); tripArray[anchor][23] = String.valueOf(d); // update departure time of aTaxi //aTaxiTrip[2] = Double.parseDouble(tripArray[anchor + other][18]); } } // only 1 destination associated w/ given aTaxi trip else if (a == c && b == d && assignment == "not assigned" || withinCircuity(anchor, tripArray, aTaxiTrip, a,b,c,d, 0.25) && assignment == "not assigned") { // mark this trip as having been taken care of tripArray[anchor + other][19] = "assigned"; // update tripArray with 2nd destination tripArray[anchor][19 + 1] = String.valueOf(c); tripArray[anchor][19 + 2] = String.valueOf(d); // update departure time of aTaxi //aTaxiTrip[2] = Double.parseDouble(tripArray[anchor + other][18]); } } other++; otherTime = Double.parseDouble(tripArray[anchor + other][10]); } vehicleTrips.enqueue(aTaxiTrip); } anchor++; } } private boolean withinCircuity(int anchor, String[][] tripArray, double[] array, int a, int b, int c, int d, double circ) { int anchorX = Integer.parseInt(tripArray[anchor][8]); int anchorY = Integer.parseInt(tripArray[anchor][9]); double distTo1 = Math.sqrt((a - anchorX)*(a - anchorX)+(b - anchorY)*(b - anchorY)); double distTo2 = Math.sqrt((c - anchorX)*(c - anchorX)+(d - anchorY)*(d - anchorY)); double distTo12 = Math.sqrt((c - a)*(c - a)+(d - b)*(d - b)); // path: origin --> 1 --> 2 if ((1 + circ) * distTo2 < distTo1 + distTo12) { // update final destination in tripArray array[0] = (double) c; array[1] = (double) d; // add distance of path taken in tripArray array[3] = distTo1 + distTo12; return true; } // path: origin --> 2 --> 1 else if ((1 + circ) * distTo2 < distTo2 + distTo12) { // no need to change final destination // add distance of path taken in tripArray array[3] = distTo2 + distTo12; return true; } else return false; } private boolean withinCircuity(int anchor, String[][] tripArray, double[] array, int a, int b, int c, int d, int e, int f, double circ) { int anchorX = Integer.parseInt(tripArray[anchor][8]); int anchorY = Integer.parseInt(tripArray[anchor][9]); double distTo1 = Math.sqrt((a - anchorX)*(a - anchorX)+(b - anchorY)*(b - anchorY)); double distTo2 = Math.sqrt((c - anchorX)*(c - anchorX)+(d - anchorY)*(d - anchorY)); double distTo3 = Math.sqrt((e - anchorX)*(e - anchorX)+(f - anchorY)*(f - anchorY)); double distTo12 = Math.sqrt((c - a)*(c - a)+(d - b)*(d - b)); double distTo13 = Math.sqrt((e - a)*(e - a)+(f - b)*(f - b)); double distTo23 = Math.sqrt((c - e)*(c - e)+(d - f)*(d - f)); // path: origin --> 1 --> 2 --> 3 if ((1 + circ) * distTo3 < distTo1 + distTo12 + distTo23) { // update final destination to tripArray array[0] = (double) e; array[1] = (double) f; // update distance of path taken to tripArray array[3] = distTo1 + distTo12 + distTo23; return true; } // path: origin --> 1 --> 3 --> 2 else if ((1 + circ) * distTo3 < distTo1 + distTo13 + distTo23) { // update final destination in tripArray array[0] = (double) c; array[1] = (double) d; // update distance of path taken in tripArray array[3] = distTo1 + distTo13 + distTo23; return true; } // path: origin --> 2 --> 1 --> 3 else if ((1 + circ) * distTo3 < distTo2 + distTo12 + distTo13) { // update final destination in tripArray array[0] = (double) e; array[1] = (double) f; // update distance of path taken in tripArray array[3] = distTo2 + distTo12 + distTo13; return true; } // path: origin --> 2 --> 3 --> 1 else if ((1 + circ) * distTo3 < distTo2 + distTo23 + distTo13) { // add final destination to tripArray array[0] = (double) a; array[1] = (double) b; // add distance of path taken to tripArray array[3] = distTo2 + distTo23 + distTo13; return true; } // path: origin --> 3 --> 1 --> 2 else if ((1 + circ) * distTo3 < distTo3 + distTo13 + distTo12) { // add final destination to tripArray array[0] = (double) c; array[1] = (double) d; // add distance of path taken to tripArray array[3] = distTo3 + distTo13 + distTo12; return true; } // path: origin --> 3 --> 2 --> 1 else if ((1 + circ) * distTo3 < distTo3 + distTo23 + distTo12) { // add final destination to tripArray array[0] = (double) a; array[1] = (double) b; // add distance of path taken to tripArray array[3] = distTo3 + distTo23 + distTo12; return true; } else return false; } public Queue<double[]> iterate() { return vehicleTrips; } public static void main(String[] args) { ATaxi test = new ATaxi(); for (double[] array : test.iterate()) { for (int i = 0; i < 4; i++) { StdOut.print(array[i] + ", "); } StdOut.println(); } } }
5fa69ef5d1e60ebec3a2ddaa3ba8542a3f4f2f34
53b2063a4cd2ae22b61ebe09d292f92f0dc75417
/applications/archive/archive-plugins/org.csstudio.archive.vtype.test/src/org/csstudio/archive/vtype/ArchiveVTypeTest.java
67221e64d661ed15edb2234fe9f136ed97bc5f38
[]
no_license
ATNF/cs-studio
886d6cb2a3d626b761d4486f4243dd04cb21c055
f3ef004fd1566b8b47161b13a65990e8c741086a
refs/heads/master
2021-01-21T08:29:54.345483
2015-05-29T04:04:33
2015-05-29T04:04:33
11,189,876
1
0
null
null
null
null
UTF-8
Java
false
false
3,761
java
/******************************************************************************* * Copyright (c) 2012 Oak Ridge National Laboratory. * 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 ******************************************************************************/ package org.csstudio.archive.vtype; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertThat; import java.util.Arrays; import java.util.Date; import java.util.List; import org.epics.vtype.AlarmSeverity; import org.epics.vtype.Display; import org.epics.vtype.VType; import org.epics.vtype.ValueFactory; import org.epics.util.text.NumberFormats; import org.epics.util.time.Timestamp; import org.junit.Test; /** JUnit test of Archive {@link VType}s * @author Kay Kasemir */ @SuppressWarnings("nls") public class ArchiveVTypeTest { @Test public void testEqual() throws Exception { final Date now = new Date(); final Display display = ValueFactory.newDisplay(0.0, 1.0, 2.0, "a.u.", NumberFormats.format(3), 8.0, 9.0, 10.0, 0.0, 10.0); final VType dbl314 = new ArchiveVNumber(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, 3.14); final VType dbl314b = new ArchiveVNumber(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, 3.14); assertThat(dbl314, equalTo(dbl314b)); final VType int3 = new ArchiveVNumber(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, Integer.valueOf(3)); assertThat(int3, not(equalTo(dbl314))); final VType dbl3 = new ArchiveVNumber(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, Double.valueOf(3)); assertThat(int3, equalTo(dbl3)); final List<String> labels = Arrays.asList("zero", "one", "two", "three"); final VType enum3 = new ArchiveVEnum(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", labels, 3); assertThat(enum3, not(equalTo(dbl314))); assertThat(enum3, equalTo(int3)); assertThat(enum3, equalTo(dbl3)); assertThat(dbl3, equalTo(enum3)); final VType str3 = new ArchiveVString(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", "three"); assertThat(str3, not(equalTo(int3))); assertThat(enum3, equalTo(str3)); assertThat(str3, equalTo(enum3)); final VType arr1 = new ArchiveVNumberArray(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, 1.0, 2.0, 3.0); final VType arr1b = new ArchiveVNumberArray(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, 1.0, 2.0, 3.0); final VType arr2 = new ArchiveVNumberArray(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, 1.0, 2.0, 3.1); System.out.println(arr1); assertThat(arr1, not(equalTo(int3))); assertThat(arr1, not(equalTo(arr2))); assertThat(arr1, equalTo(arr1b)); final StatisticsAccumulator stats = new StatisticsAccumulator(1.0, 2.0, 3.0, 4.0); final VType stat1 = new ArchiveVStatistics(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, stats); final VType stat1b = new ArchiveVStatistics(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, stats); stats.add(2.5); final VType stat2 = new ArchiveVStatistics(Timestamp.of(now), AlarmSeverity.MINOR, "Troubling", display, stats); System.out.println(stat1); assertThat(stat1, not(equalTo(int3))); assertThat(stat1, equalTo(stat1b)); assertThat(stat1, not(equalTo(stat2))); } }
8ec62918fac6ede288440f8e62f4a0dd66ad419b
1f91cf15d43d89ed4d5f109e4358857dc121b96b
/RabbitMQ/my-rabbitmq-app/src/main/java/com/app04/routing/message/PublisherWithExchange.java
19512d89c5e4a4f2a5421f37988c00389da8320a
[]
no_license
softwareengineerhub/spring
384aa3f0f423db4ffbc0aef6684e1706f724e1ed
fdd961e839892eb78f831b5490f7a59442911b45
refs/heads/master
2023-06-23T15:30:45.090708
2023-06-08T08:27:37
2023-06-08T08:27:37
147,172,612
0
0
null
2023-01-27T20:08:46
2018-09-03T08:11:35
Java
UTF-8
Java
false
false
1,106
java
package com.app04.routing.message; import com.rabbitmq.client.*; import java.util.Date; public class PublisherWithExchange { private static String EXCHANGE_NAME = "direct-exchange"; private static String ROUTING_KEY = "direct-route"; private static String ROUTING_KEY2 = "direct-route2"; public static void main(String[] args) throws Exception { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = factory.newConnection("app:api:rest"); try(Channel channel = connection.createChannel()){ channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.DIRECT); AMQP.BasicProperties headers = null; int n = 10; for(int i=0;i<n;i++) { Thread.sleep(1000); String body = i+"; Test message "+ new Date(); channel.basicPublish(EXCHANGE_NAME, ROUTING_KEY2, headers, body.getBytes()); System.out.println(i+" message was published"); } } connection.close(); } }
bee8a3b4417f3da9241fdca588a5a8cbe436ff3e
462e7a27236d977137e932ba521c87df32796b76
/src/backEnd/ModelSecurity.java
7e32563cb10cff314a342aeee44bbde8787f717f
[ "MIT" ]
permissive
DanielRubinstein/Tower-Defense-Maker
e7f73853ec85dc355a78f2dfef8c398370d4d76f
9313982f35f432464e39c677d7353daa9225a66d
refs/heads/master
2021-01-20T03:06:34.162636
2017-10-27T15:33:12
2017-10-27T15:33:12
101,345,802
2
0
null
null
null
null
UTF-8
Java
false
false
394
java
package backEnd; import backEnd.Attribute.AttributeOwner; import backEnd.Attribute.AttributeOwnerReader; import backEnd.GameEngine.Engine.Spawning.SpawnData; import backEnd.GameEngine.Engine.Spawning.SpawnDataReader; public interface ModelSecurity { AttributeOwner getAttributeOwner(AttributeOwnerReader attributeOwnerReader); SpawnData getSpawnData(SpawnDataReader mySpawnDataReader); }
ffc606b13ad79b0d4b49c2d6d84cdb3665da712f
835da5a3100b6b8d01d36e518a87485f8428b72b
/encrypt-file-imgs/src/main/java/com/lyh/img/tools/GameProperties.java
540b9ed5dbb24b784fbd428dc72150ff5f317496
[]
no_license
liuyuhua1984/game-tools
ad27fd2b1db3716e1dd5bede9a04885e2e80e5db
51f5055de7c612bfc08b87c4576078470b595e53
refs/heads/master
2022-07-04T19:58:14.075107
2022-05-19T01:06:46
2022-05-19T01:06:46
153,424,984
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.lyh.img.tools; import java.io.*; import java.util.Properties; /** * 读取游戏属性 * * @author: root * @create: 2018-10-08 15:03 **/ public class GameProperties { /** * loadGameProperties:(). <br/> * TODO().<br/> * 加载配置属性 * * @param propertiesPath * @author lyh */ public static Properties loadGameProperties(String propertiesPath) { InputStream is = null; Properties GAME_BUNDLE = null; try { GAME_BUNDLE = new Properties(); is = new FileInputStream(propertiesPath); BufferedReader br = new BufferedReader(new InputStreamReader(is, "utf-8")); if (is != null) { GAME_BUNDLE.load(br); } br.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } return GAME_BUNDLE; } }
[ "163.com" ]
163.com
f4f7c418decee6bc2ea9eaa627e28664cd893c82
82da9af2a66b39526ea41bf2bff03802ccc58da1
/app/src/main/java/com/app/elisoft/carprojectprimary/Recycler/SignItem.java
12094d0faa6968731b56cc1778713b3062acafa8
[]
no_license
eli200601/car_projector_primary
5f7f839a5c148248e6cf9ff4588f080b72517c5c
fef7e714808f688c22583d6a525604a71b67e109
refs/heads/master
2020-12-30T13:20:08.132066
2017-05-17T20:49:00
2017-05-17T20:49:00
91,347,082
0
0
null
null
null
null
UTF-8
Java
false
false
523
java
package com.app.elisoft.carprojectprimary.Recycler; public class SignItem { private String name; private int image; public SignItem(String name, int image) { this.name = name; this.image = image; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getImage() { return image; } public void setImage(int image) { this.image = image; } }
543c369ac99d34955367ca9cd1b61331a0e06341
e78c246733d268138cd2543101cc0026bbf9228b
/week-09/day-01/RestApp/src/main/java/com/greenfox/restapp/model/Number.java
37e69058b0e50b4931ae497d4867848b297bbe66
[]
no_license
green-fox-academy/Ky0j1n
9684d20cf21e1c855eafc3fab805dc1cfbfe6dbb
ba7c296a90fcd050d844addea093a207c5e154dd
refs/heads/master
2023-03-06T03:04:25.007162
2021-02-19T13:06:56
2021-02-19T13:06:56
314,023,784
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.greenfox.restapp.model; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @Getter @Setter @NoArgsConstructor public class Number { Integer until; public Number(Integer until) { this.until = until; } }
e7149f5cbb2db5e4d5129430fa532e4fdf4a0602
3c751ea375656ed20adc2227102d735c7814a45d
/r2dbc-spi-test/src/main/java/io/r2dbc/spi/test/MockOutParameters.java
74d2ebca0f359d298975de612ffa0a60ed344194
[ "Apache-2.0", "LicenseRef-scancode-dco-1.1" ]
permissive
ascertrobw/r2dbc-spi
f34f1177d54d54306f53b7afdddd3e1be1020980
cf237fe7c602d6a4f213dcd3a28488c43b29d6bd
refs/heads/main
2023-07-19T14:50:53.718416
2021-07-09T15:48:44
2021-07-09T15:48:44
404,377,049
0
0
Apache-2.0
2021-09-08T14:22:44
2021-09-08T14:22:43
null
UTF-8
Java
false
false
5,032
java
/* * Copyright 2017-2021 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.r2dbc.spi.test; import io.r2dbc.spi.OutParameters; import io.r2dbc.spi.OutParametersMetadata; import java.util.HashMap; import java.util.Map; import java.util.Objects; public final class MockOutParameters implements OutParameters { private final Map<Identified, Object> identified; private final OutParametersMetadata metadata; private MockOutParameters(Map<Identified, Object> identified, OutParametersMetadata metadata) { this.identified = Assert.requireNonNull(identified, "identified must not be null"); this.metadata = Assert.requireNonNull(metadata, "metadata must not be null"); } public static Builder builder() { return new Builder(); } public static MockOutParameters empty() { return builder().build(); } @Override @SuppressWarnings("unchecked") public <T> T get(int index, Class<T> type) { Assert.requireNonNull(type, "type must not be null"); Identified identified = new Identified(index, type); if (!this.identified.containsKey(identified)) { throw new AssertionError(String.format("Unexpected call to get(Object, Class) with values '%s', '%s'", index, type.getName())); } return (T) this.identified.get(identified); } @Override @SuppressWarnings("unchecked") public <T> T get(String name, Class<T> type) { Assert.requireNonNull(name, "name must not be null"); Assert.requireNonNull(type, "type must not be null"); Identified identified = new Identified(name, type); if (!this.identified.containsKey(identified)) { throw new AssertionError(String.format("Unexpected call to get(Object, Class) with values '%s', '%s'", name, type.getName())); } return (T) this.identified.get(identified); } @Override public OutParametersMetadata getMetadata() { return this.metadata; } @Override public String toString() { return "MockOutParameters{" + "identified=" + this.identified + '}'; } public static final class Builder { private final Map<Identified, Object> identified = new HashMap<>(); private OutParametersMetadata metadata = MockOutParametersMetadata.empty(); private Builder() { } public MockOutParameters build() { return new MockOutParameters(this.identified, this.metadata); } public Builder identified(Object identifier, Class<?> type, @Nullable Object value) { Assert.requireNonNull(identifier, "identifier must not be null"); Assert.requireNonNull(type, "type must not be null"); this.identified.put(new Identified(identifier, type), value); return this; } public Builder metadata(OutParametersMetadata outParametersMetadata) { this.metadata = Assert.requireNonNull(outParametersMetadata, "outParametersMetadata must not be null"); return this; } @Override public String toString() { return "Builder{" + "identified=" + this.identified + "outParametersMetadata=" + this.metadata + '}'; } } private static final class Identified { private final Object identifier; private final Class<?> type; private Identified(Object identifier, Class<?> type) { this.identifier = Assert.requireNonNull(identifier, "identifier must not be null"); this.type = Assert.requireNonNull(type, "type must not be null"); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Identified that = (Identified) o; return Objects.equals(this.identifier, that.identifier) && Objects.equals(this.type, that.type); } @Override public int hashCode() { return Objects.hash(this.identifier, this.type); } @Override public String toString() { return "Identified{" + "identifier=" + this.identifier + ", type=" + this.type + '}'; } } }
f6c20e59d5ba6376e70f12ca4909a01472aa724e
75c2211a6fefd167f382dac301e1b46617c917e1
/expected-output/random/random1/sll/Input_withGetExponent1.java
c44299d72aeb28b1a69eb7ea169b0e6a31d3492f
[]
no_license
star-finder/jpf-costar
0f87d88f420eace4b1b1c93ad44e764346b09f19
b3f4d4893019a42b6c3f50e4294fd3ab6f2b5f88
refs/heads/master
2022-11-25T01:31:09.822003
2019-07-04T01:46:55
2019-07-04T01:46:55
105,350,745
2
1
null
2022-11-15T08:38:39
2017-09-30T07:20:18
Java
UTF-8
Java
false
false
7,002
java
package random.sll; import org.junit.Test; import gov.nasa.jpf.util.test.TestJPF; public class Input_withGetExponent1 extends TestJPF { @Test public void test_withGetExponent1() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = null; int elem_1 = 7; root.elem = elem_1; root.next = next_2; obj.withGetExponent(root); } @Test public void test_withGetExponent2() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = null; int elem_9 = -30; int elem_11 = 29; int elem_3 = -15; int elem_1 = -32; int elem_7 = -27; int elem_5 = 11; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; obj.withGetExponent(root); } @Test public void test_withGetExponent3() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = null; int elem_13 = 22; int elem_9 = -28; int elem_11 = -28; int elem_3 = -22; int elem_1 = -9; int elem_7 = -13; int elem_5 = 26; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; obj.withGetExponent(root); } @Test public void test_withGetExponent4() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = null; int elem_3 = -29; int elem_1 = -7; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; obj.withGetExponent(root); } @Test public void test_withGetExponent5() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = null; int elem_3 = -17; int elem_1 = 9; int elem_7 = -9; int elem_5 = 16; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; obj.withGetExponent(root); } @Test public void test_withGetExponent6() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = null; int elem_3 = -30; int elem_1 = -15; int elem_5 = 13; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; obj.withGetExponent(root); } @Test public void test_withGetExponent7() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = new random.sll.Node(); random.sll.Node next_16 = null; int elem_13 = 25; int elem_9 = -15; int elem_11 = 18; int elem_15 = 17; int elem_3 = -29; int elem_1 = -17; int elem_7 = -23; int elem_5 = -29; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; next_14.elem = elem_15; next_14.next = next_16; obj.withGetExponent(root); } @Test public void test_withGetExponent8() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = new random.sll.Node(); random.sll.Node next_12 = new random.sll.Node(); random.sll.Node next_14 = new random.sll.Node(); random.sll.Node next_16 = new random.sll.Node(); random.sll.Node next_18 = null; int elem_13 = 23; int elem_9 = 22; int elem_11 = 1; int elem_17 = -22; int elem_15 = 28; int elem_3 = -29; int elem_1 = -28; int elem_7 = 25; int elem_5 = 19; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; next_10.elem = elem_11; next_10.next = next_12; next_12.elem = elem_13; next_12.next = next_14; next_14.elem = elem_15; next_14.next = next_16; next_16.elem = elem_17; next_16.next = next_18; obj.withGetExponent(root); } @Test public void test_withGetExponent9() throws Exception { Input obj = new Input(); random.sll.Node root = null; obj.withGetExponent(root); } @Test public void test_withGetExponent10() throws Exception { Input obj = new Input(); random.sll.Node root = new random.sll.Node(); random.sll.Node next_2 = new random.sll.Node(); random.sll.Node next_4 = new random.sll.Node(); random.sll.Node next_6 = new random.sll.Node(); random.sll.Node next_8 = new random.sll.Node(); random.sll.Node next_10 = null; int elem_9 = 25; int elem_3 = -14; int elem_1 = -8; int elem_7 = -24; int elem_5 = -16; root.elem = elem_1; root.next = next_2; next_2.elem = elem_3; next_2.next = next_4; next_4.elem = elem_5; next_4.next = next_6; next_6.elem = elem_7; next_6.next = next_8; next_8.elem = elem_9; next_8.next = next_10; obj.withGetExponent(root); } }
be998d156db6546773e76517b517e38d98b7deaf
0c2ffe0c4648aaf48f3f4ca80fa45e4698775c29
/src/test/java/org/helianto/task/repository/ReportKnowledgeRepositoryTests.java
d3a304ea85e76bf75535c9e4752973ad73270ba5
[ "Apache-2.0" ]
permissive
raphaelutfpr/helianto-plan-1
e133f663cfd74bfa02aca0b7dc9af122b8a8a106
5624f852d82d2733ee8d5edc2bf3c7d725473768
refs/heads/master
2021-01-20T16:45:20.834107
2015-10-20T18:05:48
2015-10-20T18:05:48
44,603,311
0
0
null
2015-10-20T12:00:26
2015-10-20T12:00:26
null
UTF-8
Java
false
false
1,642
java
package org.helianto.task.repository; import java.io.Serializable; import javax.inject.Inject; import org.helianto.core.test.AbstractJpaRepositoryIntegrationTest; import org.helianto.task.domain.DocumentRequirement; import org.helianto.task.domain.ReportKnowledge; import org.helianto.task.domain.UserRequirement; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; /** * * @author mauriciofernandesdecastro */ @RunWith(SpringJUnit4ClassRunner.class) @Transactional public class ReportKnowledgeRepositoryTests extends AbstractJpaRepositoryIntegrationTest<ReportKnowledge,ReportKnowledgeRepository>{ @Inject private ReportKnowledgeRepository repository; @Inject private DocumentRequirementRepository documentRequirementRepository ; @Inject private UserRequirementRepository userRequirementRepository ; private DocumentRequirement documentRequirement; private UserRequirement userRequirement; protected ReportKnowledgeRepository getRepository() { return repository; } protected Serializable getTargetId(ReportKnowledge target) { return target.getId(); } protected ReportKnowledge getNewTarget() { documentRequirement = documentRequirementRepository.save(new DocumentRequirement()); userRequirement = userRequirementRepository.save(new UserRequirement()); return new ReportKnowledge(documentRequirement, userRequirement); } protected ReportKnowledge findByKey() { return getRepository().findByDocumentRequirementAndUserRequirement(documentRequirement, userRequirement); } }
36e81b051bd87619fec6a9438f842ee8d8171d87
34f81bf64d5e05507c91c965aa3c4867bd24dcf4
/hospital_pojo/src/main/java/com/ccw/entity/UserRole.java
aa5a1072fdfdd77af826e4d55fcf74f33d751122
[]
no_license
123ccw123/hospital_system
33e8bea399f8de7760b2ac325259c9efec072bca
0c7244b28ddfff7574f048554f2ee8663907e407
refs/heads/master
2023-06-30T22:34:23.149367
2021-08-01T02:16:27
2021-08-01T02:16:27
391,502,044
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package com.ccw.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * * </p> * * @author zs * @since 2021-07-05 */ @Data @EqualsAndHashCode(callSuper = true) @TableName("t_user_role") public class UserRole extends Model { private static final long serialVersionUID = 1L; private Integer userId; private Integer roleId; }
544dc73b6ebe9779e08977a1bc8b021cb8bfb285
459e40d36d2e45e97c4fac50a3a2af2d89b4f329
/src/main/java/com/ligaofei/springbootxdtest/model/request/LoginRequest.java
714fe41ca5f690cdb0fba6ca6b3d152068032a17
[]
no_license
ligaofei-xue/springboot-xdtest
d9606375db2ea265d15a800c72b7d0152421aa5f
8a42c89d121776093afd0eb44b19e9dbbd9923ca
refs/heads/master
2023-04-06T05:58:45.041678
2021-04-17T09:30:26
2021-04-17T09:30:26
358,837,565
0
0
null
null
null
null
UTF-8
Java
false
false
422
java
package com.ligaofei.springbootxdtest.model.request; /** * 登录 request */ public class LoginRequest { private String phone; private String pwd; public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } }
64e3cc843059844480c0f7b6d0f9c765c601f94a
5ab816cc7629c5cd712eaddbc89cbecabb9dc150
/app/src/main/java/com/lfish/lotteryssc/wififound/wifishare/WiFiShareServerConfig.java
ae16cff125ec0d5b40616c13a140a584c41a7c83
[]
no_license
littlefishwill/CpTencent15
2298e410ceddd5e831b165f7d268b6b21a356e5e
aa9985aaa5dff451d8aa0a2864085c7a17665a56
refs/heads/master
2020-03-07T03:48:46.304898
2018-04-13T07:15:44
2018-04-13T07:15:45
127,247,351
0
0
null
null
null
null
UTF-8
Java
false
false
2,100
java
package com.lfish.lotteryssc.wififound.wifishare; /** * Created by shenmegui on 2017/6/5. */ public class WiFiShareServerConfig { /** * 获取 文件列表 */ public static final String HOST_PARAM_FILE_LIST = "filelist"; /** * 获取 指定文件 */ public static final String HOST_PARAM_FILE_FILEPATH = "filepath"; /** * 获取 - 搜索指定类型文件 */ public static final String HOST_PARAM_FILE_FILETYPE = "filetype"; /** * 获取 - 搜索指定文字的文件 */ public static final String HOST_PARAM_FILE_FILENAME = "filename"; /** * 删除 - 指定路径的文件 */ public static final String HOST_PARAM_FILE_DELECT = "delectfile"; /** * 获取 - 搜索指定文字的文件 */ public static final String HOST_PARAM_FILE_SEARCH_SPEC = "searchpec"; public static final String[] HOST_PARAM_FILE_FILETYPE_IMAGE_ARRAY = new String[]{".png",".jpg",".jpeg",".gif"}; public static final String[] HOST_PARAM_FILE_FILETYPE_VIDEO_ARRAY = new String[]{".mp4",".avi",".rmvb",".rm",".flash",".mid",".3gp",".flv",".m4v"}; public static final String[] HOST_PARAM_FILE_FILETYPE_MUSIC_ARRAY = new String[]{".mp3",".cd",".wma",".rm",".real",".wav"}; public static final String[] HOST_PARAM_FILE_FILETYPE_APK_ARRAY = new String[]{".apk"}; /** * 获取 - 搜索指定类型文件 iamge */ public static final String HOST_PARAM_FILE_FILETYPE_IMAGE = "image"; /** * 获取 - 搜索指定类型文件 video */ public static final String HOST_PARAM_FILE_FILETYPE_VIDEO = "video"; /** * 获取 - 搜索指定类型文件 music */ public static final String HOST_PARAM_FILE_FILETYPE_MUSIC = "music"; /** * 获取 - 搜索指定类型文件 apk */ public static final String HOST_PARAM_FILE_FILETYPE_APK= "apk"; }
[ "baimes123" ]
baimes123
41191ab031a95860dbd4e4e05dde6b25917a476d
cdb0caf3cb4ec04adbc2abcd0cb395c1ffa48350
/app/src/main/java/com/example/mvc/adapters/transaction/TransactionItemViewMvcImpl.java
b039d50b4437c425d4354cefdee0257c1f7e9467
[]
no_license
arifuljannatarif/CircleImageView
a5ace591456c1e53b8947a231414f9c9ddb86d7c
6823e1701a5615af5583dc503e6a9d053163218d
refs/heads/master
2021-01-16T15:10:12.327528
2020-06-21T08:15:57
2020-06-21T08:15:57
243,163,218
1
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
/* * Copyright (c) 2020. This code is created and written by Ariful Jannat Arif on 3/24/20 10:04 AM */ package com.example.mvc.adapters.transaction; import android.view.LayoutInflater; import android.view.ViewGroup; import com.example.mvc.R; import com.example.mvc.screens.common.views.BaseOvservableViewMvc; import com.example.mvc.models.TransactionModel; import javax.annotation.Nullable; public class TransactionItemViewMvcImpl extends BaseOvservableViewMvc<TransactionItemViewMvc.Listener> implements TransactionItemViewMvc { public TransactionItemViewMvcImpl(LayoutInflater inflater, @Nullable ViewGroup parent, int viewType) { if(viewType==TransactionRecyclerADapter.TYPE_DATE) setRootView(inflater.inflate(R.layout.transaction_date_item,parent,false)); else setRootView(inflater.inflate(R.layout.recent_transaction_item,parent,false)); initViews(); } @Override public void initViews() { } @Override public void bindTransaction(TransactionModel item) { } }
0635d852094e4929d0a282000de5a8a3446005af
b4bcad5e51423042f0e12ce0c17812e23851a417
/src/main/java/com/lhy/设计模式/D_J2EE模式/F拦截过滤器模式/步骤2/DebugFilter.java
5009058fabc98d485258c8451848524d7903d6d3
[]
no_license
l406608580/design-pattern
dc076b2de494e2dd357e719f29c85b4d00bced00
0453c1c311e1ad64f961b7712588d016315ce3be
refs/heads/master
2022-12-07T18:18:46.772765
2020-08-28T02:12:57
2020-08-28T02:12:57
290,926,164
1
0
null
null
null
null
UTF-8
Java
false
false
355
java
package com.lhy.设计模式.D_J2EE模式.F拦截过滤器模式.步骤2; import com.lhy.设计模式.D_J2EE模式.F拦截过滤器模式.步骤1.Filter; /** * @author hy.Li * @date 2020/8/25 15:12 */ public class DebugFilter implements Filter { public void execute(String request){ System.out.println("request log: " + request); } }
616575f75afe03a69cff4434965f89031e52c847
88e8ade32d1b9a2f4fac64de4364661f033a7e88
/src/com/sebastien/Location.java
d720de782473feaafa788bcfc9175a2839c07c9a
[]
no_license
SystematicSkid/JavaGame
b9ff558b54bc66c87d7107c2f9f55da354e5a6f6
67491d4dc56c99e3ff8290eee5c7f7b4a708a1cc
refs/heads/master
2020-04-12T01:52:39.279655
2018-12-20T15:29:51
2018-12-20T15:29:51
162,230,794
0
0
null
null
null
null
UTF-8
Java
false
false
2,048
java
package com.sebastien; import org.json.simple.parser.ParseException; import java.io.IOException; import java.util.ArrayList; import java.util.List; class LocationInfo { private Location m_Location; private String m_szAction; private String m_szActionDescription; private Encounter m_Encounter; private int m_iEnemies; private List<NPC> m_Bodies = new ArrayList<>(); boolean m_bDestroyed = false; public String GetAction() { return m_szAction; } public String GetDescription() { return m_szActionDescription; } Encounter GetEncounter() { return m_Encounter; } public Location GetLocation() { return m_Location; } LocationInfo(Location location) { m_szAction = "Action"; m_Location = location; m_iEnemies = ((Globals.GetLocalPlayer().GetStats().FindAttribute("mLevel").GetInt() > 3) ? 2 : 1); //m_Encounter = new Encounter(this); } void CreateEncounter() throws IOException, ParseException { if(!m_bDestroyed) { m_Encounter = new Encounter(this); Globals.SetIsInEncounter(true); } } void EndEncounter() { m_Encounter = null; m_bDestroyed = true; Globals.SetIsInEncounter(false); } List<NPC> GetBodies() {return m_Bodies; } int GetNumEnemies() { return m_iEnemies; } } class Location extends GameObject { private Race m_Owner; private LocationInfo m_Info; LocationInfo GetInfo() { return m_Info; } Race GetOwner() { return m_Owner; } public Location(String name) { super(); m_Owner = Util.GetRandomRace(); m_szName = name; m_Info = new LocationInfo(this); ShowText(); } public void ShowText() { System.out.print("\nAs you approach the town, you see a sign with the words " + GetName() + " scribbled on it...\nAs you look around you can see a lot of " + m_Owner.GetName() + "'s lingering around.\n"); } }
4fcab23dd5060b6f081597d6b1b0d304bd2c66bf
988a62954f778b218f08ad2afe96b836797436db
/app/src/main/java/com/rivetry/dealermanager/fragments/HomeFragment.java
b3a0f803cc8f872a51e3e12a5defe996a343cffe
[]
no_license
jmrigado/dealermanager
9bc81c2c4283a23a7c9c74a2b675cfe76cdda52f
8a7dfbc9c1e52cf40d383444fac73a1c65160bfa
refs/heads/master
2021-01-23T00:34:15.987523
2016-02-23T15:47:14
2016-02-23T15:47:14
47,858,912
0
0
null
null
null
null
UTF-8
Java
false
false
4,246
java
package com.rivetry.dealermanager.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.TextView; import com.rivetry.dealermanager.R; import com.rivetry.dealermanager.custom.IconButton; public class HomeFragment extends BaseFragment { private Button btnGameControls; private TextView btnCloseGameControls; private LinearLayout viewGameControls; private IconButton barCallButton; private IconButton chipsCallButton; private IconButton fsrCallButton; private IconButton securityCallButton; public HomeFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.fragment_home, container, false); viewGameControls = (LinearLayout) view.findViewById(R.id.viewGameControls); btnGameControls = (Button) view.findViewById(R.id.btnGameControls); btnCloseGameControls = (TextView) view.findViewById(R.id.btnCloseGameControls); btnGameControls.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showGameControlsPanel(); } }); barCallButton = (IconButton) view.findViewById(R.id.barCallButton); chipsCallButton = (IconButton) view.findViewById(R.id.chipsCallButton); fsrCallButton = (IconButton) view.findViewById(R.id.fsrCallButton); securityCallButton = (IconButton) view.findViewById(R.id.securityCallButton); btnCloseGameControls.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { hideGameControlsPanel(); } }); barCallButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { } else { } } }); chipsCallButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } }); fsrCallButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } }); securityCallButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } }); return view; } @Override public void onResume() { super.onResume(); } private void showGameControlsPanel() { final Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.bottom_up); anim.setDuration(500); viewGameControls.startAnimation(anim); btnGameControls.setVisibility(View.GONE); viewGameControls.setVisibility(View.VISIBLE); } private void hideGameControlsPanel() { final Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.bottom_down); anim.setDuration(500); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { viewGameControls.setVisibility(View.INVISIBLE); btnGameControls.setVisibility(View.VISIBLE); } @Override public void onAnimationRepeat(Animation animation) { } }); viewGameControls.startAnimation(anim); } }
08892c3deb67994665ff6482ad5b9054b3626a00
8e97abcffa37a8d38c05221be8d8c856bc260a43
/Day 10/Velocity.java
0a54cb91fa1c09731e4f3d7e581c8160aea16dee
[]
no_license
scottsquatch/adventofcode2018
da09b61d67fece1db15452e7961a705c2c92f985
d03a0ab4e9d9e91f0fa9edbd98fcd65aa5bbb845
refs/heads/master
2020-04-14T06:28:08.729243
2018-12-31T17:45:29
2018-12-31T17:45:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
public class Velocity { private int vx; private int vy; public Velocity(int vx, int vy) { this.vx = vx; this.vy = vy; } public int getVx() { return vx; } public int getVy() { return vy; } }
26124285bf55b4a035fd34bb2b901ce136d8b34f
0cdcf152510556e17bb26524732d55133a3b4a09
/core/src/lando/systems/ld44/world/backgrounds/TextureRegionParallaxLayer.java
0158bc15b247e0bf53624148f9162d5109d57b38
[]
no_license
bploeckelman/LudumDare44
2cc828ccab4c2158ad4bd992e39f8bcfda1a08dc
c6f11b5853549ac12a2cdbee22ef33bb52fc6c0f
refs/heads/master
2020-05-17T15:20:51.640834
2019-04-30T01:38:37
2019-04-30T01:38:37
183,787,270
0
0
null
null
null
null
UTF-8
Java
false
false
5,897
java
package lando.systems.ld44.world.backgrounds; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Vector2; import lando.systems.ld44.utils.Utils; public class TextureRegionParallaxLayer extends ParallaxLayer{ private TextureRegion texRegion; private float padLeft=0,padRight=0,padBottom=0,padTop=0; private float regionWidth,regionHeight; /** * Creates a TextureRegionParallaxLayer with regionWidth and regionHeight equal that of the texRegion. Paddings are set to 0. * @param texRegion the texture region * @param parallaxScrollRatio the parallax ratio in x and y direction */ public TextureRegionParallaxLayer(TextureRegion texRegion, Vector2 parallaxScrollRatio){ this.texRegion = texRegion; setRegionWidth(texRegion.getRegionWidth()); setRegionHeight(texRegion.getRegionHeight()); setParallaxRatio(parallaxScrollRatio); } /** * Creates a TextureRegionParallaxLayer with regionWidth and regionHeight equal to parameters width and height. Paddings are set to 0. * @param texRegion the texture region * @param regionWidth width to be used as regionWidth * @param regionHeight height to be used as regionHeight * @param parallaxScrollRatio the parallax ratio in x and y direction */ public TextureRegionParallaxLayer(TextureRegion texRegion, float regionWidth, float regionHeight, Vector2 parallaxScrollRatio){ this.texRegion = texRegion; setRegionWidth(regionWidth); setRegionHeight(regionHeight); setParallaxRatio(parallaxScrollRatio); } /** * Creates a TextureRegionParallaxLayer with either regionWidth or regionHeight equal oneDimen specified, while the other is calculated maintaining the aspect ratio of the region. Paddings are set to 0. * @param texRegion texRegion the texture region * @param oneDimen either regionWidth of regionHeight * @param parallaxScrollRatio the parallax ratio in x and y direction * @param wh what does oneDimen represent */ public TextureRegionParallaxLayer(TextureRegion texRegion, float oneDimen, Vector2 parallaxScrollRatio, Utils.WH wh){ this.texRegion = texRegion; switch(wh){ case width: setRegionWidth(oneDimen); setRegionHeight(Utils.calculateOtherDimension(Utils.WH.width, oneDimen, this.texRegion)); break; case height: setRegionHeight(oneDimen); setRegionWidth(Utils.calculateOtherDimension(Utils.WH.height, oneDimen, this.texRegion)); break; } setParallaxRatio(parallaxScrollRatio); } /** * draws the texture region at x y ,with left and bottom padding * <p> * You might be wondering that why are topPadding and rightPadding not used , what is their use then . Well they are used by ParallaxBackground when it renders this layer . During rendering it pings the {@link #getWidth()}/{@link #getHeight()} method of this layer which in {@link TextureRegionParallaxLayer} implementation return the sum of regionWidth/regionHeight and paddings. */ @Override public void draw(Batch batch, float x, float y) { batch.draw(texRegion, x+padLeft, y+padBottom, getRegionWidth(), getRegionHeight()); } /** * returns the width of this layer (regionWidth+padLeft+padRight) */ @Override public float getWidth() { return getPadLeft()+getRegionWidth()+getPadRight(); } /** * returns the height of this layer (regionHeight+padTop+padBottom) */ @Override public float getHeight() { return getPadTop()+getRegionHeight()+getPadBottom(); } /** * sets left right top bottom padding to same value * @param pad padding */ public void setAllPad(float pad){ setPadLeft(pad); setPadRight(pad); setPadTop(pad); setPadBottom(pad); } /** * returns texture region of this layer * @return texture region */ public TextureRegion getTexRegion() { return texRegion; } /** * get left padding * @return left padding */ public float getPadLeft() { return padLeft; } /** * sets the left padding * @param padLeft padding */ public void setPadLeft(float padLeft) { this.padLeft = padLeft; } /** * get right padding * @return right padding */ public float getPadRight() { return padRight; } /** * sets the right padding * @param padRight padding */ public void setPadRight(float padRight) { this.padRight = padRight; } /** * get bottom padding * @return bottom padding */ public float getPadBottom() { return padBottom; } /** * sets the bottom padding * @param padBottom padding */ public void setPadBottom(float padBottom) { this.padBottom = padBottom; } /** * get top padding * @return top padding */ public float getPadTop() { return padTop; } /** * sets the top padding * @param padTop padding */ public void setPadTop(float padTop) { this.padTop = padTop; } /** * return the region width of this layer * @return region width */ public float getRegionWidth() { return regionWidth; } /** * return the region height of this layer * @return region height */ public float getRegionHeight() { return regionHeight; } private void setRegionWidth(float width){ this.regionWidth = width; } private void setRegionHeight(float height){ this.regionHeight = height; } }
2be1248dec9acf83bd78fd03b31624a6e021cfa2
382c71c1df58305022089c06fff47abcdd0af1f9
/aula01/Exemplo02.java
39afc44e5b579fbdf8138f539a5e6659ea6407fc
[]
no_license
meirelene/gitMeire
97aebfbfb49a8f3ce4863c16c5c53a696b730fa0
22173c5f2b548408168c7003ae2fdf8194d0a051
refs/heads/master
2022-12-24T02:24:31.392608
2020-09-16T14:27:12
2020-09-16T14:27:12
296,046,838
0
0
null
null
null
null
UTF-8
Java
false
false
626
java
public class Exemplo02 { public static void main(String[] args) { System.out.println("1 + 2"); System.out.println(1 + 2); System.out.println("1 + 2 = " + 1 + 2); System.out.println("1 + 2 = " + (1 + 2)); //operadores matemáticos // + - * / System.out.println(2 + 3 * 5); System.out.println((2 + 3) * 5); // Alt + Shift + seta baixo : duplica linha // CTRL + F5 : Run //syso : System.out.println System.out.println( 10 / 2); System.out.println( 11 / 2); System.out.println( 11.0 / 2); } }
b882a54409cf36771d73c0976db2b90bd7b57d8f
daca8aa405dcd74356f5a6f8976dc33fc401bfb6
/src/DnsMessage.java
bf84a65a023b2ce0a16cbcb0092394848d3ff94b
[]
no_license
maximebedard/gti610-lab3
6523ce0b1bb57a912dfe2bc36f06690985cb7134
f301eda057414e931c7d61af5ff52176b26eebc5
refs/heads/master
2020-04-22T22:17:08.358665
2014-11-11T14:18:56
2014-11-11T14:18:56
26,037,540
0
1
null
null
null
null
UTF-8
Java
false
false
3,672
java
import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayList; /** * Created with IntelliJ IDEA. * User: Maxime * Date: 31/10/14 * Time: 16:08 * To change this template use File | Settings | File Templates. */ public class DnsMessage { private final short flags; private final int transactionId; private final int questionsCount; private final int answersCount; private final int authoritiesCount; private final int additionalCount; private final ArrayList<Question> questions; private final ArrayList<Answer> answers; public ArrayList<Question> getQuestions() { return questions; } public ArrayList<Answer> getAnswers() { return answers; } public DnsMessage(DataInputStream stream) throws IOException { transactionId = stream.readUnsignedShort(); flags = stream.readShort(); questionsCount = stream.readUnsignedShort(); answersCount = stream.readUnsignedShort(); authoritiesCount = stream.readUnsignedShort(); additionalCount = stream.readUnsignedShort(); questions = new ArrayList<Question>(); answers = new ArrayList<Answer>(); for(int i = 0; i < questionsCount; i++) { questions.add(new Question(stream)); } for(int i = 0; i < answersCount; i++) { answers.add(new Answer(stream)); } } public boolean isResponse() { return flags < 0; } public boolean isRequest() { return !(flags < 0); } private String parseVariableString(DataInputStream stream) throws IOException { String temp = ""; byte cb; while((cb = stream.readByte()) != 0x00){ byte length = cb; for(byte i = 0; i < length; i++){ cb = stream.readByte(); temp += (char)cb; } temp += "."; } return temp.substring(0,temp.length()-1); } public int getTransactionId() { return transactionId; } class Question { String getName() { return name; } int getType() { return type; } int getKlass() { return klass; } private final String name; private final int type; private final int klass; public Question(DataInputStream stream) throws IOException { name = parseVariableString(stream); type = stream.readUnsignedShort(); klass = stream.readUnsignedShort(); } } class Answer { private final int[] rdData; private final int name; private final int type; private final int klass; private final int ttl; private final int rdLength; public Answer(DataInputStream stream) throws IOException { name = stream.readUnsignedShort(); type = stream.readUnsignedShort(); klass = stream.readUnsignedShort(); ttl = stream.readInt(); rdLength = stream.readUnsignedShort(); rdData = new int[rdLength]; for(int i = 0; i < rdLength; i++) { rdData[i] = stream.readUnsignedByte(); } } public String getAddress(){ assert(rdData.length == 4); return String.format("%d.%d.%d.%d", rdData[0], rdData[1], rdData[2], rdData[3]); } } private void toHex(byte b){ StringBuilder sb = new StringBuilder(); sb.append(String.format("%02X ", b)); System.out.print(sb.toString() + " "); } }
ade63b448757c01989477a8c4a5f424cbbcc90e7
a1a46251687b32a390caedc80d1a814e4787e008
/documents/第三循环/原型4.15/Client/src/view/mainFrame.java
76c6ed1ec96c4a2c259686017aed832d78ad61f1
[]
no_license
liveangel-js/TeleconferencePlatform
e78518074ded5e029085a79da443dd34e768b51a
ab76aa7b74528e04410c708f5fe5addee07d5ada
refs/heads/master
2021-01-25T10:43:40.215036
2014-02-24T06:30:20
2014-02-24T06:30:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,354
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * mainFrame.java * * Created on 2012-4-14, 13:14:00 */ package ui; /** * * @author Gyx */ public class mainFrame extends javax.swing.JFrame { /** Creates new form mainFrame */ public mainFrame() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { MeetingControlPanel = new javax.swing.JPanel(); WhiteBoard = new javax.swing.JPanel(); ChattingPanel = new javax.swing.JPanel(); OrderPanel = new javax.swing.JPanel(); VoiceChatPanel = new javax.swing.JPanel(); DrawTools = new javax.swing.JPanel(); OnlineMembers = new javax.swing.JPanel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout MeetingControlPanelLayout = new javax.swing.GroupLayout(MeetingControlPanel); MeetingControlPanel.setLayout(MeetingControlPanelLayout); MeetingControlPanelLayout.setHorizontalGroup( MeetingControlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 453, Short.MAX_VALUE) ); MeetingControlPanelLayout.setVerticalGroup( MeetingControlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 50, Short.MAX_VALUE) ); javax.swing.GroupLayout WhiteBoardLayout = new javax.swing.GroupLayout(WhiteBoard); WhiteBoard.setLayout(WhiteBoardLayout); WhiteBoardLayout.setHorizontalGroup( WhiteBoardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 449, Short.MAX_VALUE) ); WhiteBoardLayout.setVerticalGroup( WhiteBoardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) ); javax.swing.GroupLayout ChattingPanelLayout = new javax.swing.GroupLayout(ChattingPanel); ChattingPanel.setLayout(ChattingPanelLayout); ChattingPanelLayout.setHorizontalGroup( ChattingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 126, Short.MAX_VALUE) ); ChattingPanelLayout.setVerticalGroup( ChattingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 277, Short.MAX_VALUE) ); javax.swing.GroupLayout OrderPanelLayout = new javax.swing.GroupLayout(OrderPanel); OrderPanel.setLayout(OrderPanelLayout); OrderPanelLayout.setHorizontalGroup( OrderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 126, Short.MAX_VALUE) ); OrderPanelLayout.setVerticalGroup( OrderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 149, Short.MAX_VALUE) ); javax.swing.GroupLayout VoiceChatPanelLayout = new javax.swing.GroupLayout(VoiceChatPanel); VoiceChatPanel.setLayout(VoiceChatPanelLayout); VoiceChatPanelLayout.setHorizontalGroup( VoiceChatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 393, Short.MAX_VALUE) ); VoiceChatPanelLayout.setVerticalGroup( VoiceChatPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 63, Short.MAX_VALUE) ); javax.swing.GroupLayout DrawToolsLayout = new javax.swing.GroupLayout(DrawTools); DrawTools.setLayout(DrawToolsLayout); DrawToolsLayout.setHorizontalGroup( DrawToolsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); DrawToolsLayout.setVerticalGroup( DrawToolsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); javax.swing.GroupLayout OnlineMembersLayout = new javax.swing.GroupLayout(OnlineMembers); OnlineMembers.setLayout(OnlineMembersLayout); OnlineMembersLayout.setHorizontalGroup( OnlineMembersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); OnlineMembersLayout.setVerticalGroup( OnlineMembersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 162, Short.MAX_VALUE) ); jMenu1.setText("File"); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(105, 105, 105) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addComponent(MeetingControlPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37)) .addGroup(layout.createSequentialGroup() .addComponent(VoiceChatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(41, 41, 41)) .addGroup(layout.createSequentialGroup() .addComponent(WhiteBoard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(OrderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ChattingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(DrawTools, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(OnlineMembers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(ChattingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(OrderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(MeetingControlPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(18, 18, 18) .addComponent(WhiteBoard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31) .addComponent(VoiceChatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(36, 36, 36) .addComponent(DrawTools, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(74, 74, 74) .addComponent(OnlineMembers, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(mainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new mainFrame().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel ChattingPanel; private javax.swing.JPanel DrawTools; private javax.swing.JPanel MeetingControlPanel; private javax.swing.JPanel OnlineMembers; private javax.swing.JPanel OrderPanel; private javax.swing.JPanel VoiceChatPanel; private javax.swing.JPanel WhiteBoard; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; // End of variables declaration//GEN-END:variables }
21a50d485fdcd15efaddea4011349c857815dd4b
43db367eb6ada48dd6d4aadd442fbf87e84fe752
/springjdbc-batch-update/src/main/java/jbr/springjdbc/dao/CityDaoImpl.java
1d5edbdc88a065cb37a931e617fa5c110b85d37c
[]
no_license
javabyranjith/spring-framework-jdbc
d1f725563d2cbd1996d6c6647e52089eb4ba203f
42efaac02b63f167eb792c874dc755aa51440081
refs/heads/master
2022-12-20T15:46:40.633711
2020-05-15T15:37:36
2020-05-15T15:37:36
65,965,998
1
2
null
2022-12-16T05:11:12
2016-08-18T04:49:06
TSQL
UTF-8
Java
false
false
3,620
java
package jbr.springjdbc.dao; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BatchPreparedStatementSetter; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.ParameterizedPreparedStatementSetter; import org.springframework.jdbc.core.PreparedStatementSetter; import org.springframework.stereotype.Repository; import jbr.springjdbc.model.City; @Repository public class CityDaoImpl implements CityDao { private static final Logger log = Logger.getLogger(CityDaoImpl.class); @Autowired JdbcTemplate jdbcTemplate; @Override public int insert(List<City> cities) { log.info("insert - started"); long start = System.currentTimeMillis(); String sql = "INSERT INTO city VALUES (?,?,?,?,?,?)"; int[] result = jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() { @Override public void setValues(PreparedStatement ps, int i) throws SQLException { ps.setString(1, cities.get(i).getName()); ps.setString(2, cities.get(i).getLatitude()); ps.setString(3, cities.get(i).getLongitude()); ps.setString(4, cities.get(i).getCountry()); ps.setString(5, cities.get(i).getState()); ps.setString(6, cities.get(i).getPopulation()); } @Override public int getBatchSize() { return cities.size(); } }); log.info(result.length + " insert - Execution time: " + (System.currentTimeMillis() - start) + " ms"); log.info("insert - completed"); return result.length; } @Override public int insertBatch(List<City> cities, int batchSize) { log.info("insertBatch - started"); long start = System.currentTimeMillis(); String sql = "INSERT INTO city VALUES (?,?,?,?,?,?)"; int[][] count = jdbcTemplate.batchUpdate(sql, cities, batchSize, new ParameterizedPreparedStatementSetter<City>() { @Override public void setValues(PreparedStatement ps, City city) throws SQLException { ps.setString(1, city.getName()); ps.setString(2, city.getLatitude()); ps.setString(3, city.getLongitude()); ps.setString(4, city.getCountry()); ps.setString(5, city.getState()); ps.setString(6, city.getPopulation()); } }); log.info(count.length + " insertBatch - Execution time: " + (System.currentTimeMillis() - start) + " ms"); log.info("insertBatch - completed."); return count.length; } @Override public int update(List<City> cities) { return 0; } @Override public int[][] updateBatch(List<City> cities, int batchSize) { return null; } @Override public void add(List<City> cities) { long start = System.currentTimeMillis(); String sql = "INSERT INTO city VALUES (?,?,?,?,?,?)"; cities.forEach(city -> jdbcTemplate.update(sql, new PreparedStatementSetter() { @Override public void setValues(PreparedStatement ps) throws SQLException { ps.setString(1, city.getName()); ps.setString(2, city.getLatitude()); ps.setString(3, city.getLongitude()); ps.setString(4, city.getCountry()); ps.setString(5, city.getState()); ps.setString(6, city.getPopulation()); } })); log.info("Execution time: " + (System.currentTimeMillis() - start) + " ms"); } @Override public void flush() { log.info("flush - started"); jdbcTemplate.execute("delete from city"); log.info("flush - completed"); } }
3969e2b63a2594431b427b81c1fa98ba3df27e02
856ff25364f49163974626ce44ea281b91984f84
/Day3/src/array_1_10.java
7f3d37e1652cd308fe7f36c0b6d78f5d622ed641
[]
no_license
akromibn37/My_java_project
8269208cbce6e7bb6a5be047a9804bc3c7dd3066
7a25a8f92d1454d39b74235286cf1b4536b918b2
refs/heads/master
2020-03-21T22:50:32.837059
2018-06-29T13:33:47
2018-06-29T13:33:47
139,150,661
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
import java.util.Scanner; public class array_1_10 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int[] x = new int[10]; int count = 0; int min = Integer.MAX_VALUE; for (int i = 0; i < x.length; i++) { System.out.print("Please input a number: "); x[i] = sc.nextInt(); if (min > x[i]) { min = x[i]; } } System.out.println(min); } }
5b1a12a9d01ae915de0bae361d4c97f941465aca
dcf2c7f041b5f63d4cafdb33a823f92e9c49e890
/sentiment/src/main/java/com/cidd/sentiment/config/WebMvcConfig.java
4b78449beaff103fbb0128def1e86db71dbcf177
[]
no_license
cidd04/ciddapp
2ebb9ec7ae160f37ca1dd83866d5f8d0ec644fe1
48941b45542e27901730ba48d4592a06330fb0f7
refs/heads/master
2016-09-13T23:23:01.382393
2016-05-15T14:03:16
2016-05-15T14:03:16
56,981,030
0
0
null
null
null
null
UTF-8
Java
false
false
3,810
java
package com.cidd.sentiment.config; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ReloadableResourceBundleMessageSource; import org.springframework.stereotype.Controller; import org.springframework.validation.Validator; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.servlet.view.tiles3.TilesConfigurer; import org.springframework.web.servlet.view.tiles3.TilesViewResolver; import com.cidd.sentiment.Application; @Configuration @ComponentScan(basePackageClasses = Application.class, includeFilters = @Filter(Controller.class), useDefaultFilters = false) public class WebMvcConfig extends WebMvcConfigurationSupport { private static final String MESSAGE_SOURCE = "/WEB-INF/i18n/messages"; private static final String TILES = "/WEB-INF/tiles/tiles.xml"; private static final String VIEWS = "/WEB-INF/views/**/views.xml"; private static final String RESOURCES_LOCATION = "/resources/"; private static final String RESOURCES_HANDLER = RESOURCES_LOCATION + "**"; @Override public RequestMappingHandlerMapping requestMappingHandlerMapping() { RequestMappingHandlerMapping requestMappingHandlerMapping = super.requestMappingHandlerMapping(); requestMappingHandlerMapping.setUseSuffixPatternMatch(false); requestMappingHandlerMapping.setUseTrailingSlashMatch(false); return requestMappingHandlerMapping; } @Bean(name = "messageSource") public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename(MESSAGE_SOURCE); messageSource.setCacheSeconds(5); return messageSource; } @Bean public TilesViewResolver configureTilesViewResolver() { return new TilesViewResolver(); } @Bean public TilesConfigurer configureTilesConfigurer() { TilesConfigurer configurer = new TilesConfigurer(); configurer.setDefinitions(new String[] { TILES, VIEWS }); return configurer; } @Bean public CommonsMultipartResolver multipartResolver() { CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver(); commonsMultipartResolver.setDefaultEncoding("utf-8"); commonsMultipartResolver.setMaxUploadSize(50000000); return commonsMultipartResolver; } @Override public Validator getValidator() { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.setValidationMessageSource(messageSource()); return validator; } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler(RESOURCES_HANDLER).addResourceLocations(RESOURCES_LOCATION); } @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } /** * Handles favicon.ico requests assuring no <code>404 Not Found</code> error * is returned. */ @Controller static class FaviconController { @RequestMapping("favicon.ico") String favicon() { return "forward:/resources/images/favicon.ico"; } } }
f7f7d6a819dc01ee883f9909630ae40c61b7b4f8
c94e8a59770bec19f22cec3f6d8c1c611046fd1e
/app/src/main/java/shubhamjha33/sunshine/app/DetailFragment.java
e0ec3b64b0f588ccfc22e07d01471a89ede37ebd
[]
no_license
shubhamjha33/MySunshineApp
c7615c14b30b4513d85829e9fc815061be063de2
fc0eb99c948090191253827ec2e33f3124fc92b7
refs/heads/master
2021-01-17T18:04:57.224380
2016-06-12T07:55:55
2016-06-12T07:55:55
60,953,744
0
0
null
null
null
null
UTF-8
Java
false
false
6,889
java
package shubhamjha33.sunshine.app; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.ShareActionProvider; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import shubhamjha33.sunshine.app.data.WeatherContract; /** * A placeholder fragment containing a simple view. */ public class DetailFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor>{ private static String mForecastStr; private static ShareActionProvider mShareActionProvider; private static Intent mShareIntent; private static ViewHolder mViewHolder; private static Uri mUri; private static int DETAIL_ID=101; void onLocationChanged( String newLocation ) { // replace the uri, since the location has changed Uri uri = mUri; if (null != uri) { long date = WeatherContract.WeatherEntry.getDateFromUri(uri); Uri updatedUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date); mUri = updatedUri; getLoaderManager().restartLoader(DETAIL_ID, null, this); } } public static class ViewHolder { public final ImageView iconView; public final TextView dateView; public final TextView descriptionView; public final TextView highTempView; public final TextView lowTempView; public final TextView dayView; public final TextView humidityView; public final TextView pressureView; public final TextView windView; public ViewHolder(View view) { iconView = (ImageView) view.findViewById(R.id.detail_icon); dateView = (TextView) view.findViewById(R.id.detail_date_textview); descriptionView = (TextView) view.findViewById(R.id.detail_forecast_textview); highTempView = (TextView) view.findViewById(R.id.detail_high_textview); lowTempView = (TextView) view.findViewById(R.id.detail_low_textview); dayView = (TextView) view.findViewById(R.id.detail_day_textview); humidityView=(TextView)view.findViewById(R.id.detail_humidity_textview); pressureView=(TextView)view.findViewById(R.id.detail_pressure_textview); windView=(TextView)view.findViewById(R.id.detail_wind_textview); } } public DetailFragment() { } @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setHasOptionsMenu(true); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_detail, menu); MenuItem menuItem=menu.findItem(R.id.action_share); mShareActionProvider=(ShareActionProvider) MenuItemCompat.getActionProvider(menuItem); mShareIntent=new Intent(Intent.ACTION_SEND); mShareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); mShareIntent.setType("text/plain"); mShareIntent.putExtra(Intent.EXTRA_TEXT,mForecastStr + " #SunshineApp"); mShareActionProvider.setShareIntent(mShareIntent); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId()==R.id.action_settings){ Intent intent=new Intent(getActivity(),SettingsActivity.class); startActivity(intent); return true; } else if(item.getItemId()==R.id.action_share){ startActivity(mShareIntent); return true; } return super.onOptionsItemSelected(item); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView=inflater.inflate(R.layout.fragment_detail, container, false); mViewHolder=new ViewHolder(rootView); getLoaderManager().initLoader(DETAIL_ID, null,this); return rootView; } @Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { Log.v("TabDebug","In onCreateLoader"); Intent intent=getActivity().getIntent(); if(intent==null) return null; mForecastStr=intent.getDataString(); Log.v("TabDebug",mForecastStr); return new CursorLoader(getContext(),Uri.parse(mForecastStr),WeatherContract.FORECAST_COLUMNS,null,null,null); } @Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { Log.v("TabDebug","Loading of data finished"); if(data!=null&&data.moveToFirst()){ Log.v("TabDebug","Updating view"); mViewHolder.dayView.setText(Utility.getDayName(getActivity(),data.getLong(WeatherContract.COL_WEATHER_DATE))); String dateString=Utility.getFormattedMonthDay(getActivity(), data.getLong(WeatherContract.COL_WEATHER_DATE)); mViewHolder.dateView.setText(dateString); String weatherString=data.getString(WeatherContract.COL_WEATHER_DESC); mViewHolder.descriptionView.setText(weatherString); boolean isMetric=Utility.isMetric(getActivity()); String high=Utility.formatTemperature(getContext(), data.getDouble(WeatherContract.COL_WEATHER_MAX_TEMP), isMetric); String low=Utility.formatTemperature(getContext(),data.getDouble(WeatherContract.COL_WEATHER_MIN_TEMP),isMetric); mViewHolder.highTempView.setText(high); mViewHolder.lowTempView.setText(low); int weatherConditionId=data.getInt(WeatherContract.COL_WEATHER_CONDITION_ID); mViewHolder.iconView.setImageResource(Utility.getArtResourceForWeatherCondition(weatherConditionId)); mViewHolder.pressureView.setText(getContext().getString(R.string.format_pressure,data.getDouble(WeatherContract.COL_PRESSURE))); int windSpeedFormat=R.string.format_wind_mph; if(isMetric){ windSpeedFormat=R.string.format_wind_kmh; } mViewHolder.windView.setText(Utility.getFormattedWind(getActivity(),data.getFloat(WeatherContract.COL_WIND_SPEED),data.getFloat(WeatherContract.COL_DEGREES))); mViewHolder.humidityView.setText(getContext().getString(R.string.format_humidity,data.getDouble(WeatherContract.COL_HUMIDITY))); } } @Override public void onLoaderReset(Loader<Cursor> loader) { } }
f4e85bd608954a47b129fbed81d3049e189769ce
c3f27897b5659345ed6018148b0313eb0f74f80a
/1-Two-Sum/solution.java
b6854edfe844f73272c08e12fc590a52dc1ed8d8
[]
no_license
benjiyue/PersonalProjects
a4dd56b3ecc83fac5d1a1800a01dc0b812c851ef
df0b6e5f14526fb5352e2a5f81d656f86ddfebe4
refs/heads/master
2021-01-19T05:01:09.694868
2016-12-26T15:35:00
2016-12-26T15:35:00
66,719,098
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
public class Solution { public int[] twoSum(int[] nums, int target) { /* use a map to record the conjugate value and the current index. when we see something in the map then return the other index */ Map<Integer, Integer> map = new HashMap(); for(int i=0;i<nums.length;i++){ if(map.containsKey(nums[i])){ int[] res = new int[2]; res[0] = map.get(nums[i]); res[1] = i; return res; } map.put(target-nums[i], i); } return new int[]{}; } }
e134825b89a4de79ae6b34c012ecce31e080ce52
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/xiaomi/mipush/sdk/u.java
3293a38501c3718a6e6d3b56a5da93779acbb6cf
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
2,182
java
package com.xiaomi.mipush.sdk; import android.content.Context; import com.xiaomi.a.a.a.c; import com.xiaomi.push.aa; import com.xiaomi.push.ce; import com.xiaomi.push.jg; import java.io.File; import java.util.HashMap; final class u implements Runnable { final /* synthetic */ Context a; /* renamed from: a reason: collision with other field name */ final /* synthetic */ boolean f160a; u(Context context, boolean z) { this.a = context; this.f160a = z; } /* JADX WARNING: Removed duplicated region for block: B:25:0x0097 */ /* JADX WARNING: Removed duplicated region for block: B:29:? A[ADDED_TO_REGION, RETURN, SYNTHETIC] */ @Override // java.lang.Runnable public void run() { File file; Throwable th; String str; File file2 = null; try { HashMap<String, String> a2 = ac.a(this.a, ""); if (this.f160a) { str = this.a.getFilesDir().getAbsolutePath(); } else { str = this.a.getExternalFilesDir(null).getAbsolutePath() + ce.a; } File logFile = Logger.getLogFile(str); if (logFile == null) { c.a("log file null"); return; } file = new File(str, this.a.getPackageName() + ".zip"); try { jg.a(file, logFile); if (file.exists()) { aa.a((this.f160a ? "https://api.xmpush.xiaomi.com/upload/xmsf_log?file=" : "https://api.xmpush.xiaomi.com/upload/app_log?file=") + file.getName(), a2, file, "file"); } else { c.a("zip log file failed"); } } catch (Throwable th2) { th = th2; file2 = file; c.a(th); file = file2; if (file == null) { } } if (file == null && file.exists()) { file.delete(); } } catch (Throwable th3) { th = th3; c.a(th); file = file2; if (file == null) { } } } }
ff077db34f1f7452e08a84f8d6311daee7efab19
3a1d26e89356edfc6b542b04a528a91ca7265a12
/app/build/generated/source/r/debug/android/support/mediacompat/R.java
7b2d4b627f95fd8a8df5a09fc6e2399e6f0bc32e
[ "Apache-2.0" ]
permissive
roxanamacarie/PracticalTest01Var01
bde4609fa79abfe2a06fc206fe0691814444b0a1
d2acc1cfc3f36a51e2f83417af04efd0c720bbd5
refs/heads/master
2020-03-08T04:37:35.222225
2018-04-03T16:27:35
2018-04-03T16:27:35
127,927,520
0
0
null
null
null
null
UTF-8
Java
false
false
9,442
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.mediacompat; public final class R { public static final class attr { public static final int font = 0x7f020070; public static final int fontProviderAuthority = 0x7f020072; public static final int fontProviderCerts = 0x7f020073; public static final int fontProviderFetchStrategy = 0x7f020074; public static final int fontProviderFetchTimeout = 0x7f020075; public static final int fontProviderPackage = 0x7f020076; public static final int fontProviderQuery = 0x7f020077; public static final int fontStyle = 0x7f020078; public static final int fontWeight = 0x7f020079; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f030000; } public static final class color { public static final int notification_action_color_filter = 0x7f04003e; public static final int notification_icon_bg_color = 0x7f04003f; public static final int notification_material_background_media_default_color = 0x7f040040; public static final int primary_text_default_material_dark = 0x7f040045; public static final int ripple_material_light = 0x7f04004a; public static final int secondary_text_default_material_dark = 0x7f04004b; public static final int secondary_text_default_material_light = 0x7f04004c; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f05004a; public static final int compat_button_inset_vertical_material = 0x7f05004b; public static final int compat_button_padding_horizontal_material = 0x7f05004c; public static final int compat_button_padding_vertical_material = 0x7f05004d; public static final int compat_control_corner_material = 0x7f05004e; public static final int notification_action_icon_size = 0x7f050058; public static final int notification_action_text_size = 0x7f050059; public static final int notification_big_circle_margin = 0x7f05005a; public static final int notification_content_margin_start = 0x7f05005b; public static final int notification_large_icon_height = 0x7f05005c; public static final int notification_large_icon_width = 0x7f05005d; public static final int notification_main_column_padding_top = 0x7f05005e; public static final int notification_media_narrow_margin = 0x7f05005f; public static final int notification_right_icon_size = 0x7f050060; public static final int notification_right_side_padding_top = 0x7f050061; public static final int notification_small_icon_background_padding = 0x7f050062; public static final int notification_small_icon_size_as_large = 0x7f050063; public static final int notification_subtext_size = 0x7f050064; public static final int notification_top_pad = 0x7f050065; public static final int notification_top_pad_large_text = 0x7f050066; } public static final class drawable { public static final int notification_action_background = 0x7f060056; public static final int notification_bg = 0x7f060057; public static final int notification_bg_low = 0x7f060058; public static final int notification_bg_low_normal = 0x7f060059; public static final int notification_bg_low_pressed = 0x7f06005a; public static final int notification_bg_normal = 0x7f06005b; public static final int notification_bg_normal_pressed = 0x7f06005c; public static final int notification_icon_background = 0x7f06005d; public static final int notification_template_icon_bg = 0x7f06005e; public static final int notification_template_icon_low_bg = 0x7f06005f; public static final int notification_tile_bg = 0x7f060060; public static final int notify_panel_notification_icon_bg = 0x7f060061; } public static final class id { public static final int action0 = 0x7f070006; public static final int action_container = 0x7f07000e; public static final int action_divider = 0x7f070010; public static final int action_image = 0x7f070011; public static final int action_text = 0x7f070017; public static final int actions = 0x7f070018; public static final int async = 0x7f07001e; public static final int blocking = 0x7f070021; public static final int cancel_action = 0x7f070025; public static final int chronometer = 0x7f070028; public static final int end_padder = 0x7f070033; public static final int forever = 0x7f070036; public static final int icon = 0x7f07003a; public static final int icon_group = 0x7f07003b; public static final int info = 0x7f07003e; public static final int italic = 0x7f07003f; public static final int line1 = 0x7f070040; public static final int line3 = 0x7f070041; public static final int media_actions = 0x7f070044; public static final int normal = 0x7f07004c; public static final int notification_background = 0x7f07004d; public static final int notification_main_column = 0x7f07004e; public static final int notification_main_column_container = 0x7f07004f; public static final int right_icon = 0x7f070057; public static final int right_side = 0x7f070058; public static final int status_bar_latest_event_content = 0x7f070074; public static final int text = 0x7f070078; public static final int text2 = 0x7f070079; public static final int time = 0x7f07007c; public static final int title = 0x7f07007d; } public static final class integer { public static final int cancel_button_image_alpha = 0x7f080002; public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { public static final int notification_action = 0x7f09001d; public static final int notification_action_tombstone = 0x7f09001e; public static final int notification_media_action = 0x7f09001f; public static final int notification_media_cancel_action = 0x7f090020; public static final int notification_template_big_media = 0x7f090021; public static final int notification_template_big_media_custom = 0x7f090022; public static final int notification_template_big_media_narrow = 0x7f090023; public static final int notification_template_big_media_narrow_custom = 0x7f090024; public static final int notification_template_custom_big = 0x7f090025; public static final int notification_template_icon_group = 0x7f090026; public static final int notification_template_lines_media = 0x7f090027; public static final int notification_template_media = 0x7f090028; public static final int notification_template_media_custom = 0x7f090029; public static final int notification_template_part_chronometer = 0x7f09002a; public static final int notification_template_part_time = 0x7f09002b; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0b0021; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0c00fa; public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00fb; public static final int TextAppearance_Compat_Notification_Info_Media = 0x7f0c00fc; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00fd; public static final int TextAppearance_Compat_Notification_Line2_Media = 0x7f0c00fe; public static final int TextAppearance_Compat_Notification_Media = 0x7f0c00ff; public static final int TextAppearance_Compat_Notification_Time = 0x7f0c0100; public static final int TextAppearance_Compat_Notification_Time_Media = 0x7f0c0101; public static final int TextAppearance_Compat_Notification_Title = 0x7f0c0102; public static final int TextAppearance_Compat_Notification_Title_Media = 0x7f0c0103; public static final int Widget_Compat_NotificationActionContainer = 0x7f0c016b; public static final int Widget_Compat_NotificationActionText = 0x7f0c016c; } public static final class styleable { public static final int[] FontFamily = { 0x7f020072, 0x7f020073, 0x7f020074, 0x7f020075, 0x7f020076, 0x7f020077 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x7f020070, 0x7f020078, 0x7f020079 }; public static final int FontFamilyFont_font = 0; public static final int FontFamilyFont_fontStyle = 1; public static final int FontFamilyFont_fontWeight = 2; } }
809fc237c3e9899ab3b1b07896ec76390e4bee56
3b91ed788572b6d5ac4db1bee814a74560603578
/com/tencent/mm/plugin/wallet_core/ui/WalletOrderInfoOldUI$5.java
7c2f4c105bdc06aa5e215569dabba5a012a383df
[]
no_license
linsir6/WeChat_java
a1deee3035b555fb35a423f367eb5e3e58a17cb0
32e52b88c012051100315af6751111bfb6697a29
refs/heads/master
2020-05-31T05:40:17.161282
2018-08-28T02:07:02
2018-08-28T02:07:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,394
java
package com.tencent.mm.plugin.wallet_core.ui; import com.tencent.mm.g.a.tb; import com.tencent.mm.plugin.wallet_core.id_verify.util.RealnameGuideHelper; import com.tencent.mm.sdk.b.b; import com.tencent.mm.sdk.b.c; import com.tencent.mm.sdk.platformtools.x; class WalletOrderInfoOldUI$5 extends c<tb> { final /* synthetic */ WalletOrderInfoOldUI pwD; WalletOrderInfoOldUI$5(WalletOrderInfoOldUI walletOrderInfoOldUI) { this.pwD = walletOrderInfoOldUI; this.sFo = tb.class.getName().hashCode(); } public final /* synthetic */ boolean a(b bVar) { tb tbVar = (tb) bVar; if (!(tbVar instanceof tb)) { return false; } if (!tbVar.ceA.ceB.lKP) { x.i("MicroMsg.WalletOrderInfoOldUI", "block pass"); return true; } else if (!"1".equals(tbVar.ceA.ceB.ced) && !"2".equals(tbVar.ceA.ceB.ced)) { return false; } else { RealnameGuideHelper realnameGuideHelper = new RealnameGuideHelper(); realnameGuideHelper.a(tbVar.ceA.ceB.ced, tbVar.ceA.ceB.cee, tbVar.ceA.ceB.cef, tbVar.ceA.ceB.ceg, tbVar.ceA.ceB.ceh, this.pwD.mCn == null ? 0 : this.pwD.mCn.bVY); x.i("MicroMsg.WalletOrderInfoOldUI", "receive guide"); this.pwD.sy.putParcelable("key_realname_guide_helper", realnameGuideHelper); return false; } } }
346c33641b7edc0ac9e5bdd9b32b6183cf952bfd
5b9235d8505ba545159b35021c092a62bf75d338
/src/main/java/com/dummy/cdi/events/beans/EventConsumerBean.java
5c5c4b669d4de02205bb0b0140dba0b9ece9a2a5
[]
no_license
cirix/cdi-events
befffed75f66b1c6f19fd04454d5ba45132344a3
1568072975a0593845b93146b65cc3201ef5d01b
refs/heads/master
2022-09-16T03:05:27.491994
2015-04-26T13:52:44
2015-04-26T13:52:44
34,700,574
1
0
null
2022-08-27T17:56:55
2015-04-28T01:24:46
Java
UTF-8
Java
false
false
1,504
java
package com.dummy.cdi.events.beans; import com.dummy.cdi.events.payload.ServiceInstance; import com.dummy.cdi.events.payload.deployers.Deployer; import com.dummy.cdi.events.zookeeper.ZookeeperService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.ejb.Stateless; import javax.enterprise.event.Observes; import javax.inject.Inject; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; @Stateless(name="eventConsumer") public class EventConsumerBean implements Serializable{ private static final long serialVersionUID = 4775947387215201659L; private static final Logger logger = LoggerFactory.getLogger(EventConsumerBean.class); @Inject private ZookeeperService zookeeperService; /** * The observer method for registration requests. * @param serviceInstance : The instance data to save in Zookeeper. */ public void onRegisterEvent(@Observes ServiceInstance serviceInstance) { try { ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(serviceInstance.getData())); Deployer deployer = (Deployer)objectInputStream.readObject(); logger.info("Object read:{}",deployer.toString()); zookeeperService.getMasterEnsemble(serviceInstance.getEndpoint()); } catch (IOException | ClassNotFoundException e) { logger.error("Failed to do stuff:{}",e); } } }
c0613d78851a65a466eeeae93d03c99dd677e01e
458b3ef30184e0436831833255729c42334f808b
/app/src/main/java/com/marasm/cm_romhelper/worker/CmLedSettingsRestoreTask.java
24d22a5a9b5095f80045e70a1a39c77f38dac943
[ "MIT" ]
permissive
marasm/CM-Rom-Helper
0ef2e9f557ec1715697607b11ce0296204d26b68
9a7abb0fb24540f33fbea952d693bdf1c9bdf991
refs/heads/master
2021-01-01T04:25:13.976091
2016-05-01T07:30:46
2016-05-01T07:30:46
56,521,839
0
0
null
null
null
null
UTF-8
Java
false
false
2,220
java
package com.marasm.cm_romhelper.worker; import android.content.Context; import android.util.Log; import com.marasm.cm_romhelper.constants.Constants; import com.marasm.cm_romhelper.dataaccess.LedNotificationSettingsDAO; import com.marasm.cm_romhelper.valueobjects.TaskResultsVO; import java.util.List; import java.util.Map; import eu.chainfire.libsuperuser.Shell; /** * Created by mkorotkovas on 5/1/16. */ public class CmLedSettingsRestoreTask extends AbstractTask { private final String TAG = this.getClass().getSimpleName(); private Context context; public CmLedSettingsRestoreTask(Context inContext) { context = inContext; } @Override public TaskResultsVO executeTask() { TaskResultsVO res = new TaskResultsVO(); try { Map<String, String> settingsMap = getLedNotificationsSettingsDAO().getLedNotificationSettings(); if (!settingsMap.isEmpty()) { Log.d(TAG, "Found settings backed up earlier"); for (Map.Entry<String, String> entry : settingsMap.entrySet()) { //delete setting first Log.d(TAG, "clearing setting " + entry.getKey()); List<String> out = Shell.SU.run("sqlite3 " + Constants.CM_SETTINGS_DB_FILE + " \"DELETE FROM system WHERE name = '" + entry.getKey() +"'\""); Log.d(TAG, "DELETE cmd output: " + out); //insert new value Log.d(TAG, "inserting property " + entry.getKey() + "=" + entry.getValue()); out = Shell.SU.run("sqlite3 " + Constants.CM_SETTINGS_DB_FILE + " \"INSERT INTO system (name, value) VALUES ('" + entry.getKey() +"', '"+ entry.getValue() +"') \""); Log.d(TAG, "INSERT cmd output: " + out); } res.setIsSuccessful(true); } else { throw new RuntimeException("Settings backup was not found"); } } catch (Exception e) { Log.e(TAG, "Error while restoring LED settings" + e.getMessage(), e); res.setIsSuccessful(false); res.setErrorMsg(e.getMessage()); } return res; } protected LedNotificationSettingsDAO getLedNotificationsSettingsDAO() { return new LedNotificationSettingsDAO(context); } }
1c5d2d4d5be1531a0986099b3280ebd49a74557a
c8c2b102fe4b9e125d998877c2f66b396d4d039a
/m/MindBody/src/main/java/integration/mindbody/GetClientContractsRequest.java
0fdbaa0a26e2fb71004aa41b6294ff1f1c3b666b
[ "BSD-2-Clause" ]
permissive
SergiiShapoval/hyperjaxb3-support
740521da5f8197566809ccbbd5888df47065bf04
abfbc145aae9363bcc75623f1885037d788dfcee
refs/heads/master
2020-12-25T10:59:42.540051
2015-03-18T21:26:21
2015-03-18T21:26:22
32,484,228
0
0
null
2015-03-18T21:03:11
2015-03-18T21:03:11
null
UTF-8
Java
false
false
4,789
java
package integration.mindbody; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy; import org.jvnet.jaxb2_commons.lang.ToString; import org.jvnet.jaxb2_commons.lang.ToStringStrategy; import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; /** * <p>Java class for GetClientContractsRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="GetClientContractsRequest"> * &lt;complexContent> * &lt;extension base="{http://clients.mindbodyonline.com/api/0_5}MBRequest"> * &lt;sequence> * &lt;element name="ClientID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GetClientContractsRequest", propOrder = { "clientID" }) public class GetClientContractsRequest extends MBRequest implements Serializable, Equals, HashCode, ToString { private final static long serialVersionUID = 1L; @XmlElement(name = "ClientID") protected String clientID; /** * Gets the value of the clientID property. * * @return * possible object is * {@link String } * */ public String getClientID() { return clientID; } /** * Sets the value of the clientID property. * * @param value * allowed object is * {@link String } * */ public void setClientID(String value) { this.clientID = value; } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); { String theClientID; theClientID = this.getClientID(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "clientID", theClientID), currentHashCode, theClientID); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof GetClientContractsRequest)) { return false; } if (this == object) { return true; } if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } final GetClientContractsRequest that = ((GetClientContractsRequest) object); { String lhsClientID; lhsClientID = this.getClientID(); String rhsClientID; rhsClientID = that.getClientID(); if (!strategy.equals(LocatorUtils.property(thisLocator, "clientID", lhsClientID), LocatorUtils.property(thatLocator, "clientID", rhsClientID), lhsClientID, rhsClientID)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { super.appendFields(locator, buffer, strategy); { String theClientID; theClientID = this.getClientID(); strategy.appendField(locator, this, "clientID", buffer, theClientID); } return buffer; } }
c333290cc11b20afc7215b925b9af0c2eaf7c727
58264cc501beac92ab125d953ffeb46299249efe
/Java/quiz/src/quiz/Java9.java
bd797fd9d28567185a444f9eea4036e14e62f757
[]
no_license
kaito-27/github
ad1b05fadc2fa9b11c1c25b3008adc98b2bf1ec2
6e4e0b830348b362283e421745b594094dc1d12d
refs/heads/master
2021-05-25T22:53:34.171253
2020-04-08T03:59:02
2020-04-08T03:59:02
253,954,336
0
0
null
null
null
null
UTF-8
Java
false
false
294
java
package quiz; public class Java9 { public static void main (String[] args) { int year = 2000; if(year % 4 == 0){ if(year % 400 == 0 || year % 100 != 0) { System.out.println("うるう年です"); }else { System.out.println("うるう年じゃないです"); } } } }
eeeb86b0a8030bf2021a30abea546dfc8abf838e
898895bb1c6dc0d62b8a75f1ce54792b6c1584ca
/src/main/java/seed/orm/consts/DBConsts.java
0a51a25863702a5bb91aa56b774f8331f3c270de
[ "Apache-2.0" ]
permissive
pronebel/api-server-seed
af20ab3ca983ad7c3539f358b1326644c34fbf5e
f15ee5815266aa158afd5d0a855ba4f677d183e4
refs/heads/master
2021-01-15T16:09:41.855054
2016-03-02T01:08:28
2016-03-02T01:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,845
java
package seed.orm.consts; /** * Created by liuhaiming on 2015/12/12. */ public interface DBConsts { /** DB标准字段-主键 */ public static final String FIELD_ID = "id"; /** DB标准字段-状态 */ public static final String FIELD_STATUS = "status"; /** DB标准字段-逻辑状态 */ public static final String FIELD_DR = "dr"; /** DB标准字段-时间戳 */ public static final String FIELD_TS = "ts"; /** 数据逻辑状态 - 正常态 */ public static final Short DR_NORMAL = 0; /** 数据逻辑状态 - 删除态 */ public static final Short DR_DELETE = 1; /** 启用标识 - 启用 */ public static final Short STATUS_ENABLE = 0; /** 启用标识 - 停用 */ public static final Short STATUS_DISABLE = 1; /** 性别 - 男 */ public static final Short SEX_MALE = 0; /** 启用标识 - 停用 */ public static final Short SEX_FEMALE = 1; /** 节点类型 - 虚拟节点 */ public static final Short NODE_TYPE_DUMMY = 0; /** 节点类型 - 功能节点 */ public static final Short NODE_TYPE_FUNC = 1; /** 客户类型 - 内部单位 */ public static final Short CUSTPROP_IN = 1; /** 客户类型 - 外部单位 */ public static final Short CUSTPROP_OUT = 0; /** 是否是散户 - 是 */ public static final Short ISFREECUST_YES = 0; /** 是否是散户 - 不是 */ public static final Short ISFREECUST_NO = 1; /** 是否是零售门店 - 是 */ public static final Short ISRETAILSTORE_YES = 0; /** 是否是零售门店 - 不是 */ public static final Short ISRETAILSTORE_NO = 1; /** 是否供应商 - 是 */ public static final Short ISSUPPLIER_YES = 0; /** 是否供应商 - 不是 */ public static final Short ISSUPPLIER_NO = 1; }
cc0b069cc07823dc86c0d961dbed27511ba462b8
0bb68a60a6397c3071acb10d31d13f0366c1ce0c
/Part-1/q14.java
4dfd546bc37f282a1bf5cd2e5029bcf14dd69a24
[]
no_license
ritika-07/Java-Programming
528f1fffff960e0b140fb3dc969db9909c059504
3d1802c666ad15ad057fb894b4e7e78c497281c4
refs/heads/master
2021-07-20T14:39:47.574513
2021-04-10T20:16:38
2021-04-10T20:16:38
246,754,488
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
import java.util.*; class q14 { public static void main ( String[] args) { Scanner sc = new Scanner(System.in); String s; int i; s=sc.nextLine(); int n= s.indexOf('-'); String react= s.substring(0,n); String prod = s.substring(n+3); String[] r=react.split(" "); String[] p=prod.split(" "); System.out.print("Reactants are "); for(i=0;i<r.length;i=i+2) { String ele= r[i]; String moles= new String(); String compound= new String(); if (ele.charAt(0)>='0' && ele.charAt(0)<='9') { moles= ele.substring(0,1); compound= ele.substring(1); } else { moles="0"; compound= ele.substring(0); } System.out.print(moles+ " number of moles of " +compound+ ","); } System.out.println(); System.out.print("Products are "); for(i=0;i<p.length;i=i+2) { String ele= p[i]; String moles= new String(); String compound= new String(); if (ele.charAt(0)>='0' && ele.charAt(0)<='9') { moles= ele.substring(0,1); compound= ele.substring(1); } else { moles="0"; compound= ele.substring(0); } System.out.print(moles+ " number of moles of " +compound+ ","); } } }
603e36781de3464b1ab4966b3720bb857fc6a170
6f279fd6e31a71e8780cb3b2826023f8476a20a1
/Football_Scores/app/src/main/java/barqsoft/footballscores/service/myFetchService.java
a4feb66f4333799944d88bf94f57aa2a7ff8171a
[]
no_license
rodrigoshariff/Super_Duo
4fd8823d3f6eaba1a5bb97185a35f8e9a2e098a5
bdbb7516bdcd3cc7e0f793e4f316987d02614bb6
refs/heads/master
2021-01-10T04:23:28.346086
2015-10-05T03:02:45
2015-10-05T03:02:45
43,587,992
0
0
null
null
null
null
UTF-8
Java
false
false
11,869
java
package barqsoft.footballscores.service; import android.app.IntentService; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.util.Log; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import java.util.Vector; import barqsoft.footballscores.DatabaseContract; import barqsoft.footballscores.R; /** * Created by yehya khaled on 3/2/2015. */ public class myFetchService extends IntentService { public static final String LOG_TAG = "myFetchService"; public myFetchService() { super("myFetchService"); } @Override protected void onHandleIntent(Intent intent) { //truncate database //getContentResolver().delete(DatabaseContract.BASE_CONTENT_URI, null, null); getData("p8"); getData("n2"); return; } private void getData (String timeFrame) { //Creating fetch URL final String BASE_URL = "http://api.football-data.org/alpha/fixtures"; //Base URL final String QUERY_TIME_FRAME = "timeFrame"; //Time Frame parameter to determine days //final String QUERY_MATCH_DAY = "matchday"; Uri fetch_build = Uri.parse(BASE_URL).buildUpon(). appendQueryParameter(QUERY_TIME_FRAME, timeFrame).build(); //Log.v(LOG_TAG, "The url we are looking at is: "+fetch_build.toString()); //log spam HttpURLConnection m_connection = null; BufferedReader reader = null; String JSON_data = null; //Opening Connection try { URL fetch = new URL(fetch_build.toString()); m_connection = (HttpURLConnection) fetch.openConnection(); m_connection.setRequestMethod("GET"); m_connection.addRequestProperty("X-Auth-Token",getString(R.string.api_key)); m_connection.connect(); // Read the input stream into a String InputStream inputStream = m_connection.getInputStream(); StringBuffer buffer = new StringBuffer(); if (inputStream == null) { // Nothing to do. return; } reader = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = reader.readLine()) != null) { // Since it's JSON, adding a newline isn't necessary (it won't affect parsing) // But it does make debugging a *lot* easier if you print out the completed // buffer for debugging. buffer.append(line + "\n"); } if (buffer.length() == 0) { // Stream was empty. No point in parsing. return; } JSON_data = buffer.toString(); } catch (Exception e) { Log.e(LOG_TAG,"Exception here " + e.getMessage()); } finally { if(m_connection != null) { m_connection.disconnect(); } if (reader != null) { try { reader.close(); } catch (IOException e) { Log.e(LOG_TAG,"Error Closing Stream"); } } } try { if (JSON_data != null) { //This bit is to check if the data contains any matches. If not, we call processJson on the dummy data JSONArray matches = new JSONObject(JSON_data).getJSONArray("fixtures"); if (matches.length() == 0) { //if there is no data, call the function on dummy data //this is expected behavior during the off season. processJSONdata(getString(R.string.dummy_data), getApplicationContext(), false); return; } //processJSONdata(getString(R.string.dummy_data), getApplicationContext(), false); processJSONdata(JSON_data, getApplicationContext(), true); } else { //Could not Connect Log.d(LOG_TAG, "Could not connect to server."); } } catch(Exception e) { Log.e(LOG_TAG,e.getMessage()); } } private void processJSONdata (String JSONdata,Context mContext, boolean isReal) { //JSON data // This set of league codes is for the 2015/2016 season. In fall of 2016, they will need to // be updated. Feel free to use the codes final String BUNDESLIGA1 = "394"; final String BUNDESLIGA2 = "395"; final String LIGUE1 = "396"; final String LIGUE2 = "397"; final String PREMIER_LEAGUE = "398"; final String PRIMERA_DIVISION = "399"; final String SEGUNDA_DIVISION = "400"; final String SERIE_A = "401"; final String PRIMERA_LIGA = "402"; final String Bundesliga3 = "403"; final String EREDIVISIE = "404"; final String SEASON_LINK = "http://api.football-data.org/alpha/soccerseasons/"; final String MATCH_LINK = "http://api.football-data.org/alpha/fixtures/"; final String FIXTURES = "fixtures"; final String LINKS = "_links"; final String SOCCER_SEASON = "soccerseason"; final String SELF = "self"; final String MATCH_DATE = "date"; final String HOME_TEAM = "homeTeamName"; final String AWAY_TEAM = "awayTeamName"; final String RESULT = "result"; final String HOME_GOALS = "goalsHomeTeam"; final String AWAY_GOALS = "goalsAwayTeam"; final String MATCH_DAY = "matchday"; //Match data String League = null; String mDate = null; String mTime = null; String Home = null; String Away = null; String Home_goals = null; String Away_goals = null; String match_id = null; String match_day = null; try { JSONArray matches = new JSONObject(JSONdata).getJSONArray(FIXTURES); //ContentValues to be inserted Vector<ContentValues> values = new Vector <ContentValues> (matches.length()); for(int i = 0;i < matches.length();i++) { JSONObject match_data = matches.getJSONObject(i); League = match_data.getJSONObject(LINKS).getJSONObject(SOCCER_SEASON). getString("href"); League = League.replace(SEASON_LINK,""); //This if statement controls which leagues we're interested in the data from. //add leagues here in order to have them be added to the DB. // If you are finding no data in the app, check that this contains all the leagues. // If it doesn't, that can cause an empty DB, bypassing the dummy data routine. if( League.equals(PREMIER_LEAGUE) || League.equals(SERIE_A) || //League.equals(BUNDESLIGA1) || //League.equals(BUNDESLIGA2) || //League.equals(Bundesliga3) || League.equals(PRIMERA_DIVISION) //|| //League.equals(SEGUNDA_DIVISION) //|| //League.equals(PRIMERA_LIGA) ) { match_id = match_data.getJSONObject(LINKS).getJSONObject(SELF). getString("href"); match_id = match_id.replace(MATCH_LINK, ""); if(!isReal){ //This if statement changes the match ID of the dummy data so that it all goes into the database match_id=match_id+Integer.toString(i); } mDate = match_data.getString(MATCH_DATE); mTime = mDate.substring(mDate.indexOf("T") + 1, mDate.indexOf("Z")); mDate = mDate.substring(0,mDate.indexOf("T")); SimpleDateFormat match_date = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); match_date.setTimeZone(TimeZone.getTimeZone("UTC")); try { Date parseddate = match_date.parse(mDate+mTime); SimpleDateFormat new_date = new SimpleDateFormat("yyyy-MM-dd:HH:mm"); new_date.setTimeZone(TimeZone.getDefault()); mDate = new_date.format(parseddate); mTime = mDate.substring(mDate.indexOf(":") + 1); mDate = mDate.substring(0,mDate.indexOf(":")); if(!isReal){ //This if statement changes the dummy data's date to match our current date range. Date fragmentdate = new Date(System.currentTimeMillis()+((i-7)*86400000)); SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd"); mDate=mformat.format(fragmentdate); } } catch (Exception e) { Log.d(LOG_TAG, "error here!"); Log.e(LOG_TAG,e.getMessage()); } Home = match_data.getString(HOME_TEAM); Away = match_data.getString(AWAY_TEAM); Home_goals = match_data.getJSONObject(RESULT).getString(HOME_GOALS); Away_goals = match_data.getJSONObject(RESULT).getString(AWAY_GOALS); match_day = match_data.getString(MATCH_DAY); ContentValues match_values = new ContentValues(); match_values.put(DatabaseContract.scores_table.MATCH_ID,match_id); match_values.put(DatabaseContract.scores_table.DATE_COL,mDate); match_values.put(DatabaseContract.scores_table.TIME_COL,mTime); match_values.put(DatabaseContract.scores_table.HOME_COL,Home); match_values.put(DatabaseContract.scores_table.AWAY_COL,Away); match_values.put(DatabaseContract.scores_table.HOME_GOALS_COL,Home_goals); match_values.put(DatabaseContract.scores_table.AWAY_GOALS_COL,Away_goals); match_values.put(DatabaseContract.scores_table.LEAGUE_COL,League); match_values.put(DatabaseContract.scores_table.MATCH_DAY,match_day); //log spam //Log.v(LOG_TAG,match_id); //Log.v(LOG_TAG,mDate); //Log.v(LOG_TAG,mTime); //Log.v(LOG_TAG,Home); //Log.v(LOG_TAG,Away); //Log.v(LOG_TAG,Home_goals); //Log.v(LOG_TAG,Away_goals); values.add(match_values); } } int inserted_data = 0; ContentValues[] insert_data = new ContentValues[values.size()]; values.toArray(insert_data); inserted_data = mContext.getContentResolver().bulkInsert( DatabaseContract.BASE_CONTENT_URI,insert_data); //Log.v(LOG_TAG,"Succesfully Inserted : " + String.valueOf(inserted_data)); } catch (JSONException e) { Log.e(LOG_TAG,e.getMessage()); } } }
250350ef4c2f1c749db6f3304d525301777cf310
763c4bab94e7c796ada03f5b8a4813653fdf2f6f
/JavaMasterclass/AbstractClass/src/Java/MasterClass/ListItem.java
940d88277fbbb8d753c6a42efa2c6a4dc6591c10
[]
no_license
rzusko/Exercises-from-Udemy-courses
bec9d676e91e02d7952dc84d43efbe4d479b1e74
64f04b5b9412eca840a2c942e05e5604132d66ce
refs/heads/master
2023-08-11T17:19:59.012417
2021-09-29T20:27:21
2021-09-29T20:27:21
411,821,462
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
package Java.MasterClass; public abstract class ListItem { protected ListItem rightLink = null; protected ListItem leftLink = null; protected Object value; public ListItem(Object value) { this.value = value; } abstract ListItem next(); abstract ListItem setNext(ListItem item); abstract ListItem previous(); abstract ListItem setPrevious(ListItem item); abstract int compareTo(ListItem item); public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } }
79f0759d8c6b59b57505716cca5f03632e50c200
bd5364b928b638e79ea8a1d3fb131f922de069dc
/src/main/java/assessment/Application.java
9e07a43610b4d482bd07aaa84d015e2911d11544
[]
no_license
deltaforce123/SpringBootRestfulApi
0b59e92b8965ad8d519f5d15a2d91d05f0cbf3eb
d8ffb99e7d454bdfd105d62416d4897f79ab44be
refs/heads/master
2021-04-06T20:25:02.192086
2018-03-15T15:32:36
2018-03-15T15:32:36
125,386,499
0
0
null
null
null
null
UTF-8
Java
false
false
833
java
package assessment; import assessment.config.ApplicationConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @SpringBootApplication @Configuration @EnableAutoConfiguration @ComponentScan("assessment") @EnableJpaRepositories(basePackages = "assessment.repos") @Import({ApplicationConfig.class}) public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
ed4e40f4ab5a7a3430cf185977503a5ef8e3465e
928057b5649982685686e135ca39efed08296e50
/src/main/java/com/jqb/shop/listener/InitListener.java
dbb10bc6c9f86e23c8ad69fa24d852edc87e3240
[]
no_license
liubinzk/shop
a8d29e127ee115b8da20d088950c05a3e09b5bda
a87904b143700a79a591e17437dfcf7ed2e03258
refs/heads/master
2021-01-20T20:28:02.646332
2016-08-16T09:05:52
2016-08-16T09:05:52
65,804,504
0
0
null
null
null
null
UTF-8
Java
false
false
2,269
java
/* * Copyright 2014-2015 jingqubao All rights reserved. * * Support: http://www.jingqubao.com * * License: licensed * */ package com.jqb.shop.listener; import java.io.File; import java.util.logging.Logger; import javax.annotation.Resource; import javax.servlet.ServletContext; import com.jqb.shop.service.CacheService; import com.jqb.shop.service.SearchService; import com.jqb.shop.service.StaticService; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import org.springframework.web.context.ServletContextAware; /** * Listener - 初始化 * * @author JQB Team * @version 3.0 */ @Component("initListener") public class InitListener implements ServletContextAware, ApplicationListener<ContextRefreshedEvent> { /** 安装初始化配置文件 */ private static final String INSTALL_INIT_CONFIG_FILE_PATH = "/install_init.conf"; /** logger */ private static final Logger logger = Logger.getLogger(InitListener.class.getName()); /** servletContext */ private ServletContext servletContext; @Value("${system.version}") private String systemVersion; @Resource(name = "staticServiceImpl") private StaticService staticService; @Resource(name = "cacheServiceImpl") private CacheService cacheService; @Resource(name = "searchServiceImpl") private SearchService searchService; public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) { if (servletContext != null && contextRefreshedEvent.getApplicationContext().getParent() == null) { String info = "I|n|i|t|i|a|l|i|z|i|n|g| |S|H|O|P|+|+| |" + systemVersion; logger.info(info.replace("|", "")); File installInitConfigFile = new File(servletContext.getRealPath(INSTALL_INIT_CONFIG_FILE_PATH)); if (installInitConfigFile.exists()) { cacheService.clear(); staticService.buildAll(); searchService.purge(); searchService.index(); installInitConfigFile.delete(); } else { staticService.buildIndex(); staticService.buildOther(); } } } }
f6387c263e1aacbdebb62fd1f86c4c97ff660101
b9648eb0f0475e4a234e5d956925ff9aa8c34552
/google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/enums/ResourceLimitTypeProto.java
3aaf108b6754e97be61bbab88bbae85cb60eac3a
[ "Apache-2.0" ]
permissive
wfansh/google-ads-java
ce977abd611d1ee6d6a38b7b3032646d5ffb0b12
7dda56bed67a9e47391e199940bb8e1568844875
refs/heads/main
2022-05-22T23:45:55.238928
2022-03-03T14:23:07
2022-03-03T14:23:07
460,746,933
0
0
Apache-2.0
2022-02-18T07:08:46
2022-02-18T07:08:45
null
UTF-8
Java
false
true
9,765
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v10/enums/resource_limit_type.proto package com.google.ads.googleads.v10.enums; public final class ResourceLimitTypeProto { private ResourceLimitTypeProto() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_google_ads_googleads_v10_enums_ResourceLimitTypeEnum_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_ads_googleads_v10_enums_ResourceLimitTypeEnum_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n8google/ads/googleads/v10/enums/resourc" + "e_limit_type.proto\022\036google.ads.googleads" + ".v10.enums\032\034google/api/annotations.proto" + "\"\264$\n\025ResourceLimitTypeEnum\"\232$\n\021ResourceL" + "imitType\022\017\n\013UNSPECIFIED\020\000\022\013\n\007UNKNOWN\020\001\022\032" + "\n\026CAMPAIGNS_PER_CUSTOMER\020\002\022\037\n\033BASE_CAMPA" + "IGNS_PER_CUSTOMER\020\003\022%\n!EXPERIMENT_CAMPAI" + "GNS_PER_CUSTOMER\020i\022 \n\034HOTEL_CAMPAIGNS_PE" + "R_CUSTOMER\020\004\022)\n%SMART_SHOPPING_CAMPAIGNS" + "_PER_CUSTOMER\020\005\022\032\n\026AD_GROUPS_PER_CAMPAIG" + "N\020\006\022#\n\037AD_GROUPS_PER_SHOPPING_CAMPAIGN\020\010" + "\022 \n\034AD_GROUPS_PER_HOTEL_CAMPAIGN\020\t\022*\n&RE" + "PORTING_AD_GROUPS_PER_LOCAL_CAMPAIGN\020\n\022(" + "\n$REPORTING_AD_GROUPS_PER_APP_CAMPAIGN\020\013" + "\022(\n$MANAGED_AD_GROUPS_PER_SMART_CAMPAIGN" + "\0204\022\"\n\036AD_GROUP_CRITERIA_PER_CUSTOMER\020\014\022\'" + "\n#BASE_AD_GROUP_CRITERIA_PER_CUSTOMER\020\r\022" + "-\n)EXPERIMENT_AD_GROUP_CRITERIA_PER_CUST" + "OMER\020k\022\"\n\036AD_GROUP_CRITERIA_PER_CAMPAIGN" + "\020\016\022\"\n\036CAMPAIGN_CRITERIA_PER_CUSTOMER\020\017\022\'" + "\n#BASE_CAMPAIGN_CRITERIA_PER_CUSTOMER\020\020\022" + "-\n)EXPERIMENT_CAMPAIGN_CRITERIA_PER_CUST" + "OMER\020l\022!\n\035WEBPAGE_CRITERIA_PER_CUSTOMER\020" + "\021\022&\n\"BASE_WEBPAGE_CRITERIA_PER_CUSTOMER\020" + "\022\022,\n(EXPERIMENT_WEBPAGE_CRITERIA_PER_CUS" + "TOMER\020\023\022+\n\'COMBINED_AUDIENCE_CRITERIA_PE" + "R_AD_GROUP\020\024\0225\n1CUSTOMER_NEGATIVE_PLACEM" + "ENT_CRITERIA_PER_CUSTOMER\020\025\022;\n7CUSTOMER_" + "NEGATIVE_YOUTUBE_CHANNEL_CRITERIA_PER_CU" + "STOMER\020\026\022\031\n\025CRITERIA_PER_AD_GROUP\020\027\022\037\n\033L" + "ISTING_GROUPS_PER_AD_GROUP\020\030\022*\n&EXPLICIT" + "LY_SHARED_BUDGETS_PER_CUSTOMER\020\031\022*\n&IMPL" + "ICITLY_SHARED_BUDGETS_PER_CUSTOMER\020\032\022+\n\'" + "COMBINED_AUDIENCE_CRITERIA_PER_CAMPAIGN\020" + "\033\022\"\n\036NEGATIVE_KEYWORDS_PER_CAMPAIGN\020\034\022$\n" + " NEGATIVE_PLACEMENTS_PER_CAMPAIGN\020\035\022\034\n\030G" + "EO_TARGETS_PER_CAMPAIGN\020\036\022#\n\037NEGATIVE_IP" + "_BLOCKS_PER_CAMPAIGN\020 \022\034\n\030PROXIMITIES_PE" + "R_CAMPAIGN\020!\022(\n$LISTING_SCOPES_PER_SHOPP" + "ING_CAMPAIGN\020\"\022,\n(LISTING_SCOPES_PER_NON" + "_SHOPPING_CAMPAIGN\020#\022$\n NEGATIVE_KEYWORD" + "S_PER_SHARED_SET\020$\022&\n\"NEGATIVE_PLACEMENT" + "S_PER_SHARED_SET\020%\022-\n)SHARED_SETS_PER_CU" + "STOMER_FOR_TYPE_DEFAULT\020(\022>\n:SHARED_SETS" + "_PER_CUSTOMER_FOR_NEGATIVE_PLACEMENT_LIS" + "T_LOWER\020)\022;\n7HOTEL_ADVANCE_BOOKING_WINDO" + "W_BID_MODIFIERS_PER_AD_GROUP\020,\022#\n\037BIDDIN" + "G_STRATEGIES_PER_CUSTOMER\020-\022!\n\035BASIC_USE" + "R_LISTS_PER_CUSTOMER\020/\022#\n\037LOGICAL_USER_L" + "ISTS_PER_CUSTOMER\0200\022\"\n\036BASE_AD_GROUP_ADS" + "_PER_CUSTOMER\0205\022(\n$EXPERIMENT_AD_GROUP_A" + "DS_PER_CUSTOMER\0206\022\035\n\031AD_GROUP_ADS_PER_CA" + "MPAIGN\0207\022#\n\037TEXT_AND_OTHER_ADS_PER_AD_GR" + "OUP\0208\022\032\n\026IMAGE_ADS_PER_AD_GROUP\0209\022#\n\037SHO" + "PPING_SMART_ADS_PER_AD_GROUP\020:\022&\n\"RESPON" + "SIVE_SEARCH_ADS_PER_AD_GROUP\020;\022\030\n\024APP_AD" + "S_PER_AD_GROUP\020<\022#\n\037APP_ENGAGEMENT_ADS_P" + "ER_AD_GROUP\020=\022\032\n\026LOCAL_ADS_PER_AD_GROUP\020" + ">\022\032\n\026VIDEO_ADS_PER_AD_GROUP\020?\022+\n&LEAD_FO" + "RM_CAMPAIGN_ASSETS_PER_CAMPAIGN\020\217\001\022*\n&PR" + "OMOTION_CUSTOMER_ASSETS_PER_CUSTOMER\020O\022*" + "\n&PROMOTION_CAMPAIGN_ASSETS_PER_CAMPAIGN" + "\020P\022*\n&PROMOTION_AD_GROUP_ASSETS_PER_AD_G" + "ROUP\020Q\022)\n$CALLOUT_CUSTOMER_ASSETS_PER_CU" + "STOMER\020\206\001\022)\n$CALLOUT_CAMPAIGN_ASSETS_PER" + "_CAMPAIGN\020\207\001\022)\n$CALLOUT_AD_GROUP_ASSETS_" + "PER_AD_GROUP\020\210\001\022*\n%SITELINK_CUSTOMER_ASS" + "ETS_PER_CUSTOMER\020\211\001\022*\n%SITELINK_CAMPAIGN" + "_ASSETS_PER_CAMPAIGN\020\212\001\022*\n%SITELINK_AD_G" + "ROUP_ASSETS_PER_AD_GROUP\020\213\001\0224\n/STRUCTURE" + "D_SNIPPET_CUSTOMER_ASSETS_PER_CUSTOMER\020\214" + "\001\0224\n/STRUCTURED_SNIPPET_CAMPAIGN_ASSETS_" + "PER_CAMPAIGN\020\215\001\0224\n/STRUCTURED_SNIPPET_AD" + "_GROUP_ASSETS_PER_AD_GROUP\020\216\001\022,\n\'MOBILE_" + "APP_CUSTOMER_ASSETS_PER_CUSTOMER\020\220\001\022,\n\'M" + "OBILE_APP_CAMPAIGN_ASSETS_PER_CAMPAIGN\020\221" + "\001\022,\n\'MOBILE_APP_AD_GROUP_ASSETS_PER_AD_G" + "ROUP\020\222\001\022/\n*HOTEL_CALLOUT_CUSTOMER_ASSETS" + "_PER_CUSTOMER\020\223\001\022/\n*HOTEL_CALLOUT_CAMPAI" + "GN_ASSETS_PER_CAMPAIGN\020\224\001\022/\n*HOTEL_CALLO" + "UT_AD_GROUP_ASSETS_PER_AD_GROUP\020\225\001\022&\n!CA" + "LL_CUSTOMER_ASSETS_PER_CUSTOMER\020\226\001\022&\n!CA" + "LL_CAMPAIGN_ASSETS_PER_CAMPAIGN\020\227\001\022&\n!CA" + "LL_AD_GROUP_ASSETS_PER_AD_GROUP\020\230\001\022\'\n\"PR" + "ICE_CUSTOMER_ASSETS_PER_CUSTOMER\020\232\001\022\'\n\"P" + "RICE_CAMPAIGN_ASSETS_PER_CAMPAIGN\020\233\001\022\'\n\"" + "PRICE_AD_GROUP_ASSETS_PER_AD_GROUP\020\234\001\022&\n" + "!PAGE_FEED_ASSET_SETS_PER_CUSTOMER\020\235\001\0223\n" + ".DYNAMIC_EDUCATION_FEED_ASSET_SETS_PER_C" + "USTOMER\020\236\001\022#\n\036ASSETS_PER_PAGE_FEED_ASSET" + "_SET\020\237\001\0220\n+ASSETS_PER_DYNAMIC_EDUCATION_" + "FEED_ASSET_SET\020\240\001\022\023\n\017VERSIONS_PER_AD\020R\022\033" + "\n\027USER_FEEDS_PER_CUSTOMER\020Z\022\035\n\031SYSTEM_FE" + "EDS_PER_CUSTOMER\020[\022\034\n\030FEED_ATTRIBUTES_PE" + "R_FEED\020\\\022\033\n\027FEED_ITEMS_PER_CUSTOMER\020^\022\037\n" + "\033CAMPAIGN_FEEDS_PER_CUSTOMER\020_\022$\n BASE_C" + "AMPAIGN_FEEDS_PER_CUSTOMER\020`\022*\n&EXPERIME" + "NT_CAMPAIGN_FEEDS_PER_CUSTOMER\020m\022\037\n\033AD_G" + "ROUP_FEEDS_PER_CUSTOMER\020a\022$\n BASE_AD_GRO" + "UP_FEEDS_PER_CUSTOMER\020b\022*\n&EXPERIMENT_AD" + "_GROUP_FEEDS_PER_CUSTOMER\020n\022\037\n\033AD_GROUP_" + "FEEDS_PER_CAMPAIGN\020c\022\037\n\033FEED_ITEM_SETS_P" + "ER_CUSTOMER\020d\022 \n\034FEED_ITEMS_PER_FEED_ITE" + "M_SET\020e\022%\n!CAMPAIGN_EXPERIMENTS_PER_CUST" + "OMER\020p\022(\n$EXPERIMENT_ARMS_PER_VIDEO_EXPE" + "RIMENT\020q\022\035\n\031OWNED_LABELS_PER_CUSTOMER\020s\022" + "\027\n\023LABELS_PER_CAMPAIGN\020u\022\027\n\023LABELS_PER_A" + "D_GROUP\020v\022\032\n\026LABELS_PER_AD_GROUP_AD\020w\022!\n" + "\035LABELS_PER_AD_GROUP_CRITERION\020x\022\036\n\032TARG" + "ET_CUSTOMERS_PER_LABEL\020y\022\'\n#KEYWORD_PLAN" + "S_PER_USER_PER_CUSTOMER\020z\0223\n/KEYWORD_PLA" + "N_AD_GROUP_KEYWORDS_PER_KEYWORD_PLAN\020{\022+" + "\n\'KEYWORD_PLAN_AD_GROUPS_PER_KEYWORD_PLA" + "N\020|\0223\n/KEYWORD_PLAN_NEGATIVE_KEYWORDS_PE" + "R_KEYWORD_PLAN\020}\022+\n\'KEYWORD_PLAN_CAMPAIG" + "NS_PER_KEYWORD_PLAN\020~\022$\n\037CONVERSION_ACTI" + "ONS_PER_CUSTOMER\020\200\001\022!\n\034BATCH_JOB_OPERATI" + "ONS_PER_JOB\020\202\001\022\034\n\027BATCH_JOBS_PER_CUSTOME" + "R\020\203\001\0229\n4HOTEL_CHECK_IN_DATE_RANGE_BID_MO" + "DIFIERS_PER_AD_GROUP\020\204\001B\360\001\n\"com.google.a" + "ds.googleads.v10.enumsB\026ResourceLimitTyp" + "eProtoP\001ZCgoogle.golang.org/genproto/goo" + "gleapis/ads/googleads/v10/enums;enums\242\002\003" + "GAA\252\002\036Google.Ads.GoogleAds.V10.Enums\312\002\036G" + "oogle\\Ads\\GoogleAds\\V10\\Enums\352\002\"Google::" + "Ads::GoogleAds::V10::Enumsb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_ads_googleads_v10_enums_ResourceLimitTypeEnum_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_ads_googleads_v10_enums_ResourceLimitTypeEnum_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_ads_googleads_v10_enums_ResourceLimitTypeEnum_descriptor, new java.lang.String[] { }); com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
e07f5a8bec8a8c9ceffb21e39a9d2c6d33b90b23
a42cf17b77ab5ab339f97d6eea81b2d6ecc9d2b6
/TestHost/gen/com/host/j/ICallBack.java
2657cc8128d6325baef46a3258deacde8699ecc7
[]
no_license
roy9527/Host_Client
cf9b657606f6fd254ad2c70c4e3f47521354e1ec
de23e1944e652440dffba045af733328e13251b8
refs/heads/master
2021-03-12T23:27:24.128950
2014-03-18T15:35:48
2014-03-18T15:35:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,775
java
/* * This file is auto-generated. DO NOT MODIFY. * Original file: /home/roy/workspace/TestHost/src/com/host/j/ICallBack.aidl */ package com.host.j; public interface ICallBack extends android.os.IInterface { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements com.host.j.ICallBack { private static final java.lang.String DESCRIPTOR = "com.host.j.ICallBack"; /** Construct the stub at attach it to the interface. */ public Stub() { this.attachInterface(this, DESCRIPTOR); } /** * Cast an IBinder object into an com.host.j.ICallBack interface, * generating a proxy if needed. */ public static com.host.j.ICallBack asInterface(android.os.IBinder obj) { if ((obj==null)) { return null; } android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (((iin!=null)&&(iin instanceof com.host.j.ICallBack))) { return ((com.host.j.ICallBack)iin); } return new com.host.j.ICallBack.Stub.Proxy(obj); } @Override public android.os.IBinder asBinder() { return this; } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { switch (code) { case INTERFACE_TRANSACTION: { reply.writeString(DESCRIPTOR); return true; } case TRANSACTION_invokCallBack: { data.enforceInterface(DESCRIPTOR); com.host.j.PushMsg _arg0; if ((0!=data.readInt())) { _arg0 = com.host.j.PushMsg.CREATOR.createFromParcel(data); } else { _arg0 = null; } this.invokCallBack(_arg0); reply.writeNoException(); if ((_arg0!=null)) { reply.writeInt(1); _arg0.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { reply.writeInt(0); } return true; } } return super.onTransact(code, data, reply, flags); } private static class Proxy implements com.host.j.ICallBack { private android.os.IBinder mRemote; Proxy(android.os.IBinder remote) { mRemote = remote; } @Override public android.os.IBinder asBinder() { return mRemote; } public java.lang.String getInterfaceDescriptor() { return DESCRIPTOR; } @Override public void invokCallBack(com.host.j.PushMsg msg) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); if ((msg!=null)) { _data.writeInt(1); msg.writeToParcel(_data, 0); } else { _data.writeInt(0); } mRemote.transact(Stub.TRANSACTION_invokCallBack, _data, _reply, 0); _reply.readException(); if ((0!=_reply.readInt())) { msg.readFromParcel(_reply); } } finally { _reply.recycle(); _data.recycle(); } } } static final int TRANSACTION_invokCallBack = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); } public void invokCallBack(com.host.j.PushMsg msg) throws android.os.RemoteException; }
c357ffd1c0100ec761d9ce93abd9dda49e411ae7
9a7ea182f523eb37ac6126821f2eff6fccee5b3b
/com.liferay.blade.migration.liferay70/test/com/liferay/blade/migration/liferay70/apichanges/MobileDeviceRulesLegacyAPITest.java
90518f1f67b5df66b76461768a4ee0d6933f88ff
[ "Apache-2.0" ]
permissive
gitter-badger/liferay-blade-tools
c174d0b95f70f6319b54a5ec86e4dd299512559d
06a5d6c51fb1afaecadf6e78f2104b08ce0cf036
refs/heads/master
2020-12-30T21:46:09.110286
2015-11-06T18:39:21
2015-11-06T18:39:21
45,706,726
0
0
null
2015-11-06T20:50:58
2015-11-06T20:50:58
null
UTF-8
Java
false
false
2,313
java
package com.liferay.blade.migration.liferay70.apichanges; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.util.List; import org.junit.Before; import org.junit.Test; import com.liferay.blade.java.api.SearchResult; import com.liferay.blade.java.provider.JavaFileJDT; import com.liferay.blade.migration.liferay70.apichanges.MobileDeviceRulesLegacyAPI; @SuppressWarnings("restriction") public class MobileDeviceRulesLegacyAPITest { final File testFile = new File( "projects/legacy-apis-ant-portlet/docroot/WEB-INF/src/com/liferay/EditLayoutsAction.java"); MobileDeviceRulesLegacyAPI component; @Before public void beforeTest() { assertTrue(testFile.exists()); component = new MobileDeviceRulesLegacyAPI(); } @Test public void mobileDeviceRulesLegacyAPITest() throws Exception { List<SearchResult> results = component.searchFile(testFile, new JavaFileJDT(testFile)); assertNotNull(results); assertEquals(8, results.size()); SearchResult problem = results.get(0); assertEquals(36, problem.startLine); assertEquals(1519, problem.startOffset); assertEquals(1590, problem.endOffset); problem = results.get(1); assertEquals(64, problem.startLine); assertEquals(2741, problem.startOffset); assertEquals(2836, problem.endOffset); problem = results.get(2); assertEquals(37, problem.startLine); assertEquals(1599, problem.startOffset); assertEquals(1665, problem.endOffset); problem = results.get(3); assertEquals(68, problem.startLine); assertEquals(2893, problem.startOffset); assertEquals(3112, problem.endOffset); problem = results.get(4); assertEquals(38, problem.startLine); assertEquals(1674, problem.startOffset); assertEquals(1756, problem.endOffset); problem = results.get(5); assertEquals(50, problem.startLine); assertEquals(2199, problem.startOffset); assertEquals(2310, problem.endOffset); problem = results.get(6); assertEquals(39, problem.startLine); assertEquals(1765, problem.startOffset); assertEquals(1842, problem.endOffset); problem = results.get(7); assertEquals(57, problem.startLine); assertEquals(2457, problem.startOffset); assertEquals(2696, problem.endOffset); } }
30be236e80abb5cc34beda9273fbd3f2fadf2a5d
a9caa2b576f0f098bf38256f540564ca18383f04
/src/main/java/com/study/reactive/sample/repository/ReactiveMonitorRepository.java
f06750df6230b0d780aee0683f3338079c9f36a7
[]
no_license
moonsoo5522/server_sample
e1120cb9a4f3a1edadc628a052ba081158b87616
1a2b9390df62ba0b2e20dda715b15f122674f21a
refs/heads/master
2022-10-12T12:36:05.375006
2020-09-04T09:13:39
2020-09-04T09:13:39
238,839,339
0
0
null
2022-10-05T18:22:09
2020-02-07T03:55:15
Java
UTF-8
Java
false
false
352
java
package com.study.reactive.sample.repository; import com.study.reactive.sample.model.Metrics; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.stereotype.Repository; @Repository public interface ReactiveMonitorRepository extends ReactiveElasticsearchRepository<Metrics, String> { }
d69b67726a749b138eae4cc7b07fac0e94eabe97
6db7abc134f5be58e00905d88f28d3091cf16cbf
/src/main/java/LoopBuilderTest.java
046184cf0052117a37936a42614cfc64b6ff318b
[]
no_license
hanslovsky/spark-test-imglib2-loopbuilder
1e35ae07347429e88468631e298498b5e23bc72b
77bc60337c2f3cd97817520ccc42b97e6102de61
refs/heads/master
2020-04-19T18:04:12.011741
2019-01-30T14:03:15
2019-01-30T14:03:18
168,352,383
0
0
null
null
null
null
UTF-8
Java
false
false
1,886
java
import net.imglib2.RandomAccessible; import net.imglib2.RandomAccessibleInterval; import net.imglib2.algorithm.gauss3.Gauss3; import net.imglib2.img.array.ArrayImgs; import net.imglib2.loops.LoopBuilder; import net.imglib2.type.numeric.integer.UnsignedLongType; import net.imglib2.util.ConstantUtils; import net.imglib2.view.Views; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaSparkContext; import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.Collections; public class LoopBuilderTest { public static void main(String[] args) throws Exception { final long[] blockSize = new long[] {100, 200, 300}; final SparkConf conf = new SparkConf().setAppName(MethodHandles.lookup().lookupClass().getName()); try (final JavaSparkContext sc = new JavaSparkContext(conf)) { final long result = sc .parallelize(Collections.singletonList(1)) .map(one -> { final RandomAccessible<UnsignedLongType> source = ConstantUtils.constantRandomAccessible(new UnsignedLongType(1), blockSize.length); final RandomAccessibleInterval<UnsignedLongType> target = ArrayImgs.unsignedLongs(blockSize); Gauss3.gauss(1.0, source, target); LoopBuilder.setImages(target, Views.interval(source, target)).forEachPixel(UnsignedLongType::set); final UnsignedLongType sum = new UnsignedLongType(0); Views.iterable(target).forEach(sum::add); return sum.get(); }) .first(); if (result != Arrays.stream(blockSize).reduce(1, (l1, l2) -> l1 * l2)) throw new Exception("Wrong result."); System.out.println("Sum is " + result); } } }
9f3da663ed928a20d5e339f5a03d28666516ff95
32ee35ebcf2c74c72c5db163669894755666fb09
/jaqy-codecov/src/test/java/com/teradata/jaqy/db/DerbyTest.java
3af5c18ab7c11f2a4f9f21a4040dd1447161fa16
[ "Apache-2.0" ]
permissive
guptam/jaqy
5d083693155ef140170e198cae3c9a440159cc3f
5ec9d032ea08c39d5a05af6ad4661f6be23034f6
refs/heads/master
2021-07-17T03:53:44.650193
2017-10-23T08:46:46
2017-10-23T08:46:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,484
java
/* * Copyright (c) 2017 Teradata * * 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.teradata.jaqy.db; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import com.teradata.jaqy.utils.TestUtils; /** * @author Heng Yuan */ public class DerbyTest { @Rule public TemporaryFolder testFolder = new TemporaryFolder (); @Test public void test1 () throws Exception { TestUtils.jaqyTest (testFolder, "../tests/unittests/derby/ansi_types.sql", "../tests/unittests/derby/control/ansi_types.control"); } @Test public void test2 () throws Exception { TestUtils.jaqyTest (testFolder, "../tests/unittests/derby/identity.sql", "../tests/unittests/derby/control/identity.control"); } @Test public void test3 () throws Exception { TestUtils.jaqyTest (testFolder, "../tests/unittests/derby/data_types.sql", "../tests/unittests/derby/control/data_types.control"); } }
ca45a01e525bd21d1756442c2b70772c5f6f4f35
5eb034cf8928d3389c5e156a91db2398f38ef165
/src/main/java/practice/leetcode/june/week1/Solution.java
7c46b9ce49cc6820c1ffdca74518342f8c448f6d
[]
no_license
ramangugnani/practice
b2b21548581c5e98362f20ae6c6ef62ec2e65942
ef847cf56a1edf3a982806248a7a87c9e8ab81c9
refs/heads/master
2022-05-25T04:20:40.101299
2021-02-07T08:07:41
2021-02-07T08:07:41
85,815,337
0
0
null
2022-05-20T22:00:49
2017-03-22T10:34:13
Java
UTF-8
Java
false
false
848
java
package practice.leetcode.june.week1; public class Solution { Integer totalCount = 0; int[] newW = null; public Solution(int[] w) { newW = new int[w.length]; for (int i = 0; i < w.length; i++) { newW[i] = totalCount + w[i]; totalCount = newW[i]; } } public int pickIndex() { int random = (int) (totalCount * Math.random()); for(int i = 0 ; i < newW.length ; i++) { if(random < newW[i]) { return i; } } return -1; } public static void main(String[] args) { int[] w = new int[] { 1, 3, 1 }; Solution obj = new Solution(w); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); System.out.println(obj.pickIndex()); } }
19f02005ce9d170995ed9f28c6dd44e86b14f8aa
18cfb24c4914acd5747e533e88ce7f3a52eee036
/src/main/jdk8/javax/lang/model/type/TypeVariable.java
a8fa13949083e278c97e2337faad03d23e869d68
[]
no_license
douguohai/jdk8-code
f0498e451ec9099e4208b7030904e1b4388af7c5
c8466ed96556bfd28cbb46e588d6497ff12415a0
refs/heads/master
2022-12-19T03:10:16.879386
2020-09-30T05:43:20
2020-09-30T05:43:20
273,399,965
0
0
null
null
null
null
UTF-8
Java
false
false
2,157
java
/* * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.lang.model.type; import javax.lang.model.element.Element; import javax.lang.model.element.TypeParameterElement; import javax.lang.model.util.Types; /** * Represents a type variable. * A type variable may be explicitly declared by a * {@linkplain TypeParameterElement type parameter} of a * type, method, or constructor. * A type variable may also be declared implicitly, as by * the capture conversion of a wildcard type argument * (see chapter 5 of * <cite>The Java&trade; Language Specification</cite>). * * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ah&eacute; * @see TypeParameterElement * @since 1.6 */ public interface TypeVariable extends ReferenceType { /** * Returns the element corresponding to this type variable. * * @return the element corresponding to this type variable */ Element asElement(); /** * Returns the upper bound of this type variable. * * <p> If this type variable was declared with no explicit * upper bounds, the result is {@code java.lang.Object}. * If it was declared with multiple upper bounds, * the result is an {@linkplain IntersectionType intersection type}; * individual bounds can be found by examining the result's * {@linkplain IntersectionType#getBounds() bounds}. * * @return the upper bound of this type variable */ TypeMirror getUpperBound(); /** * Returns the lower bound of this type variable. While a type * parameter cannot include an explicit lower bound declaration, * capture conversion can produce a type variable with a * non-trivial lower bound. Type variables otherwise have a * lower bound of {@link NullType}. * * @return the lower bound of this type variable */ TypeMirror getLowerBound(); }
c00cc326795a2ce4022b6e828f0e04cf34fcefb5
5bb29da62d13b6a4401061e9d9926da61f101aa4
/week-03/day-13/PetrolStation/src/Station.java
d160c3ec17102ace6f76470195c864351380022f
[]
no_license
green-fox-academy/SomodiEmese
633560a605e2649e5092a8548b485227b9485f0d
7143a1164cc09718f865b624dd2038924bee0db4
refs/heads/master
2020-03-25T01:54:14.814202
2018-10-02T15:32:36
2018-10-02T15:32:36
143,263,440
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
public class Station { int gasAmount = 1000; public void refill(Car car){ int addedGasAmount = car.capacity - car.carGasAmount; car.carGasAmount += addedGasAmount; gasAmount-= addedGasAmount; } public static void main(String [] args){ Car car01 = new Car(72, 214); Station station = new Station(); station.refill(car01); System.out.println(car01.carGasAmount); System.out.println(station.gasAmount); } }
a5bc17551c98390f46461b45fdf16f5c95906a15
0a9f5f619ff687faf956d2d2efebb235331029ac
/java/src/com/google/typography/font/tools/fontviewer/AbstractNode.java
c50a99a8703511b3b7129ada5d5191feadfa8bf2
[ "Apache-2.0" ]
permissive
rillig/sfntly
b1c0b310a9067f31071ef0fc81ae7c073b235b35
ea0893911b86edbd15cf8478594e4f683c8d4ec1
refs/heads/master
2022-02-06T07:17:27.208956
2022-01-27T19:29:44
2022-01-27T19:29:44
93,274,384
202
46
null
2022-10-29T08:17:04
2017-06-03T21:17:37
Java
UTF-8
Java
false
false
889
java
package com.google.typography.font.tools.fontviewer; import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.tree.DefaultMutableTreeNode; /** * The tree in the left panel is built from these nodes. Most of these nodes correspond to a "table" * of the font. * * @see FontNode */ abstract class AbstractNode extends DefaultMutableTreeNode { @Override public final String toString() { return getNodeName(); } protected abstract String getNodeName(); abstract JComponent render(); /** * Whether the component from {@link #render()} is wrapped in a {@link JScrollPane} so that it can * be arbitrarily large. Otherwise it can easily be truncated on small screens. */ boolean renderInScrollPane() { return true; } @Override public AbstractNode getChildAt(int index) { throw new UnsupportedOperationException(); } }
3e4d2a3d59fb8cb2f47a01f191c87599ac65d018
4c881f69ebd0c91672f821dec109eba45493479b
/lab9/src/lambdaexp3/Username.java
6499ba159861a8155f86cb326b6fb7c19b669d6d
[]
no_license
thenameispavan/CapG_Lab-book
430d0aeee4006c7fcc79529840aef4e1bee4ed90
0eaba3dc1f511f1a7ce7c51a1a88ac1db1092875
refs/heads/main
2023-03-19T19:11:48.662913
2021-03-08T12:20:44
2021-03-08T12:20:44
337,974,348
0
1
null
null
null
null
UTF-8
Java
false
false
469
java
package lambdaexp3; import java.util.Scanner; public class Username { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String in=sc.next(); String pass=sc.next(); Check c= (u_name,pword)->{ if(u_name.equals(in)) { if(pword.equals(pass)) { return true; } else return false; } else return false; }; System.out.println(c.check("pavan", "12345")); } }
b31c95aa514183432ad4e345b96bd58b19cca1ba
36709509d75d17a7b15693ab853972dec3d410e3
/WEB-INF/src/cidc/adminGrupos/db/grupo/GruposGestionDB.java
15beb1e7b4704aec66246548a572b17af046f15c
[]
no_license
crisdago/SiciudRepositorio
533c1b85e62463eff0c6992d409ef9afad0c8e4a
17ee5aca66523763dc6e6904e6096742cf394b3b
refs/heads/master
2021-01-16T21:48:42.684345
2014-01-27T21:29:29
2014-01-27T21:29:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,669
java
package cidc.adminGrupos.db.grupo; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; import javax.mail.MessagingException; import javax.mail.internet.AddressException; import cidc.adminGrupos.obj.Integrante; import cidc.general.db.BaseDB; import cidc.general.db.CursorDB; import cidc.general.mails.EnvioMail; import cidc.general.mails.Reporte; import cidc.general.obj.CrearClaves; import cidc.general.obj.Globales; public class GruposGestionDB extends BaseDB{ public GruposGestionDB(CursorDB cursor, int perfil) { super(cursor, perfil); rb=ResourceBundle.getBundle("cidc.adminGrupos.db.grupo.consultas"); } public List buscaIntegrantesGrupo(long idGrupo) { List listaIntegrantes=new ArrayList(); Connection cn=null; PreparedStatement ps=null; ResultSet rs=null; Integrante integrante=null; int i=1; try { cn=cursor.getConnection(super.perfil); ps=cn.prepareStatement(rb.getString("listaIntegrantes")); ps.setLong(i++, idGrupo); rs=ps.executeQuery(); while(rs.next()){ i=1; integrante=new Integrante(); integrante.setId(rs.getLong(i++)); integrante.setNombres(rs.getString(i++)); integrante.setApellidos(rs.getString(i++)); integrante.setPapel(rs.getInt(i++)); integrante.setFechaSalida(rs.getString(i++)); listaIntegrantes.add(integrante); } }catch (SQLException e) { lanzaExcepcion(e); }catch (Exception e) { lanzaExcepcion(e); }finally{ cerrar(rs); cerrar(ps); cerrar(cn); } return listaIntegrantes; } public boolean actualizaDatosIntegrante(Integrante integ) { Connection cn=null; PreparedStatement ps=null; boolean retorno=false; int i=1; try { cn=cursor.getConnection(super.perfil); cn.setAutoCommit(false); ps=cn.prepareStatement(rb.getString("actualizaPersona")); ps.setString(i++,integ.getMail()); ps.setString(i++,integ.getTel1()); ps.setString(i++,integ.getCel1()); ps.setString(i++,integ.getCodigoUd()); ps.setInt(i++,integ.getTipoCed()); ps.setString(i++,integ.getCedula()); ps.setString(i++,integ.getDeCed()); ps.setString(i++,integ.getNombres()); ps.setString(i++,integ.getApellidos()); ps.setString(i++,integ.getCvlac()); ps.setLong(i++,integ.getId()); System.out.println("----->"+ps.executeUpdate()); i=1; ps=cn.prepareStatement(rb.getString("actualizaIntegrante")); ps.setLong(i++, integ.getCodFacultad()); ps.setLong(i++, integ.getIdProyectoCurr()); ps.setLong(i++, integ.getPapel()); ps.setString(i++, integ.getFechaVinculacion()); ps.setString(i++, integ.getFechaSalida()); ps.setLong(i++,integ.getId()); System.out.println("----->"+ps.executeUpdate()); cn.commit(); retorno=true; // System.out.println("---Actualizar papel-->"+integ.getPapel()); }catch (SQLException e) { lanzaExcepcion(e); }catch (Exception e) { lanzaExcepcion(e); }finally{ cerrar(ps); cerrar(cn); } return retorno; } public Integrante verIntegranteGrupo(String idIntegrante) { Connection cn=null; PreparedStatement ps=null; ResultSet rs=null; Integrante integrante=null; int i=1; try { cn=cursor.getConnection(super.perfil); cn.setAutoCommit(false); ps=cn.prepareStatement(rb.getString("verIntegrante")); ps.setLong(1, Long.parseLong(idIntegrante)); rs=ps.executeQuery(); // System.out.println("----->"+ps); while(rs.next()){ i=1; integrante=new Integrante(); integrante.setId(rs.getLong(i++)); integrante.setCodigoUd(rs.getString(i++)); integrante.setTipoCed(rs.getInt(i++)); integrante.setCedula(rs.getString(i++)); integrante.setDeCed(rs.getString(i++)); integrante.setNombres(rs.getString(i++)); integrante.setApellidos(rs.getString(i++)); integrante.setMail(rs.getString(i++)); integrante.setTel1(rs.getString(i++)); integrante.setCel1(rs.getString(i++)); integrante.setNombreFacultad(rs.getString(i++)); integrante.setNombreProyCurr(rs.getString(i++)); integrante.setPapel(rs.getInt(i++)); integrante.setFechaVinculacion(rs.getString(i++)); integrante.setFechaSalida(rs.getString(i++)); integrante.setCodFacultad(rs.getInt(i++)); integrante.setIdProyectoCurr(rs.getLong(i++)); integrante.setUltimaActua(rs.getString(i++)); integrante.setCvlac(rs.getString(i++)); } }catch (SQLException e) { lanzaExcepcion(e); }catch (Exception e) { lanzaExcepcion(e); }finally{ cerrar(rs); cerrar(ps); cerrar(cn); } return integrante; } public boolean claveInvestigador(String idPersona,String papel){ // //System.out.println("persona "+idPersona+" papel "+papel); boolean retorno=false; if(papel.equals("1")) papel="10"; else papel="8"; CrearClaves clave=new CrearClaves(); Connection cn=null; PreparedStatement ps=null; ResultSet rs=null; String perfil=null,nick=null,key=null; String []datos=new String[5]; int i=1; key=clave.getClave(); //System.out.println("Bandera 1"); try { cn=cursor.getConnection(super.perfil); ps=cn.prepareStatement(rb.getString("verPerfil")); ps.setLong(1,Long.parseLong(idPersona)); rs=ps.executeQuery(); while(rs.next()){ //System.out.println("Bandera 2"); perfil=rs.getString(1); nick=rs.getString(2); datos[2]=rs.getString(3); datos[1]=rs.getString(4); datos[0]=rs.getString(5); } //System.out.println("Bandera 3"); if(perfil==null){ //System.out.println("Bandera 4"); ps=cn.prepareStatement(rb.getString("nuevoUsuario")); ps.setLong(i++, Long.parseLong(idPersona)); ps.setString(i++,"investigador"); ps.setString(i++,key); ps.setString(i++,papel+",0,0"); ps.executeUpdate(); nick="investigador"; }else{ //System.out.println("Bandera 5"); String []partes=perfil.split(","); String nuevoPerfil=null; if(!partes[0].equals(papel)){ if(partes[1].equals("0")) nuevoPerfil=partes[0]+","+papel+",0"; else if(partes[2].equals("0") && !partes[1].equals(papel)) nuevoPerfil=partes[0]+","+partes[1]+","+papel; } //System.out.println("Bandera 6"); if(nuevoPerfil!=null){ //System.out.println("Bandera 7"); ps=cn.prepareStatement(rb.getString("asignaPerfKey")); ps.setString(i++,key); ps.setString(i++,nuevoPerfil); ps.setLong(i++, Long.parseLong(idPersona)); ps.executeUpdate(); // //System.out.println("Asigna perfil y psw "+nuevoPerfil); }else{ //System.out.println("Bandera 8"); ps=cn.prepareStatement(rb.getString("cambioClave")); ps.setString(i++,key); ps.setLong(i++, Long.parseLong(idPersona)); ps.executeUpdate(); // //System.out.println("solo cambia clave"); } //System.out.println("Bandera 9"); } datos[3]=nick; datos[4]=key; mailClaveNueva(datos); //System.out.println("Bandera 10"); retorno=true; }catch (SQLException e) { lanzaExcepcion(e); }catch (Exception e) { lanzaExcepcion(e); }finally{ cerrar(rs); cerrar(ps); cerrar(cn); } return retorno; } public void mailClaveNueva(String []datos) throws AddressException,MessagingException{ String []direcciones={datos[1]}; ResourceBundle rb=ResourceBundle.getBundle("cidc.general.mails.grupoInvestigacion"); Globales global=new Globales(); //System.out.println("Bandera 9-1"); EnvioMail envioMail=new EnvioMail("general"); //System.out.println("Bandera 9-2"); StringBuffer texto=new StringBuffer(); texto.append("<br>CIDC-SI "+datos[0]+"-"+global.getAnoCortoHoy()+"<br><br>"); texto.append(rb.getString("cg1")); texto.append(" "+datos[2]); texto.append(rb.getString("cg2")); texto.append(rb.getString("cg3")); texto.append(" "+datos[3]); texto.append(rb.getString("cg4")); texto.append(" "+datos[4]); texto.append(rb.getString("cg5")); texto.append(rb.getString("cg6")); texto.append(rb.getString("cg7")); //System.out.println("Bandera 9-3"); envioMail.enviar(direcciones,"Clave de Ingreso al SICIUD",""+texto); //System.out.println("Bandera 9-4"); Reporte reporteMail=new Reporte(cursor,super.perfil); //System.out.println("Bandera 9-5"); reporteMail.reportar(datos[2],"Clave Investigador",direcciones[0],datos[0]); //System.out.println("Bandera 9-6"); } public boolean nuevoIntegranteGrupo(Integrante integrante) { Connection cn=null; PreparedStatement ps=null; boolean retorno=false; int i=1; try { cn=cursor.getConnection(super.perfil); cn.setAutoCommit(false); ps=cn.prepareStatement(rb.getString("nuevaPersona")); ps.setInt(i++,integrante.getTipoCed()); ps.setString(i++,integrante.getCedula()); ps.setString(i++,integrante.getDeCed()); ps.setString(i++,integrante.getCodigoUd()); ps.setString(i++,integrante.getNombres()); ps.setString(i++,integrante.getApellidos()); ps.setString(i++,integrante.getMail()); ps.setString(i++,integrante.getTel1()); ps.setString(i++,integrante.getCel1()); ps.setString(i++,integrante.getCvlac()); ps.executeUpdate(); i=1; ps=cn.prepareStatement(rb.getString("nuevoIntegrante")); ps.setInt(i++,integrante.getCodFacultad()); ps.setLong(i++,integrante.getIdGrupo()); ps.setLong(i++,integrante.getIdProyectoCurr()); ps.setInt(i++,integrante.getPapel()); ps.setString(i++,integrante.getFechaVinculacion()); ps.executeUpdate(); cn.commit(); retorno=true; }catch (SQLException e) { lanzaExcepcion(e); }catch (Exception e) { lanzaExcepcion(e); }finally{ cerrar(ps); cerrar(cn); } return retorno; } }
0cfe358214396f83a9d73002c658d03fdf9a490b
b299fbaa356d8ef724d00e52c97754579cdb6b0d
/app/src/main/java/com/sun/mystudy/ListviewLoadActivity.java
93f8f6d4000418bcc833f39a01600287a270dc50
[]
no_license
sun18321/Study
1a3d15f6b19efa6f0edf3b2c8084537bb4178f5d
af68ea84f11944d61e871c45429dbc9d0c9ed6c0
refs/heads/master
2021-01-22T02:49:02.318781
2018-10-22T13:02:20
2018-10-22T13:02:20
81,072,895
1
0
null
null
null
null
UTF-8
Java
false
false
5,637
java
package com.sun.mystudy; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; 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.LinearLayout; import android.widget.ListView; import android.widget.TextView; import com.bumptech.glide.Glide; public class ListviewLoadActivity extends AppCompatActivity { private ListView mListView; private int[] mStraggeredIcons = new int[]{R.mipmap.p1, R.mipmap.p2, R.mipmap.p3, R .mipmap.p4, R.mipmap.p5, R.mipmap.p6, R.mipmap.p7, R.mipmap.p8, R.mipmap.p9, R .mipmap.p10, R.mipmap.p11, R.mipmap.p12, R.mipmap.p13, R.mipmap.p14, R.mipmap .p15, R.mipmap.p16, R.mipmap.p17, R.mipmap.p18, R.mipmap.p19, R.mipmap.p20, R .mipmap.p21, R.mipmap.p22, R.mipmap.p23, R.mipmap.p24, R.mipmap.p25, R.mipmap .p26, R.mipmap.p27, R.mipmap.p28, R.mipmap.p29, R.mipmap.p30, R.mipmap.p31, R .mipmap.p32, R.mipmap.p33, R.mipmap.p34, R.mipmap.p35, R.mipmap.p36, R.mipmap .p37, R.mipmap.p38, R.mipmap.p39, R.mipmap.p40, R.mipmap.p41, R.mipmap.p42, R .mipmap.p43, R.mipmap.p44}; private String[] string_text = {"一","二","三","四","五","六","七","八","九","十","壹","贰","叁","肆","伍","陆","柒","捌","玖","拾"}; private ListLoadAdapter mAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listview_load); init(); mAdapter = new ListLoadAdapter(); mListView.setAdapter(mAdapter); } private void init() { mListView = (ListView) findViewById(R.id.listview); mListView.setOnScrollListener(new AbsListView.OnScrollListener() { private int end; private int start; @Override public void onScrollStateChanged(AbsListView view, int scrollState) { switch (scrollState) { case SCROLL_STATE_IDLE: mAdapter.setScrollState(false); int childCount = view.getChildCount(); System.out.println("childcount" + childCount); for (int i = 0; i < childCount; i++) { ImageView image = (ImageView) view.getChildAt(i).findViewById(R.id.image); LinearLayout linear = (LinearLayout) view.getChildAt(i).findViewById(R.id.linear); TextView text = (TextView) view.getChildAt(i).findViewById(R.id.text); if (linear.getTag() != null) { Glide.with(ListviewLoadActivity.this).load(linear.getTag()).into(image); text.setText(text.getTag().toString()); linear.setTag(null); } } break; case SCROLL_STATE_FLING: mAdapter.setScrollState(true); break; case SCROLL_STATE_TOUCH_SCROLL: mAdapter.setScrollState(true); break; } } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { } }); } class ListLoadAdapter extends BaseAdapter { private boolean scrollState = false; public void setScrollState(boolean scrollState) { this.scrollState = scrollState; } @Override public int getCount() { return string_text.length; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { LoadViewHolder holder; if (convertView == null) { holder = new LoadViewHolder(); convertView = LayoutInflater.from(ListviewLoadActivity.this).inflate(R.layout.item_load, parent, false); holder.linearLayout = (LinearLayout) convertView.findViewById(R.id.linear); holder.image = (ImageView) convertView.findViewById(R.id.image); holder.text = (TextView) convertView.findViewById(R.id.text); convertView.setTag(holder); } else { System.out.println("convertview---" + convertView.getTag()); holder = (LoadViewHolder) convertView.getTag(); } if (scrollState) { holder.linearLayout.setTag(mStraggeredIcons[position]); holder.text.setTag(string_text[position]); Glide.with(ListviewLoadActivity.this).load(R.mipmap.g20).into(holder.image); } else { Glide.with(ListviewLoadActivity.this).load(mStraggeredIcons[position]).into(holder.image); holder.text.setText(string_text[position]); // holder.text.setTag(null); holder.linearLayout.setTag(null); } return convertView; } class LoadViewHolder { LinearLayout linearLayout; ImageView image; TextView text; } } }
34c3572c647066e84b90ccd08d4c5196e2cb7308
7acf6b2a24063b1d4162cefd48e49734488b8c9d
/src/main/java/com/neemshade/matri/web/rest/MalaParamResource.java
dafdcf064eab98f0ff67a7422e5ee6bf80def50b
[]
no_license
cinthiya1234567890/tls
bca9bc8bc2c5c9f3b52677532067ef7b7c6ad49b
2491879cc4c5d96ee1457158ba4f2989b3d2cce1
refs/heads/main
2023-01-06T16:49:45.841892
2020-11-11T08:50:31
2020-11-11T08:50:31
311,899,898
0
0
null
null
null
null
UTF-8
Java
false
false
5,026
java
package com.neemshade.matri.web.rest; import com.neemshade.matri.service.MalaParamService; import com.neemshade.matri.web.rest.errors.BadRequestAlertException; import com.neemshade.matri.service.dto.MalaParamDTO; import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing {@link com.neemshade.matri.domain.MalaParam}. */ @RestController @RequestMapping("/api") public class MalaParamResource { private final Logger log = LoggerFactory.getLogger(MalaParamResource.class); private static final String ENTITY_NAME = "malaParam"; @Value("${jhipster.clientApp.name}") private String applicationName; private final MalaParamService malaParamService; public MalaParamResource(MalaParamService malaParamService) { this.malaParamService = malaParamService; } /** * {@code POST /mala-params} : Create a new malaParam. * * @param malaParamDTO the malaParamDTO to create. * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new malaParamDTO, or with status {@code 400 (Bad Request)} if the malaParam has already an ID. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PostMapping("/mala-params") public ResponseEntity<MalaParamDTO> createMalaParam(@RequestBody MalaParamDTO malaParamDTO) throws URISyntaxException { log.debug("REST request to save MalaParam : {}", malaParamDTO); if (malaParamDTO.getId() != null) { throw new BadRequestAlertException("A new malaParam cannot already have an ID", ENTITY_NAME, "idexists"); } MalaParamDTO result = malaParamService.save(malaParamDTO); return ResponseEntity.created(new URI("/api/mala-params/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, false, ENTITY_NAME, result.getId().toString())) .body(result); } /** * {@code PUT /mala-params} : Updates an existing malaParam. * * @param malaParamDTO the malaParamDTO to update. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated malaParamDTO, * or with status {@code 400 (Bad Request)} if the malaParamDTO is not valid, * or with status {@code 500 (Internal Server Error)} if the malaParamDTO couldn't be updated. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PutMapping("/mala-params") public ResponseEntity<MalaParamDTO> updateMalaParam(@RequestBody MalaParamDTO malaParamDTO) throws URISyntaxException { log.debug("REST request to update MalaParam : {}", malaParamDTO); if (malaParamDTO.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } MalaParamDTO result = malaParamService.save(malaParamDTO); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, false, ENTITY_NAME, malaParamDTO.getId().toString())) .body(result); } /** * {@code GET /mala-params} : get all the malaParams. * * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of malaParams in body. */ @GetMapping("/mala-params") public List<MalaParamDTO> getAllMalaParams() { log.debug("REST request to get all MalaParams"); return malaParamService.findAll(); } /** * {@code GET /mala-params/:id} : get the "id" malaParam. * * @param id the id of the malaParamDTO to retrieve. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the malaParamDTO, or with status {@code 404 (Not Found)}. */ @GetMapping("/mala-params/{id}") public ResponseEntity<MalaParamDTO> getMalaParam(@PathVariable Long id) { log.debug("REST request to get MalaParam : {}", id); Optional<MalaParamDTO> malaParamDTO = malaParamService.findOne(id); return ResponseUtil.wrapOrNotFound(malaParamDTO); } /** * {@code DELETE /mala-params/:id} : delete the "id" malaParam. * * @param id the id of the malaParamDTO to delete. * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. */ @DeleteMapping("/mala-params/{id}") public ResponseEntity<Void> deleteMalaParam(@PathVariable Long id) { log.debug("REST request to delete MalaParam : {}", id); malaParamService.delete(id); return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, false, ENTITY_NAME, id.toString())).build(); } }
bd8cb3b494166883e9c00ed4a161f9b7d4f829bd
fdd8c892c396f62a5ea3884a72e8058cdd5a33b3
/web/src/main/java/com/github/freeacs/web/app/page/unittype/UnittypeCreatePage.java
fff08a23a2813ab28875fb9e328c751726012b2a
[ "MIT" ]
permissive
yrong/freeacs
8e408dffd62be25163a36b877d7f5f6f5a7eb58a
a8458c2b319c7680afd39998481a659f60edac7a
refs/heads/master
2020-06-24T22:29:15.296459
2019-07-29T03:52:41
2019-07-29T03:52:41
199,109,973
1
0
MIT
2019-07-27T03:23:27
2019-07-27T03:23:27
null
UTF-8
Java
false
false
6,470
java
package com.github.freeacs.web.app.page.unittype; import com.github.freeacs.dbi.ACS; import com.github.freeacs.dbi.Unittype; import com.github.freeacs.dbi.Unittype.ProvisioningProtocol; import com.github.freeacs.dbi.UnittypeParameter; import com.github.freeacs.dbi.UnittypeParameters; import com.github.freeacs.web.Page; import com.github.freeacs.web.app.Output; import com.github.freeacs.web.app.input.DropDownSingleSelect; import com.github.freeacs.web.app.input.InputDataIntegrity; import com.github.freeacs.web.app.input.InputDataRetriever; import com.github.freeacs.web.app.input.InputSelectionFactory; import com.github.freeacs.web.app.input.ParameterParser; import com.github.freeacs.web.app.menu.MenuItem; import com.github.freeacs.web.app.page.AbstractWebPage; import com.github.freeacs.web.app.util.ACSLoader; import com.github.freeacs.web.app.util.SessionCache; import com.github.freeacs.web.app.util.SessionData; import com.github.freeacs.web.app.util.WebConstants; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.sql.DataSource; /** The Class UnittypeCreatePage. */ public class UnittypeCreatePage extends AbstractWebPage { public List<MenuItem> getShortcutItems(SessionData sessionData) { List<MenuItem> list = new ArrayList<>(super.getShortcutItems(sessionData)); list.add(new MenuItem("Unit Type overview", Page.UNITTYPEOVERVIEW)); return list; } @Override public void process( ParameterParser params, Output outputHandler, DataSource xapsDataSource, DataSource syslogDataSource) throws Exception { UnittypeCreateData inputData = (UnittypeCreateData) InputDataRetriever.parseInto(new UnittypeCreateData(), params); inputData.getUnittype().setValue(null); String sessionId = params.getSession().getId(); ACS acs = ACSLoader.getXAPS(sessionId, xapsDataSource, syslogDataSource); if (acs == null) { outputHandler.setRedirectTarget(WebConstants.LOGIN_URI); return; } InputDataIntegrity.loadAndStoreSession(params, outputHandler, inputData); DropDownSingleSelect<Unittype> unittypesToCopyFrom = InputSelectionFactory.getDropDownSingleSelect( inputData.getUnittypeToCopyFrom(), acs.getUnittype(inputData.getUnittypeToCopyFrom().getString()), getUnittypesWithProtocol( sessionId, inputData.getNewProtocol().getString(), xapsDataSource, syslogDataSource)); if (inputData.getFormSubmit().hasValue("Create")) { if (isUnittypesLimited(sessionId, xapsDataSource, syslogDataSource)) { outputHandler.setDirectResponse("You are not allowed to create unittypes!"); return; } String description = inputData.getNewDescription().getString(); String modelName = inputData.getNewModelname().getString(); String protocol = inputData.getNewProtocol().getString(); String vendor = inputData.getNewVendor().getString(); // String matcherId = modelName; // if (protocol != null && protocol.equals("OPP")) // matcherId = inputData.getNewMatcherid().getString(); if (vendor != null && modelName != null) { String copyFrom = inputData.getUnittypeToCopyFrom().getString(); Unittype unittypeToCopyFrom = null; if (copyFrom != null) { unittypeToCopyFrom = acs.getUnittype(copyFrom); } if (unittypeToCopyFrom != null && !unittypeToCopyFrom.getProtocol().equals(protocol)) { outputHandler.setDirectResponse( "Cannot copy parameters from a unittype of different protocol."); return; } Unittype unittype = new Unittype(modelName, vendor, description, ProvisioningProtocol.toEnum(protocol)); acs.getUnittypes().addOrChangeUnittype(unittype, acs); if (unittypeToCopyFrom != null) { for (UnittypeParameter utp : getParametersFromUnittype(unittypeToCopyFrom).getUnittypeParameters()) { if (unittype.getUnittypeParameters().getByName(utp.getName()) == null) { UnittypeParameter newUtp = new UnittypeParameter(unittype, utp.getName(), utp.getFlag()); if (utp.getValues() != null) { newUtp.setValues(utp.getValues()); } unittype.getUnittypeParameters().addOrChangeUnittypeParameter(newUtp, acs); } } } inputData.getUnittype().setValue(unittype.getName()); SessionCache.getSessionData(sessionId).setUnittypeName(unittype.getName()); outputHandler.setDirectToPage(Page.UNITTYPE); return; } } outputHandler.getTemplateMap().put("unittypesInProtocol", unittypesToCopyFrom); DropDownSingleSelect<String> protocols = InputSelectionFactory.getDropDownSingleSelect( inputData.getNewProtocol(), inputData.getNewProtocol().getString(), Arrays.asList(UnittypePage.NA_PROTOCOL, UnittypePage.TR069_PROTOCOL)); outputHandler.getTemplateMap().put("protocols", protocols); outputHandler.setTemplatePath("unit-type/create"); } /** * Gets the parameters from unittype. * * @param unittypeToCopyFrom the unittype to copy from * @return the parameters from unittype */ private UnittypeParameters getParametersFromUnittype(Unittype unittypeToCopyFrom) { if (unittypeToCopyFrom != null) { return unittypeToCopyFrom.getUnittypeParameters(); } return null; } /** * Gets the unittypes with protocol. * * @param sessionId the session id * @param protocol the protocol * @param xapsDataSource * @param syslogDataSource * @return the unittypes with protocol the no available connection exception * @throws SQLException the sQL exception */ private List<Unittype> getUnittypesWithProtocol( String sessionId, String protocol, DataSource xapsDataSource, DataSource syslogDataSource) throws SQLException { List<Unittype> unittypes = getAllowedUnittypes(sessionId, xapsDataSource, syslogDataSource); List<Unittype> allowedUnittypes = new ArrayList<>(); for (Unittype ut : unittypes) { if (ut.getProtocol().equals(protocol == null ? UnittypePage.NA_PROTOCOL : protocol)) { allowedUnittypes.add(ut); } } return allowedUnittypes; } }
9505efb87213cd3569cc6bf275f5964f5878d020
87690eda17c38591afdeda4be1de2f89b1c49082
/src/main/java/com/detroitlabs/starWarsApi/AppConfiguration.java
e24669c904dfe94e88ac526c2d0cf506475ca9fa
[]
no_license
barnesb7/StarWarsApi2
d4fc4d8fe7e8cd41a2baf5859e7bc1cd9f2f2609
5bdba6469cff4ff4e98808db913e511519cf011f
refs/heads/master
2020-05-05T00:16:15.279290
2019-04-04T18:13:17
2019-04-04T18:13:17
179,569,720
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.detroitlabs.starWarsApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @EnableAutoConfiguration @ComponentScan public class AppConfiguration { public static void main(String[] args){ SpringApplication.run(AppConfiguration.class, args); } }
57dcc2f56988c8b8548db63e1191014ab8432984
047477eb6f297833811edf127e297baf6777cd57
/src/net/sf/robocode/serialization/RbSerializer.java
d6807de4eb4a7048103aec4bbd918624201215aa
[]
no_license
janrsilva/ia-campeonato-robocode
dfb511767555ea7a0cbd6305a48bc00b86a57ddc
fa586a0a017568f615163ec8ab458d2edc5a760a
refs/heads/master
2021-01-23T06:54:54.902732
2017-03-31T19:51:11
2017-03-31T19:51:11
86,409,658
0
0
null
null
null
null
UTF-8
Java
false
false
14,571
java
package net.sf.robocode.serialization; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.nio.charset.CodingErrorAction; import java.util.HashMap; import java.util.Map; import net.sf.robocode.core.ContainerBase; import net.sf.robocode.io.Logger; import net.sf.robocode.manager.IVersionManagerBase; import net.sf.robocode.security.HiddenAccess; import robocode.Event; public final class RbSerializer { public static final int SIZEOF_TYPEINFO = 1; public static final int SIZEOF_BYTE = 1; public static final int SIZEOF_BOOL = 1; public static final int SIZEOF_CHAR = 2; public static final int SIZEOF_INT = 4; public static final int SIZEOF_LONG = 8; public static final int SIZEOF_DOUBLE = 8; public static final byte TERMINATOR_TYPE = -1; public static final byte ExecCommands_TYPE = 1; public static final byte BulletCommand_TYPE = 2; public static final byte TeamMessage_TYPE = 3; public static final byte DebugProperty_TYPE = 4; public static final byte ExecResults_TYPE = 5; public static final byte RobotStatus_TYPE = 6; public static final byte BulletStatus_TYPE = 7; public static final byte BattleResults_TYPE = 8; public static final byte Bullet_TYPE = 9; public static final byte RobotStatics_TYPE = 10; public static final byte BattleEndedEvent_TYPE = 32; public static final byte BulletHitBulletEvent_TYPE = 33; public static final byte BulletHitEvent_TYPE = 34; public static final byte BulletMissedEvent_TYPE = 35; public static final byte DeathEvent_TYPE = 36; public static final byte WinEvent_TYPE = 37; public static final byte HitWallEvent_TYPE = 38; public static final byte RobotDeathEvent_TYPE = 39; public static final byte SkippedTurnEvent_TYPE = 40; public static final byte ScannedRobotEvent_TYPE = 41; public static final byte HitByBulletEvent_TYPE = 42; public static final byte HitRobotEvent_TYPE = 43; public static final byte KeyPressedEvent_TYPE = 44; public static final byte KeyReleasedEvent_TYPE = 45; public static final byte KeyTypedEvent_TYPE = 46; public static final byte MouseClickedEvent_TYPE = 47; public static final byte MouseDraggedEvent_TYPE = 48; public static final byte MouseEnteredEvent_TYPE = 49; public static final byte MouseExitedEvent_TYPE = 50; public static final byte MouseMovedEvent_TYPE = 51; public static final byte MousePressedEvent_TYPE = 52; public static final byte MouseReleasedEvent_TYPE = 53; public static final byte MouseWheelMovedEvent_TYPE = 54; public static final byte RoundEndedEvent_TYPE = 55; private static final ISerializableHelper[] typeToHelper = new ISerializableHelper['Ā']; private static Map<Class<?>, Byte> classToType = new HashMap(); private static final Charset charset = Charset.forName("UTF8"); static { register(null, (byte)-1); } private final CharsetEncoder encoder; private final CharsetDecoder decoder; public RbSerializer() { currentVersion = ((IVersionManagerBase)ContainerBase.getComponent(IVersionManagerBase.class)).getVersionAsInt(); encoder = charset.newEncoder(); encoder.onMalformedInput(CodingErrorAction.REPORT); encoder.onUnmappableCharacter(CodingErrorAction.REPLACE); ByteBuffer buffer = ByteBuffer.allocate(8); encoder.encode(CharBuffer.wrap("BOM"), buffer, false); decoder = charset.newDecoder(); decoder.onMalformedInput(CodingErrorAction.REPORT); decoder.onUnmappableCharacter(CodingErrorAction.REPLACE); } public void serialize(OutputStream target, byte type, Object object) throws IOException { int length = sizeOf(type, object); ByteBuffer buffer = ByteBuffer.allocate(12); buffer.putInt(-1059135839); buffer.putInt(currentVersion); buffer.putInt(length); target.write(buffer.array()); buffer = ByteBuffer.allocate(length); serialize(buffer, type, object); if (buffer.remaining() != 0) { throw new IOException("Serialization failed: bad size"); } target.write(buffer.array()); } public ByteBuffer serialize(byte type, Object object) throws IOException { int length = sizeOf(type, object); ByteBuffer buffer = ByteBuffer.allocateDirect(12 + length); buffer.putInt(-1059135839); buffer.putInt(currentVersion); buffer.putInt(length); serialize(buffer, type, object); if (buffer.remaining() != 0) { throw new IOException("Serialization failed: bad size"); } return buffer; } public ByteBuffer serializeToBuffer(ByteBuffer buffer, byte type, Object object) throws IOException { int length = sizeOf(type, object); buffer.limit(12 + length); buffer.putInt(-1059135839); buffer.putInt(currentVersion); buffer.putInt(length); serialize(buffer, type, object); if (buffer.remaining() != 0) { throw new IOException("Serialization failed: bad size"); } return buffer; } public Object deserialize(InputStream source) throws IOException { ByteBuffer buffer = ByteBuffer.allocate(12); fillBuffer(source, buffer); buffer.flip(); int bo = buffer.getInt(); if (bo != -1059135839) { throw new IOException("Different byte order is not supported"); } int version = buffer.getInt(); if (version != currentVersion) { throw new IOException("Version of data is not supported. We support only strong match"); } int length = buffer.getInt(); buffer = ByteBuffer.allocate(length); fillBuffer(source, buffer); buffer.flip(); Object res = deserializeAny(buffer); if (buffer.remaining() != 0) { throw new IOException("Serialization failed"); } return res; } public Object deserialize(ByteBuffer buffer) throws IOException { int bo = buffer.getInt(); if (bo != -1059135839) { throw new IOException("Different byte order is not supported"); } int version = buffer.getInt(); if (version != currentVersion) { throw new IOException("Version of data is not supported. We support only strong match"); } int length = buffer.getInt(); if (length != buffer.remaining()) { throw new IOException("Wrong buffer size, " + length + "expected but got " + buffer.remaining()); } Object res = deserializeAny(buffer); if (buffer.remaining() != 0) { throw new IOException("Serialization failed"); } return res; } public void serialize(ByteBuffer buffer, byte type, Object object) { ISerializableHelper helper = getHelper(type); if (object != null) { buffer.put(type); helper.serialize(this, buffer, object); } else { buffer.put((byte)-1); } } private static final int BYTE_ORDER = -1059135839; private final int currentVersion; public void serialize(ByteBuffer buffer, String data) { if (data == null) { buffer.putInt(-1); } else { ByteBuffer slice = encode(data); buffer.putInt(slice.limit()); buffer.put(slice); } } public void serialize(ByteBuffer buffer, byte[] data) { if (data == null) { buffer.putInt(-1); } else { buffer.putInt(data.length); buffer.put(data); } } public void serialize(ByteBuffer buffer, int[] data) { if (data == null) { buffer.putInt(-1); } else { buffer.putInt(data.length); for (int aData : data) { buffer.putInt(aData); } } } public void serialize(ByteBuffer buffer, char[] data) { if (data == null) { buffer.putInt(-1); } else { buffer.putInt(data.length); for (char aData : data) { buffer.putChar(aData); } } } public void serialize(ByteBuffer buffer, double[] data) { if (data == null) { buffer.putInt(-1); } else { buffer.putInt(data.length); for (double aData : data) { buffer.putDouble(aData); } } } public void serialize(ByteBuffer buffer, float[] data) { if (data == null) { buffer.putInt(-1); } else { buffer.putInt(data.length); for (float aData : data) { buffer.putFloat(aData); } } } public void serialize(ByteBuffer buffer, boolean value) { buffer.put((byte)(value ? 1 : 0)); } public void serialize(ByteBuffer buffer, double value) { buffer.putDouble(value); } public void serialize(ByteBuffer buffer, char value) { buffer.putChar(value); } public void serialize(ByteBuffer buffer, long value) { buffer.putLong(value); } public void serialize(ByteBuffer buffer, int value) { buffer.putInt(value); } public void serialize(ByteBuffer buffer, Event event) { byte type = HiddenAccess.getSerializationType(event); serialize(buffer, type, event); } public Object deserializeAny(ByteBuffer buffer) { byte type = buffer.get(); if (type == -1) { return null; } return getHelper(type).deserialize(this, buffer); } public String deserializeString(ByteBuffer buffer) { int bytes = buffer.getInt(); if (bytes == -1) { return null; } ByteBuffer slice = buffer.slice(); slice.limit(bytes); String res; try { res = decoder.decode(slice).toString(); } catch (CharacterCodingException e) { throw new Error("Bad character", e); } buffer.position(buffer.position() + bytes); return res; } public byte[] deserializeBytes(ByteBuffer buffer) { int len = buffer.getInt(); if (len == -1) { return null; } byte[] res = new byte[len]; buffer.get(res); return res; } public int[] deserializeIntegers(ByteBuffer buffer) { int len = buffer.getInt(); if (len == -1) { return null; } int[] res = new int[len]; for (int i = 0; i < len; i++) { res[i] = buffer.getInt(); } return res; } public float[] deserializeFloats(ByteBuffer buffer) { int len = buffer.getInt(); if (len == -1) { return null; } float[] res = new float[len]; for (int i = 0; i < len; i++) { res[i] = buffer.getFloat(); } return res; } public char[] deserializeChars(ByteBuffer buffer) { int len = buffer.getInt(); if (len == -1) { return null; } char[] res = new char[len]; for (int i = 0; i < len; i++) { res[i] = buffer.getChar(); } return res; } public double[] deserializeDoubles(ByteBuffer buffer) { int len = buffer.getInt(); if (len == -1) { return null; } double[] res = new double[len]; for (int i = 0; i < len; i++) { res[i] = buffer.getDouble(); } return res; } public boolean deserializeBoolean(ByteBuffer buffer) { return buffer.get() != 0; } public char deserializeChar(ByteBuffer buffer) { return buffer.getChar(); } public int deserializeInt(ByteBuffer buffer) { return buffer.getInt(); } public Float deserializeFloat(ByteBuffer buffer) { return Float.valueOf(buffer.getFloat()); } public double deserializeDouble(ByteBuffer buffer) { return buffer.getDouble(); } public long deserializeLong(ByteBuffer buffer) { return buffer.getLong(); } public int sizeOf(String data) { return data == null ? 4 : 4 + encode(data).limit(); } public int sizeOf(byte[] data) { return data == null ? 4 : 4 + data.length; } public int sizeOf(byte type, Object object) { return getHelper(type).sizeOf(this, object); } public int sizeOf(Event event) { return sizeOf(HiddenAccess.getSerializationType(event), event); } private ISerializableHelper getHelper(byte type) { ISerializableHelper helper = typeToHelper[type]; if (helper == null) { throw new Error("Unknownd or unsupported data type"); } return helper; } private ByteBuffer encode(String data) { ByteBuffer slice = ByteBuffer.allocate(data.length() * 3); encoder.encode(CharBuffer.wrap(data), slice, false); slice.flip(); return slice; } private void fillBuffer(InputStream source, ByteBuffer buffer) throws IOException { do { int res = source.read(buffer.array(), buffer.position(), buffer.remaining()); if (res == -1) { throw new IOException("Unexpected EOF"); } buffer.position(buffer.position() + res); } while (buffer.remaining() != 0); } public static void register(Class<?> realClass, byte type) { try { if (realClass != null) { Method method = realClass.getDeclaredMethod("createHiddenSerializer", new Class[0]); method.setAccessible(true); ISerializableHelper helper = (ISerializableHelper)method.invoke(null, new Object[0]); method.setAccessible(false); typeToHelper[type] = helper; classToType.put(realClass, Byte.valueOf(type)); } } catch (NoSuchMethodException e) { Logger.logError(e); } catch (InvocationTargetException e) { Logger.logError(e); } catch (IllegalAccessException e) { Logger.logError(e); } } public static ByteBuffer serializeToBuffer(Object src) throws IOException { RbSerializer rbs = new RbSerializer(); Byte type = (Byte)classToType.get(src.getClass()); return rbs.serialize(type.byteValue(), src); } public static <T> T deserializeFromBuffer(ByteBuffer buffer) throws IOException { RbSerializer rbs = new RbSerializer(); Object res = rbs.deserialize(buffer); return res; } public static Object deepCopy(byte type, Object src) { ByteArrayOutputStream out = new ByteArrayOutputStream(1024); RbSerializer rbs = new RbSerializer(); try { rbs.serialize(out, type, src); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); return rbs.deserialize(in); } catch (IOException e) { Logger.logError(e); } return null; } }
7c39ac30fdb9ece3a2a0c85cd36852ad6e03ebc0
70a49ea7caa733e1e073f9c00c3becc8d50f69dc
/hospital-manage/src/main/java/com/hosptest/hospital/config/Swagger2Config.java
46420eb503958e973e3e559f6247e7d4b47d0b9b
[]
no_license
779943132/SYT
198f9870948347208f4c5a22bf731d0ba8ff53e0
b70cb9118a82284c5c009f626521ec107e11ee6a
refs/heads/master
2023-06-07T20:52:46.920524
2021-06-28T08:53:11
2021-06-28T08:53:11
364,471,389
0
1
null
null
null
null
UTF-8
Java
false
false
1,736
java
package com.hosptest.hospital.config; import com.google.common.base.Predicates; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ParameterBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.schema.ModelRef; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.service.Parameter; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; import java.util.ArrayList; import java.util.List; /** * Swagger2配置信息 * @author qy */ @Configuration @EnableSwagger2 public class Swagger2Config { @Bean public Docket webApiConfig(){ return new Docket(DocumentationType.SWAGGER_2) .groupName("webApi") .apiInfo(webApiInfo()) .select() //过滤掉admin路径下的所有页面 .paths(Predicates.and(PathSelectors.regex("/P2P/.*"))) //过滤掉所有error或error.*页面 //.paths(Predicates.not(PathSelectors.regex("/error.*"))) .build(); } private ApiInfo webApiInfo(){ return new ApiInfoBuilder() .title("网站-API文档") .description("本文档描述了网站微服务接口定义") .version("1.0") .contact(new Contact("qy", "http://atguigu.com", "[email protected]")) .build(); } }