blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5ea62885a8595b46a7d1bc7b24289c7234dd35a7 | 36bf98918aebe18c97381705bbd0998dd67e356f | /projects/castor-1.3.3/cpa/src/test/java/org/castor/cache/hashbelt/reaper/TestNullReaper.java | 7563592328a790c227479fab9d1a3d3e093c02b4 | [] | no_license | ESSeRE-Lab/qualitas.class-corpus | cb9513f115f7d9a72410b3f5a72636d14e4853ea | 940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213 | refs/heads/master | 2020-12-24T21:22:32.381385 | 2016-05-17T14:03:21 | 2016-05-17T14:03:21 | 59,008,169 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,784 | java | /*
* Copyright 2006 Ralf Joachim
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.castor.cache.hashbelt.reaper;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.castor.cache.hashbelt.container.Container;
import org.castor.cache.hashbelt.container.MapContainer;
/**
* @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
* @version $Revision: 9041 $ $Date: 2011-08-16 11:51:17 +0200 (Di, 16 Aug 2011) $
* @since 1.0
*/
public final class TestNullReaper extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite("NullReaper Tests");
suite.addTest(new TestNullReaper("test"));
return suite;
}
public TestNullReaper(final String name) { super(name); }
public void test() {
Container<Integer, String> container = new MapContainer<Integer, String>();
for (int i = 0; i < 10; i++) {
container.put(new Integer(i), Integer.toString(i));
}
AbstractReaper<Integer, String> reaper = new NullReaper<Integer, String>();
reaper.handleExpiredContainer(container);
assertEquals(10, container.size());
}
}
| [
"[email protected]"
] | |
5a5eeafcb58f01fcdbbf2c76260d2678b752da33 | 2e6b1b3f00de7e9de4b419c8f87f5d9f2056ee3d | /src/problem/PallindromeNumber.java | 32d7d16c0c62b3ea0ec15f01184cb0b34f6b3849 | [] | no_license | Ramanjeet95/algorithms | 23679a0545413b1acd9e4be25c374e7daa050228 | 387d6929af8ac1f4229106817458734deb8ea385 | refs/heads/master | 2023-01-28T01:25:59.445073 | 2020-12-12T14:17:01 | 2020-12-12T14:17:01 | 312,980,595 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package problem;
public class PallindromeNumber
{
public String is_palindrome(int n)
{
// Code here
String s = String.valueOf(n);
for(int i = 0; i < s.length()/2; i++)
{
if(s.charAt(i) != s.charAt(s.length()-i-1))
return "No";
}
return "Yes";
}
}
| [
"[email protected]"
] | |
37f2793041f02242e6294ce0cc09c94aee95d1ba | 7ce6bd62652120a441bdf9dbab58c559d7bb524f | /src/main/java/com/crm/custom/service/impl/CustomServiceImpl.java | b3d0ef82b222ff06870c04a59d6986b6520ae20a | [] | no_license | tianjianqin/crm | a45b38bccc67d01415b1a34913303fdb031727f3 | bf87fb780386c8a76299406339619ffa48deb4e2 | refs/heads/master | 2021-04-15T07:04:30.766467 | 2018-04-16T01:38:54 | 2018-04-16T01:38:54 | 126,415,119 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package com.crm.custom.service.impl;
import com.crm.custom.domain.Custom;
import com.crm.custom.mapper.CustomMapper;
import com.crm.custom.service.CustomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author tianjianqin
* @date 2018/3/19 10:28
*/
@Service
@Transactional
public class CustomServiceImpl implements CustomService {
@Autowired
private CustomMapper customMapper;
@Override
public List<Custom> queryList(Map<String, Object> map) {
return customMapper.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return customMapper.queryTotal(map);
}
@Override
public void update(Custom custom) {
customMapper.update(custom);
}
@Override
public void save(Custom custom) {
custom.setCreatedate(new Date());
customMapper.save(custom);
}
@Override
public void delete(Integer id) {
customMapper.delete(id);
}
@Override
public Custom queryByNameAndPhone(Custom custom) {
return customMapper.queryByNameAndPhone(custom);
}
}
| [
"[email protected]"
] | |
ac935a4107f17eec7d961df72a6fd46116c39cee | 8cbe5e8e2051e1f8b78c3059405e67749f723241 | /src/agents/PlaneComp.java | 3531670e39ff632640fc7964fe54a63e7300fbc4 | [] | no_license | smbea/FEUP-AIAD | 59bbe5576703af3e17b1bf524d084ae578f81f4c | 4f2694885e9dd65bc523761e933c752788a822b5 | refs/heads/master | 2022-03-31T23:50:17.726834 | 2019-11-13T13:16:38 | 2019-11-13T13:16:38 | 210,637,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,524 | java | package agents;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Queue;
import java.util.LinkedList;
import jade.core.AID;
import jade.domain.FIPAAgentManagement.AMSAgentDescription;
import jade.core.Agent;
import jade.core.behaviours.*;
import jade.lang.acl.ACLMessage;
@SuppressWarnings("serial")
public class PlaneComp
{
/**
* Fuel Left (liters)
*/
int fuelLeft = 50;
/**
* Plane average speed of 100 km/h (kilometers per hour)
*/
int speed = 100;
/**
* Plane average total fuel loss of 10 L/km (liters per kilometer)
*/
int fuelLoss = 10;
/**
* Predicted Flight Time Left (minutes)
*/
int timeLeft = 60;
int moneyAvailable = 100;
int bid=10;
Queue<String> route = new LinkedList<>(){{add("DUL");add("DUL");add("DUL");}};
HashMap<String, Integer> actualPos = new HashMap<String, Integer>(){{put("x", 3);put("y", 3);}};
HashMap<String, Integer> finalPos = new HashMap<String, Integer>(){{put("x", 0);put("y", 0);}};
/**
* Current Distance Left (km)
*/
int distanceLeft = route.size();
String goal="money"; //money, time, fuel, etc
/**
* Numerical value that is attached to a particular attribute's level. A higher value is generally related to more attractiveness.
*/
HashMap<String, LinkedHashMap<Double, Double>> negotiationAttributes = new HashMap<String, LinkedHashMap<Double, Double>>() {{
// minimize amount of money spent
put("money", new LinkedHashMap<Double, Double>() {{
put(50.0, 0.05); // nadir alternative value
put(49.0, 0.15); // upper limit for barely acceptable
put(1.0, 0.3); // lower limit of ideal values
put(0.0, 0.5); // ideal alternative value
}});
// maximize amount of fuel
put("fuel", new LinkedHashMap<Double, Double>() {{
put(4000.0, 0.5); // ideal alternative value
put(4000.0-fuelLoss, 0.3); // lower limit of ideal values
put(4000.0-distanceLeft*fuelLoss/2, 0.15); // upper limit for barely acceptable value
put(4000.0-distanceLeft*fuelLoss, 0.05); // lowest acceptable value
}});
// minimize amount of flight time
put("time", new LinkedHashMap<Double, Double>() {{
put(timeLeft/60.0, 0.05);
put(timeLeft/60/2.0, 0.15);
put(((fuelLeft/fuelLoss)/speed)/2.0, 0.3);
put(1.0*(fuelLeft/fuelLoss)/speed, 0.5);
}});
// minimize detour
put("detour", new LinkedHashMap<Double, Double>() {{
put(1.0*fuelLeft/fuelLoss, 0.05);
put(fuelLeft/fuelLoss/2.0, 0.15);
put(1.0, 0.3);
put(0.0, 0.5);
}});
}};
public PlaneComp() {}
} | [
"[email protected]"
] | |
b1623454de1599363b931456edfbbc0d7d5822e6 | 44315a1f6599ada9dc2e17e99995411b9c804b50 | /Java/조기성/src/조기성/guestbookDAOImpl.java | 15a3fbecdd705657ca80d0668363d4d302fe7ec7 | [] | no_license | chogiseong/GovernmentExpenditureEducation | 476261cdc16fd19280efd5192b72ce4421b709e8 | 258a1cca6ce701af515d8cc395d5622d8b367af2 | refs/heads/main | 2023-01-01T12:55:00.593812 | 2020-10-20T08:02:34 | 2020-10-20T08:02:34 | 305,630,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,624 | java | package 조기성;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class guestbookDAOImpl implements guestbookDAO {
private Connection getConnection() throws SQLException {
Connection conn = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String dburl = "jdbc:oracle:thin:@localhost:1521:xe";
conn = DriverManager.getConnection(dburl, "webdb", "0707");
} catch (ClassNotFoundException e) {
System.err.println("JDBC 드라이버 로드 실패!");
}
return conn;
}
@Override
public List<guestbookVO> getList() {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
// 데이터 전송을 위한 리스트
List<guestbookVO> list = new ArrayList<>();
try {
conn = getConnection();
stmt = conn.createStatement();
String sql = "SELECT no, name, " +
"password, content, reg_date FROM guestbook";
rs = stmt.executeQuery(sql);
while(rs.next()) {
guestbookVO guestbookVO = new guestbookVO(
rs.getLong(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5)
);
list.add(guestbookVO);
}
} catch (SQLException e) {
System.err.println("ERROR:" + e.getMessage());
}
return list;
}
@Override
public guestbookVO get(Long id) {
Connection conn = null;
PreparedStatement pstmt = null;
guestbookVO guestbookVO = null;
ResultSet rs = null;
try {
conn = getConnection();
String sql = "SELECT no, " +
"name, password, content, reg_date " +
"FROM guestbook " +
"WHERE no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setLong(1, id);
rs = pstmt.executeQuery();
if (rs.next()) {
guestbookVO = new guestbookVO(
rs.getLong(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5)
);
}
} catch (SQLException e) {
System.err.println("ERROR:" + e.getMessage());
} finally {
try {
if (rs != null) rs.close();
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
} catch (Exception e) {
System.err.println("ERROR:" + e.getMessage());
}
}
return guestbookVO;
}
@Override
public boolean insert(guestbookVO guestbookVO) {
Connection conn = null;
PreparedStatement pstmt = null;
int insertedCount = 0;
try {
conn = getConnection();
String sql = "INSERT INTO guestbook " +
"VALUES(SEQ_guestbook_no.NEXTVAL, " +
"?, ?, ?, sysdate)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, guestbookVO.getname());
pstmt.setString(2, guestbookVO.getpassword());
pstmt.setString(3, guestbookVO.getcontent());
insertedCount = pstmt.executeUpdate();
} catch (SQLException e) {
System.err.println("ERROR:" + e.getMessage());
} finally {
try {
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
} catch (Exception e) {
System.err.println("ERROR:" + e.getMessage());
}
}
return insertedCount == 1;
}
@Override
public boolean delete(Long no, String password) {
Connection conn = null;
PreparedStatement pstmt = null;
int deletedCount = 0;
try {
conn = getConnection();
String sql = "DELETE FROM guestbook WHERE no=? and password=?";
pstmt = conn.prepareStatement(sql);
pstmt.setLong(1, no);
pstmt.setString(2, password);
deletedCount = pstmt.executeUpdate();
} catch (SQLException e) {
System.err.println("ERROR:" + e.getMessage());
} finally {
try {
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
} catch (Exception e) {
System.err.println("ERROR:" + e.getMessage());
}
}
return deletedCount == 1;
}
@Override
public boolean update(guestbookVO guestbookVO) {
Connection conn = null;
PreparedStatement pstmt = null;
int updatedCount = 0;
try {
conn = getConnection();
String sql = "UPDATE guestbook SET " +
"name=?, password=?, content=?, getreg_date=? " +
"WHERE no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setLong(1, guestbookVO.getno());
pstmt.setString(2, guestbookVO.getname());
pstmt.setString(3, guestbookVO.getpassword());
pstmt.setString(4, guestbookVO.getcontent());
pstmt.setString(5, guestbookVO.getreg_date());
updatedCount = pstmt.executeUpdate();
} catch (SQLException e) {
System.err.println("ERROR:" + e.getMessage());
} finally {
try {
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
} catch (Exception e) {
System.err.println("ERROR:" + e.getMessage());
}
}
return 1 == updatedCount;
}
}
| [
"[email protected]"
] | |
a2eb38cb91515efbe111e76636e5eac6d41be527 | 21e36f755b78b5fd1af6454661baa9b73cf507c2 | /org.molymer/src-gen/org/molymer/modelDsl/Model.java | ec1053ac712a038a3bf841c10d970e329f53a2f6 | [] | no_license | shumy/molymer | 4ae2ab6548daf4bd7c67139278c4e26502349036 | d550fb3b035dc7b020c78b4228f0f26a858ff6a7 | refs/heads/master | 2021-01-18T13:51:22.189338 | 2015-09-04T22:35:59 | 2015-09-04T22:35:59 | 41,822,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,896 | java | /**
*/
package org.molymer.modelDsl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Model</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.molymer.modelDsl.Model#getImports <em>Imports</em>}</li>
* <li>{@link org.molymer.modelDsl.Model#getElements <em>Elements</em>}</li>
* </ul>
* </p>
*
* @see org.molymer.modelDsl.ModelDslPackage#getModel()
* @model
* @generated
*/
public interface Model extends EObject
{
/**
* Returns the value of the '<em><b>Imports</b></em>' containment reference list.
* The list contents are of type {@link org.molymer.modelDsl.Import}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Imports</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Imports</em>' containment reference list.
* @see org.molymer.modelDsl.ModelDslPackage#getModel_Imports()
* @model containment="true"
* @generated
*/
EList<Import> getImports();
/**
* Returns the value of the '<em><b>Elements</b></em>' containment reference list.
* The list contents are of type {@link org.molymer.modelDsl.Element}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Elements</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Elements</em>' containment reference list.
* @see org.molymer.modelDsl.ModelDslPackage#getModel_Elements()
* @model containment="true"
* @generated
*/
EList<Element> getElements();
} // Model
| [
"[email protected]"
] | |
cd888716591fad02be21453be80a6d7a135a5af4 | 48cef93e95771232de485db1f17c9180acd9d380 | /src/test/java/LeetCode/L_24.java | 03d48094c654bb8c96373d6294fba2df6f5fca74 | [] | no_license | 1819011603/mavenTest | 9839fe6b1162509b17a00e65ee886d02c7e137e8 | 56deae57a6f608a0c7ef4a010dc013bc807c593f | refs/heads/master | 2023-08-28T14:37:08.352545 | 2021-10-06T14:39:53 | 2021-10-06T14:39:53 | 356,887,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,417 | java | package LeetCode;
import com.sun.xml.internal.ws.api.WSDLLocator;
/**
* @author 18190
* @Date: 2021/10/1 21:40
* @VERSION 1.0
*/
public class L_24 {
public ListNode swapPairs(ListNode head) {
if (head == null)return null;
return dfs(head,head.next);
}
public ListNode dfs(ListNode pre,ListNode now){
if (now == null)return pre;
ListNode next = now.next;
now.next = pre;
pre.next = next;
if (next != null)
pre.next = dfs(next,next.next);
return now;
}
/* ListNode pre_pre = null;
public ListNode swapPairs(ListNode head) {
if (head == null)return null;
ListNode slow = head;
ListNode fast = slow.next;
if (fast == null)
return slow;
dfs(slow,fast);
return fast;
}
public void dfs(ListNode pre,ListNode now){
if (pre == null || now == null)return;
ListNode next = now.next;
now.next = pre;
pre.next = next;
if (pre_pre != null){
pre_pre.next = now;
}
pre_pre = pre;
if (next!=null)
dfs(next,next.next);
}*/
public static void main(String[] args) {
System.out.println(new L_24().swapPairs(ListNode.arrayToLinkList(new int[]{1,2,3,4})));
System.out.println(new L_24().swapPairs(ListNode.arrayToLinkList(new int[]{1})));
}
}
| [
"[email protected]"
] | |
2ccf6647bb88e5c0c0a64c02554bcd0783cb4f58 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/hd/lvcmpy/rec/HD_LVCMPY_1109_LCURLISTRecord.java | 02d4a022099442f8787dbbcf9764c7e88e65708b | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 9,359 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 :
* 작성일자 :
* 작성자 : 이태식
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.hd.lvcmpy.rec;
import java.sql.*;
import chosun.ciis.hd.lvcmpy.dm.*;
import chosun.ciis.hd.lvcmpy.ds.*;
/**
*
*/
public class HD_LVCMPY_1109_LCURLISTRecord extends java.lang.Object implements java.io.Serializable{
public String lvcmpy_dt;
public String rvrs_prd_frdt;
public String rvrs_prd_todt;
public String dept_cd;
public String dept_nm;
public String in_cmpy_dt;
public String last_midl_adjm_dt;
public String real_lvcmpy_dt;
public String cont_svc_yys;
public String cont_svc_yy;
public String cont_svc_dd;
public String last_mm_saly_1;
public String last_mm_saly_2;
public String last_mm_saly_3;
public String last_mm_saly_4;
public String last_mm_saly_add;
public String last_mm_alon_1;
public String last_mm_alon_2;
public String last_mm_alon_3;
public String last_mm_alon_4;
public String last_mm_alon_add;
public String year_alon_pay_yymm;
public String year_alon_pay_amt;
public String mm_avg_charg_amt;
public String lvcmpy_amt;
public String lvcmpy_mm_saly;
public String yymm_alon_1;
public String year_cnt_1;
public String duty_cnt_1;
public String em_cnt_1;
public String yy_alon_use_stot_1;
public String yy_alon_2;
public String year_cnt_2;
public String duty_cnt_2;
public String em_cnt_2;
public String yy_alon_use_stot_2;
public String un_pay_alon;
public String lvcmpy_add_amt;
public String nm_lvcmpy_add_amt;
public String cont_svc_yys_2012;
public String cont_svc_yys_2013;
public String avg_wag_dt;
public HD_LVCMPY_1109_LCURLISTRecord(){}
public void setLvcmpy_dt(String lvcmpy_dt){
this.lvcmpy_dt = lvcmpy_dt;
}
public void setRvrs_prd_frdt(String rvrs_prd_frdt){
this.rvrs_prd_frdt = rvrs_prd_frdt;
}
public void setRvrs_prd_todt(String rvrs_prd_todt){
this.rvrs_prd_todt = rvrs_prd_todt;
}
public void setDept_cd(String dept_cd){
this.dept_cd = dept_cd;
}
public void setDept_nm(String dept_nm){
this.dept_nm = dept_nm;
}
public void setIn_cmpy_dt(String in_cmpy_dt){
this.in_cmpy_dt = in_cmpy_dt;
}
public void setLast_midl_adjm_dt(String last_midl_adjm_dt){
this.last_midl_adjm_dt = last_midl_adjm_dt;
}
public void setReal_lvcmpy_dt(String real_lvcmpy_dt){
this.real_lvcmpy_dt = real_lvcmpy_dt;
}
public void setCont_svc_yys(String cont_svc_yys){
this.cont_svc_yys = cont_svc_yys;
}
public void setCont_svc_yy(String cont_svc_yy){
this.cont_svc_yy = cont_svc_yy;
}
public void setCont_svc_dd(String cont_svc_dd){
this.cont_svc_dd = cont_svc_dd;
}
public void setLast_mm_saly_1(String last_mm_saly_1){
this.last_mm_saly_1 = last_mm_saly_1;
}
public void setLast_mm_saly_2(String last_mm_saly_2){
this.last_mm_saly_2 = last_mm_saly_2;
}
public void setLast_mm_saly_3(String last_mm_saly_3){
this.last_mm_saly_3 = last_mm_saly_3;
}
public void setLast_mm_saly_4(String last_mm_saly_4){
this.last_mm_saly_4 = last_mm_saly_4;
}
public void setLast_mm_saly_add(String last_mm_saly_add){
this.last_mm_saly_add = last_mm_saly_add;
}
public void setLast_mm_alon_1(String last_mm_alon_1){
this.last_mm_alon_1 = last_mm_alon_1;
}
public void setLast_mm_alon_2(String last_mm_alon_2){
this.last_mm_alon_2 = last_mm_alon_2;
}
public void setLast_mm_alon_3(String last_mm_alon_3){
this.last_mm_alon_3 = last_mm_alon_3;
}
public void setLast_mm_alon_4(String last_mm_alon_4){
this.last_mm_alon_4 = last_mm_alon_4;
}
public void setLast_mm_alon_add(String last_mm_alon_add){
this.last_mm_alon_add = last_mm_alon_add;
}
public void setYear_alon_pay_yymm(String year_alon_pay_yymm){
this.year_alon_pay_yymm = year_alon_pay_yymm;
}
public void setYear_alon_pay_amt(String year_alon_pay_amt){
this.year_alon_pay_amt = year_alon_pay_amt;
}
public void setMm_avg_charg_amt(String mm_avg_charg_amt){
this.mm_avg_charg_amt = mm_avg_charg_amt;
}
public void setLvcmpy_amt(String lvcmpy_amt){
this.lvcmpy_amt = lvcmpy_amt;
}
public void setLvcmpy_mm_saly(String lvcmpy_mm_saly){
this.lvcmpy_mm_saly = lvcmpy_mm_saly;
}
public void setYymm_alon_1(String yymm_alon_1){
this.yymm_alon_1 = yymm_alon_1;
}
public void setYear_cnt_1(String year_cnt_1){
this.year_cnt_1 = year_cnt_1;
}
public void setDuty_cnt_1(String duty_cnt_1){
this.duty_cnt_1 = duty_cnt_1;
}
public void setEm_cnt_1(String em_cnt_1){
this.em_cnt_1 = em_cnt_1;
}
public void setYy_alon_use_stot_1(String yy_alon_use_stot_1){
this.yy_alon_use_stot_1 = yy_alon_use_stot_1;
}
public void setYy_alon_2(String yy_alon_2){
this.yy_alon_2 = yy_alon_2;
}
public void setYear_cnt_2(String year_cnt_2){
this.year_cnt_2 = year_cnt_2;
}
public void setDuty_cnt_2(String duty_cnt_2){
this.duty_cnt_2 = duty_cnt_2;
}
public void setEm_cnt_2(String em_cnt_2){
this.em_cnt_2 = em_cnt_2;
}
public void setYy_alon_use_stot_2(String yy_alon_use_stot_2){
this.yy_alon_use_stot_2 = yy_alon_use_stot_2;
}
public void setUn_pay_alon(String un_pay_alon){
this.un_pay_alon = un_pay_alon;
}
public void setLvcmpy_add_amt(String lvcmpy_add_amt){
this.lvcmpy_add_amt = lvcmpy_add_amt;
}
public void setNm_lvcmpy_add_amt(String nm_lvcmpy_add_amt){
this.nm_lvcmpy_add_amt = nm_lvcmpy_add_amt;
}
public void setCont_svc_yys_2012(String cont_svc_yys_2012){
this.cont_svc_yys_2012 = cont_svc_yys_2012;
}
public void setCont_svc_yys_2013(String cont_svc_yys_2013){
this.cont_svc_yys_2013 = cont_svc_yys_2013;
}
public void setAvg_wag_dt(String avg_wag_dt){
this.avg_wag_dt = avg_wag_dt;
}
public String getLvcmpy_dt(){
return this.lvcmpy_dt;
}
public String getRvrs_prd_frdt(){
return this.rvrs_prd_frdt;
}
public String getRvrs_prd_todt(){
return this.rvrs_prd_todt;
}
public String getDept_cd(){
return this.dept_cd;
}
public String getDept_nm(){
return this.dept_nm;
}
public String getIn_cmpy_dt(){
return this.in_cmpy_dt;
}
public String getLast_midl_adjm_dt(){
return this.last_midl_adjm_dt;
}
public String getReal_lvcmpy_dt(){
return this.real_lvcmpy_dt;
}
public String getCont_svc_yys(){
return this.cont_svc_yys;
}
public String getCont_svc_yy(){
return this.cont_svc_yy;
}
public String getCont_svc_dd(){
return this.cont_svc_dd;
}
public String getLast_mm_saly_1(){
return this.last_mm_saly_1;
}
public String getLast_mm_saly_2(){
return this.last_mm_saly_2;
}
public String getLast_mm_saly_3(){
return this.last_mm_saly_3;
}
public String getLast_mm_saly_4(){
return this.last_mm_saly_4;
}
public String getLast_mm_saly_add(){
return this.last_mm_saly_add;
}
public String getLast_mm_alon_1(){
return this.last_mm_alon_1;
}
public String getLast_mm_alon_2(){
return this.last_mm_alon_2;
}
public String getLast_mm_alon_3(){
return this.last_mm_alon_3;
}
public String getLast_mm_alon_4(){
return this.last_mm_alon_4;
}
public String getLast_mm_alon_add(){
return this.last_mm_alon_add;
}
public String getYear_alon_pay_yymm(){
return this.year_alon_pay_yymm;
}
public String getYear_alon_pay_amt(){
return this.year_alon_pay_amt;
}
public String getMm_avg_charg_amt(){
return this.mm_avg_charg_amt;
}
public String getLvcmpy_amt(){
return this.lvcmpy_amt;
}
public String getLvcmpy_mm_saly(){
return this.lvcmpy_mm_saly;
}
public String getYymm_alon_1(){
return this.yymm_alon_1;
}
public String getYear_cnt_1(){
return this.year_cnt_1;
}
public String getDuty_cnt_1(){
return this.duty_cnt_1;
}
public String getEm_cnt_1(){
return this.em_cnt_1;
}
public String getYy_alon_use_stot_1(){
return this.yy_alon_use_stot_1;
}
public String getYy_alon_2(){
return this.yy_alon_2;
}
public String getYear_cnt_2(){
return this.year_cnt_2;
}
public String getDuty_cnt_2(){
return this.duty_cnt_2;
}
public String getEm_cnt_2(){
return this.em_cnt_2;
}
public String getYy_alon_use_stot_2(){
return this.yy_alon_use_stot_2;
}
public String getUn_pay_alon(){
return this.un_pay_alon;
}
public String getLvcmpy_add_amt(){
return this.lvcmpy_add_amt;
}
public String getNm_lvcmpy_add_amt(){
return this.nm_lvcmpy_add_amt;
}
public String getCont_svc_yys_2012(){
return this.cont_svc_yys_2012;
}
public String getCont_svc_yys_2013(){
return this.cont_svc_yys_2013;
}
public String getAvg_wag_dt(){
return this.avg_wag_dt;
}
}
/* 작성시간 : Wed Nov 23 11:10:11 KST 2016 */ | [
"[email protected]"
] | |
1ebacf88e66988b3f791316d916f61dc3d070ba0 | aec9295db4cd4916f7b1a1ebe36f3fa40ada4098 | /analytics/src/com/mzland/analytics/ws/Encrypt.java | ba3560b044748337468b6fc0eabe27185f9da911 | [] | no_license | yseasony/yseasony | be4df7d8590825866a59574feb7576083b1104ac | 293a55b5b5b5cfe09cf1784ab3ba6056536f6625 | refs/heads/master | 2021-01-10T18:53:40.110191 | 2013-10-09T12:10:17 | 2013-10-09T12:10:17 | 32,120,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,797 | java | package com.mzland.analytics.ws;
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.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
public class Encrypt {
public final static int[] KEY = new int[]{0x1D96B5A3, 0x388A268B, 0xA4ECB758, 0x689D5CE2};
public final static int TIMES = 16;
private final static byte[] hex = "0123456789ABCDEF".getBytes();
/**
*
* @param content
* @param offset
* @param key
* @param times
* @return
*/
public static byte[] encrypt(byte[] content, int offset, int[] key, int times) {
int[] tempInt = byteToInt(content, offset);
int y = tempInt[0], z = tempInt[1], sum = 0, i;
int delta = 0x9E3779B9;
int a = key[0], b = key[1], c = key[2], d = key[3];
for (i = 0; i < times; i++) {
sum += delta;
y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
}
tempInt[0] = y;
tempInt[1] = z;
return intToByte(tempInt, 0);
}
/**
* ����
*
* @param encryptContent
* @param offset
* @param key
* @param times
* @return
*/
public static byte[] decrypt(byte[] encryptContent, int offset, int[] key, int times) {
int[] tempInt = byteToInt(encryptContent, offset);
int y = tempInt[0], z = tempInt[1], sum = 0, i;
int delta = 0x9e3779b9;
int a = key[0], b = key[1], c = key[2], d = key[3];
if (times == 32)
sum = 0xC6EF3720;
else if (times == 16)
sum = 0xE3779B90;
else
sum = delta * times;
for (i = 0; i < times; i++) {
z -= ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);
y -= ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);
sum -= delta;
}
tempInt[0] = y;
tempInt[1] = z;
return intToByte(tempInt, 0);
}
/**
* byte[]
*
* @param content
* @param offset
* @return
*/
public static int[] byteToInt(byte[] content, int offset) {
int[] result = new int[content.length >> 2];
for (int i = 0, j = offset; j < content.length; i++, j += 4) {
result[i] = transform(content[j])
| transform(content[j + 1]) << 8
| transform(content[j + 2]) << 16
| (int) content[j + 3] << 24;
}
return result;
}
/**
* int[]
*
* @param content
* @param offset
* @return
*/
public static byte[] intToByte(int[] content, int offset) {
byte[] result = new byte[content.length << 2];
for (int i = 0, j = offset; j < result.length; i++, j += 4) {
result[j] = (byte) (content[i] & 0xff);
result[j + 1] = (byte) ((content[i] >> 8) & 0xff);
result[j + 2] = (byte) ((content[i] >> 16) & 0xff);
result[j + 3] = (byte) ((content[i] >> 24) & 0xff);
}
return result;
}
/**
*
*/
public static int transform(byte temp) {
int tempInt = (int) temp;
if (tempInt < 0) {
tempInt += 256;
}
return tempInt;
}
/**
*
*
* @param fileName
* @param b
*/
public static void save(final String fileName, byte[] b) {
File file = new File(fileName);
try {
OutputStream out = new FileOutputStream(file);
out.write(b, 0, b.length);
out.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
}
/**
*
* @param fileName
* @return
*/
public static byte[] open(final String fileName) {
StringBuffer buf = new StringBuffer();
File file = new File(fileName);
try {
InputStream in = new FileInputStream(file);
int i = -1;
while ((i = in.read()) != -1) {
buf.append((char) i);
}
in.close();
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
*
* @param info
* @return
*/
public static byte[] encryptByTea(String info) {
try {
byte[] temp = info.getBytes("UTF-8");
int n = 8 - temp.length % 8;
byte[] encryptStr = new byte[temp.length + n];
encryptStr[temp.length + n - 1] = (byte) n;
System.arraycopy(temp, 0, encryptStr, 0, temp.length);
byte[] result = new byte[encryptStr.length];
for (int offset = 0; offset < result.length; offset += 8) {
byte[] tempEncrpt = Encrypt.encrypt(encryptStr, offset, KEY, TIMES);
System.arraycopy(tempEncrpt, 0, result, offset, 8);
}
return result;
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
/**
*
* @param secretInfo
* @return
*/
public static String decryptByTea(byte[] secretInfo) {
if (secretInfo.length == 0) {
return "";
}
byte[] decryptStr = null;
byte[] tempDecrypt = new byte[secretInfo.length];
for (int offset = 0; offset < secretInfo.length; offset += 8) {
decryptStr = Encrypt.decrypt(secretInfo, offset, KEY, TIMES);
System.arraycopy(decryptStr, 0, tempDecrypt, offset, 8);
}
return new String(tempDecrypt, 0, decryptStr.length);
}
/**
*
* @param s
* @return
*/
public final static String md5(String s) {
char hexDigits[] = {'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'};
try {
byte[] strTemp = s.getBytes();
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(strTemp);
byte[] md = mdTemp.digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
}
catch (Exception e) {
return null;
}
}
// 从字节数组到十六进制字符串转换
public static String bytesToHexString(byte[] b) {
byte[] buff = new byte[2 * b.length];
for (int i = 0; i < b.length; i++) {
buff[2 * i] = hex[(b[i] >> 4) & 0x0f];
buff[2 * i + 1] = hex[b[i] & 0x0f];
}
return new String(buff);
}
// 从十六进制字符串到字节数组转换
public static byte[] hexStringToBytes(String hexstr) {
byte[] b = new byte[hexstr.length() / 2];
int j = 0;
for (int i = 0; i < b.length; i++) {
char c0 = hexstr.charAt(j++);
char c1 = hexstr.charAt(j++);
b[i] = (byte) ((parse(c0) << 4) | parse(c1));
}
return b;
}
private static int parse(char c) {
if (c >= 'a')
return (c - 'a' + 10) & 0x0f;
if (c >= 'A')
return (c - 'A' + 10) & 0x0f;
return (c - '0') & 0x0f;
}
} | [
"yseasony@63ded714-ee35-11de-9e3d-99312c638492"
] | yseasony@63ded714-ee35-11de-9e3d-99312c638492 |
ced7470fee55790f1ea6269cc12a18a8289522cc | 75e71f3b975def2fed9ac442247d3970cf8bc586 | /shop/src/main/java/fer/shop/App.java | a3bc0e3d6d58ca3b5749d38ea9cd1b06a6021057 | [] | no_license | ferpessina/PrototypeApp-Shop | 9fa57f7f70ab00e03e4fe362218750c1fabf4556 | e36d8d1ac2cc4d454c56aea565c8352c501b944d | refs/heads/master | 2020-12-25T14:33:33.598232 | 2016-09-07T00:16:26 | 2016-09-07T00:16:26 | 67,556,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package fer.shop;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class App
{
public static void main( String[] args )
{
SpringApplication.run(App.class, args);
}
}
| [
"[email protected]"
] | |
1156ff06bd46c6f2b78f1c394bba81feca1ef2c3 | 2f949789b06ffbefe9e0765b463dbb4c16aae295 | /favService/src/main/java/com/favService/dto/favRequest.java | 9639777b6367902d77854af004d20809e7e467f2 | [] | no_license | KavithaHRH/cricketapp | 329283dc05673e2ce2086ea154c37231a083cc64 | 22b8aafdd81fae29273c3d7fa7fa5bf941726b32 | refs/heads/main | 2023-07-04T19:25:58.745527 | 2021-08-09T17:42:29 | 2021-08-09T17:42:29 | 394,378,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package com.favService.dto;
public class favRequest {
private int matchid;
private String matchtitle;
public favRequest() {
super();
// TODO Auto-generated constructor stub
}
public int getMatchid() {
return matchid;
}
public void setMatchid(int matchid) {
this.matchid = matchid;
}
public String getMatchtitle() {
return matchtitle;
}
public void setMatchtitle(String matchtitle) {
this.matchtitle = matchtitle;
}
}
| [
"[email protected]"
] | |
429bf97f15db678e49098aa5fbf99d3bcc77fd55 | 340c2fa31350f5dd1744a76b9e79eb836ed83105 | /src/main/java/com/uas/services/impl/DiagnosticServiceImpl.java | 0dbfec722dd063e71f9d0c3e3fed24126464aa1b | [] | no_license | hkirisara/ProjectPFEsara | 6998e992629c50d898ed1e6d77aee0fe5a33c08e | 52d3adc4a77e15d24c30c05559677448c1e065e0 | refs/heads/master | 2023-06-10T00:34:16.089583 | 2021-07-06T19:48:32 | 2021-07-06T19:48:32 | 376,108,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,006 | java | package com.uas.services.impl;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Service;
import com.uas.dto.DiagnosticDTO;
import com.uas.entity.Diagnostic;
import com.uas.entity.Intervention;
import com.uas.entity.Utilisateur;
import com.uas.repository.DiagnosticRepository;
import com.uas.repository.InterventionRepository;
import com.uas.repository.UtilisateurRepository;
import com.uas.services.DiagnosticService;
@Service
public class DiagnosticServiceImpl implements DiagnosticService {
private final DiagnosticRepository diagnosticRepository;
private final UtilisateurRepository userRepo;
private final InterventionRepository interventionRepository;
public DiagnosticServiceImpl(DiagnosticRepository diagnosticRepository, UtilisateurRepository userRepo,
InterventionRepository interventionRepository) {
this.diagnosticRepository = diagnosticRepository;
this.userRepo = userRepo;
this.interventionRepository = interventionRepository;
}
@Override
public List<Diagnostic> getAllDiagnostic() {
return diagnosticRepository.findAll();
}
@Override
public Diagnostic getById(String id) {
return diagnosticRepository.findById(id).get();
}
@Override
public Diagnostic update(Diagnostic diagnostic) {
return diagnosticRepository.save(diagnostic);
}
@Override
public Diagnostic add(String interventionId, Diagnostic diagnostic) {
Optional<Intervention> interventionOptional = interventionRepository.findById(interventionId);
if (interventionOptional.isPresent()) {
diagnostic.setIntervention(interventionOptional.get());
}
return diagnosticRepository.save(diagnostic);
}
@Override
public void delete(String id) {
diagnosticRepository.deleteById(id);
}
@Override
public List<Diagnostic> findAllByIntervIntervention (String interventionId) {
Intervention intervention = interventionRepository.findById(interventionId).get();
return diagnosticRepository.findAllByIntervention(intervention);
}
// @Override
// public List<Intervention> getDiagnosticByInterventionId(String InterventionId) {
// return diagnosticRepository.getDiagnosticByInterventionId(InterventionId);
// }
/*@Override
public Diagnostic add(DiagnosticDTO diagnosticDTO) {
if (diagnosticDTO.getDiagnosticIds() != null) {
for (String el : diagnosticDTO.getDiagnosticIds()) {
Diagnostic diagnostic = diagnosticRepository.findById(el).get();
Utilisateur user = null;
if (diagnosticDTO.getUserId() != null) {
Optional<Utilisateur> userOptional = userRepo.findById(diagnosticDTO.getUserId());
user = userOptional.get();
}
diagnostic.setUtilisateur(user);
diagnosticRepository.save(diagnostic);
}
}
return null;*/
/*@Override
public Diagnostic getByInterventionId(String InterventionId) {
List<Diagnostic> list = diagnosticRepository.findAll();
for(Diagnostic diag : list) {
if(diag.getIntervention().getId().equals(InterventionId))
return diag;
}
return null;
}*/
}
| [
"[email protected]"
] | |
3324374a7e328a60e3ba5a0118989c288b87566f | a7497fae8dd751b07abe1c61dbb09d52f47f3d76 | /org.isistan.flabot.launcher.instrumentation/src/org/isistan/flabot/launcher/instrumentation/localjava/LocalJavaApplicationCollectionLauncher.java | 6c7b7cf571d3519b41a9f75d1b8880e47b798274 | [] | no_license | niconistal/FLABot | 639388ec36e514cb6f8c63caa01530bff2e1fcbd | a118b9fd20c3ee44b6d2b456b3f7b362ce92327a | refs/heads/master | 2021-03-12T19:52:59.571266 | 2013-01-29T01:46:46 | 2013-01-29T01:46:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,006 | java | package org.isistan.flabot.launcher.instrumentation.localjava;
import java.io.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.isistan.flabot.launcher.collection.CollectionLauncherException;
import org.isistan.flabot.launcher.collection.TraceConfigurationSavingCollectionLauncher;
public class LocalJavaApplicationCollectionLauncher extends TraceConfigurationSavingCollectionLauncher {
@Override
public void launch(ILaunchConfiguration flabotConfiguration,
ILaunchConfiguration targetConfiguration,
String mode, ILaunch launch, IProgressMonitor monitor,
File traceConfiguration)
throws CoreException, CollectionLauncherException {
LocalJavaApplicationConfigurationDelegate delegate=
new LocalJavaApplicationConfigurationDelegate(traceConfiguration);
delegate.launch(targetConfiguration, mode, launch, monitor);
}
}
| [
"[email protected]"
] | |
d17e72acdce4545b96c7a1e50678fd79506cac3d | 3333d55b9d6ba933557ac4775f4a69aa48ed7be2 | /src/main/java/linkealist/twoside/LinkedQueueImpl.java | a5355781dcef750b90cdb8f6b301ba25a8754197 | [] | no_license | lexa10/lesson | a6b483844f0aad2e5bd54a3f6f909866dc43dd5c | 2156c07602547be8f209191c4b37e4dfc39f6a93 | refs/heads/master | 2021-06-28T19:02:56.118089 | 2019-12-26T12:10:14 | 2019-12-26T12:10:14 | 172,770,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 829 | java | package linkealist.twoside;
import linkealist.StackQueue.Queue;
public class LinkedQueueImpl<E> implements Queue<E> {
private TwoSideLinkedList<E> data;
public LinkedQueueImpl() {
this.data = new TwoSideLinkedListImpl<>();
}
@Override
public void insert(E value) {
data.insertRight(value);
}
@Override
public E remove() {
return data.removeLeft();
}
@Override
public E peek() {
return data.getFirstElement();
}
@Override
public int size() {
return data.getSize();
}
public boolean isFull() {
return false;
}
@Override
public boolean isEmpty() {
return data.isEmpty();
}
} | [
"[email protected]"
] | |
0de4e1cc087596b5ce7f9697b188bd47009d964a | 0bc868d114710118e3f5dd01394cb4f0b0acf909 | /verdi_core/src/anl/verdi/parser/ASTSqrt.java | f7f690f29279f8a05f4587b08c06e8bee6fdfed0 | [] | no_license | gitter-badger/VERDI | 043221fde65dd58075fb31df4063b5b6e1cbe398 | dd765405f09aa690bdcee89f81322d655d8dff28 | refs/heads/master | 2020-12-30T18:29:45.418759 | 2016-03-13T20:58:20 | 2016-03-13T20:58:20 | 61,566,178 | 0 | 0 | null | 2016-06-20T17:16:02 | 2016-06-20T17:16:00 | null | UTF-8 | Java | false | false | 763 | java | /* Generated By:JJTree: Do not edit this line. ASTSqrt.java */
package anl.verdi.parser;
import anl.verdi.formula.IllegalFormulaException;
import anl.verdi.util.DoubleFunction;
import anl.verdi.util.FormulaArray;
public class ASTSqrt extends SimpleNode {
static class Sqrt implements DoubleFunction {
public double apply(double val) {
return Math.sqrt(val);
}
}
public ASTSqrt(int id) {
super(id);
}
public ASTSqrt(Parser p, int id) {
super(p, id);
}
/**
* Evaluates this Node.
*
* @param frame
* @return the result of the evaluation.
*/
@Override
public FormulaArray evaluate(Frame frame) throws IllegalFormulaException {
return jjtGetChild(0).evaluate(frame).foreach(new Sqrt());
}
}
| [
"lizadams@b46c3202-f04a-0410-9bfd-f137835f981a"
] | lizadams@b46c3202-f04a-0410-9bfd-f137835f981a |
5aefe5e28d88ea392ffc4618ebd8792108838a3e | bc32ffd8f3ee2dce44303764b7004b26bf915005 | /src/main/java/cn/bos/bosApplication.java | 9ad4bd6d2ccb97703012b94af0aae4010b6bce25 | [] | no_license | xiaojiong0/bosxj | 21b82a6501b7de44041a8f33610e7db70ee0c18b | 23199d734ddfedf8361390a5d21de275cf6075a8 | refs/heads/master | 2021-05-08T12:27:41.816691 | 2018-06-20T03:45:52 | 2018-06-20T03:45:52 | 119,945,850 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,981 | java | package cn.bos;
import com.jolbox.bonecp.BoneCPDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import javax.sql.DataSource;
@Configuration
@PropertySource(value = { "classpath:jdbc.properties" })
@ComponentScan(basePackages = "cn.bos")
@SpringBootApplication
public class bosApplication {
@Value("${jdbc.url}")
private String jdbcUrl;
@Value("${jdbc.driverClassName}")
private String jdbcDriverClassName;
@Value("${jdbc.username}")
private String jdbcUsername;
@Value("${jdbc.password}")
private String jdbcPassword;
@Bean(destroyMethod = "close")
public DataSource dataSource() {
BoneCPDataSource boneCPDataSource = new BoneCPDataSource();
// 数据库驱动
boneCPDataSource.setDriverClass(jdbcDriverClassName);
// 相应驱动的jdbcUrl
boneCPDataSource.setJdbcUrl(jdbcUrl);
// 数据库的用户名
boneCPDataSource.setUsername(jdbcUsername);
// 数据库的密码
boneCPDataSource.setPassword(jdbcPassword);
// 检查数据库连接池中空闲连接的间隔时间,单位是分,默认值:240,如果要取消则设置为0
boneCPDataSource.setIdleConnectionTestPeriodInMinutes(60);
// 连接池中未使用的链接最大存活时间,单位是分,默认值:60,如果要永远存活设置为0
boneCPDataSource.setIdleMaxAgeInMinutes(30);
// 每个分区最大的连接数
boneCPDataSource.setMaxConnectionsPerPartition(100);
// 每个分区最小的连接数
boneCPDataSource.setMinConnectionsPerPartition(5);
return boneCPDataSource;
}
}
| [
"[email protected]"
] | |
be96335676d7b0d0a75071d190e259d02eca0ac6 | e62cd41b83372755de5322c99e75091bfc601903 | /simple/src/main/java/gordon/study/simple/compile/antlr4ref/tour02/ExprListener.java | ca4bc3b253a9c79e3d1d5880ef4b79c282bf2f1b | [] | no_license | YGH-710848226/study | be5bed93a0473ff82ecf91376539c2c3aa0c21b1 | eb803bc4f322758e0010a3b62fa913c4182b590e | refs/heads/master | 2023-07-02T01:55:16.669783 | 2021-06-13T07:45:18 | 2021-06-13T07:45:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | // Generated from C:/study/codebase/github/gordonklg/study/simple/src/main/java/gordon/study/simple/compile/antlr4ref/tour02\Expr.g4 by ANTLR 4.8
package gordon.study.simple.compile.antlr4ref.tour02;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link ExprParser}.
*/
public interface ExprListener extends ParseTreeListener {
/**
* Enter a parse tree produced by {@link ExprParser#prog}.
* @param ctx the parse tree
*/
void enterProg(ExprParser.ProgContext ctx);
/**
* Exit a parse tree produced by {@link ExprParser#prog}.
* @param ctx the parse tree
*/
void exitProg(ExprParser.ProgContext ctx);
/**
* Enter a parse tree produced by {@link ExprParser#stat}.
* @param ctx the parse tree
*/
void enterStat(ExprParser.StatContext ctx);
/**
* Exit a parse tree produced by {@link ExprParser#stat}.
* @param ctx the parse tree
*/
void exitStat(ExprParser.StatContext ctx);
/**
* Enter a parse tree produced by {@link ExprParser#expr}.
* @param ctx the parse tree
*/
void enterExpr(ExprParser.ExprContext ctx);
/**
* Exit a parse tree produced by {@link ExprParser#expr}.
* @param ctx the parse tree
*/
void exitExpr(ExprParser.ExprContext ctx);
} | [
"[email protected]"
] | |
7b6f0d48d624640a025610d4ed5ae9eed65a7ed8 | 4a68a3afeb5b56cdfb5d84974347f51f5eca5d09 | /src/main/java/study/designpattern/observer/CurrentConditionsDisplay.java | 8bdc427184ce5d9aaa64b5e51b9d435a509a2398 | [] | no_license | luvram/design-pattern-study | 9bbddb2a2ed84806ac2852086657458b8a8245c9 | f50932876be877c8d57306c50a63fc57d3a6b019 | refs/heads/master | 2023-04-15T10:47:28.106438 | 2021-04-20T13:31:35 | 2021-04-20T13:31:35 | 352,915,657 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | java | package study.designpattern.observer;
public class CurrentConditionsDisplay implements Observer, DisplayElement {
private float temperature;
private float humidity;
private Subject weatherData;
public CurrentConditionsDisplay(Subject weatherData) {
this.weatherData = weatherData;
weatherData.registerObserver(this);
}
@Override
public void display() {
System.out.println("Current conditions: " + temperature + "F decrees and " + humidity + "% humidity");
}
@Override
public void update(float temp, float humidity, float pressure) {
this.temperature = temp;
this.humidity = temperature;
display();
}
}
| [
"[email protected]"
] | |
5e5f36f566ab1b54721153f4efa88b57b7c3914a | 898f19a47c1cd12e14bf02c5f9a010b4f5d7a7d5 | /src/com/owncloud/android/lib/common/accounts/ExternalLinksOperation.java | bc7e1bfdbf35b2bfdbe1d22c76af2b00359e6f07 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | tkjcloud/android-library-1 | e2d8dc7d5a91455fabc4bffa94af34b4a6148623 | e3dd340da1f6c486f65ed75cd01e13d488187727 | refs/heads/master | 2021-08-22T15:23:09.581963 | 2017-11-28T09:33:27 | 2017-11-28T09:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,389 | java | /**
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2017 Nextcloud GmbH.
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
* <p>
* 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 Affero General Public License for more details.
* <p>
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.lib.common.accounts;
import com.owncloud.android.lib.common.ExternalLink;
import com.owncloud.android.lib.common.ExternalLinkType;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.GetRemoteCapabilitiesOperation;
import com.owncloud.android.lib.resources.status.OCCapability;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* gets external links provided by 'external' app
*/
public class ExternalLinksOperation extends RemoteOperation {
private static final String TAG = ExternalLinksOperation.class.getSimpleName();
// OCS Route
private static final String OCS_ROUTE_EXTERNAL_LINKS = "/ocs/v2.php/apps/external/api/v1";
// JSON Node names
private static final String NODE_OCS = "ocs";
private static final String NODE_DATA = "data";
private static final String NODE_ID = "id";
private static final String NODE_ICON = "icon";
private static final String NODE_LANGUAGE = "lang";
private static final String NODE_TYPE = "type";
private static final String NODE_NAME = "name";
private static final String NODE_URL = "url";
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result = null;
int status = -1;
GetMethod get = null;
String ocsUrl = client.getBaseUri() + OCS_ROUTE_EXTERNAL_LINKS;
try {
// check capabilities
RemoteOperation getCapabilities = new GetRemoteCapabilitiesOperation();
RemoteOperationResult capabilitiesResult = getCapabilities.execute(client);
OCCapability capability = (OCCapability) capabilitiesResult.getData().get(0);
if (capability.getExternalLinks().isTrue()) {
get = new GetMethod(ocsUrl);
get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
get.setQueryString(new NameValuePair[]{new NameValuePair("format", "json")});
status = client.executeMethod(get);
if (isSuccess(status)) {
String response = get.getResponseBodyAsString();
Log_OC.d(TAG, "Successful response: " + response);
// parse
JSONArray links = new JSONObject(response).getJSONObject(NODE_OCS).getJSONArray(NODE_DATA);
ArrayList<Object> resultLinks = new ArrayList<>();
for (int i = 0; i < links.length(); i++) {
JSONObject link = links.getJSONObject(i);
if (link != null) {
Integer id = link.getInt(NODE_ID);
String iconUrl = link.getString(NODE_ICON);
String language = link.getString(NODE_LANGUAGE);
ExternalLinkType type;
switch (link.getString(NODE_TYPE)) {
case "link":
type = ExternalLinkType.LINK;
break;
case "settings":
type = ExternalLinkType.SETTINGS;
break;
case "quota":
type = ExternalLinkType.QUOTA;
break;
default:
type = ExternalLinkType.UNKNOWN;
break;
}
String name = link.getString(NODE_NAME);
String url = link.getString(NODE_URL);
resultLinks.add(new ExternalLink(id, iconUrl, language, type, name, url));
}
}
result = new RemoteOperationResult(true, status, get.getResponseHeaders());
result.setData(resultLinks);
} else {
result = new RemoteOperationResult(false, status, get.getResponseHeaders());
String response = get.getResponseBodyAsString();
Log_OC.e(TAG, "Failed response while getting external links ");
if (response != null) {
Log_OC.e(TAG, "*** status code: " + status + " ; response message: " + response);
} else {
Log_OC.e(TAG, "*** status code: " + status);
}
}
} else {
result = new RemoteOperationResult(RemoteOperationResult.ResultCode.NOT_AVAILABLE);
Log_OC.d(TAG, "External links disabled");
}
} catch (Exception e) {
result = new RemoteOperationResult(e);
Log_OC.e(TAG, "Exception while getting external links ", e);
} finally {
if (get != null) {
get.releaseConnection();
}
}
return result;
}
private boolean isSuccess(int status) {
return (status == HttpStatus.SC_OK);
}
}
| [
"[email protected]"
] | |
c2e55ee95caeae3c03dc2aacd0c035f71164992e | 8bdcdd28a484046204669dfc1fbdf1a1ae14f8d3 | /gupao-study-mybatis/src/test/java/com/study/mybatis/TestMapper.java | 5c08ef15f79b44f55178402af241f7c65d49e3ac | [] | no_license | p-m-q/Learning-program-gupao-or-myself | 55f529f7b07977db3f2b9b81bc173300822dc087 | 47d05575bed923973e0fe454989fab100037353b | refs/heads/master | 2023-06-02T06:27:16.632653 | 2020-10-14T13:44:44 | 2020-10-14T13:44:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,629 | java | package com.study.mybatis;
import com.study.dubbo.mybatis.entity.NormalCustom;
import com.study.dubbo.mybatis.mapper.NormalCustomMapper;
import com.study.dubbo.mybatis.util.session.SessionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.PropertyConfigurator;
import java.io.IOException;
import java.io.InputStream;
public class TestMapper {
private static final Log log = LogFactory.getLog(TestMapper.class);
public static void main(String[] args) throws IOException {
InputStream inputStream = Resources.getResourceAsStream("config/log4j.properties");
PropertyConfigurator.configure(inputStream);
SqlSession sqlSession = SessionUtils.getSqlSession();
NormalCustomMapper mapper = sqlSession.getMapper(NormalCustomMapper.class);
NormalCustom customer = (NormalCustom) mapper.findByPrimaryKey("jack");
System.out.println(customer);
// Customer customerAdd = new Customer();
// customerAdd.setUsername("ben");
// customerAdd.setPasswd("w1212");
// customerAdd.setAge(34);
// customerAdd.setCreatedate(new Date());
// customerAdd.setSex('男');
// Calendar calendar = Calendar.getInstance();
// calendar.set(1993,6,20);
// customerAdd.setBirth(calendar.getTime());
// mapper.addCustomer(customerAdd);
// customer.setPasswd("wqwass1e333");
// mapper.update(customer);
sqlSession.commit();
sqlSession.close();
}
}
| [
"[email protected]"
] | |
f9ce284ed6305fdeab413a546eecde4382d16a93 | 1cedb98670494d598273ca8933b9d989e7573291 | /ezyfox-server-util/src/test/java/com/tvd12/ezyfoxserver/testing/io/EzyMathTest.java | 8690307cdf263420367d49780462dfd6b2e9b2c4 | [
"Apache-2.0"
] | permissive | thanhdatbkhn/ezyfox-server | ee00e1e23a2b38597bac94de7103bdc3a0e0bedf | 069e70c8a7d962df8341444658b198ffadc3ce61 | refs/heads/master | 2020-03-10T11:08:10.921451 | 2018-01-14T16:50:37 | 2018-01-14T16:50:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,210 | java | package com.tvd12.ezyfoxserver.testing.io;
import org.testng.annotations.Test;
import com.tvd12.ezyfoxserver.io.EzyBytes;
import com.tvd12.ezyfoxserver.io.EzyMath;
import com.tvd12.test.base.BaseTest;
import static org.testng.Assert.*;
import java.nio.ByteBuffer;
public class EzyMathTest extends BaseTest {
@Test
public void test() {
assertEquals(EzyMath.bin2uint(
new byte[] {1, 2, 3, 4}),
ByteBuffer.wrap(new byte[] {1, 2, 3, 4}).getInt());
assertEquals(EzyMath.bin2int(8), 255);
assertEquals(EzyMath.bin2ulong(
new byte[] {1, 2, 3, 4, 5, 6, 7, 8}),
ByteBuffer.wrap(new byte[] {1, 2, 3, 4, 5, 6, 7, 8}).getLong());
assertEquals(EzyMath.bin2long(40), 1099511627775L);
assertEquals(EzyMath.bin2int(
getBytes(ByteBuffer.allocate(4).putInt(-100))),
-100);
assertEquals(EzyMath.bin2long(
getBytes(ByteBuffer.allocate(8).putLong(-100000))),
-100000L);
byte[] xor = new byte[] {(byte) 255, (byte) 255, (byte) 255};
EzyMath.xor(xor);
assertEquals(xor, new byte[] {0, 0, 0});
}
protected byte[] getBytes(ByteBuffer buffer) {
return EzyBytes.getBytes(buffer);
}
@Override
public Class<?> getTestClass() {
return EzyMath.class;
}
}
| [
"[email protected]"
] | |
e01b0b3d904d23e6f7053bcc16be461cfbd5b341 | 4e9cc5d6eb8ec75e717404c7d65ab07e8f749c83 | /sdk-hook/src/main/java/com/dingtalk/api/request/OapiCollectionSchemaCreateRequest.java | daa978808e43d47884301ba2acaa0b713db39fc8 | [] | no_license | cvdnn/ZtoneNetwork | 38878e5d21a17d6fe69a107cfc901d310418e230 | 2b985cc83eb56d690ec3b7964301aeb4fda7b817 | refs/heads/master | 2023-05-03T16:41:01.132198 | 2021-05-19T07:35:58 | 2021-05-19T07:35:58 | 92,125,735 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 13,491 | java | package com.dingtalk.api.request;
import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.TaobaoObject;
import java.util.Date;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.taobao.api.internal.util.json.JSONWriter;
import com.dingtalk.api.response.OapiCollectionSchemaCreateResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.collection.schema.create request
*
* @author top auto create
* @since 1.0, 2020.06.17
*/
public class OapiCollectionSchemaCreateRequest extends BaseTaobaoRequest<OapiCollectionSchemaCreateResponse> {
/**
* 根请求
*/
private String request;
public void setRequest(String request) {
this.request = request;
}
public void setRequest(SaveFormSchemaRequest request) {
this.request = new JSONWriter(false,false,true).write(request);
}
public String getRequest() {
return this.request;
}
public String getApiMethodName() {
return "dingtalk.oapi.collection.schema.create";
}
private String topResponseType = Constants.RESPONSE_TYPE_DINGTALK_OAPI;
public String getTopResponseType() {
return this.topResponseType;
}
public void setTopResponseType(String topResponseType) {
this.topResponseType = topResponseType;
}
public String getTopApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
private String topHttpMethod = DingTalkConstants.HTTP_METHOD_POST;
public String getTopHttpMethod() {
return this.topHttpMethod;
}
public void setTopHttpMethod(String topHttpMethod) {
this.topHttpMethod = topHttpMethod;
}
public void setHttpMethod(String httpMethod) {
this.setTopHttpMethod(httpMethod);
}
public Map<String, String> getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("request", this.request);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class<OapiCollectionSchemaCreateResponse> getResponseClass() {
return OapiCollectionSchemaCreateResponse.class;
}
public void check() throws ApiRuleException {
}
/**
* 可见范围
*
* @author top auto create
* @since 1.0, null
*/
public static class ProcessVisibleValueVo extends TaobaoObject {
private static final long serialVersionUID = 7879553399686982361L;
/**
* 类型
*/
@ApiField("visible_type")
private Long visibleType;
/**
* 值
*/
@ApiField("visible_value")
private String visibleValue;
public Long getVisibleType() {
return this.visibleType;
}
public void setVisibleType(Long visibleType) {
this.visibleType = visibleType;
}
public String getVisibleValue() {
return this.visibleValue;
}
public void setVisibleValue(String visibleValue) {
this.visibleValue = visibleValue;
}
}
/**
* 表单设置
*
* @author top auto create
* @since 1.0, null
*/
public static class FormSchemaSettingVo extends TaobaoObject {
private static final long serialVersionUID = 1689289489418477659L;
/**
* 业务类型
*/
@ApiField("biz_type")
private Long bizType;
/**
* 填写结束时间循环表单的循环结束时间
*/
@ApiField("end_time")
private Date endTime;
/**
* 表单类型
*/
@ApiField("form_type")
private Long formType;
/**
* 循环周期
*/
@ApiListField("loop_day_of_weeks")
@ApiField("number")
private List<Long> loopDayOfWeeks;
/**
* 提醒时间
*/
@ApiField("loop_time")
private String loopTime;
/**
* 回复时间开关循环周期启用
*/
@ApiField("reply_time")
private Boolean replyTime;
public Long getBizType() {
return this.bizType;
}
public void setBizType(Long bizType) {
this.bizType = bizType;
}
public Date getEndTime() {
return this.endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Long getFormType() {
return this.formType;
}
public void setFormType(Long formType) {
this.formType = formType;
}
public List<Long> getLoopDayOfWeeks() {
return this.loopDayOfWeeks;
}
public void setLoopDayOfWeeks(List<Long> loopDayOfWeeks) {
this.loopDayOfWeeks = loopDayOfWeeks;
}
public String getLoopTime() {
return this.loopTime;
}
public void setLoopTime(String loopTime) {
this.loopTime = loopTime;
}
public Boolean getReplyTime() {
return this.replyTime;
}
public void setReplyTime(Boolean replyTime) {
this.replyTime = replyTime;
}
}
/**
* 选项级联目标
*
* @author top auto create
* @since 1.0, null
*/
public static class BehaviorTarget extends TaobaoObject {
private static final long serialVersionUID = 6295847365151368358L;
/**
* 行为
*/
@ApiField("behavior")
private String behavior;
/**
* 控件ID
*/
@ApiField("field_id")
private String fieldId;
public String getBehavior() {
return this.behavior;
}
public void setBehavior(String behavior) {
this.behavior = behavior;
}
public String getFieldId() {
return this.fieldId;
}
public void setFieldId(String fieldId) {
this.fieldId = fieldId;
}
}
/**
* 选项级联属性
*
* @author top auto create
* @since 1.0, null
*/
public static class BehaviorLinkageVo extends TaobaoObject {
private static final long serialVersionUID = 2628945886338383471L;
/**
* 选项级联目标
*/
@ApiListField("targets")
@ApiField("behavior_target")
private List<BehaviorTarget> targets;
/**
* 值
*/
@ApiField("value")
private String value;
public List<BehaviorTarget> getTargets() {
return this.targets;
}
public void setTargets(List<BehaviorTarget> targets) {
this.targets = targets;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
/**
* 带选项的组件的option
*
* @author top auto create
* @since 1.0, null
*/
public static class ComponentPropOptionVo extends TaobaoObject {
private static final long serialVersionUID = 6442265549498198644L;
/**
* 名称
*/
@ApiField("key")
private String key;
/**
* 选项值
*/
@ApiField("value")
private String value;
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
/**
* 矩阵表单组件列定义
*
* @author top auto create
* @since 1.0, null
*/
public static class ComponentMatrixDefVo extends TaobaoObject {
private static final long serialVersionUID = 6812847768651464325L;
/**
* 别名
*/
@ApiField("alias")
private String alias;
/**
* 主键
*/
@ApiField("key")
private String key;
/**
* 名称
*/
@ApiField("name")
private String name;
public String getAlias() {
return this.alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
/**
* 控件属性
*
* @author top auto create
* @since 1.0, null
*/
public static class ComponentPropVo extends TaobaoObject {
private static final long serialVersionUID = 2152815244951615177L;
/**
* 选项级联属性
*/
@ApiListField("behavior_linkage")
@ApiField("behavior_linkage_vo")
private List<BehaviorLinkageVo> behaviorLinkage;
/**
* 系统别名
*/
@ApiField("biz_alias")
private String bizAlias;
/**
* 矩阵表单组件列定义
*/
@ApiListField("cols")
@ApiField("component_matrix_def_vo")
private List<ComponentMatrixDefVo> cols;
/**
* 控件id
*/
@ApiField("id")
private String id;
/**
* 标签
*/
@ApiField("label")
private String label;
/**
* 带选项的组件的option
*/
@ApiListField("options")
@ApiField("component_prop_option_vo")
private List<ComponentPropOptionVo> options;
/**
* 占位符
*/
@ApiField("placeholder")
private String placeholder;
/**
* 是否必填
*/
@ApiField("required")
private Boolean required;
/**
* 矩阵表单组件行定义
*/
@ApiListField("rows")
@ApiField("component_matrix_def_vo")
private List<ComponentMatrixDefVo> rows;
public List<BehaviorLinkageVo> getBehaviorLinkage() {
return this.behaviorLinkage;
}
public void setBehaviorLinkage(List<BehaviorLinkageVo> behaviorLinkage) {
this.behaviorLinkage = behaviorLinkage;
}
public String getBizAlias() {
return this.bizAlias;
}
public void setBizAlias(String bizAlias) {
this.bizAlias = bizAlias;
}
public List<ComponentMatrixDefVo> getCols() {
return this.cols;
}
public void setCols(List<ComponentMatrixDefVo> cols) {
this.cols = cols;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public List<ComponentPropOptionVo> getOptions() {
return this.options;
}
public void setOptions(List<ComponentPropOptionVo> options) {
this.options = options;
}
public String getPlaceholder() {
return this.placeholder;
}
public void setPlaceholder(String placeholder) {
this.placeholder = placeholder;
}
public Boolean getRequired() {
return this.required;
}
public void setRequired(Boolean required) {
this.required = required;
}
public List<ComponentMatrixDefVo> getRows() {
return this.rows;
}
public void setRows(List<ComponentMatrixDefVo> rows) {
this.rows = rows;
}
}
/**
* 控件数组
*
* @author top auto create
* @since 1.0, null
*/
public static class FormComponentVo extends TaobaoObject {
private static final long serialVersionUID = 8414286569363991387L;
/**
* 控件名称
*/
@ApiField("component_name")
private String componentName;
/**
* 控件属性
*/
@ApiField("props")
private ComponentPropVo props;
public String getComponentName() {
return this.componentName;
}
public void setComponentName(String componentName) {
this.componentName = componentName;
}
public ComponentPropVo getProps() {
return this.props;
}
public void setProps(ComponentPropVo props) {
this.props = props;
}
}
/**
* 控件对象
*
* @author top auto create
* @since 1.0, null
*/
public static class FormContentVo extends TaobaoObject {
private static final long serialVersionUID = 1674594237766334812L;
/**
* 控件数组
*/
@ApiListField("items")
@ApiField("form_component_vo")
private List<FormComponentVo> items;
public List<FormComponentVo> getItems() {
return this.items;
}
public void setItems(List<FormComponentVo> items) {
this.items = items;
}
}
/**
* 根请求
*
* @author top auto create
* @since 1.0, null
*/
public static class SaveFormSchemaRequest extends TaobaoObject {
private static final long serialVersionUID = 8186768244627224169L;
/**
* 控件字符串
*/
@ApiField("content")
private String content;
/**
* 表单设置
*/
@ApiField("custom_setting")
private FormSchemaSettingVo customSetting;
/**
* 控件对象
*/
@ApiField("form_content")
private FormContentVo formContent;
/**
* 图标
*/
@ApiField("icon")
private String icon;
/**
* 提示
*/
@ApiField("memo")
private String memo;
/**
* 表单名称
*/
@ApiField("name")
private String name;
/**
* 可见范围
*/
@ApiListField("process_visible_list")
@ApiField("process_visible_value_vo")
private List<ProcessVisibleValueVo> processVisibleList;
/**
* 用户id
*/
@ApiField("userid")
private String userid;
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public FormSchemaSettingVo getCustomSetting() {
return this.customSetting;
}
public void setCustomSetting(FormSchemaSettingVo customSetting) {
this.customSetting = customSetting;
}
public FormContentVo getFormContent() {
return this.formContent;
}
public void setFormContent(FormContentVo formContent) {
this.formContent = formContent;
}
public String getIcon() {
return this.icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getMemo() {
return this.memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public List<ProcessVisibleValueVo> getProcessVisibleList() {
return this.processVisibleList;
}
public void setProcessVisibleList(List<ProcessVisibleValueVo> processVisibleList) {
this.processVisibleList = processVisibleList;
}
public String getUserid() {
return this.userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
} | [
"[email protected]"
] | |
0b5c5f861ecdbf2d4b35a7bfbdb26c3e99fdea2f | 649c83001e8cd79706695b89ad0d0991d39f621c | /executor/src/main/java/de/uniba/dsg/serverless/profiling/load/Mixed.java | a2d45f3eee08cea9f3d3677c225a0634d6fbfb28 | [] | no_license | martin-endress/profiling-cloud-functions | a5f3482bc088354f496e541c1cf6a6df53014e0f | ddd874379a4ebcb2acc277d15ad0353e6a04503d | refs/heads/master | 2022-06-28T22:51:34.202947 | 2022-06-18T00:18:54 | 2022-06-18T00:18:54 | 188,238,191 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,334 | java | package de.uniba.dsg.serverless.profiling.load;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.google.common.util.concurrent.Uninterruptibles;
import de.uniba.dsg.serverless.profiling.executor.ProfilingException;
import org.glassfish.jersey.client.ClientConfig;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class Mixed implements RequestHandler<LoadInput, LoadResponse> {
private Optional<CPULoad> cpuLoad;
private Optional<CPULoadFibonacci> cpuLoadFibonacci;
private Optional<MemoryLoad> memoryLoad;
private Optional<IOLoad> ioLoad;
private long loadTime;
@Override
public LoadResponse handleRequest(LoadInput input, Context context) {
long startTime = System.currentTimeMillis();
cpuLoadFibonacci = Optional.of(new CPULoadFibonacci(input.load));
simulateLoad();
LoadResponse response = new LoadResponse();
response.setResponse(System.currentTimeMillis() - startTime);
return response;
}
public Mixed() throws ProfilingException {
loadTime = getLoadTime();
cpuLoad = getCpuLoad();
cpuLoadFibonacci = getCpuLoadFibonacci();
memoryLoad = getMemoryLoad();
ioLoad = getIoLoad();
}
private long getLoadTime() {
String loadTime = System.getenv("LOAD_TIME");
if (loadTime != null) {
try {
return Long.parseLong(loadTime);
} catch (NumberFormatException e) {
return 0L;
}
}
return 0L;
}
public void simulateLoad() {
ExecutorService service = Executors.newFixedThreadPool(4);
cpuLoad.ifPresent(service::submit);
cpuLoadFibonacci.ifPresent(service::submit);
memoryLoad.ifPresent(service::submit);
ioLoad.ifPresent(service::submit);
if (cpuLoad.isPresent() || memoryLoad.isPresent() || ioLoad.isPresent()) {
Uninterruptibles.sleepUninterruptibly(loadTime, TimeUnit.MILLISECONDS);
}
shutdownAndAwaitTermination(service);
}
private void shutdownAndAwaitTermination(ExecutorService pool) {
pool.shutdown();
try {
if (!pool.awaitTermination(10, TimeUnit.MINUTES)) {
pool.shutdownNow();
if (!pool.awaitTermination(1, TimeUnit.MINUTES)) {
System.err.println("Pool did not terminate");
}
}
} catch (InterruptedException ie) {
pool.shutdownNow();
}
}
private Optional<CPULoad> getCpuLoad() {
try {
double cpuFrom = Double.valueOf(System.getenv("CPU_FROM"));
double cpuTo = Double.valueOf(System.getenv("CPU_TO"));
return Optional.of(new CPULoad(cpuFrom, cpuTo, loadTime));
} catch (NullPointerException | NumberFormatException e) {
return Optional.empty();
}
}
private Optional<CPULoadFibonacci> getCpuLoadFibonacci() {
try {
int fibonacci = Integer.valueOf(System.getenv("CPU_FIBONACCI"));
return Optional.of(new CPULoadFibonacci(fibonacci));
} catch (NullPointerException | NumberFormatException e) {
return Optional.empty();
}
}
private Optional<MemoryLoad> getMemoryLoad() {
try {
long memoryTo = Long.valueOf(System.getenv("MEMORY_TO"));
return Optional.of(new MemoryLoad(memoryTo, loadTime));
} catch (NullPointerException | NumberFormatException e) {
return Optional.empty();
}
}
private Optional<IOLoad> getIoLoad() throws ProfilingException {
try {
int ioFrom = Integer.valueOf(System.getenv("IO_FROM"));
int ioTo = Integer.valueOf(System.getenv("IO_TO"));
int ioSize = Integer.valueOf(System.getenv("IO_SIZE"));
return Optional.of(new IOLoad(ioFrom, ioTo, ioSize, loadTime));
} catch (NullPointerException | NumberFormatException e) {
return Optional.empty();
}
}
}
| [
"[email protected]"
] | |
341df447eb6611b4ae40f65396a38f0893eeb27e | e87893d1d74351776c49cde0c8e5746a0c5e2099 | /java014_03_FurKids/src/main/java/_02_ShoppingSystem/ShoppingCart/controller/AbortServlet.java | c5ec7603059196c92ee3333b60167f1e6f568d33 | [] | no_license | yichen07/Java014-03-Furkids | f756aacb07ad8a28368a61b2461d7d419ee498a9 | 179890a6ceca0d0f61c5ddc26cdd6fdb21d1cac4 | refs/heads/master | 2022-12-28T23:30:34.306820 | 2020-10-17T10:16:21 | 2020-10-17T10:16:21 | 287,675,198 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,106 | java | package _02_ShoppingSystem.ShoppingCart.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import _02_ShoppingSystem.ShoppingCart.model.ShoppingCart;
// 當進行『結帳』時,如果按下『放棄購物』超連結,瀏覽器會要求此程式
@WebServlet("/_04_ShoppingCart/abort.do")
public class AbortServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession();
ShoppingCart cart = (ShoppingCart)session.getAttribute("ShoppingCart");
if (cart != null) {
//由session物件中移除ShoppingCart物件
session.removeAttribute("ShoppingCart");
}
response.sendRedirect(response.encodeRedirectURL ("../index.jsp"));
return;
}
}
| [
"[email protected]"
] | |
f56ddec109c539380b9782c304b72ff9ac357c73 | 8ea26be55c80a3909eb372b6946206b94da27488 | /src/main/java/com/example/message/ActiveMqUtil.java | 5331eac4b0b3d58beaab7a46fd169ff4828bc8af | [] | no_license | nanshen1987/spring-boot-demo | 729dd35c2e022006731a8e2a33e378e6d5d34c6a | d9793d1b22722f9fa713ed00c842510fd1d7637a | refs/heads/master | 2021-01-19T21:36:33.811751 | 2017-04-19T15:37:22 | 2017-04-19T15:37:22 | 88,675,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,283 | java | package com.example.message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Component;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.Session;
import java.util.Random;
import java.util.UUID;
/**
* Created by sn on 2017-4-16.
*/
@Component
public class ActiveMqUtil {
private final JmsTemplate jmsTemplate;
@Autowired
public ActiveMqUtil(JmsTemplate jmsTemplate)
{
this.jmsTemplate=jmsTemplate;
}
public void sendMsgQueue()
{
jmsTemplate.send("testAmq",new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
return session.createTextMessage("send:"+ UUID.randomUUID());
}
});
}
public void sendMsgTopic()
{
jmsTemplate.send("testAmqTopic",new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
return session.createTextMessage("send:"+ UUID.randomUUID());
}
});
}
}
| [
"[email protected]"
] | |
543380eac23473b459e34ab0abc4ea98c77420b8 | 614760f25d3e1fd87fab1bea0dcd71629e7aefcd | /CCchapter1/five.java | 01238442b92bc4f323459c34fd141c26a074ddbe | [] | no_license | saybia1993/CrackingCode | d32a109e4bc7fe3af7ca31a90a23c07d28d32274 | 48f75bfad3c5cd0769ea0ce0bc4768af6b36987c | refs/heads/master | 2021-01-22T21:06:59.226829 | 2013-02-01T21:33:16 | 2013-02-01T21:33:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java |
// replace all the spaces in a string with '%20'
public class five {
public static void main(String[] args){
// null
}
/**
* create a new array to store the new string
*/
public static String replaceBlank (String str){
char[] stringToChar = str.toCharArray(); // convert from string to char[]
int space = 0;
for (int i=0; i<stringToChar.length; i++){
if (stringToChar[i] == ' ') space +=1; // count space
}
int lengthOfNew = stringToChar.length + space*2; // length for store the new array
char[] newArray = new char[lengthOfNew]; // create a new array
int j=0; // j is the index of new array
String s = ""; // need to return s
for(int i=0; i<stringToChar.length; i++){
if (stringToChar[i] == ' ') {
newArray[j] = '%';
newArray[j+1] = '2';
newArray[j+2] = '0';
j += 3;
}
else {
newArray[j] = stringToChar[i];
j += 1;
}
}
for(int i=0; i<lengthOfNew; i++){
String temp = String.valueOf(newArray[i]);
s = s + temp; //return string
}
return s; // return
}
}
| [
"[email protected]"
] | |
6161d1115ff999b92f743fb8e89a4150fddfc971 | 2ad86169ade8dd031fe7fd344efed9436711f1fe | /app/src/main/java/com/abhiandroid/quizgameapp/fragments/LoginDialogfragment.java | 5b4489ca98d2e65d3a367c3ca4c262b0f24397fd | [] | no_license | ratthakarn/QuizAppcode01 | b17fbd698f59d74370d50cc8e437f3755365aaaa | 69128a363fa50ca5e5c898d3c76a0e03c2a6e28a | refs/heads/master | 2020-05-18T08:01:57.080036 | 2019-04-30T14:59:06 | 2019-04-30T14:59:06 | 184,282,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,106 | java | package com.abhiandroid.quizgameapp.fragments;
import android.app.Activity;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;
import com.abhiandroid.quizgameapp.R;
import com.abhiandroid.quizgameapp.activity.QuizActivity;
import com.abhiandroid.quizgameapp.activity.StartQuizActivity;
import com.abhiandroid.quizgameapp.constant.GlobalConstant;
import com.abhiandroid.quizgameapp.databinding.FragmentLoginDialogBinding;
import com.abhiandroid.quizgameapp.interfaces.OnLoginCallbackListener;
import com.abhiandroid.quizgameapp.model.User;
import com.abhiandroid.quizgameapp.quiz_preferences.SharedPreferences;
import com.abhiandroid.quizgameapp.retrofit_libs.APIClient;
import com.abhiandroid.quizgameapp.retrofit_libs.APIInterface;
import com.abhiandroid.quizgameapp.utils.AppLog;
import com.facebook.AccessToken;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.login.LoginManager;
import com.facebook.login.LoginResult;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.tasks.Task;
import com.google.gson.JsonObject;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Arrays;
import java.util.Set;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Developed by AbhiAndroid.com
*/
public class LoginDialogfragment extends DialogFragment {
private View view;
private static Context mContext;
private static Activity mActivity;
private APIInterface apiInterface;
private static OnLoginCallbackListener onLogincallbackDialogListener;
String mesage;
FragmentLoginDialogBinding mBinding;
private CallbackManager callbackManager;
private static final String EMAIL = "email";
private static final String PUBLIC_PROFILE = "public_profile";
private GoogleSignInClient mGoogleSignInClient;
private final int RC_SIGN_IN=101;
private boolean isLoggedin=false;
static boolean fromHomeActivity=false;
private final int GOOGLE_LOGIN_CANECLED=13;
private final int GOOGLE_LOGIN_FAILURE=7;
Set<String> deniedPermissions;
public static LoginDialogfragment getInstance(Context context,Activity activity, OnLoginCallbackListener mListener){
mActivity=activity;
mContext=context;
onLogincallbackDialogListener=mListener;
fromHomeActivity=false;
return new LoginDialogfragment();
}
public static LoginDialogfragment getInstance(boolean controll_from,Context context,Activity activity, OnLoginCallbackListener mListener){
mActivity=activity;
mContext=context;
onLogincallbackDialogListener=mListener;
fromHomeActivity=controll_from;
return new LoginDialogfragment();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// mContext=getContext();
//mActivity=getActivity();
apiInterface = APIClient.getClient().create(APIInterface.class);
callbackManager = CallbackManager.Factory.create();
apiInterface = APIClient.getClient().create(APIInterface.class);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
mBinding= DataBindingUtil.inflate(inflater,R.layout.fragment_login_dialog, container, false);
view= mBinding.getRoot();
mBinding.whatWantToCheck.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.shaking_anim));
mesage=getArguments().getString("message");
mBinding.loginForWhat.setText(mesage);
mBinding.back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
onLogincallbackDialogListener.OnCancel();
}
});
mBinding.tvFbLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
fbLogin();
}
});
init_GLogin();
return view;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// setStyle(R.style.popup_window_animation,getTheme());
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
}
}
@Override
public void onActivityCreated(Bundle arg0) {
super.onActivityCreated(arg0);
getDialog().getWindow()
.getAttributes().windowAnimations = R.style.popup_window_animation;
}
/**
* Initialize Google login
*/
private void init_GLogin() {
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(mActivity, gso);
GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(mContext);
// updateUI(account);
/* SignInButton signInButton = findViewById(R.id.sign_in_button);
signInButton.setSize(SignInButton.SIZE_STANDARD);*/
mBinding.tvGoogleLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, RC_SIGN_IN);
}
});
}
private void showMailRequiredMessage() {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(R.string.email_mandatory)
.setPositiveButton("Ok!Got it", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// FIRE ZE MISSILES!
dialog.dismiss();
}
});
builder.create().show();
}
/**
* Initialize facebook login
*
*/
public void fbLogin()
{
LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList(EMAIL,PUBLIC_PROFILE));
// LoginManager.getInstance().logInWithPublishPermissions(this, Arrays.asList("publish_actions"));
LoginManager.getInstance().registerCallback(callbackManager,
new FacebookCallback<LoginResult>()
{
@Override
public void onSuccess(LoginResult loginResult)
{
AppLog.getInstance().printLog(mContext,"Login success");
deniedPermissions= AccessToken.getCurrentAccessToken().getDeclinedPermissions();
if (deniedPermissions.contains(EMAIL)) {
showEmailMandatoryPopop();
}
deniedPermissions=null;
GraphRequest request = GraphRequest.newMeRequest(
loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
Log.v("LoginActivity", response.toString());
// Application code
try {
String email = object.getString("email");
String name = object.getString("name");
// String profilePicUrl = object.getJSONObject("picture").getJSONObject("data").getString("url");
String id = object.getString("id");
String image_url = "https://graph.facebook.com/" + id + "/picture?type=large";
AppLog.getInstance().printLog(mContext,"context:::"+email);
if(!(email==null||email.isEmpty()))
makeLoginReq(name,email,image_url,id, GlobalConstant.getInstance().LOGIN_TYPE_FACEBOOK);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email,gender,birthday");
request.setParameters(parameters);
request.executeAsync();
}
@Override
public void onCancel()
{
// App code
AppLog.getInstance().printToast(mContext,"login cancelled::");
deniedPermissions= AccessToken.getCurrentAccessToken().getDeclinedPermissions();
if (deniedPermissions.contains(EMAIL)) {
AppLog.getInstance().printToast(mContext,"Without your email we're not able to create your account.");
deniedPermissions=null;
}else{
AppLog.getInstance().printToast(mContext,"Login Cancelled");
}
}
@Override
public void onError(FacebookException exception)
{
// App code
AppLog.getInstance().printToast(mContext,getResources().getString(R.string.internet_error));
if(exception.toString().equalsIgnoreCase("User logged in as different Facebook user."))
AppLog.getInstance().printToast(mContext,"Something went wrong with facebook login.Please try google login.");
else
AppLog.getInstance().printToast(mContext,getResources().getString(R.string.internet_error));
}
});
}
public void showEmailMandatoryPopop(){
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(mActivity);
builder.setMessage(R.string.email_mandatory)
.setPositiveButton("Ok! Got it", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// FIRE ZE MISSILES!
dialog.dismiss();
}
});
builder.create().show();
// Create the AlertDialog object and return it
//return builder.create();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
callbackManager.onActivityResult(requestCode, resultCode, data);
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
// The Task returned from this call is always completed, no need to attach
// a listener.
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(task,result);
}
}
private void handleSignInResult(Task<GoogleSignInAccount> completedTask, GoogleSignInResult result) {
try {
if (result.isSuccess()) {
GoogleSignInAccount acct = completedTask.getResult(ApiException.class);
// Signed in successfully, show authenticated UI.
if (acct != null) {
String personName = acct.getDisplayName();
String personGivenName = acct.getGivenName();
String personFamilyName = acct.getFamilyName();
String personEmail = acct.getEmail();
String personId = acct.getId();
Uri personPhoto = acct.getPhotoUrl();
makeLoginReq(personName,personEmail,personPhoto== null? "":personPhoto.toString() ,personId,GlobalConstant.getInstance().LOGIN_TYPE_GOOGLE);
mGoogleSignInClient.signOut();
}
}else{
Status status = result.getStatus();
int statusCode = status.getStatusCode();
AppLog.getInstance().printLog(mContext,"google login failed");
if (statusCode == GOOGLE_LOGIN_CANECLED) {
AppLog.getInstance().printToast(mContext,"Google Login cancelled");
}
else if (statusCode == GOOGLE_LOGIN_FAILURE) {
AppLog.getInstance().printToast(mContext,getResources().getString(R.string.internet_error));
}
}
// updateUI(account);
} catch (ApiException e) {
// The ApiException status code indicates the detailed failure reason.
// Please refer to the GoogleSignInStatusCodes class reference for more information.
AppLog.getInstance().printToast(mContext,getResources().getString(R.string.internet_error));
//updateUI(null);
}
}
private void makeLoginReq(String name,String email,String profile_img,String social_id,String login_type) {
final Dialog pDialog = new Dialog(mActivity, R.style.NewDialog);
pDialog.setContentView(R.layout.progress_dialog);
pDialog.setTitle("Loading");
pDialog.setCancelable(false);
pDialog.show();
apiInterface = APIClient.getClient().create(APIInterface.class);
/**
Create new user
**/
User user=new User();
User.Credentials credentials=user.new Credentials();
credentials.email = email;
credentials.name = name;
credentials.logintype = login_type;
credentials.social_id = social_id;
credentials.profile_pic = profile_img;
Call<User> call1 = apiInterface.createUser(credentials);
call1.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
isLoggedin=true;
pDialog.dismiss();
User user = response.body();
SharedPreferences.getInstance(mContext).saveLoggedInUser(user.data.name,
user.data.email,
user.data.profile_pic,
user.data.logintype,
user.data.social_id,
user.data.student_id
);
dismiss();
onLogincallbackDialogListener.onSuccess();
}
@Override
public void onFailure(Call<User> call, Throwable t) {
pDialog.dismiss();
call.cancel();
AppLog.getInstance().printToast(mContext,getResources().getString(R.string.internet_not_available));
}
});
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if(!isLoggedin && !fromHomeActivity)
getActivity().onBackPressed();
}
}
/**
* Developed by AbhiAndroid.com
*/ | [
"[email protected]"
] | |
6ebf6c1f1f58ac0914c399c787cc223935a5a34c | fd22b9ff9358d1bec7574c5ea936fe612d77a072 | /src/net/robbytu/bukkit/NoTalk/chatHandler.java | eba2e745574396997e256f4fa93dbd7f6e5a319e | [] | no_license | robbietjuh/NoTalk | de3b2f3192fe44c963e141d5b30a9a338b305a39 | 569d9c5bcc50b5d323b912826ae7a9270e4128df | refs/heads/master | 2021-01-13T02:36:24.618681 | 2012-04-07T23:50:45 | 2012-04-07T23:50:45 | 3,241,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,406 | java | package net.robbytu.bukkit.NoTalk;
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.configuration.MemorySection;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
public class chatHandler implements Listener {
public static NoTalk parentInstance;
public chatHandler(NoTalk instance) {
parentInstance = instance;
}
@EventHandler
public void onPlayerChat(PlayerChatEvent event) {
// Check if the player is allowed to bypass NoTalk regions
if(!event.getPlayer().hasPermission("notalk.bypass")) {
// This try statement will bypass a bug, in which the console gets full of Exceptions because
// the user is trying to talk in a world where NoTalk has never been used before.
try {
Set<String> _regions = ((MemorySection)parentInstance.getConfig().get("region." + event.getPlayer().getWorld().getName())).getKeys(false);
for(String region : _regions) {
// Check if the player is in this region
double player_x = event.getPlayer().getLocation().getX();
double player_y = event.getPlayer().getLocation().getY();
double player_z = event.getPlayer().getLocation().getZ();
double max_x = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".max.x");
double max_y = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".max.y");
double max_z = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".max.z");
double min_x = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".min.x");
double min_y = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".min.y");
double min_z = parentInstance.getConfig().getDouble("region." + event.getPlayer().getWorld().getName() + "." + region + ".min.z");
if(player_x >= min_x && player_x < max_x
&& player_y >= min_y && player_y < max_y
&& player_z >= min_z && player_z < max_z) {
event.getPlayer().sendMessage(ChatColor.RED + "You are not allowed to chat here.");
event.setCancelled(true);
}
}
}
catch(Exception ex) {
// Do nothing, world just does not exist
}
}
}
}
| [
"[email protected]"
] | |
5b7495f0e5bb00b35cc4ab897722da10188c625f | d2244dc530ce05ebc8d8e654c4bcf0dae991e78b | /android_art-xposed-lollipop-mr1/test/401-optimizing-compiler/src/Main.java | 6792f3dd6a73daf1b08d07de4735e9e4b33c5e4f | [
"NCSA",
"Apache-2.0"
] | permissive | java007hf/Dynamicloader | 6fe4b1de14de751247ecd1b9bda499e100f4ec75 | 474427de20057b9c890622bb168810a990591573 | refs/heads/master | 2021-09-05T21:19:30.482850 | 2018-01-31T03:10:39 | 2018-01-31T03:10:39 | 119,626,890 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,803 | java | /*
* Copyright (C) 2014 The Android Open Source Project
*
* 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.
*/
// Note that $opt$ is a marker for the optimizing compiler to ensure
// it does compile the method.
public class Main {
public static void main(String[] args) {
Error error = null;
try {
$opt$TestInvokeStatic();
} catch (Error e) {
error = e;
}
System.out.println(error);
$opt$TestInvokeNew();
int result = $opt$TestInvokeIntParameter(42);
if (result != 42) {
throw new Error("Different value returned: " + result);
}
$opt$TestInvokeObjectParameter(new Object());
Object a = new Object();
Object b = $opt$TestInvokeObjectParameter(a);
if (a != b) {
throw new Error("Different object returned " + a + " " + b);
}
result = $opt$TestInvokeWith2Parameters(10, 9);
if (result != 1) {
throw new Error("Unexpected result: " + result);
}
result = $opt$TestInvokeWith3Parameters(10, 9, 1);
if (result != 0) {
throw new Error("Unexpected result: " + result);
}
result = $opt$TestInvokeWith5Parameters(10000, 1000, 100, 10, 1);
if (result != 8889) {
throw new Error("Unexpected result: " + result);
}
result = $opt$TestInvokeWith7Parameters(100, 6, 5, 4, 3, 2, 1);
if (result != 79) {
throw new Error("Unexpected result: " + result);
}
Main m = new Main();
if (m.$opt$TestThisParameter(m) != m) {
throw new Error("Unexpected value returned");
}
if (m.$opt$TestOtherParameter(new Main()) == m) {
throw new Error("Unexpected value returned");
}
if (m.$opt$TestReturnNewObject(m) == m) {
throw new Error("Unexpected value returned");
}
// Loop enough iterations to hope for a crash if no write barrier
// is emitted.
for (int j = 0; j < 3; j++) {
Main m1 = new Main();
$opt$SetFieldInOldObject(m1);
for (int i = 0; i < 1000; ++i) {
Object o = new byte[1024];
}
}
// Test that we do NPE checks on invokedirect.
Exception exception = null;
try {
invokePrivate();
} catch (NullPointerException e) {
exception = e;
}
if (exception == null) {
throw new Error("Missing NullPointerException");
}
}
public static void invokePrivate() {
Main m = null;
m.privateMethod();
}
private void privateMethod() {
Object o = new Object();
}
static int $opt$TestInvokeIntParameter(int param) {
return param;
}
static Object $opt$TestInvokeObjectParameter(Object a) {
forceGCStaticMethod();
return a;
}
static int $opt$TestInvokeWith2Parameters(int a, int b) {
return a - b;
}
static int $opt$TestInvokeWith3Parameters(int a, int b, int c) {
return a - b - c;
}
static int $opt$TestInvokeWith5Parameters(int a, int b, int c, int d, int e) {
return a - b - c - d - e;
}
static int $opt$TestInvokeWith7Parameters(int a, int b, int c, int d, int e, int f, int g) {
return a - b - c - d - e - f - g;
}
Object $opt$TestThisParameter(Object other) {
forceGCStaticMethod();
return other;
}
Object $opt$TestOtherParameter(Object other) {
forceGCStaticMethod();
return other;
}
Object $opt$TestReturnNewObject(Object other) {
Object o = new Object();
forceGCStaticMethod();
return o;
}
public static void $opt$TestInvokeStatic() {
printStaticMethod();
printStaticMethodWith2Args(1, 2);
printStaticMethodWith5Args(1, 2, 3, 4, 5);
printStaticMethodWith7Args(1, 2, 3, 4, 5, 6, 7);
forceGCStaticMethod();
throwStaticMethod();
}
public static void $opt$TestInvokeNew() {
Object o = new Object();
forceGCStaticMethod();
printStaticMethodWithObjectArg(o);
forceGCStaticMethod();
}
public static void printStaticMethod() {
System.out.println("In static method");
}
public static void printStaticMethodWith2Args(int a, int b) {
System.out.println("In static method with 2 args " + a + " " + b);
}
public static void printStaticMethodWith5Args(int a, int b, int c, int d, int e) {
System.out.println("In static method with 5 args "
+ a + " " + b + " " + c + " " + d + " " + e);
}
public static void printStaticMethodWith7Args(int a, int b, int c, int d, int e, int f, int g) {
System.out.println("In static method with 7 args "
+ a + " " + b + " " + c + " " + d + " " + e + " " + f + " " + g);
}
public static void printStaticMethodWithObjectArg(Object a) {
System.out.println("In static method with object arg " + a.getClass());
}
public static void forceGCStaticMethod() {
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
Runtime.getRuntime().gc();
System.out.println("Forced GC");
}
public static void throwStaticMethod() {
throw new Error("Error");
}
public static void $opt$SetFieldInOldObject(Main m) {
m.o = new Main();
}
Object o;
}
| [
"[email protected]"
] | |
cf5cf819f9199291dc0a322a55bc7107acac016d | 015686fca2b44a94a41b51090fb423d2c6996a9a | /app/src/main/java/com/example/catatankeuangan/MainActivity.java | 90ab7b3da5ea4fb711425678fe0f10a47810ffbd | [] | no_license | Malik-hrj/Catatan-Keuangan | fd4b3dd3fbd0c32e347b82961c84fdf63413cfd3 | adfc7de627ee36677492da24fa4a86a57cc107af | refs/heads/master | 2023-02-11T20:54:23.550471 | 2021-01-06T15:18:32 | 2021-01-06T15:18:32 | 327,350,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,367 | java | package com.example.catatankeuangan;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import com.example.catatankeuangan.database.KeuanganHelper;
import com.example.catatankeuangan.model.Keuangan;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
RecyclerView rvKeuangan;
KeuanganAdapter KeuanganAdapter;
KeuanganHelper KeuanganHelper;
ArrayList<Keuangan> listKeuangan;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
rvKeuangan = findViewById(R.id.rv_keuangan);
rvKeuangan.setLayoutManager(new LinearLayoutManager(this));
rvKeuangan.setHasFixedSize(true);
KeuanganHelper = new KeuanganHelper(this);
KeuanganHelper.open();
listKeuangan = new ArrayList<>();
KeuanganAdapter = new KeuanganAdapter(this);
rvKeuangan.setAdapter(KeuanganAdapter);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
// .setAction("Action", null).show();
Intent intent = new Intent(MainActivity.this, InsertUpdateActivity.class);
startActivityForResult(intent, InsertUpdateActivity.KIRIM_INSERT);
}
});
new LoadDataKeuangan().execute();
}
public class LoadDataKeuangan extends AsyncTask<Void, Void, ArrayList<Keuangan>> {
@Override
protected void onPreExecute() {
super.onPreExecute();
if (listKeuangan.size() > 0) {
listKeuangan.clear();
}
}
@Override
protected ArrayList<Keuangan> doInBackground(Void... voids) {
return KeuanganHelper.readKeuangan();
}
@Override
protected void onPostExecute(ArrayList<Keuangan> keuangans) {
super.onPostExecute(keuangans);
listKeuangan.addAll(keuangans);
KeuanganAdapter.setArrayList(keuangans);
KeuanganAdapter.notifyDataSetChanged();
if (listKeuangan.size() == 0) {
Snackbar.make(findViewById(R.id.content_main), "Belum ada data", Snackbar.LENGTH_SHORT).show();
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == InsertUpdateActivity.KIRIM_INSERT){
if (resultCode == InsertUpdateActivity.TERIMA_INSERT){
String mag = data.getStringExtra(InsertUpdateActivity.KEY_KIRIM_INSERT);
Toast.makeText(this, mag, Toast.LENGTH_SHORT).show();
new LoadDataKeuangan().execute();
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
36debc4881a693a0179b961d4f987bfc69279e3e | b9ddf1202477ff5c0baf5ebb255269b1a76dd71e | /CasDev-Webbshop-Database/src/main/java/se/casdev/database/storage/ProductInterface.java | f9f42f680347c5300734a4f10a14020d081821c0 | [] | no_license | CasDev/WebbShop-One | e352772fc0da9a956319ddb445df9fe9650a0199 | 8ed0c74e67f47693517bd4f56c37c5da3903f82b | refs/heads/master | 2016-09-03T07:05:32.827553 | 2013-04-29T11:09:33 | 2013-04-29T11:09:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package se.casdev.database.storage;
import java.io.File;
import java.util.List;
import se.casdev.product.Product;
public interface ProductInterface {
Product getLatestProduct();
Product getProductFromProductId(String id);
List<Product> getAllProducts();
boolean createProduct(String title, String price, String numberinstock,
String typeinstock, String producttype,
String artist, String categoryid, File filePath, String label,
String release);
boolean updateProductPrice(String price, String id);
boolean updateProductNumberInStock(String inStock, String id);
boolean updateProductTypeInStock(String type, String id);
}
| [
"[email protected]"
] | |
4716082ce8b9b64b6ac7d482089f0ef5bcceec17 | edd0988748f096ea8e6c08201b0c2e146b6dc4d0 | /hello-consumer/src/main/java/pl/mberkan/softwarecraftmanship/awsdemo/HelloConsumerApplication.java | 0a76f60f1bf89afcc31c92d3d757ef0678a22210 | [] | no_license | mberkan/awsdemo | 7e47379124ff365dfb1e57db88c36e8f1e8473ca | 140504dcc6809738f3614dd906cc3542c69c75f1 | refs/heads/master | 2022-09-20T02:50:05.235192 | 2022-08-27T07:51:19 | 2022-08-27T07:51:19 | 116,153,453 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,959 | java | package pl.mberkan.softwarecraftmanship.awsdemo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import java.util.List;
@EnableDiscoveryClient
@EnableFeignClients
@SpringBootApplication
public class HelloConsumerApplication {
public static void main(String[] args) {
System.out.println("HelloConsumerApplication test!");
SpringApplication.run(HelloConsumerApplication.class, args);
}
}
@RestController
class HelloWorldConsumerRestController {
@Autowired
private DiscoveryClient discoveryClient;
@RequestMapping("/")
public String serviceInstancesByApplicationName() {
return "Output from producer: " + this.discoveryClient.getInstances("hello-producer-client")
.stream()
.findFirst()
.map(serviceInstance -> new RestTemplate().getForObject(serviceInstance.getUri().toString(), String.class))
.orElse("No producer found");
}
}
@RestController
class HelloWorldConsumerFeinController {
@Autowired
private HelloClient helloClient;
@RequestMapping("/fein")
public String serviceInstancesByApplicationName() {
return helloClient.hello().getHello();
}
} | [
"[email protected]"
] | |
4ea3539090d3228020350dd9f3d9ebbb7d4c9a36 | 59c07ad9ebf4ffd4947fa84fb9e819fbc0ee3f1a | /gui/servlet/src/msf/event/CorsRequestFilter.java | a7575d9a059b52e2ef1ad429c5812188650e0aa2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | lixiaochun/fabric-controller | 108e8c9327dd1a34ed0caed955f651cd7c4d57d7 | 2b9788ff5e3a95ce1b82c4a80464592effe45e82 | refs/heads/master | 2021-05-20T14:05:54.112371 | 2019-06-27T07:15:39 | 2019-06-27T07:15:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package msf.event;
import java.io.IOException;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.Response;
/**
* CORS(Cross-Origin Resource Sharing)用リクエストフィルタクラス.
*
* @author NTT
*
*/
public class CorsRequestFilter implements ContainerRequestFilter {
/**
* CORS(Cross-Origin Resource Sharing)においてサーバ(FC)にアクセスを許容するアクセス元.
*/
private static final String HTTP_METHOD_OPTIONS = "OPTIONS";
/**
* JAX-RS リクエストフィルタ実装.
* HTTPメソッドがOPTIONSの場合はシナリオ処理せずにHTTP 200 OKを返す.
*/
@Override
public void filter(ContainerRequestContext request) throws IOException {
if (request.getRequest().getMethod().equals(HTTP_METHOD_OPTIONS)) {
request.abortWith(Response.status(Response.Status.OK).build());
}
}
} | [
"[email protected]"
] | |
2272d27800f25df6d98907b31b1798b3854a4956 | be78473c19603d1c39370080c122783e1ca70b6a | /courses/src/main/java/com/courses/CoursesApplication.java | 4780d9525e90678d7f834b5e7ad80d42afae06dd | [] | no_license | leonardogolfeto/springboot-microsservices | adf978607db5a18762c6c66cc048a2a0e1f1d15e | d4b31fef8b1d0580ea422de5693fe10689c9a5c9 | refs/heads/master | 2020-12-24T00:16:47.580624 | 2020-02-02T20:52:05 | 2020-02-02T20:52:05 | 237,320,990 | 0 | 0 | null | 2020-02-02T20:52:07 | 2020-01-30T22:48:40 | Java | UTF-8 | Java | false | false | 528 | java | package com.courses;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
@EntityScan({"com.core.model"})
@EnableJpaRepositories({"com.core.repository"})
public class CoursesApplication {
public static void main(String[] args) {
SpringApplication.run(CoursesApplication.class, args);
}
}
| [
"[email protected]"
] | |
46b1c445e457a5f8a2c1b6b2291ad1afb40f8a91 | 04357c2bd88462208b247f199771f5dfdae3e450 | /app/src/main/java/com/kwmax/up/db/EncourageSentenceOperation.java | 114c0b3005147bfe2accf563f1a80ca6fb6b805c | [] | no_license | kwmax/UP | 86bfe5a204b7729b67d6ed382d2409748289e561 | 06e7d9a629975f7ae990b18a488acf01bbade4ca | refs/heads/master | 2020-08-05T03:49:04.398550 | 2019-10-23T08:38:22 | 2019-10-23T08:38:22 | 212,382,569 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,236 | java | package com.kwmax.up.db;
import android.content.Context;
import com.kwmax.up.model.EncourageSentence;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;
import java.util.List;
/**
* Created by kwmax on 2019/10/8.
*/
public class EncourageSentenceOperation {
/**
* 添加数据至数据库
*
* @param context
* @param EncourageSentence
*/
public static void insertData(Context context, EncourageSentence EncourageSentence) {
DBManager.getDaoSession(context).getEncourageSentenceDao().insert(EncourageSentence);
}
/**
* 将数据实体通过事务添加至数据库
*
* @param context
* @param list
*/
public static void insertData(Context context, List<EncourageSentence> list) {
if (null == list || list.size() <= 0) {
return;
}
DBManager.getDaoSession(context).getEncourageSentenceDao().insertInTx(list);
}
/**
* 添加数据至数据库,如果存在,将原来的数据覆盖
* 内部代码判断了如果存在就update(entity);不存在就insert(entity);
*
* @param context
* @param EncourageSentence
*/
public static void saveData(Context context, EncourageSentence EncourageSentence) {
DBManager.getDaoSession(context).getEncourageSentenceDao().save(EncourageSentence);
}
/**
* 删除数据至数据库
*
* @param context
* @param EncourageSentence 删除具体内容
*/
public static void deleteData(Context context, EncourageSentence EncourageSentence) {
DBManager.getDaoSession(context).getEncourageSentenceDao().delete(EncourageSentence);
}
/**
* 根据id删除数据至数据库
*
* @param context
* @param id 删除具体内容
*/
public static void deleteByKeyData(Context context, long id) {
DBManager.getDaoSession(context).getEncourageSentenceDao().deleteByKey(id);
}
/**
* 删除全部数据
*
* @param context
*/
public static void deleteAllData(Context context) {
DBManager.getDaoSession(context).getEncourageSentenceDao().deleteAll();
}
/**
* 更新数据库
*
* @param context
* @param EncourageSentence
*/
public static void updateData(Context context, EncourageSentence EncourageSentence) {
DBManager.getDaoSession(context).getEncourageSentenceDao().update(EncourageSentence);
}
/**
* 查询所有数据
*
* @param context
* @return
*/
public static List<EncourageSentence> queryAll(Context context) {
QueryBuilder<EncourageSentence> builder = DBManager.getDaoSession(context).getEncourageSentenceDao().queryBuilder();
return builder.build().list();
}
/**
* 带查询条件查询
*
* @param context
* @return
*/
public static List<EncourageSentence> queryWithCondition(Context context, WhereCondition condition) {
QueryBuilder<EncourageSentence> builder = DBManager.getDaoSession(context).getEncourageSentenceDao().queryBuilder().where(condition);
return builder.build().list();
}
}
| [
"[email protected]"
] | |
949146a83b1de1081baf9421bebb42dcf16f771f | ede2d7907d4b1ffcbb0fa25f4e83528df804bc75 | /java0918/src/ex1/FileList.java | 5c0d2a01a5441e327523b5e40c7f904cca3925cc | [] | no_license | jonggyue/gyue | 297dd34e1b2d8e513353cfb7c06dd8d4693bc823 | 1f9d723770b547b6a609cda6a6e785864b21ae89 | refs/heads/master | 2021-01-19T20:19:07.036171 | 2014-11-07T07:46:02 | 2014-11-07T07:46:02 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 7,680 | 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 ex1;
import java.io.File;
/**
*
* @author 1
*/
public class FileList extends javax.swing.JFrame {
/**
* Creates new form FileList
*/
public FileList() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
input = new javax.swing.JTextField();
inputBtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
result = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(255, 102, 102));
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("Path");
input.setText("c://");
input.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputActionPerformed(evt);
}
});
inputBtn.setText("입 력");
inputBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
inputBtnActionPerformed(evt);
}
});
result.setColumns(20);
result.setRows(5);
jScrollPane1.setViewportView(result);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(38, 38, 38)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(input, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(inputBtn)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(inputBtn))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void inputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inputActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_inputActionPerformed
private void inputBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inputBtnActionPerformed
// TODO add your handling code here:
list();
}//GEN-LAST:event_inputBtnActionPerformed
public void list() {
File parentDir = new File(input.getText().trim());
result.setText("");
StringBuffer sb = new StringBuffer();
if (parentDir.isDirectory()) {
File[] files = parentDir.listFiles();
for (File file : files) {
boolean prefix = file.isDirectory();
if (prefix) {
sb.append("디렉토리 : " + file.getName() + "\n");
} else {
sb.append(" 파 일 : " + file.getName() + "\n");
}
result.append(sb.toString());
}
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FileList.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FileList.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FileList.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FileList.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FileList().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField input;
private javax.swing.JButton inputBtn;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea result;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
8bc075998450bc99d7951ed3208c92f4424c852e | 99501afc426faf1794d4b320948059965f6a6942 | /aula05-sistema-academico/src/Aluno.java | ae403858064edd2451973cf6e23e00bca362c19d | [] | no_license | poo-2021-2-da3/lecture-code | 0d7ea12304aae5c2e8f3bbf48c39ef8ee6bcd28d | 47eb1330eb2d1aecea3b554f9558b535e1c1cd7e | refs/heads/main | 2023-06-30T04:05:20.941929 | 2021-07-28T14:07:35 | 2021-07-28T14:07:35 | 369,845,139 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 920 | java | public class Aluno {
private String nome;
private String sobrenome;
private String ra;
public Aluno(String nome, String sobrenome, String ra) {
this.nome = nome;
this.sobrenome = sobrenome;
setRa(ra);
}
public void setRa(String ra) {
if (!ra.matches("\\d+")) {
throw new IllegalArgumentException("RA must be a number");
}
this.ra = ra;
}
public String getRa() {
return this.ra;
}
public void setNome(String nome) {
if (nome.split(" ").length > 1) {
throw new IllegalArgumentException("nome must be a single word");
}
this.nome = nome;
}
public String getNome() {
return this.nome;
}
public void setSobrenome(String sobrenome) {
this.sobrenome = sobrenome;
}
public String getSobrenome() {
return this.sobrenome;
}
}
| [
"[email protected]"
] | |
7f72bde01b80ed9518bf095571c01d0482ab50e9 | 1d3e31f90d059dd15cf66a05e2703159068dc551 | /src/main/java/com/maiya/util/solr/SynchronizedTest.java | 7e98303d8d2f1071932b68b9842c641db47ffda2 | [] | no_license | lubinsu/case | e778cdb1808e681bf8ef80d34fdc4892c4962db1 | f332d54677ebc84298ec7d32c7ff35f3bc3e19f9 | refs/heads/master | 2020-03-23T06:31:03.605153 | 2018-08-13T03:22:37 | 2018-08-13T03:22:37 | 141,213,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,289 | java | package com.maiya.util.solr;
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by lubin 2016/11/23
*/
public class SynchronizedTest {
public SynchronizedTest() {
Thread task1 = new TimerSendTask();
task1.start();
}
public synchronized void sendBatch(String str, int timewait) throws InterruptedException {
System.out.println("sending..." + str);
Thread.sleep(timewait);
System.out.println("end ......" + str);
}
/**
* 定时同步任务
*/
private class TimerSendTask extends Thread {
public void run() {
Timer timer = new Timer();
timer.schedule(new SendTask(), 1000, 1000);
}
}
class SendTask extends TimerTask {
public void run() {
try {
sendBatch("timmer", 1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public void send(String string, int timewait) throws InterruptedException {
sendBatch(string, timewait);
}
public static void main(String[] args) throws InterruptedException {
SynchronizedTest test = new SynchronizedTest();
test.send("hello", 1000);
test.send("hi", 10000);
}
}
| [
"[email protected]"
] | |
6eb42ea6e5348e13c1c13ac0a5b7ab9a9d7debd9 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/85/2168.java | c9989d640de2509d1e9865382ab61cbe7d4a53be | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
char[][] zfc = new char[100][21];
int n;
int i;
int k;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (i = 0;i < n;i++)
{
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
zfc[i] = tempVar2.charAt(0);
}
}
for (i = 0;i < n;i++)
{
if ((zfc[i][0] >= 'A' && zfc[i][0] <= 'Z') || zfc[i][0] >= 'a' && zfc[i][0] <= 'z' || zfc[i][0] == '_')
{
int m = String.valueOf(zfc[i]).length();
int c = 0;
for (k = 1;k < m;k++)
{
if ((zfc[i][k] >= '0' && zfc[i][k] <= '9') || (zfc[i][k] >= 'A' && zfc[i][k] <= 'Z') || (zfc[i][k] >= 'a' && zfc[i][k] <= 'z') || zfc[i][k] == '_')
{
c++;
}
}
if (c == (m - 1))
{
System.out.print("yes\n");
}
else
{
System.out.print("no\n");
}
}
else
{
System.out.print("no\n");
}
}
return 0;
}
}
| [
"[email protected]"
] | |
605eb02d72c9eff28193e49afac8990e065b495e | 29a5bd1600e63dda731dbe2b442df63d0d594baf | /src/main/java/com/example/agricultural2/service/impl/MenuServiceImpl.java | 17d66eb108a01e7824aa53eb928545b14c175945 | [] | no_license | guo1842146668/agricultural2 | 687576185ca8fa4decd903c9a2352b5ae727ab6c | 4aa6120337a5d3c89840a751ef4c3e241e503af9 | refs/heads/master | 2023-01-11T03:23:38.815835 | 2020-11-12T08:00:36 | 2020-11-12T08:00:36 | 303,325,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 832 | java | package com.example.agricultural2.service.impl;
import com.example.agricultural2.entity.Menu;
import com.example.agricultural2.mapper.MenuMapper;
import com.example.agricultural2.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author jobob
* @since 2020-09-10
*/
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
@Resource
private MenuMapper menuMapper;
@Override
public List<Menu> getList() {
return menuMapper.selectList(null);
}
@Override
public List<Menu> getListDept(Integer deptId) {
return menuMapper.getListDept(deptId);
}
}
| [
"[email protected]"
] | |
4802aad3d9e870559f51a004aed6db9ffaaecec5 | 53330fdbf3ef129d8b8bee73a7c27b2da55f7612 | /src/leetcode竞赛/九月/订单系统工作.java | 4f3a7651b57992aad4d0a3feac68e7123aefe153 | [] | no_license | HuYaXing/DataStructures | a96c2c95c54abda75c88579989fb7ad1c4ccf65b | 08e24e4d60ee6d1b8e09c8c172703a169b8365bf | refs/heads/master | 2021-07-21T17:46:20.357646 | 2020-10-10T09:27:53 | 2020-10-10T09:27:53 | 220,730,480 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,545 | java | package leetcode竞赛.九月;
import java.util.*;
/**
* @author :huyaxing
* @date :Created in 2020/9/8 下午7:34
*/
public class 订单系统工作 {
static PriorityQueue<String> res = new PriorityQueue<>(Comparator.naturalOrder());
static List<Boolean> flag = new ArrayList<>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] strs = s.split(" ");
dfs(strs, 0, new ArrayList<>(), false);
int index = 0;
for (String r : res) {
if (flag.get(index)) {
r += "--circular dependence";
}
index++;
System.out.println(r);
}
}
private static void dfs(String[] strs, int index, ArrayList<Character> path, boolean is) {
if (index == strs.length) {
String str = builderString(path, is);
res.add(str);
return;
}
for (int i = 0; i < strs[index].length(); i++) {
if (path.contains(strs[index].charAt(i))) {
is = true;
}
path.add(strs[index].charAt(i));
dfs(strs, index + 1, path, is);
is = false;
path.remove(path.size() - 1);
}
}
public static String builderString(List<Character> path, boolean is) {
StringBuilder sb = new StringBuilder();
for (char c : path) {
sb.append(c);
}
flag.add(is);
return sb.toString();
}
}
| [
"[email protected]"
] | |
7670ad09c06bab7921b15ce4a4a51632caab6630 | ac875c56b92a914cd5ddacaad03bbd4a62e44067 | /Strategy/src/main/java/ua/martynenko/pattern/strategy/sample/Main.java | ba646f3ff63c9cf7d23db1d2c7d2203cb9d746b0 | [] | no_license | martynenko-e/Patterns | 8ccdafcadb3c00ab35ef3f6cd53083b2bbdb8ca7 | 7731b607e3eaa146db343c106816afdac0535007 | refs/heads/master | 2021-01-10T07:16:53.089630 | 2015-10-07T14:15:12 | 2015-10-07T14:15:12 | 43,609,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package ua.martynenko.pattern.strategy.sample;
import java.util.Arrays;
/**
* Created by cleri on 04.10.2015.
*/
public class Main {
public static void main(String[] args) {
Comparator comparator = new ToStringLengthComparator();
BubbleSorter sorter = new BubbleSorter(comparator);
System.out.println(Arrays.toString(sorter.sort(new Integer[] {123, 45, 3, 6, 12345, 456})));
System.out.println(Arrays.toString(sorter.sort(new String[] {"HElle", "GO", "work", "unexpectable", "aproval", "world"})));
System.out.println(Arrays.toString(sorter.sort(new Boolean[] {true, false, true})));
}
}
| [
"[email protected]"
] | |
de345b2f076a15d3f7f67dc7a8e13737d5fb8003 | 9f976b2652408af14a7b136e27b76f426f221e13 | /app/src/main/java/com/example/gymfit/system/conf/recycleview/ListFaqAdapter.java | ec20efe9fc788eea67ebe1a8599a5dbd63f6d9ee | [] | no_license | grgfede/GymFitSMS | cc30fa27f3b17e7f5b8ab348a9cf1865a6ccb2b4 | 09c2551443b432f57b576ba6b4530da010e14569 | refs/heads/master | 2023-02-20T11:08:55.602439 | 2021-01-24T23:01:03 | 2021-01-24T23:01:03 | 301,337,662 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,150 | java | package com.example.gymfit.system.conf.recycleview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.gymfit.R;
import com.google.android.material.textview.MaterialTextView;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
public class ListFaqAdapter extends RecyclerView.Adapter<ListFaqAdapter.MyViewHolder> {
private final List<String[]> faqs;
private final Context context;
private final OnItemClickListener listener;
public ListFaqAdapter(@NonNull final Context context, @NonNull final List<String[]> faqs, @NonNull final OnItemClickListener listener) {
this.faqs = faqs;
this.context = context;
this.listener = listener;
}
public static class MyViewHolder extends RecyclerView.ViewHolder {
private final RelativeLayout row;
private final LinearLayout answerContainer;
private final CircleImageView endIcon;
private final MaterialTextView questionText, answerText;
private String code;
public MyViewHolder(@NonNull final View itemView) {
super(itemView);
this.row = itemView.findViewById(R.id.faq_row);
this.endIcon = itemView.findViewById(R.id.end_icon);
this.answerContainer = itemView.findViewById(R.id.container_answer);
this.questionText = itemView.findViewById(R.id.question);
this.answerText = itemView.findViewById(R.id.answer);
}
public void bind(final int position, @NonNull final String code, @NonNull final OnItemClickListener listener) {
this.code = code;
this.row.setOnClickListener(v -> listener.onItemClick(this, position));
}
@NonNull
public LinearLayout getAnswerContainer() {
return this.answerContainer;
}
@NonNull
public CircleImageView getEndIcon() {
return this.endIcon;
}
@NonNull
public String getCode() {
return this.code;
}
}
@NonNull
@Override
public ListFaqAdapter.MyViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType) {
final LayoutInflater inflater = LayoutInflater.from(this.context);
final View view = inflater.inflate(R.layout.layout_recycleview_faq, parent, false);
return new ListFaqAdapter.MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final ListFaqAdapter.MyViewHolder holder, final int position) {
holder.bind(position, this.faqs.get(position)[2], this.listener);
final String question = this.faqs.get(position)[0];
holder.questionText.setText(question);
final String answer = this.faqs.get(position)[1];
holder.answerText.setText(answer);
}
@Override
public int getItemCount() {
return this.faqs.size();
}
}
| [
"[email protected]"
] | |
7fa786f840f3ca1bdd15d3caa073c67aaa4dfc5e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/13/13_dcc8afd0e6528258d8be3608b952e19a32acf8fc/EntityAIOwnerHurtByTarget/13_dcc8afd0e6528258d8be3608b952e19a32acf8fc_EntityAIOwnerHurtByTarget_s.java | 8670d59c496d6412edef7e63f0afc0654a1d99a5 | [] | 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,655 | java | /*
* This file is part of MyPet
*
* Copyright (C) 2011-2013 Keyle
* MyPet is licensed under the GNU Lesser General Public License.
*
* MyPet 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 3 of the License, or
* (at your option) any later version.
*
* MyPet 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.Keyle.MyPet.entity.ai.target;
import de.Keyle.MyPet.entity.types.EntityMyPet;
import de.Keyle.MyPet.entity.types.MyPet;
import de.Keyle.MyPet.skill.skills.implementation.Behavior;
import de.Keyle.MyPet.skill.skills.implementation.Behavior.BehaviorState;
import de.Keyle.MyPet.util.MyPetPvP;
import net.minecraft.server.v1_5_R2.EntityLiving;
import net.minecraft.server.v1_5_R2.EntityPlayer;
import net.minecraft.server.v1_5_R2.EntityTameableAnimal;
import net.minecraft.server.v1_5_R2.PathfinderGoal;
import org.bukkit.entity.Player;
public class EntityAIOwnerHurtByTarget extends PathfinderGoal
{
private EntityMyPet petEntity;
private EntityLiving lastDamager;
private MyPet myPet;
public EntityAIOwnerHurtByTarget(EntityMyPet entityMyPet)
{
this.petEntity = entityMyPet;
myPet = entityMyPet.getMyPet();
}
public boolean a()
{
if (!petEntity.canMove())
{
return false;
}
EntityLiving localEntityLiving = this.petEntity.getOwner();
if (localEntityLiving == null)
{
return false;
}
this.lastDamager = localEntityLiving.aF();
if (this.lastDamager == null || !lastDamager.isAlive())
{
return false;
}
if (lastDamager instanceof EntityPlayer)
{
Player targetPlayer = (Player) lastDamager.getBukkitEntity();
if (!MyPetPvP.canHurt(myPet.getOwner().getPlayer(), targetPlayer))
{
return false;
}
}
else if (lastDamager instanceof EntityMyPet)
{
MyPet targetMyPet = ((EntityMyPet) lastDamager).getMyPet();
if (!MyPetPvP.canHurt(myPet.getOwner().getPlayer(), targetMyPet.getOwner().getPlayer()))
{
return false;
}
}
else if (lastDamager instanceof EntityTameableAnimal)
{
EntityTameableAnimal tameable = (EntityTameableAnimal) lastDamager;
if (tameable.isTamed() && tameable.getOwner() != null)
{
Player tameableOwner = (Player) tameable.getOwner().getBukkitEntity();
if (myPet.getOwner().equals(tameableOwner))
{
return false;
}
}
}
if (myPet.getSkills().isSkillActive("Behavior"))
{
Behavior behaviorSkill = (Behavior) myPet.getSkills().getSkill("Behavior");
if (behaviorSkill.getBehavior() == Behavior.BehaviorState.Friendly)
{
return false;
}
if (behaviorSkill.getBehavior() == BehaviorState.Raid)
{
if (lastDamager instanceof EntityTameableAnimal && ((EntityTameableAnimal) lastDamager).isTamed())
{
return false;
}
if (lastDamager instanceof EntityMyPet)
{
return false;
}
if (lastDamager instanceof EntityPlayer)
{
return false;
}
}
}
return true;
}
public boolean b()
{
EntityLiving entityliving = petEntity.getGoalTarget();
if (!petEntity.canMove())
{
return false;
}
else if (entityliving == null)
{
return false;
}
else if (!entityliving.isAlive())
{
return false;
}
return true;
}
public void c()
{
petEntity.setGoalTarget(this.lastDamager);
}
public void d()
{
petEntity.setGoalTarget(null);
}
}
| [
"[email protected]"
] | |
c605273841bb3c3a19032ae10d4d6de5d8fe034c | 7f4ce761606d294e7c7e88ba451111ed58719455 | /app/src/main/java/ibm/imfras_baithul_mal/LoginActivity.java | 67c861ea99b4601776fc718bbeea1b6b4aa7c0bc | [] | no_license | mdzubair89/Ibm | 2f244ffc36b6cecc669fbbc28ef65438fb8fc105 | cb6d12731d930efe3849fab469fa67ad1f0c14a8 | refs/heads/master | 2021-08-11T09:04:49.199904 | 2018-05-21T09:27:50 | 2018-05-21T09:27:50 | 103,988,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,968 | java | package ibm.imfras_baithul_mal;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
private Button buttonSignIn;
private EditText editTextEmail;
private EditText editTextPassword;
private TextView textViewSignup;
private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
progressDialog = new ProgressDialog(this);
firebaseAuth = FirebaseAuth.getInstance();
if(firebaseAuth.getCurrentUser() != null)
{
//profile activity here
finish();
startActivity(new Intent(getApplicationContext(),ProfileActivity.class));
}
buttonSignIn = (Button) findViewById(R.id.buttonSignin);
editTextEmail = (EditText) findViewById(R.id.editTextEmail);
editTextPassword = (EditText) findViewById(R.id.editTextPassword);
textViewSignup = (TextView) findViewById(R.id.textViewSignUp);
buttonSignIn.setOnClickListener(this);
textViewSignup.setOnClickListener(this);
}
private void userLogin()
{
String email = editTextEmail.getText().toString().trim();
String password = editTextPassword.getText().toString().trim();
if(TextUtils.isEmpty(email))
{
//email is empty
Toast.makeText(this,"Please enter email",Toast.LENGTH_SHORT).show();
//stopping function execution
return;
}
if(TextUtils.isEmpty(password))
{
//password is empty
Toast.makeText(this,"Please enter password",Toast.LENGTH_SHORT).show();
//stopping function execution
return;
}
progressDialog.setMessage("Login in progress...");
progressDialog.show();
firebaseAuth.signInWithEmailAndPassword(email,password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressDialog.dismiss();
if(task.isSuccessful())
{
//start profile activity
finish();
startActivity(new Intent(getApplicationContext(),ProfileActivity.class));
}
else{
try {
throw task.getException();
} catch(Exception e) {
showToast("Error : " + e.getLocalizedMessage());
}
}
}
});
}
@Override
public void onClick(View view) {
if(view == buttonSignIn)
{
userLogin();
}
if(view == textViewSignup)
{
//will open user registration activity
finish();
startActivity(new Intent(this,MainActivity.class));
}
}
private void showToast(String message) {
Toast.makeText(this,message,Toast.LENGTH_LONG).show();
}
}
| [
"[email protected]"
] | |
972737408dd53bf7930c476ba55dd1e9ba779b80 | 39c992a03ef9795e2f8fcdcd72e47e9008011db0 | /common/common-lib/src/main/java/app/validation/MaxValueValidator.java | bf9ca2ac86f52b7e1ef615fa1c0e4dcaf9d306ec | [] | no_license | stevenzearo/iblog | 946bf68cb80cb09afdf93bf559f4c7bb46cb0d9a | b3e38436ae688c72844ec2dc87de09df65b8364a | refs/heads/master | 2023-04-15T23:25:09.793235 | 2023-04-11T16:38:11 | 2023-04-11T16:38:11 | 247,906,650 | 0 | 0 | null | 2021-01-06T09:59:31 | 2020-03-17T07:33:41 | Java | UTF-8 | Java | false | false | 945 | java | package app.validation;
import app.validation.annotation.Max;
import app.web.error.ValidationException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Set;
/**
* @author steve
*/
public class MaxValueValidator extends AbstractValidator {
private static final Class<? extends Annotation> MAX_CLASS = Max.class;
private static final Set<Class<?>> VALID_CLASSES = Set.of(Integer.class, Long.class, Double.class, Float.class);
public MaxValueValidator() {
super(MAX_CLASS, VALID_CLASSES);
}
@Override
protected void validateFieldValue(Field field, Object fieldValue) throws Exception {
double d = Double.parseDouble(fieldValue.toString());
Max minAnnotation = field.getDeclaredAnnotation(Max.class);
if (d > minAnnotation.value())
throw new ValidationException(String.format(minAnnotation.msg(), d, minAnnotation.value()));
}
}
| [
"[email protected]"
] | |
29bde5828401037e3fc7504b939c05e00c394f64 | f009dc33f9624aac592cb66c71a461270f932ffa | /src/main/java/com/alipay/api/response/AlipayOpenPublicPartnerMenuQueryResponse.java | 4ce8e3ffe6b0b000833d9515a686d0de2c2dfd48 | [
"Apache-2.0"
] | permissive | 1093445609/alipay-sdk-java-all | d685f635af9ac587bb8288def54d94e399412542 | 6bb77665389ba27f47d71cb7fa747109fe713f04 | refs/heads/master | 2021-04-02T16:49:18.593902 | 2020-03-06T03:04:53 | 2020-03-06T03:04:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.public.partner.menu.query response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class AlipayOpenPublicPartnerMenuQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 6155576134571952677L;
/**
* 服务窗菜单
*/
@ApiField("public_menu")
private String publicMenu;
public void setPublicMenu(String publicMenu) {
this.publicMenu = publicMenu;
}
public String getPublicMenu( ) {
return this.publicMenu;
}
}
| [
"[email protected]"
] | |
72fa71472afd85a9e5268ec6a7f033dc7082e1ae | cc671d6cc5765514f8716e97859dfc11358d2ce5 | /src/test/java/org/synyx/urlaubsverwaltung/core/period/PeriodTest.java | 03edc8ab1a9c2dac0f0b78f79a7aa20757cbf46e | [
"Apache-2.0"
] | permissive | Intera/urlaubsverwaltung | 0feb969dc6b223fedc5cbf265e5039111b5f8b44 | 87faa5c950029f9698420835a5b8c22933074fd5 | refs/heads/master | 2021-08-18T01:14:53.481179 | 2019-03-15T12:19:48 | 2019-03-15T12:19:48 | 27,863,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,703 | java | package org.synyx.urlaubsverwaltung.core.period;
import org.joda.time.DateMidnight;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Aljona Murygina - [email protected]
*/
public class PeriodTest {
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsOnNullStartDate() {
new Period(null, DateMidnight.now(), DayLength.FULL);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsOnNullEndDate() {
new Period(DateMidnight.now(), null, DayLength.FULL);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsOnNullDayLength() {
new Period(DateMidnight.now(), DateMidnight.now(), null);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsOnZeroDayLength() {
new Period(DateMidnight.now(), DateMidnight.now(), DayLength.ZERO);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsIfEndDateIsBeforeStartDate() {
DateMidnight startDate = DateMidnight.now();
DateMidnight endDateBeforeStartDate = startDate.minusDays(1);
new Period(startDate, endDateBeforeStartDate, DayLength.FULL);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsIfStartAndEndDateAreNotSameForMorningDayLength() {
DateMidnight startDate = DateMidnight.now();
new Period(startDate, startDate.plusDays(1), DayLength.MORNING);
}
@Test(expected = IllegalArgumentException.class)
public void ensureThrowsIfStartAndEndDateAreNotSameForNoonDayLength() {
DateMidnight startDate = DateMidnight.now();
new Period(startDate, startDate.plusDays(1), DayLength.NOON);
}
@Test
public void ensureCanBeInitializedWithFullDay() {
DateMidnight startDate = DateMidnight.now();
DateMidnight endDate = startDate.plusDays(1);
Period period = new Period(startDate, endDate, DayLength.FULL);
Assert.assertEquals("Wrong start date", startDate, period.getStartDate());
Assert.assertEquals("Wrong end date", endDate, period.getEndDate());
Assert.assertEquals("Wrong day length", DayLength.FULL, period.getDayLength());
}
@Test
public void ensureCanBeInitializedWithHalfDay() {
DateMidnight date = DateMidnight.now();
Period period = new Period(date, date, DayLength.MORNING);
Assert.assertEquals("Wrong start date", date, period.getStartDate());
Assert.assertEquals("Wrong end date", date, period.getEndDate());
Assert.assertEquals("Wrong day length", DayLength.MORNING, period.getDayLength());
}
}
| [
"[email protected]"
] | |
2d435d3644186f3c5445d430b3832ca6f7e80de2 | 351edad0db87c890a4d742fdca385ab057fe00f2 | /athena-framework/athena-core/src/main/java/com/xiongyayun/athena/core/validation/dict/DictValidator.java | b893363f40dbb55d31573a204f75b69820ddb845 | [] | no_license | xiongyayun428/athena | f9feb37f1e2736b681e2b8af3b31e8c18a26419d | 7832f4315057a6058e35b8fdd2e54abfb95c21d3 | refs/heads/master | 2023-04-27T02:31:18.022029 | 2022-01-21T09:48:29 | 2022-01-21T09:48:29 | 129,015,232 | 0 | 0 | null | 2023-04-24T00:07:20 | 2018-04-11T01:19:27 | Java | UTF-8 | Java | false | false | 1,117 | java | package com.xiongyayun.athena.core.validation.dict;
import cn.hutool.extra.spring.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.List;
/**
* DictValidator
*
* @author <a href="mailto:[email protected]">Yayun.Xiong</a>
* @date 2021/4/20
*/
@Slf4j
public class DictValidator implements ConstraintValidator<Dict, String> {
private String[] dictCode;
private DictService dictService;
public DictValidator() {
dictService = SpringUtil.getBean(DictService.class);
}
@Override
public void initialize(Dict constraintAnnotation) {
this.dictCode = constraintAnnotation.value();
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
List<String> values = dictService.queryDictItems(dictCode);
if (ObjectUtils.isEmpty(values) && log.isDebugEnabled()) {
log.debug("字典数据未配置:" + String.join(", ", dictCode));
}
return ObjectUtils.isEmpty(values) ? false : values.contains(value);
}
}
| [
"[email protected]"
] | |
55ebfb5a7650ac9b61efaccf0e86a8ff24e61e55 | ea494d069358d88b661fabfdf10a7add47ebfd91 | /icemung/src/main/java/org/github/xxbld/icemung/base/mvp/BasePresenter.java | 0616eb6fabac8430b06c2af9f4adb06e1158a701 | [] | no_license | xxbld/JxustTravelApp | 1d2dff0bd4332a91083897393a78e23c8cae95b0 | 5e1ecd4da2a424c09ebf93145f733870e6efa20a | refs/heads/master | 2016-09-13T06:43:36.133858 | 2016-04-29T02:36:14 | 2016-04-29T02:36:14 | 57,348,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,232 | java | package org.github.xxbld.icemung.base.mvp;
/**
* Created by xxbld on 2016/3/1
* you can contact me at: [email protected]
*
* @descript :BasePresenter
*/
public class BasePresenter<T extends IMvpView> implements IPresenter<T> {
private T mMvpView;
@Override
public void initialized() {
checkViewAttached();
}
@Override
public void attachView(T mvpView) {
this.mMvpView = mvpView;
}
@Override
public void detachView() {
mMvpView = null;
}
/**
* 是否关联 Mvp View
*
* @return
*/
public boolean isViewAttached() {
return mMvpView == null ? false : true;
}
public T getMvpView() {
return mMvpView;
}
/**
* check viewAttached,if false throw MvpViewNoAttachedException
*/
public void checkViewAttached() {
if (!isViewAttached()) {
throw new MvpViewNoAttachedException();
}
}
public static class MvpViewNoAttachedException extends RuntimeException {
public MvpViewNoAttachedException() {
super("Please call IPresenter.attachView(IMvpView) before" +
" requesting data to the IPresenter");
}
}
}
| [
"[email protected]"
] | |
41e2349f833ac2340b97207dad15897b226ccd29 | cb601c9b503d43d5dea2c54e777ecd115222a16a | /src/org/pepstock/charba/client/dom/BaseElement.java | b05939766cdcc96d1e07a7f3b280217aad5f3362 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"MIT"
] | permissive | pepstock-org/Charba | cdd98c47081cb3cf52a939c8c3489a80fa9451fd | 32e1807325b646918f595b3043e4990dccb112b4 | refs/heads/master | 2023-09-01T11:43:20.143296 | 2023-08-28T19:49:14 | 2023-08-28T19:49:14 | 106,569,586 | 55 | 7 | Apache-2.0 | 2023-08-28T19:37:21 | 2017-10-11T15:03:37 | Java | UTF-8 | Java | false | false | 8,801 | 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.pepstock.charba.client.dom;
import org.pepstock.charba.client.commons.NativeName;
import org.pepstock.charba.client.dom.enums.PointerEventType;
import org.pepstock.charba.client.dom.events.NativePointerEvent;
import org.pepstock.charba.client.dom.events.PointerEventInit;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* Base class from which all element objects (objects that represent elements) in a document inherit.<br>
* It only has methods and properties common to all kinds of elements.
*
* @author Andrea "Stock" Stocchero
*/
@JsType(isNative = true, name = NativeName.DOM_ELEMENT, namespace = JsPackage.GLOBAL)
public abstract class BaseElement extends BaseNode {
/**
* To avoid any instantiation
*/
BaseElement() {
// do nothing
}
/**
* Returns the number of children of this element which are elements.
*
* @return the number of children of this element which are elements
*/
@JsProperty
public final native int getChildElementCount();
/**
* Returns a number representing the inner height of the element.
*
* @return a number representing the inner height of the element
*/
@JsProperty
public final native int getClientHeight();
/**
* Returns a number representing the width of the left border of the element.
*
* @return a number representing the width of the left border of the element
*/
@JsProperty
public final native int getClientLeft();
/**
* Returns a number representing the width of the top border of the element.
*
* @return a number representing the width of the top border of the element
*/
@JsProperty
public final native int getClientTop();
/**
* Returns a number representing the inner width of the element.
*
* @return a number representing the inner width of the element
*/
@JsProperty
public final native int getClientWidth();
/**
* Returns the first node which is both a child of this element and is also an element, or <code>null</code> if there is none.
*
* @return the first node which is both a child of this element and is also an element, or <code>null</code> if there is none
*/
@JsProperty
public final native BaseElement getFirstElementChild();
/**
* Returns the unique id of the element.
*
* @return the unique id of the element
*/
@JsProperty
public final native String getId();
/**
* Sets the unique id of the element.
*
* @param id the unique id of the element
*/
@JsProperty
public final native void setId(String id);
/**
* Returns the markup of the element's content.
*
* @return the markup of the element's content
*/
@JsProperty
public final native String getInnerHTML();
/**
* Sets the markup of the element's content..
*
* @param innerHTML the markup of the element's content
*/
@JsProperty
public final native void setInnerHTML(String innerHTML);
/**
* Returns the serialized HTML fragment describing the element including its descendants.
*
* @return the serialized HTML fragment describing the element including its descendants
*/
@JsProperty
public final native String getOuterHTML();
/**
* Returns the last node which is both a child of this element and is an element, or <code>null</code> if there is none.
*
* @return the last node which is both a child of this element and is an element, or <code>null</code> if there is none
*/
@JsProperty
public final native BaseElement getLastElementChild();
/**
* Returns the element immediately following the given one in the tree, or <code>null</code> if there's no sibling node.
*
* @return the element immediately following the given one in the tree, or <code>null</code> if there's no sibling node
*/
@JsProperty
public final native BaseElement getNextElementSibling();
/**
* Returns the element immediately preceding the given one in the tree, or <code>null</code> if there is no sibling element.
*
* @return the element immediately preceding the given one in the tree, or <code>null</code> if there is no sibling element
*/
@JsProperty
public final native BaseElement getPreviousElementSibling();
/**
* Returns a number representing the scroll view height of an element.
*
* @return a number representing the scroll view height of an element
*/
@JsProperty
public final native int getScrollHeight();
/**
* Returns a number representing the left scroll offset of the element.
*
* @return a number representing the left scroll offset of the element
*/
@JsProperty
public final native double getScrollLeft();
/**
* Returns a number representing number of pixels the top of the document is scrolled vertically.
*
* @return a number representing number of pixels the top of the document is scrolled vertically
*/
@JsProperty
public final native double getScrollTop();
/**
* Returns a number representing the scroll view width of the element.
*
* @return a number representing the scroll view width of the element
*/
@JsProperty
public final native int getScrollWidth();
/**
* Returns the name of the tag for the given element.
*
* @return the name of the tag for the given element
*/
@JsProperty
public final native String getTagName();
/**
* Returns a collection of all attribute nodes registered to the specified node.
*
* @return a collection of all attribute nodes registered to the specified node
*/
@JsProperty
public native NamedNodeMap<BaseAttribute> getAttributes();
/**
* Returns a list containing all descendant elements, of a particular tag name, from the current element.
*
* @param tagname the qualified name to look for. The special string "*" represents all elements.
* @return a list containing all descendant elements
*/
@JsMethod
public final native NodeList<BaseElement> getElementsByTagName(String tagname);
/**
* Removes the element from the children list of its parent.
*/
@JsMethod
public final native void remove();
/**
* Returns a boolean indicating whether the current element has any attributes or not.
*
* @return <code>true</code> whether the current element has any attributes
*/
@JsMethod
public final native boolean hasAttributes();
/**
* It is used to designate a specific element as the capture target of future pointer events.<br>
* Subsequent events for the pointer will be targeted at the capture element until capture is released (via {@link BaseElement#releasePointerCapture(int)} or the
* {@link PointerEventType#POINTER_UP} event is fired).
*
* @param pointerId pointer id, retrievable by {@link NativePointerEvent#getId()} or in {@link PointerEventInit#getId()}
*/
@JsMethod
public final native void setPointerCapture(int pointerId);
/**
* Checks whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID.
*
* @param pointerId pointer id, retrievable by {@link NativePointerEvent#getId()} or in {@link PointerEventInit#getId()}
* @return <code>true</code> whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID
*/
@JsMethod
public final native boolean hasPointerCapture(int pointerId);
/**
* Releases (stops) pointer capture that was previously set for a specific {@link NativePointerEvent}.
*
* @param pointerId pointer id, retrievable by {@link NativePointerEvent#getId()} or in {@link PointerEventInit#getId()}
*/
@JsMethod
public final native void releasePointerCapture(int pointerId);
/**
* Returns a {@link DOMRectangle} object providing information about the size of an element and its position relative to the viewport.
*
* @return a {@link DOMRectangle} object providing information about the size of an element and its position relative to the viewport
*/
@JsMethod
public final native DOMRectangle getBoundingClientRect();
} | [
"[email protected]"
] | |
24ec359491672369fb1d64aa3022007734538f88 | d7ee907df8e066cf07e7c78e34f6d45fbf1737db | /src/main/java/ForTest.java | 6e7b938453be79bc4920c69457bd5b823c1e35eb | [] | no_license | karsv/projectTest | 7aba1dc9ee16a628bf24c325a1859820d1f58d88 | 04613f07bbc762cfb7b04ce4df42d7650f44b81a | refs/heads/master | 2020-09-22T04:03:43.100634 | 2019-11-30T17:51:31 | 2019-11-30T17:51:31 | 225,043,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | public class ForTest {
public static void main(String[] args) {
System.out.println("Test!");
}
}
| [
"[email protected]"
] | |
70a7d2e1dde1812a409a01f7bac0c7921df3ce90 | a4ce8e5b85c924a00f02376a5e0a4dbeb50a39bc | /1342470OOPExam/src/main/java/com/mycompany/oopexam/Wilbur.java | 711567500a99bd37c8a677c01ff694c004d85533 | [] | no_license | 1342470/DennisTextGame | ed44852c63a96a5b651379eb60fa3a522d7e398a | cd4f0f008613335da4c6fe46b9e31530b585a982 | refs/heads/main | 2023-03-29T19:07:41.607820 | 2021-04-08T14:49:16 | 2021-04-08T14:49:16 | 354,138,039 | 0 | 0 | null | 2021-04-08T14:46:30 | 2021-04-02T21:32:11 | Java | UTF-8 | Java | false | false | 2,656 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.oopexam;
/**
*
* @author kylej
*/
public class Wilbur extends Adult implements Person,life {
private int age;
private String gender;
private int strikes;
private String nickname;
private int strength;
private int health;
private String name;
public Wilbur(int age, String gender, int strikes, String nickname, int strength, int health, String name) {
this.age = age;
this.gender = gender;
this.strikes = strikes;
this.nickname = nickname;
this.strength = strength;
this.health = health;
this.name = name;
}
@Override
public int getStrikes() {
return strikes;
}
public int getAge() {
return age;
}
public String getGender() {
return gender;
}
public String getNickname() {
return nickname;
}
public int getStrength() {
return strength;
}
public void setStrength(int strength) {
this.strength = strength;
}
public String getName() {
return name;
}
@Override
public void increaseStrikes() {
this.strikes++;
}
public int decreasehealth(){
return --health;
}
public void specialistMove(Person theTroubleMaker) {
theTroubleMaker.increaseStrikes();
System.out.println(theTroubleMaker.getName() + " your grounded goto your room");
NewMain.goToRoomGrounded();
}
@Override
public void detain(Person theTroubleMaker) {
theTroubleMaker.increaseStrikes();
System.out.println("You have been caught " + theTroubleMaker.getName() + " now has " + theTroubleMaker.getStrikes()+ "strikes ");
}
@Override
public int gethealth() {
return health;
}
@Override
public void caught() {
strikes+=10;
}
@Override
public int increasehelath() {
return this.health++;
}
@Override
public void eat() {
this.health+=10;
System.out.println("Yumm" + this.getName() + "enjoys eating thier food and now has " + this.gethealth() + "heatlh");
}
@Override
public void move() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
| [
"[email protected]"
] | |
d4f542658ad228e767d4666cd1b739551f756c58 | 5f2ca87d3154b7807c0cc4277df55c3aa81a1108 | /p5-web/src/main/java/com/tr/p5/pc/exception/ExceptionController.java | 74e26929cacd9d0d6f9a99b07b147b77c61c4bbd | [] | no_license | Air-TR/Parent-Project5 | b2ce1c938db93560bc93fc33ba12752e2287820c | 9f2c69ec62cbd8c9c1d12f53faf776b8f520f782 | refs/heads/master | 2021-09-28T03:58:35.890547 | 2018-11-14T07:03:13 | 2018-11-14T07:03:13 | 111,515,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 847 | java | package com.tr.p5.pc.exception;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.tr.common.exception.MyException;
import com.tr.common.result.ResultEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 统一异常处理测试
*
* @author taorun
* @date 2017年11月21日 下午3:18:02
*
*/
@Api(tags = "Exception")
@RestController
public class ExceptionController {
@ApiOperation(value = "自定义异常测试")
@GetMapping("/exception/myException")
public void myException() {
throw new MyException(ResultEnum.MY_EXCEPTION_TEST);
}
@ApiOperation(value = "系统异常测试")
@GetMapping("/exception/systemException")
public void systemException() throws Exception {
throw new Exception();
}
}
| [
"[email protected]"
] | |
fd962b3624e4e3f5646e7ee38c0acc4f88f61daa | c90832d18be978bc8b52683ca478e622cec182d3 | /app/src/main/java/com/github/teocci/android/pptopus/model/DeviceInfo.java | 843057861bc304c8458ee1fd3b9df185f74f367d | [] | no_license | teocci/Android-PPTOpus | 0d19e98a6684230530a9b20edc78e8d9966cc83f | cbac0197ff4ccb957b7fc4c1789e6b2a57f5a734 | refs/heads/master | 2020-04-02T21:50:36.557265 | 2018-11-19T07:10:42 | 2018-11-19T07:10:42 | 154,813,034 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.github.teocci.android.pptopus.model;
/**
* Created by teocci.
*
* @author [email protected] on 2017-Jul-17
*/
public class DeviceInfo
{
public final String name;
public final String address;
public int transmission;
public long ping;
public DeviceInfo(String name, String address, int transmission, long ping)
{
this.name = name;
this.address = address;
this.transmission = transmission;
this.ping = ping;
}
@Override
public String toString()
{
return "[DeviceInfo] { name: '" + name +
"', address: " + address +
"', transmission: '" + transmission +
"', ping: '" + ping +
"' }";
}
}
| [
"[email protected]"
] | |
a5c2d1087ed0299ab0fbe5baa08c343788fd3911 | 2f3b1d0e97d248a74315ab4502a9b524b90cc57e | /src/main/java/Catch/wyjatek.java | f5eb92dee5a7657c8e27b08eeffb2074e52e2164 | [] | no_license | xmada666/SDAzajecia | dbf0d12774c89bfeac3a29e595c12ba0904e891c | c49f401815efa329794aaf6ebbc3e7b89e78aaae | refs/heads/master | 2020-09-20T15:07:20.319942 | 2019-11-27T21:10:36 | 2019-11-27T21:10:36 | 224,518,168 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package Catch;
import java.util.InputMismatchException;
import java.util.Scanner;
public class wyjatek{
public static void main (String[] args ){
Scanner wejscie = new Scanner(System.in);
int wprowadzonaWartosc;
System.out.println("Podaj dowolna wartosc typu int");
try {
wprowadzonaWartosc = wejscie.nextInt();
}
catch (InputMismatchException aa) {
System.out.println("Wprowadzona wartosc nie jest typu int\n" + aa);
return;
}
System.out.println("Wprowadzona wartosc to : " + wprowadzonaWartosc);
}} | [
"[email protected]"
] | |
0232f3d0c1df1dd1587da26c35773fa1a7ddf4a1 | ee20656ec6559bd6c7263805ce94fa9abda4c374 | /src/main/java/commands/ShowCommand.java | c445b1b3d7aa7d1fe8e348a2a1372ea689dc0d20 | [] | no_license | 1KarinaV/proga5 | d109db592adbb3633e394ac693139c88b3a7b583 | 2247492453fe0eb7cdf45602656fc9c5c2c0dbe8 | refs/heads/master | 2023-09-03T16:02:02.719738 | 2021-10-25T09:21:28 | 2021-10-25T09:21:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package commands;
import db.Database;
import io.CheckedReader;
import exceptions.CommandException;
import java.io.IOException;
/**
* Команда "show".
* Не имеет аргументов.
* Вывод на экран всех групп.
*/
public class ShowCommand extends AbstractCommand {
/**
* Создание команды "show"
* @param db база данных
*/
public ShowCommand(Database db) {
super("show", "show - вывести в стандартный поток вывода все элементы коллекции в строковом представлении", db);
}
/**
* {@inheritDoc}
*/
@Override
public void execute(CheckedReader reader, String... args) throws IOException {
if (args.length > 0)
throw new CommandException("Ошибка: команда '" + name() + "' не имеет аргументов");
database.show();
}
}
| [
"[email protected]"
] | |
03afb64860a249ecc2efffe879dbcdbde0e4c56c | 315fd5244d46ba8d6478520acfb0f11737c4f91f | /day 2/task2/buildings/validation.java | 0a05030d8a97a97efafaad7db7ae74b441f0e2c4 | [] | no_license | dante66219/Homework | 6a7d1fd95f420d58d1827527e57b2514de4020da | 4079c513a452210de6af5869f8c8f0c97eb0dbef | refs/heads/master | 2022-12-11T19:09:27.679964 | 2020-08-21T21:12:17 | 2020-08-21T21:12:17 | 288,188,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package task2.buildings;
public class validation {
private int residentialCheck;
public validation(int residentialCheck) {
this.residentialCheck = residentialCheck;
}
public boolean isValid () {
if (residentialCheck == 1)
return true;
return false;
}
}
| [
"[email protected]"
] | |
a6cccad47b43e4033b86a48ae98a360f7741ed70 | 14173d1524ea17b22b6a91ac826b064f6a7126d8 | /src/main/java/com/xiang/springboot01/modules/test/entity/Student.java | 1cae9b02f9106ab4df594bfb427601f509312f6b | [] | no_license | xiangxiaoxian/study | dcf3cadfc082dfdc8e5f289446dd7ca7f94e5576 | 21ca421a8fd0aae26148fe74307cdc1fbf10eb51 | refs/heads/master | 2022-12-10T17:33:57.505529 | 2020-09-08T07:43:39 | 2020-09-08T07:43:39 | 286,368,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,320 | java | package com.xiang.springboot01.modules.test.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;
/**
* @Description Student
* @Author HymanHu
* @Date 2020/7/30 13:41
*/
@Entity
@Table(name = "h_student")
public class Student {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int studentId;
private String studentName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime createDate;
/**
* OneToOne:一对一关系中,一方使用 JoinColumn 注解,另一方使用 mappedBy 属性(可选)
* cascade:联级操作
* fetch:加载数据策略
* JoinColumn
* name 对应 h_student 表中 card_id 外键列
* referencedColumnName 对应关联表 Card 中的主键 cardId
* insertable、updatable 标识该属性是否参与插入和更新插入
* JsonIgnore:不序列化该字段,避免无限递归
*/
@OneToOne(targetEntity = Card.class, cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinColumn(name = "card_id")
private Card studentCard;
/**
* ManyToMany,一方使用 JoinTable 注解,另一方配置 mappedBy 属性
* cascade:联级操作
* fetch:加载数据策略
*/
@ManyToMany(mappedBy = "students", cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
private List<Clazz> clazzes;
public int getStudentId() {
return studentId;
}
public void setStudentId(int studentId) {
this.studentId = studentId;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public LocalDateTime getCreateDate() {
return createDate;
}
public void setCreateDate(LocalDateTime createDate) {
this.createDate = createDate;
}
public List<Clazz> getClazzes() {
return clazzes;
}
public void setClazzes(List<Clazz> clazzes) {
this.clazzes = clazzes;
}
public Card getStudentCard() {
return studentCard;
}
public void setStudentCard(Card studentCard) {
this.studentCard = studentCard;
}
}
| [
"[email protected]"
] | |
cabe80000c67e5ff04587f3e8a18a32416698638 | 9621605f80e3ae6d22a0568e04275c1c7587580b | /app/src/main/java/com/zlcdgroup/taskManager/ApiSonTaskCallBack.java | 12a1f933d62bdae72332ccde88c095430ca2f0b2 | [] | no_license | akingyin1987/ShareLibs | cb21b9ca939839dafe2cb735092f7f26eb7b94c9 | 0f95fe1a57bf92ca3dc84784d80e51b7e8e2749b | refs/heads/master | 2020-12-24T19:12:59.653793 | 2018-08-01T10:08:59 | 2018-08-01T10:08:59 | 56,663,612 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,650 | java | package com.zlcdgroup.taskManager;
import com.zlcdgroup.taskManager.enums.TaskStatusEnum;
/**
* * * # #
* # _oo0oo_ #
* # o8888888o #
* # 88" . "88 #
* # (| -_- |) #
* # 0\ = /0 #
* # ___/`---'\___ #
* # .' \\| |# '. #
* # / \\||| : |||# \ #
* # / _||||| -:- |||||- \ #
* # | | \\\ - #/ | | #
* # | \_| ''\---/'' |_/ | #
* # \ .-\__ '-' ___/-. / #
* # ___'. .' /--.--\ `. .'___ #
* # ."" '< `.___\_<|>_/___.' >' "". #
* # | | : `- \`.;`\ _ /`;.`/ - ` : | | #
* # \ \ `_. \_ __\ /__ _/ .-` / / #
* # =====`-.____`.___ \_____/___.-`___.-'===== #
* # `=---=' #
* # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
* # #
* # 佛祖保佑 永无BUG #
* #
*
* @ Description: #
* Company:重庆中陆承大科技有限公司
* @ Author king
* @ Date 2016/10/24 17:00
* @ Version V1.0
*/
public interface ApiSonTaskCallBack {
void call(TaskStatusEnum taskStatusEnum);
}
| [
"[email protected]"
] | |
049530a00b23d7eae61769028c1af1a9337f40cc | f73b77ddec1ab57bbd2da1bad6f1944127e0b2e2 | /MiniGo(Web)/src/com/nis/view/DisplayBookingByClient.java | c176d63bf636af539f55d26ba10d6098d87c9ae2 | [] | no_license | suyashshukla/MiniGO-App | 0cb009992257ebe11ff1d6c7b9b0ad69736e3bd1 | 1b26167536e2e7dcfc8e9a279357cfd83cd09dbf | refs/heads/master | 2021-09-10T02:41:27.258903 | 2018-03-20T19:06:31 | 2018-03-20T19:06:31 | 126,069,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,934 | java | package com.nis.view;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.controller.BookingController;
/**
* Servlet implementation class DisplayBookingByClient
*/
@WebServlet("/DisplayBookingByClient")
public class DisplayBookingByClient extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DisplayBookingByClient() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out=response.getWriter();
try{
ResultSet rs=BookingController.DisplayBookingByClient();
out.println("<html>");
out.println("<table border=1>");
out.println("<caption> List of Bookings</caption>");
if(rs.next())
{
out.println("<tr><th>Sn</th><th>Booking Id</th><th>Client<br>Email</th><th>Client<br>Mobile no</th><th>Booking<br>Date</th><th>Booking<br>time</th><th>Source/<br>Destination</th></tr>");
int sn=1;
do
{
out.println("<tr><td>"+sn+"</td><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3)+"</td><td>"+rs.getString(4)+"</td><td>"+rs.getString(5)+"</td><td>From "+rs.getString(6)+"<br> to "+rs.getString(7)+"</td><td>"+rs.getString(8)+" <br> to "+rs.getString(9)+"</td></tr>");
}while(rs.next());
out.print("</table></html>");
}
else
{
out.println("No Bookings...");
}
out.flush();
}catch(Exception e)
{
out.println(e);
}
}
}
| [
"[email protected]"
] | |
5474419021c19d9a87586472e4dca1b1b6177180 | 59d2c8e8ceaad88c06e49d9f479944ea35415d2e | /events-camel/src/test/java/events/camel/repository/StockRepositoryTest.java | 35a2acfe9189be612fef403236eb1bd834a4ca07 | [] | no_license | LikeDreamLin/eventsdemo | fdf8b19e748e5ef6133ff896a5fe6848894cc253 | 8c5e636ebcb8613619c77367d64823d8ea1cb5e2 | refs/heads/master | 2021-01-12T01:05:34.360483 | 2014-07-08T09:21:09 | 2014-09-15T20:22:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,475 | java | package events.camel.repository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.annotations.Test;
import events.camel.entities.Item;
import events.camel.entities.StockItemType;
import events.camel.repositories.StockRepository;
//Load the same files here as in StockServiceTest to reuse spring context between the tests
// Not reusing results in multiple spring contexts where the bitronix tx manager will
// not start in the second context.
@ContextConfiguration(locations = {"classpath:META-INF/jpa.spring.xml",
"classpath:META-INF/service.spring.xml",
"classpath:META-INF/activemq.spring.xml"})
public class StockRepositoryTest extends AbstractTransactionalTestNGSpringContextTests
{
@Autowired
private StockRepository target;
@Test
public void insertRead()
{
Item item = new Item(StockItemType.DRIVE, "driveName", "driveNumber", Double.valueOf(12.34));
item = target.save(item);
item = target.findOne(item.getId());
Assert.assertEquals(item.getName(), "driveName");
List<Item> items = target.findByNumber(item.getNumber());
Assert.assertTrue(items.size() > 0);
Assert.assertEquals(items.get(0).getName(), "driveName");
}
}
| [
"[email protected]"
] | |
a84da508e8e64020f6fbd73b58ed5ecb3801b648 | fa8edc1cb25735ea2e09eefcd4797e6d6468c323 | /src/abstractfactory/AdidasLippis.java | 6adeac9c9c0728e105429390e7c8216dab81a9a6 | [] | no_license | huikkeli/Suunnittelumallit | 8403556d9a96ec3a372d0d89b78618da8122c6b1 | 9fecf90bc1e7c9f06ea39df66fb2275fb9505a18 | refs/heads/master | 2020-03-18T20:50:18.966830 | 2018-05-29T04:49:28 | 2018-05-29T04:49:28 | 135,241,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | 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 abstractfactory;
/**
*
* @author Huy Nguyen
*/
public class AdidasLippis implements Lippis {
@Override
public String toString() {
return "Adidaksen lippiksen";
}
}
| [
"[email protected]"
] | |
af4f6a758799e57e340e18bae0ad7bce5ffa236a | 12b14b30fcaf3da3f6e9dc3cb3e717346a35870a | /examples/commons-math3/mutations/mutants-Sigmoid/67/org/apache/commons/math3/analysis/function/Sigmoid.java | 354bdb5fc2da34ac3295e0be66e8d48a655a621d | [
"BSD-3-Clause",
"Minpack",
"Apache-2.0"
] | permissive | SmartTests/smartTest | b1de326998857e715dcd5075ee322482e4b34fb6 | b30e8ec7d571e83e9f38cd003476a6842c06ef39 | refs/heads/main | 2023-01-03T01:27:05.262904 | 2020-10-27T20:24:48 | 2020-10-27T20:24:48 | 305,502,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,721 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis.function;
import java.util.Arrays;
import org.apache.commons.math3.analysis.FunctionUtils;
import org.apache.commons.math3.analysis.UnivariateFunction;
import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction;
import org.apache.commons.math3.analysis.ParametricUnivariateFunction;
import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
import org.apache.commons.math3.exception.NullArgumentException;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.util.FastMath;
/**
* <a href="http://en.wikipedia.org/wiki/Sigmoid_function">
* Sigmoid</a> function.
* It is the inverse of the {@link Logit logit} function.
* A more flexible version, the generalised logistic, is implemented
* by the {@link Logistic} class.
*
* @since 3.0
* @version $Id$
*/
public class Sigmoid implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction {
/** Lower asymptote. */
private final double lo;
/** Higher asymptote. */
private final double hi;
/**
* Usual sigmoid function, where the lower asymptote is 0 and the higher
* asymptote is 1.
*/
public Sigmoid() {
this(0, 1);
}
/**
* Sigmoid function.
*
* @param lo Lower asymptote.
* @param hi Higher asymptote.
*/
public Sigmoid(double lo,
double hi) {
this.lo = lo;
this.hi = hi;
}
/** {@inheritDoc}
* @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
*/
@Deprecated
public UnivariateFunction derivative() {
return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
}
/** {@inheritDoc} */
public double value(double x) {
return value(x, lo, hi);
}
/**
* Parametric function where the input array contains the parameters of
* the {@link Sigmoid#Sigmoid(double,double) sigmoid function}, ordered
* as follows:
* <ul>
* <li>Lower asymptote</li>
* <li>Higher asymptote</li>
* </ul>
*/
public static class Parametric implements ParametricUnivariateFunction {
/**
* Computes the value of the sigmoid at {@code x}.
*
* @param x Value for which the function must be computed.
* @param param Values of lower asymptote and higher asymptote.
* @return the value of the function.
* @throws NullArgumentException if {@code param} is {@code null}.
* @throws DimensionMismatchException if the size of {@code param} is
* not 2.
*/
public double value(double x, double ... param)
throws NullArgumentException,
DimensionMismatchException {
validateParameters(param);
return Sigmoid.value(x, param[0], param[1]);
}
/**
* Computes the value of the gradient at {@code x}.
* The components of the gradient vector are the partial
* derivatives of the function with respect to each of the
* <em>parameters</em> (lower asymptote and higher asymptote).
*
* @param x Value at which the gradient must be computed.
* @param param Values for lower asymptote and higher asymptote.
* @return the gradient vector at {@code x}.
* @throws NullArgumentException if {@code param} is {@code null}.
* @throws DimensionMismatchException if the size of {@code param} is
* not 2.
*/
public double[] gradient(double x, double ... param)
throws NullArgumentException,
DimensionMismatchException {
validateParameters(param);
final double invExp1 = 1 / (1 + FastMath.exp(-x));
return new double[] { 1 - invExp1, invExp1 };
}
/**
* Validates parameters to ensure they are appropriate for the evaluation of
* the {@link #value(double,double[])} and {@link #gradient(double,double[])}
* methods.
*
* @param param Values for lower and higher asymptotes.
* @throws NullArgumentException if {@code param} is {@code null}.
* @throws DimensionMismatchException if the size of {@code param} is
* not 2.
*/
private void validateParameters(double[] param)
throws NullArgumentException,
DimensionMismatchException {
if (param == null) {
throw new NullArgumentException();
}
if (param.length != 2) {
throw new DimensionMismatchException(param.length, 2);
}
}
}
/**
* @param x Value at which to compute the sigmoid.
* @param lo Lower asymptote.
* @param hi Higher asymptote.
* @return the value of the sigmoid function at {@code x}.
*/
private static double value(double x,
double lo,
double hi) {
return lo + (hi - lo) / (1 + FastMath.exp(-x));
}
/** {@inheritDoc}
* @since 3.1
*/
public DerivativeStructure value(final DerivativeStructure t)
throws DimensionMismatchException {
double[] f = new double[t.getOrder() + 1];
final double exp = FastMath.exp(+t.getValue());
if (Double.isInfinite(exp)) {
// special handling near lower boundary, to avoid NaN
f[0] = lo;
Arrays.fill(f, 1, f.length, 0.0);
} else {
// the nth order derivative of sigmoid has the form:
// dn(sigmoid(x)/dxn = P_n(exp(-x)) / (1+exp(-x))^(n+1)
// where P_n(t) is a degree n polynomial with normalized higher term
// P_0(t) = 1, P_1(t) = t, P_2(t) = t^2 - t, P_3(t) = t^3 - 4 t^2 + t...
// the general recurrence relation for P_n is:
// P_n(x) = n t P_(n-1)(t) - t (1 + t) P_(n-1)'(t)
final double[] p = new double[f.length];
final double inv = 1 / (1 + exp);
double coeff = hi - lo;
for (int n = 0; n < f.length; ++n) {
// update and evaluate polynomial P_n(t)
double v = 0;
p[n] = 1;
for (int k = n; k >= 0; --k) {
v = v * exp + p[k];
if (k > 1) {
p[k - 1] = (n - k + 2) * p[k - 2] - (k - 1) * p[k - 1];
} else {
p[0] = 0;
}
}
coeff *= inv;
f[n] = coeff * v;
}
// fix function value
f[0] += lo;
}
return t.compose(f);
}
}
| [
"[email protected]"
] | |
f3283f3e7b4775ef9c29c66bc29d37bc8b8c696d | 8d4dbed17a93b25878f5f459646769320adb0dcc | /Java/File_System/Link.java | 60d946da187c7fd22b2af40a3a6c1e976f6f35f0 | [] | no_license | marcellio4/school_Project | 7564205c5e8d7bd8469c2cc74892a63b247ec0f9 | 371a440708ea6867dbb2611410fc1fe67e38f103 | refs/heads/master | 2021-07-13T09:48:35.096373 | 2020-11-19T01:32:47 | 2020-11-19T01:32:47 | 219,182,499 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,244 | java | /**
* A symbolic link is a pointer to an entry in the file system.
*
* @author Roman Kontchakov
* @author Carsten Fuhs
* @author Marcel Zacharias
*
* @param <T> The type of file system entry to which this Link points.
*/
public abstract class Link<T extends Entry> extends AbstractEntry {
/** The file system entry to which this link points. */
private final T target;
/**
* Constructs a new link to an entity.
*
* @param folder the parent folder of this link; must not be null
* @param name the name of this link; must not be null
* @param entity the entity to which this links points; must not be null
*/
public Link(Folder folder, String name, T entity) {
super(folder, name);
if (entity == null)
throw new IllegalArgumentException("entity cannot be null");
this.target = entity;
}
/**
* Returns the entity to which this Link points (the target of the link).
*
* @return the entity to which this Link points.
*/
public T getTarget() {
return target;
}
/**
* Returns whether this Link is valid for the current file system.
*
* @return whether this Link is valid for the current file system, i.e.,
* whether it links to an entry currently stored in the file system
*/
public boolean isValidLink() {
return target.isInFileSystem();
}
/* (non-Javadoc)
* @see Entry#getSize()
*/
@Override
public int getSize() {
return 0;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
// relies on entity != null
return super.hashCode() + prime*target.hashCode();
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof Link))
return false;
Link other = (Link) obj; // no generic type here :(
return target.equals(other.target); // relies on entity != null
}
}
| [
"[email protected]"
] | |
06c82865e5de4aa72d02c32e29eb3ed641e3b93c | b0f41af2372fc7f05f867fbcb5b8b6cc4c578735 | /src/main/java/com/ssz/wechat/wechatdemo/message/resp/BaseMessage.java | 3860f72ddd48d6dabd1bc78ef5326a626489bcaf | [
"Apache-2.0"
] | permissive | itduoduo/wechat-demo | c879e54db457c7a4349714d8e86c93f9b3b58e97 | 1969ff7a1f0308a99da1ed1ac9a6104e3d3f1caa | refs/heads/master | 2020-04-24T07:00:24.312782 | 2019-02-21T02:25:57 | 2019-02-21T02:25:57 | 171,784,219 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,143 | java | package com.ssz.wechat.wechatdemo.message.resp;
/**
* ClassName: BaseMessage
*
* @author dapengniao
* @Description: 返回消息体-基本消息
* @date 2016年3月7日 下午3:16:57
*/
public class BaseMessage {
// 接收方帐号(收到的OpenID)
private String ToUserName;
// 开发者微信号
private String FromUserName;
// 消息创建时间 (整型)
private long CreateTime;
// 消息类型(text/music/news)
private String MsgType;
public String getToUserName() {
return ToUserName;
}
public void setToUserName(String toUserName) {
ToUserName = toUserName;
}
public String getFromUserName() {
return FromUserName;
}
public void setFromUserName(String fromUserName) {
FromUserName = fromUserName;
}
public long getCreateTime() {
return CreateTime;
}
public void setCreateTime(long createTime) {
CreateTime = createTime;
}
public String getMsgType() {
return MsgType;
}
public void setMsgType(String msgType) {
MsgType = msgType;
}
}
| [
"[email protected]"
] | |
6465880a753ea044813f1624cdf6c018164160e2 | a2817914ffd7ae270f98f7e472d993a6ef65c1aa | /blog-backend/src/main/java/com/hhj/blogbackend/controller/admin/FileUploadController.java | 2807fcb68c0f920cc5f5a8e7922d68fb97cc8e60 | [] | no_license | lalaorya/viturals-blog | afa908820083ac59928f00f61d86373f227c10cd | 3d7fc1314153313e6524a487b428c23b932070ee | refs/heads/master | 2023-06-06T04:29:48.954487 | 2021-06-26T08:45:12 | 2021-06-26T08:45:12 | 347,425,666 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.hhj.blogbackend.controller.admin;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api("文件上传控制器")
@Slf4j
@RequestMapping("/admin/uploadImg")
public class FileUploadController {
}
| [
"[email protected]"
] | |
9262f0c85fd1e978395f06b4689fdafe4476482b | d1cc716c6b17ca3969ab68a7acdaea673ee605b2 | /ActionBarTest/src/main/java/mymodule/mymodule/actionbartest/ActionBarTabActivity.java | 8845c7e2e15d9baaf23500098b00ed42a2be6941 | [] | no_license | cgcym1234/AndroidSum | 0f7fb8d6ec43306bbd977ca2ba84915ee8d0afdc | e664a053eb20d4421a58c85162c263d37b6d4c99 | refs/heads/master | 2021-01-23T03:27:20.828636 | 2014-12-02T03:16:50 | 2014-12-02T03:16:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,183 | java | package mymodule.mymodule.actionbartest;
import android.app.ActionBar;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.DisplayMetrics;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.View;
import java.util.ArrayList;
/**
添加导航Tabs
Tabs的应用可以算是非常广泛了,它可以使得用户非常轻松地在你的应用程序中切换不同的视图。
而Android官方更加推荐使用ActionBar中提供的Tabs功能,因为它更加的智能,可以自动适配各种屏幕的大小。
比如说,在平板上屏幕的空间非常充足,Tabs会和Action按钮在同一行显示,如下图所示:
而如果是在手机上,屏幕的空间不够大的话,Tabs和Action按钮则会分为两行显示,如下图所示:
下面我们就来看一下如何使用ActionBar提供的Tab功能,大致可以分为以下几步:
1. 实现ActionBar.TabListener接口,这个接口提供了Tab事件的各种回调,比如当用户点击了一个Tab时,你就可以进行切换Tab的操作。
2.为每一个你想添加的Tab创建一个ActionBar.Tab的实例,并且调用setTabListener()方法来设置ActionBar.TabListener。
除此之外,还需要调用setText()方法来给当前Tab设置标题。
3.最后调用ActionBar的addTab()方法将创建好的Tab添加到ActionBar中。
看起来并不复杂,总共就只有三步,那么我们现在就来尝试一下吧。首先第一步需要创建一个实现ActionBar.TabListener接口的类,
*/
public class ActionBarTabActivity extends FragmentActivity {
private ArrayList<ChatFragment> fragments = new ArrayList<ChatFragment>();
private static final String TAG = "UserMyOrders.";
private String[] mTitles = {"待付款", "待发货", "已发货", "待评价", "全部"};
ViewPager viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.actionbar_tab_activity);
setTitle("test");
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
for(int i = 0; i < mTitles.length; i++){
fragments.add(new ChatFragment());
ActionBar.Tab tab = actionBar.newTab().setText(mTitles[i]).setTabListener(new MyTabListener<ChatFragment>(this, "one1", ChatFragment.class));
actionBar.addTab(tab);
}
}
void viewPagerInit(){
viewPager = (ViewPager) findViewById(R.id.view_pager);
viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), mTitles, fragments));
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
private class MyPagerAdapter extends FragmentPagerAdapter{
private String[] titles = null;
private ArrayList<ChatFragment> fragments;
public MyPagerAdapter(FragmentManager fm, String[] titles, ArrayList<ChatFragment> fragments) {
super(fm);
this.titles = titles;
this.fragments = fragments;
}
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}
@Override
public int getCount() {
return fragments.size();
}
@Override
public CharSequence getPageTitle(int position) {
return titles[position];
}
}
}
| [
"[email protected]"
] | |
aa2ff566dd8cd79da6ca48346d7e478adc91ddf6 | 2208444efc15c5d6e3a213be99a365ba46e2e305 | /plugins/eu.jucy.gui/src/eu/jucy/gui/texteditor/hub/ReconnectHandler.java | 819f34458150df98034ab28b846d2a1e1043a2c7 | [] | no_license | BackupTheBerlios/jucy | 99c26b4b586da865b06ff9622e2dc36466901dad | 45c93cb18f6d8644a9146e6de8204406f107088a | refs/heads/master | 2021-01-01T16:39:27.824040 | 2011-08-30T20:34:39 | 2011-08-30T20:34:39 | 39,715,148 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package eu.jucy.gui.texteditor.hub;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.ui.handlers.HandlerUtil;
import uc.IHub;
public class ReconnectHandler extends AbstractHandler implements IHandler {
public static final String COMMAND_ID = "eu.jucy.gui.reconnect";
public Object execute(ExecutionEvent event) throws ExecutionException {
IHub hub = ((HubEditor)HandlerUtil.getActiveEditorChecked(event)).getHub();
hub.reconnect(0);
return null;
}
}
| [
"[email protected]"
] | |
db2a267a885efdedeed4a53481a564d19dc30beb | 6635387159b685ab34f9c927b878734bd6040e7e | /src/com/snapchat/android/fragments/settings/twofa/RecoveryCodeFragment$2.java | e37db3529360d7d796899bd20dcf6604fca72d41 | [] | no_license | RepoForks/com.snapchat.android | 987dd3d4a72c2f43bc52f5dea9d55bfb190966e2 | 6e28a32ad495cf14f87e512dd0be700f5186b4c6 | refs/heads/master | 2021-05-05T10:36:16.396377 | 2015-07-16T16:46:26 | 2015-07-16T16:46:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.snapchat.android.fragments.settings.twofa;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.View.OnClickListener;
final class RecoveryCodeFragment$2
implements View.OnClickListener
{
RecoveryCodeFragment$2(RecoveryCodeFragment paramRecoveryCodeFragment) {}
public final void onClick(View paramView)
{
a.getActivity().onBackPressed();
}
}
/* Location:
* Qualified Name: com.snapchat.android.fragments.settings.twofa.RecoveryCodeFragment.2
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
79fd27876cbe00abe8b6edab4f45adef268a3f06 | 6ae4a99e7af454ea925273d01fb0570d29e3cb8d | /YOLO/src/main/java/com/one/yolo/mypage/controller/MyEditController.java | a4e71d75e94238636478534fb1df620b1d4935b4 | [] | no_license | sihye/YOLO | db846864345ffc1256f38b8ec057a20f5cf5e2b7 | 1d84ab28a0ddd4e4091b775b06b1dff49deceb8a | refs/heads/master | 2021-01-19T07:07:00.120969 | 2017-05-12T07:13:33 | 2017-05-12T07:13:33 | 87,523,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,228 | java | package com.one.yolo.mypage.controller;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.one.yolo.category.model.CategoryService;
import com.one.yolo.category.model.CategoryVO;
import com.one.yolo.categorygroup.model.CategoryGroupService;
import com.one.yolo.categorygroup.model.CategoryGroupVO;
import com.one.yolo.member.model.MemberService;
import com.one.yolo.member.model.MemberVO;
@Controller
@RequestMapping("/mypage/myedit")
public class MyEditController {
private static final Logger logger
=LoggerFactory.getLogger(MyEditController.class);
@Autowired
private MemberService memberService;
@Autowired
private CategoryService categoryService;
@Autowired
private CategoryGroupService categoryGroupService;
@RequestMapping(value="/myedit.do", method=RequestMethod.GET)
public String myedit_get(HttpSession session,Model model){
String userid=(String) session.getAttribute("userid");
logger.info("회원수정화면 보여주기 123, 파라미터 userid={}", userid);
MemberVO vo =memberService.selectByUserid(userid);
logger.info("회원수정화면123 - 회원정보조회 결과, vo={}", vo);
List<CategoryVO> cList
=categoryService.selectAll();
List<CategoryGroupVO> cgList
=categoryGroupService.selectAll();
logger.info("123cList size={}",cList.size());
logger.info("123cgList size={}",cgList.size());
model.addAttribute("vo", vo);
model.addAttribute("cList",cList);
model.addAttribute("cgList",cgList);
return "mypage/myedit/myedit";
}
@RequestMapping(value="/myedit.do", method=RequestMethod.POST)
public String myedit_post(@ModelAttribute MemberVO memberVo,
@RequestParam(value="mEmail3" ,required=false) String email3,
@RequestParam int[] kno,
HttpSession session, Model model){
logger.info("회원수정 처리, 파라미터 vo={}", memberVo);
String userid=(String) session.getAttribute("userid");
memberVo.setmUserid(userid);
for(int i:kno){
logger.info("kno="+i);
}
logger.info("kno[0]="+kno[0]);
//logger.info("kno[1]="+kno[1]);
//체크박스 처리
switch(kno.length){
case 1:
memberVo.setkNo1(kno[0]);
break;
case 2:
memberVo.setkNo1(kno[0]);
memberVo.setkNo2(kno[1]);
break;
case 3:
memberVo.setkNo1(kno[0]);
memberVo.setkNo2(kno[1]);
memberVo.setkNo3(kno[2]);
break;
}
logger.info("kNo1"+memberVo.getkNo1());
logger.info("kNo2"+memberVo.getkNo2());
//1
logger.info("회원가입 처리, 파라미터 vo={}", memberVo);
//2
//휴대폰 입력하지 않은 경우 처리
String hp2=memberVo.getmTel2();
String hp3=memberVo.getmTel3();
if(hp2==null || hp2.isEmpty() || hp3==null || hp3.isEmpty()){
memberVo.setmTel1("");
memberVo.setmTel2("");
memberVo.setmTel3("");
}
//이메일 입력하지 않은 경우 처리
String email1=memberVo.getmEmail1();
if(email1==null || email1.isEmpty()){
memberVo.setmEmail2("");
}else{
//직접입력인 경우
if(memberVo.getmEmail2().equals("etc")){
if(email3 !=null && !email3.isEmpty()){
memberVo.setmEmail2(email3);
}else{
memberVo.setmEmail1("");
memberVo.setmEmail2("");
}
}
}
int cnt = memberService.memberInsert(memberVo);
String msg="", url="";
if(cnt>0){
msg="회원정보 수정";
url="/index2.do";
}else{
msg="회원정보 수정실패";
url="/member/register.do";
}
//3
model.addAttribute("msg", msg);
model.addAttribute("url", url);
return "common/message";
}
}
| [
"User@UserPC"
] | User@UserPC |
73371cab8189839f040ad1111bd38ccdc35c34c9 | 7f75fac09a3535a988f8365d8ba954d1601b24c2 | /app/src/main/java/com/pei/foodpie/browserfood/knowledge/KnowledgeFragment.java | 488616c843d7e31fc1c67a20b1e78c0995d772dc | [] | no_license | emrys62134/FoodPie | 4f98f7975164867d425e6eeae0a970457e812035 | 4b447287f78567753f4c8162d4683c592ac92e68 | refs/heads/master | 2020-06-16T23:37:07.138028 | 2016-11-29T08:20:10 | 2016-11-29T08:20:10 | 75,057,745 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,081 | java | package com.pei.foodpie.browserfood.knowledge;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.android.volley.VolleyError;
import com.pei.foodpie.R;
import com.pei.foodpie.base.BaseFragment;
import com.pei.foodpie.browserfood.delicious.CommonActivity;
import com.pei.foodpie.constant.Constant;
import com.pei.foodpie.volleysingleton.MyApp;
import com.pei.foodpie.volleysingleton.NetListener;
import com.pei.foodpie.volleysingleton.VolleySingleton;
/**
* Created by dllo on 16/11/23.
*/
public class KnowledgeFragment extends BaseFragment {
private ListView lv;
private KnowledgeAdapter adapter;
@Override
protected int setLayout() {
return R.layout.fragment_knowledge_browser;
}
@Override
protected void initView(View view) {
initViews();// 初始化控件
}
@Override
protected void initData() {
getNetData(); // 获取网络数据
}
private void initViews() {
lv = bindView(R.id.lv_browser_knowledge);
adapter = new KnowledgeAdapter(MyApp.getContext());
lv.setAdapter(adapter);
}
private void getNetData() {
VolleySingleton.MyRequest(Constant.KnowledgeUrl, KnowledgeBean.class, new NetListener<KnowledgeBean>() {
@Override
public void successListener(final KnowledgeBean response) {
adapter.setKnowledgeBean(response);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Intent intent = new Intent(getActivity(), CommonActivity.class);
intent.putExtra("data",response.getFeeds().get(i).getLink());
startActivity(intent);
}
});
}
@Override
public void errorListener(VolleyError error) {
}
});
}
}
| [
"[email protected]"
] | |
00a6b68c9027606ae28e985ebc1166ccdf67c191 | 0be82b9a18db00f0e0b0ac28b9fe3caaa2e276a6 | /open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/AssetOwnerInterface.java | f2f16c205792ed14ebe4b6fc09dd640648f77ac4 | [
"Apache-2.0"
] | permissive | constantinnastase/egeria | 6d2882e08745d07b432477be93d43b4ce2a524b7 | 80f0a3cc172e063b61401a23268f5d1e2ccd8095 | refs/heads/master | 2020-03-22T09:47:26.442127 | 2018-07-18T12:58:11 | 2018-07-18T12:58:11 | 139,860,496 | 0 | 0 | Apache-2.0 | 2018-07-05T14:33:29 | 2018-07-05T14:23:22 | Java | UTF-8 | Java | false | false | 268 | java | /* SPDX-License-Identifier: Apache-2.0 */
package org.odpi.openmetadata.accessservices.assetowner;
/**
* AssetOwnerInterface provides the client-side interface for an asset owner to manage the metadata about their
* asset.
*/
public class AssetOwnerInterface
{
}
| [
"[email protected]"
] | |
101ac19709969e119645657cc6d2bc58d8217bb6 | 6e517ce4526caeed233a3398e228443e1ba69491 | /AutoMobileWebTherr/src/annotation/Log.java | a3f13936f611c07bea0fd2cf51050ab082b42889 | [] | no_license | Demoywj/AutoMobileWebTherr | 3fea2019d544079c92911a444f5fe946a80e500b | 12022660a12c8cce42021d26cb75a2a912a00e92 | refs/heads/master | 2022-11-16T15:00:47.970346 | 2020-07-15T06:44:43 | 2020-07-15T06:44:43 | 279,787,536 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 705 | java | package annotation;
import java.lang.annotation.*;
/*
* 定义用于controller类中方法的注解
* 使用该注解可以对controller类中的方法定义操作类型
*/
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Log {
/** 定义方法是否需要进行进行操作日志的保存**/
public boolean isSaveLog() default false;
/** 要执行的操作类型比如:add操作 **/
public String operationType() default "";
/** 要执行的具体操作内容比如:添加管理员用户/修改管理员角色权限 **/
public String operationName() default "";
} | [
"[email protected]"
] | |
92bb9987f082307d2a8369903fd0155ac68fee08 | 2c763e57ab1c4066668c96f0fa04bb6d945f4794 | /src/main/java/com/jlcabral/pedidos/repositories/CidadeRepository.java | a00c02e5d8eec2e02cc4ecd55f23e3333ac444f9 | [] | no_license | jhonnyluiz/pedidos-spring | f5c3b489e961aa806e03f7f02204135ffca3e38c | 985d0360de626b5d1f80d5879a9336ff5be93432 | refs/heads/master | 2021-04-06T10:36:47.244823 | 2018-07-05T12:14:00 | 2018-07-05T12:14:00 | 125,383,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 287 | java | package com.jlcabral.pedidos.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.jlcabral.pedidos.domain.Cidade;
@Repository
public interface CidadeRepository extends JpaRepository<Cidade, Long>{
}
| [
"[email protected]"
] | |
46f555f1fd10a60bacf4e3b5aaae0bde58cccf6d | ea8b2bf1a0a55e1945a515eb63ebe83245ec2dee | /oleaster-runner/src/test/java/com/mscharhag/oleaster/runner/PendingSpecTest.java | 9ba9d3197630e2959bf883a3e40af41ee00f92de | [
"Apache-2.0"
] | permissive | bangarharshit/Oleaster | ac7ef4936772c676bb9ce64a7d3644eb3250436e | 505ec09688f1a941e937fe9dcd350661638b33b3 | refs/heads/master | 2021-07-14T20:16:50.650099 | 2017-10-21T16:08:42 | 2017-10-21T16:08:42 | 105,345,446 | 2 | 1 | null | 2017-10-21T16:08:42 | 2017-09-30T05:52:01 | Java | UTF-8 | Java | false | false | 1,575 | java | package com.mscharhag.oleaster.runner;
import org.junit.runner.RunWith;
import static com.mscharhag.oleaster.runner.StaticRunnerSupport.*;
import static junit.framework.TestCase.*;
@RunWith(OleasterRunner.class)
public class PendingSpecTest {{
describe("PendingSpecs", () -> {
describe("with a nested describe", () -> {
it("should be executed", () -> {
assertTrue(true);
});
xit("should not be executed", () -> {
fail("Pending it (xit) should not be executed!");
});
describe("a nested describe should be executed", () -> {
it("should be fine", () -> {
assertTrue(true);
});
});
xdescribe("a pending describe should not be executed", () -> {
it("should not be executed", () -> {
fail("'it' in 'xdescribe' should not be executed!");
});
describe("a describe with a xdescribe parent", () -> {
it("should not be executed", () -> {
fail("'it' in 'describe' with 'xdescribe' parent should not be executed!");
});
describe("a describe with a xdescribe grandparent", () -> {
it("should not be executed", () -> {
fail("'it' in 'describe' with 'xdescribe' grandparent should not be executed!");
});
});
});
});
});
it("should be executed", () -> {
assertTrue(true);
});
xit("should not be executed", () -> {
fail("Pending it (xit) should not be executed!");
});
it("another pending style of test");
});
}}
| [
"[email protected]"
] | |
ba54b9f658e52f7a2e4c8b7df297ed89bf82e32a | 902717bf061841833c27d1b8053a615e85ef1494 | /taotao-order-spring-boot/taotao-order-spring-boot-service/src/main/java/com/taotao/order/quartz/QuartzConfiguration.java | 955b8e36b5e318b0ec15a5c372edac3c57c0d940 | [] | no_license | fengyangcai/tt | a1600be7584e58926731521cacdbbb87e0de4f45 | 802c345b1886117c94c6bb43ecf42943539afc0f | refs/heads/master | 2022-09-07T09:51:56.000558 | 2019-06-17T18:00:15 | 2019-06-17T18:00:15 | 192,394,083 | 0 | 0 | null | 2022-09-01T23:08:29 | 2019-06-17T17:57:03 | JavaScript | UTF-8 | Java | false | false | 1,937 | java | package com.taotao.order.quartz;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import com.taotao.order.service.OrderService;
@Configuration
public class QuartzConfiguration {
//任务详细信息bean
@Bean("orderJobDetail")
public MethodInvokingJobDetailFactoryBean getJobDetail(OrderService orderService) {
MethodInvokingJobDetailFactoryBean jobDetailFactoryBean = new MethodInvokingJobDetailFactoryBean();
//设置执行对象
jobDetailFactoryBean.setTargetObject(orderService);
//设置执行对象中对应的方法
jobDetailFactoryBean.setTargetMethod("autoCloseOrder");
//设置是否可并发
jobDetailFactoryBean.setConcurrent(false);
return jobDetailFactoryBean;
}
//任务调度触发器bean
@Bean("orderCronTrigger")
public CronTriggerFactoryBean getTrigger(MethodInvokingJobDetailFactoryBean jobDetail,
@Value("${quartz.cronExpression}")String cronExpression) {
CronTriggerFactoryBean cronTriggerFactoryBean = new CronTriggerFactoryBean();
//任务详细信息
cronTriggerFactoryBean.setJobDetail(jobDetail.getObject());
//设置执行时机,每隔5秒
cronTriggerFactoryBean.setCronExpression(cronExpression);
return cronTriggerFactoryBean;
}
//任务触发器调度工厂bean
@Bean("orderSchedulerFactoryBean")
public SchedulerFactoryBean getScheduler(CronTriggerFactoryBean trigger) {
SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
//设置触发器们
schedulerFactoryBean.setTriggers(trigger.getObject());
return schedulerFactoryBean;
}
}
| [
"[email protected]"
] | |
4cd92fcc62aadd9c525f1a52b6b5a99d6d18cd03 | 00b451d4a2ec468d3877b5e380943f34c1d36a67 | /src/main/java/com/songPlayer/command/ListSongBasedOnAlbum.java | d023ce68601cfc463e66efc1bc38981cac7c8a36 | [] | no_license | YashaswiBM13/SongPlayer | ca445b834f45c05843bcc1bb83ea4ea6faebc4cb | 3ac7230c78bf2b10ce9c86914af6206412e4b7ab | refs/heads/main | 2023-08-13T18:44:53.960933 | 2021-10-18T06:03:22 | 2021-10-18T06:03:22 | 418,364,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,280 | java | package com.songPlayer.command;
import java.util.List;
import com.songPlayer.entities.Song;
import com.songPlayer.services.ISongListService;
public class ListSongBasedOnAlbum implements ICommand {
private final ISongListService iSongListService;
public ListSongBasedOnAlbum(ISongListService iSongListService) {
this.iSongListService = iSongListService;
}
@Override
public void execute(List<String> tokens) {
String album = tokens.get(1);
System.out.println("List Songs Based On Album: \n");
List<Song> songList = iSongListService.listSongsBasedOnAlbum(album);
songList.stream()
.forEach(song -> {
System.out.println("Song ID - "+song.getId());
System.out.println("Song Name - "+song.getName());
System.out.println("Genre - "+song.getGenre());
System.out.println("Album - "+song.getAlbum());
System.out.println("Album Artist - "+song.getAlbumArtist());
System.out.print("Artists - ");
song.getArtistList().stream()
.forEach(artist -> System.out.print(artist+","));
System.out.println();
});
System.out.println();
}
} | [
"[email protected]"
] | |
4ee8f8889e3fee2d304931bc529e41fc6621548b | 1d12412e6ffbd0fa597f71f5e0c1c4452e2a120b | /src/main/java/Phone/Phone.java | f89f7650fa1d9de896fc2b4fe495cd5ab5025515 | [] | no_license | alangre3n/ExamClouds | b929cadf44274e1ecbf1aa1fd966884abd279b69 | 4d119378ccf4fac11e79cc70b72b031570ec26b3 | refs/heads/master | 2022-12-13T08:04:18.636924 | 2020-09-16T01:05:23 | 2020-09-16T01:05:23 | 295,886,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,449 | java | package Phone;
import lombok.Getter;
import lombok.Setter;
import java.util.Arrays;
@Getter
@Setter
public class Phone {
private String number;
private String model;
private int weight;
public Phone(String number, String model, int weight) {
this(number, model);
this.weight = weight;
}
public Phone(String number, String model) {
this.number = number;
this.model = model;
}
public Phone() {
}
public String getNumber() {
return number;
}
public String getModel() {
return model;
}
public int getWeight() {
return weight;
}
public void setNumber(String number) {
this.number = number;
}
public void setModel(String model) {
this.model = model;
}
public void setWeight(int weight) {
this.weight = weight;
}
public void receiveCall(String name){
System.out.println("Call " + name);
}
public void receiveCall(String name, String number) {
System.out.println("Call " + name + " phone number " + number);
}
public void sendMessage(String...number) {
System.out.println(Arrays.toString(number));
}
@Override
public String toString() {
return "Phone{" +
"number='" + number + '\'' +
", model='" + model + '\'' +
", weight=" + weight +
'}';
}
}
| [
"[email protected]"
] | |
f0aaa2d74c83df3d8b29b0faf5120564cc345433 | 5fdffcef3aef2b46b6f8229caef5100df8647b97 | /src/java/promepe/negocio/AlergiaBO.java | b0d81ec3851ef23c421ab684050d6f72df718789 | [] | no_license | ArnaldoGuedes/promepe | 85b01a705a99982399b93385e60a0c18effee728 | 51ad165e1aad9a0099b23ac90f1f7748809b3ead | refs/heads/master | 2021-01-02T08:47:18.434165 | 2013-10-12T11:52:13 | 2013-10-12T12:04:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,372 | java | package promepe.negocio;
import java.util.Date;
import java.util.List;
import promepe.entidade.Alergia;
import promepe.persistencia.AlergiaDAO;
/**
*
* @author Arnaldo F Guedes Reis
*/
public class AlergiaBO {
private AlergiaDAO alergiaDAO = new AlergiaDAO();
public void adicionarAlergia(Alergia alergia){
//Verifica se ja existe Alergia com o mesmo nome
Alergia obterAlergia;
try{
obterAlergia = alergiaDAO.obterAlergiaNomeUsuarioId(alergia.getUsuario().getId(), alergia.getNome().toLowerCase());
}catch(Exception e){
obterAlergia = new Alergia();
}
if (!obterAlergia.getNome().equals("")) {
throw new RuntimeException("A alergia '"+ alergia.getNome() +"' já existe.");
}
//Verifica se a data da ultima reação alergica é valida.
//Testar se a data esta vazia.
boolean dataVazia = true;
try {
alergia.getUltimaReacao().compareTo(new Date()); //Gambiarra! =D
}catch(Exception e){
dataVazia = false;
}
if(dataVazia){
if (alergia.getUltimaReacao().after(new Date())) {
throw new RuntimeException("A data da ultima reação alérgica não pode ser posterior a data atual.");
}
if (!(alergia.getUsuario().getDataNascimento().before(alergia.getUltimaReacao()))) {
throw new RuntimeException("A data da ultima reação alérgica não pode ser antes do nascimento do usuário.");
}
}
//Se as validaçõe estiverem corretas, passa a alergia para a camada de persistencia.
alergiaDAO.adicionarAlergia(alergia);
}
public void alterarAlergia(Alergia alergia){
Alergia obterAlergia;
try{
obterAlergia = alergiaDAO.obterAlergiaNomeUsuarioId(alergia.getUsuario().getId(), alergia.getNome().toLowerCase());
}catch(Exception e){
obterAlergia = new Alergia();
}
if ((!obterAlergia.getNome().equals("")) && (obterAlergia.getId() != alergia.getId())) {
throw new RuntimeException("A alergia '"+ alergia.getNome() +"' já existe.");
}
//Verifica se a data da ultima reação alergica é valida.
//Testar se a data esta vazia.
boolean dataVazia = true;
try {
alergia.getUltimaReacao().compareTo(new Date()); //Gambiarra! =D
}catch(Exception e){
dataVazia = false;
}
if(dataVazia){
if (alergia.getUltimaReacao().after(new Date())) {
throw new RuntimeException("A data da ultima reação alérgica não pode ser posterior a data atual.");
}
if (!(alergia.getUsuario().getDataNascimento().before(alergia.getUltimaReacao()))) {
throw new RuntimeException("A data da ultima reação alérgica não pode ser antes do nascimento do usuário.");
}
}
alergiaDAO.alterarAlergia(alergia);
}
public void excluirAlergia(Alergia alergia){
alergiaDAO.excluirAlergia(alergia);
}
public List<Alergia> obterTodasAlergiasUsuarioId(long id){
return alergiaDAO.obterTodasAlergiasUsuarioId(id);
}
}
| [
"[email protected]"
] | |
2e48da26c2ad5f982c9dfa90ce729e3aa01b7956 | cc6d93c332d0996d55db1e292680c44126ada9dc | /minecraft/net/minecraft/item/crafting/RecipesWeapons.java | d13d1c9c763e4e9adeb3dc4c327805e6746011cf | [] | no_license | tibijejczyk/TheMinecraft | d51dc9589115dc21348f60d54576a1ff96aa1421 | 63f16c77e92233c6121f6c60d3ab606f26f97403 | refs/heads/master | 2021-01-25T04:01:26.852814 | 2013-01-26T18:17:12 | 2013-01-26T18:17:12 | 7,686,980 | 1 | 0 | null | 2013-01-20T00:43:30 | 2013-01-18T13:24:40 | Java | UTF-8 | Java | false | false | 1,436 | java | package net.minecraft.item.crafting;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class RecipesWeapons
{
private String[][] recipePatterns = new String[][] {{"X", "X", "#"}};
private Object[][] recipeItems;
public RecipesWeapons()
{
this.recipeItems = new Object[][] {{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordSteel, Item.swordDiamond, Item.swordGold}};
}
/**
* Adds the weapon recipes to the CraftingManager.
*/
public void addRecipes(CraftingManager par1CraftingManager)
{
for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2)
{
Object var3 = this.recipeItems[0][var2];
for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4)
{
Item var5 = (Item)this.recipeItems[var4 + 1][var2];
par1CraftingManager.func_92051_a(new ItemStack(var5), new Object[] {this.recipePatterns[var4], '#', Item.stick, 'X', var3});
}
}
par1CraftingManager.func_92051_a(new ItemStack(Item.bow, 1), new Object[] {" #X", "# X", " #X", 'X', Item.silk, '#', Item.stick});
par1CraftingManager.func_92051_a(new ItemStack(Item.arrow, 4), new Object[] {"X", "#", "Y", 'Y', Item.feather, 'X', Item.flint, '#', Item.stick});
}
}
| [
"[email protected]"
] | |
03b5c323a91a3b9db7edc2526409cd0e661578ee | 9b07cf50830833a92b90569f6fd9f84bd72c9170 | /app/src/main/java/com/delta/campuscomm/ListAdapter.java | 78ff2a7b3b4829b4c67bf300b3b20f57911c0e30 | [] | no_license | shreenibhar/campus_comm | c4d46925fbd7c3674b07f840b3489f9e7bb53107 | 0378ff7e212759cb4c792879040c9fe7fa418601 | refs/heads/master | 2021-06-02T11:25:28.080895 | 2016-03-13T08:35:33 | 2016-03-13T08:35:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,256 | java | package com.delta.campuscomm;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.ArrayList;
public class ListAdapter extends ArrayAdapter{
ArrayList<String> tagsList;
ArrayList<Boolean> stateList;
public ListAdapter(Context context, int resource
, ArrayList<String> tagsList, ArrayList<Boolean> stateList) {
super(context, resource,tagsList);
this.tagsList = tagsList;
this.stateList = stateList;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(getContext());
View view = inflater.inflate(R.layout.adapter_list, parent, false);
TextView textView = (TextView)view.findViewById(R.id.textView);
textView.setText(tagsList.get(position).toUpperCase());
if(stateList.get(position))
view.setBackgroundColor(getContext().getResources().getColor(R.color.colorCyan));
else
view.setBackgroundColor(getContext().getResources().getColor(R.color.colorPureWhite));
return view;
}
}
| [
"[email protected]"
] | |
4328ac4e5481fc6b6f32b77f93137de2e37d8a51 | c9ca5f961dea20808f4fe713457235c29b715887 | /HW1/src/CoinTossSimulator.java | 8825823ece4c2f1a7655f67b93f4052d2e3444bb | [] | no_license | Caoyoung1991/Various_Coding | cbaad7a37f83e5f5893589178f7333b8d64c662e | 7d6b9534e791002bcf6650c94d1ac086eea617b2 | refs/heads/master | 2020-06-20T17:51:27.205933 | 2016-11-26T21:25:01 | 2016-11-26T21:25:01 | 74,850,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,600 | java | /**Name: Yang Cao
USC loginid: [email protected]
CSCI 455 PA1
Fall 2016
*/
import java.util.Random;
/**
* class CoinTossSimulator
*
* Simulates trials of tossing two coins and allows the user to access the
* cumulative results.
*
* NOTE: we have provided the public interface for this class. Do not change
* the public interface. You can add private instance variables, constants,
* and private methods to the class. You will also be completing the
* implementation of the methods given.
*
* Invariant: getNumTrials() = getTwoHeads() + getTwoTails() + getHeadTails()
*
*/
public class CoinTossSimulator {
private static int numTrials;
private static int numTwoheads;
private static int numTwotails;
private static int numHeadtails;
private static int totalTrials;
private Random generator;
/**
Creates a coin toss simulator with no trials done yet.
*/
public CoinTossSimulator() {
numTrials = 0;
numTwoheads = 0;
numTwotails = 0;
numHeadtails = 0;
totalTrials = 0;
generator = new Random();
}
/**
Runs the simulation for numTrials more trials. Multiple calls to this
without a reset() between them add these trials to the simulation
already completed.
@param numTrials number of trials to for simulation; must be >= 0
*/
public void run(int numTrials) {
totalTrials += numTrials;//to record the total trails
for(int i=0; i<numTrials; i++){//using random() to simulate
switch (generator.nextInt(4)){
case 0: numTwoheads++;
break;
case 1: numTwotails++;
break;
case 2: numHeadtails++;
break;
case 3: numHeadtails++;
break;
}
}
}
/**
Get number of trials performed since last reset.
*/
public int getNumTrials() {
return totalTrials;
}
/**
Get number of trials that came up two heads since last reset.
*/
public int getTwoHeads() {
return numTwoheads;
}
/**
Get number of trials that came up two tails since last reset.
*/
public int getTwoTails() {
return numTwotails;
}
/**
Get number of trials that came up one head and one tail since last reset.
*/
public int getHeadTails() {
return numHeadtails;
}
/**
Resets the simulation, so that subsequent runs start from 0 trials done.
*/
public void reset() {
numTwoheads = 0;//reset all numbers to zero
numTwotails = 0;
numHeadtails = 0;
totalTrials = 0;
}
}
| [
"[email protected]"
] | |
1937565e25af644ae00a4d60b9222ea4604f319a | 93117921bc50ccc534127408d0718fbe1f2dc518 | /src/test/java/com/eagro/web/rest/UserResourceIntTest.java | ee44654f919d2c5bd91a782ac0ca000c1b95be0e | [] | no_license | vrajabasu/eagrobuddy | b86b3ea94689d4838b0f5edfade9e81571bf99aa | cf9b4f1ad1ba2412208597436dcf5ef9c526be0b | refs/heads/master | 2021-06-03T08:38:33.218185 | 2018-08-23T01:22:58 | 2018-08-23T01:22:58 | 131,384,331 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 16,307 | java | /*package com.eagro.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.List;
import javax.persistence.EntityManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import com.eagro.EagroserviceApplication;
import com.eagro.entities.User;
import com.eagro.repository.UserRepository;
import com.eagro.service.UserService;
import com.eagro.service.dto.UserDTO;
import com.eagro.service.exception.ExceptionTranslator;
import com.eagro.service.mapper.UserMapper;
*//**
* Test class for the UserResource REST controller.
*
* @see UserResource
*//*
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = EagroserviceApplication.class)
public class UserResourceIntTest {
private static final Long DEFAULT_USER_ID = 1L;
private static final Long UPDATED_USER_ID = 2L;
private static final String DEFAULT_LOGIN_KEY = "AAAAAAAAAA";
private static final String UPDATED_LOGIN_KEY = "BBBBBBBBBB";
private static final String DEFAULT_PASSWORD = "AAAAAAAAAA";
private static final String UPDATED_PASSWORD = "BBBBBBBBBB";
private static final String DEFAULT_FIRST_NAME = "AAAAAAAAAA";
private static final String UPDATED_FIRST_NAME = "BBBBBBBBBB";
private static final String DEFAULT_MIDDLE_NAME = "AAAAAAAAAA";
private static final String UPDATED_MIDDLE_NAME = "BBBBBBBBBB";
private static final String DEFAULT_LAST_NAME = "AAAAAAAAAA";
private static final String UPDATED_LAST_NAME = "BBBBBBBBBB";
private static final String DEFAULT_EMAIL_ADDRESS = "AAAAAAAAAA";
private static final String UPDATED_EMAIL_ADDRESS = "BBBBBBBBBB";
private static final boolean DEFAULT_ACTIVE_FLAG = Boolean.FALSE;
private static final boolean UPDATED_ACTIVE_FLAG = Boolean.TRUE;
private static final LocalDate DEFAULT_CREATED_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_CREATED_DATE = LocalDate.now(ZoneId.systemDefault());
private static final String DEFAULT_CREATED_BY = "AAAAAAAAAA";
private static final String UPDATED_CREATED_BY = "BBBBBBBBBB";
private static final LocalDate DEFAULT_UPDATED_DATE = LocalDate.ofEpochDay(0L);
private static final LocalDate UPDATED_UPDATED_DATE = LocalDate.now(ZoneId.systemDefault());
private static final String DEFAULT_UPDATED_BY = "AAAAAAAAAA";
private static final String UPDATED_UPDATED_BY = "BBBBBBBBBB";
@Autowired
private UserRepository UserRepository;
@Autowired
private UserMapper UserMapper;
@Autowired
private UserService UserService;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private EntityManager em;
private MockMvc restUserMockMvc;
private User User;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
final UserResource UserResource = new UserResource(UserService);
this.restUserMockMvc = MockMvcBuilders.standaloneSetup(UserResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
// .setControllerAdvice(exceptionTranslator)
// .setConversionService(createFormattingConversionService())
.setMessageConverters(jacksonMessageConverter).build();
}
*//**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*//*
public static User createEntity(EntityManager em) {
User User = new User()
.userId(DEFAULT_USER_ID)
.loginKey(DEFAULT_LOGIN_KEY)
.password(DEFAULT_PASSWORD)
.firstName(DEFAULT_FIRST_NAME)
.middleName(DEFAULT_MIDDLE_NAME)
.lastName(DEFAULT_LAST_NAME)
.emailAddress(DEFAULT_EMAIL_ADDRESS)
.createdDate(DEFAULT_CREATED_DATE)
.createdBy(DEFAULT_CREATED_BY)
.updatedDate(DEFAULT_UPDATED_DATE)
.updatedBy(DEFAULT_UPDATED_BY);
return User;
}
@Before
public void initTest() {
User = createEntity(em);
}
@Test
@Transactional
public void createUser() throws Exception {
int databaseSizeBeforeCreate = UserRepository.findAll().size();
// Create the User
UserDTO UserDTO = UserMapper.toDto(User);
restUserMockMvc.perform(post("/api/eagro-users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(UserDTO)))
.andExpect(status().isCreated());
// Validate the User in the database
List<User> UserList = UserRepository.findAll();
assertThat(UserList).hasSize(databaseSizeBeforeCreate + 1);
User testUser = UserList.get(UserList.size() - 1);
assertThat(testUser.getUserId()).isEqualTo(DEFAULT_USER_ID);
assertThat(testUser.getLoginKey()).isEqualTo(DEFAULT_LOGIN_KEY);
assertThat(testUser.getPassword()).isEqualTo(DEFAULT_PASSWORD);
assertThat(testUser.getFirstName()).isEqualTo(DEFAULT_FIRST_NAME);
assertThat(testUser.getMiddleName()).isEqualTo(DEFAULT_MIDDLE_NAME);
assertThat(testUser.getLastName()).isEqualTo(DEFAULT_LAST_NAME);
assertThat(testUser.getEmailAddress()).isEqualTo(DEFAULT_EMAIL_ADDRESS);
assertThat(testUser.isActiveFlag()).isEqualTo(DEFAULT_ACTIVE_FLAG);
assertThat(testUser.getCreatedDate()).isEqualTo(DEFAULT_CREATED_DATE);
assertThat(testUser.getCreatedBy()).isEqualTo(DEFAULT_CREATED_BY);
assertThat(testUser.getUpdatedDate()).isEqualTo(DEFAULT_UPDATED_DATE);
assertThat(testUser.getUpdatedBy()).isEqualTo(DEFAULT_UPDATED_BY);
}
@Test
@Transactional
public void createUserWithExistingId() throws Exception {
int databaseSizeBeforeCreate = UserRepository.findAll().size();
// Create the User with an existing ID
User.setId(1L);
UserDTO UserDTO = UserMapper.toDto(User);
// An entity with an existing ID cannot be created, so this API call must fail
restUserMockMvc.perform(post("/api/eagro-users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(UserDTO)))
.andExpect(status().isBadRequest());
// Validate the User in the database
List<User> UserList = UserRepository.findAll();
assertThat(UserList).hasSize(databaseSizeBeforeCreate);
}
@Test
@Transactional
public void getAllUsers() throws Exception {
// Initialize the database
UserRepository.saveAndFlush(User);
// Get all the UserList
restUserMockMvc.perform(get("/api/eagro-users?sort=id,desc"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(User.getId().intValue())))
.andExpect(jsonPath("$.[*].userId").value(hasItem(DEFAULT_USER_ID.intValue())))
.andExpect(jsonPath("$.[*].loginKey").value(hasItem(DEFAULT_LOGIN_KEY.toString())))
.andExpect(jsonPath("$.[*].password").value(hasItem(DEFAULT_PASSWORD.toString())))
.andExpect(jsonPath("$.[*].firstName").value(hasItem(DEFAULT_FIRST_NAME.toString())))
.andExpect(jsonPath("$.[*].middleName").value(hasItem(DEFAULT_MIDDLE_NAME.toString())))
.andExpect(jsonPath("$.[*].lastName").value(hasItem(DEFAULT_LAST_NAME.toString())))
.andExpect(jsonPath("$.[*].emailAddress").value(hasItem(DEFAULT_EMAIL_ADDRESS.toString())))
.andExpect(jsonPath("$.[*].activeFlag").value(hasItem(DEFAULT_ACTIVE_FLAG)))
.andExpect(jsonPath("$.[*].createdDate").value(hasItem(DEFAULT_CREATED_DATE.toString())))
.andExpect(jsonPath("$.[*].createdBy").value(hasItem(DEFAULT_CREATED_BY.toString())))
.andExpect(jsonPath("$.[*].updatedDate").value(hasItem(DEFAULT_UPDATED_DATE.toString())))
.andExpect(jsonPath("$.[*].updatedBy").value(hasItem(DEFAULT_UPDATED_BY.toString())));
}
@Test
@Transactional
public void getUser() throws Exception {
// Initialize the database
UserRepository.saveAndFlush(User);
// Get the User
restUserMockMvc.perform(get("/api/eagro-users/{id}", User.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andExpect(jsonPath("$.id").value(User.getId().intValue()))
.andExpect(jsonPath("$.userId").value(DEFAULT_USER_ID.intValue()))
.andExpect(jsonPath("$.loginKey").value(DEFAULT_LOGIN_KEY.toString()))
.andExpect(jsonPath("$.password").value(DEFAULT_PASSWORD.toString()))
.andExpect(jsonPath("$.firstName").value(DEFAULT_FIRST_NAME.toString()))
.andExpect(jsonPath("$.middleName").value(DEFAULT_MIDDLE_NAME.toString()))
.andExpect(jsonPath("$.lastName").value(DEFAULT_LAST_NAME.toString()))
.andExpect(jsonPath("$.emailAddress").value(DEFAULT_EMAIL_ADDRESS.toString()))
.andExpect(jsonPath("$.activeFlag").value(DEFAULT_ACTIVE_FLAG))
.andExpect(jsonPath("$.createdDate").value(DEFAULT_CREATED_DATE.toString()))
.andExpect(jsonPath("$.createdBy").value(DEFAULT_CREATED_BY.toString()))
.andExpect(jsonPath("$.updatedDate").value(DEFAULT_UPDATED_DATE.toString()))
.andExpect(jsonPath("$.updatedBy").value(DEFAULT_UPDATED_BY.toString()));
}
@Test
@Transactional
public void getNonExistingUser() throws Exception {
// Get the User
restUserMockMvc.perform(get("/api/eagro-users/{id}", Long.MAX_VALUE))
.andExpect(status().isNotFound());
}
@Test
@Transactional
public void updateUser() throws Exception {
// Initialize the database
UserRepository.saveAndFlush(User);
int databaseSizeBeforeUpdate = UserRepository.findAll().size();
// Update the User
User updatedUser = UserRepository.findOne(User.getId());
// Disconnect from session so that the updates on updatedUser are not directly saved in db
em.detach(updatedUser);
updatedUser
.userId(UPDATED_USER_ID)
.loginKey(UPDATED_LOGIN_KEY)
.password(UPDATED_PASSWORD)
.firstName(UPDATED_FIRST_NAME)
.middleName(UPDATED_MIDDLE_NAME)
.lastName(UPDATED_LAST_NAME)
.emailAddress(UPDATED_EMAIL_ADDRESS)
.createdDate(UPDATED_CREATED_DATE)
.createdBy(UPDATED_CREATED_BY)
.updatedDate(UPDATED_UPDATED_DATE)
.updatedBy(UPDATED_UPDATED_BY);
UserDTO UserDTO = UserMapper.toDto(updatedUser);
restUserMockMvc.perform(put("/api/eagro-users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(UserDTO)))
.andExpect(status().isOk());
// Validate the User in the database
List<User> UserList = UserRepository.findAll();
assertThat(UserList).hasSize(databaseSizeBeforeUpdate);
User testUser = UserList.get(UserList.size() - 1);
assertThat(testUser.getUserId()).isEqualTo(UPDATED_USER_ID);
assertThat(testUser.getLoginKey()).isEqualTo(UPDATED_LOGIN_KEY);
assertThat(testUser.getPassword()).isEqualTo(UPDATED_PASSWORD);
assertThat(testUser.getFirstName()).isEqualTo(UPDATED_FIRST_NAME);
assertThat(testUser.getMiddleName()).isEqualTo(UPDATED_MIDDLE_NAME);
assertThat(testUser.getLastName()).isEqualTo(UPDATED_LAST_NAME);
assertThat(testUser.getEmailAddress()).isEqualTo(UPDATED_EMAIL_ADDRESS);
assertThat(testUser.isActiveFlag()).isEqualTo(UPDATED_ACTIVE_FLAG);
assertThat(testUser.getCreatedDate()).isEqualTo(UPDATED_CREATED_DATE);
assertThat(testUser.getCreatedBy()).isEqualTo(UPDATED_CREATED_BY);
assertThat(testUser.getUpdatedDate()).isEqualTo(UPDATED_UPDATED_DATE);
assertThat(testUser.getUpdatedBy()).isEqualTo(UPDATED_UPDATED_BY);
}
@Test
@Transactional
public void updateNonExistingUser() throws Exception {
int databaseSizeBeforeUpdate = UserRepository.findAll().size();
// Create the User
UserDTO UserDTO = UserMapper.toDto(User);
// If the entity doesn't have an ID, it will be created instead of just being updated
restUserMockMvc.perform(put("/api/eagro-users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(UserDTO)))
.andExpect(status().isCreated());
// Validate the User in the database
List<User> UserList = UserRepository.findAll();
assertThat(UserList).hasSize(databaseSizeBeforeUpdate + 1);
}
@Test
@Transactional
public void deleteUser() throws Exception {
// Initialize the database
UserRepository.saveAndFlush(User);
int databaseSizeBeforeDelete = UserRepository.findAll().size();
// Get the User
restUserMockMvc.perform(delete("/api/eagro-users/{id}", User.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<User> UserList = UserRepository.findAll();
assertThat(UserList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(User.class);
User User1 = new User();
User1.setId(1L);
User User2 = new User();
User2.setId(User1.getId());
assertThat(User1).isEqualTo(User2);
User2.setId(2L);
assertThat(User1).isNotEqualTo(User2);
User1.setId(null);
assertThat(User1).isNotEqualTo(User2);
}
@Test
@Transactional
public void dtoEqualsVerifier() throws Exception {
TestUtil.equalsVerifier(UserDTO.class);
UserDTO UserDTO1 = new UserDTO();
UserDTO1.setId(1L);
UserDTO UserDTO2 = new UserDTO();
assertThat(UserDTO1).isNotEqualTo(UserDTO2);
UserDTO2.setId(UserDTO1.getId());
assertThat(UserDTO1).isEqualTo(UserDTO2);
UserDTO2.setId(2L);
assertThat(UserDTO1).isNotEqualTo(UserDTO2);
UserDTO1.setId(null);
assertThat(UserDTO1).isNotEqualTo(UserDTO2);
}
@Test
@Transactional
public void testEntityFromId() {
assertThat(UserMapper.fromId(42L).getId()).isEqualTo(42);
assertThat(UserMapper.fromId(null)).isNull();
}
}
*/ | [
"[email protected]"
] | |
0e17f8d238149805502e71b8d7ac981ae8975949 | ce850e44815734719aa892bf7b2390fe8f518b92 | /src/model/CribbageConstants.java | 39757817847d367228c7743772ad94458f3c8876 | [] | no_license | MamdouhAttallah/Java-Concurrency-Example | 5556bece44728afcc8fa380db664ef58e7508ac5 | fbfed1f73c0f645e8529ab5b066bd453712d796b | refs/heads/master | 2021-01-10T17:04:26.106709 | 2016-04-07T01:35:32 | 2016-04-07T01:35:32 | 55,653,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,188 | java | package model;
/**
* Here we define generally useful constants for the game of Cribbage.
*
* Assignment 2: added a contstant for the "ten" card.
*
* @author jim
*/
public interface CribbageConstants {
// the suits
public final static String CLUBS = "C";
public final static String DIAMONDS = "D";
public final static String HEARTS = "H";
public final static String SPADES = "S";
public final static String[] allSuits = {CLUBS, DIAMONDS, HEARTS, SPADES};
// some of the card names
public final static String ACE = "A";
public final static String TEN = "T";
public final static String JACK = "J";
public final static String QUEEN = "Q";
public final static String KING = "K";
public final static String[] allRanks = {ACE, "2", "3", "4", "5", "6", "7", "8", "9", TEN, JACK, QUEEN, KING};
// the board
public final static int FINISH = 121;
// some card stats
public final static int DECK_SIZE = 52;
public final static int HAND_SIZE = 6;
public final static int HIS_NIBS = 1;
public final static int HIS_NOBS = 2;
public final static int PEGGING_MAX = 31;
public final static int FIFTEEN = 15;
}
| [
"[email protected]"
] | |
6792a240096ed0043d16b1908962429254815f20 | 5b9a04d3c911c16aba63258d48606d6ea364a6da | /distribution_purchase/modules/purchase/app/utils/purchase/RegExpValidatorUtils.java | 898b9927d65c021300cec3da0edeb03675992d23 | [
"Apache-2.0"
] | permissive | yourant/repository1 | 40fa5ce602bbcad4e6f61ad6eb1330cfe966f780 | 9ab74a2dfecc3ce60a55225e39597e533975a465 | refs/heads/master | 2021-12-15T04:22:23.009473 | 2017-07-28T06:06:35 | 2017-07-28T06:06:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package utils.purchase;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class RegExpValidatorUtils {
/**
* 验证输入两位小数
* @param 待验证的字符串
* @return 如果是符合格式的字符串,返回 <b>true </b>,否则为 <b>false </b>
*/
public static boolean isDecimal(String str) {
String regex = "^[0-9]+(.[0-9]{2})?$";
return match(regex, str);
}
public static boolean isMoney(String str){
String regex = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$";
return match(regex, str);
}
/**
* @param regex
* 正则表达式字符串
* @param str
* 要匹配的字符串
* @return 如果str 符合 regex的正则表达式格式,返回true, 否则返回 false;
*/
private static boolean match(String regex, String str) {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(str);
return matcher.matches();
}
} | [
"[email protected]"
] | |
bdd7dd4ffc5eab791214c5399c5b06c0d1688c37 | 5282e660bc1e13d8e20522e6a1450ee689209571 | /HibernateCRUD/src/service/RegisterService.java | 34a96596004e078105b1f2288773f5d5b9cf2bd7 | [] | no_license | sreekandank/SKEclipseOxygen | 3c784a5dd123a88892fd01bdeef4b589e856c6ff | ab32f1d90056f17812841400103ecabb6d6da746 | refs/heads/master | 2020-11-28T02:04:49.581818 | 2019-12-23T05:21:37 | 2019-12-23T05:21:37 | 229,675,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package service;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import util.HibernateUtil;
import bean.User;
public class RegisterService {
public boolean register(User user){
Session session = HibernateUtil.openSession();
if(isUserExists(user)) return false;
Transaction tx = null;
try {
tx = session.getTransaction();
tx.begin();
session.saveOrUpdate(user);
tx.commit();
} catch (Exception e) {
if (tx != null) {
tx.rollback();
}
e.printStackTrace();
} finally {
session.close();
}
return true;
}
public boolean isUserExists(User user){
Session session = HibernateUtil.openSession();
boolean result = false;
Transaction tx = null;
try{
tx = session.getTransaction();
tx.begin();
Query query = session.createQuery("from User where userId='"+user.getUserId()+"'");
User u = (User)query.uniqueResult();
tx.commit();
if(u!=null) result = true;
}catch(Exception ex){
if(tx!=null){
tx.rollback();
}
}finally{
session.close();
}
return result;
}
}
| [
"[email protected]"
] | |
7dae1c8d3f4b7eaad9351863ac691ced50bbc076 | bb6455c7071a0e590f194568cd6b5c4bb15c9b08 | /weiit-saas-api/src/main/java/com/weiit/web/util/Base64Util.java | 3b54bd4403acea9e70d0fc109e2a016cc96f3ea2 | [
"Apache-2.0"
] | permissive | beanrootbaob/weiit-saas | b00d2f3adab3c6587d856c06016ba930b2386798 | 2d8816320635e645e045a1e7e67bc6917069dec8 | refs/heads/main | 2023-05-29T20:19:28.847176 | 2021-06-17T07:45:10 | 2021-06-17T07:45:10 | 381,589,885 | 1 | 0 | Apache-2.0 | 2021-06-30T05:50:49 | 2021-06-30T05:50:49 | null | UTF-8 | Java | false | false | 10,724 | java | /*
* Copyright (C) 2010 The MobileSecurePay Project
* All right reserved.
* author: [email protected]
*/
package com.weiit.web.util;
import org.apache.commons.codec.binary.Base64;
public final class Base64Util {
static private final int BASELENGTH = 128;
static private final int LOOKUPLENGTH = 64;
static private final int TWENTYFOURBITGROUP = 24;
static private final int EIGHTBIT = 8;
static private final int SIXTEENBIT = 16;
static private final int FOURBYTE = 4;
static private final int SIGN = -128;
static private final char PAD = '=';
static private final boolean fDebug = false;
static final private byte[] base64Alphabet = new byte[BASELENGTH];
static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
static {
for (int i = 0; i < BASELENGTH; ++i) {
base64Alphabet[i] = -1;
}
for (int i = 'Z'; i >= 'A'; i--) {
base64Alphabet[i] = (byte) (i - 'A');
}
for (int i = 'z'; i >= 'a'; i--) {
base64Alphabet[i] = (byte) (i - 'a' + 26);
}
for (int i = '9'; i >= '0'; i--) {
base64Alphabet[i] = (byte) (i - '0' + 52);
}
base64Alphabet['+'] = 62;
base64Alphabet['/'] = 63;
for (int i = 0; i <= 25; i++) {
lookUpBase64Alphabet[i] = (char) ('A' + i);
}
for (int i = 26, j = 0; i <= 51; i++, j++) {
lookUpBase64Alphabet[i] = (char) ('a' + j);
}
for (int i = 52, j = 0; i <= 61; i++, j++) {
lookUpBase64Alphabet[i] = (char) ('0' + j);
}
lookUpBase64Alphabet[62] = (char) '+';
lookUpBase64Alphabet[63] = (char) '/';
}
private static boolean isWhiteSpace(char octect) {
return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
}
private static boolean isPad(char octect) {
return (octect == PAD);
}
private static boolean isData(char octect) {
return (octect < BASELENGTH && base64Alphabet[octect] != -1);
}
/**
* Encodes hex octects into Base64
*
* @param decode
* @return Encoded Base64 array
*/
public static String encode(Object decode) {
byte[] binaryData =decode.toString().getBytes();
if (binaryData == null) {
return null;
}
int lengthDataBits = binaryData.length * EIGHTBIT;
if (lengthDataBits == 0) {
return "";
}
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
char encodedData[] = null;
encodedData = new char[numberQuartet * 4];
byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
int encodedIndex = 0;
int dataIndex = 0;
if (fDebug) {
System.out.println("number of triplets = " + numberTriplets);
}
for (int i = 0; i < numberTriplets; i++) {
b1 = binaryData[dataIndex++];
b2 = binaryData[dataIndex++];
b3 = binaryData[dataIndex++];
if (fDebug) {
System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
}
l = (byte) (b2 & 0x0f);
k = (byte) (b1 & 0x03);
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
if (fDebug) {
System.out.println("val2 = " + val2);
System.out.println("k4 = " + (k << 4));
System.out.println("vak = " + (val2 | (k << 4)));
}
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
}
// form integral number of 6-bit groups
if (fewerThan24bits == EIGHTBIT) {
b1 = binaryData[dataIndex];
k = (byte) (b1 & 0x03);
if (fDebug) {
System.out.println("b1=" + b1);
System.out.println("b1<<2 = " + (b1 >> 2));
}
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
encodedData[encodedIndex++] = PAD;
encodedData[encodedIndex++] = PAD;
} else if (fewerThan24bits == SIXTEENBIT) {
b1 = binaryData[dataIndex];
b2 = binaryData[dataIndex + 1];
l = (byte) (b2 & 0x0f);
k = (byte) (b1 & 0x03);
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
encodedData[encodedIndex++] = PAD;
}
return new String(encodedData);
}
/**
* Decodes Base64 data into octects
*
* @param encoded string containing Base64 data
* @return Array containind decoded data.
*/
public static byte[] decode(String encoded) {
if (encoded == null) {
return null;
}
char[] base64Data = encoded.toCharArray();
// remove white spaces
int len = removeWhiteSpace(base64Data);
if (len % FOURBYTE != 0) {
return null;//should be divisible by four
}
int numberQuadruple = (len / FOURBYTE);
if (numberQuadruple == 0) {
return new byte[0];
}
byte decodedData[] = null;
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
int i = 0;
int encodedIndex = 0;
int dataIndex = 0;
decodedData = new byte[(numberQuadruple) * 3];
for (; i < numberQuadruple - 1; i++) {
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|| !isData((d3 = base64Data[dataIndex++]))
|| !isData((d4 = base64Data[dataIndex++]))) {
return null;
}//if found "no data" just return null
b1 = base64Alphabet[d1];
b2 = base64Alphabet[d2];
b3 = base64Alphabet[d3];
b4 = base64Alphabet[d4];
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
}
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
return null;//if found "no data" just return null
}
b1 = base64Alphabet[d1];
b2 = base64Alphabet[d2];
d3 = base64Data[dataIndex++];
d4 = base64Data[dataIndex++];
if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
if (isPad(d3) && isPad(d4)) {
if ((b2 & 0xf) != 0)//last 4 bits should be zero
{
return null;
}
byte[] tmp = new byte[i * 3 + 1];
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
return tmp;
} else if (!isPad(d3) && isPad(d4)) {
b3 = base64Alphabet[d3];
if ((b3 & 0x3) != 0)//last 2 bits should be zero
{
return null;
}
byte[] tmp = new byte[i * 3 + 2];
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
return tmp;
} else {
return null;
}
} else { //No PAD e.g 3cQl
b3 = base64Alphabet[d3];
b4 = base64Alphabet[d4];
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
}
return decodedData;
}
/**
* remove WhiteSpace from MIME containing encoded Base64 data.
*
* @param data the byte array of base64 data (with WS)
* @return the new length
*/
private static int removeWhiteSpace(char[] data) {
if (data == null) {
return 0;
}
// count characters that's not whitespace
int newSize = 0;
int len = data.length;
for (int i = 0; i < len; i++) {
if (!isWhiteSpace(data[i])) {
data[newSize++] = data[i];
}
}
return newSize;
}
public static void main(String[] args) {
//加密
System.out.println(encode(19));
String aa = new String(Base64.decodeBase64("eyJleHAiOjE1NDQwNzg3NTYwMjcsInBheWxvYWQiOiJ7XCJzaG9wX2lkXCI6MSxcIm9wZW5faWRfdHlwZVwiOlwiMVwiLFwidXNlcl9pZFwiOlwiMlwiLFwidXNlcl9uYW1lXCI6XCJMXCIsXCJ1c2VyX3Bob25lXCI6XCIxMjJcIixcInVzZXJfaW1nXCI6XCJodHRwOi8vdGhpcmR3eC5xbG9nby5jbi9tbW9wZW4vdmlfMzIvVWpHakpCOXRDYXFqQ2RyS1daTFE1amNPaWNpY2w5WlNyZzFpYVN3QnhsYXhCbGNaZWVOckZiQnhHU09TQzRkZkVibnQ0T2tENnFEMUdrV1RKNm05RXF0VncvMTMyXCIsXCJ3eF9vcGVuX2lkXCI6XCJvQnlscnhKOEdMUGFWVGJ6Vm5mOGFxdV84cFJnXCIsXCJhdXRob3JpemVyX2FwcF9pZFwiOlwid3hkNGYzOTQ1ODZiZTExNDhhXCJ9In0"));
System.out.println(aa);
//解密
// System.out.println(decode("eyJleHAiOjE1NDQwNzkyMjkxNTQsInBheWxvYWQiOiJ7XCJzaG9wX2lkXCI6MSxcIm9wZW5faWRfdHlwZVwiOlwiMVwiLFwidXNlcl9pZFwiOlwiMlwiLFwidXNlcl9uYW1lXCI6XCJMXCIsXCJ3eF9vcGVuX2lkXCI6XCJvQnlscnhKOEdMUGFWVGJ6Vm5mOGFxdV84cFJnXCIsXCJhdXRob3JpemVyX2FwcF9pZFwiOlwid3hkNGYzOTQ1ODZiZTExNDhhXCJ9In0").toString());
}
}
| [
"[email protected]"
] | |
49cb1000d42a428aa87245bb4bce949149965f7a | 1b0a2ae96386370cf435d6a4765274ce05483dc4 | /src/main/java/com/accelad/math/doubledouble/CacheMap.java | 94033dc9fe97f6d23390ed2a3895d031183f7c55 | [
"BSD-2-Clause"
] | permissive | accelad-com/nilgiri-math | f0d40d10a8c65167e9edbac6f7e44c9088fa33b9 | 271726f6e29553e02396a3911947fffd8501ebb6 | refs/heads/master | 2021-01-20T17:09:40.682158 | 2017-12-12T18:57:48 | 2017-12-12T18:57:48 | 62,397,171 | 0 | 0 | null | 2017-12-12T17:21:44 | 2016-07-01T14:05:27 | Java | UTF-8 | Java | false | false | 523 | java | package com.accelad.math.doubledouble;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
class CacheMap<K, V> {
private final Map<K, V> map = new ConcurrentHashMap<>();
private final int sizeLimit;
CacheMap(int sizeLimit) {
this.sizeLimit = sizeLimit;
}
V get(K key, Supplier<V> supplier) {
if (map.size() > sizeLimit) {
map.clear();
}
return map.computeIfAbsent(key, k -> supplier.get());
}
}
| [
"[email protected]"
] | |
4360148c770d0c0e37982d13d3ec7ff8266bc1da | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/7/7_3b41c17b924fa0ce91c791a936d935f9cb0f71ee/TrackbackPlugin/7_3b41c17b924fa0ce91c791a936d935f9cb0f71ee_TrackbackPlugin_t.java | 95e4d151ab604903112da2f3b6d36098344940c5 | [] | 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 | 25,126 | java | /**
* Copyright (c) 2003-2004, David A. Czarnecki
* All rights reserved.
*
* Portions Copyright (c) 2003-2004 by Mark Lussier
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the "David A. Czarnecki" and "blojsom" nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Products derived from this software may not be called "blojsom",
* nor may "blojsom" appear in their name, without prior written permission of
* David A. Czarnecki.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.blojsom.plugin.trackback;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.blojsom.blog.*;
import org.blojsom.plugin.BlojsomPluginException;
import org.blojsom.plugin.common.IPBanningPlugin;
import org.blojsom.plugin.email.EmailUtils;
import org.blojsom.util.BlojsomConstants;
import org.blojsom.util.BlojsomUtils;
import org.blojsom.util.BlojsomMetaDataConstants;
import org.blojsom.fetcher.BlojsomFetcher;
import org.blojsom.fetcher.BlojsomFetcherException;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
/**
* TrackbackPlugin
*
* @author David Czarnecki
* @version $Id: TrackbackPlugin.java,v 1.23 2004-05-03 23:37:05 czarneckid Exp $
*/
public class TrackbackPlugin extends IPBanningPlugin implements BlojsomConstants, BlojsomMetaDataConstants {
private Log _logger = LogFactory.getLog(TrackbackPlugin.class);
/**
* Default prefix for trackback e-mail notification
*/
private static final String DEFAULT_TRACKBACK_PREFIX = "[blojsom] Trackback on: ";
/**
* Initialization parameter for e-mail prefix
*/
public static final String TRACKBACK_PREFIX_IP = "plugin-trackback-email-prefix";
/**
* Initialization parameter for the throttling of trackbacks from IP addresses
*/
public static final String TRACKBACK_THROTTLE_MINUTES_IP = "plugin-trackback-throttle";
/**
* Initialization parameter for disabling trackbacks on entries after a certain number of days
*/
public static final String TRACKBACK_DAYS_EXPIRATION_IP = "plugin-trackback-days-expiration";
/**
* Default throttle value for trackbacks from a particular IP address
*/
private static final int TRACKBACK_THROTTLE_DEFAULT_MINUTES = 5;
/**
* Request parameter to indicate a trackback "tb"
*/
private static final String TRACKBACK_PARAM = "tb";
/**
* Request parameter for the trackback "title"
*/
public static final String TRACKBACK_TITLE_PARAM = "title";
/**
* Request parameter for the trackback "excerpt"
*/
public static final String TRACKBACK_EXCERPT_PARAM = "excerpt";
/**
* Request parameter for the trackback "url"
*/
public static final String TRACKBACK_URL_PARAM = "url";
/**
* Request parameter for the trackback "blog_name"
*/
public static final String TRACKBACK_BLOG_NAME_PARAM = "blog_name";
/**
* Key under which the indicator this plugin is "live" will be placed
* (example: on the request for the JSPDispatcher)
*/
public static final String BLOJSOM_TRACKBACK_PLUGIN_ENABLED = "BLOJSOM_TRACKBACK_PLUGIN_ENABLED";
/**
* Key under which the trackback return code will be placed
* (example: on the request for the JSPDispatcher)
*/
public static final String BLOJSOM_TRACKBACK_RETURN_CODE = "BLOJSOM_TRACKBACK_RETURN_CODE";
/**
* Key under which the trackback error message will be placed
* (example: on the request for the JSPDispatcher)
*/
public static final String BLOJSOM_TRACKBACK_MESSAGE = "BLOJSOM_TRACKBACK_MESSAGE";
/**
* IP address meta-data
*/
public static final String BLOJSOM_TRACKBACK_PLUGIN_METADATA_IP = "BLOJSOM_TRACKBACK_PLUGIN_METADATA_IP";
/**
* Trackback success page
*/
private static final String TRACKBACK_SUCCESS_PAGE = "/trackback-success";
/**
* Trackback failure page
*/
private static final String TRACKBACK_FAILURE_PAGE = "/trackback-failure";
private Map _ipAddressTrackbackTimes;
private BlojsomFetcher _fetcher;
/**
* Default constructor
*/
public TrackbackPlugin() {
}
/**
* Initialize this plugin. This method only called when the plugin is instantiated.
*
* @param servletConfig Servlet config object for the plugin to retrieve any initialization parameters
* @param blojsomConfiguration {@link org.blojsom.blog.BlojsomConfiguration} information
* @throws BlojsomPluginException If there is an error initializing the plugin
*/
public void init(ServletConfig servletConfig, BlojsomConfiguration blojsomConfiguration) throws BlojsomPluginException {
super.init(servletConfig, blojsomConfiguration);
_ipAddressTrackbackTimes = new HashMap(10);
String fetcherClassName = blojsomConfiguration.getFetcherClass();
try {
Class fetcherClass = Class.forName(fetcherClassName);
_fetcher = (BlojsomFetcher) fetcherClass.newInstance();
_fetcher.init(servletConfig, blojsomConfiguration);
_logger.info("Added blojsom fetcher: " + fetcherClassName);
} catch (ClassNotFoundException e) {
_logger.error(e);
throw new BlojsomPluginException(e);
} catch (InstantiationException e) {
_logger.error(e);
throw new BlojsomPluginException(e);
} catch (IllegalAccessException e) {
_logger.error(e);
throw new BlojsomPluginException(e);
} catch (BlojsomFetcherException e) {
_logger.error(e);
throw new BlojsomPluginException(e);
}
}
/**
* Process the blog entries
*
* @param httpServletRequest Request
* @param httpServletResponse Response
* @param user {@link BlogUser} instance
* @param context Context
* @param entries Blog entries retrieved for the particular request
* @return Modified set of blog entries
* @throws BlojsomPluginException If there is an error processing the blog entries
*/
public BlogEntry[] process(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse,
BlogUser user,
Map context,
BlogEntry[] entries) throws BlojsomPluginException {
Blog blog = user.getBlog();
context.put(BLOJSOM_TRACKBACK_PLUGIN_ENABLED, blog.getBlogTrackbacksEnabled());
if (!blog.getBlogTrackbacksEnabled().booleanValue()) {
_logger.debug("blog trackbacks not enabled for user: " + user.getId());
return entries;
}
String[] _blogFileExtensions;
String _blogHome;
String _blogTrackbackDirectory;
Boolean _blogEmailEnabled;
Boolean _blogTrackbacksEnabled;
String _blogUrlPrefix;
String _blogFileEncoding;
String _emailPrefix;
_blogFileExtensions = blog.getBlogFileExtensions();
_blogHome = blog.getBlogHome();
_blogTrackbackDirectory = blog.getBlogTrackbackDirectory();
_blogEmailEnabled = blog.getBlogEmailEnabled();
_blogTrackbacksEnabled = blog.getBlogTrackbacksEnabled();
_blogUrlPrefix = blog.getBlogURL();
_blogFileEncoding = blog.getBlogFileEncoding();
_emailPrefix = blog.getBlogProperty(TRACKBACK_PREFIX_IP);
if (_emailPrefix == null) {
_emailPrefix = DEFAULT_TRACKBACK_PREFIX;
}
if (entries.length == 0) {
return entries;
}
if (!_blogTrackbacksEnabled.booleanValue()) {
return entries;
}
String bannedIPListParam = blog.getBlogProperty(BANNED_IP_ADDRESSES_IP);
String[] bannedIPList;
if (bannedIPListParam == null) {
bannedIPList = null;
_logger.info("Blog configuration parameter not supplied for: " + BANNED_IP_ADDRESSES_IP);
} else {
bannedIPList = BlojsomUtils.parseCommaList(bannedIPListParam);
}
// Check for a trackback from a banned IP address
String remoteIPAddress = httpServletRequest.getRemoteAddr();
if (isIPBanned(bannedIPList, remoteIPAddress)) {
_logger.debug("Attempted trackback from banned IP address: " + remoteIPAddress);
return entries;
}
String category = httpServletRequest.getPathInfo();
if (category == null) {
category = "/";
} else if (!category.endsWith("/")) {
category += "/";
}
if (category.startsWith("/" + user.getId() + "/")) {
category = BlojsomUtils.getCategoryFromPath(category);
}
String url = httpServletRequest.getParameter(TRACKBACK_URL_PARAM);
String permalink = httpServletRequest.getParameter(PERMALINK_PARAM);
String title = httpServletRequest.getParameter(TRACKBACK_TITLE_PARAM);
String excerpt = httpServletRequest.getParameter(TRACKBACK_EXCERPT_PARAM);
String blogName = httpServletRequest.getParameter(TRACKBACK_BLOG_NAME_PARAM);
String tb = httpServletRequest.getParameter(TRACKBACK_PARAM);
String entryTitle = entries[0].getTitle();
if ((permalink != null) && (!"".equals(permalink)) && (tb != null) && ("y".equalsIgnoreCase(tb))) {
if ((url == null) || ("".equals(url.trim()))) {
context.put(BLOJSOM_TRACKBACK_RETURN_CODE, new Integer(1));
context.put(BLOJSOM_TRACKBACK_MESSAGE, "No url parameter for trackback. url must be specified.");
httpServletRequest.setAttribute(PAGE_PARAM, TRACKBACK_FAILURE_PAGE);
return entries;
}
// Check for trackback throttling
String trackbackThrottleValue = blog.getBlogProperty(TRACKBACK_THROTTLE_MINUTES_IP);
if (!BlojsomUtils.checkNullOrBlank(trackbackThrottleValue)) {
int trackbackThrottleMinutes;
try {
trackbackThrottleMinutes = Integer.parseInt(trackbackThrottleValue);
} catch (NumberFormatException e) {
trackbackThrottleMinutes = TRACKBACK_THROTTLE_DEFAULT_MINUTES;
}
_logger.debug("Trackback throttling enabled at: " + trackbackThrottleMinutes + " minutes");
remoteIPAddress = httpServletRequest.getRemoteAddr();
if (_ipAddressTrackbackTimes.containsKey(remoteIPAddress)) {
Calendar currentTime = Calendar.getInstance();
Calendar timeOfLastTrackback = (Calendar) _ipAddressTrackbackTimes.get(remoteIPAddress);
long timeDifference = currentTime.getTimeInMillis() - timeOfLastTrackback.getTimeInMillis();
long differenceInMinutes = timeDifference / (60 * 1000);
if (differenceInMinutes < trackbackThrottleMinutes) {
_logger.debug("Trackback throttle enabled. Comment from IP address: " + remoteIPAddress + " in less than " + trackbackThrottleMinutes + " minutes");
context.put(BLOJSOM_TRACKBACK_RETURN_CODE, new Integer(1));
context.put(BLOJSOM_TRACKBACK_MESSAGE, "Trackback throttling enabled.");
httpServletRequest.setAttribute(PAGE_PARAM, TRACKBACK_FAILURE_PAGE);
return entries;
} else {
_logger.debug("Trackback throttle enabled. Resetting date of last comment to current time");
_ipAddressTrackbackTimes.put(remoteIPAddress, currentTime);
}
} else {
Calendar calendar = Calendar.getInstance();
_ipAddressTrackbackTimes.put(remoteIPAddress, calendar);
}
}
url = url.trim();
if (BlojsomUtils.checkNullOrBlank(title)) {
title = url;
} else {
title = title.trim();
}
if (excerpt == null) {
excerpt = "";
} else {
if (excerpt.length() >= 255) {
excerpt = excerpt.substring(0, 252);
excerpt += "...";
}
excerpt = BlojsomUtils.stripLineTerminators(excerpt);
}
if (blogName == null) {
blogName = "";
} else {
blogName = blogName.trim();
blogName = BlojsomUtils.stripLineTerminators(blogName);
}
if (!category.endsWith("/")) {
category += "/";
}
// Check to see if comments have been disabled for this blog entry
BlogCategory blogCategory = _fetcher.newBlogCategory();
blogCategory.setCategory(category);
blogCategory.setCategoryURL(user.getBlog().getBlogURL() + BlojsomUtils.removeInitialSlash(category));
Map fetchMap = new HashMap();
fetchMap.put(BlojsomFetcher.FETCHER_CATEGORY, blogCategory);
fetchMap.put(BlojsomFetcher.FETCHER_PERMALINK, permalink);
try {
BlogEntry[] fetchedEntries = _fetcher.fetchEntries(fetchMap, user);
if (entries.length > 0) {
BlogEntry entry = fetchedEntries[0];
if (BlojsomUtils.checkMapForKey(entry.getMetaData(), BLOG_METADATA_TRACKBACKS_DISABLED)) {
_logger.debug("Trackbacks have been disabled for blog entry: " + entry.getId());
context.put(BLOJSOM_TRACKBACK_MESSAGE, "Trackbacks have been disabled for this blog entry");
context.put(BLOJSOM_TRACKBACK_RETURN_CODE, new Integer(1));
httpServletRequest.setAttribute(PAGE_PARAM, TRACKBACK_FAILURE_PAGE);
return entries;
}
// Check for a trackback where the number of days between trackback auto-expiration has passed
String trackbackDaysExpiration = blog.getBlogProperty(TRACKBACK_DAYS_EXPIRATION_IP);
if (!BlojsomUtils.checkNullOrBlank(trackbackDaysExpiration)) {
try {
int daysExpiration = Integer.parseInt(trackbackDaysExpiration);
int daysBetweenDates = BlojsomUtils.daysBetweenDates(entry.getDate(), new Date());
if ((daysExpiration > 0) && (daysBetweenDates >= daysExpiration)) {
_logger.debug("Trackback period for this entry has expired. Expiration period set at " + daysExpiration + " days. Difference in days: " + daysBetweenDates);
return entries;
}
} catch (NumberFormatException e) {
_logger.error("Error in parameter " + TRACKBACK_DAYS_EXPIRATION_IP + ": " + trackbackDaysExpiration);
}
}
}
} catch (BlojsomFetcherException e) {
_logger.error(e);
}
Map trackbackMetaData = new HashMap();
trackbackMetaData.put(BLOJSOM_TRACKBACK_PLUGIN_METADATA_IP, remoteIPAddress);
Integer code = addTrackback(context, category, permalink, title, excerpt, url, blogName,
_blogFileExtensions, _blogHome, _blogTrackbackDirectory,
_blogFileEncoding, trackbackMetaData);
// For persisting the Last-Modified time
context.put(BLOJSOM_LAST_MODIFIED, new Long(new Date().getTime()));
if (_blogEmailEnabled.booleanValue()) {
sendTrackbackEmail(entryTitle, title, category, permalink, url, excerpt, blogName, context,
_blogUrlPrefix, _emailPrefix);
}
context.put(BLOJSOM_TRACKBACK_RETURN_CODE, code);
if (code.intValue() == 0) {
httpServletRequest.setAttribute(PAGE_PARAM, TRACKBACK_SUCCESS_PAGE);
} else {
httpServletRequest.setAttribute(PAGE_PARAM, TRACKBACK_FAILURE_PAGE);
}
}
return entries;
}
/**
* Add a trackback to the permalink entry
*
* @param category Category where the permalink exists
* @param permalink Permalink
* @param title Trackback title
* @param excerpt Excerpt for the trackback (not more than 255 characters in length)
* @param url URL for the trackback
* @param blogName Name of the blog making the trackback
*/
private Integer addTrackback(Map context, String category, String permalink, String title,
String excerpt, String url, String blogName,
String[] blogFileExtensions, String blogHome,
String blogTrackbackDirectory, String blogFileEncoding, Map trackbackMetaData) {
Trackback trackback = new Trackback();
excerpt = BlojsomUtils.escapeMetaAndLink(excerpt);
trackback.setTitle(title);
trackback.setExcerpt(excerpt);
trackback.setUrl(url);
trackback.setBlogName(blogName);
trackback.setTrackbackDateLong(new Date().getTime());
trackback.setMetaData(trackbackMetaData);
StringBuffer trackbackDirectory = new StringBuffer();
String permalinkFilename = BlojsomUtils.getFilenameForPermalink(permalink, blogFileExtensions);
permalinkFilename = BlojsomUtils.urlDecode(permalinkFilename);
if (permalinkFilename == null) {
_logger.debug("Invalid permalink trackback for: " + permalink);
context.put(BLOJSOM_TRACKBACK_MESSAGE, "Invalid permalink trackback for: " + permalink);
return new Integer(1);
}
trackbackDirectory.append(blogHome);
trackbackDirectory.append(BlojsomUtils.removeInitialSlash(category));
File blogEntry = new File(trackbackDirectory.toString() + File.separator + permalinkFilename);
if (!blogEntry.exists()) {
_logger.error("Trying to create trackback for invalid blog entry: " + permalink);
context.put(BLOJSOM_TRACKBACK_MESSAGE, "Trying to create trackback for invalid permalink: " + category + permalinkFilename);
return new Integer(1);
}
trackbackDirectory.append(blogTrackbackDirectory);
trackbackDirectory.append(File.separator);
trackbackDirectory.append(permalinkFilename);
trackbackDirectory.append(File.separator);
String trackbackFilename = trackbackDirectory.toString() + trackback.getTrackbackDateLong() + TRACKBACK_EXTENSION;
trackback.setId(trackback.getTrackbackDateLong() + TRACKBACK_EXTENSION);
File trackbackDir = new File(trackbackDirectory.toString());
if (!trackbackDir.exists()) {
if (!trackbackDir.mkdirs()) {
_logger.error("Could not create directory for trackbacks: " + trackbackDirectory);
context.put(BLOJSOM_TRACKBACK_MESSAGE, "Could not create directory for trackbacks");
return new Integer(1);
}
}
File trackbackEntry = new File(trackbackFilename);
try {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(trackbackEntry), blogFileEncoding));
bw.write(BlojsomUtils.nullToBlank(trackback.getTitle()).trim());
bw.newLine();
bw.write(BlojsomUtils.nullToBlank(trackback.getExcerpt()).trim());
bw.newLine();
bw.write(BlojsomUtils.nullToBlank(trackback.getUrl()).trim());
bw.newLine();
bw.write(BlojsomUtils.nullToBlank(trackback.getBlogName()).trim());
bw.newLine();
bw.close();
_logger.debug("Added trackback: " + trackbackFilename);
Properties trackbackMetaDataProperties = BlojsomUtils.mapToProperties(trackbackMetaData, UTF8);
String trackbackMetaDataFilename = BlojsomUtils.getFilename(trackbackEntry.toString()) + DEFAULT_METADATA_EXTENSION;
trackbackMetaDataProperties.store(new FileOutputStream(new File(trackbackMetaDataFilename)), null);
_logger.debug("Wrote trackback meta-data: " + trackbackMetaDataFilename);
} catch (IOException e) {
_logger.error(e);
context.put(BLOJSOM_TRACKBACK_MESSAGE, "I/O error on trackback write.");
return new Integer(1);
}
return new Integer(0);
}
/**
* Send Trackback Email to Blog Author
*
* @param entryTitle Blog Entry title for this Trackback
* @param title title of trackback entry
* @param category catagory for trackbacked entry
* @param permalink permalink for trackbacked entry
* @param url URL of site tracking back
* @param excerpt excerpt of trackback post
* @param blogName Title of trackbacking blog
* @param context Context
*/
private void sendTrackbackEmail(String entryTitle, String title, String category, String permalink, String url,
String excerpt, String blogName, Map context,
String blogUrlPrefix, String emailPrefix) {
StringBuffer _trackback = new StringBuffer();
_trackback.append("Trackback on: ").append(blogUrlPrefix).append(BlojsomUtils.removeInitialSlash(category));
_trackback.append("?permalink=").append(permalink).append("&page=trackback").append("\n");
_trackback.append("\n==[ Trackback ]==========================================================").append("\n\n");
if (title != null && !title.equals("")) {
_trackback.append("Title : ").append(title).append("\n");
}
if (url != null && !url.equals("")) {
_trackback.append("Url : ").append(url).append("\n");
}
if (blogName != null && !blogName.equals("")) {
_trackback.append("Blog Name: ").append(blogName).append("\n");
}
if (excerpt != null && !excerpt.equals("")) {
_trackback.append("Excerpt : ").append(excerpt).append("\n");
}
EmailUtils.notifyBlogAuthor(emailPrefix + entryTitle, _trackback.toString(), context);
}
/**
* Perform any cleanup for the plugin. Called after {@link #process}.
*
* @throws BlojsomPluginException If there is an error performing cleanup for this plugin
*/
public void cleanup() throws BlojsomPluginException {
}
/**
* Called when BlojsomServlet is taken out of service
*
* @throws BlojsomPluginException If there is an error in finalizing this plugin
*/
public void destroy() throws BlojsomPluginException {
}
}
| [
"[email protected]"
] | |
4d720bf82aa36603157eb2a9e9a508746977a7c6 | 11dcf260ca16503d1972bcfc7781c6596b70fa65 | /java/com/imooc/sell/service/impl/FlowImpl.java | 48bb9748b896bd7d17f17c0cda163725ab2f713d | [] | no_license | 2017LLLLL/weChatSell | 3e30bb14efafb61d5032479e3eddc6e721771be8 | 9d6f617ca914e1cf009f8b77ef87ba79e72c8a8c | refs/heads/master | 2022-04-23T00:54:33.819575 | 2020-04-11T14:43:23 | 2020-04-11T14:43:23 | 254,886,272 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 784 | java | package com.imooc.sell.service.impl;
import com.imooc.sell.dao.FlowDao;
import com.imooc.sell.dataobject.Flow;
import com.imooc.sell.service.FlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @program: sell
* @description: 流水订单服务层
* @author: flj
* @create: 2020-03-04 12:31
**/
@Service
public class FlowImpl implements FlowService {
@Autowired
private FlowDao flowDao;
@Override
public Flow findone(Integer id) {
return flowDao.findOne(id);
}
@Override
public Flow save(Flow flow) {
return flowDao.save(flow);
}
@Override
public Flow findByOrderNum(Integer orderId) {
return flowDao.findByOrderNum(orderId);
}
}
| [
"[email protected]"
] | |
2e96b0b16952d369352e21541a57754e448de6e7 | 62f0a7288114eda8968a76960cfc4ba94def733e | /edu.rice.cs.hpc.traceviewer/src/edu/rice/cs/hpc/traceviewer/summary/HPCSummaryView.java | 35bd18db9af7f178efe62f91dba8bf33248b139f | [] | no_license | daddddd/hpcviewer | bd2aebc019c5f46b7208b80d1c9bb18f97af767f | b1de398cfeaf8a460581ff4611d829d417d80b56 | refs/heads/master | 2021-01-10T12:42:48.949100 | 2015-08-12T20:06:48 | 2015-08-12T20:06:48 | 52,604,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,763 | java | package edu.rice.cs.hpc.traceviewer.summary;
import java.util.Map;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.ISourceProvider;
import org.eclipse.ui.ISourceProviderListener;
import org.eclipse.ui.services.ISourceProviderService;
import edu.rice.cs.hpc.traceviewer.services.DataService;
import edu.rice.cs.hpc.traceviewer.spaceTimeData.SpaceTimeDataController;
import edu.rice.cs.hpc.traceviewer.ui.AbstractTimeView;
/*************************************************************************
*
* View part of the summary window
*
*************************************************************************/
public class HPCSummaryView extends AbstractTimeView
{
public static final String ID = "hpcsummaryview.view";
/**The canvas that actually displays this view*/
SummaryTimeCanvas summaryCanvas;
public void createPartControl(Composite master)
{
/*************************************************************************
* Master Composite
*/
master.setLayout(new GridLayout());
master.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
/*************************************************************************
* Summary View Canvas
*/
summaryCanvas = new SummaryTimeCanvas(master);
summaryCanvas.setLayout(new GridLayout());
summaryCanvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
summaryCanvas.setVisible(false);
setListener();
super.addListener();
}
private void setListener() {
ISourceProviderService service = (ISourceProviderService)getSite().getService(ISourceProviderService.class);
ISourceProvider serviceProvider = service.getSourceProvider(DataService.DATA_UPDATE);
serviceProvider.addSourceProviderListener( new ISourceProviderListener(){
public void sourceChanged(int sourcePriority, Map sourceValuesByName) { }
public void sourceChanged(int sourcePriority, String sourceName,
Object sourceValue) {
// eclipse bug: even if we set a very specific source provider, eclipse still
// gather event from other source. we then require to put a guard to avoid this.
if (sourceName.equals(DataService.DATA_UPDATE)) {
summaryCanvas.redraw();
}
}
});
}
public void updateView(SpaceTimeDataController dataTraces)
{
summaryCanvas.updateData(dataTraces);
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
public void setFocus()
{
summaryCanvas.setFocus();
}
@Override
public void active(boolean isActive)
{
summaryCanvas.activate(isActive);
}
}
| [
"[email protected]"
] | |
a387d4c3bd90a3e15cbbf5fb067ed39047cfcdce | 491dd4b68c36ae0e8b1c1a55a888c5b2db63c402 | /app/src/main/java/com/ns/yc/lifehelper/ui/other/douBook/view/fragment/DouBookFragment.java | deb3e1eda51916b44c1d62562406a1abf49399de | [] | no_license | zhaozw/LifeHelper | bc2794b42cf33ee147a70c9ea1e1dab586c9d133 | 2dd21f6319a84bb45fd73714b71edcdb29f859f3 | refs/heads/master | 2021-04-29T11:43:54.479555 | 2018-02-11T03:29:38 | 2018-02-11T03:29:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,347 | java | package com.ns.yc.lifehelper.ui.other.douBook.view.fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.widget.Toast;
import com.blankj.utilcode.util.NetworkUtils;
import com.ns.yc.lifehelper.R;
import com.ns.yc.lifehelper.base.mvp1.BaseFragment;
import com.ns.yc.lifehelper.ui.other.douBook.view.DouBookActivity;
import com.ns.yc.lifehelper.ui.other.douBook.view.activity.DouBookDetailActivity;
import com.ns.yc.lifehelper.ui.other.douBook.adapter.DouBookAdapter;
import com.ns.yc.lifehelper.ui.other.douBook.bean.DouBookBean;
import com.ns.yc.lifehelper.ui.other.douBook.model.DouBookModel;
import com.ns.yc.lifehelper.ui.weight.manager.FullyGridLayoutManager;
import org.yczbj.ycrefreshviewlib.YCRefreshView;
import org.yczbj.ycrefreshviewlib.adapter.RecyclerArrayAdapter;
import butterknife.Bind;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* ================================================
* 作 者:杨充
* 版 本:1.0
* 创建日期:2017/8/22
* 描 述:豆瓣读书页面
* 修订历史:
* ================================================
*/
public class DouBookFragment extends BaseFragment {
private static final String TYPE = "";
@Bind(R.id.recyclerView)
YCRefreshView recyclerView;
private DouBookActivity activity;
private String mType;
private DouBookAdapter adapter;
public static DouBookFragment newInstance(String param1) {
DouBookFragment fragment = new DouBookFragment();
Bundle args = new Bundle();
args.putString(TYPE, param1);
fragment.setArguments(args);
return fragment;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
activity = (DouBookActivity) context;
}
@Override
public void onDetach() {
super.onDetach();
activity = null;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
Bundle arguments = getArguments();
mType = arguments.getString(TYPE);
}
}
@Override
public int getContentView() {
return R.layout.base_easy_recycle;
}
@Override
public void initView() {
initRecycleView();
}
@Override
public void initListener() {
adapter.setOnItemClickListener(new RecyclerArrayAdapter.OnItemClickListener() {
@Override
public void onItemClick(int position) {
Intent intent = new Intent(activity, DouBookDetailActivity.class);
intent.putExtra("title",adapter.getAllData().get(position).getTitle());
intent.putExtra("author",adapter.getAllData().get(position).getAuthor().get(0));
intent.putExtra("image",adapter.getAllData().get(position).getImage());
intent.putExtra("average",adapter.getAllData().get(position).getRating().getAverage());
intent.putExtra("numRaters",String.valueOf(adapter.getAllData().get(position).getRating().getNumRaters()));
intent.putExtra("pubdate",adapter.getAllData().get(position).getPubdate());
intent.putExtra("publisher",adapter.getAllData().get(position).getPublisher());
intent.putExtra("id",adapter.getAllData().get(position).getId());
intent.putExtra("alt",adapter.getAllData().get(position).getAlt());
startActivity(intent);
}
});
}
@Override
public void initData() {
recyclerView.showProgress();
getTopMovieData(mType , 0 , 30);
}
private void initRecycleView() {
recyclerView.setLayoutManager(new FullyGridLayoutManager(activity, 3));
adapter = new DouBookAdapter(activity);
recyclerView.setAdapter(adapter);
//加载更多
adapter.setMore(R.layout.view_recycle_more, new RecyclerArrayAdapter.OnMoreListener() {
@Override
public void onMoreShow() {
if (NetworkUtils.isConnected()) {
if (adapter.getAllData().size() > 0) {
getTopMovieData(mType, adapter.getAllData().size(), adapter.getAllData().size() + 21);
} else {
adapter.pauseMore();
}
} else {
adapter.pauseMore();
Toast.makeText(activity, "网络不可用", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onMoreClick() {
}
});
//设置没有数据
adapter.setNoMore(R.layout.view_recycle_no_more, new RecyclerArrayAdapter.OnNoMoreListener() {
@Override
public void onNoMoreShow() {
if (NetworkUtils.isConnected()) {
adapter.resumeMore();
} else {
Toast.makeText(activity, "网络不可用", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onNoMoreClick() {
if (NetworkUtils.isConnected()) {
adapter.resumeMore();
} else {
Toast.makeText(activity, "网络不可用", Toast.LENGTH_SHORT).show();
}
}
});
//设置错误
adapter.setError(R.layout.view_recycle_error, new RecyclerArrayAdapter.OnErrorListener() {
@Override
public void onErrorShow() {
adapter.resumeMore();
}
@Override
public void onErrorClick() {
adapter.resumeMore();
}
});
//刷新
recyclerView.setRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (NetworkUtils.isConnected()) {
getTopMovieData(mType , 0 , 30);
} else {
recyclerView.setRefreshing(false);
Toast.makeText(activity, "网络不可用", Toast.LENGTH_SHORT).show();
}
}
});
}
private void getTopMovieData(String mType , final int start, int count) {
DouBookModel model = DouBookModel.getInstance(activity);
model.getHotMovie(mType,start,count)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<DouBookBean>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
recyclerView.showError();
recyclerView.setErrorView(R.layout.view_custom_empty_data);
}
@Override
public void onNext(DouBookBean bookBean) {
if(adapter==null){
adapter = new DouBookAdapter(activity);
}
if(start==0){
if(bookBean!=null && bookBean.getBooks()!=null && bookBean.getBooks().size()>0){
adapter.clear();
adapter.addAll(bookBean.getBooks());
adapter.notifyDataSetChanged();
} else {
recyclerView.showEmpty();
recyclerView.setEmptyView(R.layout.view_custom_empty_data);
}
} else {
if(bookBean!=null && bookBean.getBooks()!=null && bookBean.getBooks().size()>0){
adapter.addAll(bookBean.getBooks());
adapter.notifyDataSetChanged();
} else {
adapter.stopMore();
}
}
}
});
}
}
| [
"[email protected]"
] | |
d1adb5d69cc986a12e7cc4b460c760ab11278916 | 32b918ea98702dc01f508af434beef2f4aca25d6 | /P3_Final/PracticaFinal/src/indexacion/Localizacion.java | bfd0f3eefb08836c0a8ca48836b1aa1fb54624dc | [] | no_license | jcgq/RecuperacionInformacion_UGR | d5aeec05f2ab8cdf3be4e508af12c35c4336828a | 434c98d57a44e3de794ed7f668694ebbd9b20889 | refs/heads/main | 2023-04-30T15:23:08.480230 | 2021-05-21T15:40:58 | 2021-05-21T15:40:58 | 369,578,094 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 493 | java |
package indexacion;
import com.fasterxml.jackson.databind.JsonNode;
class Localizacion {
String lugar;
String pais;
Localizacion(){
lugar = "Desconocido";
pais = "Desconocido";
}
public void setLugar(String _lugar){
lugar=_lugar;
}
public void setPais(String _pais){
pais=_pais;
}
public String getLugar(){
return lugar;
}
public String getPais(){
return pais;
}
}
| [
"[email protected]"
] | |
eeac21e4e1925599403de24147ffa48b4ba629d9 | ae986cac9f6810bc2c145f0c4f9938f4e3034b55 | /Spring_Infearn/Web_RTC_Ex2/src/main/java/org/nextrtc/examples/videochat_with_rest/domain/User.java | 1750f1f0172e6edd30387094716a9d4fdc9e4d02 | [
"MIT"
] | permissive | satelite54/BUSAN_IT_ACADEMY | 975e3b9cdd39a1839dd7c01458ac904e6895f5f0 | e2fc06f3f1847edaa1641acab8d49d87943863fb | refs/heads/main | 2023-04-22T21:34:56.899605 | 2021-05-14T15:52:09 | 2021-05-14T15:52:09 | 307,250,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,626 | java | package org.nextrtc.examples.videochat_with_rest.domain;
import org.nextrtc.examples.videochat_with_rest.domain.history.History;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "Users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "user_id")
private int id;
@Column(name = "username")
private String username;
@Column(name = "password")
private String password;
@Column(name = "auth_provider_id")
private String authProviderId;
@Column(name = "confirmation_key")
private String confirmationKey;
@Column(name = "role")
private String role = "USER";
@Column(name = "email")
private String email;
@Column(name = "confirmed")
private boolean confirmed = false;
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY)
private Set<Member> conversationMember;
@Deprecated
User() {
}
public User(String username, String password, String email, String confirmationKey) {
this.username = username;
this.password = password;
this.email = email;
this.confirmationKey = confirmationKey;
}
public User(String username, String email, String authProviderId) {
this.username = username;
this.email = email;
this.authProviderId = authProviderId;
confirmed = true;
}
public String getUsername() {
return username;
}
public void confirmEmail() {
confirmed = true;
}
public History prepareHistory() {
return new History(conversationMember);
}
}
| [
"[email protected]"
] | |
7de22c629b3e2acf242b407ab914bef243dc6c86 | 3ca4e3a41a284f90800d956dca971396cb8ff9c2 | /src/Trivia/Game.java | f3d93d7198c081189d41e2523ff1e0a801d01f9b | [] | no_license | yosefabush/TriviaGame | 0b0ea882bb130b73fa2a4970ec122dcdddc042d6 | 1e69c469cb5aacc0d6112b1fd19d5677381f6c02 | refs/heads/master | 2020-12-25T16:54:41.221251 | 2016-08-11T17:12:33 | 2016-08-11T17:12:33 | 50,916,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,071 | java | package Trivia;
import java.io.IOException;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* This class contain all the logic of the game
*
* @author Yosef
*/
public class Game {
/**
*
*/
private static User current;
/**
*This collection variable will hold all the question from the DataBase
*/
private static ArrayList<Question> allQuesFromDB = new <Question>ArrayList();
/**
*
*/
private static int level;
/**
* Game constructor
*
* @param wantedQuestion
* @param current
* @param newGame
* @param level
* @throws Exception
*/
public Game(int wantedQuestion, User current, boolean newGame, int level) throws Exception {
if (newGame == true) { //if is new game need to clear thee arreyList and full it from DB
this.level = level;
this.allQuesFromDB.clear();
this.allQuesFromDB = DataBaseMange.getInstance().getQuestion();
}
this.current = current;
try {
Play(wantedQuestion);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Start game method
* @param remainingQues
* @throws Exception
*/
public void Play(int remainingQues) throws Exception {
Random rand = new Random();
// validation no duplcate ques
int random = 0;
while (remainingQues > 0) {
random = rand.nextInt(allQuesFromDB.size());
if (level != 0) {
if (allQuesFromDB.get(random).getCheekIfQuesWasAsked() == false && allQuesFromDB.get(random).getLevel() == level) {
allQuesFromDB.get(random).setCheekIfQuesWasAsked(true);
break;
}
} else if (allQuesFromDB.get(random).getCheekIfQuesWasAsked() == false) {
allQuesFromDB.get(random).setCheekIfQuesWasAsked(true);
break;
}
}
FormClass f1;
TotalSummry finisGame;
if (remainingQues > 0) {
f1 = new FormClass(allQuesFromDB.get(random), remainingQues, current, level);
} else {
int score = FormClass.point;
current.setPoints(FormClass.point); //set the point to the current player just when game over
FormClass.point = 0; //set the static varibale to zero
FormClass.currentLevel = 0; //set the static varibale to zero
if (SelectGame.multiPlayerGame == false) {
System.out.println("Finish single player game");
if (updateFinalScore(current)) {//cheek if the point of current player get new high score and update in DB
finisGame = new TotalSummry(current, "NewHigScor"); //open summery screen
finisGame.setVisible(true);
} else {
System.out.println("Update score Faild mybe your have highr score in DB...");
finisGame = new TotalSummry(current, "YouCanBetrr");//in the end show summry point
finisGame.setVisible(true);
}
} else {
System.out.println("Finish multi player game");
sendToServerTotalScore(current, score);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
TotalSummry total = new TotalSummry(current, SelectGame.ois.readObject().toString(), true);
total.setVisible(true);
} catch (IOException ex) {
Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
thread.start();
}
}
}
/**
*this method try to update the score of the player in DB if the score
* that player get higher from what he has in DB
* @param player Object
* @return boolean true or false
*/
public boolean updateFinalScore(User player) {
try {
Class.forName(DbUtilitis.dbDriver); //load the rigt server
Connection connection
= DriverManager.getConnection(DbUtilitis.jdbcUrl,
DbUtilitis.jdbcUser,
DbUtilitis.jdbcPassword);
PreparedStatement ps = connection.prepareStatement("update tblrecords set Score='" + player.getPoints() + "'where tblrecords.UserID='" + player.getUserID() + "'and tblrecords.`Score`<'" + player.getPoints() + "'");
int res = ps.executeUpdate();
if (res > 0) {
ps.close();
return true;
} else {
ps.close();
return false;
}
} catch (SQLException sqle) {
System.out.println("SQLException: " + sqle.getMessage());
System.out.println("Vendor Error: " + sqle.getErrorCode());
return false;
} catch (ClassNotFoundException e) {
e.printStackTrace();
return false;
}
}
/**
* this method send the total score to server and the server tell us how is
* the winner between the players
*
* @param player
* @param score
*
*/
public void sendToServerTotalScore(User player, int score) {
try {
SelectGame.oos.writeObject(player);
} catch (IOException ex) {
Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"[email protected]"
] | |
fe2abe3a330000cff56f3b03e68067f43dcad200 | d0e4909a6e527a3dcbc102fb571ab01ee593e6c7 | /app/src/main/java/com/example/asus/toolbar/MainActivity.java | 31915d07bdaa525e1d5638c22196fda481101acb | [] | no_license | hexianzhi/zhihu | 5ddb57fc469924cd0b0e43db191534219b09ded0 | bfeca7c0877817d3e62b8141eee0c3cf6c2889ce | refs/heads/master | 2021-01-10T10:43:48.596638 | 2016-03-02T13:54:56 | 2016-03-02T13:54:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,423 | java | package com.example.asus.toolbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//
// toolbar.setNavigationIcon(R.mipmap.ic_drawer_home);//设置导航栏图标
// toolbar.setLogo(R.mipmap.ic_launcher);//设置app logo
// toolbar.setTitle("Title");//设置主标题
// toolbar.setSubtitle("Subtitle");//设置子标题
// toolbar.inflateMenu(R.menu.main); //填充右上角菜单
//
setSupportActionBar(toolbar);
// toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
// @Override
// public boolean onMenuItemClick(MenuItem item) {
// int menuItemId = item.getItemId();
// if (menuItemId == R.id.action_search) {
// Toast.makeText(MainActivity.this, R.string.menu_search, Toast.LENGTH_SHORT).show();
//
// } else if (menuItemId == R.id.action_notification) {
// Toast.makeText(MainActivity.this, R.string.menu_notifications, Toast.LENGTH_SHORT).show();
//
// } else if (menuItemId == R.id.action_item1) {
// Toast.makeText(MainActivity.this, R.string.item_01, Toast.LENGTH_SHORT).show();
//
// } else if (menuItemId == R.id.action_item2) {
// Toast.makeText(MainActivity.this, R.string.item_02, Toast.LENGTH_SHORT).show();
//
// }
// return true;
// }
// });
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_item1)
Toast.makeText(MainActivity.this,"item1",Toast.LENGTH_SHORT).show();
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
| [
"[email protected]"
] | |
60dcd74872cfc7eb7c74d5dcc25782b466f354e5 | 2b8c47031dddd10fede8bcf16f8db2b52521cb4f | /subject SPLs and test cases/BerkeleyDB(5)/BerkeleyDB_P4/evosuite-tests2/com/sleepycat/je/tree/WithRootLatched_ESTest_scaffolding2.java | 38ca744fef6a03a3965b0dbe777376bacb67ddb0 | [] | no_license | psjung/SRTST_experiments | 6f1ff67121ef43c00c01c9f48ce34f31724676b6 | 40961cb4b4a1e968d1e0857262df36832efb4910 | refs/heads/master | 2021-06-20T04:45:54.440905 | 2019-09-06T04:05:38 | 2019-09-06T04:05:38 | 206,693,757 | 1 | 0 | null | 2020-10-13T15:50:41 | 2019-09-06T02:10:06 | Java | UTF-8 | Java | false | false | 1,452 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Apr 22 02:06:59 KST 2017
*/
package com.sleepycat.je.tree;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class WithRootLatched_ESTest_scaffolding2 {
@org.junit.Rule
public org.junit.rules.Timeout globalTimeout = new org.junit.rules.Timeout(4000);
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.sleepycat.je.tree.WithRootLatched";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
}
| [
"[email protected]"
] | |
60ccf77d086d9d94f4f70684077041f3942e943c | d71e879b3517cf4fccde29f7bf82cff69856cfcd | /ExtractedJars/Health_com.huawei.health/javafiles/android/support/v4/media/session/MediaSessionCompat$MediaSessionImplBase.java | 8dc1c55899ddf2212f790c19a275502a5e54143a | [
"MIT"
] | permissive | Andreas237/AndroidPolicyAutomation | b8e949e072d08cf6c6166c3f15c9c63379b8f6ce | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | refs/heads/master | 2020-04-10T02:14:08.789751 | 2019-05-16T19:29:11 | 2019-05-16T19:29:11 | 160,739,088 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 140,564 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package android.support.v4.media.session;
import android.app.PendingIntent;
import android.content.*;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.media.RemoteControlClient;
import android.net.Uri;
import android.os.*;
import android.support.v4.media.*;
import android.view.KeyEvent;
import java.util.List;
// Referenced classes of package android.support.v4.media.session:
// MediaSessionCompat, IMediaControllerCallback, PlaybackStateCompat, ParcelableVolumeInfo
static class MediaSessionCompat$MediaSessionImplBase
implements MediaSessionCompat.MediaSessionImpl
{
static final class Command
{
public final String command;
public final Bundle extras;
public final ResultReceiver stub;
public Command(String s, Bundle bundle, ResultReceiver resultreceiver)
{
// 0 0:aload_0
// 1 1:invokespecial #21 <Method void Object()>
command = s;
// 2 4:aload_0
// 3 5:aload_1
// 4 6:putfield #23 <Field String command>
extras = bundle;
// 5 9:aload_0
// 6 10:aload_2
// 7 11:putfield #25 <Field Bundle extras>
stub = resultreceiver;
// 8 14:aload_0
// 9 15:aload_3
// 10 16:putfield #27 <Field ResultReceiver stub>
// 11 19:return
}
}
class MediaSessionStub extends IMediaSession.Stub
{
public void addQueueItem(MediaDescriptionCompat mediadescriptioncompat)
{
postToHandler(25, ((Object) (mediadescriptioncompat)));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 25
// 3 6:aload_1
// 4 7:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 5 10:return
}
public void addQueueItemAt(MediaDescriptionCompat mediadescriptioncompat, int i)
{
postToHandler(26, ((Object) (mediadescriptioncompat)), i);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 26
// 3 6:aload_1
// 4 7:iload_2
// 5 8:invokevirtual #31 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, int)>
// 6 11:return
}
public void adjustVolume(int i, int j, String s)
{
MediaSessionCompat.MediaSessionImplBase.this.adjustVolume(i, j);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iload_1
// 3 5:iload_2
// 4 6:invokevirtual #36 <Method void MediaSessionCompat$MediaSessionImplBase.adjustVolume(int, int)>
// 5 9:return
}
public void fastForward()
throws RemoteException
{
postToHandler(16);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 16
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public Bundle getExtras()
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #49 <Field Object MediaSessionCompat$MediaSessionImplBase.mLock>
// 3 7:astore_1
obj;
// 4 8:aload_1
JVM INSTR monitorenter ;
// 5 9:monitorenter
Bundle bundle = mExtras;
// 6 10:aload_0
// 7 11:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 8 14:getfield #53 <Field Bundle MediaSessionCompat$MediaSessionImplBase.mExtras>
// 9 17:astore_2
obj;
// 10 18:aload_1
JVM INSTR monitorexit ;
// 11 19:monitorexit
return bundle;
// 12 20:aload_2
// 13 21:areturn
Exception exception;
exception;
// 14 22:astore_2
//* 15 23:aload_1
throw exception;
// 16 24:monitorexit
// 17 25:aload_2
// 18 26:athrow
}
public long getFlags()
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #49 <Field Object MediaSessionCompat$MediaSessionImplBase.mLock>
// 3 7:astore 4
obj;
// 4 9:aload 4
JVM INSTR monitorenter ;
// 5 11:monitorenter
int i = mFlags;
// 6 12:aload_0
// 7 13:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 8 16:getfield #59 <Field int MediaSessionCompat$MediaSessionImplBase.mFlags>
// 9 19:istore_1
long l = i;
// 10 20:iload_1
// 11 21:i2l
// 12 22:lstore_2
obj;
// 13 23:aload 4
JVM INSTR monitorexit ;
// 14 25:monitorexit
return l;
// 15 26:lload_2
// 16 27:lreturn
Exception exception;
exception;
// 17 28:astore 5
//* 18 30:aload 4
throw exception;
// 19 32:monitorexit
// 20 33:aload 5
// 21 35:athrow
}
public PendingIntent getLaunchPendingIntent()
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #49 <Field Object MediaSessionCompat$MediaSessionImplBase.mLock>
// 3 7:astore_1
obj;
// 4 8:aload_1
JVM INSTR monitorenter ;
// 5 9:monitorenter
PendingIntent pendingintent = mSessionActivity;
// 6 10:aload_0
// 7 11:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 8 14:getfield #65 <Field PendingIntent MediaSessionCompat$MediaSessionImplBase.mSessionActivity>
// 9 17:astore_2
obj;
// 10 18:aload_1
JVM INSTR monitorexit ;
// 11 19:monitorexit
return pendingintent;
// 12 20:aload_2
// 13 21:areturn
Exception exception;
exception;
// 14 22:astore_2
//* 15 23:aload_1
throw exception;
// 16 24:monitorexit
// 17 25:aload_2
// 18 26:athrow
}
public MediaMetadataCompat getMetadata()
{
return mMetadata;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #71 <Field MediaMetadataCompat MediaSessionCompat$MediaSessionImplBase.mMetadata>
// 3 7:areturn
}
public String getPackageName()
{
return mPackageName;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #77 <Field String MediaSessionCompat$MediaSessionImplBase.mPackageName>
// 3 7:areturn
}
public PlaybackStateCompat getPlaybackState()
{
return getStateWithUpdatedPosition();
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:invokevirtual #82 <Method PlaybackStateCompat MediaSessionCompat$MediaSessionImplBase.getStateWithUpdatedPosition()>
// 3 7:areturn
}
public List getQueue()
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #49 <Field Object MediaSessionCompat$MediaSessionImplBase.mLock>
// 3 7:astore_1
obj;
// 4 8:aload_1
JVM INSTR monitorenter ;
// 5 9:monitorenter
List list = mQueue;
// 6 10:aload_0
// 7 11:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 8 14:getfield #88 <Field List MediaSessionCompat$MediaSessionImplBase.mQueue>
// 9 17:astore_2
obj;
// 10 18:aload_1
JVM INSTR monitorexit ;
// 11 19:monitorexit
return list;
// 12 20:aload_2
// 13 21:areturn
Exception exception;
exception;
// 14 22:astore_2
//* 15 23:aload_1
throw exception;
// 16 24:monitorexit
// 17 25:aload_2
// 18 26:athrow
}
public CharSequence getQueueTitle()
{
return mQueueTitle;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #96 <Field CharSequence MediaSessionCompat$MediaSessionImplBase.mQueueTitle>
// 3 7:areturn
}
public int getRatingType()
{
return mRatingType;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #101 <Field int MediaSessionCompat$MediaSessionImplBase.mRatingType>
// 3 7:ireturn
}
public int getRepeatMode()
{
return mRepeatMode;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #105 <Field int MediaSessionCompat$MediaSessionImplBase.mRepeatMode>
// 3 7:ireturn
}
public String getTag()
{
return mTag;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #109 <Field String MediaSessionCompat$MediaSessionImplBase.mTag>
// 3 7:areturn
}
public ParcelableVolumeInfo getVolumeAttributes()
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #49 <Field Object MediaSessionCompat$MediaSessionImplBase.mLock>
// 3 7:astore 6
obj;
// 4 9:aload 6
JVM INSTR monitorenter ;
// 5 11:monitorenter
int l;
int i1;
VolumeProviderCompat volumeprovidercompat;
l = mVolumeType;
// 6 12:aload_0
// 7 13:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 8 16:getfield #114 <Field int MediaSessionCompat$MediaSessionImplBase.mVolumeType>
// 9 19:istore 4
i1 = mLocalStream;
// 10 21:aload_0
// 11 22:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 12 25:getfield #117 <Field int MediaSessionCompat$MediaSessionImplBase.mLocalStream>
// 13 28:istore 5
volumeprovidercompat = mVolumeProvider;
// 14 30:aload_0
// 15 31:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 16 34:getfield #121 <Field VolumeProviderCompat MediaSessionCompat$MediaSessionImplBase.mVolumeProvider>
// 17 37:astore 7
if(l != 2)
break MISSING_BLOCK_LABEL_66;
// 18 39:iload 4
// 19 41:iconst_2
// 20 42:icmpne 66
int i;
int j;
int k;
i = volumeprovidercompat.getVolumeControl();
// 21 45:aload 7
// 22 47:invokevirtual #126 <Method int VolumeProviderCompat.getVolumeControl()>
// 23 50:istore_1
j = volumeprovidercompat.getMaxVolume();
// 24 51:aload 7
// 25 53:invokevirtual #129 <Method int VolumeProviderCompat.getMaxVolume()>
// 26 56:istore_2
k = volumeprovidercompat.getCurrentVolume();
// 27 57:aload 7
// 28 59:invokevirtual #132 <Method int VolumeProviderCompat.getCurrentVolume()>
// 29 62:istore_3
break MISSING_BLOCK_LABEL_94;
// 30 63:goto 94
i = 2;
// 31 66:iconst_2
// 32 67:istore_1
j = mAudioManager.getStreamMaxVolume(i1);
// 33 68:aload_0
// 34 69:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 35 72:getfield #136 <Field AudioManager MediaSessionCompat$MediaSessionImplBase.mAudioManager>
// 36 75:iload 5
// 37 77:invokevirtual #142 <Method int AudioManager.getStreamMaxVolume(int)>
// 38 80:istore_2
k = mAudioManager.getStreamVolume(i1);
// 39 81:aload_0
// 40 82:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 41 85:getfield #136 <Field AudioManager MediaSessionCompat$MediaSessionImplBase.mAudioManager>
// 42 88:iload 5
// 43 90:invokevirtual #145 <Method int AudioManager.getStreamVolume(int)>
// 44 93:istore_3
obj;
// 45 94:aload 6
JVM INSTR monitorexit ;
// 46 96:monitorexit
goto _L1
//* 47 97:goto 108
Exception exception;
exception;
// 48 100:astore 7
//* 49 102:aload 6
throw exception;
// 50 104:monitorexit
// 51 105:aload 7
// 52 107:athrow
_L1:
return new ParcelableVolumeInfo(l, i1, i, j, k);
// 53 108:new #147 <Class ParcelableVolumeInfo>
// 54 111:dup
// 55 112:iload 4
// 56 114:iload 5
// 57 116:iload_1
// 58 117:iload_2
// 59 118:iload_3
// 60 119:invokespecial #150 <Method void ParcelableVolumeInfo(int, int, int, int, int)>
// 61 122:areturn
}
public boolean isShuffleModeEnabled()
{
return mShuffleModeEnabled;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #156 <Field boolean MediaSessionCompat$MediaSessionImplBase.mShuffleModeEnabled>
// 3 7:ireturn
}
public boolean isTransportControlEnabled()
{
return (mFlags & 2) != 0;
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #59 <Field int MediaSessionCompat$MediaSessionImplBase.mFlags>
// 3 7:iconst_2
// 4 8:iand
// 5 9:ifeq 14
// 6 12:iconst_1
// 7 13:ireturn
// 8 14:iconst_0
// 9 15:ireturn
}
public void next()
throws RemoteException
{
postToHandler(14);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 14
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void pause()
throws RemoteException
{
postToHandler(12);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 12
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void play()
throws RemoteException
{
postToHandler(7);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 7
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void playFromMediaId(String s, Bundle bundle)
throws RemoteException
{
postToHandler(8, ((Object) (s)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 8
// 3 6:aload_1
// 4 7:aload_2
// 5 8:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 11:return
}
public void playFromSearch(String s, Bundle bundle)
throws RemoteException
{
postToHandler(9, ((Object) (s)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 9
// 3 6:aload_1
// 4 7:aload_2
// 5 8:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 11:return
}
public void playFromUri(Uri uri, Bundle bundle)
throws RemoteException
{
postToHandler(10, ((Object) (uri)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 10
// 3 6:aload_1
// 4 7:aload_2
// 5 8:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 11:return
}
public void prepare()
throws RemoteException
{
postToHandler(3);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iconst_3
// 3 5:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 8:return
}
public void prepareFromMediaId(String s, Bundle bundle)
throws RemoteException
{
postToHandler(4, ((Object) (s)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iconst_4
// 3 5:aload_1
// 4 6:aload_2
// 5 7:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 10:return
}
public void prepareFromSearch(String s, Bundle bundle)
throws RemoteException
{
postToHandler(5, ((Object) (s)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iconst_5
// 3 5:aload_1
// 4 6:aload_2
// 5 7:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 10:return
}
public void prepareFromUri(Uri uri, Bundle bundle)
throws RemoteException
{
postToHandler(6, ((Object) (uri)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 6
// 3 6:aload_1
// 4 7:aload_2
// 5 8:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 11:return
}
public void previous()
throws RemoteException
{
postToHandler(15);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 15
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void rate(RatingCompat ratingcompat)
throws RemoteException
{
postToHandler(19, ((Object) (ratingcompat)));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 19
// 3 6:aload_1
// 4 7:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 5 10:return
}
public void registerCallbackListener(IMediaControllerCallback imediacontrollercallback)
{
if(mDestroyed)
//* 0 0:aload_0
//* 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 2 4:getfield #182 <Field boolean MediaSessionCompat$MediaSessionImplBase.mDestroyed>
//* 3 7:ifeq 19
{
try
{
imediacontrollercallback.onSessionDestroyed();
// 4 10:aload_1
// 5 11:invokeinterface #187 <Method void IMediaControllerCallback.onSessionDestroyed()>
return;
// 6 16:return
}
// Misplaced declaration of an exception variable
catch(IMediaControllerCallback imediacontrollercallback)
//* 7 17:astore_1
{
return;
// 8 18:return
}
} else
{
mControllerCallbacks.register(((android.os.IInterface) (imediacontrollercallback)));
// 9 19:aload_0
// 10 20:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 11 23:getfield #191 <Field RemoteCallbackList MediaSessionCompat$MediaSessionImplBase.mControllerCallbacks>
// 12 26:aload_1
// 13 27:invokevirtual #197 <Method boolean RemoteCallbackList.register(android.os.IInterface)>
// 14 30:pop
return;
// 15 31:return
}
}
public void removeQueueItem(MediaDescriptionCompat mediadescriptioncompat)
{
postToHandler(27, ((Object) (mediadescriptioncompat)));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 27
// 3 6:aload_1
// 4 7:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 5 10:return
}
public void removeQueueItemAt(int i)
{
postToHandler(28, i);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 28
// 3 6:iload_1
// 4 7:invokevirtual #201 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, int)>
// 5 10:return
}
public void rewind()
throws RemoteException
{
postToHandler(17);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 17
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void seekTo(long l)
throws RemoteException
{
postToHandler(18, ((Object) (Long.valueOf(l))));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 18
// 3 6:lload_1
// 4 7:invokestatic #210 <Method Long Long.valueOf(long)>
// 5 10:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 6 13:return
}
public void sendCommand(String s, Bundle bundle, MediaSessionCompat.ResultReceiverWrapper resultreceiverwrapper)
{
postToHandler(1, ((Object) (new Command(s, bundle, MediaSessionCompat.ResultReceiverWrapper.access$100(resultreceiverwrapper)))));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iconst_1
// 3 5:new #214 <Class MediaSessionCompat$MediaSessionImplBase$Command>
// 4 8:dup
// 5 9:aload_1
// 6 10:aload_2
// 7 11:aload_3
// 8 12:invokestatic #220 <Method ResultReceiver MediaSessionCompat$ResultReceiverWrapper.access$100(MediaSessionCompat$ResultReceiverWrapper)>
// 9 15:invokespecial #223 <Method void MediaSessionCompat$MediaSessionImplBase$Command(String, Bundle, ResultReceiver)>
// 10 18:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 11 21:return
}
public void sendCustomAction(String s, Bundle bundle)
throws RemoteException
{
postToHandler(20, ((Object) (s)), bundle);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 20
// 3 6:aload_1
// 4 7:aload_2
// 5 8:invokevirtual #165 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object, Bundle)>
// 6 11:return
}
public boolean sendMediaButton(KeyEvent keyevent)
{
boolean flag;
if((mFlags & 1) != 0)
//* 0 0:aload_0
//* 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 2 4:getfield #59 <Field int MediaSessionCompat$MediaSessionImplBase.mFlags>
//* 3 7:iconst_1
//* 4 8:iand
//* 5 9:ifeq 17
flag = true;
// 6 12:iconst_1
// 7 13:istore_2
else
//* 8 14:goto 19
flag = false;
// 9 17:iconst_0
// 10 18:istore_2
if(flag)
//* 11 19:iload_2
//* 12 20:ifeq 33
postToHandler(21, ((Object) (keyevent)));
// 13 23:aload_0
// 14 24:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 15 27:bipush 21
// 16 29:aload_1
// 17 30:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
return flag;
// 18 33:iload_2
// 19 34:ireturn
}
public void setRepeatMode(int i)
throws RemoteException
{
postToHandler(23, i);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 23
// 3 6:iload_1
// 4 7:invokevirtual #201 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, int)>
// 5 10:return
}
public void setShuffleModeEnabled(boolean flag)
throws RemoteException
{
postToHandler(24, ((Object) (Boolean.valueOf(flag))));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 24
// 3 6:iload_1
// 4 7:invokestatic #234 <Method Boolean Boolean.valueOf(boolean)>
// 5 10:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 6 13:return
}
public void setVolumeTo(int i, int j, String s)
{
MediaSessionCompat.MediaSessionImplBase.this.setVolumeTo(i, j);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:iload_1
// 3 5:iload_2
// 4 6:invokevirtual #237 <Method void MediaSessionCompat$MediaSessionImplBase.setVolumeTo(int, int)>
// 5 9:return
}
public void skipToQueueItem(long l)
{
postToHandler(11, ((Object) (Long.valueOf(l))));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 11
// 3 6:lload_1
// 4 7:invokestatic #210 <Method Long Long.valueOf(long)>
// 5 10:invokevirtual #26 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int, Object)>
// 6 13:return
}
public void stop()
throws RemoteException
{
postToHandler(13);
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:bipush 13
// 3 6:invokevirtual #42 <Method void MediaSessionCompat$MediaSessionImplBase.postToHandler(int)>
// 4 9:return
}
public void unregisterCallbackListener(IMediaControllerCallback imediacontrollercallback)
{
mControllerCallbacks.unregister(((android.os.IInterface) (imediacontrollercallback)));
// 0 0:aload_0
// 1 1:getfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #191 <Field RemoteCallbackList MediaSessionCompat$MediaSessionImplBase.mControllerCallbacks>
// 3 7:aload_1
// 4 8:invokevirtual #243 <Method boolean RemoteCallbackList.unregister(android.os.IInterface)>
// 5 11:pop
// 6 12:return
}
final MediaSessionCompat.MediaSessionImplBase this$0;
MediaSessionStub()
{
this$0 = MediaSessionCompat.MediaSessionImplBase.this;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #16 <Field MediaSessionCompat$MediaSessionImplBase this$0>
super();
// 3 5:aload_0
// 4 6:invokespecial #19 <Method void IMediaSession$Stub()>
// 5 9:return
}
}
class MessageHandler extends Handler
{
private void onMediaButtonEvent(KeyEvent keyevent, MediaSessionCompat.Callback callback)
{
if(keyevent == null || keyevent.getAction() != 0)
//* 0 0:aload_1
//* 1 1:ifnull 11
//* 2 4:aload_1
//* 3 5:invokevirtual #89 <Method int KeyEvent.getAction()>
//* 4 8:ifeq 12
return;
// 5 11:return
long l;
if(mState == null)
//* 6 12:aload_0
//* 7 13:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 8 16:getfield #93 <Field PlaybackStateCompat MediaSessionCompat$MediaSessionImplBase.mState>
//* 9 19:ifnonnull 28
l = 0L;
// 10 22:lconst_0
// 11 23:lstore 6
else
//* 12 25:goto 40
l = mState.getActions();
// 13 28:aload_0
// 14 29:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 15 32:getfield #93 <Field PlaybackStateCompat MediaSessionCompat$MediaSessionImplBase.mState>
// 16 35:invokevirtual #99 <Method long PlaybackStateCompat.getActions()>
// 17 38:lstore 6
switch(keyevent.getKeyCode())
//* 18 40:aload_1
//* 19 41:invokevirtual #102 <Method int KeyEvent.getKeyCode()>
{
//* 20 44:lookupswitch 9: default 128
// 79: 239
// 85: 239
// 86: 193
// 87: 161
// 88: 177
// 89: 223
// 90: 207
// 126: 129
// 127: 145
default:
return;
// 21 128:return
case 126: // '~'
if((4L & l) != 0L)
//* 22 129:ldc2w #103 <Long 4L>
//* 23 132:lload 6
//* 24 134:land
//* 25 135:lconst_0
//* 26 136:lcmp
//* 27 137:ifeq 337
{
callback.onPlay();
// 28 140:aload_2
// 29 141:invokevirtual #110 <Method void MediaSessionCompat$Callback.onPlay()>
return;
// 30 144:return
}
break;
case 127: // '\177'
if((2L & l) != 0L)
//* 31 145:ldc2w #111 <Long 2L>
//* 32 148:lload 6
//* 33 150:land
//* 34 151:lconst_0
//* 35 152:lcmp
//* 36 153:ifeq 337
{
callback.onPause();
// 37 156:aload_2
// 38 157:invokevirtual #115 <Method void MediaSessionCompat$Callback.onPause()>
return;
// 39 160:return
}
break;
case 87: // 'W'
if((32L & l) != 0L)
//* 40 161:ldc2w #116 <Long 32L>
//* 41 164:lload 6
//* 42 166:land
//* 43 167:lconst_0
//* 44 168:lcmp
//* 45 169:ifeq 337
{
callback.onSkipToNext();
// 46 172:aload_2
// 47 173:invokevirtual #120 <Method void MediaSessionCompat$Callback.onSkipToNext()>
return;
// 48 176:return
}
break;
case 88: // 'X'
if((16L & l) != 0L)
//* 49 177:ldc2w #121 <Long 16L>
//* 50 180:lload 6
//* 51 182:land
//* 52 183:lconst_0
//* 53 184:lcmp
//* 54 185:ifeq 337
{
callback.onSkipToPrevious();
// 55 188:aload_2
// 56 189:invokevirtual #125 <Method void MediaSessionCompat$Callback.onSkipToPrevious()>
return;
// 57 192:return
}
break;
case 86: // 'V'
if((1L & l) != 0L)
//* 58 193:lconst_1
//* 59 194:lload 6
//* 60 196:land
//* 61 197:lconst_0
//* 62 198:lcmp
//* 63 199:ifeq 337
{
callback.onStop();
// 64 202:aload_2
// 65 203:invokevirtual #128 <Method void MediaSessionCompat$Callback.onStop()>
return;
// 66 206:return
}
break;
case 90: // 'Z'
if((64L & l) != 0L)
//* 67 207:ldc2w #129 <Long 64L>
//* 68 210:lload 6
//* 69 212:land
//* 70 213:lconst_0
//* 71 214:lcmp
//* 72 215:ifeq 337
{
callback.onFastForward();
// 73 218:aload_2
// 74 219:invokevirtual #133 <Method void MediaSessionCompat$Callback.onFastForward()>
return;
// 75 222:return
}
break;
case 89: // 'Y'
if((8L & l) != 0L)
//* 76 223:ldc2w #134 <Long 8L>
//* 77 226:lload 6
//* 78 228:land
//* 79 229:lconst_0
//* 80 230:lcmp
//* 81 231:ifeq 337
{
callback.onRewind();
// 82 234:aload_2
// 83 235:invokevirtual #138 <Method void MediaSessionCompat$Callback.onRewind()>
return;
// 84 238:return
}
break;
case 79: // 'O'
case 85: // 'U'
boolean flag;
if(mState != null && mState.getState() == 3)
//* 85 239:aload_0
//* 86 240:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 87 243:getfield #93 <Field PlaybackStateCompat MediaSessionCompat$MediaSessionImplBase.mState>
//* 88 246:ifnull 268
//* 89 249:aload_0
//* 90 250:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 91 253:getfield #93 <Field PlaybackStateCompat MediaSessionCompat$MediaSessionImplBase.mState>
//* 92 256:invokevirtual #141 <Method int PlaybackStateCompat.getState()>
//* 93 259:iconst_3
//* 94 260:icmpne 268
flag = true;
// 95 263:iconst_1
// 96 264:istore_3
else
//* 97 265:goto 270
flag = false;
// 98 268:iconst_0
// 99 269:istore_3
boolean flag1;
if((516L & l) != 0L)
//* 100 270:ldc2w #142 <Long 516L>
//* 101 273:lload 6
//* 102 275:land
//* 103 276:lconst_0
//* 104 277:lcmp
//* 105 278:ifeq 287
flag1 = true;
// 106 281:iconst_1
// 107 282:istore 4
else
//* 108 284:goto 290
flag1 = false;
// 109 287:iconst_0
// 110 288:istore 4
boolean flag2;
if((514L & l) != 0L)
//* 111 290:ldc2w #144 <Long 514L>
//* 112 293:lload 6
//* 113 295:land
//* 114 296:lconst_0
//* 115 297:lcmp
//* 116 298:ifeq 307
flag2 = true;
// 117 301:iconst_1
// 118 302:istore 5
else
//* 119 304:goto 310
flag2 = false;
// 120 307:iconst_0
// 121 308:istore 5
if(flag && flag2)
//* 122 310:iload_3
//* 123 311:ifeq 324
//* 124 314:iload 5
//* 125 316:ifeq 324
{
callback.onPause();
// 126 319:aload_2
// 127 320:invokevirtual #115 <Method void MediaSessionCompat$Callback.onPause()>
return;
// 128 323:return
}
if(!flag && flag1)
//* 129 324:iload_3
//* 130 325:ifne 337
//* 131 328:iload 4
//* 132 330:ifeq 337
callback.onPlay();
// 133 333:aload_2
// 134 334:invokevirtual #110 <Method void MediaSessionCompat$Callback.onPlay()>
break;
}
// 135 337:return
}
public void handleMessage(Message message)
{
MediaSessionCompat.Callback callback = mCallback;
// 0 0:aload_0
// 1 1:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 2 4:getfield #151 <Field MediaSessionCompat$Callback MediaSessionCompat$MediaSessionImplBase.mCallback>
// 3 7:astore_2
if(callback == null)
//* 4 8:aload_2
//* 5 9:ifnonnull 13
return;
// 6 12:return
switch(message.what)
//* 7 13:aload_1
//* 8 14:getfield #156 <Field int Message.what>
{
//* 9 17:tableswitch 1 28: default 144
// 1 145
// 2 454
// 3 211
// 4 216
// 5 232
// 6 248
// 7 264
// 8 269
// 9 285
// 10 301
// 11 317
// 12 332
// 13 337
// 14 342
// 15 347
// 16 352
// 17 357
// 18 362
// 19 377
// 20 389
// 21 170
// 22 467
// 23 480
// 24 489
// 25 405
// 26 417
// 27 433
// 28 445
default:
return;
// 10 144:return
case 1: // '\001'
message = ((Message) ((Command)message.obj));
// 11 145:aload_1
// 12 146:getfield #160 <Field Object Message.obj>
// 13 149:checkcast #162 <Class MediaSessionCompat$MediaSessionImplBase$Command>
// 14 152:astore_1
callback.onCommand(((Command) (message)).command, ((Command) (message)).extras, ((Command) (message)).stub);
// 15 153:aload_2
// 16 154:aload_1
// 17 155:getfield #166 <Field String MediaSessionCompat$MediaSessionImplBase$Command.command>
// 18 158:aload_1
// 19 159:getfield #170 <Field Bundle MediaSessionCompat$MediaSessionImplBase$Command.extras>
// 20 162:aload_1
// 21 163:getfield #174 <Field ResultReceiver MediaSessionCompat$MediaSessionImplBase$Command.stub>
// 22 166:invokevirtual #178 <Method void MediaSessionCompat$Callback.onCommand(String, Bundle, ResultReceiver)>
return;
// 23 169:return
case 21: // '\025'
message = ((Message) ((KeyEvent)message.obj));
// 24 170:aload_1
// 25 171:getfield #160 <Field Object Message.obj>
// 26 174:checkcast #85 <Class KeyEvent>
// 27 177:astore_1
Intent intent = new Intent("android.intent.action.MEDIA_BUTTON");
// 28 178:new #180 <Class Intent>
// 29 181:dup
// 30 182:ldc1 #182 <String "android.intent.action.MEDIA_BUTTON">
// 31 184:invokespecial #185 <Method void Intent(String)>
// 32 187:astore_3
intent.putExtra("android.intent.extra.KEY_EVENT", ((android.os.Parcelable) (message)));
// 33 188:aload_3
// 34 189:ldc1 #187 <String "android.intent.extra.KEY_EVENT">
// 35 191:aload_1
// 36 192:invokevirtual #191 <Method Intent Intent.putExtra(String, android.os.Parcelable)>
// 37 195:pop
if(!callback.onMediaButtonEvent(intent))
//* 38 196:aload_2
//* 39 197:aload_3
//* 40 198:invokevirtual #194 <Method boolean MediaSessionCompat$Callback.onMediaButtonEvent(Intent)>
//* 41 201:ifne 503
{
onMediaButtonEvent(((KeyEvent) (message)), callback);
// 42 204:aload_0
// 43 205:aload_1
// 44 206:aload_2
// 45 207:invokespecial #196 <Method void onMediaButtonEvent(KeyEvent, MediaSessionCompat$Callback)>
return;
// 46 210:return
}
break;
case 3: // '\003'
callback.onPrepare();
// 47 211:aload_2
// 48 212:invokevirtual #199 <Method void MediaSessionCompat$Callback.onPrepare()>
return;
// 49 215:return
case 4: // '\004'
callback.onPrepareFromMediaId((String)message.obj, message.getData());
// 50 216:aload_2
// 51 217:aload_1
// 52 218:getfield #160 <Field Object Message.obj>
// 53 221:checkcast #201 <Class String>
// 54 224:aload_1
// 55 225:invokevirtual #205 <Method Bundle Message.getData()>
// 56 228:invokevirtual #209 <Method void MediaSessionCompat$Callback.onPrepareFromMediaId(String, Bundle)>
return;
// 57 231:return
case 5: // '\005'
callback.onPrepareFromSearch((String)message.obj, message.getData());
// 58 232:aload_2
// 59 233:aload_1
// 60 234:getfield #160 <Field Object Message.obj>
// 61 237:checkcast #201 <Class String>
// 62 240:aload_1
// 63 241:invokevirtual #205 <Method Bundle Message.getData()>
// 64 244:invokevirtual #212 <Method void MediaSessionCompat$Callback.onPrepareFromSearch(String, Bundle)>
return;
// 65 247:return
case 6: // '\006'
callback.onPrepareFromUri((Uri)message.obj, message.getData());
// 66 248:aload_2
// 67 249:aload_1
// 68 250:getfield #160 <Field Object Message.obj>
// 69 253:checkcast #214 <Class Uri>
// 70 256:aload_1
// 71 257:invokevirtual #205 <Method Bundle Message.getData()>
// 72 260:invokevirtual #218 <Method void MediaSessionCompat$Callback.onPrepareFromUri(Uri, Bundle)>
return;
// 73 263:return
case 7: // '\007'
callback.onPlay();
// 74 264:aload_2
// 75 265:invokevirtual #110 <Method void MediaSessionCompat$Callback.onPlay()>
return;
// 76 268:return
case 8: // '\b'
callback.onPlayFromMediaId((String)message.obj, message.getData());
// 77 269:aload_2
// 78 270:aload_1
// 79 271:getfield #160 <Field Object Message.obj>
// 80 274:checkcast #201 <Class String>
// 81 277:aload_1
// 82 278:invokevirtual #205 <Method Bundle Message.getData()>
// 83 281:invokevirtual #221 <Method void MediaSessionCompat$Callback.onPlayFromMediaId(String, Bundle)>
return;
// 84 284:return
case 9: // '\t'
callback.onPlayFromSearch((String)message.obj, message.getData());
// 85 285:aload_2
// 86 286:aload_1
// 87 287:getfield #160 <Field Object Message.obj>
// 88 290:checkcast #201 <Class String>
// 89 293:aload_1
// 90 294:invokevirtual #205 <Method Bundle Message.getData()>
// 91 297:invokevirtual #224 <Method void MediaSessionCompat$Callback.onPlayFromSearch(String, Bundle)>
return;
// 92 300:return
case 10: // '\n'
callback.onPlayFromUri((Uri)message.obj, message.getData());
// 93 301:aload_2
// 94 302:aload_1
// 95 303:getfield #160 <Field Object Message.obj>
// 96 306:checkcast #214 <Class Uri>
// 97 309:aload_1
// 98 310:invokevirtual #205 <Method Bundle Message.getData()>
// 99 313:invokevirtual #227 <Method void MediaSessionCompat$Callback.onPlayFromUri(Uri, Bundle)>
return;
// 100 316:return
case 11: // '\013'
callback.onSkipToQueueItem(((Long)message.obj).longValue());
// 101 317:aload_2
// 102 318:aload_1
// 103 319:getfield #160 <Field Object Message.obj>
// 104 322:checkcast #229 <Class Long>
// 105 325:invokevirtual #232 <Method long Long.longValue()>
// 106 328:invokevirtual #236 <Method void MediaSessionCompat$Callback.onSkipToQueueItem(long)>
return;
// 107 331:return
case 12: // '\f'
callback.onPause();
// 108 332:aload_2
// 109 333:invokevirtual #115 <Method void MediaSessionCompat$Callback.onPause()>
return;
// 110 336:return
case 13: // '\r'
callback.onStop();
// 111 337:aload_2
// 112 338:invokevirtual #128 <Method void MediaSessionCompat$Callback.onStop()>
return;
// 113 341:return
case 14: // '\016'
callback.onSkipToNext();
// 114 342:aload_2
// 115 343:invokevirtual #120 <Method void MediaSessionCompat$Callback.onSkipToNext()>
return;
// 116 346:return
case 15: // '\017'
callback.onSkipToPrevious();
// 117 347:aload_2
// 118 348:invokevirtual #125 <Method void MediaSessionCompat$Callback.onSkipToPrevious()>
return;
// 119 351:return
case 16: // '\020'
callback.onFastForward();
// 120 352:aload_2
// 121 353:invokevirtual #133 <Method void MediaSessionCompat$Callback.onFastForward()>
return;
// 122 356:return
case 17: // '\021'
callback.onRewind();
// 123 357:aload_2
// 124 358:invokevirtual #138 <Method void MediaSessionCompat$Callback.onRewind()>
return;
// 125 361:return
case 18: // '\022'
callback.onSeekTo(((Long)message.obj).longValue());
// 126 362:aload_2
// 127 363:aload_1
// 128 364:getfield #160 <Field Object Message.obj>
// 129 367:checkcast #229 <Class Long>
// 130 370:invokevirtual #232 <Method long Long.longValue()>
// 131 373:invokevirtual #239 <Method void MediaSessionCompat$Callback.onSeekTo(long)>
return;
// 132 376:return
case 19: // '\023'
callback.onSetRating((RatingCompat)message.obj);
// 133 377:aload_2
// 134 378:aload_1
// 135 379:getfield #160 <Field Object Message.obj>
// 136 382:checkcast #241 <Class RatingCompat>
// 137 385:invokevirtual #245 <Method void MediaSessionCompat$Callback.onSetRating(RatingCompat)>
return;
// 138 388:return
case 20: // '\024'
callback.onCustomAction((String)message.obj, message.getData());
// 139 389:aload_2
// 140 390:aload_1
// 141 391:getfield #160 <Field Object Message.obj>
// 142 394:checkcast #201 <Class String>
// 143 397:aload_1
// 144 398:invokevirtual #205 <Method Bundle Message.getData()>
// 145 401:invokevirtual #248 <Method void MediaSessionCompat$Callback.onCustomAction(String, Bundle)>
return;
// 146 404:return
case 25: // '\031'
callback.onAddQueueItem((MediaDescriptionCompat)message.obj);
// 147 405:aload_2
// 148 406:aload_1
// 149 407:getfield #160 <Field Object Message.obj>
// 150 410:checkcast #250 <Class MediaDescriptionCompat>
// 151 413:invokevirtual #254 <Method void MediaSessionCompat$Callback.onAddQueueItem(MediaDescriptionCompat)>
return;
// 152 416:return
case 26: // '\032'
callback.onAddQueueItem((MediaDescriptionCompat)message.obj, message.arg1);
// 153 417:aload_2
// 154 418:aload_1
// 155 419:getfield #160 <Field Object Message.obj>
// 156 422:checkcast #250 <Class MediaDescriptionCompat>
// 157 425:aload_1
// 158 426:getfield #257 <Field int Message.arg1>
// 159 429:invokevirtual #260 <Method void MediaSessionCompat$Callback.onAddQueueItem(MediaDescriptionCompat, int)>
return;
// 160 432:return
case 27: // '\033'
callback.onRemoveQueueItem((MediaDescriptionCompat)message.obj);
// 161 433:aload_2
// 162 434:aload_1
// 163 435:getfield #160 <Field Object Message.obj>
// 164 438:checkcast #250 <Class MediaDescriptionCompat>
// 165 441:invokevirtual #263 <Method void MediaSessionCompat$Callback.onRemoveQueueItem(MediaDescriptionCompat)>
return;
// 166 444:return
case 28: // '\034'
callback.onRemoveQueueItemAt(message.arg1);
// 167 445:aload_2
// 168 446:aload_1
// 169 447:getfield #257 <Field int Message.arg1>
// 170 450:invokevirtual #267 <Method void MediaSessionCompat$Callback.onRemoveQueueItemAt(int)>
return;
// 171 453:return
case 2: // '\002'
adjustVolume(message.arg1, 0);
// 172 454:aload_0
// 173 455:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 174 458:aload_1
// 175 459:getfield #257 <Field int Message.arg1>
// 176 462:iconst_0
// 177 463:invokevirtual #271 <Method void MediaSessionCompat$MediaSessionImplBase.adjustVolume(int, int)>
return;
// 178 466:return
case 22: // '\026'
setVolumeTo(message.arg1, 0);
// 179 467:aload_0
// 180 468:getfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 181 471:aload_1
// 182 472:getfield #257 <Field int Message.arg1>
// 183 475:iconst_0
// 184 476:invokevirtual #274 <Method void MediaSessionCompat$MediaSessionImplBase.setVolumeTo(int, int)>
return;
// 185 479:return
case 23: // '\027'
callback.onSetRepeatMode(message.arg1);
// 186 480:aload_2
// 187 481:aload_1
// 188 482:getfield #257 <Field int Message.arg1>
// 189 485:invokevirtual #277 <Method void MediaSessionCompat$Callback.onSetRepeatMode(int)>
return;
// 190 488:return
case 24: // '\030'
callback.onSetShuffleModeEnabled(((Boolean)message.obj).booleanValue());
// 191 489:aload_2
// 192 490:aload_1
// 193 491:getfield #160 <Field Object Message.obj>
// 194 494:checkcast #279 <Class Boolean>
// 195 497:invokevirtual #283 <Method boolean Boolean.booleanValue()>
// 196 500:invokevirtual #287 <Method void MediaSessionCompat$Callback.onSetShuffleModeEnabled(boolean)>
break;
}
// 197 503:return
}
public void post(int i)
{
post(i, ((Object) (null)));
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aconst_null
// 3 3:invokevirtual #291 <Method void post(int, Object)>
// 4 6:return
}
public void post(int i, Object obj)
{
obtainMessage(i, obj).sendToTarget();
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aload_2
// 3 3:invokevirtual #295 <Method Message obtainMessage(int, Object)>
// 4 6:invokevirtual #298 <Method void Message.sendToTarget()>
// 5 9:return
}
public void post(int i, Object obj, int j)
{
obtainMessage(i, j, 0, obj).sendToTarget();
// 0 0:aload_0
// 1 1:iload_1
// 2 2:iload_3
// 3 3:iconst_0
// 4 4:aload_2
// 5 5:invokevirtual #302 <Method Message obtainMessage(int, int, int, Object)>
// 6 8:invokevirtual #298 <Method void Message.sendToTarget()>
// 7 11:return
}
public void post(int i, Object obj, Bundle bundle)
{
obj = ((Object) (obtainMessage(i, obj)));
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aload_2
// 3 3:invokevirtual #295 <Method Message obtainMessage(int, Object)>
// 4 6:astore_2
((Message) (obj)).setData(bundle);
// 5 7:aload_2
// 6 8:aload_3
// 7 9:invokevirtual #307 <Method void Message.setData(Bundle)>
((Message) (obj)).sendToTarget();
// 8 12:aload_2
// 9 13:invokevirtual #298 <Method void Message.sendToTarget()>
// 10 16:return
}
private static final int KEYCODE_MEDIA_PAUSE = 127;
private static final int KEYCODE_MEDIA_PLAY = 126;
private static final int MSG_ADD_QUEUE_ITEM = 25;
private static final int MSG_ADD_QUEUE_ITEM_AT = 26;
private static final int MSG_ADJUST_VOLUME = 2;
private static final int MSG_COMMAND = 1;
private static final int MSG_CUSTOM_ACTION = 20;
private static final int MSG_FAST_FORWARD = 16;
private static final int MSG_MEDIA_BUTTON = 21;
private static final int MSG_NEXT = 14;
private static final int MSG_PAUSE = 12;
private static final int MSG_PLAY = 7;
private static final int MSG_PLAY_MEDIA_ID = 8;
private static final int MSG_PLAY_SEARCH = 9;
private static final int MSG_PLAY_URI = 10;
private static final int MSG_PREPARE = 3;
private static final int MSG_PREPARE_MEDIA_ID = 4;
private static final int MSG_PREPARE_SEARCH = 5;
private static final int MSG_PREPARE_URI = 6;
private static final int MSG_PREVIOUS = 15;
private static final int MSG_RATE = 19;
private static final int MSG_REMOVE_QUEUE_ITEM = 27;
private static final int MSG_REMOVE_QUEUE_ITEM_AT = 28;
private static final int MSG_REWIND = 17;
private static final int MSG_SEEK_TO = 18;
private static final int MSG_SET_REPEAT_MODE = 23;
private static final int MSG_SET_SHUFFLE_MODE_ENABLED = 24;
private static final int MSG_SET_VOLUME = 22;
private static final int MSG_SKIP_TO_ITEM = 11;
private static final int MSG_STOP = 13;
final MediaSessionCompat.MediaSessionImplBase this$0;
public MessageHandler(Looper looper)
{
this$0 = MediaSessionCompat.MediaSessionImplBase.this;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #77 <Field MediaSessionCompat$MediaSessionImplBase this$0>
super(looper);
// 3 5:aload_0
// 4 6:aload_2
// 5 7:invokespecial #80 <Method void Handler(Looper)>
// 6 10:return
}
}
private void sendEvent(String s, Bundle bundle)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_3
//* 6 10:iload_3
//* 7 11:iflt 48
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_3
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore 4
try
{
imediacontrollercallback.onEvent(s, bundle);
// 14 27:aload 4
// 15 29:aload_1
// 16 30:aload_2
// 17 31:invokeinterface #175 <Method void IMediaControllerCallback.onEvent(String, Bundle)>
}
//* 18 36:goto 41
catch(RemoteException remoteexception) { }
// 19 39:astore 4
}
// 20 41:iload_3
// 21 42:iconst_1
// 22 43:isub
// 23 44:istore_3
//* 24 45:goto 10
mControllerCallbacks.finishBroadcast();
// 25 48:aload_0
// 26 49:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 27 52:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 28 55:return
}
private void sendExtras(Bundle bundle)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onExtrasChanged(bundle);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #183 <Method void IMediaControllerCallback.onExtrasChanged(Bundle)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendMetadata(MediaMetadataCompat mediametadatacompat)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onMetadataChanged(mediametadatacompat);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #188 <Method void IMediaControllerCallback.onMetadataChanged(MediaMetadataCompat)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendQueue(List list)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onQueueChanged(list);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #193 <Method void IMediaControllerCallback.onQueueChanged(List)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendQueueTitle(CharSequence charsequence)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onQueueTitleChanged(charsequence);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #200 <Method void IMediaControllerCallback.onQueueTitleChanged(CharSequence)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendRepeatMode(int i)
{
for(int j = mControllerCallbacks.beginBroadcast() - 1; j >= 0; j--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(j);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onRepeatModeChanged(i);
// 14 26:aload_3
// 15 27:iload_1
// 16 28:invokeinterface #205 <Method void IMediaControllerCallback.onRepeatModeChanged(int)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendSessionDestroyed()
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_1
//* 6 10:iload_1
//* 7 11:iflt 43
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_1
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_2
try
{
imediacontrollercallback.onSessionDestroyed();
// 14 26:aload_2
// 15 27:invokeinterface #209 <Method void IMediaControllerCallback.onSessionDestroyed()>
}
//* 16 32:goto 36
catch(RemoteException remoteexception) { }
// 17 35:astore_2
}
// 18 36:iload_1
// 19 37:iconst_1
// 20 38:isub
// 21 39:istore_1
//* 22 40:goto 10
mControllerCallbacks.finishBroadcast();
// 23 43:aload_0
// 24 44:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 25 47:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
mControllerCallbacks.kill();
// 26 50:aload_0
// 27 51:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 28 54:invokevirtual #212 <Method void RemoteCallbackList.kill()>
// 29 57:return
}
private void sendShuffleModeEnabled(boolean flag)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onShuffleModeChanged(flag);
// 14 26:aload_3
// 15 27:iload_1
// 16 28:invokeinterface #217 <Method void IMediaControllerCallback.onShuffleModeChanged(boolean)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
private void sendState(PlaybackStateCompat playbackstatecompat)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onPlaybackStateChanged(playbackstatecompat);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #222 <Method void IMediaControllerCallback.onPlaybackStateChanged(PlaybackStateCompat)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
void adjustVolume(int i, int j)
{
if(mVolumeType == 2)
//* 0 0:aload_0
//* 1 1:getfield #148 <Field int mVolumeType>
//* 2 4:iconst_2
//* 3 5:icmpne 24
{
if(mVolumeProvider != null)
//* 4 8:aload_0
//* 5 9:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
//* 6 12:ifnull 37
{
mVolumeProvider.onAdjustVolume(i);
// 7 15:aload_0
// 8 16:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 9 19:iload_1
// 10 20:invokevirtual #231 <Method void VolumeProviderCompat.onAdjustVolume(int)>
return;
// 11 23:return
}
} else
{
mAudioManager.adjustStreamVolume(mLocalStream, i, j);
// 12 24:aload_0
// 13 25:getfield #128 <Field AudioManager mAudioManager>
// 14 28:aload_0
// 15 29:getfield #150 <Field int mLocalStream>
// 16 32:iload_1
// 17 33:iload_2
// 18 34:invokevirtual #235 <Method void AudioManager.adjustStreamVolume(int, int, int)>
}
// 19 37:return
}
android.media.RemoteControlClient.MetadataEditor buildRccMetadata(Bundle bundle)
{
android.media.RemoteControlClient.MetadataEditor metadataeditor = mRcc.editMetadata(true);
// 0 0:aload_0
// 1 1:getfield #157 <Field RemoteControlClient mRcc>
// 2 4:iconst_1
// 3 5:invokevirtual #241 <Method android.media.RemoteControlClient$MetadataEditor RemoteControlClient.editMetadata(boolean)>
// 4 8:astore_2
if(bundle == null)
//* 5 9:aload_1
//* 6 10:ifnonnull 15
return metadataeditor;
// 7 13:aload_2
// 8 14:areturn
if(bundle.containsKey("android.media.metadata.ART"))
//* 9 15:aload_1
//* 10 16:ldc1 #243 <String "android.media.metadata.ART">
//* 11 18:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 12 21:ifeq 43
metadataeditor.putBitmap(100, (Bitmap)bundle.getParcelable("android.media.metadata.ART"));
// 13 24:aload_2
// 14 25:bipush 100
// 15 27:aload_1
// 16 28:ldc1 #243 <String "android.media.metadata.ART">
// 17 30:invokevirtual #253 <Method android.os.Parcelable Bundle.getParcelable(String)>
// 18 33:checkcast #255 <Class Bitmap>
// 19 36:invokevirtual #261 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putBitmap(int, Bitmap)>
// 20 39:pop
else
//* 21 40:goto 70
if(bundle.containsKey("android.media.metadata.ALBUM_ART"))
//* 22 43:aload_1
//* 23 44:ldc2 #263 <String "android.media.metadata.ALBUM_ART">
//* 24 47:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 25 50:ifeq 70
metadataeditor.putBitmap(100, (Bitmap)bundle.getParcelable("android.media.metadata.ALBUM_ART"));
// 26 53:aload_2
// 27 54:bipush 100
// 28 56:aload_1
// 29 57:ldc2 #263 <String "android.media.metadata.ALBUM_ART">
// 30 60:invokevirtual #253 <Method android.os.Parcelable Bundle.getParcelable(String)>
// 31 63:checkcast #255 <Class Bitmap>
// 32 66:invokevirtual #261 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putBitmap(int, Bitmap)>
// 33 69:pop
if(bundle.containsKey("android.media.metadata.ALBUM"))
//* 34 70:aload_1
//* 35 71:ldc2 #265 <String "android.media.metadata.ALBUM">
//* 36 74:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 37 77:ifeq 93
metadataeditor.putString(1, bundle.getString("android.media.metadata.ALBUM"));
// 38 80:aload_2
// 39 81:iconst_1
// 40 82:aload_1
// 41 83:ldc2 #265 <String "android.media.metadata.ALBUM">
// 42 86:invokevirtual #269 <Method String Bundle.getString(String)>
// 43 89:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 44 92:pop
if(bundle.containsKey("android.media.metadata.ALBUM_ARTIST"))
//* 45 93:aload_1
//* 46 94:ldc2 #275 <String "android.media.metadata.ALBUM_ARTIST">
//* 47 97:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 48 100:ifeq 117
metadataeditor.putString(13, bundle.getString("android.media.metadata.ALBUM_ARTIST"));
// 49 103:aload_2
// 50 104:bipush 13
// 51 106:aload_1
// 52 107:ldc2 #275 <String "android.media.metadata.ALBUM_ARTIST">
// 53 110:invokevirtual #269 <Method String Bundle.getString(String)>
// 54 113:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 55 116:pop
if(bundle.containsKey("android.media.metadata.ARTIST"))
//* 56 117:aload_1
//* 57 118:ldc2 #277 <String "android.media.metadata.ARTIST">
//* 58 121:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 59 124:ifeq 140
metadataeditor.putString(2, bundle.getString("android.media.metadata.ARTIST"));
// 60 127:aload_2
// 61 128:iconst_2
// 62 129:aload_1
// 63 130:ldc2 #277 <String "android.media.metadata.ARTIST">
// 64 133:invokevirtual #269 <Method String Bundle.getString(String)>
// 65 136:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 66 139:pop
if(bundle.containsKey("android.media.metadata.AUTHOR"))
//* 67 140:aload_1
//* 68 141:ldc2 #279 <String "android.media.metadata.AUTHOR">
//* 69 144:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 70 147:ifeq 163
metadataeditor.putString(3, bundle.getString("android.media.metadata.AUTHOR"));
// 71 150:aload_2
// 72 151:iconst_3
// 73 152:aload_1
// 74 153:ldc2 #279 <String "android.media.metadata.AUTHOR">
// 75 156:invokevirtual #269 <Method String Bundle.getString(String)>
// 76 159:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 77 162:pop
if(bundle.containsKey("android.media.metadata.COMPILATION"))
//* 78 163:aload_1
//* 79 164:ldc2 #281 <String "android.media.metadata.COMPILATION">
//* 80 167:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 81 170:ifeq 187
metadataeditor.putString(15, bundle.getString("android.media.metadata.COMPILATION"));
// 82 173:aload_2
// 83 174:bipush 15
// 84 176:aload_1
// 85 177:ldc2 #281 <String "android.media.metadata.COMPILATION">
// 86 180:invokevirtual #269 <Method String Bundle.getString(String)>
// 87 183:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 88 186:pop
if(bundle.containsKey("android.media.metadata.COMPOSER"))
//* 89 187:aload_1
//* 90 188:ldc2 #283 <String "android.media.metadata.COMPOSER">
//* 91 191:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 92 194:ifeq 210
metadataeditor.putString(4, bundle.getString("android.media.metadata.COMPOSER"));
// 93 197:aload_2
// 94 198:iconst_4
// 95 199:aload_1
// 96 200:ldc2 #283 <String "android.media.metadata.COMPOSER">
// 97 203:invokevirtual #269 <Method String Bundle.getString(String)>
// 98 206:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 99 209:pop
if(bundle.containsKey("android.media.metadata.DATE"))
//* 100 210:aload_1
//* 101 211:ldc2 #285 <String "android.media.metadata.DATE">
//* 102 214:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 103 217:ifeq 233
metadataeditor.putString(5, bundle.getString("android.media.metadata.DATE"));
// 104 220:aload_2
// 105 221:iconst_5
// 106 222:aload_1
// 107 223:ldc2 #285 <String "android.media.metadata.DATE">
// 108 226:invokevirtual #269 <Method String Bundle.getString(String)>
// 109 229:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 110 232:pop
if(bundle.containsKey("android.media.metadata.DISC_NUMBER"))
//* 111 233:aload_1
//* 112 234:ldc2 #287 <String "android.media.metadata.DISC_NUMBER">
//* 113 237:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 114 240:ifeq 257
metadataeditor.putLong(14, bundle.getLong("android.media.metadata.DISC_NUMBER"));
// 115 243:aload_2
// 116 244:bipush 14
// 117 246:aload_1
// 118 247:ldc2 #287 <String "android.media.metadata.DISC_NUMBER">
// 119 250:invokevirtual #291 <Method long Bundle.getLong(String)>
// 120 253:invokevirtual #295 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putLong(int, long)>
// 121 256:pop
if(bundle.containsKey("android.media.metadata.DURATION"))
//* 122 257:aload_1
//* 123 258:ldc2 #297 <String "android.media.metadata.DURATION">
//* 124 261:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 125 264:ifeq 281
metadataeditor.putLong(9, bundle.getLong("android.media.metadata.DURATION"));
// 126 267:aload_2
// 127 268:bipush 9
// 128 270:aload_1
// 129 271:ldc2 #297 <String "android.media.metadata.DURATION">
// 130 274:invokevirtual #291 <Method long Bundle.getLong(String)>
// 131 277:invokevirtual #295 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putLong(int, long)>
// 132 280:pop
if(bundle.containsKey("android.media.metadata.GENRE"))
//* 133 281:aload_1
//* 134 282:ldc2 #299 <String "android.media.metadata.GENRE">
//* 135 285:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 136 288:ifeq 305
metadataeditor.putString(6, bundle.getString("android.media.metadata.GENRE"));
// 137 291:aload_2
// 138 292:bipush 6
// 139 294:aload_1
// 140 295:ldc2 #299 <String "android.media.metadata.GENRE">
// 141 298:invokevirtual #269 <Method String Bundle.getString(String)>
// 142 301:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 143 304:pop
if(bundle.containsKey("android.media.metadata.TITLE"))
//* 144 305:aload_1
//* 145 306:ldc2 #301 <String "android.media.metadata.TITLE">
//* 146 309:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 147 312:ifeq 329
metadataeditor.putString(7, bundle.getString("android.media.metadata.TITLE"));
// 148 315:aload_2
// 149 316:bipush 7
// 150 318:aload_1
// 151 319:ldc2 #301 <String "android.media.metadata.TITLE">
// 152 322:invokevirtual #269 <Method String Bundle.getString(String)>
// 153 325:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 154 328:pop
if(bundle.containsKey("android.media.metadata.TRACK_NUMBER"))
//* 155 329:aload_1
//* 156 330:ldc2 #303 <String "android.media.metadata.TRACK_NUMBER">
//* 157 333:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 158 336:ifeq 352
metadataeditor.putLong(0, bundle.getLong("android.media.metadata.TRACK_NUMBER"));
// 159 339:aload_2
// 160 340:iconst_0
// 161 341:aload_1
// 162 342:ldc2 #303 <String "android.media.metadata.TRACK_NUMBER">
// 163 345:invokevirtual #291 <Method long Bundle.getLong(String)>
// 164 348:invokevirtual #295 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putLong(int, long)>
// 165 351:pop
if(bundle.containsKey("android.media.metadata.WRITER"))
//* 166 352:aload_1
//* 167 353:ldc2 #305 <String "android.media.metadata.WRITER">
//* 168 356:invokevirtual #249 <Method boolean Bundle.containsKey(String)>
//* 169 359:ifeq 376
metadataeditor.putString(11, bundle.getString("android.media.metadata.WRITER"));
// 170 362:aload_2
// 171 363:bipush 11
// 172 365:aload_1
// 173 366:ldc2 #305 <String "android.media.metadata.WRITER">
// 174 369:invokevirtual #269 <Method String Bundle.getString(String)>
// 175 372:invokevirtual #273 <Method android.media.RemoteControlClient$MetadataEditor android.media.RemoteControlClient$MetadataEditor.putString(int, String)>
// 176 375:pop
return metadataeditor;
// 177 376:aload_2
// 178 377:areturn
}
public String getCallingPackage()
{
return null;
// 0 0:aconst_null
// 1 1:areturn
}
public Object getMediaSession()
{
return ((Object) (null));
// 0 0:aconst_null
// 1 1:areturn
}
int getRccStateFromState(int i)
{
switch(i)
//* 0 0:iload_1
{
//* 1 1:tableswitch 0 11: default 64
// 0 75
// 1 89
// 2 77
// 3 79
// 4 73
// 5 81
// 6 67
// 7 70
// 8 67
// 9 83
// 10 86
// 11 86
//* 2 64:goto 91
case 6: // '\006'
case 8: // '\b'
return 8;
// 3 67:bipush 8
// 4 69:ireturn
case 7: // '\007'
return 9;
// 5 70:bipush 9
// 6 72:ireturn
case 4: // '\004'
return 4;
// 7 73:iconst_4
// 8 74:ireturn
case 0: // '\0'
return 0;
// 9 75:iconst_0
// 10 76:ireturn
case 2: // '\002'
return 2;
// 11 77:iconst_2
// 12 78:ireturn
case 3: // '\003'
return 3;
// 13 79:iconst_3
// 14 80:ireturn
case 5: // '\005'
return 5;
// 15 81:iconst_5
// 16 82:ireturn
case 9: // '\t'
return 7;
// 17 83:bipush 7
// 18 85:ireturn
case 10: // '\n'
case 11: // '\013'
return 6;
// 19 86:bipush 6
// 20 88:ireturn
case 1: // '\001'
return 1;
// 21 89:iconst_1
// 22 90:ireturn
}
return -1;
// 23 91:iconst_m1
// 24 92:ireturn
}
int getRccTransportControlFlagsFromActions(long l)
{
int j = 0;
// 0 0:iconst_0
// 1 1:istore 4
if((1L & l) != 0L)
//* 2 3:lconst_1
//* 3 4:lload_1
//* 4 5:land
//* 5 6:lconst_0
//* 6 7:lcmp
//* 7 8:ifeq 15
j = 32;
// 8 11:bipush 32
// 9 13:istore 4
int i = j;
// 10 15:iload 4
// 11 17:istore_3
if((2L & l) != 0L)
//* 12 18:ldc2w #313 <Long 2L>
//* 13 21:lload_1
//* 14 22:land
//* 15 23:lconst_0
//* 16 24:lcmp
//* 17 25:ifeq 34
i = j | 0x10;
// 18 28:iload 4
// 19 30:bipush 16
// 20 32:ior
// 21 33:istore_3
j = i;
// 22 34:iload_3
// 23 35:istore 4
if((4L & l) != 0L)
//* 24 37:ldc2w #315 <Long 4L>
//* 25 40:lload_1
//* 26 41:land
//* 27 42:lconst_0
//* 28 43:lcmp
//* 29 44:ifeq 52
j = i | 4;
// 30 47:iload_3
// 31 48:iconst_4
// 32 49:ior
// 33 50:istore 4
i = j;
// 34 52:iload 4
// 35 54:istore_3
if((8L & l) != 0L)
//* 36 55:ldc2w #317 <Long 8L>
//* 37 58:lload_1
//* 38 59:land
//* 39 60:lconst_0
//* 40 61:lcmp
//* 41 62:ifeq 70
i = j | 2;
// 42 65:iload 4
// 43 67:iconst_2
// 44 68:ior
// 45 69:istore_3
j = i;
// 46 70:iload_3
// 47 71:istore 4
if((16L & l) != 0L)
//* 48 73:ldc2w #319 <Long 16L>
//* 49 76:lload_1
//* 50 77:land
//* 51 78:lconst_0
//* 52 79:lcmp
//* 53 80:ifeq 88
j = i | 1;
// 54 83:iload_3
// 55 84:iconst_1
// 56 85:ior
// 57 86:istore 4
i = j;
// 58 88:iload 4
// 59 90:istore_3
if((32L & l) != 0L)
//* 60 91:ldc2w #321 <Long 32L>
//* 61 94:lload_1
//* 62 95:land
//* 63 96:lconst_0
//* 64 97:lcmp
//* 65 98:ifeq 108
i = j | 0x80;
// 66 101:iload 4
// 67 103:sipush 128
// 68 106:ior
// 69 107:istore_3
j = i;
// 70 108:iload_3
// 71 109:istore 4
if((64L & l) != 0L)
//* 72 111:ldc2w #323 <Long 64L>
//* 73 114:lload_1
//* 74 115:land
//* 75 116:lconst_0
//* 76 117:lcmp
//* 77 118:ifeq 127
j = i | 0x40;
// 78 121:iload_3
// 79 122:bipush 64
// 80 124:ior
// 81 125:istore 4
i = j;
// 82 127:iload 4
// 83 129:istore_3
if((512L & l) != 0L)
//* 84 130:ldc2w #325 <Long 512L>
//* 85 133:lload_1
//* 86 134:land
//* 87 135:lconst_0
//* 88 136:lcmp
//* 89 137:ifeq 146
i = j | 8;
// 90 140:iload 4
// 91 142:bipush 8
// 92 144:ior
// 93 145:istore_3
return i;
// 94 146:iload_3
// 95 147:ireturn
}
public Object getRemoteControlClient()
{
return ((Object) (null));
// 0 0:aconst_null
// 1 1:areturn
}
public MediaSessionCompat.Token getSessionToken()
{
return mToken;
// 0 0:aload_0
// 1 1:getfield #144 <Field MediaSessionCompat$Token mToken>
// 2 4:areturn
}
PlaybackStateCompat getStateWithUpdatedPosition()
{
long l1 = -1L;
// 0 0:ldc2w #332 <Long -1L>
// 1 3:lstore_3
Object obj = mLock;
// 2 4:aload_0
// 3 5:getfield #83 <Field Object mLock>
// 4 8:astore 7
obj;
// 5 10:aload 7
JVM INSTR monitorenter ;
// 6 12:monitorenter
PlaybackStateCompat playbackstatecompat = mState;
// 7 13:aload_0
// 8 14:getfield #335 <Field PlaybackStateCompat mState>
// 9 17:astore 9
long l = l1;
// 10 19:lload_3
// 11 20:lstore_1
if(mMetadata == null)
break MISSING_BLOCK_LABEL_54;
// 12 21:aload_0
// 13 22:getfield #337 <Field MediaMetadataCompat mMetadata>
// 14 25:ifnull 54
l = l1;
// 15 28:lload_3
// 16 29:lstore_1
if(mMetadata.containsKey("android.media.metadata.DURATION"))
//* 17 30:aload_0
//* 18 31:getfield #337 <Field MediaMetadataCompat mMetadata>
//* 19 34:ldc2 #297 <String "android.media.metadata.DURATION">
//* 20 37:invokevirtual #340 <Method boolean MediaMetadataCompat.containsKey(String)>
//* 21 40:ifeq 54
l = mMetadata.getLong("android.media.metadata.DURATION");
// 22 43:aload_0
// 23 44:getfield #337 <Field MediaMetadataCompat mMetadata>
// 24 47:ldc2 #297 <String "android.media.metadata.DURATION">
// 25 50:invokevirtual #341 <Method long MediaMetadataCompat.getLong(String)>
// 26 53:lstore_1
obj;
// 27 54:aload 7
JVM INSTR monitorexit ;
// 28 56:monitorexit
goto _L1
//* 29 57:goto 68
Exception exception;
exception;
// 30 60:astore 8
//* 31 62:aload 7
throw exception;
// 32 64:monitorexit
// 33 65:aload 8
// 34 67:athrow
_L1:
Object obj1;
label0:
{
Object obj2 = null;
// 35 68:aconst_null
// 36 69:astore 8
obj1 = ((Object) (obj2));
// 37 71:aload 8
// 38 73:astore 7
if(playbackstatecompat == null)
break label0;
// 39 75:aload 9
// 40 77:ifnull 213
if(playbackstatecompat.getState() != 3 && playbackstatecompat.getState() != 4)
//* 41 80:aload 9
//* 42 82:invokevirtual #346 <Method int PlaybackStateCompat.getState()>
//* 43 85:iconst_3
//* 44 86:icmpeq 111
//* 45 89:aload 9
//* 46 91:invokevirtual #346 <Method int PlaybackStateCompat.getState()>
//* 47 94:iconst_4
//* 48 95:icmpeq 111
{
obj1 = ((Object) (obj2));
// 49 98:aload 8
// 50 100:astore 7
if(playbackstatecompat.getState() != 5)
break label0;
// 51 102:aload 9
// 52 104:invokevirtual #346 <Method int PlaybackStateCompat.getState()>
// 53 107:iconst_5
// 54 108:icmpne 213
}
long l2 = playbackstatecompat.getLastPositionUpdateTime();
// 55 111:aload 9
// 56 113:invokevirtual #350 <Method long PlaybackStateCompat.getLastPositionUpdateTime()>
// 57 116:lstore_3
long l3 = SystemClock.elapsedRealtime();
// 58 117:invokestatic #355 <Method long SystemClock.elapsedRealtime()>
// 59 120:lstore 5
obj1 = ((Object) (obj2));
// 60 122:aload 8
// 61 124:astore 7
if(l2 > 0L)
//* 62 126:lload_3
//* 63 127:lconst_0
//* 64 128:lcmp
//* 65 129:ifle 213
{
l2 = (long)(playbackstatecompat.getPlaybackSpeed() * (float)(l3 - l2)) + playbackstatecompat.getPosition();
// 66 132:aload 9
// 67 134:invokevirtual #359 <Method float PlaybackStateCompat.getPlaybackSpeed()>
// 68 137:lload 5
// 69 139:lload_3
// 70 140:lsub
// 71 141:l2f
// 72 142:fmul
// 73 143:f2l
// 74 144:aload 9
// 75 146:invokevirtual #362 <Method long PlaybackStateCompat.getPosition()>
// 76 149:ladd
// 77 150:lstore_3
if(l < 0L || l2 <= l)
//* 78 151:lload_1
//* 79 152:lconst_0
//* 80 153:lcmp
//* 81 154:iflt 166
//* 82 157:lload_3
//* 83 158:lload_1
//* 84 159:lcmp
//* 85 160:ifle 166
//* 86 163:goto 176
{
l = l2;
// 87 166:lload_3
// 88 167:lstore_1
if(l2 < 0L)
//* 89 168:lload_3
//* 90 169:lconst_0
//* 91 170:lcmp
//* 92 171:ifge 176
l = 0L;
// 93 174:lconst_0
// 94 175:lstore_1
}
obj1 = ((Object) (new PlaybackStateCompat.Builder(playbackstatecompat)));
// 95 176:new #364 <Class PlaybackStateCompat$Builder>
// 96 179:dup
// 97 180:aload 9
// 98 182:invokespecial #366 <Method void PlaybackStateCompat$Builder(PlaybackStateCompat)>
// 99 185:astore 7
((PlaybackStateCompat.Builder) (obj1)).setState(playbackstatecompat.getState(), l, playbackstatecompat.getPlaybackSpeed(), l3);
// 100 187:aload 7
// 101 189:aload 9
// 102 191:invokevirtual #346 <Method int PlaybackStateCompat.getState()>
// 103 194:lload_1
// 104 195:aload 9
// 105 197:invokevirtual #359 <Method float PlaybackStateCompat.getPlaybackSpeed()>
// 106 200:lload 5
// 107 202:invokevirtual #370 <Method PlaybackStateCompat$Builder PlaybackStateCompat$Builder.setState(int, long, float, long)>
// 108 205:pop
obj1 = ((Object) (((PlaybackStateCompat.Builder) (obj1)).build()));
// 109 206:aload 7
// 110 208:invokevirtual #373 <Method PlaybackStateCompat PlaybackStateCompat$Builder.build()>
// 111 211:astore 7
}
}
if(obj1 == null)
//* 112 213:aload 7
//* 113 215:ifnonnull 221
return playbackstatecompat;
// 114 218:aload 9
// 115 220:areturn
else
return ((PlaybackStateCompat) (obj1));
// 116 221:aload 7
// 117 223:areturn
}
public boolean isActive()
{
return mIsActive;
// 0 0:aload_0
// 1 1:getfield #92 <Field boolean mIsActive>
// 2 4:ireturn
}
void postToHandler(int i)
{
postToHandler(i, ((Object) (null)));
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aconst_null
// 3 3:invokevirtual #379 <Method void postToHandler(int, Object)>
// 4 6:return
}
void postToHandler(int i, int j)
{
postToHandler(i, ((Object) (null)), j);
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aconst_null
// 3 3:iload_2
// 4 4:invokevirtual #382 <Method void postToHandler(int, Object, int)>
// 5 7:return
}
void postToHandler(int i, Object obj)
{
postToHandler(i, obj, ((Bundle) (null)));
// 0 0:aload_0
// 1 1:iload_1
// 2 2:aload_2
// 3 3:aconst_null
// 4 4:invokevirtual #385 <Method void postToHandler(int, Object, Bundle)>
// 5 7:return
}
void postToHandler(int i, Object obj, int j)
{
Object obj1 = mLock;
// 0 0:aload_0
// 1 1:getfield #83 <Field Object mLock>
// 2 4:astore 4
obj1;
// 3 6:aload 4
JVM INSTR monitorenter ;
// 4 8:monitorenter
if(mHandler != null)
//* 5 9:aload_0
//* 6 10:getfield #387 <Field MediaSessionCompat$MediaSessionImplBase$MessageHandler mHandler>
//* 7 13:ifnull 26
mHandler.post(i, obj, j);
// 8 16:aload_0
// 9 17:getfield #387 <Field MediaSessionCompat$MediaSessionImplBase$MessageHandler mHandler>
// 10 20:iload_1
// 11 21:aload_2
// 12 22:iload_3
// 13 23:invokevirtual #390 <Method void MediaSessionCompat$MediaSessionImplBase$MessageHandler.post(int, Object, int)>
obj1;
// 14 26:aload 4
JVM INSTR monitorexit ;
// 15 28:monitorexit
return;
// 16 29:return
obj;
// 17 30:astore_2
//* 18 31:aload 4
throw obj;
// 19 33:monitorexit
// 20 34:aload_2
// 21 35:athrow
}
void postToHandler(int i, Object obj, Bundle bundle)
{
Object obj1 = mLock;
// 0 0:aload_0
// 1 1:getfield #83 <Field Object mLock>
// 2 4:astore 4
obj1;
// 3 6:aload 4
JVM INSTR monitorenter ;
// 4 8:monitorenter
if(mHandler != null)
//* 5 9:aload_0
//* 6 10:getfield #387 <Field MediaSessionCompat$MediaSessionImplBase$MessageHandler mHandler>
//* 7 13:ifnull 26
mHandler.post(i, obj, bundle);
// 8 16:aload_0
// 9 17:getfield #387 <Field MediaSessionCompat$MediaSessionImplBase$MessageHandler mHandler>
// 10 20:iload_1
// 11 21:aload_2
// 12 22:aload_3
// 13 23:invokevirtual #392 <Method void MediaSessionCompat$MediaSessionImplBase$MessageHandler.post(int, Object, Bundle)>
obj1;
// 14 26:aload 4
JVM INSTR monitorexit ;
// 15 28:monitorexit
return;
// 16 29:return
obj;
// 17 30:astore_2
//* 18 31:aload 4
throw obj;
// 19 33:monitorexit
// 20 34:aload_2
// 21 35:athrow
}
void registerMediaButtonEventReceiver(PendingIntent pendingintent, ComponentName componentname)
{
mAudioManager.registerMediaButtonEventReceiver(componentname);
// 0 0:aload_0
// 1 1:getfield #128 <Field AudioManager mAudioManager>
// 2 4:aload_2
// 3 5:invokevirtual #397 <Method void AudioManager.registerMediaButtonEventReceiver(ComponentName)>
// 4 8:return
}
public void release()
{
mIsActive = false;
// 0 0:aload_0
// 1 1:iconst_0
// 2 2:putfield #92 <Field boolean mIsActive>
mDestroyed = true;
// 3 5:aload_0
// 4 6:iconst_1
// 5 7:putfield #90 <Field boolean mDestroyed>
update();
// 6 10:aload_0
// 7 11:invokevirtual #401 <Method boolean update()>
// 8 14:pop
sendSessionDestroyed();
// 9 15:aload_0
// 10 16:invokespecial #403 <Method void sendSessionDestroyed()>
// 11 19:return
}
public void sendSessionEvent(String s, Bundle bundle)
{
sendEvent(s, bundle);
// 0 0:aload_0
// 1 1:aload_1
// 2 2:aload_2
// 3 3:invokespecial #406 <Method void sendEvent(String, Bundle)>
// 4 6:return
}
void sendVolumeInfoChanged(ParcelableVolumeInfo parcelablevolumeinfo)
{
for(int i = mControllerCallbacks.beginBroadcast() - 1; i >= 0; i--)
//* 0 0:aload_0
//* 1 1:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
//* 2 4:invokevirtual #166 <Method int RemoteCallbackList.beginBroadcast()>
//* 3 7:iconst_1
//* 4 8:isub
//* 5 9:istore_2
//* 6 10:iload_2
//* 7 11:iflt 44
{
IMediaControllerCallback imediacontrollercallback = (IMediaControllerCallback)mControllerCallbacks.getBroadcastItem(i);
// 8 14:aload_0
// 9 15:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 10 18:iload_2
// 11 19:invokevirtual #170 <Method android.os.IInterface RemoteCallbackList.getBroadcastItem(int)>
// 12 22:checkcast #172 <Class IMediaControllerCallback>
// 13 25:astore_3
try
{
imediacontrollercallback.onVolumeInfoChanged(parcelablevolumeinfo);
// 14 26:aload_3
// 15 27:aload_1
// 16 28:invokeinterface #411 <Method void IMediaControllerCallback.onVolumeInfoChanged(ParcelableVolumeInfo)>
}
//* 17 33:goto 37
catch(RemoteException remoteexception) { }
// 18 36:astore_3
}
// 19 37:iload_2
// 20 38:iconst_1
// 21 39:isub
// 22 40:istore_2
//* 23 41:goto 10
mControllerCallbacks.finishBroadcast();
// 24 44:aload_0
// 25 45:getfield #88 <Field RemoteCallbackList mControllerCallbacks>
// 26 48:invokevirtual #178 <Method void RemoteCallbackList.finishBroadcast()>
// 27 51:return
}
public void setActive(boolean flag)
{
if(flag == mIsActive)
//* 0 0:iload_1
//* 1 1:aload_0
//* 2 2:getfield #92 <Field boolean mIsActive>
//* 3 5:icmpne 9
return;
// 4 8:return
mIsActive = flag;
// 5 9:aload_0
// 6 10:iload_1
// 7 11:putfield #92 <Field boolean mIsActive>
if(update())
//* 8 14:aload_0
//* 9 15:invokevirtual #401 <Method boolean update()>
//* 10 18:ifeq 37
{
setMetadata(mMetadata);
// 11 21:aload_0
// 12 22:aload_0
// 13 23:getfield #337 <Field MediaMetadataCompat mMetadata>
// 14 26:invokevirtual #415 <Method void setMetadata(MediaMetadataCompat)>
setPlaybackState(mState);
// 15 29:aload_0
// 16 30:aload_0
// 17 31:getfield #335 <Field PlaybackStateCompat mState>
// 18 34:invokevirtual #418 <Method void setPlaybackState(PlaybackStateCompat)>
}
// 19 37:return
}
public void setCallback(MediaSessionCompat.Callback callback, Handler handler)
{
mCallback = callback;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #422 <Field MediaSessionCompat$Callback mCallback>
if(callback == null)
break MISSING_BLOCK_LABEL_54;
// 3 5:aload_1
// 4 6:ifnull 54
callback = ((MediaSessionCompat.Callback) (handler));
// 5 9:aload_2
// 6 10:astore_1
if(handler == null)
//* 7 11:aload_2
//* 8 12:ifnonnull 23
callback = ((MediaSessionCompat.Callback) (new Handler()));
// 9 15:new #424 <Class Handler>
// 10 18:dup
// 11 19:invokespecial #425 <Method void Handler()>
// 12 22:astore_1
handler = ((Handler) (mLock));
// 13 23:aload_0
// 14 24:getfield #83 <Field Object mLock>
// 15 27:astore_2
handler;
// 16 28:aload_2
JVM INSTR monitorenter ;
// 17 29:monitorenter
mHandler = new MessageHandler(((Handler) (callback)).getLooper());
// 18 30:aload_0
// 19 31:new #19 <Class MediaSessionCompat$MediaSessionImplBase$MessageHandler>
// 20 34:dup
// 21 35:aload_0
// 22 36:aload_1
// 23 37:invokevirtual #429 <Method Looper Handler.getLooper()>
// 24 40:invokespecial #432 <Method void MediaSessionCompat$MediaSessionImplBase$MessageHandler(MediaSessionCompat$MediaSessionImplBase, Looper)>
// 25 43:putfield #387 <Field MediaSessionCompat$MediaSessionImplBase$MessageHandler mHandler>
handler;
// 26 46:aload_2
JVM INSTR monitorexit ;
// 27 47:monitorexit
return;
// 28 48:return
callback;
// 29 49:astore_1
//* 30 50:aload_2
throw callback;
// 31 51:monitorexit
// 32 52:aload_1
// 33 53:athrow
// 34 54:return
}
public void setExtras(Bundle bundle)
{
mExtras = bundle;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #435 <Field Bundle mExtras>
sendExtras(bundle);
// 3 5:aload_0
// 4 6:aload_1
// 5 7:invokespecial #437 <Method void sendExtras(Bundle)>
// 6 10:return
}
public void setFlags(int i)
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #83 <Field Object mLock>
// 2 4:astore_2
obj;
// 3 5:aload_2
JVM INSTR monitorenter ;
// 4 6:monitorenter
mFlags = i;
// 5 7:aload_0
// 6 8:iload_1
// 7 9:putfield #440 <Field int mFlags>
obj;
// 8 12:aload_2
JVM INSTR monitorexit ;
// 9 13:monitorexit
goto _L1
//* 10 14:goto 22
Exception exception;
exception;
// 11 17:astore_3
//* 12 18:aload_2
throw exception;
// 13 19:monitorexit
// 14 20:aload_3
// 15 21:athrow
_L1:
update();
// 16 22:aload_0
// 17 23:invokevirtual #401 <Method boolean update()>
// 18 26:pop
return;
// 19 27:return
}
public void setMediaButtonReceiver(PendingIntent pendingintent)
{
// 0 0:return
}
public void setMetadata(MediaMetadataCompat mediametadatacompat)
{
Object obj;
obj = ((Object) (mediametadatacompat));
// 0 0:aload_1
// 1 1:astore_2
if(mediametadatacompat != null)
//* 2 2:aload_1
//* 3 3:ifnull 21
obj = ((Object) ((new android.support.v4.media.MediaMetadataCompat.Builder(mediametadatacompat, MediaSessionCompat.sMaxBitmapSize)).build()));
// 4 6:new #443 <Class android.support.v4.media.MediaMetadataCompat$Builder>
// 5 9:dup
// 6 10:aload_1
// 7 11:getstatic #446 <Field int MediaSessionCompat.sMaxBitmapSize>
// 8 14:invokespecial #449 <Method void android.support.v4.media.MediaMetadataCompat$Builder(MediaMetadataCompat, int)>
// 9 17:invokevirtual #452 <Method MediaMetadataCompat android.support.v4.media.MediaMetadataCompat$Builder.build()>
// 10 20:astore_2
mediametadatacompat = ((MediaMetadataCompat) (mLock));
// 11 21:aload_0
// 12 22:getfield #83 <Field Object mLock>
// 13 25:astore_1
mediametadatacompat;
// 14 26:aload_1
JVM INSTR monitorenter ;
// 15 27:monitorenter
mMetadata = ((MediaMetadataCompat) (obj));
// 16 28:aload_0
// 17 29:aload_2
// 18 30:putfield #337 <Field MediaMetadataCompat mMetadata>
mediametadatacompat;
// 19 33:aload_1
JVM INSTR monitorexit ;
// 20 34:monitorexit
goto _L1
//* 21 35:goto 43
obj;
// 22 38:astore_2
//* 23 39:aload_1
throw obj;
// 24 40:monitorexit
// 25 41:aload_2
// 26 42:athrow
_L1:
sendMetadata(((MediaMetadataCompat) (obj)));
// 27 43:aload_0
// 28 44:aload_2
// 29 45:invokespecial #454 <Method void sendMetadata(MediaMetadataCompat)>
if(!mIsActive)
//* 30 48:aload_0
//* 31 49:getfield #92 <Field boolean mIsActive>
//* 32 52:ifne 56
return;
// 33 55:return
if(obj == null)
//* 34 56:aload_2
//* 35 57:ifnonnull 65
mediametadatacompat = null;
// 36 60:aconst_null
// 37 61:astore_1
else
//* 38 62:goto 70
mediametadatacompat = ((MediaMetadataCompat) (((MediaMetadataCompat) (obj)).getBundle()));
// 39 65:aload_2
// 40 66:invokevirtual #458 <Method Bundle MediaMetadataCompat.getBundle()>
// 41 69:astore_1
buildRccMetadata(((Bundle) (mediametadatacompat))).apply();
// 42 70:aload_0
// 43 71:aload_1
// 44 72:invokevirtual #460 <Method android.media.RemoteControlClient$MetadataEditor buildRccMetadata(Bundle)>
// 45 75:invokevirtual #463 <Method void android.media.RemoteControlClient$MetadataEditor.apply()>
return;
// 46 78:return
}
public void setPlaybackState(PlaybackStateCompat playbackstatecompat)
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #83 <Field Object mLock>
// 2 4:astore_2
obj;
// 3 5:aload_2
JVM INSTR monitorenter ;
// 4 6:monitorenter
mState = playbackstatecompat;
// 5 7:aload_0
// 6 8:aload_1
// 7 9:putfield #335 <Field PlaybackStateCompat mState>
obj;
// 8 12:aload_2
JVM INSTR monitorexit ;
// 9 13:monitorexit
goto _L1
//* 10 14:goto 22
playbackstatecompat;
// 11 17:astore_1
//* 12 18:aload_2
throw playbackstatecompat;
// 13 19:monitorexit
// 14 20:aload_1
// 15 21:athrow
_L1:
sendState(playbackstatecompat);
// 16 22:aload_0
// 17 23:aload_1
// 18 24:invokespecial #465 <Method void sendState(PlaybackStateCompat)>
if(!mIsActive)
//* 19 27:aload_0
//* 20 28:getfield #92 <Field boolean mIsActive>
//* 21 31:ifne 35
return;
// 22 34:return
if(playbackstatecompat == null)
//* 23 35:aload_1
//* 24 36:ifnonnull 56
{
mRcc.setPlaybackState(0);
// 25 39:aload_0
// 26 40:getfield #157 <Field RemoteControlClient mRcc>
// 27 43:iconst_0
// 28 44:invokevirtual #467 <Method void RemoteControlClient.setPlaybackState(int)>
mRcc.setTransportControlFlags(0);
// 29 47:aload_0
// 30 48:getfield #157 <Field RemoteControlClient mRcc>
// 31 51:iconst_0
// 32 52:invokevirtual #470 <Method void RemoteControlClient.setTransportControlFlags(int)>
return;
// 33 55:return
} else
{
setRccState(playbackstatecompat);
// 34 56:aload_0
// 35 57:aload_1
// 36 58:invokevirtual #473 <Method void setRccState(PlaybackStateCompat)>
mRcc.setTransportControlFlags(getRccTransportControlFlagsFromActions(playbackstatecompat.getActions()));
// 37 61:aload_0
// 38 62:getfield #157 <Field RemoteControlClient mRcc>
// 39 65:aload_0
// 40 66:aload_1
// 41 67:invokevirtual #476 <Method long PlaybackStateCompat.getActions()>
// 42 70:invokevirtual #478 <Method int getRccTransportControlFlagsFromActions(long)>
// 43 73:invokevirtual #470 <Method void RemoteControlClient.setTransportControlFlags(int)>
return;
// 44 76:return
}
}
public void setPlaybackToLocal(int i)
{
if(mVolumeProvider != null)
//* 0 0:aload_0
//* 1 1:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
//* 2 4:ifnull 15
mVolumeProvider.setCallback(((android.support.v4.media.VolumeProviderCompat.Callback) (null)));
// 3 7:aload_0
// 4 8:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 5 11:aconst_null
// 6 12:invokevirtual #482 <Method void VolumeProviderCompat.setCallback(android.support.v4.media.VolumeProviderCompat$Callback)>
mVolumeType = 1;
// 7 15:aload_0
// 8 16:iconst_1
// 9 17:putfield #148 <Field int mVolumeType>
sendVolumeInfoChanged(new ParcelableVolumeInfo(mVolumeType, mLocalStream, 2, mAudioManager.getStreamMaxVolume(mLocalStream), mAudioManager.getStreamVolume(mLocalStream)));
// 10 20:aload_0
// 11 21:new #484 <Class ParcelableVolumeInfo>
// 12 24:dup
// 13 25:aload_0
// 14 26:getfield #148 <Field int mVolumeType>
// 15 29:aload_0
// 16 30:getfield #150 <Field int mLocalStream>
// 17 33:iconst_2
// 18 34:aload_0
// 19 35:getfield #128 <Field AudioManager mAudioManager>
// 20 38:aload_0
// 21 39:getfield #150 <Field int mLocalStream>
// 22 42:invokevirtual #487 <Method int AudioManager.getStreamMaxVolume(int)>
// 23 45:aload_0
// 24 46:getfield #128 <Field AudioManager mAudioManager>
// 25 49:aload_0
// 26 50:getfield #150 <Field int mLocalStream>
// 27 53:invokevirtual #490 <Method int AudioManager.getStreamVolume(int)>
// 28 56:invokespecial #493 <Method void ParcelableVolumeInfo(int, int, int, int, int)>
// 29 59:invokevirtual #495 <Method void sendVolumeInfoChanged(ParcelableVolumeInfo)>
// 30 62:return
}
public void setPlaybackToRemote(VolumeProviderCompat volumeprovidercompat)
{
if(volumeprovidercompat == null)
//* 0 0:aload_1
//* 1 1:ifnonnull 15
throw new IllegalArgumentException("volumeProvider may not be null");
// 2 4:new #103 <Class IllegalArgumentException>
// 3 7:dup
// 4 8:ldc2 #499 <String "volumeProvider may not be null">
// 5 11:invokespecial #108 <Method void IllegalArgumentException(String)>
// 6 14:athrow
if(mVolumeProvider != null)
//* 7 15:aload_0
//* 8 16:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
//* 9 19:ifnull 30
mVolumeProvider.setCallback(((android.support.v4.media.VolumeProviderCompat.Callback) (null)));
// 10 22:aload_0
// 11 23:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 12 26:aconst_null
// 13 27:invokevirtual #482 <Method void VolumeProviderCompat.setCallback(android.support.v4.media.VolumeProviderCompat$Callback)>
mVolumeType = 2;
// 14 30:aload_0
// 15 31:iconst_2
// 16 32:putfield #148 <Field int mVolumeType>
mVolumeProvider = volumeprovidercompat;
// 17 35:aload_0
// 18 36:aload_1
// 19 37:putfield #226 <Field VolumeProviderCompat mVolumeProvider>
sendVolumeInfoChanged(new ParcelableVolumeInfo(mVolumeType, mLocalStream, mVolumeProvider.getVolumeControl(), mVolumeProvider.getMaxVolume(), mVolumeProvider.getCurrentVolume()));
// 20 40:aload_0
// 21 41:new #484 <Class ParcelableVolumeInfo>
// 22 44:dup
// 23 45:aload_0
// 24 46:getfield #148 <Field int mVolumeType>
// 25 49:aload_0
// 26 50:getfield #150 <Field int mLocalStream>
// 27 53:aload_0
// 28 54:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 29 57:invokevirtual #502 <Method int VolumeProviderCompat.getVolumeControl()>
// 30 60:aload_0
// 31 61:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 32 64:invokevirtual #505 <Method int VolumeProviderCompat.getMaxVolume()>
// 33 67:aload_0
// 34 68:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 35 71:invokevirtual #508 <Method int VolumeProviderCompat.getCurrentVolume()>
// 36 74:invokespecial #493 <Method void ParcelableVolumeInfo(int, int, int, int, int)>
// 37 77:invokevirtual #495 <Method void sendVolumeInfoChanged(ParcelableVolumeInfo)>
volumeprovidercompat.setCallback(mVolumeCallback);
// 38 80:aload_1
// 39 81:aload_0
// 40 82:getfield #101 <Field android.support.v4.media.VolumeProviderCompat$Callback mVolumeCallback>
// 41 85:invokevirtual #482 <Method void VolumeProviderCompat.setCallback(android.support.v4.media.VolumeProviderCompat$Callback)>
// 42 88:return
}
public void setQueue(List list)
{
mQueue = list;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #511 <Field List mQueue>
sendQueue(list);
// 3 5:aload_0
// 4 6:aload_1
// 5 7:invokespecial #513 <Method void sendQueue(List)>
// 6 10:return
}
public void setQueueTitle(CharSequence charsequence)
{
mQueueTitle = charsequence;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #516 <Field CharSequence mQueueTitle>
sendQueueTitle(charsequence);
// 3 5:aload_0
// 4 6:aload_1
// 5 7:invokespecial #518 <Method void sendQueueTitle(CharSequence)>
// 6 10:return
}
public void setRatingType(int i)
{
mRatingType = i;
// 0 0:aload_0
// 1 1:iload_1
// 2 2:putfield #146 <Field int mRatingType>
// 3 5:return
}
void setRccState(PlaybackStateCompat playbackstatecompat)
{
mRcc.setPlaybackState(getRccStateFromState(playbackstatecompat.getState()));
// 0 0:aload_0
// 1 1:getfield #157 <Field RemoteControlClient mRcc>
// 2 4:aload_0
// 3 5:aload_1
// 4 6:invokevirtual #346 <Method int PlaybackStateCompat.getState()>
// 5 9:invokevirtual #521 <Method int getRccStateFromState(int)>
// 6 12:invokevirtual #467 <Method void RemoteControlClient.setPlaybackState(int)>
// 7 15:return
}
public void setRepeatMode(int i)
{
if(mRepeatMode != i)
//* 0 0:aload_0
//* 1 1:getfield #524 <Field int mRepeatMode>
//* 2 4:iload_1
//* 3 5:icmpeq 18
{
mRepeatMode = i;
// 4 8:aload_0
// 5 9:iload_1
// 6 10:putfield #524 <Field int mRepeatMode>
sendRepeatMode(i);
// 7 13:aload_0
// 8 14:iload_1
// 9 15:invokespecial #526 <Method void sendRepeatMode(int)>
}
// 10 18:return
}
public void setSessionActivity(PendingIntent pendingintent)
{
Object obj = mLock;
// 0 0:aload_0
// 1 1:getfield #83 <Field Object mLock>
// 2 4:astore_2
obj;
// 3 5:aload_2
JVM INSTR monitorenter ;
// 4 6:monitorenter
mSessionActivity = pendingintent;
// 5 7:aload_0
// 6 8:aload_1
// 7 9:putfield #529 <Field PendingIntent mSessionActivity>
obj;
// 8 12:aload_2
JVM INSTR monitorexit ;
// 9 13:monitorexit
return;
// 10 14:return
pendingintent;
// 11 15:astore_1
//* 12 16:aload_2
throw pendingintent;
// 13 17:monitorexit
// 14 18:aload_1
// 15 19:athrow
}
public void setShuffleModeEnabled(boolean flag)
{
if(mShuffleModeEnabled != flag)
//* 0 0:aload_0
//* 1 1:getfield #532 <Field boolean mShuffleModeEnabled>
//* 2 4:iload_1
//* 3 5:icmpeq 18
{
mShuffleModeEnabled = flag;
// 4 8:aload_0
// 5 9:iload_1
// 6 10:putfield #532 <Field boolean mShuffleModeEnabled>
sendShuffleModeEnabled(flag);
// 7 13:aload_0
// 8 14:iload_1
// 9 15:invokespecial #534 <Method void sendShuffleModeEnabled(boolean)>
}
// 10 18:return
}
void setVolumeTo(int i, int j)
{
if(mVolumeType == 2)
//* 0 0:aload_0
//* 1 1:getfield #148 <Field int mVolumeType>
//* 2 4:iconst_2
//* 3 5:icmpne 24
{
if(mVolumeProvider != null)
//* 4 8:aload_0
//* 5 9:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
//* 6 12:ifnull 37
{
mVolumeProvider.onSetVolumeTo(i);
// 7 15:aload_0
// 8 16:getfield #226 <Field VolumeProviderCompat mVolumeProvider>
// 9 19:iload_1
// 10 20:invokevirtual #538 <Method void VolumeProviderCompat.onSetVolumeTo(int)>
return;
// 11 23:return
}
} else
{
mAudioManager.setStreamVolume(mLocalStream, i, j);
// 12 24:aload_0
// 13 25:getfield #128 <Field AudioManager mAudioManager>
// 14 28:aload_0
// 15 29:getfield #150 <Field int mLocalStream>
// 16 32:iload_1
// 17 33:iload_2
// 18 34:invokevirtual #541 <Method void AudioManager.setStreamVolume(int, int, int)>
}
// 19 37:return
}
void unregisterMediaButtonEventReceiver(PendingIntent pendingintent, ComponentName componentname)
{
mAudioManager.unregisterMediaButtonEventReceiver(componentname);
// 0 0:aload_0
// 1 1:getfield #128 <Field AudioManager mAudioManager>
// 2 4:aload_2
// 3 5:invokevirtual #544 <Method void AudioManager.unregisterMediaButtonEventReceiver(ComponentName)>
// 4 8:return
}
boolean update()
{
if(mIsActive)
//* 0 0:aload_0
//* 1 1:getfield #92 <Field boolean mIsActive>
//* 2 4:ifeq 152
{
if(!mIsMbrRegistered && (mFlags & 1) != 0)
//* 3 7:aload_0
//* 4 8:getfield #94 <Field boolean mIsMbrRegistered>
//* 5 11:ifne 43
//* 6 14:aload_0
//* 7 15:getfield #440 <Field int mFlags>
//* 8 18:iconst_1
//* 9 19:iand
//* 10 20:ifeq 43
{
registerMediaButtonEventReceiver(mMediaButtonReceiverIntent, mMediaButtonReceiverComponentName);
// 11 23:aload_0
// 12 24:aload_0
// 13 25:getfield #134 <Field PendingIntent mMediaButtonReceiverIntent>
// 14 28:aload_0
// 15 29:getfield #132 <Field ComponentName mMediaButtonReceiverComponentName>
// 16 32:invokevirtual #546 <Method void registerMediaButtonEventReceiver(PendingIntent, ComponentName)>
mIsMbrRegistered = true;
// 17 35:aload_0
// 18 36:iconst_1
// 19 37:putfield #94 <Field boolean mIsMbrRegistered>
} else
//* 20 40:goto 76
if(mIsMbrRegistered && (mFlags & 1) == 0)
//* 21 43:aload_0
//* 22 44:getfield #94 <Field boolean mIsMbrRegistered>
//* 23 47:ifeq 76
//* 24 50:aload_0
//* 25 51:getfield #440 <Field int mFlags>
//* 26 54:iconst_1
//* 27 55:iand
//* 28 56:ifne 76
{
unregisterMediaButtonEventReceiver(mMediaButtonReceiverIntent, mMediaButtonReceiverComponentName);
// 29 59:aload_0
// 30 60:aload_0
// 31 61:getfield #134 <Field PendingIntent mMediaButtonReceiverIntent>
// 32 64:aload_0
// 33 65:getfield #132 <Field ComponentName mMediaButtonReceiverComponentName>
// 34 68:invokevirtual #548 <Method void unregisterMediaButtonEventReceiver(PendingIntent, ComponentName)>
mIsMbrRegistered = false;
// 35 71:aload_0
// 36 72:iconst_0
// 37 73:putfield #94 <Field boolean mIsMbrRegistered>
}
if(!mIsRccRegistered && (mFlags & 2) != 0)
//* 38 76:aload_0
//* 39 77:getfield #96 <Field boolean mIsRccRegistered>
//* 40 80:ifne 110
//* 41 83:aload_0
//* 42 84:getfield #440 <Field int mFlags>
//* 43 87:iconst_2
//* 44 88:iand
//* 45 89:ifeq 110
{
mAudioManager.registerRemoteControlClient(mRcc);
// 46 92:aload_0
// 47 93:getfield #128 <Field AudioManager mAudioManager>
// 48 96:aload_0
// 49 97:getfield #157 <Field RemoteControlClient mRcc>
// 50 100:invokevirtual #552 <Method void AudioManager.registerRemoteControlClient(RemoteControlClient)>
mIsRccRegistered = true;
// 51 103:aload_0
// 52 104:iconst_1
// 53 105:putfield #96 <Field boolean mIsRccRegistered>
return true;
// 54 108:iconst_1
// 55 109:ireturn
}
if(mIsRccRegistered && (mFlags & 2) == 0)
//* 56 110:aload_0
//* 57 111:getfield #96 <Field boolean mIsRccRegistered>
//* 58 114:ifeq 207
//* 59 117:aload_0
//* 60 118:getfield #440 <Field int mFlags>
//* 61 121:iconst_2
//* 62 122:iand
//* 63 123:ifne 207
{
mRcc.setPlaybackState(0);
// 64 126:aload_0
// 65 127:getfield #157 <Field RemoteControlClient mRcc>
// 66 130:iconst_0
// 67 131:invokevirtual #467 <Method void RemoteControlClient.setPlaybackState(int)>
mAudioManager.unregisterRemoteControlClient(mRcc);
// 68 134:aload_0
// 69 135:getfield #128 <Field AudioManager mAudioManager>
// 70 138:aload_0
// 71 139:getfield #157 <Field RemoteControlClient mRcc>
// 72 142:invokevirtual #555 <Method void AudioManager.unregisterRemoteControlClient(RemoteControlClient)>
mIsRccRegistered = false;
// 73 145:aload_0
// 74 146:iconst_0
// 75 147:putfield #96 <Field boolean mIsRccRegistered>
return false;
// 76 150:iconst_0
// 77 151:ireturn
}
} else
{
if(mIsMbrRegistered)
//* 78 152:aload_0
//* 79 153:getfield #94 <Field boolean mIsMbrRegistered>
//* 80 156:ifeq 176
{
unregisterMediaButtonEventReceiver(mMediaButtonReceiverIntent, mMediaButtonReceiverComponentName);
// 81 159:aload_0
// 82 160:aload_0
// 83 161:getfield #134 <Field PendingIntent mMediaButtonReceiverIntent>
// 84 164:aload_0
// 85 165:getfield #132 <Field ComponentName mMediaButtonReceiverComponentName>
// 86 168:invokevirtual #548 <Method void unregisterMediaButtonEventReceiver(PendingIntent, ComponentName)>
mIsMbrRegistered = false;
// 87 171:aload_0
// 88 172:iconst_0
// 89 173:putfield #94 <Field boolean mIsMbrRegistered>
}
if(mIsRccRegistered)
//* 90 176:aload_0
//* 91 177:getfield #96 <Field boolean mIsRccRegistered>
//* 92 180:ifeq 207
{
mRcc.setPlaybackState(0);
// 93 183:aload_0
// 94 184:getfield #157 <Field RemoteControlClient mRcc>
// 95 187:iconst_0
// 96 188:invokevirtual #467 <Method void RemoteControlClient.setPlaybackState(int)>
mAudioManager.unregisterRemoteControlClient(mRcc);
// 97 191:aload_0
// 98 192:getfield #128 <Field AudioManager mAudioManager>
// 99 195:aload_0
// 100 196:getfield #157 <Field RemoteControlClient mRcc>
// 101 199:invokevirtual #555 <Method void AudioManager.unregisterRemoteControlClient(RemoteControlClient)>
mIsRccRegistered = false;
// 102 202:aload_0
// 103 203:iconst_0
// 104 204:putfield #96 <Field boolean mIsRccRegistered>
}
}
return false;
// 105 207:iconst_0
// 106 208:ireturn
}
static final int RCC_PLAYSTATE_NONE = 0;
final AudioManager mAudioManager;
volatile MediaSessionCompat.Callback mCallback;
private final Context mContext;
final RemoteCallbackList mControllerCallbacks = new RemoteCallbackList();
boolean mDestroyed;
Bundle mExtras;
int mFlags;
private MessageHandler mHandler;
boolean mIsActive;
private boolean mIsMbrRegistered;
private boolean mIsRccRegistered;
int mLocalStream;
final Object mLock = new Object();
private final ComponentName mMediaButtonReceiverComponentName;
private final PendingIntent mMediaButtonReceiverIntent;
MediaMetadataCompat mMetadata;
final String mPackageName;
List mQueue;
CharSequence mQueueTitle;
int mRatingType;
final RemoteControlClient mRcc;
int mRepeatMode;
PendingIntent mSessionActivity;
boolean mShuffleModeEnabled;
PlaybackStateCompat mState;
private final MediaSessionStub mStub;
final String mTag;
private final MediaSessionCompat.Token mToken;
private android.support.v4.media.VolumeProviderCompat.Callback mVolumeCallback;
VolumeProviderCompat mVolumeProvider;
int mVolumeType;
public MediaSessionCompat$MediaSessionImplBase(Context context, String s, ComponentName componentname, PendingIntent pendingintent)
{
// 0 0:aload_0
// 1 1:invokespecial #81 <Method void Object()>
// 2 4:aload_0
// 3 5:new #4 <Class Object>
// 4 8:dup
// 5 9:invokespecial #81 <Method void Object()>
// 6 12:putfield #83 <Field Object mLock>
// 7 15:aload_0
// 8 16:new #85 <Class RemoteCallbackList>
// 9 19:dup
// 10 20:invokespecial #86 <Method void RemoteCallbackList()>
// 11 23:putfield #88 <Field RemoteCallbackList mControllerCallbacks>
mDestroyed = false;
// 12 26:aload_0
// 13 27:iconst_0
// 14 28:putfield #90 <Field boolean mDestroyed>
mIsActive = false;
// 15 31:aload_0
// 16 32:iconst_0
// 17 33:putfield #92 <Field boolean mIsActive>
mIsMbrRegistered = false;
// 18 36:aload_0
// 19 37:iconst_0
// 20 38:putfield #94 <Field boolean mIsMbrRegistered>
mIsRccRegistered = false;
// 21 41:aload_0
// 22 42:iconst_0
// 23 43:putfield #96 <Field boolean mIsRccRegistered>
mVolumeCallback = ((android.support.v4.media.VolumeProviderCompat.Callback) (new android.support.v4.media.VolumeProviderCompat.Callback() {
public void onVolumeChanged(VolumeProviderCompat volumeprovidercompat)
{
if(mVolumeProvider != volumeprovidercompat)
//* 0 0:aload_0
//* 1 1:getfield #15 <Field MediaSessionCompat$MediaSessionImplBase this$0>
//* 2 4:getfield #25 <Field VolumeProviderCompat MediaSessionCompat$MediaSessionImplBase.mVolumeProvider>
//* 3 7:aload_1
//* 4 8:if_acmpeq 12
{
return;
// 5 11:return
} else
{
volumeprovidercompat = ((VolumeProviderCompat) (new ParcelableVolumeInfo(mVolumeType, mLocalStream, volumeprovidercompat.getVolumeControl(), volumeprovidercompat.getMaxVolume(), volumeprovidercompat.getCurrentVolume())));
// 6 12:new #27 <Class ParcelableVolumeInfo>
// 7 15:dup
// 8 16:aload_0
// 9 17:getfield #15 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 10 20:getfield #31 <Field int MediaSessionCompat$MediaSessionImplBase.mVolumeType>
// 11 23:aload_0
// 12 24:getfield #15 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 13 27:getfield #34 <Field int MediaSessionCompat$MediaSessionImplBase.mLocalStream>
// 14 30:aload_1
// 15 31:invokevirtual #40 <Method int VolumeProviderCompat.getVolumeControl()>
// 16 34:aload_1
// 17 35:invokevirtual #43 <Method int VolumeProviderCompat.getMaxVolume()>
// 18 38:aload_1
// 19 39:invokevirtual #46 <Method int VolumeProviderCompat.getCurrentVolume()>
// 20 42:invokespecial #49 <Method void ParcelableVolumeInfo(int, int, int, int, int)>
// 21 45:astore_1
sendVolumeInfoChanged(((ParcelableVolumeInfo) (volumeprovidercompat)));
// 22 46:aload_0
// 23 47:getfield #15 <Field MediaSessionCompat$MediaSessionImplBase this$0>
// 24 50:aload_1
// 25 51:invokevirtual #53 <Method void MediaSessionCompat$MediaSessionImplBase.sendVolumeInfoChanged(ParcelableVolumeInfo)>
return;
// 26 54:return
}
}
final MediaSessionCompat.MediaSessionImplBase this$0;
{
this$0 = MediaSessionCompat.MediaSessionImplBase.this;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #15 <Field MediaSessionCompat$MediaSessionImplBase this$0>
super();
// 3 5:aload_0
// 4 6:invokespecial #18 <Method void android.support.v4.media.VolumeProviderCompat$Callback()>
// 5 9:return
}
}
));
// 24 46:aload_0
// 25 47:new #11 <Class MediaSessionCompat$MediaSessionImplBase$1>
// 26 50:dup
// 27 51:aload_0
// 28 52:invokespecial #99 <Method void MediaSessionCompat$MediaSessionImplBase$1(MediaSessionCompat$MediaSessionImplBase)>
// 29 55:putfield #101 <Field android.support.v4.media.VolumeProviderCompat$Callback mVolumeCallback>
if(componentname == null)
//* 30 58:aload_3
//* 31 59:ifnonnull 72
{
throw new IllegalArgumentException("MediaButtonReceiver component may not be null.");
// 32 62:new #103 <Class IllegalArgumentException>
// 33 65:dup
// 34 66:ldc1 #105 <String "MediaButtonReceiver component may not be null.">
// 35 68:invokespecial #108 <Method void IllegalArgumentException(String)>
// 36 71:athrow
} else
{
mContext = context;
// 37 72:aload_0
// 38 73:aload_1
// 39 74:putfield #110 <Field Context mContext>
mPackageName = context.getPackageName();
// 40 77:aload_0
// 41 78:aload_1
// 42 79:invokevirtual #116 <Method String Context.getPackageName()>
// 43 82:putfield #118 <Field String mPackageName>
mAudioManager = (AudioManager)context.getSystemService("audio");
// 44 85:aload_0
// 45 86:aload_1
// 46 87:ldc1 #120 <String "audio">
// 47 89:invokevirtual #124 <Method Object Context.getSystemService(String)>
// 48 92:checkcast #126 <Class AudioManager>
// 49 95:putfield #128 <Field AudioManager mAudioManager>
mTag = s;
// 50 98:aload_0
// 51 99:aload_2
// 52 100:putfield #130 <Field String mTag>
mMediaButtonReceiverComponentName = componentname;
// 53 103:aload_0
// 54 104:aload_3
// 55 105:putfield #132 <Field ComponentName mMediaButtonReceiverComponentName>
mMediaButtonReceiverIntent = pendingintent;
// 56 108:aload_0
// 57 109:aload 4
// 58 111:putfield #134 <Field PendingIntent mMediaButtonReceiverIntent>
mStub = new MediaSessionStub();
// 59 114:aload_0
// 60 115:new #16 <Class MediaSessionCompat$MediaSessionImplBase$MediaSessionStub>
// 61 118:dup
// 62 119:aload_0
// 63 120:invokespecial #135 <Method void MediaSessionCompat$MediaSessionImplBase$MediaSessionStub(MediaSessionCompat$MediaSessionImplBase)>
// 64 123:putfield #137 <Field MediaSessionCompat$MediaSessionImplBase$MediaSessionStub mStub>
mToken = new MediaSessionCompat.Token(((Object) (mStub)));
// 65 126:aload_0
// 66 127:new #139 <Class MediaSessionCompat$Token>
// 67 130:dup
// 68 131:aload_0
// 69 132:getfield #137 <Field MediaSessionCompat$MediaSessionImplBase$MediaSessionStub mStub>
// 70 135:invokespecial #142 <Method void MediaSessionCompat$Token(Object)>
// 71 138:putfield #144 <Field MediaSessionCompat$Token mToken>
mRatingType = 0;
// 72 141:aload_0
// 73 142:iconst_0
// 74 143:putfield #146 <Field int mRatingType>
mVolumeType = 1;
// 75 146:aload_0
// 76 147:iconst_1
// 77 148:putfield #148 <Field int mVolumeType>
mLocalStream = 3;
// 78 151:aload_0
// 79 152:iconst_3
// 80 153:putfield #150 <Field int mLocalStream>
mRcc = new RemoteControlClient(pendingintent);
// 81 156:aload_0
// 82 157:new #152 <Class RemoteControlClient>
// 83 160:dup
// 84 161:aload 4
// 85 163:invokespecial #155 <Method void RemoteControlClient(PendingIntent)>
// 86 166:putfield #157 <Field RemoteControlClient mRcc>
return;
// 87 169:return
}
}
}
| [
"[email protected]"
] | |
cafc5797f556f191d09f50cd1b011d8349247844 | 32089db09af39f6f85426fc54f85c1a132c724c0 | /プログラマカレッジ資料/ecsite/src/com/internousdev/ecsite/action/HomeAction.java | 1af461b4a3f427d9447f4aa31d0fe0196295ce7a | [] | no_license | masa0308/test | d997ba75edcfc297c6e41680454aca8324e0313c | 4738e69ea20a43c50defdb16cf0c6e0e4934adf9 | refs/heads/master | 2021-09-10T17:59:24.128806 | 2018-03-30T12:46:33 | 2018-03-30T12:46:33 | 116,369,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | package com.internousdev.ecsite.action;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.internousdev.ecsite.dao.BuyItemDAO;
import com.internousdev.ecsite.dto.BuyItemDTO;
import com.opensymphony.xwork2.ActionSupport;
public class HomeAction extends ActionSupport implements SessionAware{
public Map<String, Object> session;
/**
* ログインボタン押下時に実行
* ログイン画面へ遷移します。
*
* @return SUCCESS
*/
public String execute() {
String result = "login";
if (session.containsKey("id")){
// アイテム情報を取得
BuyItemDAO buyItemDAO = new BuyItemDAO();
BuyItemDTO buyItemDTO = buyItemDAO.getBuyItemInfo();
session.put("id", buyItemDTO.getId());
session.put("buyItem_name", buyItemDTO.getItemName());
session.put("buyItem_price", buyItemDTO.getItemPrice());
result = SUCCESS;
}
return result;
}
@Override
public void setSession(Map<String, Object> session){
this.session = session;
}
public Map<String, Object> getSession() {
return this.session;
}
} | [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.