blob_id
stringlengths 40
40
| language
stringclasses 1
value | repo_name
stringlengths 5
132
| path
stringlengths 2
382
| src_encoding
stringclasses 34
values | length_bytes
int64 9
3.8M
| score
float64 1.5
4.94
| int_score
int64 2
5
| detected_licenses
listlengths 0
142
| license_type
stringclasses 2
values | text
stringlengths 9
3.8M
| download_success
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|
75bcf8151fe17b2191ba33e17ad4d2bc881512f9
|
Java
|
aditya-dalal/public
|
/src/designPatternsNew/creational/abstractFactoryNew/Client.java
|
UTF-8
| 1,695 | 3.515625 | 4 |
[] |
no_license
|
package designPatternsNew.creational.abstractFactoryNew;
/**
* Created by aditya.dalal on 10/03/18.
*/
public class Client {
public static void main(String[] args) {
Application application = new Application(new MacGUIFactory());
application.paint();
}
}
interface Button {
void paint();
}
class MacButton implements Button {
@Override
public void paint() {
System.out.println("Mac button");
}
}
class WinButton implements Button {
@Override
public void paint() {
System.out.println("Windows button");
}
}
interface Textbox {
void paint();
}
class MacTexbox implements Textbox {
@Override
public void paint() {
System.out.println("Mac textbox");
}
}
class WinTextbox implements Textbox {
@Override
public void paint() {
System.out.println("Win textbox");
}
}
interface GUIFactory {
Button createButton();
Textbox createTextBox();
}
class WinGUIFactory implements GUIFactory {
@Override
public Button createButton() {
return new WinButton();
}
@Override
public Textbox createTextBox() {
return new WinTextbox();
}
}
class MacGUIFactory implements GUIFactory {
@Override
public Button createButton() {
return new MacButton();
}
@Override
public Textbox createTextBox() {
return new MacTexbox();
}
}
class Application {
Button button;
Textbox textbox;
public Application(GUIFactory factory) {
button = factory.createButton();
textbox = factory.createTextBox();
}
public void paint() {
button.paint();
textbox.paint();
}
}
| true |
f7b2b28bce58826a70fe1e83e3764ce076993a0d
|
Java
|
3yebMB/EattingCats
|
/src/Theme5/Dish.java
|
UTF-8
| 1,147 | 3.84375 | 4 |
[] |
no_license
|
package Theme5;
public class Dish extends Bowls {
float volume;
float foodInside;
public Dish(float volume) {
this.volume = volume;
}
public void emptyingBowl(CatFamily catFamily){
if (!catFamily.info()){
if ((foodInside-catFamily.getMaxFood()) >= 0) {
catFamily.eat(foodInside);
foodInside -= catFamily.getMaxFood();
}
else
System.out.println("В миске недостаточно еды.");
}
else
System.out.println("Котик сыт. В кормлении не нуждается... пока!");
}
@Override
public void fillingBowl(float food) {
if (volume-foodInside>=food)
this.foodInside += food;
else {
System.out.println("Вы стараетесь положить большое кол-во еды в миску. Можно положить, только "+
volume + " будем считать, что столько и положено.");
this.foodInside = volume;
}
}
}
| true |
465b14c983c01989633b74edf52274ad9a55c21d
|
Java
|
SergeyParfentiev/Prof-it
|
/src/main/java/project/service/UserService.java
|
UTF-8
| 865 | 1.921875 | 2 |
[] |
no_license
|
package project.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import project.dto.UserDTO;
import project.repository.UserRepository;
import java.util.List;
@Service
public class UserService {
private final UserRepository userRepository;
@Autowired
public UserService(UserRepository userRepository) {
this.userRepository = userRepository;
}
@Transactional
public void save(List<UserDTO> userList) {
userRepository.save(userList);
}
public List<UserDTO> getListByCommentId(long commentId) {
return userRepository.getListByCommentId(commentId);
}
public UserDTO getByUserName(String username) {
return userRepository.findByUsername(username);
}
}
| true |
4a5d3fd290f3c351d0ff253e169d10b2d2cf1b82
|
Java
|
CCCCoder/CampusRun
|
/app/src/main/java/com/n1njac/yiqipao/android/runengine/GpsStatusRemoteService.java
|
UTF-8
| 8,048 | 1.820313 | 2 |
[] |
no_license
|
package com.n1njac.yiqipao.android.runengine;
import android.Manifest;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.GpsSatellite;
import android.location.GpsStatus;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import com.n1njac.yiqipao.android.IGpsStatusCallback;
import com.n1njac.yiqipao.android.IGpsStatusService;
import java.util.Iterator;
/*
* Created by N1njaC on 2017/9/16.
* email:[email protected]
*/
public class GpsStatusRemoteService extends Service {
private static final String TAG = GpsStatusRemoteService.class.getSimpleName();
public static final int SIGNAL_FULL = 0x01;
public static final int SIGNAL_GOOD = 0x02;
public static final int SIGNAL_BAD = 0x03;
public static final int SIGNAL_NONE = 0x04;
private LocationManager mLocationManager;
private GpsStatus mGpsStatus;
private GpsListener mGpsListener;
private MyLocationListener mLocationListener;
private static final int MAX_SATELLITE = 255;
@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate");
mLocationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
mGpsListener = new GpsListener();
mLocationListener = new MyLocationListener();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(TAG, "onStartCommand");
initGpsStatus();
return START_STICKY;
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
Log.d(TAG, "onBind");
// initGpsStatus();
return mBinder;
}
private RemoteCallbackList<IGpsStatusCallback> mCallback = new RemoteCallbackList<>();
private IGpsStatusService.Stub mBinder = new IGpsStatusService.Stub() {
@Override
public void registerCallback(IGpsStatusCallback callback) throws RemoteException {
Log.d(TAG,"register gps callback");
mCallback.register(callback);
}
@Override
public void unRegisterCallback(IGpsStatusCallback callback) throws RemoteException {
mCallback.unregister(callback);
}
};
private void broadcastData(int status) {
int length = mCallback.beginBroadcast();
for (int i = 0; i < length; i++) {
try {
mCallback.getBroadcastItem(i).gpsStatus(status);
} catch (RemoteException e) {
e.printStackTrace();
}
}
mCallback.finishBroadcast();
}
private void initGpsStatus() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
mGpsStatus = mLocationManager.getGpsStatus(null);
mLocationManager.addGpsStatusListener(mGpsListener);
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 1, mLocationListener);
}
private class GpsListener implements GpsStatus.Listener {
@Override
public void onGpsStatusChanged(int event) {
switch (event) {
case GpsStatus.GPS_EVENT_FIRST_FIX:
Log.i(TAG, "第一次定位");
break;
case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
Log.i(TAG, "卫星状态改变");
Iterator<GpsSatellite> iterator = mGpsStatus.getSatellites().iterator();
int count = 0;
while (iterator.hasNext() && count <= MAX_SATELLITE) {
GpsSatellite gpsSatellite = iterator.next();
if (gpsSatellite.getSnr() > 30) {
count++;
if (count > 8) {
//满格信号
broadcastData(SIGNAL_FULL);
break;
} else if (count >= 4) {
//两格信号
broadcastData(SIGNAL_GOOD);
break;
} else {
//一格信号
broadcastData(SIGNAL_BAD);
break;
}
}
}
//测试用
broadcastData(SIGNAL_BAD);
Log.d(TAG, "satellite num:" + count);
break;
case GpsStatus.GPS_EVENT_STARTED:
Log.i(TAG, "gps打开");
Iterator<GpsSatellite> iterator2 = mGpsStatus.getSatellites().iterator();
int count2 = 0;
Log.d(TAG, "iterator2.hasNext():" + iterator2.hasNext());
// if (!iterator2.hasNext()){
// broadcastData(SIGNAL_NONE);
// break;
// }
while (iterator2.hasNext() && count2 <= MAX_SATELLITE) {
GpsSatellite gpsSatellite = iterator2.next();
//信噪比大于30,算作有效卫星
if (gpsSatellite.getSnr() > 30) {
count2++;
}
if (count2 > 8) {
//满格信号
broadcastData(SIGNAL_FULL);
} else if (count2 >= 4) {
//两格信号
broadcastData(SIGNAL_GOOD);
} else {
//一格信号
broadcastData(SIGNAL_BAD);
}
}
//测试用
broadcastData(SIGNAL_BAD);
Log.d(TAG, "satellite num:" + count2);
break;
case GpsStatus.GPS_EVENT_STOPPED:
Log.i(TAG, "gps关闭");
break;
}
}
}
private class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
Log.d(TAG, "onProviderEnabled");
}
@Override
public void onProviderDisabled(String provider) {
Log.d(TAG, "onProviderDisabled");
//gps未开启
broadcastData(SIGNAL_NONE);
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (mLocationManager != null) {
mLocationManager.removeGpsStatusListener(mGpsListener);
mLocationManager.removeUpdates(mLocationListener);
mLocationManager = null;
}
Log.d(TAG, "onDestroy");
}
}
| true |
313b8f75726403c4095b618896fa2b149dabfa64
|
Java
|
KeleiAzz/Text-Extraction
|
/src/SynonymGrouping/test2.java
|
UTF-8
| 1,858 | 2.984375 | 3 |
[] |
no_license
|
package SynonymGrouping;
/**
* Created by keleigong on 3/20/15.
*/
public class test2 {
public static void main(String[] args){
Vector v = new Vector();
Matrix m = new Matrix();
Vector vm = new Matrix();
DiagonalMatrix d = new DiagonalMatrix();
Matrix md = new DiagonalMatrix();
Vector vd = new DiagonalMatrix();
IdentityMatrix i = new IdentityMatrix();
Matrix mi = new IdentityMatrix();
Vector vi = new IdentityMatrix();
System.out.println("v.m");
v.add(m);
System.out.println("v.vm");
v.add(vm);
d.add(vm);
d.add(md);
vm.add(md);
i.add(d);
i.add(mi);
m.add(vi);
DiagonalMatrix.add(mi, md);
m = Matrix.add(mi, d);
}
}
class Vector {
/*1*/ public Vector add(Vector other) {
System.out.println(1);
return other;
}
/*2*/ public static Vector add(Vector first, Vector second) {
System.out.println(2);
return first;
}
}
class Matrix extends Vector {
/*3*/ public Matrix add(Matrix other) { System.out.println(3);
return other;};
/*4*/ public static Matrix add(Matrix first, Matrix second) { System.out.println(4);
return first;};
}
class DiagonalMatrix extends Matrix {
/*5*/ public DiagonalMatrix add(DiagonalMatrix other) {
System.out.println(5);
return other;}
/*6*/ public DiagonalMatrix add(Vector other) {
System.out.println(6);
return new DiagonalMatrix();}
/*7*/ public DiagonalMatrix add(Matrix other) {
System.out.println(7);
return (DiagonalMatrix) other;};
/*8*/ public static DiagonalMatrix add(DiagonalMatrix first, DiagonalMatrix second) { System.out.println(8);
return first;};
}
class IdentityMatrix extends Matrix {
/*9*/ public IdentityMatrix add(IdentityMatrix other) { System.out.println(9);
return other;};
/*10*/ public static IdentityMatrix add(IdentityMatrix first, IdentityMatrix second) { System.out.println(10);
return first;};
}
| true |
7597bc6e94e7d241d7bc12510db6c29f543e9eb3
|
Java
|
jposes22/App-Guias
|
/Codigo Servidores/Codigo Borneiro/src/main/java/es/server/java/borneiro/model/vo/GuiaSaberMasVO.java
|
UTF-8
| 2,667 | 2.0625 | 2 |
[] |
no_license
|
package es.server.java.borneiro.model.vo;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "GUIA_SABER_MAS")
public class GuiaSaberMasVO extends GenericLanguageVO implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3524850901475256846L;
@Id
@GeneratedValue
@Column(name = "id_guia_saber_mas")
private int idGuiaSaberMas;
@Column(name = "id_guia_detalle")
private int idGuiaDetalle;
@Column(name = "url_audio_guia_gl")
private String urlAudioGuiaGl;
@Column(name = "url_audio_guia_es")
private String urlAudioGuiaEs;
@Column(name = "url_audio_guia_en")
private String urlAudioGuiaEn;
@Column(name="longitud")
private double longitud;
@Column(name="latitud")
private double latitud;
//property one to many que no se llama desde el servicio rest GuiaSaberMas por eso le ponemos lazy
@OneToMany(targetEntity = GuiaSaberMasDetalleVO.class, fetch = FetchType.LAZY)
@JoinColumn(nullable = true,name="id_guia_saber_mas")
private List<GuiaSaberMasDetalleVO> listGuiaSaberDetalleMas;
public int getIdGuiaSaberMas() {
return idGuiaSaberMas;
}
public void setIdGuiaSaberMas(int idGuiaSaberMas) {
this.idGuiaSaberMas = idGuiaSaberMas;
}
public int getIdGuiaDetalle() {
return idGuiaDetalle;
}
public void setIdGuiaDetalle(int idGuiaDetalle) {
this.idGuiaDetalle = idGuiaDetalle;
}
public double getLongitud() {
return longitud;
}
public void setLongitud(double longitud) {
this.longitud = longitud;
}
public double getLatitud() {
return latitud;
}
public void setLatitud(double latitud) {
this.latitud = latitud;
}
public List<GuiaSaberMasDetalleVO> getListGuiaSaberDetalleMas() {
return listGuiaSaberDetalleMas;
}
public void setListGuiaSaberDetalleMas(List<GuiaSaberMasDetalleVO> listGuiaSaberDetalleMas) {
this.listGuiaSaberDetalleMas = listGuiaSaberDetalleMas;
}
public String getUrlAudioGuiaGl() {
return urlAudioGuiaGl;
}
public void setUrlAudioGuiaGl(String urlAudioGuiaGl) {
this.urlAudioGuiaGl = urlAudioGuiaGl;
}
public String getUrlAudioGuiaEs() {
return urlAudioGuiaEs;
}
public void setUrlAudioGuiaEs(String urlAudioGuiaEs) {
this.urlAudioGuiaEs = urlAudioGuiaEs;
}
public String getUrlAudioGuiaEn() {
return urlAudioGuiaEn;
}
public void setUrlAudioGuiaEn(String urlAudioGuiaEn) {
this.urlAudioGuiaEn = urlAudioGuiaEn;
}
}
| true |
e087e081bbfdc5be00882887ce15a7894a6f804a
|
Java
|
Projal/Projal
|
/Partie_Java/src/donnees/ContreIndication.java
|
UTF-8
| 1,326 | 2.640625 | 3 |
[] |
no_license
|
package donnees;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class ContreIndication {
private int id_contr;
private String nom;
public ContreIndication(Statement stmt, int id_contr, String nom) throws SQLException {
this.id_contr = id_contr;
this.nom = nom;
if(!contreIndicExistante(stmt, nom)) {
stmt.executeUpdate("INSERT INTO Contre_Indication VALUES(id_contr.nextval,'"+nom+"')");
}
}
public ContreIndication(Statement stmt, String nom) throws SQLException{
this.nom = nom;
ResultSet res = stmt.executeQuery("SELECT ID_CONTR FROM CONTRE_INDICATION WHERE NOM_CONTR = '"+nom+"'");
if(res.next())
id_contr = res.getInt(1);
}
public String getNom() {
return nom;
}
public boolean contreIndicExistante(Statement stmt, String nom) throws SQLException {
ResultSet result = stmt.executeQuery("SELECT NOM_CONTR FROM Contre_Indication WHERE NOM_CONTR = '"+nom+"'");
if(result.next())
return true;
return false;
}
public void estAssocie(int id_pat, Statement stmt) throws SQLException{
stmt.executeUpdate("INSERT INTO ESTASSOCIE VALUES ("+id_contr+","+id_pat+")");
}
public void concerne(int id_molec, Statement stmt) throws SQLException{
stmt.executeUpdate("INSERT INTO CONCERNE VALUES ("+id_molec+ ", " +id_contr+")");
}
}
| true |
3b510904657947bcf831c7efdd5945c734bc6ba1
|
Java
|
qfsf0220/gitxuexi
|
/test001/src/test1208/test2.java
|
UTF-8
| 795 | 2.921875 | 3 |
[] |
no_license
|
package test1208;
/**
* test2
*
* @author feng.qian
* @create at 2016-12-08 15:19
*/
public class test2 {
public static void main(String[] args) {
// System.out.println("");
// int [] []a = {{1,2},{3,4},{5,6}};
// for (int i=0;i<a.length;i++){
// for(int j =0;j<a[i].length;j++) {
// System.out.println(a[i][j]);
//
// }
// }
int []b={1,3,2,5,4};
int temp=0;
for (int i=0;i<b.length;i++){
for (int j=i;j<b.length;j++){
if(b[i]>b[j]){
temp=b[i];
b[i]=b[j];
b[j]=temp;
}
}
}
for(int a:b ){
System.out.println(a);
}
}
}
| true |
4d8dca947e4ccbd73fad09bcaf6def5458a98041
|
Java
|
sonyfe25cp/genius-parent
|
/genius-analysis/src/main/java/edu/bit/dlde/analysis/rank/commons/Parameters.java
|
UTF-8
| 879 | 2.609375 | 3 |
[] |
no_license
|
package edu.bit.dlde.analysis.rank.commons;
/**
* 机器学习的公共参数
*
* @author ChenJie
*
*/
public class Parameters {
/** 训练的轮数. */
private static int EpochNum = 4000;
/** 权重初始值. */
private static final double WeightInit = 0.0;
/** 梯度下降法的学习步长. */
private static final double Step = 0.0025;
/** 训练中每多少轮保存一次. */
private static int save = -1;
/**
* Instantiates a new parameters.
*/
private Parameters(){}
public static int getEpochNum() {
return EpochNum;
}
public static void setEpochNum(int epochNum) {
EpochNum = epochNum;
}
public static int getSave() {
return save;
}
public static void setSave(int save) {
Parameters.save = save;
}
public static double getWeightinit() {
return WeightInit;
}
public static double getStep() {
return Step;
}
}
| true |
b2ff9ecee06edef6246ea1ec11173b3f4a37c346
|
Java
|
hmlingesh/dynatrace-service-broker
|
/src/test/java/com/covisint/cf/broker/dynatrace/binding/BindingRequestTest.java
|
UTF-8
| 1,142 | 2.140625 | 2 |
[
"Apache-2.0"
] |
permissive
|
package com.covisint.cf.broker.dynatrace.binding;
import com.covisint.cf.broker.dynatrace.AbstractDeserializationTest;
import com.covisint.cf.broker.dynatrace.binding.BindingRequest;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
/**
* Class: BindingRequestTest.java
* Description: Test class for BindingRequest.
*
*@version 1.0, 2015-06-01
*@author lingesh - happiest minds-covisint
*
*/
public final class BindingRequestTest extends AbstractDeserializationTest<BindingRequest> {
public BindingRequestTest() {
super(BindingRequest.class);
}
@Override
protected void assertContents(BindingRequest instance) {
assertEquals("test-service-id", instance.getServiceId());
assertEquals("test-plan-id", instance.getPlanId());
assertEquals("test-app-guid", instance.getAppGuid());
}
@Override
protected Map getMap() {
Map<String, String> m = new HashMap<>();
m.put("service_id", "test-service-id");
m.put("plan_id", "test-plan-id");
m.put("app_guid", "test-app-guid");
return m;
}
}
| true |
b63151fc89834f0373905ebd66df4de1ad067970
|
Java
|
oigGe/kit
|
/programmieren-1/ÜbungsblätterSS2019/Übungsblatt2/AufgabeB/src/georggross/SumCalculator.java
|
UTF-8
| 2,311 | 3.8125 | 4 |
[] |
no_license
|
package georggross;
public final class SumCalculator {
// Utility class. Therefor a private constructor.
private SumCalculator() {
}
// Convert Character to an integer value.
private static int letterToInt(char input) {
input = Character.toUpperCase(input);
int value = input - 'A' + 1;
return value;
}
/**
* calculate the cross sum of letters and digits in the serial number.
* look for letters and converts them to int values using letterToInt().
*
* @param input String containing the serial number without check digit.
* @return int value with cross sum of serial number.
*/
public static int calcDigitSum(String input) {
int checkSum = 0;
for (int i = 0; i < input.length(); i++) {
if (Character.isLetter(input.charAt(i))) {
checkSum += letterToInt(input.charAt(i));
} else {
checkSum += input.charAt(i) - '0';
}
}
return checkSum;
}
/**
* calculate the check digit using the cross sum from calcDigitSum().
*
* @param input serial number as String without check digit.
* @return the check digit for the cross sum from input.
*/
public static int calcCheckSum(String input) {
int checkSum = calcDigitSum(input);
checkSum = checkSum % 9;
checkSum = 7 - checkSum;
if (checkSum == 0) {
checkSum = 9;
} else if (checkSum == -1) {
checkSum = 8;
}
return checkSum;
}
/**
* Calculate the check digit using calcChecksum() and compare it to the check digit in the serial number.
* Extract the check digit from input.
* Extract the Serial numbers required to calculate the check digit.
*
* @param input serial number as String including check digit.
* @return boolean, true if the calculated checksum and the given check digit are identical.
*/
public static boolean isValid(String input) {
String validationNumber = input.substring(input.length() - 1);
input = input.substring(0, input.length() - 1);
if (calcCheckSum(input) == Integer.parseInt(validationNumber)) {
return true;
}
return false;
}
}
| true |
e0b5bc63e485dfc5430410766646871a3882035d
|
Java
|
mapleskip/Utils
|
/animation/src/main/java/com/hwangjr/utils/animation/CustomAnim.java
|
UTF-8
| 13,636 | 2.875 | 3 |
[
"Apache-2.0"
] |
permissive
|
package com.hwangjr.utils.animation;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
public class CustomAnim {
/**
* Don't let anyone instantiate this class.
*/
private CustomAnim() {
throw new Error("Do not need instantiate!");
}
/**
* get a rotation animation
*
* @param fromDegrees Rotation offset to apply at the start of the
* animation.
* @param toDegrees Rotation offset to apply at the end of the animation.
* @param pivotXType Specifies how pivotXValue should be interpreted. One of
* Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
* Animation.RELATIVE_TO_PARENT.
* @param pivotXValue The X coordinate of the point about which the object
* is being rotated, specified as an absolute number where 0 is the
* left edge. This value can either be an absolute number if
* pivotXType is ABSOLUTE, or a percentage (where 1.0 is 100%)
* otherwise.
* @param pivotYType Specifies how pivotYValue should be interpreted. One of
* Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
* Animation.RELATIVE_TO_PARENT.
* @param pivotYValue The Y coordinate of the point about which the object
* is being rotated, specified as an absolute number where 0 is the
* top edge. This value can either be an absolute number if
* pivotYType is ABSOLUTE, or a percentage (where 1.0 is 100%)
* otherwise.
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return rotation animation
*/
public static RotateAnimation getRotateAnimation(float fromDegrees, float toDegrees, int pivotXType,
float pivotXValue, int pivotYType, float pivotYValue,
long durationMillis, Animation.AnimationListener listener) {
RotateAnimation rotateAnimation = new RotateAnimation(fromDegrees,
toDegrees, pivotXType, pivotXValue, pivotYType, pivotYValue);
rotateAnimation.setDuration(durationMillis);
if (listener != null) {
rotateAnimation.setAnimationListener(listener);
}
return rotateAnimation;
}
/**
* get an animation rotate by view center point.
*
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return animation rotate by view center point
*/
public static RotateAnimation getRotateAnimationByCenter(long durationMillis, Animation.AnimationListener listener) {
return getRotateAnimation(0f, 359f, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f, durationMillis,
listener);
}
/**
* get an animation rotate by view center point.
*
* @param durationMillis Duration in milliseconds
* @return animation rotate by view center point
*/
public static RotateAnimation getRotateAnimationByCenter(long durationMillis) {
return getRotateAnimationByCenter(durationMillis, null);
}
/**
* get an animation rotate by view center point.
*
* @param listener the animation listener to be notified
* @return animation rotate by view center point
*/
public static RotateAnimation getRotateAnimationByCenter(Animation.AnimationListener listener) {
return getRotateAnimationByCenter(AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
/**
* get an animation rotate by view center point.
* animation duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}
*
* @return animation rotate by view center point
*/
public static RotateAnimation getRotateAnimationByCenter() {
return getRotateAnimationByCenter(AnimationHelper.DEFAULT_ANIMATION_DURATION, null);
}
/**
* get an alpha animation.
*
* @param fromAlpha Starting alpha value for the animation, where 1.0 means
* fully opaque and 0.0 means fully transparent.
* @param toAlpha Ending alpha value for the animation.
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return An animation that controls the alpha level of an object.
*/
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis,
Animation.AnimationListener listener) {
AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
alphaAnimation.setDuration(durationMillis);
if (listener != null) {
alphaAnimation.setAnimationListener(listener);
}
return alphaAnimation;
}
/**
* get an alpha animation.
*
* @param fromAlpha Starting alpha value for the animation, where 1.0 means
* fully opaque and 0.0 means fully transparent.
* @param toAlpha Ending alpha value for the animation.
* @param durationMillis Duration in milliseconds
* @return An animation that controls the alpha level of an object.
*/
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis) {
return getAlphaAnimation(fromAlpha, toAlpha, durationMillis, null);
}
/**
* get an alpha animation. duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}.
*
* @param fromAlpha Starting alpha value for the animation, where 1.0 means
* fully opaque and 0.0 means fully transparent.
* @param toAlpha Ending alpha value for the animation.
* @param listener the animation listener to be notified
* @return An animation that controls the alpha level of an object.
*/
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha, Animation.AnimationListener listener) {
return getAlphaAnimation(fromAlpha, toAlpha, AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
/**
* get an alpha animation. duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}.
*
* @param fromAlpha Starting alpha value for the animation, where 1.0 means
* fully opaque and 0.0 means fully transparent.
* @param toAlpha Ending alpha value for the animation.
* @return An animation that controls the alpha level of an object.
*/
public static AlphaAnimation getAlphaAnimation(float fromAlpha, float toAlpha) {
return getAlphaAnimation(fromAlpha, toAlpha, AnimationHelper.DEFAULT_ANIMATION_DURATION, null);
}
/**
* get an animation from visible to invisible by changing alpha.
*
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return an animation from visible to invisible by changing alpha
*/
public static AlphaAnimation getVisibleAlphaAnimation(long durationMillis, Animation.AnimationListener listener) {
return getAlphaAnimation(1.0f, 0.0f, durationMillis, listener);
}
/**
* get an animation from visible to invisible by changing alpha.
*
* @param durationMillis Duration in milliseconds
* @return an animation from visible to invisible by changing alpha
*/
public static AlphaAnimation getVisibleAlphaAnimation(long durationMillis) {
return getVisibleAlphaAnimation(durationMillis, null);
}
/**
* get an animation from visible to invisible by changing alpha.
* default duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}
*
* @param listener the animation listener to be notified
* @return an animation from visible to invisible by changing alpha
*/
public static AlphaAnimation getVisibleAlphaAnimation(Animation.AnimationListener listener) {
return getVisibleAlphaAnimation(AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
/**
* get an animation from visible to invisible by changing alpha.
* default duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}
*
* @return an animation from visible to invisible by changing alpha
*/
public static AlphaAnimation getVisibleAlphaAnimation() {
return getVisibleAlphaAnimation(AnimationHelper.DEFAULT_ANIMATION_DURATION, null);
}
/**
* get an animation from invisible to visible by changing alpha.
*
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return an animation from invisible to visible by changing alpha
*/
public static AlphaAnimation getInvisibleAlphaAnimation(long durationMillis, Animation.AnimationListener listener) {
return getAlphaAnimation(0.0f, 1.0f, durationMillis, listener);
}
/**
* get an animation from invisible to visible by changing alpha.
*
* @param durationMillis Duration in milliseconds
* @return an animation from invisible to visible by changing alpha
*/
public static AlphaAnimation getInvisibleAlphaAnimation(long durationMillis) {
return getAlphaAnimation(0.0f, 1.0f, durationMillis, null);
}
/**
* get an animation from invisible to visible by changing alpha.
* default duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}
*
* @param listener the animation listener to be notified
* @return an animation from invisible to visible by changing alpha
*/
public static AlphaAnimation getInvisibleAlphaAnimation(Animation.AnimationListener listener) {
return getAlphaAnimation(0.0f, 1.0f, AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
/**
* get an animation from invisible to visible by changing alpha.
* default duration is {@link AnimationHelper#DEFAULT_ANIMATION_DURATION}
*
* @return an animation from invisible to visible by changing alpha
*/
public static AlphaAnimation getInvisibleAlphaAnimation() {
return getAlphaAnimation(0.0f, 1.0f, AnimationHelper.DEFAULT_ANIMATION_DURATION, null);
}
/**
* get a lessen scale animation
*
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return An animation that controls the lessen scale of an object
*/
public static ScaleAnimation getLessenScaleAnimation(long durationMillis, Animation.AnimationListener listener) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f,
0.0f, ScaleAnimation.RELATIVE_TO_SELF,
ScaleAnimation.RELATIVE_TO_SELF);
scaleAnimation.setDuration(durationMillis);
scaleAnimation.setAnimationListener(listener);
return scaleAnimation;
}
/**
* get a lessen scale animation
*
* @param durationMillis Duration in milliseconds
* @return An animation that controls the lessen scale of an object
*/
public static ScaleAnimation getLessenScaleAnimation(long durationMillis) {
return getLessenScaleAnimation(durationMillis, null);
}
/**
* get a lessen scale animation
*
* @param listener the animation listener to be notified
* @return An animation that controls the lessen scale of an object
*/
public static ScaleAnimation getLessenScaleAnimation(Animation.AnimationListener listener) {
return getLessenScaleAnimation(AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
/**
* get a amplification scale animation
*
* @param durationMillis Duration in milliseconds
* @param listener the animation listener to be notified
* @return An animation that controls the amplification scale of an object
*/
public static ScaleAnimation getAmplificationAnimation(long durationMillis, Animation.AnimationListener listener) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f,
1.0f, ScaleAnimation.RELATIVE_TO_SELF,
ScaleAnimation.RELATIVE_TO_SELF);
scaleAnimation.setDuration(durationMillis);
scaleAnimation.setAnimationListener(listener);
return scaleAnimation;
}
/**
* get a amplification scale animation
*
* @param durationMillis Duration in milliseconds
* @return An animation that controls the amplification scale of an object
*/
public static ScaleAnimation getAmplificationAnimation(long durationMillis) {
return getAmplificationAnimation(durationMillis, null);
}
/**
* get a amplification scale animation
*
* @param listener the animation listener to be notified
* @return An animation that controls the amplification scale of an object
*/
public static ScaleAnimation getAmplificationAnimation(Animation.AnimationListener listener) {
return getAmplificationAnimation(AnimationHelper.DEFAULT_ANIMATION_DURATION, listener);
}
}
| true |
0b0d311d700b6542eaa8d926fbdda424bcaa3c3c
|
Java
|
zhongxingyu/Seer
|
/Diff-Raw-Data/17/17_2703d324a2e06cbecebdc93724e0a4fa7dfef21a/TableInsertCluster/17_2703d324a2e06cbecebdc93724e0a4fa7dfef21a_TableInsertCluster_s.java
|
UTF-8
| 2,429 | 2.484375 | 2 |
[] |
no_license
|
package bixi.hbase.upload;
import java.io.File;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import bixi.dataset.cluster.XQuadTreeClustering;
import bixi.dataset.collection.XStation;
import bixi.hbase.query.BixiConstant;
public class TableInsertCluster {
static Configuration conf = HBaseConfiguration.create();
HTable table;
static byte[] tableName = BixiConstant.SCHEMA2_CLUSTER_TABLE_NAME.getBytes();
static byte[] idsFamily = BixiConstant.SCHEMA2_CLUSTER_FAMILY_NAME.getBytes();
/**
* @throws IOException
*/
public TableInsertCluster() throws IOException {
table = new HTable(conf, tableName);
table.setAutoFlush(true);
}
public static void main(String[] args) throws ParserConfigurationException, IOException {
TableInsertCluster inserter = new TableInsertCluster();
inserter.insertRow();
}
public void insertRow(){
XQuadTreeClustering clustering = new XQuadTreeClustering();
File dir = new File("data2");
String filename = dir.getAbsolutePath()+"/01_10_2010__00_00_01.xml";
clustering.doClustering(filename);
clustering.aggreateCluster();
Hashtable<String,List<String>> cluster_structure = clustering.getClusters();
int row = 0;
try{
Set<String> keys = cluster_structure.keySet();
Iterator<String> ie = keys.iterator();
while(ie.hasNext()){
String cluster = ie.next();
Put put = new Put(cluster.getBytes());
Iterator<String> ids = cluster_structure.get(cluster).iterator();
while(ids.hasNext()){
String stationId = ids.next();
if(Integer.valueOf(stationId).intValue()<10) stationId = "0"+stationId;
put.add(idsFamily, stationId.getBytes(), clustering.getOneStation(stationId).getMetadata().getBytes());
}
//System.out.println(new String(put.getRow()));
row++;
table.put(put);
}
}catch(Exception e){
e.printStackTrace();
}
System.out.println("inserted row : "+row);
}
}
| true |
c88e7c933f75e7748df44a3b48f3738eb32d82cf
|
Java
|
jacqueterrell/atlas
|
/app/src/main/java/com/team/mamba/atlas/data/model/api/fireStore/CrmNotes.java
|
UTF-8
| 7,033 | 2.125 | 2 |
[] |
no_license
|
package com.team.mamba.atlas.data.model.api.fireStore;
import com.google.firebase.firestore.Exclude;
import com.google.firebase.firestore.IgnoreExtraProperties;
import com.team.mamba.atlas.utils.formatData.AppFormatter;
import com.team.mamba.atlas.utils.formatData.RegEx;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@IgnoreExtraProperties
public class CrmNotes {
public String id= "";
public String subjectID= "";
public String authorID= "";
public String noteName= "";
public String poc= "";
public String whereMetCitySt= "";
public String whereMetEventName= "";
public int howMet;
public int stage;
public int type;
public int oppGoal;
public String desc= "";
public int nextStep;
public double timestamp; //creation time
public double closeTimestamp; //close time
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSubjectID() {
return subjectID;
}
public void setSubjectID(String subjectID) {
this.subjectID = subjectID;
}
public String getAuthorID() {
return authorID;
}
public void setAuthorID(String authorID) {
this.authorID = authorID;
}
public String getNoteName() {
return noteName;
}
public void setNoteName(String noteName) {
this.noteName = noteName;
}
public String getPoc() {
return poc;
}
public void setPoc(String poc) {
this.poc = poc;
}
public String getWhereMetCitySt() {
return whereMetCitySt;
}
public void setWhereMetCitySt(String whereMetCitySt) {
this.whereMetCitySt = whereMetCitySt;
}
public String getWhereMetEventName() {
return whereMetEventName;
}
public void setWhereMetEventName(String whereMetEventName) {
this.whereMetEventName = whereMetEventName;
}
public int getHowMet() {
return howMet;
}
public void setHowMet(int howMet) {
this.howMet = howMet;
}
public int getStage() {
return stage;
}
public void setStage(int stage) {
this.stage = stage;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getOppGoal() {
return oppGoal;
}
public void setOppGoal(int oppGoal) {
this.oppGoal = oppGoal;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getNextStep() {
return nextStep;
}
public void setNextStep(int nextStep) {
this.nextStep = nextStep;
}
public double getTimestamp() {
return timestamp;
}
public void setTimestamp(double timestamp) {
this.timestamp = timestamp;
}
public double getCloseTimestamp() {
return closeTimestamp;
}
public void setCloseTimestamp(double closeTimestamp) {
this.closeTimestamp = closeTimestamp;
}
@Exclude public long getAdjustedTimeStamp(){
String adjustedTime = AppFormatter.timeStampFormatter.format(timestamp);
return Long.parseLong(adjustedTime);
}
@Exclude public long getAdjustedCloseTimeStamp(){
String adjustedTime = AppFormatter.timeStampFormatter.format(closeTimestamp);
return Long.parseLong(adjustedTime);
}
@Exclude public String getHowMetToString(){
if (howMet == 0){
return "Exhibit Booth";
} else if ( howMet == 1){
return "Networking";
} else {
return "Meeting";
}
}
@Exclude public String getStageToString(){
if (stage == 0){
return "New";
} else if ( stage == 1){
return "Qualified";
} else if (stage == 2){
return "Proposal";
} else if (stage == 3){
return "Negotiation";
} else if (stage == 4){
return "Closed Won";
} else {
return "Closed Lost";
}
}
@Exclude public String getTypeToString(){
if (type == 0){
return "Commercial";
} else if ( type == 1){
return "Non-Profit";
} else if (type == 2){
return "Federal";
} else if (type == 3){
return "Local";
} else {
return "State";
}
}
@Exclude public String getOpportunityGoalToString(){
if (oppGoal == 0){
return "Solicitation";
} else if ( oppGoal == 1){
return "Teaming";
} else {
return "Direct Sell";
}
}
@Exclude public String getNextStepToString(){
if (nextStep == 0){
return "Email";
} else if ( nextStep == 1){
return "Phone Call";
} else if (nextStep == 2){
return "Teleconference";
} else if (nextStep == 3){
return "Meeting";
} else {
return "Proposal";
}
}
@Exclude public String getDateCreatedToString(){
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(getAdjustedTimeStamp() * 1000);
int month = calendar.get(Calendar.MONTH);
String monthName = getMonth(month);
int day = calendar.get(Calendar.DAY_OF_MONTH);
int year = calendar.get(Calendar.YEAR);
String stamp = String.valueOf(getAdjustedTimeStamp());
if (stamp.matches(RegEx.ALLOW_DIGITS_AND_DECIMALS)
&& stamp.length() > 1){
return monthName + " " + day + " " + year;
} else {
return "";
}
}
@Exclude public String getDateClosedToString(){
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(getAdjustedCloseTimeStamp() * 1000);
int month = calendar.get(Calendar.MONTH);
String monthName = getMonth(month);
int day = calendar.get(Calendar.DAY_OF_MONTH);
int year = calendar.get(Calendar.YEAR);
String stamp = String.valueOf(getAdjustedCloseTimeStamp());
if (stamp.matches(RegEx.ALLOW_DIGITS_AND_DECIMALS)
&& stamp.length() > 1){
return monthName + " " + day + " " + year;
} else {
return "";
}
}
@Exclude private String getMonth(int index) {
List<String> monthsList = new ArrayList<>();
monthsList.add("Jan");
monthsList.add("Feb");
monthsList.add("Mar");
monthsList.add("Apr");
monthsList.add("May");
monthsList.add("Jun");
monthsList.add("Jul");
monthsList.add("Aug");
monthsList.add("Sep");
monthsList.add("Oct");
monthsList.add("Nov");
monthsList.add("Dec");
return monthsList.get(index);
}
}
| true |
d04f8554056d672496da8c17d3a07bb5f8289287
|
Java
|
bulaiocht/java-starter
|
/src/main/java/ok/lesson8/Employee.java
|
UTF-8
| 3,088 | 3.34375 | 3 |
[] |
no_license
|
package ok.lesson8;
public class Employee {
private Integer id;
private String name;
private String secondName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSecondName() {
return secondName;
}
public void setSecondName(String secondName) {
this.secondName = secondName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Employee)) return false;
Employee employee = (Employee) o;
if (getId() != null ? !getId().equals(employee.getId()) : employee.getId() != null) return false;
if (getName() != null ? !getName().equals(employee.getName()) : employee.getName() != null) return false;
return getSecondName() != null ? getSecondName().equals(employee.getSecondName()) : employee.getSecondName() == null;
}
@Override
public int hashCode() {
int result = getId() != null ? getId().hashCode() : 0;
result = 31 * result + (getName() != null ? getName().hashCode() : 0);
result = 31 * result + (getSecondName() != null ? getSecondName().hashCode() : 0);
return result;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (!(o instanceof Employee)) return false;
//
// Employee employee = (Employee) o;
//
// if (getId() != null ? !getId().equals(employee.getId()) : employee.getId() != null) return false;
// if (getName() != null ? !getName().equals(employee.getName()) : employee.getName() != null) return false;
// return getSecondName() != null ? getSecondName().equals(employee.getSecondName()) : employee.getSecondName() == null;
//
// }
//
// @Override
// public int hashCode() {
// int result = getId() != null ? getId().hashCode() : 0;
// result = 31 * result + (getName() != null ? getName().hashCode() : 0);
// result = 31 * result + (getSecondName() != null ? getSecondName().hashCode() : 0);
// return result;
// }
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// Employee employee = (Employee) o;
//
// if (id != null ? !id.equals(employee.id) : employee.id != null) return false;
// if (name != null ? !name.equals(employee.name) : employee.name != null) return false;
// return secondName != null ? secondName.equals(employee.secondName) : employee.secondName == null;
//
// }
//
// @Override
// public int hashCode() {
// int result = id != null ? id.hashCode() : 0;
// result = 31 * result + (name != null ? name.hashCode() : 0);
// result = 31 * result + (secondName != null ? secondName.hashCode() : 0);
// return result;
// }
}
| true |
7e55da4f75f769501bf9657542d9be220f958001
|
Java
|
zano5/Siyikhipha
|
/app/src/main/java/macmain/co/za/siyikhipha/BackgroundTask.java
|
UTF-8
| 5,802 | 2.3125 | 2 |
[] |
no_license
|
package macmain.co.za.siyikhipha;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.widget.Toast;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
* Created by ProJava on 11/25/2015.
*/public class BackgroundTask extends AsyncTask<String,Void,String> {
AlertDialog builder;
Context context;
String user_name;
BackgroundTask(Context context) {
this.context = context;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
builder = new AlertDialog.Builder(context).create();
builder.setTitle("Login Information...");
}
@Override
protected String doInBackground(String... params) {
String reg_url = "http://10.0.2.2/webmacmain/registration.php";
String log_url = "http://10.0.2.2/webmacmain/log.php";
String method = params[0];
//name,surname,username,email,sex,province,password
if (method.equals("register")) {
String name = params[1];
String surname = params[2];
String username = params[3];
String email = params[4];
String region = params[5];
String password = params[6];
try {
URL url = new URL(reg_url);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
OutputStream os = httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
String data = URLEncoder.encode("name", "UTF-8") + "=" + URLEncoder.encode(name, "UTF-8") + "&" +
URLEncoder.encode("surname", "UTF-8") + "=" + URLEncoder.encode(surname, "UTF-8") + "&" +
URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(username, "UTF-8") + "&" +
URLEncoder.encode("email", "UTF-8") + "=" + URLEncoder.encode(email, "UTF-8") + "&" +
URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode(password, "UTF-8") + "&" + URLEncoder.encode("region", "UTF-8") + "=" + URLEncoder.encode(region, "UTF-8");
bufferedWriter.write(data);
bufferedWriter.flush();
bufferedWriter.close();
os.close();
InputStream is = httpURLConnection.getInputStream();
is.close();
httpURLConnection.disconnect();
return "registration success...";
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} else if (method.equals("login")) {
user_name = params[1];
String password = params[2];
try {
URL url = new URL(log_url);
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
OutputStream os = httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
String data = URLEncoder.encode("login_username", "UTF-8") + "=" + URLEncoder.encode(user_name, "UTF-8") + "&" +
URLEncoder.encode("login_password", "UTF-8") + "=" + URLEncoder.encode(password, "UTF-8");
bufferedWriter.write(data);
bufferedWriter.flush();
bufferedWriter.close();
os.close();
InputStream is = httpURLConnection.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"));
String response = "";
String line = "";
while ((line = bufferedReader.readLine()) != null) {
response += line;
}
bufferedReader.close();
is.close();
httpURLConnection.disconnect();
return response;
// httpURLConnection.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(String result) {
if (result.equals("registration success...")) {
Toast.makeText(context, result, Toast.LENGTH_LONG).show();
} else {
builder.setMessage(result);
builder.show();
}
if (result.equals("Login Success...Welcome")) {
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
}
}
}
| true |
ffe0fdc11708c814c32acd80d316fd125e8a7ff3
|
Java
|
nick318/mongodb-dbref
|
/src/main/java/com/mongod/example/domain/Country.java
|
UTF-8
| 506 | 1.851563 | 2 |
[] |
no_license
|
package com.mongod.example.domain;
import com.mongod.example.db.CascadeSave;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "countries")
@Data
@Accessors(chain = true)
public class Country {
@Id
private String id;
private String name;
@DBRef
@CascadeSave
private Area area;
}
| true |
a49870959cdc4e15fa3dfae866a92d1602dee980
|
Java
|
CS683-Mobile-Apps/cs683-project-josebGithub
|
/app/src/main/java/edu/bu/metcs/myproject/Database/MyFoodManagerDao.java
|
UTF-8
| 13,716 | 2.578125 | 3 |
[] |
no_license
|
package edu.bu.metcs.myproject.Database;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Date;
import edu.bu.metcs.myproject.FoodItem;
import edu.bu.metcs.myproject.FoodSpace;
public class MyFoodManagerDao {
private final static String TAG = MyFoodManagerDao.class.getSimpleName();
public static MyFoodManagerDao instance;
public MyFoodManagerDBHelper myFoodManagerDBHelper;
public SQLiteDatabase mReadableDB, mWriteableDB;
public MyFoodManagerDao(Context context) {
myFoodManagerDBHelper = new MyFoodManagerDBHelper(context);
}
public void openDB() {
mReadableDB = myFoodManagerDBHelper.getReadableDatabase();
mWriteableDB = myFoodManagerDBHelper.getWritableDatabase();
}
public void closeDB() {
mReadableDB.close();
mWriteableDB.close();
}
public static MyFoodManagerDao getInstance(Context context) {
if (instance == null)
instance = new MyFoodManagerDao(context);
return instance;
}
public long addFoodSpace(FoodSpace foodspace) {
ContentValues foodSpaceValue = new ContentValues();
foodSpaceValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE, foodspace.getTitle());
return mWriteableDB.insert(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_SPACE_TABLE_NAME, null, foodSpaceValue);
}
public long addFoodItem(int foodspaceId, FoodItem fooditem) {
ContentValues foodItemValue = new ContentValues();
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID, foodspaceId);
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME, fooditem.getName());
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE, fooditem.getType());
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE, fooditem.getExpirationDate().toString());
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY, fooditem.getQuantity());
foodItemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST, fooditem.getCost());
return mWriteableDB.insert(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME, null, foodItemValue);
}
public ArrayList<FoodSpace> getAllFoodSpaces() {
String[] foodspaceValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE};
Cursor foodspaceCursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_SPACE_TABLE_NAME,
foodspaceValues, null, null, null, null, null);
ArrayList<FoodSpace> foodspaces = new ArrayList<FoodSpace>();
while (foodspaceCursor.moveToNext()) {
int foodspaceId = foodspaceCursor.getInt(foodspaceCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID));
String foodspaceTitle = foodspaceCursor.getString(foodspaceCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE));
foodspaces.add(new FoodSpace(foodspaceTitle));
} // while
foodspaceCursor.close();
return foodspaces;
}
public ArrayList<FoodItem> getAllFoodItems(int foodspaceId) {
String[] fooditemValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST};
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID + "=?";
String[] selectionArgs = {Integer.toString(foodspaceId)};
Cursor fooditemCursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
fooditemValues, selection, selectionArgs, null, null, null);
ArrayList<FoodItem> fooditems = new ArrayList<FoodItem>();
while (fooditemCursor.moveToNext()) {
int fooditemId = fooditemCursor.getInt(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID));
String fooditemName = fooditemCursor.getString(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME));
String fooditemType = fooditemCursor.getString(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE));
String fooditemExpirydate = fooditemCursor.getString(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE));
String fooditemQuantity = fooditemCursor.getString(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY));
String fooditemCost = fooditemCursor.getString(fooditemCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST));
fooditems.add(new FoodItem(fooditemId, foodspaceId, fooditemName, fooditemType, fooditemExpirydate, fooditemQuantity, Double.parseDouble(fooditemCost)));
} // while
fooditemCursor.close();
return fooditems;
}
public FoodSpace getFoodSpaceById(int foodspaceId) {
String[] foodspaceValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE};
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID + "=?";
String[] selectionArgs = {Integer.toString(foodspaceId)};
Cursor cursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_SPACE_TABLE_NAME,
foodspaceValues, selection, selectionArgs, null, null, null);
cursor.moveToFirst();
String foodspaceTitle = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE));
FoodSpace foodspace = new FoodSpace(foodspaceId, foodspaceTitle);
cursor.close();
return foodspace;
}
public FoodItem getFoodItemById(int fooditemId, int foodspaceId) {
String[] fooditemValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST};
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID + "=? AND " +
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID + "=?";
String[] selectionArgs = {Integer.toString(fooditemId), Integer.toString(foodspaceId)};
Cursor cursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
fooditemValues, selection, selectionArgs, null, null, null);
cursor.moveToFirst();
String fooditemName = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME));
String fooditemType = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE));
String fooditemExpirydate = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE));
String fooditemQuantity = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY));
String fooditemCost = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST));
Log.d("TAG", "fooditemId : " + fooditemId);
Log.d("TAG", "fooditemId : " + fooditemName);
Log.d("TAG", "fooditemId : " + fooditemType);
Log.d("TAG", "fooditemId : " + fooditemExpirydate);
FoodItem fooditem = new FoodItem(fooditemId, foodspaceId, fooditemName, fooditemType, fooditemExpirydate, fooditemQuantity, Double.parseDouble(fooditemCost));
cursor.close();
return fooditem;
}
public String[] getAllFoodSpaceTitles() {
String[] foodspaceTitleValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE};
Cursor foodspaceTitleCursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_SPACE_TABLE_NAME,
foodspaceTitleValues, null, null, null, null, null);
String[] foodspaceTitles = new String[foodspaceTitleCursor.getCount()];
while (foodspaceTitleCursor.moveToNext()) {
String foodspaceId = foodspaceTitleCursor.getString(foodspaceTitleCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ID));
String foodspaceTitle = foodspaceTitleCursor.getString(foodspaceTitleCursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_TITLE));
foodspaceTitles[Integer.parseInt(foodspaceId)] = foodspaceTitle;
} // while
foodspaceTitleCursor.close();
return foodspaceTitles;
}
public long updateFoodItemById(FoodItem fooditem, int fooditemId, int foodspaceId) {
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID + "=? AND " +
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID + "=?";
String[] selectionArgs = {Integer.toString(fooditemId), Integer.toString(foodspaceId)};
ContentValues fooditemValue = new ContentValues();
fooditemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME, fooditem.getName());
fooditemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_TYPE, fooditem.getType());
fooditemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE, fooditem.getExpirationDate().toString());
fooditemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_QUANTITY, fooditem.getQuantity());
fooditemValue.put(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_COST, fooditem.getCost());
long numberOfRows = mWriteableDB.update(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
fooditemValue, selection, selectionArgs);
return numberOfRows;
}
public long delectFoodItemById(int itemId) {
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID + "=?";
String[] selectionArgs = {itemId + ""};
return mWriteableDB.delete(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
selection, selectionArgs);
}
public int getFoodSpaceId(int fooditemId) {
String[] fooditemValues = {MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID,
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID};
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_ITEM_ID + "=?";
String[] selectionArgs = {Integer.toString(fooditemId)};
Cursor cursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
fooditemValues, selection, selectionArgs, null, null, null);
cursor.moveToFirst();
int foodspaceId = cursor.getInt(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_SPACE_ITEM_ID));
cursor.close();
return foodspaceId;
}
public ArrayList<String> getFridgeFoodItemByExpiryDate(String expiryDate) {
ArrayList<String> foodItem=new ArrayList<String>();
String[] fooditemValues = {
MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME};
String selection = MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_EXPIRY_DATE + " = ?";
String[] selectionArgs = {expiryDate};
Cursor cursor = mReadableDB.query(MyFoodManagerDBContract.MyFoodManagerContract.FOOD_ITEM_TABLE_NAME,
fooditemValues, selection, selectionArgs, null, null, null);
Log.d("TAG", "Querying expiry food items...");
while (cursor.moveToNext()) {
String fooditemName = cursor.getString(cursor.getColumnIndex(MyFoodManagerDBContract.MyFoodManagerContract.COLUMN_FOOD_NAME));
Log.d("TAG", "fooditemId : " + fooditemName);
foodItem.add(fooditemName);
}
if (foodItem == null) {
Log.d("TAG", "No food items are going to expire...");
}
cursor.close();
return foodItem;
}
}
| true |
0b0c45a6f9dcec3b3917a478c6505829f76ac974
|
Java
|
mateoim/FER-Java-Course
|
/hw17-0036509386-2/src/main/java/hr/fer/zemris/java/hw17/jvdraw/tools/Tool.java
|
UTF-8
| 975 | 3.328125 | 3 |
[] |
no_license
|
package hr.fer.zemris.java.hw17.jvdraw.tools;
import java.awt.*;
import java.awt.event.MouseEvent;
/**
* An interface used to model all tools.
*
* @author Mateo Imbrišak
*/
public interface Tool {
/**
* Represents a click.
*
* @param e {@link MouseEvent}.
*/
void mousePressed(MouseEvent e);
/**
* Represents release of a click.
*
* @param e {@link MouseEvent}.
*/
void mouseReleased(MouseEvent e);
/**
* Represents a click.
*
* @param e {@link MouseEvent}.
*/
void mouseClicked(MouseEvent e);
/**
* Represents mouse movement.
*
* @param e {@link MouseEvent}.
*/
void mouseMoved(MouseEvent e);
/**
* Represents mouse movement.
*
* @param e {@link MouseEvent}.
*/
void mouseDragged(MouseEvent e);
/**
* Paints the mouse movement.
*
* @param g2d used to do the painting.
*/
void paint(Graphics2D g2d);
}
| true |
af9624372f1b82b22aaffec781b4fe0e9e173270
|
Java
|
lixiawss/fd-j
|
/feidao-service-migratory/src/main/java/com/feidao/platform/service/migratory/drools/DrawDrools.java
|
UTF-8
| 4,331 | 2.359375 | 2 |
[] |
no_license
|
package com.feidao.platform.service.migratory.drools;
import com.feidao.platform.service.migratory.drools.bean.BindField;
import com.feidao.platform.service.migratory.drools.bean.EdgeBean;
import com.feidao.platform.service.migratory.drools.bean.VertexBean;
/**
* 提供给Drools 调用接口
*
* @author znyuan
* @date 2016年5月12日
*/
public class DrawDrools {
public static void drawVertex(DrawExecute DE, String nodeType, String condtion, String... paramfields) {
VertexBean vbMp = DE.getVbMp().get(nodeType);
if (vbMp == null) {
vbMp = new VertexBean();
DE.getVbMp().put(nodeType, vbMp);
vbMp.setNodeType(nodeType);
vbMp.setCondtion(condtion);
for (String key : paramfields) {
if (DE.getParamsKey().get(key) == null)
DE.getParamsKey().put(key, "1");
}
}
}
/**
* 顶点信
*
* @param DE
* 运行的对象<br>
* @param nodeType
* 节点类型<br>
* @param nodeProp
* 节点字段<br>
* @param key
* 绑定key(fieldid,tablename,externalcdt,paramfield)<br>
* @param value
* 绑定值<br>
*/
public static void drawVertexSet(DrawExecute DE, String nodeType, String nodeProp, String key, String value) {
VertexBean vbMp = DE.getVbMp().get(nodeType);
BindField bindField = vbMp.getSetMap().get(nodeProp);
if (bindField == null) {
bindField = new BindField();
vbMp.getSetMap().put(nodeProp, bindField);
}
dealBindField(bindField, key, value);
}
public static void drawVertexSet(DrawExecute DE, String nodeType, String nodeProp, String allValue) {
VertexBean vbMp = DE.getVbMp().get(nodeType);
BindField bindField = vbMp.getSetMap().get(nodeProp);
if (bindField == null) {
bindField = new BindField();
vbMp.getSetMap().put(nodeProp, bindField);
}
dealBindField(bindField, allValue);
}
public static void drawEdge(DrawExecute DE, String nodeType, String condtion, String... paramfields) {
EdgeBean ebMp = DE.getEbMp().get(nodeType);
if (ebMp == null) {
ebMp = new EdgeBean();
DE.getEbMp().put(nodeType, ebMp);
ebMp.setNodeType(nodeType);
ebMp.setCondtion(condtion);
for (String key : paramfields) {
if (DE.getParamsKey().get(key) == null)
DE.getParamsKey().put(key, "1");
}
}
}
/**
* 顶点信
*
* @param DE
* 运行的对象<br>
* @param nodeType
* 节点类型<br>
* @param nodeProp
* 节点字段<br>
* @param key
* 绑定key(fieldid,tablename,externalcdt,paramfield)<br>
* @param value
* 绑定值<br>
*/
public static void drawEdgeSet(DrawExecute DE, String nodeType, String nodeProp, String key, String value) {
EdgeBean ebMp = DE.getEbMp().get(nodeType);
BindField bindField = ebMp.getSetMap().get(nodeProp);
if (bindField == null) {
bindField = new BindField();
ebMp.getSetMap().put(nodeProp, bindField);
}
dealBindField(bindField, key, value);
}
public static void drawEdgeSet(DrawExecute DE, String nodeType, String nodeProp, String allValue) {
EdgeBean ebMp = DE.getEbMp().get(nodeType);
BindField bindField = ebMp.getSetMap().get(nodeProp);
if (bindField == null) {
bindField = new BindField();
ebMp.getSetMap().put(nodeProp, bindField);
}
dealBindField(bindField, allValue);
}
/**
* 设置信息
*
* @param bindField
* @param key
* @param value
*/
private static void dealBindField(BindField bindField, String key, String value) {
if (key.equalsIgnoreCase("fieldid")) {
bindField.setFieldId(value);
return;
}
if (key.equalsIgnoreCase("tablename")) {
bindField.setTableName(value);
return;
}
if (key.equalsIgnoreCase("externalcdt")) {
bindField.setExternalCdt(value);
return;
}
if (key.equalsIgnoreCase("paramfield")) {
bindField.setParamField(value);
return;
}
}
/**
* 设置信息
*
* @param bindField
* @param key
* @param value
*/
private static void dealBindField(BindField bindField, String allvalue) {
String[] param = allvalue.split(";");
if (0 < param.length) {
bindField.setFieldId(param[0]);
}
if (1 < param.length) {
bindField.setTableName(param[1]);
}
if (2 < param.length) {
bindField.setExternalCdt(param[2]);
}
if (3 < param.length) {
bindField.setParamField(param[3]);
}
}
}
| true |
c9d87c071379de2d9bddefbe9726f197107c97a6
|
Java
|
sszumilas/Performance-Appraisal-System
|
/src/main/java/pl/lodz/p/it/spjava/sop8/web/mnote/ConfirmMnotePageBean.java
|
UTF-8
| 970 | 1.875 | 2 |
[] |
no_license
|
package pl.lodz.p.it.spjava.sop8.web.mnote;
import pl.lodz.p.it.spjava.sop8.web.mnote.*;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import pl.lodz.p.it.spjava.sop8.model.Mnote;
@ManagedBean(name = "confirmMnotePageBean")
@RequestScoped
public class ConfirmMnotePageBean {
public ConfirmMnotePageBean() {
}
// @PostConstruct
// private void initBean() {
// mnote = mnoteSession.getMnoteChange();
// }
//
// @ManagedProperty(value="#{mnoteSession}")
// private MnoteSession mnoteSession;
//
// public void setMnoteSession(MnoteSession mnoteSession) {
// this.mnoteSession = mnoteSession;
// }
//
// private Mnote mnote;
//
// public Mnote getMnote() {
// return mnote;
// }
//
// public String mnoteMnote() {
// return mnoteSession.confirmUploadMnote();
// }
}
| true |
a6e709855701258f45e3620582778e5081e27f87
|
Java
|
jail1/somepxsv
|
/src/main/java/ro/activemall/photoxserver/repositories/TagsRepository.java
|
UTF-8
| 547 | 1.898438 | 2 |
[] |
no_license
|
package ro.activemall.photoxserver.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import ro.activemall.photoxserver.entities.ResourceTagName;
public interface TagsRepository extends JpaRepository<ResourceTagName, Long> {
// dummy - to be removed when added another method
@Query("SELECT tn FROM tag_name tn WHERE tn.id = :id")
List<ResourceTagName> get(@Param("id") Long id);
}
| true |
2a2f2622243f3aaac999b52c0c23142880adc4be
|
Java
|
hejackey/heproject
|
/indexServer/searchlist/com/moobao/searchlist/WriteDbList.java
|
UTF-8
| 6,360 | 2.4375 | 2 |
[] |
no_license
|
package com.moobao.searchlist;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.lucene.search.IndexSearcher;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import com.apply.b2b.cms.base.BaseDAO;
import com.moobao.indexser.peijian.field.PeiJianContentField;
import com.moobao.indexser.phone.field.PhoneContentField;
import com.moobao.searchInterface.SearchInterface;
/**
* 将词库的关键字和相应的搜索数目写入表中.
* @author liuxueyong
*
*/
public class WriteDbList {
private Connection conn = null;
private PreparedStatement pstmt = null;
/**
* 将词库中的keywords的搜索数目插入表中
* @param type 1:手机,2:配件,3.资讯,4.增值
* @param fieldName
* @param searcher
*/
public void writerToDb( int type, String fieldName, IndexSearcher searcher ) {
Set set1 = new HashSet();
Set set2 = new HashSet();
//取出表中的.
GetFieldFromDb gf = new GetFieldFromDb();
String sql1 = "select productname, productmodel from product_list";
String sql2 = "select keywords from search_keywords";
List<String> fields = new ArrayList();
fields.add("productname");
fields.add("productmodel");
set1 = gf.getField(sql1, fields);
set2 = gf.getField(sql2, "keywords");
List<String> list_keywords = new ArrayList(set1);
List<String> list_keywords2 = new ArrayList(set2);
String product = "";
for( int i = 0; i < list_keywords.size(); i ++ ) {
product = list_keywords.get(i);
for( int j = 0; j < list_keywords2.size(); j ++ ) {
if(list_keywords2.get(j).equals(product)) {
list_keywords.remove(i);
i--;
}
}
}
//词库中的词所对应的数量.
List<Integer> list_num = GetKeywordNum.getSearchNum( type, fieldName, searcher, list_keywords );
BaseDAO dao = new BaseDAO();
String sql = "";
if( list_num != null && list_num.size() > 0 ) {
for( int i = 0; i < list_num.size(); i ++ ) {
sql = "insert into search_keywords(id, search_type, keywords,num, sortby) values( SEQ_SEARCH_KEYWORDS.nextval, '"+type+"', '"+list_keywords.get(i)+"' ,'"+list_num.get(i)+"' , 0)";
dao.executeUpdate( sql );
}
}
}
/**
* 更新search_keywords中"手机"和"配件"的搜索数量
* @param type 1:手机,2:配件
* @param fieldName
* @param searcher
*/
public void updateToDb() {
IndexSearcher searcher_phone = SearchInterface.getPhoneSearcher();
IndexSearcher searcher_peijian = SearchInterface.getPeiJianSearcher();
BaseDAO dao = new BaseDAO();
List<Integer> search_type = new ArrayList<Integer>(); //1.手机 2.配件
List<String> list_keywords = new ArrayList<String>();
List<Integer> list_num = new ArrayList<Integer>();
SqlRowSet rs = dao.getRowSetQuery( "select search_type, keywords from search_keywords" );
while( rs.next() ) {
search_type.add( rs.getInt("search_type") );
list_keywords.add( rs.getString("keywords") );
}
int num = 0;
if( search_type != null && search_type.size() > 0 ) {
for( int i = 0; i < search_type.size(); i ++ ) {
if( search_type.get(i) == 1 ) {
//表中keywords所对应的数量.
num = GetKeywordNum.getSearchNum( search_type.get(i), searcher_phone, list_keywords.get(i) );
}
else {
//表中keywords所对应的数量.
num = GetKeywordNum.getSearchNum( search_type.get(i), searcher_peijian, list_keywords.get(i) );
}
list_num.add( num );
}
//更新表的数量字段
String sql = "";
for( int i = 0; i < list_num.size(); i ++ ) {
sql = "update search_keywords set num = "+list_num.get(i)+" where search_type = '"+search_type.get(i)+ "' and keywords = '"+list_keywords.get(i)+"' ";
dao.executeUpdate( sql );
}
}
else {
System.out.println( "没有满足条件的记录!" );
}
//System.out.println( "search_type数量:" + search_type.size() + " " + "list_keywords数量:" + list_keywords.size() + " " + "list_num数量:" + list_num.size() );
}
public void addHighProperty( List<String> sql ) {
BaseDAO dao = new BaseDAO();
if( sql != null && sql.size() > 0 ) {
for( int i = 0; i < sql.size(); i ++ ) {
dao.executeUpdate( sql.get(i) );
}
}
}
public static void main( String[] args ) {
WriteDbList db = new WriteDbList();
int type = 1;
String fieldName = PhoneContentField.fieldName;
IndexSearcher searcher = SearchInterface.getPhoneSearcher();
db.writerToDb( type, fieldName, searcher );
db.updateToDb();
// List<String> sql = new ArrayList<String>();
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval,1,'拍照',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'MP3',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'视频拍摄',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'录音',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'蓝牙',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'扩展卡',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'手写',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'智能系统',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'红外',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'和弦',0,0)");
// sql.add("insert into search_keywords(id,search_type, keywords, num ,sortby) values( SEQ_SEARCH_KEYWORDS.nextval, 1,'GPS',0,0)");
// db.addHighProperty(sql);
}
}
| true |
b53217d656ffa376ae64811380bdb4753b638ee0
|
Java
|
wStockhausen/DisMELS
|
/DisMELS_ROMS/src/wts/roms/gui/Calculator_OceanTime.java
|
UTF-8
| 9,415 | 2.265625 | 2 |
[
"MIT"
] |
permissive
|
/*
* Calculator_OceanTime.java
*
* Created on December 6, 2005, 11:35 AM
*/
package wts.roms.gui;
/**
*
* @author William Stockhausen
*/
import java.beans.PropertyChangeEvent;
import wts.models.utilities.CalendarJulian;
import wts.models.utilities.DateTime;
public class Calculator_OceanTime extends javax.swing.JDialog {
private CalendarJulian julCal;
private DateTime dtOceanDate;
private DateTime dtRefDate;
/** Creates new form ModelDataViewer */
public Calculator_OceanTime(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
julCal = new CalendarJulian();
dtOceanDate = julCal.getDate();
dtcOceanDate.setObject(dtOceanDate);
julCal.setDate(dtOceanDate);
long t = julCal.getTimeOffset();
jtfTime.setText(Long.toString(t));
dtOceanDate.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
dtOceanDatePropertyChanged(evt);
}
});
dtRefDate = julCal.getRefDate();
dtcRefDate.setObject(dtRefDate);
dtRefDate.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
dtRefDatePropertyChanged(evt);
}
});
}
private void dtOceanDatePropertyChanged(PropertyChangeEvent evt) {
julCal.setDate(dtOceanDate);
long t = julCal.getTimeOffset();
jtfTime.setText(Long.toString(t));
}
private void dtRefDatePropertyChanged(PropertyChangeEvent evt) {
julCal.setRefDate(dtRefDate);
long t = julCal.getTimeOffset();
jtfTime.setText(Long.toString(t));
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel3 = new javax.swing.JPanel();
jtfTime = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
dtcOceanDate = new wts.models.utilities.DateTimeCustomizer();
jPanel2 = new javax.swing.JPanel();
dtcRefDate = new wts.models.utilities.DateTimeCustomizer();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("ROMS Ocean Time Calculator");
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Ocean time"));
jtfTime.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jtfTimeActionPerformed(evt);
}
});
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jtfTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 150, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jtfTime, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Ocean date"));
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(dtcOceanDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(dtcOceanDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Reference date"));
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(dtcRefDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel2Layout.createSequentialGroup()
.add(dtcRefDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jtfTimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtfTimeActionPerformed
long t = Long.parseLong(jtfTime.getText());
julCal.setTimeOffset(t);
dtOceanDate = julCal.getDate();
dtcOceanDate.setObject(dtOceanDate);
dtOceanDate.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
dtOceanDatePropertyChanged(evt);
}
});
}//GEN-LAST:event_jtfTimeActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Calculator_OceanTime(new javax.swing.JFrame(),true).setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private wts.models.utilities.DateTimeCustomizer dtcOceanDate;
private wts.models.utilities.DateTimeCustomizer dtcRefDate;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JTextField jtfTime;
// End of variables declaration//GEN-END:variables
}
| true |
a3b1babb261501e7d5e9e139971cf301fc7327ca
|
Java
|
Russelldan554/WebsiteProjects
|
/Snake/src/dev/druss/snake/worlds/World.java
|
UTF-8
| 558 | 2.734375 | 3 |
[] |
no_license
|
package dev.druss.snake.worlds;
import java.awt.Color;
import java.awt.Graphics;
import dev.druss.snake.Handler;
public class World {
private Handler handler;
private int width, height;
public World(Handler handler, String string) {
this.handler = handler;
loadWorld();
}
private void loadWorld() {
}
public void render(Graphics g) {
width = handler.getWidth();
height = handler.getHeight();
g.setColor(Color.BLACK);
g.fillRect(0, 0, width, height);
}
public void tick() {
// TODO Auto-generated method stub
}
}
| true |
70bc36b04f83201d25ded5cdbb77f9453024f7db
|
Java
|
hyo90/JavaStudy20210811
|
/이효원3624/src/practice/Quiz_1000.java
|
UHC
| 386 | 3.046875 | 3 |
[] |
no_license
|
package practice;
import java.util.Scanner;
public class Quiz_1000 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// System.out.print("ù° : ");
int i = sc.nextInt();
// System.out.print("ι : ");
int i2 = sc.nextInt();
// System.out.print(" : ");
System.out.println(i + i2);
}
}
| true |
b3a9019422c244dd69c8c9475645f10a747b79f2
|
Java
|
Neressea/compilation
|
/Compile/src/generator/ExpressionArithmetique.java
|
ISO-8859-1
| 1,528 | 3.09375 | 3 |
[] |
no_license
|
package generator;
import java.util.ArrayList;
import java.util.Arrays;
import org.antlr.runtime.tree.CommonTree;
import analyse.TDS;
public class ExpressionArithmetique extends Instruction{
public ExpressionArithmetique(CommonTree node, SupaHackaGenerator generator) {
super(node, generator);
}
@Override
public void genererCode(ArrayList<TDS> pile) {
ArrayList<String> ope = new ArrayList<>(Arrays.asList(new String[]{"+","-","*","/", "NEG"}));
CodeAss ca = CodeAss.getCodeSingleton();
if (!ope.contains(node.getText())) {
OperandeSimple os = new OperandeSimple(node, this.generator);
os.genererCode(pile);
} else {
ExpressionArithmetique ea = new ExpressionArithmetique((CommonTree) node.getChild(0), this.generator);
ea.genererCode(pile);
//Si jamais on a NEG, on ngationne R3 et on s'arrte l
if(node.getText().equals("NEG")){
ca.append("NEG R3, R3");
return;
}
ca.append("STW R3, -(R15) //On empile le resultat de l'operande droite");
ea = new ExpressionArithmetique((CommonTree) node.getChild(1), this.generator);
ea.genererCode(pile);
ca.append("LDW R2, (R15)+ //On depile l'operande droite");
switch (node.getText()) {
case "+":
// R2 (partie gauche) + R3 (partie droite) dans R3
ca.append("ADD R2, R3, R3");
break;
case "-":
ca.append("SUB R2, R3, R3");
break;
case "*":
ca.append("MUL R2, R3, R3");
break;
case "/":
ca.append("DIV R2, R3, R3");
break;
}
}
}
}
| true |
9040419b53ac3d7e22567c782675009cd358c13b
|
Java
|
suevip/productCenter
|
/src/main/java/com/yijiawang/web/platform/productCenter/util/GenCodeUtil.java
|
UTF-8
| 1,754 | 2.40625 | 2 |
[] |
no_license
|
package com.yijiawang.web.platform.productCenter.util;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Map;
/**
* Created by xy on 2017/2/9.
*/
public class GenCodeUtil {
public static Font loadFont(String fontFileName, float fontSize) //第一个参数是外部字体名,第二个是字体大小
{
try
{
File file = new File(fontFileName);
FileInputStream aixing = new FileInputStream(file);
Font dynamicFont = Font.createFont(Font.TRUETYPE_FONT, aixing);
Font dynamicFontPt = dynamicFont.deriveFont(fontSize);
aixing.close();
return dynamicFontPt;
}
catch(Exception e)//异常处理
{
e.printStackTrace();
return new java.awt.Font("宋体", Font.PLAIN, 14);
}
}
public static BufferedImage genCodeImage(String url, int width, int height) {
try {
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map hints = new HashMap();
//内容所使用编码
hints.put(EncodeHintType.CHARACTER_SET, "gb2312");
BitMatrix bitMatrix = multiFormatWriter.encode(url, BarcodeFormat.QR_CODE, width, height, hints);
return MatrixToImageWriter.toBufferedImage(bitMatrix);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| true |
fb1ce4316d28487cd199b1834ffa83f193472e99
|
Java
|
jotaceperez/aws-lambda-api-dynamodb-graalvm
|
/src/main/java/com/nickvanhoof/ApiGatewayRequestHandler.java
|
UTF-8
| 1,415 | 2.171875 | 2 |
[] |
no_license
|
package com.nickvanhoof;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
import com.google.gson.Gson;
import com.nickvanhoof.dao.MessageDao;
import com.nickvanhoof.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.Map;
@Named("myHandler")
public class ApiGatewayRequestHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
@Inject
private Gson gson;
@Inject
private MessageService messageService;
public ApiGatewayRequestHandler() {}
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input, Context context) {
MessageDao messageDao = messageService.handleGetMessageRequest(input.getPathParameters().get("uuid"));
return new APIGatewayProxyResponseEvent()
.withStatusCode(201)
.withHeaders(Map.of("X-Powered-By", "AWS-Lambda", "X-Created-By", "https://twitter.com/TheNickVanHoof"))
.withBody(messageToJson(messageDao));
}
private String messageToJson(MessageDao message) {
return gson.toJson(message);
}
}
| true |
023f97b466b8e10141ec7f14d0044b814da940a4
|
Java
|
cjburkey01/FreeBoi
|
/src/main/java/com/cjburkey/freeboi/world/World.java
|
UTF-8
| 7,811 | 2.1875 | 2 |
[
"MIT"
] |
permissive
|
package com.cjburkey.freeboi.world;
import com.cjburkey.freeboi.Game;
import com.cjburkey.freeboi.components.Transform;
import com.cjburkey.freeboi.concurrent.IAction;
import com.cjburkey.freeboi.concurrent.ThreadPool;
import com.cjburkey.freeboi.concurrent.ThreadSafeHandler;
import com.cjburkey.freeboi.ecs.ECSEntity;
import com.cjburkey.freeboi.ecs.ECSWorld;
import com.cjburkey.freeboi.util.Debug;
import com.cjburkey.freeboi.util.Texture;
import com.cjburkey.freeboi.util.TimeDebug;
import com.cjburkey.freeboi.util.Util;
import com.cjburkey.freeboi.value.Pos;
import com.cjburkey.freeboi.world.event.ChunkGenerationBegin;
import com.cjburkey.freeboi.world.event.ChunkGenerationFinish;
import com.cjburkey.freeboi.world.generation.IChunkGenerator;
import it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import java.util.UUID;
import org.joml.Vector3f;
public class World {
public static final int chunkWidth = 32;
public static final int chunkHeight = 128;
public static final int regionSize = chunkWidth;
private final int chunkLoadingRadiusBlocks;
private final float updateInterval;
private final float unloadTime;
private float updateTimer = 0.0f;
private boolean loadChunks = true;
private final Object2ObjectOpenHashMap<Pos, Chunk> chunks = new Object2ObjectOpenHashMap<>();
private final Object2FloatOpenHashMap<Pos> chunksToUnload = new Object2FloatOpenHashMap<>();
private final ThreadPool generationThreadPool = new ThreadPool("ChunkGeneration", 4);
private final Object2ObjectOpenHashMap<UUID, Transform> loaders = new Object2ObjectOpenHashMap<>();
private final ThreadSafeHandler threadSafeHandler = new ThreadSafeHandler(Integer.MAX_VALUE);
private final IChunkGenerator generator;
public World(IChunkGenerator generator, int chunkLoadingRadiusBlocks, float updateInterval, float unloadTime) {
this.generator = generator;
this.chunkLoadingRadiusBlocks = chunkLoadingRadiusBlocks;
this.updateInterval = updateInterval;
this.unloadTime = unloadTime;
}
public void overrideChunkLoading() {
loadChunks = !loadChunks;
}
public void addChunkLoader(ECSEntity entity) {
loaders.put(entity.uuid, entity.transform);
}
public void removeChunkLoader(ECSEntity entity) {
loaders.remove(entity.uuid);
}
public int getLoadedChunks() {
return chunks.size();
}
public float getCheckTime() {
return updateInterval - updateTimer;
}
private Chunk getChunkRaw(Pos pos) {
if (chunks.containsKey(pos)) {
return chunks.get(pos);
}
Chunk chunk = new Chunk(this, pos.x, pos.y, pos.z);
chunks.put(pos, chunk);
return chunk;
}
public void update(float deltaTime) {
TimeDebug.start("world.update");
TimeDebug.start("world.update.render");
ChunkRenderHelper.update();
TimeDebug.pause("world.update.render");
TimeDebug.start("world.update.generate");
threadSafeHandler.update();
TimeDebug.pause("world.update.generate");
updateTimer += deltaTime;
if (updateTimer < updateInterval) {
return;
}
updateTimer -= updateInterval;
if (loadChunks) {
TimeDebug.start("world.update.loadChunks");
TimeDebug.start("world.update.loadChunks.unloadTime");
ObjectOpenHashSet<Pos> chunksToRemove = new ObjectOpenHashSet<>();
for (Pos chunkToUnload : chunksToUnload.keySet()) {
float time = chunksToUnload.getFloat(chunkToUnload) + updateInterval;
if (time >= unloadTime) {
chunksToRemove.add(chunkToUnload);
} else {
chunksToUnload.put(chunkToUnload, time);
}
}
TimeDebug.pause("world.update.loadChunks.unloadTime");
TimeDebug.start("world.update.loadChunks.unload");
for (Pos chunkToRemove : chunksToRemove) {
chunksToUnload.removeFloat(chunkToRemove);
unload(chunkToRemove);
}
TimeDebug.pause("world.update.loadChunks.unload");
TimeDebug.start("world.update.loadChunks.loadSearch");
ObjectOpenHashSet<Pos> chunksToLoad = new ObjectOpenHashSet<>();
for (Transform entity : loaders.values()) {
Pos currentChunk = blockToRawChunk(entity.position);
int chunkRadius = Util.divCeil(chunkLoadingRadiusBlocks, chunkWidth);
for (int x = -chunkRadius; x <= chunkRadius; x++) {
for (int y = -chunkRadius; y <= chunkRadius; y++) {
for (int z = -chunkRadius; z <= chunkRadius; z++) {
chunksToLoad.add(rawChunkToChunk(currentChunk.add(x, y, z)));
}
}
}
}
TimeDebug.pause("world.update.loadChunks.loadSearch");
TimeDebug.start("world.update.loadChunks.unloadCheck");
for (Pos loadedChunk : chunks.keySet()) {
boolean toLoadHas = chunksToLoad.contains(loadedChunk);
boolean unloadHas = chunksToUnload.containsKey(loadedChunk);
if (unloadHas && toLoadHas) {
chunksToUnload.removeFloat(loadedChunk);
} else if (!unloadHas && !toLoadHas) {
chunksToUnload.put(loadedChunk, 0.0f);
}
}
TimeDebug.pause("world.update.loadChunks.unloadCheck");
TimeDebug.start("world.update.loadChunks.load");
for (Pos chunkToLoad : chunksToLoad) {
if (!chunks.containsKey(chunkToLoad)) {
getChunk(chunkToLoad);
}
}
TimeDebug.pause("world.update.loadChunks.load");
TimeDebug.pause("world.update.loadChunks");
}
TimeDebug.pause("world.update");
}
private void unload(Pos chunk) {
if (chunks.containsKey(chunk)) {
chunks.remove(chunk).remove();
}
}
public void exit() {
ChunkRenderHelper.stop();
generationThreadPool.stop();
}
private void queueGeneration(final Chunk chunk) {
chunk.markGenerating();
generationThreadPool.queueAction(() -> generateChunk(chunk));
}
private void generateChunk(Chunk chunk) {
chunk.initArray();
Game.EVENT_HANDLER.trigger(new ChunkGenerationBegin(chunk));
generator.generate(chunk);
chunk.markGenerated();
queue(() -> Game.EVENT_HANDLER.trigger(new ChunkGenerationFinish(chunk)));
}
private void queue(IAction action) {
threadSafeHandler.queue(action);
}
// Queues the chunk's generation if necessary
public Chunk getChunk(Pos pos) {
Chunk chunk = getChunkRaw(pos);
if (!chunk.getIsGenerated() && !chunk.getIsGenerating()) {
queueGeneration(chunk);
}
return chunk;
}
public ECSEntity addChunkToScene(ECSWorld scene, Texture texture, Pos pos) {
return ChunkRenderHelper.queueChunkRender(scene, texture, getChunk(pos));
}
private static Pos blockToRawChunk(Vector3f pos) {
return new Pos(pos.x / chunkWidth, pos.y / chunkWidth, pos.z / chunkWidth);
}
private static Pos rawChunkToChunk(Pos pos) {
return new Pos(pos.x, Util.divFloor(pos.y, Util.divFloor(chunkHeight, chunkWidth)), pos.z);
}
}
| true |
fd2cfc278276f7caab5eb1da4a35745266b11a87
|
Java
|
daviddaw/arrays
|
/Arrays/src/ejercicios_Strings_LeerTeclado/herenciaVehiculos/Main.java
|
UTF-8
| 1,722 | 3.09375 | 3 |
[] |
no_license
|
package herenciaVehiculos;
public class Main {
Vehiculo[] arrayVehiculos;
public static void main(String[] args) {
Vehiculo moto = new Vehiculo("vespino", "3498-plp", 2, 100);
Coche deportivo = new Coche("ferrari", "8909-jvl", 50, 300, "amarillo", 3, true);
Camion camion2 = new Camion("Pegaso", "2343-PM", 8, 5000, 45678, 567, "Pedro");
Camion camion1 = new Camion("Renault", "1111-PPP", 6, 567777, 3500, 3000, "Antonio");
System.out.println(moto.toString());
System.out.println(deportivo.toString());
System.out.println(camion1.toString());
System.out.println(camion2.toString());
System.out.println("De que color quieres pintar el coche");
String nuevoColor=LeerTeclado.readString();
deportivo.pintarCoche(nuevoColor);
System.out.println("Cuantos kgs quieres cargar el camion 1");
int carga=LeerTeclado.readInteger();
camion1.cargar(carga);
System.out.println("Cuantos kgs quieres descargar el camion");
int descarga=LeerTeclado.readInteger();
System.out.println("Cargamos 50kg al camion 2");
carga=50;
camion2.cargar(carga);
System.out.println();
System.out.println("Descargamos 40kg del camion 2");
descarga=40;
camion2.descargar(descarga);
System.out.println();
System.out.println();
System.out.println("Cambiamos el coductor 1 por David");
String conductor="David";
camion1.cambiarConductor(conductor);
camion1.descargar(descarga);
System.out.println(moto.toString());
System.out.println(deportivo.toString());
System.out.println(camion1.toString());
System.out.println(camion2.toString());
}
}
| true |
6a52e4b736890d3c9cd2b720ac4eb2a0704674d1
|
Java
|
salta-kozbagarova/healthapp
|
/src/main/java/kz/salikhanova/healthapp/service/MedicalCenterServiceImpl.java
|
UTF-8
| 9,499 | 2.21875 | 2 |
[] |
no_license
|
package kz.salikhanova.healthapp.service;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import kz.salikhanova.healthapp.model.CalculatedHospitalRating;
import kz.salikhanova.healthapp.model.CalculatedMedicalCenterRating;
import kz.salikhanova.healthapp.model.Hospital;
import kz.salikhanova.healthapp.model.HospitalRating;
import kz.salikhanova.healthapp.model.MedicalCenter;
import kz.salikhanova.healthapp.model.MedicalCenterRating;
import kz.salikhanova.healthapp.model.User;
import kz.salikhanova.healthapp.util.GoogleGeoCoder;
@Service("medicalCenterService")
public class MedicalCenterServiceImpl implements MedicalCenterService {
private static String egovApiUrl = "http://data.egov.kz/api/v2/medicinalyk_ortalyktar2/v2";
@Resource(name = "medicalCenterRatingService")
private MedicalCenterRatingService medicalCenterRatingService;
@Resource(name = "userService")
private UserService userService;
@Resource(name = "calculatedMedicalCenterRatingService")
private CalculatedMedicalCenterRatingService calculatedMedicalCenterRatingService;
@Override
public List<MedicalCenter> findAll(Boolean nameSort, Boolean priceSort, Boolean serviceSort) {
List<MedicalCenter> medicalCenters = new ArrayList<MedicalCenter>();
try{
URL url = new URL(this.egovApiUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
int responseCode = con.getResponseCode();
System.out.println("\nSending 'GET' request to URL : " + this.egovApiUrl);
System.out.println("Response Code : " + responseCode);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream(),"UTF-8"));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = bufferedReader.readLine()) != null) {
response.append(inputLine);
}
bufferedReader.close();
JSONArray jsonArr = new JSONArray(response.toString());
MedicalCenter medicalCenter = null;
CalculatedMedicalCenterRating chr = null;
HashMap<String,Double> coords;
for (int i = 0; i < jsonArr.length(); i++) {
JSONObject jsonObj = jsonArr.getJSONObject(i);
Gson gson = new Gson();
medicalCenter = gson.fromJson(jsonObj.toString(), MedicalCenter.class);
/*if(medicalCenter.getAddress()!=null && !medicalCenter.getAddress().isEmpty()) {
if((coords = GoogleGeoCoder.getCoordinates(medicalCenter.getAddress()))!=null) {
medicalCenter.setLat(coords.get("lat"));
medicalCenter.setLng(coords.get("lng"));
}
}*/
chr = calculatedMedicalCenterRatingService.findByMedicalCenterId(medicalCenter.getId());
if(chr!=null) {
medicalCenter.setPriceRating(chr.getPriceRating()!=null?chr.getPriceRating():0);
medicalCenter.setServiceRating(chr.getServiceRating()!=null?chr.getServiceRating():0);
medicalCenter.setPriceCount(chr.getPriceCount()!=null?chr.getPriceCount():0);
medicalCenter.setServiceCount(chr.getServiceCount()!=null?chr.getServiceCount():0);
} else {
medicalCenter.setPriceRating((short)0);
medicalCenter.setServiceRating((short)0);
medicalCenter.setPriceCount(0L);
medicalCenter.setServiceCount(0L);
}
medicalCenters.add(medicalCenter);
}
if(nameSort!=null && nameSort==true){
Collections.sort(medicalCenters, new Comparator<MedicalCenter>(){
@Override
public int compare(MedicalCenter arg0, MedicalCenter arg1) {
return arg1.getOrganizationName().compareTo(arg0.getOrganizationName());
}
});
}
if(priceSort!=null && priceSort==true){
Collections.sort(medicalCenters, new Comparator<MedicalCenter>(){
@Override
public int compare(MedicalCenter arg0, MedicalCenter arg1) {
return arg1.getPriceRating().compareTo(arg0.getPriceRating());
}
});
}
if(serviceSort!=null && serviceSort==true){
Collections.sort(medicalCenters, new Comparator<MedicalCenter>(){
@Override
public int compare(MedicalCenter arg0, MedicalCenter arg1) {
return arg1.getServiceRating().compareTo(arg0.getServiceRating());
}
});
}
for (MedicalCenter h : medicalCenters) {
System.out.println(h.toString());
}
} catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
return medicalCenters;
}
@Override
public MedicalCenter findOne(Long id) {
MedicalCenter medicalCenter = null;
String str="";
try{
URL url = new URL(this.egovApiUrl+"?source={%20\"size\":1,%20\"query\":%20{%20\"bool\":{%20\"must\":[%20{\"match\":{\"id\":%20\""+id+"\"}}%20]%20}%20}%20}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
int responseCode = con.getResponseCode();
System.out.println("\nSending 'GET' request to URL : " + url.toString());
System.out.println("Response Code : " + responseCode);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream(),"UTF-8"));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = bufferedReader.readLine()) != null) {
response.append(inputLine);
}
bufferedReader.close();
JSONArray jsonArr = new JSONArray(response.toString());
CalculatedMedicalCenterRating chr = null;
MedicalCenterRating hr = null;
User curUser = new User();
HashMap<String,Double> coords;
Gson gson = new Gson();
medicalCenter = gson.fromJson(jsonArr.getJSONObject(0).toString(), MedicalCenter.class);
/*if(medicalCenter.getAddress()!=null && !medicalCenter.getAddress().isEmpty()) {
if((coords = GoogleGeoCoder.getCoordinates(medicalCenter.getAddress()))!=null) {
medicalCenter.setLat(coords.get("lat"));
medicalCenter.setLng(coords.get("lng"));
}
}*/
chr = calculatedMedicalCenterRatingService.findByMedicalCenterId(medicalCenter.getId());
if(chr!=null) {
medicalCenter.setPriceRating(chr.getPriceRating()!=null?chr.getPriceRating():0);
medicalCenter.setServiceRating(chr.getServiceRating()!=null?chr.getServiceRating():0);
medicalCenter.setPriceCount(chr.getPriceCount()!=null?chr.getPriceCount():0);
medicalCenter.setServiceCount(chr.getServiceCount()!=null?chr.getServiceCount():0);
} else {
medicalCenter.setPriceRating((short)0);
medicalCenter.setServiceRating((short)0);
medicalCenter.setPriceCount(0L);
medicalCenter.setServiceCount(0L);
}
curUser = userService.getCurrentUser();
if(curUser!=null) {
hr = medicalCenterRatingService.findByUserForMedicalCenter(curUser.getId(), medicalCenter.getId());
if(hr!=null) {
medicalCenter.setCurUserPriceRating(hr.getPrice());
medicalCenter.setCurUserServiceRating(hr.getService());
}
}
System.out.println(medicalCenter.toString());
} catch(Exception e){
System.out.println(e.getMessage());
}
return medicalCenter;
}
@Override
public void ratePrice(Long id, Short price) {
User currentUser = userService.getCurrentUser();
MedicalCenterRating medicalCenterRating = medicalCenterRatingService.findByUserForMedicalCenter(currentUser.getId(), id);
if(medicalCenterRating==null) {
medicalCenterRating = new MedicalCenterRating();
medicalCenterRating.setUser(currentUser);
medicalCenterRating.setMedicalCenterId(id);
}
medicalCenterRating.setPrice(price);
medicalCenterRatingService.save(medicalCenterRating);
CalculatedMedicalCenterRating calcMedicalCenterRating = calculatedMedicalCenterRatingService.findByMedicalCenterId(id);
if(calcMedicalCenterRating==null) {
calcMedicalCenterRating = new CalculatedMedicalCenterRating();
calcMedicalCenterRating.setMedicalCenterId(id);
}
calcMedicalCenterRating.setPriceRating(medicalCenterRatingService.calculatePriceAvg(id));
calcMedicalCenterRating.setPriceCount(medicalCenterRatingService.calculatePriceCount(id));
calculatedMedicalCenterRatingService.save(calcMedicalCenterRating);
}
@Override
public void rateService(Long id, Short service) {
User currentUser = userService.getCurrentUser();
MedicalCenterRating medicalCenterRating = medicalCenterRatingService.findByUserForMedicalCenter(currentUser.getId(), id);
if(medicalCenterRating==null) {
medicalCenterRating = new MedicalCenterRating();
medicalCenterRating.setUser(currentUser);
medicalCenterRating.setMedicalCenterId(id);
}
medicalCenterRating.setService(service);
medicalCenterRatingService.save(medicalCenterRating);
CalculatedMedicalCenterRating calcMedicalCenterRating = calculatedMedicalCenterRatingService.findByMedicalCenterId(id);
if(calcMedicalCenterRating==null) {
calcMedicalCenterRating = new CalculatedMedicalCenterRating();
calcMedicalCenterRating.setMedicalCenterId(id);
}
calcMedicalCenterRating.setServiceRating(medicalCenterRatingService.calculateServiceAvg(id));
calcMedicalCenterRating.setServiceCount(medicalCenterRatingService.calculateServiceCount(id));
calculatedMedicalCenterRatingService.save(calcMedicalCenterRating);
}
}
| true |
80224821c945491f2a7773a9da67b44693e79a55
|
Java
|
yyy932949717/fh1902
|
/src/main/java/com/fh/shop/api/util/KeyUtil.java
|
UTF-8
| 891 | 1.78125 | 2 |
[] |
no_license
|
package com.fh.shop.api.util;
public class KeyUtil {
public static String buildCodeKey(String data){
return "code:"+data;
}
public static String MENU_TYPE_LIST(String data){
return "MENU_TYPE_LIST:"+data;
}
public static String USER_URL(String data){
return "USER_URL:"+data;
}
public static String MENU_LIST(String data){
return "MENU_LIST:"+data;
}
public static String LOGIN_USER_(String data){
return "LOGIN_USER_:"+data;
}
public static String buildPhoneKey(String data){
return "SMS:"+data;
}
public static String buidVipKey(String name,String uuid){
return "vip:"+name+":"+uuid;
}
public static String buildVipCart(Long id){
return "vipCart:"+id+":";
}
public static String buildPayLogKey(Long data){
return "vipPayLog:"+data;
}
}
| true |
9d1d0858a79d7ffddd9f6a3d06fa84a1f8b346d0
|
Java
|
MuhammadMansuri/Sketchware-Pro
|
/app/src/main/java/mod/hilal/saif/lib/PCP.java
|
UTF-8
| 917 | 2.09375 | 2 |
[] |
no_license
|
package mod.hilal.saif.lib;
import android.app.AlertDialog;
import android.widget.EditText;
import a.a.a.Zx;
import mod.hilal.saif.activities.tools.BlocksManager;
public class PCP implements Zx.b {
public final BlocksManager a;
public final AlertDialog d;
public final EditText e;
public boolean ii = false;
public PCP(BlocksManager blocksManager, EditText editText, AlertDialog alertDialog) {
this.a = blocksManager;
this.e = editText;
this.d = alertDialog;
}
public PCP(EditText editText) {
this.e = editText;
this.ii = true;
this.d = null;
this.a = null;
}
public void a(int i) {
if (this.ii) {
this.e.setText(String.format("#%08X", Integer.valueOf(i & -1)));
return;
}
this.d.show();
this.e.setText(String.format("#%08X", Integer.valueOf(i & -1)));
}
}
| true |
baa72b13e81550f8fece95a3250b8b377a54f035
|
Java
|
blckopps/RTR_Assignments
|
/OpenGL/Android/17_Sphere_PV_PF/src/main/java/com/example/sphereadspvpf/GLESView.java
|
UTF-8
| 34,496 | 1.75 | 2 |
[] |
no_license
|
package com.example.sphereadspvpf;
import android.opengl.GLSurfaceView;
import android.opengl.GLES31;
import javax.microedition.khronos.opengles.GL10;
import javax.microedition.khronos.egl.EGLConfig;
//texture
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
import android.opengl.GLUtils; //Teximage2D
//for opengl buffers
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
//matrix maths
import android.opengl.Matrix;
import android.content.Context;
import android.view.Gravity;
import android.graphics.Color;
import android.view.MotionEvent;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.GestureDetector.OnDoubleTapListener;
public class GLESView extends GLSurfaceView implements GLSurfaceView.Renderer ,OnDoubleTapListener,OnGestureListener
{
private GestureDetector gestureDetector;
private final Context context;
//variables
private int vertexShaderObject_PV;
private int fragmentShaderObject_PV;
private int vertexShaderObject_PF;
private int fragmentShaderObject_PF;
private int shaderProgramObject_PV;
private int shaderProgramObject_PF;
private int[] vao_sphere = new int[1];
private int[] vbo_sphere_position = new int[1];
private int[] vbo_sphere_normal = new int[1];
private int[] vbo_sphere_element = new int[1];
int numVertices,numElements;
//Uniforms for PV
private int mUniform;
private int vUniform;
private int projectionUniform;
////
private int sampler_Uniform;
//For PV
private int laUniform_PV;
private int ldUniform_PV;
private int lsUniform_PV;
private int kaUniform_PV;
private int kdUniform_PV;
private int ksUniform_PV;
private int shininessUniform_PV;
private int lightPositionUniform_PV;
private int isLKeyIsPressed_PV;
//For PF
private int laUniform_PF;
private int ldUniform_PF;
private int lsUniform_PF;
private int kaUniform_PF;
private int kdUniform_PF;
private int ksUniform_PF;
private int shininessUniform_PF;
private int lightPositionUniform_PF;
private int isLKeyIsPressed_PF;
private float[] perspectiveProjectionMatrix = new float[16]; //4*4 matrix
//Light arrays
private float lightAmbient[] = new float[ ]{ 0.0f, 0.0f, 0.0f, 0.0f};
private float lightDifuse[] = new float[ ] { 1.0f, 1.0f, 1.0f, 1.0f };
private float lightSpecular[] = new float[ ] {1.0f, 1.0f, 1.0f, 1.0f };
//material array
private float materialAmbient[] = new float[ ]{0.0f, 0.0f, 0.0f, 0.0f};
private float materialDifuse[] = new float[ ]{1.0f, 1.0f, 1.0f, 1.0f };
private float materialSpecular[] = new float[ ]{1.0f, 1.0f, 1.0f, 1.0f};
private float lightPosition[] = new float[ ]{100.0f, 100.0f, 100.0f, 1.0f};
private float materialShininess = 50.0f;
//
Boolean bFullScreen = false;
Boolean bIsLighting = false;
Boolean bPerVertex = true;
Boolean bPerFragment = false;
//
final float[] cube_vertices = new float[12];
public GLESView(Context drawingContext)
{
super(drawingContext);
context = drawingContext;
//
gestureDetector = new GestureDetector(drawingContext, this, null, false);
//drawingContext:it's like global enviroment
//this:who is going to handle gesture
//null:other is not going to handle
//false:internally used by android
gestureDetector.setOnDoubleTapListener(this);
setEGLContextClientVersion(3);
setRenderer(this);
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
//methods OnDoubleTapListner
@Override
public boolean onTouchEvent(MotionEvent event)
{
int eventaction = event.getAction(); //not needed
if(!gestureDetector.onTouchEvent(event))
super.onTouchEvent(event);
return(true);
}
@Override
public boolean onDoubleTap(MotionEvent event) //Enable Lighting
{
if(bIsLighting)
{
bIsLighting = false;
}
else
{
bIsLighting = true;
}
System.out.println("RTR: Double tap");
return(true);
}
@Override
public boolean onDoubleTapEvent(MotionEvent event)
{
return(true);
}
@Override
public boolean onSingleTapConfirmed(MotionEvent event)
{
if(!bPerVertex)
{
bPerVertex = true;
bPerFragment = false;
}
return(true);
}
//On GestureListner
@Override
public boolean onDown(MotionEvent event)
{
return(true);
}
//
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
{
return(true);
}
@Override
public void onLongPress(MotionEvent e)
{
if(!bPerFragment)
{
bPerFragment = true;
bPerVertex = false;
}
System.out.println("RTR: On long press");
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float disX, float disY)
{
Uninitialize();
System.exit(0);
return(true);
}
@Override
public void onShowPress(MotionEvent e)
{
}
@Override
public boolean onSingleTapUp(MotionEvent e)
{
return(true);
}
//implements GLSurfaceView.Renderer
@Override
public void onSurfaceCreated(GL10 gl,EGLConfig config)
{
String version = gl.glGetString(GL10.GL_VERSION);
String shadingVersion = gl.glGetString(GLES31.GL_SHADING_LANGUAGE_VERSION);
System.out.println("RTR Opengl version: " + version);
System.out.println("RTR: Shading language version " + shadingVersion);
initialize();
System.out.println("RTR: After Initialize()");
}
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) //resize
{
System.out.println("RTR: onSurfaceChanged()");
resize(width, height);
}
@Override
public void onDrawFrame(GL10 unused) //Display
{
display();
System.out.println("RTR: onDrawFrame()");
}
//our custom methods
private void initialize()
{
System.out.println("RTR: In start Initialize()");
///////////////*****For Per Fragment*********//////////////////////
vertexShaderObject_PF = GLES31.glCreateShader(GLES31.GL_VERTEX_SHADER);
final String vertexShaderSourceCode_PF = String.format
(
"#version 310 es" +
"\n" +
"in vec4 vPosition;" +
"in vec3 vNormal;" +
"uniform mat4 u_model_matrix;" +
"uniform mat4 u_view_matrix;" +
"uniform mat4 u_projection_matrix;" +
"uniform float islkeypressed_PF;" +
"uniform vec4 u_light_position_PF;" +
"out vec3 tnorm_PF;" +
"out vec3 light_direction_PF;" +
"out vec3 viewer_vector_PF;" +
"void main(void)" +
"{" +
"if(islkeypressed_PF == 1.0)" +
"{" +
"vec4 eye_coordinates = u_view_matrix * u_model_matrix * vPosition;" +
"tnorm_PF = mat3(u_view_matrix * u_model_matrix) * vNormal;" +
"light_direction_PF = vec3(u_light_position_PF - eye_coordinates);" +
"viewer_vector_PF = vec3(-eye_coordinates.xyz);" +
"}" +
"gl_Position = u_projection_matrix * u_view_matrix * u_model_matrix * vPosition;" +
" } "
);
GLES31.glShaderSource(vertexShaderObject_PF, vertexShaderSourceCode_PF);
GLES31.glCompileShader(vertexShaderObject_PF);
//Vertex shader error checking
int[] iShaderCompileStatus = new int[1];
int[] iInfoLogLength = new int[1];
String szInfoLog = null;
GLES31.glGetShaderiv(vertexShaderObject_PF,
GLES31.GL_COMPILE_STATUS,
iShaderCompileStatus,
0);
if(iShaderCompileStatus[0] == GLES31.GL_FALSE)
{
GLES31.glGetShaderiv(vertexShaderObject_PF,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0 );
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetShaderInfoLog(vertexShaderObject_PF);
System.out.println("RTR: vertex shader PF ERROR: " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
System.out.println("RTR: After Vertex Shader PF..");
///////////////////////////////////////****Fragment Shader *******////////////////////////////////
fragmentShaderObject_PF = GLES31.glCreateShader(GLES31.GL_FRAGMENT_SHADER);
final String fragmentShaderSourceCode_PF = String.format
(
"#version 310 es" +
"\n" +
"precision highp float;" +
"out vec4 fragColor;" +
"uniform float islkeypressed_PF;" +
"uniform vec3 u_la_PF;" +
"uniform vec3 u_ld_PF;" +
"uniform vec3 u_ls_PF;" +
"uniform vec3 u_ka_PF;" +
"uniform vec3 u_kd_PF;" +
"uniform vec3 u_ks_PF;" +
"in vec3 tnorm_PF;" +
"in vec3 light_direction_PF;" +
"in vec3 viewer_vector_PF;" +
"uniform float u_shininess_PF;" +
"void main(void)" +
"{" +
"if(islkeypressed_PF == 1.0)" +
"{" +
"vec3 tnorm_normalized = normalize(tnorm_PF);" +
"vec3 light_direction_normalized = normalize(light_direction_PF);" +
"vec3 viewer_vector_normalized = normalize(viewer_vector_PF);" +
"float tn_dot_ldirection = max(dot(light_direction_normalized, tnorm_normalized), 0.0);" +
"vec3 reflection_vector = reflect(-light_direction_normalized, tnorm_normalized);" +
"vec3 ambient = u_la_PF * u_ka_PF;" +
"vec3 difuse = u_ld_PF * u_kd_PF * tn_dot_ldirection;" +
"vec3 specular = u_ls_PF * u_ks_PF * pow(max(dot(reflection_vector,viewer_vector_normalized),0.0),u_shininess_PF);" +
"vec3 phong_light_pf = ambient + difuse + specular;" +
"fragColor = vec4(phong_light_pf, 1.0);" +
"}" +
"else" +
"{" +
"fragColor = vec4(1.0, 1.0 , 1.0 , 1.0);" +
"}" +
"}"
);
GLES31.glShaderSource(fragmentShaderObject_PF, fragmentShaderSourceCode_PF);
GLES31.glCompileShader(fragmentShaderObject_PF);
//Error checking for fragment shader
iShaderCompileStatus[0] = 0;
iInfoLogLength[0] = 0;
szInfoLog = null;
GLES31.glGetShaderiv(fragmentShaderObject_PF,
GLES31.GL_COMPILE_STATUS,
iShaderCompileStatus,
0);
if(iShaderCompileStatus[0] == GLES31.GL_FALSE)
{
GLES31.glGetShaderiv(fragmentShaderObject_PF,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0);
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetShaderInfoLog(fragmentShaderObject_PF);
System.out.println("RTR: fragment shader PF ERROR: " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
System.out.println("RTR: After Fragment Shader..");
//Create ShaderProgramObject and attach above shaders
shaderProgramObject_PF = GLES31.glCreateProgram();
GLES31.glAttachShader(shaderProgramObject_PF, vertexShaderObject_PF);
GLES31.glAttachShader(shaderProgramObject_PF, fragmentShaderObject_PF);
//*** PRELINKING BINDING TO VERTEX ATTRIBUTES***
GLES31.glBindAttribLocation(shaderProgramObject_PF,
GLESMacros.AMC_ATTRIBUTE_POSITION,
"vPosition");
GLES31.glBindAttribLocation(shaderProgramObject_PF,
GLESMacros.AMC_ATTRIBUTE_NORMAL,
"vNormal");
System.out.println("RTR: shader pre link program successfull for PF : " );
//Link above program
GLES31.glLinkProgram(shaderProgramObject_PF);
//ERROR checking for Linking
int[] iShaderLinkStatus = new int[1];
iInfoLogLength[0] = 0;
szInfoLog = null;
System.out.println( "RTR: iShaderLinkStatus for PF before " + iShaderLinkStatus[0]);
GLES31.glGetProgramiv(shaderProgramObject_PF,
GLES31.GL_LINK_STATUS,
iShaderLinkStatus,
0);
if(iShaderLinkStatus[0] == GLES31.GL_FALSE)
{
System.out.println( "RTR: iShaderLinkStatus for PF after " + iShaderLinkStatus[0]);
GLES31.glGetProgramiv(shaderProgramObject_PF,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0 );
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetProgramInfoLog(shaderProgramObject_PF);
System.out.println( "RTR: iInfoLogLength " + iInfoLogLength[0]);
System.out.println("RTR: shader program PF ERROR : " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
///***POST LINKING GETTING UNIFORMS**
isLKeyIsPressed_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF,
"islkeypressed_PF");
laUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_la_PF");
ldUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_ld_PF");
lsUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_ls_PF");
kaUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_ka_PF");
kdUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_kd_PF");
ksUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_ks_PF");
shininessUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF, "u_shininess_PF");
lightPositionUniform_PF = GLES31.glGetUniformLocation(shaderProgramObject_PF,
"u_light_position_PF");
System.out.println("RTR: After Post Linking per fragment");
////////////////////****For per Vertex***********////////////////////////////////////////////////////////
//// ////////////////////////// //*********Vertex shader *********//////
vertexShaderObject_PV = GLES31.glCreateShader(GLES31.GL_VERTEX_SHADER);
final String vertexShaderSourceCode = String.format
(
"#version 310 es" +
"\n" +
"in vec4 vPosition;" +
"in vec3 vNormal;" +
"uniform mat4 u_model_matrix;" +
"uniform mat4 u_view_matrix;" +
"uniform mat4 u_projection_matrix;" +
"uniform float islkeypressed_PV;" +
"uniform vec3 u_la_PV;" +
"uniform vec3 u_ld_PV;" +
"uniform vec3 u_ls_PV;" +
"uniform vec3 u_ka_PV;" +
"uniform vec3 u_kd_PV;" +
"uniform vec3 u_ks_PV;" +
"uniform float u_shininess_PV;" +
"uniform vec4 u_light_position_PV;" +
"out vec3 phong_ads_light_PV;" +
"void main(void)" +
"{" +
"if(islkeypressed_PV == 1.0)" +
"{" +
"vec4 eye_coordinates = u_view_matrix * u_model_matrix * vPosition;" +
"vec3 tnorm = normalize(mat3(u_view_matrix * u_model_matrix) * vNormal);" +
"vec3 light_direction = normalize(vec3(u_light_position_PV - eye_coordinates));" +
"float tn_dot_ldirection = max(dot(light_direction, tnorm), 0.0);" +
"vec3 reflection_vector = reflect(-light_direction, tnorm);" +
"vec3 viewer_vector = normalize(vec3(-eye_coordinates));" +
"vec3 ambient = u_la_PV * u_ka_PV;" +
"vec3 difuse = u_ld_PV * u_kd_PV * tn_dot_ldirection;" +
"vec3 specular = u_ls_PV * u_ks_PV * pow(max(dot(reflection_vector,viewer_vector),0.0),u_shininess_PV);" +
"phong_ads_light_PV = ambient + difuse + specular;" +
"}" +
"else" +
"{" +
"phong_ads_light_PV = vec3(1.0, 1.0, 1.0);" +
"}" +
"gl_Position = u_projection_matrix * u_view_matrix * u_model_matrix * vPosition;" +
" } "
);
GLES31.glShaderSource(vertexShaderObject_PV, vertexShaderSourceCode);
GLES31.glCompileShader(vertexShaderObject_PV);
//Vertex shader error checking
iShaderCompileStatus[0] = 0;
iInfoLogLength[0] = 0;
szInfoLog = null;
GLES31.glGetShaderiv(vertexShaderObject_PV,
GLES31.GL_COMPILE_STATUS,
iShaderCompileStatus,
0);
if(iShaderCompileStatus[0] == GLES31.GL_FALSE)
{
GLES31.glGetShaderiv(vertexShaderObject_PV,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0 );
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetShaderInfoLog(vertexShaderObject_PV);
System.out.println("RTR: vertex shader ERROR: " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
System.out.println("RTR: After Vertex Shader..");
///////////////////////////////////////****Fragment Shader *******////////////////////////////////
fragmentShaderObject_PV = GLES31.glCreateShader(GLES31.GL_FRAGMENT_SHADER);
final String fragmentShaderSourceCode = String.format
(
"#version 310 es" +
"\n" +
"precision highp float;" +
"out vec4 fragColor;" +
"uniform float islkeypressed_PV;" +
"in vec3 phong_ads_light_PV;" +
"void main(void)" +
"{" +
"if(islkeypressed_PV == 1.0)" +
"{" +
"fragColor = vec4(phong_ads_light_PV, 1.0);" +
"}" +
"else" +
"{" +
"fragColor = vec4(phong_ads_light_PV, 1.0);" +
"}" +
"}"
);
GLES31.glShaderSource(fragmentShaderObject_PV, fragmentShaderSourceCode);
GLES31.glCompileShader(fragmentShaderObject_PV);
//Error checking for fragment shader
iShaderCompileStatus[0] = 0;
iInfoLogLength[0] = 0;
szInfoLog = null;
GLES31.glGetShaderiv(fragmentShaderObject_PV,
GLES31.GL_COMPILE_STATUS,
iShaderCompileStatus,
0);
if(iShaderCompileStatus[0] == GLES31.GL_FALSE)
{
GLES31.glGetShaderiv(fragmentShaderObject_PV,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0);
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetShaderInfoLog(fragmentShaderObject_PV);
System.out.println("RTR: fragment shader ERROR: " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
System.out.println("RTR: After Fragment Shader..");
//Create ShaderProgramObject and attach above shaders
shaderProgramObject_PV = GLES31.glCreateProgram();
GLES31.glAttachShader(shaderProgramObject_PV, vertexShaderObject_PV);
GLES31.glAttachShader(shaderProgramObject_PV, fragmentShaderObject_PV);
//*** PRELINKING BINDING TO VERTEX ATTRIBUTES***
GLES31.glBindAttribLocation(shaderProgramObject_PV,
GLESMacros.AMC_ATTRIBUTE_POSITION,
"vPosition");
GLES31.glBindAttribLocation(shaderProgramObject_PV,
GLESMacros.AMC_ATTRIBUTE_NORMAL,
"vNormal");
System.out.println("RTR: shader pre link program successfull : " );
//Link above program
GLES31.glLinkProgram(shaderProgramObject_PV);
//ERROR checking for Linking
iShaderLinkStatus[0] = 0;
iInfoLogLength[0] = 0;
szInfoLog = null;
System.out.println( "RTR: iShaderLinkStatus before " + iShaderLinkStatus[0]);
GLES31.glGetProgramiv(shaderProgramObject_PV,
GLES31.GL_LINK_STATUS,
iShaderLinkStatus,
0);
if(iShaderLinkStatus[0] == GLES31.GL_FALSE)
{
System.out.println( "RTR: iShaderLinkStatus after " + iShaderLinkStatus[0]);
GLES31.glGetProgramiv(shaderProgramObject_PV,
GLES31.GL_INFO_LOG_LENGTH,
iInfoLogLength,
0 );
if(iInfoLogLength[0] > 0)
{
szInfoLog = GLES31.glGetProgramInfoLog(shaderProgramObject_PV);
System.out.println( "RTR: iInfoLogLength " + iInfoLogLength[0]);
System.out.println("RTR: shader program ERROR : " + szInfoLog);
//uninitialize();
System.exit(0);
}
}
///***POST LINKING GETTING UNIFORMS**
mUniform= GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_model_matrix");
vUniform = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_view_matrix");
projectionUniform = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_projection_matrix");
isLKeyIsPressed_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV,
"islkeypressed_PV");
laUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_la_PV");
ldUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_ld_PV");
lsUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_ls_PV");
kaUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_ka_PV");
kdUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_kd_PV");
ksUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_ks_PV");
shininessUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV, "u_shininess_PV");
lightPositionUniform_PV = GLES31.glGetUniformLocation(shaderProgramObject_PV,
"u_light_position_PV");
System.out.println("RTR: After Post Linking");
//Sphere call
Sphere sphere=new Sphere();
float sphere_vertices[]=new float[1146];
float sphere_normals[]=new float[1146];
float sphere_textures[]=new float[764];
short sphere_elements[]=new short[2280];
sphere.getSphereVertexData(sphere_vertices, sphere_normals, sphere_textures, sphere_elements);
numVertices = sphere.getNumberOfSphereVertices();
numElements = sphere.getNumberOfSphereElements();
////
// vao
GLES31.glGenVertexArrays(1,vao_sphere,0);
GLES31.glBindVertexArray(vao_sphere[0]);
// position vbo
GLES31.glGenBuffers(1,vbo_sphere_position,0);
GLES31.glBindBuffer(GLES31.GL_ARRAY_BUFFER,vbo_sphere_position[0]);
ByteBuffer byteBuffer=ByteBuffer.allocateDirect(sphere_vertices.length * 4);
byteBuffer.order(ByteOrder.nativeOrder());
FloatBuffer verticesBuffer=byteBuffer.asFloatBuffer();
verticesBuffer.put(sphere_vertices);
verticesBuffer.position(0);
GLES31.glBufferData(GLES31.GL_ARRAY_BUFFER,
sphere_vertices.length * 4,
verticesBuffer,
GLES31.GL_STATIC_DRAW);
GLES31.glVertexAttribPointer(GLESMacros.AMC_ATTRIBUTE_POSITION,
3,
GLES31.GL_FLOAT,
false,0,0);
GLES31.glEnableVertexAttribArray(GLESMacros.AMC_ATTRIBUTE_POSITION);
GLES31.glBindBuffer(GLES31.GL_ARRAY_BUFFER,0);
// normal vbo
GLES31.glGenBuffers(1,vbo_sphere_normal,0);
GLES31.glBindBuffer(GLES31.GL_ARRAY_BUFFER,vbo_sphere_normal[0]);
byteBuffer=ByteBuffer.allocateDirect(sphere_normals.length * 4);
byteBuffer.order(ByteOrder.nativeOrder());
verticesBuffer=byteBuffer.asFloatBuffer();
verticesBuffer.put(sphere_normals);
verticesBuffer.position(0);
GLES31.glBufferData(GLES31.GL_ARRAY_BUFFER,
sphere_normals.length * 4,
verticesBuffer,
GLES31.GL_STATIC_DRAW);
GLES31.glVertexAttribPointer(GLESMacros.AMC_ATTRIBUTE_NORMAL,
3,
GLES31.GL_FLOAT,
false,0,0);
GLES31.glEnableVertexAttribArray(GLESMacros.AMC_ATTRIBUTE_NORMAL);
GLES31.glBindBuffer(GLES31.GL_ARRAY_BUFFER,0);
// element vbo
GLES31.glGenBuffers(1,vbo_sphere_element,0);
GLES31.glBindBuffer(GLES31.GL_ELEMENT_ARRAY_BUFFER,vbo_sphere_element[0]);
byteBuffer=ByteBuffer.allocateDirect(sphere_elements.length * 2);
byteBuffer.order(ByteOrder.nativeOrder());
ShortBuffer elementsBuffer=byteBuffer.asShortBuffer();
elementsBuffer.put(sphere_elements);
elementsBuffer.position(0);
GLES31.glBufferData(GLES31.GL_ELEMENT_ARRAY_BUFFER,
sphere_elements.length * 2,
elementsBuffer,
GLES31.GL_STATIC_DRAW);
GLES31.glBindBuffer(GLES31.GL_ELEMENT_ARRAY_BUFFER,0);
GLES31.glBindVertexArray(0);
System.out.println("RTR: After vbo_sphere_normal");
/////////////////
GLES31.glEnable(GLES31.GL_DEPTH_TEST);
GLES31.glDepthFunc(GLES31.GL_LEQUAL);
GLES31.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
Matrix.setIdentityM(perspectiveProjectionMatrix, 0);
System.out.println("RTR: End Initialize()");
}
private void resize(int width, int height)
{
if(height == 0)
{
height = 1;
}
GLES31.glViewport(0, 0, width, height);
Matrix.perspectiveM(perspectiveProjectionMatrix, 0 ,45.0f,(float) width/(float)height, 0.1f, 100.0f);
System.out.println("RTR: In resize()");
}
private void display()
{
System.out.println("RTR: Start of display()");
float[] modelMatrix = new float[16];
float[] viewMatrix = new float[16];
float[] translateMatrix = new float[16];
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT | GLES31.GL_DEPTH_BUFFER_BIT);
//set to identity matrix
Matrix.setIdentityM(modelMatrix, 0);
Matrix.setIdentityM(viewMatrix, 0);
Matrix.setIdentityM(translateMatrix, 0);
Matrix.translateM(modelMatrix, 0 ,translateMatrix, 0, 0.0f, 0.0f, -2.0f);
if(bPerVertex)
{
GLES31.glUseProgram(shaderProgramObject_PV);
//light uniform
if (bIsLighting == true)
{
GLES31.glUniform1f(isLKeyIsPressed_PV, 1.0f);
GLES31.glUniform1f(shininessUniform_PV, materialShininess);
GLES31.glUniform3fv(laUniform_PV, 1, lightAmbient, 0);
GLES31.glUniform3fv(ldUniform_PV, 1, lightDifuse, 0);
GLES31.glUniform3fv(lsUniform_PV, 1, lightSpecular, 0);
GLES31.glUniform3fv(kaUniform_PV, 1, materialAmbient, 0);
GLES31.glUniform3fv(kdUniform_PV, 1, materialDifuse, 0);
GLES31.glUniform3fv(ksUniform_PV, 1, materialSpecular, 0);
GLES31.glUniform4fv(lightPositionUniform_PV, 1, lightPosition, 0);
}
else
{
GLES31.glUniform1f(isLKeyIsPressed_PV, 0.0f);
}
}
else
{
GLES31.glUseProgram(shaderProgramObject_PF);
if (bIsLighting == true)
{
GLES31.glUniform1f(isLKeyIsPressed_PF, 1.0f);
GLES31.glUniform1f(shininessUniform_PF, materialShininess);
GLES31.glUniform3fv(laUniform_PF, 1, lightAmbient, 0);
GLES31.glUniform3fv(ldUniform_PF, 1, lightDifuse, 0);
GLES31.glUniform3fv(lsUniform_PF, 1, lightSpecular, 0);
GLES31.glUniform3fv(kaUniform_PF, 1, materialAmbient, 0);
GLES31.glUniform3fv(kdUniform_PF, 1, materialDifuse, 0);
GLES31.glUniform3fv(ksUniform_PF, 1, materialSpecular, 0);
GLES31.glUniform4fv(lightPositionUniform_PF, 1, lightPosition, 0);
}
else
{
GLES31.glUniform1f(isLKeyIsPressed_PF, 0.0f);
}
}
GLES31.glUniformMatrix4fv(mUniform,
1,
false,
modelMatrix,
0 );
GLES31.glUniformMatrix4fv(vUniform,
1,
false,
viewMatrix,
0 );
GLES31.glUniformMatrix4fv(projectionUniform,
1,
false,
perspectiveProjectionMatrix,
0 );
// bind vao
GLES31.glBindVertexArray(vao_sphere[0]);
// *** draw, either by glDrawTriangles() or glDrawArrays() or glDrawElements()
GLES31.glBindBuffer(GLES31.GL_ELEMENT_ARRAY_BUFFER, vbo_sphere_element[0]);
GLES31.glDrawElements(GLES31.GL_TRIANGLES, numElements, GLES31.GL_UNSIGNED_SHORT, 0);
// unbind vao
GLES31.glBindVertexArray(0);
requestRender();
System.out.println("RTR: End of display()");
}
private void Uninitialize()
{
if (vbo_sphere_normal[0] != 0)
{
GLES31.glDeleteBuffers(1, vbo_sphere_normal , 0);
}
if (vbo_sphere_position[0] != 0)
{
GLES31.glDeleteBuffers(1, vbo_sphere_position , 0);
}
if (vbo_sphere_element[0] != 0)
{
GLES31.glDeleteBuffers(1, vbo_sphere_element , 0);
}
if (vao_sphere[0] != 0)
{
GLES31.glDeleteVertexArrays(1, vao_sphere, 0);
}
//per vertex
GLES31.glUseProgram(shaderProgramObject_PV);
GLES31.glDetachShader(shaderProgramObject_PV, GLES31.GL_FRAGMENT_SHADER );
GLES31.glDeleteShader(fragmentShaderObject_PV);
GLES31.glDetachShader(shaderProgramObject_PV, GLES31.GL_VERTEX_SHADER );
GLES31.glDeleteShader(vertexShaderObject_PV);
GLES31.glDeleteProgram(shaderProgramObject_PV);
GLES31.glUseProgram(0);
//per fragment
GLES31.glUseProgram(shaderProgramObject_PF);
GLES31.glDetachShader(shaderProgramObject_PF, GLES31.GL_FRAGMENT_SHADER );
GLES31.glDeleteShader(fragmentShaderObject_PF);
GLES31.glDetachShader(shaderProgramObject_PF, GLES31.GL_VERTEX_SHADER );
GLES31.glDeleteShader(vertexShaderObject_PF);
GLES31.glDeleteProgram(shaderProgramObject_PF);
GLES31.glUseProgram(0);
System.out.println("Uninitialize successfull");
}
}
| true |
803234dd6a1b90b85dd5930d061d658a130bf0a7
|
Java
|
lu-xiansheng/lzframe
|
/src/main/java/com/lzblog/module/help/ConfigConstant.java
|
UTF-8
| 498 | 1.804688 | 2 |
[] |
no_license
|
package com.lzblog.module.help;
/**
* 用来提供相关配置文件常量接口
* Created by lz on 2016/11/14.
*/
public interface ConfigConstant {
String CONFIG_FILE = "lzframe.properties";
String JDBC_DRIVER = "jdbc.driver";
String JDBA_URL = "jdbc.url";
String JDBC_USERNAME = "jdbc.username";
String JDBC_PASSWORD = "jdbc.password";
String APP_BASE_PATH = "app.base_path";
String APP_JSP_PATH = "app.jsp_path";
String APP_STATIC_PATH = "app.static_path";
}
| true |
944a6d7287f49106ae70e2eee0e6fc6fb3653b2a
|
Java
|
miarevalo10/ReporteReddit
|
/reddit-decompilada/kotlin/reflect/jvm/internal/impl/load/java/typeEnhancement/C2955xd5dbd441.java
|
UTF-8
| 1,752 | 1.625 | 2 |
[] |
no_license
|
package kotlin.reflect.jvm.internal.impl.load.java.typeEnhancement;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Lambda;
import kotlin.reflect.jvm.internal.impl.load.java.typeEnhancement.SignatureEnhancementBuilder.ClassEnhancementBuilder.FunctionEnhancementBuilder;
import kotlin.reflect.jvm.internal.impl.load.kotlin.SignatureBuildingComponents;
/* compiled from: predefinedEnhancementInfo.kt */
final class C2955xd5dbd441 extends Lambda implements Function1<FunctionEnhancementBuilder, Unit> {
final /* synthetic */ SignatureBuildingComponents f38569a;
final /* synthetic */ String f38570b;
final /* synthetic */ String f38571c;
final /* synthetic */ String f38572d;
final /* synthetic */ String f38573e;
final /* synthetic */ String f38574f;
final /* synthetic */ String f38575g;
final /* synthetic */ String f38576h;
final /* synthetic */ String f38577i;
final /* synthetic */ String f38578j;
C2955xd5dbd441(SignatureBuildingComponents signatureBuildingComponents, String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9) {
this.f38569a = signatureBuildingComponents;
this.f38570b = str;
this.f38571c = str2;
this.f38572d = str3;
this.f38573e = str4;
this.f38574f = str5;
this.f38575g = str6;
this.f38576h = str7;
this.f38577i = str8;
this.f38578j = str9;
super(1);
}
public final /* synthetic */ Object mo6492a(Object obj) {
((FunctionEnhancementBuilder) obj).m27264a(this.f38570b, PredefinedEnhancementInfoKt.f25753b, PredefinedEnhancementInfoKt.f25753b);
return Unit.f25273a;
}
}
| true |
348925fc898826781545cfeba5e1afbf347a73b9
|
Java
|
CuriC4T/ConferenceManagement_with_AI
|
/Graduation_Project_final/src/mainFrame_02/MainFrame.java
|
UHC
| 10,013 | 2.15625 | 2 |
[] |
no_license
|
package mainFrame_02;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.Socket;
import javax.crypto.Cipher;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import cryption.CipherFunc;
//3e454c 2185c5 7ecefd fff6e5 ff7f66
public class MainFrame extends JFrame {
private Image screenImage;
private Graphics screenGraphics;
private String ID;
private Dimension MONITER_SIZE;
static ImageIcon AIimage;
static ImageIcon AI_Thinking;
static ImageIcon AIimage2;
private ImageIcon micOnimage;
private ImageIcon micOffimage;
private JLabel AILabel;
private JPopupMenu popupMenu;
private MainFrame frame;
private JPanel orderPart;
private JLabel whatAIsay;
private JLabel whatIsay;
private JTextField orderField;
private TTS tts ;
private STT stt;
private AI ai;
JPanel AIPanel = new JPanel();
JPanel STTPanel = new JPanel();
JPanel inputPanel = new JPanel();
JButton STTStartButton = new JButton();
JButton STTEndButton = new JButton();
int mouseX, mouseY;
private int imageWidth, imageHeight;
String AIspeck="";
Socket socket;
BufferedReader reader;
PrintWriter writer;
CipherFunc cipher;
public MainFrame(String ID) {
this.ID=ID;
frame = this;
try {
cipher = new CipherFunc();
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
MONITER_SIZE = new Dimension(Toolkit.getDefaultToolkit().getScreenSize());
AIimage = new ImageIcon(Main.class.getResource("../Images/AI.gif"));
AI_Thinking = new ImageIcon(Main.class.getResource("../Images/AIThinking.gif"));
AIimage2= new ImageIcon(Main.class.getResource("../Images/AI2.gif"));
micOnimage = new ImageIcon(Main.class.getResource("../Images/micon.png"));
micOffimage = new ImageIcon(Main.class.getResource("../Images/micoff.png"));
AILabel = new JLabel(AIimage);
orderPart = new JPanel();
whatIsay = new JLabel();
whatAIsay = new JLabel();
orderField = new JTextField(10);
AIPanel = new JPanel();
STTPanel = new JPanel();
inputPanel = new JPanel();
STTStartButton = new JButton(micOnimage);
STTEndButton = new JButton(micOffimage);
imageWidth = AIimage.getIconWidth();
imageHeight = AIimage.getIconHeight();
mouseX = imageWidth / 2;
mouseY = imageHeight / 2;
setUndecorated(true);
setSize(imageWidth, imageHeight + 200);
setLocation((this.MONITER_SIZE.width - getWidth()) / 2, (this.MONITER_SIZE.height - getHeight()) / 2);
setLayout(new BorderLayout());
setResizable(false);
this.setBackground(Color.BLACK);
setAlwaysOnTop(true);
// setOpacity(0.9F);
init();
settingEvent();
popupMenu();
connect();
setVisible(true);
pack();
tts.speak(AIspeck);
}
public void init() {
JPanel temp = new JPanel();
tts= new TTS();
ai = new AI(this, whatAIsay,tts);
stt = new STT(whatIsay, ai);
STTStartButton.setPreferredSize(new Dimension(40,40));
STTStartButton.setBorderPainted(false);
STTStartButton.setContentAreaFilled(false);
STTStartButton.setFocusPainted(false);
STTStartButton.setEnabled(false);
STTEndButton.setPreferredSize(new Dimension(40,40));
STTEndButton.setEnabled(true);
STTEndButton.setBorderPainted(false);
STTEndButton.setContentAreaFilled(false);
STTEndButton.setFocusPainted(false);
AILabel.setSize(AIimage.getIconWidth(), AIimage.getIconHeight());
AILabel.setOpaque(false);
AILabel.setBackground(new Color(54,54,54));
temp.setBackground(new Color(54,54,54));
temp.setPreferredSize(new Dimension(50, 60));
STTPanel.setLayout(new FlowLayout());
STTPanel.setBackground(new Color(54,54,54));
AIPanel.setSize(AIimage.getIconWidth(), AIimage.getIconHeight());
AIPanel.setBackground(new Color(54,54,54));
inputPanel.setLayout(new BorderLayout());
inputPanel.setSize(30, 40);
inputPanel.setBackground(new Color(54,54,54));
orderPart.setLayout(new BorderLayout(10, 30));
orderPart.setSize(30, 200);
orderPart.setBackground(new Color(54,54,54));
whatAIsay.setFont(new Font("", Font.PLAIN, (int) 50));
whatAIsay.setHorizontalAlignment(JLabel.CENTER);
AIspeck=" ȳϼ. "+ID+" ";
whatAIsay.setText(AIspeck);
whatAIsay.setBackground(new Color(54,54,54));
whatAIsay.setForeground(new Color(0xfff6e5));
whatIsay.setHorizontalAlignment(JLabel.CENTER);
whatIsay.setBackground(new Color(54,54,54));
whatIsay.setFont(new Font("", Font.PLAIN, (int) 20));
whatIsay.setForeground(new Color(0xfff6e5));
whatIsay.setText(" ");
orderField.setHorizontalAlignment(JLabel.CENTER);
orderField.setToolTipText("ɾ Էϼ");
orderField.setFont(new Font("", Font.PLAIN, (int) 30));
AIPanel.add(AILabel);
STTPanel.add(STTStartButton);
STTPanel.add(STTEndButton);
inputPanel.add(orderField, BorderLayout.CENTER);
inputPanel.add(STTPanel, BorderLayout.EAST);
orderPart.add(whatAIsay, BorderLayout.NORTH);
orderPart.add(whatIsay, BorderLayout.CENTER);
orderPart.add(inputPanel, BorderLayout.SOUTH);
add(AIPanel, BorderLayout.NORTH);
add(temp, BorderLayout.CENTER);
add(orderPart, BorderLayout.SOUTH);
stt.startSTT();
}
public void settingEvent() {
AILabel.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
mouseX = e.getX();
mouseY = e.getY();
}
if (e.getButton() == MouseEvent.BUTTON3) {
popupMenu.show(e.getComponent(), mouseX, mouseY);
}
}
public void mouseReleased(MouseEvent e) {
}
});
AILabel.addMouseMotionListener(new MouseAdapter() {
public void mouseDragged(MouseEvent e) {
int X = e.getXOnScreen();
int Y = e.getYOnScreen();
frame.setLocation(X - mouseX, Y - mouseY);
}
});
orderField.addActionListener(new ActionListener() {
String order;
@Override
public void actionPerformed(ActionEvent e) {
order = orderField.getText();
orderField.setText("");
whatIsay.setText(order);
ai.performOrder(order);
}
});
STTStartButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
AILabel.setIcon(AI_Thinking);
STTStartButton.setEnabled(false);
STTEndButton.setEnabled(true);
stt.startSTT();
}
});
STTEndButton.addActionListener(new ActionListener() {
String order;
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
AILabel.setIcon(AIimage);
STTStartButton.setEnabled(true);
STTEndButton.setEnabled(false);
stt.stopSTT();
order = whatIsay.getText();
}
});
}
public void popupMenu() {
popupMenu = new JPopupMenu();
JMenuItem orders = new JMenuItem("");
JMenuItem managerplan = new JMenuItem("");
JMenuItem setting = new JMenuItem("");
JMenuItem help = new JMenuItem("");
JMenuItem exit = new JMenuItem("");
orders.setFont(new Font("HY߰", 0, 15));
managerplan.setFont(new Font("HY߰", 0, 15));
setting.setFont(new Font("HY߰", 0, 15));
help.setFont(new Font("HY߰", 0, 15));
exit.setFont(new Font("HY߰", 0, 15));
orders.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new OrderUI(ai.getDataManagement());
}
});
managerplan.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new PlanManagerFrame(ai.getDataManagement());
}
});
setting.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new SettingUI(frame);
}
});
help.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// new PlanPartner.helpFrame(PlanPartner.this);
System.out.println(ID);
}
});
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
popupMenu.add(managerplan);
popupMenu.add(orders);
popupMenu.add(setting);
popupMenu.add(help);
popupMenu.add(exit);
}
public String getID() {
return ID;
}
public void setID(String iD) {
ID = iD;
}
public JLabel getWhatIsay() {
return whatIsay;
}
public JLabel getWhatAIsay() {
return whatAIsay;
}
void connect() { //
try {
InetAddress inetAddress = InetAddress.getLocalHost();
System.out.println(inetAddress);
socket = new Socket(inetAddress, 7777);
reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
writer = new PrintWriter(socket.getOutputStream(), true);
writer.println(cipher.encrypt("[NAME]"+ID));
} catch (Exception e) {
}
}
public Socket getSocket() {
return socket;
}
public void setSocket(Socket socket) {
this.socket = socket;
}
public BufferedReader getReader() {
return reader;
}
public void setReader(BufferedReader reader) {
this.reader = reader;
}
public PrintWriter getWriter() {
return writer;
}
public void setWriter(PrintWriter writer) {
this.writer = writer;
}
public CipherFunc getCipher() {
return cipher;
}
public void setCipher(CipherFunc cipher) {
this.cipher = cipher;
}
public JLabel getAILabel() {
return AILabel;
}
public void setAILabel(JLabel aILabel) {
AILabel = aILabel;
}
}
| true |
2b53eedc7e80478974e8b27614b1eb3c62181871
|
Java
|
leonzm/lts_work
|
/src/main/java/com/company/model/DmMobile.java
|
UTF-8
| 826 | 2.0625 | 2 |
[] |
no_license
|
package com.company.model;
import com.mongodb.ReflectionDBObject;
public class DmMobile extends ReflectionDBObject {
private String Key;// 号码段,如:1801623
private String Prov;// 省
private String City;// 城市
private String Type;// 中国电信
private Long Ut = System.currentTimeMillis();// 更新时间
public String getKey() {
return Key;
}
public void setKey(String key) {
this.Key = key;
}
public String getProv() {
return Prov;
}
public void setProv(String prov) {
this.Prov = prov;
}
public String getCity() {
return City;
}
public void setCity(String city) {
this.City = city;
}
public String getType() {
return Type;
}
public void setType(String type) {
this.Type = type;
}
public Long getUt() {
return Ut;
}
public void setUt(Long ut) {
Ut = ut;
}
}
| true |
5ca92a0e869477625d29e615a8e340296663a332
|
Java
|
Beloya/SSM
|
/src/main/java/com/MyBlog/entity/archives.java
|
UTF-8
| 4,255 | 2.28125 | 2 |
[] |
no_license
|
package com.MyBlog.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class Archives implements Serializable,Comparable<Archives> {
/**
*
*/
private static final long serialVersionUID = 1L;
private Integer aid ;
/** 标题 */
private String title ;
/** 内容 */
private String context ;
/** 类型 */
private Integer type ;
/** 创建人 */
private String createdBy ;
/** 创建时间 */
private Date createdTime ;
/** 更新人 */
private String updatedBy ;
/** 更新时间 */
private Date updatedTime ;
/** 状态;1审核||0正常||-1失效 */
private Integer status ;
/** 阅读数 */
private Integer readcount ;
/** 标签;外键 */
private Integer flag ;
/** 可见性;外键 */
private Integer vid ;
private List<Flag> flags;
private List<archivesFlag> archivesflags;
private Archivesvisibility archivesvisibility;
private type etype;
/** 主键;自增 */
public Integer getAid(){
return this.aid;
}
/** 主键;自增 */
public void setAid(Integer aid){
this.aid = aid;
}
/** 标题 */
public String getTitle(){
return this.title;
}
/** 标题 */
public void setTitle(String title){
this.title = title;
}
/** 内容 */
public String getContext(){
return this.context;
}
/** 内容 */
public void setContext(String context){
this.context = context;
}
/** 类型 */
public Integer getType(){
return this.type;
}
/** 类型 */
public void setType(int type){
this.type = type;
}
/** 创建人 */
public String getCreatedBy(){
return this.createdBy;
}
/** 创建人 */
public void setCreatedBy(String createdBy){
this.createdBy = createdBy;
}
/** 创建时间 */
public Date getCreatedTime(){
return this.createdTime;
}
/** 创建时间 */
public void setCreatedTime(Date createdTime){
this.createdTime = createdTime;
}
/** 更新人 */
public String getUpdatedBy(){
return this.updatedBy;
}
/** 更新人 */
public void setUpdatedBy(String updatedBy){
this.updatedBy = updatedBy;
}
/** 更新时间 */
public Date getUpdatedTime(){
return this.updatedTime;
}
/** 更新时间 */
public void setUpdatedTime(Date updatedTime){
this.updatedTime = updatedTime;
}
/** 状态;1审核||0正常||-1失效 */
public Integer getStatus(){
return this.status;
}
/** 状态;1审核||0正常||-1失效 */
public void setStatus(Integer status){
this.status = status;
}
/** 阅读数 */
public Integer getReadcount(){
return this.readcount;
}
/** 阅读数 */
public void setReadcount(Integer readcount){
this.readcount = readcount;
}
/** 标签;外键 */
public Integer getFlag(){
return this.flag;
}
/** 标签;外键 */
public void setFlag(Integer flag){
this.flag = flag;
}
/** 可见性;外键 */
public Integer getVid(){
return this.vid;
}
/** 可见性;外键 */
public void setVid(Integer vid){
this.vid = vid;
}
public List<Flag> getFlags() {
return flags;
}
public void setFlags(List<Flag> flags) {
this.flags = flags;
}
public List<archivesFlag> getArchivesflags() {
return archivesflags;
}
public void setArchivesflags(List<archivesFlag> archivesflags) {
this.archivesflags = archivesflags;
}
public Archivesvisibility getArchivesvisibility() {
return archivesvisibility;
}
public void setArchivesvisibility(Archivesvisibility archivesvisibility) {
this.archivesvisibility = archivesvisibility;
}
public type getEtype() {
return etype;
}
public void setEtype(type etype) {
this.etype = etype;
}
@Override
public int compareTo(Archives o) {
// TODO Auto-generated method stub
return this.readcount - o.readcount;
}
}
| true |
351c4e83d86aca19096ad5a7e56496672d94c887
|
Java
|
wkoltunowski/appointment
|
/scheduling/src/test/java/com/falco/appointment/scheduling/ReserveScheduleRangeServiceTest.java
|
UTF-8
| 7,847 | 2.015625 | 2 |
[] |
no_license
|
package com.falco.appointment.scheduling;
import com.falco.appointment.Factory;
import com.falco.appointment.scheduling.api.*;
import com.falco.appointment.scheduling.application.AppointmentTakenException;
import com.falco.appointment.scheduling.application.DefineNewScheduleService;
import com.falco.appointment.scheduling.api.SearchTags;
import com.falco.appointment.scheduling.domain.freescheduleranges.FreeScheduleSlot;
import com.falco.appointment.scheduling.domain.freescheduleranges.FreeScheduleSlotRepository;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.time.LocalDateTime;
import java.util.List;
import static com.falco.appointment.scheduling.api.ScheduleRange.scheduleRange;
import static com.falco.appointment.scheduling.domain.schedule.Validity.validFromTo;
import static com.falco.appointment.scheduling.domain.schedule.Validity.validOn;
import static com.falco.appointment.scheduling.domain.schedule.WorkingHours.ofHours;
import static com.falco.testsupport.DateTestUtils.todayAt;
import static com.falco.testsupport.DateTestUtils.todayBetween;
import static java.time.Duration.ofMinutes;
import static java.time.LocalDate.now;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
public class ReserveScheduleRangeServiceTest {
private FindFreeRangesService findFreeSlots;
private ReservationService reservationService;
private DefineNewScheduleService defineNewScheduleService;
private FreeScheduleSlotRepository repository;
private CancellationService cancellationService;
@Test
public void shouldFindAppointmentWhenFirstReserved() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:30"), ofMinutes(15));
reservationService.reserve(findFirstFree(todayAt("08:00")));
assertThat(findFirstFree(todayAt("08:00")), is(scheduleRange(todayBetween("08:15-08:30"), scheduleId)));
}
@Test
public void shouldFindEmptyForFullSchedule() throws Exception {
defineNewScheduleService.addDailySchedule(ofHours("08:00-08:30"), ofMinutes(15), validFromTo(now(), now()));
reservationService.reserve(findFirstFree(todayAt("08:00")));
reservationService.reserve(findFirstFree(todayAt("08:15")));
assertThat(findFree(todayAt(8, 0)), hasSize(0));
}
@Test(expectedExceptions = AppointmentTakenException.class)
public void shouldNotReserveSameAppointmentTwice() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:30"), ofMinutes(15));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:15"), scheduleId));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:15"), scheduleId));
}
@Test(expectedExceptions = AppointmentTakenException.class)
public void shouldNotReserveEnclosingAppointment() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:45"), ofMinutes(15));
reservationService.reserve(scheduleRange(todayBetween("08:15-08:45"), scheduleId));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:45"), scheduleId));
}
@Test(expectedExceptions = AppointmentTakenException.class)
public void shouldNotReserveOverlappingAppointment() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:45"), ofMinutes(15));
reservationService.reserve(scheduleRange(todayBetween("08:15-08:45"), scheduleId));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:20"), scheduleId));
}
@Test
public void shouldCancel() throws Exception {
defineNewScheduleService.addDailySchedule(ofHours("08:00-08:30"), ofMinutes(15));
ScheduleRange visitAt8am = findFirstFree(todayAt("08:00"));
reservationService.reserve(visitAt8am);
cancellationService.cancel(visitAt8am);
assertThat(findFirstFree(todayAt("08:00")), is(visitAt8am));
}
@Test
public void shouldCancelLast() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:30"), ofMinutes(15), validOn(now()));
reservationService.reserve(findFirstFree(todayAt("08:00")));
reservationService.reserve(findFirstFree(todayAt("08:15")));
assertThat(repository.findByScheduleId(scheduleId), hasSize(0));
cancellationService.cancel(scheduleRange(todayBetween("08:00-08:15"), scheduleId));
cancellationService.cancel(scheduleRange(todayBetween("08:15-08:30"), scheduleId));
assertThat(repository.findByScheduleId(scheduleId), hasItem(FreeScheduleSlot.of(scheduleId, todayBetween("08:00-08:30"), SearchTags.empty())));
}
@Test
public void shouldCancelMiddle() throws Exception {
ScheduleId scheduleId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:45"), ofMinutes(15), validOn(now()));
reservationService.reserve(findFirstFree(todayAt("08:15")));
assertThat(repository.findByScheduleId(scheduleId), contains(
FreeScheduleSlot.of(scheduleId, todayBetween("08:00-08:15"), SearchTags.empty()),
FreeScheduleSlot.of(scheduleId, todayBetween("08:30-08:45"), SearchTags.empty())));
cancellationService.cancel(scheduleRange(todayBetween("08:15-08:30"), scheduleId));
assertThat(repository.findByScheduleId(scheduleId), contains(FreeScheduleSlot.of(scheduleId, todayBetween("08:00-08:45"), SearchTags.empty())));
}
@Test
public void shouldCancelFullSchedule() throws Exception {
ScheduleId sId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:45"), ofMinutes(15), validOn(now()));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:15"), sId));
reservationService.reserve(scheduleRange(todayBetween("08:15-08:30"), sId));
reservationService.reserve(scheduleRange(todayBetween("08:30-08:45"), sId));
assertThat(repository.findByScheduleId(sId), hasSize(0));
cancellationService.cancel(scheduleRange(todayBetween("08:00-08:15"), sId));
cancellationService.cancel(scheduleRange(todayBetween("08:15-08:30"), sId));
cancellationService.cancel(scheduleRange(todayBetween("08:30-08:45"), sId));
assertThat(repository.findByScheduleId(sId), contains(FreeScheduleSlot.of(sId, todayBetween("08:00-08:45"), SearchTags.empty())));
}
@Test
public void shouldReserveCancelled() throws Exception {
ScheduleId sId = defineNewScheduleService.addDailySchedule(ofHours("08:00-08:45"), ofMinutes(15), validOn(now()));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:15"), sId));
cancellationService.cancel(scheduleRange(todayBetween("08:00-08:15"), sId));
reservationService.reserve(scheduleRange(todayBetween("08:00-08:30"), sId));
}
private ScheduleRange findFirstFree(LocalDateTime startingFrom) {
return findFree(startingFrom).get(0);
}
private List<ScheduleRange> findFree(LocalDateTime startingFrom) {
return findFreeSlots.findFirstFree(startingFrom);
}
@BeforeMethod
public void setUp() throws Exception {
Factory factory = new Factory();
findFreeSlots = factory.findFreeService(10);
defineNewScheduleService = factory.scheduleDefinitionService();
reservationService = factory.reservationService();
cancellationService = factory.cancellationService();
repository = factory.freeSlotRepository();
}
}
| true |
0e5d67c99c2b9081b871032b819e5b59d2d2c479
|
Java
|
jim1338/SeniorHighSchoolLessonsArrangement
|
/SeniorHighSchoolLessonsArrangement/src/Setting/Choose.java
|
UTF-8
| 100 | 1.859375 | 2 |
[] |
no_license
|
package Setting;
public enum Choose {
physics, biology, chemistry, history, politics, geography
}
| true |
aac5c4ffb4cc1145918e66c3c676595e3d0c3c30
|
Java
|
AirspanNetworks/SWITModules
|
/airspan.netspan/src/main/java/Netspan/NBI_15_1/Statistics/StatisticsSoapImpl.java
|
UTF-8
| 113,600 | 1.71875 | 2 |
[] |
no_license
|
/**
* Please modify this class to meet your needs
* This class is not complete
*/
package Netspan.NBI_15_1.Statistics;
import java.util.logging.Logger;
/**
* This class was generated by Apache CXF 3.0.1
* 2016-12-06T19:17:44.267+02:00
* Generated source version: 3.0.1
*
*/
@javax.jws.WebService(
serviceName = "Statistics",
portName = "StatisticsSoap",
targetNamespace = "http://Airspan.Netspan.WebServices",
wsdlLocation = "http://192.168.58.103//ws/15.0/Statistics.asmx?WSDL",
endpointInterface = "Netspan.NBI_15_1.Statistics.StatisticsSoap")
public class StatisticsSoapImpl implements StatisticsSoap {
private static final Logger LOG = Logger.getLogger(StatisticsSoapImpl.class.getName());
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#pagingRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePagingResponse pagingRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation pagingRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePagingResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse cellLevelRadioBearerQosHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ueAssociatedLogicalS1ConnectionGetDaily(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse ueAssociatedLogicalS1ConnectionGetDaily(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ueAssociatedLogicalS1ConnectionGetDaily");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse cellLevelRadioBearerQosRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#linkAdaptationRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMcsResponse linkAdaptationRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation linkAdaptationRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMcsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachPreamblesSentHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse rachPreamblesSentHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachPreamblesSentHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ueAssociatedLogicalS1ConnectionGetHourly(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse ueAssociatedLogicalS1ConnectionGetHourly(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ueAssociatedLogicalS1ConnectionGetHourly");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#relayRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse relayRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation relayRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#liteCompHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse liteCompHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation liteCompHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabResponse erabRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabResponse erabDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabPerQciHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse erabPerQciHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabPerQciHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#relayHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse relayHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation relayHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse handoverDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverPerTargetCellRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse handoverPerTargetCellRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverPerTargetCellRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosPerQciHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse cellLevelRadioBearerQosPerQciHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosPerQciHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse bsIbBaseAirInterfaceRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermDataHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse bsIbBaseTermDataHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermDataHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rfMeasureHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse rfMeasureHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rfMeasureHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermRfDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse bsIbBaseTermRfDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermRfDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverDiskDayGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerDiskResponse serverDiskDayGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverDiskDayGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerDiskResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440QosPerQciDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse ib440QosPerQciDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440QosPerQciDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#harqDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHarqResponse harqDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation harqDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHarqResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermRfRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse bsIbBaseTermRfRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermRfRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse bsIbBaseAirInterfaceDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#positioningMeasurementsRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse positioningMeasurementsRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation positioningMeasurementsRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#linkAdaptationHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMcsResponse linkAdaptationHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation linkAdaptationHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMcsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceUsageRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse bsIbBaseAirInterfaceUsageRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceUsageRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rruPerQciHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse rruPerQciHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rruPerQciHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#mmeDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMmeResponse mmeDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation mmeDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMmeResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440RfDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440RfResponse ib440RfDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440RfDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440RfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#csfbRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse csfbRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation csfbRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#radioResourceUtilizationRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse radioResourceUtilizationRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation radioResourceUtilizationRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse handoverRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#positioningMeasurementsHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse positioningMeasurementsHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation positioningMeasurementsHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermRfHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse bsIbBaseTermRfHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermRfHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermRfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#liteCompRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse liteCompRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation liteCompRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachAccessDelayHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse rachAccessDelayHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachAccessDelayHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#liteCompDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse liteCompDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation liteCompDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteLiteCompResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachPreamblesSentRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse rachPreamblesSentRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachPreamblesSentRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceUsageHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse bsIbBaseAirInterfaceUsageHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceUsageHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosPerQciDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse cellLevelRadioBearerQosPerQciDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosPerQciDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rfMeasureDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse rfMeasureDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rfMeasureDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#equipmentMeasureDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse equipmentMeasureDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation equipmentMeasureDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverProcessRawGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerProcessResponse serverProcessRawGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverProcessRawGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerProcessResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#pagingHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePagingResponse pagingHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation pagingHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePagingResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#relayDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse relayDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation relayDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIRelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#csfbHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse csfbHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation csfbHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceUsageDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse bsIbBaseAirInterfaceUsageDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceUsageDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceUsageResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440RfHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440RfResponse ib440RfHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440RfHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440RfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#radioResourceUtilizationDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse radioResourceUtilizationDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation radioResourceUtilizationDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosPerQciRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse cellLevelRadioBearerQosPerQciRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosPerQciRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rrcConnectionDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse rrcConnectionDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rrcConnectionDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#radioResourceUtilizationHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse radioResourceUtilizationHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation radioResourceUtilizationHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRadioResourceUtilizationResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachAccessDelayDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse rachAccessDelayDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachAccessDelayDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverPerTargetCellDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse handoverPerTargetCellDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverPerTargetCellDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#embmsRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse embmsRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation embmsRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverProcessDayGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerProcessResponse serverProcessDayGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverProcessDayGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerProcessResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440IpRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440IpResponse ib440IpRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440IpRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440IpResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverDiskHourGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerDiskResponse serverDiskHourGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverDiskHourGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerDiskResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabPerQciRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse erabPerQciRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabPerQciRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#embmsHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse embmsHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation embmsHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#csfbDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse csfbDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation csfbDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCsfbResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#pagingDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePagingResponse pagingDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation pagingDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePagingResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440QosPerQciHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse ib440QosPerQciHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440QosPerQciHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachAccessDelayRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse rachAccessDelayRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachAccessDelayRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachAccessDelayResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#equipmentMeasureHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse equipmentMeasureHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation equipmentMeasureHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse handoverHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabResponse erabHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermDataDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse bsIbBaseTermDataDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermDataDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440IpHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440IpResponse ib440IpHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440IpHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440IpResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#mmeRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMmeResponse mmeRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation mmeRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMmeResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#harqHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHarqResponse harqHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation harqHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHarqResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#equipmentMeasureRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse equipmentMeasureRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation equipmentMeasureRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEquipmentMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseTermDataRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse bsIbBaseTermDataRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseTermDataRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseTermDataResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rrcConnectionHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse rrcConnectionHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rrcConnectionHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#handoverPerTargetCellHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse handoverPerTargetCellHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation handoverPerTargetCellHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHandoverPerTargetCellResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#harqRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteHarqResponse harqRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation harqRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteHarqResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rfMeasureRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse rfMeasureRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rfMeasureRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRfMeasureResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440RfRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440RfResponse ib440RfRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440RfRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440RfResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rruPerQciDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse rruPerQciDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rruPerQciDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#embmsDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse embmsDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation embmsDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteEmbmsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rrcConnectionRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse rrcConnectionRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rrcConnectionRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRrcConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440QosPerQciRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse ib440QosPerQciRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440QosPerQciRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440QosPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverProcessHourGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerProcessResponse serverProcessHourGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverProcessHourGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerProcessResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ueAssociatedLogicalS1ConnectionGetRaw(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse ueAssociatedLogicalS1ConnectionGetRaw(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ueAssociatedLogicalS1ConnectionGetRaw");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteUeAssociatedLogicalS1ConnectionResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#erabPerQciDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse erabPerQciDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation erabPerQciDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteErabPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#ib440IpDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsIb440IpResponse ib440IpDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation ib440IpDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsIb440IpResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#serverDiskRawGet(javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsServerDiskResponse serverDiskRawGet(javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation serverDiskRawGet");
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsServerDiskResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#mmeHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMmeResponse mmeHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation mmeHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMmeResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#positioningMeasurementsDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse positioningMeasurementsDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation positioningMeasurementsDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLtePosMeasurementsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rruPerQciRawGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse rruPerQciRawGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rruPerQciRawGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRruPerQciResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#bsIbBaseAirInterfaceHourlyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse bsIbBaseAirInterfaceHourlyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation bsIbBaseAirInterfaceHourlyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsBsIbBaseAirInterfaceResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#linkAdaptationDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteMcsResponse linkAdaptationDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation linkAdaptationDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteMcsResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#rachPreamblesSentDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse rachPreamblesSentDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation rachPreamblesSentDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteRachPreamblesSentResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
/* (non-Javadoc)
* @see Netspan.NBI_15_1.Statistics.StatisticsSoap#cellLevelRadioBearerQosDailyGet(java.util.List<java.lang.String> nodeName ,)java.util.List<java.lang.String> nodeId ,)javax.xml.datatype.XMLGregorianCalendar dateStart ,)javax.xml.datatype.XMLGregorianCalendar dateEnd ,)Netspan.NBI_15_1.Statistics.Credentials credentials )*
*/
public Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse cellLevelRadioBearerQosDailyGet(java.util.List<java.lang.String> nodeName,java.util.List<java.lang.String> nodeId,javax.xml.datatype.XMLGregorianCalendar dateStart,javax.xml.datatype.XMLGregorianCalendar dateEnd,Credentials credentials) {
LOG.info("Executing operation cellLevelRadioBearerQosDailyGet");
System.out.println(nodeName);
System.out.println(nodeId);
System.out.println(dateStart);
System.out.println(dateEnd);
System.out.println(credentials);
try {
Netspan.NBI_15_1.Statistics.StatsLteCellLevelRadioBearerQosResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
}
| true |
4cb096269493fe296a1f8167e59c6595cea07cd7
|
Java
|
jhillierdavis/WhosInSpace_JavaExercise
|
/src/main/java/com/jhdit/java/exercise/whosinspace/Astronaut.java
|
UTF-8
| 601 | 3.265625 | 3 |
[] |
no_license
|
package com.jhdit.java.exercise.whosinspace;
/**
* Represents an space craft crew member.
*/
public class Astronaut {
private String name;
public Astronaut(final String name) {
if (null == name ) { throw new IllegalArgumentException("Invalid name: " + name); }
this.name = name;
}
public String getName() {
return this.name;
}
public String getSurname() {
String[] array = this.name.split( "\\b" );
return array[ array.length - 1];
}
@Override
public String toString() {
return this.name;
}
}
| true |
bbd079ceef83d57778379b47c0e5294fdb63c960
|
Java
|
kvrayudu/biomat
|
/src/main/java/edu/cornell/cals/biomat/model/measurement/MeasurementsSearchResultsForm.java
|
UTF-8
| 1,351 | 2.171875 | 2 |
[] |
no_license
|
package edu.cornell.cals.biomat.model.measurement;
import java.io.Serializable;
public class MeasurementsSearchResultsForm implements Serializable{
private static final long serialVersionUID = -2574959934691630627L;
/*
protected List<BioMeasurement> bioMeasurements;
private int currentPage;
private int lastPage;
private int pagerStart;
private int pagerEnd;
public List<BioMeasurement> getBioMeasurements() {
return bioMeasurements;
}
public void setBioMeasurements(List<BioMeasurement> bioMeasurements) {
this.bioMeasurements = bioMeasurements;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getLastPage() {
return lastPage;
}
public void setLastPage(int lastPage) {
this.lastPage = lastPage;
}
public int getPagerStart() {
return pagerStart;
}
public void setPagerStart(int pagerStart) {
this.pagerStart = pagerStart;
}
public int getPagerEnd() {
return pagerEnd;
}
public void setPagerEnd(int pagerEnd) {
this.pagerEnd = pagerEnd;
}
@Override
public String toString() {
return "MeasurementsSearchResultsForm [bioMeasurements=" + bioMeasurements + ", currentPage=" + currentPage
+ ", lastPage=" + lastPage + ", pagerStart=" + pagerStart + ", pagerEnd=" + pagerEnd + "]";
}
*/
}
| true |
aef5daa3732ffb5ba430ba63df65ce5f6ead2e1b
|
Java
|
JamesChen666/JY-SpringBoot
|
/src/main/java/com/boot/controller/serve/DownloadtypeController.java
|
UTF-8
| 6,236 | 1.9375 | 2 |
[] |
no_license
|
package com.boot.controller.serve;
import cn.hutool.core.lang.Dict;
import com.boot.controller.system.BaseController;
import com.boot.model.Downloadtype;
import com.boot.system.SqlIntercepter;
import com.boot.util.AjaxResult;
import com.boot.util.PublicClass;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author chenjiang
*/
@Controller
@RequestMapping("/downloadType")
public class DownloadtypeController extends BaseController{
private static final String BASE_PATH = "downloadType";
private static final String LIST = "downloadType.list";
@RequestMapping("/")
public String index() {
return BASE_PATH+"/downloadType_list";
}
@ResponseBody
@RequestMapping("/list")
public Object list(HttpServletRequest httpServletRequest) {
Map map = pageQuery(LIST,httpServletRequest);
return map;
}
@ResponseBody
@RequestMapping("/downloadTypeList")
public Object downloadTypeList(HttpServletRequest httpServletRequest) {
List<Map> list = sqlManager.select(LIST,Map.class);
return list;
}
@RequestMapping("/add")
public String add() {
return BASE_PATH + "/downloadType_add";
}
@RequestMapping("/edit")
public String edit(HttpServletRequest httpServletRequest, ModelMap modelMap) {
modelMap.put("id", httpServletRequest.getParameter("id"));
return BASE_PATH + "/downloadType_edit";
}
@ResponseBody
@RequestMapping("/edit/{id}")
public Object edit(@PathVariable Integer id) {
Downloadtype DownloadType = sqlManager.single(Downloadtype.class,id);
return DownloadType;
}
@ResponseBody
@RequestMapping("/save")
public AjaxResult save(HttpServletRequest request) {
Downloadtype model = mapping(Downloadtype.class, request);
if(model != null){
if(PublicClass.isNull(model.getId()+"")){
model.setIsEnabled(false);
//新增
return sqlManager.insert(model)>0?success(SUCCESS):fail(FAIL);
}else{
Downloadtype downloadtype = sqlManager.single(Downloadtype.class,model.getId());
model.setIsEnabled(downloadtype.getIsEnabled());
//修改
return sqlManager.updateById(model)>0?success(SUCCESS):fail(FAIL);
}
}else{
return fail("没有接收到参数,请重新提交");
}
}
@ResponseBody
@RequestMapping("/delete")
public AjaxResult delete(HttpServletRequest httpServletRequest) {
Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
int deleteById = 0;
for (String s : parameterMap.keySet()) {
String id = httpServletRequest.getParameter(s);
deleteById += sqlManager.deleteById(Downloadtype.class, id);
}
if (deleteById <= 0) {
return fail(FAIL);
}
return success(SUCCESS);
}
@ResponseBody
@RequestMapping("/queryCode")
public Object queryCode(HttpServletRequest request) {
Map map = new HashMap();
String typeCode = request.getParameter("TypeCode");
if(!PublicClass.isNull(typeCode)){
map.put("typeCode",typeCode);
return sqlManager.select("downloadtype.queryCode",Map.class,map);
}
return null;
}
@ResponseBody
@RequestMapping("/disableOrEnable")
public AjaxResult disableOrEnable(HttpServletRequest httpServletRequest) {
Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
int updateById = 0;
for (String s : parameterMap.keySet()) {
if (!s.equals("flag")){
String id = httpServletRequest.getParameter(s);
String flag = httpServletRequest.getParameter("flag");
Downloadtype single = sqlManager.single(Downloadtype.class, id);
if (flag.equals("true")){
single.setIsEnabled(true);
}else {
single.setIsEnabled(false);
}
updateById += sqlManager.updateById(single);
}
}
if (updateById <= 0) {
return fail(FAIL);
}
return success(SUCCESS);
}
@ResponseBody
@RequestMapping("/import")
public AjaxResult importExcel(MultipartHttpServletRequest request) {
MultiValueMap<String, MultipartFile> multiFileMap = request.getMultiFileMap();
int insert = 0;
for (String s : multiFileMap.keySet()) {
MultipartFile file = request.getFile(s);
List<Downloadtype> DownloadTypes = importExcel(file, Downloadtype.class);
for (Downloadtype downloadType : DownloadTypes) {
insert += sqlManager.insert(downloadType);
}
}
if (insert<=0){
return fail(FAIL);
}
return success(SUCCESS);
}
@ResponseBody
@RequestMapping("/export")
public AjaxResult exportExcel(HttpServletRequest httpServletRequest) {
String ids = httpServletRequest.getParameter("ids");
List<Map> mapList;
if (ids == null||ids.isEmpty()) {
mapList = sqlManager.select("downloadType.list",Map.class);
}else {
mapList = appendToList("downloadType.list",
SqlIntercepter.create().set("WHERE FIND_IN_SET(Id,#{ids})"),
Dict.create().set("ids", ids));
}
try {
simpleExport("DownloadType", mapList );
}catch (Exception e){
e.getStackTrace();
return fail(FAIL);
}
return success(SUCCESS);
}
}
| true |
f57880f438b5d4bbad76ed3091eb4270e4824130
|
Java
|
weiandedidi/javaStu
|
/javacore/src/main/java/zookeeperConfig/Config.java
|
UTF-8
| 356 | 1.570313 | 2 |
[] |
no_license
|
package zookeeperConfig;
import lombok.*;
import java.io.Serializable;
/**
* zookeeper的动态配置
*
* @author qidi
* @date 2018-12-19 20:20
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Config implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String password;
}
| true |
1789ddc9b21f8c3103227ac05330cbf7ec8a22cb
|
Java
|
zubata/2019-09-otus-spring-Zubkov
|
/homework17/src/main/java/ru/otus/spring/homework17/actuator/RestBookHealthChecker.java
|
UTF-8
| 738 | 2.328125 | 2 |
[] |
no_license
|
package ru.otus.spring.homework17.actuator;
import lombok.Data;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
import ru.otus.spring.homework17.rest.RestControllerForBook;
@Component
@Data
public class RestBookHealthChecker implements HealthIndicator {
private final RestControllerForBook restControllerForBook;
@Override
public Health health() {
if (restControllerForBook != null) {
return Health.up().withDetail("message", "Rest for book is up").build();
} else {
return Health.down().withDetail("message", "Rest for book is down").build();
}
}
}
| true |
4294a58b9441d842c7aa5ca70d36ce9b726f4a35
|
Java
|
lucifer-gg/SE2
|
/代码/src/main/java/com/example/cinema/blImpl/promotion/VIPServiceImpl.java
|
UTF-8
| 11,643 | 2.140625 | 2 |
[] |
no_license
|
package com.example.cinema.blImpl.promotion;
import com.example.cinema.bl.promotion.VIPService;
import com.example.cinema.data.promotion.VIPCardMapper;
import com.example.cinema.data.sales.TicketMapper;
import com.example.cinema.po.*;
import com.example.cinema.vo.VIPCardForm;
import com.example.cinema.vo.ResponseVO;
import com.example.cinema.vo.VIPInfoVO;
import com.example.cinema.vo.VipStrategyForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
/**
* Created by liying on 2019/4/14.
*/
/**
* @author 蔡明卫
* @date 6/1
*/
@Service
public class VIPServiceImpl implements VIPService {
@Autowired
VIPCardMapper vipCardMapper;
@Autowired
TicketMapper ticketMapper;
@Override
public ResponseVO addVIPCard(int userId) {
VIPCard vipCard = new VIPCard();
vipCard.setUserId(userId);
vipCard.setBalance(0);
try {
int id = vipCardMapper.insertOneCard(vipCard);
//购卡时插入购卡的消费记录
ConsumeHistory currentConsumeHistory=new ConsumeHistory();
currentConsumeHistory.setUserId(userId);
currentConsumeHistory.setAmountOfMoney(VIPCard.price);
currentConsumeHistory.setConsumeType(0);
currentConsumeHistory.setConsumeWay(1);
currentConsumeHistory.setConsumeCardId(123123123);
ticketMapper.insertConsumeHistory(currentConsumeHistory);
//会员开户时数据库新建会员消费的记录
VipConsume vipConsume=new VipConsume();
vipConsume.setUserId(userId);
vipConsume.setVipId(vipCardMapper.selectCardByUserId(userId).getId());
vipConsume.setConsume(0);
vipCardMapper.insertVipConsume(vipConsume);
return ResponseVO.buildSuccess(vipCardMapper.selectCardById(id));
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getCardById(int id) {
try {
return ResponseVO.buildSuccess(vipCardMapper.selectCardById(id));
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getVIPInfo(int userId) {
VIPInfoVO vipInfoVO = new VIPInfoVO();
//根据会员等级获取相应的优惠策略
int viptype=vipCardMapper.selectCardByUserId(userId)==null?1:vipCardMapper.selectCardByUserId(userId).getViptype();
VipStrategy vipStrategy=vipCardMapper.selectVipStrategybyViptype(viptype);
//计算满减
String description="满"+vipStrategy.getBasis()+"送"+vipStrategy.getAddition();
//计算会员距离下一级的差距
List<RechangeRecord> rechangeRecordList=vipCardMapper.selectRechangeRecordbyUser(userId);
int totalrecord=0;
for(int j=0;j<rechangeRecordList.size();j++){
totalrecord+=rechangeRecordList.get(j).getAmountOfMoney();
}
double gap=vipStrategy.getCell()-totalrecord;
String level="";
if (gap<0){
level="恭喜你已到达最高等级";
}else {
level="距离下一级仍需充值"+gap+"元";}
vipInfoVO.setDescription(description);
vipInfoVO.setPrice(vipStrategy.getPrice());
vipInfoVO.setLevel(level);
return ResponseVO.buildSuccess(vipInfoVO);
}
@Override
public ResponseVO charge(VIPCardForm vipCardForm) {
VIPCard vipCard = vipCardMapper.selectCardById(vipCardForm.getVipId());
if (vipCard == null) {
return ResponseVO.buildFailure("会员卡不存在");
}
//计算实到金额
double balance = vipCard.calculate(vipCardForm.getAmount(),vipCardMapper.selectVipStrategybyViptype(vipCard.getViptype()).getBasis(),vipCardMapper.selectVipStrategybyViptype(vipCard.getViptype()).getAddition());
//计算赠送金额
double bonus=balance-vipCardForm.getAmount();
//更新会员卡余额信息
vipCard.setBalance(vipCard.getBalance() + balance);
try {
//插入充值记录
vipCardMapper.updateCardBalance(vipCardForm.getVipId(), vipCard.getBalance());
RechangeRecord rechangeRecord=new RechangeRecord();
rechangeRecord.setAmountOfMoney(vipCardForm.getAmount());
rechangeRecord.setConsumeCardId(123123123);
rechangeRecord.setUserId(vipCard.getUserId());
rechangeRecord.setBalance(vipCard.getBalance());
rechangeRecord.setBonus(bonus);
vipCardMapper.insertRechangeRecord(rechangeRecord);
//计算至今充值金额并判断会员卡是否应该升级
List<RechangeRecord> rechangeRecordList=vipCardMapper.selectRechangeRecordbyUser(vipCard.getUserId());
int totalrecord=0;
for(int i=0;i<rechangeRecordList.size();i++){
totalrecord+=rechangeRecordList.get(i).getAmountOfMoney();
}
//判断等级
while(totalrecord>=vipCardMapper.selectVipStrategybyViptype(vipCard.getViptype()).getCell()&&vipCard.getViptype()<vipCardMapper.trueselectlaststrategy().getViptype()){
vipCardMapper.updateViptype(vipCard.getViptype()+1,vipCard.getUserId());
vipCard.setViptype(vipCard.getViptype()+1);
}
return ResponseVO.buildSuccess(vipCard);
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getCardByUserId(int userId) {
try {
VIPCard vipCard = vipCardMapper.selectCardByUserId(userId);
if(vipCard==null){
return ResponseVO.buildFailure("用户卡不存在");
}
return ResponseVO.buildSuccess(vipCard);
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getRechangeRecordByUserId(int userId){
try {
return ResponseVO.buildSuccess(vipCardMapper.selectRechangeRecordbyUser(userId));
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getLastVipStrategy(){
try {
return ResponseVO.buildSuccess(vipCardMapper.selectLastVipStrategy());
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO updateVipStrategy(double basis,double addition,double cell,int viptype){
try {
vipCardMapper.updateVipStrategy(viptype,cell,basis,addition);
//更新优惠策略后考虑对已有会员卡用户的影响
List<VIPCard> vipCardList=vipCardMapper.selectAllCard();
VIPCard currentvipCard;
for (int i=0;i<vipCardList.size();i++){//循环所有已有的会员卡
currentvipCard=vipCardList.get(i);
List<RechangeRecord> rechangeRecordList=vipCardMapper.selectRechangeRecordbyUser(currentvipCard.getUserId());
int totalrecord=0;
for(int j=0;j<rechangeRecordList.size();j++){
totalrecord+=rechangeRecordList.get(j).getAmountOfMoney();
}//计算总充值额
while(totalrecord>=vipCardMapper.selectVipStrategybyViptype(currentvipCard.getViptype()).getCell()&¤tvipCard.getViptype()<vipCardMapper.trueselectlaststrategy().getViptype()){
vipCardMapper.updateViptype(currentvipCard.getViptype()+1,currentvipCard.getUserId());
currentvipCard.setViptype(currentvipCard.getViptype()+1);
}//是否应该升级
if (currentvipCard.getViptype()!=1){
while (totalrecord < vipCardMapper.selectVipStrategybyViptype(currentvipCard.getViptype() - 1).getCell() && currentvipCard.getViptype() > 1) {
vipCardMapper.updateViptype(currentvipCard.getViptype() - 1, currentvipCard.getUserId());
currentvipCard.setViptype(currentvipCard.getViptype() - 1);
if (currentvipCard.getViptype() == 1) break;
}
}//是否应该降级(1级会员卡不降级)
}
return ResponseVO.buildSuccess();
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO addVipStrategy(VipStrategyForm vipStrategyForm){
try {//增加会员优惠策略
VipStrategy vipStrategy=new VipStrategy();
vipStrategy.setAddition(vipStrategyForm.getAddition());
vipStrategy.setBasis(vipStrategyForm.getBasis());
vipStrategy.setViptype(vipCardMapper.trueselectlaststrategy().getViptype()+1);
vipStrategy.setCell(vipStrategyForm.getCell());
vipCardMapper.insertVipStrategy(vipStrategy);
return ResponseVO.buildSuccess();
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO getVipConsumebyMoney(int money) {
try {
return ResponseVO.buildSuccess(vipCardMapper.selectVipConsumebyMoney(money));
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
@Override
public ResponseVO addCoupon(List<Integer> idList,int couponId) {
try {
for (int i=0;i<idList.size();i++){
vipCardMapper.addVipCoupon(idList.get(0),couponId);
}
return ResponseVO.buildSuccess();
} catch (Exception e) {
e.printStackTrace();
return ResponseVO.buildFailure("失败");
}
}
//模拟会员卡
public VIPCard Stub1(){
System.out.println("return a vipcard");
VIPCard card=new VIPCard();
card.setId(8);
card.setUserId(15);
card.setBalance(100.00);
card.setViptype(0);
card.setJoinDate(new Timestamp(11231));
return card;
}
//模拟获取的优惠策略
public VipStrategy Stub2(){
System.out.println("return a vipstrategy");
VipStrategy vipStrategy=new VipStrategy();
vipStrategy.setCell(200);
vipStrategy.setPrice(25);
vipStrategy.setViptype(1);
vipStrategy.setBasis(200);
vipStrategy.setAddition(30);
vipStrategy.setId(30);
return vipStrategy;
}
//模拟充值记录
public List<RechangeRecord> Stub3(){
System.out.println("retuen Rechangerecord");
RechangeRecord rechangeRecord=new RechangeRecord();
rechangeRecord.setBonus(30);
rechangeRecord.setBalance(2000);
rechangeRecord.setUserId(13);
rechangeRecord.setConsumeCardId(123123123);
rechangeRecord.setAmountOfMoney(200);
rechangeRecord.setId(8);
List<RechangeRecord> rechangeRecordList=new ArrayList<>();
rechangeRecordList.add(rechangeRecord);
return rechangeRecordList;
}
}
| true |
789d41a5179cfeecb4fbb3e0b36949484316cca5
|
Java
|
anfaas1618/aestheticAM-clientApp
|
/app/src/main/java/com/mibtech/aesthetic_am/model/Cart.java
|
UTF-8
| 1,581 | 2.3125 | 2 |
[] |
no_license
|
package com.mibtech.aesthetic_am.model;
import java.util.ArrayList;
public class Cart {
String id, user_id, product_id, product_variant_id, qty, date_created, ready_to_cart;
ArrayList<CartItems> item;
public String getReady_to_cart() {
return ready_to_cart;
}
public void setReady_to_cart(String ready_to_cart) {
this.ready_to_cart = ready_to_cart;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getProduct_id() {
return product_id;
}
public void setProduct_id(String product_id) {
this.product_id = product_id;
}
public String getProduct_variant_id() {
return product_variant_id;
}
public void setProduct_variant_id(String product_variant_id) {
this.product_variant_id = product_variant_id;
}
public String getQty() {
return qty;
}
public void setQty(String qty) {
this.qty = qty;
}
public String getDate_created() {
return date_created;
}
public void setDate_created(String date_created) {
this.date_created = date_created;
}
public ArrayList<CartItems> getItems() {
return item;
}
public void setItems(ArrayList<CartItems> items) {
this.item = items;
}
}
| true |
8b2920fbf9bee72b9a2cc77b2d32ca6cd6193551
|
Java
|
FrankieRM/movie-theater
|
/src/main/java/com/osp/demo/movietheater/controller/mapper/MovieMapper.java
|
UTF-8
| 964 | 2.546875 | 3 |
[] |
no_license
|
package com.osp.demo.movietheater.controller.mapper;
import com.osp.demo.movietheater.domain.Movie;
import com.osp.demo.movietheater.controller.dto.MovieDTO;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class MovieMapper {
@Autowired
private ModelMapper modelMapper;
public List<MovieDTO> mapMovieDTOs(final List<Movie> movies) {
return movies
.stream()
.map(this::mapMovieDTO)
.collect(Collectors.toList());
}
public MovieDTO mapMovieDTO(final Movie movie) {
if (movie == null) {
return null;
}
return modelMapper.map(movie, MovieDTO.class);
}
public Movie mapMovie(final MovieDTO movieDTO) {
return modelMapper.map(movieDTO, Movie.class);
}
}
| true |
1c8d244177462dee2883079f91a078d79fa9ea26
|
Java
|
ManojSureddi/Online-Cab-Reservation-System
|
/src/com/ocsr/dao/BookingDAO.java
|
UTF-8
| 6,280 | 2.515625 | 3 |
[] |
no_license
|
package com.ocsr.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.ocsr.bean.Bookingbean;
import com.ocsr.utils.Connector;
public class BookingDAO {
public String Bookacab(Bookingbean bookingbean)
{ String carId="";
String bookId="";
Connection con=null;
PreparedStatement ps1=null;
PreparedStatement ps2=null;
PreparedStatement ps3=null;
PreparedStatement ps4=null;
ResultSet rs=null;
ResultSet rs1=null;
ResultSet rs2=null;
int count=0;
try{
con=Connector.getConnection();
ps3=con.prepareStatement("select car_id as carId from ocsr_fleet where carmake=? and fleettype=? and features=? and carmodel =? and car_status='1' ");
ps3.setString(1,bookingbean.getCarMake());
ps3.setString(2,bookingbean.getCarType());
ps3.setString(3,bookingbean.getFeatures());
ps3.setString(4,bookingbean.getCarModel());
System.out.println(bookingbean.toString());
rs1=ps3.executeQuery();
while(rs1.next())
{System.out.println("sas");
carId=rs1.getString("carId");
System.out.println(carId);
bookingbean.setCarId(carId);
break;
}
System.out.println(carId);
if(carId!="")
{ System.out.println("1234");
System.out.println("in "+carId);
ps3=con.prepareStatement("UPDATE OCSR_FlEET SET CAR_STATUS='0' WHERE CAR_ID=?" );
ps3.setString(1,bookingbean.getCarId());
System.out.println(ps3.executeUpdate());
con.commit();
ps1=con.prepareStatement("SELECT count(*) FROM TEMP_OCSR_BOOKING");
rs=ps1.executeQuery();
String tempcount="0";
while(rs.next())
{
System.out.println("asdsa"+rs.getString(1));
tempcount=rs.getString(1);
}
// tempcount=tempcount.substring(1,tempcount.length());
count=Integer.parseInt(tempcount)+2;
bookId="B"+count;
bookingbean.setBookingId(bookId);
System.out.println(bookId);
ps2=con.prepareStatement(" insert into temp_ocsr_booking values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps2.setString(1,bookingbean.getBookingId());
ps2.setString(2,bookingbean.getBookingDate());
ps2.setString(3,bookingbean.getSource());
ps2.setString(4,bookingbean.getDestination());
ps2.setInt(5,bookingbean.getNumberOfDays());
ps2.setDouble(6,bookingbean.getConveyance());
ps2.setDouble(7,bookingbean.getTotalAmount());
ps2.setString(8,bookingbean.getStartTime());
ps2.setString(9,bookingbean.getCarId());
ps2.setString(10,bookingbean.getDriverId());
ps2.setString(11,bookingbean.getSourceCity());
ps2.setString(12,bookingbean.getDestinationCity());
int a=ps2.executeUpdate();
con.commit();
}
else
{
bookId=null;
}
}catch(SQLException e)
{
e.printStackTrace();
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
finally
{
try{
if(con!=null)
{
con.close();
}
if(ps1!=null)
{
ps1.close();
}
if(ps2!=null)
{
ps2.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
return bookId;
}
public String makePayment(Bookingbean Bean, String Type) {
Connection con=null;
PreparedStatement ps1=null;
PreparedStatement ps2=null;
ResultSet rs1=null;
ResultSet rs2=null;
int paymentRowId = 0;
String paymentId=null;
double subTotal=0.0;
try{
con=Connector.getConnection();
ps1 = con.prepareStatement("select count(*) from ocsr_payment");
rs1 = ps1.executeQuery();
if(rs1.next())
{
paymentRowId=rs1.getInt(1);
}
paymentId="P"+(paymentRowId+1);
ps2 = con.prepareStatement("select * from ocsr_fleet");
rs2=ps2.executeQuery();
if(rs2.next())
{
subTotal=rs2.getDouble("RENT_PER_DAY");
}
System.out.println(subTotal);
int noOfDays=Bean.getNumberOfDays();
System.out.println(Bean.getNumberOfDays());
double conveyance=Bean.getConveyance();
double subAmount=(subTotal*noOfDays);
System.out.println(subAmount);
double amount=subAmount+conveyance;
Bean.setTotalAmount(amount);
PreparedStatement ps3 = con.prepareStatement("insert into ocsr_payment values(?,?,?,?,?)");
ps3.setString(1, paymentId);
ps3.setString(2,Type);
ps3.setDouble(3,amount);
ps3.setDouble(4,0);
ps3.setString(5,Bean.getBookingId());
ps3.executeQuery();
con.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return paymentId;
}
public String bookDrive(Bookingbean Bean)
{
int bookNumber;
int bookId = 0;
int count=0;
String carId = null;
String bookId1=null;
try
{
Connection con=Connector.getConnection();
PreparedStatement ps7=con.prepareStatement("select * from ocsr_booking");
ResultSet rs5=ps7.executeQuery();
String tempcount="B00";
while(rs5.next())
{
System.out.println("asdsa"+rs5.getString(1));
tempcount=rs5.getString(1);
}
tempcount=tempcount.substring(1,tempcount.length());
count=Integer.parseInt(tempcount)+1;
bookId1="B"+count;
Bean.setBookingId(bookId1);
// bookId1="B"+(bookId+1);
ps7=con.prepareStatement("insert into ocsr_Booking values(?,?,?,?,?,?,?,?,?,?,?,?,?)");
ps7.setString(1,bookId1);
ps7.setString(2,Bean.getUserId());
ps7.setString(3,Bean.getBookingDate());
ps7.setString(4,Bean.getSource());
ps7.setString(5,Bean.getDestination());
ps7.setInt(6,Bean.getNumberOfDays());
ps7.setDouble(7,Bean.getConveyance());
ps7.setDouble(8,Bean.getTotalAmount());
ps7.setString(9,Bean.getStartTime());
ps7.setString(10,Bean.getCarId());
ps7.setString(11,Bean.getDriverId());
ps7.setString(12,Bean.getSourceCity());
ps7.setString(13,Bean.getDestinationCity());
bookNumber=ps7.executeUpdate();
con.commit();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return bookId1;
}
}
| true |
49a0ef90a8ad7e3767db6278facdf7ae4c86058c
|
Java
|
brian50208lee/PMI
|
/src/nltk/collocations/AbstractCollocationFinder.java
|
UTF-8
| 1,593 | 2.734375 | 3 |
[] |
no_license
|
package nltk.collocations;
import java.util.ArrayList;
import java.util.Comparator;
import nltk.metrics.association.NgramAssocMeasures;
import nltk.probability.FreqDist;
public abstract class AbstractCollocationFinder {
public FreqDist word_fd;
public FreqDist ngram_fd;
public int N;
public AbstractCollocationFinder(FreqDist word_fd,FreqDist ngram_fd){
this.word_fd=word_fd;
this.ngram_fd=ngram_fd;
this.N=word_fd.N();
}
private ArrayList<Object[]> _score_ngrams(NgramAssocMeasures score_fn){
ArrayList<Object[]> result =new ArrayList<Object[]>();
for( String tup :ngram_fd.keySet()){
String tupArr[] = tup.split(",");
Double score = score_ngram(score_fn, tupArr);
if (score != null) {
Object obj[] = new Object[2];
obj[0]=tupArr;
obj[1]=score;
result.add(obj);
}
}
return result;
}
public ArrayList<Object[]> score_ngrams( NgramAssocMeasures score_fn){
ArrayList<Object[]> score_result = _score_ngrams(score_fn);
//sort
score_result.sort(new Comparator<Object[]>() {
@Override
public int compare(Object[] o1, Object[] o2) {
int cmp = -((Double)(o1[1])).compareTo(((Double)(o2[1])));
if (cmp == 0 ) {
String s1 = ((String[])(o1[0]))[0];
String s2 = ((String[])(o2[0]))[0];
cmp = s1.compareTo(s2);
}
if (cmp == 0 ) {
String s1 = ((String[])(o1[0]))[1];
String s2 = ((String[])(o2[0]))[1];
cmp = s1.compareTo(s2);
}
return cmp;
}
});
return score_result;
}
public abstract Double score_ngram(NgramAssocMeasures score_fn,String w[]);
}
| true |
f1fa18759df49b17d37533aea81a8191df60cf14
|
Java
|
sopherwang/CodeInterview
|
/src/interviewQuestion/Permutations.java
|
UTF-8
| 1,726 | 3.53125 | 4 |
[] |
no_license
|
package interviewQuestion;
import java.util.ArrayList;
import java.util.List;
public class Permutations
{
//iterative
public ArrayList<ArrayList<Integer>> permute(int[] num)
{
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
result.add(new ArrayList<Integer>()); // add a empty list
for (int i = 0; i < num.length; i++)
{
ArrayList<ArrayList<Integer>> current = new ArrayList<ArrayList<Integer>>();
for (ArrayList<Integer> array : result)
{
for (int j = 0; j < array.size() + 1; j++)
{
array.add(j, num[i]);
ArrayList<Integer> temp = new ArrayList<Integer>(array);
current.add(temp);
array.remove(j);
}
}
result = new ArrayList<ArrayList<Integer>>(current);
}
return result;
}
//recursive
public List<List<Integer>> permuteRec(int[] num)
{
ArrayList<List<Integer>> result = new ArrayList<List<Integer>>();
ArrayList<Integer> array = new ArrayList<Integer>();
dfs(result, array, num);
return result;
}
private void dfs(ArrayList<List<Integer>> result, ArrayList<Integer> array, int[] num)
{
if (array.size() == num.length)
{
result.add(new ArrayList<Integer>(array));
}
for (int i = 0; i < num.length; i++)
{
if (array.contains(num[i]))
{
continue;
}
array.add(num[i]);
dfs(result, array, num);
array.remove(array.size() - 1);
}
}
}
| true |
5b94adbc266a39a28b0d2372bbb15592d4a874aa
|
Java
|
lamthao1995/LeetCode.com
|
/SetMismatch.java
|
UTF-8
| 487 | 2.78125 | 3 |
[] |
no_license
|
public class Solution {
public int[] findErrorNums(int[] nums) {
HashMap<Integer, Integer> map = new HashMap();
int sum = 0;
int len = nums.length;
int num1 = 0, num2 = 0;
for(int x : nums){
sum += x;
map.put(x, map.getOrDefault(x, 0) + 1);
if(map.get(x) == 2)
num1 = x;
}
num2 = len * (len + 1) / 2 - sum + num1;
return new int[]{num1, num2};
}
}
| true |
e757ff14b1e402504171ab54adf9f52c061e1305
|
Java
|
Mark-WJQ/WJQ
|
/java-base/src/main/java/com/wjq/innerclass/InterfaceInner.java
|
UTF-8
| 423 | 3.203125 | 3 |
[] |
no_license
|
package com.wjq.innerclass;
/**
* Created by wangjianqiang on 2017/11/1.
*/
public interface InterfaceInner {
void howdy();
/**
* 接口中默认static,final,嵌套类
*/
class Test implements InterfaceInner{
public void howdy() {
System.out.println("Howdy!");
}
public static void main(String[] args) {
new Test().howdy();
}
}
}
| true |
5aca0faea2b0b127f3183b68b0d94faff47b7ff6
|
Java
|
oGZo/zjgsu-abroadStu-web
|
/backend/zjgsu-abroadStu/abroadStu-service/src/test/java/test/zjgsu/abroadStu/service/CourseServiceTest.java
|
UTF-8
| 2,089 | 2.265625 | 2 |
[
"BSD-2-Clause"
] |
permissive
|
package test.zjgsu.abroadStu.service;
import com.zjgsu.abroadStu.model.CourseTemplate;
import com.zjgsu.abroadStu.service.CourseService;
import com.zjgsu.abroadStu.service.common.ExcelOperate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by JIADONG on 16/4/14.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/applicationContext.xml")
public class CourseServiceTest {
@Autowired
CourseService courseService;
@Test
public void selectCourseTemplateByProfessionIdTest(){
List<CourseTemplate> courseTemplateList = courseService.selectCourseTemplateByProfessionId(1);
System.out.println("*********************");
System.out.println(courseTemplateList.toString());
System.out.println("*********************");
}
@Test
public void insertCourseTemplateTest(){
File file = new File("/Users/JIADONG/Documents/workDocuments/courseTemplate.xlsx");
try {
List<CourseTemplate> newCourseTemplateList = new ArrayList<>();
List list = ExcelOperate.readExcel(file);
for (int i = 1; i < list.size(); i++) {
List obj = (List) list.get(i);
CourseTemplate courseTemplate = new CourseTemplate();
courseTemplate.setName(obj.get(0).toString());
courseTemplate.setProfessionId(Integer.parseInt(obj.get(1).toString()));
courseTemplate.setStartWeek(Integer.parseInt(obj.get(2).toString()));
courseTemplate.setEndWeek(Integer.parseInt(obj.get(3).toString()));
newCourseTemplateList.add(courseTemplate);
}
courseService.insertCourseTemplate(newCourseTemplateList);
} catch (IOException e) {
}
}
}
| true |
6cf6706a4ed02be9f01148e8fbba9865b7eff667
|
Java
|
SonYoonSeok/YoonSeokGG
|
/src/main/java/GameHistory/gamehistory/web/dto/ViewMatchDto.java
|
UTF-8
| 586 | 1.789063 | 2 |
[] |
no_license
|
package GameHistory.gamehistory.web.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.Map;
@Getter
@Setter
public class ViewMatchDto {
private int championId;
private String championName;
private String r_name;
private int kills;
private int deaths;
private int assists;
private double kda;
private boolean win;
private String r_win;
private int item0;
private int item1;
private int item2;
private int item3;
private int item4;
private int item5;
private int level;
private double damageAmount;
}
| true |
82076004b1a31d564d543971efd06fe9c52c15e5
|
Java
|
crakaC/DiveIntoOfuton
|
/FallIntoOfuton/src/com/crakac/ofuton/timeline/BaseTimelineFragment.java
|
SHIFT_JIS
| 11,476 | 2.046875 | 2 |
[] |
no_license
|
package com.crakac.ofuton.timeline;
import java.util.List;
import java.util.ListIterator;
import twitter4j.Twitter;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.crakac.fallintoofuton.R;
import com.crakac.ofuton.status.StatusDialogFragment;
import com.crakac.ofuton.status.StatusHolder;
import com.crakac.ofuton.status.TweetStatusAdapter;
import com.crakac.ofuton.util.AppUtil;
import com.crakac.ofuton.util.TwitterUtils;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnLastItemVisibleListener;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
public abstract class BaseTimelineFragment extends BaseStatusActionFragment {
private TweetStatusAdapter mAdapter;// statusێlistviewɕ\z
private Twitter mTwitter;
private PullToRefreshListView ptrListView;// čXVł
private ListView listView;// čXVł̒g
private View footerView, emptyView;// ԉ̂,ŏ̂
private TextView emptyText;
private ProgressBar emptyProgress;
// private GestureDetector gestureDetector;
private long sinceId = -1l, maxId = -1l;// cC[g擾ƂɎgD
AsyncTask<Void, Void, List<twitter4j.Status>> initTask, loadNewTask,
loadPreviousTask;
private final BaseTimelineFragment selfFragment;
private static final String TAG = BaseTimelineFragment.class.getSimpleName();
public BaseTimelineFragment(){
selfFragment = this;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);// CX^Xێ@ʂ]Ă擾TweetȂȂ
//setHasOptionsMenu(true);//IvVj[tOglj
}
@Override
// onCreateViewpager2ׂfragmentׂfragmentɈڂĂƂɌĂD
// \邽߂View쐬C[WŁD
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// gestureDetector = new GestureDetector(new
// MyGestureListener(getActivity()));
View view = inflater.inflate(R.layout.tweet_lists, null);
if (mAdapter == null) {
mAdapter = new TweetStatusAdapter(getActivity());
}
if (mTwitter == null){
mTwitter = TwitterUtils.getTwitterInstance(getActivity());
}
//čXVł
ptrListView = (PullToRefreshListView) view.findViewById(R.id.listView1);
ptrListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
loadNewTweets();
}
});
ptrListView
.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
loadPreviousTweets();
}
});
//gListView
listView = ptrListView.getRefreshableView();
listView.setFastScrollEnabled(true);
listView.setScrollingCacheEnabled(false);//XN[̂h~
listView.setDivider(getResources().getDrawable(R.color.dark_gray));
listView.setDividerHeight(1);
if (footerView == null) {
footerView = (View) inflater.inflate(R.layout.list_item_footer,
null);
}
listView.addFooterView(footerView);
footerView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
loadPreviousTweets();
}
});
if (emptyView == null) {
emptyView = (View) inflater.inflate(R.layout.list_item_empty, null);
}
emptyText = (TextView) emptyView.findViewById(R.id.emptyText);
emptyProgress = (ProgressBar) emptyView
.findViewById(R.id.emptyProgress);
emptyView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
initTimeline();
}
});
listView.setEmptyView(emptyView);
listView.setAdapter(mAdapter);
/*
* _u^bvƂg߂GestureDetectorg
* łꂾƃACeȂListViewŜɑăXi[쐬̂ ܂ƍsȂD
* listView.setOnTouchListener(new OnTouchListener() {
*
* @Override public boolean onTouch(View v, MotionEvent event) { return
* gestureDetector.onTouchEvent(event); } });
*/
// registerForContextMenu(listView);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
ListView lv = (ListView) parent;
twitter4j.Status status = (twitter4j.Status) lv
.getItemAtPosition(position);
StatusHolder.setStatus(status);
StatusDialogFragment dialog = new StatusDialogFragment(selfFragment);
dialog.show(getFragmentManager(), "dialog");
}
});
initTimeline();
return view;
}
// @Override
// public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
// super.onCreateContextMenu(menu, v, menuInfo);
// AdapterContextMenuInfo adapterInfo = (AdapterContextMenuInfo) menuInfo;
// menu.setHeaderTitle("Menu");
// twitter4j.Status tweet = mAdapter.getItem(adapterInfo.position - 1);
// menu.add("@" + tweet.getUser().getScreenName());
// menu.add("reply");
// menu.add("retweet");
// menu.add("favorite");
// }
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
getActivity().getMenuInflater().inflate(R.menu.timeline, menu);
super.onCreateOptionsMenu(menu, inflater);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()){
case R.id.menu_refresh :
mAdapter.clear();
mAdapter.notifyDataSetChanged();
initialStatuses();
}
return super.onOptionsItemSelected(item);
}
private void initTimeline() {
if (initTask != null
&& initTask.getStatus() == AsyncTask.Status.RUNNING) {
return;
}
if (mAdapter.getCount() > 0) {
ptrListView.setMode(Mode.PULL_FROM_START);
Log.d(TAG, "mAdapter has items." );
return;
}
initTask = new AsyncTask<Void, Void, List<twitter4j.Status>>() {
@Override
protected void onPreExecute() {
super.onPreExecute();
if (emptyView.isEnabled()) {
setEmptyViewLoading();
}
}
@Override
protected List<twitter4j.Status> doInBackground(Void... params) {
return initialStatuses();
}
@Override
protected void onPostExecute(List<twitter4j.Status> result) {
if (result != null) {
for (twitter4j.Status status : result) {
mAdapter.add(status);
}
if (result.size() > 0) {
maxId = result.listIterator(result.size()).previous()
.getId();
sinceId = result.iterator().next().getId();
mAdapter.notifyDataSetChanged();
}
ptrListView.setMode(Mode.PULL_FROM_START);
} else {
AppUtil.showToast(getActivity(), "fail to get Tilmeline");
setEmptyViewStandby();
}
}
};
initTask.execute();
}
private void loadNewTweets() {
if (loadNewTask != null
&& loadNewTask.getStatus() == AsyncTask.Status.RUNNING) {
return;
}
loadNewTask = new AsyncTask<Void, Void, List<twitter4j.Status>>() {
@Override
protected List<twitter4j.Status> doInBackground(Void... params) {
return newStatuses(sinceId, 200);
}
@Override
protected void onPostExecute(List<twitter4j.Status> result) {
if (result != null) {
int lastPos = listView.getFirstVisiblePosition();//VstatusljÖԏ̃|WVێ
for (ListIterator<twitter4j.Status> ite = result
.listIterator(result.size()); ite.hasPrevious();) {
mAdapter.insert(ite.previous(), 0);
}
if (result.size() > 0) {
sinceId = result.iterator().next().getId();
mAdapter.notifyDataSetChanged();
//܂肤܂ƂĂȂۂD
listView.setSelection(lastPos + result.size());//lj炷
}
} else {
AppUtil.showToast(getActivity(), "fail to get Tilmeline");
}
ptrListView.onRefreshComplete();
}
};
loadNewTask.execute();
}
private void loadPreviousTweets() {
if (loadPreviousTask != null
&& loadPreviousTask.getStatus() == AsyncTask.Status.RUNNING) {
return;
}
loadPreviousTask = new AsyncTask<Void, Void, List<twitter4j.Status>>() {
TextView tv;
ProgressBar pb;
String readMore;
@Override
protected void onPreExecute() {
super.onPreExecute();
tv = (TextView) footerView.findViewById(R.id.listFooterText);
tv.setText(getResources().getString(R.string.now_loading));
pb = (ProgressBar) footerView
.findViewById(R.id.listFooterProgress);
pb.setVisibility(View.VISIBLE);
readMore = getResources().getString(R.string.read_more);
}
@Override
protected List<twitter4j.Status> doInBackground(Void... params) {
return previousStatuses(maxId, 50);
}
@Override
protected void onPostExecute(List<twitter4j.Status> result) {
if (result != null) {
for (twitter4j.Status status : result) {
mAdapter.add(status);
}
if (result.size() > 0) {
maxId = result.listIterator(result.size()).previous()
.getId();
mAdapter.notifyDataSetChanged();
}
} else {
failToGetStatuses();
}
tv.setText(readMore);
pb.setVisibility(View.GONE);
}
};
loadPreviousTask.execute();
}
private void setEmptyViewLoading() {
emptyText.setText(getResources().getString(R.string.now_loading));
emptyProgress.setVisibility(View.VISIBLE);
ptrListView.setMode(Mode.DISABLED);
}
private void setEmptyViewStandby() {
if (emptyText != null && emptyProgress != null)
emptyText.setText(getResources().getString(R.string.tap_to_reload));
emptyProgress.setVisibility(View.GONE);
}
/**
* ԍŏɌĂԓzD
*
* @return
*/
abstract List<twitter4j.Status> initialStatuses();
/**
* XVƂɌĂԂ
*
* @param sinceId
* @param count
* @return
*/
abstract List<twitter4j.Status> newStatuses(long sinceId, int count);
/**
* ÂcC[g擾ƂɌĂԓz
*
* @param maxId
* @param count
* @return
*/
abstract List<twitter4j.Status> previousStatuses(long maxId, int count);
/**
* 擾ɎsɂԂ
*
*/
abstract void failToGetStatuses();
/**
* FragmentPagerAdapterɓnă^Cg\邽߂̂
*
* @return
*/
public abstract String getTimelineName();
}
| true |
73663e7ca86c3f4b51a65325781a9fe5325ef563
|
Java
|
wqh0109663/transfer
|
/src/org/unswift/gtft/transfer/service/impl/DataSourceService.java
|
UTF-8
| 5,399 | 2.140625 | 2 |
[] |
no_license
|
package org.unswift.gtft.transfer.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.unswift.core.utils.ObjectUtils;
import org.unswift.core.utils.StringUtils;
import org.unswift.gtft.transfer.pojo.DataSource;
import org.unswift.core.pojo.Page;
import org.unswift.gtft.transfer.service.IDataSourceService;
import org.unswift.gtft.transfer.dao.IDataSourceMapper;
import org.unswift.core.annotations.Cache;
import org.unswift.core.annotations.CacheClear;
import org.unswift.core.conn.Session;
import org.unswift.core.conn.SessionFactory;
import org.unswift.core.exception.UnswiftException;
import org.unswift.core.pojo.DeletePojo;
import org.unswift.core.pojo.OrderNoMovePojo;
import org.unswift.core.pojo.StatusPojo;
/**
* 数据源Service(封装各种业务操作)
* @author Administrator
*
*/
@Service("dataSourceService")
@Transactional(propagation=Propagation.NOT_SUPPORTED, rollbackFor=Exception.class)
public class DataSourceService implements IDataSourceService{
@Resource
private IDataSourceMapper dataSourceMapper;
@Override
public Page findPageList(Page page, DataSource dataSource){
List<DataSource> dataSourceList=dataSourceMapper.findPageList(page, dataSource);
page.setData(dataSourceList);
return page;
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
@CacheClear("findDataSourceList")//清空缓存,allEntries变量表示所有对象的缓存都清除
public void saveDataSource(DataSource dataSource){
dataSource.setId(StringUtils.uuid());
dataSource.setOrderNo(dataSourceMapper.findMax(null)+1);
dataSource.setStatus(1);
dataSourceMapper.insert(dataSource);
}
@Override
public DataSource findById(String id) {
return dataSourceMapper.findById(id);
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
@CacheClear("findDataSourceList")//清空缓存,allEntries变量表示所有对象的缓存都清除
public void updateDataSource(DataSource dataSource){
dataSourceMapper.updateById(dataSource);
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
@CacheClear("findDataSourceList")//清空缓存,allEntries变量表示所有对象的缓存都清除
public void deleteDataSource(String id){
dataSourceMapper.deleteById(new DataSource(id));
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
@CacheClear("findDataSourceList")//清空缓存,allEntries变量表示所有对象的缓存都清除
public void moveDataSource(String id, String operator) {
DataSource dataSource=dataSourceMapper.findById(id);
int orderNo=dataSource.getOrderNo();
if(operator.equals("down")){
DataSource after=dataSourceMapper.findAfter(orderNo);
if(after!=null){
dataSourceMapper.updateOrderNo(new OrderNoMovePojo(dataSource.getId(), after.getOrderNo(), after.getId(), orderNo));
}
}else{
DataSource before=dataSourceMapper.findBefore(orderNo);
if(before!=null){
dataSourceMapper.updateOrderNo(new OrderNoMovePojo(dataSource.getId(), before.getOrderNo(), before.getId(), orderNo));
}
}
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
@CacheClear("findDataSourceList")//清空缓存,allEntries变量表示所有对象的缓存都清除
public void deleteDataSources(String[] ids) {
dataSourceMapper.deleteDataSources(new DeletePojo(ids));
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public void deleteRecycles(String[] ids) {
dataSourceMapper.deleteRecycles(ids);
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public void clearRecycle() {
dataSourceMapper.clearRecycle();
}
@Override
@Transactional(propagation=Propagation.REQUIRED)
public void recoveryRecycles(String[] ids) {
dataSourceMapper.updateStatus(new StatusPojo(ids, 1));
}
@Override
@Cache("findDataSourceList")
public List<DataSource> findAllList(String type) {
DataSource task=new DataSource();
task.setStatus(1);
return dataSourceMapper.findList(task);
}
@Override
public void connDataSource(DataSource dataSource) {
Session session=null;
try {
session=createSession(dataSource);
session.test();
} catch (Exception e) {
e.printStackTrace();
throw new UnswiftException(e.getMessage());
} finally {
if(ObjectUtils.isNotEmpty(session)){
session.close();
}
}
}
@Override
public Session createSession(DataSource dataSource) {
if(dataSource.getType().equals("db-conn")){
return SessionFactory.newJdbcSession(dataSource.getDbType(), dataSource.getDbDriver(),
dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());
}else{
return SessionFactory.newHttpSession(dataSource.getDbType(), dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());
}
}
@Override
public Session createTransactionSession(DataSource dataSource) {
if(dataSource.getType().equals("db-conn")){
return SessionFactory.newJdbcTransactionSession(dataSource.getDbType(), dataSource.getDbDriver(),
dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());
}else{
return SessionFactory.newHttpSession(dataSource.getDbType(), dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());
}
}
}
| true |
f20e2727af8bbb8e1b0bb08786efc4efcfd8e3b6
|
Java
|
andiads/JavaExercises
|
/src/iofs/Exercise1.java
|
UTF-8
| 542 | 2.40625 | 2 |
[] |
no_license
|
/*
* 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 iofs;
import java.io.File;
import java.util.Date;
/**
*
* @author ANDI DWI SAPUTRO
*/
public class Exercise1 {
public static void main(String[] args) {
File file = new File("C:/Users/x/Documents/GitHub");
String[] fileList = file.list();
for (String name : fileList) {
System.out.println(name);
}
}
}
| true |
b70b3ab0f80cccbd6580800c1de0f3dc697fe112
|
Java
|
cocktail-api/cocktails-server
|
/src/main/java/de/slevermann/cocktails/controller/UserController.java
|
UTF-8
| 2,301 | 2.140625 | 2 |
[
"Apache-2.0"
] |
permissive
|
package de.slevermann.cocktails.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.slevermann.cocktails.api.UsersApi;
import de.slevermann.cocktails.mapper.UserInfoMapper;
import de.slevermann.cocktails.dto.UserInfo;
import de.slevermann.cocktails.service.AuthenticationService;
import de.slevermann.cocktails.service.UserService;
import org.hibernate.validator.constraints.Length;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Optional;
import java.util.UUID;
@RestController
@RequestMapping("/api")
public class UserController implements UsersApi {
private final UserService userService;
private final AuthenticationService authenticationService;
private final UserInfoMapper userInfoMapper;
public UserController(UserService userService, AuthenticationService authenticationService, UserInfoMapper userInfoMapper) {
this.userService = userService;
this.authenticationService = authenticationService;
this.userInfoMapper = userInfoMapper;
}
@Override
public Optional<ObjectMapper> getObjectMapper() {
return Optional.empty();
}
@Override
public Optional<HttpServletRequest> getRequest() {
return Optional.empty();
}
@Override
@PreAuthorize("isAuthenticated()")
public ResponseEntity<UserInfo> getUserInfo() {
return ResponseEntity.ok(userInfoMapper.dbUserInfoToUserInfo(authenticationService.getUserDetails()));
}
@Override
@PreAuthorize("isAuthenticated()")
public ResponseEntity<Void> setNick(@Pattern(regexp = "^[\\p{L}0-9]+(\\.[\\p{L}0-9]+)*$") @Size(min = 1, max = 30) String body) {
userService.updateNick(body, authenticationService.getUserDetails().getUuid());
return ResponseEntity.ok().build();
}
@Override
public ResponseEntity<UserInfo> getProfile(UUID uuid) {
return ResponseEntity.ok(userService.getById(uuid));
}
}
| true |
4a5a7e42f96019135e85587ae7166cf311493a7e
|
Java
|
Phantoms007/zhihuAPK
|
/src/main/java/com/fasterxml/jackson/p519b/p527h/Separators.java
|
UTF-8
| 1,014 | 2.046875 | 2 |
[] |
no_license
|
package com.fasterxml.jackson.p519b.p527h;
import java.io.Serializable;
/* renamed from: com.fasterxml.jackson.b.h.l */
/* compiled from: Separators */
public class Separators implements Serializable {
private static final long serialVersionUID = 1;
/* renamed from: a */
private final char f19598a;
/* renamed from: b */
private final char f19599b;
/* renamed from: c */
private final char f19600c;
/* renamed from: a */
public static Separators m24563a() {
return new Separators();
}
public Separators() {
this(':', ',', ',');
}
public Separators(char c, char c2, char c3) {
this.f19598a = c;
this.f19599b = c2;
this.f19600c = c3;
}
/* renamed from: b */
public char mo29780b() {
return this.f19598a;
}
/* renamed from: c */
public char mo29781c() {
return this.f19599b;
}
/* renamed from: d */
public char mo29782d() {
return this.f19600c;
}
}
| true |
fd541824bfb64079535abd8f226f272a4fc946ea
|
Java
|
mahbuba102/JavaSmallProblems
|
/src/Problems.java
|
UTF-8
| 2,241 | 3.84375 | 4 |
[] |
no_license
|
public class Problems {
private static void printFibonacciSeries() {
int n = 20;
int temp1 = 1;
int temp2 = 1;
int result = 0;
System.out.println("Printing fibonacci series :");
System.out.print(temp1+" ");
System.out.print(temp2+" ");
for(int i = 1;i<=n;i++){
result = temp1+temp2;
if(result<20)
System.out.print(result+" ");
temp2 = temp1;
temp1 = result;
}
System.out.println();
}
private static void printLongestPalindrome() {
String text = "Marry";
boolean isPalindromicSubstring = false;
int subStringStart = 0;
int subStringLength = 0;
for(int i =0;i<=text.length()-1;i++){
if(text.charAt(i)!=text.charAt(text.length()-1-i))
continue;
else{
if(text.charAt(i)==text.charAt(text.length()-i)){
isPalindromicSubstring = true;
System.out.println(text.charAt(i));
subStringStart = text.indexOf(text.charAt(i));
subStringLength++;
}
}
}
if(isPalindromicSubstring ){
System.out.println("Substring start :="+subStringStart+" "+"Substring Length :="+subStringLength);
System.out.println("Longest Palindromic Substring is : "+text.substring(subStringStart,subStringStart+ subStringLength));
}
}
private static void checkPalindrome() {
String text = "noon";
boolean isPalin = true;
if(text.length()==0){
isPalin = false;
}
else if(text.charAt(0)!=text.charAt(text.length()-1)){
isPalin = false;
}
else{
for(int i=1;i<=text.length()-1;i++){
if(text.charAt(i)!=text.charAt(text.length()-1-i)){
isPalin = false;
}
}
}
if(isPalin){
System.out.println("It is a palindrome");
}
else{
System.out.println("It is not a palindrome");
}
}
private static void power() {
int base = 2;
int power = 0;
int result = 1;
if(power==0){
System.out.println(base+"^"+power+"="+result);
}
else if (power==1){
System.out.println(base+"^"+power+"="+base);
}
else{
for(int i = 0;i<4;i++){
result*=base;
}
}
System.out.println(base+"^"+power+"="+result);
}
public static void main(String[] args) {
//printFibonacciSeries();
//checkPalindrome();
//printLongestPalindrome();
power();
char c = 8;
System.out.println(c*c);
}
}
| true |
6bd381be9faa61d9f078641739dc97d0387b27ba
|
Java
|
Mati02K/Publicsectorservice
|
/src/publicsectorservice/DOWNLOADFORMS.java
|
UTF-8
| 9,092 | 2.234375 | 2 |
[] |
no_license
|
/*
* 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 publicsectorservice;
import javax.swing.JOptionPane;
/**
*
* @author Admin
*/
public class DOWNLOADFORMS extends javax.swing.JFrame {
/**
* Creates new form DOWNLOADFORMS
*/
public DOWNLOADFORMS() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox<>();
jButton1 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel2.setFont(new java.awt.Font("Arial Black", 1, 24)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 51, 153));
jLabel2.setText("MARJ HELPLINE CENTRE");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 30, 380, 50));
jLabel1.setFont(new java.awt.Font("Arial Black", 1, 14)); // NOI18N
jLabel1.setText("DOWNLOAD VARIOUS KINDS OF FORMS HERE");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 120, 440, -1));
jLabel3.setText("SELECT THE FORM WHICH YOU WANT TO DOWNLOAD");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 220, 460, 60));
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { " Aadhar card form", "Driving Licence form", "Medical Certifcate", "PAN Card Application Form", "Marriage Registration", "Surrender of Permit and clearance", "Encumbrance certificate", "Authorization of tourist permit", "Passport Application Form", "Trade Certficate", " " }));
getContentPane().add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(454, 239, 200, 30));
jButton1.setText("Download");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 370, 120, 40));
jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\039fee8fdd06a3ac415798d0757e2b51.jpg")); // NOI18N
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 110, 770, 400));
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
switch(jComboBox1.getSelectedIndex())
{
case 0: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\aadhar new and correction form.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 1: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\DRIVING LICENCE FORM.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 2: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\MEDICAL CERTFICATE.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 3: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\PAN FORM.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 4: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\Marriage registration.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 5: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\Surrender of permit and clearance.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 6: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\Encumbrance certificate.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 7: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\Authorization for tourist permit.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 8: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\PASSPORT APPLICATION FORM.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
case 9: try{
Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler "+"C:\\Users\\Admin\\Desktop\\NETBEANS PROJECT\\publicsectorservice\\Trade certificate.pdf");
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage());
}
break;
}
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DOWNLOADFORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DOWNLOADFORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DOWNLOADFORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DOWNLOADFORMS.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DOWNLOADFORMS().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
// End of variables declaration//GEN-END:variables
}
| true |
b6d3d1f15f42d8b62641772982c0ac136b5b4e17
|
Java
|
scwang90/WifiSurfing
|
/src/main/java/com/simpletech/wifisurfing/dao/impl/LoginDaoImpl.java
|
UTF-8
| 1,018 | 2.140625 | 2 |
[] |
no_license
|
package com.simpletech.wifisurfing.dao.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.simpletech.wifisurfing.dao.base.BaseDaoImpl;
import com.simpletech.wifisurfing.dao.LoginDao;
import com.simpletech.wifisurfing.model.Login;
/**
* 数据库表t_login的Dao实现
* @author 树朾
* @date 2015-11-20 15:47:21 中国标准时间
*/
@Repository
public class LoginDaoImpl extends BaseDaoImpl<Login> implements LoginDao{
@Override
public int insert(Login t) {
return super.insert(t);
}
@Override
public int update(Login t) {
return super.update(t);
}
@Override
public int delete(Object id) {
return super.delete(id);
}
@Override
public int countAll() {
return super.countAll();
}
@Override
public Login findById(Object id) {
return super.findById(id);
}
@Override
public List<Login> findAll() {
return super.findAll();
}
@Override
public List<Login> findByPage(int limit, int start) {
return super.findByPage(limit, start);
}
}
| true |
6b0920cc4c156942ba8701f95c7416e3c1354a43
|
Java
|
Valemos/discord_anime_bot
|
/src/main/java/bot/commands/user/squadron/PatrolCommand.java
|
UTF-8
| 1,718 | 2.75 | 3 |
[] |
no_license
|
package bot.commands.user.squadron;
import bot.commands.AbstractCommand;
import com.jagrosh.jdautilities.command.CommandEvent;
import game.AnimeCardsGame;
import game.player_objects.squadron.PatrolType;
import game.player_objects.squadron.Squadron;
import org.kohsuke.args4j.Argument;
import java.time.Instant;
public class PatrolCommand extends AbstractCommand<PatrolCommand.Arguments> {
public static class Arguments{
PatrolType patrolType;
@Argument(metaVar = "patrol world (o - overworld, u - underworld)", usage = "type of world to send current squadron to", required = true)
public void setPatrolWorld(PatrolType patrolType) {
this.patrolType = PatrolType.getTypeNameFromAlias(patrolType);
}
}
public PatrolCommand(AnimeCardsGame game) {
super(game, Arguments.class);
name = "patrol";
aliases = new String[]{"p"};
}
@Override
public void handle(CommandEvent event) {
Squadron squadron = game.getOrCreateSquadron(player);
if (squadron.isEmpty()){
sendMessage(event, "your squadron is empty");
} else if (squadron.getPatrol().isBusy()) {
sendMessage(event,
"you have already active patrol in "
+ squadron.getPatrol().getPatrolType().getTypeName() + ":\n"
+ squadron.getDescription());
} else {
game.createNewPatrol(player, commandArgs.patrolType, Instant.now());
sendMessage(event,
"your heroes started " +
commandArgs.patrolType.getTypeName() +
" exploration");
}
}
}
| true |
db770aad9b2bb9b105bcb1248362c330e6357ec8
|
Java
|
antuan1996/oracle-aggregator
|
/src/main/java/io/university/model/dao/oracle/OPerson.java
|
UTF-8
| 4,420 | 2.28125 | 2 |
[
"MIT"
] |
permissive
|
package io.university.model.dao.oracle;
import io.dummymaker.annotation.complex.GenEnum;
import io.dummymaker.annotation.complex.GenTime;
import io.dummymaker.annotation.simple.string.GenCity;
import io.dummymaker.annotation.simple.string.GenName;
import io.dummymaker.annotation.simple.string.GenSurname;
import io.dummymaker.annotation.special.GenEmbedded;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
/**
* ! NO DESCRIPTION !
*
* @author GoodforGod
* @since 16.02.2019
*/
@Entity
public class OPerson implements Serializable {
public enum PersonType {
STUDENT,
TEACHER
}
@Id
@GeneratedValue
private Integer id;
@GenName
private String name;
@GenName
private String middleName;
@GenSurname
private String surname;
@GenTime
private Timestamp birthTimestamp;
@GenCity
private String birthPlace;
@GenEnum
private PersonType type;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name = "schedule_mapper",
joinColumns = { @JoinColumn(name = "person_id") },
inverseJoinColumns = { @JoinColumn(name = "schedule_id") }
)
private Set<OSchedule> schedules = new HashSet<>();
@OneToMany(mappedBy = "person", cascade = CascadeType.ALL)
private Set<OGrade> grades = new HashSet<>();
@GenEmbedded
@OneToOne(mappedBy = "person", cascade = CascadeType.ALL)
private OWorkHistory workHistory;
@GenEmbedded
@OneToOne(mappedBy = "person", cascade = CascadeType.ALL)
private OStudy study;
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public String getMiddleName() {
return middleName;
}
public String getSurname() {
return surname;
}
public Timestamp getBirthTimestamp() {
return birthTimestamp;
}
public String getBirthPlace() {
return birthPlace;
}
public OStudy getStudy() {
return study;
}
public PersonType getType() {
return type;
}
public OWorkHistory getWorkHistory() {
return workHistory;
}
public Set<OSchedule> getSchedules() {
return schedules;
}
public OSchedule addSchedule(OSchedule schedule) {
this.schedules.add(schedule);
return schedule;
}
public Set<OGrade> getGrades() {
return grades;
}
public OGrade addGrade(OGrade grade) {
this.grades.add(grade);
grade.setPerson(this);
return grade;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OPerson person = (OPerson) o;
if (id != person.id) return false;
if (name != null ? !name.equals(person.name) : person.name != null) return false;
if (middleName != null ? !middleName.equals(person.middleName) : person.middleName != null) return false;
if (surname != null ? !surname.equals(person.surname) : person.surname != null) return false;
if (birthTimestamp != null ? !birthTimestamp.equals(person.birthTimestamp) : person.birthTimestamp != null)
return false;
if (birthPlace != null ? !birthPlace.equals(person.birthPlace) : person.birthPlace != null) return false;
if (type != person.type) return false;
if (workHistory != null ? !workHistory.equals(person.workHistory) : person.workHistory != null) return false;
return study != null ? study.equals(person.study) : person.study == null;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (middleName != null ? middleName.hashCode() : 0);
result = 31 * result + (surname != null ? surname.hashCode() : 0);
result = 31 * result + (birthTimestamp != null ? birthTimestamp.hashCode() : 0);
result = 31 * result + (birthPlace != null ? birthPlace.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (workHistory != null ? workHistory.hashCode() : 0);
result = 31 * result + (study != null ? study.hashCode() : 0);
return result;
}
}
| true |
45b06ddbc77d41aa8f38ef52fdedc1cfc086d26d
|
Java
|
cheng2016/AppModel
|
/app/src/main/java/com/uniaip/android/home/invoice/activity/SearchShopActivity.java
|
UTF-8
| 4,346 | 2.078125 | 2 |
[
"Apache-2.0"
] |
permissive
|
package com.uniaip.android.home.invoice.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.baidu.mapapi.search.core.PoiInfo;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.poi.OnGetPoiSearchResultListener;
import com.baidu.mapapi.search.poi.PoiCitySearchOption;
import com.baidu.mapapi.search.poi.PoiDetailResult;
import com.baidu.mapapi.search.poi.PoiIndoorResult;
import com.baidu.mapapi.search.poi.PoiResult;
import com.baidu.mapapi.search.poi.PoiSearch;
import com.uniaip.android.R;
import com.uniaip.android.base.BaseActivity;
import com.uniaip.android.home.invoice.adapter.MapDataAdapter;
import com.uniaip.android.home.invoice.models.CheckInfo;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/**
* 搜索商家
* 作者: ysc
* 时间: 2017/2/18
*/
public class SearchShopActivity extends BaseActivity {
@BindView(R.id.prv_search_list)
ListView mPrvList;
@BindView(R.id.tv_title_right)
TextView mTvRight;
@BindView(R.id.et_search_input)
EditText mEtInput;
@BindView(R.id.lay_map_search)
LinearLayout mLaySearch;
private MapDataAdapter mAdp;
private String city;
private PoiSearch mPoiSearch;
private List<PoiInfo> dataList = new ArrayList<>();//商家列表数据
@Override
protected int getLayoutID() {
return R.layout.activity_search_shop;
}
@Override
protected void init(Bundle savedInstanceState) {
initView();
getListener();
initData();
}
private void initView() {
mTvRight.setText("搜索");
mAdp = new MapDataAdapter(this);
mPrvList.setAdapter(mAdp);
mLaySearch.setVisibility(View.VISIBLE);
}
/**
* 初始化监听
*/
private void getListener() {
mPrvList.setOnItemClickListener((parent, view, position, id) -> {
PoiInfo poi = dataList.get(position);
Intent intent = new Intent();
intent.putExtra("address", new CheckInfo(poi.name, poi.city, poi.address, poi.location.longitude, poi.location.latitude));
setResult(1201, intent);
finish();
});
mTvRight.setOnClickListener(v -> {
if (!TextUtils.equals(mEtInput.getText().toString(), "")) {
searchKeyword(mEtInput.getText().toString());
} else {
toast("请输入商家名称");
}
});
}
private void initData() {
mPoiSearch = PoiSearch.newInstance();
city = getIntent().getStringExtra("city");
}
OnGetPoiSearchResultListener getCityInfo = new OnGetPoiSearchResultListener() {
@Override
public void onGetPoiResult(PoiResult poiResult) {
dismissProgress();
if (poiResult.error == SearchResult.ERRORNO.NO_ERROR && poiResult.getAllPoi() != null) {
if (poiResult.getAllPoi().size() > 0) {
dataList.clear();
dataList.addAll(poiResult.getAllPoi());
mAdp.setDataList(dataList);
mAdp.notifyDataSetChanged();
} else {
toast("未搜索到相关数据");
}
} else {
toast("未搜索到相关数据");
}
}
@Override
public void onGetPoiDetailResult(PoiDetailResult poiDetailResult) {
}
@Override
public void onGetPoiIndoorResult(PoiIndoorResult poiIndoorResult) {
}
};
/**
* 关键字搜索
*
* @param str
*/
private void searchKeyword(final String str) {
showProgress();
new Thread(() -> {
Looper.prepare();
mPoiSearch.setOnGetPoiSearchResultListener(getCityInfo);
PoiCitySearchOption cityOption = new PoiCitySearchOption();
cityOption.city(city);
cityOption.keyword(str);
cityOption.pageCapacity(50);
mPoiSearch.searchInCity(cityOption);
Looper.loop();
}).start();
}
}
| true |
0b82e0f66d0247927636b4176da58cfb8fb861f4
|
Java
|
SebastianTroy/Pong
|
/Pong/AI.java
|
UTF-8
| 2,167 | 3.046875 | 3 |
[] |
no_license
|
package Pong;
import TroysCode.Constants;
import TroysCode.Tools;
public class AI implements Constants
{
private int difficulty = AI_MEDIUM;
private boolean moveUp = false;
private boolean moveDown = false;
private int aboveLead = 2;
private int belowLead = 50;
private double timedHold = 0;
private int buttonHeld = KEY_NONE;
Paddle pad;
public AI(Paddle owner)
{
pad = owner;
}
public final void tick(double secondsPassed, int ballY, int ballX)
{
moveUp = false;
moveDown = false;
if (difficulty != AI_OFF)
{
if (Math.abs(ballX - pad.getX()) < 350)
{
if (ballY < pad.getY() + aboveLead)
moveUp = true;
if (ballY > pad.getY() + belowLead)
moveDown = true;
}
else if (difficulty == AI_HARD)
{
if (pad.getY() < 300)
pad.moveDown(secondsPassed);
else if (pad.getY() > 300)
pad.moveUp(secondsPassed);
}
else if (difficulty != AI_HARD)
{
if (timedHold > 0)
{
timedHold -= secondsPassed;
switch (buttonHeld)
{
case (KEY_W):
moveUp = true;
moveDown = false;
break;
case (KEY_S):
moveUp = false;
moveDown = true;
break;
}
}
else
{
moveUp = false;
moveDown = false;
timedHold = Tools.randDouble(0.15, 0.73);
buttonHeld = Tools.randBool() ? KEY_W : KEY_S;
}
}
if (moveUp)
pad.moveUp(secondsPassed);
if (moveDown)
pad.moveDown(secondsPassed);
if (Tools.randPercent() > 99 - difficulty)
{
belowLead += Tools.randInt(-difficulty, difficulty);
aboveLead += Tools.randInt(-difficulty, difficulty);
if (Tools.randPercent() > 95 + difficulty)
{
aboveLead = 2;
belowLead = 50;
}
}
}
}
public final void setDifficulty(int difficulty)
{
this.difficulty = difficulty;
}
public int getDifficulty()
{
return difficulty;
}
}
| true |
d963f9b89b31613f515d1b3c03d7df5aa8e42b9d
|
Java
|
Sarath0420/TestNgFramework
|
/src/test/java/org/adactinhotel/ConfirmationPage.java
|
UTF-8
| 552 | 1.898438 | 2 |
[] |
no_license
|
package org.adactinhotel;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class ConfirmationPage extends HotelDeatils
{
public ConfirmationPage()
{
PageFactory.initElements(driver, this);
}
@FindBy(id="radiobutton_0")
private WebElement radiobutton;
@FindBy(id="continue")
private WebElement continueButton;
public WebElement getRadiobutton() {
return radiobutton;
}
public WebElement getContinueButton() {
return continueButton;
}
}
| true |
716c0757cf5ee7104a5c34850dbf84b438728773
|
Java
|
LyhAndroid/Kalle
|
/kalle/src/main/java/com/yanzhenjie/kalle/simple/Work.java
|
UTF-8
| 2,181 | 2.375 | 2 |
[
"Apache-2.0"
] |
permissive
|
/*
* Copyright © 2018 Zhenjie Yan.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yanzhenjie.kalle.simple;
import com.yanzhenjie.kalle.Canceller;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
/**
* Created by Zhenjie Yan on 2018/2/13.
*/
final class Work<T extends SimpleRequest, S, F> extends FutureTask<SimpleResponse<S, F>> implements Canceller {
private BasicWorker<T, S, F> mWorker;
private final Callback<S, F> mCallback;
Work(BasicWorker<T, S, F> work, Callback<S, F> callback) {
super(work);
this.mWorker = work;
this.mCallback = callback;
}
@Override
public void run() {
mCallback.onStart();
super.run();
}
@Override
protected void done() {
try {
mCallback.onResponse(get());
} catch (CancellationException e) {
mCallback.onCancel();
} catch (ExecutionException e) {
Throwable cause = e.getCause();
if (isCancelled()) {
mCallback.onCancel();
} else if (cause != null && cause instanceof Exception) {
mCallback.onException((Exception) cause);
} else {
mCallback.onException(new Exception(cause));
}
} catch (Exception e) {
if (isCancelled()) {
mCallback.onCancel();
} else {
mCallback.onException(e);
}
}
mCallback.onEnd();
}
@Override
public void cancel() {
cancel(true);
mWorker.cancel();
}
}
| true |
05ff9b87be5d9a410bd8103ae125a7c970420dc9
|
Java
|
karentwan/yiyituan
|
/src/cn/yiyituan/action/ProjectEditAction.java
|
UTF-8
| 2,434 | 2.078125 | 2 |
[
"MIT"
] |
permissive
|
package cn.yiyituan.action;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import cn.yiyituan.model.Project;
import cn.yiyituan.service.ProjectService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
* 添加创新项目的编辑接口
* @author wan
*/
@Controller
@Scope("prototype")
public class ProjectEditAction extends ActionSupport{
private Long id;
private String name;
private String charge;
private String origin;
private String date;
@Resource
private ProjectService projectService;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCharge() {
return charge;
}
public void setCharge(String charge) {
this.charge = charge;
}
public String getOrigin() {
return origin;
}
public void setOrigin(String origin) {
this.origin = origin;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String modify() throws ParseException {
Project p = projectService.getById(id);
p.setCharge(charge);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sdf.parse(date);
p.setDate(d);
p.setName(name);
p.setOrigin(origin);
projectService.modify(p);
return "modify";
}
public String delete() {
projectService.delete(id);
return "delete";
}
public String list() {
List<Project> list = projectService.findAll();
ActionContext.getContext().put("list", list);
return "list";
}
public String save() throws ParseException {
Project p = new Project();
p.setCharge(charge);
p.setName(name);
p.setOrigin(origin);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sdf.parse(date);
p.setDate(d);
projectService.save(p);
return "save";
}
public String edit() throws ParseException {
Project p = new Project();
p.setCharge(charge);
p.setName(name);
p.setOrigin(origin);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sdf.parse(date);
p.setDate(d);
projectService.save(p);
return SUCCESS;
}
}
| true |
3c7aef8634d35d3cee8f3090296de53784ecbd46
|
Java
|
royeson/BNUtalk_Client-master
|
/src/com/bnutalk/ui/AddContactsActivity.java
|
UTF-8
| 7,545 | 1.835938 | 2 |
[] |
no_license
|
package com.bnutalk.ui;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.database.DefaultDatabaseErrorHandler;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.MediaStore.Video;
import android.provider.SyncStateContract.Helpers;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.bnutalk.server.AHttpAddContacts;
import com.bnutalk.ui.R;
import com.bnutalk.util.ContactEntity;
import com.bnutalk.util.DBopenHelper;
import com.bnutalk.util.FlingAdapterView;
import com.bnutalk.util.UserEntity;
import java.security.PublicKey;
import java.util.ArrayList;
//import java.util.List;
import java.util.List;
import org.apache.commons.logging.Log;
public class AddContactsActivity extends Activity {
// private ArrayList<CardMode> al;
private List<UserEntity> list;
// private ArrayList<ImageView> iv;
// 定义一个cardmode的数组al
private CardAdapter adapter;
// 定义一个card的适配器
private int i;
// 定义滑动卡片的容器
private FlingAdapterView flingContainer;
// 定义一个string类型的数组
// private List<List<String>> list = new ArrayList<>();
// 定义下面的左右喜欢喝不喜欢的图片
private ImageView left, right, music;
private Handler handler;
private String uid,cuid,nick;
private DBopenHelper helper;
private SharedPreferences pref;
private Editor editor;
private PopupWindow popupWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_addfriend_main);
initEvent();
// new AHttpAddContacts(list, uid, handler,helper).getAllUser();
new AHttpAddContacts(list, uid, handler, helper).getAllUser();
}
/**
* init
*/
public void initEvent() {
uid = "201211011063";
// 定义左边和右边的图片,和监听
left = (ImageView) findViewById(R.id.left);
right = (ImageView) findViewById(R.id.right);
music = (ImageView) findViewById(R.id.iv_card_flag6);
list = new ArrayList<UserEntity>();
adapter = new CardAdapter(AddContactsActivity.this, list);
helper=new DBopenHelper(getApplicationContext());
left.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
left();
}
});
right.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
right();
}
});
defHandler();
defFling();
//read user cards from local cache to show first
helper.getUserCard(list);
adapter.notifyDataSetChanged();
pref = getSharedPreferences("user_login", 0);
editor = pref.edit();
String cacheUid = pref.getString("uid", "");
if (cacheUid != null) {
uid=cacheUid;
}
//update database
helper.updateDb();
if(list.size()==0)
{
Toast toast=Toast.makeText(AddContactsActivity.this, "正在加载数据,请耐心等待!(产品组帮我翻译成英文!)", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
}
/**
* define handler operation
*/
public void defHandler()
{
handler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case AHttpAddContacts.GET_USER_SUCCESS:
android.util.Log.v("msg.what", "AHttpGetAllUser.GET_USER_SUCCESS");
// show listview
adapter.notifyDataSetChanged();
break;
case AHttpAddContacts.GET_USER_FAILED:
// unable to access server
Toast toast=Toast.makeText(AddContactsActivity.this, "unable to access server!", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
break;
case AHttpAddContacts.NOT_BEFRIEND:
break;
case AHttpAddContacts.BEFRIEND:*/
if (null != popupWindow) {
popupWindow.dismiss();
return;
} else {
initPopupWindow();
}
popupWindow.showAtLocation(findViewById(android.R.id.content).getRootView(),
Gravity.CENTER, 0, 0);
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = 0.87f;
getWindow().setAttributes(lp);
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = 1.0f;
getWindow().setAttributes(lp);
}
});
//Toast.makeText(AddContactsActivity.this, "you and "+nick+"have been friend!", Toast.LENGTH_LONG).show();
break;
default:
break;
}
}
};
}
protected void initPopupWindow()
{
View popupWindow_view = getLayoutInflater().inflate(R.layout.item_match, null, false);
popupWindow = new PopupWindow(popupWindow_view,800, 800, true);
popupWindow.setAnimationStyle(R.style.match);
popupWindow_view.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (popupWindow != null && popupWindow.isShowing()) {
popupWindow.dismiss();
popupWindow = null;
}
return false;
}
});
}
public void defFling()
{
flingContainer = (FlingAdapterView) findViewById(R.id.frame);
flingContainer.setAdapter(adapter);
flingContainer.setFlingListener(new FlingAdapterView.onFlingListener() {
@Override
public void removeFirstObjectInAdapter() {
cuid=list.get(0).getUid();
nick=list.get(0).getNick();
list.remove(0);
adapter.notifyDataSetChanged();
}
@Override
public void onLeftCardExit(Object dataObject) {
makeToast(AddContactsActivity.this, "不喜欢");
}
@Override
public void onRightCardExit(Object dataObject) {
makeToast(AddContactsActivity.this, "喜欢");
//send(uid,cuid) to server ,save into like_table
new AHttpAddContacts(list, uid, handler, helper).rightOperation(cuid);
}
@Override
public void onAdapterAboutToEmpty(int itemsInAdapter) {
// al.add(new CardMode("胡欣语", 21, R.drawable.picture_fisrt,
// "信息科学与技术", "中文", "英文", "男", "学五食堂"));
adapter.notifyDataSetChanged();
i++;
}
@Override
public void onScroll(float scrollProgressPercent) {
try {
View view = flingContainer.getSelectedView();
view.findViewById(R.id.item_swipe_right_indicator)
.setAlpha(scrollProgressPercent < 0 ? -scrollProgressPercent : 0);
view.findViewById(R.id.item_swipe_left_indicator)
.setAlpha(scrollProgressPercent > 0 ? scrollProgressPercent : 0);
} catch (Exception e) {
e.printStackTrace();
}
}
});
flingContainer.setOnItemClickListener(new FlingAdapterView.OnItemClickListener() {
@Override
public void onItemClicked(int itemPosition, Object dataObject) {
makeToast(AddContactsActivity.this, "点击图片");
}
});
}
static void makeToast(Context ctx, String s) {
Toast.makeText(ctx, s, Toast.LENGTH_SHORT).show();
}
public void right() {
flingContainer.getTopCardListener().selectRight();
}
public void left() {
flingContainer.getTopCardListener().selectLeft();
}
public void playmusic() {
}
}
| true |
0184fd307219a21a67ec891399c4ecd8bbd9653b
|
Java
|
s20914/PGO
|
/PGO 10 Task 3/src/Person.java
|
UTF-8
| 396 | 3.078125 | 3 |
[] |
no_license
|
abstract public class Person {
String firstName;
String lastName;
int birthdayYear;
public Person(String firstName, String lastName, int birthdayYear){
this.firstName=firstName;
this.lastName=lastName;
this.birthdayYear=birthdayYear;
}
public int getAge(){
int age = 2020 - birthdayYear;
return age;
}
}
| true |
ae14f9b20fed82f417e4963538f44e00f0348fd2
|
Java
|
mmaudet/linshare-core
|
/src/main/java/org/linagora/linshare/core/dao/impl/JackRabbitFileDataStoreImpl.java
|
UTF-8
| 2,921 | 2.4375 | 2 |
[] |
no_license
|
package org.linagora.linshare.core.dao.impl;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
import org.apache.commons.lang.Validate;
import org.linagora.linshare.core.dao.FileDataStore;
import org.linagora.linshare.core.dao.FileSystemDao;
import org.linagora.linshare.core.domain.objects.FileMetaData;
import org.linagora.linshare.core.exception.TechnicalErrorCode;
import org.linagora.linshare.core.exception.TechnicalException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JackRabbitFileDataStoreImpl implements FileDataStore {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
private static final String jackRabbitDefaultPath = "ee0e115f-240e-428b-8f5c-427184cf67b1";
private FileSystemDao dao;
public JackRabbitFileDataStoreImpl(FileSystemDao dao) {
super();
this.dao = dao;
}
@Override
public void remove(FileMetaData metadata) {
Validate.notNull(metadata);
String uuid = metadata.getUuid();
try {
dao.removeFileByUUID(uuid);
} catch (org.springmodules.jcr.JcrSystemException e1) {
logger.warn(e1.getMessage(), e1);
} catch (org.springframework.dao.DataRetrievalFailureException e) {
logger.warn(e.getMessage(), e);
}
}
@Override
public FileMetaData add(File file, FileMetaData metadata) {
Validate.notNull(metadata);
String mimeType = metadata.getMimeType();
Long size = metadata.getSize();
Validate.notEmpty(mimeType);
Validate.notNull(size);
try (FileInputStream fis = new FileInputStream(file)) {
String uuid = dao.insertFile(jackRabbitDefaultPath, fis, size, UUID.randomUUID().toString(), mimeType);
metadata.setUuid(uuid);
return metadata;
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw new TechnicalException(TechnicalErrorCode.GENERIC, "Can not add a new file : " + e.getMessage());
}
}
@Override
public FileMetaData add(InputStream file, FileMetaData metadata) {
String mimeType = metadata.getMimeType();
Long size = metadata.getSize();
Validate.notEmpty(mimeType);
Validate.notNull(size);
String uuid = dao.insertFile(jackRabbitDefaultPath, file, size, UUID.randomUUID().toString(), mimeType);
metadata.setUuid(uuid);
return metadata;
}
@Override
public InputStream get(FileMetaData metadata) {
Validate.notEmpty(metadata.getUuid());
InputStream inputStream = dao.getFileContentByUUID(metadata.getUuid());
if (inputStream == null) {
throw new TechnicalException(TechnicalErrorCode.GENERIC,
"Can not find document in jackrabbit : " + metadata.getUuid());
}
return inputStream;
}
@Override
public boolean exists(FileMetaData metadata) {
try (InputStream is = dao.getFileContentByUUID(metadata.getUuid())) {
if (is != null) {
return true;
}
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return false;
}
}
| true |
88ef5f311f4be6ed27de9f95eede6a18007b302f
|
Java
|
wuan/spring-jersey-hateoas-example
|
/src/main/java/com/innoq/spring/endpoints/RootEndpoint.java
|
UTF-8
| 942 | 2.046875 | 2 |
[] |
no_license
|
package com.innoq.spring.endpoints;
import com.mercateo.common.rest.schemagen.JsonHyperSchema;
import com.mercateo.common.rest.schemagen.link.LinkMetaFactory;
import com.mercateo.common.rest.schemagen.link.relation.Rel;
import com.mercateo.common.rest.schemagen.types.ObjectWithSchema;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Link;
import javax.ws.rs.core.MediaType;
import java.util.Optional;
@Path("/")
public class RootEndpoint {
@Inject
private LinkMetaFactory linkMetaFactory;
@GET
@Produces(MediaType.APPLICATION_JSON)
public ObjectWithSchema getRoot() {
Optional<Link> customersLink = linkMetaFactory.createFactoryFor(CustomerEndpoint.class).forCall(CustomerRel.CUSTOMERS,
r -> r.index());
return ObjectWithSchema.create("",
JsonHyperSchema.from(customersLink));
}
}
| true |
f5bb6f72673c5325cd1cba461d61b4290496c396
|
Java
|
stefanliydov/InternshipTasksEGT
|
/testing-framework/src/test/java/egt/interactive/testing_framework/resources/test_ng/ExpectedExceptionTests.java
|
UTF-8
| 301 | 2.109375 | 2 |
[] |
no_license
|
package egt.interactive.testing_framework.resources.test_ng;
import org.testng.annotations.Test;
public class ExpectedExceptionTests {
@Test(expectedExceptions = IllegalArgumentException.class)
public void shouldPassIfRightMistakeIsThrown() {
throw new IllegalArgumentException();
}
}
| true |
80d9fb2b88a1333dc718a6d4dc799c32543df801
|
Java
|
ipsbrar/OSDB
|
/app/src/main/java/com/osdb/app/ui/player_details_screen/view/BioFragment.java
|
UTF-8
| 2,655 | 2.109375 | 2 |
[] |
no_license
|
package com.osdb.app.ui.player_details_screen.view;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.constraint.ConstraintLayout;
import android.support.v4.widget.NestedScrollView;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.osdb.app.R;
import com.osdb.app.ui.base.view.BaseFragment;
public class BioFragment extends BaseFragment {
public static final String TAG = "BioFragment";
//no data found
private ConstraintLayout no_data;
private TextView txt_no_data_title, txt_no_data_disp;
private Context context;
private TextView bioText;
private NestedScrollView nscrollBio;
public static BioFragment getInstance(String bio) {
BioFragment bioFragment = new BioFragment();
Bundle bundle = new Bundle();
bundle.putString("bioText", bio);
bioFragment.setArguments(bundle);
return bioFragment;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.bio_fragment, container, false);
}
@Override
protected void setUp(View view) {
context = getContext();
bioText = view.findViewById(R.id.txt_bio);
nscrollBio = view.findViewById(R.id.nscrollBio);
// No data found Views
txt_no_data_title = view.findViewById(R.id.txt_no_data_title);
txt_no_data_disp = view.findViewById(R.id.txt_no_data_disp);
no_data = view.findViewById(R.id.no_data);
txt_no_data_title.setText(getString(R.string.no_data_found));
txt_no_data_disp.setText(getString(R.string.please_try_again));
no_data.setVisibility(View.GONE);
Bundle bundle = getArguments();
if (bundle != null && bundle.getString("bioText") != null && !bundle.getString("bioText").equalsIgnoreCase("")) {
no_data.setVisibility(View.GONE);
nscrollBio.setVisibility(View.VISIBLE);
bioText.setText(Html.fromHtml(bundle.getString("bioText")));
} else {
no_data.setVisibility(View.VISIBLE);
nscrollBio.setVisibility(View.GONE);
}
// bioText.setMovementMethod(new ScrollingMovementMethod());
}
}
| true |
2156d891fde30b7cf590b53a258215475eff4f3a
|
Java
|
P79N6A/icse_20_user_study
|
/methods/Method_44635.java
|
UTF-8
| 157 | 2.109375 | 2 |
[] |
no_license
|
@Override public String requestDepositAddress(Currency currency,String... arguments) throws IOException {
throw new NotAvailableFromExchangeException();
}
| true |
c20d49d9b16363d302e1fa3a2918ee77390c1cf2
|
Java
|
Gorbos/DualCam
|
/src/com/cam/dualcam/SocialMediaActivity.java
|
UTF-8
| 26,609 | 1.773438 | 2 |
[] |
no_license
|
package com.cam.dualcam;
//Local Widget/Class imports
import com.cam.dualcam.widget.GifWebView;
import com.cam.dualcam.DualCamActivity.TwitterGetAccessTokenTask;
import com.cam.dualcam.twitter.TwitterConstant;
import com.cam.dualcam.twitter.TwitterUtil;
import com.cam.dualcam.utility.Field;
import com.cam.dualcam.utility.SetMyFBSession;
import com.cam.dualcam.widget.LoadingDialog;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Toast;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.widget.TextView;
import com.cam.dualcam.utility.*;
//Facebook imports
import com.facebook.*;
import com.facebook.model.*;
import com.facebook.widget.LoginButton;
import com.hintdesk.core.activities.AlertMessageBox;
import com.hintdesk.core.util.OSUtil;
import com.hintdesk.core.util.StringUtil;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
public class SocialMediaActivity extends Activity {
private GifWebView gifView;
private int orientationOfPhone;
private boolean showSpalshScreen = true;
private String enterCamera;
public static String TAG = "DualCamActivity";
public boolean isLoggedIn = false;
private Session.StatusCallback statusCallback = new SessionStatusCallback();
private Session session;
private int checker = -1;
private String gear = "2nd";
private SetMyFBSession sessionObject;
private Bundle globalBundle;
private LoadingDialog loading;
private boolean isLoading = false;
private UiLifecycleHelper uiHelper;
private Session.StatusCallback callback =
new Session.StatusCallback() {
@Override
public void call(Session session,
SessionState state, Exception exception) {
//onSessionStateChange(session, state, exception);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//uiHelper = new UiLifecycleHelper(SocialMediaActivity.this, callback);
//uiHelper.onCreate(savedInstanceState);
globalBundle = savedInstanceState;
loading = new LoadingDialog(SocialMediaActivity.this);
setView(gear);
}
@SuppressWarnings("deprecation")
private void checkNetworkConnection() {
// TODO Auto-generated method stub
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion <= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1){
// Do something for API 15 and below versions
System.out.println("Do something for API 15 and below versions");
ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if(connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED ||
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED) {
}
else{
AlertDialog alertDialog = new AlertDialog.Builder(SocialMediaActivity.this).create();
alertDialog.setTitle("No Connection");
alertDialog.setMessage("This application requires internet connection to run, Cross check your connectivity and try again.");
// Setting OK Button
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
// Showing Alert Message
alertDialog.show();
}
} else{
System.out.println("do something for phones running an SDK above API 15");
// do something for phones running an SDK above API 15
///detect if there is an internet
if (!OSUtil.IsNetworkAvailable(getApplicationContext())) {
AlertMessageBox.Show(SocialMediaActivity.this, "Internet connection", "A valid internet connection can't be established", AlertMessageBox.AlertMessageBoxIcon.Info);
return;
}
//detect if constants has a null or whitespace
if (StringUtil.isNullOrWhitespace(TwitterConstant.TWITTER_CONSUMER_KEY) || StringUtil.isNullOrWhitespace(TwitterConstant.TWITTER_CONSUMER_SECRET)) {
AlertMessageBox.Show(SocialMediaActivity.this, "Twitter oAuth infos", "Please set your twitter consumer key and consumer secret", AlertMessageBox.AlertMessageBoxIcon.Info);
return;
}
}
}
private void detectIfUserLogInTwitter() {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (!sharedPreferences.getBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN,false)) {
System.out.println("Not Log in ");
} else {
System.out.println("Log in ");
Bundle extras = getIntent().getExtras();
if(extras != null)
showSpalshScreen = extras.getBoolean("showSplashScreen");
Intent intent = new Intent(SocialMediaActivity.this, DualCamActivity.class);
intent.putExtra("showSplashScreen", false);
startActivity(intent);
}
}
public void setView(String gear){
//THE ORIGINAL!!
if(gear == "1st"){
setContentView(R.layout.gif_webview_layout);
gifView = (GifWebView) findViewById(R.id.gif_view);
enterCamera = getResources().getString(R.string.enter_camera_text);
orientationOfPhone = this.getResources().getConfiguration().orientation;
if (orientationOfPhone == Configuration.ORIENTATION_PORTRAIT) {
gifView.setGifAssetPath("file:///android_asset/cute.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/cute.gif");
//gifView.setGifAssetPath("file:// /android_asset/funny.gif");
} else if (orientationOfPhone == Configuration.ORIENTATION_LANDSCAPE) {
gifView.setGifAssetPath("file:///android_asset/karate.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/karate.gif");
}
//get extras
Bundle extras = getIntent().getExtras();
showSpalshScreen = extras.getBoolean("showSplashScreen");
Button buttonOne = (Button) findViewById(R.id.btnEnterCamera);
buttonOne.setText(enterCamera);
buttonOne.setTextSize(36);
//buttonOne.setBackgroundColor(Color.TRANSPARENT);
buttonOne.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
});
}
//THE FACEBOOK MUSH-UP with the Original
else if(gear == "2nd"){
setContentView(R.layout.socialmedia_gear_second);
gifView = (GifWebView) findViewById(R.id.gif_view);
// simpleSession();
orientationOfPhone = this.getResources().getConfiguration().orientation;
if (orientationOfPhone == Configuration.ORIENTATION_PORTRAIT) {
gifView.setGifAssetPath("file:///android_asset/cute.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/cute.gif");
//gifView.setGifAssetPath("file:///android_asset/funny.gif");
} else if (orientationOfPhone == Configuration.ORIENTATION_LANDSCAPE) {
gifView.setGifAssetPath("file:///android_asset/karate.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/karate.gif");
}
//get extras
Bundle extras = getIntent().getExtras();
if(extras != null)
showSpalshScreen = extras.getBoolean("showSplashScreen");
Button buttonOne = (Button) findViewById(R.id.btnEnterCamera);
buttonOne.setTextSize(36);
//buttonOne.setBackgroundColor(Color.TRANSPARENT);
buttonOne.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
});
//Button login_button = (Button) findViewById(R.id.login_button);
//ImageView login_button = (ImageView) findViewById(R.id.fbBtn);
/*LinearLayout login_button = (LinearLayout) findViewById(R.id.fbButton);
login_button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
ultimateSession(globalBundle);
// sessionTime();
}
});*/
checkNetworkConnection();
initializeComponent();
initialFacebookComponent();
initControlTwitter();
detectIfUserLogInTwitter();
//initializeTwitterLogout();
}
//From the creators of FACEBOOK ...
else if(gear == "3rd"){
setContentView(R.layout.socialmedia_gear_third);
gifView = (GifWebView) findViewById(R.id.gif_view);
//setSession();
orientationOfPhone = this.getResources().getConfiguration().orientation;
if (orientationOfPhone == Configuration.ORIENTATION_PORTRAIT) {
gifView.setGifAssetPath("file:///android_asset/cute.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/cute.gif");
//gifView.setGifAssetPath("file:///android_asset/funny.gif");
} else if (orientationOfPhone == Configuration.ORIENTATION_LANDSCAPE) {
gifView.setGifAssetPath("file:///android_asset/karate.gif");
gifView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
//gifView.setGifAssetPath("file:///android_asset/karate.gif");
}
//get extras
Bundle extras = getIntent().getExtras();
if(extras != null)
showSpalshScreen = extras.getBoolean("showSplashScreen");
Button buttonOne = (Button) findViewById(R.id.btnEnterCamera);
buttonOne.setTextSize(36);
//buttonOne.setBackgroundColor(Color.TRANSPARENT);
buttonOne.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
});
Button login_button = (Button) findViewById(R.id.login_button);
login_button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
if(!isLoggedIn){
// start Facebook Login
Session.openActiveSession(SocialMediaActivity.this, true, new Session.StatusCallback() {
// callback when session changes state
@Override
public void call(Session session, SessionState state, Exception exception) {
Log.i(TAG, "This is = "+session.isOpened());
if (session.isOpened()) {
// make request to the /me API
Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
});
}
}
});
}
else{
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
}
});
}
}
// @Override
// public void onStart() {
// super.onStart();
// Session.getActiveSession().addCallback(statusCallback);
// }
//
// @Override
// public void onStop() {
// super.onStop();
// Session.getActiveSession().removeCallback(statusCallback);
// }
//
//
// @Override
// protected void onSaveInstanceState (Bundle outState) {
// super.onSaveInstanceState(outState);
// Session session = Session.getActiveSession();
// Session.saveSession(session, outState);
// }
private void initialFacebookComponent() {
// TODO Auto-generated method stub
Button BtnFacebookLogin = (Button) findViewById(R.id.fbButton);
BtnFacebookLogin.setOnClickListener(buttonfacebookLoginOnClickListener);
}
private void initializeComponent() {
// TODO Auto-generated method stub
Button BtnTwitterLogin = (Button) findViewById(R.id.btnLoginTwitter);
BtnTwitterLogin.setOnClickListener(buttonLoginOnClickListener);
}
private View.OnClickListener buttonfacebookLoginOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
ultimateSession(globalBundle);
}
};
/*private void initializeTwitterLogout() {
// TODO Auto-generated method stub
Button BtnTwitterLogout = (Button) findViewById(R.id.btnLogoutTwitter);
BtnTwitterLogout.setOnClickListener(buttonLogOutClickListener);
}*/
/*private View.OnClickListener buttonLogOutClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN, "");
editor.putString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN_SECRET, "");
editor.putBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN, false);
editor.commit();
Toast.makeText(getApplicationContext(), "Logging Out on Twitter", Toast.LENGTH_LONG).show();
}
};*/
private View.OnClickListener buttonLoginOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (!sharedPreferences.getBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN,false))
{
new TwitterAuthenticateTask().execute();
/*Boolean we = sharedPreferences.getBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN, false);
Toast.makeText(getApplicationContext(), we + "Has No Logged In.", Toast.LENGTH_LONG).show();*/
} else {
Bundle extras = getIntent().getExtras();
if(extras != null)
showSpalshScreen = extras.getBoolean("showSplashScreen");
Intent intent = new Intent(SocialMediaActivity.this, DualCamActivity.class);
intent.putExtra("showSplashScreen", false);
startActivity(intent);
/*Boolean we = sharedPreferences.getBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN, false);
Toast.makeText(getApplicationContext(), we + "Has Logged In.", Toast.LENGTH_LONG).show();*/
}
}
};
public boolean logCheck(){
Session session = Session.getActiveSession();
if(session == null)
return false;
return session.isOpened();
}
private class SessionStatusCallback implements Session.StatusCallback {
@Override
public void call(Session session, SessionState state, Exception exception) {
Log.i(TAG,"It went here at SessionStatusCallback");
}
}
private class LogInCallback implements Session.StatusCallback {
@Override
public void call(Session session, SessionState state, Exception exception) {
if(session.isOpened()){
finish();
Intent i = new Intent(SocialMediaActivity.this, DualCamActivity.class);
//Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("session", session);
i.putExtra("showSplashScreen", false);
startActivity(i);
}
}
}
private void onSessionStateChange(Session session, SessionState state, Exception exception) {
// Only make changes if the activity is visible
}
private void setSession(){
//session = mySession();
simpleSession();
}
private void simpleSession(){
sessionObject = new SetMyFBSession(getApplicationContext(), this);
session = sessionObject.getMySession();
}
private void ultimateSession(Bundle bundy){
loading.show();
sessionObject = new SetMyFBSession(getApplicationContext(), this, bundy);
// sessionObject.setClassName("SocialMediaActivity");
session = sessionObject.startMySession();
// Toast.makeText(getApplicationContext(), "It Happened. session = "+session.getState().toString(), Field.SHOWTIME).show();
// makeMeRequest(session);
}
private void makeMeRequest(final Session session) {
Request request = Request.newMeRequest(session,
new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
// If the response is successful
if (user != null) {
//String facebookId = user.getId();
isLoggedIn = true;
Toast.makeText(getApplicationContext(), "It Happened. User = "+user.getName(), Field.SHOWTIME).show();
}
else
Toast.makeText(getApplicationContext(), "It Happened. User = null", Field.SHOWTIME).show();
// else
// isLoggedIn = false;
//
// if (response.getError() != null) {
// // Handle error
// isLoggedIn = false;
// }
}
});
request.executeAsync();
}
private void sessionTime(){
Session session = Session.getActiveSession();
Log.i(TAG,"sessionTime active");
//Log.i(TAG,"session = "+session.getState());
if (session == null) {
Log.i(TAG,"session itself is null");
// Session.openActiveSession(parentActivity, true,statusCallback);
//session = new Session(getApplicationContext());
session = Session.openActiveSession(SocialMediaActivity.this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if(session.isOpened()){
Log.i(TAG,"It went here at LogInCallback");
Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
//
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
Toast.makeText(getApplicationContext(), "Hello!! "+user.getFirstName()+".",Field.SHOWTIME).show();
// if(parentName == gifClassName){
ultimateSession(globalBundle);
finish();
Intent i = new Intent(getApplicationContext(), DualCamActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.putExtra("showSplashScreen", false);
startActivity(i);
// }
}
}
});
}
}
});
}
else{
Log.i(TAG,"sessionTime to UltimateSession");
ultimateSession(globalBundle);
}
}
@Override
public void onResume() {
super.onResume();
//uiHelper.onResume();
if(loading != null)
loading.dismiss();
detectIfUserLogInTwitter();
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
//uiHelper.onSaveInstanceState(bundle);
}
@Override
public void onPause() {
super.onPause();
//uiHelper.onPause();
}
@Override
public void onDestroy(){
super.onDestroy();
loading.dismiss();
//uiHelper.onDestroy();
//session.closeAndClearTokenInformation();
if(sessionObject != null && session != null){
sessionObject.storeMySession();
//session.closeAndClearTokenInformation();
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
if (requestCode == 100) {
//uiHelper.onActivityResult(requestCode, resultCode, data);
}
if(loading != null)
loading.dismiss();
}
class TwitterAuthenticateTask extends AsyncTask<String, String, RequestToken> {
@Override
protected void onPostExecute(RequestToken requestToken) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL()));
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.addFlags(Intent.FLAG_FROM_BACKGROUND);
startActivity(intent);
}
@Override
protected RequestToken doInBackground(String... params) {
return TwitterUtil.getInstance().getRequestToken();
}
}
// Twitter initial Control for getting token Data
private void initControlTwitter() {
Uri uri = getIntent().getData();
if (uri != null && uri.toString().startsWith(TwitterConstant.TWITTER_CALLBACK_URL)) {
String verifier = uri.getQueryParameter(TwitterConstant.URL_PARAMETER_TWITTER_OAUTH_VERIFIER);
new TwitterGetAccessTokenTask().execute(verifier);
} else
new TwitterGetAccessTokenTask().execute("");
}
// Background task on getting Access token in twitter
class TwitterGetAccessTokenTask extends AsyncTask<String, String, String> {
@Override
protected void onPostExecute(String userName) {
//textViewUserName.setText(Html.fromHtml("<b> Welcome " + userName + "</b>"));
}
@Override
protected String doInBackground(String... params) {
Twitter twitter = TwitterUtil.getInstance().getTwitter();
RequestToken requestToken = TwitterUtil.getInstance().getRequestToken();
if (!StringUtil.isNullOrWhitespace(params[0])) {
try {
AccessToken accessToken = twitter.getOAuthAccessToken(requestToken, params[0]);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN, accessToken.getToken());
editor.putString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN_SECRET, accessToken.getTokenSecret());
editor.putBoolean(TwitterConstant.PREFERENCE_TWITTER_IS_LOGGED_IN, true);
editor.commit();
return twitter.showUser(accessToken.getUserId()).getName();
} catch (TwitterException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} else {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
String accessTokenString = sharedPreferences.getString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN, "");
String accessTokenSecret = sharedPreferences.getString(TwitterConstant.PREFERENCE_TWITTER_OAUTH_TOKEN_SECRET, "");
AccessToken accessToken = new AccessToken(accessTokenString, accessTokenSecret);
try {
TwitterUtil.getInstance().setTwitterFactory(accessToken);
return TwitterUtil.getInstance().getTwitter().showUser(accessToken.getUserId()).getName();
} catch (TwitterException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
return null; //To change body of implemented methods use File | Settings | File Templates.
}
}
}
| true |
8354eb9077d0e77383041f69a2225d39de97b786
|
Java
|
HK-hub/campus-scud
|
/src/main/java/com/aclab/campus_scud/service/impl/ScoreServiceImpl.java
|
UTF-8
| 424 | 1.617188 | 2 |
[] |
no_license
|
package com.aclab.campus_scud.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.aclab.campus_scud.pojo.Score;
import com.aclab.campus_scud.service.ScoreService;
import com.aclab.campus_scud.mapper.ScoreMapper;
import org.springframework.stereotype.Service;
/**
*
*/
@Service
public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score>
implements ScoreService{
}
| true |
0e834b7ba7e3937749f081ab9bec4820a1972902
|
Java
|
JefeSimpson/service-sample
|
/src/main/java/com/jefesimpson/service/sample/service/ClientService.java
|
UTF-8
| 724 | 2.109375 | 2 |
[] |
no_license
|
package com.jefesimpson.service.sample.service;
import com.jefesimpson.service.sample.model.*;
import java.util.List;
public interface ClientService extends Service<Client> {
Client authenticate(String login, String password);
Client authenticate(String token);
Client findByLogin(String login);
Client findByToken(String token);
boolean loginExist(String login);
boolean tokenExist(String token);
boolean isPhoneUnique(String phone);
boolean isEmailUnique(String email);
List<ModelPermission> permissionsFor(Client client, Client target);
List<ModelPermission> permissionsFor(Client client, Order target);
List<ModelPermission> permissionsFor(Client client, Product target);
}
| true |
aa56169647f15751ceda543db88e12d897c5b5bb
|
Java
|
Kpraveen1786/TestingRepo1
|
/src/com/forsys/Schedulingsalesorder.java
|
UTF-8
| 13,311 | 1.96875 | 2 |
[] |
no_license
|
package com.forsys;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.io.StringWriter;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.PageLoadStrategy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Schedulingsalesorder {
public WebDriver browser;
public String Order_Number;
public String Fulfillment_Number;
public String Item_Number;
public String SSD_Update;
boolean loginsuccess = false;
Logger logger = Logger.getLogger(Schedulingsalesorder.class);
@BeforeTest()
public void Login_Page() throws Exception {
try {
logger.info("Initial loginsuccess : " + loginsuccess);
WebDriverManager.chromedriver().version("92").setup();
ChromeOptions options = new ChromeOptions();
options.setPageLoadStrategy(PageLoadStrategy.NONE);
browser = new ChromeDriver(options);
browser.manage().window().maximize();
logger.info("Chrome driver started");
browser.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
browser.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS);
browser.get("https://elme-dev1.fa.us8.oraclecloud.com");
browser.findElement(By.id("userid")).click();
browser.findElement(By.id("userid")).sendKeys("forsys.user");
browser.findElement(By.id("password")).click();
browser.findElement(By.id("password")).sendKeys("Boyd2021!");
browser.findElement(By.id("btnActive")).click();
JavascriptExecutor js = (JavascriptExecutor) browser;
for (int i = 0; i < 25; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
logger.info("Page is not loaded");
}
// To check page ready state.
if (js.executeScript("return document.readyState").toString().equals("complete")) {
break;
}
}
// Thread.sleep(12000);
browser.findElement(By.xpath("//a[text()='You have a new home page!']")).click();
Thread.sleep(10000);
browser.findElement(By.linkText("Order Management")).click();
WebElement order1 = browser.findElement(By.id("itemNode_order_management_order_management_1"));
WebDriverwaitelement(order1);
order1.click();
loginsuccess = true;
logger.info("loginsuccess in Login_Page(): " + loginsuccess);
} catch (Exception e) {
logger.info("Exception occured in Login_Page()");
e.printStackTrace();
convertPrintStrackToString(e);
}
}
@Test()
public void Home_Page() throws Exception {
boolean flag = false;
File f = null;
FileInputStream fis = null;
Workbook wb = null;
logger.info("loginsuccess : " + loginsuccess);
if (loginsuccess) {
String filename = getFileName();
try {
if (!filename.isEmpty()) {
logger.info("Script is started");
logger.info("File path is :" + filename);
// File f = new File(System.getProperty("user.dir")+"\\Excel\\Scheduling_Salesorder.xlsx");
f = new File(filename);
fis = new FileInputStream(f);
wb = new HSSFWorkbook(fis);
Sheet sheet = wb.getSheet("Schedulingsalesorder");
sheet.getRow(0).createCell(4).setCellValue("Result");
sheet.getRow(0).createCell(5).setCellValue("Comments");
int totalrows = sheet.getPhysicalNumberOfRows();
System.out.println("Total number of Excel rows are :" + totalrows);
if (sheet.getRow(1).getCell(4) == null) {
for (int i = 1; i <= totalrows; i++) {
if (sheet.getRow(i) == null) {
break;
}
Order_Number = sheet.getRow(i).getCell(0).getStringCellValue();
Fulfillment_Number = sheet.getRow(i).getCell(1).getStringCellValue();
Item_Number = sheet.getRow(i).getCell(2).getStringCellValue();
SSD_Update = sheet.getRow(i).getCell(3).getStringCellValue();
Thread.sleep(4000);
WebElement task = browser.findElement(By.linkText("Tasks"));
WebDriverwaitelement(task);
task.click();
WebElement fulfillment = browser
.findElement(By.xpath("//td[text()='Manage Fulfillment Lines']"));
WebDriverwaitelement(fulfillment);
fulfillment.click();
WebElement el = browser.findElement(By.xpath("//*[contains(@id,'value20::content')]"));
WebDriverwaitelement(el);
el.click();
Select sc = new Select(
browser.findElement(By.xpath("//*[contains(@id,'operator2::content')]")));
sc.selectByVisibleText("Equals");
Thread.sleep(3000);
browser.findElement(By.xpath("//*[contains(@id,'value20::content')]")).click();
browser.findElement(By.xpath("//*[contains(@id,'value20::content')]"))
.sendKeys(Order_Number);
Thread.sleep(2000);
browser.findElement(By.xpath("//*[contains(@id,'value30::content')]")).click();
browser.findElement(By.xpath("//*[contains(@id,'value30::content')]"))
.sendKeys(Fulfillment_Number);
Thread.sleep(3000);
browser.findElement(By.xpath("//*[contains(@id,'value50::content')]")).click();
browser.findElement(By.xpath("//*[contains(@id,'value50::content')]"))
.sendKeys(Item_Number);
Thread.sleep(3000);
browser.findElement(By.xpath("//*[contains(@id,'q1::search')]")).click();
try {
WebElement table = browser
.findElement(By.xpath("//*[contains(@id,'ATt1::db')]/table/tbody/tr/td[1]"));
WebDriverwaitelement(table);
table.click();
Thread.sleep(3000);
WebElement edit = browser.findElement(By.xpath("//*[contains(@id,'edit::icon')]"));
JavascriptExecutor js = (JavascriptExecutor) browser;
js.executeScript("arguments[0].click();", edit);
Thread.sleep(8000);
Select overide = new Select(browser
.findElement(By.xpath("//*[contains(@id,'overrideScheduleDate::content')]")));
overide.selectByVisibleText("Yes");
Thread.sleep(6000);
browser.findElement(By.xpath("//*[contains(@id,'id1::content')]")).click();
browser.findElement(By.xpath("//*[contains(@id,'id1::content')]")).sendKeys(SSD_Update);
Thread.sleep(3000);
browser.findElement(By.xpath("//*[contains(@id,'FulSAP:AT1:cb4')]")).click();
try {
WebElement okbutton = browser
.findElement(By.xpath("//*[contains(@id,'FulSAP:AT1:d9::ok')]"));
WebDriverwaitelement(okbutton);
okbutton.click();
Thread.sleep(3000);
WebElement refresh = browser.findElement(By.xpath("//button[text()='Refresh']"));
WebDriverwaitelement(refresh);
refresh.click();
Thread.sleep(4000);
browser.findElement(By.xpath("//button[text()='Refresh']")).click();
Thread.sleep(3000);
browser.findElement(By.xpath("//button[text()='Refresh']")).click();
Thread.sleep(6000);
browser.findElement(By.xpath("//*[contains(@id,'FulSAP:cb1')]")).click();
sheet.getRow(i).createCell(4).setCellValue("Pass");
Updatefile(f, wb);
} catch (Exception e) {
browser.findElement(By.id("d1::msgDlg::cancel")).click();
WebElement cancel = browser
.findElement(By.xpath("//*[contains(@id,'d3::cancel')]"));
WebDriverwaitelement(cancel);
cancel.click();
WebElement done = browser.findElement(By.xpath("//*[contains(@id,'FulSAP:cb1')]"));
WebDriverwaitelement(done);
done.click();
sheet.getRow(i).createCell(4).setCellValue("Fail");
sheet.getRow(i).createCell(5).setCellValue(
"You cannot set the scheduled ship date to a date prior to today.");
Updatefile(f, wb);
}
} catch (Exception e) {
browser.findElement(By.xpath("//*[contains(@id,'FulSAP:cb1')]")).click();
sheet.getRow(i).createCell(4).setCellValue("Fail");
sheet.getRow(i).createCell(5)
.setCellValue("Order has no data or edit button is in disablemode");
Updatefile(f, wb);
}
}
} else {
System.out.println("File is already processed");
logger.info("File is processed");
}
}
} catch (Exception e) {
flag = true;
e.printStackTrace();
convertPrintStrackToString(e);
logger.info("Script is failed");
}
if (wb != null) {
wb.close();
}
if (fis != null) {
fis.close();
}
logger.info("flag : " + flag);
if (flag) {
logger.info("Error folder");
logger.info(TestRunner.processed_folder_path + f.getName());
try {
Files.move(Paths.get(TestRunner.processed_folder_path + f.getName()),
Paths.get(TestRunner.error_folder_path + f.getName()), StandardCopyOption.REPLACE_EXISTING);
Email email = new Email("File upload status",
"The provided file was errored out. Please find the attachment for more details",
TestRunner.error_folder_path + f.getName());
email.sendEmail();
} catch (Exception e) {
e.printStackTrace();
convertPrintStrackToString(e);
}
File f1 = new File(TestRunner.loggerfilepath);
String logmessage = readFromLast(f1, 1000);
// String screenshot = TakeScreenShotOfBrowser.takeScreenShot(browser);
// Email email = new Email();
// email.sendErrorEmail(logmessage, screenshot);
// Files.deleteIfExists(Paths.get(screenshot));
} else {
logger.info("Success folder");
logger.info(TestRunner.processed_folder_path + f.getName());
try {
Files.move(Paths.get(TestRunner.processed_folder_path + f.getName()),
Paths.get(TestRunner.success_folder_path + f.getName()),
StandardCopyOption.REPLACE_EXISTING);
Email email = new Email("File upload status",
"The provided file was processed successfully. Please find the attachment",
TestRunner.success_folder_path + f.getName());
email.sendEmail();
} catch (Exception e) {
convertPrintStrackToString(e);
}
}
}
}
public void WebDriverwaitelement(WebElement element) {
WebDriverWait wait = new WebDriverWait(browser, 350);
wait.until(ExpectedConditions.visibilityOf(element));
}
public void Updatefile(File f, Workbook wb) {
try {
FileOutputStream fos = new FileOutputStream(f);
wb.write(fos);
fos.flush();
fos.close();
} catch (Exception e) {
e.printStackTrace();
convertPrintStrackToString(e);
}
}
@AfterTest()
public void Close_browser() {
if (browser != null) {
browser.quit();
logger.info("browser is closed");
}
}
public String getFileName() {
try {
File f = new File(TestRunner.unprocessed_folder_path);
String filename = f.getAbsolutePath();
String name = TestRunner.filename;
Files.move(Paths.get(filename), Paths.get(TestRunner.processed_folder_path + name),
StandardCopyOption.REPLACE_EXISTING);
return TestRunner.processed_folder_path + name;
} catch (Exception e) {
e.printStackTrace();
convertPrintStrackToString(e);
}
return "";
}
public void convertPrintStrackToString(Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String sStackTrace = sw.toString(); // stack trace as a string
logger.info(sStackTrace);
}
// Read n lines from the end of the file
public String readFromLast(File file, int lines) {
int readLines = 0;
StringBuilder builder = new StringBuilder();
RandomAccessFile randomAccessFile = null;
try {
randomAccessFile = new RandomAccessFile(file, "r");
long fileLength = file.length() - 1;
// Set the pointer at the last of the file
randomAccessFile.seek(fileLength);
for (long pointer = fileLength; pointer >= 0; pointer--) {
randomAccessFile.seek(pointer);
char c;
// read from the last one char at the time
c = (char) randomAccessFile.read();
// break when end of the line
if (c == '\n') {
readLines++;
if (readLines == lines)
break;
}
builder.append(c);
}
// Since line is read from the last so it
// is in reverse so use reverse method to make it right
builder.reverse();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (randomAccessFile != null) {
try {
randomAccessFile.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return builder.toString();
}
}
| true |
f6733666f7c1eed594b4c542df92c73d30c8159b
|
Java
|
Fakau/TestUnitaireSpringBoot
|
/src/main/java/com/engine/fakau/TestUnitaire/service/IBankAccountService.java
|
UTF-8
| 701 | 2.015625 | 2 |
[] |
no_license
|
package com.engine.fakau.TestUnitaire.service;
import com.engine.fakau.TestUnitaire.domain.BankAccount;
import java.math.BigDecimal;
import java.util.List;
import java.util.Optional;
public interface IBankAccountService {
BankAccount save(BankAccount bankAccount);
BankAccount deposit(final String bankAccountNo, final BigDecimal amount);
BankAccount withdraw(final String bankAccountNo, final BigDecimal amount);
List<BankAccount> saveAll(List<BankAccount> bankAccounts);
Optional<BankAccount> findOneByBankAccountNo(String bankAccountNo);
List<BankAccount> findAllBankAccountWithMaxAmmout();
BigDecimal findMaxBankAccountAmmout();
List<BankAccount> findAll();
}
| true |
25a6c3722eaebaf2385d68c2496307bd4ac9fb23
|
Java
|
camsys/onebusaway-nyc
|
/onebusaway-nyc-gtfsrt/src/main/java/org/onebusaway/nyc/gtfsrt/util/BlockTripMapReader.java
|
UTF-8
| 1,461 | 2.46875 | 2 |
[
"Apache-2.0"
] |
permissive
|
/**
* Copyright (C) 2017 Cambridge Systematics, 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.onebusaway.nyc.gtfsrt.util;
import org.onebusaway.nyc.gtfsrt.model.test.BlockTripEntry;
import java.util.HashMap;
import java.util.Map;
/**
* Read a TSV of the format "block_id trip_id".
*/
public class BlockTripMapReader extends RecordReader<BlockTripEntry> {
@Override
public BlockTripEntry convert(Object o) {
return (BlockTripEntry) o;
}
/**
* Get a map from trip to block from a TSV.
*
* @param filename file to read from
* @return map from trip ID to block ID.
*/
public Map<String, String> getTripToBlockMap(String filename) {
Map<String, String> map = new HashMap<String, String>();
for (BlockTripEntry e : getRecords(filename, BlockTripEntry.class)) {
map.put(e.getTripId(), e.getBlockId());
}
return map;
}
}
| true |
56bc993315ddab095bd62b671d7a161fa7651735
|
Java
|
daom89/JugadoresFutbol
|
/src/Jugador.java
|
UTF-8
| 2,257 | 3.515625 | 4 |
[] |
no_license
|
import java.util.ArrayList;
import java.util.Collections;
public class Jugador {
enum Posicion { DELANTERO, DEFENSA, VOLANTE, ARQUERO }
private String Nombres;
private int Numero;
private Posicion posicion;
public Jugador() {
}
public Jugador(String nombres, int numero, Posicion posicion) {
Nombres = nombres;
Numero = numero;
this.posicion = posicion;
}
public String getNombres() {
return Nombres;
}
public void setNombres(String nombres) {
Nombres = nombres;
}
public int getNumero() {
return Numero;
}
public void setNumero(int numero) {
Numero = numero;
}
public Posicion getPosicion() {
return posicion;
}
public void setPosicion(Posicion posicion) {
this.posicion = posicion;
}
@Override
public String toString() {
return "Jugador{" +
"Nombres='" + Nombres + '\'' +
", Numero=" + Numero +
", posicion=" + posicion +
'}';
}
static public ArrayList<Jugador> ordenarJugadores (ArrayList<Jugador> arrayDesordenado){
ArrayList<Integer> numJugadores = new ArrayList<Integer>();
for (Jugador tmpJugador: arrayDesordenado) { //Recorremos el array desordenado
numJugadores.add(tmpJugador.getNumero()); //Sacamos el numero del jugador y lo agregamos al ArrayLis numJugadores
}
Collections.sort(numJugadores); //Ordenamos el numJugadores que tiene solamente los numeros de los jugadores
ArrayList<Jugador> arrJugadoresOrdenados = new ArrayList<Jugador>(); // ArrayList para almacenar Jugadores Ordenados
for (int numJugador: numJugadores) { //Recorrerer numJugadores que tiene los numeros ordenados
for (Jugador tmpJugador: arrayDesordenado) { //Recorro el ArrayDesordenado para buscar el numero del jugador
if(tmpJugador.getNumero() == numJugador){ //Si el numero del jugador ordenado coincide con el arraylistDesordenador
arrJugadoresOrdenados.add(tmpJugador); //Agrega el Objeto del Jugador al arrayordenado
}
}
}
return arrJugadoresOrdenados;
}
}
| true |
d7c4f7f8d1e54587c2e0325629d7324c98c1469f
|
Java
|
Fr8org/Fr8Java
|
/app/co/fr8/terminal/base/AbstractTerminalService.java
|
UTF-8
| 13,781 | 2.0625 | 2 |
[] |
no_license
|
package co.fr8.terminal.base;
import co.fr8.data.interfaces.dto.*;
import co.fr8.data.interfaces.manifests.StandardFr8TerminalCM;
import co.fr8.hub.managers.CrateManager;
import co.fr8.hub.managers.ICrateManager;
import co.fr8.play.ApplicationConstants;
import co.fr8.terminal.TerminalConstants;
import co.fr8.terminal.base.exception.ActivityNotFoundException;
import co.fr8.terminal.base.ui.AbstractActivityUI;
import co.fr8.terminal.infrastructure.BaseTerminalEvent;
import co.fr8.terminal.infrastructure.DefaultHubCommunicator;
import co.fr8.terminal.infrastructure.IHubCommunicator;
import co.fr8.util.CollectionUtils;
import co.fr8.util.DateUtils;
import co.fr8.util.Fr8StringUtils;
import co.fr8.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import org.apache.xerces.impl.dv.util.Base64;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* TODO: Implement
* from TerminalBase.BaseClasses.BaseTerminalController
*/
abstract public class AbstractTerminalService<T extends BaseTerminalEvent> {
private final T baseTerminalEvent;
private final String name;
private Map<String, AbstractTerminalActivity<? extends AbstractActivityUI>> activityRegistrations = new HashMap<>();
private IHubCommunicator hubCommunicator = new DefaultHubCommunicator();
private ICrateManager crateManager = new CrateManager();
/**
* Two parameter constructor
*
* @param event Sets the event associated with the terminal
*/
public AbstractTerminalService(T event, String name) {
this.baseTerminalEvent = event;
this.name = name;
registerActivities();
}
/**
* Configures the IHubCommunicator for the terminal and sets it to the activity
*
* @param terminalActivity the activity that will use the hubCommunicator
*/
private void configureHubCommunicator(AbstractTerminalActivity terminalActivity, Fr8HubSecurityDTO fr8HubSecurity) {
if (terminalActivity != null) {
hubCommunicator.configure(fr8HubSecurity);
terminalActivity.getActivityContext().setHubCommunicator(hubCommunicator);
}
// TODO: Throw exception?
}
/**
* Helper method which logs information about the request
*
* @param actionPath the type of request
* @param terminalName the name of the terminal
* @param activityId the ID of the activity
* @param type the type action
*/
private void logWhenRequest(String actionPath,String terminalName, String activityId, String type) {
Logger.info("[" + terminalName + "] " + type + " /" + actionPath + " call at " +
DateUtils.getCurrentShortDate() + " for ActivityID " + activityId + ", " + terminalName);
}
/**
* Converts a Fr8DataDTO object to an ActivityContext object to use in when processing the activity
*
* @param curDataDTO the Fr8DataDTO object to convert
* @param actionName the ActionNameEnum representing the type of request being made
* @return
*/
private ActivityContext extractActivityContextFromData(Fr8DataDTO curDataDTO, ActionNameEnum actionName) {
if (curDataDTO.getActivityPayload() == null) {
Logger.error("curDataDTO activity DTO is null for " + curDataDTO);
throw new IllegalArgumentException("ActivityPayload for " + curDataDTO + " is null");
}
ActivityDTO curActivityPayload = curDataDTO.getActivityPayload();
if (curDataDTO.getActivityPayload().getActivityTemplate() == null)
throw new IllegalArgumentException("ActivityTemplate is null " + curDataDTO.getActivityPayload().getClass());
logWhenRequest(actionName.getLowerValue(), curActivityPayload.getActivityTemplate().getTerminalName(),
curActivityPayload.getId().toString(), "received");
Logger.debug("Checking curActionPath " + actionName + " as enum: " +
actionName);
return createActivityContextFromFr8Data(curDataDTO);
}
private AbstractTerminalActivity<? extends AbstractActivityUI> extractActivity(Fr8DataDTO fr8DataDTO)
throws ActivityNotFoundException {
String activityTemplateName = fr8DataDTO.getActivityPayload().getActivityTemplate().getName();
Logger.debug("Looking for activity template with name: " + activityTemplateName);
AbstractTerminalActivity<? extends AbstractActivityUI> terminalActivity =
activityRegistrations.get(activityTemplateName);
if (terminalActivity == null) {
Logger.error("No terminalActivity found for " + activityTemplateName);
throw new ActivityNotFoundException("No terminalActivity found for " + activityTemplateName);
}
return terminalActivity;
}
/**
* Main work method for a terminal service. This method is called from a controller
* and passes the request payload as a Fr8DataDTO object
*
* @param actionName ActionNameEnum equivalent which matches the operation request
* made from the Hub
* @param curDataDTO The Fr8DataDTO object sent in the request payload from
* the Hub
* @return an ActivityDTO with crates that contain the result of the operation
*/
public ActivityDTO handleFr8Request(ActionNameEnum actionName, Fr8HubSecurityDTO fr8HubSecurity, Fr8DataDTO curDataDTO,
Map<String, String[]> params) {
ActivityDTO curActivityPayload = curDataDTO.getActivityPayload();
ActivityContext activityContext = extractActivityContextFromData(curDataDTO, actionName);
try {
//to extract run, configure vs.
AbstractTerminalActivity terminalActivity = extractActivity(curDataDTO);
//Set Current user of action
configureHubCommunicator(terminalActivity, fr8HubSecurity);
switch (actionName) {
case CONFIGURE: {
Logger.debug("In configure statement");
terminalActivity.configure(activityContext);
ActivityPayload resultActivityPayload = terminalActivity.getActivityPayload();
return new ActivityDTO(resultActivityPayload);
}
case RUN: {
Logger.debug("In run statement");
ContainerExecutionContext resultContainerExecutionContext =
createContainerExecutionContext(curDataDTO);
curActivityPayload.setContainerExecutionContext(resultContainerExecutionContext);
// terminalActivity.addOperationalStateToCrateStorage(resultContainerExecutionContext);
String[] scopeParams = params.get("scope");
boolean isChildActivitiesScope = false;
if (CollectionUtils.isNotEmpty(scopeParams)) {
for(String scopeParam : scopeParams) {
if ("childActivities".equalsIgnoreCase(scopeParam)) {
isChildActivitiesScope = true;
break;
}
}
}
if (isChildActivitiesScope) {
Logger.debug("Executing child activity scope");
terminalActivity.runChildActivities(activityContext,
resultContainerExecutionContext);
} else {
terminalActivity.run(activityContext,
resultContainerExecutionContext);
}
// return resultContainerExecutionContext;
break;
}
case ACTIVATE: {
Logger.debug("activating activity");
terminalActivity.activate(activityContext);
//Plan.cs run method line 518 & activate method 258
break;
}
case DEACTIVATE: {
Logger.debug("deactivating activity");
terminalActivity.deactivate(activityContext);
break;
}
case DOCUMENTATION: {
Logger.debug("documentation request");
terminalActivity.getDocumentation(activityContext, "placeholder");
break;
}
default:
Logger.debug("Switch statement fell through to default");
// TODO: Add error message to terminalActivity.getActivityPayload();
}
return new ActivityDTO(terminalActivity.getActivityPayload());
} catch (Exception e) {
Logger.error("There was an exception processing the request", e);
// TODO: Add error message to terminalActivity.getActivityPayload();
}
Logger.debug("HandleFr8Request returning end value");
logWhenRequest(actionName.getLowerValue(), curActivityPayload.getActivityTemplate().getTerminalName(),
curActivityPayload.getId().toString(), "responded");
// TODO: do something with this
return null;
}
/**
* Register an activity to the terminal. This method adds an activity to
* the activityRegistrations map using the payload name as the key
*
* The logic does not attempt to handle duplicate keys. If a key exists, its
* value will be overwritten
*
* @param activity the activity to register
*/
protected void registerActivity(AbstractTerminalActivity<? extends AbstractActivityUI> activity) {
Logger.debug("Registering activity " + activity.getActivityPayload().getName());
activityRegistrations.put(activity.getActivityPayload().getName(), activity);
}
/**
* Helper method which creates a ContainerExecutionContext object from an
* Fr8DataDTO object
* @param dataDTO the Fr8DataDTO object to use to instantiate the
* ContainerExecutionContext object
* @return a ContainerExecutionContext object
*/
private ContainerExecutionContext createContainerExecutionContext(Fr8DataDTO dataDTO) {
PayloadDTO payload = hubCommunicator.getPayload(
(dataDTO.getContainerId() == null) ? UUID.randomUUID().toString() : dataDTO.getContainerId().toString());
if (payload != null) {
return new ContainerExecutionContext(payload.getContainerId(), crateManager.getUpdatableStorage(payload));
}
return null;
}
/**
* Helper method that creates an ActivityContext given a Fr8DataDTO object
* @param fr8Data the Fr8DataDTO object to use to instantiate the
* ActivityContext object
* @return an ActivityContext object
*/
private ActivityContext createActivityContextFromFr8Data(Fr8DataDTO fr8Data) {
ActivityContext ret = new ActivityContext();
if (fr8Data != null) {
ret.setActivityPayload(new ActivityPayload(fr8Data.getActivityPayload()));
ret.setUserId(fr8Data.getActivityPayload().getAuthToken().getUserId());
ret.setAuthorizationToken(fr8Data.getActivityPayload().getAuthToken());
}
Logger.debug("Created activity context for " + fr8Data);
return ret;
}
/**
* Generates an HMAC header that the Hub can use to verify the identity
* of the terminal
* @param currentUserId the ID of the user account on the Hub for which the request
* is being made
* @return a base64 encoded String
*/
public String generateHMACHeader(String currentUserId) {
String headerString = StringUtils.EMPTY;
String endpoint = ApplicationConstants.TERMINAL_HOST;
String terminalSecret = ApplicationConstants.TERMINAL_SECRET;
String terminalId = ApplicationConstants.TERMINAL_ID;
String now = String.valueOf(Calendar.getInstance().getTimeInMillis());
String nonce = UUID.randomUUID().toString();
try {
String url = URLEncoder.encode(endpoint.toLowerCase(), StandardCharsets.UTF_8.name());
//Formulate the keys used in plain format as a concatenated string.
String authenticationKeyString =
terminalId + url + now + nonce + Fr8StringUtils.base64MD5String(StringUtils.EMPTY) + currentUserId;
byte[] secretKeyBase64ByteArray =
terminalSecret.getBytes(StandardCharsets.US_ASCII);//Convert.FromBase64String(terminalSecret);
Mac sha512Hmac = Mac.getInstance(TerminalConstants.HMAC_SHA_512);
SecretKeySpec secretKey =
new SecretKeySpec(secretKeyBase64ByteArray, TerminalConstants.HMAC_SHA_512 );
sha512Hmac.init(secretKey);
byte[] mac_data = sha512Hmac.doFinal(authenticationKeyString.getBytes(StandardCharsets.UTF_8));
headerString = Base64.encode(mac_data);
}catch(NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e){
Logger.error("Exception generating sha512HMAC", e);
}
Logger.debug("Returning headerString: " + headerString);
return "hmac " + headerString;
}
/** Getters & Setters **/
public String getName() {
return name;
}
public T getBaseTerminalEvent() {
return baseTerminalEvent;
}
/** Abstract Methods **/
/**
* Abstract method definition which is meant to respond to the /terminals/discover
* request
*
* @return a StandardFr8TerminalCM object to be added to a crate
*/
public abstract StandardFr8TerminalCM discover();
/**
* Abstract method definition which is executed upon request to /authorization/request_url
*
* @return an ExternalAuthURLDTO object to be packaged in to a crate
*/
public abstract ExternalAuthUrlDTO generateExternalAuthUrl();
/**
* Abstract method definition which is executed when the /authentication/token
* route is requested
* @param externalAuthDTO an ExternalAuthDTO object extracted from the request
* JSON body
* @return an AuthorizationToken object
*/
public abstract AuthorizationToken authenticateToken(ExternalAuthDTO externalAuthDTO);
/**
* Method which requires subclasses to register objects of type
* AbstractTerminalActivity with the terminal service
*/
public abstract void registerActivities();
}
| true |
95143660ad0beb1b72fd5908915bdc802c3efc1d
|
Java
|
Shchava/hospitalServlet
|
/src/test/java/ua/training/servlet/hospital/controller/command/showdiagnosis/AddProcedureTest.java
|
UTF-8
| 6,915 | 2.21875 | 2 |
[] |
no_license
|
package ua.training.servlet.hospital.controller.command.showdiagnosis;
import com.google.gson.Gson;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import ua.training.servlet.hospital.controller.utilities.gson.GsonFactory;
import ua.training.servlet.hospital.entity.User;
import ua.training.servlet.hospital.entity.dto.CommandResponse;
import ua.training.servlet.hospital.entity.dto.CreationResponse;
import ua.training.servlet.hospital.entity.dto.ProcedureDTO;
import ua.training.servlet.hospital.service.procedure.ProcedureService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Locale;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
import static org.mockito.MockitoAnnotations.initMocks;
public class AddProcedureTest {
private Gson gson = GsonFactory.create();
@Mock
private HttpServletRequest request;
@Mock
private ProcedureService procedureService;
@Mock
private HttpSession session;
private User doctor = new User(20L);
@InjectMocks
private AddProcedure addProcedure = new AddProcedure();
private String JSON = "jsonObj";
private BufferedReader reader;
@Captor
private ArgumentCaptor<ProcedureDTO> dtoCaptor;
@Before
public void setUp() throws Exception {
initMocks(this);
given(request.getLocale()).willReturn(Locale.forLanguageTag("en-EN"));
when(request.getSession()).thenReturn(session);
when(session.getAttribute("LoggedUser")).thenReturn(doctor);
given(request.getRequestURI()).willReturn("/patient/2/diagnosis/5/addProcedure/");
given(procedureService.createProcedure(any(),anyLong(),anyLong())).willReturn(true);
given(procedureService.getNumberOfProceduresByDiagnosisId(5L)).willReturn(10L);
}
@Test
public void testAddProcedure () throws IOException {
ProcedureDTO procedure = new ProcedureDTO();
procedure.setName("name");
procedure.setDescription("description");
procedure.setRoom(43);
procedure.setAppointmentDates(new ArrayList<>());
procedure.getAppointmentDates().add(LocalDateTime.now());
String dtoJSON = gson.toJson(procedure);
Reader strReader = new StringReader(dtoJSON);
reader = new BufferedReader(strReader);
when(request.getReader()).thenReturn(reader);
CreationResponse expected = new CreationResponse("created",new ArrayList<>());
CommandResponse response = addProcedure.execute(request);
assertEquals(gson.toJson(expected), response.getResponse());
assertEquals(200, response.getStatus());
verify(procedureService,times(1)).createProcedure(dtoCaptor.capture(),eq(5L),eq(20L));
assertEquals(procedure.getName(),dtoCaptor.getValue().getName());
assertEquals(procedure.getDescription(),dtoCaptor.getValue().getDescription());
assertEquals(procedure.getRoom(),dtoCaptor.getValue().getRoom());
assertEquals(procedure.getAppointmentDates(),dtoCaptor.getValue().getAppointmentDates());
}
@Test
public void testAddProcedureEmptyName () throws IOException {
ProcedureDTO procedure = new ProcedureDTO();
procedure.setName(null);
procedure.setDescription("description");
procedure.setRoom(43);
procedure.setAppointmentDates(new ArrayList<>());
procedure.getAppointmentDates().add(LocalDateTime.now());
String dtoJSON = gson.toJson(procedure);
Reader strReader = new StringReader(dtoJSON);
reader = new BufferedReader(strReader);
when(request.getReader()).thenReturn(reader);
CreationResponse expected = new CreationResponse("creationFailed",new ArrayList<>());
CommandResponse response = addProcedure.execute(request);
CreationResponse creationResponse = gson.fromJson(response.getResponse(), CreationResponse.class);
assertEquals(400, response.getStatus());
assertEquals("creationFailed",creationResponse.getMessage());
assertEquals("name",creationResponse.getErrors().get(0).getCause());
verify(procedureService,times(0)).createProcedure(dtoCaptor.capture(),eq(5L),eq(20L));
}
@Test
public void testAddProcedureEmptyCount () throws IOException {
ProcedureDTO procedure = new ProcedureDTO();
procedure.setName("name");
procedure.setDescription("description");
procedure.setRoom(null);
procedure.setAppointmentDates(new ArrayList<>());
procedure.getAppointmentDates().add(LocalDateTime.now());
String dtoJSON = gson.toJson(procedure);
Reader strReader = new StringReader(dtoJSON);
reader = new BufferedReader(strReader);
when(request.getReader()).thenReturn(reader);
CreationResponse expected = new CreationResponse("creationFailed",new ArrayList<>());
CommandResponse response = addProcedure.execute(request);
CreationResponse creationResponse = gson.fromJson(response.getResponse(), CreationResponse.class);
assertEquals(400, response.getStatus());
assertEquals("creationFailed",creationResponse.getMessage());
assertEquals("room",creationResponse.getErrors().get(0).getCause());
verify(procedureService,times(0)).createProcedure(dtoCaptor.capture(),eq(5L),eq(20L));
}
@Test
public void testAddProcedureMinusCount () throws IOException {
ProcedureDTO procedure = new ProcedureDTO();
procedure.setName("name");
procedure.setDescription("description");
procedure.setRoom(-1);
procedure.setAppointmentDates(new ArrayList<>());
procedure.getAppointmentDates().add(LocalDateTime.now());
String dtoJSON = gson.toJson(procedure);
Reader strReader = new StringReader(dtoJSON);
reader = new BufferedReader(strReader);
when(request.getReader()).thenReturn(reader);
CreationResponse expected = new CreationResponse("creationFailed",new ArrayList<>());
CommandResponse response = addProcedure.execute(request);
CreationResponse creationResponse = gson.fromJson(response.getResponse(), CreationResponse.class);
assertEquals(400, response.getStatus());
assertEquals("creationFailed",creationResponse.getMessage());
assertEquals("room",creationResponse.getErrors().get(0).getCause());
verify(procedureService,times(0)).createProcedure(dtoCaptor.capture(),eq(5L),eq(20L));
}
}
| true |
9b51cf6d9c34f0bba37bd745a5f3f8b3981a690d
|
Java
|
Notelzg/javaReview
|
/jvm/option/Test.java
|
UTF-8
| 997 | 2.890625 | 3 |
[
"Apache-2.0"
] |
permissive
|
package option;
import java.lang.reflect.InvocationTargetException;
public class Test {
private static int race;
public static void increase(){
race++;
}
static class A{
static {
System.out.println("123");
}
}
public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
String s = new String("1123");
String s1 = new String("123");
System.out.println(String.join(s));
System.out.println(s.replace('1', '3'));
System.out.println(s.replace("1", "3"));
Long l = new Long(1);
System.out.println(l.longValue());
Long.valueOf("1");
Long.parseLong("1");
// Class.forName("option.A");
Class a = new Test().getClass().getClassLoader().loadClass("option.A");
A aa = (A)a.newInstance();
a.getMethod("getA", null).invoke(aa);
}
}
| true |
db6e23d82fcf2bf507e6029f67dcb8f59e6dcad9
|
Java
|
jokeofweek/comp361
|
/src/comp361/shared/data/Statistics.java
|
UTF-8
| 2,458 | 2.921875 | 3 |
[] |
no_license
|
package comp361.shared.data;
import java.util.HashMap;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.KryoSerializable;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
public class Statistics {
// Transient for now...
private transient HashMap<String, Object> aStatistics;
private int wins;
private int losses;
private int draws;
public Statistics()
{
aStatistics = new HashMap<String, Object>();
}
/**
* @param pKey
* @return the value associated with this key
*/
public Object getStatisticValue(String pKey)
{
return aStatistics.get(pKey);
}
/**
* @param pKey key of object to add
* @param pValue vale of object to add
*/
public void addStatistic(String pKey, Object pValue)
{
aStatistics.put(pKey, pValue);
}
/**
* @return all of the statistics
*/
public HashMap<String, Object> getStatistics()
{
return aStatistics;
}
/**
* Just make up some statistics for an example
*/
public void initialiseStatisticExample()
{
String[] descriptions = { "Rank", "Games Played", "Games Won", "Ships Sunk", "Enemy Ships Sunk", "K/D Ratio" };
Object[] data = { "Lieutenant", 14, 11, 45, 102, 2.267 };
for(int i = 0; i < descriptions.length; i++)
{
this.addStatistic(descriptions[i], data[i]);
}
}
/**
* Make up some other random stats
*/
public void initialiseOtherStatistics()
{
String[] descriptions = { "Rank", "Games Played", "Games Won", "Ships Sunk", "Enemy Ships Sunk", "K/D Ratio" };
Object[] data = { "Landlubber", 1, 0, 2, 1, 0.005 };
for(int i = 0; i < descriptions.length; i++)
{
this.addStatistic(descriptions[i], data[i]);
}
}
/**
* Make up some other random stats
*/
public void initialiseEvenOtherStatistics()
{
String[] descriptions = { "Rank", "Games Played", "Games Won", "Ships Sunk", "Enemy Ships Sunk", "K/D Ratio" };
Object[] data = { "NOOB", 0, 0, 0, 0, 0 };
for(int i = 0; i < descriptions.length; i++)
{
this.addStatistic(descriptions[i], data[i]);
}
}
public int getWins() {
return wins;
}
public int getDraws() {
return draws;
}
public int getLosses() {
return losses;
}
public int getTotalGames() {
return wins + draws + losses;
}
public void setDraws(int draws) {
this.draws = draws;
}
public void setLosses(int losses) {
this.losses = losses;
}
public void setWins(int wins) {
this.wins = wins;
}
}
| true |
28072d542fa5a33703c564f1fc500aaea1b6b0be
|
Java
|
RiosCreative/JavaPractice
|
/src/test/java/algorithms/search/tests/SearchTests.java
|
UTF-8
| 1,465 | 3.078125 | 3 |
[] |
no_license
|
package algorithms.search.tests;
import static org.junit.jupiter.api.Assertions.*;
import java.util.Arrays;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import algorithms.search.BinarySearch;
import algorithms.search.SequentialSearch;
class SearchTests {
private int[] numbers = { 1, 14, 2, 78, 128, 50, 9, 26, 99 };
private int[] numbersSorted = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
@BeforeEach
void setUp() throws Exception {
}
@Test
void searchingNumbersFor2YieldsIndex2() {
assertEquals(2, SequentialSearch.search(2, numbers));
}
@Test
void searchingNumbersFor128YieldsIndex4() {
assertEquals(4, SequentialSearch.search(128, numbers));
}
@Test
void searchingNumbersFor99YieldsIndex8() {
assertEquals(8, SequentialSearch.search(99, numbers));
}
@Test
void binarySearchOfNumbersSortedFor4YieldsIndex3() {
assertEquals(3, BinarySearch.binarySearch(4, numbersSorted));
assertEquals(3, BinarySearch.binarySearchRecursive(4, numbersSorted, 0, 14));
}
@Test
void binarySearchOfNumbersSortedFor8YieldsIndex7() {
assertEquals(7, BinarySearch.binarySearch(8, numbersSorted));
assertEquals(7, BinarySearch.binarySearchRecursive(8, numbersSorted, 0, 14));
}
@Test
void binarySearchOfNumbersSortedFor12YieldsIndex11() {
assertEquals(11, BinarySearch.binarySearch(12, numbersSorted));
assertEquals(11, BinarySearch.binarySearchRecursive(12, numbersSorted, 0, 14));
}
}
| true |
2c3018bc766327ad17525c7114572ddb5e9e8945
|
Java
|
cha63506/CompSecurity
|
/Shopping/flipp_source/src/com/wishabi/flipp/app/aw.java
|
UTF-8
| 1,189 | 1.617188 | 2 |
[] |
no_license
|
// 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.wishabi.flipp.app;
import android.content.SharedPreferences;
import com.wishabi.flipp.content.SearchTermProvider;
import com.wishabi.flipp.content.aj;
// Referenced classes of package com.wishabi.flipp.app:
// FlippApplication
final class aw
implements android.content.SharedPreferences.OnSharedPreferenceChangeListener
{
final FlippApplication a;
aw(FlippApplication flippapplication)
{
a = flippapplication;
super();
}
public final void onSharedPreferenceChanged(SharedPreferences sharedpreferences, String s)
{
if (s.equals("postal_code") || s.equals("allow_push"))
{
FlippApplication.a(a);
} else
if (s.equals("keep_search_history"))
{
boolean flag = sharedpreferences.getBoolean("keep_search_history", true);
if (!flag)
{
aj.a(FlippApplication.b());
}
SearchTermProvider.a(flag);
return;
}
}
}
| true |
c22ff354859791f684d4768dd2fa897e1da8dab3
|
Java
|
aritzg/mShowCase-portlet
|
/docroot/WEB-INF/src/net/sareweb/mshowcase/service/persistence/OfferPersistenceImpl.java
|
UTF-8
| 20,508 | 1.507813 | 2 |
[] |
no_license
|
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* 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.
*/
package net.sareweb.mshowcase.service.persistence;
import com.liferay.portal.NoSuchModelException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.BatchSessionUtil;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
import net.sareweb.mshowcase.NoSuchOfferException;
import net.sareweb.mshowcase.model.Offer;
import net.sareweb.mshowcase.model.impl.OfferImpl;
import net.sareweb.mshowcase.model.impl.OfferModelImpl;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* The persistence implementation for the offer service.
*
* <p>
* Caching information and settings can be found in <code>portal.properties</code>
* </p>
*
* @author Aritz Galdos
* @see OfferPersistence
* @see OfferUtil
* @generated
*/
public class OfferPersistenceImpl extends BasePersistenceImpl<Offer>
implements OfferPersistence {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify or reference this class directly. Always use {@link OfferUtil} to access the offer persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
*/
public static final String FINDER_CLASS_NAME_ENTITY = OfferImpl.class.getName();
public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
".List1";
public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
".List2";
public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferModelImpl.FINDER_CACHE_ENABLED, OfferImpl.class,
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferModelImpl.FINDER_CACHE_ENABLED, OfferImpl.class,
FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferModelImpl.FINDER_CACHE_ENABLED, Long.class,
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
/**
* Caches the offer in the entity cache if it is enabled.
*
* @param offer the offer
*/
public void cacheResult(Offer offer) {
EntityCacheUtil.putResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offer.getPrimaryKey(), offer);
offer.resetOriginalValues();
}
/**
* Caches the offers in the entity cache if it is enabled.
*
* @param offers the offers
*/
public void cacheResult(List<Offer> offers) {
for (Offer offer : offers) {
if (EntityCacheUtil.getResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offer.getPrimaryKey()) == null) {
cacheResult(offer);
}
else {
offer.resetOriginalValues();
}
}
}
/**
* Clears the cache for all offers.
*
* <p>
* The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
* </p>
*/
@Override
public void clearCache() {
if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
CacheRegistryUtil.clear(OfferImpl.class.getName());
}
EntityCacheUtil.clearCache(OfferImpl.class.getName());
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
/**
* Clears the cache for the offer.
*
* <p>
* The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
* </p>
*/
@Override
public void clearCache(Offer offer) {
EntityCacheUtil.removeResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offer.getPrimaryKey());
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
/**
* Creates a new offer with the primary key. Does not add the offer to the database.
*
* @param offerId the primary key for the new offer
* @return the new offer
*/
public Offer create(long offerId) {
Offer offer = new OfferImpl();
offer.setNew(true);
offer.setPrimaryKey(offerId);
return offer;
}
/**
* Removes the offer with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the offer
* @return the offer that was removed
* @throws com.liferay.portal.NoSuchModelException if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public Offer remove(Serializable primaryKey)
throws NoSuchModelException, SystemException {
return remove(((Long)primaryKey).longValue());
}
/**
* Removes the offer with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param offerId the primary key of the offer
* @return the offer that was removed
* @throws net.sareweb.mshowcase.NoSuchOfferException if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public Offer remove(long offerId)
throws NoSuchOfferException, SystemException {
Session session = null;
try {
session = openSession();
Offer offer = (Offer)session.get(OfferImpl.class,
Long.valueOf(offerId));
if (offer == null) {
if (_log.isWarnEnabled()) {
_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + offerId);
}
throw new NoSuchOfferException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
offerId);
}
return offerPersistence.remove(offer);
}
catch (NoSuchOfferException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
/**
* Removes the offer from the database. Also notifies the appropriate model listeners.
*
* @param offer the offer
* @return the offer that was removed
* @throws SystemException if a system exception occurred
*/
@Override
public Offer remove(Offer offer) throws SystemException {
return super.remove(offer);
}
@Override
protected Offer removeImpl(Offer offer) throws SystemException {
offer = toUnwrappedModel(offer);
Session session = null;
try {
session = openSession();
BatchSessionUtil.delete(session, offer);
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
EntityCacheUtil.removeResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offer.getPrimaryKey());
return offer;
}
@Override
public Offer updateImpl(net.sareweb.mshowcase.model.Offer offer,
boolean merge) throws SystemException {
offer = toUnwrappedModel(offer);
Session session = null;
try {
session = openSession();
BatchSessionUtil.update(session, offer, merge);
offer.setNew(false);
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
EntityCacheUtil.putResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offer.getPrimaryKey(), offer);
return offer;
}
protected Offer toUnwrappedModel(Offer offer) {
if (offer instanceof OfferImpl) {
return offer;
}
OfferImpl offerImpl = new OfferImpl();
offerImpl.setNew(offer.isNew());
offerImpl.setPrimaryKey(offer.getPrimaryKey());
offerImpl.setOfferId(offer.getOfferId());
offerImpl.setInstanceId(offer.getInstanceId());
offerImpl.setOfferText(offer.getOfferText());
offerImpl.setBeginDate(offer.getBeginDate());
offerImpl.setEndDate(offer.getEndDate());
offerImpl.setPrice(offer.getPrice());
offerImpl.setTransactions(offer.getTransactions());
offerImpl.setImageId(offer.getImageId());
offerImpl.setImageURL(offer.getImageURL());
offerImpl.setUserId(offer.getUserId());
offerImpl.setCompanyId(offer.getCompanyId());
offerImpl.setCreateDate(offer.getCreateDate());
offerImpl.setModifyDate(offer.getModifyDate());
return offerImpl;
}
/**
* Returns the offer with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
*
* @param primaryKey the primary key of the offer
* @return the offer
* @throws com.liferay.portal.NoSuchModelException if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public Offer findByPrimaryKey(Serializable primaryKey)
throws NoSuchModelException, SystemException {
return findByPrimaryKey(((Long)primaryKey).longValue());
}
/**
* Returns the offer with the primary key or throws a {@link net.sareweb.mshowcase.NoSuchOfferException} if it could not be found.
*
* @param offerId the primary key of the offer
* @return the offer
* @throws net.sareweb.mshowcase.NoSuchOfferException if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public Offer findByPrimaryKey(long offerId)
throws NoSuchOfferException, SystemException {
Offer offer = fetchByPrimaryKey(offerId);
if (offer == null) {
if (_log.isWarnEnabled()) {
_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + offerId);
}
throw new NoSuchOfferException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
offerId);
}
return offer;
}
/**
* Returns the offer with the primary key or returns <code>null</code> if it could not be found.
*
* @param primaryKey the primary key of the offer
* @return the offer, or <code>null</code> if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public Offer fetchByPrimaryKey(Serializable primaryKey)
throws SystemException {
return fetchByPrimaryKey(((Long)primaryKey).longValue());
}
/**
* Returns the offer with the primary key or returns <code>null</code> if it could not be found.
*
* @param offerId the primary key of the offer
* @return the offer, or <code>null</code> if a offer with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
public Offer fetchByPrimaryKey(long offerId) throws SystemException {
Offer offer = (Offer)EntityCacheUtil.getResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offerId);
if (offer == _nullOffer) {
return null;
}
if (offer == null) {
Session session = null;
boolean hasException = false;
try {
session = openSession();
offer = (Offer)session.get(OfferImpl.class,
Long.valueOf(offerId));
}
catch (Exception e) {
hasException = true;
throw processException(e);
}
finally {
if (offer != null) {
cacheResult(offer);
}
else if (!hasException) {
EntityCacheUtil.putResult(OfferModelImpl.ENTITY_CACHE_ENABLED,
OfferImpl.class, offerId, _nullOffer);
}
closeSession(session);
}
}
return offer;
}
/**
* Returns all the offers.
*
* @return the offers
* @throws SystemException if a system exception occurred
*/
public List<Offer> findAll() throws SystemException {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
}
/**
* Returns a range of all the offers.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of offers
* @param end the upper bound of the range of offers (not inclusive)
* @return the range of offers
* @throws SystemException if a system exception occurred
*/
public List<Offer> findAll(int start, int end) throws SystemException {
return findAll(start, end, null);
}
/**
* Returns an ordered range of all the offers.
*
* <p>
* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
* </p>
*
* @param start the lower bound of the range of offers
* @param end the upper bound of the range of offers (not inclusive)
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
* @return the ordered range of offers
* @throws SystemException if a system exception occurred
*/
public List<Offer> findAll(int start, int end,
OrderByComparator orderByComparator) throws SystemException {
FinderPath finderPath = null;
Object[] finderArgs = new Object[] { start, end, orderByComparator };
if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
(orderByComparator == null)) {
finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
finderArgs = FINDER_ARGS_EMPTY;
}
else {
finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
finderArgs = new Object[] { start, end, orderByComparator };
}
List<Offer> list = (List<Offer>)FinderCacheUtil.getResult(finderPath,
finderArgs, this);
if (list == null) {
StringBundler query = null;
String sql = null;
if (orderByComparator != null) {
query = new StringBundler(2 +
(orderByComparator.getOrderByFields().length * 3));
query.append(_SQL_SELECT_OFFER);
appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
orderByComparator);
sql = query.toString();
}
else {
sql = _SQL_SELECT_OFFER.concat(OfferModelImpl.ORDER_BY_JPQL);
}
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
if (orderByComparator == null) {
list = (List<Offer>)QueryUtil.list(q, getDialect(), start,
end, false);
Collections.sort(list);
}
else {
list = (List<Offer>)QueryUtil.list(q, getDialect(), start,
end);
}
}
catch (Exception e) {
throw processException(e);
}
finally {
if (list == null) {
FinderCacheUtil.removeResult(finderPath, finderArgs);
}
else {
cacheResult(list);
FinderCacheUtil.putResult(finderPath, finderArgs, list);
}
closeSession(session);
}
}
return list;
}
/**
* Removes all the offers from the database.
*
* @throws SystemException if a system exception occurred
*/
public void removeAll() throws SystemException {
for (Offer offer : findAll()) {
offerPersistence.remove(offer);
}
}
/**
* Returns the number of offers.
*
* @return the number of offers
* @throws SystemException if a system exception occurred
*/
public int countAll() throws SystemException {
Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY, this);
if (count == null) {
Session session = null;
try {
session = openSession();
Query q = session.createQuery(_SQL_COUNT_OFFER);
count = (Long)q.uniqueResult();
}
catch (Exception e) {
throw processException(e);
}
finally {
if (count == null) {
count = Long.valueOf(0);
}
FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY, count);
closeSession(session);
}
}
return count.intValue();
}
/**
* Initializes the offer persistence.
*/
public void afterPropertiesSet() {
String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
com.liferay.util.service.ServiceProps.get(
"value.object.listener.net.sareweb.mshowcase.model.Offer")));
if (listenerClassNames.length > 0) {
try {
List<ModelListener<Offer>> listenersList = new ArrayList<ModelListener<Offer>>();
for (String listenerClassName : listenerClassNames) {
listenersList.add((ModelListener<Offer>)InstanceFactory.newInstance(
listenerClassName));
}
listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
}
catch (Exception e) {
_log.error(e);
}
}
}
public void destroy() {
EntityCacheUtil.removeCache(OfferImpl.class.getName());
FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
@BeanReference(type = ActivityPersistence.class)
protected ActivityPersistence activityPersistence;
@BeanReference(type = CategoryPersistence.class)
protected CategoryPersistence categoryPersistence;
@BeanReference(type = DealPersistence.class)
protected DealPersistence dealPersistence;
@BeanReference(type = FriendshipPersistence.class)
protected FriendshipPersistence friendshipPersistence;
@BeanReference(type = InstancePersistence.class)
protected InstancePersistence instancePersistence;
@BeanReference(type = InstanceImagePersistence.class)
protected InstanceImagePersistence instanceImagePersistence;
@BeanReference(type = LocationPersistence.class)
protected LocationPersistence locationPersistence;
@BeanReference(type = OfferPersistence.class)
protected OfferPersistence offerPersistence;
@BeanReference(type = ResourcePersistence.class)
protected ResourcePersistence resourcePersistence;
@BeanReference(type = UserPersistence.class)
protected UserPersistence userPersistence;
private static final String _SQL_SELECT_OFFER = "SELECT offer FROM Offer offer";
private static final String _SQL_COUNT_OFFER = "SELECT COUNT(offer) FROM Offer offer";
private static final String _ORDER_BY_ENTITY_ALIAS = "offer.";
private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Offer exists with the primary key ";
private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
private static Log _log = LogFactoryUtil.getLog(OfferPersistenceImpl.class);
private static Offer _nullOffer = new OfferImpl() {
@Override
public Object clone() {
return this;
}
@Override
public CacheModel<Offer> toCacheModel() {
return _nullOfferCacheModel;
}
};
private static CacheModel<Offer> _nullOfferCacheModel = new CacheModel<Offer>() {
public Offer toEntityModel() {
return _nullOffer;
}
};
}
| true |
d60ed8c1c0366dc05bedb27b996daf234af8025e
|
Java
|
zelax-bot/leetcode
|
/Easy/CheckArrayFormationThroughConcatenation.java
|
UTF-8
| 1,525 | 3.359375 | 3 |
[] |
no_license
|
package Easy;
import java.util.Arrays;
import java.util.Comparator;
public class CheckArrayFormationThroughConcatenation {
public boolean canFormArray(int[] arr, int[][] pieces) {
boolean[] arrMatch = new boolean[arr.length];
Arrays.fill(arrMatch, false);
Arrays.sort(pieces, Comparator.comparingInt(o -> -o.length));
for (int[] piece : pieces) {
int matchStartIndex = match(arr, piece, arrMatch);
if (matchStartIndex == -1)
return false;
for (int i = 0; i < piece.length; i++)
arrMatch[i + matchStartIndex] = true;
}
for (boolean match : arrMatch)
if (!match)
return false;
return true;
}
private int match(int[] arr, int[] piece, boolean[] arrMatch) {
int index = -1;
for (int i = 0; i < arr.length; i++) {
if (arr[i] == piece[0] && !arrMatch[i]) {
boolean match = true;
for (int j = 0; j < piece.length; j++) {
if (j + i >= arr.length) {
match = false;
break;
}
if (arr[j + i] != piece[j])
match = false;
if (arrMatch[j + i])
match = false;
}
if (match) {
index = i;
break;
}
}
}
return index;
}
}
| true |
a8ba45c6ce34d73bcb7fb4cd48b10edabcd1ff3f
|
Java
|
188383/BeerApp
|
/app/src/main/java/project/pwr/beer/MainActivity.java
|
UTF-8
| 4,439 | 2.125 | 2 |
[] |
no_license
|
package project.pwr.beer;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONObject;
import project.pwr.database.Beer;
import project.pwr.database.BeerDBHelper;
import project.pwr.database.DataProc;
import project.pwr.database.DecodeClass;
import project.pwr.database.Location;
import project.pwr.database.Mapping;
import static android.content.Context.*;
public class MainActivity extends Activity {
private String USER_NAME=null;
private String EMAIL=null;
private boolean registered =false;
public static final String USER = "com.beer.drinker";
public static final String PASS = "com.beer.pass";
static final int REGISTER_USER = 1;
public void onSavedInstanceState(Bundle savedInstanceState){
savedInstanceState.putString(USER,USER_NAME);
savedInstanceState.putString(PASS,EMAIL);
}
public void onResume(){
super.onResume();
Context context = getApplicationContext();
SharedPreferences sharedPreferences = context.getSharedPreferences(getString(R.string.credentials), MODE_PRIVATE);
USER_NAME = sharedPreferences.getString(USER,null);
EMAIL = sharedPreferences.getString(PASS,null);
if(USER_NAME!=null && EMAIL!=null) {
Log.d("Here",EMAIL);
new UpdateClass().execute("5", USER_NAME, EMAIL);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Context ctx = getApplicationContext();
SharedPreferences sharedPreferences = ctx.getSharedPreferences(getString(R.string.credentials), MODE_PRIVATE);
USER_NAME = sharedPreferences.getString(USER,null);
EMAIL = sharedPreferences.getString(PASS,null);
if(USER_NAME==null&&EMAIL==null){
Intent intent = new Intent(this,OptionsActivity.class);
startActivity(intent);
}
Button listBeers = (Button)findViewById(R.id.list_beers);
Button location = (Button)findViewById(R.id.location);
location.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(),LocationActivity.class);
startActivity(intent);
}
});
listBeers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),BeerActivity.class));
}
});
}
private class UpdateClass extends AsyncTask<String,Void,String>{
public UpdateClass(){
super();
}
@Override
protected String doInBackground(String... params) {
String answer=null;
String post = null;
try{
DataProc proc = new DataProc();
post = proc.buildPost(params);
answer = proc.postData(post);
DecodeClass dc = new DecodeClass(getApplicationContext());
dc.decodeData(answer);
// BeerDBHelper helper = new BeerDBHelper(getApplicationContext());
// JSONObject j = new JSONObject(answer);
// Location b = new Location((j.getJSONArray("locations")).getJSONObject(0));
// helper.insertLocation(b.getName(),b.getLat(),b.getLon());
// helper.close();
}catch(Exception e){
//answer = null;
Log.d("Error",e.getMessage());
}
return answer;
}
protected void onPostExecute(String string) {
String text = null;// string;
text = string;
Context context = getApplicationContext();
int duration = Toast.LENGTH_LONG;
//String text = Long.toString(1);
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
}
}
| true |
93c9e74e396961758744629f0242260b8f577b66
|
Java
|
hjm142531/testgit
|
/dashixun/src/com/bw/hu/lianxi/LianxiFanshe.java
|
GB18030
| 476 | 2.375 | 2 |
[] |
no_license
|
/**
*
*/
package com.bw.hu.lianxi;
/**
* @author
*
* 2018287:15:57
*/
public class LianxiFanshe {
public static void main(String[] args) {
Class<? extends Class> class1 = Student.class.getClass();
try {
Class newInstance = class1.newInstance();
Student newInstance2 = (Student)newInstance.newInstance();
newInstance2.getAge();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| true |
dc86ad8de3779aa312f929151fbe8029ea299a46
|
Java
|
SunithM/LeetCode
|
/OneDrive/Documents/workspace-spring-tool-suite-4-4.5.1.RELEASE/LeetCode/src/challenges/RichestCustomerWealth.java
|
UTF-8
| 577 | 3.078125 | 3 |
[] |
no_license
|
package challenges;
public class RichestCustomerWealth {
public static int maximumWealth(int[][] accounts) {
int max=Integer.MIN_VALUE;
for(int j=0;j<accounts.length;j++) {
if(max< money(accounts[j])) {
max=money(accounts[j]);
}
}
return max;
}
private static int money(int[] is) {
int count=0;
for(int i=0;i<is.length;i++) {
count=count+is[i];
}
return count;
}
public static void main(String[] args) {
int [][] accounts= {{1,2,3},{3,10,1},{2,4,70}};
System.out.println(maximumWealth(accounts));
}
}
| true |
513d5fdb8bdfadc9b55c35def0458c7b46373d46
|
Java
|
RichardBrochini/clienteCaixa
|
/src/Envio.java
|
UTF-8
| 499 | 2.875 | 3 |
[] |
no_license
|
import java.io.IOException;
import java.io.OutputStream;
import java.util.Formatter;
import javax.swing.JOptionPane;
public class Envio{
private Conectar sock;
private Formatter saida;
public Envio(Conectar sock){
this.sock = sock;
try {
this.saida = new Formatter(this.sock.getSock().getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
public void enviarMsg(String msg){
msg = msg+"\0";
this.saida.format(msg);
this.saida.flush();
}
}
| true |
5b8c1dac73d33c270e24ad6187263abeb29fc161
|
Java
|
Marcoshsc/prog2_gestao_universitaria
|
/src/interfacegrafica/AcaoExcluirAluno.java
|
UTF-8
| 1,925 | 2.6875 | 3 |
[] |
no_license
|
package interfacegrafica;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import complementares.Utilitario;
import ensino.secaodisciplina.GerenciadorDisciplinas;
import pessoas.classealuno.Aluno;
import pessoas.classealuno.GerenciadorAluno;
import sistema.classes.ServidorArmazenamento;
public class AcaoExcluirAluno implements ActionListener {
private JanelaPrincipal parent;
private JTextField cpfCampo;
/**
*
* @param parent JanelaPrincipal que possui o objeto
* @param cpfCampo: JTextField referente ao CPF do aluno
*/
protected AcaoExcluirAluno(JanelaPrincipal parent, JTextField cpfCampo) {
this.parent = parent;
this.cpfCampo = cpfCampo;
}
/**
*
* @param e: clicar no botão de excluir aluno.
*/
@Override
public void actionPerformed(ActionEvent e) {
Aluno alunoPrevio = ServidorArmazenamento.gerenciadorAlunos.pesquisarAlunoCPF(Utilitario.formataCampo(this.cpfCampo));
if(alunoPrevio != null) {
if(alunoPrevio.temVinculo() || GerenciadorDisciplinas.verificaVinculoAluno(alunoPrevio)) {
this.parent.erroPreenchimento("Não foi possível excluir aluno pois existe vínculo com disciplinas concluídas e/ou turmas.");
return;
}
GerenciadorAluno.excluir(alunoPrevio);
JOptionPane.showMessageDialog(this.parent, "Aluno excluído com sucesso.", "INFO", JOptionPane.INFORMATION_MESSAGE);
this.parent.cadastroAluno.setVisible(false);
this.parent.painelOpcoesAluno.setVisible(true);
}
else {
this.parent.erroPreenchimento("ALUNO NÃO EXISTE. IMPOSSÍVEL EXCLUIR.");
this.parent.cadastroAluno.setVisible(false);
this.parent.painelOpcoesAluno.setVisible(true);
}
}
}
| true |