blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
97739aeda531051695bd4cf4cb5df052d7831522
c4aed6c53d0ebab601fb5bcabd1bf07c3adcdb81
/src/main/java/com/career/Action/PersonalDetailsAction.java
956a2ef41ed8e06f828b7e320adf326840c0ceae
[]
no_license
mani-sreekakula/careerportal-heroku
7eb6a1c6c5aaee4f89a2d0ef9f87d08949bd7e63
e805fcc07ae42319ec312fdfc24e5c5ccfd8c78d
refs/heads/master
2021-06-01T15:58:22.960102
2016-09-02T14:09:34
2016-09-02T14:09:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,650
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.career.Action; import com.career.Bo.PersonalDetailsBo; import com.career.DTO.PersonalDetailsDto; import com.opensymphony.xwork2.ActionSupport; import java.util.Map; import org.apache.struts2.interceptor.SessionAware; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * * @author avinashkumar */ public class PersonalDetailsAction extends ActionSupport implements SessionAware { String userId; String firstName; String lastName; String birthDate; String mStatus; String sex; String uEmail; String mobileNum; String AddrLine1; String AddrLine2; String Dist; String city; String state; String pin; String ch1; String AddrLine12; String AddrLine22; String Dist2; String city2; String state2; String pin2; Map session; protected PersonalDetailsDto personal = new PersonalDetailsDto(); PersonalDetailsBo personalDetailsBo; public PersonalDetailsAction() { ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); personalDetailsBo = (PersonalDetailsBo)context.getBean("personalDetailsBoProxy"); } public PersonalDetailsBo getPersonalDetailsBo() { return personalDetailsBo; } public void setPersonalDetailsBo(PersonalDetailsBo personalDetailsBo) { this.personalDetailsBo = personalDetailsBo; } public String getAddrLine1() { return AddrLine1; } public void setAddrLine1(String AddrLine1) { this.AddrLine1 = AddrLine1; } public String getAddrLine12() { return AddrLine12; } public void setAddrLine12(String AddrLine12) { this.AddrLine12 = AddrLine12; } public String getAddrLine2() { return AddrLine2; } public void setAddrLine2(String AddrLine2) { this.AddrLine2 = AddrLine2; } public String getAddrLine22() { return AddrLine22; } public void setAddrLine22(String AddrLine22) { this.AddrLine22 = AddrLine22; } public String getDist() { return Dist; } public void setDist(String Dist) { this.Dist = Dist; } public String getDist2() { return Dist2; } public void setDist2(String Dist2) { this.Dist2 = Dist2; } public String getBirthDate() { return birthDate; } public void setBirthDate(String birthDate) { this.birthDate = birthDate; } public String getCh1() { return ch1; } public void setCh1(String ch1) { this.ch1 = ch1; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getCity2() { return city2; } public void setCity2(String city2) { this.city2 = city2; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getmStatus() { return mStatus; } public void setmStatus(String mStatus) { this.mStatus = mStatus; } public String getMobileNum() { return mobileNum; } public void setMobileNum(String mobileNum) { this.mobileNum = mobileNum; } public String getPin() { return pin; } public void setPin(String pin) { this.pin = pin; } public String getPin2() { return pin2; } public void setPin2(String pin2) { this.pin2 = pin2; } public Map getSession() { return session; } @Override public void setSession(Map session) { this.session = session; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getState2() { return state2; } public void setState2(String state2) { this.state2 = state2; } public String getuEmail() { return uEmail; } public void setuEmail(String uEmail) { this.uEmail = uEmail; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public boolean isSessionAlive() { if (session.isEmpty()) { return false; } else { return true; } } public String insertPersonalDetails() { if (isSessionAlive()) { userId = (String) session.get("userid"); System.out.println("<-- Personal Details -->"); personal.setUserId(userId); personal.setFirstName(firstName); personal.setLastName(lastName); personal.setBirthDate(birthDate); personal.setmStatus(mStatus); personal.setSex(sex); personal.setuEmail(uEmail); personal.setMobileNum(mobileNum); personal.setAddrLine1(AddrLine1); personal.setAddrLine2(AddrLine2); personal.setDist(Dist); personal.setCity(city); personal.setState(state); personal.setPin(pin); personal.setCh1(ch1); personal.setAddrLine12(AddrLine12); personal.setAddrLine22(AddrLine22); personal.setDist2(Dist2); personal.setCity2(city2); personal.setState2(state2); personal.setPin2(pin2); personalDetailsBo.insertPersonalDetails(personal); System.out.println("Insert personaldetails"+userId); addActionMessage("Personal details saved successfully. "); return "success"; } else { addActionError("session expired"); return "ERROR"; } } public String fetchPersonalDetails() { if (isSessionAlive()) { userId = (String) session.get("userid"); System.out.println("<-- Fetch Personal Details -->"); personal = personalDetailsBo.fetchPersonalDetails(userId); firstName = personal.getFirstName(); lastName = personal.getLastName(); birthDate = personal.getBirthDate(); mStatus = personal.getmStatus(); sex = personal.getSex(); uEmail = personal.getuEmail(); mobileNum = personal.getMobileNum(); AddrLine1 = personal.getAddrLine1(); AddrLine2 = personal.getAddrLine2(); Dist = personal.getDist(); city = personal.getCity(); state = personal.getState(); pin = personal.getPin(); ch1 = personal.getCh1(); AddrLine12 = personal.getAddrLine12(); AddrLine22 = personal.getAddrLine22(); Dist2 = personal.getDist2(); city2 = personal.getCity2(); state2 = personal.getState2(); pin2 = personal.getPin2(); System.out.println("fetch personaldetails"+userId); return "success"; } else { addActionError("session expired"); return "ERROR"; } } }
9e30de06574cfbddbd4911a9289a762f2f708988
918e23a375dbe8498d58da2aa1c427201ddffc4c
/src/main/java/edu/wvnet/perfdash/CourseDisplay.java
f5ce4d0a54762d5fae67df32c316e11c7542e96f
[]
no_license
OSCELOT/wvn-perfdash
0875b609c41e6659627485ba3506a5c66ebd0a5d
1dff7d442b6a73b5c1ec3621301debdb2da5a588
refs/heads/master
2021-01-19T19:02:34.430566
2017-08-31T16:07:29
2017-08-31T16:07:29
101,183,623
1
1
null
null
null
null
UTF-8
Java
false
false
14,644
java
package edu.wvnet.perfdash; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.ResultSet; import java.sql.PreparedStatement; import java.sql.SQLException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import blackboard.db.ConnectionManager; import blackboard.db.ConnectionNotAvailableException; import blackboard.platform.session.BbSession; import blackboard.platform.session.BbSessionManagerService; import blackboard.platform.session.BbSessionManagerServiceFactory; public class CourseDisplay extends HttpServlet { private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // make sure user is logged in BbSessionManagerService sessman = BbSessionManagerServiceFactory.getInstance(); BbSession sess = sessman.getSession(request); if(!sess.isAuthenticated()) throw new ServletException("user not authenticated"); // get the user pk1 String pk1 = sess.getUserId().toExternalString().split("_")[1]; // if we're exporting, output the file if(request.getParameter("export") != null) { response.setContentType("text/csv"); response.setHeader("Content-Disposition", "inline; filename=spd.csv"); PrintWriter writer = response.getWriter(); writer.write(exportSPDTable(pk1)); writer.flush(); writer.close(); return; } // otherwise forward to the jsp to output the page String pageHelp = "Use <b>Ctrl+f</b> to find a course within the list. Use <b>Ctrl+p</b> to print."; request.setAttribute("pageHelp", pageHelp); request.setAttribute("spdtable", buildSPDTable(pk1)); if(request.getParameter("standalone") != null) request.setAttribute("standalone", "true"); else request.setAttribute("standalone", "false"); RequestDispatcher requetsDispatcherObj = request.getRequestDispatcher("/courseDisplay.jsp"); requetsDispatcherObj.forward(request, response); } private String buildSPDTable(String pk1) { String query = "select pk1, course_id, course_name, lastname, firstname, user_id, last_access_date, sum_score, sum_possible, max_possible, nvl(trunc(sum_score / sum_possible, 2)*100, 0) personal_percent, nvl(trunc(sum_score / max_possible, 2)*100, 0) peer_percent from ( with scores as ( select course_main.pk1 , course_id , course_name , lastname , firstname , user_id , last_access_date , sum(nvl(decode(NULL, manual_grade, NULL, manual_score, NULL, manual_score), (select score from attempt where attempt.pk1 = highest_attempt_pk1))) sum_score, sum(gradebook_main.possible) sum_possible from gradebook_grade join gradebook_main on gradebook_main_pk1 = gradebook_main.pk1 and possible > 0 join course_users on course_users_pk1 = course_users.pk1 join course_main on gradebook_main.crsmain_pk1 = course_main.pk1 join users on users_pk1 = users.pk1 where course_users.available_ind = 'Y' and possible > 0 and (course_main.available_ind = 'Y' or (course_main.honor_term_avail_ind = 'Y' and (select available_ind from term where term.pk1 = (select term_pk1 from course_term where course_term.crsmain_pk1 = course_main.pk1)) = 'Y' )) and course_main.row_status = 0 group by course_main.pk1 , course_id , course_name , lastname , firstname , user_id , last_access_date order by course_id , lastname , firstname , user_id , last_access_date ) select pk1, course_id, course_name, lastname, firstname, user_id, last_access_date, sum_score, sum_possible, (select max(sum_possible) from scores b where b.course_id = a.course_id group by course_id) max_possible from scores a )"; ResultSet result = null; Connection conn = null; //if(!isAdmin(pk1)) { String courses; try { courses = getAccessibleCourses(pk1); } catch (SQLException e) { return "ERROR CHECKING ACCESS: " + e.getErrorCode() + " : " + e.getMessage(); } if(courses.isEmpty()) return "Access denied. Sorry, but this tool is only for use by instructors."; query += " where course_id in (" + courses + ")"; //} float class_sum_score = 0; float class_max_possible = 0; float class_average = 0; String prevclass = ""; String prevpk1 = ""; String output = ""; try { conn = ConnectionManager.getDefaultConnection(); PreparedStatement pStatement = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); result = pStatement.executeQuery(); if (!result.isBeforeFirst() ) { return "No gradebook data was found for any courses you are associated with."; } while(true) { if(!result.isAfterLast()) result.next(); //this way we do stuff after last row without an SQLException //header row and footer if(result.isAfterLast() || !result.getString("COURSE_ID").equals(prevclass)) { //class has changed or we finished last class // close table and compute average if(!prevclass.equals("")) { // make sure this isn't the first class // footer of table class_average = class_sum_score / class_max_possible * 100; output += "\n</table>"; output += "\n<a class='classlink' href='/webapps/blackboard/execute/launcher?type=Course&id=_" + prevpk1 + "_1' target='_blank'>Visit course</a>"; output += "\n</div>"; output += "\n<h2 class='classaverage' style='color: " + percentToColor(class_average) + "'>" + String.format("%d", Math.round(class_average)) + "%</h2>"; output += "\n</div>"; if(result.isAfterLast()) break; class_sum_score = 0; class_max_possible = 0; } // header row of table prevclass = result.getString("COURSE_ID"); prevpk1 = result.getString("PK1"); output += "<div class='accordion'><h2 class='classheader'><a class='headerlink' href='#'><div class='expando expando-plus'><span class='sechead'>" + result.getString("COURSE_ID") + "<span class='coursename'>&nbsp;: " + result.getString("COURSE_NAME") + "</span></span></div></a></h2><div>"; output += "\n<table class='classtable' id=" + result.getString("COURSE_ID") + ">"; output += "\n <tr>"; output += "\n <th>LASTNAME</th>"; output += "\n <th>FIRSTNAME</th>"; output += "\n <th>USER_ID</th>"; output += "\n <th>LAST_ACCESS_DATE</th>"; output += "\n <th>PERSONAL_PERCENT</th>"; output += "\n <th>PEER_PERCENT</th>"; output += "\n </tr>"; } // remaining rows class_sum_score += result.getFloat("SUM_SCORE"); class_max_possible += result.getFloat("MAX_POSSIBLE"); output += "\n <tr style='background-color:" + percentToColor(result.getFloat("PEER_PERCENT")) + "'>"; output += "\n <td>" + result.getString("LASTNAME") + "</td>"; output += "\n <td>" + result.getString("FIRSTNAME") + "</td>"; output += "\n <td>" + result.getString("USER_ID") + "</td>"; try { if(result.getString("LAST_ACCESS_DATE") != null) output += "\n <td>" + result.getString("LAST_ACCESS_DATE").split("\\.")[0] + "</td>"; else output += "\n <td></td>"; } catch (Exception e) { output += "<td>" + e.toString() + e.getMessage() + " noooo</td>"; } output += "\n <td>" + result.getString("PERSONAL_PERCENT") + "%</td>"; output += "\n <td>" + result.getString("PEER_PERCENT") + "%</td>"; output += "\n </tr>"; } } catch (SQLException e) { output += "ERROR RETREIVING OUTPUT"; output += "\nError code: " + e.getErrorCode(); output += "\nMessage: " + e.getMessage(); } catch (ConnectionNotAvailableException e) { output += "COULD NOT GET CONNETION"; output += "\nMessage: " + e.getMessage(); } finally { if(conn != null) { ConnectionManager.releaseDefaultConnection(conn); } } return output; } private String exportSPDTable(String pk1) { // output as csv instead of html String query = "select course_id, course_name, lastname, firstname, user_id, last_access_date, sum_score, sum_possible, max_possible, nvl(trunc(sum_score / sum_possible, 2)*100, 0) personal_percent, nvl(trunc(sum_score / max_possible, 2)*100, 0) peer_percent from ( with scores as ( select course_id , course_name , lastname , firstname , user_id , last_access_date , sum(nvl(manual_score, (select score from attempt where attempt.pk1 = highest_attempt_pk1))) sum_score, sum(gradebook_main.possible) sum_possible from gradebook_grade join gradebook_main on gradebook_main_pk1 = gradebook_main.pk1 and possible > 0 join course_users on course_users_pk1 = course_users.pk1 join course_main on gradebook_main.crsmain_pk1 = course_main.pk1 join users on users_pk1 = users.pk1 where course_users.available_ind = 'Y' and possible > 0 and (course_main.available_ind = 'Y' or (course_main.honor_term_avail_ind = 'Y' and (select available_ind from term where term.pk1 = (select term_pk1 from course_term where course_term.crsmain_pk1 = course_main.pk1)) = 'Y' )) and course_main.row_status = 0 group by course_id , course_name , lastname , firstname , user_id , last_access_date order by course_id , lastname , firstname , user_id , last_access_date ) select course_id, course_name, lastname, firstname, user_id, last_access_date, sum_score, sum_possible, (select max(sum_possible) from scores b where b.course_id = a.course_id group by course_id) max_possible from scores a )"; ResultSet result = null; Connection conn = null; //if(!isAdmin(pk1)) { String courses; try { courses = getAccessibleCourses(pk1); } catch (SQLException e) { return "ERROR CHECKING ACCESS: " + e.getErrorCode() + " : " + e.getMessage(); } if(courses.isEmpty()) return "Access denied. Sorry, but this tool is only for use by instructors."; query += " where course_id in (" + courses + ")"; //} String output = ""; try { conn = ConnectionManager.getDefaultConnection(); PreparedStatement pStatement = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); result = pStatement.executeQuery(query); if (!result.isBeforeFirst() ) { return "No gradebook data was found for any courses you are associated with."; } output = "course_id,course_name,lastname,firstname,user_id,last_access_date,sum_score,sum_possible,max_possible,personal_percent,peer_percent\r\n"; while(result.next()) { output += result.getString("COURSE_ID") + ","; output += result.getFloat("PEER_PERCENT") + ","; output += result.getString("LASTNAME") + ","; output += result.getString("FIRSTNAME") + ","; output += result.getString("USER_ID") + ","; try { if(result.getString("LAST_ACCESS_DATE") != null) output += result.getString("LAST_ACCESS_DATE").split("\\.")[0] + ","; else output += ","; } catch (Exception e) { output += "ERROR:" + e.toString() + e.getMessage() + ","; } output += result.getString("SUM_SCORE") + ","; output += result.getString("SUM_POSSIBLE") + ","; output += result.getString("MAX_POSSIBLE") + ","; output += result.getString("PERSONAL_PERCENT") + "%,"; output += result.getString("PEER_PERCENT") + "%\r\n"; } } catch (SQLException e) { output += "ERROR RETREIVING OUTPUT"; output += "\nError code: " + e.getErrorCode(); output += "\nMessage: " + e.getMessage(); } catch (ConnectionNotAvailableException e) { output += "COULD NOT GET CONNETION"; output += "\nMessage: " + e.getMessage(); } finally { if(conn != null) { ConnectionManager.releaseDefaultConnection(conn); } } return output; } private String percentToColor(float percent) { String hexstring; if(percent >= 70) hexstring = "#A6FFA6"; else if(percent >= 50) hexstring = "#FFFF80"; else hexstring = "#D06B64"; return hexstring; } private boolean isAdmin(String pk1) { String query = "select 1 from users where pk1 = '" + pk1 + "' and system_role='Z'"; ResultSet result = null; Connection conn = null; try { conn = ConnectionManager.getDefaultConnection(); PreparedStatement pStatement = conn.prepareStatement(query); result = pStatement.executeQuery(query); if (!result.isBeforeFirst() ) { return false; } } catch (Exception e) { return false; } finally { if(conn != null) { ConnectionManager.releaseDefaultConnection(conn); } } return true; } /** * Return a comma-separated list of courses the user may admin. Courses * are given as course_ids from the bblearn.course_main table. Intended * to be fed to an SQL where clause. Assumes the user is not a sysadmin. * An empty return means the user has no access. * @param pk1 the pk1 of this user in the bblearn.users table * @return a string containing a comma-separated list of course_ids */ private String getAccessibleCourses(String pk1) throws SQLException { String query = "select distinct course_id from course_main where pk1 in (select course_main_pk1 from domain_admin join domain_course_coll on parent_domain_pk1 = domain_admin.domain_pk1 where system_role = 'C' and user_pk1 = ? union select crsmain_pk1 from course_users where role = 'P' and users_pk1 = ?)"; ResultSet result = null; Connection conn = null; String courses = ""; try { conn = ConnectionManager.getDefaultConnection(); PreparedStatement pStatement = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); pStatement.setString(1, pk1); pStatement.setString(2, pk1); result = pStatement.executeQuery(); if (!result.isBeforeFirst()) return ""; //empty result while(result.next()) { courses += "'" + result.getString(1) + "'"; if(!result.isLast()) courses += ","; } } catch (ConnectionNotAvailableException e) { return ""; // let's just deny access if there's a problem } finally { if(conn != null) { ConnectionManager.releaseDefaultConnection(conn); } } return courses; } }
7a95bb7b6dd0bdd9b967a86d0289cee956f98fe2
3f67e72e751caeeaec72e27e1742ef15c604302c
/src/main/java/com/program/backend/repositories/UserSkillRepository.java
3d8fc06823e12fdd7fe2806f99bc25a5a8d2981a
[]
no_license
grkarolis/backend
a76af98d6b767e841ec1aeeeeff6e9893c7b5ddc
66b313c84b5f3a5869eae7a6f303b258693a2b47
refs/heads/master
2020-04-05T01:42:54.557474
2019-01-07T19:59:45
2019-01-07T19:59:45
156,446,444
0
0
null
null
null
null
UTF-8
Java
false
false
581
java
package com.program.backend.repositories; import com.program.backend.beans.entity.Skill; import com.program.backend.beans.entity.User; import com.program.backend.beans.entity.UserSkill; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface UserSkillRepository extends CrudRepository<UserSkill, Long> { UserSkill findByUserIdAndSkillId(Long userId, Long skillId); Iterable<UserSkill> findAllBySkill(Skill skill); List<UserSkill> findAllByUser(User user); }
34efbdb2478659b78fda1b33870b1d95789ba6c6
f08b6cc9115b73af5e193e37609884405b103ede
/app/src/main/java/com/appsnipp/claraerp/saibookhouse/Model/PaymentFailureModel.java
119a8ac821c14e24452769c7dcfe65bceadac6b2
[]
no_license
annuyadav10/SaiBookHouse
f26d94b4a061f8ca47463bd3f00cc48b73dee8dc
bdd0e0fa7b313899a45801e3a08e29d0ea86358f
refs/heads/master
2023-08-22T06:32:02.482562
2021-09-27T05:57:02
2021-09-27T05:57:02
410,758,843
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.appsnipp.claraerp.saibookhouse.Model; import com.google.gson.annotations.SerializedName; public class PaymentFailureModel{ @SerializedName("response") private String response; @SerializedName("message") private String message; @SerializedName("status") private int status; public String getResponse(){ return response; } public String getMessage(){ return message; } public int getStatus(){ return status; } }
7a0b298909430127310d515e8db48a349ef8a656
68d19b57af694054e70fe6ab934bb60abe2f6e88
/testjms1/src/com/yc/jms5/ConsumerMessageListener1.java
dab5ffe5930450c8306e645fdbb2a8a7d77a1cea
[]
no_license
MapleIsMine/jusS2SM
e43a2c298a8aaf6ec1d0dffceebd64c8a4161b4e
93fcbaf4b4d6c9d4b3b10a4c04c6a365eb25a888
refs/heads/master
2021-01-13T09:27:00.070990
2016-09-07T07:17:51
2016-09-07T07:17:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
646
java
package com.yc.jms5; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; //临听器有两种实现方案: 一种是采用原生的jms的MessageListener // 另一种是采用spring的方案:SessionAwareMessageListener //注意: 这里的MessageListener接口是 jms的接口 public class ConsumerMessageListener1 implements MessageListener { @Override public void onMessage(Message message) { if( message instanceof TextMessage){ TextMessage text=(TextMessage) message; System.out.println("接收到的消息是一个文本消息:"+ text); } } }
286235abd4cdfdb766a8e270228f846d5a4b6ce0
309995c813a0700bb6b005aa9847962c5b6de2b8
/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/basics/GettingStartedExample.java
dd56dc382617131d8669ddd63ae9d43fbc47a36c
[ "MIT", "OFL-1.1", "ISC", "Apache-2.0", "BSD-3-Clause" ]
permissive
wangxiyuan/flink
5635a643bf6a96aa5abbdef3c9577ea89700bc9c
d126d94d3a0b9efc15ba60b976bff751c97cdd55
refs/heads/master
2021-06-27T21:47:27.188829
2020-12-09T09:33:03
2020-12-09T09:33:03
194,633,053
1
2
Apache-2.0
2023-08-15T07:25:52
2019-07-01T08:34:48
Java
UTF-8
Java
false
false
6,129
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.flink.table.examples.java.basics; import org.apache.flink.table.api.EnvironmentSettings; import org.apache.flink.table.api.Table; import org.apache.flink.table.api.TableEnvironment; import org.apache.flink.table.functions.ScalarFunction; import org.apache.flink.types.Row; import org.apache.flink.util.CloseableIterator; import java.time.LocalDate; import java.util.HashSet; import java.util.Set; import static org.apache.flink.table.api.Expressions.$; import static org.apache.flink.table.api.Expressions.call; import static org.apache.flink.table.api.Expressions.range; import static org.apache.flink.table.api.Expressions.withColumns; /** * Example for getting started with the Table & SQL API. * * <p>The example shows how to create, transform, and query a table. It should give a first impression * about the look-and-feel of the API without going too much into details. See the other examples for * using connectors or more complex operations. * * <p>In particular, the example shows how to * <ul> * <li>setup a {@link TableEnvironment}, * <li>use the environment for creating example tables, registering views, and executing SQL queries, * <li>transform tables with filters and projections, * <li>declare user-defined functions, * <li>and print/collect results locally. * </ul> * * <p>The example executes two Flink jobs. The results are written to stdout. */ public final class GettingStartedExample { public static void main(String[] args) throws Exception { // setup the unified API // in this case: declare that the table programs should be executed in batch mode final EnvironmentSettings settings = EnvironmentSettings.newInstance() .inBatchMode() .build(); final TableEnvironment env = TableEnvironment.create(settings); // create a table with example data without a connector required final Table rawCustomers = env.fromValues( Row.of("Guillermo Smith", LocalDate.parse("1992-12-12"), "4081 Valley Road", "08540", "New Jersey", "m", true, 0, 78, 3), Row.of("Valeria Mendoza", LocalDate.parse("1970-03-28"), "1239 Rainbow Road", "90017", "Los Angeles", "f", true, 9, 39, 0), Row.of("Leann Holloway", LocalDate.parse("1989-05-21"), "2359 New Street", "97401", "Eugene", null, true, null, null, null), Row.of("Brandy Sanders", LocalDate.parse("1956-05-26"), "4891 Walkers-Ridge-Way", "73119", "Oklahoma City", "m", false, 9, 39, 0), Row.of("John Turner", LocalDate.parse("1982-10-02"), "2359 New Street", "60605", "Chicago", "m", true, 12, 39, 0), Row.of("Ellen Ortega", LocalDate.parse("1985-06-18"), "2448 Rodney STreet", "85023", "Phoenix", "f", true, 0, 78, 3) ); // handle ranges of columns easily final Table truncatedCustomers = rawCustomers.select(withColumns(range(1, 7))); // name columns final Table namedCustomers = truncatedCustomers .as("name", "date_of_birth", "street", "zip_code", "city", "gender", "has_newsletter"); // register a view temporarily env.createTemporaryView("customers", namedCustomers); // use SQL whenever you like // call execute() and print() to get insights env .sqlQuery( "SELECT " + " COUNT(*) AS `number of customers`, " + " AVG(YEAR(date_of_birth)) AS `average birth year` " + "FROM `customers`" ) .execute() .print(); // or further transform the data using the fluent Table API // e.g. filter, project fields, or call a user-defined function final Table youngCustomers = env .from("customers") .filter($("gender").isNotNull()) .filter($("has_newsletter").isEqual(true)) .filter($("date_of_birth").isGreaterOrEqual(LocalDate.parse("1980-01-01"))) .select( $("name").upperCase(), $("date_of_birth"), call(AddressNormalizer.class, $("street"), $("zip_code"), $("city")).as("address") ); // use execute() and collect() to retrieve your results from the cluster // this can be useful for testing before storing it in an external system try (CloseableIterator<Row> iterator = youngCustomers.execute().collect()) { final Set<Row> expectedOutput = new HashSet<>(); expectedOutput.add(Row.of("GUILLERMO SMITH", LocalDate.parse("1992-12-12"), "4081 VALLEY ROAD, 08540, NEW JERSEY")); expectedOutput.add(Row.of("JOHN TURNER", LocalDate.parse("1982-10-02"), "2359 NEW STREET, 60605, CHICAGO")); expectedOutput.add(Row.of("ELLEN ORTEGA", LocalDate.parse("1985-06-18"), "2448 RODNEY STREET, 85023, PHOENIX")); final Set<Row> actualOutput = new HashSet<>(); iterator.forEachRemaining(actualOutput::add); if (actualOutput.equals(expectedOutput)) { System.out.println("SUCCESS!"); } else { System.out.println("FAILURE!"); } } } /** * We can put frequently used procedures in user-defined functions. * * <p>It is possible to call third-party libraries here as well. */ public static class AddressNormalizer extends ScalarFunction { // the 'eval()' method defines input and output types (reflectively extracted) // and contains the runtime logic public String eval(String street, String zipCode, String city) { return normalize(street) + ", " + normalize(zipCode) + ", " + normalize(city); } private String normalize(String s) { return s.toUpperCase().replaceAll("\\W", " ").replaceAll("\\s+", " ").trim(); } } }
ab35c21bce76cb19b859e1cf2569c212c7eb5f7b
e0c7a27f853043e65cd7c20b550b4e01b6426d32
/src/main/java/com/code/art/offer/Offer35.java
4eb9d0b7dce369d30e6a7bfc711b03024a83a980
[]
no_license
zhourao/data_structure
295cd6b7d4e88b2cb4596229fdff361b12da9237
45c94a011e100c05df7c4d4dfb957e4d1bc10449
refs/heads/master
2023-07-26T23:21:49.831886
2021-09-09T11:42:05
2021-09-09T11:42:05
326,990,457
0
0
null
null
null
null
UTF-8
Java
false
false
1,878
java
package com.code.art.offer; import java.util.HashMap; import java.util.Map; /** * 描述: 复杂链表的复制 * https://leetcode-cn.com/problems/fu-za-lian-biao-de-fu-zhi-lcof/ * * @author zhourao * @create 2021-04-15 2:44 下午 */ public class Offer35 { /** * 【题目】复杂链表的复制 * 【题目说明】 * 请实现 copyRandomList 函数,复制一个复杂链表。在复杂链表中,每个节点除了有一个 next 指针指向下一个节点, * 还有一个 random 指针指向链表中的任意节点或者 null。 * 【示例】 * 输入:head = [[7,null],[13,0],[11,4],[10,2],[1,0]] * 输出:[[7,null],[13,0],[11,4],[10,2],[1,0]] * 输入:head = [[3,null],[3,0],[3,null]] * 输出:[[3,null],[3,0],[3,null]] * 输入:head = [] * 输出:[] * 解释:给定的链表为空(空指针),因此返回 null。 */ public Node copyRandomList(Node head) { if (head == null) return null; Node cur = head; Map<Node, Node> map = new HashMap<>(); // 3. 复制各节点,并建立 “原节点 -> 新节点” 的 Map 映射 while (cur != null) { map.put(cur, new Node(cur.val)); cur = cur.next; } cur = head; // 4. 构建新链表的 next 和 random 指向 while (cur != null) { map.get(cur).next = map.get(cur.next); map.get(cur).random = map.get(cur.random); cur = cur.next; } // 5. 返回新链表的头节点 return map.get(head); } class Node { int val; Node next; Node random; public Node(int val) { this.val = val; this.next = null; this.random = null; } } public static void main(String[] args) { } }
8b9eb9e44040b0df0fa45647d3d35705d229d947
33bc6b4229fd03e46305291312508f46125ac553
/AndroidStudioProjects/ScrollView/app/src/test/java/app/com/scrollview/ExampleUnitTest.java
999ffb3e94a2d7338a3cb17b731b18887b83f29e
[]
no_license
vinod-hosamani/AllVinodProjects
1ab68e2a3c6886f5e6a4c41c82179b2fbe8fea5a
644c74ab8a22c22c7079adddfb8d4d3805f595f0
refs/heads/master
2020-12-03T00:43:01.551860
2017-07-03T04:11:29
2017-07-03T04:11:29
96,069,280
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package app.com.scrollview; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
13aac8108c1d2c2cba6ba979edbe2ec2652a4ef7
98bacc06808b8637559ce5ed3a1ae744aa828d23
/src/P992_K个不同整数的子数组.java
b3dbc6f9941c03796cf076a77dc9c7a42e7a80fd
[]
no_license
fogbirdfree/algorithm
adcfe0e2a4c42533c4881d8736e109a855c86c8c
ef40aa4fe4de2f5b4ed846d6f53a3b973261d706
refs/heads/master
2023-04-27T10:48:04.747253
2021-02-23T10:39:36
2021-02-23T10:39:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
910
java
/** * 滑动窗口, 恰好由K个不同整数组成的子数组个数 == 最多由K个不同整数组成的子数组个数 - 最多由K-1个不同整数组成的子数组个数 */ public class P992_K个不同整数的子数组 { public int subarraysWithKDistinct(int[] A, int K) { return mostKDistinct(A, K) - mostKDistinct(A, K-1); } private int mostKDistinct(int[] A, int K) { int length = A.length; int[] flag = new int[length+1]; int left = 0; int right = 0; int num = 0; int res = 0; for (; right < length; right++) { if (flag[A[right]]++ == 0) { num++; } while (num > K) { if (--flag[A[left]] == 0) { num--; } left++; } res += right - left; } return res; } }
ce1abf2b9ee3f772410ffa02c99e2caf566c8a59
fc125556676f537abb08255c52b03117cf5c92af
/src/middleware/externalinterfaces/DbClass.java
7be722ec5f053745dc1ccd95972bb339a5827a27
[]
no_license
akolom/SoftwareEngineering
2c2464da955027130bf0d6186e5f85e041b92b8e
d6cdc85941a3400e1ff67bb1037d50980d8767f4
refs/heads/master
2020-12-24T06:35:40.954632
2016-07-07T02:24:56
2016-07-07T02:24:56
62,767,389
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package middleware.externalinterfaces; import java.sql.ResultSet; import middleware.exceptions.DatabaseException; /** All concrete dbclasses implement this interface */ public interface DbClass { public void populateEntity(ResultSet resultSet) throws DatabaseException ; public String getDbUrl(); public String getQuery(); public Object[] getQueryParams(); public int[] getParamTypes(); }
bd3398c1076b57751614ef0f3313c0b755753dc9
cb016e3046f50fd7e1db73ad5d694ae9cf9ea61d
/src/main/java/com/safenetpay/firstproject/firstproject/DataBase.java
2f1cf8c404dbc8da083009c20285b93d678576d8
[]
no_license
azizxonImomnazarov/vertx
a59b4bf5ba715221680a00ecdba5a4322f719623
70f2bb90d60648eb8994ab9e438206b293c5bb88
refs/heads/master
2023-05-01T19:23:44.537088
2021-05-18T08:52:09
2021-05-18T08:52:09
362,617,361
0
0
null
null
null
null
UTF-8
Java
false
false
9,439
java
package com.safenetpay.firstproject.firstproject; import io.vertx.core.Future; import io.vertx.core.Promise; import io.vertx.core.Vertx; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import io.vertx.pgclient.PgConnectOptions; import io.vertx.pgclient.PgPool; import io.vertx.sqlclient.*; import java.math.BigInteger; import java.util.Iterator; public class DataBase { PgConnectOptions connectOptions; PoolOptions poolOptions; PgPool client; public DataBase(Vertx vertx) { connectOptions = new PgConnectOptions() .setPort(5433) .setHost("localhost") .setDatabase("employee") .setUser("postgres") .setPassword("postgres"); poolOptions = new PoolOptions() .setMaxSize(5); client = PgPool.pool(vertx, connectOptions, poolOptions); } public Future<JsonArray> getData() { Promise<JsonArray> promise = Promise.promise(); client .preparedQuery("SELECT * FROM employee") .execute(ar -> { if (ar.succeeded()) { JsonArray jsonArray = new JsonArray(); RowSet<Row> rows = ar.result(); for (Row row : rows) { JsonObject jsonObject = new JsonObject() .put("id", row.getInteger("id")) .put("name", row.getString("name")) .put("surName", row.getString("sur_name")) .put("salary", row.getDouble("salary")); jsonArray.add(jsonObject); } promise.complete(jsonArray); } else { System.out.println(ar.cause()); } }); return promise.future(); } public Future<JsonObject> saveData(JsonObject employee) { Promise<JsonObject> answer = Promise.promise(); client .preparedQuery("INSERT INTO employee(name, sur_name, department, salary) VALUES($1, $2, $3, $4)") .execute(Tuple.of( employee.getString("name"), employee.getString("surName"), employee.getString("department"), employee.getDouble("salary")), rc -> { JsonObject jsonObject = new JsonObject(); if (rc.succeeded()) { jsonObject.put("success", true); } else { jsonObject .put("success", false) .put("cause", rc.cause().getMessage()); } answer.complete(jsonObject); }); return answer.future(); } public Future<JsonObject> updateData(JsonObject employee, Integer id) { Promise<JsonObject> answer = Promise.promise(); client .preparedQuery("UPDATE employee SET name = $1,sur_name = $2,department = $3,salary = $4 where id = $5") .execute(Tuple.of( employee.getString("name"), employee.getString("surName"), employee.getString("department"), employee.getDouble("salary"), employee.getInteger("id") == null ? id : employee.getInteger("id")), rc -> { JsonObject jsonObject = new JsonObject(); if (rc.succeeded()) { jsonObject.put("success", true); } else { jsonObject .put("success", false) .put("cause", rc.cause().getMessage()); } answer.complete(jsonObject); }); return answer.future(); } public Future<JsonObject> deleteData(Integer id) { Promise<JsonObject> answer = Promise.promise(); client .preparedQuery("DELETE FROM employee WHERE id = $1") .execute(Tuple.of(id), rc -> { JsonObject jsonObject = new JsonObject(); RowSet<Row> rowSet = rc.result(); if (rc.succeeded()) { if (rowSet.rowCount() > 0) { jsonObject.put("success", true); } else { jsonObject.put("success", false); } } else { jsonObject .put("success", false) .put("cause", rc.cause().getMessage()); } answer.complete(jsonObject); }); return answer.future(); } public Future<JsonObject> getDataWithInfo(Integer id) { Promise<JsonObject> promise = Promise.promise(); client .preparedQuery("select * from employee_info where id = $1") .execute(Tuple.of(id),rc -> { JsonObject jsonObject = new JsonObject(); if(rc.succeeded()) { RowSet<Row> rowSet = rc.result(); Iterator<Row> iterator = rowSet.iterator(); if(iterator.hasNext()) { Row row = iterator.next(); jsonObject .put("id", row.getInteger("id")) .put("passport", row.getString("passport")) .put("country", row.getString("country")) .put("is_married" , row.getBoolean("is_married")) .put("employeeId", row.getInteger("employeeid")); } } else { jsonObject .put("success", false) .put("cause", rc.cause().getMessage()); } promise.complete(jsonObject); }); return promise.future(); } public Future<JsonObject> getEmployeeById(JsonObject jsonObject, Integer employeeId) { Promise<JsonObject> promise = Promise.promise(); client .preparedQuery("select * from employee where id = $1") .execute(Tuple.of(employeeId),rc -> { if(rc.succeeded()) { RowSet<Row> rowSet = rc.result(); Iterator<Row> iterator = rowSet.iterator(); if(iterator.hasNext()) { Row row = iterator.next(); jsonObject .put("id", row.getInteger("id")) .put("name", row.getString("name")) .put("surName", row.getString("sur_name")) .put("department" , row.getString("department")) .put("salary", row.getDouble("salary")); } } else { jsonObject .put("success", false) .put("cause", rc.cause().getMessage()); } promise.complete(jsonObject); }); return promise.future(); } public Future<JsonArray> getAllDataWithInfo() { Promise<JsonArray> promise = Promise.promise(); client .preparedQuery("SELECT * FROM employee_info") .execute(ar -> { if (ar.succeeded()) { JsonArray jsonArray = new JsonArray(); RowSet<Row> rows = ar.result(); for (Row row : rows) { JsonObject jsonObject = new JsonObject() .put("id", row.getInteger("id")) .put("passport", row.getString("passport")) .put("country", row.getString("country")) .put("isMarried", row.getBoolean("is_married")) .put("employeeId", row.getInteger("employeeid")); jsonArray.add(jsonObject); } promise.complete(jsonArray); } else { System.out.println(ar.cause().getMessage()); } }); return promise.future(); } public Future<JsonArray> getData(JsonArray jsonArray) { Promise<JsonArray> promise = Promise.promise(); for (int i = 0; i < jsonArray.size(); i++) { JsonObject jsonObject = jsonArray.getJsonObject(i); client .preparedQuery("SELECT * FROM employee WHERE id = $1") .execute(Tuple.of(jsonObject.getInteger("employeeId")), rc -> { if (rc.succeeded()) { RowSet<Row> rowSet = rc.result(); Iterator<Row> iterator = rowSet.iterator(); Row row = iterator.next(); jsonObject .put("id", row.getInteger("id")) .put("name", row.getString("name")) .put("surName", row.getString("sur_name")) .put("department", row.getString("department")) .put("salary", row.getDouble("salary")); jsonArray.add(jsonObject); promise.complete(jsonArray); } else { System.out.println(rc.cause()); } }); } return promise.future(); } public Future<JsonArray> getEmployeeInfo() { Promise<JsonArray> promise = Promise.promise(); client .preparedQuery("SELECT * FROM employee_info") .execute(ar -> { if (ar.succeeded()) { JsonArray jsonArray = new JsonArray(); RowSet<Row> rows = ar.result(); for (Row row : rows) { JsonObject jsonObject = new JsonObject() .put("id", row.getInteger("id")) .put("passport", row.getString("passport")) .put("country", row.getString("country")) .put("isMarried", row.getBoolean("is_married")) .put("employeeId", row.getDouble("employeeid")); jsonArray.add(jsonObject); } promise.complete(jsonArray); } else { ar.cause().printStackTrace(); } }); return promise.future(); } BigInteger bigInteger = BigInteger.valueOf(2); public Future<JsonArray> getDataWithFunc() { Promise<JsonArray> promise = Promise.promise(); client .preparedQuery("select * from employee") .execute(ar -> { if (ar.succeeded()) { JsonArray jsonArray = new JsonArray(); RowSet<Row> rows = ar.result(); for (Row row : rows) { JsonObject jsonObject = new JsonObject() // .put("id", row.getInteger("id")) .put("name", row.getString("name")) .put("surName", row.getString("sur_name")) .put("salary", row.getDouble("salary")); jsonArray.add(jsonObject); } promise.complete(jsonArray); } else { System.out.println(ar.cause()); } }); return promise.future(); } }
4fc30b46bf6292b8bc9c2625b76fd85fbea7adaf
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/avito/android/design/widget/circular_progress/LookupTableInterpolator.java
309e63193cf3b6f0e82bb75dfb3d72d152e4044d
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
2,167
java
package com.avito.android.design.widget.circular_progress; import a2.b.a.a.a; import android.view.animation.Interpolator; import com.avito.android.publish.residential_complex_search.di.ResidentialComplexModuleKt; import com.avito.android.remote.auth.AuthSource; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; import org.jetbrains.annotations.NotNull; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0007\n\u0002\b\u0006\n\u0002\u0010\u0014\n\u0002\b\u0006\b \u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\f\u001a\u00020\t¢\u0006\u0004\b\r\u0010\u000eJ\u0017\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0004\u0010\u0005R\u0016\u0010\b\u001a\u00020\u00028\u0002@\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\u0006\u0010\u0007R\u0016\u0010\f\u001a\u00020\t8\u0002@\u0002X‚\u0004¢\u0006\u0006\n\u0004\b\n\u0010\u000b¨\u0006\u000f"}, d2 = {"Lcom/avito/android/design/widget/circular_progress/LookupTableInterpolator;", "Landroid/view/animation/Interpolator;", "", "input", "getInterpolation", "(F)F", AuthSource.SEND_ABUSE, "F", "stepSize", "", AuthSource.BOOKING_ORDER, "[F", ResidentialComplexModuleKt.VALUES, "<init>", "([F)V", "ui-components_release"}, k = 1, mv = {1, 4, 2}) public abstract class LookupTableInterpolator implements Interpolator { public final float a; public final float[] b; public LookupTableInterpolator(@NotNull float[] fArr) { Intrinsics.checkNotNullParameter(fArr, ResidentialComplexModuleKt.VALUES); this.b = fArr; this.a = 1.0f / ((float) (fArr.length - 1)); } @Override // android.animation.TimeInterpolator public float getInterpolation(float f) { if (f >= 1.0f) { return 1.0f; } if (f <= 0.0f) { return 0.0f; } float[] fArr = this.b; int min = Math.min((int) (((float) (fArr.length - 1)) * f), fArr.length - 2); float f2 = this.a; float f3 = (f - (((float) min) * f2)) / f2; float[] fArr2 = this.b; return a.b(fArr2[min + 1], fArr2[min], f3, fArr2[min]); } }
988049e5ce91b597ce86feb620093288cd4ca35d
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-workstations/proto-google-cloud-workstations-v1/src/main/java/com/google/cloud/workstations/v1/ListUsableWorkstationConfigsResponseOrBuilder.java
343defcdca127adc8b38513a6203d75f7a6df167
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
3,973
java
/* * Copyright 2023 Google LLC * * 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 * * https://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. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/workstations/v1/workstations.proto package com.google.cloud.workstations.v1; public interface ListUsableWorkstationConfigsResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse) com.google.protobuf.MessageOrBuilder { /** * * * <pre> * The requested configs. * </pre> * * <code>repeated .google.cloud.workstations.v1.WorkstationConfig workstation_configs = 1;</code> */ java.util.List<com.google.cloud.workstations.v1.WorkstationConfig> getWorkstationConfigsList(); /** * * * <pre> * The requested configs. * </pre> * * <code>repeated .google.cloud.workstations.v1.WorkstationConfig workstation_configs = 1;</code> */ com.google.cloud.workstations.v1.WorkstationConfig getWorkstationConfigs(int index); /** * * * <pre> * The requested configs. * </pre> * * <code>repeated .google.cloud.workstations.v1.WorkstationConfig workstation_configs = 1;</code> */ int getWorkstationConfigsCount(); /** * * * <pre> * The requested configs. * </pre> * * <code>repeated .google.cloud.workstations.v1.WorkstationConfig workstation_configs = 1;</code> */ java.util.List<? extends com.google.cloud.workstations.v1.WorkstationConfigOrBuilder> getWorkstationConfigsOrBuilderList(); /** * * * <pre> * The requested configs. * </pre> * * <code>repeated .google.cloud.workstations.v1.WorkstationConfig workstation_configs = 1;</code> */ com.google.cloud.workstations.v1.WorkstationConfigOrBuilder getWorkstationConfigsOrBuilder( int index); /** * * * <pre> * Token to retrieve the next page of results, or empty if there are no more * results in the list. * </pre> * * <code>string next_page_token = 2;</code> * * @return The nextPageToken. */ java.lang.String getNextPageToken(); /** * * * <pre> * Token to retrieve the next page of results, or empty if there are no more * results in the list. * </pre> * * <code>string next_page_token = 2;</code> * * @return The bytes for nextPageToken. */ com.google.protobuf.ByteString getNextPageTokenBytes(); /** * * * <pre> * Unreachable resources. * </pre> * * <code>repeated string unreachable = 3;</code> * * @return A list containing the unreachable. */ java.util.List<java.lang.String> getUnreachableList(); /** * * * <pre> * Unreachable resources. * </pre> * * <code>repeated string unreachable = 3;</code> * * @return The count of unreachable. */ int getUnreachableCount(); /** * * * <pre> * Unreachable resources. * </pre> * * <code>repeated string unreachable = 3;</code> * * @param index The index of the element to return. * @return The unreachable at the given index. */ java.lang.String getUnreachable(int index); /** * * * <pre> * Unreachable resources. * </pre> * * <code>repeated string unreachable = 3;</code> * * @param index The index of the value to return. * @return The bytes of the unreachable at the given index. */ com.google.protobuf.ByteString getUnreachableBytes(int index); }
025d81e1a7ea975616d18d737daf44eaaf1f4fe5
f616d44573454ff83278f869dd28ce198b186df8
/app/src/main/java/com/config/pad/content/library/alertview/AlertView.java
f4237c958037b2365ed4ca6cc68efae6d666d10d
[]
no_license
tushuangxi/StuMvp
b20cc47ce9acec1656c2e1f3f0bb0a121fdfe31e
69dbe1ee45bd4df9bb0f15a19edd07519472a55d
refs/heads/master
2020-09-05T14:00:28.202336
2020-01-13T05:50:02
2020-01-13T05:50:02
220,126,928
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
package com.config.pad.content.library.alertview; import android.app.Activity; import com.config.pad.content.R; import com.tapadoo.alerter.Alerter; /** * Created by czx on 2018/1/29. */ public class AlertView { public static void showTip(Activity activity, String msg){ Alerter.create(activity) // .setTitle("系统提示") .setText(msg) .setIcon(R.drawable.alerter_ic_notifications) .setBackgroundColorRes(R.color.main_background) // or setBackgroundColorInt(Color.CYAN) .show(); } }
16666d1c0a09bffb8f06a5320a248178cf89dfe3
011475f46062638fc7d8ac3c5f83dd43f30656c0
/attendance1.2.6-2015.5.6_release/src/com/ebanswers/attendance/InformationActivity.java
91c083f24ddae568b2fe2459161becdea566d3f8
[]
no_license
30598261/code
ffb47365aaad78483e61451eb0ec10603ffceab5
ab57b9d456b015dc4fc9077b146be0735cb94d4e
refs/heads/master
2020-12-31T00:29:25.477336
2016-05-18T01:23:44
2016-05-18T01:23:44
59,074,325
0
0
null
null
null
null
UTF-8
Java
false
false
3,420
java
package com.ebanswers.attendance; import com.example.db.DBAdapter; import com.ebanswers.attendance.R; import com.ebanswers.object.Person; import com.example.util.AbstractActivity; import android.app.NotificationManager; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Bundle; import android.provider.Settings.Secure; import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; public class InformationActivity extends AbstractActivity implements OnClickListener { static DBAdapter dbAdapter; private Button m_btnCancel; private defineTextView textView1, textView2, textView3, textView4, textView5; String strPersonCount, strAttendanceCount; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initUI(savedInstanceState, R.layout.informationstorage); } @Override public void onDestroy() { super.onDestroy(); } @Override public void onClick(View v) { // TODO Auto-generated method stub } @Override public void findView() { Context context = getApplicationContext(); dbAdapter = new DBAdapter(context); dbAdapter.open(); long attenDanceCount = dbAdapter.getCount("select count (*) from Attendance"); long count = dbAdapter.getCount("select count (*) from Person"); m_btnCancel = (Button)findViewById(R.id.btnCancel); textView1 = (defineTextView)findViewById(R.id.textview1); textView1.setPosition(100, 80); textView1.setState(1); strAttendanceCount = ""+attenDanceCount+" 条"; textView1.setText("考勤记录数量", strAttendanceCount); textView2 = (defineTextView)findViewById(R.id.textview2); textView2.setPosition(100, 80); strPersonCount = ""+count+" 枚"; textView2.setText("指纹数量", strPersonCount); textView3 = (defineTextView)findViewById(R.id.textview3); textView3.setPosition(100, 80); textView3.setText("厂商", "上海豪普森生物识别应用科技有限公司"); textView4 = (defineTextView)findViewById(R.id.textview4); textView4.setPosition(100, 80); textView4.setText("软件版本", "1.2.7"); //1.0.04无停止切换,更新连接bug textView5 = (defineTextView)findViewById(R.id.textview5); textView5.setPosition(100, 80); textView5.setText("设备ID", Secure.getString(getApplication().getApplicationContext().getContentResolver(), Secure.ANDROID_ID)); dbAdapter.close(); dbAdapter = null; } @Override public void fillData() { } @Override public void setListener() { // TODO Auto-generated method stub m_btnCancel.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub finish(); } }); } @Override public Bundle saveData() { // TODO Auto-generated method stub return null; } @Override public void loadData(Bundle bundle) { } }
f71962841421058749654cdc024c529c67fd3cca
3223c624ae64b027c584231c6f01736d87d10cda
/springboot-jiezhang-setnx-demo/src/main/java/com/example/miaoshademo/SpringbootRedisDemoApplication.java
7ab88256ea355b35429ed0a132be46c220241d47
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
LiJinHongPassion/springboot
070f9639d9c8f48fb392113eaf82428b4c557625
255eca4d60681ee2e2d9f08313aacf2d8f3c9de3
refs/heads/master
2023-07-19T17:38:23.042124
2022-10-01T08:23:25
2022-10-01T08:23:25
179,213,988
35
30
NOASSERTION
2023-07-18T20:52:18
2019-04-03T05:03:37
Java
UTF-8
Java
false
false
518
java
package com.example.miaoshademo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringbootRedisDemoApplication { public static void main(String[] args) { SpringApplication.run(SpringbootRedisDemoApplication.class, args); System.out.println("http://localhost:9090/jz/pay?id=1"); System.out.println("该示例能够正常加锁, 但解锁功能有问题, 无法解锁"); } }
75621be25ec3d8f8c8b48aa57125031cd5489276
19471952a1470962de398cddd0d9cf4de3691f8d
/app/src/main/java/android/coolweather/com/coolweather/gson/Forecast.java
ecb5af16081122ccb3b8dc14a79ac1e944ae261c
[ "Apache-2.0" ]
permissive
chenzhuoyong/coolweather
e1b537c6d96b14513684c29b5f64d12f669bfc36
71584a0a7ded5d0fd99bb280af53c4225344ee4b
refs/heads/master
2020-03-17T00:19:12.440643
2018-05-14T06:30:41
2018-05-14T06:30:41
133,111,932
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package android.coolweather.com.coolweather.gson; import com.google.gson.annotations.SerializedName; public class Forecast { public String date; @SerializedName("tmp") public Temperature temperature; @SerializedName("cond") public More more; public class Temperature { public String max; public String min; } public class More { @SerializedName("txt_d") public String info; } }
987ace885130cbd9e6e1906bccd363fb37732efb
21a2b136eb7c7b2cea832aa7a8ab0948636b658d
/src/main/java/de/praktikant/bibliothek/api/resources/response/BaseResponse.java
a6a2d2de4fc708fcaf19f738b0cedf5403b2053c
[]
no_license
bschenkelberger/bibliothek-api
5387d09a829e7b45a3e1b5ea2eb511e4fda808db
d04f48052f7bbcadac7e440c7c623d82e54d737b
refs/heads/master
2023-02-18T15:36:10.002363
2023-02-16T14:05:10
2023-02-16T14:05:10
152,224,534
0
0
null
null
null
null
UTF-8
Java
false
false
624
java
package de.praktikant.bibliothek.api.resources.response; import de.praktikant.bibliothek.api.service.common.Message; import java.util.ArrayList; import java.util.List; public class BaseResponse { private Boolean successful; private List<Message> messages = new ArrayList<>(); public Boolean isSuccessful() { return successful; } public void setSuccessful(Boolean successful) { this.successful = successful; } public List<Message> getMessages() { return messages; } public void setMessages(List<Message> messages) { this.messages = messages; } }
e038d00d916ff5ef3fc11fa8cc681851694064e4
b1e2f7dd0d34d365fb949dadd9490cacc7708e72
/src/main/java/com/codedifferently/casino/Utilities/Suit.java
c87080f5611ca2eeeb1a3dcee21a20aaa2f8c088
[]
no_license
ChastinT/TheCasino
1e4ff653ba7847b8ffe16c95816409c8b9e563fa
6dcb1a865bb66630ea6e1e57059f30d1e19648c5
refs/heads/master
2022-11-14T15:48:06.344122
2020-07-11T22:08:31
2020-07-11T22:08:31
277,939,090
1
3
null
2020-07-08T16:25:21
2020-07-07T22:57:50
Java
UTF-8
Java
false
false
136
java
package com.codedifferently.casino.Utilities; public enum Suit { HEARTS, DIAMONDS, SPADES, CLUBS; // Suit can only be of these 4 }
c22231b73f222c0bb22cc93ffaeb7c5b3b668d33
25587613b4eb203ac093b4b93aefd6c738b2a3d5
/LayoutShared/src/main/java/com/bluebrim/layout/impl/shared/CoImmutableCustomGridIF.java
f381cbf75664f554e2d0a011f2a09cc93dcd06f4
[ "Apache-2.0" ]
permissive
goranstack/bluebrim
80b4f5d2aba0a5cadbda310d673b97ce64d84e6e
eb6edbeada72ed7fd1294391396432cb25575fe0
refs/heads/master
2021-05-02T07:39:42.782432
2018-06-19T14:30:14
2018-06-19T14:30:14
35,280,662
0
0
null
null
null
null
ISO-8859-1
Java
false
false
528
java
package com.bluebrim.layout.impl.shared; import com.bluebrim.layout.shared.*; /** * Interface for a serializable and immutable custom snap grid * * @author: Dennis Malmström */ public interface CoImmutableCustomGridIF extends CoImmutableSnapGridIF { public static final String CUSTOM_GRID = "CUSTOM_GRID"; double findXPosition( double x, double range ); double findYPosition( double x, double range ); double getXPosition( int i ); int getXPositionCount(); double getYPosition( int i ); int getYPositionCount(); }
89ed10f50350d887d246f1f79f1177d49cfbb262
273bf98612e79c1a2123236c6a36d27698114e3e
/TreeSet/src/Main.java
23ad6489fa603c34dfafb7d3cf518b8a3f28ab02
[]
no_license
Alitsuli/Tietorakenteet_Algoritmit
d652f76b8d47487581d8f28e06e3826c098a8104
13d0e9b7340c01238e1c1056f7f719fa746ab11b
refs/heads/main
2023-01-21T21:16:01.714468
2020-12-06T14:02:45
2020-12-06T14:02:45
308,597,712
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,460
java
import java.util.Iterator; import java.util.TreeSet; public class Main { public static void main(String[] args) { printMenu(); } private static void printMenu() { char select; TreeSet<Integer> tree = new TreeSet<Integer>(); String data; do { System.out.println("\n\t\t\t1. Lisää avain."); System.out.println("\t\t\t2. Etsi avaimella."); System.out.println("\t\t\t3. Käy puu läpi sisäjärjestyksessä."); System.out.println("\t\t\t4. Käy puu läpi esijärjestyksessä."); System.out.println("\t\t\t5. lopetus "); System.out.print("\n\n"); // tehdään tyhjiä rivejä select = Lue.merkki(); switch (select) { case '1': System.out.println("Anna uusi avain (kokonaisluku)"); data = new String(Lue.rivi()); tree.add(Integer.parseInt(data)); break; case '2': System.out.println("Anna etsittävä avain (kokonaisluku)"); data = Lue.rivi(); if (tree.contains(Integer.parseInt(data))) { System.out.println("Avain löytyi."); } else { System.out.println("Avainta ei löytynyt."); } break; case '3': Iterator<Integer> itr = tree.iterator(); while (itr.hasNext()) { System.out.println(itr.next()); } char h = Lue.merkki(); // pysäytetään kontrolli break; case '4': System.out.println("Ei onnistu"); char k = Lue.merkki(); // pysäytetään kontrolli break; case '5': break; } } while (select != '5'); } }
45f3c9e2da36431764526320329accec59412b50
072742f580167c59cb6ccf388dd74c486d8efbe7
/sources/com/txznet/comm/Tr/Tr/Tv.java
bebe43669e128ce047f3a9d3fe4eac853086d8ab
[]
no_license
1989rat/libcan59-TsMainUI
3ff2034fc162943419998edab8ad4f1dd9dc8a02
9fe822b23d0f748dd8c6c109a5e93150f54458aa
refs/heads/master
2023-03-20T07:56:55.859764
2021-01-26T05:07:11
2021-01-26T05:07:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package com.txznet.comm.Tr.Tr; /* compiled from: Proguard */ public class Tv { /* renamed from: T reason: collision with root package name */ private static T f408T; /* compiled from: Proguard */ public static abstract class T { public void T(String jsonResult) { } public void T(int errorCode) { } } public static void T(String cmd, byte[] data) { if (cmd.equals("result") && f408T != null) { if (data != null) { f408T.T(new String(data)); } else { return; } } if (cmd.equals("error") && data != null) { f408T.T(T(new String(data), -1)); } } private static int T(String str, int defaultValue) { try { return Integer.parseInt(str); } catch (NumberFormatException e) { return defaultValue; } } }
7a8808aa424a04a35fd3eecea0946412634ad77a
83d5931a7a6fe278ed7380398e831e8e6cd8122f
/src/main/java/com/example/registry/ServletInitializer.java
dcab784d551ce3c6786f566d560f467212cfc0d2
[]
no_license
ABY-sys/Micro-services
8cbe3f662fd5fc852a1ac3f366d6ac1fc022dec0
e4246fe5de8562cd48949c4b57a89168772e2ded
refs/heads/master
2023-03-30T19:04:06.052855
2021-03-30T14:17:02
2021-03-30T14:17:02
353,023,884
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
package com.example.registry; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RegistryApplication.class); } }
ca91c8b7589cc2a1e8947b3cca9a3ca51bbc4089
0ff504f363c057e256556405acefdf3f827006fd
/src/main/java/com/app/demo/Gof23Model/factorya/section2/ProductA1.java
43100bdf4becfc75bede16f3e15ca9b9dd9b8e71
[]
no_license
Justdoitwj/breeze
b16606036c5303f5e9c9b4310ec711629ff77920
b772e01a3c1ede32c15cf106bd6a61b18be5671a
refs/heads/dev
2022-06-30T13:29:47.901212
2021-04-11T14:40:32
2021-04-11T14:40:32
210,748,978
1
2
null
2022-06-21T01:56:21
2019-09-25T03:37:36
Java
UTF-8
Java
false
false
314
java
package com.app.demo.Gof23Model.factorya.section2; /** * @author cbf4Life [email protected] * I'm glad to share my knowledge with you all. * 产品A的实现类 */ public class ProductA1 extends AbstractProductA { @Override public void doSomething() { System.out.println("产品A1的实现方法"); } }
309dc4464532758767736f7e4a95514c2f635fff
e1de859ab00d157a365765b8c0156e4fc71c3045
/yckx/src/com/androidy/lib3/view/pulltorefresh/library/LoadingLayoutProxy.java
25e4b91b0cafec3202df5580155d17f90330b8ff
[]
no_license
paomian2/yckx
fedf1370a723a3284e3687c95acb06e3f7b73d39
07e074bfcac2b2558385acc374f433868c4d41d1
refs/heads/master
2021-01-10T05:22:37.434059
2016-04-11T05:23:19
2016-04-11T05:23:19
55,936,017
0
0
null
null
null
null
UTF-8
Java
false
false
1,814
java
package com.androidy.lib3.view.pulltorefresh.library; import java.util.HashSet; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import com.androidy.lib3.view.pulltorefresh.LoadingLayout; public class LoadingLayoutProxy implements ILoadingLayout { private final HashSet<LoadingLayout> mLoadingLayouts; LoadingLayoutProxy() { mLoadingLayouts = new HashSet<LoadingLayout>(); } /** * This allows you to add extra LoadingLayout instances to this proxy. This * is only necessary if you keep your own instances, and want to have them * included in any * {@link PullToRefreshBase#createLoadingLayoutProxy(boolean, boolean) * createLoadingLayoutProxy(...)} calls. * * @param layout - LoadingLayout to have included. */ public void addLayout(LoadingLayout layout) { if (null != layout) { mLoadingLayouts.add(layout); } } @Override public void setLastUpdatedLabel(CharSequence label) { for (LoadingLayout layout : mLoadingLayouts) { layout.setLastUpdatedLabel(label); } } @Override public void setLoadingDrawable(Drawable drawable) { for (LoadingLayout layout : mLoadingLayouts) { layout.setLoadingDrawable(drawable); } } @Override public void setRefreshingLabel(CharSequence refreshingLabel) { for (LoadingLayout layout : mLoadingLayouts) { layout.setRefreshingLabel(refreshingLabel); } } @Override public void setPullLabel(CharSequence label) { for (LoadingLayout layout : mLoadingLayouts) { layout.setPullLabel(label); } } @Override public void setReleaseLabel(CharSequence label) { for (LoadingLayout layout : mLoadingLayouts) { layout.setReleaseLabel(label); } } public void setTextTypeface(Typeface tf) { for (LoadingLayout layout : mLoadingLayouts) { layout.setTextTypeface(tf); } } }
17bc45eb915531ecfc723b45bf7874cd942c9fad
0e62d6c2934f1ce7b67c5c420daf9ff8a5a22f53
/tlkiosdk/src/main/java/com/yinni/tlk/olsapi/Permission.java
e0da75396c67382c436992ac226a3ff5e5350391
[]
no_license
ibt01/DApp_Server
9e351a68d461949c5ff4cc3ed0507d07527374af
1ae4e9c3f8d0158d62b5cd2c9f9364e11323cd1f
refs/heads/main
2023-04-05T22:43:50.546647
2021-04-14T15:03:47
2021-04-14T15:03:47
357,936,625
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package com.yinni.tlk.olsapi; import com.google.gson.annotations.Expose; public class Permission { @Expose private String name; @Expose private String parent; @Expose private RequiredAuth required_auth; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getParent() { return parent; } public void setParent(String parent) { this.parent = parent; } public RequiredAuth getRequiredAuth() { return required_auth; } public void setRequiredAuth(RequiredAuth requiredAuth) { this.required_auth = requiredAuth; } }
a3579d5bfe76f2da468a430f295a4f76fc1e6cd8
5a3c97cb60c3c9d9b95a10134cf3d786def92cd0
/src/com/kilobolt/framework/implementation/AndroidGame.java
0427606d4edd8644957b88be3834e36bd47a2e0c
[]
no_license
chuotngocha/KiloboltRobotGame
857d425566ba5adc1f464af0dc3c8b39051ba2c3
72cf9f6cfd9dac416dc5a554cad0d28de6b4f12f
refs/heads/master
2016-09-06T04:09:15.197213
2014-12-11T17:13:48
2014-12-11T17:13:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,075
java
package com.kilobolt.framework.implementation; import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.os.Bundle; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.view.Window; import android.view.WindowManager; import com.kilobolt.framework.Audio; import com.kilobolt.framework.FileIO; import com.kilobolt.framework.Game; import com.kilobolt.framework.Graphics; import com.kilobolt.framework.Input; import com.kilobolt.framework.Screen; public abstract class AndroidGame extends Activity implements Game { AndroidFastRenderView renderView; Graphics graphics; Audio audio; Input input; FileIO fileIO; Screen screen; WakeLock wakeLock; @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); boolean isPortrait = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; int frameBufferWidth = isPortrait ? 480 : 800; int frameBufferHeight = isPortrait ? 800 : 480; Bitmap frameBuffer = Bitmap.createBitmap(frameBufferWidth, frameBufferHeight, Config.RGB_565); float scaleX = (float) frameBufferWidth / getWindowManager().getDefaultDisplay().getWidth(); float scaleY = (float) frameBufferHeight / getWindowManager().getDefaultDisplay().getHeight(); renderView = new AndroidFastRenderView(this, frameBuffer); graphics = new AndroidGraphics(getAssets(), frameBuffer); fileIO = new AndroidFileIO(this); audio = new AndroidAudio(this); input = new AndroidInput(this, renderView, scaleX, scaleY); screen = getInitScreen(); setContentView(renderView); PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "MyGame"); } @Override public void onResume() { super.onResume(); wakeLock.acquire(); screen.resume(); renderView.resume(); } @Override public void onPause() { super.onPause(); wakeLock.release(); renderView.pause(); screen.pause(); if (isFinishing()) screen.dispose(); } @Override public Input getInput() { return input; } @Override public FileIO getFileIO() { return fileIO; } @Override public Graphics getGraphics() { return graphics; } @Override public Audio getAudio() { return audio; } @Override public void setScreen(Screen screen) { if (screen == null) throw new IllegalArgumentException("Screen must not be null"); this.screen.pause(); this.screen.dispose(); screen.resume(); screen.update(0); this.screen = screen; } public Screen getCurrentScreen() { return screen; } }
668390634993b0f5e7a4b433b82f01b98009e085
0e5d0775fb3c53e633f116a8a1b249039549c04e
/src/main/java/rest/DemoResource.java
0eee0621057f41a19fba463db035539a3151325a
[]
no_license
Tarllark/CA3
25dc1813e1d0380783579130e2c5fff063532f2d
fdd3f9d6cde08c009aaafc5f996d1d0552d6c8c9
refs/heads/master
2020-04-06T09:29:52.758826
2018-11-19T10:09:17
2018-11-19T10:09:17
157,344,869
0
1
null
null
null
null
UTF-8
Java
false
false
1,789
java
package rest; import javax.annotation.security.RolesAllowed; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PUT; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.SecurityContext; import Resources.*; import java.io.IOException; import java.sql.SQLException; import javax.ws.rs.PathParam; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import net.minidev.json.parser.ParseException; /** * REST Web Service * * @author [email protected] */ @Path("info") public class DemoResource { @Context private UriInfo context; @Context SecurityContext securityContext; @GET @Produces(MediaType.APPLICATION_JSON) @Path("user") @RolesAllowed("user") public String getFromUser() { String user = securityContext.getUserPrincipal().getName(); return "\"Hello from USER: " + user + "\""; } @GET @Produces(MediaType.APPLICATION_JSON) @Path("admin") @RolesAllowed("admin") public String getFromAdmin() { String user = securityContext.getUserPrincipal().getName(); return "\"Hello from ADMIN" + user + "\""; } @GET @Produces(MediaType.APPLICATION_JSON) @Path("all") //@RolesAllowed({"user","admin"}) public String getAll() throws IOException, ParseException { return new externalData().getAll(); } @GET @Produces(MediaType.APPLICATION_JSON) @Path("dummy/{offset}") public String getDummyData(@PathParam("offset") Integer offset) throws SQLException, ClassNotFoundException { return new Resources.DBAccess.dbData().getData(offset); } }
99d8361eb396f7a1b5aa377e68b4f9e2dd65afb2
0837f7d75f1a0d4feb7bee52fb8a97d562fa2d33
/litemall-core/src/test/java/com/chengshengkeji/litemall/core/SmsTest.java
691c1f8c1fda9c1012979844336e680c918800ce
[ "MIT" ]
permissive
jbzhang99/nblanhLiteMall
356cb242709587f46432667229eb875bd61f51e8
7f54c77c3bd9d7f5e135a934086fa8117ce56811
refs/heads/master
2020-09-13T19:29:05.091940
2019-11-01T05:58:54
2019-11-01T05:58:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,424
java
package com.nblanh.litemall.core; import com.nblanh.litemall.core.notify.NotifyService; import com.nblanh.litemall.core.notify.NotifyType; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Primary; import org.springframework.core.task.SyncTaskExecutor; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import java.util.concurrent.Executor; /** * 测试短信发送服务 * <p> * 注意LitemallNotifyService采用异步线程操作 * 因此测试的时候需要睡眠一会儿,保证任务执行 * <p> * 开发者需要确保: * 1. 在腾讯云短信平台设置短信签名和短信模板notify.properties已经设置正确 * 2. 在腾讯云短信平台设置短信签名和短信模板 * 3. 在当前测试类设置好正确的手机号码 */ @WebAppConfiguration @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest public class SmsTest { @Autowired private NotifyService notifyService; @Test public void testCaptcha() { String phone = "xxxxxxxxxxx"; String[] params = new String[]{"123456"}; notifyService.notifySmsTemplate(phone, NotifyType.CAPTCHA, params); } @Test public void testPaySucceed() { String phone = "xxxxxxxxxxx"; String[] params = new String[]{"123456"}; notifyService.notifySmsTemplate(phone, NotifyType.PAY_SUCCEED, params); } @Test public void testShip() { String phone = "xxxxxxxxxxx"; String[] params = new String[]{"123456"}; notifyService.notifySmsTemplate(phone, NotifyType.SHIP, params); } @Test public void testRefund() { String phone = "xxxxxxxxxxx"; String[] params = new String[]{"123456"}; notifyService.notifySmsTemplate(phone, NotifyType.REFUND, params); } @Configuration @Import(Application.class) static class ContextConfiguration { @Bean @Primary public Executor executor() { return new SyncTaskExecutor(); } } }
898ead233c93d9521e2d1584a8359b4f218c5da2
a2209af62b260fedcb4ac76b79105380d5e9cb00
/app/src/main/java/in/afckstechnologies/afcksfees/activity/AddTemplatesActivity.java
7e2ccf51e668b6e65ab6eb2c0a4c1c65a0792ac7
[]
no_license
ashokkumawat20/AFCKSFees
ccf03a76cfd8610e4703092d516587d3e86fdf16
e2e39242d2aa150ca9d9c47be2a86cad9a420d10
refs/heads/master
2022-12-10T07:36:44.486871
2020-09-05T02:05:12
2020-09-05T02:05:12
292,983,565
0
0
null
null
null
null
UTF-8
Java
false
false
10,186
java
package in.afckstechnologies.afcksfees.activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import androidx.appcompat.app.AppCompatActivity; import in.afckstechnologies.afcksfees.R; import in.afckstechnologies.afcksfees.utils.AppStatus; import in.afckstechnologies.afcksfees.utils.Config; import in.afckstechnologies.afcksfees.utils.Constant; import in.afckstechnologies.afcksfees.utils.FeesListener; import in.afckstechnologies.afcksfees.utils.WebClient; public class AddTemplatesActivity extends AppCompatActivity { String title = ""; String templateText = ""; EditText add_title, msgData; Button saveTemplate; ProgressDialog mProgressDialog; private JSONObject jsonLeadObj, jsonLeadObj1; String addTemplateResponse = ""; String msg = ""; boolean status; private static FeesListener mListener; Button first_name,course_name,start_date,notes,timings,frequency,duration,branch_name; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_templates); Intent intent = getIntent(); title = intent.getStringExtra("title"); add_title = (EditText) findViewById(R.id.add_title); msgData = (EditText) findViewById(R.id.msgData); add_title.setText(title); first_name=(Button)findViewById(R.id.first_name); course_name=(Button)findViewById(R.id.course_name); start_date=(Button)findViewById(R.id.start_date); notes=(Button)findViewById(R.id.notes); timings=(Button)findViewById(R.id.timings); frequency=(Button)findViewById(R.id.frequency); duration=(Button)findViewById(R.id.duration); branch_name=(Button)findViewById(R.id.branch_name); first_name.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[first_name]"); } }); course_name.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[course_name]"); } }); start_date.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[start_date]"); } }); notes.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[notes]"); } }); timings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[timings]"); } }); frequency.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[frequency]"); } }); duration.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[duration]"); } }); branch_name.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { msgData.append("[branch_name]"); } }); saveTemplate = (Button) findViewById(R.id.saveTemplate); saveTemplate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (AppStatus.getInstance(getApplicationContext()).isOnline()) { templateText = msgData.getText().toString().trim(); title = add_title.getText().toString().trim(); if (!templateText.equals("")) { new initAddTemplate().execute(); } else { Toast.makeText(getApplicationContext(), "Please enter value for template message", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(getApplicationContext(), Constant.INTERNET_MSG, Toast.LENGTH_SHORT).show(); } } }); } private class initAddTemplate extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() { super.onPreExecute(); // Create a progressdialog mProgressDialog = new ProgressDialog(AddTemplatesActivity.this); // Set progressdialog title mProgressDialog.setTitle("Please Wait..."); // Set progressdialog message mProgressDialog.setMessage("Loading..."); //mProgressDialog.setIndeterminate(false); // Show progressdialog mProgressDialog.show(); } @Override protected Void doInBackground(Void... params) { jsonLeadObj = new JSONObject() { { try { put("ID", title); put("Template_Text", templateText); } catch (Exception e) { e.printStackTrace(); Log.e("json exception", "json exception" + e); } } }; WebClient serviceAccess = new WebClient(); // String baseURL = "http://192.168.1.13:8088/lms/api/lead/showlead"; Log.i("json", "json" + jsonLeadObj); addTemplateResponse = serviceAccess.SendHttpPost(Config.URL_ADDTEMPLATE, jsonLeadObj); Log.i("resp", "addTemplateResponse" + addTemplateResponse); if (addTemplateResponse.compareTo("") != 0) { if (isJSONValid(addTemplateResponse)) { runOnUiThread(new Runnable() { @Override public void run() { try { JSONObject jsonObject = new JSONObject(addTemplateResponse); msg = jsonObject.getString("message"); status = jsonObject.getBoolean("status"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } else { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(getApplicationContext(), "Please check your network connection", Toast.LENGTH_LONG).show(); } }); return null; } } else { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(getApplicationContext(), "Please check your network connection.", Toast.LENGTH_LONG).show(); } }); return null; } return null; } @Override protected void onPostExecute(Void args) { if (addTemplateResponse.compareTo("") != 0) { if (status) { Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show(); AlertDialog.Builder alertDialog = new AlertDialog.Builder(AddTemplatesActivity.this); alertDialog.setTitle("Add Template"); alertDialog.setMessage("Do you want add more Template "); // alertDialog.setIcon(R.drawable.msg_img); alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Intent intent = new Intent(AddTemplatesActivity.this, StudentList.class); // startActivity(intent); mListener.messageReceived(msg); finish(); } }); alertDialog.show(); mProgressDialog.dismiss(); } else { Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show(); } mProgressDialog.dismiss(); } else { // Close the progressdialog mProgressDialog.dismiss(); } } } protected boolean isJSONValid(String callReoprtResponse2) { // TODO Auto-generated method stub try { new JSONObject(callReoprtResponse2); } catch (JSONException ex) { // edited, to include @Arthur's comment // e.g. in case JSONArray is valid as well... try { new JSONArray(callReoprtResponse2); } catch (JSONException ex1) { return false; } } return true; } public static void bindListener(FeesListener listener) { mListener = listener; } }
2c63990a74b90d8605787f5ae7015c3ab5c373b4
53d3e082b15c180400d72f36ebcba8263a330e1d
/app/src/main/java/co/poynt/samples/SampleActivity.java
421e1ca7fb8d76f640f80675c1597551b0d0bb15
[]
no_license
nishant-personatech/PoyntSamples
28b1babdd23aae6330b91afd40ccdc979c1de84a
e9ca5e726d1f21c89e08a4e173390f71d28eb497
refs/heads/master
2021-05-30T12:29:40.195147
2015-12-21T06:04:05
2015-12-21T06:04:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,270
java
package co.poynt.samples; import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AccountManagerCallback; import android.accounts.AccountManagerFuture; import android.app.Activity; import android.app.ProgressDialog; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.nimbusds.jwt.ReadOnlyJWTClaimsSet; import com.nimbusds.jwt.SignedJWT; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.UUID; import co.poynt.api.model.Business; import co.poynt.api.model.OrderItem; import co.poynt.os.Constants; import co.poynt.os.model.Intents; import co.poynt.os.model.Payment; import co.poynt.os.model.PaymentStatus; import co.poynt.os.model.PoyntError; import co.poynt.os.services.v1.IPoyntBusinessReadListener; import co.poynt.os.services.v1.IPoyntBusinessService; import co.poynt.os.services.v1.IPoyntSecondScreenService; import co.poynt.os.services.v1.IPoyntSessionService; import co.poynt.os.services.v1.IPoyntSessionServiceListener; /** * A simple sample app demonstrating how to get business info from the device using * the PoyntBusinessService. */ public class SampleActivity extends Activity { private static final int AUTHORIZATION_CODE = 1993; // request code for payment service activity private static final int COLLECT_PAYMENT_REQUEST = 13132; private static final String TAG = "SampleActivity"; private AccountManager accountManager; private IPoyntSessionService mSessionService; private IPoyntBusinessService mBusinessService; private IPoyntSecondScreenService mSecondScreenService; ProgressDialog progress; private TextView bizInfo; private Button chargeBtn; Account currentAccount = null; String userName; String accessToken; TextView tokenInfo; TextView userInfo; List<OrderItem> items; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); accountManager = AccountManager.get(this); tokenInfo = (TextView) findViewById(R.id.tokenInfo); userInfo = (TextView) findViewById(R.id.userInfo); bizInfo = (TextView) findViewById(R.id.bizInfo); chargeBtn = (Button) findViewById(R.id.chargeBtn); chargeBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { launchPoyntPayment(1000l); } }); Button currentUser = (Button) findViewById(R.id.currentUser); currentUser.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { // Android Account Manager does not maintain sessions - so we use Poynt Session // Service to keep track of the current logged in user. // NOTE that the access tokens are still managed by the Account Manager. mSessionService.getCurrentUser(sessionServiceListener); } catch (RemoteException e) { e.printStackTrace(); } } }); Button getToken = (Button) findViewById(R.id.getToken); getToken.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // get access token for the current user from tha account manager // Note the authTokenType passed if (currentAccount != null) { accountManager.getAuthToken(currentAccount, Constants.Accounts.POYNT_AUTH_TOKEN, null, SampleActivity.this, new OnTokenAcquired(), null); } else { // launch the login accountManager.getAuthToken(Constants.Accounts.POYNT_UNKNOWN_ACCOUNT, Constants.Accounts.POYNT_AUTH_TOKEN, null, SampleActivity.this, new OnTokenAcquired(), null); } } }); // create some dummy items to display in second screen items = new ArrayList<OrderItem>(); OrderItem item1 = new OrderItem(); // these are the only required fields for second screen display item1.setName("Item1"); item1.setUnitPrice(100l); item1.setQuantity(1.0f); items.add(item1); OrderItem item2 = new OrderItem(); // these are the only required fields for second screen display item2.setName("Item2"); item2.setUnitPrice(100l); item2.setQuantity(1.0f); items.add(item2); OrderItem item3 = new OrderItem(); // these are the only required fields for second screen display item3.setName("Item3"); item3.setUnitPrice(100l); item3.setQuantity(2.0f); items.add(item3); Button displayItems = (Button) findViewById(R.id.displayItems); displayItems.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { /** * Request second screen service to display the items to the consumer * Enable second screen emulator from the developer options on your android * emulator or device. */ try { if (mSecondScreenService != null) { BigDecimal total = new BigDecimal(0); for (OrderItem item : items) { BigDecimal price = new BigDecimal(item.getUnitPrice()); price.setScale(2, RoundingMode.HALF_UP); price = price.multiply(new BigDecimal(item.getQuantity())); total = total.add(price); } mSecondScreenService.showItem(items, total.longValue(), "USD"); } } catch (RemoteException e) { e.printStackTrace(); } } }); } @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_sample, 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(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "binding to services..."); bindService(new Intent(IPoyntBusinessService.class.getName()), mBusinessServiceConnection, Context.BIND_AUTO_CREATE); bindService(new Intent(IPoyntSessionService.class.getName()), mSessionConnection, Context.BIND_AUTO_CREATE); bindService(new Intent(IPoyntSecondScreenService.class.getName()), mSecondScreenConnection, Context.BIND_AUTO_CREATE); } @Override public void onPause() { super.onPause(); Log.d(TAG, "unbinding from services..."); unbindService(mBusinessServiceConnection); unbindService(mSessionConnection); unbindService(mSecondScreenConnection); } /** * Class for interacting with the BusinessService */ private ServiceConnection mBusinessServiceConnection = new ServiceConnection() { // Called when the connection with the service is established public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "PoyntBusinessService is now connected"); // this gets an instance of the IRemoteInterface, which we can use to call on the service mBusinessService = IPoyntBusinessService.Stub.asInterface(service); // first load business and business users to make sure the device resolves to a business // invoke the api to get business details try { mBusinessService.getBusiness(businessReadServiceListener); } catch (RemoteException e) { Log.e(TAG, "Unable to connect to business service to resolve the business this terminal belongs to!"); } } // Called when the connection with the service disconnects unexpectedly public void onServiceDisconnected(ComponentName className) { Log.d(TAG, "PoyntBusinessService has unexpectedly disconnected"); mBusinessService = null; } }; /** * Business service listener interface */ private IPoyntBusinessReadListener businessReadServiceListener = new IPoyntBusinessReadListener.Stub() { @Override public void onResponse(final Business business, PoyntError poyntError) throws RemoteException { Log.d(TAG, "Received business obj:" + business.getDoingBusinessAs() + " -- " + business.getDescription()); runOnUiThread(new Runnable() { @Override public void run() { bizInfo.setText(business.getDoingBusinessAs()); chargeBtn.setVisibility(View.VISIBLE); } }); } }; /** * Class for interacting with the SessionService */ private ServiceConnection mSessionConnection = new ServiceConnection() { // Called when the connection with the service is established public void onServiceConnected(ComponentName className, IBinder service) { Log.e("TransactionTestActivity", "PoyntSessionService is now connected"); // Following the example above for an AIDL interface, // this gets an instance of the IRemoteInterface, which we can use to call on the service mSessionService = IPoyntSessionService.Stub.asInterface(service); } // Called when the connection with the service disconnects unexpectedly public void onServiceDisconnected(ComponentName className) { Log.e("TransactionTestActivity", "PoyntSessionService has unexpectedly disconnected"); mSessionService = null; } }; /** * Session service listener interface */ private IPoyntSessionServiceListener sessionServiceListener = new IPoyntSessionServiceListener.Stub() { @Override public void onResponse(final Account account, PoyntError poyntError) throws RemoteException { runOnUiThread(new Runnable() { @Override public void run() { if (account != null) { userName = account.name; userInfo.setText(userName); currentAccount = account; } else { userInfo.setText("n/a"); currentAccount = null; userName = null; } } }); } }; /** * Account manager callback handler to receive access token or launch * login activity if requested by the Poynt authenticator */ public class OnTokenAcquired implements AccountManagerCallback<Bundle> { @Override public void run(AccountManagerFuture<Bundle> result) { try { if (progress != null) { progress.dismiss(); } Bundle bundle = result.getResult(); Intent launch = (Intent) bundle.get(AccountManager.KEY_INTENT); if (launch != null) { Log.d("TransactionTestActivity", "received intent to login"); startActivityForResult(launch, AUTHORIZATION_CODE); } else { Log.d("TransactionTestActivity", "token user:" + bundle.get(AccountManager.KEY_ACCOUNT_NAME)); accessToken = bundle .getString(AccountManager.KEY_AUTHTOKEN); Log.d("TransactionTestActivity", "received token result: " + accessToken); // display the claims in the screen SignedJWT signedJWT = SignedJWT.parse(accessToken); StringBuilder claimsStr = new StringBuilder(); ReadOnlyJWTClaimsSet claims = signedJWT.getJWTClaimsSet(); claimsStr.append("Subject: " + claims.getSubject()); claimsStr.append(", Type: " + claims.getType()); claimsStr.append(", Issuer: " + claims.getIssuer()); claimsStr.append(", JWT ID: " + claims.getJWTID()); claimsStr.append(", IssueTime : " + claims.getIssueTime()); claimsStr.append(", Expiration Time: " + claims.getExpirationTime()); claimsStr.append(", Not Before Time: " + claims.getNotBeforeTime()); Map<String, Object> customClaims = claims.getCustomClaims(); for (Map.Entry<String, Object> entry : customClaims.entrySet()) { claimsStr.append(", " + entry.getKey() + ": " + entry.getValue()); } tokenInfo.setText(claimsStr.toString()); } } catch (Exception e) { Log.d("TransactionTestActivity", "Exception received: " + e.getMessage()); } } } /** * Class for interacting with the Second Screen Service */ private ServiceConnection mSecondScreenConnection = new ServiceConnection() { // Called when the connection with the service is established public void onServiceConnected(ComponentName className, IBinder service) { Log.d(TAG, "IPoyntSecondScreenService is now connected"); // Following the example above for an AIDL interface, // this gets an instance of the IRemoteInterface, which we can use to call on the service mSecondScreenService = IPoyntSecondScreenService.Stub.asInterface(service); } // Called when the connection with the service disconnects unexpectedly public void onServiceDisconnected(ComponentName className) { Log.d(TAG, "IPoyntSecondScreenService has unexpectedly disconnected"); mSecondScreenService = null; } }; private void launchPoyntPayment(Long amount) { String currencyCode = NumberFormat.getCurrencyInstance().getCurrency().getCurrencyCode(); Payment payment = new Payment(); String referenceId = UUID.randomUUID().toString(); payment.setReferenceId(referenceId); payment.setAmount(amount); payment.setCurrency(currencyCode); // start Payment activity for result try { Intent collectPaymentIntent = new Intent(Intents.ACTION_COLLECT_PAYMENT); collectPaymentIntent.putExtra(Intents.INTENT_EXTRAS_PAYMENT, payment); startActivityForResult(collectPaymentIntent, COLLECT_PAYMENT_REQUEST); } catch (ActivityNotFoundException ex) { Log.e(TAG, "Poynt Payment Activity not found - did you install PoyntServices?", ex); } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d(TAG, "Received onActivityResult (" + requestCode + ")"); // Check which request we're responding to if (requestCode == COLLECT_PAYMENT_REQUEST) { // Make sure the request was successful if (resultCode == Activity.RESULT_OK) { if (data != null) { Payment payment = data.getParcelableExtra(Intents.INTENT_EXTRAS_PAYMENT); Log.d(TAG, "Received onPaymentAction from PaymentFragment w/ Status(" + payment.getStatus() + ")"); if (payment.getStatus().equals(PaymentStatus.COMPLETED)) { Toast.makeText(this, "Payment Completed", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.AUTHORIZED)) { Toast.makeText(this, "Payment Authorized", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.CANCELED)) { Toast.makeText(this, "Payment Canceled", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.FAILED)) { Toast.makeText(this, "Payment Failed", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.REFUNDED)) { Toast.makeText(this, "Payment Refunded", Toast.LENGTH_LONG).show(); } else if (payment.getStatus().equals(PaymentStatus.VOIDED)) { Toast.makeText(this, "Payment Voided", Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "Payment Completed", Toast.LENGTH_LONG).show(); } } } else if (resultCode == Activity.RESULT_CANCELED) { Toast.makeText(this, "Payment Canceled", Toast.LENGTH_LONG).show(); } } } }
fdb5cf5db2e8476b60da830e8cd0f94e97415d39
408d18072f5038f7ac08af08cfd5653873791406
/src/main/java/db/DBHelper.java
3d67c23611e579d36c9f8afc8c1c6bc08d77ae8d
[]
no_license
ccentauri/javaee_mongo
11ff847dec02604dc24f3b1e5d889c547b5a8b1d
203f588d46531b001167e79d2398d4336e2a6f2b
refs/heads/master
2021-06-07T22:02:31.531858
2016-11-11T01:21:29
2016-11-11T01:21:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
931
java
package db; import com.mongodb.MongoClient; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import com.sun.istack.internal.Nullable; import model.MedicineModel; import org.bson.Document; import java.util.LinkedList; public interface DBHelper { @Nullable MongoClient createConnection(); void closeConnection(); @Nullable MongoDatabase getDatabase(); @Nullable MongoClient getClient(); @Nullable MongoCollection<Document> createCollection(); @Nullable MongoCollection<Document> getCollection(); boolean isCollectionExists(final String collectionName); @Nullable LinkedList<MedicineModel> getAllDocuments(); MedicineModel getDocumentById(final String id); void addDocument(final MedicineModel model); void deleteDocument(final String docId); void updateDocument(final String docId, final MedicineModel model); }
1828ac14103a82b6f1d8e326fa39e27f08b05e5e
1cf1c4e00c4b7b2972d8c0b32b02a17e363d31b9
/sources/p000a/p001a/p002a/p003a/p004a/p012g/C0114d.java
ccc28e013de5644b9fd08fc1f39427695ac17781
[]
no_license
rootmelo92118/analysis
4a66353c77397ea4c0800527afac85e06165fd48
a9cd8bb268f54c03630de8c6bdff86b0e068f216
refs/heads/main
2023-03-16T10:59:50.933761
2021-03-05T05:36:43
2021-03-05T05:36:43
344,705,815
0
0
null
null
null
null
UTF-8
Java
false
false
1,336
java
package p000a.p001a.p002a.p003a.p004a.p012g; import java.util.Collection; import p000a.p001a.p002a.p003a.C0152k; /* renamed from: a.a.a.a.a.g.d */ /* compiled from: AppRequestData */ public class C0114d { /* renamed from: a */ public final String f219a; /* renamed from: b */ public final String f220b; /* renamed from: c */ public final String f221c; /* renamed from: d */ public final String f222d; /* renamed from: e */ public final String f223e; /* renamed from: f */ public final String f224f; /* renamed from: g */ public final int f225g; /* renamed from: h */ public final String f226h; /* renamed from: i */ public final String f227i; /* renamed from: j */ public final C0124n f228j; /* renamed from: k */ public final Collection<C0152k> f229k; public C0114d(String str, String str2, String str3, String str4, String str5, String str6, int i, String str7, String str8, C0124n nVar, Collection<C0152k> collection) { this.f219a = str; this.f220b = str2; this.f221c = str3; this.f222d = str4; this.f223e = str5; this.f224f = str6; this.f225g = i; this.f226h = str7; this.f227i = str8; this.f228j = nVar; this.f229k = collection; } }
7be277c309cd5fe0b0da70b115b3ab058d4d487c
97556f295cfda5c2a0d38a802109bc731f63bd92
/src/test/java/com/s4n/delivery/ReporteTest.java
d0c8804414ed29bc8c3aaa25e5c1a33dda163a71
[]
no_license
EjemplosAcademicos/Seven4N-Test
62842d920a8fbf60901731faa8e9d013ef0af9b0
6c411fbd946d2f76b6e1c76962ad7bdeb9a0cca4
refs/heads/master
2020-05-29T17:32:14.469840
2017-02-20T21:19:34
2017-02-20T21:19:34
82,603,390
0
0
null
null
null
null
UTF-8
Java
false
false
2,351
java
package com.s4n.delivery; import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collection; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import com.s4n.delivery.exception.AccessFileException; import com.s4n.delivery.exception.DeliveryException; import com.s4n.delivery.ruta.Ruta; import com.s4n.delivery.ruta.RutaXArchivo; @RunWith(Parameterized.class) public class ReporteTest { private Entrega dispositivo; private Ruta ruta; private String reporte; public ReporteTest(String reporte, Ruta ruta){ this.reporte = reporte; this.ruta = ruta; } @Before public void constructor(){ this.dispositivo = new Dron(10,2); } @After public void destroy(){} @Parameters public static Collection<Object[]> nums() throws AccessFileException{ Object[][] nums = new Object[][]{ { "== Reporte de entregas =="+"\n"+ "(1, 3) dirección Norte"+"\n"+ "(2, 6) dirección Norte"+"\n", new RutaXArchivo("src/test/resources/test_file/in.txt")}, { "== Reporte de entregas =="+"\n"+ "(0, 1) dirección Sur"+"\n"+ "(0, -2) dirección Norte"+"\n", new RutaXArchivo("src/test/resources/test_file/in01.txt")}, { "== Reporte de entregas =="+"\n"+ "(-3, 0) dirección Sur"+"\n"+ "(-6, 0) dirección Norte"+"\n", new RutaXArchivo("src/test/resources/test_file/in02.txt")}, { "== Reporte de entregas =="+"\n", new RutaXArchivo("src/test/resources/test_file/in03.txt")}, { "== Reporte de entregas =="+"\n"+ "(0, 7) dirección Norte"+"\n"+ "(0, 10) dirección Norte"+"\n", new RutaXArchivo("src/test/resources/test_file/in04.txt")}, { "== Reporte de entregas =="+"\n"+ "(0, 3) dirección Oriente"+"\n"+ "(-1, 2) dirección Sur"+"\n", new RutaXArchivo("src/test/resources/test_file/in05.txt")}, }; return Arrays.asList(nums); } @Test public void entregarDomicilioTest() { String reporte; dispositivo.setRuta(ruta); try{ reporte = dispositivo.entregarDomicilio(); assertEquals(this.reporte, reporte); } catch (DeliveryException e) { fail("No se esperaba una DeliveryException "+e.getMessage()); } catch (Exception e) { fail("No se esperaba una Exception "+e.getMessage()); } } }
edb188d8576166006563f6daf70b6dbf076c42ae
aebaeff18af3aab57926aba4100d82b3e97da030
/shoppingmall/src/bookshop/command/_28_QnaDeletePro.java
ae5e8c7c0d3a499c52d87443197084d5739ffb90
[]
no_license
daeunchung/JSP_Projects
2893d9dafca4c8cb24be85e2db6773eddd482ce3
a9a9c049d3012721ee990b73ab975c068ee1f713
refs/heads/master
2023-04-12T01:25:54.952037
2021-04-23T15:46:45
2021-04-23T15:46:45
360,931,569
1
0
null
null
null
null
UTF-8
Java
false
false
698
java
package bookshop.command; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import bookshop.bean.QnaDAO; public class _28_QnaDeletePro implements CommandAction { @Override public String requestPro(HttpServletRequest request, HttpServletResponse response) throws Throwable { // TODO Auto-generated method stub request.setCharacterEncoding("utf-8"); int qna_id = Integer.parseInt(request.getParameter("qna_id")); //qna_id에 해당하는 qna삭제 QnaDAO qnaProcess = QnaDAO.getInstance(); int check = qnaProcess.deleteArticle(qna_id); request.setAttribute("check", new Integer(check)); return "/28_qnaDeletePro.jsp"; } }
2975fd0e9f914bf400d53f8cb6bd1f3fc66c7392
f5eb2121d7afe76f2f11c481ded74cfbc59a1ad4
/communicate/src/main/java/com/mrl/communicate/parse/MessageDecoder.java
ade7759274ecb6f80b9bde81a6addb5119b30bb3
[ "Apache-2.0" ]
permissive
HERO5/SparkDroid
84dd1a4e7dc7e8c2d0163b96381573ffaf210443
ee9255015b43af7c9e702c0750776557fad3e8be
refs/heads/master
2021-01-04T07:09:34.083236
2020-06-29T07:22:45
2020-06-29T07:22:45
240,443,082
1
0
null
null
null
null
UTF-8
Java
false
false
1,719
java
package com.mrl.communicate.parse; import com.mrl.protocol.factory.SerializerFactory; import com.mrl.protocol.pojo.message.Message; import com.mrl.protocol.utils.Serializer; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import java.util.List; /** * @program: com.mrl.protocal.parse * @description: 自定义解码器(将字节数组变为对象) * @author: * @create: 2020-02-02 11:42 **/ public class MessageDecoder extends ByteToMessageDecoder { private static final int HEAD_LENGTH = 4; // 表示数据流(头部是消息长度)头部的字节数 private Serializer serializer = SerializerFactory.getSerializer(Message.class); @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { if (in.readableBytes() < HEAD_LENGTH) { return; } // 标记当前readIndex的位置 in.markReaderIndex(); // 读取传送过来的消息长度,ByteBuf的 readInt() 方法会让它的readIndex+4 int dataLength = in.readInt(); if (dataLength <= 0) {// 如果读到的消息长度不大于0,这是不应该出现的情况,关闭连接 ctx.close(); } if (in.readableBytes() < dataLength) { // 说明是不完整的报文,重置readIndex in.resetReaderIndex(); return; } // 至此,读取到一条完整报文 byte[] body = new byte[dataLength]; in.readBytes(body); // 将bytes数组转换为我们需要的对象 Message msg = serializer.deserialize(body); out.add(msg); } }
c0689b6124468ff147e845fe05df6594395fbb62
81d472dd7458f9e68ef18964e8e9bfb6e38f3f45
/thrillio/src/com/nstoya/thrillio/constants/MovieGenre.java
6f9822eefc15951ab3361f31f5b1019448986cb5
[]
no_license
nstoya/JavaId
e99ec83be861f49ca8cd0885e34b3d3b6acabe5d
a98da2d80fd5ee5dc75c736c47e12165a36a41cd
refs/heads/master
2020-03-12T02:06:47.065028
2018-06-28T07:05:33
2018-06-28T07:05:33
130,393,964
0
0
null
null
null
null
UTF-8
Java
false
false
1,830
java
package com.nstoya.thrillio.constants; public class MovieGenre { private MovieGenre() {} public static final String CLASSICS = "Classics"; public static final String DRAMA = "Drama"; public static final String SCIFI_AND_FANTASY = "Sci-Fi & Fantasy"; public static final String COMEDY = "Comedy"; public static final String CHILDREN_AND_FAMILY = "Children & Family"; public static final String ACTION_AND_ADVENTURE = "Action & Adventure"; public static final String THRILLERS = "Thrillers"; public static final String MUSIC_AND_MUSICALS = "Music & Musicals"; public static final String TELEVISION = "Television"; public static final String HORROR = "Horror"; public static final String SPECIAL_INTEREST = "Special Interest"; public static final String INDEPENDENT = "Independent"; public static final String SPORTS_AND_FITNESS = "Sports & Fitness"; public static final String ANIME_AND_ANIMATION = "Anime & Animation"; public static final String GAY_AND_LESBIAN = "Gay & Lesbian"; public static final String CLASSIC_MOVIE_MUSICALS = "Classic Movie Musicals"; public static final String FAITH_AND_SPIRITUALITY = "Faith & Spirituality"; public static final String FOREIGN_DRAMAS = "Foreign Dramas"; public static final String FOREGIN_ACTION_AND_ADVENTURE = "Foreign Action & Adventure"; public static final String FOREGIN_THRILLERS = "Foreign Thrillers"; public static final String TV_SHOWS = "TV Shows"; public static final String DRAMAS = "Dramas"; public static final String ROMANTIC_MOVIES = "Romantic Movies"; public static final String COMEDIES = "Comedies"; public static final String DOCUMENTARIES = "Documentaries"; public static final String FOREIGN_MOVIES = "Foreign Movies"; }
2a3ec9289c84ac3f17982059968a9b38a95d3388
1556686e784876ccbcfc8f30e5a38e074bb9b4df
/Java/spring/src/com/helloweenvsfei/spring/aop/ThrowsInterceptor.java
a65164a8551b90cde33d1410709bcb2395ceeae2
[]
no_license
smallchichen/pidos
fe5df8011424c7bb55cdb035ea87c89e3043c2fd
f7ef518f953a1aed0d467c21ee50df3bf3ccc46c
refs/heads/master
2023-01-10T16:46:00.467903
2020-03-31T17:15:42
2020-03-31T17:15:42
246,302,825
3
0
null
2023-01-07T16:07:55
2020-03-10T13:04:38
CSS
UTF-8
Java
false
false
559
java
package com.helloweenvsfei.spring.aop; import java.lang.reflect.Method; import javax.security.auth.login.AccountException; import org.springframework.aop.ThrowsAdvice; public class ThrowsInterceptor implements ThrowsAdvice { public void afterThrowing(Method method, Object[] args, Object instance, AccountException ex) throws Throwable { System.out.println("方法" + method.getName() + " 拋出了例外:" + ex); } public void afterThrowing(NullPointerException ex) throws Throwable { System.out.println("拋出了例外:" + ex); } }
5be7d207b98018af16868b16111cf60299e43b0c
2de80e9ce228c09c75ac1355ea4297aa301ed8a8
/app/src/main/java/com/example/devansh/roaddetection/detection/TensorFlowObjectDetectionAPIModel.java
30f3a0a0c5bfd8a4ba82906f10ef87a334817335
[]
no_license
folol/RoadLaneDetection
ae67b525c99729353c26bf09ecc9e1c673459991
6a20e218dd9a49590dd24743acd7ad3c09482147
refs/heads/master
2020-03-10T18:03:30.423590
2018-04-14T12:44:31
2018-04-14T12:44:31
129,515,940
0
0
null
null
null
null
UTF-8
Java
false
false
7,700
java
package com.example.devansh.roaddetection.detection; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.RectF; import android.os.Trace; import com.example.devansh.roaddetection.Classifier; import com.example.devansh.roaddetection.env.Logger; import org.tensorflow.Graph; import org.tensorflow.Operation; import org.tensorflow.contrib.android.TensorFlowInferenceInterface; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.PriorityQueue; import java.util.Vector; /** * Created by devansh on 21/2/18. */ public class TensorFlowObjectDetectionAPIModel implements Classifier { private static final Logger LOGGER = new Logger(); // Only return this many results. private static final int MAX_RESULTS = 100; // Config values. private String inputName; private int inputSize; // Pre-allocated buffers. private Vector<String> labels = new Vector<String>(); private int[] intValues; private byte[] byteValues; private float[] outputLocations; private float[] outputScores; private float[] outputClasses; private float[] outputNumDetections; private String[] outputNames; private boolean logStats = false; private TensorFlowInferenceInterface inferenceInterface; /** * Initializes a native TensorFlow session for classifying images. */ public static Classifier create( final AssetManager assetManager, final String modelFilename, final String labelFilename, final int inputSize) throws IOException { final TensorFlowObjectDetectionAPIModel d = new TensorFlowObjectDetectionAPIModel(); InputStream labelsInput = null; String actualFilename = labelFilename.split("file:///android_asset/")[1]; labelsInput = assetManager.open(actualFilename); BufferedReader br = null; br = new BufferedReader(new InputStreamReader(labelsInput)); String line; while ((line = br.readLine()) != null) { LOGGER.w(line); d.labels.add(line); } br.close(); d.inferenceInterface = new TensorFlowInferenceInterface(assetManager, modelFilename); final Graph g = d.inferenceInterface.graph(); d.inputName = "image_tensor"; // The inputName node has a shape of [N, H, W, C], where // N is the batch size // H = W are the height and width // C is the number of channels (3 for our purposes - RGB) final Operation inputOp = g.operation(d.inputName); if (inputOp == null) { throw new RuntimeException("Failed to find input Node '" + d.inputName + "'"); } d.inputSize = inputSize; // The outputScoresName node has a shape of [N, NumLocations], where N // is the batch size. final Operation outputOp1 = g.operation("detection_scores"); if (outputOp1 == null) { throw new RuntimeException("Failed to find output Node 'detection_scores'"); } final Operation outputOp2 = g.operation("detection_boxes"); if (outputOp2 == null) { throw new RuntimeException("Failed to find output Node 'detection_boxes'"); } final Operation outputOp3 = g.operation("detection_classes"); if (outputOp3 == null) { throw new RuntimeException("Failed to find output Node 'detection_classes'"); } // Pre-allocate buffers. d.outputNames = new String[] {"detection_boxes", "detection_scores", "detection_classes", "num_detections"}; d.intValues = new int[d.inputSize * d.inputSize]; d.byteValues = new byte[d.inputSize * d.inputSize * 3]; d.outputScores = new float[MAX_RESULTS]; d.outputLocations = new float[MAX_RESULTS * 4]; d.outputClasses = new float[MAX_RESULTS]; d.outputNumDetections = new float[1]; return d; } private TensorFlowObjectDetectionAPIModel() {} @Override public List<Recognition> recognizeImage(final Bitmap bitmap) { // Log this method so that it can be analyzed with systrace. Trace.beginSection("recognizeImage"); Trace.beginSection("preprocessBitmap"); // Preprocess the image data from 0-255 int to normalized float based // on the provided parameters. bitmap.getPixels(intValues, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight()); for (int i = 0; i < intValues.length; ++i) { byteValues[i * 3 + 2] = (byte) (intValues[i] & 0xFF); byteValues[i * 3 + 1] = (byte) ((intValues[i] >> 8) & 0xFF); byteValues[i * 3 + 0] = (byte) ((intValues[i] >> 16) & 0xFF); } Trace.endSection(); // preprocessBitmap // Copy the input data into TensorFlow. Trace.beginSection("feed"); inferenceInterface.feed(inputName, byteValues, 1, inputSize, inputSize, 3); Trace.endSection(); // Run the inference call. Trace.beginSection("run"); inferenceInterface.run(outputNames, logStats); Trace.endSection(); // Copy the output Tensor back into the output array. Trace.beginSection("fetch"); outputLocations = new float[MAX_RESULTS * 4]; outputScores = new float[MAX_RESULTS]; outputClasses = new float[MAX_RESULTS]; outputNumDetections = new float[1]; inferenceInterface.fetch(outputNames[0], outputLocations); inferenceInterface.fetch(outputNames[1], outputScores); inferenceInterface.fetch(outputNames[2], outputClasses); inferenceInterface.fetch(outputNames[3], outputNumDetections); Trace.endSection(); // Find the best detections. final PriorityQueue<Recognition> pq = new PriorityQueue<Recognition>( 1, new Comparator<Recognition>() { @Override public int compare(final Recognition lhs, final Recognition rhs) { // Intentionally reversed to put high confidence at the head of the queue. return Float.compare(rhs.getConfidence(), lhs.getConfidence()); } }); // Scale them back to the input size. for (int i = 0; i < outputScores.length; ++i) { final RectF detection = new RectF( outputLocations[4 * i + 1] * inputSize, outputLocations[4 * i] * inputSize, outputLocations[4 * i + 3] * inputSize, outputLocations[4 * i + 2] * inputSize); pq.add( new Recognition("" + i, labels.get((int) outputClasses[i]), outputScores[i], detection)); } final ArrayList<Recognition> recognitions = new ArrayList<Recognition>(); for (int i = 0; i < Math.min(pq.size(), MAX_RESULTS); ++i) { recognitions.add(pq.poll()); } Trace.endSection(); // "recognizeImage" return recognitions; } @Override public void enableStatLogging(final boolean logStats) { this.logStats = logStats; } @Override public String getStatString() { return inferenceInterface.getStatString(); } @Override public void close() { inferenceInterface.close(); } }
a35283596df071a426ec4832cf8ba725055c6126
047b5a07e72d74362a264abdf0feac10b85b2879
/final_togetherTrip_end/src/main/java/trip/user/dto/InterestedFestivalDto.java
06b7fcc329035a56f2a7b7b9739eb54b6a1a3cc8
[]
no_license
gunwoo0223/TogetherTrip
bbe630612012842c63a67a3908627e512031fe86
92706905b7ceb2b53b2d3e18720fc874681d9b3b
refs/heads/master
2021-01-15T13:25:08.506075
2017-08-08T10:05:49
2017-08-08T10:05:49
99,672,699
0
0
null
null
null
null
UTF-8
Java
false
false
958
java
package trip.user.dto; public class InterestedFestivalDto { private String f_thumbnail; private String f_title; private String f_time; private String f_loc; private int f_num; private int g_num; public String getF_thumbnail() { return f_thumbnail; } public void setF_thumbnail(String f_thumbnail) { this.f_thumbnail = f_thumbnail; } public String getF_title() { return f_title; } public void setF_title(String f_title) { this.f_title = f_title; } public String getF_time() { return f_time; } public void setF_time(String f_time) { this.f_time = f_time; } public String getF_loc() { return f_loc; } public void setF_loc(String f_loc) { this.f_loc = f_loc; } public int getF_num() { return f_num; } public void setF_num(int f_num) { this.f_num = f_num; } public int getG_num() { return g_num; } public void setG_num(int g_num) { this.g_num = g_num; } }
ab55ec6b9d13c2eaccbbe54c4ecd5e8dec1e0c6a
662933646d5fbaa5b3b6c851e97ffdc1b24efb6d
/dgn-AutomationFramework/src/main/java/com/ddaqe/pages/TrackingListPopupDialog.java
cf6b4c92fc5fde2b41808aed0c76178867040083
[]
no_license
cbehara/DGN_PageObejectModel
354a9fb06ef58c90b586d19347c2e890c0950ad1
de894be71c4dfc60406955d9c8d019ce1d06d510
refs/heads/master
2020-03-27T01:31:47.316322
2018-08-22T14:19:40
2018-08-22T14:19:40
145,719,539
0
0
null
null
null
null
UTF-8
Java
false
false
4,345
java
package com.ddaqe.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.How; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.Select; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.Status; import com.ddaqe.Listener.TestListener; import com.ddaqe.utils.CommonUtils; import com.ddaqe.utils.SeleniumUtils; public class TrackingListPopupDialog { private WebDriver driver; private ExtentTest extentTest; @FindBy(how = How.XPATH, using = "//a[@class='rename-popup-submit']") private WebElement saveButtonfieldInEditDialog; @FindBy(how = How.NAME, using = "TrackingListType") private WebElement typeListOnEditDialog; @FindBy(how = How.XPATH, using = "//div[@id='popUpLBTrackingListRename']//input[@type='text']") private WebElement nameTextfieldInEditDialog; @FindBy(how = How.LINK_TEXT, using = "Edit") private WebElement editTrackingNameLink; @FindBy(how = How.XPATH, using = "//a[@class='rename-popup-close']") private WebElement cancelButtonfieldInEditDialog; @FindBy(how = How.ID, using = "TrackingListType") private WebElement trackingListType; public TrackingListPopupDialog(WebDriver driver) { this.driver = driver; extentTest = TestListener.getExtentTest(); PageFactory.initElements(driver, this); } public TrackingLists clickOnSaveButtonEditDialog() { extentTest.log(Status.INFO, "Click on Save button of Edit tracking name dialog."); saveButtonfieldInEditDialog.click(); try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return new TrackingLists(driver); } public void selectTypeListInEditDialog(String optionToSelect) { extentTest.log(Status.INFO, "Making changes to Type filter (applicable only for PLAT admin user) option to set :" + optionToSelect); Select typeList = new Select(typeListOnEditDialog); typeList.selectByVisibleText(optionToSelect); } public void editTrackingNameSetText(String trackingName) { extentTest.log(Status.INFO, "Edit/Set the name of Tracking list from Edit tracking name dialog."); nameTextfieldInEditDialog.clear(); nameTextfieldInEditDialog.sendKeys(trackingName); } public boolean isTrackingListTypeDisplayed() { extentTest.log(Status.INFO, "Verify that Tracking list type Drop Down- My Tracking Lists is displayed-PLAT user "); return trackingListType.isDisplayed(); } public boolean checkEditTrackingNameDialog() { boolean result = true; if (!nameTextfieldInEditDialog.isDisplayed()) { result = false; } else if (!saveButtonfieldInEditDialog.isDisplayed()) { result = false; } else if (!cancelButtonfieldInEditDialog.isDisplayed()) { result = false; } return result; } public void clickOnCancelButtonEditDialog() { extentTest.log(Status.INFO, "Click on Cancel button of Edit tracking name dialog."); cancelButtonfieldInEditDialog.click(); } public boolean checkSelectOfEditTypeDropdown(String optionToCheck) { extentTest.log(Status.INFO, "Verify the option selected in the edit dialog type dropdown:" + optionToCheck); Select typeList = new Select(typeListOnEditDialog); return typeList.getFirstSelectedOption().getText().toUpperCase().trim() .equals(optionToCheck.toUpperCase().trim()); } public boolean checkEditTypeDropdownOption() { extentTest.log(Status.INFO, "Verify the option present in the type dropdown of the edit dialog with private option tracking list."); SeleniumUtils.isVisible(typeListOnEditDialog, driver); return MyAccountCommonContainerPage.checkOptionOfShareEditTypeDropdown(typeListOnEditDialog); } public boolean checkETypeDropdownPresentOnEditTrackingDialog() { boolean result = true; if (!typeListOnEditDialog.isDisplayed()) { result = false; } return result; } public boolean checkShareEditTypeDropdownOption() { extentTest.log(Status.INFO, "Verify the option present in the type dropdown of the edit dialog with share option/link tracking list."); SeleniumUtils.isVisible(typeListOnEditDialog, driver); Select typeOption = new Select(typeListOnEditDialog); return CommonUtils.getListFromWebElements(typeOption.getOptions()).contains("Shared"); } }
50329a2526ec260231c462781f0f0d07499c7b7f
9088aefc739131a81733cf37bf1947f1e87916ce
/src/main/java/br/com/zup/desafioZup/resources/UserResource.java
3464a553a590922fe86058bab0cfc39bca1e3983
[]
no_license
ThallesRg/zupChallenge
dbbb4548d37b522dc58cc30853be8eab9cc40e4b
0fa83e0ca9901a56e776e630074d0789e1c48416
refs/heads/main
2023-02-09T23:43:11.803469
2021-01-03T23:39:31
2021-01-03T23:39:31
326,522,419
0
0
null
null
null
null
UTF-8
Java
false
false
2,607
java
package br.com.zup.desafioZup.resources; import java.net.URI; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort.Direction; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import br.com.zup.desafioZup.dto.UserDTO; import br.com.zup.desafioZup.services.UserService; @RestController @RequestMapping(value = "/users") public class UserResource { @Autowired private UserService service; @GetMapping public ResponseEntity<Page<UserDTO>> findAll( @RequestParam(value = "page", defaultValue = "0") Integer page, @RequestParam(value = "linesPerPage", defaultValue = "12") Integer linesPerPage, @RequestParam(value = "direction", defaultValue = "ASC") String direction, @RequestParam(value = "orderBy", defaultValue = "name") String orderBy ){ PageRequest pageRequest = PageRequest.of(page, linesPerPage, Direction.valueOf(direction), orderBy ); Page<UserDTO> list = service.findAllPaged(pageRequest); return ResponseEntity.ok().body(list); } @GetMapping(value = "/{id}") public ResponseEntity<UserDTO> findById( @PathVariable Long id){ UserDTO dto = service.findById(id); return ResponseEntity.ok().body(dto); } @PostMapping public ResponseEntity<UserDTO> insert(@Valid @RequestBody UserDTO dto){ UserDTO newDto = service.insert(dto); URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}") .buildAndExpand(newDto.getId()).toUri(); return ResponseEntity.created(uri).body(newDto); } @PutMapping(value = "/{id}") public ResponseEntity<UserDTO> update(@PathVariable Long id,@Valid @RequestBody UserDTO dto){ dto = service.updtate(id, dto); return ResponseEntity.ok().body(dto); } @DeleteMapping(value = "/{id}") public ResponseEntity<UserDTO> delete(@PathVariable Long id){ service.delete(id); return ResponseEntity.noContent().build(); } }
5e5d72cd98f40b45096e3da816a56cff043d50ac
a75669a70ef519de46ff873c77cc9bc20f06ff62
/Sokoban-Client/src/model/data/TypeFactory.java
6920b312d5ed4d45f55377ce523c2e59e5d15c7c
[]
no_license
MaayanMash/Sokoban-Client
86f7a7d8f9a8fba19caa999a049807aa3ae140a0
0f1202e38ffc0ba1e1a322a9f47d8b29d02f4c69
refs/heads/master
2020-12-02T08:05:39.050694
2017-07-10T13:12:41
2017-07-10T13:12:41
96,768,094
0
0
null
null
null
null
UTF-8
Java
false
false
1,734
java
package model.data; import java.util.HashMap; import commons.Box; import commons.Path; import commons.Player; import commons.Target; import commons.TwoPoint; import commons.Wall; import commons.type; public class TypeFactory { private HashMap<Character, CreatorType> typeCreator; public TypeFactory() { typeCreator = new HashMap<Character, CreatorType>(); typeCreator.put(' ',new PathCreator()); typeCreator.put('#',new WallCreator()); typeCreator.put('o',new TargetCreator()); typeCreator.put('O',new TargetCreator()); BoxCreator bc=new BoxCreator(); typeCreator.put('@',bc); typeCreator.put('$',bc); //box on target PlayerCreator pc= new PlayerCreator(); typeCreator.put('A',pc); typeCreator.put('a',pc); //player on target } private class PathCreator implements CreatorType{ @Override public type createType(TwoPoint pos) { return new Path(pos); } } private class WallCreator implements CreatorType{ @Override public type createType(TwoPoint pos) { return new Wall(pos); } } private class TargetCreator implements CreatorType{ @Override public type createType(TwoPoint pos) { return new Target(pos); } } private class BoxCreator implements CreatorType{ @Override public type createType(TwoPoint pos) { return new Box(pos); } } private class PlayerCreator implements CreatorType{ @Override public type createType(TwoPoint pos) { return new Player(pos); } } public type creatType(Character c,TwoPoint pos) { CreatorType ct= typeCreator.get(c); TwoPoint tp = new TwoPoint(pos.getX(),pos.getY()); if(ct!= null)return ct.createType(tp); return null; } }
ae908ca640857b3089813ef3755072390f8ddc80
d82eed5360ade2147b38ffb12303ecc51e4da9a8
/Ejercicios-PoloTic/Ejercicios/src/ejercicios/Ejercicio_02.java
c34c5212f246d1e536816df50556d89c7c9d0a0a
[]
no_license
ArtemioD/Ejercicios_Java
fcbc6952b0d94dfa898a49b99341429bb1360ca6
90df72da92128cc2f23312514b7f031a677d9b8f
refs/heads/main
2023-02-11T09:57:12.872425
2021-01-16T20:38:31
2021-01-16T20:38:31
323,934,779
0
0
null
null
null
null
UTF-8
Java
false
false
686
java
package ejercicios; import java.util.Scanner; /* Realozar un programa que muestre por pantalla palabras que sean ingresadas por teclado hasta que se ingrese la palabra "salir". */ public class Ejercicio_02 { public static void start() { Scanner entrada = new Scanner(System.in); String palabra; boolean bandera = true; while (bandera == true) { System.out.println("Ingrese una palabra: "); palabra = entrada.next(); if (palabra.equalsIgnoreCase("salir")) { bandera = false; }else{ System.out.println(palabra); } } } }
5a8929fb3c4ef22dd2df4cbba635a5f180b95bd9
2c6ebc529297ec6806f840212bfebc865b0e98ca
/src/test/java/com/amos/lukkien/airlineapp/service/BookingServiceImplTest.java
dc977ae3e47e463943974811b03dbc373986743c
[]
no_license
coats001/lukkien-airlines-web-services
c9c26618ad9b25b32f21d54ddbfb96fd5f430b05
1f39aab16d50c81eb72499736b5c62cc1783e653
refs/heads/master
2020-03-09T08:32:37.374707
2018-04-11T12:17:57
2018-04-11T12:17:57
128,691,716
0
0
null
null
null
null
UTF-8
Java
false
false
398
java
package com.amos.lukkien.airlineapp.service; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; public class BookingServiceImplTest { @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void findAirportsByCodeOrName() throws Exception { } }
deff9c515d8831828bb09cd54a514c5891e979ff
46c74ca498972fd12026ab322cf54f83faf4064d
/src/main/java/com/dy/leetcode/_组合问题/_40NO.java
bf4d164064668bf4e44a862ed9f23c9fc4c79d99
[]
no_license
dengyu123456/mini_springMvc
9e16364de1f663b6d280119dd007af09b3a84e69
98e3fd51886dfcc20b63d8f06ebd107f813f3298
refs/heads/master
2022-06-22T09:48:36.092022
2021-05-10T20:17:04
2021-05-10T20:17:04
214,308,704
2
1
null
2022-06-17T03:27:10
2019-10-11T00:16:53
Java
UTF-8
Java
false
false
2,268
java
package com.dy.leetcode._组合问题; import java.util.*; //给定一个数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。 // //candidates 中的每个数字在每个组合中只能使用一次。 // //说明: // //所有数字(包括目标数)都是正整数。 //解集不能包含重复的组合。  //示例 1: // //输入: candidates = [10,1,2,7,6,1,5], target = 8, //所求解集为: //[ // [1, 7], // [1, 2, 5], // [2, 6], // [1, 1, 6] //] //示例 2: // //输入: candidates = [2,5,2,1,2], target = 5, //所求解集为: //[ //  [1,2,2], //  [5] //] // //来源:力扣(LeetCode) //链接:https://leetcode-cn.com/problems/combination-sum-ii //著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 public class _40NO { List<List<Integer>> res = new ArrayList<>(); List<Integer> pathList = new ArrayList<>(); // //访问过的索引 // boolean visitIndex[] = null; // boolean visitNum[] = null; public List<List<Integer>> combinationSum2(int[] candidates, int target) { Arrays.sort(candidates); combinationSum(candidates, target, 0); return res; } public void combinationSum(int[] candidates, int target, int minIndex) { Set<Integer> set = new HashSet<>(); for (int i = minIndex; i < candidates.length; i++) { if (set.contains(candidates[i])) { continue; } else { set.add(candidates[i]); } if (candidates[i] > target) { continue; } if (candidates[i] == target) { pathList.add(candidates[i]); res.add(new ArrayList<>(pathList)); pathList.remove(pathList.size() - 1); } if (candidates[i] < target) { pathList.add(candidates[i]); combinationSum(candidates, target - candidates[i], i + 1); pathList.remove(pathList.size() - 1); } } } public static void main(String[] args) { int[] nums = {10, 1, 2, 7, 6, 1, 5}; new _40NO().combinationSum2(nums, 8); } }
7ca563924a4fdecdc0cd86cef8718f8124dfcfe1
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/85/1007.java
eba6d19629f403433bad0db731102449b84b0aad
[ "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
1,052
java
package <missing>; public class GlobalMembers { public static int judge(tangible.RefObject<String> zfc) { //C++ TO JAVA CONVERTER TODO TASK: Pointer arithmetic is detected on this variable, so pointers on this variable are left unchanged: char * p; p = zfc.argValue; for (; * p != '\0';p++) { if (*p == '_' || ('A' <= *p && *p <= 'Z') || ('a' <= *p && *p <= 'z') || ('0' <= *p && *p <= '9' && p != zfc.argValue)) { continue; } else { return 0; } } return 1; } public static int Main() { int i; String z = new String(new char[3]); z = new Scanner(System.in).nextLine(); int n = Integer.parseInt(z); for (i = 0;i < n;i++) { String zfc = new String(new char[81]); zfc = new Scanner(System.in).nextLine(); tangible.RefObject<String> tempRef_zfc = new tangible.RefObject<String>(zfc); if (judge(tempRef_zfc) != 0) { zfc = tempRef_zfc.argValue; System.out.print("yes\n"); } else { zfc = tempRef_zfc.argValue; System.out.print("no\n"); } } return 0; } }
7df8418b2ea6156a2ee4535db15bd675bf1140c4
e9896512fc98d0614bedae02e17b58010b500d32
/discourse.parser.parent/discourse.conll.dataset/src/main/java/org/cleartk/corpus/conll2015/json/SentenceTokenFinder.java
53535d1044fbe6de5d9bdadfd9a241407fee8060
[ "BSD-2-Clause-Views" ]
permissive
mjlaali/CLaCDiscourseParser
8c7b7d2988b8e2f6604c0a641215cc15d0931f82
cc840de13d1df9294dd471050dfbfbbb4220ba0b
refs/heads/master
2020-04-15T23:46:55.878280
2019-02-24T20:01:59
2019-02-24T20:01:59
35,230,582
4
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package org.cleartk.corpus.conll2015.json; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class SentenceTokenFinder { private String[] SentIDX=new String[2]; private String[] TokenIDX=new String[4]; public String[] SentFinder(JSONArray WordList) throws JSONException { JSONArray FirstWord = (JSONArray) WordList.get(0); JSONObject FirstWordSpec = (JSONObject) FirstWord.get(1); SentIDX[0] = FirstWordSpec.get("CharacterOffsetBegin").toString(); JSONArray EndWord = (JSONArray) WordList.get(WordList.length()-1); JSONObject EndWordSpec = (JSONObject) EndWord.get(1); SentIDX[1] = EndWordSpec.get("CharacterOffsetEnd").toString(); return SentIDX; } public String[] TokenFinder(JSONArray Word) throws JSONException { String WordTonen = Word.get(0).toString(); JSONObject WordSpec = (JSONObject) Word.get(1); //System.out.println(WordSpec); TokenIDX[0] = WordTonen; TokenIDX[1] = WordSpec.get("CharacterOffsetBegin").toString(); TokenIDX[2] = WordSpec.get("CharacterOffsetEnd").toString(); TokenIDX[3] = WordSpec.get("PartOfSpeech").toString(); return TokenIDX; } }
ca23e27c5d36f4da2da5348ba55ad0db173832d3
70f7b7dec601d172b0eab4b5a7c22bdab7d3c65a
/CVProjectData.java
f5499091287fdf02750a8e31d54c5d46132e49f1
[]
no_license
derek-hon/4P82Project
ccd61423f787ba6e4266d43434f9edba69ae6ad5
3ac3fda16526ddca6674ab8a78990728aa4b2bf1
refs/heads/master
2022-03-31T19:17:58.612705
2019-12-15T19:33:59
2019-12-15T19:33:59
224,778,000
0
0
null
null
null
null
UTF-8
Java
false
false
280
java
package ec.Project4P82; import ec.gp.*; /** * @author Derek Hon * @version 1.0 */ public class CVProjectData extends GPData { // return value public double d; public void copyTo(final GPData gpd) { ((CVProjectData)gpd).d = d; } }
3943be3ad0ae674cd81769dc207f79b127088591
659b4d1e42c9dd587fa0d25c40228e3d921199c2
/syswarpERPWeb/src/ar/com/syswarp/web/ejb/BeanTickets_prioridadAbm.java
830203724b09fa0d845b0d079bcfa6df37a50b74
[]
no_license
martinChochochocho/melezcabaco
3e0ada7c74ae8d2819bc0f98b683d83d743ddf79
85e5a1cf5dc017b4844d006f602c0e73d81098fd
refs/heads/master
2020-07-03T16:48:13.970360
2014-12-09T04:40:14
2014-12-09T04:40:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,535
java
/* javabean para la entidad: tickets_prioridad Copyrigth(r) sysWarp S.R.L. Fecha de creacion: Tue Feb 26 14:19:10 ART 2008 Para manejar la pagina: tickets_prioridadAbm.jsp */ package ar.com.syswarp.web.ejb; import java.io.Serializable; import java.rmi.RemoteException; import javax.ejb.EJBException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; import javax.servlet.RequestDispatcher; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import java.util.*; import java.math.*; import ar.com.syswarp.ejb.*; import ar.com.syswarp.api.Common; public class BeanTickets_prioridadAbm implements SessionBean, Serializable { static Logger log = Logger.getLogger(BeanTickets_prioridadAbm.class); private SessionContext context; private int limit = 15; private long offset = 0l; private long totalRegistros = 0l; private long totalPaginas = 0l; private long paginaSeleccion = 1l; private List tickets_prioridadList = new ArrayList(); private String accion = ""; private String ocurrencia = ""; private BigDecimal idprioridad; private BigDecimal idempresa; private String mensaje = ""; private HttpServletRequest request; private HttpServletResponse response; boolean buscar = false; public BeanTickets_prioridadAbm() { super(); } public void setSessionContext(SessionContext newContext) throws EJBException { context = newContext; } public void ejbRemove() throws EJBException, RemoteException { // TODO Auto-generated method stub } public void ejbActivate() throws EJBException, RemoteException { // TODO Auto-generated method stub } public void ejbPassivate() throws EJBException, RemoteException { // TODO Auto-generated method stub } public boolean ejecutarValidacion() { RequestDispatcher dispatcher = null; General tickets_prioridad = Common.getGeneral(); try { if (this.accion.equalsIgnoreCase("baja")) { if (idprioridad == null || idprioridad.longValue() < 0) { this.mensaje = "Debe seleccionar un registro a eliminar."; } else { this.mensaje = tickets_prioridad.tickets_prioridadDelete(idprioridad,this.idempresa); } } if (this.accion.equalsIgnoreCase("modificacion")) { if (idprioridad == null || idprioridad.longValue() < 0) { this.mensaje = "Debe seleccionar un registro a modificar."; } else { dispatcher = request.getRequestDispatcher("tickets_prioridadFrm.jsp"); dispatcher.forward(request, response); return true; } } if (this.accion.equalsIgnoreCase("alta")) { dispatcher = request.getRequestDispatcher("tickets_prioridadFrm.jsp"); dispatcher.forward(request, response); return true; } if (!this.ocurrencia.trim().equalsIgnoreCase("")) { if (ocurrencia.indexOf("'") >= 0) { this.mensaje = "Caracteres invalidos en campo busqueda."; } else { buscar = true; } } if (buscar) { String[] campos = { "idprioridad", "prioridad" }; this.totalRegistros = tickets_prioridad.getTotalEntidadOcuporempresa("tickets_prioridad", campos, this.ocurrencia,this.idempresa); this.totalPaginas = (this.totalRegistros / this.limit) + 1; if (this.totalPaginas < this.paginaSeleccion) this.paginaSeleccion = this.totalPaginas; if (this.totalRegistros == this.limit) this.offset = 0; this.offset = (this.paginaSeleccion - 1) * this.limit; if (this.totalRegistros == this.limit) { this.offset = 0; this.totalPaginas = 1; } this.tickets_prioridadList = tickets_prioridad.getTickets_prioridadOcu(this.limit,this.offset, this.ocurrencia,this.idempresa); } else { this.totalRegistros = tickets_prioridad.getTotalEntidadporempresa("tickets_prioridad",this.idempresa); this.totalPaginas = (this.totalRegistros / this.limit) + 1; if (this.totalPaginas < this.paginaSeleccion) this.paginaSeleccion = this.totalPaginas; this.offset = (this.paginaSeleccion - 1) * this.limit; if (this.totalRegistros == this.limit) { this.offset = 0; this.totalPaginas = 1; } this.tickets_prioridadList = tickets_prioridad.getTickets_prioridadAll(this.limit,this.offset,this.idempresa); } if (this.totalRegistros < 1) this.mensaje = "No existen registros."; } catch (Exception e) { log.error("ejecutarValidacion()" + e); } return true; } public int getLimit() { return limit; } public void setLimit(int limit) { this.limit = limit; } public long getOffset() { return offset; } public void setOffset(long offset) { this.offset = offset; } public long getTotalRegistros() { return totalRegistros; } public void setTotalRegistros(long total) { this.totalRegistros = total; } public long getTotalPaginas() { return totalPaginas; } public void setTotalPaginas(long totalPaginas) { this.totalPaginas = totalPaginas; } public long getPaginaSeleccion() { return paginaSeleccion; } public void setPaginaSeleccion(long paginaSeleccion) { this.paginaSeleccion = paginaSeleccion; } public List getTickets_prioridadList() { return tickets_prioridadList; } public void setTickets_prioridadList(List tickets_prioridadList) { this.tickets_prioridadList = tickets_prioridadList; } public String getAccion() { return accion; } public void setAccion(String accion) { this.accion = accion; } public String getOcurrencia() { return ocurrencia; } public void setOcurrencia(String buscar) { this.ocurrencia = buscar; } public BigDecimal getIdprioridad(){ return idprioridad; } public void setIdprioridad(BigDecimal idprioridad){ this.idprioridad=idprioridad; } public String getMensaje() { return mensaje; } public void setMensaje(String mensaje) { this.mensaje = mensaje; } public HttpServletRequest getRequest() { return request; } public void setRequest(HttpServletRequest request) { this.request = request; } public HttpServletResponse getResponse() { return response; } public void setResponse(HttpServletResponse response) { this.response = response; } public BigDecimal getIdempresa() { return idempresa; } public void setIdempresa(BigDecimal idempresa) { this.idempresa = idempresa; } }
[ "[email protected]@d2fec2ea-c312-7dbe-da52-3d23d6abaef1" ]
[email protected]@d2fec2ea-c312-7dbe-da52-3d23d6abaef1
6da8c93cb2ef9b833e1454ea364e0ec4c7af8c82
03dee6ba5e084ee3c61971e56255ffedf3501bd4
/src/hr/zg/rus/PublicKey.java
e1ccdab7dbfe495550358ee06b6762b8aa9c4dad
[ "MIT" ]
permissive
Vidreven/Honeybadger
1a82e58bea65406bab95b99b33ec9996f8120b1e
36e754be2b0782b491c5c41e56f004689a4c3f5d
refs/heads/master
2021-01-19T12:28:51.964530
2017-09-14T18:16:44
2017-09-14T18:16:44
100,790,598
1
0
null
null
null
null
UTF-8
Java
false
false
5,326
java
package hr.zg.rus; import io.nayuki.bitcoin.crypto.*; import java.util.Arrays; import java.util.Hashtable; public class PublicKey { private int[] val = new int[3 * 8 + 1 * 8 + CurvePointMath.MULTIPLY_TEMP_WORDS]; private int[] public_key = new int[24]; private boolean valid; private boolean compressed; private PrivateKey private_key; private Hashtable<String, Byte> network; // Should accept PrivateKey as argument. public PublicKey(PrivateKey privkey){ if(!privkey.isValid()) throw new IllegalArgumentException("Generate private key before creating public key"); valid = false; this.private_key = privkey; this.compressed = privkey.isCompressed(); this.network = privkey.getNetwork(); } // Returns public key in little endian. // point = [x, y, z] // x = little endian // y = little endian // z = little endian // Must be on curve! public int[] generatePubKey(){ int[] decimal_key = new int[24]; try { decimal_key = private_key.toUit(); } catch (IllegalArgumentException iae){ System.out.println(iae); } decimal_key = reverseArray(decimal_key); //store private key as little endian. int[] basepoint = CurvePointMath.getBasePoint(); // Copy the base point into the val array System.arraycopy(basepoint, 0, val, 0, 3 * 8 ); // Copy the number to multiply the base point with (private key) System.arraycopy(decimal_key, 0, val, 3 * 8, 8); CurvePointMath.multiply(val, 0, 3 * 8, 32); CurvePointMath.normalize(val, 0, 32); if(CurvePointMath.isOnCurve(val, 0, 24) == 0) throw new IllegalArgumentException("Error calculating public key! Generate a new private key."); public_key = Arrays.copyOfRange(val, 0, 24); valid = true; return public_key; } // Big endian public byte[] toBin(){ byte[] byte_pubkey; int header; if(!valid) throw new IllegalArgumentException("Generate a public key!"); // Parses coordinates from public_key byte[] XCOORD = Int256Math.uintToBytes(public_key, 0); if(!compressed){ byte_pubkey = new byte[65]; header = 4; byte_pubkey[0] = (byte)header; byte[] YCOORD = Int256Math.uintToBytes(public_key, 8); System.arraycopy(YCOORD, 0, byte_pubkey, 33, 32); } else { byte_pubkey = new byte[33]; header = getHeader(); byte_pubkey[0] = (byte)header; } System.arraycopy(XCOORD, 0, byte_pubkey, 1, 32); return byte_pubkey; } // Big endian public String toHex(){ int header; String hex_pubkey = new String(); if(!valid) throw new IllegalArgumentException("Generate a public key!"); String XCOORD = Int256Math.uintToHex(public_key, 0); if(!compressed) { header = 4; String YCOORD = Int256Math.uintToHex(public_key, 8); hex_pubkey = "0" + Integer.toHexString(header) + XCOORD + YCOORD; } else{ header = getHeader(); hex_pubkey = "0" + Integer.toHexString(header) + XCOORD; } return hex_pubkey; } public String toAddress(){ byte[] byte_pubkey; byte_pubkey = toBin(); Sha256Hash sha; sha = Sha256.getHash(byte_pubkey); byte[] rmdsha; rmdsha = Ripemd160.getHash(sha.toBytes()); byte[] raw_key = new byte[21]; raw_key[0] = network.get("pubKeyHash"); System.arraycopy(rmdsha, 0, raw_key, 1, 20); return Base58Check.bytesToBase58(raw_key); } public String makePubkeyScript(String address){ byte[] raw_script = Base58Check.base58ToBytes(address); // version byte + PKH byte[] raw_pkh = new byte[32]; System.arraycopy(raw_script, 1, raw_pkh, 12, 20); int[] temp = new int[8]; Int256Math.bytesToUint(raw_pkh, temp, 0); String hex_key = Int256Math.uintToHex(temp, 0); hex_key = hex_key.substring(24, hex_key.length()); return "76a914" + hex_key + "88ac"; } public String makePubkeyScript(){ String address = toAddress(); return makePubkeyScript(address); } public boolean isValid() { return valid; } public int[] getPublic_key() { if(!valid) throw new IllegalArgumentException("Public key not generated!"); return public_key; } public boolean equal(PublicKey other){ return Arrays.equals(this.public_key, other.getPublic_key()); } public boolean isCompressed() { return compressed; } public String toString(){ return toHex(); } private int[] reverseArray(int[] arr){ int size = arr.length; int[] temp = new int[size]; for (int i = 0; i < arr.length; i++) { temp[size-1-i] = arr[i]; } return temp; } private int getHeader(){ int header; header = Integer.reverseBytes(public_key[8]); // Last byte of Y is stored here header = 2 + Math.abs((header % 2)); return header; } }
4084427da0afc11e1096c7e77f0c6955681cb1c6
f198c6a651036e7f6179bea2fedbdb723b7a8635
/Seccion_03_CardView/app/src/androidTest/java/mx/edu/utng/seccion_03_cardview/ApplicationTest.java
e344800fe4b22893a87d16292d178cccb1e08317
[]
no_license
Miguel1196pollo/Proyectos-Unidad-5
bd8d0e99dd20a259f9e2da872c5d184167faf573
91d3fdaeff0c2bc45bc9f96f7dadaed6c7cce96c
refs/heads/master
2021-01-20T00:09:34.573370
2017-04-22T17:44:39
2017-04-22T17:44:39
89,087,307
0
0
null
null
null
null
UTF-8
Java
false
false
362
java
package mx.edu.utng.seccion_03_cardview; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
a0c3111827d3be037f64a6dd00ba8f02c9c73c60
6472fb91c65a6429525bf0a520ead1bc6e820106
/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/valuesets/ContractActorroleEnumFactory.java
58dbc243083aff964e611f7ff14ef0a4882fb762
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
tlevrard/hapi-fhir
e436d1f708c753abf332fac7985e13d4a6aeb2b3
08b19f55ad71104f576a062b1f7fc59ccbeacb6c
refs/heads/master
2021-01-17T22:06:25.832988
2015-08-31T20:18:38
2015-08-31T20:18:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,499
java
package org.hl7.fhir.instance.model.valuesets; /* Copyright (c) 2011+, HL7, Inc. All rights reserved. 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 HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Generated on Thu, Aug 27, 2015 19:45-0400 for FHIR v0.5.0 import org.hl7.fhir.instance.model.EnumFactory; public class ContractActorroleEnumFactory implements EnumFactory<ContractActorrole> { public ContractActorrole fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("practitioner".equals(codeString)) return ContractActorrole.PRACTITIONER; if ("patient".equals(codeString)) return ContractActorrole.PATIENT; throw new IllegalArgumentException("Unknown ContractActorrole code '"+codeString+"'"); } public String toCode(ContractActorrole code) { if (code == ContractActorrole.PRACTITIONER) return "practitioner"; if (code == ContractActorrole.PATIENT) return "patient"; return "?"; } }
e544ac811eb39ed625b88f9f2328bd0bce3ff66e
ac1c9fbc1f1019efb19d0a8f3a088e8889f1e83c
/out/release/gen/services/device/public/mojom/mojom_java/generated_java/input_srcjars/org/chromium/device/mojom/InputDeviceManager.java
dc03e629589fe859c0a053dcd8190027eda72316
[ "BSD-3-Clause" ]
permissive
xueqiya/chromium_src
5d20b4d3a2a0251c063a7fb9952195cda6d29e34
d4aa7a8f0e07cfaa448fcad8c12b29242a615103
refs/heads/main
2022-07-30T03:15:14.818330
2021-01-16T16:47:22
2021-01-16T16:47:22
330,115,551
1
0
null
null
null
null
UTF-8
Java
false
false
1,196
java
// InputDeviceManager.java is auto generated by mojom_bindings_generator.py, do not edit // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is autogenerated by: // mojo/public/tools/bindings/mojom_bindings_generator.py // For: // services/device/public/mojom/input_service.mojom // package org.chromium.device.mojom; public interface InputDeviceManager extends org.chromium.mojo.bindings.Interface { public interface Proxy extends InputDeviceManager, org.chromium.mojo.bindings.Interface.Proxy { } Manager<InputDeviceManager, InputDeviceManager.Proxy> MANAGER = InputDeviceManager_Internal.MANAGER; void getDevicesAndSetClient( org.chromium.mojo.bindings.AssociatedInterfaceNotSupported client, GetDevicesAndSetClientResponse callback); interface GetDevicesAndSetClientResponse extends org.chromium.mojo.bindings.Callbacks.Callback1<InputDeviceInfo[]> { } void getDevices( GetDevicesResponse callback); interface GetDevicesResponse extends org.chromium.mojo.bindings.Callbacks.Callback1<InputDeviceInfo[]> { } }
a36944135ed7735e859907b2a8e2874f11a531b4
244255f2c1886699838060288ec396e30fab2bd8
/4.JavaCollections/src/com/javarush/task/task28/task2810/model/DiceStrategy.java
3b3dc8319f7b37b5cac29c9defc1b9ee0850dc4c
[]
no_license
AlexManax/JavaRushTasks
fb1fe1f57d0f89a7dbe3e8b5bd879d4f4b6e9b29
7a8359699c0f917228b21473eeca5815d8fb2243
refs/heads/master
2020-04-26T21:35:45.199276
2020-03-06T19:14:57
2020-03-06T19:14:57
173,846,068
0
0
null
null
null
null
UTF-8
Java
false
false
1,338
java
//package com.javarush.task.task28.task2810.model; // //import com.javarush.task.task28.task2810.vo.Vacancy; //import org.jsoup.Connection; //import org.jsoup.Jsoup; //import org.jsoup.nodes.Document; // //import java.io.IOException; //import java.nio.file.Files; //import java.nio.file.Paths; //import java.util.Collections; //import java.util.List; // //public class DiceStrategy implements Strategy{ // private static final String URL_FORMAT = "https://www.dice.com/jobs?q=java+jun&l=%s&p=%d"; // // @Override // public List<Vacancy> getVacancies(String searchString) { // Connection connection = Jsoup.connect(String.format(URL_FORMAT,"",1)); // connection.userAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"); // connection.referrer("www.google.com"); // Document document; // try { // document = connection.get(); // System.out.println(document.html()); // Files.write(Paths.get("/Users/alexp/Desktop/JavaRushTasks/JavaRushTasks/4.JavaCollections/src/com/javarush/task/task28/task2810/html"), Collections.singleton(document.html())); // } catch (IOException e) { // e.printStackTrace(); // } // // return Collections.EMPTY_LIST; // } //}
e3ccb6a88d0eaba0c44b13cd8185175d9a363ebe
e123e439dec64749acc3f69cf2486147d43b00c1
/src/main/java/com/example/orm/repository/UserRepository.java
a267985bcbe682c8fed9ffd3fdd5eabda86b75d1
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
jorikburlakov/restorator
d7f8b69dab8ff95c1c7f19abf21be3ffcc7dde72
dfaa34b86a2b6c0fb7109371e38ba8be8376c11c
refs/heads/master
2021-01-10T09:21:11.559899
2015-12-21T23:57:03
2015-12-21T23:57:03
48,388,876
0
0
null
null
null
null
UTF-8
Java
false
false
921
java
/* * Copyright 2014-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.orm.repository; import com.example.orm.model.User; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface UserRepository extends CrudRepository<User, Long> { User findByLogin(String login); }
d196cd49e3deccef7d9d5a4bb7c24d67f01cf3dd
79595075622ded0bf43023f716389f61d8e96e94
/app/src/main/java/com/android/server/biometrics/BiometricsService.java
4bbf8e9032e11f8f01c094635efa780fbe4541b0
[]
no_license
dstmath/OppoR15
96f1f7bb4d9cfad47609316debc55095edcd6b56
b9a4da845af251213d7b4c1b35db3e2415290c96
refs/heads/master
2020-03-24T16:52:14.198588
2019-05-27T02:24:53
2019-05-27T02:24:53
142,840,716
7
4
null
null
null
null
UTF-8
Java
false
false
11,517
java
package com.android.server.biometrics; import android.content.Context; import android.os.IBinder.DeathRecipient; import android.os.Message; import android.os.PowerManagerInternal; import android.os.SystemProperties; import android.util.Log; import android.view.WindowManagerPolicy; import com.android.server.LocalServices; import com.android.server.ServiceThread; import com.android.server.SystemService; import com.android.server.Watchdog; import com.android.server.Watchdog.Monitor; import com.android.server.biometrics.tool.ExHandler; import com.android.server.face.FaceService; import com.android.server.face.power.FaceInternal; import com.android.server.fingerprint.FingerprintService; import com.android.server.fingerprint.power.FingerprintInternal; public class BiometricsService extends SystemService implements DeathRecipient, Monitor { public static boolean DEBUG = SystemProperties.getBoolean("persist.sys.assert.panic", false); public static final String GO_TO_SLEEP_BY_AUTHENTICATE_SUSPEND = "FINGERPRINT_AUTHENTICATE_SUSPEND"; public static final String KEEP_KEYGUARD_OPAQUE_WHILE_AUTO_UNLOCK = "keepOpaqueWhileAutoUnlock"; public static final int MSG_TURN_SCREEN_ON_BY_FAIL_RESULT = 1; public static final String SET_KEYGUARD_OPAQUE_WHILE_FAIL_UNLOCK = "setOpaqueWhileFailToUnlock"; public static final String SET_KEYGUARD_OPAQUE_WHILE_WAKE_UP_REASON_NOT_BIOMETRICS = "wakeUpByOther"; public static final String TAG = "BiometricsService.Main"; public static final String TAG_NAME = "BiometricsService"; public static final String UNBLOCK_SCREEN_ON_BY_AUTHENTICATE_FAIL = "unBlockScreenOnByAuthenticateFail"; public static final String UNBLOCK_SCREEN_ON_BY_AUTHENTICATE_SUCESS = "unBlockScreenOnByAuthenticateSucess"; public static final String UNBLOCK_SCREEN_ON_BY_AUTHENTICATE_TIMEOUT = "unBlockScreenOnByAuthenticateTimeout"; public static final String UNBLOCK_SCREEN_ON_BY_ERROR = "unBlockScreenOnByError"; private int mBrightness = 255; private final Context mContext; private FaceInternal mFaceInternal = null; private FingerprintInternal mFingerprintInternal = null; private ExHandler mHandler; private Object mLock = new Object(); private WindowManagerPolicy mPolicy; private PowerManagerInternal mPowerManagerInternal; private final BiometricsManagerInternal mService = new BiometricsManagerInternal() { public void gotoSleepWhenScreenOnBlocked(String srcBiometrics, String reason) { BiometricsService.this.mPowerManagerInternal.gotoSleepWhenScreenOnBlocked(reason); } public void blockScreenOn(String srcBiometrics, String wakeUpReason) { BiometricsService.this.mPowerManagerInternal.wakeUpAndBlockScreenOn(wakeUpReason); } public void unblockScreenOn(String srcBiometrics, String screenOnReason, long delay) { if (delay > 0) { Message msg = BiometricsService.this.mHandler.obtainMessage(1); msg.obj = screenOnReason; BiometricsService.this.mHandler.sendMessageDelayed(msg, delay); return; } BiometricsService.this.mPowerManagerInternal.unblockScreenOn(screenOnReason); } public boolean isFaceAutoUnlockEnabled() { if (BiometricsService.this.mFaceInternal != null) { return BiometricsService.this.mFaceInternal.isFaceAutoUnlockEnabled(); } return false; } public void setKeyguardTransparent(String srcBiometrics, String wakeUpReason) { if (BiometricsService.this.mPowerManagerInternal.isFingerprintWakeUpReason(wakeUpReason)) { Log.d(BiometricsService.TAG, "setKeyguardTransparent wakeUpReason = " + wakeUpReason); BiometricsService.this.mHandler.removeMessage(1); BiometricsService.this.mPolicy.onWakeUp(wakeUpReason); } else if (!BiometricsService.this.mPowerManagerInternal.isFaceWakeUpReason(wakeUpReason)) { if (BiometricsService.this.mService.isFaceAutoUnlockEnabled() && BiometricsService.KEEP_KEYGUARD_OPAQUE_WHILE_AUTO_UNLOCK.equals(wakeUpReason) && FaceService.TAG_NAME.equals(srcBiometrics)) { Log.d(BiometricsService.TAG, "setKeyguardTransparent wakeUpReason = " + wakeUpReason); BiometricsService.this.mPolicy.onWakeUp(wakeUpReason); } if (!"android.policy.wakeup.slient".equals(wakeUpReason) && FingerprintService.TAG.equals(srcBiometrics)) { Log.d(BiometricsService.TAG, "setKeyguardTransparent wakeUpReason = " + wakeUpReason); BiometricsService.this.mPolicy.onWakeUp(BiometricsService.SET_KEYGUARD_OPAQUE_WHILE_WAKE_UP_REASON_NOT_BIOMETRICS); } } else if (BiometricsService.this.mService.isFaceAutoUnlockEnabled()) { if (FaceService.TAG_NAME.equals(srcBiometrics)) { Log.d(BiometricsService.TAG, "setKeyguardTransparent wakeUpReason = " + wakeUpReason); BiometricsService.this.mHandler.removeMessage(1); BiometricsService.this.mPolicy.onWakeUp(wakeUpReason); } } else if (FingerprintService.TAG.equals(srcBiometrics)) { Log.d(BiometricsService.TAG, "setKeyguardTransparent wakeUpReason = " + wakeUpReason); BiometricsService.this.mPolicy.onWakeUp(wakeUpReason); } } public void setKeyguardOpaque(String srcBiometrics, String reason) { Log.d(BiometricsService.TAG, "setKeyguardOpaque reason = " + reason); BiometricsService.this.mPolicy.onWakeUp(reason); } public void cancelFaceAuthenticateWhileScreenOff(String srcBiometrics, String reason) { Log.d(BiometricsService.TAG, "cancelFaceAuthenticateWhileScreenOff reason = " + reason); BiometricsService.this.mPolicy.onWakeUp(reason); } public void notifyPowerKeyPressed() { if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.notifyPowerKeyPressed(); } } public void onAnimateScreenBrightness(int brightness) { if (brightness != 0) { onWakeUpFinish(); } BiometricsService.this.mBrightness = brightness; } public void onWakeUp(String wakeupReason) { Log.d(BiometricsService.TAG, "onWakeUp wakeupReason = " + wakeupReason); BiometricsService.this.mBrightness = 0; if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.onWakeUp(wakeupReason); } if (BiometricsService.this.mService.isFaceAutoUnlockEnabled() && BiometricsService.this.mPowerManagerInternal.isFaceWakeUpReason(wakeupReason)) { BiometricsService.this.mFaceInternal.onWakeUp(wakeupReason); } } public void onGoToSleep() { Log.d(BiometricsService.TAG, "onGoToSleep"); if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.onGoToSleep(); } if (BiometricsService.this.mFaceInternal != null) { BiometricsService.this.mFaceInternal.onGoToSleep(); } } public void onWakeUpFinish() { if (BiometricsService.this.mBrightness != 0) { Log.e(BiometricsService.TAG, "return mBrightness != 0"); return; } Log.d(BiometricsService.TAG, "onWakeUpFinish"); BiometricsService.this.mBrightness = 1; if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.onWakeUpFinish(); } if (BiometricsService.this.mFaceInternal != null) { BiometricsService.this.mFaceInternal.onWakeUpFinish(); } } public void onGoToSleepFinish() { Log.d(BiometricsService.TAG, "onGoToSleepFinish"); BiometricsService.this.mBrightness = 0; if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.onGoToSleepFinish(); } if (BiometricsService.this.mFaceInternal != null) { BiometricsService.this.mFaceInternal.onGoToSleepFinish(); } } public void onScreenOnUnBlockedByOther(String unBlockedReason) { Log.d(BiometricsService.TAG, "onScreenOnUnBlockedByOther, unBlockedReason = " + unBlockedReason); if (BiometricsService.this.mFingerprintInternal != null) { BiometricsService.this.mFingerprintInternal.onScreenOnUnBlockedByOther(unBlockedReason); } if (BiometricsService.this.mService.isFaceAutoUnlockEnabled() && BiometricsService.this.mPowerManagerInternal.isFaceWakeUpReason(unBlockedReason)) { BiometricsService.this.mFaceInternal.onScreenOnUnBlockedByOther(unBlockedReason); } } }; private final ServiceThread mServiceThread; private boolean mSupportFace = false; private boolean mSupportFingerprint = false; private boolean mSystemReady = false; private void initHandler() { this.mHandler = new ExHandler(this.mServiceThread.getLooper()) { public void handleMessage(Message msg) { switch (msg.what) { case 1: Log.d(BiometricsService.TAG, "trun screen on by fail result"); BiometricsService.this.mPowerManagerInternal.unblockScreenOn((String) msg.obj); return; default: Log.w(BiometricsService.TAG, "Unknown message:" + msg.what); return; } } }; } public BiometricsService(Context context) { super(context); Log.d(TAG, TAG_NAME); this.mContext = context; Watchdog.getInstance().addMonitor(this); this.mServiceThread = new ServiceThread(TAG, -2, true); this.mServiceThread.start(); initHandler(); this.mPolicy = (WindowManagerPolicy) LocalServices.getService(WindowManagerPolicy.class); this.mPowerManagerInternal = (PowerManagerInternal) getLocalService(PowerManagerInternal.class); this.mSupportFace = context.getPackageManager().hasSystemFeature("oppo.hardware.face.support"); this.mSupportFingerprint = context.getPackageManager().hasSystemFeature("android.hardware.fingerprint"); } public void onStart() { Log.d(TAG, "onStart"); publishLocalService(BiometricsManagerInternal.class, this.mService); } public void binderDied() { Log.d(TAG, "binderDied"); } public void monitor() { } public void systemReady() { Log.d(TAG, "systemReady"); this.mSystemReady = true; if (this.mSupportFace) { this.mFaceInternal = (FaceInternal) LocalServices.getService(FaceInternal.class); } if (this.mSupportFingerprint) { this.mFingerprintInternal = (FingerprintInternal) LocalServices.getService(FingerprintInternal.class); } } }
560307c78765cf9e159821e5b62cb706fe376111
ddce1fbc658e4bf9d124dc4acfc3914817a580a5
/sources/com/google/android/gms/common/util/zzq.java
8bdf66757e62b6489ae06119a8b249f0868e1bf0
[]
no_license
ShahedSabab/eExpense
1011f833a614c64cbb52a203821e38f18fce8a4f
b85c7ad6ee5ce6ae433a6220df182e14c0ea2d6d
refs/heads/master
2020-12-21T07:39:45.956655
2020-07-13T21:52:04
2020-07-13T21:52:04
235,963,863
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package com.google.android.gms.common.util; import java.util.HashMap; public class zzq { public static void zza(StringBuilder sb, HashMap<String, String> hashMap) { boolean z; sb.append("{"); boolean z2 = true; for (String str : hashMap.keySet()) { if (!z2) { sb.append(","); z = z2; } else { z = false; } String str2 = (String) hashMap.get(str); sb.append("\"").append(str).append("\":"); if (str2 == null) { sb.append("null"); } else { sb.append("\"").append(str2).append("\""); } z2 = z; } sb.append("}"); } }
e17460bfaa3db2b9ce21386b2e78a09bef8fec23
8201ffbf4024b37c227f67ed1dee9b6d7d17f958
/TEST.java
9b3bab83ae00162d461d1bf093e0df18896fb208
[]
no_license
netnicenung/TEST
216cde6f4844efaaff406db31167e037de774ba2
49d6e7d632bc5fe274f0db491267fa978661278f
refs/heads/main
2023-06-18T20:04:21.105500
2021-07-12T15:16:33
2021-07-12T15:16:33
385,291,031
0
0
null
null
null
null
UTF-8
Java
false
false
886
java
import java.util.Scanner; public class TEST { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print(" Input total score : "); int Score = scan.nextInt(); String Grade; if(Score >= 80){ Grade = "A"; } else if(Score >= 75){ Grade = "B+"; } else if(Score >= 70){ Grade = "B"; } else if(Score >= 65){ Grade = "C+"; } else if(Score >= 60){ Grade = "C"; } else if(Score >= 55){ Grade = "D+"; } else if(Score >= 50){ Grade = "D"; } else{ Grade = "F"; } System.out.println(" The Grade is " + Grade); scan.close(); } }
c3a66b45d11b1f395aaaed9d6b4b3dc0f7fde3ce
6afe8f14f8a4a83c5a569489e66201e6d1694bb4
/spring/integration-lab/src/main/java/io/ashimjk/spring/integration/config/AmqpHandlerConfig.java
77278e22e8004df9ce08fe459ea89ecaf79660ac
[ "MIT" ]
permissive
ashimjk/ajk-research
64e70a47e04fb7574a3aa865411a518655953345
a4061a6451229e0a49dac8818e51370c9bda53e4
refs/heads/master
2023-01-13T00:50:41.310847
2020-05-02T18:10:08
2020-05-02T18:10:08
183,064,897
2
0
MIT
2023-01-07T22:10:27
2019-04-23T17:34:13
Java
UTF-8
Java
false
false
2,744
java
package io.ashimjk.spring.integration.config; import io.ashimjk.spring.integration.domain.Beneficiary; import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.MessageProperties; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.support.converter.ClassMapper; import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.integration.amqp.dsl.Amqp; import org.springframework.integration.annotation.IntegrationComponentScan; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; import org.springframework.integration.dsl.IntegrationFlows; @Configuration @EnableIntegration @IntegrationComponentScan public class AmqpHandlerConfig { @Bean public IntegrationFlow amqpOutputIntegrationFlow(AmqpTemplate amqpTemplate) { return IntegrationFlows.from("amqpOutputChannel") .handle(Amqp.outboundAdapter(amqpTemplate) .exchangeName("fileExchange") .routingKey("fileQueue") ) .get(); } @Bean public IntegrationFlow amqpIntegrationFlow(ConnectionFactory connectionFactory) { return IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, "fileQueue")) .handle(String.class, (s, headers) -> { System.out.println("### Inside Amqp Inbound ###"); System.out.println(s); return null; }) .get(); } @Bean public AmqpTemplate amqpTemplate(ConnectionFactory connectionFactory) { RabbitTemplate amqpTemplate = new RabbitTemplate(connectionFactory); amqpTemplate.setMessageConverter(jackson2JsonMessageConverter()); return amqpTemplate; } private Jackson2JsonMessageConverter jackson2JsonMessageConverter() { Jackson2JsonMessageConverter jackson2JsonMessageConverter = new Jackson2JsonMessageConverter(); jackson2JsonMessageConverter.setClassMapper(getClassMapper()); return jackson2JsonMessageConverter; } private ClassMapper getClassMapper() { return new ClassMapper() { @Override public void fromClass(Class<?> clazz, MessageProperties properties) { } @Override public Class<?> toClass(MessageProperties properties) { return Beneficiary.class; } }; } }
764a65c524479775b86ee3b8b08e93cdf3c244cf
5c23d6703e3dbfae406315a8fe9dee997e6ec8b6
/jhs-loan-entity/src/main/java/com/jhh/jhs/loan/entity/manager/AuditsUser.java
4a5b5f44bb36e26df8178e7f63c8c2cbf9529be2
[]
no_license
soldiers1989/loan-uhs
1dc4e766fce56ca21bc34e5a5b060eaf7116a8b0
77b06a67651898c4f1734e6c323becd0df639c22
refs/heads/master
2020-03-28T09:27:29.670311
2018-06-12T07:53:52
2018-06-12T07:53:52
148,038,503
0
1
null
null
null
null
UTF-8
Java
false
false
2,805
java
package com.jhh.jhs.loan.entity.manager; import com.jhh.jhs.loan.entity.enums.BaiKeLuStatusEnum; import com.jhh.jhs.loan.entity.enums.BorrowStatusEnum; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang.StringUtils; import org.jeecgframework.poi.excel.annotation.Excel; /** * Created by wanzezhong on 2018/1/4. */ @Getter @Setter public class AuditsUser { private Integer id; private Integer perId; @Excel(name="合同编号") private String borrNum; @Excel(name="姓名") private String name; @Excel(name="身份证号") private String cardNum; @Excel(name="手机号码") private String phone; @Excel(name="产品类型") private String productName; @Excel(name="贷款金额") private String borrAmount; @Excel(name="银行名称") private String bankName; @Excel(name="银行卡号") private String bankCard; private String borrStatus; @Excel(name="合同状态") private String borrStatusValue; private String borrUpStatus; @Excel(name="上单状态") private String borrUpStatusValue; private String baikeluStatus; @Excel(name="自动电呼") private String baikeluStatusValue; @Excel(name="人工拒绝理由") private String reason;; @Excel(name="是否人工审核") private String isManualValue; private String isManual; @Excel(name="认证说明") private String description; @Excel(name="审核人") private String emplloyeeName; @Excel(name="签约时间") private String makeborrDate; public void setBorrStatus(String borrStatus) { this.borrStatus = borrStatus; String desc = BorrowStatusEnum.getDescByCode(borrStatus); if(StringUtils.isNotBlank(desc)){ this.borrStatusValue = desc; }else{ this.borrStatusValue = borrStatus; } } public void setBorrUpStatus(String borrUpStatus) { this.borrUpStatus = borrUpStatus; String desc = BorrowStatusEnum.getDescByCode(borrUpStatus); if(StringUtils.isNotBlank(desc)){ this.borrUpStatusValue = desc; }else{ this.borrUpStatusValue = borrUpStatus; } } public void setBaikeluStatus(String baikeluStatus) { this.baikeluStatus = baikeluStatus; String desc = BaiKeLuStatusEnum.getDescByCode(baikeluStatus); if(StringUtils.isNotBlank(desc)){ this.baikeluStatusValue = desc; }else{ this.baikeluStatusValue = baikeluStatus; } } public void setIsManual(String isManual) { this.isManual = isManual; if ( "4".equals(isManual)) { this.isManualValue = "否"; }else { this.isManualValue = "是"; } } }
99a9969220a9168031fc72e2ecc82c27cc33b10d
fc88311f333be81ddf649223fc472134594c6438
/MiniFacebook-Service/src/main/java/com/renu/about/models/HighSchool.java
34cd7b0f5f0bb2e62f93f2208852cd2f738e6f9c
[]
no_license
aslamhossain43/MiniFacebook-Microservices
a81c8a6c1919ddc2f39fa174280c189995fcf1f4
a631f1aa1fe14a330a9018d6451a63e31b400293
refs/heads/master
2021-10-21T03:00:32.474593
2019-03-03T07:42:14
2019-03-03T07:42:14
166,392,820
1
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.renu.about.models; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class HighSchool extends TimeEntity<Long> { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; private String uid; private String highSchool; public HighSchool() {} @Override public Long getId() { // TODO Auto-generated method stub return id; } public String getHighSchool() { return highSchool; } public void setHighSchool(String highSchool) { this.highSchool = highSchool; } public void setId(Long id) { this.id = id; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } }
7e993e8c1cf4bc2bffae4c5cfc8603344ab19f2b
2464ee952a94f60afff2668c61e977db2085fcaf
/src/Controller/Command/AbstractCommand.java
7e17cc72b65f56f248bdc92c0170a081e45e3014
[]
no_license
marhuijb/HendrikMarco
6d23e57f4a7c05fea0ecc8b8b0238862dc18ba3b
b475a47b3095c70cea8b30c20b3d3144466d3189
refs/heads/master
2021-05-15T11:41:48.559566
2017-11-19T14:51:57
2017-11-19T14:51:57
108,266,153
0
0
null
null
null
null
UTF-8
Java
false
false
545
java
package Controller.Command; import Controller.Interface.*; /** * Abstract class for a command */ public abstract class AbstractCommand{ protected IPresentationController presentationController; protected IApplicationController applicationController; protected AbstractCommand(IPresentationController presentatieController, IApplicationController applicationController) { this.presentationController = presentatieController; this.applicationController = applicationController; } public abstract void execute(); }
d5e4413bc904b6ba4c8ab2e03d3c9eb01fde3086
570d5c86cb9522718ca2e4c2e1fa337ff393afde
/src/main/java/com/jm/students/service/util/GeocodingService.java
39d31cccae6e4688fde654f0b4e6a9aded4362eb
[]
no_license
ZloyGremlinJE/students_service_center_crm
daba61718bc59de40749b3141ec6708c074e02aa
6693dec617ae5f01132674075409b2ebab789d3f
refs/heads/master
2023-04-11T20:21:59.049675
2021-04-27T06:11:39
2021-04-27T06:11:39
353,449,042
0
0
null
2021-04-27T06:11:40
2021-03-31T18:12:16
Java
UTF-8
Java
false
false
197
java
package com.jm.students.service.util; import com.jm.students.model.Location; import java.util.Optional; public interface GeocodingService { Optional<Location> getLocation(String address); }
442ab8195ec5430c07e8fa692249ce6da3bfaf8f
0c59ec1c3363768e9f8004ce685296fcd9dc1ed8
/Java6MusatBogdanWEB/DisplayBooks/DisplayBooks.java
dfbc56ebb7b265ddfe2d675efb49298bba6e0afe
[]
no_license
Bogdanmusat79/Java6MusatBogdanWEB
c7f5053e385be9c19f176373cf27bbf2b65abc9e
9563867f534171d49d3e468baa047de777089e9a
refs/heads/master
2021-05-09T01:41:48.820160
2018-01-27T17:10:57
2018-01-27T17:10:57
119,184,277
0
0
null
null
null
null
UTF-8
Java
false
false
3,017
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. */ import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Bogdan */ public class DisplayBooks extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet DisplayBooks</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet DisplayBooks at " + request.getContextPath() + "</h1>"); out.println("<h2>My code</h2>"); out.println("</body>"); out.println("</html>"); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "Bogdan@DESKTOP-TTHDTK5" ]
Bogdan@DESKTOP-TTHDTK5
cdbc3cdbf875235a6f5f191d95f6467b84c32977
1abc80cd81754b2c6f7473c22203249eb74cded5
/app/src/main/java/com/example/software_cliente/Adapters/StudentAdapter.java
700d271f210ba4c7a2004e9d996c50f85fdc6c24
[]
no_license
uagrm-sw1/adai-client
667b826781f470089210ae93627c5e4851ba8adb
ed356cd153d404a7ea5da4af49a5fa8edded409d
refs/heads/master
2022-12-29T01:58:19.666623
2020-10-13T20:12:11
2020-10-13T20:12:11
282,554,013
0
0
null
null
null
null
UTF-8
Java
false
false
7,474
java
package com.example.software_cliente.Adapters; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.example.software_cliente.AreaListActivity; import com.example.software_cliente.Interface.RetrofitServices; import com.example.software_cliente.Response.Student; import com.example.software_cliente.EditStudentActivity; import com.example.software_cliente.R; import com.example.software_cliente.StudentListActivity; import com.example.software_cliente.TestActivity; import java.util.Calendar; import java.util.List; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import static android.content.Context.MODE_PRIVATE; public class StudentAdapter extends RecyclerView.Adapter<StudentAdapter.MyViewHolder> { final String baseUrl = "http://ec2-3-21-164-122.us-east-2.compute.amazonaws.com/api/"; RetrofitServices services; private String token = ""; private SharedPreferences preferences; Context context; List<Student> students; public StudentAdapter(Context context, List<Student> students) { this.context = context; this.students = students; preferences = context.getSharedPreferences("Session", MODE_PRIVATE); token = preferences.getString("token", null); } @NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(context); View view = inflater.inflate(R.layout.student_list_item, parent, false); return new MyViewHolder(view); } @Override public void onBindViewHolder(@NonNull MyViewHolder holder, int position) { holder.name_text_view.setText(students.get(position).getName() + " " + students.get(position).getLastName()); holder.student = students.get(position); Calendar calendar = Calendar.getInstance(); Student student = students.get(position); holder.age_text_view.setText((calendar.get(Calendar.YEAR) - student.getYear()) + " años"); } @Override public int getItemCount() { return students.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { TextView name_text_view; TextView age_text_view; Button edit_button; Button delete_button; Student student; public MyViewHolder(@NonNull View itemView) { super(itemView); name_text_view = itemView.findViewById(R.id.name_text_view); age_text_view = itemView.findViewById(R.id.age_text_view); edit_button = itemView.findViewById(R.id.edit_button); delete_button = itemView.findViewById(R.id.delete_button); name_text_view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!student.isInitialExam()) { Intent intent = new Intent(context, TestActivity.class); intent.putExtra("type", "initial"); intent.putExtra("idStudent", student.getId()); intent.putExtra("name", student.getName()); intent.putExtra("lastName", student.getLastName()); intent.putExtra("birthday", student.getBirthday()); intent.putExtra("gender", student.getGender()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); context.startActivity(intent); } else { Calendar calendar = Calendar.getInstance(); int age = calendar.get(Calendar.YEAR) - student.getYear(); int idCourse = 0; if (age == 4 || age == 5) idCourse = 1; if (age == 6) idCourse = 2; if (age == 7) idCourse = 3; if (age == 8) idCourse = 4; if (age == 9) idCourse = 5; if (age == 10) idCourse = 6; Intent intent = new Intent(context, AreaListActivity.class); intent.putExtra("idStudent", student.getId()); intent.putExtra("idCourse", idCourse); context.startActivity(intent); } } }); edit_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(context, EditStudentActivity.class); intent.putExtra("idStudent", student.getId()); intent.putExtra("name", student.getName()); intent.putExtra("lastName", student.getLastName()); intent.putExtra("birthday", student.getBirthday()); intent.putExtra("gender", student.getGender()); context.startActivity(intent); } }); delete_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(GsonConverterFactory.create()).build(); services = retrofit.create(RetrofitServices.class); Call<Student> call = services.deleteStudent("token " + token, student.getId()); call.enqueue(new Callback<Student>() { @Override public void onResponse(Call<Student> call, Response<Student> response) { if (response.isSuccessful()) { Intent intent = new Intent(context, StudentListActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); context.startActivity(intent); } else { Toast.makeText(context, "Delete student failed. Try again please", Toast.LENGTH_LONG).show(); } } @Override public void onFailure(Call<Student> call, Throwable t) { Log.i(StudentListActivity.class.getSimpleName(), "Error: " + t.getMessage()); } }); } }); } } }
f1546ebcc310dc584c7b8835df9f68da4716bd0f
75b9dd5a5735f2fbf843743df511854e80dfe976
/src-tests/org/softlang/model/Company_JML_Test.java
6f88de88a90fdff074990199ffda81b02999808a
[]
no_license
rbonifacio/101JMLSpecifications
b4ce3cd09966eb1ac1d73b5d1e0725ccdc1287ef
fb2f1f38eab0bf768cd9f2c89ba9d549073b64c5
refs/heads/master
2020-03-26T10:23:05.899093
2012-08-22T12:09:36
2012-08-22T12:09:36
5,473,697
1
0
null
null
null
null
UTF-8
Java
false
false
13,743
java
/* * Test Oracle Class for org.softlang.model.Company * For Use With JML4 RAC * * Generated by JMLUnitNG 1.3 (103), 2012-08-21 11:42 -0300. * (do not modify this comment, it is used by JMLUnitNG clean-up routines) */ package org.softlang.model; import java.io.PrintWriter; import java.util.ArrayList; import org.jmlspecs.jmlunitng.iterator.IteratorWrapper; import org.jmlspecs.jmlunitng.iterator.ParameterArrayIterator; import org.jmlspecs.jmlunitng.testng.BasicTestListener; import org.jmlspecs.jmlunitng.testng.PreconditionSkipException; import org.testng.Assert; import org.testng.TestException; import org.testng.TestNG; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.testng.xml.XmlSuite; import org.jmlspecs.jml4.rac.runtime.JMLAssertionError; import org.jmlspecs.jml4.rac.runtime.JMLChecker; import org.jmlspecs.jml4.rac.runtime.JMLEntryPreconditionError; import org.jmlspecs.jml4.rac.runtime.JMLEvaluationError; import org.softlang.model.Company_JML_Data.*; /** * Test oracles generated by JMLUnitNG for JML4 RAC of class * org.softlang.model.Company. * * @author JMLUnitNG 1.3 (103) * @version 2012-08-21 11:42 -0300 */ public class Company_JML_Test { /** * The main method. Allows the tests to be run without a testng.xml or * the use of the TestNG executable/plugin. * * @param the_args Command line arguments, ignored. */ public static void main(String[] the_args) { final TestNG testng_runner = new TestNG(); final Class<?>[] classes = {Company_JML_Test.class}; final BasicTestListener listener = new BasicTestListener(new PrintWriter(System.out)); testng_runner.setUseDefaultListeners(false); testng_runner.setXmlSuites(new ArrayList<XmlSuite>()); testng_runner.setTestClasses(classes); testng_runner.addListener(listener); testng_runner.run(); } /** * A test to ensure that RAC is enabled before running other tests. */ @Test public void test_racEnabled() { Assert.assertTrue (JMLChecker.isRACCompiled(org.softlang.model.Company.class), "JMLUnitNG tests can only run on RAC-compiled code."); } /** * A test for a constructor. * * @param pname The String to be passed. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_Company__String_pname__10") public void test_Company__String_pname__10 (final java.lang.String pname) { try { new org.softlang.model.Company(pname); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method getName. * * @param the_test_object The Company to call the test method on. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_instance_only") public void test_getName__0 (final org.softlang.model.Company the_test_object ) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.getName(); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method addDepartment. * * @param the_test_object The Company to call the test method on. * @param department The Department to be passed. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_addDepartment__Department_department__19") public void test_addDepartment__Department_department__19 (final org.softlang.model.Company the_test_object, final org.softlang.model.Department department) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.addDepartment(department); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method total. * * @param the_test_object The Company to call the test method on. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_instance_only") public void test_total__0 (final org.softlang.model.Company the_test_object ) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.total(); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method getDepts. * * @param the_test_object The Company to call the test method on. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_instance_only") public void test_getDepts__0 (final org.softlang.model.Company the_test_object ) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.getDepts(); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method setName. * * @param the_test_object The Company to call the test method on. * @param pname The String to be passed. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_setName__String_pname__10") public void test_setName__String_pname__10 (final org.softlang.model.Company the_test_object, final java.lang.String pname) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.setName(pname); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for method cut. * * @param the_test_object The Company to call the test method on. */ @Test(dependsOnMethods = { "test_racEnabled" }, dataProvider = "p_instance_only") public void test_cut__0 (final org.softlang.model.Company the_test_object ) { if (the_test_object == null) { throw new PreconditionSkipException ("could not construct an object to test"); } try { the_test_object.cut(); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * A test for a constructor. * */ @Test(dependsOnMethods = { "test_racEnabled" }) public void test_Company__0 () { try { new org.softlang.model.Company(); } catch (final JMLEntryPreconditionError $e) { // meaningless test throw new PreconditionSkipException($e.getMessage()); } catch (final JMLEvaluationError $e) { if ($e.getCause() instanceof JMLEntryPreconditionError) { // meaningless test throw new PreconditionSkipException($e.getCause().getMessage()); } else { // failed test throw new TestException($e.getCause().getMessage()); } } catch (final JMLAssertionError $e) { // test failure throw new TestException($e.getMessage()); } catch (final Throwable $e) { // test failure for some reason other than assertion violation throw new TestException($e.getMessage()); } } /** * Data provider for constructor Company(String). * @return An iterator over strategies to use for parameter generation. */ @SuppressWarnings({"unchecked"}) @DataProvider(name = "p_Company__String_pname__10", parallel = false) public static IteratorWrapper<Object[]> p_Company__String_pname__10() { return new IteratorWrapper<Object[]> (new ParameterArrayIterator (Company__String_pname__10__pname.class)); } /** * Data provider for method void addDepartment(Department). * @return An iterator over strategies to use for parameter generation. */ @SuppressWarnings({"unchecked"}) @DataProvider(name = "p_addDepartment__Department_department__19", parallel = false) public static IteratorWrapper<Object[]> p_addDepartment__Department_department__19() { return new IteratorWrapper<Object[]> (new ParameterArrayIterator (Company_InstanceStrategy.class, addDepartment__Department_department__19__department.class)); } /** * Data provider for method void setName(String). * @return An iterator over strategies to use for parameter generation. */ @SuppressWarnings({"unchecked"}) @DataProvider(name = "p_setName__String_pname__10", parallel = false) public static IteratorWrapper<Object[]> p_setName__String_pname__10() { return new IteratorWrapper<Object[]> (new ParameterArrayIterator (Company_InstanceStrategy.class, setName__String_pname__10__pname.class)); } /** * Data provider for methods with no parameters. * @return An iterator over the main class strategy. */ @SuppressWarnings({"unchecked"}) @DataProvider(name = "p_instance_only", parallel = false) public static IteratorWrapper<Object[]> p_instance_only() { return new IteratorWrapper<Object[]> (new ParameterArrayIterator(Company_InstanceStrategy.class)); } }
d5acf00f214cfec4d016c8c8ed8914bd1d846297
b83041942d92ead939b8f56318a13e3d82f20e48
/src/com/wenyu/kjw/adapter/HomeYing.java
9f5cb8d5b7bdde00e0293ece84e324be1774bdbc
[ "Apache-2.0" ]
permissive
xingfeng2010/kai-ji-wang
cda7f9f032d09204cfe6d0deb9148154029999f4
c4d5156551c0cb42fe313e7dd82b6ac57607d1d6
refs/heads/master
2021-01-10T01:19:38.470989
2015-10-17T19:12:21
2015-10-17T19:12:21
44,230,645
1
0
null
null
null
null
GB18030
Java
false
false
2,916
java
package com.wenyu.kjw.adapter; import java.util.List; import android.content.Context; import android.graphics.Color; import android.graphics.PorterDuff; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import com.example.mywork.util.AsyncImageLoader; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.wenyu.Data.Find_yingshi; import com.wenyu.kaijiw.R; public class HomeYing extends BaseAdapter{ private List<Find_yingshi> strs; private Context context; private AsyncImageLoader mAsyncImageLoader; public HomeYing(List<Find_yingshi> strs, Context context) { super(); this.strs = strs; this.context = context; } public void setData(List<Find_yingshi> strs){ this.strs = strs; } @Override public int getCount() { if(strs.size()<=0){ return 0; } return strs.size(); } @Override public Object getItem(int arg0) { if(strs.size()<=0){ return null; } return strs.get(arg0); } @Override public long getItemId(int position) { return position; } /* * (non-Javadoc) *getView方法的数据需要更改。 * */ @Override public View getView(int position, View convertView, final ViewGroup parent) { ViewHolder vh; if(convertView ==null){ vh = new ViewHolder(); convertView = LayoutInflater.from(context).inflate(R.layout.drop_dowm_box , null); vh.ps = (TextView) convertView.findViewById(R.id.ps); vh.text = (TextView) convertView.findViewById(R.id.textView1); vh.image = (ImageView) convertView.findViewById(R.id.imageView); vh.image.setColorFilter(Color.GRAY,PorterDuff.Mode.MULTIPLY); convertView.setTag(vh); }else{ vh = (ViewHolder) convertView.getTag(); } Find_yingshi str =strs.get(position); vh.text.setText(str.getName()); vh.text.setTextSize(20); vh.ps.setText(" "+str.getCountV()+"次浏览"+" "); final String imageUrl = str.getPicture(); //给ImageView设置标记(图片的url),以防止图片加载混乱 vh.image.setTag(imageUrl); ImageLoader imageloader = ImageLoader.getInstance(); imageloader.init(ImageLoaderConfiguration.createDefault(context)); DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() //加载开始默认的图片 .showStubImage(R.drawable.z1) //url为空时显示该图片 .showImageForEmptyUri(R.drawable.z2) .cacheInMemory(true) .cacheOnDisc(true) // .cacheOnDisc(false) //加载图片出现问题显示图片 .showImageOnFail(R.drawable.z3) .build(); imageloader.displayImage(imageUrl, vh.image,defaultOptions); return convertView; } class ViewHolder{ TextView ps,text; ImageView image; } }
5791423ebcbacf0d7700bda73d6e7eb2a9152091
c92985215f97fa0d194c26450c07d11ac15cc94b
/src/bordspel/library/element/event/KeyEvent.java
4cd51ff9bb1b70d2a84bebcea2ff263bdd52b9b5
[]
no_license
bordspel/ui-lib
1646c557b8e670875a470762aca274f01e55ef22
32dbfb214d5616509dccfc8933684c26d2d1a4b7
refs/heads/main
2023-01-28T11:30:03.524139
2020-12-07T09:44:25
2020-12-07T09:44:25
317,479,311
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package bordspel.library.element.event; import org.python.core.Py; import org.python.core.PyString; public class KeyEvent { public String type; public PyString key; public int keyCode; public KeyEvent(String type, String key, int keyCode) { this.type = type; this.key = Py.newStringOrUnicode(key); this.keyCode = keyCode; } public String getType() { return this.type; } public PyString getKey() { return this.key; } public int getKeyCode() { return this.keyCode; } }
7cac226015f9ee2aa88bf0f48b05a710d8d23595
2d98738948c87acce33ac79aca2bd48332d2ee64
/src/com/java/session/example/day2/SessionEnum.java
e9059fdbf5f8d4e0cfb27696837d59813117d3d1
[]
no_license
abhishekhbd/java-session
e4db2a4c23966d265b65bd81ef98c6161cdd8c69
8da236aabdacc42515e8d334680f18a89b84f78a
refs/heads/master
2021-08-15T22:40:26.199014
2017-11-18T13:18:50
2017-11-18T13:18:50
111,206,693
0
0
null
null
null
null
UTF-8
Java
false
false
296
java
package com.java.session.example.day2; public enum SessionEnum { USER_SESSION_1("ADMIN"), USER_SESSION_2("GUEST"); private String sessionName; private SessionEnum(String sessionName) { this.sessionName = sessionName; } public String getSessionName() { return sessionName; } }
bee158e33dda991e209713107920e977bb3af65e
51ca49bb5cfc5220d8af834756d3962450205067
/test/org/waveprotocol/wave/model/operation/testing/reference/InsertionPreservationTransformer.java
fa9f60ce816a70e41b32e469312f997da4d3cc92
[ "Apache-2.0" ]
permissive
vega113/WaveInCloud
c08f2e33503511e9754888ad63b2a674f348300b
7a240021b931b240c33dca0b8443152fb82e0487
refs/heads/master
2021-01-01T17:47:13.719444
2011-11-15T18:00:21
2011-11-15T18:00:21
1,935,818
2
1
null
null
null
null
UTF-8
Java
false
false
11,580
java
/** * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.waveprotocol.wave.model.operation.testing.reference; import org.waveprotocol.wave.model.document.operation.AnnotationBoundaryMap; import org.waveprotocol.wave.model.document.operation.Attributes; import org.waveprotocol.wave.model.document.operation.AttributesUpdate; import org.waveprotocol.wave.model.document.operation.DocOp; import org.waveprotocol.wave.model.document.operation.EvaluatingDocOpCursor; import org.waveprotocol.wave.model.document.operation.algorithm.OperationNormalizer; import org.waveprotocol.wave.model.document.operation.algorithm.RangeNormalizer; import org.waveprotocol.wave.model.document.operation.impl.DocOpBuffer; import org.waveprotocol.wave.model.operation.OperationPair; import org.waveprotocol.wave.model.operation.TransformException; import org.waveprotocol.wave.model.operation.testing.reference.PositionTracker.RelativePosition; /** * A utility class for transforming an insertion operation with a * structure-preserving operation. * * @author Alexandre Mah */ final class InsertionPreservationTransformer { /** * A cache for the effect of a component of a document mutation that affects a * range of the document. */ private static abstract class RangeCache { abstract void resolve(int retain); } /** * A target of a document mutation which can be used to transform document * mutations by making use primarily of information from one mutation with the * help of auxiliary information from a second mutation. These targets should * be used in pairs. */ private static abstract class Target implements EvaluatingDocOpCursor<DocOp> { /** * The target to which to write the transformed mutation. */ final EvaluatingDocOpCursor<DocOp> targetDocument; /** * The position of the processing cursor associated with this target * relative to the position of the processing cursor associated to the * opposing target. All positional calculations are based on cursor * positions in the original document on which the two original operations * apply. */ final RelativePosition relativePosition; Target(EvaluatingDocOpCursor<DocOp> targetDocument, RelativePosition relativePosition) { this.targetDocument = targetDocument; this.relativePosition = relativePosition; } @Override public DocOp finish() { return targetDocument.finish(); } } private static final class InsertionTarget extends Target { NoninsertionTarget otherTarget; InsertionTarget(EvaluatingDocOpCursor<DocOp> targetDocument, RelativePosition relativePosition) { super(targetDocument, relativePosition); } public void setOtherTarget(NoninsertionTarget otherTarget) { this.otherTarget = otherTarget; } @Override public void retain(int itemCount) { int oldPosition = relativePosition.get(); relativePosition.increase(itemCount); if (relativePosition.get() < 0) { otherTarget.rangeCache.resolve(itemCount); } else if (oldPosition < 0) { otherTarget.rangeCache.resolve(-oldPosition); } } @Override public void characters(String chars) { targetDocument.characters(chars); otherTarget.targetDocument.retain(chars.length()); } @Override public void elementStart(String tag, Attributes attrs) { targetDocument.elementStart(tag, attrs); otherTarget.targetDocument.retain(1); } @Override public void elementEnd() { targetDocument.elementEnd(); otherTarget.targetDocument.retain(1); } @Override public void deleteCharacters(String chars) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void deleteElementStart(String tag, Attributes attrs) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void deleteElementEnd() { throw new UnsupportedOperationException("This method should never be called."); } @Override public void replaceAttributes(Attributes oldAttrs, Attributes newAttrs) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void updateAttributes(AttributesUpdate attrUpdate) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void annotationBoundary(AnnotationBoundaryMap map) { throw new UnsupportedOperationException("This method should never be called."); } } private static final class NoninsertionTarget extends Target { private final class ReplaceAttributesCache extends RangeCache { private final Attributes oldAttributes; private final Attributes newAttributes; ReplaceAttributesCache(Attributes oldAttributes, Attributes newAttributes) { this.oldAttributes = oldAttributes; this.newAttributes = newAttributes; } @Override void resolve(int itemCount) { targetDocument.replaceAttributes(oldAttributes, newAttributes); otherTarget.targetDocument.retain(1); } } private final class UpdateAttributesCache extends RangeCache { private final AttributesUpdate update; UpdateAttributesCache(AttributesUpdate update) { this.update = update; } @Override void resolve(int itemCount) { targetDocument.updateAttributes(update); otherTarget.targetDocument.retain(1); } } private final RangeCache retainCache = new RangeCache() { @Override void resolve(int itemCount) { targetDocument.retain(itemCount); otherTarget.targetDocument.retain(itemCount); } }; /** * A cache for the effect of mutation components which affect ranges. */ private RangeCache rangeCache = retainCache; private InsertionTarget otherTarget; NoninsertionTarget(EvaluatingDocOpCursor<DocOp> targetDocument, RelativePosition relativePosition) { super(targetDocument, relativePosition); } public void setOtherTarget(InsertionTarget otherTarget) { this.otherTarget = otherTarget; } @Override public void retain(int itemCount) { resolveRange(itemCount, retainCache); rangeCache = retainCache; } @Override public void characters(String chars) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void elementStart(String tag, Attributes attrs) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void elementEnd() { throw new UnsupportedOperationException("This method should never be called."); } @Override public void deleteCharacters(String chars) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void deleteElementStart(String tag, Attributes attrs) { throw new UnsupportedOperationException("This method should never be called."); } @Override public void deleteElementEnd() { throw new UnsupportedOperationException("This method should never be called."); } @Override public void replaceAttributes(Attributes oldAttrs, Attributes newAttrs) { RangeCache cache = new ReplaceAttributesCache(oldAttrs, newAttrs); if (resolveRange(1, cache) == 0) { rangeCache = cache; } } @Override public void updateAttributes(AttributesUpdate attrUpdate) { RangeCache cache = new UpdateAttributesCache(attrUpdate); if (resolveRange(1, cache) == 0) { rangeCache = new UpdateAttributesCache(attrUpdate); } } @Override public void annotationBoundary(AnnotationBoundaryMap map) { targetDocument.annotationBoundary(map); } /** * Resolves the transformation of a range. * * @param size the requested size to resolve * @param cache the cache to use * @return the portion of the requested size that was resolved, or -1 to * indicate that the entire range was resolved */ private int resolveRange(int size, RangeCache cache) { int oldPosition = relativePosition.get(); relativePosition.increase(size); if (relativePosition.get() > 0) { if (oldPosition < 0) { cache.resolve(-oldPosition); } return -oldPosition; } else { cache.resolve(size); return -1; } } } /** * Transforms an insertion operation with a structure-preserving operation. * * @param insertionOp the insertion operation * @param preservationOp the structure-preserving operation * @return the transformed pair of operations * @throws TransformException if a problem was encountered during the * transformation process */ OperationPair<DocOp> transformOperations(DocOp insertionOp, DocOp preservationOp) throws TransformException { PositionTracker positionTracker = new PositionTracker(); RelativePosition insertionPosition = positionTracker.getPosition1(); RelativePosition preservationPosition = positionTracker.getPosition2(); // The target responsible for processing components of the insertion operation. InsertionTarget insertionTarget = new InsertionTarget( new RangeNormalizer<DocOp>(new DocOpBuffer()), insertionPosition); // The target responsible for processing components of the preservation operation. NoninsertionTarget preservationTarget = new NoninsertionTarget( OperationNormalizer.createNormalizer(new DocOpBuffer()), preservationPosition); insertionTarget.setOtherTarget(preservationTarget); preservationTarget.setOtherTarget(insertionTarget); // Incrementally apply the two operations in a linearly-ordered interleaving // fashion. int insertionIndex = 0; int preservationIndex = 0; while (insertionIndex < insertionOp.size()) { insertionOp.applyComponent(insertionIndex++, insertionTarget); while (insertionPosition.get() > 0) { if (preservationIndex >= preservationOp.size()) { throw new TransformException("Ran out of " + preservationOp.size() + " noninsertion op components after " + insertionIndex + " of " + insertionOp.size() + " insertion op components, with " + insertionPosition.get() + " spare positions"); } preservationOp.applyComponent(preservationIndex++, preservationTarget); } } while (preservationIndex < preservationOp.size()) { preservationOp.applyComponent(preservationIndex++, preservationTarget); } insertionOp = insertionTarget.finish(); preservationOp = preservationTarget.finish(); return new OperationPair<DocOp>(insertionOp, preservationOp); } }
dcb5df57d1a9901924fac65328806bec480262b4
f0742b54db08bc68a27e0d4d531eb20b5b85b285
/000 AAAseleniumcucumbertask/src/test/java/Rough/rough1.java
f2ec245ed467d2dcd85b43c9efc5cf2eb5c76849
[]
no_license
ssathish1992/CucumberDemoRepo
c7fdbe12378cff7f4d00a049a0d213eeef23ff43
7055ee4bf53469cd21ae4cc541a11fcfc54adf3a
refs/heads/master
2023-06-21T16:26:01.592240
2021-07-26T03:37:42
2021-07-26T03:37:42
387,343,946
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
package Rough; public class rough1 { static int random; public static void main(String[] args) { String actual = "Dear Sample4 Test4,\r\n" + "\r\n" + "Your personal settings have been registered."; System.out.println(actual); String actual1 = "Hi Mr.Sathish,\r\n" + "This is for Testing.\r\n"+"\r\n"+"\r\n"+"Thanks&Regards,\r\n"+"Sathish"; System.out.println(actual1); //random System.out.println(random); // System.out.println(actual.length()); // String substring = actual.substring(23, 67); // System.out.println(substring); /* * String firstname = "Sample4"; String lastname = "Test4"; * * int length = firstname.length(); System.out.println(length); int length2 = * lastname.length(); System.out.println(length2); * * //int total = firstname.length() + lastname.length() + 6; * * //System.out.println(total); * * String substring = actual.substring(0, (firstname.length() + * lastname.length() + 6)); * * System.out.println(substring); */ } }
[ "08980D744@DESKTOP-0GLHP35" ]
08980D744@DESKTOP-0GLHP35
260b530269432bb5737bfb99e3a40958cd905743
b35a0e3befd8caab8a2036d56f802a202388023b
/SpringBoot/src/main/java/by/bsuir/myappspringboot/controller/UserPaynmentController.java
967f23388c18c3520c6e679ad723a1756940a2ad
[]
no_license
sanyancha/stp2017
2ba03201bddd0d6ab8bece4f884eb49ba15c590f
65c59f5e1c06529713fee1e5f869cbaa4498f010
refs/heads/master
2021-01-22T17:40:09.693270
2017-12-11T11:19:00
2017-12-11T11:19:00
102,399,172
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
package by.bsuir.myappspringboot.controller; import by.bsuir.myappspringboot.entity.Course; import by.bsuir.myappspringboot.entity.User; import by.bsuir.myappspringboot.entity.UserPaynment; import by.bsuir.myappspringboot.repository.UserPaynmentRepository; import by.bsuir.myappspringboot.service.UserPaynmentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.util.List; @Controller public class UserPaynmentController { @Autowired private UserPaynmentService userPaynmentService; }
d70be646a542bf8f68e2c1fa97f2f9dfe1b94006
c21d8651e8c3faa40c8b5e89dbed806c0a9ef3b1
/2_hbase_neo4j/hbase-client/src/HBaseClientDemo.java
33898934e3cc7f2f6b86ba22a2bf2acdaa11bf19
[]
no_license
vincenzopronesti/BigData
1a7e3f516f93b0752499b175c7c4954914c80878
be3425d3605d56623bae0593def6ad4e3d3624db
refs/heads/master
2022-12-21T23:44:14.632679
2020-09-23T07:09:29
2020-09-23T07:09:29
297,878,078
0
0
null
null
null
null
UTF-8
Java
false
false
14,743
java
import bus.HTableDescriptor; import com.google.protobuf.ServiceException; import hbase.client.HBaseClient; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.filter.CompareFilter; import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; import org.apache.hadoop.hbase.util.Bytes; import java.io.IOException; import java.util.Map; public class HBaseClientDemo { private static byte[] b(String s){ return Bytes.toBytes(s); } public static void tableManagementOperations(HBaseClient hbc) throws IOException, ServiceException { /* ********************************************************** * Table Management: Create, Alter, Describe, Delete * ********************************************************** */ // Create if (!hbc.exists("products")){ System.out.println("Creating table..."); hbc.createTable("products", "fam1", "fam2", "fam3"); } // List tables System.out.println("Listing table..."); System.out.println(hbc.listTables()); // Alter System.out.println("Altering tables..."); System.out.println(hbc.describeTable("products")); hbc.alterColumnFamily(HBaseClient.ALTER_COLUMN_FAMILY.DELETE, "products","fam3"); System.out.println(hbc.describeTable("products")); hbc.alterColumnFamily(HBaseClient.ALTER_COLUMN_FAMILY.ADD, "products","fam4"); System.out.println(hbc.describeTable("products")); // Scan table System.out.println("Scanning table..."); hbc.scanTable("products", null, null); // Drop table System.out.println("Deleting table..."); hbc.dropTable("products"); } public static void simpleDataManipulationOperations(HBaseClient hbc) throws IOException, ServiceException { /* ********************************************************** * Data Management: Put, Get, Delete, Scan, Truncate * ********************************************************** */ /* Create */ System.out.println("\n******************************************************** \n"); if (!hbc.exists("products")){ System.out.println("Creating table..."); hbc.createTable("products", "fam1", "fam2", "fam3"); } System.out.println("\n******************************************************** \n"); /* Put */ System.out.println("\n ------------------\n"); System.out.println("Adding value: row1:fam1:col1=val1"); hbc.put("products", "row1", "fam1", "col1", "val1"); System.out.println("Adding value: row1:fam1:col2=val2"); hbc.put("products", "row1", "fam1", "col2", "val2"); System.out.println("Adding value: row1:fam2:col2=val2"); hbc.put("products", "row1", "fam2", "col2", "val2"); System.out.println("Adding value: row1:fam2:col2=val3"); hbc.put("products", "row1", "fam2", "col2", "val3"); /* Get */ String v1 = hbc.get("products", "row1", "fam1", "col1"); String v2 = hbc.get("products", "row1", "fam1", "col2"); String v3 = hbc.get("products", "row1", "fam2", "col2"); System.out.println("Retrieving values : " + v1 + "; " + v2 + "; " + v3); System.out.println("\n ------------------\n"); /* Scan table */ System.out.println("Scanning table..."); hbc.scanTable("products", null, null); System.out.println("\n ------------------\n"); /* Update a row (the row key is unique) */ System.out.println("Updating value: row1:fam1:col1=val1 to row1:fam1:col1=val3"); hbc.put("products", "row1", "fam1", "col1", "val3"); v1 = hbc.get("products", "row1", "fam1", "col1"); v2 = hbc.get("products", "row1", "fam1", "col2"); System.out.println("Retrieving values : " + v1 + "; " + v2); System.out.println("\n ------------------\n"); /* Delete a column (with a previous value stored within) */ System.out.println("Deleting value: row1:fam1:col1"); v1 = hbc.get("products", "row1", "fam1", "col1"); System.out.println("Retrieving value row1:fam1:col1 (pre-delete): " + v1); hbc.delete("products", "row1", "fam1", "col1"); v1 = hbc.get("products", "row1", "fam1", "col1"); System.out.println("Retrieving value row1:fam1:col1 (post-1st-delete): " + v1); hbc.delete("products", "row1", "fam1", "col1"); v1 = hbc.get("products", "row1", "fam1", "col1"); System.out.println("Retrieving value row1:fam1:col1 (post-2nd-delete): " + v1); System.out.println("\n ------------------\n"); /* Scanning table */ System.out.println("Scanning table..."); hbc.scanTable("products", null, null); /* Truncate */ System.out.println("Truncating data... "); hbc.truncateTable("products", true); System.out.println("\n ------------------\n"); /* Scanning table */ System.out.println("Scanning table..."); hbc.scanTable("products", null, null); } public static void otherDataManipulationOperations(HBaseClient hbc) throws IOException, ServiceException { /* Create */ System.out.println("\n******************************************************** \n"); if (!hbc.exists("products")){ System.out.println("Creating table..."); hbc.createTable("products", "fam1", "fam2", "fam3"); } System.out.println("\n******************************************************** \n"); /* ********************************************************** * Data Management: Special Cases of Put, Delete * ********************************************************** */ /* Try to insert a row for a not existing column family */ System.out.println("Insert a key with a not existing column family"); boolean res = hbc.put("products", "row2", "fam100", "col1", "val1"); System.out.println(" result: " + res); System.out.println("\n ------------------\n"); /* Delete: different columns, same column family */ System.out.println(" # Inserting row2:fam1:col1"); hbc.put("products", "row2", "fam1", "col1", "val1"); System.out.println(" # Inserting row2:fam1:col2 "); hbc.put("products", "row2", "fam1", "col2", "val2"); String v1 = hbc.get("products", "row2", "fam1", "col1"); String v2 = hbc.get("products", "row2", "fam1", "col2"); System.out.println("Retrieving values (pre-delete of col1): " + v1 + "; " + v2); System.out.println("Deleting data of different columns, but same column family... "); hbc.delete("products", "row2", "fam1", "col1"); v1 = hbc.get("products", "row2", "fam1", "col1"); v2 = hbc.get("products", "row2", "fam1", "col2"); System.out.println("Retrieving values (post-delete of col1): " + v1 + "; " + v2); System.out.println("\n ------------------\n"); /* Cleaning up all the data, before showing the next example */ hbc.truncateTable("products", false); /* Delete: column family */ System.out.println(" # Inserting row2:fam1:col2 = val2 (same family of existing row)"); hbc.put("products", "row2", "fam1", "col2", "val2"); System.out.println(" # Inserting row2:fam2:col3 = val3 (same family of existing row)"); hbc.put("products", "row2", "fam2", "col3", "val3"); System.out.println(); System.out.println("Deleting a column family for a data... "); hbc.delete("products", "row2", "fam1", null); v1 = hbc.get("products", "row2", "fam1", "col1"); v2 = hbc.get("products", "row2", "fam1", "col2"); String v3 = hbc.get("products", "row2", "fam2", "col3"); System.out.println("Retrieving values : " + v1 + "; " + v2 + "; " + v3); System.out.println("\n ------------------\n"); // note that we can insert: v1 = row2:fam1:col1 res = hbc.put("products", "row2", "fam1", "col1", "val1"); System.out.println(" result: " + res); v1 = hbc.get("products", "row2", "fam1", "col1"); System.out.println("Retrieving value : " + v1); System.out.println("\n ------------------\n"); /* Delete: entire row key */ System.out.println("Deleting the whole row (row2)... "); hbc.delete("products", "row2", null, null); v1 = hbc.get("products", "row2", "fam1", "col1"); v2 = hbc.get("products", "row2", "fam1", "col2"); v3 = hbc.get("products", "row2", "fam2", "col3"); System.out.println("Retrieving values : " + v1 + "; " + v2 + "; " + v3); } public static void getAllVersions(HBaseClient hbc) throws IOException, ServiceException { /* Create */ System.out.println("\n******************************************************** \n"); if (!hbc.exists("products")){ System.out.println("Creating table..."); hbc.createTable("products", "fam1", "fam2", "fam3"); } System.out.println("\n******************************************************** \n"); /* Put */ System.out.println("\n ------------------\n"); System.out.println("Adding value: row1:fam1:col1=val1"); hbc.put("products", "row1", "fam1", "col1", "val1"); System.out.println("Adding value: row1:fam1:col1=val2"); hbc.put("products", "row1", "fam1", "col1", "val2"); /* Get All Versions */ System.out.println("Retrieving all versions of row1:fam1:col1"); Map<Long, String> values = hbc.getAllVersions("products", "row1", "fam1", "col1"); for (long ts : values.keySet()){ System.out.println(" - " + ts + ": " + values.get(ts)); } // Deleting a value an trying again: System.out.println("Deleting value of row1:fam1:col1"); hbc.delete("products", "row1", "fam1", "col1"); values = hbc.getAllVersions("products", "row1", "fam1", "col1"); System.out.println("Retrieving all versions of row1:fam1:col1"); for (long ts : values.keySet()){ System.out.println(" - " + ts + ": " + values.get(ts)); } // Drop table System.out.println("Deleting table..."); hbc.dropTable("products"); } public static void filter(HBaseClient hbc) throws IOException, ServiceException { /* ********************************************************** * Data Management: Filter * ********************************************************** */ /* Create */ System.out.println("\n******************************************************** \n"); if (!hbc.exists("products")){ System.out.println("Creating table..."); hbc.createTable("products", "fam1", "fam2", "fam3"); } System.out.println("\n******************************************************** \n"); /* Put: different rows, same column family */ System.out.println(" # Inserting row1:fam1:col1"); hbc.put("products", "row1", "fam1", "col1", "test"); System.out.println(" # Inserting row2:fam1:col1 "); hbc.put("products", "row2", "fam1", "col1", "val"); String v1 = hbc.get("products", "row1", "fam1", "col1"); String v2 = hbc.get("products", "row2", "fam1", "col1"); System.out.println("Retrieving values: " + v1 + "; " + v2); Table table = hbc.getConnection().getTable(TableName.valueOf("products")); Scan scan = new Scan(); // We add to the scan the column we are interested in and the column we want to filter on scan.addColumn(b("fam1"), b("col1")); // We specify the row prefix for starting the scan operation scan.withStartRow(b("row")) // we set the stop condition as follows: proceed until scanning all rows with specified prefix .setRowPrefixFilter(b("row")); SingleColumnValueFilter valueFilter = new SingleColumnValueFilter( b("fam1"), b("col1"), CompareFilter.CompareOp.NOT_EQUAL, b("val")); scan.setFilter(valueFilter); ResultScanner scanner = table.getScanner(scan); // Emitting results int count = 0; for (Result r = scanner.next(); r != null; r = scanner.next()){ byte[] test = r.getValue(b("fam1"), Bytes.toBytes("col1")); System.out.println(" - " + new String(r.getRow()) + ", Test result = " + new String(test)); count++; } System.out.println(" Found: " + count + " entries"); scanner.close(); // Drop table System.out.println("Deleting table..."); hbc.dropTable("products"); } public static void main(String[] args) throws IOException, ServiceException { HBaseClient hbc = new HBaseClient(); int choice = 4; switch (choice) { case 1: /* ********************************************************** * Table Management: Create, Alter, Describe, Delete * ********************************************************** */ tableManagementOperations(hbc); break; case 2: /* ********************************************************** * Data Management: Put, Get, Delete, Scan, Truncate * ********************************************************** */ simpleDataManipulationOperations(hbc); break; case 3: /* Data manipulation, special cases */ otherDataManipulationOperations(hbc); break; case 4: /* Get All Versions */ getAllVersions(hbc); break; default: /* ********************************************************** * Data Management: Filter * ********************************************************** */ filter(hbc); break; } } }
0028f226d7ebde3e05912ec35fe6ce5ef570aa6b
fe6bf7a13de8b601b0431a99e8c8b1ddbceb8500
/app/src/main/java/com/zhaoqy/self/ui/activity/main/knowledge/banner/BannerMainActivity.java
64a27b84fe8201fb457dec013a592a508d513939
[]
no_license
Clearlove2015/ZhiWo
9dbaa5ce0f5a9406b97c15a8059433495e671a7e
6fa750b97b25f01674fd110ad4229579e468f499
refs/heads/master
2020-03-30T00:36:59.630930
2018-08-07T09:43:40
2018-08-07T09:43:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,124
java
package com.zhaoqy.self.ui.activity.main.knowledge.banner; import android.content.Intent; import android.graphics.Color; import android.os.Handler; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; import android.widget.Toast; import com.youth.banner.Banner; import com.youth.banner.listener.OnBannerListener; import com.zhaoqy.self.R; import com.zhaoqy.self.ui.activity.main.knowledge.banner.loader.GlideImageLoader; import com.zhaoqy.self.ui.base.BaseBarActivity; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import butterknife.BindView; import butterknife.OnClick; public class BannerMainActivity extends BaseBarActivity implements View.OnClickListener, OnBannerListener { private static final int REFRESH_COMPLETE = 0X1112; @BindView(R.id.swipelayout) SwipeRefreshLayout mSwipeLayout; @BindView(R.id.banner) Banner banner; @Override protected int getLayoutResID() { return R.layout.activity_banner_main; } @Override protected void initData() { mSwipeLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW); mSwipeLayout.setEnabled(true); mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { mHandler.sendEmptyMessageDelayed(REFRESH_COMPLETE, 2000); } }); banner.setImages(new ArrayList<>()) .setImageLoader(new GlideImageLoader()) .setOnBannerListener(this) .start(); } @OnClick({R.id.banner0, R.id.banner1, R.id.banner2, R.id.banner3, R.id.banner4}) public void onClick(View view) { switch (view.getId()) { case R.id.banner0: { /** * 动画预览 */ Intent intent = new Intent(this, BannerAnimationActivity.class); startActivity(intent); break; } case R.id.banner1: { /** * 内置样式预览 */ Intent intent = new Intent(this, BannerStyleActivity.class); startActivity(intent); break; } case R.id.banner2: { /** * 自定义样式预览 */ Intent intent = new Intent(this, BannerCustomActivity.class); startActivity(intent); break; } case R.id.banner3: { /** * 指示器设置预览 */ Intent intent = new Intent(this, BannerIndicatorActivity.class); startActivity(intent); break; } case R.id.banner4: { /** * 加载本地图片 */ Intent intent = new Intent(this, BannerLocalActivity.class); startActivity(intent); break; } } } private Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { switch (msg.what) { case REFRESH_COMPLETE: String[] urls = getResources().getStringArray(R.array.banner_url); List list = Arrays.asList(urls); List arrayList = new ArrayList(list); banner.update(arrayList); mSwipeLayout.setRefreshing(false); break; } } }; @Override public void OnBannerClick(int position) { Toast.makeText(this,"你点击了:" + position, Toast.LENGTH_SHORT).show(); } @Override protected void onStart() { super.onStart(); /** * 开始轮播 */ banner.startAutoPlay(); } @Override protected void onStop() { super.onStop(); /** * 结束轮播 */ banner.stopAutoPlay(); } }
70065f6a086974d82cbdfa87d2d420a6882f93dd
d802c10c87358b3a7fd41476a3e6024d2e4723b0
/src/main/java/com/ssm/serviceImpl/LandinfoServiceServiceImpl.java
56ad6770a4af90f1d3f48d2b2f41557afd82c5f6
[]
no_license
longyuan-com/happyfarm-1.0
9d74dec6bf12f9e582d9c495c0b335ffd6966d8e
f29d11603dc01854eaf1e6cc4dd3f4526ba19fa6
refs/heads/master
2022-12-23T19:22:49.842618
2019-10-22T05:13:20
2019-10-22T05:13:20
216,705,385
0
0
null
2022-12-16T03:32:12
2019-10-22T02:21:46
JavaScript
UTF-8
Java
false
false
7,529
java
package com.ssm.serviceImpl; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ssm.entity.HappyFarmCart; import com.ssm.entity.HappyFarmLandinfo; import com.ssm.entity.HappyFarmLandinfoExample; import com.ssm.entity.HappyFarmLandinfoExample.Criteria; import com.ssm.mapper.HappyFarmLandinfoMapper; import com.ssm.service.LandinfoService; @Service public class LandinfoServiceServiceImpl implements LandinfoService { @Autowired private HappyFarmLandinfoMapper happyFarmLandinfoMapper; @Override public void addHappyFarmLandinfo(HappyFarmLandinfo HappyFarmLandinfo) { happyFarmLandinfoMapper.insert(HappyFarmLandinfo); } @Override public List<HappyFarmLandinfo> selectHappyFarmLandinfo() { return happyFarmLandinfoMapper.selectByExample(null); } @Override public HappyFarmLandinfo getByHappyFarmLandinfoId(int landid) { // TODO Auto-generated method stub return happyFarmLandinfoMapper.selectByPrimaryKey(landid); } @Override public void deletHappyFarmLandinfo(int landid) { // TODO Auto-generated method stub happyFarmLandinfoMapper.deleteByPrimaryKey(landid); } @Override public void updateHappyFarmLandinfo(HappyFarmLandinfo HappyFarmLandinfo) { // TODO Auto-generated method stub happyFarmLandinfoMapper.updateByPrimaryKey(HappyFarmLandinfo); } @Override public int updateStstus(int landid, int status) { // TODO Auto-generated method stub return happyFarmLandinfoMapper.updatestatus(landid, status); } // @Override // public List<HappyFarmLandinfo> addHappyFarmLandinfoCartList(HttpServletRequest request, // List<HappyFarmCart> Carlist, int num, int HappyFarmLandinfoID) { // //根据土地ID查询土地的明细 // int landID = Integer.parseInt(request.getParameter("landID")); // HappyFarmLandinfo land = happyFarmLandinfoMapper.selectByPrimaryKey(landID); // //判断土地是否存在 // if(land==null) { // throw new RuntimeException("该土地不存在"); // } // //根据商家的ID判断购物车里的商品ID是否存在 // //LandCart lCart = new LandCart(); // HappyFarmCart lCart=searchLandCartByLandID(Carlist,request); // //如果购物车两个ID不相等说明购物车中不存在此土地 // if(lCart==null) { // lCart=new HappyFarmCart(); // lCart.setId(land.getLandid()); // lCart.set(land.getLandname()); // lCart.setLandPrice(land.getLandprice()); // lCart.setNum(num); // Carlist.add(lCart); // }else {//判断商品是否存在购物车明细列表中 // lCart.setNum(lCart.getNum()+num); // //如果小于0删除土地 // if(lCart.getNum()<=0||num==0) { // Carlist.remove(lCart); // } // } // return Carlist; // } @Override public int getCount() { // TODO Auto-generated method stub HappyFarmLandinfoExample example=new HappyFarmLandinfoExample(); Criteria criteria=example.createCriteria(); criteria.andLandnameIsNull(); return (int)happyFarmLandinfoMapper.countByExample(example); } public HappyFarmCart searchLandCartByLandID(List<HappyFarmCart> list,HttpServletRequest request) { int landID = Integer.parseInt(request.getParameter("landid")); for (HappyFarmCart landCart : list) { if(landCart.getId()==landID) { return landCart; } } return null; } @Override public List<HappyFarmLandinfo> addHappyFarmLandinfoCartList(HttpServletRequest request, List<HappyFarmLandinfo> Carlist, int num, int HappyFarmLandinfoID) { // TODO Auto-generated method stub return null; } @Override public List<HappyFarmLandinfo> selectInfoStatus() { HappyFarmLandinfoExample example=new HappyFarmLandinfoExample(); Criteria criteria=example.createCriteria(); criteria.andStatusEqualTo(1); List<HappyFarmLandinfo> list=happyFarmLandinfoMapper.selectByExample(example); return list; } // @Override // public void addLand(HappyFarmLandinfo land) { // // landDao.addLand(land); // } // @Override // public List<HappyFarmLandinfo> selectLand() { // // return landDao.selectLand(); // } // @Override // public List<HappyFarmLandinfo> getByLandId(int landID) { // // return landDao.getByLandId(landID); // } // @Override // public void deletLand(int landID) { // // landDao.deletLand(landID); // } // @Override // public void updateLand(HappyFarmLandinfo land) { // // landDao.updateLand(land); // } // @Override // public Land getByLandId2(int landID) { // Land land =landDao.getByLandId2(landID); // return land; // // } // @Override // public List<LandCart> addLandCartList(HttpServletRequest request,List<LandCart> Carlist, int num,int landID) { // //根据土地ID查询土地的明细 // //int landID = Integer.parseInt(request.getParameter("landID")); // Land land = landDao.getByLandId2(landID); // //判断土地是否存在 // if(land==null) { // throw new RuntimeException("该土地不存在"); // } // //根据商家的ID判断购物车里的商品ID是否存在 // //LandCart lCart = new LandCart(); // LandCart lCart=searchLandCartByLandID(Carlist,request); // //如果购物车两个ID不相等说明购物车中不存在此土地 // if(lCart==null) { // lCart=new LandCart(); // lCart.setId(land.getLandID()); // lCart.setLandImg(land.getLandImg()); // lCart.setLandName(land.getLandName()); // lCart.setLandPrice(land.getLandPrice()); // lCart.setNum(num); // Carlist.add(lCart); // }else {//判断商品是否存在购物车明细列表中 // lCart.setNum(lCart.getNum()+num); // //如果小于0删除土地 // if(lCart.getNum()<=0||num==0) { // Carlist.remove(lCart); // } // } // return Carlist; // } // /* // * 根据土地列表土地ID在购物车明细列表中查询明细对象 // * */ // public LandCart searchLandCartByLandID(List<LandCart> list,HttpServletRequest request) { // int landID = Integer.parseInt(request.getParameter("landID")); // for (LandCart landCart : list) { // if(landCart.getId()==landID) { // return landCart; // } // } // return null; // } // @Override // public int getCount() { // int count =landDao.getCount(); // return count; // } // @Override // /* // * // * (non-Javadoc) // * @see com.ssm.service.LandService#updateStstus(int, int) // */ // public int updateStstus(int landId, int status) { // // int num=landDao.updateStstus(landId, status); // return num; // } // @Override // public void addHappyFarmLandinfo(HappyFarmLandinfo HappyFarmLandinfo) { // // TODO Auto-generated method stub // // } // @Override // public List<HappyFarmLandinfo> selectHappyFarmLandinfo() { // // TODO Auto-generated method stub // return null; // } // @Override // public List<HappyFarmLandinfo> getByHappyFarmLandinfoId(int HappyFarmLandinfoID) { // // TODO Auto-generated method stub // return null; // } // @Override // public void deletHappyFarmLandinfo(int HappyFarmLandinfoID) { // // TODO Auto-generated method stub // // } // @Override // public void updateHappyFarmLandinfo(HappyFarmLandinfo HappyFarmLandinfo) { // // TODO Auto-generated method stub // // } // @Override // public HappyFarmLandinfo getByHappyFarmLandinfoId2(int HappyFarmLandinfoID) { // // TODO Auto-generated method stub // return null; // } // @Override // public List<HappyFarmLandinfo> addHappyFarmLandinfoCartList(HttpServletRequest request, // List<HappyFarmLandinfo> Carlist, int num, int HappyFarmLandinfoID) { // // TODO Auto-generated method stub // return null; // } }
bd5eb54654e3f5ef2a4b1a45492b51dd57290cfe
9a6238d012ad50cc0f6e223ec2cc4504ab804f3f
/muviplayersdk/src/main/java/com/muvi/muviplayersdk/model/SubtitleModel.java
f545440eff398e2de02fb3a5b9c4deaa37e2779b
[]
no_license
MuviDeveloper/MUVIPLAYERSDK
73a4d6ec732306966a06027a6c03493aa8d6cc10
69144f9538d9f039fc30a8d2c8dd060fe30214b5
refs/heads/master
2022-10-13T10:58:50.436678
2017-11-14T09:37:04
2017-11-14T09:37:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
740
java
package com.muvi.muviplayersdk.model; /** * Created by MUVI on 6/20/2017. */ public class SubtitleModel { public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } private String ID; private String language; public String getID() { return ID; } public void setID(String ID) { this.ID = ID; } public String getUID() { return UID; } public void setUID(String UID) { this.UID = UID; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } private String UID; private String path; }
a343307d4649a0565ace1a85a82ee38b7c5b4b49
df8e49f2748b6e38b5f5fa2c9de8c41caee94273
/hibernate/jpawithhibernate/src/main/java/com/ustglobal/jpawithhibernate/jpql/DeleteWithJPQL.java
e395d88de82e45e4011dd0805ac0beb127af1794
[]
no_license
Sreekanth123reddy/USTGlobal-16Sep2019-ASreekanthReddy
bc42c9df5f56c8371e66bc74ee28a0fa1305c0be
a8d174363a4b45f3a8639e01023ca5fbcae94429
refs/heads/master
2023-01-12T01:59:04.627227
2020-06-01T11:35:51
2020-06-01T11:35:51
157,062,486
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.ustglobal.jpawithhibernate.jpql; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; public class DeleteWithJPQL { public static void main(String[] args) { EntityManager entityManager=null; EntityTransaction entityTransaction = null; try { EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("test"); entityManager = entityManagerFactory.createEntityManager(); entityTransaction = entityManager.getTransaction(); entityTransaction.begin(); String jpql = "delete from ProductInfo where pid=101"; Query query = entityManager.createQuery(jpql); int result = query.executeUpdate(); System.out.println(result); entityTransaction.commit(); } catch (Exception e) { e.printStackTrace(); entityTransaction.rollback(); } entityManager.close(); } }
0d5eea54c18014e654c108fe2d47e4cb153b8895
d037e784c63365ced3725892374865970745dbcb
/app/src/main/java/com/example/korolkir/contactsdemo/presentation/posts/PostsPresenter.java
e40363836e0bc8a4a119ccd6e13fcc43bac28c40
[]
no_license
korolkir/ContactsDemo
e56c9437998af9417f61e0030feb99dec1c5b3a0
6ac2210df009beadc9326ad808979dec51ee7138
refs/heads/master
2020-12-06T22:10:28.051306
2016-09-13T21:08:17
2016-09-13T21:08:17
67,531,118
0
0
null
null
null
null
UTF-8
Java
false
false
3,727
java
package com.example.korolkir.contactsdemo.presentation.posts; import android.content.Context; import android.net.ConnectivityManager; import com.example.korolkir.contactsdemo.data.LogConstants; import com.example.korolkir.contactsdemo.domain.PostUnit; import com.example.korolkir.contactsdemo.domain.entity.Post; import com.example.korolkir.contactsdemo.presentation.common.BasePresenter; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; import rx.Observable; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by korolkir on 04.09.16. */ public class PostsPresenter extends BasePresenter<PostsActivity> { private Context context; private PostUnit postUnit; private List<Post> postList; @Inject public PostsPresenter(PostUnit postUnit, Context context) { this.postUnit = postUnit; this.context = context; postList = new ArrayList<>(); } public void onSaveLog() { saveLog().subscribe(new Subscriber<String>() { @Override public void onCompleted() { unsubscribe(); } @Override public void onError(Throwable e) { } @Override public void onNext(String filename) { if (filename != null) { mainView.showLogSavingResult(filename); } else { mainView.showLogSavingResult(null); } } }); } private Observable<String> saveLog() { Observable<String> save = Observable.create( new Observable.OnSubscribe<String>() { @Override public void call(Subscriber<? super String> subscriber) { subscriber.onNext(saveLogInFile()); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()); return save; } private String saveLogInFile() { String logFileName = String.format(LogConstants.LOG_FILE_NAME, System.currentTimeMillis()); File outputFile = new File(context.getExternalCacheDir(), logFileName); try { @SuppressWarnings("unused") Process process = Runtime.getRuntime().exec(String.format(LogConstants.LOG_FILE_PATH, outputFile.getAbsolutePath())); return logFileName; } catch (IOException e) { e.printStackTrace(); } return null; } public void loadPostData() { if(isNetworkConnected()) { postUnit.getPosts() .subscribe(new Subscriber<List<Post>>() { @Override public void onCompleted() { unsubscribe(); } @Override public void onError(Throwable e) { } @Override public void onNext(List<Post> posts) { postList.addAll(posts); mainView.showPosts(posts); mainView.stopShowingProgress(); } }); } else { mainView.askToEnableNetwork(); } } private boolean isNetworkConnected() { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo() != null; } }
26550ec0c9f640fc2273b33a52c6464bf3b88524
5ab026c6a6213e3301b127c9a9456533a694129b
/code/java/1.4.0/opc-ua-java-stack-1.02/src/org/opcfoundation/ua/core/ContentFilterElementResult.java
8e5c152f6037bc7fc1dbf8b6f63927ff1f47a7c5
[ "Apache-2.0" ]
permissive
wuzhaojie/opcua-training
2071ef1390feb76f1657baa9afa0137fec3bbc48
f9c595fda501778acc1f531cfb5e1a27e192f68d
refs/heads/master
2021-12-26T10:57:55.525000
2021-08-04T15:15:43
2021-08-04T15:15:43
226,808,478
3
0
null
2021-06-04T02:21:48
2019-12-09T07:14:59
Java
UTF-8
Java
false
false
5,636
java
/* ======================================================================== * Copyright (c) 2005-2014 The OPC Foundation, Inc. All rights reserved. * * OPC Foundation MIT License 1.00 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * The complete license agreement can be found here: * http://opcfoundation.org/License/MIT/1.00/ * ======================================================================*/ package org.opcfoundation.ua.core; import org.opcfoundation.ua.builtintypes.Structure; import org.opcfoundation.ua.builtintypes.ExpandedNodeId; import org.opcfoundation.ua.core.Identifiers; import org.opcfoundation.ua.utils.ObjectUtils; import java.util.Arrays; import org.opcfoundation.ua.builtintypes.DiagnosticInfo; import org.opcfoundation.ua.builtintypes.StatusCode; public class ContentFilterElementResult extends Object implements Structure, Cloneable { public static final ExpandedNodeId ID = new ExpandedNodeId(Identifiers.ContentFilterElementResult); public static final ExpandedNodeId BINARY = new ExpandedNodeId(Identifiers.ContentFilterElementResult_Encoding_DefaultBinary); public static final ExpandedNodeId XML = new ExpandedNodeId(Identifiers.ContentFilterElementResult_Encoding_DefaultXml); protected StatusCode StatusCode; protected StatusCode[] OperandStatusCodes; protected DiagnosticInfo[] OperandDiagnosticInfos; public ContentFilterElementResult() {} public ContentFilterElementResult(StatusCode StatusCode, StatusCode[] OperandStatusCodes, DiagnosticInfo[] OperandDiagnosticInfos) { this.StatusCode = StatusCode; this.OperandStatusCodes = OperandStatusCodes; this.OperandDiagnosticInfos = OperandDiagnosticInfos; } public StatusCode getStatusCode() { return StatusCode; } public void setStatusCode(StatusCode StatusCode) { this.StatusCode = StatusCode; } public StatusCode[] getOperandStatusCodes() { return OperandStatusCodes; } public void setOperandStatusCodes(StatusCode[] OperandStatusCodes) { this.OperandStatusCodes = OperandStatusCodes; } public DiagnosticInfo[] getOperandDiagnosticInfos() { return OperandDiagnosticInfos; } public void setOperandDiagnosticInfos(DiagnosticInfo[] OperandDiagnosticInfos) { this.OperandDiagnosticInfos = OperandDiagnosticInfos; } /** * Deep clone * * @return cloned ContentFilterElementResult */ public ContentFilterElementResult clone() { ContentFilterElementResult result = new ContentFilterElementResult(); result.StatusCode = StatusCode; result.OperandStatusCodes = OperandStatusCodes==null ? null : OperandStatusCodes.clone(); result.OperandDiagnosticInfos = OperandDiagnosticInfos==null ? null : OperandDiagnosticInfos.clone(); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ContentFilterElementResult other = (ContentFilterElementResult) obj; if (StatusCode==null) { if (other.StatusCode != null) return false; } else if (!StatusCode.equals(other.StatusCode)) return false; if (OperandStatusCodes==null) { if (other.OperandStatusCodes != null) return false; } else if (!Arrays.equals(OperandStatusCodes, other.OperandStatusCodes)) return false; if (OperandDiagnosticInfos==null) { if (other.OperandDiagnosticInfos != null) return false; } else if (!Arrays.equals(OperandDiagnosticInfos, other.OperandDiagnosticInfos)) return false; return true; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((StatusCode == null) ? 0 : StatusCode.hashCode()); result = prime * result + ((OperandStatusCodes == null) ? 0 : Arrays.hashCode(OperandStatusCodes)); result = prime * result + ((OperandDiagnosticInfos == null) ? 0 : Arrays.hashCode(OperandDiagnosticInfos)); return result; } public ExpandedNodeId getTypeId() { return ID; } public ExpandedNodeId getXmlEncodeId() { return XML; } public ExpandedNodeId getBinaryEncodeId() { return BINARY; } public String toString() { return "ContentFilterElementResult: "+ObjectUtils.printFieldsDeep(this); } }
320003036816d1bd3538f360fbccd5d77a235c41
3d22f79186fde3cf5f9fe9ab3dca24d854b54f50
/src/main/java/com/uday/producer/service/FanoutPublisherService.java
554b5b92e6a99f6d1df13a592650b88ed4b53daa
[]
no_license
udaykumar1113/RabbitMQ_basic_producer
bc50c2e412a66d0f705903845c4eece2a94fe3d2
eda2e6292c4e8bce1beab654fbb37155ddd4e9f4
refs/heads/master
2022-11-21T08:26:31.147307
2019-11-27T19:43:08
2019-11-27T19:43:08
166,683,800
0
0
null
2022-11-16T12:00:18
2019-01-20T16:35:45
Java
UTF-8
Java
false
false
921
java
package com.uday.producer.service; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.uday.producer.entity.Employee; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class FanoutPublisherService { @Autowired private RabbitTemplate rabbitTemplate; public void publishToFanoutExchange() throws JsonProcessingException { ObjectMapper objectMapper=new ObjectMapper(); for(int i=1;i<=5;i++){ String employeeJson=objectMapper .writeValueAsString(new Employee("EMP_"+i,"Employee "+i)); rabbitTemplate.convertAndSend("x.hr","",employeeJson); System.out.println("Published message to Fanout excange "+employeeJson); } } }
a8cdee08b793e6377b33dc676e4017885e50c62c
fd76d488c5057e4829b2d83f01370ea260d9912b
/lib/jspf-d7e879684cc6/modules/plugins/remote.xmlrpcdelight/src/net/xeoh/plugins/remote/impl/xmlrpcdelight/RemoteAPIImpl.java
c093233a8d8b5b71188a955744aecd906d9757f6
[]
no_license
Energy0124/EnergyDominion
680f4931445e8eee9cca319010e5026422f8c285
263ab07e750dd6609f332f897f7fb98b48fa1326
refs/heads/master
2020-05-19T10:19:14.207419
2015-10-11T19:59:08
2015-10-11T19:59:08
13,497,109
0
0
null
null
null
null
UTF-8
Java
false
false
10,633
java
/* * RemoteAPIImpl.java * * Copyright (c) 2008, Ralf Biedert All rights reserved. * * 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 author nor the names of its contributors may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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 net.xeoh.plugins.remote.impl.xmlrpcdelight; import de.dfki.util.xmlrpc.XmlRpc; import de.dfki.util.xmlrpc.common.XmlRpcConnection; import de.dfki.util.xmlrpc.server.XmlRpcHandlerFactory; import net.xeoh.plugins.base.Plugin; import net.xeoh.plugins.base.PluginConfiguration; import net.xeoh.plugins.base.annotations.Capabilities; import net.xeoh.plugins.base.annotations.PluginImplementation; import net.xeoh.plugins.base.annotations.events.Init; import net.xeoh.plugins.base.annotations.injections.InjectPlugin; import net.xeoh.plugins.base.annotations.meta.Author; import net.xeoh.plugins.base.util.OptionUtils; import net.xeoh.plugins.remote.ExportResult; import net.xeoh.plugins.remote.PublishMethod; import net.xeoh.plugins.remote.RemoteAPIXMLRPCDelight; import net.xeoh.plugins.remote.options.ExportVanillaObjectOption; import net.xeoh.plugins.remote.options.exportvanillaobject.OptionExportName; import net.xeoh.plugins.remote.util.internal.PluginExport; import net.xeoh.plugins.remote.util.vanilla.ExportResultImpl; import net.xeoh.plugins.remotediscovery.RemoteDiscovery; import net.xeoh.plugins.remotediscovery.util.RemoteAPIDiscoveryUtil; import org.apache.xmlrpc.WebServer; import org.apache.xmlrpc.XmlRpcHandler; import java.io.IOException; import java.net.*; import java.util.HashMap; import java.util.Random; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Logger; /** * RemoteApi implementation for DFKI's XMLRPC Delight * * @author Ralf Biedert, Andreas Lauer, Christian Reuschling */ @Author(name = "Ralf Biedert, Andreas Lauer, Christian Reuschling") @PluginImplementation public class RemoteAPIImpl implements RemoteAPIXMLRPCDelight { /** * @return */ private static int getFreePort() { try { final ServerSocket serverSocket = new ServerSocket(0); final int port = serverSocket.getLocalPort(); serverSocket.close(); return port; } catch (final IOException e) { e.printStackTrace(); } return 1025 + new Random().nextInt(50000); } /** */ @InjectPlugin public PluginConfiguration configuration; /** */ @InjectPlugin public RemoteDiscovery discovery; /** * Where this server can be found */ private String exportUrl = "http://"; /** */ private RemoteAPIDiscoveryUtil remoteAPIDiscoveryUtil; /** * Lock server from concurrent access */ private final Lock serverLock = new ReentrantLock(); /** * Log events */ final Logger logger = Logger.getLogger(this.getClass().getName()); /** * Used for unexport */ HashMap<Plugin, String> handlerToPluginMap = new HashMap<Plugin, String>(); /** * Server object to receive requests */ volatile WebServer server; /* (non-Javadoc) * @see net.xeoh.plugins.remote.RemoteAPI#exportPlugin(net.xeoh.plugins.base.Plugin) */ public ExportResult exportPlugin(final Plugin plugin) { this.serverLock.lock(); if (this.server == null) { initServer(); } this.serverLock.unlock(); // If this server is still null now, return if (this.server == null) return null; // // Try to find the most appropriate export name // String exportName = PluginExport.getExportName(plugin); /* // FIXME: Might need improvement. final Class<?>[] interfaces = plugin.getClass().getInterfaces(); // All interfaces this class implements for (final Class<?> class1 : interfaces) { if (Plugin.class.isAssignableFrom(class1)) { exportName = class1.getSimpleName(); } } */ // The URL we export at final String exportURL = this.exportUrl + exportName; this.serverLock.lock(); try { final XmlRpcHandler delightHandler = XmlRpcHandlerFactory.createHandlerFor(plugin); this.handlerToPluginMap.put(plugin, exportName); this.server.addHandler(exportName, delightHandler); } finally { this.serverLock.unlock(); } final URI createURI = createURI(exportURL); // Announce the plugin this.discovery.announcePlugin(plugin, getPublishMethod(), createURI); return new ExportResultImpl(createURI); } /** * @return . */ @Capabilities public String[] getCapabilites() { return new String[]{"xmlrpc", "XMLRPC", "xmlrpcdelight", "XMLRPCDELIGHT"}; } public PublishMethod getPublishMethod() { return PublishMethod.XMLRPCDELIGHT; } public <R extends Plugin> R getRemoteProxy(final URI url, final Class<R> remote) { // In case this is a remote url, let the discoverer work. if (this.remoteAPIDiscoveryUtil.isDiscoveryURI(url)) return this.remoteAPIDiscoveryUtil.getRemoteProxy(url, remote); try { String handler = url.getPath(); handler = handler.substring(handler.lastIndexOf('/') + 1); final R client = XmlRpc.createClient(remote, handler, XmlRpcConnection.connect(url.toURL())); return client; } catch (final IOException e) { e.printStackTrace(); } catch (final Exception e) { e.printStackTrace(); } return null; } /** */ @Init public void init() { this.remoteAPIDiscoveryUtil = new RemoteAPIDiscoveryUtil(this.discovery, this); } /** */ @Shutdown public void shutdown() { // shutdown in einem Extra-Thread, damit es sich nicht verhakt if (this.server != null) { final Thread shutDownThread = new Thread(new Runnable() { public void run() { RemoteAPIImpl.this.server.shutdown(); RemoteAPIImpl.this.server = null; RemoteAPIImpl.this.logger.info("XmlRpc server shut down"); } }); shutDownThread.start(); } } public void unexportPlugin(final Plugin plugin) { final String strPluginID = this.handlerToPluginMap.get(plugin); this.handlerToPluginMap.remove(plugin); this.server.removeHandler(strPluginID); } /** * Internally used to create an URL without 'try' * * @param string * @return */ URI createURI(final String string) { try { return new URI(string); } catch (final URISyntaxException e) { e.printStackTrace(); } return null; } /** * Try to setup the server if it's not already there */ void initServer() { int NUM_RETRIES = 10; int SERVER_PORT = getFreePort(); try { SERVER_PORT = Integer.parseInt(this.configuration.getConfiguration(RemoteAPIImpl.class, "xmlrpc.port")); } catch (final NumberFormatException e) { // Do nothing, as the most probable reason is the config was not set. } this.logger.info("Setting up XMLRPC-server on port " + SERVER_PORT); boolean succeded = false; while (!succeded && NUM_RETRIES-- > 0) { try { this.exportUrl += InetAddress.getLocalHost().getCanonicalHostName(); this.exportUrl += ":" + SERVER_PORT + "/"; this.server = new WebServer(SERVER_PORT); // start wird schon im Konstruktor ausgeführt // this.server.start(); this.logger.info("XMLRPC server listening on baseroot " + this.exportUrl); succeded = true; } catch (final UnknownHostException e) { this.logger.warning("Unable to create XMLRPC handler for this host"); e.printStackTrace(); } catch (final IOException e) { this.logger.warning("Unable to create XMLRPC handler for this host"); e.printStackTrace(); } SERVER_PORT++; } } /* (non-Javadoc) * @see net.xeoh.plugins.remote.impl.RemoteAPIXMLRPCDelight#exportVanillaObject(java.lang.Object, net.xeoh.plugins.base.Option[]) */ public URI exportVanillaObject(Object toExport, ExportVanillaObjectOption... option) { this.serverLock.lock(); if (this.server == null) { initServer(); } this.serverLock.unlock(); // //final String exportName = toExport.getClass().getSimpleName() + "@" + System.nanoTime(); final OptionUtils<ExportVanillaObjectOption> ou = new OptionUtils<ExportVanillaObjectOption>(option); if (ou.contains(OptionExportName.class)) { ou.get(OptionExportName.class); // TODO: Get export name } // If this server is still null now, return if (this.server == null) return null; return null; } }
9bf92fd45f849742ca970d5dad241e1706295687
403c78b5a8c47ee7a4b00d9fafdef3c8ae9ec2da
/dev/src/org/proteomecommons/pfsm/util/FASTAMatcherListener.java
bc106e81309599cf730ef54616ddce4b668480dc
[]
no_license
jfalkner/PFSM
f9432c7a5217ddd7741b1228c0a2a8ec520505fc
913b9361cc823bf5200e8dd6b4faf91948731d98
refs/heads/master
2016-09-16T05:27:22.442540
2013-12-12T05:50:18
2013-12-12T05:50:18
12,941,891
1
0
null
null
null
null
UTF-8
Java
false
false
518
java
package org.proteomecommons.pfsm.util; import org.proteomecommons.pfsm.*; /** * Simple serial listener for FASTAMatcher instances. * @author Jayson Falkner - [email protected] */ public interface FASTAMatcherListener { void searchStarted(FASTAMatcher matcher); void searchFinished(FASTAMatcher matcher); void peptideMatched(byte[] proteinName, int proteinNameOffset, int proteinNameLength, byte[] protein, int proteinOffset, int proteinLength, int sequenceOffset, int sequenceLength, DFAState finState); }
c7d89624a721dfe47d68d70cdca9cdf779c087f7
095b0f77ffdad9d735710c883d5dafd9b30f8379
/src/com/google/tagmanager/a/ar.java
f050815752002c0477473a4ca594378d1a5bc1cb
[]
no_license
wubainian/smali_to_java
d49f9b1b9b5ae3b41e350cc17c84045bdc843cde
47cfc88bbe435a5289fb71a26d7b730db8366373
refs/heads/master
2021-01-10T01:52:44.648391
2016-03-10T12:10:09
2016-03-10T12:10:09
53,547,707
1
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package com.google.tagmanager.a import java.io.OutputStream; import java.util.Iterator; class ar extends com.google.tagmanager.a.h{ //instance field private final int d; private final com.google.tagmanager.a.h e; private final com.google.tagmanager.a.h f; private final int g; private final int h; private int i; //static field private static final []int c; //clinit method static{ } //init method private ar(com.google.tagmanager.a.h ah0, com.google.tagmanager.a.h ah0){ } synthetic ar(com.google.tagmanager.a.h ah0, com.google.tagmanager.a.h ah0, com.google.tagmanager.a.as aas0){ } //ordinary method static synthetic com.google.tagmanager.a.h a(com.google.tagmanager.a.ar aar0){ } static com.google.tagmanager.a.h a(com.google.tagmanager.a.h ah0, com.google.tagmanager.a.h ah0){ } private static com.google.tagmanager.a.aj b(com.google.tagmanager.a.h ah0, com.google.tagmanager.a.h ah0){ } static synthetic com.google.tagmanager.a.h b(com.google.tagmanager.a.ar aar0){ } private boolean b(com.google.tagmanager.a.h ah0){ } static synthetic []int b(){ } public int a(){ } protected int a(int aint0, int aint0, int aint0){ } public String a(String aString0){ } protected void a([]byte abyte0, int aint0, int aint0, int aint0){ } protected int b(int aint0, int aint0, int aint0){ } void b(OutputStream aOutputStream0, int aint0, int aint0){ } public com.google.tagmanager.a.i c(){ } public boolean equals(Object aObject0){ } public boolean g(){ } public com.google.tagmanager.a.k h(){ } public int hashCode(){ } public synthetic Iterator iterator(){ } protected int j(){ } protected boolean k(){ } protected int l(){ } }
6ef70d4d63416ae58476aea7df4ae4c96926d681
88fe7e59ecfba871f02b3f19146be388ac9ce58d
/src/java/com/crudjsfjpa/dao/impl/ProyectoDaoImpl.java
10368502afc18da6976e3d546fd13efd80f18236
[]
no_license
klmeir/crudjsfjpa
ff49a3c57a813c8dbf859cbdc2f38d648896e72c
989ecdd8c24c72309137d1e22e7e8c3687e61cd4
refs/heads/master
2021-01-22T04:01:56.717184
2017-05-27T23:16:30
2017-05-27T23:16:30
92,410,807
0
0
null
null
null
null
UTF-8
Java
false
false
1,289
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.crudjsfjpa.dao.impl; import com.crudjsfjpa.dao.ProyectoDao; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query; /** * * @author Carlos Meriño Iriarte <[email protected]> * @param <Proyecto> */ public class ProyectoDaoImpl<Proyecto> implements ProyectoDao<Proyecto> { private EntityManager entityManager; public EntityManager getEntityManager() { return entityManager; } public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; } @Override public void save(Proyecto p) { this.getEntityManager().persist(p); } @Override public void update(Proyecto p) { this.getEntityManager().merge(p); } @Override public void delete(Proyecto p) { this.getEntityManager().remove(p); } @Override public List<Proyecto> list() { Query query = this.getEntityManager().createQuery("SELECT p " + "FROM Proyecto p ORDER BY p.id"); return query.getResultList(); } }
92cd82d3c6e12ddaf3f1cecf4c9ce81c66fd8948
4ebcbeba4b5fc9bdadf3e14a439f14b2e2c0ffa9
/src/main/java/com/epam/dao/AudioBooksRepository.java
b455bc20d6cba427017ef68ff2b3dea0dbfd7533
[]
no_license
roma0297/media-storage-service
391b2b98121a83858fc1447cf6ef18d4409d1e54
f25f03d6cfeefb0a125e912ff2ca462b0a1c2e58
refs/heads/master
2022-12-22T05:14:47.455778
2019-07-24T19:01:26
2019-07-25T07:38:36
195,653,555
0
1
null
2022-12-16T00:38:41
2019-07-07T13:20:03
Java
UTF-8
Java
false
false
2,009
java
package com.epam.dao; import com.epam.models.AudioBookModel; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; @Repository public class AudioBooksRepository { private static final List<AudioBookModel> AUDIO_BOOKS; static { AUDIO_BOOKS = Arrays.asList(AudioBookModel.builder() .id(1) .name("White Fang") .description("Adventure literature and animal literature classics") .artist("Jack London") .rank(0) .createDateTime(LocalDateTime.now()) .build(), AudioBookModel.builder() .id(2) .name("I am a dragon") .description("Science fiction novel Alexander Sapegina") .artist("Alexander Sapegin") .rank(0) .createDateTime(LocalDateTime.now()) .build(), AudioBookModel.builder() .id(2) .name("Ocean") .description("\"Ocean\" - the third book of Diana Lilit, published in the publishing house \"AST\"") .artist("Diane Lilith") .rank(0) .createDateTime(LocalDateTime.now()) .build(), AudioBookModel.builder() .id(2) .name("Jack on the moon") .description("His name is Zhenya, but for everyone here he is - Jack") .artist("Tatyana Rusuberg") .rank(0) .createDateTime(LocalDateTime.now()) .build()); } public List<AudioBookModel> getAudioBooksAlbum() { return AUDIO_BOOKS; } }
c4ac7dbf0184c70e27ed48be5161c0942b3a2b62
63d319fbd88e49701d8dcc2919c8f3a6013e90d0
/Applications/ModelSoC/plugins/org.oasisopen.names.tc.opendocument/src/org/oasisopen/names/tc/opendocument/xmlns/style/MirrorTypeMember2.java
56d94880aa406513e6efaf8b4acd720a5d006017
[]
no_license
DevBoost/Reuseware
2e6b3626c0d434bb435fcf688e3a3c570714d980
4c2f0170df52f110c77ee8cffd2705af69b66506
refs/heads/master
2021-01-19T21:28:13.184309
2019-06-09T20:39:41
2019-06-09T20:48:34
5,324,741
1
1
null
null
null
null
UTF-8
Java
false
false
5,066
java
/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id$ */ package org.oasisopen.names.tc.opendocument.xmlns.style; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * <!-- begin-user-doc --> * A representation of the literals of the enumeration '<em><b>Mirror Type Member2</b></em>', * and utility methods for working with them. * <!-- end-user-doc --> * @see org.oasisopen.names.tc.opendocument.xmlns.style.StylePackage#getMirrorTypeMember2() * @model extendedMetaData="name='mirror_._type_._member_._2'" * @generated */ public enum MirrorTypeMember2 implements Enumerator { /** * The '<em><b>Vertical</b></em>' literal object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #VERTICAL_VALUE * @generated * @ordered */ VERTICAL(0, "vertical", "vertical"); /** * The '<em><b>Vertical</b></em>' literal value. * <!-- begin-user-doc --> * <p> * If the meaning of '<em><b>Vertical</b></em>' literal object isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @see #VERTICAL * @model name="vertical" * @generated * @ordered */ public static final int VERTICAL_VALUE = 0; /** * An array of all the '<em><b>Mirror Type Member2</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final MirrorTypeMember2[] VALUES_ARRAY = new MirrorTypeMember2[] { VERTICAL, }; /** * A public read-only list of all the '<em><b>Mirror Type Member2</b></em>' enumerators. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final List<MirrorTypeMember2> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the '<em><b>Mirror Type Member2</b></em>' literal with the specified literal value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static MirrorTypeMember2 get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { MirrorTypeMember2 result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the '<em><b>Mirror Type Member2</b></em>' literal with the specified name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static MirrorTypeMember2 getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { MirrorTypeMember2 result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the '<em><b>Mirror Type Member2</b></em>' literal with the specified integer value. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static MirrorTypeMember2 get(int value) { switch (value) { case VERTICAL_VALUE: return VERTICAL; } return null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final int value; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String name; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private final String literal; /** * Only this class can construct instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private MirrorTypeMember2(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { return literal; } } //MirrorTypeMember2
6dedf1299259735df618a35d9ec321d2104659b4
885e24c87e9f4f673f4659264b6e639100a95f0a
/java/MineMineNoMi3/entities/mobs/pirates/krieg/EntityGin.java
ff964483ac60e11125aa33043904b9a18ae7db70
[]
no_license
hk00560/MineMineNoMi3
4758e91bb13a37e16590c06a32a85bbb4ccd8b7a
6d5f5d0a1c79d2e0a0016056d662aa9d62a5e1a2
refs/heads/master
2021-05-09T14:07:44.932643
2017-05-08T12:21:36
2017-05-08T12:21:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
package MineMineNoMi3.entities.mobs.pirates.krieg; import net.minecraft.entity.monster.EntityMob; import net.minecraft.world.World; public class EntityGin extends EntityMob { public EntityGin(World worldIn) { super(worldIn); } }
5610c7c88bb58ca79651518af0ea3515320f8fa0
cbaaff0a2a9179fcdf4d247926132fc946f24234
/src/main/java/org/apache/ibatis/annotations/Options.java
a56b833b662222bc5e98d74ad955ccdeabc6c451
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
nome-gruppo/lice-mybatis-3.5.0
5fee05a02a0f50a31d08ca8cfaae8e1faf4bbaeb
53a958092527fcd7490300f82a1e003599012ccd
refs/heads/master
2022-10-06T02:02:07.851836
2020-01-31T10:15:58
2020-01-31T10:15:58
233,382,740
0
0
Apache-2.0
2022-09-08T01:05:12
2020-01-12T11:37:49
Java
UTF-8
Java
false
false
1,984
java
/** * Copyright 2009-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.ibatis.mapping.ResultSetType; import org.apache.ibatis.mapping.StatementType; /** * @author Clinton Begin */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Options { /** * The options for the {@link Options#flushCache()}. * The default is {@link FlushCachePolicy#DEFAULT} */ enum FlushCachePolicy { /** <code>false</code> for select statement; <code>true</code> for insert/update/delete statement. */ DEFAULT, /** Flushes cache regardless of the statement type. */ TRUE, /** Does not flush cache regardless of the statement type. */ FALSE } boolean useCache() default true; FlushCachePolicy flushCache() default FlushCachePolicy.DEFAULT; ResultSetType resultSetType() default ResultSetType.DEFAULT; StatementType statementType() default StatementType.PREPARED; int fetchSize() default -1; int timeout() default -1; boolean useGeneratedKeys() default false; String keyProperty() default ""; String keyColumn() default ""; String resultSets() default ""; }
7c208f1fb2cdd1df0121ebf89481df923cea0749
5200b06c938b57c1e05fffe0159a08bdc2c1829d
/kodilla-exception/src/main/java/com/kodilla/exception/test/FirstChallenge.java
6aee1d4ec9126a4dc1427fae2adc737bc3c2b6d2
[]
no_license
MajaBrog/Maja-Brog-Kodilla-Java
396641740a5bfe571f445fac7f5ca56ccce5a613
712c56bb4f7bc8cbb1cc74cd17993787b03897b0
refs/heads/master
2020-07-14T21:33:22.451094
2020-04-13T08:50:59
2020-04-13T08:50:59
205,407,498
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.kodilla.exception.test; public class FirstChallenge { public double divide(double a, double b) throws ArithmeticException { if (b == 0) { throw new ArithmeticException(); } return a / b; } /** * This main can throw an ArithmeticException!!! * * @param args */ public static void main(String[] args) { FirstChallenge firstChallenge = new FirstChallenge(); try { double result = firstChallenge.divide(3, 0); System.out.println(result); } catch (ArithmeticException e) { System.out.println("You are trying to divide by 0"); } finally { System.out.println("the end"); } } }
d2eba4aad9390ad698726c537d7d6d6510c72ff4
c48e0f91390aa8316bae346284c493a4a118d622
/app/src/main/java/org/hisp/india/trackercapture/models/storage/RMapping.java
d2a5ab535047eaad5ea3d6e6d9a31c0f9ab58598
[]
no_license
hispindia/hi-android-tracker-capture
73b70bc9d016bbad5dc069ece2dd2c3f022dd19d
2c795194dc7e6ca5ae4e72ff362d6c4c754ea15a
refs/heads/master
2021-01-19T00:39:46.639919
2017-09-06T17:37:02
2017-09-06T17:37:02
87,198,471
0
0
null
null
null
null
UTF-8
Java
false
false
14,552
java
package org.hisp.india.trackercapture.models.storage; import org.hisp.india.trackercapture.models.base.Attribute; import org.hisp.india.trackercapture.models.base.DataElement; import org.hisp.india.trackercapture.models.base.Option; import org.hisp.india.trackercapture.models.base.OptionSet; import org.hisp.india.trackercapture.models.base.OrganizationUnit; import org.hisp.india.trackercapture.models.base.Program; import org.hisp.india.trackercapture.models.base.ProgramRule; import org.hisp.india.trackercapture.models.base.ProgramRuleAction; import org.hisp.india.trackercapture.models.base.ProgramRuleVariable; import org.hisp.india.trackercapture.models.base.ProgramTrackedEntityAttribute; import org.hisp.india.trackercapture.models.base.TrackedEntity; import org.hisp.india.trackercapture.models.base.TrackedEntityAttribute; import org.hisp.india.trackercapture.models.base.TrackedEntityInstance; import org.hisp.india.trackercapture.models.base.User; import org.hisp.india.trackercapture.models.response.ProgramStage; import org.hisp.india.trackercapture.models.response.ProgramStageDataElement; import java.util.ArrayList; import java.util.List; import io.realm.RealmList; /** * Created by nhancao on 4/16/17. */ public class RMapping { public static RUser from(User user) { RUser model = new RUser(); model.setId(user.getId()); model.setDisplayName(user.getDisplayName()); model.setEmail(user.getEmail()); model.setFirstName(user.getFirstName()); model.setName(user.getName()); model.setSurName(user.getSurName()); model.setOrganizationUnits(new RealmList<>()); for (OrganizationUnit organizationUnit : user.getOrganizationUnits()) { ROrganizationUnit item = from(organizationUnit); if (item != null) { model.getOrganizationUnits().add(item); } } return model; } public static ROrganizationUnit from(OrganizationUnit organizationUnit) { if (organizationUnit == null) return null; ROrganizationUnit model = new ROrganizationUnit(); model.setId(organizationUnit.getId()); model.setDisplayName(organizationUnit.getDisplayName()); model.setCode(organizationUnit.getCode()); model.setLevel(organizationUnit.getLevel()); model.setPrograms(new RealmList<>()); if (organizationUnit.getParent() != null) { model.setParent(organizationUnit.getParent().getId()); } if (organizationUnit.getPrograms() != null) { for (Program program : organizationUnit.getPrograms()) { RProgram item = from(program); if (item != null) { model.getPrograms().add(item); } } } return model; } public static RDataElement from(DataElement dataElement) { if (dataElement == null) return null; RDataElement model = new RDataElement(); model.setId(dataElement.getId()); model.setDisplayName(dataElement.getDisplayName()); model.setValueType(dataElement.getValueType()); model.setOptionSetValue(dataElement.isOptionSetValue()); model.setOptionSet(from(dataElement.getOptionSet())); return model; } public static RProgramStageDataElement from(ProgramStageDataElement programStageDataElement) { if (programStageDataElement == null) return null; RProgramStageDataElement model = new RProgramStageDataElement(); model.setId(programStageDataElement.getId()); model.setDisplayName(programStageDataElement.getDisplayName()); model.setDisplayInReports(programStageDataElement.isDisplayInReports()); model.setCompulsory(programStageDataElement.isCompulsory()); model.setAllowProvidedElsewhere(programStageDataElement.isAllowProvidedElsewhere()); model.setSortOrder(programStageDataElement.getSortOrder()); model.setAllowFutureDate(programStageDataElement.isAllowFutureDate()); model.setDataElement(from(programStageDataElement.getDataElement())); return model; } public static RProgramStage from(ProgramStage programStage) { if (programStage == null) return null; RProgramStage model = new RProgramStage(); model.setId(programStage.getId()); model.setDisplayName(programStage.getDisplayName()); model.setSortOrder(programStage.getSortOrder()); model.setMinDaysFromStart(programStage.getMinDaysFromStart()); model.setProgramStageDataElements(new RealmList<>()); if (programStage.getProgramStageDataElements() != null) { for (ProgramStageDataElement programStageDataElement : programStage.getProgramStageDataElements()) { RProgramStageDataElement item = from(programStageDataElement); if (item != null) { model.getProgramStageDataElements().add(item); } } } return model; } public static RProgramRuleVariable from(ProgramRuleVariable programRuleVariable) { if (programRuleVariable == null) return null; RProgramRuleVariable model = new RProgramRuleVariable(); model.setId(programRuleVariable.getId()); model.setDisplayName(programRuleVariable.getDisplayName()); return model; } public static ROption from(Option option) { if (option == null) return null; ROption model = new ROption(); model.setId(option.getId()); model.setCode(option.getCode()); model.setDisplayName(option.getDisplayName()); return model; } public static ROptionSet from(OptionSet optionSet) { if (optionSet == null) return null; ROptionSet model = new ROptionSet(); model.setId(optionSet.getId()); model.setDisplayName(optionSet.getDisplayName()); model.setValueType(optionSet.getValueType()); model.setOptions(new RealmList<>()); for (Option option : optionSet.getOptions()) { ROption item = from(option); if (item != null) { model.getOptions().add(item); } } return model; } public static RTrackedEntityAttribute from(TrackedEntityAttribute trackedEntityAttribute) { if (trackedEntityAttribute == null) return null; RTrackedEntityAttribute model = new RTrackedEntityAttribute(); model.setId(trackedEntityAttribute.getId()); model.setDisplayName(trackedEntityAttribute.getDisplayName()); model.setOptionSetValue(trackedEntityAttribute.isOptionSetValue()); ROptionSet optionSet = from(trackedEntityAttribute.getOptionSet()); if (optionSet != null) { model.setOptionSet(optionSet); } return model; } public static RProgramTrackedEntityAttribute from(ProgramTrackedEntityAttribute programTrackedEntityAttribute) { if (programTrackedEntityAttribute == null) return null; RProgramTrackedEntityAttribute model = new RProgramTrackedEntityAttribute(); model.setId(programTrackedEntityAttribute.getId()); model.setDisplayName(programTrackedEntityAttribute.getDisplayName()); model.setMandatory(programTrackedEntityAttribute.isMandatory()); model.setDisplayInList(programTrackedEntityAttribute.isDisplayInList()); model.setAllowFutureDate(programTrackedEntityAttribute.isAllowFutureDate()); model.setValueType(programTrackedEntityAttribute.getValueType()); RTrackedEntityAttribute trackedEntityAttribute = from( programTrackedEntityAttribute.getTrackedEntityAttribute()); if (trackedEntityAttribute != null) { model.setTrackedEntityAttribute(trackedEntityAttribute); } return model; } public static RProgramRuleAction from(ProgramRuleAction programRuleAction) { if (programRuleAction == null) return null; RProgramRuleAction model = new RProgramRuleAction(); model.setId(programRuleAction.getId()); model.setDisplayName(programRuleAction.getDisplayName()); model.setProgramRuleActionType(programRuleAction.getProgramRuleActionType()); return model; } public static RProgramRule from(ProgramRule programRule) { if (programRule == null) return null; RProgramRule model = new RProgramRule(); model.setId(programRule.getId()); model.setDisplayName(programRule.getDisplayName()); model.setCondition(programRule.getCondition()); model.setDescription(programRule.getDescription()); model.setProgramRuleActions(new RealmList<>()); if (programRule.getProgramRuleActions() != null) { for (ProgramRuleAction programRuleAction : programRule.getProgramRuleActions()) { RProgramRuleAction item = from(programRuleAction); if (item != null) { model.getProgramRuleActions().add(item); } } } return model; } public static RTrackedEntity from(TrackedEntity trackedEntity) { if (trackedEntity == null) return null; RTrackedEntity model = new RTrackedEntity(); model.setId(trackedEntity.getId()); model.setDisplayName(trackedEntity.getDisplayName()); return model; } public static RProgram from(Program program) { if (program == null) return null; RProgram model = new RProgram(); model.setId(program.getId()); model.setDisplayName(program.getDisplayName()); model.setWithoutRegistration(program.isWithoutRegistration()); model.setEnrollmentDateLabel(program.getEnrollmentDateLabel()); model.setIncidentDateLabel(program.getIncidentDateLabel()); model.setSelectEnrollmentDatesInFuture(program.isSelectEnrollmentDatesInFuture()); model.setSelectIncidentDatesInFuture(program.isSelectIncidentDatesInFuture()); model.setDisplayIncidentDate(program.isDisplayIncidentDate()); if (program.getTrackedEntity() != null) { model.setTrackedEntity(from(program.getTrackedEntity())); } model.setProgramStages(new RealmList<>()); model.setProgramRuleVariables(new RealmList<>()); model.setProgramRules(new RealmList<>()); model.setProgramTrackedEntityAttributes(new RealmList<>()); if (program.getProgramStages() != null) { for (ProgramStage programStage : program.getProgramStages()) { RProgramStage item = from(programStage); if (item != null) { model.getProgramStages().add(item); } } } if (program.getProgramRuleVariables() != null) { for (ProgramRuleVariable programRuleVariable : program.getProgramRuleVariables()) { RProgramRuleVariable item = from(programRuleVariable); if (item != null) { model.getProgramRuleVariables().add(item); } } } if (program.getProgramTrackedEntityAttributes() != null) { for (ProgramTrackedEntityAttribute programTrackedEntityAttribute : program .getProgramTrackedEntityAttributes()) { RProgramTrackedEntityAttribute item = from(programTrackedEntityAttribute); if (item != null) { model.getProgramTrackedEntityAttributes().add(item); } } } if (program.getProgramRules() != null) { for (ProgramRule programRule : program.getProgramRules()) { RProgramRule item = from(programRule); if (item != null) { model.getProgramRules().add(item); } } } return model; } public static RAttribute from(Attribute attribute) { if (attribute == null) return null; RAttribute model = new RAttribute(); model.setAttributeId(attribute.getAttributeId()); model.setDisplayName(attribute.getDisplayName()); model.setValue(attribute.getValue()); model.setValueType(attribute.getValueType()); return model; } public static Attribute from(RAttribute attribute) { if (attribute == null) return null; Attribute model = new Attribute(); model.setAttributeId(attribute.getAttributeId()); model.setDisplayName(attribute.getDisplayName()); model.setValue(attribute.getValue()); model.setValueType(attribute.getValueType()); return model; } public static RTrackedEntityInstance from(TrackedEntityInstance trackedEntityInstance) { if (trackedEntityInstance == null) return null; RTrackedEntityInstance model = new RTrackedEntityInstance(); model.setTrackedEntityInstanceId(trackedEntityInstance.getTrackedEntityInstanceId()); model.setTrackedEntityId(trackedEntityInstance.getTrackedEntityId()); model.setOrgUnitId(trackedEntityInstance.getOrgUnitId()); model.setProgramId(trackedEntityInstance.getProgramId()); RealmList<RAttribute> attributes = new RealmList<>(); if (trackedEntityInstance.getAttributeList() != null) { for (Attribute attribute : trackedEntityInstance.getAttributeList()) { if (attribute != null) attributes.add(from(attribute)); } } model.setAttributeList(attributes); return model; } public static TrackedEntityInstance from(RTrackedEntityInstance trackedEntityInstance) { if (trackedEntityInstance == null) return null; TrackedEntityInstance model = new TrackedEntityInstance(); model.setTrackedEntityInstanceId(trackedEntityInstance.getTrackedEntityInstanceId()); model.setTrackedEntityId(trackedEntityInstance.getTrackedEntityId()); model.setOrgUnitId(trackedEntityInstance.getOrgUnitId()); model.setProgramId(trackedEntityInstance.getProgramId()); List<Attribute> attributes = new ArrayList<>(); if (trackedEntityInstance.getAttributeList() != null) { for (RAttribute attribute : trackedEntityInstance.getAttributeList()) { if (attribute != null) attributes.add(from(attribute)); } } model.setAttributeList(attributes); return model; } }
3b29da8b009754409dde1a30edf9c0e09dbf67a5
187023134d97852f5a6ead9108a02f1708095468
/idei.parent/idei.entity/src/main/java/com/ideitegia/entity/client/model/Teacher.java
ab3aec2f41e1f8ad491611c7bb5b143dc67f8e8f
[]
no_license
ideitegia/apps
42dc2dc529550edfbeacaf8a9cae7ba1802928e2
b53d36b76bff48611e5c3d708d87ffc1a4710978
refs/heads/master
2021-01-23T20:50:08.680835
2014-07-31T21:20:40
2014-07-31T21:20:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
232
java
package com.ideitegia.entity.client.model; public class Teacher { private Person person; public Person getPerson() { return person; } public void setPerson(Person person) { this.person = person; } }
[ "eagirrezabal@a5e02eba-b892-4d49-8416-2aa2ae7277cf" ]
eagirrezabal@a5e02eba-b892-4d49-8416-2aa2ae7277cf
ac828642935661a40176c07e944cf0ca1413f66b
013a8093558110f5b518acdfb4a474f5807dadc6
/src/main/java/br/com/labormed/services/GrupoService.java
1f7d4b0410b2b3d9138f3a0a6ccaa2b7071f6eec
[]
no_license
paulonicolau/Labormed-web
f4549f9cb1b04459272705c628425e6b782ecc09
5dcc091fe26fc6440355781595d3cc7b8cefa3cf
refs/heads/master
2020-12-02T19:31:34.085046
2017-07-11T20:55:04
2017-07-11T20:55:04
96,355,099
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package br.com.labormed.services; import br.com.labormed.model.Grupo; public interface GrupoService extends Service<Grupo>{ }
5fc3682a0ebfa37914244cc4c93f2c6de492bfc7
7a153af83de97b052b82eed32847b4c3c5348024
/src/main/java/com/israelb/config/WebConfigurer.java
781ac1d0e0c4fe6afa5bc35033cb3cc97ecfeade
[]
no_license
israelberko/PlayingWithAngular
918255cc2336cbf8d1e0cd8a6bfae20c3fe12a5e
749c76fb45eb769b9cdf6798785e5cb8d28bf216
refs/heads/master
2020-04-01T05:09:14.379157
2018-10-13T18:49:23
2018-10-13T18:49:23
152,891,967
0
0
null
null
null
null
UTF-8
Java
false
false
8,850
java
package com.israelb.config; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.servlet.InstrumentedFilter; import com.codahale.metrics.servlets.MetricsServlet; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.config.h2.H2ConfigurationHelper; import io.github.jhipster.web.filter.CachingHttpHeadersFilter; import io.undertow.UndertowOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.boot.web.server.*; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.http.MediaType; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; import javax.servlet.*; import java.io.File; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.*; import static java.net.URLDecoder.decode; /** * Configuration of web application with Servlet 3.0 APIs. */ @Configuration public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> { private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); private final Environment env; private final JHipsterProperties jHipsterProperties; private MetricRegistry metricRegistry; public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) { this.env = env; this.jHipsterProperties = jHipsterProperties; } @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); initMetrics(servletContext, disps); if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) { initCachingHttpHeadersFilter(servletContext, disps); } if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) { initH2Console(servletContext); } log.info("Web application fully configured"); } /** * Customize the Servlet engine: Mime types, the document root, the cache. */ @Override public void customize(WebServerFactory server) { setMimeMappings(server); // When running in an IDE or with ./gradlew bootRun, set location of the static web assets. setLocationForStaticAssets(server); /* * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. * See the JHipsterProperties class and your application-*.yml configuration files * for more information. */ if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) && server instanceof UndertowServletWebServerFactory) { ((UndertowServletWebServerFactory) server) .addBuilderCustomizers(builder -> builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true)); } } private void setMimeMappings(WebServerFactory server) { if (server instanceof ConfigurableServletWebServerFactory) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase()); ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; servletWebServer.setMimeMappings(mappings); } } private void setLocationForStaticAssets(WebServerFactory server) { if (server instanceof ConfigurableServletWebServerFactory) { ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server; File root; String prefixPath = resolvePathPrefix(); root = new File(prefixPath + "build/www/"); if (root.exists() && root.isDirectory()) { servletWebServer.setDocumentRoot(root); } } } /** * Resolve path prefix to static resources. */ private String resolvePathPrefix() { String fullExecutablePath; try { fullExecutablePath = decode(this.getClass().getResource("").getPath(), StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { /* try without decoding if this ever happens */ fullExecutablePath = this.getClass().getResource("").getPath(); } String rootPath = Paths.get(".").toUri().normalize().getPath(); String extractedPath = fullExecutablePath.replace(rootPath, ""); int extractionEndIndex = extractedPath.indexOf("build/"); if (extractionEndIndex <= 0) { return ""; } return extractedPath.substring(0, extractionEndIndex); } /** * Initializes the caching HTTP Headers Filter. */ private void initCachingHttpHeadersFilter(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Registering Caching HTTP Headers Filter"); FilterRegistration.Dynamic cachingHttpHeadersFilter = servletContext.addFilter("cachingHttpHeadersFilter", new CachingHttpHeadersFilter(jHipsterProperties)); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/i18n/*"); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*"); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*"); cachingHttpHeadersFilter.setAsyncSupported(true); } /** * Initializes Metrics. */ private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Initializing Metrics registries"); servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, metricRegistry); servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, metricRegistry); log.debug("Registering Metrics Filter"); FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", new InstrumentedFilter()); metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); metricsFilter.setAsyncSupported(true); log.debug("Registering Metrics Servlet"); ServletRegistration.Dynamic metricsAdminServlet = servletContext.addServlet("metricsServlet", new MetricsServlet()); metricsAdminServlet.addMapping("/management/metrics/*"); metricsAdminServlet.setAsyncSupported(true); metricsAdminServlet.setLoadOnStartup(2); } @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConfiguration("/api/**", config); source.registerCorsConfiguration("/management/**", config); source.registerCorsConfiguration("/v2/api-docs", config); } return new CorsFilter(source); } /** * Initializes H2 console. */ private void initH2Console(ServletContext servletContext) { log.debug("Initialize H2 console"); H2ConfigurationHelper.initH2Console(servletContext); } @Autowired(required = false) public void setMetricRegistry(MetricRegistry metricRegistry) { this.metricRegistry = metricRegistry; } }
28115c66aa9e6847036d5ae35f3ae2375987c29e
a73b3d2389c0cd4c59626e03aee39e86f972439c
/src/main/java/id/web/fahmikudo/meeting/mom/model/Meeting.java
3ce4037d49a6789143294ad85583df395f73d3a2
[]
no_license
fahmikudo/application-MinutesofMeeting
be60ce12f235597216fb1036b1850d87327c7bbb
8957a84f0419fa577267f46c307da8a4d4adddd9
refs/heads/master
2020-04-03T15:13:54.889019
2019-01-17T13:05:49
2019-01-17T13:05:49
153,995,376
0
0
null
null
null
null
UTF-8
Java
false
false
1,626
java
package id.web.fahmikudo.meeting.mom.model; import com.fasterxml.jackson.annotation.*; import lombok.Data; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.List; @Entity @Table(name = "meeting") @Data public class Meeting implements Serializable { @Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") @Column(name = "id_meeting") private String id; @Column(nullable = false) private String agenda; @Column(nullable = false, name = "tanggal_waktu") @Temporal(TemporalType.TIMESTAMP) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") private Date tanggalWaktu; @Column(nullable = false) private String lokasi; @Column(nullable = false) private String kesimpulan; @ManyToOne(optional = false, fetch = FetchType.EAGER) @JoinColumn(name = "id_project", nullable = false) private Project project; @ManyToOne(optional = false, fetch = FetchType.EAGER) @JoinColumn(name = "id_user", nullable = false) private User users; @OneToMany(mappedBy = "meeting", orphanRemoval = true, fetch = FetchType.LAZY) @JsonIgnore private List<PokokBahasan> pokokBahasan; @OneToMany(mappedBy = "meeting", fetch = FetchType.LAZY, orphanRemoval = true) @JsonIgnore private List<DaftarPeserta> daftarPeserta; @OneToMany(mappedBy = "meeting", fetch = FetchType.LAZY, orphanRemoval = true) @JsonIgnore private List<Gallery> gallery; public Meeting() { } }
585f16e0c068ed87a5bef4ab16b8800037950fe4
1ac956b147122a39edef01c4738505d0e1b4e3f6
/src/main/java/com/status/service/UserService.java
9f78628fbfd74ed4253d76154902b42a35bb135f
[]
no_license
zhangzhiyu1994/statu
28d50d0d40f528042234383ba4e8234cda95eca2
b5939fd31765328a9c2be593a2bf7a55941b9f44
refs/heads/master
2023-04-27T16:55:10.779764
2021-05-18T02:21:48
2021-05-18T02:21:48
344,106,364
0
0
null
null
null
null
UTF-8
Java
false
false
794
java
package com.status.service; import com.status.common.AjaxResult; import com.status.model.entity.User; import com.status.model.request.LoginRequest; public interface UserService { AjaxResult login(LoginRequest user); /** * 验证根据手机号查询是否注册过 * @param phone 手机号 * @return 用户对象 */ User selectByPhone(User user); /** * 注册用户 * @param record 用户对象 * @return 成功返回1否则返回0 */ int insertSelective(User record); /** * 查询个人信息 * @param id * @return 用户对象 */ User selectByPrimaryKey(Integer id); /** * 修改个人信息 * @param user * @return 用户对象 */ int updateByPrimaryKey(User user); }
e2856f7f62c1b5b0537f6d3b4522d2b76605f54e
2b8c47031dddd10fede8bcf16f8db2b52521cb4f
/subject SPLs and test cases/BerkeleyDB(5)/BerkeleyDB_P2/src/com/sleepycat/je/dbi/DbTree.java
c78bceb18355e4e7abe63372b8181fcaa63cbfee
[]
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
26,278
java
package com.sleepycat.je.dbi; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseConfig; import com.sleepycat.je.DatabaseEntry; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.DatabaseNotFoundException; import com.sleepycat.je.DeadlockException; import com.sleepycat.je.OperationStatus; import com.sleepycat.je.TransactionConfig; import com.sleepycat.je.dbi.CursorImpl.SearchMode; import com.sleepycat.je.log.LogEntryType; import com.sleepycat.je.log.LogException; import com.sleepycat.je.log.LogReadable; import com.sleepycat.je.log.LogUtils; import com.sleepycat.je.log.LoggableObject; import com.sleepycat.je.tree.ChildReference; import com.sleepycat.je.tree.IN; import com.sleepycat.je.tree.LN; import com.sleepycat.je.tree.MapLN; import com.sleepycat.je.tree.NameLN; import com.sleepycat.je.tree.Tree; import com.sleepycat.je.tree.TreeUtils; import com.sleepycat.je.tree.WithRootLatched; import com.sleepycat.je.txn.AutoTxn; import com.sleepycat.je.txn.BasicLocker; import com.sleepycat.je.txn.LockType; import com.sleepycat.je.txn.Locker; import de.ovgu.cide.jakutil.*; public class DbTree implements LoggableObject, LogReadable { public static final DatabaseId ID_DB_ID=new DatabaseId(0); public static final DatabaseId NAME_DB_ID=new DatabaseId(1); public static final String ID_DB_NAME="_jeIdMap"; public static final String NAME_DB_NAME="_jeNameMap"; public static final String UTILIZATION_DB_NAME="_jeUtilization"; private static final String[] RESERVED_DB_NAMES={ID_DB_NAME,NAME_DB_NAME,UTILIZATION_DB_NAME}; private int lastAllocatedDbId; private DatabaseImpl idDatabase; private DatabaseImpl nameDatabase; private EnvironmentImpl envImpl; /** * Create a dbTree from the log. */ public DbTree() throws DatabaseException { this.envImpl=null; idDatabase=new DatabaseImpl(); idDatabase.setDebugDatabaseName(ID_DB_NAME); nameDatabase=new DatabaseImpl(); nameDatabase.setDebugDatabaseName(NAME_DB_NAME); } /** * Create a new dbTree for a new environment. */ public DbTree( EnvironmentImpl env) throws DatabaseException { this.envImpl=env; idDatabase=new DatabaseImpl(ID_DB_NAME,new DatabaseId(0),env,new DatabaseConfig()); nameDatabase=new DatabaseImpl(NAME_DB_NAME,new DatabaseId(1),env,new DatabaseConfig()); lastAllocatedDbId=1; } /** * Get the latest allocated id, for checkpoint info. */ public synchronized int getLastDbId(){ return lastAllocatedDbId; } /** * Get the next available database id. */ private synchronized int getNextDbId(){ return ++lastAllocatedDbId; } /** * Initialize the db id, from recovery. */ public synchronized void setLastDbId( int maxDbId){ lastAllocatedDbId=maxDbId; } private Locker createLocker( EnvironmentImpl envImpl) throws DatabaseException { if (envImpl.isNoLocking()) { return new BasicLocker(envImpl); } else { return new AutoTxn(envImpl,new TransactionConfig()); } } /** * Set the db environment during recovery, after instantiating the tree from * the log. */ void setEnvironmentImpl( EnvironmentImpl envImpl) throws DatabaseException { this.envImpl=envImpl; idDatabase.setEnvironmentImpl(envImpl); nameDatabase.setEnvironmentImpl(envImpl); } /** * Create a database. */ public synchronized DatabaseImpl createDb( Locker locker, String databaseName, DatabaseConfig dbConfig, Database databaseHandle) throws DatabaseException { return createDb(locker,databaseName,dbConfig,databaseHandle,true); } /** * Create a database. * @param lockerowning locker * @param databaseNameidentifier for database * @param dbConfig * @param allowEvictionis whether eviction is allowed during cursor operations. */ public synchronized DatabaseImpl createDb( Locker locker, String databaseName, DatabaseConfig dbConfig, Database databaseHandle, boolean allowEviction) throws DatabaseException { DatabaseId newId=new DatabaseId(getNextDbId()); DatabaseImpl newDb=new DatabaseImpl(databaseName,newId,envImpl,dbConfig); CursorImpl idCursor=null; CursorImpl nameCursor=null; boolean operationOk=false; Locker autoTxn=null; try { nameCursor=new CursorImpl(nameDatabase,locker); this.hook307(allowEviction,nameCursor); LN nameLN=new NameLN(newId); nameCursor.putLN(databaseName.getBytes("UTF-8"),nameLN,false); if (databaseHandle != null) { locker.addToHandleMaps(new Long(nameLN.getNodeId()),databaseHandle); } autoTxn=createLocker(envImpl); idCursor=new CursorImpl(idDatabase,autoTxn); this.hook306(allowEviction,idCursor); idCursor.putLN(newId.getBytes(),new MapLN(newDb),false); operationOk=true; } catch ( UnsupportedEncodingException UEE) { throw new DatabaseException(UEE); } finally { if (idCursor != null) { idCursor.close(); } if (nameCursor != null) { nameCursor.close(); } if (autoTxn != null) { autoTxn.operationEnd(operationOk); } } return newDb; } /** * Called by the Tree to propagate a root change. If the tree is a data * database, we will write the MapLn that represents this db to the log. If * the tree is one of the mapping dbs, we'll write the dbtree to the log. * @param dbthe target db */ public void modifyDbRoot( DatabaseImpl db) throws DatabaseException { if (db.getId().equals(ID_DB_ID) || db.getId().equals(NAME_DB_ID)) { envImpl.logMapTreeRoot(); } else { Locker locker=createLocker(envImpl); CursorImpl cursor=new CursorImpl(idDatabase,locker); boolean operationOk=false; try { DatabaseEntry keyDbt=new DatabaseEntry(db.getId().getBytes()); MapLN mapLN=null; while (true) { try { boolean searchOk=(cursor.searchAndPosition(keyDbt,new DatabaseEntry(),SearchMode.SET,LockType.WRITE) & CursorImpl.FOUND) != 0; if (!searchOk) { throw new DatabaseException("can't find database " + db.getId()); } mapLN=(MapLN)cursor.getCurrentLNAlreadyLatched(LockType.WRITE); assert mapLN != null; } catch ( DeadlockException DE) { cursor.close(); locker.operationEnd(false); locker=createLocker(envImpl); cursor=new CursorImpl(idDatabase,locker); continue; } finally { this.hook299(cursor); } break; } RewriteMapLN writeMapLN=new RewriteMapLN(cursor); mapLN.getDatabase().getTree().withRootLatchedExclusive(writeMapLN); operationOk=true; } finally { if (cursor != null) { cursor.close(); } locker.operationEnd(operationOk); } } } private static class RewriteMapLN implements WithRootLatched { private CursorImpl cursor; RewriteMapLN( CursorImpl cursor){ this.cursor=cursor; } public IN doWork( ChildReference root) throws DatabaseException { DatabaseEntry dataDbt=new DatabaseEntry(new byte[0]); cursor.putCurrent(dataDbt,null,null); return null; } } private NameLockResult lockNameLN( Locker locker, String databaseName, String action) throws DatabaseException { NameLockResult result=new NameLockResult(); result.dbImpl=getDb(locker,databaseName,null); if (result.dbImpl == null) { throw new DatabaseNotFoundException("Attempted to " + action + " non-existent database "+ databaseName); } result.nameCursor=new CursorImpl(nameDatabase,locker); try { DatabaseEntry key=new DatabaseEntry(databaseName.getBytes("UTF-8")); boolean found=(result.nameCursor.searchAndPosition(key,null,SearchMode.SET,LockType.WRITE) & CursorImpl.FOUND) != 0; if (!found) { this.hook300(result); result.nameCursor.close(); result.nameCursor=null; return result; } result.nameLN=(NameLN)result.nameCursor.getCurrentLNAlreadyLatched(LockType.WRITE); assert result.nameLN != null; int handleCount=result.dbImpl.getReferringHandleCount(); if (handleCount > 0) { throw new DatabaseException("Can't " + action + " database "+ databaseName+ ","+ handleCount+ " open Dbs exist"); } } catch ( UnsupportedEncodingException UEE) { this.hook301(result); result.nameCursor.close(); throw new DatabaseException(UEE); } catch ( DatabaseException e) { this.hook302(result); result.nameCursor.close(); throw e; } return result; } private static class NameLockResult { CursorImpl nameCursor; DatabaseImpl dbImpl; NameLN nameLN; } void deleteMapLN( DatabaseId id) throws DatabaseException { Locker autoTxn=null; boolean operationOk=false; CursorImpl idCursor=null; try { autoTxn=createLocker(envImpl); idCursor=new CursorImpl(idDatabase,autoTxn); boolean found=(idCursor.searchAndPosition(new DatabaseEntry(id.getBytes()),null,SearchMode.SET,LockType.WRITE) & CursorImpl.FOUND) != 0; if (found) { idCursor.delete(); } operationOk=true; } finally { if (idCursor != null) { idCursor.close(); } if (autoTxn != null) { autoTxn.operationEnd(operationOk); } } } /** * Get a database object given a database name. */ public DatabaseImpl getDb( Locker nameLocker, String databaseName, Database databaseHandle) throws DatabaseException { return getDb(nameLocker,databaseName,databaseHandle,true); } /** * Get a database object given a database name. * @param nameLockeris used to access the NameLN. As always, a NullTxn is used to * access the MapLN. * @param databaseNametarget database * @return null if database doesn't exist * @param allowEvictionis whether eviction is allowed during cursor operations. */ public DatabaseImpl getDb( Locker nameLocker, String databaseName, Database databaseHandle, boolean allowEviction) throws DatabaseException { try { CursorImpl nameCursor=null; DatabaseId id=null; try { nameCursor=new CursorImpl(nameDatabase,nameLocker); this.hook308(allowEviction,nameCursor); DatabaseEntry keyDbt=new DatabaseEntry(databaseName.getBytes("UTF-8")); boolean found=(nameCursor.searchAndPosition(keyDbt,null,SearchMode.SET,LockType.READ) & CursorImpl.FOUND) != 0; if (found) { NameLN nameLN=(NameLN)nameCursor.getCurrentLNAlreadyLatched(LockType.READ); assert nameLN != null; id=nameLN.getId(); if (databaseHandle != null) { nameLocker.addToHandleMaps(new Long(nameLN.getNodeId()),databaseHandle); } } } finally { if (nameCursor != null) { this.hook303(nameCursor); nameCursor.close(); } } if (id == null) { return null; } else { return getDb(id,-1,allowEviction,databaseName); } } catch ( UnsupportedEncodingException UEE) { throw new DatabaseException(UEE); } } /** * Get a database object based on an id only. Used by recovery, cleaning and * other clients who have an id in hand, and don't have a resident node, to * find the matching database for a given log entry. */ public DatabaseImpl getDb( DatabaseId dbId) throws DatabaseException { return getDb(dbId,-1); } /** * Get a database object based on an id only. Specify the lock timeout to * use, or -1 to use the default timeout. A timeout should normally only be * specified by daemons with their own timeout configuration. public for * unit tests. */ public DatabaseImpl getDb( DatabaseId dbId, long lockTimeout) throws DatabaseException { return getDb(dbId,lockTimeout,true,null); } /** * Get a database object based on an id only, caching the id-db mapping in * the given map. */ public DatabaseImpl getDb( DatabaseId dbId, long lockTimeout, Map dbCache) throws DatabaseException { if (dbCache.containsKey(dbId)) { return (DatabaseImpl)dbCache.get(dbId); } else { DatabaseImpl db=getDb(dbId,lockTimeout,true,null); dbCache.put(dbId,db); return db; } } /** * Get a database object based on an id only. Specify the lock timeout to * use, or -1 to use the default timeout. A timeout should normally only be * specified by daemons with their own timeout configuration. public for * unit tests. * @param allowEvictionis whether eviction is allowed during cursor operations. */ public DatabaseImpl getDb( DatabaseId dbId, long lockTimeout, boolean allowEviction, String dbNameIfAvailable) throws DatabaseException { if (dbId.equals(idDatabase.getId())) { return idDatabase; } else if (dbId.equals(nameDatabase.getId())) { return nameDatabase; } else { Locker locker=new BasicLocker(envImpl); if (lockTimeout != -1) { locker.setLockTimeout(lockTimeout); } CursorImpl idCursor=null; DatabaseImpl foundDbImpl=null; while (true) { idCursor=new CursorImpl(idDatabase,locker); this.hook309(allowEviction,idCursor); try { DatabaseEntry keyDbt=new DatabaseEntry(dbId.getBytes()); boolean found=(idCursor.searchAndPosition(keyDbt,new DatabaseEntry(),SearchMode.SET,LockType.READ) & CursorImpl.FOUND) != 0; if (found) { MapLN mapLN=(MapLN)idCursor.getCurrentLNAlreadyLatched(LockType.READ); assert mapLN != null; foundDbImpl=mapLN.getDatabase(); } break; } catch ( DeadlockException DE) { idCursor.close(); locker.operationEnd(false); locker=new BasicLocker(envImpl); if (lockTimeout != -1) { locker.setLockTimeout(lockTimeout); } idCursor=new CursorImpl(idDatabase,locker); this.hook310(allowEviction,idCursor); continue; } finally { this.hook304(idCursor); idCursor.close(); locker.operationEnd(true); } } if (envImpl.isOpen()) { setDebugNameForDatabaseImpl(foundDbImpl,dbNameIfAvailable); } return foundDbImpl; } } private void setDebugNameForDatabaseImpl( DatabaseImpl dbImpl, String dbName) throws DatabaseException { if (dbImpl != null) { if (dbName != null) { dbImpl.setDebugDatabaseName(dbName); } else if (dbImpl.getDebugName() == null) { dbImpl.setDebugDatabaseName(getDbName(dbImpl.getId())); } } } /** * Rebuild the IN list after recovery. */ public void rebuildINListMapDb() throws DatabaseException { idDatabase.getTree().rebuildINList(); } /** * Return the database name for a given db. Slow, must traverse. Used by * truncate and for debugging. */ public String getDbName( DatabaseId id) throws DatabaseException { if (id.equals(ID_DB_ID)) { return ID_DB_NAME; } else if (id.equals(NAME_DB_ID)) { return NAME_DB_NAME; } Locker locker=null; CursorImpl cursor=null; try { locker=new BasicLocker(envImpl); cursor=new CursorImpl(nameDatabase,locker); DatabaseEntry keyDbt=new DatabaseEntry(); DatabaseEntry dataDbt=new DatabaseEntry(); String name=null; if (cursor.positionFirstOrLast(true,null)) { OperationStatus status=cursor.getCurrentAlreadyLatched(keyDbt,dataDbt,LockType.NONE,true); do { if (status == OperationStatus.SUCCESS) { NameLN nameLN=(NameLN)cursor.getCurrentLN(LockType.NONE); if (nameLN != null && nameLN.getId().equals(id)) { name=new String(keyDbt.getData(),"UTF-8"); break; } } status=cursor.getNext(keyDbt,dataDbt,LockType.NONE,true,false); } while (status == OperationStatus.SUCCESS); } return name; } catch ( UnsupportedEncodingException UEE) { throw new DatabaseException(UEE); } finally { if (cursor != null) { this.hook305(cursor); cursor.close(); } if (locker != null) { locker.operationEnd(); } } } /** * @return a list of database names held in the environment, as strings. */ public List getDbNames() throws DatabaseException { List nameList=new ArrayList(); Locker locker=null; CursorImpl cursor=null; try { locker=new BasicLocker(envImpl); cursor=new CursorImpl(nameDatabase,locker); DatabaseEntry keyDbt=new DatabaseEntry(); DatabaseEntry dataDbt=new DatabaseEntry(); if (cursor.positionFirstOrLast(true,null)) { OperationStatus status=cursor.getCurrentAlreadyLatched(keyDbt,dataDbt,LockType.READ,true); do { if (status == OperationStatus.SUCCESS) { String name=new String(keyDbt.getData(),"UTF-8"); if (!isReservedDbName(name)) { nameList.add(name); } } status=cursor.getNext(keyDbt,dataDbt,LockType.READ,true,false); } while (status == OperationStatus.SUCCESS); } return nameList; } catch ( UnsupportedEncodingException UEE) { throw new DatabaseException(UEE); } finally { if (cursor != null) { cursor.close(); } if (locker != null) { locker.operationEnd(); } } } /** * Returns true if the name is a reserved JE database name. */ public boolean isReservedDbName( String name){ for (int i=0; i < RESERVED_DB_NAMES.length; i+=1) { if (RESERVED_DB_NAMES[i].equals(name)) { return true; } } return false; } /** * @return the higest level node in the environment. */ public int getHighestLevel() throws DatabaseException { RootLevel getLevel=new RootLevel(idDatabase); idDatabase.getTree().withRootLatchedShared(getLevel); int idHighLevel=getLevel.getRootLevel(); getLevel=new RootLevel(nameDatabase); nameDatabase.getTree().withRootLatchedShared(getLevel); int nameHighLevel=getLevel.getRootLevel(); return (nameHighLevel > idHighLevel) ? nameHighLevel : idHighLevel; } private static class RootLevel implements WithRootLatched { private DatabaseImpl db; private int rootLevel; RootLevel( DatabaseImpl db){ this.db=db; rootLevel=0; } public IN doWork( ChildReference root) throws DatabaseException { IN rootIN=(IN)root.fetchTarget(db,null); rootLevel=rootIN.getLevel(); return null; } int getRootLevel(){ return rootLevel; } } /** * @see LoggableObject#getLogType */ public LogEntryType getLogType(){ return LogEntryType.LOG_ROOT; } /** * @see LoggableObject#marshallOutsideWriteLatch Can be marshalled outside * the log write latch. */ public boolean marshallOutsideWriteLatch(){ return true; } /** * @see LoggableObject#countAsObsoleteWhenLogged */ public boolean countAsObsoleteWhenLogged(){ return false; } /** * @see LoggableObject#getLogSize */ public int getLogSize(){ return LogUtils.getIntLogSize() + idDatabase.getLogSize() + nameDatabase.getLogSize(); } /** * @see LoggableObject#writeToLog */ public void writeToLog( ByteBuffer logBuffer){ LogUtils.writeInt(logBuffer,lastAllocatedDbId); idDatabase.writeToLog(logBuffer); nameDatabase.writeToLog(logBuffer); } /** * @see LoggableObject#postLogWork */ public void postLogWork( long justLoggedLsn) throws DatabaseException { } /** * @see LogReadable#readFromLog */ public void readFromLog( ByteBuffer itemBuffer, byte entryTypeVersion) throws LogException { lastAllocatedDbId=LogUtils.readInt(itemBuffer); idDatabase.readFromLog(itemBuffer,entryTypeVersion); nameDatabase.readFromLog(itemBuffer,entryTypeVersion); } /** * @see LogReadable#dumpLog */ public void dumpLog( StringBuffer sb, boolean verbose){ sb.append("<dbtree lastId = \""); sb.append(lastAllocatedDbId); sb.append("\">"); sb.append("<idDb>"); idDatabase.dumpLog(sb,verbose); sb.append("</idDb><nameDb>"); nameDatabase.dumpLog(sb,verbose); sb.append("</nameDb>"); sb.append("</dbtree>"); } /** * @see LogReadable#logEntryIsTransactional. */ public boolean logEntryIsTransactional(){ return false; } /** * @see LogReadable#getTransactionId */ public long getTransactionId(){ return 0; } String dumpString( int nSpaces){ StringBuffer self=new StringBuffer(); self.append(TreeUtils.indent(nSpaces)); self.append("<dbTree lastDbId =\""); self.append(lastAllocatedDbId); self.append("\">"); self.append('\n'); self.append(idDatabase.dumpString(nSpaces + 1)); self.append('\n'); self.append(nameDatabase.dumpString(nSpaces + 1)); self.append('\n'); self.append("</dbtree>"); return self.toString(); } public String toString(){ return dumpString(0); } /** * For debugging. */ public void dump() throws DatabaseException { idDatabase.getTree().dump(); nameDatabase.getTree().dump(); } private void hook299__wrappee__base ( CursorImpl cursor) throws DatabaseException { } protected void hook299( CursorImpl cursor) throws DatabaseException { cursor.releaseBINs(); hook299__wrappee__base(cursor); } private void hook300__wrappee__base ( NameLockResult result) throws DatabaseException, UnsupportedEncodingException { } protected void hook300( NameLockResult result) throws DatabaseException, UnsupportedEncodingException { result.nameCursor.releaseBIN(); hook300__wrappee__base(result); } private void hook301__wrappee__base ( NameLockResult result) throws DatabaseException { } protected void hook301( NameLockResult result) throws DatabaseException { result.nameCursor.releaseBIN(); hook301__wrappee__base(result); } private void hook302__wrappee__base ( NameLockResult result) throws DatabaseException { } protected void hook302( NameLockResult result) throws DatabaseException { result.nameCursor.releaseBIN(); hook302__wrappee__base(result); } private void hook303__wrappee__base ( CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { } protected void hook303( CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { nameCursor.releaseBIN(); hook303__wrappee__base(nameCursor); } private void hook304__wrappee__base ( CursorImpl idCursor) throws DatabaseException { } protected void hook304( CursorImpl idCursor) throws DatabaseException { idCursor.releaseBIN(); hook304__wrappee__base(idCursor); } private void hook305__wrappee__base ( CursorImpl cursor) throws DatabaseException { } protected void hook305( CursorImpl cursor) throws DatabaseException { cursor.releaseBINs(); hook305__wrappee__base(cursor); } private void hook306__wrappee__base ( boolean allowEviction, CursorImpl idCursor) throws DatabaseException, UnsupportedEncodingException { } protected void hook306( boolean allowEviction, CursorImpl idCursor) throws DatabaseException, UnsupportedEncodingException { idCursor.setAllowEviction(allowEviction); hook306__wrappee__base(allowEviction,idCursor); } private void hook307__wrappee__base ( boolean allowEviction, CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { } protected void hook307( boolean allowEviction, CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { nameCursor.setAllowEviction(allowEviction); hook307__wrappee__base(allowEviction,nameCursor); } private void hook308__wrappee__base ( boolean allowEviction, CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { } protected void hook308( boolean allowEviction, CursorImpl nameCursor) throws DatabaseException, UnsupportedEncodingException { nameCursor.setAllowEviction(allowEviction); hook308__wrappee__base(allowEviction,nameCursor); } private void hook309__wrappee__base ( boolean allowEviction, CursorImpl idCursor) throws DatabaseException { } protected void hook309( boolean allowEviction, CursorImpl idCursor) throws DatabaseException { idCursor.setAllowEviction(allowEviction); hook309__wrappee__base(allowEviction,idCursor); } private void hook310__wrappee__base ( boolean allowEviction, CursorImpl idCursor) throws DatabaseException { } protected void hook310( boolean allowEviction, CursorImpl idCursor) throws DatabaseException { idCursor.setAllowEviction(allowEviction); hook310__wrappee__base(allowEviction,idCursor); } /** * Remove the database by deleting the nameLN. */ void dbRemove( Locker locker, String databaseName) throws DatabaseException { CursorImpl nameCursor=null; try { NameLockResult result=lockNameLN(locker,databaseName,"remove"); nameCursor=result.nameCursor; if (nameCursor == null) { return; } else { nameCursor.delete(); locker.markDeleteAtTxnEnd(result.dbImpl,true); } } finally { if (nameCursor != null) { this.hook293(nameCursor); nameCursor.close(); } } } private void hook293__wrappee__DeleteOp ( CursorImpl nameCursor) throws DatabaseException { } protected void hook293( CursorImpl nameCursor) throws DatabaseException { nameCursor.releaseBIN(); hook293__wrappee__DeleteOp(nameCursor); } }
1b580938a510fbff8321fab8e1cdfc06e12187f2
fd96523e4d3576534374f1afc40ac66c470c1047
/src/main/java/com/matang28/restsqlexporter/Application.java
8827576d613af7048d0c1c881d12433c1a54f5d5
[]
no_license
matang28/rest-sql-exporter
23a2830435defc9abd88d4af7137bd3bc34509da
352c0207b9a8f00defbefd55adb7fedb82b61ce3
refs/heads/master
2020-04-16T19:31:01.093667
2019-01-15T14:16:45
2019-01-15T14:16:45
165,862,845
0
0
null
null
null
null
UTF-8
Java
false
false
519
java
package com.matang28.restsqlexporter; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan public class Application { public static void main(String[] args){ //Run the spring application: ApplicationContext context = SpringApplication.run(Application.class, args); } }
153bfd4db1358bec0c2fed734b889076452fe6f1
ee88816c21027d824e68aff3ebf4eaa75a2a8f6d
/src/main/java/net/prosavage/savageenchants/utils/nbt/NBTEntity.java
878ae54a5371950c73610a84e26c8d3902369027
[]
no_license
PorkSkulls/SavageEnchants
2c50de6e5a5572367c9c9241caa2c756f1b4a66a
09ea9453076ac8497ab0dfb48c0384b0fbcfcbe4
refs/heads/master
2021-10-09T06:51:12.232885
2018-12-23T01:45:23
2018-12-23T01:45:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
package net.prosavage.savageenchants.utils.nbt; import org.bukkit.entity.Entity; public class NBTEntity extends NBTCompound { private final Entity ent; public NBTEntity(Entity entity) { super(null, null); ent = entity; } protected Object getCompound() { return NBTReflectionUtil.getEntityNBTTagCompound(NBTReflectionUtil.getNMSEntity(ent)); } protected void setCompound(Object compound) { NBTReflectionUtil.setEntityNBTTag(compound, NBTReflectionUtil.getNMSEntity(ent)); } }
32f118d733b812c764da32c2890aa3fd755ad4a4
a31f2c8d77d0ff62b3939830f17199985ba90ebd
/generator.client.angular2/src/main/java/com/bbva/kltt/apirest/generator/client/angular2/output/language/OutputLanguageParametersClientAngular2.java
0fbc81dfa3e023b1fad9aa844834602a073bebad
[ "Apache-2.0" ]
permissive
pakkk/APIRestGenerator
ed22281731a5f1cce9e590d23c316f18e509b1ed
f3b28638b1d9ed98145bdd47c425cf5ac970941f
refs/heads/master
2023-03-20T23:28:22.433315
2017-06-15T15:06:32
2017-06-15T15:06:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,973
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 com.bbva.kltt.apirest.generator.client.angular2.output.language; import java.util.List; import com.bbva.kltt.apirest.core.generator.output.language.IOutputLanguageItems; import com.bbva.kltt.apirest.core.generator.output.parameters.OutputParameter; import com.bbva.kltt.apirest.core.generator.output.parameters.OutputParameters; import com.bbva.kltt.apirest.core.parsed_info.ParsedInfoHandler; import com.bbva.kltt.apirest.core.parsed_info.parameters.Parameter; import com.bbva.kltt.apirest.generator.client.angular2.output.parameters.OutputParameterClientAngular2; import com.bbva.kltt.apirest.generator.client.angular2.output.parameters.OutputParametersClientAngular2; import com.bbva.kltt.apirest.generator.client.web.output.language.OutputLanguageParametersClientWeb; /** * ------------------------------------------------ * @author Francisco Manuel Benitez Chico * ------------------------------------------------ */ public class OutputLanguageParametersClientAngular2 extends OutputLanguageParametersClientWeb { /** Attribute - IOutputLanguageItems */ private final IOutputLanguageItems outputLanguageItems ; /** * Public constructor * @param parsedInfoHandler with the parsed information handler */ public OutputLanguageParametersClientAngular2(final ParsedInfoHandler parsedInfoHandler) { super(parsedInfoHandler, new OutputLanguageSeparatorsClientAngular2()) ; this.outputLanguageItems = new OutputLanguageItemsClientAngular2(parsedInfoHandler) ; } @Override public OutputParameters createNewOutputParameters(final List<OutputParameter> outputParamList) { return new OutputParametersClientAngular2(this.getOutputLangSeparators(), outputParamList) ; } @Override public OutputParameter createNewOutputParameter(final Parameter parameter) { final String type = this.outputLanguageItems.getFullTypeOutput(parameter.getItem()) ; return new OutputParameterClientAngular2(parameter.getItem(), parameter.getDescription(), type, parameter.getName(), parameter.isAutoInjected()) ; } }