blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
a29276f363242132dbbd9cd705026c775bc86dd8
5528eca954cb68b0a48d712b43ff9ffe35627006
/app/src/main/java/com/safaricom/movie/repository/TypeDao.java
2cd21ae38eeaef38d08523a30906054b6c1d62c8
[]
no_license
davis-mwangi/movies-docker-mysql-microservice
bef88c01ff690f17091650a6065ed62a1dc44d29
57e984223b3070180db7ad70359cd5931030ef6e
refs/heads/master
2020-05-25T02:54:49.733216
2019-05-23T09:13:34
2019-05-23T09:13:34
187,589,740
0
0
null
null
null
null
UTF-8
Java
false
false
429
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 com.safaricom.movie.repository; import com.safaricom.movie.entities.Type; import org.springframework.data.jpa.repository.JpaRepository; /** * * @author david */ public interface TypeDao extends JpaRepository<Type ,Integer>{ }
[ "daudimwash@gmail.com" ]
daudimwash@gmail.com
c650f2de8e5ee0c150c459a853fb61b7022edc49
663236eaa6b368aa9835489efb5ec599db92f64f
/ks-loader/src/main/java/org/kuali/student/loader/organization/OrgOrgRelationInputModelExcelImpl.java
b207e58b27cb7f4aeef98b8c8dcb560f6eb5d91d
[]
no_license
mocleiri/myuni-ks-loader
7d470c6dd62cb5dc1c5250600702c478281f6feb
e33ac01b1a4d2a8e47c58ed226f1ac783f8eae2e
refs/heads/master
2021-01-18T05:44:27.361657
2013-11-09T21:38:03
2013-11-09T21:38:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,330
java
/* * Copyright 2010 The Kuali Foundation * * Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.kuali.student.loader.organization; import java.util.ArrayList; import java.util.List; import org.kuali.student.loader.util.ExcelLoaderHelper; import org.kuali.student.spreadsheet.SpreadsheetReader; import org.kuali.student.spreadsheet.WorksheetNotFoundException; import org.kuali.student.spreadsheet.WorksheetReader; /** * * @author nwright */ public class OrgOrgRelationInputModelExcelImpl implements OrgOrgRelationInputModel { private SpreadsheetReader reader; public OrgOrgRelationInputModelExcelImpl (SpreadsheetReader reader) { this.reader = reader; } @Override public List<OrgOrgRelation> getOrgOrgRelations () { WorksheetReader worksheetReader; try { worksheetReader = reader.getWorksheetReader ("OrgOrgRelations"); } catch (WorksheetNotFoundException ex) { throw new IllegalArgumentException (ex); } ExcelLoaderHelper helper = new ExcelLoaderHelper (worksheetReader); helper.setMaxStringSize (500); List<OrgOrgRelation> list = new ArrayList (worksheetReader.getEstimatedRows ()); int row = 0; while (worksheetReader.next ()) { OrgOrgRelation orgRelation = new OrgOrgRelation (); orgRelation.setOrgId(helper.getFixup ("orgId")); if (orgRelation.getOrgId () == null) { continue; } list.add (orgRelation); row ++; orgRelation.setRelatedOrgId(helper.getFixup ("relatedOrgId")); orgRelation.setType (helper.getFixup ("type")); orgRelation.setState (helper.getFixup ("state")); orgRelation.setEffectiveDate (helper.getFixupDate ("effectiveDate")); orgRelation.setOrgShortName(helper.getFixup ("orgShortName")); orgRelation.setRelatedOrgShortName(helper.getFixup ("relatedOrgShortName")); } return list; } }
[ "cmann50@me.com" ]
cmann50@me.com
456f2e70e5d99f40e18bcf46246491c6cc15097e
b316aa2879044407bde95e458dc34a5c1a81283f
/src/main/java/uk/gov/ons/fwmt/cache/data/ActionInstructionType.java
23ca1e7f698d05746b012452141381a11cce6d2e
[]
no_license
ONSdigital/ons-fwmt-cache-service
4b022fee22beb543b7c56141472b901959f58bf9
4474ec920387a9aa257d07d2923f83a374b7d095
refs/heads/master
2023-05-06T08:23:50.884649
2021-06-02T10:26:24
2021-06-02T10:26:24
373,123,963
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package uk.gov.ons.fwmt.cache.data; public enum ActionInstructionType { CANCEL("Cancel"), CREATE("Create"), UPDATE("Update"); public final String name; ActionInstructionType(String name) { this.name = name; } @Override public String toString() { return name; } }
[ "steve.scorfield@ons.gov.uk" ]
steve.scorfield@ons.gov.uk
d7bab9f6a468fd7d11f4637ebee52146adf6253b
89458ed6dc838801e769b6e2bb6e3ef5c888afd2
/src/main/java/com/bwtc/concurrent/Callable/CallableImpl.java
d4086a7b886f4a4850c3ca9531d0700ac486120a
[]
no_license
wangrui00/LearnSpringBoot
bb590641e937bd311da104141e7717fe0921289d
c496ebe1cb50f50dfb0f2c7e262e3686b133eb7f
refs/heads/master
2020-03-18T16:13:27.387587
2018-06-27T03:20:33
2018-06-27T03:20:33
134,953,985
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package com.bwtc.concurrent.Callable; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; /** * @Author wangrui * @Description: * @Date:Created in 20:18 2018/5/30 **/ public class CallableImpl implements Callable<String>{ private String acceptStr; public CallableImpl(String acceptStr){ this.acceptStr=acceptStr; } @Override public String call() throws Exception{ //任务阻塞1秒 Thread.sleep(1000); return this.acceptStr+" append some chars and return it!"; } public static void main(String[] args)throws ExecutionException,InterruptedException{ Callable<String> callable=new CallableImpl("my callable test!"); FutureTask<String> task=new FutureTask<String>(callable); long beginTime=System.currentTimeMillis(); //创建线程 new Thread(task).start(); //调用get()阻塞主线程,反之,线程不会阻塞 String result=task.get(); long endTime=System.currentTimeMillis(); System.out.println("hello : "+result); System.out.println("cast : "+(endTime-beginTime)/1000+" second!"); } }
[ "rui.wang@wisefinger.cn" ]
rui.wang@wisefinger.cn
9e63cd207612ad9c0cf48b4b1a10d2c692f1b277
dd2523c86c7a0f81f90b5c049d1f129821b19fee
/code/src/test/java/com/karlmarxindustries/herospotter/dao/PowerRepositoryTest.java
e1793fa25a9f94a9adfa421c2014f3e5c899c297
[]
no_license
karlmarx/HeroSpotter
b3fb9ffe660bcefaf60d23d9cd548d8b7456ea05
8b617e6bd5cb24eca262dfed0fd4b68f97244def
refs/heads/master
2021-06-21T03:39:35.458502
2019-10-29T16:32:07
2019-10-29T16:32:07
214,042,675
1
0
null
2021-05-12T00:29:15
2019-10-09T23:21:27
JavaScript
UTF-8
Java
false
false
6,636
java
package com.karlmarxindustries.herospotter.dao; import com.karlmarxindustries.herospotter.dto.Power; import com.karlmarxindustries.herospotter.dto.Super; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @ExtendWith(SpringExtension.class) @DataJpaTest class PowerRepositoryTest { @Autowired private PowerRepository powers; @Autowired private SuperRepository supers; @Test void testFindBySuperMembers() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", true); Power power2 = new Power("Proletarian Internationalism", "Offal selvage messenger bag", false); Power power3 = new Power("underfunding AIDS", "lexitarian readymade DIY tofu tattooed locavore forage. Polaroid meditation kogi umami trust fun", false); powers.save(power); powers.save(power2); powers.save(power3); Super super_ = new Super("jon", "jerkface", false); Super super_2 = new Super("ronald reagan", "jerk", true); super_2.setPowers(new ArrayList<Power>(Arrays.asList(power,power3))); super_.setPowers(new ArrayList<Power>(Arrays.asList(power2))); Super super_3 = new Super("trotsky", "good guy", false); supers.save(super_); supers.save(super_2); supers.save(super_3); List<Power> shouldBePowerAndPower3 = powers.findBySuperMembers(super_2); List<Power> shouldBePower2 = powers.findBySuperMembers(super_); List<Power> shouldBeEmpty = powers.findBySuperMembers(super_3); Assertions.assertEquals(2, shouldBePowerAndPower3.size()); Assertions.assertEquals(1, shouldBePower2.size()); Assertions.assertEquals(0, shouldBeEmpty.size()); Assertions.assertTrue(shouldBePowerAndPower3.contains(power) && shouldBePowerAndPower3.contains(power3)); Assertions.assertTrue(shouldBePower2.contains(power2)); } @BeforeEach public void setUp() { powers.deleteAll(); } @Test public void testSaveOneGetAll() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", true); powers.save(power); List<Power> shouldHaveOne = powers.findAll(); Assertions.assertEquals(1, shouldHaveOne.size()); } @Test public void testSaveManyGetAll() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", true); Power power2 = new Power("Proletarian Internationalism", "Offal selvage messenger bag", false); Power power3 = new Power("underfunding AIDS", "lexitarian readymade DIY tofu tattooed locavore forage. Polaroid meditation kogi umami trust fun", false); powers.save(power); powers.save(power2); powers.save(power3); List<Power> shouldHaveThree = powers.findAll(); Assertions.assertEquals(3, shouldHaveThree.size()); } @Test public void testFindByID() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", false); Power power2 = new Power("Proletarian Internationalism", "Offal selvage messenger bag, activated charcoal PBR&B tattooed freegan hoodie mixtape seitanr prism pitchfork four dollar toast church-key tumeri", false); Power power3 = new Power("underfunding AIDS", "lexitarian readymade DIY tofu tattooed locavore forage. Polaroid meditation kogi umami trust fun", false); power = powers.save(power); power2 = powers.save(power2); power3 = powers.save(power3); Power shouldBePower = powers.findById(power.getId()).orElse(null); Power shouldBePower2 = powers.findById(power2.getId()).orElse(null); Power shouldBePower3 = powers.findById(power3.getId()).orElse(null); Assertions.assertEquals(power, shouldBePower); Assertions.assertEquals(power2, shouldBePower2); Assertions.assertEquals(power3, shouldBePower3); } @Test public void testSavedUpdatesObject() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", false); power = powers.save(power); Power shouldBe1 = powers.findById(power.getId()).orElse(null); Assertions.assertEquals(power, shouldBe1); shouldBe1.setName("blech"); powers.save(shouldBe1); Power shouldBe1Modified = powers.findById(power.getId()).orElse(null); long objectCount = powers.count(); Assertions.assertEquals(shouldBe1Modified, shouldBe1); Assertions.assertEquals(1, objectCount); } @Test public void testDelete() { Power power = new Power("Cultural Revolution", "Lorem ipsum dolor amet lumbersexual thundercats mlkshk umami cray fashion axe asymmetrical", false); Power power2 = new Power("Proletarian Internationalism", "Offal selvage messenger bag, activated charcoal PBR&B tattooed freegan hoodie mixtape seitanr prism pitchfork four dollar toast church-key tumeri", false); Power power3 = new Power("underfunding AIDS", "lexitarian readymade DIY tofu tattooed locavore forage. Polaroid meditation kogi umami trust fun", false); power = powers.save(power); power2 = powers.save(power2); power3 = powers.save(power3); long shouldBe3 = powers.count(); powers.delete(power); powers.delete(power2); powers.delete(power3); long shouldBe0 = powers.count(); Assertions.assertEquals(0, shouldBe0); Assertions.assertEquals(3, shouldBe3); Power powerNew = new Power("Monkey Handling", "lkshk quinoa raw denim. Fingerstache gastropub fanny pack, chia trust fund wolf 8-bit ethical keffiyeh dreamcatcher hella helvetica vinyl enamel pin quinoa. Etsy vape mess", true); powerNew = powers.save(powerNew); powers.deleteById(powerNew.getId()); long shouldBe0Again = powers.count(); Assertions.assertEquals(0, shouldBe0Again); } }
[ "5042021062karlmarx@gmail.com" ]
5042021062karlmarx@gmail.com
42fe80b13fbfc74715c81f3273583fc319eebe53
3001b957ef27a70abe70b4178be7ec066c2a8060
/3.VIP课程/09.netty/课件/netty-example/src/main/java/com/kkb/demo/netty/example/simple/NettyServer.java
50f4dbba76ca5560d48ebe0d1f9eb25bfa253686
[]
no_license
1906522096/kaikeba
c7e87b70d7c87f141122470828d1d3d21eb8c6a1
798161b51a272883f1290d310991a9a656f64854
refs/heads/master
2023-06-08T05:04:12.841837
2021-07-02T07:38:05
2021-07-02T07:38:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,374
java
package com.kkb.demo.netty.example.simple; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; public class NettyServer { public static void main(String[] args) { //创建BossGroup 和 WorkerGroup //说明 //1. 创建两个线程组 bossGroup 和 workerGroup //2. bossGroup 只是处理连接请求 , 真正的和客户端业务处理,会交给 workerGroup完成 //3. 两个都是无限循环 //4. bossGroup 和 workerGroup 含有的子线程(NioEventLoop)的个数 // 默认实际 cpu核数 * 2 EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); //8 try { //创建服务器端的启动对象,配置参数 ServerBootstrap bootstrap = new ServerBootstrap(); //使用链式编程来进行设置 bootstrap.group(bossGroup, workerGroup) //设置两个线程组 .channel(NioServerSocketChannel.class) //使用NioSocketChannel 作为服务器的通道实现 .option(ChannelOption.SO_BACKLOG, 128) // 设置线程队列得到连接个数 .childOption(ChannelOption.SO_KEEPALIVE, true) //设置保持活动连接状态 // .handler(null) // 该 handler对应 bossGroup , childHandler 对应 workerGroup .childHandler(new ChannelInitializer<SocketChannel>() {//创建一个通道初始化对象(匿名对象) //给pipeline 设置处理器 @Override protected void initChannel(SocketChannel ch) throws Exception { System.out.println("客户socketchannel hashcode=" + ch.hashCode()); //可以使用一个集合管理 SocketChannel, 再推送消息时,可以将业务加入到各个channel 对应的 NIOEventLoop 的 taskQueue 或者 scheduleTaskQueue ch.pipeline().addLast(new NettyServerHandler()); } }); // 给我们的workerGroup 的 EventLoop 对应的管道设置处理器 System.out.println(".....服务器 is ready..."); //绑定一个端口并且同步, 生成了一个 ChannelFuture 对象 //启动服务器(并绑定端口) ChannelFuture cf = bootstrap.bind(6668).sync(); //给cf 注册监听器,监控我们关心的事件 cf.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (cf.isSuccess()) { System.out.println("监听端口 6668 成功"); } else { System.out.println("监听端口 6668 失败"); } } }); //对关闭通道进行监听 cf.channel().closeFuture().sync(); } catch (InterruptedException e) { e.printStackTrace(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } }
[ "shuyan434224591@gmail.com" ]
shuyan434224591@gmail.com
c2bf78dc612c106a480ac16a24a7f63835fb928d
0cdab0464b878574b8cd78ab53c898304892a3ac
/src/main/java/org/apache/ibatis/type/ArrayTypeHandler.java
8183906488f306e084f14297ea1232a492b37f04
[ "Apache-2.0" ]
permissive
yeecode/MyBatisCN
e600f660b0975c6d58996cd5e578d615dffe0d1f
489e130b318d4e46f0b2e70a5ed71b25914bda20
refs/heads/master
2023-08-17T02:58:42.922095
2022-01-18T13:26:05
2022-01-18T13:26:05
218,516,578
366
287
Apache-2.0
2023-07-22T20:12:22
2019-10-30T11:55:10
Java
UTF-8
Java
false
false
4,977
java
/** * Copyright 2009-2019 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.apache.ibatis.type; import java.math.BigDecimal; import java.math.BigInteger; import java.net.URL; import java.sql.Array; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.OffsetDateTime; import java.time.OffsetTime; import java.util.Calendar; import java.util.concurrent.ConcurrentHashMap; /** * @author Clinton Begin */ public class ArrayTypeHandler extends BaseTypeHandler<Object> { private static final ConcurrentHashMap<Class<?>, String> STANDARD_MAPPING; static { STANDARD_MAPPING = new ConcurrentHashMap<>(); STANDARD_MAPPING.put(BigDecimal.class, JdbcType.NUMERIC.name()); STANDARD_MAPPING.put(BigInteger.class, JdbcType.BIGINT.name()); STANDARD_MAPPING.put(boolean.class, JdbcType.BOOLEAN.name()); STANDARD_MAPPING.put(Boolean.class, JdbcType.BOOLEAN.name()); STANDARD_MAPPING.put(byte[].class, JdbcType.VARBINARY.name()); STANDARD_MAPPING.put(byte.class, JdbcType.TINYINT.name()); STANDARD_MAPPING.put(Byte.class, JdbcType.TINYINT.name()); STANDARD_MAPPING.put(Calendar.class, JdbcType.TIMESTAMP.name()); STANDARD_MAPPING.put(java.sql.Date.class, JdbcType.DATE.name()); STANDARD_MAPPING.put(java.util.Date.class, JdbcType.TIMESTAMP.name()); STANDARD_MAPPING.put(double.class, JdbcType.DOUBLE.name()); STANDARD_MAPPING.put(Double.class, JdbcType.DOUBLE.name()); STANDARD_MAPPING.put(float.class, JdbcType.REAL.name()); STANDARD_MAPPING.put(Float.class, JdbcType.REAL.name()); STANDARD_MAPPING.put(int.class, JdbcType.INTEGER.name()); STANDARD_MAPPING.put(Integer.class, JdbcType.INTEGER.name()); STANDARD_MAPPING.put(LocalDate.class, JdbcType.DATE.name()); STANDARD_MAPPING.put(LocalDateTime.class, JdbcType.TIMESTAMP.name()); STANDARD_MAPPING.put(LocalTime.class, JdbcType.TIME.name()); STANDARD_MAPPING.put(long.class, JdbcType.BIGINT.name()); STANDARD_MAPPING.put(Long.class, JdbcType.BIGINT.name()); STANDARD_MAPPING.put(OffsetDateTime.class, JdbcType.TIMESTAMP_WITH_TIMEZONE.name()); STANDARD_MAPPING.put(OffsetTime.class, JdbcType.TIME_WITH_TIMEZONE.name()); STANDARD_MAPPING.put(Short.class, JdbcType.SMALLINT.name()); STANDARD_MAPPING.put(String.class, JdbcType.VARCHAR.name()); STANDARD_MAPPING.put(Time.class, JdbcType.TIME.name()); STANDARD_MAPPING.put(Timestamp.class, JdbcType.TIMESTAMP.name()); STANDARD_MAPPING.put(URL.class, JdbcType.DATALINK.name()); } public ArrayTypeHandler() { super(); } @Override public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException { if (parameter instanceof Array) { // it's the user's responsibility to properly free() the Array instance ps.setArray(i, (Array) parameter); } else { if (!parameter.getClass().isArray()) { throw new TypeException( "ArrayType Handler requires SQL array or java array parameter and does not support type " + parameter.getClass()); } Class<?> componentType = parameter.getClass().getComponentType(); String arrayTypeName = resolveTypeName(componentType); Array array = ps.getConnection().createArrayOf(arrayTypeName, (Object[]) parameter); ps.setArray(i, array); array.free(); } } protected String resolveTypeName(Class<?> type) { return STANDARD_MAPPING.getOrDefault(type, JdbcType.JAVA_OBJECT.name()); } @Override public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { return extractArray(rs.getArray(columnName)); } @Override public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return extractArray(rs.getArray(columnIndex)); } @Override public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { return extractArray(cs.getArray(columnIndex)); } protected Object extractArray(Array array) throws SQLException { if (array == null) { return null; } Object result = array.getArray(); array.free(); return result; } }
[ "yeecode@126.com" ]
yeecode@126.com
40f736d91803f7afc012142396a2930b0efddc61
fc9240ef0d78edf0ca6197b392b7685a5deed17c
/app/src/androidTest/java/com/example/cadet/myapplication/ExampleInstrumentedTest.java
3a444587a2892dcf0e986ceb1e5738a368501854
[]
no_license
PokotelykOleksiy/Main-config
6fec7d0ea3cc11576744aa98928167e68e8d0c37
4989351a8ebd0bb90381c59b1906ffd3036f129f
refs/heads/master
2020-04-01T04:23:23.294469
2018-10-13T10:30:22
2018-10-13T10:30:22
152,861,349
0
0
null
null
null
null
UTF-8
Java
false
false
746
java
package com.example.cadet.myapplication; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.cadet.myapplication", appContext.getPackageName()); } }
[ "kiber.kiber.viti@gmail.com" ]
kiber.kiber.viti@gmail.com
689e42fc0e76e6aec78fc350bcc84757aeeca98d
1805abcab63468c29ea263facaecd88996a83edc
/src/test/java/com/amazon/tests/DataProviderTest.java
d89270cdc7d8e1814066e35854ea12166584e860
[]
no_license
msen2020/AmazonRegistration
d1d2c93f160c68dfc3251fa49724b3352eb060fe
448191bcd2b918ec905923f84ea88493304965a3
refs/heads/main
2023-07-12T06:19:33.011483
2021-08-04T18:45:09
2021-08-04T18:45:09
384,985,528
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package com.amazon.tests; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class DataProviderTest { //TestNg @DataProvider nedir? @Test(dataProvider = "names") public void test(String name, int age){ System.out.println(name + "-" + age); } @DataProvider public Object [][] names(){ Object[][] list = {{"Hamza", 20 },{"Ayse", 40}, {"Ahmet", 30}, {"Fatma", 25}}; return list; } }
[ "msen2020@hotmail.com" ]
msen2020@hotmail.com
1a788a5b7b75591a353725e04e7e0b43b722239e
d6b6abe73a0c82656b04875135b4888c644d2557
/sources/android/support/v4/app/FragmentManagerImpl.java
4969a26b543e88c9a9f8ffc91ffff3a2ff14333a
[]
no_license
chanyaz/and_unimed
4344d1a8ce8cb13b6880ca86199de674d770304b
fb74c460f8c536c16cca4900da561c78c7035972
refs/heads/master
2020-03-29T09:07:09.224595
2018-08-30T06:29:32
2018-08-30T06:29:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
104,309
java
package android.support.v4.app; import android.animation.Animator; import android.animation.AnimatorInflater; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.arch.lifecycle.k; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources.NotFoundException; import android.content.res.TypedArray; import android.os.Build.VERSION; import android.os.Bundle; import android.os.Looper; import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.v4.app.Fragment.SavedState; import android.support.v4.app.FragmentManager.OnBackStackChangedListener; import android.support.v4.util.b; import android.support.v4.util.d; import android.support.v4.util.e; import android.support.v4.util.o; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater.Factory2; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationSet; import android.view.animation.AnimationUtils; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.ScaleAnimation; import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; final class FragmentManagerImpl extends FragmentManager implements Factory2 { static final Interpolator F = new DecelerateInterpolator(2.5f); static final Interpolator G = new DecelerateInterpolator(1.5f); static final Interpolator H = new AccelerateInterpolator(2.5f); static final Interpolator I = new AccelerateInterpolator(1.5f); static boolean a = false; static Field q = null; Bundle A = null; SparseArray<Parcelable> B = null; ArrayList<x> C; y D; Runnable E = new Runnable() { public void run() { FragmentManagerImpl.this.i(); } }; private final CopyOnWriteArrayList<o<p, Boolean>> J = new CopyOnWriteArrayList(); ArrayList<OpGenerator> b; boolean c; int d = 0; final ArrayList<Fragment> e = new ArrayList(); SparseArray<Fragment> f; ArrayList<d> g; ArrayList<Fragment> h; ArrayList<d> i; ArrayList<Integer> j; ArrayList<OnBackStackChangedListener> k; int l = 0; o m; m n; Fragment o; Fragment p; boolean r; boolean s; boolean t; boolean u; String v; boolean w; ArrayList<d> x; ArrayList<Boolean> y; ArrayList<Fragment> z; interface OpGenerator { boolean generateOps(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2); } FragmentManagerImpl() { } private void B() { if (g()) { throw new IllegalStateException("Can not perform this action after onSaveInstanceState"); } else if (this.v != null) { throw new IllegalStateException("Can not perform this action inside of " + this.v); } } private void C() { Object obj = 1; synchronized (this) { Object obj2 = (this.C == null || this.C.isEmpty()) ? null : 1; if (this.b == null || this.b.size() != 1) { obj = null; } if (!(obj2 == null && obj == null)) { this.m.h().removeCallbacks(this.E); this.m.h().post(this.E); } } } private void D() { this.c = false; this.y.clear(); this.x.clear(); } private void E() { if (this.C != null) { while (!this.C.isEmpty()) { ((x) this.C.remove(0)).b(); } } } private void F() { int size = this.f == null ? 0 : this.f.size(); for (int i = 0; i < size; i++) { Fragment fragment = (Fragment) this.f.valueAt(i); if (fragment != null) { if (fragment.X() != null) { int Z = fragment.Z(); View X = fragment.X(); Animation animation = X.getAnimation(); if (animation != null) { animation.cancel(); X.clearAnimation(); } fragment.a(null); a(fragment, Z, 0, 0, false); } else if (fragment.Y() != null) { fragment.Y().end(); } } } } private void G() { if (this.f != null) { for (int size = this.f.size() - 1; size >= 0; size--) { if (this.f.valueAt(size) == null) { this.f.delete(this.f.keyAt(size)); } } } } private int a(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2, int i, int i2, b<Fragment> bVar) { int i3 = i2 - 1; int i4 = i2; while (i3 >= i) { int i5; d dVar = (d) arrayList.get(i3); boolean booleanValue = ((Boolean) arrayList2.get(i3)).booleanValue(); boolean z = dVar.g() && !dVar.a((ArrayList) arrayList, i3 + 1, i2); if (z) { if (this.C == null) { this.C = new ArrayList(); } OnStartEnterTransitionListener xVar = new x(dVar, booleanValue); this.C.add(xVar); dVar.a(xVar); if (booleanValue) { dVar.f(); } else { dVar.b(false); } int i6 = i4 - 1; if (i3 != i6) { arrayList.remove(i3); arrayList.add(i6, dVar); } b((b) bVar); i5 = i6; } else { i5 = i4; } i3--; i4 = i5; } return i4; } static s a(Context context, float f, float f2) { Animation alphaAnimation = new AlphaAnimation(f, f2); alphaAnimation.setInterpolator(G); alphaAnimation.setDuration(220); return new s(alphaAnimation, null); } static s a(Context context, float f, float f2, float f3, float f4) { Animation animationSet = new AnimationSet(false); Animation scaleAnimation = new ScaleAnimation(f, f2, f, f2, 1, 0.5f, 1, 0.5f); scaleAnimation.setInterpolator(F); scaleAnimation.setDuration(220); animationSet.addAnimation(scaleAnimation); scaleAnimation = new AlphaAnimation(f3, f4); scaleAnimation.setInterpolator(G); scaleAnimation.setDuration(220); animationSet.addAnimation(scaleAnimation); return new s(animationSet, null); } private static AnimationListener a(Animation animation) { try { if (q == null) { q = Animation.class.getDeclaredField("mListener"); q.setAccessible(true); } return (AnimationListener) q.get(animation); } catch (Throwable e) { Log.e("FragmentManager", "No field with the name mListener is found in Animation class", e); return null; } catch (Throwable e2) { Log.e("FragmentManager", "Cannot access Animation's mListener field", e2); return null; } } private void a(@NonNull final Fragment fragment, @NonNull s sVar, int i) { final View view = fragment.S; final ViewGroup viewGroup = fragment.R; viewGroup.startViewTransition(view); fragment.c(i); if (sVar.a != null) { Animation uVar = new u(sVar.a, viewGroup, view); fragment.a(fragment.S); uVar.setAnimationListener(new r(a(uVar)) { public void onAnimationEnd(Animation animation) { super.onAnimationEnd(animation); viewGroup.post(new Runnable() { public void run() { if (fragment.X() != null) { fragment.a(null); FragmentManagerImpl.this.a(fragment, fragment.Z(), 0, 0, false); } } }); } }); b(view, sVar); fragment.S.startAnimation(uVar); return; } Animator animator = sVar.b; fragment.a(sVar.b); animator.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animator) { viewGroup.endViewTransition(view); Animator Y = fragment.Y(); fragment.a(null); if (Y != null && viewGroup.indexOfChild(view) < 0) { FragmentManagerImpl.this.a(fragment, fragment.Z(), 0, 0, false); } } }); animator.setTarget(fragment.S); b(fragment.S, sVar); animator.start(); } private void a(d dVar, boolean z, boolean z2, boolean z3) { if (z) { dVar.b(z3); } else { dVar.f(); } ArrayList arrayList = new ArrayList(1); ArrayList arrayList2 = new ArrayList(1); arrayList.add(dVar); arrayList2.add(Boolean.valueOf(z)); if (z2) { ac.a(this, arrayList, arrayList2, 0, 1, true); } if (z3) { a(this.l, true); } if (this.f != null) { int size = this.f.size(); for (int i = 0; i < size; i++) { Fragment fragment = (Fragment) this.f.valueAt(i); if (fragment != null && fragment.S != null && fragment.Y && dVar.b(fragment.I)) { if (fragment.aa > 0.0f) { fragment.S.setAlpha(fragment.aa); } if (z3) { fragment.aa = 0.0f; } else { fragment.aa = -1.0f; fragment.Y = false; } } } } } private static void a(y yVar) { if (yVar != null) { List<Fragment> a = yVar.a(); if (a != null) { for (Fragment fragment : a) { fragment.N = true; } } List<y> b = yVar.b(); if (b != null) { for (y a2 : b) { a(a2); } } } } private void a(b<Fragment> bVar) { int size = bVar.size(); for (int i = 0; i < size; i++) { Fragment fragment = (Fragment) bVar.b(i); if (!fragment.u) { View s = fragment.s(); fragment.aa = s.getAlpha(); s.setAlpha(0.0f); } } } private void a(RuntimeException runtimeException) { Log.e("FragmentManager", runtimeException.getMessage()); Log.e("FragmentManager", "Activity state:"); PrintWriter printWriter = new PrintWriter(new e("FragmentManager")); if (this.m != null) { try { this.m.a(" ", null, printWriter, new String[0]); } catch (Throwable e) { Log.e("FragmentManager", "Failed dumping state", e); } } else { try { a(" ", null, printWriter, new String[0]); } catch (Throwable e2) { Log.e("FragmentManager", "Failed dumping state", e2); } } throw runtimeException; } private void a(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2) { int i = 0; int size = this.C == null ? 0 : this.C.size(); while (i < size) { int indexOf; x xVar = (x) this.C.get(i); if (!(arrayList == null || xVar.a)) { indexOf = arrayList.indexOf(xVar.b); if (indexOf != -1 && ((Boolean) arrayList2.get(indexOf)).booleanValue()) { xVar.c(); i++; size = size; } } if (xVar.a() || (arrayList != null && xVar.b.a((ArrayList) arrayList, 0, arrayList.size()))) { this.C.remove(i); i--; size--; if (!(arrayList == null || xVar.a)) { indexOf = arrayList.indexOf(xVar.b); if (indexOf != -1 && ((Boolean) arrayList2.get(indexOf)).booleanValue()) { xVar.c(); } } xVar.b(); } i++; size = size; } } private void a(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2, int i, int i2) { d dVar; int a; boolean z = ((d) arrayList.get(i)).t; if (this.z == null) { this.z = new ArrayList(); } else { this.z.clear(); } this.z.addAll(this.e); int i3 = i; Fragment z2 = z(); boolean z3 = false; while (i3 < i2) { dVar = (d) arrayList.get(i3); Fragment a2 = !((Boolean) arrayList2.get(i3)).booleanValue() ? dVar.a(this.z, z2) : dVar.b(this.z, z2); boolean z4 = z3 || dVar.i; i3++; z2 = a2; z3 = z4; } this.z.clear(); if (!z) { ac.a(this, (ArrayList) arrayList, (ArrayList) arrayList2, i, i2, false); } b(arrayList, arrayList2, i, i2); if (z) { b bVar = new b(); b(bVar); a = a((ArrayList) arrayList, (ArrayList) arrayList2, i, i2, bVar); a(bVar); } else { a = i2; } if (a != i && z) { ac.a(this, (ArrayList) arrayList, (ArrayList) arrayList2, i, a, true); a(this.l, true); } while (i < i2) { dVar = (d) arrayList.get(i); if (((Boolean) arrayList2.get(i)).booleanValue() && dVar.m >= 0) { c(dVar.m); dVar.m = -1; } dVar.b(); i++; } if (z3) { k(); } } static boolean a(Animator animator) { if (animator == null) { return false; } if (animator instanceof ValueAnimator) { PropertyValuesHolder[] values = ((ValueAnimator) animator).getValues(); for (PropertyValuesHolder propertyName : values) { if ("alpha".equals(propertyName.getPropertyName())) { return true; } } return false; } else if (!(animator instanceof AnimatorSet)) { return false; } else { List childAnimations = ((AnimatorSet) animator).getChildAnimations(); for (int i = 0; i < childAnimations.size(); i++) { if (a((Animator) childAnimations.get(i))) { return true; } } return false; } } static boolean a(s sVar) { if (sVar.a instanceof AlphaAnimation) { return true; } if (!(sVar.a instanceof AnimationSet)) { return a(sVar.b); } List animations = ((AnimationSet) sVar.a).getAnimations(); for (int i = 0; i < animations.size(); i++) { if (animations.get(i) instanceof AlphaAnimation) { return true; } } return false; } static boolean a(View view, s sVar) { return view != null && sVar != null && VERSION.SDK_INT >= 19 && view.getLayerType() == 0 && ViewCompat.s(view) && a(sVar); } private boolean a(String str, int i, int i2) { i(); c(true); if (this.p != null && i < 0 && str == null) { FragmentManager n = this.p.n(); if (n != null && n.d()) { return true; } } boolean a = a(this.x, this.y, str, i, i2); if (a) { this.c = true; try { b(this.x, this.y); } finally { D(); } } j(); G(); return a; } public static int b(int i, boolean z) { switch (i) { case 4097: return z ? 1 : 2; case 4099: return z ? 5 : 6; case 8194: return z ? 3 : 4; default: return -1; } } private void b(b<Fragment> bVar) { if (this.l >= 1) { int min = Math.min(this.l, 4); int size = this.e.size(); for (int i = 0; i < size; i++) { Fragment fragment = (Fragment) this.e.get(i); if (fragment.k < min) { a(fragment, min, fragment.S(), fragment.T(), false); if (!(fragment.S == null || fragment.K || !fragment.Y)) { bVar.add(fragment); } } } } } private static void b(View view, s sVar) { if (view != null && sVar != null && a(view, sVar)) { if (sVar.b != null) { sVar.b.addListener(new t(view)); return; } AnimationListener a = a(sVar.a); view.setLayerType(2, null); sVar.a.setAnimationListener(new q(view, a)); } } private void b(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2) { int i = 0; if (arrayList != null && !arrayList.isEmpty()) { if (arrayList2 == null || arrayList.size() != arrayList2.size()) { throw new IllegalStateException("Internal error with the back stack records"); } a((ArrayList) arrayList, (ArrayList) arrayList2); int size = arrayList.size(); int i2 = 0; while (i < size) { int i3; if (((d) arrayList.get(i)).t) { i3 = i; } else { if (i2 != i) { a((ArrayList) arrayList, (ArrayList) arrayList2, i2, i); } i2 = i + 1; if (((Boolean) arrayList2.get(i)).booleanValue()) { while (i2 < size && ((Boolean) arrayList2.get(i2)).booleanValue() && !((d) arrayList.get(i2)).t) { i2++; } } i3 = i2; a((ArrayList) arrayList, (ArrayList) arrayList2, i, i3); i2 = i3; i3--; } i = i3 + 1; } if (i2 != size) { a((ArrayList) arrayList, (ArrayList) arrayList2, i2, size); } } } private static void b(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2, int i, int i2) { while (i < i2) { d dVar = (d) arrayList.get(i); if (((Boolean) arrayList2.get(i)).booleanValue()) { dVar.a(-1); dVar.b(i == i2 + -1); } else { dVar.a(1); dVar.f(); } i++; } } private void c(boolean z) { if (this.c) { throw new IllegalStateException("FragmentManager is already executing transactions"); } else if (this.m == null) { throw new IllegalStateException("Fragment host has been destroyed"); } else if (Looper.myLooper() != this.m.h().getLooper()) { throw new IllegalStateException("Must be called from main thread of fragment host"); } else { if (!z) { B(); } if (this.x == null) { this.x = new ArrayList(); this.y = new ArrayList(); } this.c = true; try { a(null, null); } finally { this.c = false; } } } /* JADX WARNING: Missing block: B:18:?, code: return false; */ private boolean c(java.util.ArrayList<android.support.v4.app.d> r5, java.util.ArrayList<java.lang.Boolean> r6) { /* r4 = this; r0 = 0; monitor-enter(r4); r1 = r4.b; Catch:{ all -> 0x003e } if (r1 == 0) goto L_0x000e; L_0x0006: r1 = r4.b; Catch:{ all -> 0x003e } r1 = r1.size(); Catch:{ all -> 0x003e } if (r1 != 0) goto L_0x0010; L_0x000e: monitor-exit(r4); Catch:{ all -> 0x003e } L_0x000f: return r0; L_0x0010: r1 = r4.b; Catch:{ all -> 0x003e } r3 = r1.size(); Catch:{ all -> 0x003e } r2 = r0; r1 = r0; L_0x0018: if (r2 >= r3) goto L_0x002b; L_0x001a: r0 = r4.b; Catch:{ all -> 0x003e } r0 = r0.get(r2); Catch:{ all -> 0x003e } r0 = (android.support.v4.app.FragmentManagerImpl.OpGenerator) r0; Catch:{ all -> 0x003e } r0 = r0.generateOps(r5, r6); Catch:{ all -> 0x003e } r1 = r1 | r0; r0 = r2 + 1; r2 = r0; goto L_0x0018; L_0x002b: r0 = r4.b; Catch:{ all -> 0x003e } r0.clear(); Catch:{ all -> 0x003e } r0 = r4.m; Catch:{ all -> 0x003e } r0 = r0.h(); Catch:{ all -> 0x003e } r2 = r4.E; Catch:{ all -> 0x003e } r0.removeCallbacks(r2); Catch:{ all -> 0x003e } monitor-exit(r4); Catch:{ all -> 0x003e } r0 = r1; goto L_0x000f; L_0x003e: r0 = move-exception; monitor-exit(r4); Catch:{ all -> 0x003e } throw r0; */ throw new UnsupportedOperationException("Method not decompiled: android.support.v4.app.FragmentManagerImpl.c(java.util.ArrayList, java.util.ArrayList):boolean"); } public static int d(int i) { switch (i) { case 4097: return 8194; case 4099: return 4099; case 8194: return 4097; default: return 0; } } private void e(int i) { try { this.c = true; a(i, false); i(); } finally { this.c = false; } } private Fragment q(Fragment fragment) { ViewGroup viewGroup = fragment.R; View view = fragment.S; if (viewGroup == null || view == null) { return null; } for (int indexOf = this.e.indexOf(fragment) - 1; indexOf >= 0; indexOf--) { Fragment fragment2 = (Fragment) this.e.get(indexOf); if (fragment2.R == viewGroup && fragment2.S != null) { return fragment2; } } return null; } Factory2 A() { return this; } public int a(d dVar) { int size; synchronized (this) { if (this.j == null || this.j.size() <= 0) { if (this.i == null) { this.i = new ArrayList(); } size = this.i.size(); if (a) { Log.v("FragmentManager", "Setting back stack index " + size + " to " + dVar); } this.i.add(dVar); } else { size = ((Integer) this.j.remove(this.j.size() - 1)).intValue(); if (a) { Log.v("FragmentManager", "Adding back stack index " + size + " with " + dVar); } this.i.set(size, dVar); } } return size; } public SavedState a(Fragment fragment) { if (fragment.o < 0) { a(new IllegalStateException("Fragment " + fragment + " is not currently in the FragmentManager")); } if (fragment.k <= 0) { return null; } Bundle o = o(fragment); return o != null ? new SavedState(o) : null; } public Fragment a(Bundle bundle, String str) { int i = bundle.getInt(str, -1); if (i == -1) { return null; } Fragment fragment = (Fragment) this.f.get(i); if (fragment != null) { return fragment; } a(new IllegalStateException("Fragment no longer exists for key " + str + ": index " + i)); return fragment; } public Fragment a(String str) { int size; Fragment fragment; if (str != null) { for (size = this.e.size() - 1; size >= 0; size--) { fragment = (Fragment) this.e.get(size); if (fragment != null && str.equals(fragment.J)) { return fragment; } } } if (!(this.f == null || str == null)) { for (size = this.f.size() - 1; size >= 0; size--) { fragment = (Fragment) this.f.valueAt(size); if (fragment != null && str.equals(fragment.J)) { return fragment; } } } return null; } public FragmentTransaction a() { return new d(this); } s a(Fragment fragment, int i, boolean z, int i2) { int S = fragment.S(); Animation a = fragment.a(i, z, S); if (a != null) { return new s(a, null); } Animator b = fragment.b(i, z, S); if (b != null) { return new s(b, null); } if (S != 0) { Object obj; boolean equals = "anim".equals(this.m.g().getResources().getResourceTypeName(S)); if (equals) { try { Animation loadAnimation = AnimationUtils.loadAnimation(this.m.g(), S); if (loadAnimation != null) { return new s(loadAnimation, null); } obj = 1; } catch (NotFoundException e) { throw e; } catch (RuntimeException e2) { obj = null; } } else { obj = null; } if (obj == null) { try { b = AnimatorInflater.loadAnimator(this.m.g(), S); if (b != null) { return new s(b, null); } } catch (RuntimeException e3) { if (equals) { throw e3; } a = AnimationUtils.loadAnimation(this.m.g(), S); if (a != null) { return new s(a, null); } } } } if (i == 0) { return null; } int b2 = b(i, z); if (b2 < 0) { return null; } switch (b2) { case 1: return a(this.m.g(), 1.125f, 1.0f, 0.0f, 1.0f); case 2: return a(this.m.g(), 1.0f, 0.975f, 1.0f, 0.0f); case 3: return a(this.m.g(), 0.975f, 1.0f, 0.0f, 1.0f); case 4: return a(this.m.g(), 1.0f, 1.075f, 1.0f, 0.0f); case 5: return a(this.m.g(), 0.0f, 1.0f); case 6: return a(this.m.g(), 1.0f, 0.0f); default: if (i2 == 0 && this.m.d()) { i2 = this.m.e(); } return i2 == 0 ? null : null; } } public void a(int i, int i2) { if (i < 0) { throw new IllegalArgumentException("Bad id: " + i); } a(new w(this, null, i, i2), false); } public void a(int i, d dVar) { synchronized (this) { if (this.i == null) { this.i = new ArrayList(); } int size = this.i.size(); if (i < size) { if (a) { Log.v("FragmentManager", "Setting back stack index " + i + " to " + dVar); } this.i.set(i, dVar); } else { while (size < i) { this.i.add(null); if (this.j == null) { this.j = new ArrayList(); } if (a) { Log.v("FragmentManager", "Adding available back stack index " + size); } this.j.add(Integer.valueOf(size)); size++; } if (a) { Log.v("FragmentManager", "Adding back stack index " + i + " with " + dVar); } this.i.add(dVar); } } } void a(int i, boolean z) { if (this.m == null && i != 0) { throw new IllegalStateException("No activity"); } else if (z || i != this.l) { this.l = i; if (this.f != null) { int i2; int size = this.e.size(); for (i2 = 0; i2 < size; i2++) { f((Fragment) this.e.get(i2)); } size = this.f.size(); for (i2 = 0; i2 < size; i2++) { Fragment fragment = (Fragment) this.f.valueAt(i2); if (fragment != null && ((fragment.v || fragment.L) && !fragment.Y)) { f(fragment); } } h(); if (this.r && this.m != null && this.l == 5) { this.m.c(); this.r = false; } } } } public void a(Configuration configuration) { int i = 0; while (true) { int i2 = i; if (i2 < this.e.size()) { Fragment fragment = (Fragment) this.e.get(i2); if (fragment != null) { fragment.a(configuration); } i = i2 + 1; } else { return; } } } public void a(Bundle bundle, String str, Fragment fragment) { if (fragment.o < 0) { a(new IllegalStateException("Fragment " + fragment + " is not currently in the FragmentManager")); } bundle.putInt(str, fragment.o); } void a(Parcelable parcelable, y yVar) { if (parcelable != null) { FragmentManagerState fragmentManagerState = (FragmentManagerState) parcelable; if (fragmentManagerState.a != null) { List a; List b; int size; Fragment fragment; int i; List list; if (yVar != null) { a = yVar.a(); b = yVar.b(); List c = yVar.c(); if (a != null) { size = a.size(); } else { boolean size2 = false; } for (int i2 = 0; i2 < size2; i2++) { fragment = (Fragment) a.get(i2); if (a) { Log.v("FragmentManager", "restoreAllState: re-attaching retained " + fragment); } i = 0; while (i < fragmentManagerState.a.length && fragmentManagerState.a[i].b != fragment.o) { i++; } if (i == fragmentManagerState.a.length) { a(new IllegalStateException("Could not find active fragment with index " + fragment.o)); } FragmentState fragmentState = fragmentManagerState.a[i]; fragmentState.l = fragment; fragment.m = null; fragment.A = 0; fragment.x = false; fragment.u = false; fragment.r = null; if (fragmentState.k != null) { fragmentState.k.setClassLoader(this.m.g().getClassLoader()); fragment.m = fragmentState.k.getSparseParcelableArray("android:view_state"); fragment.l = fragmentState.k; } } a = c; list = b; } else { a = null; list = null; } this.f = new SparseArray(fragmentManagerState.a.length); int i3 = 0; while (i3 < fragmentManagerState.a.length) { FragmentState fragmentState2 = fragmentManagerState.a[i3]; if (fragmentState2 != null) { y yVar2 = (list == null || i3 >= list.size()) ? null : (y) list.get(i3); k kVar = (a == null || i3 >= a.size()) ? null : (k) a.get(i3); Fragment a2 = fragmentState2.a(this.m, this.n, this.o, yVar2, kVar); if (a) { Log.v("FragmentManager", "restoreAllState: active #" + i3 + ": " + a2); } this.f.put(a2.o, a2); fragmentState2.l = null; } i3++; } if (yVar != null) { b = yVar.a(); if (b != null) { i = b.size(); } else { boolean z = false; } for (int i4 = 0; i4 < i; i4++) { fragment = (Fragment) b.get(i4); if (fragment.s >= 0) { fragment.r = (Fragment) this.f.get(fragment.s); if (fragment.r == null) { Log.w("FragmentManager", "Re-attaching retained fragment " + fragment + " target no longer exists: " + fragment.s); } } } } this.e.clear(); if (fragmentManagerState.b != null) { for (size2 = 0; size2 < fragmentManagerState.b.length; size2++) { fragment = (Fragment) this.f.get(fragmentManagerState.b[size2]); if (fragment == null) { a(new IllegalStateException("No instantiated fragment for index #" + fragmentManagerState.b[size2])); } fragment.u = true; if (a) { Log.v("FragmentManager", "restoreAllState: added #" + size2 + ": " + fragment); } if (this.e.contains(fragment)) { throw new IllegalStateException("Already added!"); } synchronized (this.e) { this.e.add(fragment); } } } if (fragmentManagerState.c != null) { this.g = new ArrayList(fragmentManagerState.c.length); for (int i5 = 0; i5 < fragmentManagerState.c.length; i5++) { d a3 = fragmentManagerState.c[i5].a(this); if (a) { Log.v("FragmentManager", "restoreAllState: back stack #" + i5 + " (index " + a3.m + "): " + a3); PrintWriter printWriter = new PrintWriter(new e("FragmentManager")); a3.a(" ", printWriter, false); printWriter.close(); } this.g.add(a3); if (a3.m >= 0) { a(a3.m, a3); } } } else { this.g = null; } if (fragmentManagerState.d >= 0) { this.p = (Fragment) this.f.get(fragmentManagerState.d); } this.d = fragmentManagerState.e; } } } /* JADX WARNING: Removed duplicated region for block: B:215:? A:{SYNTHETIC, RETURN} */ /* JADX WARNING: Removed duplicated region for block: B:37:0x0063 */ /* JADX WARNING: Missing block: B:80:0x01d1, code: d(r11); */ /* JADX WARNING: Missing block: B:81:0x01d4, code: if (r12 <= 1) goto L_0x02cf; */ /* JADX WARNING: Missing block: B:83:0x01d8, code: if (a == false) goto L_0x01f2; */ /* JADX WARNING: Missing block: B:84:0x01da, code: android.util.Log.v("FragmentManager", "moveto ACTIVITY_CREATED: " + r11); */ /* JADX WARNING: Missing block: B:86:0x01f4, code: if (r11.w != false) goto L_0x02ba; */ /* JADX WARNING: Missing block: B:88:0x01f8, code: if (r11.I == 0) goto L_0x04b0; */ /* JADX WARNING: Missing block: B:90:0x01fd, code: if (r11.I != -1) goto L_0x0220; */ /* JADX WARNING: Missing block: B:91:0x01ff, code: a(new java.lang.IllegalArgumentException("Cannot create fragment " + r11 + " for a container view with no id")); */ /* JADX WARNING: Missing block: B:92:0x0220, code: r0 = (android.view.ViewGroup) r10.n.a(r11.I); */ /* JADX WARNING: Missing block: B:93:0x022a, code: if (r0 != null) goto L_0x026f; */ /* JADX WARNING: Missing block: B:95:0x022e, code: if (r11.y != false) goto L_0x026f; */ /* JADX WARNING: Missing block: B:97:?, code: r1 = r11.k().getResourceName(r11.I); */ /* JADX WARNING: Missing block: B:132:0x0333, code: r1 = "unknown"; */ /* JADX WARNING: Missing block: B:139:0x0348, code: if (r12 >= 1) goto L_0x005f; */ /* JADX WARNING: Missing block: B:141:0x034c, code: if (r10.u == false) goto L_0x035e; */ /* JADX WARNING: Missing block: B:143:0x0352, code: if (r11.X() == null) goto L_0x045a; */ /* JADX WARNING: Missing block: B:144:0x0354, code: r0 = r11.X(); r11.a(null); r0.clearAnimation(); */ /* JADX WARNING: Missing block: B:146:0x0362, code: if (r11.X() != null) goto L_0x036a; */ /* JADX WARNING: Missing block: B:148:0x0368, code: if (r11.Y() == null) goto L_0x046c; */ /* JADX WARNING: Missing block: B:149:0x036a, code: r11.c(r12); r12 = 1; */ /* JADX WARNING: Missing block: B:156:0x0395, code: if (r12 >= 4) goto L_0x03b9; */ /* JADX WARNING: Missing block: B:158:0x0399, code: if (a == false) goto L_0x03b3; */ /* JADX WARNING: Missing block: B:159:0x039b, code: android.util.Log.v("FragmentManager", "movefrom STARTED: " + r11); */ /* JADX WARNING: Missing block: B:160:0x03b3, code: r11.N(); e(r11, false); */ /* JADX WARNING: Missing block: B:161:0x03b9, code: if (r12 >= 3) goto L_0x03da; */ /* JADX WARNING: Missing block: B:163:0x03bd, code: if (a == false) goto L_0x03d7; */ /* JADX WARNING: Missing block: B:164:0x03bf, code: android.util.Log.v("FragmentManager", "movefrom STOPPED: " + r11); */ /* JADX WARNING: Missing block: B:165:0x03d7, code: r11.O(); */ /* JADX WARNING: Missing block: B:167:0x03db, code: if (r12 >= 2) goto L_0x0348; */ /* JADX WARNING: Missing block: B:169:0x03df, code: if (a == false) goto L_0x03f9; */ /* JADX WARNING: Missing block: B:170:0x03e1, code: android.util.Log.v("FragmentManager", "movefrom ACTIVITY_CREATED: " + r11); */ /* JADX WARNING: Missing block: B:172:0x03fb, code: if (r11.S == null) goto L_0x040c; */ /* JADX WARNING: Missing block: B:174:0x0403, code: if (r10.m.a(r11) == false) goto L_0x040c; */ /* JADX WARNING: Missing block: B:176:0x0407, code: if (r11.m != null) goto L_0x040c; */ /* JADX WARNING: Missing block: B:177:0x0409, code: n(r11); */ /* JADX WARNING: Missing block: B:178:0x040c, code: r11.P(); f(r11, false); */ /* JADX WARNING: Missing block: B:179:0x0414, code: if (r11.S == null) goto L_0x0450; */ /* JADX WARNING: Missing block: B:181:0x0418, code: if (r11.R == null) goto L_0x0450; */ /* JADX WARNING: Missing block: B:182:0x041a, code: r11.R.endViewTransition(r11.S); r11.S.clearAnimation(); */ /* JADX WARNING: Missing block: B:183:0x0428, code: if (r10.l <= 0) goto L_0x04ae; */ /* JADX WARNING: Missing block: B:185:0x042c, code: if (r10.u != false) goto L_0x04ae; */ /* JADX WARNING: Missing block: B:187:0x0434, code: if (r11.S.getVisibility() != 0) goto L_0x04ae; */ /* JADX WARNING: Missing block: B:189:0x043b, code: if (r11.aa < 0.0f) goto L_0x04ae; */ /* JADX WARNING: Missing block: B:190:0x043d, code: r0 = a(r11, r13, false, r14); */ /* JADX WARNING: Missing block: B:191:0x0441, code: r11.aa = 0.0f; */ /* JADX WARNING: Missing block: B:192:0x0444, code: if (r0 == null) goto L_0x0449; */ /* JADX WARNING: Missing block: B:193:0x0446, code: a(r11, r0, r12); */ /* JADX WARNING: Missing block: B:194:0x0449, code: r11.R.removeView(r11.S); */ /* JADX WARNING: Missing block: B:195:0x0450, code: r11.R = null; r11.S = null; r11.T = null; r11.x = false; */ /* JADX WARNING: Missing block: B:197:0x045e, code: if (r11.Y() == null) goto L_0x035e; */ /* JADX WARNING: Missing block: B:198:0x0460, code: r0 = r11.Y(); r11.a(null); r0.cancel(); */ /* JADX WARNING: Missing block: B:200:0x046e, code: if (a == false) goto L_0x0488; */ /* JADX WARNING: Missing block: B:201:0x0470, code: android.util.Log.v("FragmentManager", "movefrom CREATED: " + r11); */ /* JADX WARNING: Missing block: B:203:0x048a, code: if (r11.N != false) goto L_0x04a3; */ /* JADX WARNING: Missing block: B:204:0x048c, code: r11.Q(); g(r11, false); */ /* JADX WARNING: Missing block: B:205:0x0492, code: r11.R(); h(r11, false); */ /* JADX WARNING: Missing block: B:206:0x0498, code: if (r15 != false) goto L_0x005f; */ /* JADX WARNING: Missing block: B:208:0x049c, code: if (r11.N != false) goto L_0x04a6; */ /* JADX WARNING: Missing block: B:209:0x049e, code: h(r11); */ /* JADX WARNING: Missing block: B:210:0x04a3, code: r11.k = 0; */ /* JADX WARNING: Missing block: B:211:0x04a6, code: r11.C = null; r11.G = null; r11.B = null; */ /* JADX WARNING: Missing block: B:212:0x04ae, code: r0 = null; */ /* JADX WARNING: Missing block: B:213:0x04b0, code: r0 = null; */ void a(android.support.v4.app.Fragment r11, int r12, int r13, int r14, boolean r15) { /* r10 = this; r9 = 4; r6 = 3; r5 = 1; r7 = 0; r3 = 0; r0 = r11.u; if (r0 == 0) goto L_0x000d; L_0x0009: r0 = r11.L; if (r0 == 0) goto L_0x0010; L_0x000d: if (r12 <= r5) goto L_0x0010; L_0x000f: r12 = r5; L_0x0010: r0 = r11.v; if (r0 == 0) goto L_0x0023; L_0x0014: r0 = r11.k; if (r12 <= r0) goto L_0x0023; L_0x0018: r0 = r11.k; if (r0 != 0) goto L_0x003b; L_0x001c: r0 = r11.f(); if (r0 == 0) goto L_0x003b; L_0x0022: r12 = r5; L_0x0023: r0 = r11.U; if (r0 == 0) goto L_0x002e; L_0x0027: r0 = r11.k; if (r0 >= r9) goto L_0x002e; L_0x002b: if (r12 <= r6) goto L_0x002e; L_0x002d: r12 = r6; L_0x002e: r0 = r11.k; if (r0 > r12) goto L_0x033d; L_0x0032: r0 = r11.w; if (r0 == 0) goto L_0x003e; L_0x0036: r0 = r11.x; if (r0 != 0) goto L_0x003e; L_0x003a: return; L_0x003b: r12 = r11.k; goto L_0x0023; L_0x003e: r0 = r11.X(); if (r0 != 0) goto L_0x004a; L_0x0044: r0 = r11.Y(); if (r0 == 0) goto L_0x005a; L_0x004a: r11.a(r7); r11.a(r7); r2 = r11.Z(); r0 = r10; r1 = r11; r4 = r3; r0.a(r1, r2, r3, r4, r5); L_0x005a: r0 = r11.k; switch(r0) { case 0: goto L_0x009a; case 1: goto L_0x01d1; case 2: goto L_0x02cf; case 3: goto L_0x02d4; case 4: goto L_0x02f8; default: goto L_0x005f; }; L_0x005f: r0 = r11.k; if (r0 == r12) goto L_0x003a; L_0x0063: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "moveToState: Fragment state for "; r1 = r1.append(r2); r1 = r1.append(r11); r2 = " not updated inline; "; r1 = r1.append(r2); r2 = "expected state "; r1 = r1.append(r2); r1 = r1.append(r12); r2 = " found "; r1 = r1.append(r2); r2 = r11.k; r1 = r1.append(r2); r1 = r1.toString(); android.util.Log.w(r0, r1); r11.k = r12; goto L_0x003a; L_0x009a: if (r12 <= 0) goto L_0x01d1; L_0x009c: r0 = a; if (r0 == 0) goto L_0x00b8; L_0x00a0: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "moveto CREATED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x00b8: r0 = r11.l; if (r0 == 0) goto L_0x0104; L_0x00bc: r0 = r11.l; r1 = r10.m; r1 = r1.g(); r1 = r1.getClassLoader(); r0.setClassLoader(r1); r0 = r11.l; r1 = "android:view_state"; r0 = r0.getSparseParcelableArray(r1); r11.m = r0; r0 = r11.l; r1 = "android:target_state"; r0 = r10.a(r0, r1); r11.r = r0; r0 = r11.r; if (r0 == 0) goto L_0x00ed; L_0x00e3: r0 = r11.l; r1 = "android:target_req_state"; r0 = r0.getInt(r1, r3); r11.t = r0; L_0x00ed: r0 = r11.n; if (r0 == 0) goto L_0x0153; L_0x00f1: r0 = r11.n; r0 = r0.booleanValue(); r11.V = r0; r11.n = r7; L_0x00fb: r0 = r11.V; if (r0 != 0) goto L_0x0104; L_0x00ff: r11.U = r5; if (r12 <= r6) goto L_0x0104; L_0x0103: r12 = r6; L_0x0104: r0 = r10.m; r11.C = r0; r0 = r10.o; r11.G = r0; r0 = r10.o; if (r0 == 0) goto L_0x015e; L_0x0110: r0 = r10.o; r0 = r0.D; L_0x0114: r11.B = r0; r0 = r11.r; if (r0 == 0) goto L_0x0173; L_0x011a: r0 = r10.f; r1 = r11.r; r1 = r1.o; r0 = r0.get(r1); r1 = r11.r; if (r0 == r1) goto L_0x0165; L_0x0128: r0 = new java.lang.IllegalStateException; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "Fragment "; r1 = r1.append(r2); r1 = r1.append(r11); r2 = " declared target fragment "; r1 = r1.append(r2); r2 = r11.r; r1 = r1.append(r2); r2 = " that does not belong to this FragmentManager!"; r1 = r1.append(r2); r1 = r1.toString(); r0.<init>(r1); throw r0; L_0x0153: r0 = r11.l; r1 = "android:user_visible_hint"; r0 = r0.getBoolean(r1, r5); r11.V = r0; goto L_0x00fb; L_0x015e: r0 = r10.m; r0 = r0.i(); goto L_0x0114; L_0x0165: r0 = r11.r; r0 = r0.k; if (r0 >= r5) goto L_0x0173; L_0x016b: r1 = r11.r; r0 = r10; r2 = r5; r4 = r3; r0.a(r1, r2, r3, r4, r5); L_0x0173: r0 = r10.m; r0 = r0.g(); r10.a(r11, r0, r3); r11.Q = r3; r0 = r10.m; r0 = r0.g(); r11.a(r0); r0 = r11.Q; if (r0 != 0) goto L_0x01aa; L_0x018b: r0 = new android.support.v4.app.av; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "Fragment "; r1 = r1.append(r2); r1 = r1.append(r11); r2 = " did not call through to super.onAttach()"; r1 = r1.append(r2); r1 = r1.toString(); r0.<init>(r1); throw r0; L_0x01aa: r0 = r11.G; if (r0 != 0) goto L_0x0322; L_0x01ae: r0 = r10.m; r0.b(r11); L_0x01b3: r0 = r10.m; r0 = r0.g(); r10.b(r11, r0, r3); r0 = r11.ac; if (r0 != 0) goto L_0x0329; L_0x01c0: r0 = r11.l; r10.a(r11, r0, r3); r0 = r11.l; r11.l(r0); r0 = r11.l; r10.b(r11, r0, r3); L_0x01cf: r11.N = r3; L_0x01d1: r10.d(r11); if (r12 <= r5) goto L_0x02cf; L_0x01d6: r0 = a; if (r0 == 0) goto L_0x01f2; L_0x01da: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "moveto ACTIVITY_CREATED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x01f2: r0 = r11.w; if (r0 != 0) goto L_0x02ba; L_0x01f6: r0 = r11.I; if (r0 == 0) goto L_0x04b0; L_0x01fa: r0 = r11.I; r1 = -1; if (r0 != r1) goto L_0x0220; L_0x01ff: r0 = new java.lang.IllegalArgumentException; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "Cannot create fragment "; r1 = r1.append(r2); r1 = r1.append(r11); r2 = " for a container view with no id"; r1 = r1.append(r2); r1 = r1.toString(); r0.<init>(r1); r10.a(r0); L_0x0220: r0 = r10.n; r1 = r11.I; r0 = r0.a(r1); r0 = (android.view.ViewGroup) r0; if (r0 != 0) goto L_0x026f; L_0x022c: r1 = r11.y; if (r1 != 0) goto L_0x026f; L_0x0230: r1 = r11.k(); Catch:{ NotFoundException -> 0x0332 } r2 = r11.I; Catch:{ NotFoundException -> 0x0332 } r1 = r1.getResourceName(r2); Catch:{ NotFoundException -> 0x0332 } L_0x023a: r2 = new java.lang.IllegalArgumentException; r4 = new java.lang.StringBuilder; r4.<init>(); r8 = "No view found for id 0x"; r4 = r4.append(r8); r8 = r11.I; r8 = java.lang.Integer.toHexString(r8); r4 = r4.append(r8); r8 = " ("; r4 = r4.append(r8); r1 = r4.append(r1); r4 = ") for fragment "; r1 = r1.append(r4); r1 = r1.append(r11); r1 = r1.toString(); r2.<init>(r1); r10.a(r2); L_0x026f: r11.R = r0; r1 = r11.l; r1 = r11.h(r1); r2 = r11.l; r1 = r11.b(r1, r0, r2); r11.S = r1; r1 = r11.S; if (r1 == 0) goto L_0x0339; L_0x0283: r1 = r11.S; r11.T = r1; r1 = r11.S; r1.setSaveFromParentEnabled(r3); if (r0 == 0) goto L_0x0293; L_0x028e: r1 = r11.S; r0.addView(r1); L_0x0293: r0 = r11.K; if (r0 == 0) goto L_0x029e; L_0x0297: r0 = r11.S; r1 = 8; r0.setVisibility(r1); L_0x029e: r0 = r11.S; r1 = r11.l; r11.a(r0, r1); r0 = r11.S; r1 = r11.l; r10.a(r11, r0, r1, r3); r0 = r11.S; r0 = r0.getVisibility(); if (r0 != 0) goto L_0x0337; L_0x02b4: r0 = r11.R; if (r0 == 0) goto L_0x0337; L_0x02b8: r11.Y = r5; L_0x02ba: r0 = r11.l; r11.m(r0); r0 = r11.l; r10.c(r11, r0, r3); r0 = r11.S; if (r0 == 0) goto L_0x02cd; L_0x02c8: r0 = r11.l; r11.f(r0); L_0x02cd: r11.l = r7; L_0x02cf: r0 = 2; if (r12 <= r0) goto L_0x02d4; L_0x02d2: r11.k = r6; L_0x02d4: if (r12 <= r6) goto L_0x02f8; L_0x02d6: r0 = a; if (r0 == 0) goto L_0x02f2; L_0x02da: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "moveto STARTED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x02f2: r11.I(); r10.b(r11, r3); L_0x02f8: if (r12 <= r9) goto L_0x005f; L_0x02fa: r0 = a; if (r0 == 0) goto L_0x0316; L_0x02fe: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "moveto RESUMED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x0316: r11.J(); r10.c(r11, r3); r11.l = r7; r11.m = r7; goto L_0x005f; L_0x0322: r0 = r11.G; r0.a(r11); goto L_0x01b3; L_0x0329: r0 = r11.l; r11.j(r0); r11.k = r5; goto L_0x01cf; L_0x0332: r1 = move-exception; r1 = "unknown"; goto L_0x023a; L_0x0337: r5 = r3; goto L_0x02b8; L_0x0339: r11.T = r7; goto L_0x02ba; L_0x033d: r0 = r11.k; if (r0 <= r12) goto L_0x005f; L_0x0341: r0 = r11.k; switch(r0) { case 1: goto L_0x0348; case 2: goto L_0x03da; case 3: goto L_0x03b9; case 4: goto L_0x0395; case 5: goto L_0x0370; default: goto L_0x0346; }; L_0x0346: goto L_0x005f; L_0x0348: if (r12 >= r5) goto L_0x005f; L_0x034a: r0 = r10.u; if (r0 == 0) goto L_0x035e; L_0x034e: r0 = r11.X(); if (r0 == 0) goto L_0x045a; L_0x0354: r0 = r11.X(); r11.a(r7); r0.clearAnimation(); L_0x035e: r0 = r11.X(); if (r0 != 0) goto L_0x036a; L_0x0364: r0 = r11.Y(); if (r0 == 0) goto L_0x046c; L_0x036a: r11.c(r12); r12 = r5; goto L_0x005f; L_0x0370: r0 = 5; if (r12 >= r0) goto L_0x0395; L_0x0373: r0 = a; if (r0 == 0) goto L_0x038f; L_0x0377: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "movefrom RESUMED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x038f: r11.M(); r10.d(r11, r3); L_0x0395: if (r12 >= r9) goto L_0x03b9; L_0x0397: r0 = a; if (r0 == 0) goto L_0x03b3; L_0x039b: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "movefrom STARTED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x03b3: r11.N(); r10.e(r11, r3); L_0x03b9: if (r12 >= r6) goto L_0x03da; L_0x03bb: r0 = a; if (r0 == 0) goto L_0x03d7; L_0x03bf: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "movefrom STOPPED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x03d7: r11.O(); L_0x03da: r0 = 2; if (r12 >= r0) goto L_0x0348; L_0x03dd: r0 = a; if (r0 == 0) goto L_0x03f9; L_0x03e1: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "movefrom ACTIVITY_CREATED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x03f9: r0 = r11.S; if (r0 == 0) goto L_0x040c; L_0x03fd: r0 = r10.m; r0 = r0.a(r11); if (r0 == 0) goto L_0x040c; L_0x0405: r0 = r11.m; if (r0 != 0) goto L_0x040c; L_0x0409: r10.n(r11); L_0x040c: r11.P(); r10.f(r11, r3); r0 = r11.S; if (r0 == 0) goto L_0x0450; L_0x0416: r0 = r11.R; if (r0 == 0) goto L_0x0450; L_0x041a: r0 = r11.R; r1 = r11.S; r0.endViewTransition(r1); r0 = r11.S; r0.clearAnimation(); r0 = r10.l; if (r0 <= 0) goto L_0x04ae; L_0x042a: r0 = r10.u; if (r0 != 0) goto L_0x04ae; L_0x042e: r0 = r11.S; r0 = r0.getVisibility(); if (r0 != 0) goto L_0x04ae; L_0x0436: r0 = r11.aa; r1 = 0; r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1)); if (r0 < 0) goto L_0x04ae; L_0x043d: r0 = r10.a(r11, r13, r3, r14); L_0x0441: r1 = 0; r11.aa = r1; if (r0 == 0) goto L_0x0449; L_0x0446: r10.a(r11, r0, r12); L_0x0449: r0 = r11.R; r1 = r11.S; r0.removeView(r1); L_0x0450: r11.R = r7; r11.S = r7; r11.T = r7; r11.x = r3; goto L_0x0348; L_0x045a: r0 = r11.Y(); if (r0 == 0) goto L_0x035e; L_0x0460: r0 = r11.Y(); r11.a(r7); r0.cancel(); goto L_0x035e; L_0x046c: r0 = a; if (r0 == 0) goto L_0x0488; L_0x0470: r0 = "FragmentManager"; r1 = new java.lang.StringBuilder; r1.<init>(); r2 = "movefrom CREATED: "; r1 = r1.append(r2); r1 = r1.append(r11); r1 = r1.toString(); android.util.Log.v(r0, r1); L_0x0488: r0 = r11.N; if (r0 != 0) goto L_0x04a3; L_0x048c: r11.Q(); r10.g(r11, r3); L_0x0492: r11.R(); r10.h(r11, r3); if (r15 != 0) goto L_0x005f; L_0x049a: r0 = r11.N; if (r0 != 0) goto L_0x04a6; L_0x049e: r10.h(r11); goto L_0x005f; L_0x04a3: r11.k = r3; goto L_0x0492; L_0x04a6: r11.C = r7; r11.G = r7; r11.B = r7; goto L_0x005f; L_0x04ae: r0 = r7; goto L_0x0441; L_0x04b0: r0 = r7; goto L_0x026f; */ throw new UnsupportedOperationException("Method not decompiled: android.support.v4.app.FragmentManagerImpl.a(android.support.v4.app.Fragment, int, int, int, boolean):void"); } void a(Fragment fragment, Context context, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).a(fragment, context, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).a((FragmentManager) this, fragment, context); } } } void a(Fragment fragment, Bundle bundle, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).a(fragment, bundle, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).a((FragmentManager) this, fragment, bundle); } } } void a(Fragment fragment, View view, Bundle bundle, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).a(fragment, view, bundle, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).a(this, fragment, view, bundle); } } } public void a(Fragment fragment, boolean z) { if (a) { Log.v("FragmentManager", "add: " + fragment); } g(fragment); if (!fragment.L) { if (this.e.contains(fragment)) { throw new IllegalStateException("Fragment already added: " + fragment); } synchronized (this.e) { this.e.add(fragment); } fragment.u = true; fragment.v = false; if (fragment.S == null) { fragment.Z = false; } if (fragment.O && fragment.P) { this.r = true; } if (z) { c(fragment); } } } public void a(OpGenerator opGenerator, boolean z) { if (!z) { B(); } synchronized (this) { if (!this.u && this.m != null) { if (this.b == null) { this.b = new ArrayList(); } this.b.add(opGenerator); C(); } else if (z) { } else { throw new IllegalStateException("Activity has been destroyed"); } } } public void a(o oVar, m mVar, Fragment fragment) { if (this.m != null) { throw new IllegalStateException("Already attached"); } this.m = oVar; this.n = mVar; this.o = fragment; } public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) { int size; int i; Fragment fragment; d dVar; int i2 = 0; String str2 = str + " "; if (this.f != null) { size = this.f.size(); if (size > 0) { printWriter.print(str); printWriter.print("Active Fragments in "); printWriter.print(Integer.toHexString(System.identityHashCode(this))); printWriter.println(":"); for (i = 0; i < size; i++) { fragment = (Fragment) this.f.valueAt(i); printWriter.print(str); printWriter.print(" #"); printWriter.print(i); printWriter.print(": "); printWriter.println(fragment); if (fragment != null) { fragment.a(str2, fileDescriptor, printWriter, strArr); } } } } size = this.e.size(); if (size > 0) { printWriter.print(str); printWriter.println("Added Fragments:"); for (i = 0; i < size; i++) { fragment = (Fragment) this.e.get(i); printWriter.print(str); printWriter.print(" #"); printWriter.print(i); printWriter.print(": "); printWriter.println(fragment.toString()); } } if (this.h != null) { size = this.h.size(); if (size > 0) { printWriter.print(str); printWriter.println("Fragments Created Menus:"); for (i = 0; i < size; i++) { fragment = (Fragment) this.h.get(i); printWriter.print(str); printWriter.print(" #"); printWriter.print(i); printWriter.print(": "); printWriter.println(fragment.toString()); } } } if (this.g != null) { size = this.g.size(); if (size > 0) { printWriter.print(str); printWriter.println("Back Stack:"); for (i = 0; i < size; i++) { dVar = (d) this.g.get(i); printWriter.print(str); printWriter.print(" #"); printWriter.print(i); printWriter.print(": "); printWriter.println(dVar.toString()); dVar.a(str2, fileDescriptor, printWriter, strArr); } } } synchronized (this) { if (this.i != null) { int size2 = this.i.size(); if (size2 > 0) { printWriter.print(str); printWriter.println("Back Stack Indices:"); for (i = 0; i < size2; i++) { dVar = (d) this.i.get(i); printWriter.print(str); printWriter.print(" #"); printWriter.print(i); printWriter.print(": "); printWriter.println(dVar); } } } if (this.j != null && this.j.size() > 0) { printWriter.print(str); printWriter.print("mAvailBackStackIndices: "); printWriter.println(Arrays.toString(this.j.toArray())); } } if (this.b != null) { i = this.b.size(); if (i > 0) { printWriter.print(str); printWriter.println("Pending Actions:"); while (i2 < i) { OpGenerator opGenerator = (OpGenerator) this.b.get(i2); printWriter.print(str); printWriter.print(" #"); printWriter.print(i2); printWriter.print(": "); printWriter.println(opGenerator); i2++; } } } printWriter.print(str); printWriter.println("FragmentManager misc state:"); printWriter.print(str); printWriter.print(" mHost="); printWriter.println(this.m); printWriter.print(str); printWriter.print(" mContainer="); printWriter.println(this.n); if (this.o != null) { printWriter.print(str); printWriter.print(" mParent="); printWriter.println(this.o); } printWriter.print(str); printWriter.print(" mCurState="); printWriter.print(this.l); printWriter.print(" mStateSaved="); printWriter.print(this.s); printWriter.print(" mStopped="); printWriter.print(this.t); printWriter.print(" mDestroyed="); printWriter.println(this.u); if (this.r) { printWriter.print(str); printWriter.print(" mNeedMenuInvalidate="); printWriter.println(this.r); } if (this.v != null) { printWriter.print(str); printWriter.print(" mNoTransactionsBecause="); printWriter.println(this.v); } } public void a(boolean z) { for (int size = this.e.size() - 1; size >= 0; size--) { Fragment fragment = (Fragment) this.e.get(size); if (fragment != null) { fragment.i(z); } } } boolean a(int i) { return this.l >= i; } public boolean a(Menu menu) { boolean z = false; if (this.l < 1) { return false; } int i = 0; while (true) { boolean z2 = z; if (i >= this.e.size()) { return z2; } Fragment fragment = (Fragment) this.e.get(i); if (fragment != null && fragment.c(menu)) { int i2 = 1; } z = i + 1; } } public boolean a(Menu menu, MenuInflater menuInflater) { int i = 0; if (this.l < 1) { return false; } Fragment fragment; ArrayList arrayList = null; int i2 = 0; boolean z = false; while (i2 < this.e.size()) { boolean z2; fragment = (Fragment) this.e.get(i2); if (fragment == null || !fragment.b(menu, menuInflater)) { z2 = z; } else { if (arrayList == null) { arrayList = new ArrayList(); } arrayList.add(fragment); z2 = true; } i2++; z = z2; } if (this.h != null) { while (i < this.h.size()) { fragment = (Fragment) this.h.get(i); if (arrayList == null || !arrayList.contains(fragment)) { fragment.x(); } i++; } } this.h = arrayList; return z; } public boolean a(MenuItem menuItem) { if (this.l < 1) { return false; } for (int i = 0; i < this.e.size(); i++) { Fragment fragment = (Fragment) this.e.get(i); if (fragment != null && fragment.c(menuItem)) { return true; } } return false; } boolean a(ArrayList<d> arrayList, ArrayList<Boolean> arrayList2, String str, int i, int i2) { if (this.g == null) { return false; } int size; if (str == null && i < 0 && (i2 & 1) == 0) { size = this.g.size() - 1; if (size < 0) { return false; } arrayList.add(this.g.remove(size)); arrayList2.add(Boolean.valueOf(true)); } else { int size2; size = -1; if (str != null || i >= 0) { d dVar; size2 = this.g.size() - 1; while (size2 >= 0) { dVar = (d) this.g.get(size2); if ((str != null && str.equals(dVar.getName())) || (i >= 0 && i == dVar.m)) { break; } size2--; } if (size2 < 0) { return false; } if ((i2 & 1) != 0) { size2--; while (size2 >= 0) { dVar = (d) this.g.get(size2); if ((str == null || !str.equals(dVar.getName())) && (i < 0 || i != dVar.m)) { break; } size2--; } } size = size2; } if (size == this.g.size() - 1) { return false; } for (size2 = this.g.size() - 1; size2 > size; size2--) { arrayList.add(this.g.remove(size2)); arrayList2.add(Boolean.valueOf(true)); } } return true; } public Fragment b(int i) { int size; Fragment fragment; for (size = this.e.size() - 1; size >= 0; size--) { fragment = (Fragment) this.e.get(size); if (fragment != null && fragment.H == i) { return fragment; } } if (this.f != null) { for (size = this.f.size() - 1; size >= 0; size--) { fragment = (Fragment) this.f.valueAt(size); if (fragment != null && fragment.H == i) { return fragment; } } } return null; } public Fragment b(String str) { if (!(this.f == null || str == null)) { for (int size = this.f.size() - 1; size >= 0; size--) { Fragment fragment = (Fragment) this.f.valueAt(size); if (fragment != null) { fragment = fragment.a(str); if (fragment != null) { return fragment; } } } } return null; } public void b(Fragment fragment) { if (!fragment.U) { return; } if (this.c) { this.w = true; return; } fragment.U = false; a(fragment, this.l, 0, 0, false); } void b(Fragment fragment, Context context, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).b(fragment, context, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).b((FragmentManager) this, fragment, context); } } } void b(Fragment fragment, Bundle bundle, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).b(fragment, bundle, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).b((FragmentManager) this, fragment, bundle); } } } void b(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).b(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).a(this, fragment); } } } public void b(OpGenerator opGenerator, boolean z) { if (!z || (this.m != null && !this.u)) { c(z); if (opGenerator.generateOps(this.x, this.y)) { this.c = true; try { b(this.x, this.y); } finally { D(); } } j(); G(); } } void b(d dVar) { if (this.g == null) { this.g = new ArrayList(); } this.g.add(dVar); } public void b(Menu menu) { if (this.l >= 1) { int i = 0; while (true) { int i2 = i; if (i2 < this.e.size()) { Fragment fragment = (Fragment) this.e.get(i2); if (fragment != null) { fragment.d(menu); } i = i2 + 1; } else { return; } } } } public void b(boolean z) { for (int size = this.e.size() - 1; size >= 0; size--) { Fragment fragment = (Fragment) this.e.get(size); if (fragment != null) { fragment.j(z); } } } public boolean b() { boolean i = i(); E(); return i; } public boolean b(MenuItem menuItem) { if (this.l < 1) { return false; } for (int i = 0; i < this.e.size(); i++) { Fragment fragment = (Fragment) this.e.get(i); if (fragment != null && fragment.d(menuItem)) { return true; } } return false; } public void c() { a(new w(this, null, -1, 0), false); } public void c(int i) { synchronized (this) { this.i.set(i, null); if (this.j == null) { this.j = new ArrayList(); } if (a) { Log.v("FragmentManager", "Freeing back stack index " + i); } this.j.add(Integer.valueOf(i)); } } void c(Fragment fragment) { a(fragment, this.l, 0, 0, false); } void c(Fragment fragment, Bundle bundle, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).c(fragment, bundle, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).c(this, fragment, bundle); } } } void c(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).c(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).b(this, fragment); } } } void d(Fragment fragment) { if (fragment.w && !fragment.z) { fragment.S = fragment.b(fragment.h(fragment.l), null, fragment.l); if (fragment.S != null) { fragment.T = fragment.S; fragment.S.setSaveFromParentEnabled(false); if (fragment.K) { fragment.S.setVisibility(8); } fragment.a(fragment.S, fragment.l); a(fragment, fragment.S, fragment.l, false); return; } fragment.T = null; } } void d(Fragment fragment, Bundle bundle, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).d(fragment, bundle, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).d(this, fragment, bundle); } } } void d(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).d(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).c(this, fragment); } } } public boolean d() { B(); return a(null, -1, 0); } public int e() { return this.g != null ? this.g.size() : 0; } void e(final Fragment fragment) { if (fragment.S != null) { s a = a(fragment, fragment.T(), !fragment.K, fragment.U()); if (a == null || a.b == null) { if (a != null) { b(fragment.S, a); fragment.S.startAnimation(a.a); a.a.start(); } int i = (!fragment.K || fragment.ab()) ? 0 : 8; fragment.S.setVisibility(i); if (fragment.ab()) { fragment.k(false); } } else { a.b.setTarget(fragment.S); if (!fragment.K) { fragment.S.setVisibility(0); } else if (fragment.ab()) { fragment.k(false); } else { final ViewGroup viewGroup = fragment.R; final View view = fragment.S; viewGroup.startViewTransition(view); a.b.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animator) { viewGroup.endViewTransition(view); animator.removeListener(this); if (fragment.S != null) { fragment.S.setVisibility(8); } } }); } b(fragment.S, a); a.b.start(); } } if (fragment.u && fragment.O && fragment.P) { this.r = true; } fragment.Z = false; fragment.c(fragment.K); } void e(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).e(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).d(this, fragment); } } } public List<Fragment> f() { if (this.e.isEmpty()) { return Collections.EMPTY_LIST; } List<Fragment> list; synchronized (this.e) { list = (List) this.e.clone(); } return list; } void f(Fragment fragment) { if (fragment != null) { int i = this.l; if (fragment.v) { i = fragment.f() ? Math.min(i, 1) : Math.min(i, 0); } a(fragment, i, fragment.T(), fragment.U(), false); if (fragment.S != null) { Fragment q = q(fragment); if (q != null) { View view = q.S; ViewGroup viewGroup = fragment.R; int indexOfChild = viewGroup.indexOfChild(view); i = viewGroup.indexOfChild(fragment.S); if (i < indexOfChild) { viewGroup.removeViewAt(i); viewGroup.addView(fragment.S, indexOfChild); } } if (fragment.Y && fragment.R != null) { if (fragment.aa > 0.0f) { fragment.S.setAlpha(fragment.aa); } fragment.aa = 0.0f; fragment.Y = false; s a = a(fragment, fragment.T(), true, fragment.U()); if (a != null) { b(fragment.S, a); if (a.a != null) { fragment.S.startAnimation(a.a); } else { a.b.setTarget(fragment.S); a.b.start(); } } } } if (fragment.Z) { e(fragment); } } } void f(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).f(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).e(this, fragment); } } } void g(Fragment fragment) { if (fragment.o < 0) { int i = this.d; this.d = i + 1; fragment.a(i, this.o); if (this.f == null) { this.f = new SparseArray(); } this.f.put(fragment.o, fragment); if (a) { Log.v("FragmentManager", "Allocated fragment index " + fragment); } } } void g(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).g(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).f(this, fragment); } } } public boolean g() { return this.s || this.t; } void h() { if (this.f != null) { int i = 0; while (true) { int i2 = i; if (i2 < this.f.size()) { Fragment fragment = (Fragment) this.f.valueAt(i2); if (fragment != null) { b(fragment); } i = i2 + 1; } else { return; } } } } void h(Fragment fragment) { if (fragment.o >= 0) { if (a) { Log.v("FragmentManager", "Freeing fragment index " + fragment); } this.f.put(fragment.o, null); fragment.w(); } } void h(Fragment fragment, boolean z) { if (this.o != null) { FragmentManager l = this.o.l(); if (l instanceof FragmentManagerImpl) { ((FragmentManagerImpl) l).h(fragment, true); } } Iterator it = this.J.iterator(); while (it.hasNext()) { o oVar = (o) it.next(); if (!z || ((Boolean) oVar.b).booleanValue()) { ((p) oVar.a).g(this, fragment); } } } public void i(Fragment fragment) { if (a) { Log.v("FragmentManager", "remove: " + fragment + " nesting=" + fragment.A); } boolean z = !fragment.f(); if (!fragment.L || z) { synchronized (this.e) { this.e.remove(fragment); } if (fragment.O && fragment.P) { this.r = true; } fragment.u = false; fragment.v = true; } } public boolean i() { c(true); boolean z = false; while (c(this.x, this.y)) { this.c = true; try { b(this.x, this.y); D(); z = true; } catch (Throwable th) { D(); throw th; } } j(); G(); return z; } void j() { if (this.w) { this.w = false; h(); } } public void j(Fragment fragment) { boolean z = true; if (a) { Log.v("FragmentManager", "hide: " + fragment); } if (!fragment.K) { fragment.K = true; if (fragment.Z) { z = false; } fragment.Z = z; } } void k() { if (this.k != null) { int i = 0; while (true) { int i2 = i; if (i2 < this.k.size()) { ((OnBackStackChangedListener) this.k.get(i2)).onBackStackChanged(); i = i2 + 1; } else { return; } } } } public void k(Fragment fragment) { boolean z = false; if (a) { Log.v("FragmentManager", "show: " + fragment); } if (fragment.K) { fragment.K = false; if (!fragment.Z) { z = true; } fragment.Z = z; } } y l() { a(this.D); return this.D; } public void l(Fragment fragment) { if (a) { Log.v("FragmentManager", "detach: " + fragment); } if (!fragment.L) { fragment.L = true; if (fragment.u) { if (a) { Log.v("FragmentManager", "remove from detach: " + fragment); } synchronized (this.e) { this.e.remove(fragment); } if (fragment.O && fragment.P) { this.r = true; } fragment.u = false; } } } void m() { List list; List list2; List list3; if (this.f != null) { int i = 0; list = null; list2 = null; list3 = null; while (i < this.f.size()) { ArrayList arrayList; ArrayList arrayList2; ArrayList arrayList3; Fragment fragment = (Fragment) this.f.valueAt(i); if (fragment != null) { Object obj; int i2; if (fragment.M) { if (list3 == null) { arrayList = new ArrayList(); } arrayList.add(fragment); fragment.s = fragment.r != null ? fragment.r.o : -1; if (a) { Log.v("FragmentManager", "retainNonConfig: keeping retained " + fragment); } } if (fragment.D != null) { fragment.D.m(); obj = fragment.D.D; } else { y obj2 = fragment.E; } if (list2 == null && obj2 != null) { arrayList2 = new ArrayList(this.f.size()); for (i2 = 0; i2 < i; i2++) { arrayList2.add(null); } } if (arrayList2 != null) { arrayList2.add(obj2); } if (list == null && fragment.F != null) { arrayList3 = new ArrayList(this.f.size()); for (i2 = 0; i2 < i; i2++) { arrayList3.add(null); } } if (arrayList3 != null) { arrayList3.add(fragment.F); } } ArrayList arrayList4 = arrayList3; i++; Object list32 = arrayList; Object list22 = arrayList2; Object list4 = arrayList4; } } else { list4 = null; list22 = null; list32 = null; } if (list32 == null && list22 == null && list4 == null) { this.D = null; } else { this.D = new y(list32, list22, list4); } } public void m(Fragment fragment) { if (a) { Log.v("FragmentManager", "attach: " + fragment); } if (fragment.L) { fragment.L = false; if (!fragment.u) { if (this.e.contains(fragment)) { throw new IllegalStateException("Fragment already added: " + fragment); } if (a) { Log.v("FragmentManager", "add from attach: " + fragment); } synchronized (this.e) { this.e.add(fragment); } fragment.u = true; if (fragment.O && fragment.P) { this.r = true; } } } } Parcelable n() { BackStackState[] backStackStateArr = null; E(); F(); i(); this.s = true; this.D = null; if (this.f == null || this.f.size() <= 0) { return null; } int size = this.f.size(); FragmentState[] fragmentStateArr = new FragmentState[size]; int i = 0; boolean z = false; while (i < size) { boolean z2; Fragment fragment = (Fragment) this.f.valueAt(i); if (fragment != null) { if (fragment.o < 0) { a(new IllegalStateException("Failure saving state: active " + fragment + " has cleared index: " + fragment.o)); } FragmentState fragmentState = new FragmentState(fragment); fragmentStateArr[i] = fragmentState; if (fragment.k <= 0 || fragmentState.k != null) { fragmentState.k = fragment.l; } else { fragmentState.k = o(fragment); if (fragment.r != null) { if (fragment.r.o < 0) { a(new IllegalStateException("Failure saving state: " + fragment + " has target not in fragment manager: " + fragment.r)); } if (fragmentState.k == null) { fragmentState.k = new Bundle(); } a(fragmentState.k, "android:target_state", fragment.r); if (fragment.t != 0) { fragmentState.k.putInt("android:target_req_state", fragment.t); } } } if (a) { Log.v("FragmentManager", "Saved state of " + fragment + ": " + fragmentState.k); } z2 = true; } else { z2 = z; } i++; z = z2; } if (z) { int[] iArr; int i2; i = this.e.size(); if (i > 0) { iArr = new int[i]; for (i2 = 0; i2 < i; i2++) { iArr[i2] = ((Fragment) this.e.get(i2)).o; if (iArr[i2] < 0) { a(new IllegalStateException("Failure saving state: active " + this.e.get(i2) + " has cleared index: " + iArr[i2])); } if (a) { Log.v("FragmentManager", "saveAllState: adding fragment #" + i2 + ": " + this.e.get(i2)); } } } else { iArr = null; } if (this.g != null) { i = this.g.size(); if (i > 0) { backStackStateArr = new BackStackState[i]; for (i2 = 0; i2 < i; i2++) { backStackStateArr[i2] = new BackStackState((d) this.g.get(i2)); if (a) { Log.v("FragmentManager", "saveAllState: adding back stack #" + i2 + ": " + this.g.get(i2)); } } } } FragmentManagerState fragmentManagerState = new FragmentManagerState(); fragmentManagerState.a = fragmentStateArr; fragmentManagerState.b = iArr; fragmentManagerState.c = backStackStateArr; if (this.p != null) { fragmentManagerState.d = this.p.o; } fragmentManagerState.e = this.d; m(); return fragmentManagerState; } else if (!a) { return null; } else { Log.v("FragmentManager", "saveAllState: no fragments!"); return null; } } void n(Fragment fragment) { if (fragment.T != null) { if (this.B == null) { this.B = new SparseArray(); } else { this.B.clear(); } fragment.T.saveHierarchyState(this.B); if (this.B.size() > 0) { fragment.m = this.B; this.B = null; } } } Bundle o(Fragment fragment) { Bundle bundle; if (this.A == null) { this.A = new Bundle(); } fragment.n(this.A); d(fragment, this.A, false); if (this.A.isEmpty()) { bundle = null; } else { bundle = this.A; this.A = null; } if (fragment.S != null) { n(fragment); } if (fragment.m != null) { if (bundle == null) { bundle = new Bundle(); } bundle.putSparseParcelableArray("android:view_state", fragment.m); } if (!fragment.V) { if (bundle == null) { bundle = new Bundle(); } bundle.putBoolean("android:user_visible_hint", fragment.V); } return bundle; } public void o() { this.D = null; this.s = false; this.t = false; int size = this.e.size(); for (int i = 0; i < size; i++) { Fragment fragment = (Fragment) this.e.get(i); if (fragment != null) { fragment.K(); } } } public View onCreateView(View view, String str, Context context, AttributeSet attributeSet) { if (!"fragment".equals(str)) { return null; } String attributeValue = attributeSet.getAttributeValue(null, "class"); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, v.a); String string = attributeValue == null ? obtainStyledAttributes.getString(0) : attributeValue; int resourceId = obtainStyledAttributes.getResourceId(1, -1); String string2 = obtainStyledAttributes.getString(2); obtainStyledAttributes.recycle(); if (!Fragment.a(this.m.g(), string)) { return null; } int id = view != null ? view.getId() : 0; if (id == -1 && resourceId == -1 && string2 == null) { throw new IllegalArgumentException(attributeSet.getPositionDescription() + ": Must specify unique android:id, android:tag, or have a parent with an id for " + string); } Fragment fragment; Fragment b = resourceId != -1 ? b(resourceId) : null; if (b == null && string2 != null) { b = a(string2); } if (b == null && id != -1) { b = b(id); } if (a) { Log.v("FragmentManager", "onCreateView: id=0x" + Integer.toHexString(resourceId) + " fname=" + string + " existing=" + b); } if (b == null) { Fragment a = this.n.a(context, string, null); a.w = true; a.H = resourceId != 0 ? resourceId : id; a.I = id; a.J = string2; a.x = true; a.B = this; a.C = this.m; a.a(this.m.g(), attributeSet, a.l); a(a, true); fragment = a; } else if (b.x) { throw new IllegalArgumentException(attributeSet.getPositionDescription() + ": Duplicate id 0x" + Integer.toHexString(resourceId) + ", tag " + string2 + ", or parent id 0x" + Integer.toHexString(id) + " with another fragment for " + string); } else { b.x = true; b.C = this.m; if (!b.N) { b.a(this.m.g(), attributeSet, b.l); } fragment = b; } if (this.l >= 1 || !fragment.w) { c(fragment); } else { a(fragment, 1, 0, 0, false); } if (fragment.S == null) { throw new IllegalStateException("Fragment " + string + " did not create a view."); } if (resourceId != 0) { fragment.S.setId(resourceId); } if (fragment.S.getTag() == null) { fragment.S.setTag(string2); } return fragment.S; } public View onCreateView(String str, Context context, AttributeSet attributeSet) { return onCreateView(null, str, context, attributeSet); } public void p() { this.s = false; this.t = false; e(1); } public void p(Fragment fragment) { if (fragment == null || (this.f.get(fragment.o) == fragment && (fragment.C == null || fragment.l() == this))) { this.p = fragment; return; } throw new IllegalArgumentException("Fragment " + fragment + " is not an active fragment of FragmentManager " + this); } public void q() { this.s = false; this.t = false; e(2); } public void r() { this.s = false; this.t = false; e(4); } public void s() { this.s = false; this.t = false; e(5); } public void t() { e(4); } public String toString() { StringBuilder stringBuilder = new StringBuilder(128); stringBuilder.append("FragmentManager{"); stringBuilder.append(Integer.toHexString(System.identityHashCode(this))); stringBuilder.append(" in "); if (this.o != null) { d.a(this.o, stringBuilder); } else { d.a(this.m, stringBuilder); } stringBuilder.append("}}"); return stringBuilder.toString(); } public void u() { this.t = true; e(3); } public void v() { e(2); } public void w() { e(1); } public void x() { this.u = true; i(); e(0); this.m = null; this.n = null; this.o = null; } public void y() { int i = 0; while (true) { int i2 = i; if (i2 < this.e.size()) { Fragment fragment = (Fragment) this.e.get(i2); if (fragment != null) { fragment.L(); } i = i2 + 1; } else { return; } } } public Fragment z() { return this.p; } }
[ "khairilirfanlbs@gmail.com" ]
khairilirfanlbs@gmail.com
24388b18aab27a60c611ce2bbe4eaaf6508f366e
88bbf49683310b2e37d0faa7ef763a8025954681
/app/src/main/java/comhs/fundationdev/hairstyle/database/repository/tabelas/ServiceTable.java
ecef07b6899eae8e1a397a0f2a3b9751b5c8fdf5
[]
no_license
lks-rst/HairStyle
0daab50c3b067480d5e82d550d585279382a200e
e9936e967ed22e7d5fc98756121d1e210b7f3fa7
refs/heads/master
2021-01-10T07:36:18.397486
2016-02-19T11:42:04
2016-02-19T11:42:04
51,089,308
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package comhs.fundationdev.hairstyle.database.repository.tabelas; /** * Created by lucas on 09/02/16. */ public class ServiceTable { public static final String NOME_TABELA = ""; public static String criaTabela(){ StringBuilder sb = new StringBuilder(); sb.append("CREATE TABLE "); sb.append(NOME_TABELA); sb.append(");"); return sb.toString(); } }
[ "lks_rst@hotmail.com" ]
lks_rst@hotmail.com
12f048a90f8719599f4780bccee8f0a6041767ae
f2d1f0fc71635dbeb91c40155b4c845a2cf5b666
/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java
868a28f94feb57d02022dff54c6f90a551eb9351
[ "Apache-2.0" ]
permissive
apache/geronimo-gshell
ab845bca920dae4a17dbc063bded5e9018f2e4cc
51c982761777b2ce2fbf0b18ab642a5cf0c169eb
refs/heads/trunk
2023-08-22T08:13:09.429103
2009-06-24T10:24:03
2009-06-24T10:24:03
240,470
10
13
Apache-2.0
2023-08-21T20:40:07
2009-07-01T08:14:25
Java
UTF-8
Java
false
false
1,073
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.geronimo.gshell.command; import jline.Completor; import java.util.Collection; /** * Provides completion support for a command. * * @version $Rev$ $Date$ */ public interface CommandCompleter { Collection<Completor> createCompletors(); }
[ "jdillon@apache.org" ]
jdillon@apache.org
31698594e8531de2629fa2a1828fc036db13cbb2
55d2031d3ab767ffdec6ad1197d9792b05a4ef2f
/src/javaexample3/JavaExample3.java
c50de7f79a082a9849420c416ef5a757942341da
[]
no_license
JackHilon/JavaExample3
9f12d09757da121e953dafac3e3503a4dc9d6342
8610df88527c85a6672d08ced42347450edfeabf
refs/heads/master
2023-05-27T16:59:19.799282
2021-06-13T07:24:09
2021-06-13T07:24:09
376,469,368
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package javaexample3; import MyUtilities.InputHelper; public class JavaExample3 { public static void main(String[] args) { String myInput= InputHelper.GetInput("Enter the input: "); System.out.println("The output is: "+myInput); } }
[ "markandmark1111@gmail.com" ]
markandmark1111@gmail.com
8bad80a9c0630ff59b4f1131a2ab0e8dadc4d219
42c3474169378a5337fd2f3a13224776b4f1cb91
/src/main/java/cybersoft/java12/springdemo/dbconnection/MySqlConnection.java
8629b51f69cfe44d04f88d5f48b4c3a14c814049
[]
no_license
TristanNgo/springdemo-hv
bf63e17bde86b181a229212997c5ebbb9b174608
c0861fa49bebd659e4c08881859ba1804d65c990
refs/heads/main
2023-06-17T08:39:52.052734
2021-07-18T08:50:15
2021-07-18T08:50:15
387,131,196
0
0
null
null
null
null
UTF-8
Java
false
false
277
java
package cybersoft.java12.springdemo.dbconnection; import cybersoft.java12.springdemo.dbconnection.DbDataSource; public class MySqlConnection implements DatabaseConnection { @Override public void getConnection(DbDataSource dts) { // TODO Auto-generated method stub } }
[ "ngotrungtin123456789@gmail.com" ]
ngotrungtin123456789@gmail.com
d0155ec08d8ec9570840f4b78d01c87a17a3962f
a0361b4d6c42b001490d855d2f3aaa553e866c66
/src/test/java/lesson1/tests/selenium/AuthorizationInEmptyCartTest.java
ed100592e56d11ffb7ff73e62445cb796cf15dfa
[]
no_license
ferras777/UI_Test
800561390ac20d1f4540085e4a1af82f51295d86
0f4b62440746cabd1d71514ed9f6d4820f558ae0
refs/heads/master
2023-05-12T13:42:21.262240
2020-11-10T14:07:37
2020-11-10T14:07:37
283,298,811
1
0
null
2023-05-09T18:49:59
2020-07-28T18:44:31
Java
UTF-8
Java
false
false
2,070
java
package lesson1.tests.selenium; import pages.seleniumPages.Advertisement; import pages.seleniumPages.Authorization; import pages.seleniumPages.Cart; import pages.seleniumPages.MainPage; import test.SeleniumBase; import test.enums.Credentials; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.support.PageFactory; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static test.enums.Urls.SITE; public class AuthorizationInEmptyCartTest extends SeleniumBase { private Authorization authorization; private Advertisement advertisement; private Cart cart; private MainPage mainPage; @BeforeMethod public void beforeMethod() { authorization = PageFactory.initElements(driver, Authorization.class); advertisement = PageFactory.initElements(driver, Advertisement.class); cart = PageFactory.initElements(driver, Cart.class); mainPage = PageFactory.initElements(driver, MainPage.class); } @AfterMethod public void afterMethod() { driver.close(); } @Test public void authorizationInEmptyCart() { // Navigate site driver.navigate().to(SITE.getUrl()); // Close advertisement advertisement.closeAdvertisementLayer(); // Click on cart mainPage.clickOnCartButton(); // Delete item in cart cart.deleteAllItemsInCart(); // Click on authorization link cart.clickOnAuthorizationLink(); try { // Enter login authorization.fillLoginField(Credentials.TEST_ACCOUNT_NEW_USER); // Enter password authorization.fillPasswordField(Credentials.TEST_ACCOUNT_NEW_USER); } catch (NoSuchElementException e) { System.out.println("Registration not required"); } // 5. Click enter button authorization.clickOnEnterButton(); // 6. Click on authorization link cart.clickOnAuthorizationLink(); } }
[ "ferras2007@yandex.ru" ]
ferras2007@yandex.ru
948ad9ae002c357865ca1549c63d179f1ce125df
4a0f35bb33fa5457340e9a69844993de28db5f89
/src/main/java/com/ediary/controllers/TeacherGradeScreenController.java
8ef8b024d82c0a6462063340a74e6ef11792aea4
[]
no_license
R3dner/E-dziennik
00a7dbfe5d9608a12e396a113b1a1fa0529be094
887ab703fd976dfc4851ea81c88d3641f08f41e3
refs/heads/master
2022-12-31T02:14:36.871478
2020-06-15T21:34:06
2020-06-15T21:34:06
272,546,210
0
0
null
2020-10-13T22:49:36
2020-06-15T21:18:34
HTML
UTF-8
Java
false
false
5,606
java
package com.ediary.controllers; import com.ediary.modelFx.*; import com.sun.javafx.css.converters.StringConverter; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.TextFieldTableCell; public class TeacherGradeScreenController { private GradeModel gradeModel; private SubjectModel subjectModel; private TeacherModel teacherModel; @FXML private ComboBox<SubjectFx> subjectComboBox; @FXML private Button deleteGradeButton; @FXML private TableView<GradeFx> tableView; @FXML private TableColumn<GradeFx, Number> gradeColumn; @FXML private TableColumn<GradeFx, SubjectFx> subjectColumn; @FXML private TableColumn<GradeFx, String> descColumn; @FXML private TableColumn<GradeFx, String> dateColumn; @FXML private TableColumn<GradeFx, TeacherFx> teacherColumn; @FXML public void displayAllGrades(){ gradeModel.initGradesForLoggedTeacher(teacherModel.getLoggedTeacher()); addGradesToTableView(); } @FXML public void initialize() { gradeModel = new GradeModel(); subjectModel = new SubjectModel(); teacherModel = new TeacherModel(); //ładowanie przedmiotów i comboBoxa subjectModel.initSubjects(); subjectComboBox.getItems().setAll(subjectModel.getSubjectFxList()); //ładowanie ocen dla nauczyciela gradeModel.initGradesForLoggedTeacher(teacherModel.getLoggedTeacher()); //table view addGradesToTableView(); //listener do combobox - przedmioty subjectComboBox.getSelectionModel().selectedItemProperty().addListener((v,oldValue,newValue)-> { gradeModel.subjectFxObjectPropertyProperty().bind(this.subjectComboBox.valueProperty()); gradeModel.initGradesBySubjectForTeacher(teacherModel.getLoggedTeacher()); addGradesToTableView(); }); //listener do przycisku usuwania ocen this.deleteGradeButton.disableProperty().bind(this.gradeModel.gradeFxFxObjectPropertyProperty().isNull()); tableView.getSelectionModel().selectedItemProperty().addListener((v,oldValue,newValue)-> { gradeModel.gradeFxFxObjectPropertyProperty().bind(this.tableView.getSelectionModel().selectedItemProperty()); }); } public void addGradesToTableView() { this.tableView.setItems(this.gradeModel.getFilteredGradeFxObservableList()); this.gradeColumn.setCellValueFactory(cellData -> cellData.getValue().gradeProperty()); this.subjectColumn.setCellValueFactory(cellData -> cellData.getValue().subjectFxProperty()); this.descColumn.setCellValueFactory(cellData -> cellData.getValue().descProperty()); this.dateColumn.setCellValueFactory(cellData -> cellData.getValue().addedDateProperty()); this.teacherColumn.setCellValueFactory(cellData -> cellData.getValue().teacherFxProperty()); } @FXML public void deleteGrade() { //gradeModel.setGradeFxFxObjectProperty(this.tableView.getSelectionModel().getSelectedItem()); gradeModel.deleteGradeById(); } //for tests ComboBox<SubjectFx> getSubjectComboBox() { return subjectComboBox; } void setSubjectComboBox(ComboBox<SubjectFx> subjectComboBox) { this.subjectComboBox = subjectComboBox; } Button getDeleteGradeButton() { return deleteGradeButton; } void setDeleteGradeButton(Button deleteGradeButton) { this.deleteGradeButton = deleteGradeButton; } TableView<GradeFx> getTableView() { return tableView; } void setTableView(TableView<GradeFx> tableView) { this.tableView = tableView; } TableColumn<GradeFx, Number> getGradeColumn() { return gradeColumn; } void setGradeColumn(TableColumn<GradeFx, Number> gradeColumn) { this.gradeColumn = gradeColumn; } TableColumn<GradeFx, SubjectFx> getSubjectColumn() { return subjectColumn; } void setSubjectColumn(TableColumn<GradeFx, SubjectFx> subjectColumn) { this.subjectColumn = subjectColumn; } TableColumn<GradeFx, String> getDescColumn() { return descColumn; } void setDescColumn(TableColumn<GradeFx, String> descColumn) { this.descColumn = descColumn; } TableColumn<GradeFx, String> getDateColumn() { return dateColumn; } void setDateColumn(TableColumn<GradeFx, String> dateColumn) { this.dateColumn = dateColumn; } TableColumn<GradeFx, TeacherFx> getTeacherColumn() { return teacherColumn; } void setTeacherColumn(TableColumn<GradeFx, TeacherFx> teacherColumn) { this.teacherColumn = teacherColumn; } GradeModel getGradeModel() { return gradeModel; } void setGradeModel(GradeModel gradeModel) { this.gradeModel = gradeModel; } SubjectModel getSubjectModel() { return subjectModel; } void setSubjectModel(SubjectModel subjectModel) { this.subjectModel = subjectModel; } TeacherModel getTeacherModel() { return teacherModel; } void setTeacherModel(TeacherModel teacherModel) { this.teacherModel = teacherModel; } }
[ "noreply@github.com" ]
R3dner.noreply@github.com
bae172f2e0af631783b5e96de80b6f76e6cc8e57
170aa185f2a73db01780437e2ddbcd50401d6759
/resource-service/src/main/java/com/example/resourceservice/entities/Province.java
c746889b68504e6e21335c4094461beb439ab48d
[]
no_license
trung02012017/eureka-gateway-springboot
f09cfcd7d59a2833dcf7d3a737c2c1f4dda590af
6134168826268068b910a657735fb7806144777c
refs/heads/master
2023-06-19T17:58:13.040581
2021-07-19T03:06:27
2021-07-19T03:06:27
387,322,633
0
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.example.resourceservice.entities; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data public class Province { private Integer provinceId; private String provinceName; private Integer type; }
[ "trungtq@tima.vn" ]
trungtq@tima.vn
39687c52f0db757830e656ff7027806a19a65883
b3f52f1c6f435d76f2fedbe3d3cfa718e7a07b5f
/Congzhijie20190418/app/src/main/java/com/bawei/congzhijie/congzhijie20190418/adapter/Mlssadapter.java
517318922317848bd04c4b6a458ee364ec51926b
[]
no_license
congzhijie/Mvp
83890087a8ae236923635a12bcc438505609223d
baf79e28e26d79ad5082cc6ded39903b81d6c1b3
refs/heads/master
2020-05-15T03:58:38.235293
2019-04-18T11:42:25
2019-04-18T11:42:25
182,076,874
0
1
null
null
null
null
UTF-8
Java
false
false
2,045
java
package com.bawei.congzhijie.congzhijie20190418.adapter; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bawei.congzhijie.congzhijie20190418.R; import com.bawei.congzhijie.congzhijie20190418.bean.JsonBean; import com.bumptech.glide.Glide; public class Mlssadapter extends RecyclerView.Adapter<Mlssadapter.MlssViewHolder> { Context context; JsonBean.ResultBean result; public Mlssadapter(Context context, JsonBean.ResultBean result) { this.context = context; this.result = result; } @NonNull @Override public MlssViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { View view = LayoutInflater.from(context).inflate(R.layout.item2, viewGroup, false); return new MlssViewHolder(view); } @Override public void onBindViewHolder(@NonNull MlssViewHolder mlssViewHolder, int i) { mlssViewHolder.mlss_name.setText(result.getMlss().getCommodityList().get(i).getCommodityName()); mlssViewHolder.mlss_price.setText(result.getMlss().getCommodityList().get(i).getPrice()+""); Glide.with(context).load(result.getMlss().getCommodityList().get(i).getMasterPic()).into(mlssViewHolder.mlss_img); } @Override public int getItemCount() { return result.getMlss().getCommodityList().size(); } public class MlssViewHolder extends RecyclerView.ViewHolder { private final ImageView mlss_img; private final TextView mlss_name; private final TextView mlss_price; public MlssViewHolder(@NonNull View itemView) { super(itemView); mlss_img = itemView.findViewById(R.id.mlss_img); mlss_name = itemView.findViewById(R.id.mlss_name); mlss_price = itemView.findViewById(R.id.mlss_price); } } }
[ "1286401293@qq.com" ]
1286401293@qq.com
11cbb3efcb73c72dc2fd633d447443d336bd221c
cc074e76929f8075d249e67ef8bba40fe9be1791
/src/main/java/com/mlaz/api/services/RepositoryUserDetailsService.java
4672369f346379f89c519491ba4eb5469fea76c3
[]
no_license
nquoctuan/mlaz.auth
b95f4e23c22b0e0830d0baa6e5703a5d9e20ceb5
11bde5354f50799639d180c1cad63f1ebeb4f35b
refs/heads/master
2021-01-22T10:36:37.826329
2017-04-15T18:41:29
2017-04-15T18:41:29
82,021,446
1
0
null
null
null
null
UTF-8
Java
false
false
2,366
java
package com.mlaz.api.services; import com.google.gson.Gson; import com.mlaz.api.Repositories.MlazUserProfileRepository; import com.mlaz.api.model.MlazUserProfile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import java.util.Collection; /** * Created by jimmy on 15/4/17. */ public class RepositoryUserDetailsService implements UserDetailsService { private static final Logger LOGGER = LoggerFactory.getLogger(RepositoryUserDetailsService.class); private MlazUserProfileRepository mlazUserProfileRepository; @Autowired public RepositoryUserDetailsService(MlazUserProfileRepository mlazUserProfileRepository) { this.mlazUserProfileRepository = mlazUserProfileRepository; } @Override public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException { LOGGER.debug("Loading user by Username:{}", userName); MlazUserProfile userProfile = mlazUserProfileRepository.findByUserId(userName); LOGGER.debug("Found a user:{}", (new Gson()).toJson(userProfile)); UserDetails userDetails = new UserDetails() { @Override public Collection<? extends GrantedAuthority> getAuthorities() { return null; } @Override public String getPassword() { return userProfile.getPassword(); } @Override public String getUsername() { return userProfile.getUsername(); } @Override public boolean isAccountNonExpired() { return false; } @Override public boolean isAccountNonLocked() { return false; } @Override public boolean isCredentialsNonExpired() { return false; } @Override public boolean isEnabled() { return false; } }; return userDetails; } }
[ "tuan.nguyen@jayeson.com.sg" ]
tuan.nguyen@jayeson.com.sg
efe18507ec086bec3160f669db1196fecf09982a
faf825ce4412a786aba44c9ced5f673d446fcd3c
/1.7.10/src/main/java/stevekung/mods/moreplanets/planets/kapteynb/inventory/container/ContainerSchematicTier8Rocket.java
7cb92dd2235368f698376f7720078e8ac85e944d
[]
no_license
AugiteSoul/MorePlanets
87022c06706c3194bde6926039ee7f28acf4983f
dd1941d7d520cb372db41abee67d865bd5125f87
refs/heads/master
2021-08-15T12:23:01.538212
2017-11-16T16:00:34
2017-11-16T16:00:34
111,147,939
0
0
null
2017-11-17T20:32:07
2017-11-17T20:32:06
null
UTF-8
Java
false
false
8,683
java
/******************************************************************************* * Copyright 2015 SteveKunG - More Planets Mod * * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. ******************************************************************************/ package stevekung.mods.moreplanets.planets.kapteynb.inventory.container; import micdoodle8.mods.galacticraft.core.inventory.SlotRocketBenchResult; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import stevekung.mods.moreplanets.core.inventory.InventorySchematicRocket; import stevekung.mods.moreplanets.planets.kapteynb.inventory.slot.SlotSchematicTier8Rocket; import stevekung.mods.moreplanets.planets.kapteynb.recipe.Tier8RocketRecipes; public class ContainerSchematicTier8Rocket extends Container { public InventorySchematicRocket craftMatrix = new InventorySchematicRocket(this); public IInventory craftResult = new InventoryCraftResult(); private World worldObj; public ContainerSchematicTier8Rocket(InventoryPlayer par1InventoryPlayer, int x, int y, int z) { int change = 27; this.worldObj = par1InventoryPlayer.player.worldObj; this.addSlotToContainer(new SlotRocketBenchResult(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 142, 18 + 69 + change)); int var6; int var7; // Cone this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 1, 48, -8 + change, x, y, z, par1InventoryPlayer.player)); // Body for (var6 = 0; var6 < 5; ++var6) { this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 2 + var6, 39, -6 + var6 * 18 + 16 + change, x, y, z, par1InventoryPlayer.player)); } // Body Right for (var6 = 0; var6 < 5; ++var6) { this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 7 + var6, 57, -6 + var6 * 18 + 16 + change, x, y, z, par1InventoryPlayer.player)); } // Left fins this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 12, 21, 64 + change, x, y, z, par1InventoryPlayer.player)); this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 13, 21, 82 + change, x, y, z, par1InventoryPlayer.player)); this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 14, 21, 100 + change, x, y, z, par1InventoryPlayer.player)); // Engine this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 15, 48, 100 + change, x, y, z, par1InventoryPlayer.player)); // Right fins this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 16, 75, 64 + change, x, y, z, par1InventoryPlayer.player)); this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 17, 75, 82 + change, x, y, z, par1InventoryPlayer.player)); this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 18, 75, 100 + change, x, y, z, par1InventoryPlayer.player)); // Addons for (int var8 = 0; var8 < 3; var8++) { this.addSlotToContainer(new SlotSchematicTier8Rocket(this.craftMatrix, 19 + var8, 93 + var8 * 26, -15 + change, x, y, z, par1InventoryPlayer.player)); } // Player inv: for (var6 = 0; var6 < 3; ++var6) { for (var7 = 0; var7 < 9; ++var7) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 129 + var6 * 18 + change)); } } for (var6 = 0; var6 < 9; ++var6) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 18 + 169 + change)); } this.onCraftMatrixChanged(this.craftMatrix); } @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); if (!this.worldObj.isRemote) { for (int var2 = 1; var2 < this.craftMatrix.getSizeInventory(); ++var2) { ItemStack slot = this.craftMatrix.getStackInSlotOnClosing(var2); if (slot != null) { player.entityDropItem(slot, 0.0F); } } } } @Override public void onCraftMatrixChanged(IInventory par1IInventory) { this.craftResult.setInventorySlotContents(0, Tier8RocketRecipes.findMatchingTier8RocketRecipe(this.craftMatrix)); } @Override public boolean canInteractWith(EntityPlayer player) { return true; } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slotId) { ItemStack itemStack = null; Slot slot = (Slot) this.inventorySlots.get(slotId); if (slot != null && slot.getHasStack()) { ItemStack stack = slot.getStack(); itemStack = stack.copy(); if (slotId <= 21) { if (!this.mergeItemStack(stack, 22, 58, false)) { return null; } slot.onSlotChange(stack, itemStack); } else { boolean valid = false; for (int i = 1; i < 19; i++) { Slot testSlot = (Slot) this.inventorySlots.get(i); if (!testSlot.getHasStack() && testSlot.isItemValid(itemStack)) { valid = true; break; } } if (valid) { if (!this.mergeOneItemTestValid(stack, 1, 19, false)) { return null; } } else { if (itemStack.getItem() == Item.getItemFromBlock(Blocks.chest)) { if (!this.mergeOneItemTestValid(stack, 19, 22, false)) { return null; } } else if (slotId >= 22 && slotId < 49) { if (!this.mergeItemStack(stack, 49, 58, false)) { return null; } } else if (slotId >= 49 && slotId < 58) { if (!this.mergeItemStack(stack, 22, 49, false)) { return null; } } else if (!this.mergeItemStack(stack, 22, 58, false)) { return null; } } } if (stack.stackSize == 0) { slot.putStack((ItemStack) null); } else { slot.onSlotChanged(); } if (stack.stackSize == itemStack.stackSize) { return null; } slot.onPickupFromSlot(player, stack); } return itemStack; } protected boolean mergeOneItemTestValid(ItemStack itemStack, int par2, int par3, boolean par4) { boolean flag1 = false; if (itemStack.stackSize > 0) { Slot slot; ItemStack slotStack; for (int k = par2; k < par3; k++) { slot = (Slot) this.inventorySlots.get(k); slotStack = slot.getStack(); if (slotStack == null && slot.isItemValid(itemStack)) { ItemStack stackOneItem = itemStack.copy(); stackOneItem.stackSize = 1; itemStack.stackSize--; slot.putStack(stackOneItem); slot.onSlotChanged(); flag1 = true; break; } } } return flag1; } }
[ "mccommander_minecraft@hotmail.com" ]
mccommander_minecraft@hotmail.com
19ea0d3df927f7a3bc403739b0e51858638c4fa5
0d8c11d9a242d92ba14b78ede2f298cfd1810fc8
/ICHRSampleManager/test/ichr/controller/TestLoginController.java
a78342780285d9eaeca56f2636c6bf67eef59155
[]
no_license
chriscasola/ichr
fd60dc9642c737e6171d0847ae1d0fb3d449f99c
5d956179c91477683fd9532018b9b5a2221816b8
refs/heads/master
2016-09-09T20:00:18.728036
2013-04-23T16:07:04
2013-04-23T16:07:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
package ichr.controller; import static org.junit.Assert.*; import java.sql.SQLException; import ichr.ICHRException; import ichr.database.DataStore; import ichr.view.login.LoginView; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; /** * Tests for the login controller * * @author Chris Casola * @version Apr 8, 2013 * */ public class TestLoginController { private static LoginView view; private static LoginController controller; @BeforeClass public static void setup() throws SQLException { DataStore.getDB().openTestConnection(); DataStore.getDB().createTables(); addTestData(); view = new LoginView("Test"); controller = new LoginController(view); } @AfterClass public static void tearDown() { DataStore.getDB().executeSQLFile("./sql/drop.sql"); DataStore.getDB().closeConnection(); } @Test public void checkCorrectPassword() throws ICHRException { controller.checkPassword("testuser", "testpassword"); } @Test(expected=ICHRException.class) public void checkIncorrectPassword() throws ICHRException { controller.checkPassword("testuser", "bla"); } @Test(expected=ICHRException.class) public void checkPasswordWithInvalidUsername() throws ICHRException { controller.checkPassword("bla", "bla"); } @Test public void loginFormWorksWithCorrectPassword() throws ICHRException { view.getLoginPanel().getUserNameField().setText("testuser"); view.getLoginPanel().getPasswordField().setText("testpassword"); controller.checkCredentials(); } @Test(expected=ICHRException.class) public void loginFormWorksWithIncorrectPassword() throws ICHRException { view.getLoginPanel().getUserNameField().setText("testuser"); view.getLoginPanel().getPasswordField().setText("testpswd"); controller.checkCredentials(); } @Test public void loginFormHandlesBlankFields() { try { controller.checkCredentials(); fail("Check credentials should throw an exception when username/password are blank."); } catch (ICHRException e) { assertEquals("Login Failed: Incorrect password", e.getMessage()); } } private static void addTestData() { DataStore.getDB().executeSQLFile("./sql/test_data.sql"); } }
[ "ccasola@wpi.edu" ]
ccasola@wpi.edu
12a6d38a8b58373035017dedd006ba578551b51a
79e99fdff03933340af437b8365885da90e1132a
/station/station-src/src/main/java/com/station/moudles/entity/Parameter.java
fbcbaf1f7fc82569dbcd9219dfdb366580c7fa72
[]
no_license
leonchen09/poc
ad0e2a1437384fc079c509082eab84c8f7c3f5f2
6c633ea1da7e85e57e888d6b043f1941178108a8
refs/heads/master
2021-03-27T12:02:51.339218
2018-01-11T01:04:02
2018-01-11T01:04:02
116,938,058
1
0
null
null
null
null
UTF-8
Java
false
false
2,797
java
package com.station.moudles.entity; import com.station.common.utils.StringUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * This class was generated by Bill Generator. * This class corresponds to the database table parameters * * @zdmgenerated 2017-28-20 11:28 */ @ApiModel(value = "Parameter", description = "Parameter描述") public class Parameter { /** * This field corresponds to the database column parameters.parameter_code */ @ApiModelProperty(value = "pk", example = "pk", required = true) private String parameterCode; /** * This field corresponds to the database column parameters.parameter_value */ @ApiModelProperty(value = "parameterValue", example = "parameterValue", required = false) private String parameterValue; /** * This field corresponds to the database column parameters.parameter_desc */ @ApiModelProperty(value = "parameterDesc", example = "parameterDesc", required = false) private String parameterDesc; //参数类型 private String parameterCategory; public String getParameterCategory() { return parameterCategory; } public void setParameterCategory(String parameterCategory) { this.parameterCategory = parameterCategory; } /** * This method returns the value of the database column parameters.parameter_code * @return the value of parameters.parameter_code */ public String getParameterCode() { return parameterCode; } /** * This method sets the value of the database column parameters.parameter_code * @param parameterCode the value for parameters.parameter_code */ public void setParameterCode(String parameterCode) { this.parameterCode = parameterCode == null ? null : parameterCode.trim(); } /** * This method returns the value of the database column parameters.parameter_value * @return the value of parameters.parameter_value */ public String getParameterValue() { return parameterValue; } /** * This method sets the value of the database column parameters.parameter_value * @param parameterValue the value for parameters.parameter_value */ public void setParameterValue(String parameterValue) { this.parameterValue = StringUtils.isNull(parameterValue) ? null : parameterValue.trim(); } /** * This method returns the value of the database column parameters.parameter_desc * @return the value of parameters.parameter_desc */ public String getParameterDesc() { return parameterDesc; } /** * This method sets the value of the database column parameters.parameter_desc * @param parameterDesc the value for parameters.parameter_desc */ public void setParameterDesc(String parameterDesc) { this.parameterDesc = StringUtils.isNull(parameterDesc) ? null : parameterDesc.trim(); } }
[ "aliag00@sohu.com" ]
aliag00@sohu.com
f537df5011e50bffa6811ef1d91964db15e7c3dc
8c2a49f6fc73f8e587be41a87809f263fcdce05c
/src/main/java/com/nj/secretary/services/main/MainController.java
9c8381ba7610ed32cc722540e55e7f1869bc2346
[]
no_license
NullJavaJo/secretary
1483a472957892df2b0fc5716706d27efd4237f8
9eb6714565f35ab3daa069b74f76085189f58d1c
refs/heads/master
2023-07-10T09:07:01.504931
2021-08-11T11:44:26
2021-08-11T11:44:26
328,360,305
0
3
null
2021-08-11T11:44:27
2021-01-10T10:51:12
JavaScript
UTF-8
Java
false
false
4,205
java
package com.nj.secretary.services.main; import com.nj.secretary.services.alarm.service.AlarmService; import com.nj.secretary.services.monologue.domain.Monologue; import com.nj.secretary.services.monologue.domain.Question; import com.nj.secretary.services.monologue.service.MonologueService; import com.nj.secretary.services.user.domain.User; import com.nj.secretary.services.user.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpSession; import java.util.Random; @Controller public class MainController { @Autowired private UserService userService; @Autowired private JavaMailSender mailSender; @Autowired private AlarmService alarmService; @Autowired private MonologueService monologueService; @RequestMapping(value = "/") public String index(HttpSession session, Model model) throws Exception{ if(session.getAttribute("user") != null) { User login = (User)session.getAttribute("user"); Monologue monologue = new Monologue(); monologue.setUserId(login.getUserId()); if(login.getRoles().trim().equals("ADMIN")){ // 알람 시작 int alarmCount = alarmService.alarmCount(login.getUserId()); model.addAttribute("count", alarmCount); System.out.println("count check : " + alarmCount); // 알람 끝 model.addAttribute("user", login); return "user/adminAfterLogin"; }else { if (monologueService.checkMonologue(login.getUserId()) > 0) { // 알람 시작 int alarmCount = alarmService.alarmCount(login.getUserId()); model.addAttribute("count", alarmCount); System.out.println("count check : " + alarmCount); // 알람 끝 System.out.println("Already wrote Monologue"); Question question = new Question(); model.addAttribute("user", login); model.addAttribute("question", question); return "user/afterLogin"; } else { Random random = new Random(); System.out.println("didn't write Monologue"); while (true) { int ran = random.nextInt(100) + 1; monologue.setQuestionId(ran); if (monologueService.randomCheck(monologue) == 0) { // 알람 시작 int alarmCount = alarmService.alarmCount(login.getUserId()); model.addAttribute("count", alarmCount); System.out.println("count check : " + alarmCount); // 알람 끝 model.addAttribute("question", monologueService.getQuestionText(ran)); model.addAttribute("user", login); return "user/afterLogin"; } if (monologueService.randomCheck(monologue) == 100) { // 알람 시작 int alarmCount = alarmService.alarmCount(login.getUserId()); model.addAttribute("count", alarmCount); System.out.println("count check : " + alarmCount); // 알람 끝 Question question = new Question(); model.addAttribute("user", login); model.addAttribute("question", question); model.addAttribute("user", login); return "user/afterLogin"; } } } } }else{ return "index"; } } }
[ "yygg1926@naver.com" ]
yygg1926@naver.com
926d0b3dffb2280c23ec7686dc12ca134d0bf69a
5176df4e5765ab5ceea7111e06d0cf89161fd8ee
/src/test/java/com/ridgeline/example/ExampleApplicationTests.java
ab76d55afdb32dae5334181a8703bd9e4851569b
[]
no_license
ewood81/Code_example
f221782c3c2f4f9b2ccba4e2d0da899299af2865
419a33254cf8d5c9f4fbdf1a629d66711f9a7672
refs/heads/master
2023-01-02T11:48:54.060894
2020-10-28T15:54:19
2020-10-28T15:54:19
308,067,916
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package com.ridgeline.example; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ExampleApplicationTests { @Test void contextLoads() { } }
[ "edwarddwood@outlook.com" ]
edwarddwood@outlook.com
a721faead4d8bbb2dda2986b9fb775e2ec1112cd
4f8e948fa9df0ee53cc895dac587d5a0d2ab2899
/datasource-identifiers/src/main/java/edu/ucdenver/ccp/datasource/identifiers/transfac/TransfacGeneID.java
539cf37642802e24d5386ef76de5645dfbaf2b3f
[]
no_license
tuh8888/datasource
c4ab966fd1a1bbdf8931e9f09b53e05b96e4594a
9dcfa04a4c099991ed5cd5b36baea27ea1161462
refs/heads/master
2020-04-07T14:52:28.765064
2017-03-20T14:23:43
2017-03-20T14:23:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,461
java
package edu.ucdenver.ccp.datasource.identifiers.transfac; /* * #%L * Colorado Computational Pharmacology's common module * %% * Copyright (C) 2012 - 2014 Regents of the University of Colorado * %% * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the Regents of the University of Colorado nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * #L% */ import edu.ucdenver.ccp.common.string.RegExPatterns; import edu.ucdenver.ccp.datasource.identifiers.DataSource; import edu.ucdenver.ccp.datasource.identifiers.StringDataSourceIdentifier; public class TransfacGeneID extends StringDataSourceIdentifier { public TransfacGeneID(String resourceID) { super(resourceID,DataSource.TRANSFAC); } @Override public String validate(String resourceID) throws IllegalArgumentException { resourceID = super.validate(resourceID); if (resourceID.startsWith("G") && resourceID.substring(1).matches(RegExPatterns.HAS_NUMBERS_ONLY)) return resourceID; throw new IllegalArgumentException(String.format("Invalid Transfac Gene ID detected: %s", resourceID)); } }
[ "william.baumgartner@ucdenver.edu" ]
william.baumgartner@ucdenver.edu
a6fe73b0a7855d5d3a9347985a7df796841f0f68
41ae950b46036a9ebe6a221fcc0a23601bfbf190
/LeetCode/src/lcof/Lcof003_1.java
73edf967cf7fca75bc99ad22cc665e5563441f47
[]
no_license
yuruiyin/AlgorithmLearn
f7a88a499d050fa9c5d666514a74de0f0a56d001
4224b664e6d05f233512f77088f6d1437a87cd97
refs/heads/master
2023-07-08T09:19:41.101604
2023-07-03T01:48:08
2023-07-03T01:48:08
143,147,502
4
2
null
null
null
null
UTF-8
Java
false
false
441
java
package lcof; public class Lcof003_1 { public int findRepeatNumber(int[] nums) { int len = nums.length; for (int i = 0; i < len; i++) { while (nums[i] != i) { int num = nums[i]; if (nums[num] == num) { return num; } nums[i] = nums[num]; nums[num] = num; } } return -1; } }
[ "yuruiyin@cyou-inc.com" ]
yuruiyin@cyou-inc.com
e1dac5277a2d9f8367a5ba50828cdab00f08ceee
f8053febb4c473a7f32a0d94eaab0590331302ce
/lr3/ejb-remote/src/main/java/ru/rps/lr3/ejb/remote/client/PersonDAORemote.java
9730ae7b93effcf60d478fb4a9dffdeb711058d2
[]
no_license
alex-kuver/rps_aaaaa
b13d1dc61e7756653786155d818d3f1026d65ccf
a2b5934f519a41b9afc97be255499eb138817552
refs/heads/main
2023-05-29T22:03:28.775120
2021-06-06T17:17:25
2021-06-06T17:17:25
374,415,479
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package ru.rps.lr3.ejb.remote.client; import java.util.List; import javax.ejb.Remote; import ru.rps.lr3.ejb.remote.entity.Person; @Remote public interface PersonDAORemote { void createSuccess(Person person); void createRollback(Person person); void createNewTX(Person person); List<Person> getAll(); }
[ "noreply@github.com" ]
alex-kuver.noreply@github.com
e92b12af64d985035e44c50742ef4f3382ce605a
6decbe1dbbc55943a7770b91ce63f2e77fce865c
/Comp 1210/Lab 10/Project/PetBoardingPart2Test.java
567df4b0ebea78dc8f5b21367e6f95a0d83ff5f7
[]
no_license
Kareithdyce/Auburn-Classes
9a895f3926cb462fad01a642be02bfb8800cca11
b0813eead9f6c5a3bc9b512b988b0183c88a9bf1
refs/heads/master
2020-03-28T18:24:10.487433
2020-02-17T19:52:59
2020-02-17T19:52:59
148,878,647
1
2
null
null
null
null
UTF-8
Java
false
false
1,227
java
import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.io.IOException; /** * Tests petNameComparator. * Project 10 * * @author Kareith Dyce * @version 11/02/16 */ public class PetBoardingPart2Test { /** Fixture initialization (common initialization * for all tests). */ @Before public void setUp() { } /** * Checks empty String[]. * * @throws IOException from scanning input file. */ @Test public void emptyTest() throws IOException { PetBoardingList.resetListCount(); PetBoardingPart2 app = new PetBoardingPart2(); String[] args1 = {}; // an empty String[] PetBoardingPart2.main(args1); Assert.assertEquals("Pet Boarding List count should be 0. ", 0, PetBoardingList.getListCount()); } /** *Checks filled String[] . * * @throws IOException from scanning input file. */ @Test public void filledTest() throws IOException { PetBoardingList.resetListCount(); String[] args2 = {"pet_boarding_data.csv"}; PetBoardingPart2.main(args2); Assert.assertEquals("Pet Boarding List count should be 1. ", 1, PetBoardingList.getListCount()); } }
[ "Kareith.dyce@gmail.com" ]
Kareith.dyce@gmail.com
eeb2d79fac74030ff2d9178a3a349811c149d498
19c54cc78602576cddcdfcbc8c8055b7dfe96546
/src/main/java/org/bluebank/atm/authorization/outbound/PinValidationResponseHandler.java
69c3b2b0dc65057876bbc7f10ec76aab6bd90501
[]
no_license
Finaxys/bluebank-atm-server
4c6d5e4588d9e3d06ab79c9a7db1fa195cc92e53
7a8f77a015855dd5def1ce33e7cc94dfbf239da1
refs/heads/master
2021-01-18T07:14:24.849025
2016-03-09T21:23:37
2016-03-09T21:23:37
50,185,696
0
8
null
2016-02-03T09:53:12
2016-01-22T14:21:32
Java
UTF-8
Java
false
false
2,356
java
package org.bluebank.atm.authorization.outbound; import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; import org.bluebank.api.endpoint.OutboundEndPoint; import org.bluebank.atm.Transaction; import org.bluebank.atm.Atm; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import static org.bluebank.contract.Messages.CardValidationStatus; import static org.bluebank.contract.Messages.CardValidationStatus.Status.CARD_DISABLED; import static org.bluebank.contract.Messages.CardValidationStatus.Status.VALIDATED; import static org.bluebank.contract.Messages.CardValidationStatus.Status.WRONG_PIN; @Singleton public class PinValidationResponseHandler { private final OutboundEndPoint<CardValidationStatus> pinValidationResponseSender; private final Atm atm; @Inject public PinValidationResponseHandler(EventBus eventBus, @Named("pinValidationResponseSender") OutboundEndPoint<CardValidationStatus> pinValidationResponseSender, Atm atm) { this.pinValidationResponseSender = pinValidationResponseSender; this.atm = atm; eventBus.register(this); } @Subscribe public void handlePinValidResponse(Transaction.PinValidated pinValidated) { CardValidationStatus cardValidationStatus = CardValidationStatus.newBuilder() .setStatus(VALIDATED) .build(); pinValidationResponseSender.send(cardValidationStatus); } @Subscribe public void handleCardRetainedResponse(Transaction.CardRetained cardRetained) { atm.retainCard(); CardValidationStatus cardValidationStatus = CardValidationStatus.newBuilder() .setReason("Card has been retained") .setStatus(CARD_DISABLED) .build(); pinValidationResponseSender.send(cardValidationStatus); } @Subscribe public void handlePinInvalidResponse(Transaction.PinInvalid pinInvalid) { CardValidationStatus cardValidationStatus = CardValidationStatus.newBuilder() .setStatus(WRONG_PIN) .setReason("Wrong PIN") .build(); pinValidationResponseSender.send(cardValidationStatus); } }
[ "riad.maouchi@gmail.com" ]
riad.maouchi@gmail.com
852e96281fa7e3dc67f3bf6417be6f63b24f28bc
62fa39b317ded3010b1b983a144416d297fe52fe
/gmall-sms/src/main/java/com/atguigu/gmall/sms/entity/CouponEntity.java
53d78232994276dea6eec92b6647638f885116e2
[ "Apache-2.0" ]
permissive
w1514139296/gmall-0108
38b03c59f7046410c88e2f312d9d74c6461bef5b
a8eb8144525b8c09ff477b63a853345ed22ae0d7
refs/heads/main
2023-06-06T18:12:52.176382
2021-07-15T09:10:48
2021-07-15T09:10:48
378,921,059
0
0
null
null
null
null
UTF-8
Java
false
false
1,794
java
package com.atguigu.gmall.sms.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; import java.io.Serializable; import java.util.Date; import lombok.Data; /** * 优惠券信息 * * @author gouge * @email gouge@atguigu.com * @date 2021-06-22 18:12:00 */ @Data @TableName("sms_coupon") public class CouponEntity implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId private Long id; /** * 优惠卷类型[0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券] */ private Integer couponType; /** * 优惠券图片 */ private String couponImg; /** * 优惠卷名字 */ private String couponName; /** * 数量 */ private Integer num; /** * 金额 */ private BigDecimal amount; /** * 每人限领张数 */ private Integer perLimit; /** * 使用门槛 */ private BigDecimal minPoint; /** * 开始时间 */ private Date startTime; /** * 结束时间 */ private Date endTime; /** * 使用类型[0->全场通用;1->指定分类;2->指定商品] */ private Integer useType; /** * 备注 */ private String note; /** * 发行数量 */ private Integer publishCount; /** * 已使用数量 */ private Integer useCount; /** * 领取数量 */ private Integer receiveCount; /** * 可以领取的开始日期 */ private Date enableStartTime; /** * 可以领取的结束日期 */ private Date enableEndTime; /** * 优惠码 */ private String code; /** * 可以领取的会员等级[0->不限等级,其他-对应等级] */ private Integer memberLevel; /** * 发布状态[0-未发布,1-已发布] */ private Integer publish; }
[ "wbt0425@qq.com" ]
wbt0425@qq.com
91da67db58269d3cf65e96047401495cb427af2d
f378ddd47c8b7de6e9cf1d4228c84f73e9dc59f1
/projetos/WEAPON/src/asgard/weapon/map/Edge.java
4543e7abb7611cc1f17265b587c6079a9ba9b372
[]
no_license
charles-marques/dataset-375
29e2f99ac1ba323f8cb78bf80107963fc180487c
51583daaf58d5669c69d8208b8c4ed4e009001a5
refs/heads/master
2023-01-20T07:23:09.445693
2020-11-27T22:35:49
2020-11-27T22:35:49
283,315,149
0
1
null
null
null
null
UTF-8
Java
false
false
1,479
java
package asgard.weapon.map; import java.util.Arrays; /** * * @author Adam * * */ public class Edge { private int weight; private Node[] nodes; @SuppressWarnings("unused") private Edge(){} public Edge (Node first, Node second, int weight) { nodes = new Node[2]; nodes[0] = first; nodes[1] = second; this.weight = weight; } public int getWeight(){ return weight; } public Node getOtherNode(Node current) { if (current == null) return null; if (current == nodes[0] || current.equals(nodes[0])) return nodes[1]; if (current == nodes[1] || current.equals(nodes[1])) return nodes[0]; return null; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Arrays.hashCode(nodes); result = prime * result + weight; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Edge other = (Edge) obj; if (!Arrays.equals(nodes, other.nodes)) return false; if (weight != other.weight) return false; return true; } @Override public String toString() { return "Edge [weight=" + weight + ", nodes=" + nodes[0].getName() + " and " + nodes[1].getName(); } public boolean isAdjacent(Node n) { if (n == null) return false; if (n.equals(nodes[0]) || n.equals(nodes[1])){ return true; } return false; } }
[ "suporte@localhost.localdomain" ]
suporte@localhost.localdomain
4f09f652ab0929579000cb69594b55fdda26b930
8960812df8ade16e7f8a5d626a9d13b59d0b2fac
/app/src/main/java/com/example/ilovezappos/adapters/AsksAdapter.java
f8184620e771aa7b727ff3803534454d58cd3c11
[]
no_license
Mk09878/CoinTracker
858b13ceae9853c5edc498b09a5c76335f43abbd
d23d10f7d8492f368b1bfa9d47de0c74ce5009b3
refs/heads/master
2022-11-29T03:52:35.895340
2020-08-05T07:27:24
2020-08-05T07:27:24
236,876,733
0
0
null
null
null
null
UTF-8
Java
false
false
2,580
java
package com.example.ilovezappos.adapters; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.recyclerview.widget.RecyclerView; import com.example.ilovezappos.R; import com.example.ilovezappos.getters.AskGetters; import java.util.ArrayList; public class AsksAdapter extends RecyclerView.Adapter<AsksAdapter.AsksViewHolder> { private ArrayList<AskGetters> arrayList; private String TAG = "AsksAdapter"; Context context; @NonNull @Override public AsksViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { Log.i(TAG, "inviewholder"); View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.carditem_asks, parent, false); AsksViewHolder avh = new AsksViewHolder(v); return avh; } @Override public void onBindViewHolder(@NonNull AsksViewHolder holder, int position) { AskGetters current = arrayList.get(position); Log.i(TAG, String.valueOf(current.getVal())); holder.value.setText(String.valueOf(current.getVal())); holder.amount.setText(String.valueOf(current.getAmt())); holder.askslayout.setText(String.valueOf(current.getAsk())); setAnimation(holder.item_parent); } @Override public int getItemCount() { return arrayList.size(); } public AsksAdapter(ArrayList<AskGetters> list, Context context){ Log.i(TAG, "incons"); arrayList = list; this.context = context; } public static class AsksViewHolder extends RecyclerView.ViewHolder { public TextView value; public TextView amount; public TextView askslayout; ConstraintLayout item_parent; public AsksViewHolder(@NonNull View itemView) { super(itemView); value = itemView.findViewById(R.id.Value); amount = itemView.findViewById(R.id.Amount); askslayout = itemView.findViewById(R.id.AsksLayout); item_parent = itemView.findViewById(R.id.parent_asks); } } private void setAnimation(View viewToAnimate) { Animation animation = AnimationUtils.loadAnimation(context, R.anim.item_animation_fall_down); viewToAnimate.startAnimation(animation); } }
[ "mihirk107@gmail.com" ]
mihirk107@gmail.com
248b0af2665a00a9284a3cde83b2f704dc0d1fcf
095da00c639801cf7c9fae80de82730a920bcfd2
/signup.java
0a5e7e87d7603267b755d79e0dad61ab70f0e304
[]
no_license
poshdevopsblr23/Employee_Systems
6375bdb8729bee86e619a7a4b4390565991913a4
aaae8d0df7589268fd7150ae43bb7b59986f87da
refs/heads/master
2023-04-09T12:35:03.318664
2021-03-19T02:46:44
2021-03-19T02:46:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
118
java
public class Signup { void main() { public static void main() { System.out.println("Hellow World"); } } }
[ "rohit@ibm.com" ]
rohit@ibm.com
6bcb772c072ec552f8cc1dad29595a7fe0a81b2a
5598faaaaa6b3d1d8502cbdaca903f9037d99600
/code_changes/Apache_projects/HDFS-162/c14bb61a82f58b8b3ae37c6a6cc4fabe9f65dbec/~MapRunnable.java
0b8f26618b81491389930f3145c476bb46af75c4
[]
no_license
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
2,060
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.mapred; import java.io.IOException; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; /** * Expert: Generic interface for {@link Mapper}s. * * <p>Custom implementations of <code>MapRunnable</code> can exert greater * control on map processing e.g. multi-threaded, asynchronous mappers etc.</p> * * @see Mapper * @deprecated Use {@link org.apache.hadoop.mapreduce.Mapper} instead. */ @Deprecated @InterfaceAudience.Public @InterfaceStability.Stable public interface MapRunnable<K1, V1, K2, V2> extends JobConfigurable { /** * Start mapping input <tt>&lt;key, value&gt;</tt> pairs. * * <p>Mapping of input records to output records is complete when this method * returns.</p> * * @param input the {@link RecordReader} to read the input records. * @param output the {@link OutputCollector} to collect the outputrecords. * @param reporter {@link Reporter} to report progress, status-updates etc. * @throws IOException */ void run(RecordReader<K1, V1> input, OutputCollector<K2, V2> output, Reporter reporter) throws IOException; }
[ "archen94@gmail.com" ]
archen94@gmail.com
593d5a33984d06cdd683e83bb608ee4b4d62037b
58657f0a7dbe6f850d2d54fa822c54e00fa6a05c
/src/com/hrm/pojo/User.java
e2eb64305aaee05f0c42c6cd039e46254be4a5f8
[]
no_license
Ada0910/hrm
e0f500baecc452f5149cea8dfb773376463a9cd3
f34bda35dd4007d63513cef8fb4f19db938bbeec
refs/heads/master
2020-03-26T03:38:20.402761
2019-09-28T07:20:13
2019-09-28T07:20:13
144,464,226
1
0
null
null
null
null
UTF-8
Java
false
false
1,582
java
package com.hrm.pojo; import java.io.Serializable; import java.util.Date; /** * @Description: * <br>网站:<a href="http://www.fkit.org">疯狂Java</a> * @author 肖文吉 36750064@qq.com * @version V1.0 */ public class User implements Serializable { private Integer id; // id private String username; // 用户名 private String loginname; // 登录名 private String password; // 密码 private Integer status; // 状态 private Date createDate; // 建档日期 // 无参数构造器 public User() { super(); // TODO Auto-generated constructor stub } // setter和getter方法 public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getLoginname() { return loginname; } public void setLoginname(String loginname) { this.loginname = loginname; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } @Override public String toString() { return "User [id=" + id + ", username=" + username + ", loginname=" + loginname + ", password=" + password + ", status=" + status + ", createDate=" + createDate + "]"; } }
[ "1355948107@qq.com" ]
1355948107@qq.com
ad463494e6f1bf6e7a957d2a3fd6f0e6c697767e
c28c86d0bf2545e6457603b0f56cedf6a611aff1
/miniproject/pic_downloader/src/main/java/com/johnny/service/handler/handler/OnlineAlbumHandler.java
06033c44d07fc55c474956023c3641edd1f185bd
[]
no_license
YangShuailing/test-1
01e4ac09aeb4b00561a6785f26a8531c5871348a
4c6c22ebb1f6e2e49ed3f3d259b4cb0fe2b3eadc
refs/heads/master
2021-05-04T23:01:27.767081
2018-01-16T15:08:26
2018-01-16T15:08:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,688
java
package com.johnny.service.handler.handler; import com.johnny.common.Console; import com.johnny.common.utils.URLUtils; import com.johnny.model.Album; import com.johnny.model.BGImage; import com.johnny.service.handler.AlbumHandler; import com.johnny.service.image.ImageListComparator; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class OnlineAlbumHandler extends AlbumHandler { public static final int PAGE_SIZE_IMAGES_ONLINE = 90; public static final String PAGE_TAG = "start"; public static final String IMAGE_NAME_REGEX = "p\\d+.(gif|jpg|png)"; public static final String ALBUM_URL_REGEX = "(http|https)://www.douban.com/online/\\d+/album/\\d+/"; public String getURLRegex() { return ALBUM_URL_REGEX; } public String getPageRegex() { return super.getAlbumURL() + "\\?\\w+=\\d+"; } public boolean removeURLParameter() { return true; } public Integer getPageSize() { return PAGE_SIZE_IMAGES_ONLINE; } public String getPageTag() { return PAGE_TAG; } public String getImageNameRegex() { return IMAGE_NAME_REGEX; } public String getRawURL(String imageURL) { return null; } public void createBGImage(String source, String pageURL, String imageURL, Map<String, BGImage> map) { String imageId = imageURL.substring(imageURL.lastIndexOf("/p") + 2, imageURL.lastIndexOf(".")); String onlineId = pageURL.substring(pageURL.indexOf("online/") + 7, pageURL.indexOf("/album")); String startIndexStr = "<a href=\"https://www.douban.com/online/" + onlineId + "/photo/" + imageId + "/\" title=\""; int descStartIndex = source.indexOf(startIndexStr); String desc; if (descStartIndex != -1) { int start = descStartIndex + startIndexStr.length(); desc = source.substring(start, source.indexOf("\"", start)); } else { desc = ""; } String ownerStartStr = "来自 <a href=\""; int ownerStartIndex = source.indexOf(ownerStartStr, descStartIndex); String ownerA = source.substring(ownerStartIndex + 12, source.indexOf("</a>", ownerStartIndex)); String ownerURL = "@@@@"; try { ownerURL = ownerA.substring(0, ownerA.indexOf("/\">")); } catch (Exception e) { System.out.println("====================="); System.out.println(ownerA); System.out.println(ownerA.indexOf("<a href=\"") + 9); System.out.println(ownerA.indexOf("/\">")); System.out.println("====================="); e.printStackTrace(); } String ownerName = ownerA.substring(ownerA.indexOf(">") + 1); String commentTatolStartIndexStr = "<a href=\"https://www.douban.com/online/" + onlineId + "/photo/" + imageId + "/#comments\">"; int commentTatolStartIndex = source.indexOf(commentTatolStartIndexStr); Integer commentTatol = null; if (commentTatolStartIndex != -1) { String s = source.substring(commentTatolStartIndex + commentTatolStartIndexStr.length(), source.indexOf("</a>", commentTatolStartIndex)); commentTatol = Integer.valueOf(s.replace("回应", "")); } imageURL = imageURL.replace("thumb", "photo").trim(); desc = desc.replace("\\t\\n", "").trim(); if (!map.containsKey(imageURL)) { BGImage bgImage = new BGImage(desc, imageURL, commentTatol); bgImage.setOwnerName(ownerName); bgImage.setOwnerURL(ownerURL); map.put(imageURL, bgImage); } } public boolean checkBGImage(BGImage bgImage) { return !bgImage.getUrl().contains("albumicon"); } public void createDescDoc(Album album) { List<BGImage> imageList = album.getPhotosList(); Map<String, BGImage> map = new HashMap<>(); for (BGImage bgImage : imageList) { map.put(bgImage.getUrl(), bgImage); } List<String> keyList = new ArrayList<>(map.keySet()); keyList.sort(new ImageListComparator()); try { BufferedWriter bw = new BufferedWriter(new FileWriter(album.getPath() + "/" + "描述.txt")); bw.write(URLUtils.charset + " " + album.getUrl() + " " + album.getDate().getTime() + " -"); bw.newLine(); for (int i = 0; i < keyList.size(); i++) { BGImage bgImage = (BGImage) map.get(keyList.get(i)); Integer commentTotal = bgImage.getCommentTotal(); String commentTotalStr = commentTotal == null ? "-" : String.valueOf(commentTotal); bw.write(i + 1 + " " + (String) keyList.get(i) + " " + commentTotalStr + " " + bgImage.getDesc()); bw.newLine(); bw.write(bgImage.getOwnerURL() + " " + bgImage.getOwnerName()); bw.newLine(); } bw.flush(); bw.close(); Console.print("生成描述文档:成功"); } catch (IOException e) { Console.print("生成描述文档:失败"); e.printStackTrace(); } } public List<BGImage> getBGImageFromDescDoc(File descFile) throws IOException { List<BGImage> list = new ArrayList<>(); BufferedReader reader = new BufferedReader(new FileReader(descFile)); BGImage tempBGImage = null; int line = 0; String str; while ((str = reader.readLine()) != null) { if (line == 0) { line++; } else if (line % 2 == 1) { String[] info = str.split(" ", 4); tempBGImage = new BGImage(info[0], info[1], info[3]); if (!info[2].equals("-")) { tempBGImage.setCommentTotal(Integer.valueOf(info[2])); } line++; } else { String[] info = str.split(" ", 2); tempBGImage.setOwnerURL(info[0]); tempBGImage.setOwnerName(info[1]); list.add(tempBGImage); line++; } } reader.close(); return list; } public String getCommentURL(Album album, BGImage image) { return album.getUrl().substring(0, album.getUrl().indexOf("/album/")) + "/photo/" + image.getId(); } public String getAlbumDesc(String source) { return null; } }
[ "1224017485@qq.com" ]
1224017485@qq.com
dc869f24726c92fb14eae1ef8006aad51e2ef6ba
9a90837c005992dbc14e26fe1bc983ca9ddd1fe4
/src/main/java/br/com/livro/cdi/qualificadores/Simulador.java
df5250bee027467d597a6dd6c7e5a4cbab8ef49f
[]
no_license
FlorMigliorini/cdi
6e0422dcba7245a470f2b123e1037a2a54753885
d4433a8e1ba93ada743a96c33c3e986fb137e16c
refs/heads/master
2023-03-14T19:06:54.643407
2021-03-17T18:16:05
2021-03-17T18:16:05
344,661,814
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package br.com.livro.cdi.qualificadores; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.enterprise.util.Nonbinding; import javax.inject.Qualifier; @Qualifier @Retention(RUNTIME) @Target({METHOD, FIELD, PARAMETER, TYPE}) public @interface Simulador { PlanoDeCargos planoDeCargos() default PlanoDeCargos.VERSAO_2005; boolean planoAprovado() default true; @Nonbinding boolean enviarNotificacao() default false; }
[ "flor.migliorini@gmail.com" ]
flor.migliorini@gmail.com
75fe36685ac5eb910a7b98e2d3a3f2386cfaefe4
56d473dc7cb94beae46d408e9a94b1e67380f0fc
/src/main/java/com/live/streaming/udp/service/AudioSender.java
efb588bfd3b52496f83ad6e77b36e0248c87130f
[]
no_license
preet18/LiveStreamingUsingUDP
6a6481b04eb93886714872ad0035b287f8ccee25
b9faa05c065cdb06857003cd26b80b35b4defca9
refs/heads/master
2023-03-03T03:24:08.988037
2021-02-13T07:38:36
2021-02-13T07:38:36
334,690,593
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
package com.live.streaming.udp.service; import java.util.List; public class AudioSender { public void sendAudio() { System.out.println("Send Audio in Audio Sender..."); TCP_IP_Server tcpServer = new TCP_IP_Server(); tcpServer.getTCPIPConnection(new SendAudioDataViaTCPIP()); } }
[ "kpr0881@gmail.com" ]
kpr0881@gmail.com
f068a9d3608a88107011cb4c272c0f69f98ea68b
17bdc0cf99ceb13ce8d0ad2681a05d4f2eb04a7c
/app/src/main/java/com/example/styledotmetask/MyListAdapter.java
a88f2fcbc4602509bb5df687417fe645a204ff76
[]
no_license
shivammaindola/ChatUI
a1281d99161acfcd8928109988e455f2714d7eb7
dbf76090eed9c06b1c2a081899f8fe98fc6ef1db
refs/heads/master
2022-10-13T09:09:31.726164
2020-06-11T12:01:50
2020-06-11T12:01:50
270,008,640
0
1
null
null
null
null
UTF-8
Java
false
false
3,169
java
package com.example.styledotmetask; import android.graphics.Color; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.recyclerview.widget.RecyclerView; import de.hdodenhof.circleimageview.CircleImageView; public class MyListAdapter extends RecyclerView.Adapter<MyListAdapter.ViewHolder>{ private MyListData[] listdata; MyListAdapter(MyListData[] listdata) { this.listdata = listdata; } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); View listItem= layoutInflater.inflate(R.layout.chat_item, parent, false); ViewHolder viewHolder = new ViewHolder(listItem); return viewHolder; } @Override public void onBindViewHolder(ViewHolder holder, int position) { final MyListData myListData = listdata[position]; String str=listdata[position].getNumber(); if(str.equals("1")) { holder.readImg.setImageResource(R.drawable.a1); holder.userMsgView.setTypeface(null, Typeface.BOLD); } else if(str.equals("3")) { holder.readImg.setImageResource(R.drawable.a3); holder.userMsgView.setTextColor(Color.BLUE); } else { //Typing holder.readImg.setImageResource(R.drawable.a4); holder.userMsgView.setTextColor(Color.parseColor("#A9A9A9")); } holder.profileImgView.setImageResource(listdata[position].getProfileImg()); holder.userNameView.setText(listdata[position].getUserName()); holder.userMsgView.setText(listdata[position].getUserMsg()); holder.time.setText(listdata[position].getTime()); holder.chatLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(view.getContext(),"Item Clicked ",Toast.LENGTH_LONG).show(); } }); } @Override public int getItemCount() { return listdata.length; } static class ViewHolder extends RecyclerView.ViewHolder { CircleImageView profileImgView; TextView userNameView; TextView userMsgView; TextView time; ImageView readImg; ConstraintLayout chatLayout; ViewHolder(View itemView) { super(itemView); this.profileImgView = (CircleImageView) itemView.findViewById(R.id.userImg); this.userNameView=(TextView) itemView.findViewById(R.id.userName); this.userMsgView = (TextView) itemView.findViewById(R.id.userMsg); this.time=(TextView) itemView.findViewById(R.id.time); this.readImg=(ImageView) itemView.findViewById(R.id.readImg); chatLayout = (ConstraintLayout) itemView.findViewById(R.id.chat_layout); } } }
[ "shivammaindola07@gmail.com" ]
shivammaindola07@gmail.com
16a1ea9bd6813260c28c0a327571dacef6ae48df
3edc51726f1b77f234f023558fd0bfd1e40d6eaa
/app/src/test/java/com/example/proiectsma/ExampleUnitTest.java
797459c33cd2a6c47dc292bd8467540d53bd8aa2
[]
no_license
FlaviusAr/proiectSma
d9b1a660800c7a35212b37d390870f4272d1bb5e
e48496b69d50ac2c0f19083acfc2c7465addc172
refs/heads/master
2023-02-12T08:07:27.950677
2021-01-12T15:48:27
2021-01-12T15:48:27
329,034,584
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.example.proiectsma; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "acmilanyo12@gmail.com" ]
acmilanyo12@gmail.com
f4c025bd6a3bbcab643a4b874e7c3a7601513486
9a33a9cacaddebc5e830c9f81f00b99349d075d0
/src/main/java/io/jmix/sampler/screen/ui/components/table/iconprovider/TableIconProviderSample.java
82807c2a40d494d395467ced15ccf4028175d521
[ "Apache-2.0" ]
permissive
stvliu/jmix-sampler
ae5730818d8713497108d5ce19da31a47a0556c8
4bbdfdd222378dc6f72b1bfac38eaf58daf1a4ff
refs/heads/master
2023-04-03T17:46:45.948120
2021-03-25T08:47:15
2021-03-25T08:47:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package io.jmix.sampler.screen.ui.components.table.iconprovider; import io.jmix.sampler.entity.Customer; import io.jmix.ui.icon.JmixIcon; import io.jmix.ui.screen.Install; import io.jmix.ui.screen.ScreenFragment; import io.jmix.ui.screen.UiController; import io.jmix.ui.screen.UiDescriptor; @UiController("table-icon-provider") @UiDescriptor("table-icon-provider.xml") public class TableIconProviderSample extends ScreenFragment { @Install(to = "customerTable", subject = "iconProvider") protected String customerTableIconProvider(Customer customer) { return customer.getActive() ? JmixIcon.OK.source() : JmixIcon.CANCEL.source(); } }
[ "durygin@haulmont.com" ]
durygin@haulmont.com
9f9676641c0fd7949502348da298b24acf968b48
ada0005eb48ce41b00b9d825b394c99b93e6e126
/src/main/java/xin/creek/quiz/web/rest/errors/FieldErrorVM.java
7de9a0600880a8e1edbf237c98b2be91b18b756f
[]
no_license
yongmao/Quiz
e482d0aead65474ec06750dcd602e7c6a57f206a
07d4664086e58e7c126d651a015c68121964aa17
refs/heads/master
2021-09-05T11:29:11.055593
2018-01-26T23:08:06
2018-01-26T23:08:06
119,112,946
0
0
null
null
null
null
UTF-8
Java
false
false
646
java
package xin.creek.quiz.web.rest.errors; import java.io.Serializable; public class FieldErrorVM implements Serializable { private static final long serialVersionUID = 1L; private final String objectName; private final String field; private final String message; public FieldErrorVM(String dto, String field, String message) { this.objectName = dto; this.field = field; this.message = message; } public String getObjectName() { return objectName; } public String getField() { return field; } public String getMessage() { return message; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
94bcaa8d3b0819658f9ca808ac56cb63415f0649
46969f5411125419599d03b2b37a26d2c5bb7a61
/YuiHatano/src/main/java/android/content/ShadowContext.java
3df51b35ea52b09e7aaa167ab905390ef08ea6ba
[ "Apache-2.0" ]
permissive
kkmike999/YuiHatano
7d7507cd981290dc42efe6020948ce463897dec6
486db1bdc1087a5e8817981dc83397d49780588e
refs/heads/master
2021-05-16T17:39:16.528795
2021-03-09T06:27:46
2021-03-09T06:27:46
103,027,757
13
4
null
null
null
null
UTF-8
Java
false
false
4,729
java
package android.content; import android.annotation.TargetApi; import android.app.Application; import android.content.res.AssetManager; import android.content.res.Resources; import android.content.res.ShadowAssetManager; import android.content.res.ShadowResources; import android.database.DatabaseErrorHandler; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.ShadowSQLiteDatabase; import android.os.Build; import android.shadow.Shadow; import android.support.annotation.NonNull; import android.support.annotation.StringRes; import net.kkmike.sptest.SharedPreferencesHelper; import net.yui.CGLibProxy; import net.yui.utils.DbPathUtils; import java.io.File; import java.util.HashMap; import java.util.Map; /** * Created by kkmike999 on 2017/05/26. */ public class ShadowContext implements Shadow { private Resources resources; private ShadowResources mShadowResources; private Context mockContext; private Application application; private Map<String, SQLiteDatabase> dbMap = new HashMap<>(); public ShadowContext(Resources resources) { this.resources = resources; } public ShadowContext(Resources resources, ShadowResources shadowResources) { this.resources = resources; this.mShadowResources = shadowResources; } @NonNull public final String getString(@StringRes int resId) { return getResources().getString(resId); } public Resources getResources() { return resources; } public SharedPreferences getSharedPreferences(String name, int mode) { return SharedPreferencesHelper.getInstance(name); } public Context getApplicationContext() { return application == null ? mockContext : application; } public File getDatabasePath(String name) { return new File("build/db"); } public AssetManager getAssets() { return new CGLibProxy().proxy(AssetManager.class, new ShadowAssetManager()); } public String getPackageName() { return mShadowResources == null ? "" : mShadowResources.getPackageName(); } //////////////////////////// file ////////////////////////// public File getFilesDir() { return getAndCreateDir("build/files/"); } public File getCacheDir() { return getAndCreateDir("build/cache"); } public File getDataDir() { return getAndCreateDir("build/data"); } public File getExternalCacheDir() { return getAndCreateDir("build/external/cache"); } public File getExternalFilesDir(String type) { return getAndCreateDir("build/external/files/" + type); } private File getAndCreateDir(String dirPath) { File dir = new File(dirPath); if (!dir.exists()) { dir.mkdirs(); } return dir; } ///////////////////////////// SQLiteDatabase ///////////////////////////// public void putSQLiteDatabase(String name, SQLiteDatabase db) { dbMap.put(name, db); } public SQLiteDatabase openOrCreateDatabase(String name, int mode, SQLiteDatabase.CursorFactory factory) { return openOrCreateDatabase(name, mode, factory, null); } @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public SQLiteDatabase openOrCreateDatabase(String name, int mode, SQLiteDatabase.CursorFactory factory, DatabaseErrorHandler errorHandler) { if (dbMap.containsKey(name)) { return dbMap.get(name); } // 创建数据库 String path = DbPathUtils.getDbPath(name); // 不同api版本,构造函数参数不同 ShadowSQLiteDatabase sdb = new ShadowSQLiteDatabase(path, 0, null); SQLiteDatabase db = new CGLibProxy().proxy(SQLiteDatabase.class, sdb); sdb.setMockDatabase(db); putSQLiteDatabase(name, db); return db; } public boolean deleteDatabase(String name) { SQLiteDatabase db = dbMap.get(name); // db.execSQL("DROP DATABASE " + name); db.close(); String path = DbPathUtils.getDbPath(name); new File(path).delete(); return true; } public Map<String, SQLiteDatabase> getDbMap() { return dbMap; } ///////////////////////////// SQLiteDatabase end ///////////////////////////// @Override public String toString() { return "ShadowContext@" + hashCode() + "{}"; } @Override public void setProxyObject(Object proxyObject) { mockContext = (Context) proxyObject; } public void setApplication(Application application) { this.application = application; } }
[ "kkmike999@163.com" ]
kkmike999@163.com
325911e0febccc3338c53af274639bf1655938e3
a4c5a386de5456634da79a51b056cbcf0197314c
/src/test/java/AutoTestCreateExtension.java
e176f33c82f9074c06d65941d3534bab0e64490e
[]
no_license
Amy-jm/AutoTest2021
7bbdc1342c95eef5503e0d509ab5ddc4c49703ac
6a4685b5e3a57d1f0817d17d7f45a9a5c58c8b19
refs/heads/main
2023-03-17T11:39:11.933969
2021-03-02T12:27:46
2021-03-02T12:27:46
335,634,571
1
0
null
null
null
null
UTF-8
Java
false
false
2,088
java
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class AutoTestCreateExtension { WebDriver driver; @BeforeTest public void openChrome() throws InterruptedException { System.setProperty("webdriver.chrome.driver","F:\\AutoTest2021\\driver\\chromedriver.exe"); driver = new ChromeDriver(); driver.manage().window().maximize(); driver.get("https://192.168.7.130:8088/login"); WebElement username = driver.findElement(By.id("login_username")); WebElement password = driver.findElement(By.id("login_password")); username.sendKeys("admin"); password.sendKeys("Yeastar202"); WebElement login =driver.findElement(By.id("login-btn")); login.click(); Thread.sleep(2000); String url = driver.getCurrentUrl(); Assert.assertEquals(url,"https://192.168.7.130:8088/","登录成功"); } @Test public void addExtension(){ WebElement extandTrunk = driver.findElement(By.xpath("//*[@id=\"root\"]/div/section/div/div[1]/aside/div/ul/li[2]/div")); extandTrunk.click(); WebElement ext = driver.findElement(By.id("m_extensions")); ext.click(); WebElement add = driver.findElement(By.xpath("///*[@id=\"root\"]/div/section/section/div/div[2]/div/div[1]/div[1]/button[1]")); add.click(); WebElement save = driver.findElement(By.xpath("//*[@id=\"root\"]/div/section/section/div/div[2]/div/div[2]/div/div/button[1]")); save.click(); WebElement ext1 = driver.findElement(By.xpath("//*[@id=\"root\"]/div/section/section/div/div[2]/div/div[2]/div/div/div/div/div/div/div/div/table/tbody/tr[8]/td[4]")); Assert.assertEquals(ext1.getText(),"1006","添加成功"); } @AfterTest public void closeChrome(){ driver.quit(); } }
[ "1072807167@qq.com" ]
1072807167@qq.com
75c653db9dec39567ae96dc944d0fbd4b6a8bb5e
5f7af00359af367648b56d9cc07fcc32f0890e50
/src/main/java/com/lan/lineage/common/LineageColumn.java
38fc34f3bc1d629d81f44458e6c03e4b93e23225
[]
no_license
luckyayulee/sql-lineage-parser
2d65ca694a22e25064846ef84f745b271caddeb3
6a7f30de087ed0c397de8a0666f4ce5cde5e2efb
refs/heads/master
2023-07-18T13:42:11.080416
2021-08-31T06:25:40
2021-08-31T06:25:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,062
java
package com.lan.lineage.common; import lombok.Data; /** * @author lanxueri * @ClassName LineageColumn * @Description TODO * @createTime 2020-07-31 */ @Data public class LineageColumn implements Comparable<LineageColumn> { private String targetColumnName; private String sourceDbName; private String sourceTableName; private String sourceColumnName; private String expression; private Boolean isEnd = false; public void setSourceTableName(String sourceTableName) { sourceTableName = EmptyUtils.isNotEmpty(sourceTableName) ? sourceTableName.replace("`","") : sourceTableName; if (sourceTableName.contains(".")){ this.sourceDbName = sourceTableName.substring(0,sourceTableName.indexOf(".")); this.sourceTableName = sourceTableName.substring(sourceTableName.indexOf(".")+1); }else { this.sourceTableName = sourceTableName; } } public int compareTo(LineageColumn o) { if (this.getTargetColumnName().equals(o.getTargetColumnName())) return 0; return -1; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LineageColumn myColumn = (LineageColumn) o; if (!this.getTargetColumnName().equals(myColumn.getTargetColumnName())) return false; if (EmptyUtils.isNotEmpty(sourceTableName) && !sourceTableName.equals(myColumn.sourceTableName)) return false; if (EmptyUtils.isNotEmpty(sourceColumnName)) return sourceColumnName.equals(myColumn.sourceColumnName); return true; } @Override public int hashCode() { int result = getTargetColumnName().hashCode(); if (EmptyUtils.isNotEmpty(sourceTableName)){ result = 31 * result + sourceTableName.hashCode(); } if (EmptyUtils.isNotEmpty(sourceColumnName)){ result = 31 * result + sourceColumnName.hashCode(); } return result; } }
[ "lanxueri@hujiang.com" ]
lanxueri@hujiang.com
b85515179e6923a5dfec3a28d2dabddafeba1d35
5da60dad45228e47233bcec527f4cd746029cf54
/app/src/main/java/com/infoicon/bonjob/chat/ShowUrl.java
675f5552cfe2d6349ba75b827ba25b241aa8b49d
[]
no_license
vikashgiri/hello
e7a20ee016f3ce1ee0f1443825ec87b55f90be5c
9bba0ebeb16ffea553a94fe8f3f39f418c61f32c
refs/heads/master
2020-12-16T23:45:22.984894
2020-01-21T07:27:34
2020-01-21T07:27:34
235,277,989
0
0
null
null
null
null
UTF-8
Java
false
false
4,011
java
package com.infoicon.bonjob.chat; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.Log; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; import android.widget.MediaController; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import android.widget.VideoView; import com.bumptech.glide.Glide; import com.bumptech.glide.load.resource.drawable.GlideDrawable; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.infoicon.bonjob.R; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import static com.facebook.FacebookSdk.getApplicationContext; public class ShowUrl extends Activity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.chat_video_image); ProgressBar progress_bar = (ProgressBar) findViewById(R.id.progress_bar); ImageView image = (ImageView) findViewById(R.id.image); WebView pdf = (WebView) findViewById(R.id.pdf); VideoView videoView = (VideoView)findViewById(R.id.videoView2); TextView close = (TextView) findViewById(R.id.close); String type=getIntent().getStringExtra("type"); String url=getIntent().getStringExtra("url"); close.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); if(type.equalsIgnoreCase("video")) { MediaController mc= new MediaController(this); videoView.setMediaController(mc); videoView.setVisibility(View.VISIBLE); videoView.setVideoPath(""+url); videoView.start(); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { progress_bar.setVisibility(View.GONE); } }); } if(type.equalsIgnoreCase("file")) { pdf.setVisibility(View.VISIBLE); try { pdf.getSettings().setJavaScriptEnabled(true); url= URLEncoder.encode(url,"UTF-8"); pdf.loadUrl("https://docs.google.com/gview?embedded=true&url="+url); progress_bar.setVisibility(View.GONE); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } pdf.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) { progress_bar.setVisibility(View.GONE); } }); if(type.equalsIgnoreCase("image")) { image.setVisibility(View.VISIBLE); Glide.with(this) .load(url) .listener(new RequestListener<String, GlideDrawable>() { @Override public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) { return false; } @Override public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { progress_bar.setVisibility(View.GONE); return false; } }) .into(image); /* Glide.with(this) .load(url) .placeholder(R.drawable.default_icon) .into(image).se; progress_bar.setVisibility(View.GONE);*/ } } }
[ "vgiri8308@gmail.com" ]
vgiri8308@gmail.com
953ce4ec7095689293d8afbc8b5c7c6b982861c0
6505de5cc40f15a8892626ce0eab595b2901f073
/Java/workshop/day09/src/ws4/Circle.java
8fea0fc2163ff404a4c1afaf197945ef78b6e702
[]
no_license
gwang920/TIL
31a2a3ca7c56963f2077a0cc01fbe9be71866da0
e0d4ee023915c840f3e115e5462ab85592b0ca54
refs/heads/master
2022-12-24T23:35:48.107120
2021-05-24T13:45:22
2021-05-24T13:45:22
187,792,785
2
2
null
2022-12-16T07:48:36
2019-05-21T08:17:21
Java
UTF-8
Java
false
false
860
java
package ws4; public class Circle extends Shape{ private int radius; private String color; public Circle() { } public Circle(int radius) { this.radius = radius; } public Circle(Point point, int radius) { super(point); this.radius = radius; } public Circle(Point point, int radius, String color) { super(point); this.radius = radius; this.color = color; } public int getRadius() { return radius; } public void setRadius(int radius) { this.radius = radius; } @Override public String toString() { return "Circle [point=" + point + ", radius=" + radius + ", color=" + color + "]"; } @Override public double getArea() { double result = 0.0; result = Math.PI*radius*radius; return result; } @Override public double getCircume() { double result =0.0; result = Math.PI*2*radius; return result; } }
[ "gwang92@naver.com" ]
gwang92@naver.com
84068bf6635c2b7659fb6245633bec2e4297006d
2dfcf3e3f393429c67fee86f3edb26f43156533c
/netty-server/src/main/java/net/netty/server/thread/ProtobufServer.java
0328bf73899fc2bdda080f8607e0aa09d0ba13af
[ "Apache-2.0" ]
permissive
lolog/netty
0287f8fa8d9c7ca329463a0f5d8ede0009b65d6e
081d68467ae26579ce05c7058e4ae6e0bc1d6178
refs/heads/master
2021-09-15T19:19:15.110892
2018-06-09T04:09:12
2018-06-09T04:09:12
109,823,530
1
0
null
null
null
null
UTF-8
Java
false
false
2,153
java
package net.netty.server.thread; import java.util.concurrent.atomic.AtomicBoolean; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.protobuf.ProtobufDecoder; import io.netty.handler.codec.protobuf.ProtobufEncoder; import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder; import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender; import net.netty.plugins.pojo.User; import net.netty.server.handler.ProtobufHandler; public class ProtobufServer implements Runnable { int port; ServerBootstrap server; // Server Nio Group EventLoopGroup boosGroup = new NioEventLoopGroup(); EventLoopGroup workGroup = new NioEventLoopGroup(); volatile AtomicBoolean start = new AtomicBoolean(false); public ProtobufServer() { this(8899); } public ProtobufServer(int port) { this.port = port; } public void run() { if(start.compareAndSet(false, true)) { server = new ServerBootstrap(); server.group(boosGroup, workGroup) .channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG, 1024) .childHandler(new ChildChannelHandler()); try { ChannelFuture future = server.bind(this.port).sync(); future.channel().closeFuture().sync(); } catch (InterruptedException e) { e.printStackTrace(); } finally { boosGroup.shutdownGracefully(); workGroup.shutdownGracefully(); } } } private class ChildChannelHandler extends ChannelInitializer<SocketChannel> { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast( new ProtobufVarint32FrameDecoder(), new ProtobufDecoder(User.UserInfo.getDefaultInstance()), new ProtobufVarint32LengthFieldPrepender(), new ProtobufEncoder(), // new ProtobufHandler() ); } } }
[ "jonguo@yeah.net" ]
jonguo@yeah.net
bc7f2b6b8e7fd87db3cf1e416ed3c7a949416baa
4e95c6acee4e11161d8f964e1bbf50512158f87f
/src/main/java/com/josh/jokesapp/JokesappApplication.java
772249636b7f0384a9d8ff5aa98a27b0dadd276b
[]
no_license
davebowman276/jokesapp
fb26fc6073411d7526de2023c2ecd27ef4144b3b
77ca75dfbcb85e8a6ca6197aa2e1faba05eacc1c
refs/heads/master
2023-02-15T11:36:08.739693
2021-01-07T19:54:52
2021-01-07T19:54:52
321,848,281
0
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.josh.jokesapp; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class JokesappApplication { public static void main(String[] args) { SpringApplication.run(JokesappApplication.class, args); } }
[ "Davebowman276@gmail.com" ]
Davebowman276@gmail.com
0686827b37568e256ca3d49c6e4a6327df6ee9e7
eebe49436b4d2f7be67ed92e98359e8be94b845e
/al-game/admincommands/Ban.java
3f757e8d2850c58408e188d49f54ad6018199727
[]
no_license
hejiangping2022/AionEmu
f6548318281a4dc8e397ccd58b24e0851d801f05
62637482ec42ee4e3021a630a2fe4b49c3828e8c
refs/heads/main
2023-03-20T04:31:21.377552
2020-12-10T02:35:27
2020-12-10T02:35:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,693
java
package admincommands; import com.aionemu.commons.database.dao.DAOManager; import com.aionemu.gameserver.configs.administration.AdminConfig; import com.aionemu.gameserver.dao.PlayerDAO; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.network.loginserver.LoginServer; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.Util; import com.aionemu.gameserver.utils.chathandlers.AdminCommand; import com.aionemu.gameserver.world.World; public class Ban extends AdminCommand { public Ban() { super("ban"); } public void executeCommand(Player admin, String[] params) { if (admin.getAccessLevel() < AdminConfig.COMMAND_BAN) { PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command!"); return; } if (params == null || params.length < 1) { PacketSendUtility.sendMessage(admin, "Syntax: //ban <player> [account|ip|full] [time in minutes]"); return; } String name = Util.convertName(params[0]); int accountId = 0; Player player = World.getInstance().findPlayer(name); if (player != null) { accountId = player.getClientConnection().getAccount().getId(); } if (accountId == 0) { accountId = ((PlayerDAO) DAOManager.getDAO(PlayerDAO.class)).getAccountIdByName(name); } if (accountId == 0) { PacketSendUtility.sendMessage(admin, "Player " + name + " was not found!"); PacketSendUtility.sendMessage(admin, "Syntax: //ban <player> [account|ip|full] [time in minutes]"); return; } byte type = 3; if (params.length > 1) { String stype = params[1].toLowerCase(); if ("account".startsWith(stype)) { type = 1; } else if ("ip".startsWith(stype)) { type = 2; } else if ("full".startsWith(stype)) { type = 3; } else { PacketSendUtility.sendMessage(admin, "Syntax: //ban <player> [account|ip|full] [time in minutes]"); return; } } int time = 0; if (params.length > 2) { try { time = Integer.parseInt(params[2]); } catch (NumberFormatException e) { PacketSendUtility.sendMessage(admin, "Syntax: //ban <player> [account|ip|full] [time in minutes]"); return; } } LoginServer.getInstance().sendBanPacket(type, accountId, "", time, admin.getObjectId()); } }
[ "rafabertholdo@gmail.com" ]
rafabertholdo@gmail.com
c9ed5528fb71224c34c0280b8c442b393863f228
b4df4bc1c227972a064521eac664661f5a99386f
/ES-system/src/main/java/com/es/teacher/service/impl/TeaStuServiceImpl.java
ff83d999d13af26bfc77a47d0cd76a0326c2da4d
[ "MIT" ]
permissive
dongyangfu/es
91e4f3be1ff4ecebedf950a0a87619a577f6d906
03f8761be66b3063fa740d38e8b62e9a3099a27e
refs/heads/master
2023-04-13T23:40:30.711521
2021-04-27T15:10:21
2021-04-27T15:10:21
363,005,659
1
0
null
null
null
null
UTF-8
Java
false
false
3,965
java
package com.es.teacher.service.impl; import com.es.common.utils.DateUtils; import com.es.common.utils.StringUtils; import com.es.student.domain.StuUser; import com.es.teacher.domain.TeaStuRelDTO; import com.es.teacher.mapper.TeaStuMapper; import com.es.teacher.service.ITeaStuService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Stream; /** * 教师学生关系 业务层 * @Author qishuaibin */ @Service public class TeaStuServiceImpl implements ITeaStuService { @Resource private TeaStuMapper teaStuMapper; @Override public List<TeaStuRelDTO> selectStuUserListById(TeaStuRelDTO teaStuRelDTO) { List<TeaStuRelDTO> stuUsers = teaStuMapper.selectStuUserListById(teaStuRelDTO); int year = Integer.parseInt(DateUtils.dateYear()); int month = Integer.parseInt(DateUtils.dateMonth()); List<TeaStuRelDTO> stuList = new ArrayList<>(); for (TeaStuRelDTO teaStu: stuUsers) { int sem = (year - 1 - Integer.parseInt(teaStu.getStuPeriod())) * 2 + (month - 7 < 0 ? 1 : 2) + 1; String semester = teaStu.getSemester(); String semes = null; if( 1<month && month<7 || 7<=month && month<10 ){ semes = sem+"初"; } else if (5<month && month<8 || 11<=month && month<=12){ semes = sem+"末"; } if(Objects.equals(semes,semester)){ stuList.add(teaStu); } } return stuList; } @Override public List<Map<String, Object>> selectStuSelectList() { List<Map<String, Object>> stuUsers = teaStuMapper.selectStuSelectList(); return stuUsers; } @Override public Map<String, Object> selectStuByStuId(Long stuId) { return teaStuMapper.selectStuByStuId(stuId); } @Override public int updateStuScore(StuUser stuUser) { return teaStuMapper.updateStuScore(stuUser); } @Override public int updateStuScoreTemp(StuUser stuUser) { return teaStuMapper.updateStuScoreTemp(stuUser); } @Override public List<Map<String,Object>> selectStuListById(Long teaId) { List<Map<String,Object>> stuUsers = teaStuMapper.selectStuListById(teaId); return stuUsers; } @Override public int updateStatus(Map<String, Object> map) { return teaStuMapper.updateStatus(map); } @Override public int selectCountById(Long teaId) { return teaStuMapper.selectCountById(teaId); } @Override public int updateRejectAll(Long teaId) { return teaStuMapper.updateRejectAll(teaId); } @Override public int updateCourseStatus(Map<String, Object> map) { return teaStuMapper.updateCourseStatus(map); } @Override public int auditCourseStatus(Map<String, Object> map) { return teaStuMapper.auditCourseStatus(map); } @Override public Map<String, Object> selectPracticeId(String semester) { return teaStuMapper.selectPracticeId(semester); } @Override public int insertStuPracticeRel(Map<String, Object> map) { return teaStuMapper.insertStuPracticeRel(map); } @Override public List<Map<String, Object>> selectStuSelectListInterview(Map<String, Object> map) { return teaStuMapper.selectStuSelectListInterview(map); } @Override public int updateStuInterviewScore(Map<String, Object> map) { return teaStuMapper.updateStuInterviewScore(map); } @Override public int updateStuInterviewScoreTemp(Map<String, Object> map) { return teaStuMapper.updateStuInterviewScoreTemp(map); } @Override public Map<String, Object> selectStuByStuIdAndTeaId(Map<String, Object> map) { return teaStuMapper.selectStuByStuIdAndTeaId(map); } }
[ "281720213@qq.com" ]
281720213@qq.com
f2d9322964a6a2c5d082f9614e42d4f7300b6d33
e7ca69cd2ef2f2fb52360194235e71914e4de3cf
/src/test/java/com/anlsj/webservicedemo/WebserviceDemoApplicationTests.java
0c66541f4cf41fa43532656d44eb40af91ecd4d0
[]
no_license
FallenPuppet/webservicedemo
dc589c2db3d1c970412dc4b3e0854199dd66fde1
d7e0218982fa179466b52adecc07df4252254fbf
refs/heads/master
2020-07-23T19:24:58.226279
2019-09-10T23:48:28
2019-09-10T23:48:28
207,682,051
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.anlsj.webservicedemo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class WebserviceDemoApplicationTests { @Test public void contextLoads() { } }
[ "FallenPuppet@yeah.net" ]
FallenPuppet@yeah.net
ddd8a985535cb1d6b7a4b5b9f58529905ac936f0
ef18d99eff01a708dddfc2cbf77f68bb1d8aa889
/java/unclassified/algorithms/90.subsets-ii.java
c6868158054ac1093330e9e7f03179b762bce2d6
[ "MIT" ]
permissive
fengbaoheng/leetcode
53d5b6f92f7958d551e6297f77c4edfc042a4d58
e37535a06b0b4cb23de9a2cfa357eb689b1c06fb
refs/heads/master
2023-07-23T11:33:42.938862
2023-07-08T08:43:46
2023-07-08T08:43:46
131,551,048
1
0
MIT
2022-11-16T02:53:49
2018-04-30T03:13:55
Java
UTF-8
Java
false
false
879
java
/* * @lc app=leetcode.cn id=90 lang=java * * [90] 子集 II */ // @lc code=start import java.util.Arrays; import java.util.LinkedList; import java.util.List; class Solution { public List<List<Integer>> subsetsWithDup(int[] nums) { List<List<Integer>> ans = new LinkedList<>(); Arrays.sort(nums); getAns(nums, 0, new LinkedList<>(), ans); return ans; } private void getAns(int[] nums, int start, LinkedList<Integer> temp, List<List<Integer>> ans) { ans.add(new LinkedList<>(temp)); for (int i = start; i < nums.length; i++) { //和上个数字相等就跳过 if (i > start && nums[i] == nums[i - 1]) { continue; } temp.addLast(nums[i]); getAns(nums, i + 1, temp, ans); temp.removeLast(); } } } // @lc code=end
[ "fengbaoheng@qq.com" ]
fengbaoheng@qq.com
cd610136ed2761ab0557ec936ed00f610a5a76a9
ff580c3cf29f1c957cf1e3f2030fb5a412d14f3b
/app/src/main/java/com/cjy/flb/qrcode/decoding/CaptureActivityHandler.java
3b58cd4c2535c8aef80484f58ccd32669d0351b6
[ "Apache-2.0" ]
permissive
jianghw/DrugHousekeeper
0ea2c90a2035e109ff5bdd3f67df26874fbdf4bf
12bbfbaffd64ac53c848464c192558e51ecc8a90
refs/heads/master
2021-01-21T09:20:39.984601
2017-02-23T06:07:15
2017-02-23T06:07:36
82,890,663
0
0
null
null
null
null
UTF-8
Java
false
false
5,311
java
/* * Copyright (C) 2008 ZXing 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 com.cjy.flb.qrcode.decoding; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import com.cjy.flb.R; import com.cjy.flb.qrcode.camera.CameraManager; import com.cjy.flb.qrcode.capture.CaptureActivity; import com.cjy.flb.qrcode.view.ViewfinderResultPointCallback; import com.google.zxing.BarcodeFormat; import com.google.zxing.Result; import java.util.Vector; /** * This class handles all the messaging which comprises the state machine for capture. */ public final class CaptureActivityHandler extends Handler { private static final String TAG = CaptureActivityHandler.class.getSimpleName(); private final CaptureActivity activity; private final DecodeThread decodeThread; private State state; private enum State { PREVIEW, SUCCESS, DONE } public CaptureActivityHandler(CaptureActivity activity, Vector<BarcodeFormat> decodeFormats, String characterSet) { this.activity = activity; decodeThread = new DecodeThread(activity, decodeFormats, characterSet, new ViewfinderResultPointCallback(activity.getViewfinderView())); decodeThread.start(); state = State.SUCCESS; // Start ourselves capturing previews and decoding. CameraManager.get().startPreview(); restartPreviewAndDecode(); } @Override public void handleMessage(Message message) { switch (message.what) { case R.id.auto_focus: //Log.d(TAG, "Got auto-focus message"); // When one auto focus pass finishes, start another. This is the closest thing to // continuous AF. It does seem to hunt a bit, but I'm not sure what else to do. if (state == State.PREVIEW) { CameraManager.get().requestAutoFocus(this, R.id.auto_focus); } break; case R.id.restart_preview: Log.d(TAG, "Got restart preview message"); restartPreviewAndDecode(); break; case R.id.decode_succeeded: Log.d(TAG, "Got decode succeeded message"); state = State.SUCCESS; Bundle bundle = message.getData(); /***********************************************************************/ Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);//���ñ����߳� activity.handleDecode((Result) message.obj, barcode);//���ؽ�� /***********************************************************************/ break; case R.id.decode_failed: // We're decoding as fast as possible, so when one decode fails, start another. state = State.PREVIEW; CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); break; case R.id.return_scan_result: Log.d(TAG, "Got return scan result message"); activity.setResult(Activity.RESULT_OK, (Intent) message.obj); activity.finish(); break; case R.id.launch_product_query: Log.d(TAG, "Got product query message"); String url = (String) message.obj; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); activity.startActivity(intent); break; } } public void quitSynchronously() { state = State.DONE; CameraManager.get().stopPreview(); Message quit = Message.obtain(decodeThread.getHandler(), R.id.quit); quit.sendToTarget(); try { decodeThread.join(); } catch (InterruptedException e) { // continue } // Be absolutely sure we don't send any queued up messages removeMessages(R.id.decode_succeeded); removeMessages(R.id.decode_failed); } private void restartPreviewAndDecode() { if (state == State.SUCCESS) { state = State.PREVIEW; CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); CameraManager.get().requestAutoFocus(this, R.id.auto_focus); activity.drawViewfinder(); } } }
[ "jiaswei89@gmail.com" ]
jiaswei89@gmail.com
5a070f30e1c9f4c5ebc914177e9c1c8e0c43b6de
de00db5ef3e41072fdfc7eb4ff2dca5a4b502004
/src/me/fluxcapacitor/dragongamecore/inventories/JoinInventory.java
0f5f374330fadcb516cfb29e65103762b0bd1184
[]
no_license
FluxCapacitor2/DragonGameCore
06fd79e624ede7ffe517def1dbf2d17acaa671b0
f65db3c17dc29d7ab3888ee083d53ad05956a6cc
refs/heads/master
2020-06-03T18:28:56.784100
2019-07-04T23:07:51
2019-07-04T23:07:51
191,682,745
0
0
null
null
null
null
UTF-8
Java
false
false
3,126
java
package me.fluxcapacitor.dragongamecore.inventories; import me.fluxcapacitor.dragongamecore.DragonGame; import me.fluxcapacitor.dragongamecore.Main; import me.fluxcapacitor.dragongamecore.Wrapper; import me.fluxcapacitor.dragongamecore.commands.LeaveCommand; import me.fluxcapacitor.dragongamecore.util.Items; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.Inventory; public class JoinInventory extends GUI { @Override public void open(DragonGame game, Player player) { Inventory inv = Bukkit.createInventory(null, 27, game.getName()); //Quick join inv.setItem(12, Items.createItem("&aQuick Join", Material.PAPER, new String[] {"&7BlueDragon will decide what game", "&7will start fastest, and put you", "&7right in."})); //Choose team if (!game.isFFA()) inv.setItem(4, Items.createItem("&eSelect Preferred Team", Material.GOLD_SWORD, new String[] {"&7Pick a team that you prefer to", "&7join before you join a game."})); //Game info inv.setItem(13, Items.createItem("&e&l" + game.getName(), Material.EMERALD, new String[] {"&fClick for game information"})); //Map selector inv.setItem(14, Items.createItem("&dMap Selector", Material.BOOK_AND_QUILL, new String[] {"&cRequires &aPremium", "&7Like a certain map? Pick any", "&7one you want. The game may take", "&7a little longer to start, but it'll be", "&7worth the wait."})); //Leave game if (game.getWrapper().isQueuedOrIngameOrSpectating(player)) { inv.setItem(22, Items.createItem("&cLeave Queue/Game", Material.BED, new String[] {"&7Leave the current game or ", "&7queue that you are in."})); } player.openInventory(inv); this.inventories.add(inv); } @Override public void handleClick(DragonGame game, Wrapper wrapper, Player player, Inventory inventory, int slot, ClickType clickType) { switch (slot) { case 4: //Select preferred team player.closeInventory(); Main.instance.guiManager.teamInv.open(game, player); break; case 12: //Random map. wrapper.findMostPopulatedMap().queue.add(player); player.closeInventory(); break; case 13: //Give more information about the game. Bukkit.dispatchCommand(player, "info " + game.getName()); player.closeInventory(); break; case 14: //Open the map selector. player.closeInventory(); Main.instance.guiManager.mapInv.open(game, player); break; case 22: //Unqueue from the game. LeaveCommand.removePlayerFromGame(player, game); player.closeInventory(); break; } } }
[ "tntawkward@gmail.com" ]
tntawkward@gmail.com
2213d4cbd768e5257043a8388032c04f92352948
12b14b30fcaf3da3f6e9dc3cb3e717346a35870a
/examples/commons-math3/mutations/mutants-AbstractRealDistribution/72/org/apache/commons/math3/distribution/AbstractRealDistribution.java
2aacc16977f59e4c5b58a28967bf13a353fada0b
[ "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
10,268
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.distribution; import java.io.Serializable; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.solvers.UnivariateSolverUtils; import org.apache.commons.math3.exception.NotStrictlyPositiveException; import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.OutOfRangeException; import org.apache.commons.math3.exception.util.LocalizedFormats; import org.apache.commons.math3.random.RandomGenerator; import org.apache.commons.math3.random.RandomDataImpl; import org.apache.commons.math3.util.FastMath; /** * Base class for probability distributions on the reals. * Default implementations are provided for some of the methods * that do not vary from distribution to distribution. * * @version $Id$ * @since 3.0 */ public abstract class AbstractRealDistribution implements RealDistribution, Serializable { /** Default accuracy. */ public static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY = 1e-6; /** Serializable version identifier */ private static final long serialVersionUID = -38038050983108802L; /** * RandomData instance used to generate samples from the distribution. * @deprecated As of 3.1, to be removed in 4.0. Please use the * {@link #random} instance variable instead. */ @Deprecated protected RandomDataImpl randomData = new RandomDataImpl(); /** * RNG instance used to generate samples from the distribution. * @since 3.1 */ protected final RandomGenerator random; /** Solver absolute accuracy for inverse cumulative computation */ private double solverAbsoluteAccuracy = SOLVER_DEFAULT_ABSOLUTE_ACCURACY; /** * @deprecated As of 3.1, to be removed in 4.0. Please use * {@link #AbstractRealDistribution(RandomGenerator)} instead. */ @Deprecated protected AbstractRealDistribution() { // Legacy users are only allowed to access the deprecated "randomData". // New users are forbidden to use this constructor. random = null; } /** * @param rng Random number generator. * @since 3.1 */ protected AbstractRealDistribution(RandomGenerator rng) { random = rng; } /** * {@inheritDoc} * * The default implementation uses the identity * <p>{@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}</p> * * @deprecated As of 3.1 (to be removed in 4.0). Please use * {@link #probability(double,double)} instead. */ @Deprecated public double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException { return probability(x0, x1); } /** * For a random variable {@code X} whose values are distributed according * to this distribution, this method returns {@code P(x0 < X <= x1)}. * * @param x0 Lower bound (excluded). * @param x1 Upper bound (included). * @return the probability that a random variable with this distribution * takes a value between {@code x0} and {@code x1}, excluding the lower * and including the upper endpoint. * @throws NumberIsTooLargeException if {@code x0 > x1}. * * The default implementation uses the identity * {@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)} * * @since 3.1 */ public double probability(double x0, double x1) { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } return cumulativeProbability(x1) - cumulativeProbability(x0); } /** * {@inheritDoc} * * The default implementation returns * <ul> * <li>{@link #getSupportLowerBound()} for {@code p = 0},</li> * <li>{@link #getSupportUpperBound()} for {@code p = 1}.</li> * </ul> */ public double inverseCumulativeProbability(final double p) throws OutOfRangeException { /* * IMPLEMENTATION NOTES * -------------------- * Where applicable, use is made of the one-sided Chebyshev inequality * to bracket the root. This inequality states that * P(X - mu >= k * sig) <= 1 / (1 + k^2), * mu: mean, sig: standard deviation. Equivalently * 1 - P(X < mu + k * sig) <= 1 / (1 + k^2), * F(mu + k * sig) >= k^2 / (1 + k^2). * * For k = sqrt(p / (1 - p)), we find * F(mu + k * sig) >= p, * and (mu + k * sig) is an upper-bound for the root. * * Then, introducing Y = -X, mean(Y) = -mu, sd(Y) = sig, and * P(Y >= -mu + k * sig) <= 1 / (1 + k^2), * P(-X >= -mu + k * sig) <= 1 / (1 + k^2), * P(X <= mu - k * sig) <= 1 / (1 + k^2), * F(mu - k * sig) <= 1 / (1 + k^2). * * For k = sqrt((1 - p) / p), we find * F(mu - k * sig) <= p, * and (mu - k * sig) is a lower-bound for the root. * * In cases where the Chebyshev inequality does not apply, geometric * progressions 1, 2, 4, ... and -1, -2, -4, ... are used to bracket * the root. */ if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } double lowerBound = getSupportLowerBound(); if (p == 0.0) { return lowerBound; } double upperBound = getSupportUpperBound(); if (p == 1.0) { return upperBound; } final double mu = getNumericalMean(); final double sig = FastMath.sqrt(getNumericalVariance()); final boolean chebyshevApplies; chebyshevApplies = !(Double.isInfinite(mu) || Double.isNaN(mu) || Double.isInfinite(sig) || Double.isNaN(sig)); if (lowerBound == Double.NEGATIVE_INFINITY) { if (chebyshevApplies) { lowerBound = mu - sig * FastMath.sqrt((1.0 - p) + p); } else { lowerBound = -1.0; while (cumulativeProbability(lowerBound) >= p) { lowerBound *= 2.0; } } } if (upperBound == Double.POSITIVE_INFINITY) { if (chebyshevApplies) { upperBound = mu + sig * FastMath.sqrt(p / (1. - p)); } else { upperBound = 1.0; while (cumulativeProbability(upperBound) < p) { upperBound *= 2.0; } } } final UnivariateFunction toSolve = new UnivariateFunction() { public double value(final double x) { return cumulativeProbability(x) - p; } }; double x = UnivariateSolverUtils.solve(toSolve, lowerBound, upperBound, getSolverAbsoluteAccuracy()); if (!isSupportConnected()) { /* Test for plateau. */ final double dx = getSolverAbsoluteAccuracy(); if (x - dx >= getSupportLowerBound()) { double px = cumulativeProbability(x); if (cumulativeProbability(x - dx) == px) { upperBound = x; while (upperBound - lowerBound > dx) { final double midPoint = 0.5 * (lowerBound + upperBound); if (cumulativeProbability(midPoint) < px) { lowerBound = midPoint; } else { upperBound = midPoint; } } return upperBound; } } } return x; } /** * Returns the solver absolute accuracy for inverse cumulative computation. * You can override this method in order to use a Brent solver with an * absolute accuracy different from the default. * * @return the maximum absolute error in inverse cumulative probability estimates */ protected double getSolverAbsoluteAccuracy() { return solverAbsoluteAccuracy; } /** {@inheritDoc} */ public void reseedRandomGenerator(long seed) { random.setSeed(seed); randomData.reSeed(seed); } /** * {@inheritDoc} * * The default implementation uses the * <a href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"> * inversion method. * </a> */ public double sample() { return inverseCumulativeProbability(random.nextDouble()); } /** * {@inheritDoc} * * The default implementation generates the sample by calling * {@link #sample()} in a loop. */ public double[] sample(int sampleSize) { if (sampleSize <= 0) { throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES, sampleSize); } double[] out = new double[sampleSize]; for (int i = 0; i < sampleSize; i++) { out[i] = sample(); } return out; } /** * {@inheritDoc} * * @return zero. * @since 3.1 */ public double probability(double x) { return 0d; } }
[ "kesina@Kesinas-MBP.lan" ]
kesina@Kesinas-MBP.lan
c1a6b85e4d1c3301609bdde4a22852e178e49681
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_337/Productionnull_33643.java
3ff086fe74e09ee1b9903b92742d8efcb7fe6ae2
[]
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
588
java
package org.gradle.test.performancenull_337; public class Productionnull_33643 { private final String property; public Productionnull_33643(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
eb9b16b36d106322554f31710d937eb4dab5cbfc
0eae9825ee662c1a5169a0ee1ccebd6a6a078bd5
/src/main/java/com/idealo/robot/command/Command.java
b6e48bcdafd81ead00e3a0b61105138418e98db1
[]
no_license
mike-adamenko/robot
d793208463b3bb1c61c5e7ab2d166d32b30e396e
f66b96b21bbc0b43aa07c3bca7306077c1f055e2
refs/heads/master
2021-10-21T18:09:41.722638
2019-03-05T15:47:34
2019-03-05T15:47:34
173,144,303
0
0
null
null
null
null
UTF-8
Java
false
false
473
java
package com.idealo.robot.command; import com.idealo.robot.model.Robot; /** * @author Mike Adamenko (mnadamenko@gmail.com) */ public abstract class Command { private String[] args; public Command() { } public Command(String[] args) { this.args = args; } public String[] getArgs() { return args; } public void setArgs(String[] args) { this.args = args; } public abstract void execute(Robot robot); }
[ "mnadamenko@gmail.com" ]
mnadamenko@gmail.com
53421510fdd655800fe8c68f6884a4e9074ab45f
7b10b15cebe7e1fa67820f14bd4188627a933b79
/SimpleDht/app/src/main/java/edu/buffalo/cse/cse486586/simpledht/SimpleDhtProvider.java
1f92cd5b4570c0e24921478bcb6c18ff58046342
[]
no_license
SuhashBollu/Distributed-Systems
8edf93c1a42dbda2ab18aa4f5da0fa6b373b7755
2861285cbca10706f7bdc4439aded98e1182abd8
refs/heads/master
2022-12-12T20:21:03.655041
2020-08-28T06:55:21
2020-08-28T06:55:21
257,720,531
0
0
null
null
null
null
UTF-8
Java
false
false
33,877
java
package edu.buffalo.cse.cse486586.simpledht; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.UnknownHostException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.Formatter; import java.util.HashMap; import java.util.Iterator; import java.util.TreeMap; import android.app.Activity; import android.content.ContentProvider; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.MatrixCursor; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.telephony.TelephonyManager; import android.util.Log; import android.content.ContextWrapper; import android.widget.TextView; import edu.buffalo.cse.cse486586.simpledht.SimpleDhtActivity; import static android.content.Context.MODE_PRIVATE; public class SimpleDhtProvider extends ContentProvider { private static final String TAG = SimpleDhtProvider.class.getName(); //final static Uri providerUri = buildUri("content", "edu.buffalo.cse.cse486586.simpledht.provider"); static final String REMOTE_PORT0 = "11108"; static final String REMOTE_PORT1 = "11112"; static final String REMOTE_PORT2 = "11116"; static final String REMOTE_PORT3 = "11120"; static final String REMOTE_PORT4 = "11124"; String REMOTE_PORT_NUM0 = "5554"; String REMOTE_PORT_NUM1 = "5556"; String REMOTE_PORT_NUM2 = "5558"; String REMOTE_PORT_NUM3 = "5560"; String REMOTE_PORT_NUM4 = "5562"; String myPort_hashed = ""; String predecessor_hashed = ""; String successor_hashed = ""; String predecessor_port = ""; String successor_port = ""; String primary_port = ""; String portStr = ""; String myPort = ""; ArrayList<String> msgs_received = new ArrayList<String>(); static final int SERVER_PORT = 10000; String remote_ports[] = {REMOTE_PORT0, REMOTE_PORT1, REMOTE_PORT2, REMOTE_PORT3, REMOTE_PORT4}; TreeMap<String, String> port_nums_map = new TreeMap<String, String>(); TreeMap<String, String> active_port_nums_map = new TreeMap<String, String>(); TreeMap<String, String> active_port_nums_map_hashed = new TreeMap<String, String>(); static Uri providerUri = null; private static Uri buildUri(String scheme, String authority, String path) { Uri.Builder uriBuilder = new Uri.Builder(); uriBuilder.authority(authority); uriBuilder.scheme(scheme); return uriBuilder.build(); } @Override public int delete(Uri uri, String selection, String[] selectionArgs) { // TODO Auto-generated method stub Log.d(TAG, "selection " + selection); getContext().deleteFile(selection); return 0; } @Override public String getType(Uri uri) { // TODO Auto-generated method stub return null; } @Override public Uri insert(Uri uri, ContentValues values) { // TODO Auto-generated method stub String fileName = values.get("key").toString(); String msgValue = values.get("value").toString(); Log.v(TAG, "Received for insertion key " + fileName); Log.v(TAG, "Received for insertion val " + msgValue); String[] value_array = msgValue.split("\\s+"); if (value_array.length > 1) { Log.d(TAG, "Inserting key " + fileName + " val " + msgValue); try { FileOutputStream fos = getContext().openFileOutput(fileName, MODE_PRIVATE); fos.write(msgValue.getBytes()); fos.close(); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } return providerUri; } String fileName_hashed = ""; try { fileName_hashed = genHash(fileName); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } Log.d(TAG, "fileName_hashed.compareTo(myPort_hashed) " + Integer.toString(fileName_hashed.compareTo(myPort_hashed))); Log.d(TAG, "fileName_hashed.compareTo(predecessor_hashed) " + Integer.toString(fileName_hashed.compareTo(predecessor_hashed))); // if(!msgs_received.contains(fileName)){ // msgs_received.add(fileName); if (myPort.equals(primary_port) && (fileName_hashed.compareTo(myPort_hashed) > 0 && fileName_hashed.compareTo(predecessor_hashed) > 0 || fileName_hashed.compareTo(myPort_hashed) < 0 && fileName_hashed.compareTo(predecessor_hashed) < 0)) { Log.d(TAG, "Inserting key " + fileName + " val " + msgValue); try { FileOutputStream fos = getContext().openFileOutput(fileName, MODE_PRIVATE); fos.write(msgValue.getBytes()); fos.close(); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } return providerUri; } if (fileName_hashed.compareTo(myPort_hashed) <= 0 && fileName_hashed.compareTo(predecessor_hashed) > 0) { Log.d(TAG, "Inserting key " + fileName + " val " + msgValue); try { FileOutputStream fos = getContext().openFileOutput(fileName, MODE_PRIVATE); fos.write(msgValue.getBytes()); fos.close(); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } return providerUri; } else { if(successor_port!=null){ if(!successor_port.equals("")){ Log.v(TAG, "Sending msg to successor " + successor_port); new ClientTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, "insert",fileName + " " + msgValue, successor_port, myPort);}else{ Log.d(TAG, "successor port null"); ContentValues keyValueToInsert = new ContentValues(); keyValueToInsert.put("key", fileName); keyValueToInsert.put("value", msgValue + " failed"); Uri newUri = getContext().getContentResolver().insert(SimpleDhtProvider.providerUri, keyValueToInsert); }} return null; } // }else{ // Log.d(TAG, "Inserting key esacping contains" + fileName + " val " + msgValue); // try { // FileOutputStream fos = getContext().openFileOutput(fileName, MODE_PRIVATE); // fos.write(msgValue.getBytes()); // fos.close(); // } catch (FileNotFoundException e) { // Log.e(TAG, "File Not Found Exception"); // } catch (IOException e) { // Log.e(TAG, "Input/Output Exception"); // } // // return providerUri; // } // Log.d(TAG, "Inserting key "+fileName+" val "+msgValue); // try { // FileOutputStream fos = getContext().openFileOutput(fileName, MODE_PRIVATE); // fos.write(msgValue.getBytes()); // fos.close(); // } catch (FileNotFoundException e) { // Log.e(TAG, "File Not Found Exception"); // } catch (IOException e) { // Log.e(TAG, "Input/Output Exception"); // } // // return providerUri; } @Override public boolean onCreate() { // TODO Auto-generated method stub TelephonyManager tel = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); portStr = tel.getLine1Number().substring(tel.getLine1Number().length() - 4); myPort = String.valueOf((Integer.parseInt(portStr) * 2)); Log.d(TAG, "mPort " + myPort); Log.d(TAG, "mPortNum " + portStr); providerUri = buildUri("content", "edu.buffalo.cse.cse486586.simpledht.provider", myPort); if(portStr.equals("5554")){ active_port_nums_map.put(portStr, myPort); } String hashed_myport_num = ""; try { hashed_myport_num = genHash(portStr); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } if(portStr.equals("5554")){ active_port_nums_map_hashed.put(hashed_myport_num, myPort); } Log.v(TAG, "REMOTE_PORT_NUM0" + REMOTE_PORT_NUM0); Log.v(TAG, "REMOTE_PORT_NUM1" + REMOTE_PORT_NUM1); Log.v(TAG, "REMOTE_PORT_NUM2" + REMOTE_PORT_NUM2); Log.v(TAG, "REMOTE_PORT_NUM3" + REMOTE_PORT_NUM3); Log.v(TAG, "REMOTE_PORT_NUM4" + REMOTE_PORT_NUM4); port_nums_map.put(REMOTE_PORT_NUM0, REMOTE_PORT0); port_nums_map.put(REMOTE_PORT_NUM1, REMOTE_PORT1); port_nums_map.put(REMOTE_PORT_NUM2, REMOTE_PORT2); port_nums_map.put(REMOTE_PORT_NUM3, REMOTE_PORT3); port_nums_map.put(REMOTE_PORT_NUM4, REMOTE_PORT4); try { myPort_hashed = genHash(portStr); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } Log.v(TAG, "myPort_hashed" + myPort_hashed); //Finding available nodes for join if(!portStr.equals("5554")){ new ClientTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, "request","request "+portStr, "11108", myPort); } try { /* * Create a server socket as well as a thread (AsyncTask) that listens on the server * port. * * AsyncTask is a simplified thread construct that Android provides. Please make sure * you know how it works by reading * http://developer.android.com/reference/android/os/AsyncTask.html */ Log.d(TAG, "Creating server socket"); ServerSocket serverSocket = new ServerSocket(SERVER_PORT); new ServerTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, serverSocket); } catch (IOException e) { /* * Log is a good way to debug your code. LogCat prints out all the messages that * Log class writes. * * Please read http://developer.android.com/tools/debugging/debugging-projects.html * and http://developer.android.com/tools/debugging/debugging-log.html * for more information on debugging. */ Log.e(TAG, "Can't create a ServerSocket" + e); } return false; } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { // TODO Auto-generated method stub Log.d(TAG, "selection " + selection); if (selection.equals("@")) { Log.v(TAG, "inside @"); String[] list_of_files = getContext().fileList(); MatrixCursor cursor = new MatrixCursor(new String[]{"key", "value"}); for (String str : list_of_files) { String msg = ""; try { Log.d(TAG, "selection " + str); FileInputStream fis = getContext().openFileInput(str); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fis)); msg = bufferedReader.readLine(); Log.d(TAG, "message " + msg); fis.close(); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } cursor.addRow(new String[]{str, msg}); Log.v("msg", msg); } return cursor; } else if (selection.equals("*")) { Log.v(TAG, "inside *"); String[] list_of_files = getContext().fileList(); MatrixCursor cursor = new MatrixCursor(new String[]{"key", "value"}); for (String str : list_of_files) { String msg = ""; try { Log.d(TAG, "selection " + str); FileInputStream fis = getContext().openFileInput(str); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fis)); msg = bufferedReader.readLine(); Log.d(TAG, "message " + msg); fis.close(); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } cursor.addRow(new String[]{str, msg}); Log.v("msg", msg); } for(String rm_port:remote_ports){ if(!rm_port.equals(myPort)){ try { Log.d(TAG, "sending query @ to port "+rm_port); Socket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(rm_port)); String msgToSend = "@ query"; OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); InputStream inputStream = socket.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); //socket.close(); String messageFromClient = bufferedReader.readLine(); Log.d(TAG, "msg received from client for query " + messageFromClient); if(messageFromClient!=null){ if(!messageFromClient.equals("")){ if(!messageFromClient.equals(" ")){ //MatrixCursor cursor1 = new MatrixCursor(new String[]{"key", "value"}); String[] pairs = messageFromClient.split("\\|"); for(String st:pairs){ Log.d(TAG, "pair "+st); } for(String pair: pairs){ pair.trim(); String[] splits = pair.split("\\s+"); for(String st: splits){ Log.d(TAG, "split "+st); } cursor.addRow(new String[]{splits[0], splits[1]}); }}}} } catch (IOException ex) { ex.printStackTrace(); }catch (NullPointerException e){ Log.d(TAG, e.getMessage()); } }} return cursor; } else { String msg = ""; MatrixCursor cursor = new MatrixCursor(new String[]{"key", "value"}); try { FileInputStream fis = getContext().openFileInput(selection); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fis)); msg = bufferedReader.readLine(); Log.d(TAG, "message " + msg); fis.close(); cursor.addRow(new String[]{selection, msg}); Log.v("msg", msg); Log.v("query", selection); } catch (FileNotFoundException e) { Log.e(TAG, "File Not Found Exception"); try { Log.d(TAG, "sending query to successor"+successor_port); Socket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(successor_port)); String msgToSend = selection+" query"; OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); InputStream inputStream = socket.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String messageFromClient = bufferedReader.readLine(); Log.d(TAG, "msg received from client for query " + messageFromClient); MatrixCursor cursor1 = new MatrixCursor(new String[]{"key", "value"}); String[] pairs = messageFromClient.split("\\|"); for(String st:pairs){ Log.d(TAG, "pair "+st); } for(String pair: pairs){ pair.trim(); String[] splits = pair.split("\\s+"); for(String st: splits){ Log.d(TAG, "split "+st); } cursor1.addRow(new String[]{splits[0], splits[1]}); } return cursor1; } catch (IOException ex) { ex.printStackTrace(); } } catch (IOException e) { Log.e(TAG, "Input/Output Exception"); } return cursor; } } @Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { // TODO Auto-generated method stub return 0; } private String genHash(String input) throws NoSuchAlgorithmException { MessageDigest sha1 = MessageDigest.getInstance("SHA-1"); byte[] sha1Hash = sha1.digest(input.getBytes()); Formatter formatter = new Formatter(); for (byte b : sha1Hash) { formatter.format("%02x", b); } return formatter.toString(); } private class ClientTask extends AsyncTask<String, Void, Void> { @Override protected Void doInBackground(String... msgs) { try { /* * TODO: Fill in your client code that sends out a message. */ /* *The Socket API used is learnt from Oracle tutorials on Socket Communications(suggested by professor) *URL: https://www.oracle.com/technetwork/java/socket-140484.html */ //Writing the String msgToSend to output stream of data //String[] msgToSend_array = msgToSend.split("\\s+"); if (msgs[0].equals("insert")) { String remote_port = msgs[2]; Socket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(remote_port)); String msgToSend = msgs[1]; Log.v(TAG, "Inside client, sending msg for insert to " + remote_port); OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); InputStream inputStream = socket.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String messageFromClient = bufferedReader.readLine(); Log.d(TAG, "msg received from string " + messageFromClient); if (messageFromClient == null) { Log.d(TAG, "msg received for split " + msgs[1]); String[] strReceived = msgs[1].split("\\s+"); Log.d(TAG, "key received" + strReceived[0]); Log.d(TAG, "val received" + strReceived[1]); ContentValues keyValueToInsert = new ContentValues(); keyValueToInsert.put("key", strReceived[0]); keyValueToInsert.put("value", strReceived[1] + " failed"); Uri newUri = getContext().getContentResolver().insert(SimpleDhtProvider.providerUri, keyValueToInsert); } }else if(msgs[0].equals("request")){ String remote_port = msgs[2]; Socket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(remote_port)); String msgToSend = msgs[1]; Log.v(TAG, "Inside client, sending msg for request to " + remote_port); OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); } else { String remote_port = msgs[1]; Socket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(remote_port)); String msgToSend = msgs[0]; Log.v(TAG, "Inside client, sending msg to " + remote_port); OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); } } catch (UnknownHostException e) { Log.e(TAG, "ClientTask UnknownHostException"); } catch (IOException e) { Log.e(TAG, "ClientTask socket IOException"); } catch (NullPointerException e) { } return null; } } private class ServerTask extends AsyncTask<ServerSocket, String, Void> { int msg_count = 0; @Override protected Void doInBackground(ServerSocket... sockets) { ServerSocket serverSocket = sockets[0]; /* * TODO: Fill in your server code that receives messages and passes them * to onProgressUpdate(). */ /* *The Socket API used is learnt from Oracle tutorials(suggested by professor) on socket programming *URL: https://www.oracle.com/technetwork/java/socket-140484.html */ try { //Server listening for incoming client connections and sending the message from client to UI Thread //While loop to keep the server listening for client requests while (true) { //Listens for client requests Socket socket = serverSocket.accept(); //Gets byte stream from client InputStream inputStream = socket.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); //Reads and stores the data in a string String messageFromClient = bufferedReader.readLine(); Log.v(TAG, "Received message from client " + messageFromClient); if(messageFromClient!=null&&!messageFromClient.equals("")){ String[] msgs_received = messageFromClient.split("\\s+"); String key = msgs_received[0]; String value = msgs_received[1]; Log.d(TAG, "key server "+key+" val server"+value); if(portStr.equals("5554")){ if(key.equals("request")){ Log.d(TAG, "received node request"); active_port_nums_map.put(value, port_nums_map.get(value)); String hashed_num = ""; try { hashed_num = genHash(value); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } active_port_nums_map_hashed.put(hashed_num, port_nums_map.get(value)); Log.d(TAG, "printing values in map"); for(String st: active_port_nums_map_hashed.keySet()){ Log.d(TAG, st+" "+active_port_nums_map_hashed.get(st)); } StringBuilder sb = new StringBuilder(); for(String st: active_port_nums_map.keySet()){ sb.append(st); sb.append(" "); } for(String st : active_port_nums_map.values()){ if(!st.equals("11108")){ Socket socket1 = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}), Integer.parseInt(st)); String msgToSend = "nodes "+sb.toString(); OutputStream outputStream = socket1.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(msgToSend); } } int i = 0; Iterator iterator = active_port_nums_map_hashed.keySet().iterator(); while (iterator.hasNext()) { if (iterator.next().equals(myPort_hashed)) { break; } i++; } primary_port = active_port_nums_map_hashed.get(active_port_nums_map_hashed.firstKey()); Log.v(TAG, "primary_port" + primary_port); Log.d(TAG, "my loc "+i); ArrayList<String> keys_map = new ArrayList<String>(active_port_nums_map_hashed.keySet()); if (i > 0) { predecessor_hashed = keys_map.get(i - 1); } else { predecessor_hashed = keys_map.get(keys_map.size() - 1); } if (i < keys_map.size() - 1) { successor_hashed = keys_map.get(i + 1); } else { successor_hashed = keys_map.get(0); } predecessor_port = active_port_nums_map_hashed.get(predecessor_hashed); successor_port = active_port_nums_map_hashed.get(successor_hashed); Log.v(TAG, "predecessor_port" + predecessor_port); Log.v(TAG, "successor_port" + successor_port); } } if(!portStr.equals("5554")){ if(key.equals("nodes")){ Log.d(TAG, "received nodes list"); active_port_nums_map.clear(); for(int i =0;i<msgs_received.length;i++){ if(i!=0){ String curr_hashed= ""; try { curr_hashed = genHash(msgs_received[i]); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } active_port_nums_map_hashed.put(curr_hashed, port_nums_map.get(msgs_received[i])); } } Log.d(TAG, "printing values in map"); for(String st: active_port_nums_map_hashed.keySet()){ Log.d(TAG, st+" "+active_port_nums_map_hashed.get(st)); } int i = 0; Iterator iterator = active_port_nums_map_hashed.keySet().iterator(); while (iterator.hasNext()) { if (iterator.next().equals(myPort_hashed)) { break; } i++; } primary_port = active_port_nums_map_hashed.get(active_port_nums_map_hashed.firstKey()); Log.v(TAG, "primary_port" + primary_port); Log.d(TAG, "my loc "+i); ArrayList<String> keys_map = new ArrayList<String>(active_port_nums_map_hashed.keySet()); if (i > 0) { predecessor_hashed = keys_map.get(i - 1); } else { predecessor_hashed = keys_map.get(keys_map.size() - 1); } if (i < keys_map.size() - 1) { successor_hashed = keys_map.get(i + 1); } else { successor_hashed = keys_map.get(0); } predecessor_port = active_port_nums_map_hashed.get(predecessor_hashed); successor_port = active_port_nums_map_hashed.get(successor_hashed); Log.v(TAG, "predecessor_port" + predecessor_port); Log.v(TAG, "successor_port" + successor_port); } } if(value.equals("query")){ Log.d(TAG, "recievd query from client"+key); Cursor cursor = getContext().getContentResolver().query(providerUri, null, key, null, null); StringBuilder sb = new StringBuilder(); while(cursor.moveToNext()){ sb.append(cursor.getString(0)); sb.append(" "); sb.append(cursor.getString(1)); sb.append("|"); } OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println(sb.toString()); Log.v(TAG, "printing ths sb from cursor"+sb.toString()); }else { if (!key.equals("nodes") && !key.equals("request")) { String key_hashed = ""; try { key_hashed = genHash(key); } catch (Exception e) { } if (key_hashed.compareTo(myPort_hashed) < 0) { publishProgress(messageFromClient); OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println("success"); } else { publishProgress(messageFromClient); OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream, true); printWriter.println("success"); } } } }} } catch (IOException e) { Log.e(TAG, "Cannot read input stream from client"); } return null; } protected void onProgressUpdate(String... strings) { /* * The following code displays what is received in doInBackground(). */ String[] strReceived = strings[0].split("\\s+"); Log.d(TAG, "key received" + strReceived[0]); Log.d(TAG, "val received" + strReceived[1]); ContentValues keyValueToInsert = new ContentValues(); keyValueToInsert.put("key", strReceived[0]); keyValueToInsert.put("value", strReceived[1]); msg_count++; Uri newUri = getContext().getContentResolver().insert(SimpleDhtProvider.providerUri, keyValueToInsert); return; } } }
[ "suhashbollu@gmail.com" ]
suhashbollu@gmail.com
7e33cddced3560530c704071b5b14c5e91854b8c
eb352a7bfa8b6761088a9b6f31d2b3edc9fd8978
/app/src/main/java/com/example/dell/yukao1/view/IView.java
31d673d32f45c1eb9a612ce5db6eb68bc55a1793
[]
no_license
Swallow-Lgy/yukao11
dc9d9fce5d7802c519891f9a86e587744ca45b26
6b79f81ed0c03c4f0c39161f8892dbc3ae42b813
refs/heads/master
2020-04-12T18:04:51.963830
2018-12-21T05:10:18
2018-12-21T05:10:18
162,668,495
0
0
null
null
null
null
UTF-8
Java
false
false
97
java
package com.example.dell.yukao1.view; public interface IView { void success(Object data); }
[ "2451528553@qq.com" ]
2451528553@qq.com
23bc530e479dec125766a285745874d063447812
26b7f30c6640b8017a06786e4a2414ad8a4d71dd
/src/number_of_direct_superinterfaces/i40197.java
76e1524ab6ea6f947953d4798079b45f1582ccf1
[]
no_license
vincentclee/jvm-limits
b72a2f2dcc18caa458f1e77924221d585f23316b
2fd1c26d1f7984ea8163bc103ad14b6d72282281
refs/heads/master
2020-05-18T11:18:41.711400
2014-09-14T04:25:18
2014-09-14T04:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package number_of_direct_superinterfaces; public interface i40197 {}
[ "vincentlee.dolbydigital@yahoo.com" ]
vincentlee.dolbydigital@yahoo.com
a3a18ad54f6e14b255d6c1ba8e5c38d3723aca08
48c6884571c95d5e34890bc1196df1bad65948f5
/exe14.java
8d0d72d3906d4f6d2b1cef75ee4d749cdf95fdf1
[]
no_license
SathishRamadoss/java-labprograms
49934c36e36f57e38db31fb3764dbce71aeb718c
2b84092d77638599b3075390c0c471aa95631ec1
refs/heads/master
2020-03-29T15:00:02.896481
2018-09-24T02:23:43
2018-09-24T02:23:43
150,040,442
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
//Java Copy Constructor class Exp14{ int id; String name; Exp14(int i,String n){ id = i; name = n; } Exp14(Exp14 s){ id = s.id; name =s.name; } void display(){System.out.println(id+""+name);} public static void main(String args[]){ Exp14 s1 = new Exp14(111,"Deva"); Exp14 s2 = new Exp14(s1); s1.display(); s2.display(); } }
[ "noreply@github.com" ]
SathishRamadoss.noreply@github.com
56dd99b68b26c034ee4a972cc32d38c5d7cb2923
9553c418c7515558a907ee0b0b923ed63f06a3c5
/BridgeLab/Programs-master/Programs-master/JavaProgram/src/com/datastructure/MyDeque.java
1f5cbabb27d414d23ed71cfdd28a82be28e214a0
[]
no_license
sowndaraperumal/Bridelabz_Projects
4fede8cea4867968d2d34765e089189d303081c9
f595e076bf3a4e67c1e21abcffa5e59132e86eb1
refs/heads/main
2023-04-17T18:39:12.343592
2021-04-25T15:12:25
2021-04-25T15:12:25
361,451,118
0
0
null
null
null
null
UTF-8
Java
false
false
1,435
java
package com.datastructure; public class MyDeque { int cap=0,rear=-1,front=-1; Object obj1[]; /** * * @param scap size of the queue */ public MyDeque(int scap) { this.cap=scap; obj1=new Object[cap]; front=cap-1; } /** * * @param data for store in the queue add in front * @return boolean true or false */ boolean addRear(Object data) { if(rear==cap-1) { System.out.println("deque overflow"); return true; } obj1[++rear]=data; return true; } /** * * @param data for store in the queue add in last * @return boolean true or false */ boolean addFront(Object data) { if(front==rear) { System.out.println("dequeue"); return true; } obj1[front--]=data; return true; } /*@Override public String toString() { if(rear<=cap-1 && rear>0) { for(int i=0;i<=rear;i++) { System.out.print(obj1[i]+" "); } } else { for(int i=cap-1;i>front;i--) { System.out.println("hi"); System.out.println(obj2[i]+" "); } } return ""; }*/ /* * delete in last element in queue */ public Object removeRear() { if(rear==-1) { System.out.println("no elemnets"); return null; } return obj1[rear--]; } /* * delete in front element in queue */ public Object removeFront() { if(front==cap) { System.out.println("no elements"); return null; } return obj1[++front]; } }
[ "sowndaraperumal18@gmail.com" ]
sowndaraperumal18@gmail.com
3e359dd041fd29919c55930cf13b08c8c4e9cd8b
d483a4e01eacfddee8078beffe19d6c54b59f380
/Inhabitants/DOT/org.emftext.language.dot.resource.dot/src/org/emftext/language/dot/resource/dot/analysis/DotSUBGRAPHTYPETokenResolver.java
4e99c850f01c9f1fcd68a33925a80331f89754db
[]
no_license
DevBoost/EMFText-Zoo
1e05a438d30415e8582de0947af26d836fee46ce
c193113edcaa0f92634288782f22a21412f2c396
refs/heads/master
2020-04-06T06:56:44.588008
2013-09-16T09:47:33
2013-09-16T09:47:33
5,324,760
8
2
null
null
null
null
UTF-8
Java
false
false
1,696
java
/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ package org.emftext.language.dot.resource.dot.analysis; public class DotSUBGRAPHTYPETokenResolver implements org.emftext.language.dot.resource.dot.IDotTokenResolver { private org.emftext.language.dot.resource.dot.analysis.DotDefaultTokenResolver defaultTokenResolver = new org.emftext.language.dot.resource.dot.analysis.DotDefaultTokenResolver(); public java.lang.String deResolve(java.lang.Object value, org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject container) { java.lang.String result = defaultTokenResolver.deResolve(value, feature, container); return result; } public void resolve(java.lang.String lexem, org.eclipse.emf.ecore.EStructuralFeature feature, org.emftext.language.dot.resource.dot.IDotTokenResolveResult result) { defaultTokenResolver.resolve(lexem, feature, result); } public void setOptions(java.util.Map<?,?> options) { defaultTokenResolver.setOptions(options); } }
[ "jendrik.johannes@devboost.de" ]
jendrik.johannes@devboost.de
2ba6257a9d6ce41761ee1d6fb7f6abf4715083b7
b07e9505a96af8904f572f5aa99c75851705478d
/src/main/java/edu/psu/cse/siis/coal/values/BottomPropagationValue.java
ac0bec73f12f99487127b604d58817af76bcb90e
[ "Apache-2.0" ]
permissive
JordanSamhi/coal
3a01b131401c1519c087e8917b7a7da401a14533
3bf14d2dc42f0260d2861d4f82580a902e8121db
refs/heads/master
2023-06-10T01:51:27.683634
2023-06-01T07:52:39
2023-06-01T07:52:39
252,406,275
1
1
Apache-2.0
2022-12-09T15:31:33
2020-04-02T09:05:46
Java
UTF-8
Java
false
false
1,288
java
/* * Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin * Systems and Internet Infrastructure Security Laboratory * * Author: Damien Octeau * * 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 edu.psu.cse.siis.coal.values; /** * A "bottom" COAL propagation value. */ public final class BottomPropagationValue implements BasePropagationValue { private static final BottomPropagationValue instance = new BottomPropagationValue(); private BottomPropagationValue() { } /** * Returns the singleton instance for this class. * * @return The singleton instance for this class. */ public static BottomPropagationValue v() { return instance; } @Override public String toString() { return "bottom"; } }
[ "octeau@cse.psu.edu" ]
octeau@cse.psu.edu
c9741b0f5d56e28cd53f334b4b532f2fcf2b8425
a8f9a8a3683ea1b2f484ae6f0211a1b69732587d
/2-advanced/dubbo-samples-cloud-native/dubbo-call-sc/dubbo-sc-provider/src/main/java/org/apache/dubbo/samples/microservices/sc/controller/MeController.java
60b81750fd9bd64c32076f7c76d068719b26b85e
[ "Apache-2.0" ]
permissive
dubbo/dubbo-samples
48e2d5c58c88a82ee311141744ce3977f3721edb
762abf87194c128c5cb8d6bf0654dffadd4d9952
refs/heads/master
2023-03-15T15:12:56.803024
2023-02-01T02:18:46
2023-02-01T02:18:46
329,902,356
3
1
Apache-2.0
2021-01-15T12:47:11
2021-01-15T12:11:26
Java
UTF-8
Java
false
false
1,447
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.dubbo.samples.microservices.sc.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class MeController { private String instanceId; @Autowired public MeController(@Value("${spring.cloud.consul.discovery.instance-id:${random.value}}") String instanceId) { this.instanceId = instanceId; } @GetMapping("/me") public String me() { return instanceId; } }
[ "ken.lj.hz@gmail.com" ]
ken.lj.hz@gmail.com
d09904b1f898f2079640ce5c50e755720155cf31
403ffc913cb47a37ac6faf8cdda25d01d0a5e154
/Arrays/MergeWithoutExtraSpace.java
989549ebc55c54de30402385d3f29f65e5ae09a5
[]
no_license
dhruv-chk/Algorithms
68e2eeebd77d47e929c51d1d81e76efb33bfbfcc
5b87404ff182a8ab9de5b47b0dbc1221fd771940
refs/heads/master
2023-06-05T01:38:24.508768
2021-07-03T05:49:35
2021-07-03T05:49:35
260,983,313
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
public class MergeWithoutExtraSpace { public static void main(String[] args) { int arr1[] = {10, 12}; int arr2[] = {5, 18, 20}; for(int i=arr1.length-1; i>=0; i--){ int last = arr2[arr2.length-1]; int j; for(j = arr2.length-2; j>=0&&arr1[j]>arr2[j]; j--){ arr1[j+1] = arr1[j]; } if(j!=arr2.length-2 || last> arr2[i]){ arr1[j+1] = arr2[i]; arr2[i] = last; } } for(int n: arr1){ System.out.println(n); } for(int n: arr2){ System.out.println(n); } } }
[ "dhruv.chk9@gmail.com" ]
dhruv.chk9@gmail.com
45873ba9fd3d142b76216b6b875e4d8fde9352c7
b3ce47dc578f0d5247d2d88ca708ce6108a7c0f4
/src/main/java/Leetcode/Easy/KeyboardRow.java
7d65d7fd6e7e65f869ee71c890713ca4a4d7a5e0
[]
no_license
ayeshabhushan/Leetcode
1cd0ad0dc8cc38695eb07e58b87743bf7a9d37ce
3aeaf920442ec5cc57c860795eace7b4d48ed066
refs/heads/master
2021-01-14T15:11:49.619454
2020-04-13T05:30:07
2020-04-13T05:30:07
242,657,190
0
0
null
null
null
null
UTF-8
Java
false
false
1,884
java
package Leetcode.Easy; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Stream; public class KeyboardRow { public static void main(String[] args) { } public String[] findWords(String[] words) { String keyboardRegex = "[qwertyuiop]*|[asdfghjkl]*|[zxcvbnm]*"; return Stream.of(words) .filter(word -> word.toLowerCase().matches(keyboardRegex)) .toArray(String[]::new); // String[]::new is a syntax sugar for the lambda expression size -> new String[size] } public String[] findWords1(String[] words) { String[] strs = {"QWERTYUIOP","ASDFGHJKL","ZXCVBNM"}; // Map to hold row number (0, 1, 2) for each character Map<Character, Integer> map = new HashMap<>(); for(int i = 0; i<strs.length; i++){ for(char c: strs[i].toCharArray()){ map.put(c, i); } } List<String> res = new LinkedList<>(); for(String w: words) { if(w.equals("")) continue; // Identify what row does the first letter belong to int index = map.get(w.toUpperCase().charAt(0)); // Now start matching remaining characters for this word // One complete for loop = 1 word for(char c: w.toUpperCase().toCharArray()){ // If there's a mismatch, break out of the loop if(map.get(c)!=index){ index = -1; //don't need a boolean flag. break; } } // This word is complete // If index didn't changed, it means mismatch didn't occur => Add that to the result if(index !=- 1) res.add(w); } return res.toArray(new String[0]); } }
[ "sankanan@cisco.com" ]
sankanan@cisco.com
e6787092d9ef333af759480df301436f691add2e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_95c011789a1c0c32a47be94bde69f306232f5e12/FileStorage/5_95c011789a1c0c32a47be94bde69f306232f5e12_FileStorage_t.java
1bacfb1adf70c7fda4e6fed27839df26675584df
[]
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
8,203
java
/******************************************************************************* * Copyright (c) 1997-2009 by ProSyst Software GmbH * http://www.prosyst.com * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * ProSyst Software GmbH - initial API and implementation *******************************************************************************/ package org.eclipse.equinox.internal.ds.storage.file; import java.io.*; import java.net.URL; import java.net.URLConnection; import java.util.Dictionary; import java.util.Vector; import org.eclipse.equinox.internal.ds.*; import org.eclipse.equinox.internal.ds.model.ServiceComponent; import org.eclipse.equinox.internal.util.io.ExternalizableDictionary; import org.eclipse.osgi.util.ManifestElement; import org.eclipse.osgi.util.NLS; import org.osgi.framework.*; import org.osgi.service.component.ComponentConstants; import org.osgi.service.log.LogService; /** * This class implements a cache for the parsed component XML descriptions. * * @author Pavlin Dobrev * @author Stoyan Boshev */ public class FileStorage extends ComponentStorage { //TODO: this constant should be public and shared across other bundles that use the same property. //Probably it should be in the supplement bundle? public static final String PROP_CHECK_CONFIG = "osgi.checkConfiguration"; //$NON-NLS-1$ private String[] dbBundlePath = new String[1]; private String[] dbCompPath = new String[] {null, "COMPONENTS"}; //$NON-NLS-1$ private static String CUSTOM_DB_NAME = "SCR"; //$NON-NLS-1$ private File file; private ExternalizableDictionary data = new ExternalizableDictionary(); private StringBuffer pathBuffer = new StringBuffer(); private String separator; private boolean isDirty = false; public FileStorage(BundleContext bc) { separator = bc.getProperty("path.separator"); //$NON-NLS-1$ file = bc.getDataFile(CUSTOM_DB_NAME); FileInputStream fis = null; try { if (file.exists()) { data.readObject(new BufferedInputStream(fis = new FileInputStream(file))); } } catch (IOException e) { Activator.log.error(NLS.bind(Messages.ERROR_LOADING_DATA_FILE, file.getAbsolutePath()), e); } catch (Exception e) { Activator.log.error(NLS.bind(Messages.ERROR_LOADING_DATA_FILE, file.getAbsolutePath()), e); } finally { if (fis != null) { try { fis.close(); } catch (Exception e) { // ignore } } } } public Vector loadComponentDefinitions(Bundle bundle, String dsHeader) { try { Vector components = null; if (!Activator.DBSTORE) { return parseXMLDeclaration(bundle, dsHeader); } long lastModified; // if not dev mode, we simply use the bundle's timestamp if (!Activator.getBoolean(PROP_CHECK_CONFIG)) { lastModified = bundle.getLastModified(); } else { lastModified = getLastModifiedTimestamp(bundle); } dbBundlePath[0] = String.valueOf(bundle.getBundleId()); String lastModifiedValue = (String) data.get(getPath(dbBundlePath)); if (lastModifiedValue == null) { components = parseXMLDeclaration(bundle, dsHeader); if (components != null && components.size() != 0) { data.put(getPath(dbBundlePath), "" + lastModified); //$NON-NLS-1$ saveComponentDefinitions(components, bundle.getBundleId()); } } else { long dbLastModified = Long.parseLong(lastModifiedValue); if (lastModified != dbLastModified) { components = parseXMLDeclaration(bundle, dsHeader); if (components != null && components.size() != 0) { data.put(getPath(dbBundlePath), "" + lastModified); //$NON-NLS-1$ saveComponentDefinitions(components, bundle.getBundleId()); } } else { components = loadComponentsFromDB(bundle); } } return components; } catch (Throwable e) { Activator.log.error(NLS.bind(Messages.PROCESSING_BUNDLE_FAILED, Long.toString(bundle.getBundleId()), bundle), e); return null; } } private Vector loadComponentsFromDB(Bundle bundle) throws Exception { try { ServiceComponent currentComponent = null; long bundleId = bundle.getBundleId(); dbCompPath[0] = String.valueOf(bundleId); DBObject value = new DBObject(); byte[] byteArr = (byte[]) data.get(getPath(dbCompPath)); ByteArrayInputStream tmpIn = new ByteArrayInputStream(byteArr); value.readObject(tmpIn); Vector components = value.components; if (components == null) { return null; } for (int i = 0; i < components.size(); i++) { currentComponent = (ServiceComponent) components.elementAt(i); currentComponent.bundle = bundle; currentComponent.bc = bundle.getBundleContext(); } return components; } catch (Throwable t) { Activator.log.error(Messages.ERROR_LOADING_COMPONENTS, t); } return null; } public void deleteComponentDefinitions(long bundleID) { dbBundlePath[0] = String.valueOf(bundleID); data.remove(getPath(dbBundlePath)); dbCompPath[0] = String.valueOf(bundleID); data.remove(getPath(dbCompPath)); if (file.exists()) { //delete the file to prevent leaving old information in it file.delete(); } isDirty = true; } private void saveComponentDefinitions(Vector components, long bundleID) throws Exception { try { if (components == null || components.size() == 0) { return; } dbCompPath[0] = String.valueOf(bundleID); DBObject tmpObj = new DBObject(components); ByteArrayOutputStream buf = new ByteArrayOutputStream(); tmpObj.writeObject(buf); data.put(getPath(dbCompPath), buf.toByteArray()); isDirty = true; } catch (Exception e) { Activator.log.error(Messages.ERROR_SAVING_COMPONENT_DEFINITIONS, e); } } public void stop() { if (isDirty) { saveFile(); } } private void saveFile() { FileOutputStream fos = null; try { fos = new FileOutputStream(file); try { data.writeObject(fos); isDirty = false; } catch (Exception e) { Activator.log.error(Messages.ERROR_WRITING_OBJECT, e); } } catch (FileNotFoundException e) { Activator.log.error(Messages.FILE_DOESNT_EXIST_OR_DIRECTORY, e); } finally { if (fos != null) { try { fos.close(); } catch (IOException e) { //ignore } } } } private String getPath(String path[]) { pathBuffer.setLength(0); for (int i = 0; i < path.length; i++) { pathBuffer.append(path[i]).append(separator); } return pathBuffer.toString(); } /** * The last modified timestamp of the bundle. Should only be called in development mode * * @param bundle * @return the last modified timestamp of the bundle */ protected long getLastModifiedTimestamp(Bundle bundle) { if (bundle == null) return 0; long result = 0; ManifestElement[] elements = parseManifestHeader(bundle); for (int i = 0; i < elements.length; i++) { URL componentURL = bundle.getEntry(elements[i].getValue()); if (componentURL != null) { try { URLConnection connection = componentURL.openConnection(); long lastModified = connection.getLastModified(); if (lastModified > result) result = lastModified; } catch (IOException e) { //last modified cannot be calculated. should force reparse return Long.MAX_VALUE; } } } return result; } private ManifestElement[] parseManifestHeader(Bundle bundle) { Dictionary headers = bundle.getHeaders(""); //$NON-NLS-1$ String files = (String) headers.get(ComponentConstants.SERVICE_COMPONENT); if (files == null) return new ManifestElement[0]; try { return ManifestElement.parseHeader(ComponentConstants.SERVICE_COMPONENT, files); } catch (BundleException e) { Activator.log(bundle.getBundleContext(), LogService.LOG_ERROR, Messages.ERROR_PARSING_MANIFEST_HEADER, e); return new ManifestElement[0]; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c740a4871a649c4cfa5b03f95cf915471d304909
91fe393b79c8c33a39f88f695634ac0154dda250
/src/main/java/com/karma/gema/controller/CompanyController.java
3380975cf49141fcb29343980d3184660e048324
[]
no_license
atarazona89/GeMA
e4f3e932bc087bccb071597d22c7fef47407c002
ab451a48f6b0f5e60b200c272d6f23eb9c2d0968
refs/heads/master
2021-05-15T18:23:31.820939
2017-12-07T16:53:20
2017-12-07T16:53:20
107,623,764
0
0
null
null
null
null
UTF-8
Java
false
false
1,983
java
package com.karma.gema.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.karma.gema.model.Company; import com.karma.gema.request.CompanyRequest; import com.karma.gema.service.CompanyService; @Controller @RequestMapping(value = "/company") public class CompanyController { @Autowired CompanyService companyService; @RequestMapping(value = "/{id}", method = RequestMethod.GET) public @ResponseBody Company getCompany(@PathVariable("id") Long id) { //return userService.findById(id); return companyService.findById(id); } @RequestMapping(value = "", method = RequestMethod.GET) public @ResponseBody List<Company> getCompanies() { return companyService.findAll(); } @RequestMapping(value = "", method = RequestMethod.POST) public @ResponseBody Company createCompany(@RequestBody CompanyRequest userRequest) { return companyService.saveCompany(userRequest); } @RequestMapping(value = "/{id}", method = RequestMethod.PUT) public @ResponseBody Company updateCompany(@PathVariable("id") Long id, @RequestBody CompanyRequest userRequest) { return companyService.updateCompany(id, userRequest); } @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public @ResponseBody ResponseEntity<Object> deleteCompany(@PathVariable("id") Long id) { return companyService.deleteCompany(id); } @RequestMapping(value = "/byuser/{id}", method = RequestMethod.GET) public @ResponseBody Company getByUser(@PathVariable("id") Long id) { return companyService.findByIdUser(id); } }
[ "alejandrotarazona@gmail.com" ]
alejandrotarazona@gmail.com
d2f39f15b1946b994570474ef7b446f8883d5257
0b5787d8edf39143a018f04ef04aad9b22188810
/CrossPlatformApp/app/src/main/java/com/fullsail/djones/android/crossplatformapp/ItemAdapter.java
128568ed93cfdf42d1b3ec47c9c3cbed9e134c1f
[]
no_license
dljones79/CPMD1412
eecb3fac9f8e86acd7ac98d57c1aead5f9644c60
2d02b3881184df2ee4714c24a28c40a606d6b14b
refs/heads/master
2020-12-27T15:15:28.296668
2014-12-19T00:56:35
2014-12-19T00:56:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,826
java
/////////////////////////// // David Jones // // CMD 1412 // // Week 1 // /////////////////////////// package com.fullsail.djones.android.crossplatformapp; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.parse.ParseObject; import java.util.ArrayList; /** * Created by David on 12/6/14. * Custom Adapter to populate the listview */ public class ItemAdapter extends BaseAdapter { private static final long ID_CONSTANT = 0x01000000; Context mContext; ArrayList<ParseObject> mItems; public ItemAdapter(Context context, ArrayList<ParseObject> items){ mContext = context; mItems = items; } @Override public int getCount() { return mItems.size(); } @Override public Object getItem(int position) { return mItems.get(position); } @Override public long getItemId(int position) { return ID_CONSTANT + position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null){ convertView = LayoutInflater.from(mContext).inflate(R.layout.listview_item, parent, false); } ParseObject parseObject = (ParseObject) getItem(position); Integer qty = parseObject.getInt("quantity"); String quantity = qty.toString(); TextView itemNameView = (TextView) convertView.findViewById(R.id.itemText); TextView quantityNameView = (TextView) convertView.findViewById(R.id.quantityText); itemNameView.setText(parseObject.getString("item")); quantityNameView.setText(quantity); return convertView; } }
[ "dljones79@fullsail.edu" ]
dljones79@fullsail.edu
daa72e5b5000e8863074a0ab52d89602e8d6a1cb
5215199309671c2c55541631f7d149a06962e852
/src/art/soft/gameObjs/gui/ControlsMenu.java
65e23b7f639f0a14ff87218be42f97886513ee00
[]
no_license
artem8086/NewYearRescueComplete
c9fb2ad7f77341daeedc91d8b0d46d11f06ce6c1
cb4e078112b8d549240450c672e7f19c188b68a4
refs/heads/master
2022-12-01T03:01:36.436444
2020-07-18T07:22:22
2020-07-18T07:22:22
280,604,383
0
0
null
null
null
null
UTF-8
Java
false
false
1,269
java
package art.soft.gameObjs.gui; import art.soft.Loader; import static art.soft.gameObjs.gui.AnimMenu.NOACTIVE_STATE; import static art.soft.gameObjs.gui.AnimMenu.NORMAL_STATE; import static art.soft.gameObjs.gui.AnimMenu.PRESSED_STATE; import art.soft.stages.Menu; /** * * @author Артём Святоха */ public class ControlsMenu extends AnimMenu { public ControlsMenu() { setAnimSet(Loader.getLoader().loadAnimation(Loader.ANIM_TYPE_ASCII, "menu/controls")); // numItems = 4; // fillMenuState(0); fillIndxs(NORMAL_STATE, 4); fillIndxs(PRESSED_STATE, 4 + numItems); fillIndxs(NOACTIVE_STATE, 4 + numItems * 2); } @Override public void closeAction() { Loader.getLoader().menu.settings.activate(); } @Override public void pressed(int indx) { Menu menu = Loader.getLoader().menu; switch (indx) { case 0: case 1: diactivate(); menu.player.setPlayer(indx); menu.player.start(); break; case 2: diactivate(); menu.common.start(); break; case 3: close(); } } }
[ "artemsvyatoha@gmai.com" ]
artemsvyatoha@gmai.com
d9f8bc7597711b79c25a2367e759b9d74ac829a0
b1e99025c5b84288e7caef7bd7cad8379275dc3e
/src/Library/model/LibraryUser.java
70e7b6bdf23710e776d2e4a09987993f26c033ac
[]
no_license
koltundew/Library
c82895211bb7e85a467b4f237e597aea61c2f1d3
81aa2c713a1663d715315152ff0d1ec4c04a5a0b
refs/heads/master
2023-02-18T14:04:01.326837
2021-01-06T14:49:17
2021-01-06T14:49:17
319,392,985
1
0
null
null
null
null
UTF-8
Java
false
false
1,706
java
package Library.model; import java.util.List; import java.util.ArrayList; import java.util.Objects; public class LibraryUser extends User { private List<Publication>publicationHistory = new ArrayList<>(); private List<Publication>borrowedPublications = new ArrayList<>(); public List<Publication> getPublicationHistory(){ return publicationHistory; } public List<Publication>getBorrowedPublications(){ return borrowedPublications; } public LibraryUser(String firstName,String lastName, String pesel){ super(firstName, lastName, pesel); } private void addPublicationToHistory(Publication pub){ publicationHistory.add(pub); } public void borrowPublication(Publication pub){ borrowedPublications.add(pub); } public boolean returnPublication(Publication pub){ boolean result = false; if(borrowedPublications.remove(pub)){ result = true; addPublicationToHistory(pub); } return result; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; LibraryUser that = (LibraryUser) o; return Objects.equals(publicationHistory, that.publicationHistory) && Objects.equals(borrowedPublications, that.borrowedPublications); } @Override public int hashCode() { return Objects.hash(super.hashCode(), publicationHistory, borrowedPublications); } @Override public String toCsv(){ return getFirstName() +";"+ getLastName()+";"+getPesel(); } }
[ "kszym94@gmail.com" ]
kszym94@gmail.com
4a0c9f7965e32b5b713368336cf7314a0ec0fd46
537654c9b992b5d1e78441d5e99944c66c3f60bd
/src/main/java/jp/co/systena/tigerscave/ShoppingApp/HighAndLow/HighAndLowActor.java
208517c638203748a6d6b0db2d70e30ecb5bc3c7
[]
no_license
yuutoabe/webjava-2
1667c82dfa2b9a9023e9a26b1f6ed187716cddde
a7d7bdc33549bb18bbdbf94d3be255faa6edd8f6
refs/heads/master
2020-04-17T10:42:12.778151
2019-02-22T14:03:25
2019-02-22T14:03:25
166,510,658
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package jp.co.systena.tigerscave.ShoppingApp.HighAndLow; import jp.co.systena.tigerscave.ShoppingApp.Actor; import jp.co.systena.tigerscave.ShoppingApp.Card; /** * HighAndLowPlayerクラスです。 */ public class HighAndLowActor extends Actor { @Override public boolean play(Card card) { return false; } }
[ "abeyuut@systena.co.jp" ]
abeyuut@systena.co.jp
1551e97a074603e708123428c889500d9fad5b7b
e6afb842b195704c894f88c277a29a3da0f9eb76
/app/src/main/java/com/mythmayor/androidcomponentdemo/model/MainModel.java
970e8a9edcbfe805654b4c073e3a0b8ecaea4ca7
[ "Apache-2.0" ]
permissive
zhulvlong/Component_AndroidComponentDemo
1d8dcf5623c78903b4793fd4e22f59e52be67474
918c53933aaad1f4e4baded10dc8952d82b5fecc
refs/heads/master
2023-07-23T07:18:20.652567
2021-05-22T07:10:39
2021-05-22T07:10:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
package com.mythmayor.androidcomponentdemo.model; import com.mythmayor.basicproject.request.UserInfoRequest; import com.mythmayor.basicproject.response.UserInfoResponse; import com.mythmayor.basicproject.utils.http.RetrofitClient; import com.mythmayor.androidcomponentdemo.contract.MainContract; import io.reactivex.rxjava3.core.Observable; /** * Created by mythmayor on 2020/7/8. * 首页Model */ public class MainModel implements MainContract.Model { @Override public Observable<UserInfoResponse> getUserInfo(UserInfoRequest request) { return RetrofitClient.getInstance().getHttpService().getUserInfo(request.getUsername(), request.getPassword()); } }
[ "mythmayor@163.com" ]
mythmayor@163.com
7b685fda893f66b573639fe6eaf7324eaf9d9134
df0a8880a597025a18d45b2b1f8355a26d807f7d
/src/main/java/capstone/backend/api/service/impl/security/UserDetailsImpl.java
a0abcf3a1c54e544ff7c7af963438f06f4290c6c
[]
no_license
TungBeo199x/new
241990815f286962989e4c27451b75afe7d64449
0e02f24327325d395250d2d9033ec89e34e5b3e3
refs/heads/master
2023-01-04T17:26:53.292852
2020-10-27T09:00:19
2020-10-27T09:00:19
307,640,020
0
0
null
null
null
null
UTF-8
Java
false
false
1,205
java
package capstone.backend.api.service.impl.security; import capstone.backend.api.entity.User; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Service; import java.util.Collection; @Data @AllArgsConstructor @NoArgsConstructor @Service @Builder public class UserDetailsImpl implements UserDetails { private Long id; private String username; private String fullName; private String avatarUrl; @JsonIgnore private String password; private Collection<? extends GrantedAuthority> authorities; @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }
[ "sontung199x@gmail.com" ]
sontung199x@gmail.com
dd7623d188abaf7eab28490605b1f649db824c0d
83d56024094d15f64e07650dd2b606a38d7ec5f1
/sicc_druida/fuentes/java/INCRangoCuotas.java
bb76b8110b0a191ec7399402e6d04a7677594aa4
[]
no_license
cdiglesias/SICC
bdeba6af8f49e8d038ef30b61fcc6371c1083840
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
refs/heads/master
2021-01-19T19:45:14.788800
2016-04-07T16:20:51
2016-04-07T16:20:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,051
java
import es.indra.druida.DruidaConector; import es.indra.mare.common.mii.services.jdbcservice.RecordSet; import es.indra.mare.common.mln.MareBusinessID; import es.indra.sicc.cmn.cargaInicial.ComposerViewElement; import es.indra.sicc.cmn.cargaInicial.ComposerViewElementList; import es.indra.sicc.cmn.cargaInicial.presentacion.ConectorComposerView; import es.indra.sicc.rep.logicanegocio.ConstantesREP; import es.indra.sicc.util.DTOBelcorp; import es.indra.sicc.dtos.zon.DTOUnidadAdministrativa; import es.indra.sicc.util.DTOSalida; import es.indra.sicc.util.UtilidadesSession; import es.indra.sicc.util.xml.XMLDocument; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Vector; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; public class INCRangoCuotas extends LPSICCBase { public INCRangoCuotas() { super(); } public void inicio() throws Exception { } public void ejecucion() throws Exception { String accion = conectorParametroLimpia("accion","", true); setTrazaFichero(); try { this.rastreo(); if (accion.equals("generar")){ generarReporte(); traza("termino de generar el reporte"); //cargarPagina(); }else{ cargarPagina(); getConfiguracionMenu("INCRangoCuotas"); } } catch (Exception ex) { // pagina("contenido_informe_pedidos_escala_generar"); // getConfiguracionMenu("INCRangoCuotas"); ByteArrayOutputStream stack = new ByteArrayOutputStream(); PrintStream out = new PrintStream(stack); ex.printStackTrace(out); traza("EXCEPCION:" + stack.toString()); lanzarPaginaError(ex); /* try{ cargarPagina(); }catch(Exception e){ e.printStackTrace(); }*/ } } private DruidaConector generarConector(String rowsetID, RecordSet datos, Vector columns) throws DOMException, Exception { StringBuffer salida = new StringBuffer(); int sizeColums = datos.getColumnCount(); int sizeRows = datos.getRowCount(); if (columns == null) { columns = new Vector(); } Vector columsDesc = datos.getColumnIdentifiers(); DruidaConector conectorValoresPosibles = new DruidaConector(); XMLDocument xmlDoc = new XMLDocument(); Document docDestino = xmlDoc.makeDocument("<ROWSET2/>"); Element e_rows = docDestino.createElement("ROWSET"); e_rows.setAttribute("ID", rowsetID); docDestino.getDocumentElement().appendChild(e_rows); for (int i = 0; i < sizeRows; i++) { Element e_row = docDestino.createElement("ROW"); e_rows.appendChild(e_row); for (int j = 0; j < sizeColums; j++) { if (columns.contains(columsDesc.elementAt(j))) { Element e_campo2 = docDestino.createElement("CAMPO"); e_campo2.setAttribute("NOMBRE", columsDesc.elementAt(j).toString()); e_campo2.setAttribute("TIPO", "OBJECTO"); e_campo2.setAttribute("LONGITUD", "50"); Text txt = docDestino.createTextNode(((datos.getValueAt(i, j) == null) ? "" : datos.getValueAt(i, j).toString())); e_campo2.appendChild(txt); e_row.appendChild(e_campo2); } } } conectorValoresPosibles.setXML(docDestino.getDocumentElement()); return conectorValoresPosibles; } private void cargarPagina() throws Exception{ pagina("contenido_informe_rango_cuotas_generar"); // asignarAtributo("LABELC", "lbldtPais", "valor", UtilidadesSession.getDescripcionPais(this)); ComposerViewElementList cv = crearParametrosEntrada(); ConectorComposerView conector = new ConectorComposerView(cv, this.getRequest()); conector.ejecucion(); DruidaConector resultados = conector.getConector(); traza(" 4 " + resultados.getXML()); asignar("COMBO","cbMarca",resultados,"SEGConsultaMarcas"); //DTOs DTOUnidadAdministrativa dtoUA = new DTOUnidadAdministrativa(); dtoUA.setOidPais(UtilidadesSession.getPais(this)); dtoUA.setOidIdioma(UtilidadesSession.getIdioma(this)); DTOBelcorp dto = new DTOBelcorp(); dto.setOidPais(UtilidadesSession.getPais(this)); dto.setOidIdioma(UtilidadesSession.getIdioma(this)); Vector vec = new Vector(); // Carga Paises MareBusinessID idPais = new MareBusinessID("REPRecuperarPaises"); dto.setOidIdioma(UtilidadesSession.getIdioma(this)); vec.add(dto); vec.add(idPais); DTOSalida dtoSalPais = (DTOSalida)conectar("ConectorPaises",vec).objeto("dtoSalida"); RecordSet pais = (RecordSet)dtoSalPais.getResultado(); Vector colPAIS = pais.getColumnIdentifiers(); DruidaConector paises = generarConector("DTOSalida.paises_ROWSET",pais, colPAIS); asignar("COMBO", "cbPais", paises, "DTOSalida.paises_ROWSET"); // Carga lista oculta Regiones traza("antesde la lista oculta de Regiones"); MareBusinessID idRegiones = new MareBusinessID("ZONObtenerRegionesPorSGV"); Vector vecReg = new Vector(); vecReg.add(dtoUA); vecReg.add(idRegiones); DTOSalida dtoRegiones = (DTOSalida) conectar("ConectorUA",vecReg).objeto("dtoSalida"); RecordSet region = (RecordSet)dtoRegiones.getResultado(); Vector colRegion = region.getColumnIdentifiers(); DruidaConector regiones = generarConector("DTOSalida.regiones_ROWSET",region, colRegion); traza("regiones "+dtoRegiones.getResultado()); traza("regiones "+dtoRegiones.getResultado().getColumnIdentifiers()); this.crearListaLP(colRegion, region.getColumnCount(), "CapaReg","lstRegiones", "14", "200"); asignar("LISTA", "lstRegiones", regiones, "DTOSalida.regiones_ROWSET"); //cargo la lista oculta de Zonas traza("antesde la lista oculta de Zonas"); MareBusinessID idZonas = new MareBusinessID("ZONObtenerZonasPorRegiones"); Vector vecZ = new Vector(); vecZ.add(dtoUA); vecZ.add(idZonas); DTOSalida dtoZonas = (DTOSalida) conectar("ConectorUA",vecZ).objeto("dtoSalida"); RecordSet zona = (RecordSet)dtoZonas.getResultado(); Vector colZona = zona.getColumnIdentifiers(); DruidaConector zonas = generarConector("DTOSalida.zonas_ROWSET",zona, colZona); traza("zonas "+dtoZonas.getResultado()); traza("zonas "+dtoZonas.getResultado().getColumnIdentifiers()); this.crearListaLP(colZona, zona.getColumnCount(), "CapaZon","lstZonas", "14", "200"); asignar("LISTA", "lstZonas", zonas, "DTOSalida.zonas_ROWSET"); asignarAtributo("VAR", "idioma", "valor", UtilidadesSession.getIdioma(this).toString()); asignarAtributo("VAR", "pais", "valor", UtilidadesSession.getPais(this).toString()); this.getFormatosValidaciones(); } private void generarReporte() throws Exception{ HashMap datos = new HashMap(); datos.put("MODULO", "INC"); //comienzo de los parametrso de filtrado String pais = conectorParametroLimpia("pais", "", true); datos.put(ConstantesREP.PAISES, pais); String subgerenciaVentas = conectorParametroLimpia("subgerenciaVentas", "", true); if (!subgerenciaVentas.equals("")) { datos.put(ConstantesREP.SUBGERENCIAVENTAS, subgerenciaVentas); } String region = conectorParametroLimpia("region", "", true); if(!region.equals("")){ datos.put(ConstantesREP.REGIONES, region); } String zona = conectorParametroLimpia("zona", "", true); if(!zona.equals("")){ datos.put(ConstantesREP.ZONAS, zona); } String marca = conectorParametroLimpia("marca", "", true); if(!marca.equals("")){ datos.put(ConstantesREP.MARCAS, marca); } String unidadNegocio = conectorParametroLimpia("unidadNegocio", "", true); if(!unidadNegocio.equals("")){ datos.put(ConstantesREP.UNIDADNEGOCIOS, unidadNegocio); } String negocio = conectorParametroLimpia("negocio", "", true); if(!negocio.equals("")){ datos.put(ConstantesREP.NEGOCIOS, negocio); } String numeroConcurso = conectorParametroLimpia("numeroConcurso", "", true); datos.put(ConstantesREP.NUMEROCONCURSOS, numeroConcurso); datos.put(ConstantesREP.TITULO, "Rango de Cuotas (Venta Incremental)"); traza("++++++Antes de enviar a reportes " + datos); String formato = conectorParametroLimpia("formato", "", true); if(formato.equals("xls")){ datos.put(ConstantesREP.FORMATOSALIDA, "EXCEL"); } String reporte; if(region.equals("")){ reporte = "RD_REP-057_02"; }else{ if(zona.equals("")){ reporte = "RD_REP-057_01"; }else{ reporte = "RD_REP-057"; } } ejecutarReporte2(datos, "REPGenerarReporteBatch", reporte, formato); } private ComposerViewElementList crearParametrosEntrada() throws Exception{ traza("metodo crearParametrosEntrada() "); DTOBelcorp dtoBel = new DTOBelcorp(); dtoBel.setOidPais(UtilidadesSession.getPais(this)); dtoBel.setOidIdioma(UtilidadesSession.getIdioma(this)); ComposerViewElementList lista = new ComposerViewElementList(); //Carga de combo marca ComposerViewElement cbMarca = new ComposerViewElement(); cbMarca.setIDBusiness("SEGConsultaMarcas"); cbMarca.setDTOE(dtoBel); lista.addViewElement(cbMarca); return lista; } private void crearListaLP(Vector nomColumns, int cantColumns, String nomCapa, String nomLista, String XCapa, String YCapa) throws Exception { traza("dentro de crearListaLP() " + nomColumns + " " + cantColumns); Document document = getXML(); Element eCapa = document.createElement("CAPA"); eCapa.setAttribute("nombre", nomCapa); eCapa.setAttribute("alto", "162"); eCapa.setAttribute("ancho", "580"); eCapa.setAttribute("colorf", ""); eCapa.setAttribute("borde", "1"); eCapa.setAttribute("imagenf", ""); eCapa.setAttribute("repeat", ""); eCapa.setAttribute("padding", ""); eCapa.setAttribute("visibilidad", "hidden"); eCapa.setAttribute("contravsb", ""); eCapa.setAttribute("zindex", ""); eCapa.setAttribute("x", XCapa); eCapa.setAttribute("y", YCapa); Element eLista = document.createElement("LISTA"); eLista.setAttribute("seleccion", "boton"); eLista.setAttribute("nombre", nomLista); eLista.setAttribute("ancho", "580"); eLista.setAttribute("alto", "150"); eLista.setAttribute("multisel", "0"); eLista.setAttribute("incy", "1"); eLista.setAttribute("incx", "10"); eLista.setAttribute("colorf", "#EFEFEF"); eLista.setAttribute("imagenoff", "close_no.gif"); eLista.setAttribute("imagenon", "close_up.gif"); eLista.setAttribute("accion", ""); eLista.setAttribute("sep", "|"); eLista.setAttribute("pixelsborde", "3"); eLista.setAttribute("colorborde", "#CCCCCC"); Element eCABECERA = document.createElement("CABECERA"); eCABECERA.setAttribute("nombre", "cabecera"); eCABECERA.setAttribute("height", "20"); Integer anchoCab; if (cantColumns < 4) { anchoCab = new Integer(580 / cantColumns); } else { anchoCab = new Integer(150); } Element eCOL_1 = document.createElement("COL"); eCOL_1.setAttribute("id", "fondoCabecera"); eCOL_1.setAttribute("ancho", anchoCab.toString()); Element eCOL_2 = document.createElement("COL"); eCOL_2.setAttribute("id", "fondoCabecera"); eCOL_2.setAttribute("ancho", anchoCab.toString()); Element eCOL_3 = document.createElement("COL"); eCOL_3.setAttribute("id", "fondoCabecera"); eCOL_3.setAttribute("ancho", anchoCab.toString()); Element eCOL_4 = document.createElement("COL"); eCOL_4.setAttribute("id", "fondoCabecera"); eCOL_4.setAttribute("ancho", anchoCab.toString()); Element eCOL_5 = document.createElement("COL"); eCOL_5.setAttribute("id", "fondoCabecera"); eCOL_5.setAttribute("ancho", anchoCab.toString()); Element eCOL_6 = document.createElement("COL"); eCOL_6.setAttribute("id", "fondoCabecera"); eCOL_6.setAttribute("ancho", anchoCab.toString()); Vector columnas = new Vector(); for (int i = 0; i < cantColumns; i++) { Element eLABEL_2 = document.createElement("LABELC"); eLABEL_2.setAttribute("id", "fondoCabecera"); eLABEL_2.setAttribute("nombre", "lbDivisionesPoliticas" + i); eLABEL_2.setAttribute("ancho", anchoCab.toString()); eLABEL_2.setAttribute("alto", "20"); eLABEL_2.setAttribute("filas", "1"); eLABEL_2.setAttribute("id", "datosCamposCabecera"); if (i != 0) { eLABEL_2.setAttribute("valor", (String) nomColumns.get(i)); } else { eLABEL_2.setAttribute("cod", "199"); } eLABEL_2.setAttribute("enviaroculto", "N"); columnas.add(eLABEL_2); //Agrego label a la columna } traza("despues de poner en variables los titulos " + columnas + " " + cantColumns); if (cantColumns >= 1) { eCOL_1.appendChild((Element) columnas.get(0)); eCABECERA.appendChild(eCOL_1); traza("1"); } if (cantColumns >= 2) { eCOL_2.appendChild((Element) columnas.get(1)); eCABECERA.appendChild(eCOL_2); traza("1"); } if (cantColumns >= 3) { eCOL_3.appendChild((Element) columnas.get(2)); eCABECERA.appendChild(eCOL_3); traza("1"); } if (cantColumns >= 4) { eCOL_4.appendChild((Element) columnas.get(3)); eCABECERA.appendChild(eCOL_4); traza("1"); } if (cantColumns >= 5) { eCOL_5.appendChild((Element) columnas.get(4)); eCABECERA.appendChild(eCOL_5); traza("1"); } if (cantColumns >= 6) { eCOL_6.appendChild((Element) columnas.get(5)); eCABECERA.appendChild(eCOL_6); traza("1"); } Element ePRESENTACION = document.createElement("PRESENTACION"); Integer ancho = new Integer(cantColumns * anchoCab.intValue()); ePRESENTACION.setAttribute("ancho", ancho.toString()); ePRESENTACION.setAttribute("filas", "1"); int swX1 = 0; StringBuffer cadena = new StringBuffer("['datosCamposCenterImpar'"); traza("break brain"); for (int i = 1; i < cantColumns; i++) { if (swX1 == 0) { cadena.append(", 'datosCamposCenterPar'"); swX1 = 1; } else { cadena.append(", 'datosCamposCenterImpar'"); swX1 = 0; } } for (int i = 0; i < cantColumns; i++) { Element eCOLP_2 = document.createElement("COL"); eCOLP_2.setAttribute("ancho", anchoCab.toString()); eCOLP_2.setAttribute("caracteres", "150"); ePRESENTACION.appendChild(eCOLP_2); //Agrego columna a la presentacion } cadena.append("]"); traza("### " + cadena.toString()); ePRESENTACION.setAttribute("bloquesid", cadena.toString()); Element eROWSET = document.createElement("ROWSET"); eLista.appendChild(eCABECERA); //Agrego la cabecera de la lista eLista.appendChild(ePRESENTACION); //Agrego la presentacion de la lista eLista.appendChild(eROWSET); //Agrego el rowset de la lista eCapa.appendChild(eLista); getXML().getElementsByTagName("FORMULARIO").item(0).appendChild(eCapa); } // Fin metodo }
[ "hp.vega@hotmail.com" ]
hp.vega@hotmail.com
776e1dd87bdad369f4a921beb2b80b6ee6d9c65c
709d01c5014f269f2947414e8c440170fd0897c4
/10_rest_client/src/main/java/guru/springframework/api/domain/Job.java
6871753bbcfd6dca1dbd99824ba8933d1bb597a5
[ "Unlicense" ]
permissive
amarchino/spring-framework-5
ccf87fe07129ecb15394b5eb187579cb82149a20
e3230d786abf1e1e9ca36bcb76ea12837893d0e0
refs/heads/master
2023-03-08T22:23:10.302833
2021-02-27T14:57:56
2021-02-27T14:57:56
324,447,764
0
0
null
2021-01-16T15:52:48
2020-12-25T23:17:43
Java
UTF-8
Java
false
false
139
java
package guru.springframework.api.domain; import lombok.Data; @Data public class Job { private String title; private String company; }
[ "marchino.alessandro@gmail.com" ]
marchino.alessandro@gmail.com
371512f2e809870816805d384acebba43e14c228
d510882b50b12a9af261f910b8b82c143190d925
/FragmentNaviHostExamples/app/src/main/java/com/example/yingding/fragmentnavihostexamples/ui/main/PageViewFragment.java
4f1ad54bc5eb80d94d11606ec32cecaaf78bd136
[ "Apache-2.0" ]
permissive
yingding/android-examples
d5871f87be94ae4d29d827c9226956a32a8d20f4
34add8b71f56f2987f034441989b6996d7eee5d7
refs/heads/master
2023-04-14T01:55:22.034266
2023-04-03T21:01:43
2023-04-03T21:01:43
162,573,555
2
3
Apache-2.0
2023-03-25T00:49:33
2018-12-20T11:57:49
Kotlin
UTF-8
Java
false
false
4,492
java
package com.example.yingding.fragmentnavihostexamples.ui.main; import android.content.Context; import android.net.Uri; import android.os.Bundle; import androidx.annotation.Nullable; import androidx.lifecycle.ViewModelProviders; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.yingding.fragmentnavihostexamples.R; import com.example.yingding.fragmentnavihostexamples.ui.base.BaseFragment; /** * A simple {@link BaseFragment} subclass. * Activities that contain this fragment must implement the * {@link PageViewFragment.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link PageViewFragment#newInstance} factory method to * create an instance of this fragment. */ public class PageViewFragment extends BaseFragment { private MainViewModel mViewModel; // private static final String mFragmentTitle = PageViewFragment.class.getSimpleName(); // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; private OnFragmentInteractionListener mListener; public PageViewFragment() { // Required empty public constructor } @Override protected String TAG() { return PageViewFragment.class.getSimpleName(); } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment PageViewFragment. */ // TODO: Rename and change types and number of parameters public static PageViewFragment newInstance(String param1, String param2) { PageViewFragment fragment = new PageViewFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } /** * use the local Params to persis Fragment information * @param savedInstanceState */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_page_view, container, false); } // TODO: Rename method, update argument and hook method into UI event public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mViewModel = ViewModelProviders.of(this).get(MainViewModel.class); mViewModel.setTitle(TAG()); } @Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof OnFragmentInteractionListener) { mListener = (OnFragmentInteractionListener) context; } else { throw new RuntimeException(context.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); mListener = null; } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * Very Important * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } }
[ "yingdingwang@yahoo.de" ]
yingdingwang@yahoo.de
60b89a1b66f997dd6cf24b8ed19ece25bb210fcb
892dfc45bca2d6f647e6e4df3ba8d4e0b6a2bf43
/source/tools/yadas/src/gov/lanl/yadas/Gaussian.java
edac1abfdc48d3a2dac4efd68900955bbb6c7b8c
[ "Artistic-1.0" ]
permissive
bertcarnell/mcmcMixResolve
fd786599afaa26b41d295bc7c5a4020aed82553a
c2acf92ac7c4bee8dadc9b674f26c7eac16ed8a2
refs/heads/master
2020-03-29T20:22:31.175972
2018-11-24T23:32:13
2018-11-24T23:32:13
8,275,595
0
0
null
null
null
null
UTF-8
Java
false
false
605
java
package gov.lanl.yadas; // note has been changed to deal in standard deviations!!! /** * Gaussian log density function, parameterized by its mean and standard deviation. * Can be used as a model for writing one's own classes that implement LogDensity. */ public class Gaussian extends AbstractLogDensity { public double compute (double[][] args, int i) { data = args[0][i]; mean = args[1][i]; sd = args[2][i]; return -(Math.pow((data - mean) / sd, 2.0)) / 2.0 - Math.log(sd) + cst; } double data, mean, sd; static final double cst = -Math.log(2. * Math.PI) / 2.; }
[ "bertcarnell@gmail.com" ]
bertcarnell@gmail.com
49f15d3801b9315e26b39eb5eca66bc64e11a323
3261218ab8518c9b5b1a8cdf5ae54fdcb9ac35ea
/src/main/java/io/CopyDemo.java
acb9b5dd684d47889ee05f5bb5f7102c5e3a1c20
[]
no_license
q449180476/TeDu
dc0e6cd5eb38d6c55636bf737f36af4182373d0c
f80c73a31b19d8914c49f4beeeb192f8a3156126
refs/heads/master
2023-03-10T12:27:25.781025
2021-02-23T11:40:29
2021-02-23T11:40:29
340,607,665
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
package io; import com.sun.javaws.IconUtil; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; /** * 使用文件流完成文件的复制 */ public class CopyDemo { public static void main(String[] args) throws IOException { /* 1:创建文件流输入读取源文件 2:创建文件流输出写入复制文件 3:循环块读写完成复制 4:关闭两个流 */ FileInputStream fis=new FileInputStream("fos.txt"); FileOutputStream fos=new FileOutputStream("newfis.txt"); int len; byte[] data=new byte[1024*10]; while((len=fis.read(data))!=-1) { fos.write(data,0,len); } System.out.println("复制完毕!"); fis.close(); fos.close(); } }
[ "449180476@qq.com" ]
449180476@qq.com
437e3d4a924eb51b504932e371c5fc8b50bb5666
3c26d3fb9ab113f46278b874c2ebdd8f4ef58490
/virtualtrade-android/src/edu/upc/eetac/dsa/dsaqt1314g1/virtualtrade/android/api/Anuncio.java
2587800e97a43b46c00f5cf00e2d9476d933801f
[]
no_license
dsaqt1314g1/virtualtrade-project
68f2db2adb717b8a2bde5b652b622c4516e9a801
e7e76de7e08786b571557ad5ff73b7756bedbd2a
refs/heads/master
2020-05-19T09:47:04.885580
2014-01-29T10:33:26
2014-01-29T10:33:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,380
java
package edu.upc.eetac.dsa.dsaqt1314g1.virtualtrade.android.api; import java.util.Date; import java.util.ArrayList; import java.util.List; public class Anuncio { private String anuncioid; private String email; private String subject; private String content; private boolean estado; private String precio; private Date creation_timestamp; private String atributo1; private String atributo2; private String atributo3; private String marca; private List<Link> links = new ArrayList<Link>(); private List<Imagen> imagenes = new ArrayList<Imagen>(); public void add(Link link) { links.add(link); } public List<Link> getLinks() { return links; } public void setLinks(List<Link> links) { this.links = links; } public void add(Imagen imagen) { imagenes.add(imagen); } public List<Imagen> getImagenes() { return imagenes; } public void setImagenes(List<Imagen> imagenes) { this.imagenes = imagenes; } public String getAnuncioid() { return anuncioid; } public void setAnuncioid(String anuncioid) { this.anuncioid = anuncioid; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public boolean isEstado() { return estado; } public void setEstado(boolean estado) { this.estado = estado; } public String getPrecio() { return precio; } public void setPrecio(String precio) { this.precio = precio; } public Date getCreation_timestamp() { return creation_timestamp; } public void setCreation_timestamp(Date creation_timestamp) { this.creation_timestamp = creation_timestamp; } public String getAtributo1() { return atributo1; } public void setAtributo1(String atributo1) { this.atributo1 = atributo1; } public String getAtributo2() { return atributo2; } public void setAtributo2(String atributo2) { this.atributo2 = atributo2; } public String getAtributo3() { return atributo3; } public void setAtributo3(String atributo3) { this.atributo3 = atributo3; } public String getMarca() { return marca; } public void setMarca(String marca) { this.marca = marca; } }
[ "roxanagogonea@gmail.com" ]
roxanagogonea@gmail.com
fd526b51305c928f9e77f69b9b62c5cd71bb0a9d
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-groundstation/src/main/java/com/amazonaws/services/groundstation/model/CreateMissionProfileRequest.java
63c57c4a3fdcb4a86dee6cad84781834186010be
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
19,005
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.groundstation.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * <p/> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/groundstation-2019-05-23/CreateMissionProfile" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateMissionProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. * </p> */ private Integer contactPostPassDurationSeconds; /** * <p> * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming pass. * </p> */ private Integer contactPrePassDurationSeconds; /** * <p> * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a <i>to</i> * <code>Config</code>. * </p> */ private java.util.List<java.util.List<String>> dataflowEdges; /** * <p> * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station will not * present you with contacts shorter than this duration. * </p> */ private Integer minimumViableContactDurationSeconds; /** * <p> * Name of a mission profile. * </p> */ private String name; /** * <p> * Tags assigned to a mission profile. * </p> */ private java.util.Map<String, String> tags; /** * <p> * ARN of a tracking <code>Config</code>. * </p> */ private String trackingConfigArn; /** * <p> * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. * </p> * * @param contactPostPassDurationSeconds * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. */ public void setContactPostPassDurationSeconds(Integer contactPostPassDurationSeconds) { this.contactPostPassDurationSeconds = contactPostPassDurationSeconds; } /** * <p> * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. * </p> * * @return Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. */ public Integer getContactPostPassDurationSeconds() { return this.contactPostPassDurationSeconds; } /** * <p> * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. * </p> * * @param contactPostPassDurationSeconds * Amount of time after a contact ends that you’d like to receive a CloudWatch event indicating the pass has * finished. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withContactPostPassDurationSeconds(Integer contactPostPassDurationSeconds) { setContactPostPassDurationSeconds(contactPostPassDurationSeconds); return this; } /** * <p> * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming pass. * </p> * * @param contactPrePassDurationSeconds * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming * pass. */ public void setContactPrePassDurationSeconds(Integer contactPrePassDurationSeconds) { this.contactPrePassDurationSeconds = contactPrePassDurationSeconds; } /** * <p> * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming pass. * </p> * * @return Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming * pass. */ public Integer getContactPrePassDurationSeconds() { return this.contactPrePassDurationSeconds; } /** * <p> * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming pass. * </p> * * @param contactPrePassDurationSeconds * Amount of time prior to contact start you’d like to receive a CloudWatch event indicating an upcoming * pass. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withContactPrePassDurationSeconds(Integer contactPrePassDurationSeconds) { setContactPrePassDurationSeconds(contactPrePassDurationSeconds); return this; } /** * <p> * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a <i>to</i> * <code>Config</code>. * </p> * * @return A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a * <i>to</i> <code>Config</code>. */ public java.util.List<java.util.List<String>> getDataflowEdges() { return dataflowEdges; } /** * <p> * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a <i>to</i> * <code>Config</code>. * </p> * * @param dataflowEdges * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a * <i>to</i> <code>Config</code>. */ public void setDataflowEdges(java.util.Collection<java.util.List<String>> dataflowEdges) { if (dataflowEdges == null) { this.dataflowEdges = null; return; } this.dataflowEdges = new java.util.ArrayList<java.util.List<String>>(dataflowEdges); } /** * <p> * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a <i>to</i> * <code>Config</code>. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDataflowEdges(java.util.Collection)} or {@link #withDataflowEdges(java.util.Collection)} if you want * to override the existing values. * </p> * * @param dataflowEdges * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a * <i>to</i> <code>Config</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withDataflowEdges(java.util.List<String>... dataflowEdges) { if (this.dataflowEdges == null) { setDataflowEdges(new java.util.ArrayList<java.util.List<String>>(dataflowEdges.length)); } for (java.util.List<String> ele : dataflowEdges) { this.dataflowEdges.add(ele); } return this; } /** * <p> * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a <i>to</i> * <code>Config</code>. * </p> * * @param dataflowEdges * A list of lists of ARNs. Each list of ARNs is an edge, with a <i>from</i> <code>Config</code> and a * <i>to</i> <code>Config</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withDataflowEdges(java.util.Collection<java.util.List<String>> dataflowEdges) { setDataflowEdges(dataflowEdges); return this; } /** * <p> * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station will not * present you with contacts shorter than this duration. * </p> * * @param minimumViableContactDurationSeconds * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station * will not present you with contacts shorter than this duration. */ public void setMinimumViableContactDurationSeconds(Integer minimumViableContactDurationSeconds) { this.minimumViableContactDurationSeconds = minimumViableContactDurationSeconds; } /** * <p> * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station will not * present you with contacts shorter than this duration. * </p> * * @return Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station * will not present you with contacts shorter than this duration. */ public Integer getMinimumViableContactDurationSeconds() { return this.minimumViableContactDurationSeconds; } /** * <p> * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station will not * present you with contacts shorter than this duration. * </p> * * @param minimumViableContactDurationSeconds * Smallest amount of time in seconds that you’d like to see for an available contact. AWS Ground Station * will not present you with contacts shorter than this duration. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withMinimumViableContactDurationSeconds(Integer minimumViableContactDurationSeconds) { setMinimumViableContactDurationSeconds(minimumViableContactDurationSeconds); return this; } /** * <p> * Name of a mission profile. * </p> * * @param name * Name of a mission profile. */ public void setName(String name) { this.name = name; } /** * <p> * Name of a mission profile. * </p> * * @return Name of a mission profile. */ public String getName() { return this.name; } /** * <p> * Name of a mission profile. * </p> * * @param name * Name of a mission profile. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withName(String name) { setName(name); return this; } /** * <p> * Tags assigned to a mission profile. * </p> * * @return Tags assigned to a mission profile. */ public java.util.Map<String, String> getTags() { return tags; } /** * <p> * Tags assigned to a mission profile. * </p> * * @param tags * Tags assigned to a mission profile. */ public void setTags(java.util.Map<String, String> tags) { this.tags = tags; } /** * <p> * Tags assigned to a mission profile. * </p> * * @param tags * Tags assigned to a mission profile. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see CreateMissionProfileRequest#withTags * @returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap<String, String>(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest clearTagsEntries() { this.tags = null; return this; } /** * <p> * ARN of a tracking <code>Config</code>. * </p> * * @param trackingConfigArn * ARN of a tracking <code>Config</code>. */ public void setTrackingConfigArn(String trackingConfigArn) { this.trackingConfigArn = trackingConfigArn; } /** * <p> * ARN of a tracking <code>Config</code>. * </p> * * @return ARN of a tracking <code>Config</code>. */ public String getTrackingConfigArn() { return this.trackingConfigArn; } /** * <p> * ARN of a tracking <code>Config</code>. * </p> * * @param trackingConfigArn * ARN of a tracking <code>Config</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateMissionProfileRequest withTrackingConfigArn(String trackingConfigArn) { setTrackingConfigArn(trackingConfigArn); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getContactPostPassDurationSeconds() != null) sb.append("ContactPostPassDurationSeconds: ").append(getContactPostPassDurationSeconds()).append(","); if (getContactPrePassDurationSeconds() != null) sb.append("ContactPrePassDurationSeconds: ").append(getContactPrePassDurationSeconds()).append(","); if (getDataflowEdges() != null) sb.append("DataflowEdges: ").append(getDataflowEdges()).append(","); if (getMinimumViableContactDurationSeconds() != null) sb.append("MinimumViableContactDurationSeconds: ").append(getMinimumViableContactDurationSeconds()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getTrackingConfigArn() != null) sb.append("TrackingConfigArn: ").append(getTrackingConfigArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateMissionProfileRequest == false) return false; CreateMissionProfileRequest other = (CreateMissionProfileRequest) obj; if (other.getContactPostPassDurationSeconds() == null ^ this.getContactPostPassDurationSeconds() == null) return false; if (other.getContactPostPassDurationSeconds() != null && other.getContactPostPassDurationSeconds().equals(this.getContactPostPassDurationSeconds()) == false) return false; if (other.getContactPrePassDurationSeconds() == null ^ this.getContactPrePassDurationSeconds() == null) return false; if (other.getContactPrePassDurationSeconds() != null && other.getContactPrePassDurationSeconds().equals(this.getContactPrePassDurationSeconds()) == false) return false; if (other.getDataflowEdges() == null ^ this.getDataflowEdges() == null) return false; if (other.getDataflowEdges() != null && other.getDataflowEdges().equals(this.getDataflowEdges()) == false) return false; if (other.getMinimumViableContactDurationSeconds() == null ^ this.getMinimumViableContactDurationSeconds() == null) return false; if (other.getMinimumViableContactDurationSeconds() != null && other.getMinimumViableContactDurationSeconds().equals(this.getMinimumViableContactDurationSeconds()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getTrackingConfigArn() == null ^ this.getTrackingConfigArn() == null) return false; if (other.getTrackingConfigArn() != null && other.getTrackingConfigArn().equals(this.getTrackingConfigArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContactPostPassDurationSeconds() == null) ? 0 : getContactPostPassDurationSeconds().hashCode()); hashCode = prime * hashCode + ((getContactPrePassDurationSeconds() == null) ? 0 : getContactPrePassDurationSeconds().hashCode()); hashCode = prime * hashCode + ((getDataflowEdges() == null) ? 0 : getDataflowEdges().hashCode()); hashCode = prime * hashCode + ((getMinimumViableContactDurationSeconds() == null) ? 0 : getMinimumViableContactDurationSeconds().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTrackingConfigArn() == null) ? 0 : getTrackingConfigArn().hashCode()); return hashCode; } @Override public CreateMissionProfileRequest clone() { return (CreateMissionProfileRequest) super.clone(); } }
[ "" ]
80aabde256e935715ffc448b99ace12269b17b78
3efe166292de0de621c41bc195d6d4f48d510624
/DataModelExtractor/src/importWizard/ProgressPane.java
ab064d461f09d4362415df6dd094da9b025df61b
[]
no_license
sureshsarda/DataModelExtractor
6dd98053e6420056ec64d89da23ef8d182a806d2
4545bf7137671cdd734f3ea7e87ce012d17b83d4
refs/heads/master
2021-01-10T03:10:05.335003
2015-05-22T13:28:04
2015-05-22T13:28:04
36,028,580
0
0
null
null
null
null
UTF-8
Java
false
false
6,600
java
/** * ProgressPane: Progress Pane actually extracts the Entity-Relationship * information from text using Stanford processor. Refer the algorithm to how it * is achieved. Briefly, there is a progress bar and extraction is done in * background. * * @author SureshSarda */ package importWizard; import java.awt.Dimension; import java.io.File; import java.io.PrintStream; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import javax.swing.JProgressBar; import javax.swing.SwingWorker; import nlp.objects.TagDataLoader; import nlp.processing.StanfordProcessor; import nlp.test.LookupResultObject; import nlp.test.TestParagraph; import nlp.test.TestSentence; import trie.serial.SerialTrie; @SuppressWarnings("serial") public class ProgressPane extends ImportWizardPageTemplate { JProgressBar progressbar; String text; static String trieFile = "data/model.xml"; TestParagraph para; public ProgressPane() { super(); super.initComponents(); nextButton.setText("Finish"); titleLabelMessage("Loading Part-Of-Speech Tagger"); progressbar = new JProgressBar(); progressbar.setIndeterminate(true); progressbar.setPreferredSize(new Dimension(500, 20)); center.add(progressbar); backgroundWorker(); } private void backgroundWorker() { SwingWorker<TestParagraph, Void> worker = new SwingWorker<TestParagraph, Void>() { public List<TestSentence> processSentencesParallel(List<String> sentences, SerialTrie trie) throws InterruptedException, ExecutionException { int threads = Runtime.getRuntime().availableProcessors(); ExecutorService service = Executors.newFixedThreadPool(threads); List<Future<TestSentence>> futures = new ArrayList<Future<TestSentence>>(); for (final String sent : sentences) { Callable<TestSentence> callable = new Callable<TestSentence>() { public TestSentence call() throws Exception { TestSentence output = new TestSentence(sent); trie.assignLookupResults(output); output.sortLookupResult(); output.discardExtraResults(4); return output; } }; futures.add(service.submit(callable)); } service.shutdown(); int id = 0; List<TestSentence> outputs = new ArrayList<TestSentence>(); for (Future<TestSentence> future : futures) { future.get().setId(id++); outputs.add(future.get()); } return outputs; } @Override protected TestParagraph doInBackground() throws Exception { // profiling purposes long startTime = System.currentTimeMillis(); // Load Stanford processor StanfordProcessor instance = StanfordProcessor.getInstance(); titleLabelMessage("Parsing document text"); List<String> rawSentences = instance.paragraphToSentences(text); titleLabelMessage("Loading tagging model"); SerialTrie trie = SerialTrie.loadFromXml(trieFile); TagDataLoader.getInstance().load(); para = new TestParagraph(); titleLabelMessage("Tagging " + (rawSentences.size() + 1) + " sentences"); para.setSentences(processSentencesParallel(rawSentences, trie)); titleLabelMessage("Tagging Complete"); // enable/disable components when tagging is complete nextButton.setEnabled(true); nextButton.requestFocus(); progressbar.setIndeterminate(false); progressbar.setValue(100); // For profiling purposes long endTime = System.currentTimeMillis(); long timeRequired = endTime - startTime; System.out.println("Total Time Required: " + timeRequired); System.out.println("Time per sentence: " + timeRequired / para.getSentences().size()); return para; } /* * @Override protected TestParagraph doInBackground() throws * Exception { long startTime = System.currentTimeMillis(); * StanfordProcessor instance = StanfordProcessor.getInstance(); * * titleLabelMessage("Parsing document text"); * * List<String> rawSentences = instance.paragraphToSentences(text); * * titleLabelMessage("Loading tagging model"); SerialTrie trie = * SerialTrie.loadFromXml(trieFile); * TagDataLoader.getInstance().load(); * * progressbar.setIndeterminate(false); para = new TestParagraph(); * titleLabelMessage("Tagging " + (rawSentences.size() + 1) + * " sentences"); for (int i = 0; i < rawSentences.size(); i++) { * //Update progress bar int val = (i * 100 )/ rawSentences.size(); * progressbar.setValue(val); * * // TestSentence tSent = new TestSentence(rawSentences.get(i)); * tSent.setId(i); trie.assignLookupResults(tSent); * tSent.sortLookupResult(); tSent.discardExtraResults(4); * * para.getSentences().add(tSent); } progressbar.setValue(100); * titleLabelMessage("Tagging Complete"); * * System.setOut(new PrintStream(new * File("C://Users//SureshSarda//Desktop//file.txt"))); for * (TestSentence sent : para.getSentences()) { * System.out.println(sent.getValue()); for (LookupResultObject obj * : sent.getLookupResults()) { System.out.println(obj); } * System.out.println( * "---------------------------------------------------------------------------" * ); } * * long endTime = System.currentTimeMillis(); long timeRequired = * endTime - startTime; * * System.out.println("Total Time Required: " + timeRequired); * System.out.println("Time per sentence: " + timeRequired / * para.getSentences().size()); * * nextButton.setEnabled(true); nextButton.requestFocus(); * * return para; } */ }; worker.execute(); } protected TestParagraph getTestParagraph() { return para; } private void titleLabelMessage(String message) { StringBuilder sb = new StringBuilder(); sb.append("<html><body>"); sb.append("<b>Hang tight! Extracting Entity-Relationship information</b>"); // sb.append("<p>Import wizard lets you extract entity-relation diagram from a text document. Browse for a file or start typing text.</p>"); sb.append("<br>"); sb.append("<br>"); sb.append("<p>"); sb.append(message); sb.append("</p>"); sb.append("</body></html>"); title.setText(sb.toString()); } }
[ "Username123*" ]
Username123*
33c17a352c1838b2b8d3f6d1746cd6162683ae69
a319559a5a378aff71c5df1f2b7946f4357dd802
/AndroidAnnotationTestTwo/.apt_generated/com/example/androidannotationtesttwo/view/PhotoDetailView_.java
0d96f12beb879b93b7b4c85b68fa6642d54faac6
[]
no_license
201216323/GraduationDesign
2bfc20062b0d87b4cd1248d421062f762635a598
cb24cf2937e7cf92d1c46e73b23f3bba718976fe
refs/heads/master
2021-01-11T20:19:18.573530
2017-02-09T01:59:17
2017-02-09T01:59:17
79,088,150
0
0
null
null
null
null
UTF-8
Java
false
false
2,725
java
// // DO NOT EDIT THIS FILE.Generated using AndroidAnnotations 3.3.2. // You can create a larger work that contains this file and distribute that work under terms of your choice. // package com.example.androidannotationtesttwo.view; import android.content.Context; import android.widget.ImageView; import android.widget.TextView; import com.example.androidannotationtesttwo.R.id; import com.example.androidannotationtesttwo.R.layout; import com.example.androidannotationtesttwo.widget.ProgressButton; import org.androidannotations.api.view.HasViews; import org.androidannotations.api.view.OnViewChangedListener; import org.androidannotations.api.view.OnViewChangedNotifier; /** * We use @SuppressWarning here because our java code * generator doesn't know that there is no need * to import OnXXXListeners from View as we already * are in a View. * */ @SuppressWarnings("unused") public final class PhotoDetailView_ extends PhotoDetailView implements HasViews, OnViewChangedListener { private boolean alreadyInflated_ = false; private final OnViewChangedNotifier onViewChangedNotifier_ = new OnViewChangedNotifier(); public PhotoDetailView_(Context context) { super(context); init_(); } public static PhotoDetailView build(Context context) { PhotoDetailView_ instance = new PhotoDetailView_(context); instance.onFinishInflate(); return instance; } /** * The mAlreadyInflated_ hack is needed because of an Android bug * which leads to infinite calls of onFinishInflate() * when inflating a layout with a parent and using * the <merge /> tag. * */ @Override public void onFinishInflate() { if (!alreadyInflated_) { alreadyInflated_ = true; inflate(getContext(), layout.item_detail_photo, this); onViewChangedNotifier_.notifyViewChanged(this); } super.onFinishInflate(); } private void init_() { OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_); OnViewChangedNotifier.registerOnViewChangedListener(this); OnViewChangedNotifier.replaceNotifier(previousNotifier); } @Override public void onViewChanged(HasViews hasViews) { photoCount = ((TextView) hasViews.findViewById(id.photo_count)); currentImage = ((ImageView) hasViews.findViewById(id.current_image)); progressButton = ((ProgressButton) hasViews.findViewById(id.progressButton)); photoContent = ((TextView) hasViews.findViewById(id.photo_content)); photoTitle = ((TextView) hasViews.findViewById(id.photo_title)); initView(); } }
[ "[1060140613@qq.com]" ]
[1060140613@qq.com]
7862da92fa654d28ba8d002b44d53bd53a19d259
11e991e40d2c143c4fe63ddc25a1ef849f4e44de
/app/src/main/java/com/example/diku/food/ViewHolder/VirtualcartAdapter.java
0559a9fa3f672d03dd2293cf6d13c19df41265bf
[]
no_license
Snigdhadeep/FoodApp-ClientSide-
6e7d9549d39a2306889952b80923d368b267e273
0b219d3d26de66fb5ec80411ea79472c51f80580
refs/heads/master
2020-03-18T04:49:21.624940
2018-06-15T19:36:32
2018-06-15T19:36:32
134,308,430
0
0
null
null
null
null
UTF-8
Java
false
false
911
java
package com.example.diku.food.ViewHolder; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.example.diku.food.Module.Order; import com.example.diku.food.R; /** * Created by Diku on 06-06-2018. */ public class VirtualcartAdapter extends RecyclerView.Adapter<CartViewHolder> { private Context context; Order order; @Override public CartViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater=LayoutInflater.from(context); View itemview=inflater.inflate(R.layout.cart_layout,parent,false); return new CartViewHolder(itemview); } @Override public void onBindViewHolder(CartViewHolder holder, int position) { } @Override public int getItemCount() { return 0; } }
[ "snigdhadeep93@gmail.com" ]
snigdhadeep93@gmail.com
f1710eb5ab733d6e93015eba1b84689c1508410b
6690a7bc879e25ec9095f2eb1cd44ded507ac951
/src/main/java/br/com/edson/workshopmongodb/resources/PostResource.java
fff377884d4e1cb6139b80bac734f092cad1f4b5
[]
no_license
edsonrjunior/workshop-spring-boot-mongdb
618b809928a0a4264f79f2a6e2e002ff06285ccd
cbda7a55fa2a5f57900d75ebf1546a7cbbd86c89
refs/heads/master
2022-10-16T03:38:18.706058
2020-06-10T03:45:49
2020-06-10T03:45:49
270,130,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
package br.com.edson.workshopmongodb.resources; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import br.com.edson.workshopmongodb.domain.Post; import br.com.edson.workshopmongodb.resources.util.URL; import br.com.edson.workshopmongodb.services.PostService; @RestController @RequestMapping(value = "/posts") public class PostResource { @Autowired private PostService service; @RequestMapping(value = "/{id}", method = RequestMethod.GET) public ResponseEntity<Post> findById(@PathVariable String id) { Post obj = service.findById(id); return ResponseEntity.ok().body(obj); } @RequestMapping(value = "/titlesearch", method = RequestMethod.GET) public ResponseEntity<List<Post>> findByTitle(@RequestParam(value = "text", defaultValue = "") String text) { text = URL.decodeParam(text); List<Post> list = service.findByTitle(text); return ResponseEntity.ok().body(list); } @RequestMapping(value = "/fullsearch", method = RequestMethod.GET) public ResponseEntity<List<Post>> fullSearch( @RequestParam(value = "text", defaultValue = "") String text, @RequestParam(value = "minDate", defaultValue = "") String minDate, @RequestParam(value = "maxDate", defaultValue = "") String maxDate) { text = URL.decodeParam(text); //Obter a data mínima Date min = URL.convertDate(minDate, new Date(0L)); //Obter a data atual Date max = URL.convertDate(maxDate, new Date()); List<Post> list = service.fullSearch(text, min, max); return ResponseEntity.ok().body(list); } }
[ "edsonkjr@gmail.com" ]
edsonkjr@gmail.com
47a5b1a743b78df284331beabd0a476bf70a638f
1440db8f205457f873b3222c9b7047fc41ae0ffd
/app/src/main/java/com/savemeout/di/annotation/ActivityContext.java
3b39621e85896b1262dea95fdb2142ca69feb186
[]
no_license
binod-techindustan/Savemeout
71887d84494bb7a4991c158e4fb067d8ca332c27
0d90933426f2f7768ddf46bd9119382b76276558
refs/heads/master
2021-03-27T15:14:31.839561
2018-01-16T12:28:13
2018-01-16T12:28:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
/* * Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.savemeout.di.annotation; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Qualifier; /** * Created by amitshekhar on 13/01/17. */ @Qualifier @Retention(RetentionPolicy.RUNTIME) public @interface ActivityContext { }
[ "binod.techindustan@gmail.com" ]
binod.techindustan@gmail.com
21a19a14b31087d193e9bf9f8e25437c6bbe481c
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgGson/src/org/kyojo/schemaorg/m3n5/gson/core/clazz/ActionAccessSpecificationDeserializer.java
5c34569d6fd3d5bbd38dfc2291eacdf7817e0cab
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
package org.kyojo.schemaorg.m3n5.gson.core.clazz; import java.lang.reflect.Field; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; import org.kyojo.gson.JsonDeserializationContext; import org.kyojo.gson.JsonDeserializer; import org.kyojo.gson.JsonElement; import org.kyojo.gson.JsonParseException; import org.kyojo.schemaorg.m3n5.core.impl.ACTION_ACCESS_SPECIFICATION; import org.kyojo.schemaorg.m3n5.core.Clazz.ActionAccessSpecification; import org.kyojo.schemaorg.m3n5.gson.DeserializerTemplate; public class ActionAccessSpecificationDeserializer implements JsonDeserializer<ActionAccessSpecification> { public static Map<String, Field> fldMap = new HashMap<>(); @Override public ActionAccessSpecification deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { if(jsonElement.isJsonPrimitive()) { return new ACTION_ACCESS_SPECIFICATION(jsonElement.getAsString()); } return DeserializerTemplate.deserializeSub(jsonElement, type, context, new ACTION_ACCESS_SPECIFICATION(), ActionAccessSpecification.class, ACTION_ACCESS_SPECIFICATION.class, fldMap); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
a65184691f708862142c1198771498220df2d722
a3e7b7d403bdc00b929423cc15488f5f0b0c39e3
/climate/src/main/java/com/boc/entities/DateRange.java
4568217e1a191f36bc63800d8f46edb75ac2d3af
[ "Apache-2.0" ]
permissive
paulchenzhong/boc-quiz
4e40fb2b1e68bb296222dc0daa3a4be9e36f45d8
9c7bf7bf57c80d4884670e19e301743c949947d3
refs/heads/main
2023-03-19T22:10:30.949840
2021-03-11T08:47:35
2021-03-11T08:47:35
346,145,828
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.boc.entities; import java.util.Date; import org.springframework.format.annotation.DateTimeFormat; public class DateRange { // Set date ranger for filter @DateTimeFormat(pattern = "dd/MM/yyyy") private Date dateFrom; @DateTimeFormat(pattern = "dd/MM/yyyy") private Date dateTo; public Date getDateFrom() { return dateFrom; } public DateRange() { } public DateRange(Date dateFrom, Date dateTo) { super(); this.dateFrom = dateFrom; this.dateTo = dateTo; } public void setDateFrom(Date dateFrom) { this.dateFrom = dateFrom; } public Date getDateTo() { return dateTo; } public void setDateTo(Date dateTo) { this.dateTo = dateTo; } }
[ "zhongpaul.chen@hrsdc-rhdcc.gc.ca" ]
zhongpaul.chen@hrsdc-rhdcc.gc.ca
979c7de4b0006af7cd896264a98237af186754b6
f2a38cd34d5ff1763013202e1db1da02b586fdff
/src/main/java/com/example/demo/Demo6Application.java
d012ab1264f9bcefd73896da74e3d72358957640
[]
no_license
ardlal1989/testtwo
f4df0cbc2f8a946ccd78a44402aee0b2683ff7ac
7f700b5a2a425cae150afb6379151bad4028d9f2
refs/heads/master
2020-09-02T07:31:43.070687
2019-11-02T14:50:36
2019-11-02T14:50:36
219,168,065
0
0
null
null
null
null
UTF-8
Java
false
false
372
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; @SpringBootApplication public class Demo6Application { public static void main(String[] args) { SpringApplication.run(Demo6Application.class, args); } }
[ "noreply@github.com" ]
ardlal1989.noreply@github.com
22f45d4ccd273bbf4fc5c4230d7a3444bdc5810d
60a43481e2bc635beb86f24033ebc1c865d9c1ee
/src/main/java/mcjty/theoneprobe/api/ILayoutStyle.java
02500669e025c296454525b10cbed192b587f4c0
[ "MIT" ]
permissive
Zarathul/simplefluidtanks
d305e399efb15409ef472d211d2d0e38a4f26be8
6c95d4e6a3efc24aa2b50910d5a1f4b0434d3ef1
refs/heads/1.12.2
2020-12-12T22:57:00.179800
2019-08-07T17:37:05
2019-08-07T17:37:05
17,317,984
8
8
MIT
2019-08-07T17:37:06
2014-03-01T15:48:33
Java
UTF-8
Java
false
false
655
java
package mcjty.theoneprobe.api; /** * Style for a horizonatl or vertical layout. */ public interface ILayoutStyle { /// The color that is used for the border of the progress bar ILayoutStyle borderColor(Integer c); /** * The spacing to use between elements in this panel. -1 means to use default depending * on vertical vs horizontal. */ ILayoutStyle spacing(int f); /** * Set the alignment of the elements inside this element. Default is ALIGN_TOPLEFT */ ILayoutStyle alignment(ElementAlignment alignment); Integer getBorderColor(); int getSpacing(); ElementAlignment getAlignment(); }
[ "Zarathul@users.noreply.github.com" ]
Zarathul@users.noreply.github.com
6f003aefd22475b59c99ec13bd4ff7b9cb67c154
afae2d999ab236fc6b99e9a6c007f61b18e7abca
/app/src/main/java/com/shishiTec/HiMaster/UI/Fragment/Master/SearchShareFragment.java
14a046842a7bbeff9922ba465c98a56bd34f9c12
[]
no_license
wmm87501810/Patoo_Master
f785e34b351eb7b4e0cfb04f0d50e01bcf83966f
24bf903d011c456d4ba00048fe31e97ddea535fa
refs/heads/master
2021-08-26T07:27:35.305505
2017-11-22T07:57:54
2017-11-22T07:57:54
111,639,510
0
0
null
null
null
null
UTF-8
Java
false
false
5,474
java
package com.shishiTec.HiMaster.UI.fragment.master; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.Gravity; import android.view.View; import com.shishiTec.HiMaster.Model.bean.MyShareBean; import com.shishiTec.HiMaster.Model.params.BaseParams; import com.shishiTec.HiMaster.Model.params.DeviceParams; import com.shishiTec.HiMaster.Net.RetrofitManager; import com.shishiTec.HiMaster.R; import com.shishiTec.HiMaster.UI.Adapter.userCenter.MyShareAdapter; import com.shishiTec.HiMaster.Utils.ToastUtils; import com.shishiTec.HiMaster.base.BaseFragment; import com.shishiTec.HiMaster.base.BaseModel; import java.util.HashMap; import java.util.List; import java.util.Map; import rx.Subscriber; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by hyu on 2016/5/13. */ public class SearchShareFragment extends BaseFragment { private RecyclerView rl_search_share; private SwipeRefreshLayout swipeRefreshLayout; private int page = 1; private int page_size = 10; private MyShareAdapter myShareAdapter; private List<MyShareBean> list; private LinearLayoutManager linearLayoutManager; private int lastVisibleItem; private String key; @Override protected int getLayoutResId() { return R.layout.fragment_search_share; } @Override protected void onInflated(View contentView, Bundle savedInstanceState) { initViews(); Refresh(); } public void notifyData(String key){ this.key = key; queryMyShare(page,page_size,true); } public void setdapter(List<MyShareBean> key){ MyShareAdapter shareAdapter = new MyShareAdapter(getActivity(),key); rl_search_share.setAdapter(shareAdapter); } private void Refresh() { swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { queryMyShare(1,page_size,true); swipeRefreshLayout.setRefreshing(false); } }); rl_search_share.setOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (newState == RecyclerView.SCROLL_STATE_IDLE && lastVisibleItem + 1 == myShareAdapter.getItemCount()) { queryMyShare(++page,page_size,false); } } @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); lastVisibleItem = linearLayoutManager.findLastVisibleItemPosition(); } }); } protected void initViews() { rl_search_share = (RecyclerView) getContentView().findViewById(R.id.rl_search_share); swipeRefreshLayout = (SwipeRefreshLayout) getContentView().findViewById(R.id.swipeRefreshLayout); linearLayoutManager = new LinearLayoutManager(getActivity()); rl_search_share.setLayoutManager(linearLayoutManager); } private void queryMyShare(int page, int page_size, final boolean b){ Map<String,String> myShareMap = new HashMap<>(); device = new DeviceParams(); params = new BaseParams(device); params.setDevice(device); params.setSign(params.paramsSign()); params.setRest_version("3.0"); Log.i("key:",key); myShareMap.put("keywords",key); myShareMap.put("page", page + ""); myShareMap.put("page_size", page_size + ""); Log.i("key",myShareMap.size()+""); params.setData(myShareMap); Subscription subscribe = RetrofitManager.getmInstance().createService() .searchShare(params) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<BaseModel<List<MyShareBean>>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { ToastUtils.showGravity(getActivity(), "请求失败", Gravity.CENTER, 0, 0); } @Override public void onNext(BaseModel<List<MyShareBean>> listBaseModel) { if (listBaseModel.getCode()==200){ if(b){ list = listBaseModel.getData(); myShareAdapter = new MyShareAdapter(getActivity(),list); rl_search_share.setAdapter(myShareAdapter); }else{ if(listBaseModel.getData().size() > 0){ list.addAll(listBaseModel.getData()); myShareAdapter.addMoreItem(list); }else{ } } } } }); addSubscription(subscribe); } }
[ "272989027@qq.com" ]
272989027@qq.com
bc5cfd2efd6c826bf67de5afa126fb79c9f8a2fb
83d56024094d15f64e07650dd2b606a38d7ec5f1
/sicc_druida/fuentes/java/INCResultadosCierreCampana2.java
b4174279758e7ce6900f898f450c224dec23fb1f
[]
no_license
cdiglesias/SICC
bdeba6af8f49e8d038ef30b61fcc6371c1083840
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
refs/heads/master
2021-01-19T19:45:14.788800
2016-04-07T16:20:51
2016-04-07T16:20:51
null
0
0
null
null
null
null
ISO-8859-10
Java
false
false
27,020
java
import es.indra.druida.DruidaConector; import es.indra.mare.common.mii.services.jdbcservice.RecordSet; import es.indra.mare.common.mln.MareBusinessID; import es.indra.sicc.cmn.cargaInicial.ComposerViewElement; import es.indra.sicc.cmn.cargaInicial.ComposerViewElementList; import es.indra.sicc.cmn.cargaInicial.presentacion.ConectorComposerView; import es.indra.sicc.rep.logicanegocio.ConstantesREP; import es.indra.sicc.util.DTOBelcorp; import es.indra.sicc.util.DTOOID; import es.indra.sicc.util.DTOSalida; import es.indra.sicc.dtos.zon.DTOUnidadAdministrativa; import es.indra.sicc.dtos.mae.DTOTipoSubtipo; import es.indra.sicc.dtos.mae.DTOClasificaciones; import es.indra.sicc.util.UtilidadesSession; import es.indra.sicc.util.xml.XMLDocument; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Vector; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text; /* * LP del CU: Generar Informe Resultado al Cierre de Campaņa */ public class INCResultadosCierreCampana2 extends LPSICCBase { public INCResultadosCierreCampana2() { super(); } public void inicio() throws Exception { } public void ejecucion() throws Exception { String accion = conectorParametroLimpia("accion","", true); setTrazaFichero(); try { this.rastreo(); if (accion.equals("generar")){ generarReporte(); traza("termino de generar el reporte"); //cargarPagina(); }else{ cargarPagina(); getConfiguracionMenu("INCResultadosCierreCampana2"); } } catch (Exception ex) { //pagina("contenido_informe_pedidos_escala_generar"); //getConfiguracionMenu("INCResultadosCierreCampana2"); ByteArrayOutputStream stack = new ByteArrayOutputStream(); PrintStream out = new PrintStream(stack); ex.printStackTrace(out); traza("EXCEPCION:" + stack.toString()); lanzarPaginaError(ex); /* try{ cargarPagina(); }catch(Exception e){ e.printStackTrace(); }*/ } } private DruidaConector generarConector(String rowsetID, RecordSet datos, Vector columns) throws DOMException, Exception { StringBuffer salida = new StringBuffer(); int sizeColums = datos.getColumnCount(); int sizeRows = datos.getRowCount(); if (columns == null) { columns = new Vector(); } Vector columsDesc = datos.getColumnIdentifiers(); DruidaConector conectorValoresPosibles = new DruidaConector(); XMLDocument xmlDoc = new XMLDocument(); Document docDestino = xmlDoc.makeDocument("<ROWSET2/>"); Element e_rows = docDestino.createElement("ROWSET"); e_rows.setAttribute("ID", rowsetID); docDestino.getDocumentElement().appendChild(e_rows); for (int i = 0; i < sizeRows; i++) { Element e_row = docDestino.createElement("ROW"); e_rows.appendChild(e_row); for (int j = 0; j < sizeColums; j++) { if (columns.contains(columsDesc.elementAt(j))) { Element e_campo2 = docDestino.createElement("CAMPO"); e_campo2.setAttribute("NOMBRE", columsDesc.elementAt(j).toString()); e_campo2.setAttribute("TIPO", "OBJECTO"); e_campo2.setAttribute("LONGITUD", "50"); Text txt = docDestino.createTextNode(((datos.getValueAt(i, j) == null) ? "" : datos.getValueAt(i, j).toString())); e_campo2.appendChild(txt); e_row.appendChild(e_campo2); } } } conectorValoresPosibles.setXML(docDestino.getDocumentElement()); return conectorValoresPosibles; } private void cargarPagina() throws Exception{ pagina("contenido_informe_resultados_campana_generar"); asignarAtributoPagina("cod", "0873"); asignarAtributo("VAR", "lp", "valor", "INCResultadosCierreCampana2"); ComposerViewElementList cv = crearParametrosEntrada(); ConectorComposerView conector = new ConectorComposerView(cv, this.getRequest()); conector.ejecucion(); DruidaConector resultados = conector.getConector(); traza(" 4 " + resultados.getXML()); asignar("COMBO","cbMarca",resultados,"SEGConsultaMarcas"); asignar("COMBO","cbCanal",resultados,"SEGConsultaCanales"); asignarAtributo("VAR", "idioma", "valor", UtilidadesSession.getIdioma(this).toString()); asignarAtributo("VAR", "pais", "valor", UtilidadesSession.getPais(this).toString()); //DTOs DTOUnidadAdministrativa dtoUA = new DTOUnidadAdministrativa(); dtoUA.setOidPais(UtilidadesSession.getPais(this)); dtoUA.setOidIdioma(UtilidadesSession.getIdioma(this)); DTOBelcorp dto = new DTOBelcorp(); dto.setOidPais(UtilidadesSession.getPais(this)); dto.setOidIdioma(UtilidadesSession.getIdioma(this)); Vector vec = new Vector(); // Carga Paises MareBusinessID idPais = new MareBusinessID("REPRecuperarPaises"); dto.setOidIdioma(UtilidadesSession.getIdioma(this)); vec.add(dto); vec.add(idPais); DTOSalida dtoSalPais = (DTOSalida)conectar("ConectorPaises",vec).objeto("dtoSalida"); RecordSet pais = (RecordSet)dtoSalPais.getResultado(); Vector colPAIS = pais.getColumnIdentifiers(); DruidaConector paises = generarConector("DTOSalida.paises_ROWSET",pais, colPAIS); asignar("COMBO", "cbPais", paises, "DTOSalida.paises_ROWSET"); // Carga lista oculta Regiones traza("antesde la lista oculta de Regiones"); MareBusinessID idRegiones = new MareBusinessID("ZONObtenerRegionesPorSGV"); Vector vecReg = new Vector(); vecReg.add(dtoUA); vecReg.add(idRegiones); DTOSalida dtoRegiones = (DTOSalida) conectar("ConectorUA",vecReg).objeto("dtoSalida"); RecordSet region = (RecordSet)dtoRegiones.getResultado(); Vector colRegion = region.getColumnIdentifiers(); DruidaConector regiones = generarConector("DTOSalida.regiones_ROWSET",region, colRegion); traza("regiones "+dtoRegiones.getResultado()); traza("regiones "+dtoRegiones.getResultado().getColumnIdentifiers()); this.crearListaLP(colRegion, region.getColumnCount(), "CapaReg","lstRegiones", "14", "200"); asignar("LISTA", "lstRegiones", regiones, "DTOSalida.regiones_ROWSET"); //cargo la lista oculta de Zonas traza("antesde la lista oculta de Zonas"); MareBusinessID idZonas = new MareBusinessID("ZONObtenerZonasPorRegiones"); Vector vecZ = new Vector(); vecZ.add(dtoUA); vecZ.add(idZonas); DTOSalida dtoZonas = (DTOSalida) conectar("ConectorUA",vecZ).objeto("dtoSalida"); RecordSet zona = (RecordSet)dtoZonas.getResultado(); Vector colZona = zona.getColumnIdentifiers(); DruidaConector zonas = generarConector("DTOSalida.zonas_ROWSET",zona, colZona); traza("zonas "+dtoZonas.getResultado()); traza("zonas "+dtoZonas.getResultado().getColumnIdentifiers()); this.crearListaLP(colZona, zona.getColumnCount(), "CapaZon","lstZonas", "14", "200"); asignar("LISTA", "lstZonas", zonas, "DTOSalida.zonas_ROWSET"); // Carga lista oculta Territorios traza("antesde la lista oculta de Territorios"); DTOBelcorp dtoBTerri = new DTOBelcorp(); dtoBTerri.setOidPais(UtilidadesSession.getPais(this)); MareBusinessID idTerri = new MareBusinessID("ZONObtenerTerritoriosPorZonas"); Vector vecT = new Vector(); vecT.add(dtoBTerri); vecT.add(idTerri); DTOSalida dtoT = (DTOSalida) conectar("ConectorUA",vecT).objeto("dtoSalida"); RecordSet terri = (RecordSet)dtoT.getResultado(); Vector colTerri = terri.getColumnIdentifiers(); DruidaConector terris = generarConector("DTOSalida.terris_ROWSET",terri, colTerri); traza("zonas "+dtoT.getResultado()); traza("zonas "+dtoT.getResultado().getColumnIdentifiers()); this.crearListaLP(colTerri, terri.getColumnCount(), "CapaTerri","ListaTerri", "14", "200"); asignar("LISTA", "ListaTerri", terris, "DTOSalida.terris_ROWSET"); cargarTipoSubtipo(); cargarClasificaciones(); this.getFormatosValidaciones(); } private void generarReporte() throws Exception{ HashMap datos = new HashMap(); datos.put("MODULO", "INC"); //comienzo de los parametrso de filtrado String pais = conectorParametroLimpia("pais", "", true); datos.put(ConstantesREP.PAIS, pais); String marca = conectorParametroLimpia("marca", "", true); datos.put(ConstantesREP.MARCA, marca); String canal = conectorParametroLimpia("canal", "", true); datos.put(ConstantesREP.CANAL, canal); String subgerenciaVentas = conectorParametroLimpia("subgerenciaVentas", "", true); if (!subgerenciaVentas.equals("")) { datos.put(ConstantesREP.SUBGERENCIAVENTAS, subgerenciaVentas); } String region = conectorParametroLimpia("region", "", true); if(!region.equals("")){ datos.put(ConstantesREP.REGIONES, region); } String zona = conectorParametroLimpia("zona", "", true); if(!zona.equals("")){ datos.put(ConstantesREP.ZONAS, zona); } String territorio = conectorParametroLimpia("territorio", "", true); if(!territorio.equals("")){ datos.put(ConstantesREP.TERRITORIOS, territorio); } String numeroConcurso = conectorParametroLimpia("numeroConcurso", "", true); datos.put(ConstantesREP.NUMEROCONCURSOS, numeroConcurso); String numeroPuestos = conectorParametroLimpia("numeroPuestos", "", true); if(!numeroPuestos.equals("")){ datos.put(ConstantesREP.NUMEROPUESTOS, numeroPuestos); } String tipoCliente = conectorParametroLimpia("tipoCliente", "", true); datos.put(ConstantesREP.TIPOCLIENTE, tipoCliente); String subtipoCliente = conectorParametroLimpia("subtipoCliente", "", true); if(!subtipoCliente.equals("")){ datos.put(ConstantesREP.SUBTIPOCLIENTE, subtipoCliente); } String tipoClasificacion = conectorParametroLimpia("tipoClasificacion", "", true); if(!tipoClasificacion.equals("")){ datos.put(ConstantesREP.TIPOCLASIFICACION, tipoClasificacion); } String clasificacion = conectorParametroLimpia("clasificacion", "", true); if(!clasificacion.equals("")){ datos.put(ConstantesREP.CLASIFICACION, clasificacion); } String unidadNegocio = conectorParametroLimpia("unidadNegocio", "", true); if(!unidadNegocio.equals("")){ datos.put(ConstantesREP.UNIDADNEGOCIOS, unidadNegocio); } String negocio = conectorParametroLimpia("negocio", "", true); if(!negocio.equals("")){ datos.put(ConstantesREP.NEGOCIO, negocio); } String periodoDesde = conectorParametroLimpia("periodoDesde", "", true); datos.put(ConstantesREP.PERIODODESDE, periodoDesde); String periodoHasta = conectorParametroLimpia("periodoHasta", "", true); datos.put(ConstantesREP.PERIODOHASTA, periodoHasta); datos.put(ConstantesREP.TITULO, "Resultados al cierre de Campaņa"); traza("++++++Antes de enviar a reportes " + datos); String formato = conectorParametroLimpia("formato", "", true); if(formato.equals("xls")){ datos.put(ConstantesREP.FORMATOSALIDA, "EXCEL"); } String reporte = conectorParametroLimpia("reporte", "", true); ejecutarReporte2(datos, "REPGenerarReporteBatch", reporte, formato); } private ComposerViewElementList crearParametrosEntrada() throws Exception{ traza("metodo crearParametrosEntrada() "); DTOBelcorp dtoBel = new DTOBelcorp(); dtoBel.setOidPais(UtilidadesSession.getPais(this)); dtoBel.setOidIdioma(UtilidadesSession.getIdioma(this)); ComposerViewElementList lista = new ComposerViewElementList(); //Carga de combo marca ComposerViewElement cbMarca = new ComposerViewElement(); cbMarca.setIDBusiness("SEGConsultaMarcas"); cbMarca.setDTOE(dtoBel); //Carga de combo canales ComposerViewElement cbCanales = new ComposerViewElement(); cbCanales.setIDBusiness("SEGConsultaCanales"); cbCanales.setDTOE(dtoBel); lista.addViewElement(cbMarca); lista.addViewElement(cbCanales); return lista; } private void crearListaLP(Vector nomColumns, int cantColumns, String nomCapa, String nomLista, String XCapa, String YCapa) throws Exception { traza("dentro de crearListaLP() " + nomColumns + " " + cantColumns); Document document = getXML(); Element eCapa = document.createElement("CAPA"); eCapa.setAttribute("nombre", nomCapa); eCapa.setAttribute("alto", "162"); eCapa.setAttribute("ancho", "580"); eCapa.setAttribute("colorf", ""); eCapa.setAttribute("borde", "1"); eCapa.setAttribute("imagenf", ""); eCapa.setAttribute("repeat", ""); eCapa.setAttribute("padding", ""); eCapa.setAttribute("visibilidad", "hidden"); eCapa.setAttribute("contravsb", ""); eCapa.setAttribute("zindex", ""); eCapa.setAttribute("x", XCapa); eCapa.setAttribute("y", YCapa); Element eLista = document.createElement("LISTA"); eLista.setAttribute("seleccion", "boton"); eLista.setAttribute("nombre", nomLista); eLista.setAttribute("ancho", "580"); eLista.setAttribute("alto", "150"); eLista.setAttribute("multisel", "0"); eLista.setAttribute("incy", "1"); eLista.setAttribute("incx", "10"); eLista.setAttribute("colorf", "#EFEFEF"); eLista.setAttribute("imagenoff", "close_no.gif"); eLista.setAttribute("imagenon", "close_up.gif"); eLista.setAttribute("accion", ""); eLista.setAttribute("sep", "|"); eLista.setAttribute("pixelsborde", "3"); eLista.setAttribute("colorborde", "#CCCCCC"); Element eCABECERA = document.createElement("CABECERA"); eCABECERA.setAttribute("nombre", "cabecera"); eCABECERA.setAttribute("height", "20"); Integer anchoCab; if (cantColumns < 4) { anchoCab = new Integer(580 / cantColumns); } else { anchoCab = new Integer(150); } Element eCOL_1 = document.createElement("COL"); eCOL_1.setAttribute("id", "fondoCabecera"); eCOL_1.setAttribute("ancho", anchoCab.toString()); Element eCOL_2 = document.createElement("COL"); eCOL_2.setAttribute("id", "fondoCabecera"); eCOL_2.setAttribute("ancho", anchoCab.toString()); Element eCOL_3 = document.createElement("COL"); eCOL_3.setAttribute("id", "fondoCabecera"); eCOL_3.setAttribute("ancho", anchoCab.toString()); Element eCOL_4 = document.createElement("COL"); eCOL_4.setAttribute("id", "fondoCabecera"); eCOL_4.setAttribute("ancho", anchoCab.toString()); Element eCOL_5 = document.createElement("COL"); eCOL_5.setAttribute("id", "fondoCabecera"); eCOL_5.setAttribute("ancho", anchoCab.toString()); Element eCOL_6 = document.createElement("COL"); eCOL_6.setAttribute("id", "fondoCabecera"); eCOL_6.setAttribute("ancho", anchoCab.toString()); Vector columnas = new Vector(); for (int i = 0; i < cantColumns; i++) { Element eLABEL_2 = document.createElement("LABELC"); eLABEL_2.setAttribute("id", "fondoCabecera"); eLABEL_2.setAttribute("nombre", "lbDivisionesPoliticas" + i); eLABEL_2.setAttribute("ancho", anchoCab.toString()); eLABEL_2.setAttribute("alto", "20"); eLABEL_2.setAttribute("filas", "1"); eLABEL_2.setAttribute("id", "datosCamposCabecera"); if (i != 0) { eLABEL_2.setAttribute("valor", (String) nomColumns.get(i)); } else { eLABEL_2.setAttribute("cod", "199"); } eLABEL_2.setAttribute("enviaroculto", "N"); columnas.add(eLABEL_2); //Agrego label a la columna } traza("despues de poner en variables los titulos " + columnas + " " + cantColumns); if (cantColumns >= 1) { eCOL_1.appendChild((Element) columnas.get(0)); eCABECERA.appendChild(eCOL_1); traza("1"); } if (cantColumns >= 2) { eCOL_2.appendChild((Element) columnas.get(1)); eCABECERA.appendChild(eCOL_2); traza("1"); } if (cantColumns >= 3) { eCOL_3.appendChild((Element) columnas.get(2)); eCABECERA.appendChild(eCOL_3); traza("1"); } if (cantColumns >= 4) { eCOL_4.appendChild((Element) columnas.get(3)); eCABECERA.appendChild(eCOL_4); traza("1"); } if (cantColumns >= 5) { eCOL_5.appendChild((Element) columnas.get(4)); eCABECERA.appendChild(eCOL_5); traza("1"); } if (cantColumns >= 6) { eCOL_6.appendChild((Element) columnas.get(5)); eCABECERA.appendChild(eCOL_6); traza("1"); } Element ePRESENTACION = document.createElement("PRESENTACION"); Integer ancho = new Integer(cantColumns * anchoCab.intValue()); ePRESENTACION.setAttribute("ancho", ancho.toString()); ePRESENTACION.setAttribute("filas", "1"); int swX1 = 0; StringBuffer cadena = new StringBuffer("['datosCamposCenterImpar'"); traza("break brain"); for (int i = 1; i < cantColumns; i++) { if (swX1 == 0) { cadena.append(", 'datosCamposCenterPar'"); swX1 = 1; } else { cadena.append(", 'datosCamposCenterImpar'"); swX1 = 0; } } for (int i = 0; i < cantColumns; i++) { Element eCOLP_2 = document.createElement("COL"); eCOLP_2.setAttribute("ancho", anchoCab.toString()); eCOLP_2.setAttribute("caracteres", "150"); ePRESENTACION.appendChild(eCOLP_2); //Agrego columna a la presentacion } cadena.append("]"); traza("### " + cadena.toString()); ePRESENTACION.setAttribute("bloquesid", cadena.toString()); Element eROWSET = document.createElement("ROWSET"); eLista.appendChild(eCABECERA); //Agrego la cabecera de la lista eLista.appendChild(ePRESENTACION); //Agrego la presentacion de la lista eLista.appendChild(eROWSET); //Agrego el rowset de la lista eCapa.appendChild(eLista); getXML().getElementsByTagName("FORMULARIO").item(0).appendChild(eCapa); } // Fin metodo private void cargarTipoSubtipo() throws Exception { DTOTipoSubtipo dto = (DTOTipoSubtipo) conectorParametroSesion("TIPOSUBTIPO"); DruidaConector conTipoSubtipo = null; Long idioma = UtilidadesSession.getIdioma( this ); if (dto == null) { DTOBelcorp dtoE = new DTOBelcorp(); dtoE.setOidIdioma(idioma); Vector paramEntrada = new Vector(); paramEntrada.add(dtoE); paramEntrada.add(new MareBusinessID("MAEObtenerTipoSubtipo")); conTipoSubtipo = conectar("ConectorTipoSubtipo", paramEntrada); dto = (DTOTipoSubtipo) conTipoSubtipo.objeto("DTOSalida"); //MareDTO dtoSalida = (DTOTipoSubtipo) conTipoSubtipo.objeto("DTOSalida"); //dto = (DTOTipoSubtipo) dtoSalida.getProperty("resultado"); //conectorParametroSesion("TIPOSUBTIPO", dto); } //Tipo conTipoSubtipo = generaConector(dto.getTipos(), "dtoSalida.tipos_ROWSET","OID_TIPO_CLIE", "VAL_I18N", null); //DES_MAE_TIPO_CLIEN asignar("COMBO", "cbTipoCliente", conTipoSubtipo, "dtoSalida.tipos_ROWSET"); //asignarAtributo("VAR", "hTipo", "valor", this.tipoCliente); //Subtipo conTipoSubtipo = generaConector(dto.getSubtipos(), "dtoSalida.subtipos_ROWSET", "OID_SUBT_CLIE", "TICL_OID_TIPO_CLIE", "VAL_I18N"); //"DES_MAE_TIPO_CLIEN", "DES_MAE_SUBTI_CLIEN" asignar("COMBO", "lstSubtipo", conTipoSubtipo, "dtoSalida.subtipos_ROWSET"); } private void cargarClasificaciones() throws Exception { traza("ENTRO A CARGAR CLASIFICACIONES......"); traza("paso 1"); DruidaConector conClasificacion = null; traza("paso 2"); Long idioma = UtilidadesSession.getIdioma( this ); traza("paso 3"); DTOBelcorp dtoE = new DTOBelcorp(); traza("paso 4"); dtoE.setOidIdioma(idioma); traza("paso 5"); Vector paramEntrada = new Vector(); traza("paso 6"); paramEntrada.add(dtoE); traza("paso 7"); paramEntrada.add(new MareBusinessID("MSGObtenerClasificacion")); traza("paso 8"); conClasificacion = conectar("ConectorObtenerModulos", paramEntrada); traza("paso 9"); //this.ratrearFuncion(); DTOClasificaciones dtoSalida = (DTOClasificaciones) conClasificacion.objeto("dtoSalidaObjeto"); traza("paso 10"); //dto = (DTOClasificaciones) dtoSalida.getProperty("resultado"); traza("paso 11"); //conectorParametroSesion("CLASIFICACION", dto); traza("paso 12"); traza("//Tipo Clasificacion"); //Tipo Clasificacion conClasificacion = generaConector(dtoSalida.getTipoClasificacion(),"dtoSalida.tipoclasificacion_ROWSET", "OID_TIPO_CLAS","SBTI_OID_SUBT_CLIE", "VAL_I18N"); //DES_MAE_TIPO_CLASI_CLIEN asignar("COMBO", "lstTipoClasificacion", conClasificacion,"dtoSalida.tipoclasificacion_ROWSET"); //asignarAtributo("VAR", "hTipoClasificacion", "valor", this.tipoClasificacion); traza("//Clasificacion"); conClasificacion = generaConector(dtoSalida.getClasificacion(),"dtoSalida.clasificacion_ROWSET", "OID_CLAS", "TCCL_OID_TIPO_CLAS", "VAL_I18N"); //"TCCL_OID_TIPO_CLAS", "DES_MAE_CLASI" asignar("COMBO", "lstClasificacion", conClasificacion, "dtoSalida.clasificacion_ROWSET"); //asignarAtributo("VAR", "hClasificacion", "valor", this.clasificacion); } private DruidaConector generaConector(RecordSet rs, String ID_Rows, String campoCod, String campoNom, String campoF) throws Exception { XMLDocument xmlDoc = new XMLDocument(); Document docDestino = xmlDoc.makeDocument("<ROWSET2/>"); Element e_rows = docDestino.createElement("ROWSET"); e_rows.setAttribute("ID", ID_Rows); docDestino.getDocumentElement().appendChild(e_rows); for (int i = 0; i < rs.getRowCount(); i++) { Element e_row = docDestino.createElement("ROW"); e_rows.appendChild(e_row); Element e_campo1 = docDestino.createElement("CAMPO"); e_campo1.setAttribute("NOMBRE", campoCod); e_campo1.setAttribute("TIPO", "OBJECTO"); e_campo1.setAttribute("LONGITUD", "50"); Text txtCod = docDestino.createTextNode(((rs.getValueAt(i, campoCod) == null) ? "" : rs.getValueAt(i, campoCod).toString())); e_campo1.appendChild(txtCod); e_row.appendChild(e_campo1); Element e_campo2 = docDestino.createElement("CAMPO"); e_campo2.setAttribute("NOMBRE", campoNom); e_campo2.setAttribute("TIPO", "OBJECTO"); e_campo2.setAttribute("LONGITUD", "50"); Text txtDesc = docDestino.createTextNode(((rs.getValueAt(i, campoNom) == null) ? "" : rs.getValueAt(i, campoNom).toString())); e_campo2.appendChild(txtDesc); e_row.appendChild(e_campo2); if (campoF != null) { Element e_campo3 = docDestino.createElement("CAMPO"); e_campo3.setAttribute("NOMBRE", campoF); e_campo3.setAttribute("TIPO", "OBJECTO"); e_campo3.setAttribute("LONGITUD", "50"); Text txtF = docDestino.createTextNode(((rs.getValueAt(i, campoF) == null) ? "" : rs.getValueAt(i, campoF).toString())); e_campo3.appendChild(txtF); e_row.appendChild(e_campo3); } } DruidaConector conect = new DruidaConector(); conect.setXML(docDestino.getDocumentElement()); return conect; } }
[ "hp.vega@hotmail.com" ]
hp.vega@hotmail.com
1fbee4f6ca85088d7a375908aa143c87288daf6b
90280edf98acbdb2bd8308f71538e254708426d8
/app/src/androidTest/java/digital/ryanbrown/costofliving/ApplicationTest.java
0c88adf7490f1e265ce2b6e2be0539c930144b6b
[]
no_license
freesimpleryan/fin-android
c7f4229ba7ece889c2c0742e9d091c6fa068775c
601e3a0dd51090bad20a4dffd0e24d032daa72c0
refs/heads/master
2021-01-10T11:43:51.075709
2015-10-08T01:04:37
2015-10-08T01:05:27
43,233,187
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package digital.ryanbrown.costofliving; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "ryan@freesimpleapps.com" ]
ryan@freesimpleapps.com
8eada0432739bb98489b0fee7277303100165c5d
05cad6b8a0b5342b9f3bda2873975b6cbc6c0a19
/monkeyzicloud-provider/monkeyzicloud-provider-ucloud/src/main/java/com/gaoyg/monkeyzicloud/provider/service/impl/UcloudRoleServiceImpl.java
dcb1b385882367013918efef32454fae86cdf326
[]
no_license
monkeyzi/monkeyzicloud
6421e48491d93362b10a117216b2e81de3bc1520
53883e12a21f7f691b9cfc395ca05bc9622e1329
refs/heads/master
2020-03-23T10:29:29.056516
2018-10-16T13:03:30
2018-10-16T13:03:30
141,445,966
1
0
null
null
null
null
UTF-8
Java
false
false
15,367
java
package com.gaoyg.monkeyzicloud.provider.service.impl; import com.gaoyg.monkeyzicloud.commom.core.support.BaseService; import com.gaoyg.monkeyzicloud.constant.GlobalConstant; import com.gaoyg.monkeyzicloud.dto.LoginAuthDto; import com.gaoyg.monkeyzicloud.enums.ErrorCodeEnum; import com.gaoyg.monkeyzicloud.provider.exception.UcloudBizException; import com.gaoyg.monkeyzicloud.provider.mapper.UcloudRoleMapper; import com.gaoyg.monkeyzicloud.provider.model.domain.*; import com.gaoyg.monkeyzicloud.provider.model.dto.UserRole.BindUserDto; import com.gaoyg.monkeyzicloud.provider.model.dto.UserRole.RoleBindUserDto; import com.gaoyg.monkeyzicloud.provider.model.dto.role.RoleBindActionDto; import com.gaoyg.monkeyzicloud.provider.model.dto.role.RoleBindMenuDto; import com.gaoyg.monkeyzicloud.provider.model.dto.role.RoleBindUserReqDto; import com.gaoyg.monkeyzicloud.provider.model.vo.RoleVo; import com.gaoyg.monkeyzicloud.provider.model.vo.role.BindAuthVo; import com.gaoyg.monkeyzicloud.provider.service.*; import com.gaoyg.monkeyzicloud.provider.utils.TreeUtil; import com.gaoyg.monkeyzicloud.provider.vo.MenuVo; import com.gaoyg.monkeyzicloud.util.pubutils.PublicUtil; import com.gaoyg.monkeyzicloud.util.util.Collections3; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Objects; import java.util.Set; /** * @author: 高yg * @date: 2018/8/21 21:12 * @qq:854152531@qq.com * @blog http://www.monkeyzi.xin * @description: */ @Service @Transactional(rollbackFor = Exception.class) @Slf4j public class UcloudRoleServiceImpl extends BaseService<UcloudRole> implements UcloudRoleService { @Autowired private UcloudRoleMapper ucloudRoleMapper; @Autowired private UcloudRoleUserService ucloudRoleUserService; @Autowired private UcloudRoleMenuService ucloudRoleMenuService; @Autowired private UcloudRoleActionService ucloudRoleActionService; @Autowired private UcloudMenuService ucloudMenuService; @Autowired private UcloudActionService ucloudActionService; @Autowired private UcloudUserService ucloudUserService; @Override @Transactional(readOnly = true,rollbackFor = Exception.class) public List<RoleVo> queryRoleListWithPage(UcloudRole role) { return ucloudRoleMapper.queryRoleListWithPage(role); } @Override public int deleteRoleById(Long id) { if (null==id){ throw new IllegalArgumentException(ErrorCodeEnum.UCLOUD10012001.getMsg()); } //超级管理员不能删除 if (Objects.equals(id,GlobalConstant.Sys.SUER_MANAGE_ROLE_ID)){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012003); } //查询该角色有没有绑定用户 List<UcloudRoleUser> listRoleUser=ucloudRoleUserService.selectRoleUserList(id); if (!listRoleUser.isEmpty()){ //删除角色用户关联表 ucloudRoleUserService.deleteByRoleId(id); } //删除角色权限表 ucloudRoleActionService.deleteByRoleId(id); //删除角色菜单表 ucloudRoleMenuService.deleteByRoleId(id); //删除角色表 return ucloudRoleMapper.deleteByPrimaryKey(id); } @Override public void batchDeleteByIdList(List<Long> idList) { log.info("批量删除角色 idList={}",idList); Preconditions.checkArgument(PublicUtil.isNotEmpty(idList),"角色id不能为空"); List<UcloudRoleUser> roleUserList=ucloudRoleUserService.selectByRoleIdList(idList); if (!roleUserList.isEmpty()){ //删除角色用户关联 ucloudRoleUserService.deleteByRoleIdList(idList); } //删除角色权限关联表 ucloudRoleActionService.deleteByRoleIdList(idList); //删除角色菜单关联表 ucloudRoleMenuService.deleteByRoleIdList(idList); //删除角色表 int result=ucloudRoleMapper.batchDeleteByIdList(idList); if (result<idList.size()){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012006, Joiner.on(GlobalConstant.Symbol.COMMA).join(idList)); } } @Override public int saveRole(UcloudRole role, LoginAuthDto loginAuthDto) { int result = 0; role.setUpdateInfo(loginAuthDto); if (role.isNew()) { ucloudRoleMapper.insertSelective(role); } else { result = ucloudRoleMapper.updateByPrimaryKeySelective(role); } return result; } @Override @Transactional(readOnly = true,rollbackFor = Exception.class) public UcloudRole getRoleById(Long roleId) { return ucloudRoleMapper.selectByPrimaryKey(roleId); } @Override @Transactional(readOnly = true,rollbackFor = Exception.class) public BindAuthVo getActionTreeByRoleId(Long roleId) { BindAuthVo bindAuthVo=new BindAuthVo(); Preconditions.checkArgument(roleId!=null,ErrorCodeEnum.UCLOUD10012010.getMsg()); UcloudRole ucloudRole=this.getRoleById(roleId); if (ucloudRole==null){ log.error("找不到角色信息 roleId={}", roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011); } List<UcloudMenu> menuList=ucloudMenuService.listMenuListByRoleId(roleId); if (PublicUtil.isEmpty(menuList)) { throw new UcloudBizException(ErrorCodeEnum.UCLOUD10013009); } //查询所有的权限信息 List<UcloudAction> actionList=ucloudActionService.listActionList(menuList); // 合并菜单和按钮权限 递归生成树结构 List<MenuVo> menuVoList=this.getAuthList(menuList,actionList); List<MenuVo> tree = TreeUtil.getChildMenuVos(menuVoList, 0L); //获取所有已经绑定的菜单和权限Id集合 List<Long> authActionList=ucloudActionService.getCheckedActionList(roleId); bindAuthVo.setAuthTree(tree); bindAuthVo.setCheckedAuthList(authActionList); return bindAuthVo; } @Override @Transactional(readOnly = true,rollbackFor = Exception.class) public BindAuthVo getMenuTreeByRoleId(Long roleId) { BindAuthVo bindAuthVo=new BindAuthVo(); Preconditions.checkArgument(roleId!=null,ErrorCodeEnum.UCLOUD10012010.getMsg()); UcloudRole ucloudRole=this.getRoleById(roleId); if (ucloudRole==null){ log.error("找不到角色信息 roleId={}", roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011); } //查询所有的菜单 List<UcloudMenu> allMenuList=ucloudMenuService.selectAll(); // 合并菜单和按钮权限 递归生成树结构 List<MenuVo> menuVoList = this.getAuthList(allMenuList, null); List<MenuVo> tree = TreeUtil.getChildMenuVos(menuVoList, 0L); //查询已经绑定的菜单信息 List<Long> authMenuList=ucloudActionService.getCheckedMenuList(roleId); bindAuthVo.setCheckedAuthList(authMenuList); bindAuthVo.setAuthTree(tree); return bindAuthVo; } @Override public void bindUserRole(RoleBindUserReqDto roleBindUserReqDto, LoginAuthDto loginAuthDto) { if (roleBindUserReqDto == null) { log.error("参数不能为空"); throw new IllegalArgumentException("参数不能为空"); } Long roleId = roleBindUserReqDto.getRoleId(); Long loginUserId = loginAuthDto.getUserId(); List<Long> userIdList = roleBindUserReqDto.getUserIdList(); if (null==roleId){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012001); } UcloudRole role=this.getRoleById(roleId); if (role == null) { log.error("找不到角色信息 roleId={}", roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011, roleId); } if (PublicUtil.isNotEmpty(userIdList)&&userIdList.contains(loginUserId)){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10011023); } //查询超级管理员用户Id集合 List<Long> superUserList=ucloudRoleUserService.listSuperUser(GlobalConstant.Sys.SUER_MANAGE_ROLE_ID); //交集 List<Long> unionList = Collections3.intersection(userIdList, superUserList); if (PublicUtil.isNotEmpty(userIdList) && PublicUtil.isNotEmpty(unionList)) { log.error("不能操作超级管理员用户 超级用户={}", unionList); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10011023); } //先取消对该角色的用户绑定,(不包含超级管理员) List<UcloudRoleUser> userRoles = ucloudRoleUserService.listByRoleId(roleId); if (PublicUtil.isNotEmpty(userRoles)){ ucloudRoleUserService.deleteExcludeSuperMng(roleId,GlobalConstant.Sys.SUER_MANAGE_ROLE_ID); } if (PublicUtil.isEmpty(userIdList)) { // 取消该角色的所有用户的绑定 log.info("取消绑定所有非超级管理员用户成功"); return; } userIdList.stream().forEach(a->{ //先通过用户的Id查询用户 UcloudUser ucloudUser=ucloudUserService.queryUserById(a); if (PublicUtil.isEmpty(ucloudUser)) { log.error("找不到绑定的用户 userId={}", a); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10011024, a); } //添加关系 ucloudRoleUserService.saveRoleUser(a,roleId); }); } @Override @Transactional(readOnly = true, rollbackFor = Exception.class) public RoleBindUserDto getRoleBindUserDto(Long roleId, Long currentUserId) { RoleBindUserDto roleBindUserDto = new RoleBindUserDto(); Set<Long> alreadyBindUserIdSet = Sets.newHashSet(); UcloudRole ucloudRole = ucloudRoleMapper.selectByPrimaryKey(roleId); if (PublicUtil.isEmpty(ucloudRole)){ log.error("找不到角色 roleId={}",roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011,roleId); } //查询所有用户包含已经禁用的用户 List<BindUserDto> allNeedBindUser=ucloudRoleMapper.selectAllNeedBindUser(GlobalConstant.Sys.SUER_MANAGE_ROLE_ID, currentUserId); // 该角色已经绑定的用户 List<UcloudRoleUser> setAlreadyBindUserSet = ucloudRoleUserService.listByRoleId(roleId); Set<BindUserDto> bindUserDtoSet=Sets.newHashSet(allNeedBindUser); setAlreadyBindUserSet.stream().forEach(a->{ alreadyBindUserIdSet.add(a.getUserId()); }); roleBindUserDto.setAllUserSet(bindUserDtoSet); roleBindUserDto.setAlreadyBindUserIdSet(alreadyBindUserIdSet); return roleBindUserDto; } @Override public void bindAction(RoleBindActionDto grantAuthRole) { Long roleId = grantAuthRole.getRoleId(); Set<Long> actionIdList = grantAuthRole.getActionIdList(); if (roleId == null) { throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012001); } if (Objects.equals(roleId, GlobalConstant.Sys.SUER_MANAGE_ROLE_ID)) { log.error("越权操作, 超级管理员用户不允许操作"); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10011023); } //查询角色信息 UcloudRole uacRole = ucloudRoleMapper.selectByPrimaryKey(roleId); if (uacRole == null) { log.error("找不到角色信息. roleId={}", roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011, roleId); } //校验权限是否存在 actionIdList.stream().forEach(a->{ UcloudAction action=ucloudActionService.selectByKey(a); if (action==null){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10015001,a); } }); List<UcloudRoleAction> ucloudRoleActionList = ucloudRoleActionService.listByRoleId(roleId); //先删除 if (PublicUtil.isNotEmpty(ucloudRoleActionList)) { ucloudRoleActionService.deleteByRoleId(roleId); } if (PublicUtil.isEmpty(actionIdList)) { log.error("传入按钮权限Id为空, 取消所有按钮权限"); } else { // 绑定权限 ucloudRoleActionService.insert(roleId, actionIdList); } } @Override public void bindMenu(RoleBindMenuDto roleBindMenuDto) { Long roleId = roleBindMenuDto.getRoleId(); Set<Long> menuIdList = roleBindMenuDto.getMenuIdList(); if (roleId == null) { throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012001); } if (Objects.equals(roleId, GlobalConstant.Sys.SUER_MANAGE_ROLE_ID)) { log.error("越权操作, 超级管理员用户不允许操作"); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10011023); } UcloudRole uacRole = ucloudRoleMapper.selectByPrimaryKey(roleId); if (uacRole == null) { log.error("找不到角色信息. roleId={}", roleId); throw new UcloudBizException(ErrorCodeEnum.UCLOUD10012011, roleId); } // 校验菜单是否存在 menuIdList.stream().forEach(a->{ UcloudMenu menu=ucloudMenuService.selectByKey(a); if (menu==null){ throw new UcloudBizException(ErrorCodeEnum.UCLOUD10014002,a); } }); List<UcloudRoleMenu> uacRoleMenuList = ucloudRoleMenuService.listByRoleId(roleId); if (PublicUtil.isNotEmpty(uacRoleMenuList)) { ucloudRoleMenuService.deleteByRoleId(roleId); } // 如果为空则 取消该角色所有权限 if (PublicUtil.isEmpty(menuIdList)) { log.error("传入菜单权限Id为空, 取消菜单权限"); } else { // 绑定菜单 ucloudRoleMenuService.insert(roleId, menuIdList); } } private List<MenuVo> getAuthList(List<UcloudMenu> menuList, List<UcloudAction> actionList) { List<MenuVo> menuVoList= Lists.newArrayList(); MenuVo menuVo; for (UcloudMenu vo:menuList){ menuVo=new MenuVo(); BeanUtils.copyProperties(vo,menuVo); menuVo.setRemark("menu"); menuVoList.add(menuVo); } if (PublicUtil.isNotEmpty(actionList)){ for (UcloudAction ucloudAction : actionList) { menuVo = new MenuVo(); menuVo.setId(ucloudAction.getId()); menuVo.setMenuName(ucloudAction.getActionName()); menuVo.setMenuCode(ucloudAction.getActionCode()); menuVo.setPid(ucloudAction.getMenuId()); menuVo.setUrl(ucloudAction.getUrl()); menuVo.setRemark("action"); menuVoList.add(menuVo); } } return menuVoList; } }
[ "854152531@qq.com" ]
854152531@qq.com
ec38074141f1cd6feaa5ff98dd5bec5a1c246ede
1ea323b73bc53ce1c2cbf6a47a5d05969970eee2
/src/main/java/org/superbiz/moviefun/rest/MoviesResource.java
72c935fb2037320a5480c1a2da9b62bb73ce5fcc
[ "Apache-2.0" ]
permissive
tomitribe/oauth2-jwt-custom-claims
6713df6eb0771efb484b858583df9c37a95ce6da
03f5df60139ba795c9fb762605f9d08687466380
refs/heads/master
2020-03-21T12:47:03.873155
2018-07-04T16:14:17
2018-07-04T16:14:17
138,571,768
1
2
Apache-2.0
2018-07-04T16:14:18
2018-06-25T09:19:54
JavaScript
UTF-8
Java
false
false
3,495
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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.superbiz.moviefun.rest; import org.superbiz.moviefun.Comment; import org.superbiz.moviefun.Movie; import org.superbiz.moviefun.MoviesBean; import javax.annotation.security.RolesAllowed; import javax.ejb.EJB; import javax.enterprise.context.ApplicationScoped; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.SecurityContext; import java.util.Date; import java.util.List; import java.util.logging.Logger; @Path("movies") @Produces({"application/json"}) @ApplicationScoped public class MoviesResource { private static final Logger LOGGER = Logger.getLogger(MoviesResource.class.getName()); @EJB private MoviesBean service; @Context private SecurityContext securityContext; @GET @Path("{id}") public Movie find(@PathParam("id") Long id) { return service.find(id); } @GET public List<Movie> getMovies(@QueryParam("first") Integer first, @QueryParam("max") Integer max, @QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) { return service.getMovies(first, max, field, searchTerm); } @POST @Consumes("application/json") public Movie addMovie(Movie movie) { service.addMovie(movie); return movie; } @POST @Path("{id}/comment") @Consumes("text/plain") public Movie addCommentToMovie( @PathParam("id") final long id, final String comment) { final Comment c = new Comment(); c.setAuthor("From JWT with Mircoprofile JWT extension for instance"); c.setComment(comment); c.setEmail("From JWT with Mircoprofile JWT extension for instance"); c.setTimestamp(new Date()); return service.addCommentToMovie(id, c); } @PUT @Path("{id}") @Consumes("application/json") @RolesAllowed("update") public Movie editMovie( @PathParam("id") final long id, Movie movie) { service.editMovie(movie); return movie; } @DELETE @Path("{id}") @RolesAllowed("delete") public void deleteMovie(@PathParam("id") long id) { service.deleteMovie(id); } @GET @Path("count") @Produces(MediaType.TEXT_PLAIN) public int count(@QueryParam("field") String field, @QueryParam("searchTerm") String searchTerm) { return service.count(field, searchTerm); } }
[ "jeanouii@gmail.com" ]
jeanouii@gmail.com
ce8db071091f5f7bac69a313827528143aae0af0
5f709f94c729744b72b2db34ca237e491d46f4aa
/ShapesScreenSaver/src/main/se450/model/Circle.java
55b17896aaae9b07753eb873c5f5c5e652237478
[]
no_license
djpara/ShapesScreenSaver
65ef8ae4ff1ae636b8c1e5004118d9cb5a44889d
518cb6f8186d9cbad3f2c5dae06e7c3cff49cc00
refs/heads/master
2021-01-12T01:29:18.437004
2017-01-09T03:55:16
2017-01-09T03:55:16
78,391,471
3
0
null
null
null
null
UTF-8
Java
false
false
1,026
java
package main.se450.model; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; import main.se450.interfaces.IStrategy; public class Circle extends Shape { //Read only pattern public Circle(float nLeft, float nTop, float nRight, float nBottom, float nX, float nY, float nRotation, int nColor, IStrategy iStrategy) { super(nLeft, nTop, nRight, nBottom, nX, nY, nRotation, nColor, iStrategy); } @Override public void draw(Graphics graphics) { Ellipse2D circle = new Ellipse2D.Float(getLeft(), getTop(), getWidth(), getHeight()); Graphics2D g2d = (Graphics2D)(graphics); g2d.setColor(new Color(getColor())); g2d.draw(circle); } public float getRadius() { return ((getLeft() + getRight()) / 2) - getLeft(); } public final Point2D.Float getCenter() { return new Point2D.Float((getLeft() + getRight()) / 2.0f, (getTop() + getBottom()) / 2.0f); } }
[ "davidjpara@gmail.com" ]
davidjpara@gmail.com
72bd892f1161969e9a0d1245f4cc35e2915fe9d6
7af1d44877b3ed8a03cacd8bf7b7fa023a2c6161
/diozero-sampleapps/src/main/java/com/diozero/sampleapps/sandpit/Max30102Test.java
f9cc64fb1066677090d44df6ea9cd1c2cecf0e62
[ "MIT" ]
permissive
mattjlewis/diozero
efe8192c1d7ea7a1478f00202be4936106e737f2
bf38ccc922951c6172e72212a5315237b9c96ee8
refs/heads/main
2023-09-03T10:21:18.871174
2023-08-18T07:43:08
2023-08-18T07:43:08
50,951,613
264
74
MIT
2023-08-21T16:12:39
2016-02-02T21:01:19
Java
UTF-8
Java
false
false
2,925
java
package com.diozero.sampleapps.sandpit; /*- * #%L * Organisation: diozero * Project: diozero - Sample applications * Filename: Max30102Test.java * * This file is part of the diozero project. More information about this project * can be found at https://www.diozero.com/. * %% * Copyright (C) 2016 - 2023 diozero * %% * 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. * #L% */ import java.util.concurrent.BlockingQueue; import org.tinylog.Logger; import com.diozero.devices.sandpit.Max30102; import com.diozero.devices.sandpit.Max30102.LedPulseWidth; import com.diozero.devices.sandpit.Max30102.Mode; import com.diozero.devices.sandpit.Max30102.Sample; import com.diozero.devices.sandpit.Max30102.SampleAveraging; import com.diozero.devices.sandpit.Max30102.SpO2AdcRange; import com.diozero.devices.sandpit.Max30102.SpO2SampleRate; import com.diozero.util.Diozero; public class Max30102Test { public static void main(String[] args) { // Run for 10s int duration_ms = 30_000; SpO2SampleRate spo2_sample_rate = SpO2SampleRate._100; try (Max30102 max = new Max30102(1)) { Diozero.registerForShutdown(max); max.setup(SampleAveraging._4, false, 15, Mode.SPO2, SpO2AdcRange._4096, spo2_sample_rate, LedPulseWidth._411, 7.1f, 7.1f); BlockingQueue<Sample> sample_queue = max.getSampleQueue(); Logger.info("Collecting samples for {#,###} ms", Integer.valueOf(duration_ms)); max.start(); Thread.sleep(duration_ms); max.stop(); Logger.info("Samples:"); sample_queue.forEach(Max30102Test::printSample); } catch (InterruptedException e) { Logger.error(e, "Error: {}", e); } finally { Diozero.shutdown(); } } private static void printSample(Sample sample) { if (sample.getSpo2() == -1) { System.out.println(sample.getHeartRate()); } else { System.out.println(sample.getHeartRate() + ", " + sample.getSpo2()); } } }
[ "deviceiozero@gmail.com" ]
deviceiozero@gmail.com
40a8455b75fe886ab7779da9e0d27c6dfbe77110
75e4984760b1c63a2ae9f459709c11579a610e25
/PROG/ProgramacionArrays/src/Ejercicio2Arrays.java
3d5de57cc676d19428f003c9d6768bfd645ce2c2
[]
no_license
vcasas00/1-DAM
ab34c9cf5a598d70a961fd0b6aeadb9601e0ecf3
c4f0d7fdb74daa17baf9e5640ff5c40378128916
refs/heads/master
2023-04-23T20:12:42.409049
2021-05-10T07:13:09
2021-05-10T07:13:09
321,593,268
1
0
null
null
null
null
WINDOWS-1250
Java
false
false
976
java
/** * */ import java.util.Scanner; /** * @author Vicent Casasús * */ public class Ejercicio2Arrays { /** * @param args //PROGRAMA QUE SACA LA MEDIA DE 10 NUMEROS PARES O IMPARES// */ public static void main(String[] args) { Scanner teclado = new Scanner (System.in); //INICIAMOS VARIABLES int [] notas = new int [12]; int i; int median = 0; int cont1 = 1; int res = 0; int mayor = 0; //For para guardar 1 a 1 los numeros dentro del ARRAY for( i = 0; i<notas.length; i++) { System.out.println("Alumno " + (i + 1) + ": "); notas[i] = teclado.nextInt(); if (notas[i] > 0) { res = notas[i] + res; median = res / cont1; cont1= cont1 + 1; } }System.out.println("Media de las notas es: " + median); System.out.println("Los alumnos por encima de la media son: "); for(i = 0; i<notas.length; i++){ if (notas[i] > median) System.out.println(" Alumno " + (i + 1) + ": "+ "Nota =" + " " + notas[i]); } } }
[ "vifuentet@gmail.com" ]
vifuentet@gmail.com