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
9ba3c677841a58b19f0aa0e8a72b16539a10f047
5d405dd596f409f6da348faa218a4f5e4ebb2dfe
/app/src/main/java/com/example/tanxiao/opengldemo/drawcommand/DrawCommand.java
81a5a3019bf7f50c344d6b4f84a8dfe4a99e5643
[]
no_license
TxShon/OpenGlDemo
3519de84b6fa832886812d3182f65d9d20f86d27
96dd579a73fbcaf82150b5c195ebab429a9697dc
refs/heads/master
2021-05-03T06:37:20.037241
2018-03-05T10:01:03
2018-03-05T10:01:03
120,598,266
0
1
null
null
null
null
UTF-8
Java
false
false
159
java
package com.example.tanxiao.opengldemo.drawcommand; /** * Created by TX on 2018/2/26. * Class note: */ public interface DrawCommand { void draw(); }
[ "tanxiao@zhihu.com" ]
tanxiao@zhihu.com
58c15e0b714e4d73ac5477a386aa9ecb906b811e
2504595d4ec3dc665c81dd26bf8c6a9fe589ef16
/src/java/entities/CountrylanguagePK.java
ab8b400654f5c68e9161855fb95c477cded225b7
[]
no_license
ashrafxcoder/HelloWorldService
b771a4f76be2b2b6cddddb15ae82ff4df5d82d3f
b7f2f3d890b2c4b50ff541780b5123602258d062
refs/heads/master
2021-01-19T14:00:50.289509
2017-01-30T06:53:45
2017-01-30T06:53:45
79,231,913
0
0
null
null
null
null
UTF-8
Java
false
false
2,376
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package entities; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * * @author Ashraf-XCODER */ @Embeddable public class CountrylanguagePK implements Serializable { @Basic(optional = false) @NotNull @Size(min = 1, max = 3) @Column(name = "CountryCode") private String countryCode; @Basic(optional = false) @NotNull @Size(min = 1, max = 30) @Column(name = "Language") private String language; public CountrylanguagePK() { } public CountrylanguagePK(String countryCode, String language) { this.countryCode = countryCode; this.language = language; } public String getCountryCode() { return countryCode; } public void setCountryCode(String countryCode) { this.countryCode = countryCode; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } @Override public int hashCode() { int hash = 0; hash += (countryCode != null ? countryCode.hashCode() : 0); hash += (language != null ? language.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof CountrylanguagePK)) { return false; } CountrylanguagePK other = (CountrylanguagePK) object; if ((this.countryCode == null && other.countryCode != null) || (this.countryCode != null && !this.countryCode.equals(other.countryCode))) { return false; } if ((this.language == null && other.language != null) || (this.language != null && !this.language.equals(other.language))) { return false; } return true; } @Override public String toString() { return "entities.CountrylanguagePK[ countryCode=" + countryCode + ", language=" + language + " ]"; } }
[ "ashraf.ali1811@gmail.com" ]
ashraf.ali1811@gmail.com
55637f76449b2969470fe3d60706cebf03175d06
5a155f8741c46f168b0ce1eac90f6d1d673fdf07
/PreviousProjects/java/javabasic/java基础/javaproject/第二章:基本/第二章:基本程序设计/数值类型转化/Shuz.java
109fe05a251dd177722cd2cb3ffbeb57e0fe54ad
[]
no_license
gitjinyubao/MyProject
10b308948597ef726af858260b8622814ddd5b25
ed71b23f82ff272f6c90f0513f0e94a9accd0849
refs/heads/master
2021-09-04T01:28:08.560749
2018-01-14T02:40:15
2018-01-14T02:40:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
156
java
public class Shuz { public static void main(String[] args) { System.out.println((int)1.7); double d=4.5; int i=(int)d; System.out.println(i); } }
[ "2045279403@qq.com" ]
2045279403@qq.com
a0d449cafddaa67a73d6400fb4d3859c4c226af8
6078aa6758f06e69db1785ba887a1cafc4b58409
/src/main/java/com/homeninja/dao/SiteUserDAO.java
aba08c48f7abf8410c312c9d26b35d29500e0b37
[]
no_license
feysal07/ninja
71343106e6d0acbeeceb2f72d83ca96f3809e4f5
08d8ba2a68764e4e238adb15097ec42559b90ebc
refs/heads/master
2020-05-29T15:42:53.689427
2015-03-24T20:03:40
2015-03-24T20:03:40
32,845,262
0
0
null
null
null
null
UTF-8
Java
false
false
1,217
java
package com.homeninja.dao; import java.util.List; import java.util.Set; import com.homeninja.entities.Address; import com.homeninja.entities.SiteUsers; import com.homeninja.entities.UserJobCategoryMap; import com.homeninja.entities.UserJobSubCategoryMap; import com.homeninja.entities.UserType; public interface SiteUserDAO { public long addUser(SiteUsers user ); public boolean updateUser(SiteUsers user ); public SiteUsers validateLogin(String username, String password); public boolean isEmailExists(String loginEmail); public SiteUsers findbyExample(SiteUsers siteUsers); public Set<UserType> getUserType(); public SiteUsers getSiteUsersById(SiteUsers siteUsers); public boolean resetPassword(String email,String newPassword); public SiteUsers getSiteUsersById(long userId); public boolean saveUserAddress(Address address); public UserType getUserType( long id); public List<UserJobCategoryMap> getUserJobCategories(long userId); public List<UserJobSubCategoryMap> getUserJobSubCategories(long userId); public boolean isUsernameExist(String username); public String getUserPhoneNo(long userId); public String getUserLoginEmailAddress(long userId); }
[ "feysal@f0de6d7c-5c98-4a70-9b99-ebcc080b4637" ]
feysal@f0de6d7c-5c98-4a70-9b99-ebcc080b4637
0b6f1a121572f21890a25883c07003490714dfed
d42385e7adc5f2d7c27b0bee1322e73762ea01f3
/src/loxapizza/LoxaPizza.java
54daa3c695f5fbfdc5ed865c74b54612e7ae9145
[]
no_license
joseabad123/loxapizza
ecfe4d4c474580ac556e58be029feee9a69dfb88
81286bca22ac04369f72bc0312a1723e7b9f8b3f
refs/heads/main
2023-06-20T06:52:29.750174
2021-07-12T19:37:46
2021-07-12T19:37:46
385,360,829
0
0
null
null
null
null
UTF-8
Java
false
false
451
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package loxapizza; /** * * @author LENOVO */ public class LoxaPizza { // // /** // * @param args the command line arguments // */ // public static void main(String[] args) { // // TODO code application logic here // // } // }
[ "jmabad2@utpl.edu.ec" ]
jmabad2@utpl.edu.ec
0128b6f66b7526af350526109dffefdfa3ff000e
8aab6d13011914e37f2d679dd58080e61c93c320
/app/src/main/java/com/odiousrainbow/leftovers/Helpers/AlarmNotificationReceiver.java
0ddc4315eede294777e7874eb92f9431810fe1f3
[]
no_license
lgkidz/Tula
da67ff108e8debb892188211c0a49063223e6a8f
1f15d1291a13be42aa3a45fe0e8be634d22093c3
refs/heads/master
2020-04-03T08:54:50.033850
2019-06-09T04:55:36
2019-06-09T04:55:36
155,148,922
0
0
null
null
null
null
UTF-8
Java
false
false
806
java
package com.odiousrainbow.leftovers.Helpers; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.support.v4.app.NotificationCompat; public class AlarmNotificationReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String title = intent.getStringExtra("notiTitle"); String message = intent.getStringExtra("notiMessage"); NotificationHelper notificationHelper = new NotificationHelper(context); NotificationCompat.Builder builder = notificationHelper.getChannel1Notification(title,message); int uniqueInt = (int) (System.currentTimeMillis() & 0xfffffff); notificationHelper.getManager().notify(uniqueInt,builder.build()); } }
[ "lgkidz1@gmail.com" ]
lgkidz1@gmail.com
fdd88ed5c08ed9df84da6a9f28f5102cde3f57e1
c6198c9956f9911223a224c6b94e0738ac008323
/src/main/java/com/belvedere/service/dto/UserDTO.java
e145121a4261fa97ff5b752ec537390126986fdb
[]
no_license
renzobelve/enredados
e0d0498305266e9fdb0c5bc9efe4f32173e6118c
35ca78c620403069d452e5bdde8bc8a076b575a7
refs/heads/master
2021-01-22T22:20:32.434733
2017-09-16T19:24:48
2017-09-16T19:24:48
92,769,951
0
0
null
null
null
null
UTF-8
Java
false
false
4,218
java
package com.belvedere.service.dto; import com.belvedere.config.Constants; import com.belvedere.domain.Authority; import com.belvedere.domain.User; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotBlank; import javax.validation.constraints.*; import java.time.Instant; import java.util.Set; import java.util.stream.Collectors; /** * A DTO representing a user, with his authorities. */ public class UserDTO { private Long id; @Pattern(regexp = Constants.LOGIN_REGEX) @Size(min = 1, max = 50) private String login; @Size(max = 50) private String firstName; @Size(max = 50) private String lastName; @Email(message = "La direccion de E-Mail ingresada es invalida") @NotBlank @Size(min = 5, max = 100) private String email; @Size(max = 256) private String imageUrl; private boolean activated = false; @Size(min = 2, max = 5) private String langKey; private String createdBy; private Instant createdDate; private String lastModifiedBy; private Instant lastModifiedDate; private Set<String> authorities; public UserDTO() { // Empty constructor needed for Jackson. } public UserDTO(User user) { this(user.getId(), user.getLogin(), user.getFirstName(), user.getLastName(), user.getEmail(), user.getActivated(), user.getImageUrl(), user.getLangKey(), user.getCreatedBy(), user.getCreatedDate(), user.getLastModifiedBy(), user.getLastModifiedDate(), user.getAuthorities().stream().map(Authority::getName) .collect(Collectors.toSet())); } public UserDTO(Long id, String login, String firstName, String lastName, String email, boolean activated, String imageUrl, String langKey, String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate, Set<String> authorities) { this.id = id; this.login = login; this.firstName = firstName; this.lastName = lastName; this.email = email; this.activated = activated; this.imageUrl = imageUrl; this.langKey = langKey; this.createdBy = createdBy; this.createdDate = createdDate; this.lastModifiedBy = lastModifiedBy; this.lastModifiedDate = lastModifiedDate; this.authorities = authorities; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getEmail() { return email; } public String getImageUrl() { return imageUrl; } public boolean isActivated() { return activated; } public String getLangKey() { return langKey; } public String getCreatedBy() { return createdBy; } public Instant getCreatedDate() { return createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public Set<String> getAuthorities() { return authorities; } @Override public String toString() { return "UserDTO{" + "login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", imageUrl='" + imageUrl + '\'' + ", activated=" + activated + ", langKey='" + langKey + '\'' + ", createdBy=" + createdBy + ", createdDate=" + createdDate + ", lastModifiedBy='" + lastModifiedBy + '\'' + ", lastModifiedDate=" + lastModifiedDate + ", authorities=" + authorities + "}"; } }
[ "renzobelvedere@MacBook-Pro-de-Renzo.local" ]
renzobelvedere@MacBook-Pro-de-Renzo.local
6cceea0bab1d4599d8833b13151cb4f5c8de7fc8
f142763230c425e012c0f3eb8a2d3c78f3fd337f
/jeethink-framework/src/main/java/com/jeethink/framework/datasource/DynamicDataSourceContextHolder.java
eef19df6608ee5285cab1a34e5595fce92d14833
[]
no_license
FlyGitHubPower/jeeThinkManager
a06d92c3190cdcb6a81cf32cd25fe4cc732f4b0c
76ba5ac53dac76422a0002a4f75f1c865f701004
refs/heads/master
2023-06-17T10:18:43.770474
2021-07-13T13:38:00
2021-07-13T13:38:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,125
java
package com.jeethink.framework.datasource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 数据源切换处理 * * @author jeethink */ public class DynamicDataSourceContextHolder { public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); /** * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 */ private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>(); /** * 设置数据源的变量 */ public static void setDataSourceType(String dsType) { log.info("切换到{}数据源", dsType); CONTEXT_HOLDER.set(dsType); } /** * 获得数据源的变量 */ public static String getDataSourceType() { return CONTEXT_HOLDER.get(); } /** * 清空数据源变量 */ public static void clearDataSourceType() { CONTEXT_HOLDER.remove(); } }
[ "1991995430@qq.com" ]
1991995430@qq.com
c906bb51125697db6ea8613a02b83f74d15f093d
88d03e42bfba1d1b221faa1169a1035f14f58342
/src/main/java/org/uma/jmetalmsa/util/SynchronizedMersenneTwister.java
d28964febf1a4bc7ae51bfd74dbc8b3e3689d9f0
[]
no_license
ali-nayeem/MSA
a68d2af0afad9b15516ef026c9f6bcd75b1d892f
5bada137053657c804dc8531fb1564babf737996
refs/heads/master
2021-09-24T16:40:56.267774
2021-09-09T11:34:35
2021-09-09T11:34:35
95,363,332
1
1
null
2020-10-12T18:52:41
2017-06-25T14:02:34
Java
UTF-8
Java
false
false
3,231
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.uma.jmetalmsa.util; /** * * @author Nayeem */ import java.security.SecureRandom; import java.util.Random; import org.apache.commons.math3.random.MersenneTwister; import org.uma.jmetal.util.pseudorandom.PseudoRandomGenerator; public class SynchronizedMersenneTwister extends Random implements PseudoRandomGenerator { private static final long serialVersionUID = -4586969514356530381L; private static Random SEEDER; private static SynchronizedMersenneTwister INSTANCE; private static ThreadLocal<MersenneTwister> LOCAL_RANDOM; private static final String name = "SynchronizedMersenneTwister" ; static { SEEDER = new SecureRandom(); LOCAL_RANDOM = new ThreadLocal<MersenneTwister>() { @Override protected MersenneTwister initialValue() { synchronized (SEEDER) { return new MersenneTwister(SEEDER.nextLong()); } } }; INSTANCE = new SynchronizedMersenneTwister(); } private SynchronizedMersenneTwister() { super(); } public static SynchronizedMersenneTwister getInstance() { return INSTANCE; } private MersenneTwister current() { return LOCAL_RANDOM.get(); } public synchronized void setSeed(long seed) { current().setSeed(seed); } public void nextBytes(byte[] bytes) { current().nextBytes(bytes); } @Override public int nextInt() { return current().nextInt(); } @Override public int nextInt(int n) { return current().nextInt(n); } public long nextLong() { return current().nextLong(); } public boolean nextBoolean() { return current().nextBoolean(); } public float nextFloat() { return current().nextFloat(); } @Override public double nextDouble() { return current().nextDouble(); } @Override public synchronized double nextGaussian() { return current().nextGaussian(); } @Override public int nextInt(int lowerBound, int upperBound) { return lowerBound + current().nextInt((upperBound - lowerBound) + 1); } @Override public double nextDouble(double lowerBound, double upperBound) { return lowerBound + current().nextDouble()*(upperBound - lowerBound) ; } @Override public long getSeed() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public String getName() { return name; } public synchronized double nextGaussian(double mean, double standardDeviation) { return nextGaussian() * standardDeviation + mean; } }
[ "Nayeem@ACER-MAN" ]
Nayeem@ACER-MAN
a7f150e79528f82b8b08a11d4dc57cf953635151
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/salesforce/android/chat/ui/internal/view/AvatarViewBinderBuilder.java
beb66b30545a81582bb8ddb9610756c4e206f6e3
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
package com.salesforce.android.chat.ui.internal.view; import com.salesforce.android.chat.ui.internal.presenter.Presenter; import com.salesforce.android.chat.ui.internal.state.AvatarCache; import com.salesforce.android.chat.ui.internal.view.ViewBinder; public interface AvatarViewBinderBuilder<V extends ViewBinder, P extends Presenter> extends ViewBinderBuilder<V, P> { AvatarViewBinderBuilder<V, P> avatarCache(AvatarCache avatarCache); }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
4d0d2dbf68cbe7cb2611fb4131c697bc8cbfe7be
ac3f5f0715c6e3e18246a219ff0c09613bfc1ccc
/src/test/java/io/github/crudigor/todo/TodoApplicationTests.java
412f07b97e8b1973b475f547ccfe6eede58f0f60
[]
no_license
drakelima/apiTodoSpring
280000d535cd6dd358fc7f5cb8da1f25d498ab5c
4a3537e049b76322648ba882ee1b3a7f1b3184f4
refs/heads/master
2023-06-18T18:13:46.441822
2021-07-01T13:26:53
2021-07-01T13:26:53
382,028,635
0
0
null
null
null
null
UTF-8
Java
false
false
213
java
package io.github.crudigor.todo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class TodoApplicationTests { @Test void contextLoads() { } }
[ "comercial@solinvestimentos.com" ]
comercial@solinvestimentos.com
254b61ab65d261fc6af913d9ca792fe41705340f
ade7c08ffe19011559e3d63fc3efdc0f7d530dc0
/src/test/java/com/TestRunner/TestRunner_JPet_Project_CTS.java
2e2ffd1b5b9e20f6ba006d890ac9d739e0e945b4
[]
no_license
Abhishek-Shrivastava-Git/Abhishek_Shrivastava_844887_JPet_Store
3de8753428131c38a5b2cb1b47b122a65208ffcb
692313967cc5ecddb814182199a84ef6b8b70964
refs/heads/master
2021-05-16T20:54:17.406421
2020-03-27T07:12:47
2020-03-27T07:12:47
250,464,801
0
0
null
2021-04-26T20:06:06
2020-03-27T07:08:08
Java
UTF-8
Java
false
false
1,086
java
/*------------Test_Runner_File_Using_JUnit------------*/ package com.TestRunner; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( //Path_Of_Feature_File********************************************************** features = {"src\\main\\resources\\Feature\\JPet_Project_CTS.feature"}, plugin = {"pretty", "html:Reports/cucumber-html-report","json:Reports/cucumber-json-report/jsonreport","com.cucumber.listener.ExtentCucumberFormatter:Reports/cucumber-Extentreport-report//report.html"}, //Test_Cases_To_Be_Executed**************************************************** tags = {"@TC_01_Registeration,@TC_02_Login_The_User,@TC_03_Search_Product_Add_To_Cart,@TC_04_Print_Table,@TC_05_Signout_User_From_JPet_Web_Application"}, //Package_Name_Containing_Step_Definition_Files************************************* glue = {"com.StepDefinition"}, //dryRun = true, monochrome=true ) // public class TestRunner_JPet_Project_CTS { }
[ "Abhi@DESKTOP-NB6B10B" ]
Abhi@DESKTOP-NB6B10B
9b3fa84f5dc367f479802d3813c76137b9e1c426
b7e1b73741eb1f927d6a322a045686db7437909c
/src/org/fpe4j/Ciphers.java
61130000f4865fb2c5d44b6a949de87bf8d48c02
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
alexsaen/Format-Preserving-Encryption
4c46b45cc81eb7a059f54b83d946388892604981
f8ba063f13505c5f4e652557c369607a05ef2395
refs/heads/master
2021-01-10T22:39:01.082895
2016-08-17T22:52:36
2016-08-17T22:52:36
69,708,360
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
7,699
java
/** * Format-Preserving Encryption * * Copyright (c) 2016 Weydstone LLC dba Sutton Abinger * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. Sutton Abinger licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License * at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package org.fpe4j; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; /** * Common cipher functions for FF1 and FF3 based on AES. * * @author Kai Johnson * */ public class Ciphers { /** * Instance of the AES cipher in ECB mode with no padding. */ private Cipher mAesEcbCipher; /** * Instance of the AES cipher in CBC mode with no padding. */ private Cipher mAesCbcCipher; /** * Constructs a Ciphers instance with the required AES ciphers. */ protected Ciphers() { try { mAesEcbCipher = Cipher.getInstance("AES/ECB/NoPadding"); mAesCbcCipher = Cipher.getInstance("AES/CBC/NoPadding"); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { // this would be a programming error so convert to an unchecked // exception throw new RuntimeException(e); } } /** * NIST SP 800-38G Algorithm 6: PRF(X) - Applies the pseudorandom function * to the input using the supplied key. * <p> * Prerequisites:<br> * Designated cipher function, CIPH, of an approved 128-bit block * cipher;<br> * Key, K, for the block cipher. * <p> * Input:<br> * Block string, X. * <p> * Output:<br> * Block, Y. * * @param K * The AES key for the cipher function. * @param X * The block string input. * @return The output of the function PRF applied to the block X; PRF is * defined in terms of a given designated cipher function. * @throws InvalidKeyException * If the key is not a valid AES key. */ protected byte[] prf(SecretKey K, byte[] X) throws InvalidKeyException { // validate K if (K == null) throw new NullPointerException("K must not be null"); if (!K.getAlgorithm().equals("AES")) throw new InvalidKeyException("K must contain an AES key"); // validate X if (X == null) throw new NullPointerException("X must not be null"); if (X.length < 1 || X.length > Constants.MAXLEN) throw new IllegalArgumentException( "The length of X is not within the permitted range of 1.." + Constants.MAXLEN + ": " + X.length); // 1. Let m = LEN(X)/128. // i.e. BYTELEN(X)/16 int m = X.length / 16; // 2. Let X[1], …, X[m] be the blocks for which X = X[1] || … || X[m]. // we extract the blocks inside the for loop // 3. Let Y(0) = bitstring(0,128), and byte[] Y = Common.bitstring(false, 128); // for j from 1 to m let Y(j) = CIPH(K,Y(j–1) xor X[j]). for (int j = 0; j < m; j++) { byte[] Xj = Arrays.copyOfRange(X, j * 16, j * 16 + 16); try { mAesEcbCipher.init(Cipher.ENCRYPT_MODE, K); Y = mAesEcbCipher.doFinal(Common.xor(Y, Xj)); } catch (IllegalBlockSizeException | BadPaddingException e) { // these would be programming errors so convert to an unchecked // exception throw new RuntimeException(e); } } // 4. Return Y(m). return Y; } /** * Equivalent implementation of the PRF(X) algorithm using the AES CBC * cipher with a zero initialization vector. * <p> * The PRF(X) algorithm is an implementation of CBC mode encryption with a * zero initialization vector. PRF(X) then extracts the last block as the * result. Instead of implementing CBC by hand, this method uses the Java * libraries to perform the same operation, and to demonstrate the * equivalence of the methods. * * @param K * The AES key for the cipher function * @param X * The block string input * @return The output of the function PRF applied to the block X; PRF is * defined in terms of a given designated cipher function. * @throws InvalidKeyException * If the key is not a valid AES key. */ protected byte[] prf2(SecretKey K, byte[] X) throws InvalidKeyException { // validate K if (K == null) throw new NullPointerException("K must not be null"); if (!K.getAlgorithm().equals("AES")) throw new InvalidKeyException("K must be an AES key"); // validate X if (X == null) throw new NullPointerException("X must not be null"); if (X.length < 1 || X.length > Constants.MAXLEN) throw new IllegalArgumentException( "The length of X is not within the permitted range of 1.." + Constants.MAXLEN + ": " + X.length); byte[] Z; try { byte[] Y = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 }; mAesCbcCipher.init(Cipher.ENCRYPT_MODE, K, new IvParameterSpec(Y)); Z = mAesCbcCipher.doFinal(X); } catch (IllegalBlockSizeException | BadPaddingException | InvalidAlgorithmParameterException e) { // these would be programming errors so convert to an unchecked // exception throw new RuntimeException(e); } return Arrays.copyOfRange(Z, Z.length - 16, Z.length); } /** * Encrypts the input using the AES block cipher in ECB mode using the * specified key. * <p> * Although the ECB mode of operation is not explicitly mentioned in NIST SP * 800-38G, it is implied by the use of the CIPH(X) function in FF1 and FF3. * <p> * To quote NIST SP 800-38G, "For both of the modes, the underlying block * cipher shall be approved, and the block size shall be 128 bits. * Currently, the AES block cipher, with key lengths of 128, 192, or 256 * bits, is the only block cipher that fits this profile." * * @param K * The AES key for the cipher function * @param X * The block string input * @return The output of the cipher function applied to the block X. * @throws InvalidKeyException * If the key is not a valid AES key. */ protected byte[] ciph(SecretKey K, byte[] X) throws InvalidKeyException { // validate K if (K == null) throw new NullPointerException("K must not be null"); if (!K.getAlgorithm().equals("AES")) throw new InvalidKeyException("K must be an AES key"); // validate X if (X == null) throw new NullPointerException("X must not be null"); if (X.length < 1 || X.length > Constants.MAXLEN) throw new IllegalArgumentException( "The length of X is not within the permitted range of 1.." + Constants.MAXLEN + ": " + X.length); byte[] cipherText; try { mAesEcbCipher.init(Cipher.ENCRYPT_MODE, K); cipherText = mAesEcbCipher.doFinal(X); } catch (IllegalBlockSizeException | BadPaddingException e) { // these would be programming errors so convert to an unchecked // exception throw new RuntimeException(e); } return cipherText; } }
[ "kai@suttonabinger.com" ]
kai@suttonabinger.com
bc6b94c1d29ba54242217b86ee775bd9cfce15fa
802d98d35d5e9a077d6f918a0917db5a3b0a6a79
/src/ClientMain.java
9d1b5c48d3176020cab880122134d2355552c7d5
[]
no_license
RoNiN-23/ArcDZ
567a631d9d2c18f7e4e1177de6fa29b4904dc969
1e12dcea45a906c45a88bdad9054f81ddd71165c
refs/heads/master
2023-08-18T07:25:07.210060
2021-09-29T11:57:52
2021-09-29T11:57:52
411,655,050
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
import java.rmi.NotBoundException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; public class ClientMain { public static final String UNIQUE_BINDING_NAME = "server.calculator"; public static void main(String[] args) throws RemoteException, NotBoundException { final Registry registry = LocateRegistry.getRegistry(8080); Calc calculator = (Calc) registry.lookup(UNIQUE_BINDING_NAME); String equationResult = calculator.equation(1, -8, 15); System.out.println(equationResult); } }
[ "smegr@mail.ru" ]
smegr@mail.ru
80660a28c5f3a5b6823d48f874813521865e07f1
cf4e783b7483e30107314e74bfb15dc42b57d766
/java-se-bootcamp/java-se-bootcamp/src/main/java/bootcamp/java/number8/Example16.java
25b10f2f5d4a3509cd8498d36a51c9a39a322886
[]
no_license
hector-hc/java-se-8-examples
940746017a914e2ad156cc853e1959a7c816543f
e889c4b3b91cc7657da66531816e2fca94594185
refs/heads/master
2022-07-01T12:01:53.915816
2020-04-05T03:12:54
2020-04-05T03:12:54
197,471,286
0
0
null
2022-06-21T03:08:24
2019-07-17T22:22:59
Java
UTF-8
Java
false
false
862
java
/** * Class: Example16.java * Author: hector.hernandez * Date: Feb 8, 2020 */ package bootcamp.java.number8; import java.util.Arrays; /** * @author hector.hernandez * @Version 1.0 */ public class Example16 { public static void main(String[] args) { Student []students = { new Student("cs011", "Lennon ", 3.1), new Student("cs021", "McCartney", 3.4), new Student("cs012", "Harrison ", 2.7), new Student("cs022", "Starr ", 3.7) }; System.out.println("Before sorting by CGPA "); System.out.println("Student-ID \t Name \t CGPA (for 4.0) "); System.out.println(Arrays.toString(students)); Arrays.sort(students, new CGPAComparator()); System.out.println("After sorting by CGPA"); System.out.println("Student-ID \t Name \t CGPA (for 4.0) "); System.out.println(Arrays.toString(students)); } }
[ "hector.hdez.chavez@gmail.com" ]
hector.hdez.chavez@gmail.com
e7b2019b41af3024a41b13880c90af277dff6937
62ce4cfb795d4ca737012c5f3ff0c097fb61b4ae
/app/src/main/java/com/contreras/myquizapplication/Util/Constantes.java
4a8e32e4aa01dffacbbebd3b708e2967468e8e8a
[]
no_license
rensocontreras/QuizTheWords-V1.0-Sqlite
c3a47c01997759d20f7fd64ed43060128268a42c
1085ab4e0f26e8568deab922a698a00a9a1ef00d
refs/heads/master
2022-01-25T08:01:14.160939
2019-06-17T20:37:46
2019-06-17T20:37:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,472
java
package com.contreras.myquizapplication.Util; public class Constantes { /** SERIALIZABLE**/ public static final String OBJ_NIVEL_ACTUAL="obj_nivel_actual"; public static final String OBJ_COMPETICION_ACTUAL="obj_competicion_actual"; /** NIVEL **/ public static final String N_NUMERO_NIVEL = "numero_nivel"; public static final String N_TOT_PREGUNTAS = "tot_preguntas"; public static final String N_LIMITE_PREGUNTAS = "limite_preguntas"; /** PREGUNTAS**/ public static final String P_NUMERO_PREGUNTA = "numero_pregunta"; public static final String P_NUMERO_NIVEL = "numero_nivel"; public static final String P_CONTENIDO_PREGUNTA = "contenido_pregunta"; public static final String P_OPCION1 = "opcion1"; public static final String P_OPCION2 = "opcion2"; public static final String P_OPCION3 = "opcion3"; public static final String P_OPCION4 = "opcion4"; public static final String P_RESPUESTA = "respuesta"; /** USUARIOS**/ public static final String U_CODIGO_USUARIO = "codigo_usuario"; public static final String U_NOMBRES = "nombres"; public static final String U_APELLIDOS = "apellidos"; public static final String U_CORREO = "correo"; public static final String U_PASSWORD = "password"; public static final String U_SEXO = "sexo"; /** COMPITE**/ public static final String C_CODIGO_USUARIO = "codigo_usuario"; public static final String C_NUMERO_NIVEL = "numero_nivel"; public static final String C_ESTADO_CANDADO = "estado_candado"; public static final String C_PREGUNTAS_RESUELTAS = "preguntas_resueltas"; public static final String C_MY_TIMER = "my_timer"; /** TOP **/ public static final String T_NUMERO_NIVEL = "numero_nivel"; public static final String T_CODIGO_USUARIO = "codigo_usuario"; public static final String T_MY_TIMER = "my_timer"; public static final String T_PREGUNTAS_RESUELTAS = "preguntas_resueltas"; /* ITEM COMPETIDOR TOP*/ public static final String IT_NUMERO_NIVEL = "numero_nivel"; public static final String IT_CODIGO_USUARIO = "codigo_usuario"; public static final String IT_NOMBRES = "nombres"; public static final String IT_SEXO = "sexo"; public static final String IT_MY_TIMER = "my_timer"; public static final String IT_PREGUNTAS_RESUELTAS = "preguntas_resueltas"; /**PREFERENCES**/ public static final String PREFERENCIA_USUARIO = "codigo_usuario"; }
[ "rensocontreras@hotmail.com" ]
rensocontreras@hotmail.com
8348e4dba3f72b0ec73d2b3cafa7cb76263fb8eb
a89a8f6b20f9c28b4b3ef2fd963e084251be19f4
/AverageofLevelsinBinaryTree/src/AverageofLevelsinBinaryTree.java
f195ceaf2e9a8302915413a9ca08f7e415ff9309
[]
no_license
lalitchilka/LeetCode
468f20444976c50c28124044b7bf66bd93b6401c
d61f16d3e9bef62b7e595c6b162a0df725e8a865
refs/heads/master
2021-11-09T03:40:04.791065
2021-11-01T11:41:16
2021-11-01T11:41:16
223,133,012
0
0
null
2020-07-02T17:54:18
2019-11-21T09:08:05
Java
UTF-8
Java
false
false
1,036
java
import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; public class AverageofLevelsinBinaryTree { public static void main(String[] args) { // TODO Auto-generated method stub TreeNode t1 = new TreeNode(3); TreeNode t2 = new TreeNode(9); TreeNode t3 = new TreeNode(20); TreeNode t4 = new TreeNode(15); TreeNode t5 = new TreeNode(7); t1.left = t2; t1.right = t3; t3.left = t4; t3.right = t5; System.out.println(averageOfLevels(t1)); } private static List<Double> averageOfLevels(TreeNode root) { Queue<TreeNode> q = new LinkedList<TreeNode>(); List<Double> l = new ArrayList<Double>(); q.add(root); while(q.size() != 0) { int size = q.size(); double sum = 0; for(int i = 0; i < size; i++) { TreeNode temp = q.poll(); if(temp.left != null) q.add(temp.left); if(temp.right != null) q.add(temp.right); sum += temp.val; } l.add(sum / size); } return l; } }
[ "l.chilka@eldro-la.eldro1.local" ]
l.chilka@eldro-la.eldro1.local
0ea7eb387663c69932be794daec14d73c4a8460b
c20234a8072962eb5c272412e55ac90525c7e3b3
/2021/3_March/Week_4/Day24_AdvantageShuffle.java
3f2ad625bc01f6959b0e45a82f800a27de9198c0
[]
no_license
Nedhro/Java
6b01bc96b0bb18e949e8f0ebd207b07fcdcf5507
d15b220bfcd7604be645c498d6c50c8c8a9d5453
refs/heads/main
2023-06-29T02:44:32.274868
2021-07-31T18:23:04
2021-07-31T18:23:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
//Day 24: //Problem Statement: Advantage Shuffle // Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]. // Return any permutation of A that maximizes its advantage with respect to B. // Example 1: // Input: A = [2,7,11,15], B = [1,10,4,11] // Output: [2,11,7,15] // Example 2: // Input: A = [12,24,8,32], B = [13,25,32,11] // Output: [24,32,8,12] // Note: // 1 <= A.length = B.length <= 10000 // 0 <= A[i] <= 10^9 // 0 <= B[i] <= 10^9 //Solution: class Solution { public int[] advantageCount(int[] a, int[] b) { int[] ans=new int[a.length]; Arrays.sort(a); PriorityQueue<int[]> pq=new PriorityQueue<>((x, y) -> y[1]-x[1]); for(int i=0; i<b.length; i++) { pq.offer(new int[]{i, b[i]}); } int slow=0, fast=a.length-1; while(!pq.isEmpty()) { int[] top=pq.poll(); ans[top[0]] = top[1]>=a[fast] ? a[slow++]: a[fast--]; } return ans; } } //Complexity: O(n*logn)
[ "v.anushka786@gmail.com" ]
v.anushka786@gmail.com
fa8adc0acc3a9e7f25205acd63ea067dc6054c4e
39723eae63b30bba1dc2e6bade36eea0c5d982cb
/wemo_apk/java_code/org/apache/http/impl/cookie/RFC2965VersionAttributeHandler.java
3d1b1fdbca9daff2c6148b92ce63b543e03d5df0
[]
no_license
haoyu-liu/crack_WeMo
39142e3843b16cdf0e3c88315d1bfbff0d581827
cdca239427cb170316e9774886a4eed9a5c51757
refs/heads/master
2020-03-22T21:40:45.425229
2019-02-24T13:48:11
2019-02-24T13:48:11
140,706,494
1
1
null
null
null
null
UTF-8
Java
false
false
1,112
java
package org.apache.http.impl.cookie; import org.apache.http.cookie.Cookie; import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.SetCookie; @Deprecated public class RFC2965VersionAttributeHandler implements CookieAttributeHandler { public RFC2965VersionAttributeHandler() { throw new RuntimeException("Stub!"); } public boolean match(Cookie paramCookie, CookieOrigin paramCookieOrigin) { throw new RuntimeException("Stub!"); } public void parse(SetCookie paramSetCookie, String paramString) throws MalformedCookieException { throw new RuntimeException("Stub!"); } public void validate(Cookie paramCookie, CookieOrigin paramCookieOrigin) throws MalformedCookieException { throw new RuntimeException("Stub!"); } } /* Location: /root/Documents/wemo_apk/classes-dex2jar.jar!/org/apache/http/impl/cookie/RFC2965VersionAttributeHandler.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "root@localhost.localdomain" ]
root@localhost.localdomain
719a610fdef9c92c87cdffb38503018663f19dfc
d08416f961d92edd3f6a9ed753ae26891af7b5fc
/src/game/Tracker.java
32c08e7ec48a5e755562bd22d7cc676f2491d4cb
[]
no_license
WDibble/platformer-demo
f0648589993f4a05aa9fa938896c09661878db9a
cf65de94fffc0eb65e8a5d43719beb9f49cad2aa
refs/heads/master
2022-11-28T14:56:34.868843
2020-08-09T11:04:31
2020-08-09T11:04:31
283,803,955
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
package game; import city.cs.engine.Body; import city.cs.engine.StepEvent; import city.cs.engine.StepListener; import city.cs.engine.WorldView; import org.jbox2d.common.Vec2; /** * @author Will Dibble wodibble@gmail.com * @version 1.13.2 * @since 1.0 * This class is Tracker. * This class allows the camera to follow the players movement in the game. */ public class Tracker implements StepListener { private WorldView view; private Body body; /** * Tracker so camera follows player movement. * * @param view The Players View. * @param body The Player. */ public Tracker(WorldView view, Body body) { this.view = view; this.body = body; } @Override public void preStep(StepEvent e) { } @Override public void postStep(StepEvent e) { view.setCentre(new Vec2(body.getPosition())); } }
[ "wodibble@gmail.com" ]
wodibble@gmail.com
f7150c7c59f2dbfc3048ad8f5ccef7dbbf505d87
2c669ccff008612f6e12054d9162597f2088442c
/MEVO_apkpure.com_source_from_JADX/sources/okhttp3/OkHttpClient.java
aec263182528b28aff0fa0750aaeccdd9a35d9f0
[]
no_license
PythonicNinja/mevo
e97fb27f302cb3554a69b27022dada2134ff99c0
cab7cea9376085caead1302b93e62e0d34a75470
refs/heads/master
2020-05-02T22:32:46.764930
2019-03-28T23:37:51
2019-03-28T23:37:51
178,254,526
1
0
null
null
null
null
UTF-8
Java
false
false
25,823
java
package okhttp3; import io.fabric.sdk.android.services.common.AbstractSpiCall; import java.net.MalformedURLException; import java.net.Proxy; import java.net.ProxySelector; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyStore; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Random; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; import javax.net.SocketFactory; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; import okhttp3.Call.Factory; import okhttp3.internal.Internal; import okhttp3.internal.Util; import okhttp3.internal.cache.InternalCache; import okhttp3.internal.connection.RealConnection; import okhttp3.internal.connection.RouteDatabase; import okhttp3.internal.connection.StreamAllocation; import okhttp3.internal.platform.Platform; import okhttp3.internal.tls.CertificateChainCleaner; import okhttp3.internal.tls.OkHostnameVerifier; import okhttp3.internal.ws.RealWebSocket; public class OkHttpClient implements Cloneable, Factory, WebSocket.Factory { static final List<ConnectionSpec> DEFAULT_CONNECTION_SPECS = Util.immutableList(ConnectionSpec.MODERN_TLS, ConnectionSpec.CLEARTEXT); static final List<Protocol> DEFAULT_PROTOCOLS = Util.immutableList(Protocol.HTTP_2, Protocol.HTTP_1_1); final Authenticator authenticator; @Nullable final Cache cache; @Nullable final CertificateChainCleaner certificateChainCleaner; final CertificatePinner certificatePinner; final int connectTimeout; final ConnectionPool connectionPool; final List<ConnectionSpec> connectionSpecs; final CookieJar cookieJar; final Dispatcher dispatcher; final Dns dns; final EventListener.Factory eventListenerFactory; final boolean followRedirects; final boolean followSslRedirects; final HostnameVerifier hostnameVerifier; final List<Interceptor> interceptors; @Nullable final InternalCache internalCache; final List<Interceptor> networkInterceptors; final int pingInterval; final List<Protocol> protocols; @Nullable final Proxy proxy; final Authenticator proxyAuthenticator; final ProxySelector proxySelector; final int readTimeout; final boolean retryOnConnectionFailure; final SocketFactory socketFactory; @Nullable final SSLSocketFactory sslSocketFactory; final int writeTimeout; public static final class Builder { Authenticator authenticator; @Nullable Cache cache; @Nullable CertificateChainCleaner certificateChainCleaner; CertificatePinner certificatePinner; int connectTimeout; ConnectionPool connectionPool; List<ConnectionSpec> connectionSpecs; CookieJar cookieJar; Dispatcher dispatcher; Dns dns; EventListener.Factory eventListenerFactory; boolean followRedirects; boolean followSslRedirects; HostnameVerifier hostnameVerifier; final List<Interceptor> interceptors; @Nullable InternalCache internalCache; final List<Interceptor> networkInterceptors; int pingInterval; List<Protocol> protocols; @Nullable Proxy proxy; Authenticator proxyAuthenticator; ProxySelector proxySelector; int readTimeout; boolean retryOnConnectionFailure; SocketFactory socketFactory; @Nullable SSLSocketFactory sslSocketFactory; int writeTimeout; public Builder() { this.interceptors = new ArrayList(); this.networkInterceptors = new ArrayList(); this.dispatcher = new Dispatcher(); this.protocols = OkHttpClient.DEFAULT_PROTOCOLS; this.connectionSpecs = OkHttpClient.DEFAULT_CONNECTION_SPECS; this.eventListenerFactory = EventListener.factory(EventListener.NONE); this.proxySelector = ProxySelector.getDefault(); this.cookieJar = CookieJar.NO_COOKIES; this.socketFactory = SocketFactory.getDefault(); this.hostnameVerifier = OkHostnameVerifier.INSTANCE; this.certificatePinner = CertificatePinner.DEFAULT; this.proxyAuthenticator = Authenticator.NONE; this.authenticator = Authenticator.NONE; this.connectionPool = new ConnectionPool(); this.dns = Dns.SYSTEM; this.followSslRedirects = true; this.followRedirects = true; this.retryOnConnectionFailure = true; this.connectTimeout = AbstractSpiCall.DEFAULT_TIMEOUT; this.readTimeout = AbstractSpiCall.DEFAULT_TIMEOUT; this.writeTimeout = AbstractSpiCall.DEFAULT_TIMEOUT; this.pingInterval = 0; } Builder(OkHttpClient okHttpClient) { this.interceptors = new ArrayList(); this.networkInterceptors = new ArrayList(); this.dispatcher = okHttpClient.dispatcher; this.proxy = okHttpClient.proxy; this.protocols = okHttpClient.protocols; this.connectionSpecs = okHttpClient.connectionSpecs; this.interceptors.addAll(okHttpClient.interceptors); this.networkInterceptors.addAll(okHttpClient.networkInterceptors); this.eventListenerFactory = okHttpClient.eventListenerFactory; this.proxySelector = okHttpClient.proxySelector; this.cookieJar = okHttpClient.cookieJar; this.internalCache = okHttpClient.internalCache; this.cache = okHttpClient.cache; this.socketFactory = okHttpClient.socketFactory; this.sslSocketFactory = okHttpClient.sslSocketFactory; this.certificateChainCleaner = okHttpClient.certificateChainCleaner; this.hostnameVerifier = okHttpClient.hostnameVerifier; this.certificatePinner = okHttpClient.certificatePinner; this.proxyAuthenticator = okHttpClient.proxyAuthenticator; this.authenticator = okHttpClient.authenticator; this.connectionPool = okHttpClient.connectionPool; this.dns = okHttpClient.dns; this.followSslRedirects = okHttpClient.followSslRedirects; this.followRedirects = okHttpClient.followRedirects; this.retryOnConnectionFailure = okHttpClient.retryOnConnectionFailure; this.connectTimeout = okHttpClient.connectTimeout; this.readTimeout = okHttpClient.readTimeout; this.writeTimeout = okHttpClient.writeTimeout; this.pingInterval = okHttpClient.pingInterval; } public Builder connectTimeout(long j, TimeUnit timeUnit) { this.connectTimeout = Util.checkDuration("timeout", j, timeUnit); return this; } public Builder readTimeout(long j, TimeUnit timeUnit) { this.readTimeout = Util.checkDuration("timeout", j, timeUnit); return this; } public Builder writeTimeout(long j, TimeUnit timeUnit) { this.writeTimeout = Util.checkDuration("timeout", j, timeUnit); return this; } public Builder pingInterval(long j, TimeUnit timeUnit) { this.pingInterval = Util.checkDuration("interval", j, timeUnit); return this; } public Builder proxy(@Nullable Proxy proxy) { this.proxy = proxy; return this; } public Builder proxySelector(ProxySelector proxySelector) { this.proxySelector = proxySelector; return this; } public Builder cookieJar(CookieJar cookieJar) { if (cookieJar == null) { throw new NullPointerException("cookieJar == null"); } this.cookieJar = cookieJar; return this; } void setInternalCache(@Nullable InternalCache internalCache) { this.internalCache = internalCache; this.cache = null; } public Builder cache(@Nullable Cache cache) { this.cache = cache; this.internalCache = null; return this; } public Builder dns(Dns dns) { if (dns == null) { throw new NullPointerException("dns == null"); } this.dns = dns; return this; } public Builder socketFactory(SocketFactory socketFactory) { if (socketFactory == null) { throw new NullPointerException("socketFactory == null"); } this.socketFactory = socketFactory; return this; } public Builder sslSocketFactory(SSLSocketFactory sSLSocketFactory) { if (sSLSocketFactory == null) { throw new NullPointerException("sslSocketFactory == null"); } this.sslSocketFactory = sSLSocketFactory; this.certificateChainCleaner = Platform.get().buildCertificateChainCleaner(sSLSocketFactory); return this; } public Builder sslSocketFactory(SSLSocketFactory sSLSocketFactory, X509TrustManager x509TrustManager) { if (sSLSocketFactory == null) { throw new NullPointerException("sslSocketFactory == null"); } else if (x509TrustManager == null) { throw new NullPointerException("trustManager == null"); } else { this.sslSocketFactory = sSLSocketFactory; this.certificateChainCleaner = CertificateChainCleaner.get(x509TrustManager); return this; } } public Builder hostnameVerifier(HostnameVerifier hostnameVerifier) { if (hostnameVerifier == null) { throw new NullPointerException("hostnameVerifier == null"); } this.hostnameVerifier = hostnameVerifier; return this; } public Builder certificatePinner(CertificatePinner certificatePinner) { if (certificatePinner == null) { throw new NullPointerException("certificatePinner == null"); } this.certificatePinner = certificatePinner; return this; } public Builder authenticator(Authenticator authenticator) { if (authenticator == null) { throw new NullPointerException("authenticator == null"); } this.authenticator = authenticator; return this; } public Builder proxyAuthenticator(Authenticator authenticator) { if (authenticator == null) { throw new NullPointerException("proxyAuthenticator == null"); } this.proxyAuthenticator = authenticator; return this; } public Builder connectionPool(ConnectionPool connectionPool) { if (connectionPool == null) { throw new NullPointerException("connectionPool == null"); } this.connectionPool = connectionPool; return this; } public Builder followSslRedirects(boolean z) { this.followSslRedirects = z; return this; } public Builder followRedirects(boolean z) { this.followRedirects = z; return this; } public Builder retryOnConnectionFailure(boolean z) { this.retryOnConnectionFailure = z; return this; } public Builder dispatcher(Dispatcher dispatcher) { if (dispatcher == null) { throw new IllegalArgumentException("dispatcher == null"); } this.dispatcher = dispatcher; return this; } public Builder protocols(List<Protocol> list) { List arrayList = new ArrayList(list); StringBuilder stringBuilder; if (arrayList.contains(Protocol.HTTP_1_1) == null) { stringBuilder = new StringBuilder(); stringBuilder.append("protocols doesn't contain http/1.1: "); stringBuilder.append(arrayList); throw new IllegalArgumentException(stringBuilder.toString()); } else if (arrayList.contains(Protocol.HTTP_1_0) != null) { stringBuilder = new StringBuilder(); stringBuilder.append("protocols must not contain http/1.0: "); stringBuilder.append(arrayList); throw new IllegalArgumentException(stringBuilder.toString()); } else if (arrayList.contains(null) != null) { throw new IllegalArgumentException("protocols must not contain null"); } else { arrayList.remove(Protocol.SPDY_3); this.protocols = Collections.unmodifiableList(arrayList); return this; } } public Builder connectionSpecs(List<ConnectionSpec> list) { this.connectionSpecs = Util.immutableList((List) list); return this; } public List<Interceptor> interceptors() { return this.interceptors; } public Builder addInterceptor(Interceptor interceptor) { if (interceptor == null) { throw new IllegalArgumentException("interceptor == null"); } this.interceptors.add(interceptor); return this; } public List<Interceptor> networkInterceptors() { return this.networkInterceptors; } public Builder addNetworkInterceptor(Interceptor interceptor) { if (interceptor == null) { throw new IllegalArgumentException("interceptor == null"); } this.networkInterceptors.add(interceptor); return this; } public Builder eventListener(EventListener eventListener) { if (eventListener == null) { throw new NullPointerException("eventListener == null"); } this.eventListenerFactory = EventListener.factory(eventListener); return this; } public Builder eventListenerFactory(EventListener.Factory factory) { if (factory == null) { throw new NullPointerException("eventListenerFactory == null"); } this.eventListenerFactory = factory; return this; } public OkHttpClient build() { return new OkHttpClient(this); } } /* renamed from: okhttp3.OkHttpClient$1 */ class C08981 extends Internal { C08981() { } public void addLenient(okhttp3.Headers.Builder builder, String str) { builder.addLenient(str); } public void addLenient(okhttp3.Headers.Builder builder, String str, String str2) { builder.addLenient(str, str2); } public void setCache(Builder builder, InternalCache internalCache) { builder.setInternalCache(internalCache); } public boolean connectionBecameIdle(ConnectionPool connectionPool, RealConnection realConnection) { return connectionPool.connectionBecameIdle(realConnection); } public RealConnection get(ConnectionPool connectionPool, Address address, StreamAllocation streamAllocation, Route route) { return connectionPool.get(address, streamAllocation, route); } public boolean equalsNonHost(Address address, Address address2) { return address.equalsNonHost(address2); } public Socket deduplicate(ConnectionPool connectionPool, Address address, StreamAllocation streamAllocation) { return connectionPool.deduplicate(address, streamAllocation); } public void put(ConnectionPool connectionPool, RealConnection realConnection) { connectionPool.put(realConnection); } public RouteDatabase routeDatabase(ConnectionPool connectionPool) { return connectionPool.routeDatabase; } public int code(okhttp3.Response.Builder builder) { return builder.code; } public void apply(ConnectionSpec connectionSpec, SSLSocket sSLSocket, boolean z) { connectionSpec.apply(sSLSocket, z); } public HttpUrl getHttpUrlChecked(String str) throws MalformedURLException, UnknownHostException { return HttpUrl.getChecked(str); } public StreamAllocation streamAllocation(Call call) { return ((RealCall) call).streamAllocation(); } public Call newWebSocketCall(OkHttpClient okHttpClient, Request request) { return RealCall.newRealCall(okHttpClient, request, true); } } static { Internal.instance = new C08981(); } public OkHttpClient() { this(new Builder()); } OkHttpClient(Builder builder) { StringBuilder stringBuilder; this.dispatcher = builder.dispatcher; this.proxy = builder.proxy; this.protocols = builder.protocols; this.connectionSpecs = builder.connectionSpecs; this.interceptors = Util.immutableList(builder.interceptors); this.networkInterceptors = Util.immutableList(builder.networkInterceptors); this.eventListenerFactory = builder.eventListenerFactory; this.proxySelector = builder.proxySelector; this.cookieJar = builder.cookieJar; this.cache = builder.cache; this.internalCache = builder.internalCache; this.socketFactory = builder.socketFactory; loop0: while (true) { Object obj = null; for (ConnectionSpec connectionSpec : this.connectionSpecs) { if (obj != null || connectionSpec.isTls()) { obj = 1; } } break loop0; } if (builder.sslSocketFactory == null) { if (obj != null) { X509TrustManager systemDefaultTrustManager = systemDefaultTrustManager(); this.sslSocketFactory = systemDefaultSslSocketFactory(systemDefaultTrustManager); this.certificateChainCleaner = CertificateChainCleaner.get(systemDefaultTrustManager); this.hostnameVerifier = builder.hostnameVerifier; this.certificatePinner = builder.certificatePinner.withCertificateChainCleaner(this.certificateChainCleaner); this.proxyAuthenticator = builder.proxyAuthenticator; this.authenticator = builder.authenticator; this.connectionPool = builder.connectionPool; this.dns = builder.dns; this.followSslRedirects = builder.followSslRedirects; this.followRedirects = builder.followRedirects; this.retryOnConnectionFailure = builder.retryOnConnectionFailure; this.connectTimeout = builder.connectTimeout; this.readTimeout = builder.readTimeout; this.writeTimeout = builder.writeTimeout; this.pingInterval = builder.pingInterval; if (this.interceptors.contains(null) != null) { stringBuilder = new StringBuilder(); stringBuilder.append("Null interceptor: "); stringBuilder.append(this.interceptors); throw new IllegalStateException(stringBuilder.toString()); } else if (this.networkInterceptors.contains(null) != null) { stringBuilder = new StringBuilder(); stringBuilder.append("Null network interceptor: "); stringBuilder.append(this.networkInterceptors); throw new IllegalStateException(stringBuilder.toString()); } } } this.sslSocketFactory = builder.sslSocketFactory; this.certificateChainCleaner = builder.certificateChainCleaner; this.hostnameVerifier = builder.hostnameVerifier; this.certificatePinner = builder.certificatePinner.withCertificateChainCleaner(this.certificateChainCleaner); this.proxyAuthenticator = builder.proxyAuthenticator; this.authenticator = builder.authenticator; this.connectionPool = builder.connectionPool; this.dns = builder.dns; this.followSslRedirects = builder.followSslRedirects; this.followRedirects = builder.followRedirects; this.retryOnConnectionFailure = builder.retryOnConnectionFailure; this.connectTimeout = builder.connectTimeout; this.readTimeout = builder.readTimeout; this.writeTimeout = builder.writeTimeout; this.pingInterval = builder.pingInterval; if (this.interceptors.contains(null) != null) { stringBuilder = new StringBuilder(); stringBuilder.append("Null interceptor: "); stringBuilder.append(this.interceptors); throw new IllegalStateException(stringBuilder.toString()); } else if (this.networkInterceptors.contains(null) != null) { stringBuilder = new StringBuilder(); stringBuilder.append("Null network interceptor: "); stringBuilder.append(this.networkInterceptors); throw new IllegalStateException(stringBuilder.toString()); } } private X509TrustManager systemDefaultTrustManager() { try { TrustManagerFactory instance = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); instance.init((KeyStore) null); TrustManager[] trustManagers = instance.getTrustManagers(); if (trustManagers.length == 1) { if (trustManagers[0] instanceof X509TrustManager) { return (X509TrustManager) trustManagers[0]; } } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("Unexpected default trust managers:"); stringBuilder.append(Arrays.toString(trustManagers)); throw new IllegalStateException(stringBuilder.toString()); } catch (Exception e) { throw Util.assertionError("No System TLS", e); } } private SSLSocketFactory systemDefaultSslSocketFactory(X509TrustManager x509TrustManager) { try { SSLContext sSLContext = Platform.get().getSSLContext(); sSLContext.init(null, new TrustManager[]{x509TrustManager}, null); return sSLContext.getSocketFactory(); } catch (X509TrustManager x509TrustManager2) { throw Util.assertionError("No System TLS", x509TrustManager2); } } public int connectTimeoutMillis() { return this.connectTimeout; } public int readTimeoutMillis() { return this.readTimeout; } public int writeTimeoutMillis() { return this.writeTimeout; } public int pingIntervalMillis() { return this.pingInterval; } public Proxy proxy() { return this.proxy; } public ProxySelector proxySelector() { return this.proxySelector; } public CookieJar cookieJar() { return this.cookieJar; } public Cache cache() { return this.cache; } InternalCache internalCache() { return this.cache != null ? this.cache.internalCache : this.internalCache; } public Dns dns() { return this.dns; } public SocketFactory socketFactory() { return this.socketFactory; } public SSLSocketFactory sslSocketFactory() { return this.sslSocketFactory; } public HostnameVerifier hostnameVerifier() { return this.hostnameVerifier; } public CertificatePinner certificatePinner() { return this.certificatePinner; } public Authenticator authenticator() { return this.authenticator; } public Authenticator proxyAuthenticator() { return this.proxyAuthenticator; } public ConnectionPool connectionPool() { return this.connectionPool; } public boolean followSslRedirects() { return this.followSslRedirects; } public boolean followRedirects() { return this.followRedirects; } public boolean retryOnConnectionFailure() { return this.retryOnConnectionFailure; } public Dispatcher dispatcher() { return this.dispatcher; } public List<Protocol> protocols() { return this.protocols; } public List<ConnectionSpec> connectionSpecs() { return this.connectionSpecs; } public List<Interceptor> interceptors() { return this.interceptors; } public List<Interceptor> networkInterceptors() { return this.networkInterceptors; } public EventListener.Factory eventListenerFactory() { return this.eventListenerFactory; } public Call newCall(Request request) { return RealCall.newRealCall(this, request, false); } public WebSocket newWebSocket(Request request, WebSocketListener webSocketListener) { WebSocket realWebSocket = new RealWebSocket(request, webSocketListener, new Random(), (long) this.pingInterval); realWebSocket.connect(this); return realWebSocket; } public Builder newBuilder() { return new Builder(this); } }
[ "mail@pythonic.ninja" ]
mail@pythonic.ninja
5346727a09772da82cd8cbb6d528527a482a39e6
f5cf630c3877112b9146665494e52dd81732c8ac
/src/main/java/com/connected/model/LinkedNode.java
6b9ec1c3fa6adc23f5ee417a119be9f4661010e5
[]
no_license
AleksWithCoffee/Connected-client-1
97d33d96661986a3e30263f8581bd63d96e7b546
e519cecb41b92ebd2d00d1484829af71f50284c6
refs/heads/master
2020-05-07T16:07:22.050815
2019-04-10T21:56:29
2019-04-10T21:56:29
180,669,219
0
0
null
2019-04-10T21:52:35
2019-04-10T21:52:34
null
UTF-8
Java
false
false
768
java
package com.connected.model; import java.net.Socket; import java.util.Scanner; public class LinkedNode implements Runnable { private Socket socket; private Interpreter interpreter; public LinkedNode(Socket socket, Interpreter interpreter) throws Exception { this.socket = socket; this.interpreter =interpreter; } @Override public void run() { try (Scanner scanner = new Scanner(socket.getInputStream())) { while (true) { if (scanner.hasNextLine()) { String serverMessage = scanner.nextLine(); String action = interpreter.extractAction(serverMessage); int order = interpreter.getOrder(action); interpreter.followTheOrder(order, serverMessage); } } } catch (Exception e) { throw new RuntimeException(e); } } }
[ "aleksanderroztro@gmail.com" ]
aleksanderroztro@gmail.com
469d761dd4098c308c9b6408a5cb43aa36881c30
3fc8e9865e8675d5e39493e9e28211acc494af28
/src/test/java/dukecooks/testutil/diary/PageBuilder.java
8527f2bbfdedead4e1e9cdee44763e67a2bf2058
[ "MIT", "LicenseRef-scancode-other-permissive" ]
permissive
AY1920S1-CS2103T-T10-2/main
d51e3aa96bb6b63780ebb348139eb074751ee474
a3516960584f4705adf7c13b3ca3db8e510aaa75
refs/heads/master
2020-07-23T06:38:53.970294
2019-11-15T12:12:06
2019-11-15T12:12:06
207,470,044
0
2
NOASSERTION
2019-11-14T16:16:28
2019-09-10T05:08:18
Java
UTF-8
Java
false
false
2,273
java
package dukecooks.testutil.diary; import dukecooks.model.Image; import dukecooks.model.diary.components.Page; import dukecooks.model.diary.components.PageDescription; import dukecooks.model.diary.components.PageType; import dukecooks.model.diary.components.Title; /** * A utility class to help with building Page objects. */ public class PageBuilder { public static final String DEFAULT_TITLE = "Sushi"; public static final String DEFAULT_DESCRIPTION = "This is a test description!!"; public static final String DEFAULT_PAGE_TYPE = "food"; public static final String DEFAULT_IMAGE = "/images/sushi.jpg"; private Title title; private PageDescription description; private PageType pageType; private Image image; public PageBuilder() { title = new Title(DEFAULT_TITLE); description = new PageDescription(DEFAULT_DESCRIPTION); pageType = new PageType(DEFAULT_PAGE_TYPE); image = new Image(DEFAULT_IMAGE); } /** * Initializes the PageBuilder with the data of {@code pageToCopy}. */ public PageBuilder(Page pageToCopy) { title = pageToCopy.getTitle(); description = pageToCopy.getDescription(); pageType = pageToCopy.getPageType(); image = pageToCopy.getImage(); } /** * Sets the {@code Title} of the {@code Page} that we are building. */ public PageBuilder withTitle(String title) { this.title = new Title(title); return this; } /** * Sets the {@code PageDescription} of the {@code Page} that we are building. */ public PageBuilder withPageDescription(String description) { this.description = new PageDescription(description); return this; } /** * Sets the {@code PageType} of the {@code Page} that we are building. */ public PageBuilder withPageType(String pageType) { this.pageType = new PageType(pageType); return this; } /** * Sets the {@code Image} of the {@code Page} that we are building. */ public PageBuilder withImage(String image) { this.image = new Image(image); return this; } public Page build() { return new Page(title, pageType, description, image); } }
[ "junwei.97@hotmail.com" ]
junwei.97@hotmail.com
042ed6eb7d53e290e959d6de569151887cc8d5a8
bb96ec95bffec89de9b35c3e7e74d3887dc85701
/arcaniumOS-server/src/main/java/org/arcanium/plugin/Plugin.java
0cb26cbd0a42166149e11b4a1fbd3db0afafe5c9
[]
no_license
Shadowrs/OSRS-PS
fb3fff1fea34942e3a0566b7d5c2b791fbb0ce83
8148d18102135a3ed6f918c29aaaefea8ab4d668
refs/heads/master
2020-05-01T16:25:08.904595
2019-03-21T01:15:50
2019-03-21T01:15:50
177,571,376
0
1
null
2019-03-25T11:15:54
2019-03-25T11:15:54
null
UTF-8
Java
false
false
553
java
package org.arcanium.plugin; /** * Represents a plugin. * @author Emperor * @param <T> The argument type. */ public interface Plugin<T> { /** * Creates a new instance. * @param arg The argument. * @return The plugin instance created. */ Plugin<T> newInstance(T arg) throws Throwable; /** * Fires a plugin event. * @param identifier The identifier. * @param args The arguments. * @return Specified by the plugin implementation. */ Object fireEvent(String identifier, Object... args); }
[ "zeruth09@gmail.com" ]
zeruth09@gmail.com
3127616a37e8c5626e8dfab11add06115d03a441
2734d4c7e80ff2f11d99596bf5df45323fc230b8
/HttpServer/src/com/servlet/office/util/HtmlHelper.java
59fa13281ced25b65247a9ea3b88cc3ebf12ea63
[ "Apache-2.0" ]
permissive
aqi00/net_server
af9c14e9d237436350aee40425759277ec8497b0
77e8ddb831ac89c761301f763984802d5e1bacc8
refs/heads/master
2023-03-30T19:07:38.888580
2023-03-27T02:05:47
2023-03-27T02:05:47
135,550,076
51
30
null
null
null
null
UTF-8
Java
false
false
194
java
package com.servlet.office.util; import java.util.Formatter; import org.apache.poi.ss.usermodel.CellStyle; public interface HtmlHelper { void colorStyles(CellStyle var1, Formatter var2); }
[ "aqi00@163.com" ]
aqi00@163.com
3a4b0ca68b78df71ace8766394714cdf57fae8a5
afc7e492d43d7743180fc93920cc0bac206d9851
/src/main/java/org/mybatis/generator/extend/codegen/mybatis3/ExtendIntrospectedTableMyBatis3Impl.java
bc167a5f579c1aaa1ae7a95ea6d6ba960ead5baa
[]
no_license
freegeese/mybatis-generator-extend
455dfe091eccdfdb8133edb3948ade438e1437a5
63ca6dfef1020118f8acc58d69cedf73119aca6d
refs/heads/master
2021-01-11T23:57:43.863455
2017-02-27T03:16:56
2017-02-27T03:16:56
78,650,830
2
0
null
null
null
null
UTF-8
Java
false
false
4,681
java
package org.mybatis.generator.extend.codegen.mybatis3; import org.mybatis.generator.api.GeneratedJavaFile; import org.mybatis.generator.api.GeneratedXmlFile; import org.mybatis.generator.api.ProgressCallback; import org.mybatis.generator.api.dom.java.CompilationUnit; import org.mybatis.generator.api.dom.xml.Document; import org.mybatis.generator.codegen.AbstractJavaClientGenerator; import org.mybatis.generator.codegen.mybatis3.IntrospectedTableMyBatis3Impl; import org.mybatis.generator.extend.GeneratorUtils; import org.mybatis.generator.extend.codegen.mybatis3.xmlmapper.ExtendXMLMapperGenerator; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by Administrator on 2017/1/8. */ public class ExtendIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Impl { // 文档对象(xml文件)与生成文件对象之间的映射 private static Map<String, GeneratedXmlFile> documentWithGeneratedFileMap = new HashMap<>(); // 编译单元(java文件)与生成文件对象之间的映射 private static Map<String, GeneratedJavaFile> compilationUnitWithGeneratedFileMap = new HashMap<>(); /** * 创建Xml Mapper File 生成器 * * @param javaClientGenerator * @param warnings * @param progressCallback */ @Override protected void calculateXmlMapperGenerator(AbstractJavaClientGenerator javaClientGenerator, List<String> warnings, ProgressCallback progressCallback) { // 使用扩展的Xml Mapper生成器 xmlMapperGenerator = new ExtendXMLMapperGenerator(); initializeAbstractGenerator(xmlMapperGenerator, warnings, progressCallback); } /** * <p> * 覆盖获取获取生成Xml文件对象的接口,添加可覆盖xml内容的属性(isMerge:true 是合并,false 是覆盖) * 保存编译单元与Java文件对象之间的映射关系 * </p> * * @return */ @Override public List<GeneratedXmlFile> getGeneratedXmlFiles() { List<GeneratedXmlFile> answer = new ArrayList<GeneratedXmlFile>(); // 添加是否合并参数 ------------------ boolean merge = true; String isMerge = context.getSqlMapGeneratorConfiguration().getProperty("isMerge"); if (null != isMerge) { merge = Boolean.valueOf(isMerge); } if (xmlMapperGenerator != null) { Document document = xmlMapperGenerator.getDocument(); GeneratedXmlFile gxf = new GeneratedXmlFile(document, getMyBatis3XmlMapperFileName(), getMyBatis3XmlMapperPackage(), context.getSqlMapGeneratorConfiguration().getTargetProject(), merge, context.getXmlFormatter()); if (context.getPlugins().sqlMapGenerated(gxf, this)) { answer.add(gxf); documentWithGeneratedFileMap.put(GeneratorUtils.getDocumentNamespace(document), gxf); } } return answer; } /** * <p> * 覆盖获取获取生成Java文件对象的接口,保存编译单元与Java文件对象之间的映射关系 * </p> * * @return */ @Override public List<GeneratedJavaFile> getGeneratedJavaFiles() { List<GeneratedJavaFile> javaFiles = super.getGeneratedJavaFiles(); int size = javaFiles.size(); GeneratedJavaFile javaFile = null; String javaFileClassName = null; for (int i = 0; i < size; i++) { javaFile = javaFiles.get(i); javaFileClassName = GeneratorUtils.getJavaFileClassName(javaFile.getCompilationUnit()); compilationUnitWithGeneratedFileMap.put(javaFileClassName, javaFile); } return javaFiles; } /** * 获取文档对象对应的生成文件对象 * * @param document * @return */ public static GeneratedXmlFile getGeneratedXmlFile(Document document) { return documentWithGeneratedFileMap.get(GeneratorUtils.getDocumentNamespace(document)); } /** * 获取编译单元对应的生成文件对象 * * @param compilationUnit * @return */ public static GeneratedJavaFile getGeneratedJavaFile(CompilationUnit compilationUnit) { return compilationUnitWithGeneratedFileMap.get(GeneratorUtils.getJavaFileClassName(compilationUnit)); } /** * 获取编译单元对应的生成文件对象 * * @param className * @return */ public static GeneratedJavaFile getGeneratedJavaFile(String className) { return compilationUnitWithGeneratedFileMap.get(className); } }
[ "1243610991@qq.com" ]
1243610991@qq.com
b6f5ad0b00743cee7975ecdd6272c131d41e9937
6253283b67c01a0d7395e38aeeea65e06f62504b
/decompile/framework/services/com/android/server/devicepolicy/AbsDevicePolicyManagerService.java
6c1bf9c4ff46fbf7fe51d1755e1b3199080b7790
[]
no_license
sufadi/decompile-hw
2e0457a0a7ade103908a6a41757923a791248215
4c3efd95f3e997b44dd4ceec506de6164192eca3
refs/heads/master
2023-03-15T15:56:03.968086
2017-11-08T03:29:10
2017-11-08T03:29:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
24,864
java
package com.android.server.devicepolicy; import android.app.admin.IDevicePolicyManager.Stub; import android.os.Bundle; import android.util.Log; import android.util.Slog; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; public abstract class AbsDevicePolicyManagerService extends Stub { protected static final boolean HWDBG = false; protected static final boolean HWFLOW; private static final String TAG = "AbsDevicePolicyManagerService"; static class HwActiveAdmin { private static final String ATTR_VALUE = "value"; private static final String DOMAIN = "domain"; private static final String FIELD = "field"; private static final String ID = "id"; private static final String INCOMING = "incoming"; private static final String LABEL = "label"; private static final String OUTGOING = "outgoing"; private static final String PROVIDER = "provider"; private static final String PROVIDERS_PRODUCT = "providers_product"; private static final String TAG_ALLOWED_INSTALL_PACKAGES = "allowed-install-packages"; private static final String TAG_ALLOWED_INSTALL_PACKAGES_ITEM = "allowed-install-packages-item"; private static final String TAG_DISABLED_DEACTIVE_Mdm_PACKAGES = "disabled-deactive-mdm-packages"; private static final String TAG_DISABLED_DEACTIVE_Mdm_PACKAGES_ITEM = "disabled-deactive-mdm-packages-item"; private static final String TAG_DISABLE_ADB = "disable-adb"; private static final String TAG_DISABLE_BACK_KEY = "disable-backKey"; private static final String TAG_DISABLE_BLUETOOTH = "disable-bluetooth"; private static final String TAG_DISABLE_BOOTLOADER = "disable-bootloader"; private static final String TAG_DISABLE_CHANGE_LAUNCHER = "disable-change-launcher"; private static final String TAG_DISABLE_DATA_CONNECTIVITY = "disable-dataconnectivity"; private static final String TAG_DISABLE_DECRYPT_SD_CARD = "disable-decrypt-sd-card"; private static final String TAG_DISABLE_EXTERNAL_STORAGE = "disable-externalstorage"; private static final String TAG_DISABLE_GPS = "disable-gps"; private static final String TAG_DISABLE_HOME_KEY = "disable-homekey"; private static final String TAG_DISABLE_INSTALLSOURCE = "disable-installsource"; private static final String TAG_DISABLE_NFC = "disable-nfc"; private static final String TAG_DISABLE_SAFEMODE = "disable-safemode"; private static final String TAG_DISABLE_SMS = "disable-sms"; private static final String TAG_DISABLE_StatusBar_ExpandPanel = "disable-expandpanel"; private static final String TAG_DISABLE_TASK_KEY = "disable-taskkey"; private static final String TAG_DISABLE_USBDATA = "disable-usbdata"; private static final String TAG_DISABLE_USBOTG = "disable-usbotg"; private static final String TAG_DISABLE_VOICE = "disable-voice"; private static final String TAG_DISABLE_WIFI = "disable-wifi"; private static final String TAG_DISABLE_WIFIAP = "disable-wifiap"; private static final String TAG_DISALLOWED_RUNNING_APP_LIST = "disallowedRunning-app-list"; private static final String TAG_DISALLOWED_RUNNING_APP_LIST_ITEM = "disallowedRunning-app-list-item"; private static final String TAG_DISALLOWED_UNINSTALL_PACKAGES = "disallowed-uninstall-packages"; private static final String TAG_DISALLOWED_UNINSTALL_PACKAGES_ITEM = "disallowed-uninstall-packages-item"; private static final String TAG_INSTALL_SOURCE_WHITELIST = "install-source-whitelist"; private static final String TAG_INSTALL_SOURCE_WHITELIST_ITEM = "install-source-whitelist_item"; private static final String TAG_NETWORK_ACCESS_ADDR_WHITELIST = "network-access-whitelist"; private static final String TAG_NETWORK_ACCESS_ADDR_WHITELIST_ITEM = "network-access-whitelist-item"; private static final String TAG_PERSISTENT_APP_LIST = "persistent-app-list"; private static final String TAG_PERSISTENT_APP_LIST_ITEM = "persistent-app-list-item"; public static final String TAG_POLICIES = "hw_policy"; private static final String URI = "uri"; private static final String USERNAME = "username"; boolean disableAdb = false; boolean disableBackKey = false; boolean disableBluetooth = false; boolean disableBootLoader = false; boolean disableChangeLauncher = false; boolean disableDataConnectivity = false; boolean disableDecryptSDCard = false; boolean disableExternalStorage = false; boolean disableGPS = false; boolean disableHomeKey = false; boolean disableInstallSource = false; boolean disableNFC = false; boolean disableSMS = false; boolean disableSafeMode = false; boolean disableStatusBarExpandPanel = false; boolean disableTaskKey = false; boolean disableUSBData = false; boolean disableUSBOtg = false; boolean disableVoice = false; boolean disableWifi = false; boolean disableWifiAp = false; List<String> disabledDeactiveMdmPackagesList = null; List<String> disallowedRunningAppList = null; List<String> disallowedUninstallPackageList = null; List<String> installPackageWhitelist = null; List<String> installSourceWhitelist = null; List<Bundle> mailProviderlist = null; List<String> networkAccessWhitelist = null; List<String> persistentAppList = null; HwActiveAdmin() { } public void writePoliciesToXml(XmlSerializer out) throws IOException { if (AbsDevicePolicyManagerService.HWFLOW) { Slog.d(AbsDevicePolicyManagerService.TAG, "write policy to xml out"); } out.startTag(null, TAG_POLICIES); if (this.disableWifi) { out.startTag(null, TAG_DISABLE_WIFI); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableWifi)); out.endTag(null, TAG_DISABLE_WIFI); } if (this.disableDecryptSDCard) { out.startTag(null, TAG_DISABLE_DECRYPT_SD_CARD); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableDecryptSDCard)); out.endTag(null, TAG_DISABLE_DECRYPT_SD_CARD); } if (this.disableBluetooth) { out.startTag(null, TAG_DISABLE_BLUETOOTH); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableBluetooth)); out.endTag(null, TAG_DISABLE_BLUETOOTH); } if (this.disableWifiAp) { out.startTag(null, TAG_DISABLE_WIFIAP); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableWifiAp)); out.endTag(null, TAG_DISABLE_WIFIAP); } if (this.disableBootLoader) { out.startTag(null, TAG_DISABLE_BOOTLOADER); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableBootLoader)); out.endTag(null, TAG_DISABLE_BOOTLOADER); } if (this.disableUSBData) { out.startTag(null, TAG_DISABLE_USBDATA); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableUSBData)); out.endTag(null, TAG_DISABLE_USBDATA); } if (this.disableExternalStorage) { out.startTag(null, TAG_DISABLE_EXTERNAL_STORAGE); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableExternalStorage)); out.endTag(null, TAG_DISABLE_EXTERNAL_STORAGE); } if (this.disableNFC) { out.startTag(null, TAG_DISABLE_NFC); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableNFC)); out.endTag(null, TAG_DISABLE_NFC); } if (this.disableDataConnectivity) { out.startTag(null, TAG_DISABLE_DATA_CONNECTIVITY); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableDataConnectivity)); out.endTag(null, TAG_DISABLE_DATA_CONNECTIVITY); } if (this.disableVoice) { out.startTag(null, TAG_DISABLE_VOICE); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableVoice)); out.endTag(null, TAG_DISABLE_VOICE); } if (this.disableSMS) { out.startTag(null, TAG_DISABLE_SMS); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableSMS)); out.endTag(null, TAG_DISABLE_SMS); } if (this.disableStatusBarExpandPanel) { out.startTag(null, TAG_DISABLE_StatusBar_ExpandPanel); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableStatusBarExpandPanel)); out.endTag(null, TAG_DISABLE_StatusBar_ExpandPanel); } if (this.disableInstallSource) { out.startTag(null, TAG_DISABLE_INSTALLSOURCE); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableInstallSource)); out.endTag(null, TAG_DISABLE_INSTALLSOURCE); } if (this.disableSafeMode) { out.startTag(null, TAG_DISABLE_SAFEMODE); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableSafeMode)); out.endTag(null, TAG_DISABLE_SAFEMODE); } if (this.disableAdb) { out.startTag(null, TAG_DISABLE_ADB); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableAdb)); out.endTag(null, TAG_DISABLE_ADB); } if (this.disableUSBOtg) { out.startTag(null, TAG_DISABLE_USBOTG); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableUSBOtg)); out.endTag(null, TAG_DISABLE_USBOTG); } if (this.disableGPS) { out.startTag(null, TAG_DISABLE_GPS); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableGPS)); out.endTag(null, TAG_DISABLE_GPS); } if (this.disableHomeKey) { out.startTag(null, TAG_DISABLE_HOME_KEY); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableHomeKey)); out.endTag(null, TAG_DISABLE_HOME_KEY); } if (this.disableBackKey) { out.startTag(null, TAG_DISABLE_BACK_KEY); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableBackKey)); out.endTag(null, TAG_DISABLE_BACK_KEY); } if (this.disableTaskKey) { out.startTag(null, TAG_DISABLE_TASK_KEY); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableTaskKey)); out.endTag(null, TAG_DISABLE_TASK_KEY); } if (this.disableChangeLauncher) { out.startTag(null, TAG_DISABLE_CHANGE_LAUNCHER); out.attribute(null, ATTR_VALUE, Boolean.toString(this.disableChangeLauncher)); out.endTag(null, TAG_DISABLE_CHANGE_LAUNCHER); } writeListToXml(out, TAG_ALLOWED_INSTALL_PACKAGES, TAG_ALLOWED_INSTALL_PACKAGES_ITEM, this.installPackageWhitelist); writeListToXml(out, TAG_DISALLOWED_UNINSTALL_PACKAGES, TAG_DISALLOWED_UNINSTALL_PACKAGES_ITEM, this.disallowedUninstallPackageList); writeListToXml(out, TAG_INSTALL_SOURCE_WHITELIST, TAG_INSTALL_SOURCE_WHITELIST_ITEM, this.installSourceWhitelist); writeListToXml(out, TAG_PERSISTENT_APP_LIST, TAG_PERSISTENT_APP_LIST_ITEM, this.persistentAppList); writeListToXml(out, TAG_DISALLOWED_RUNNING_APP_LIST, TAG_DISALLOWED_RUNNING_APP_LIST_ITEM, this.disallowedRunningAppList); writeListToXml(out, TAG_NETWORK_ACCESS_ADDR_WHITELIST, TAG_NETWORK_ACCESS_ADDR_WHITELIST_ITEM, this.networkAccessWhitelist); writeListToXml(out, TAG_DISABLED_DEACTIVE_Mdm_PACKAGES, TAG_DISABLED_DEACTIVE_Mdm_PACKAGES_ITEM, this.disabledDeactiveMdmPackagesList); writeProviderListToXml(out, PROVIDERS_PRODUCT, this.mailProviderlist); out.endTag(null, TAG_POLICIES); } public void readPoliciesFromXml(XmlPullParser parser) throws IOException, XmlPullParserException { if (AbsDevicePolicyManagerService.HWFLOW) { Slog.d(AbsDevicePolicyManagerService.TAG, "read policy from xml"); } int outerDepth = parser.getDepth(); while (true) { int type = parser.next(); if (type == 1) { return; } if (type == 3 && parser.getDepth() <= outerDepth) { return; } if (!(type == 3 || type == 4)) { String tag = parser.getName(); if (TAG_DISABLE_WIFI.equals(tag)) { this.disableWifi = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_BLUETOOTH.equals(tag)) { this.disableBluetooth = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_WIFIAP.equals(tag)) { this.disableWifiAp = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_BOOTLOADER.equals(tag)) { this.disableBootLoader = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_USBDATA.equals(tag)) { this.disableUSBData = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_EXTERNAL_STORAGE.equals(tag)) { this.disableExternalStorage = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_NFC.equals(tag)) { this.disableNFC = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_DATA_CONNECTIVITY.equals(tag)) { this.disableDataConnectivity = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_VOICE.equals(tag)) { this.disableVoice = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_SMS.equals(tag)) { this.disableSMS = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_StatusBar_ExpandPanel.equals(tag)) { this.disableStatusBarExpandPanel = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_INSTALLSOURCE.equals(tag)) { this.disableInstallSource = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_SAFEMODE.equals(tag)) { this.disableSafeMode = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_ADB.equals(tag)) { this.disableAdb = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_USBOTG.equals(tag)) { this.disableUSBOtg = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_GPS.equals(tag)) { this.disableGPS = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_HOME_KEY.equals(tag)) { this.disableHomeKey = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_BACK_KEY.equals(tag)) { this.disableBackKey = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_TASK_KEY.equals(tag)) { this.disableTaskKey = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_DISABLE_CHANGE_LAUNCHER.equals(tag)) { this.disableChangeLauncher = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else if (TAG_INSTALL_SOURCE_WHITELIST.equals(tag)) { this.installSourceWhitelist = readListFromXml(parser, TAG_INSTALL_SOURCE_WHITELIST_ITEM); } else if (TAG_ALLOWED_INSTALL_PACKAGES.equals(tag)) { this.installPackageWhitelist = readListFromXml(parser, TAG_ALLOWED_INSTALL_PACKAGES_ITEM); } else if (TAG_DISALLOWED_UNINSTALL_PACKAGES.equals(tag)) { this.disallowedUninstallPackageList = readListFromXml(parser, TAG_DISALLOWED_UNINSTALL_PACKAGES_ITEM); } else if (TAG_DISABLED_DEACTIVE_Mdm_PACKAGES.equals(tag)) { this.disabledDeactiveMdmPackagesList = readListFromXml(parser, TAG_DISABLED_DEACTIVE_Mdm_PACKAGES_ITEM); } else if (TAG_PERSISTENT_APP_LIST.equals(tag)) { this.persistentAppList = readListFromXml(parser, TAG_PERSISTENT_APP_LIST_ITEM); } else if (TAG_DISALLOWED_RUNNING_APP_LIST.equals(tag)) { this.disallowedRunningAppList = readListFromXml(parser, TAG_DISALLOWED_RUNNING_APP_LIST_ITEM); } else if (TAG_NETWORK_ACCESS_ADDR_WHITELIST.equals(tag)) { this.networkAccessWhitelist = readListFromXml(parser, TAG_NETWORK_ACCESS_ADDR_WHITELIST_ITEM); } else if (PROVIDERS_PRODUCT.equals(tag)) { this.mailProviderlist = readPorvidersList(parser, tag); } else if (TAG_DISABLE_DECRYPT_SD_CARD.equals(tag)) { this.disableDecryptSDCard = Boolean.parseBoolean(parser.getAttributeValue(null, ATTR_VALUE)); } else { Slog.w(AbsDevicePolicyManagerService.TAG, "Unknown admin tag: " + tag); } } } } private List<Bundle> readPorvidersList(XmlPullParser parser, String tag) throws XmlPullParserException, IOException { List<Bundle> result = new ArrayList(); int outerDepth = parser.getDepth(); while (true) { int outerType = parser.next(); if (outerType != 1 && (outerType != 3 || parser.getDepth() > outerDepth)) { if (!(outerType == 3 || outerType == 4)) { String tagnew = parser.getName(); if (PROVIDER.equals(tagnew)) { Bundle para = new Bundle(); para.putString(ID, parser.getAttributeValue(null, ID)); para.putString(LABEL, parser.getAttributeValue(null, LABEL)); para.putString(DOMAIN, parser.getAttributeValue(null, DOMAIN)); readProvidersItems(parser, para); result.add(para); } else { Slog.w(AbsDevicePolicyManagerService.TAG, "missing value under inner tag[" + tagnew + "]"); } } } } return result.isEmpty() ? null : result; } void readProvidersItems(XmlPullParser parser, Bundle para) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); while (true) { int outerType = parser.next(); if (outerType == 1) { return; } if (outerType == 3 && parser.getDepth() <= outerDepth) { return; } if (!(outerType == 3 || outerType == 4)) { String tagnew = parser.getName(); if (INCOMING.equals(tagnew) && para != null) { para.putString("incominguri", parser.getAttributeValue(null, URI)); para.putString("incomingusername", parser.getAttributeValue(null, USERNAME)); para.putString("incomingfield", parser.getAttributeValue(null, FIELD)); } else if (!OUTGOING.equals(tagnew) || para == null) { Slog.w(AbsDevicePolicyManagerService.TAG, "missing value under inner tag[" + tagnew + "]"); } else { para.putString("outgoinguri", parser.getAttributeValue(null, URI)); para.putString("outgoingusername", parser.getAttributeValue(null, USERNAME)); } } } } void writeProviderListToXml(XmlSerializer out, String outerTag, List<Bundle> providerList) throws IllegalArgumentException, IllegalStateException, IOException { if (providerList != null) { out.startTag(null, outerTag); for (Bundle para : providerList) { out.startTag(null, PROVIDER); out.attribute(null, ID, para.getString(ID)); out.attribute(null, LABEL, para.getString(LABEL)); out.attribute(null, DOMAIN, para.getString(DOMAIN)); out.startTag(null, INCOMING); out.attribute(null, URI, para.getString("incominguri")); out.attribute(null, USERNAME, para.getString("incomingusername")); out.attribute(null, FIELD, para.getString("incomingfield")); out.endTag(null, INCOMING); out.startTag(null, OUTGOING); out.attribute(null, URI, para.getString("outgoinguri")); out.attribute(null, USERNAME, para.getString("outgoingusername")); out.endTag(null, OUTGOING); out.endTag(null, PROVIDER); } out.endTag(null, outerTag); } } private List<String> readListFromXml(XmlPullParser parser, String tag) throws XmlPullParserException, IOException { if (tag == null || tag.isEmpty()) { return null; } List<String> result = new ArrayList(); int outerDepth = parser.getDepth(); while (true) { int outerType = parser.next(); if (outerType != 1 && (outerType != 3 || parser.getDepth() > outerDepth)) { if (!(outerType == 3 || outerType == 4)) { String outerTag = parser.getName(); if (tag.equals(outerTag)) { String value = parser.getAttributeValue(null, ATTR_VALUE); if (value != null) { result.add(value); } else { Slog.w(AbsDevicePolicyManagerService.TAG, "missing value under inner tag[" + outerTag + "]"); } } } } } if (result.isEmpty()) { result = null; } return result; } void writeListToXml(XmlSerializer out, String outerTag, String innerTag, List<String> someList) throws IllegalArgumentException, IllegalStateException, IOException { if (someList != null && !someList.isEmpty()) { out.startTag(null, outerTag); for (String value : someList) { out.startTag(null, innerTag); out.attribute(null, ATTR_VALUE, value); out.endTag(null, innerTag); } out.endTag(null, outerTag); } } } static { boolean isLoggable = !Log.HWINFO ? Log.HWModuleLog ? Log.isLoggable(TAG, 4) : false : true; HWFLOW = isLoggable; } protected void syncHwDeviceSettingsLocked(int userHandle) { } protected void clearWipeDataFactoryLowlevel(String reason) { } }
[ "liming@droi.com" ]
liming@droi.com
dfa800f77d34815ab2befd6720ab389ddcb14f2f
7b17596553a29a00aeb19a46cafdfb4fa1050ce9
/app/src/test/java/com/example/b/pocket_wallet/ExampleUnitTest.java
0c96eaa7564241275cd6430abf75169e9b098a01
[]
no_license
m-jayy/MobileWallet-RedTheme
5e6573c06871ae256650795cedc5676e3b8cce81
6a61defb12f79c030900f5cc6f196f23120b7b62
refs/heads/master
2023-03-14T10:51:10.892461
2021-03-02T07:35:16
2021-03-02T07:35:16
343,684,948
0
0
null
null
null
null
UTF-8
Java
false
false
421
java
package com.example.b.pocket_wallet; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "m.mohsinjaved2010@gmail.com" ]
m.mohsinjaved2010@gmail.com
1d94857c64aeb24622253973bccd09da5315d369
ee76e2bbcc6cf708098877ffa59907ba00c4018d
/core/src/com/biubiuman/game/DirectedGame.java
6e29356ece3877b03927a7b0e91764705a7605c6
[]
no_license
QUSHAOMING/BiuBiuMan
46d6810d07e435374ad71deb0bb8dde340f10694
9b22e8d5568f2f074d51f2e06f9e28a4f35dbf25
refs/heads/master
2021-01-17T12:56:47.289842
2016-03-30T15:05:05
2016-03-30T15:05:05
38,724,155
0
0
null
null
null
null
UTF-8
Java
false
false
3,781
java
package com.biubiuman.game; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.Pixmap.Format; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.biubiuman.game.model.BattleAction; import com.biubiuman.game.screen.AbstractScreen; import com.biubiuman.game.screen.rtt.ScreenTransition; import com.biubiuman.game.util.Constants; public abstract class DirectedGame implements ApplicationListener { private boolean init; private Screen currScreen; private Screen nextScreen; private FrameBuffer currFbo; private FrameBuffer nextFbo; private SpriteBatch batch; private float t; private ScreenTransition screenTransition; public void setScreen(Screen screen) { setScreen(screen, null); } public void setScreen(Screen screen, ScreenTransition screenTransition) { int w = Gdx.graphics.getWidth(); int h = Gdx.graphics.getHeight(); if (!init) { currFbo = new FrameBuffer(Format.RGB888, w, h, false); nextFbo = new FrameBuffer(Format.RGB888, w, h, false); batch = new SpriteBatch(); init = true; } // start new transition nextScreen = screen; nextScreen.show(); // activate next screen nextScreen.resize(w, h); nextScreen.render(0); // let screen update() once if (currScreen != null) currScreen.pause(); nextScreen.pause(); Gdx.input.setInputProcessor(null); // disable input this.screenTransition = screenTransition; t = 0; } @Override public void render() { // get delta time and ensure an upper limit of one 60th second float deltaTime = Math.min(Gdx.graphics.getDeltaTime(), 1.0f / 60.0f); if (nextScreen == null) { // no ongoing transition if (currScreen != null) currScreen.render(deltaTime); } else { // ongoing transition float duration = 0; if (screenTransition != null) duration = screenTransition.getDuration(); // update progress of ongoing transition t = Math.min(t + deltaTime, duration); if (screenTransition == null || t >= duration) { // no transition effect set or transition has just finished if (currScreen != null) currScreen.hide(); nextScreen.resume(); if (nextScreen instanceof AbstractScreen) { Gdx.input.setInputProcessor(((AbstractScreen) nextScreen) .getInputProcessor()); } else { // nextScreen = (BattleAction)screen; } // enable input for next screen // switch screens currScreen = nextScreen; nextScreen = null; screenTransition = null; } else { // render screens to FBOs currFbo.begin(); if (currScreen != null) currScreen.render(deltaTime); currFbo.end(); nextFbo.begin(); nextScreen.render(deltaTime); nextFbo.end(); // render transition effect to screen float alpha = t / duration; screenTransition.render(batch, currFbo.getColorBufferTexture(), nextFbo.getColorBufferTexture(), alpha); } } } @Override public void resize(int width, int height) { if (currScreen != null) currScreen.resize(width, height); if (nextScreen != null) nextScreen.resize(width, height); } @Override public void pause() { if (currScreen != null) currScreen.pause(); } @Override public void resume() { if (currScreen != null) currScreen.resume(); } @Override public void dispose() { if (currScreen != null) currScreen.hide(); if (nextScreen != null) nextScreen.hide(); if (init) { currFbo.dispose(); currScreen = null; nextFbo.dispose(); nextScreen = null; batch.dispose(); init = false; } } }
[ "15651125909@163.com" ]
15651125909@163.com
c11b792b740ab23b233e07fda6bb70262d6e8e72
42bd79973e3019c02ba259a24ef140e12dd00c55
/src/main/java/basic/str/StrMemoryAllocation.java
82983c8efd9f7381ca996893e3f8d520038eff25
[]
no_license
iMustang/l-jdk
2b9b27ba2cf96297bd303d70cba484137f6fd353
1be195ff74f093e77330747489087d4e6d843883
refs/heads/master
2022-07-15T21:59:17.553017
2020-01-23T05:59:27
2020-01-23T05:59:27
181,631,822
0
0
null
2021-04-26T19:07:54
2019-04-16T06:51:13
Java
UTF-8
Java
false
false
464
java
package basic.str; /** * 字符串内存分配 */ public class StrMemoryAllocation { public static void main(String[] args) { String str1 = "aaa"; String str2 = "bbb"; String str3 = "aaabbb"; String str4 = str1 + str2; String str5 = "aaa" + "bbb"; System.out.println(str1 == new String("aaa"));// false System.out.println(str3 == str4);// false System.out.println(str3 == str4.intern());// true System.out.println(str3 == str5);// true } }
[ "xMustang@foxmail.com" ]
xMustang@foxmail.com
df7903f0e84c180134863c4e74773d8461570cb6
5489cedc9fc60367af28f8e08dcbf0c3057ac238
/shipin/src/main/java/com/example/shipin/ui/fragment/NewsFragment.java
fc07e4268a047f8ffd01d1aa6c0612a76054945f
[]
no_license
xiaoyu1204/All
395d2c5241231c407042e3b1bba254c72073b02a
ffc820a4854adc26cfc1509e294cb7a3d0bf4453
refs/heads/main
2023-02-10T00:48:13.273462
2020-12-24T08:15:51
2020-12-24T08:15:51
324,088,685
0
0
null
null
null
null
UTF-8
Java
false
false
2,950
java
package com.example.shipin.ui.fragment; import android.view.Gravity; import android.view.View; import android.widget.PopupWindow; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.example.shipin.R; import com.example.shipin.adapter.ShowVideoAdapter; import com.example.shipin.adapter.VideoAdapter; import com.example.shipin.base.BaseAdapter; import com.example.shipin.base.BaseFragment; import com.example.shipin.model.bean.VideoBean; import com.example.shipin.presenter.VideoPresenter; import java.util.ArrayList; import java.util.List; import butterknife.BindView; public class NewsFragment extends BaseFragment<VideoPresenter> { @BindView(R.id.mRlv_newest) RecyclerView mRlv; List<VideoBean.DataBean.ListBean> list = new ArrayList<>(); private VideoAdapter adapter; public void setList(List<VideoBean.DataBean.ListBean> list) { this.list = list; } @Override protected int getLayout() { return R.layout.fragment_news; } @Override protected void initView() { mRlv.setLayoutManager(new GridLayoutManager(getActivity(), 2)); adapter = new VideoAdapter(getActivity(),list); mRlv.setAdapter(adapter); adapter.addListClick(new BaseAdapter.IListClick() { @Override public void itemClick(int pos) { videoPopup(pos);//弹出来弹窗 } }); } @Override protected VideoPresenter createpersenter() { return null; } private void videoPopup(int pos) { View view = null; if(view == null){ view = View.inflate(getActivity(),R.layout.video_popu,null); } PopupWindow window = null; if(window == null){ window = new PopupWindow(view,-1,-2); } window.showAtLocation(mRlv, Gravity.CENTER,0,0); ShowVideoAdapter videoAdapter = null; if(videoAdapter == null){ List<VideoBean.DataBean.ListBean> beanList = new ArrayList<>(); for (int i = 0; i <list.size()-pos-1 ; i++) { beanList.add(list.get(i+pos)); } RecyclerView mRec_video = view.findViewById(R.id.mRlv_popup_video); mRec_video.setLayoutManager(new LinearLayoutManager(getActivity())); ShowVideoAdapter showVideoAdapter = new ShowVideoAdapter(getActivity(), beanList); mRec_video.setAdapter(showVideoAdapter); } ShowVideoAdapter finalVideoAdapter = videoAdapter; window.setOnDismissListener(new PopupWindow.OnDismissListener() { @Override public void onDismiss() { finalVideoAdapter.onDestroyVideo(); } }); } @Override protected void initData() { adapter.notifyDataSetChanged(); } }
[ "lxy18501240085@163.com" ]
lxy18501240085@163.com
da839589c65ca9e5ff1bd1730e99a453e5459dd8
b178eacdabbee38b57aca0e2580f565b786fb93d
/src/main/java/org/springframework/session/MapSession.java
59db5dd704a64f409fdf4b44ede144c02eddb4a9
[ "Apache-2.0" ]
permissive
douzhi415/OA
3bd53fdc4ee50ca82f886b13dbc2f01c65376e60
b282ffc71f1bac57786052498a600f407cc71418
refs/heads/master
2021-01-19T01:23:32.141428
2017-03-13T01:21:21
2017-03-13T01:21:21
84,391,047
0
0
null
null
null
null
UTF-8
Java
false
false
5,993
java
/* * Copyright 2014-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.session; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.concurrent.TimeUnit; /** * <p> * A {@link Session} implementation that is backed by a {@link java.util.Map}. The defaults for the properties are: * </p> * <ul> * <li>id - a secure random generated id</li> * <li>creationTime - the moment the {@link MapSession} was instantiated</li> * <li>lastAccessedTime - the moment the {@link MapSession} was instantiated</li> * <li>maxInactiveInterval - 30 minutes</li> * </ul> * * <p> * This implementation has no synchronization, so it is best to use the copy constructor when working on multiple * threads. * </p> * * @author Rob Winch * @since 1.0 */ public final class MapSession implements ExpiringSession, Serializable { /** * Default {@link #setMaxInactiveIntervalInSeconds(int)} (30 minutes). */ public static final int DEFAULT_MAX_INACTIVE_INTERVAL_SECONDS = 1800; private static final long serialVersionUID = 7160779239673823561L; private String id; private Map<String, Object> sessionAttrs = new HashMap<String, Object>(); private long creationTime = System.currentTimeMillis(); private long lastAccessedTime = this.creationTime; /** * Defaults to 30 minutes. */ private int maxInactiveInterval = DEFAULT_MAX_INACTIVE_INTERVAL_SECONDS; /** * Creates a new instance with a secure randomly generated identifier. */ public MapSession() { this(UUID.randomUUID().toString()); } /** * Creates a new instance with the specified id. This is preferred to the default constructor when the id is known * to prevent unnecessary consumption on entropy which can be slow. * * @param id * the identifier to use */ public MapSession(String id) { this.id = id; } /** * Creates a new instance from the provided {@link Session}. * * @param session * the {@link Session} to initialize this {@link Session} with. Cannot be null. */ public MapSession(ExpiringSession session) { if (session == null) { throw new IllegalArgumentException("session cannot be null"); } this.id = session.getId(); this.sessionAttrs = new HashMap<String, Object>(session .getAttributeNames().size()); for (String attrName : session.getAttributeNames()) { Object attrValue = session.getAttribute(attrName); this.sessionAttrs.put(attrName, attrValue); } this.lastAccessedTime = session.getLastAccessedTime(); this.creationTime = session.getCreationTime(); this.maxInactiveInterval = session.getMaxInactiveIntervalInSeconds(); } public void setLastAccessedTime(long lastAccessedTime) { this.lastAccessedTime = lastAccessedTime; } public long getCreationTime() { return this.creationTime; } public String getId() { return this.id; } public long getLastAccessedTime() { return this.lastAccessedTime; } public void setMaxInactiveIntervalInSeconds(int interval) { this.maxInactiveInterval = interval; } public int getMaxInactiveIntervalInSeconds() { return this.maxInactiveInterval; } public boolean isExpired() { return isExpired(System.currentTimeMillis()); } boolean isExpired(long now) { if (this.maxInactiveInterval < 0) { return false; } return (now - TimeUnit.SECONDS.toMillis(this.maxInactiveInterval)) >= this.lastAccessedTime; } @SuppressWarnings("unchecked") public <T> T getAttribute(String attributeName) { return (T) this.sessionAttrs.get(attributeName); } public Set<String> getAttributeNames() { return this.sessionAttrs.keySet(); } public void setAttribute(String attributeName, Object attributeValue) { if (attributeValue == null) { removeAttribute(attributeName); } else { this.sessionAttrs.put(attributeName, attributeValue); } } public void removeAttribute(String attributeName) { this.sessionAttrs.remove(attributeName); } /** * Sets the time that this {@link Session} was created in milliseconds since midnight of 1/1/1970 GMT. The default * is when the {@link Session} was instantiated. * * @param creationTime * the time that this {@link Session} was created in milliseconds since midnight of 1/1/1970 GMT. */ public void setCreationTime(long creationTime) { this.creationTime = creationTime; } /** * Sets the identifier for this {@link Session}. The id should be a secure random generated value to prevent * malicious users from guessing this value. The default is a secure random generated identifier. * * @param id * the identifier for this session. */ public void setId(String id) { this.id = id; } public boolean equals(Object obj) { return obj instanceof Session && this.id.equals(((Session) obj).getId()); } public int hashCode() { return this.id.hashCode(); } }
[ "604447137@qq.com" ]
604447137@qq.com
aa6d1e853fa6249635ecf589aa3141d944f4cca8
df3aa9da3937e14ca980ca3ebcc6cf4557f7de12
/src/source/Bishenge.java
212bc722ce450ccb375070c80a88dc1080c09880
[]
no_license
ShiroNYami/bqgDownloader
1ea1820d3ce6f00a37e77fa0b5793c6936f10b91
8026c0bf63f24fa127f371fd43f634f8792dbfc6
refs/heads/master
2020-04-01T20:55:25.438940
2018-10-18T14:03:06
2018-10-18T14:03:06
153,626,967
0
1
null
2018-10-18T13:18:49
2018-10-18T13:18:48
null
UTF-8
Java
false
false
1,857
java
package source; import bean.Chapter; import bean.ChapterBuffer; import util.RegexUtil; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * Created By zia on 2018/10/5. * 笔神阁 http://www.bishenge.com * 测试约1.5m/s */ public class Bishenge extends FastDownloader { public Bishenge(String bookName, String catalogUrl, String path) { super(bookName, catalogUrl, path); } @Override protected List<Chapter> getChapters(String catalogUrl) throws IOException { String catalogHTML = getHtml(catalogUrl); String sub = RegexUtil.regexExcept("<div id=\"list\">", "</div>", catalogHTML).get(0); String ssub = sub.split("正文</dt>")[1]; List<String> as = RegexUtil.regexInclude("<a", "</a>", ssub); List<Chapter> list = new ArrayList<>(); as.forEach(s -> { RegexUtil.Tag tag = new RegexUtil.Tag(s); Chapter chapter = new Chapter(); chapter.name = tag.getText(); chapter.href = catalogUrl + tag.getValue("href"); list.add(chapter); }); return list; } @Override protected ChapterBuffer adaptBookBuffer(Chapter chapter, int num) throws IOException { ChapterBuffer chapterBuffer = new ChapterBuffer(); chapterBuffer.number = num; chapterBuffer.name = chapter.name; String html = getHtml(chapter.href); String sub = RegexUtil.regexExcept("<div id=\"content\">", "</div>", html).get(0); String lines[] = sub.split("<br>|<br/>|<br />"); List<String> content = new ArrayList<>(); for (String line : lines) { if (!line.isEmpty()){ content.add(cleanContent(line)); } } chapterBuffer.content = content; return chapterBuffer; } }
[ "jzljzljl@outlook.com" ]
jzljzljl@outlook.com
9253fe67341a2a26d752590a6f8ce0bb065c5593
ee1fe4af5bb1e1b88c5f0cda83e327bdd2a48cbb
/core/src/ec/pong/sprites/AiPaddle.java
627e91a073a2826c690fbba79dc0583199a32eca
[]
no_license
Jonas-C/Pong
29380b9e5fc6c9be89560a8e33728c750fff168e
7f4febb61455c143ae38ca2f5235a07a0b388a60
refs/heads/master
2020-12-29T20:36:39.173166
2020-02-10T18:59:13
2020-02-10T18:59:13
235,169,006
0
0
null
null
null
null
UTF-8
Java
false
false
1,298
java
package ec.pong.sprites; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.math.Vector2; public class AiPaddle extends Paddle implements Observer{ private Vector2 desiredPos; private float centerPoint; /* Currently set to the following: Easy: 100 Medium: 300 Hard: 500 */ private final float paddleSpeed; public AiPaddle(float x, float y, Sprite sprite, float paddleSpeed) { super(x, y, sprite); this.paddleSpeed = paddleSpeed; desiredPos = new Vector2(x, y); centerPoint = getPaddleSprite().getRegionHeight() / 2; } private void setDesiredYPos(Vector2 desiredPos){ this.desiredPos.set(desiredPos.x, (int)desiredPos.y + (desiredPos.y > pos.y ? centerPoint : -(centerPoint))); } @Override public void update(float dt){ if(!bounds.contains(desiredPos)){ float newPosY = desiredPos.y <= pos.y ? dt * -(paddleSpeed) : dt * paddleSpeed; updatePosition(newPosY); bounds.setPosition(pos); } } @Override public void resetPaddle(){ super.resetPaddle(); desiredPos.set(pos.x, pos.y); } @Override public void receiveNotification(Object obj) { setDesiredYPos((Vector2) obj); } }
[ "jonas.c@hotmail.no" ]
jonas.c@hotmail.no
d7dd4c9dd6b45b96a10f898b8d982392111a71c8
743c888aa32833046c58210f6e992162565aa922
/src/main/java/com/cmc/persistencia/TObjeto.java
9333e3ff1fee26140cabb0051cf79befe50391e4
[]
no_license
dblasm/ServicioJson
63e0f8e9519f2e220ec0e910f3925edf16bd7006
1f31bd0eb37bfbb84898b4b6fa3ff22384e5578b
refs/heads/master
2023-01-29T15:52:16.439561
2020-12-15T14:45:56
2020-12-15T14:45:56
321,686,180
0
0
null
null
null
null
UTF-8
Java
false
false
1,408
java
package com.cmc.persistencia; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "primaria") public class TObjeto { @Column(name = "ip", nullable = false) private String ip; @Id @Column(name = "id", nullable = false) private String id; @Column(name = "tagname", nullable = false) private String tagName; @Column(name = "idvalor", nullable = false) private String idValor; //Constructores public TObjeto() { } public TObjeto(String ip, String id, String tagName, String idValor) { super(); this.ip = ip; this.id = id; this.tagName = tagName; this.idValor = idValor; } //Accesores public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTagName() { return tagName; } public void setTagName(String tagName) { this.tagName = tagName; } public String getIdValor() { return idValor; } public void setIdValor(String idValor) { this.idValor = idValor; } @Override public String toString() { return "TObjeto [ip=" + ip + ", id=" + id + ", tagName=" + tagName + ", idValor=" + idValor + "]"; } }
[ "alexandru.duma@grupocmc.es" ]
alexandru.duma@grupocmc.es
c03547398eab44e4e1afa79c41567b6b077efcec
62b8441631f0d262bf59e7e2451a88603915aadf
/.svn/pristine/e0/e0b7bcf7ea716f726e6a19dd0b5110bb754d88ca.svn-base
02290c083e56449449784fd2e9c4b4ecd5f38c43
[]
no_license
WJtoy/mainHousehold-
496fc5af19657d938324d384f2d0b72d70e60c0e
4cff9537a5f78058a84d4b33f5f58595380597d8
refs/heads/master
2023-06-17T22:55:08.988873
2021-07-15T07:18:25
2021-07-15T07:18:25
385,202,403
0
0
null
null
null
null
UTF-8
Java
false
false
619
package com.wolfking.jeesite.modules.fi.dao; import com.wolfking.jeesite.common.persistence.LongIDCrudDao; import com.wolfking.jeesite.modules.fi.entity.EngineerChargeMaster; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * Created by Jeff on 2017/4/19. */ @Mapper public interface EngineerChargeMasterDao extends LongIDCrudDao<EngineerChargeMaster> { /** * 根据ID查询工单级别费用 * @param orderId * @return */ EngineerChargeMaster findOrderLevelFee(@Param("orderId") Long orderId, @Param("servicePointId") Long servicePointId); }
[ "1227679550@qq.com" ]
1227679550@qq.com
d60dbb86def2f31010681bb84b59ae0080ea1f9f
7ca0ef5a12e940c7a56df3957ec8df3a7204d7e1
/app/src/main/java/com/lancewu/greendao3gradleplugin/dao/GDao.java
5d707200918e2cd4b9ccd67220598975152fd1c5
[]
no_license
SwordWang0228/Greendao3GradlePlugin
33aef97f2e8a0d7ab0f4729561e49e95bbf77b68
e615a41a4861878446461e33f1a33246bb4e503f
refs/heads/master
2023-04-30T02:05:21.717473
2018-07-24T02:46:38
2018-07-24T02:46:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,767
java
package com.lancewu.greendao3gradleplugin.dao; import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; import com.lancewu.greendao3gradleplugin.bean.G; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "G". */ public class GDao extends AbstractDao<G, Void> { public static final String TABLENAME = "G"; /** * Properties of entity G.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property _id = new Property(0, long.class, "_id", false, "_ID"); } public GDao(DaoConfig config) { super(config); } public GDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"G\" (" + // "\"_ID\" INTEGER NOT NULL );"); // 0: _id } /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"G\""; db.execSQL(sql); } @Override protected final void bindValues(DatabaseStatement stmt, G entity) { stmt.clearBindings(); stmt.bindLong(1, entity.get_id()); } @Override protected final void bindValues(SQLiteStatement stmt, G entity) { stmt.clearBindings(); stmt.bindLong(1, entity.get_id()); } @Override public Void readKey(Cursor cursor, int offset) { return null; } @Override public G readEntity(Cursor cursor, int offset) { G entity = new G( // cursor.getLong(offset + 0) // _id ); return entity; } @Override public void readEntity(Cursor cursor, G entity, int offset) { entity.set_id(cursor.getLong(offset + 0)); } @Override protected final Void updateKeyAfterInsert(G entity, long rowId) { // Unsupported or missing PK type return null; } @Override public Void getKey(G entity) { return null; } @Override public boolean hasKey(G entity) { // TODO return false; } @Override protected final boolean isEntityUpdateable() { return true; } }
[ "wrs@meitu.com" ]
wrs@meitu.com
f80df9c91ead4354b1c7c77d28a7e342e80e8d4a
bcef05b343f8c1ec5dbc6833acd6ecbc1b6d2ae9
/app/src/main/java/br/com/agendanode/app/MainActivity.java
9fbdb27c8302c107a54285597ac19d11312f8a79
[]
no_license
vinicius-colutti/AgendaNode
06a35dea3746b30c20083c56fde2a7397f6b4f14
71db538a216650c99bad1b71d2766db9e888d5f8
refs/heads/master
2021-05-04T14:46:43.347431
2018-02-04T18:21:29
2018-02-04T18:21:29
120,210,662
1
0
null
null
null
null
UTF-8
Java
false
false
4,379
java
package br.com.agendanode.app; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.app.NotificationCompat; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.ListView; import com.google.gson.Gson; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; public class MainActivity extends AppCompatActivity { ListView list_view; Context context; AgendaAdapter adapter; Socket socket; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); context = this; //Floating Button para abrir tela de novo item FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(new Intent(context , NovoItemActivity.class)); } }); list_view = (ListView)findViewById(R.id.list_view); //Inicializando o adapter vazio adapter = new AgendaAdapter(context, R.layout.list_view_item, new ArrayList<ItemAgenda>()); list_view.setAdapter(adapter); carregarItensDaInternet(); try { socket = IO.socket("http://10.0.2.2:8888"); } catch (URISyntaxException e) { e.printStackTrace(); } socket.on("novo_usuario", new Emitter.Listener() { @Override public void call(Object... args) { if(args.length > 0){ Log.d("novo_usuario", args[0].toString()); String json = args[0].toString(); final ItemAgenda item = new Gson().fromJson(json, ItemAgenda.class); //Executar a thread principal runOnUiThread(new Runnable() { @Override public void run() { adapter.add(item); enviarNotificacao(item); } }); } } }); socket.connect(); } private void carregarItensDaInternet() { new Carrega().execute(); } class Carrega extends AsyncTask<Void, Void, Void>{ String retornoJson; @Override protected Void doInBackground(Void... voids) { String caminho = getResources().getString(R.string.caminho); retornoJson = HttpConnection.get(caminho); return null; } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); ItemAgenda[] itens = new Gson().fromJson(retornoJson, ItemAgenda[].class); adapter.clear(); adapter.addAll(Arrays.asList(itens)); } } int nofication_id = 1; public void enviarNotificacao(ItemAgenda item){ Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0,notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setSmallIcon(R.drawable.ic_sms_white_24dp).setContentTitle(item.getTitulo()).setContentText(item.getDetalhes()).setDefaults(Notification.DEFAULT_ALL).setPriority(Notification.PRIORITY_HIGH).setContentIntent(contentIntent).setAutoCancel(true); NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(nofication_id, builder.build()); builder.setContentIntent(contentIntent); } }
[ "claudio@claudio-PC" ]
claudio@claudio-PC
b24efbedd78703b6bec3615a80f3ab652efa46fc
78a238c3efa5200d2bada318ac2a1bd326614e99
/src/main/java/com/zhl/oa/model/entity/note/Note.java
e808ff538d67de40a0dac1686ce3c951ff82141e
[]
no_license
zhl0101/oa_office
1d8989a3c4ec60edbf021e151d9e29585449d1c3
6f90301197996a78d102b79d7922d4cebe95f430
refs/heads/master
2020-05-16T11:23:00.830931
2019-05-04T05:05:45
2019-05-04T05:05:45
183,014,359
0
0
null
null
null
null
UTF-8
Java
false
false
5,205
java
package com.zhl.oa.model.entity.note; import com.zhl.oa.model.entity.user.User; import lombok.Data; import org.hibernate.validator.constraints.NotBlank; import javax.persistence.*; import java.util.Date; import java.util.Set; /** * @ClassName Note * @Description TODO 笔记表 * @Author Administrator * @Date 2019/4/26 0026 22:02 * @Version 1.0 */ @Entity @Table(name = "aoa_note_list") @Data public class Note { @Id @Column(name = "note_id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Long noteId; // 笔记id @NotBlank private String title;// 笔记标题 @NotBlank private String content;// 内容 @Column(name = "catalog_id") private Long catalogId; // 目录id @Column(name = "type_id") private Long typeId; // 类型id @Column(name = "status_id") private Long statusId; // 状态id @Column(name = "attach_id") private Long attachId; // 附件id @Column(name = "create_time") private Date createTime;// 发布时间 @Column(name = "is_collected") private Long isCollected; // 是否收藏 @Column(name = "createman_id") private Long createmanId; // 类型id @Column(name = "receiver") private String receiver;// 笔记分享接收人 @ManyToMany @JoinTable(name = "aoa_receiver_note", joinColumns = { @JoinColumn(name = "note_id") }, inverseJoinColumns = { @JoinColumn(name = "user_id") }) private Set<User> userss; public Note() { } public Note(String title, String content, Long catalogId, Long typeId, Long statusId, Long attachId, Date createTime, Long isCollected) { super(); this.title = title; this.content = content; this.catalogId = catalogId; this.typeId = typeId; this.statusId = statusId; this.attachId = attachId; this.createTime = createTime; this.isCollected = isCollected; } public Note(String title, String content, Long catalogId, Long typeId, Long statusId, Long attachId, Date createTime, Long isCollected, Long createmanId, String receiver, Set<User> userss) { this.title = title; this.content = content; this.catalogId = catalogId; this.typeId = typeId; this.statusId = statusId; this.attachId = attachId; this.createTime = createTime; this.isCollected = isCollected; this.createmanId = createmanId; this.receiver = receiver; this.userss = userss; } public Long getNoteId() { return noteId; } public void setNoteId(Long noteId) { this.noteId = noteId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Long getCatalogId() { return catalogId; } public void setCatalogId(Long catalogId) { this.catalogId = catalogId; } public Long getTypeId() { return typeId; } public void setTypeId(Long typeId) { this.typeId = typeId; } public Long getStatusId() { return statusId; } public void setStatusId(Long statusId) { this.statusId = statusId; } public Long getAttachId() { return attachId; } public void setAttachId(Long attachId) { this.attachId = attachId; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Long getIsCollected() { return isCollected; } public void setIsCollected(Long isCollected) { this.isCollected = isCollected; } public Long getCreatemanId() { return createmanId; } public void setCreatemanId(Long createmanId) { this.createmanId = createmanId; } public String getReceiver() { return receiver; } public void setReceiver(String receiver) { this.receiver = receiver; } public Set<User> getUserss() { return userss; } public void setUserss(Set<User> userss) { this.userss = userss; } @Override public String toString() { return "Note{" + "noteId=" + noteId + ", title='" + title + '\'' + ", content='" + content + '\'' + ", catalogId=" + catalogId + ", typeId=" + typeId + ", statusId=" + statusId + ", attachId=" + attachId + ", createTime=" + createTime + ", isCollected=" + isCollected + ", createmanId=" + createmanId + ", receiver='" + receiver + '\'' + ", userss=" + userss + '}'; } }
[ "1985656933@qq.com" ]
1985656933@qq.com
2ddabe60a8e1efe4b22cd7f946176d79902944ac
c11870493f4c842c0dd569c1f75d8d8f180e139a
/app/src/main/java/com/pinery/findlove/moudle/content/IContent.java
25eec98cbd7019983d99b7a4325df267ee34e5fd
[]
no_license
gujianhesong/FindLove
019adb0bc151326bfb9a41d7c710dfda399f39ae
797512fffa8544177c1b73fae85f33610fd8c226
refs/heads/master
2020-03-25T08:34:56.615065
2018-08-05T15:12:40
2018-08-05T15:12:40
143,621,239
0
1
null
null
null
null
UTF-8
Java
false
false
461
java
package com.pinery.findlove.moudle.content; import android.view.View; import com.pinery.findlove.bean.OCResultBean; /** * Created by Administrator on 2017/5/5 0005. */ public interface IContent { public static final int Type_Baike = 0; public static final int Type_Source = 1; public static final int Type_SameSize = 2; public static final int Type_Similary = 3; public View getView(); public void fillData(OCResultBean bean); }
[ "gujianqitan123@gmail.com" ]
gujianqitan123@gmail.com
a26d9e44f649cbb44b08b794933f3e1e008c411c
612db0ace04f80e2744087c6c1b8699ec9551d4a
/src/br/com/ufpb/questao2/Loriga.java
3b7c1d821c78e077bb5680aa3769ee1c5b232ff8
[]
no_license
matheusnicolas/ExercicioPadraoObserver
f01183d64a07811ed9c7d194bd96f0b069d4a91c
147812437c0498b37929f6dcee36873b9d006afa
refs/heads/master
2021-01-19T00:38:52.674873
2016-11-08T02:18:53
2016-11-08T02:18:53
73,140,386
0
0
null
null
null
null
UTF-8
Java
false
false
184
java
package br.com.ufpb.questao2; public class Loriga implements ArmourStrategy { private static final int RESISTENCIA = 5; public int resist(){ return RESISTENCIA; } }
[ "mathe@Matheus-PC" ]
mathe@Matheus-PC
fcc69888e91400bed342dbae0580608d8bbe0c56
1c595fa3af5d4f4bfaf9154581c496cff4f3d75f
/server/src/main/java/yukitas/animal/collector/service/AnimalService.java
c8854462acf836f054d540b7ac1c15d3f34fca0b
[]
no_license
YuKitAs/animal-collector
9d6c67f9becaa4b8fe8bef5f8ebc976303e3b1f4
168f45e9a69d2fcb53df07058ca0bf79274a79ca
refs/heads/master
2021-06-28T13:19:26.403939
2020-10-11T21:45:27
2020-10-11T21:45:27
163,219,409
1
0
null
null
null
null
UTF-8
Java
false
false
549
java
package yukitas.animal.collector.service; import java.util.List; import java.util.UUID; import yukitas.animal.collector.model.Animal; public interface AnimalService { String ENTITY_NAME = "animal"; List<Animal> getAllAnimals(); List<Animal> getAnimalsByCategory(UUID categoryId); List<Animal> getAnimalsByPhoto(UUID photoId); Animal getAnimal(UUID id); Animal createAnimal(UUID categoryId, String name, String[] tags); Animal updateAnimal(UUID id, String name, String[] tags); void deleteAnimal(UUID id); }
[ "moncher.merci@gmail.com" ]
moncher.merci@gmail.com
ae4d0fb65a201f98f91cdcea35bdbede13d7b9af
131c50a29ad34eedbc231362f6d845ad04af5150
/azkarra-server/src/main/java/io/streamthoughts/azkarra/http/routes/WebUIHttpRoutes.java
b98c2452bddc508f80f03d720f6f3ecf36363114
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
arujit/azkarra-streams
d76474d945d68d20c7076944d623277b4fbfe89f
4fd90efb8d0848b869d989155a38f45c920b390c
refs/heads/master
2022-07-06T15:57:03.377519
2020-05-09T10:38:17
2020-05-09T10:43:48
262,531,268
1
0
Apache-2.0
2020-05-09T09:03:43
2020-05-09T09:03:42
null
UTF-8
Java
false
false
2,560
java
/* * Copyright 2019 StreamThoughts. * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.streamthoughts.azkarra.http.routes; import io.streamthoughts.azkarra.api.AzkarraStreamsService; import io.streamthoughts.azkarra.api.util.ClassUtils; import io.streamthoughts.azkarra.http.spi.RoutingHandlerProvider; import io.undertow.Handlers; import io.undertow.predicate.Predicates; import io.undertow.server.RoutingHandler; import io.undertow.server.handlers.PredicateHandler; import io.undertow.server.handlers.resource.ClassPathResourceManager; import io.undertow.server.handlers.resource.ResourceHandler; import io.undertow.util.Methods; public class WebUIHttpRoutes implements RoutingHandlerProvider { private static final String UI_STATIC_CLASSPATH = "io/streamthoughts/azkarra/ui/"; private static final ClassPathResourceManager resourceManager = new ClassPathResourceManager( ClassUtils.getClassLoader(), UI_STATIC_CLASSPATH ); /** * {@inheritDoc} */ @Override public RoutingHandler handler(final AzkarraStreamsService service) { final ResourceHandler resourceHandler = Handlers.resource(resourceManager); final PredicateHandler predicateHandler = new PredicateHandler( Predicates.suffixes(".css", ".js", ".html", ".png", ".svg", ".map"), resourceHandler, new ApiVersionRoutes()); RoutingHandler handler = Handlers.routing(); return handler .add(Methods.HEAD, "/static/*", predicateHandler) .add(Methods.POST, "/static/*", predicateHandler) .add(Methods.GET, "/static/*", predicateHandler) .get("/ui", new ResourceHandler( (exchange, path) -> resourceManager.getResource("index.html")) ); } }
[ "florian.hussonnois@gmail.com" ]
florian.hussonnois@gmail.com
dba3c02427e66f0fcc0105b69ed4b3b885444e85
2a979629c49c7b392fc4396d41882b7a0b8bd117
/src/main/java/com/test/client/GetlClient.java
d441cf9de15600ee854faaf1c26619ddfe24b0d9
[]
no_license
xibaomum/zhgl_api_adddep
4bdddcae5581c2ca408d91e0da7876f1e3cafeec
fea99647c2b7d48917af2dfc382e20d5ce631dbd
refs/heads/master
2020-04-27T10:24:29.691686
2019-03-07T02:14:38
2019-03-07T02:14:38
174,252,361
1
0
null
null
null
null
UTF-8
Java
false
false
3,315
java
package com.test.client; import java.io.IOException; import java.util.HashMap; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; public class GetlClient { // url是我们去进行get请求的地址; //String url = "https://api.apishop.net/communication/phone/getLocationByPhoneNum?apiKey=rdSgCD95612a799e375adbb2f99527894b387d8c0d7e359&phoneNum=1778635"; String url = "https://api.apishop.net/common/weather/getWeatherByPhonePostCode?apiKey=rdSgCD95612a799e375adbb2f99527894b387d8c0d7e359&phoneCode=027"; // httpClient是用来发送http请求的HttpClient实例; CloseableHttpClient httpclient; // httpGet是get请求的一个实例; HttpGet httpGet; // httpResponse用来存储我们接收到的反馈; CloseableHttpResponse httpResponse; // responseCode用来存储反馈的状态码; int responseCode; // responseBody用来存储反馈的主体信息,JSON格式;; JSONObject responseBody; // responseHeader用来存储反馈的头部信息; HashMap<String, String> responseHeads; // getResponse方法:通过httpclient获取请求的反馈 public void getResponse(String url) throws ClientProtocolException, IOException { // 创建一个httpClient的实例 httpclient = HttpClients.createDefault(); // 创建一个httpGet请求实例 httpGet = new HttpGet(url); // 使用httpClient实例发送刚创建的get请求,并用httpResponse将反馈接收 httpResponse = httpclient.execute(httpGet); } // getBodyInJSON方法:以JSON格式获取到反馈的主体 public JSONObject getBodyInJSON() throws ParseException, IOException { HttpEntity entity; String entityToString; // 从反馈中提取出反馈主体 entity = httpResponse.getEntity(); // 用EntityUtils工具类将反馈主体处理为字符串形式 entityToString = EntityUtils.toString(entity); System.out.println("This is your entityToString:" + entityToString+"-----001"); responseBody = JSON.parseObject(entityToString); System.out.println("This is your response body:" + responseBody+"-----001"); return responseBody; } // getHeaderInHash方法:以哈希图的方式获取到反馈头部 public HashMap<String, String> getHeaderInHash() { Header[] responseHeader; // 从反馈中提取出所有头部信息 responseHeader = httpResponse.getAllHeaders(); // 用哈希图将反馈头信息以键值对形式保存 responseHeads = new HashMap<String, String>(); for (Header header : responseHeader) { responseHeads.put(header.getName(), header.getValue()); } System.out.println("This is your response header" + responseHeads+"-----001"); return responseHeads; } // getCodeInNumber方法:获取反馈状态码 public int getCodeInNumber() { responseCode = httpResponse.getStatusLine().getStatusCode(); System.out.println("This is your response code" + responseCode); return responseCode; } }
[ "263198464@qq.com" ]
263198464@qq.com
d01d9e7219158c0fc6a2c4f35cec68f87b878035
b659dce63541b5a496137afba9a4de47b710bdb5
/src/main/java/com/erahub/jlja/authoritymanage/entity/Permission.java
fd989872b012a0cb408dc4bbc0ad129d04c221ba
[]
no_license
15751839366lp/erahub_jlja
871f4d4a4fc7a937e199c39842c76371bbba19a5
28699410d00b8be7e506cf86a7ed1f21c601387c
refs/heads/master
2023-08-31T07:25:27.313244
2021-09-26T11:40:05
2021-09-26T11:40:05
398,502,383
1
0
null
null
null
null
UTF-8
Java
false
false
1,769
java
package com.erahub.jlja.authoritymanage.entity; import com.baomidou.mybatisplus.annotation.*; import java.time.LocalDateTime; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; /** * <p> * * </p> * * @author lipeng * @since 2021-08-30 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_permission") public class Permission implements Serializable { private static final long serialVersionUID = 1L; /** * 编号 */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 权限编号 */ private Long permissionId; /** * 权限名称 */ private String permission; /** * 权限访问路径 */ private String url; /** * 是否为菜单 */ private Boolean isMenu; /** * 是否有子节点 */ private Boolean hasChildren; /** * 权限标识 */ private String perm; /** * 图标 */ private String icon; /** * 父节点(根节点为0) */ private Long pid; /** * 创建时间 */ @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; /** * 更新时间 */ @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateTime; /** * 删除时间 */ private LocalDateTime deleteTime; /** * 是否删除 */ private Boolean deleted; /** * 是否锁定 */ private Boolean locked; }
[ "15751839366@163.com" ]
15751839366@163.com
3efdb7848d3856a6b2698c0a27978e022df49343
d197603718990bb9c42203664f9e61a4400d3771
/blogcore/src/main/java/cn/factory/NYClamPizza.java
d2639d6def722b492e01a62b7bdca29f3939e754
[]
no_license
ZhouKaiDongGitHub/kzhou
e107ae6a49ae6f0424f2337f8c7b535cf5b4f2ad
43e74abd7a3545f4eb814d34895fce2be5df8901
refs/heads/master
2023-01-05T08:44:44.851787
2019-08-07T03:03:04
2019-08-07T03:03:04
200,954,298
1
0
null
2023-01-02T22:12:45
2019-08-07T02:08:17
Java
UTF-8
Java
false
false
313
java
package cn.factory; public class NYClamPizza extends Pizza { public NYClamPizza(){ name = "NY Style Clam Pizza"; dough = "Thin Crust Dough"; sauce = "Marinara Sauce"; toppings.add("Grated Reggiano Cheese"); toppings.add("Fresh Clams from Long Island Sound"); } }
[ "Kaidong.Zhou@eisgroup.com" ]
Kaidong.Zhou@eisgroup.com
9d83a3eb5cb91adf08c92461bb88cc1d94bb4834
048bc037dc8d392d7f97cd852d0a8869072f87ca
/src/main/java/com/ld/jwc/jwc_score_job/dao/mysql/mapper/XincheDataQuality/TotalScoreMapper.java
94f463b6b30b082d686a757eb58d1f69b96ebff1
[]
no_license
happy-le/jwc
9e3823aff1279c434269e48431fec15045c781ec
f009e72ba2c528dfcda0d0d521c25aa67cf42045
refs/heads/master
2022-09-19T12:30:39.516648
2019-06-05T09:07:52
2019-06-05T09:07:52
178,994,933
4
0
null
2022-09-01T23:04:51
2019-04-02T03:51:37
Java
UTF-8
Java
false
false
995
java
package com.ld.jwc.jwc_score_job.dao.mysql.mapper.XincheDataQuality; import com.ld.jwc.jwc_score_job.model.mysql.entity.JwcScoreJob.TotalScore; import com.ld.jwc.jwc_score_job.model.mysql.entity.JwcScoreJob.TotalScoreExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface TotalScoreMapper { long countByExample(TotalScoreExample example); int deleteByExample(TotalScoreExample example); int deleteByPrimaryKey(Long id); int insert(TotalScore record); int insertSelective(TotalScore record); List<TotalScore> selectByExample(TotalScoreExample example); TotalScore selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") TotalScore record, @Param("example") TotalScoreExample example); int updateByExample(@Param("record") TotalScore record, @Param("example") TotalScoreExample example); int updateByPrimaryKeySelective(TotalScore record); int updateByPrimaryKey(TotalScore record); }
[ "mgq_1996@163.com" ]
mgq_1996@163.com
8ce50e24b14c1668b9cc63cb5328ce2c9543d513
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/6/6_33d9e1ed7b169ce6afae3b4992ce534f8b9715e2/Graphics/6_33d9e1ed7b169ce6afae3b4992ce534f8b9715e2_Graphics_s.java
841fbc327dbb52e8628fb751ac09fe98348106b0
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
45,666
java
package org.newdawn.slick; import java.nio.ByteBuffer; import java.nio.DoubleBuffer; import java.nio.FloatBuffer; import java.security.AccessController; import java.security.PrivilegedAction; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; import org.newdawn.slick.geom.Rectangle; import org.newdawn.slick.geom.Shape; import org.newdawn.slick.geom.ShapeRenderer; import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.renderer.LineStripRenderer; import org.newdawn.slick.opengl.renderer.Renderer; import org.newdawn.slick.opengl.renderer.SGL; import org.newdawn.slick.util.FastTrig; import org.newdawn.slick.util.Log; /** * A graphics context that can be used to render primatives to the accelerated * canvas provided by LWJGL. * * @author kevin */ public class Graphics { /** The renderer to use for all GL operations */ protected static SGL GL = Renderer.get(); /** The renderer to use line strips */ private static LineStripRenderer LSR = Renderer.getLineStripRenderer(); /** The normal drawing mode */ public static int MODE_NORMAL = 1; /** Draw to the alpha map */ public static int MODE_ALPHA_MAP = 2; /** Draw using the alpha blending */ public static int MODE_ALPHA_BLEND = 3; /** The default number of segments that will be used when drawing an oval */ private static final int DEFAULT_SEGMENTS = 50; /** The last graphics context in use */ protected static Graphics currentGraphics = null; /** The font in use */ private Font font; /** The default font to use */ private Font defaultFont; /** The current color */ private Color currentColor = Color.white; /** The width of the screen */ protected int screenWidth; /** The height of the screen */ protected int screenHeight; /** True if the matrix has been pushed to the stack */ private boolean pushed; /** The graphics context clipping */ private Rectangle clip; /** Buffer used for setting the world clip */ private DoubleBuffer worldClip = BufferUtils.createDoubleBuffer(4); /** The buffer used to read a screen pixel */ private ByteBuffer readBuffer = BufferUtils.createByteBuffer(4); /** True if we're antialias */ private boolean antialias; /** The world clip recorded since last set */ private Rectangle worldClipRecord; /** The current drawing mode */ private int currentDrawingMode = MODE_NORMAL; /** * Create a new graphics context. Only the container should be doing this * really * * @param width * The width of the screen for this context * @param height * The height of the screen for this context */ public Graphics(int width, int height) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { defaultFont = new AngelCodeFont( "org/newdawn/slick/data/default.fnt", "org/newdawn/slick/data/default_00.tga"); } catch (SlickException e) { Log.error(e); } return null; // nothing to return } }); this.font = defaultFont; screenWidth = width; screenHeight = height; } /** * Set the drawing mode to use. This mode defines how pixels are drawn to * the graphics context. It can be used to draw into the alpha map. * * The mode supplied should be one of {@link Graphics#MODE_NORMAL} or * {@link Graphics#MODE_ALPHA_MAP} or {@link Graphics#MODE_ALPHA_BLEND} * * @param mode * The mode to apply. */ public void setDrawMode(int mode) { predraw(); if (currentDrawingMode != mode) { currentDrawingMode = mode; if (currentDrawingMode == MODE_NORMAL) { GL.glEnable(SGL.GL_BLEND); GL.glColorMask(true, true, true, true); GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA); } if (currentDrawingMode == MODE_ALPHA_MAP) { GL.glDisable(SGL.GL_BLEND); GL.glColorMask(false, false, false, true); } if (currentDrawingMode == MODE_ALPHA_BLEND) { GL.glEnable(SGL.GL_BLEND); GL.glColorMask(true, true, true, false); GL.glBlendFunc(GL11.GL_DST_ALPHA, GL11.GL_ONE_MINUS_DST_ALPHA); } } postdraw(); } /** * Clear the state of the alpha map across the entire screen. This sets * alpha to 0 everywhere, meaning in {@link Graphics#MODE_ALPHA_BLEND} * nothing will be drawn. */ public void clearAlphaMap() { int originalMode = currentDrawingMode; setDrawMode(MODE_ALPHA_MAP); setColor(new Color(0,0,0,0)); fillRect(0, 0, screenWidth, screenHeight); setColor(currentColor); setDrawMode(originalMode); } /** * Must be called before all OpenGL operations to maintain context for * dynamic images */ private void predraw() { if (currentGraphics != this) { if (currentGraphics != null) { currentGraphics.disable(); } currentGraphics = this; currentGraphics.enable(); } } /** * Must be called after all OpenGL operations to maintain context for * dynamic images */ private void postdraw() { } /** * Enable rendering to this graphics context */ protected void enable() { } /** * Flush this graphics context to the underlying rendering context */ public void flush() { if (currentGraphics == this) { currentGraphics.disable(); currentGraphics = null; } } /** * Disable rendering to this graphics context */ protected void disable() { } /** * Get the current font * * @return The current font */ public Font getFont() { return font; } /** * Set the background colour of the graphics context * * @param color * The background color of the graphics context */ public void setBackground(Color color) { predraw(); GL.glClearColor(color.r, color.g, color.b, color.a); postdraw(); } /** * Get the current graphics context background color * * @return The background color of this graphics context */ public Color getBackground() { predraw(); FloatBuffer buffer = BufferUtils.createFloatBuffer(16); GL.glGetFloat(SGL.GL_COLOR_CLEAR_VALUE, buffer); postdraw(); return new Color(buffer); } /** * Clear the graphics context */ public void clear() { predraw(); GL.glClear(SGL.GL_COLOR_BUFFER_BIT); postdraw(); } /** * Reset the transformation on this graphics context */ public void resetTransform() { if (pushed) { predraw(); GL.glPopMatrix(); pushed = false; postdraw(); } } /** * Check if we've pushed the previous matrix, if not then push it now. */ private void checkPush() { if (!pushed) { predraw(); GL.glPushMatrix(); pushed = true; postdraw(); } } /** * Apply a scaling factor to everything drawn on the graphics context * * @param sx * The scaling factor to apply to the x axis * @param sy * The scaling factor to apply to the y axis */ public void scale(float sx, float sy) { checkPush(); predraw(); GL.glScalef(sx, sy, 0); postdraw(); } /** * Apply a rotation to everything draw on the graphics context * * @param rx * The x coordinate of the center of rotation * @param ry * The y coordinate of the center of rotation * @param ang * The angle (in degrees) to rotate by */ public void rotate(float rx, float ry, float ang) { checkPush(); predraw(); translate(rx, ry); GL.glRotatef(ang, 0, 0, 1); translate(-rx, -ry); postdraw(); } /** * Apply a translation to everything drawn to the context * * @param x * The amount to translate on the x-axis * @param y * The amount of translate on the y-axis */ public void translate(float x, float y) { checkPush(); predraw(); GL.glTranslatef(x, y, 0); postdraw(); } /** * Set the font to be used when rendering text * * @param font * The font to be used when rendering text */ public void setFont(Font font) { this.font = font; } /** * Reset to using the default font for this context */ public void resetFont() { font = defaultFont; } /** * Set the color to use when rendering to this context * * @param color * The color to use when rendering to this context */ public void setColor(Color color) { currentColor = color; predraw(); color.bind(); postdraw(); } /** * Get the color in use by this graphics context * * @return The color in use by this graphics context */ public Color getColor() { return new Color(currentColor); } /** * Draw a line on the canvas in the current colour * * @param x1 * The x coordinate of the start point * @param y1 * The y coordinate of the start point * @param x2 * The x coordinate of the end point * @param y2 * The y coordinate of the end point */ public void drawLine(float x1, float y1, float x2, float y2) { predraw(); currentColor.bind(); Texture.bindNone(); // make sure the start and end points are drawn - GL implementations // seem a bit flakey on this GL.glBegin(SGL.GL_POINTS); GL.glVertex2f(x1, y1); GL.glVertex2f(x2, y2); GL.glEnd(); GL.glBegin(SGL.GL_LINES); GL.glVertex2f(x1, y1); GL.glVertex2f(x2, y2); GL.glEnd(); postdraw(); } /** * Draw the outline of the given shape. * * @param shape * The shape to draw. * @param fill * The fill type to apply */ public void draw(Shape shape, ShapeFill fill) { predraw(); Texture.bindNone(); ShapeRenderer.draw(shape, fill); currentColor.bind(); postdraw(); } /** * Draw the the given shape filled in. * * @param shape * The shape to fill. * @param fill * The fill type to apply */ public void fill(Shape shape, ShapeFill fill) { predraw(); Texture.bindNone(); ShapeRenderer.fill(shape, fill); currentColor.bind(); postdraw(); } /** * Draw the outline of the given shape. * * @param shape * The shape to draw. */ public void draw(Shape shape) { predraw(); Texture.bindNone(); currentColor.bind(); ShapeRenderer.draw(shape); postdraw(); } /** * Draw the the given shape filled in. * * @param shape * The shape to fill. */ public void fill(Shape shape) { predraw(); Texture.bindNone(); currentColor.bind(); ShapeRenderer.fill(shape); postdraw(); } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape */ public void texture(Shape shape, Image image) { texture(shape, image, 0.01f, 0.01f, false); } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape * @param fill * The shape fill to apply */ public void texture(Shape shape, Image image, ShapeFill fill) { texture(shape, image, 0.01f, 0.01f, fill); } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape * @param fit * True if we want to fit the image on to the shape */ public void texture(Shape shape, Image image, boolean fit) { if (fit) { texture(shape, image, 1, 1, true); } else { texture(shape, image, 0.01f, 0.01f, false); } } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape * @param scaleX * The scale to apply on the x axis for texturing * @param scaleY * The scale to apply on the y axis for texturing */ public void texture(Shape shape, Image image, float scaleX, float scaleY) { texture(shape, image, scaleX, scaleY, false); } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape * @param scaleX * The scale to apply on the x axis for texturing * @param scaleY * The scale to apply on the y axis for texturing * @param fit * True if we want to fit the image on to the shape */ public void texture(Shape shape, Image image, float scaleX, float scaleY, boolean fit) { predraw(); Texture.bindNone(); currentColor.bind(); ShapeRenderer.texture(shape, image, scaleX, scaleY); postdraw(); } /** * Draw the the given shape filled in with a texture * * @param shape * The shape to texture. * @param image * The image to tile across the shape * @param scaleX * The scale to apply on the x axis for texturing * @param scaleY * The scale to apply on the y axis for texturing * @param fill * The shape fill to apply */ public void texture(Shape shape, Image image, float scaleX, float scaleY, ShapeFill fill) { predraw(); Texture.bindNone(); currentColor.bind(); ShapeRenderer.texture(shape, image, scaleX, scaleY, fill); postdraw(); } /** * Draw a rectangle to the canvas in the current colour * * @param x1 * The x coordinate of the top left corner * @param y1 * The y coordinate of the top left corner * @param width * The width of the rectangle to draw * @param height * The height of the rectangle to draw */ public void drawRect(float x1, float y1, float width, float height) { predraw(); Texture.bindNone(); currentColor.bind(); LSR.start(); LSR.vertex(x1, y1); LSR.vertex(x1 + width - 1, y1); LSR.vertex(x1 + width - 1, y1 + height - 1); LSR.vertex(x1, y1 + height - 1); LSR.vertex(x1, y1); LSR.end(); postdraw(); } /** * Clear the clipping being applied. This will allow graphics to be drawn * anywhere on the screen */ public void clearClip() { clip = null; predraw(); GL.glDisable(SGL.GL_SCISSOR_TEST); postdraw(); } /** * Set clipping that controls which areas of the world will be drawn to. * Note that world clip is different from standard screen clip in that it's * defined in the space of the current world coordinate - i.e. it's affected * by translate, rotate, scale etc. * * @param x * The x coordinate of the top left corner of the allowed area * @param y * The y coordinate of the top left corner of the allowed area * @param width * The width of the allowed area * @param height * The height of the allowed area */ public void setWorldClip(float x, float y, float width, float height) { worldClipRecord = new Rectangle(x, y, width, height); GL.glEnable(SGL.GL_CLIP_PLANE0); worldClip.put(1).put(0).put(0).put(-x).flip(); GL.glClipPlane(SGL.GL_CLIP_PLANE0, worldClip); GL.glEnable(SGL.GL_CLIP_PLANE1); worldClip.put(-1).put(0).put(0).put(x + width).flip(); GL.glClipPlane(SGL.GL_CLIP_PLANE1, worldClip); GL.glEnable(SGL.GL_CLIP_PLANE2); worldClip.put(0).put(1).put(0).put(-y).flip(); GL.glClipPlane(SGL.GL_CLIP_PLANE2, worldClip); GL.glEnable(SGL.GL_CLIP_PLANE3); worldClip.put(0).put(-1).put(0).put(y + height).flip(); GL.glClipPlane(SGL.GL_CLIP_PLANE3, worldClip); } /** * Clear world clipping setup. This does not effect screen clipping */ public void clearWorldClip() { worldClipRecord = null; GL.glDisable(SGL.GL_CLIP_PLANE0); GL.glDisable(SGL.GL_CLIP_PLANE1); GL.glDisable(SGL.GL_CLIP_PLANE2); GL.glDisable(SGL.GL_CLIP_PLANE3); } /** * Set the world clip to be applied * * @see #setWorldClip(float, float, float, float) * @param clip * The area still visible */ public void setWorldClip(Rectangle clip) { if (clip == null) { clearWorldClip(); } else { setWorldClip(clip.getX(), clip.getY(), clip.getWidth(), clip .getHeight()); } } /** * Get the last set world clip or null of the world clip isn't set * * @return The last set world clip rectangle */ public Rectangle getWorldClip() { return worldClipRecord; } /** * Set the clipping to apply to the drawing. Note that this clipping takes * no note of the transforms that have been applied to the context and is * always in absolute screen space coordinates. * * @param x * The x coordinate of the top left corner of the allowed area * @param y * The y coordinate of the top left corner of the allowed area * @param width * The width of the allowed area * @param height * The height of the allowed area */ public void setClip(int x, int y, int width, int height) { predraw(); GL.glEnable(SGL.GL_SCISSOR_TEST); clip = new Rectangle(x, y, width, height); GL.glScissor(x, screenHeight - y - height, width, height); postdraw(); } /** * Set the clipping to apply to the drawing. Note that this clipping takes * no note of the transforms that have been applied to the context and is * always in absolute screen space coordinates. * * @param rect * The rectangle describing the clipped area in screen * coordinates */ public void setClip(Rectangle rect) { if (rect == null) { clearClip(); return; } setClip((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight()); } /** * Return the currently applied clipping rectangle * * @return The current applied clipping rectangle or null if no clipping is * applied */ public Rectangle getClip() { return clip; } /** * Tile a rectangle with a pattern specifing the offset from the top corner * that one tile should match * * @param x * The x coordinate of the rectangle * @param y * The y coordinate of the rectangle * @param width * The width of the rectangle * @param height * The height of the rectangle * @param pattern * The image to tile across the rectangle * @param offX * The offset on the x axis from the top left corner * @param offY * The offset on the y axis from the top left corner */ public void fillRect(float x, float y, float width, float height, Image pattern, float offX, float offY) { int cols = ((int) Math.ceil(width / pattern.getWidth())) + 2; int rows = ((int) Math.ceil(height / pattern.getHeight())) + 2; Rectangle preClip = getWorldClip(); setWorldClip(x, y, width, height); predraw(); // Draw all the quads we need for (int c = 0; c < cols; c++) { for (int r = 0; r < rows; r++) { pattern.draw(c * pattern.getWidth() + x - offX, r * pattern.getHeight() + y - offY); } } postdraw(); setWorldClip(preClip); } /** * Fill a rectangle on the canvas in the current color * * @param x1 * The x coordinate of the top left corner * @param y1 * The y coordinate of the top left corner * @param width * The width of the rectangle to fill * @param height * The height of the rectangle to fill */ public void fillRect(float x1, float y1, float width, float height) { predraw(); Texture.bindNone(); currentColor.bind(); GL.glBegin(SGL.GL_QUADS); GL.glVertex2f(x1, y1); GL.glVertex2f(x1 + width - 1, y1); GL.glVertex2f(x1 + width - 1, y1 + height - 1); GL.glVertex2f(x1, y1 + height - 1); GL.glEnd(); postdraw(); } /** * Draw an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the oval * @param y1 * The y coordinate of the top left corner of a box containing * the oval * @param width * The width of the oval * @param height * The height of the oval */ public void drawOval(float x1, float y1, float width, float height) { drawOval(x1, y1, width, height, DEFAULT_SEGMENTS); } /** * Draw an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the oval * @param y1 * The y coordinate of the top left corner of a box containing * the oval * @param width * The width of the oval * @param height * The height of the oval * @param segments * The number of line segments to use when drawing the oval */ public void drawOval(float x1, float y1, float width, float height, int segments) { drawArc(x1, y1, width, height, segments, 0, 360); } /** * Draw an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the arc * @param y1 * The y coordinate of the top left corner of a box containing * the arc * @param width * The width of the arc * @param height * The height of the arc * @param start * The angle the arc starts at * @param end * The angle the arc ends at */ public void drawArc(float x1, float y1, float width, float height, float start, float end) { drawArc(x1, y1, width, height, DEFAULT_SEGMENTS, start, end); } /** * Draw an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the arc * @param y1 * The y coordinate of the top left corner of a box containing * the arc * @param width * The width of the arc * @param height * The height of the arc * @param segments * The number of line segments to use when drawing the arc * @param start * The angle the arc starts at * @param end * The angle the arc ends at */ public void drawArc(float x1, float y1, float width, float height, int segments, float start, float end) { predraw(); Texture.bindNone(); currentColor.bind(); while (end < start) { end += 360; } float cx = x1 + (width / 2.0f); float cy = y1 + (height / 2.0f); LSR.start(); int step = 360 / segments; for (int a = (int) start; a < (int) (end + step); a += step) { float ang = a; if (ang > end) { ang = end; } float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang)) * width / 2.0f)); float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang)) * height / 2.0f)); LSR.vertex(x,y); } LSR.end(); postdraw(); } /** * Fill an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the oval * @param y1 * The y coordinate of the top left corner of a box containing * the oval * @param width * The width of the oval * @param height * The height of the oval */ public void fillOval(float x1, float y1, float width, float height) { fillOval(x1, y1, width, height, DEFAULT_SEGMENTS); } /** * Fill an oval to the canvas * * @param x1 * The x coordinate of the top left corner of a box containing * the oval * @param y1 * The y coordinate of the top left corner of a box containing * the oval * @param width * The width of the oval * @param height * The height of the oval * @param segments * The number of line segments to use when filling the oval */ public void fillOval(float x1, float y1, float width, float height, int segments) { fillArc(x1, y1, width, height, segments, 0, 360); } /** * Fill an arc to the canvas (a wedge) * * @param x1 * The x coordinate of the top left corner of a box containing * the arc * @param y1 * The y coordinate of the top left corner of a box containing * the arc * @param width * The width of the arc * @param height * The height of the arc * @param start * The angle the arc starts at * @param end * The angle the arc ends at */ public void fillArc(float x1, float y1, float width, float height, float start, float end) { fillArc(x1, y1, width, height, DEFAULT_SEGMENTS, start, end); } /** * Fill an arc to the canvas (a wedge) * * @param x1 * The x coordinate of the top left corner of a box containing * the arc * @param y1 * The y coordinate of the top left corner of a box containing * the arc * @param width * The width of the arc * @param height * The height of the arc * @param segments * The number of line segments to use when filling the arc * @param start * The angle the arc starts at * @param end * The angle the arc ends at */ public void fillArc(float x1, float y1, float width, float height, int segments, float start, float end) { predraw(); Texture.bindNone(); currentColor.bind(); while (end < start) { end += 360; } float cx = x1 + (width / 2.0f); float cy = y1 + (height / 2.0f); GL.glBegin(SGL.GL_TRIANGLE_FAN); int step = 360 / segments; GL.glVertex2f(cx, cy); for (int a = (int) start; a < (int) (end + step); a += step) { float ang = a; if (ang > end) { ang = end; } float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang)) * width / 2.0f)); float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang)) * height / 2.0f)); GL.glVertex2f(x, y); } GL.glEnd(); if (antialias) { GL.glBegin(SGL.GL_TRIANGLE_FAN); GL.glVertex2f(cx, cy); if (end != 360) { end -= 10; } for (int a = (int) start; a < (int) (end + step); a += step) { float ang = a; if (ang > end) { ang = end; } float x = (float) (cx + (FastTrig.cos(Math.toRadians(ang + 10)) * width / 2.0f)); float y = (float) (cy + (FastTrig.sin(Math.toRadians(ang + 10)) * height / 2.0f)); GL.glVertex2f(x, y); } GL.glEnd(); } postdraw(); } /** * Draw a rounded rectangle * * @param x * The x coordinate of the top left corner of the rectangle * @param y * The y coordinate of the top left corner of the rectangle * @param width * The width of the rectangle * @param height * The height of the rectangle * @param cornerRadius * The radius of the rounded edges on the corners */ public void drawRoundRect(float x, float y, float width, float height, int cornerRadius) { drawRoundRect(x, y, width, height, cornerRadius, DEFAULT_SEGMENTS); } /** * Draw a rounded rectangle * * @param x * The x coordinate of the top left corner of the rectangle * @param y * The y coordinate of the top left corner of the rectangle * @param width * The width of the rectangle * @param height * The height of the rectangle * @param cornerRadius * The radius of the rounded edges on the corners * @param segs * The number of segments to make the corners out of */ public void drawRoundRect(float x, float y, float width, float height, int cornerRadius, int segs) { if (cornerRadius < 0) throw new IllegalArgumentException("corner radius must be > 0"); if (cornerRadius == 0) { drawRect(x, y, width, height); return; } int mr = (int) Math.min(width, height) / 2; // make sure that w & h are larger than 2*cornerRadius if (cornerRadius > mr) { cornerRadius = mr; } drawLine(x + cornerRadius, y, x + width - cornerRadius, y); drawLine(x, y + cornerRadius, x, y + height - cornerRadius); drawLine(x + width, y + cornerRadius, x + width, y + height - cornerRadius); drawLine(x + cornerRadius, y + height, x + width - cornerRadius, y + height); float d = cornerRadius * 2; // bottom right - 0, 90 drawArc(x + width - d, y + height - d, d, d, segs, 0, 90); // bottom left - 90, 180 drawArc(x, y + height - d, d, d, segs, 90, 180); // top right - 270, 360 drawArc(x + width - d, y, d, d, segs, 270, 360); // top left - 180, 270 drawArc(x, y, d, d, segs, 180, 270); } /** * Fill a rounded rectangle * * @param x * The x coordinate of the top left corner of the rectangle * @param y * The y coordinate of the top left corner of the rectangle * @param width * The width of the rectangle * @param height * The height of the rectangle * @param cornerRadius * The radius of the rounded edges on the corners */ public void fillRoundRect(float x, float y, float width, float height, int cornerRadius) { fillRoundRect(x, y, width, height, cornerRadius, DEFAULT_SEGMENTS); } /** * Fill a rounded rectangle * * @param x * The x coordinate of the top left corner of the rectangle * @param y * The y coordinate of the top left corner of the rectangle * @param width * The width of the rectangle * @param height * The height of the rectangle * @param cornerRadius * The radius of the rounded edges on the corners * @param segs * The number of segments to make the corners out of */ public void fillRoundRect(float x, float y, float width, float height, int cornerRadius, int segs) { if (cornerRadius < 0) throw new IllegalArgumentException("corner radius must be > 0"); if (cornerRadius == 0) { fillRect(x, y, width, height); return; } int mr = (int) Math.min(width, height) / 2; // make sure that w & h are larger than 2*cornerRadius if (cornerRadius > mr) { cornerRadius = mr; } float d = cornerRadius * 2; fillRect(x + cornerRadius, y, width - d, cornerRadius); fillRect(x, y + cornerRadius, cornerRadius, height - d); fillRect(x + width - cornerRadius, y + cornerRadius, cornerRadius, height - d); fillRect(x + cornerRadius, y + height - cornerRadius, width - d, cornerRadius); fillRect(x + cornerRadius, y + cornerRadius, width - d, height - d); // bottom right - 0, 90 fillArc(x + width - d, y + height - d, d, d, segs, 0, 90); // bottom left - 90, 180 fillArc(x, y + height - d, d, d, segs, 90, 180); // top right - 270, 360 fillArc(x + width - d, y, d, d, segs, 270, 360); // top left - 180, 270 fillArc(x, y, d, d, segs, 180, 270); } /** * Set the with of the line to be used when drawing line based primitives * * @param width * The width of the line to be used when drawing line based * primitives */ public void setLineWidth(float width) { predraw(); LSR.setWidth(width); GL.glPointSize(width); postdraw(); } /** * Get the width of lines being drawn in this context * * @return The width of lines being draw in this context */ public float getLineWidth() { predraw(); FloatBuffer buffer = BufferUtils.createFloatBuffer(16); GL.glGetFloat(SGL.GL_LINE_WIDTH, buffer); postdraw(); return buffer.get(0); } /** * Reset the line width in use to the default for this graphics context */ public void resetLineWidth() { predraw(); GL.glLineWidth(1.0f); GL.glPointSize(1.0f); postdraw(); } /** * Indicate if we should antialias as we draw primitives * * @param anti * True if we should antialias */ public void setAntiAlias(boolean anti) { predraw(); antialias = anti; LSR.setAntiAlias(anti); if (anti) { GL.glEnable(SGL.GL_POLYGON_SMOOTH); } else { GL.glDisable(SGL.GL_POLYGON_SMOOTH); } postdraw(); } /** * True if antialiasing has been turned on for this graphics context * * @return True if antialiasing has been turned on for this graphics context */ public boolean isAntiAlias() { return antialias; } /** * Draw a string to the screen using the current font * * @param str * The string to draw * @param x * The x coordinate to draw the string at * @param y * The y coordinate to draw the string at */ public void drawString(String str, float x, float y) { predraw(); font.drawString(x, y, str, currentColor); postdraw(); } /** * Draw an image to the screen * * @param image * The image to draw to the screen * @param x * The x location at which to draw the image * @param y * The y location at which to draw the image * @param col * The color to apply to the image as a filter */ public void drawImage(Image image, float x, float y, Color col) { predraw(); image.draw(x, y, col); currentColor.bind(); postdraw(); } /** * Draw an animation to this graphics context * * @param anim * The animation to be drawn * @param x * The x position to draw the animation at * @param y * The y position to draw the animation at */ public void drawAnimation(Animation anim, float x, float y) { drawAnimation(anim, x, y, Color.white); } /** * Draw an animation to this graphics context * * @param anim * The animation to be drawn * @param x * The x position to draw the animation at * @param y * The y position to draw the animation at * @param col * The color to apply to the animation as a filter */ public void drawAnimation(Animation anim, float x, float y, Color col) { predraw(); anim.draw(x, y, col); currentColor.bind(); postdraw(); } /** * Draw an image to the screen * * @param image * The image to draw to the screen * @param x * The x location at which to draw the image * @param y * The y location at which to draw the image */ public void drawImage(Image image, float x, float y) { drawImage(image, x, y, Color.white); } /** * Draw a section of an image at a particular location and scale on the * screen * * @param image * The image to draw a section of * @param x * The x position to draw the image * @param y * The y position to draw the image * @param x2 * The x position of the bottom right corner of the drawn image * @param y2 * The y position of the bottom right corner of the drawn image * @param srcx * The x position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcy * The y position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcx2 * The x position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param srcy2 * The t position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) */ public void drawImage(Image image, float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2) { predraw(); image.draw(x, y, x2, y2, srcx, srcy, srcx2, srcy2); currentColor.bind(); postdraw(); } /** * Draw a section of an image at a particular location and scale on the * screen * * @param image * The image to draw a section of * @param x * The x position to draw the image * @param y * The y position to draw the image * @param srcx * The x position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcy * The y position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcx2 * The x position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param srcy2 * The t position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) */ public void drawImage(Image image, float x, float y, float srcx, float srcy, float srcx2, float srcy2) { drawImage(image, x, y, x + image.getWidth(), y + image.getHeight(), srcx, srcy, srcx2, srcy2); } /** * Copy an area of the rendered screen into an image. The width and height * of the area are assumed to match that of the image * * @param target * The target image * @param x * The x position to copy from * @param y * The y position to copy from */ public void copyArea(Image target, int x, int y) { int format = target.getTexture().hasAlpha() ? SGL.GL_RGBA : SGL.GL_RGB; target.bind(); GL.glCopyTexImage2D(SGL.GL_TEXTURE_2D, 0, format, x, screenHeight - (y + target.getHeight()), target.getTexture() .getTextureWidth(), target.getTexture().getTextureHeight(), 0); target.ensureInverted(); } /** * Translate an unsigned int into a signed integer * * @param b * The byte to convert * @return The integer value represented by the byte */ private int translate(byte b) { if (b < 0) { return 256 + b; } return b; } /** * Get the colour of a single pixel in this graphics context * * @param x * The x coordinate of the pixel to read * @param y * The y coordinate of the pixel to read * @return The colour of the pixel at the specified location */ public Color getPixel(int x, int y) { GL.glReadPixels(x, screenHeight - y, 1, 1, SGL.GL_RGBA, SGL.GL_UNSIGNED_BYTE, readBuffer); return new Color(translate(readBuffer.get(0)), translate(readBuffer .get(1)), translate(readBuffer.get(2)), translate(readBuffer .get(3))); } /** * Draw a section of an image at a particular location and scale on the * screen * * @param image * The image to draw a section of * @param x * The x position to draw the image * @param y * The y position to draw the image * @param x2 * The x position of the bottom right corner of the drawn image * @param y2 * The y position of the bottom right corner of the drawn image * @param srcx * The x position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcy * The y position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcx2 * The x position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param srcy2 * The t position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param col * The color to apply to the image as a filter */ public void drawImage(Image image, float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2, Color col) { predraw(); image.draw(x, y, x2, y2, srcx, srcy, srcx2, srcy2, col); currentColor.bind(); postdraw(); } /** * Draw a section of an image at a particular location and scale on the * screen * * @param image * The image to draw a section of * @param x * The x position to draw the image * @param y * The y position to draw the image * @param srcx * The x position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcy * The y position of the rectangle to draw from this image (i.e. * relative to the image) * @param srcx2 * The x position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param srcy2 * The t position of the bottom right cornder of rectangle to * draw from this image (i.e. relative to the image) * @param col * The color to apply to the image as a filter */ public void drawImage(Image image, float x, float y, float srcx, float srcy, float srcx2, float srcy2, Color col) { drawImage(image, x, y, x + image.getWidth(), y + image.getHeight(), srcx, srcy, srcx2, srcy2, col); } /** * Draw a line with a gradient between the two points. * * @param x1 * The starting x position to draw the line * @param y1 * The starting y position to draw the line * @param red1 * The starting position's shade of red * @param green1 * The starting position's shade of green * @param blue1 * The starting position's shade of blue * @param alpha1 * The starting position's alpha value * @param x2 * The ending x position to draw the line * @param y2 * The ending y position to draw the line * @param red2 * The ending position's shade of red * @param green2 * The ending position's shade of green * @param blue2 * The ending position's shade of blue * @param alpha2 * The ending position's alpha value */ public void drawGradientLine(float x1, float y1, float red1, float green1, float blue1, float alpha1, float x2, float y2, float red2, float green2, float blue2, float alpha2) { predraw(); Texture.bindNone(); GL.glBegin(SGL.GL_LINES); GL.glColor4f(red1, green1, blue1, alpha1); GL.glVertex2f(x1, y1); GL.glColor4f(red2, green2, blue2, alpha2); GL.glVertex2f(x2, y2); GL.glEnd(); postdraw(); } /** * Draw a line with a gradient between the two points. * * @param x1 * The starting x position to draw the line * @param y1 * The starting y position to draw the line * @param Color1 * The starting position's color * @param x2 * The ending x position to draw the line * @param y2 * The ending y position to draw the line * @param Color2 * The ending position's color */ public void drawGradientLine(float x1, float y1, Color Color1, float x2, float y2, Color Color2) { predraw(); Texture.bindNone(); GL.glBegin(SGL.GL_LINES); Color1.bind(); GL.glVertex2f(x1, y1); Color2.bind(); GL.glVertex2f(x2, y2); GL.glEnd(); postdraw(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
567d5d3cbc72572ab1637efd255ac571265ef6d3
1b7539da48f239b220c1c388769b5a2167878ad1
/src/main/java/com/web/util/tars/CommunicatorConfigUtil.java
5b917f01fd452618dd14e3c329313fbb85223952
[]
no_license
GZJZD/SpringMybatis
fa7120d0938432f9502b5d93271642b544cac9de
7c67e21468823a120a090dbb6ecf95ec13b162d1
refs/heads/master
2020-03-27T15:30:21.995759
2018-09-04T07:23:22
2018-09-04T07:23:22
146,722,339
1
0
null
null
null
null
UTF-8
Java
false
false
921
java
package com.web.util.tars; import com.qq.tars.client.Communicator; import com.qq.tars.client.CommunicatorConfig; import com.qq.tars.client.CommunicatorFactory; import com.web.servant.center.TraderServantPrx; public abstract class CommunicatorConfigUtil { private static CommunicatorConfig cfg = new CommunicatorConfig(); public static TraderServantPrx getProxy(){ cfg.setLocator("tars.tarsregistry.QueryObj@tcp -h 192.168.3.189 -p 17890"); cfg.setSyncInvokeTimeout(3600000); Communicator communicator = CommunicatorFactory.getInstance().getCommunicator(cfg); // = communicator.stringToProxy(TraderServantPrx.class,"Center.EFServer.TraderServantAObj"); String strConnecter = "Center.EFServer.TraderServantObj@tcp -h 192.168.3.167 -p 21111"; TraderServantPrx proxy = communicator.stringToProxy(TraderServantPrx.class, strConnecter); return proxy; } }
[ "jumy_z@126.com" ]
jumy_z@126.com
75e2abcc9499ebf0416613297da88f5389e18087
a956c445249c73aeca7d2f9259e74e632b099334
/src/main/java/com/weixin/req/VoiceMessage.java
25fc27a00531c410b9aede82628aab8ae0b4d22b
[]
no_license
lwzj/weixin
7cebd9b232a16925d55545b3de1d722560cb3477
5b101a75f8bfc7ce8aefac3fec2bdbfa554e071d
refs/heads/master
2021-08-24T05:55:06.414448
2017-12-08T09:11:03
2017-12-08T09:11:03
113,030,654
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
package com.weixin.req; /** * @author lw * @version 1.0 * @describe 语音消息 */ public class VoiceMessage extends BaseMessage { // 媒体ID private String MediaId; // 语音格式 private String Format; public String getMediaId() { return MediaId; } public void setMediaId(String mediaId) { MediaId = mediaId; } public String getFormat() { return Format; } public void setFormat(String format) { Format = format; } }
[ "18334793466@163.com" ]
18334793466@163.com
3a7b8657bd3af0c771addef00b260df2c13596a7
2667d7565e62b04337b93dc34876dfae8cf11b0d
/gmall-wms-interface/src/main/java/com/atguigu/gmall/wms/entity/PurchaseEntity.java
ba7552d5d6f860cea707f01468c3b5b721ffd7e1
[ "Apache-2.0" ]
permissive
caodan689/gmall-0522
b6dc1813686c0a883a9fcadc628b35fcea80b04c
64b13825aeba6039437a1117f62914bfb8ec5167
refs/heads/main
2023-06-24T16:46:45.532401
2020-11-24T03:33:57
2020-11-24T03:33:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,006
java
package com.atguigu.gmall.wms.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * 采购信息 * * @author fengge * @email fengge@atguigu.com * @date 2020-10-30 14:04:41 */ @Data @TableName("wms_purchase") public class PurchaseEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 采购单id */ @TableId private Long id; /** * 采购人id */ private Long assigneeId; /** * 采购人名 */ private String assigneeName; /** * 联系方式 */ private String phone; /** * 优先级 */ private Integer priority; /** * 状态 */ private Integer status; /** * 仓库id */ private Long wareId; /** * 总金额 */ private BigDecimal amount; /** * 创建日期 */ private Date createTime; /** * 更新日期 */ private Date updateTime; }
[ "joedy23@aliyun.com" ]
joedy23@aliyun.com
937bd69a81a1804fa7876d0456557e6a4c94a4dc
91614d28d7dcabf421b1261399ba25ea85572b4e
/seopsta/src/main/java/com/instacopy/seopsta/Stomp/ChatRoomEntitiy.java
0a5ad32e758c1dd08a8f7b54881816b3b0cbb8cd
[]
no_license
Seop-kor/Seopstagram
486d2e69831adc485ee888a90040281b9c061f92
2ec1ce62071111b0cbf88fbf3aa56bb45051f075
refs/heads/master
2021-04-16T13:54:10.991958
2020-04-19T17:46:49
2020-04-19T17:46:49
249,360,637
0
0
null
null
null
null
UTF-8
Java
false
false
459
java
package com.instacopy.seopsta.Stomp; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import org.springframework.data.mongodb.core.mapping.Document; @NoArgsConstructor @Getter @Document(collection = "chatroom") public class ChatRoomEntitiy { private String roomId; private String name; @Builder public ChatRoomEntitiy(String roomId, String name){ this.roomId = roomId; this.name = name; } }
[ "54997445+Seop-kor@users.noreply.github.com" ]
54997445+Seop-kor@users.noreply.github.com
31dbab0feb063505aa415a5fe87bdfcfe9821f41
849280ec30fd086839c55b78076e03d5b869cafe
/CommUtil/app/src/main/java/com/wzf/com/commutil/MainActivity.java
0447ab57e10cb6647ef9a8778cf27229237e0a4f
[]
no_license
soonlen/util
a027e40016d57c81564be9cc90fcd2d5a4f26802
940840c16678de1f50a9c9716c09dbbb0cd1c290
refs/heads/master
2021-01-12T12:05:43.598347
2016-09-26T09:04:11
2016-09-26T09:04:11
69,229,985
0
0
null
null
null
null
UTF-8
Java
false
false
1,326
java
package com.wzf.com.commutil; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.wzf.com.commutil.util.BitmapUtil; import com.wzf.com.mylibrary.TestActivity; import com.wzf.com.mylibrary.TestUtil; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.desert); ImageView imageView = (ImageView) findViewById(R.id.imageView); imageView.setImageBitmap(BitmapUtil.createReflectionImageWithOrigin(bitmap)); bitmap.recycle(); ((TextView)findViewById(R.id.tv)).setText(TestUtil.libraryText()); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { secActivity(); } }); } private void secActivity() { Intent intent =new Intent(this, TestActivity.class); startActivity(intent); } }
[ "soonlen@163.com" ]
soonlen@163.com
56c5b6c96fc0e6cb304693dd06c43b4c64405197
b4e6056b550d076eb3fadd1557eda087253faa24
/app/src/main/java/com/gaiamount/module_creator/sub_module_album/AlbumListActivity.java
9be348a79b9fa322f40c5bd84f94c9b4cfed3c1d
[]
no_license
yukunkun/Gaia
a4093c4044bca15c49bdddf353d57f1a9e26effa
387186f253da311593ff2e2473be0355150bd2e3
refs/heads/master
2020-06-17T17:14:16.256297
2019-07-11T07:55:21
2019-07-11T07:55:21
195,987,959
0
0
null
null
null
null
UTF-8
Java
false
false
18,739
java
package com.gaiamount.module_creator.sub_module_album; import android.content.DialogInterface; import android.content.Intent; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.CardView; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.text.InputType; import android.text.method.PasswordTransformationMethod; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.PopupWindow; import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; import com.gaiamount.R; import com.gaiamount.apis.Configs; import com.gaiamount.apis.api_creator.AlbumApi; import com.gaiamount.apis.api_creator.AlbumApiHelper; import com.gaiamount.gaia_main.GaiaApp; import com.gaiamount.module_academy.bean.MixLightDecoration; import com.gaiamount.module_academy.bean.OnEventId; import com.gaiamount.module_academy.bean.OnEventLearn; import com.gaiamount.module_creator.fragment.AlbumDialog; import com.gaiamount.util.ScreenUtils; import com.gaiamount.util.image.ImageUtils; import com.gaiamount.util.network.GsonUtil; import com.gaiamount.util.network.MJsonHttpResponseHandler; import com.google.gson.reflect.TypeToken; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import org.json.JSONArray; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; /** * 1显示专辑列表 * 2创建专辑 */ public class AlbumListActivity extends AppCompatActivity { public static final String GID = "gid"; public static final String ALBUM_TYPE = "album_type"; public static final String HAVE_POWER = "have_power"; public static final String IS_JOIN = "is_join"; private static final int CREATE_ALBUM = 23; private static final int ALBUM_DETAIL = 24; private GridLayoutManager gridLayoutManager; private int allowCleanCreation; /** * toolbar控件 */ @Bind(R.id.toolbar) Toolbar mToolbar; @Bind(R.id.title) TextView mTv_Title; /** * 专辑列表控件 */ @Bind(R.id.album_list) RecyclerView mAlbumList; /** * 内容为空的提示 */ @Bind(R.id.empty_hint) RelativeLayout emptyHint; /** * 小组id,从传入intent中获取 */ private int pi=1; private long mGid; private int mAlbumType; private int mHavePower; /** * 当前用户是否加入了该专辑所在小组 */ private int mIsJoin; private MViewHolder holder; List<AlbumBean> lists=new ArrayList<>(); private MAdapter adapter; private String more; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_album_list); ButterKnife.bind(this); EventBus.getDefault().register(this); mGid = getIntent().getLongExtra(GID, -1); mAlbumType = getIntent().getIntExtra(ALBUM_TYPE, -1); mHavePower = getIntent().getIntExtra(HAVE_POWER, -1); mIsJoin = getIntent().getIntExtra(IS_JOIN, -1); allowCleanCreation=getIntent().getIntExtra("allowCleanCreation",-1); gridLayoutManager=new GridLayoutManager(getApplicationContext(),2); mAlbumList.setLayoutManager(gridLayoutManager); setToolbar(); //联网获取专辑列表数据 getAlbumListFromNet(); setAdapter(); setOnListener(); } private void setOnListener() { mAlbumList.setOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); } @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); int lastVisibleItemPosition = gridLayoutManager.findLastCompletelyVisibleItemPosition(); if (lastVisibleItemPosition == gridLayoutManager.getItemCount()-1) { //加载更多 pi++; getAlbumListFromNet(); adapter.notifyDataSetChanged(); } } }); } private void setAdapter() { adapter = new MAdapter(lists); mAlbumList.setAdapter(adapter); mAlbumList.addItemDecoration(new MixLightDecoration(10,10,20,20)); } @Subscribe(threadMode = ThreadMode.MAIN) public void onEvent(OnEventId event) { if(event.id==1){ lists.remove(event.position); adapter.notifyItemRemoved(event.position); } } // @Subscribe(threadMode = ThreadMode.MAIN) // public void onEvent(OnEventLearn event) { // if(event.id==0){ // lists.clear(); // getAlbumListFromNet(); // adapter.notifyDataSetChanged(); // } // } /** * 联网获取专辑列表数据 */ private void getAlbumListFromNet() { MJsonHttpResponseHandler handler = new MJsonHttpResponseHandler(AlbumListActivity.class) { @Override public void onGoodResponse(JSONObject response) { super.onGoodResponse(response); JSONArray jsonArray = response.optJSONArray("a"); if(jsonArray.length()!=0){ emptyHint.setVisibility(View.GONE); } for (int i = 0; i < jsonArray.length(); i++) { JSONObject object = jsonArray.optJSONObject(i); AlbumBean albumBean=new AlbumBean(); albumBean.setAid(object.optLong("aid")); albumBean.setCover(object.optString("cover")); albumBean.setIsPublic(object.optInt("isPublic")); albumBean.setName(object.optString("name")); albumBean.setCollegeCount(object.optInt("collegeCount")); albumBean.setMaterialCount(object.optInt("materialCount")); albumBean.setScriptCount(object.optInt("scriptCount")); albumBean.setWorksCount(object.optInt("worksCount")); lists.add(albumBean); } adapter.notifyDataSetChanged(); } }; AlbumApiHelper.getAlbumList(mGid, mAlbumType, 1, pi,this, handler); } /** * toolbar事件处理 */ private void setToolbar() { mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); //只有有权限的人才能创建专辑 if (mHavePower == 1) { //1 表示有权限 mToolbar.inflateMenu(R.menu.album_list); } mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_add_album) { Intent intent = new Intent(AlbumListActivity.this, SetUpAlbumActivity.class); intent.putExtra(SetUpAlbumActivity.GID, mGid); intent.putExtra(SetUpAlbumActivity.ALBUM_TYPE, mAlbumType); startActivityForResult(intent, CREATE_ALBUM); } return true; } }); } class MAdapter extends RecyclerView.Adapter<MViewHolder> { private List<AlbumBean> mList; private final ImageUtils mImageUtils; public MAdapter(List<AlbumBean> list) { mList = list; mImageUtils = ImageUtils.getInstance(AlbumListActivity.this); } @Override public MViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = View.inflate(AlbumListActivity.this, R.layout.item_album_list, null); holder = new MViewHolder(itemView); return holder; } @Override public void onBindViewHolder(final MViewHolder holder, final int position) { final AlbumBean albumBean = mList.get(position); //专辑封面 Glide.with(getApplicationContext()).load(Configs.COVER_PREFIX+albumBean.getCover()).placeholder(R.mipmap.bg_general).into(holder.albumCover); //专辑信息 more = "作品 " + albumBean.getWorksCount() + "|" + "素材 " + albumBean.getMaterialCount() + "|" + "剧本 " + albumBean.getScriptCount() + "|" + "学院 " + albumBean.getCollegeCount(); //专辑标题 holder.albumTitle.setText(albumBean.getName()); // ViewGroup.LayoutParams layoutParams = (holder.albumCover).getLayoutParams(); // layoutParams.height = getHeight(); // (holder.albumCover).setLayoutParams(layoutParams); (holder.albumCover).getLayoutParams().height = getHeight(); //判断是否公开 if(albumBean.getIsPublic()==0){ //1为公开 holder.albumSec.setVisibility(View.VISIBLE); }else { holder.albumSec.setVisibility(View.GONE); } //点击封面跳转到专辑详情 holder.albumCover.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mIsJoin!=1&&albumBean.getIsPublic()==0){ //ispublic 0表示已经加密 selfDialoga(albumBean.getAid(),albumBean); }else { Intent intent = new Intent(AlbumListActivity.this, AlbumDetailActivity.class); intent.putExtra(AlbumDetailActivity.AID, albumBean.getAid()); intent.putExtra(AlbumDetailActivity.ALBUM_TYPE, mAlbumType); intent.putExtra(AlbumDetailActivity.IS_PUBLIC, albumBean.getIsPublic()); intent.putExtra(AlbumDetailActivity.IS_JOIN, mIsJoin); intent.putExtra(AlbumDetailActivity.HAVE_POWER, mHavePower); intent.putExtra("allowCleanCreation", allowCleanCreation); intent.putExtra(AlbumDetailActivity.GID, mGid); startActivityForResult(intent, ALBUM_DETAIL); } } }); if(mHavePower==1){ //有权限 holder.albumMore.setVisibility(View.VISIBLE); holder.albumMore.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showPopu(holder.albumMore,albumBean.getAid(),position); } }); }else { holder.albumMore.setVisibility(View.GONE); } } @Override public int getItemCount() { return mList.size(); } } private PopupWindow popupWindow; private void showPopu(ImageView view,long aid,int position) { CardView inflate = (CardView) LayoutInflater.from(getApplicationContext()).inflate(R.layout.academy_collection_shanchu, null); popupWindow=new PopupWindow(inflate,250, LinearLayout.LayoutParams.WRAP_CONTENT); //移除专辑 TextView textViewDelete= (TextView) inflate.findViewById(R.id.academy_collect_delete); TextView textViewSeeting= (TextView) inflate.findViewById(R.id.academy_collect_deletes); textViewSeeting.setText("专辑设置"); textViewDelete.setOnClickListener(new Listener(aid,position)); textViewSeeting.setOnClickListener(new Listener(aid,position)); //獲取焦點 popupWindow.setFocusable(true); popupWindow.setOutsideTouchable(true); popupWindow.setBackgroundDrawable(new BitmapDrawable()); //測量控件寬高 inflate.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); int popupWidth = inflate.getMeasuredWidth(); int popupHeight = inflate.getMeasuredHeight(); int[] location = new int[2]; view.getLocationOnScreen(location); //在控件上方显示 popupWindow.showAsDropDown(view,0-popupWidth,0-popupHeight-ScreenUtils.dp2Px(getApplicationContext(), 25)); // popupWindow.showAtLocation(view, Gravity.NO_GRAVITY, // (location[0] + view.getWidth() / 2) - popupWidth*3, location[1] - popupHeight*2); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // if (requestCode == ALBUM_DETAIL || requestCode == CREATE_ALBUM && resultCode == RESULT_OK) { // //刷新 // getAlbumListFromNet(); // } } class MViewHolder extends RecyclerView.ViewHolder { private TextView albumTitle,albumSec; private ImageView albumCover,albumMore; public MViewHolder(View itemView) { super(itemView); albumCover = (ImageView) itemView.findViewById(R.id.album_cover); albumTitle = (TextView) itemView.findViewById(R.id.album_title); albumMore= (ImageView) itemView.findViewById(R.id.album_more); albumSec= (TextView) itemView.findViewById(R.id.album_secret); } } int mScreenWidth; int mItemHeight; private int getHeight(){ mScreenWidth = ScreenUtils.instance().getWidth(); int itemWidth = (mScreenWidth -(3* ScreenUtils.dp2Px(getApplicationContext(),8)))/2; mItemHeight = (int) (itemWidth *0.562); return mItemHeight; } class Listener implements View.OnClickListener { private long aid; private int position; public Listener(long aid,int position){ this.aid=aid; this.position=position; } @Override public void onClick(View v) { switch (v.getId()){ case R.id.academy_collect_delete: AlbumDialog alertDialog= AlbumDialog.newInstance(aid,position); alertDialog.show(getSupportFragmentManager(), "alertDialog"); break; case R.id.academy_collect_deletes: Intent intent = new Intent(AlbumListActivity.this, SetUpAlbumActivity.class); intent.putExtra(SetUpAlbumActivity.GID, mGid); intent.putExtra("reSet","reSet"); intent.putExtra("aid",aid); intent.putExtra(SetUpAlbumActivity.ALBUM_TYPE, mAlbumType); startActivityForResult(intent, CREATE_ALBUM); popupWindow.dismiss(); break; } } } //自定义的对话框 private void selfDialoga(final long aid, final AlbumBean albumBean) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = getLayoutInflater(); final View view = inflater.inflate(R.layout.my_dialog, null); builder.setTitle("请输入密码"); builder.setView(view); builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { EditText editText= (EditText) view.findViewById(R.id.my_dialog_edit); editText.setTransformationMethod(PasswordTransformationMethod.getInstance()); editText.setInputType(InputType.TYPE_CLASS_NUMBER); sendSecret(aid,editText.getText().toString(),albumBean); } }); builder.setNegativeButton(getString(R.string.give_up), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { } }); AlertDialog dialog = builder.create(); dialog.show(); } private void sendSecret(final long aid, final String pwd, final AlbumBean albumBean) { //验证密码是否正确,同时如果正确,返回专辑详情 MJsonHttpResponseHandler handler = new MJsonHttpResponseHandler(AlbumDetailActivity.class) { @Override public void onGoodResponse(JSONObject response) { super.onGoodResponse(response); JSONObject a = response.optJSONObject("a"); AlbumDetail albumDetail = GsonUtil.getInstannce().getGson().fromJson(a.toString(), AlbumDetail.class); Intent intent = new Intent(AlbumListActivity.this, AlbumDetailActivity.class); intent.putExtra(AlbumDetailActivity.AID,aid); intent.putExtra(AlbumDetailActivity.ALBUM_TYPE, mAlbumType); intent.putExtra(AlbumDetailActivity.IS_PUBLIC, albumBean.getIsPublic()); intent.putExtra(AlbumDetailActivity.IS_JOIN, mIsJoin); intent.putExtra(AlbumDetailActivity.HAVE_POWER, mHavePower); intent.putExtra("allowCleanCreation", allowCleanCreation); intent.putExtra(AlbumDetailActivity.GID, mGid); intent.putExtra("more", more); intent.putExtra("pwd",pwd); startActivityForResult(intent, ALBUM_DETAIL); } @Override public void onBadResponse(JSONObject response) { super.onBadResponse(response); GaiaApp.showToast("密码错误"); } }; AlbumApiHelper.getAlbumDetail(aid, pwd, AlbumListActivity.this, handler); } @Override protected void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } }
[ "1163459047@qq.com" ]
1163459047@qq.com
4aedd602db0ea275ebb1d32a4f203e134a47a828
9e1757b5db85291ba4b363b56c85075765a90a44
/src/mappers/io/ImportTriplesReconstructMapper.java
d5c8bdd2cd4f16dbd6d88747617401a283f053ca
[ "Apache-2.0" ]
permissive
jrbn/webpie
4e07c7caff5a77b37055bbdf79413aa33818c27f
843807ef875b056b875cb250134730facc9c7cf1
refs/heads/master
2020-05-02T17:58:32.863165
2012-10-18T13:10:11
2012-10-18T13:10:11
6,278,620
2
0
null
null
null
null
UTF-8
Java
false
false
814
java
package mappers.io; import java.io.IOException; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.mapreduce.Mapper; import utils.NumberUtils; public class ImportTriplesReconstructMapper extends Mapper<LongWritable, BytesWritable, LongWritable, LongWritable> { private LongWritable oKey = new LongWritable(); private LongWritable oValue = new LongWritable(); protected void map(LongWritable key, BytesWritable value, Context context) throws IOException, InterruptedException { long newValue = 0; long newKey = 0; long iValue = NumberUtils.decodeLong(value.getBytes(), 0); newValue = key.get() << 2; newValue |= iValue & 0x3; newKey = iValue >> 2; oKey.set(newKey); oValue.set(newValue); context.write(oKey, oValue); } }
[ "jacopo@cs.vu.nl" ]
jacopo@cs.vu.nl
0a2319006e6db2f309c96fc06ee83a4628af6e92
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_a975da81f5cf63024c6e2a4ddb8edff9feeae0dd/RuleState/8_a975da81f5cf63024c6e2a4ddb8edff9feeae0dd_RuleState_t.java
9333b06a28c31f1238132dc5e08a22300c79b387
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
13,851
java
/****************************************************************** * File: RuleState.java * Created by: Dave Reynolds * Created on: 11-May-2003 * * (c) Copyright 2003, 2004, 2005, 2006 Hewlett-Packard Development Company, LP * [See end of file] * $Id: RuleState.java,v 1.7 2006-07-14 13:00:00 der Exp $ *****************************************************************/ package com.hp.hpl.jena.reasoner.rulesys.impl.oldCode; import com.hp.hpl.jena.reasoner.rulesys.*; import com.hp.hpl.jena.reasoner.rulesys.impl.BindingVector; import com.hp.hpl.jena.reasoner.rulesys.impl.StateFlag; import com.hp.hpl.jena.reasoner.*; import com.hp.hpl.jena.graph.*; /** * Part of the backward chaining rule interpreter. A RuleState represents * the state of a partially expanded search tree for a single Rule. * The RuleStates are linked back in an OR tree to a root goal which is * being satisfied. Each RuleState shares a pointer to a RuleInstance which * holds references for the rule being processed and the goal which the rule is * satisfying. * <p> * Encapuslation warning: this object is used in the tight inner loop of the engine so we access its * field pointers directly rather than through accessor methods. * </p> * * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a> * @version $Revision: 1.7 $ on $Date: 2006-07-14 13:00:00 $ */ public class RuleState { /** Reference to a package of information on the rule being processed */ protected RuleInstance ruleInstance; /** the parent RuleState for backtracking */ protected RuleState prev; /** The binding environment for the rule so far */ protected BindingVector env; /** The continuation point for the rule clause being processed */ protected GoalState goalState; /** Flag to indicate that rule state is scheduled on the agenda */ protected boolean isScheduled = false; /** The clause number in the rule to be processed next. */ int clauseIndex; /** binding offset for subject field, -1 if none */ int subjectBind; /** binding offset for predicate field, -1 if none */ int predicateBind; /** binding offset for object field, -1 if none */ int objectBind; /** functor node for object binding */ protected Functor functorMatch = null; /** * Normal constructor. Creates a new RuleState as an extension to an existing one. * @param parent the parent RuleState being expanded, can't be null * @param clause the TriplePattern which forms the goal for this state * @param index the index of the clause in the parent rule * @param env the prebound enviornment to use */ public RuleState(RuleState parent, TriplePattern clause, int index, BindingVector env) { prev = parent; ruleInstance = parent.ruleInstance; clauseIndex = index; this.env = env; TriplePattern subgoal = env.partInstantiate((TriplePattern)clause); goalState = ruleInstance.engine.findGoal(subgoal); initMapping(subgoal); ruleInstance.generator.incRefCount(); } /** * Constructor used when creating the first RuleState for a rule. * The caller is responsible for initializing the mapping. */ private RuleState(RuleInstance ruleInstance, BindingVector env, GoalState goalState, int index) { prev = null; this.ruleInstance = ruleInstance; this.env = env; this.goalState = goalState; this.clauseIndex = index; ruleInstance.generator.incRefCount(); } /** * Return the next match for this clause (or FAIL or SUSPEND) */ Object next() { if (goalState == null) { return StateFlag.SATISFIED; } else { return goalState.next(); } } /** * Return a new binding environment based on this one but extended * by the matches resulting from the given triple result for this state. */ public BindingVector newEnvironment(Triple result) { BindingVector newenv = new BindingVector(env); if (subjectBind != -1) newenv.bind(subjectBind, result.getSubject()); if (predicateBind != -1) newenv.bind(predicateBind, result.getPredicate()); if (objectBind != -1) newenv.bind(objectBind, result.getObject()); // Functor matches are not precompiled but intepreted if (functorMatch != null) { Node obj = result.getObject(); if (Functor.isFunctor(obj)) { Functor objValue = (Functor)obj.getLiteralValue(); if (objValue.getName().equals(functorMatch.getName())) { Node[] margs = functorMatch.getArgs(); Node[] args = objValue.getArgs(); if (margs.length != args.length) return null; for (int i = 0; i < margs.length; i++) { Node match = margs[i]; if (match instanceof Node_RuleVariable) { Node val = args[i]; if (Functor.isFunctor(val)) return null; if (!newenv.bind(match, val)) return null; } } } else { return null; } } else { return null; } } return newenv; } /** * Return the final goal result, based on the given binding environment */ public Triple getResult(BindingVector newenv) { return newenv.instantiate(ruleInstance.head); } /** * Return true if it seems worth scheduling this RuleState. This will be the case * if the RS can be immediately disposed of due to being complete or if there is a result known already. */ public boolean couldProcess() { if (goalState == null) return true; return goalState.couldProcess(); } /** * Initialize the mapping pointers that map result values to environment bindings */ private void initMapping(TriplePattern goal) { Node n = goal.getSubject(); subjectBind = (n instanceof Node_RuleVariable) ? ((Node_RuleVariable)n).getIndex() : -1 ; n = goal.getPredicate(); predicateBind = (n instanceof Node_RuleVariable) ? ((Node_RuleVariable)n).getIndex() : -1 ; n = goal.getObject(); objectBind = (n instanceof Node_RuleVariable) ? ((Node_RuleVariable)n).getIndex() : -1 ; if (Functor.isFunctor(n)) functorMatch = (Functor)n.getLiteralValue(); } /** * Return the index of the next body clause to try. * Takes clause reordering into account. */ protected int nextClauseIndex() { if (ruleInstance.clausesReordered) { if (clauseIndex == (ruleInstance.secondClause + 1) ) { // go back to do first clause return ruleInstance.secondClause - 1; } else if (clauseIndex == ruleInstance.secondClause) { return clauseIndex + 1; } } return clauseIndex; } /** * Close a non-longer needed rule state. This will decrement * the reference count of the goal table entry (this might have been * the last RuleState working on that entry) and will close any * iterators in the goal state. */ public void close() { if (goalState != null) goalState.close(); ruleInstance.generator.decRefCount(); } /** * Create the first RuleState for using a given rule to satisfy a goal. * @param rule the rule being instantiated * @param generator the GoalTable entry that this rule should generate results for * @param engine the parent rule engine * @return the instantiated initial RuleState or null if a guard predicate * fails so the rule is not applicable. */ public static RuleState createInitialState(Rule rule, GoalResults generator) { // Axioms are alredy handled by the infGraph so this first guard should be helpful but // in practice it doesn't seem to. // if (rule.bodyLength() == 0) return null; TriplePattern goal = generator.goal; TriplePattern head = (TriplePattern) rule.getHeadElement(0); BindingVector env = BindingVector.unify(goal, head, rule.getNumVars()); if (env == null) return null; // Find the first goal clause RuleInstance ri = new RuleInstance(generator, rule, head); int maxClause = rule.bodyLength(); int clauseIndex = 0; while (clauseIndex < maxClause) { ClauseEntry clause = rule.getBodyElement(clauseIndex++); if (clause instanceof TriplePattern) { // Check for possible clause reorder ... ClauseEntry secondClause = null; boolean foundSecondClause = false; if (clauseIndex < maxClause) { secondClause = rule.getBodyElement(clauseIndex); if (secondClause instanceof TriplePattern) { foundSecondClause = true; } } if (foundSecondClause) { int score1 = scoreClauseBoundness((TriplePattern)clause, head, env); int score2 = scoreClauseBoundness((TriplePattern)secondClause, head, env); if (score2 > score1) { ri.clausesReordered = true; ri.secondClause = clauseIndex; clause = secondClause; clauseIndex++; } } // ... end of clause reorder TriplePattern subgoal = env.partInstantiate((TriplePattern)clause); if (!subgoal.isLegal()) return null; GoalState gs = generator.getEngine().findGoal(subgoal); RuleState rs = new RuleState(ri, env, gs, clauseIndex); rs.initMapping(subgoal); return rs; } else { if (!generator.getEngine().processBuiltin(clause, rule, env)) { return null; } } } // If we get to here there are no rule body clause to process return new RuleState(ri, env, null, 0); } /** * Score a clause in terms of groundedness using simple heurisitcs. * For this case we are only considering head variables which occur * in the clause and score on boundedness of these. */ private static int scoreClauseBoundness(TriplePattern clause, TriplePattern head, BindingVector env) { return scoreNodeBoundness(clause.getSubject(), head, env) + scoreNodeBoundness(clause.getPredicate(), head, env) + scoreNodeBoundness(clause.getObject(), head, env); } /** * Score a node from a pattern as part of scoreClauseBoundedness. */ private static int scoreNodeBoundness(Node n, TriplePattern head, BindingVector env) { if (n.isVariable()) { if (n == head.getSubject() || n == head.getPredicate() || n == head.getObject() ) { Node val = env.getBinding(n); if (val == null || val.isVariable()) return -5; return 5; } else { return 0; } } else { return 1; } } /** * Printable string */ public String toString() { return "RuleState " + ruleInstance.rule.toShortString() + "("+ (clauseIndex-1) +")" // + ", env=" + env + ", gs=" + goalState; } } /* (c) Copyright 2003, 2004, 2005, 2006 Hewlett-Packard Development Company, LP All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4f1b36e2fadae4dba294cfb1ffe1a64a7c2c59be
4f73a62d428147f4895606821fde101429212145
/src/main/java/frogger/world/levels/LevelThree.java
7e866ce68b1c102ccc03992f78d6929634d5ab3e
[]
no_license
maestoso292/COMP2042_CW_syedahmadazhad
2e9d462f665b99bd67bf2cb42b774fae46c1267a
3a8d3eebb3bc106d2144f55cecf2cc06d32e6449
refs/heads/master
2023-02-02T20:57:30.219300
2020-12-18T18:45:12
2020-12-18T18:45:12
307,588,484
0
0
null
null
null
null
UTF-8
Java
false
false
2,339
java
package frogger.world.levels; import frogger.actor.*; /** * LevelThree is a class that creates a custom Level for the Frogger game to use. * @see Level * @see LevelFactory */ public class LevelThree extends Level { /** * Creates a new instance of LevelThree with preset child nodes. Called by LevelFactory. * @param levelNumber Specifies the level number. * @param waterBoundary Specifies the y-coordinate where the water region begins in the level. */ protected LevelThree(int levelNumber, double waterBoundary) { super(levelNumber, waterBoundary); add(new Log(Log.LogType.SHORT, 0, Section.THREE.getY(), 1)); add(new Log(Log.LogType.SHORT, 350, Section.THREE.getY(), 1)); add(new WetTurtle(500, Section.FOUR.getY(), -1.25, true)); add(new Turtle(300, Section.FOUR.getY(), -1.25)); add(new WetTurtle(100, Section.FOUR.getY(), -1.25, true)); add(new Turtle(150, Section.FIVE.getY(), 0.75)); add(new WetTurtle(350, Section.FIVE.getY(), 0.75, true)); add(new WetTurtle(550, Section.FIVE.getY(), 0.75, true)); // Ensures that animal is above platforms but below obstacles getAnimal().toFront(); add(new Car(Car.CarType.RED, 0, Section.SEVEN.getY(), -5)); add(new Truck(Truck.TruckType.LONG, 0, Section.EIGHT.getY(), 1.5)); add(new Truck(Truck.TruckType.LONG, 400, Section.EIGHT.getY(), 1.5)); add(new Truck(Truck.TruckType.SHORT, 0, Section.NINE.getY(), -1.5)); add(new Truck(Truck.TruckType.SHORT, 200, Section.NINE.getY(), -1.5)); add(new Truck(Truck.TruckType.SHORT, 450, Section.NINE.getY(), -1.5)); add(new Car(Car.CarType.RED, 0, Section.TEN.getY(), 1)); add(new Car(Car.CarType.WHITE, 120, Section.TEN.getY(), 1)); add(new Car(Car.CarType.RED, 300, Section.TEN.getY(), 1)); add(new Car(Car.CarType.WHITE, 450, Section.TEN.getY(), 1)); add(new Truck(Truck.TruckType.LONG, 200, Section.ELEVEN.getY(), 4)); add(new Car(Car.CarType.WHITE, 100, Section.TWELVE.getY(), -3)); add(new Car(Car.CarType.RED, 400, Section.TWELVE.getY(), -3)); add(new Truck(Truck.TruckType.SHORT, 0, Section.THIRTEEN.getY(), 2)); add(new Truck(Truck.TruckType.SHORT, 300, Section.THIRTEEN.getY(), 2)); } }
[ "65017095+maestoso292@users.noreply.github.com" ]
65017095+maestoso292@users.noreply.github.com
ddfe5ea6886457c15ff8e259c59b8f159ded59d0
b51f81c461ae3087aa01bb656225f361ff8339b9
/src/main/java/com/example/bean/LasAccount3DynEntity.java
b97e74e975f239ba516a8aaa6015101064c009c4
[]
no_license
RoxyYao/type2
cf151c210a0d590b02dcbf3735c5ca871f2dad59
fd58783cdedd194e32cf50f68c54c5ca560c49fc
refs/heads/master
2021-01-17T17:46:48.951450
2016-10-11T09:12:48
2016-10-11T09:12:48
70,572,052
0
0
null
null
null
null
UTF-8
Java
false
false
11,941
java
package com.example.bean; import javax.persistence.*; import java.sql.Time; /** * Created by yy on 2016/10/10 * . */ @Entity @Table(name = "LAS_ACCOUNT3DYN", schema = "TYPE23", catalog = "") public class LasAccount3DynEntity { private long id; private String brcno; private String acctno; private String subone; private String subtwo; private String ccy; private long bal; private String stoppayflag; private String frozenflag; private long lastbal; private long ctramt; private Long intctrlamt; private String intflag; private String taxflag; private String intplanno; private String taxplanno; private String floatintflag; private Long floatrate; private String opendate; private String beginintdate; private Time trandate; private String lastdate; private Long forctrlamt; private Long forcrtotbal; private Long forcrtotamt; private String forprono; private String openbrc; private String profitbrc; private String acctinfo; @Id @Column(name = "ID") public long getId() { return id; } public void setId(long id) { this.id = id; } @Basic @Column(name = "BRCNO") public String getBrcno() { return brcno; } public void setBrcno(String brcno) { this.brcno = brcno; } @Basic @Column(name = "ACCTNO") public String getAcctno() { return acctno; } public void setAcctno(String acctno) { this.acctno = acctno; } @Basic @Column(name = "SUBONE") public String getSubone() { return subone; } public void setSubone(String subone) { this.subone = subone; } @Basic @Column(name = "SUBTWO") public String getSubtwo() { return subtwo; } public void setSubtwo(String subtwo) { this.subtwo = subtwo; } @Basic @Column(name = "CCY") public String getCcy() { return ccy; } public void setCcy(String ccy) { this.ccy = ccy; } @Basic @Column(name = "BAL") public long getBal() { return bal; } public void setBal(long bal) { this.bal = bal; } @Basic @Column(name = "STOPPAYFLAG") public String getStoppayflag() { return stoppayflag; } public void setStoppayflag(String stoppayflag) { this.stoppayflag = stoppayflag; } @Basic @Column(name = "FROZENFLAG") public String getFrozenflag() { return frozenflag; } public void setFrozenflag(String frozenflag) { this.frozenflag = frozenflag; } @Basic @Column(name = "LASTBAL") public long getLastbal() { return lastbal; } public void setLastbal(long lastbal) { this.lastbal = lastbal; } @Basic @Column(name = "CTRAMT") public long getCtramt() { return ctramt; } public void setCtramt(long ctramt) { this.ctramt = ctramt; } @Basic @Column(name = "INTCTRLAMT") public Long getIntctrlamt() { return intctrlamt; } public void setIntctrlamt(Long intctrlamt) { this.intctrlamt = intctrlamt; } @Basic @Column(name = "INTFLAG") public String getIntflag() { return intflag; } public void setIntflag(String intflag) { this.intflag = intflag; } @Basic @Column(name = "TAXFLAG") public String getTaxflag() { return taxflag; } public void setTaxflag(String taxflag) { this.taxflag = taxflag; } @Basic @Column(name = "INTPLANNO") public String getIntplanno() { return intplanno; } public void setIntplanno(String intplanno) { this.intplanno = intplanno; } @Basic @Column(name = "TAXPLANNO") public String getTaxplanno() { return taxplanno; } public void setTaxplanno(String taxplanno) { this.taxplanno = taxplanno; } @Basic @Column(name = "FLOATINTFLAG") public String getFloatintflag() { return floatintflag; } public void setFloatintflag(String floatintflag) { this.floatintflag = floatintflag; } @Basic @Column(name = "FLOATRATE") public Long getFloatrate() { return floatrate; } public void setFloatrate(Long floatrate) { this.floatrate = floatrate; } @Basic @Column(name = "OPENDATE") public String getOpendate() { return opendate; } public void setOpendate(String opendate) { this.opendate = opendate; } @Basic @Column(name = "BEGININTDATE") public String getBeginintdate() { return beginintdate; } public void setBeginintdate(String beginintdate) { this.beginintdate = beginintdate; } @Basic @Column(name = "TRANDATE") public Time getTrandate() { return trandate; } public void setTrandate(Time trandate) { this.trandate = trandate; } @Basic @Column(name = "LASTDATE") public String getLastdate() { return lastdate; } public void setLastdate(String lastdate) { this.lastdate = lastdate; } @Basic @Column(name = "FORCTRLAMT") public Long getForctrlamt() { return forctrlamt; } public void setForctrlamt(Long forctrlamt) { this.forctrlamt = forctrlamt; } @Basic @Column(name = "FORCRTOTBAL") public Long getForcrtotbal() { return forcrtotbal; } public void setForcrtotbal(Long forcrtotbal) { this.forcrtotbal = forcrtotbal; } @Basic @Column(name = "FORCRTOTAMT") public Long getForcrtotamt() { return forcrtotamt; } public void setForcrtotamt(Long forcrtotamt) { this.forcrtotamt = forcrtotamt; } @Basic @Column(name = "FORPRONO") public String getForprono() { return forprono; } public void setForprono(String forprono) { this.forprono = forprono; } @Basic @Column(name = "OPENBRC") public String getOpenbrc() { return openbrc; } public void setOpenbrc(String openbrc) { this.openbrc = openbrc; } @Basic @Column(name = "PROFITBRC") public String getProfitbrc() { return profitbrc; } public void setProfitbrc(String profitbrc) { this.profitbrc = profitbrc; } @Basic @Column(name = "ACCTINFO") public String getAcctinfo() { return acctinfo; } public void setAcctinfo(String acctinfo) { this.acctinfo = acctinfo; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LasAccount3DynEntity that = (LasAccount3DynEntity) o; if (id != that.id) return false; if (bal != that.bal) return false; if (lastbal != that.lastbal) return false; if (ctramt != that.ctramt) return false; if (brcno != null ? !brcno.equals(that.brcno) : that.brcno != null) return false; if (acctno != null ? !acctno.equals(that.acctno) : that.acctno != null) return false; if (subone != null ? !subone.equals(that.subone) : that.subone != null) return false; if (subtwo != null ? !subtwo.equals(that.subtwo) : that.subtwo != null) return false; if (ccy != null ? !ccy.equals(that.ccy) : that.ccy != null) return false; if (stoppayflag != null ? !stoppayflag.equals(that.stoppayflag) : that.stoppayflag != null) return false; if (frozenflag != null ? !frozenflag.equals(that.frozenflag) : that.frozenflag != null) return false; if (intctrlamt != null ? !intctrlamt.equals(that.intctrlamt) : that.intctrlamt != null) return false; if (intflag != null ? !intflag.equals(that.intflag) : that.intflag != null) return false; if (taxflag != null ? !taxflag.equals(that.taxflag) : that.taxflag != null) return false; if (intplanno != null ? !intplanno.equals(that.intplanno) : that.intplanno != null) return false; if (taxplanno != null ? !taxplanno.equals(that.taxplanno) : that.taxplanno != null) return false; if (floatintflag != null ? !floatintflag.equals(that.floatintflag) : that.floatintflag != null) return false; if (floatrate != null ? !floatrate.equals(that.floatrate) : that.floatrate != null) return false; if (opendate != null ? !opendate.equals(that.opendate) : that.opendate != null) return false; if (beginintdate != null ? !beginintdate.equals(that.beginintdate) : that.beginintdate != null) return false; if (trandate != null ? !trandate.equals(that.trandate) : that.trandate != null) return false; if (lastdate != null ? !lastdate.equals(that.lastdate) : that.lastdate != null) return false; if (forctrlamt != null ? !forctrlamt.equals(that.forctrlamt) : that.forctrlamt != null) return false; if (forcrtotbal != null ? !forcrtotbal.equals(that.forcrtotbal) : that.forcrtotbal != null) return false; if (forcrtotamt != null ? !forcrtotamt.equals(that.forcrtotamt) : that.forcrtotamt != null) return false; if (forprono != null ? !forprono.equals(that.forprono) : that.forprono != null) return false; if (openbrc != null ? !openbrc.equals(that.openbrc) : that.openbrc != null) return false; if (profitbrc != null ? !profitbrc.equals(that.profitbrc) : that.profitbrc != null) return false; if (acctinfo != null ? !acctinfo.equals(that.acctinfo) : that.acctinfo != null) return false; return true; } @Override public int hashCode() { int result = (int) (id ^ (id >>> 32)); result = 31 * result + (brcno != null ? brcno.hashCode() : 0); result = 31 * result + (acctno != null ? acctno.hashCode() : 0); result = 31 * result + (subone != null ? subone.hashCode() : 0); result = 31 * result + (subtwo != null ? subtwo.hashCode() : 0); result = 31 * result + (ccy != null ? ccy.hashCode() : 0); result = 31 * result + (int) (bal ^ (bal >>> 32)); result = 31 * result + (stoppayflag != null ? stoppayflag.hashCode() : 0); result = 31 * result + (frozenflag != null ? frozenflag.hashCode() : 0); result = 31 * result + (int) (lastbal ^ (lastbal >>> 32)); result = 31 * result + (int) (ctramt ^ (ctramt >>> 32)); result = 31 * result + (intctrlamt != null ? intctrlamt.hashCode() : 0); result = 31 * result + (intflag != null ? intflag.hashCode() : 0); result = 31 * result + (taxflag != null ? taxflag.hashCode() : 0); result = 31 * result + (intplanno != null ? intplanno.hashCode() : 0); result = 31 * result + (taxplanno != null ? taxplanno.hashCode() : 0); result = 31 * result + (floatintflag != null ? floatintflag.hashCode() : 0); result = 31 * result + (floatrate != null ? floatrate.hashCode() : 0); result = 31 * result + (opendate != null ? opendate.hashCode() : 0); result = 31 * result + (beginintdate != null ? beginintdate.hashCode() : 0); result = 31 * result + (trandate != null ? trandate.hashCode() : 0); result = 31 * result + (lastdate != null ? lastdate.hashCode() : 0); result = 31 * result + (forctrlamt != null ? forctrlamt.hashCode() : 0); result = 31 * result + (forcrtotbal != null ? forcrtotbal.hashCode() : 0); result = 31 * result + (forcrtotamt != null ? forcrtotamt.hashCode() : 0); result = 31 * result + (forprono != null ? forprono.hashCode() : 0); result = 31 * result + (openbrc != null ? openbrc.hashCode() : 0); result = 31 * result + (profitbrc != null ? profitbrc.hashCode() : 0); result = 31 * result + (acctinfo != null ? acctinfo.hashCode() : 0); return result; } }
[ "yy" ]
yy
07b5a4582dff23fe068529ea33f5c0bd17a4afa3
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgDoma/src/org/kyojo/schemaorg/m3n4/healthLifesci/impl/PREGNANCY_CATEGORY.java
b339095d43bda0979c90d5aac839dcd05eea58f2
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
3,052
java
package org.kyojo.schemaorg.m3n4.healthLifesci.impl; import java.util.ArrayList; import java.util.List; import org.kyojo.schemaorg.SimpleJsonBuilder; import org.kyojo.schemaorg.m3n4.core.Container.Name; import org.kyojo.schemaorg.m3n4.healthLifesci.Clazz.DrugPregnancyCategory; import org.kyojo.schemaorg.m3n4.healthLifesci.Container; import org.kyojo.schemaorg.m3n4.healthLifesci.impl.DRUG_PREGNANCY_CATEGORY; import org.seasar.doma.Transient; public class PREGNANCY_CATEGORY implements Container.PregnancyCategory { private static final long serialVersionUID = 1L; @Transient public List<DrugPregnancyCategory> drugPregnancyCategoryList; public PREGNANCY_CATEGORY() { } public PREGNANCY_CATEGORY(String string) { this(new DRUG_PREGNANCY_CATEGORY(string)); } public String getString() { if(drugPregnancyCategoryList == null || drugPregnancyCategoryList.size() == 0 || drugPregnancyCategoryList.get(0) == null) { return null; } else { Name name = drugPregnancyCategoryList.get(0).getName(); if(name == null || name.getTextList() == null || name.getTextList().size() == 0 || name.getTextList().get(0) == null) { return null; } else { return name.getTextList().get(0).getString(); } } } public void setString(String string) { if(drugPregnancyCategoryList == null) { drugPregnancyCategoryList = new ArrayList<DrugPregnancyCategory>(); } if(drugPregnancyCategoryList.size() == 0) { drugPregnancyCategoryList.add(new DRUG_PREGNANCY_CATEGORY(string)); } else { drugPregnancyCategoryList.set(0, new DRUG_PREGNANCY_CATEGORY(string)); } } public PREGNANCY_CATEGORY(DrugPregnancyCategory drugPregnancyCategory) { drugPregnancyCategoryList = new ArrayList<DrugPregnancyCategory>(); drugPregnancyCategoryList.add(drugPregnancyCategory); } @Override public DrugPregnancyCategory getDrugPregnancyCategory() { if(drugPregnancyCategoryList != null && drugPregnancyCategoryList.size() > 0) { return drugPregnancyCategoryList.get(0); } else { return null; } } @Override public void setDrugPregnancyCategory(DrugPregnancyCategory drugPregnancyCategory) { if(drugPregnancyCategoryList == null) { drugPregnancyCategoryList = new ArrayList<>(); } if(drugPregnancyCategoryList.size() == 0) { drugPregnancyCategoryList.add(drugPregnancyCategory); } else { drugPregnancyCategoryList.set(0, drugPregnancyCategory); } } @Override public List<DrugPregnancyCategory> getDrugPregnancyCategoryList() { return drugPregnancyCategoryList; } @Override public void setDrugPregnancyCategoryList(List<DrugPregnancyCategory> drugPregnancyCategoryList) { this.drugPregnancyCategoryList = drugPregnancyCategoryList; } @Override public boolean hasDrugPregnancyCategory() { return drugPregnancyCategoryList != null && drugPregnancyCategoryList.size() > 0 && drugPregnancyCategoryList.get(0) != null; } @Override public String getNativeValue() { return getString(); } @Override public String toString() { return SimpleJsonBuilder.toJson(this); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
de2012cfe00d2c43d28aea24fda0b218e75730aa
70b860e6a929058f35b09c244c94644e7620461b
/src/ch/hszt/hs_2011/aud/exercise_06/Task1Samples.java
5d411682fc5734ac6ec2ecb1c495c1e12588cfb6
[]
no_license
foyan/Algorithmen
211e0e5050fff904798adf1b10ac4d03147de847
6073ef1ba38c414a2071bf9412a773c77e31c903
refs/heads/master
2021-01-15T23:02:18.057134
2011-12-18T15:32:35
2011-12-18T15:32:35
2,663,864
0
1
null
null
null
null
UTF-8
Java
false
false
2,205
java
package ch.hszt.hs_2011.aud.exercise_06; public final class Task1Samples { public static void main(String[] args) { Task1 list = new Task1Impl_Luethi(); /* Spirituosenliste 21:00 */ list.prepend(list.newListNode("Grappa")); list.prepend(list.newListNode("Fernet Branca")); list.prepend(list.newListNode("Limoncello")); list.append(list.newListNode("Chartreuse")); list.append(list.newListNode("Tequila")); list.append(list.newListNode("Benedictine")); list.prepend(list.newListNode("Cointreau")); list.prepend(list.newListNode("Russian Standard")); list.prepend(list.newListNode("Cragganmore")); list.append(list.newListNode("Friesengeist")); list.append(list.newListNode("Weissflog")); list.append(list.newListNode("Absinthe")); System.out.println("---------- Spirituosenliste 21:00 ----------"); System.out.println(list.toString()); System.out.println(); /* Spirituosenliste 01:30 */ list.deleteNodeWith("Grappa"); list.deleteNodeWith("Tequila"); list.deleteNodeWith("Weissflog"); list.deleteNodeWith("Russian Standard"); list.deleteNodeWith("Absinthe"); list.deleteNodeWith("Cragganmore"); System.out.println("---------- Spirituosenliste 01:30 ----------"); System.out.println("Leer ist: Grappe, Tequila, Weissflog, Russion Standard, Absinthe, Cragganmore"); System.out.println("Somit bleibt �brig:\n"); System.out.println(list.toString()); System.out.println(); /* Sortiertes Einfuegen */ list.deleteAllNodes(); System.out .println("Unterdessen ist alles leer.\nNeu hinzugef�gt wird in dieser Reihenfolge: \nTequila, Fernet Branca, Charteuse, Benedictine, Limoncello\n"); list.sortedInsert(list.newListNode("Tequila")); list.sortedInsert(list.newListNode("Fernet Branca")); list.sortedInsert(list.newListNode("Chartreuse")); list.sortedInsert(list.newListNode("Benedictine")); list.sortedInsert(list.newListNode("Limoncello")); System.out.println("---------- Sortiert (nach Alphabet): ----------"); System.out.println(list.toString()); System.out.println(); System.out.println("---------- Revese Order: ----------"); System.out.println(list.WriteNodesInReverseOrder()); System.out.println(); } }
[ "vlo@guez.li" ]
vlo@guez.li
671360fa4871452f9e08cd54f04ce905b33352c9
029215efd595aee41ac6b96f2f5dba1a21d3eedd
/Leetcode/Combination Sum III/Solution.java
60a9908d6b4be886ecb8a547c13c3b71a0c24283
[]
no_license
nickboy/Technical-Interview
b2897edd9c43877a7c69c23653df22a953b0cd93
fd2dd51c7997965b37d8788c057be3ea45532c10
refs/heads/master
2020-05-17T17:29:10.156598
2016-02-12T06:00:15
2016-02-12T06:00:15
33,785,518
0
0
null
null
null
null
UTF-8
Java
false
false
992
java
public class Solution { private int number; private int size; public List<List<Integer>> combinationSum3(int k, int n) { number = n; size = k; List<List<Integer>> res = new ArrayList<List<Integer>>(); if (k == 0) { return res; } helper(res, new ArrayList<Integer>(), 0, 1); return res; } private void helper(List<List<Integer>> res, ArrayList<Integer> tempRes, int cur, int pos) { if (tempRes.size() == size && number == cur) { res.add(new ArrayList<Integer>(tempRes)); return; } //記住,要看清題目,只能用到9,而非n for (int i = pos; i <= 9; i++) { if (cur + i <= number) { tempRes.add(i); helper(res, tempRes, cur + i, i+1); tempRes.remove(tempRes.size() - 1); } } } }
[ "nickboy0211@hotmail.com" ]
nickboy0211@hotmail.com
77205a6abb3c285f54e17ca434f429d5af36b64f
028cbe18b4e5c347f664c592cbc7f56729b74060
/external/modules/weld/core/1.1.0.Beta2/impl/src/main/java/org/jboss/weld/bean/interceptor/WeldInterceptorInstantiator.java
11b419de7f067add30cda3806a3fc0b10a8a02cf
[]
no_license
dmatej/Glassfish-SVN-Patched
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
269e29ba90db6d9c38271f7acd2affcacf2416f1
refs/heads/master
2021-05-28T12:55:06.267463
2014-11-11T04:21:44
2014-11-11T04:21:44
23,610,469
1
0
null
null
null
null
UTF-8
Java
false
false
2,730
java
package org.jboss.weld.bean.interceptor; import org.jboss.interceptor.spi.instance.InterceptorInstantiator; import org.jboss.interceptor.spi.metadata.ClassMetadata; import org.jboss.interceptor.spi.metadata.InterceptorReference; import org.jboss.weld.exceptions.DeploymentException; import org.jboss.weld.manager.BeanManagerImpl; import org.jboss.weld.serialization.spi.helpers.SerializableContextual; import org.jboss.weld.util.reflection.SecureReflections; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.spi.AnnotatedType; import javax.enterprise.inject.spi.InjectionTarget; import javax.enterprise.inject.spi.Interceptor; import java.lang.reflect.Constructor; /** * @author Marius Bogoevici * @param <T> */ public class WeldInterceptorInstantiator<T> implements InterceptorInstantiator<T, Object> { private BeanManagerImpl manager; private CreationalContext<T> creationalContext; public WeldInterceptorInstantiator(BeanManagerImpl manager, CreationalContext<T> creationalContext) { this.manager = manager; this.creationalContext = creationalContext; } public T createFor(InterceptorReference<Object> interceptorReference) { if (interceptorReference.getInterceptor() instanceof ClassMetadata<?>) { try { // this is not a managed instance - assume no-argument constructor exists Class<T> clazz = (Class<T>) interceptorReference.getClassMetadata().getJavaClass(); Constructor<T> constructor = ((Constructor<T>) SecureReflections.getDeclaredConstructor(clazz)); T interceptorInstance = SecureReflections.ensureAccessible(constructor).newInstance(); // inject AnnotatedType<T> type = manager.createAnnotatedType(clazz); InjectionTarget<T> target = manager.createInjectionTarget(type); target.inject(interceptorInstance, creationalContext); return interceptorInstance; } catch (Exception e) { throw new DeploymentException(e); } } if (interceptorReference.getInterceptor() instanceof SerializableContextual) { try { // this is not a managed instance - assume no-argument constructor exists SerializableContextual<Interceptor<T>, T> serializableContextual = (SerializableContextual<Interceptor<T>, T>) interceptorReference.getInterceptor(); return (T) manager.getReference(serializableContextual.get(), creationalContext, false); } catch (Exception e) { throw new DeploymentException(e); } } throw new IllegalStateException(); } }
[ "sivakumart@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5" ]
sivakumart@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
a48022feeff1fce09cc509d8ad4a093fd0adb729
17a4e94fcb6b6f64258850515dc4a95ae0fb633b
/tajo-storage/src/main/java/org/apache/tajo/storage/parquet/TajoWriteSupport.java
83b2f7bf7c54f3c2deb2fb038608b4912617edd3
[ "MIT", "Apache-2.0" ]
permissive
sungsoo/tajo
bd1a8b82764250a2fce50b293bd7753aa2038edb
23e25f43956b762ee3dfe1612b2760f717b0c461
refs/heads/master
2021-01-20T10:30:34.334633
2014-07-15T08:44:07
2014-07-15T08:44:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,916
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tajo.storage.parquet; import java.util.Map; import java.util.HashMap; import java.util.List; import parquet.hadoop.api.WriteSupport; import parquet.io.api.Binary; import parquet.io.api.RecordConsumer; import parquet.schema.GroupType; import parquet.schema.MessageType; import parquet.schema.Type; import org.apache.hadoop.conf.Configuration; import org.apache.tajo.catalog.Schema; import org.apache.tajo.catalog.Column; import org.apache.tajo.common.TajoDataTypes; import org.apache.tajo.storage.Tuple; import org.apache.tajo.datum.Datum; /** * Tajo implementation of {@link WriteSupport} for {@link Tuple}s. * Users should use {@link ParquetAppender} and not this class directly. */ public class TajoWriteSupport extends WriteSupport<Tuple> { private static final String TAJO_SCHEMA = "parquet.tajo.schema"; private RecordConsumer recordConsumer; private MessageType rootSchema; private Schema rootTajoSchema; /** * Creates a new TajoWriteSupport. * * @param tajoSchema The Tajo schema for the table. */ public TajoWriteSupport(Schema tajoSchema) { this.rootSchema = new TajoSchemaConverter().convert(tajoSchema); this.rootTajoSchema = tajoSchema; } /** * Initializes the WriteSupport. * * @param configuration The job's configuration. * @return A WriteContext that describes how to write the file. */ @Override public WriteContext init(Configuration configuration) { Map<String, String> extraMetaData = new HashMap<String, String>(); extraMetaData.put(TajoReadSupport.TAJO_SCHEMA_METADATA_KEY, rootTajoSchema.toJson()); return new WriteContext(rootSchema, extraMetaData); } /** * Called once per row group. * * @param recordConsumer The {@link RecordConsumer} to write to. */ @Override public void prepareForWrite(RecordConsumer recordConsumer) { this.recordConsumer = recordConsumer; } /** * Writes a Tuple to the file. * * @param tuple The Tuple to write to the file. */ @Override public void write(Tuple tuple) { recordConsumer.startMessage(); writeRecordFields(rootSchema, rootTajoSchema, tuple); recordConsumer.endMessage(); } private void writeRecordFields(GroupType schema, Schema tajoSchema, Tuple tuple) { List<Type> fields = schema.getFields(); // Parquet ignores Tajo NULL_TYPE columns, so the index may differ. int index = 0; for (int tajoIndex = 0; tajoIndex < tajoSchema.size(); ++tajoIndex) { Column column = tajoSchema.getColumn(tajoIndex); if (column.getDataType().getType() == TajoDataTypes.Type.NULL_TYPE) { continue; } Datum datum = tuple.get(tajoIndex); Type fieldType = fields.get(index); if (!tuple.isNull(tajoIndex)) { recordConsumer.startField(fieldType.getName(), index); writeValue(fieldType, column, datum); recordConsumer.endField(fieldType.getName(), index); } else if (fieldType.isRepetition(Type.Repetition.REQUIRED)) { throw new RuntimeException("Null-value for required field: " + column.getSimpleName()); } ++index; } } private void writeValue(Type fieldType, Column column, Datum datum) { switch (column.getDataType().getType()) { case BOOLEAN: recordConsumer.addBoolean((Boolean) datum.asBool()); break; case BIT: case INT2: case INT4: recordConsumer.addInteger(datum.asInt4()); break; case INT8: recordConsumer.addLong(datum.asInt8()); break; case FLOAT4: recordConsumer.addFloat(datum.asFloat4()); break; case FLOAT8: recordConsumer.addDouble(datum.asFloat8()); break; case CHAR: case TEXT: recordConsumer.addBinary(Binary.fromString(datum.asChars())); break; case PROTOBUF: case BLOB: case INET4: case INET6: recordConsumer.addBinary(Binary.fromByteArray(datum.asByteArray())); break; default: break; } } }
[ "hyunsik@apache.org" ]
hyunsik@apache.org
57e83bb2de70adf749fc4265ac0efa3bd15d94f6
f271a9eedec6271c693563914e90fd46b97c2e61
/src/main/java/com/yujibolt90/mobnuke/Fallout.java
3222173e8f04a59f251f8bcb35f8382658d68bd1
[]
no_license
vegeta2005/MobNuke
137c0038c0cd8abb6cd858c9e8c9f33c81f4c7b8
a963f550ff1f5a6b974232383444669152cbd104
refs/heads/main
2023-05-19T11:28:53.079844
2021-06-08T17:30:36
2021-06-08T17:30:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
794
java
package com.yujibolt90.mobnuke; import org.bukkit.util.Vector; public class Fallout{ double hDecay; double vDecay; double x1; double x2; double y1; double y2; double z1; double z2; public Fallout(double x, double y, double z, double h, double v) { this.x1 = x; this.x2 = x; this.y1 = y; this.y2 = y; this.z1 = z; this.z2 = z; this.hDecay = h; this.vDecay = v; } public void increaseFallout() { this.x1 += hDecay; this.x2 -= hDecay; this.y1 += vDecay; this.y2 -= vDecay; this.z1 += hDecay; this.z2 -= hDecay; } public Vector getFirstVector() { Vector v = new Vector(x1,y1,z1); return v; } public Vector getSecondVector() { Vector v = new Vector(x2,y2,z2); return v; } }
[ "noreply@github.com" ]
noreply@github.com
922a5207a57fc5e6c06414000e627fe2dd0820fa
42a7efea3b53eb82621961b28f61b21d85a91909
/src/cn/itcast/shop/cart/CartItem.java
bb3c67cfc55312d10b20ce94f1a75bf3d368cee8
[]
no_license
huangshichen1/shop
d037223498dc0580f82da62651fcab4c240850e5
e20f90bc15bd6f6283447da0f3cb9e2370469b21
refs/heads/master
2023-01-11T08:20:55.463393
2020-11-16T07:19:42
2020-11-16T07:19:42
112,476,190
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
package cn.itcast.shop.cart; import cn.itcast.shop.product.Product; /** * 购物项: * @author 传智.郭嘉 * */ public class CartItem { // 商品对象 private Product product; // 数量 private Integer count; // 小计 private Double subtotal; public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public Double getSubtotal() { return count * product.getShop_price(); } }
[ "1641452570@qq.com" ]
1641452570@qq.com
0da8c2de12604a3bcd554e52c0637aa7a6c3c1e0
3d51cce8d4a82bd6b1750a8e78fb18b2d5666d54
/ShopRangerApp/app/src/main/java/com/example/shopranger/activity/SearchResultActivity.java
7e9bdb774fdcf7abac68ea54b718cc0351a92a78
[]
no_license
aickathon2018/JustForFun
0860da048ef148aa482a03eb680e0c2abd685065
1a71047f2951d156c29ac5c492dbbcb7c0361ec5
refs/heads/master
2020-04-07T04:02:16.970916
2018-11-18T01:15:21
2018-11-18T01:15:21
158,037,812
2
0
null
null
null
null
UTF-8
Java
false
false
1,342
java
package com.example.shopranger.activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; import android.widget.TextView; import android.support.v7.widget.Toolbar; import com.example.shopranger.R; public class SearchResultActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search_result); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_arrow_back); } String result = getIntent().getExtras().getString("result"); TextView result_text = findViewById(R.id.result); result_text.setText(result); byte[] byteArray = getIntent().getByteArrayExtra("image"); Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length); ImageView image = findViewById(R.id.image); image.setImageBitmap(bmp); } }
[ "kphilemon0529@gmail.com" ]
kphilemon0529@gmail.com
4b967c8e732a2addab1c0be323dd8b1dfc0daeb7
1dbac2875ed722bdb4a0218e2a863caf65242611
/Graphs/src/GraphADType/Utilities/RunBenchmark.java
bb96b25b9e8844e5483f38f251771aade368fd2d
[]
no_license
nunofaria11/ugl-uminho-cpd
da665c63f48939a4f7203f1aee44cb1ef2d11aeb
860cd4a21e0c26d764eb36c2a18eb836f5cc39b1
refs/heads/master
2021-01-23T12:10:56.899253
2015-03-16T09:19:42
2015-03-16T09:19:42
32,313,491
0
0
null
null
null
null
UTF-8
Java
false
false
11,092
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GraphADType.Utilities; import GraphADT_2nd_try.ADTConverter; import GraphADT_2nd_try.Boruvka2; import GraphADT_2nd_try.Kruskal2; import GraphADT_2nd_try.Prim2; import GraphADT_2nd_try.Prim2VisitedArray; import GraphADT_2nd_try.UndirectedColoredGraph; import GraphADT_2nd_try.UndirectedGraph; import GraphADType.Algorithms.BoruvkaADT; import GraphADType.Algorithms.BoruvkaADT2; import GraphADType.Algorithms.KruskalADT_UF; import GraphADType.Algorithms.PrimADT; import GraphADType.GraphADT; import GraphADType.GraphArraySucc; import GraphADType.GraphMapAdj; import GraphADType.GraphMapSucc; import GraphADType.GraphMatrix; import GraphADType.Support.Constants; import GraphIO.GraphInput; import JGraphTest.BoruvkaJgraph; import JGraphTest.JGraphConverter; import JGraphTest.KruskalJgraph; import JGraphTest.PrimJgraph; import JungTest.BoruvkaJung; import GraphADT_2nd_try.EdgeJ; import JungTest.JungConverter; import JungTest.KruskalJung; import JungTest.PrimJung; import edu.uci.ics.jung.graph.UndirectedSparseGraph; import org.jgrapht.graph.WeightedMultigraph; /** * * @author nuno */ public class RunBenchmark { public static GraphADT alloc(String type, int size) { // System.out.println(type); if (type.equals("mapadj")) { return new GraphMapAdj<String, Integer>(size); } if (type.equals("mapsucc")) { return new GraphMapSucc<String, Integer>(size); } if (type.equals("arraysucc")) { return new GraphArraySucc<String, Integer>(size); } if (type.equals("matrix")) { return new GraphMatrix<String, Integer>(size); } return null; } public static long runAlgorithm(GraphADT g, String alg) { if (alg.equals("boruvka")) { BoruvkaADT b = new BoruvkaADT(g); long begin = System.currentTimeMillis(); GraphADT mst = b.getMst(); long end = System.currentTimeMillis(); // System.out.println("boruvka time:\t" + (end - begin)); int total = 0; System.out.print("mstW:" + mst.getMstWeight(Constants.intArith, total) + "\t"); return (end - begin); } else if (alg.equals("boruvka2")) { BoruvkaADT2 b = new BoruvkaADT2(); long begin = System.currentTimeMillis(); GraphADT mst = b.getMst(g); long end = System.currentTimeMillis(); // System.out.println("boruvka time:\t" + (end - begin)); int total = 0; System.out.print("mstW:" + mst.getMstWeight(Constants.intArith, total) + "\t"); return (end - begin); } else if (alg.equals("kruskal")) { KruskalADT_UF b = new KruskalADT_UF(); long begin = System.currentTimeMillis(); GraphADT mst = b.getMst(g); long end = System.currentTimeMillis(); // System.out.println("boruvka time:\t" + (end - begin)); int total = 0; System.out.print("mstW:" + mst.getMstWeight(Constants.intArith, total) + "\t"); return (end - begin); } else if (alg.equals("prim")) { PrimADT b = new PrimADT(); long begin = System.currentTimeMillis(); GraphADT mst = b.getMst(g); long end = System.currentTimeMillis(); // System.out.println("prim time:\t" + (end - begin)); int total = 0; System.out.print("mstW:" + mst.getMstWeight(Constants.intArith, total) + "\t"); return (end - begin); } return -1; } public static long runLibraries(String lib, String alg, GraphADT adt) { if (lib.equals("jung")) { JungConverter jconv = new JungConverter(); UndirectedSparseGraph<String, EdgeJ<Integer>> g = new UndirectedSparseGraph<String, EdgeJ<Integer>>(); g = jconv.ADTtoJung(adt); if (alg.equals("boruvka")) { BoruvkaJung bor = new BoruvkaJung(); long begin = System.currentTimeMillis(); UndirectedSparseGraph<String, EdgeJ<Integer>> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } if (alg.equals("kruskal")) { KruskalJung bor = new KruskalJung(); long begin = System.currentTimeMillis(); UndirectedSparseGraph<String, EdgeJ<Integer>> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } if (alg.equals("prim")) { PrimJung bor = new PrimJung(); long begin = System.currentTimeMillis(); UndirectedSparseGraph<String, EdgeJ<Integer>> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } } if (lib.equals("jgraph")) { JGraphConverter jconv = new JGraphConverter(); WeightedMultigraph<String, Integer> g = jconv.ADTtoJGraph(adt); if (alg.equals("boruvka")) { BoruvkaJgraph bor = new BoruvkaJgraph(); long begin = System.currentTimeMillis(); WeightedMultigraph<String, Integer> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } if (alg.equals("kruskal")) { KruskalJgraph bor = new KruskalJgraph(); long begin = System.currentTimeMillis(); WeightedMultigraph<String, Integer> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } if (alg.equals("prim")) { PrimJgraph bor = new PrimJgraph(); long begin = System.currentTimeMillis(); WeightedMultigraph<String, Integer> mst = bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.intArith) + "\t"); return (end - begin); } } if (lib.equals("myNewLib")) { ADTConverter jconv = new ADTConverter(); UndirectedGraph<String, EdgeJ<Integer>> graph = jconv.ADT2New(adt); //***this conversion should be more versatile UndirectedColoredGraph<String,EdgeJ<Integer>> g = new UndirectedColoredGraph<String, EdgeJ<Integer>>(graph); if (alg.equals("prim")) { Prim2 prim = new Prim2(); long begin = System.currentTimeMillis(); UndirectedGraph<String, EdgeJ<Integer>> mst = (UndirectedGraph<String, EdgeJ<Integer>>) prim.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + prim.getMstWeight(mst, Constants.myNewLibArith) + "\t"); return (end - begin); } if (alg.equals("prim_visited")) { Prim2VisitedArray bor = new Prim2VisitedArray(); long begin = System.currentTimeMillis(); UndirectedGraph<String, EdgeJ<Integer>> mst = (UndirectedGraph<String, EdgeJ<Integer>>) bor.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + bor.getMstWeight(mst, Constants.myNewLibArith) + "\t"); return (end - begin); } if (alg.equals("kruskal")) { Kruskal2 kruskal = new Kruskal2(); long begin = System.currentTimeMillis(); UndirectedGraph<String, EdgeJ<Integer>> mst = (UndirectedGraph<String, EdgeJ<Integer>>) kruskal.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + kruskal.getMstWeight(mst, Constants.myNewLibArith) + "\t"); return (end - begin); } if (alg.equals("boruvka")) { Boruvka2 boruvka = new Boruvka2(); long begin = System.currentTimeMillis(); UndirectedGraph<String, EdgeJ<Integer>> mst = (UndirectedGraph<String, EdgeJ<Integer>>) boruvka.getMst(g); long end = System.currentTimeMillis(); System.out.print("\tmstW: " + boruvka.getMstWeight(mst, Constants.myNewLibArith) + "\t"); return (end - begin); } } return -1; } // le e converte o grafo para o tipo determinado public static GraphADT readGraph(String filename, String type) { // System.out.println(filename); GraphInput gin = new GraphInput(filename); GraphADT gg = gin.readGraphADT(); if (type.equals("mapsucc")) { return ((GraphMapAdj) gg).toGraphMapSucc(); } if (type.equals("arraysucc")) { return ((GraphMapAdj) gg).toGraphArraySucc(); } if (type.equals("matrix")) { return ((GraphMapAdj) gg).toGraphMatrix(); } return gg; } public static String getOnlyNumerics(String str) { if (str == null) { return null; } StringBuilder strBuff = new StringBuilder(); char c; for (int i = 0; i < str.length(); i++) { c = str.charAt(i); if (Character.isDigit(c)) { strBuff.append(c); } } return strBuff.toString(); } public static void main(String[] args) { /* * bench_graphADT_50.ser mapadj boruvka * args[0] -> graph to read and execute * args[1] -> graph implementation to use * args[2] -> algorithm to run */ // need to get size according to the file name to allocate N nodes in the // 'arraysucc' implementation int size = Integer.parseInt(getOnlyNumerics(args[0])); GraphADT g = RunBenchmark.alloc(args[1], size); g = RunBenchmark.readGraph(args[0], args[1]); System.out.print(args[1] + "\t" + args[2] + "\t"); System.out.print(g.order() + "\t"); System.out.print(g.size() + "\t"); if (args[1].equals("jung") || args[1].equals("jgraph") || args[1].equals("myNewLib")) { System.out.println(runLibraries(args[1], args[2], g)); } else { System.out.println(RunBenchmark.runAlgorithm(g, args[2])); } } }
[ "nunofaria11@99c9b96b-6dd2-4da9-bfb5-3db95630f279" ]
nunofaria11@99c9b96b-6dd2-4da9-bfb5-3db95630f279
fd6a9b5153e82c6773f98f360c4234a1e2a166b1
468e4c56b662cc2ffc6e8d4a81eebf992605bcb6
/PurchaseRequisition/src/com/te/purreq/security/NTLMLocalWrapperFilter.java
cbd0d356d6803218853e700c5dc27808f20708d2
[]
no_license
hiteshmanand/hiteshte
a3197d3f4afe35692291fabce352e2a3a1aecda1
d43e97a4a9ec6220fd61dcc53cbbc7fd61922349
refs/heads/master
2021-01-22T22:57:13.239687
2014-06-23T19:47:28
2014-06-23T19:47:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package com.te.purreq.security; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import com.te.purreq.util.CPRWebProperties; public class NTLMLocalWrapperFilter implements Filter { // private static final Logger logger = Logger.getLogger(NTLMLocalWrapperFilter.class); private FilterConfig fc; public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // logger.debug("NTLMLocalWrapperFilter: doFilter called"); System.out.println("Filtering"); if (CPRWebProperties.getCentrifyDisabledLocally()) { String defaultUser = CPRWebProperties.getCentrifyOverrideUserID(); System.out.println("defaultUser --> " + defaultUser); // logger.debug("NTLMLocalWrapperFilter: Bypassing Centrify Athentication, using user " + defaultUser); chain.doFilter(new NtlmOverrideHttpServletRequest((HttpServletRequest)request, defaultUser), response); } else{ chain.doFilter(request,response); } /*if (false){//(CPRWebProperties.getCentrifyDisabledLocally()) { String defaultUser = "TE158053"; //CPRWebProperties.getCentrifyOverrideUserID(); // logger.debug("NTLMLocalWrapperFilter: Bypassing Centrify Athentication, using user " + defaultUser); chain.doFilter(new NtlmOverrideHttpServletRequest((HttpServletRequest)request, defaultUser), response); } else{ chain.doFilter(request,response); }*/ } public void init(FilterConfig filterConfig) throws ServletException { // logger.debug("NTLMLocalWrapperFilter: init called"); this.fc = filterConfig; } public void destroy() { // logger.debug("NTLMLocalWrapperFilter: destroy called"); if (this.fc != null) { this.fc = null; } } private class NtlmOverrideHttpServletRequest extends HttpServletRequestWrapper { private String user; public NtlmOverrideHttpServletRequest(HttpServletRequest request, String user) { super(request); this.user = user; } public String getRemoteUser() { return user; } } }
[ "hiteshm.anand@yahoo.com" ]
hiteshm.anand@yahoo.com
eddeba422375cf5edb3e597e783eddfdfb3c6a73
8755a02cd6fc41c0b64fb6fca9403e4b2dbbf06e
/app/src/main/java/main/dailynovel/Fragments/SortItemFragment.java
ff8a021cd844e8bc839a0ea27f6ebb5127649786
[]
no_license
QiQi14/DailyNovel
cb883c2a48418e975b72ce4522839619245be33d
e70ea7a8dc8613d72b8605b37af6d3dc951dee45
refs/heads/master
2021-08-23T07:32:08.676100
2017-12-04T04:37:53
2017-12-04T04:37:53
110,980,983
0
1
null
2017-11-22T02:09:39
2017-11-16T14:25:20
Java
UTF-8
Java
false
false
3,622
java
package main.dailynovel.Fragments; import android.app.Activity; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.os.SystemClock; import android.support.v4.app.Fragment; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; import main.dailynovel.ItemClickListener; import main.dailynovel.NovelActivity; import main.dailynovel.Objects.Crawler; import main.dailynovel.Objects.Novel; import main.dailynovel.R; /** * A simple {@link Fragment} subclass. */ public class SortItemFragment extends Fragment { RecyclerView rvSort; NovelAdapterHorizontal adapterHorizontal; int Genre; public SortItemFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_sort_item, container, false); if (getArguments() != null) { Genre = getArguments().getInt("genre"); } Preload novelTask = new Preload(view, this.getActivity()); novelTask.execute(); return view; } class Preload extends AsyncTask<String, Integer, List<String>> { View view; Activity activity; List<Novel> novels = new ArrayList<>(); public Preload(View view, Activity activity) { this.activity = activity; this.view = view; rvSort = (RecyclerView) view.findViewById(R.id.rvSort); GridLayoutManager grid3column = new GridLayoutManager(getActivity(), 3, GridLayoutManager.VERTICAL, false); rvSort.setLayoutManager(grid3column); rvSort.setItemAnimator(new DefaultItemAnimator()); try { adapterHorizontal = new NovelAdapterHorizontal(getActivity(), novels, new ItemClickListener() { @Override public void onItemClick(View v, int position) { Intent intent = new Intent(getActivity(), NovelActivity.class); intent.putExtra("Object", novels.get(position)); startActivity(intent); } }); } catch (Exception e) { e.printStackTrace(); } rvSort.setAdapter(adapterHorizontal); } @Override protected void onPreExecute() { super.onPreExecute(); novels.clear(); } @Override protected void onPostExecute(List<String> strings) { super.onPostExecute(strings); } @Override protected void onProgressUpdate(Integer... values) { super.onProgressUpdate(values); int i = values[0]; if(i%3==0) { adapterHorizontal.notifyDataSetChanged(); } } @Override protected List<String> doInBackground(String... strings) { for (int i = 0; i < 18; i++) { SystemClock.sleep(50); try { novels.add(Crawler.getNovelList(1, Genre, i)); } catch (Exception e) { e.printStackTrace(); } publishProgress(i); } return null; } } }
[ "giaky" ]
giaky
fbb1723b353146e4f2748151def6ee54fb263119
aae029772d030412fe9672d8bd7893171e867160
/config-server/src/main/java/com/example/ecom/config/ConfigApp.java
40291c581ef6377801996c6bb45872786c9b87a3
[]
no_license
senapatirupen/ecom-app
b67ac5d87b3d421147f5987c0dcdcb2de9f03537
4783e0aafbe02017d4d93107ff834a0636634df4
refs/heads/master
2023-06-29T08:51:37.773820
2021-07-25T15:48:15
2021-07-25T15:48:15
385,585,010
0
0
null
null
null
null
UTF-8
Java
false
false
1,219
java
package com.example.ecom.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.cloud.config.server.EnableConfigServer; import org.springframework.context.event.EventListener; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; /** * @author Rupen Senapati */ @SpringBootApplication @EnableConfigServer public class ConfigApp { @Autowired JdbcTemplate jdbcTemplate; /** * @param args */ public static void main(String[] args) { SpringApplication.run(ConfigApp.class, args); } @EventListener(ApplicationReadyEvent.class) public void insertDataAfterStartup() { Resource resource = new ClassPathResource("data-config.sql"); ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator(resource); databasePopulator.execute(jdbcTemplate.getDataSource()); } }
[ "senapatirupen1986@gmail.com" ]
senapatirupen1986@gmail.com
bd402465c9326eca08aff46b1fd95d1ccff396e3
4b2f9ffa20cefc1a0d7168d8e799d03a0f7f8161
/src/test/java/learn/springframework/springapp/SpringappApplicationTests.java
0da843e445dbccddb7d342d02c68d821c1dd1b26
[]
no_license
CyNEXX/springapp
89ce4c518abc7f6f7a26cc329ddfe9ab58a64e6c
a754a0c8916166334bbdcdf0c800f2843f2deb83
refs/heads/master
2021-01-09T15:15:21.901963
2020-02-22T14:05:22
2020-02-22T14:05:22
242,351,884
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
package learn.springframework.springapp; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SpringappApplicationTests { @Test void contextLoads() { } }
[ "cynexx@gmail.com" ]
cynexx@gmail.com
8b0ac76ea48f0ae3db55ea8afa3d168a173767f3
98a786e299d2469e11116deccc063c14cf87cfeb
/sources/server/falasehhrio-server/src/main/java/br/com/falasehhrio/server/model/api/ModelDBView.java
996329c41f70ae5986b874663968d3dba3d5d80a
[]
no_license
andreluizoliver/pesquisa-pibic-univali-mobile
24e47c6b336692cbdd5f49d2162956c2c84d8b64
20612dd0b643be36e3429a94fed1381b1d495adb
refs/heads/master
2021-05-08T19:10:59.492281
2018-01-30T17:22:50
2018-01-30T17:22:50
119,555,383
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package br.com.falasehhrio.server.model.api; import java.sql.ResultSet; import java.util.List; public interface ModelDBView<M> extends ModelDBGenericView{ M get(Object id) throws ModelException; void save(M m) throws ModelException; List<M> list() throws ModelException; void delete(Object id) throws ModelException; boolean exist(M m) throws ModelException; M prepare(ResultSet resultSet) throws ModelException; List<M> prepareAll(ResultSet resultSet) throws ModelException; }
[ "andre.oliveira@intelbras.com.br" ]
andre.oliveira@intelbras.com.br
8b420935884a3ec1c75eed83c4dc5890302eab9b
7fce9d9992cb57c8f0761ac0bee1005e141be021
/lib_src/src/com/sap/spe/freegoods/transactiondata/userexit/IFreeQuantityCalculationFormula.java
2de1a3e562d43109bc9664832ab4cf3602ebeaf3
[]
no_license
mjj55409/cintas-pricing
3e10cb68101858f56a1c1b2f40577a0ee5b3e0e0
037513a983f86cfd98a0abbe04fb448a2d1c7bea
refs/heads/master
2020-04-02T03:28:54.953342
2016-06-27T19:18:34
2016-06-27T19:18:34
60,651,882
0
0
null
null
null
null
UTF-8
Java
false
false
1,334
java
/* Copyright (c) 2005 by SAP AG All rights to both implementation and design are reserved. Use and copying of this software and preparation of derivative works based upon this software are not permitted. Distribution of this software is restricted. SAP does not make any warranty about the software, its performance or its conformity to any specification. */ package com.sap.spe.freegoods.transactiondata.userexit; import java.math.BigDecimal; import com.sap.spe.condmgnt.customizing.userexit.IFormula; /** * @author d028100 * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public interface IFreeQuantityCalculationFormula extends IFormula { public final static String TYPE_NAME = "FQC"; /** * Calculates the quantity to be given for free. Depending on inclusive or exclusive * it is in base unit of measurement (exclusive) or in sales unit of measurement (inclusive). * Corresponds to KONDN_FRM-NRMENGE (R/3) * @param freeGoodsCondition the free goods condition to be calculated. Corresponds to KONDN_FRM (R/3) * @return the quantity to be given for free */ public BigDecimal calculateFreeQuantity(IFreeGoodsConditionUserExit freeGoodsCondition); }
[ "michael@mertisconsulting.com" ]
michael@mertisconsulting.com
e387f67b12e5e0d9a727a043f50437fa910bb208
adfb906b2520341981f886ac77df1d60cb4d7c31
/src/main/java/com/automation/framework/core/datadriven/utils/CSVFileHelper.java
ae6e6b01659c329ee0680c798407921ca09cfc8c
[]
no_license
hieutran19081994/SourceCodeTesting
dab6c69b9f14c53f826fd561868696f5caa87ddb
351e42675d1c8339cacf9e563dc3a69264ef11ca
refs/heads/master
2023-01-13T15:45:07.053256
2020-11-13T14:05:26
2020-11-13T14:05:26
311,082,314
0
1
null
null
null
null
UTF-8
Java
false
false
1,433
java
package com.automation.framework.core.datadriven.utils; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; public class CSVFileHelper { public static ArrayList<HashMap<String, String>> getDataFromFile(String filePath) throws IOException { ArrayList<HashMap<String, String>> dataList = new ArrayList<>(); Reader in = new FileReader(filePath); CSVParser parser = CSVFormat.RFC4180.parse(in); // read the first line as header Iterable<CSVRecord> records = parser.getRecords(); Iterator itr = records.iterator(); Iterator headerItr = ((CSVRecord) itr.next()).iterator(); List<String> headers = new ArrayList<>(); while(headerItr.hasNext()) { String headerText = (String) headerItr.next(); headers.add(headerText); } while(itr.hasNext()) { CSVRecord record = (CSVRecord) itr.next(); HashMap<String, String> data = new HashMap<>(); for(int i = 0; i < headers.size(); i++) { data.put(headers.get(i), record.get(i)); } dataList.add(data); } return dataList; } }
[ "hieutran19081994@outlook.com" ]
hieutran19081994@outlook.com
a840a1f54ab52dd0799e38d0c9395f544804e56e
6095dd4ada06f8a3f9c37a26e8c00565b46ab571
/unipejet/src/br/com/unipejet/viewresolver/Agendamento.java
016d5eb6ce37fcf7ed8cbcb12a31db474bba1cc0
[]
no_license
EvertonBt/unipejet
df3741169e0a52aba1f9a43066a9c5f23488a687
18c043324377c62ace63c3d502a2374f751b9d08
refs/heads/master
2021-01-11T12:08:02.732001
2017-01-19T17:42:47
2017-01-19T17:42:47
79,478,396
0
0
null
null
null
null
UTF-8
Java
false
false
1,199
java
package br.com.unipejet.viewresolver; import javax.transaction.Transactional; import org.quartz.CronScheduleBuilder; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerFactory; import org.quartz.Trigger; import org.quartz.TriggerBuilder; import org.quartz.impl.StdSchedulerFactory; import org.springframework.stereotype.Component; @Transactional @Component public class Agendamento { public static void main(String[] args) { try { SchedulerFactory schedFact = new StdSchedulerFactory(); Scheduler sched = schedFact.getScheduler(); sched.start(); JobDetail job = JobBuilder.newJob(MyJob.class) .withIdentity("myJob", "group1") .build(); Trigger trigger = TriggerBuilder .newTrigger() .withIdentity("myTrigger", "group1") .withSchedule(CronScheduleBuilder.cronSchedule("0/10 * * * * ?")) .build(); sched.scheduleJob(job, trigger); } catch (Exception e) { System.out.println("erro"); e.printStackTrace(); } } }
[ "evertonidpbjp@outlook.com" ]
evertonidpbjp@outlook.com
8331b95717f70d301484520fab26dffc7db1cfdb
afecf32346d05a584802ad447041e77d19021d83
/src/BT3/QLSV.java
c496a0488f9b51d43f364015c374b6a17e2deaac
[]
no_license
nhoxsieusao2001/PhanTrongNghia_58131349_SteategyPatterm
7ca2d29e521dfdef3fc9b5f6e07dcc6742605caa
9b78516adce32b88705b8dab400fe100c3697ee0
refs/heads/master
2022-04-20T15:42:43.107099
2020-04-23T03:17:56
2020-04-23T03:17:56
257,933,417
0
0
null
null
null
null
UTF-8
Java
false
false
928
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package BT3; /** * * @author Admin */ import java.util.ArrayList; import java.util.Collections; public class QLSV { ISoSanh soSanh; ArrayList<SinhVien> dS = new ArrayList<>(); public void setSoSanh(ISoSanh soSanh) { this.soSanh = soSanh; } public void them(SinhVien sv){ dS.add(sv); } public void sapXep(){ for(int i = 0; i< dS.size(); i++) for(int j = i + 1; j< dS.size(); j++){ if(soSanh.soSanh(dS.get(i), dS.get(j)) > 0){ Collections.swap(dS, i, j); } } } public void inDS(){ for(int i = 0; i < dS.size(); i++){ dS.get(i).hienthiTT(); } } }
[ "ptnghia051098@gmail.com" ]
ptnghia051098@gmail.com
92fbd97d10ed6dd488b7b0c0548c44e8d8f30a96
08cbb98cde3709305e362b1ed7f6c9695bd59dd0
/src/com/bonch/cvcreator/JobExperience.java
57659b28708e5a390fae85f6858624dc2cc088f0
[]
no_license
Bonch90/CVCreator
316d2becee420aac867da2086ef05795c9c2e94f
c26e45a9445be348bed45af5383b44ed66d7c22c
refs/heads/master
2016-09-05T10:57:49.691426
2013-05-22T12:05:34
2013-05-22T12:05:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,448
java
package com.bonch.cvcreator; import java.util.Comparator; import android.app.Activity; import android.app.DialogFragment; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; public class JobExperience extends Activity { private Job job; private boolean editable=false; private int position; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_job_experience); if(savedInstanceState!=null) onRestoreInstanceState(savedInstanceState); Intent i=getIntent(); editable=i.getBooleanExtra("editable", false); if(editable){ position=i.getIntExtra("position", -1); job=JobExperiences.adapter.getItem(position); ((Button) findViewById(R.id.startDate)).setText(job.startDate); ((Button) findViewById(R.id.endDate)).setText(job.endDate); ((EditText) findViewById(R.id.nJob)).setText(job.nome); ((EditText) findViewById(R.id.tJob)).setText(job.tipo); ((EditText) findViewById(R.id.impiego)).setText(job.impiego); ((EditText) findViewById(R.id.mansione)).setText(job.mansione); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.job_experience, menu); return true; } public void showStartDatePickerDialog(View view){ DialogFragment newFragment = new DatePickerFragment(view.getId()); newFragment.show(getFragmentManager(), "datePicker"); } public void showEndDatePickerDialog(View view){ DialogFragment newFragment = new DatePickerFragment(view.getId()); newFragment.show(getFragmentManager(), "datePicker"); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.salva: confirm(); return true; } return super.onOptionsItemSelected(item); } public void confirm(){ if(!editable) job=new Job(); else JobExperiences.adapter.remove(job); Intent resultIntent=new Intent(); job.startDate=((Button) findViewById(R.id.startDate)).getText().toString(); job.endDate=((Button) findViewById(R.id.endDate)).getText().toString(); job.nome=((EditText) findViewById(R.id.nJob)).getText().toString(); job.tipo=((EditText) findViewById(R.id.tJob)).getText().toString(); job.impiego=((EditText) findViewById(R.id.impiego)).getText().toString(); job.mansione=((EditText) findViewById(R.id.mansione)).getText().toString(); JobExperiences.adapter.add(job); JobExperiences.adapter.sort(new Comparator<Job>() { public int compare(Job lhs, Job rhs) { return lhs.compareTo(rhs); } }); setResult(Activity.RESULT_OK, resultIntent); finish(); } @Override public void onSaveInstanceState(Bundle outState){ super.onSaveInstanceState(outState); outState.putString("startDate",((Button)findViewById(R.id.startDate)).getText().toString()); outState.putString("endDate",((Button)findViewById(R.id.endDate)).getText().toString()); } @Override public void onRestoreInstanceState(Bundle outState){ super.onRestoreInstanceState(outState); ((Button)findViewById(R.id.startDate)).setText(outState.getString("startDate")); ((Button)findViewById(R.id.endDate)).setText(outState.getString("endDate")); } }
[ "bonch90@gmail.com" ]
bonch90@gmail.com
db87ece248334d87d2d47510a71a2afc15c7bddc
124b59c98b49f4f38c9bd82c739e08228e0a8773
/app/src/main/java/com/killthed/framework/Music.java
d116521a101f02a4b32c0fbc5068753304e278e3
[]
no_license
umaito/KillTheDAndroid
f75c24aee917b413ee1e79c4140e09350cb707d3
817509f78ea855d650d5561ce1ce8f33c350f871
refs/heads/master
2021-01-10T02:01:52.636574
2015-06-15T01:44:01
2015-06-15T01:44:01
36,672,051
0
0
null
null
null
null
UTF-8
Java
false
false
416
java
package com.killthed.framework; /** * Created by Dylan on 22/05/2015. */ public interface Music { public void play(); public void stop(); public void pause(); public void setLooping(boolean looping); public void setVolume(float volume); public boolean isPlaying(); public boolean isStopped(); public boolean isLooping(); public void dispose(); void seekBegin(); }
[ "ddp_1991@hotmail.com" ]
ddp_1991@hotmail.com
8fb6c13d4c6cdbdbc0c55a9bc946b47c7ac0310e
c681667c446b67f8ac0960133a50137126d08e9f
/archives/chat/UDPClient.java
49fd7d020a5a9d8868837d3af9dc9dc3e6e95975
[]
no_license
andr6/Pentest-Cheatsheets
68f944d9376054e54c89bcbf1bf5a37335e6e967
f18aea8fe5c52cc143ff2a5308b17472b41f599f
refs/heads/master
2020-03-30T14:14:07.985408
2018-09-27T02:51:43
2018-09-27T02:51:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,288
java
package javaapplication1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.util.logging.Level; import java.util.logging.Logger; public class UDPClient implements Runnable { private final LorenzButterEuler lorenz = new LorenzButterEuler(-10.0, -10.0, -10.0, -10.0, 0.0001, 500000); private final String host; public UDPClient(String host) { this.host = host; } @Override public void run() { try { BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in)); DatagramSocket clientSocket = new DatagramSocket(); InetAddress IPAddress = InetAddress.getByName(host); while (true) { byte[] input = inFromUser.readLine().getBytes(); byte[] cipherText = lorenz.update(input, input.length); DatagramPacket sendPacket = new DatagramPacket(cipherText, cipherText.length, IPAddress, 1337); clientSocket.send(sendPacket); } } catch (IOException ex) { Logger.getLogger(UDPClient.class.getName()).log(Level.SEVERE, null, ex); } } }
[ "toufik.airane@gmail.com" ]
toufik.airane@gmail.com
d4fb1c7031edfd27acfaa2812fd45d090f2f2ebe
878a2f4f4c425ed22bf5452adb5c3705fafb258b
/Aula04/src/exercicio4/Funcionario.java
0f8c47469f068355757c9d2fb3ac5a838b20b163
[]
no_license
AndrePS2021/Serratec-Programacao-Orientada-Objeto
4a620fc2ac2be4239da7f9dd52dda56c20d019d8
fb88613ff17ba3750bf18d4e09d344842e0b62de
refs/heads/main
2023-08-22T13:40:35.373533
2021-10-13T12:29:33
2021-10-13T12:29:33
415,423,279
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package exercicio4; public class Funcionario { protected String nome; protected String cpf; protected double salario; protected String turno; public Funcionario(String nome, double salario) { this.nome = nome; this.salario = salario; } public String toString() { return String.format("Funcionario - nome: %s, salario: %.2f", this.nome, this.salario); } public void bonificarComParticipacao() { this.salario += this.salario * 0.01; } }
[ "noreply@github.com" ]
noreply@github.com
866f4ed451407f6cad3f7482a8223a9805dbceb5
79e576b531e8069bd648ad18d7f9e8c5d98bb10b
/app/src/main/java/com/aglhz/yicommunity/main/parking/contract/CarportContract.java
41e3dd1b4be50d4ab905579f55c5ebb558ee05e1
[]
no_license
ackj/YiCommunityAndS1
c53cab4df9b67d89f2a875ddf303f5daec2ce790
93701523782c18896c552fc6c235c834a5903f9c
refs/heads/master
2021-09-08T10:47:13.786769
2018-03-09T09:24:21
2018-03-09T09:24:21
105,245,194
0
0
null
2018-02-28T12:06:14
2017-09-29T07:51:38
Java
UTF-8
Java
false
false
736
java
package com.aglhz.yicommunity.main.parking.contract; import cn.itsite.abase.mvp.contract.base.BaseContract; import com.aglhz.yicommunity.common.Params; import com.aglhz.yicommunity.entity.bean.CarportBeam; import rx.Observable; /** * @author leguang * @version v0.0.0 * @E-mail langmanleguang@qq.com * @time 2017/11/2 0002 17:39 * 车位模块接口。 */ public interface CarportContract { interface View extends BaseContract.View { void responseCarports(CarportBeam data); } interface Presenter extends BaseContract.Presenter { void requestCarports(Params params); } interface Model extends BaseContract.Model { Observable<CarportBeam> requestCarports(Params params); } }
[ "langmanleguang@qq.com" ]
langmanleguang@qq.com
56a884e97a8e0f582dbaa6e69c7ce4e789c292ab
488f41de2b5fce4081c87feb547ef853ea69a5f6
/materials/2018-2019/homeworks/03-TUESky/src/org/elsys/tuesky/api/TUESkyException.java
f06b3abd2c1587952076cca97f07769a182bdd94
[]
no_license
elsys/oop
5c17e8f2c72aba775f4d895499782b6cad5816d1
a5be4adb767cdde7d9f904024880382509f53498
refs/heads/master
2023-06-14T06:21:30.570095
2023-06-05T19:04:14
2023-06-05T19:04:14
211,560,844
11
32
null
2023-02-22T09:24:13
2019-09-28T20:57:51
PostScript
UTF-8
Java
false
false
89
java
package org.elsys.tuesky.api; public class TUESkyException extends RuntimeException { }
[ "mario.ben@mail.bg" ]
mario.ben@mail.bg
35e9b84bdd7f38f2caffb01f5d579de2087c2f8d
d1d35c4b845938e783b895adb9f4c81fd38a4a92
/src/main/java/com/sk/socket/WebSocketConfig.java
1a098083955fdeaf71054a23e242412995f08e29
[]
no_license
suokai-xu/sk-redis
f6c38ef0075378bb8d08a552f3a655b598cba041
9025be61d73cf98de484afb0668921d5c4527ea6
refs/heads/master
2020-05-18T22:35:58.801146
2019-05-03T03:53:07
2019-05-03T03:53:07
184,694,811
0
0
null
null
null
null
UTF-8
Java
false
false
473
java
package com.sk.socket; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.server.standard.ServerEndpointExporter; /** * 2019年3月26日 下午3:08:43 * @HXing xu * sk-redis * **/ @Configuration public class WebSocketConfig { @Bean public ServerEndpointExporter serverEndpointExporter() { return new ServerEndpointExporter(); } }
[ "xuhengxing@hongbo.net.cn" ]
xuhengxing@hongbo.net.cn
9ac49225bdaa03d596c480a0c43a54ee17b36888
5bb4a4b0364ec05ffb422d8b2e76374e81c8c979
/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnections.java
351fddbe17a6853540aa7ae594a8abf2d08cfd76
[ "MIT", "LicenseRef-scancode-generic-cla", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
FabianMeiswinkel/azure-sdk-for-java
bd14579af2f7bc63e5c27c319e2653db990056f1
41d99a9945a527b6d3cc7e1366e1d9696941dbe3
refs/heads/main
2023-08-04T20:38:27.012783
2020-07-15T21:56:57
2020-07-15T21:56:57
251,590,939
3
1
MIT
2023-09-02T00:50:23
2020-03-31T12:05:12
Java
UTF-8
Java
false
false
3,875
java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.kusto.v2020_06_14; import com.microsoft.azure.arm.collection.SupportsCreating; import rx.Completable; import rx.Observable; import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionsInner; import com.microsoft.azure.arm.model.HasInner; /** * Type representing DataConnections. */ public interface DataConnections extends SupportsCreating<DataConnection.DefinitionStages.Blank>, HasInner<DataConnectionsInner> { /** * Returns a data connection. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @param dataConnectionName The name of the data connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Observable<DataConnection> getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); /** * Returns the list of data connections of the given Kusto database. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Observable<DataConnection> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName); /** * Deletes the data connection with the given name. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @param dataConnectionName The name of the data connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); /** * Checks that the data connection parameters are valid. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Observable<DataConnectionValidationListResult> dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters); /** * Checks that the data connection name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. * @param databaseName The name of the database in the Kusto cluster. * @param name Data Connection name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ Observable<CheckNameResult> checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name); }
[ "noreply@github.com" ]
noreply@github.com
9b4b9e5f2d42ce876780d1a24b029f9e025e1fce
fe06f97c2cf33a8b4acb7cb324b79a6cb6bb9dac
/java/po/EHU_EVERTER/IT5117mPo.java
2e00564e8dc762af8ed0a89f90d4a431c1ef6a26
[]
no_license
HeimlichLin/TableSchema
3f67dae0b5b169ee3a1b34837ea9a2d34265f175
64b66a2968c3a169b75d70d9e5cf75fa3bb65354
refs/heads/master
2023-02-11T09:42:47.210289
2023-02-01T02:58:44
2023-02-01T02:58:44
196,526,843
0
0
null
2022-06-29T18:53:55
2019-07-12T07:03:58
Java
UTF-8
Java
false
false
936
java
package com.doc.common.po; public interface IT5117mPo { String getControlno(); void setControlno(final String controlno); String getGcodate(); void setGcodate(final String gcodate); String getWarehouseno(); void setWarehouseno(final String warehouseno); String getSenderid(); void setSenderid(final String senderid); String getSenderqualifier(); void setSenderqualifier(final String senderqualifier); String getReceiverid(); void setReceiverid(final String receiverid); String getReceiverqualifier(); void setReceiverqualifier(final String receiverqualifier); String getDecltype(); void setDecltype(final String decltype); String getIe(); void setIe(final String ie); String getTtype(); void setTtype(final String ttype); String getBriefnote(); void setBriefnote(final String briefnote); String getSendstatus(); void setSendstatus(final String sendstatus); }
[ "jerry.l@acer.com" ]
jerry.l@acer.com
bce2fe10ad4c5c065b525298959a076675e96952
bd2f8b41d446aee03f090e26e5c643d10313900e
/src/com/leetcode/S_0160_IntersectionOfTwoLinkedLists.java
0d5cb44be90caf274753193078d0c3da89ed76cd
[]
no_license
natalia-ko/leetcode
bae4430930a0c120c6d8330219b083c2db12213b
7c9a3c04f1fbdd98711e4b824383a2990efca116
refs/heads/master
2023-04-20T10:07:42.837326
2021-05-12T15:19:45
2021-05-12T15:19:45
344,207,815
0
0
null
2021-05-12T15:19:45
2021-03-03T17:27:30
Java
UTF-8
Java
false
false
3,084
java
package com.leetcode; import java.util.HashSet; import java.util.Set; /*Intersection of Two Linked Lists Write a program to find the node at which the intersection of two singly linked lists begins. Example 1: Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skipA = 2, skipB = 3 Output: Reference of the node with value = 8 Input Explanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect). From the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,6,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B. Example 2: Input: intersectVal = 2, listA = [1,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1 Output: Reference of the node with value = 2 Input Explanation: The intersected node's value is 2 (note that this must not be 0 if the two lists intersect). From the head of A, it reads as [1,9,1,2,4]. From the head of B, it reads as [3,2,4]. There are 3 nodes before the intersected node in A; There are 1 node before the intersected node in B. Example 3: Input: intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2 Output: null Input Explanation: From the head of A, it reads as [2,6,4]. From the head of B, it reads as [1,5]. Since the two lists do not intersect, intersectVal must be 0, while skipA and skipB can be arbitrary values. Explanation: The two lists do not intersect, so return null. Notes: If the two linked lists have no intersection at all, return null. The linked lists must retain their original structure after the function returns. You may assume there are no cycles anywhere in the entire linked structure. Each value on each linked list is in the range [1, 10^9]. Your code should preferably run in O(n) time and use only O(1) memory.*/ public class S_0160_IntersectionOfTwoLinkedLists { public static void main(String[] args) { ListNode headA = new ListNode(4); ListNode headA1 = new ListNode(1); headA.next = headA1; ListNode headA2 = new ListNode(8); headA1.next = headA2; ListNode headA3 = new ListNode(4); headA2.next = headA3; headA3.next = new ListNode(5); ListNode headB = new ListNode(5); ListNode headB1 = new ListNode(6); headB.next = headB1; ListNode headB2 = new ListNode(1); headB1.next = headB2; headB2.next = headA2; getIntersectionNode(headA, headB); } static class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; } } public static ListNode getIntersectionNode(ListNode headA, ListNode headB) { Set<ListNode> nodesB = new HashSet<>(); while (headB != null) { nodesB.add(headB); headB = headB.next; } while ((headA != null)) { if (nodesB.contains(headA)) { return headA; } headA = headA.next; } return null; } }
[ "natalia.kozhukhova@ya.ru" ]
natalia.kozhukhova@ya.ru
e93bf27e62397a84e322c3ca188e3d37c9881313
e1358fbac6658caed8bee1dba30f125e64daea12
/src/Clase/ConectaBD.java
6bfdcfeaacdfb6f62a2985405c10319eb4c11b22
[]
no_license
alejogo4/coloresInfantiles
d75f88785a83fd758938ed5f6006e7bc016352b9
46a7ec86d171b843427c440f58f45f22a0818334
refs/heads/master
2021-05-07T19:41:08.743898
2017-11-20T06:25:45
2017-11-20T06:25:45
108,897,205
0
0
null
null
null
null
UTF-8
Java
false
false
624
java
package Clase; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; public class ConectaBD { public Connection getConnection(){ Connection cn = null; try { Class.forName("com.mysql.jdbc.Driver"); cn=DriverManager.getConnection("jdbc:mysql://localhost/coloresinfantiles","colores","admin123"); } catch (SQLException e) { System.out.println("Error: " + e.getMessage()); }catch(Exception e1){ System.out.println("Error: " + e1.getMessage()); } return cn; } }
[ "alejo.go4@hotmail.com" ]
alejo.go4@hotmail.com
11433d4fadd908a168ec162d7eeb075b5faa500f
feee5f89923722da9df8c51bd3931cc8a5623c6d
/demo-bo/src/main/java/com/example/demo/bo/service/SelectBurgerServiceImpl.java
8d9c7422a53a9ba92b819b62ca873e9822bc1002
[]
no_license
shlee0882/springboot-msa-default-setting
274dc71543e82ade3c86a5690a4eafa5095e47f0
f6a4906c1677c3f4b8c067b83d612b2d97db8321
refs/heads/master
2022-07-09T01:34:30.470410
2020-06-05T04:51:08
2020-06-05T04:51:08
183,113,678
0
0
null
2022-06-29T17:19:50
2019-04-24T00:04:12
Java
UTF-8
Java
false
false
1,934
java
package com.example.demo.bo.service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import com.example.demo.bo.common.ApiClientUtil; import com.example.demo.bo.common.ApiPath; import com.example.demo.bo.exception.DemoException; import com.example.demo.bo.model.burger.BurgerVO; import com.example.demo.config.ServiceConfig; import lombok.extern.slf4j.Slf4j; @Slf4j @Service public class SelectBurgerServiceImpl implements SelectBurgerService{ @Autowired private ServiceConfig config; @Autowired private ApiClientUtil apiClientUtil; @Override public String getBurgerInfoList() throws DemoException { log.debug("[SelectBurgerServiceImpl] getBurgerInfoList (PAR)=> {}"); StringBuilder url = new StringBuilder(); url.append(config.getApiDemoServer() + ApiPath.API_SELECTBURGER + "/list"); // url.append("?searchYear={searchYear}"); // url.append("&searchMonth={searchMonth}"); Map<String, Object> info = new HashMap<String, Object>(); // info.put("searchYear", searchYear); // info.put("searchMonth", searchMonth); log.debug("[SelectBurgerServiceImpl] getBurgerInfoList => api url: {} ", url); HttpEntity httpEntity = new HttpEntity(apiClientUtil.getHeaderWithApikey()); ResponseEntity<String> responseEntity = apiClientUtil.getRestTemplate().exchange(url.toString(), HttpMethod.GET, httpEntity, String.class, info); String jsonList = ""; if (responseEntity.getStatusCode() == HttpStatus.OK) { jsonList = responseEntity.getBody(); log.debug("response=> {}", responseEntity.getBody()); return jsonList; }else { return null; } } }
[ "shlee0882@gmail.com" ]
shlee0882@gmail.com
67dab32083ccac0053c391759b7566546fa6f7a3
f586c15b9448b5cd0c58ae7f36652e4906115374
/AKSA Essentials/aksaessentials.ver.1.1.1.build.8_source_from_JADX/aksaessentials.ver.1.1.1.build.8_source_from_JADX/mono/android/webkit/DownloadListenerImplementor.java
0c1f789a194ce52a3c407c0443f41841cb105827
[ "Apache-2.0" ]
permissive
Dan6erbond/SchoolHelper
07c4409ec3abeab66b23e8352b6fb59badbf1ae4
15f428e2f26dc23e61d674b2c5594acd7b0cf488
refs/heads/master
2022-01-05T20:06:12.467199
2019-05-15T06:11:10
2019-05-15T06:11:10
116,488,935
4
2
null
null
null
null
UTF-8
Java
false
false
1,784
java
package mono.android.webkit; import android.webkit.DownloadListener; import java.util.ArrayList; import mono.android.IGCUserPeer; import mono.android.Runtime; import mono.android.TypeManager; public class DownloadListenerImplementor implements IGCUserPeer, DownloadListener { public static final String __md_methods = "n_onDownloadStart:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V:GetOnDownloadStart_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_JHandler:Android.Webkit.IDownloadListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null\n"; private ArrayList refList; private native void n_onDownloadStart(String str, String str2, String str3, String str4, long j); static { Runtime.register("Android.Webkit.IDownloadListenerImplementor, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065", DownloadListenerImplementor.class, __md_methods); } public DownloadListenerImplementor() throws Throwable { if (getClass() == DownloadListenerImplementor.class) { TypeManager.Activate("Android.Webkit.IDownloadListenerImplementor, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065", "", this, new Object[0]); } } public void onDownloadStart(String str, String str2, String str3, String str4, long j) { n_onDownloadStart(str, str2, str3, str4, j); } public void monodroidAddReference(Object obj) { if (this.refList == null) { this.refList = new ArrayList(); } this.refList.add(obj); } public void monodroidClearReferences() { if (this.refList != null) { this.refList.clear(); } } }
[ "32235074+Dan6erbond@users.noreply.github.com" ]
32235074+Dan6erbond@users.noreply.github.com
d69a8f2543b412a538c27739d4926658e0cc101f
a1417794f6968c3574e6ddd58fe5c7eb3feedaab
/HotelManagerSystem/src/io/github/blai44/controller/home/HomeController.java
b4319d1d0747b8fa18e045de9a2d5e4491c4b35b
[]
no_license
blai404/SSMHotel
9e8e651fdf76a5e79b2e90caf411767e47abe516
1e1ac2b9c4785ebe937daf60abf21d3f0e64383f
refs/heads/master
2021-04-20T03:16:50.936440
2020-03-24T08:32:55
2020-03-25T10:00:55
249,651,100
0
0
null
null
null
null
GB18030
Java
false
false
5,762
java
package io.github.blai44.controller.home; import io.github.blai44.entity.Customer; import io.github.blai44.service.CustomerService; import io.github.blai44.service.RoomTypeService; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; /** * 前台首页控制器 * @author blai * */ @RequestMapping("/home") @Controller public class HomeController { @Autowired private RoomTypeService roomTypeService; @Autowired private CustomerService customerService; /** * 前台首页 * @param model * @param name * @return */ @RequestMapping(value="/index",method=RequestMethod.GET) public ModelAndView index(ModelAndView model, @RequestParam(name="name",defaultValue="")String name ){ Map<String, Object> queryMap = new HashMap<String, Object>(); queryMap.put("name", name); queryMap.put("offset", 0); queryMap.put("pageSize", 999); model.addObject("roomTypeList", roomTypeService.findList(queryMap)); model.addObject("kw", name); model.setViewName("home/index/index"); return model; } /** * 前台登录页面 * @param model * @return */ @RequestMapping(value="/login",method=RequestMethod.GET) public ModelAndView login(ModelAndView model){ model.setViewName("home/index/login"); return model; } /** * 登录信息提交 * @param customer * @return */ @RequestMapping(value="/login",method=RequestMethod.POST) @ResponseBody public Map<String, String> loginAct(Customer customer, String vcode, HttpServletRequest request){ Map<String, String> retMap = new HashMap<String, String>(); if(customer == null){ retMap.put("type", "error"); retMap.put("msg", "请填写用户信息"); return retMap; } if(StringUtils.isEmpty(vcode)){ retMap.put("type", "error"); retMap.put("msg", "请填写验证码"); return retMap; } if(StringUtils.isEmpty(customer.getName())){ retMap.put("type", "error"); retMap.put("msg", "请填写用户名"); return retMap; } if(StringUtils.isEmpty(customer.getPassword())){ retMap.put("type", "error"); retMap.put("msg", "请填写密码"); return retMap; } Object loginCpacha = request.getSession().getAttribute("customerLoginCpacha"); if(loginCpacha == null){ retMap.put("type", "error"); retMap.put("msg", "验证码失效"); return retMap; } if(!vcode.equalsIgnoreCase(loginCpacha.toString())){ retMap.put("type", "error"); retMap.put("msg", "验证码错误!"); return retMap; } Customer findByName = customerService.findByName(customer.getName()); if(findByName == null){ retMap.put("type", "error"); retMap.put("msg", "用户名不存在!"); return retMap; } if(!customer.getPassword().equals(findByName.getPassword())){ retMap.put("type", "error"); retMap.put("msg", "密码不正确!"); return retMap; } if(findByName.getStatus() == -1){ retMap.put("type", "error"); retMap.put("msg", "该用户已被禁用,请联系管理员!"); return retMap; } request.getSession().setAttribute("customer", findByName); request.getSession().setAttribute("customerLoginCpacha", null); retMap.put("type", "success"); retMap.put("msg", "登陆成功!"); return retMap; } /** * 前台注销功能 * @param request * @return */ @RequestMapping(value="/logout",method=RequestMethod.GET) public String logout(HttpServletRequest request){ HttpSession session = request.getSession(); session.setAttribute("customer", null); return "redirect:index"; } /** * 前台注册页面 * @param model * @return */ @RequestMapping(value="/reg",method=RequestMethod.GET) public ModelAndView reg(ModelAndView model){ model.setViewName("home/index/reg"); return model; } /** * 注册信息提交 * @param customer * @return */ @RequestMapping(value="/reg",method=RequestMethod.POST) @ResponseBody public Map<String, String> regAct(Customer customer, HttpServletRequest request){ Map<String, String> retMap = new HashMap<String, String>(); if(customer == null){ retMap.put("type", "error"); retMap.put("msg", "请填写用户信息"); return retMap; } if(StringUtils.isEmpty(customer.getPhoneNum())){ retMap.put("type", "error"); retMap.put("msg", "手机号不能为空!"); return retMap; } if(StringUtils.isEmpty(customer.getName())){ retMap.put("type", "error"); retMap.put("msg", "请填写用户名!"); return retMap; } if(StringUtils.isEmpty(customer.getPassword())){ retMap.put("type", "error"); retMap.put("msg", "请填写密码"); return retMap; } if(isExist(customer.getName())){ retMap.put("type", "error"); retMap.put("msg", "该用户名已存在,请重新输入!"); return retMap; } if(customerService.add(customer) <= 0){ retMap.put("type", "error"); retMap.put("msg", "注册失败,请联系管理员!"); return retMap; } retMap.put("type", "success"); retMap.put("msg", "注册成功!"); return retMap; } /** * 判断用户名是否存在 * @param name * @param id * @return */ private boolean isExist(String name){ Customer customer = customerService.findByName(name); if(customer == null)return false; return true; } }
[ "390632458@qq.com" ]
390632458@qq.com
c8f13371599b1e05e48f7fcf5e6642b2da8f9fcf
4d701f7fa2f13861f89fa39893809ded931b9e07
/src/main/java/org/culturegraph/mf/morph/maps/JndiSqlMap.java
1d873e941f2b7dd72a264db43d1460505c7e93a3
[]
no_license
malieva/metafacture-core
be779a944f41eccb8cdd3958810d377d108a2de5
ebe1cd1110dc15e72c1c95fa1ea22d1f70ed0eb2
refs/heads/master
2021-01-16T19:58:35.437963
2013-03-22T14:08:26
2013-03-22T14:08:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,590
java
/* * Copyright 2013 Deutsche Nationalbibliothek * * Licensed under the Apache License, Version 2.0 the "License"; * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.culturegraph.mf.morph.maps; import java.io.Closeable; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; import org.culturegraph.mf.exceptions.MorphException; /** * @author Daniel * */ public final class JndiSqlMap extends AbstractReadOnlyMap<String, String> implements Closeable { private boolean isUninitialized = true; private DataSource datasource; private String query; private Connection connection; private PreparedStatement preparedStatement; public void init() { try { connection = datasource.getConnection(); this.preparedStatement = connection.prepareStatement(query); } catch (SQLException e) { throw new MorphException(e); } isUninitialized = false; } @Override public void close() throws IOException { try { if (connection != null) { connection.close(); } } catch (SQLException e) { throw new MorphException(e); } } protected DataSource getDatasource() { return datasource; } public void setDatasource(final String name) { try { this.datasource = (DataSource) new InitialContext().lookup(name); } catch (NamingException e) { throw new MorphException(e); } } public void setQuery(final String query) { this.query = query; } @Override public String get(final Object key) { if (isUninitialized) { init(); } String resultString = null; final ResultSet resultSet; try { preparedStatement.setString(1, key.toString()); resultSet = preparedStatement.executeQuery(); if (resultSet.first()) { resultString = resultSet.getString(1); } resultSet.close(); } catch (SQLException e) { throw new MorphException(e); } return resultString; } }
[ "c.boehme@dnb.de" ]
c.boehme@dnb.de
ff2531601fc83d2479c7512493568bbe00804c28
da757f009510dfb82b4f154da967411b4bbd0dc5
/src/com/suvorov/Lab2/Shoe.java
edcc2d44c0efedfcdceddea5d70160d8b9f10e05
[]
no_license
Cybervaldemar/javaLabs
5e3c23b0ccff2ab9c0286cf6102da6ce19c22298
7abed3235531af6e3fed6a467eadb3c2d94511c7
refs/heads/master
2020-03-16T18:31:27.270508
2018-05-10T09:14:02
2018-05-10T09:14:02
132,876,869
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
package com.suvorov.Lab2; public class Shoe implements Product { @Override public String whoAmI() { return "I am the Shoe"; } }
[ "cyber@DESKTOP-UEJS8FI.localdomain" ]
cyber@DESKTOP-UEJS8FI.localdomain
1e48b04632e3ab32f0835b2ceeb5111faeee6f7a
ef44d044ff58ebc6c0052962b04b0130025a102b
/com.freevisiontech.fvmobile_source_from_JADX/sources/p008jp/p009co/cyberagent/android/gpuimage/GPUImageCrosshatchFilter.java
354dca837790856998b505f3a8b904a76e078886
[]
no_license
thedemoncat/FVShare
e610bac0f2dc394534ac0ccec86941ff523e2dfd
bd1e52defaec868f0d1f9b4f2039625c8ff3ee4a
refs/heads/master
2023-08-06T04:11:16.403943
2021-09-25T10:11:13
2021-09-25T10:11:13
410,232,121
2
0
null
null
null
null
UTF-8
Java
false
false
3,007
java
package p008jp.p009co.cyberagent.android.gpuimage; import android.opengl.GLES20; /* renamed from: jp.co.cyberagent.android.gpuimage.GPUImageCrosshatchFilter */ public class GPUImageCrosshatchFilter extends GPUImageFilter { public static final String CROSSHATCH_FRAGMENT_SHADER = "varying highp vec2 textureCoordinate;\nuniform sampler2D inputImageTexture;\nuniform highp float crossHatchSpacing;\nuniform highp float lineWidth;\nconst highp vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\nhighp float luminance = dot(texture2D(inputImageTexture, textureCoordinate).rgb, W);\nlowp vec4 colorToDisplay = vec4(1.0, 1.0, 1.0, 1.0);\nif (luminance < 1.00)\n{\nif (mod(textureCoordinate.x + textureCoordinate.y, crossHatchSpacing) <= lineWidth)\n{\ncolorToDisplay = vec4(0.0, 0.0, 0.0, 1.0);\n}\n}\nif (luminance < 0.75)\n{\nif (mod(textureCoordinate.x - textureCoordinate.y, crossHatchSpacing) <= lineWidth)\n{\ncolorToDisplay = vec4(0.0, 0.0, 0.0, 1.0);\n}\n}\nif (luminance < 0.50)\n{\nif (mod(textureCoordinate.x + textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth)\n{\ncolorToDisplay = vec4(0.0, 0.0, 0.0, 1.0);\n}\n}\nif (luminance < 0.3)\n{\nif (mod(textureCoordinate.x - textureCoordinate.y - (crossHatchSpacing / 2.0), crossHatchSpacing) <= lineWidth)\n{\ncolorToDisplay = vec4(0.0, 0.0, 0.0, 1.0);\n}\n}\ngl_FragColor = colorToDisplay;\n}\n"; private float mCrossHatchSpacing; private int mCrossHatchSpacingLocation; private float mLineWidth; private int mLineWidthLocation; public GPUImageCrosshatchFilter() { this(0.03f, 0.003f); } public GPUImageCrosshatchFilter(float crossHatchSpacing, float lineWidth) { super(GPUImageFilter.NO_FILTER_VERTEX_SHADER, CROSSHATCH_FRAGMENT_SHADER); this.mCrossHatchSpacing = crossHatchSpacing; this.mLineWidth = lineWidth; } public void onInit() { super.onInit(); this.mCrossHatchSpacingLocation = GLES20.glGetUniformLocation(getProgram(), "crossHatchSpacing"); this.mLineWidthLocation = GLES20.glGetUniformLocation(getProgram(), "lineWidth"); } public void onInitialized() { super.onInitialized(); setCrossHatchSpacing(this.mCrossHatchSpacing); setLineWidth(this.mLineWidth); } public void setCrossHatchSpacing(float crossHatchSpacing) { float singlePixelSpacing; if (getOutputWidth() != 0) { singlePixelSpacing = 1.0f / ((float) getOutputWidth()); } else { singlePixelSpacing = 4.8828125E-4f; } if (crossHatchSpacing < singlePixelSpacing) { this.mCrossHatchSpacing = singlePixelSpacing; } else { this.mCrossHatchSpacing = crossHatchSpacing; } setFloat(this.mCrossHatchSpacingLocation, this.mCrossHatchSpacing); } public void setLineWidth(float lineWidth) { this.mLineWidth = lineWidth; setFloat(this.mLineWidthLocation, this.mLineWidth); } }
[ "nl.ruslan@yandex.ru" ]
nl.ruslan@yandex.ru
61b4ce4aaab674ab22e2d4fc239b53bc4a31b6ab
4180f974f68c3a44c957a9c3714b308a80fb7697
/nbdemetra-ui/src/test/java/ec/nbdemetra/ui/demo/impl/Grid2Factory.java
8e2d7cbb626bad5f829f46e24ddc2ba9c8fe1cd8
[]
no_license
MFatihTuzen/jdemetra-app
7c3594601a33b032416db78e92a8212822d147b8
d6304de4c65e77e71195e939e5aceba8f1b42830
refs/heads/master
2022-09-04T07:53:55.595427
2015-01-12T09:01:53
2015-01-12T09:01:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,716
java
/* * Copyright 2013 National Bank of Belgium * * Licensed under the EUPL, Version 1.1 or – as soon they will be approved * by the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * * http://ec.europa.eu/idabc/eupl * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. */ package ec.nbdemetra.ui.demo.impl; import com.google.common.collect.ImmutableMap; import ec.nbdemetra.ui.demo.DemoComponentFactory; import ec.tss.tsproviders.utils.DataFormat; import ec.tss.tsproviders.utils.Formatters.Formatter; import ec.tstoolkit.utilities.Id; import ec.tstoolkit.utilities.LinearId; import static ec.util.chart.swing.SwingColorSchemeSupport.withAlpha; import ec.util.grid.swing.AbstractGridModel; import ec.util.grid.swing.GridModel; import ec.util.grid.swing.GridRowHeaderRenderer; import ec.util.grid.swing.JGrid; import java.awt.Color; import java.awt.Component; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Callable; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.table.DefaultTableCellRenderer; import org.openide.util.lookup.ServiceProvider; @ServiceProvider(service = DemoComponentFactory.class) public final class Grid2Factory extends DemoComponentFactory { @Override public Map<Id, Callable<Component>> getComponents() { return builder().put(new LinearId("(2) Other", "JGrid*"), excelGrid()).build(); } private static Callable<Component> excelGrid() { return new Callable<Component>() { @Override public Component call() throws Exception { JGrid result = new JGrid(); result.setModel(new ExcelModel()); result.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); result.setColumnSelectionAllowed(true); result.setDragEnabled(true); result.setDefaultRenderer(Object.class, new ExcelCellRenderer()); result.setRowRenderer(new ExcelRowRenderer()); result.setOddBackground(Color.WHITE); return result; } }; } private static final class ExcelModel extends AbstractGridModel implements GridModel { int rowCount = 300; int colCount = 300; Map<String, Object> data = new HashMap<>(); ExcelModel() { data = ImmutableMap.<String, Object>builder() .put(key(2, 2), "hello") .put(key(2, 4), 123.5) .put(key(5, 4), true) .put(key(4, 3), new Date()) .build(); } static String key(int rowIndex, int columnIndex) { return rowIndex + "x" + columnIndex; } @Override public int getRowCount() { return rowCount; } @Override public String getRowName(int rowIndex) { return Integer.toString(rowIndex + 1); } @Override public int getColumnCount() { return colCount; } @Override public Object getValueAt(int rowIndex, int columnIndex) { return data.get(key(rowIndex, columnIndex)); } } private static final class ExcelCellRenderer extends DefaultTableCellRenderer { final Formatter<Number> numberFormatter = DataFormat.DEFAULT.numberFormatter(); final Formatter<Date> dateFormatter = DataFormat.DEFAULT.dateFormatter(); @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel result = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Number) { result.setText(numberFormatter.formatAsString((Number) value)); result.setHorizontalAlignment(JLabel.TRAILING); } else if (value instanceof Date) { result.setText(dateFormatter.formatAsString((Date) value)); result.setHorizontalAlignment(JLabel.LEADING); } else if (value instanceof CharSequence) { result.setHorizontalAlignment(JLabel.LEADING); } else if (value instanceof Boolean) { result.setText(((Boolean) value) ? "TRUE" : "FALSE"); result.setHorizontalAlignment(JLabel.CENTER); } result.setForeground(table.getForeground()); result.setBackground(withAlpha(result.getBackground(), 100)); return result; } } private static final class ExcelRowRenderer extends GridRowHeaderRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel result = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); result.setHorizontalAlignment(JLabel.CENTER); return result; } } }
[ "philippe.charles@nbb.be" ]
philippe.charles@nbb.be
2c3c8bd396da4cc984152e585ffcbe581f3174ca
a046cc3f348c6fd581a74633886ced8c6276e0f6
/src/main/java/com/hbxy/util/ReflectHelper.java
1cf8b5dfbe1a0c01f55b0e3e0aa90c2b57a0b25d
[]
no_license
Scarboroug/apartment
006d7cdfc623f68df02258c1461247f849f3de6b
1cc666151b63580ee6ee5af84622f9e430382c8f
refs/heads/master
2020-05-02T17:34:56.410955
2019-05-16T14:45:51
2019-05-16T14:45:51
178,103,395
0
0
null
null
null
null
UTF-8
Java
false
false
1,836
java
package com.hbxy.util; import java.lang.reflect.Field; public class ReflectHelper { /** * 获取obj对象fieldName的Field * @param obj * @param fieldName * @return */ public static Field getFieldByFieldName(Object obj, String fieldName) { for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { try { return superClass.getDeclaredField(fieldName); } catch (NoSuchFieldException e) { } } return null; } /** * 获取obj对象fieldName的属性值 * @param obj * @param fieldName * @return * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalArgumentException * @throws IllegalAccessException */ public static Object getValueByFieldName(Object obj, String fieldName) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field field = getFieldByFieldName(obj, fieldName); Object value = null; if (field != null) { if (field.isAccessible()) { value = field.get(obj); } else { field.setAccessible(true); value = field.get(obj); field.setAccessible(false); } } return value; } /** * 设置obj对象fieldName的属性值 * @param obj * @param fieldName * @param value * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalArgumentException * @throws IllegalAccessException */ public static void setValueByFieldName(Object obj, String fieldName, Object value) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field field = obj.getClass().getDeclaredField(fieldName); if (field.isAccessible()) { field.set(obj, value); } else { field.setAccessible(true); field.set(obj, value); field.setAccessible(false); } } }
[ "17659731017@163.com" ]
17659731017@163.com
083a9439aa45678c06476ae1c353955d5c8c01fb
65e8643b58205f92cd56fad16d421115a188a1a3
/com.mymoney/src/mu.java
07feebb764514f4a1fdfc3ae47139fb439c3abb0
[]
no_license
goodev/liudongbaoproject
f2b0b0a22a1fd8c2ab5611ad0279e26b998c4e3d
72e585884d0a6f5765383f20f388303b11a1f0ad
refs/heads/master
2021-01-10T10:47:33.250578
2012-06-03T10:11:51
2012-06-03T10:11:51
50,891,250
0
0
null
null
null
null
UTF-8
Java
false
false
723
java
import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.widget.ScrollView; import com.mymoney.ui.report.ReportActivity; public class mu implements Animation.AnimationListener { public mu(ReportActivity paramReportActivity) { } public void onAnimationEnd(Animation paramAnimation) { } public void onAnimationRepeat(Animation paramAnimation) { } public void onAnimationStart(Animation paramAnimation) { ReportActivity.a(this.a).setVisibility(8); } } /* Location: F:\soft\android\soft\dex2jar-0.0.7.10-SNAPSHOT\classes.dex.dex2jar.jar * Qualified Name: mu * JD-Core Version: 0.6.0 */
[ "liudongbaollz@gmail.com" ]
liudongbaollz@gmail.com
33bb4d9bae83c525e3e2d70025c805b399874a84
6fd7064ecaba12969ce60eae7569d93b9be18b43
/flinkx-executor/src/test/java/com/guoliang/flinkx/executor/test/TestRun.java
6b14d36b340255f088ae56eabe3064d48b7fbe6a
[ "Apache-2.0" ]
permissive
kuyusea/LarkMidTable
a5b7d540c34be91f30bce7e821f6ca9fad694c75
1556c47dcd0fc0727185aaa586c4241d1124cb70
refs/heads/master
2022-12-24T18:45:27.788073
2020-10-11T16:29:50
2020-10-11T16:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
package com.guoliang.flinkx.executor.test; /** * * @Author: LarkMidTable * @Date: 2020/9/16 19:36 * @Description: **/ public class TestRun { }
[ "wxgzgl@gmail.com" ]
wxgzgl@gmail.com
43714ca4080da836a5fc138916cb4f12ac04e9c1
465a0cfef90cc9538315fd5e2254d9615ee93444
/app/src/main/java/com/example/mycrm/fragment/PersonInfoFragment.java
9780afa47a35fc3a89c0fe8823bb64fda70d3219
[]
no_license
dementev-a-m/MyCRMClient
eca432dc3d049eff521022526ce60e66a3e313be
9a0d25ad0f92abdc187ab14e0450ffb6bffe0359
refs/heads/master
2021-01-19T04:11:26.566602
2017-04-06T10:57:24
2017-04-06T10:57:24
87,355,876
0
0
null
null
null
null
UTF-8
Java
false
false
1,040
java
package com.example.mycrm.fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.example.mycrm.R; /** * Created by Антон Дементьев on 03.04.2017. */ public class PersonInfoFragment extends Fragment { private static final int LAYOUT = R.layout.fragment_tab_person_info; private View view; private TextView textView; public static PersonInfoFragment getInstans(){ Bundle args = new Bundle(); PersonInfoFragment personInfoFragment = new PersonInfoFragment(); personInfoFragment.setArguments(args); return personInfoFragment; } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(LAYOUT,container,false); return view; } }
[ "antdementev@gmail.com" ]
antdementev@gmail.com
f9bc239a6590c76fa39e8be4159e233bc7ec4035
b287d8a475cf0912197c500ca5a49d1d0c59d2d5
/app/src/main/java/com/example/newstoday/models/Articles.java
daab2acb2a1dd5b56325929c5ace107c9937cbae
[]
no_license
aashishtathod/NewsTodayApp
4b5efebcbea634dfde0ecfeef17b93fd4e9c444b
72a949dce3da2b55e188ec818548828c9708fdd9
refs/heads/main
2023-09-06T09:53:02.150490
2021-11-07T06:36:47
2021-11-07T06:36:47
425,303,219
0
0
null
null
null
null
UTF-8
Java
false
false
709
java
package com.example.newstoday.models; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; public class Articles { @SerializedName("articles") @Expose private ArrayList<SingleArticle> singleArticleArrayList; public Articles(ArrayList<SingleArticle> singleArticleArrayList) { this.singleArticleArrayList = singleArticleArrayList; } public ArrayList<SingleArticle> getSingleArticleArrayList() { return singleArticleArrayList; } public void setSingleArticleArrayList(ArrayList<SingleArticle> singleArticleArrayList) { this.singleArticleArrayList = singleArticleArrayList; } }
[ "aashishtathod@outlook.com" ]
aashishtathod@outlook.com
fb98515d8a2cce52824c31b58631b07e8840ef7e
5564f65d86fce5d4633655f97a918b13ec4ebb9f
/Springcore/src/main/java/com/springcore/auto/wire/Test.java
c4bca5617a0a4ef9b8371a20faa4415737bba0c7
[]
no_license
saralkumar93/SpringCore
592fbf942b851f01f06d2688d7f1fbb29ce09897
f274ecccbe4f8ea043b58a68df8839387e8cac21
refs/heads/master
2023-02-25T16:54:11.621390
2021-01-31T12:17:10
2021-01-31T12:17:10
334,637,653
0
0
null
null
null
null
UTF-8
Java
false
false
428
java
package com.springcore.auto.wire; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class Test { public static void main(String[] args) { ApplicationContext context=new ClassPathXmlApplicationContext("com/springcore/auto/wire/autoconfig.xml"); Emp emp1=context.getBean("emp1",Emp.class); System.out.println(emp1); } }
[ "saralkalwalwar@gmail.com" ]
saralkalwalwar@gmail.com