blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
b9e05522be2105dce96a0e7eb4d26e1667e1f123
bec201d85db44a7b56414e4be5c0e6bc241d5a7f
/main/daos/EntityDaoImpl.java
8210318309b1899104e853b09da49f9339e029ec
[]
no_license
dafemart/SQLBANKINGAPP
adaf632af51b931057a27fbe63a961ca744cc719
1e4eb62d637278767d46f586bd835830bebaf395
refs/heads/master
2021-09-09T08:58:31.519464
2018-03-14T13:16:12
2018-03-14T13:16:12
124,951,176
0
0
null
null
null
null
UTF-8
Java
false
false
3,987
java
package daos; import java.beans.Statement; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import com.revature.util.ConnectionFactory; import entityInfo.BankAdminInfo; import entityInfo.CustomerInfo; import entityInfo.EmployeeInfo; import entityInfo.EntityInfo; public class EntityDaoImpl<T> implements EntityDao<T> { @Override public void createEntity(T info) { Connection conn = ConnectionFactory.getInstance().getConnection(); String WhatTable = null; if(info.getClass() == CustomerInfo.class) WhatTable = "INSERTCUSTOMER"; else if(info.getClass() == EmployeeInfo.class) WhatTable = "INSERTEMPLOYEE"; else if(info.getClass() == BankAdminInfo.class) WhatTable = "INSERTBANKADMIN"; try{ CallableStatement cStmt = conn.prepareCall("{call "+WhatTable+"(?,?,?)}"); cStmt.setString(1, ((EntityInfo) info).getName()); cStmt.setString(2, ((EntityInfo) info).getUsername()); cStmt.setString(3, ((EntityInfo) info).getPassword()); cStmt.execute(); conn.close(); } catch(SQLException e){ e.printStackTrace(); } } @Override public T retrieveEntityByUsername(String username, String EntityType) { EntityInfo Entity = null; String table = null; switch(EntityType){ case "CUSTOMER": table = "CUSTOMERS"; Entity = new CustomerInfo("null","null","null",0); break; case "EMPLOYEE": table = "EMPLOYEES"; Entity = new EmployeeInfo("null","null", "null",0); break; case "BANKADMIN": table = "BANKADMINS"; Entity = new BankAdminInfo("null","null","null",0); break; default: table = "UNKNOWN"; break; } if(table == "UNKNOWN") return (T) Entity; String sql = "SELECT * FROM " + table + " WHERE USERNAME = ?"; try{ Connection conn = ConnectionFactory.getInstance().getConnection(); PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1, username); ResultSet rs = ps.executeQuery(); while(rs.next()){ Entity.setName(rs.getString(1)); Entity.setUsername(rs.getString(2)); Entity.setPassword(rs.getString(3)); Entity.setBankID(rs.getInt(4)); } conn.close(); } catch(SQLException e){ e.printStackTrace(); } return (T) Entity; } @Override public ArrayList<T> retrieveAllEntities(String EntityType) { Connection conn = ConnectionFactory.getInstance().getConnection(); ArrayList<T> Entities = new ArrayList<T>(); String table = null; switch(EntityType){ case "CUSTOMER": table = "CUSTOMERS"; break; case "EMPLOYEE": table = "EMPLOYEES"; break; case "BANKADMIN": table = "BANKADMINS"; break; default: table = "UNKNOWN"; break; } if(table == "UNKNOWN"){ System.out.println("unknown entity type"); return Entities; } String sql = "SELECT * FROM " + table + ";"; try{ PreparedStatement ps = conn.prepareStatement(sql); ResultSet rs = ps.executeQuery(); while(rs.next()){ switch(EntityType){ case "CUSTOMER": CustomerInfo customer = new CustomerInfo(rs.getString(1), rs.getString(2), rs.getString(3), rs.getInt(4)); Entities.add((T) customer); break; case "EMPLOYEE": EmployeeInfo employee = new EmployeeInfo(rs.getString(1), rs.getString(2), rs.getString(3), rs.getInt(4)); Entities.add((T)employee); table = "EMPLOYEES"; break; case "BANKADMIN": BankAdminInfo BankAdmin = new BankAdminInfo(rs.getString(1), rs.getString(2), rs.getString(3), rs.getInt(4)); Entities.add((T)BankAdmin); table = "BANKADMINS"; break; default: table = "UNKNOWN"; break; } } } catch(SQLException e){ e.printStackTrace(); } return Entities; } }
[ "dafemart@ucsc.edu" ]
dafemart@ucsc.edu
22bc4a35c8ee7a2af869f8286ae1220bda40eaed
6abc8d4e44a644047986d0ce872ec30c2eb8326f
/MyAutoConfig2/src/main/java/com/spring/boot/AutoApp.java
6d0f890ca365e713ad5ba3de1e5c60a324c3051d
[]
no_license
hyoGirl/MySpringBoot
133d0fd558cf49764390a7ced92789987749ce33
a082a00d23d154403171991f384026e2ccdee203
refs/heads/master
2022-10-19T10:01:54.088807
2020-07-04T05:53:35
2020-07-04T05:53:35
132,216,894
0
0
null
2022-10-12T19:51:48
2018-05-05T05:10:44
JavaScript
UTF-8
Java
false
false
992
java
package com.spring.boot; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author ashura1110 * @ClassName XULEI * @description TODO * @Date 2019/7/22 22:44 * @Version 1.0 */ @SpringBootApplication @RestController public class AutoApp { @Value("${some.key:true}") private boolean flag; @Autowired private Hello hello; @RequestMapping("/") public String index() { System.out.println("------------>"+flag); return hello.sayHello(); } // 原文:https://blog.csdn.net/zxc123e/article/details/80222967 public static void main(String[] args) { SpringApplication.run(AutoApp.class,args); } }
[ "xulei912@163.com" ]
xulei912@163.com
79834f221e5920c6c6a66e8d35dde92ac7653559
7ca8ffcdfb39ab4ffc2d8ff291e46ffabc8db6a2
/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/converter/ConversionException.java
bb228596b70c861b6adbe6f4d69d57ba0aab2e64
[ "CC-PDDC", "CC0-1.0", "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-only", "LicenseRef-scancode-other-permissive", "CDDL-1.0", "GCC-exception-3.1", "MIT", "EPL-1.0", "Classpath-exception-2.0", "BSD-3-Clause", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-pu...
permissive
apache/hadoop
ea2a4a370dd00d4a3806dd38df5b3cf6fd5b2c64
42b4525f75b828bf58170187f030b08622e238ab
refs/heads/trunk
2023-08-18T07:29:26.346912
2023-08-17T16:56:34
2023-08-17T16:56:34
23,418,517
16,088
10,600
Apache-2.0
2023-09-14T16:59:38
2014-08-28T07:00:08
Java
UTF-8
Java
false
false
1,313
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.yarn.server.resourcemanager.scheduler.fair.converter; /** * Thrown when the FS-to-CS converter logic encounters a * condition from which it cannot recover (eg. unsupported * settings). * */ public class ConversionException extends RuntimeException { private static final long serialVersionUID = 4161836727287317835L; public ConversionException(String message) { super(message); } public ConversionException(String message, Throwable cause) { super(message, cause); } }
[ "snemeth@apache.org" ]
snemeth@apache.org
8be6199876441b2826d2366e10432a732d6adf2f
73d7b546c655c3258dbd356a90f5ca216364b93e
/android/app/src/main/java/in/oceanacademy/phone_authentication/MainActivity.java
b2f33080a39b39834b187ca19fbd074670fee818
[]
no_license
OceanAcadamy/phone_authentication
639bd4de191549938fc3138197030c58d063acbb
7d870b8fd2d413209f5cb44d440cbe4d834c7eba
refs/heads/master
2023-01-28T19:14:44.520611
2020-12-08T05:50:47
2020-12-08T05:50:47
319,539,869
0
0
null
null
null
null
UTF-8
Java
false
false
155
java
package in.oceanacademy.phone_authentication; import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { }
[ "oceandocuments@gmail.com" ]
oceandocuments@gmail.com
27aab29614fb44dfdfe37e760ab2078663d252c0
381467dfd716305d4332394a1780e7cf3caf89d4
/src/main/java/com/myblog/blog/po/Type.java
fb4e1aab9cc81c9079df5ba223d928dd2825d0a7
[]
no_license
zhaohaihang/MyBlog
63dfb189032379f5276a14bb82925925f5e1c547
603dc98ad6668a45027b6115fb72f2db3ade885d
refs/heads/master
2021-03-07T18:49:47.374872
2020-03-22T13:18:11
2020-03-22T13:18:11
246,288,962
0
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
package com.myblog.blog.po; import javax.persistence.*; import javax.validation.constraints.NotBlank; import java.util.ArrayList; import java.util.List; @Entity @Table(name="t_type") public class Type { @Id @GeneratedValue private Long id; @NotBlank(message = "分类名称不能为空") private String name; //数据库关系 @OneToMany(mappedBy = "type") private List<Blog> blogs=new ArrayList<>(); public Type() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Blog> getBlogs() { return blogs; } public void setBlogs(List<Blog> blogs) { this.blogs = blogs; } @Override public String toString() { return "Type{" + "id=" + id + ", name='" + name + '\'' + '}'; } }
[ "1932859223@qq.com" ]
1932859223@qq.com
f162249efba92a189274eab2bae920599c29e589
be296aa5877f7c0b621b248a913c84d670607ae0
/PredictiveMonitorAnalytics/src/org/processmining/plugins/predictive_monitor/bpm/configuration/modules/Run.java
458d5970ecbc762f785df869c36f65654df7feb6
[]
no_license
PDI-FBK/Predictive-Process-Monitoring
54b1ff910a6bdce708a89607952f1361fd75d842
44834145dbf8b53d0b30c83db69e4207f1ffd797
refs/heads/master
2021-09-07T16:49:33.386620
2017-10-15T22:40:09
2017-10-15T22:40:09
105,550,956
2
0
null
null
null
null
UTF-8
Java
false
false
163
java
package org.processmining.plugins.predictive_monitor.bpm.configuration.modules; public class Run { public Run() { // TODO Auto-generated constructor stub } }
[ "dfmchiara@fbk.eu" ]
dfmchiara@fbk.eu
dc6b316a1f4613f50bb0f1ab806b41bd083a3175
bc236c9d969783e62692d92cf37d3adf5698fe5f
/src/main/java/net/snowflake/client/core/DataConversionContext.java
21acda3923b9173297c7e35ab4972924350cbb46
[ "Apache-2.0" ]
permissive
binglihub/snowflake-jdbc
13a5d33f11bb837975b3b4c692ccb3df7d05cdc9
7ce958ac4f0194b0a3b34ac094d681f94a768ab4
refs/heads/master
2022-01-07T17:35:43.810162
2019-06-21T05:40:05
2019-06-21T21:25:21
125,897,156
0
0
Apache-2.0
2018-03-19T17:41:41
2018-03-19T17:41:40
null
UTF-8
Java
false
false
2,209
java
/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ package net.snowflake.client.core; import net.snowflake.common.core.SFBinaryFormat; import net.snowflake.common.core.SnowflakeDateTimeFormat; /** * This class contains formatter info about each data type and related flags * etc. And it is scoped to a single result set. a.k.a each result set object * should have its own formatter info */ public class DataConversionContext { /** * timestamp_ltz formatter */ final private SnowflakeDateTimeFormat timestampLTZFormatter; /** * timestamp_ntz formatter */ final private SnowflakeDateTimeFormat timestampNTZFormatter; /** * timestamp_tz formatter */ final private SnowflakeDateTimeFormat timestampTZFormatter; /** * date formatter */ final private SnowflakeDateTimeFormat dateFormatter; /** * time formatter */ final private SnowflakeDateTimeFormat timeFormatter; /** * binary formatter */ private SFBinaryFormat binaryFormatter; public DataConversionContext( SnowflakeDateTimeFormat timestampLTZFormatter, SnowflakeDateTimeFormat timestampNTZFormatter, SnowflakeDateTimeFormat timestampTZFormatter, SnowflakeDateTimeFormat dateFormatter, SnowflakeDateTimeFormat timeFormatter, SFBinaryFormat binaryFormatter) { this.timestampLTZFormatter = timestampLTZFormatter; this.timestampNTZFormatter = timestampNTZFormatter; this.timestampTZFormatter = timestampTZFormatter; this.dateFormatter = dateFormatter; this.timeFormatter = timeFormatter; this.binaryFormatter = binaryFormatter; } public SnowflakeDateTimeFormat getTimestampLTZFormatter() { return timestampLTZFormatter; } public SnowflakeDateTimeFormat getTimestampNTZFormatter() { return timestampNTZFormatter; } public SnowflakeDateTimeFormat getTimestampTZFormatter() { return timestampTZFormatter; } public SnowflakeDateTimeFormat getDateFormatter() { return dateFormatter; } public SnowflakeDateTimeFormat getTimeFormatter() { return timeFormatter; } public SFBinaryFormat getBinaryFormatter() { return binaryFormatter; } }
[ "41644644+ankit-bhatnagar167@users.noreply.github.com" ]
41644644+ankit-bhatnagar167@users.noreply.github.com
53a9bc8537d6e79bca4321d8b2a252edb3c3fad1
32ada64601dca2faf2ad0dae2dd5a080fd9ecc04
/timesheet/src/main/java/com/fastcode/timesheet/application/core/authorization/users/dto/UpdateUsersOutput.java
47d5ec19f8bc76ea7111973c5da432fef7253dec
[]
no_license
fastcoderepos/tbuchner-sampleApplication1
d61cb323aeafd65e3cfc310c88fc371e2344847d
0880d4ef63b6aeece6f4a715e24bfa94de178664
refs/heads/master
2023-07-09T02:59:47.254443
2021-08-11T16:48:27
2021-08-11T16:48:27
395,057,379
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package com.fastcode.timesheet.application.core.authorization.users.dto; import java.time.*; import lombok.Getter; import lombok.Setter; @Getter @Setter public class UpdateUsersOutput { private String emailaddress; private String firstname; private Long id; private Boolean isactive; private LocalDate joinDate; private String lastname; private String triggerGroup; private String triggerName; private String username; }
[ "info@nfinityllc.com" ]
info@nfinityllc.com
a38108d8c15567c06377bd96bedc7c1b4f093e2a
dc5941e5530e026c1b030a2c617ae9e25d6e37b5
/sms1/src/main/java/service/EssayService.java
12e72c48db29daad71f19153c39f1d47730aa710
[]
no_license
monmango/spring
c5404f8d278df415fbe481a8c2435720e924a323
fba11bd4f0ab8563ac3b0ed0ee2a9caa15d5e6f3
refs/heads/master
2022-12-23T00:28:29.234324
2019-10-10T02:05:40
2019-10-10T02:05:40
203,337,227
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package service; import java.util.List; import dto.EssayDTO; import dto.PageDTO; public interface EssayService { public int countProcess(); public List<EssayDTO> essayListProcess(PageDTO pv); public EssayDTO essayViewProcess(int essay_num); public void essayInsertProcess(EssayDTO dto); public EssayDTO essayUpViewProcess(int essay_num); public void essayUpdateProcess(EssayDTO dto); public void essayDeleteProcess(int essay_num); }// end interface
[ "orion3734@gmail.com" ]
orion3734@gmail.com
63f57b1622365afb81b78e7661c2fc20cf8028c4
6900a8dfa96d36d06b4aa06eba3e5dcf912eccc6
/开发/源码/app/src/main/java/www/wellswang/cn/smartcity/button/onclick/buttonOnclickedEvent.java
0b825d0d74aa83f90be17237b238ba87a8acc941
[]
no_license
Wells-ING/android
80cddf53059f6dbc02bd9dae9f7ab1feaa586cbe
d159841c02b17abfbf82ab0c9761ff86fcf45a5a
refs/heads/master
2023-04-17T03:16:22.588997
2021-04-07T11:51:11
2021-04-07T11:51:11
352,525,426
0
1
null
null
null
null
UTF-8
Java
false
false
2,200
java
package www.wellswang.cn.smartcity.button.onclick; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import androidx.annotation.Nullable; import www.wellswang.cn.smartcity.R; /** * 鼠标点击方法 */ public class buttonOnclickedEvent extends Activity implements View.OnClickListener{ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_button); // 方法一:布局文件中button控件使用android:onClick="方法名" Button testtestBtn = findViewById(R.id.testBtn); // 方法二:匿名内部类 testtestBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(buttonOnclickedEvent.this, "Hello World", Toast.LENGTH_SHORT).show(); } }); // 方法三:实现View.OnClickListener接口,是成员内部类的一种变形 testtestBtn.setOnClickListener(this); // 方法四:成员内部类 InnerButtonOnclickedEvent i = new InnerButtonOnclickedEvent(); testtestBtn.setOnClickListener(i); } public void doSomething() { Toast.makeText(buttonOnclickedEvent.this, "Hello World", Toast.LENGTH_SHORT).show(); } @Override public void onClick(View v) { // 常用的格式 switch(v.getId()) { case R.id.testBtn: Toast.makeText(buttonOnclickedEvent.this, "Hello World", Toast.LENGTH_SHORT).show(); break; default: break; } } public class InnerButtonOnclickedEvent implements View.OnClickListener{ @Override public void onClick(View v) { // 常用的格式 switch(v.getId()) { case R.id.testBtn: Toast.makeText(buttonOnclickedEvent.this, "Hello World", Toast.LENGTH_SHORT).show(); break; default: break; } } } }
[ "15751366023@163.com" ]
15751366023@163.com
1f077f26912ada7e01a528101b8e05774a55b899
5f95241967455daaafbdf6149e739a2e41b9a3aa
/src/test/java/dk/tka/patientportal/repository/timezone/DateTimeWrapperRepository.java
3a4baa1cebb60d608ca0389eb3eca247e2c17651
[]
no_license
TimKara/patient_portal
75cd5a6171407e04d66407fc9cc32286bc74b504
4d141284b6eafe0149f216b33018025ce6a5551e
refs/heads/master
2023-01-14T15:14:51.969683
2020-02-17T17:16:10
2020-02-17T17:16:10
241,116,257
0
0
null
2022-12-30T19:42:53
2020-02-17T13:37:32
Java
UTF-8
Java
false
false
347
java
package dk.tka.patientportal.repository.timezone; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data JPA repository for the {@link DateTimeWrapper} entity. */ @Repository public interface DateTimeWrapperRepository extends JpaRepository<DateTimeWrapper, Long> { }
[ "engintimkara@gmail.com" ]
engintimkara@gmail.com
9c45b49b2abb68b51aea94abaf78a46806009e91
d9f0033546ffae9b5ca7a37ff6a0e30dd312e4ac
/o2o_business_studio/fanwe_o2o_businessclient_23/src/main/java/com/fanwe/model/Biz_dealvCtlIndexActModel.java
285aa292098a1bc2ccc16da86bb5282f3b772244
[]
no_license
aliang5820/o2o_studio_projects
f4c69c9558b6a405275b3896669aed00d4ea3d4b
7427c5e41406c71147dbbc622e3e4f6f7850c050
refs/heads/master
2020-04-16T02:12:16.817584
2017-05-26T07:44:46
2017-05-26T07:44:46
63,346,646
1
2
null
null
null
null
UTF-8
Java
false
false
624
java
package com.fanwe.model; import java.util.ArrayList; /** * @author 作者 E-mail:309581534@qq.com * @version 创建时间:2015-5-11 下午2:33:40 类说明 */ public class Biz_dealvCtlIndexActModel extends BaseCtlActModel { private ArrayList<LocationModel> location_list; private int is_auth; public ArrayList<LocationModel> getLocation_list() { return location_list; } public void setLocation_list(ArrayList<LocationModel> location_list) { this.location_list = location_list; } public int getIs_auth() { return is_auth; } public void setIs_auth(int is_auth) { this.is_auth = is_auth; } }
[ "aliang5820@126.com" ]
aliang5820@126.com
e74f6e4977542f21a339bf882a83bd71b8011c11
1bf02c81e3cfb3101f09cf55f764df163558f463
/src/main/java/daily_digest/config/LoggingConfiguration.java
7f22874ecfa3c103448ba35453d05424503e7466
[]
no_license
smithsun/churchApp
8ffd215ff39db8984bf367f44440d62e692f6291
3fc3d94f28e9b801e66b5ed7d15160e5c9b1c245
refs/heads/master
2023-06-23T23:46:04.444834
2021-07-02T12:14:09
2021-07-02T12:14:09
381,242,496
0
0
null
null
null
null
UTF-8
Java
false
false
1,793
java
package daily_digest.config; import static tech.jhipster.config.logging.LoggingUtils.*; import ch.qos.logback.classic.LoggerContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; import java.util.Map; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import tech.jhipster.config.JHipsterProperties; /* * Configures the console and Logstash log appenders from the app properties */ @Configuration public class LoggingConfiguration { public LoggingConfiguration( @Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort, JHipsterProperties jHipsterProperties, ObjectMapper mapper ) throws JsonProcessingException { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); Map<String, String> map = new HashMap<>(); map.put("app_name", appName); map.put("app_port", serverPort); String customFields = mapper.writeValueAsString(map); JHipsterProperties.Logging loggingProperties = jHipsterProperties.getLogging(); JHipsterProperties.Logging.Logstash logstashProperties = loggingProperties.getLogstash(); if (loggingProperties.isUseJsonFormat()) { addJsonConsoleAppender(context, customFields); } if (logstashProperties.isEnabled()) { addLogstashTcpSocketAppender(context, customFields, logstashProperties); } if (loggingProperties.isUseJsonFormat() || logstashProperties.isEnabled()) { addContextListener(context, customFields, loggingProperties); } } }
[ "smith.sun@pollex.com.tw" ]
smith.sun@pollex.com.tw
8c5206ecb251bac5a77893502ea7f4a55f95b912
411f9804df9631417e5d19c06352b5d970907241
/E2ECMS/src/test/java/CMSPack_1/AddDocument.java
0df887e2adeb610c2db9f94ee3812fb093028c3d
[]
no_license
johnnysabjan/CMSRepository
01d5afe232da865e4cf5a33151c804ef8ce77d78
19495b79e949fbe46e07c4b8bf252fbab1ef554a
refs/heads/master
2020-05-02T19:06:47.985235
2019-03-28T08:30:23
2019-03-28T08:30:23
178,149,454
0
0
null
null
null
null
UTF-8
Java
false
false
2,349
java
package CMSPack_1; import java.util.concurrent.TimeUnit; import PageObjects.LoginwithEmail; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import CommonResources.Base; import PageObjects.AddResourcess; public class AddDocument extends Base { public WebDriver driver; @DataProvider(name="Docinputs") public Object[][] Docinputs() { return new Object[][] {{"Sabjan Doc1", "C:\\Users\\sabjansab\\Downloads\\Test_Plan_Template_02.doc", "Test Desc1"}, {"Sabjan Doc2", "C:\\Users\\sabjansab\\Downloads\\Test_Plan_Template_03.doc", "Test Desc2"}, {"Sabjan Doc3", "C:\\Users\\sabjansab\\Downloads\\Test_Plan_Template_04.doc", "Test Desc3"}}; } private static Logger log=LogManager.getLogger(Base.class.getName()); @BeforeTest public void initialize() { log.info("Intialize the browser"); driver=initializebrowser(); log.info("Browser intialization completed"); } @Test(dataProvider = "Docinputs") public void AddDocuments(String Title1,String UploadF,String Des) throws InterruptedException { driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); log.debug("Start adding the document"); LoginwithEmail le=new LoginwithEmail(driver); AddResourcess ar=new AddResourcess(driver); driver.get("https://cmds.nhancelms.com/login"); le.clickLoginwithemail().click(); le.EnterUsername().sendKeys("sabjansab.c@gasofttech.in"); le.EnterPassword().sendKeys("testing@ga"); le.Submit().click(); Thread.sleep(3000); ar.Selectfolder().click(); Thread.sleep(3000); ar.clkaddcontent().click(); ar.Sel_Doc().click(); Thread.sleep(3000); ar.Title().sendKeys(Title1); ar.Upload().sendKeys(UploadF); ar.Desc().sendKeys(Des); Thread.sleep(3000); ar.Programdropdown().click(); Thread.sleep(3000); ar.Functionalradio().click(); ar.ProgramDone().click(); int count=ar.Checkboxsize().size(); for(int i=0;i<count;i++) { Thread.sleep(3000); ar.Topics().click(); ar.Checkboxsize().get(i).click(); ar.Topics_Done().click(); } ar.Add().click(); Thread.sleep(3000); ar.Logoutsel().click(); ar.Logout().click(); } @AfterTest public void close() { driver.close(); } }
[ "johnny.sabjan@gmail.com" ]
johnny.sabjan@gmail.com
26290a9f74a4abdda20cb8c961e5150a20a926ad
b903b8bc1ee39b10eb0b7f7bfcab4f384372ac7b
/app/src/main/java/com/example/foodcriticapp/Database.java
459256282f0fbd1bc605a283ac78ec24061c318e
[]
no_license
tom12345-coder-creator/FoodCriticApp
27b494ac81f997737b18b1acb3bd47971cc94805
6ab81209d2a40de14bfa442ed81db4bdda7a6289
refs/heads/master
2023-04-15T13:17:54.086124
2021-04-26T14:21:54
2021-04-26T14:21:54
359,374,870
0
0
null
null
null
null
UTF-8
Java
false
false
1,595
java
package com.example.foodcriticapp; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import androidx.annotation.Nullable; public class Database extends DataBaseHelper { public Database(@Nullable Context context) { super(context); } public long addReview(ContentValues values) { SQLiteDatabase db = getWritableDatabase(); return db.insert("review", null, values); } public Cursor getReviewList() { SQLiteDatabase db = this.getReadableDatabase(); String table = "review"; String[] columns = {"foodName","foodPrice","reviewInput"}; String selection = ""; String[] selectionArgs = {}; String groupBy = null; String having = null; String orderBy = "foodName Desc"; String list = "100"; Cursor cursor = db.query(table, columns, selection, selectionArgs, groupBy, having, orderBy, list); return cursor; } public int deleteReview(String foodItem) { SQLiteDatabase db = getWritableDatabase(); String column = "foodName=?"; String[] foodName = {foodItem}; return db.delete("review",column, foodName); } public int saveReview(String search, String newValue) { SQLiteDatabase db = getWritableDatabase(); ContentValues values = new ContentValues(); values.put("foodName",newValue); String[] searches = {search}; return db.update("review",values,"foodName=?",searches); } }
[ "thomasgibson247@gmail.com" ]
thomasgibson247@gmail.com
5c79c6e89693ace2d3432acddba118667e0aa727
f321db1ace514d08219cc9ba5089ebcfff13c87a
/generated-tests/dynamosa/tests/s1027/4_freehep/evosuite-tests/org/freehep/math/minuit/MnAlgebraicSymMatrix_ESTest.java
ecbf79c4eebaf3f3f0faaaa011768c0ce86ac8c2
[]
no_license
sealuzh/dynamic-performance-replication
01bd512bde9d591ea9afa326968b35123aec6d78
f89b4dd1143de282cd590311f0315f59c9c7143a
refs/heads/master
2021-07-12T06:09:46.990436
2020-06-05T09:44:56
2020-06-05T09:44:56
146,285,168
2
2
null
null
null
null
UTF-8
Java
false
false
12,197
java
/* * This file was automatically generated by EvoSuite * Thu Jul 04 17:55:43 GMT 2019 */ package org.freehep.math.minuit; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.freehep.math.minuit.MnAlgebraicSymMatrix; import org.freehep.math.minuit.MnAlgebraicVector; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class MnAlgebraicSymMatrix_ESTest extends MnAlgebraicSymMatrix_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.set((-836), 2832, 1382.817152877); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test01() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(442); // Undeclared exception! try { mnAlgebraicSymMatrix0.set(2179, (-2309), 2179); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test02() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.get((-772), 0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test03() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(18); mnAlgebraicSymMatrix0.invert(); mnAlgebraicSymMatrix0.invert(); } @Test(timeout = 4000) public void test04() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); int int0 = mnAlgebraicSymMatrix0.size(); assertEquals(0, int0); } @Test(timeout = 4000) public void test05() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); int int0 = mnAlgebraicSymMatrix0.nrow(); assertEquals(0, int0); } @Test(timeout = 4000) public void test06() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); int int0 = mnAlgebraicSymMatrix0.nrow(); assertEquals(1, int0); } @Test(timeout = 4000) public void test07() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); int int0 = mnAlgebraicSymMatrix0.ncol(); assertEquals(0, int0); } @Test(timeout = 4000) public void test08() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(615); double double0 = mnAlgebraicSymMatrix0.get(493, (-1)); assertEquals(0.0, double0, 0.01); } @Test(timeout = 4000) public void test09() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); double[] doubleArray0 = mnAlgebraicSymMatrix0.data(); assertEquals(0, doubleArray0.length); } @Test(timeout = 4000) public void test10() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.set((-776), (-776), 0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // 299924 // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test11() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(623); mnAlgebraicSymMatrix0.set((-775), (-42), (-1619.2)); } @Test(timeout = 4000) public void test12() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.get(0, 0); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test13() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(550); // Undeclared exception! mnAlgebraicSymMatrix0.toString(); } @Test(timeout = 4000) public void test14() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(114); // Undeclared exception! mnAlgebraicSymMatrix0.invert(); } @Test(timeout = 4000) public void test15() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(20); // Undeclared exception! try { mnAlgebraicSymMatrix0.get((-2549), (-2549)); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // } } @Test(timeout = 4000) public void test16() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.eigenvalues(); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // 1 // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test17() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(7); // Undeclared exception! try { mnAlgebraicSymMatrix0.set(2, 7, 7); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test18() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.set(0, 0, 1.0E-35); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test19() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(0); // Undeclared exception! try { mnAlgebraicSymMatrix0.get((-1), 1); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test20() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); // Undeclared exception! try { mnAlgebraicSymMatrix0.get(1040, 2); fail("Expecting exception: ArrayIndexOutOfBoundsException"); } catch(ArrayIndexOutOfBoundsException e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test21() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(13); MnAlgebraicVector mnAlgebraicVector0 = mnAlgebraicSymMatrix0.eigenvalues(); assertNotNull(mnAlgebraicVector0); } @Test(timeout = 4000) public void test22() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(21); mnAlgebraicSymMatrix0.set(5, 5, (-442.5304269)); try { mnAlgebraicSymMatrix0.invert(); fail("Expecting exception: Exception"); } catch(Exception e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test23() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); try { mnAlgebraicSymMatrix0.invert(); fail("Expecting exception: Exception"); } catch(Exception e) { // // no message in exception (getMessage() returned null) // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test24() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(13); mnAlgebraicSymMatrix0.invert(); // Undeclared exception! mnAlgebraicSymMatrix0.eigenvalues(); } @Test(timeout = 4000) public void test25() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = null; try { mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix((-1494)); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // Invalid matrix size: -1494 // verifyException("org.freehep.math.minuit.MnAlgebraicSymMatrix", e); } } @Test(timeout = 4000) public void test26() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); MnAlgebraicSymMatrix mnAlgebraicSymMatrix1 = mnAlgebraicSymMatrix0.clone(); assertNotSame(mnAlgebraicSymMatrix1, mnAlgebraicSymMatrix0); } @Test(timeout = 4000) public void test27() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(18); int int0 = mnAlgebraicSymMatrix0.size(); assertEquals(171, int0); } @Test(timeout = 4000) public void test28() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(623); int int0 = mnAlgebraicSymMatrix0.ncol(); assertEquals(623, int0); } @Test(timeout = 4000) public void test29() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); String string0 = mnAlgebraicSymMatrix0.toString(); assertEquals("LASymMatrix parameters:\n\n 0.00000 \n", string0); } @Test(timeout = 4000) public void test30() throws Throwable { MnAlgebraicSymMatrix mnAlgebraicSymMatrix0 = new MnAlgebraicSymMatrix(1); double[] doubleArray0 = mnAlgebraicSymMatrix0.data(); assertEquals(1, doubleArray0.length); } }
[ "granogiovanni90@gmail.com" ]
granogiovanni90@gmail.com
c5b1ad3ec004d92f2aae315f23e1c28e3a2286e6
fd07687521021ff843cb064cc3febcd2c9035dca
/PMBFrameworkLib/src/de/uni_tuebingen/gris/pmb/config/IConfiguration.java
3659ac503e5cbd378c2b9a36938397f2d0dbf17b
[]
no_license
dvdgeisler/Praktikum-Medizinische-Bildverarbeitung
eb4f7bc956a326baf1942636e6cbac20d04cbccf
14804e89f2bd420cafeeaca30f1dd25824e17d58
refs/heads/master
2016-09-05T17:51:27.004695
2014-08-09T15:38:19
2014-08-09T15:38:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package de.uni_tuebingen.gris.pmb.config; /*import de.uni_tuebingen.gris.pmb.utils.listener.IObservable;*/ public interface IConfiguration extends IConfigurationSection /*, IObservable<IConfigurationListener>*/ { }
[ "dvdgeisler@googlemail.com" ]
dvdgeisler@googlemail.com
5c0982db6156d784cebb6dd5d4057106f2476b20
ceddf4fbef335bec3a770a05a067564f1e40560f
/src/main/java/com/polarising/auth/security/oauth2/SimpleAuthoritiesExtractor.java
f6679bad63ef205169f8df9615dec4f96aa4e68c
[]
no_license
jrjm/cognito-auth
c7e635d25eef44bb428cf845bf1775ff6f4a0fb2
8f9cfca5d021a62f443d7ee167fdd78185ceba9d
refs/heads/master
2020-04-13T15:07:59.976739
2018-12-27T10:42:53
2018-12-27T10:42:53
163,282,398
0
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package com.polarising.auth.security.oauth2; import org.springframework.boot.autoconfigure.security.oauth2.resource.AuthoritiesExtractor; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; import static java.util.stream.Collectors.toList; public class SimpleAuthoritiesExtractor implements AuthoritiesExtractor { private final String oauth2AuthoritiesAttribute; public SimpleAuthoritiesExtractor(String oauth2AuthoritiesAttribute) { this.oauth2AuthoritiesAttribute = oauth2AuthoritiesAttribute; } @Override public List<GrantedAuthority> extractAuthorities(Map<String, Object> map) { return Optional.ofNullable((List<String>) map.get(oauth2AuthoritiesAttribute)) .filter(it -> !it.isEmpty()) .orElse(Collections.emptyList()) .stream() .map(SimpleGrantedAuthority::new) .collect(toList()); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d6f1068d9058d4b02507f80fd7d8baccb378717b
dd34da5374ef0079d458aa63f15c591d8ed3a052
/src/com/qkj/manage/action/ActiveProductAction.java
a057479ff975b6180628e22b31f4196474081974
[]
no_license
kreocn/qkjebiz
0fd53600c99d4d054747f873e21f5fe8262f6d3a
749d4d118cd31860568ff2db872ed79099007875
refs/heads/master
2021-01-17T01:15:36.173750
2014-07-14T09:02:00
2014-07-14T09:02:00
21,596,226
1
0
null
2016-05-30T06:06:34
2014-07-08T02:56:02
JavaScript
UTF-8
Java
false
false
3,498
java
package com.qkj.manage.action; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.iweb.sys.ContextHelper; import com.opensymphony.xwork2.ActionSupport; import com.qkj.manage.dao.ActiveDAO; import com.qkj.manage.dao.ActiveProductDAO; import com.qkj.manage.domain.ActiveProduct; public class ActiveProductAction extends ActionSupport { private static final long serialVersionUID = 1L; private static Log log = LogFactory.getLog(ActiveProductAction.class); private ActiveProductDAO dao = new ActiveProductDAO(); private ActiveDAO adao = new ActiveDAO(); private ActiveProduct activeProduct; private List<ActiveProduct> activeProducts; private String message; private String viewFlag; private int recCount; private int pageSize; public ActiveProduct getActiveProduct() { return activeProduct; } public void setActiveProduct(ActiveProduct activeProduct) { this.activeProduct = activeProduct; } public List<ActiveProduct> getActiveProducts() { return activeProducts; } public void setActiveProducts(List<ActiveProduct> activeProducts) { this.activeProducts = activeProducts; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getViewFlag() { return viewFlag; } public void setViewFlag(String viewFlag) { this.viewFlag = viewFlag; } public int getRecCount() { return recCount; } public void setRecCount(int recCount) { this.recCount = recCount; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public String add() throws Exception { ContextHelper.isPermit("QKJ_QKJMANAGE_ACTIVEPRODUCT_ADD"); try { activeProduct.setStatus(1); dao.add(activeProduct); adao.mdyActiveItPrice(activeProduct.getActive_id()); } catch (Exception e) { log.error(this.getClass().getName() + "!add 数据添加失败:", e); throw new Exception(this.getClass().getName() + "!add 数据添加失败:", e); } return SUCCESS; } public String del() throws Exception { ContextHelper.isPermit("QKJ_QKJMANAGE_ACTIVEPRODUCT_DEL"); try { dao.delete(activeProduct); adao.mdyActiveItPrice(activeProduct.getActive_id()); setMessage("删除成功!ID=" + activeProduct.getUuid()); } catch (Exception e) { log.error(this.getClass().getName() + "!del 数据删除失败:", e); throw new Exception(this.getClass().getName() + "!del 数据删除失败:", e); } return SUCCESS; } public String addClose() throws Exception { ContextHelper.isPermit("QKJ_QKJMANAGE_ACTIVEPRODUCTCLOSE_ADD"); try { activeProduct.setStatus(2); dao.add(activeProduct); adao.mdyActiveCloseItPrice(activeProduct.getActive_id()); } catch (Exception e) { log.error(this.getClass().getName() + "!add 数据添加失败:", e); throw new Exception(this.getClass().getName() + "!add 数据添加失败:", e); } return SUCCESS; } public String delClose() throws Exception { ContextHelper.isPermit("QKJ_QKJMANAGE_ACTIVEPRODUCTCLOSE_DEL"); try { dao.delete(activeProduct); adao.mdyActiveCloseItPrice(activeProduct.getActive_id()); setMessage("删除成功!ID=" + activeProduct.getUuid()); } catch (Exception e) { log.error(this.getClass().getName() + "!del 数据删除失败:", e); throw new Exception(this.getClass().getName() + "!del 数据删除失败:", e); } return SUCCESS; } }
[ "kreo@qq.com" ]
kreo@qq.com
70bcdc2e8b0e3bd702df8ed9661ca59b0bc9fed3
33ff7b84ea194ed28ffeb147927bc1fbfe4501c2
/modules/matterhorn-waveform-api/src/main/java/org/opencastproject/waveform/api/WaveformService.java
ceabec88450186d3898920ac38037707c343a624
[ "ECL-2.0", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-unknown", "LicenseRef-scancode-free-unknown" ]
permissive
hayate891/opencast
6aeda6b8ede7dbbebecab6b9c9363f9efe5a7c09
4d1d577eec4a8469f01ee87fa6b4c0b992e13d4f
refs/heads/develop
2023-01-05T18:28:28.701431
2021-01-21T09:17:17
2021-01-21T09:17:17
88,654,299
1
0
ECL-2.0
2023-01-02T21:59:24
2017-04-18T17:53:15
Java
UTF-8
Java
false
false
1,694
java
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you 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://opensource.org/licenses/ecl2.txt * * 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.opencastproject.waveform.api; import org.opencastproject.job.api.Job; import org.opencastproject.mediapackage.MediaPackageException; import org.opencastproject.mediapackage.Track; /** * This is an api for a service that will create a waveform image from a track. */ public interface WaveformService { /** Job type */ String JOB_TYPE = "org.opencastproject.waveform"; /** * Takes the given track and returns the job that will create a waveform image. * * @param sourceTrack the track to create waveform image from * @return a job that will create a waveform image * @throws MediaPackageException if the serialization of the given track fails * @throws WaveformServiceException if the job can't be created for any reason */ Job createWaveformImage(Track sourceTrack) throws MediaPackageException, WaveformServiceException; }
[ "wsmirnow@uni-osnabrueck.de" ]
wsmirnow@uni-osnabrueck.de
b7c788a1be30638a6bfb772e24fc81bdf2349114
87b83821b83df128f754f23224675b9fd7e4ad29
/src/main/MainController.java
9c55f114f897bc854de7bbb4fdfd0085f407d7f1
[]
no_license
TeamProjectGroupNo1/movieKiosk
a18776c506e43a55349c9defc7720dc0ff076c33
ce78a9474dbcc2aeebad1edeb2c6595dbc480231
refs/heads/master
2023-03-27T09:02:16.484331
2021-03-24T06:23:50
2021-03-24T06:23:50
346,558,679
0
0
null
null
null
null
UTF-8
Java
false
false
1,958
java
package main; import java.net.URL; import java.util.ResourceBundle; import common.CommonService; import javafx.fxml.Initializable; import javafx.scene.Parent; import javafx.scene.control.CheckBox; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import login.LoginService; import login.LoginServiceImpl; import memberInfo.MemberInfoDAO; import signUp.SignUpService; import signUp.SignUpServiceImpl; public class MainController implements Initializable{ private LoginService lsi; private SignUpService ssi; Parent root; public void setRoot(Parent root) { this.root = root; CommonService.setMainRoot(root); } @Override public void initialize(URL arg0, ResourceBundle arg1) { lsi = new LoginServiceImpl(); ssi = new SignUpServiceImpl(); } public void clkLogin() { TextField userID = (TextField)root.lookup("#userID"); PasswordField userPwd = (PasswordField)root.lookup("#userPwd"); CheckBox chkRemId = (CheckBox)root.lookup("#chkRemId"); if(userID.getText().isEmpty()) { CommonService.alertWarnShow("ID를 입력하세요"); }else if(userPwd.getText().isEmpty()) { CommonService.alertWarnShow("Password를 입력하세요"); }else { MemberInfoDAO memberInfo = new MemberInfoDAO(); String pwd = memberInfo.getPwd(userID.getText()); if(pwd == null) { CommonService.alertWarnShow("존재하지 않는 ID 입니다."); if(!chkRemId.isSelected()) userID.clear(); userPwd.clear(); }else if(userPwd.getText().equals(pwd)) { //login 성공 lsi.showLoginPage(root); CommonService.setUserId(userID.getText()); userID.clear(); userPwd.clear(); chkRemId.setSelected(false); CommonService.closeRoot(root); }else { CommonService.alertWarnShow("비밀번호가 틀렸습니다."); if(!chkRemId.isSelected()) userID.clear(); userPwd.clear(); } } } public void clkSignUp() { ssi.showSignUp(root); CommonService.closeRoot(root); } }
[ "nsnos@naver.com" ]
nsnos@naver.com
007a96bed83f534ac44d579953096e0740bcf3b8
a7f2d6ab342bb6779c72b009b2d5c6e10dee7db6
/test/ColorButton.java
e05d7e2c474270eedfee2d5aa0c18d6b25c25242
[]
no_license
gi-web/java
af39672fae86944f69fa991e3458a2bd537187cc
30519bd9d94b62328f6082ff553bf31b4c3ea42c
refs/heads/main
2023-03-28T20:38:34.406554
2021-03-29T06:12:01
2021-03-29T06:12:01
352,534,633
0
0
null
null
null
null
UHC
Java
false
false
1,733
java
package test; import javax.swing.*; import java.awt.event.*; import java.awt.*; public class ColorButton extends JFrame{ ColorButton(){ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //프레임 윈도우를 닫으면 프로그램 종료 setTitle("배경색이 다른 버튼"); // 프레임 제목 GridLayout grid = new GridLayout(); //GridLayout 배치관리자 생성 setLayout(grid); // grid를 컨텐트팬의 배치관리자로 지정 JButton btn1 = new JButton("1"); JButton btn2 = new JButton("2"); JButton btn3 = new JButton("3"); JButton btn4 = new JButton("4"); JButton btn5 = new JButton("5"); add(btn1); add(btn2); add(btn3); add(btn4); add(btn5); MyMouseListener listener = new MyMouseListener(); btn1.addMouseListener(listener); btn2.addMouseListener(listener); btn3.addMouseListener(listener); btn4.addMouseListener(listener); btn5.addMouseListener(listener); setSize(500,300); setVisible(true); } public static void main(String[] args) { new ColorButton(); } } class MyMouseListener implements MouseListener{ public void mouseClicked(MouseEvent e){ JButton buttonn = (JButton)e.getSource(); String str = buttonn.getText(); if(str.equals("1")) buttonn.setBackground(Color.red); else if(str.equals("2")) buttonn.setBackground(Color.blue); else if(str.equals("3")) buttonn.setBackground(Color.pink); else if(str.equals("4")) buttonn.setBackground(Color.yellow); else buttonn.setBackground(Color.green); } public void mouseExited(MouseEvent e){ } public void mousePressed(MouseEvent e){} public void mouseReleased(MouseEvent e){} public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } }
[ "phok75@naver.com" ]
phok75@naver.com
c576c45f246052f844b61d7ec0ac7dc376ece929
414d845c16c1f74d3a3ec7af587a1423d98e10fa
/app/build/generated/source/r/androidTest/debug/android/support/test/rule/R.java
38f1aeef03491113d780e3243f6817fce67d4671
[]
no_license
PhillypHenning/ParkIt
e9cac5e73e5f8d82654446f4bb66670924246854
bfa1692847d5d149dae7a9035bb2aa9f34d06054
refs/heads/master
2021-08-29T20:51:49.784100
2017-12-15T00:15:18
2017-12-15T00:15:18
105,935,183
0
1
null
2017-12-12T14:11:48
2017-10-05T20:08:23
Java
UTF-8
Java
false
false
345
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.test.rule; public final class R { public static final class string { public static final int app_name = 0x7f070074; } }
[ "phil8t8@gmail.com" ]
phil8t8@gmail.com
e8ccd958f2112dbb3957bf77bd155b0181adcfdd
0e0c16b6749edfda8ecf435e0393c0f59fd442cb
/app/src/main/java/id/luvie/luviedokter/model/statusDokter/ResponseStatusDokter.java
1d45653c5d81e2d0db5ce67c88fb68408328006b
[]
no_license
ranggacikal/DokterHaloQlinic
dcc671964e028c39874d387f58318504193f1797
5e13d429e9e85e7b60f2751ad6b3a0a04e52379f
refs/heads/master
2023-08-22T04:49:40.681491
2021-09-22T04:57:06
2021-09-22T04:57:06
370,740,963
1
0
null
null
null
null
UTF-8
Java
false
false
453
java
package id.luvie.luviedokter.model.statusDokter; import com.google.gson.annotations.SerializedName; public class ResponseStatusDokter{ @SerializedName("response") private String response; public void setResponse(String response){ this.response = response; } public String getResponse(){ return response; } @Override public String toString(){ return "ResponseStatusDokter{" + "response = '" + response + '\'' + "}"; } }
[ "ranggacikal2@gmail.com" ]
ranggacikal2@gmail.com
c7ad47ac23d9d92054f8ee0c0312f91151ae4f90
7e6bb196aa7c159f8ba991961df466ad200e1a44
/app/src/main/java/com/tusueldo/pokedex/MainActivity.java
c782417603e7694fc1ba947e4669b2cc3ec8b6ff
[]
no_license
davidCadillo/Pokedex
16b81eca2bc995f7256fceb6cc21b570ac7782e9
0a0efca2d063b9c6fd05787e0119e100a20e622b
refs/heads/master
2021-01-19T23:12:54.987879
2017-04-22T03:49:02
2017-04-22T03:49:02
88,937,201
0
0
null
null
null
null
UTF-8
Java
false
false
3,884
java
package com.tusueldo.pokedex; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import com.tusueldo.pokedex.interfaces.PokeApiService; import com.tusueldo.pokedex.modelo.Pokemon; import com.tusueldo.pokedex.modelo.PokemonResponse; import java.util.ArrayList; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class MainActivity extends AppCompatActivity { private static final String TAG = "POKEDEX"; private Retrofit retrofit; private RecyclerView recyclerView; private ListaPokemonAdapter listaPokemonAdapter; private int offset; private static int iteracion = 1; private boolean aptoParaCargar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); recyclerView = (RecyclerView) findViewById(R.id.recyclerView); listaPokemonAdapter = new ListaPokemonAdapter(this); recyclerView.setAdapter(listaPokemonAdapter); recyclerView.setHasFixedSize(true); final GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3); recyclerView.setLayoutManager(gridLayoutManager); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (dy > 0) { int visibleItemCount = gridLayoutManager.getChildCount(); int totalITemCount = gridLayoutManager.getItemCount(); int pastVisibleITem = gridLayoutManager.findFirstVisibleItemPosition(); Log.i(TAG, iteracion + " visibleITem: " + visibleItemCount + " totalITemCount: " + totalITemCount + " pastVisibleITem: " + pastVisibleITem); iteracion++; if (aptoParaCargar) { if (visibleItemCount + pastVisibleITem >= totalITemCount) { Log.i(TAG, "Llegamos al final"); aptoParaCargar = false; offset += 20; obtenerDatos(offset); } } } } }); retrofit = new Retrofit.Builder() .baseUrl("http://pokeapi.co/api/v2/") .addConverterFactory(GsonConverterFactory.create()) .build(); aptoParaCargar = true; offset = 0; obtenerDatos(offset); } private void obtenerDatos(int offset) { PokeApiService service = retrofit.create(PokeApiService.class); Call<PokemonResponse> pokemonResponseCall = service.obtenerListaPokemon(20, offset); pokemonResponseCall.enqueue(new Callback<PokemonResponse>() { @Override public void onResponse(Call<PokemonResponse> call, Response<PokemonResponse> response) { aptoParaCargar = true; if (response.isSuccessful()) { PokemonResponse pokemonResponse = response.body(); ArrayList<Pokemon> listaPokemon = pokemonResponse.getResults(); listaPokemonAdapter.adicionarListaPokemon(listaPokemon); } else { Log.e(TAG, "onResponse: " + response.errorBody()); } } @Override public void onFailure(Call<PokemonResponse> call, Throwable t) { Log.e(TAG, "onFailure: " + t.getMessage()); } }); } }
[ "cadillodavid@gmail.com" ]
cadillodavid@gmail.com
fd99bf5fa919b3f4dd660d9b740d74e6efaaf63f
c818fae3b6bede57e25344acf229adb33fc0b0d1
/DMS Server - Community Edition 2022/src/com/primeleaf/krystal/web/action/cpanel/NewDocumentClassAction.java
62b48a599c7cf2d1a52647255300d9a91bb0537c
[]
no_license
primeleaf/krystaldms-community-edition
1438bd512ead3e3b7d9d6d8d9ca6235bb69cdfd0
48483d3256e6801b6525c8d49e5118ec063aa489
refs/heads/master
2022-08-14T03:46:14.257698
2022-07-28T12:40:54
2022-07-28T12:40:54
131,812,861
19
11
null
null
null
null
UTF-8
Java
false
false
6,072
java
/** * Created On 05-Jan-2014 * Copyright 2010 by Primeleaf Consulting (P) Ltd., * #29,784/785 Hendre Castle, * D.S.Babrekar Marg, * Gokhale Road(North), * Dadar,Mumbai 400 028 * India * * All rights reserved. * * This software is the confidential and proprietary information * of Primeleaf Consulting (P) Ltd. ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Primeleaf Consulting (P) Ltd. */ package com.primeleaf.krystal.web.action.cpanel; import java.util.ArrayList; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.validator.GenericValidator; import com.primeleaf.krystal.constants.HTTPConstants; import com.primeleaf.krystal.model.AuditLogManager; import com.primeleaf.krystal.model.dao.DocumentClassDAO; import com.primeleaf.krystal.model.vo.AuditLogRecord; import com.primeleaf.krystal.model.vo.DocumentClass; import com.primeleaf.krystal.model.vo.IndexDefinition; import com.primeleaf.krystal.web.KrystalSession; import com.primeleaf.krystal.web.action.Action; import com.primeleaf.krystal.web.view.WebView; import com.primeleaf.krystal.web.view.cpanel.NewDocumentClassView; /** * Author Rahul Kubadia */ public class NewDocumentClassAction implements Action { public WebView execute(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); KrystalSession krystalSession = (KrystalSession)session.getAttribute(HTTPConstants.SESSION_KRYSTAL); if(request.getMethod().equalsIgnoreCase("POST")){ try { String className = request.getParameter("txtClassName") != null ? request.getParameter("txtClassName"): ""; String classDescription = request.getParameter("txtClassDescription") != null ? request.getParameter("txtClassDescription"): ""; String isRevCtl = request.getParameter("radRevisionControl") != null ? request.getParameter("radRevisionControl"): "N"; String active = request.getParameter("radActive") != null ? request.getParameter("radActive"): "N"; //24-Nov-2011 New fields added for controlling the file size and number of documents in the system int maximumFileSize = Integer.MAX_VALUE; int documentLimit = Integer.MAX_VALUE; //10-Sep-2012 New field added for controlling the expiry period of the doucment int expiryPeriod = 0; if(!GenericValidator.maxLength(className, 50)){ request.setAttribute(HTTPConstants.REQUEST_ERROR,"Value too large for Document Class Name"); return (new ManageDocumentClassesAction().execute(request, response)); } if(!GenericValidator.maxLength(classDescription, 50)){ request.setAttribute(HTTPConstants.REQUEST_ERROR,"Value too large for Document Class Description"); return (new ManageDocumentClassesAction().execute(request, response)); } try{ expiryPeriod=request.getParameter("txtExpiryPeriod")!=null ? Integer.parseInt(request.getParameter("txtExpiryPeriod")):0; }catch(Exception e){ request.setAttribute(HTTPConstants.REQUEST_ERROR, "Invalid input"); return (new ManageDocumentClassesAction().execute(request, response)); } if(!GenericValidator.isInRange(expiryPeriod, 0, 9999)){ request.setAttribute(HTTPConstants.REQUEST_ERROR, "Invalid input"); return (new ManageDocumentClassesAction().execute(request, response)); } if(!"Y".equals(active)){ active="N"; } if(!"Y".equals(isRevCtl)){ isRevCtl="N"; } boolean isDocumentClassExist= DocumentClassDAO.getInstance().validateDocumentClass(className); if(isDocumentClassExist){ request.setAttribute(HTTPConstants.REQUEST_ERROR,"Document class " + className + " already exist"); return (new ManageDocumentClassesAction().execute(request, response)); } DocumentClass documentClass = new DocumentClass(); documentClass.setClassName(className); documentClass.setClassDescription(classDescription); if(isRevCtl.equals("Y")){ documentClass.setRevisionControlEnabled(true); }else{ documentClass.setRevisionControlEnabled(false); } if(active.equals("Y")){ documentClass.setVisible(true); }else{ documentClass.setVisible(false); } documentClass.setIndexId(-1); documentClass.setIndexCount(0); //24-Nov-2011 New fields added for controlling the file size and number of documents in the system documentClass.setMaximumFileSize(maximumFileSize); documentClass.setDocumentLimit(documentLimit); documentClass.setIndexTableName(""); documentClass.setCreatedBy(krystalSession.getKrystalUser().getUserName()); documentClass.setDataTableName(""); documentClass.setExpiryPeriod(expiryPeriod); //10-Sep-2012 Rahul Kubadia documentClass.setExpiryNotificationPeriod(-1);//08-May-2014 Rahul Kubadia ArrayList<IndexDefinition> indexDefinitions = new ArrayList<IndexDefinition>(); documentClass.setIndexDefinitions(indexDefinitions); DocumentClassDAO.getInstance().addDocumentClass(documentClass); AuditLogManager.log(new AuditLogRecord( documentClass.getClassId(), AuditLogRecord.OBJECT_DOCUMENTCLASS, AuditLogRecord.ACTION_CREATED, krystalSession.getKrystalUser().getUserName(), request.getRemoteAddr(), AuditLogRecord.LEVEL_INFO, "ID : " + documentClass.getClassId(), "Name : " + documentClass.getClassName() ) ); request.setAttribute(HTTPConstants.REQUEST_MESSAGE,"Document class " + className + " added successfully"); return (new ManageDocumentClassesAction().execute(request, response)); } catch (Exception e) { e.printStackTrace(); } } return (new NewDocumentClassView(request, response)); } }
[ "Rahul.Kubadia@local.krystaldms.in" ]
Rahul.Kubadia@local.krystaldms.in
e89b4bf22eaf0f74feff42de52a8d12013870dba
8b03806f33edcf5f425de71b193f99ab20844ab1
/src/day45_Constructor/Paycheck.java
61f9be134254e6a8d4cab2e14e0069a6ef571079
[]
no_license
Igruss/javanizm
7968d92f89027abc7863845e971379aabb054ec7
e3d620e3eb6f017400eb7b94e4a6d7ec7db4fcaa
refs/heads/master
2023-02-08T01:12:47.320038
2020-12-30T23:50:38
2020-12-30T23:50:38
284,542,275
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package day45_Constructor; public class Paycheck { public static void main(String[] args) { SalaryCalculator obj1 = new SalaryCalculator(55,40,0.09,0.24); System.out.println(obj1.salary()); System.out.println(obj1.salaryAfterTax()); System.out.println("Total Tax: "+(obj1.salary() - obj1.salaryAfterTax())); } }
[ "ruller0611@gmail.com" ]
ruller0611@gmail.com
97c4681aa017a7046f9b927a314d6a65ebebda71
0ae6a4a0edb5a6d36df6c00de32d927ec6ef6b3a
/SpringbootMybatis/src/main/java/tk/mybatis/springboot/controller/TmnInfoController.java
2b08d69552242da21213f827aff637032d188f9a
[]
no_license
415502155/Java
910fc3d81e0a07e39405f771e7508ad080c86825
972e5a362a11c2e90f294e07b1bf0884373dc085
refs/heads/master
2022-12-25T01:28:23.664229
2021-03-30T07:14:51
2021-03-30T07:14:51
97,439,827
0
1
null
2022-12-16T09:41:22
2017-07-17T05:52:59
Java
UTF-8
Java
false
false
15,779
java
package tk.mybatis.springboot.controller; import static org.assertj.core.api.Assertions.in; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.log; import java.io.Serializable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import org.apache.commons.io.IOUtils; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.ListOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.SetOperations; import org.springframework.data.redis.core.ZSetOperations; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import tk.mybatis.springboot.dao.vani.TmnInfoDao; import tk.mybatis.springboot.mapper.TmnInfoMapper; import tk.mybatis.springboot.mapper.UserInfoMapper; import tk.mybatis.springboot.model.UserInfo; import tk.mybatis.springboot.model.t_tmn_info; import tk.mybatis.springboot.util.MD5; import tk.mybatis.springboot.util.ReturnMsg; @RestController @RequestMapping("/tmn") public class TmnInfoController { private Logger logger = Logger.getLogger(getClass()); @Autowired TmnInfoMapper tmnnfoMapper; // @Autowired // TmnInfoDao tmninfoDao; @Autowired UserInfoMapper userInfo; // @Autowired // TmnPageInfoMapper tmnpageInfoMapper; // @Autowired // TmnInfoService tmninfoService; // @Autowired // TmnInfoRepository tmnInfoRepository; // @Resource // private RedisTemplate<String,String> redisTemplate; @Resource private RedisTemplate<Serializable,Serializable> template; public RedisTemplate<Serializable, Serializable> getTemplate() { return template; } public void setTemplate(RedisTemplate<Serializable, Serializable> template) { this.template = template; } @RequestMapping(value = "/info") @ResponseBody public JSONObject tmnList(HttpServletRequest request, HttpServletResponse response){ response.setContentType("text/xml;charset=UTF-8"); /** * 设置响应头允许ajax跨域访问* */ response.setHeader("Access-Control-Allow-Origin", "*");//'Access-Control-Allow-Origin:*' /*星号表示所有的异域请求都可以接受,*/ response.setHeader("Access-Control-Allow-Methods", "GET,POST"); JSONObject backJson = new JSONObject(); String s = "select * from t_tmn_info"; int pagesize = 8; int pagenum = 1; int end =pagenum*pagesize; int start = (pagenum-1)*8; int count = tmnnfoMapper.findTmnInfoNum(); List<t_tmn_info> tmn = tmnnfoMapper.getAll(end, start); backJson.put("TMN", tmn); backJson.put("COUNT", count); backJson.put("PAGESIZE", pagesize); backJson.put("PAGENUM", pagenum); return backJson; } @RequestMapping(value = "/redis") @ResponseBody public String tmnPageList(){ HashOperations<Serializable, Object, Object> hash = template.opsForHash(); Map map = new LinkedHashMap<>(); map.put("name", "zhangsan"); map.put("age", 10); map.put("sex", 1); map.put("address", "china"); // Map<String,Object> map = new HashMap<String,Object>(); // map.put("name", "lp"); // map.put("age", "26"); hash.putAll("lpMap", map); //获取 map System.out.println(hash.entries("lpMap")); //添加 一个 list 列表 ListOperations<Serializable, Serializable> list = template.opsForList(); //list.rightPush("lpList", "lp"); //list.rightPush("lpList", "26"); //输出 list list.remove("lp", 5, "lp"); System.out.println("List:"+list.range("lpList", 0, list.size("lpList"))); System.out.println("size:"+list.size("lpList")); System.out.println("lp:"+list.size("lp")); System.out.println("26:"+list.size("26")); //添加 一个 set 集合 SetOperations<Serializable, Serializable> set = template.opsForSet(); set.add("lpSet", "lp"); set.add("lpSet", "26"); set.add("lpSet", "178cm"); //输出 set 集合 System.out.println(set.members("lpSet")); //添加有序的 set 集合 ZSetOperations<Serializable, Serializable> zset = template.opsForZSet(); zset.add("lpZset", "lp", 0); zset.add("lpZset", "26", 1); zset.add("lpZset", "178cm", 2); //输出有序 set 集合 System.out.println(zset.rangeByScore("lpZset", 0, 2)); return "success"; } // @RequestMapping(value = "/params", method=RequestMethod.GET) // @ResponseBody // public Page<t_tmn_info> getEntryByParams() { // int page = 1; // int size = 10; // Sort sort = new Sort(Direction.DESC, "terminal_id"); // Pageable pageable = new PageRequest(page, size, sort); // return tmnInfoRepository.findAll(pageable); // } // @RequestMapping(value = "/findone/{id}") // @ResponseBody // public String tmnInfoByTerminalId(@PathVariable Integer id){ // String result=""; // JSONObject backJson = new JSONObject(); // t_tmn_info tmn = tmnnfoMapper.findTmnInfoByTerminal(id); // Map<String,Object> returnmap=new HashMap<String,Object>(); // returnmap.put("TERMINALID", tmn.getTerminal_id()); // returnmap.put("ACCOUNTID", tmn.getAccount_id()); // returnmap.put("ADDRESS", tmn.getTerminal_address()); // result=net.sf.json.JSONObject.fromObject(returnmap).toString(); // logger.info("res:"+result); // return result; // } @RequestMapping(value="city") @ResponseBody public String queryAll(){ int cityId = 5; List<t_tmn_info> list = tmnnfoMapper.queryAll(cityId); System.out.println(list.get(0).getLinkman()); return "success"; } // @RequestMapping(value="getinfo") // @ResponseBody // public String getTmnInfoList() { // int start = 1; // int end = 10; // List<t_tmn_info> tmnList = tmninfoDao.getAll(end, start); // return "suc"; // } @RequestMapping(value="test") @ResponseBody public JSONObject getTest() { logger.info("111111111111111111111111111111"); JSONObject backJson = new JSONObject(); List<UserInfo> userInfos = userInfo.findUserInfo(); backJson.put("user", userInfos); logger.info("BackJson:"+backJson); return backJson; } @RequestMapping(value="test1") @ResponseBody public JSONObject getTest1() { JSONObject backJson = new JSONObject(); int pagenum = 2; int pagesize = 5; int start = (pagenum-1)*pagesize; int end = pagesize; logger.info("start:"+start+",end:"+end); List<UserInfo> userInfos = userInfo.getPageUserInfo(start, end); if(userInfos.isEmpty()) { logger.info("userinfo is null!"); } JSONArray jsonArray = new JSONArray(); for (UserInfo user : userInfos) { JSONObject tempJson = new JSONObject(); tempJson.put("user_id", user.getUser_id()); tempJson.put("user_name", user.getUser_name()); tempJson.put("address", user.getAddress()); tempJson.put("sex", user.getSex()); tempJson.put("role_name", user.getRole_name()); tempJson.put("role_id", user.getRole_id()); jsonArray.add(tempJson); } backJson.put("LIST", jsonArray); logger.info("BackJson:"+backJson); return backJson; } /*** * Mysql Query * @return */ @RequestMapping(value="test2") @ResponseBody public JSONObject getTest2() { JSONObject backJson = new JSONObject(); int pagenum = 2; int pagesize = 5; int start = (pagenum-1)*pagesize; int end = pagesize; logger.info("start:"+start+",end:"+end); List<UserInfo> userInfos = userInfo.getUserRolePageInfo(start, end); //userInfo.getUserRoleInfo(); if(userInfos.isEmpty()) { logger.info("userroleinfo is null!"); } int count = userInfo.CountUserRoleInfo(); backJson.put("PAGENUM", pagenum); backJson.put("PAGESIZE", pagesize); backJson.put("COUNT", count); backJson.put("user", userInfos); logger.info("BackJson:"+userInfos.size()); return backJson; } /*** * 修改 * @return */ @RequestMapping(value="test3") @ResponseBody public JSONObject getTest3() { JSONObject backJson = new JSONObject(); String userName = "hanni"; int userId = 2; int status = userInfo.updateUserInfo(userName, userId); int count = userInfo.CountUserRoleInfo(); backJson.put("COUNT", count); backJson.put("STATUS", status); logger.info("BackJson:"+backJson); return backJson; } /*** * 批量修改或添加 * @return */ @RequestMapping(value="test4") @ResponseBody public JSONObject getTest4() { JSONObject backJson = new JSONObject(); List<UserInfo> ulist = new ArrayList<UserInfo>(); UserInfo user1 = new UserInfo(); user1.setAddress("china1"); user1.setRole_id(1); user1.setSex(1); //user1.setUser_id(1); user1.setUser_name("ningyi1"); ulist.add(user1); UserInfo user2 = new UserInfo(); user2.setAddress("china2"); user2.setRole_id(1); user2.setSex(1); user2.setUser_name("ningyi2"); ulist.add(user2); UserInfo user3 = new UserInfo(); user3.setAddress("china3"); user3.setRole_id(1); user3.setSex(1); user3.setUser_name("ningyi3"); ulist.add(user3); int sts = userInfo.addUserInfo(ulist); backJson.put("STATUS", sts); logger.info("BackJson:"+backJson); return backJson; } /*** * ThreadPoolExecutor * * @return * @throws ExecutionException * @throws InterruptedException */ @RequestMapping(value="test5") @ResponseBody public JSONObject getTest5() throws InterruptedException, ExecutionException { JSONObject backJson = new JSONObject(); ThreadPoolExecutor threadPoolExecutor =new ThreadPoolExecutor(5, 100, 5000, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>(50),new ThreadPoolExecutor.AbortPolicy()); int count = userInfo.CountUserInfo();//userinfo count logger.info("userinfo count: "+count); //thread num int threadnum = count; int num = 3; if(threadnum%3 == 0) { threadnum = threadnum/num; }else { threadnum = threadnum/num +1; } logger.info("ThreadNum :"+threadnum); StringBuilder sBuilder = new StringBuilder(); List<UserInfo> list = new ArrayList<UserInfo>(); for(int i = 0; i < threadnum ; i++) { logger.info("cishu:"+i); UserTask userTask = new UserTask(threadnum); userTask.setStart(i*num); userTask.setEnd(num); Future future = threadPoolExecutor.submit(userTask); List<UserInfo> ulist= (List<UserInfo>) future.get(); list.addAll(ulist); } JSONArray jsonArray = new JSONArray(); for (UserInfo user : list) { JSONObject tempJson = new JSONObject(); tempJson.put("user_id", user.getUser_id()); tempJson.put("user_name", user.getUser_name()); tempJson.put("address", user.getAddress()); tempJson.put("sex", user.getSex()); jsonArray.add(tempJson); } backJson.put("List", jsonArray); logger.info("BackJson:"+backJson); return backJson; } @RequestMapping(value="test6") @ResponseBody public JSONObject test6(Integer id) { JSONObject backJson = new JSONObject(); //int id = 1; List<UserInfo> list = userInfo.getUserInfoById(id); backJson.put("LIST", list); backJson.put("CODE", ReturnMsg.SUCCESS.getCode()); backJson.put("MSG", ReturnMsg.SUCCESS.getMsg()); return backJson; } @RequestMapping(value="test7") @ResponseBody public JSONObject test7() { JSONObject backJson = new JSONObject(); String name = "QQ"; String soft = "user_id desc"; List<UserInfo> list = userInfo.getUserInfoByName(name,soft); backJson.put("LIST", list); backJson.put("CODE", ReturnMsg.SUCCESS.getCode()); backJson.put("MSG", ReturnMsg.SUCCESS.getMsg()); return backJson; } /*** * 批量注册 * md5(base64) * 应该先判断当前用户表中的user_name是否有重复的 * 假如有相同的用户,停止该操作 * @return * @throws Exception */ @RequestMapping(value="/test8") @ResponseBody public JSONObject regist() throws Exception { JSONObject backJson = new JSONObject(); List<UserInfo> ulist = new ArrayList<UserInfo>(); UserInfo user1 = new UserInfo(); user1.setAddress("Beijig"); user1.setRole_id(1); user1.setSex(1); //user1.setUser_id(1); user1.setUser_name("zhangsan"); String pass1 = "123456789"; user1.setUser_pass(new MD5().digest(pass1, "MD5")); ulist.add(user1); UserInfo user2 = new UserInfo(); user2.setAddress("chaoyang"); user2.setRole_id(1); user2.setSex(1); user2.setUser_name("zhaoqi"); String pass2 = "123456789"; user2.setUser_pass(new MD5().digest(pass2, "MD5")); ulist.add(user2); UserInfo user3 = new UserInfo(); user3.setAddress("haidian"); user3.setRole_id(1); user3.setSex(1); user3.setUser_name("lisi"); String pass3 = "10086"; user3.setUser_pass(new MD5().digest(pass3, "MD5")); ulist.add(user3); //校验所添加的用户信息中是否有重复的user_name String[] strArray={user1.getUser_name(),user2.getUser_name(),user3.getUser_name()}; for(int i =0 ; i<strArray.length; i++) { logger.info("names:"+strArray[i]); int WhetherToRepeat = userInfo.checkUserName(strArray[i]); logger.info("check username num :"+WhetherToRepeat); if(WhetherToRepeat != 0) { backJson.put("CODE", 0); backJson.put("MSG", "add userinfo of username is repeat"); return backJson; } } try { int sts = userInfo.addUserInfo(ulist); backJson.put("STATUS", sts); } catch (Exception e) { // TODO: handle exception backJson.put("CODE", ReturnMsg.SALE_TICKET_EXCEPTION.getCode()); backJson.put("MSG", ReturnMsg.SALE_TICKET_EXCEPTION.getMsg()); logger.info("EX:",e); return backJson; } backJson.put("CODE", ReturnMsg.SUCCESS.getCode()); backJson.put("MSG", ReturnMsg.SUCCESS.getMsg()); return backJson; } /*** * login * @return * @throws Exception */ @RequestMapping(value="/login") @ResponseBody public JSONObject login(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); // ServletInputStream inputStream = request.getInputStream(); // String param = IOUtils.toString(inputStream); // JSONObject json = JSONObject.parseObject(param);//转为json // String nString = String.valueOf(json.get("USERNAME")); JSONObject backJson = new JSONObject(); String pass = "123456789"; String mpass = new MD5().digest(pass, "MD5"); String userName = "shy"; if(null == pass || userName == null) { return backJson; } List<UserInfo> list = userInfo.findUserInfo(); if(list.isEmpty()) { return backJson; } for(UserInfo user: list) { if(userName.equals(user.getUser_name()) && mpass.equals(user.getUser_pass()) ) { session.setAttribute("user", user.getUser_name()); session.setAttribute("pass", user.getUser_pass()); logger.info("session:"+session.getAttribute("user")+",pass:"+session.getAttribute("pass")); backJson.put("CODE", ReturnMsg.SUCCESS.getCode()); backJson.put("MSG", ReturnMsg.SUCCESS.getMsg()); return backJson; } } return backJson; } }
[ "415502155@qq.com" ]
415502155@qq.com
d99cc47e9090b00e72d4b1bbc3a2fb2ebc0ff9ab
4ae80699a2e2b21fe0e00e426c207a4db22e7e96
/Shop/src/main/java/com/deeshop/adapter/MessageAdapter.java
b20d5882b5050a7dbc6cf93e1fded0db339c3057
[ "Apache-2.0" ]
permissive
ReepicheepRed/DeeShop
9682140f9e45bb8f37b6cd53ab778815b86fff3a
cf391825eacb59cf1769be4549089525864ca51d
refs/heads/master
2021-01-22T05:37:34.419418
2018-03-24T14:25:51
2018-03-24T14:25:51
92,477,709
0
0
null
null
null
null
UTF-8
Java
false
false
1,536
java
package com.deeshop.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.ViewGroup; import com.deeshop.bean.Message; import com.deeshop.databinding.ItemMessageBinding; import com.deeshop.databinding.ItemMessageBinding; import java.util.List; /** * Created by zhiPeng.S on 2017/3/31. */ public class MessageAdapter extends BaseAdapter<MessageAdapter.ViewHolder,Message> { public MessageAdapter(Context context, List<Message> datas) { super(context, datas); } @Override protected ViewHolder getViewHolder(LayoutInflater inflater, ViewGroup parent) { return ViewHolder.create(inflater,parent); } @Override protected void setValues(ViewHolder holder, Message bean) { holder.bindTo(bean); } static class ViewHolder extends RecyclerView.ViewHolder{ private ItemMessageBinding binding; static MessageAdapter.ViewHolder create(LayoutInflater inflater, ViewGroup parent){ ItemMessageBinding binding = ItemMessageBinding.inflate(inflater,parent,false); return new MessageAdapter.ViewHolder(binding); } private ViewHolder(ItemMessageBinding binding) { super(binding.getRoot()); this.binding = binding; } public void bindTo(Message bean){ binding.setMsg(bean); binding.executePendingBindings(); } } }
[ "txj_jzyzqbx@yeah.net" ]
txj_jzyzqbx@yeah.net
abdcfd7d36e326da501ec9d561ad4b7ef4f015cf
70c850db946f675884a4635fc9f0159b9faea9a8
/example/spring-boot-atguigu/spring-boot-cyh-01-mybatis-paginator/src/main/java/com/cyh/mapper/EmployeeMapper.java
68cec78ba5523d18f8caf0fa66b8e5f5283a28fc
[]
no_license
oudream/hello-spring
dd5542b80a5f84abbdffc29053eaf5a1ec841078
0c32a9d97eaa81a2d33ca289a1750f5cca6c7720
refs/heads/master
2022-11-18T10:27:49.388512
2020-06-17T04:31:26
2020-06-17T04:31:26
231,731,318
1
0
null
2022-11-16T09:41:13
2020-01-04T08:20:52
Java
UTF-8
Java
false
false
477
java
package com.cyh.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; import com.cyh.bean.Employee; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; @Mapper @Component public interface EmployeeMapper { /** * 根据性别查询员工 * @param gender * @param pageBounds * @return */ List<Employee> findByGender(Integer gender, PageBounds pageBounds); }
[ "oudream@126.com" ]
oudream@126.com
ef60874ce4aac5ac17481c701dbd9f689d5b5a25
54562f38365b0ff1e1de99d37e7325e95d4c8b25
/library/src/main/java/xyz/zpayh/hdimage/AnimationBuilder.java
b856c732e9ff9c90029598547111bc411fe4ddc1
[ "Apache-2.0" ]
permissive
dosopeng/HDImageView
db656a0d245d09c503f9e49ea0a92098299c17b0
fea55a3ab74834edd439abf8eb84495350eb4941
refs/heads/master
2021-01-18T16:57:25.493337
2017-08-03T18:01:26
2017-08-03T18:01:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,084
java
/* * * * Copyright 2017 陈志鹏 * * * * 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 xyz.zpayh.hdimage; import android.graphics.PointF; import android.support.annotation.NonNull; import android.support.v4.animation.AnimatorListenerCompat; import android.support.v4.animation.AnimatorUpdateListenerCompat; import android.view.View; import android.view.animation.Interpolator; import java.util.ArrayList; import java.util.List; import xyz.zpayh.hdimage.util.Preconditions; /** * 文 件 名: AnimationBuilder * 创 建 人: 陈志鹏 * 创建日期: 2017/4/20 13:42 * 邮 箱: ch_zh_p@qq.com * 修改时间: * 修改备注: */ public class AnimationBuilder { private static final long DEFAULT_DURATION = 500L; private float mScaleEnd; private float mScaleStart; private final PointF mTargetSCenter; private long mDuration = DEFAULT_DURATION; private Interpolator mScaleInterpolator; private Interpolator mTranslateInterpolator; private boolean mInterrupt = true; private View mTarget; private final List<AnimatorListenerCompat> mAnimatorListenerCompats = new ArrayList<>(); private final List<AnimatorUpdateListenerCompat> mAnimatorUpdateListenerCompats = new ArrayList<>(); private PointF mViewFocusStart; private PointF mViewFocusEnd; public AnimationBuilder(PointF sCenter) { mTargetSCenter = sCenter; } public AnimationBuilder setDuration(long duration) { mDuration = duration; return this; } public AnimationBuilder setInterrupt(boolean interrupt) { mInterrupt = interrupt; return this; } public AnimationBuilder setScaleInterpolator(Interpolator scaleInterpolator) { mScaleInterpolator = scaleInterpolator; return this; } public AnimationBuilder setTranslateInterpolator(Interpolator translateInterpolator) { mTranslateInterpolator = translateInterpolator; return this; } public AnimationBuilder addAnimationListener(AnimatorListenerCompat listener) { if (listener == null){ return this; } mAnimatorListenerCompats.add(listener); return this; } public AnimationBuilder addAnimationListener(List<AnimatorListenerCompat> listeners) { if (listeners == null){ return this; } mAnimatorListenerCompats.addAll(listeners); return this; } public AnimationBuilder addAnimationUpdateListener(AnimatorUpdateListenerCompat listener) { if (listener == null){ return this; } mAnimatorUpdateListenerCompats.add(listener); return this; } public AnimationBuilder addAnimationUpdateListener(List<AnimatorUpdateListenerCompat> listeners) { if (listeners == null){ return this; } mAnimatorUpdateListenerCompats.addAll(listeners); return this; } public AnimationBuilder setTarget(@NonNull View target) { Preconditions.checkNotNull(target); mTarget = target; return this; } public AnimationBuilder setViewFocusStart(PointF viewFocusStart) { mViewFocusStart = viewFocusStart; return this; } public AnimationBuilder setViewFocusEnd(PointF viewFocusEnd) { mViewFocusEnd = viewFocusEnd; return this; } public AnimationBuilder setScaleStart(float scaleStart) { mScaleStart = scaleStart; return this; } public AnimationBuilder setScaleEnd(float scaleEnd) { mScaleEnd = scaleEnd; return this; } public ValueAnimator build(){ ValueAnimator animator = new ValueAnimator(); animator.setTarget(mTarget); animator.setScaleStart(mScaleStart); animator.setScaleEnd(mScaleEnd); animator.setSourceCenter(mTargetSCenter); animator.setViewFocusStart(mViewFocusStart); animator.setViewFocusEnd(mViewFocusEnd); animator.setDuration(mDuration); animator.setInterrupted(mInterrupt); animator.setScaleInterpolator(mScaleInterpolator); animator.setTranslateInterpolator(mTranslateInterpolator); for (AnimatorUpdateListenerCompat listenerCompat : mAnimatorUpdateListenerCompats) { animator.addUpdateListener(listenerCompat); } for (AnimatorListenerCompat listenerCompat : mAnimatorListenerCompats) { animator.addListener(listenerCompat); } return animator; } }
[ "745453463@qq.com" ]
745453463@qq.com
11ba13bd2f4d73c97ba6ab37fdd3b341a4c17ab8
b94a6fec5eaa9db7b753da5b1aa75c4c2242864f
/app/src/main/java/com/espy/mps/adapters/FeedbackListAdapater.java
66371a861cb0651a2a0d71ff0c3fd452a550f25e
[]
no_license
git-espylabs/MpsIndia
dd2805cb02d7ee6e699bbb677a7d341fbfdad655
6e8f356c875531b4e8bc8caa5fe822b0fe359198
refs/heads/master
2023-04-06T07:12:12.721618
2021-04-14T14:28:01
2021-04-14T14:28:01
351,786,218
0
0
null
null
null
null
UTF-8
Java
false
false
2,796
java
package com.espy.mps.adapters; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.espy.mps.R; import com.espy.mps.models.FeedbackTrans; import com.espy.mps.models.LeadHistoryTrans; import com.espy.mps.ui.customviews.CustomTextView; import com.espy.mps.utils.CommonUtils; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; public class FeedbackListAdapater extends RecyclerView.Adapter<FeedbackListAdapater.ViewHolder> { Context context; ArrayList<FeedbackTrans> list; public FeedbackListAdapater(Context context, ArrayList<FeedbackTrans> list) { this.context = context; this.list = list; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item_feedback_list, parent, false); ViewHolder vh = new ViewHolder(v); return vh; } @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { FeedbackTrans model = list.get(position); holder.fid.setText("Feedback id: "+model.getLead_feedback_id()); holder.status.setText("Current Status: "+model.getLead_feedback_current_status()); holder.lid.setText("Lead Id: "+model.getLead_feedback_leadid()); holder.comment.setText("Remarkks: "+model.getLead_feedback_remarks()); holder.cName.setText("Customer Name: "+model.getLead_feedback_customer_id()); holder.acttivity_type.setText("Activity Type: "+model.getLead_feedback_activity_typeid()); holder.dateLead.setText("Feedback Added date: "+ CommonUtils.formatDate_yyyyMMddHHmmss(model.getLead_feedback_addeddate())); holder.mainLay.setOnClickListener(view -> { }); } @Override public int getItemCount() { return list.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.comment) TextView comment; @BindView(R.id.fid) TextView fid; @BindView(R.id.status) TextView status; @BindView(R.id.lid) TextView lid; @BindView(R.id.acttivity_type) TextView acttivity_type; @BindView(R.id.cName) TextView cName; @BindView(R.id.dateLead) TextView dateLead; @BindView(R.id.mainLay) LinearLayout mainLay; public ViewHolder(View v) { super(v); ButterKnife.bind(this, v); } } }
[ "jobsin.joseph@zcocorporation.com" ]
jobsin.joseph@zcocorporation.com
80453b0a9dde2cf1326809a071e2941087bbe4d3
d7bd0d89ed7b37c2021c22bee78f108bd882c679
/rft/ThrowsException.java
971507abedfefb92329db807c164122e0274c6da
[]
no_license
levinsibi/MyPrograms
d8dc8850af53a30e79e43565cdbe51e8fef63aa7
eb4fac7fac97da787367fe021cf297d058466fdc
refs/heads/master
2020-04-04T19:42:14.739115
2018-12-18T08:34:46
2018-12-18T08:34:46
156,217,639
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package rft; public class ThrowsException { void checkAge(int age)throws ArithmeticException{ int t=age/0; } public static void main(String args[]){ ThrowsException obj = new ThrowsException(); try { obj.checkAge(13); } catch(ArithmeticException ex) { System.out.println("End Of execution "+ex); } } }
[ "X163459@TRPRDK67HF1J-D.hrbinc.hrblock.net" ]
X163459@TRPRDK67HF1J-D.hrbinc.hrblock.net
bebb935ce3acc96fa3d4cd7530d44eeda3465acb
ca55adfb57a6cbae648390d956f75db1595aadc6
/employee-pojo/src/main/java/com/employee/vo/OrderDetailVO.java
d0d7e8d7766859438c63981737561b5445fe7f6a
[]
no_license
Tanlian118/employee-web
ef4dadcf2a356964182c81dc107c210871d5f794
5a6ff3e7ebb88812d115ff22542b384a39d40f1c
refs/heads/master
2020-03-28T18:49:48.417441
2018-09-27T16:28:14
2018-09-27T16:28:14
148,916,534
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
package com.employee.vo; import lombok.AccessLevel; import lombok.Data; import lombok.experimental.FieldDefaults; import java.util.List; /** * @author Tanlian * @create 2018-09-27 23:16 **/ @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class OrderDetailVO { /** * 用户信息 */ List<UserVO> userVOs; /** * 订单详情 */ List<EmployeeOrderVO> employeeOrderVOs; /** * 商品信息 */ List<ProductVO> productVOs; }
[ "Tanlian118@126.com" ]
Tanlian118@126.com
b225de3797df45d7743040b50f3b7535e3482946
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-ec2instanceconnect/src/main/java/com/amazonaws/services/ec2instanceconnect/package-info.java
1b6ce2954fba7d8ce595ac7ba8352ff3042af12f
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
840
java
/* * Copyright 2018-2023 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. */ /** * <p> * Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH public keys to EC2, providing * users a simple and secure way to connect to their instances. * </p> */ package com.amazonaws.services.ec2instanceconnect;
[ "" ]
d6b92f3c61fd6f66cb27ccc0ae24687ee1539642
01330bc13b3c9a7a84ad0d2a87d49a900b32e42f
/src/main/java/com/bootcamp/commons/enums/RegionType.java
4f9dacedc31cf33d80024bc3c6585ff8f8557aca
[]
no_license
zopapa/bootcamp.vbg.commons
deb51c88800577b0a4c27ea21fda5428f0c15101
8d4d3a50ae5926e0a2fb544b0cc284204c9de31b
refs/heads/master
2021-05-06T10:32:37.553494
2017-12-13T18:11:27
2017-12-13T18:11:27
114,133,705
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.bootcamp.commons.enums; import com.google.gson.annotations.SerializedName; /** * Created by darextossa on 11/28/17. */ public enum RegionType { @SerializedName("ville") VILLE, @SerializedName("pays") PAYS, @SerializedName("commune") COMMUNE, @SerializedName("departement") DEPARTEMENT; }
[ "mo.souley@gmail.com" ]
mo.souley@gmail.com
a5f8bd4644e5f3682e6e49d1ed641b5968d1d90f
c692b4cc3c74f169faae9e28dd692f8d1efd5d25
/nypp/src/com/qws/nypp/view/flowlayout/FlowLayout.java
e7df217f4ba570055871497d68b01db68d458a99
[]
no_license
ztaober/Android-Small-Mall
8e734f2a8e1295871859cde3de1d4bee8caf058a
a333fa024f99a3830fc4a06e2556360bae4a53dd
refs/heads/master
2020-04-06T03:33:42.836534
2016-09-27T09:15:47
2016-09-27T09:15:47
48,807,376
3
0
null
null
null
null
UTF-8
Java
false
false
6,044
java
package com.qws.nypp.view.flowlayout; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; public class FlowLayout extends ViewGroup { private static final String TAG = "FlowLayout"; protected List<List<View>> mAllViews = new ArrayList<List<View>>(); protected List<Integer> mLineHeight = new ArrayList<Integer>(); public FlowLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public FlowLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public FlowLayout(Context context) { this(context, null); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int sizeWidth = MeasureSpec.getSize(widthMeasureSpec); int modeWidth = MeasureSpec.getMode(widthMeasureSpec); int sizeHeight = MeasureSpec.getSize(heightMeasureSpec); int modeHeight = MeasureSpec.getMode(heightMeasureSpec); // wrap_content int width = 0; int height = 0; int lineWidth = 0; int lineHeight = 0; int cCount = getChildCount(); for (int i = 0; i < cCount; i++) { View child = getChildAt(i); if (child.getVisibility() == View.GONE) { if (i == cCount - 1) { width = Math.max(lineWidth, width); height += lineHeight; } continue; } measureChild(child, widthMeasureSpec, heightMeasureSpec); MarginLayoutParams lp = (MarginLayoutParams) child .getLayoutParams(); int childWidth = child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; int childHeight = child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin; if (lineWidth + childWidth > sizeWidth - getPaddingLeft() - getPaddingRight()) { width = Math.max(width, lineWidth); lineWidth = childWidth; height += lineHeight; lineHeight = childHeight; } else { lineWidth += childWidth; lineHeight = Math.max(lineHeight, childHeight); } if (i == cCount - 1) { width = Math.max(lineWidth, width); height += lineHeight; } } setMeasuredDimension( // modeWidth == MeasureSpec.EXACTLY ? sizeWidth : width + getPaddingLeft() + getPaddingRight(), modeHeight == MeasureSpec.EXACTLY ? sizeHeight : height + getPaddingTop() + getPaddingBottom()// ); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { mAllViews.clear(); mLineHeight.clear(); int width = getWidth(); int lineWidth = 0; int lineHeight = 0; List<View> lineViews = new ArrayList<View>(); int cCount = getChildCount(); for (int i = 0; i < cCount; i++) { View child = getChildAt(i); if (child.getVisibility() == View.GONE) continue; MarginLayoutParams lp = (MarginLayoutParams) child .getLayoutParams(); int childWidth = child.getMeasuredWidth(); int childHeight = child.getMeasuredHeight(); if (childWidth + lineWidth + lp.leftMargin + lp.rightMargin > width - getPaddingLeft() - getPaddingRight()) { mLineHeight.add(lineHeight); mAllViews.add(lineViews); lineWidth = 0; lineHeight = childHeight + lp.topMargin + lp.bottomMargin; lineViews = new ArrayList<View>(); } lineWidth += childWidth + lp.leftMargin + lp.rightMargin; lineHeight = Math.max(lineHeight, childHeight + lp.topMargin + lp.bottomMargin); lineViews.add(child); } mLineHeight.add(lineHeight); mAllViews.add(lineViews); int left = getPaddingLeft(); int top = getPaddingTop(); int lineNum = mAllViews.size(); for (int i = 0; i < lineNum; i++) { lineViews = mAllViews.get(i); lineHeight = mLineHeight.get(i); for (int j = 0; j < lineViews.size(); j++) { View child = lineViews.get(j); if (child.getVisibility() == View.GONE) { continue; } MarginLayoutParams lp = (MarginLayoutParams) child .getLayoutParams(); int lc = left + lp.leftMargin; int tc = top + lp.topMargin; int rc = lc + child.getMeasuredWidth(); int bc = tc + child.getMeasuredHeight(); child.layout(lc, tc, rc, bc); left += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; } left = getPaddingLeft(); top += lineHeight; } } @Override public LayoutParams generateLayoutParams(AttributeSet attrs) { return new MarginLayoutParams(getContext(), attrs); } @Override protected LayoutParams generateDefaultLayoutParams() { return new MarginLayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); } @Override protected LayoutParams generateLayoutParams(LayoutParams p) { return new MarginLayoutParams(p); } }
[ "zhangtao@coracle.com" ]
zhangtao@coracle.com
9b7fa94ba92328b40b3255fabbb50da4ccffc93a
e87a6cb6eccc7b7a235e328610688a4cbe1b2c43
/app/src/main/java/com/miuty/slowgit/data/model/Tree.java
5268dedbe2b33b994cf03a6b079d5fb436f62860
[]
no_license
PracticeAndroid/slowgit
e6b02909ceeacf74bf37ae22a62a1856ca130722
796c7d82934e2727b7d84aec01a919b677ef5d4d
refs/heads/master
2021-05-13T20:18:28.731112
2018-02-05T16:42:53
2018-02-05T16:42:53
116,909,471
4
0
null
null
null
null
UTF-8
Java
false
false
465
java
package com.miuty.slowgit.data.model; import com.google.gson.annotations.SerializedName; public class Tree { @SerializedName("sha") private String sha; @SerializedName("url") private String url; public String getSha() { return sha; } public void setSha(String sha) { this.sha = sha; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
[ "trandu93@outlook.com" ]
trandu93@outlook.com
9d03ed9cfd14e3889b28381166b60a35166e0737
1b85579854efa3c337b331ad5fffaa137de2fee9
/src/main/java/com/h3b/investment/gateway/security/JwtTokenFilterConfigurer.java
195719c09cef1bf95008b1b46eacd0725653df78
[]
no_license
hhigute/spring-cloud-gateway-zuul-eureka-jwt
699b6a3938c05a3e3b8f75f0ce9839bbc265de56
d31ec73acdc634a65d56e6ca973e3a182f59a8bd
refs/heads/master
2021-05-17T19:44:22.292980
2020-03-29T03:24:29
2020-03-29T03:24:29
250,943,316
0
0
null
null
null
null
UTF-8
Java
false
false
914
java
package com.h3b.investment.gateway.security; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JwtTokenFilterConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { private JwtTokenProvider jwtTokenProvider; public JwtTokenFilterConfigurer(JwtTokenProvider jwtTokenProvider) { this.jwtTokenProvider = jwtTokenProvider; } @Override public void configure(HttpSecurity http) throws Exception { JwtTokenFilter customFilter = new JwtTokenFilter(jwtTokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
[ "helton.higute@gmail.com" ]
helton.higute@gmail.com
6bc5296366a880142b6ae197b59b0e4140955ed7
b2cb6af6a76f257f0d5ce4fcc90cf51a4287970f
/EvolutionTool/src/org/evolution/controller/SymbolicRegressionProperty.java
7a3a83ece340a3c414a47af4b0ec4ed1bcaa995e
[]
no_license
Zigi34/EvolTools
7d579f5b1d2230a05d6c8560402dd25d91d6a46d
46c5937d5566d889a261a178b6d119db14b372fc
refs/heads/master
2016-08-12T08:56:46.834458
2016-04-30T18:38:31
2016-04-30T18:38:31
43,998,445
0
0
null
null
null
null
UTF-8
Java
false
false
7,058
java
package org.evolution.controller; import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.List; import org.apache.log4j.Logger; import org.evolution.EvolutionTool; import org.evolution.model.ProblemModel; import org.evolution.problem.RegressionProblem; import org.evolution.services.ProblemService; import org.evolution.solution.type.CosFunction; import org.evolution.solution.type.DivideFunction; import org.evolution.solution.type.GPFenotype; import org.evolution.solution.type.MultiplyFunction; import org.evolution.solution.type.NumericConstant; import org.evolution.solution.type.RangedPowerFunction; import org.evolution.solution.type.SinFunction; import org.evolution.solution.type.SubtractionFunction; import org.evolution.solution.type.SumFunction; import org.evolution.util.Utils; import javafx.application.Platform; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.control.Button; import javafx.scene.control.ChoiceBox; import javafx.scene.control.Label; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.TextField; import javafx.scene.layout.AnchorPane; import javafx.stage.FileChooser; import javafx.util.Callback; public class SymbolicRegressionProperty extends AnchorPane { private static final Logger LOG = Logger.getLogger(SymbolicRegressionProperty.class); private static List<GPFenotype> allFenotype = new LinkedList<GPFenotype>(); @FXML private ChoiceBox<GPFenotype> fenotypeCombo; @FXML private AnchorPane fenotypeProperty; @FXML private ListView<GPFenotype> selected; @FXML private TextField datasetPath; @FXML private Button fileButton; @FXML private Button createButton; @FXML private Button removeButton; @FXML private TextField minValue; @FXML private TextField maxValue; @FXML private Label minValueLabel; @FXML private Label maxValueLabel; private FenotypeProperty selectedFenotype; private FileChooser fileChooser = new FileChooser(); static { allFenotype.add(new SumFunction()); allFenotype.add(new SubtractionFunction()); allFenotype.add(new MultiplyFunction()); allFenotype.add(new DivideFunction()); allFenotype.add(new SinFunction()); allFenotype.add(new CosFunction()); allFenotype.add(new NumericConstant()); allFenotype.add(new RangedPowerFunction()); } public SymbolicRegressionProperty() { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/gui/SymbolicRegressionProperty.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(this); try { fxmlLoader.load(); } catch (IOException exception) { LOG.error(exception); } initialize(); } /** * Třída reprezentující zobrazení fenotypů * * @author Zdeněk Gold * */ class FenotypeCell extends ListCell<GPFenotype> { @Override protected void updateItem(GPFenotype item, boolean empty) { super.updateItem(item, empty); if (empty || item == null) { setText(null); setGraphic(null); } else { setText(item.getName()); } } } private void initialize() { fileChooser.setTitle("Vyber soubor"); ProblemModel model = ProblemService.getSelected(); selected.getItems().clear(); if (model != null && model.getProblem() instanceof RegressionProblem) { RegressionProblem problem = (RegressionProblem) model.getProblem(); List<GPFenotype> problemFenotypes = problem.getFenotypes(); // inicializace tabulky fenotypu podle problemu for (GPFenotype item : allFenotype) { Object obj = Utils.getInstanceOfClass(item.getClass(), problemFenotypes); if (obj == null) { } else { selected.getItems().add(item); } } // seznam použitých elementů selected.setCellFactory(new Callback<ListView<GPFenotype>, ListCell<GPFenotype>>() { @Override public ListCell<GPFenotype> call(ListView<GPFenotype> param) { return new FenotypeCell(); } }); // tlačítko přidat createButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (selectedFenotype != null) { GPFenotype fenotype = selectedFenotype.generateFenotype(); LOG.info("Přidávám " + fenotype); selected.getItems().add(fenotype); problem.addFenotype(fenotype); } } }); // tlačítko odebrat removeButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { if (selected.getSelectionModel().getSelectedItem() != null) { GPFenotype fenotype = selected.getSelectionModel().getSelectedItem(); LOG.info("Odebírám " + fenotype); selected.getItems().remove(fenotype); problem.removeFenotype(fenotype); } } }); // vyber fenotype fenotypeCombo.getItems().addAll(allFenotype); fenotypeCombo.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<GPFenotype>() { @Override public void changed(ObservableValue<? extends GPFenotype> observable, GPFenotype oldValue, GPFenotype newValue) { LOG.info("vybráno " + newValue); fenotypeProperty.getChildren().clear(); selectedFenotype = new FenotypeProperty(newValue); fenotypeProperty.getChildren().add(selectedFenotype); } }); fenotypeCombo.getSelectionModel().selectFirst(); // cesta k datasetu datasetPath.setText(problem.getDatasetPath()); // výběr datasetu fileButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { File file = fileChooser.showOpenDialog(EvolutionTool.getStage()); if (file.exists()) { problem.setDatasetPath(file.toString()); datasetPath.setText(file.toString()); } } }); // nastavení minimální a maximální hodnoty minValueLabel.setText("Minimální hodnota"); maxValueLabel.setText("Maximální hodnota"); minValue.setText(String.valueOf(problem.getMinFunctionValue())); maxValue.setText(String.valueOf(problem.getMaxFunctionValue())); minValue.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { Platform.runLater(new Runnable() { @Override public void run() { try { problem.setMinFunctionValue(Double.parseDouble(newValue)); } catch (Exception e) { } } }); } }); maxValue.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { Platform.runLater(new Runnable() { @Override public void run() { try { problem.setMaxFunctionValue(Double.parseDouble(newValue)); } catch (Exception e) { } } }); } }); } } }
[ "zigisps@gmail.com" ]
zigisps@gmail.com
c5e2066273eb8b04ede172224cb34273c9157167
660e2cdac928dc355bd32f6ad0d9571a478638d0
/src/main/java/net/pl3x/bukkit/discord4bukkit/listener/SuperVanishListener.java
6f1ab574f99e3830f1d9767ee5643d6357377f81
[]
no_license
CyberFlameGO/Discord4Bukkit
d26b1f5b4e0f99c5bbadefee07e34657a43f447d
923923971f2efb96d9ee1dc004c674738657cbef
refs/heads/master
2022-04-14T01:26:13.136557
2020-03-27T03:32:35
2020-03-27T03:32:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,077
java
package net.pl3x.bukkit.discord4bukkit.listener; import de.myzelyam.api.vanish.PlayerHideEvent; import de.myzelyam.api.vanish.PlayerShowEvent; import net.pl3x.bukkit.discord4bukkit.D4BPlugin; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; public class SuperVanishListener implements Listener { private final D4BPlugin plugin; public SuperVanishListener(D4BPlugin plugin) { this.plugin = plugin; } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onVanish(PlayerHideEvent event) { plugin.getBot().sendMessageToDiscord(":heavy_minus_sign: **{player} left the game**" .replace("{player}", event.getPlayer().getName())); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onUnvanish(PlayerShowEvent event) { plugin.getBot().sendMessageToDiscord(":heavy_plus_sign: **{player} joined the game**" .replace("{player}", event.getPlayer().getName())); } }
[ "blake.galbreath@gmail.com" ]
blake.galbreath@gmail.com
0265a88e407684fc43c0f37c232947829d8f2c89
9f1f7239e8ab302f42b184ca2d9ed0900af66cd0
/library/src/main/java/org/scilab/forge/jlatexmath/core/TeXFormula.java
5d90fc611e0c913d287bd497a5c3cdd66d05c067
[]
no_license
tangqianfeng007/html_textview
b1cb579f973eefee32d7d31a629bdb967bde0e8c
a6947e5d4554c859e4780641f43b3dde1efff6af
refs/heads/master
2020-04-11T07:38:15.500480
2018-12-13T10:03:27
2018-12-13T10:03:27
161,617,430
1
0
null
null
null
null
UTF-8
Java
false
false
33,911
java
/* TeXFormula.java * ========================================================================= * This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net * * Copyright (C) 2004-2007 Universiteit Gent * Copyright (C) 2009 DENIZET Calixte * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * A copy of the GNU General Public License can be found in the file * LICENSE.txt provided with the source distribution of this program (see * the META-INF directory in the source jar). This license can also be * found on the GNU website at http://www.gnu.org/licenses/gpl.html. * * If you did not receive a copy of the GNU General Public License along * with this program, contact the lead developer, or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ /* Modified by Calixte Denizet */ package org.scilab.forge.jlatexmath.core; import android.annotation.SuppressLint; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.util.TypedValue; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.lang.Character.UnicodeBlock; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; /** * Represents a logical mathematical formula that will be displayed (by creating * a {@link TeXIcon} from it and painting it) using algorithms that are based on * the TeX algorithms. * <p> * These formula's can be built using the built-in primitive TeX parser (methods * with String arguments) or using other TeXFormula objects. Most methods have * (an) equivalent(s) where one or more TeXFormula arguments are replaced with * String arguments. These are just shorter notations, because all they do is * parse the string(s) to TeXFormula's and call an equivalent method with (a) * TeXFormula argument(s). Most methods also come in 2 variants. One kind will * use this TeXFormula to build another mathematical construction and then * change this object to represent the newly build construction. The other kind * will only use other TeXFormula's (or parse strings), build a mathematical * construction with them and insert this newly build construction at the end of * this TeXFormula. Because all the provided methods return a pointer to this * (modified) TeXFormula (except for the createTeXIcon method that returns a * TeXIcon pointer), method chaining is also possible. * <p> * <b> Important: All the provided methods modify this TeXFormula object, but * all the TeXFormula arguments of these methods will remain unchanged and * independent of this TeXFormula object!</b> */ public class TeXFormula { public static final String VERSION = "1.0.3"; public static final int SERIF = 0; public static final int SANSSERIF = 1; public static final int BOLD = 2; public static final int ITALIC = 4; public static final int ROMAN = 8; public static final int TYPEWRITER = 16; // table for putting delimiters over and under formula's, // indexed by constants from "TeXConstants" private static final String[][] delimiterNames = { { "lbrace", "rbrace" }, { "lsqbrack", "rsqbrack" }, { "lbrack", "rbrack" }, { "downarrow", "downarrow" }, { "uparrow", "uparrow" }, { "updownarrow", "updownarrow" }, { "Downarrow", "Downarrow" }, { "Uparrow", "Uparrow" }, { "Updownarrow", "Updownarrow" }, { "vert", "vert" }, { "Vert", "Vert" } }; // point-to-pixel conversion public static float PIXELS_PER_POINT = 1f; // used as second index in "delimiterNames" table (over or under) private static final int OVER_DEL = 0; private static final int UNDER_DEL = 1; // for comparing floats with 0 protected static final float PREC = 0.0000001f; // predefined TeXFormula's public static Map<String, TeXFormula> predefinedTeXFormulas = new HashMap<String, TeXFormula>( 150); public static Map<String, String> predefinedTeXFormulasAsString = new HashMap<String, String>( 150); // character-to-symbol and character-to-delimiter mappings public static String[] symbolMappings = new String[65536]; public static String[] symbolTextMappings = new String[65536]; public static String[] symbolFormulaMappings = new String[65536]; public static Map<UnicodeBlock, FontInfos> externalFontMap = new HashMap<UnicodeBlock, FontInfos>(); public List<MiddleAtom> middle = new LinkedList<MiddleAtom>(); protected Map<String, String> jlmXMLMap; private TeXParser parser; static { // character-to-symbol and character-to-delimiter mappings TeXFormulaSettingsParser parser = null; try { parser = new TeXFormulaSettingsParser(); } catch (ResourceParseException | IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } parser.parseSymbolMappings(symbolMappings, symbolTextMappings); new PredefinedCommands(); new PredefinedTeXFormulas(); new PredefMacros(); parser.parseSymbolToFormulaMappings(symbolFormulaMappings, symbolTextMappings); try { DefaultTeXFont .registerAlphabet((AlphabetRegistration) Class .forName( "org.scilab.forge.jlatexmath.cyrillic.CyrillicRegistration") .newInstance()); DefaultTeXFont .registerAlphabet((AlphabetRegistration) Class .forName( "org.scilab.forge.jlatexmath.greek.GreekRegistration") .newInstance()); } catch (Exception e) { e.printStackTrace(); } setDefaultDPI(); } public static void addSymbolMappings(String file) throws ResourceParseException, IOException { FileInputStream in; try { in = new FileInputStream(file); } catch (FileNotFoundException e) { throw new ResourceParseException(file, e); } addSymbolMappings(in, file); } public static void addSymbolMappings(InputStream in, String name) throws ResourceParseException, IOException { TeXFormulaSettingsParser tfsp = new TeXFormulaSettingsParser(in, name); tfsp.parseSymbolMappings(symbolMappings, symbolTextMappings); tfsp.parseSymbolToFormulaMappings(symbolFormulaMappings, symbolTextMappings); } public static boolean isRegisteredBlock(UnicodeBlock block) { return externalFontMap.get(block) != null; } public static FontInfos getExternalFont(UnicodeBlock block) { FontInfos infos = externalFontMap.get(block); if (infos == null) { infos = new FontInfos("SansSerif", "Serif"); externalFontMap.put(block, infos); } return infos; } public static void registerExternalFont(UnicodeBlock block, String sansserif, String serif) { if (sansserif == null && serif == null) { externalFontMap.remove(block); return; } externalFontMap.put(block, new FontInfos(sansserif, serif)); if (block.equals(UnicodeBlock.BASIC_LATIN)) { predefinedTeXFormulas.clear(); } } public static void registerExternalFont(UnicodeBlock block, String fontName) { registerExternalFont(block, fontName, fontName); } /** * Set the DPI of target * * @param dpi * the target DPI */ public static void setDPITarget(float dpi) { PIXELS_PER_POINT = dpi / 72f; } /** * Set the default target DPI to the screen dpi (only if we're in * non-headless mode) */ public static void setDefaultDPI() { setDPITarget(AjLatexMath.getContext().getResources().getDisplayMetrics().xdpi); } // the root atom of the "atom tree" that represents the formula public Atom root = null; // the current text style public String textStyle = null; public boolean isColored = false; /** * Creates an empty TeXFormula. * */ public TeXFormula() { parser = new TeXParser("", this, false); } /** * Creates a new TeXFormula by parsing the given string (using a primitive * TeX parser). * * @param s * the string to be parsed * @throws ParseException * if the string could not be parsed correctly */ public TeXFormula(String s, Map<String, String> map) throws ParseException { this.jlmXMLMap = map; this.textStyle = textStyle; parser = new TeXParser(s, this); parser.parse(); } /** * Creates a new TeXFormula by parsing the given string (using a primitive * TeX parser). * * @param s * the string to be parsed * @throws ParseException * if the string could not be parsed correctly */ public TeXFormula(String s) throws ParseException { this(s, (String) null); } public TeXFormula(String s, boolean firstpass) throws ParseException { this.textStyle = null; parser = new TeXParser(s, this, firstpass); parser.parse(); } /* * Creates a TeXFormula by parsing the given string in the given text style. * Used when a text style command was found in the parse string. */ public TeXFormula(String s, String textStyle) throws ParseException { this.textStyle = textStyle; parser = new TeXParser(s, this); parser.parse(); } public TeXFormula(String s, String textStyle, boolean firstpass, boolean space) throws ParseException { this.textStyle = textStyle; parser = new TeXParser(s, this, firstpass, space); parser.parse(); } /** * Creates a new TeXFormula that is a copy of the given TeXFormula. * <p> * <b>Both TeXFormula's are independent of one another!</b> * * @param f * the formula to be copied */ public TeXFormula(TeXFormula f) { if (f != null) { addImpl(f); } } /** * Creates an empty TeXFormula. * */ protected TeXFormula(TeXParser tp) { this.jlmXMLMap = tp.formula.jlmXMLMap; parser = new TeXParser(tp.getIsPartial(), "", this, false); } /** * Creates a new TeXFormula by parsing the given string (using a primitive * TeX parser). * * @param s * the string to be parsed * @throws ParseException * if the string could not be parsed correctly */ protected TeXFormula(TeXParser tp, String s) throws ParseException { this(tp, s, null); } protected TeXFormula(TeXParser tp, String s, boolean firstpass) throws ParseException { this.textStyle = null; this.jlmXMLMap = tp.formula.jlmXMLMap; boolean isPartial = tp.getIsPartial(); parser = new TeXParser(isPartial, s, this, firstpass); if (isPartial) { try { parser.parse(); } catch (Exception e) { } } else { parser.parse(); } } /* * Creates a TeXFormula by parsing the given string in the given text style. * Used when a text style command was found in the parse string. */ protected TeXFormula(TeXParser tp, String s, String textStyle) throws ParseException { this.textStyle = textStyle; this.jlmXMLMap = tp.formula.jlmXMLMap; boolean isPartial = tp.getIsPartial(); parser = new TeXParser(isPartial, s, this); if (isPartial) { try { parser.parse(); } catch (Exception e) { if (root == null) { root = new EmptyAtom(); } } } else { parser.parse(); } } protected TeXFormula(TeXParser tp, String s, String textStyle, boolean firstpass, boolean space) throws ParseException { this.textStyle = textStyle; this.jlmXMLMap = tp.formula.jlmXMLMap; boolean isPartial = tp.getIsPartial(); parser = new TeXParser(isPartial, s, this, firstpass, space); if (isPartial) { try { parser.parse(); } catch (Exception e) { if (root == null) { root = new EmptyAtom(); } } } else { parser.parse(); } } public static TeXFormula getAsText(String text, int alignment) throws ParseException { TeXFormula formula = new TeXFormula(); if (text == null || "".equals(text)) { formula.add(new EmptyAtom()); return formula; } String[] arr = text.split("\n|\\\\\\\\|\\\\cr"); ArrayOfAtoms atoms = new ArrayOfAtoms(); for (String s : arr) { TeXFormula f = new TeXFormula(s, "mathnormal", true, false); atoms.add(new RomanAtom(f.root)); atoms.addRow(); } atoms.checkDimensions(); formula.add(new MatrixAtom(false, atoms, MatrixAtom.ARRAY, alignment)); return formula; } /** * @param a * formula * @return a partial TeXFormula containing the valid part of formula */ public static TeXFormula getPartialTeXFormula(String formula) { TeXFormula f = new TeXFormula(); if (formula == null) { f.add(new EmptyAtom()); return f; } TeXParser parser = new TeXParser(true, formula, f); try { parser.parse(); } catch (Exception e) { if (f.root == null) { f.root = new EmptyAtom(); } } return f; } /** * @param b * true if the fonts should be registered (Java 1.6 only) to be * used with FOP. */ public static void registerFonts(boolean b) { DefaultTeXFontParser.registerFonts(b); } /** * Change the text of the TeXFormula and regenerate the root * * @param ltx * the latex formula */ public void setLaTeX(String ltx) throws ParseException { parser.reset(ltx); if (ltx != null && ltx.length() != 0) parser.parse(); } /** * Inserts an atom at the end of the current formula */ public TeXFormula add(Atom el) { if (el != null) { if (el instanceof MiddleAtom) middle.add((MiddleAtom) el); if (root == null) { root = el; } else { if (!(root instanceof RowAtom)) { root = new RowAtom(root); } ((RowAtom) root).add(el); if (el instanceof TypedAtom) { TypedAtom ta = (TypedAtom) el; int rtype = ta.getRightType(); if (rtype == TeXConstants.TYPE_BINARY_OPERATOR || rtype == TeXConstants.TYPE_RELATION) { ((RowAtom) root).add(new BreakMarkAtom()); } } } } return this; } /** * Parses the given string and inserts the resulting formula at the end of * the current TeXFormula. * * @param s * the string to be parsed and inserted * @throws ParseException * if the string could not be parsed correctly * @return the modified TeXFormula */ public TeXFormula add(String s) throws ParseException { if (s != null && s.length() != 0) { // reset parsing variables textStyle = null; // parse and add the string add(new TeXFormula(s)); } return this; } public TeXFormula append(String s) throws ParseException { return append(false, s); } public TeXFormula append(boolean isPartial, String s) throws ParseException { if (s != null && s.length() != 0) { TeXParser tp = new TeXParser(isPartial, s, this); tp.parse(); } return this; } /** * Inserts the given TeXFormula at the end of the current TeXFormula. * * @param f * the TeXFormula to be inserted * @return the modified TeXFormula */ public TeXFormula add(TeXFormula f) { addImpl(f); return this; } private void addImpl(TeXFormula f) { if (f.root != null) { // special copy-treatment for Mrow as a root!! if (f.root instanceof RowAtom) add(new RowAtom(f.root)); else add(f.root); } } public void setLookAtLastAtom(boolean b) { if (root instanceof RowAtom) ((RowAtom) root).lookAtLastAtom = b; } public boolean getLookAtLastAtom() { if (root instanceof RowAtom) return ((RowAtom) root).lookAtLastAtom; return false; } /** * Centers the current TeXformula vertically on the axis (defined by the * parameter "axisheight" in the resource "DefaultTeXFont.xml". * * @return the modified TeXFormula */ public TeXFormula centerOnAxis() { root = new VCenteredAtom(root); return this; } public static void addPredefinedTeXFormula(InputStream xmlFile) throws ResourceParseException, IOException { new PredefinedTeXFormulaParser(xmlFile, "TeXFormula") .parse(predefinedTeXFormulas); } public static void addPredefinedCommands(InputStream xmlFile) throws ResourceParseException, IOException { new PredefinedTeXFormulaParser(xmlFile, "Command") .parse(MacroInfo.Commands); } /** * Inserts a strut box (whitespace) with the given width, height and depth * (in the given unit) at the end of the current TeXFormula. * * @param unit * a unit constant (from {@link TeXConstants}) * @param width * the width of the strut box * @param height * the height of the strut box * @param depth * the depth of the strut box * @return the modified TeXFormula * @throws InvalidUnitException * if the given integer value does not represent a valid unit */ public TeXFormula addStrut(int unit, float width, float height, float depth) throws InvalidUnitException { return add(new SpaceAtom(unit, width, height, depth)); } /** * Inserts a strut box (whitespace) with the given width, height and depth * (in the given unit) at the end of the current TeXFormula. * * @param type * thinmuskip, medmuskip or thickmuskip (from * {@link TeXConstants}) * @return the modified TeXFormula * @throws InvalidUnitException * if the given integer value does not represent a valid unit */ public TeXFormula addStrut(int type) throws InvalidUnitException { return add(new SpaceAtom(type)); } /** * Inserts a strut box (whitespace) with the given width (in widthUnits), * height (in heightUnits) and depth (in depthUnits) at the end of the * current TeXFormula. * * @param widthUnit * a unit constant used for the width (from {@link TeXConstants}) * @param width * the width of the strut box * @param heightUnit * a unit constant used for the height (from TeXConstants) * @param height * the height of the strut box * @param depthUnit * a unit constant used for the depth (from TeXConstants) * @param depth * the depth of the strut box * @return the modified TeXFormula * @throws InvalidUnitException * if the given integer value does not represent a valid unit */ public TeXFormula addStrut(int widthUnit, float width, int heightUnit, float height, int depthUnit, float depth) throws InvalidUnitException { return add(new SpaceAtom(widthUnit, width, heightUnit, height, depthUnit, depth)); } /* * Convert this TeXFormula into a box, starting form the given style */ private Box createBox(TeXEnvironment style) { if (root == null) return new StrutBox(0, 0, 0, 0); else return root.createBox(style); } private DefaultTeXFont createFont(float size, int type) { DefaultTeXFont dtf = new DefaultTeXFont(size); if (type == 0) { dtf.setSs(false); } if ((type & ROMAN) != 0) { dtf.setRoman(true); } if ((type & TYPEWRITER) != 0) { dtf.setTt(true); } if ((type & SANSSERIF) != 0) { dtf.setSs(true); } if ((type & ITALIC) != 0) { dtf.setIt(true); } if ((type & BOLD) != 0) { dtf.setBold(true); } return dtf; } /** * Apply the Builder pattern instead of using the createTeXIcon(...) * factories * * @author Felix Natter * */ public class TeXIconBuilder { private Integer style; private Float size; private Integer type; private Integer fgcolor; private boolean trueValues = false; private Integer widthUnit; private Float textWidth; private Integer align; private boolean isMaxWidth = false; private Integer interLineUnit; private Float interLineSpacing; /** * Specify the style for rendering the given TeXFormula * * @param style * the style * @return the builder, used for chaining */ public TeXIconBuilder setStyle(final int style) { this.style = style; return this; } /** * Specify the font size for rendering the given TeXFormula * * @param size * the size * @return the builder, used for chaining */ public TeXIconBuilder setSize(final float size) { this.size = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, size / PIXELS_PER_POINT, AjLatexMath.getContext().getResources().getDisplayMetrics()); return this; } /** * Specify the font type for rendering the given TeXFormula * * @param type * the font type * @return the builder, used for chaining */ public TeXIconBuilder setType(final int type) { this.type = type; return this; } /** * Specify the background color for rendering the given TeXFormula * * @param fgcolor * the foreground color * @return the builder, used for chaining */ public TeXIconBuilder setFGColor(final Integer fgcolor) { this.fgcolor = fgcolor; return this; } /** * Specify the "true values" parameter for rendering the given * TeXFormula * * @param trueValues * the "true values" value * @return the builder, used for chaining */ public TeXIconBuilder setTrueValues(final boolean trueValues) { this.trueValues = trueValues; return this; } /** * Specify the width of the formula (may be exact or maximum width, see * {@link #setIsMaxWidth(boolean)}) * * @param widthUnit * the width unit * @param textWidth * the width * @param align * the alignment * @return the builder, used for chaining */ public TeXIconBuilder setWidth(final int widthUnit, final float textWidth, final int align) { this.widthUnit = widthUnit; this.textWidth = textWidth; this.align = align; trueValues = true; // TODO: is this necessary? return this; } /** * Specifies whether the width is the exact or the maximum width * * @param isMaxWidth * whether the width is a maximum width * @return the builder, used for chaining */ public TeXIconBuilder setIsMaxWidth(final boolean isMaxWidth) { if (widthUnit == null) { throw new IllegalStateException( "Cannot set 'isMaxWidth' without having specified a width!"); } if (isMaxWidth) { // NOTE: Currently isMaxWidth==true does not work with // ALIGN_CENTER or ALIGN_RIGHT (see HorizontalBox ctor) // The case (1) we don't support by setting align := ALIGN_LEFT // here is this: // \text{hello world\\hello} with align=ALIGN_CENTER (but forced // to ALIGN_LEFT) and isMaxWidth==true results in: // [hello world] // [hello ] // and NOT: // [hello world] // [ hello ] // However, this case (2) is currently not supported anyway // (ALIGN_CENTER with isMaxWidth==false): // [ hello world ] // [ hello ] // and NOT: // [ hello world ] // [ hello ] // => until (2) is solved, we stick with the hack to set align // := ALIGN_LEFT! this.align = TeXConstants.ALIGN_LEFT; } this.isMaxWidth = isMaxWidth; return this; } /** * Specify the inter line spacing unit and value. NOTE: this is required * for automatic linebreaks to work! * * @param interLineUnit * the unit * @param interLineSpacing * the value * @return the builder, used for chaining */ public TeXIconBuilder setInterLineSpacing(final int interLineUnit, final float interLineSpacing) { if (widthUnit == null) { throw new IllegalStateException( "Cannot set inter line spacing without having specified a width!"); } this.interLineUnit = interLineUnit; this.interLineSpacing = interLineSpacing; return this; } /** * Create a TeXIcon from the information gathered by the (chained) * setXXX() methods. (see Builder pattern) * * @return the TeXIcon */ public TeXIcon build() { if (style == null) { throw new IllegalStateException( "A style is required. Use setStyle()"); } if (size == null) { throw new IllegalStateException( "A size is required. Use setStyle()"); } DefaultTeXFont font = (type == null) ? new DefaultTeXFont(size) : createFont(size, type); TeXEnvironment te; if (widthUnit != null) { te = new TeXEnvironment(style, font, widthUnit, textWidth); } else { te = new TeXEnvironment(style, font); } if (interLineUnit != null) { te.setInterline(interLineUnit, interLineSpacing); } Box box = createBox(te); TeXIcon ti; if (widthUnit != null) { HorizontalBox hb; if (interLineUnit != null) { float il = interLineSpacing * SpaceAtom.getFactor(interLineUnit, te); Box b = BreakFormula.split(box, te.getTextwidth(), il); hb = new HorizontalBox(b, isMaxWidth ? b.getWidth() : te.getTextwidth(), align); } else { hb = new HorizontalBox(box, isMaxWidth ? box.getWidth() : te.getTextwidth(), align); } ti = new TeXIcon(hb, size, trueValues); } else { ti = new TeXIcon(box, size, trueValues); } if (fgcolor != null) { ti.setForeground(fgcolor); } ti.isColored = te.isColored; return ti; } } /** * Creates a TeXIcon from this TeXFormula using the default TeXFont in the * given point size and starting from the given TeX style. If the given * integer value does not represent a valid TeX style, the default style * TeXConstants.STYLE_DISPLAY will be used. * * @param style * a TeX style constant (from {@link TeXConstants}) to start from * @param size * the default TeXFont's point size * @return the created TeXIcon */ public TeXIcon createTeXIcon(int style, float size) { return new TeXIconBuilder().setStyle(style).setSize(size).build(); } public TeXIcon createTeXIcon(int style, float size, int type) { return new TeXIconBuilder().setStyle(style).setSize(size).setType(type) .build(); } public TeXIcon createTeXIcon(int style, float size, int type, Integer fgcolor) { return new TeXIconBuilder().setStyle(style).setSize(size).setType(type) .setFGColor(fgcolor).build(); } public TeXIcon createTeXIcon(int style, float size, boolean trueValues) { return new TeXIconBuilder().setStyle(style).setSize(size) .setTrueValues(trueValues).build(); } public TeXIcon createTeXIcon(int style, float size, int widthUnit, float textwidth, int align) { return createTeXIcon(style, size, 0, widthUnit, textwidth, align); } public TeXIcon createTeXIcon(int style, float size, int type, int widthUnit, float textwidth, int align) { return new TeXIconBuilder().setStyle(style).setSize(size).setType(type) .setWidth(widthUnit, textwidth, align).build(); } public TeXIcon createTeXIcon(int style, float size, int widthUnit, float textwidth, int align, int interlineUnit, float interline) { return createTeXIcon(style, size, 0, widthUnit, textwidth, align, interlineUnit, interline); } public TeXIcon createTeXIcon(int style, float size, int type, int widthUnit, float textwidth, int align, int interlineUnit, float interline) { return new TeXIconBuilder().setStyle(style).setSize(size).setType(type) .setWidth(widthUnit, textwidth, align) .setInterLineSpacing(interlineUnit, interline).build(); } public void createImage(Bitmap.CompressFormat format, int style, float size, String out, Integer bg, Integer fg, boolean transparency) throws IOException { TeXIcon icon = createTeXIcon(style, size); icon.setInsets(new Insets(1, 1, 1, 1)); int w = icon.getIconWidth(), h = icon.getIconHeight(); Bitmap image = Bitmap.createBitmap(w, h, Config.ARGB_8888); Canvas g2 = new Canvas(image); if (bg != null) { Paint st = new Paint(); st.setStyle(Style.FILL_AND_STROKE); st.setColor(bg); g2.drawRect(0, 0, w, h, st); } icon.setForeground(fg == null ? Color.BLACK : fg); icon.paintIcon(g2, 0, 0); File file = new File(out); FileOutputStream imout = new FileOutputStream(file); image.compress(format, 90, imout); imout.flush(); imout.close(); } public void createPNG(int style, float size, String out, Integer bg, Integer fg) throws IOException { createImage(Bitmap.CompressFormat.PNG, style, size, out, bg, fg, bg == null); } @SuppressLint("NewApi") public void createWEBP(int style, float size, String out, Integer bg, Integer fg) throws IOException { createImage(Bitmap.CompressFormat.WEBP, style, size, out, bg, fg, bg == null); } public void createJPEG(int style, float size, String out, Integer bg, Integer fg) throws IOException { createImage(Bitmap.CompressFormat.JPEG, style, size, out, bg, fg, false); } /** * @param formula * the formula * @param style * the style * @param size * the size * @param transparency * , if true the background is transparent * @return the generated image */ public static Bitmap createBufferedImage(String formula, int style, float size, Integer fg, Integer bg) throws ParseException { TeXFormula f = new TeXFormula(formula); TeXIcon icon = f.createTeXIcon(style, size); icon.setInsets(new Insets(2, 2, 2, 2)); int w = icon.getIconWidth(), h = icon.getIconHeight(); Bitmap image = Bitmap.createBitmap(w, h, Config.ARGB_8888); Canvas g2 = new Canvas(image); if (bg != null) { Paint st = new Paint(); st.setStyle(Style.FILL_AND_STROKE); st.setColor(bg); g2.drawRect(0, 0, w, h, st); } icon.setForeground(fg == null ? Color.BLACK : fg); icon.paintIcon(g2, 0, 0); return image; } /** * @param formula * the formula * @param style * the style * @param size * the size * @param transparency * , if true the background is transparent * @return the generated image */ public Bitmap createBufferedImage(int style, float size, Integer fg, Integer bg) throws ParseException { TeXIcon icon = createTeXIcon(style, size); icon.setInsets(new Insets(2, 2, 2, 2)); int w = icon.getIconWidth(), h = icon.getIconHeight(); Bitmap image = Bitmap.createBitmap(w, h, Config.ARGB_8888); Canvas g2 = new Canvas(image); if (bg != null) { Paint st = new Paint(); st.setStyle(Style.FILL_AND_STROKE); st.setColor(bg); g2.drawRect(0, 0, w, h, st); } icon.setForeground(fg == null ? Color.BLACK : fg); icon.paintIcon(g2, 0, 0); return image; } public void setDEBUG(boolean b) { Box.DEBUG = b; } /** * Changes the background color of the <i>current</i> TeXFormula into the * given color. By default, a TeXFormula has no background color, it's * transparent. The backgrounds of subformula's will be painted on top of * the background of the whole formula! Any changes that will be made to * this TeXFormula after this background color was set, will have the * default background color (unless it will also be changed into another * color afterwards)! * * @param c * the desired background color for the <i>current</i> TeXFormula * @return the modified TeXFormula */ public TeXFormula setBackground(Integer c) { if (c != null) { if (root instanceof ColorAtom) root = new ColorAtom(c, null, (ColorAtom) root); else root = new ColorAtom(root, c, null); } return this; } /** * Changes the (foreground) color of the <i>current</i> TeXFormula into the * given color. By default, the foreground color of a TeXFormula is the * foreground color of the component on which the TeXIcon (created from this * TeXFormula) will be painted. The color of subformula's overrides the * color of the whole formula. Any changes that will be made to this * TeXFormula after this color was set, will be painted in the default color * (unless the color will also be changed afterwards into another color)! * * @param c * the desired foreground color for the <i>current</i> TeXFormula * @return the modified TeXFormula */ public TeXFormula setColor(Integer c) { if (c != null) { if (root instanceof ColorAtom) root = new ColorAtom(null, c, (ColorAtom) root); else root = new ColorAtom(root, null, c); } return this; } /** * Sets a fixed left and right type of the current TeXFormula. This has an * influence on the glue that will be inserted before and after this * TeXFormula. * * @param leftType * atom type constant (from {@link TeXConstants}) * @param rightType * atom type constant (from TeXConstants) * @return the modified TeXFormula * @throws InvalidAtomTypeException * if the given integer value does not represent a valid atom * type */ public TeXFormula setFixedTypes(int leftType, int rightType) throws InvalidAtomTypeException { root = new TypedAtom(leftType, rightType, root); return this; } /** * Get a predefined TeXFormula. * * @param name * the name of the predefined TeXFormula * @return a copy of the predefined TeXFormula * @throws FormulaNotFoundException * if no predefined TeXFormula is found with the given name */ public static TeXFormula get(String name) throws FormulaNotFoundException { TeXFormula formula = predefinedTeXFormulas.get(name); if (formula == null) { String f = predefinedTeXFormulasAsString.get(name); if (f == null) { throw new FormulaNotFoundException(name); } TeXFormula tf = new TeXFormula(f); predefinedTeXFormulas.put(name, tf); return tf; } else { return new TeXFormula(formula); } } static class FontInfos { String sansserif; String serif; FontInfos(String sansserif, String serif) { this.sansserif = sansserif; this.serif = serif; } } }
[ "TANGQIANFENG567@pingan.com.cn" ]
TANGQIANFENG567@pingan.com.cn
d284cd3077da17b7c70301ea702215df939e9030
cae08e420325f18f8387ac963404c1102ae57f06
/src/beans/TypingTestDTO.java
3995269e6bdf51d84b346abf6b612953060d71ad
[]
no_license
avyvanu/springboard
4200bc3798c391f90536e80bd1dce95728818ad3
c206c7f88826ea0b3cdea70c54aeffe63b4f7e97
refs/heads/master
2020-12-26T21:32:24.439906
2020-02-01T17:39:59
2020-02-01T17:39:59
237,650,738
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
package beans; public class TypingTestDTO { private int typeId; private String passage; public int getTypeId() { return typeId; } public void setTypeId(int typeId) { this.typeId = typeId; } public String getPassage() { return passage; } public void setPassage(String passage) { this.passage = passage; } }
[ "vishnuvy@vishnus-MacBook-Pro.local" ]
vishnuvy@vishnus-MacBook-Pro.local
576f49b6837e94cbe61fb165f4e628b8620edb7f
6257b2349972d86111796c9474a99580e8901752
/backups-storage-file/src/main/java/com/yammer/storage/file/instrumented/metrics/TotalSpaceGauge.java
15038cb4a7ec033068eba006351b4b975c9ecc73
[ "Apache-2.0" ]
permissive
jdrew1303/backups
c1a7bc9f637f358d884b906ebf6745502c87a0f0
f547ae031559945fd2bf79bb88fcb453596a1458
refs/heads/master
2021-01-12T12:36:58.765634
2014-08-20T10:05:36
2014-08-20T10:05:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package com.yammer.storage.file.instrumented.metrics; /* * #%L * Backups * %% * Copyright (C) 2013 - 2014 Microsoft Corporation * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import com.codahale.metrics.Gauge; import com.google.common.base.Throwables; import com.yammer.storage.file.FileStorage; import java.io.IOException; public class TotalSpaceGauge implements Gauge<Long> { private final FileStorage delegate; public TotalSpaceGauge(FileStorage delegate) { this.delegate = delegate; } @Override public Long getValue() { try { return delegate.getTotalSpace().toBytes(); } catch (IOException e) { throw Throwables.propagate(e); } } }
[ "jfurness@yammer-inc.com" ]
jfurness@yammer-inc.com
00f7bb27b43f4d69c98ced445834cee354bd9eaf
2ea6d1909ed73f64203f6584e8c18119c7a471f7
/app/src/main/java/com/example/teller2/MainActivity.java
9953bc4c5a2d62074b5730c074e0a4bc7c60dfa2
[]
no_license
shitakhaoboo/SmartMqttMeterApp
eec5b21dbbd44adad19cefc292e3fcff156157c7
6fd8330380240bda0d663017e512e9be917bb93d
refs/heads/master
2023-01-22T02:12:21.499222
2020-12-03T18:41:17
2020-12-03T18:41:17
318,287,140
0
0
null
null
null
null
UTF-8
Java
false
false
7,267
java
package com.example.teller2; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import org.eclipse.paho.android.service.MqttAndroidClient; import org.eclipse.paho.client.mqttv3.IMqttActionListener; import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; import org.eclipse.paho.client.mqttv3.IMqttToken; import org.eclipse.paho.client.mqttv3.MqttCallback; import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; import java.io.UnsupportedEncodingException; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { private TextView conn; private TextView conn1; private TextView conn2; private Button btn; public boolean onoff = true; boolean connectionFlag = false; public static String topic_send="Jkuat-grid/house1/status/change"; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String clientId = "lakisama"; final MqttAndroidClient client =new MqttAndroidClient(this.getApplicationContext(), "tcp://test.mosquitto.org:1883",clientId); conn = findViewById(R.id.conn_status); conn1 = findViewById(R.id.incoming); conn2 = findViewById(R.id.relay); btn = findViewById(R.id.button3); btn.setEnabled(false); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(onoff) { // means the relay is om and we're turning it off sendMessage(client, topic_send,"off"); } else { sendMessage(client, topic_send,"on"); } } }); try { IMqttToken token = client.connect(); token.setActionCallback(new IMqttActionListener() { @Override public void onSuccess(IMqttToken asyncActionToken) { conn.setText("CONNECTED"); connectionFlag = true; btn.setEnabled(true); final String topic1 = "Jkuat-grid/house1/balance"; final String topic2 = "Jkuat-grid/house1/status/now"; int qos1 = 1; try { IMqttToken subToken = client.subscribe(topic1, qos1); IMqttToken subToken2 = client.subscribe(topic2, qos1); subToken.setActionCallback(new IMqttActionListener() { @Override public void onSuccess(IMqttToken asyncActionToken) { // The message was published } @Override public void onFailure(IMqttToken asyncActionToken, Throwable exception) { // The subscription could not be performed, maybe the user was not // authorized to subscribe on the specified topic e.g. using wildcards } });subToken2.setActionCallback(new IMqttActionListener() { @Override public void onSuccess(IMqttToken asyncActionToken) { // The message was published } @Override public void onFailure(IMqttToken asyncActionToken, Throwable exception) { // The subscription could not be performed, maybe the user was not // authorized to subscribe on the specified topic e.g. using wildcards } }); } catch (MqttException e) { e.printStackTrace(); } client.setCallback(new MqttCallback() { @Override public void connectionLost(Throwable cause) { } @Override public void messageArrived(String topic, MqttMessage message) throws Exception { Toast.makeText(MainActivity.this, new String(message.getPayload()),Toast.LENGTH_SHORT).show(); if (topic.equals(topic1)) { conn1.setText(new String(message.getPayload())); } else if(topic.equals(topic2)) { String k = new String(message.getPayload()); if (k.equals("on")) { onoff=true; } else if(k.equals("off")) { onoff=false; } else { onoff=false; } conn2.setText(new String(message.getPayload())); } } @Override public void deliveryComplete(IMqttDeliveryToken token) { } }); // We are connected //Log.d(TAG, "onSuccess"); } @Override public void onFailure(IMqttToken asyncActionToken, Throwable exception) { // Something went wrong e.g. connection timeout or firewall problems // Log.d(TAG, "onFailure"); } }); } catch (MqttException e) { e.printStackTrace(); } } public void GSecond(View view){ Intent intent = new Intent(this,SecondActivity.class); startActivity(intent); }public void GSecond2(View view){ Intent intent2 = new Intent(this,chartActivity.class); startActivity(intent2); } void sendMessage(MqttAndroidClient client1,String topic, String msg) { String payload = msg; byte[] encodedPayload; try { encodedPayload = payload.getBytes("UTF-8"); MqttMessage message = new MqttMessage(encodedPayload); client1.publish(topic, message); Toast.makeText(getApplicationContext(), "Sent", Toast.LENGTH_SHORT).show(); } catch (UnsupportedEncodingException | MqttException e) { e.printStackTrace(); } } }
[ "shitakha.oboo@students.jkuat.ac.ke" ]
shitakha.oboo@students.jkuat.ac.ke
3bc6819db0bc9b9ff65f2ad4a89fc14a366b6ff1
b3ba1cd32a5ad90df89312c10d0e8a3b1bcc398d
/src/com/example/ojprogramming/DetailInfoOfQuestion.java
ccb2f0996e4680d12b3613c1d109004a85eb6991
[ "Apache-2.0" ]
permissive
ydh12356890/OJdemo
1cd87188df7269a3215a1b82f7e83f2841b5956f
2a4c4d953db71cae245386aac3aca0b3653032f2
refs/heads/master
2021-01-21T17:57:14.960154
2017-05-22T03:22:58
2017-05-22T03:22:58
92,002,796
0
0
null
null
null
null
GB18030
Java
false
false
7,481
java
package com.example.ojprogramming; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.w3c.dom.Text; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; public class DetailInfoOfQuestion extends Activity { private TextView mtitleTextView; private TextView minfoTextView; private Button mButton; private ListView mListView; private Button mcommitbtn; public static final int PARSESUCCWSS = 0x2016; private static final String TAG = "MainActivity"; Problem problem = new Problem(); ArrayList<Language> lineList = new ArrayList<Language>(); final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); if (msg.what == PARSESUCCWSS) { problem = (Problem)msg.obj; //lineList = (ArrayList<Language>)msg.obj; minfoTextView.setText(problem.toString()); //mlanguageTextView.setText(lineList.toString()); } } }; final Handler mHandler2 = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); if (msg.what == PARSESUCCWSS) { //problem = (Problem)msg.obj; lineList = (ArrayList<Language>)msg.obj; //minfoTextView.setText(problem.toString()); //mlanguageTextView.setText(lineList.toString()); initlanguagedata(); } } }; final Handler mHandler3 = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); if (msg.what == PARSESUCCWSS) { /*Intent intent = getIntent(); Bundle bundle=intent.getExtras(); String str=bundle.getString("str"); Log.i("ydh","打印出str"+str);*/ Intent mComIntent = new Intent(DetailInfoOfQuestion.this, CommitCode.class); /*mComIntent.setClass(DetailInfoOfQuestion.this, CommitCode.class); mComIntent.putExtra("str",str);*/ startActivity(mComIntent); } } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail_info_of_question); mtitleTextView = (TextView)findViewById(R.id.detailinfo_question); minfoTextView = (TextView)findViewById(R.id.replay_question); mButton = (Button)findViewById(R.id.id_btn_language); mListView = (ListView)findViewById(R.id.language_listview); mcommitbtn = (Button)findViewById(R.id.id_btn_commitcode); Intent intent = getIntent(); Bundle bundle=intent.getExtras(); final String str=bundle.getString("str"); final String urlpathString = "http://35.189.170.28:8000/api/inline/problem?problem_sid="+str; Thread thread = new Thread(new Runnable() { @Override public void run() { Log.i("abc", "进入"); //String path = "http://35.189.170.28:8000/api/inline/problem?problem_sid=zoj-1000"; Log.i("abc", "开始读取URL"); String jsonString = HttpUtils.getJsonContent(urlpathString);// 从网络获取数据 //Log.i("abc","连接"+jsonString); JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject(); JsonObject jsonObject2 = jsonObject.getAsJsonObject("show_problem_response").getAsJsonObject("problem"); Log.i("abc", "打印"+jsonObject2.toString()); Gson gson = new Gson(); Problem problem = gson.fromJson(jsonObject2, Problem.class); Log.i("abc","转换"+problem.toString()); /*JsonArray jsonArray = jsonObject.getAsJsonObject("show_problem_response").getAsJsonArray("languages"); Gson gson1 = new Gson(); ArrayList<Language> lineList = new ArrayList<Language>(); for (JsonElement data : jsonArray) { Language mData = gson1.fromJson(data, new TypeToken<Language>() { }.getType()); lineList.add(mData); }*/ //mlanguageTextView.setText(lineList.toString()); Message msg = new Message(); msg.what = PARSESUCCWSS;// 通知UI线程Json解析完成 msg.obj = problem;// 将解析出的数据传递给UI线程 //msg.obj = lineList; mHandler.sendMessage(msg); } }); thread.start(); mButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Thread thread = new Thread(new Runnable() { @Override public void run() { Log.i("abc", "进入"); //String path = "http://35.189.170.28:8000/api/inline/problem?problem_sid=zoj-1000"; Log.i("abc", "开始读取URL"); String jsonString = HttpUtils.getJsonContent(urlpathString);// 从网络获取数据 //Log.i("abc","连接"+jsonString); JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject(); JsonArray jsonArray = jsonObject.getAsJsonObject("show_problem_response").getAsJsonArray("languages"); Gson gson1 = new Gson(); ArrayList<Language> lineList = new ArrayList<Language>(); for (JsonElement data : jsonArray) { Language mData = gson1.fromJson(data, new TypeToken<Language>() { }.getType()); lineList.add(mData); } //mlanguageTextView.setText(lineList.toString()); Message msg = new Message(); msg.what = PARSESUCCWSS;// 通知UI线程Json解析完成 //msg.obj = problem;// 将解析出的数据传递给UI线程 msg.obj = lineList; mHandler2.sendMessage(msg); } }); thread.start(); } }); mcommitbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Thread thread = new Thread(new Runnable() { @Override public void run() { Message msg = new Message(); msg.what = PARSESUCCWSS;// 通知UI线程Json解析完成 //msg.obj = problem;// 将解析出的数据传递给UI线程 //msg.obj = lineList; mHandler3.sendMessage(msg); } }); thread.start(); } }); } public void initlanguagedata() { List<Map<String, Object>> jsonlist=new ArrayList<Map<String,Object>>(); for (Language news:lineList) { Map<String, Object> map=new HashMap<String, Object>(); map.put("compiler", news.getCompiler()); map.put("language", news.getLanguage()); map.put("language_id", news.getLanguage_id()); map.put("oj_name", news.getOj_name()); jsonlist.add(map); Log.i("abc","解析json填充到listview之间的"); } SimpleAdapter adapter=new SimpleAdapter(this, jsonlist, R.layout.detail_info_language, new String[] {"compiler","language","language_id","oj_name"}, new int[]{R.id.id_txt_compiler,R.id.id_txt_language,R.id.id_txt_languageid,R.id.id_txt_ojname}); Log.i("abc","初始化"); mListView.setAdapter(adapter); } }
[ "984118142@qq.com" ]
984118142@qq.com
75077980fece5dd73e5d83facbacffb39c9aac52
84423881eac5ef2e48c6c56b6bf7d504f2e85ecd
/zingeekWeiXin/src/com/zingeek/weixin/manager/ManagerTOD.java
cf8fedb6161160098b1e1c7ef9a9f3f54964ef8a
[]
no_license
yanghaikun/TruthOrDare
0505d4d64d23022afee2a16e13d4570390d97ded
1c6e9a5166191702b2aaec2923c8b735c5046f67
refs/heads/master
2020-04-10T19:08:01.473438
2013-06-02T07:57:58
2013-06-02T07:57:58
10,432,004
0
0
null
null
null
null
UTF-8
Java
false
false
2,931
java
package com.zingeek.weixin.manager; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.HashMap; import java.util.Map; import javax.enterprise.context.ApplicationScoped; import com.zingeek.core.support.Utils; import com.zingeek.support.RandomUtils; import com.zingeek.weixin.action.ActionTOD; import com.zingeek.weixin.entity.RoomTOD; import com.zingeek.weixin.entity.UserTOD; /** * 真心话大冒险manager * @author Vincent Hiven Yang * */ @ApplicationScoped public class ManagerTOD extends ManagerBase<UserTOD, RoomTOD>{ private Map<Integer, String> 真心话 = new HashMap<Integer, String>(); private Map<Integer, String> 大冒险 = new HashMap<Integer, String>(); @Override public UserTOD getUser(String userId) { UserTOD user = users.get(userId); if(user == null) { user = new UserTOD(userId); users.put(userId, user); } return user; } @Override public RoomTOD getRoom(int roomId) { return rooms.get(roomId); } @Override public void createRoom(UserTOD user, int num) { RoomTOD room = null; for(RoomTOD r : rooms.values()) { //如果该房间长时间没活动,或者没有人了 if((System.currentTimeMillis() - r.timeUpdate) > timeRoomClear || r.users.size() == 0) { for(UserTOD u : r.users) { removeUser(u); } r.clear(); room = r; break; } } if(room == null) { largestRoomId += 10; room = new RoomTOD(largestRoomId); rooms.put(largestRoomId, room); } room.count = num; room.addUser(user); user.roomId = room.id; user.room = room; } public String truthOrDare(String key) { String result = ""; if(ActionTOD.真.contains(key)) { if(真心话.isEmpty()) { File file = new File(Utils.getRealPath() + "/WEB-INF/classes/META-INF/truthOrDare/truth.txt"); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; int i = 0; while((line = br.readLine()) != null) { 真心话.put(i, line); i++; } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } int rand = RandomUtils.nextInt(真心话.size()); result = 真心话.get(rand); } else if(ActionTOD.大.contains(key)) { if(大冒险.isEmpty()) { File file = new File(Utils.getRealPath() + "/WEB-INF/classes/META-INF/truthOrDare/dare.txt"); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; int i = 0; while((line = br.readLine()) != null) { 大冒险.put(i, line); i++; } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } int rand = RandomUtils.nextInt(大冒险.size()); result = 大冒险.get(rand); } return result; } }
[ "yhk1990@gmail.com" ]
yhk1990@gmail.com
44097dcfa4f3d9920218afd0de6f961685e308eb
f976d3992eca85ef4cf0b888ff4658e321875d6b
/homework07/AVLStudentTests.java
69e9822f822cdbaf5ddd3a9185df59def1d2bc0c
[]
no_license
oshaikh13/CS1332
1bfb4fb0fb7f65e8cc77a007d9c71475f6bff61b
03d556d18addc8e62a521e5e6f79eb592f4c6b0b
refs/heads/master
2022-01-16T05:51:34.753068
2019-05-05T18:17:42
2019-05-05T18:17:42
145,902,816
0
0
null
null
null
null
UTF-8
Java
false
false
6,840
java
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import java.util.ArrayList; import java.util.List; /** * These tests are not exhaustive. * @author CS 1332 TAs * @version 1.0 */ public class AVLStudentTests { private static final int TIMEOUT = 200; private AVL<Integer> avlTree; @Before public void setup() { avlTree = new AVL<>(); } @Test(timeout = TIMEOUT) public void testAddRightRotation() { /* 5 4 / / \ 4 -> 3 5 / 3 */ avlTree.add(5); avlTree.add(4); avlTree.add(3); assertEquals(3, avlTree.size()); AVLNode<Integer> root = avlTree.getRoot(); assertEquals((Integer) 4, root.getData()); assertEquals(1, root.getHeight()); assertEquals(0, root.getBalanceFactor()); assertEquals((Integer) 3, root.getLeft().getData()); assertEquals(0, root.getLeft().getHeight()); assertEquals(0, root.getLeft().getBalanceFactor()); assertEquals((Integer) 5, root.getRight().getData()); assertEquals(0, root.getRight().getHeight()); assertEquals(0, root.getRight().getBalanceFactor()); } @Test(timeout = TIMEOUT) public void testAddRightLeftRotationRoot() { /* 3 4 \ / \ 5 -> 3 5 / 4 */ avlTree.add(3); avlTree.add(5); avlTree.add(4); assertEquals(3, avlTree.size()); AVLNode<Integer> root = avlTree.getRoot(); assertEquals((Integer) 4, root.getData()); assertEquals(1, root.getHeight()); assertEquals(0, root.getBalanceFactor()); assertEquals((Integer) 3, root.getLeft().getData()); assertEquals(0, root.getLeft().getHeight()); assertEquals(0, root.getLeft().getBalanceFactor()); assertEquals((Integer) 5, root.getRight().getData()); assertEquals(0, root.getRight().getHeight()); assertEquals(0, root.getRight().getBalanceFactor()); } @Test(timeout = TIMEOUT) public void testRemove() { /* 646 646 / \ / \ 477 856 -> 386 856 / \ \ 386 526 526 */ Integer toBeRemoved = 477; avlTree.add(646); avlTree.add(toBeRemoved); avlTree.add(856); avlTree.add(386); avlTree.add(526); assertSame(toBeRemoved, avlTree.remove(477)); assertEquals(4, avlTree.size()); AVLNode<Integer> root = avlTree.getRoot(); assertEquals((Integer) 646, root.getData()); assertEquals(2, root.getHeight()); assertEquals(1, root.getBalanceFactor()); assertEquals((Integer) 386, root.getLeft().getData()); assertEquals(1, root.getLeft().getHeight()); assertEquals(-1, root.getLeft().getBalanceFactor()); assertEquals((Integer) 856, root.getRight().getData()); assertEquals(0, root.getRight().getHeight()); assertEquals(0, root.getRight().getBalanceFactor()); assertEquals((Integer) 526, root.getLeft().getRight().getData()); assertEquals(0, root.getLeft().getRight().getHeight()); assertEquals(0, root.getLeft().getRight().getBalanceFactor()); } @Test(timeout = TIMEOUT) public void testGet() { /* 477 / \ 386 526 \ 646 */ Integer maximum = 646; avlTree.add(477); avlTree.add(526); avlTree.add(386); avlTree.add(maximum); assertSame(maximum, avlTree.get(646)); } @Test(timeout = TIMEOUT) public void testContains() { /* 477 / \ 386 526 \ 646 */ avlTree.add(477); avlTree.add(526); avlTree.add(386); avlTree.add(646); assertTrue(avlTree.contains(477)); assertEquals((Integer) 477, avlTree.get(477)); assertTrue(avlTree.contains(386)); assertEquals((Integer) 386, avlTree.get(386)); assertTrue(avlTree.contains(646)); assertEquals((Integer) 646, avlTree.get(646)); } @Test(timeout = TIMEOUT) public void testHeight() { /* 646 / \ 386 856 / \ 526 477 */ avlTree.add(646); avlTree.add(386); avlTree.add(856); avlTree.add(526); avlTree.add(477); assertEquals(2, avlTree.height()); } @Test(timeout = TIMEOUT) public void testHeight2() { /* 646 / \ 386 856 / \ 526 477 */ avlTree.add(646); avlTree.add(856); assertEquals(1, avlTree.height()); assertEquals(0, avlTree.getRoot().getRight().getHeight()); } @Test(timeout = TIMEOUT) public void testMaxDeepestNode() { /* 2 / \ 0 3 \ 1 */ Integer deepest = 1; avlTree.add(2); avlTree.add(0); avlTree.add(3); avlTree.add(deepest); assertSame(deepest, avlTree.maxDeepestNode()); } @Test(timeout = TIMEOUT) public void testDeepestCommonAncestor() { /* 2 / \ 0 3 \ 1 */ Integer ancestor = 2; avlTree.add(ancestor); avlTree.add(0); avlTree.add(3); avlTree.add(1); assertSame(ancestor, avlTree.deepestCommonAncestor(0, 2)); } @Test(timeout = TIMEOUT) public void testConstructorAndClear() { /* 7 / \ 1 24 */ List<Integer> toAdd = new ArrayList<>(); toAdd.add(7); toAdd.add(24); toAdd.add(1); avlTree = new AVL<>(toAdd); avlTree.clear(); assertNull(avlTree.getRoot()); assertEquals(0, avlTree.size()); } }
[ "oshaikh13@gmail.com" ]
oshaikh13@gmail.com
d241726878b167e23a6e18b748163ce325e2ea7e
a9a67b04e86c87dfa695341311bb511c65cf271e
/account/src/main/java/account/application/port/in/SendMoneyCommand.java
3fcb849dbe762b69dfa5a2f985de97a9f2121ec2
[]
no_license
WlmAlex/clean-architecture-book-example
1a2a49ae8db72d70008092b9e8fc5708d2b72258
1bb6988c0c17865f47d11053d7dfeff36cfc0036
refs/heads/master
2022-11-08T20:43:57.788733
2020-06-24T16:24:49
2020-06-24T16:24:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
877
java
package account.application.port.in; import account.application.SelfValidating; import lombok.Getter; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; @Getter public class SendMoneyCommand extends SelfValidating<SendMoneyCommand> { @NotNull(message = "Source account cannot be null") private final AccountId sourceAccountId; @NotNull(message = "Target account cannot be null") private final AccountId targetAccountId; @NotNull(message = "Money cannot be null") @Min(value = 0, message = "Money should not be less than 0") private final Money money; public SendMoneyCommand(AccountId sourceAccountId, AccountId targetAccountId, Money money) { this.sourceAccountId = sourceAccountId; this.targetAccountId = targetAccountId; this.money = money; this.validateSelf(); } }
[ "muilpp@gmail.com" ]
muilpp@gmail.com
93304906d21dd2d45102edd6b55411f67b74b127
b857c0a9f29b7ff8d3aa177734526e97d3358f38
/app/src/main/java/com/lxyg/app/customer/iface/PostDataListener.java
aa896f5b25a23acc214b956a5062181a38ce16dd
[]
no_license
mirror5821/LXYG
a133d68b93901a375d1fef47710683c9c93cc953
d2be2366b41b5301d1d5c6bba6e0c5bbb25521e5
refs/heads/master
2021-01-21T13:41:20.864539
2016-05-05T06:50:58
2016-05-05T06:50:58
47,088,931
0
0
null
null
null
null
UTF-8
Java
false
false
141
java
package com.lxyg.app.customer.iface; public interface PostDataListener { void getDate(String data, String msg); void error(String msg); }
[ "mirror5821@163.com" ]
mirror5821@163.com
4552222a624cc30b0957aa8793e650f7c218c2d1
98c24f289bef9da12bc7120b8b2c3d27a57a55a2
/grandpringles/src/com/firedogs/grandpringles/service/ShowGrndInfoService.java
3d52792f38ff791659e59e74f996d2092c37c4c5
[]
no_license
OneHundredTwo/GrandPringles
0ccf31b904f677e62a230da9b49a5f3fb545544e
4749fd3845d388ed88dd19551f8c8940e645e999
refs/heads/master
2020-03-26T21:23:18.854224
2018-08-28T09:53:41
2018-08-28T09:53:41
145,384,933
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.firedogs.grandpringles.service; import java.util.List; import java.util.Map; import com.firedogs.grandpringles.vo.Board; import com.firedogs.grandpringles.vo.Grandprix; import com.firedogs.grandpringles.vo.PageVO; import com.firedogs.grandpringles.vo.User; public interface ShowGrndInfoService { public Map<String,Object> getMainContents(); public Map<String,Object> getMainContents(int grndNo); public List<User> getStreamerList(String nickname); }
[ "shinebless919@gmail.com" ]
shinebless919@gmail.com
cd3570b2e5e871a4ba3bf51ed4f9a3e86fa32835
f74ee2d3e164ed08effee29432b7db8c4aa27d5b
/app/src/main/java/com/example/geology/A10.java
b687dd9bd537409174018ce5d1064c40fee89cb2
[]
no_license
Anubhaw19/GeoBits
35d41801821e0607ae4c32832e9144ebdfa30a0f
68f786f4a5bc7be3da8c45d333d9f7e101552677
refs/heads/master
2020-09-08T07:52:04.272334
2020-03-17T14:24:29
2020-03-17T14:24:29
221,068,004
2
0
null
null
null
null
UTF-8
Java
false
false
323
java
package com.example.geology; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class A10 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_a10); } }
[ "anubhawsharma99@gmail.com" ]
anubhawsharma99@gmail.com
ee8718ccbdce44a16a9377c1d59bea4dcb63ad42
52f7972d0739421a765a471e2fda1999151fcd36
/src/score/SideAttackScore.java
a26ba2d341107ebca69bc7885a51a9f8d17651a6
[]
no_license
andertavares/inf-seal
8d2daab4afce38caa3deafe231f8917e4082e66d
65a4bfacd34be2f3d4da891b7ce730cf4ae30aa1
refs/heads/master
2020-04-27T08:41:40.606892
2015-03-25T18:34:06
2015-03-25T18:34:06
32,882,913
2
1
null
null
null
null
UTF-8
Java
false
false
1,159
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package score; import java.io.File; import net.sourceforge.jFuzzyLogic.FIS; /** * * @author Renato */ public class SideAttackScore extends Score { private FIS fis; public SideAttackScore() { super(); //TODO checar directory separator em JAVA String fileName = "rules/sideAttack.fcl"; this.fis = FIS.load(fileName, true); if (this.fis == null) { System.err.println("Can't load file: '" + fileName + "'"); } //xfis.chart(); } @Override public double getScore(double angle, double distance, double direction) { this.fis.setVariable("angle", Math.abs(angle)); this.fis.setVariable("distance", distance/300); this.fis.setVariable("direction", (direction>Math.PI?2*Math.PI-direction:direction)); this.fis.evaluate(); double score = fis.getVariable("activate").defuzzify(); return score; } }
[ "andersonrochatavares@161dce0b-8ccb-efdd-4249-d40ce7e1c4a5" ]
andersonrochatavares@161dce0b-8ccb-efdd-4249-d40ce7e1c4a5
8115eeded1010180e81d4046bca188f08471a7d8
016437bb79d5e2f101fd3d3f304faa9e5ef8b2cd
/src/JavaGenerics.java
2762b8fe288ec3c9395a2f51131f3034747c6de3
[]
no_license
prabhatkumardubey/CompetitiveCode
afec0c2123557850f1b9b2a307a37f8b9d571a7d
e591a821fa18d19ee5761291a65c5beea287872d
refs/heads/master
2022-12-07T05:48:03.449264
2020-09-02T08:21:49
2020-09-02T08:21:49
292,222,956
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
import java.io.IOException; import java.lang.reflect.Method; class JavaGenerics { public static void main(String[] args) { // TODO Auto-generated method stub Printer1 myPrinter = new Printer1(); Integer[] intArray = { 1, 2, 3 }; String[] stringArray = {"Hello", "World"}; myPrinter.printArray(intArray); myPrinter.printArray(stringArray); int count = 0; for (Method method : Printer1.class.getDeclaredMethods()) { String name = method.getName(); if(name.equals("printArray")){ count++; System.out.println("count = "+count); } } if(count > 1)System.out.println("Method overloading is not allowed!"); } } class Printer1 { //Write your code here public void printArray(Object[] intArray) { // TODO Auto-generated method stub for(int i=0;i<intArray.length;i++){ System.out.println(intArray[i]); } } }
[ "prabhatdubey.maildrop@gmail.com" ]
prabhatdubey.maildrop@gmail.com
dab3d07798adea998b81b211c01607a0a27817ff
6404ac646e701b0039b3dec3abb023d3058da573
/JAVA programs/cPHP/PrimernoControlno2/gotzeva_exam_bandit/src/Sheriff.java
b0b520a26728a7a9322edf25b694ff6f21242e6f
[]
no_license
YovoManolov/GithubRepJava
0b6ffa5234bcca3dec1ac78f491b1d96882420e8
307f11e11d384ae0dbf7b2634210656be539d92f
refs/heads/master
2023-01-09T23:26:01.806341
2021-03-28T13:41:36
2021-03-28T13:41:36
85,554,350
0
0
null
null
null
null
UTF-8
Java
false
false
522
java
public class Sheriff extends Villain { public Sheriff() { // TODO Auto-generated constructor stub } public Sheriff(int numLegs, int numHands, int numEyes, String name, String horseName, String whiskey, String shortName, int numShoots, int price) { super(numLegs, numHands, numEyes, name, horseName, whiskey, shortName, numShoots, price); // TODO Auto-generated constructor stub } @Override public int Shoot() { // TODO Auto-generated method stub return Math.min(super.Shoot()+20, 100); } }
[ "yovo.manolov@abv.bg" ]
yovo.manolov@abv.bg
fb229453ba040e3661a18213b1f56851d4e05e2d
fce55fca96ee35d8b3946e441274456209fd9dc4
/2.2.14/decompiled/buildcraft/transport/PipeLogicObsidian.java
76d417a9f7adc310a8bfb91bea8d429ae9daab9c
[]
no_license
mushroomhostage/BuildCraft
c7a074c120b6fca9e5aea161ec89ff356b46ccd8
c15e7debdc7d70f9b3681259079c31fbcbda1b45
refs/heads/master
2021-01-01T18:17:10.680211
2012-05-02T03:37:25
2012-05-02T03:37:25
4,166,166
1
1
null
null
null
null
UTF-8
Java
false
false
559
java
package buildcraft.transport; import net.minecraft.server.BuildCraftTransport; import net.minecraft.server.TileEntity; public class PipeLogicObsidian extends PipeLogic { public boolean isPipeConnected(TileEntity var1) { Pipe var2 = null; if (var1 instanceof TileGenericPipe) { var2 = ((TileGenericPipe)var1).pipe; } return BuildCraftTransport.alwaysConnectPipes ? super.isPipeConnected(var1) : (var2 == null || !(var2.logic instanceof PipeLogicObsidian)) && super.isPipeConnected(var1); } }
[ "mushroomhostage@yahoo.com" ]
mushroomhostage@yahoo.com
888156dd42e3d4ef2958af1738e2c190a3e6f055
12e7d90f39c7900875ab5873cb9163a0bfbcca0f
/app/src/main/java/custem/RecommendHotView.java
e2e341d418db619bdcbda7e9d0913d6144598bb5
[]
no_license
liuyuanliang/DeliciousFood
b8e3e7278169fffc2c4799b784ac583f64266476
be08ab61afc58bfa4bd523404fbaf9af52761993
refs/heads/master
2021-01-10T08:16:50.553091
2016-03-04T07:54:49
2016-03-04T07:54:49
53,115,920
0
0
null
null
null
null
UTF-8
Java
false
false
4,678
java
package custem; import android.content.Context; import android.support.v4.app.FragmentManager; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.widget.LinearLayout; import android.widget.TextView; import com.facebook.drawee.view.SimpleDraweeView; import com.qf.deliiousfoot.R; import java.util.List; import adapter.Vp_HotPagerAdapter; import model.RecommendEntity; import util.FrescoUtil; /** * 最热商品viewpager */ public class RecommendHotView extends LinearLayout implements ViewPager.OnPageChangeListener { private FragmentManager manager; private ViewPager viewPager; private NavView navView; /** * 4张图片 */ private SimpleDraweeView sdv_hot_1; private SimpleDraweeView sdv_hot_2; private SimpleDraweeView sdv_hot_3; private SimpleDraweeView sdv_hot_4; /** * 8个文本 */ private TextView tv_hot_1; private TextView tv_hot_2; private TextView tv_hot_3; private TextView tv_hot_4; private TextView tv_hot_5; private TextView tv_hot_6; private TextView tv_hot_7; private TextView tv_hot_8; private List<RecommendEntity.ObjEntity.ShopsEntity> shops; public RecommendHotView(Context context,FragmentManager manager) { super(context); this.manager = manager; init(); } /** * 初始化 */ private void init() { LayoutInflater.from(getContext()).inflate(R.layout.recommend_hot_vp_layout,this,true); sdv_hot_1 = (SimpleDraweeView) findViewById(R.id.sdv_hot_1); sdv_hot_2 = (SimpleDraweeView) findViewById(R.id.sdv_hot_2); sdv_hot_3 = (SimpleDraweeView) findViewById(R.id.sdv_hot_3); sdv_hot_4 = (SimpleDraweeView) findViewById(R.id.sdv_hot_4); tv_hot_1 = (TextView) findViewById(R.id.tv_hot_1); tv_hot_2 = (TextView) findViewById(R.id.tv_hot_2); tv_hot_3 = (TextView) findViewById(R.id.tv_hot_3); tv_hot_4 = (TextView) findViewById(R.id.tv_hot_4); tv_hot_5 = (TextView) findViewById(R.id.tv_hot_5); tv_hot_6 = (TextView) findViewById(R.id.tv_hot_6); tv_hot_7 = (TextView) findViewById(R.id.tv_hot_7); tv_hot_8 = (TextView) findViewById(R.id.tv_hot_8); viewPager = (ViewPager) findViewById(R.id.vp_hot); navView = (NavView) findViewById(R.id.nv_hot); viewPager.addOnPageChangeListener(this); } /** * 提供一个外部传入数据的方法 */ public void setDatas(RecommendEntity recommendEntity){ shops = recommendEntity.getObj().getShops(); FrescoUtil.bindImageView(shops.get(0).getImage(),sdv_hot_1); tv_hot_1.setText(shops.get(0).getTitle()); tv_hot_2.setText("¥"+ shops.get(0).getPrice()+"/"+ shops.get(0).getGuige()); FrescoUtil.bindImageView(shops.get(1).getImage(), sdv_hot_2); tv_hot_3.setText(shops.get(1).getTitle()); tv_hot_4.setText("¥"+ shops.get(1).getPrice()+"/"+ shops.get(1).getGuige()); FrescoUtil.bindImageView(shops.get(2).getImage(), sdv_hot_3); tv_hot_5.setText(shops.get(2).getTitle()); tv_hot_6.setText("¥"+ shops.get(2).getPrice()+"/"+ shops.get(2).getGuige()); FrescoUtil.bindImageView(shops.get(3).getImage(), sdv_hot_4); tv_hot_7.setText(shops.get(3).getTitle()); tv_hot_8.setText("¥"+ shops.get(3).getPrice()+"/"+ shops.get(3).getGuige()); navView.setCount(recommendEntity.getObj().getTop3().size()); Vp_HotPagerAdapter adapter = new Vp_HotPagerAdapter(getContext(),recommendEntity); viewPager.setAdapter(adapter); viewPager.setOffscreenPageLimit(1); } /** * viewPager的监听器 * @param position * @param positionOffset * @param positionOffsetPixels */ private boolean isLast = false; private float x = -1f; private float dx = -1f; @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { if (isLast){ if (x==-1){ x = positionOffset; }else { dx = x - positionOffset; x=positionOffset; } if (dx==0){ viewPager.setCurrentItem(0); isLast = false; } } if (navView.getCount()>0){ navView.setNavAddress(position,positionOffset); } } @Override public void onPageSelected(int position) { if (position==shops.size()){ isLast = true; } } @Override public void onPageScrollStateChanged(int state) { } }
[ "liuyuanliang1314" ]
liuyuanliang1314
93d7317fc2ee78c4c6b675ddd2ab7c769a79f072
3016374f9ee1929276a412eb9359c0420d165d77
/InstrumentAPK/sootOutput/com.waze_source_from_JADX/com/waze/carpool/CarpoolRiderJoinRequest.java
ad7bfc190193d666588d6dafd6bfe00173ffaac2
[]
no_license
DulingLai/Soot_Instrumenter
190cd31e066a57c0ddeaf2736a8d82aec49dadbf
9b13097cb426b27df7ba925276a7e944b469dffb
refs/heads/master
2021-01-02T08:37:50.086354
2018-04-16T09:21:31
2018-04-16T09:21:31
99,032,882
4
3
null
null
null
null
UTF-8
Java
false
false
19,325
java
package com.waze.carpool; import android.app.Dialog; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.graphics.Bitmap; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import com.waze.C1283R; import com.waze.Logger; import com.waze.MainActivity; import com.waze.MainActivity.ITrackOrientation; import com.waze.MsgBox; import com.waze.analytics.AnalyticsBuilder; import com.waze.analytics.AnalyticsEvents; import com.waze.ifs.ui.ActivityBase; import com.waze.ifs.ui.CircleFrameDrawable; import com.waze.settings.SettingsCarpoolSeatsActivity; import com.waze.strings.DisplayStrings; import com.waze.utils.VolleyManager.ImageRequestListener; public class CarpoolRiderJoinRequest extends Dialog implements ITrackOrientation { private ActivityBase mActivity; private CarpoolNativeManager mCpnm; private Runnable mDismissDialogRunnable = new C15251(); private CarpoolDrive mDrive; private CarpoolRide[] mRidesJoined; class C15251 implements Runnable { C15251() throws { } public void run() throws { CarpoolRiderJoinRequest.this.dismiss(); } } class C15262 implements ImageRequestListener { public boolean receivedCacheResponse = false; C15262() throws { } public void onImageLoadComplete(Bitmap $r1, Object token, long duration) throws { ((ImageView) CarpoolRiderJoinRequest.this.findViewById(C1283R.id.riderReqImageRider)).setImageDrawable(new CircleFrameDrawable($r1, 0, 4)); } public void onImageLoadFailed(Object token, long duration) throws { if (this.receivedCacheResponse) { Logger.m36d("CarpoolRiderJoinRequest: failed loading photo URL"); } else { this.receivedCacheResponse = true; } } } class C15273 implements OnClickListener { C15273() throws { } public void onClick(View v) throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_RIDER_JOINED_OVERLAY_CLICKED).addParam("ACTION", AnalyticsEvents.ANALYTICS_EVENT_VALUE_VIEW_RIDE).send(); CarpoolRiderJoinRequest.this.mDismissDialogRunnable.run(); } } class C15284 implements OnClickListener { C15284() throws { } public void onClick(View v) throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_RIDER_JOINED_OVERLAY_CLICKED).addParam("ACTION", AnalyticsEvents.ANALYTICS_EVENT_VALUE_WHATS_THIS).send(); CarpoolRiderJoinRequest.showMultipxIntroPopup(CarpoolRiderJoinRequest.this.mActivity, null); CarpoolRiderJoinRequest.this.mDismissDialogRunnable.run(); } } static class C15306 implements OnCancelListener { C15306() throws { } public void onCancel(DialogInterface dialog) throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_MULTIPAX_INTRO_POPUP_CLICKED).addParam("ACTION", "BACK").send(); } } private void initLayout() throws { /* JADX: method processing error */ /* Error: jadx.core.utils.exceptions.JadxRuntimeException: Can't find immediate dominator for block B:39:0x02c6 in {7, 10, 13, 18, 23, 28, 30, 34, 37, 40, 43, 48} preds:[] at jadx.core.dex.visitors.blocksmaker.BlockProcessor.computeDominators(BlockProcessor.java:129) at jadx.core.dex.visitors.blocksmaker.BlockProcessor.processBlocksTree(BlockProcessor.java:48) at jadx.core.dex.visitors.blocksmaker.BlockProcessor.visit(BlockProcessor.java:38) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17) at jadx.core.ProcessClass.process(ProcessClass.java:37) at jadx.core.ProcessClass.processDependencies(ProcessClass.java:59) at jadx.core.ProcessClass.process(ProcessClass.java:42) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:306) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler$1.run(JadxDecompiler.java:199) */ /* r42 = this; r0 = r42; r2 = r0.mRidesJoined; if (r2 == 0) goto L_0x0013; L_0x0006: r0 = r42; r2 = r0.mRidesJoined; r3 = r2.length; if (r3 == 0) goto L_0x0013; L_0x000d: r0 = r42; r4 = r0.mDrive; if (r4 != 0) goto L_0x0019; L_0x0013: r5 = "CarpoolRiderJoinRequest: received empty drive or rider"; com.waze.Logger.m38e(r5); return; L_0x0019: r6 = 2130903132; // 0x7f03005c float:1.7413073E38 double:1.052806032E-314; r0 = r42; r0.setContentView(r6); r0 = r42; r7 = r0.getWindow(); if (r7 == 0) goto L_0x002e; L_0x0029: r6 = -1; r8 = -1; r7.setLayout(r6, r8); L_0x002e: r6 = 2131690214; // 0x7f0f02e6 float:1.9009465E38 double:1.0531949023E-314; r0 = r42; r9 = r0.findViewById(r6); r11 = r9; r11 = (android.widget.TextView) r11; r10 = r11; r6 = 3670; // 0xe56 float:5.143E-42 double:1.813E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r10.setText(r12); r0 = r42; r4 = r0.mDrive; r13 = r4.itinerary; r14 = r13.free_offer; if (r14 == 0) goto L_0x01ef; L_0x004e: r6 = 2131690215; // 0x7f0f02e7 float:1.9009467E38 double:1.053194903E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); r6 = 2131690216; // 0x7f0f02e8 float:1.900947E38 double:1.0531949033E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); L_0x006a: r0 = r42; r2 = r0.mRidesJoined; r3 = r2.length; r6 = 1; if (r3 != r6) goto L_0x02e0; L_0x0072: r6 = 2131690213; // 0x7f0f02e5 float:1.9009463E38 double:1.053194902E-314; r0 = r42; r9 = r0.findViewById(r6); r15 = r9; r15 = (android.widget.TextView) r15; r10 = r15; r6 = 3668; // 0xe54 float:5.14E-42 double:1.812E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r10.setText(r12); r6 = 2131690219; // 0x7f0f02eb float:1.9009475E38 double:1.053194905E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 0; r9.setVisibility(r6); r6 = 2131690220; // 0x7f0f02ec float:1.9009477E38 double:1.0531949053E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 0; r9.setVisibility(r6); r6 = 2131690224; // 0x7f0f02f0 float:1.9009486E38 double:1.0531949073E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 0; r9.setVisibility(r6); r6 = 2131690225; // 0x7f0f02f1 float:1.9009488E38 double:1.0531949077E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); r0 = r42; r2 = r0.mRidesJoined; r6 = 0; r16 = r2[r6]; r0 = r16; r0 = r0.rider; r17 = r0; r6 = 2131692372; // 0x7f0f0b54 float:1.9013842E38 double:1.0531959685E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 2131690221; // 0x7f0f02ed float:1.900948E38 double:1.053194906E-314; r0 = r42; r18 = r0.findViewById(r6); r19 = r18; r19 = (android.widget.TextView) r19; r10 = r19; r0 = r17; r12 = r0.getName(); if (r12 == 0) goto L_0x02ca; L_0x00ea: r0 = r17; r12 = r0.getName(); L_0x00f0: r10.setText(r12); r0 = r17; r0 = r0.star_rating_as_pax; r20 = r0; r0 = r17; r3 = r0.completed_rides_pax; r0 = r17; r12 = r0.getFirstName(); r0 = r20; com.waze.carpool.CarpoolUtils.setStarsView(r0, r3, r9, r12); r6 = 2131692378; // 0x7f0f0b5a float:1.9013854E38 double:1.0531959715E-314; r9 = r9.findViewById(r6); r6 = 8; r9.setVisibility(r6); r0 = r17; r12 = r0.getWorkplace(); if (r12 == 0) goto L_0x02cd; L_0x011c: r0 = r17; r12 = r0.getWorkplace(); r14 = r12.isEmpty(); if (r14 != 0) goto L_0x02cd; L_0x0128: r6 = 2131690222; // 0x7f0f02ee float:1.9009482E38 double:1.0531949063E-314; r0 = r42; r9 = r0.findViewById(r6); r21 = r9; r21 = (android.widget.TextView) r21; r10 = r21; r6 = 3674; // 0xe5a float:5.148E-42 double:1.815E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r6 = 1; r0 = new java.lang.Object[r6]; r22 = r0; r0 = r17; r23 = r0.getWorkplace(); r6 = 0; r22[r6] = r23; r0 = r22; r12 = java.lang.String.format(r12, r0); r10.setText(r12); L_0x0154: r0 = r17; r12 = r0.photo_url; if (r12 == 0) goto L_0x017c; L_0x015a: r0 = r17; r12 = r0.photo_url; r14 = r12.isEmpty(); if (r14 != 0) goto L_0x017c; L_0x0164: r24 = com.waze.utils.VolleyManager.getInstance(); r0 = r17; r12 = r0.photo_url; r25 = new com.waze.carpool.CarpoolRiderJoinRequest$2; r0 = r25; r1 = r42; r0.<init>(); r0 = r24; r1 = r25; r0.loadImageFromUrl(r12, r1); L_0x017c: r6 = 2131690227; // 0x7f0f02f3 float:1.9009492E38 double:1.0531949087E-314; r0 = r42; r9 = r0.findViewById(r6); r26 = r9; r26 = (android.widget.TextView) r26; r10 = r26; r6 = 3675; // 0xe5b float:5.15E-42 double:1.8157E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r10.setText(r12); r6 = 2131690226; // 0x7f0f02f2 float:1.900949E38 double:1.053194908E-314; r0 = r42; r9 = r0.findViewById(r6); r27 = new com.waze.carpool.CarpoolRiderJoinRequest$3; r0 = r27; r1 = r42; r0.<init>(); r0 = r27; r9.setOnClickListener(r0); r6 = 3676; // 0xe5c float:5.151E-42 double:1.816E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r28 = new android.text.SpannableString; r0 = r28; r0.<init>(r12); r29 = new android.text.style.UnderlineSpan; r0 = r29; r0.<init>(); r3 = r12.length(); r6 = 0; r8 = 0; r0 = r28; r1 = r29; r0.setSpan(r1, r6, r3, r8); r6 = 2131690228; // 0x7f0f02f4 float:1.9009494E38 double:1.053194909E-314; r0 = r42; r9 = r0.findViewById(r6); r30 = r9; r30 = (android.widget.TextView) r30; r10 = r30; r0 = r28; r10.setText(r0); r31 = new com.waze.carpool.CarpoolRiderJoinRequest$4; r0 = r31; r1 = r42; r0.<init>(); r0 = r31; r10.setOnClickListener(r0); return; L_0x01ef: r6 = 2131690215; // 0x7f0f02e7 float:1.9009467E38 double:1.053194903E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 0; r9.setVisibility(r6); r6 = 2131690216; // 0x7f0f02e8 float:1.900947E38 double:1.0531949033E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 0; r9.setVisibility(r6); r6 = 2131690215; // 0x7f0f02e7 float:1.9009467E38 double:1.053194903E-314; r0 = r42; r9 = r0.findViewById(r6); r32 = r9; r32 = (android.widget.TextView) r32; r10 = r32; r6 = 3671; // 0xe57 float:5.144E-42 double:1.8137E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r10.setText(r12); r6 = 2131690217; // 0x7f0f02e9 float:1.9009471E38 double:1.053194904E-314; r0 = r42; r9 = r0.findViewById(r6); r33 = r9; r33 = (android.widget.TextView) r33; r10 = r33; r6 = 3672; // 0xe58 float:5.146E-42 double:1.814E-320; r12 = com.waze.strings.DisplayStrings.displayString(r6); r6 = 1; r0 = new java.lang.Object[r6]; r22 = r0; r0 = r42; r4 = r0.mDrive; r0 = r42; r34 = r0.getContext(); r0 = r34; r23 = r4.getRewardString(r0); r6 = 0; r22[r6] = r23; r0 = r22; r12 = java.lang.String.format(r12, r0); r10.setText(r12); r0 = r42; r4 = r0.mDrive; r0 = r42; r34 = r0.getContext(); r0 = r34; r12 = r4.getOriginalRewardString(r0); if (r12 == 0) goto L_0x02b3; L_0x0269: r6 = 3673; // 0xe59 float:5.147E-42 double:1.8147E-320; r23 = com.waze.strings.DisplayStrings.displayString(r6); r6 = 1; r0 = new java.lang.Object[r6]; r22 = r0; r6 = 0; r22[r6] = r12; r0 = r23; r1 = r22; r12 = java.lang.String.format(r0, r1); r28 = new android.text.SpannableString; r0 = r28; r0.<init>(r12); r35 = new android.text.style.StrikethroughSpan; r0 = r35; r0.<init>(); r3 = r12.length(); r6 = 0; r8 = 0; r0 = r28; r1 = r35; r0.setSpan(r1, r6, r3, r8); r6 = 2131690218; // 0x7f0f02ea float:1.9009473E38 double:1.0531949043E-314; r0 = r42; r9 = r0.findViewById(r6); r36 = r9; r36 = (android.widget.TextView) r36; r10 = r36; goto L_0x02ad; L_0x02aa: goto L_0x006a; L_0x02ad: r0 = r28; r10.setText(r0); goto L_0x02aa; L_0x02b3: r6 = 2131690218; // 0x7f0f02ea float:1.9009473E38 double:1.0531949043E-314; r0 = r42; r9 = r0.findViewById(r6); goto L_0x02c0; L_0x02bd: goto L_0x006a; L_0x02c0: r6 = 8; r9.setVisibility(r6); goto L_0x02bd; goto L_0x02ca; L_0x02c7: goto L_0x00f0; L_0x02ca: r12 = ""; goto L_0x02c7; L_0x02cd: r6 = 2131690222; // 0x7f0f02ee float:1.9009482E38 double:1.0531949063E-314; r0 = r42; r9 = r0.findViewById(r6); goto L_0x02da; L_0x02d7: goto L_0x0154; L_0x02da: r6 = 8; r9.setVisibility(r6); goto L_0x02d7; L_0x02e0: r6 = 2131690213; // 0x7f0f02e5 float:1.9009463E38 double:1.053194902E-314; r0 = r42; r9 = r0.findViewById(r6); r37 = r9; r37 = (android.widget.TextView) r37; r10 = r37; r6 = 1; r0 = new java.lang.Object[r6]; r22 = r0; r0 = r42; r2 = r0.mRidesJoined; r3 = r2.length; r38 = java.lang.Integer.valueOf(r3); r6 = 0; r22[r6] = r38; r6 = 3669; // 0xe55 float:5.141E-42 double:1.8127E-320; r0 = r22; r12 = com.waze.strings.DisplayStrings.displayStringF(r6, r0); r10.setText(r12); r6 = 2131690219; // 0x7f0f02eb float:1.9009475E38 double:1.053194905E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); r6 = 2131690220; // 0x7f0f02ec float:1.9009477E38 double:1.0531949053E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); r6 = 2131690224; // 0x7f0f02f0 float:1.9009486E38 double:1.0531949073E-314; r0 = r42; r9 = r0.findViewById(r6); r6 = 8; r9.setVisibility(r6); r6 = 2131690225; // 0x7f0f02f1 float:1.9009488E38 double:1.0531949077E-314; r0 = r42; r9 = r0.findViewById(r6); r40 = r9; r40 = (com.waze.view.button.RidersImages) r40; r39 = r40; r6 = 0; r0 = r39; r0.setVisibility(r6); r0 = r39; r0.clearImages(); r0 = r42; r2 = r0.mRidesJoined; r3 = r2.length; r41 = 0; L_0x0356: r0 = r41; if (r0 >= r3) goto L_0x017c; L_0x035a: r16 = r2[r41]; r0 = r16; r0 = r0.rider; r17 = r0; r12 = r0.getImage(); r0 = r39; r0.addImage(r12); r41 = r41 + 1; goto L_0x0356; */ throw new UnsupportedOperationException("Method not decompiled: com.waze.carpool.CarpoolRiderJoinRequest.initLayout():void"); } public CarpoolRiderJoinRequest(ActivityBase $r1, CarpoolDrive $r2, CarpoolRide[] $r3) throws { super($r1, C1283R.style.NoDimDialog); this.mRidesJoined = $r3; this.mDrive = $r2; this.mCpnm = CarpoolNativeManager.getInstance(); this.mActivity = $r1; if (this.mActivity instanceof MainActivity) { ((MainActivity) this.mActivity).addOrientationTracker(this); } initLayout(); } public static void showMultipxIntroPopup(ActivityBase $r0, Runnable $r1) throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_MULTIPAX_INTRO_POPUP_SHOWN).send(); final ActivityBase activityBase = $r0; final Runnable runnable = $r1; Dialog $r9 = MsgBox.openConfirmDialogJavaCallback(DisplayStrings.displayString(DisplayStrings.DS_CARPOOL_MPAX_INTRO_TITLE), DisplayStrings.displayString(DisplayStrings.DS_CARPOOL_MPAX_INTRO_TEXT), false, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int $i0) throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_MULTIPAX_INTRO_POPUP_CLICKED).addParam("ACTION", $i0 == 0 ? "CLOSE" : "SETTINGS").send(); if ($i0 != 0) { activityBase.startActivityForResult(new Intent(activityBase, SettingsCarpoolSeatsActivity.class), 0); if (runnable != null) { runnable.run(); } } } }, DisplayStrings.displayString(DisplayStrings.DS_CARPOOL_MPAX_INTRO_SET_RIDERS), DisplayStrings.displayString(DisplayStrings.DS_CARPOOL_MPAX_INTRO_CLOSE), -1, "carpool_multipax_popup_illustration", new C15306(), false, true, false); if ($r9 != null) { ImageView $r11 = (ImageView) $r9.findViewById(C1283R.id.confirmImage); $r11.getLayoutParams().width = -2; $r11.getLayoutParams().height = -2; } } public void show() throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_RIDER_JOINED_OVERLAY_SHOWN).addParam(AnalyticsEvents.ANALYTICS_EVENT_INFO_DRIVE_ID, this.mDrive.getId()).addParam(AnalyticsEvents.ANALYTICS_EVENT_INFO_RIDER_USER_ID, this.mRidesJoined[0].rider.getId()).addParam(AnalyticsEvents.ANALYTICS_EVENT_INFO_NUM_RIDERS, (long) this.mRidesJoined.length).send(); super.show(); } public void onOrientationChanged(int orientation) throws { initLayout(); } public void onBackPressed() throws { AnalyticsBuilder.analytics(AnalyticsEvents.ANALYTICS_EVENT_RW_RIDER_JOINED_OVERLAY_CLICKED).addParam("ACTION", "BACK").send(); super.onBackPressed(); } }
[ "laiduling@alumni.ubc.ca" ]
laiduling@alumni.ubc.ca
7a0696e81ff0edbc7047073055240f5839689b82
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_037b8ef1bcbf9fdd66a93dfa27804d69a5c41815/IndexUpdater/2_037b8ef1bcbf9fdd66a93dfa27804d69a5c41815_IndexUpdater_t.java
a89ec54b87d8cfa095d1b23def2f11ae53a6fc0e
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,960
java
package no.feide.moria.directory; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; import java.util.TimerTask; import no.feide.moria.directory.index.DirectoryManagerIndex; import no.feide.moria.log.MessageLogger; /** * This is the task responsible for periodically checking for a new index file, * and, if necessary update the existing index. */ public class IndexUpdater extends TimerTask { /** The message logger. */ private final static MessageLogger log = new MessageLogger(IndexUpdater.class); /** The location of the index file. */ private final String filename; /** The timestamp of the last read index file. Initially set to 0 (zero). */ private long timestamp = 0; /** The instance of Directory Manager that created this task. */ private final DirectoryManager owner; /** * Constructor. * @param dm * The instance of Directory Manager that created this instance. * Required since <code>IndexUpdater</code> uses this object * directly to update its index. Cannot be <code>null</code>. * @param indexFilename * The index filename. Cannot be <code>null</code>. */ public IndexUpdater(DirectoryManager dm, final String indexFilename) { super(); // Sanity checks. if (dm == null) throw new IllegalArgumentException("Directory Manager cannot be NULL"); if (indexFilename == null) throw new IllegalArgumentException("Index file name cannot be NULL"); // Set some local variables. owner = dm; filename = indexFilename; } /** * Performs the periodic update of the DirectoryManager's index, by calling * the <code>DirectoryManager.updateIndex(DirectoryManagerIndex)</code> * method. * @see java.lang.Runnable#run() * @see DirectoryManager#updateIndex(DirectoryManagerIndex) */ public void run() { owner.updateIndex(readIndex()); } /** * Reads an index file and create a new index object. <br> * <br> * Note that this method is also called by * <code>DirectoryManager.setConfig(Properties)</code> to force through an * initial update of the index. * @param filename * The filename of the index. Cannot be <code>null</code>. * @return The newly read index, as an object implementing the * <code>DirectoryManagerIndex</code> interface. Will return * <code>null</code> if this method has already been used to * successfully read an index file, and the file has not been * updated since (based on the file's timestamp on disk, as per the * <code>File.lastModified()</code> method). * @throws IllegalArgumentException * If <code>filename</code> is <code>null</code>. * @throws DirectoryManagerConfigurationException * If the index file does not exist, or if unable to read from * the file, or if unable to instantiate the index as a * <code>DirectoryManagerIndex</code> object. * @see java.io.File#lastModified() * @see DirectoryManager#setConfig(Properties) */ protected DirectoryManagerIndex readIndex() { // Sanity check. if (filename == null) throw new IllegalArgumentException("Index filename cannot be NULL"); // Check if the index file exists. File indexFile = new File(filename); if (!indexFile.isFile()) throw new DirectoryManagerConfigurationException("Index file " + filename + " does not exist"); // Check if we have received a newer index file than the one previously // read. if (timestamp >= indexFile.lastModified()) return null; // No update necessary. timestamp = indexFile.lastModified(); DirectoryManagerIndex index = null; try { // Read the new index from file. ObjectInputStream in = new ObjectInputStream(new FileInputStream(filename)); index = (DirectoryManagerIndex) in.readObject(); in.close(); } catch (FileNotFoundException e) { throw new DirectoryManagerConfigurationException("Index file " + filename + " does not exist"); } catch (IOException e) { throw new DirectoryManagerConfigurationException("Unable to read index from file " + filename, e); } catch (ClassNotFoundException e) { throw new DirectoryManagerConfigurationException("Unable to instantiate index object", e); } timestamp = indexFile.lastModified(); return index; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8629bf8b983d9bd3a12fe0a976c1ec32bc7bbf91
609e835b1cf47ee6abddde936767fdf55150fef0
/src/com/oryzone/mvdetector/detectorEvents/WarningEndedEvent.java
f9a17e3487f8738cd56d7579b02a80bbae7b49a7
[]
no_license
lmammino/movementDetector
7873299d37b2a47a263317e8872feaa2ffc64f2d
826d351d14042e1fb8b4cc16ea00c50edea6e0f1
refs/heads/master
2020-05-16T23:25:34.967796
2011-07-06T10:33:53
2011-07-06T10:33:53
1,498,529
1
2
null
2019-10-11T09:07:56
2011-03-18T23:58:27
Java
UTF-8
Java
false
false
470
java
package com.oryzone.mvdetector.detectorEvents; import com.oryzone.mvdetector.Detector; /** * Event class to describe the Warning ended event * @author Luciano Mammino, Andrea Mangano * @version 1.0 * @see WarningStartedEvent */ public class WarningEndedEvent extends DetectorEvent { /** * Constructor * @param detector the detector that fired the event */ public WarningEndedEvent(Detector detector) { super(detector); } }
[ "lmammino@oryzone.com" ]
lmammino@oryzone.com
a9634cd335f23b946aa936c081877e4310f6b89a
fa7d2dec58150b22eda854e1cac55aac47803079
/src/test/java/RacingGame/CarTest.java
401f46efc5ef7264e1c0c4cd21be3c1f78272026
[]
no_license
leechGamer/java-racingcar-playground
6db0a4ab39510f7c65638f55f4c42064ba53dbc1
36d1cd56638dcf3d452f638b574a39fa3eb39e78
refs/heads/main
2023-06-27T06:43:47.669914
2021-07-11T07:54:50
2021-07-11T07:54:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package RacingGame; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class CarTest { @Test void test() { // Given String name = "name1"; // When Car car = new Car(name); // Then Assertions.assertEquals(car.name, name); } }
[ "gebae@olulo.io" ]
gebae@olulo.io
7779bffbeeaca136b4c444a4a10f51108667bbed
9ee9b64c0775b4e4a2a19ba96e4ed751c21387f2
/app/src/main/java/com/example/mike/masterdetailflowlayoutexample/dummy/DummyContent.java
09112025de07a2827e0b83883531402767b7570c
[]
no_license
hegglinmichael/MasterDetailFlowLayoutEx
3684ee94bf281c6139779bb8849f635ef5e005cb
cef395e9034384d044567e0ab6507c1551cae407
refs/heads/master
2021-01-23T01:17:37.652654
2017-05-30T18:28:46
2017-05-30T18:28:46
92,863,683
0
0
null
null
null
null
UTF-8
Java
false
false
1,555
java
package com.example.mike.masterdetailflowlayoutexample.dummy; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Helper class for providing sample content for user interfaces created by * Android template wizards. * <p/> * TODO: Replace all uses of this class before publishing your app. */ public class DummyContent { /** * An array of sample (dummy) items. */ public static List<DummyItem> ITEMS = new ArrayList<DummyItem>(); /** * A map of sample (dummy) items, by ID. */ public static Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>(); //adding items to the list above static { // Add 3 sample items. addItem(new DummyItem("1", "something", "could put url here")); addItem(new DummyItem("2", "a picture", "could put url here")); addItem(new DummyItem("3", "pizza", "could put url here")); } private static void addItem(DummyItem item) { ITEMS.add(item); ITEM_MAP.put(item.id, item); } /** * A dummy item representing a piece of content. */ public static class DummyItem { public String id = ""; public String item_name=""; public String url = ""; public DummyItem(String id, String item_name, String url) { this.id = id; this.item_name = item_name; this.url = url; } @Override public String toString() { return item_name; } } }
[ "mhegglinmichael@gmail.com" ]
mhegglinmichael@gmail.com
e602e35f59a83e6585c574402e64a74c796113ad
f41f17c8f121b56aa704f153505168d357d53cf3
/Rockwell_automation/src/com/RA/libraries/Utility_libraries.java
15b9123b1360c6628ac565003c2e35510599b120
[]
no_license
Sourabh1924/Selenium_with_java
ecd4e69c0763e66230b5787836426f81262d0383
54741ecbce9b624684f880f8b826c3a5f5a1738a
refs/heads/master
2020-03-10T02:24:08.696092
2018-04-12T18:24:56
2018-04-12T18:24:56
129,135,991
0
0
null
null
null
null
UTF-8
Java
false
false
7,179
java
package com.RA.libraries; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.testng.Assert; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; import atu.testng.reports.ATUReports; import atu.testng.reports.logging.LogAs; import atu.testng.selenium.reports.CaptureScreen; import atu.testng.selenium.reports.CaptureScreen.ScreenshotOf; public class Utility_libraries { public static WebDriver driver; static String Folder_path = System.getProperty("user.dir")+"\\src\\Test_Result\\RA_Login_Logout"+Utility_libraries.Time_stamp(); static String Excel_path = Folder_path+"\\Excelreport"+Utility_libraries.Time_stamp()+".xls"; //----------------------------------------Launch browser------------------------------------------ public static WebDriver getBrowser(String strBrowserName) { switch(strBrowserName.toLowerCase()) { //launch in firefox case "firefox": driver=new FirefoxDriver(); break; //------------------------------------------------ //launch in chrome case "chrome": System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"\\Drivers\\chromedriver.exe"); driver=new ChromeDriver(); break; //------------------------------------------------ //launch in internetexplore case "internetexplore": System.setProperty("webdriver.ie.driver", System.getProperty("user.dir")+"\\IEDriverServer.exe"); driver=new InternetExplorerDriver(); case "ie": System.setProperty("webdriver.ie.driver", System.getProperty("user.dir")+"\\Drivers\\IEDriverServer.exe"); driver=new InternetExplorerDriver(); //------------------------------------------------ default: System.out.println("Driver is not found "+strBrowserName); } return driver; } //----------------------------------------Extend Report------------------------------------------- public static ExtentReports Report() { ExtentReports report1 = new ExtentReports(Folder_path+"\\Test"+Utility_libraries.Time_stamp()+".html"); report1.addSystemInfo("Browser","Internet Explore"); report1.addSystemInfo("Java version", "JDK 8"); report1.addSystemInfo("Machine", "iDeliver8"); report1.config().documentTitle("Sourabh"); report1.config().reportHeadline("Selenium"); report1.config().reportName("Automation"); return report1; } //----------------------------------------Time Stamp---------------------------------------------- public static String Time_stamp() { Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd-mm-yyyy-hh-mm-ss"); String time = dateFormat.format(now); return time; } //----------------------------------------Screen Report------------------------------------------- public static String Screen_Report(WebDriver driver) throws Throwable { File source_image = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); String Image_path = Folder_path+"\\Screeshot"+Utility_libraries.Time_stamp()+".png"; File Desti_image = new File(Image_path); FileUtils.copyFile(source_image,Desti_image); return ""+Desti_image; } //----------------------------------------Zip folder---------------------------------------------- public static void Zip_folder(String Zip_folder) { try { File inFolder=new File(Folder_path); File outFolder=new File(Folder_path+"\\"+Zip_folder+".zip"); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFolder))); BufferedInputStream in = null; byte[] data = new byte[1000]; String files[] = inFolder.list(); for (int i=0; i<files.length; i++) { in = new BufferedInputStream(new FileInputStream(inFolder.getPath() + "/" + files[i]), 1000); out.putNextEntry(new ZipEntry(files[i])); int count; while((count = in.read(data,0,1000)) != -1) { out.write(data, 0, count); } out.closeEntry(); } out.flush(); out.close(); } catch(Exception e) { e.printStackTrace(); } } //--------------------------------------Delete the subfolder-------------------------------------- public static void Delete_folder() throws IOException { File file = new File(System.getProperty("user.dir")+"\\src\\Test_Result"); File[] files = file.listFiles(); for(File eachfile: files) { File Subfile = new File(eachfile.getAbsolutePath()); if ( eachfile.lastModified() > 3 * 86400000) { FileUtils.deleteDirectory(new File(Subfile.getAbsolutePath())); } } } //-----------------------------------ATU reporter for pass condition------------------------------- public static void ATUReport_Pass(String Detail,String value,String Expected,String Actual) { ATUReports.add(Detail,value,Expected,Actual,LogAs.PASSED, new CaptureScreen(ScreenshotOf.DESKTOP)); ATUReports.setAuthorInfo("Sourabh Chakroborty", new SimpleDateFormat("MM_dd_y_hhmmssa").format(new Date()), "1.0"); } //-----------------------------------ATU reporter for fail condition------------------------------- public static void ATUReport_Fail(String Detail,String value,String Expected,String Actual) { ATUReports.add(Detail,value,Expected,Actual,LogAs.FAILED, new CaptureScreen(ScreenshotOf.DESKTOP)); ATUReports.setAuthorInfo("Sourabh Chakroborty", new SimpleDateFormat("MM_dd_y_hhmmssa").format(new Date()), "1.0"); } public static void Close(WebDriver driver,ExtentReports report1,ExtentTest logger) { report1.endTest(logger); report1.flush(); driver.close(); //System.exit(1); } public static String GetElement(String Keys,String OR_name) throws Throwable { FileInputStream pagobj =null; Properties obj = new Properties(); try { pagobj = new FileInputStream (System.getProperty("user.dir")+"\\src\\com\\RA\\properties"+"\\"+OR_name+".properties"); } catch (Exception e) { System.out.println("File is not found"); } obj.load(pagobj); return obj.getProperty(Keys); } public static String[] Verify_value(String[] Array,ExtentTest logger) { for(int i=0;i<=Array.length-1;i++) { Assert.assertNotNull(Array[i].toString(), "Value is present"); logger.log(LogStatus.PASS,Array[i].toString(), "Value is present"); } return Array; } }
[ "memo.sourabh@gmail.com" ]
memo.sourabh@gmail.com
076d2b9aeadb56ee9a20c9a3867c0ec937f25b15
79ad096063f4a7806ed7c6e8ae2311603bdafa00
/app/src/main/java/com/mohammed/hmod_/animeapp/widget/FavAppWidgetProvider.java
4526a2e6af773ca043f791275c5358eeae323861
[]
no_license
mohammedAlefrangy/AnimeApp
bd80720403c6727be0f782af47499883d2ad7eaa
fe5ced1ded42cc936c6d5b388421d96cff0891c0
refs/heads/master
2020-04-08T01:57:48.930087
2019-05-01T15:15:15
2019-05-01T15:15:15
158,916,372
0
0
null
null
null
null
UTF-8
Java
false
false
2,639
java
package com.mohammed.hmod_.animeapp.widget; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; import android.content.Intent; import android.view.View; import android.widget.RemoteViews; import com.mohammed.hmod_.animeapp.DataBase.FavoritesaAnimeEntity; import com.mohammed.hmod_.animeapp.MainActivity; import com.mohammed.hmod_.animeapp.R; import java.util.List; public class FavAppWidgetProvider extends AppWidgetProvider { private static final String TAG = "FavAppWidgetProvider"; static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, List<FavoritesaAnimeEntity> favss, int appWidgetId) { StringBuilder s = new StringBuilder(); for (FavoritesaAnimeEntity favs : favss) { s.append(favs.getCanonicalTitle() + "\n"); } RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.anime_app_widget); if (favss != null) { if (favss.isEmpty()) { views.setViewVisibility(R.id.empty, View.VISIBLE); views.setViewVisibility(R.id.listFav, View.INVISIBLE); } else { views.setViewVisibility(R.id.empty, View.INVISIBLE); views.setViewVisibility(R.id.listFav, View.VISIBLE); views.setTextViewText(R.id.listFav, s); } } Intent intent = new Intent(context, MainActivity.class); PendingIntent pendingInetent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.empty, pendingInetent); views.setOnClickPendingIntent(R.id.listFav, pendingInetent); // Instruct the widget manager to update the widget appWidgetManager.updateAppWidget(appWidgetId, views); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { } public static void updateAppWidgetFav(Context context, AppWidgetManager appWidgetManager, List<FavoritesaAnimeEntity> favoritesaAnimeEntities, int[] appWidgetIds) { for (int appWidgetId : appWidgetIds) { updateAppWidget(context, appWidgetManager, favoritesaAnimeEntities, appWidgetId); } } @Override public void onEnabled(Context context) { // Enter relevant functionality for when the first widget is created } @Override public void onDisabled(Context context) { // Enter relevant functionality for when the last widget is disabled } }
[ "mohamed.alefrangy@gmail.com" ]
mohamed.alefrangy@gmail.com
8812cd8fac38fc67396483d3e7f9c49cbbec530d
ca1392a3dea2ccf4dfc44c8d3605a0ecf6d8d81a
/src/main/java/fr/esiea/offerTypes/TwoForAmount.java
4592b4c19ab552e2b27a50d72b9837933b7417d5
[ "Apache-2.0" ]
permissive
CloudStrife1995/supermarket-receipt
1171a7c37b8212da7a804fe60cc92e2bf62d8be4
7dbfe7493b1b15b4b18ee6cdc78681503d35b362
refs/heads/master
2020-04-16T18:17:55.497677
2019-02-27T18:27:03
2019-02-27T18:27:03
165,813,239
0
0
Apache-2.0
2019-02-26T02:55:23
2019-01-15T08:26:28
Java
UTF-8
Java
false
false
793
java
package fr.esiea.offerTypes; import fr.esiea.Product; import fr.esiea.Discount; public class TwoForAmount extends SpecialOffer { Double discountedPriceFor2Products; public TwoForAmount(Double discountedPriceFor2Products) { this.discountedPriceFor2Products= discountedPriceFor2Products; } public Discount getDiscount(Double unitPrice, Double quantityBought, Product product) { int quantityAsInt = quantityBought.intValue(); Discount discount = null; if (quantityAsInt >= 2) { double total = discountedPriceFor2Products * quantityAsInt / 2 + quantityAsInt % 2 * unitPrice; double discountN = unitPrice * quantityBought - total; discount = new Discount(product, "2 for " + discountedPriceFor2Products, discountN); } return discount; } }
[ "akiyaraguideau@gmail.com" ]
akiyaraguideau@gmail.com
cca602e06f53a6b9b9d4b4008ac514839aee7bbe
37ec8fac000226bacac1292ae790609c65f362d1
/jd-client-v1.40/src/gen/java/org/sourcepit/jd/client/Node.java
a8524884565c555284f0508cf4a8774c9a81bf1b
[]
no_license
sourcepit/jd
d24a3d98d4e2c4d1acd1aeef9a624e630851ca1c
91b1e8832cc5f35ecd249a6465f02b64c43491df
refs/heads/master
2022-11-23T01:37:50.092295
2019-11-22T16:21:01
2019-11-22T16:21:01
85,931,859
0
0
null
2022-11-16T07:54:31
2017-03-23T09:35:54
Java
UTF-8
Java
false
false
738
java
package org.sourcepit.jd.client; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data @JsonInclude(Include.NON_NULL) public class Node { @JsonProperty("ID") private String iD; @JsonProperty("Version") private ObjectVersion version; @JsonProperty("CreatedAt") private String createdAt; @JsonProperty("UpdatedAt") private String updatedAt; @JsonProperty("Spec") private NodeSpec spec; @JsonProperty("Description") private NodeDescription description; @JsonProperty("Status") private NodeStatus status; @JsonProperty("ManagerStatus") private ManagerStatus managerStatus; }
[ "bernd.vogt@zf.com" ]
bernd.vogt@zf.com
21b760a84a65c430a9a8771d8de4fa931eddea86
d743df1183e8c377a1f40457d0230564ba820dba
/SplitExpensesApp/app/src/main/java/com/example/sushmithasjois/sliceup/CheckBalance.java
3925278e5849c04581e10bc51b9f146500d7b5e4
[]
no_license
DarshanRPrasad/Android-App-Development
68d5e124aa8edb4677fab7e95034a2c7cda67670
08ce9bea9e80813d678f705aefa6db047fe16ac4
refs/heads/master
2020-08-29T21:26:38.277460
2019-10-29T01:58:41
2019-10-29T01:58:41
218,177,898
0
0
null
null
null
null
UTF-8
Java
false
false
3,760
java
package com.example.sushmithasjois.sliceup; import android.content.Context; import android.content.DialogInterface; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.ListViewCompat; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; public class CheckBalance extends AppCompatActivity { ListView lv; ArrayList<String> array; ArrayAdapter<String> arrayAdapter; SQLiteDatabase db; String msg; Button b4; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_check_balance); lv=(ListView)findViewById(R.id.listview); b4=(Button)findViewById(R.id.button4); try{ db=openOrCreateDatabase("user", Context.MODE_PRIVATE, null); Cursor c=db.rawQuery("select * from debt",null); array=new ArrayList<String>(); if(c.getCount()==0){ } while(c.moveToNext()){ msg=c.getString(0)+" -> "+c.getString(1)+" Rs."+c.getInt(2); array.add(msg); } arrayAdapter=new ArrayAdapter<String>(getApplicationContext(),android.R.layout.simple_list_item_1,array); lv.setAdapter(arrayAdapter);} catch(Exception e){ Toast.makeText(CheckBalance.this,"All debts are cleared",Toast.LENGTH_SHORT).show(); } b4.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ try{ db.execSQL("drop table Members;"); db.execSQL("drop table event;"); db.execSQL("drop table debt;"); onCreate(savedInstanceState);} catch(Exception e){ Toast.makeText(CheckBalance.this, "All debts cleared", Toast.LENGTH_SHORT).show(); }Toast.makeText(CheckBalance.this, "All debts cleared", Toast.LENGTH_SHORT).show(); } }); lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, final int position, long id) { AlertDialog.Builder builder=new AlertDialog.Builder(CheckBalance.this); builder.setPositiveButton("Yes",new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog,int id) { String item= arrayAdapter.getItem(position); arrayAdapter.remove(item); lv.setAdapter(arrayAdapter); String[] items=item.split(" -> "); String item1=items[0]; String[] items2=items[1].split(" Rs."); db.execSQL("delete from debt where toPay='"+item1.trim()+"' and toBePaid='"+items2[0].trim()+"';"); } }); builder.setNegativeButton("No",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int id) { // if this button is clicked, just close // the dialog box and do nothing dialog.cancel(); } }); builder.setCancelable(true); builder.setTitle("SETTLE DEBT?"); builder.show(); } }); } }
[ "darshanr@usc.edu" ]
darshanr@usc.edu
4b2b9a3a260806113a417b80d4669dc6d5a1f1ec
4121d666c2c4f0e36db16b757e09478d1ff8d7e1
/src/exercise/TestCycleQueue.java
983dbafd8b82c6d6dd5beed99b0864af79a2dcda
[]
no_license
caicaiyue/beforeexercise
0ef583297526b888234fd59c26694aa3f1266efb
868f48b6bb2523cd5a9d637f4511df2c4915d6f6
refs/heads/master
2022-11-29T06:07:14.806655
2020-08-11T02:46:26
2020-08-11T02:46:26
286,627,550
0
0
null
null
null
null
GB18030
Java
false
false
1,244
java
package exercise; public class TestCycleQueue { int front; int rear; int[] array; TestCycleQueue(int capacity){ array = new int[capacity]; } public void intoQueue(int data){ if((rear+1)%array.length==front){ System.out.println("队列满了,不能插数据了"); return; } array[rear]=data; rear = (rear+1)%array.length; } public void popQueue(){ if(front==rear){ System.out.println("队列为空,不能删除"); }else{ int remove = array[front]; front = (front+1)%array.length; } } public void printCycleQueue(){ for(int i=front;i!=rear;i=(i+1)%array.length){ System.out.println(array[i]); } } public static void main(String[] args) { // TODO Auto-generated method stub TestCycleQueue cq = new TestCycleQueue(8); cq.intoQueue(6); cq.intoQueue(7); cq.intoQueue(2); cq.intoQueue(8); cq.intoQueue(5); cq.intoQueue(1); cq.intoQueue(4); //cq.intoQueue(9); cq.printCycleQueue(); System.out.println("***********"); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.popQueue(); cq.printCycleQueue(); } }
[ "wuyuemia@sina.com" ]
wuyuemia@sina.com
d89482747ba41db5d0bf77c56e6747726d074cac
e8d426d78fe1dbd3a2ff86de13641a05ddf0b65b
/src/com/svs/StringToInt.java
ccd09a3841940b43e626b4bc354497baa34ea9d1
[]
no_license
sagarvitthalsawant/CoderPad
4eddb00e9b04af712e717bd16e5cf286661f4b42
49cbc130165db0416208e36ff384d3ac9db89142
refs/heads/master
2022-09-01T11:32:41.799834
2020-05-27T22:31:25
2020-05-27T22:31:25
266,880,541
0
0
null
null
null
null
UTF-8
Java
false
false
268
java
package com.svs; public class StringToInt { public static void main(String[] args) { int intgr = Integer.parseInt("12345"); int intger = Integer.valueOf("996734569"); System.out.println(intgr); System.out.println(intger); } }
[ "sagarsawant2100@gmail.com" ]
sagarsawant2100@gmail.com
86b7c664b0261b22677562bf961e30887eed1e63
7b41950772471f6ffd9838aa6be636b27f12ccc8
/Coordinates/src/runner/Runner.java
768b09f392856808b80d4d48c674458c37f32d9d
[]
no_license
nicolasmendez001/Programacion_II
17596d31b274617f19ea749074f250b408c31395
47e4889fc09c3a072616050353c6cb5b61993dc4
refs/heads/master
2021-01-20T06:53:13.670125
2017-06-07T19:59:50
2017-06-07T19:59:50
89,939,863
0
0
null
null
null
null
UTF-8
Java
false
false
172
java
package runner; import controller.Controller; public class Runner { public static void main(String[] args) { Controller controller = new Controller(); } }
[ "mnikolas001@hotmail.com" ]
mnikolas001@hotmail.com
ccdbce4b0f286327f9816f5ec47e79f3213ed83e
c844d018e7056c5da2083844021d2069fb3411de
/app/src/main/java/com/example/dinesh/eventadminapp/ExistingActivity.java
d11726b55cbad623fd7e0aec811fc75c64b4b873
[]
no_license
dukedinesh/EventAppAdmin
aa0949450fe2004dfdbbe4430c0b7f0bd5be6524
a30a7bf64ab42ec2652d4231af5110b2258b844f
refs/heads/master
2020-03-28T22:47:59.773988
2018-09-18T09:01:48
2018-09-18T09:01:48
149,258,756
0
0
null
null
null
null
UTF-8
Java
false
false
4,609
java
package com.example.dinesh.eventadminapp; import android.content.Context; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; public class ExistingActivity extends AppCompatActivity { private RecyclerView mUploadList; ProgressBar progressBar; private DatabaseReference mUsersDatabase; Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_existing); toolbar = (Toolbar) findViewById(R.id.toolbar); this.setSupportActionBar(toolbar); this.getSupportActionBar().setTitle("Events"); this.getSupportActionBar().setDisplayHomeAsUpEnabled(true); mUploadList = (RecyclerView) findViewById(R.id.upload_list); progressBar = (ProgressBar)findViewById(R.id.progressBar); mUsersDatabase = FirebaseDatabase.getInstance().getReference().child("Events"); progressBar.setVisibility(View.VISIBLE); mUploadList.setLayoutManager(new LinearLayoutManager(this)); mUploadList.setHasFixedSize(true); FirebaseRecyclerAdapter<UsersEventData, FriendsViewHolder> friendsRecyclerView = new FirebaseRecyclerAdapter<UsersEventData, FriendsViewHolder>( UsersEventData.class, R.layout.single_event_requested, FriendsViewHolder.class, mUsersDatabase ) { @Override protected void populateViewHolder(final FriendsViewHolder viewHolder, UsersEventData model, int position) { final TextView btn = (TextView) viewHolder.itemView.findViewById(R.id.event); final String list_user_id = getRef(position).getKey(); if (getItemCount() > 0) { mUsersDatabase.child(list_user_id).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { final String userName = dataSnapshot.child("event_name").getValue().toString(); viewHolder.setName(userName); viewHolder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { /* Intent intent = new Intent(this, ReqSingleEvents.class); intent.putExtra("event_id", list_user_id); startActivity(intent);*/ } }); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { /* Intent intent = new Intent(this, ReqSingleEvents.class); intent.putExtra("event_id", list_user_id); startActivity(intent);*/ } }); progressBar.setVisibility(View.GONE); } @Override public void onCancelled(DatabaseError databaseError) { progressBar.setVisibility(View.GONE); } }); } } }; mUploadList.setAdapter(friendsRecyclerView); } public static class FriendsViewHolder extends RecyclerView.ViewHolder { View mView; public FriendsViewHolder(View itemView) { super(itemView); mView = itemView; } public void setName(String name) { TextView userName = (TextView) mView.findViewById(R.id.event); userName.setText(name); } } }
[ "dukedinesh143@gmail.com" ]
dukedinesh143@gmail.com
843abf43157eecf98d8c811877dfb11706b38330
4ff0a4070cb9f66e251e54d696dffe5fe923b822
/TestGit.java
5e0a88be21a53f51b9c02de0015f1d740d029da9
[]
no_license
SamoiliukIvan/testGit
26f428e7ea35700e64743ea36ff9ac789494f36b
e41d671b174e5c25a7059e3b97490b7eac10e901
refs/heads/master
2020-03-23T16:27:03.452904
2018-07-27T13:03:03
2018-07-27T13:03:03
141,810,091
0
0
null
null
null
null
UTF-8
Java
false
false
129
java
package com.Ivan; public class TestGit { public static void main(String[] args) { // TODO Auto-generated method stub } }
[ "bessob@fex.net" ]
bessob@fex.net
e5cc3a8484e84546a401ca3fd567beaafa2f15cf
b34654bd96750be62556ed368ef4db1043521ff2
/online_review_phases/tags/version-1.0.0.1/src/java/main/com/cronos/onlinereview/phases/ConfigurationException.java
b7f076c17ac06a6a4c979040de507b72c2cadf31
[]
no_license
topcoder-platform/tcs-cronos
81fed1e4f19ef60cdc5e5632084695d67275c415
c4ad087bb56bdaa19f9890e6580fcc5a3121b6c6
refs/heads/master
2023-08-03T22:21:52.216762
2019-03-19T08:53:31
2019-03-19T08:53:31
89,589,444
0
1
null
2019-03-19T08:53:32
2017-04-27T11:19:01
null
UTF-8
Java
false
false
1,204
java
/* * Copyright (C) 2009 TopCoder Inc., All Rights Reserved. */ package com.cronos.onlinereview.phases; import com.topcoder.util.errorhandling.BaseException; /** * <p> * Represents an exception related to loading configuration settings. Inner * exception should be provided to give more details about the error. It is used * in PhaseHandler implementation classes. * </p> * <p> * Thread safety: This class is immutable and thread safe. * </p> * * @author tuenm, bose_java * @version 1.0 */ public class ConfigurationException extends BaseException { /** * Create a new ConfigurationException instance with the specified error * message. * * @param message the error message of the exception */ public ConfigurationException(String message) { super(message); } /** * Create a new ConfigurationException instance with the specified error * message and inner exception. * * @param message the error message of the exception * @param cause the inner exception */ public ConfigurationException(String message, Throwable cause) { super(message, cause); } }
[ "Blues@fb370eea-3af6-4597-97f7-f7400a59c12a" ]
Blues@fb370eea-3af6-4597-97f7-f7400a59c12a
bee90972cbf5925afa747fd7f98d733482cc0eaf
02afb4952c36daa9d76061c20d5ccf5fda5fcb2f
/src/test/java/com/qa/crm/Java/ArrayConcept.java
dbafd3b0734833915aef05e2c3245dfd13c1c1c3
[]
no_license
ysvrvarma/GITVarma
4e7d09bad29249ba889f3df1386ada8164b0c6f4
5a4635263c0285ca2cf89186b9ed73881b2e6d26
refs/heads/master
2022-07-13T14:15:59.242784
2019-11-05T11:11:52
2019-11-05T11:11:52
216,863,597
0
0
null
2022-03-08T21:23:27
2019-10-22T16:47:59
HTML
UTF-8
Java
false
false
1,070
java
package com.qa.crm.Java; import java.util.Arrays; public class ArrayConcept { public static void main(String[] args) { // TODO Auto-generated method stub //integer array int a[]= new int[5]; a[0]=10; a[1]=20; a[2]=3; a[3]=5; a[4]=50; for(int i=0;i<a.length;i++) { System.out.println(a[i]); } //Double array of size 4 double x[]={10.1,11.22,22,33}; for( double y:x) { System.out.println(y); } //Char array char c[]= {'I','2','#'}; //System.out.println(c); for(int p=0;p<c.length;p++) { System.out.println(c[p]); } //5. String: String s[] = new String[3]; s[0]="Tom"; s[1]="test"; s[2]="selenium"; //System.out.println(Arrays.toString(s)); for (String str : s) { System.out.println(str); } boolean b[]=new boolean[2]; b[0]=false; b[1]=true; System.out.println("Java boolean Array "); for(int i=0; i < b.length;i++) { System.out.println("boolean array Element at : "+ i + " " + b[i]); } } }
[ "varma.ysvr@gmail.com" ]
varma.ysvr@gmail.com
f6966006d18e8d2a50136ecf6ef183f626945a4d
d98aa7aa4e7c31e2e89295122e2683c434216674
/app/src/main/java/co/com/ceiba/mobile/pruebadeingreso/repository/PostRepository.java
1fca99617b2f0dd2aa6e613795ef15433ba312ec
[]
no_license
Dagc1496/Prueba-Ceiba-Segundo-Intento
94acf37f5082409eaeb353426c19cdd4e298a87d
b660c9c8a1d837b25cdeb189596814e7bb4e4991
refs/heads/master
2020-07-07T11:17:02.111600
2019-08-20T08:30:28
2019-08-20T08:30:28
203,333,815
1
0
null
null
null
null
UTF-8
Java
false
false
2,722
java
package co.com.ceiba.mobile.pruebadeingreso.repository; import android.app.Application; import androidx.lifecycle.LiveData; import java.util.ArrayList; import java.util.List; import co.com.ceiba.mobile.pruebadeingreso.asyncTask.InsertPostAsyncTask; import co.com.ceiba.mobile.pruebadeingreso.repository.persistence.dao.PostDao; import co.com.ceiba.mobile.pruebadeingreso.repository.persistence.database.MyUserDatabase; import co.com.ceiba.mobile.pruebadeingreso.repository.persistence.entities.PostEntity; import co.com.ceiba.mobile.pruebadeingreso.repository.rest.Endpoints; import co.com.ceiba.mobile.pruebadeingreso.repository.rest.WebServiceData; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class PostRepository { private WebServiceData webServiceData; private PostDao postDao; private LiveData<List<PostEntity>> postLiveData; private ArrayList<PostEntity> postList; public PostRepository(Application application){ MyUserDatabase myUserDatabase = MyUserDatabase.getInstance(application); postDao = myUserDatabase.postDao(); postList = getAllPostListFromAPI(); } private void insertPost(ArrayList<PostEntity> posts){ for(int i =0; i<posts.size();i++){ new InsertPostAsyncTask(postDao).execute(posts.get(i)); } } private ArrayList<PostEntity> getAllPostListFromAPI(){ postList = new ArrayList<>(); if(isDBEmpty()){ postList = executeRestService(); } return postList; } public LiveData<List<PostEntity>> getPostsByUserId(String userId){ postLiveData = postDao.getPostByuserId(userId); return postLiveData; } private boolean isDBEmpty(){ return postDao.getAllPost().getValue() == null; } private ArrayList<PostEntity> executeRestService(){ final Retrofit retrofit =new Retrofit.Builder().baseUrl(Endpoints.URL_BASE) .addConverterFactory(GsonConverterFactory.create()) .build(); webServiceData = retrofit.create(WebServiceData.class); webServiceData.getAllPostsGet().enqueue(new Callback<ArrayList<PostEntity>>() { @Override public void onResponse(Call<ArrayList<PostEntity>> call, Response<ArrayList<PostEntity>> response) { postList = new ArrayList<>(); postList = response.body(); insertPost(postList); } @Override public void onFailure(Call<ArrayList<PostEntity>> call, Throwable t) { } }); return postList; } }
[ "dagc_1496@hotmail.com" ]
dagc_1496@hotmail.com
9643bbee3d1cb3a3c0c8d8afafe207ed69cc288a
6b7e979b28dd4e4f0ab60d4bf8576638fc5b4780
/src/main/java/net/courseproject/alex/veterinary/config/WebConfig.java
de88b879e6af444a6078f4890ffee69a41736cdd
[]
no_license
amphyzale/veterinary
9adbf030a40db9ea46f126b50d7488100a1601aa
2481299b0acc170509f104ea51b24c0a90e76998
refs/heads/master
2023-05-04T14:08:54.999619
2021-05-26T07:54:45
2021-05-26T07:54:45
341,575,400
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
package net.courseproject.alex.veterinary.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @EnableWebMvc @Configuration public class WebConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH") .allowedOriginPatterns("*") .allowCredentials(true); } }
[ "enforcer.snk@gmail.com" ]
enforcer.snk@gmail.com
5a33c9c7eccc82b7bf6f026c5110451f2ba3c4f4
35348f6624d46a1941ea7e286af37bb794bee5b7
/Ghidra/Debug/Debugger/src/main/java/ghidra/pcode/exec/AsyncWrappedPcodeExecutorState.java
8f5b38e06e49fecea459590c45cfbfa2fe360a53
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-3.0-only", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
StarCrossPortal/ghidracraft
7af6257c63a2bb7684e4c2ad763a6ada23297fa3
a960e81ff6144ec8834e187f5097dfcf64758e18
refs/heads/master
2023-08-23T20:17:26.250961
2021-10-22T00:53:49
2021-10-22T00:53:49
359,644,138
80
19
Apache-2.0
2021-10-20T03:59:55
2021-04-20T01:14:29
Java
UTF-8
Java
false
false
914
java
/* ### * IP: GHIDRA * * 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 ghidra.pcode.exec; import java.util.concurrent.CompletableFuture; public class AsyncWrappedPcodeExecutorState<T> extends AsyncWrappedPcodeExecutorStatePiece<T, T> implements PcodeExecutorState<CompletableFuture<T>> { public AsyncWrappedPcodeExecutorState(PcodeExecutorStatePiece<T, T> state) { super(state); } }
[ "46821332+nsadeveloper789@users.noreply.github.com" ]
46821332+nsadeveloper789@users.noreply.github.com
0616d9277fab8ca575fa242d8caba562814575b8
cb2e0b45e47ebeb518f1c8d7d12dfa0680aed01c
/openbanking-api-soap-transform/src/main/gen/com/laegler/openbanking/soap/model/LoanProviderInterestRateType.java
3c32514b1d0d8a7490e627ee5f959436c5a78c27
[ "MIT" ]
permissive
thlaegler/openbanking
4909cc9e580210267874c231a79979c7c6ec64d8
924a29ac8c0638622fba7a5674c21c803d6dc5a9
refs/heads/develop
2022-12-23T15:50:28.827916
2019-10-30T09:11:26
2019-10-31T05:43:04
213,506,933
1
0
MIT
2022-11-16T11:55:44
2019-10-07T23:39:49
HTML
UTF-8
Java
false
false
1,072
java
package com.laegler.openbanking.soap.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for LoanProviderInterestRateType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="LoanProviderInterestRateType"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt; * &lt;enumeration value="INBB"/&gt; * &lt;enumeration value="INFR"/&gt; * &lt;enumeration value="INGR"/&gt; * &lt;enumeration value="INLR"/&gt; * &lt;enumeration value="INNE"/&gt; * &lt;enumeration value="INOT"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> * */ @XmlType(name = "LoanProviderInterestRateType") @XmlEnum public enum LoanProviderInterestRateType { INBB, INFR, INGR, INLR, INNE, INOT; public String value() { return name(); } public static LoanProviderInterestRateType fromValue(String v) { return valueOf(v); } }
[ "thomas.laegler@googlemail.com" ]
thomas.laegler@googlemail.com
fd066ca450c8ec0e1fa1abce448cbb7529334c96
7dcfa0c365891ae6993e73f76b43d940984e41e4
/src/test/java/calculadora/FuncionalTest.java
2cc4fd0fc8a5959e7c612fdc30daa7ec835f263e
[]
no_license
deyson12/PokemonGo
228db43cc9df780ba58c2d14ba79aa014a35f4a3
6c157ef770b4b36fe30a03d71c0cfa6caee43ea0
refs/heads/master
2021-01-19T22:54:08.593124
2017-04-20T17:49:14
2017-04-20T17:49:14
88,888,260
0
0
null
null
null
null
UTF-8
Java
false
false
1,243
java
package calculadora; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.phantomjs.PhantomJSDriver; import org.openqa.selenium.phantomjs.PhantomJSDriverService; import org.openqa.selenium.remote.DesiredCapabilities; public class FuncionalTest { public void PruebaFuncional() { DesiredCapabilities caps = new DesiredCapabilities(); caps.setJavascriptEnabled(true); caps.setCapability("takesScreenshot", true); caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "phantomjs.exe" ); WebDriver driver = new PhantomJSDriver(caps); String url = "https://images.google.com"; String expectedTitle = "Imgenes de Google"; String actualTitle = ""; // Iniciar el navegador en la URL indicada driver.get(url); // Capturar el ttulo del sitio actualTitle = driver.getTitle(); // Cerrar navegador driver.close(); assertEquals(actualTitle,expectedTitle); } }
[ "deyson12@gmail.com" ]
deyson12@gmail.com
71c79adf7e29372dca3b67532fd759aecc4494b5
552b9cb0fee63bf661026fdb37aa28004d1299e9
/src/com/controller/EmployeeController.java
4ef5795e6396f741c2647f9a776a6a41b1898419
[]
no_license
malitao2017/tech27SringMVC
ff5857358815d735ee19d4e05911fe43dd8c6d49
a1536f4eed5d873dc94214165ac2d591459b72f1
refs/heads/master
2021-01-17T21:02:17.015717
2017-10-27T13:23:50
2017-10-27T13:23:50
84,157,754
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.service.EmployeeManager; @Controller @RequestMapping("/employee-module") public class EmployeeController { @Autowired EmployeeManager manager; @RequestMapping(value = "/getAllEmployees", method = RequestMethod.GET) public String getAllEmployees(Model model) { model.addAttribute("employees", manager.getAllEmployees()); return "employeesListDisplay"; } }
[ "934921721@qq.com" ]
934921721@qq.com
aaeb71ced2805368e8239e54469c4bb744de9640
94138ba86d0dbf80b387064064d1d86269e927a1
/group01/496740686/src/main/java/com/camile/_2/litestruts/bean/Action.java
2b3ff8889734a7c9e5bc460216d2df412b0094b6
[]
no_license
DonaldY/coding2017
2aa69b8a2c2990b0c0e02c04f50eef6cbeb60d42
0e0c386007ef710cfc90340cbbc4e901e660f01c
refs/heads/master
2021-01-17T20:14:47.101234
2017-06-01T00:19:19
2017-06-01T00:19:19
84,141,024
2
28
null
2017-06-01T00:19:20
2017-03-07T01:45:12
Java
UTF-8
Java
false
false
675
java
package com.camile._2.litestruts.bean; import java.util.ArrayList; import java.util.List; public class Action { private String name; private String clazz; private List<Result> results = new ArrayList<>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClazz() { return clazz; } public void setClazz(String clazz) { this.clazz = clazz; } public void addResult(Result result) { this.results.add(result); } public List<Result> getResults() { return results; } }
[ "aiassing@outlook.com" ]
aiassing@outlook.com
901217f19ba750a9fdbdf5814ff39f48591b58cc
4ac28ecfc2f16f0a01b206a9bea32947f44813b4
/src/main/java/edu/man/prod/service/ZahvatiService.java
2788a1d4b0258cf80aa5bc6fe04d9ebdb167f37b
[]
no_license
VladaStc/ManProd
bca1eb112f80c30c31039f96748e606c9e85c941
18816e99990b32a9bb5e4fdb7a0c1f2bdb5e6499
refs/heads/master
2020-04-04T15:27:33.000979
2018-11-04T01:26:40
2018-11-04T01:26:40
139,568,536
0
0
null
null
null
null
UTF-8
Java
false
false
761
java
package edu.man.prod.service; import edu.man.prod.domain.Zahvati; import java.util.List; import java.util.Optional; /** * Service Interface for managing Zahvati. */ public interface ZahvatiService { /** * Save a zahvati. * * @param zahvati the entity to save * @return the persisted entity */ Zahvati save(Zahvati zahvati); /** * Get all the zahvatis. * * @return the list of entities */ List<Zahvati> findAll(); /** * Get the "id" zahvati. * * @param id the id of the entity * @return the entity */ Optional<Zahvati> findOne(Long id); /** * Delete the "id" zahvati. * * @param id the id of the entity */ void delete(Long id); }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
a7576f0db279194f24e730fba3ea6f0593068193
435c44c515cef5466339510cd6db9ee4296d232a
/projects/youngmi/Assignment-3/Calendar/src/main/java/calendar/Appt.java
68a24ccf1ebb7d9642b454262dd676acff60edb7
[]
no_license
mwyoung/CS362-001-S2018
33d76746aafb21c20e5326584cddd1893c70286a
1987e7f332654ee685e4f508c77f7ab5a93c7e47
refs/heads/master
2020-03-08T06:21:05.690768
2018-06-09T21:18:11
2018-06-09T21:18:11
127,969,654
0
0
null
2018-04-03T21:14:42
2018-04-03T21:14:41
null
UTF-8
Java
false
false
11,520
java
/* * Appt.java */ package calendar; import org.w3c.dom.Element; /** * This class represents a single appointment that might be stored in * an xml file. The appointment consists of startHour, startMinute, * startDay, startMonth, startYear, title, description, and emailAddress */ /** * Stores the data of an appointment */ public class Appt{ /** Used for knowing whether or not an appointment is valid or not */ private boolean valid; /** The starting hour of the appointment */ private int startHour; /** The starting minute of the appointment */ private int startMinute; /** The starting day of the appointment */ private int startDay; /** The starting month of the appointment */ private int startMonth; /** The starting year of the appointment */ private int startYear; /** The title or caption of the appointment */ private String title; /** The description of the appointment */ private String description; /** E-mail address associated with the appointment */ private String emailAddress; /** Used to represent time isn't set */ private static final int NO_TIME = -1; /** Used for setting appointments to recur weekly */ public static final int RECUR_BY_WEEKLY = 1; /** Used for setting appointments to recur monthly */ public static final int RECUR_BY_MONTHLY = 2; /** Used for setting appointments to recur yearly */ public static final int RECUR_BY_YEARLY = 3; /** Used for setting appointments to recur forever */ public static final int RECUR_NUMBER_FOREVER = 1000; /** Used for setting appointments to never recur */ public static final int RECUR_NUMBER_NEVER = 0; /** Day(s) of the week that the appointment recurs on */ private int[] recurDays; /** What the appointment recurs on (weeks/months/years) */ private int recurBy; /** How often the appointment recurs on (every ? weeks/months/years) */ private int recurIncrement; /** How many recurrences (-1 for infinite, 0 by default) */ private int recurNumber; /** Element location of the appointment in XML tree */ private Element xmlElement; // ---------------------------------------------------------- /** * Constructs a new appointment that starts at a specific time on the * date specified. The appointment is constructed with no recurrence * information by default. To set recurrence information, construct the * appointment and then call setRecurrence(...) method. * @param startHour The hour that the appointment starts on. The hours are * numbered 0-23 to represent 12a.m. to 11pm on the day specified. * @param startMinute The minute of the hour the appointment starts on. * @param startDay The day of the month the appointment starts on. * @param startMonth The month of the year the appointment starts on. * @param startYear The year the appointment starts on. * @param title The title or caption to give the appointment * @param description The appointment's details * @param emailAddress An e-mail address associated with the appointment */ public Appt(int startHour, int startMinute, int startDay, int startMonth, int startYear, String title, String description, String emailAddress ) { //Sets all instance variables except recurring information setStartHour(startHour); setStartMinute(startMinute); setStartDay(startDay); setStartYear(startYear); setStartMonth(startMonth); setTitle(title); setDescription(description); setEmailAddress(emailAddress); //Set default recurring information int[] recurringDays = new int[0]; setRecurrence(recurringDays, RECUR_BY_MONTHLY, 0, RECUR_NUMBER_NEVER); //Leave XML Element null setXmlElement(null); //Sets valid to true - this is now a valid appointment this.valid = true; } /** * Constructs a new appointment that has no start time on the * date specified. The appointment is constructed with no recurrence * information by default. To set recurrence information, construct the * appointment and then call setRecurrence(...) method. The XmlElement * will be set when the appointment is saved to disk. * @param startDay The day of the month the appointment starts on * @param startMonth The month of the year the appointment starts on. Use * the constants provided by Gregorian Calendar to set the month. * @param startYear The year the appointment starts on. * @param title The title or caption to give the appointment * @param description of the appointment's details * @param emailAddress An e-mail address associated with the appointment */ public Appt(int startDay, int startMonth, int startYear, String title, String description, String emailAddress) { //Just call the other constructor this(NO_TIME, NO_TIME, startDay, startMonth, startYear, title, description, emailAddress); this.valid=true; } /** * Sets the XML Element for this appointment */ public void setXmlElement(Element xmlElement) { this.xmlElement = xmlElement; } /** Gets xmlElement */ public Element getXmlElement() { return xmlElement; } /** * @sets valid to true if the appointment is valid */ public void setValid() { if (startMonth < 1 || startMonth > 12) this.valid = false; else if (startHour < 0 || startHour > 23) this.valid = false; else if (startMinute < 0 || startMinute > 59) this.valid = false; else if (startYear <= 0) this.valid = false; else { int NumDaysInMonth = CalendarUtil.NumDaysInMonth(startYear, startMonth); if (startDay < 1 || startDay > NumDaysInMonth) this.valid = false; else this.valid = true; } } /** Sets startHour */ public void setStartHour(int startHour) { this.startHour = startHour; } /** Sets startHour */ public void setStartMinute(int startMinute) { this.startMinute = startMinute; } /** Sets startDay */ public void setStartDay(int startDay) { this.startDay = startDay; } /** Sets startMonth */ public void setStartMonth(int startMonth) { this.startMonth = startMonth; } /** Sets startYear */ public void setStartYear(int startYear) { this.startYear = startYear; } /** Sets title */ public void setTitle(String title) { if (title == null) this.title = ""; else this.title = title; } /** Sets description */ public void setDescription(String description) { if (description == null) this.description = ""; else this.description = description; } /** Sets emailAddress */ private void setEmailAddress(String emailAddress) { if (emailAddress == null) this.emailAddress = ""; else this.emailAddress = emailAddress; } /** Gets startHour */ public int getStartHour() { return startHour; } /** Gets startHour */ public int getStartMinute() { return startMinute; } /** Gets startDay */ public int getStartDay() { return startDay; } /** Gets startMonth */ public int getStartMonth() { return startMonth; } /** Gets startYear */ public int getStartYear() { return startYear; } /** Gets title */ public String getTitle() { return title; } /** Gets description */ public String getDescription() { return description; } /** Gets emailAddress */ public String getEmailAddress() { return emailAddress; } /** Gets description */ public boolean getValid() { return this.valid; } /** * Checks to see if an appointment occurs on a certain day, month, year. * Takes recurrence into account. * @return True if the appointment occurs on a certain day/month/year */ public boolean isOn(int day, int month, int year) { return (day == getStartDay() && month == getStartMonth() && year == getStartYear()); } /** * Checks to see if a time is set for this appointment. * @return True if this appointment has a time set. Otherwise false. */ public boolean hasTimeSet() { return (getStartHour() != NO_TIME); } /** * Sets the recurring information with the correct information */ public void setRecurrence(int[] recurDays, int recurBy, int recurIncrement, int recurNumber) { setRecurDays(recurDays); setRecurBy(recurBy); setRecurIncrement(recurIncrement); setRecurNumber(recurNumber); } private void setRecurDays(int[] recurDays) { if (recurDays == null) { this.recurDays = new int[0]; } else { this.recurDays = recurDays; } } /** Sets recurBy */ private void setRecurBy(int recurBy) { this.recurBy = recurBy; } /** Sets recurIncrement */ private void setRecurIncrement(int recurIncrement) { this.recurIncrement = recurIncrement; } /** Sets recurNumber */ private void setRecurNumber(int recurNumber) { this.recurNumber = recurNumber; } /** Gets recurNumber */ public int getRecurNumber() { return recurNumber; } /** Gets recurBy */ public int getRecurBy() { return recurBy; } /** Gets recurDays */ public int[] getRecurDays() { return recurDays; } /** * Checks to see if an appointment recurs or not * @return True if the appointment does occur more than once */ public boolean isRecurring() { return getRecurNumber() != RECUR_NUMBER_NEVER; } /** Gets recurIncrement */ public int getRecurIncrement() { return recurIncrement; } // ---------------------------------------------------------- /** * Generate a string representation for this appointment, with the * form "11am: dentist" or "2:00pm: class". The string consists of the * 12-hour time representation with a (lower case) "am" or "pm" * designator, followed by a colon and space, and then the appointment * description. * @return a printable representation of this appointment */ private String representationApp(){ String half = (getStartHour() > 12) ? "pm" : "am"; int printableHour = getStartHour(); if (printableHour > 11) { printableHour -= 12; } if (printableHour == 0){ printableHour = 12; } String representationApp= printableHour +":"+ getStartMinute() + half; return representationApp; } public String toString(){ if (!getValid()) { System.err.println("\tThis appointment is not valid"); } //Inherent bug - misplaced comma String day= this.getStartMonth()+"/"+this.getStartMonth()+"/"+this.getStartYear() + " at "; return "\t"+ day + this.representationApp() + " ," + getTitle()+ ", "+ getDescription()+"\n"; } }
[ "mwyoung2@gmail.com" ]
mwyoung2@gmail.com
50c8ce7c1bfd9431462dc7fb287ff8d0178882e9
fe363faa3a1df2bb79ba00852c4b5bcd9544cfe5
/MusicDb/src/main/java/org/numtrackskip/MusicMapper.java
f790432543923eef314a615db5b7b9af306fee6f
[]
no_license
pallaviyadav/dempgit
673ac15d58babf36cd368810f35c976715c94a89
22a1b5e9bf91fa22dbe77d499ea836b62ad50b19
refs/heads/master
2020-04-22T00:07:33.154648
2019-02-10T12:33:53
2019-02-10T12:33:53
169,968,541
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package org.numtrackskip; import java.io.IOException; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; public class MusicMapper extends Mapper<Object, Text, Text, Text>{ public void map(Object key,Text value,Context context) throws IOException, InterruptedException { String line=value.toString(); String token[]=line.split(" "); String userid=token[0]; String trackrd=token[1]+" "+token[3]; context.write(new Text(userid) , new Text(trackrd)); } }
[ "pallaviyadavpatil@gmail.com" ]
pallaviyadavpatil@gmail.com
f4878dbce05c05fe41a743595154674101401cc3
51d3e379d49bf3e2cab14eb9713134c2865b8794
/src/cf/bugodev/dontjump/events/PaperJump.java
c41eacb4db5a3df90e26a10d922ce375dea54c47
[ "Apache-2.0" ]
permissive
BUGO07/DontJump
0ff50bdbec68fdb688cec8212971c61929aaac89
51e045f6e319dff7d64a634bbe8ef802b5dafecb
refs/heads/master
2023-08-22T16:28:06.674491
2021-10-16T05:57:49
2021-10-16T05:57:49
379,000,580
1
0
null
null
null
null
UTF-8
Java
false
false
487
java
package cf.bugodev.dontjump.events; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import com.destroystokyo.paper.event.player.PlayerJumpEvent; import cf.bugodev.dontjump.DontJump; public class PaperJump implements Listener { @EventHandler public void onJump(PlayerJumpEvent event) { if (DontJump.isEnabled == true) { Player player = (Player) event.getPlayer(); player.damage(0.2); player.setHealth(1); } } }
[ "grigalagio07@gmail.com" ]
grigalagio07@gmail.com
8c93fbef5ffcb4c6a04c2af8eb9642d231199a42
a945daabd6ae37b1547e43aaa3c578f17870a0e1
/src/test/java/com/github/zengchao1212/sms/service/test/BaiduLoginTest.java
e7663f9de3b71fbe6b1730a67a362cae368c40c7
[]
no_license
zengchao1212/sms
683cb6527a4111771d0ee8c5f383060d479c15c3
29ec2bc0efe31f287696206aeb037525b2aaf723
refs/heads/master
2022-09-19T21:03:37.970367
2020-09-02T08:06:55
2020-09-02T08:06:55
161,444,149
1
0
null
2022-09-01T23:00:21
2018-12-12T06:40:40
Java
UTF-8
Java
false
false
446
java
package com.github.zengchao1212.sms.service.test; import com.github.zengchao1212.sms.service.BaiduLogin; import com.github.zengchao1212.sms.service.SmsBoom; import org.junit.Test; /** * @author zengchao * @date 2018/12/12 */ public class BaiduLoginTest extends AbstractSmsBoomTest { private SmsBoom sender = new BaiduLogin(); @Test public void send() throws InterruptedException { send(sender, "15297804323"); } }
[ "576178421@qq.com" ]
576178421@qq.com
1b90f75b98e2e307462ad566631fb3805fa85c66
73b334abc69d4eaf8494660bd8d3468e080f0ce9
/Prog4/Queen.java
991d3ff6810da6b195f4887ec447260c14e621e3
[]
no_license
chthota9/Data-Structures
c8ea5d41f52e452d74748bf90ab5727f64440240
5e3343be4cf52d91c5fbc9157465fa86370624fa
refs/heads/master
2020-03-08T08:22:25.787195
2018-10-10T16:58:19
2018-10-10T16:58:19
128,020,716
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
//------------------------------------------------ //Charishma Thota //cthota //Queen.java // contains the class for object Queen // col and row make up a queen object // ---------------------------------------------- import java.lang.Math; import java.util.*; import java.io.*; import java.util.Scanner; import java.util.ArrayList; public class Queen { public int col; public int row; //constructor public Queen(int col, int row){ this.col = col; this.row = row; } public boolean isAttacking(Queen i) { if (row ==i.row || col == i.col) // checks if a queen is in the same row or column return true; else if (Math.abs(row-i.row) == Math.abs(col - i.col)) // checks if the queen is in the same diagnol return true; else return false; // if the piece is not attacking } }
[ "cherrythota@eduroam-169-233-140-154.ucsc.edu" ]
cherrythota@eduroam-169-233-140-154.ucsc.edu
b010f982b2d3842722c256146a24a00bfe448a6c
c1e99f14011ec03100c920146ed12cefd1d2029e
/src/com/method/util/Sorter.java
fac416680c4f42132444c489eb619b4020a312f8
[]
no_license
dyjava/CommTestMethod
1582f2f7491c15f4e480b779a48aaf8a4caee6d6
325fd44e21d69b36e6231abc63ca26a5d983d813
refs/heads/master
2021-06-11T17:35:48.215656
2014-01-17T02:02:26
2014-01-17T02:02:26
11,679,122
0
1
null
2023-03-20T11:51:34
2013-07-26T06:21:45
Java
UTF-8
Java
false
false
2,386
java
package com.method.util; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; public class Sorter { public static void sorter(int[] a){ Arrays.sort(a); } public static void sorter(int[] a,int begin,int end){ Arrays.sort(a,begin,end); } public static void sorter(String[] a){ Arrays.sort(a); } public static void sorter(String[] a,int begin,int end){ Arrays.sort(a,begin,end); } public static void sorter(Bean[] a){ Arrays.sort(a,new comp()); } public static void listSort(List list){ Collections.sort(list,new comp()) ; } /** * @param args */ public static void main(String[] args) { // int[] in= {1,8,6,4,3,9,7,10,2,5}; // sorter(in); // String[] s = {"a","d","vad","ar","hds","fad","aa","dd","csd",}; // sorter(s,3,8); // // for(int i=0;i<s.length;i++){ // System.out.println("=="+s[i]); // } // �������� Bean[] b = new Bean[5]; Bean bean0 = new Bean(); bean0.setAge(12.5); bean0.setId(1); bean0.setName("hello"); bean0.setSex(true); b[0]=bean0 ; Bean bean1 = new Bean(); bean1.setAge(10.5); bean1.setId(3); bean1.setName("hsaflo"); bean1.setSex(true); b[1]=bean1 ; Bean bean2 = new Bean(); bean2.setAge(18.5); bean2.setId(5); bean2.setName("asdf"); bean2.setSex(true); b[2]=bean2 ; Bean bean3 = new Bean(); bean3.setAge(6.5); bean3.setId(2); bean3.setName("saaf"); bean3.setSex(true); b[3]=bean3 ; Bean bean4 = new Bean(); bean4.setAge(52.5); bean4.setId(4); bean4.setName("sfs"); bean4.setSex(true); b[4]=bean4 ; sorter(b); for(int i=0;i<b.length;i++){ Bean be = b[i]; System.out.println("=="+be.getId()); } } } class Bean{ int id ; String name ; double age ; boolean sex ; public double getAge() { return age; } public void setAge(double age) { this.age = age; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isSex() { return sex; } public void setSex(boolean sex) { this.sex = sex; } } class comp implements Comparator<Bean>{ public int compare(Bean a, Bean b) { if(a.getId()>b.getId()){ return -1 ; }else if(a.getId()==b.getId()){ return 0 ; }else{ return 1 ; } } }
[ "zhpei918" ]
zhpei918
0db7bd1bc117698a1a85b42d264cb21729230d8d
5c3ecb8139cb85a3e4600a6f52ce7e077d4555a4
/chinasofti-provider-user/src/main/java/com/chinasofti/provider/UserApplication.java
cd637c606edc9d0fc494359e420a2a368f8390a2
[]
no_license
kan-meng/spring-cloud-demo
b1180b06a9f07f6703a4c256cfcc3a9bebfb425c
22432d6b598496cbc96a798fee5c248b0d82a37e
refs/heads/master
2021-07-06T14:29:36.410234
2017-09-28T13:33:34
2017-09-28T13:33:34
104,843,568
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package com.chinasofti.provider; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @SpringBootApplication @EnableEurekaClient public class UserApplication { public static void main(String[] args) { SpringApplication.run(UserApplication.class, args); } }
[ "753162364@qq.com" ]
753162364@qq.com
a9c5e3130c776e85dcd80a48494af23ff4d6503f
b4ac774471bd72406809974172f5e7f5bb85b7e1
/CIrcularQueue/src/Singleton/CQsingle.java
aad8840f88b33056d692070fed814d8174417d5c
[]
no_license
Hemavathy12/Java
c3ee95af64cc056e1391350a6ef1b6e45ee09585
58ae909e76d24bd4946888bee75f2aff78ff7470
refs/heads/master
2021-05-13T15:27:19.309471
2018-01-09T05:20:31
2018-01-09T05:20:31
116,769,022
0
0
null
null
null
null
UTF-8
Java
false
false
2,345
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 Singleton; public class CQsingle { //creating an object of SingleObject private static CQsingle instance = new CQsingle(); //making the constructor private so that this class cannot be instantiated private CQsingle() { } //Get the only object available public static CQsingle getInstance() { return instance; } final int SIZE = 5; int[] iQueue = new int[SIZE]; private int iRear = 0; private int iFront = 0; /** * This function inserts the elements given as input into the queue. * * @param : Takes the values given by the user as input. * @return : Returns the elements present in the queue after pushing. * */ public void push(int iValues) { iRear = (iRear + 1) % iQueue.length; if (iRear == SIZE) { //System.out.println("Queue is full."); iRear = 0; iQueue[iRear] = iValues; iRear = (iRear + 1) % SIZE; } iQueue[iRear] = iValues; } /** * This function removes the elements from the queue. * * @param : Nil. * @return : Returns the elements present in the queue after removing. * */ public int pop() { if (iRear == iFront) { iQueue[iFront] = 0; int iElement = iQueue[iFront]; iFront = (iFront + 1) % SIZE; } int iElements = iQueue[iFront]; iFront = (iFront + 1) % iQueue.length; return iElements; } /** * This function displays the elements in the queue. * * @param : Nil. * @return : Displays the elements present in the queue . * */ public void display() { int iCurr = iFront; System.out.print("Queue state: "); if (iCurr == iRear) { System.out.print("[empty]"); } else { while (iCurr != iRear) { iCurr = (iCurr + 1) % iQueue.length; System.out.print(iQueue[iCurr] + " "); } } System.out.println(); } public void showMessage() { System.out.println("QUEUE"); } }
[ "hemavathy.swarnamuthu@microchip.com" ]
hemavathy.swarnamuthu@microchip.com
ad3c2e6db44eb3ac9c77829ae44e33d8d150fc58
bd5c1dbd364d07cdf46cb64588ff1c7df0964714
/src/com/tactfactory/dao/package-info.java
51bcf5ec3dbf0decdf4a5b2ea2daef1075de9fff
[]
no_license
jponcy/cdpn_uml_dp_2017
76879d35941bb1742fbde6352d9c72dcf66cc037
9e53e22cd87301062df0cc1d8b9cf8b78aede138
refs/heads/master
2021-07-17T18:25:19.160276
2017-10-25T15:02:31
2017-10-25T15:02:31
108,289,799
0
1
null
null
null
null
UTF-8
Java
false
false
39
java
/** * */ package com.tactfactory.dao;
[ "jonathan.poncy@tactfactory.com" ]
jonathan.poncy@tactfactory.com
202bdfd527eb75e2b20cd6b05629c956803bcdd0
9e4e407d16a279107d7a0b8d098e987351e6a2e8
/src/main/java/classes/model/Item.java
282e2af221cf3bf19cc01fb733758046e8b15e09
[]
no_license
fturek/transaction-generator-broker
fc8725eac7231184aaeabdfa52344184294bd194
ed0aedc775c0fe0f64b2c8a020b92a26e891a63f
refs/heads/master
2020-03-19T04:42:40.618170
2018-06-12T09:43:25
2018-06-12T09:43:25
135,855,537
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package classes.model; import jdk.nashorn.internal.ir.annotations.Immutable; import java.math.BigDecimal; @Immutable public class Item { public String name; public int quantity; public BigDecimal price; }
[ "filippturek@gmail.com" ]
filippturek@gmail.com
deb0f16cbba1ac655609eb7fdc4e654850180088
eaf547e4b018a5f087a58b95c7eb37f29b60c2ca
/src/main/java/Main1.java
8cff9259bc5ef4d01f6f63922548cfdbccd74067
[]
no_license
JokerZhouHao/JavaPractice
d50796fec0e8d44df9be6fadfd2929965ef87d61
2919fc2cbad1bce3bf5cded751416d853c8f8bae
refs/heads/master
2021-07-13T03:49:16.533318
2020-02-14T06:11:05
2020-02-14T06:11:05
204,929,642
0
0
null
2020-10-13T17:38:14
2019-08-28T12:44:24
Java
UTF-8
Java
false
false
1,273
java
import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; public class Main1 { public static void main(String[] args) throws Exception{ Scanner scan = new Scanner(System.in); String arr[] = scan.nextLine().split(" "); int n = Integer.parseInt(arr[0]); int k = Integer.parseInt(arr[1]); int counts[] = new int[101]; int i = 0; for(i=0; i<counts.length; i++) counts[i] = -1; int min =0, max = 0; for(i=0; i<n; i++) { arr = scan.nextLine().split(" "); min = Integer.parseInt(arr[0]); max = Integer.parseInt(arr[1]); for(int j=min; j<=max; j++) { if(counts[j+50]==-1) counts[j+50] += 2; else counts[j+50]++; } } min = max = Integer.MIN_VALUE; for(i=0; i<counts.length; i++) { if(counts[i] >= k) { min = max = i - 50; break; } } for(; i<counts.length; i++) { if(counts[i] < k) break; } max = i-51;; if(min != Integer.MIN_VALUE) System.out.println(min + " " + max); else System.out.println("error"); } }
[ "joker187245@163.com" ]
joker187245@163.com
d5e613da711a01e0be8f3059b685098bb9702a27
b6ccba83075751c63411b13bcad9564c53eef9a7
/src/main/java/cn/darkjrong/mix/common/pojo/vo/DictionaryVO.java
473c3846e3865b77a63ec9f53961c362dc356b95
[]
no_license
a852203465/springboot-shiro
faeffeb950e8f9a4b5cb2a001fbd352f2612aca4
0648ec209210b172936518366ef25e967308af1a
refs/heads/master
2022-04-06T15:41:19.238186
2022-03-09T03:50:45
2022-03-09T03:50:45
189,937,829
0
0
null
2022-02-09T22:14:45
2019-06-03T05:07:28
Java
UTF-8
Java
false
false
1,344
java
package cn.darkjrong.mix.common.pojo.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import lombok.ToString; import java.io.Serializable; import java.util.List; import java.util.Map; /** * 数据字典管理结果对照对象 * @author Rong.Jia * @date 2019/01/25 16:18 */ @Getter @Setter @ToString @EqualsAndHashCode(callSuper = false) @ApiModel("数据字典管理结果对照对象") public class DictionaryVO implements Serializable { private static final long serialVersionUID = 2592998177425835193L; /** * 数据字典 (key: 数据字典类别, value: 数据字典信息集合) */ @ApiModelProperty("数据字典 (key: 数据字典类别, value: 数据字典信息集合)") private Map<String, List<DictionaryVO>> dataDictionaries; /** * 含义 */ @ApiModelProperty(value = "含义") private String meaning; /** * 数值 */ @ApiModelProperty(value = "数值") private Integer numerical; /** * 类别 */ @ApiModelProperty(value = "类别") private String dictionaryClass; /** * 类别 中文含义 */ @ApiModelProperty(value = "类别 中文含义") private String dictionaryChinese; }
[ "Rong.Jia@xdcplus.com" ]
Rong.Jia@xdcplus.com
f1053cdb804bfa2ebb1c72e56ffba5d01df036c9
0b4863800f50005bffc560b0567755d13890c8dc
/src/main/java/org/antframework/common/util/tostring/format/HideFieldFormatter.java
241b499920e56d28c71a4e5d19917ea9cb333ca9
[ "Apache-2.0" ]
permissive
luchao0111/ant-common-util
b072269946495c6a4063fcbdfed9b3c1048cf98c
8e398f31054f15e8c2a7fd06b2f83099e6154dcc
refs/heads/master
2020-07-11T16:11:41.184791
2019-05-04T16:04:17
2019-05-04T16:04:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
536
java
/* * 作者:钟勋 (e-mail:zhongxunking@163.com) */ /* * 修订记录: * @author 钟勋 2017-06-20 18:21 创建 */ package org.antframework.common.util.tostring.format; import org.antframework.common.util.tostring.FieldFormatter; import java.lang.reflect.Field; /** * 隐藏属性的格式器(不输出属性) */ public class HideFieldFormatter implements FieldFormatter { @Override public void initialize(Field field) { } @Override public String format(Object obj) { return null; } }
[ "zhongxunking@163.com" ]
zhongxunking@163.com
d7e744a03df9baff26dd03466d8848a4a5c37cea
74b47b895b2f739612371f871c7f940502e7165b
/aws-java-sdk-auditmanager/src/main/java/com/amazonaws/services/auditmanager/model/transform/CreateControlMappingSourceMarshaller.java
a2b830525c0db8fc0380b7f1ebd2b1d50db42147
[ "Apache-2.0" ]
permissive
baganda07/aws-sdk-java
fe1958ed679cd95b4c48f971393bf03eb5512799
f19bdb30177106b5d6394223a40a382b87adf742
refs/heads/master
2022-11-09T21:55:43.857201
2022-10-24T21:08:19
2022-10-24T21:08:19
221,028,223
0
0
Apache-2.0
2019-11-11T16:57:12
2019-11-11T16:57:11
null
UTF-8
Java
false
false
4,143
java
/* * Copyright 2017-2022 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.auditmanager.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.auditmanager.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * CreateControlMappingSourceMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class CreateControlMappingSourceMarshaller { private static final MarshallingInfo<String> SOURCENAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceName").build(); private static final MarshallingInfo<String> SOURCEDESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceDescription").build(); private static final MarshallingInfo<String> SOURCESETUPOPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceSetUpOption").build(); private static final MarshallingInfo<String> SOURCETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceType").build(); private static final MarshallingInfo<StructuredPojo> SOURCEKEYWORD_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceKeyword").build(); private static final MarshallingInfo<String> SOURCEFREQUENCY_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceFrequency").build(); private static final MarshallingInfo<String> TROUBLESHOOTINGTEXT_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("troubleshootingText").build(); private static final CreateControlMappingSourceMarshaller instance = new CreateControlMappingSourceMarshaller(); public static CreateControlMappingSourceMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(CreateControlMappingSource createControlMappingSource, ProtocolMarshaller protocolMarshaller) { if (createControlMappingSource == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createControlMappingSource.getSourceName(), SOURCENAME_BINDING); protocolMarshaller.marshall(createControlMappingSource.getSourceDescription(), SOURCEDESCRIPTION_BINDING); protocolMarshaller.marshall(createControlMappingSource.getSourceSetUpOption(), SOURCESETUPOPTION_BINDING); protocolMarshaller.marshall(createControlMappingSource.getSourceType(), SOURCETYPE_BINDING); protocolMarshaller.marshall(createControlMappingSource.getSourceKeyword(), SOURCEKEYWORD_BINDING); protocolMarshaller.marshall(createControlMappingSource.getSourceFrequency(), SOURCEFREQUENCY_BINDING); protocolMarshaller.marshall(createControlMappingSource.getTroubleshootingText(), TROUBLESHOOTINGTEXT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
03f81ea0685645b3dd019e556b4cd3dedb249b05
9874216a9e2a9a7123a031b971b0e44f4bc43109
/src/main/java/pl/edu/agh/tai/partytura/web/controllers/InstitutionController.java
259e422c80675b9be61a31e78651e0126c9111cc
[]
no_license
margg/partytura
168486d1b5b75434b3bbeea592ab4dbd4ce28f5f
ef07cef6ba4cebdd0f0f23fada76364f0fa5db5f
refs/heads/master
2021-01-17T18:23:16.830459
2016-06-27T17:34:47
2016-06-27T17:34:47
57,901,562
0
0
null
2016-06-27T17:32:57
2016-05-02T15:53:35
Java
UTF-8
Java
false
false
4,140
java
package pl.edu.agh.tai.partytura.web.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import pl.edu.agh.tai.partytura.model.*; import pl.edu.agh.tai.partytura.model.exceptions.UnfollowingNotFollowedInstitutionException; import pl.edu.agh.tai.partytura.persistence.InstitutionRepository; import java.security.Principal; import java.util.List; import java.util.Optional; @Controller public class InstitutionController { private InstitutionRepository institutionRepository; private UserService userService; @Autowired public InstitutionController(InstitutionRepository institutionRepository, UserService userService) { this.institutionRepository = institutionRepository; this.userService = userService; } @RequestMapping(path = "/institutions", method = RequestMethod.GET) public String showEvents(Principal currentUser, Model model) { Optional<User> user = userService.getUser(currentUser.getName()); return user.map(u -> { List<Institution> institutions = institutionRepository.findAll(); model.addAttribute("institutions", institutions); return "/institutions"; }).orElse("redirect:/signin"); } @RequestMapping(path = "/institution/{instName}", method = RequestMethod.GET) public String eventHomePage(Principal currentUser, @PathVariable("instName") String instName, Model model) { Optional<User> user = userService.getUser(currentUser.getName()); return user.map(u -> { return userService.getUser(instName).map(inst -> { if (inst instanceof Institution) { model.addAttribute("institution", inst); addFollowButtonInfoIfNeeded(model, u, (Institution) inst); return "/institution"; } return "redirect:/error"; }).orElse("redirect:/error"); }).orElse("redirect:/signin"); } private void addFollowButtonInfoIfNeeded(Model model, User u, Institution inst) { if (u instanceof Attender) { boolean isFollowing = ((Attender) u).getFollowedInstitutions().contains(inst); model.addAttribute("showFollowButton", !isFollowing); model.addAttribute("followButtonText", "Follow"); model.addAttribute("unfollowButtonText", "Unfollow"); } } @RequestMapping(path = "/institution/{instName}/follow", method = RequestMethod.POST) public String follow(Principal currentUser, @PathVariable("instName") String instName, Model model) { Optional<User> user = userService.getUser(currentUser.getName()); return user.map(u -> { return userService.getUser(instName).map(institution -> { if (u instanceof Attender && institution instanceof Institution) { ((Attender) u).follow((Institution) institution); userService.save(u); model.addAttribute("institution", institution); return "redirect:/institution/" + instName; } return "redirect:/error"; }).orElse("redirect:/error"); }).orElse("redirect:/signin"); } @RequestMapping(path = "/institution/{instName}/unfollow", method = RequestMethod.POST) public String unfollow(Principal currentUser, @PathVariable("instName") String instName, Model model) { Optional<User> user = userService.getUser(currentUser.getName()); return user.map(u -> { return userService.getUser(instName).map(institution -> { try { if (u instanceof Attender && institution instanceof Institution) { ((Attender) u).unfollow((Institution) institution); userService.save(u); model.addAttribute("institution", institution); return "redirect:/institution/" + instName; } } catch (UnfollowingNotFollowedInstitutionException e) { // TODO: log } return "redirect:/error"; }).orElse("redirect:/error"); }).orElse("redirect:/signin"); } }
[ "mksalawa@gmail.com" ]
mksalawa@gmail.com
9f7736c3f5c38e4b7278d998ff1f043aa5d51ce5
fb601da740af28c60c05a063d0f7f1d891b04090
/mall/mall-order/src/main/java/com/policeschool/mall/mq/LogMessage.java
da5bcd12ad95e8d04aa71837abeaa44742ef750f
[]
no_license
PoliceSchool/project
139690d6f8d4636e5af6ed4a520540e8b91327f7
03f094075f251e64647633448b0fe84e15f14f60
refs/heads/master
2021-08-01T01:49:53.699175
2020-05-19T11:48:52
2020-05-19T11:48:52
231,328,004
0
0
null
2021-07-22T16:37:49
2020-01-02T07:14:15
Java
UTF-8
Java
false
false
1,923
java
package com.policeschool.mall.mq; import java.io.Serializable; import java.util.Date; /** * @author: lujingxiao * @description: * @since: * @version: * @date: Created in 2020/1/3. */ public class LogMessage implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String msg; private String logLevel; private String serviceType; private Date createTime; private Long userId; public LogMessage() { super(); } public LogMessage(Long id, String msg, String logLevel, String serviceType, Date createTime, Long userId) { super(); this.id = id; this.msg = msg; this.logLevel = logLevel; this.serviceType = serviceType; this.createTime = createTime; this.userId = userId; } @Override public String toString() { return "LogMessage [id=" + id + ", msg=" + msg + ", logLevel=" + logLevel + ", serviceType=" + serviceType + ", createTime=" + createTime + ", userId=" + userId + "]"; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getLogLevel() { return logLevel; } public void setLogLevel(String logLevel) { this.logLevel = logLevel; } public String getServiceType() { return serviceType; } public void setServiceType(String serviceType) { this.serviceType = serviceType; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } }
[ "lujingxiao@sythealth.com" ]
lujingxiao@sythealth.com
13d3cb86fe08c61c5df2c4cfe890e1d383e7fb09
09061ab47b2bee88274b666e4f92bb57085055f7
/src/main/java/best/reich/ingrosware/setting/Setting.java
154a5bdc833a01f3a1166640b4277eecfaaca2e3
[]
no_license
DarkiBoi/ingrosware
dba5001d52517c435c027955104269c32a253a36
51ac7a6b919a5a4523014f73c94bc199b99d8876
refs/heads/master
2022-11-12T22:55:48.808276
2020-06-23T01:31:00
2020-06-23T01:31:00
274,404,614
6
1
null
2020-06-23T12:51:01
2020-06-23T12:51:00
null
UTF-8
Java
false
false
221
java
package best.reich.ingrosware.setting; /** * made for Ingros * * @author Brennan * @since 6/13/2020 **/ public interface Setting<V> { V getValue(); void setValue(V value); void setValue(String value); }
[ "dashnullify@nullify.rip" ]
dashnullify@nullify.rip
ac022412cb22b295335d2e060756919d162f60ee
c16e698eb159f560c59c47c2cecc50139478c909
/src/test/java/com/edu/lnu/test/AdvisorTest.java
565ff963287440f92f09dfd3cd08be3181a5263c
[]
no_license
zyplnu/AOPDemo
bd0841387d5d799a8e0809dcd48f10b5555d4823
cfa92b2fd24f50646d137e66f00147c5ee0a225f
refs/heads/master
2020-03-19T17:59:50.000696
2018-06-11T13:24:51
2018-06-11T13:24:51
136,788,554
0
0
null
null
null
null
UTF-8
Java
false
false
750
java
package com.edu.lnu.test; import com.edu.lnu.advisor.Seller; import com.edu.lnu.advisor.Waiter; import org.springframework.aop.Pointcut; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.testng.annotations.Test; /** * 切面测试类 */ public class AdvisorTest { @Test public void testAdvisor(){ String configPath = "repbeans.xml"; ApplicationContext ctx = new ClassPathXmlApplicationContext(configPath); Waiter waiter = (Waiter) ctx.getBean("waiter"); // Seller seller = (Seller) ctx.getBean("seller"); waiter.greetTo("John"); waiter.serveTo("John"); // seller.greetTo("John"); } }
[ "429510037@qq.com" ]
429510037@qq.com