blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
711995fca203f586feb60d564cbf27ceeaaec93e
4bcbcc53d93ae02f5dec0c82b86b603dfa0d39dc
/app/src/main/java/com/example/soundtest/Learn/OwajibActivity.java
6965bd682422fd6ba4ed126b7c66c342646c5180
[]
no_license
AFRIDI-2020/The-Way-of-Heaven
fcf7fb88015758d3595fb655863921fedb7d8a90
ecad8ec60da6db1ca84d921616b98e67f29b9704
refs/heads/master
2022-11-10T21:31:10.322018
2020-07-05T10:11:04
2020-07-05T10:11:04
277,255,794
0
0
null
2020-07-05T07:51:37
2020-07-05T07:51:36
null
UTF-8
Java
false
false
381
java
package com.example.soundtest.Learn; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import com.example.soundtest.R; public class OwajibActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_owajib); } }
[ "engi.masihurrahman@gmail.com" ]
engi.masihurrahman@gmail.com
20230745aa1ae2935a0de0f6a6c7c31d75c32383
1bd8a6c5a23aca6e33452654697772adfd305518
/src/main/java/zym/Service/ServiceImpl/UserInfoServiceImpl.java
8d948bc8e09148ef7f8e681ed933db51ff0082a4
[]
no_license
ym1ng/springBoot-jpa
126615571f82b16c694ac05c567db6ac892ad181
11133dde37b6f18da5f14699737f382377d75cd7
refs/heads/master
2021-09-09T23:01:28.468358
2018-03-20T05:54:16
2018-03-20T05:54:16
125,164,277
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
package zym.Service.ServiceImpl; import org.springframework.stereotype.Service; import zym.Repositoty.UserInfoRepository; import zym.Service.UserInfoService; import javax.annotation.Resource; import org.springframework.transaction.annotation.Transactional; import zym.entity.UserInfo; @Service public class UserInfoServiceImpl implements UserInfoService { @Resource private UserInfoRepository userInfoRepository; @Transactional(readOnly=true) @Override public UserInfo findByUsername(String username) { return userInfoRepository.findByUsername(username); } }
[ "357471735@qq.com" ]
357471735@qq.com
591c861750ba6b1a3fd09e05c982fd67f1f22d52
c5f82d779dd64e654b1245e0a5cd9fda4871b595
/app/src/main/java/com/wuxiaolong/androidmvpsample/retrofit/AppClient.java
4e2ed96ed0d3242c2d5507ddf7b28bba427b66cc
[]
no_license
wherego/AndroidMVPSample-master
d81bb0f974b033ed3d853b69824903887eabdb5e
0a1846736676a52ae90f43ba5838590ea889d440
refs/heads/master
2021-01-20T14:35:07.576595
2017-03-16T08:31:15
2017-03-16T08:31:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,706
java
package com.wuxiaolong.androidmvpsample.retrofit; import android.content.Context; import com.wuxiaolong.androidmvpsample.BuildConfig; import java.io.File; import java.util.concurrent.TimeUnit; import okhttp3.Cache; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import retrofit2.Retrofit; import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; /** * Created by lhk * on 2016/3/24. */ public class AppClient { private static final long DEFAULT_TIMEOUT = 15; private static Retrofit mRetrofit; public static Retrofit retrofit(Context context) { if (mRetrofit == null) { mRetrofit = new Retrofit.Builder() .baseUrl(ApiStores.API_SERVER_URL) .addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create()) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .client(cacheClient(context)) .build(); } return mRetrofit; } /** * 获取没有缓存设置的OkHttpClient * @return */ public static OkHttpClient genericClient(){ OkHttpClient.Builder builder = new OkHttpClient.Builder(); if (BuildConfig.DEBUG) { // Log信息拦截器 HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); //设置 Debug Log 模式 builder.addInterceptor(loggingInterceptor); } return builder.build(); } /** * 获取有缓存设置的OkHttpClient * @param context * @return */ public static OkHttpClient cacheClient(Context context) { //缓存路径 File cacheFile = new File(context.getCacheDir().getAbsolutePath(), "HttpCache"); Cache cache = new Cache(cacheFile, 1024 * 1024 * 10);//缓存文件为10MB OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); httpClient.addInterceptor(new SetCacheInterceptor(context)) .cache(cache) .retryOnConnectionFailure(true) .connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS); //网络请求日志 if (BuildConfig.DEBUG) { HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BODY); httpClient.addInterceptor(logging); } return httpClient.build(); } }
[ "1031350293@qq.com" ]
1031350293@qq.com
3d026601aed7b97724c30f47d322136b9b716996
7d5cf06be037de2cd4acdef70dd3a653f9e0cb4e
/workspaceOfServletJSP/PrintWriterProject/src/com/eoj/web/PrintWriterServlet.java
70d19623f06394ba89c0cd4e0d2bcc20b6371fa2
[]
no_license
ShaikSalamBashoeb/researchanddevelopment
ac69c9ef68a6257089e9b500fef72ec7ddc2d813
a7b2488b85ed378f1a2ad9f0b12340f26954ae7a
refs/heads/master
2022-07-23T10:12:08.794468
2020-03-28T15:11:33
2020-03-28T15:11:33
250,803,775
0
0
null
2022-06-21T03:04:58
2020-03-28T13:36:49
JavaScript
UTF-8
Java
false
false
539
java
package com.eoj.web; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class PrintWriterServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter out = resp.getWriter(); out.println("<h1>Print Writer Successfully Executed</h1>"); } }
[ "shaiksalam550@gmail.com" ]
shaiksalam550@gmail.com
286c7e1b11c9182a12954fe40f3c98080415cae6
bbb59cd8b059ca11979602f2ed78561b6e35ca31
/src/main/java/com/murdock/books/multithread/book/Priority.java
62a389ed50b1e4d4e29e22511300bc02ac9d6013
[]
no_license
weipeng2k/multithread
e35ab89e33ed661b171f811099d0e320a3195b55
f92e6e013a0eb10fccd90193fde5ddc0b64596b6
refs/heads/master
2022-04-02T00:49:40.581563
2022-03-29T15:08:41
2022-03-29T15:08:41
7,287,369
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package com.murdock.books.multithread.book; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; public class Priority { private static volatile boolean notStart = true; private static volatile boolean notEnd = true; public static void main(String[] args) throws Exception { List<Job> jobs = new ArrayList<Job>(); for (int i = 0; i < 10; i++) { int priority = i < 5 ? Thread.MIN_PRIORITY : Thread.MAX_PRIORITY; Job job = new Job(priority); jobs.add(job); Thread thread = new Thread(job, "Thread:" + i); thread.setPriority(priority); thread.start(); } notStart = false; Thread.currentThread().setPriority(8); System.out.println("done."); TimeUnit.SECONDS.sleep(10); notEnd = false; for (Job job : jobs) { System.out.println("Job Priority : " + job.priority + ", Count : " + job.jobCount); } } static class Job implements Runnable { private int priority; private long jobCount; public Job(int priority) { this.priority = priority; } public void run() { while (notStart) { Thread.yield(); } while (notEnd) { Thread.yield(); jobCount++; } } } }
[ "weipeng2k@126.com" ]
weipeng2k@126.com
391f2b831ab220b742a0967fced7c40614993972
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_360/Testnull_35931.java
b912fcf7960c8631745bdbf4e79cc33acdefa298
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_360; import static org.junit.Assert.*; public class Testnull_35931 { private final Productionnull_35931 production = new Productionnull_35931("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
79187809981c2c3ecf1b00cc986bc43f29da051b
e010f83b9d383a958fc73654162758bda61f8290
/src/main/java/com/alipay/api/response/AlipayDaoweiServiceModifyResponse.java
91c9ac144ca1be8b751bb4f03076936f192dc2d4
[ "Apache-2.0" ]
permissive
10088/alipay-sdk-java
3a7984dc591eaf196576e55e3ed657a88af525a6
e82aeac7d0239330ee173c7e393596e51e41c1cd
refs/heads/master
2022-01-03T15:52:58.509790
2018-04-03T15:50:35
2018-04-03T15:50:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package com.alipay.api.response; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.daowei.service.modify response. * * @author auto create * @since 1.0, 2017-03-17 17:48:10 */ public class AlipayDaoweiServiceModifyResponse extends AlipayResponse { private static final long serialVersionUID = 7419264546782452458L; }
[ "liuqun.lq@alibaba-inc.com" ]
liuqun.lq@alibaba-inc.com
3c89839a11c925e0b94b3166f42626b712a2f128
9d1a8a81838ba2d16dbec740fbf4dc3657a8bc42
/app/src/main/java/com/zqp2sh/designpattern/抽象工厂模式/version3/AccessProject.java
16d9147cf002bdc4cbd29369bf903719de3e5b5c
[]
no_license
PlumpMath/DesignPattern-208
ece91c83c9d0f3f11013e0c093fef15f0f395ce7
a61f731b40ea0d904937f9e6451b646466935eec
refs/heads/master
2021-01-20T09:36:38.252301
2016-11-15T05:19:57
2016-11-15T05:19:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
488
java
package com.zqp2sh.designpattern.抽象工厂模式.version3; /** * 作者 @sh2zqp * 时间 @2016年11月11日 09:53 */ public class AccessProject implements IProject { @Override public void insertProject(Project project) { System.out.println("在Access中给Project表增加了一条记录"); } @Override public Project getProject(int id) { System.out.println("在Access中根据Id得到Project表的一条记录"); return null; } }
[ "980019603@qq.com" ]
980019603@qq.com
f779a59ab2e9313186f87089a064843e3c600b3d
76dcb4b3ac7487947da1fa61ccd8c48e979ba85b
/src/main/java/com/eureka/EurekaServiceApplication.java
a0d9a5df13e47be83d5a21faedc30eefe35a3c25
[]
no_license
261902287/eureka-service
b628fb3b5b8bc8bcf9da6f805b77c8651cfb39de
c00f5a388b6adfc5e285dd92b7ad935d1ccd5ca2
refs/heads/master
2020-12-14T17:18:39.255599
2020-01-19T01:38:34
2020-01-19T01:38:34
234,822,638
0
0
null
null
null
null
UTF-8
Java
false
false
1,058
java
package com.eureka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @EnableEurekaServer @SpringBootApplication public class EurekaServiceApplication { public static void main(String[] args) { SpringApplication.run(EurekaServiceApplication.class, args); } @EnableWebSecurity public static class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); super.configure(http); // http.csrf().ignoringAntMatchers("/eureka/**"); // super.configure(http); } } }
[ "261902287@qq.com" ]
261902287@qq.com
613c34a4deea35595c56c705493ba3f6c04742dd
0bf22e186fb06141f113be35f6073ada3023c327
/app/src/main/java/IEEE754/Float32.java
3c5aed554705bc3e79075b835f3e83abd64b2c25
[]
no_license
farbodsedghi/IEEE-754-Converter
11c58fc8dec281c12529d333ad98a96714b60ad6
6ac5e00e28beb3f9b0533f6009c7cc1446da209e
refs/heads/master
2021-01-19T09:09:12.901173
2015-03-05T06:52:57
2015-03-05T06:52:57
31,700,185
1
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
/* * This program uses java.lang.Number and its children Integer, Long, Float, Double, or BigInteger */ package IEEE754; /** * Define the IEEE-754 single precision floating point standard uses an 8-bit exponent (with a bias of 127) and a 23-bit significant * @author Farbod Sedghi */ public class Float32 extends IEEE754 { /** * * @param number as Float */ public Float32(Float number) { super(number); } /** * * @return 32bits value stored as Integer */ public Integer getFloat32() { // TODO return Float.floatToRawIntBits((Float) number); } @Override public String toHexadecimal() { if (number.floatValue() == 0) { return String.format("0x%08d", 0); } return String.format("0x%x", getFloat32()); } @Override public String toBinaryString() { return String.format("%32s", Integer.toBinaryString(getFloat32())).replace(' ', '0'); } @Override public String toString(){ if (number.floatValue() == 0) { return String.format("0x%08d", 0); } return String.format("0x%x", getFloat32()); } }
[ "info@tredolf.com" ]
info@tredolf.com
3483532241e9c4a8fc87d48a60648ae75cf38bc9
6395a4761617ad37e0fadfad4ee2d98caf05eb97
/.history/src/main/java/frc/robot/OI_20191116133029.java
29b1e8fba350938b199bcd9bcd70ef86bd22f878
[]
no_license
iNicole5/Cheesy_Drive
78383e3664cf0aeca42fe14d583ee4a8af65c1a1
80e1593512a92dbbb53ede8a8af968cc1efa99c5
refs/heads/master
2020-09-22T06:38:04.415411
2019-12-01T00:50:53
2019-12-01T00:50:53
225,088,973
0
0
null
null
null
null
UTF-8
Java
false
false
4,498
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; import edu.wpi.first.wpilibj.buttons.JoystickButton; import frc.robot.CommandGroups.PIDElevatorWrist; import frc.robot.commands.cmdArmDrop; import frc.robot.commands.cmdBAP; import frc.robot.commands.cmdBallIntake; import frc.robot.commands.cmdBallIntake2; import frc.robot.commands.cmdClimberPull; import frc.robot.commands.cmdGrabberOC; import frc.robot.commands.cmdShift; /** * This class is the glue that binds the controls on the physical operator * interface to the commands and command groups that allow control of the robot. */ public class OI { public Joystick Driver = new Joystick(0); public Joystick Driver2 = new Joystick(1); public Joystick Operator = new Joystick(2); public Joystick ButtonPannel = new Joystick(3); //Driver public Button grabberButton = new JoystickButton(Driver, 1); public Button ballIntake = new JoystickButton(Driver, 2); public Button ballIntakeReverse = new JoystickButton(Driver, 3); public Button shifter = new JoystickButton(Driver2, 1); //Operator public Button ballIntake2Reverse = new JoystickButton(Operator, 12); public Button linearActuatorUp = new JoystickButton(Operator, 11); public Button linearActuatorDown = new JoystickButton(Operator, 10); public Button climbingWheel = new JoystickButton(Operator, 6); public Button climbingWheelReverse = new JoystickButton(Operator, 7); public Button releaseClimbingClaw = new JoystickButton(Operator, 8); public Button attachClimbingClaw = new JoystickButton(Operator, 9); //ButtonPannel public Button hatchLevel1 = new JoystickButton(ButtonPannel, 3); public Button hatchLevel2 = new JoystickButton(ButtonPannel, 4); public Button hatchLevel3 = new JoystickButton(ButtonPannel, 5); public Button ballLevel1 = new JoystickButton(ButtonPannel, 6); public Button ballLevel2 = new JoystickButton(ButtonPannel, 7); public Button ballLevel3 = new JoystickButton(ButtonPannel, 8); public Button groundBall = new JoystickButton(ButtonPannel, 2); //public Button groundBall2 = new JoystickButton(ButtonPannel, 12); public Button groundBall3 = new JoystickButton(ButtonPannel, 11); public Button cargoShipBall = new JoystickButton(ButtonPannel, 10); public Button humanPlayerStationHatch = new JoystickButton(ButtonPannel, 1); public Joystick getDriverJoystick() { return Driver; } public Joystick getDriver2Joystick() { return Driver2; } public Joystick getOperatorJoystick() { return Operator; } public Joystick getButtonPannelJoystick() { return ButtonPannel; } public OI() { hatchLevel1.whenPressed(new PIDElevatorWrist(0, 0)); hatchLevel2.whenPressed(new PIDElevatorWrist(203160, 0)); hatchLevel3.whenPressed(new PIDElevatorWrist(384299, 0)); ballLevel1.whenPressed(new PIDElevatorWrist(0,31769)); ballLevel2.whenPressed(new PIDElevatorWrist(134639, 6560)); ballLevel3.whenPressed(new PIDElevatorWrist(317128, 7487)); groundBall.whenPressed(new PIDElevatorWrist(0, 115000)); // groundBall2.whenPressed(new PIDElevatorWrist(0, 95000)); groundBall3.whenPressed(new PIDElevatorWrist(0, 85000)); cargoShipBall.whenPressed(new PIDElevatorWrist(34203, 16760)); humanPlayerStationHatch.whenPressed(new PIDElevatorWrist(38522, 28996)); //35960 //79124 grabberButton.whenPressed(new cmdGrabberOC()); shifter.whenPressed(new cmdShift());; ballIntake.whileHeld(new cmdBallIntake(true)); ballIntakeReverse.whileHeld(new cmdBallIntake(false)); releaseClimbingClaw.whenPressed(new cmdArmDrop(true)); attachClimbingClaw.whenPressed(new cmdArmDrop(false)); climbingWheel.whileHeld(new cmdClimberPull(true)); climbingWheelReverse.whileHeld(new cmdClimberPull(false)); linearActuatorDown.whenPressed(new cmdBAP(true)); linearActuatorUp.whenPressed(new cmdBAP(false)); } }
[ "40499551+iNicole5@users.noreply.github.com" ]
40499551+iNicole5@users.noreply.github.com
d7d6028678955d34e0c597020ca52f160efac0b1
5ad7463f3d63c0e81f9270c0cc26a718f28b6dc4
/javaee148/day14/src/com/lofxve/classtest/classloader/Classloader.java
7d16605febaa36d78f01d3132afc88cbecbfa28a
[]
no_license
lofxve/practice
bc7fa993e3ee496696f58f33f092a1c35d9250db
f3f49aa7b0939723776fb776f5aaa13b591efd5e
refs/heads/master
2023-04-07T10:20:08.493390
2021-04-15T08:44:41
2021-04-15T08:44:41
342,749,261
1
0
null
null
null
null
UTF-8
Java
false
false
745
java
package com.lofxve.classtest.classloader; /** * @ClassName Classloader * @Author lofxve * @Date 2020/12/31 11:28 * @Version 1.0 */ public class Classloader { public static void main(String[] args) throws ClassNotFoundException { Class clazz = Class.forName("com.lofxve.classtest.classdome.Person"); //AppClassLoader 获取类加载器 ClassLoader classLoader = clazz.getClassLoader(); System.out.println(classLoader); // ExtClassLoader ClassLoader parent = classLoader.getParent(); System.out.println(parent); // 根类加载器,不是java语言描写,所以没有对象 ClassLoader parent1 = parent.getParent(); System.out.println(parent1); } }
[ "875567313@qq.com" ]
875567313@qq.com
8363fc94b174dfd18a05042c6318c22694c90d56
8280a4b4569ef3ff805086e444fadf8bdbf0d5e5
/shop-api-feign-service/src/main/java/com/fh/shop/api/goods/IGoodsFeignService.java
e4dacc3b977abdbfdf0ca34af2363a405436a08b
[]
no_license
Zhaotxjava/fh2008shop-cloud
8a2915437f3762a4cefea2c397b9e21352657418
280631846cb927acfe87a1f7e9f8357d8c42a933
refs/heads/master
2023-05-14T22:05:41.717166
2021-06-10T11:34:53
2021-06-10T11:34:53
375,590,363
1
0
null
null
null
null
UTF-8
Java
false
false
471
java
package com.fh.shop.api.goods; import com.fh.common.ServerResponse; import com.fh.shop.api.sku.po.Sku; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @FeignClient(name = "shop-goods-api") public interface IGoodsFeignService { @GetMapping("/api/skus/findSku") public ServerResponse<Sku> findSkn(@RequestParam("id") Long id); }
[ "2241905002@qq.com" ]
2241905002@qq.com
cc3b5b90f6fa6f9c92601361763e784eeed74428
2313848b3e9511cf56b007c73789d3a2387a653a
/src/main/java/com/codeclan/example/ComputerFiles/models/Folder.java
e9228a2a8df66d4f2a41839bc3f5829b8ea3ae04
[]
no_license
FuzzyDuck85/FilesFolderUser-Relations-Java-Spring
02fa2d5872be5c01d2da149ba8e23480d736ac8e
ea79e93a9906e2cedee0b562da03a568124468ce
refs/heads/master
2022-11-23T01:36:42.595701
2020-07-28T15:21:38
2020-07-28T15:21:38
283,248,406
0
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package com.codeclan.example.ComputerFiles.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.Cascade; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "folders") public class Folder { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "title") private String title; @OneToMany(mappedBy = "folder", fetch = FetchType.LAZY) @JsonIgnoreProperties({"folder"}) private List<File> files; @ManyToMany @JsonIgnoreProperties({"folders"}) @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) @JoinTable( name = "folders_users", joinColumns = {@JoinColumn(name = "user_id", nullable = false, updatable = false)}, inverseJoinColumns = {@JoinColumn(name="folder_id", nullable = false, updatable = false)} ) private List<User> users; public Folder(String title) { this.title = title; this.users = new ArrayList<User>(); } public Folder(){ } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public List<User> getUsers() { return users; } public void setUsers(List<User> users) { this.users = users; } public void addUser(User user){ this.users.add(user); } }
[ "drc85@live.co.uk" ]
drc85@live.co.uk
9f22d18de4439ba0caa8e438384cc7d9b10516a0
dbb47bfddf44b193e56da0c886b1ed4fadf22101
/app/src/main/java/com/uarmy/art/mark_sync/MergeItemView.java
1ae72177cadc36e555ba9f883351383879e1def8
[]
no_license
alariq/armysos-sebi
e38cf3cb20e85a88cecfd0f18aa4b298ce1b1c05
f55adc87ddac82957ad7e9037c5c34da760feb51
refs/heads/master
2021-01-25T08:54:20.373148
2014-09-15T21:12:40
2014-09-15T21:12:40
24,071,527
1
0
null
null
null
null
UTF-8
Java
false
false
2,270
java
package com.uarmy.art.mark_sync; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.uarmy.art.bt_sync.R; import com.uarmy.art.mark_merge.MergeInfo; /** * Created by a on 9/6/14. */ public class MergeItemView extends LinearLayout { private TextView myLeft; private TextView myRight; private MergeFragment.FieldInfo myFieldInfo; public MergeItemView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.merge_list_item, this, true); setupChildren(); } public static MergeItemView inflate(ViewGroup parent) { return (MergeItemView)LayoutInflater.from(parent.getContext()) .inflate(R.layout.merge_item_view, parent, false); } private void setupChildren() { myLeft = (TextView) findViewById(R.id.merge_left); myRight= (TextView) findViewById(R.id.merge_right); myFieldInfo = null; } public void setItem(MergeFragment.FieldInfo fi) { // Lookup view for data population myLeft.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { myFieldInfo.setFieldSelection(false); view.setBackgroundColor(getResources().getColor(android.R.color.darker_gray)); myRight.setBackgroundColor(getResources().getColor(android.R.color.background_light)); } }); myRight.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { myFieldInfo.setFieldSelection(true); view.setBackgroundColor(getResources().getColor(android.R.color.darker_gray)); myLeft.setBackgroundColor(getResources().getColor(android.R.color.background_light)); } }); myFieldInfo = fi; // Populate the data into the template view using the data object myLeft.setText(fi.myLeft); myRight.setText(fi.myRight); } }
[ "a@0xea0728b1" ]
a@0xea0728b1
effdf8067b7a2734c9779a6acbdd88d2d38800ec
12b14b30fcaf3da3f6e9dc3cb3e717346a35870a
/examples/commons-math3/mutations/mutants-Sinc/82/org/apache/commons/math3/analysis/function/Sinc.java
c35b94496701bb73aafb18a95e2551b77dc75973
[ "BSD-3-Clause", "Minpack", "Apache-2.0" ]
permissive
SmartTests/smartTest
b1de326998857e715dcd5075ee322482e4b34fb6
b30e8ec7d571e83e9f38cd003476a6842c06ef39
refs/heads/main
2023-01-03T01:27:05.262904
2020-10-27T20:24:48
2020-10-27T20:24:48
305,502,060
0
0
null
null
null
null
UTF-8
Java
false
false
7,624
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.commons.math3.analysis.function; import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction; import org.apache.commons.math3.analysis.FunctionUtils; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.util.FastMath; /** * <a href="http://en.wikipedia.org/wiki/Sinc_function">Sinc</a> function, * defined by * <pre><code> * sinc(x) = 1 if x = 0, * sin(x) / x otherwise. * </code></pre> * * @since 3.0 * @version $Id$ */ public class Sinc implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction { /** * Value below which the computations are done using Taylor series. * <p> * The Taylor series for sinc even order derivatives are: * <pre> * d^(2n)sinc/dx^(2n) = Sum_(k>=0) (-1)^(n+k) / ((2k)!(2n+2k+1)) x^(2k) * = (-1)^n [ 1/(2n+1) - x^2/(4n+6) + x^4/(48n+120) - x^6/(1440n+5040) + O(x^8) ] * </pre> * </p> * <p> * The Taylor series for sinc odd order derivatives are: * <pre> * d^(2n+1)sinc/dx^(2n+1) = Sum_(k>=0) (-1)^(n+k+1) / ((2k+1)!(2n+2k+3)) x^(2k+1) * = (-1)^(n+1) [ x/(2n+3) - x^3/(12n+30) + x^5/(240n+840) - x^7/(10080n+45360) + O(x^9) ] * </pre> * </p> * <p> * So the ratio of the fourth term with respect to the first term * is always smaller than x^6/720, for all derivative orders. * This implies that neglecting this term and using only the first three terms induces * a relative error bounded by x^6/720. The SHORTCUT value is chosen such that this * relative error is below double precision accuracy when |x| <= SHORTCUT. * </p> */ private static final double SHORTCUT = 6.0e-3; /** For normalized sinc function. */ private final boolean normalized; /** * The sinc function, {@code sin(x) / x}. */ public Sinc() { this(false); } /** * Instantiates the sinc function. * * @param normalized If {@code true}, the function is * <code> sin(&pi;x) / &pi;x</code>, otherwise {@code sin(x) / x}. */ public Sinc(boolean normalized) { this.normalized = normalized; } /** {@inheritDoc} */ public double value(final double x) { final double scaledX = normalized ? FastMath.PI * x : x; if (FastMath.abs(scaledX) <= SHORTCUT) { // use Taylor series final double scaledX2 = scaledX * scaledX; return ((scaledX2 - 20) * scaledX2 + 120) / 120; } else { // use definition expression return FastMath.sin(scaledX) / scaledX; } } /** {@inheritDoc} * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)} */ @Deprecated public UnivariateFunction derivative() { return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative(); } /** {@inheritDoc} * @since 3.1 */ public DerivativeStructure value(final DerivativeStructure t) throws DimensionMismatchException { final double scaledX = (normalized ? FastMath.PI : 1) * t.getValue(); final double scaledX2 = scaledX * scaledX; double[] f = new double[t.getOrder() + 1]; if (FastMath.abs(scaledX) <= SHORTCUT) { for (int i = 0; i < f.length; ++i) { final int k = i / 2; if ((i & 1) >= 0) { // even derivation order f[i] = (((k & 0x1) == 0) ? 1 : -1) * (1.0 / (i + 1) - scaledX2 * (1.0 / (2 * i + 6) - scaledX2 / (24 * i + 120))); } else { // odd derivation order f[i] = (((k & 0x1) == 0) ? -scaledX : scaledX) * (1.0 / (i + 2) - scaledX2 * (1.0 / (6 * i + 24) - scaledX2 / (120 * i + 720))); } } } else { final double inv = 1 / scaledX; final double cos = FastMath.cos(scaledX); final double sin = FastMath.sin(scaledX); f[0] = inv * sin; // the nth order derivative of sinc has the form: // dn(sinc(x)/dxn = [S_n(x) sin(x) + C_n(x) cos(x)] / x^(n+1) // where S_n(x) is an even polynomial with degree n-1 or n (depending on parity) // and C_n(x) is an odd polynomial with degree n-1 or n (depending on parity) // S_0(x) = 1, S_1(x) = -1, S_2(x) = -x^2 + 2, S_3(x) = 3x^2 - 6... // C_0(x) = 0, C_1(x) = x, C_2(x) = -2x, C_3(x) = -x^3 + 6x... // the general recurrence relations for S_n and C_n are: // S_n(x) = x S_(n-1)'(x) - n S_(n-1)(x) - x C_(n-1)(x) // C_n(x) = x C_(n-1)'(x) - n C_(n-1)(x) + x S_(n-1)(x) // as per polynomials parity, we can store both S_n and C_n in the same array final double[] sc = new double[f.length]; sc[0] = 1; double coeff = inv; for (int n = 1; n < f.length; ++n) { double s = 0; double c = 0; // update and evaluate polynomials S_n(x) and C_n(x) final int kStart; if ((n & 0x1) == 0) { // even derivation order, S_n is degree n and C_n is degree n-1 sc[n] = 0; kStart = n; } else { // odd derivation order, S_n is degree n-1 and C_n is degree n sc[n] = sc[n - 1]; c = sc[n]; kStart = n - 1; } // in this loop, k is always even for (int k = kStart; k > 1; k -= 2) { // sine part sc[k] = (k - n) * sc[k] - sc[k - 1]; s = s * scaledX2 + sc[k]; // cosine part sc[k - 1] = (k - 1 - n) * sc[k - 1] + sc[k -2]; c = c * scaledX2 + sc[k - 1]; } sc[0] *= -n; s = s * scaledX2 + sc[0]; coeff *= inv; f[n] = coeff * (s * sin + c * scaledX * cos); } } if (normalized) { double scale = FastMath.PI; for (int i = 1; i < f.length; ++i) { f[i] *= scale; scale *= FastMath.PI; } } return t.compose(f); } }
[ "kesina@Kesinas-MBP.lan" ]
kesina@Kesinas-MBP.lan
85c7d6356cbb63f3b74711846916e77809684eb1
7987a238b5b277f4acc5788959213999544e6326
/src/main/java/com/yrwl/api/service/impl/BaseServiceImpl.java
ca7e2db87d2c54bb441fc208f76cfd02a473e119
[]
no_license
shenmoshui/coupons
de60b199cf3fb0f4935bed8aadf47e8c304aaac3
51f9b08cb4247b7f662057914354a02c53d627a5
refs/heads/master
2022-07-12T00:06:58.435389
2020-06-18T00:54:39
2020-06-18T00:54:39
241,546,469
4
0
null
2022-06-17T02:55:35
2020-02-19T06:09:39
Java
UTF-8
Java
false
false
640
java
package com.yrwl.api.service.impl; import com.github.pagehelper.PageHelper; import com.yrwl.common.model.PageQueryModel; /** * @author shentao * @date 2019-12-24 */ public class BaseServiceImpl { /** * 分页 * @param pageQueryModel */ protected void getList(PageQueryModel pageQueryModel){ if(pageQueryModel == null){ pageQueryModel = new PageQueryModel(); } if(pageQueryModel.isQueryAll()){ pageQueryModel.setPageSize(0); } PageHelper.startPage(pageQueryModel.getPageNum(), pageQueryModel.getPageSize(), pageQueryModel.isDoCount()); } }
[ "shentao@diag.launch" ]
shentao@diag.launch
c0f65c1811a1ef4a68d4f04f32276ac8eb82e0ca
f86d89449f0f5b80a863d3cf74d4d4cea546d76a
/APCSASchool/src/unit13/Lab15d.java
d834b623783e377a98465cb771343b69605271c3
[]
no_license
taox6353/APCSAQ3
82e487fb98202500af4e4f9625c68b1afb6cab1d
2724dda733709ebd24dccef74891b7403966c4be
refs/heads/master
2020-03-15T01:58:30.168827
2018-05-02T21:17:00
2018-05-02T21:17:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package unit13; import java.util.Arrays; import java.util.Scanner; import java.util.Collections; import java.io.File; import java.io.IOException; import static java.lang.System.*; public class Lab15d { public static void main( String args[] ) throws IOException { Scanner file = new Scanner(new File("src\\unit13\\lab15d.dat")); int num = file.nextInt(); FancyWords[] sents = new FancyWords[num]; file.nextInt(); for(int i=0;i<num;i++){ sents[i] = new FancyWords(file.nextLine()); } for(int j=0;j<num;j++){ System.out.println(sents[j].toString()); } } }
[ "taox6353@CA-SU-F106-28.sduhsd.lan" ]
taox6353@CA-SU-F106-28.sduhsd.lan
7996161c9ddca5776a65e63258638572e707c13c
c630405c946ce114e82dcd67dabecf18c9b2b6b5
/CurrentDate .java
f38639a9348c26b4c8f9eaee6f00c2f644ae5667
[]
no_license
madhumithaj/trialrepo1
ca80d096126fb753722e1aa395191bab07a7cebb
66518083bc8d55efae728be32652aa281a456399
refs/heads/master
2021-01-15T10:26:22.779152
2017-08-10T09:20:11
2017-08-10T09:20:11
99,580,225
0
0
null
2017-08-10T07:29:17
2017-08-07T13:20:49
Java
UTF-8
Java
false
false
1,141
java
import java.util.Calendar; public class CurrentDate { public static void main(String[] args) { //create Calendar instance Calendar now = Calendar.getInstance(); System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1) + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR)); //add days to current date using Calendar.add method now.add(Calendar.DATE,1); System.out.println("date after one day : " + (now.get(Calendar.MONTH) + 1) + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR)); //substract days from current date using Calendar.add method now = Calendar.getInstance(); now.add(Calendar.DATE, -10); System.out.println("date before 10 days : " + (now.get(Calendar.MONTH) + 1) + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR)); } }
[ "madhumitha.j@gavstech.com" ]
madhumitha.j@gavstech.com
b7b8f5357e3a618f4f02a980019363cfb9413be2
08b8d598fbae8332c1766ab021020928aeb08872
/src/gcom/agenciavirtual/imovel/ConsultarPagamentoJSONHelper.java
7630857da4001ebfb367a91afd838f887e5b1cdd
[]
no_license
Procenge/GSAN-CAGEPA
53bf9bab01ae8116d08cfee7f0044d3be6f2de07
dfe64f3088a1357d2381e9f4280011d1da299433
refs/heads/master
2020-05-18T17:24:51.407985
2015-05-18T23:08:21
2015-05-18T23:08:21
25,368,185
3
1
null
null
null
null
ISO-8859-2
Java
false
false
2,661
java
package gcom.agenciavirtual.imovel; import java.io.Serializable; public class ConsultarPagamentoJSONHelper implements Serializable { private String valorPagamento; private String datapagamento; private String arrecadador; private String situacaoAnterior; private String situacaoAtual; // Pagamentos das Contas private String mesAnoConta; private String valorConta; // Pagamento das Guias de Pagamento private String cliente; private String numeroDocumento; private String valorPrestacao; // Pagamento dos Débitos a Cobrar private String tipoDebito; private String valorSerCobrado; private String prestacao; public String getValorPagamento(){ return valorPagamento; } public void setValorPagamento(String valorPagamento){ this.valorPagamento = valorPagamento; } public String getDatapagamento(){ return datapagamento; } public void setDatapagamento(String datapagamento){ this.datapagamento = datapagamento; } public String getArrecadador(){ return arrecadador; } public void setArrecadador(String arrecadador){ this.arrecadador = arrecadador; } public String getSituacaoAnterior(){ return situacaoAnterior; } public void setSituacaoAnterior(String situacaoAnterior){ this.situacaoAnterior = situacaoAnterior; } public String getSituacaoAtual(){ return situacaoAtual; } public void setSituacaoAtual(String situacaoAtual){ this.situacaoAtual = situacaoAtual; } public String getMesAnoConta(){ return mesAnoConta; } public void setMesAnoConta(String mesAnoConta){ this.mesAnoConta = mesAnoConta; } public String getValorConta(){ return valorConta; } public void setValorConta(String valorConta){ this.valorConta = valorConta; } public String getCliente(){ return cliente; } public void setCliente(String cliente){ this.cliente = cliente; } public String getNumeroDocumento(){ return numeroDocumento; } public void setNumeroDocumento(String numeroDocumento){ this.numeroDocumento = numeroDocumento; } public String getValorPrestacao(){ return valorPrestacao; } public void setValorPrestacao(String valorPrestacao){ this.valorPrestacao = valorPrestacao; } public String getTipoDebito(){ return tipoDebito; } public void setTipoDebito(String tipoDebito){ this.tipoDebito = tipoDebito; } public String getValorSerCobrado(){ return valorSerCobrado; } public void setValorSerCobrado(String valorSerCobrado){ this.valorSerCobrado = valorSerCobrado; } public String getPrestacao(){ return prestacao; } public void setPrestacao(String prestacao){ this.prestacao = prestacao; } }
[ "Yara.Souza@procenge.com.br" ]
Yara.Souza@procenge.com.br
5af751ce016ec8ff3f0dfa8fa3b32d16b4cb864d
921b73fb6a0964210b9f513b9aa08b4d1c2cf7d7
/src/main/java/mediator/example/torreGeneral.java
ba3568fdee048010aa06dab7abf242e0b7fb694f
[]
no_license
X4TKC/PatronesDeDiseno
d781ff5b4c7459f01dfe484cdc18e7a9ec89d75b
0ccbadc36ae5355707193766cec3e71dac5830b3
refs/heads/master
2020-08-10T03:14:55.449201
2019-11-15T12:26:14
2019-11-15T12:26:14
214,243,199
1
1
null
null
null
null
UTF-8
Java
false
false
1,811
java
package mediator.example; public class torreGeneral implements ITorre { private Vuelo7E7 user1; private Vuelo112 user2; private Vuelo747 user3; private Vuelo1011 user4; public void setVuelo7E7(Vuelo7E7 vuelo7e7){ user1=vuelo7e7; } public void setVuelo112(Vuelo112 vuelo112){ user2=vuelo112; } public void setVuelo747(Vuelo747 vuelo747){ user3=vuelo747; } public void setVuelo1011(Vuelo1011 vuelo1011){ user4=vuelo1011; } @Override public void send(String msg, Vuelo vuelo, String nombre) { if (nombre.equals("vuelo747")){ user3.messageReceived(msg); }else if(nombre.equals("vuelo112")){ user2.messageReceived(msg); } else if(nombre.equals("vuelo7E7")){ user1.messageReceived(msg); } else if(nombre.equals("vuelo1011")){ user4.messageReceived(msg); } else if(nombre.equals("")){ if(vuelo.getName().equals("vuelo747")){ user1.messageReceived(msg); user2.messageReceived(msg); user4.messageReceived(msg); } else if(vuelo.getName().equals("vuelo112")){ user1.messageReceived(msg); user3.messageReceived(msg); user4.messageReceived(msg); } else if(vuelo.getName().equals("vuelo7E7")){ user2.messageReceived(msg); user3.messageReceived(msg); user4.messageReceived(msg); } else if(vuelo.getName().equals("vuelo1011")){ user1.messageReceived(msg); user3.messageReceived(msg); user2.messageReceived(msg); } } } }
[ "tovilaskevin@gmail.com" ]
tovilaskevin@gmail.com
c3cd4216f3e1f635620d078f1329889853f7e7ae
ef3ea6ed1f440a730d4ad5ebdcd06a276bbedda3
/src/main/java/com/abseliamov/javapatterns/behavioral/mementogame/SaveFile.java
436e6943f8467d18432f228260c9ece8bec9c873
[]
no_license
AbseliamovEnver/javacorepatterns
a3b0f158fb892336b3c5988a35df5bde9b18e0c4
7ad3ba22df66c47e830292590037e8b196270fd5
refs/heads/master
2020-07-03T21:06:25.857646
2019-08-13T02:47:46
2019-08-13T02:47:46
202,049,414
0
0
null
null
null
null
UTF-8
Java
false
false
236
java
package com.abseliamov.javapatterns.behavioral.mementogame; public class SaveFile { private Save save; public Save getSave() { return save; } public void setSave(Save save) { this.save = save; } }
[ "a.enver.com@gmail.com" ]
a.enver.com@gmail.com
609666adc4853cbf11fd95242e0be72c52ed67e1
4d54eb2044c609725f196e86167730b00015c287
/src/streams/Carros.java
77dd6674aa6fe1dd2b07db4a30365115f5a05106
[]
no_license
MatheusFidelisPE/JavaCursoUdemy
bf8d433abda519307a78857808218441f13a7be1
a7226ad668c11cc2d50fcd530b4cc825abea84e3
refs/heads/master
2023-02-21T16:16:24.441668
2021-01-13T22:37:47
2021-01-13T22:37:47
329,430,127
0
0
null
null
null
null
ISO-8859-1
Java
false
false
686
java
package streams; import java.util.function.UnaryOperator; public class Carros { //fazendo o construtor ser privado não tem como instanciar um objeto do tipo carros. Dando mais enfase a uma classe com métodos puramente staticos. private Carros(){ } public static UnaryOperator<String> maiusculo = nome -> nome.toUpperCase(); public static UnaryOperator<String> primeiraLetra = nome -> nome.charAt(0) + " "; public static UnaryOperator<String> ultimaLetra = nome -> nome.charAt((nome.length() - 2)) + " "; public static UnaryOperator<String> translateNome= nome -> nome.translateEscapes(); public static String grito(String nome) { return nome = nome + "!!\n"; } }
[ "mfds@a.recife.ifpe.edu.br" ]
mfds@a.recife.ifpe.edu.br
878014d4592aa1d2532c57939524f622712fd2dc
ecb2f5ef73a84e5632e4bf304a709abcd0d28e94
/src/main/java/net/herit/iot/onem2m/core/convertor/XMLConvertor.java
1de7a2c9c2c52ae04aad3fc423fa82792b2d3306
[ "BSD-2-Clause" ]
permissive
10thyear/SI
7fb8215a2f00538358965ddbcaf56a27f169189e
4c502c39c3b4645f222f1ba2d55ce020140669dc
refs/heads/master
2021-01-16T21:11:42.714453
2016-01-15T21:17:47
2016-01-15T21:17:47
50,492,333
0
0
null
2016-01-27T08:14:19
2016-01-27T08:14:18
Java
UTF-8
Java
false
false
76,024
java
package net.herit.iot.onem2m.core.convertor; import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import javax.xml.namespace.QName; import net.herit.iot.onem2m.resource.*; import org.eclipse.persistence.jaxb.MarshallerProperties; import org.eclipse.persistence.jaxb.UnmarshallerProperties; import org.xml.sax.InputSource; import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper; import com.sun.xml.internal.bind.v2.WellKnownNamespace; public class XMLConvertor<T> { private final Class<T> t; private JAXBContext context; private Unmarshaller um; private Marshaller m; // private final static String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; public XMLConvertor(Class<T> type, String schema, Class<T>[] types) { this.t = type; try { if (types != null) { context = JAXBContext.newInstance(types); //ServiceSubscriptionProfile.class,MgmtObj.class,MgmtObjAnnc.class, } else { context = JAXBContext.newInstance(t);//AE.class); } if(context == null) { throw new Exception("JAXBContext newInstance failed"); } initialize(schema); } catch (Exception e) { // TBD e.printStackTrace(); } } public XMLConvertor(Class<T> type, String schema) { this.t = type; try { context = JAXBContext.newInstance(t);//AE.class); if(context == null) { throw new Exception("JAXBContext newInstance failed"); } initialize(schema); } catch (Exception e) { // TBD e.printStackTrace(); } } private void initialize(String schema) throws JAXBException { um = context.createUnmarshaller(); um.setProperty(UnmarshallerProperties.MEDIA_TYPE, "application/xml"); m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_ENCODING, "utf-8"); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); m.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new NamespacePrefixMapper() { @Override public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { if(namespaceUri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE)) { return "xsi"; } else return "m2m"; } }); String schemaLocation = schema; if(schemaLocation != null) { m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.onem2m.org/xml/protocols " + schemaLocation); } m.setProperty(MarshallerProperties.MEDIA_TYPE, "application/xml"); } public T unmarshal(String xml) throws Exception { //JAXBContext context = null; synchronized (um) { InputSource ins = new InputSource(new StringReader(xml)); T obj = null; obj = (T)um.unmarshal(ins); return obj; } } public String marshal(T obj) throws Exception { synchronized (m) { String resourceName = t.getSimpleName(); JAXBElement<T> element = new JAXBElement<T> (new QName("http://www.onem2m.org/xml/protocols", resourceName), t, (T)obj); Writer writer = new StringWriter(); m.marshal(obj, writer); String xml = writer.toString(); return xml; } } /* public String marshal(T obj, String schema) throws Exception { String resourceName = t.getSimpleName(); // switch(resType) { // case AE: // context = JAXBContext.newInstance(t);//AE.class); // schemaLocation = AE.SCHEMA_LOCATION; // resourceName = "AE"; // System.out.println("AE name=" + t.getSimpleName() ); // break; // // case CONTAINER: // context = JAXBContext.newInstance(t);//Container.class); // schemaLocation = Container.SCHEMA_LOCATION; // resourceName = "container"; // break; // // case CONTENT_INST: // context = JAXBContext.newInstance(t);//ContentInstance.class); // schemaLocation = ContentInstance.SCHEMA_LOCATION; // resourceName = "contentInstance"; // break; // // default: // break; // } // m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); // try{ // m.setProperty("com.sun.xml.internal.bind.xmlHeaders", XML_HEADER); // } catch(PropertyException pex) { // m.setProperty("com.sun.xml.bind.xmlHeaders", XML_HEADER); // } String schemaLocation = schema; if(schemaLocation != null) { m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.onem2m.org/xml/protocols " + schemaLocation); } JAXBElement<T> element = new JAXBElement<T> (new QName("http://www.onem2m.org/xml/protocols", resourceName), t, (T)obj); //JAXBElement<AE> element = new JAXBElement<AE> (new QName("http://www.onem2m.org/xml/protocols", AE.class.getName()), AE.class, (AE)obj); // m.setProperty(MarshallerProperties.MEDIA_TYPE, "application/json"); // // Set it to true if you need to include the JSON root element in the JSON output // m.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true); // // Set it to true if you need the JSON output to formatted // m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); Writer writer = new StringWriter(); m.marshal(obj, writer); String xml = writer.toString(); // System.out.println(out); return xml; } */ public static void main(String[] args) { String AE_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->" + "<m2m:ae xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-AE-v1_2_0.xsd\" rn=\"ae0001\">" + "<ty>2</ty> <!-- resourceType -->" + "<ri>3234234293</ri> <!-- resourceID -->" + "<pi>3234234292</pi> <!-- parentID -->" + "<ct>20150603T122321</ct> <!-- creationTime -->" + "<lt>20150603T122321</lt> <!-- lastModifiedTime -->" + "<lbl>hubiss admin</lbl> <!-- labels -->" + "<acpi>3234234001 3234234002</acpi> <!-- accessControlPolicyIDs -->" + "<et>20150603T122321</et> <!-- expirationTime -->" + "<at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!-- announceTo -->" + "<aa>pointOfAccess labels</aa> <!-- announcedAttribute -->" + "<apn>onem2mPlatformAdmin</apn> <!-- appName -->" + "<api>C[authority-ID]/[registered-App-ID]</api> <!-- App-ID -->" + "<aei>//onem2m.herit.net/csebase/ae0001</aei> <!-- AE-ID -->" + "<poa>10.101.101.111:8080</poa> <!-- pointOfAccess -->" + "<or>[ontology access url]</or> <!-- ontologyRef -->" + "<nl>//onem2m.herit.net/csebase/node0001</nl> <!-- nodeLink -->" + "<ch nm=\"container0001\" typ=\"17\">//onem2m.herit.net/csebase/container0001</ch>" + "<ch nm=\"group0001\" typ=\"14\">//onem2m.herit.net/csebase/group0001</ch>" + "<ch nm=\"acp0001\" typ=\"10001\">//onem2m.herit.net/csebase/acs0001</ch>" + "<ch nm=\"subscription0001\" typ=\"6\">//onem2m.herit.net/csebase/subscription0001</ch>" + "<ch nm=\"pollingChannel0001\" typ=\"22\">//onem2m.herit.net/csebase/pollingChannel0001</ch>" + "</m2m:ae>"; String Container_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->" + "<m2m:cnt xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"container0001\">" + "<ty>3</ty> <!--resourceType-->" + "<ri>3234234293</ri> <!--resourceID-->" + "<pi>3234234292</pi> <!--parentID-->" + "<ct>20150603T122321</ct> <!--creationTime-->" + "<lt>20150603T122321</lt> <!--lastModifiedTime-->" + "<lbl>hubiss admin</lbl> <!--labels-->" + "<acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->" + "<et>20150603T122321</et> <!--expirationTime-->" + "<at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->" + "<aa>pointOfAccess labels</aa> <!--announcedAttribute-->" + "<st>0</st> <!--stateTag-->" + "<cr>//onem2m.herit.net/csebase/ae0001</cr> <!--creator-->" + "<mni>100</mni> <!--maxNrOfInstances-->" + "<mbs>1024000</mbs> <!--maxByteSize-->" + "<mia>36000</mia> <!--maxInstanceAge-->" + "<cni>10</cni> <!--currentNrOfInstances-->" + "<cbs>10240</cbs> <!--currentByteSize-->" + "<li>//onem2m.hubiss.com/cseBase/lp1</li> <!--locationID-->" + "<or>[ontology access url]</or> <!--ontologyRef-->" + "<ch nm=\"container0001\" typ=\"3\">/container0001</ch>" + "<ch nm=\"contentInstance0001\" typ=\"4\">/contentInstance0001</ch>" + "<ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>" + "<ch nm=\"latest\" typ=\"4\">/latest</ch>" + "<ch nm=\"oldest\" typ=\"23\">/oldest</ch>" + "</m2m:cnt>"; String ContentInstance_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->" + "<m2m:cin xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-contentInstance-v1_2_0.xsd\" rn=\"ci0001\">" + "<ty>4</ty> <!--resourceType-->" + "<ri>3234234293</ri> <!--resourceID-->" + "<pi>3234234292</pi> <!--parentID-->" + "<ct>20150603T122321</ct> <!--creationTime-->" + "<lt>20150603T122321</lt> <!--lastModifiedTime-->" + "<lbl>hubiss admin</lbl> <!--labels-->" + "<et>20150603T122321</et> <!--expirationTime-->" + "<at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->" + "<aa>contentInfo contentSize statTag ontologyRef content</aa> <!--announcedAttribute-->" + "<st>0</st> <!--stateTag-->" + "<cr>//onem2m.herit.net/csebase/ae0001</cr> <!--creator-->" + "<cnf>application/txt:0</cnf> <!--contentInfo-->" + "<cs>2</cs> <!--contentSize-->" + "<or>[ontology access url]</or> <!--ontologyRef-->" + "<con>on</con> <!--content-->" + "</m2m:cin>"; String RemoteCSE_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + " <!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + " <m2m:csr xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"remoteCse001\">\n" + " <ty>16</ty> <!--resourceType-->\n" + " <ri>rcse_00001</ri> <!--resourceID-->\n" + " <pi>csebase</pi> <!--parentID-->\n" + " <ct>20150603T122321</ct> <!--creationTime-->\n" + " <lt>20150603T122321</lt> <!--lastModifiedTime-->\n" + " <lbl>gw001</lbl> --> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et> <!--expirationTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>cseType pointOfAccess CSEBase CSE-ID requestReachability</aa> <!--announcedAttribute-->\n" + " <cst>1</cst> --> <!--cseType-->\n" + " <poa>http://10.101.101.12:8090</poa> <!--pointOfAccess--> <!-- pollingChannel과 pointOfAccess 둘중 하나를 제공해야 함 -->\n" + " <cb>//onem2m.herit.net/cse01</cb> <!--CSEBase-->\n" + " <csi>cse000012</csi> <!--CSE-ID-->\n" + " <mei>TBD</mei> <!--M2M-Ext-ID-->" + " <tri>3</tri> <!--Trigger-Recipient-ID-->\n" + " <rr>true</rr> <!--requestReachability-->\n" + " <nl>//onem2m.herit.net/csebase/node0001</nl> <!--nodeLink-->\n" + " <ch nm=\"AE0001\" typ=\"2\">/AE0001</ch>\n" + " <ch nm=\"container0001\" typ=\"3\">/container0001</ch>\n" + " <ch nm=\"group0001\" typ=\"9\">/group0001</ch>\n" + " <ch nm=\"accessControlPolicy0001\" typ=\"1\">/accessControlPolicy0001</ch>\n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"pollingChannel0001\" typ=\"15\">/pollingChannel0001</ch>\n" + " <ch nm=\"schedule0001\" typ=\"18\">/schedule0001</ch>\n" + " <ch nm=\"nodeAnnc0001\" typ=\"10014\">/nodeAnnc0001</ch>\n" + " </m2m:csr>"; String AccessControlPolicy_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:acp xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"acp0001\" >\n" + " <ty>12</ty> <!--resourceType-->\n" + " <ri>3234234293</ri> <!--resourceID-->\n" + " <pi>3234234292</pi> <!--parentID-->\n" + " <et>20150603T122321</et> <!--expirationTime-->\n" + " <lbl>acpForHomeSvc</lbl> <!--labels-->\n" + " <ct>20150603T122321</ct> <!--creationTime-->\n" + " <lt>20150603T122321</lt> <!--lastModifiedTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>pointOfAccess labels</aa> <!--announcedAttribute-->\n" + " <pv>\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor> <!-- accessControlOriginators -->\n" + " <acop>63</acop> <!-- accessControlOperations Create + Retrieve + Update + Delete + Notify + Discover -->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw> <!-- accessControlWindow -->\n" + " <actw>* * 11-15 * * *</actw>\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4> <!-- ipv4Addresses -->\n" + " <!-- <ipv6>::</ipv6> -->\n" + " </acip> <!-- accessControlIpAddresses -->\n" + " <aclr> <!-- accessControlLocationRegion -->\n" + " <accc>KR</accc> <!-- countryCode -->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr> <!-- circRegion -->\n" + " </aclr>\n" + " </acco> <!-- accessControlContexts -->\n" + " </acr> <!--accessControlRule-->\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor>\n" + " <acop>2</acop> <!-- Retrieve -->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw>\n" + " <actw>* * 11-15 * * *</actw>\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4>\n" + " <!-- <ipv6>::</ipv6> -->\n" + " </acip>\n" + " <aclr>\n" + " <accc>KR</accc> <!-- countryCode -->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr> <!-- circRegion -->\n" + " </aclr>\n" + " </acco>\n" + " </acr>\n" + " </pv> <!--privileges-->\n" + " <pvs>\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor>\n" + " <acop>63</acop> <!-- Create + Retrieve + Update + Delete + Notify + Discover -->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw>\n" + " <actw>* * 11-15 * * *</actw>\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4>\n" + " <!-- <ipv6>::</ipv6> -->\n" + " </acip>\n" + " <aclr>\n" + " <accc>KR</accc>\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr>\n" + " </aclr>\n" + " </acco>\n" + " </acr>\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor>\n" + " <acop>2</acop> <!-- Retrieve -->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw>\n" + " <actw>* * 11-15 * * *</actw>\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4>\n" + " <!-- <ipv6>::</ipv6> -->\n" + " </acip>\n" + " <aclr>\n" + " <accc>KR</accc>\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr>\n" + " </aclr>\n" + " </acco>\n" + " </acr>\n" + " </pvs> <!--selfPrivileges-->\n" + "</m2m:acp>"; String CSEBase_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<m2m:cb xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-CSEBase-v1_0_0.xsd\" rn=\"CSEBase\">\n" + " <ty>4</ty> <!-- resourceType -->\n" + " <ri>CSEBase0001</ri> <!-- resourceID -->\n" + " <ct>20150603T122321</ct> <!-- creationTime -->\n" + " <lt>20150603T122321</lt> <!-- lastModifiedTime -->\n" + " <lbl>herit in cse platform</lbl> <!-- labels -->\n" + " <acpi>ACP0001 ACP0002</acpi> <!-- accessControlPolicyIDs -->\n" + " <cst>1</cst> <!-- cseType -->\n" + " <csi>CSEBase0001</csi> <!-- CSE-ID -->\n" + " <srt>1 2 3 4 5 6 7 8 9 10 11 12 10001 10002 10003 10004 10009</srt> <!-- supportedResourceType -->\n" + " <poa>10.101.101.111:8080</poa> <!-- pointOfAccess -->\n" + " <nl>node0001</nl> <!-- nodeLink -->\n" + " <ch nm=\"remoteCSE0011\" typ=\"16\">/remoteCSE0011</ch> <!-- childResource -->\n" + " <ch nm=\"remoteCSE0012\" typ=\"16\">/remoteCSE0012</ch>\n" + " <ch nm=\"node1\" typ=\"14\">/node0001</ch>\n" + " <ch nm=\"AE0001\" typ=\"2\">/AE0001</ch>\n" + " <ch nm=\"AE0002\" typ=\"2\">/AE0002</ch>\n" + " <ch nm=\"ACP0001\" typ=\"1\">ACP0001</ch>\n" + " <ch nm=\"ACP0002\" typ=\"1\">ACP0002</ch>\n" + " <ch nm=\"SUBSCRITPION0001\" typ=\"23\">/SUBSCRITPION0001</ch>\n" + " <ch nm=\"SUBSCRITPION0002\" typ=\"23\">/SUBSCRITPION0002</ch>\n" + " <ch nm=\"localPolicy0001\" typ=\"10\">/localPolicy0001</ch>\n" + " <ch nm=\"schedule0001\" typ=\"18\">http://www.altova.com/</ch>\n" + "</m2m:cb>"; String Group_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:grp xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"group001\">\n" + " <ty>9</ty> <!--resourceType-->\n" + " <ri>3234234293</ri> <!--resourceID-->\n" + " <pi>3234234292</pi> <!--resourceID-->\n" + " <ct>20150603T122321</ct> <!--creationTime-->\n" + " <lt>20150603T122321</lt> <!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et> <!--expirationTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>memberType currentNrOfMembers maxNrOfMembers memberIDs membersAccessControlPolicyIDs memberTypeValidated consistencyStrategy groupName</aa> <!--announcedAttribute-->\n" + " <cr>//onem2m.herit.net/csebase/ae0001</cr> <!--creator-->\n" + "\n" + " <mt>2</mt> <!--memberType--> <!-- resourceType + mixed:24 -->\n" + " <cnm>3</cnm> <!--currentNrOfMembers-->\n" + " <mnm>20</mnm> <!--maxNrOfMembers-->\n" + " <mid>//onem2m.hubiss.com/cse1/ae0001 C00001 S00001</mid> <!--memberIDs-->\n" + " <macp>3234234001 3234234002</macp> <!--membersAccessControlPolicyIDs-->\n" + " <mtv>true</mtv> <!--memberTypeValidated-->\n" + " <csy>1</csy> <!--consistencyStrategy--> <!-- ABANDON_MEMBER, ABANDON_GROUP, SET_MIXED --> \n" + " <gn>stone's home app</gn> <!--groupName-->\n" + " \n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:grp>"; String PollingChannel_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:pch xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"pcu0001\">\n" + " <ty>15</ty> <!--resourceType-->\n" + " <ri>pc_0000001</ri> <!--resourceType-->\n" + " <pi>ae_0000001</pi> <!--parentID-->\n" + " <ct>20150603T122321</ct> <!--creationTime-->\n" + " <lt>20150603T122321</lt> <!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et> <!--expirationTime-->\n" + " <pcu>http://test.org</pcu> <!--pollingChannelURI--> <!--virtual resource to receive long polling request of related ae/cse -->\n" + "</m2m:pch>"; String Subscription_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:sub xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"subscription0001\">\n" + " <ty>23</ty> <!--resourceType-->\n" + " <ri>subs_000321</ri> <!--resourceID-->\n" + " <pi>ae_0001</pi> <!--parentID-->\n" + " <ct>20150603T122321</ct> <!--creationTime-->\n" + " <lt>20150603T122321</lt> <!--lastModifiedTime-->\n" + " <lbl>subscription_for_ae1</lbl> <!--labels-->\n" + " <acpi>acp0001 acp0002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et> <!--expirationTime-->\n" + " <enc>\n" + " <crb>20150603T122321</crb> <!--createdBefore-->\n" + " <cra>20150603T122321</cra> <!--createdAfter-->\n" + " <ms>20150603T122321</ms> <!--modifiedSince-->\n" + " <us>20150603T122321</us> <!--unmodifiedSince-->\n" + " <sts>10</sts> <!--stateTagSmaller-->\n" + " <stb>100</stb> <!--stateTagBigger-->\n" + " <exb>20150603T122321</exb> <!--expireBefore-->\n" + " <exa>20150603T122321</exa> <!--expireAfter-->\n" + " <sza>1024000</sza> <!--sizeAbove-->\n" + " <szb>1024</szb> <!--sizeBelow-->\n" + " <rss>1</rss> <!--rss>1</rss--> <!--resourceStatus--> <!-- childCreated -->\n" + " <net>2</net> <!--rss>2</rss--> <!--resourceStatus--> <!-- childDeleted -->\n" + " <net>3</net> <!--rss>3</rss--> <!--resourceStatus--> <!-- updated -->\n" + " <net>4</net> <!--rss>4</rss--> <!--resourceStatus--> <!-- deleted -->\n" + " <om>1</om> <!--operationMonitor--> <!-- create -->\n" + " <om>2</om> <!--operationMonitor--> <!-- retrieve -->\n" + " <om>3</om> <!--operationMonitor--> <!-- update -->\n" + " <om>4</om> <!--operationMonitor--> <!-- delete -->\n" + " <om>5</om> <!--operationMonitor--> <!-- notify -->\n" + " <atr>\n" + " <nm>creator</nm> <!--name>creator</name-->\n" + " <val>2342134234</val> <!--value>2342134234</value-->\n" + " </atr> <!--attribute-->\n" + " <atr>\n" + " <nm>accessControlPolicyIDs</nm> <!--name>accessControlPolicyIDs</name-->\n" + " <val>3234234001</val> <!--value>3234234001</value-->\n" + " </atr> <!--attribute-->\n" + " </enc> <!--eventNotificationCriteria-->\n" + " <exc>100</exc> <!--expirationCounter-->\n" + " <nu>http://10.101.101.111:8080/notify http://10.101.101.112:8080/notify</nu> <!--notificationURI-->\n" + " <gpi>//onem2m.herit.net/csebase/group001</gpi> <!--groupID-->\n" + " <nfu>http://10.101.101.111:8080/notify</nfu> <!--notificationForwardingURI-->\n" + " <bn>\n" + " <num>10</num>\n" + " <dur>P1Y2M2DT10H30M</dur>\n" + " </bn> <!--batchNotify-->\n" + " <rl>\n" + " <mnn>50</mnn> <!--maxNrOfNotify>50</maxNrOfNotify-->\n" + " <tww>P1Y2M2DT10H30M</tww> <!--timeWindow>P1Y2M2DT10H30M</timeWindow-->\n" + " </rl> <!--rateLimit-->\n" + " <psn>20</psn> <!--preSubscriptionNotify-->\n" + " <pn>1</pn> <!--pendingNotification--> <!-- 1:sendLatest, 2:sendAllPending -->\n" + " <nsp>2</nsp> <!--notificationStoragePriority-->\n" + " <ln>true</ln> <!--latestNotify-->\n" + " <nct>3</nct> <!--notificationContentType--> <!-- 1:modifiedAttributes, 2:wholeResource, 3:referenceOnly -->\n" + " <nec>3</nec> <!--notificationEventCat--> <!-- 1:Default, 2:Immediate, 3:BestEffort, 4:Latest -->\n" + " <cr>//onem2m.herit.net/csebase/ae0001</cr> <!--creator-->\n" + " <su>http://www.altova.com/</su> <!--subscriberURI-->\n" + " \n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:sub>"; String AEAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:aeA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"aea_1\">\n" + " <ty>10002</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>hubiss home app1</lbl> --> <!--labels-->\n" + " <!-- <acpi>3234234001 3234234002</acpi> --> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime--> \n" + " <link>//homeiot.herit.net/csebase/ae1</link>\n" + " <!-- <apn>onem2mPlatformAdmin</apn> --> <!--appName-->\n" + " <!-- <api>C[authority-ID]/[registered-App-ID]</api> --> <!--App-ID-->\n" + " <!-- <aei>//onem2m.herit.net/csebase/ae0001</aei> --> <!--AE-ID-->\n" + " <poa>http://10.101.101.12:8090</poa>\n" + " <!-- <or>[ontology access url]</or> --> <!--ontologyRef-->\n" + " <!-- <nl>//onem2m.herit.net/csebase/node0001</nl> --> <!--nodeLink-->\n" + "\n" + " <!--" + " <subscription>0..n</subscription>\n" + " <container>0..n</container>\n" + " <containerAnnc>0..n</containerAnnc>\n" + " <group>0..n</group>\n" + " <groupAnnc>0..n</groupAnnc>\n" + " <accessControlPolicy>0..n</accessControlPolicy>\n" + " <accessControlPolicyAnnc>0..n</accessControlPolicyAnnc>\n" + " <pollingChannel>0..n</pollingChannel>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"container0001\" typ=\"3\">/container0001</ch>\n" + " <ch nm=\"containerAnnc0001\" typ=\"10003\">/containerAnnc0001</ch>\n" + " <ch nm=\"group0001\" typ=\"9\">/group0001</ch>\n" + " <ch nm=\"groupAnnc0001\" typ=\"10009\">/groupAnnc0001</ch>\n" + " <ch nm=\"accessControlPolicy0001\" typ=\"1\">/accessControlPolicy0001</ch>\n" + " <ch nm=\"accessControlPolicyAnnc0001\" typ=\"10001\">/accessControlPolicyAnnc0001</ch>\n" + " <ch nm=\"pollingChannel0001\" typ=\"15\">/pollingChannel0001</ch>\n" + "</m2m:aeA>"; String AccessControlPolicyAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:acpA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"acpAnnc001\">\n" + " <ty>13</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!--<labels>acpForHomeSvc</labels>-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/acp1</link><!--link-->\n" + " \n" + " <pv>\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor><!--accessControlOriginators-->\n" + " <acop>63</acop> <!-- Create + Retrieve + Update + Delete + Notify + Discover --> <!--accessControlOperations-->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw><!--accessControlWindow-->\n" + " <actw>* * 11-15 * * *</actw><!--accessControlWindow-->\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4><!--ipv4Addresses-->\n" + " <!-- <ipv6Addresses>::</ipv6Addresses> -->\n" + " </acip><!--accessControlIpAddresses-->\n" + " <aclr>\n" + " <accc>KR</accc><!--countryCode-->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr><!--circRegion-->\n" + " </aclr><!--accessControlLocationRegion-->\n" + " </acco><!--accessControlContexts-->\n" + " </acr><!--accessControlRule-->\n" + " <acr>\n" + " <acor>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acor><!--accessControlOriginators-->\n" + " <acop>2</acop> <!-- Retrieve --> <!--accessControlOperations-->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw><!--accessControlWindow-->\n" + " <actw>* * 11-15 * * *</actw><!--accessControlWindow-->\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4><!--ipv4Addresses-->\n" + " <!-- <ipv6Addresses>::</ipv6Addresses> -->\n" + " </acip><!--accessControlIpAddresses-->\n" + " <aclr>\n" + " <accc>KR</accc><!--countryCode-->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr><!--circRegion-->\n" + " </aclr><!--accessControlLocationRegion-->\n" + " </acco><!--accessControlContexts-->\n" + " </acr><!--accessControlRule-->\n" + " </pv><!--privileges-->\n" + " <pvs>\n" + " <acr>\n" + " <acop>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acop><!--accessControlOriginators-->\n" + " <acop>63</acop> <!-- Create + Retrieve + Update + Delete + Notify + Discover --> <!--accessControlOperations-->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw><!--accessControlWindow-->\n" + " <actw>* * 11-15 * * *</actw><!--accessControlWindow-->\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4><!--ipv4Addresses-->\n" + " <!-- <ipv6Addresses>::</ipv6Addresses> -->\n" + " </acip><!--accessControlIpAddresses-->\n" + " <aclr>\n" + " <accc>KR</accc><!--countryCode-->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr><!--circRegion-->\n" + " </aclr><!--accessControlLocationRegion-->\n" + " </acco><!--accessControlContexts-->\n" + " </acr><!--accessControlRule-->\n" + " <acr>\n" + " <acop>onem2m.herit.net //onem2m.hubiss.com/csebase/ae1 //onem2m.hubiss.com/cse1</acop><!--accessControlOriginators-->\n" + " <acop>2</acop> <!-- Retrieve --> <!--accessControlOperations-->\n" + " <acco>\n" + " <actw>* * 1-5 * * *</actw><!--accessControlWindow-->\n" + " <actw>* * 11-15 * * *</actw><!--accessControlWindow-->\n" + " <acip>\n" + " <ipv4>1.1.1.1 1.1.1.2</ipv4><!--ipv4Addresses-->\n" + " <!-- <ipv6Addresses>::</ipv6Addresses> -->\n" + " </acip><!--accessControlIpAddresses-->\n" + " <aclr>\n" + " <accc>KR</accc><!--countryCode-->\n" + " <accr>3.1415901184082031 3.1415901184082031 3.1415901184082031</accr><!--circRegion-->\n" + " </aclr><!--accessControlLocationRegion-->\n" + " </acco><!--accessControlContexts-->\n" + " </acr><!--accessControlRule-->\n" + " </pvs><!--selfPrivileges-->\n" + "</m2m:acpA>"; String ContainerAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:cntA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"containerAnnc001\">\n" + " <ty>10003</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime--> \n" + " <link>//homeiot.herit.net/csebase/container001</link>\n" + " <st>0</st> <!--stateTag-->\n" + " <mni>100</mni> <!--maxNrOfInstances-->\n" + " <mbs>1024000</mbs> <!--maxByteSize-->\n" + " <mia>36000</mia> <!--maxInstanceAge-->\n" + " <cni>10</cni> <!--currentNrOfInstances-->\n" + " <cbs>10240</cbs> <!--currentByteSize-->\n" + " <li>//onem2m.hubiss.com/cseBase/lp1</li> <!--locationID-->\n" + " <or>[ontology access url]</or> <!--ontologyRef-->\n" + " \n" + " <!--" + " <container>0..n</container>\n" + " <containerAnnc>0..n</containerAnnc>\n" + " <contentInstance>0..n</contentInstance>\n" + " <contentInstanceAnnc>0..n</contentInstanceAnnc>\n" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"container0001\" typ=\"3\">/container0001</ch>\n" + " <ch nm=\"containerAnnc0001\" typ=\"10003\">/containerAnnc0001</ch>\n" + " <ch nm=\"contentInstance0001\" typ=\"4\">/contentInstance0001</ch>\n" + " <ch nm=\"contentInstanceAnnc0001\" typ=\"10004\">/contentInstanceAnnc0001</ch>\n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:cntA>"; String ContentInstanceAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:cinA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"cinA_001\">\n" + " <ty>10004</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/container001/ci001</link>\n" + " <st>0</st> <!--stateTag-->\n" + " <cnf>application/txt:0</cnf> <!--contentInfo-->\n" + " <cs>2</cs> <!--contentSize-->\n" + " <or>[ontology access url]</or> <!--ontologyRef-->\n" + " <con>on</con> <!--content-->\n" + "</m2m:cinA>"; String Delivery_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:dlv xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-delivery-v1_0_0.xsd\" rn=\"dlv_0001\">\n" + " <ty>4</ty><!--resourceType-->\n" + " <ri>deli_0000001</ri><!--resourceID-->\n" + " <pi>csebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>delivery1</lbl> <!--labels-->\n" + " <acpi>http://www.altova.com/</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <st>0</st><!--stateTag-->\n" + " <sr>gw_00000001</sr><!--source-->\n" + " <tg>gw_00000002</tg><!--target-->\n" + " <ls>20150603T122321</ls><!--lifespan-->\n" + " <ec>1 <!-- Default:1, Immediate:2, BestEffort:3, 4:Latest --></ec><!--eventCat-->\n" + " <dmd>\n" + " <tcop>true</tcop><!--tracingOption-->\n" + " <tcin>http://www.altova.com/</tcin><!--tracingInfo-->\n" + " </dmd><!--deliveryMetaData-->\n" + " <arq>\n" + " <req>1..n</req> <!--request-->\n" + " </arq><!--aggregatedRequest-->\n" + "</m2m:dlv>"; String EventConfig_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:evcg xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-eventConfig-v1_0_0.xsd\" rn=\"evcg_0001\">\n" + " <ty>16</ty><!--resourceType-->\n" + " <ri>evtcfg_00001/</ri><!--resourceID-->\n" + " <pi>csebase/</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>evtcfg </lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <cr>gw_000001</cr><!--creator-->\n" + " <evi>evt_00001</evi><!--eventID-->\n" + " <evt>3</evt> <!-- Data Operation:1, Storage based:2, Timer Based --> <!--eventType-->\n" + " <evs>20150603T122321</evs> <!--eventStart-->\n" + " <eve>20150603T122321</eve> <!--eventEnd-->\n" + " <opt>4</opt> <!--C:1, R:2, U:3, D:4, N:5--> <!--operationType-->\n" + " <ds>0</ds> <!--dataSize-->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:evcg>"; String ExecInstance_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:exin xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-execInstance-v1_0_0.xsd\" rn=\"exin_001\">\n" + " <ty>9</ty><!--resourceType-->\n" + " <ri>execi_0000001</ri><!--resourceID-->\n" + " <pi>mgmtcmd_000001</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>ei1 ei2</lbl> <!--labels-->\n" + " <acpi>acp0001</acpi><!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <exs>6</exs> <!-- INITIATED:1, PENDING:2, FINISHED:3, CANCELLING:4, CANCELLED:5, STATUS_ NON_CANCELLABLE:6 --> <!--execStatus-->\n" + " <exr>9</exr> <!-- STATUS_REQUEST_UNSUPPORTED:1, ~ STATUS_INVALID_DEPLOYMENT_UNIT_UPDATE_VERSION_EXISTS:30 --> <!--execResult-->\n" + " <exd>true</exd> <!--execDisable-->\n" + " <ext>token</ext><!--execTarget-->\n" + " <exm>2</exm> <!-- IMMEDIATEONCE:1, IMMEDIATEREPEAT:2, RANDOMONCE:3, RANDOMREPEAT:4 --> <!--execMode-->\n" + " <exf>P1Y2M2DT10H30M</exf> <!--execFrequency-->\n" + " <exy>P1Y2M2DT10H30M</exy> <!--execDelay-->\n" + " <exn>0</exn> <!--execNumber-->\n" + " <exra>\n" + " <rst>\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </rst> <!-- reset -->\n" + " <rbo>\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </rbo> <!-- reboot -->\n" + " <uld>\n" + " <ftyp>String</ftyp> <!-- fileType -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </uld> <!-- upload -->\n" + " <dld>\n" + " <ftyp>String</ftyp> <!-- fileType -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <fsi>33</fsi> <!-- filesize -->\n" + " <tgf>String</tgf> <!-- targetFile -->\n" + " <dss>0</dss> <!-- delaySeconds -->\n" + " <surl>http://www.altova.com/</surl> <!-- successURL -->\n" + " <stt>00000101T000000</stt> <!-- startTime -->\n" + " <cpt>00000101T000000</cpt> <!-- completeTime -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </dld> <!-- download -->\n" + " <swin>\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swin> <!-- softwareInstall -->\n" + " <swup>\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <vr>String</vr> <!-- version -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swup> <!-- softwareUpdate -->\n" + " <swun>\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <vr>String</vr> <!-- version -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swun> <!-- softwareUninstall --> \n" + " </exra> <!--execReqArgs-->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:exin>"; String GroupAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:grpA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"grpA_001\">\n" + " <ty>10009</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl><!--labels-->\n" + " <acpi>3234234001 3234234002</acpi><!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/group001</link>\n" + " <mt>2</mt> <!--memberType-->\n" + " <cnm>3</cnm> <!--currentNrOfMembers-->\n" + " <mnm>20</mnm> <!--maxNrOfMembers-->\n" + " <mid>//onem2m.hubiss.com/cse1/ae0001 C00001 S00001</mid> <!--memberIDs-->\n" + " <macp>3234234001 3234234002</macp> <!--membersAccessControlPolicyIDs-->\n" + " <mtv>true</mtv> <!--memberTypeValidated-->\n" + " <csy>1</csy> <!-- ABANDON_MEMBER, ABANDON_GROUP, SET_MIXED --> <!--consistencyStrategy-->\n" + " <gn>stone's home app</gn> <!--groupName-->\n" + "\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:grpA>"; String LocationPolicy_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:lcp xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"lp0001\">\n" + " <ty>10</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>locationSource locationUpdatePeriod locationTargetId locationServer locationContainerID locationContainerName locationStatus </aa> <!--announcedAttribute-->\n" + " <los>1</los><!--locationSource-->\n" + " <lou>PT10M</lou> <!--locationUpdatePeriod-->\n" + " <!-- attribute for node using location server to get location -->" + " <lot>dddddaa</lot> locationTargetID\n" + " <lor>adafas</lor> locationServer\n" + " <loi>//onem2m.herit.net/csebase/ae0001/container0001</loi> <!--locationContainerID-->\n" + " <lon>locContainer001</lon> <!--locationContainerName-->\n" + " <lost>1</lost> <!-- Successful:1, Failure:2, In-Process:3 --> <!--locationStatus--> \n" + " <!-- " + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:lcp>"; String LocationPolicyAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:lcpA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"lcpA_001\">\n" + " <ty>10010</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/lp0001</link>\n" + " <los>1</los> <!--locationSource-->\n" + " <lou>PT10M</lou> <!--locationUpdatePeriod-->\n" + " <!-- attribute for -->" + " <lot>dafdaf</lot> locationTargetID\n" + " <lor>adasfd</lor> locationServer\n" + " <loi>//onem2m.herit.net/csebase/ae0001/container0001</loi> <!--locationContainerID-->\n" + " <lon>locContainer001</lon> <!--locationContainerName-->\n" + " <lost>success</lost> <!--locationStatus-->\n" + "\n" + "</m2m:lcpA>"; String M2MServiceSubscriptionProfile_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:mssp xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-m2mServiceSubscriptionProfile-v1_0_0.xsd\" rn=\"mssp_0001\">\n" + " <ty>10013</ty><!--resourceType-->\n" + " <ri>m2mSrvSubsPrf_0001/</ri><!--resourceID-->\n" + " <pi>csebase/</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>mssp1</lbl><!--labels-->\n" + " <acpi>acp0001 acp0002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <svr>04-001 07-001</svr> <!--serviceRoles-->\n" + " <!-- " + " <subscription>0..n</subscription>\n" + " <serviceSubscriptionNode>0..n</serviceSubscribedNode>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"serviceSubscriptionNode0001\" typ=\"20\">/serviceSubscriptionNode0001</ch>\n" + "</m2m:mssp>"; String MgmtCmd_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:mgc xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-mgmtCmd-v1_0_0.xsd\" rn=\"mgc_0001\">\n" + " <ty>8</ty><!--resourceType-->\n" + " <ri>mgmtcmd_00001</ri><!--resourceID-->\n" + " <pi>node_00000001</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>reset cmd</lbl> <!--labels-->\n" + " <acpi>acp0001 acp0002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <dc>reset command</dc> <!--description-->\n" + " <cmt>1</cmt> <!-- RESET:1, REBOOT:2, UPLOAD:3, DODWNLOAD:4, SWINSTAQLL:5, SWUNINSTALL:6, SWUPDATE:7 --> <!--cmdType-->\n" + " <exe>true</exe><!--execEnable-->\n" + " <ext>node_00001</ext><!--execTarget-->\n" + " <exm>2</exm> <!-- IMMEDIATEONCE:1, IMMEDIATEREPEAT:2, RANDOMONCE:3, RANDOMREPEAT:4 --> <!--execMode-->\n" + " <exf>P1Y2M2DT10H30M</exf> <!--execFrequency-->\n" + " <exy>P1Y2M2DT10H30M</exy><!--execDelay-->\n" + " <exn>0</exn> <!--execNumber-->\n" + " <exra>\n" + " <rst>\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </rst> <!-- reset -->\n" + " <rbo>\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </rbo> <!-- reboot -->\n" + " <uld>\n" + " <ftyp>String</ftyp> <!-- fileType -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </uld> <!-- upload -->\n" + " <dld>\n" + " <ftyp>String</ftyp> <!-- fileType -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <fsi>String</fsi> <!-- filesize -->\n" + " <tgf>String</tgf> <!-- targetFile -->\n" + " <dss>0</dss> <!-- delaySeconds -->\n" + " <surl>http://www.altova.com/</surl> <!-- successURL -->\n" + " <stt>00000101T000000</stt> <!-- startTime -->\n" + " <cpt>00000101T000000</cpt> <!-- completeTime -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </dld> <!-- download -->\n" + " <swin>\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swin> <!-- softwareInstall -->\n" + " <swup>\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <vr>String</vr> <!-- version -->\n" + " <url>http://www.altova.com/</url> <!-- URL -->\n" + " <unm>String</unm> <!-- username -->\n" + " <pwd>String</pwd> <!-- password -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swup> <!-- softwareUpdate -->\n" + " <swun>\n" + " <uuid>String</uuid> <!-- UUID -->\n" + " <vr>String</vr> <!-- version -->\n" + " <eer>String</eer> <!-- executionEnvRef -->\n" + " <any>\n" + " <nm>NCName</nm> <!-- name -->\n" + " <val>text</val> <!-- value -->\n" + " </any> <!-- anyArg -->\n" + " </swun> <!-- softwareUninstall -->\n" + " </exra> <!-- execReqArgs -->\n" + " -->\n" + "\n" + " <!--" + " <subscription>0..n</subscription>\n" + " <execInstance>1</execInstance>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"execInstance0001\" typ=\"8\">/execInstance0001</ch>\n" + "</m2m:mgc>"; String Node_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:nod xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"nod_0001\">\n" + " <ty>14</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>hostedCSELink</aa> <!--announcedAttribute-->\n" + " <ni>900001-HERITGW01-GW00001</ni><!--nodeID-->\n" + " <hcl>/csebase/cse0001</hcl> <!--hostedCSELink-->\n" + " <!--" + " <memory>0..1</memory> - mgmtObj\n" + " <battery>0..n</battery> - mgmtObj\n" + " <areaNwkInfo>0..n</areaNwkInfo> - mgmtObj\n" + " <areaNwkDeviceInfo>0..n</areaNwkDeviceInfo> - mgmtObj\n" + " <firmware>0..n</firmware> - mgmtObj\n" + " <software>0..n</software> - mgmtObj\n" + " <deviceInfo>0..n</deviceInfo> - mgmtObj\n" + " <deviceCapability>0..n</deviceCapability> - mgmtObj\n" + " <reboot>0..1</reboot> - mgmtObj\n" + " <eventLog>0..1</eventLog> - mgmtObj\n" + " <cmdhPolicy>0..n</cmdhPolicy> - mgmtObj\n" + " <activeCmdhPolicy>0..n</activeCmdhPolicy> - mgmtObj\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"memory0001\" typ=\"10013\">/memory0001</ch>\n" + " <ch nm=\"battery0001\" typ=\"10013\">/battery0001</ch>\n" + " <ch nm=\"areaNwkInfo0001\" typ=\"10013\">/areaNwkInfo0001</ch>\n" + " <ch nm=\"areaNwkDeviceInfo0001\" typ=\"10013\">/areaNwkDeviceInfo0001</ch>\n" + " <ch nm=\"firmware0001\" typ=\"10013\">/firmware0001</ch>\n" + " <ch nm=\"software0001\" typ=\"10013\">/software0001</ch>\n" + " <ch nm=\"deviceInfo0001\" typ=\"10013\">/deviceInfo0001</ch>\n" + " <ch nm=\"deviceCapability0001\" typ=\"10013\">/deviceCapability0001</ch>\n" + " <ch nm=\"reboot0001\" typ=\"10013\">/reboot0001</ch>\n" + " <ch nm=\"eventLog0001\" typ=\"10013\">/eventLog0001</ch>\n" + " <ch nm=\"cmdhPolicy0001\" typ=\"10013\">/cmdhPolicy0001</ch>\n" + " <ch nm=\"activeCmdhPolicy0001\" typ=\"10013\">/activeCmdhPolicy0001</ch>\n" + "</m2m:nod>"; String NodeAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:nodA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"nodA_0001\">\n" + " <ty>10014</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>3234234292</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTimelastModifiedTime-->\n" + " <lt>20150603T122321</lt>\n" + " <lbl>hubiss admin</lbl> <!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/node001</link>\n" + " <ni>900001-HERITGW01-GW00001</ni><!--nodeID-->\n" + " <hcl>/csebase/cse0001</hcl> <!--hostedCSELink-->\n" + " <!--" + " <memory>0..1</memory> - mgmtObjAnnc\n" + " <battery>0..n</battery> - mgmtObjAnnc\n" + " <areaNwkInfo>0..n</areaNwkInfo> - mgmtObjAnnc\n" + " <areaNwkDeviceInfo>0..n</areaNwkDeviceInfo> - mgmtObjAnnc\n" + " <firmware>0..n</firmware> - mgmtObjAnnc\n" + " <software>0..n</software> - mgmtObjAnnc\n" + " <deviceInfo>0..n</deviceInfo> - mgmtObjAnnc\n" + " <deviceCapability>0..n</deviceCapability> - mgmtObjAnnc\n" + " <reboot>0..1</reboot> - mgmtObjAnnc\n" + " <eventLog>0..1</eventLog> - mgmtObjAnnc\n" + " <cmdhPolicy>0..n</cmdhPolicy> - mgmtObjAnnc\n" + " <activeCmdhPolicy>0..n</activeCmdhPolicy> - mgmtObjAnnc\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"memory0001\" typ=\"10013\">/memory0001</ch>\n" + " <ch nm=\"battery0001\" typ=\"10013\">/battery0001</ch>\n" + " <ch nm=\"areaNwkInfo0001\" typ=\"10013\">/areaNwkInfo0001</ch>\n" + " <ch nm=\"areaNwkDeviceInfo0001\" typ=\"10013\">/areaNwkDeviceInfo0001</ch>\n" + " <ch nm=\"firmware0001\" typ=\"10013\">/firmware0001</ch>\n" + " <ch nm=\"software0001\" typ=\"10013\">/software0001</ch>\n" + " <ch nm=\"deviceInfo0001\" typ=\"10013\">/deviceInfo0001</ch>\n" + " <ch nm=\"deviceCapability0001\" typ=\"10013\">/deviceCapability0001</ch>\n" + " <ch nm=\"reboot0001\" typ=\"10013\">/reboot0001</ch>\n" + " <ch nm=\"eventLog0001\" typ=\"10013\">/eventLog0001</ch>\n" + " <ch nm=\"cmdhPolicy0001\" typ=\"10013\">/cmdhPolicy0001</ch>\n" + " <ch nm=\"activeCmdhPolicy0001\" typ=\"10013\">/activeCmdhPolicy0001</ch>\n" + "</m2m:nodA>"; String RemoteCSEAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:csrA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-remoteCSE-v1_0_0.xsd\" rn=\"csrA_0001\">\n" + " <ty>10016</ty><!--resourceType-->\n" + " <ri>3234234293</ri><!--resourceID-->\n" + " <pi>csebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>hubiss home app1</lbl><!--labels-->\n" + " <acpi>3234234001 3234234002</acpi> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase</link>\n" + " <cst>1</cst> <!--cseType-->\n" + " <poa>http://10.101.101.12:8090</poa> <!--pointOfAccess-->\n" + " <cb>//onem2m.herit.net/gw01/csebase</cb> <!--CSEBase-->\n" + " <csi>cse000012</csi> <!--CSE-ID-->\n" + " <rr>true</rr> <!--requestReachability-->\n" + " <nl>//onem2m.herit.net/csebase/node0001</nl> <!--nodeLink-->\n" + " <!--" + " <AE>0..n</AE>\n" + " <AEAnnc>0..n</AEAnnc>\n" + " <container>0..n</container>\n" + " <containerAnnc>0..n</containerAnnc>\n" + " <group>0..n</group>\n" + " <groupAnnc>0..n</groupAnnc>\n" + " <accessControlPolicy>0..n</accessControlPolicy>\n" + " <accessControlPolicyAnnc>0..n</accessControlPolicyAnnc>\n" + " <subscription>0..n</subscription>\n" + " <schedule>0..1</schedule>\n" + " <pollingChannel>0..1</pollingChannel>\n" + " <nodeAnnc>0..1</nodeAnnc>\n" + " <locationPolicyAnnc>0..n</locationPolicyAnnc>\n" + " -->" + " <ch nm=\"AE0001\" typ=\"2\">/AE0001</ch>\n" + " <ch nm=\"AEAnnc0001\" typ=\"10002\">/AEAnnc0001</ch>\n" + " <ch nm=\"container0001\" typ=\"3\">/container0001</ch>\n" + " <ch nm=\"containerAnnc0001\" typ=\"10003\">/containerAnnc0001</ch>\n" + " <ch nm=\"group0001\" typ=\"9\">/group0001</ch>\n" + " <ch nm=\"groupAnnc0001\" typ=\"10009\">/groupAnnc0001</ch>\n" + " <ch nm=\"accessControlPolicy0001\" typ=\"1\">/accessControlPolicy0001</ch>\n" + " <ch nm=\"accessControlPolicyAnnc0001\" typ=\"10001\">/accessControlPolicyAnnc0001</ch>\n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + " <ch nm=\"schedule0001\" typ=\"18\">/schedule0001</ch>\n" + " <ch nm=\"pollingChannel0001\" typ=\"15\">/pollingChannel0001</ch>\n" + " <ch nm=\"nodeAnnc0001\" typ=\"10014\">/nodeAnnc0001</ch>\n" + " <ch nm=\"locationPolicyAnnc0001\" typ=\"10010\">/locationPolicyAnnc0001</ch>\n" + "</m2m:csrA>"; String Request_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:req xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-request-v1_0_0.xsd\" rn=\"req_0001\">\n" + " <ty>12</ty><!--resourceType-->\n" + " <ri>req_000000001</ri><!--resourceID-->\n" + " <pi>csebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <lbl>req01 label</lbl> <!--labels-->\n" + " <acpi>acp001 acp002</acpi> <!--accessControlPolicyIDs-->\n" + " <st>0</st><!--stateTag-->\n" + " <opn>1</opn><!--operation-->\n" + " <tg>//iot.herit.net/gw00001</tg><!--target-->\n" + " <og>//iot.herit.net/ap00001</og><!--originator-->\n" + " <rid>ap00001_req0000012</rid><!--requestID-->\n" + " <mi>\n" + " <!-- request parameters -->\n" + " <ty>4</ty><!--resourceType-->\n" + " <nm>String</nm><!--name-->\n" + " <ot>20150603T122321</ot><!--originatingTimestamp-->\n" + " <rqet>20150603T122321</rqet><!--requestExpirationTimestamp-->\n" + " <rset>20150603T122321</rset><!--resultExpirationTimestamp-->\n" + " <oet>20150603T122321</oet><!--operationalExecutionTime-->\n" + " <rt><rtv>3</rtv>\n" + " <nu>http://test.net http://test2.net</nu>\n" + " </rt><!--responseType-->\n" + " <rp>P42D</rp><!--resultPersistence-->\n" + " <rcn>1</rcn><!--resultContent-->\n" + " <ec>eventCategory\n" + " <!--<ect>3</ect> - eventCatType \n" + " <ecn>0</ecn> -eventCatNo -->" + " </ec><!--eventCategory-->\n" + " <da>true</da><!--deliveryAggregation-->\n" + " <gid>String</gid><!--groupRequestIdentifier-->\n" + " <fc>\n" + " <crb>20150603T122321</crb><!--createdBefore-->\n" + " <cra>20150603T122321</cra><!--createdAfter-->\n" + " <ms>20150603T122321</ms><!--modifiedSince-->\n" + " <us>20150603T122321</us><!--unmodifiedSince-->\n" + " <sts>2</sts><!--stateTagSmaller-->\n" + " <stb>0</stb><!--stateTagBigger-->\n" + " <exb>20150603T122321</exb><!--expireBefore-->\n" + " <exa>20150603T122321</exa><!--expireAfter-->\n" + " <lbl>token</lbl><!--labels-->\n" + " <ty>3</ty><!--resourceType-->\n" + " <sza>0</sza><!--sizeAbove-->\n" + " <szb>2</szb><!--sizeBelow-->\n" + " <cty>String</cty><!--contentType-->\n" + " <atr>\n" + " <nm>NCName</nm><!--name-->\n" + " <val>text</val><!--value-->\n" + " </atr><!--attribute-->\n" + " <fu>2</fu><!--filterUsage-->\n" + " <lim>0</lim><!--limit-->\n" + " </fc><!--filterCriteria-->\n" + " <drt>2</drt><!--discoveryResultType-->\n" + " </mi><!--metaInformation-->\n" + " <pc>\n" + " <!-- content parameter of original request -->\n" + " </pc><!--content-->\n" + " <rs>4</rs> <!-- completed:1, failed:2, pending:3, forwarded:4 --> <!--requestStatus-->\n" + " <ol>\n" + " <!-- response parameters of requset -->\n" + " <pc>\n" + " <!-- content parameter of response -->\n" + " </pc><!--content-->\n" + " <ec>4</ec><!--eventCategory-->\n" + " <fr>//target of request</fr><!--from-->\n" + " <to>//originator of request</to><!--to-->\n" + " <ot>20150603T122321</ot><!--originatingTimestamp-->\n" + " <rqi>token</rqi><!--requestIdentifier-->\n" + " <rset>20150603T122321</rset><!--resultExpirationTimestamp-->\n" + " <rsc>4005</rsc><!--responseStatusCode-->\n" + " </ol><!--operationResult-->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:req>"; String Schedule_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:sch xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-schedule-v1_0_0.xsd\" rn=\"sce_0001\">\n" + " <ty>3</ty><!--resourceType-->\n" + " <ri>schd_0001</ri><!--resourceID-->\n" + " <pi>rcse_0001</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <lbl>gw1_schedule</lbl> <!--labels-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <at>//onem2m.hubiss.com/cse1 //onem2m.hubiss.com/cse2</at> <!--announceTo-->\n" + " <aa>attr_list</aa> <!--announcedAttribute-->\n" + " <se>\n" + " <sce>* 0-5 2,6,10 * * *</sce><!--scheduleEntry-->\n" + " <!-- scheduleEntry 목록 -->\n" + " </se><!--scheduleElement-->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:sch>"; String ScheduleAnnc_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:schA xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-schedule-v1_0_0.xsd\" rn=\"schA_0001\">\n" + " <ty>10018</ty><!--resourceType-->\n" + " <ri>schdannc_0001</ri><!--resourceID-->\n" + " <pi>rcse_0001</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>gw1_schedule</lbl> --> <!--labels-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <link>//homeiot.herit.net/csebase/lp0001/schda_00001</link>\n" + " <se>\n" + " <sce>* 0-5 2,6,10 * * *</sce> scheduleEntry \n" + " </se> scheduleElement\n" + "</m2m:schA>"; String ServiceSubscribedAppRule_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:asar xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-serviceSubscribedAppRule-v1_0_0.xsd\" rn=\"ssapprule1\">\n" + " <ty>19</ty><!--resourceType-->\n" + " <ri>ssapprule_0001</ri><!--resourceID-->\n" + " <pi>casebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>ssapprule</lbl> --> <!--labels-->\n" + " <!-- <acpi>acp0001 acp0002</acpi> --> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <apci>C123*X C124*X C125*X</apci><!--applicableCredIDs-->\n" + " <aai>R111/HomeApp* R111/PublicApp*</aai> <!--allowedApp-IDs-->\n" + " <aae>S109*</aae> <!-- allowedAEs -->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:asar>"; String ServiceSubscribedNode_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:svsn xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-serviceSubscribedNode-v1_0_0.xsd\" rn=\"ssnode1\">\n" + " <ty>20</ty><!--resourceType-->\n" + " <ri>ssnode_00001</ri><!--resourceID-->\n" + " <pi>casebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>service_subscription_node</lbl> --> <!--labels-->\n" + " <!-- <acpi>acp0001 acp0002 acp0003</acpi> --> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <ni>FFFFDDDD0EB0</ni><!--nodeID-->\n" + " <csi>CSE00001</csi> <!-- CSE-ID -->\n" + " <di>urn:dev:ops:001122-HERITGW1-GW0032432 urn:dev:ops:001122-HERITGW1-GW0032433 urn:dev:ops:001122-HERITGW1-GW0032434</di> <!-- deviceIdentifier -->\n" + " <ruleLinks>ssapprule_0001 ssapprule_0002 ssapprule_0003</ruleLinks> <!-- When empty, no applications are allowed to register on the CSE indicated by the CSE-ID attribute -->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:svsn>"; String StatsCollect_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:stcl xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-statsCollect-v1_0_0.xsd\" rn=\"statcol_00001\">\n" + " <ty>21</ty><!--resourceType-->\n" + " <ri>statcol_00001</ri><!--resourceID-->\n" + " <pi>csebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>stat_collect_1</lbl> --> <!--labels-->\n" + " <!-- <acpi>acp0001 acp0002</acpi> --> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <cr>incse_herit</cr><!--creator-->\n" + " <sci>stat_id_00001</sci><!--statsCollectID-->\n" + " <cei>ae_id_of_accountingsystem</cei><!--collectingEntityID-->\n" + " <cdi>S190XX7T</cdi><!--collectedEntityID-->\n" + " <srs>1</srs> <!-- 1:Active, 2:Inactive --> <!--statsRuleStatus-->\n" + " <sm>1</sm> <!-- 1:eventbased --> <!--statModel-->\n" + " <cp>\n" + " <sce>* 0-5 2,6,10 * * *</sce> <!-- scheduleEntry -->\n" + " <sce>* * 8-20 * * *</sce> <!-- scheduleEntry --> \n" + " </cp> <!-- collectPeriod -->\n" + " <evi>eventcfg_id_0001</evi> <!-- eventID -->\n" + " <!--" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:stcl>"; String StatsConfig_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--Sample XML file generated by XMLSpy v2015 rel. 3 sp1 (http://www.altova.com)-->\n" + "<m2m:stcg xmlns:m2m=\"http://www.onem2m.org/xml/protocols\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.onem2m.org/xml/protocols CDT-statsConfig-v1_0_0.xsd\" rn=\"statconfig1\">\n" + " <ty>22</ty><!--resourceType-->\n" + " <ri>statconfig_0001</ri><!--resourceID-->\n" + " <pi>csebase</pi><!--parentID-->\n" + " <ct>20150603T122321</ct><!--creationTime-->\n" + " <lt>20150603T122321</lt><!--lastModifiedTime-->\n" + " <!-- <lbl>stat_config</lbl> --> <!--labels-->\n" + " <!-- <acpi>acp0001 acp0002</acpi> --> <!--accessControlPolicyIDs-->\n" + " <et>20150603T122321</et><!--expirationTime-->\n" + " <cr>incse_id_or_inae_id</cr><!--creator-->\n" + " <!--" + " <eventConfig>0..n</eventConfig>\n" + " <subscription>0..n</subscription>\n" + " -->" + " <ch nm=\"eventConfig0001\" typ=\"7\">/eventConfig0001</ch>\n" + " <ch nm=\"subscription0001\" typ=\"23\">/subscription0001</ch>\n" + "</m2m:stcg>"; try { //----------------------------------------------------------------------------------------- String xml2; // XMLConvertor<AE> XC = new XMLConvertor<AE>(AE.class); // AE ae = (AE)XC.unmarshal(AE_xml); // System.out.println("resourceName: " + ae.getResourceName()); // // List<Resource> resources = ae.getContainerOrGroupOrAccessControlPolicy(); // Container container = new Container(); // container.setStateTag(BigInteger.TEN); // resources.add(container); // Group group = new Group(); // group.setCreator("test"); // resources.add(group); // // xml2 = XC.marshal(ae, AE.SCHEMA_LOCATION); // System.out.println("xml2: " + xml2); //----------------------------------------------------------------------------------------- // AE, Container, ContentInstance, RemoteCSE, AccessControlPolicy, CSEBase, Group // PollingChannel, Subscription, AEAnnc, AccessControlPolicyAnnc, ContainerAnnc // ContentInstanceAnnc, Delivery, EventConfig, ExecInstance, GroupAnnc // LocationPolicy, LocationPolicyAnnc, M2MServiceSubscriptionProfile, MgmtCmd, MgmtObj(?????), MgmtObjAnnc(??????) // Node, NodeAnnc, RemoteCSEAnnc, Request, Schedule, ScheduleAnnc, ServiceSubscribedAppRule // ServiceSubscribedNode, StatsCollect, StatsConfig XMLConvertor<AE> XC2 = new XMLConvertor<AE>(AE.class, AE.SCHEMA_LOCATION); AE resource = (AE)XC2.unmarshal(AE_xml); if(resource.getPointOfAccess() == null) System.out.println("PointOfAccess is null: " + resource.getPointOfAccess()); else System.out.println("PointOfAccess is " + resource.getPointOfAccess()); System.out.println("resourceName: " + resource.getResourceName()); xml2 = XC2.marshal(resource); System.out.println(xml2); //System.out.println(resource.getChildResource().get(0).getValue()); JSONConvertor<AE> JC = new JSONConvertor<AE>(AE.class); String json = JC.marshal(resource); System.out.println(json); System.out.println(Double.valueOf((Double)3.1415923332233335)); } catch (Exception e) { e.printStackTrace(); } } }
[ "inseuk.lee@gmail.com" ]
inseuk.lee@gmail.com
7eac2ca94fed679a0cbac9c2b1d5a25102b5ffad
1af7e61bf45e3e533281e4f1987508f6786c7100
/src/com/keinye/learn/object/basic/Overload.java
9c7073ac5c55367ea92ba4525cb5a383fb1e7a06
[]
no_license
keinYe/learnJava
bb76b168cd206b2bdc3b309b65a79103c60f4a23
9ce7673d1b4c0f1b5555bfe33d903699e75f2cdc
refs/heads/master
2023-03-10T11:35:36.771548
2021-02-27T12:24:11
2021-02-27T12:24:11
330,670,857
0
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
package com.keinye.learn.object.basic; /** * 重载方法 * * @author keinYe * * 多个方法它们具有相同的方法名,完成相似的功能,只在参数上存在区别 这类方法我们称为方法重载 重载方法必须具有相同的返回参数 */ public class Overload { public static void main(String[] args) { hello(); hello("Jack"); hello("Jack", 15); hello("Lucy", 20); Person2 p1 = new Person2(); Person2 p2 = new Person2(); p1.setName("xiao ming"); p2.setName("xiao", "hong"); System.out.println(p1.getName()); System.out.println(p2.getName()); } public static void hello() { System.out.println("Hello World!"); } public static void hello(String name) { System.out.println("Hello, " + name + "!"); } public static void hello(String name, int age) { if (age < 18) { System.out.println("Hi, " + name + "!"); } else { System.out.println("Hello, " + name + "!"); } } } class Person2 { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public void setName(String fist, String last) { this.name = fist + " " + last; } }
[ "keinye.dev@gmail.com" ]
keinye.dev@gmail.com
4d474c6b21f530b2d3a460401a1f6e5be0e77999
c8be3ecd0d6c20fe89c64a356801071eb659aec8
/Selenium_Docker/src/main/java/com/app/booking/pages/RegistrationConfirmationPage.java
795dc79f41b5d947b42123a552d9e56ca609e7e1
[ "MIT" ]
permissive
LakshminarayananG/Selenium_Docker
72a6aee5ce1dcf93eb20761c89019cb18e84633f
4d785e57dd5ab841c41968cede8edb7fd48e15e1
refs/heads/master
2023-07-26T14:56:13.480736
2021-09-06T18:16:08
2021-09-06T18:16:08
403,242,272
2
0
null
null
null
null
UTF-8
Java
false
false
857
java
package com.app.booking.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class RegistrationConfirmationPage { private WebDriver driver; private WebDriverWait wait; @FindBy(partialLinkText = "sign-in") private WebElement signInLink; @FindBy(id = "flight-link") private WebElement flightsLink; public RegistrationConfirmationPage(WebDriver driver) { this.driver = driver; this.wait = new WebDriverWait(driver, 30); PageFactory.initElements(driver, this); } public void navigateToFlightsPage() { this.wait.until(ExpectedConditions.visibilityOf(signInLink)); this.flightsLink.click(); } }
[ "lakshnarayanan7@gmail.com" ]
lakshnarayanan7@gmail.com
c1378c7234680996fa515bc40c2cc08fc9c8ea14
ffbab2d79f6afd8ca1af36e6ba19ebc661abb2b8
/com/miui/analytics/internal/collection/k.java
0af963bce8858148f4413afee9fb94abf851f850
[]
no_license
amirzaidi/MIUIAnalytics
a682c69fbd49f2f11711bfe1e44390a9fb304f25
950fd3c0fb835cf07c01893e5ce8ce40d7f88edb
refs/heads/master
2020-03-19T05:33:21.968687
2018-06-03T21:49:38
2018-06-03T21:49:38
135,943,390
1
2
null
null
null
null
UTF-8
Java
false
false
16,423
java
package com.miui.analytics.internal.collection; import android.app.usage.UsageEvents.Event; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageInfo; import android.os.Build.VERSION; import android.text.TextUtils; import android.util.Log; import com.miui.analytics.internal.LogEvent; import com.miui.analytics.internal.b; import com.miui.analytics.internal.f; import com.miui.analytics.internal.util.ab; import com.miui.analytics.internal.util.ac; import com.miui.analytics.internal.util.ae; import com.miui.analytics.internal.util.c; import com.miui.analytics.internal.util.g; import com.miui.analytics.internal.util.j; import com.miui.analytics.internal.util.n; import com.miui.analytics.internal.util.o; import com.miui.analytics.internal.util.u; import com.miui.analytics.internal.util.v; import com.miui.analytics.internal.util.y; import com.miui.analytics.internal.util.z; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.json.JSONArray; import org.json.JSONObject; public class k { private static final String A = "its"; private static volatile k B = null; private static final Object F = new Object(); private static boolean G = false; public static boolean a = false; public static final String b = "P"; public static final String c = "T"; public static final String d = "C"; private static final String e = "UU"; private static final String f = "tz"; private static final String g = "si"; private static final String h = "ts"; private static final String i = "U"; private static final String j = "I"; private static final String k = "n"; private static final String l = "v"; private static final String m = "vn"; private static final String n = "s"; private static final String o = "b"; private static final String p = "lut"; private static final String q = "fit"; private static final String r = "p"; private static final String s = "t"; private static final String t = "e"; private static final String u = "eot"; private static final String v = "pim"; private static final String w = "es"; private static final String x = "{}"; private static final int y = 6; private static final String z = "il"; private v C; private j D; private Context E; private k(Context context) { this.E = c.a(context); this.C = new v(context, u.d); this.D = new j(context, z); } public static synchronized k a(Context context) { k kVar; synchronized (k.class) { if (B == null) { B = new k(context); } kVar = B; } return kVar; } public void a() { if (!n.a(this.E, e)) { if (!g.D()) { o.a(e, "Upload usage V1 is disabled by remote."); } else if (g.c(this.E)) { ab.a(new Runnable(this) { final /* synthetic */ k a; { this.a = r1; } public void run() { synchronized (k.F) { try { o.a(k.e, "enter upload usage"); if (VERSION.SDK_INT <= 19 || !z.z()) { this.a.e(); b.b(this.a.E); } else { this.a.d(); } this.a.f(); } catch (Throwable th) { ae.a(this.a.E, k.e, "run usage task exception", th); } } } }); } } } public void b() { if (!n.e()) { if (!g.D()) { o.a(e, "Upload usage V1 is disabled by remote."); } else if (g.c(this.E)) { ab.a(new Runnable(this) { final /* synthetic */ k a; { this.a = r1; } public void run() { try { o.a(k.e, "enter saveInstallationList"); if (!ac.a(this.a.o()) || k.a) { this.a.D.a(this.a.h().toString()); this.a.p(); o.a(k.e, String.format("time: %s, installed: %s", new Object[]{Long.valueOf(System.currentTimeMillis()), r0})); return; } o.a(k.e, "installation saved today, skip"); } catch (Throwable e) { o.b(k.e, "saveInstallationList task exception: ", e); } } }); } } } private void d() { if (!ac.a(m()) || a) { o.a(e, "enter uploadRecentOneWeekAppsUsage"); Map q = q(); long a = ac.a(); long b = ac.b(); Object obj = null; for (int i = 0; i < y; i++) { if (!q.containsKey(ac.a(new Date(a)))) { JSONObject jSONObject = new JSONObject(); try { jSONObject.put(g, VERSION.SDK_INT); jSONObject.put(f, ac.c()); jSONObject.put("ts", a); jSONObject.put(i, m.a(this.E, a, b)); jSONObject.put(j, h()); } catch (Throwable e) { ae.a(this.E, e, "get usage info exception", e); } com.miui.analytics.internal.k.a(this.E).a(new LogEvent(this.E, "com.miui.analytics", f.i, jSONObject.toString())); o.a(e, String.format("uploading second space usage for %s, content:%s", new Object[]{ac.a(new Date(a)), r0})); obj = 1; a(a, 1); } a -= ac.b; b -= ac.b; } if (obj != null) { n(); return; } return; } o.a(e, "uploadRecentOneWeekAppsUsage, usage uploaded today"); } private void e() { if (a || !ac.a(i())) { String g = g(); com.miui.analytics.internal.k.a(this.E).a(new LogEvent(this.E, "com.miui.analytics", f.i, g)); j(); o.a(e, "start to upload usage info: " + g); return; } o.a(e, "usage uploaded today"); } private void f() { if (a || !ac.a(k())) { o.a(e, "start to upload usage sequence, " + new Date().toString()); com.miui.analytics.internal.k.a(this.E).a(new LogEvent(this.E, "com.miui.analytics", f.j, r())); l(); return; } o.a(e, "usage sequence uploaded today"); } private String g() { JSONObject jSONObject = new JSONObject(); try { Object h; jSONObject.put(g, VERSION.SDK_INT); jSONObject.put(f, ac.c()); if (VERSION.SDK_INT < 23) { jSONObject.put("ts", ac.d()); } else { jSONObject.put("ts", ac.d() - ac.b); } jSONObject.put(i, m.a(this.E)); if (VERSION.SDK_INT < 23) { h = h(); jSONObject.put(A, System.currentTimeMillis()); } else { String str; CharSequence a = this.D.a(); if (TextUtils.isEmpty(a)) { str = "[]"; } else { CharSequence str2 = a; } h = new JSONArray(str2); if (h.length() > 0) { jSONObject.put(A, o()); } else { h = h(); jSONObject.put(A, System.currentTimeMillis()); } } jSONObject.put(j, h); return jSONObject.toString(); } catch (Throwable e) { ae.a(this.E, e, "get usage info exception", e); return ""; } } private JSONArray h() { JSONArray jSONArray = new JSONArray(); List<PackageInfo> installedPackages = this.E.getPackageManager().getInstalledPackages(64); if (installedPackages != null) { o.a(e, "installed packages cnt=" + installedPackages.size()); Set a = g.a(f.i); int i = 0; for (PackageInfo packageInfo : installedPackages) { int i2; if (!c.a(packageInfo.applicationInfo) || (a != null && a.contains(packageInfo.packageName))) { jSONArray.put(a(packageInfo)); i2 = i; } else { i2 = i + 1; } i = i2; } o.a(e, "installed system apps cnt=" + i); } return jSONArray; } private JSONObject a(PackageInfo packageInfo) { String installerPackageName = this.E.getPackageManager().getInstallerPackageName(packageInfo.packageName); JSONObject jSONObject = new JSONObject(); try { String a = y.a(packageInfo.packageName); jSONObject.put(b, a); jSONObject.put("v", packageInfo.versionCode); jSONObject.put("vn", packageInfo.versionName); jSONObject.put("s", y.a(installerPackageName)); jSONObject.put(p, packageInfo.lastUpdateTime); jSONObject.put("fit", packageInfo.firstInstallTime); jSONObject.put(o, z.a(a) ? 1 : 0); return jSONObject; } catch (Throwable e) { Log.e(o.a(e), "Fail to format package info of " + packageInfo.packageName, e); return null; } } private long i() { return this.C.b(u.n, 0); } private void j() { this.C.a(u.n, System.currentTimeMillis()); } private long k() { return this.C.b(u.o, 0); } private void l() { this.C.a(u.o, System.currentTimeMillis()); } private long m() { long b = this.C.b(u.m, 0); o.a(e, "getLastUploadSecondSpaceUsageTime " + b); return b; } private void n() { this.C.a(u.m, System.currentTimeMillis()); o.a(e, "saveLastUploadSecondSpaceUsageTime " + System.currentTimeMillis()); } private long o() { return this.C.b(u.l, 0); } private void p() { this.C.a(u.l, System.currentTimeMillis()); } private Map<String, Integer> q() { Map<String, Integer> hashMap = new HashMap(); try { long a = ac.a(); long j = a - 432000000; if (j < 0) { j = 0; } int intValue = Integer.valueOf(ac.a(new Date(j))).intValue(); int intValue2 = Integer.valueOf(ac.a(new Date(a + ac.b))).intValue(); o.a(e, String.format("left:%d(%d), right:%d(%d)", new Object[]{Long.valueOf(j), Integer.valueOf(intValue), Long.valueOf(a), Integer.valueOf(intValue2)})); JSONObject jSONObject = new JSONObject(this.C.b(u.k, x)); Iterator keys = jSONObject.keys(); int i = 0; Object obj = null; int i2 = 0; while (keys.hasNext()) { Object obj2; int i3; String str = (String) keys.next(); long intValue3 = (long) Integer.valueOf(str).intValue(); o.a(e, String.format("SecondSpace Map: key:%s, value:%d", new Object[]{str, Integer.valueOf(jSONObject.getInt(str))})); if (intValue3 < ((long) intValue) || intValue3 > ((long) intValue2)) { keys.remove(); jSONObject.remove(str); o.a(e, String.format("the date %s is out-of-date", new Object[]{str})); obj2 = 1; i3 = i; } else { hashMap.put(str, Integer.valueOf(jSONObject.getInt(str))); Object obj3 = obj; i3 = i + 1; obj2 = obj3; } i2++; i = i3; obj = obj2; } if (obj != null) { this.C.a(u.k, jSONObject.toString()); } o.a(e, String.format("get total %d date serial, %d are valid", new Object[]{Integer.valueOf(i2), Integer.valueOf(i)})); } catch (Throwable e) { ae.a(this.E, e, "getSecondSpaceDateSerial exception: ", e); } return hashMap; } private void a(long j, int i) { try { JSONObject jSONObject = new JSONObject(this.C.b(u.k, x)); jSONObject.put(ac.a(new Date(j)), i); this.C.a(u.k, jSONObject.toString()); o.a(e, String.format("saveSecondSpaceDateSerial,key:%s,value:%d", new Object[]{r0, Integer.valueOf(i)})); } catch (Throwable e) { Log.e(o.a(e), "saveSecondSpaceDateSerial exception:", e); } } private String r() { o.d(e, "enter getUsageSequenceContent..."); JSONObject jSONObject = new JSONObject(); try { List<Event> c = m.c(this.E); Map hashMap = new HashMap(); JSONArray jSONArray = new JSONArray(); JSONArray jSONArray2 = new JSONArray(); int i = 0; long j = 0; if (c != null) { for (Event event : c) { String packageName = event.getPackageName(); if (hashMap.get(packageName) == null) { int i2 = i + 1; hashMap.put(packageName, String.valueOf(i)); i = i2; } if (j == 0) { j = event.getTimeStamp() / 1000; } JSONObject jSONObject2 = new JSONObject(); jSONObject2.put("p", Integer.valueOf((String) hashMap.get(packageName))); jSONObject2.put(t, event.getEventType()); jSONObject2.put("t", (event.getTimeStamp() / 1000) - j); jSONArray.put(jSONObject2); } for (Entry entry : hashMap.entrySet()) { JSONObject jSONObject3 = new JSONObject(); jSONObject3.put((String) entry.getKey(), Integer.valueOf((String) entry.getValue())); jSONArray2.put(jSONObject3); } jSONObject.put("es", jSONArray); jSONObject.put(v, jSONArray2); jSONObject.put(u, j); } } catch (Throwable e) { Log.e(o.a(e), "getUsageSequenceContent exception: ", e); } String jSONObject4 = jSONObject.toString(); if (a) { byte[] bytes = jSONObject4.getBytes(); o.a(e, String.format("Usage Sequence size: %dKB(%dB), content:%s", new Object[]{Integer.valueOf(bytes.length / 1024), Integer.valueOf(bytes.length), jSONObject4})); } return jSONObject4; } public void b(Context context) { if (!G) { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction("SEQUENCE_TEST"); context.registerReceiver(new BroadcastReceiver(this) { final /* synthetic */ k a; { this.a = r1; } public void onReceive(Context context, Intent intent) { o.d(k.e, "#### SEQUENCE_TEST broadcast"); this.a.r(); this.a.g(); } }, intentFilter); G = true; } o.d(e, "register broadcast SEQUENCE_TEST"); } }
[ "azaidi@live.nl" ]
azaidi@live.nl
ccab5e2e20d70b2a6bef14a1fb55ea45ea7470bc
e875a021c7a97e62c3f2dfbd230f3dd281ae5165
/Hammerhead/src/java/Model/CuttingReport.java
7afe4b17b8e2b46d8fb251e162a0920f1f44e73c
[]
no_license
JackEnPoy/DEVAPPS
e3e1e658ec9fa6f4d4b8d2e0462fa10022b9d0e2
c97a9f2a3a3f139a42e81146f3b0b212d2d6983c
refs/heads/master
2016-09-06T08:15:56.839017
2015-02-27T02:34:02
2015-02-27T02:34:02
31,398,899
0
0
null
null
null
null
UTF-8
Java
false
false
1,993
java
package Model; /** * * @author Atayan * @author Lapidario * @author Sy * @author Nunez * */ public class CuttingReport { private int cuttingMaster; private int stockNumber; private String category; private int deliveryReceiptNumber; private int rawQty; private int finalQty; /** * @return the cuttingMaster */ public int getCuttingMaster() { return cuttingMaster; } /** * @param cuttingMaster the cuttingMaster to set */ public void setCuttingMaster(int cuttingMaster) { this.cuttingMaster = cuttingMaster; } /** * @return the stockNumber */ public int getStockNumber() { return stockNumber; } /** * @param stockNumber the stockNumber to set */ public void setStockNumber(int stockNumber) { this.stockNumber = stockNumber; } /** * @return the category */ public String getCategory() { return category; } /** * @param category the category to set */ public void setCategory(String category) { this.category = category; } /** * @return the deliveryReceiptNumber */ public int getDeliveryReceiptNumber() { return deliveryReceiptNumber; } /** * @param deliveryReceiptNumber the deliveryReceiptNumber to set */ public void setDeliveryReceiptNumber(int deliveryReceiptNumber) { this.deliveryReceiptNumber = deliveryReceiptNumber; } /** * @return the rawQty */ public int getRawQty() { return rawQty; } /** * @param rawQty the rawQty to set */ public void setRawQty(int rawQty) { this.rawQty = rawQty; } /** * @return the finalQty */ public int getFinalQty() { return finalQty; } /** * @param finalQty the finalQty to set */ public void setFinalQty(int finalQty) { this.finalQty = finalQty; } }
[ "daniel_dcnunez@yahoo.com.ph" ]
daniel_dcnunez@yahoo.com.ph
0ba0ca4dd84ef80be956c31b4ffc259ab62726d1
8ac0735f831a665f4dcf02674e87abdebafa8437
/DrillSet1/test/drillSet/arrays/Unlucky1Test.java
7636bacb69a1d27b3e5845e13d17003393cf8769
[]
no_license
renegomezjr/crispy-individual-softwareguild-work-java
3cef105de9d72da292f76677ba78b8cb8593ec7f
831c2b612f1ed3f611640466175046501b7d67dc
refs/heads/master
2021-01-01T05:11:50.708818
2016-05-20T01:15:39
2016-05-20T01:15:39
59,254,505
0
0
null
null
null
null
UTF-8
Java
false
false
923
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 drillSet.arrays; import org.junit.Assert; import org.junit.Test; /** * * @author Rene Gomez */ public class Unlucky1Test { Unlucky1 testObj = new Unlucky1(); @Test public void unluck1Test1() { int[] arr = {1, 3, 4, 5}; Assert.assertTrue(testObj.Unlucky1(arr)); } @Test public void unluck1Test2() { int[] arr = {2, 1, 3, 4, 5}; Assert.assertTrue(testObj.Unlucky1(arr)); } @Test public void unluck1Test3() { int[] arr = {1, 1, 1}; Assert.assertFalse(testObj.Unlucky1(arr)); } @Test public void unluck1Test4LastPosition() { int[] arr = {1, 1, 1, 1, 3}; Assert.assertTrue(testObj.Unlucky1(arr)); } }
[ "renegomezjr@gmail.com" ]
renegomezjr@gmail.com
fd8828b89a0438c6cacca4859072c6ed04355681
b373854739a47a7922205f0b4bf33ac5a1f2d2c4
/GankIO/app/src/main/java/com/example/kk/gankio/utils/GankContract.java
86c241f783d2820d9a0a589bf9a52c9242b9da29
[]
no_license
kangkang2109/MVP-demo
6800129e474dbe7bd217ae4eaa6f796423ee94a2
9eb54e0e22537373038d64f339c9671279ab8189
refs/heads/master
2021-01-01T20:14:22.294323
2017-07-30T14:00:09
2017-07-30T14:00:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
package com.example.kk.gankio.utils; import com.example.kk.gankio.bean.GankBean; import java.util.List; /** * Created by kk on 2017/7/21. */ public interface GankContract { interface View{ void showGank(List<GankBean> lists); void showFailed(String s); } interface Presenter{ void loadData(String type, int page); } }
[ "260949998@qq.com" ]
260949998@qq.com
42d722ec465029fd75976a98757b56da85f8af68
38ee0271dd601420dba9dd133343a6d06a2880d7
/EasyTest/src/main/java/com/guava/MutliMapTest.java
ec142bfaae85b655cee2c864e2eb98af5ae68d63
[]
no_license
tankmyb/EasyProject
c630ba69f458fe13449c0ff5b88d797bb46e90cf
e699826d41c034d1ca1f8092463e7426e85778b3
refs/heads/master
2016-09-06T02:36:59.128880
2015-02-17T02:03:51
2015-02-17T02:03:51
30,898,342
2
0
null
null
null
null
UTF-8
Java
false
false
1,282
java
package com.guava; import java.util.Collection; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; public class MutliMapTest { public static void main(String... args) { Multimap<String, String> myMultimap = ArrayListMultimap.create(); // Adding some key/value myMultimap.put("Fruits", "Bannana"); myMultimap.put("Fruits", "Apple"); myMultimap.put("Fruits", "Pear"); myMultimap.put("Vegetables", "Carrot"); // Getting the size int size = myMultimap.size(); System.out.println(size); // 4 // Getting values Collection<String> fruits = myMultimap.get("Fruits"); System.out.println(fruits); // [Bannana, Apple, Pear] Collection<String> vegetables = myMultimap.get("Vegetables"); System.out.println(vegetables); // [Carrot] // Iterating over entire Mutlimap for(String value : myMultimap.values()) { System.out.println(value); } // Removing a single value myMultimap.remove("Fruits","Pear"); System.out.println(myMultimap.get("Fruits")); // [Bannana, Pear] // Remove all values for a key myMultimap.removeAll("Fruits"); System.out.println(myMultimap.get("Fruits")); // [] (Empty Collection!) } }
[ "=" ]
=
2e80a92654c8406f4d22eced99307b5437c10a30
76ed598926a708760660bcf869d2b5a5d3ee9f0a
/src/main/java/sin/glouds/controller/FileuploadController.java
74ecffdb6755d4e7e93b4aa2d06536a56f1bd03e
[]
no_license
qjhao/glouds
959736b9b4b2fe0e48d50dd3c21c1406667b5cc7
d14c752346e96a59521ff2f35ab92f2f8591bf75
refs/heads/master
2020-04-07T09:48:27.348738
2018-11-05T03:16:19
2018-11-05T03:16:19
124,200,690
2
1
null
null
null
null
UTF-8
Java
false
false
1,039
java
package sin.glouds.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import sin.glouds.common.Global; import sin.glouds.util.FileUtil; @Controller @RequestMapping("fileupload") public class FileuploadController extends BaseController { @ResponseBody @RequestMapping("upload") public String upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) { String contentType = file.getContentType(); System.out.println(contentType); String fileName = file.getOriginalFilename(); String filePath = Global.getUserDir() + "/fileupload/"; System.out.println(filePath); try { FileUtil.saveFile(file.getBytes(), filePath, fileName); }catch(Exception e) { e.printStackTrace(); } return "success"; } }
[ "1916852789@qq.com" ]
1916852789@qq.com
88f64bedbbd11b31fda0730c28e34d52beba7fcb
9d4fca7bdb45a54a24f171f3a8198d4c0162e731
/src/main/java/com/elasticbox/jenkins/model/services/deployment/configuration/validation/DeploymentDataTypeValidatorFactory.java
e770d43530e5818608b00a327a00961d3936a5f7
[]
no_license
gsanchezu/elasticbox-plugin
b68d96bee733a50499ebecb4b3d42c5d66051059
dfeee1c89d6edc5231c514ccfda3cfeac7967cfd
refs/heads/master
2021-01-13T09:49:23.056882
2016-08-26T12:48:30
2016-08-26T12:48:30
54,977,793
1
0
null
2016-03-29T13:25:33
2016-03-29T13:25:31
null
UTF-8
Java
false
false
2,369
java
/* * * ElasticBox Confidential * Copyright (c) 2016 All Right Reserved, ElasticBox Inc. * * NOTICE: All information contained herein is, and remains the property * of ElasticBox. The intellectual and technical concepts contained herein are * proprietary and may be covered by U.S. and Foreign Patents, patents in process, * and are protected by trade secret or copyright law. Dissemination of this * information or reproduction of this material is strictly forbidden unless prior * written permission is obtained from ElasticBox. * */ package com.elasticbox.jenkins.model.services.deployment.configuration.validation; import com.elasticbox.jenkins.builders.DeployBox; import com.elasticbox.jenkins.model.services.deployment.DeploymentType; import com.elasticbox.jenkins.model.services.error.ServiceException; import org.apache.commons.lang.StringUtils; import java.util.HashSet; import java.util.Set; public abstract class DeploymentDataTypeValidatorFactory { private static DeploymentDataTypeValidator[] deploymentDataTypesValidators = new DeploymentDataTypeValidator[]{ new CloudFormationManagedAbstractDeploymentDataValidator(), new CloudFormationTemplateAbstractDeploymentDataValidator(), new ApplicationBoxAbstractDeploymentDataValidator(), new PolicyBasedAbstractDeploymentDataValidator() }; public static DeploymentDataTypeValidator createValidator(final DeploymentType deploymentType) throws ServiceException { final DeploymentDataTypeValidator validator = firstMatch(new DeploymentTypeCondition() { @Override public boolean comply(DeploymentDataTypeValidator validator) { return validator.getManagedType() == deploymentType; } }); return validator; } private static DeploymentDataTypeValidator firstMatch(DeploymentTypeCondition condition) throws ServiceException { for (DeploymentDataTypeValidator validator : deploymentDataTypesValidators) { if (condition.comply(validator)) { return validator; } } throw new ServiceException("There is no AbstractDeploymentDataTypeValidatorFactory for this criteria"); } interface DeploymentTypeCondition { boolean comply(DeploymentDataTypeValidator validator); } }
[ "serna@elasticbox.com" ]
serna@elasticbox.com
11033ae567ba2fbf8e2114049bb0c059a41caef5
71eb033d75b14585fba0568896bbe9a7141026aa
/ent-common/src/main/java/com/lianchuan/common/utils/IpUtils.java
f5e69e45c9962cb92536154db6c2e8dc965567e2
[]
no_license
xilinzhang/ent
9651002b15e19c45fb418fb0aa43fad476c12995
964818cd365de40aa7b7a37b3626fe4033b76bd7
refs/heads/master
2021-07-26T00:04:58.205254
2017-11-03T07:13:02
2017-11-03T07:13:02
109,362,850
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package com.lianchuan.common.utils; import javax.servlet.http.HttpServletRequest; public class IpUtils { /** * 获取请求IP * * @param request * @return */ public static String getIp(HttpServletRequest request) { if (request == null) { return null; } String ip = request.getHeader("X-Forwarded-For"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } if (ip == null) { ip = ""; } return ip; } }
[ "zhangxilin@51lianchuan.com" ]
zhangxilin@51lianchuan.com
1de66852171b69ccc298156be8530b7ca32cf7c2
b45ea5a634c4ba578c78e8b34df6de03fcc4730e
/app/src/main/java/com/example/cchat/groupfragement.java
00affa5d23639592a2bf676a4bc2c9b532806bbf
[]
no_license
MennaMohamd/chat-app
1fa62d4c432f0dc9e4c05d6674d76ca5776bd258
d2f264f875699b3e02e6fd584241573bb0b35986
refs/heads/master
2023-04-25T00:33:11.690397
2021-05-20T18:30:10
2021-05-20T18:30:10
369,304,258
1
0
null
null
null
null
UTF-8
Java
false
false
2,918
java
package com.example.cchat; import android.content.Intent; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Adapter; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class groupfragement extends Fragment { private View groupview; private ListView listView; private ArrayAdapter<String>arrayAdapter; private ArrayList<String>list_of_group=new ArrayList<>(); private DatabaseReference groupref; public groupfragement() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment groupview= inflater.inflate(R.layout.fragment_groupfragement, container, false); groupref= FirebaseDatabase.getInstance().getReference().child("Groups"); Initializefield(); Retrivedisplay(); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long ID) { String currentgroupname=adapterView.getItemAtPosition(position).toString(); Intent groupintent=new Intent(getContext(),GroupchatActivity.class); groupintent.putExtra("groupname",currentgroupname); startActivity(groupintent); } }); return groupview; } private void Retrivedisplay() { groupref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { Set<String>set=new HashSet<>(); Iterator iterator=snapshot.getChildren().iterator(); while (iterator.hasNext()) { set.add(((DataSnapshot)iterator.next()).getKey()); } list_of_group.clear(); list_of_group.addAll(set); arrayAdapter.notifyDataSetChanged(); } @Override public void onCancelled(@NonNull DatabaseError error) { } }); } private void Initializefield() { listView=groupview.findViewById(R.id.listview); arrayAdapter=new ArrayAdapter<String>(getContext(), android.R.layout.simple_list_item_1,list_of_group); listView.setAdapter(arrayAdapter); } }
[ "ahmed01210278141m@gmail.com" ]
ahmed01210278141m@gmail.com
959dded4410cb32985a7251cc4e9254ad992e423
a155b4ca9f20149e3e4273b50f0f81a9b728dd49
/lab03/src/Addition.java
d9f2288574ee1a0773ae40a8973b6fd85755a61d
[]
no_license
smrizzo/CSC305Projects
550032a4e74ae875d3d8b8f2109e9e6f620d0adf
401f1db4784fde34bb992fc575692db5f0d2ca3e
refs/heads/master
2020-04-16T00:48:17.808899
2019-01-11T00:52:47
2019-01-11T00:52:47
165,152,091
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
class Addition extends BinaryExpression { public Addition(Expression lhs, Expression rhs) { super(lhs, rhs); } @Override protected double evaluate(double lhs, double rhs) { return lhs + rhs; } @Override protected String operatorName() { return "+"; } @Override public void accept(Visitor v) { v.visitAddition(this); } }
[ "jkarizzo345@yahoo.com" ]
jkarizzo345@yahoo.com
b346d43be4f62cb89ebcb3b9b884afaf2f3d78f4
d3de311a3dc1a4ce82b87774ab8011b62d50902c
/codenvy-ext-developer-studio-core/src/main/java/org/wso2/developerstudio/codenvy/core/client/actions/AboutDialogBoxAction.java
7aa549568b9bb8c0444f4950be5cbcb350aee25b
[ "Apache-2.0" ]
permissive
kaviththiranga/cloud-dev-studio
79c489e1708c2e9144297f79d9b00c26d111388b
ca768bc8b088e5773939b3a0e3f8dfae6267367a
refs/heads/master
2021-01-15T20:43:38.131669
2014-10-09T12:00:43
2014-10-09T12:01:36
24,983,777
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
/* * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.wso2.developerstudio.codenvy.core.client.actions; import com.codenvy.ide.api.ui.action.Action; import com.codenvy.ide.api.ui.action.ActionEvent; import com.google.inject.Inject; import org.wso2.developerstudio.codenvy.core.client.ui.dialogs.AboutDialogBox; import org.wso2.developerstudio.codenvy.core.shared.CoreExtConstants; public class AboutDialogBoxAction extends Action { @Inject public AboutDialogBoxAction() { super(CoreExtConstants.WSO2_ABOUT_ACTION_NAME); } @Override public void actionPerformed(ActionEvent arg0) { new AboutDialogBox().show(); } }
[ "kaviththiranga@gmail.com" ]
kaviththiranga@gmail.com
9a0a3eb75bf4ddca813717d0129397d66b448ef1
b7d4044af983a8ccf92832d81d25298803c75cd9
/JDK1.6Src/com/sun/corba/se/spi/activation/BadServerDefinitionHolder.java
5d4724b23ac2802632648ec7dd94005fea12ddad
[]
no_license
claytonly/jdk-1.6
6299385a17370f064f767b9186c8ffd79ac02445
75099d423c42d800bcf5d754869054a6ef161c20
refs/heads/master
2021-01-13T01:59:35.654623
2014-04-06T03:17:17
2014-04-06T03:17:17
18,481,846
1
1
null
null
null
null
UTF-8
Java
false
false
1,089
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/BadServerDefinitionHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Tuesday, August 28, 2012 5:07:36 PM PDT */ public final class BadServerDefinitionHolder implements org.omg.CORBA.portable.Streamable { public com.sun.corba.se.spi.activation.BadServerDefinition value = null; public BadServerDefinitionHolder () { } public BadServerDefinitionHolder (com.sun.corba.se.spi.activation.BadServerDefinition initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = com.sun.corba.se.spi.activation.BadServerDefinitionHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { com.sun.corba.se.spi.activation.BadServerDefinitionHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return com.sun.corba.se.spi.activation.BadServerDefinitionHelper.type (); } }
[ "Ian@Ian-PC" ]
Ian@Ian-PC
858ac040c0b7fac6b91977a92b207cacb5805bae
9b375c7146372ecb534edf285227e0a8db9779f8
/src/main/java/com/example/demo/config/SwaggerConfig.java
0e85e2aedb1ac9a372331e9bf4d1244d285710d4
[]
no_license
yuzzzzzzi/springPractice
4520e110d94500425f8dfafb18568dc13fb48bc9
f9e1ac4ea9a7806fce3f30d8b0ae183d3a782b5e
refs/heads/master
2020-06-20T12:47:44.359679
2019-07-16T05:46:44
2019-07-16T05:46:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
java
package com.example.demo.config; import com.google.common.base.Predicates; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.async.DeferredResult; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * @author cli */ @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .genericModelSubstitutes(DeferredResult.class) .useDefaultResponseMessages(false) .forCodeGeneration(false) .groupName("全部API") .select() .paths(Predicates.not(PathSelectors.regex("/error.*"))) .build() .apiInfo(apiInfo()) ; } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("通用后端接口") .description("通用后端接口") .version("0.0.1") .contact(new Contact("cli", "", "")) .build(); } }
[ "2583239879@qq.com" ]
2583239879@qq.com
f49cfc60793f66e5585b51b8b981bf6bd324747c
726a1237d1b2a54b18fb851243e54cbfe46174ed
/app/src/main/java/org/androidtown/delightteammodule/Connection/ConnectionManager.java
cec9621bc21a5dc437f065ede1b773978901be3b
[]
no_license
Cliwo/DelightTeamModule
50749f7c8c0a188f548bd8bb86087299898ff1f7
fa724ec8fe4976f7ba14763e5962cb755387bbbe
refs/heads/master
2021-01-20T11:46:38.498685
2016-09-21T02:16:35
2016-09-21T02:16:35
68,176,829
0
0
null
null
null
null
UTF-8
Java
false
false
5,864
java
package org.androidtown.delightteammodule.Connection; import android.content.Context; import android.util.Log; import com.google.gson.Gson; import org.androidtown.delightteammodule.ChanRecycleAdapter.AdapterItemData; import org.androidtown.delightteammodule.ChanRecycleAdapter.CustomViewHolder; import org.androidtown.delightteammodule.ChanRecycleAdapter.RecyclerAdapter; import org.json.JSONArray; import org.json.JSONObject; import java.util.concurrent.atomic.AtomicInteger; /** * Created by Chan on 2016-07-19. */ public class ConnectionManager<V extends CustomViewHolder, D extends AdapterItemData> { private static AtomicInteger messageID = new AtomicInteger(0); final static String SERVER_URL = "http://172.30.1.254:808/hello_jsp/receiver.jsp"; private Class<D> cls; private RecyclerAdapter<V, D> adapter; //의문점 : message에 json String 을 그냥 넣어버리면 서버에서 어떻게 받는가 //제대로 받지 않는다면 HttpUtilSend 의 message 처리 부분 코드를 수정해야함. //아마 안 될것같음 //sendJsonToServer 라는 method 를 따로 만들자. //2016-07-19 public static ConnectionManager ConnectionManagerBuilder(Class<?> cl, RecyclerAdapter<?, ?> adapter) { //Data class와 Data로 set할 adapter 를 설정한다. return new ConnectionManager(cl,adapter); } private ConnectionManager(Class<D> cl, RecyclerAdapter<V, D> adapter) { cls=cl; this.adapter=adapter; } public static void sendMessageToServer(Context context, String message) { HttpUtilSend httpUtilSend = new HttpUtilSend(context); String id = Integer.toString(messageID.incrementAndGet()); String[] string_parameters = {SERVER_URL, "KEY:"+id, "message:"+message}; httpUtilSend.execute(string_parameters); } public static void sendJsonToServer(Context context, String json) { /*이 메소드는 데이터를 전송 한 후 callBack 작동이 필요 없을 때 사용, 콜백이 필요한경우 HttpUtilSend를 직접 제어하는게 나을듯.*/ } public static String DataToJson(AdapterItemData item) { Gson gson = new Gson(); return gson.toJson(item); } public static String DataToJson(Object item) { Gson gson = new Gson(); return gson.toJson(item); } // 단일 객체만 포함한 Json 이 날라왔을 때 가능 public static AdapterItemData DataFromJson(String Json, Class<AdapterItemData> cl) { Gson gson = new Gson(); return gson.fromJson(Json, cl); } /* public static AdapterItemData[] DataArrayFromJson(String Json,Class<AdapterItemData> cl, String keyWord) { } */ public static boolean setUpRecyclerViewWithJson(String json , RecyclerAdapter<CustomViewHolder, AdapterItemData> adapter) { //1. URL을 통해서 서버에서 JSON 받기 //2. 받은 Json 을 DataArrayFromJson 또는 DataFromJson 메소드로 AdapterItemData 가져오기 //3. adapter 에 addItem() 호출 (Array 이면 여러번 호출) //4. 만약 1이 실패하면 return false; return true; } //Builder에 의해 생성된 객체에서 사용하는 것들 private void DataFromJson(String Json) { if(adapter==null || cls==null) { Log.d("ConnectionManager", "adapter or cls is null"); return; } Gson gson = new Gson(); adapter.addItem(gson.fromJson(Json, cls)); } private void DataArrayFromJson(String Json , String keyWord) { if(adapter==null || cls==null) { Log.d("ConnectionManager", "adapter or cls is null"); return; } Gson gson = new Gson(); try { JSONObject jason = new JSONObject(Json); JSONArray jArray = jason.getJSONArray(keyWord); //미리 결정된 키워드 ex)select , 어쩌구.. Log.d("DataArrayFromJson", "length =" + jArray.length()); if (jArray.length() > 0) { for (int i = 0; i < jArray.length(); i++) { //2016-07-20 //지금 이 방식은 JSON Array 로 만든 다음에 JSON Object 하나씩 뽑아내서 다시 string 으로 바꾸는데 //그냥 string 으로 작업하는 건 없을까? JSON Array 로 만들지 말고 adapter.addItem(gson.fromJson(jArray.getJSONObject(i).toString() , cls)); } } } catch(Exception e) { e.printStackTrace(); } } public boolean setUpRecyclerViewWithJsonObject(String json) //이 json은 우리가 넣는게아님, HttpUtilReceive 에서 넣어주는거 { //1. URL을 통해서 서버에서 JSON 받기 , 2016 07 20 현재 HttpUtilReceive object 가 그 역할을 함. //2. 받은 Json 을 DataFromJson 메소드로 AdapterItemData 가져오기 DataFromJson(json); //아마 DataArrayFromJson 이걸로 교체되야 할 듯. //3. 만약 1이 실패하면 return false; return true; } public boolean setUpRecyclerViewWithJsonArray(String json, String keyword) { //1. URL을 통해서 서버에서 JSON 받기 , 2016 07 20 현재 HttpUtilReceive object 가 그 역할을 함. //2. 받은 Json 을 DataArrayFromJson 메소드로 AdapterItemData 가져오기 DataArrayFromJson(json, keyword); // //3. 만약 1이 실패하면 return false; return true; } //ConnectionManager 와 HttpUtilReceive 동시 사용예제 /* Adapter => adapter; 통신할 URL => url HttpUtilReceive util = new HttpUtilReceive(ConnectionManager.ConnectionManagerBuilder(TeamSimpleData.class, adapter)); util.execute(url); */ }
[ "cliwo@naver.com" ]
cliwo@naver.com
fac38ebeb8ce99e89bbb3eccc772e1036f2dc206
dece496c3ace94d3e21a408946ecce4ec103146c
/src/main/java/com/freshqart/FreshQart/Services/CustomerService.java
3db1725e5daa5380a23c1e48bfc97732193d1a27
[]
no_license
smothe459/Carro
368d405095a67d5982c42e86de3699a8e4198c3c
27eb0186073a3fac304c1251971a38c61a20326c
refs/heads/master
2023-09-04T18:51:52.105486
2019-06-23T20:33:37
2019-06-23T20:33:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
190
java
package com.freshqart.FreshQart.Services; import com.freshqart.FreshQart.Models.Customer; public interface CustomerService { public Customer CreateCustomer(Customer customer); }
[ "srinivas.mothe@relativity.com" ]
srinivas.mothe@relativity.com
29a03f59fd4e348b0b8e956d203db55b525a1b0c
3783def961f78f1378ef158ca9ef0ebc75126657
/app/src/main/java/com/liuxl/godriving/ui/view/FocusedTextView.java
36400c28e5cf0548dc5f861e37a0fdfaa24fe84e
[]
no_license
LiuxlGH/GoDriving
718f388a20df4d84ac834d6810875892214f6edd
7f501e5f00b9c1ecc40ea7d5a9696fceb6f96bcd
refs/heads/master
2021-01-19T17:30:17.002306
2018-05-25T12:50:01
2018-05-25T12:50:01
101,062,355
0
0
null
null
null
null
UTF-8
Java
false
false
624
java
package com.liuxl.godriving.ui.view; import android.content.Context; import android.util.AttributeSet; /** * Created by Liuxl on 2018/2/11. */ public class FocusedTextView extends android.support.v7.widget.AppCompatTextView { public FocusedTextView(Context context) { super(context); } public FocusedTextView(Context context, AttributeSet attrs) { super(context, attrs); } public FocusedTextView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public boolean isFocused() { return true; } }
[ "569072733@qq.com" ]
569072733@qq.com
78defa086cc0e805147094674cd78c6fc3b1dfca
4fba55f43c67df209fd012b6dc82b61cf650e1bd
/src/ExposedBomb.java
786ae5b0967de596e04882cd81080bf0f01ca828
[]
no_license
enseri/MineMaze
4903fca23f9aad8dbf2d32c6ed5ba1a3a7f85c87
b31b75ccb555c9509c32ab68559541a455ff2d50
refs/heads/master
2023-08-24T14:18:58.354255
2021-11-01T13:51:32
2021-11-01T13:51:32
421,947,580
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
import java.awt.Color; import java.awt.Graphics; public class ExposedBomb extends GameObject{ Mouse mouse = new Mouse(); public ExposedBomb(int x, int y, ID id){ super(x, y, id); } public void tick(){ } public void render(Graphics g) { g.setColor(Color.red); g.fillRect(x, y, 50, 50); } }
[ "enseri@stu.naperville203.org" ]
enseri@stu.naperville203.org
50d5a504bfdf3b6db51265af9fe6ab472c846d97
cb840eaecbc5c81de2b910692456509f6890a7c3
/LYJMediaPlayer/src/com/liyuejiao/player/util/FileUtils.java
32c1a9dc4fb98ab10f306a5300f1a06217c9a9ac
[]
no_license
qiaolanqi/LYJPlayer
d78cabb9ba499c9470ca2ba7ce0b13e5413d39b2
91795b9eac9487f2c1e7a82df8bbd1264bb804f1
refs/heads/master
2021-01-10T04:43:42.002470
2015-06-09T13:59:24
2015-06-09T13:59:24
36,215,701
0
0
null
null
null
null
UTF-8
Java
false
false
12,016
java
package com.liyuejiao.player.util; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import android.os.Environment; import android.os.StatFs; import android.util.Log; public class FileUtils { // http://www.fileinfo.com/filetypes/video , "dat" , "bin" , "rms" public static final String[] VIDEO_EXTENSIONS = { "264", "3g2", "3gp", "3gp2", "3gpp", "3gpp2", "3mm", "3p2", "60d", "aep", "ajp", "amv", "amx", "arf", "asf", "asx", "avb", "avd", "avi", "avs", "avs", "axm", "bdm", "bdmv", "bik", "bix", "bmk", "box", "bs4", "bsf", "byu", "camre", "clpi", "cpi", "cvc", "d2v", "d3v", "dav", "dce", "dck", "ddat", "dif", "dir", "divx", "dlx", "dmb", "dmsm", "dmss", "dnc", "dpg", "dream", "dsy", "dv", "dv-avi", "dv4", "dvdmedia", "dvr-ms", "dvx", "dxr", "dzm", "dzp", "dzt", "evo", "eye", "f4p", "f4v", "fbr", "fbr", "fbz", "fcp", "flc", "flh", "fli", "flv", "flx", "gl", "grasp", "gts", "gvi", "gvp", "hdmov", "hkm", "ifo", "imovi", "imovi", "iva", "ivf", "ivr", "ivs", "izz", "izzy", "jts", "lsf", "lsx", "m15", "m1pg", "m1v", "m21", "m21", "m2a", "m2p", "m2t", "m2ts", "m2v", "m4e", "m4u", "m4v", "m75", "meta", "mgv", "mj2", "mjp", "mjpg", "mkv", "mmv", "mnv", "mod", "modd", "moff", "moi", "moov", "mov", "movie", "mp21", "mp21", "mp2v", "mp4", "mp4v", "mpe", "mpeg", "mpeg4", "mpf", "mpg", "mpg2", "mpgin", "mpl", "mpls", "mpv", "mpv2", "mqv", "msdvd", "msh", "mswmm", "mts", "mtv", "mvb", "mvc", "mvd", "mve", "mvp", "mxf", "mys", "ncor", "nsv", "nvc", "ogm", "ogv", "ogx", "osp", "par", "pds", "pgi", "piv", "playlist", "pmf", "prel", "pro", "prproj", "psh", "pva", "pvr", "pxv", "qt", "qtch", "qtl", "qtm", "qtz", "rcproject", "rdb", "rec", "rm", "rmd", "rmp", "rmvb", "roq", "rp", "rts", "rts", "rum", "rv", "sbk", "sbt", "scm", "scm", "scn", "sec", "seq", "sfvidcap", "smil", "smk", "sml", "smv", "spl", "ssm", "str", "stx", "svi", "swf", "swi", "swt", "tda3mt", "tivo", "tix", "tod", "tp", "tp0", "tpd", "tpr", "trp", "ts", "tvs", "vc1", "vcr", "vcv", "vdo", "vdr", "veg", "vem", "vf", "vfw", "vfz", "vgz", "vid", "viewlet", "viv", "vivo", "vlab", "vob", "vp3", "vp6", "vp7", "vpj", "vro", "vsp", "w32", "wcp", "webm", "wm", "wmd", "wmmp", "wmv", "wmx", "wp3", "wpl", "wtv", "wvx", "xfl", "xvid", "yuv", "zm1", "zm2", "zm3", "zmv" }; // http://www.fileinfo.com/filetypes/audio , "spx" , "mid" , "sf" public static final String[] AUDIO_EXTENSIONS = { "4mp", "669", "6cm", "8cm", "8med", "8svx", "a2m", "aa", "aa3", "aac", "aax", "abc", "abm", "ac3", "acd", "acd-bak", "acd-zip", "acm", "act", "adg", "afc", "agm", "ahx", "aif", "aifc", "aiff", "ais", "akp", "al", "alaw", "all", "amf", "amr", "ams", "ams", "aob", "ape", "apf", "apl", "ase", "at3", "atrac", "au", "aud", "aup", "avr", "awb", "band", "bap", "bdd", "box", "bun", "bwf", "c01", "caf", "cda", "cdda", "cdr", "cel", "cfa", "cidb", "cmf", "copy", "cpr", "cpt", "csh", "cwp", "d00", "d01", "dcf", "dcm", "dct", "ddt", "dewf", "df2", "dfc", "dig", "dig", "dls", "dm", "dmf", "dmsa", "dmse", "drg", "dsf", "dsm", "dsp", "dss", "dtm", "dts", "dtshd", "dvf", "dwd", "ear", "efa", "efe", "efk", "efq", "efs", "efv", "emd", "emp", "emx", "esps", "f2r", "f32", "f3r", "f4a", "f64", "far", "fff", "flac", "flp", "fls", "frg", "fsm", "fzb", "fzf", "fzv", "g721", "g723", "g726", "gig", "gp5", "gpk", "gsm", "gsm", "h0", "hdp", "hma", "hsb", "ics", "iff", "imf", "imp", "ins", "ins", "it", "iti", "its", "jam", "k25", "k26", "kar", "kin", "kit", "kmp", "koz", "koz", "kpl", "krz", "ksc", "ksf", "kt2", "kt3", "ktp", "l", "la", "lqt", "lso", "lvp", "lwv", "m1a", "m3u", "m4a", "m4b", "m4p", "m4r", "ma1", "mdl", "med", "mgv", "midi", "miniusf", "mka", "mlp", "mmf", "mmm", "mmp", "mo3", "mod", "mp1", "mp2", "mp3", "mpa", "mpc", "mpga", "mpu", "mp_", "mscx", "mscz", "msv", "mt2", "mt9", "mte", "mti", "mtm", "mtp", "mts", "mus", "mws", "mxl", "mzp", "nap", "nki", "nra", "nrt", "nsa", "nsf", "nst", "ntn", "nvf", "nwc", "odm", "oga", "ogg", "okt", "oma", "omf", "omg", "omx", "ots", "ove", "ovw", "pac", "pat", "pbf", "pca", "pcast", "pcg", "pcm", "peak", "phy", "pk", "pla", "pls", "pna", "ppc", "ppcx", "prg", "prg", "psf", "psm", "ptf", "ptm", "pts", "pvc", "qcp", "r", "r1m", "ra", "ram", "raw", "rax", "rbs", "rcy", "rex", "rfl", "rmf", "rmi", "rmj", "rmm", "rmx", "rng", "rns", "rol", "rsn", "rso", "rti", "rtm", "rts", "rvx", "rx2", "s3i", "s3m", "s3z", "saf", "sam", "sb", "sbg", "sbi", "sbk", "sc2", "sd", "sd", "sd2", "sd2f", "sdat", "sdii", "sds", "sdt", "sdx", "seg", "seq", "ses", "sf2", "sfk", "sfl", "shn", "sib", "sid", "sid", "smf", "smp", "snd", "snd", "snd", "sng", "sng", "sou", "sppack", "sprg", "sseq", "sseq", "ssnd", "stm", "stx", "sty", "svx", "sw", "swa", "syh", "syw", "syx", "td0", "tfmx", "thx", "toc", "tsp", "txw", "u", "ub", "ulaw", "ult", "ulw", "uni", "usf", "usflib", "uw", "uwf", "vag", "val", "vc3", "vmd", "vmf", "vmf", "voc", "voi", "vox", "vpm", "vqf", "vrf", "vyf", "w01", "wav", "wav", "wave", "wax", "wfb", "wfd", "wfp", "wma", "wow", "wpk", "wproj", "wrk", "wus", "wut", "wv", "wvc", "wve", "wwu", "xa", "xa", "xfs", "xi", "xm", "xmf", "xmi", "xmz", "xp", "xrns", "xsb", "xspf", "xt", "xwb", "ym", "zvd", "zvr" }; private static final HashSet<String> mHashVideo; private static final HashSet<String> mHashAudio; private static final double KB = 1024.0; private static final double MB = KB * KB; private static final double GB = KB * KB * KB; static { mHashVideo = new HashSet<String>(Arrays.asList(VIDEO_EXTENSIONS)); mHashAudio = new HashSet<String>(Arrays.asList(AUDIO_EXTENSIONS)); } /** 是否是音频或者视频 */ public static boolean isVideoOrAudio(File f) { final String ext = getFileExtension(f); return mHashVideo.contains(ext) || mHashAudio.contains(ext); } public static boolean isVideoOrAudio(String f) { final String ext = getUrlExtension(f); return mHashVideo.contains(ext) || mHashAudio.contains(ext); } public static boolean isVideo(File f) { final String ext = getFileExtension(f); return mHashVideo.contains(ext); } /** 获取文件后缀 */ public static String getFileExtension(File f) { if (f != null) { String filename = f.getName(); int i = filename.lastIndexOf('.'); if (i > 0 && i < filename.length() - 1) { return filename.substring(i + 1).toLowerCase(); } } return null; } public static String getUrlFileName(String url) { int slashIndex = url.lastIndexOf('/'); int dotIndex = url.lastIndexOf('.'); String filenameWithoutExtension; if (dotIndex == -1) { filenameWithoutExtension = url.substring(slashIndex + 1); } else { filenameWithoutExtension = url.substring(slashIndex + 1, dotIndex); } return filenameWithoutExtension; } public static String getUrlExtension(String url) { if (!StringUtils.isEmpty(url)) { int i = url.lastIndexOf('.'); if (i > 0 && i < url.length() - 1) { return url.substring(i + 1).toLowerCase(); } } return ""; } public static String getFileNameNoEx(String filename) { if ((filename != null) && (filename.length() > 0)) { int dot = filename.lastIndexOf('.'); if ((dot > -1) && (dot < (filename.length()))) { return filename.substring(0, dot); } } return filename; } public static String showFileSize(long size) { String fileSize; if (size < KB) fileSize = size + "B"; else if (size < MB) fileSize = String.format("%.1f", size / KB) + "KB"; else if (size < GB) fileSize = String.format("%.1f", size / MB) + "MB"; else fileSize = String.format("%.1f", size / GB) + "GB"; return fileSize; } /** 显示SD卡剩余空间 */ public static String showFileAvailable() { String result = ""; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { StatFs sf = new StatFs(Environment.getExternalStorageDirectory().getPath()); long blockSize = sf.getBlockSize(); long blockCount = sf.getBlockCount(); long availCount = sf.getAvailableBlocks(); return showFileSize(availCount * blockSize) + " / " + showFileSize(blockSize * blockCount); } return result; } /** 如果不存在就创建 */ public static boolean createIfNoExists(String path) { File file = new File(path); boolean mk = false; if (!file.exists()) { mk = file.mkdirs(); } return mk; } private static HashMap<String, String> mMimeType = new HashMap<String, String>(); static { mMimeType.put("M1V", "video/mpeg"); mMimeType.put("MP2", "video/mpeg"); mMimeType.put("MPE", "video/mpeg"); mMimeType.put("MPG", "video/mpeg"); mMimeType.put("MPEG", "video/mpeg"); mMimeType.put("MP4", "video/mp4"); mMimeType.put("M4V", "video/mp4"); mMimeType.put("3GP", "video/3gpp"); mMimeType.put("3GPP", "video/3gpp"); mMimeType.put("3G2", "video/3gpp2"); mMimeType.put("3GPP2", "video/3gpp2"); mMimeType.put("MKV", "video/x-matroska"); mMimeType.put("WEBM", "video/x-matroska"); mMimeType.put("MTS", "video/mp2ts"); mMimeType.put("TS", "video/mp2ts"); mMimeType.put("TP", "video/mp2ts"); mMimeType.put("WMV", "video/x-ms-wmv"); mMimeType.put("ASF", "video/x-ms-asf"); mMimeType.put("ASX", "video/x-ms-asf"); mMimeType.put("FLV", "video/x-flv"); mMimeType.put("MOV", "video/quicktime"); mMimeType.put("QT", "video/quicktime"); mMimeType.put("RM", "video/x-pn-realvideo"); mMimeType.put("RMVB", "video/x-pn-realvideo"); mMimeType.put("VOB", "video/dvd"); mMimeType.put("DAT", "video/dvd"); mMimeType.put("AVI", "video/x-divx"); mMimeType.put("OGV", "video/ogg"); mMimeType.put("OGG", "video/ogg"); mMimeType.put("VIV", "video/vnd.vivo"); mMimeType.put("VIVO", "video/vnd.vivo"); mMimeType.put("WTV", "video/wtv"); mMimeType.put("AVS", "video/avs-video"); mMimeType.put("SWF", "video/x-shockwave-flash"); mMimeType.put("YUV", "video/x-raw-yuv"); } /** 获取MIME */ public static String getMimeType(String path) { int lastDot = path.lastIndexOf("."); if (lastDot < 0) return null; return mMimeType.get(path.substring(lastDot + 1).toUpperCase()); } /** 多个SD卡时 取外置SD卡 */ public static String getExternalStorageDirectory() { // 参考文章 // http://blog.csdn.net/bbmiku/article/details/7937745 Map<String, String> map = System.getenv(); String[] values = new String[map.values().size()]; map.values().toArray(values); String path = values[values.length - 1]; Log.e("nmbb", "FileUtils.getExternalStorageDirectory : " + path); if (path.startsWith("/mnt/") && !Environment.getExternalStorageDirectory().getAbsolutePath().equals(path)) return path; else return null; } }
[ "061304011116lyj@163.com" ]
061304011116lyj@163.com
89e888a5bf0087bfa42e8849da08682434dccbe4
a34b37f087c02263edd68a9207b5d8592efffd84
/src/main/java/web/repository/impl/ConfigurationRepositoryImpl.java
7d2680192993b467cad2e652c5ea5f3ec497a8f9
[]
no_license
AriPerkkio/iot-device-manager
3b74db3292ca7da99462a233ec9af0df8010b39a
8f88f2f52f3e26b5305ec9e591b1fcedb5604275
refs/heads/master
2021-09-14T00:35:15.777191
2018-05-06T17:52:33
2018-05-06T17:52:33
117,442,945
0
0
null
null
null
null
UTF-8
Java
false
false
2,984
java
package web.repository.impl; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import web.domain.entity.Configuration; import web.repository.ConfigurationRepository; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.StoredProcedureQuery; import java.math.BigInteger; import java.util.Collection; @Repository public class ConfigurationRepositoryImpl implements ConfigurationRepository { @PersistenceContext private EntityManager entityManager; @Autowired ObjectMapper objectMapper; @Override public Collection<Configuration> getConfigurations(Integer id, String name) { StoredProcedureQuery getConfigurationsQuery = entityManager.createNamedStoredProcedureQuery("get_configurations") .setParameter("f_id", id) .setParameter("f_name", name); return getConfigurationsQuery.getResultList(); } @Override public Configuration addConfiguration(Configuration configuration) throws JsonProcessingException { // Convert HashMap into JSON string String contentString = objectMapper.writeValueAsString(configuration.getContent()); StoredProcedureQuery addConfigurationQuery = entityManager.createNamedStoredProcedureQuery("add_configuration") .setParameter("p_name", configuration.getName()) .setParameter("p_description", configuration.getDescription()) .setParameter("p_content", contentString); return (Configuration) addConfigurationQuery.getSingleResult(); } @Override public Configuration updateConfiguration(Integer id, String name, Configuration configuration) throws JsonProcessingException { // Convert HashMap into JSON string String contentString = objectMapper.writeValueAsString(configuration.getContent()); StoredProcedureQuery updateConfigurationQuery = entityManager.createNamedStoredProcedureQuery("update_configuration") .setParameter("f_id", id) .setParameter("f_name", name) .setParameter("p_name", configuration.getName()) .setParameter("p_description", configuration.getDescription()) .setParameter("p_content", contentString); return (Configuration) updateConfigurationQuery.getSingleResult(); } @Override public Boolean deleteConfiguration(Integer id, String name) { StoredProcedureQuery deleteConfigurationQuery = entityManager.createNamedStoredProcedureQuery("delete_configuration") .setParameter("f_id", id) .setParameter("f_name", name); return BigInteger.ONE.equals(deleteConfigurationQuery.getSingleResult()); } }
[ "ari.perkkio@gmail.com" ]
ari.perkkio@gmail.com
0517c604d6b8033c0fe7fc37c8e5dc10cc3121f5
db77908c40c076bb713c1b00fd633457658964a3
/common/ifs-resources/src/main/java/org/innovateuk/ifs/competition/builder/PreviousCompetitionSearchResultItemBuilder.java
627b9de0ed50921788fd19627c1762d02278e4fb
[ "MIT" ]
permissive
InnovateUKGitHub/innovation-funding-service
e3807613fd3c398931918c6cc773d13874331cdc
964969b6dc9c78750738ef683076558cc897c1c8
refs/heads/development
2023-08-04T04:04:05.501037
2022-11-11T14:48:30
2022-11-11T14:48:30
87,336,871
30
20
MIT
2023-07-19T21:23:46
2017-04-05T17:20:38
Java
UTF-8
Java
false
false
1,617
java
package org.innovateuk.ifs.competition.builder; import org.innovateuk.ifs.competition.resource.search.PreviousCompetitionSearchResultItem; import java.util.List; import java.util.function.BiConsumer; import static java.util.Collections.emptyList; import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.setField; import static org.innovateuk.ifs.base.amend.BaseBuilderAmendFunctions.uniqueIds; public class PreviousCompetitionSearchResultItemBuilder extends CompetitionSearchResultItemBuilder<PreviousCompetitionSearchResultItem, PreviousCompetitionSearchResultItemBuilder> { private PreviousCompetitionSearchResultItemBuilder(List<BiConsumer<Integer, PreviousCompetitionSearchResultItem>> newMultiActions) { super(newMultiActions); } public static PreviousCompetitionSearchResultItemBuilder newPreviousCompetitionSearchResultItem() { return new PreviousCompetitionSearchResultItemBuilder(emptyList()).with(uniqueIds()); } public PreviousCompetitionSearchResultItemBuilder openDate(Integer... projectsCounts) { return withArray((projectsCount, competition) -> setField("projectsCount", projectsCount, competition), projectsCounts); } @Override protected PreviousCompetitionSearchResultItemBuilder createNewBuilderWithActions(List<BiConsumer<Integer, PreviousCompetitionSearchResultItem>> actions) { return new PreviousCompetitionSearchResultItemBuilder(actions); } @Override protected PreviousCompetitionSearchResultItem createInitial() { return newInstance(PreviousCompetitionSearchResultItem.class); } }
[ "markd@iuk.ukri.org" ]
markd@iuk.ukri.org
60b7058d0217d2a2e0c0a743fa4a3df30a571f5a
81c76470a9ab5d58cc3551265fdf7e112b96d472
/src/org/smercapp/helper/Scraper.java
c45e6729a7d7a033689d18db914c2bdabec5a3cc
[]
no_license
vtikoo/kweryQA
8c34c098453572b0337ec888c3e1c01452cdc985
189b35e6a75b92290235a944243c1526a44248c7
refs/heads/master
2016-09-08T01:34:48.355594
2015-06-14T12:06:25
2015-06-14T12:06:25
37,410,859
0
0
null
null
null
null
UTF-8
Java
false
false
4,487
java
package org.smercapp.helper; import java.io.IOException; import java.util.AbstractMap; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class Scraper { String kw[] = {"=", "+", "-", "/", "*", "%", "++", "--", "!", "==", "<", ">", "<=", ">=", "&&", "||", "?:", "~", "<<", ">>", ">>>", "&", "^", "|", "{","}","(",")","[","]","//","/*","*/",",",":", ";","abstract", "continue", "for", "new", "switch", "assert", "default", "goto", "package", "synchronized", "boolean", "do", "if", "private", "this", "break", "double", "implements", "protected", "throw", "byte", "else", "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", "native", "super", "while", "do while"}; HashMap<String,Boolean> kwMap; public Scraper() { kwMap = new HashMap<String,Boolean>(); for(String s: kw) { kwMap.put(s, true); } } public SimpleEntry<String,Float> getAnswerStack(String link, String query) throws IOException { //Document doc = Jsoup.connect("http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java").get(); Document doc = Jsoup.connect(link.trim()).get(); System.out.println("Title: "+doc.title()); Elements accAns = doc.getElementsByAttributeValue("itemprop", "acceptedAnswer"); String answer = null; String mrSumm = null; float mr = 0f; if(accAns.size() == 1) { Integer votes = Integer.parseInt(accAns.get(0).getElementsByAttributeValue("itemprop","upvoteCount").text()); System.out.println("Votes: "+votes); if(accAns.get(0).getElementsByClass("post-text").get(0).getElementsByTag("code")!=null && accAns.get(0).getElementsByClass("post-text").get(0).getElementsByTag("code").size() > 0){ mrSumm = "<pre>"+accAns.get(0).getElementsByClass("post-text").get(0).getElementsByTag("code").get(0).html()+"</pre>"; mr = relCompute(mrSumm,query); //System.out.println("Answer: "+ answer); if(mr == 1) return new SimpleEntry<String,Float>(mrSumm, mr); } } Elements ans = doc.getElementsByClass("answer"); String tempSumm; float tr = 0f; for(int i=0 ; i<ans.size() ;i++) { if(ans.get(i).getElementsByClass("post-text").get(0).getElementsByTag("code")!=null && ans.get(i).getElementsByClass("post-text").get(0).getElementsByTag("code").size() > 0 ) { tempSumm = "<pre>"+ans.get(i).getElementsByClass("post-text").get(0).getElementsByTag("code").get(0).html()+"</pre>"; tr= relCompute(tempSumm,query); if(tr == 1) return new SimpleEntry<String,Float>(tempSumm,tr); if(mrSumm == null) { mr = tr; mrSumm = tempSumm; } else { if(tr > mr) { mr = tr; mrSumm = tempSumm; } } } } return new SimpleEntry<String,Float>(mrSumm, mr); } public SimpleEntry<String,Float> getAnswerOracle(String link, String query) throws IOException { Document doc = Jsoup.connect(link).get(); System.out.println("Title: "+doc.title()); Elements codeBlocks = doc.getElementsByClass("codeBlock"); //System.out.println("Number of code block elems: "+codeBlocks.size()); Element elem; String mrSumm = null; String tempSumm; float mr = 0f; float tr = 0f; for(int i = 0 ; i < codeBlocks.size() ; i++) { elem = codeBlocks.get(i); tempSumm = elem.html(); tr= relCompute(tempSumm,query); if(tr == 1) return new SimpleEntry<String,Float>(tempSumm,tr); if(i == 0) { mr = tr; mrSumm = tempSumm; } else { if(tr > mr) { mr = tr; mrSumm = tempSumm; } } } return new SimpleEntry<String,Float>(mrSumm,mr); } private float relCompute(String summary,String query) { String[] qArr = query.split(" "); List<String> checkFor = new ArrayList<String>(); for(String s: qArr) { if(kwMap.get(s) != null) { checkFor.add(s); } } if(checkFor.size() == 0) { return 0f; } float count = 0; for(String s: checkFor) { if(summary.contains(s)) { count++; } } return (count/checkFor.size()); } }
[ "vikasamar@gmail.com" ]
vikasamar@gmail.com
1987a0e5c17890abed3f1a37dcb986152cdd8852
e13616d7d329cafe364742ff4f8d92ae7c54007a
/src/subsets_2/Main.java
1999816b486eb03e1be105ff484e3d00efb5cf14
[ "Apache-2.0" ]
permissive
ruoyewu/QpD
c4e6b983402e28d181fbceb36964c226ccd0d669
30566611faad63c48dd4c2aec203be5db2e20027
refs/heads/master
2021-06-22T10:32:40.282570
2020-11-16T14:18:51
2020-11-16T14:18:51
137,847,208
0
0
null
null
null
null
UTF-8
Java
false
false
960
java
package subsets_2; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * User: wuruoye * Date: 2019-05-06 16:08 * Description: */ public class Main { public static void main(String[] args) { int[] nums = new int[]{1,2,2}; System.out.println(subsetsWithDup(nums)); } public static List<List<Integer>> subsetsWithDup(int[] nums) { Arrays.sort(nums); List<List<Integer>> result = new ArrayList<>(); sub(result, new ArrayList<>(nums.length), nums, 0); return result; } private static void sub(List<List<Integer>> result, List<Integer> cur, int[] nums, int pos) { result.add(new ArrayList<>(cur)); for (int i = pos; i < nums.length; i++) { if (i == pos || nums[i] != nums[i-1]) { cur.add(nums[i]); sub(result, cur, nums, i+1); cur.remove(cur.size()-1); } } } }
[ "2455929518@qq.com" ]
2455929518@qq.com
a36a7f9b4e91d27bbace6779561e60b685594a1b
3664fd27d708187ca348edc48ada04cca5e92303
/src/task1.java
37b4352ec36ad733b4370db48746690157ebf39c
[]
no_license
maroonkoi/MyBS_AVL_Tree
0bc07be0fe9eb61a3ff8a5e015cabe4028a5fa10
31ab545c6f6310f5fe95025daa15a1563da3d615
refs/heads/master
2022-06-10T23:07:33.342858
2020-03-02T04:25:14
2020-03-02T04:25:14
258,435,372
0
0
null
null
null
null
UTF-8
Java
false
false
2,307
java
import java.io.File; import java.io.FileNotFoundException; import java.util.*; import static java.util.stream.Collectors.toMap; public class task1 { /* 1.) Есть документ со списком URL: https://drive.google.com/open?id=1wVBKKxpTKvWwuCzqY1cVXCQZYCsdCXTl Вывести топ 10 доменов которые встречаются чаще всего. В документе могут встречается пустые и недопустимые строки. */ public static final Integer TOP = 10; public static void main(String[] args) throws FileNotFoundException { HashMap<String, Integer> domains = new HashMap<>(); File file = new File("src\\domains.txt"); Scanner sc = new Scanner(file); while (sc.hasNextLine()) { String s = sc.nextLine().split("/", 2)[0]; if (s.contains("m.")) { s = s.replace("m.", ""); } if (s.contains("www.")) { s = s.replace("www.", ""); } Integer count = domains.get(s); if (count != null) { count++; } else { count = 1; } domains.put(s, count); } getTop(reverseSortMap(domains), TOP); } public static HashMap<String, Integer> reverseSortMap(HashMap<String, Integer> input) { HashMap<String, Integer> sorted = input .entrySet() .stream() .sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) .collect( toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new)); return sorted; } public static void getTop(HashMap<String, Integer> sorted, int topN) { ArrayList<String> keyList = new ArrayList<>(sorted.keySet()); ArrayList<Integer> valueList = new ArrayList<>(sorted.values()); System.out.println("TOP " + TOP + " DOMAIN NAMES:"); for (int i = 0; i < topN; i++) { int N = i + 1; System.out.printf("%-5s", "#" + N); System.out.printf("%-30s", keyList.get(i)); System.out.printf("%4s%n", valueList.get(i)); } } }
[ "stars.sun.moon@mail.ru" ]
stars.sun.moon@mail.ru
5cfb10d456b52c74282dfac41af5e1fec09fd522
b1a30a923f93a60bc55f4e3b0568b88ef5f17f0c
/src/main/java/com/greeting/data/Account.java
0538b4575bf0660998e6c34f675235f31df7205d
[]
no_license
const-ch/greeting-web-app
c843ca8d39e1baa0dc8af5bf5d5250838fa21995
d28f38332ac8c7f1dca15904ef26f295d07fffdb
refs/heads/master
2022-12-21T01:17:01.722892
2020-04-05T20:24:38
2020-04-05T20:24:38
253,313,751
0
0
null
2020-10-13T20:56:28
2020-04-05T19:19:58
Java
UTF-8
Java
false
false
75
java
package com.greeting.data; public enum Account { personal, business; }
[ "kostiantyn.chernovol@netent.com" ]
kostiantyn.chernovol@netent.com
cd257aef99c2fde25b926e484dd223f7748571cc
0646dc0b27df66abb3c6d840000d45610932c26b
/src/main/java/com/scarlatti/plugin/intellij/PluginAction.java
099fb0e37b3f50743e37a8031ac4ad05107c9683
[]
no_license
alessandroscarlatti/intellij-plugin-template
7f00ede08f0d2db7cbe60c7208b5f73960af9a9f
62487011b6f8c64e8b6cd268b51e1cea3fd1db71
refs/heads/master
2020-03-26T13:01:03.616879
2018-08-16T01:03:01
2018-08-16T01:03:01
144,918,785
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
package com.scarlatti.plugin.intellij; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.components.ServiceManager; import javax.swing.*; /** * ~ _____ __ * ~ (, / | /) /) (__/ ) /) , * ~ /---| // _ _ _ _ __ _(/ __ ___ / _ _ __ // _ _/_/_ * ~ ) / |(/_(//_)/_)(_(/ ((_(_/ ((_) ) / (_(_(/ ((/_(_((_(__(_ * ~ (_/ (_/ * ~ Wednesday, 11/8/2017 */ public class PluginAction extends AnAction { public PluginAction() { super("Perform Plugin Action..."); } /** * A very simple experiment to try to show a message pane * when the action is performed. */ @Override public void actionPerformed(AnActionEvent anActionEvent) { PluginStateWrapper pluginStateWrapper = ServiceManager.getService(PluginStateWrapper.class); JOptionPane.showMessageDialog(null, pluginStateWrapper.getState()); } @Override public boolean displayTextInToolbar() { return true; } }
[ "violanotesnoextras@gmail.com" ]
violanotesnoextras@gmail.com
c19efde473b330b93fc019f64365e40e63417202
3de3dae722829727edfdd6cc3b67443a69043475
/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/cataloger/package-info.java
e8f24580ca7c70f97ec8d61c7271924b47d46ea7
[ "LicenseRef-scancode-public-domain", "Apache-2.0" ]
permissive
Unidata/awips2
9aee5b7ec42c2c0a2fa4d877cb7e0b399db74acb
d76c9f96e6bb06f7239c563203f226e6a6fffeef
refs/heads/unidata_18.2.1
2023-08-18T13:00:15.110785
2023-08-09T06:06:06
2023-08-09T06:06:06
19,332,079
161
75
NOASSERTION
2023-09-13T19:06:40
2014-05-01T00:59:04
Java
UTF-8
Java
false
false
138
java
/** * This package contains the cataloger service implementation(s) */ package com.raytheon.uf.edex.registry.ebxml.services.cataloger;
[ "mjames@unidata.ucar.edu" ]
mjames@unidata.ucar.edu
ff57ab3beb3efcc942e1bb4d4c74c89cdff48d40
2e18d5a4f878b02c298e38fe36769a95ea684a7c
/Java/郝斌Java视频源码/【76-78】源代码/上机敲得程序/Test_2.java
11a3adb0efc8df51098294d81e5c0fb3f76f827b
[]
no_license
poetries/StudyNote
755ef734d1baa267591bff63f8b54081466b2082
e35685cc5c29f0299f5c042b94fe8f4740568b47
refs/heads/master
2021-01-21T13:29:42.098275
2016-05-17T11:12:10
2016-05-17T11:12:10
57,146,464
1
0
null
null
null
null
UTF-8
Java
false
false
183
java
class A { int i = 10; public void f() { int i = 20; System.out.println("i = " + i); } } public class Test_2 { public static void main(String[] args) { new A().f(); } }
[ "jingguanliuye@gmail.com" ]
jingguanliuye@gmail.com
2c3804cc31790ec5ad940598d68af1ec1e1ff58e
d9fa6145ac47929bb8e2a85bb0fdcad8afc5fd3a
/src/test/java/com/it/helpers/IncomingEmailListHelper.java
064a251af7bb9beaa2c03a41555b647f42140f2e
[]
no_license
Irina849/SuperProjectQA
225c12fb6dcfaa7adb73a72a9e86832ec9f96449
7c1ccb3ca46f810b78c39432bf75945618aa6e2a
refs/heads/master
2022-10-11T16:17:28.500083
2020-06-06T05:58:52
2020-06-06T05:58:52
266,498,540
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
package com.it.helpers; import com.it.pages.IncomingEmailListPage; public class IncomingEmailListHelper extends IncomingEmailListPage { }
[ "yridze849@gmail.com" ]
yridze849@gmail.com
edc5ad5c86207d426ef4f749317914b5b7fd6b46
94445f7ad3d19d2b02bf813349421f6911ca8d70
/src/main/java/oasis/names/specification/ubl/schema/xsd/commonbasiccomponents_2/SplitConsignmentIndicatorType.java
bf65eb5d08d6d28412f84a9933d2131d8523e5bd
[ "Apache-2.0" ]
permissive
project-smartlog/smartlog-client
f7ef19f203db7a696de4137163d1fe00a5736ed5
b59b90b70fca4fef39f44854c07458dad8d821f0
refs/heads/master
2020-04-25T03:48:42.214719
2019-02-25T12:05:15
2019-02-25T12:05:15
172,489,812
0
0
null
null
null
null
UTF-8
Java
false
false
1,324
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.11.17 at 03:30:58 PM EET // package oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_2; import oasis.names.specification.ubl.schema.xsd.unqualifieddatatypes_2.IndicatorType; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SplitConsignmentIndicatorType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SplitConsignmentIndicatorType"> * &lt;simpleContent> * &lt;extension base="&lt;urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2>IndicatorType"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SplitConsignmentIndicatorType") public class SplitConsignmentIndicatorType extends IndicatorType { }
[ "sami.hongisto@cygate.fi" ]
sami.hongisto@cygate.fi
e7e70e79d79f3d573a65c22dffb532ea44e2580f
2fd1b33dd3110777e9b41ee1371daf12a749a9ee
/Chap5/Listing_5_12.java
3b587a9fe10820d0bc95ba916eeeeed88561be4b
[]
no_license
HULLZHU/eclipse-workspace
04c474c3cdfdfc79567342974ef04c037e684fae
3989116abd9a994336e649af11650761693e92c3
refs/heads/master
2021-06-09T18:34:17.479825
2019-11-05T20:39:05
2019-11-05T20:39:05
145,763,364
1
0
null
null
null
null
UTF-8
Java
false
false
308
java
public class Listing_5_12 { public static void main(String[] args) { int sum = 0; int num = 0; while ( num < 20 && sum<=100) { num++; sum+= num; } System.out.println("The number is "+num); System.out.println("The sume is " + sum); // TODO Auto-generated method stub } }
[ "42597991+HULLZHU@users.noreply.github.com" ]
42597991+HULLZHU@users.noreply.github.com
b7016ed480a3b70ef4a390dd2ab1f3033ecca6a6
a2ef484d60bad19cde802d064bf745b771e916b4
/src/main/java/hung/com/jstl/control/UrlServlet.java
4e6d172d126f8a861f1993f9142d8ce0422020fa
[]
no_license
hungnguyenmanh82/J2EE_Jstl_JSP
b4117c941e2dfee55579054a327785ade0f2bf4d
8338efc6b579f7c1c100932cb3eaa75b465eaace
refs/heads/master
2020-03-20T15:06:00.282373
2018-06-17T10:09:33
2018-06-17T10:09:33
137,503,041
0
0
null
null
null
null
UTF-8
Java
false
false
1,107
java
package hung.com.jstl.control; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import hung.com.jstl.dao.PersonDao; import hung.com.jstl.model.Salary; /** * Servlet implementation class PersonsSevlet */ @WebServlet(urlPatterns = { "/url"}) public class UrlServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * Default constructor. */ public UrlServlet() { // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("*********** jstl: url"); //add Model to request request.setAttribute("url", new String("/jsp/index.jsp")); //call view request.getRequestDispatcher("/jsp/url.jsp").forward(request, response); } }
[ "hung.nguyen@netvisiontel.com" ]
hung.nguyen@netvisiontel.com
731e131d9d2777ac2da4ded658721998e7619347
5a63446befbb82d23911a55f96c61ddf59f4609a
/StrikeListFront/android/app/src/main/java/com/strikelist/MainActivity.java
003ac4ae0c4b4bbe3aae923dde441070c586d4ec
[]
no_license
moehringa/StrikeList
8c1a02817f27301ce955bc05ce42a6d0eb506c56
e910077bc1186da0ebbdda20cabf34558902bfc4
refs/heads/master
2021-09-01T08:50:23.837288
2017-12-26T03:12:56
2017-12-26T03:12:56
115,155,869
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package com.strikelist; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "StrikeList"; } }
[ "moehringa@xavier.edu" ]
moehringa@xavier.edu
326c64d0cbf2eaa41923bd6cbc7e590d4884e8ff
f1a1826a7bd1b9aec5c0aa6c9665cefed8a84bc7
/src/main/java/co/charbox/domain/model/test/SstResultsModelProvider.java
97633b9ccbdb5200a04927a527b624e52d061c68
[]
no_license
derek-walker404/charbox-domain
31623e702094080964e24285fafd885f7c7fdd42
fd262e285920aa5bc98599577a2d8335250fa591
refs/heads/master
2020-07-23T23:49:43.691453
2015-07-21T08:45:47
2015-07-21T08:45:47
30,953,110
0
0
null
null
null
null
UTF-8
Java
false
false
1,413
java
package co.charbox.domain.model.test; import org.joda.time.DateTime; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import co.charbox.domain.data.mysql.DeviceDAO; import co.charbox.domain.model.DeviceModel; import co.charbox.domain.model.SstResultsModel; @Component public class SstResultsModelProvider implements CharbotModelProvider<SstResultsModel> { private DeviceModel device; @Autowired private DeviceDAO deviceDao; @Autowired private DeviceModelProvider devicePro; @Autowired private ConnectionInfoModelProvider ciPro; @Autowired private SimpleLocationModelProvider slPro; @Override public SstResultsModel getModel(Integer id) { DateTime time = new DateTime(); time = time.minusMillis(time.getMillisOfSecond()); return SstResultsModel.builder() .device(getDevice()) .deviceInfo(ciPro.getModel(null)) .deviceToken("ASDGSDFHG%ERG!#$$FQERG!#QFQ") .downloadDuration(3001) .downloadSize(87567653425L) .downloadSpeed(56.234) .id(id) .pingDuration(28) .serverLocation(slPro.getModel(null)) .startTime(time) .uploadDuration(3002) .uploadSize(34524323466L) .uploadSpeed(12.544) .build(); } public DeviceModel getDevice() { if (device == null || deviceDao.find(device.getId()) == null) { device = deviceDao.insert(devicePro.getModel(null)); } return device; } }
[ "desposi1@gmail.com" ]
desposi1@gmail.com
6c98d1efbfb00d0b9b2c03b582fffc2b5e3a221c
8c191f497297420d5e38405139f708092c7f31d7
/p_vis/time/src/main/java/edu/zjut/chart/plot/ChartType.java
81bdb2faf3b2f062d30fe7842d7b14f1e747716d
[]
no_license
yulewei/p_vis
59dbd71edf0f764ac5c6cda49706b018903a0b25
ac05bcdf748e40b350b57cb659ede234fceb5a71
refs/heads/master
2021-01-01T19:07:02.875592
2012-05-21T07:40:27
2012-05-21T07:40:27
2,682,759
1
6
null
null
null
null
UTF-8
Java
false
false
398
java
package edu.zjut.chart.plot; public enum ChartType { POINT, LINE, CURVE, BAR, AREA, AREA_STACKED; public String toString() { switch (this) { case POINT: return "Point"; case LINE: return "Line"; case CURVE: return "Curve"; case BAR: return "Bar"; case AREA: return "Area"; case AREA_STACKED: return "Area Stacked"; } return null; } }
[ "yulewei@gmail.com" ]
yulewei@gmail.com
52e40207306518b5cff6cc0f0931b103b41b08a0
59e39b5aa12fdab5fbd7dc2d8dd9ad8d3460f15a
/totpauth-api/src/main/java/live/pinger/shibboleth/totpauth/api/authn/TokenValidator.java
c898161b1aaa48763fd0d05d8127bbe0699a225a
[ "Apache-2.0" ]
permissive
joeFischetti/Shibboleth-IdP3-TOTP-Auth
6309718f1419cb90b72a838bd8bef667538e4880
2dc4e1e7fc8d33c695e287b9ba82231a55f4f45d
refs/heads/master
2022-07-11T02:32:54.991422
2020-01-07T21:21:29
2020-01-07T21:21:29
222,457,619
3
3
NOASSERTION
2022-06-25T07:28:59
2019-11-18T13:38:05
Java
UTF-8
Java
false
false
146
java
package live.pinger.shibboleth.totpauth.api.authn; public interface TokenValidator { public boolean validateToken(String seed, int token); }
[ "jkfischetti@gmail.com" ]
jkfischetti@gmail.com
78eef25180faba5960f73a88909bf0fc08ae9705
b6c99f898cab624fa4f4af35326a190ce5bbba91
/src/main/java/logics/Game.java
f8dfa59928fba504c762180c84c2e6cdd3b05c65
[]
no_license
kltrist/tic-tac-toe-TelegramBot
daf7466accb4c4b4b8fb224ff1b945a8f4a80676
0b896101d2e7938dd5761f2556b8063eeeb3ec98
refs/heads/master
2020-05-02T12:51:22.820252
2019-05-16T08:15:13
2019-05-16T08:15:13
177,967,725
0
0
null
null
null
null
UTF-8
Java
false
false
2,733
java
package logics; import gui.render.RenderService; import board.Board; import player.AbstractPlayer; import java.io.IOException; import java.io.Serializable; public class Game implements Serializable { private AbstractPlayer firstPl; private AbstractPlayer secondPl; private RenderService rn; private Board board; private boolean isInterrupted; Game(AbstractPlayer firstPl, AbstractPlayer secondPl, RenderService rn, Board board) { if (firstPl.getSymbol() == secondPl.getSymbol()) throw new IllegalArgumentException("You cannot set the same symbols!"); this.firstPl = firstPl; this.secondPl = secondPl; this.board = board; this.rn = rn; } private boolean makeMove(int moveIndex, char symbol) { return board.setCell(symbol, moveIndex); } private boolean isAvailable() { return !board.getAvailableCellIndexes().isEmpty(); } private boolean isWin(AbstractPlayer player) { char value = player.getSymbol(); return ((board.getCell(0) == board.getCell(1) && board.getCell(1) == board.getCell(2) && board.getCell(2) == value) || (board.getCell(3) == board.getCell(4) && board.getCell(4) == board.getCell(5) && board.getCell(5) == value) || (board.getCell(6) == board.getCell(7) && board.getCell(7) == board.getCell(8) && board.getCell(8) == value) || (board.getCell(0) == board.getCell(4) && board.getCell(4) == board.getCell(8) && board.getCell(8) == value) || (board.getCell(2) == board.getCell(4) && board.getCell(4) == board.getCell(6) && board.getCell(6) == value) || (board.getCell(0) == board.getCell(3) && board.getCell(3) == board.getCell(6) && board.getCell(6) == value) || (board.getCell(1) == board.getCell(4) && board.getCell(4) == board.getCell(7) && board.getCell(7) == value) || (board.getCell(2) == board.getCell(5) && board.getCell(5) == board.getCell(8) && board.getCell(8) == value)); } AbstractPlayer play(boolean is1stPlayerMove) { AbstractPlayer winner = null; isInterrupted = false; int moveSwitcher = is1stPlayerMove ? 0 : 1; while (isAvailable() && !isInterrupted) { rn.renderBoard(board); AbstractPlayer plr = moveSwitcher == 0 ? firstPl : secondPl; makeMove(plr.move(), plr.getSymbol()); if (isWin(plr)) { winner = plr; break; } else if (!isAvailable()) { break; } moveSwitcher = (moveSwitcher == 0) ? 1 : 0; } rn.renderBoard(board); return winner; } }
[ "overdno228@gmail.com" ]
overdno228@gmail.com
314b17d4c6462cb2e601973e16c39a9bdef8fc44
559f786f7830b5fcbb0dc807c48bf2b41410dacb
/RecyclerViewGmail/app/src/main/java/com/example/maobuidinh/recyclerviewgmail/model/Message.java
047b4c3413b30e822be5954ae1a4e3c5cfb14028
[]
no_license
maobui/android
75fa0aa9769923febce741631b9ec81dfd1bd90e
49742da7cc13fc1b05b0140ecbf5c993a35e1b06
refs/heads/master
2021-09-10T06:33:28.761960
2018-03-21T15:53:57
2018-03-21T15:53:57
59,539,221
0
0
null
2018-03-17T03:27:23
2016-05-24T04:02:23
Java
UTF-8
Java
false
false
1,673
java
package com.example.maobuidinh.recyclerviewgmail.model; /** * Created by maobuidinh on 6/2/2017. */ public class Message { private int id; private String from; private String subject; private String message; private String timestamp; private String picture; private boolean isImportant; private boolean isRead; private int color = -1; public Message() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getTimestamp() { return timestamp; } public void setTimestamp(String timestamp) { this.timestamp = timestamp; } public String getPicture() { return picture; } public void setPicture(String picture) { this.picture = picture; } public boolean isImportant() { return isImportant; } public void setImportant(boolean important) { isImportant = important; } public boolean isRead() { return isRead; } public void setRead(boolean read) { isRead = read; } public int getColor() { return color; } public void setColor(int color) { this.color = color; } }
[ "mao.buidinh@hotmail.com" ]
mao.buidinh@hotmail.com
fb0cc8fdbf15fcfa9efe4c74d8748b61f99115f5
dae6d1d93e917428d6b716ba35def452cae4aad9
/Tecnicas/src/ar/com/fi/uba/tecnicas/persistencia/RepositorioAlumnoGrupo.java
f928c2fd5552673cded2cf20960b43b345e96151
[]
no_license
iangrigiani/ahoratecnicas2012
4cc98c3ca262005a7a6eab30bef3a84baad9a749
82354ee1342eb56e8afeb6216ccd47e164ae3a30
refs/heads/master
2020-05-19T09:02:21.338656
2012-11-29T22:02:04
2012-11-29T22:02:04
40,673,887
0
0
null
null
null
null
UTF-8
Java
false
false
2,791
java
package ar.com.fi.uba.tecnicas.persistencia; import java.io.File; import java.util.ArrayList; import java.util.List; import ar.com.fi.uba.tecnicas.Configuracion; import ar.com.fi.uba.tecnicas.modelo.entidades.AlumnoGrupo; import ar.com.fi.uba.tecnicas.modelo.excepciones.ValidacionExcepcion; import com.thoughtworks.xstream.persistence.FilePersistenceStrategy; import com.thoughtworks.xstream.persistence.PersistenceStrategy; import com.thoughtworks.xstream.persistence.XmlArrayList; public class RepositorioAlumnoGrupo implements Repositorio<AlumnoGrupo> { private static final String CARPETA_ALUMNO_GRUPO = "/alumno_grupo"; private static RepositorioAlumnoGrupo INSTANCE; static { File file = new File(Configuracion.DIRECTORIO_PRESISTENCIA_BASE + CARPETA_ALUMNO_GRUPO); if (!file.exists()) { file.mkdir(); } } private PersistenceStrategy strategyAlumnoGrupo = new FilePersistenceStrategy(new File(Configuracion.DIRECTORIO_PRESISTENCIA_BASE + CARPETA_ALUMNO_GRUPO)); @SuppressWarnings("unchecked") private List<AlumnoGrupo> alumnoGrupos = new XmlArrayList(strategyAlumnoGrupo); public static Repositorio<AlumnoGrupo> getInstance() { if (INSTANCE == null) { INSTANCE = new RepositorioAlumnoGrupo(); } return INSTANCE; } private RepositorioAlumnoGrupo() { } @Override public AlumnoGrupo obtener(String nombre) { List<AlumnoGrupo> elementoAlumnoGrupo = obtenerAlumnoGrupoPorPadron(alumnoGrupos, nombre); if (elementoAlumnoGrupo != null && !elementoAlumnoGrupo.isEmpty()) { return elementoAlumnoGrupo.get(0); } return null; } @Override public void agregar(AlumnoGrupo grupo) throws ValidacionExcepcion { if (alumnoGrupos.contains(grupo)) { throw new ValidacionExcepcion("Ya existe el alumno en algun grupo en este cuatrimestre."); } alumnoGrupos.add((AlumnoGrupo)grupo); } @Override public void vaciar() { alumnoGrupos.clear(); } @Override public void quitar(String nombre) { AlumnoGrupo grupo = obtener(nombre); removerAlumnoGrupo(alumnoGrupos, grupo); } private void removerAlumnoGrupo(List<? extends AlumnoGrupo> grupos, AlumnoGrupo grupo) { grupos.remove(grupo); } private List<AlumnoGrupo> obtenerAlumnoGrupoPorPadron(List<? extends AlumnoGrupo> grupos, String codigo) { List<AlumnoGrupo> gruposByCodigo = new ArrayList<AlumnoGrupo>(); if (grupos != null && !grupos.isEmpty()) { for (AlumnoGrupo grupo : grupos) { if (grupo.getPadron().equals(codigo)) { gruposByCodigo.add(grupo); } } } return gruposByCodigo; } @Override public List<AlumnoGrupo> obtenerTodos() { return new ArrayList<AlumnoGrupo>(alumnoGrupos); } @Override public List<AlumnoGrupo> obtenerTodos(String clave) { return obtenerAlumnoGrupoPorPadron(alumnoGrupos, clave); } }
[ "ramiro.salom@gmail.com" ]
ramiro.salom@gmail.com
bbdb45242d24fcc708c49ee7aa45559f5dbca573
95296e4d72fc41bf201ec1d7829541a3894995d0
/v2/code_ext/src/sw4j/vocabulary/pml/PMLDS.java
275564aa990820833eaab580a6ae15976323b1b4
[]
no_license
lidingpku/sw4j
4052ea03d4d7e8d2e77eb823b9fc5a4d9889bb83
1378171d49c1381902ed4605a7c6c24864a16804
refs/heads/master
2016-09-05T21:45:50.993736
2011-04-04T07:33:33
2011-04-04T07:33:33
32,132,742
0
0
null
null
null
null
UTF-8
Java
false
false
2,149
java
/** * PMLDS.java * * This file is automatically generated by PML API * generated on Sat Jan 16 17:14:23 EST 2010 * * @author: Li Ding (http://www.cs.rpi.edu/~dingl ) * */ package sw4j.vocabulary.pml; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.ResourceFactory; /** * * * Ontology information * label: Data Structure Ontology (v 0.1.1)@en * comment: This ontology offers OWL-Lite definition for object list. It is a restricted version of OWL-S ObjectList (http://www.daml.org/services/owl-s/1.1/generic/ObjectList.owl). It is compatible to rdf:List with the following differences: (i) OWL individuals as list members and (ii) appropriate property cardinality restriction. The range of first will specified by the subclasses. @en */ public class PMLDS{ protected static final String NS = "http://inference-web.org/2.0/ds.owl#"; public static final String getURI(){ return NS; } // Class (1) public final static String List_lname = "List"; public final static String List_qname = "pmlds:List"; public final static String List_uri = "http://inference-web.org/2.0/ds.owl#List"; public final static Resource List = ResourceFactory.createResource(List_uri); // Property (2) public final static String first_lname = "first"; public final static String first_qname = "pmlds:first"; public final static String first_uri = "http://inference-web.org/2.0/ds.owl#first"; public final static Property first = ResourceFactory.createProperty(first_uri); public final static String rest_lname = "rest"; public final static String rest_qname = "pmlds:rest"; public final static String rest_uri = "http://inference-web.org/2.0/ds.owl#rest"; public final static Property rest = ResourceFactory.createProperty(rest_uri); // Instance (1) public final static String nil_lname = "nil"; public final static String nil_qname = "pmlds:nil"; public final static String nil_uri = "http://inference-web.org/2.0/ds.owl#nil"; public final static Resource nil = ResourceFactory.createResource(nil_uri); }
[ "lidingpku@23d186f6-0d78-11de-b321-f573fdaff03e" ]
lidingpku@23d186f6-0d78-11de-b321-f573fdaff03e
686bdac67f016920ac073e714fcd61ab11cf2c62
890af51efbc9b8237e0fd09903f78fe2bb9caadd
/general/hr/com/hd/agent/hr/service/impl/SigninServiceImpl.java
3370b5a74994f7ac102f18377621ecc33e72bb2a
[]
no_license
1045907427/project
815fb0c5b4b44bf5d8365acfde61b6f68be6e52a
6eaecf09cd3414295ccf91454f62cf4d619cdbf2
refs/heads/master
2020-04-14T19:17:54.310613
2019-01-14T10:49:11
2019-01-14T10:49:11
164,052,678
0
5
null
null
null
null
UTF-8
Java
false
false
2,412
java
/** * @(#)SigninServiceImpl.java * * @author limin * * 版本历史 * ------------------------------------------------------------------------- * 时间 作者 内容 * ------------------------------------------------------------------------- * 2014-9-18 limin 创建版本 */ package com.hd.agent.hr.service.impl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.hd.agent.basefiles.model.DepartMent; import com.hd.agent.common.service.impl.BaseServiceImpl; import com.hd.agent.common.util.PageData; import com.hd.agent.common.util.PageMap; import com.hd.agent.hr.dao.SigninMapper; import com.hd.agent.hr.model.Signin; import com.hd.agent.hr.service.ISigninService; import org.apache.commons.lang3.StringUtils; /** * * * @author limin */ public class SigninServiceImpl extends BaseServiceImpl implements ISigninService { private SigninMapper signinMapper; public SigninMapper getSigninMapper() { return signinMapper; } public void setSigninMapper(SigninMapper signinMapper) { this.signinMapper = signinMapper; } @Override public PageData selectSigninList(PageMap map) throws Exception { int cnt = signinMapper.selectSigninListCount(map); List<Signin> list = (List<Signin>)signinMapper.selectSigninList(map); for(Signin signin : list) { String deptid = signin.getDeptid(); if(StringUtils.isNotEmpty(deptid)) { DepartMent dept = getDepartmentByDeptid(deptid); if (dept != null) { signin.setDeptname(dept.getName()); } } } PageData data = new PageData(cnt, list, map); return data; } @Override public Signin selectSigninInfo(String id) throws Exception { Signin signin = signinMapper.selectSigninInfo(id); return signin; } @Override public Map deleteSignin(String ids) throws Exception { String[] idArr = ids.split(","); int success = 0; String successIds = ""; int failure = 0; for(String id : idArr) { int ret = signinMapper.deleteSignin(id); if(ret == 0) { failure++; } else { success++; successIds = successIds + "," + id; } } Map map = new HashMap(); map.put("success", success); map.put("failure", failure); map.put("successIds", successIds.length() > 0 ? successIds.substring(1) : ""); return map; } }
[ "1045907427@qq.com" ]
1045907427@qq.com
d8b7d7dfb1b04c4d84d57cbce47e6dca5667bc6c
04c6528aed25dab63bde3ef3e2dfd78757d09b10
/PickView/src/main/java/com/ouyangzn/lib/pickview/listener/OnItemSelectedListener.java
5825976311abd34c55423783012d29c303fc4d1c
[]
no_license
ouyangzn/Android-Library
26e4ff6b2ae1744c998519e8298508ecabe20cf8
28cfe3f01767bcbcd662241f021c87edc03cc23f
refs/heads/master
2021-01-21T08:20:57.435693
2016-09-27T03:17:33
2016-09-27T03:17:33
68,595,242
0
0
null
null
null
null
UTF-8
Java
false
false
123
java
package com.ouyangzn.lib.pickview.listener; public interface OnItemSelectedListener { void onItemSelected(int index); }
[ "ouyangzn@163.com" ]
ouyangzn@163.com
4597a456c4bb91624e9c5f9e40807ee08ad8797a
bad06c5495a7ccb812e0592184efb3e35e417fda
/Tokens/bikemarket/contracts/src/main/java/net/corda/samples/bikemarket/states/WheelsTokenState.java
b542bcbf28cafd1e7bdb1afb6b607e6d0e34755f
[ "Apache-2.0" ]
permissive
Vs-karma/AmexHack
66c5d0fe814f0cba71080c1df201bacf6c5f225d
67919c82e4ae4cd56b366a90f9b9791e75171bc6
refs/heads/master
2023-08-15T18:04:55.819721
2021-10-14T08:50:43
2021-10-14T08:50:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,903
java
package net.corda.samples.bikemarket.states; import com.google.common.collect.ImmutableList; import com.r3.corda.lib.tokens.contracts.states.EvolvableTokenType; import com.r3.corda.lib.tokens.contracts.types.TokenPointer; import net.corda.core.contracts.LinearPointer; import net.corda.samples.bikemarket.contracts.WheelsContract; import net.corda.core.contracts.BelongsToContract; import net.corda.core.contracts.UniqueIdentifier; import net.corda.core.identity.Party; import org.jetbrains.annotations.NotNull; import java.util.List; @BelongsToContract(WheelsContract.class) public class WheelsTokenState extends EvolvableTokenType { private final Party maintainer; private final UniqueIdentifier uniqueIdentifier; private final int fractionDigits; private final String serialNum; public WheelsTokenState(Party maintainer, UniqueIdentifier uniqueIdentifier, int fractionDigits, String serialNum) { this.maintainer = maintainer; this.uniqueIdentifier = uniqueIdentifier; this.fractionDigits = fractionDigits; this.serialNum = serialNum; } public String getserialNum() { return serialNum; } public Party getIssuer() { return maintainer; } @Override public int getFractionDigits() { return this.fractionDigits; } @NotNull @Override public List<Party> getMaintainers() { return ImmutableList.of(maintainer); } @NotNull @Override public UniqueIdentifier getLinearId() { return this.uniqueIdentifier; } /* This method returns a TokenPointer by using the linear Id of the evolvable state */ public TokenPointer<WheelsTokenState> toPointer(){ LinearPointer<WheelsTokenState> linearPointer = new LinearPointer<>(uniqueIdentifier, WheelsTokenState.class); return new TokenPointer<>(linearPointer, fractionDigits); } }
[ "lobrockyl@gmail.com" ]
lobrockyl@gmail.com
c1ccc0b1482aea726eee5eef70a124ddd4bcc1d4
2150684ba8f9ce2e43f1f548080c28146810fa67
/app/src/main/java/com/example/bestactors/LoginActivity.java
489250b2060eb56d44d433205e9393035cab112a
[]
no_license
Refa-Ghaznavi/BestActors
c6abbe55a2ab840ca08ea492f6e17934b20d830f
19a6ee73134cf07128ab286e22a4f491c648c9f4
refs/heads/master
2022-12-27T03:54:23.825435
2020-10-03T08:12:04
2020-10-03T08:12:04
238,553,536
1
0
null
null
null
null
UTF-8
Java
false
false
2,743
java
package com.example.bestactors; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; public class LoginActivity extends AppCompatActivity { EditText etEmail,etPssword; Button btnLogin; TextView tvSignUp; FirebaseAuth mAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); mAuth=FirebaseAuth.getInstance(); etEmail=findViewById(R.id.etEmalil); etPssword=findViewById(R.id.etPassword); btnLogin=findViewById(R.id.btnLogin); tvSignUp=findViewById(R.id.tvSignUp); btnLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String email=etEmail.getText().toString(); String password=etPssword.getText().toString(); mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()){ Intent intent=new Intent(LoginActivity.this,MainActivity.class); startActivity(intent); finish(); } else { Toast.makeText(LoginActivity.this, "There is a problem in Sign iN", Toast.LENGTH_SHORT).show(); } } }); } }); tvSignUp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(LoginActivity.this,SignUpActivity.class); startActivity(intent); } }); } @Override protected void onStart() { super.onStart(); FirebaseUser currentUser = mAuth.getCurrentUser(); if (currentUser!=null){ Intent intent=new Intent(LoginActivity.this,MainActivity.class); startActivity(intent); finish(); } } }
[ "refaghanavi@gmail.com" ]
refaghanavi@gmail.com
89a6a2b6a0470538b731528af10a14f11254b5f0
5598faaaaa6b3d1d8502cbdaca903f9037d99600
/code_changes/Apache_projects/MAPREDUCE-44/db06f1bcb98270cd1c36e314f818886f1ef7fd77/~MRJobConfig.java
24c3399449355c7b9dacddd0d154465aef7f5fa2
[ "Apache-2.0" ]
permissive
SPEAR-SE/LogInBugReportsEmpirical_Data
94d1178346b4624ebe90cf515702fac86f8e2672
ab9603c66899b48b0b86bdf63ae7f7a604212b29
refs/heads/master
2022-12-18T02:07:18.084659
2020-09-09T16:49:34
2020-09-09T16:49:34
286,338,252
0
2
null
null
null
null
UTF-8
Java
false
false
28,376
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.mapreduce; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; @InterfaceAudience.Private @InterfaceStability.Evolving public interface MRJobConfig { // Put all of the attribute names in here so that Job and JobContext are // consistent. public static final String INPUT_FORMAT_CLASS_ATTR = "mapreduce.job.inputformat.class"; public static final String MAP_CLASS_ATTR = "mapreduce.job.map.class"; public static final String MAP_OUTPUT_COLLECTOR_CLASS_ATTR = "mapreduce.job.map.output.collector.class"; public static final String COMBINE_CLASS_ATTR = "mapreduce.job.combine.class"; public static final String REDUCE_CLASS_ATTR = "mapreduce.job.reduce.class"; public static final String OUTPUT_FORMAT_CLASS_ATTR = "mapreduce.job.outputformat.class"; public static final String PARTITIONER_CLASS_ATTR = "mapreduce.job.partitioner.class"; public static final String SETUP_CLEANUP_NEEDED = "mapreduce.job.committer.setup.cleanup.needed"; public static final String TASK_CLEANUP_NEEDED = "mapreduce.job.committer.task.cleanup.needed"; public static final String JAR = "mapreduce.job.jar"; public static final String ID = "mapreduce.job.id"; public static final String JOB_NAME = "mapreduce.job.name"; public static final String JAR_UNPACK_PATTERN = "mapreduce.job.jar.unpack.pattern"; public static final String USER_NAME = "mapreduce.job.user.name"; public static final String PRIORITY = "mapreduce.job.priority"; public static final String QUEUE_NAME = "mapreduce.job.queuename"; public static final String JVM_NUMTASKS_TORUN = "mapreduce.job.jvm.numtasks"; public static final String SPLIT_FILE = "mapreduce.job.splitfile"; public static final String SPLIT_METAINFO_MAXSIZE = "mapreduce.job.split.metainfo.maxsize"; public static final long DEFAULT_SPLIT_METAINFO_MAXSIZE = 10000000L; public static final String NUM_MAPS = "mapreduce.job.maps"; public static final String MAX_TASK_FAILURES_PER_TRACKER = "mapreduce.job.maxtaskfailures.per.tracker"; public static final String COMPLETED_MAPS_FOR_REDUCE_SLOWSTART = "mapreduce.job.reduce.slowstart.completedmaps"; public static final String NUM_REDUCES = "mapreduce.job.reduces"; public static final String SKIP_RECORDS = "mapreduce.job.skiprecords"; public static final String SKIP_OUTDIR = "mapreduce.job.skip.outdir"; public static final String SPECULATIVE_SLOWNODE_THRESHOLD = "mapreduce.job.speculative.slownodethreshold"; public static final String SPECULATIVE_SLOWTASK_THRESHOLD = "mapreduce.job.speculative.slowtaskthreshold"; public static final String SPECULATIVECAP = "mapreduce.job.speculative.speculativecap"; public static final String JOB_LOCAL_DIR = "mapreduce.job.local.dir"; public static final String OUTPUT_KEY_CLASS = "mapreduce.job.output.key.class"; public static final String OUTPUT_VALUE_CLASS = "mapreduce.job.output.value.class"; public static final String KEY_COMPARATOR = "mapreduce.job.output.key.comparator.class"; public static final String GROUP_COMPARATOR_CLASS = "mapreduce.job.output.group.comparator.class"; public static final String WORKING_DIR = "mapreduce.job.working.dir"; public static final String CLASSPATH_ARCHIVES = "mapreduce.job.classpath.archives"; public static final String CLASSPATH_FILES = "mapreduce.job.classpath.files"; public static final String CACHE_FILES = "mapreduce.job.cache.files"; public static final String CACHE_ARCHIVES = "mapreduce.job.cache.archives"; public static final String CACHE_FILES_SIZES = "mapreduce.job.cache.files.filesizes"; // internal use only public static final String CACHE_ARCHIVES_SIZES = "mapreduce.job.cache.archives.filesizes"; // ditto public static final String CACHE_LOCALFILES = "mapreduce.job.cache.local.files"; public static final String CACHE_LOCALARCHIVES = "mapreduce.job.cache.local.archives"; public static final String CACHE_FILE_TIMESTAMPS = "mapreduce.job.cache.files.timestamps"; public static final String CACHE_ARCHIVES_TIMESTAMPS = "mapreduce.job.cache.archives.timestamps"; public static final String CACHE_FILE_VISIBILITIES = "mapreduce.job.cache.files.visibilities"; public static final String CACHE_ARCHIVES_VISIBILITIES = "mapreduce.job.cache.archives.visibilities"; /** * @deprecated Symlinks are always on and cannot be disabled. */ @Deprecated public static final String CACHE_SYMLINK = "mapreduce.job.cache.symlink.create"; public static final String USER_LOG_RETAIN_HOURS = "mapreduce.job.userlog.retain.hours"; public static final String MAPREDUCE_JOB_USER_CLASSPATH_FIRST = "mapreduce.job.user.classpath.first"; public static final String MAPREDUCE_JOB_CLASSLOADER = "mapreduce.job.classloader"; public static final String MAPREDUCE_JOB_CLASSLOADER_SYSTEM_CLASSES = "mapreduce.job.classloader.system.classes"; public static final String MAPREDUCE_JVM_SYSTEM_PROPERTIES_TO_LOG = "mapreduce.jvm.system-properties-to-log"; public static final String DEFAULT_MAPREDUCE_JVM_SYSTEM_PROPERTIES_TO_LOG = "os.name,os.version,java.home,java.runtime.version,java.vendor," + "java.version,java.vm.name,java.class.path,java.io.tmpdir,user.dir,user.name"; public static final String IO_SORT_FACTOR = "mapreduce.task.io.sort.factor"; public static final String IO_SORT_MB = "mapreduce.task.io.sort.mb"; public static final String INDEX_CACHE_MEMORY_LIMIT = "mapreduce.task.index.cache.limit.bytes"; public static final String PRESERVE_FAILED_TASK_FILES = "mapreduce.task.files.preserve.failedtasks"; public static final String PRESERVE_FILES_PATTERN = "mapreduce.task.files.preserve.filepattern"; public static final String TASK_TEMP_DIR = "mapreduce.task.tmp.dir"; public static final String TASK_DEBUGOUT_LINES = "mapreduce.task.debugout.lines"; public static final String RECORDS_BEFORE_PROGRESS = "mapreduce.task.merge.progress.records"; public static final String SKIP_START_ATTEMPTS = "mapreduce.task.skip.start.attempts"; public static final String TASK_ATTEMPT_ID = "mapreduce.task.attempt.id"; public static final String TASK_ISMAP = "mapreduce.task.ismap"; public static final String TASK_PARTITION = "mapreduce.task.partition"; public static final String TASK_PROFILE = "mapreduce.task.profile"; public static final String TASK_PROFILE_PARAMS = "mapreduce.task.profile.params"; public static final String NUM_MAP_PROFILES = "mapreduce.task.profile.maps"; public static final String NUM_REDUCE_PROFILES = "mapreduce.task.profile.reduces"; public static final String TASK_MAP_PROFILE_PARAMS = "mapreduce.task.profile.map.params"; public static final String TASK_REDUCE_PROFILE_PARAMS = "mapreduce.task.profile.reduce.params"; public static final String TASK_TIMEOUT = "mapreduce.task.timeout"; public static final String TASK_TIMEOUT_CHECK_INTERVAL_MS = "mapreduce.task.timeout.check-interval-ms"; public static final String TASK_ID = "mapreduce.task.id"; public static final String TASK_OUTPUT_DIR = "mapreduce.task.output.dir"; public static final String TASK_USERLOG_LIMIT = "mapreduce.task.userlog.limit.kb"; public static final String MAP_SORT_SPILL_PERCENT = "mapreduce.map.sort.spill.percent"; public static final String MAP_INPUT_FILE = "mapreduce.map.input.file"; public static final String MAP_INPUT_PATH = "mapreduce.map.input.length"; public static final String MAP_INPUT_START = "mapreduce.map.input.start"; public static final String MAP_MEMORY_MB = "mapreduce.map.memory.mb"; public static final int DEFAULT_MAP_MEMORY_MB = 1024; public static final String MAP_CPU_VCORES = "mapreduce.map.cpu.vcores"; public static final int DEFAULT_MAP_CPU_VCORES = 1; public static final String MAP_ENV = "mapreduce.map.env"; public static final String MAP_JAVA_OPTS = "mapreduce.map.java.opts"; public static final String MAP_MAX_ATTEMPTS = "mapreduce.map.maxattempts"; public static final String MAP_DEBUG_SCRIPT = "mapreduce.map.debug.script"; public static final String MAP_SPECULATIVE = "mapreduce.map.speculative"; public static final String MAP_FAILURES_MAX_PERCENT = "mapreduce.map.failures.maxpercent"; public static final String MAP_SKIP_INCR_PROC_COUNT = "mapreduce.map.skip.proc-count.auto-incr"; public static final String MAP_SKIP_MAX_RECORDS = "mapreduce.map.skip.maxrecords"; public static final String MAP_COMBINE_MIN_SPILLS = "mapreduce.map.combine.minspills"; public static final String MAP_OUTPUT_COMPRESS = "mapreduce.map.output.compress"; public static final String MAP_OUTPUT_COMPRESS_CODEC = "mapreduce.map.output.compress.codec"; public static final String MAP_OUTPUT_KEY_CLASS = "mapreduce.map.output.key.class"; public static final String MAP_OUTPUT_VALUE_CLASS = "mapreduce.map.output.value.class"; public static final String MAP_OUTPUT_KEY_FIELD_SEPERATOR = "mapreduce.map.output.key.field.separator"; public static final String MAP_LOG_LEVEL = "mapreduce.map.log.level"; public static final String REDUCE_LOG_LEVEL = "mapreduce.reduce.log.level"; public static final String DEFAULT_LOG_LEVEL = "INFO"; public static final String REDUCE_MERGE_INMEM_THRESHOLD = "mapreduce.reduce.merge.inmem.threshold"; public static final String REDUCE_INPUT_BUFFER_PERCENT = "mapreduce.reduce.input.buffer.percent"; public static final String REDUCE_MARKRESET_BUFFER_PERCENT = "mapreduce.reduce.markreset.buffer.percent"; public static final String REDUCE_MARKRESET_BUFFER_SIZE = "mapreduce.reduce.markreset.buffer.size"; public static final String REDUCE_MEMORY_MB = "mapreduce.reduce.memory.mb"; public static final int DEFAULT_REDUCE_MEMORY_MB = 1024; public static final String REDUCE_CPU_VCORES = "mapreduce.reduce.cpu.vcores"; public static final int DEFAULT_REDUCE_CPU_VCORES = 1; public static final String REDUCE_MEMORY_TOTAL_BYTES = "mapreduce.reduce.memory.totalbytes"; public static final String SHUFFLE_INPUT_BUFFER_PERCENT = "mapreduce.reduce.shuffle.input.buffer.percent"; public static final String SHUFFLE_MEMORY_LIMIT_PERCENT = "mapreduce.reduce.shuffle.memory.limit.percent"; public static final String SHUFFLE_MERGE_PERCENT = "mapreduce.reduce.shuffle.merge.percent"; public static final String REDUCE_FAILURES_MAXPERCENT = "mapreduce.reduce.failures.maxpercent"; public static final String REDUCE_ENV = "mapreduce.reduce.env"; public static final String REDUCE_JAVA_OPTS = "mapreduce.reduce.java.opts"; public static final String MAPREDUCE_JOB_DIR = "mapreduce.job.dir"; public static final String REDUCE_MAX_ATTEMPTS = "mapreduce.reduce.maxattempts"; public static final String SHUFFLE_PARALLEL_COPIES = "mapreduce.reduce.shuffle.parallelcopies"; public static final String REDUCE_DEBUG_SCRIPT = "mapreduce.reduce.debug.script"; public static final String REDUCE_SPECULATIVE = "mapreduce.reduce.speculative"; public static final String SHUFFLE_CONNECT_TIMEOUT = "mapreduce.reduce.shuffle.connect.timeout"; public static final String SHUFFLE_READ_TIMEOUT = "mapreduce.reduce.shuffle.read.timeout"; public static final String SHUFFLE_FETCH_FAILURES = "mapreduce.reduce.shuffle.maxfetchfailures"; public static final String SHUFFLE_NOTIFY_READERROR = "mapreduce.reduce.shuffle.notify.readerror"; public static final String MAX_SHUFFLE_FETCH_RETRY_DELAY = "mapreduce.reduce.shuffle.retry-delay.max.ms"; public static final long DEFAULT_MAX_SHUFFLE_FETCH_RETRY_DELAY = 60000; public static final String REDUCE_SKIP_INCR_PROC_COUNT = "mapreduce.reduce.skip.proc-count.auto-incr"; public static final String REDUCE_SKIP_MAXGROUPS = "mapreduce.reduce.skip.maxgroups"; public static final String REDUCE_MEMTOMEM_THRESHOLD = "mapreduce.reduce.merge.memtomem.threshold"; public static final String REDUCE_MEMTOMEM_ENABLED = "mapreduce.reduce.merge.memtomem.enabled"; public static final String COMBINE_RECORDS_BEFORE_PROGRESS = "mapreduce.task.combine.progress.records"; public static final String JOB_NAMENODES = "mapreduce.job.hdfs-servers"; public static final String JOB_JOBTRACKER_ID = "mapreduce.job.kerberos.jtprinicipal"; public static final String JOB_CANCEL_DELEGATION_TOKEN = "mapreduce.job.complete.cancel.delegation.tokens"; public static final String JOB_ACL_VIEW_JOB = "mapreduce.job.acl-view-job"; public static final String DEFAULT_JOB_ACL_VIEW_JOB = " "; public static final String JOB_ACL_MODIFY_JOB = "mapreduce.job.acl-modify-job"; public static final String DEFAULT_JOB_ACL_MODIFY_JOB = " "; /* config for tracking the local file where all the credentials for the job * credentials. */ public static final String MAPREDUCE_JOB_CREDENTIALS_BINARY = "mapreduce.job.credentials.binary"; /* Configs for tracking ids of tokens used by a job */ public static final String JOB_TOKEN_TRACKING_IDS_ENABLED = "mapreduce.job.token.tracking.ids.enabled"; public static final boolean DEFAULT_JOB_TOKEN_TRACKING_IDS_ENABLED = false; public static final String JOB_TOKEN_TRACKING_IDS = "mapreduce.job.token.tracking.ids"; public static final String JOB_SUBMITHOST = "mapreduce.job.submithostname"; public static final String JOB_SUBMITHOSTADDR = "mapreduce.job.submithostaddress"; public static final String COUNTERS_MAX_KEY = "mapreduce.job.counters.max"; public static final int COUNTERS_MAX_DEFAULT = 120; public static final String COUNTER_GROUP_NAME_MAX_KEY = "mapreduce.job.counters.group.name.max"; public static final int COUNTER_GROUP_NAME_MAX_DEFAULT = 128; public static final String COUNTER_NAME_MAX_KEY = "mapreduce.job.counters.counter.name.max"; public static final int COUNTER_NAME_MAX_DEFAULT = 64; public static final String COUNTER_GROUPS_MAX_KEY = "mapreduce.job.counters.groups.max"; public static final int COUNTER_GROUPS_MAX_DEFAULT = 50; public static final String JOB_UBERTASK_ENABLE = "mapreduce.job.ubertask.enable"; public static final String JOB_UBERTASK_MAXMAPS = "mapreduce.job.ubertask.maxmaps"; public static final String JOB_UBERTASK_MAXREDUCES = "mapreduce.job.ubertask.maxreduces"; public static final String JOB_UBERTASK_MAXBYTES = "mapreduce.job.ubertask.maxbytes"; public static final String MR_PREFIX = "yarn.app.mapreduce."; public static final String MR_AM_PREFIX = MR_PREFIX + "am."; /** The number of client retires to the AM - before reconnecting to the RM * to fetch Application State. */ public static final String MR_CLIENT_TO_AM_IPC_MAX_RETRIES = MR_PREFIX + "client-am.ipc.max-retries"; public static final int DEFAULT_MR_CLIENT_TO_AM_IPC_MAX_RETRIES = 3; /** * The number of client retries to the RM/HS before throwing exception. */ public static final String MR_CLIENT_MAX_RETRIES = MR_PREFIX + "client.max-retries"; public static final int DEFAULT_MR_CLIENT_MAX_RETRIES = 3; /** The staging directory for map reduce.*/ public static final String MR_AM_STAGING_DIR = MR_AM_PREFIX+"staging-dir"; public static final String DEFAULT_MR_AM_STAGING_DIR = "/tmp/hadoop-yarn/staging"; /** The amount of memory the MR app master needs.*/ public static final String MR_AM_VMEM_MB = MR_AM_PREFIX+"resource.mb"; public static final int DEFAULT_MR_AM_VMEM_MB = 1536; /** The number of virtual cores the MR app master needs.*/ public static final String MR_AM_CPU_VCORES = MR_AM_PREFIX+"resource.cpu-vcores"; public static final int DEFAULT_MR_AM_CPU_VCORES = 1; /** Command line arguments passed to the MR app master.*/ public static final String MR_AM_COMMAND_OPTS = MR_AM_PREFIX+"command-opts"; public static final String DEFAULT_MR_AM_COMMAND_OPTS = "-Xmx1024m"; /** Admin command opts passed to the MR app master.*/ public static final String MR_AM_ADMIN_COMMAND_OPTS = MR_AM_PREFIX+"admin-command-opts"; public static final String DEFAULT_MR_AM_ADMIN_COMMAND_OPTS = ""; /** Root Logging level passed to the MR app master.*/ public static final String MR_AM_LOG_LEVEL = MR_AM_PREFIX+"log.level"; public static final String DEFAULT_MR_AM_LOG_LEVEL = "INFO"; /**The number of splits when reporting progress in MR*/ public static final String MR_AM_NUM_PROGRESS_SPLITS = MR_AM_PREFIX+"num-progress-splits"; public static final int DEFAULT_MR_AM_NUM_PROGRESS_SPLITS = 12; /** * Upper limit on the number of threads user to launch containers in the app * master. Expect level config, you shouldn't be needing it in most cases. */ public static final String MR_AM_CONTAINERLAUNCHER_THREAD_COUNT_LIMIT = MR_AM_PREFIX+"containerlauncher.thread-count-limit"; public static final int DEFAULT_MR_AM_CONTAINERLAUNCHER_THREAD_COUNT_LIMIT = 500; /** Number of threads to handle job client RPC requests.*/ public static final String MR_AM_JOB_CLIENT_THREAD_COUNT = MR_AM_PREFIX + "job.client.thread-count"; public static final int DEFAULT_MR_AM_JOB_CLIENT_THREAD_COUNT = 1; /** * Range of ports that the MapReduce AM can use when binding. Leave blank * if you want all possible ports. */ public static final String MR_AM_JOB_CLIENT_PORT_RANGE = MR_AM_PREFIX + "job.client.port-range"; /** Enable blacklisting of nodes in the job.*/ public static final String MR_AM_JOB_NODE_BLACKLISTING_ENABLE = MR_AM_PREFIX + "job.node-blacklisting.enable"; /** Ignore blacklisting if a certain percentage of nodes have been blacklisted */ public static final String MR_AM_IGNORE_BLACKLISTING_BLACKLISTED_NODE_PERECENT = MR_AM_PREFIX + "job.node-blacklisting.ignore-threshold-node-percent"; public static final int DEFAULT_MR_AM_IGNORE_BLACKLISTING_BLACKLISTED_NODE_PERCENT = 33; /** Enable job recovery.*/ public static final String MR_AM_JOB_RECOVERY_ENABLE = MR_AM_PREFIX + "job.recovery.enable"; public static final boolean MR_AM_JOB_RECOVERY_ENABLE_DEFAULT = true; /** * Limit on the number of reducers that can be preempted to ensure that at * least one map task can run if it needs to. Percentage between 0.0 and 1.0 */ public static final String MR_AM_JOB_REDUCE_PREEMPTION_LIMIT = MR_AM_PREFIX + "job.reduce.preemption.limit"; public static final float DEFAULT_MR_AM_JOB_REDUCE_PREEMPTION_LIMIT = 0.5f; /** AM ACL disabled. **/ public static final String JOB_AM_ACCESS_DISABLED = "mapreduce.job.am-access-disabled"; public static final boolean DEFAULT_JOB_AM_ACCESS_DISABLED = false; /** * Limit reduces starting until a certain percentage of maps have finished. * Percentage between 0.0 and 1.0 */ public static final String MR_AM_JOB_REDUCE_RAMPUP_UP_LIMIT = MR_AM_PREFIX + "job.reduce.rampup.limit"; public static final float DEFAULT_MR_AM_JOB_REDUCE_RAMP_UP_LIMIT = 0.5f; /** The class that should be used for speculative execution calculations.*/ public static final String MR_AM_JOB_SPECULATOR = MR_AM_PREFIX + "job.speculator.class"; /** Class used to estimate task resource needs.*/ public static final String MR_AM_TASK_ESTIMATOR = MR_AM_PREFIX + "job.task.estimator.class"; /** The lambda value in the smoothing function of the task estimator.*/ public static final String MR_AM_TASK_ESTIMATOR_SMOOTH_LAMBDA_MS = MR_AM_PREFIX + "job.task.estimator.exponential.smooth.lambda-ms"; public static final long DEFAULT_MR_AM_TASK_ESTIMATOR_SMOOTH_LAMBDA_MS = 1000L * 60; /** true if the smoothing rate should be exponential.*/ public static final String MR_AM_TASK_ESTIMATOR_EXPONENTIAL_RATE_ENABLE = MR_AM_PREFIX + "job.task.estimator.exponential.smooth.rate"; /** The number of threads used to handle task RPC calls.*/ public static final String MR_AM_TASK_LISTENER_THREAD_COUNT = MR_AM_PREFIX + "job.task.listener.thread-count"; public static final int DEFAULT_MR_AM_TASK_LISTENER_THREAD_COUNT = 30; /** How often the AM should send heartbeats to the RM.*/ public static final String MR_AM_TO_RM_HEARTBEAT_INTERVAL_MS = MR_AM_PREFIX + "scheduler.heartbeat.interval-ms"; public static final int DEFAULT_MR_AM_TO_RM_HEARTBEAT_INTERVAL_MS = 1000; /** * If contact with RM is lost, the AM will wait MR_AM_TO_RM_WAIT_INTERVAL_MS * milliseconds before aborting. During this interval, AM will still try * to contact the RM. */ public static final String MR_AM_TO_RM_WAIT_INTERVAL_MS = MR_AM_PREFIX + "scheduler.connection.wait.interval-ms"; public static final int DEFAULT_MR_AM_TO_RM_WAIT_INTERVAL_MS = 360000; /** * How long to wait in milliseconds for the output committer to cancel * an operation when the job is being killed */ public static final String MR_AM_COMMITTER_CANCEL_TIMEOUT_MS = MR_AM_PREFIX + "job.committer.cancel-timeout"; public static final int DEFAULT_MR_AM_COMMITTER_CANCEL_TIMEOUT_MS = 60 * 1000; /** * Defines a time window in milliseconds for output committer operations. * If contact with the RM has occurred within this window then commit * operations are allowed, otherwise the AM will not allow output committer * operations until contact with the RM has been re-established. */ public static final String MR_AM_COMMIT_WINDOW_MS = MR_AM_PREFIX + "job.committer.commit-window"; public static final int DEFAULT_MR_AM_COMMIT_WINDOW_MS = 10 * 1000; /** * Boolean. Create the base dirs in the JobHistoryEventHandler * Set to false for multi-user clusters. This is an internal config that * is set by the MR framework and read by it too. */ public static final String MR_AM_CREATE_JH_INTERMEDIATE_BASE_DIR = MR_AM_PREFIX + "create-intermediate-jh-base-dir"; public static final String MR_AM_HISTORY_MAX_UNFLUSHED_COMPLETE_EVENTS = MR_AM_PREFIX + "history.max-unflushed-events"; public static final int DEFAULT_MR_AM_HISTORY_MAX_UNFLUSHED_COMPLETE_EVENTS = 200; public static final String MR_AM_HISTORY_JOB_COMPLETE_UNFLUSHED_MULTIPLIER = MR_AM_PREFIX + "history.job-complete-unflushed-multiplier"; public static final int DEFAULT_MR_AM_HISTORY_JOB_COMPLETE_UNFLUSHED_MULTIPLIER = 30; public static final String MR_AM_HISTORY_COMPLETE_EVENT_FLUSH_TIMEOUT_MS = MR_AM_PREFIX + "history.complete-event-flush-timeout"; public static final long DEFAULT_MR_AM_HISTORY_COMPLETE_EVENT_FLUSH_TIMEOUT_MS = 30 * 1000l; public static final String MR_AM_HISTORY_USE_BATCHED_FLUSH_QUEUE_SIZE_THRESHOLD = MR_AM_PREFIX + "history.use-batched-flush.queue-size.threshold"; public static final int DEFAULT_MR_AM_HISTORY_USE_BATCHED_FLUSH_QUEUE_SIZE_THRESHOLD = 50; public static final String MR_AM_ENV = MR_AM_PREFIX + "env"; public static final String MR_AM_ADMIN_USER_ENV = MR_AM_PREFIX + "admin.user.env"; public static final String MAPRED_MAP_ADMIN_JAVA_OPTS = "mapreduce.admin.map.child.java.opts"; public static final String MAPRED_REDUCE_ADMIN_JAVA_OPTS = "mapreduce.admin.reduce.child.java.opts"; public static final String DEFAULT_MAPRED_ADMIN_JAVA_OPTS = "-Djava.net.preferIPv4Stack=true " + "-Dhadoop.metrics.log.level=WARN "; public static final String MAPRED_ADMIN_USER_SHELL = "mapreduce.admin.user.shell"; public static final String DEFAULT_SHELL = "/bin/bash"; public static final String MAPRED_ADMIN_USER_ENV = "mapreduce.admin.user.env"; public static final String DEFAULT_MAPRED_ADMIN_USER_ENV = "LD_LIBRARY_PATH=$HADOOP_COMMON_HOME/lib/native"; public static final String WORKDIR = "work"; public static final String OUTPUT = "output"; public static final String HADOOP_WORK_DIR = "HADOOP_WORK_DIR"; // Environment variables used by Pipes. (TODO: these // do not appear to be used by current pipes source code!) public static final String STDOUT_LOGFILE_ENV = "STDOUT_LOGFILE_ENV"; public static final String STDERR_LOGFILE_ENV = "STDERR_LOGFILE_ENV"; // This should be the directory where splits file gets localized on the node // running ApplicationMaster. public static final String JOB_SUBMIT_DIR = "jobSubmitDir"; // This should be the name of the localized job-configuration file on the node // running ApplicationMaster and Task public static final String JOB_CONF_FILE = "job.xml"; // This should be the name of the localized job-jar file on the node running // individual containers/tasks. public static final String JOB_JAR = "job.jar"; public static final String JOB_SPLIT = "job.split"; public static final String JOB_SPLIT_METAINFO = "job.splitmetainfo"; public static final String APPLICATION_MASTER_CLASS = "org.apache.hadoop.mapreduce.v2.app.MRAppMaster"; public static final String MAPREDUCE_V2_CHILD_CLASS = "org.apache.hadoop.mapred.YarnChild"; public static final String APPLICATION_ATTEMPT_ID = "mapreduce.job.application.attempt.id"; /** * Job end notification. */ public static final String MR_JOB_END_NOTIFICATION_URL = "mapreduce.job.end-notification.url"; public static final String MR_JOB_END_NOTIFICATION_PROXY = "mapreduce.job.end-notification.proxy"; public static final String MR_JOB_END_NOTIFICATION_TIMEOUT = "mapreduce.job.end-notification.timeout"; public static final String MR_JOB_END_RETRY_ATTEMPTS = "mapreduce.job.end-notification.retry.attempts"; public static final String MR_JOB_END_RETRY_INTERVAL = "mapreduce.job.end-notification.retry.interval"; public static final String MR_JOB_END_NOTIFICATION_MAX_ATTEMPTS = "mapreduce.job.end-notification.max.attempts"; public static final String MR_JOB_END_NOTIFICATION_MAX_RETRY_INTERVAL = "mapreduce.job.end-notification.max.retry.interval"; public static final int DEFAULT_MR_JOB_END_NOTIFICATION_TIMEOUT = 5000; /* * MR AM Service Authorization */ public static final String MR_AM_SECURITY_SERVICE_AUTHORIZATION_TASK_UMBILICAL = "security.job.task.protocol.acl"; public static final String MR_AM_SECURITY_SERVICE_AUTHORIZATION_CLIENT = "security.job.client.protocol.acl"; /** * CLASSPATH for all YARN MapReduce applications. */ public static final String MAPREDUCE_APPLICATION_CLASSPATH = "mapreduce.application.classpath"; /** * Default CLASSPATH for all YARN MapReduce applications. */ public static final String[] DEFAULT_MAPREDUCE_APPLICATION_CLASSPATH = { "$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*", "$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*", }; public static final String WORKFLOW_ID = "mapreduce.workflow.id"; public static final String WORKFLOW_NAME = "mapreduce.workflow.name"; public static final String WORKFLOW_NODE_NAME = "mapreduce.workflow.node.name"; public static final String WORKFLOW_ADJACENCY_PREFIX_STRING = "mapreduce.workflow.adjacency."; public static final String WORKFLOW_ADJACENCY_PREFIX_PATTERN = "^mapreduce\\.workflow\\.adjacency\\..+"; public static final String WORKFLOW_TAGS = "mapreduce.workflow.tags"; /** * The maximum number of application attempts. * It is a application-specific setting. */ public static final String MR_AM_MAX_ATTEMPTS = "mapreduce.am.max-attempts"; public static final int DEFAULT_MR_AM_MAX_ATTEMPTS = 2; public static final String MR_APPLICATION_TYPE = "MAPREDUCE"; }
[ "archen94@gmail.com" ]
archen94@gmail.com
e394a96ff797d333f41357436838276424b162cd
8678ddf88da7449727aa54bae5c6e9c2681ef31f
/Hello11/app/src/main/java/org/androidtown/hello11/NewActivity.java
cb8ddcf5d53fb7a1addc0fdf7cd8fcacafe0f026
[]
no_license
CrazyAtom/android_study
1a08f9ea0972c7bcdcd9fbfad0bdad0a49a28f86
d00b95bbab63ba6ad907abb8c6ed3ad548a789d9
refs/heads/master
2021-01-10T18:19:59.524144
2016-04-04T13:43:31
2016-04-04T13:43:31
55,412,816
0
0
null
null
null
null
UTF-8
Java
false
false
849
java
package org.androidtown.hello11; import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class NewActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_new); Button buttonBack = (Button) findViewById(R.id.buttonBack); buttonBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "돌아가기 버튼이 눌렸어요.", Toast.LENGTH_LONG).show(); finish(); } }); } }
[ "crazyatom84@gmail.com" ]
crazyatom84@gmail.com
295eb8d6ec45f4ed94eb114365d0b5f5e4f99445
987c5b53241c8bda4289a4d1df5e232dc6a7dd7e
/backend/LBrand/src/main/java/com/rianta9/config/LBrandConfig.java
32b4fc2d3678f6d2b209747cb9a86d4dfdd94c99
[]
no_license
rianta9/LBrand
5014d71d8965da87b63552fc907a2c74978d4ed9
a0dd6427159bfb139e94132bc6965f199ab2857d
refs/heads/master
2023-05-01T03:58:25.580467
2021-05-30T07:20:01
2021-05-30T07:20:01
365,893,323
0
0
null
2021-05-30T07:20:02
2021-05-10T02:15:25
HTML
UTF-8
Java
false
false
703
java
/** * */ package com.rianta9.config; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ReloadableResourceBundleMessageSource; /** * @author rianta9 * @datecreated 22 thg 4, 2021 23:19:42 */ @Configuration public class LBrandConfig { @Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.addBasenames("classpath:messages"); messageSource.setDefaultEncoding("UTF-8"); return messageSource; } }
[ "hoangquockhanh122@gmail.com" ]
hoangquockhanh122@gmail.com
a35e2cf48beed320872cf34807d3a412206e7ed7
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/repairnator/learning/5106/InspectJobs.java
2ff369d0f819c38169e5e21cdd6e0e769d5555f3
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package fr.inria.spirals.repairnator.realtime; import fr.inria.jtravis.entities.v2.JobV2; import fr.inria.spirals.repairnator.config.RepairnatorConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; import java.util.Optional; /** * This class is launched in a dedicated thread to interrogate regularly the /job endpoint of Travis CI */ public class InspectJobs implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(InspectJobs.class); public static final int JOB_SLEEP_TIME = 60; private RTScanner rtScanner; private int sleepTime; private boolean shouldStop; public InspectJobs(RTScanner scanner) { this.rtScanner = scanner; this.sleepTime = RepairnatorConfig.getInstance().getJobSleepTime(); } /** * This is used to stop the thread execution. */ public void switchOff() { this.shouldStop = true; } @Override public void run() { LOGGER.debug("Start running inspect Jobs..."); if (sleepTime == -1) { throw new RuntimeException("Sleep time has to be set before running this."); } while (!shouldStop) { Optional<List<JobV2>> jobListOpt = RepairnatorConfig.getInstance().getJTravis().job().allFromV2(); if (jobListOpt.isPresent()) { List<JobV2> jobList = jobListOpt.get(); LOGGER.info("Retrieved "+jobList.size()+" jobs"); for (JobV2 job : jobList) { if (this.rtScanner.isRepositoryInteresting(job.getRepositoryId())) { this.rtScanner.submitWaitingBuild(job.getBuildId()); } } } if (this.rtScanner.getInspectBuilds().maxSubmittedBuildsReached() || !jobListOpt.isPresent()) { LOGGER.debug("Max number of submitted builds reached. Sleep for "+sleepTime+" seconds."); try { Thread.sleep(sleepTime * 1000); } catch (InterruptedException e) { e.printStackTrace(); } } } LOGGER.info("This will now stop."); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
76699165f78c6794728cc8e40bd4ef5ba7941468
ddcf14f5681a2b511749017f4ff5514748c93940
/family_service_platform/src/main/java/com/msb/bean/WyVegetationInformation.java
d5aaa02cf47d9fffb3156ea08c2370d78ddf90b3
[]
no_license
leiyungit/property-server
f811f61c7bb1a57c90de340089a5a9cdd8b3393d
a28934935c6d029df54f45affa0c26bef7e0bc98
refs/heads/main
2023-01-06T12:36:35.742747
2020-11-14T14:36:59
2020-11-14T14:36:59
305,880,106
0
0
null
null
null
null
UTF-8
Java
false
false
3,464
java
package com.msb.bean; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; /** * <p> * 植被信息 * </p> * * @author leiy * @since 2020-10-21 */ public class WyVegetationInformation implements Serializable { private static final long serialVersionUID=1L; /** * 植被编号 */ @TableId(value = "vegetation_id", type = IdType.AUTO) private String vegetationId; /** * 植被名称 */ private String vegetationName; /** * 种类 */ private String vegetationType; /** * 树龄 */ private Integer vegetationAge; /** * 数量 */ private Integer vegetationNumber; /** * 单位 */ private String vegetationUnit; /** * 习性 */ private String vegetationHabit; /** * 特点 */ private String vegetationFeature; /** * 备注 */ private String remark; /** * 所属公司 */ private String company; public String getVegetationId() { return vegetationId; } public void setVegetationId(String vegetationId) { this.vegetationId = vegetationId; } public String getVegetationName() { return vegetationName; } public void setVegetationName(String vegetationName) { this.vegetationName = vegetationName; } public String getVegetationType() { return vegetationType; } public void setVegetationType(String vegetationType) { this.vegetationType = vegetationType; } public Integer getVegetationAge() { return vegetationAge; } public void setVegetationAge(Integer vegetationAge) { this.vegetationAge = vegetationAge; } public Integer getVegetationNumber() { return vegetationNumber; } public void setVegetationNumber(Integer vegetationNumber) { this.vegetationNumber = vegetationNumber; } public String getVegetationUnit() { return vegetationUnit; } public void setVegetationUnit(String vegetationUnit) { this.vegetationUnit = vegetationUnit; } public String getVegetationHabit() { return vegetationHabit; } public void setVegetationHabit(String vegetationHabit) { this.vegetationHabit = vegetationHabit; } public String getVegetationFeature() { return vegetationFeature; } public void setVegetationFeature(String vegetationFeature) { this.vegetationFeature = vegetationFeature; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } @Override public String toString() { return "WyVegetationInformation{" + "vegetationId=" + vegetationId + ", vegetationName=" + vegetationName + ", vegetationType=" + vegetationType + ", vegetationAge=" + vegetationAge + ", vegetationNumber=" + vegetationNumber + ", vegetationUnit=" + vegetationUnit + ", vegetationHabit=" + vegetationHabit + ", vegetationFeature=" + vegetationFeature + ", remark=" + remark + ", company=" + company + "}"; } }
[ "744561873@qq.com" ]
744561873@qq.com
e3bd015ff3058da86bbd03c8816141571b81334f
1769377f73309877472b59e4265d11980284a200
/RESTBookService/src/main/java/com/viswagb/example/rest/jpa/BookRepository.java
029edacf4260f9b0df10004d59dc1f61a1a5d22d
[]
no_license
viswagb/SpringJPADemo
ae28a88fce37ec39be05bcc30cba1c6613a4011b
89dfd0e3f76a245fe0dc26f2a55052d8c71f2be7
refs/heads/master
2020-12-25T14:33:49.055818
2016-08-23T15:03:26
2016-08-23T15:03:26
66,370,344
0
0
null
null
null
null
UTF-8
Java
false
false
965
java
package com.viswagb.example.rest.jpa; import java.util.List; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RestResource; public interface BookRepository extends PagingAndSortingRepository<Book, Long> { public Book findByIsbn(@Param("isbn") String isbn); @RestResource(path="getBooksByAuthor") public List<Book> findByAuthorIgnoreCaseOrderByTitleAsc(@Param("author") String author); @Query("SELECT b FROM Book b WHERE b.published BETWEEN :startYear AND :endYear ORDER BY b.published") public List<Book> getBooksBetweenYears(@Param("startYear")int startYear, @Param("endYear")int endYear); public List<Book> findByTitleContaining(@Param("title") String title); public int countByAuthor(@Param("author") String author); }
[ "viswanatha.basavalingappa@oracle.com" ]
viswanatha.basavalingappa@oracle.com
a6e1bf8520d9a115594e7dd87302b35a37198de9
888bc5c7c7082fefa9e08dc4e63f45e0106cb373
/Java/src/main/java/com/httplib/FileUploader.java
afde8cbde210694c0d02066344325a47aa030097
[]
no_license
connectthefuture/learning
c9b540c47d840395a6fd5b631231eb67de4eac1c
cebb00d64517dd6f0dc1892d866e896c720bcc8a
refs/heads/master
2022-10-12T06:04:29.190840
2017-02-10T22:20:06
2017-02-10T22:20:06
98,581,015
0
0
null
2022-10-05T00:01:32
2017-07-27T21:25:14
Java
UTF-8
Java
false
false
3,379
java
package com.httplib; import com.beust.jcommander.internal.Lists; import com.httplib.util.HttpFileUploader; import org.apache.commons.io.FileUtils; import org.apache.log4j.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; /** * @author : pgajjar * @since : 7/13/16 */ public class FileUploader { private static Logger logger = org.apache.log4j.Logger.getLogger(FileUploader.class.getName()); public enum HttpWebDavHost { RW05("RW05", "http://localhost/Gossamer/"), RW15("RW15", "http://localhost/Gossamer/"), LOCAL("LOCAL", "http://localhost/Gossamer/"), UNKNOWN("UNKNOWN", "http://unknown"); private final @Nonnull String env; private final @Nonnull String httpHostWebDAVBaseUrl; HttpWebDavHost(@Nonnull final String _env, @Nonnull final String _httpHostWebDAVBaseUrl) { env = _env; httpHostWebDAVBaseUrl = _httpHostWebDAVBaseUrl; } @Nonnull public String getEnv() { return env; } @Nonnull public String getHttpHostWebDAVBaseUrl() { return httpHostWebDAVBaseUrl; } @Nonnull public static HttpWebDavHost host(@Nullable final String queueName) { return (queueName != null) ? HttpWebDavHost.valueOf(queueName.trim().toUpperCase()) : UNKNOWN; } } @Nonnull private final Collection<File> inputDataFiles; @Nonnull private final HttpFileUploader worker; public FileUploader(@Nonnull final Collection<File> files, @Nonnull final HttpWebDavHost httpWebDAVHost) { inputDataFiles = Lists.newArrayList(); for (File inputFile : files) { if (inputFile.exists()) { inputDataFiles.add(inputFile); } else { logger.info("File: " + inputFile + " doesn't exist, ignoring it."); } } worker = new HttpFileUploader(inputDataFiles, "123456789012323", httpWebDAVHost); } private void moveFilesToDiagnosticPath() throws IOException, URISyntaxException { worker.uploadFiles(); } public static void main(String[] args) throws IOException, URISyntaxException { if (args.length < 2) { System.out.println("usage: FileUploader <Directory to upload> <webdavhost>"); System.exit(0); } final File dir = new File(args[0]); if (!dir.exists()) { System.out.println("Looks like you provided a directory " + args[0] + " that doesn't exist."); System.out.println("usage: FileUploader <Directory to upload> <webdavhost>"); System.exit(0); } // final File[] filesExceptHiddenFiles = dir.listFiles(file -> !file.isHidden()); List<File> filesExceptHiddenFiles = FileUtils.listFiles(dir, null, true).stream().filter(f -> !f.isHidden()).collect(Collectors.toList()); // Get the queue name to determine the HTTP WebDAV Host HttpWebDavHost httpWebDavHost = HttpWebDavHost.host(args[1]); FileUploader uploader = new FileUploader(filesExceptHiddenFiles, httpWebDavHost); uploader.moveFilesToDiagnosticPath(); } }
[ "pgajjar@apple.com" ]
pgajjar@apple.com
d4b75983c64bfc38525faaac87665033c6b7fe06
740fb93cfbe51c2cb14f603aa4b0be547d1e78df
/Documents/ViewTest/app/src/main/java/com/example/leo/viewtest/MainActivity.java
fd4deda480419e3726b29afa13d611225acd42b3
[]
no_license
leo521/ColorView
e59cd6f6e8e1567aae12f27feb7f64548b7e36cd
0d8224469142b816e899b93753eb5a15594a0bd2
refs/heads/master
2021-01-10T08:36:41.644093
2015-11-12T13:53:35
2015-11-12T13:53:35
45,237,740
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package com.example.leo.viewtest; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "nalanyouqing@sina.com" ]
nalanyouqing@sina.com
26f1088e4c1ec9cdf5514d008c62197fe3ac0bab
83593598f21cba234f08eca4dec44d2f73a6052d
/prj/otc/web-specialmember/src/main/java/gnnt/MEBS/common/model/OnLineUser.java
7d682ea5042b01964dc534240b8aeeb12f624f27
[ "Apache-2.0" ]
permissive
bigstar18/prjs
23a04309a51b0372ddf6c391ee42270e640ec13c
c29da4d0892ce43e074d9e9831f1eedf828cd9d8
refs/heads/master
2021-05-31T19:55:16.217893
2016-06-24T02:35:31
2016-06-24T02:35:31
42,025,473
0
2
null
null
null
null
UTF-8
Java
false
false
1,024
java
package gnnt.MEBS.common.model; import gnnt.MEBS.base.model.Clone; import java.io.Serializable; public class OnLineUser extends Clone { private String userId; private String logonTime; private String logonIp; private long sessionId; public long getSessionId() { return this.sessionId; } public void setSessionId(long sessionId) { this.sessionId = sessionId; } public String getLogonIp() { return this.logonIp; } public void setLogonIp(String logonIp) { this.logonIp = logonIp; } public String getLogonTime() { return this.logonTime; } public void setLogonTime(String logonTime) { this.logonTime = logonTime; } public String getUserId() { return this.userId; } public void setUserId(String userId) { this.userId = userId; } public <T extends Serializable> T getId() { return this.userId; } public void setPrimary(String arg0) {} }
[ "hxx@hxx-PC" ]
hxx@hxx-PC
85fa56f5ac290cfce45a3fa3eb833a5172eac510
cf4f55d0b080c02b12590005072fea7ad6fcb02d
/src/main/java/com/nitish/spring/services/Services.java
76af1f5320e5b0505df57cf6b1ed2edcfcf39fc8
[]
no_license
Nitish567/SpringMVC
bba4421b305e0dc30b0b0c0a29398b319ce2233c
f3e1294dda25ff99c592bca307d151331de6540d
refs/heads/master
2020-03-17T19:58:50.060600
2018-05-18T01:40:23
2018-05-18T01:40:23
133,887,727
0
0
null
null
null
null
UTF-8
Java
false
false
423
java
package com.nitish.spring.services; import java.util.List; import com.nitish.spring.model.Customer; public interface Services { void addUser(Customer customer); void updateUser(Customer customer); Customer loadUser(String userName); List<Customer> loadUsers(String userName); List<Customer> loadUsers(); List<String> loadUserNames(); Customer loadUserById(String userId); boolean deleteUser(String userId); }
[ "gerard.25292@gmail.com" ]
gerard.25292@gmail.com
2ac6aac7acf249cbe70b071e27b6dca915f7ce35
dc93392da93e88874ba67d2454dd6604b4f09127
/src/com/demo/aspect/LoggingAspect.java
9f1e8ce3460ca5dccd8cea16d44d61397403e689
[]
no_license
NickLi19/spring-aop-demo
a34be692217ea5e7b234107f5a61b010494fb72e
f47c4df7124c7422337a65d8a57172350b3b1c30
refs/heads/master
2022-12-02T12:02:31.278376
2020-08-21T02:10:24
2020-08-21T02:10:24
289,154,584
0
0
null
null
null
null
UTF-8
Java
false
false
2,052
java
package com.demo.aspect; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.springframework.core.annotation.Order; @Aspect @Order(1) public class LoggingAspect { // @Before("execution(public String getName())") @Before("adviceForAllGetters()") // @Before("execution(public String com.demo.model.Circle.getName())") public void simpleAdvice() { System.out.println("Advice run. getNameMethod"); } @Pointcut("execution(public * get*())") public void adviceForAllGetters() { System.out.println("Advice for All Getters."); } @Before("within(com.demo.model.Circle)") public void adviceForAllCircleMethods(JoinPoint joinPoint) { System.out.println("Advice for Circle methods using WITHIN!"); System.out.println(joinPoint.getTarget()); } // @Before("args(name)") @After("args(name)") public void adviceForArgs(String name) { System.out.println("Advice for String ARG method! " + name); } @AfterReturning(pointcut="args(temp)", returning="obj") public void adviceForReturning(String temp, String obj) { System.out.println("After returning ARG: " + temp); System.out.println("After returning RETURN VAL: " + obj); } @AfterThrowing(pointcut = "args(name)", throwing = "ex") public void adviceForException(String name, RuntimeException ex) { System.out.println("There is an EXC: " + ex); } @Around("args(name)") public Object adviceForAround(ProceedingJoinPoint proceedingJoinPoint, String name) { Object obj = null; try { System.out.println("Before advice."); obj = proceedingJoinPoint.proceed(); System.out.println("After Returning: " + name); } catch(Throwable e) { System.out.println("After throwing." + e); } return obj; } }
[ "nicklee19950330@gmail.com" ]
nicklee19950330@gmail.com
a079579f73aeb2f72fe2789912941eadc1412dda
e222a7bccf65a3a3897c02b259d2235f03a1be0c
/src/main/java/com/stackroute/unittest/pe1/ExerciseOne.java
458177293364a96ce905551c28677d0b9bf7ecdc
[]
no_license
sushantanshu/PracticeExercise
fd8bbc9311268de78ad2d2ee7f6b793e23c4c718
32bfb9571ba102c333a6b816242b868dce42bc95
refs/heads/master
2020-04-12T14:04:46.038670
2019-01-03T04:22:00
2019-01-03T04:22:00
162,541,405
0
1
null
null
null
null
UTF-8
Java
false
false
1,077
java
package com.stackroute.unittest.pe1; import java.util.Scanner; public class ExerciseOne { public static void main(String []args){ System.out.println("Enter your number : "); Scanner sc = new Scanner(System.in); String s = sc.next(); System.out.println(checkPalindrome(s)); } public static String checkPalindrome(String s){ int l = s.length(); for(int i=0;i<l/2;i++){ if(s.charAt(i)!=s.charAt(l-1-i)){ return (s+" is not a palindrome"); } } return checkSum(s); } public static String checkSum(String s){ int sum = 0; int num = 0; int l = s.length(); for(int i=0;i<l;i++){ num = Integer.parseInt(""+s.charAt(i)); if(num%2==0) sum += num; } if(sum>=25) return (s + " is a palindrome and the sum of even numbers is greater than or equals 25"); else return (s + " is a palindrome and the sum of even numbers is less than 25"); } }
[ "anshu.sushant@gmail.com" ]
anshu.sushant@gmail.com
0b3298886bbf0f1df1a64c06dbd102f1acc81c36
f05679783c1038f5e8c03dbe4783e78ddfc99dac
/onebusaway-gtfs-transformer/src/main/java/org/onebusaway/gtfs_transformer/impl/RemoveCurrentService.java
973a0a557861a8c0c2ddff33677250f65e0ecc49
[ "Apache-2.0" ]
permissive
okina-transport/onebusaway-gtfs-modules
8a55a01dec8a2ff47b76cd3f07e0fa44cd3264e7
4d12edab06ebe1a143767f58ae8f9180c3786fb5
refs/heads/master
2020-03-16T22:01:40.138612
2019-05-24T14:11:26
2019-05-24T14:11:26
133,023,874
0
0
null
2018-05-11T10:07:48
2018-05-11T10:07:47
null
UTF-8
Java
false
false
2,810
java
/** * Copyright (C) 2018 Cambridge Systematics, Inc. * * 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.onebusaway.gtfs_transformer.impl; import org.onebusaway.gtfs.model.*; import org.onebusaway.gtfs.model.calendar.ServiceDate; import org.onebusaway.gtfs.services.GtfsMutableRelationalDao; import org.onebusaway.gtfs_transformer.services.TransformContext; import org.onebusaway.gtfs_transformer.services.GtfsTransformStrategy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; public class RemoveCurrentService implements GtfsTransformStrategy { private final Logger _log = LoggerFactory.getLogger(CountAndTest.class); @Override public String getName() { return this.getClass().getSimpleName(); } @Override public void run(TransformContext context, GtfsMutableRelationalDao dao) { Date today = removeTime(new Date()); boolean hasEntryToday; for (AgencyAndId aai : dao.getAllServiceIds()) { hasEntryToday = false; for (ServiceCalendarDate calDate : dao.getCalendarDatesForServiceId(aai)) { Date date = removeTime(calDate.getDate().getAsDate()); if (date.equals(today)) { hasEntryToday = true; if (calDate.getExceptionType() == 1) { calDate.setExceptionType(2); dao.saveOrUpdateEntity(calDate); } } } if (!hasEntryToday) { _log.info("No entry for today, adding one, id: {}", aai); ServiceCalendarDate calendarDate = new ServiceCalendarDate(); calendarDate.setServiceId(aai); calendarDate.setDate(new ServiceDate(today)); calendarDate.setExceptionType(2); dao.saveOrUpdateEntity(calendarDate); } } } private Date removeTime(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); date = calendar.getTime(); return date; } }
[ "heidebritta@gmail.com" ]
heidebritta@gmail.com
558fc6b888d1d7f51f5675eba5ea6a29aaf7d049
a63d907ad63ba6705420a6fb2788196d1bd3763c
/src/dataflow/unified-computing/stream/flink-code/src/main/java/com/tencent/bk/base/dataflow/flink/source/FlinkKafkaConsumer.java
688e365d5bf6ee3e09f49312182ca21366458d47
[ "MIT" ]
permissive
Tencent/bk-base
a38461072811667dc2880a13a5232004fe771a4b
6d483b4df67739b26cc8ecaa56c1d76ab46bd7a2
refs/heads/master
2022-07-30T04:24:53.370661
2022-04-02T10:30:55
2022-04-02T10:30:55
381,257,882
101
51
NOASSERTION
2022-04-02T10:30:56
2021-06-29T06:10:01
Python
UTF-8
Java
false
false
4,484
java
/* * Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. * * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. * * BK-BASE 蓝鲸基础平台 is licensed under the MIT License. * * License for BK-BASE 蓝鲸基础平台: * -------------------------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.tencent.bk.base.dataflow.flink.source; import com.tencent.bk.base.dataflow.core.topo.SourceNode; import com.tencent.bk.base.dataflow.core.topo.Topology; import com.tencent.bk.base.dataflow.core.types.AvroMessage; import com.tencent.bk.base.dataflow.flink.checkpoint.FlinkCodeCheckpointManager; import com.tencent.bk.base.dataflow.kafka.consumer.IConsumer; import com.tencent.bk.base.dataflow.kafka.consumer.utils.ByteOffsetSourceKafka; import java.io.IOException; import java.util.Properties; import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer010; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FlinkKafkaConsumer implements IConsumer<FlinkKafkaConsumer010<AvroMessage>> { private static final long serialVersionUID = 1L; private static final Logger LOGGER = LoggerFactory.getLogger(FlinkKafkaConsumer.class); private String topic; private Properties properties; // flink source struct private FlinkKafkaConsumer010<AvroMessage> consumer; private String startPosition; /** * source的构造方法 * * @param node rt * @throws IOException exception */ public FlinkKafkaConsumer(SourceNode node, FlinkCodeCheckpointManager checkpointManager, Topology topology) { this.topic = String.format("table_%s", node.getNodeId()); this.properties = new Properties(); this.startPosition = checkpointManager.getStartPosition(); String inputInfo = node.getInput().getInputInfo().toString(); initProperties(properties, inputInfo, topology); } /** * 获取 kafka consumer * TODO: 根据 checkpointManager 配置处理对应的逻辑 * * @return kafka consumer */ @Override public FlinkKafkaConsumer010 getConsumer() { consumer = new FlinkKafkaConsumer010<AvroMessage>( topic, new ByteOffsetSourceKafka(), properties); // 判断是否从最新位置开始消费数据 if ("from_tail".equalsIgnoreCase(this.startPosition)) { consumer.setStartFromLatest(); LOGGER.info("read latest data from kafka!!!!"); } else if ("continue".equalsIgnoreCase(this.startPosition)) { // 继续消费 consumer.setStartFromGroupOffsets(); LOGGER.info("continue to read data."); } else { consumer.setStartFromEarliest(); LOGGER.info("read earliest data from kafka!!!"); } return consumer; } private void initProperties(Properties properties, String inputInfo, Topology topology) { properties.setProperty("bootstrap.servers", inputInfo); String groupId; if ("product".equals(topology.getRunMode())) { groupId = String.format("%s-%s-%s", "calculate", "flink", topology.getJobId()); } else { groupId = String.format("%s-%s", "calculate", "flink-debug"); } properties.setProperty("group.id", groupId); } }
[ "terrencehan@tencent.com" ]
terrencehan@tencent.com
1874944710a5d4306d6c46d47efe325b9b7bc63f
a2e5561b2915947baef5b32819693474579ae769
/app/src/main/java/com/a310p/radical/whalewatcher_final/Models/Agency.java
ada977939fb51118b1aa44c5ad32041064f46d93
[]
no_license
daniel-0930/WhaleWatcher_Final
f32ce5e7d360ef3a4e51e3bcaccb8d87f6facf55
cc29033a8694b435ad8aefe1128fdb49b4c75bc2
refs/heads/master
2021-05-16T00:28:42.052294
2017-10-15T10:55:41
2017-10-15T10:55:41
101,846,352
0
0
null
null
null
null
UTF-8
Java
false
false
2,611
java
package com.a310p.radical.whalewatcher_final.Models; /** * Agency model to used as a tour agency object * version 1.0 * @author Yinhong Ren * @since 19/9/2017 */ public class Agency { //Declare variables private String agency_website_url; private String agency_name; private String agency_location; private String agency_image_url; /** * Default constructor */ public Agency() { } /** * Constructor contains parameters * @param agency_website_url website url of the agency * @param agency_name name of the agency * @param agency_location the address of the agency * @param agency_image_url the image logo url of the agency */ public Agency(String agency_website_url, String agency_name, String agency_location, String agency_image_url) { this.agency_website_url = agency_website_url; this.agency_name = agency_name; this.agency_location = agency_location; this.agency_image_url = agency_image_url; } /** * Get website url of the Agency * @return agency_website_url agency's website url */ public String getAgency_website_url() { return agency_website_url; } /** * Set website url of the Agency * @param agency_website_url agency's website url */ public void setAgency_website_url(String agency_website_url) { this.agency_website_url = agency_website_url; } /** * Get name of the Agency * @return agency_name agency's name */ public String getAgency_name() { return agency_name; } /** * Set name of the Agency * @param agency_name agency's name */ public void setAgency_name(String agency_name) { this.agency_name = agency_name; } /** * Get location address of the Agency * @return agency_location agency's address of location */ public String getAgency_location() { return agency_location; } /** * Set location address of the Agency * @param agency_location agency's address of location */ public void setAgency_location(String agency_location) { this.agency_location = agency_location; } /** * Get image url of the Agency * @return agency_image_url agency's image url */ public String getAgency_image_url() { return agency_image_url; } /** * Set image url of the Agency * @param agency_image_url agency's image url */ public void setAgency_image_url(String agency_image_url) { this.agency_image_url = agency_image_url; } }
[ "460737263@qq.com" ]
460737263@qq.com
ece44d2b0ab0b4c729170af244a344e0e1700788
96cb5fcda9d676ec17caa0ac653af74fc5d02d51
/sdk/src/main/java/com/minapp/android/sdk/typeadapter/GeoPointDeserializer.java
90c9f0f28aa53ad094082d0dc0afe14a0620b84b
[ "Apache-2.0" ]
permissive
ifanrx/hydrogen-android-sdk
2639130c913c439aa2cb742ec13556b29d6c6734
6e4a222ae69e2e26e981f1a4345c20caece49520
refs/heads/master
2021-06-12T22:32:05.953286
2021-05-11T08:13:45
2021-05-11T08:13:45
178,979,868
0
1
Apache-2.0
2021-05-11T08:13:45
2019-04-02T02:04:48
Java
UTF-8
Java
false
false
664
java
package com.minapp.android.sdk.typeadapter; import com.google.gson.*; import com.minapp.android.sdk.database.GeoPoint; import java.lang.reflect.Type; public class GeoPointDeserializer implements JsonDeserializer<GeoPoint> { @Override public GeoPoint deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { try { JsonArray coordinates = ((JsonObject) json).getAsJsonArray("coordinates"); return new GeoPoint(coordinates.get(0).getAsFloat(), coordinates.get(1).getAsFloat()); } catch (Exception e) { throw new JsonParseException(e); } } }
[ "linwei@ifanr.com" ]
linwei@ifanr.com
2c05a2b1bfc85f73a147a4c800f810e4ef89b303
a4313bc4d44316d7ba1ff64ec3f783389d8f123b
/src/leetcode/LRUCache.java
9a76fbe85e5038addbbc7e36ea15b9bededb72c7
[]
no_license
Erma318/Shuati
585d68822b45b7fbb85c5b448a4993ffcdf0fa44
af17b823121ea7d9741fad30866db5f57db80a33
refs/heads/master
2023-03-06T05:37:43.082292
2020-05-25T02:14:36
2020-05-25T02:14:36
135,938,537
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package leetcode; import java.util.LinkedHashMap; public class LRUCache { LinkedHashMap<Integer, Integer> map; int cap; public LRUCache(int capacity) { map = new LinkedHashMap<>(); cap = capacity; } public int get(int key) { if (map.containsKey(key)) { int r = map.get(key); map.remove(key); map.put(key, r); return r; } else { return -1; } } public void put(int key, int value) { if (cap <= 0) return; if (map.size() >= cap) { map.remove(map.entrySet().iterator().next().getKey()); } map.put(key, value); } }
[ "fengyz318@gmail.com" ]
fengyz318@gmail.com
b1cfba8f5e683c52e1732767303dd27e7353330d
5026a3d7bb8ab7d5768e583a67e10920797a232c
/src/ca/digitalcave/moss/restlet/resource/TotpTokenResource.java
8cca048fcffd83d40041b2cc4a9e52db5a39c86c
[]
no_license
thebiguno/moss.restlet
88c95cfee79b9b806e34cc07ae061e67709fc864
75f01f65f1818e0a668094561cf750cc3e9cc37d
refs/heads/master
2023-07-20T04:30:31.552022
2023-07-12T00:05:14
2023-07-12T00:05:14
116,283,505
0
0
null
null
null
null
UTF-8
Java
false
false
3,939
java
package ca.digitalcave.moss.restlet.resource; import java.io.IOException; import org.restlet.data.ChallengeResponse; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Status; import org.restlet.representation.Representation; import org.restlet.representation.StringRepresentation; import org.restlet.representation.Variant; import org.restlet.resource.ResourceException; import org.restlet.resource.ServerResource; import ca.digitalcave.moss.restlet.CookieAuthenticator; import ca.digitalcave.moss.restlet.model.AuthUser; import ca.digitalcave.moss.restlet.plugin.AuthenticationHelper; import dev.samstevens.totp.code.CodeVerifier; import dev.samstevens.totp.code.DefaultCodeGenerator; import dev.samstevens.totp.code.DefaultCodeVerifier; import dev.samstevens.totp.code.HashingAlgorithm; import dev.samstevens.totp.time.SystemTimeProvider; /** * This resource accepts the POST from the TOTP token validation window and validates the TOTP token. Success completes login. */ public class TotpTokenResource extends ServerResource { @Override protected void doInit() throws ResourceException { getVariants().add(new Variant(MediaType.APPLICATION_JSON)); } @Override protected Representation post(Representation entity, Variant variant) throws ResourceException { try { final AuthenticationHelper helper = CookieAuthenticator.getAuthenticationHelper(getRequest()); final Form form = new Form(entity.getText()); final String totpToken = form.getFirstValue(CookieAuthenticator.FIELD_TOTP_TOKEN); if (totpToken == null){ throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, "Value for \"" + CookieAuthenticator.FIELD_TOTP_TOKEN +"\" is required."); } final ChallengeResponse cr = getChallengeResponse(); final AuthUser user = helper.selectUser(cr.getIdentifier()); if (totpToken != null && user.getTwoFactorSecret() != null){ final CodeVerifier verifier = new DefaultCodeVerifier(new DefaultCodeGenerator(HashingAlgorithm.SHA1), new SystemTimeProvider()); if (verifier.isValidCode(user.getTwoFactorSecret(), totpToken)){ CookieAuthenticator.setTwoFactorValidated(cr); CookieAuthenticator.setEncryptedCookieFromChallengeResponse(getRequest(), getResponse(), helper); if (CookieAuthenticator.isPasswordExpired(cr)){ return new StringRepresentation("{\"success\": false, \"next\": \"" + CookieAuthenticator.FIELD_PASSWORD_EXPIRED + "\"}", MediaType.APPLICATION_JSON); } else if (user.getTwoFactorBackupCodes().size() == 0){ return new StringRepresentation("{\"success\": false, \"next\": \"totpBackupCodesNeeded\"}", MediaType.APPLICATION_JSON); } return new StringRepresentation("{\"success\": true}", MediaType.APPLICATION_JSON); } else { //If the token didn\"t validate as a proper TOTP value, check if it is in the valid backup codes. if (user.getTwoFactorBackupCodes().contains(totpToken)){ //We disable the backup code that was used helper.updateTotpBackupCodeMarkUsed(cr.getIdentifier(), totpToken, cr); CookieAuthenticator.setTwoFactorValidated(cr); CookieAuthenticator.setEncryptedCookieFromChallengeResponse(getRequest(), getResponse(), helper); if (user.getTwoFactorBackupCodes().size() <= 1){ //Since we just used one of them to get here, we need to check if size is 1 (technically should never be less, but doesn\"t hurt). return new StringRepresentation("{\"success\": false, \"next\": \"totpBackupCodesNeeded\"}", MediaType.APPLICATION_JSON); } return new StringRepresentation("{\"success\": true}", MediaType.APPLICATION_JSON); } } } } catch (IOException e){ throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e); } getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST); return new StringRepresentation("{\"success\": false}", MediaType.APPLICATION_JSON); } }
[ "olsonw@richer.ca" ]
olsonw@richer.ca
311aeff24b59fce359ed2096d5c9a935aeda9f8c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_4010af7cab7d2e52c0e62877ca00274dd699ad2b/LuceneQuery/2_4010af7cab7d2e52c0e62877ca00274dd699ad2b_LuceneQuery_s.java
92138cfb0a0acf7a65d1700e25eeaa2faa41552f
[]
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
54,257
java
/** * Copyright 2010 CosmoCode GmbH * * 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 de.cosmocode.lucene; import java.util.Collection; /** * <p> The LuceneQuery is a builder for Lucene queries. * It provides several methods that all handle proper escaping. * </p> * <p> An abstract implemententation of this interface, * that takes care of the redirects to methods with * default values and those with old style "boolean mandatory" signature, * is available at {@link AbstractLuceneQuery}. * A version that delegates every call is {@link ForwardingLuceneQuery}. * </p> * <p> Example for the usage: * </p> * <pre> * import com.google.common.collect.Lists; * import de.cosmocode.lucene.LuceneQuery; * ... * // This example uses the default implemtation, but any other implementation works alike * final LuceneQuery builder = LuceneHelper.newQuery(); * builder.setModifier(LuceneQuery.MOD_ID); * builder.addField("test", Lists.newArrayList("test1", "test2")); * builder.addArgument("blubb", LuceneQuery.MOD_TEXT); * builder.addSubquery(LuceneHelper.newQuery().addField("sub", "test^3").addField("array", new int[] {1, 2})); * System.out.println(builder.getQuery()); * // prints out: +test:(test1 test2) +(blubb blubb*) +(sub:test\^3 array:(1 2)) * </pre> * * @since 1.0 * @author Oliver Lorenz * * @see AbstractLuceneQuery * @see ForwardingLuceneQuery */ public interface LuceneQuery { /* * Some general QueryModifiers. */ /** * <p> A {@link QueryModifier} that has * {@link ModifierBuilder#required()} and * {@link ModifierBuilder#disjunct()} set. * </p> * <p> Can be used to include one or more IDs into the search. * </p> */ QueryModifier MOD_ID = QueryModifier.start().required().disjunct().end(); /** * <p> A {@link QueryModifier} that has * {@link ModifierBuilder#prohibited()} and * {@link ModifierBuilder#conjunct()} set. * </p> * <p> Can be used to exclude one or more IDs from the search. * </p> */ QueryModifier MOD_NOT_ID = QueryModifier.start().prohibited().conjunct().end(); /** * <p> A {@link QueryModifier} that has * {@link ModifierBuilder#required()}, * {@link ModifierBuilder#conjunct()}, * {@link ModifierBuilder#wildcarded()} and * {@link ModifierBuilder#doSplit()} set. * </p> * <p> Can be used for required text fields. * </p> */ QueryModifier MOD_TEXT = QueryModifier.start().required().conjunct().wildcarded().doSplit().end(); /** * <p> A {@link QueryModifier} that has * {@link ModifierBuilder#required()}, * {@link ModifierBuilder#disjunct()}, * {@link ModifierBuilder#wildcarded()}, * {@link ModifierBuilder#setFuzzyness(Double)} with 0.7 and * {@link ModifierBuilder#doSplit()} set. * </p> * <p> Can be used for some autocompletion, though the fuzzyness may vary * from project to project. * </p> */ QueryModifier MOD_AUTOCOMPLETE = QueryModifier.start().required().disjunct().wildcarded().setFuzzyness(0.7).doSplit().end(); /* * Other default values. */ /** * The default fuzzyness. It is used by * <ul> * <li> {@link LuceneQuery#addFuzzyArgument(String)}</li> * <li> {@link LuceneQuery#addFuzzyArgument(String, boolean)}</li> * <li> {@link LuceneQuery#addFuzzyField(String, String)}</li> * <li> {@link LuceneQuery#addFuzzyField(String, String, boolean)}</li> * </ul> */ double DEFAULT_FUZZYNESS = 0.5; /** * Error that is thrown when {@link #getQuery()} is called, * but the result would be an empty String. */ String ERR_EMPTY_QUERY = "The resulting query is empty, no previous method call was successful"; /** * Error to show that the boost is out of bounds. * Valid boost values are: 0 < boostFactor < 10000000 */ String ERR_BOOST_OUT_OF_BOUNDS = "boostFactor must be greater than 0 and less than 10.000.000 (10 millions)"; /** * Error to indicate that the given QueryModifier is null. */ String ERR_MODIFIER_NULL = "the QueryModifier must not be null, choose QueryModifier.DEFAULT instead"; /* * Utility methods */ /** * Returns true if this LuceneQuery appends a wildcard ("*") after each added argument, false otherwise. * <br> * <br><i>Implementation note</i>: This method should use isWildcarded() of {@link #getModifier()} * @return true if this LuceneQuery appends a wildcard ("*") after each added argument, false otherwise */ boolean isWildCarded(); /** * The wildcard parameter.<br> * Set it to true to append a wildcard ("*") after each added argument, * false to turn this behaviour off (and just append each argument as is). * <br> <br> * <i>Implementation note</i>: * To provide a coherent user experience, * the implementation should alter the default QueryModifier * (i.e. set a new default QueryModifier with wildcarded set to the given value), * with {@link #setModifier(QueryModifier)} and {@link #getModifier()}. * @param wildCarded true to turn wildcarded behaviour on, false to turn it off. * * @see ModifierBuilder#setWildcarded(boolean) * @see #setModifier(QueryModifier) */ void setWildCarded(final boolean wildCarded); /** * <p> Sets a default QueryModifier that is used * whenever a method is invoked without a QueryModifier parameter. * </p> * <p> Please note that null as a parameter is not permitted and results in a NullPointerException. * If you want to set a default value, use {@link QueryModifier#DEFAULT} instead. * </p> * * @param mod the default modifier to set * @throws NullPointerException if the parameter `mod` is null */ void setModifier(final QueryModifier mod); /** * <p> Gets the default {@link QueryModifier} that is used * whenever a method is invoked without a QueryModifier parameter. * </p> * * @return the default QueryModifier */ QueryModifier getModifier(); /** * <p> Returns the query which was built with the add...-methods. * It throws an IllegalStateException if no add...-methods were successful * and the resulting query is empty. * </p> * * @return the query which was built with the add...-methods * @throws IllegalStateException if no add...-methods were successful so that the query would be empty */ String getQuery() throws IllegalStateException; /** * <p> If the last method call was successful (that means it altered the output of this query), * then this method returns true, false otherwise. * </p> * All method calls but the following alter this state: * <ul> * <li> {@link #addBoost(double)} - but the boost uses this feature </li> * <li> {@link #getModifier()} </li> * <li> {@link #getQuery()} </li> * <li> {@link #isWildCarded()} </li> * <li> {@link #lastSuccessful()} </li> * <li> {@link #setModifier(QueryModifier)} </li> * <li> {@link #setWildCarded(boolean)} </li> * </ul> * @return true if the last method call changed this LuceneQuery, false otherwise */ boolean lastSuccessful(); //--------------------------- // addFuzzyArgument //--------------------------- /** * Append a fuzzy term. <br> * fuzzy searches include terms that are in the levenshtein distance of the searched term. * <br><br> * This method uses the {@link #getModifier()} and {@link #DEFAULT_FUZZYNESS}. * * @param value the value to search for * @return this */ LuceneQuery addFuzzyArgument(String value); /** * Append a fuzzy term with default fuzzyness of 0.5. <br> * fuzzy searches include terms that are in the levenshtein distance of the searched term. * <br><br> * This method uses the {@link #DEFAULT_FUZZYNESS}. * * @see #addFuzzyArgument(String, boolean, double) * @param value the value to search for * @param mandatory if true then the value must be found, otherwise it is just prioritized in the search results * @return this */ LuceneQuery addFuzzyArgument(String value, boolean mandatory); /** * Append a fuzzy argument with the given fuzzyness. <br> * fuzzy searches include arguments that are in the levenshtein distance of the searched term. * * @param value the value to search for * @param mandatory if true then the value must be found, otherwise it is just prioritized in the search results * @param fuzzyness the fuzzyness; must be between 0 (inclusive) and 1 (exclusive), so that: 0 <= fuzzyness < 1 * @return this */ LuceneQuery addFuzzyArgument(String value, boolean mandatory, double fuzzyness); //--------------------------- // addArgument //--------------------------- /** * <p> Adds a String term to this LuceneQuery. * The default modifier is applied to the value. * This method uses {@link #getModifier()} and * redirects to {@link #addArgument(String, QueryModifier)}. * </p> * <p> The parameter `value` can have any value, including null or an empty or blank String, * but then this method call has no effect on the final query. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * * @param value the String value to add * @return this * * @see #addArgument(String, QueryModifier) */ LuceneQuery addArgument(String value); /** * <p> Adds a String term to this LuceneQuery. * </p> * <p> The parameter `value` can have any value, including null or an empty or blank String, * but then this method call has no effect on the final query. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> If the second parameter `mandatory` is true, then the value is added as required * (i.e. the result contains only documents that match the value). * Otherwise the String value is added as a "boost" so that all documents * matching it are ordered to the top. * </p> * * @param value the String value to add * @param mandatory if true then the value must be found, * otherwise it is just prioritized in the search results * @return this */ LuceneQuery addArgument(String value, boolean mandatory); /** * <p> Adds a String term to this LuceneQuery. * The given modifier is applied to the value. * </p> * <p> The first parameter `value` can have any value, * including null or an empty or blank String, * but then this method call has no effect on the final query. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * * @param value the String value to add * @param modifier the {@link QueryModifier} for the value * @return this (for chaining) * @throws NullPointerException if the second parameter `modifier` is null * * @see QueryModifier */ LuceneQuery addArgument(String value, QueryModifier modifier); /** * <p> Add a collection of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> This method uses {@link #getModifier()} and * redirects to {@link #addArgument(Collection, QueryModifier)}. * </p> * * @param values a collection of search terms * @return this * * @see #addArgumentAsCollection(Collection) */ LuceneQuery addArgument(Collection<?> values); /** * <p> Add a collection of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> If the second parameter `mandatory` is true, then the array of terms are added as required * (i.e. the result contains only documents that match all values). * Otherwise the array is added as a "boost" so that all documents matching * at least one of the values are ordered to the top. * </p> * * @param values a collection of search terms * @param mandatory if true then the value must be found, * otherwise it is just prioritized in the search results * @return this */ LuceneQuery addArgument(Collection<?> values, boolean mandatory); /** * <p> Add a collection of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * * @param values a collection of search terms * @param modifier the {@link QueryModifier} that is applied to the values * @return this * @throws NullPointerException if the second parameter `modifier` is null * * @see #addArgumentAsCollection(Collection, QueryModifier) */ LuceneQuery addArgument(Collection<?> values, QueryModifier modifier); /** * <p> Add an array of Terms to this LuceneQuery. * This method is equivalent to {@link #addArgumentAsArray(Object[])}. * </p> * <p> This method uses {@link #getModifier()} and * redirects to {@link #addArgumentAsArray(Object[], QueryModifier)}. * </p> * * @param <K> generic element type * @param values an array of search terms * @return this * * @see #addArgumentAsArray(Object[]) */ <K> LuceneQuery addArgument(K[] values); /** * <p> Add an array of Terms to this LuceneQuery. * </p> * <p> If the second parameter `mandatory` is true, then the array of terms are added as required * (i.e. the result contains only documents that match all values). * Otherwise the array is added as a "boost" so that all documents matching * at least one of the values are ordered to the top. * </p> * * @param <K> generic element type * @param values an array of search terms * @param mandatory if true then the value must be found, otherwise it is just prioritized in the search results * @return this */ <K> LuceneQuery addArgument(K[] values, boolean mandatory); /** * <p> Add an array of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * * @param <K> generic element type * @param values an array of search terms * @param modifier the {@link QueryModifier} that is applied to the values * @return this * @throws NullPointerException if the second parameter `modifier` is null * * @see #addArgumentAsArray(Object[], QueryModifier) */ <K> LuceneQuery addArgument(K[] values, QueryModifier modifier); /** * <p> Add an array of doubles to this LuceneQuery. * This method uses the {@link #getModifier()}. * </p> * * @param values the array of terms to search for * @return this */ LuceneQuery addArgument(double[] values); /** * <p> Add an array of doubles to this LuceneQuery, * using the given {@link QueryModifier}. * </p> * * @param values the array of terms to search for * @param modifier the {@link QueryModifier} that is applied to the values * @return this */ LuceneQuery addArgument(double[] values, QueryModifier modifier); /** * <p> Add an int array to this LuceneQuery. * This method uses the {@link #getModifier()}. * </p> * * @param values the array of terms to search for * @return this */ LuceneQuery addArgument(int[] values); /** * <p> Add an int array to this LuceneQuery, using the given QueryModifier. * </p> * * @param values the array of terms to search for * @param modifier the {@link QueryModifier} that is applied to the values * @return this */ LuceneQuery addArgument(int[] values, QueryModifier modifier); //--------------------------- // addArgumentAs... //--------------------------- /** * <p> Add a collection of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> This method uses {@link #getModifier()} and * redirects to {@link #addArgumentAsCollection(Collection, QueryModifier)}. * </p> * * @param values a collection of search terms * @return this */ LuceneQuery addArgumentAsCollection(Collection<?> values); /** * <p> Add a collection of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * * @param values a collection of search terms * @param modifier the {@link QueryModifier} that is applied to the values * @return this * @throws NullPointerException if the second parameter `modifier` is null */ LuceneQuery addArgumentAsCollection(Collection<?> values, QueryModifier modifier); /** * <p> Add an array of Terms to this LuceneQuery. * </p> * <p> The first parameter contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> This method uses {@link #getModifier()} and * redirects to {@link #addArgumentAsArray(Object[], QueryModifier)}. * </p> * * @param <K> generic element type * @param values an array of search terms * @return this * * @see #addArgumentAsArray(Object[]) */ <K> LuceneQuery addArgumentAsArray(K[] values); /** * <p> * Add an array of Terms to this LuceneQuery. * The given QueryModifier specifies the way the terms are added. * </p> * * @param <K> generic element type * @param values an array of search terms * @param modifier the {@link QueryModifier} that is applied to the values * @return this */ <K> LuceneQuery addArgumentAsArray(K[] values, QueryModifier modifier); /* * addRange */ /** * <p> Adds a range to the query. * This method calls {@link #addRange(String, String, QueryModifier)} with the default modifier * ({@link #getModifier()}). * </p> * * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @since 1.2 * @see #addRange(String, String, QueryModifier) */ LuceneQuery addRange(String from, String to); /** * <p> Adds a range to the query, using the given QueryModifier. * </p> * <p> If the given QueryModifier has wildcarded set to true, * then both the from and the to clause is set to wildcarded. * This means that for example a call of * {@code addRange("a", "b", QueryModifier.start().wildcarded().end()} * would return results that start with a or b. * </p> * <p> <strong> Important: </strong> doSplit() and fuzzyness of the given QueryModifier * have no effect on a range query. * </p> * Examples: * <pre> * final LuceneQuery query = LuceneHelper.newQuery(); * query.addRange("a", "b"); * System.out.println(query.getQuery()); // prints something like [a TO b] * </pre> * <pre> * final LuceneQuery query = LuceneHelper.newQuery(); * query.addRange("a", "b", LuceneQuery.MOD_TEXT); * System.out.println(query.getQuery()); // prints something like [a* TO b*] * </pre> * * @param from the start of the range * @param to the end of the range * @param mod the QueryModifier that affects the * @return this (for chaining) * * @since 1.2 */ LuceneQuery addRange(String from, String to, QueryModifier mod); /** * <p> Adds a numerical range to the query. * This method calls {@link #addRange(int, int, QueryModifier)} with the default modifier * ({@link #getModifier()}). * </p> * * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @since 1.2 * @see #addRange(int, int, QueryModifier) */ LuceneQuery addRange(int from, int to); /** * <p> Adds a numerical range to the query, using the given QueryModifier. * </p> * <p> If the given QueryModifier has wildcarded set to true, * then both the from and the to clause is set to wildcarded. * This means that for example a call of * {@code addRange(1, 3, QueryModifier.start().wildcarded().end()} * would return results that start with 1 or 3, so every number that starts with 1,2 or 3. * </p> * <p> <strong> Important: </strong> doSplit() and fuzzyness of the given QueryModifier * have no effect on a range query. * </p> * Examples: * <pre> * final LuceneQuery query = LuceneHelper.newQuery(); * query.addRange(1, 10); * System.out.println(query.getQuery()); // prints something like [1 TO 10] * </pre> * <pre> * final LuceneQuery query = LuceneHelper.newQuery(); * query.addRange(1, 3, LuceneQuery.MOD_TEXT); * System.out.println(query.getQuery()); // prints something like [1* TO 3*] * </pre> * * @param from the start of the range * @param to the end of the range * @param mod the QueryModifier that affects the * @return this (for chaining) * * @since 1.2 */ LuceneQuery addRange(int from, int to, QueryModifier mod); /** * <p> Adds a numerical, floating point range to the query. * This method calls {@link #addRange(double, double, QueryModifier)} with the default modifier * ({@link #getModifier()}). * </p> * * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @since 1.2 * @see #addRange(double, double, QueryModifier) */ LuceneQuery addRange(double from, double to); /** * <p> Adds a numerical, floating point range to the query, using the given QueryModifier. * </p> * <p> If the given QueryModifier has wildcarded set to true, * then both the from and the to clause is set to wildcarded. * This means that for example a call of * {@code addRange(2.0, 3.0, QueryModifier.start().wildcarded().end()} * would return results that start with 2.0 or 3.0, so every floating point number * between 2 (inclusive) and 3.1 (exclusive). * </p> * <p> <strong> Important: </strong> doSplit() and fuzzyness of the given QueryModifier * have no effect on a range query. * </p> * Example: * <pre> * final LuceneQuery query = LuceneHelper.newQuery(); * query.addRange(1.1, 1.9); * System.out.println(query.getQuery()); // prints something like [1.1 TO 1.9] * </pre> * * @param from the start of the range * @param to the end of the range * @param mod the QueryModifier that affects the * @return this (for chaining) * * @since 1.2 */ LuceneQuery addRange(double from, double to, QueryModifier mod); //--------------------------- // addSubquery //--------------------------- /** * <p> This method adds a LuceneQuery as a sub query to this LuceneQuery. * </p> * <p> If the parameter (`value`) is null, * then this LuceneQuery remains unchanged. No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> This method uses the {@link #getModifier()} * and redirects to {@link #addSubquery(LuceneQuery, QueryModifier)} with it. * </p> * * @param value the SubQuery to add * @return this */ LuceneQuery addSubquery(LuceneQuery value); /** * <p> This method adds a LuceneQuery as a sub query to this LuceneQuery. * </p> * <p> If the first parameter (`value`) is null, * then this LuceneQuery remains unchanged. No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> If the second parameter is true, then the sub query is added as required * (i.e. the result contains only documents that match the sub query). * Otherwise the sub query is added as a "boost" so that all documents matching * the sub query are ordered to the top. * </p> * * @param value the subQuery to add * @param mandatory if true then the sub query restricts the results, otherwise only boosts them * @return this */ LuceneQuery addSubquery(LuceneQuery value, boolean mandatory); /** * <p> This method adds a LuceneQuery as a sub query to this LuceneQuery. * </p> * <p> If the parameter (`value`) is null, * then this LuceneQuery remains unchanged. No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> The second parameter `modifier` affects the way the sub query is added. * </p> * <p>If its {@link QueryModifier#getTermModifier()} is {@link TermModifier#REQUIRED}, * then the sub query is added as required, * that means the result contains only documents that match the sub query. * </p> * <p> If its {@link QueryModifier#getTermModifier()} is {@link TermModifier#PROHIBITED}, * then the sub query is added as prohibited, * that means the result contains only documents that do NOT match the sub query. * </p> * <p> Otherwise the sub query is added as a "boost" so that all documents matching * the sub query are ordered to the top. The number of the documents is not * </p> * * @param value the subQuery to add * @param modifier the {@link QueryModifier} that affects the way the sub query is added * @return this */ LuceneQuery addSubquery(LuceneQuery value, QueryModifier modifier); //--------------------------- // addUnescaped-methods //--------------------------- /** * Add a field with an argument unescaped. * If the second parameter `value` is null then nothing happens. * <b>Attention</b>: Use with care, otherwise you get Exceptions on execution. * * @param key the field name * @param value the value of the field; * @param mandatory whether the field is mandatory or not * @return this */ LuceneQuery addUnescapedField(String key, CharSequence value, boolean mandatory); /** * Add an argument unescaped. * If the parameter `value` is null then nothing happens. * <b>Attention</b>: Use with care, otherwise you get Exceptions on execution. * * @param value the argument to add unescaped; omitted if null * @param mandatory whether the argument is mandatory or not * @return this */ LuceneQuery addUnescaped(CharSequence value, boolean mandatory); //--------------------------- // addField(String, String, ...) //--------------------------- /** * <p> Add a field with the name `key` to the query. * The searched value is given as a String. * </p> * <p> This method uses {@link #getModifier()} and * redirects to {@link #addField(String, String, QueryModifier)}. * </p> * * @param key the name of the field * @param value the (string)-value of the field * @return this */ LuceneQuery addField(String key, String value); /** * <p> Add a field with the name `key` to the query. * The searched value is given as a String. * </p> * <p> The first parameter, key, must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> The second parameter, value, can be any valid String. * Blank or empty String or null value is permitted, * but then this method call has no effect on the final query. * </p> * <p> If the third parameter, `mandatoryKey`, is true, * then the field with the given String value is search for as required * (i.e. the result contains only documents that have the specified field). * Otherwise the field is added as a "boost" so that all documents * that have this field are ordered to the top. * </p> * * @param key the name of the field * @param value the (string)-value of the field * @param mandatoryKey if true then the field is required, otherwise the field is only boosted * @return this */ LuceneQuery addField(String key, String value, boolean mandatoryKey); /** * <p> Append a field with a string value, and apply a boost afterwards. * </p> * <p> The method calls {@link #addField(String, String, boolean)} * and then {@link #addBoost(double)}. * </p> * * @param key the name of the field * @param value the (string)-value of the field * @param mandatoryKey if true then the field is required, otherwise the field is only boosted * @param boostFactor the boost factor to apply to the field * @return this * * @see #addField(String, String, boolean) * @see #addBoost(double) */ LuceneQuery addField(String key, String value, boolean mandatoryKey, double boostFactor); /** * <p> Append a field with a string value with the specified QueryModifier. * </p> * <p> The first parameter, key, must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> The second parameter, value, can be any valid String. * Blank or empty String or null value is permitted, * but then this method call has no effect on the final query. * </p> * <p> The third parameter, the {@link QueryModifier} `modifier`, must not be null. * A NullPointerException is thrown otherwise. * </p> * * @param key the name of the field * @param value the value for the field * @param modifier the {@link QueryModifier} to apply to the field * @return this * @throws NullPointerException if the third parameter, modifier, is null * * @see QueryModifier */ LuceneQuery addField(String key, String value, QueryModifier modifier); //--------------------------- // addField(String, Collection, ...) //--------------------------- /** * <p> Append a field with a collection of values. * </p> * <p> The first parameter, key, must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> If the second parameter, `mandatoryKey`, is true, * then the field is search for as required * (i.e. the result contains only documents that have the specified field). * Otherwise the field is added as a "boost" so that all documents * that have this field are ordered to the top. * </p> * <p> The third parameter `values` contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> If the fourth parameter, `mandatoryValue`, is true, * then the field must have all values given in the collection. * Otherwise the field must have only one of the values. * </p> * * @param key the name of the field * @param mandatoryKey if true then the field is required, otherwise the field is only boosted * @param values the values (as a collection) for the field * @param mandatoryValue if true then field must have all values, otherwise only one of them * @return this */ LuceneQuery addField(String key, boolean mandatoryKey, Collection<?> values, boolean mandatoryValue); /** * <p> Append a field with a collection of values, and apply a boost afterwards. * </p> * <p> This method calls {@link #addField(String, boolean, Collection, boolean)} first * and then {@link #addBoost(double)}. * </p> * * @param key the name of the field * @param mandatoryKey if true then the field is required, otherwise the field is only boosted * @param values the values (as a collection) for the field * @param mandatoryValue if true then field must have all values, otherwise only one of them * @param boostFactor the boost to apply afterwards. * @return this * * @see #addField(String, boolean, Collection, boolean) * @see #addBoost(double) */ LuceneQuery addField(String key, boolean mandatoryKey, Collection<?> values, boolean mandatoryValue, double boostFactor); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in a collection. * </p> * <p> This method calls {@link #addField(String, Collection, QueryModifier)} * with {@link #getModifier()}. * </p> * * @param key the name of the field * @param values the values (as a collection) for the field * @return this * * @see #addField(String, Collection, QueryModifier) */ LuceneQuery addField(String key, Collection<?> values); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in a collection. * </p> * <p> The first parameter `key` must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> The second parameter `values` contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> The third parameter, the {@link QueryModifier} `modifier`, must not be null. * A NullPointerException is thrown otherwise. * </p> * * @param key the name of the field * @param values the values (as a collection) for the field * @param modifier the {@link QueryModifier} to apply to the field * @return this * @throws NullPointerException if the third parameter, modifier, is null * * @see #addFieldAsCollection(String, Collection, QueryModifier) */ LuceneQuery addField(String key, Collection<?> values, QueryModifier modifier); //--------------------------- // addField(String, Array, ...) //--------------------------- /** * <p> Add a field with the name `key` to the query. * The values to search for are given in an array. * </p> * <p> This method calls {@link #addField(String, Object[], QueryModifier)} * with {@link #getModifier()}. * </p> * * @param <K> generic element type * @param key the name of the field * @param value the values to be searched in the field * @return this * * @see #addFieldAsArray(String, Object[]) */ <K> LuceneQuery addField(String key, K[] value); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in an array. * </p> * <p> The first parameter `key` must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> The second parameter `values` contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> The third parameter, the {@link QueryModifier} `modifier`, must not be null. * A NullPointerException is thrown otherwise. * </p> * * @param <K> generic element type * @param key the name of the field * @param value the values to be searched in the field * @param modifier the {@link QueryModifier} to apply to the field * @return this * @throws NullPointerException if the third parameter, modifier, is null * * @see #addFieldAsArray(String, Object[], QueryModifier) */ <K> LuceneQuery addField(String key, K[] value, QueryModifier modifier); /* * addRangeField, for example: (fieldName):[(a) TO (b)] */ /** * <p> Adds a range for a specific field to this query. * This method calls {@link #addRangeField(String, String, String, QueryModifier)} * with the default modifier ({@link #getModifier()}). * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @see #addRangeField(String, String, String, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, String from, String to); /** * <p> Adds a range for a specific field to this query, using the given QueryModifier. * See {@link #addRange(String, String, QueryModifier)} for further documentation. * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @param mod the {@link QueryModifier} to apply to the field * @return this (for chaining) * * @see #addRange(String, String, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, String from, String to, QueryModifier mod); /** * <p> Adds a numeric range for a specific field to this query. * This method calls {@link #addRangeField(String, int, int, QueryModifier)} * with the default modifier ({@link #getModifier()}). * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @see #addRangeField(String, int, int, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, int from, int to); /** * <p> Adds a numeric range for a specific field to this query, using the given QueryModifier. * See {@link #addRange(int, int, QueryModifier)} for further documentation. * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @param mod the {@link QueryModifier} to apply to the field * @return this (for chaining) * * @see #addRange(int, int, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, int from, int to, QueryModifier mod); /** * <p> Adds a numeric, floating point range for a specific field to this query. * This method calls {@link #addRangeField(String, double, double, QueryModifier)} * with the default modifier ({@link #getModifier()}). * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @return this (for chaining) * * @see #addRangeField(String, double, double, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, double from, double to); /** * <p> Adds a numeric, floating point range for a specific field to this query, using the given QueryModifier. * See {@link #addRange(double, double, QueryModifier)} for further documentation. * </p> * * @param fieldName the name of the field to search in * @param from the start of the range * @param to the end of the range * @param mod the {@link QueryModifier} to apply to the field * @return this (for chaining) * * @see #addRange(double, double, QueryModifier) * @since 1.2 */ LuceneQuery addRangeField(String fieldName, double from, double to, QueryModifier mod); //--------------------------- // addFuzzyField //--------------------------- /** * Append a fuzzy search argument with the given fuzzyness for the given field. * <br>fuzzy searches include arguments that are in the levenshtein distance of the searched term. * <br>Less fuzzyness (closer to 0) means less accuracy, and vice versa * (the closer to 1, solr yields less but accurater results) * <br> * <br>This method uses {@link #getModifier()} and the {@link #DEFAULT_FUZZYNESS}. * * @param key the name of the field * @param value the value to search for * @return this */ LuceneQuery addFuzzyField(String key, String value); /** * Append a fuzzy search argument with default fuzzyness (0.5) for the given field. <br> * fuzzy searches include arguments that are in the levenshtein distance of the searched term. * <br><br> * This method uses the {@link #DEFAULT_FUZZYNESS}. * * @param key the name of the field * @param value the value to search for * @param mandatoryKey if true then the field must contain the given value, * otherwise it is just prioritized in the search results * @return this */ LuceneQuery addFuzzyField(String key, String value, boolean mandatoryKey); /** * Append a fuzzy search argument with the given fuzzyness for the given field. * <br>fuzzy searches include arguments that are in the levenshtein distance of the searched term. * <br>Less fuzzyness (closer to 0) means less accuracy, and vice versa * (the closer to 1, lucene yields less but accurater results) * * @param key the name of the field * @param value the value to search for * @param mandatoryKey if true then the field must contain the given value, * otherwise it is just prioritized in the search results * @param fuzzyness the fuzzyness; must be between 0 and 1, so that 0 <= fuzzyness < 1 * @return this */ LuceneQuery addFuzzyField(String key, String value, boolean mandatoryKey, double fuzzyness); //--------------------------- // addFieldAs... //--------------------------- /** * <p> Add a field with the name `key` to the query. * The values to search for are given in a collection. * </p> * <p> This method calls {@link #addFieldAsCollection(String, Collection, QueryModifier)} * with {@link #getModifier()}. * </p> * * @param key the name of the field * @param values the values (as a collection) for the field * @return this * * @see #addFieldAsCollection(String, Collection, QueryModifier) */ LuceneQuery addFieldAsCollection(String key, Collection<?> values); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in a collection. * </p> * <p> The second parameter `values` contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> The third parameter, the {@link QueryModifier} `modifier`, must not be null. * A NullPointerException is thrown otherwise. * </p> * * @param key the name of the field * @param values the values (as a collection) for the field * @param modifier the {@link QueryModifier} to apply to the field * @return this * @throws NullPointerException if the third parameter, modifier, is null */ LuceneQuery addFieldAsCollection(String key, Collection<?> values, QueryModifier modifier); /** * <p> Append a field with a collection of values, and apply a boost afterwards. * </p> * <p> This method calls {@link #addField(String, Collection, QueryModifier)} first * and then {@link #addBoost(double)}. * </p> * * @param key the name of the field * @param values the values (as a collection) for the field * @param modifier the {@link QueryModifier} to apply to the field * @param boost the boost to apply on the field afterwards. * @return this * * @see #addFieldAsCollection(String, Collection, QueryModifier) * @see #addBoost(double) */ LuceneQuery addFieldAsCollection(String key, Collection<?> values, QueryModifier modifier, double boost); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in an array. * </p> * <p> This method calls {@link #addFieldAsArray(String, Object[], QueryModifier)} * with {@link #getModifier()}. * </p> * * @param <K> generic element type * @param key the name of the field * @param values the values to be searched in the field * @return this */ <K> LuceneQuery addFieldAsArray(String key, K[] values); /** * <p> Add a field with the name `key` to the query. * The values to search for are given in an array. * </p> * <p> The first parameter `key` must be a valid field name * (i.e. it must not contain any special characters of Lucene). * </p> * <p> The second parameter `values` contains the values which are added to the final query. * It can be null or empty or contain only blank or empty Strings, * but then this method call has no effect on the final query. * No Exception will be thrown on this invocation. * If all other method calls don't change this LuceneQuery, * then {@link #getQuery()} will throw an IllegalStateException. * </p> * <p> The third parameter, the {@link QueryModifier} `modifier`, must not be null. * A NullPointerException is thrown otherwise. * </p> * * @param <K> generic element type * @param key the name of the field * @param value the values to be searched in the field * @param modifier the {@link QueryModifier} to apply to the field * @return this * @throws NullPointerException if the third parameter, modifier, is null */ <K> LuceneQuery addFieldAsArray(String key, K[] value, QueryModifier modifier); //--------------------------------------- // startField, endField, addBoost //--------------------------------------- /** * Starts a field with `key`:(.<br> * <b>Attention</b>: Use this method carefully and end all fields with * {@link LuceneQuery#endField()}, * or otherwise you get Exceptions on execution. * @param fieldName the name of the field; omitted if null * @param mandatory whether the field is mandatory for execution ("+" is prepended) or not. * @return this */ LuceneQuery startField(String fieldName, boolean mandatory); /** * Starts a field with `key`:(.<br> * <b>Attention</b>: Use this method carefully and end all fields with * {@link LuceneQuery#endField()}, * or otherwise you get Exceptions on execution. * @param fieldName the name of the field; omitted if null * @param modifier the modifiers for the field (see QueryModifier for more details) * @return this */ LuceneQuery startField(String fieldName, QueryModifier modifier); /** * Ends a previously started field. <br> * <b>Attention</b>: Use this method carefully and only end fields that have been started with * {@link LuceneQuery#startField(String, boolean)}, * or otherwise you get Solr-Exceptions on execution. * @return this */ LuceneQuery endField(); /** * Add a boost factor to the current element. <br> * <b>Attention</b>: Don't use this method directly after calling startField(...), * or otherwise you get Exceptions on execution. * @param boostFactor a positive double < 10.000.000 which boosts the previously added element * @return this */ LuceneQuery addBoost(double boostFactor); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8b79aef76e3fa16c245e0476774204d575f91337
3ded4c24cffc6a4fc0d14e15efb192f5629a9905
/src/com/google/ads/aq.java
d25206dc33f549d9e54644bf5a34ec3d91fae3ec
[]
no_license
cbedoy/FlappyBird
e9d20677881af3fe3104463315d608261be60dd8
c4873c03a4b1f757a1b4dc5ae486f5f41457af11
refs/heads/master
2020-06-02T06:56:30.324218
2014-02-18T06:49:12
2014-02-18T06:49:12
16,939,528
0
1
null
null
null
null
UTF-8
Java
false
false
8,417
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.ads; // Referenced classes of package com.google.ads: // ap public final class aq { private static final char a[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private static final char b[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".toCharArray(); private static final byte c[] = { -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -5, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, -9, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -9, -9, -9, -1, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, -9, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9 }; private static final byte d[] = { -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -5, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -9, -9, -9, -1, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, 63, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9 }; private static int a(char ac[], int i, byte abyte0[], int j, byte abyte1[]) { if (ac[i + 2] == '=') { abyte0[j] = (byte)(((abyte1[ac[i]] << 24) >>> 6 | (abyte1[ac[i + 1]] << 24) >>> 12) >>> 16); return 1; } if (ac[i + 3] == '=') { int l = (abyte1[ac[i]] << 24) >>> 6 | (abyte1[ac[i + 1]] << 24) >>> 12 | (abyte1[ac[i + 2]] << 24) >>> 18; abyte0[j] = (byte)(l >>> 16); abyte0[j + 1] = (byte)(l >>> 8); return 2; } else { int k = (abyte1[ac[i]] << 24) >>> 6 | (abyte1[ac[i + 1]] << 24) >>> 12 | (abyte1[ac[i + 2]] << 24) >>> 18 | (abyte1[ac[i + 3]] << 24) >>> 24; abyte0[j] = (byte)(k >> 16); abyte0[j + 1] = (byte)(k >> 8); abyte0[j + 2] = (byte)k; return 3; } } public static String a(byte abyte0[], int i, int j, char ac[], boolean flag) { char ac1[] = a(abyte0, i, j, ac, 0x7fffffff); int k = ac1.length; do { if (flag || k <= 0 || ac1[k - 1] != '=') { return new String(ac1, 0, k); } k--; } while (true); } public static String a(byte abyte0[], boolean flag) { return a(abyte0, 0, abyte0.length, b, flag); } public static byte[] a(String s) { char ac[] = s.toCharArray(); return a(ac, 0, ac.length); } public static byte[] a(char ac[], int i, int j) { return a(ac, i, j, c); } public static byte[] a(char ac[], int i, int j, byte abyte0[]) { byte abyte1[] = new byte[2 + (j * 3) / 4]; int k = 0; char ac1[] = new char[4]; boolean flag = false; int l = 0; int i1 = 0; while (l < j) { char c1 = ac[l + i]; char c2 = (char)(c1 & 0x7f); byte byte0 = abyte0[c2]; if (c2 == c1 && byte0 < -5) { throw new ap((new StringBuilder()).append("Bad Base64 input character at ").append(l).append(": ").append(ac[l + i]).append("(decimal)").toString()); } int j1; if (byte0 >= -1) { if (c2 == '=') { if (flag) { j1 = k; } else { if (l < 2) { throw new ap((new StringBuilder()).append("Invalid padding char found in position ").append(l).toString()); } flag = true; char c3 = (char)(0x7f & ac[i + (j - 1)]); if (c3 != '=' && c3 != '\n') { throw new ap("encoded value has invalid trailing char"); } j1 = k; } } else { if (flag) { throw new ap((new StringBuilder()).append("Data found after trailing padding char at index ").append(l).toString()); } int k1 = i1 + 1; ac1[i1] = c2; byte abyte2[]; if (k1 == 4) { j1 = k + a(ac1, 0, abyte1, k, abyte0); i1 = 0; } else { i1 = k1; j1 = k; } } } else { j1 = k; } l++; k = j1; } if (i1 != 0) { if (i1 == 1) { throw new ap((new StringBuilder()).append("single trailing character at offset ").append(j - 1).toString()); } ac1[i1] = '='; k += a(ac1, 0, abyte1, k, abyte0); } abyte2 = new byte[k]; System.arraycopy(abyte1, 0, abyte2, 0, k); return abyte2; } public static char[] a(byte abyte0[], int i, int j, char ac[], int k) { int l = 4 * ((j + 2) / 3); char ac1[] = new char[l + l / k]; int i1 = j - 2; int j1 = 0; int k1 = 0; int l1; for (l1 = 0; l1 < i1;) { int i2 = (abyte0[l1 + i] << 24) >>> 8 | (abyte0[i + (l1 + 1)] << 24) >>> 16 | (abyte0[i + (l1 + 2)] << 24) >>> 24; ac1[k1] = ac[i2 >>> 18]; ac1[k1 + 1] = ac[0x3f & i2 >>> 12]; ac1[k1 + 2] = ac[0x3f & i2 >>> 6]; ac1[k1 + 3] = ac[i2 & 0x3f]; int j2 = j1 + 4; if (j2 == k) { ac1[k1 + 4] = '\n'; k1++; j2 = 0; } l1 += 3; k1 += 4; j1 = j2; } if (l1 < j) { a(abyte0, l1 + i, j - l1, ac1, k1, ac); if (j1 + 4 == k) { ac1[k1 + 4] = '\n'; k1++; } int _tmp = k1 + 4; } return ac1; } private static char[] a(byte abyte0[], int i, int j, char ac[], int k, char ac1[]) { int l; int i1; int j1; int k1; int l1; if (j > 0) { l = (abyte0[i] << 24) >>> 8; } else { l = 0; } if (j > 1) { i1 = (abyte0[i + 1] << 24) >>> 16; } else { i1 = 0; } j1 = i1 | l; k1 = 0; if (j > 2) { k1 = (abyte0[i + 2] << 24) >>> 24; } l1 = k1 | j1; switch (j) { default: return ac; case 3: // '\003' ac[k] = ac1[l1 >>> 18]; ac[k + 1] = ac1[0x3f & l1 >>> 12]; ac[k + 2] = ac1[0x3f & l1 >>> 6]; ac[k + 3] = ac1[l1 & 0x3f]; return ac; case 2: // '\002' ac[k] = ac1[l1 >>> 18]; ac[k + 1] = ac1[0x3f & l1 >>> 12]; ac[k + 2] = ac1[0x3f & l1 >>> 6]; ac[k + 3] = '='; return ac; case 1: // '\001' ac[k] = ac1[l1 >>> 18]; ac[k + 1] = ac1[0x3f & l1 >>> 12]; ac[k + 2] = '='; ac[k + 3] = '='; return ac; } } }
[ "carlos.bedoy@gmail.com" ]
carlos.bedoy@gmail.com
602feb41da972fe2cf747697038478f09cf332ef
fd7d67bf1fb4c7f54aa5840d736c1a5f309c0abc
/app/src/main/java/bw/com/work17/util/UserServicer.java
81f72faa895a517a4e3d6844ef1ee07ccdca7410
[]
no_license
18833013313/work17
20873b49670cb29dd20af2019158b6922d98187c
a06b9442148a07757806a4b1cf5e19a6270d7fba
refs/heads/master
2020-04-26T07:40:12.054071
2019-03-02T03:49:40
2019-03-02T03:49:40
173,400,224
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
package bw.com.work17.util; import java.util.HashMap; import java.util.List; import bw.com.work17.entity.BaseBean; import bw.com.work17.entity.ShopBean; import io.reactivex.Observable; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.QueryMap; import retrofit2.http.Url; public interface UserServicer { //查询购物车 @GET Observable<BaseBean<List<ShopBean>>> GetShop(@Url String Url, @QueryMap HashMap<String,String> map); }
[ "2417539426@qq.com" ]
2417539426@qq.com
c052f649fa085220e0a788729b1de0db6d150da6
5be794df1c1252ab3ccd01b7f0e2966a13969e40
/src/test/java/com/learnreactivespring/handler/SampleHandlerFunctionTest.java
ca56788a1e6780db0925caf79fe399ef5ee75c43
[]
no_license
sren0130/reactivespring
5c21af03a33eea02099e93ec755b3ab2a6cce82d
f13fbbf0188bfec72e60bdd71b10ac31cb9603fe
refs/heads/master
2023-06-05T13:38:59.776246
2021-06-26T01:07:10
2021-06-26T01:07:10
380,385,321
0
0
null
null
null
null
UTF-8
Java
false
false
2,172
java
package com.learnreactivespring.handler; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import reactor.core.publisher.Flux; import reactor.test.StepVerifier; import static org.junit.jupiter.api.Assertions.assertEquals; // @RunWith is Junit4 test, no good, use Junit5 ====== It should use Spring boot test, not Webflux // @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureWebTestClient public class SampleHandlerFunctionTest { /* WebClient and WebTestClient are both for reactive testing, WebTestClient has new methods to check message response, isOk, header, content type, body, etc. */ @Autowired WebTestClient webTestClient; @Test public void flux_approach1() { Flux<Integer> integerFlux = webTestClient.get().uri("/fun/flux") .accept(MediaType.APPLICATION_JSON_UTF8) .exchange() .expectStatus().isOk() .returnResult(Integer.class) .getResponseBody(); StepVerifier.create(integerFlux) .expectSubscription() .expectNext(1) .expectNext(2) .expectNext(3) .expectNext(4) .expectNext(5) .expectNext(6) .verifyComplete(); } @Test public void mono() { Integer expectedValue = new Integer(1); webTestClient.get().uri("/fun/mono") .accept(MediaType.APPLICATION_JSON_UTF8) .exchange() .expectStatus().isOk() .expectBody(Integer.class) .consumeWith((response)->{ assertEquals(expectedValue, response.getResponseBody()); }); } }
[ "70994978+sren0130@users.noreply.github.com" ]
70994978+sren0130@users.noreply.github.com
df0efb8e88619e23f5d1fc61ff9fe01d4266bab0
005553bcc8991ccf055f15dcbee3c80926613b7f
/generated/com/guidewire/_generated/typekey/LedgerSideInternalAccess.java
5b333342af31a90382aae4138a528890287ab6e0
[]
no_license
azanaera/toggle-isbtf
5f14209cd87b98c123fad9af060efbbee1640043
faf991ec3db2fd1d126bc9b6be1422b819f6cdc8
refs/heads/master
2023-01-06T22:20:03.493096
2020-11-16T07:04:56
2020-11-16T07:04:56
313,212,938
0
0
null
2020-11-16T08:48:41
2020-11-16T06:42:23
null
UTF-8
Java
false
false
676
java
package com.guidewire._generated.typekey; @javax.annotation.processing.Generated(value = "com.guidewire.pl.metadata.codegen.Codegen", comments = "LedgerSide.eti;LedgerSide.eix;LedgerSide.etx") @java.lang.SuppressWarnings(value = {"deprecation", "unchecked"}) public class LedgerSideInternalAccess { public static final com.guidewire.pl.system.internal.FriendAccessor<com.guidewire.pl.persistence.code.TypeKeyFriendAccess<typekey.LedgerSide>> FRIEND_ACCESSOR = new com.guidewire.pl.system.internal.FriendAccessor<com.guidewire.pl.persistence.code.TypeKeyFriendAccess<typekey.LedgerSide>>(typekey.LedgerSide.class); private LedgerSideInternalAccess() { } }
[ "azanaera691@gmail.com" ]
azanaera691@gmail.com
2427907333855e100a065e2106e7269ac89eba41
cc6119407c9a721a906e0cfde0999ec1c68dfb20
/src/paneles/codigo/PnlProductos.java
466e61fb3c63d017bdeefc39e8dca40c00507d8b
[]
no_license
jimenezd99/LaYaquesita_presentacion
4383c7b1839a9da2a031e76850927c34a2341351
5c6f2d969aa437489c539a1b2bee651d2376d822
refs/heads/main
2023-04-26T18:54:45.189919
2021-05-28T17:31:14
2021-05-28T17:31:14
354,124,917
0
0
null
2021-05-28T16:06:20
2021-04-02T20:22:32
HTML
UTF-8
Java
false
false
7,126
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 paneles.codigo; import Entidades.Platillo; import fachadaLogica.FachadaLogica; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import javax.swing.AbstractButton; import javax.swing.JPanel; import javax.swing.JToggleButton; import vistas.FmPrincipal; /** * * @author Zannie */ public class PnlProductos extends JPanel { private FmPrincipal tomarOrden; private FachadaLogica fachadaLogica; private List<Platillo> platillos; private ArrayList<JToggleButton> botonesProductos; private javax.swing.JPanel jPanelOrden; private Dimension sizePrincipal; private Dimension minSize; private PnlPersonalizar personalizar; private final Color cafecito = new java.awt.Color(226, 207, 169); private final Color cremita = new java.awt.Color(254, 244, 222); public PnlProductos(FmPrincipal fmPrincipal, Point location) { this.jPanelOrden = new javax.swing.JPanel(); this.tomarOrden = fmPrincipal; this.fachadaLogica = new FachadaLogica(); this.personalizar = new PnlPersonalizar(tomarOrden, location, this); this.add(personalizar); personalizar.setVisible(false); botonesProductos = new ArrayList(); this.platillos = getPlatillos(); this.sizePrincipal = new Dimension((this.tomarOrden.getWidth() / 3) * 2, (this.tomarOrden.getHeight() / 10) * 8); this.minSize = new Dimension((int) this.sizePrincipal.getWidth() - 20, (int) (this.sizePrincipal.getHeight() / 4) * 3 + 20); initPanel(location); } public List getPlatillos() { ArrayList<Platillo> platillosTemp = new ArrayList<>(); ArrayList<Platillo> platillosTempBD = new ArrayList<>(); try { platillosTempBD.addAll(fachadaLogica.consultarPlatillos()); for (Platillo platillo : platillosTempBD) { if(!platillo.getDescripcion().equalsIgnoreCase("No disponible")){ platillosTemp.add(platillo); } } return platillosTemp; } catch(Exception e){ System.out.println("Error al conectar con la BD"); } return null; } public void initPanel(Point location) { this.setBackground(cafecito); this.setPreferredSize(sizePrincipal); this.setSize(sizePrincipal); this.setLocation(location); this.jPanelOrden.setBackground(cremita); this.jPanelOrden.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); this.jPanelOrden.setMinimumSize(minSize); this.jPanelOrden.setPreferredSize(minSize); this.add(jPanelOrden); } public Platillo getPlatillo(String nombre) { this.platillos = getPlatillos(); for (Platillo platillo : platillos) { if (platillo.getNombre().equalsIgnoreCase(nombre)) { return platillo; } } return null; } public void cargarBebidas() { ArrayList<Platillo> productos = getProductos("bebida"); removeBotones(); crearBotones(productos); } public void cargarHotdogs() { ArrayList<Platillo> productos = getProductos("hotdog"); removeBotones(); crearBotones(productos); } public void cargarExtras() { ArrayList<Platillo> productos = getProductos("extra"); removeBotones(); crearBotones(productos); } public void removeBotones() { jPanelOrden.removeAll(); jPanelOrden.revalidate(); jPanelOrden.repaint(); botonesProductos.clear(); } public void crearBotones(ArrayList<Platillo> productos) { for (Platillo producto : productos) { JToggleButton productoTemp = new JToggleButton(); botonesProductos.add(productoTemp); setBoton(productoTemp, producto.getNombre(), producto.getTipoProducto()); } setPosicionBoton(botonesProductos); } public ArrayList getProductos(String tipo) { ArrayList<Platillo> platillosTemp = new ArrayList(); for (Platillo platillo : platillos) { if (platillo.getTipoProducto().equalsIgnoreCase(tipo)) { platillosTemp.add(platillo); } } return platillosTemp; } public void setBoton(JToggleButton producto, String nombreProducto, String tipoProducto) { Color background = new Color(245, 133, 25); Color foreground = new Color(91, 52, 46); Dimension tamBoton = new Dimension(188, 88); Font font = new java.awt.Font("Century Gothic", 1, 18); producto.setFont(font); producto.setName(nombreProducto); producto.setBackground(background); producto.setForeground(foreground); producto.setText(nombreProducto); producto.setMaximumSize(tamBoton); producto.setMinimumSize(tamBoton); producto.setPreferredSize(tamBoton); setActionBoton(producto, tipoProducto); } public void setPosicionBoton(ArrayList<JToggleButton> productos) { ArrayList<JToggleButton> productosTemp = productos; int x = 0; int y = 0; for (JToggleButton producto : productosTemp) { producto.setLocation(x, y); jPanelOrden.add(producto); x += 10; } revalidate(); } public void setActionBoton(JToggleButton boton, String tipoPlatillo) { ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { AbstractButton abstractButton = (AbstractButton) actionEvent.getSource(); boolean selected = abstractButton.getModel().isSelected(); if (tipoPlatillo.equalsIgnoreCase("hotdog")) { jPanelOrden.setVisible(false); personalizar.setVisible(true); personalizar.setIngredientesPlatillo(getPlatillo(boton.getText())); } else { Platillo platillo = getPlatillo(boton.getText()); platillo.setCantidad(1); tomarOrden.getPanelOrden().addPlatillo(platillo); } boton.setSelected(false); } }; boton.addActionListener(actionListener); } public javax.swing.JPanel getPanelOrden() { return jPanelOrden; } public PnlPersonalizar getPnlPersonalizar() { return personalizar; } }
[ "56750116+MechanicalPuppet@users.noreply.github.com" ]
56750116+MechanicalPuppet@users.noreply.github.com
525d9e3d2578e21e78dfab21272fdd99beb1401b
eeec57f8c42dba2d4804850fea64623c5603c9dc
/SpringBootREST/src/main/java/br/com/eduardo/data/model/Person.java
ab5e7ac9d326fc2e80c9ce5f564eff1f65ec9943
[]
no_license
EduardoBecker34/SpringBootREST
960c1339406797f9cf4dc1a7b5e6afb7fcec90a2
607f2a051db3b87073501ff3b3dc49209a6506af
refs/heads/main
2023-02-27T21:23:15.389534
2021-01-29T01:36:33
2021-01-29T01:36:33
303,862,331
0
0
null
null
null
null
UTF-8
Java
false
false
3,001
java
package br.com.eduardo.data.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "person") public class Person implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 80) private String firstName; @Column(nullable = false, length = 80) private String lastName; @Column(nullable = false, length = 100) private String address; @Column(nullable = false, length = 6) private String gender; @Column(nullable = false) private boolean enabled; public Person() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public boolean isEnabled() { return enabled; } public void setEnabled(boolean enabled) { this.enabled = enabled; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((address == null) ? 0 : address.hashCode()); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); result = prime * result + ((gender == null) ? 0 : gender.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Person other = (Person) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (enabled != other.enabled) return false; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstName)) return false; if (gender == null) { if (other.gender != null) return false; } else if (!gender.equals(other.gender)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (lastName == null) { if (other.lastName != null) return false; } else if (!lastName.equals(other.lastName)) return false; return true; } }
[ "eduardobeckerdaluz@gmail.com" ]
eduardobeckerdaluz@gmail.com
0c28029446d6ecc6ffa71b16c1d0cbf0e7e8f34f
c328bd12e44e52108301db370867d2a9cfc6bbb5
/app/src/main/java/viralandroid/com/materialdesignslidingtabs/subtransistorbc547.java
89fe2e0793e1864caefdb707e95cebe9365fa91f
[]
no_license
VCoklat/Edtech
959b17c4e0abf92ab0882623e17cfa9cf837f48a
8eb857664c05962372f5bf53f649826c73e831ce
refs/heads/master
2021-06-30T09:20:26.975413
2017-09-16T23:58:11
2017-09-16T23:58:11
103,791,354
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
package viralandroid.com.materialdesignslidingtabs; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; /** * Created by vanhauten on 08/07/16. */ public class subtransistorbc547 extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.subtransistorbc547); Button pdf = (Button) findViewById(R.id.pdf); pdf.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Uri uri = Uri.parse("https://www.fairchildsemi.com/datasheets/BC/BC547.pdf"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); Button beli = (Button) findViewById(R.id.beli); beli.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Uri uri = Uri.parse("https://www.tokopedia.com/search?st=product&q=bc547"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); } }); } }
[ "VCoklat@users.noreply.github.com" ]
VCoklat@users.noreply.github.com
f5cbb8058caa9aa1af209f641994dcdd1c43f5ee
c263a8b8f73b4f19f1ced5d80ef47c4382f8a192
/android/Android ASCII 2.2 SDK v1.1.1/Rfid.AsciiProtocol/src/com/uk/tsl/rfid/asciiprotocol/parameters/TransponderParameters.java
51c7349dcfcaf7ab993c8e9475af3dd9b1302ba7
[]
no_license
DarioJaimes/SilvernestAlpes
5c2302dd20c5dc76a9823e8fc557768fe2a0dc3b
b18903aa782986af986045fad8b255ab41916bd8
refs/heads/master
2022-03-04T08:08:07.485527
2019-10-31T21:59:52
2019-10-31T21:59:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,812
java
package com.uk.tsl.rfid.asciiprotocol.parameters; import com.uk.tsl.rfid.asciiprotocol.Constants; import com.uk.tsl.rfid.asciiprotocol.enumerations.TriState; import com.uk.tsl.utils.StringHelper; //----------------------------------------------------------------------- // Copyright (c) 2013 Technology Solutions UK Ltd. All rights reserved. // // Authors: Brian Painter & Robin Stone //----------------------------------------------------------------------- /** Helper class for implementing ITransponderParameters */ public final class TransponderParameters { /** Append the parameters from source that have been specified to the command line @param source The parameters to append @param line The line to append the specified parameters to */ public static void appendToCommandLine(ITransponderParameters source, StringBuilder line) { if (source.getIncludeChecksum() != TriState.NOT_SPECIFIED) { line.append(String.format("-c%s", source.getIncludeChecksum().getArgument())); } if (source.getIncludePC() != TriState.NOT_SPECIFIED) { line.append(String.format("-e%s", source.getIncludePC().getArgument())); } if (source.getIncludeTransponderRssi() != TriState.NOT_SPECIFIED) { line.append(String.format("-r%s", source.getIncludeTransponderRssi().getArgument())); } if (source.getIncludeIndex() != TriState.NOT_SPECIFIED) { line.append(String.format("-ix%s", source.getIncludeIndex().getArgument())); } if (!StringHelper.isNullOrEmpty(source.getAccessPassword())) { if (source.getAccessPassword().length() != 8) { String reasonMessage = String.format(Constants.ERROR_LOCALE, "Invalid access password length (%s). Must be 8 Ascii hex chars.", source.getAccessPassword().length()); throw new IllegalArgumentException(reasonMessage); } line.append(String.format("-ap%s", source.getAccessPassword())); } } /** Parses the specified parameter and sets the appropriate property in value @param value The parameters to update @param parameter The parameter to parse @return True if parameter was parsed */ public static boolean parseParameterFor(ITransponderParameters value, String parameter) { if (parameter.length() > 0) { // Decode parameters switch (parameter.charAt(0)) { case 'i': { // Decode the 'i' parameters if (parameter.length() > 1) { switch (parameter.charAt(1)) { case 'x': { value.setIncludeIndex(TriState.Parse(parameter.substring(2))); return true; } default: break; } } } break; case 'a': { // Decode the 'a' parameters if (parameter.length() > 1) { switch (parameter.charAt(1)) { case 'p': { value.setAccessPassword(parameter.substring(2).trim()); return true; } default: break; } } } break; case 'c': { value.setIncludeChecksum(TriState.Parse(parameter.substring(1))); return true; } case 'e': { value.setIncludePC(TriState.Parse(parameter.substring(1))); return true; } case 'r': { value.setIncludeTransponderRssi(TriState.Parse(parameter.substring(1))); return true; } default: break; } } return false; } /** Sets value to the parameter defaults @param value The parameters to set to defaults */ public static void setDefaultParametersFor(ITransponderParameters value) { value.setIncludeChecksum(TriState.NOT_SPECIFIED); value.setIncludePC(TriState.NOT_SPECIFIED); value.setIncludeTransponderRssi(TriState.NOT_SPECIFIED); value.setIncludeIndex(TriState.NOT_SPECIFIED); value.setAccessPassword(""); } }
[ "jaimes.alpes@gmail.com" ]
jaimes.alpes@gmail.com
ab7c3b8e4bf00881847b63d2862b6cf76980c78c
c8143440db8d1b90012ccac7c354f882484caec0
/src/test/java/org/openinfinity/core/aspect/CryptoAspectBehaviour.java
e30bf68aa6376823f322a6ace4ef5a16681c4a6f
[ "Apache-2.0" ]
permissive
open-infinity/core
1edd6626f5464e8b18b21e762882703cadb14b52
33518072d6346721c72ee2cb9d01e8b720b9d6d8
refs/heads/master
2020-12-25T17:34:22.267190
2016-07-29T11:08:34
2016-07-29T11:08:34
19,940,259
0
1
null
null
null
null
UTF-8
Java
false
false
3,607
java
/* * Copyright (c) 2011-2014 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.openinfinity.core.aspect; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; import org.aopalliance.intercept.Joinpoint; import org.aspectj.lang.ProceedingJoinPoint; import org.jbehave.core.annotations.BeforeScenario; import org.jbehave.core.annotations.Given; import org.jbehave.core.annotations.Then; import org.jbehave.core.annotations.When; import org.mockito.Mockito; import org.openinfinity.common.infrastructure.AnnotatedEmbedderUsingSpring; import org.openinfinity.core.annotation.Encrypt; import org.openinfinity.core.common.domain.Account; import org.springframework.stereotype.Component; /** * Functional test class for cipher aspect. * * @author Ilkka Leinonen * @version 1.0.0 * @since 1.3.0 */ @Component("cipherAspectBehaviour") public class CryptoAspectBehaviour extends AnnotatedEmbedderUsingSpring { private CryptoAspect cipherAspect; private Account actual; public static String EXPECTED_ID = "Open-Infinity"; public static String EXPECTED_NAME = "Open"; public static String EXPECTED_ADDRESS = "Infinify"; @BeforeScenario public void setupScenario() { actual = new Account(EXPECTED_ID, EXPECTED_NAME); actual.setAddress(EXPECTED_ADDRESS); } @Given("an aspect to be called") public void aspectForExceptionTranslation() { cipherAspect = new CryptoAspect(); } @When("executing business operation and encryption of an object graphs is needed") public void executingBusinessOperationAndEncryptionOfAnObjectGraphsIsNeeded() { //TODO: imitate proceed functionality of the aspect ProceedingJoinPoint joinPoint = (ProceedingJoinPoint) Mockito.mock(Joinpoint.class); Encrypt encrypt = Mockito.mock(Encrypt.class); when(joinPoint.getArgs()).thenReturn(new Object[]{actual}); when(encrypt.argumentStrategy()).thenReturn(ArgumentStrategy.ALL); cipherAspect.encryptObjectContentAfterMethod(joinPoint, encrypt); System.out.println("Doing stuff"); assertTrue(EXPECTED_ID.equals(actual.getId())); } @When("executing business operation and decryption of an object graphs is needed") public void executingBusinessOperationAndDecryptionOfAnObjectGraphsIsNeeded() { } @Then("object graphs spefied fields must be encrypted") public void knownExceptionsMustBeByPassed() { } @Then("object graphs none of the fields must not be encrypted") public void objectGraphsNoneOfTheFieldsMustNotBeEncrypted() { } @Then("object graphs spefied fields must be decrypted") public void objectGraphsSpefiedFieldsMustBeDecrypted() { } @Then("object graphs all fields must be decrypted") public void objectGraphsAllFieldsMustBeDecrypted() { } @Then("object graphs none of the fields must not be decrypted") public void objectGraphsNoneOfTheFieldsMustNotBeDecrypted() { } @Override protected String getStoryName() { return "crypto_aspect.story"; } }
[ "ilkka.h.leinonen@gmail.com" ]
ilkka.h.leinonen@gmail.com
6c79d34218216e0b75234d848ddc483c9c5f4cad
c52a5e16c01cb2b47fbdd807e5f6bd9322e85502
/Collection/HashTable.java
c382ece8a907bff8ff061dd3abea02bde80a0152
[]
no_license
1212100124/JavaStudyNote
202837969fdf2a06b512e453e28c07ac92d28362
b14b914f69fd6de3078ca1d12ed3472faa19d91d
refs/heads/master
2021-01-18T23:04:28.977927
2017-07-01T07:15:55
2017-07-01T07:15:55
87,087,436
0
0
null
null
null
null
UTF-8
Java
false
false
43,105
java
/* 他继承自Dictionary,实现Map,Cloneable,Seriablizable接口 感觉整体跟HashMap类似,只不过是线程安全的罢了 */ public class Hashtable<K,V> extends Dictionary<K,V> implements Map<K,V>, Cloneable, java.io.Serializable { /** * The hash table data. */ // 存储数据的数组 private transient Entry<?,?>[] table; /** * The total number of entries in the hash table. */ // hashtable中的元素个数 private transient int count; /** * The table is rehashed when its size exceeds this threshold. (The * value of this field is (int)(capacity * loadFactor).) * * @serial */ // 如果大小超过阈值,将会扩大 private int threshold; // 加载因子 private float loadFactor; /** * The number of times this Hashtable has been structurally modified * Structural modifications are those that change the number of entries in * the Hashtable or otherwise modify its internal structure (e.g., * rehash). This field is used to make iterators on Collection-views of * the Hashtable fail-fast. (See ConcurrentModificationException). */ // 用来检查fail-fast private transient int modCount = 0; /** use serialVersionUID from JDK 1.0.2 for interoperability */ private static final long serialVersionUID = 1421746759512286392L; // 容量+加载因子的初始化方法 public Hashtable(int initialCapacity, float loadFactor) { if (initialCapacity < 0) throw new IllegalArgumentException("Illegal Capacity: "+ initialCapacity); if (loadFactor <= 0 || Float.isNaN(loadFactor)) throw new IllegalArgumentException("Illegal Load: "+loadFactor); if (initialCapacity==0) initialCapacity = 1; this.loadFactor = loadFactor; table = new Entry<?,?>[initialCapacity]; threshold = (int)Math.min(initialCapacity * loadFactor, MAX_ARRAY_SIZE + 1); } public Hashtable(int initialCapacity) { this(initialCapacity, 0.75f); } // 默认构造函数,构造一个大小在11,factor为0.75的Map public Hashtable() { this(11, 0.75f); } public Hashtable(Map<? extends K, ? extends V> t) { this(Math.max(2*t.size(), 11), 0.75f); putAll(t); } // 线程安全的,用于返回 public synchronized int size() { return count; } /** * Tests if this hashtable maps no keys to values. * * @return <code>true</code> if this hashtable maps no keys to values; * <code>false</code> otherwise. */ public synchronized boolean isEmpty() { return count == 0; } /** * Returns an enumeration of the keys in this hashtable. * * @return an enumeration of the keys in this hashtable. * @see Enumeration * @see #elements() * @see #keySet() * @see Map */ public synchronized Enumeration<K> keys() { return this.<K>getEnumeration(KEYS); } /** * Returns an enumeration of the values in this hashtable. * Use the Enumeration methods on the returned object to fetch the elements * sequentially. * * @return an enumeration of the values in this hashtable. * @see java.util.Enumeration * @see #keys() * @see #values() * @see Map */ public synchronized Enumeration<V> elements() { return this.<V>getEnumeration(VALUES); } /** * Tests if some key maps into the specified value in this hashtable. * This operation is more expensive than the {@link #containsKey * containsKey} method. * * <p>Note that this method is identical in functionality to * {@link #containsValue containsValue}, (which is part of the * {@link Map} interface in the collections framework). * * @param value a value to search for * @return <code>true</code> if and only if some key maps to the * <code>value</code> argument in this hashtable as * determined by the <tt>equals</tt> method; * <code>false</code> otherwise. * @exception NullPointerException if the value is <code>null</code> */ public synchronized boolean contains(Object value) { if (value == null) { throw new NullPointerException(); } Entry<?,?> tab[] = table; for (int i = tab.length ; i-- > 0 ;) { for (Entry<?,?> e = tab[i] ; e != null ; e = e.next) { if (e.value.equals(value)) { return true; } } } return false; } /** * Returns true if this hashtable maps one or more keys to this value. * * <p>Note that this method is identical in functionality to {@link * #contains contains} (which predates the {@link Map} interface). * * @param value value whose presence in this hashtable is to be tested * @return <tt>true</tt> if this map maps one or more keys to the * specified value * @throws NullPointerException if the value is <code>null</code> * @since 1.2 */ public boolean containsValue(Object value) { return contains(value); } /** * Tests if the specified object is a key in this hashtable. * * @param key possible key * @return <code>true</code> if and only if the specified object * is a key in this hashtable, as determined by the * <tt>equals</tt> method; <code>false</code> otherwise. * @throws NullPointerException if the key is <code>null</code> * @see #contains(Object) */ public synchronized boolean containsKey(Object key) { Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { return true; } } return false; } /** * Returns the value to which the specified key is mapped, * or {@code null} if this map contains no mapping for the key. * * <p>More formally, if this map contains a mapping from a key * {@code k} to a value {@code v} such that {@code (key.equals(k))}, * then this method returns {@code v}; otherwise it returns * {@code null}. (There can be at most one such mapping.) * * @param key the key whose associated value is to be returned * @return the value to which the specified key is mapped, or * {@code null} if this map contains no mapping for the key * @throws NullPointerException if the specified key is null * @see #put(Object, Object) */ @SuppressWarnings("unchecked") public synchronized V get(Object key) { Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { return (V)e.value; } } return null; } /** * The maximum size of array to allocate. * Some VMs reserve some header words in an array. * Attempts to allocate larger arrays may result in * OutOfMemoryError: Requested array size exceeds VM limit */ private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; /** * Increases the capacity of and internally reorganizes this * hashtable, in order to accommodate and access its entries more * efficiently. This method is called automatically when the * number of keys in the hashtable exceeds this hashtable's capacity * and load factor. */ @SuppressWarnings("unchecked") // 扩容 protected void rehash() { int oldCapacity = table.length; Entry<?,?>[] oldMap = table; // overflow-conscious code //新的容量大小是原来的2倍 int newCapacity = (oldCapacity << 1) + 1; if (newCapacity - MAX_ARRAY_SIZE > 0) { if (oldCapacity == MAX_ARRAY_SIZE) // Keep running with MAX_ARRAY_SIZE buckets return; newCapacity = MAX_ARRAY_SIZE; } Entry<?,?>[] newMap = new Entry<?,?>[newCapacity]; modCount++; threshold = (int)Math.min(newCapacity * loadFactor, MAX_ARRAY_SIZE + 1); table = newMap; // 直接丢过去 换位置就好(感觉原来的hashMap也这样就好了) for (int i = oldCapacity ; i-- > 0 ;) { for (Entry<K,V> old = (Entry<K,V>)oldMap[i] ; old != null ; ) { Entry<K,V> e = old; old = old.next; int index = (e.hash & 0x7FFFFFFF) % newCapacity; e.next = (Entry<K,V>)newMap[index]; newMap[index] = e; } } } // 添加Entry private void addEntry(int hash, K key, V value, int index) { modCount++; Entry<?,?> tab[] = table; // 如果元素个数达到了阈值,就需要扩容 if (count >= threshold) { // Rehash the table if the threshold is exceeded rehash(); tab = table; hash = key.hashCode(); // 更新index位置 index = (hash & 0x7FFFFFFF) % tab.length; } // Creates the new entry. @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>) tab[index]; //放在这个桶的第一个位置 tab[index] = new Entry<>(hash, key, value, e); count++; } // 线程安全的往 HashTable当中添加k,v public synchronized V put(K key, V value) { // Make sure the value is not null if (value == null) { throw new NullPointerException(); } // Makes sure the key is not already in the hashtable. Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> entry = (Entry<K,V>)tab[index]; // 查看这个是否已经存在 for(; entry != null ; entry = entry.next) { if ((entry.hash == hash) && entry.key.equals(key)) { V old = entry.value; entry.value = value; return old; } } // 添加元素 addEntry(hash, key, value, index); return null; } /** * Removes the key (and its corresponding value) from this * hashtable. This method does nothing if the key is not in the hashtable. * * @param key the key that needs to be removed * @return the value to which the key had been mapped in this hashtable, * or <code>null</code> if the key did not have a mapping * @throws NullPointerException if the key is <code>null</code> */ // 线程安全的删除一个元素 public synchronized V remove(Object key) { Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for(Entry<K,V> prev = null ; e != null ; prev = e, e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { modCount++; // 直接把这个指针指向这个节点的后一个节点就行 if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; V oldValue = e.value; e.value = null; return oldValue; } } return null; } /** * Copies all of the mappings from the specified map to this hashtable. * These mappings will replace any mappings that this hashtable had for any * of the keys currently in the specified map. * * @param t mappings to be stored in this map * @throws NullPointerException if the specified map is null * @since 1.2 */ public synchronized void putAll(Map<? extends K, ? extends V> t) { for (Map.Entry<? extends K, ? extends V> e : t.entrySet()) put(e.getKey(), e.getValue()); } /** * Clears this hashtable so that it contains no keys. */ public synchronized void clear() { Entry<?,?> tab[] = table; modCount++; for (int index = tab.length; --index >= 0; ) tab[index] = null; count = 0; } /** * Creates a shallow copy of this hashtable. All the structure of the * hashtable itself is copied, but the keys and values are not cloned. * This is a relatively expensive operation. * * @return a clone of the hashtable */ public synchronized Object clone() { try { Hashtable<?,?> t = (Hashtable<?,?>)super.clone(); t.table = new Entry<?,?>[table.length]; for (int i = table.length ; i-- > 0 ; ) { t.table[i] = (table[i] != null) ? (Entry<?,?>) table[i].clone() : null; } t.keySet = null; t.entrySet = null; t.values = null; t.modCount = 0; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(e); } } /** * Returns a string representation of this <tt>Hashtable</tt> object * in the form of a set of entries, enclosed in braces and separated * by the ASCII characters "<tt>,&nbsp;</tt>" (comma and space). Each * entry is rendered as the key, an equals sign <tt>=</tt>, and the * associated element, where the <tt>toString</tt> method is used to * convert the key and element to strings. * * @return a string representation of this hashtable */ public synchronized String toString() { int max = size() - 1; if (max == -1) return "{}"; StringBuilder sb = new StringBuilder(); Iterator<Map.Entry<K,V>> it = entrySet().iterator(); sb.append('{'); for (int i = 0; ; i++) { Map.Entry<K,V> e = it.next(); K key = e.getKey(); V value = e.getValue(); sb.append(key == this ? "(this Map)" : key.toString()); sb.append('='); sb.append(value == this ? "(this Map)" : value.toString()); if (i == max) return sb.append('}').toString(); sb.append(", "); } } private <T> Enumeration<T> getEnumeration(int type) { if (count == 0) { return Collections.emptyEnumeration(); } else { return new Enumerator<>(type, false); } } private <T> Iterator<T> getIterator(int type) { if (count == 0) { return Collections.emptyIterator(); } else { return new Enumerator<>(type, true); } } // Views /** * Each of these fields are initialized to contain an instance of the * appropriate view the first time this view is requested. The views are * stateless, so there's no reason to create more than one of each. */ private transient volatile Set<K> keySet; private transient volatile Set<Map.Entry<K,V>> entrySet; private transient volatile Collection<V> values; /** * Returns a {@link Set} view of the keys contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified * while an iteration over the set is in progress (except through * the iterator's own <tt>remove</tt> operation), the results of * the iteration are undefined. The set supports element removal, * which removes the corresponding mapping from the map, via the * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> * operations. It does not support the <tt>add</tt> or <tt>addAll</tt> * operations. * * @since 1.2 */ public Set<K> keySet() { if (keySet == null) keySet = Collections.synchronizedSet(new KeySet(), this); return keySet; } private class KeySet extends AbstractSet<K> { public Iterator<K> iterator() { return getIterator(KEYS); } public int size() { return count; } public boolean contains(Object o) { return containsKey(o); } public boolean remove(Object o) { return Hashtable.this.remove(o) != null; } public void clear() { Hashtable.this.clear(); } } /** * Returns a {@link Set} view of the mappings contained in this map. * The set is backed by the map, so changes to the map are * reflected in the set, and vice-versa. If the map is modified * while an iteration over the set is in progress (except through * the iterator's own <tt>remove</tt> operation, or through the * <tt>setValue</tt> operation on a map entry returned by the * iterator) the results of the iteration are undefined. The set * supports element removal, which removes the corresponding * mapping from the map, via the <tt>Iterator.remove</tt>, * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and * <tt>clear</tt> operations. It does not support the * <tt>add</tt> or <tt>addAll</tt> operations. * * @since 1.2 */ public Set<Map.Entry<K,V>> entrySet() { if (entrySet==null) entrySet = Collections.synchronizedSet(new EntrySet(), this); return entrySet; } private class EntrySet extends AbstractSet<Map.Entry<K,V>> { public Iterator<Map.Entry<K,V>> iterator() { return getIterator(ENTRIES); } public boolean add(Map.Entry<K,V> o) { return super.add(o); } public boolean contains(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry<?,?> entry = (Map.Entry<?,?>)o; Object key = entry.getKey(); Entry<?,?>[] tab = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry<?,?> e = tab[index]; e != null; e = e.next) if (e.hash==hash && e.equals(entry)) return true; return false; } public boolean remove(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry<?,?> entry = (Map.Entry<?,?>) o; Object key = entry.getKey(); Entry<?,?>[] tab = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for(Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if (e.hash==hash && e.equals(entry)) { modCount++; if (prev != null) prev.next = e.next; else tab[index] = e.next; count--; e.value = null; return true; } } return false; } public int size() { return count; } public void clear() { Hashtable.this.clear(); } } /** * Returns a {@link Collection} view of the values contained in this map. * The collection is backed by the map, so changes to the map are * reflected in the collection, and vice-versa. If the map is * modified while an iteration over the collection is in progress * (except through the iterator's own <tt>remove</tt> operation), * the results of the iteration are undefined. The collection * supports element removal, which removes the corresponding * mapping from the map, via the <tt>Iterator.remove</tt>, * <tt>Collection.remove</tt>, <tt>removeAll</tt>, * <tt>retainAll</tt> and <tt>clear</tt> operations. It does not * support the <tt>add</tt> or <tt>addAll</tt> operations. * * @since 1.2 */ public Collection<V> values() { if (values==null) values = Collections.synchronizedCollection(new ValueCollection(), this); return values; } private class ValueCollection extends AbstractCollection<V> { public Iterator<V> iterator() { return getIterator(VALUES); } public int size() { return count; } public boolean contains(Object o) { return containsValue(o); } public void clear() { Hashtable.this.clear(); } } // Comparison and hashing /** * Compares the specified Object with this Map for equality, * as per the definition in the Map interface. * * @param o object to be compared for equality with this hashtable * @return true if the specified Object is equal to this Map * @see Map#equals(Object) * @since 1.2 */ public synchronized boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map)) return false; Map<?,?> t = (Map<?,?>) o; if (t.size() != size()) return false; try { Iterator<Map.Entry<K,V>> i = entrySet().iterator(); while (i.hasNext()) { Map.Entry<K,V> e = i.next(); K key = e.getKey(); V value = e.getValue(); if (value == null) { if (!(t.get(key)==null && t.containsKey(key))) return false; } else { if (!value.equals(t.get(key))) return false; } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } /** * Returns the hash code value for this Map as per the definition in the * Map interface. * * @see Map#hashCode() * @since 1.2 */ public synchronized int hashCode() { /* * This code detects the recursion caused by computing the hash code * of a self-referential hash table and prevents the stack overflow * that would otherwise result. This allows certain 1.1-era * applets with self-referential hash tables to work. This code * abuses the loadFactor field to do double-duty as a hashCode * in progress flag, so as not to worsen the space performance. * A negative load factor indicates that hash code computation is * in progress. */ int h = 0; if (count == 0 || loadFactor < 0) return h; // Returns zero loadFactor = -loadFactor; // Mark hashCode computation in progress Entry<?,?>[] tab = table; for (Entry<?,?> entry : tab) { while (entry != null) { h += entry.hashCode(); entry = entry.next; } } loadFactor = -loadFactor; // Mark hashCode computation complete return h; } @Override public synchronized V getOrDefault(Object key, V defaultValue) { V result = get(key); return (null == result) ? defaultValue : result; } @SuppressWarnings("unchecked") @Override public synchronized void forEach(BiConsumer<? super K, ? super V> action) { Objects.requireNonNull(action); // explicit check required in case // table is empty. final int expectedModCount = modCount; Entry<?, ?>[] tab = table; for (Entry<?, ?> entry : tab) { while (entry != null) { action.accept((K)entry.key, (V)entry.value); entry = entry.next; if (expectedModCount != modCount) { throw new ConcurrentModificationException(); } } } } @SuppressWarnings("unchecked") @Override public synchronized void replaceAll(BiFunction<? super K, ? super V, ? extends V> function) { Objects.requireNonNull(function); // explicit check required in case // table is empty. final int expectedModCount = modCount; Entry<K, V>[] tab = (Entry<K, V>[])table; for (Entry<K, V> entry : tab) { while (entry != null) { entry.value = Objects.requireNonNull( function.apply(entry.key, entry.value)); entry = entry.next; if (expectedModCount != modCount) { throw new ConcurrentModificationException(); } } } } @Override public synchronized V putIfAbsent(K key, V value) { Objects.requireNonNull(value); // Makes sure the key is not already in the hashtable. Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> entry = (Entry<K,V>)tab[index]; for (; entry != null; entry = entry.next) { if ((entry.hash == hash) && entry.key.equals(key)) { V old = entry.value; if (old == null) { entry.value = value; } return old; } } addEntry(hash, key, value, index); return null; } @Override public synchronized boolean remove(Object key, Object value) { Objects.requireNonNull(value); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if ((e.hash == hash) && e.key.equals(key) && e.value.equals(value)) { modCount++; if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; e.value = null; return true; } } return false; } @Override public synchronized boolean replace(K key, V oldValue, V newValue) { Objects.requireNonNull(oldValue); Objects.requireNonNull(newValue); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (; e != null; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { if (e.value.equals(oldValue)) { e.value = newValue; return true; } else { return false; } } } return false; } @Override public synchronized V replace(K key, V value) { Objects.requireNonNull(value); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (; e != null; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { V oldValue = e.value; e.value = value; return oldValue; } } return null; } @Override public synchronized V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) { Objects.requireNonNull(mappingFunction); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (; e != null; e = e.next) { if (e.hash == hash && e.key.equals(key)) { // Hashtable not accept null value return e.value; } } V newValue = mappingFunction.apply(key); if (newValue != null) { addEntry(hash, key, newValue, index); } return newValue; } @Override public synchronized V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { Objects.requireNonNull(remappingFunction); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if (e.hash == hash && e.key.equals(key)) { V newValue = remappingFunction.apply(key, e.value); if (newValue == null) { modCount++; if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; } else { e.value = newValue; } return newValue; } } return null; } @Override public synchronized V compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { Objects.requireNonNull(remappingFunction); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if (e.hash == hash && Objects.equals(e.key, key)) { V newValue = remappingFunction.apply(key, e.value); if (newValue == null) { modCount++; if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; } else { e.value = newValue; } return newValue; } } V newValue = remappingFunction.apply(key, null); if (newValue != null) { addEntry(hash, key, newValue, index); } return newValue; } @Override public synchronized V merge(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) { Objects.requireNonNull(remappingFunction); Entry<?,?> tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for (Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if (e.hash == hash && e.key.equals(key)) { V newValue = remappingFunction.apply(e.value, value); if (newValue == null) { modCount++; if (prev != null) { prev.next = e.next; } else { tab[index] = e.next; } count--; } else { e.value = newValue; } return newValue; } } if (value != null) { addEntry(hash, key, value, index); } return value; } /** * Save the state of the Hashtable to a stream (i.e., serialize it). * * @serialData The <i>capacity</i> of the Hashtable (the length of the * bucket array) is emitted (int), followed by the * <i>size</i> of the Hashtable (the number of key-value * mappings), followed by the key (Object) and value (Object) * for each key-value mapping represented by the Hashtable * The key-value mappings are emitted in no particular order. */ private void writeObject(java.io.ObjectOutputStream s) throws IOException { Entry<Object, Object> entryStack = null; synchronized (this) { // Write out the threshold and loadFactor s.defaultWriteObject(); // Write out the length and count of elements s.writeInt(table.length); s.writeInt(count); // Stack copies of the entries in the table for (int index = 0; index < table.length; index++) { Entry<?,?> entry = table[index]; while (entry != null) { entryStack = new Entry<>(0, entry.key, entry.value, entryStack); entry = entry.next; } } } // Write out the key/value objects from the stacked entries while (entryStack != null) { s.writeObject(entryStack.key); s.writeObject(entryStack.value); entryStack = entryStack.next; } } /** * Reconstitute the Hashtable from a stream (i.e., deserialize it). */ private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { // Read in the threshold and loadFactor s.defaultReadObject(); // Validate loadFactor (ignore threshold - it will be re-computed) if (loadFactor <= 0 || Float.isNaN(loadFactor)) throw new StreamCorruptedException("Illegal Load: " + loadFactor); // Read the original length of the array and number of elements int origlength = s.readInt(); int elements = s.readInt(); // Validate # of elements if (elements < 0) throw new StreamCorruptedException("Illegal # of Elements: " + elements); // Clamp original length to be more than elements / loadFactor // (this is the invariant enforced with auto-growth) origlength = Math.max(origlength, (int)(elements / loadFactor) + 1); // Compute new length with a bit of room 5% + 3 to grow but // no larger than the clamped original length. Make the length // odd if it's large enough, this helps distribute the entries. // Guard against the length ending up zero, that's not valid. int length = (int)((elements + elements / 20) / loadFactor) + 3; if (length > elements && (length & 1) == 0) length--; length = Math.min(length, origlength); table = new Entry<?,?>[length]; threshold = (int)Math.min(length * loadFactor, MAX_ARRAY_SIZE + 1); count = 0; // Read the number of elements and then all the key/value objects for (; elements > 0; elements--) { @SuppressWarnings("unchecked") K key = (K)s.readObject(); @SuppressWarnings("unchecked") V value = (V)s.readObject(); // sync is eliminated for performance reconstitutionPut(table, key, value); } } /** * The put method used by readObject. This is provided because put * is overridable and should not be called in readObject since the * subclass will not yet be initialized. * * <p>This differs from the regular put method in several ways. No * checking for rehashing is necessary since the number of elements * initially in the table is known. The modCount is not incremented and * there's no synchronization because we are creating a new instance. * Also, no return value is needed. */ private void reconstitutionPut(Entry<?,?>[] tab, K key, V value) throws StreamCorruptedException { if (value == null) { throw new java.io.StreamCorruptedException(); } // Makes sure the key is not already in the hashtable. // This should not happen in deserialized version. int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry<?,?> e = tab[index] ; e != null ; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { throw new java.io.StreamCorruptedException(); } } // Creates the new entry. @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; tab[index] = new Entry<>(hash, key, value, e); count++; } /** * Hashtable bucket collision list entry */ private static class Entry<K,V> implements Map.Entry<K,V> { final int hash; final K key; V value; Entry<K,V> next; protected Entry(int hash, K key, V value, Entry<K,V> next) { this.hash = hash; this.key = key; this.value = value; this.next = next; } @SuppressWarnings("unchecked") protected Object clone() { return new Entry<>(hash, key, value, (next==null ? null : (Entry<K,V>) next.clone())); } // Map.Entry Ops public K getKey() { return key; } public V getValue() { return value; } public V setValue(V value) { if (value == null) throw new NullPointerException(); V oldValue = this.value; this.value = value; return oldValue; } public boolean equals(Object o) { if (!(o instanceof Map.Entry)) return false; Map.Entry<?,?> e = (Map.Entry<?,?>)o; return (key==null ? e.getKey()==null : key.equals(e.getKey())) && (value==null ? e.getValue()==null : value.equals(e.getValue())); } public int hashCode() { return hash ^ Objects.hashCode(value); } public String toString() { return key.toString()+"="+value.toString(); } } // Types of Enumerations/Iterations private static final int KEYS = 0; private static final int VALUES = 1; private static final int ENTRIES = 2; /** * A hashtable enumerator class. This class implements both the * Enumeration and Iterator interfaces, but individual instances * can be created with the Iterator methods disabled. This is necessary * to avoid unintentionally increasing the capabilities granted a user * by passing an Enumeration. */ private class Enumerator<T> implements Enumeration<T>, Iterator<T> { Entry<?,?>[] table = Hashtable.this.table; int index = table.length; Entry<?,?> entry; Entry<?,?> lastReturned; int type; /** * Indicates whether this Enumerator is serving as an Iterator * or an Enumeration. (true -> Iterator). */ boolean iterator; /** * The modCount value that the iterator believes that the backing * Hashtable should have. If this expectation is violated, the iterator * has detected concurrent modification. */ protected int expectedModCount = modCount; Enumerator(int type, boolean iterator) { this.type = type; this.iterator = iterator; } public boolean hasMoreElements() { Entry<?,?> e = entry; int i = index; Entry<?,?>[] t = table; /* Use locals for faster loop iteration */ while (e == null && i > 0) { e = t[--i]; } entry = e; index = i; return e != null; } @SuppressWarnings("unchecked") public T nextElement() { Entry<?,?> et = entry; int i = index; Entry<?,?>[] t = table; /* Use locals for faster loop iteration */ while (et == null && i > 0) { et = t[--i]; } entry = et; index = i; if (et != null) { Entry<?,?> e = lastReturned = entry; entry = e.next; return type == KEYS ? (T)e.key : (type == VALUES ? (T)e.value : (T)e); } throw new NoSuchElementException("Hashtable Enumerator"); } // Iterator methods public boolean hasNext() { return hasMoreElements(); } public T next() { if (modCount != expectedModCount) throw new ConcurrentModificationException(); return nextElement(); } public void remove() { if (!iterator) throw new UnsupportedOperationException(); if (lastReturned == null) throw new IllegalStateException("Hashtable Enumerator"); if (modCount != expectedModCount) throw new ConcurrentModificationException(); synchronized(Hashtable.this) { Entry<?,?>[] tab = Hashtable.this.table; int index = (lastReturned.hash & 0x7FFFFFFF) % tab.length; @SuppressWarnings("unchecked") Entry<K,V> e = (Entry<K,V>)tab[index]; for(Entry<K,V> prev = null; e != null; prev = e, e = e.next) { if (e == lastReturned) { modCount++; expectedModCount++; if (prev == null) tab[index] = e.next; else prev.next = e.next; count--; lastReturned = null; return; } } throw new ConcurrentModificationException(); } } } }
[ "294141800@qq.com" ]
294141800@qq.com
a8d20efd98196cfb04525af86be8607cb07977e8
a3ce481751c74a89ccb8916c4c82a92cca4c7f42
/src/ikj/main/ioke/lang/test/SimpleVoidClass.java
01e561702d8cbe3970e9222c0079d48f5be6f14c
[ "MIT", "ICU" ]
permissive
olabini/ioke
265b6a32d63a2a435e586d375018f28cdfbc08fe
c5f345b3983a95f3e5725d07ff5b4e02afc860e4
refs/heads/master
2020-12-24T14:36:21.698156
2011-07-19T00:24:36
2011-07-19T00:24:36
524,658
108
15
null
2013-07-11T07:14:58
2010-02-18T17:43:10
Java
UTF-8
Java
false
false
376
java
/* * See LICENSE file in distribution for copyright and licensing information. */ package ioke.lang.test; /** * * @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a> */ public class SimpleVoidClass { private String data; public void doTheThing() { data = "done it"; } public String getData() { return data; } }// SimpleVoidClass
[ "ola.bini@gmail.com" ]
ola.bini@gmail.com
a585378e7a9be4967d031f16a4f015ec5d904ba2
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/google/android/exoplayer2/source/hls/HlsMediaPeriod.java
f6cf618ac069e53a0438193990e338c0cc675ddf
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
38,491
java
package com.google.android.exoplayer2.source.hls; import android.net.Uri; import android.text.TextUtils; import com.google.android.exoplayer2.C1996C; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.SeekParameters; import com.google.android.exoplayer2.drm.DrmInitData; import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.metadata.Metadata; import com.google.android.exoplayer2.offline.StreamKey; import com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory; import com.google.android.exoplayer2.source.MediaPeriod; import com.google.android.exoplayer2.source.MediaSourceEventListener.EventDispatcher; import com.google.android.exoplayer2.source.SampleStream; import com.google.android.exoplayer2.source.SequenceableLoader; import com.google.android.exoplayer2.source.TrackGroup; import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper.Callback; import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist; import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Rendition; import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Variant; import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistTracker; import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistTracker.PlaylistEventListener; import com.google.android.exoplayer2.trackselection.TrackSelection; import com.google.android.exoplayer2.upstream.Allocator; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy; import com.google.android.exoplayer2.upstream.TransferListener; import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.Util; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; public final class HlsMediaPeriod implements MediaPeriod, Callback, PlaylistEventListener { private final Allocator allocator; private final boolean allowChunklessPreparation; private MediaPeriod.Callback callback; private SequenceableLoader compositeSequenceableLoader; private final CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory; private final HlsDataSourceFactory dataSourceFactory; private final DrmSessionManager<?> drmSessionManager; private HlsSampleStreamWrapper[] enabledSampleStreamWrappers = new HlsSampleStreamWrapper[0]; private final EventDispatcher eventDispatcher; private final HlsExtractorFactory extractorFactory; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private int[][] manifestUrlIndicesPerWrapper = new int[0][]; private final TransferListener mediaTransferListener; private final int metadataType; private boolean notifiedReadingStarted; private int pendingPrepareCount; private final HlsPlaylistTracker playlistTracker; private HlsSampleStreamWrapper[] sampleStreamWrappers = new HlsSampleStreamWrapper[0]; private final IdentityHashMap<SampleStream, Integer> streamWrapperIndices = new IdentityHashMap<>(); private final TimestampAdjusterProvider timestampAdjusterProvider = new TimestampAdjusterProvider(); private TrackGroupArray trackGroups; private final boolean useSessionKeys; public long getAdjustedSeekPositionUs(long j, SeekParameters seekParameters) { return j; } public HlsMediaPeriod(HlsExtractorFactory hlsExtractorFactory, HlsPlaylistTracker hlsPlaylistTracker, HlsDataSourceFactory hlsDataSourceFactory, TransferListener transferListener, DrmSessionManager<?> drmSessionManager2, LoadErrorHandlingPolicy loadErrorHandlingPolicy2, EventDispatcher eventDispatcher2, Allocator allocator2, CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory2, boolean z, int i, boolean z2) { this.extractorFactory = hlsExtractorFactory; this.playlistTracker = hlsPlaylistTracker; this.dataSourceFactory = hlsDataSourceFactory; this.mediaTransferListener = transferListener; this.drmSessionManager = drmSessionManager2; this.loadErrorHandlingPolicy = loadErrorHandlingPolicy2; this.eventDispatcher = eventDispatcher2; this.allocator = allocator2; this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory2; this.allowChunklessPreparation = z; this.metadataType = i; this.useSessionKeys = z2; this.compositeSequenceableLoader = compositeSequenceableLoaderFactory2.createCompositeSequenceableLoader(new SequenceableLoader[0]); eventDispatcher2.mediaPeriodCreated(); } public void release() { this.playlistTracker.removeListener(this); for (HlsSampleStreamWrapper release : this.sampleStreamWrappers) { release.release(); } this.callback = null; this.eventDispatcher.mediaPeriodReleased(); } public void prepare(MediaPeriod.Callback callback2, long j) { this.callback = callback2; this.playlistTracker.addListener(this); buildAndPrepareSampleStreamWrappers(j); } public void maybeThrowPrepareError() throws IOException { for (HlsSampleStreamWrapper maybeThrowPrepareError : this.sampleStreamWrappers) { maybeThrowPrepareError.maybeThrowPrepareError(); } } public TrackGroupArray getTrackGroups() { return (TrackGroupArray) Assertions.checkNotNull(this.trackGroups); } public List<StreamKey> getStreamKeys(List<TrackSelection> list) { TrackGroupArray trackGroupArray; int[] iArr; int i; HlsMediaPeriod hlsMediaPeriod = this; HlsMasterPlaylist hlsMasterPlaylist = (HlsMasterPlaylist) Assertions.checkNotNull(hlsMediaPeriod.playlistTracker.getMasterPlaylist()); boolean z = !hlsMasterPlaylist.variants.isEmpty(); int length = hlsMediaPeriod.sampleStreamWrappers.length - hlsMasterPlaylist.subtitles.size(); int i2 = 0; if (z) { HlsSampleStreamWrapper hlsSampleStreamWrapper = hlsMediaPeriod.sampleStreamWrappers[0]; iArr = hlsMediaPeriod.manifestUrlIndicesPerWrapper[0]; trackGroupArray = hlsSampleStreamWrapper.getTrackGroups(); i = hlsSampleStreamWrapper.getPrimaryTrackGroupIndex(); } else { iArr = new int[0]; trackGroupArray = TrackGroupArray.EMPTY; i = 0; } ArrayList arrayList = new ArrayList(); boolean z2 = false; boolean z3 = false; for (TrackSelection trackSelection : list) { TrackGroup trackGroup = trackSelection.getTrackGroup(); int indexOf = trackGroupArray.indexOf(trackGroup); if (indexOf == -1) { int i3 = z; while (true) { HlsSampleStreamWrapper[] hlsSampleStreamWrapperArr = hlsMediaPeriod.sampleStreamWrappers; if (i3 >= hlsSampleStreamWrapperArr.length) { break; } else if (hlsSampleStreamWrapperArr[i3].getTrackGroups().indexOf(trackGroup) != -1) { int i4 = i3 < length ? 1 : 2; int[] iArr2 = hlsMediaPeriod.manifestUrlIndicesPerWrapper[i3]; int i5 = 0; while (i5 < trackSelection.length()) { arrayList.add(new StreamKey(i4, iArr2[trackSelection.getIndexInTrackGroup(i5)])); i5++; } } else { i3++; hlsMediaPeriod = this; } } } else if (indexOf == i) { for (int i6 = 0; i6 < trackSelection.length(); i6++) { arrayList.add(new StreamKey(i2, iArr[trackSelection.getIndexInTrackGroup(i6)])); } z3 = true; } else { z2 = true; } i2 = 0; hlsMediaPeriod = this; } if (z2 && !z3) { int i7 = iArr[0]; int i8 = ((Variant) hlsMasterPlaylist.variants.get(iArr[0])).format.bitrate; for (int i9 = 1; i9 < iArr.length; i9++) { int i10 = ((Variant) hlsMasterPlaylist.variants.get(iArr[i9])).format.bitrate; if (i10 < i8) { i7 = iArr[i9]; i8 = i10; } } arrayList.add(new StreamKey(0, i7)); } return arrayList; } /* JADX WARNING: Code restructure failed: missing block: B:51:0x00df, code lost: if (r5 != r8[0]) goto L_0x00e3; */ /* Code decompiled incorrectly, please refer to instructions dump. */ public long selectTracks(com.google.android.exoplayer2.trackselection.TrackSelection[] r21, boolean[] r22, com.google.android.exoplayer2.source.SampleStream[] r23, boolean[] r24, long r25) { /* r20 = this; r0 = r20 r1 = r21 r2 = r23 int r3 = r1.length int[] r3 = new int[r3] int r4 = r1.length int[] r4 = new int[r4] r6 = 0 L_0x000d: int r7 = r1.length if (r6 >= r7) goto L_0x004e r7 = r2[r6] r8 = -1 if (r7 != 0) goto L_0x0017 r7 = -1 goto L_0x0025 L_0x0017: java.util.IdentityHashMap<com.google.android.exoplayer2.source.SampleStream, java.lang.Integer> r7 = r0.streamWrapperIndices r9 = r2[r6] java.lang.Object r7 = r7.get(r9) java.lang.Integer r7 = (java.lang.Integer) r7 int r7 = r7.intValue() L_0x0025: r3[r6] = r7 r4[r6] = r8 r7 = r1[r6] if (r7 == 0) goto L_0x004b r7 = r1[r6] com.google.android.exoplayer2.source.TrackGroup r7 = r7.getTrackGroup() r9 = 0 L_0x0034: com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r10 = r0.sampleStreamWrappers int r11 = r10.length if (r9 >= r11) goto L_0x004b r10 = r10[r9] com.google.android.exoplayer2.source.TrackGroupArray r10 = r10.getTrackGroups() int r10 = r10.indexOf(r7) if (r10 == r8) goto L_0x0048 r4[r6] = r9 goto L_0x004b L_0x0048: int r9 = r9 + 1 goto L_0x0034 L_0x004b: int r6 = r6 + 1 goto L_0x000d L_0x004e: java.util.IdentityHashMap<com.google.android.exoplayer2.source.SampleStream, java.lang.Integer> r6 = r0.streamWrapperIndices r6.clear() int r6 = r1.length com.google.android.exoplayer2.source.SampleStream[] r6 = new com.google.android.exoplayer2.source.SampleStream[r6] int r7 = r1.length com.google.android.exoplayer2.source.SampleStream[] r7 = new com.google.android.exoplayer2.source.SampleStream[r7] int r8 = r1.length com.google.android.exoplayer2.trackselection.TrackSelection[] r15 = new com.google.android.exoplayer2.trackselection.TrackSelection[r8] com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r8 = r0.sampleStreamWrappers int r8 = r8.length com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r13 = new com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[r8] r12 = 0 r14 = 0 r16 = 0 L_0x0065: com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r8 = r0.sampleStreamWrappers int r8 = r8.length if (r14 >= r8) goto L_0x00ff r8 = 0 L_0x006b: int r9 = r1.length if (r8 >= r9) goto L_0x0084 r9 = r3[r8] r10 = 0 if (r9 != r14) goto L_0x0076 r9 = r2[r8] goto L_0x0077 L_0x0076: r9 = r10 L_0x0077: r7[r8] = r9 r9 = r4[r8] if (r9 != r14) goto L_0x007f r10 = r1[r8] L_0x007f: r15[r8] = r10 int r8 = r8 + 1 goto L_0x006b L_0x0084: com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r8 = r0.sampleStreamWrappers r11 = r8[r14] r8 = r11 r9 = r15 r10 = r22 r5 = r11 r11 = r7 r2 = r12 r12 = r24 r17 = r2 r18 = r13 r2 = r14 r13 = r25 r19 = r15 r15 = r16 boolean r8 = r8.selectTracks(r9, r10, r11, r12, r13, r15) r9 = 0 r10 = 0 L_0x00a2: int r11 = r1.length r12 = 1 if (r9 >= r11) goto L_0x00ca r11 = r7[r9] r13 = r4[r9] if (r13 != r2) goto L_0x00bc com.google.android.exoplayer2.util.Assertions.checkNotNull(r11) r6[r9] = r11 java.util.IdentityHashMap<com.google.android.exoplayer2.source.SampleStream, java.lang.Integer> r10 = r0.streamWrapperIndices java.lang.Integer r13 = java.lang.Integer.valueOf(r2) r10.put(r11, r13) r10 = 1 goto L_0x00c7 L_0x00bc: r13 = r3[r9] if (r13 != r2) goto L_0x00c7 if (r11 != 0) goto L_0x00c3 goto L_0x00c4 L_0x00c3: r12 = 0 L_0x00c4: com.google.android.exoplayer2.util.Assertions.checkState(r12) L_0x00c7: int r9 = r9 + 1 goto L_0x00a2 L_0x00ca: if (r10 == 0) goto L_0x00f2 r18[r17] = r5 int r9 = r17 + 1 if (r17 != 0) goto L_0x00ec r5.setIsTimestampMaster(r12) if (r8 != 0) goto L_0x00e2 com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r8 = r0.enabledSampleStreamWrappers int r10 = r8.length if (r10 == 0) goto L_0x00e2 r10 = 0 r8 = r8[r10] if (r5 == r8) goto L_0x00f0 goto L_0x00e3 L_0x00e2: r10 = 0 L_0x00e3: com.google.android.exoplayer2.source.hls.TimestampAdjusterProvider r5 = r0.timestampAdjusterProvider r5.reset() r12 = r9 r16 = 1 goto L_0x00f5 L_0x00ec: r10 = 0 r5.setIsTimestampMaster(r10) L_0x00f0: r12 = r9 goto L_0x00f5 L_0x00f2: r10 = 0 r12 = r17 L_0x00f5: int r14 = r2 + 1 r2 = r23 r13 = r18 r15 = r19 goto L_0x0065 L_0x00ff: r17 = r12 r18 = r13 r10 = 0 int r1 = r6.length r2 = r23 java.lang.System.arraycopy(r6, r10, r2, r10, r1) r1 = r18 java.lang.Object[] r1 = com.google.android.exoplayer2.util.Util.nullSafeArrayCopy(r1, r12) com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r1 = (com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[]) r1 r0.enabledSampleStreamWrappers = r1 com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory r1 = r0.compositeSequenceableLoaderFactory com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper[] r2 = r0.enabledSampleStreamWrappers com.google.android.exoplayer2.source.SequenceableLoader r1 = r1.createCompositeSequenceableLoader(r2) r0.compositeSequenceableLoader = r1 return r25 */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer2.source.hls.HlsMediaPeriod.selectTracks(com.google.android.exoplayer2.trackselection.TrackSelection[], boolean[], com.google.android.exoplayer2.source.SampleStream[], boolean[], long):long"); } public void discardBuffer(long j, boolean z) { for (HlsSampleStreamWrapper discardBuffer : this.enabledSampleStreamWrappers) { discardBuffer.discardBuffer(j, z); } } public void reevaluateBuffer(long j) { this.compositeSequenceableLoader.reevaluateBuffer(j); } public boolean continueLoading(long j) { if (this.trackGroups != null) { return this.compositeSequenceableLoader.continueLoading(j); } for (HlsSampleStreamWrapper continuePreparing : this.sampleStreamWrappers) { continuePreparing.continuePreparing(); } return false; } public boolean isLoading() { return this.compositeSequenceableLoader.isLoading(); } public long getNextLoadPositionUs() { return this.compositeSequenceableLoader.getNextLoadPositionUs(); } public long readDiscontinuity() { if (!this.notifiedReadingStarted) { this.eventDispatcher.readingStarted(); this.notifiedReadingStarted = true; } return C1996C.TIME_UNSET; } public long getBufferedPositionUs() { return this.compositeSequenceableLoader.getBufferedPositionUs(); } public long seekToUs(long j) { HlsSampleStreamWrapper[] hlsSampleStreamWrapperArr = this.enabledSampleStreamWrappers; if (hlsSampleStreamWrapperArr.length > 0) { boolean seekToUs = hlsSampleStreamWrapperArr[0].seekToUs(j, false); int i = 1; while (true) { HlsSampleStreamWrapper[] hlsSampleStreamWrapperArr2 = this.enabledSampleStreamWrappers; if (i >= hlsSampleStreamWrapperArr2.length) { break; } hlsSampleStreamWrapperArr2[i].seekToUs(j, seekToUs); i++; } if (seekToUs) { this.timestampAdjusterProvider.reset(); } } return j; } public void onPrepared() { int i = this.pendingPrepareCount - 1; this.pendingPrepareCount = i; if (i <= 0) { int i2 = 0; for (HlsSampleStreamWrapper trackGroups2 : this.sampleStreamWrappers) { i2 += trackGroups2.getTrackGroups().length; } TrackGroup[] trackGroupArr = new TrackGroup[i2]; HlsSampleStreamWrapper[] hlsSampleStreamWrapperArr = this.sampleStreamWrappers; int length = hlsSampleStreamWrapperArr.length; int i3 = 0; int i4 = 0; while (i3 < length) { HlsSampleStreamWrapper hlsSampleStreamWrapper = hlsSampleStreamWrapperArr[i3]; int i5 = hlsSampleStreamWrapper.getTrackGroups().length; int i6 = i4; int i7 = 0; while (i7 < i5) { int i8 = i6 + 1; trackGroupArr[i6] = hlsSampleStreamWrapper.getTrackGroups().get(i7); i7++; i6 = i8; } i3++; i4 = i6; } this.trackGroups = new TrackGroupArray(trackGroupArr); this.callback.onPrepared(this); } } public void onPlaylistRefreshRequired(Uri uri) { this.playlistTracker.refreshPlaylist(uri); } public void onContinueLoadingRequested(HlsSampleStreamWrapper hlsSampleStreamWrapper) { this.callback.onContinueLoadingRequested(this); } public void onPlaylistChanged() { this.callback.onContinueLoadingRequested(this); } public boolean onPlaylistError(Uri uri, long j) { boolean z = true; for (HlsSampleStreamWrapper onPlaylistError : this.sampleStreamWrappers) { z &= onPlaylistError.onPlaylistError(uri, j); } this.callback.onContinueLoadingRequested(this); return z; } private void buildAndPrepareSampleStreamWrappers(long j) { Map map; HlsMasterPlaylist hlsMasterPlaylist = (HlsMasterPlaylist) Assertions.checkNotNull(this.playlistTracker.getMasterPlaylist()); if (this.useSessionKeys) { map = deriveOverridingDrmInitData(hlsMasterPlaylist.sessionKeyDrmInitData); } else { map = Collections.emptyMap(); } Map map2 = map; boolean z = !hlsMasterPlaylist.variants.isEmpty(); List<Rendition> list = hlsMasterPlaylist.audios; List<Rendition> list2 = hlsMasterPlaylist.subtitles; this.pendingPrepareCount = 0; ArrayList arrayList = new ArrayList(); ArrayList arrayList2 = new ArrayList(); if (z) { buildAndPrepareMainSampleStreamWrapper(hlsMasterPlaylist, j, arrayList, arrayList2, map2); } buildAndPrepareAudioSampleStreamWrappers(j, list, arrayList, arrayList2, map2); int i = 0; while (i < list2.size()) { Rendition rendition = (Rendition) list2.get(i); int i2 = i; Rendition rendition2 = rendition; HlsSampleStreamWrapper buildSampleStreamWrapper = buildSampleStreamWrapper(3, new Uri[]{rendition.url}, new Format[]{rendition.format}, null, Collections.emptyList(), map2, j); arrayList2.add(new int[]{i2}); arrayList.add(buildSampleStreamWrapper); buildSampleStreamWrapper.prepareWithMasterPlaylistInfo(new TrackGroup[]{new TrackGroup(rendition2.format)}, 0, new int[0]); i = i2 + 1; } this.sampleStreamWrappers = (HlsSampleStreamWrapper[]) arrayList.toArray(new HlsSampleStreamWrapper[0]); this.manifestUrlIndicesPerWrapper = (int[][]) arrayList2.toArray(new int[0][]); HlsSampleStreamWrapper[] hlsSampleStreamWrapperArr = this.sampleStreamWrappers; this.pendingPrepareCount = hlsSampleStreamWrapperArr.length; hlsSampleStreamWrapperArr[0].setIsTimestampMaster(true); for (HlsSampleStreamWrapper continuePreparing : this.sampleStreamWrappers) { continuePreparing.continuePreparing(); } this.enabledSampleStreamWrappers = this.sampleStreamWrappers; } /* JADX WARNING: Removed duplicated region for block: B:24:0x0068 A[ADDED_TO_REGION] */ /* Code decompiled incorrectly, please refer to instructions dump. */ private void buildAndPrepareMainSampleStreamWrapper(com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist r20, long r21, java.util.List<com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper> r23, java.util.List<int[]> r24, java.util.Map<java.lang.String, com.google.android.exoplayer2.drm.DrmInitData> r25) { /* r19 = this; r0 = r20 java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant> r1 = r0.variants int r1 = r1.size() int[] r1 = new int[r1] r2 = 0 r3 = 0 r4 = 0 r5 = 0 L_0x000e: java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant> r6 = r0.variants int r6 = r6.size() r7 = -1 r8 = 2 r9 = 1 if (r3 >= r6) goto L_0x0047 java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant> r6 = r0.variants java.lang.Object r6 = r6.get(r3) com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant r6 = (com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Variant) r6 com.google.android.exoplayer2.Format r6 = r6.format int r10 = r6.height if (r10 > 0) goto L_0x0040 java.lang.String r10 = r6.codecs java.lang.String r10 = com.google.android.exoplayer2.util.Util.getCodecsOfType(r10, r8) if (r10 == 0) goto L_0x0030 goto L_0x0040 L_0x0030: java.lang.String r6 = r6.codecs java.lang.String r6 = com.google.android.exoplayer2.util.Util.getCodecsOfType(r6, r9) if (r6 == 0) goto L_0x003d r1[r3] = r9 int r5 = r5 + 1 goto L_0x0044 L_0x003d: r1[r3] = r7 goto L_0x0044 L_0x0040: r1[r3] = r8 int r4 = r4 + 1 L_0x0044: int r3 = r3 + 1 goto L_0x000e L_0x0047: int r3 = r1.length if (r4 <= 0) goto L_0x004c r3 = 1 goto L_0x0057 L_0x004c: int r4 = r1.length if (r5 >= r4) goto L_0x0055 int r3 = r1.length int r4 = r3 - r5 r3 = 0 r5 = 1 goto L_0x0058 L_0x0055: r4 = r3 r3 = 0 L_0x0057: r5 = 0 L_0x0058: android.net.Uri[] r12 = new android.net.Uri[r4] com.google.android.exoplayer2.Format[] r6 = new com.google.android.exoplayer2.Format[r4] int[] r15 = new int[r4] r10 = 0 r11 = 0 L_0x0060: java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant> r13 = r0.variants int r13 = r13.size() if (r10 >= r13) goto L_0x008c if (r3 == 0) goto L_0x006e r13 = r1[r10] if (r13 != r8) goto L_0x0089 L_0x006e: if (r5 == 0) goto L_0x0074 r13 = r1[r10] if (r13 == r9) goto L_0x0089 L_0x0074: java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant> r13 = r0.variants java.lang.Object r13 = r13.get(r10) com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Variant r13 = (com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Variant) r13 android.net.Uri r14 = r13.url r12[r11] = r14 com.google.android.exoplayer2.Format r13 = r13.format r6[r11] = r13 int r13 = r11 + 1 r15[r11] = r10 r11 = r13 L_0x0089: int r10 = r10 + 1 goto L_0x0060 L_0x008c: r1 = r6[r2] java.lang.String r1 = r1.codecs r11 = 0 com.google.android.exoplayer2.Format r14 = r0.muxedAudioFormat java.util.List<com.google.android.exoplayer2.Format> r3 = r0.muxedCaptionFormats r10 = r19 r13 = r6 r5 = r15 r15 = r3 r16 = r25 r17 = r21 com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper r3 = r10.buildSampleStreamWrapper(r11, r12, r13, r14, r15, r16, r17) r10 = r23 r10.add(r3) r10 = r24 r10.add(r5) r5 = r19 boolean r10 = r5.allowChunklessPreparation if (r10 == 0) goto L_0x0185 if (r1 == 0) goto L_0x0185 java.lang.String r8 = com.google.android.exoplayer2.util.Util.getCodecsOfType(r1, r8) if (r8 == 0) goto L_0x00bc r8 = 1 goto L_0x00bd L_0x00bc: r8 = 0 L_0x00bd: java.lang.String r10 = com.google.android.exoplayer2.util.Util.getCodecsOfType(r1, r9) if (r10 == 0) goto L_0x00c5 r10 = 1 goto L_0x00c6 L_0x00c5: r10 = 0 L_0x00c6: java.util.ArrayList r11 = new java.util.ArrayList r11.<init>() if (r8 == 0) goto L_0x0128 com.google.android.exoplayer2.Format[] r1 = new com.google.android.exoplayer2.Format[r4] r4 = 0 L_0x00d0: int r8 = r1.length if (r4 >= r8) goto L_0x00de r8 = r6[r4] com.google.android.exoplayer2.Format r8 = deriveVideoFormat(r8) r1[r4] = r8 int r4 = r4 + 1 goto L_0x00d0 L_0x00de: com.google.android.exoplayer2.source.TrackGroup r4 = new com.google.android.exoplayer2.source.TrackGroup r4.<init>(r1) r11.add(r4) if (r10 == 0) goto L_0x0108 com.google.android.exoplayer2.Format r1 = r0.muxedAudioFormat if (r1 != 0) goto L_0x00f4 java.util.List<com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist$Rendition> r1 = r0.audios boolean r1 = r1.isEmpty() if (r1 == 0) goto L_0x0108 L_0x00f4: com.google.android.exoplayer2.source.TrackGroup r1 = new com.google.android.exoplayer2.source.TrackGroup com.google.android.exoplayer2.Format[] r4 = new com.google.android.exoplayer2.Format[r9] r6 = r6[r2] com.google.android.exoplayer2.Format r8 = r0.muxedAudioFormat com.google.android.exoplayer2.Format r6 = deriveAudioFormat(r6, r8, r2) r4[r2] = r6 r1.<init>(r4) r11.add(r1) L_0x0108: java.util.List<com.google.android.exoplayer2.Format> r0 = r0.muxedCaptionFormats if (r0 == 0) goto L_0x0145 r1 = 0 L_0x010d: int r4 = r0.size() if (r1 >= r4) goto L_0x0145 com.google.android.exoplayer2.source.TrackGroup r4 = new com.google.android.exoplayer2.source.TrackGroup com.google.android.exoplayer2.Format[] r6 = new com.google.android.exoplayer2.Format[r9] java.lang.Object r8 = r0.get(r1) com.google.android.exoplayer2.Format r8 = (com.google.android.exoplayer2.Format) r8 r6[r2] = r8 r4.<init>(r6) r11.add(r4) int r1 = r1 + 1 goto L_0x010d L_0x0128: if (r10 == 0) goto L_0x016e com.google.android.exoplayer2.Format[] r1 = new com.google.android.exoplayer2.Format[r4] r4 = 0 L_0x012d: int r8 = r1.length if (r4 >= r8) goto L_0x013d r8 = r6[r4] com.google.android.exoplayer2.Format r10 = r0.muxedAudioFormat com.google.android.exoplayer2.Format r8 = deriveAudioFormat(r8, r10, r9) r1[r4] = r8 int r4 = r4 + 1 goto L_0x012d L_0x013d: com.google.android.exoplayer2.source.TrackGroup r0 = new com.google.android.exoplayer2.source.TrackGroup r0.<init>(r1) r11.add(r0) L_0x0145: com.google.android.exoplayer2.source.TrackGroup r0 = new com.google.android.exoplayer2.source.TrackGroup com.google.android.exoplayer2.Format[] r1 = new com.google.android.exoplayer2.Format[r9] r4 = 0 java.lang.String r6 = "ID3" java.lang.String r8 = "application/id3" com.google.android.exoplayer2.Format r4 = com.google.android.exoplayer2.Format.createSampleFormat(r6, r8, r4, r7, r4) r1[r2] = r4 r0.<init>(r1) r11.add(r0) com.google.android.exoplayer2.source.TrackGroup[] r1 = new com.google.android.exoplayer2.source.TrackGroup[r2] java.lang.Object[] r1 = r11.toArray(r1) com.google.android.exoplayer2.source.TrackGroup[] r1 = (com.google.android.exoplayer2.source.TrackGroup[]) r1 int[] r4 = new int[r9] int r0 = r11.indexOf(r0) r4[r2] = r0 r3.prepareWithMasterPlaylistInfo(r1, r2, r4) goto L_0x0185 L_0x016e: java.lang.IllegalArgumentException r0 = new java.lang.IllegalArgumentException java.lang.StringBuilder r2 = new java.lang.StringBuilder r2.<init>() java.lang.String r3 = "Unexpected codecs attribute: " r2.append(r3) r2.append(r1) java.lang.String r1 = r2.toString() r0.<init>(r1) throw r0 L_0x0185: return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer2.source.hls.HlsMediaPeriod.buildAndPrepareMainSampleStreamWrapper(com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist, long, java.util.List, java.util.List, java.util.Map):void"); } private void buildAndPrepareAudioSampleStreamWrappers(long j, List<Rendition> list, List<HlsSampleStreamWrapper> list2, List<int[]> list3, Map<String, DrmInitData> map) { List<Rendition> list4 = list; ArrayList arrayList = new ArrayList(list.size()); ArrayList arrayList2 = new ArrayList(list.size()); ArrayList arrayList3 = new ArrayList(list.size()); HashSet hashSet = new HashSet(); for (int i = 0; i < list.size(); i++) { String str = ((Rendition) list4.get(i)).name; if (!hashSet.add(str)) { List<HlsSampleStreamWrapper> list5 = list2; List<int[]> list6 = list3; } else { arrayList.clear(); arrayList2.clear(); arrayList3.clear(); boolean z = true; for (int i2 = 0; i2 < list.size(); i2++) { if (Util.areEqual(str, ((Rendition) list4.get(i2)).name)) { Rendition rendition = (Rendition) list4.get(i2); arrayList3.add(Integer.valueOf(i2)); arrayList.add(rendition.url); arrayList2.add(rendition.format); z &= rendition.format.codecs != null; } } HlsSampleStreamWrapper buildSampleStreamWrapper = buildSampleStreamWrapper(1, (Uri[]) arrayList.toArray(Util.castNonNullTypeArray(new Uri[0])), (Format[]) arrayList2.toArray(new Format[0]), null, Collections.emptyList(), map, j); list3.add(Util.toArray(arrayList3)); list2.add(buildSampleStreamWrapper); if (this.allowChunklessPreparation && z) { buildSampleStreamWrapper.prepareWithMasterPlaylistInfo(new TrackGroup[]{new TrackGroup((Format[]) arrayList2.toArray(new Format[0]))}, 0, new int[0]); } } } } private HlsSampleStreamWrapper buildSampleStreamWrapper(int i, Uri[] uriArr, Format[] formatArr, Format format, List<Format> list, Map<String, DrmInitData> map, long j) { HlsChunkSource hlsChunkSource = new HlsChunkSource(this.extractorFactory, this.playlistTracker, uriArr, formatArr, this.dataSourceFactory, this.mediaTransferListener, this.timestampAdjusterProvider, list); HlsSampleStreamWrapper hlsSampleStreamWrapper = new HlsSampleStreamWrapper(i, this, hlsChunkSource, map, this.allocator, j, format, this.drmSessionManager, this.loadErrorHandlingPolicy, this.eventDispatcher, this.metadataType); return hlsSampleStreamWrapper; } private static Map<String, DrmInitData> deriveOverridingDrmInitData(List<DrmInitData> list) { ArrayList arrayList = new ArrayList(list); HashMap hashMap = new HashMap(); int i = 0; while (i < arrayList.size()) { DrmInitData drmInitData = (DrmInitData) list.get(i); String str = drmInitData.schemeType; i++; DrmInitData drmInitData2 = drmInitData; int i2 = i; while (i2 < arrayList.size()) { DrmInitData drmInitData3 = (DrmInitData) arrayList.get(i2); if (TextUtils.equals(drmInitData3.schemeType, str)) { drmInitData2 = drmInitData2.merge(drmInitData3); arrayList.remove(i2); } else { i2++; } } hashMap.put(str, drmInitData2); } return hashMap; } private static Format deriveVideoFormat(Format format) { String codecsOfType = Util.getCodecsOfType(format.codecs, 2); return Format.createVideoContainerFormat(format.f1474id, format.label, format.containerMimeType, MimeTypes.getMediaMimeType(codecsOfType), codecsOfType, format.metadata, format.bitrate, format.width, format.height, format.frameRate, null, format.selectionFlags, format.roleFlags); } private static Format deriveAudioFormat(Format format, Format format2, boolean z) { String str; int i; int i2; int i3; Metadata metadata; String str2; String str3; Format format3 = format; Format format4 = format2; if (format4 != null) { String str4 = format4.codecs; Metadata metadata2 = format4.metadata; int i4 = format4.channelCount; int i5 = format4.selectionFlags; int i6 = format4.roleFlags; String str5 = format4.language; str3 = format4.label; str2 = str4; metadata = metadata2; i3 = i4; i2 = i5; i = i6; str = str5; } else { String codecsOfType = Util.getCodecsOfType(format3.codecs, 1); Metadata metadata3 = format3.metadata; if (z) { int i7 = format3.channelCount; int i8 = format3.selectionFlags; str2 = codecsOfType; i3 = i7; i2 = i8; metadata = metadata3; i = format3.roleFlags; str = format3.language; str3 = format3.label; } else { str2 = codecsOfType; str3 = null; str = null; metadata = metadata3; i3 = -1; i2 = 0; i = 0; } } return Format.createAudioContainerFormat(format3.f1474id, str3, format3.containerMimeType, MimeTypes.getMediaMimeType(str2), str2, metadata, z ? format3.bitrate : -1, i3, -1, null, i2, i, str); } }
[ "knag88@gmail.com" ]
knag88@gmail.com