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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4d574579946ebde294abe4d4a5b56bb61f75776f | 9a11d356ed1da9c4c6a8c7e66321a7fcf459c3fb | /app/src/main/java/com/gh/newtools/utils/EmptyUtils.java | fd0fa1e73b3fd88098f80d4000559dcac9d920ff | [] | no_license | yezizaiqiutian/NewTools | c203d8109578d717b7cf5ba8fcc62abc5808d404 | 19ce3f7d8f7ada4281375ea280b0293a6d141d3b | refs/heads/master | 2020-05-31T23:02:03.776300 | 2017-09-27T07:22:46 | 2017-09-27T07:22:46 | 94,051,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package com.gh.newtools.utils;
import android.text.TextUtils;
/**
* author: gh
* time: 2017/6/9.
* description:字符串判空工具
*/
public class EmptyUtils {
/**
* 判断String是否为空
* 当为null,设置为""
* @param string
* @return
*/
public static String EmptyString(String string) {
return TextUtils.isEmpty(string) ? "" : string;
}
/**
* 判断String是否为空
* 当为null,设置为temp
* @param string
* @param temp
* @return
*/
public static String EmptyString(String string,String temp) {
return TextUtils.isEmpty(string) ? temp : string;
}
}
| [
"15652919252@163.com"
] | 15652919252@163.com |
735d00bd3592b9dfd8b5f144898234c353d95f70 | 6ec6e88a344b4dfe206069ca724171e0501a3e8a | /src/main/java/eden/sun/supermarketmanager/App.java | 1fad9b9b1d7bf74fa73399437e75a3dcbf9f2b12 | [] | no_license | EdenSun/SupermarketManager | b05a77c0c48d499ccd3724daed3e8df70d40e6e6 | b39b6bf18f55c6579a9d5ff43efcaa1f77ae2086 | refs/heads/master | 2019-01-02T01:46:08.700118 | 2014-08-28T15:22:58 | 2014-08-28T15:22:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package eden.sun.supermarketmanager;
import java.io.File;
import org.apache.catalina.startup.Tomcat;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )throws Exception
{
String PROJECT_PATH = System.getProperty("user.dir");
String CATALINA_HOME = PROJECT_PATH + "/embedded/tomcat";
String webappDirLocation = "src/main/webapp/";
Tomcat tomcat = new Tomcat();
//The port that we should run on can be set into an environment variable
//Look for that variable and default to 8080 if it isn't there.
String webPort = System.getenv("PORT");
if(webPort == null || webPort.isEmpty()) {
webPort = "8080";
}
tomcat.setPort(Integer.valueOf(webPort));
tomcat.setBaseDir(CATALINA_HOME);
tomcat.addWebapp("/", new File(webappDirLocation).getAbsolutePath());
System.out.println("configuring app with basedir: " + new File("./" + webappDirLocation).getAbsolutePath());
tomcat.start();
tomcat.getServer().await();
}
}
| [
"durian.suen@gmail.com"
] | durian.suen@gmail.com |
85e5b873aeb0e77263c931a20745f7000b7236a5 | 32dc7c81dc56c19d1a98ce8c67adf44528c58b76 | /app/src/main/java/com/example/abhijeetbiswas/kumbhdarshan/About.java | eb905a474e6a22e3e08ea49b427f1313629611d0 | [] | no_license | satish1872/KumbhDarshan | f386ddf86de47e42adbd97e31ab8e7e2dba24f24 | 945ff8e56fc5ce963e3ecd35e2ecaa802721cc83 | refs/heads/master | 2020-03-29T10:19:21.715516 | 2018-09-21T12:14:26 | 2018-09-21T12:14:26 | 149,799,116 | 1 | 0 | null | 2018-09-21T17:56:22 | 2018-09-21T17:56:22 | null | UTF-8 | Java | false | false | 3,588 | java | package com.example.abhijeetbiswas.kumbhdarshan;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link About.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link About#newInstance} factory method to
* create an instance of this fragment.
*/
public class About extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
/* private String mParam1;
private String mParam2;
private OnFragmentInteractionListener mListener;
public About() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment About.
*/
// TODO: Rename and change types and number of parameters
/* public static About newInstance(String param1, String param2) {
About fragment = new About();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_about, container, false);
}
// TODO: Rename method, update argument and hook method into UI event
/* public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
mListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
/*public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}*/
}
| [
"mpsabhijeet@gmail.com"
] | mpsabhijeet@gmail.com |
58b7ed50fe0808d6d88e263a48c220325f6e8158 | 881bf8a8e4cc1ea2039fd03f1102001f01db5c79 | /core/src/main/java/com/madhouse/platform/premiummad/entity/ReportPolicyCsv.java | 6923800dad88442bea18f322a8e71e7849420689 | [] | no_license | romanticstxj/service | c085d83570613296c734d6273ee6876246d36abb | a7f0ccfb51c91b5cabee10cbbf2bd1526d40c21f | refs/heads/feature_4.3.1_4491 | 2023-01-08T12:27:30.112902 | 2019-12-24T10:01:01 | 2019-12-24T10:01:01 | 120,257,464 | 0 | 1 | null | 2022-12-16T04:49:09 | 2018-02-05T05:06:08 | Java | UTF-8 | Java | false | false | 7,475 | java | package com.madhouse.platform.premiummad.entity;
import java.util.Date;
import com.madhouse.platform.premiummad.annotation.CsvColumn;
public class ReportPolicyCsv{
private Integer id;
private Integer policyId;
@CsvColumn(title="Deal ID")
private Integer policyDealId;
@CsvColumn(title="流量策略名称")
private String policyName;
private Integer policyType; //策略类型
@CsvColumn(title="交易模式")
private String policyTypeName; //策略类型名称(1: PDB, 2: PD, 4: PMP, 8: RTB)
private Integer dspId;
@CsvColumn(title="需求方")
private String dspName;
private Integer mediaId;
@CsvColumn(title="媒体")
private String mediaName;
private Integer adspaceId;
@CsvColumn(title="广告位")
private String adspaceName;
private Integer carrier; //运营商code
private Integer conn; //联网方式code
private Integer device; //设备类型code
private String location; //地域列
@CsvColumn(title="城市")
private String cityName;
@CsvColumn(title="省份")
private String provinceName;
@CsvColumn(title="国家")
private String countryName;
@CsvColumn(title="小时")
private Byte hour;
private Date date;
@CsvColumn(title="日期")
private String dateStr;
@CsvColumn(title="请求数")
private Long reqs;
@CsvColumn(title="填充数")
private Long bids;
@CsvColumn(title="超时数")
private Long timeouts;
@CsvColumn(title="错误数")
private Long errs;
@CsvColumn(title="赢得竞价数")
private Long wins;
@CsvColumn(title="曝光数")
private Long imps;
@CsvColumn(title="点击数")
private Long clks;
@CsvColumn(title="有效曝光数")
private Long vimps;
@CsvColumn(title="有效点击数")
private Long vclks;
private Double income;
private Double cost;
@CsvColumn(title="填充率")
private String bidsRateStr;
@CsvColumn(title="点击率")
private String vclksRateStr;
@CsvColumn(title="媒体收入")
private String incomeStr;
@CsvColumn(title="需求方花费")
private String costStr;
@CsvColumn(title="差价")
private String priceDiffStr;
@CsvColumn(title="利润率")
private String profitRateStr;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getPolicyId() {
return policyId;
}
public void setPolicyId(Integer policyId) {
this.policyId = policyId;
}
public Integer getPolicyDealId() {
return policyDealId;
}
public void setPolicyDealId(Integer policyDealId) {
this.policyDealId = policyDealId;
}
public String getPolicyName() {
return policyName;
}
public void setPolicyName(String policyName) {
this.policyName = policyName;
}
public Integer getPolicyType() {
return policyType;
}
public void setPolicyType(Integer policyType) {
this.policyType = policyType;
}
public String getPolicyTypeName() {
return policyTypeName;
}
public void setPolicyTypeName(String policyTypeName) {
this.policyTypeName = policyTypeName;
}
public Integer getDspId() {
return dspId;
}
public void setDspId(Integer dspId) {
this.dspId = dspId;
}
public String getDspName() {
return dspName;
}
public void setDspName(String dspName) {
this.dspName = dspName;
}
public Integer getMediaId() {
return mediaId;
}
public void setMediaId(Integer mediaId) {
this.mediaId = mediaId;
}
public String getMediaName() {
return mediaName;
}
public void setMediaName(String mediaName) {
this.mediaName = mediaName;
}
public Integer getAdspaceId() {
return adspaceId;
}
public void setAdspaceId(Integer adspaceId) {
this.adspaceId = adspaceId;
}
public String getAdspaceName() {
return adspaceName;
}
public void setAdspaceName(String adspaceName) {
this.adspaceName = adspaceName;
}
public Integer getCarrier() {
return carrier;
}
public void setCarrier(Integer carrier) {
this.carrier = carrier;
}
public Integer getConn() {
return conn;
}
public void setConn(Integer conn) {
this.conn = conn;
}
public Integer getDevice() {
return device;
}
public void setDevice(Integer device) {
this.device = device;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCountryName() {
return countryName;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
}
public Byte getHour() {
return hour;
}
public void setHour(Byte hour) {
this.hour = hour;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getDateStr() {
return dateStr;
}
public void setDateStr(String dateStr) {
this.dateStr = dateStr;
}
public Long getReqs() {
return reqs;
}
public void setReqs(Long reqs) {
this.reqs = reqs;
}
public Long getBids() {
return bids;
}
public void setBids(Long bids) {
this.bids = bids;
}
public Long getTimeouts() {
return timeouts;
}
public void setTimeouts(Long timeouts) {
this.timeouts = timeouts;
}
public Long getErrs() {
return errs;
}
public void setErrs(Long errs) {
this.errs = errs;
}
public Long getWins() {
return wins;
}
public void setWins(Long wins) {
this.wins = wins;
}
public Long getImps() {
return imps;
}
public void setImps(Long imps) {
this.imps = imps;
}
public Long getClks() {
return clks;
}
public void setClks(Long clks) {
this.clks = clks;
}
public Long getVimps() {
return vimps;
}
public void setVimps(Long vimps) {
this.vimps = vimps;
}
public Long getVclks() {
return vclks;
}
public void setVclks(Long vclks) {
this.vclks = vclks;
}
public Double getIncome() {
return income;
}
public void setIncome(Double income) {
this.income = income;
}
public Double getCost() {
return cost;
}
public void setCost(Double cost) {
this.cost = cost;
}
public String getBidsRateStr() {
return bidsRateStr;
}
public void setBidsRateStr(String bidsRateStr) {
this.bidsRateStr = bidsRateStr;
}
public String getVclksRateStr() {
return vclksRateStr;
}
public void setVclksRateStr(String vclksRateStr) {
this.vclksRateStr = vclksRateStr;
}
public String getIncomeStr() {
return incomeStr;
}
public void setIncomeStr(String incomeStr) {
this.incomeStr = incomeStr;
}
public String getCostStr() {
return costStr;
}
public void setCostStr(String costStr) {
this.costStr = costStr;
}
public String getPriceDiffStr() {
return priceDiffStr;
}
public void setPriceDiffStr(String priceDiffStr) {
this.priceDiffStr = priceDiffStr;
}
public String getProfitRateStr() {
return profitRateStr;
}
public void setProfitRateStr(String profitRateStr) {
this.profitRateStr = profitRateStr;
}
} | [
"385933488@qq.com"
] | 385933488@qq.com |
2e458b310eed14884459bf315a3f547b6e295a8c | 394691878859fbbe231f32635ef101a52862b166 | /WA140 - Object Oriented Programming with Java/WA140_instructor/WA140_solutions/Solutions/Chapter03/ProgrammingExercises/Ex03-12/Student.java | 59634e4ec98a48fc50401ca4533f2c5e6c17b676 | [] | no_license | janesferr/WADD-Courses | 6969babd452374482bf2779651bec38a8fba25bd | a955c48d3c7209ed61c08f2e950da1967d730c1d | refs/heads/master | 2021-10-22T20:37:16.836119 | 2019-03-12T20:28:38 | 2019-03-12T20:28:38 | 175,291,381 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,343 | java | // Student.java
// Chapter 3, Exercise 12
// Part c
// Adds constructor to Student class
class Student
{
// the private data members
private int idNumber;
private int hours;
private int points;
// Constructor added in part c
Student()
{
idNumber = 9999;
points = 12;
hours = 3;
}
// end of constructor added in part c
// the public get and set methods
public void setIDnumber(int number)
{
idNumber = number;
}
public int getIDnumber()
{
return idNumber;
}
public void setHours(int number)
{
hours = number;
}
public int getHours()
{
return hours;
}
public void setPoints(int number)
{
points = number;
}
public int getPoints()
{
return points;
}
// methods to display the fields
public void showIDnumber()
{
System.out.println("ID Number is: " + idNumber);
}
public void showHours()
{
System.out.println("Credit Hours: " + hours);
}
public void showPoints()
{
System.out.println("Points Earned: " + points);
}
public double getGradePoint()
{
return (points * 1.0 / hours);
// simple integer division will truncate the decimal places
}
}
| [
"janesferrazza@MacBook-Pro.fios-router.home"
] | janesferrazza@MacBook-Pro.fios-router.home |
607f3276fcd9a71974fc5d2bec1933f3ba3a26dc | 57fa5f188254c0b85a9a2fb8850328d46f2b0064 | /aura-util/src/test/java/org/auraframework/util/type/CustomConcreteType2.java | a612dd0715f797db99f1581ecba20b4ccc5b9187 | [
"Apache-2.0",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"ICU",
"LicenseRef-scancode-mx4j",
"W3C",
"CC-BY-4.0",
"SAX-PD",
"MPL-2.0",
"WTFPL",
"CDDL-1.0",
"MIT"
] | permissive | BrettMN/aura | 6db0f4ccd941d6fe5bc1bd759b9b67261eef43ba | 827beb2dbadd2f9f7ccc880a2a38a6a2660f88d6 | refs/heads/master | 2020-03-24T23:42:43.760455 | 2018-08-01T05:49:42 | 2018-08-01T05:49:42 | 143,150,945 | 0 | 0 | Apache-2.0 | 2018-08-01T12:08:21 | 2018-08-01T12:08:21 | null | UTF-8 | Java | false | false | 816 | java | /*
* Copyright (C) 2013 salesforce.com, 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.auraframework.util.type;
public class CustomConcreteType2 extends CustomAbstractType {
protected CustomConcreteType2(String strValue, int intValue) {
super(strValue, -2 * intValue);
}
}
| [
"chris.seymour@salesforce.com"
] | chris.seymour@salesforce.com |
11f4052c1ada1b567145c6089dbd9d7cc7c2985b | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project43/src/main/java/org/gradle/test/performance43_1/Production43_95.java | a1c20a885e9e82bc209e66da2b0ba603a938a10c | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 302 | java | package org.gradle.test.performance43_1;
public class Production43_95 extends org.gradle.test.performance13_1.Production13_95 {
private final String property;
public Production43_95() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
0bd96246fb341651fbda36e8345133f55f197792 | 0e9a4a7ad52fd4eb96c99cc27990e7850b521b8c | /src/main/java/cn/edu/hqu/javaee/StuSelectHouseSystem/entity/House.java | 056df6e7a428d8ad6e367b16ec2c84c0bacd95af | [] | no_license | DOGEE7/StuSelectHouSystem | 32a6d9c4693e34a792387fb95dc6199a8bb2e5d2 | df1f1a10c74935d32b6a6322254d9e4b5af4128d | refs/heads/master | 2020-03-22T12:33:39.143300 | 2018-07-07T02:50:40 | 2018-07-07T02:50:40 | 140,047,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,127 | java | package cn.edu.hqu.javaee.StuSelectHouseSystem.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.Random;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotEmpty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name="house")
public class House implements Serializable {/**
*
*/
private static final long serialVersionUID = 1L;
@Getter
@Setter
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private Long houId;
@Getter
@Setter
@NotEmpty
@Column(name="houAdress")
private String houAddress;
@Getter
@Setter
@NotEmpty
@Column(name="type")
private String type;
@Getter
@Setter
@NotEmpty
@Column(name="population")
private int population;
@Getter
@Setter
@NotEmpty
@Column(name="rentPrice")
private int rentPrice;
@Getter
@Setter
@NotEmpty
@Column(name="rentOrNot")
private Boolean rentOrNot;
@Getter
@Setter
@NotEmpty
@Column(name="rentOrNot")
private String reason;
@Getter
@Setter
private int updateCost=(new Random()).nextInt(50);
@Getter
@Setter
@OneToOne(mappedBy="landlord")
@JoinColumn(name="id",nullable=false)
private Landlord landlord;
@Getter
@Setter
@Column(name="postedTime")
@Temporal(value=TemporalType.DATE)
@NotEmpty
private Date postedTime;
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that, "id","landlord");
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this, "id","landlord");
}
}
| [
"2645148577@qq.com"
] | 2645148577@qq.com |
3f4ab85cc4bbf98aa79cc15a897d9c7e530c5227 | 73064c3280f0da0c0a318ff92dfd7c56c80edfc7 | /src/main/java/com/couchbase/sdkdclient/options/OptionInfo.java | 49c626ba054e4c434289ac818a816bc86fe94690 | [] | no_license | programmatix/txn_client | 9e6c713107fa5fa92e3405e1a7dc21e91023f829 | d0771bed92e247a051f6ca101b6db11bae49f75e | refs/heads/master | 2020-12-15T15:51:56.056023 | 2020-01-22T11:19:55 | 2020-01-22T11:19:55 | 235,164,163 | 1 | 0 | null | 2020-01-20T18:01:19 | 2020-01-20T18:01:15 | null | UTF-8 | Java | false | false | 803 | java | /*
* Copyright (c) 2013 Couchbase, Inc.
*/
package com.couchbase.sdkdclient.options;
public interface OptionInfo {
/**
* Gets the actual option
* @return the Option object
*/
public RawOption getOption();
/**
* Gets the container for this option, i.e the tree in which this option
* was found. Note that this information is not authorative and that the
* container may change. This represents the container at the time the
* OptionInfo object was created
* @return
*/
public OptionTree getContainer();
/**
* Returns the "canonical" name for the option. The canonical name
* is the option with all its prefixes.
*
* In this format, prefixes are delimited by a slash ('/')
* @return The canonical name
*/
public String getCanonicalName();
}
| [
"praneeth.bokka@couchbase.com"
] | praneeth.bokka@couchbase.com |
b9f8c07201daf5d4db29ccd4c12d5faea4d177e4 | 4020611c7c16a7b7d9c908b9bd2a3aec0524bb5a | /src/test/java/com/royale/mahi/ClashRoyaleApplicationTests.java | 2b21c09720273f585603472b6696e6df73fefd61 | [
"MIT"
] | permissive | mahi-pg/clash-royale | d15b98157b16d71df4e48d89d13170dd6b3c2473 | 874cfddb731235d8e6dbf156e9a9a6c1a8c117b7 | refs/heads/master | 2021-06-16T03:20:49.946898 | 2019-07-04T15:01:18 | 2019-07-04T15:01:18 | 195,096,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.royale.mahi;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ClashRoyaleApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"ts344585@ca2.so-net.ne.jp"
] | ts344585@ca2.so-net.ne.jp |
475949c77c19c06ca978cc6b7f1fb7125e2ced90 | e20bbadda18c76b48c2ca2f5a638e4684650af23 | /subscription-service/src/main/java/org/challenge/coding/subscriptionservice/security/AuthorizationServerConfiguration.java | 5769d11722fa6bac045829e5d206aea0e08f75be | [] | no_license | logas81/Subscription-Service | bb7ca9591ce783566116449923514a6a0d396d28 | 7804303bdab56590f8e1348a699aea7ddcaac31a | refs/heads/master | 2021-01-19T12:14:42.905978 | 2017-02-19T16:31:33 | 2017-02-19T16:31:33 | 82,297,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,544 | java | package org.challenge.coding.subscriptionservice.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.approval.UserApprovalHandler;
import org.springframework.security.oauth2.provider.token.TokenStore;
/**
*
* Provides all the necessary methods to configure the Authorization server
*
*/
@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
private static String REALM="MY_OAUTH_REALM";
@Autowired
private TokenStore tokenStore;
@Autowired
private UserApprovalHandler userApprovalHandler;
@Autowired
@Qualifier("authenticationManagerBean")
private AuthenticationManager authenticationManager;
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
.withClient("my-trusted-client")
.authorizedGrantTypes("password", "authorization_code", "refresh_token", "implicit")
.authorities("ROLE_CLIENT", "ROLE_TRUSTED_CLIENT")
.scopes("read", "write", "trust")
.secret("secret")
.accessTokenValiditySeconds(300).//Access token is only valid for 5 minutes.
refreshTokenValiditySeconds(900);//Refresh token is only valid for 15 minutes.
}
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.tokenStore(tokenStore).userApprovalHandler(userApprovalHandler)
.authenticationManager(authenticationManager);
}
@Override
public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {
oauthServer.realm(REALM+"/client");
}
} | [
"logas@logas-HP"
] | logas@logas-HP |
8983d8a295cd75c432f0c7e1e0f77c2033203c82 | e66ee86dc12bb7b9921764193836aa56fa37b542 | /third_party/pmd/src/main/java/net/sourceforge/pmd/cpd/CPD.java | bebf1174caf50e8d273aa3596dc243e2efbba98f | [
"BSD-3-Clause"
] | permissive | daejunpark/jsaf | d425d51a3ac330379ba088a99d860eb882b4be4c | d9c155f01330672a7b895d77782001c95b29e8a0 | refs/heads/master | 2020-04-05T20:07:31.250275 | 2015-02-17T21:04:59 | 2015-02-17T21:04:59 | 28,986,869 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,004 | java | /**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cpd;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import net.sourceforge.pmd.util.FileFinder;
public class CPD {
private static final int MISSING_FILES = 1;
private static final int MISSING_ARGS = 2;
private static final int DUPLICATE_CODE_FOUND = 4;
private CPDConfiguration configuration;
private Map<String, SourceCode> source = new TreeMap<String, SourceCode>();
private CPDListener listener = new CPDNullListener();
private Tokens tokens = new Tokens();
private MatchAlgorithm matchAlgorithm;
public CPD(CPDConfiguration theConfiguration) {
configuration = theConfiguration;
}
public void setCpdListener(CPDListener cpdListener) {
this.listener = cpdListener;
}
public void go() {
TokenEntry.clearImages();
matchAlgorithm = new MatchAlgorithm(
source, tokens,
configuration.minimumTileSize(),
listener
);
matchAlgorithm.findMatches();
}
public Iterator<Match> getMatches() {
return matchAlgorithm.matches();
}
public void add(File file) throws IOException {
add(1, file);
}
public void addAllInDirectory(String dir) throws IOException {
addDirectory(dir, false);
}
public void addRecursively(String dir) throws IOException {
addDirectory(dir, true);
}
public void add(List<File> files) throws IOException {
for (File f: files) {
add(files.size(), f);
}
}
private void addDirectory(String dir, boolean recurse) throws IOException {
if (!(new File(dir)).exists()) {
throw new FileNotFoundException("Couldn't find directory " + dir);
}
FileFinder finder = new FileFinder();
// TODO - could use SourceFileSelector here
add(finder.findFilesFrom(dir, configuration.filenameFilter(), recurse));
}
private Set<String> current = new HashSet<String>();
private void add(int fileCount, File file) throws IOException {
if (configuration.skipDuplicates()) {
// TODO refactor this thing into a separate class
String signature = file.getName() + '_' + file.length();
if (current.contains(signature)) {
System.err.println("Skipping " + file.getAbsolutePath() + " since it appears to be a duplicate file and --skip-duplicate-files is set");
return;
}
current.add(signature);
}
if (!file.getCanonicalPath().equals(new File(file.getAbsolutePath()).getCanonicalPath())) {
System.err.println("Skipping " + file + " since it appears to be a symlink");
return;
}
listener.addedFile(fileCount, file);
SourceCode sourceCode = configuration.sourceCodeFor(file);
configuration.tokenizer().tokenize(sourceCode, tokens);
source.put(sourceCode.getFileName(), sourceCode);
}
private static void setSystemProperties(String[] args) {
boolean ignoreLiterals = CPDConfiguration.findBooleanSwitch(args, "--ignore-literals"),
ignoreIdentifiers = CPDConfiguration.findBooleanSwitch(args, "--ignore-identifiers");
Properties properties = System.getProperties();
if (ignoreLiterals) {
properties.setProperty(JavaTokenizer.IGNORE_LITERALS, "true");
}
if (ignoreIdentifiers) {
properties.setProperty(JavaTokenizer.IGNORE_IDENTIFIERS, "true");
}
System.setProperties(properties);
}
public static void main(String[] args) {
if (args.length == 0) {
showUsage();
System.exit(MISSING_ARGS);
}
try {
CPDConfiguration config = new CPDConfiguration(args);
// Pass extra parameters as System properties to allow language
// implementation to retrieve their associate values...
setSystemProperties(args);
CPD cpd = new CPD(config);
/* FIXME: Improve this !!! */
boolean missingFiles = true;
for (int position = 0; position < args.length; position++) {
if (args[position].equals("--files")) {
cpd.addRecursively(args[position + 1]);
if ( missingFiles ) {
missingFiles = false;
}
}
}
if ( missingFiles ) {
System.out.println("No " + "--files" + " value passed in");
showUsage();
System.exit(MISSING_FILES);
}
cpd.go();
if (cpd.getMatches().hasNext()) {
System.out.println(config.renderer().render(cpd.getMatches()));
System.exit(DUPLICATE_CODE_FOUND);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void showUsage() {
System.out.println("Usage:");
System.out.println(" java net.sourceforge.pmd.cpd.CPD --minimum-tokens xxx --files xxx [--language xxx] [--encoding xxx] [--format (xml|text|csv|vs)] [--skip-duplicate-files] ");
System.out.println("i.e: ");
System.out.println(" java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files c:\\jdk14\\src\\java ");
System.out.println("or: ");
System.out.println(" java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files /path/to/c/code --language c ");
System.out.println("or: ");
System.out.println(" java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --encoding UTF-16LE --files /path/to/java/code --format xml");
}
}
| [
"ssaljalu@kaist.ac.kr"
] | ssaljalu@kaist.ac.kr |
ecd104d986b051bec9ddab5f4b06bf4afec145fd | 052c5d1c36cfeb0d8db55c096baa92f54bed953a | /src/emfEMRHEADER.java | c1656262836408bba366b3056ca155ce193d01a1 | [] | no_license | KanshuYokoo/MS_EMF_Perser | 07aca35f73b07c949f38134261f056fd0fe9b810 | b72380f73a4ddb0f317b7dbaddf61c6b6690b413 | refs/heads/master | 2021-01-20T17:55:15.410306 | 2017-05-10T19:50:11 | 2017-05-10T19:50:11 | 90,895,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,192 | java |
public class emfEMRHEADER extends emfRecordType {
private int offDescription;
private int nDescription;
private int cbPixelFormat;
private int offPixelFormat;
private int bOpenGL;
private int MicrometersX;
private int MicrometersY;
//constructor
emfEMRHEADER() {
super();
this.name="EMR_HEADER";
}
emfEMRHEADER(byte[] v_emfbytes) {
super(v_emfbytes);
this.name="EMR_HEADER";
}
/**
*Header
* Type 4 byte
* Size 4
* EmfHeader 80
* EmfHeaderExtension1 12
* EmfHeaderExtension2 8
* EmfDescriptionBuffer (variable)
* EmfPixelFormatBuffer (variable)
*/
/**
* Header Type
* @param indxstart index of the start of this record
* @return
* @throws Exception
*/
public int readHeaderType(int indxstart) throws Exception{
int ret=indxstart + 4;
setType(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* Header Size
* @param indxstart index of the start of this record
* @return
* @throws Exception
*/
public int readHeaderSize(int indxstart) throws Exception{
int ret=indxstart + 4;
setSize( get4bytesInt(emfbytes,indxstart) );
return ret;
}
/**
*EmfHeader
* 80 byte
*
* Bounds (16 bytes):
* Frame (16 bytes):
* RecordSignature (4 bytes):
* Version (4 bytes):
* Bytes (4 bytes):
* Records (4 bytes):
* Handles (2 bytes):
* Reserved (2 bytes):
* nDescription (4 bytes):
* offDescription (4 bytes):
* nPalEntries (4 bytes):
* Device (8 bytes):
* Millimeters (8 bytes):
*
* @param bytes an allay of byte data from emf file
* @param indxstart index number of the start of the buffer
* @return index number of the next buffer
*/
public int readEmfHeader(int indxstart) throws Exception{
int index = indxstart;
index = readBounds(index); //16
index = readFrame(index); //16
index = readRecordSignature(index);//4
index = readVersion(index); //4
index = readBytes(index); //4
index = readRecords(index); //4
index = readHandles(index); //2
index = readReserved(index); //2
index = readnDescription(index); //4
index = readoffDescription(index); //4
index = readnPalEntries(index); //4
index = readDevice(index); //8
index = Millimeters(index); //8
return index;
}
/**
* Bounds (16 bytes): A WMF RectL object ([MS-WMF] section 2.2.2.19)
* that specifies the rectangular inclusive-inclusive bounds in device
* units of the smallest rectangle that can be drawn around the image
* stored in the metafile.
*/
public int readBounds(int indxstart) throws Exception{
int ret=indxstart + 16;
//todo: get object data
return ret;
}
/**
* Frame (16 bytes): A WMF RectL object that specifies the rectangular
* inclusive-inclusive dimensions, in .01 millimeter units, of a rectangle
* that surrounds the image stored in the metafile.
*/
public int readFrame(int indxstart) throws Exception{
int ret=indxstart + 16;
//todo:get object data
return ret;
}
/**
* RecordSignature (4 bytes): A 32-bit unsigned integer that specifies
* the record signature. This MUST be ENHMETA_SIGNATURE, from the FormatSignature
* enumeration (section 2.1.14).
*/
public int readRecordSignature(int indxstart) throws Exception{
int ret=indxstart + 4;
//todo:get object data
return ret;
}
/**
* Version (4 bytes): A 32-bit unsigned integer that specifies EMF metafile interoperability.
* This SHOULD be 0x00010000.<57>
*/
public int readVersion(int indxstart) throws Exception{
int ret=indxstart + 4;
//todo:get object data
return ret;
}
/**
* Bytes (4 bytes): A 32-bit unsigned integer that specifies
* the size of the metafile, in bytes.
*/
public int readBytes(int indxstart) throws Exception{
int ret=indxstart + 4;
//todo:get object data
return ret;
}
/**
* Records (4 bytes): A 32-bit unsigned integer that specifies
* the number of records in the metafile.
*/
public int readRecords(int indxstart) throws Exception{
int ret=indxstart + 4;
//todo:get object data
return ret;
}
/**
* Handles (2 bytes): A 16-bit unsigned integer that specifies
* the number of graphics objects that will be used during
* the processing of the metafile.
*/
public int readHandles(int indxstart) throws Exception{
int ret=indxstart + 2;
//todo:get object data
return ret;
}
/**
* Reserved (2 bytes): A 16-bit unsigned integer
* that MUST be 0x0000 and MUST be ignored.
*/
public int readReserved(int indxstart) throws Exception{
int ret=indxstart + 2;
//todo:get object data
return ret;
}
/**
* nDescription (4 bytes): A 32-bit unsigned integer
* that specifies the number of characters in the array
* that contains the description of the metafile's contents.
* This is zero if there is no description string.
*/
public int readnDescription(int indxstart) throws Exception{
int ret=indxstart + 4;
setnDescription(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* offDescription (4 bytes): A 32-bit unsigned integer
* that specifies the offset from the beginning of this record to
* the array that contains the description of the metafile's contents.
*/
public int readoffDescription(int indxstart) throws Exception{
int ret=indxstart + 4;
setOffDescription(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* nPalEntries (4 bytes): A 32-bit unsigned integer
* that specifies the number of entries in the metafile palette.
* The palette is located in the EMR_EOF record.
*/
public int readnPalEntries(int indxstart) throws Exception{
int ret=indxstart + 4;
//todo:get object data
return ret;
}
/**
* Device (8 bytes): A WMF SizeL object ([MS-WMF] section 2.2.2.22)
* that specifies the size of the reference device, in pixels.
*/
public int readDevice(int indxstart) throws Exception{
int ret=indxstart + 8;
//todo:内容を取得
return ret;
}
/**
* Millimeters (8 bytes): A WMF SizeL object that specifies
* the size of the reference device, in millimeters.
*/
public int Millimeters(int indxstart) throws Exception{
int ret=indxstart + 8;
//todo:内容を取得
return ret;
}
/**
*EmfMetafileHeaderExtension1
* 12 bytes
* @param bytes an allay of byte data from emf file
* @param indxstart index number of the start of the buffer
* @return index number of the next buffer
*/
public int readEmfMetafileHeaderExtension1(int indxstart) throws Exception{
int ret = indxstart;
ret = readcbPixelFormat(ret);
ret = readoffPixelFormat(ret);
ret = readbOpenGL(ret);
return ret;
}
/**
* cbPixelFormat (4 bytes):
* A 32-bit unsigned integer that specifies the size of
* the PixelFormatDescriptor object.
* This MUST be 0x00000000 if no pixel format is set.
*
* @param indxstart
* @return
* @throws Exception
*/
public int readcbPixelFormat(int indxstart) throws Exception{
int ret=indxstart + 4;
setCbPixelFormat(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* offPixelFormat (4 bytes):
* A 32-bit unsigned integer that specifies the offset to
* the PixelFormatDescriptor object. This MUST be 0x00000000
* if no pixel format is set.
* @param indxstart
* @return
* @throws Exception
*/
public int readoffPixelFormat(int indxstart) throws Exception{
int ret=indxstart + 4;
setOffPixelFormat(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* bOpenGL (4 bytes):
* A 32-bit unsigned integer that indicates whether OpenGL
* commands are present in the metafile
*
* 0x00000000 : OpenGL records are not present in the metafile.
* 0x00000001 : OpenGL records are present in the metafile.
*
* @param indxstart
* @return
* @throws Exception
*/
public int readbOpenGL(int indxstart) throws Exception{
int ret=indxstart + 4;
setbOpenGL(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
*EmfMetafileHeaderExtension2
* 8 bytes
* @param bytes an allay of byte data from emf file
* @param indxstart index number of the start of the buffer
* @return index number of the next buffer
*/
public int readEmfMetafileHeaderExtension2(int indxstart) throws Exception{
int ret=indxstart;
//todo:内容を取得
ret = readMicrometersX(ret);
ret = readMicrometersY(ret);
return ret;
}
/**
* MicrometersX (4 bytes):
* The 32-bit horizontal size of the display device for which
* the metafile image was generated, in micrometers.
*
* @param indxstart
* @return
* @throws Exception
*/
public int readMicrometersX(int indxstart) throws Exception{
int ret=indxstart + 4;
this.setMicrometersX(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* MicrometersY (4 bytes):
* The 32-bit vertical size of the display device for which
* the metafile image was generated, in micrometers.
*
* @param indxstart
* @return
* @throws Exception
*/
public int readMicrometersY(int indxstart) throws Exception{
int ret=indxstart + 4;
this.setMicrometersY(get4bytesInt(emfbytes,indxstart));
return ret;
}
/**
* EmfDescriptionBuffer (variable)
*An optional array of bytes that contains
*the EMF description string, which is not
*required to be contiguous with the fixed
*portion of the EmfMetafileHeader record.
*Accordingly, the field in this buffer that
*is labeled "UndefinedSpace" is optional
*and MUST be ignored.
*
*UndefinedSpace (variable)
*EmfDescription (variable)
*
* @param indxstart index number of the start of the record
* @return index number of the next buffer
*/
public int readEmfDescriptionBuffer(int indxstart){
int ret=0;
//todo: to understand the true size of variable.
//currently I am guessing the totally the nDescription*2 + OffDescription.
int varsize =
getnDescription()*2 +
getOffDescription();
ret = indxstart + varsize;
return ret;
}
/**
* EmfPixelFormatBuffer
*
* EmfPixelFormatBuffer (variable):
* An optional array of bytes that contains the EMF pixel format descriptor
* ,which is not required to be contiguous with the fixed portion of
* the EmfMetafileHeaderExtension1 record or with the EMF description string.
* Accordingly, the field in this buffer that is labeled "UndefinedSpace"
* is optional and MUST be ignored.
*
* EmfPixelFormat (40 bytes):
* An optional PixelFormatDescriptor object that specifies the last pixel
* format that was defined when the metafile was recorded. Its size and
* location in the record are specified by the cbPixelFormat and
* offPixelFormat fields, respectively, in EmfHeaderExtension1. If the
* value of either field is zero, no pixel format descriptor is present.
*
* UndefinedSpace2 (variable)
* EmfPixelFormat (40 bytes, optional)
*
*
* @param indxstart index number of the start of the record
* @return index number of the next buffer
*/
public int readEmfPixelFormatBuffer(int indxstart){
int ret=indxstart;
int offset = getOffPixelFormat();
if(offset !=0){
readPixelFormatDescriptor(indxstart);
ret = ret + offset + 40;
}
return ret;
}
/**
* PixelFormatDescriptor Object
* The PixelFormatDescriptor object specifies the pixel format of a drawing surface.
*
* @param indxstart
* @return
*/
public int readPixelFormatDescriptor(int indxstart){
int ret = indxstart;
//todo:get pixel format
int pixelnSize;
ret = ret +2;
int pixelnVersion;
pixelnVersion = get2bytesInt( emfbytes , ret);
return ret;
}
//////////////////////
//setter getter
public int getnDescription() {
return nDescription;
}
public void setnDescription(int nDescription) {
this.nDescription = nDescription;
}
public int getOffDescription() {
return offDescription;
}
public void setOffDescription(int offDescription) {
this.offDescription = offDescription;
}
/*
public int getHeader_type() {
return header_type;
}
public void setHeader_type(int header_type) {
this.header_type = header_type;
}
public int getHeader_size() {
return header_size;
}
public void setHeader_size(int header_size) {
this.header_size = header_size;
}*/
public int getCbPixelFormat() {
return cbPixelFormat;
}
//cdPixelFormat : HeaderExtention1 Object
public void setCbPixelFormat(int cbPixelFormat) {
this.cbPixelFormat = cbPixelFormat;
}
public int getOffPixelFormat() {
return offPixelFormat;
}
public void setOffPixelFormat(int offPixelFormat) {
this.offPixelFormat = offPixelFormat;
}
public int getbOpenGL() {
return bOpenGL;
}
public void setbOpenGL(int bOpenGL) {
this.bOpenGL = bOpenGL;
}
public int getMicrometersX() {
return MicrometersX;
}
public void setMicrometersX(int micrometersX) {
MicrometersX = micrometersX;
}
public int getMicrometersY() {
return MicrometersY;
}
public void setMicrometersY(int micrometersY) {
MicrometersY = micrometersY;
}
}
| [
"kanshu@lotusandcompanyinc.com"
] | kanshu@lotusandcompanyinc.com |
50f544c31525b8fa28253eea550ad4fae79f7997 | 4d66ae645bcb9159a4b6d0fdb2f24e029da00847 | /busi-root/busi-dao/src/main/java/com/huatek/busi/model/contract/BusiContractTendersBranchDetail.java | 57ed4521a11fd3aaa0ae6b5df0e75ad53f645b50 | [] | no_license | GitWangH/JiFen | 1e3722d49502e8ac7de2cfa4e97e99cf47e404df | 0cec185c83c0f76a97b4d00fc8f1cfb230415a8e | refs/heads/master | 2022-12-20T13:28:57.456912 | 2019-05-24T06:00:16 | 2019-05-24T06:00:16 | 131,266,103 | 0 | 2 | null | 2022-12-10T01:13:11 | 2018-04-27T08:07:02 | JavaScript | UTF-8 | Java | false | false | 6,755 | java | package com.huatek.busi.model.contract;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import com.huatek.busi.model.BusiFwOrg;
import com.huatek.frame.core.model.BaseEntity;
/**
* 代码自动生成model类.
*
* @ClassName: BusiContractTendersBranchDetail
* @Description: 标段分部分项清单
* @author: mickey_meng
* @Email : mickey_meng@huatek.com
* @date: 2017-10-25 15:11:54
* @version: 1.0
*/
@Entity
@Table(name = "busi_contract_tenders_branch_detail")
public class BusiContractTendersBranchDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
@Column(name = "TENDERS_BRANCH_DETAIL_ID", nullable = true)
private Long id;
/** @Fields busiContractTendersBranch : 标段分部分项ID */
@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true)
@JoinColumn(name = "TENDERS_BRANCH_ID")
private BusiContractTendersBranch busiContractTendersBranch;
/** @Fields busiContractTendersContractDetail : 合同清单主键ID */
@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = true)
@JoinColumn(name = "TENDERS_CONTRACT_DETAIL_ID")
private BusiContractTendersContractDetail busiContractTendersContractDetail;
/** @Fields dissolubleQuantity : 可分解数量 */
@Column(name = "DISSOLUBLE_QUANTITY", nullable = false, precision = 18, scale = 2)
private BigDecimal dissolubleQuantity;
/** @Fields designUnitPrice : 设计单价(元) */
@Column(name = "DESIGN_UNIT_PRICE", nullable = false, precision = 18, scale = 4)
private BigDecimal designUnitPrice;
/** @Fields designQuantity : 设计数量 */
@Column(name = "DESIGN_QUANTITY", nullable = false, precision = 18, scale = 2)
private BigDecimal designQuantity;
/** @Fields designTotalPrice : 设计金额(元) */
@Column(name = "DESIGN_TOTAL_PRICE", nullable = false, precision = 18, scale = 4)
private BigDecimal designTotalPrice;
/** @Fields cumulativeQuantity : 累计计量 */
@Column(name = "CUMULATIVE_QUANTITY", nullable = false, precision = 18, scale = 2)
private BigDecimal cumulativeQuantity;
/** @Fields creater : 创建人id */
@Column(name = "CREATER", nullable = false)
private Long creater;
/** @Fields createrName : 创建人姓名 */
@Column(name = "CREATER_NAME", nullable = false, length = 100)
private String createrName;
/** @Fields createTime : 创建时间 */
@Column(name = "CREATE_TIME", nullable = false)
private Date createTime;
/** @Fields modifer : 修改人id */
@Column(name = "MODIFER", nullable = false)
private Long modifer;
/** @Fields modifierName : 修改人姓名 */
@Column(name = "MODIFIER_NAME", nullable = false, length = 100)
private String modifierName;
/** @Fields modifyTime : 修改时间 */
@Column(name = "MODIFY_TIME", nullable = false)
private Date modifyTime;
/** @Fields tenantId : 租户id */
@Column(name = "TENANT_ID", nullable = false)
private Long tenantId;
/** @Fields orgId : 组织机构ID */
@ManyToOne(fetch = FetchType.EAGER, optional = true)
@JoinColumn(name = "ORG_ID")
private BusiFwOrg busiFwOrg;// 关联Org对象获取机构信息
/** @Fields isDelete : 是否删除 0 未删除的正常数据 1 已删除的数据 */
@Column(name = "IS_DELETE", nullable = false)
private Integer isDelete;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return this.id;
}
public void setBusiContractTendersBranch(
BusiContractTendersBranch busiContractTendersBranch) {
this.busiContractTendersBranch = busiContractTendersBranch;
}
public BusiContractTendersBranch getBusiContractTendersBranch() {
return this.busiContractTendersBranch;
}
public void setBusiContractTendersContractDetail(
BusiContractTendersContractDetail busiContractTendersContractDetail) {
this.busiContractTendersContractDetail = busiContractTendersContractDetail;
}
public BusiContractTendersContractDetail getBusiContractTendersContractDetail() {
return this.busiContractTendersContractDetail;
}
public void setDissolubleQuantity(BigDecimal dissolubleQuantity) {
this.dissolubleQuantity = dissolubleQuantity;
}
public BigDecimal getDissolubleQuantity() {
return this.dissolubleQuantity;
}
public void setDesignUnitPrice(BigDecimal designUnitPrice) {
this.designUnitPrice = designUnitPrice;
}
public BigDecimal getDesignUnitPrice() {
return this.designUnitPrice;
}
public void setDesignQuantity(BigDecimal designQuantity) {
this.designQuantity = designQuantity;
}
public BigDecimal getDesignQuantity() {
return this.designQuantity;
}
public void setDesignTotalPrice(BigDecimal designTotalPrice) {
this.designTotalPrice = designTotalPrice;
}
public BigDecimal getDesignTotalPrice() {
return this.designTotalPrice;
}
public void setCumulativeQuantity(BigDecimal cumulativeQuantity) {
this.cumulativeQuantity = cumulativeQuantity;
}
public BigDecimal getCumulativeQuantity() {
return this.cumulativeQuantity;
}
public void setCreater(Long creater) {
this.creater = creater;
}
public Long getCreater() {
return this.creater;
}
public void setCreaterName(String createrName) {
this.createrName = createrName;
}
public String getCreaterName() {
return this.createrName;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getCreateTime() {
return this.createTime;
}
public void setModifer(Long modifer) {
this.modifer = modifer;
}
public Long getModifer() {
return this.modifer;
}
public void setModifierName(String modifierName) {
this.modifierName = modifierName;
}
public String getModifierName() {
return this.modifierName;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Date getModifyTime() {
return this.modifyTime;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
public Long getTenantId() {
return this.tenantId;
}
public BusiFwOrg getBusiFwOrg() {
return busiFwOrg;
}
public void setBusiFwOrg(BusiFwOrg busiFwOrg) {
this.busiFwOrg = busiFwOrg;
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}
| [
"15771883191@163.com"
] | 15771883191@163.com |
ec7ef71050516ab6eaa50e7c0cf74f2f237a0ac6 | ef850e6af490cb6fb0da5f8e3e6976507f778dec | /newProject2/app/src/main/java/com/amarpreetsinghprojects/newproject/SecondActivity.java | b98a2c684781e6ebf53af9d506487e3ed553a367 | [] | no_license | AmarpreetSingh58/All-Projects-android | 1972f0550dd0d6bdd081ef7778f47305e437e925 | bfad2553b5b6778037e04d7fea3eed33623c4c71 | refs/heads/master | 2021-07-03T20:59:55.383351 | 2017-09-26T07:27:30 | 2017-09-26T07:27:30 | 104,850,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java | package com.amarpreetsinghprojects.newproject;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
public class SecondActivity extends AppCompatActivity implements Communicate {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public void changeText(String text) {
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragmentc);
FragmentC fragmentC = (FragmentC) fragment;
fragmentC.changeText(text);
}
}
| [
"amarpreetsingh58@gmail.com"
] | amarpreetsingh58@gmail.com |
c2d97d56c2095cb2746443a63e0d267602d0bfff | 2e041d16cc831faa185ef45df1891408a98e3476 | /src/ServiceCommunicator.java | bd4b14401965f24a51ef2b9ef6db7ca0e2eb6f5f | [] | no_license | myleen1213/Project5new | bcb1addb5cdce15b09b3a12e89ef01c61b6c5de1 | 11138aca0c91191ba3fe362c1921cb66eed633b0 | refs/heads/master | 2023-06-09T15:49:47.680456 | 2021-06-24T22:49:23 | 2021-06-24T22:49:23 | 380,068,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,317 | java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
/*
Simplistic utility class to connect to a web server and retrieve data.
Works for typical websites (but not very useful) and works for service calls that don't require authentication
-fdg
*/
public class ServiceCommunicator {
private HttpURLConnection conn;
/*
Constructor - supply the target URL and try to make the connection
*/
public ServiceCommunicator(String serviceURL) {
try {
URL url = new URL(serviceURL);
URLConnection urlConnection = url.openConnection();
conn = (HttpURLConnection)urlConnection;
} catch(Exception ex) {
System.err.println("**Error in constructor - Cannot create the URL or make the connection.");
System.exit(1);
}
}
/*
get() - read the reply from the webserver specifed in the constructor.
returns a string that captured the output from that service.
*/
public String get() {
String urlString = "";
String current;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while((current = in.readLine()) != null) {
urlString += current;
}
} catch (IOException iox) {
System.err.println("**Error in get(). Cannot read from URL");
}
return urlString;
}
/*
main method used just to test this class in isolation. You will learn more about testing in another course
*/
public static void main(String[] argv) {
System.out.println(new ServiceCommunicator("http://api.zippopotam.us/us/" + "10011").get());
System.out.println(new ServiceCommunicator("https://itunes.apple.com/search?term=" + "bbking" + "\\&limit=1").get());
System.err.println("==================================");
System.out.println(new ServiceCommunicator("http://www.google.com").get());
}
}
| [
"myleenwill123@gmail.com"
] | myleenwill123@gmail.com |
4c62ec4c229f0f35d8dee882b7f3a9511734d1fb | 8cfa204a8d04a6496d9f79f018460b76a6d939d0 | /yara-app-helpdeskmanagement/src/main/java/com/nagarro/nagp/yara/helpdeskmanagement/services/IOrderItemService.java | b8d6bdd7654ccc96cab2059250f9656248614688 | [] | no_license | nagarro-osheen/YaraApp | bc607cc65a51e30e04c1853cf488af0d5668742a | 887cdea7c6d3a8b9312e02fd7aa8062c0b9a0606 | refs/heads/main | 2023-04-06T17:29:18.873294 | 2021-04-10T19:04:21 | 2021-04-10T19:04:21 | 356,539,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package com.nagarro.nagp.yara.helpdeskmanagement.services-app.ordermanagement.services;
import java.util.List;
import com.nagarro.nagp.yara-app.ordermanagement.models.OrderItem;
public interface IOrderItemService {
void updateOrderItems(List<OrderItem> orderItems, Long cartId);
void deleteOrderItems(List<OrderItem> orderItems);
void updateOrderItemsWithOrder(List<OrderItem> orderItems, Long orderId);
}
| [
"osheen.gulati@nagarro.com"
] | osheen.gulati@nagarro.com |
84fae5761cecd897187f39e34d7f575d3f6eafe2 | 9202a9a968ed2243d8c18f783bae5fed6bce7c35 | /app/src/main/java/com/example/andys/myapplication/figures/Square.java | 027300b242174830c86269650e78ce5bea392e59 | [] | no_license | Osinaelo/AndroidAreaCalculator | 777674ee3c29995b72d054ad302996032577dc28 | a104ed20fe2041098a4b4ff496f3c9dd768a3027 | refs/heads/master | 2020-03-22T07:49:05.672585 | 2018-07-04T13:33:09 | 2018-07-04T13:33:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package com.example.andys.myapplication.figures;
public class Square extends Rectangle {
public Square(double dimension) {
super(dimension, dimension);
}
}
| [
"210905@edu.p.lodz.pl"
] | 210905@edu.p.lodz.pl |
c71d88ee3bd3115625e0d2832ecd6ada9b136e58 | aca9bfd690b55b682475e6710ab361af9ac2709d | /client/src/test/java/ru/taskurotta/client/serialization/ActorDefinitionSerializationTest.java | c040685a68173656bd57c478d24900a2c2f803a4 | [
"MIT"
] | permissive | JLLeitschuh/taskurotta | fd838aa23a8f9afdef9bb2e9185579f58a8565db | 0e1f1eda2f93a723c6d77f3842e732c6c886c109 | refs/heads/master | 2021-01-02T21:12:32.682367 | 2020-01-16T08:24:28 | 2020-01-16T08:24:28 | 239,803,397 | 0 | 0 | null | 2020-11-17T18:51:04 | 2020-02-11T15:59:45 | null | UTF-8 | Java | false | false | 1,937 | java | package ru.taskurotta.client.serialization;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.taskurotta.client.jersey.serialization.TransportJacksonModule;
import ru.taskurotta.util.ActorDefinition;
import java.io.StringWriter;
public class ActorDefinitionSerializationTest {
private static final Logger logger = LoggerFactory.getLogger(ActorDefinitionSerializationTest.class);
@Test
public void testActorDefinitionSerialization() {
innerTestActorDefinitionSerialization(ActorDefinition.valueOf("test.me.worker", "7.6.5"));
innerTestActorDefinitionSerialization(ActorDefinition.valueOf("test.me.worker", "7.6.5", "testTaskList"));
}
public void innerTestActorDefinitionSerialization(ActorDefinition original) {
ObjectMapper jacksonMapper = new ObjectMapper();
jacksonMapper.registerModule(new TransportJacksonModule());
ActorDefinition result = null;
try {
String json = jacksonMapper.writer().writeValueAsString(original);
System.err.println("JSON = " + json);
result = jacksonMapper.readValue(json, ActorDefinition.class);
} catch (Exception e) {
logger.error("Exception at (de)serialization of ActorDefinition to String", e);
Assert.fail("Exception at (de)serialization of ActorDefinition to String");
}
Assert.assertNotNull(result);
if (result != null) {
Assert.assertEquals("ActorDefinition names must be equal", original.getName(), result.getName());
Assert.assertEquals("ActorDefinition versions must be equal", original.getVersion(), result.getVersion());
Assert.assertEquals("ActorDefinition taskLists must be equal", original.getTaskList(),
result.getTaskList());
}
}
}
| [
"romario13@gmail.com"
] | romario13@gmail.com |
135e482d73264200918d32c2dcb52336962ba4dd | 58c9e221df3c0c24f6e6b55fd0fd97ba628a3dc9 | /SpringBootProject_20200102/src/main/java/com/project/spring/dto/Authority.java | 9a223de9dcaec228e4b9f2aa53449dd94e94acd2 | [] | no_license | ImSeongMuk/test_project | 6abbb02daa8be4b47c0616fea54c469e33e02a9e | 2b6664e7cf8105552c15aa2d432ad69c5f20e935 | refs/heads/master | 2023-02-05T15:17:49.079369 | 2020-12-22T10:04:16 | 2020-12-22T10:04:16 | 323,583,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.project.spring.dto;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
public class Authority {
private String username;
private String authority_name;
}
| [
"49136613+ImSeongMuk@users.noreply.github.com"
] | 49136613+ImSeongMuk@users.noreply.github.com |
01afc6c720e1d4e1aa9f96de894d36a8854d0305 | f2fcaa5d9371ed48ae36964aba6e453468c4281e | /src/main/java/simplecombatmagic/network/MagicCapabilityPacket.java | 5a70883b2c559791b8d336ddcfdbbb2966253892 | [] | no_license | OrderedChaos-Dev/SimpleCombatMagic | afa7321bd1b0ea812b41e995987d8877be323f77 | 560e978023455f9c37394b5fb3ae4b30195c08f4 | refs/heads/master | 2022-09-27T02:54:32.773445 | 2020-06-03T07:01:39 | 2020-06-03T07:01:39 | 268,210,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,792 | java | package simplecombatmagic.network;
import java.util.function.Supplier;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.network.NetworkEvent;
import simplecombatmagic.capabilities.CombatMagicInstance;
import simplecombatmagic.capabilities.ICombatMagic;
public class MagicCapabilityPacket {
private CompoundNBT nbt;
public MagicCapabilityPacket(PacketBuffer buffer) {
this.nbt = buffer.readCompoundTag();
}
public MagicCapabilityPacket(CompoundNBT nbt) {
this.nbt = nbt;
}
public void encode(PacketBuffer buf) {
buf.writeCompoundTag(nbt);
}
public void handle(Supplier<NetworkEvent.Context> ctx) {
NetworkEvent.Context context = ctx.get();
Capability.IStorage<ICombatMagic> storage = CombatMagicInstance.COMBAT_MAGIC.getStorage();
context.enqueueWork(() -> {
if(context.getDirection().getOriginationSide().isServer()) { //SERVER TO CLIENT
ClientPlayerEntity player = Minecraft.getInstance().player;
player.getCapability(CombatMagicInstance.COMBAT_MAGIC).ifPresent(instance -> {
storage.readNBT(CombatMagicInstance.COMBAT_MAGIC, instance, null, nbt);
});
} else if(context.getDirection().getOriginationSide().isClient()) { //CLIENT TO SERVER
ServerPlayerEntity player = context.getSender();
player.getCapability(CombatMagicInstance.COMBAT_MAGIC).ifPresent(instance -> {
storage.readNBT(CombatMagicInstance.COMBAT_MAGIC, instance, null, nbt);
});
}
});
context.setPacketHandled(true);
}
}
| [
"modding.jt9@gmail.com"
] | modding.jt9@gmail.com |
7515fd7775234a20bf62fbb15c077325d8b5a919 | 48b08c3b27c5486db19930909b274bb9b04d57c3 | /src/main/java/com/shan/org/shan/pojo/OrderQuery.java | d74a868dfb52272bf216a753bb661da89bd313f6 | [] | no_license | qiaolu0884/shanxinshu | 5a25aa71e4eb87055aa64146611636de03fcf45e | 4ac6da0c08e9f3a9933ef1336431b9d0bad90cf1 | refs/heads/master | 2021-01-21T11:45:40.446017 | 2017-05-19T01:37:54 | 2017-05-19T01:37:54 | 91,669,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,924 | java | package com.shan.org.shan.pojo;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class OrderQuery {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
protected Integer pageNo = 1;
protected Integer startRow;
protected Integer pageSize = 10;
protected String fields;
public OrderQuery() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
public void setPageNo(Integer pageNo) {
this.pageNo=pageNo;
this.startRow = (pageNo-1)*this.pageSize;
}
public Integer getPageNo() {
return pageNo;
}
public void setStartRow(Integer startRow) {
this.startRow=startRow;
}
public Integer getStartRow() {
return startRow;
}
public void setPageSize(Integer pageSize) {
this.pageSize=pageSize;
this.startRow = (pageNo-1)*this.pageSize;
}
public Integer getPageSize() {
return pageSize;
}
public void setFields(String fields) {
this.fields=fields;
}
public String getFields() {
return fields;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Long value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Long value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Long value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Long value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Long value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Long value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Long> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Long> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Long value1, Long value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Long value1, Long value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andMoneyIsNull() {
addCriterion("money is null");
return (Criteria) this;
}
public Criteria andMoneyIsNotNull() {
addCriterion("money is not null");
return (Criteria) this;
}
public Criteria andMoneyEqualTo(BigDecimal value) {
addCriterion("money =", value, "money");
return (Criteria) this;
}
public Criteria andMoneyNotEqualTo(BigDecimal value) {
addCriterion("money <>", value, "money");
return (Criteria) this;
}
public Criteria andMoneyGreaterThan(BigDecimal value) {
addCriterion("money >", value, "money");
return (Criteria) this;
}
public Criteria andMoneyGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("money >=", value, "money");
return (Criteria) this;
}
public Criteria andMoneyLessThan(BigDecimal value) {
addCriterion("money <", value, "money");
return (Criteria) this;
}
public Criteria andMoneyLessThanOrEqualTo(BigDecimal value) {
addCriterion("money <=", value, "money");
return (Criteria) this;
}
public Criteria andMoneyIn(List<BigDecimal> values) {
addCriterion("money in", values, "money");
return (Criteria) this;
}
public Criteria andMoneyNotIn(List<BigDecimal> values) {
addCriterion("money not in", values, "money");
return (Criteria) this;
}
public Criteria andMoneyBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("money between", value1, value2, "money");
return (Criteria) this;
}
public Criteria andMoneyNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("money not between", value1, value2, "money");
return (Criteria) this;
}
public Criteria andOrderNumberIsNull() {
addCriterion("order_number is null");
return (Criteria) this;
}
public Criteria andOrderNumberIsNotNull() {
addCriterion("order_number is not null");
return (Criteria) this;
}
public Criteria andOrderNumberEqualTo(Long value) {
addCriterion("order_number =", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotEqualTo(Long value) {
addCriterion("order_number <>", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberGreaterThan(Long value) {
addCriterion("order_number >", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberGreaterThanOrEqualTo(Long value) {
addCriterion("order_number >=", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberLessThan(Long value) {
addCriterion("order_number <", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberLessThanOrEqualTo(Long value) {
addCriterion("order_number <=", value, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberIn(List<Long> values) {
addCriterion("order_number in", values, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotIn(List<Long> values) {
addCriterion("order_number not in", values, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberBetween(Long value1, Long value2) {
addCriterion("order_number between", value1, value2, "orderNumber");
return (Criteria) this;
}
public Criteria andOrderNumberNotBetween(Long value1, Long value2) {
addCriterion("order_number not between", value1, value2, "orderNumber");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCommodityIdIsNull() {
addCriterion("commodity_id is null");
return (Criteria) this;
}
public Criteria andCommodityIdIsNotNull() {
addCriterion("commodity_id is not null");
return (Criteria) this;
}
public Criteria andCommodityIdEqualTo(Long value) {
addCriterion("commodity_id =", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdNotEqualTo(Long value) {
addCriterion("commodity_id <>", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdGreaterThan(Long value) {
addCriterion("commodity_id >", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdGreaterThanOrEqualTo(Long value) {
addCriterion("commodity_id >=", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdLessThan(Long value) {
addCriterion("commodity_id <", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdLessThanOrEqualTo(Long value) {
addCriterion("commodity_id <=", value, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdIn(List<Long> values) {
addCriterion("commodity_id in", values, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdNotIn(List<Long> values) {
addCriterion("commodity_id not in", values, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdBetween(Long value1, Long value2) {
addCriterion("commodity_id between", value1, value2, "commodityId");
return (Criteria) this;
}
public Criteria andCommodityIdNotBetween(Long value1, Long value2) {
addCriterion("commodity_id not between", value1, value2, "commodityId");
return (Criteria) this;
}
public Criteria andOrderCountIsNull() {
addCriterion("order_count is null");
return (Criteria) this;
}
public Criteria andOrderCountIsNotNull() {
addCriterion("order_count is not null");
return (Criteria) this;
}
public Criteria andOrderCountEqualTo(Long value) {
addCriterion("order_count =", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountNotEqualTo(Long value) {
addCriterion("order_count <>", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountGreaterThan(Long value) {
addCriterion("order_count >", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountGreaterThanOrEqualTo(Long value) {
addCriterion("order_count >=", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountLessThan(Long value) {
addCriterion("order_count <", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountLessThanOrEqualTo(Long value) {
addCriterion("order_count <=", value, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountIn(List<Long> values) {
addCriterion("order_count in", values, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountNotIn(List<Long> values) {
addCriterion("order_count not in", values, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountBetween(Long value1, Long value2) {
addCriterion("order_count between", value1, value2, "orderCount");
return (Criteria) this;
}
public Criteria andOrderCountNotBetween(Long value1, Long value2) {
addCriterion("order_count not between", value1, value2, "orderCount");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"ql0884@126.com"
] | ql0884@126.com |
52395c9bddc43ff781521210217568572efbeab5 | 349f314c07582402b790f64229a3f40231ba269f | /hemesh/wblut/hemesh/HEC_UVParametric.java | b50d102082ff56bdd65ae6764e29b2bedd760a37 | [] | no_license | blvkoblsk/Meshia | 33b645194b7c0e9ad1ad3f56531365a084ff2e28 | c92764a4069ac00669923c17e9d0bf5d3875f6d8 | refs/heads/master | 2021-01-19T20:55:59.629816 | 2015-06-16T19:50:59 | 2015-06-16T19:50:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,226 | java | package wblut.hemesh;
import wblut.geom.WB_Point3d;
import wblut.math.WB_Function2D;
// TODO: Auto-generated Javadoc
/**
* Creates a new mesh from a parametric uv equation.
*
* @author David Bollinger
*
*/
public class HEC_UVParametric extends HEC_FromFacelist { // Creator {
/** Number of subdivisions along u-axis. */
protected int usteps;
/** Number of subdivisions along v-axis. */
protected int vsteps;
/** The u wrap. */
protected boolean uWrap;
/** The v wrap. */
protected boolean vWrap;
/** Scale factor. */
protected double radius;
/** The parametric evaluator. */
protected WB_Function2D<WB_Point3d> evaluator;
/**
* Instantiates a new HEC_UVParametric.
*/
public HEC_UVParametric() {
super();
override = true;
usteps = 32;
vsteps = 32;
radius = 1.0;
uWrap = false;
vWrap = false;
}
/**
* Sets the evaluator.
*
* @param eval an implementation of HET_UVEvaluator
* @return self
*/
public HEC_UVParametric setEvaluator(final WB_Function2D<WB_Point3d> eval) {
evaluator = eval;
return this;
}
/**
* Sets the number of subdivisions along u/v axes.
*
* @param usteps the number of subdivisions along u-axis
* @param vsteps the number of subdivisions along v-axis
* @return self
*/
public HEC_UVParametric setUVSteps(final int usteps, final int vsteps) {
this.usteps = (usteps > 1) ? usteps : 32;
this.vsteps = (usteps > 1) ? vsteps : 32;
return this;
}
/**
* Sets the scale factor.
*
* @param r the r
* @return self
*/
public HEC_UVParametric setRadius(final double r) {
radius = r;
return this;
}
/**
* is u a periodic parameter?.
*
* @param b true/false
* @return self
*/
public HEC_UVParametric setUWrap(final boolean b) {
uWrap = b;
return this;
}
/**
* is v a periodic parameter?.
*
* @param b true/false
* @return self
*/
public HEC_UVParametric setVWrap(final boolean b) {
vWrap = b;
return this;
}
/*
* (non-Javadoc)
* @see wblut.hemesh.HE_Creator#create()
*/
@Override
protected HE_Mesh createBase() {
if (evaluator != null) {
final int lusteps = (uWrap) ? usteps : usteps + 1;
final int lvsteps = (vWrap) ? vsteps : vsteps + 1;
int N = lusteps * lvsteps;
final WB_Point3d[] vertices = new WB_Point3d[N];
int index = 0;
for (int iv = 0; iv < lvsteps; iv++) {
final double v = (double) (iv) / (double) (vsteps);
for (int iu = 0; iu < lusteps; iu++) {
final double u = (double) (iu) / (double) (usteps);
vertices[index] = evaluator.f(u, v);
vertices[index].scale(radius);
index++;
} // for iu
} // for iv
N = usteps * vsteps;
final int[][] faces = new int[N][4];
index = 0;
for (int iv = 0; iv < vsteps; iv++) {
for (int iu = 0; iu < usteps; iu++) {
faces[index][0] = iv * lusteps + iu;
faces[index][1] = iv * lusteps + ((iu + 1) % lusteps);
faces[index][2] = ((iv + 1) % lvsteps) * lusteps
+ ((iu + 1) % lusteps);
faces[index][3] = ((iv + 1) % lvsteps) * lusteps + iu;
index++;
} // for iu
} // for iv
this.setVertices(vertices).setFaces(faces).setDuplicate(true);
return super.createBase();
}
return null;
}
}
| [
"mikaelhc@gmail.com"
] | mikaelhc@gmail.com |
911590e82be65175fbd1c6f93b0dfaae4560f673 | 5c55cfbc4959dd424115412a01de93cf07f33790 | /src/Afvink1/Heapsort.java | 8f708340d6c3775be8893f6888cc7a3cd4895d6f | [] | no_license | Thijsch/Course6Thijs | e9e01f2784a70c3b9f226de8e7f9d1fae0f943c6 | 8a3d46b916bc4cbd64ea724615d695924adc1f10 | refs/heads/master | 2023-01-21T15:51:29.355115 | 2020-12-02T10:22:24 | 2020-12-02T10:22:24 | 315,861,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,091 | java | package Afvink1; /**
* @author Thijs Ermens
* @date 18-11-2020
*/
class HeapSort {
public void sort(int arr[]) {
/**
*Functie voor het inmplementeren van de Heap Sort
*/
int n = arr.length;
// Build heap (rearrange array)
for (int i = n / 2 - 1; i >= 0; i--)
heapify(arr, n, i);
for (int i = n - 1; i >= 0; i--) { // One by one extract an element from heap
// Move current root to end
int temp = arr[0];
arr[0] = arr[i];
arr[i] = temp;
// call max heapify on the reduced heap
heapify(arr, i, 0);
}
}
// To heapify a subtree rooted with node i which is
// an index in arr[]. n is size of heap
void heapify(int arr[], int n, int i) {
/**
* Functie die een subtree maakt en van de lijst.
*/
int largest = i; // Initialize largest as root
int l = 2 * i + 1; // left = 2*i + 1
int r = 2 * i + 2; // right = 2*i + 2
// If left child is larger than root
if (l < n && arr[l] > arr[largest])
largest = l;
// If right child is larger than largest so far
if (r < n && arr[r] > arr[largest])
largest = r;
// If largest is not root
if (largest != i) {
int swap = arr[i];
arr[i] = arr[largest];
arr[largest] = swap;
// Recursively heapify the affected sub-tree
heapify(arr, n, largest);
}
}
/* A utility function to print array of size n */
static void printArray(int arr[]) {
int n = arr.length;
for (int i = 0; i < n; ++i)
System.out.print(arr[i] + " ");
System.out.println();
}
public static void main(String args[]) {
int arr[] = {12, 11, 13, 5, 6, 7, 1, 2, 90, 22, 54, 6, 6,};
int n = arr.length;
HeapSort ob = new HeapSort();
ob.sort(arr);
System.out.println("Sorted array is");
printArray(arr);
}
} | [
"thijschermens@gmail.com"
] | thijschermens@gmail.com |
8c557c352beafb8236e66dce6557c62206219cd9 | 47119d527d55e9adcb08a3a5834afe9a82dd2254 | /vipr-portal/com.iwave.ext.windows/src/java/com/iwave/ext/windows/winrm/wmi/GetRegistryValueMethod.java | 2283e015d0d831df9d5321d615b728e8c6e5d1b9 | [] | no_license | chrisdail/coprhd-controller | 1c3ddf91bb840c66e4ece3d4b336a6df421b43e4 | 38a063c5620135a49013aae5e078aeb6534a5480 | refs/heads/master | 2020-12-03T10:42:22.520837 | 2015-06-08T15:24:36 | 2015-06-08T15:24:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,005 | java | /**
* Copyright 2012-2015 iWave Software LLC
* All Rights Reserved
*/
package com.iwave.ext.windows.winrm.wmi;
import java.util.List;
import javax.xml.xpath.XPathExpression;
import org.apache.commons.lang.math.NumberUtils;
import org.w3c.dom.Element;
import com.iwave.ext.windows.model.wmi.RegistryValueType;
import com.iwave.ext.windows.winrm.WinRMTarget;
import com.iwave.ext.xml.XmlStringBuilder;
import com.iwave.ext.xml.XmlUtils;
public class GetRegistryValueMethod extends AbstractRegistryMethod<Object> {
private static final String GET_STRING_VALUE = "GetStringValue";
private static final String GET_EXPANDED_STRING_VALUE = "GetExpandedStringValue";
private static final String GET_BINARY_VALUE = "GetBinaryValue";
private static final String GET_DWORD_VALUE = "GetDWORDValue";
private static final String GET_MULTI_STRING_VALUE = "GetMultiStringValue";
private static final XPathExpression STRING_VALUE_EXPR = XmlUtils.compileXPath(XPATH, "ns:sValue");
private static final XPathExpression EXPANDED_STRING_VALUE_EXPR = XmlUtils.compileXPath(XPATH, "ns:sValue");
private static final XPathExpression BINARY_VALUE_EXPR = XmlUtils.compileXPath(XPATH, "ns:uValue");
private static final XPathExpression DWORD_VALUE_EXPR = XmlUtils.compileXPath(XPATH, "ns:uValue");
private static final XPathExpression MULTI_STRING_VALUE_EXPR = XmlUtils.compileXPath(XPATH, "ns:sValue");
private long registryTree;
private String subKeyName;
private String valueName;
private RegistryValueType valueType;
public GetRegistryValueMethod(WinRMTarget target) {
super(target);
}
public void setRegistryTree(long registryTree) {
this.registryTree = registryTree;
}
public void setSubKeyName(String subKeyName) {
this.subKeyName = subKeyName;
}
public void setValueName(String valueName) {
this.valueName = valueName;
}
public void setValueType(RegistryValueType valueType) {
this.valueType = valueType;
switch (valueType) {
case STRING:
setMethodName(GET_STRING_VALUE);
break;
case EXPANDED_STRING:
setMethodName(GET_EXPANDED_STRING_VALUE);
break;
case BINARY:
setMethodName(GET_BINARY_VALUE);
break;
case DWORD:
setMethodName(GET_DWORD_VALUE);
break;
case MULTI_STRING:
setMethodName(GET_MULTI_STRING_VALUE);
break;
default:
throw new IllegalArgumentException("Unsupported value type: " + valueType);
}
}
@Override
protected void buildInput(XmlStringBuilder xml) {
if (registryTree != 0) {
xml.element("hDefKey", registryTree);
}
xml.element("sSubKeyName", subKeyName);
xml.element("sValueName", valueName);
}
@Override
protected Object processOutput(Element output) {
switch (valueType) {
case STRING:
return getStringValue(output);
case EXPANDED_STRING:
return getExpandedStringValue(output);
case BINARY:
return getBinaryValue(output);
case DWORD:
return getDWordValue(output);
case MULTI_STRING:
return getMultiStringValue(output);
default:
throw new IllegalStateException("Unsupported value type: " + valueType);
}
}
protected String getStringValue(Element output) {
Element value = XmlUtils.selectElement(STRING_VALUE_EXPR, output);
return value != null ? XmlUtils.getText(value) : null;
}
protected String getExpandedStringValue(Element output) {
Element value = XmlUtils.selectElement(EXPANDED_STRING_VALUE_EXPR, output);
return value != null ? XmlUtils.getText(value) : null;
}
protected byte[] getBinaryValue(Element output) {
List<Element> values = XmlUtils.selectElements(BINARY_VALUE_EXPR, output);
byte[] result = new byte[values.size()];
for (int i = 0; i < values.size(); i++) {
String value = XmlUtils.getText(values.get(i));
int x = NumberUtils.toInt(value);
result[i] = (byte) (0xff & x);
}
return result;
}
protected int getDWordValue(Element output) {
String value = XmlUtils.selectText(DWORD_VALUE_EXPR, output);
// A DWord is an unsigned 32 bit value, so we need to convert it to a long first, then cast to an int
long longValue = NumberUtils.toLong(value);
int intValue = (int) longValue;
return intValue;
}
protected String[] getMultiStringValue(Element output) {
List<Element> values = XmlUtils.selectElements(MULTI_STRING_VALUE_EXPR, output);
String[] results = new String[values.size()];
for (int i = 0; i < values.size(); i++) {
results[i] = XmlUtils.getText(values.get(i));
}
return results;
}
} | [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
ecbf8cb1fbf5309b48242874a108e6d94dae2b7c | 4bcd07fcdadd2884c04e7529e258f34915b1ae09 | /src/dao/Entity/MatierePremier.java | 1a6f4b901f43c90d9b5f01c4507b26338af36a9b | [] | no_license | YASSER-TAIBI/GestionCommande | 0687747bfcac532390ac18f0d9eb7f9f8f2e4ffe | d136a22960ac78c9cb2d35d4f13ba7b7799041ff | refs/heads/master | 2023-05-07T16:15:53.333882 | 2021-05-19T11:12:04 | 2021-05-19T11:12:04 | 255,936,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,339 | java | package dao.Entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* The persistent class for the matiere_premier database table.
*
*/
@Entity
@Table(name="matiere_premier")
@NamedQuery(name="MatierePremier.findAll", query="SELECT m FROM MatierePremier m")
public class MatierePremier implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
private String code;
private String nom;
private boolean deleted ;
private BigDecimal valMinMP;
private BigDecimal valMaxMP;
private BigDecimal stockAlert;
@Column(name="ETAT")
private String etat;
@ManyToOne
@JoinColumn(name="id_cat")
private CategorieMp categorieMp;
@ManyToOne
@JoinColumn(name="ID_DIMENSION")
private Dimension dimension;
@ManyToOne
@JoinColumn(name="ID_UTIL_CREATION")
private Utilisateur utilisateurCreation;
public BigDecimal getValMinMP() {
return valMinMP;
}
public void setValMinMP(BigDecimal valMinMP) {
this.valMinMP = valMinMP;
}
public BigDecimal getValMaxMP() {
return valMaxMP;
}
public BigDecimal getStockAlert() {
return stockAlert;
}
public void setStockAlert(BigDecimal stockAlert) {
this.stockAlert = stockAlert;
}
public void setValMaxMP(BigDecimal valMaxMP) {
this.valMaxMP = valMaxMP;
}
/*//bi-directional many-to-one association to Stock
@OneToMany(mappedBy="matierePremier")
private List<Stock> stocks;*/
public MatierePremier() {
}
public int getId() {
return this.id;
}
public String getEtat() {
return etat;
}
public void setEtat(String etat) {
this.etat = etat;
}
public void setId(int id) {
this.id = id;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getNom() {
return this.nom;
}
public Utilisateur getUtilisateurCreation() {
return utilisateurCreation;
}
public void setUtilisateurCreation(Utilisateur utilisateurCreation) {
this.utilisateurCreation = utilisateurCreation;
}
public Dimension getDimension() {
return dimension;
}
public void setDimension(Dimension dimension) {
this.dimension = dimension;
}
public void setNom(String nom) {
this.nom = nom;
}
/* public List<DetailCommande> getDetailCommandes() {
return this.detailCommandes;
}
public void setDetailCommandes(List<DetailCommande> detailCommandes) {
this.detailCommandes = detailCommandes;
}
public DetailCommande addDetailCommande(DetailCommande detailCommande) {
getDetailCommandes().add(detailCommande);
detailCommande.setMatierePremier(this);
return detailCommande;
}
public DetailCommande removeDetailCommande(DetailCommande detailCommande) {
getDetailCommandes().remove(detailCommande);
detailCommande.setMatierePremier(null);
return detailCommande;
}
public List<DetailFacture> getDetailFactures() {
return this.detailFactures;
}
public void setDetailFactures(List<DetailFacture> detailFactures) {
this.detailFactures = detailFactures;
}
public DetailFacture addDetailFacture(DetailFacture detailFacture) {
getDetailFactures().add(detailFacture);
detailFacture.setMatierePremier(this);
return detailFacture;
}
public DetailFacture removeDetailFacture(DetailFacture detailFacture) {
getDetailFactures().remove(detailFacture);
detailFacture.setMatierePremier(null);
return detailFacture;
}
public List<DetailProduit> getDetailProduits() {
return this.detailProduits;
}
public void setDetailProduits(List<DetailProduit> detailProduits) {
this.detailProduits = detailProduits;
}
public DetailProduit addDetailProduit(DetailProduit detailProduit) {
getDetailProduits().add(detailProduit);
detailProduit.setMatierePremier(this);
return detailProduit;
}
public DetailProduit removeDetailProduit(DetailProduit detailProduit) {
getDetailProduits().remove(detailProduit);
detailProduit.setMatierePremier(null);
return detailProduit;
}
*/
public CategorieMp getCategorieMp() {
return this.categorieMp;
}
public void setCategorieMp(CategorieMp categorieMp) {
this.categorieMp = categorieMp;
}
public boolean isDeleted() {
return deleted;
}
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}
/*public List<Stock> getStocks() {
return this.stocks;
}
public void setStocks(List<Stock> stocks) {
this.stocks = stocks;
}
public Stock addStock(Stock stock) {
getStocks().add(stock);
stock.setMatierePremier(this);
return stock;
}
public Stock removeStock(Stock stock) {
getStocks().remove(stock);
stock.setMatierePremier(null);
return stock;
}*/
} | [
"yasser.taibi.19@gmail.com"
] | yasser.taibi.19@gmail.com |
eaa4fa5d86f2c52deefa22565350cd2612ccf2e0 | a2a22d4c2afa3d60d9892eb0eb9f4888dbe62778 | /app/src/main/java/com/example/android/fragmentsdemo/FragmentActionListener.java | 2bc46ee7d5783e64b78aae4643583320b634744e | [] | no_license | gavblaze/FragmentsDemo | 8eb9c0d7cc8f6fd15730955ef87151c9d873916f | 6930541dfb735eb8a2e8ab249da21407cc3e52f0 | refs/heads/master | 2020-04-14T22:32:56.715787 | 2019-01-05T00:15:09 | 2019-01-05T00:15:09 | 164,165,825 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.example.android.fragmentsdemo;
import android.os.Bundle;
public interface FragmentActionListener {
// here we define possible actions
String ACTION_KEY = "actionKey";
int ACTION_COUNTRY_CLIKED = 1;
String COUNTRY_NAME_KEY = "clickKey";
String DESCRIPTION_KEY = "descKey";
void onActionPerformed(Bundle bundle);
}
| [
"gav.plant@gmail.com"
] | gav.plant@gmail.com |
011c01ac76fcd8e7eb5ae14224a685ca98928588 | c466e8058e442c3798b57fad5741a12cdef21a1b | /commands/staff/FlyCommand.java | 18f048fd103aa699eeafed10fa7f05350d5b6243 | [] | no_license | ProjectStormfront/Core | 493b4f6ab132464ba4fe9bef387f667ac6e6d56d | e2e4160b0cd714d80cf5c4bf1e6a29c1eff9f377 | refs/heads/main | 2023-03-14T14:42:28.605751 | 2021-03-11T17:26:46 | 2021-03-11T17:26:46 | 345,036,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,549 | java | package core.deagan.core.commands.staff;
import core.deagan.core.commands.CommandHandler;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class FlyCommand extends CommandHandler {
public FlyCommand() {
super("fly", "staff.fly", false);
}
@Override
public void execute(CommandSender sender, String[] args) {
Player p = (Player)sender;
if(args.length == 0) {
if(p.isFlying()) {
p.setFlying(false);
p.setAllowFlight(false);
p.sendMessage(ChatColor.RED + "You are no longer flying.");
return;
}
p.setAllowFlight(true);
p.setFlying(true);
p.sendMessage(ChatColor.GREEN + "You are now flying.");
return;
}
if(args.length == 1) {
if(Bukkit.getPlayer(args[1]) == null) {
p.sendMessage(ChatColor.RED + "Player is not online.");
return;
}
Player target = Bukkit.getPlayer(args[1]);
if(target.isFlying()) {
target.setFlying(false);
target.setAllowFlight(false);
target.sendMessage(ChatColor.RED + "Staff has taken away your flight.");
return;
}
target.setAllowFlight(true);
target.setFlying(true);
target.sendMessage(ChatColor.GREEN + "Staff has given you flight.");
}
}
}
| [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
d702930f23d19f3fcc58e7ef3a2a340664ec9436 | d55fd3ab68565cf8818a4b29b7d4bcc46bb947c6 | /server/src/main/java/com/autonomous/pm/vhcl/websocket/WebSocketPmHandlerConfig.java | f26c867eea7cd3e0362ed16e43b838197af81279 | [] | no_license | VAIP-foundation/autonomous-driving-control | 1ed1fe77bf4284e80a2aa0c71c054cde503ec3c3 | 7cbe5aef7fe6a5f018f4780cd6e3ccb7dd2d5006 | refs/heads/master | 2023-03-05T23:29:40.470438 | 2021-02-15T07:00:12 | 2021-02-15T07:00:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,916 | java | package com.autonomous.pm.vhcl.websocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean;
@Profile("!stomp,sockJS")
@Configuration
@EnableWebSocket
public class WebSocketPmHandlerConfig implements WebSocketConfigurer {
public static final Logger logger = LoggerFactory.getLogger(WebSocketPmHandlerConfig.class);
private final int MAX_MESSAGE_SIZE = 1024 * 1024 * 16; // 16Mb
// private final Long MAX_SESSION_IDLE_TIMEOUT = 1 * 60 * 1000L; // 1min
private final Long MAX_SESSION_IDLE_TIMEOUT = 24 * 60 * 60 * 1000L; // 1day
@Autowired
private WebSocketPmHandler socketHandler;
@Bean
public ServletServerContainerFactoryBean createWebSocketContainer() {
ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();
container.setMaxTextMessageBufferSize(MAX_MESSAGE_SIZE);
container.setMaxBinaryMessageBufferSize(MAX_MESSAGE_SIZE);
container.setMaxSessionIdleTimeout(MAX_SESSION_IDLE_TIMEOUT);
container.setAsyncSendTimeout(MAX_SESSION_IDLE_TIMEOUT);
return container;
}
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
// INERFACE - 200. WebSocket 접속
// 해당 endpoint로 handshake가 이루어진다.
// use not .withSockJS();
registry
.addHandler(socketHandler, "/ws/v1/connect/**")
.setAllowedOrigins("*");
// .withSockJS()
}
} | [
"richard@aivision.co.kr"
] | richard@aivision.co.kr |
c2b30fd71c21f95b18478804c6ae77fbaf219cfd | ce2de86aa95bac1d5623e453895ed7c4f5cc477c | /Problem12Roles/src/empleado/rol/RolSueldoTemporal.java | a7415345a0a6d613fcc7be5bc316ef3ddf54c948 | [] | no_license | NicolasBriones21/ejercicios-para-practicar-poo | 532935ba63e3dd7b0b1eda9015a306d769fd18b1 | e6ae465a1438b731b3a116bc90fd11f848907abf | refs/heads/master | 2023-03-26T03:40:34.493284 | 2016-11-03T20:01:39 | 2016-11-03T20:01:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,308 | java | package empleado.rol;
import java.util.GregorianCalendar;
/**
* Clase que modela los roles de
* manera temporal.
*
* @author garciparedes
*
*/
public class RolSueldoTemporal extends BaseRolSueldoMensual{
private static final String FECHA_BAJA = "Fecha Baja: ";
private GregorianCalendar fechaBaja;
/**
* Constructor de la clase RolSueldoTemporal.
*
* @param sueldo Sueldo base del empleado.
* @param fechaAlta Fecha de alta del empleado.
* @param fechaBaja Fecha de baja del empleado.
*/
public RolSueldoTemporal(double sueldo, GregorianCalendar fechaAlta, GregorianCalendar fechaBaja){
super( sueldo, fechaAlta);
assert(fechaBaja.after(fechaAlta));
this.fechaBaja = fechaBaja;
}
/**
* Setter de fecha baja.
*
* @param fechaBaja La fecha de baja debe ser posterior a la de alta.
*/
public void setFechaBaja(GregorianCalendar fechaBaja){
assert(fechaBaja.after(getFechaAlta()));
this.fechaBaja = fechaBaja;
}
/**
* Getter de fecha de baja.
*
* @return fecha de baja.
*/
public GregorianCalendar getFechaBaja(){
return fechaBaja;
}
/**
* Funcion encargado de transformar
* en cadena de caracteres el objeto.
*/
@Override
public String toString(){
return (super.toString() + FECHA_BAJA + getFechaBaja());
}
}
| [
"garciparedes@gmail.com"
] | garciparedes@gmail.com |
13b128026841fdb0669c8f65df1498ca8f7d850d | 98fa6ba5e6b07abe8c86717c7c50127d78f6730e | /src/ru/fizteh/fivt/students/vlmazlov/multifilemap/DataBaseReader.java | acd60ddbfb8112bdaf594a76fa45ddac2823bdc9 | [] | no_license | dmitrybaldin/fizteh-java-2013 | ae30d4629c52e84b86d02c56d67d4d79816a42fd | caae665c62a3f462753cf2df428a8f95c2332a00 | refs/heads/master | 2021-01-18T18:20:38.074369 | 2013-12-26T00:24:34 | 2013-12-26T00:24:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,492 | java | package ru.fizteh.fivt.students.vlmazlov.multifilemap;
import ru.fizteh.fivt.students.vlmazlov.filemap.FileMap;
import ru.fizteh.fivt.students.vlmazlov.shell.QuietCloser;
import ru.fizteh.fivt.students.vlmazlov.shell.FileOperationFailException;
import java.io.File;
import java.util.Iterator;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.util.Map;
public class DataBaseReader {
private static final int FILES_QUANTITY = 16;
private static final int DIRECTORIES_QUANTITY = 16;
private static int getNum(File file) {
String tokens[] = file.getName().split("\\.");
return Integer.parseInt(tokens[0]);
}
private static void addTablePart(FileMap tablePart, FileMap whole) {
for (Map.Entry<String, String> entry : tablePart) {
whole.put(entry.getKey(), entry.getValue());
}
}
private static void checkKeys(FileMap tablePart, File file, File directory) throws ValidityCheckFailedException {
for (Map.Entry<String, String> entry : tablePart) {
ValidityChecker.checkKeyStorageAffiliation(entry.getKey(), getNum(file), getNum(directory),
FILES_QUANTITY, DIRECTORIES_QUANTITY);
}
}
private static String readUTFString(RandomAccessFile dataBaseStorage, int readingPosition, int length) throws IOException {
byte[] bytes = new byte[length];
dataBaseStorage.seek(readingPosition);
dataBaseStorage.read(bytes);
return new String(bytes, "UTF-8");
}
public static void readMultiTableDataBase(MultiTableDataBase multiTableDataBase)
throws IOException, ValidityCheckFailedException {
File root = multiTableDataBase.getRoot();
ValidityChecker.checkMultiTableRoot(root);
for (File entry : root.listFiles()) {
multiTableDataBase.create(entry.getName());
FileMap curTable = multiTableDataBase.getTable(entry.getName());
readMultiFileMap(curTable, entry);
}
}
public static void readMultiFileMap(FileMap fileMap, File root) throws IOException, ValidityCheckFailedException {
ValidityChecker.checkMultiFileMapRoot(root);
FileMap[][] tableParts = new FileMap[DIRECTORIES_QUANTITY][FILES_QUANTITY];
for (int i = 0;i < tableParts.length;++i) {
for (int j = 0;j < tableParts[i].length;++j) {
tableParts[i][j] = new FileMap();
}
}
for (File directory : root.listFiles()) {
ValidityChecker.checkMultiFileStorageName(directory, DIRECTORIES_QUANTITY);
for (File file : directory.listFiles()) {
ValidityChecker.checkMultiFileStorageName(file, FILES_QUANTITY);
readFileMap(directory, file, tableParts[getNum(directory)][getNum(file)]);
checkKeys(tableParts[getNum(directory)][getNum(file)], file, directory);
}
}
for (int i = 0;i < tableParts.length;++i) {
for (int j = 0;j < tableParts[i].length;++j) {
addTablePart(tableParts[i][j], fileMap);
}
}
}
public static void readFileMap(File root, File storage, FileMap fileMap)
throws IOException, ValidityCheckFailedException {
if (root == null) {
throw new FileNotFoundException("Directory not specified");
}
ValidityChecker.checkFileMapRoot(root);
if ((!storage.exists()) || (storage.length() == 0)) {
return;
}
RandomAccessFile dataBaseStorage = new RandomAccessFile(storage, "r");
try {
String key = null;
int readPosition = 0, initialOffset = -1, prevOffset = -1;
do {
dataBaseStorage.seek(readPosition);
while (dataBaseStorage.getFilePointer() < dataBaseStorage.length()) {
if (dataBaseStorage.readByte() == '\0') {
break;
}
}
int keyLen = (int)dataBaseStorage.getFilePointer() - readPosition - 1;
int curOffset = (int)dataBaseStorage.readInt();
ValidityChecker.checkFileMapOffset(curOffset);
if (prevOffset == -1) {
initialOffset = curOffset;
} else {
String value = readUTFString(dataBaseStorage, prevOffset, curOffset - prevOffset);
ValidityChecker.checkFileMapValue(value);
fileMap.put(key, value);
}
prevOffset = curOffset;
//read key
key = readUTFString(dataBaseStorage, readPosition, keyLen);
ValidityChecker.checkFileMapKey(key);
readPosition = (int)dataBaseStorage.getFilePointer() + 5;
} while (readPosition < initialOffset);
String value = readUTFString(dataBaseStorage, prevOffset, (int)dataBaseStorage.length() - prevOffset);
ValidityChecker.checkFileMapValue(value);
fileMap.put(key, value);
} finally {
QuietCloser.closeQuietly(dataBaseStorage);
}
}
} | [
"vlmazlov@gmail.com"
] | vlmazlov@gmail.com |
73ef9c4405996e9eb772446e6abebeba4d1895fe | 250fb0f34cc88d49f9cac78a9d9e305ca361da07 | /Icarus/Console/cn/blacard/console/FILE_Opera/FileOpera.java | 9e91e8284a929d2ccd12945b0068bd8c0373eadb | [] | no_license | Onnt/Icarus | ef67a020f70efa0bbe39611cb724cb8e70811644 | 97cfddbc5540381bcee207035e4ebfe4226f92c1 | refs/heads/master | 2020-09-17T15:46:41.311625 | 2016-09-19T10:21:06 | 2016-09-19T10:21:06 | 67,686,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package cn.blacard.console.FILE_Opera;
import cn.blacard.console.xiaoqiu.Qiu;
public class FileOpera {
public static void start(){
OrderDeal.curSystemInfo();
while(true){
String[] orders = Qiu.getOrders();
Order.deal(orders);
}
}
}
| [
"Blacard@PC-201606062032"
] | Blacard@PC-201606062032 |
7bedf3d98812a5e0427663ef439d90a32a26b1be | ed786c36230663801f7deb844abe64abd709b4a6 | /GameAlgorithms/src/at/mw/games/tictactoe/TicTacToeMove.java | 3dbfcc054ec7caf7ba269d390cd1df7650630600 | [
"Apache-2.0"
] | permissive | winterer/GameTheory | 3835b508bfab3db978d18df35583e9be91bc06c1 | c45298cf3426bbf17d5102db5b8963f76ae7792d | refs/heads/master | 2020-05-18T03:49:32.898939 | 2016-10-27T09:31:47 | 2016-10-27T09:31:47 | 22,231,873 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 692 | java | package at.mw.games.tictactoe;
import at.mw.games.Move;
public class TicTacToeMove implements Move {
public final int bitMask;
public final TicTacToePlayer player;
public TicTacToeMove(int bitMask, TicTacToePlayer player) {
this.bitMask = bitMask;
this.player = player;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(3 * 3 + 3 * 2);
char c = player == TicTacToePlayer.Cross ? 'X' : 'O';
int v = 0x01;
for (int row = 0; row < 3; row++) {
for (int col = 0; col < 3; col++) {
if ((bitMask & v) != 0) {
sb.append(c);
} else {
sb.append('#');
}
v <<= 1;
}
sb.append("\r\n");
}
return sb.toString();
}
}
| [
"mario.winterer+github@gmail.com"
] | mario.winterer+github@gmail.com |
e89db823225dfe63e68006b231d032a07b6607fb | 06cf01aa7ae1ec68d242e91665041075fdaab707 | /app/src/main/java/com/business_idea/business_ideas_app/ChatRoomActivity.java | 8e607bac6c4c4c5293ff2cc610d761626ad500ef | [] | no_license | Muzammilzafar19/business_ideas_App | 6956d0c70228d3598b63a9fa47d89b1f56cac5c1 | 8b667f509bf1070b7617706d0651e18a1b8d8942 | refs/heads/master | 2021-07-09T02:44:36.493911 | 2020-08-29T12:39:32 | 2020-08-29T12:39:32 | 174,510,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,632 | java | package com.business_idea.business_ideas_app;
import android.app.ProgressDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.business_idea.business_ideas_app.Adapter.ChatListAdapter;
import com.business_idea.business_ideas_app.DataClasses.ChatListData;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ChatRoomActivity extends AppCompatActivity {
private ImageView _btnback;
private DatabaseReference mDatabase, refroot;
public RecyclerView rv;
private ChatListAdapter chatlistadapter;
private List<ChatListData> _list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat_room);
_btnback = findViewById(R.id._btnback);
_btnback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
fetchList();
}
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
public void fetchList() {
mDatabase = FirebaseDatabase.getInstance().getReference();
refroot = mDatabase.child("users");
_list = new ArrayList<>();
final ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setTitle("Loading");
progressDialog.setIcon(R.drawable.loading);
progressDialog.setMessage("Please Wait........");
progressDialog.show();
ValueEventListener eventListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
//create new user
progressDialog.dismiss();
try {
collectBlog((Map<String, Object>) dataSnapshot.getValue());
/* rv = findViewById(R.id.my_recycler_view);
rv.setHasFixedSize(true);
rv.setLayoutManager(new LinearLayoutManager(ShowBlogsActivity.this));
blogAdapter=new BlogAdapter(ShowBlogsActivity.this,blogdata);
rv.setAdapter(blogAdapter);
*/
} catch (Exception e) {
Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
// Toast.makeText(DashboardActivity.this,"Value "+name+" "+email,Toast.LENGTH_SHORT).show();
} else {
progressDialog.dismiss();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
Toast.makeText(ChatRoomActivity.this, databaseError.getMessage(), Toast.LENGTH_SHORT).show();
}
};
refroot.addListenerForSingleValueEvent(eventListener);
}
private List<ChatListData> collectBlog(Map<String, Object> users) {
ArrayList<String> phoneNumbers = new ArrayList<>();
List<ChatListData> _lis = new ArrayList<>();
//iterate through each user, ignoring their UID
for (Map.Entry<String, Object> entry : users.entrySet()) {
//Get user map
Map singleUser = (Map) entry.getValue();
//Get phone field and append to list
//phoneNumbers.add((String) singleUser.get("title"));
_list.add(new ChatListData((String) singleUser.get("userName"), (String) singleUser.get("userType"), (String) singleUser.get("imageUrl"),(String) singleUser.get("uid")));
// Toast.makeText(ShowBlogsActivity.this,(String) singleUser.get("title"),Toast.LENGTH_SHORT).show();
}
rv = findViewById(R.id.chatlist_recycle);
rv.setHasFixedSize(true);
rv.setLayoutManager(new LinearLayoutManager(ChatRoomActivity.this));
chatlistadapter = new ChatListAdapter(ChatRoomActivity.this, _list);
rv.setAdapter(chatlistadapter);
return _list;
}
}
| [
"muzammilzafar19@gmail.com"
] | muzammilzafar19@gmail.com |
ed4a13ac95267f050781f03fecfdb6e20a5e3a5a | 46e5b636da0580a6d7eddd10538ce507f30bee6c | /o.n.antlr.editor/src/test/java/org/netbeans/modules/antlr/editor/NbAntlrLexerTest.java | 4d09cc05e7cf253c13c45aa0dba004f117e29ee5 | [
"Apache-2.0"
] | permissive | timboudreau/netbeans-contrib | b96c700768cca0932a0e2350362352352b3b91f6 | f1e67dbd0f5c6ae596bd9754b5b1ba22cfe8cb8e | refs/heads/master | 2023-01-25T00:36:37.680959 | 2023-01-06T06:07:09 | 2023-01-06T06:07:09 | 141,208,493 | 4 | 2 | NOASSERTION | 2022-09-01T22:50:24 | 2018-07-17T00:13:23 | Java | UTF-8 | Java | false | false | 3,286 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2013 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Contributor(s):
*
* Portions Copyrighted 2013 Sun Microsystems, Inc.
*/
package org.netbeans.modules.antlr.editor;
import org.netbeans.api.lexer.Token;
import org.netbeans.api.lexer.TokenHierarchy;
import org.netbeans.api.lexer.TokenSequence;
import org.netbeans.editor.BaseDocument;
import org.openide.filesystems.FileObject;
/**
*
* @author marekfukala
*/
public class NbAntlrLexerTest extends AntlrTestBase {
public NbAntlrLexerTest(String testName) {
super(testName);
}
public void testLexAntlrGrammar() {
FileObject testFile = getTestFile("testfiles/ANTLRv3.g");
final BaseDocument document = getDocument(testFile);
document.render(new Runnable() {
@Override
public void run() {
TokenHierarchy th = TokenHierarchy.get(document);
assertNotNull(th);
TokenSequence<AntlrTokenId> ts = th.tokenSequence(AntlrTokenId.language());
ts.moveStart();
while(ts.moveNext()) {
Token<AntlrTokenId> t = ts.token();
System.out.println("'" + t.text() + "', " + t.id());
}
}
});
}
}
| [
"mfukala@netbeans.org"
] | mfukala@netbeans.org |
b6149989ab30bb0732cfb0e02b4914455c0505cd | 5f574f02674e775833a307aa8bb1b2b5c5b52ea7 | /src/main/java/com/lumbu/tradingsignalparser/pojo/response/child/Urls.java | 59de2dd4159557ac5448c3ba64e77ce9c7727c49 | [] | no_license | myITToolBox/trading-signal-parser | d788cc96403cdbcf02987b881e81e5d3fbe58b8e | 1a6a554fb6e135e2bc099c69ae8b86dbffaeeffc | refs/heads/master | 2023-03-01T07:51:14.173600 | 2021-02-03T14:43:42 | 2021-02-03T14:43:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,283 | java | package com.lumbu.tradingsignalparser.pojo.response.child;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Urls {
private String url;
@JsonProperty("expanded_url")
private String expandedUrl;
@JsonProperty("display_url")
private String displayUrl;
private ArrayList<Long> indices;
public Urls() {
}
public Urls(String url, String expandedUrl, String displayUrl, ArrayList<Long> indices) {
super();
this.url = url;
this.expandedUrl = expandedUrl;
this.displayUrl = displayUrl;
this.indices = indices;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getExpandedUrl() {
return expandedUrl;
}
public void setExpandedUrl(String expandedUrl) {
this.expandedUrl = expandedUrl;
}
public String getDisplayUrl() {
return displayUrl;
}
public void setDisplayUrl(String displayUrl) {
this.displayUrl = displayUrl;
}
public ArrayList<Long> getIndices() {
return indices;
}
public void setIndices(ArrayList<Long> indices) {
this.indices = indices;
}
@Override
public String toString() {
return "Urls [url=" + url + ", expandedUrl=" + expandedUrl + ", displayUrl=" + displayUrl + ", indices="
+ indices + "]";
}
}
| [
"azizsugianto@rocketmail.com"
] | azizsugianto@rocketmail.com |
41fdeda0a70735ab002b6ece06a4a465e7a7d9a6 | 1d22ce8184cc35ea68fd99e683dad0cb23824ef7 | /app/src/main/java/com/oscarchang/androidapp/adapter/ListViewAdapter.java | 4ca8cca2664d96be0af23cbcbeced6fcc8403073 | [] | no_license | CUITzyt/OcAndroidApp | 3e853a7b2b2ab849c74372378958c326424bfa99 | a67473d0a3bcb7b66cdc25db3c6648d5738d791b | refs/heads/master | 2020-03-09T22:05:46.932989 | 2018-05-19T09:38:00 | 2018-05-19T09:38:00 | 129,026,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,685 | java | package com.oscarchang.androidapp.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
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.oscarchang.androidapp.R;
import com.oscarchang.androidapp.comm.DataUtil;
import com.oscarchang.androidapp.comm.MyLog;
import com.oscarchang.androidapp.net.NetImageAsyncTask;
import com.oscarchang.androidapp.picsView.PostImage;
import java.util.ArrayList;
/**
* Created by OscarChang on 2018/3/30.
*/
public class ListViewAdapter extends BaseAdapter{
private ArrayList<String> picNames = new ArrayList<String>();
private LayoutInflater mInflater;
private Handler mHandler;
public ListViewAdapter(Context context, ArrayList<String> mNames){
picNames = mNames;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return picNames.size();
}
@Override
public Object getItem(int position) {
return picNames.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public void setHandler(Handler pHandler){
this.mHandler = pHandler;
}
public void refreshUI(){
for (int i=6; i<10; i++){
picNames.add(DataUtil.getDownPicPath(i));
}
notifyDataSetChanged();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
View pView = convertView;
if (pView == null){
holder = new ViewHolder();
pView = mInflater.inflate(R.layout.list_item,null);
holder.mImage = (ImageView)pView.findViewById(R.id.lst_item_image);
holder.mText = (TextView)pView.findViewById(R.id.lst_item_txt);
pView.setTag(holder);
}else {
holder = (ViewHolder)pView.getTag();
}
String currentPicPath = picNames.get(position);
holder.mText.setText(currentPicPath.substring(currentPicPath.lastIndexOf("/") + 1));
NetImageAsyncTask loadImageTask = new NetImageAsyncTask(currentPicPath,new PostImage() {
@Override
public void postImage(Bitmap bitMap) {
holder.mImage.setImageBitmap(bitMap);
}
});
MyLog.i(" to excute image net ");
loadImageTask.execute(currentPicPath);
return pView;
}
public class ViewHolder{
public ImageView mImage;
public TextView mText;
}
}
| [
"260120684@qq.com"
] | 260120684@qq.com |
c06e96df9d137c2735955e2771f6c0fcd7e162f9 | 3a0edbb2fddaa06bdf010fa742b2fc3eb030198e | /portal/src/com/hansy/portal/model/vo/TUserBillVo.java | 6953a52c5c11f828ae6f5e40c9e91e73417b7d3b | [] | no_license | hanhan167/portal | 9cece4545c40b24d4b979105994faac967d664f9 | 8cef8829216b1723b5c6ba15c21a92a0d4cb2323 | refs/heads/master | 2021-09-01T05:57:14.965357 | 2017-12-25T07:05:46 | 2017-12-25T07:05:46 | 110,626,308 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,655 | java |
package com.hansy.portal.model.vo;
import java.util.Date;
public class TUserBillVo {
private String custNo;//商户编号
private String billType;//发票类型普通发票,电子发票,增值税发票
private String billTitle;//发票抬头,个人,公司
private String billReceipt;//纳税人识别号
private String billContent;//发票内容
private String billReceivePhone;//收票人手机号
private String billReceiveAddress;//收票人邮箱
private String billStatus;//发票状态
private Date insertDate;//新增时间
private Date updateDate;//修改时间
private Double billMoney;//发票总金额
private String companyName;//单位名称
private String registerAddress;//单位注册地址
private String registerPhone;//单位注册手机号码
private String openBand;//开户行
private String bandCard;//银行卡
private String billReceiveName;//收票人姓名
private String billReceiveMail;//收票人邮箱
private String billNatrue;//类型
private String applyNo;//申请编号
private String billProvince;//省
private String billCity;//市
private String billArea;//区
public String getCustNo() {
return custNo;
}
public String getBillNatrue() {
return billNatrue;
}
public void setBillNatrue(String billNatrue) {
this.billNatrue = billNatrue;
}
public void setCustNo(String custNo) {
this.custNo = custNo;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getBillTitle() {
return billTitle;
}
public void setBillTitle(String billTitle) {
this.billTitle = billTitle;
}
public String getBillReceipt() {
return billReceipt;
}
public void setBillReceipt(String billReceipt) {
this.billReceipt = billReceipt;
}
public String getBillContent() {
return billContent;
}
public void setBillContent(String billContent) {
this.billContent = billContent;
}
public String getBillReceivePhone() {
return billReceivePhone;
}
public void setBillReceivePhone(String billReceivePhone) {
this.billReceivePhone = billReceivePhone;
}
public String getBillReceiveAddress() {
return billReceiveAddress;
}
public void setBillReceiveAddress(String billReceiveAddress) {
this.billReceiveAddress = billReceiveAddress;
}
public String getBillStatus() {
return billStatus;
}
public void setBillStatus(String billStatus) {
this.billStatus = billStatus;
}
public Date getInsertDate() {
return insertDate;
}
public void setInsertDate(Date insertDate) {
this.insertDate = insertDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public Double getBillMoney() {
return billMoney;
}
public void setBillMoney(Double billMoney) {
this.billMoney = billMoney;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getRegisterAddress() {
return registerAddress;
}
public void setRegisterAddress(String registerAddress) {
this.registerAddress = registerAddress;
}
public String getRegisterPhone() {
return registerPhone;
}
public void setRegisterPhone(String registerPhone) {
this.registerPhone = registerPhone;
}
public String getOpenBand() {
return openBand;
}
public void setOpenBand(String openBand) {
this.openBand = openBand;
}
public String getBandCard() {
return bandCard;
}
public void setBandCard(String bandCard) {
this.bandCard = bandCard;
}
public String getBillReceiveName() {
return billReceiveName;
}
public void setBillReceiveName(String billReceiveName) {
this.billReceiveName = billReceiveName;
}
public String getBillReceiveMail() {
return billReceiveMail;
}
public void setBillReceiveMail(String billReceiveMail) {
this.billReceiveMail = billReceiveMail;
}
public String getBillProvince() {
return billProvince;
}
public void setBillProvince(String billProvince) {
this.billProvince = billProvince;
}
public String getBillCity() {
return billCity;
}
public void setBillCity(String billCity) {
this.billCity = billCity;
}
public String getBillArea() {
return billArea;
}
public void setBillArea(String billArea) {
this.billArea = billArea;
}
public String getApplyNo() {
return applyNo;
}
public void setApplyNo(String applyNo) {
this.applyNo = applyNo;
}
}
| [
"375441493@qq.com"
] | 375441493@qq.com |
6dd37a97df36bc5b8a95b0686fb8f09548963211 | 1ee21f095d96f418962bdcb9e14563e5ab119936 | /Aula4Exercicio2/app/src/main/java/br/com/targettrust/aula4exercicio2/MovieVideosFragment.java | 7907c27a82f3dbe5c9b40c924166a782483879c7 | [] | no_license | MarceloLeite2604/curso_android_avancado | 766d4d9b4e4dc5a2cce79e76a3a88452557288e7 | 4279b4775acb6b31f1c56d69b4d561f905204d91 | refs/heads/master | 2021-01-12T12:03:16.683905 | 2016-10-16T00:32:41 | 2016-10-16T00:32:41 | 69,913,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,689 | java | package br.com.targettrust.aula4exercicio2;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.koushikdutta.ion.Ion;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import br.com.targettrust.aula4exercicio2.objects.Movie;
import static android.R.attr.screenSize;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link MovieVideosFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link MovieVideosFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class MovieVideosFragment extends Fragment implements FutureCallBackGetVideoKeysFromJsonObject.OnTaskCompletedInterface {
private static final String ARG_PARAM1 = "movie";
private static final String ARG_PARAM2 = "displayMetrics";
private Movie movie;
private View fragmentView;
private OnFragmentInteractionListener onFragmentInteractionListener;
private Integer[] screenSize;
public MovieVideosFragment() {
}
public static MovieVideosFragment newInstance(Movie movie, Integer[] screenSize) {
MovieVideosFragment fragment = new MovieVideosFragment();
Bundle args = new Bundle();
args.putSerializable(ARG_PARAM1, movie);
args.putSerializable(ARG_PARAM2, screenSize);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
movie = (Movie) getArguments().getSerializable(ARG_PARAM1);
screenSize = (Integer[]) getArguments().getSerializable(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.d(MainActivity.LOG_TAG, "{onCreateView, 56} ");
fragmentView = inflater.inflate(R.layout.fragment_movie_videos, container, false);
getMovieVideosAddresses();
return fragmentView;
}
private void getMovieVideosAddresses() {
// Elaborate address to get movie videos.
String apiServer = getString(R.string.imdb_api_server);
String apiMovieVideos = getString(R.string.imdb_api_movie_videos).replace("#movieId#", movie.getImdb());
String serviceAddress = apiServer + apiMovieVideos;
// Add the key parameter.
String keyParameterName = getString(R.string.key_parameter_name);
String key = getString(R.string.imdb_api_key);
serviceAddress += keyParameterName + "=" + key;
Log.d(MainActivity.LOG_TAG, "{getMovieVideosAddresses, 70} Video keys api address: " + serviceAddress);
FutureCallBackGetVideoKeysFromJsonObject futureCallBackGetVideoAddressesFromJsonObject = new FutureCallBackGetVideoKeysFromJsonObject(getContext(), this);
Ion.with(getContext()).load(serviceAddress).asJsonObject()
.setCallback(futureCallBackGetVideoAddressesFromJsonObject);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnFragmentInteractionListener) {
onFragmentInteractionListener = (OnFragmentInteractionListener) context;
} else {
throw new RuntimeException(context.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
onFragmentInteractionListener = null;
}
@Override
public void getVideoKeysFromJsonObjectCompleted(ArrayList<String> videoKeyArrayList) {
Log.d(MainActivity.LOG_TAG, "{getVideoKeysFromJsonObjectCompleted, 102} Creating web view.");
WebView webViewVideo = (WebView) fragmentView.findViewById(R.id.webview_video);
String videoSource = null;
if (videoKeyArrayList.size() > 0) {
videoSource = getString(R.string.youtube_video_source).replace("#videoKey#", videoKeyArrayList.get(0));
Log.d(MainActivity.LOG_TAG, "{getVideoKeysFromJsonObjectCompleted, 118} Video source: " + videoSource);
}
Log.d(MainActivity.LOG_TAG, "{getVideoKeysFromJsonObjectCompleted, 107} Video source: " + videoSource);
//
if (videoSource != null) {
webViewVideo.getSettings().setJavaScriptEnabled(true);
webViewVideo.loadUrl(videoSource);
} else {
String customHtml = "<!DOCTYPE html>\n" +
"<html>\n" +
"<head>\n" +
" <meta charset=\"utf-8\">\n" +
" <meta name=\"viewport\" content=\"width=device-width\">\n" +
" <title>Trailer</title>\n" +
"</head>\n" +
"<body>\n" +
"<p>Sorry, but no video is available for this movie!</p>\n" +
"</body>\n" +
"</html>";
webViewVideo.getSettings().setJavaScriptEnabled(false);
webViewVideo.loadData(customHtml, "text/html", "UTF-8");
}
}
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onMovieDetailFragmentInteraction(Uri uri);
}
}
| [
"marceloleite2604@gmail.com"
] | marceloleite2604@gmail.com |
f42398033312e66fe38028a5114847fcf06992ef | 137064a34cef7582e1058b5c23af318a9f8e9ea9 | /VectorDraw/VectorDraw/src/eg/edu/alexu/csd/oop/draw/Engine.java | 716de54d8aca26cb808589d32c020cad4d4222e5 | [] | no_license | mohamedramadan2515/VectorDraw | afcd2ba7b9595dd4b7a723d378a262834e9b3c87 | 92c277e576a71c126c6207c2335aa476d5ad3918 | refs/heads/master | 2021-01-17T17:16:20.200658 | 2016-08-07T20:51:01 | 2016-08-07T20:51:01 | 65,155,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,837 | java | package eg.edu.alexu.csd.oop.draw;
import java.awt.Graphics;
import java.io.IOException;
import java.nio.file.InvalidPathException;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
public class Engine implements DrawingEngine {
private List<Class<? extends Shape>> shapes = null;
private static Engine instance;
private Engine() {
History.destoryInstance();
}
public static void destoryInstance() {
instance = null;
}
public static Engine getInstance() {
if (instance == null) {
instance = new Engine();
}
return instance;
}
@Override
public void refresh(Graphics canvas) {
Shape[] shapes = getShapes();
for (Shape shape : shapes) {
shape.draw(canvas);
}
}
@Override
public void addShape(Shape shape) {
History.getInstance().add(shape);
}
@Override
public void removeShape(Shape shape) {
try {
History.getInstance().removeShape(shape);
} catch (NullPointerException e) {
throw new NullPointerException();
}
}
@Override
public void updateShape(Shape oldShape, Shape newShape) {
try {
History.getInstance().updateShape(oldShape, newShape);
} catch (NullPointerException e) {
throw new NullPointerException();
}
}
@Override
public Shape[] getShapes() {
Shape[] current = new Shape[History.getInstance().size()];
LinkedList<Shape> shapes;
try {
shapes = History.getInstance().getCurrent();
} catch (NullPointerException e) {
throw new NullPointerException();
}
return shapes.toArray(current);
}
@SuppressWarnings("unchecked")
@Override
public List<Class<? extends Shape>> getSupportedShapes() {
shapes = new LinkedList<Class<? extends Shape>>();
shapes.add(Line.class);
shapes.add(Triangle.class);
shapes.add(Rectangle.class);
shapes.add(Square.class);
shapes.add(Ellipse.class);
shapes.add(Circle.class);
try {
ClassFinder cf = new ClassFinder();
Set<?> classes = cf.findClasses(Shape.class);
for (Object className : classes) {
Class<?> clazz = Class.forName((String) className);
if (!shapes.contains(clazz)) {
shapes.add((Class<? extends Shape>) clazz);
}
}
} catch (ClassNotFoundException | IOException e) {
}
return shapes;
}
public List<Class<? extends Shape>> getValidShapes() {
return shapes;
}
@Override
public void undo() {
try {
History.getInstance().undo();
} catch (NullPointerException e) {
throw new NullPointerException();
}
}
@Override
public void redo() {
try {
History.getInstance().redo();
} catch (NullPointerException e) {
throw new NullPointerException();
}
}
@Override
public void save(String path) {
try {
if ((path.toLowerCase()).endsWith(".xml")) {
XML xml = new XML();
xml.save(this.getShapes(), path);
} else if ((path.toLowerCase()).endsWith(".json")) {
JSON json = new JSON();
json.save(this.getShapes(), path);
} else {
throw new InvalidPathException(path, "WRONG EXTENSION");
}
} catch (Exception e) {
throw new RuntimeException();
}
}
@Override
public void load(String path) {
try {
if ((path.toLowerCase()).endsWith(".xml")) {
XML xml = new XML();
Shape[] shapes = xml.load(path);
History.destoryInstance();
History.getInstance().adddummy();
History.getInstance().add(shapes);
} else if ((path.toLowerCase()).endsWith(".json")) {
JSON json = new JSON();
Shape[] shapes = json.load(path);
History.destoryInstance();
History.getInstance().adddummy();
History.getInstance().add(shapes);
} else {
throw new InvalidPathException(path, "WRONG EXTENSION");
}
} catch (Exception e) {
throw new RuntimeException();
}
}
}
| [
"Ramadan@RamadanPC"
] | Ramadan@RamadanPC |
39c6a4c8917c5708f4a4bdd8ecdd77367e727c67 | f4030bf283b1f48f283ef035359749f9db25801e | /build/tmp/expandedArchives/forge-1.16.4-35.1.0_mapped_snapshot_20201028-1.16.3-sources.jar_c51f1a4d6ae306192d7f9edae1dccaf5/net/minecraft/world/server/package-info.java | d4cc6f527286b9b3b1574c7658d007f1f53dccfe | [
"MIT"
] | permissive | Slightly-Useful-Inc/DankestMod | 803a1cb913ee16251d52d54053918ecca27cea48 | 01345585be6a26587a44cee341a99a5efe31cc51 | refs/heads/master | 2023-03-06T11:37:44.104046 | 2021-02-16T23:12:19 | 2021-02-16T23:12:19 | 316,117,727 | 2 | 3 | MIT | 2021-02-16T23:12:20 | 2020-11-26T03:54:33 | Java | UTF-8 | Java | false | false | 233 | java | // Auto generated package-info by MCP
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package net.minecraft.world.server;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault; | [
"amdecapio@gmail.com"
] | amdecapio@gmail.com |
ce444d8edd7c6d4f930b6ac96770b889fa15d2a4 | d1653f4fb1e2689086f273472c646f1e3dc7ec6e | /app/src/test/java/com/example/franciscoandrade/daggerstepbystep/ExampleUnitTest.java | 6cf501e67bb80a0a79e77ab98ced29ef63042e6c | [] | no_license | 7sco/DaggerStepByStep | f7f3ccfed4a3332388692d282ba53318255fc1d5 | 55f29117e0c5af8e80b72f660230a4dd7ffb6d27 | refs/heads/master | 2020-03-17T22:13:52.045670 | 2018-05-19T02:21:45 | 2018-05-19T02:21:45 | 133,994,753 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.example.franciscoandrade.daggerstepbystep;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"xaviandrade14@gmail.com"
] | xaviandrade14@gmail.com |
9516ba9c1b3ef0efda793bc3906d8708bf0994a2 | 86bc7842ea73461684a9d85ef0754ff1e82a0e19 | /Webpage.java | 8852e78a8008ba252f4efd859e7914ef02cdaad5 | [] | no_license | Evanlaarhoven/cs230-assign4 | 5736e457cf71d13cfb2da49a332d8e7d8572fca8 | d48ac435be635c571b7429e107c37160f40b83db | refs/heads/master | 2021-06-28T14:51:17.874550 | 2017-09-19T02:32:48 | 2017-09-19T02:32:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,952 | java | /**
* Webpage.java
* Written by: Emily Van Laarhoven
* CS 230 Assignment 4
* Due: Tuesday Oct 4, 2016 @11:59pm
*/
public class Webpage implements Comparable<Webpage> {
//instance vars
private String urlName;
private int lineCounter;
private String pageContent;
//constructor
public Webpage(String urlName, int lineCounter, String pageContent) {
this.urlName=urlName;
this.lineCounter=lineCounter;
this.pageContent=pageContent;
}
//Getters
public String getURLName() {
return urlName;
}
public int getLineCounter() {
return lineCounter;
}
public String getPageContent() {
return pageContent;
}
//Setters
public void setURLName(String name) {
urlName=name;
}
public void setLineCounter(int value) {
lineCounter = value;
}
public void setPageContent(String content) {
pageContent = content;
}
//CompareTo
public int compareTo(Webpage p){
if (lineCounter > p.getLineCounter()) {
return 1;
}else if (lineCounter < p.getLineCounter()) {
return -1;
} else {
return 0;
}
}
//toString
public String toString() {
String s = this.urlName+" : "+this.lineCounter+" : "+this.pageContent.substring(0,20);
return s;
}
//main
public static void main (String[] args) {
Webpage google = new Webpage("http://www.google.com",10,"This is the google website so fancy!");
System.out.println(google);
google.setLineCounter(100);
google.setPageContent("Goooooooooooooooooooogle");
System.out.println(google);
Webpage wellesley = new Webpage("http://wellesley.edu",50,"what a swell college");
System.out.println(wellesley.compareTo(google));
System.out.println(google.compareTo(wellesley));
wellesley.setLineCounter(100);
System.out.println(wellesley.compareTo(google));
}
} | [
"noreply@github.com"
] | noreply@github.com |
4f1b6c97bfe806de83625790cab9f7c36e1dd831 | 1e4bb27f08c281501f7bfae4b1d646de8f876b36 | /app/src/main/java/dirtybloom/smartsensing/MainActivity.java | 7d1587f05ae286684dfcc71f855b2462b6864f47 | [] | no_license | dirtybloom/SmartSensing | 9a894a5a10492718f34a69a5537c0b35548af0f9 | eaf8992acd2dbc042a46ecaa4338e566252079e1 | refs/heads/master | 2020-04-05T22:57:42.469932 | 2015-06-30T15:13:54 | 2015-06-30T15:13:54 | 38,304,616 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,629 | java | package dirtybloom.smartsensing;
import android.net.ConnectivityManager;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import dirtybloom.smartsensing.sys.SysReceiver;
import dirtybloom.smartsensing.sys.SysService;
import dirtybloom.smartsensing.sys.speedtest.SpeedtestHelper;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String name = SpeedtestHelper.getNetworkClass((ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE));
Log.d("MobileNetworkClass",name);
/*if(savedInstanceState == null){
SysReceiver.scheduleOperations(getApplicationContext());
}*/
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"dirtybloom@gmail.com"
] | dirtybloom@gmail.com |
ab699dc67ed25a72b7f34ac85ad2652b7e46590a | 953e9203a2ab40ada4e8e42fe46aa7fec837466a | /app/src/main/java/com/agentk/tictactoe/users/UserListActivity.java | db016ce013a3f5e1e80ca038871c273efbca2ee5 | [] | no_license | AgentK47/tictactoe | 1c532f2345fcc441d00d70e1b89162cf099dc061 | 947a4aeaa0dfb56e0afe60b3a455316066dced1e | refs/heads/master | 2023-01-06T14:43:16.269660 | 2020-10-25T05:08:05 | 2020-10-25T05:08:05 | 306,998,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,683 | java | package com.agentk.tictactoe.users;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.agentk.tictactoe.OnlineActivity;
import com.agentk.tictactoe.R;
import com.agentk.tictactoe.databinding.ActivityUserListBinding;
import com.agentk.tictactoe.model.User;
import com.agentk.tictactoe.push_notifications.Util;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthCredential;
import com.google.firebase.auth.EmailAuthProvider;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ServerValue;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static com.agentk.tictactoe.PrincipalPage.getDefaults;
import static com.agentk.tictactoe.PrincipalPage.setDefaults;
public class UserListActivity extends AppCompatActivity {
private static final String LOG_TAG = "UserListActivity";
Context context=this;
private List<User> users = new ArrayList<>();
private Adapter adapter;
private String grid;
private String status;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityUserListBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_user_list);
// ActionBar actionBar=getSupportActionBar();
// actionBar.hide();
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String uid = user.getUid();
grid=getDefaults("grid",getApplicationContext());
Log.d( "onCreateGrid: ",grid);
adapter = new Adapter(this, users, grid);
binding.list.setAdapter(adapter);
binding.list.setLayoutManager(new LinearLayoutManager(this));
TextView emptyList=binding.emptyList;
emptyList.setVisibility(View.GONE);
// any time that connectionsRef's value is null (i.e. has no children) I am offline
final FirebaseDatabase database = FirebaseDatabase.getInstance();
final DatabaseReference myConnectionsRef = database.getReference().child("users").child(uid).child("connections");
// stores the timestamp of my last disconnect (the last time I was seen online)
final DatabaseReference lastOnlineRef = database.getReference().child("users").child(uid).child("lastOnline");
// change status to 0
final DatabaseReference lastOnlineSt = database.getReference().child("users").child(uid).child("status");
DatabaseReference connectedRef = FirebaseDatabase.getInstance().getReference(".info/connected");
connectedRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
boolean connected = snapshot.getValue(Boolean.class);
if (connected) {
DatabaseReference con = myConnectionsRef.push();
// when this device disconnects, remove it
con.onDisconnect().removeValue();
// when I disconnect, update the last time I was seen online
lastOnlineRef.onDisconnect().setValue(ServerValue.TIMESTAMP);
//update the status to 0
lastOnlineSt.onDisconnect().setValue("0");
// add this device to my connections list
// this value could contain info about the device or a timestamp too
con.setValue(Boolean.TRUE);
System.out.println("connected");
FirebaseDatabase.getInstance().getReference().child("users").child(uid).child("status")
.setValue("1");
}
}
@Override
public void onCancelled(DatabaseError error) {
System.err.println("Listener was cancelled at .info/connected");
}
});
fetchUsers();
fetchUser();
if(users.size()==0) emptyList.setVisibility(VISIBLE);
}
public interface SimpleCallback<T> {
void callback(T data);
}
private void getStatus(@NonNull SimpleCallback<String> finishedCallback){
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String uid = user.getUid();
FirebaseDatabase.getInstance().getReference().child("users").child(uid)
.child("status")
.addValueEventListener(new ValueEventListener (){
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
finishedCallback.callback(String.valueOf(dataSnapshot.getValue()));
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void delete(){
Dialog alertDialog = new Dialog(context);
alertDialog.setContentView(R.layout.delinfo);
// set the custom dialog components - text, image and button
TextView text = (TextView) alertDialog.findViewById(R.id.text);
ProgressBar pb=(ProgressBar) alertDialog.findViewById(R.id.progressBar2);
pb.setVisibility(View.GONE);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String uid = user.getUid();
text.setText(getString(R.string.delete_account)+" "+user.getEmail());
text.setTextSize(18);
alertDialog.show();
Button dialogButton = (Button) alertDialog.findViewById(R.id.dialogButtonOK);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(V->{
pb.setVisibility(View.VISIBLE);
FirebaseDatabase.getInstance().getReference().child("users").child(uid)
.removeValue();
AuthCredential credential = EmailAuthProvider
.getCredential(user.getEmail(), "123456");
user.reauthenticate(credential)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
user.delete()
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Toast.makeText(context, getString(R.string.account_deleted), Toast.LENGTH_LONG).show();
startActivity(new Intent(context, OnlineActivity.class));
finish();
}
}
});
}
});
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_online:
Dialog alertDialog = new Dialog(context);
alertDialog.setContentView(R.layout.delinfo);
// set the custom dialog components - text, image and button
TextView text = alertDialog.findViewById(R.id.text);
ProgressBar pb= alertDialog.findViewById(R.id.progressBar2);
pb.setVisibility(View.GONE);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String uid = user.getUid();
String msgText=getString(R.string.account_profile) + " "+(status=="0"?getString(R.string._online):getString(R.string._offline));
text.setText(msgText);
text.setTextSize(18);
alertDialog.show();
Button dialogButton = alertDialog.findViewById(R.id.dialogButtonOK);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(V->{
pb.setVisibility(View.VISIBLE);
if(status.equals("0")){
FirebaseDatabase.getInstance().getReference().child("users").child(uid).child("status")
.setValue("1");
}else{
FirebaseDatabase.getInstance().getReference().child("users").child(uid).child("status")
.setValue("0");
}
alertDialog.dismiss();
});
return true;
case R.id.action_delete:
UserListActivity.this.delete();
return true;
default:
// If we got here, the user's action was not recognized.
// Invoke the superclass to handle it.
return super.onOptionsItemSelected(item);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.user_bar, menu);
MenuItem onlineStatus = menu.findItem(R.id.action_online);
// MenuItem delete = menu.findItem(R.id.action_delete);
getStatus(new SimpleCallback<String>() {
@Override
public void callback(String data) {
if (data.equals("1")) {
status="1";
onlineStatus.setIcon(R.drawable.online);
} else {
status="0";
onlineStatus.setIcon(R.drawable.offline);
}
}
});
/*
menu.add(status=="1"?"Online":"Offline")
.setIcon(status=="1"?R.drawable.online:R.drawable.offline)
.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
UserListActivity.this.userStatus();
return true;
}
})
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menu.add("Delete your Account")
.setIcon(android.R.drawable.ic_delete)
.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
UserListActivity.this.delete();
return true;
}
})
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
*/
return true;
}
private void fetchUser(){
FirebaseDatabase.getInstance().getReference().child("users").addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
users.clear();
fetchUsers();
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void fetchUsers() {
FirebaseDatabase.getInstance().getReference().child("users")
.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
User user = snapshot.getValue(User.class);
if (!snapshot.getKey().equals(Util.getCurrentUserId())) {
if(user.getStatus() != null && user.getStatus().equals("1"))
users.add(user);
}
}
adapter.notifyDataSetChanged();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
| [
"ekd4042@umoncton.ca"
] | ekd4042@umoncton.ca |
25147530be99145296b8a578491c1a0e23253b76 | 889384c89ca05590415c01dbd214c73c6d05ab7d | /FireTimeEJB/ejbModule/fr/firesoft/fireTime/impl/CompetenceManager.java | 23ff0b988608e5927b950540c1f303b7a5bd9e3c | [] | no_license | xbeaufils/sergeo | b6ecb1095f14be985ef4664bca7d55f514ff6d03 | 3dfee2fbe78b8b6bc18863fab6000c07a6d6e446 | refs/heads/master | 2021-01-02T22:38:01.356963 | 2015-05-12T15:50:30 | 2015-05-12T15:50:30 | 31,075,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,092 | java | /**
*
*/
package fr.firesoft.fireTime.impl;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fr.firesoft.fireTime.bean.CompetenceManagerLocal;
import fr.firesoft.fireTime.bean.EffectifDaoLocal;
import fr.firesoft.fireTime.entity.Activite;
import fr.firesoft.fireTime.entity.CategorieEmploi;
import fr.firesoft.fireTime.entity.CompetenceAgent;
import fr.firesoft.fireTime.entity.EmploiOperationnel;
import fr.firesoft.fireTime.entity.UniteValeur;
import fr.firesoft.fireTime.entity.effectif.Agent;
import fr.firesoft.fireTime.entity.horaire.PlageHoraire;
import fr.firesoft.fireTime.factory.HelperFactory;
import fr.firesoft.fireTime.helper.CompetenceAgentHelper;
/**
* @author xbeaufils
*
*/
/**
* @author xbeaufils
*
*/
@Local (CompetenceManagerLocal.class)
@Stateless
public class CompetenceManager implements CompetenceManagerLocal {
Logger log = LoggerFactory.getLogger(CompetenceManager.class);
@PersistenceContext(unitName = "FireTime")
private EntityManager em;
@EJB
private EffectifDaoLocal aDaoEffectif;
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#addCompetenceForAgent(java.lang.Integer, java.lang.String, java.lang.Integer, java.util.Date, java.util.Date)
*/
@SuppressWarnings("unchecked")
@Override
public void addCompetenceForAgent(Integer idfAgent, String codeUniteValeur,
Integer niveau, Date debut, Date fin, Activite actif) {
EmploiOperationnel emploi = this.selectEmploiOperationnelByCodeAndLevel(codeUniteValeur, niveau);
Query query = em.createNamedQuery("CompetenceAgent.selectByAgentAndEmploi");
query.setParameter("idfAgent", idfAgent);
query.setParameter("idfEmploi", emploi.getIdEmploi());
List<CompetenceAgent> lstCompetence = query.getResultList();
CompetenceAgent aCompetence;
if (lstCompetence.isEmpty()) {
Agent agent = aDaoEffectif.select(idfAgent);
if (agent == null)
return;
aCompetence = new CompetenceAgent();
aCompetence.setAgent(agent);
aCompetence.setEmploi(emploi);
aCompetence.setDteDebut(debut);
aCompetence.setDteFin(fin);
aCompetence.setActivite(actif);
em.persist(aCompetence);
}
else {
for (CompetenceAgent iterateCompetence : lstCompetence) {
if (iterateCompetence.getDteDebut().equals(debut)) {
iterateCompetence.setActivite(actif);
iterateCompetence.setDteFin(fin);
}
}
}
}
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#saveCompetence(fr.firesoft.fireTime.helper.CompetenceAgentHelper)
*/
@Override
public void saveCompetence(CompetenceAgentHelper helper) {
CompetenceAgent competence = null;
if (helper.getIdfCompetenceAgent() == null)
competence = new CompetenceAgent();
else
competence = em.find(CompetenceAgent.class, helper.getIdfCompetenceAgent());
if (competence.getAgent() == null ) {
Agent agent = aDaoEffectif.select(helper.getIdfAgent());
competence.setAgent(agent);
competence.setActivite(Activite.ACTIF);
}
competence.setDteDebut(helper.getDebut());
competence.setDteFin(helper.getFin());
EmploiOperationnel emploi = this.selectEmploi(helper.getIdfEmploiOpe());
competence.setEmploi(emploi);
if (competence.getIdfCompetenceAgent() == null)
em.persist(competence);
}
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#selectCompetence(java.lang.Integer)
*/
@Override
public CompetenceAgentHelper selectCompetence(Integer idfCompetence) {
CompetenceAgent competence = em.find(CompetenceAgent.class, idfCompetence);
if (competence == null)
return null;
CompetenceAgentHelper helper = new CompetenceAgentHelper();
helper.setIdfCompetenceAgent(idfCompetence);
helper.setDebut(competence.getDteDebut());
helper.setFin(competence.getDteFin());
helper.setIdfAgent(competence.getAgent().getIdfAgent());
helper.setIdfEmploiOpe(competence.getEmploi().getIdEmploi());
return helper;
}
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#deleteCompetence(java.lang.Integer)
*/
@Override
public void deleteCompetence(Integer idfCompetence) {
CompetenceAgent competence = em.find(CompetenceAgent.class, idfCompetence);
if (competence == null)
return ;
em.remove(competence);
em.flush();
}
@Override
public void saveEmploi(String code, String libelle, Integer niveau, CategorieEmploi categorie) {
Query query = em.createNamedQuery("UniteValeur.selectByCode");
query.setParameter("code", code);
UniteValeur uniteValeur = ( UniteValeur ) query.getSingleResult();
EmploiOperationnel anEmploi =
this.selectEmploiOperationnelByCodeAndLevel(code, niveau);
if (anEmploi == null) {
anEmploi = new EmploiOperationnel();
anEmploi.setUniteValeur(uniteValeur);
anEmploi.setNiveau(niveau);
}
anEmploi.setLibelle(libelle);
anEmploi.setCategorie(categorie);
if (anEmploi.getIdEmploi() == null)
em.persist(anEmploi);
else
em.merge(anEmploi);
}
private EmploiOperationnel selectEmploiOperationnelByCodeAndLevel(String code, Integer niveau) {
try {
Query query = em.createNamedQuery("EmploiOperationnel.selectByCodeAndLevel");
query.setParameter("code", code);
query.setParameter("level", niveau);
return (EmploiOperationnel) query.getSingleResult();
}
catch (NoResultException e) {
return null;
}
}
@SuppressWarnings("unchecked")
@Override
public List<EmploiOperationnel> makeListEmploiOperationel() {
Query query = em.createNamedQuery("EmploiOperationnel.makeListOperationnel");
List<EmploiOperationnel> lstEmploi = query.getResultList();
Collections.sort(lstEmploi, new EmploiOperationnelComparator());
return lstEmploi;
}
@SuppressWarnings("unchecked")
@Override
public List<PlageHoraire> makeListForEchelon(Integer idfEchelon) {
Query query = em.createNamedQuery("PlageHoraire.makeListForEchelon");
query.setParameter("anIdfEchelon", idfEchelon);
return query.getResultList();
}
/*
* Gestion des unités de valeur
*/
@Override
public void saveUniteValeur(String code, String libelle) {
UniteValeur unite = this.selectUniteValeurByCode(code);
if (unite == null) {
unite = new UniteValeur();
unite.setCode(code);
unite.setLibelle(libelle);
em.persist(unite);
}
else {
unite.setLibelle(libelle);
}
}
private UniteValeur selectUniteValeurByCode(String code) {
try {
Query query = em.createNamedQuery("UniteValeur.selectByCode");
query.setParameter("code", code);
UniteValeur existingUV = (UniteValeur) query.getSingleResult();
return existingUV;
}
catch (NoResultException e) {
return null;
}
}
@Override
public EmploiOperationnel selectEmploi(Integer idfEmploi) {
EmploiOperationnel emploi = em.find(EmploiOperationnel.class, idfEmploi);
return emploi;
}
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#makeListForAgent(java.lang.Integer)
*/
@SuppressWarnings("unchecked")
@Override
public List<CompetenceAgent> makeListForAgent(Integer idfAgent) {
Query query = em.createNamedQuery("CompetenceAgent.selectByAgent");
query.setParameter("idfAgent", idfAgent);
return query.getResultList();
}
/* (non-Javadoc)
* @see fr.firesoft.fireTime.bean.CompetenceManagerLocal#makeListHelperForAgent(java.lang.Integer)
*/
@Override
public List<CompetenceAgentHelper> makeListHelperForAgent(Integer idfAgent) {
return HelperFactory.makeListCompetence(this.makeListForAgent(idfAgent));
}
/**
* @author xbeaufils
*
*/
public class EmploiOperationnelComparator implements Comparator<EmploiOperationnel> {
@Override
public int compare(EmploiOperationnel arg0, EmploiOperationnel arg1) {
return arg0.getLibelle().compareTo(arg1.getLibelle());
}
}
}
| [
"beaufils@lthe-cermo-205.ujf-grenoble.fr"
] | beaufils@lthe-cermo-205.ujf-grenoble.fr |
815a1dbcb27583d4fe6b5b48dd8ec9fdb6b9eef0 | b5415b666e62f4f9a7c81d2f0cb077e6360b147d | /cp_3/Gaivoron_&_Soldatov_FB-84_CP_3/linalg.java | f684641a41e3a2cf25ae469a8f0f7dc4af35903a | [] | no_license | TarasSamchuk/fb-labs-2020 | d63a82cfce6c545fea58b734ff585e1d772d1ed6 | 726b6b3861f43079e579651a93b834edc986b89d | refs/heads/master | 2023-02-10T04:10:17.676181 | 2021-01-12T19:50:02 | 2021-01-12T19:50:02 | 294,743,547 | 0 | 0 | null | 2020-09-11T16:17:26 | 2020-09-11T16:17:25 | null | UTF-8 | Java | false | false | 1,363 | java | package aphine_app;
import java.util.ArrayList;
public class linalg {
public static ArrayList<Integer> linsolve(int a, int b, int n){
int d = gcd(a, n);
int a_ = a % n;
int a1 = a_ / d;
int b1 = b / d;
int n1 = n / d;
int x0 = extendedGCD(a1, n1)[1];
int a_1 = (b1 * x0) % n1;
ArrayList<Integer> res = new ArrayList<Integer>();
for (int i=0; i<d; i++ ){
res.add(a_1 + i * n1);
}
ArrayList<Integer> res_ = new ArrayList<Integer>();
for (int r: res){
if (r < 0) {
res_.add(r + n);
} else {
res_.add(r);
}
}
return res_;
}
public static int gcd(int a,int b) {
while (b != 0) {
int tmp = a % b;
a = b;
b = tmp;
}
return a;
}
public static int[] extendedGCD(int a, int n) {
int s1 = 1, s2 = 0;
int t1 = 0, t2 = 1;
while(n != 0) {
int quotient = a / n;
int r = a % n;
a = n;
n = r;
int tempS = s1 - s2 * quotient;
s1 = s2;
s2 = tempS;
int tempR = t1 - t2 * quotient;
t1 = t2;
t2 = tempR;
}
return new int[] {a, s1, t1};
}
}
| [
"noreply@github.com"
] | noreply@github.com |
4254f673e081326c0d96209c200f296f022845c4 | eef35dddfbaeba7af5808675bacc3257d2bffab2 | /src/test/java/com/isoft/uaa/security/jwt/TokenProviderTest.java | 8cb14d02c3b6116a83abfb9c7e6a40f027d0aad0 | [] | no_license | Ibrahim5560/uaa-application | 4fa673dff9081dc70da53b1f55d7e64180f74e60 | 5f95d93c379eaa1841c74900de06b1b91b853fd1 | refs/heads/master | 2022-12-24T19:20:43.164011 | 2020-02-26T12:23:32 | 2020-02-26T12:23:32 | 243,256,323 | 0 | 0 | null | 2022-12-16T05:13:13 | 2020-02-26T12:23:23 | Java | UTF-8 | Java | false | false | 3,861 | java | package com.isoft.uaa.security.jwt;
import com.isoft.uaa.security.AuthoritiesConstants;
import java.security.Key;
import java.util.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.test.util.ReflectionTestUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import static org.assertj.core.api.Assertions.assertThat;
public class TokenProviderTest {
private static final long ONE_MINUTE = 60000;
private Key key;
private TokenProvider tokenProvider;
@BeforeEach
public void setup() {
tokenProvider = new TokenProvider( new JHipsterProperties());
key = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
ReflectionTestUtils.setField(tokenProvider, "key", key);
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", ONE_MINUTE);
}
@Test
public void testReturnFalseWhenJWThasInvalidSignature() {
boolean isTokenValid = tokenProvider.validateToken(createTokenWithDifferentSignature());
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisMalformed() {
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
String invalidToken = token.substring(1);
boolean isTokenValid = tokenProvider.validateToken(invalidToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisExpired() {
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", -ONE_MINUTE);
Authentication authentication = createAuthentication();
String token = tokenProvider.createToken(authentication, false);
boolean isTokenValid = tokenProvider.validateToken(token);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisUnsupported() {
String unsupportedToken = createUnsupportedToken();
boolean isTokenValid = tokenProvider.validateToken(unsupportedToken);
assertThat(isTokenValid).isEqualTo(false);
}
@Test
public void testReturnFalseWhenJWTisInvalid() {
boolean isTokenValid = tokenProvider.validateToken("");
assertThat(isTokenValid).isEqualTo(false);
}
private Authentication createAuthentication() {
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
return new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities);
}
private String createUnsupportedToken() {
return Jwts.builder()
.setPayload("payload")
.signWith(key, SignatureAlgorithm.HS512)
.compact();
}
private String createTokenWithDifferentSignature() {
Key otherKey = Keys.hmacShaKeyFor(Decoders.BASE64
.decode("Xfd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8"));
return Jwts.builder()
.setSubject("anonymous")
.signWith(otherKey, SignatureAlgorithm.HS512)
.setExpiration(new Date(new Date().getTime() + ONE_MINUTE))
.compact();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
deb6d7490a30ff17e7aec24abe151b609e328aa9 | b61ffa70598ce0bdbe6fef9337c6962c288d5fb0 | /app/src/main/java/com/weather/view/utill/Progressdialogue.java | c784a0d4662dd6fe2b750e921845249bc43de5e8 | [] | no_license | Pavithra9321/Weather | 3902d80d690f71e3ddb1388f6340a911f86fccfa | fd3e392f104c4efda346317e921c779d84815ba1 | refs/heads/master | 2020-03-25T23:23:36.697661 | 2018-08-10T10:35:44 | 2018-08-10T10:35:44 | 144,267,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | package com.weather.view.utill;
import android.app.Activity;
import android.app.Dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import com.weather.R;
/**
* Created by CDS125 on 23-02-2018.
*/
public class Progressdialogue {
static Activity activitys;
static Dialog dialog;
static RotateLoading rotateLoading;
public static void showDialog(Activity activity) {
activitys = activity;
dialogu();
}
public static void dismiss() {
rotateLoading.stop();
dialog.cancel();
}
private static void dialogu() {
dialog = new Dialog(activitys, android.R.style.Theme_Light);
final TypedValue value = new TypedValue();
activitys.getTheme().resolveAttribute(R.attr.colorPrimary, value, true);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
dialog.getWindow().setGravity(Gravity.CENTER);
dialog.setContentView(R.layout.activity_progress);
dialog.setCancelable(true);
rotateLoading = (RotateLoading) dialog.findViewById(R.id.rotateloading);
rotateLoading.start();
dialog.show();
}
}
| [
"CDS121@DESK56-PC.COGNITI.COM"
] | CDS121@DESK56-PC.COGNITI.COM |
a2e763cd9cbe250e7155a6922eccf62edd79cd99 | 7cd738b512771677cb13e1ad0e713525d011f134 | /tz520-order/tz520-order-service/src/main/java/com/tz/mapper/vo/TzReceiverinfoMapperVo.java | 03be22c8c21dac87368dca7bb62caa2b79e942de | [
"Apache-2.0"
] | permissive | money461/Tz520 | 415807015772ef06f6c3696c6a93f97079b85e8e | c05bf435a3aefdb102f17f2588aaee17456c71f4 | refs/heads/master | 2022-11-03T20:07:54.335567 | 2020-02-10T14:48:47 | 2020-02-10T14:48:47 | 239,528,729 | 1 | 0 | Apache-2.0 | 2022-10-12T20:36:40 | 2020-02-10T14:16:59 | JavaScript | UTF-8 | Java | false | false | 437 | java | package com.tz.mapper.vo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.tz.pojo.TzReceiverinfo;
public interface TzReceiverinfoMapperVo {
//清空该用户所有的默认地址标识
void deleteISDefault(@Param("userId") String userId);
//根据用户id查询收货人地址信息(按照更新时间查询)
List<TzReceiverinfo> selectReceiverInfoByUserId(@Param("userId") String userId);
}
| [
"2282500426@qq.com"
] | 2282500426@qq.com |
4585b578c424c84b5a1498fb6b83524f859e1e12 | 9cd69f295d263ceb67b00be81194226904f2e75d | /mueller/Uebungen/continuous_time/src/main/java/swidgets/SDateField.java | 4214463087123e710cedd5a8266b4d4cc6153203 | [] | no_license | briemla/ase-tinf15 | 1e57a73b0be27763d2e9dfaff3e0dd1c0d745970 | f30dc93c15162b01d683aee03b9eee25697b371c | refs/heads/master | 2021-01-01T16:36:10.698711 | 2018-04-03T18:52:57 | 2018-04-03T18:52:57 | 97,866,764 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,986 | java | package swidgets;
import nz.sodium.Cell;
import javax.swing.*;
import java.awt.*;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Optional;
import java.util.Vector;
public class SDateField extends JComponent {
public SDateField() {
this(new GregorianCalendar());
}
private static final String[] months = new String[] {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
public SDateField(Calendar cal) {
Vector<Integer> years = new Vector<>();
Calendar now = new GregorianCalendar();
for (int y = now.get(Calendar.YEAR) - 10; y <= now.get(Calendar.YEAR) + 10; y++)
years.add(y);
SComboBox<Integer> year = new SComboBox<Integer>(years);
year.setSelectedItem(cal.get(Calendar.YEAR));
SComboBox<String> month = new SComboBox<String>(months);
Vector<Integer> days = new Vector<>();
for (int d = 1; d <= 31; d++)
days.add(d);
month.setSelectedItem(months[cal.get(Calendar.MONTH)]);
SComboBox<Integer> day = new SComboBox<Integer>(days);
day.setSelectedItem(cal.get(Calendar.DAY_OF_MONTH));
setLayout(new FlowLayout());
add(year);
add(month);
add(day);
Cell<Optional<Integer>> monthIndex = month.selectedItem.map(
ostr -> {
if (ostr.isPresent()) {
for (int i = 0; i < months.length; i++)
if (months[i].equals(ostr.get()))
return Optional.of(i);
}
return Optional.empty();
});
date = year.selectedItem.lift(monthIndex, day.selectedItem,
(oy, om, od) -> {
return oy.isPresent() && om.isPresent() && od.isPresent()
? new GregorianCalendar(oy.get(), om.get(), od.get())
: new GregorianCalendar();
});
}
public final Cell<Calendar> date;
}
| [
"moepad380@googlemail.com"
] | moepad380@googlemail.com |
193974ef2a61b15d60b408b5b17bcddfb5bb0f18 | a1d905b98fe258bc036e743b4a2a863efd51582b | /src/application/Programa.java | a08c9a7f5e6e8ffacf381fc4db00c6b93442c31b | [] | no_license | wellrodrigues1983/Crud_com_MYSQL | 08933cec000fa8ccf36fc9be12fbc68a33acbd2e | 82c210b03804b131efa7210c73af100c96b7cab6 | refs/heads/master | 2023-06-17T09:37:15.468038 | 2021-07-20T23:58:26 | 2021-07-20T23:58:26 | 387,837,799 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package application;
import application.dados.Pessoa;
public class Programa {
public static void main(String[] args) {
Pessoa pessoa = new Pessoa();
pessoa.CadastarPessoa();
pessoa.InserirDados();
}
} | [
"wellrodrigues@gmail.com"
] | wellrodrigues@gmail.com |
7a8e306b8ef1851aeb43e8e469c9d3bf34f7a31e | b5b4cf99ff324e371efd3a811137c87abf78e21f | /src/main/java/com/wanfin/fpd/common/quartz/QTCreditChecking.java | f4f7a77e8c7a60bfab464d2906ec5b1a8fff63a6 | [
"Apache-2.0"
] | permissive | shimaomao/fpd | 2692f950a36ad7137d14e902d4bc7dff7de53aa2 | aedd8f053de1ff9288dbafca9b4b26fe9cc2bc50 | refs/heads/master | 2021-06-30T02:00:27.652743 | 2017-09-13T03:49:41 | 2017-09-13T03:49:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,496 | java | /**
* @Project fpd
* @Title QTCreditChecking.java
* @Package com.wanfin.fpd.common.quartz
* @Description [[_xxx_]]文件
* @author Chenh
* @date 2016年5月31日 上午9:34:32
* @version V1.0
*/
package com.wanfin.fpd.common.quartz;
import java.text.SimpleDateFormat;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired;
import com.wanfin.fpd.modules.wind.service.creditchecking.TCreditCheckingService;
/**
* @Description [[_xxx_]] QTCreditChecking类
* @author Chenh
* @date 2016年5月31日 上午9:34:32
*/
public class QTCreditChecking {
/**
* 定时任务,执行方法
* */
public void execute(){
String time = new SimpleDateFormat("MMM d,yyyy KK:mm:ss a",Locale.CHINESE).format(System.currentTimeMillis());
System.out.println("——————————————————————————————————————————————————————————————————————————1——");
// tCreditCheckingService.init();
System.out.println("——————————————————————————————————————————————————————————————————————————4——");
System.out.println("time:"+time+">>当前定时任务正在执行:具体用法详见-> B端-OA[Feature #1862]");
}
}
| [
"lengzhijun@wanfin.com"
] | lengzhijun@wanfin.com |
f7767a018d7eb45fe1f2d0fa9c8404081bb4284e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/32/32_3f6eb341a34d86f79b5ba4d92d824007b4698001/PlaylistService/32_3f6eb341a34d86f79b5ba4d92d824007b4698001_PlaylistService_t.java | 0381dbb97fd85da333f157a9c9bfd33a27b4af7a | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 26,951 | java | /*
* Copyright 2013 The Last Crusade ContactLastCrusade@gmail.com
*
* This file is part of SoundStream.
*
* SoundStream is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SoundStream is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SoundStream. If not, see <http://www.gnu.org/licenses/>.
*/
package com.lastcrusade.soundstream.service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import com.lastcrusade.soundstream.R;
import com.lastcrusade.soundstream.audio.AudioPlayerWithEvents;
import com.lastcrusade.soundstream.audio.IPlayer;
import com.lastcrusade.soundstream.audio.RemoteAudioPlayer;
import com.lastcrusade.soundstream.audio.SingleFileAudioPlayer;
import com.lastcrusade.soundstream.manager.PlaylistDataManager;
import com.lastcrusade.soundstream.model.Playlist;
import com.lastcrusade.soundstream.model.PlaylistEntry;
import com.lastcrusade.soundstream.model.SongMetadata;
import com.lastcrusade.soundstream.service.MessagingService.MessagingServiceBinder;
import com.lastcrusade.soundstream.service.MusicLibraryService.MusicLibraryServiceBinder;
import com.lastcrusade.soundstream.util.BroadcastRegistrar;
import com.lastcrusade.soundstream.util.IBroadcastActionHandler;
import com.lastcrusade.soundstream.util.LocalBroadcastIntent;
import com.lastcrusade.soundstream.util.SongMetadataUtils;
import com.lastcrusade.soundstream.util.Toaster;
/**
* This service is responsible for holding the play queue and sending songs to
* the SingleFileAudioPlayer
*/
public class PlaylistService extends Service {
/**
* Broadcast action used to toggle playing and pausing the current song.
*
* This will control the playlist service and music control.
*
*/
public static final String ACTION_PLAY_PAUSE = PlaylistService.class
.getName() + ".action.PlayPause";
/**
* Broadcast action used to pause the current song.
*
* This will control the playlist service and music control.
*
*/
public static final String ACTION_PAUSE = PlaylistService.class
.getName() + ".action.Pause";
/**
* Broadcast action used to skip the current song.
*
* This will control the playlist service and music control.
*
*/
public static final String ACTION_SKIP = PlaylistService.class
.getName() + ".action.Skip";
/**
* Broadcast action sent when the Audio Player service is paused.
*/
public static final String ACTION_PAUSED_AUDIO = PlaylistService.class
.getName() + ".action.PausedAudio";
/**
* Broadcast action sent when the Audio Player service starts playing.
*/
public static final String ACTION_PLAYING_AUDIO = PlaylistService.class
.getName() + ".action.PlayingAudio";
/**
* Broadcast action sent when the Audio Player service is asked to skip a
* song.
*/
public static final String ACTION_SKIPPING_AUDIO = PlaylistService.class
.getName() + ".action.SkippingAudio";
/**
* Broadcast action sent when the playlist gets updated
*/
public static final String ACTION_PLAYLIST_UPDATED = PlaylistService.class + ".action.PlaylistUpdated";
public static final String ACTION_SONG_REMOVED = PlaylistService.class + ".action.SongRemoved";
public static final String ACTION_SONG_ADDED = PlaylistService.class + ".action.SongAdded";
public static final String ACTION_SONG_PLAYING = PlaylistService.class + ".action.SongPlaying";
public static final String EXTRA_SONG = PlaylistService.class + ".extra.Song";
private static final String TAG = PlaylistService.class.getSimpleName();
/**
* Class for clients to access. Because we know this service always runs in
* the same process as its clients, we don't need to deal with IPC.
*/
public class PlaylistServiceBinder extends Binder implements
ILocalBinder<PlaylistService> {
public PlaylistService getService() {
return PlaylistService.this;
}
}
private BroadcastRegistrar registrar;
private IPlayer mThePlayer;
private SingleFileAudioPlayer mAudioPlayer; //TODO remove this when we add stop to IPlayer
private Playlist mPlaylist;
private Thread mDataManagerThread;
private PlaylistDataManager mDataManager;
private PlaylistEntry currentEntry;
private boolean isLocalPlayer;
private ServiceLocator<MusicLibraryService> musicLibraryLocator;
private ServiceLocator<MessagingService> messagingServiceLocator;
private int lastEntryId = 0;
@Override
public IBinder onBind(Intent intent) {
messagingServiceLocator = new ServiceLocator<MessagingService>(
this, MessagingService.class, MessagingServiceBinder.class);
//create the local player in a separate variable, and use that
// as the player until we see a host connected
this.mAudioPlayer = new SingleFileAudioPlayer(this, messagingServiceLocator);
//Assume we are local until we connect to a host
isLocalPlayer = true;
this.mThePlayer = new AudioPlayerWithEvents(this.mAudioPlayer, this);
this.mPlaylist = new Playlist();
musicLibraryLocator = new ServiceLocator<MusicLibraryService>(
this, MusicLibraryService.class, MusicLibraryServiceBinder.class);
registerReceivers();
//start the data manager by default...it is disabled when
// a host is connected
startDataManager();
return new PlaylistServiceBinder();
}
@Override
public boolean onUnbind(Intent intent) {
unregisterReceivers();
messagingServiceLocator.unbind();
return super.onUnbind(intent);
}
/**
* Register intent receivers to control this service
*
*/
private void registerReceivers() {
this.registrar = new BroadcastRegistrar();
this.registrar
.addLocalAction(SingleFileAudioPlayer.ACTION_SONG_FINISHED, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
//NOTE: this is an indicator that the song data can be deleted...therefore, we don't
//want to set the flag until after the song has been played
if (currentEntry != null) {
currentEntry.setPlayed(true);
getMessagingService()
.sendSongStatusMessage(currentEntry);
currentEntry = null;
}
// automatically play the next song, but only if we're not paused
if (!mThePlayer.isPaused()) {
play();
}else{
setNextSong();
}
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(PlaylistService.this);
}
})
.addLocalAction(ConnectionService.ACTION_HOST_CONNECTED, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (mThePlayer != null) {
mThePlayer.cancel();
}
mThePlayer = new AudioPlayerWithEvents(
new RemoteAudioPlayer(
PlaylistService.this,
messagingServiceLocator),
context
);
isLocalPlayer = false;
stopDataManager();
}
})
.addLocalAction(ConnectionService.ACTION_HOST_DISCONNECTED, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (mThePlayer != null) {
mThePlayer.cancel();
}
mThePlayer = new AudioPlayerWithEvents(mAudioPlayer, PlaylistService.this);
isLocalPlayer = true;
currentEntry = null;
startDataManager();
}
})
.addLocalAction(ConnectionService.ACTION_GUEST_CONNECTED, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
if (currentEntry != null) {
getMessagingService().sendPlayStatusMessage(currentEntry, mThePlayer.isPlaying());
}
}
})
.addLocalAction(MessagingService.ACTION_PLAY_STATUS_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
boolean isPlaying = intent.getBooleanExtra(MessagingService.EXTRA_IS_PLAYING, false);
String macAddress = intent.getStringExtra(MessagingService.EXTRA_ADDRESS);
long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID,
SongMetadata.UNKNOWN_SONG);
int entryId = intent.getIntExtra( MessagingService.EXTRA_ENTRY_ID, 0);
PlaylistEntry entry = mPlaylist.findEntryByAddressIdAndEntry(macAddress, songId, entryId);
if (entry != null) {
currentEntry = entry;
}
if (isPlaying) {
new LocalBroadcastIntent(PlaylistService.ACTION_PLAYING_AUDIO).send(PlaylistService.this);
} else {
new LocalBroadcastIntent(PlaylistService.ACTION_PAUSED_AUDIO).send(PlaylistService.this);
}
}
})
.addLocalAction(MessagingService.ACTION_PAUSE_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
pause();
}
})
.addLocalAction(MessagingService.ACTION_PLAY_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
play();
}
})
.addLocalAction(MessagingService.ACTION_SKIP_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
skip();
}
})
.addLocalAction(MessagingService.ACTION_ADD_TO_PLAYLIST_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (!isLocalPlayer) {
Log.wtf(TAG, "Received AddToPlaylistMessage on guest...these messages are only for hosts");
}
String macAddress = intent.getStringExtra(MessagingService.EXTRA_ADDRESS);
long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID,
SongMetadata.UNKNOWN_SONG);
SongMetadata song = getMusicLibraryService().lookupSongByAddressAndId(macAddress, songId);
if (song != null) {
addSong(song);
} else {
Log.wtf(TAG, "Song with mac address " + macAddress + " and id " + songId + " not found.");
}
}
})
.addLocalAction(MessagingService.ACTION_BUMP_SONG_ON_PLAYLIST_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (!isLocalPlayer) {
Log.wtf(TAG, "Received BumpSongOnPlaylist on guest...these messages are only for hosts");
}
String macAddress = intent.getStringExtra(MessagingService.EXTRA_ADDRESS);
long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID,
SongMetadata.UNKNOWN_SONG);
int entryId = intent.getIntExtra( MessagingService.EXTRA_ENTRY_ID, 0);
SongMetadata song = getMusicLibraryService().lookupSongByAddressAndId(macAddress, songId);
PlaylistEntry entry = mPlaylist.findEntryBySongAndId(song, entryId);
if (entry != null) {
bumpSong(entry);
} else {
Log.e(TAG, "Attempting to bump a song that is not in our playlist: " + song);
}
}
})
.addLocalAction(MessagingService.ACTION_REMOVE_FROM_PLAYLIST_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (!isLocalPlayer) {
Log.wtf(TAG, "Received AddToPlaylistMessage on guest...these messages are only for hosts");
}
String macAddress = intent.getStringExtra(MessagingService.EXTRA_ADDRESS);
long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID,
SongMetadata.UNKNOWN_SONG);
int entryId = intent.getIntExtra( MessagingService.EXTRA_ENTRY_ID, 0);
//NOTE: only remove if its not the currently playing song.
//TODO: may need a better message back to the remote fan
SongMetadata song = getMusicLibraryService().lookupSongByAddressAndId(macAddress, songId);
PlaylistEntry entry = mPlaylist.findEntryBySongAndId(song, entryId);
if (!isCurrentEntry(entry)) {
removeSong(entry);
}
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
}
})
.addLocalAction(MessagingService.ACTION_PLAYLIST_UPDATED_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (isLocalPlayer) {
Log.wtf(TAG, "Received PlaylistUpdateMessage as host...these messages are only for guests");
}
List<PlaylistEntry> newList =
intent.getParcelableArrayListExtra(MessagingService.EXTRA_PLAYLIST_ENTRY);
mPlaylist.clear();
for (PlaylistEntry entry : newList) {
mPlaylist.add(entry);
//if the entry has an id assigned, check to see if it's greater than
// our last id...if so, we want to keep this updated because if we become
// host (from guest), we need to make sure we don't reuse ids.
lastEntryId = Math.max(lastEntryId, entry.getEntryId());
}
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(PlaylistService.this);
}
})
.addLocalAction(MessagingService.ACTION_SONG_STATUS_MESSAGE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (isLocalPlayer) {
Log.wtf(TAG, "Received SongStatusMessage as host...these messages are only for guests");
}
String macAddress = intent.getStringExtra(MessagingService.EXTRA_ADDRESS);
long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID, SongMetadata.UNKNOWN_SONG);
int entryId = intent.getIntExtra( MessagingService.EXTRA_ENTRY_ID, 0);
boolean loaded = intent.getBooleanExtra(MessagingService.EXTRA_LOADED, false);
boolean played = intent.getBooleanExtra(MessagingService.EXTRA_PLAYED, false);
//TODO: this may be done more efficiently by using mPlaylist.findEntryByAddressSongAndEntry
SongMetadata song = getMusicLibraryService().lookupSongByAddressAndId(macAddress, songId);
if (song != null) {
PlaylistEntry entry = mPlaylist.findEntryBySongAndId(song, entryId);
if (entry != null) {
entry.setLoaded(loaded);
entry.setPlayed(played);
// send an intent to the fragments that the playlist is updated
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(PlaylistService.this);
} else {
Log.e(TAG, "Attempting to update information about a song that is not in our playlist: " + song);
}
} else {
Log.e(TAG, "MusicLibraryService cannot find song");
}
}
})
.addLocalAction(PlaylistService.ACTION_PAUSE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
pause();
}
})
.addLocalAction(PlaylistService.ACTION_PLAY_PAUSE, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
if (mThePlayer.isPaused()) {
play();
} else {
pause();
}
}
})
.addLocalAction(PlaylistService.ACTION_SKIP, new IBroadcastActionHandler() {
@Override
public void onReceiveAction(Context context, Intent intent) {
skip();
}
})
.register(this);
}
protected void startDataManager() {
if (mDataManager == null) {
mDataManager = new PlaylistDataManager(PlaylistService.this, messagingServiceLocator);
mDataManagerThread = new Thread(mDataManager, PlaylistDataManager.class.getSimpleName() + " Thread");
mDataManagerThread.start();
}
}
protected void stopDataManager() {
if (mDataManager != null) {
mDataManager.stopLoading();
mDataManager = null;
mDataManagerThread = null;
}
}
private void unregisterReceivers() {
this.registrar.unregister();
}
private boolean isCurrentEntry(PlaylistEntry entry) {
//currentSong == null before play is started, and for a brief moment between songs
// (It's nulled out when the ACTION_SONG_FINISHED method is called,
// and repopulated in setSong)
return currentEntry != null && SongMetadataUtils.isTheSameEntry(entry, currentEntry);
}
public boolean isPlaying() {
return this.mThePlayer.isPlaying();
}
public void play() {
if (this.mThePlayer.isPaused()) {
this.mThePlayer.resume();
} else {
boolean play = true;
if(isLocalPlayer) {
play = setNextSong();
}
//we have stuff to play...play it and send a notification
if (play) {
this.mThePlayer.play();
}
}
}
/**
* Helper method to manage all of the things we need to do to set a song
* to play locally (e.g. on the host).
*/
private boolean setNextSong() {
if (!isLocalPlayer) {
throw new IllegalStateException("Cannot call setSong when using a remote player");
}
boolean songSet = false;
//only
if (mPlaylist.size() > 0) {
PlaylistEntry song = mPlaylist.getNextAvailableSong();
//we've reached the end of the playlist...reset it to the beginning and try again
if (song == null) {
resetPlaylist();
song = mPlaylist.getNextAvailableSong();
Toaster.iToast(this, getString(R.string.playlist_finished));
}
//still no available music..this means we're waiting for data to come in
//...display a warning, but don't play.
if (song == null) {
//TODO: instead of this, we may want to repost a message to wait for the next song to be available
//stop the player
this.mAudioPlayer.stop();
//pop up the notice
Toaster.iToast(this, getString(R.string.no_available_songs));
} else {
//we have a song available to play...play it!
this.currentEntry = song;
this.mAudioPlayer.setSong(song);
//the song has been set...indicate this in the return value
songSet = true;
}
} else {
Toaster.iToast(this, getString(R.string.playlist_empty));
}
return songSet;
}
/**
*
*/
private void resetPlaylist() {
mPlaylist.reset();
if (isLocalPlayer) {
//we may need to re-add entries to the data manager, for remote
// loading
for (PlaylistEntry entry : mPlaylist.getSongsToPlay()) {
//add all of the entries to the load queue
Log.i(TAG, entry + " is loaded? " + entry.isLoaded());
mDataManager.addToLoadQueue(entry);
}
}
//send a message to the guests with the new playlist
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
}
public void clearPlaylist() {
mPlaylist.clear();
lastEntryId = 0;
currentEntry = null;
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(this);
}
public void pause() {
this.mThePlayer.pause();
}
public void skip() {
this.mThePlayer.skip();
}
public void addSong(SongMetadata metadata) {
addSong(new PlaylistEntry(metadata));
}
public void addSong(PlaylistEntry entry) {
//NOTE: the entries are shared between the playlist and the data loader...the loader
// will load data into the same objects that are held in the playlist
entry.setEntryId(++lastEntryId);
mPlaylist.add(entry);
if (isLocalPlayer) {
mDataManager.addToLoadQueue(entry);
}
new LocalBroadcastIntent(ACTION_SONG_ADDED)
.putExtra(EXTRA_SONG, entry)
.send(this);
// send an intent to the fragments that the playlist is updated
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(this);
if (isLocalPlayer) {
//send a message to the guests with the new playlist
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
} else {
//send a message to the host to add this song
getMessagingService().sendAddToPlaylistMessage(entry);
}
}
public void removeSong(PlaylistEntry entry) {
if (entry != null) {
mPlaylist.remove(entry);
//broadcast the fact that a song has been removed
new LocalBroadcastIntent(ACTION_SONG_REMOVED)
.putExtra(EXTRA_SONG, entry)
.send(this);
//broadcast the fact that the playlist has been updated
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(this);
if (isLocalPlayer) {
//send a message to the guests with the new playlist
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
} else {
//send a message to the host to remove this song
getMessagingService().sendRemoveFromPlaylistMessage(entry);
}
} else {
Log.e(TAG, "Attempting to remove a song that is not in our playlist: " + entry);
}
}
public List<PlaylistEntry> getPlaylistEntries() {
return Collections.unmodifiableList(new ArrayList<PlaylistEntry>(mPlaylist.getSongsToPlay()));
}
private IMessagingService getMessagingService() {
MessagingService messagingService = null;
try {
messagingService = this.messagingServiceLocator.getService();
} catch (ServiceNotBoundException e) {
Log.wtf(TAG, e);
}
return messagingService;
}
public void bumpSong(PlaylistEntry entry){
mPlaylist.bumpSong(entry);
new LocalBroadcastIntent(ACTION_PLAYLIST_UPDATED).send(this);
if (isLocalPlayer) {
//send a message to the guests with the new playlist
getMessagingService().sendPlaylistMessage(mPlaylist.getSongsToPlay());
} else {
//send a message to the host to remove this song
getMessagingService().sendBumpSongOnPlaylistMessage(entry);
}
}
public PlaylistEntry getCurrentEntry(){
return currentEntry;
}
public MusicLibraryService getMusicLibraryService() {
MusicLibraryService musicLibraryService = null;
try {
musicLibraryService = this.musicLibraryLocator.getService();
} catch (ServiceNotBoundException e) {
Log.wtf(TAG, e);
}
return musicLibraryService;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1be354fc1d1371fb50494fb491c938ace79f9aa8 | 4cf1a07dcbdd147bcafac8a51d120f548ec90272 | /SampleDA/src/test/java/com/beam/sample/repository/ProductRepositoryImplTest.java | 52f9e39dd29050efb7d0de934c9965c65c43c5f6 | [] | no_license | jterry31/project1 | 818f0bdb40a36873fce38178838b3d0105f5deec | 488c2c1dadfc06bac9610a6891cc0d26c1983950 | refs/heads/master | 2021-01-20T15:36:55.800058 | 2016-08-03T08:27:23 | 2016-08-03T08:27:23 | 63,600,353 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package com.beam.sample.repository;
import com.beam.sample.domain.Product;
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.test.context.junit4.SpringRunner;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
* Created by Efe on 28.07.2016.
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class ProductRepositoryImplTest {
@Autowired
ProductRepository productRepository;
/*
@Test
public void testListProduct() {
List<Product> productList = productRepository.listProductInfo();
assertEquals(0, productList.size());
}
*/
}
| [
"efe.erdil@metu.edu.tr"
] | efe.erdil@metu.edu.tr |
b7fb9faefb70c9a3d8c5eff26ae09af9e0615610 | cb2c56f38e5713105869012501b9fce71454910b | /src/test/java/com/fortify/ssc/restclient/api/ProjectVersionOfCloudPoolControllerApiTest.java | 6075a0651c89fbf7a9b23675f255ff3b4f0a1319 | [
"MIT"
] | permissive | ilatypov/ssc-restapi-client | 0c0d87d23f7f88cae04c2ed23b77798fafbfd112 | 1a632fc021a07e0a609efbb6c90caa4238cbda27 | refs/heads/master | 2022-01-23T04:41:55.217639 | 2020-06-22T06:59:22 | 2020-06-22T07:32:54 | 248,676,011 | 0 | 0 | MIT | 2021-12-29T19:29:27 | 2020-03-20T05:33:51 | Java | UTF-8 | Java | false | false | 3,263 | java | /*
* Fortify Software Security Center API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1:18.20
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.fortify.ssc.restclient.api;
import com.fortify.ssc.restclient.ApiException;
import com.fortify.ssc.restclient.model.ApiCollectionActionlong;
import com.fortify.ssc.restclient.model.ApiResult;
import com.fortify.ssc.restclient.model.ApiResultApiActionResponse;
import com.fortify.ssc.restclient.model.ApiResultCloudPoolProjectVersionActionResponse;
import com.fortify.ssc.restclient.model.ApiResultListProjectVersion;
import com.fortify.ssc.restclient.model.CloudPoolProjectVersionAssignRequest;
import com.fortify.ssc.restclient.model.CloudPoolProjectVersionReplaceRequest;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for ProjectVersionOfCloudPoolControllerApi
*/
@Ignore
public class ProjectVersionOfCloudPoolControllerApiTest {
private final ProjectVersionOfCloudPoolControllerApi api = new ProjectVersionOfCloudPoolControllerApi();
/**
* assign
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void assignProjectVersionOfCloudPoolTest() throws ApiException {
String parentId = null;
CloudPoolProjectVersionAssignRequest resource = null;
ApiResultCloudPoolProjectVersionActionResponse response = api.assignProjectVersionOfCloudPool(parentId, resource);
// TODO: test validations
}
/**
* doAction
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void doActionProjectVersionOfCloudPoolTest() throws ApiException {
String parentId = null;
ApiCollectionActionlong collectionAction = null;
ApiResultApiActionResponse response = api.doActionProjectVersionOfCloudPool(parentId, collectionAction);
// TODO: test validations
}
/**
* list
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void listProjectVersionOfCloudPoolTest() throws ApiException {
String parentId = null;
String fields = null;
Integer start = null;
Integer limit = null;
String orderby = null;
ApiResultListProjectVersion response = api.listProjectVersionOfCloudPool(parentId, fields, start, limit, orderby);
// TODO: test validations
}
/**
* replace
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void replaceProjectVersionOfCloudPoolTest() throws ApiException {
String parentId = null;
CloudPoolProjectVersionReplaceRequest resource = null;
ApiResultCloudPoolProjectVersionActionResponse response = api.replaceProjectVersionOfCloudPool(parentId, resource);
// TODO: test validations
}
}
| [
"ann@hpe.com"
] | ann@hpe.com |
19d8cd76b9ddf047fe3f18de2f83d482f3551365 | e682fa3667adce9277ecdedb40d4d01a785b3912 | /internal/fischer/mangf/A086385.java | 2915ecfaadfb409935360117084245a6e435b91a | [
"Apache-2.0"
] | permissive | gfis/joeis-lite | 859158cb8fc3608febf39ba71ab5e72360b32cb4 | 7185a0b62d54735dc3d43d8fb5be677734f99101 | refs/heads/master | 2023-08-31T00:23:51.216295 | 2023-08-29T21:11:31 | 2023-08-29T21:11:31 | 179,938,034 | 4 | 1 | Apache-2.0 | 2022-06-25T22:47:19 | 2019-04-07T08:35:01 | Roff | UTF-8 | Java | false | false | 346 | java | package irvine.oeis.a086;
import irvine.math.z.Z;
import irvine.oeis.a000.A000796;
/**
* A086385 Odd digits of Pi.
* @author Georg Fischer
*/
public class A086385 extends A000796 {
@Override
public Z next() {
while (true) {
final Z result = super.next();
if (result.isOdd()) {
return result;
}
}
}
}
| [
"dr.Georg.Fischer@gmail.com"
] | dr.Georg.Fischer@gmail.com |
25b0f21b50173c100430d707eb6c3f1190b907a0 | e69c2a8a037d6a5056dbc64bfe257b5eefc8467c | /superkatale/RegistrationActivity.java | e471436d07a5bb3b08c12988d1409265282ad3dc | [] | no_license | madrara/slique-works | 14ba7192880f3db2aa3f72fbc0e48fe9cd8a535e | 098823510d5f04f9e3f44a3009c8afb4238fd545 | refs/heads/master | 2021-01-11T18:04:06.598938 | 2017-01-24T10:14:55 | 2017-01-24T10:14:55 | 79,483,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,069 | java | package com.example.flash.superkatale;
import android.content.Intent;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import java.util.HashMap;
import java.util.Map;
public class RegistrationActivity extends AppCompatActivity {
public static final String KEY_USERNAME = "username";
public static final String KEY_PASSWORD = "password";
public static final String KEY_PHONE = "phone_number";
public static final String KEY_EMAIL = "email_address";
private EditText et_fullnames;
private EditText et_email;
private EditText et_number;
private EditText et_password;
private EditText et_confirm;
private Button btn_signup;
private Button btn_login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Call some material design APIs here
} else {
// Implement this feature without material design
}
et_fullnames = (EditText)findViewById(R.id.et_fullnames);
et_email = (EditText)findViewById(R.id.et_email);
et_number = (EditText)findViewById(R.id.et_number);
et_password = (EditText)findViewById(R.id.et_password);
et_confirm = (EditText)findViewById(R.id.et_confirm);
btn_login = (Button)findViewById(R.id.btn_login);
btn_signup = (Button)findViewById(R.id.btn_signup);
btn_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent login = new Intent(getApplicationContext(),LoginActivity.class);
startActivity(login);
}
});
btn_signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//call to the signup method
sendRegister();
}
});
}
private void sendRegister(){
final String fullnames = et_fullnames.getText().toString().trim();
final String email = et_email.getText().toString().trim();
final String number = et_number.getText().toString().trim();
final String password = et_password.getText().toString().trim();
StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.REGISTER_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(RegistrationActivity.this, response, Toast.LENGTH_LONG).show();
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(RegistrationActivity.this,error.toString(),Toast.LENGTH_LONG).show();
}
}){
@Override
protected Map<String,String> getParams(){
Map<String,String> params = new HashMap<String, String>();
params.put(KEY_USERNAME,fullnames);
params.put(KEY_PASSWORD,password);
params.put(KEY_EMAIL,email);
params.put(KEY_PHONE, number);
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
3c4bdd7e45d6fe476413f53e90acd98f149d89af | 7dc64b9386600f2bbadc7af16f5f0d8ff9bc151e | /lab10/charfiles.java | a4628007ab9a13094925bff8d5ac86eb5b8c3038 | [] | no_license | divyaabirami/lab-10 | 72cf28cc72718c90a541093f54e8719286bdb276 | 55e96a4c08875827c73bcadc006dea771a842b21 | refs/heads/main | 2022-12-28T00:24:43.158565 | 2020-10-06T07:09:38 | 2020-10-06T07:09:38 | 301,641,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package lab10;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class charfiles {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
FileReader fi=null;
FileWriter fo=null;
fi=new FileReader("input pic.PNG");
fo=new FileWriter("output char .PNG");
int i;
while((i=fi.read())!=-1)
{
fo.write(i);
}
fo.close();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8ca38a417e0d3ff5282ed59fac074e892b0dc5d3 | 10913a69912a9ff059ec79711723fc6cc7cd6478 | /e4.test.app/src/e4/test/app/handlers/QuitHandler.java | 033f5fc9a7600c5decb3bfb076cb699bc9855b83 | [] | no_license | psuzzi/eclipse.bugs | a4ea4f00a700e45455967de8290723f27976113c | 77b472c870053e556ef7056abf3ea830f28fa709 | refs/heads/master | 2021-01-19T22:33:02.791913 | 2015-05-06T17:02:35 | 2015-05-06T17:02:35 | 31,888,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,024 | java | /*******************************************************************************
* Copyright (c) 2010 - 2013 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
* Lars Vogel <lars.Vogel@gmail.com> - Bug 419770
*******************************************************************************/
package e4.test.app.handlers;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.workbench.IWorkbench;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
public class QuitHandler {
@Execute
public void execute(IWorkbench workbench, Shell shell){
if (MessageDialog.openConfirm(shell, "Confirmation",
"Do you want to exit?")) {
workbench.close();
}
}
}
| [
"psuzzi@gmail.com"
] | psuzzi@gmail.com |
64181a805756b611e56356403c16e8dd0f388f11 | 78f042d42be9d282c2b90430e3c385c8c5b027b6 | /src/test/java/com/test/sharding/security/SecurityUtilsUnitTest.java | 1e72349ccd2a69b3e862e1afb8dde877d721fb38 | [] | no_license | TonyLuo/test-shardingsphere | 0e7189982a1ba9ac5b83f8a4909c55a2429a5a92 | 446052c0ea4ddffdd68148403306b2ef8f1e7183 | refs/heads/master | 2022-12-21T23:30:34.836611 | 2019-12-24T02:13:45 | 2019-12-24T02:13:45 | 229,847,990 | 0 | 0 | null | 2022-12-16T04:42:35 | 2019-12-24T01:26:59 | Java | UTF-8 | Java | false | false | 3,199 | java | package com.test.sharding.security;
import org.junit.jupiter.api.Test;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test class for the {@link SecurityUtils} utility class.
*/
public class SecurityUtilsUnitTest {
@Test
public void testGetCurrentUserLogin() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"));
SecurityContextHolder.setContext(securityContext);
Optional<String> login = SecurityUtils.getCurrentUserLogin();
assertThat(login).contains("admin");
}
@Test
public void testgetCurrentUserJWT() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "token"));
SecurityContextHolder.setContext(securityContext);
Optional<String> jwt = SecurityUtils.getCurrentUserJWT();
assertThat(jwt).contains("token");
}
@Test
public void testIsAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("admin", "admin"));
SecurityContextHolder.setContext(securityContext);
boolean isAuthenticated = SecurityUtils.isAuthenticated();
assertThat(isAuthenticated).isTrue();
}
@Test
public void testAnonymousIsNotAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities));
SecurityContextHolder.setContext(securityContext);
boolean isAuthenticated = SecurityUtils.isAuthenticated();
assertThat(isAuthenticated).isFalse();
}
@Test
public void testIsCurrentUserInRole() {
SecurityContext securityContext = SecurityContextHolder.createEmptyContext();
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.USER));
securityContext.setAuthentication(new UsernamePasswordAuthenticationToken("user", "user", authorities));
SecurityContextHolder.setContext(securityContext);
assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.USER)).isTrue();
assertThat(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)).isFalse();
}
}
| [
"luozhuming@gmail.com"
] | luozhuming@gmail.com |
67e51bfc2faa43221ac9604b6d0ce9646d888819 | 4a5721600bd6cd2691c289e89ebcf858872fbbea | /src/main/java/com/xtu/constant/Tables.java | a64ecfede23df02be008f901c5f1ccb305f97050 | [] | no_license | Zhuyi731/xtuOJCode | 22d6f797c8c00c065b39668e21fd058dd6d5779e | 02e09f0fe9a21aad8dc72c8cb708dd9f2a359f8e | refs/heads/master | 2021-06-16T11:43:50.107573 | 2017-05-22T02:51:03 | 2017-05-22T02:51:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,247 | java | package com.xtu.constant;
/** 数据库表常量
* Created by Ilovezilian on 2017/4/12.
*/
public class Tables{
public static final String ACTION_GROUPS = "action_groups";
public static final String ACTIONS = "actions";
public static final String CLARIFICATIONS = "clarifications";
public static final String CONTEST_DETAIL = "contest_detail";
public static final String CONTEST_PROBLEMS = "contest_problems";
public static final String CONTEST_RANKLIST = "contest_ranklist";
public static final String CONTESTS = "contests";
public static final String JUDGE = "judge";
public static final String PRINTS = "prints";
public static final String PROBLEM_SET_DETAIL = "problem_set_detail";
public static final String PROBLEM_SETS = "problem_sets";
public static final String PROBLEMS = "problems";
public static final String RESULT = "result";
public static final String ROLE_ACTIONS = "role_actions";
public static final String RUNS = "runs";
public static final String TESTDATAS = "testdatas";
public static final String USER_ROLE = "user_role";
public static final String USERS = "users";
public static final String VALIDATOR = "validator";
}
| [
"1084288424@qq.com"
] | 1084288424@qq.com |
816b3fd055e882d20d263be1a554378c06c644a6 | 325bc4e49b41a44b280078fe210b85e408f28985 | /springBoot-myBatis/src/main/java/mdm_web/QueryMdmcodeByGdCode.java | 41b68285d9f508314aa4c042438f3a60a543a137 | [] | no_license | kafun18/springboot_test | 9231f10b9643463155d2f7a2e631af251411f13f | ac7a8b5eab257069e99ccb9aba737e890e1b24f7 | refs/heads/master | 2022-07-11T22:03:13.128897 | 2020-12-12T15:40:23 | 2020-12-12T15:40:23 | 190,215,015 | 0 | 0 | null | 2022-06-21T02:04:34 | 2019-06-04T14:11:39 | Java | GB18030 | Java | false | false | 4,251 | java |
package mdm_web;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="string" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="string1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="string2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="string3" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"string",
"string1",
"string2",
"string3"
})
@XmlRootElement(name = "queryMdmcodeByGdCode")
public class QueryMdmcodeByGdCode {
@XmlElementRef(name = "string", namespace = "http://sharing.mdm07.itf.yonyou.com/IMdSharingCenterService", type = JAXBElement.class, required = false)
protected JAXBElement<String> string;
@XmlElementRef(name = "string1", namespace = "http://sharing.mdm07.itf.yonyou.com/IMdSharingCenterService", type = JAXBElement.class, required = false)
protected JAXBElement<String> string1;
@XmlElementRef(name = "string2", namespace = "http://sharing.mdm07.itf.yonyou.com/IMdSharingCenterService", type = JAXBElement.class, required = false)
protected JAXBElement<String> string2;
@XmlElementRef(name = "string3", namespace = "http://sharing.mdm07.itf.yonyou.com/IMdSharingCenterService", type = JAXBElement.class, required = false)
protected JAXBElement<String> string3;
/**
* 获取string属性的值。
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getString() {
return string;
}
/**
* 设置string属性的值。
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setString(JAXBElement<String> value) {
this.string = value;
}
/**
* 获取string1属性的值。
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getString1() {
return string1;
}
/**
* 设置string1属性的值。
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setString1(JAXBElement<String> value) {
this.string1 = value;
}
/**
* 获取string2属性的值。
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getString2() {
return string2;
}
/**
* 设置string2属性的值。
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setString2(JAXBElement<String> value) {
this.string2 = value;
}
/**
* 获取string3属性的值。
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getString3() {
return string3;
}
/**
* 设置string3属性的值。
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setString3(JAXBElement<String> value) {
this.string3 = value;
}
}
| [
"513112374@qq.com"
] | 513112374@qq.com |
8b66463db8bce3feef6d52a91f5bbad3422a3b7e | 6e6047e19116cf625190b2b1e6d028b6aa4c4dd0 | /week-4/Su-dung-bo-nho-hieu-qua-Memory-Pool/src/Gun.java | 4e3dc5ad82b8b19c9a00891ca2be52b39e38a1a5 | [] | no_license | conaldev/Java-core | 621c2f8a7069a5a91a1314314b30d89f08a1083b | 41d37c4649d9617760aacf0e54f35e76f25ec674 | refs/heads/master | 2022-11-30T10:42:18.903685 | 2020-08-04T15:03:04 | 2020-08-04T15:03:04 | 276,941,488 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,311 | java | import java.util.ArrayList;
import java.util.List;
public class Gun {
private int bulletCount = 1000;
public void fireInPool() {
BulletPool pool = new BulletPool();
List<Bullet> plist = new ArrayList<>();
for(int i = 0; i < bulletCount; i++) {
Bullet p = pool.newItem();
p.setPosition(0);
plist.add(p);
for(int j=0; j < plist.size(); j++) {
Bullet pp = plist.get(j);
pp.move();
System.out.print("-" + pp.getPosition());
if(pp.getPosition() == 10) {
pool.freeItem(pp);
plist.remove(pp);
}
}
System.out.println();
}
}
public void fire() {
List<Bullet> plist = new ArrayList<>();
for(int i = 0; i < bulletCount; i++) {
Bullet p = new Bullet();
p.setPosition(0);
plist.add(p);
for(int j=0; j < plist.size(); j++) {
Bullet pp=plist.get(j);
pp.move();
System.out.print("-" + pp.getPosition());
if(pp.getPosition() == 10) {
plist.remove(pp);
}
}
System.out.println();
}
}
}
| [
"talaaidoaibiet@gmail.com"
] | talaaidoaibiet@gmail.com |
7530d9d73c81b9b5ffd2207736445175a5766c3d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_93b7fb9417038c62a81997cc5964e2bf4bdb1fb4/SubscriptionsController/3_93b7fb9417038c62a81997cc5964e2bf4bdb1fb4_SubscriptionsController_s.java | b6bfd71fd6dadbda0f9808461a3ef3ce14ee7ec8 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 9,651 | java | /**
*
* Copyright (c) 2012, PetalsLink
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
package controllers;
import java.util.List;
import org.ow2.play.governance.api.BootSubscriptionService;
import org.ow2.play.governance.api.GovernanceExeption;
import org.ow2.play.governance.api.SubscriptionRegistry;
import org.ow2.play.governance.api.SubscriptionService;
import org.ow2.play.governance.api.bean.Subscription;
import org.ow2.play.governance.api.bean.Topic;
import utils.Locator;
/**
* @author chamerling
*
*/
public class SubscriptionsController extends PlayController {
/**
* Get all the subscriptions
*
*/
public static void subscriptions() {
SubscriptionRegistry registry = null;
try {
registry = Locator.getSubscriptionRegistry(getNode());
} catch (Exception e) {
handleException("Locator error", e);
}
List<Subscription> subscriptions = null;
try {
subscriptions = registry.getSubscriptions();
} catch (GovernanceExeption e) {
e.printStackTrace();
}
render(subscriptions);
}
public static void subscription(String id) {
handleException("Null id", new Exception(
"Can not get subscription from null ID"));
SubscriptionRegistry registry = null;
try {
registry = Locator.getSubscriptionRegistry(getNode());
} catch (Exception e) {
handleException("Locator error", e);
}
Subscription filter = new Subscription();
filter.setId(id);
List<Subscription> subscriptions = null;
try {
subscriptions = registry.getSubscriptions(filter);
} catch (GovernanceExeption e) {
e.printStackTrace();
}
Subscription subscription = null;
if (subscriptions != null && subscriptions.size() > 0) {
subscription = subscriptions.get(0);
}
render(subscription);
}
/**
* Create page from null args
*
*/
public static void create() {
createFrom("", "", "");
}
/**
* GET
*
* Create page from args
*
* @param topicname
* @param topicns
* @param topicprefix
*/
public static void createFrom(String topicname, String topicns, String topicprefix) {
// flash parameters to inject them in the template (this flash stuff is also used when validating form data
params.flash();
renderTemplate("SubscriptionsController/create.html");
}
/**
* POST. Creates a subscription.
*
* @param consumer
* @param provider
* @param topicName
* @param topicNS
* @param topicPrefix
*/
public static void createNew(String consumer, String provider,
String topicname, String topicns, String topicprefix, boolean save) {
validation.required(consumer);
validation.required(provider);
// validation url does not allow IP address...
validation.isTrue(consumer != null && (consumer.startsWith("http://") || consumer.startsWith("https://")));
validation.isTrue(provider != null && (provider.startsWith("http://") || provider.startsWith("https://")));
validation.required(topicname);
validation.url(topicns);
validation.required(topicprefix);
if (validation.hasErrors()) {
params.flash();
validation.keep();
createFrom(topicname, topicns, topicprefix);
}
try {
SubscriptionService client = Locator
.getSubscriptionService(getNode());
Subscription subscription = new Subscription();
subscription.setProvider(provider);
subscription.setSubscriber(consumer);
Topic topic = new Topic();
topic.setName(topicname);
topic.setNs(topicns);
topic.setPrefix(topicprefix);
subscription.setTopic(topic);
Subscription result = client.subscribe(subscription);
if (result != null) {
flash.success("Subscription has been created %s", result.toString());
}
if (result != null && save) {
// register
SubscriptionRegistry registry = Locator
.getSubscriptionRegistry(getNode());
registry.addSubscription(result);
}
} catch (GovernanceExeption ge) {
handleException("Can not subscribe", ge);
} catch (Exception e) {
handleException("Locator error", e);
}
// Forward to subscription service
create();
}
/**
* GET
*
* Remove all the subscriptions from the registry. This does not means that
* we unregister, we just delete from storage, that's all...
*/
public static void removeAll() {
try {
SubscriptionRegistry client = Locator
.getSubscriptionRegistry(getNode());
client.removeAll();
flash.success("Subscriptions have been removed");
} catch (Exception e) {
handleException("Problem while getting client", e);
}
subscriptions();
}
/**
* POST
* Create a new boot subscription. The subscription is just registered in
* the database and is intented to be used at boot time...
*
* @param consumer
* @param provider
* @param topicname
* @param topicns
* @param topicprefix
* @param save
*/
public static void createNewBoot(String name, String consumer, String provider,
String topicname, String topicns, String topicprefix) {
validation.required(name);
validation.required(consumer);
validation.required(provider);
// validation url does not allow IP address...
validation.isTrue(consumer != null && (consumer.startsWith("http://") || consumer.startsWith("https://")));
validation.isTrue(provider != null && (provider.startsWith("http://") || provider.startsWith("https://")));
validation.required(topicname);
validation.url(topicns);
validation.required(topicprefix);
if (validation.hasErrors()) {
params.flash();
validation.keep();
bootSubscriptions(name, consumer, provider, topicname, topicns, topicprefix);
}
try {
BootSubscriptionService client = Locator
.getBootSubscriptionService(getNode());
Subscription subscription = new Subscription();
subscription.setId(name);
subscription.setProvider(provider);
subscription.setSubscriber(consumer);
Topic topic = new Topic();
topic.setName(topicname);
topic.setNs(topicns);
topic.setPrefix(topicprefix);
subscription.setTopic(topic);
subscription.setDate(System.currentTimeMillis());
client.add(subscription);
flash.success("Subscription has been created");
} catch (GovernanceExeption ge) {
handleException("Can not create boot subscription", ge);
} catch (Exception e) {
handleException("Locator error", e);
}
bootSubscriptions(null, null, null, null, null, null);
}
/**
*
* @param name
* @param consumer
* @param provider
* @param topicname
* @param topicns
* @param topicprefix
*/
public static void deleteBoot(String name, String consumer, String provider,
String topicname, String topicns, String topicprefix) {
validation.required(name);
validation.required(consumer);
validation.required(provider);
// validation url does not allow IP address...
validation.isTrue(consumer != null && (consumer.startsWith("http://") || consumer.startsWith("https://")));
validation.isTrue(provider != null && (provider.startsWith("http://") || provider.startsWith("https://")));
validation.required(topicname);
validation.url(topicns);
validation.required(topicprefix);
if (validation.hasErrors()) {
params.flash();
validation.keep();
bootSubscriptions(name, consumer, provider, topicname, topicns, topicprefix);
}
try {
BootSubscriptionService client = Locator
.getBootSubscriptionService(getNode());
Subscription subscription = new Subscription();
subscription.setId(name);
subscription.setProvider(provider);
subscription.setSubscriber(consumer);
Topic topic = new Topic();
topic.setName(topicname);
topic.setNs(topicns);
topic.setPrefix(topicprefix);
subscription.setTopic(topic);
subscription.setDate(System.currentTimeMillis());
client.remove(subscription);
flash.success("Subscription has been removed");
} catch (GovernanceExeption ge) {
handleException("Can not delete boot subscription", ge);
} catch (Exception e) {
handleException("Locator error", e);
}
bootSubscriptions(null, null, null, null, null, null);
}
/**
* List the boot subscriptions
*/
public static void bootSubscriptions(String name, String consumer, String provider,
String topicname, String topicns, String topicprefix) {
params.flash();
BootSubscriptionService client = null;
try {
client = Locator.getBootSubscriptionService(getNode());
} catch (Exception e) {
handleException("Locator error", e);
}
List<Subscription> subscriptions = null;
try {
subscriptions = client.all();
} catch (GovernanceExeption e) {
e.printStackTrace();
}
render(subscriptions);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
558d8944a3a7d2a9b639deb7f3d9b7d21ec4fe3a | ec897c1152f53fa1efe994e7842cb73d5bd82d08 | /mdgen/src/hamy/mdgen/api/generator/format/aseXML/MDMTSettlementCaseDateRangeReportParameters.java | d241e9c5a4b0358f57409efda6c10d8d8d8e1ca9 | [
"MIT"
] | permissive | hemantmurthy/mdgen | 4b69e5f6805526bd35a532c1c61610dae052ad78 | 31333e4d7687526103d08b6f6772a1805cd12c7a | refs/heads/master | 2020-12-27T22:16:34.251746 | 2020-06-11T00:21:10 | 2020-06-11T00:21:10 | 238,079,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,410 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.03.18 at 10:36:34 AM AEDT
//
package hamy.mdgen.api.generator.format.aseXML;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
*
* Purpose - Parameter definition for reports requiring the settlement case identifier and optionally a date range within it
* Report Names - Level1SettlementReconciliation, AggregatedActualvsEstimate, DataEstimation
* MSATS Reports - RM16, RM19, RM22
* Detail - Note that the same report parameters type can be used for several reports since they all use the
* same parameters. It is thus the report name that will indicate what output will be produced.
*
*
* <p>Java class for MDMTSettlementCaseDateRangeReportParameters complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MDMTSettlementCaseDateRangeReportParameters">
* <complexContent>
* <extension base="{urn:aseXML:r38}BaseReportParameters">
* <sequence>
* <group ref="{urn:aseXML:r38}MDMTSettlementCaseGroup"/>
* <element name="SettlementRun" type="{urn:aseXML:r38}MDMSettlementRunType" minOccurs="0"/>
* </sequence>
* <attribute name="version" type="{urn:aseXML:r38}r10" default="r10" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MDMTSettlementCaseDateRangeReportParameters", propOrder = {
"settlementCase",
"fromDate",
"toDate",
"lastSequenceNumber",
"settlementRun"
})
public class MDMTSettlementCaseDateRangeReportParameters
extends BaseReportParameters
{
@XmlElement(name = "SettlementCase", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger settlementCase;
@XmlElement(name = "FromDate")
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar fromDate;
@XmlElement(name = "ToDate")
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar toDate;
@XmlElement(name = "LastSequenceNumber", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger lastSequenceNumber;
@XmlElement(name = "SettlementRun")
@XmlSchemaType(name = "string")
protected MDMSettlementRunType settlementRun;
@XmlAttribute(name = "version")
protected R10 version;
/**
* Gets the value of the settlementCase property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getSettlementCase() {
return settlementCase;
}
/**
* Sets the value of the settlementCase property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setSettlementCase(BigInteger value) {
this.settlementCase = value;
}
/**
* Gets the value of the fromDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getFromDate() {
return fromDate;
}
/**
* Sets the value of the fromDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setFromDate(XMLGregorianCalendar value) {
this.fromDate = value;
}
/**
* Gets the value of the toDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getToDate() {
return toDate;
}
/**
* Sets the value of the toDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setToDate(XMLGregorianCalendar value) {
this.toDate = value;
}
/**
* Gets the value of the lastSequenceNumber property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getLastSequenceNumber() {
return lastSequenceNumber;
}
/**
* Sets the value of the lastSequenceNumber property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setLastSequenceNumber(BigInteger value) {
this.lastSequenceNumber = value;
}
/**
* Gets the value of the settlementRun property.
*
* @return
* possible object is
* {@link MDMSettlementRunType }
*
*/
public MDMSettlementRunType getSettlementRun() {
return settlementRun;
}
/**
* Sets the value of the settlementRun property.
*
* @param value
* allowed object is
* {@link MDMSettlementRunType }
*
*/
public void setSettlementRun(MDMSettlementRunType value) {
this.settlementRun = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link R10 }
*
*/
public R10 getVersion() {
if (version == null) {
return R10 .R_10;
} else {
return version;
}
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link R10 }
*
*/
public void setVersion(R10 value) {
this.version = value;
}
}
| [
"hemantmurthy@gmail.com"
] | hemantmurthy@gmail.com |
bee4b939af60932cea641e077f0b0138236f5bf3 | ec11305701f16f2449512b873926927bcaa0851a | /app/models/User.java | 3db0459cc330c80da5a86d4d60588294867aa774 | [] | no_license | blegand/AcademicTokenEconomy | b22be4fbfae5d5574ed2e24707c1535bc6f78792 | 07da759110c8d2eebe526616c2a229b7897665e8 | refs/heads/master | 2021-01-01T06:27:32.115666 | 2013-02-21T22:37:57 | 2013-02-21T22:37:57 | 8,345,106 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,906 | java | package models;
import java.util.*;
import play.data.validation.Email;
import play.data.validation.Password;
import play.data.validation.Phone;
import play.data.validation.Required;
import siena.*;
import siena.embed.Embedded;
import siena.embed.Embedded.Mode;
public class User extends Model {
@Id(Generator.AUTO_INCREMENT)
public Long id;
// token from 3rd party authenticator (i.e. google, facebook, yahoo...etc)
public String authToken;
// mobile Token to send notifications to GCM or Apple Notification System
public String mobileToken;
// Date created
@DateTime
public Date creationDate;
// First Name
@Required
@Max(20)
public String firstName;
// Last Name
@Required
@Max(30)
public String lastName;
// The role of this account
@Required
@Column("role")
@Index("role_index")
public int role;
// Contact email
@Required
@Email
public String email;
// Contact mobile phone number
@Required
@Phone
public String mobilePhoneNumber;
@Required
public String userName;
@Required
@Password
public String passwd;
@Filter("favList")
public static Query<Event> eventList;
// Category Tags
@Filter("usercategory_index")
public static Query<UserCategory> category;
public User() {
super();
creationDate = new Date();
}
public static List<UserCategory> getUserCategorys() {
return category.fetch();
}
public static Query<User> all() {
return Model.all(User.class);
}
public static User findByEmail(String email) {
return all().filter("email", email).get();
}
public String toString() {
return "User: " + userName + " Role: " + role + " authToken: "
+ authToken + " mobileToken: " + mobileToken;
}
public static User findByUserName(String u) {
return all().filter("userName", u).get();
}
public static User findByPhoneNumber(String u) {
return all().filter("mobilePhoneNumber", u).get();
}
public static List<User> findByRole(int role) {
return all().filter("role", role).fetch();
}
public static User findById(Long id) {
return all().filter("id", id).get();
}
public static User findByAuthToken(String token) {
return all().filter("authToken", token).get();
}
public static User findByPasswd(String u, String p) {
return all().filter("userName", u).filter("passwd", p).get();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result
+ ((creationDate == null) ? 0 : creationDate.hashCode());
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime
* result
+ ((mobilePhoneNumber == null) ? 0 : mobilePhoneNumber
.hashCode());
result = prime * result
+ ((userName == null) ? 0 : userName.hashCode());
result = prime * result + ((passwd == null) ? 0 : passwd.hashCode());
result = prime * result
+ ((authToken == null) ? 0 : authToken.hashCode());
result = prime * result
+ ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result
+ ((lastName == null) ? 0 : lastName.hashCode());
result = prime * result + (int) role;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
User other = (User) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (creationDate == null) {
if (other.creationDate != null)
return false;
} else if (!creationDate.equals(other.creationDate))
return false;
if (email == null) {
if (other.email != null)
return false;
} else if (!email.equals(other.email))
return false;
if (mobilePhoneNumber == null) {
if (other.mobilePhoneNumber != null)
return false;
} else if (!mobilePhoneNumber.equals(other.mobilePhoneNumber))
return false;
if (userName == null) {
if (other.userName != null)
return false;
} else if (!userName.equals(other.userName))
return false;
if (passwd == null) {
if (other.passwd != null)
return false;
} else if (!passwd.equals(other.passwd))
return false;
if (authToken == null) {
if (other.authToken != null)
return false;
} else if (!authToken.equals(other.authToken))
return false;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.firstName))
return false;
if (lastName == null) {
if (other.lastName != null)
return false;
} else if (!lastName.equals(other.lastName))
return false;
if (role != other.role)
return false;
return true;
}
}
| [
"blegand@gmail.com"
] | blegand@gmail.com |
43de5b615f454754585437d9d47f429f120c9ca7 | 19e5659e48f117880957dbbe913ab3c73d8e47ec | /Billboard/src/Server/Handlers/CPHandler.java | 60af6934b6fedb9651f5f48afa6ce1cf1726b9ce | [] | no_license | Mbur1988/Billboard-server-client | 61f89233ecc029cf0903420f873ff396d053bc4f | 098d7a18c92baf50623d04859f6f9a7547495935 | refs/heads/master | 2022-09-24T21:31:16.878547 | 2020-06-05T05:39:57 | 2020-06-05T05:39:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 22,545 | java | package Server.Handlers;
import SerializableObjects.*;
import Server.Trackers.Authorised;
import Tools.HashCredentials;
import Tools.Log;
import Tools.ObjectStreamer;
import Tools.UserAccess;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.UUID;
import static Server.Server.mariaDB;
public class CPHandler extends ConnectionHandler {
private ObjectStreamer objectStreamer;
private User user;
/**
* Class constructor
* @param socket the socket reference to use
* @param dis the existing data input stream
* @param dos the existing data output stream
*/
public CPHandler(Socket socket, DataInputStream dis, DataOutputStream dos) {
// Update inherited variables
super(socket, dis, dos);
// Create new user class to check user access
user = new User();
// Create a new ObjectStreamHandler to send and receive objects
objectStreamer = new ObjectStreamer(socket);
}
/**
* Override of the run function of parent class
*/
@Override
public void run() {
Log.Message(socket + " control panel handler started");
// Attempt to communicate with the control panel
try {
user = (User) objectStreamer.Receive();
Log.Message("User object received from control panel");
// If the current control panel user is not verified then check credential validity
if (!user.isVerified() && user.getAction().equals("LoginAttempt")) {
Log.Message("Login attempt received from control panel");
AttemptLogin();
objectStreamer.Send(user);
Log.Message("User object sent to control panel");
if (user.isVerified()) {
String request = dis.readUTF();
if (request.equals("List Users Billboards")) {
ListUsersBillboards();
request = dis.readUTF();
}
if (request.equals("List Billboards")) {
ListBillboards();
request = dis.readUTF();
}
if (request.equals("List Schedules")) {
ListSchedules();
request = dis.readUTF();
}
if (request.equals("List Users")) {
ListUsers();
}
}
}
// If the current control panel user is verified then handle the requested action
else if (user.isVerified() && Authorised.Check(user.getUsername(), user.getId())) {
// Next, receive action command from control panel
switch(user.getAction()) {
// Handle requested action
case ("List Users Billboards"):
ListUsersBillboards();
break;
case ("List Billboards"):
ListBillboards();
break;
case ("Get Billboard Information"):
GetBillboardInformation();
break;
case ("Create Billboard"):
CreateBillboard();
break;
case ("Edit Billboard"):
EditBillboard();
break;
case ("Delete Billboard"):
DeleteBillboard();
break;
case ("List Schedules"):
ListSchedules();
break;
case ("View Schedule"):
ViewSchedule();
break;
case ("Schedule Billboard"):
ScheduleBillboard();
break;
case ("Remove Billboard"):
RemoveBillboard();
break;
case ("List Users"):
ListUsers();
break;
case ("Create User"):
CreateUser();
break;
case ("Edit User"):
EditUser();
break;
case ("Get User Permissions"):
GetUserPermissions();
break;
case ("Set User Password"):
SetUserPassword();
break;
case ("Delete User"):
DeleteUser();
break;
case ("Log Out"):
LogOut();
break;
}
}
// Close connection to control panel nicely
socket.close();
this.dis.close();
this.dos.close();
Log.Confirmation(socket.toString() + " closed successfully");
}
catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
}
/**
* the Control Panel will send the Server a username and hashed password (see: User Authentication). The Server will
* either send back an error or a valid session token.
* (Permissions required: none.)
*/
private void AttemptLogin() {
// Get login credentials from user instance
String username = user.getUsername();
String password = user.getPassword();
try {
// get the relevant salt for the user from the database
byte[] salt = mariaDB.users.getSalt(username);
// salt-hash the password using the relevant salt
String toCheck = HashCredentials.Hash(password, salt);
// check whether the salt-hashed password matches that stored on the database
if (toCheck.equals(mariaDB.users.getPassword(username))) {
// if passwords match then validate user and update authorised list
UUID uuid = UUID.randomUUID();
Authorised.Add(username, uuid);
user.setId(uuid);
user.setAccess(mariaDB.users.getAccess(username));
user.setVerified(true);
// print confirmation log message
Log.Confirmation("User credentials validated");
}
else {
// user could not be validated - print warning log message
user.setVerified(false);
Log.Error("User credentials could not be validated");
}
} catch (SQLException e) {
user.setVerified(false);
e.printStackTrace();
}
// clear user password variable for security
user.setPassword("");
}
/**
* the Server will send with a list of billboards created by the current user
* (Permissions required: “Create Billboards”.)
*/
private void ListUsersBillboards() {
try {
boolean[] access = UserAccess.dec2bool(user.getAccess());
if (!access[0]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
sendTrue();
ArrayList<String> list = (mariaDB.billboards.getAllBillboardsCurrent(user.getUsername()));
Collections.sort(list);
objectStreamer.Send(list);
}
catch (IOException | SQLException e) {
e.printStackTrace();
}
}
/**
* the Server will send with a list of all billboards
* (Permissions required: none.)
*/
private void ListBillboards() {
try {
ArrayList<String> list = (mariaDB.billboards.getAllBillboards());
Collections.sort(list);
objectStreamer.Send(list);
}
catch (IOException | SQLException e) {
e.printStackTrace();
}
}
/**
* Gets an existing billboard from the database and sends it to the control panel
*/
private void GetBillboardInformation() {
try {
String name = dis.readUTF();
Billboard billboard = mariaDB.billboards.getBillboard(name);
boolean confirm = (billboard != null);
dos.writeBoolean(confirm);
if (confirm) {
objectStreamer.Send(billboard);
}
} catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Adds a new billboard to the database
*/
private void CreateBillboard() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
Billboard newBillboard = (Billboard) objectStreamer.Receive();
Log.Message("User object received from control panel");
// to create a billboard, must have “Create Billboards” permission
if (Access[0]) {
dos.writeBoolean(mariaDB.billboards.AddBillboard(newBillboard));
}
else {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
}
}
catch (IOException | ClassNotFoundException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Saves changes to an existing billboard
*/
private void EditBillboard() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
Billboard newBillboard = (Billboard) objectStreamer.Receive();
Log.Message("User object received from control panel");
// To edit own billboard, as long as it is not currently scheduled, must have “Create Billboards” permission
if (user.getUsername().equals(newBillboard.getCreatedBy()) && !newBillboard.getScheduled() && Access[0]) {
dos.writeBoolean(mariaDB.billboards.edit(newBillboard));
}
// To edit a billboard that is currently scheduled, must have “Edit All Billboards” permission
else if (newBillboard.getScheduled() && Access[1]) {
dos.writeBoolean(mariaDB.billboards.edit(newBillboard));
}
// To edit another user’s billboard, must have “Edit All Billboards” permission
else if (!user.getUsername().equals(newBillboard.getCreatedBy()) && Access[1]) {
dos.writeBoolean(mariaDB.billboards.edit(newBillboard));
}
else {
sendFalse();
}
}
catch (IOException | ClassNotFoundException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Deletes a billboard
*/
private void DeleteBillboard() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
String name = dis.readUTF();
Log.Message("String data received from control panel");
Billboard billboard = mariaDB.billboards.getBillboard(name);
// To delete any other billboards, including those currently scheduled, must have “Edit All Billboards” permission.
if (billboard.getScheduled() && Access[1]) {
dos.writeBoolean(mariaDB.billboards.DeleteBillboard(name));
mariaDB.scheduling.deleteScheduledBillboard(name);
ListSchedules();
return;
}
// To edit another user’s billboard, must have “Edit All Billboards” permission
else if (!user.getUsername().equals(billboard.getCreatedBy()) && Access[1]) {
dos.writeBoolean(mariaDB.billboards.DeleteBillboard(name));
mariaDB.scheduling.deleteScheduledBillboard(name);
ListSchedules();
return;
} else if (!billboard.getScheduled() && Access[0]) {
dos.writeBoolean(mariaDB.billboards.DeleteBillboard(name));
mariaDB.scheduling.deleteScheduledBillboard(name);
ListSchedules();
} else {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
}
}
catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Get a list of schedules
*/
private void ListSchedules() {
try {
boolean[] access = UserAccess.dec2bool(user.getAccess());
if (!access[2]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
sendTrue();
ArrayList<String> list = (mariaDB.scheduling.getAllSchedules());
Collections.sort(list);
objectStreamer.Send(list);
}
catch (IOException | SQLException e) {
e.printStackTrace();
}
}
/**
* Get the details of an existing schedule
*/
private void ViewSchedule() {
try {
String name = dis.readUTF();
Schedule schedule = mariaDB.scheduling.getSchedule(name);
boolean confirm = (schedule != null);
dos.writeBoolean(confirm);
if (confirm) {
objectStreamer.Send(schedule);
}
} catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Adds a new schedule to the database
*/
private void ScheduleBillboard() {
try {
boolean[] access = UserAccess.dec2bool(user.getAccess());
if (!access[2]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
}
Schedule newSchedule = (Schedule) objectStreamer.Receive();
Log.Message("User object received from control panel");
dos.writeBoolean(mariaDB.scheduling.AddSchedule(newSchedule));
mariaDB.billboards.setScheduled(newSchedule.getBillboardName(), true);
}
catch (IOException | ClassNotFoundException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Deletes and existing schedule from the database
*/
private void RemoveBillboard() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
if (!Access[2]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
String received = dis.readUTF();
Log.Message("String data received from control panel");
String scheduledBillboard = mariaDB.scheduling.getScheduleBillboard(received);
dos.writeBoolean(mariaDB.scheduling.deleteScheduled(received));
if (!mariaDB.scheduling.checkForBillboard(scheduledBillboard)) {
mariaDB.billboards.setScheduled(scheduledBillboard, false);
}
}
catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Get a list of users
*/
private void ListUsers() {
try {
boolean[] access = UserAccess.dec2bool(user.getAccess());
if (!access[3]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
sendTrue();
ArrayList<String> list = (mariaDB.users.getAllUsernames());
Collections.sort(list);
objectStreamer.Send(list);
}
catch (IOException | SQLException e) {
e.printStackTrace();
}
}
/**
* Method to add a new user to the users table in the database
*/
private void CreateUser() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
if (!Access[3]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
User newUser = (User) objectStreamer.Receive();
Log.Message("User object received from control panel");
byte[] salt = HashCredentials.CreateSalt();
String password = HashCredentials.Hash(newUser.getPassword(), salt);
dos.writeBoolean(mariaDB.users.add(
newUser.getUsername(),
password,
newUser.getAccess(),
salt));
}
catch (IOException | ClassNotFoundException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Method to edit an existing user in the database
*/
private void EditUser() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
if (!Access[3]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
String username = dis.readUTF();
String password = dis.readUTF();
access = dis.read();
boolean confirm = true;
if (!password.equals("")) {
byte[] salt = HashCredentials.CreateSalt();
password = HashCredentials.Hash(password, salt);
confirm = mariaDB.users.edit(username, password, salt);
}
dos.writeBoolean(mariaDB.users.edit(username, access) && confirm);
} catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Retrieves the access level of a user and sends it to the control panel
*/
private void GetUserPermissions() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
if (!Access[3]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
dos.write(mariaDB.users.getAccess(dis.readUTF()));
}
catch (IOException | SQLException e) {
e.printStackTrace();
}
}
/**
* Method to change an existing users password
* This change password method is only used to change the password of the current user therefore no access level
* check is required.
* The function to change another users password is handled in the EditUser() method
*/
private void SetUserPassword() {
try {
String username = user.getUsername();
String password = dis.readUTF();
Log.Confirmation("message received from control panel");
byte[] salt = mariaDB.users.getSalt(username);
String toCheck = HashCredentials.Hash(password, salt);
if (toCheck.equals(mariaDB.users.getPassword(username))) {
Log.Confirmation("password correct");
dos.writeBoolean(true);
salt = HashCredentials.CreateSalt();
password = dis.readUTF();
Log.Confirmation("message received from control panel");
password = HashCredentials.Hash(password, salt);
dos.writeBoolean(mariaDB.users.edit(user.getUsername(), password, salt));
}
else {
Log.Confirmation("password incorrect");
sendFalse();
}
} catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Method to delete an existing user from the database
*/
private void DeleteUser() {
try {
int access = mariaDB.users.getAccess(user.getUsername());
boolean[] Access = UserAccess.dec2bool(access);
if (!Access[3]) {
Log.Message("user: " + user.getUsername() + " not authorised to complete this request");
sendFalse();
return;
}
String received = dis.readUTF();
Log.Message("String data received from control panel");
dos.writeBoolean(mariaDB.users.delete(received));
}
catch (IOException | SQLException e) {
sendFalse();
e.printStackTrace();
}
}
/**
* Removes the user from the authorised user list and returns confirmation
*/
private void LogOut() {
Authorised.Remove(user.getUsername());
try {
dos.writeBoolean(!Authorised.Check(user.getUsername(), user.getId()));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Sends a false boolean over data output stream to indicate that an action has failed
*/
private void sendFalse() {
try {
dos.writeBoolean(false);
} catch (IOException ioException) {
ioException.printStackTrace();
}
}
/**
* Sends a true boolean over data output stream to indicate that an action has failed
*/
private void sendTrue() {
try {
dos.writeBoolean(true);
} catch (IOException ioException) {
ioException.printStackTrace();
}
}
} | [
"markburton88@live.com"
] | markburton88@live.com |
2bc74f159c5a6e38783ecb158f88e48ebc807cb6 | 0b99941112b4407465c643b056e770f40ecd4cbe | /src/PersonalStuff/Student/Student.java | 36d588b5c50ea82503198b83f93805b61a835458 | [] | no_license | banthony79/JavaPractice | c81c9e65936af7948d32d5de9923cfd34ff41251 | e3d144e5e5c6973bcc30a7c185d44c39a1cfee19 | refs/heads/master | 2023-01-18T14:13:21.684925 | 2020-11-29T18:06:41 | 2020-11-29T18:06:41 | 300,121,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,412 | java | package PersonalStuff.Student;
public class Student {
private String name;
private String phoneNumber;
private double mathGrade;
private double scienceGrade;
private double englishGrade;
public Student(String name, String phoneNumber, double mathGrade, double scienceGrade, double englishGrade) {
this.name = name;
this.phoneNumber = phoneNumber;
this.mathGrade = mathGrade;
this.scienceGrade = scienceGrade;
this.englishGrade = englishGrade;
}
public String getName() {
return this.name;
}
public String getPhoneNumber() {
return this.phoneNumber;
}
public double getMathGrade() {
return this.mathGrade;
}
public double getScienceGrade() {
return this.scienceGrade;
}
public double getEnglishGrade() {
return this.englishGrade;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public void setMathGrade(double mathGrade) {
this.mathGrade = mathGrade;
}
public void setScienceGrade(double scienceGrade) {
this.scienceGrade = scienceGrade;
}
public void setEnglishGrade(double englishGrade) {
this.englishGrade = englishGrade;
}
public double getAverage() {
return (getMathGrade() + getScienceGrade() + getEnglishGrade()) / 3;
}
}
| [
"blooyeng@gmail.com"
] | blooyeng@gmail.com |
d797366804c689a43b458b94bb1f256a820cab3e | 7bee11dc584217ce214efc6a43f04527fa6d986a | /app/src/test/java/com/examenlab/mito/examenlab/ExampleUnitTest.java | 178e87a7181d763b04942680768e3c641d3b6555 | [] | no_license | mitoo95/ExamenLab1 | 845c97c40be9475c7759fd3e2cbbf4e8da1ec3c2 | 2c9e060ab0e227d8444086656dbc27f77fd617ed | refs/heads/master | 2021-01-10T06:38:11.943655 | 2016-02-26T19:02:12 | 2016-02-26T19:02:12 | 52,625,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.examenlab.mito.examenlab;
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);
}
} | [
"Mito Santos"
] | Mito Santos |
bc0b6e03028cf8f1eaac2330fd11931fcb063355 | bd73bb48ef47af02d9ccf4ef40696772e5a8ea02 | /src/Kata3/Histogram.java | 4d4dc6d0fac616fa64cccd992835ad5a10e21b0d | [] | no_license | AlbertoDelRosario/Kata3 | b7ebf581a811fb6ca3ce39145b843d6b2a9f9d77 | d4c9d02d380722d6990ddb14d4f374b9b0f2f563 | refs/heads/master | 2020-04-02T14:54:51.028535 | 2018-10-24T17:52:47 | 2018-10-24T17:52:47 | 154,543,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 436 | java | package Kata3;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class Histogram<T> {
private final Map<T, Integer> map = new HashMap<>();
public int get(T key){
return map.get(key);
}
public Set<T> keySet(){
return map.keySet();
}
public void increment(T key){
map.put(key, map.containsKey(key) ? map.get(key) + 1 : 1);
}
}
| [
"Administrador@192.168.1.36"
] | Administrador@192.168.1.36 |
d05803672fa5bdd030819b39e62e7e685be6273e | d5f63aaabd51acd11753ef75abed3f0a2873fe49 | /framework/framework-mvc/src/main/java/cn/roilat/framework/util/CollectionUtils.java | b64ba939dc12497189689d036bc7a2eb1d2e2896 | [] | no_license | roilat/roilat_study_code | bf8ac1849f69d60ca0142fc03e452da5e235a975 | 8e58735b62c4ceda120410b999c06dea57d47e1d | refs/heads/master | 2022-12-23T21:07:26.720607 | 2019-12-17T16:00:39 | 2019-12-17T16:00:39 | 125,948,386 | 0 | 2 | null | 2022-12-16T06:11:44 | 2018-03-20T02:21:34 | Java | UTF-8 | Java | false | false | 69 | java | package cn.roilat.framework.util;
public class CollectionUtils {
}
| [
"roilat@hotmail.com"
] | roilat@hotmail.com |
e3176dafe9f75ae7ee7b89c628abbd9815f634ea | f6899a2cf1c10a724632bbb2ccffb7283c77a5ff | /glassfish/core/kernel/src/test/java/com/sun/enterprise/v3/admin/TestDocument.java | 0bf157ce2eb63905b3dd37a2d1eb82a27910c3d0 | [] | no_license | Appdynamics/OSS | a8903058e29f4783e34119a4d87639f508a63692 | 1e112f8854a25b3ecf337cad6eccf7c85e732525 | refs/heads/master | 2023-07-22T03:34:54.770481 | 2021-10-28T07:01:57 | 2021-10-28T07:01:57 | 19,390,624 | 2 | 13 | null | 2023-07-08T02:26:33 | 2014-05-02T22:42:20 | null | UTF-8 | Java | false | false | 2,891 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.enterprise.v3.admin;
import org.jvnet.hk2.config.DomDocument;
import org.jvnet.hk2.config.Dom;
import org.jvnet.hk2.config.ConfigModel;
import org.jvnet.hk2.component.Habitat;
import org.glassfish.config.support.GlassFishConfigBean;
import org.junit.Ignore;
import javax.xml.stream.XMLStreamReader;
/**
*
* This document will create the appropriate ConfigBean implementation but will
* not save the modified config tree.
*
* User: Jerome Dochez
*/
@Ignore
public class TestDocument extends DomDocument<GlassFishConfigBean> {
public TestDocument(Habitat habitat) {
super(habitat);
}
public Dom make(final Habitat habitat, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom, ConfigModel configModel) {
// by default, people get the translated view.
return new GlassFishConfigBean(habitat,this, dom, configModel, xmlStreamReader);
}
}
| [
"srini@appdynamics.com"
] | srini@appdynamics.com |
dc8eb226c5b2ad170d46df83407a357debbb0cfd | dc2f71023844fce9c3e4bda1988d372ac3e1166a | /src/main/java/com/mindtree/schoolmanagement/exception/service/NoMoreStudentAllowedException.java | c1ba41c0a85dfdd506d150c36832393c9968ac8a | [] | no_license | cape-man/kalinga | 8462f67ef3713b926f68ec5817f6f431ea09a134 | 0b5000ff977bfcb5e1b400cca8a0c8a61ad2e2ef | refs/heads/master | 2022-07-17T10:23:36.590649 | 2020-02-12T05:57:30 | 2020-02-12T05:57:30 | 239,937,014 | 0 | 0 | null | 2022-06-21T02:47:14 | 2020-02-12T05:47:24 | Java | UTF-8 | Java | false | false | 775 | java | package com.mindtree.schoolmanagement.exception.service;
public class NoMoreStudentAllowedException extends ServiceException{
public NoMoreStudentAllowedException() {
super();
// TODO Auto-generated constructor stub
}
public NoMoreStudentAllowedException(String arg0, Throwable arg1, boolean arg2, boolean arg3) {
super(arg0, arg1, arg2, arg3);
// TODO Auto-generated constructor stub
}
public NoMoreStudentAllowedException(String arg0, Throwable arg1) {
super(arg0, arg1);
// TODO Auto-generated constructor stub
}
public NoMoreStudentAllowedException(String arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public NoMoreStudentAllowedException(Throwable arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
}
| [
"M1056105@mindtree.com"
] | M1056105@mindtree.com |
d2219ffd8786121702437166c8dbdcc3cf438eff | 0a9900a5e9a0003aaadb54a81a0d8a21432c65e1 | /src/main/java/com/cs307/sustc/project/entity/Report.java | e5c86a66f9ea25b86c5c7e5bb2908a84121ef55d | [] | no_license | StarPolygen/CS207-DB-project | 338accd937bdbb6bbc958f9b9bea413824ba8957 | cea0801f8cff5fbd8c3de9d29d5a080561b35cfa | refs/heads/master | 2020-05-25T05:27:57.221579 | 2019-06-24T18:18:39 | 2019-06-24T18:18:39 | 187,650,281 | 0 | 0 | null | 2019-10-31T14:53:45 | 2019-05-20T13:53:31 | Java | UTF-8 | Java | false | false | 2,066 | java | package com.cs307.sustc.project.entity;
import java.util.Date;
public class Report {
private Integer id;
private Integer good_id;
private Integer reporter_id;
private String description;
private String feedback;
private Date time;
public Report(Integer id, Integer good_id, Integer reporter_id, String description, String feedback, Date time) {
this.id = id;
this.good_id = good_id;
this.reporter_id = reporter_id;
this.description = description;
this.feedback = feedback;
this.time = time;
}
public Report(Integer good_id, Integer reporter_id, String description) {
this.id = null;
this.good_id = good_id;
this.reporter_id = reporter_id;
this.description = description;
this.feedback = null;
this.time = null;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGood_id() {
return good_id;
}
public void setGood_id(Integer good_id) {
this.good_id = good_id;
}
public Integer getReporter_id() {
return reporter_id;
}
public void setReporter_id(Integer reporter_id) {
this.reporter_id = reporter_id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getFeedback() {
return feedback;
}
public void setFeedback(String feedback) {
this.feedback = feedback;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public String toString(){
return "<Report> id: " + id + ", good_id: " + good_id + ", reporter_id: " + reporter_id + ", description: "
+ description + ", feedback: " + feedback + ", time: " + time;
}
}
| [
"644564286@qq.com"
] | 644564286@qq.com |
c34e37a8153b819831c3570f428a03121771d07c | 4ff545bbd98568da8a68586539af7be6fedb3379 | /src/test/java/net/jhorstmann/json/JSONPrettyPrinterTest.java | 59a471b58dc9a8293f78b15653ba85dc2543b731 | [] | no_license | jhorstmann/jjson | faef0f7e3ee4e647e872486e393d716694399b3b | ca2bf4f918442fa5b69bd7fbfad65ba92b62399f | refs/heads/master | 2021-01-19T13:01:53.670800 | 2012-05-03T22:07:19 | 2012-05-03T22:07:19 | 3,022,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package net.jhorstmann.json;
import java.io.IOException;
public class JSONPrettyPrinterTest {
public static void main(String[] args) throws IOException {
System.out.println(JSONPrettyPrinter.prettyprint("{\"abc\":123.0,\"def\":456.0,\"ghi\":[123.0,true,{},{},[],[]],\"jkl\":{\"abc\":true,\"def\":null}}"));
}
}
| [
"git@jhorstmann.net"
] | git@jhorstmann.net |
2e632d70a99969d6e79d5519f4c6348f6ef2c2e9 | 320a6617dce331cc75bc528e95895aa579ab1a62 | /user.consoleapp/src/main/java/eapli/ecafeteria/user/consoleapp/presentation/booking/CancelBookingAction.java | 867ec26ad9c3cbd22ed5db8ef6084adf2f5da249 | [] | no_license | Ren1140822/EAPLI | d997d61ba34ac52c97d6ad51ab9c8ebe9c6df38a | b4e68ee6657b5520c66ea5382249b9e8b5eebee9 | refs/heads/master | 2021-07-08T07:29:02.014797 | 2017-05-25T12:18:38 | 2017-05-25T12:18:38 | 105,758,757 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | 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 eapli.ecafeteria.user.consoleapp.presentation.booking;
import eapli.framework.actions.Action;
/**
*
* @author Miguel Silva - 1150901
*/
public class CancelBookingAction implements Action {
@Override
public boolean execute() {
return new CancelBookingUI().show();
}
}
| [
"1150901@isep.ipp.pt"
] | 1150901@isep.ipp.pt |
039c479867b1a1888def920a547db9cb1a76fc96 | c0fa71a51ec0f7bfd4bae72c70479176573d0771 | /app/src/main/java/com/bxs/bnbtest/GeoAdapter.java | c9c1d51977ec1bcf681ef460eec60991e2968e79 | [] | no_license | bhupinderjitbawa/BNBTest | 29ff37c547ca6091d938632623fdbdf6b0ebad06 | 90b3efc24f6f8904ab35768c8a662b6e30c70ce8 | refs/heads/master | 2016-09-06T12:58:43.979289 | 2015-04-30T18:41:15 | 2015-04-30T18:41:15 | 34,678,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,539 | java | package com.bxs.bnbtest;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by bhupinder on 5/4/15.
*/
public class GeoAdapter extends BaseAdapter {
private Context context;
private ArrayList<GeoModel> geoModelArrayList;
public GeoAdapter(Context context, ArrayList<GeoModel> propertyModelArrayList){
this.context = context;
this.geoModelArrayList = propertyModelArrayList;
}
@Override
public int getCount() {
if(Utilities.hasData(geoModelArrayList))
return geoModelArrayList.size();
else return 0;
}
@Override
public Object getItem(int i) {
return geoModelArrayList.get(i);
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.adapter_geo, viewGroup,false);
TextView tvName = (TextView) view.findViewById(R.id.tvname);
TextView tvAddress = (TextView) view.findViewById(R.id.tvAddress);
tvName.setText(geoModelArrayList.get(i).getName());
tvAddress.setText(geoModelArrayList.get(i).getState() + ", " + geoModelArrayList.get(i).getCountry());
return view;
}
}
| [
"bhupinderjitbawa@gmail.com"
] | bhupinderjitbawa@gmail.com |
c26f73b807e0e72119e0af8b03d6efeae7b609ec | e70abc02efbb8a7637eb3655f287b0a409cfa23b | /hyjf-admin/src/main/java/com/hyjf/admin/manager/borrow/batchcenter/batchborrowrecover/BatchBorrowRecoverService.java | 0c162c3c2f810f50ab0d54eae4b4c097c3c1172c | [] | no_license | WangYouzheng1994/hyjf | ecb221560460e30439f6915574251266c1a49042 | 6cbc76c109675bb1f120737f29a786fea69852fc | refs/heads/master | 2023-05-12T03:29:02.563411 | 2020-05-19T13:49:56 | 2020-05-19T13:49:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package com.hyjf.admin.manager.borrow.batchcenter.batchborrowrecover;
import java.util.List;
import com.hyjf.admin.BaseService;
import com.hyjf.mybatis.model.customize.admin.BatchCenterCustomize;
import com.hyjf.pay.lib.bank.bean.BankCallBean;
public interface BatchBorrowRecoverService extends BaseService {
/**
*
* 获取批次放款列表数量
* @author pcc
* @param batchCenterCustomize
* @return
*/
Long countBatchCenter(BatchCenterCustomize batchCenterCustomize);
/**
*
* 获取批次放款列表
* @author pcc
* @param batchCenterCustomize
* @return
*/
List<BatchCenterCustomize> selectBatchCenterList(BatchCenterCustomize batchCenterCustomize);
/**
* 满标自动放款查询
* @param borrowNid
* @return
* @throws Exception
*/
BankCallBean queryBatchDetails(String borrowNid) throws Exception;
/**
*
* 获取金额合计值
* @author LSY
* @param batchCenterCustomize
* @return
*/
BatchCenterCustomize sumBatchCenter(BatchCenterCustomize batchCenterCustomize);
}
| [
"heshuying@hyjf.com"
] | heshuying@hyjf.com |
6d75b10bf8bef3cf914bdf09279f913d100b0380 | 513ad837aa210144bafc904f6714166d452a177c | /src/cliff/ford/algorithm/security/hash/md5/MD5.java | 7115b4e44aeb38f3e59c776c0703e2a308966cd3 | [] | no_license | Cliff-Ford/Cliff_Ford-Algorithm | 24a0c60be53009f2388d8fd8a377c11f7d9e96ba | 39bcc49d01b916bd813651ad2a8deffcedfc7e56 | refs/heads/master | 2020-05-03T22:04:44.350060 | 2019-04-15T10:29:11 | 2019-04-15T10:29:11 | 178,837,088 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,727 | java | package cliff.ford.algorithm.security.hash.md5;
/**
* @author Cliff_Ford
*/
public class MD5 {
/**
* 四个链接变量
*/
private static final int A = 0x67452301;
private static final int B = 0xefcdab89;
private static final int C = 0x98badcfe;
private static final int D = 0x10325476;
/**
* A B C D的临时变量
*/
private static int aTemp, bTemp, cTemp, dTemp;
/**
* 常量ti
* 公式:floor(abs(sin(i+1))×(2pow32)
*/
/**
* 循环左移数,计算方法未知
*/
private static final int[] S = {
7,12,17,22,7,12,17,22,7,12,17,22,7,
12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,
4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,
15,21,6,10,15,21,6,10,15,21,6,10,15,21};
private static final int[] K = {
0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8,
0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193,
0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51,
0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905,
0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681,
0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60,
0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244,
0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92,
0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314,
0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391};
/**
* 初始化函数
*/
private static void init(){
aTemp = A;
bTemp = B;
cTemp = C;
dTemp = D;
}
/**
* 1. 一个字符 c 可以用一个字节byte来表示,也就是8个bits
* 2. md5规定在最后填充一个8个字节长的,也就是64bits的,表示源字符串长度的数据
* 3. 512bits为一组,也就是64字节为一组
* @param message 源字符串
* @return 返回一个整型数组 注意一个int可以填充4个byte
*/
private static int[] add(String message) {
//分组数
int numOfGroup = ((message.length()+8)/64)+1;
//这里用了int去存储byte, 1 int = 4 bytes,所以只需要numOfGroup*16个int即可完整存储
//int默认初始为0
int[] strByte = new int[numOfGroup*16];
int i = 0;
for(int len = message.length(); i < len; i++){
// i>>2 是 i 除以 4的意思,保证每次取出来的字符(byte)都可以存进对应的int里面,因为 1 int = 4 bytes
// message.charAt(i)<<((i%4)*8) 注意虽然message.charAt(i)取出来的是一个字节,只有8个bits,但是前面的strByte[i>>2]是32bits
// 所以这里jvm给我们做了精度调整,message.charAt(i)有32个bits
// 所以message.charAt(i)<<((i%4)*8)左移运算后strByte[i>>2]进行或运算就保证了前一个byte的数据不会被覆盖
strByte[i>>2] = strByte[i>>2] | message.charAt(i)<<((i%4)*8);
}
//尾部添加1
strByte[i>>2]= strByte[i>>2] | (0x80<<((i%4)*8));
//添加原长度,长度指bit的长度,所以要乘8,然后是小端序,所以放在倒数第二个,这里长度只用了32位
//最后两个int 即8个byte 即64bits
strByte[numOfGroup*16-2]=message.length()*8;
return strByte;
}
/**
* 主循环
* @param m 每一组的计算,注意int[]长度为16,相当于64bytes,512bits
*/
private static void mainLoop(int m[]){
int F,g;
//保存4个临时变量
int a = aTemp;
int b = bTemp;
int c = cTemp;
int d = dTemp;
//组队进行64轮运算
//每次操作对a、b、c和d中的其中三个作一次非线性函数运算,也就是下面的F,注意F的运算只用到了bcd
//然后将所得结果加上第四个变量,也就是a
//再加上文本的一个子分组,即m[g]
//再加上一个常数,即K[i]
//再将所得结果向左环移一个不定的数,即shift(var, S[i])中的S[i]
for(int i = 0; i < 64; i++){
//这里的F在i取不同的值时有不同的计算规则,也就是传说中的 F G H I函数,是一次非线性运算
if(i < 16){
//0-15号字节的计算方式
F = (b&c)|((~b)&d);
g = i;
}else if(i<32){
//16-31号字节的计算方式
F = (d&b)|((~d)&c);
g = (5*i+1)%16;
}else if(i<48){
//31-47号字节的计算方式
F = b^c^d;
g = (3*i+5)%16;
}else{
//48-63号字节的计算方式
F = c^(b|(~d));
g = (7*i)%16;
}
//b c 向后覆盖
int tmp = d;
d = c;
c = b;
//重新计算b
b = b + shift(a+F+K[i]+m[g], S[i]);
//注意这里将d的值赋予了a,下一组shift运算是a起到了调参的作用
a = tmp;
}
//更新临时变量,用于下一组的计算,注意这里的表述是下一组,不是下一轮
aTemp = a + aTemp;
bTemp = b + bTemp;
cTemp = c + cTemp;
dTemp = d + dTemp;
}
/**
* 移动一定位数
* 右移的时候,高位一定要补零,而不是补充符号位
*/
private static int shift(int a, int s){
return (a<<s) | (a>>>(32-s));
}
/**
*整数变成16进制字符串
*/
private static String changeHex(int a){
StringBuilder str= new StringBuilder();
for(int i=0;i<4;i++){
str.append(String.format("%2s", Integer.toHexString(((a >> i * 8) % (1 << 8)) & 0xff)).replace(' ', '0'));
}
return str.toString();
}
public static String encryption(String message){
init();
int[] strByte = add(message);
//每512bits为一组,也就是64个bytes,16个int
for(int i = 0; i < strByte.length/16; i++) {
//取出每组对应的数据
int[] num = new int[16];
System.arraycopy(strByte, i*16, num, 0, 16);
//传给主循环,进行64轮运算
mainLoop(num);
}
return changeHex(aTemp)+changeHex(bTemp)+changeHex(cTemp)+changeHex(dTemp);
}
}
| [
"31761320+Cliff-Ford@users.noreply.github.com"
] | 31761320+Cliff-Ford@users.noreply.github.com |
358888706ddaa29f370180667e363ca67ce04e69 | 06cf08b26c7f4a27ad2f9fafa192c8b6bde768b7 | /app/src/androidTest/java/nextu/com/sesordetemperatura/ApplicationTest.java | b64ca0fc29971e19937997e9b9a668c673ef4bc4 | [] | no_license | AlexisRoj/SesordeTemperatura | 5ad9d16e8b7473061d5fa1f638d761e968413a05 | 77cd0a6a93a37b46d59b5ddc7e9aae7278e40ab2 | refs/heads/master | 2021-01-20T15:53:11.674555 | 2017-05-09T22:53:10 | 2017-05-09T22:53:10 | 90,798,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package nextu.com.sesordetemperatura;
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);
}
} | [
"alexisroj2@gmail.com"
] | alexisroj2@gmail.com |
6b0f10332aae82e7ba80fb56d505c621a47d5655 | 62be7340634804be61bf0062b9bd299e90044c59 | /app/src/main/java/com/gmail/masonashment/tasktimer/MainActivityFragment.java | cae71760670d10084a603655d3e2efe2a564d1a9 | [] | no_license | mrashment/TaskTimer | e14860d808c7ac65a3f0f6cd5097440e6f5da3cc | beed1840e51670363baf03dbfc7735a69ddba874 | refs/heads/master | 2020-09-04T19:35:39.433126 | 2019-11-27T03:45:42 | 2019-11-27T03:45:42 | 219,870,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 590 | java | package com.gmail.masonashment.tasktimer;
import androidx.fragment.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A placeholder fragment containing a simple view.
*/
public class MainActivityFragment extends Fragment {
public MainActivityFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_main, container, false);
}
}
| [
"masonashment@gmail.com"
] | masonashment@gmail.com |
62744ede1656fc76cb44cf7514b2f498fbd70b43 | 0557ee0556a69e63bcaa38d27e2428300b9ef8f9 | /src/Layer.java | 922e4e6fab61c5099166d9751c1fedecbbc0af5f | [] | no_license | dixonp1/CNN | 3567ef472d7d99e8dd33c1d40a9e85ded914df14 | 771b7f1ad709828ed6b9df82bcaab4926a823b06 | refs/heads/master | 2021-01-21T14:38:58.789729 | 2017-06-24T18:36:48 | 2017-06-24T18:36:48 | 95,314,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java |
public interface Layer {
public void initweights();
public void updateWeights(int miniBatchSize, double lambda, int trainingSize);
}
| [
"shay_117@yahoo.com"
] | shay_117@yahoo.com |
e571afc69b9df94b9cfcff4f69f67f7c2df08727 | 4978bb45351817763650d76fc5504a5e5448105a | /tabou2-service/src/main/java/rm/tabou2/service/mapper/sig/IrisMapper.java | 0dafb88a316253cff8f952f6b93ed74ca3ce63a6 | [] | no_license | sigrennesmetropole/geor_tabou2_backend | ae3bfdc7889ebf31dfc89567211890cf1b6e8740 | c8ef9ac5a758cd1c78c10f2b50c6ba1a9ed8c15e | refs/heads/master | 2023-04-16T09:12:50.404609 | 2023-04-12T15:45:50 | 2023-04-12T15:45:50 | 317,872,990 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package rm.tabou2.service.mapper.sig;
import org.mapstruct.Mapper;
import rm.tabou2.service.dto.Iris;
import rm.tabou2.service.mapper.AbstractMapper;
import rm.tabou2.storage.sig.entity.IrisEntity;
@Mapper(componentModel = "spring")
public interface IrisMapper extends AbstractMapper<IrisEntity, Iris> {
}
| [
"anais.Bringy@open-groupe.com"
] | anais.Bringy@open-groupe.com |
2b9974017181984e7c0aadcedd6082e18dcf28ed | cfb18826c89f6765bf4a006a60886076b3e6aa6e | /Aufgabenblatt4-2/Aufgabe5/tasks/Aufgabe5.java | 78445d010a35349bea2f067f46124a6e90d9ab08 | [] | no_license | belminz/-Program-Construction- | b071b527c8ebcc6ee176b16c482f037f6252bd54 | ee4dc2b529a61806f9cca2a57377f3b56016482e | refs/heads/master | 2020-04-22T17:16:00.352216 | 2019-02-13T18:38:15 | 2019-02-13T18:38:15 | 170,534,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 140 | java | /*
Aufgabe5) wird in Aufgabe3.java implementiert
*/
public class Aufgabe5 {
public static void main(String[] args) {
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5cd8eb1682a626efa8bf9c2397adadd052f37262 | 377405a1eafa3aa5252c48527158a69ee177752f | /src/com/google/android/gms/games/internal/GamesClientImpl$SignOutCompleteCallback.java | ddaa40830160e26a7e8b1fed4b8ff649bdfa03e6 | [] | no_license | apptology/AltFuelFinder | 39c15448857b6472ee72c607649ae4de949beb0a | 5851be78af47d1d6fcf07f9a4ad7f9a5c4675197 | refs/heads/master | 2016-08-12T04:00:46.440301 | 2015-10-25T18:25:16 | 2015-10-25T18:25:16 | 44,921,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.games.internal;
import com.google.android.gms.common.api.Status;
// Referenced classes of package com.google.android.gms.games.internal:
// GamesClientImpl
final class wJ extends com.google.android.gms.internal.lback
{
final GamesClientImpl IJ;
private final Status wJ;
public void a(Object obj)
{
c((com.google.android.gms.common.api.ack.c)obj);
}
public void c(com.google.android.gms.common.api.ack ack)
{
ack.ack(wJ);
}
protected void dx()
{
}
public (GamesClientImpl gamesclientimpl, com.google.android.gms.common.api.ack ack, Status status)
{
IJ = gamesclientimpl;
super(gamesclientimpl, ack);
wJ = status;
}
}
| [
"rich.foreman@apptology.com"
] | rich.foreman@apptology.com |
efb2c1bf68016afc069a60f84b67acff3f10bcbf | d772aae7200eac0b598969174fa9f5ea2838fe52 | /src/model/Interface/IDAO.java | fb7aae5d505783f9ec371af25228b1e730cc0e47 | [] | no_license | JackyCafe/redLine | e46185efcc9cd5ed35b72836b885fabb70315012 | 4a8db09d004c886a9ab996a2ee8272ee8ef344a7 | refs/heads/master | 2021-01-25T10:34:50.347175 | 2017-04-07T09:16:18 | 2017-04-07T09:16:18 | 82,436,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package model.Interface;
import java.util.List;
import org.hibernate.Session;
public interface IDAO<T> {
public abstract T select(T bean);
public abstract T select(int id);
public abstract List<T> select( );
public abstract T insert (T bean);
public abstract Boolean delete(T bean);
public abstract Boolean delete(int id);
public abstract T update(T bean);
public abstract Session getSession();
}
| [
"Powerworker1234@gmail.com"
] | Powerworker1234@gmail.com |
1153d8893b8b223e870fa0fa274f58b77453a42c | fd70c2cece573b2329efdc4a8c9474ee61552cda | /app/src/main/java/com/william/broadcastreceiver/IPDialerActivity.java | e87c3f103eba17b0cba6de7f61d9e478e95b456a | [] | no_license | Willian-L/Broadcastreceiver | 8f6bdf6be2d4dd5f64b4565021ee2c3718ecb17b | 5167559433290c5a2bf2d4bb54c10d3a96a143a3 | refs/heads/master | 2020-05-16T02:08:20.150586 | 2019-04-22T04:09:31 | 2019-04-22T04:09:31 | 182,621,035 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,594 | java | package com.william.broadcastreceiver;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class IPDialerActivity extends Activity {
EditText edtPrefix;
Button btnSave;
private SharedPreferences sp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ipdialer);
sp = getSharedPreferences("info", MODE_PRIVATE);
edtPrefix = findViewById(R.id.edt_prefix);
btnSave = findViewById(R.id.btn_save);
btnSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String prefix = edtPrefix.getText().toString().trim();
if (TextUtils.isEmpty(prefix)) {
Toast.makeText(getApplicationContext(), "输入不可为空", Toast.LENGTH_SHORT).show();
} else {
//通过sp保存用户的输入并且使用commit提交
sp.edit().putString("prefix", prefix).commit();
}
}
});
}
public void toDial(View view) {
Uri uri = Uri.parse("tel:");
Intent intent = new Intent(Intent.ACTION_DIAL, uri);
startActivity(intent);
}
}
| [
"307813163@qq.com"
] | 307813163@qq.com |
20cf9e602802cc4f0a455547e7c7494deb909155 | 073bd1080450a4d20cff37ba6ccfd96ad8045c61 | /items-spring-ldap/src/test/java/org/andy/spring/ldap/testbase/TestBase.java | c4a032b665ddf2181428349739fb086a7fdb87ef | [] | no_license | zwz611/scattered-items | 3ec399a3241d2f97fc6b3fe0e648edf2523176e0 | 53eb3017d603efa8442c761523ac1b02df4027b9 | refs/heads/master | 2020-03-29T01:12:17.966862 | 2017-07-12T10:59:15 | 2017-07-12T10:59:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,396 | java | package org.andy.spring.ldap.testbase;
import org.junit.After;
import org.junit.Before;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.util.StringUtils;
/**
* Happy day, happy life.
* <p/>
* Instance ClassPathXmlApplicationContext by springXmlPath.
* Support base get Beans methods.
*
* @author andy
* @version 1.0-SNAPSHOT
* Created date: 2014-11-14 18:45
*/
@SuppressWarnings("unused")
public class TestBase {
protected ClassPathXmlApplicationContext context;
private String springXmlPath;
public TestBase() {
}
public TestBase(String springXmlPath) {
this.springXmlPath = springXmlPath;
}
/**
* Init and start ClassPathXmlApplicationContext.
*/
@Before
public void before() {
if (StringUtils.isEmpty(springXmlPath)) {
context = new ClassPathXmlApplicationContext("classpath*:*.xml");
} else {
context = new ClassPathXmlApplicationContext(springXmlPath);
}
context.start();
}
/**
* Destroy ClassPathXmlApplicationContext.
*/
@After
public void after() {
context.destroy();
}
/**
* Return an instance, which may be shared or independent, of the specified bean.
* <p>This method allows a Spring BeanFactory to be used as a replacement for the
* Singleton or Prototype design pattern. Callers may retain references to
* returned objects in the case of Singleton beans.
* <p>Translates aliases back to the corresponding canonical bean name.
* Will ask the parent factory if the bean cannot be found in this factory instance.
*
* @param name the name of the bean to retrieve
* @return an instance of the bean
*/
public Object getBean(String name) {
return context.getBean(name);
}
/**
* Return the bean instance that uniquely matches the given object type, if any.
*
* @param requiredType type the bean must match; can be an interface or superclass.
* {@code null} is disallowed.
* <p>This method goes into {@link org.springframework.beans.factory.ListableBeanFactory} by-type lookup territory
* but may also be translated into a conventional by-name lookup based on the name
* of the given type. For more extensive retrieval operations across sets of beans,
* use {@link org.springframework.beans.factory.ListableBeanFactory} and/or {@link org.springframework.beans.factory.BeanFactoryUtils}.
* @return an instance of the single bean matching the required type
*/
public <T> T getBean(Class<T> requiredType) {
return context.getBean(requiredType);
}
/**
* @param name the name of the bean to retrieve
* @param requiredType type the bean must match. Can be an interface or superclass
* of the actual class, or {@code null} for any match. For example, if the value
* is {@code Object.class}, this method will succeed whatever the class of the
* returned instance.
* @return an instance of the bean
*/
public <T> T getBean(String name, Class<T> requiredType) {
return context.getBean(name, requiredType);
}
} | [
"461857202@qq.com"
] | 461857202@qq.com |
732228dd556e69bbfa255557c9dcbb0a7a0ba92a | 66fd8b327b9d96aea191233e60f2ef7d5f33bb67 | /src/main/java/com/example/lab6excercise/Lab6excerciseApplication.java | 1129e63347ca9ebdbaebac608cc6fa6836c80fa8 | [] | no_license | sharmila1995/Java_PI1_Assignment6 | f6d40f3570f75da3b86bd313d3aabad0505d4831 | 9a4dde2d5d0379471d155069dddd92c18d32d5d6 | refs/heads/master | 2023-08-10T15:34:39.823234 | 2021-10-13T21:39:38 | 2021-10-13T21:39:38 | 416,902,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.example.lab6excercise;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Lab6excerciseApplication {
public static void main(String[] args) {
SpringApplication.run(Lab6excerciseApplication.class, args);
}
}
| [
"sharmilashrestha@unomaha.edu"
] | sharmilashrestha@unomaha.edu |
e9b65aa16d353d726a7484656eb8b100683b32d5 | 89f4ff8e2cb5e7c3be3f56055df64faa58f2c0ad | /ms-common/ms-common-module/src/main/java/com/ms/common/domain/PmsProduct.java | d8bbb92552b921046dfd65d07dd132f9294fbf96 | [] | no_license | xiaobingcom/ms_cloud | d39047eae1b5a232bdf7fb74245e5f2d5f135b52 | 064023cd8a69c614f22858c4a187e54ba5d6d1ec | refs/heads/master | 2023-01-03T05:58:31.451723 | 2020-11-04T12:01:30 | 2020-11-04T12:01:30 | 296,762,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,614 | java | package com.ms.common.domain;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 商品
* @author xiaobing
*/
@Data
public class PmsProduct implements Serializable {
/**
* 商品ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 商品品牌ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long brandId;
@ApiModelProperty(value = "限购数量 ,0为不限购")
private Integer perLimit;
/**
* 商品分类ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long productCategoryId;
/**
* 运费模板ID
*/
@ApiModelProperty(value = "运费模板ID")
private Long deliveryTemplateId;
/**
* 商品属性分类ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long productAttributeCategoryId;
private String name;
@ApiModelProperty(value = "总上架数量")
private int totalStock;
private String pic;
@ApiModelProperty(value = "货号")
private String productSn;
@ApiModelProperty(value = "删除状态:0->未删除;1->已删除")
private Integer deleteStatus;
private Integer wantToCount;
@ApiModelProperty(value = "上架状态:0->下架;1->上架")
private Integer publishStatus;
@ApiModelProperty(value = "新品状态:0->不是新品;1->新品")
private Integer newStatus;
@ApiModelProperty(value = "推荐状态;0->不推荐;1->推荐")
private Integer recommandStatus;
@ApiModelProperty(value = "审核状态:0->未审核;1->审核通过")
private Integer verifyStatus;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "销量")
private Integer sale;
private BigDecimal price;
@ApiModelProperty(value = "促销价格(RMB)")
private BigDecimal promotionRmb;
@ApiModelProperty(value = "促销价格(龙珠)")
private BigDecimal promotionPrice;
@ApiModelProperty(value = "促销销量")
private Integer promotionSale;
@ApiModelProperty(value = "赠送的成长值")
private Integer giftGrowth;
@ApiModelProperty(value = "赠送的积分")
private Integer giftPoint;
@ApiModelProperty(value = "限制使用的积分数")
private Integer usePointLimit;
@ApiModelProperty(value = "副标题")
private String subTitle;
@ApiModelProperty(value = "市场价")
private BigDecimal originalPrice;
@ApiModelProperty(value = "库存")
private Integer stock;
@ApiModelProperty(value = "库存预警值")
private Integer lowStock;
@ApiModelProperty(value = "单位")
private String unit;
@ApiModelProperty(value = "商品重量,默认为克")
private BigDecimal weight;
@ApiModelProperty(value = "体积")
private BigDecimal volume;
@ApiModelProperty(value = "是否为预告商品:0->不是;1->是")
private Integer previewStatus;
@ApiModelProperty(value = "以逗号分割的产品服务:1->无忧退货;2->快速退款;3->免费包邮")
private String serviceIds;
private String keywords;
private String note;
@ApiModelProperty(value = "画册图片,连产品图片限制为5张,以逗号分割")
private String albumPics;
private String detailTitle;
@ApiModelProperty(value = "促销开始时间")
private Date promotionStartTime;
@ApiModelProperty(value = "促销结束时间")
private Date promotionEndTime;
@ApiModelProperty(value = "活动限购数量")
private Integer promotionPerLimit;
@ApiModelProperty(value = "促销类型:0->没有促销使用原价;1->使用促销价;2->拼团")
private Integer promotionType;
@ApiModelProperty(value = "品牌名称")
private String brandName;
@ApiModelProperty(value = "商品分类名称")
private String productCategoryName;
@ApiModelProperty(value = "商品描述")
private String description;
private String detailDesc;
@ApiModelProperty(value = "产品详情网页内容")
private String detailHtml;
@ApiModelProperty(value = "移动端网页详情")
private String detailMobileHtml;
@ApiModelProperty(value = "人民币价格")
private BigDecimal rmb;
private static final long serialVersionUID = 1L;
} | [
"1043263723@qq.com"
] | 1043263723@qq.com |
ea253dcb1629e4b5780f8a8a14424366c26a2901 | c8316dd0f71c7d70777c8962a99a2775ffa20b92 | /src/main/java/com/example/demo/validation/IdCardValidator.java | 7512abb3c821cd04df8717b7908f65ce95101d2f | [] | no_license | tuvietvan210694/du_an_nha_dat_tigers-010203 | e3ce6e1d5dd46244d0373d1c5596d1460631f445 | 78fc44a16fda35212d3daea686599a8948e64abc | refs/heads/master | 2022-11-27T05:19:26.029103 | 2019-05-26T10:58:52 | 2019-05-26T10:58:52 | 188,671,791 | 0 | 0 | null | 2022-11-16T11:32:12 | 2019-05-26T10:59:43 | Java | UTF-8 | Java | false | false | 464 | java | package com.example.demo.validation;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class IdCardValidator implements ConstraintValidator<IdCard, String>{
public void initialize(IdCard paramA) {
}
public boolean isValid(String phoneNo, ConstraintValidatorContext ctx) {
if (phoneNo == null) {
return false;
}
//return phoneNo.matches("\\d{10,12}");
return phoneNo.matches("[0-9]+");
}
}
| [
"you@example.com"
] | you@example.com |
a1137e6b1f190f52dc4f6e0c48a5b2c7e9af952b | 6a193331fa88c3fa1d1ea02451e7facd59abb321 | /app/src/main/java/com/example/myfirstwords/MainView/CategoriesClickListener.java | 7b762f7d4b611a84765bd1f6740cdc6fdaf9ceb3 | [] | no_license | Kryvovyaz/MyFirstWords | 0047c8d791a0b7632608774b9c9ac28bb8c176df | be9903d4e9d250092b6afa1c083993a9a638f529 | refs/heads/master | 2023-04-23T17:33:00.633885 | 2021-05-04T22:10:56 | 2021-05-04T22:10:56 | 330,533,408 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package com.example.myfirstwords.MainView;
public interface CategoriesClickListener {
void onClick(int position);
}
| [
"kidalv85@yahoo.com"
] | kidalv85@yahoo.com |
c4091d016c463f4a75c97d798e17df9783b5bde9 | 7b9e12ecb5cb43cfaf37f9a67277d3a1be5e04b9 | /week-09/day-02/macrotis/src/main/java/com/greenfox/macrotis/macrotisexam/services/AttractionServiceImpl.java | 4d8663bf5cdce5a6ba585502ace0818f75f28b38 | [] | no_license | green-fox-academy/attila-m | d454a0e2c65b3036b8a7773c3ec2ff13cf394ebb | 6fdc6223aac52d481c693a6d4e8df7103e621da5 | refs/heads/master | 2021-07-08T03:09:55.225047 | 2018-09-09T19:11:40 | 2018-09-09T19:11:40 | 132,755,068 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,678 | java | package com.greenfox.macrotis.macrotisexam.services;
import com.greenfox.macrotis.macrotisexam.models.Attractions;
import com.greenfox.macrotis.macrotisexam.models.Filter;
import com.greenfox.macrotis.macrotisexam.repositories.AttractionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AttractionServiceImpl implements AttractionService {
@Autowired
AttractionRepository attractionRepository;
@Override
public List<Attractions> getAllAttractions() {
return attractionRepository.findAll();
}
@Override
public void addAttraction(Attractions attraction) {
attractionRepository.save(attraction);
}
@Override
public Attractions getAttraction(int id) {
return attractionRepository.findById(id).get();
}
@Override
public Filter filterAttractions(String city, String category) {
List<Attractions> attractionsList;
if(category != null && city != null) {
attractionsList = attractionRepository.findByCityAndCategory(city, category);
return new Filter("ok", attractionsList.size(), attractionsList);
} else if (category != null) {
attractionsList = attractionRepository.findByCategory(category);
return new Filter("ok", attractionsList.size(), attractionsList);
} else if (city != null) {
attractionsList = attractionRepository.findByCity(city);
return new Filter("ok", attractionsList.size(), attractionsList);
} else {
attractionsList = attractionRepository.findAll();
return new Filter("full list", attractionsList.size(), attractionsList);
}
}
}
| [
"at.murvai@gmail.com"
] | at.murvai@gmail.com |
3db684916d991eb9458431785ec42a7283af811f | edfb435ee89eec4875d6405e2de7afac3b2bc648 | /tags/selenium-2.16.1/java/server/src/org/openqa/selenium/remote/server/handler/html5/SetLocalStorageItem.java | 95c0a04f89fe3c6654e283af08ec569595f3742b | [
"Apache-2.0"
] | permissive | Escobita/selenium | 6c1c78fcf0fb71604e7b07a3259517048e584037 | f4173df37a79ab6dd6ae3f1489ae0cd6cc7db6f1 | refs/heads/master | 2021-01-23T21:01:17.948880 | 2012-12-06T22:47:50 | 2012-12-06T22:47:50 | 8,271,631 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,664 | java | /*
Copyright 2010 WebDriver committers
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.openqa.selenium.remote.server.handler.html5;
import org.openqa.selenium.html5.WebStorage;
import org.openqa.selenium.remote.server.JsonParametersAware;
import org.openqa.selenium.remote.server.Session;
import org.openqa.selenium.remote.server.handler.WebDriverHandler;
import org.openqa.selenium.remote.server.rest.ResultType;
import java.util.Map;
public class SetLocalStorageItem extends WebDriverHandler implements JsonParametersAware {
private volatile String key;
private volatile String value;
public SetLocalStorageItem(Session session) {
super(session);
}
public ResultType call() throws Exception {
((WebStorage) getUnwrappedDriver()).getLocalStorage().setItem(key, value);
return ResultType.SUCCESS;
}
public void setJsonParameters(Map<String, Object> allParameters) throws Exception {
key = (String) allParameters.get("key");
value = (String) allParameters.get("value");
}
@Override
public String toString() {
return String.format("[Set local storage item pair: (%s, %s)]", key, value);
}
}
| [
"dawagner@07704840-8298-11de-bf8c-fd130f914ac9"
] | dawagner@07704840-8298-11de-bf8c-fd130f914ac9 |
4da13113c276e91979bf762bb08ea8b4c9a9e048 | 7f5210488dbfbb71d978860645f6164a7260a0da | /serviceInterfaces/src/main/java/org/mifos/dto/domain/SavingsProductDto.java | 6901be7d1d6e7d2121efb960caf967970ef5992b | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | vorburger/mifos-head | f61f17c2afeb883e9c6daf0ccb2107647fbee192 | b77be9aa97283a21d209d8c27c6b58128450dff4 | refs/heads/master | 2020-12-24T16:16:38.386828 | 2011-01-02T01:23:03 | 2011-01-02T01:23:03 | 961,895 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 5,230 | java | /*
* Copyright (c) 2005-2010 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.dto.domain;
import java.math.BigDecimal;
@SuppressWarnings("PMD")
public class SavingsProductDto {
private boolean openSavingsAccountsExist = true;
private final ProductDetailsDto productDetails;
private final Integer depositType;
private final Integer interestCalculationType;
private final Integer groupMandatorySavingsType;
private final Double amountForDeposit;
private final Double maxWithdrawal;
private final boolean groupMandatorySavingsAccount;
private final BigDecimal interestRate;
private final Integer interestCalculationFrequency;
private final Integer interestCalculationFrequencyPeriod;
private final Integer interestPostingMonthlyFrequency;
private final BigDecimal minBalanceForInterestCalculation;
private final Integer depositGlCode;
private String depositGlCodeValue;
private final Integer interestGlCode;
private String interestGlCodeValue;
/**
* minimal legal constructor for create savings products request
*/
public SavingsProductDto(ProductDetailsDto productDetailsDto, boolean groupSavingsAccount,
Integer depositType, Integer groupSavingsType, Double amountForDeposit, Double maxWithdrawal,
BigDecimal interestRate, Integer interestCalculationType, Integer interestCalculationFrequency,
Integer interestCalculationFrequencyPeriod, Integer interestPostingMonthlyFrequency,
BigDecimal minBalanceForInterestCalculation, Integer depositGlCode, Integer interestGlCode) {
this.productDetails = productDetailsDto;
this.groupMandatorySavingsAccount = groupSavingsAccount;
this.depositType = depositType;
this.groupMandatorySavingsType = groupSavingsType;
this.amountForDeposit = amountForDeposit;
this.maxWithdrawal = maxWithdrawal;
this.interestRate = interestRate;
this.interestCalculationType = interestCalculationType;
this.interestCalculationFrequency = interestCalculationFrequency;
this.interestCalculationFrequencyPeriod = interestCalculationFrequencyPeriod;
this.interestPostingMonthlyFrequency = interestPostingMonthlyFrequency;
this.minBalanceForInterestCalculation = minBalanceForInterestCalculation;
this.depositGlCode = depositGlCode;
this.interestGlCode = interestGlCode;
}
public ProductDetailsDto getProductDetails() {
return this.productDetails;
}
public Integer getDepositType() {
return this.depositType;
}
public Integer getInterestCalculationType() {
return this.interestCalculationType;
}
public Integer getGroupMandatorySavingsType() {
return this.groupMandatorySavingsType;
}
public Double getAmountForDeposit() {
return this.amountForDeposit;
}
public Double getMaxWithdrawal() {
return this.maxWithdrawal;
}
public boolean isGroupMandatorySavingsAccount() {
return this.groupMandatorySavingsAccount;
}
public BigDecimal getInterestRate() {
return this.interestRate;
}
public Integer getInterestCalculationFrequency() {
return this.interestCalculationFrequency;
}
public Integer getInterestCalculationFrequencyPeriod() {
return this.interestCalculationFrequencyPeriod;
}
public Integer getInterestPostingMonthlyFrequency() {
return this.interestPostingMonthlyFrequency;
}
public BigDecimal getMinBalanceForInterestCalculation() {
return this.minBalanceForInterestCalculation;
}
public Integer getDepositGlCode() {
return this.depositGlCode;
}
public Integer getInterestGlCode() {
return this.interestGlCode;
}
public String getDepositGlCodeValue() {
return this.depositGlCodeValue;
}
public void setDepositGlCodeValue(String depositGlCodeValue) {
this.depositGlCodeValue = depositGlCodeValue;
}
public String getInterestGlCodeValue() {
return this.interestGlCodeValue;
}
public void setInterestGlCodeValue(String interestGlCodeValue) {
this.interestGlCodeValue = interestGlCodeValue;
}
public boolean isOpenSavingsAccountsExist() {
return this.openSavingsAccountsExist;
}
public void setOpenSavingsAccountsExist(boolean openSavingsAccountsExist) {
this.openSavingsAccountsExist = openSavingsAccountsExist;
}
} | [
"keithwoodlock@gmail.com"
] | keithwoodlock@gmail.com |
2ad7b02bcb5d7fcea9defb8392bb2058f89798a2 | 000b338c0757000f6b06de1786fa4169099282dd | /MindMap/android/app/src/main/java/com/mindmap/MainActivity.java | d3b0e1deaa37d67a365a33c0ea3a0fe3a0f47fbb | [] | no_license | dinhanhhuy/mindmap | b40b82eff89d66ea0d87ec79bf9e3bcdbd1d42ca | da26539dc424412980f9d0e7670023e2835072f0 | refs/heads/master | 2021-08-19T17:03:05.103706 | 2017-11-22T16:33:03 | 2017-11-22T16:33:03 | 112,133,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.mindmap;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "MindMap";
}
}
| [
"dinhanhhuy.it@gmail.com"
] | dinhanhhuy.it@gmail.com |
8f0a3b6298f28d4c427fa78396fba69a046717ad | d7252ba6626ae4d66b167ef612d51c7e67e5c19d | /timeslice-lib/src/main/java/com/enokinomi/timeslice/lib/prorata/api/GroupComponent.java | 4e5c0bb1833428aeb817bced2bb4510fe984ec28 | [] | no_license | VijayEluri/timeslice | 2ea517eda20df8576c2350ec7cb842ad06e92d7a | faa2a7e7b47de20dae82c7c8b285e9f4f59c292a | refs/heads/master | 2020-05-20T10:59:20.252397 | 2011-03-06T10:15:27 | 2011-03-06T10:15:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package com.enokinomi.timeslice.lib.prorata.api;
import java.math.BigDecimal;
public class GroupComponent
{
private final String groupName;
private final String name;
private final BigDecimal weight;
public GroupComponent(String groupName, String name, BigDecimal weight)
{
this.groupName = groupName;
this.name = name;
this.weight = weight;
}
public String getName()
{
return name;
}
public BigDecimal getWeight()
{
return weight;
}
public String getGroupName()
{
return groupName;
}
}
| [
"dbacon@Bacon-Daves-MacBook-Pro.local"
] | dbacon@Bacon-Daves-MacBook-Pro.local |
7451e972f916804b812dc95921b49d490bcfd300 | 198c48afb5b3a700ce386243bba4c0f0bf7fd78e | /test/com/tumri/joz/util/TestJozResult.java | 05fde37bb3afd6d4b84341cd41731c15b774c0b0 | [] | no_license | anandp504/dco-joz | 0781eaf80de955c3f8ed7b3cf9108857b815374a | 24115d348b256bece7b82c438264b53061881eeb | refs/heads/master | 2021-01-25T08:29:38.718937 | 2014-07-16T11:27:51 | 2014-07-16T11:27:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | /**
*
*/
package com.tumri.joz.util;
import java.util.ArrayList;
import java.util.Collections;
import junit.framework.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
import com.tumri.joz.utils.Result;
/**
* @author omprakash
* @date May 30, 2014
* @time 2:54:08 PM
*/
public class TestJozResult {
@Test
public void test(){
Result r1 = new Result(111111, 1.1);
Result r2 = new Result(222222,2.2);
Result r3 = new Result(111111, 1.1);
Result r4 = new Result(666666, 1.1);
Result r5 = new Result(222222,2.3);
Result r6 = new Result(444444, 1.1);
Assert.assertTrue(r1.equals(r3));
Assert.assertFalse(r1.equals(r2));
Assert.assertFalse(r2.equals(r3));
ArrayList<Result> results = new ArrayList<Result>();
results.add(r1);
results.add(r2);
results.add(r3);
results.add(r4);
results.add(r5);
results.add(r6);
for(Result result: results){
System.out.println("Id: " + result.getOid() + " Score: " + result.getScore()) ;
}
Collections.sort(results);
System.out.println("after sorting the Results:");
for(Result result: results){
System.out.println("Id: " + result.getOid() + " Score: " + result.getScore()) ;
}
}
}
| [
"omprakash@collective.com"
] | omprakash@collective.com |
c37003027dcc5a022bebd434e006de0f6597e202 | c3101515ddde8a6e6ddc4294a4739256d1600df0 | /GeneralApp__2.20_1.0(1)_source_from_JADX/sources/com/google/firebase/crashlytics/internal/common/BytesBackedNativeSessionFile.java | 08fee452f5dc25aca3864685af9f3edf52f13b02 | [] | no_license | Aelshazly/Carty | b56fdb1be58a6d12f26d51b46f435ea4a73c8168 | d13f3a4ad80e8a7d0ed1c6a5720efb4d1ca721ee | refs/heads/master | 2022-11-14T23:29:53.547694 | 2020-07-08T19:23:39 | 2020-07-08T19:23:39 | 278,175,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,254 | java | package com.google.firebase.crashlytics.internal.common;
import com.google.firebase.crashlytics.internal.model.CrashlyticsReport.FilesPayload.File;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
/* compiled from: com.google.firebase:firebase-crashlytics@@17.0.0-beta04 */
class BytesBackedNativeSessionFile implements NativeSessionFile {
private final byte[] bytes;
private final String dataTransportFilename;
private final String reportsEndpointFilename;
BytesBackedNativeSessionFile(String dataTransportFilename2, String reportsEndpointFilename2, byte[] bytes2) {
this.dataTransportFilename = dataTransportFilename2;
this.reportsEndpointFilename = reportsEndpointFilename2;
this.bytes = bytes2;
}
public String getReportsEndpointFilename() {
return this.reportsEndpointFilename;
}
public InputStream getStream() {
if (isEmpty()) {
return null;
}
return new ByteArrayInputStream(this.bytes);
}
public File asFilePayload() {
byte[] gzippedBytes = asGzippedBytes();
if (gzippedBytes == null) {
return null;
}
return File.builder().setContents(gzippedBytes).setFilename(this.dataTransportFilename).build();
}
private boolean isEmpty() {
byte[] bArr = this.bytes;
return bArr == null || bArr.length == 0;
}
/* JADX WARNING: Code restructure failed: missing block: B:17:0x0028, code lost:
r4 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:19:?, code lost:
$closeResource(r3, r2);
*/
/* JADX WARNING: Code restructure failed: missing block: B:20:0x002c, code lost:
throw r4;
*/
/* JADX WARNING: Code restructure failed: missing block: B:24:0x002f, code lost:
r3 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:26:?, code lost:
$closeResource(r2, r0);
*/
/* JADX WARNING: Code restructure failed: missing block: B:27:0x0033, code lost:
throw r3;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
private byte[] asGzippedBytes() {
/*
r5 = this;
boolean r0 = r5.isEmpty()
r1 = 0
if (r0 == 0) goto L_0x0008
return r1
L_0x0008:
java.io.ByteArrayOutputStream r0 = new java.io.ByteArrayOutputStream // Catch:{ IOException -> 0x0034 }
r0.<init>() // Catch:{ IOException -> 0x0034 }
java.util.zip.GZIPOutputStream r2 = new java.util.zip.GZIPOutputStream // Catch:{ all -> 0x002d }
r2.<init>(r0) // Catch:{ all -> 0x002d }
byte[] r3 = r5.bytes // Catch:{ all -> 0x0026 }
r2.write(r3) // Catch:{ all -> 0x0026 }
r2.finish() // Catch:{ all -> 0x0026 }
byte[] r3 = r0.toByteArray() // Catch:{ all -> 0x0026 }
$closeResource(r1, r2) // Catch:{ all -> 0x002d }
$closeResource(r1, r0) // Catch:{ IOException -> 0x0034 }
return r3
L_0x0026:
r3 = move-exception
throw r3 // Catch:{ all -> 0x0028 }
L_0x0028:
r4 = move-exception
$closeResource(r3, r2) // Catch:{ all -> 0x002d }
throw r4 // Catch:{ all -> 0x002d }
L_0x002d:
r2 = move-exception
throw r2 // Catch:{ all -> 0x002f }
L_0x002f:
r3 = move-exception
$closeResource(r2, r0) // Catch:{ IOException -> 0x0034 }
throw r3 // Catch:{ IOException -> 0x0034 }
L_0x0034:
r0 = move-exception
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.crashlytics.internal.common.BytesBackedNativeSessionFile.asGzippedBytes():byte[]");
}
private static /* synthetic */ void $closeResource(Throwable x0, AutoCloseable x1) {
if (x0 != null) {
try {
x1.close();
} catch (Throwable th) {
}
} else {
x1.close();
}
}
}
| [
"aelshazly@engineer.com"
] | aelshazly@engineer.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.