blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
69c2b4bbd671414fb4d62b55d1977938eecfb9fd | f3ad3448ab3582a3c1976eb323f4af67747e6e83 | /Romo/src/romo/RomoActivity.java | 20d43b7a6ceb7cb7a052a6297da411c68860ebe2 | [] | no_license | SteveVandenbussche/romo | 8eaa8dfd91ca3be1c57b283cfe8fbf8a84062014 | c3f62d15a7444cb72264202c08da6c980455e1ce | refs/heads/master | 2021-01-23T22:53:47.093210 | 2013-05-03T12:21:44 | 2013-05-03T12:21:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,725 | java | package romo;
import media.MediaActivity;
import android.app.ActionBar;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Face;
import android.hardware.Camera.FaceDetectionListener;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.GestureDetectorCompat;
import android.util.Log;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.Surface;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.FrameLayout;
import android.widget.Switch;
import android.widget.Toast;
import com.example.romo.R;
import discovery.DiscoverActivity;
public class RomoActivity extends Activity {
// Debugging
public static final String TAG = "RomoActivity";
// Intent request codes
private static final int REQUEST_ENABLE_BT = 0;
private static final int REQUEST_DISCOVER_BT = 1;
private static final int REQUEST_MEDIAPLAYER = 2;
// Local Bluetooth adapter
private BluetoothAdapter oAdapter;
// The BluetoothService
private BluetoothService oBluetootService;
// Detects various gestures and touch events
private GestureDetectorCompat oDetector;
// Client for camera service, which manages the actual camera hardware
private Camera oCamera;
// SurfaceView that can display the live image data coming from the camera
private CameraPreview oPreview;
/**
* Activity initialisation
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "onCreate called");
// Setup window
setContentView(R.layout.activity_romo);
// Get local Bluetooth adapter
oAdapter = BluetoothAdapter.getDefaultAdapter();
// If the adpater is null, then Bleutooth is not supported
if(oAdapter == null){
Toast.makeText(this, R.string.bluetooth_availability, Toast.LENGTH_LONG).show();
finish();
}
oBluetootService = new BluetoothService(this, oHandler);
oDetector = new GestureDetectorCompat(this, GestureListener);
// Get acces to front camera
oCamera = getFrontCamera();
// Setup camera preview and face detection listener
if(oCamera != null){
oPreview = new CameraPreview(this, oCamera);
FrameLayout preview = (FrameLayout)findViewById(R.id.camera_preview);
preview.addView(oPreview);
oCamera.setFaceDetectionListener(oFaceDetectionListener);
oCamera.stopPreview();
}else{
Toast.makeText(this, R.string.camera_availability, Toast.LENGTH_LONG).show();
}
getActionBar().hide();
}
/**
* Start intent to enable Bluetooth if it's not on
*/
@Override
protected void onStart() {
super.onStart();
Log.d(TAG, "onStart called");
if(!oAdapter.isEnabled()){
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
oBluetootService.stop();
}
/**
* Receive the result from a previous launched activity
*/
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, "onActivityResult called " + resultCode);
switch (requestCode) {
// When the Bluetooth enable activity returns
case REQUEST_ENABLE_BT:
// Bluetooth is enabled now
if(resultCode == Activity.RESULT_OK){
Log.d(TAG, "Bluetooth enabled");
// or something went wrong
}else{
Toast.makeText(this, R.string.bluetooth_not_enabled, Toast.LENGTH_LONG).show();
finish();
}
break;
// When the Discover activity returns
case REQUEST_DISCOVER_BT:
// Attempt to connect to the device
if(resultCode == Activity.RESULT_OK){
String address = data.getStringExtra(DiscoverActivity.EXTRA_DEVICE_ADDRESS);
BluetoothDevice device = oAdapter.getRemoteDevice(address);
oBluetootService.connect(device);
}
break;
// When the Media activity returns
case REQUEST_MEDIAPLAYER:
if(resultCode == Activity.RESULT_OK){
oCamera.stopFaceDetection();
oCamera.stopPreview();
}
default:
break;
}
}
/**
* Get front camera
* @return
*/
public Camera getFrontCamera(){
Log.d(TAG, "acces front camera");
Camera c = null;
CameraInfo cInfo = new CameraInfo();
// Get the rotation of the screen from its "natural" orientation
int rotation = getWindowManager().getDefaultDisplay().getRotation();
int degrees = 0;
// Convert rotation ID to actual degrees
switch (rotation) {
case Surface.ROTATION_0: degrees = 0; break;
case Surface.ROTATION_90: degrees = 90; break;
case Surface.ROTATION_180: degrees = 180; break;
case Surface.ROTATION_270: degrees = 270; break;
}
// Try to access the front camera
try{
int numCams = Camera.getNumberOfCameras();
for(int i=0; i<numCams; i++){
Camera.getCameraInfo(i, cInfo);
if(cInfo.facing == CameraInfo.CAMERA_FACING_FRONT){
c = Camera.open(i);
// Set camera orientation identical to the display orientation
int result = (cInfo.orientation + degrees) % 360;
result = (360 - result) % 360;
c.setDisplayOrientation(result);
break;
}
}
}catch(Exception e){
Log.e(TAG, "acces camera failed",e);
}
return c;
}
/**
* Inflate and configure menu
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.romo, menu);
// Configure switch
Switch serviceSwitch = (Switch)menu.findItem(R.id.action_service).getActionView();
serviceSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.d(TAG, "onCheckedChanged called " + isChecked);
if(isChecked){
// Attemp to start the BluetoothService by doing a Bluetooth discovery
Intent discoverIntent = new Intent(getApplicationContext(), DiscoverActivity.class);
startActivityForResult(discoverIntent, REQUEST_DISCOVER_BT);
}else{
// Stop BluetoothService
oBluetootService.stop();
}
}
});
return true;
}
/**
* Analayse the given MotionEvent and triggers the appropriate callbacks
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
oDetector.onTouchEvent(event);
return super.onTouchEvent(event);
}
/**
* The gesture listener, used for handling simple gestures such as double touches, scrolls, and flings.
*/
private final SimpleOnGestureListener GestureListener = new SimpleOnGestureListener(){
public boolean onDown(MotionEvent e) {
Log.d(TAG, "onDown called");
return true;
};
public boolean onDoubleTap(MotionEvent e) {
Log.d(TAG, "onDoubleTap called");
//ActionBar actionBar = getActionBar();
/*if(actionBar.isShowing()){
actionBar.hide();
}else{
actionBar.show();
}*/
oCamera.startPreview();
oCamera.startFaceDetection();
return true;
};
};
/**
* Handle messages from the BluetoothService
*/
private Handler oHandler = new Handler(){
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case BluetoothService.MESSAGE_DATA:
//byte[] readBuf = (byte[])msg.obj;
Log.i("HANDLER", "!data received " + msg.arg1);
break;
case BluetoothService.MESSAGE_STATE_CHANGED:
Bundle bundle = msg.getData();
String deviceName = bundle.getString(BluetoothService.KEY_DEVICE_NAME);
int currentState = bundle.getInt(BluetoothService.KEY_CURRENT_STATE);
int nextState = bundle.getInt(BluetoothService.KEY_NEXT_STATE);
if((currentState == BluetoothService.STATE_NONE) && (nextState == BluetoothService.STATE_CONNECTING)){
Toast.makeText(getApplicationContext(), "Connection with device " + deviceName + ".", Toast.LENGTH_SHORT).show();
}else if((currentState == BluetoothService.STATE_CONNECTING) && (nextState == BluetoothService.STATE_NONE)) {
Toast.makeText(getApplicationContext(), "Connection with device " + deviceName + " failed.", Toast.LENGTH_LONG).show();
// Uncheck service switch, this will also stop the BluetoothService
CompoundButton serviceSwitch = (CompoundButton)findViewById(R.id.action_service);
serviceSwitch.setChecked(false);
}else if((currentState == BluetoothService.STATE_CONNECTING) && (nextState == BluetoothService.STATE_CONNECTED)){
Toast.makeText(getApplicationContext(), "Connection established with: " + deviceName, Toast.LENGTH_SHORT).show();
}else if((currentState == BluetoothService.STATE_CONNECTED) && (nextState == BluetoothService.STATE_NONE)){
Toast.makeText(getApplicationContext(), "Connection with " + deviceName + " closed", Toast.LENGTH_LONG).show();
// Uncheck service switch, this will also stop the BluetoothService
CompoundButton serviceSwitch = (CompoundButton)findViewById(R.id.action_service);
serviceSwitch.setChecked(false);
}else if(currentState != nextState){
// This state will normally never occure
Log.w(TAG, "Invalid transition: " + currentState + "-" + nextState);
}
default:
break;
}
};
};
private FaceDetectionListener oFaceDetectionListener = new FaceDetectionListener() {
@Override
public void onFaceDetection(Face[] faces, Camera camera) {
if(faces.length > 0){
// Stop face detection
camera.stopFaceDetection();
Intent intent = new Intent(getApplicationContext(), MediaActivity.class);
if(faces.length == 1){
intent.putExtra(MediaActivity.MEDIA, "sdcard/video/romo/Romo_Knipoog_High.mp4");
}else{
intent.putExtra(MediaActivity.MEDIA, "sdcard/video/romo/Romo_Vrolijk.mp4");
}
startActivityForResult(intent, REQUEST_MEDIAPLAYER);
}
}
};
}
| [
"SteveVdb@172.30.27.234"
] | SteveVdb@172.30.27.234 |
dd5776f4ba94b74f778d86acac8712eaf05d2531 | a85f45910dda537d8e274474d5fc488c0d9ed1f3 | /src/pl/edu/uwm/wmii/Krystian_Gasior/laboratorium01/Zadanie21b.java | d288f8015f6a20e0a51fe1bc7df09ec7fa755c7d | [] | no_license | Krystian6991/ZPO-GasiorKrystian | e966ca9b50d252fe17a9ad612a47f0c5e7e70eb1 | f6aa5672ce3f706735013810715a3545bd63040b | refs/heads/main | 2023-06-09T15:41:59.587627 | 2021-06-27T11:46:04 | 2021-06-27T11:46:04 | 349,995,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package pl.edu.uwm.wmii.Krystian_Gasior.laboratorium01;
import java.util.Scanner;
public class Zadanie21b {
public static void main(String[] args) {
int ile=0;
System.out.print("Podaj liczbe n: ");
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for(int i=0;i<n;i++)
{
System.out.print("Podaj liczbe: ");
Scanner in1 = new Scanner(System.in);
int x = in1.nextInt();
if(x%5!=0 && x%3==0) {
ile++;
}
}
System.out.println("Wynik: "+ile);
}
}
| [
"80976080+Krystian6991@users.noreply.github.com"
] | 80976080+Krystian6991@users.noreply.github.com |
4a5f74dd905af49c5c79d07f0418921a6419e943 | 64b47f83d313af33804b946d0613760b8ff23840 | /tags/stable-3-2/weka/gui/GenericObjectEditor.java | 4781f0ae9180e59613405244fde5986a91652c8f | [] | no_license | hackerastra/weka | afde1c7ab0fbf374e6d6ac6d07220bfaffb9488c | c8366c454e9718d0e1634ddf4a72319dac3ce559 | refs/heads/master | 2021-05-28T08:25:33.811203 | 2015-01-22T03:12:18 | 2015-01-22T03:12:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,220 | java | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* GenericObjectEditor.java
* Copyright (C) 1999 Len Trigg
*
*/
package weka.gui;
import weka.core.OptionHandler;
import weka.core.Utils;
import weka.core.Tag;
import weka.core.SelectedTag;
import weka.core.SerializedObject;
import weka.core.Utils;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyEditor;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
/**
* A PropertyEditor for objects that themselves have been defined as
* editable in the GenericObjectEditor configuration file, which lists
* possible values that can be selected from, and themselves configured.
* The configuration file is called "GenericObjectEditor.props" and
* may live in either the location given by "user.home" or the current
* directory (this last will take precedence), and a default properties
* file is read from the weka distribution. For speed, the properties
* file is read only once when the class is first loaded -- this may need
* to be changed if we ever end up running in a Java OS ;-).
*
* @author Len Trigg (trigg@cs.waikato.ac.nz)
* @version $Revision: 1.26 $
*/
public class GenericObjectEditor implements PropertyEditor {
/** The classifier being configured */
private Object m_Object;
/** Holds a copy of the current classifier that can be reverted to
if the user decides to cancel */
private Object m_Backup;
/** Handles property change notification */
private PropertyChangeSupport m_Support = new PropertyChangeSupport(this);
/** The Class of objects being edited */
private Class m_ClassType;
/** The GUI component for editing values, created when needed */
private GOEPanel m_EditorComponent;
/** True if the GUI component is needed */
private boolean m_Enabled = true;
/** The name of the properties file */
protected static String PROPERTY_FILE = "weka/gui/GenericObjectEditor.props";
/** Contains the editor properties */
private static Properties EDITOR_PROPERTIES;
/** Loads the configuration property file */
static {
// Allow a properties file in the current directory to override
try {
EDITOR_PROPERTIES = Utils.readProperties(PROPERTY_FILE);
java.util.Enumeration keys =
(java.util.Enumeration)EDITOR_PROPERTIES.propertyNames();
if (!keys.hasMoreElements()) {
throw new Exception("Failed to read a property file for the "
+"generic object editor");
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null,
"Could not read a configuration file for the generic object\n"
+"editor. An example file is included with the Weka distribution.\n"
+"This file should be named \"" + PROPERTY_FILE + "\" and\n"
+"should be placed either in your user home (which is set\n"
+ "to \"" + System.getProperties().getProperty("user.home") + "\")\n"
+ "or the directory that java was started from\n",
"GenericObjectEditor",
JOptionPane.ERROR_MESSAGE);
}
}
/**
* Handles the GUI side of editing values.
*/
public class GOEPanel extends JPanel implements ItemListener {
/** The chooser component */
private JComboBox m_ObjectChooser;
/** The component that performs classifier customization */
private PropertySheetPanel m_ChildPropertySheet;
/** The model containing the list of names to select from */
private DefaultComboBoxModel m_ObjectNames;
/** Open object from disk */
private JButton m_OpenBut;
/** Save object to disk */
private JButton m_SaveBut;
/** ok button */
private JButton m_okBut;
/** cancel button */
private JButton m_cancelBut;
/** The filechooser for opening and saving object files */
private JFileChooser m_FileChooser;
/** Creates the GUI editor component */
public GOEPanel() {
m_Backup = copyObject(m_Object);
//System.err.println("GOE()");
m_ObjectNames = new DefaultComboBoxModel(new String [0]);
m_ObjectChooser = new JComboBox(m_ObjectNames);
m_ObjectChooser.setEditable(false);
m_ChildPropertySheet = new PropertySheetPanel();
m_ChildPropertySheet.addPropertyChangeListener(
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
m_Support.firePropertyChange("", null, null);
}
});
m_OpenBut = new JButton("Open...");
m_OpenBut.setToolTipText("Load a configured object");
m_OpenBut.setEnabled(true);
m_OpenBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Object object = openObject();
if (object != null) {
// setValue takes care of: Making sure obj is of right type,
// and firing property change.
setValue(object);
// Need a second setValue to get property values filled in OK.
// Not sure why.
setValue(object);
}
}
});
m_SaveBut = new JButton("Save...");
m_SaveBut.setToolTipText("Save the current configured object");
m_SaveBut.setEnabled(true);
m_SaveBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
saveObject(m_Object);
}
});
m_okBut = new JButton("OK");
m_okBut.setEnabled(true);
m_okBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
m_Backup = copyObject(m_Object);
if ((getTopLevelAncestor() != null)
&& (getTopLevelAncestor() instanceof Window)) {
Window w = (Window) getTopLevelAncestor();
w.dispose();
}
}
});
m_cancelBut = new JButton("Cancel");
m_cancelBut.setEnabled(true);
m_cancelBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (m_Backup != null) {
m_Object = copyObject(m_Backup);
setObject(m_Object);
updateClassType();
updateChooser();
updateChildPropertySheet();
}
if ((getTopLevelAncestor() != null)
&& (getTopLevelAncestor() instanceof Window)) {
Window w = (Window) getTopLevelAncestor();
w.dispose();
}
}
});
setLayout(new BorderLayout());
add(m_ObjectChooser, BorderLayout.NORTH);
add(m_ChildPropertySheet, BorderLayout.CENTER);
// Since we resize to the size of the property sheet, a scrollpane isn't
// typically needed
// add(new JScrollPane(m_ChildPropertySheet), BorderLayout.CENTER);
JPanel okcButs = new JPanel();
okcButs.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
okcButs.setLayout(new GridLayout(1, 4, 5, 5));
okcButs.add(m_OpenBut);
okcButs.add(m_SaveBut);
okcButs.add(m_okBut);
okcButs.add(m_cancelBut);
add(okcButs, BorderLayout.SOUTH);
if (m_ClassType != null) {
updateClassType();
updateChooser();
updateChildPropertySheet();
}
m_ObjectChooser.addItemListener(this);
}
/**
* Opens an object from a file selected by the user.
*
* @return the loaded object, or null if the operation was cancelled
*/
protected Object openObject() {
if (m_FileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File selected = m_FileChooser.getSelectedFile();
try {
ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected)));
Object obj = oi.readObject();
oi.close();
if (!m_ClassType.isAssignableFrom(obj.getClass())) {
throw new Exception("Object not of type: " + m_ClassType.getName());
}
return obj;
} catch (Exception ex) {
JOptionPane.showMessageDialog(this,
"Couldn't read object: "
+ selected.getName()
+ "\n" + ex.getMessage(),
"Open object file",
JOptionPane.ERROR_MESSAGE);
}
}
return null;
}
/**
* Opens an object from a file selected by the user.
*
* @return the loaded object, or null if the operation was cancelled
*/
protected void saveObject(Object object) {
if (m_FileChooser == null) {
createFileChooser();
}
int returnVal = m_FileChooser.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File sFile = m_FileChooser.getSelectedFile();
try {
ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
oo.writeObject(object);
oo.close();
} catch (Exception ex) {
JOptionPane.showMessageDialog(this,
"Couldn't write to file: "
+ sFile.getName()
+ "\n" + ex.getMessage(),
"Save object",
JOptionPane.ERROR_MESSAGE);
}
}
}
protected void createFileChooser() {
m_FileChooser = new JFileChooser(new File(System.getProperty("user.dir")));
m_FileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
}
/**
* Makes a copy of an object using serialization
* @param source the object to copy
* @return a copy of the source object
*/
protected Object copyObject(Object source) {
Object result = null;
try {
SerializedObject so = new SerializedObject(source);
result = so.getObject();
} catch (Exception ex) {
System.err.println("GenericObjectEditor: Problem making backup object");
System.err.print(ex);
}
return result;
}
/**
* This is used to hook an action listener to the ok button
* @param a The action listener.
*/
public void addOkListener(ActionListener a) {
m_okBut.addActionListener(a);
}
/**
* This is used to hook an action listener to the cancel button
* @param a The action listener.
*/
public void addCancelListener(ActionListener a) {
m_cancelBut.addActionListener(a);
}
/**
* This is used to remove an action listener from the ok button
* @param a The action listener
*/
public void removeOkListener(ActionListener a) {
m_okBut.removeActionListener(a);
}
/**
* This is used to remove an action listener from the cancel button
* @param a The action listener
*/
public void removeCancelListener(ActionListener a) {
m_cancelBut.removeActionListener(a);
}
/** Called when the class of object being edited changes. */
protected void updateClassType() {
Vector classes = getClassesFromProperties();
m_ObjectChooser.setModel(new DefaultComboBoxModel(classes));
if (classes.size() > 0) {
add(m_ObjectChooser, BorderLayout.NORTH);
} else {
remove(m_ObjectChooser);
}
}
/** Called to update the list of values to be selected from */
protected void updateChooser() {
//System.err.println("GOE::updateChooser()");
String objectName = m_Object.getClass().getName();
boolean found = false;
for (int i = 0; i < m_ObjectNames.getSize(); i++) {
if (objectName.equals((String)m_ObjectNames.getElementAt(i))) {
found = true;
break;
}
}
if (!found) {
m_ObjectNames.addElement(objectName);
}
m_ObjectChooser.setSelectedItem(objectName);
}
/** Updates the child property sheet, and creates if needed */
public void updateChildPropertySheet() {
//System.err.println("GOE::updateChildPropertySheet()");
// Set the object as the target of the propertysheet
m_ChildPropertySheet.setTarget(m_Object);
// Adjust size of containing window if possible
if ((getTopLevelAncestor() != null)
&& (getTopLevelAncestor() instanceof Window)) {
((Window) getTopLevelAncestor()).pack();
}
}
/**
* When the chooser selection is changed, ensures that the Object
* is changed appropriately.
*
* @param e a value of type 'ItemEvent'
*/
public void itemStateChanged(ItemEvent e) {
//System.err.println("GOE::itemStateChanged()");
if ((e.getSource() == m_ObjectChooser)
&& (e.getStateChange() == ItemEvent.SELECTED)){
String className = (String)m_ObjectChooser
.getSelectedItem();
try {
//System.err.println("Setting object from chooser");
setObject((Object)Class
.forName(className)
.newInstance());
//System.err.println("done setting object from chooser");
} catch (Exception ex) {
m_ObjectChooser.hidePopup();
m_ObjectChooser.setSelectedIndex(0);
JOptionPane.showMessageDialog(this,
"Could not create an example of\n"
+ className + "\n"
+ "from the current classpath",
"GenericObjectEditor",
JOptionPane.ERROR_MESSAGE);
}
}
}
}
/** Called when the class of object being edited changes. */
protected Vector getClassesFromProperties() {
Vector classes = new Vector();
String className = m_ClassType.getName();
String typeOptions = EDITOR_PROPERTIES.getProperty(className);
if (typeOptions == null) {
System.err.println("Warning: No configuration property found in\n"
+ PROPERTY_FILE + "\n"
+ "for " + className);
} else {
StringTokenizer st = new StringTokenizer(typeOptions, ", ");
while (st.hasMoreTokens()) {
String current = st.nextToken().trim();
if (false) {
// Verify that class names are OK. Slow -- with Java2 we could
// try Class.forName(current, false, getClass().getClassLoader());
try {
Class c = Class.forName(current);
classes.addElement(current);
} catch (Exception ex) {
System.err.println("Couldn't find class with name" + current);
}
} else {
classes.addElement(current);
}
}
}
return classes;
}
/**
* Sets whether the editor is "enabled", meaning that the current
* values will be painted.
*
* @param newVal a value of type 'boolean'
*/
public void setEnabled(boolean newVal) {
if (newVal != m_Enabled) {
m_Enabled = newVal;
/*
if (m_EditorComponent != null) {
m_EditorComponent.setEnabled(m_Enabled);
}
*/
}
}
/**
* Sets the class of values that can be edited.
*
* @param type a value of type 'Class'
*/
public void setClassType(Class type) {
//System.err.println("setClassType("
// + (type == null? "<null>" : type.getName()) + ")");
m_ClassType = type;
if (m_EditorComponent != null) {
m_EditorComponent.updateClassType();
}
}
/**
* Sets the current object to be the default, taken as the first item in
* the chooser
*/
public void setDefaultValue() {
if (m_ClassType == null) {
System.err.println("No ClassType set up for GenericObjectEditor!!");
return;
}
Vector v = getClassesFromProperties();
try {
if (v.size() > 0) {
setObject((Object)Class.forName((String)v.elementAt(0)).newInstance());
}
} catch (Exception ex) {
}
}
/**
* Sets the current Object. If the Object is in the
* Object chooser, this becomes the selected item (and added
* to the chooser if necessary).
*
* @param o an object that must be a Object.
*/
public void setValue(Object o) {
//System.err.println("setValue()");
if (m_ClassType == null) {
System.err.println("No ClassType set up for GenericObjectEditor!!");
return;
}
if (!m_ClassType.isAssignableFrom(o.getClass())) {
System.err.println("setValue object not of correct type!");
return;
}
setObject((Object)o);
if (m_EditorComponent != null) {
m_EditorComponent.updateChooser();
}
}
/**
* Sets the current Object, but doesn't worry about updating
* the state of the Object chooser.
*
* @param c a value of type 'Object'
*/
private void setObject(Object c) {
// This should really call equals() for comparison.
boolean trueChange = (c != getValue());
/*
System.err.println("Didn't even try to make a Object copy!! "
+ "(using original)");
*/
m_Backup = m_Object;
m_Object = c;
if (m_EditorComponent != null) {
m_EditorComponent.updateChildPropertySheet();
if (trueChange) {
m_Support.firePropertyChange("", null, null);
}
}
}
/**
* Gets the current Object.
*
* @return the current Object
*/
public Object getValue() {
//System.err.println("getValue()");
return m_Object;
}
/**
* Supposedly returns an initialization string to create a Object
* identical to the current one, including it's state, but this doesn't
* appear possible given that the initialization string isn't supposed to
* contain multiple statements.
*
* @return the java source code initialisation string
*/
public String getJavaInitializationString() {
return "new " + m_Object.getClass().getName() + "()";
}
/**
* Returns true to indicate that we can paint a representation of the
* Object.
*
* @return true
*/
public boolean isPaintable() {
return true;
}
/**
* Paints a representation of the current Object.
*
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
public void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box) {
if (m_Enabled && m_Object != null) {
String rep = m_Object.getClass().getName();
int dotPos = rep.lastIndexOf('.');
if (dotPos != -1) {
rep = rep.substring(dotPos + 1);
}
if (m_Object instanceof OptionHandler) {
rep += " " + Utils.joinOptions(((OptionHandler)m_Object)
.getOptions());
}
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getHeight()) / 2;
gfx.drawString(rep, 2, fm.getHeight() + vpad);
} else {
}
}
/**
* Returns null as we don't support getting/setting values as text.
*
* @return null
*/
public String getAsText() {
return null;
}
/**
* Returns null as we don't support getting/setting values as text.
*
* @param text the text value
* @exception IllegalArgumentException as we don't support
* getting/setting values as text.
*/
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
/**
* Returns null as we don't support getting values as tags.
*
* @return null
*/
public String[] getTags() {
return null;
}
/**
* Returns true because we do support a custom editor.
*
* @return true
*/
public boolean supportsCustomEditor() {
return true;
}
/**
* Returns the array editing component.
*
* @return a value of type 'java.awt.Component'
*/
public java.awt.Component getCustomEditor() {
//System.err.println("getCustomEditor()");
if (m_EditorComponent == null) {
//System.err.println("creating new editing component");
m_EditorComponent = new GOEPanel();
}
return m_EditorComponent;
}
/**
* Adds a PropertyChangeListener who will be notified of value changes.
*
* @param l a value of type 'PropertyChangeListener'
*/
public void addPropertyChangeListener(PropertyChangeListener l) {
m_Support.addPropertyChangeListener(l);
}
/**
* Removes a PropertyChangeListener.
*
* @param l a value of type 'PropertyChangeListener'
*/
public void removePropertyChangeListener(PropertyChangeListener l) {
m_Support.removePropertyChangeListener(l);
}
/**
* Tests out the Object editor from the command line.
*
* @param args may contain the class name of a Object to edit
*/
public static void main(String [] args) {
try {
System.err.println("---Registering Weka Editors---");
java.beans.PropertyEditorManager
.registerEditor(weka.experiment.ResultProducer.class,
GenericObjectEditor.class);
java.beans.PropertyEditorManager
.registerEditor(weka.experiment.SplitEvaluator.class,
GenericObjectEditor.class);
java.beans.PropertyEditorManager
.registerEditor(weka.classifiers.Classifier.class,
GenericObjectEditor.class);
java.beans.PropertyEditorManager
.registerEditor(weka.attributeSelection.ASEvaluation.class,
GenericObjectEditor.class);
java.beans.PropertyEditorManager
.registerEditor(weka.attributeSelection.ASSearch.class,
GenericObjectEditor.class);
java.beans.PropertyEditorManager
.registerEditor(SelectedTag.class,
SelectedTagEditor.class);
java.beans.PropertyEditorManager
.registerEditor(java.io.File.class,
FileEditor.class);
GenericObjectEditor ce = new GenericObjectEditor();
ce.setClassType(weka.filters.Filter.class);
Object initial = new weka.filters.AddFilter();
if (args.length > 0) {
initial = (Object)Class.forName(args[0]).newInstance();
}
ce.setValue(initial);
PropertyDialog pd = new PropertyDialog(ce, 100, 100);
pd.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
PropertyEditor pe = ((PropertyDialog)e.getSource()).getEditor();
Object c = (Object)pe.getValue();
String options = "";
if (c instanceof OptionHandler) {
options = Utils.joinOptions(((OptionHandler)c).getOptions());
}
System.out.println(c.getClass().getName() + " " + options);
System.exit(0);
}
});
} catch (Exception ex) {
ex.printStackTrace();
System.err.println(ex.getMessage());
}
}
}
| [
"(no author)@e0a1b77d-ad91-4216-81b1-defd5f83fa92"
] | (no author)@e0a1b77d-ad91-4216-81b1-defd5f83fa92 |
59cf1051ad316e2ee102cffebe660e4b9dd5d735 | 5f134be1e9081d3abc06e1fb93f2989d542e857e | /src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockMCSR.java | dc4ffe7fa2dde4bce99e1cb7b9271c2788bcea6c | [
"Apache-2.0"
] | permissive | jdb110/incubator-systemml | bf5b75dfc39cbbe514ac2d633453ff537bf73f4c | e455a5599781e7cf6c89c6232668a2746bd6dba6 | refs/heads/master | 2021-01-18T11:21:23.738965 | 2016-01-21T01:20:46 | 2016-01-21T01:20:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,827 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sysml.runtime.matrix.data;
/**
* SparseBlock implementation that realizes a 'modified compressed sparse row'
* representation, where each compressed row is stored as a separate SparseRow
* object which provides flexibility for unsorted row appends without the need
* for global reshifting of values/indexes but it incurs additional memory
* overhead per row for object/array headers per row which also slows down
* memory-bound operations due to higher memory bandwidth requirements.
*
*/
public class SparseBlockMCSR extends SparseBlock
{
private static final long serialVersionUID = -4743624499258436199L;
private SparseRow[] _rows = null;
/**
* Copy constructor sparse block abstraction.
*/
public SparseBlockMCSR(SparseBlock sblock)
{
//special case SparseBlockMCSR
if( sblock instanceof SparseBlockMCSR ) {
SparseRow[] orows = ((SparseBlockMCSR)sblock)._rows;
_rows = new SparseRow[orows.length];
for( int i=0; i<_rows.length; i++ )
_rows[i] = new SparseRow(orows[i]);
}
//general case SparseBlock
else {
_rows = new SparseRow[sblock.numRows()];
for( int i=0; i<_rows.length; i++ ) {
int apos = sblock.pos(i);
int alen = sblock.size(i);
_rows[i] = new SparseRow(alen);
_rows[i].setSize(alen);
System.arraycopy(sblock.indexes(i), apos, _rows[i].indexes(), 0, alen);
System.arraycopy(sblock.values(i), apos, _rows[i].values(), 0, alen);
}
}
}
/**
* Copy constructor old sparse row representation.
*/
public SparseBlockMCSR(SparseRow[] rows, boolean deep) {
if( deep ) {
_rows = new SparseRow[rows.length];
for( int i=0; i<_rows.length; i++ )
_rows[i] = new SparseRow(rows[i]);
}
else {
_rows = rows;
}
}
public SparseBlockMCSR(int rlen, int clen) {
_rows = new SparseRow[rlen];
}
///////////////////
//SparseBlock implementation
@Override
public void allocate(int r) {
if( _rows[r] == null )
_rows[r] = new SparseRow();
}
@Override
public void allocate(int r, int nnz) {
if( _rows[r] == null )
_rows[r] = new SparseRow(nnz);
}
@Override
public void allocate(int r, int ennz, int maxnnz) {
if( _rows[r] == null )
_rows[r] = new SparseRow(ennz, maxnnz);
}
@Override
public int numRows() {
return _rows.length;
}
@Override
public boolean isThreadSafe() {
return true;
}
@Override
public void reset() {
for( SparseRow row : _rows )
if( row != null )
row.reset(row.size(), Integer.MAX_VALUE);
}
@Override
public void reset(int ennz, int maxnnz) {
for( SparseRow row : _rows )
if( row != null )
row.reset(ennz, maxnnz);
}
@Override
public void reset(int r, int ennz, int maxnnz) {
if( _rows[r] != null )
_rows[r].reset(ennz, maxnnz);
}
@Override
public long size() {
//recompute non-zeros to avoid redundant maintenance
long nnz = 0;
for( SparseRow row : _rows )
if( row != null )
nnz += row.size();
return nnz;
}
@Override
public int size(int r) {
//prior check with isEmpty(r) expected
//TODO perf sparse block
return (_rows[r]!=null) ? _rows[r].size() : 0;
}
@Override
public long size(int rl, int ru) {
int ret = 0;
for( int i=rl; i<ru; i++ )
ret += (_rows[i]!=null) ? _rows[i].size() : 0;
return ret;
}
@Override
public long size(int rl, int ru, int cl, int cu) {
long nnz = 0;
for(int i=rl; i<ru; i++)
if( !isEmpty(i) ) {
int start = posFIndexGTE(i, cl);
int end = posFIndexGTE(i, cu);
nnz += (start!=-1) ? (end-start) : 0;
}
return nnz;
}
@Override
public boolean isEmpty(int r) {
return (_rows[r]==null || _rows[r].isEmpty());
}
@Override
public int[] indexes(int r) {
//prior check with isEmpty(r) expected
return _rows[r].indexes();
}
@Override
public double[] values(int r) {
//prior check with isEmpty(r) expected
return _rows[r].values();
}
@Override
public int pos(int r) {
//arrays per row (always start 0)
return 0;
}
@Override
public boolean set(int r, int c, double v) {
if( _rows[r] == null )
_rows[r] = new SparseRow();
return _rows[r].set(c, v);
}
@Override
public void set(int r, SparseRow row) {
_rows[r] = row;
}
@Override
public void append(int r, int c, double v) {
if( _rows[r] == null )
_rows[r] = new SparseRow();
_rows[r].append(c, v);
}
@Override
public void setIndexRange(int r, int cl, int cu, double[] v, int vix, int len) {
if( _rows[r] == null )
_rows[r] = new SparseRow();
//different sparse row semantics: upper bound inclusive
_rows[r].setIndexRange(cl, cu-1, v, vix, len);
}
@Override
public void deleteIndexRange(int r, int cl, int cu) {
//prior check with isEmpty(r) expected
//different sparse row semantics: upper bound inclusive
_rows[r].deleteIndexRange(cl, cu-1);
}
@Override
public void sort() {
for( SparseRow row : _rows )
if( row != null && !row.isEmpty() )
row.sort();
}
@Override
public void sort(int r) {
//prior check with isEmpty(r) expected
_rows[r].sort();
}
@Override
public double get(int r, int c) {
if( _rows[r] == null )
return 0;
return _rows[r].get(c);
}
@Override
public SparseRow get(int r) {
return _rows[r];
}
@Override
public int posFIndexLTE(int r, int c) {
//prior check with isEmpty(r) expected
return _rows[r].searchIndexesFirstLTE(c);
}
@Override
public int posFIndexGTE(int r, int c) {
//prior check with isEmpty(r) expected
return _rows[r].searchIndexesFirstGTE(c);
}
@Override
public int posFIndexGT(int r, int c) {
//prior check with isEmpty(r) expected
return _rows[r].searchIndexesFirstGT(c);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("SparseBlockMCSR: rlen=");
sb.append(numRows());
sb.append(", nnz=");
sb.append(size());
sb.append("\n");
for( int i=0; i<numRows(); i++ ) {
sb.append("row +");
sb.append(i);
sb.append(": ");
sb.append(_rows[i]);
sb.append("\n");
}
return sb.toString();
}
}
| [
"mboehm@us.ibm.com"
] | mboehm@us.ibm.com |
7455f4b648f39c7d44801c0552d5e52fd01d5233 | 5b9f2d88a2bf21cfd81ca3a3dbc286af6a2dcea3 | /src/org/sanyanse/ravi/graph/Util.java | d9f6dd56e5ce18a923758795e6bcf4a8b9baa36b | [] | no_license | lipaskc/sanyanse | 1c009f0c19aee28aa9b384d1131ffe9f3500ad56 | b34dd67ddb04d84392f9496aa45fd9101a000b9e | refs/heads/master | 2021-01-15T15:26:37.547385 | 2011-05-11T20:00:35 | 2011-05-11T20:00:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,563 | java | package org.sanyanse.ravi.graph;
import org.sanyanse.common.Vertex;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public class Util {
public static Collection<UndirectedGraph> getConnectedComponents(UndirectedGraph graph) {
Collection<UndirectedGraph> subgraphs = new HashSet<UndirectedGraph>();
Collection<Vertex> vertices = graph.cloneVertices();
while (vertices.size() > 0) {
Vertex root = null;
{
root = vertices.iterator().next();
}
// Run a DFS and get reachable vertices.
Collection<Vertex> reachableVertices = new HashSet<Vertex>();
dfs(graph, root, reachableVertices);
// Get induced subgraph for the reachable vertices.
UndirectedGraph subgraph = graph.getSubgraph(reachableVertices);
subgraphs.add(subgraph);
// Remove reachable vertices and proceed with only unreachable vertices.
for (Iterator<Vertex> traversedVertexIter = reachableVertices.iterator(); traversedVertexIter. hasNext(); ) {
vertices.remove(traversedVertexIter.next());
}
}
return subgraphs;
}
private static Tree dfs(UndirectedGraph graph, Vertex root, Collection<Vertex> traversedVertices) {
return dfs(graph, root, null, traversedVertices, null);
}
private static Tree dfs(UndirectedGraph graph, Vertex v, TreeNode parent, Collection<Vertex> seenVertices, Tree dfsTree) {
if (seenVertices == null) {
seenVertices = new HashSet<Vertex>();
}
if (!seenVertices.contains(v)) {
seenVertices.add(v);
TreeNode node = new TreeNode(v.Id, parent);
if (parent == null) {
dfsTree = new Tree(node);
} else {
dfsTree.addChild(parent, node);
}
Collection<Vertex> neighbors = graph.getEdges(v);
if (neighbors != null) {
for (Vertex neighbor : neighbors) {
dfs(graph, neighbor, node, seenVertices, dfsTree);
}
}
}
return dfsTree;
}
public static List<Vertex> sortVerticesByDegree(final UndirectedGraph graph) {
Collection<Vertex> vertices = graph.cloneVertices();
List<Vertex> list = new ArrayList<Vertex>(vertices);
Collections.sort(list, new Comparator<Vertex>() {
public int compare(Vertex v1, Vertex v2) {
Collection<Vertex> edges1 = graph.getEdges(v1);
Collection<Vertex> edges2 = graph.getEdges(v2);
int degree1 = (edges1 != null ? edges1.size() : 0);
int degree2 = (edges2 != null ? edges2.size() : 0);
return (degree1 < degree2 ? -1 : 1);
}
});
return list;
}
}
| [
"brian.guarraci@gmail.com"
] | brian.guarraci@gmail.com |
38d75db0afbb128523032aa6a9ec5ac777d56704 | 49c20cb9f5018a42509faff53a783babcc47bd05 | /Chapter_7_3/src/ArrayListDemo4.java | eea1a44c5ab012762697dd8acb385e95f4ca6859 | [
"MIT"
] | permissive | Emreyanmis/Java_Projects | 6c254a3e1c6d249a70e97cb017613d2495585ce7 | 3a0558c0997296d74836065c88eaf8d613391445 | refs/heads/master | 2020-04-21T18:18:35.249983 | 2019-02-08T16:39:50 | 2019-02-08T16:39:50 | 169,764,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 875 | java | import java.util.ArrayList; // Needed for ArrayList class
/**
* This program demonstrates inserting an item
* @author emreyanmis
*/
public class ArrayListDemo4
{
public static void main(String[] args)
{
// Create an ArrayList to hold some names.
ArrayList<String> nameList = new ArrayList<String>();
// Add some names to the ArrayList.
nameList.add("James");
nameList.add("Catherine");
nameList.add("Catherine");
nameList.add("Bill");
// Display the items in nameList and their indices.
for(int i = 0; i < nameList.size(); i++)
{
System.out.println("Index: " + i + " Name: " + nameList.get(i));
}
// Now insert an item index 1.
nameList.add(1," Mary ");
for(int i = 0; i < nameList.size();i++)
{
System.out.println("Index: " + i + " Name: " + nameList.get(i));
}
}
}
| [
"emreyanmis@emreyanmiss-mbp.wireless-guest.unc.edu"
] | emreyanmis@emreyanmiss-mbp.wireless-guest.unc.edu |
60d704592f294ec4c075a9606c56e76150fde2e9 | 15c6e0cabd2c73fccb20c5a0e2c5f54d8634840d | /src/main/java/com/way/learning/service/course/LectureReplyServiceImpl.java | 71a6f2f3acd7ecd778ff7ba2c2f5bd184ff50400 | [
"MIT"
] | permissive | InhoAndrewJung/way_learning | fedc031e62fe11d60b08f777ba182029dbd7bd7b | 95bb3843b85ec9db4faeb880e1886d188ef737c8 | refs/heads/master | 2021-04-05T23:57:05.406715 | 2017-12-26T06:40:15 | 2017-12-26T06:40:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,068 | java | package com.way.learning.service.course;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.way.learning.model.course.dao.LectureReplyDAO;
import com.way.learning.model.course.vo.LectureReply;
@Service
public class LectureReplyServiceImpl implements LectureReplyService {
@Autowired
private LectureReplyDAO lectureReplyDAO;
public int insertReply(LectureReply rvo){
return lectureReplyDAO.insertReply(rvo);
}
public List<LectureReply> selectListReply(int lectureNo, int courseNo){
return lectureReplyDAO.selectListReply(lectureNo, courseNo);
}
public int updateReply(HashMap<String, Object> mapParam){
return lectureReplyDAO.updateReply(mapParam);
}
public String selectUpdatedReply(HashMap<String, Object> mapParam){
return lectureReplyDAO.selectUpdatedReply(mapParam);
}
public int deleteReply(HashMap<String, Object> mapParam){
return lectureReplyDAO.deleteReply(mapParam);
}
}
| [
"isp8373@naver.com"
] | isp8373@naver.com |
ef0c4565ff2e732c1ec6acd07167216a58de2a65 | 6c14a0c364315498ff733da2daf898e1781dbe20 | /tyj-dao/src/main/java/com/tyj/dao/demo/deviceGpsInfos/dao/DeviceGpsInfosCountDao.java | 2891af9a0dc9659f3e8ebc6c5b469df40f2dc423 | [] | no_license | gitdevep/tyj | 0a43ff664d700281b1248b9d5758b36650b9d124 | f5e09dad83825765f5e9a5fe6f57ae2ae351a11a | refs/heads/master | 2021-04-10T00:20:04.676962 | 2018-11-18T02:52:24 | 2018-11-18T02:52:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 731 | java | /*
* Copyright (C) 2015 CK, Inc. All Rights Reserved.
*/
package com.tyj.dao.demo.deviceGpsInfos.dao;
import cn.vansky.framework.core.dao.SqlMapDao;
import com.tyj.dao.demo.deviceGpsInfos.bo.DeviceGpsInfosCount;
import java.util.List;
import java.util.Map;
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table `device_gps_infos_count`
*
* @mbggenerated 2015-12-30 16:45:19
*/
public interface DeviceGpsInfosCountDao extends SqlMapDao<DeviceGpsInfosCount, Integer> {
void delByDeviceIdAndTime(Map<String, Object> params);
List<DeviceGpsInfosCount> findParams(Map<String, Object> params);
List<DeviceGpsInfosCount> findTotalAlarm(Map<String, Object> params);
} | [
"maxiao19900520@163.com"
] | maxiao19900520@163.com |
b5e73c123a318d8c9fffcc2c1beaab1bcb26d1ba | dd8b5700b179ced20119f3d6eaa76733797742ff | /MeteorBlasterDriver/src/meteorblasterdriver/MeteorBlasterDriver.java | cd8a19bebb3f7be69cb55381e4cb6c19efd81bd6 | [] | no_license | Evin-Gregory/major-program-1-ccannon94 | 475457fdb32556730df950ef3373d0dcc4158b5a | 41923454e06b195caff1e3b0b9d06030268e9c10 | refs/heads/master | 2020-03-08T07:28:14.752019 | 2018-02-23T17:19:10 | 2018-02-23T17:19:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,172 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package meteorblasterdriver;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import MeteorBlasterGUI2.ProfilePane;
/**
*
* @author kelvin
*/
public class MeteorBlasterDriver extends Application {
@Override
public void start(Stage primaryStage) {
Parameters params = this.getParameters();
//GamePane root = new GamePane(params.getRaw().get(0), params.getRaw().get(1));
ProfilePane root = new ProfilePane(params.getRaw().get(1),
params.getRaw().get(0), primaryStage);
Scene scene = new Scene(root, 400, 400);
primaryStage.setTitle("Meteor Blaster");
primaryStage.setScene(scene);
primaryStage.show();
root.requestFocus();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
| [
"chris.c.canon@gmail.com"
] | chris.c.canon@gmail.com |
78e9abe4768bd54a3146eed5f65a714c9fecfd17 | ebe7f3dbf5a45163fccfc6920707b09dfb9909b9 | /app/src/main/java/com/min/kr/jeonju_all/food/view/FoodBibimbapAdapter.java | 47767fb29c7800e73b95a6355b5cbf99ca1adafa | [] | no_license | minkyoungryul/jeonju_all | 7fb9679c0bab275494fd1a904d5deccb3c979df8 | f4898f7ed642ad2f364ebbdf77d3eed7f52f1c84 | refs/heads/master | 2021-08-16T17:34:24.268472 | 2017-11-20T05:57:08 | 2017-11-20T05:57:08 | 109,091,621 | 0 | 0 | null | 2017-11-05T09:44:55 | 2017-11-01T05:41:13 | Java | UTF-8 | Java | false | false | 3,663 | java | package com.min.kr.jeonju_all.food.view;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.min.kr.jeonju_all.R;
import com.min.kr.jeonju_all.food.data.FoodListData;
import com.min.kr.jeonju_all.food.presenter.FoodPresenter;
import java.util.List;
/**
* Created by minkr on 2017-11-03.
*/
public class FoodBibimbapAdapter extends RecyclerView.Adapter<FoodBibimbapAdapter.ViewHolder> {
Context mContext;
List<FoodListData> datas;
FoodPresenter presenter;
public FoodBibimbapAdapter(Context mContext, List<FoodListData> datas, FoodPresenter presenter) {
this.mContext = mContext;
this.datas = datas;
this.presenter = presenter;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_food_rice, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
FoodListData data = datas.get(position);
Glide.with(mContext)
.load(data.getMainImg())
.fitCenter()
.into(holder.iv_food);
if(data.isLike()){
holder.ib_like.setImageResource(R.drawable.ic_like_p);
}else{
holder.ib_like.setImageResource(R.drawable.ic_like_n);
}
holder.ib_share.setOnClickListener(v -> {
presenter.showDialog(data);
});
holder.tv_store_name.setText(data.getStoreName());
holder.tv_main_menu.setText(data.getMainMenu());
if(data.getNewAddr() == null || data.getNewAddr().equals("")){
holder.iv_map.setVisibility(View.GONE);
holder.tv_address.setVisibility(View.GONE);
}else{
holder.tv_address.setText(data.getNewAddr());
}
holder.ib_like.setOnClickListener(v->{
if(data.isLike()){
presenter.deleteDBData(data);
}else{
presenter.insertDBData(data);
}
});
holder.getView().setOnClickListener(v->{
presenter.getStoreInfo(data);
});
holder.tv_address.setOnClickListener(v -> {
presenter.getAddressClick(data);
});
}
@Override
public int getItemCount() {
return datas.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
ImageView iv_food;
TextView tv_store_name;
TextView tv_main_menu;
TextView tv_address;
View itemView;
ImageButton ib_like;
ImageView iv_map;
ImageButton ib_share;
public ViewHolder(View itemView) {
super(itemView);
iv_food = (ImageView) itemView.findViewById(R.id.iv_food);
tv_store_name = (TextView) itemView.findViewById(R.id.tv_store_name);
tv_main_menu = (TextView) itemView.findViewById(R.id.tv_main_menu);
tv_address = (TextView) itemView.findViewById(R.id.tv_address);
ib_like = (ImageButton) itemView.findViewById(R.id.ib_like);
iv_map = (ImageView) itemView.findViewById(R.id.iv_map);
ib_share = (ImageButton) itemView.findViewById(R.id.ib_share);
this.itemView = itemView;
}
public View getView(){
return itemView;
}
}
}
| [
"minkr3321@naver.com"
] | minkr3321@naver.com |
0f08ea02d920d9adf1f4fe0949b3ae97a4f8f24f | 9339cb45bdbd9f1c5b7769bf29e58a39893a811d | /view-web/src/main/java/com/zx5435/pcmoto/web/config/MyInterceptor.java | 983cae2fe831688345fa9d773e2b606901a1b3df | [
"MIT"
] | permissive | wolanx/springcloud-demo | 0022a3fa3bd6698e31844af104d6be4209f38de9 | af729dde67910e51491df5ddfc749fe93b06e82c | refs/heads/master | 2022-02-02T09:37:36.968732 | 2019-08-02T13:27:21 | 2019-08-02T13:27:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 787 | java | package com.zx5435.pcmoto.web.config;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MyInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String url = request.getRequestURI();
Object uid = request.getSession().getAttribute("uid");
System.out.println("MyInterceptor = " + url + "; uid = " + uid);
if (uid == null) {
response.sendRedirect("/user/login?from=" + url);
return false;
}
return super.preHandle(request, response, handler);
}
}
| [
"825407762@qq.com"
] | 825407762@qq.com |
77a32d3db6a4519dd3c45c8b8100ab4a612b006a | 9ab0b0bb9d4a653b8348912677141dc518e87572 | /dev/cosbench-log/src/com/intel/cosbench/log/LogManager.java | 14b89a6e41e289bf3e757e0dc179a2bc9100eecf | [
"Apache-2.0"
] | permissive | guymguym/cosbench | 433ebf9460fdce0f7b2ab0c40361056651d80d6e | 7a07683edc904334294b0853f871f20fed65cbef | refs/heads/master | 2022-06-05T16:47:47.652359 | 2022-04-19T23:27:58 | 2022-04-19T23:27:58 | 280,248,309 | 0 | 0 | NOASSERTION | 2020-07-16T20:10:09 | 2020-07-16T20:10:08 | null | UTF-8 | Java | false | false | 1,104 | java | /**
Copyright 2013 Intel Corporation, All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.intel.cosbench.log;
import java.io.*;
/**
* The interface of LogManager.
*
* @author ywang19, qzheng7
*
*/
public interface LogManager {
public void dispose();
public Logger getLogger();
public LogLevel getLogLevel();
public void setLogLevel(LogLevel level);
public void setLogFile(File dir, String filename, boolean append,
boolean buffer) throws IOException;
public void enableConsole();
public String getLogAsString() throws IOException;
}
| [
"yaguang.wang@intel.com"
] | yaguang.wang@intel.com |
da4cc9e6246405f59bad2f5e3955749726259200 | bb540bc2408fa95851a332060ff9100011a7685f | /endpoint-libs/libdeviceinfoendpoint-v1/deviceinfoendpoint/deviceinfoendpoint-v1-generated-source/com/pubci/simple_traveller/deviceinfoendpoint/Deviceinfoendpoint.java | c246aef48c670d8e6487ecac8e4367955bdecf48 | [
"Apache-2.0"
] | permissive | pubudu538/Simple_Traveller | 5f600e4f6bd91125fc5bb4b0cb72176847f11a2f | 14f84d459e758a60a785d401d81d48d8136b01a5 | refs/heads/master | 2021-01-20T11:25:19.152329 | 2013-10-13T18:53:42 | 2013-10-13T18:53:42 | 12,209,549 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,749 | java | /*
* 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.
*/
/*
* This code was generated by https://code.google.com/p/google-apis-client-generator/
* (build: 2013-09-16 16:01:30 UTC)
* on 2013-09-22 at 15:11:37 UTC
* Modify at your own risk.
*/
package com.pubci.simple_traveller.deviceinfoendpoint;
/**
* Service definition for Deviceinfoendpoint (v1).
*
* <p>
* This is an API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="" target="_blank">API Documentation</a>
* </p>
*
* <p>
* This service uses {@link DeviceinfoendpointRequestInitializer} to initialize global parameters via its
* {@link Builder}.
* </p>
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class Deviceinfoendpoint extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.15 of google-api-client to run version " +
"1.16.0-rc of the deviceinfoendpoint library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://simpletravellerwebapp.appspot.com/_ah/api/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "deviceinfoendpoint/v1/";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
*/
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
* <p>
* Use {@link Builder} if you need to specify any of the optional parameters.
* </p>
*
* @param transport HTTP transport, which should normally be:
* <ul>
* <li>Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
* <li>Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
* <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
* </li>
* </ul>
* @param jsonFactory JSON factory, which may be:
* <ul>
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
* <li>Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
* </ul>
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Deviceinfoendpoint(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
this(new Builder(transport, jsonFactory, httpRequestInitializer));
}
/**
* @param builder builder
*/
Deviceinfoendpoint(Builder builder) {
super(builder);
}
@Override
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* Create a request for the method "getDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting any
* optional parameters, call the {@link GetDeviceInfo#execute()} method to invoke the remote
* operation.
*
* @param id
* @return the request
*/
public GetDeviceInfo getDeviceInfo(java.lang.String id) throws java.io.IOException {
GetDeviceInfo result = new GetDeviceInfo(id);
initialize(result);
return result;
}
public class GetDeviceInfo extends DeviceinfoendpointRequest<com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo> {
private static final String REST_PATH = "deviceinfo/{id}";
/**
* Create a request for the method "getDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting
* any optional parameters, call the {@link GetDeviceInfo#execute()} method to invoke the remote
* operation. <p> {@link GetDeviceInfo#initialize(com.google.api.client.googleapis.services.Abstra
* ctGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @param id
* @since 1.13
*/
protected GetDeviceInfo(java.lang.String id) {
super(Deviceinfoendpoint.this, "GET", REST_PATH, null, com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo.class);
this.id = com.google.api.client.util.Preconditions.checkNotNull(id, "Required parameter id must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public GetDeviceInfo setAlt(java.lang.String alt) {
return (GetDeviceInfo) super.setAlt(alt);
}
@Override
public GetDeviceInfo setFields(java.lang.String fields) {
return (GetDeviceInfo) super.setFields(fields);
}
@Override
public GetDeviceInfo setKey(java.lang.String key) {
return (GetDeviceInfo) super.setKey(key);
}
@Override
public GetDeviceInfo setOauthToken(java.lang.String oauthToken) {
return (GetDeviceInfo) super.setOauthToken(oauthToken);
}
@Override
public GetDeviceInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
return (GetDeviceInfo) super.setPrettyPrint(prettyPrint);
}
@Override
public GetDeviceInfo setQuotaUser(java.lang.String quotaUser) {
return (GetDeviceInfo) super.setQuotaUser(quotaUser);
}
@Override
public GetDeviceInfo setUserIp(java.lang.String userIp) {
return (GetDeviceInfo) super.setUserIp(userIp);
}
@com.google.api.client.util.Key
private java.lang.String id;
/**
*/
public java.lang.String getId() {
return id;
}
public GetDeviceInfo setId(java.lang.String id) {
this.id = id;
return this;
}
@Override
public GetDeviceInfo set(String parameterName, Object value) {
return (GetDeviceInfo) super.set(parameterName, value);
}
}
/**
* Create a request for the method "insertDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting any
* optional parameters, call the {@link InsertDeviceInfo#execute()} method to invoke the remote
* operation.
*
* @param content the {@link com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo}
* @return the request
*/
public InsertDeviceInfo insertDeviceInfo(com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo content) throws java.io.IOException {
InsertDeviceInfo result = new InsertDeviceInfo(content);
initialize(result);
return result;
}
public class InsertDeviceInfo extends DeviceinfoendpointRequest<com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo> {
private static final String REST_PATH = "deviceinfo";
/**
* Create a request for the method "insertDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting
* any optional parameters, call the {@link InsertDeviceInfo#execute()} method to invoke the
* remote operation. <p> {@link InsertDeviceInfo#initialize(com.google.api.client.googleapis.servi
* ces.AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor. </p>
*
* @param content the {@link com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo}
* @since 1.13
*/
protected InsertDeviceInfo(com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo content) {
super(Deviceinfoendpoint.this, "POST", REST_PATH, content, com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo.class);
}
@Override
public InsertDeviceInfo setAlt(java.lang.String alt) {
return (InsertDeviceInfo) super.setAlt(alt);
}
@Override
public InsertDeviceInfo setFields(java.lang.String fields) {
return (InsertDeviceInfo) super.setFields(fields);
}
@Override
public InsertDeviceInfo setKey(java.lang.String key) {
return (InsertDeviceInfo) super.setKey(key);
}
@Override
public InsertDeviceInfo setOauthToken(java.lang.String oauthToken) {
return (InsertDeviceInfo) super.setOauthToken(oauthToken);
}
@Override
public InsertDeviceInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
return (InsertDeviceInfo) super.setPrettyPrint(prettyPrint);
}
@Override
public InsertDeviceInfo setQuotaUser(java.lang.String quotaUser) {
return (InsertDeviceInfo) super.setQuotaUser(quotaUser);
}
@Override
public InsertDeviceInfo setUserIp(java.lang.String userIp) {
return (InsertDeviceInfo) super.setUserIp(userIp);
}
@Override
public InsertDeviceInfo set(String parameterName, Object value) {
return (InsertDeviceInfo) super.set(parameterName, value);
}
}
/**
* Create a request for the method "listDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting any
* optional parameters, call the {@link ListDeviceInfo#execute()} method to invoke the remote
* operation.
*
* @return the request
*/
public ListDeviceInfo listDeviceInfo() throws java.io.IOException {
ListDeviceInfo result = new ListDeviceInfo();
initialize(result);
return result;
}
public class ListDeviceInfo extends DeviceinfoendpointRequest<com.pubci.simple_traveller.deviceinfoendpoint.model.CollectionResponseDeviceInfo> {
private static final String REST_PATH = "deviceinfo";
/**
* Create a request for the method "listDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting
* any optional parameters, call the {@link ListDeviceInfo#execute()} method to invoke the remote
* operation. <p> {@link ListDeviceInfo#initialize(com.google.api.client.googleapis.services.Abstr
* actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor. </p>
*
* @since 1.13
*/
protected ListDeviceInfo() {
super(Deviceinfoendpoint.this, "GET", REST_PATH, null, com.pubci.simple_traveller.deviceinfoendpoint.model.CollectionResponseDeviceInfo.class);
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public ListDeviceInfo setAlt(java.lang.String alt) {
return (ListDeviceInfo) super.setAlt(alt);
}
@Override
public ListDeviceInfo setFields(java.lang.String fields) {
return (ListDeviceInfo) super.setFields(fields);
}
@Override
public ListDeviceInfo setKey(java.lang.String key) {
return (ListDeviceInfo) super.setKey(key);
}
@Override
public ListDeviceInfo setOauthToken(java.lang.String oauthToken) {
return (ListDeviceInfo) super.setOauthToken(oauthToken);
}
@Override
public ListDeviceInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
return (ListDeviceInfo) super.setPrettyPrint(prettyPrint);
}
@Override
public ListDeviceInfo setQuotaUser(java.lang.String quotaUser) {
return (ListDeviceInfo) super.setQuotaUser(quotaUser);
}
@Override
public ListDeviceInfo setUserIp(java.lang.String userIp) {
return (ListDeviceInfo) super.setUserIp(userIp);
}
@com.google.api.client.util.Key
private java.lang.String cursor;
/**
*/
public java.lang.String getCursor() {
return cursor;
}
public ListDeviceInfo setCursor(java.lang.String cursor) {
this.cursor = cursor;
return this;
}
@com.google.api.client.util.Key
private java.lang.Integer limit;
/**
*/
public java.lang.Integer getLimit() {
return limit;
}
public ListDeviceInfo setLimit(java.lang.Integer limit) {
this.limit = limit;
return this;
}
@Override
public ListDeviceInfo set(String parameterName, Object value) {
return (ListDeviceInfo) super.set(parameterName, value);
}
}
/**
* Create a request for the method "removeDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting any
* optional parameters, call the {@link RemoveDeviceInfo#execute()} method to invoke the remote
* operation.
*
* @param id
* @return the request
*/
public RemoveDeviceInfo removeDeviceInfo(java.lang.String id) throws java.io.IOException {
RemoveDeviceInfo result = new RemoveDeviceInfo(id);
initialize(result);
return result;
}
public class RemoveDeviceInfo extends DeviceinfoendpointRequest<Void> {
private static final String REST_PATH = "deviceinfo/{id}";
/**
* Create a request for the method "removeDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting
* any optional parameters, call the {@link RemoveDeviceInfo#execute()} method to invoke the
* remote operation. <p> {@link RemoveDeviceInfo#initialize(com.google.api.client.googleapis.servi
* ces.AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor. </p>
*
* @param id
* @since 1.13
*/
protected RemoveDeviceInfo(java.lang.String id) {
super(Deviceinfoendpoint.this, "DELETE", REST_PATH, null, Void.class);
this.id = com.google.api.client.util.Preconditions.checkNotNull(id, "Required parameter id must be specified.");
}
@Override
public RemoveDeviceInfo setAlt(java.lang.String alt) {
return (RemoveDeviceInfo) super.setAlt(alt);
}
@Override
public RemoveDeviceInfo setFields(java.lang.String fields) {
return (RemoveDeviceInfo) super.setFields(fields);
}
@Override
public RemoveDeviceInfo setKey(java.lang.String key) {
return (RemoveDeviceInfo) super.setKey(key);
}
@Override
public RemoveDeviceInfo setOauthToken(java.lang.String oauthToken) {
return (RemoveDeviceInfo) super.setOauthToken(oauthToken);
}
@Override
public RemoveDeviceInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
return (RemoveDeviceInfo) super.setPrettyPrint(prettyPrint);
}
@Override
public RemoveDeviceInfo setQuotaUser(java.lang.String quotaUser) {
return (RemoveDeviceInfo) super.setQuotaUser(quotaUser);
}
@Override
public RemoveDeviceInfo setUserIp(java.lang.String userIp) {
return (RemoveDeviceInfo) super.setUserIp(userIp);
}
@com.google.api.client.util.Key
private java.lang.String id;
/**
*/
public java.lang.String getId() {
return id;
}
public RemoveDeviceInfo setId(java.lang.String id) {
this.id = id;
return this;
}
@Override
public RemoveDeviceInfo set(String parameterName, Object value) {
return (RemoveDeviceInfo) super.set(parameterName, value);
}
}
/**
* Create a request for the method "updateDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting any
* optional parameters, call the {@link UpdateDeviceInfo#execute()} method to invoke the remote
* operation.
*
* @param content the {@link com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo}
* @return the request
*/
public UpdateDeviceInfo updateDeviceInfo(com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo content) throws java.io.IOException {
UpdateDeviceInfo result = new UpdateDeviceInfo(content);
initialize(result);
return result;
}
public class UpdateDeviceInfo extends DeviceinfoendpointRequest<com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo> {
private static final String REST_PATH = "deviceinfo";
/**
* Create a request for the method "updateDeviceInfo".
*
* This request holds the parameters needed by the the deviceinfoendpoint server. After setting
* any optional parameters, call the {@link UpdateDeviceInfo#execute()} method to invoke the
* remote operation. <p> {@link UpdateDeviceInfo#initialize(com.google.api.client.googleapis.servi
* ces.AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor. </p>
*
* @param content the {@link com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo}
* @since 1.13
*/
protected UpdateDeviceInfo(com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo content) {
super(Deviceinfoendpoint.this, "PUT", REST_PATH, content, com.pubci.simple_traveller.deviceinfoendpoint.model.DeviceInfo.class);
}
@Override
public UpdateDeviceInfo setAlt(java.lang.String alt) {
return (UpdateDeviceInfo) super.setAlt(alt);
}
@Override
public UpdateDeviceInfo setFields(java.lang.String fields) {
return (UpdateDeviceInfo) super.setFields(fields);
}
@Override
public UpdateDeviceInfo setKey(java.lang.String key) {
return (UpdateDeviceInfo) super.setKey(key);
}
@Override
public UpdateDeviceInfo setOauthToken(java.lang.String oauthToken) {
return (UpdateDeviceInfo) super.setOauthToken(oauthToken);
}
@Override
public UpdateDeviceInfo setPrettyPrint(java.lang.Boolean prettyPrint) {
return (UpdateDeviceInfo) super.setPrettyPrint(prettyPrint);
}
@Override
public UpdateDeviceInfo setQuotaUser(java.lang.String quotaUser) {
return (UpdateDeviceInfo) super.setQuotaUser(quotaUser);
}
@Override
public UpdateDeviceInfo setUserIp(java.lang.String userIp) {
return (UpdateDeviceInfo) super.setUserIp(userIp);
}
@Override
public UpdateDeviceInfo set(String parameterName, Object value) {
return (UpdateDeviceInfo) super.set(parameterName, value);
}
}
/**
* Builder for {@link Deviceinfoendpoint}.
*
* <p>
* Implementation is not thread-safe.
* </p>
*
* @since 1.3.0
*/
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport, which should normally be:
* <ul>
* <li>Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
* <li>Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
* <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
* </li>
* </ul>
* @param jsonFactory JSON factory, which may be:
* <ul>
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
* <li>Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
* </ul>
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
}
/** Builds a new instance of {@link Deviceinfoendpoint}. */
@Override
public Deviceinfoendpoint build() {
return new Deviceinfoendpoint(this);
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}
@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}
/**
* Set the {@link DeviceinfoendpointRequestInitializer}.
*
* @since 1.12
*/
public Builder setDeviceinfoendpointRequestInitializer(
DeviceinfoendpointRequestInitializer deviceinfoendpointRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(deviceinfoendpointRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}
| [
"pubudu538@gmail.com"
] | pubudu538@gmail.com |
8d64aa04a228627889aa037b2b708b3a3b52f29e | 9525ef180fd0f7fb2ce10a80f675117a67ac1818 | /automationtesting/src/test/java/hw5/generator/test/YaDiskBaseTest.java | c8d2d9b1cf88787b62d3869fb04216acbb9ab5de | [] | no_license | greenmapc/AutomationTest | 9fffff9f654ad6cb516863cbb9f4de2b654a3493 | 15f06be8954543e046be0c796b2ddc640f0a6318 | refs/heads/master | 2020-12-01T13:46:11.707592 | 2019-12-28T18:20:50 | 2019-12-28T18:20:50 | 230,646,422 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 272 | java | package hw5.generator.test;
import hw5.generator.manager.ApplicationManager;
public class YaDiskBaseTest {
protected static ApplicationManager applicationManager;
public YaDiskBaseTest() {
applicationManager = ApplicationManager.getInstance();
}
}
| [
"anna.kuzmenko@simbirsoft.com"
] | anna.kuzmenko@simbirsoft.com |
31ff62cd845dedcd22254ae05c12ba7b72be0e55 | 010b557a6af56c81f7a09572870d1729444fa992 | /src/main/java/wniemiec/app/java/executionflow/collector/MethodCollector.java | 2912a553dbeb0ccc5dc92e5ff0a83b06809f51d9 | [
"MIT"
] | permissive | williamniemiec/ExecutionFlow | bf473fc9a5c150f34043f57994dbac5e7f122d38 | f3de0ff23262f6b46a198f1d1be11dcce7c970c5 | refs/heads/v8.x | 2023-09-03T18:31:27.640644 | 2021-10-04T23:58:19 | 2021-10-04T23:58:19 | 250,606,068 | 1 | 3 | MIT | 2021-10-04T23:59:06 | 2020-03-27T17:55:06 | Java | UTF-8 | Java | false | false | 3,836 | java | package wniemiec.app.java.executionflow.collector;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import wniemiec.app.java.executionflow.invoked.Invoked;
import wniemiec.app.java.executionflow.invoked.TestedInvoked;
import wniemiec.app.java.executionflow.user.User;
/**
* Responsible for collect methods.
*
* @author William Niemiec < williamniemiec@hotmail.com >
* @since 7.0.0
*/
public class MethodCollector extends InvokedCollector {
//-------------------------------------------------------------------------
// Attributes
//-------------------------------------------------------------------------
private static MethodCollector instance;
/**
* Stores information about collected methods.<hr/>
* <ul>
* <li><b>Key:</b> Method invocation line</li>
* <li><b>Value:</b> List of methods invoked from this line</li>
* </ul>
*/
private volatile Map<Integer, List<TestedInvoked>> methodCollector;
//-------------------------------------------------------------------------
// Constructor
//-------------------------------------------------------------------------
private MethodCollector() {
methodCollector = new HashMap<>();
}
//-------------------------------------------------------------------------
// Methods
//-------------------------------------------------------------------------
public static MethodCollector getInstance() {
if (instance == null)
instance = new MethodCollector();
return instance;
}
@Override
public void collect(TestedInvoked testedInvoked) {
if (wasMethodCollected(testedInvoked.getTestedInvoked())) {
List<TestedInvoked> list = getAllCollectedInvokedFromMethod(
testedInvoked.getTestedInvoked()
);
list.add(testedInvoked);
}
else {
List<TestedInvoked> list = new ArrayList<>();
list.add(testedInvoked);
putInMethodCollection(testedInvoked.getTestedInvoked(), list);
}
storeMethodCollector();
}
private boolean wasMethodCollected(Invoked method) {
return methodCollector.containsKey(method.getInvocationLine());
}
private List<TestedInvoked> getAllCollectedInvokedFromMethod(Invoked method) {
return methodCollector.get(method.getInvocationLine());
}
private void putInMethodCollection(Invoked method, List<TestedInvoked> list) {
methodCollector.put(method.getInvocationLine(), list);
}
private void storeMethodCollector() {
try {
User.storeMethodCollector(methodCollector);
}
catch (IOException e) {
}
}
@Override
public Set<TestedInvoked> getAllCollectedInvoked() {
Set<TestedInvoked> collectors = new HashSet<>();
for (List<TestedInvoked> collector : getMethodCollection()) {
if (collector.isEmpty())
continue;
collectors.add(collector.get(0));
}
return collectors;
}
private Collection<List<TestedInvoked>> getMethodCollection() {
try {
methodCollector = User.getMethodCollector();
if (methodCollector == null)
methodCollector = new HashMap<>();
return methodCollector.values();
}
catch (IOException e) {
return List.of(new ArrayList<>());
}
}
@Override
public void reset() {
methodCollector.clear();
User.resetMethodCollector();
}
@Override
public void updateInvocationLines(Map<Integer, List<Integer>> mapping,
Path testMethodSrcFile) {
for (List<TestedInvoked> methodCollectorList : getMethodCollection()) {
updateInvokedInvocationLines(
mapping,
testMethodSrcFile,
methodCollectorList
);
}
storeMethodCollector();
}
@Override
public String toString() {
return "MethodCollector [methodCollector=" + methodCollector + "]";
}
}
| [
"williamniemiec@hotmail.com"
] | williamniemiec@hotmail.com |
a981b9f8effd4f16800790fee509f3cb76f125ee | eeba7b83cfb2aab11536cc37cdd0003d4fcf2afd | /src/main/java/com/example/demo/model/CardPayment.java | bdae903323b5fb530195871f2d28db6cfa3638ee | [] | no_license | himashatw/store-payment | be6d2f305769c0929c3d923679f7d150ae6243c7 | 03640fb473550ea40cf0fce1decc6564c7136952 | refs/heads/master | 2023-05-25T10:06:11.423905 | 2021-05-17T07:00:54 | 2021-05-17T07:00:54 | 368,086,946 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 914 | java | package com.example.demo.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document("Payment")
public class CardPayment {
@Id
private String cardNo;
private String name;
private String cvcNo;
private double amount;
public String payType = "CardPayment";
public String getCardNo() {
return cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCvcNo() {
return cvcNo;
}
public void setCvcNo(String cvcNo) {
this.cvcNo = cvcNo;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType;
}
}
| [
"himashatw@gmail.com"
] | himashatw@gmail.com |
5c042546c2de08c1fc6ca6199cae32d6598eb420 | 15b560d911c89eadc62c059e69edfccbdaa7feb6 | /src/main/java/kimmyeonghoe/cloth/web/cloth/ClothController.java | 8ab80c31725c8d5e713555f37571155bbb247099 | [] | no_license | mhui12311/kimmyeonghoe.cloth | 1651a9c7dc944b00c8fd597f4fc4ca02a915cb39 | 353ff9a7d64d84e4a70872b428c0a05338dd118f | refs/heads/master | 2023-04-02T10:52:58.045605 | 2021-04-13T10:42:08 | 2021-04-13T10:42:08 | 355,040,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,843 | java | package kimmyeonghoe.cloth.web.cloth;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import kimmyeonghoe.cloth.domain.cloth.Cloth;
import kimmyeonghoe.cloth.service.cloth.ClothService;
@Controller("kimmyeonghoe.cloth.web.cloth")
@RequestMapping("cloth")
public class ClothController {
@Autowired private ClothService clothService;
@GetMapping("/clothList")
public ModelAndView clothListAddr(ModelAndView mv) {
mv.setViewName("cloth/clothList");
return mv;
}
@ResponseBody
@GetMapping("/list")
public List<Cloth> getCloths() {
return clothService.getCloths();
}
@ResponseBody
@GetMapping("/clothDetail/find")
public Cloth findCloth(HttpServletRequest request) {
HttpSession session = request.getSession();
int clothNum = Integer.parseInt(String.valueOf(session.getAttribute("clothNum")));
return clothService.findCloth(clothNum);
}
@GetMapping("/clothDetail/{clothNum}")
public ModelAndView clothDetailAddr(ModelAndView mv, HttpServletRequest request, @PathVariable int clothNum) {
HttpSession session = request.getSession();
session.setAttribute("clothNum", clothNum);
System.out.println("session clothNum : "+ session.getAttribute("clothNum") );
mv.setViewName("cloth/clothDetail");
return mv;
}
@ResponseBody
@PostMapping("/clothDetail/purchase/{purQuantity}")
public void purchaseCloth(HttpServletRequest request, @PathVariable int purQuantity) {
HttpSession session = request.getSession();
session.setAttribute("purQuantity", purQuantity);
}
@RequestMapping("/searchCloth")
public String searchClothAddr() {
return "/cloth/searchCloth";
}
@ResponseBody
@PostMapping("/saveKeyword")
public void saveKeyword(@RequestParam("keyword") String keyword, HttpServletRequest request) {
HttpSession session = request.getSession();
session.setAttribute("keyword", keyword);
}
@ResponseBody
@PostMapping("/searchCloth")
public List<Cloth> showSearchResult(HttpServletRequest request){
HttpSession session = request.getSession();
String keyword = (String) session.getAttribute("keyword");
List<Cloth> result = clothService.searchClothWithKeyword(keyword);
return result;
}
}
| [
"hui@220.79.175.179"
] | hui@220.79.175.179 |
6ef570b45efa30d6b143077760fbd957d1b5e1a7 | 553de4a4e7e31b1ebc05c4f8d743cdaa4c0630af | /src/com/facebook/service/FacebookServiceInterface.java | 90612734a84a311e4b21581e5a7f5472eadd64a6 | [] | no_license | ankit9512/ankit_git | 1b34336c509f283738b5affc7fde9ade9f292bd7 | e6ae6035fd8af405edc96ee78c630f83c1fed653 | refs/heads/master | 2020-07-16T13:23:08.769545 | 2019-09-02T07:11:34 | 2019-09-02T07:11:34 | 205,796,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 173 | java | package com.facebook.service;
import com.facebook.entity.FacebookEmployee;
public interface FacebookServiceInterface {
int createProfile(FacebookEmployee fe);
}
| [
"AS57543@TRNW57SLPC0134.ind.zensar.com"
] | AS57543@TRNW57SLPC0134.ind.zensar.com |
5fffb43d9ad50515238b46e321549ec8a0295961 | 87bc1d4e3b13aac2e7111750d34a871bf7766b60 | /app/src/test/java/com/websarva/wings/android/recyclerviewsample/ExampleUnitTest.java | da1a84a62753f78c098a0adcef14fb4b7ac5caf3 | [] | no_license | disk3457/RecyclerViewSample | 318d7eea51690f4a84e239c64011477d262b704f | 5d4ea5fde935be146be557609e98cf502a70975f | refs/heads/master | 2020-03-24T22:28:49.024390 | 2018-08-01T01:22:12 | 2018-08-01T01:22:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 236 | java | package com.websarva.wings.android.recyclerviewsample;
import org.junit.Test;
import static org.junit.Assert.*;
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"dsakkyan0304@yahoo.co.jp"
] | dsakkyan0304@yahoo.co.jp |
1fa3211cc3e57519749b035fb08f24baf42e3c76 | e2135dba47686535a401d5ad1285aef4613adce9 | /src/main/java/eu/canpack/fip/config/ApplicationProperties.java | 575865feec888ec6d3b0fd4afc5270773c9ca818 | [] | no_license | appservice/cp-tn | 19fa1ea1c60fd8aaa84df6ddd4bdf7591ee4c3be | 029aa4d1398a81fb2873ead992cdb05f335660e0 | refs/heads/master | 2021-07-07T10:28:18.086097 | 2018-06-10T19:27:13 | 2018-06-10T19:27:13 | 103,777,224 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,537 | java | package eu.canpack.fip.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Properties specific to Tn.
* <p>
* Properties are configured in the application.yml file.
* See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
*/
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
public class ApplicationProperties {
private String drawingDirectoryPath;
private String initialPassword;
private String initialOfferRemarks;
private int columnOnPageWithOperatorCard;
public ApplicationProperties() {
}
public int getColumnOnPageWithOperatorCard() {
return columnOnPageWithOperatorCard;
}
public void setColumnOnPageWithOperatorCard(int columnOnPageWithOperatorCard) {
this.columnOnPageWithOperatorCard = columnOnPageWithOperatorCard;
}
public String getDrawingDirectoryPath() {
return drawingDirectoryPath;
}
public void setDrawingDirectoryPath(String drawingDirectoryPath) {
this.drawingDirectoryPath = drawingDirectoryPath;
}
public String getInitialPassword() {
return initialPassword;
}
public void setInitialPassword(String initialPassword) {
this.initialPassword = initialPassword;
}
public String getInitialOfferRemarks() {
return initialOfferRemarks;
}
public void setInitialOfferRemarks(String initialOfferRemarks) {
this.initialOfferRemarks = initialOfferRemarks;
}
}
| [
"lukasz.mochel@canpack.eu"
] | lukasz.mochel@canpack.eu |
2faf52065c8c695edd86ef90be81fab41a904103 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/camel/1.0/org/apache/camel/builder/FluentArg.java | a6c89434ed748d4d7e121747f10a9e705442fb8c | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 491 | java | package org.apache.camel.builder;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Used to annotate the parameter of a {@see Fluent} method.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface FluentArg {
String value();
boolean attribute() default true;
boolean element() default false;
boolean reference() default false;
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
1e48fbdaed936800cb226bbc8e3db68c02ef304a | 26c92df9422d96253f4ca5b80bec96d905a9e289 | /src/test/java/com/aws/greengrass/ipc/modules/LifecycleIPCServiceTest.java | 2558cc877d70db6e697f784afbe80ebc05be80fc | [
"Apache-2.0",
"EPL-1.0",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"MIT",
"LGPL-2.1-or-later"
] | permissive | Xuqing888/aws-greengrass-nucleus | 05732398e84932d3bb1fd039e4eba65c53241ab1 | 0b2d716871f47c5fbb61eba9af25380250c873be | refs/heads/main | 2023-04-12T03:53:24.028690 | 2021-04-26T18:07:40 | 2021-04-26T19:16:06 | 361,848,522 | 0 | 0 | Apache-2.0 | 2021-04-26T18:09:18 | 2021-04-26T18:09:17 | null | UTF-8 | Java | false | false | 3,383 | java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package com.aws.greengrass.ipc.modules;
import com.aws.greengrass.builtin.services.lifecycle.LifecycleIPCEventStreamAgent;
import com.aws.greengrass.testcommons.testutilities.GGExtension;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import software.amazon.awssdk.aws.greengrass.GeneratedAbstractDeferComponentUpdateOperationHandler;
import software.amazon.awssdk.aws.greengrass.GeneratedAbstractSubscribeToComponentUpdatesOperationHandler;
import software.amazon.awssdk.aws.greengrass.GeneratedAbstractUpdateStateOperationHandler;
import software.amazon.awssdk.aws.greengrass.GreengrassCoreIPCService;
import software.amazon.awssdk.eventstreamrpc.OperationContinuationHandlerContext;
import java.util.function.Function;
import static org.mockito.Mockito.verify;
@ExtendWith({MockitoExtension.class, GGExtension.class})
class LifecycleIPCServiceTest {
LifecycleIPCService lifecycleIPCService;
@Mock
private LifecycleIPCEventStreamAgent eventStreamAgent;
@Mock
private GreengrassCoreIPCService greengrassCoreIPCService;
@Mock
OperationContinuationHandlerContext mockContext;
@BeforeEach
public void setup() {
lifecycleIPCService = new LifecycleIPCService();
lifecycleIPCService.setEventStreamAgent(eventStreamAgent);
lifecycleIPCService.setGreengrassCoreIPCService(greengrassCoreIPCService);
}
@Test
void testHandlersRegistered() {
lifecycleIPCService.startup();
ArgumentCaptor<Function> argumentCaptor = ArgumentCaptor.forClass(Function.class);
verify(greengrassCoreIPCService).setUpdateStateHandler(argumentCaptor.capture());
Function<OperationContinuationHandlerContext, GeneratedAbstractUpdateStateOperationHandler> updateHandler =
(Function<OperationContinuationHandlerContext,
GeneratedAbstractUpdateStateOperationHandler>)argumentCaptor.getValue();
updateHandler.apply(mockContext);
verify(eventStreamAgent).getUpdateStateOperationHandler(mockContext);
verify(greengrassCoreIPCService).setSubscribeToComponentUpdatesHandler(argumentCaptor.capture());
Function<OperationContinuationHandlerContext, GeneratedAbstractSubscribeToComponentUpdatesOperationHandler>
subsHandler = (Function<OperationContinuationHandlerContext,
GeneratedAbstractSubscribeToComponentUpdatesOperationHandler>)argumentCaptor.getValue();
subsHandler.apply(mockContext);
verify(eventStreamAgent).getSubscribeToComponentUpdateHandler(mockContext);
verify(greengrassCoreIPCService).setDeferComponentUpdateHandler(argumentCaptor.capture());
Function<OperationContinuationHandlerContext, GeneratedAbstractDeferComponentUpdateOperationHandler> deferHandler =
(Function<OperationContinuationHandlerContext,
GeneratedAbstractDeferComponentUpdateOperationHandler>)argumentCaptor.getValue();
deferHandler.apply(mockContext);
verify(eventStreamAgent).getDeferComponentHandler(mockContext);
}
}
| [
"joebutl@amazon.com"
] | joebutl@amazon.com |
97fbc70bdf3408e23b03f9f412c7c1af1703309a | 05ce40fae152efc583c52fe42bdd80f3051e1d20 | /src/main/java/com/cheer/controller/LeaveDayController.java | 5af377cb256c91d938e240bde83b03c09b81ee91 | [] | no_license | zqc85398789/cheer | 0fda74eda61ea31235195a84048482b36157bda6 | 628b875ea1bca5e91b9d651c01e919546f73b45b | refs/heads/master | 2022-12-23T10:13:55.522709 | 2019-11-16T02:54:17 | 2019-11-16T02:54:17 | 206,988,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,745 | java | package com.cheer.controller;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.cheer.controller.base.BaseController;
import com.cheer.mybatis.model.IAccount;
import com.cheer.mybatis.model.ILeaveDay;
import com.cheer.mybatis.model.IStaff;
import com.cheer.mybatis.model.IWorkingHour;
import com.cheer.service.LeaveDayService;
@Controller
public class LeaveDayController extends BaseController{
@Resource(name="leaveDayService")
LeaveDayService leaveDayService;
@ModelAttribute
public void setEnconding(HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;utf-8");
}
@RequestMapping("leaveDayList.do")
public String leaveDayList(@ModelAttribute("iLeaveDay")ILeaveDay iLeaveDay,Model model) {
model.addAttribute("max_page",0);
return "leave_day_list";
}
@RequestMapping("queryLeaveDay.do")
public String queryLeaveDay(@RequestParam("empno")String empno,@RequestParam("startTime")Date startTime,
@RequestParam("endTime")Date endTime,@RequestParam int queryPage,Model model) {
if(StringUtils.isEmpty(empno)) {
model.addAttribute("max_page",0);
model.addAttribute("leave_day_msg","员工号不能为空");
return "leave_day_list";
}
List<ILeaveDay> iLeaveDayList = leaveDayService.queryILeaveDay(empno,startTime,endTime,queryPage);
if(iLeaveDayList.size()==0) {
model.addAttribute("max_page",0);
model.addAttribute("leave_day_msg","没有查询到数据");
return "leave_day_list";
}
int totalDays = leaveDayService.queryTotalDays(empno,startTime,endTime);
int maxPage = leaveDayService.getMaxPage(empno, startTime, endTime);
model.addAttribute("empno",empno);
model.addAttribute("max_page",maxPage);
model.addAttribute("current_page",queryPage);
model.addAttribute("iLeaveDayList",iLeaveDayList);
model.addAttribute("totalDays",totalDays);
return "leave_day_list";
}
@RequestMapping("updateLeaveDatePage.do/{id}.do")
public String updateLeaveDatePage(@PathVariable Integer id,Model model) {
ILeaveDay ild = leaveDayService.getILeaveDay(id);
if(ild == null) {
model.addAttribute("max_page",0);
model.addAttribute("leave_day_msg","没有查询到数据");
return "leave_day_list";
}
model.addAttribute("iLeaveDay",ild);
return "leave_day_update";
}
@RequestMapping("updateLeaveDay.do")
public String updateLeaveDay(@ModelAttribute("iLeaveDay") ILeaveDay iLeaveDay,HttpSession session,Model model) {
String accountName = ((IAccount)session.getAttribute("loginAccount")).getAccountName();
iLeaveDay.setUpdateBy(accountName);
if(leaveDayService.updateILeaveDay(iLeaveDay)) {
model.addAttribute("leave_day_update_msg","工时已更新");
return "leave_day_update";
}
model.addAttribute("leave_day_update_msg","更新失败,请检查后重试");
return "leave_day_update";
}
@RequestMapping("createLeaveDayPage.do")
public String createLeaveDayPage(@ModelAttribute("iLeaveDay")ILeaveDay iLeaveDay) {
return "leave_day_create";
}
@RequestMapping("createLeaveDay.do")
public String createLeaveDay(@ModelAttribute("iLeaveDay") @Valid ILeaveDay iLeaveDay, BindingResult br,
Model model, HttpSession session) {
// 信息校验
if (br.hasErrors()) {
model.addAttribute("leave_day_create_msg", "新增记录失败,请检查后重试");
return "leave_day_create";
}
// 检查当日记录是否已存在
if (leaveDayService.recordExists(iLeaveDay)) {
model.addAttribute("leave_day_create_msg", "新增记录失败,已存在同日记录");
return "leave_day_create";
}
// 获取当前登录账户名
iLeaveDay.setCreatedBy(((IAccount) session.getAttribute("loginAccount")).getAccountName());
// 尝试新增记录
if (leaveDayService.createILeaveDay(iLeaveDay)) {
model.addAttribute("leave_day_create_msg", "新增记录成功");
return "leave_day_create";
}
model.addAttribute("leave_day_create_msg", "新增记录失败,请检查后重试");
return "leave_day_create";
}
}
| [
"842357958@qq.com"
] | 842357958@qq.com |
2edee5b5e1fcc67fd9fa6fd97a6525b0914c0a80 | dd92e3d6431f96455edc9952c03c65b043119450 | /Bali-API/src/org/kkonoplev/bali/suiteexec/resource/ResourceMarkerFactory.java | b6fc28ad97ddee2d17154d7d5bfaae74663e4e2d | [
"Apache-2.0"
] | permissive | Kirill1983/Bali | 4af1d3a0870c95b41897b821dcee3b69fb0b91eb | 4a0860be29551bad98217023d83c631b77d057b0 | refs/heads/master | 2021-08-18T09:52:27.025850 | 2021-04-30T11:14:11 | 2021-04-30T11:14:11 | 122,599,547 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,876 | java | /*
* Copyright � 2011 Konoplev Kirill
*
*
* 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.kkonoplev.bali.suiteexec.resource;
import java.util.ArrayList;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.kkonoplev.bali.suiteexec.resource.ResourcePoolFactory;
import org.kkonoplev.bali.suiteexec.resource.TestExecResource;
public class ResourceMarkerFactory implements ResourcePoolFactory {
protected static final Logger log = LogManager.getLogger(ResourceMarkerFactory.class);
public Class<? extends TestExecResource> getResourceClass(){
return EnvResource.class;
}
public ArrayList<TestExecResource> load(String cmd) {
String[] tags = cmd.split(", ");
ArrayList<TestExecResource> resources = new ArrayList<TestExecResource>();
for (String tag: tags){
if (tag.endsWith(EnvResource.ENVRESOURCE)){
String shortTag = tag.substring(0, tag.length()-EnvResource.ENVRESOURCE.length());
resources.add(new EnvResource(shortTag, "UAT2"));
} else
if (tag.endsWith(EnvResource.RESOURCE)){
String shortTag = tag.substring(0, tag.length()-EnvResource.RESOURCE.length());
resources.add(new EnvResource(shortTag, EnvResource.ALLENV));
}
}
return resources;
}
@Override
public String getLoadCmdHelp() {
return "<resource_name> ResourceEnv|Resource";
}
}
| [
"kirill-konoplev@yandex.ru"
] | kirill-konoplev@yandex.ru |
d81771b2846a9cd637e0e697a5db2bb3add29173 | e2eb0d314ba1b01d56d9315b27cddd66b9c149d1 | /src/main/java/by/epam/jmp18/service/UnitService.java | 7cd4a6cf97cab59053db60a8496b39c74642c6c2 | [] | no_license | vitali-ihnatsenka/JMP-18 | 27a22e09b4170489936576f10997cb3f662fca15 | 8d73e51c780e938f0fcd8eec748b39454b163e81 | refs/heads/master | 2020-12-24T06:40:23.441169 | 2016-11-12T17:36:03 | 2016-11-12T17:36:03 | 73,463,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package by.epam.jmp18.service;
import by.epam.jmp18.domain.Unit;
/**
* Created by Vitali on 12.11.2016.
*/
public interface UnitService {
void save(Unit unit);
Unit find(long id);
void update(Unit unit);
void delete(long id);
}
| [
"vitt.ignat@gmail.com"
] | vitt.ignat@gmail.com |
a77fd097a4a6a85abdb44b2d997e7271346aee89 | 390d274d085c08ce27141abf4f7accd5ea8b2cab | /register_app/android/app/src/main/java/com/example/register_app/MainActivity.java | 6c81606ef812063f9191dcbc0e4e7625837619bd | [] | no_license | elertan/label-a-just-go | eaaf810cb47556157e6d96ebf5b626c0e3abf9f6 | 017e393563c8560779bc6fbd401fc7f8e77c3ba3 | refs/heads/master | 2020-05-16T18:29:28.533475 | 2019-04-24T19:39:19 | 2019-04-24T19:39:19 | 183,225,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.example.register_app;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
| [
"denkievits@gmail.com"
] | denkievits@gmail.com |
22652fd7949e6d94738da172a1500944914fa800 | a3f314b9284f897209f944125d20aad26ef41688 | /Ders13/src/Yazar.java | 76e07eff159b8333eb9fa02d079572b9fa0b5e23 | [] | no_license | OzanBoyuk/VektorelBilisimKodlar | 53f3f6451efaa6b438757982aea4098d4640e089 | 24119f2c5c038b62957fa0b46985ef7516e56c2e | refs/heads/master | 2021-01-23T12:37:50.617268 | 2017-08-09T17:22:18 | 2017-08-09T17:22:18 | 93,182,209 | 0 | 0 | null | 2017-07-05T15:22:50 | 2017-06-02T16:02:45 | Java | UTF-8 | Java | false | false | 384 | java |
public class Yazar {
private String yazarAdi="";
public String getYazarAdi() {
return yazarAdi;
}
public void setYazarAdi(String yazarAdi) {
this.yazarAdi = yazarAdi;
}
public String getYazarSoyadi() {
return yazarSoyadi;
}
public void setYazarSoyadi(String yazarSoyadi) {
this.yazarSoyadi = yazarSoyadi;
}
private String yazarSoyadi="";
}
| [
"vektorel@lab8-8"
] | vektorel@lab8-8 |
909df6340d18e8fa42d1f6f56e2c4c4af25586fe | 5e4100a6611443d0eaa8774a4436b890cfc79096 | /src/main/java/com/alipay/api/response/AlipaySocialBaseChatGroupCreateResponse.java | c4ba3b8b984625254dff8b236ebd225cb3305fea | [
"Apache-2.0"
] | permissive | coderJL/alipay-sdk-java-all | 3b471c5824338e177df6bbe73ba11fde8bc51a01 | 4f4ed34aaf5a320a53a091221e1832f1fe3c3a87 | refs/heads/master | 2020-07-15T22:57:13.705730 | 2019-08-14T10:37:41 | 2019-08-14T10:37:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.GroupInfo;
import com.alipay.api.domain.MemberInfo;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.social.base.chat.group.create response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class AlipaySocialBaseChatGroupCreateResponse extends AlipayResponse {
private static final long serialVersionUID = 7192346385549632624L;
/**
* 群信息
*/
@ApiField("group_info")
private GroupInfo groupInfo;
/**
* 群成员信息列表
*/
@ApiListField("member_infos")
@ApiField("member_info")
private List<MemberInfo> memberInfos;
public void setGroupInfo(GroupInfo groupInfo) {
this.groupInfo = groupInfo;
}
public GroupInfo getGroupInfo( ) {
return this.groupInfo;
}
public void setMemberInfos(List<MemberInfo> memberInfos) {
this.memberInfos = memberInfos;
}
public List<MemberInfo> getMemberInfos( ) {
return this.memberInfos;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
a48986eb00e179783108f81c105ed2b2f106807e | 04d2b9982a8479f94e465791ee572b9d6031663b | /refimpl/src/main/java/org/notapache/writeful/forms/FormAdapter.java | a51af665a58c4217439d5c0408bac9a0e761fd2d | [
"Apache-2.0"
] | permissive | williamstw/writeful | 27c0706ec161b63f1915c0d48e5fae9be8e3f0c5 | 23a7c034602b694b091adfb2c334f5459491a24b | refs/heads/master | 2020-12-02T22:20:03.415369 | 2017-07-07T00:44:30 | 2017-07-07T00:44:30 | 96,116,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,314 | java | package org.notapache.writeful.forms;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.EntityLinks;
import org.springframework.stereotype.Component;
import java.beans.PropertyDescriptor;
import java.util.Map;
@Component
public class FormAdapter {
private static final String PATH_ROOT = "/";
@Autowired
private EntityLinks entityLinks;
public Forms createDefault(Object object) throws Exception {
if (object == null) {
throw new IllegalArgumentException("Bean cannot be null.");
}
Map<String, Object> props = PropertyUtils.describe(object);
Forms forms = new Forms();
Form defaultForm = new Form();
defaultForm.add(entityLinks.linkToCollectionResource(object.getClass()).withRel(Form.REL_TARGET));
Class<?> clazz = object.getClass();
for (Map.Entry<String, Object> e : props.entrySet()) {
if (!"class".equals(e.getKey())) {
PropertyDescriptor propertyDescriptor = PropertyUtils.getPropertyDescriptor(object, e.getKey());
if(!propertyDescriptor.getReadMethod().isAnnotationPresent(JsonIgnore.class)) {
defaultForm.getFields().add(createField(e.getKey(), propertyDescriptor));
}
}
}
forms.getForms().put(Forms.DEFAULT, defaultForm);
return forms;
}
private Field createField(String key, PropertyDescriptor descriptor) {
Field f = new Field();
f.setName(key);
f.setPath(PATH_ROOT + key);
String display = String.join(" ", StringUtils.splitByCharacterTypeCamelCase(key));
f.setDisplayText(StringUtils.capitalize(display));
if (descriptor.getReadMethod().isAnnotationPresent(Writeful.class)) {
Writeful annotation = descriptor.getReadMethod().getAnnotation(Writeful.class);
if (StringUtils.isNotEmpty(annotation.display())) {
f.setDisplayText(annotation.display());
}
f.setType(annotation.type());
}
return f;
}
}
| [
"williamstw@gmail.com"
] | williamstw@gmail.com |
d6800f80fb224dee9a359ae998413a4a95ab16bc | d4b141f4ad849844bc7056011293f011029f37e5 | /tank-program/src/main/java/com/lq/tank/enums/Dir.java | 3ffcf8979039106acc04029c32fdc12a0ed8fa1b | [] | no_license | poxiaoliming36/java-own | 6032c100f690906806a6ae893f22ba9da3925df8 | 168b016177be2b58b305d87de038b7f80a3edd52 | refs/heads/master | 2023-04-07T09:24:01.687624 | 2021-04-16T14:08:48 | 2021-04-16T14:08:48 | 307,056,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | package com.lq.tank.enums;
/**
* @Description
* @Date 2021/4/12 22:23
* @Author lq
*/
public enum Dir {
LEFT,UP,DOWN,RIGHT
}
| [
"1546315068@qq.com"
] | 1546315068@qq.com |
ef2371cae44278f4cbd1eb27b29179b3c5b73ba3 | 154a46f37ffb89f774ec766f9ae4c6c1e803fa09 | /pi_social_network-ejb/src/main/java/tn/esprit/entities/Post.java | db1e68e040e62feade5fbe2e291a691f77729b37 | [] | no_license | ahmeeeeeeed/social_network_java_backend | 09b188cfdebc34d9a46465b0eb73cf86f904cd94 | 3b9bb18bbdf67996ca0e0b6c2d7477a68c507aae | refs/heads/master | 2022-07-12T20:23:18.949967 | 2019-12-15T01:28:21 | 2019-12-15T01:28:21 | 228,111,880 | 0 | 0 | null | 2022-06-30T20:22:02 | 2019-12-15T01:13:48 | Java | UTF-8 | Java | false | false | 1,688 | java | package tn.esprit.entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
public class Post implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue( strategy= GenerationType.IDENTITY)
private int id ;
private String description ;
private boolean isActive = true;
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Temporal(TemporalType.DATE)
private Date datePost ;
public Post () {
}
public Post(int id, String description, Date datePost) {
super();
this.id = id;
this.description = description;
this.datePost = datePost;
}
public Post(String description, Date datePost) {
super();
this.description = description;
this.datePost = datePost;
}
public Post(int idPost) {
this.id=idPost;
}
@Override
public String toString() {
return "Post [id=" + id + ", description=" + description + ", datePost=" + datePost + "]";
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getDatePost() {
return datePost;
}
public void setDatePost(Date datePost) {
this.datePost = datePost;
}
}
| [
"ahmed.benmbarek96@gmail.com"
] | ahmed.benmbarek96@gmail.com |
3b6903b38a60e8e0f4c801aa0ea496cbe6bc5323 | fd42ba7ea13dd68e65a13dd359c0ea0d684a0c87 | /java/src/main/java/be/steinsomers/bron_kerbosch/BronKerbosch3_gpx.java | 96c05a262de3915e0364117d258a18fc06ed6693 | [
"BSD-3-Clause"
] | permissive | ssomers/Bron-Kerbosch | f8ec904ca67b2b657121a4dda34a7859763dd7fd | c8b30c34944013fb0869dfa9333d3bc4ae52e33f | refs/heads/master | 2023-07-23T00:42:22.832068 | 2023-07-13T09:36:30 | 2023-07-13T09:36:30 | 152,104,885 | 6 | 0 | null | 2018-10-08T15:39:39 | 2018-10-08T15:39:38 | null | UTF-8 | Java | false | false | 302 | java | package be.steinsomers.bron_kerbosch;
import java.util.stream.Stream;
public final class BronKerbosch3_gpx implements BronKerboschAlgorithm {
@Override
public Stream<int[]> explore(UndirectedGraph graph) {
return BronKerboschOrder.explore(graph, PivotChoice.MaxDegreeLocalX);
}
}
| [
"git@steinsomers.be"
] | git@steinsomers.be |
14891202b934e691a4e73b8354fdc51f1331921c | 18a091eb9b0ecd38fc637f9991f2fc2493c47235 | /eclipse-workspace/demo1/src/main/java/com/syn/ObjectifyWebFilter.java | 7851f9622bd5c5a5a0f4e2202d2dcdf9cc7cc0e3 | [] | no_license | callakela/gcprepo | 3196fa2410ed282f8cedf5aa415847398261a467 | 5314228a13488c5a7a594d32d3824a6715d93000 | refs/heads/master | 2020-04-12T19:09:51.858433 | 2018-12-21T11:07:25 | 2018-12-21T11:07:25 | 162,701,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.syn;
import javax.servlet.annotation.WebFilter;
import com.googlecode.objectify.ObjectifyFilter;
/**
* Filter required by Objectify to clean up any thread-local transaction contexts and pending
* asynchronous operations that remain at the end of a request.
*/
@WebFilter(urlPatterns = {"/*"})
public class ObjectifyWebFilter extends ObjectifyFilter {} | [
"callakela@vm1-amitk.us-west1-b.c.gleaming-lead-225504.internal"
] | callakela@vm1-amitk.us-west1-b.c.gleaming-lead-225504.internal |
952e56a03ee8bcf0e61d7e8e2062d825038453f4 | 9dbc4a42b33d25ab1c0d8495abcdfbf93b6863f8 | /nbmerchandise/nbmerchandisefulfilmentprocess/src/de/hybris/nbmerchandise/fulfilmentprocess/actions/order/SendOrderRefundNotificationAction.java | c535fbf6e4954e5934fca8668f36cd7606a63413 | [] | no_license | MarcosKnightCS401/NBGardens | 7c7cba920f16388812a33d85f601d40fd47cf7d5 | 5e5de7528b719bbc5eab8e27a058539a40e92429 | refs/heads/master | 2020-05-29T09:42:59.664482 | 2015-02-17T18:20:22 | 2015-02-17T18:20:22 | 30,235,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,492 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2014 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.nbmerchandise.fulfilmentprocess.actions.order;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Required;
import de.hybris.platform.orderprocessing.model.OrderProcessModel;
import de.hybris.platform.processengine.action.AbstractProceduralAction;
import de.hybris.platform.servicelayer.event.EventService;
import de.hybris.nbmerchandise.fulfilmentprocess.events.OrderCancelledEvent;
public class SendOrderRefundNotificationAction extends AbstractProceduralAction<OrderProcessModel>{
private static final Logger LOG = Logger.getLogger(SendOrderRefundNotificationAction.class);
private EventService eventService;
@Override
public void executeAction(final OrderProcessModel process)
{
getEventService().publishEvent(new OrderCancelledEvent(process));
if (LOG.isInfoEnabled())
{
LOG.info("Process: " + process.getCode() + " in step " + getClass());
}
}
protected EventService getEventService()
{
return eventService;
}
@Required
public void setEventService(final EventService eventService)
{
this.eventService = eventService;
}
}
| [
"mek110@yahoo.com"
] | mek110@yahoo.com |
6b6ea968cb76c2c647d90b9cbfd865352f6f8e58 | e4068e41cd32596ccd513e06322c46cb95025be4 | /src/string/string_word_rev.java | 1f91998ed5af8af73c3a224d029ec056d9252d04 | [] | no_license | chandrakanttiwari31/Core-Java-Practice-Set | 88f6265cde9a236eaf034e4dd97651363fb7dca5 | fd097f90ed628437999cd6a397eb48fbf1936308 | refs/heads/master | 2023-02-03T16:33:33.612176 | 2020-12-15T18:24:35 | 2020-12-15T18:24:35 | 321,753,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package string;
public class string_word_rev {
public static void main(String[] args)
{
String s[] = "Coder Technologies vashi".split(" ");
String ans = "";
for (int i = s.length - 1; i >= 0; i--) {
ans += s[i] + " ";
}
System.out.println("Reversed String:");
System.out.println(ans);
}
}
| [
"tiwarichandan187@gmail.com"
] | tiwarichandan187@gmail.com |
acdeb3effb3d6613c9480d81268557abebb85f60 | 2f75487366a63aa588a4204d17029e3565fa2e64 | /src/com/company/Submarine.java | c4ce431d0ffd730183c2cef8197cacfaa2034e27 | [] | no_license | ekeric112/BattleShip | b0d872e0ee7576ef6aabb49818c4aaf30aab6112 | ece0f0d2a1f40354afefe98552237b3963d25c56 | refs/heads/master | 2020-09-05T12:42:31.927944 | 2019-11-06T23:14:57 | 2019-11-06T23:14:57 | 220,108,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package com.company;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
public class Submarine extends Ship {
private BufferedImage hImage = ImageIO.read(getClass().getResource("ship_submarineh.png"));
private BufferedImage vImage = ImageIO.read(getClass().getResource("ship_submarinev.png"));
public Submarine(int length, Grid grid, SetShipMenu shipMenu) throws IOException {
super(length, grid, shipMenu);
}
public String getType() {
return "Submarine";
}
public BufferedImage getIcon(boolean vertical) {
if (vertical) {
return vImage;
} else {
return hImage;
}
}
}
| [
"ekeric112@gmail.com"
] | ekeric112@gmail.com |
8b9291714a14fb8d24026f9d04a523c9b08fd8ac | 6f50edc334d2ea15bba9092d0e41cf32d7141b80 | /object-mapper-example/src/test/java/object/mapper/example/LibraryTest.java | 52220e902d6bdc164f14af0f33ee6e3117829875 | [] | no_license | powerhorang2/object-mapper-example | f629fa87d21ec0e1cbe987506d1960c6db118b35 | d0d130f116504fd56fc20bb0bd4ca02c73af0679 | refs/heads/main | 2023-07-15T19:39:26.777443 | 2021-08-23T01:25:27 | 2021-08-23T01:25:27 | 397,456,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package object.mapper.example;
import org.junit.Test;
import static org.junit.Assert.*;
public class LibraryTest {
@Test
public void testSomeLibraryMethod() {
Library classUnderTest = new Library();
assertTrue("someLibraryMethod should return 'true'", classUnderTest.someLibraryMethod());
}
}
| [
"tjrdbqls3@naver.com"
] | tjrdbqls3@naver.com |
84f23c1f42097a7f551d7cc9448c8d329fca9794 | 5c8f5d4a9d2b8481e1fadfa0735d6836107596f9 | /src/hra/SeznamZdi.java | bc463f9d83738c535063c24c7abbac1f9bc971ae | [] | no_license | tljo/repo | d2425217385d6f6b94da37e5b83e8d554da2452d | 9cfac38062b5dfb544bbec66a06fc4cffccab81d | refs/heads/master | 2021-05-04T02:35:52.978788 | 2016-12-19T21:19:53 | 2016-12-19T21:19:53 | 71,348,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | package hra;
import java.util.ArrayList;
public class SeznamZdi extends ArrayList<Zed>{
private static final long serialVersionUID = 1L;
private int ktera;
public SeznamZdi(){
super();
ktera = 0;
}
@Override
public void clear(){
super.clear();
ktera = 0; //smaze se seznam a hodnota se recykluje
}
public Zed getAktualniZed(){
return this.get(ktera);
}
public Zed getPredchoziZed(){
if(ktera > 0){
return this.get(ktera - 1);
}
return this.get(this.size()-1);
}
public void nastavDalsiZedNaAktualni(){
if(ktera < this.size()-1){
ktera = ktera + 1;
}else{
ktera = 0;
}
}
}
| [
"aron.stoone@hotmail.cz"
] | aron.stoone@hotmail.cz |
e18b6cc2767e0031ab5aea57a0a1fde051849aa1 | d531fc55b08a0cd0f71ff9b831cfcc50d26d4e15 | /gen/main/java/org/hl7/fhir/SubstanceSpecificationProperty.java | 22af359ca43dafb53c8caa06ab74e3df65b44ba4 | [] | no_license | threadedblue/fhir.emf | f2abc3d0ccce6dcd5372874bf1664113d77d3fad | 82231e9ce9ec559013b9dc242766b0f5b4efde13 | refs/heads/master | 2021-12-04T08:42:31.542708 | 2021-08-31T14:55:13 | 2021-08-31T14:55:13 | 104,352,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,190 | java | /**
*/
package org.hl7.fhir;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Substance Specification Property</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* The detailed description of a substance, typically at a level beyond what is used for prescribing.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getCategory <em>Category</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getCode <em>Code</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getParameters <em>Parameters</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getDefiningSubstanceReference <em>Defining Substance Reference</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getDefiningSubstanceCodeableConcept <em>Defining Substance Codeable Concept</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getAmountQuantity <em>Amount Quantity</em>}</li>
* <li>{@link org.hl7.fhir.SubstanceSpecificationProperty#getAmountString <em>Amount String</em>}</li>
* </ul>
*
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty()
* @model extendedMetaData="name='SubstanceSpecification.Property' kind='elementOnly'"
* @generated
*/
public interface SubstanceSpecificationProperty extends BackboneElement {
/**
* Returns the value of the '<em><b>Category</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A category for this property, e.g. Physical, Chemical, Enzymatic.
* <!-- end-model-doc -->
* @return the value of the '<em>Category</em>' containment reference.
* @see #setCategory(CodeableConcept)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_Category()
* @model containment="true"
* extendedMetaData="kind='element' name='category' namespace='##targetNamespace'"
* @generated
*/
CodeableConcept getCategory();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getCategory <em>Category</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Category</em>' containment reference.
* @see #getCategory()
* @generated
*/
void setCategory(CodeableConcept value);
/**
* Returns the value of the '<em><b>Code</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Property type e.g. viscosity, pH, isoelectric point.
* <!-- end-model-doc -->
* @return the value of the '<em>Code</em>' containment reference.
* @see #setCode(CodeableConcept)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_Code()
* @model containment="true"
* extendedMetaData="kind='element' name='code' namespace='##targetNamespace'"
* @generated
*/
CodeableConcept getCode();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getCode <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Code</em>' containment reference.
* @see #getCode()
* @generated
*/
void setCode(CodeableConcept value);
/**
* Returns the value of the '<em><b>Parameters</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Parameters that were used in the measurement of a property (e.g. for viscosity: measured at 20C with a pH of 7.1).
* <!-- end-model-doc -->
* @return the value of the '<em>Parameters</em>' containment reference.
* @see #setParameters(org.hl7.fhir.String)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_Parameters()
* @model containment="true"
* extendedMetaData="kind='element' name='parameters' namespace='##targetNamespace'"
* @generated
*/
org.hl7.fhir.String getParameters();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getParameters <em>Parameters</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Parameters</em>' containment reference.
* @see #getParameters()
* @generated
*/
void setParameters(org.hl7.fhir.String value);
/**
* Returns the value of the '<em><b>Defining Substance Reference</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol). (choose any one of definingSubstance*, but only one)
* <!-- end-model-doc -->
* @return the value of the '<em>Defining Substance Reference</em>' containment reference.
* @see #setDefiningSubstanceReference(Reference)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_DefiningSubstanceReference()
* @model containment="true"
* extendedMetaData="kind='element' name='definingSubstanceReference' namespace='##targetNamespace'"
* @generated
*/
Reference getDefiningSubstanceReference();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getDefiningSubstanceReference <em>Defining Substance Reference</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Defining Substance Reference</em>' containment reference.
* @see #getDefiningSubstanceReference()
* @generated
*/
void setDefiningSubstanceReference(Reference value);
/**
* Returns the value of the '<em><b>Defining Substance Codeable Concept</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol). (choose any one of definingSubstance*, but only one)
* <!-- end-model-doc -->
* @return the value of the '<em>Defining Substance Codeable Concept</em>' containment reference.
* @see #setDefiningSubstanceCodeableConcept(CodeableConcept)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_DefiningSubstanceCodeableConcept()
* @model containment="true"
* extendedMetaData="kind='element' name='definingSubstanceCodeableConcept' namespace='##targetNamespace'"
* @generated
*/
CodeableConcept getDefiningSubstanceCodeableConcept();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getDefiningSubstanceCodeableConcept <em>Defining Substance Codeable Concept</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Defining Substance Codeable Concept</em>' containment reference.
* @see #getDefiningSubstanceCodeableConcept()
* @generated
*/
void setDefiningSubstanceCodeableConcept(CodeableConcept value);
/**
* Returns the value of the '<em><b>Amount Quantity</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Quantitative value for this property. (choose any one of amount*, but only one)
* <!-- end-model-doc -->
* @return the value of the '<em>Amount Quantity</em>' containment reference.
* @see #setAmountQuantity(Quantity)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_AmountQuantity()
* @model containment="true"
* extendedMetaData="kind='element' name='amountQuantity' namespace='##targetNamespace'"
* @generated
*/
Quantity getAmountQuantity();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getAmountQuantity <em>Amount Quantity</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Amount Quantity</em>' containment reference.
* @see #getAmountQuantity()
* @generated
*/
void setAmountQuantity(Quantity value);
/**
* Returns the value of the '<em><b>Amount String</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Quantitative value for this property. (choose any one of amount*, but only one)
* <!-- end-model-doc -->
* @return the value of the '<em>Amount String</em>' containment reference.
* @see #setAmountString(org.hl7.fhir.String)
* @see org.hl7.fhir.FhirPackage#getSubstanceSpecificationProperty_AmountString()
* @model containment="true"
* extendedMetaData="kind='element' name='amountString' namespace='##targetNamespace'"
* @generated
*/
org.hl7.fhir.String getAmountString();
/**
* Sets the value of the '{@link org.hl7.fhir.SubstanceSpecificationProperty#getAmountString <em>Amount String</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Amount String</em>' containment reference.
* @see #getAmountString()
* @generated
*/
void setAmountString(org.hl7.fhir.String value);
} // SubstanceSpecificationProperty
| [
"roberts_geoffry@bah.com"
] | roberts_geoffry@bah.com |
be9c06e34a0e48e049d32a7724cb36c5e159589d | e9213e8c3921acc4a5d26a3bb24c26be3391b7fa | /Angry Fruit Vendor/core/src/com/isaac/interfaces/_ButtonListener.java | 351708139557e45179b3b70dde8aeaba60db2a68 | [] | no_license | hollowayisaac/AS_LibgdxProjects | e3d506713908a9a876e27dc5b77d88c3fd41b4c8 | 15344663cae0cad99f2c20ead98290ba23e0a868 | refs/heads/master | 2021-01-18T22:31:11.416577 | 2016-07-25T01:42:47 | 2016-07-25T01:42:47 | 33,430,312 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 146 | java | package com.isaac.interfaces;
/**
* Created by Isaac Holloway on 6/13/2015.
*/
public interface _ButtonListener {
public void onClick();
}
| [
"hollowayisaac@gmail.com"
] | hollowayisaac@gmail.com |
6b4986f8d936dbd31d174d9b7182109a60bdd188 | e6d34bda17520f1e61bb9fab1b3a1e660a91b0db | /src/main/java/walkingkooka/collect/map/FakeMap.java | aa08909a62a8eab0af40284497dd63612f9e3aad | [
"Apache-2.0"
] | permissive | mP1/walkingkooka | d614345bb2ebef1e4e5c976f9a24cbda2e0c3bb5 | fc2b2aba7c9a29eee7dec25177b5b7cf0313554e | refs/heads/master | 2023-07-19T10:18:59.148269 | 2023-07-17T10:40:49 | 2023-07-17T10:40:49 | 135,434,888 | 2 | 2 | Apache-2.0 | 2023-09-13T09:09:18 | 2018-05-30T11:47:26 | Java | UTF-8 | Java | false | false | 2,438 | java | /*
* Copyright 2019 Miroslav Pokorny (github.com/mP1)
*
* 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 walkingkooka.collect.map;
import walkingkooka.test.Fake;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
/**
* A {@link Map} where all methods throw {@link UnsupportedOperationException}. This is intended to
* be used only when creating fakes.
*/
public class FakeMap<K, V> implements Map<K, V>, Fake {
static <K, V> Map<K, V> create() {
return new FakeMap<>();
}
protected FakeMap() {
super();
}
@Override
public int size() {
throw new UnsupportedOperationException();
}
@Override
public boolean isEmpty() {
throw new UnsupportedOperationException();
}
@Override
public boolean containsKey(final Object key) {
throw new UnsupportedOperationException();
}
@Override
public boolean containsValue(final Object value) {
throw new UnsupportedOperationException();
}
@Override
public V get(final Object key) {
throw new UnsupportedOperationException();
}
@Override
public V put(final K key, final V value) {
throw new UnsupportedOperationException();
}
@Override
public V remove(final Object key) {
throw new UnsupportedOperationException();
}
@Override
public void putAll(final Map<? extends K, ? extends V> m) {
throw new UnsupportedOperationException();
}
@Override
public void clear() {
throw new UnsupportedOperationException();
}
@Override
public Set<K> keySet() {
throw new UnsupportedOperationException();
}
@Override
public Collection<V> values() {
throw new UnsupportedOperationException();
}
@Override
public Set<Entry<K, V>> entrySet() {
throw new UnsupportedOperationException();
}
}
| [
"miroslav.pokorny@gmail.com"
] | miroslav.pokorny@gmail.com |
25692d48b2013936c9ab853d7c3908a6453c665b | bb2152eb82628255d4101456e6841094cf9ccd93 | /CH06_Method/src/returnValues/App.java | e658ac453294779844c3bf702b2d330e081866ab | [
"MIT"
] | permissive | RaulSong/java_study | 182420f3e03b0863aa5ca1293125bc0ed3ca5db3 | a8feba7d5c66563847894079f6694a74fddc870f | refs/heads/main | 2023-08-29T20:38:34.871871 | 2021-11-03T06:00:27 | 2021-11-03T06:00:27 | 416,540,815 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 261 | java | package returnValues;
public class App {
public static void main(String[] args) {
//메소드의 리턴
ReturnValue value1=new ReturnValue();
System.out.println(value1.getAnimal());
String ani=value1.getAnimal();
System.out.println(ani);
}
}
| [
"opal6100@naver.com"
] | opal6100@naver.com |
f0d5e17968ed631aec6bd20bcd4f1d0ba4e90b22 | 50cf0a5e0da769af7f5ea0eb564c73d80f80bbc3 | /src/test/java/javaPractice/StringFunctions.java | a692e3bb633efceaf5d91ad92f6a63a984c24a65 | [] | no_license | rahilshaikh20/ReadyProject | 607a03ae40b2649bb7ad28ba67b97f557d0b49ac | 7c07d007795ea1cc98101e6b7579daa13dceb4e2 | refs/heads/master | 2023-07-25T03:19:22.365068 | 2022-03-24T09:14:29 | 2022-03-24T09:14:29 | 167,159,099 | 0 | 0 | null | 2023-07-07T21:16:00 | 2019-01-23T09:51:54 | Java | UTF-8 | Java | false | false | 1,444 | java | package javaPractice;
import com.gargoylesoftware.htmlunit.util.StringUtils;
public class StringFunctions {
public static void main(String[] args) {
String S1 ="This is my place";
String S2 = S1;
S2.split("g");
System.out.println(S1.length());
/*System.out.println(S1.contains("the best"));
System.out.println(S1.trim());
System.out.println(S1.toUpperCase());
System.out.println(S1.concat(S2));
System.out.println(S1.getClass());
*/
String blogName = "how to do in java and python";
StringBuilder reverseString = new StringBuilder();
String[] words = blogName.split(" "); //step 1
System.out.println(words.length);
//for reversing words in a string
for (String word : words)
{
String reverseWord = new StringBuilder(word).reverse().toString(); //step 2
reverseString.append(reverseWord+ " " ); //step 3
}
System.out.println( reverseString.toString().trim() );
//for reversing sequence of words in a string
for(int i=words.length-1;i>=0;i--)
{
System.out.print(words[i]+ " ");
}
StringBuffer demo1 = new StringBuffer("Hello") ;
// The above object stored in heap and its value can be changed .
demo1=new StringBuffer("Bye");
demo1 =new StringBuffer("Welcome");
System.out.println();
System.out.println(demo1);
}
}
| [
"44061715+rahilshaikh20@users.noreply.github.com"
] | 44061715+rahilshaikh20@users.noreply.github.com |
c2ab621f353a8dc9c5470bcb8bcdb86fb175a744 | d6381d331fb3ee73df7fb1f76721d72c64385e7c | /src/com/cice/diccionarios/Diccionarios.java | 55b7c3d71cba047bb11cbe7c2438434b52e91afd | [] | no_license | luislopez1981/007-Diccionarios | 75019e5987ebd5cfcee6c7578c489fc6d979e986 | 6dbbdc78541bfdbe460a81f8e598e2584c1705fe | refs/heads/master | 2021-01-01T18:14:59.005902 | 2017-07-25T09:05:36 | 2017-07-25T09:05:36 | 98,286,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package com.cice.diccionarios;
import java.util.Hashtable;
public class Diccionarios {
public static void main(String[] args){
Hashtable<String,String> diccionario = new Hashtable<>();
String dentroDelCajon = diccionario.put("cajon", "calculadora");
System.out.println(dentroDelCajon); //null
dentroDelCajon = diccionario.put("cajon", "linterna");
System.out.println(dentroDelCajon); //calculadora
dentroDelCajon = diccionario.put("cajon", "estuche");
System.out.println("habia "+ dentroDelCajon);
System.out.println("hay " + diccionario.get("cajon"));
System.out.println(diccionario.size());
//diccionario.remove("cajon");
//System.out.println(diccionario.size());
System.out.println(diccionario.contains("estuchE".toLowerCase()));
//operador ternario
String mensaje = (1 < 2) ? "hola" : "adios";
if(1 > 2){
System.out.println(mensaje);
} else {
System.out.println(mensaje);
}
}
}
| [
"NYL@NYL-PC"
] | NYL@NYL-PC |
50a15f19a8e2589b46c6fad33cf831065287c52b | 9c89827b24523e10780578a70730f3e034d6ce97 | /accelerate-core/src/main/java/co/pishfa/security/exception/ChangePasswordException.java | 8d251a883dd135c45032999655656df01294d99e | [
"Apache-2.0"
] | permissive | aliakbarRashidi/accelerate | 6fbb2828b314b99286f5767a6d69ee798899ef9d | ddd2bae9872e72c661800c81d4ebab4321002911 | refs/heads/master | 2020-03-18T01:08:53.934710 | 2017-01-29T07:32:52 | 2017-01-29T07:32:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package co.pishfa.security.exception;
import co.pishfa.accelerate.exception.UiException;
/**
*
* @author Taha Ghasemi <taha.ghasemi@gmail.com>
*
*/
@UiException(page = "ac:passwordChange", message = "security.error.changePassword")
public class ChangePasswordException extends AuthenticationException {
private static final long serialVersionUID = 1L;
}
| [
"taha.ghasemi@gmail.com"
] | taha.ghasemi@gmail.com |
f15b51d199d184af4323b951883ec51e8e9a2dc1 | aa6997aba1475b414c1688c9acb482ebf06511d9 | /src/org/w3c/dom/html/HTMLFieldSetElement.java | b4e3e06a56b46e872fc92ca115f79252fe4f8be5 | [] | no_license | yueny/JDKSource1.8 | eefb5bc88b80ae065db4bc63ac4697bd83f1383e | b88b99265ecf7a98777dd23bccaaff8846baaa98 | refs/heads/master | 2021-06-28T00:47:52.426412 | 2020-12-17T13:34:40 | 2020-12-17T13:34:40 | 196,523,101 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,247 | java | /*
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
/*
*
*
*
*
*
* Copyright (c) 2000 World Wide Web Consortium,
* (Massachusetts Institute of Technology, Institut National de
* Recherche en Informatique et en Automatique, Keio University). All
* Rights Reserved. This program is distributed under the W3C's Software
* Intellectual Property License. This program is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
* details.
*/
package org.w3c.dom.html;
/**
* Organizes form controls into logical groups. See the FIELDSET element definition in HTML 4.0.
* <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model
* (DOM) Level 2 Specification</a>.
*/
public interface HTMLFieldSetElement extends HTMLElement {
/**
* Returns the <code>FORM</code> element containing this control. Returns
* <code>null</code> if this control is not within the context of a form.
*/
public HTMLFormElement getForm();
}
| [
"yueny09@163.com"
] | yueny09@163.com |
8f16f73485de635d443b59da6bc935d9ec777717 | e7f4b67312723941c432d81663e1210138d529b1 | /Examples/Java/SDK/src/main/java/com/aspose/cells/cloud/examples/worksheet/CopyWorksheet.java | 029659ce47a703eb67c4671b44174435fb5b6134 | [
"MIT"
] | permissive | naeem244/Aspose.Cells-for-Cloud | c4e20d43ab51eff1c855834140ef8205fffe90e1 | d6d5d28776c1e8d462d85e5750fb9bbf52e3a62e | refs/heads/master | 2021-05-03T20:55:05.849247 | 2016-10-20T11:45:55 | 2016-10-20T11:45:55 | 71,455,162 | 0 | 0 | null | 2016-10-20T11:11:41 | 2016-10-20T11:11:41 | null | UTF-8 | Java | false | false | 1,289 | java | package com.aspose.cells.cloud.examples.worksheet;
import com.aspose.cells.cloud.examples.Utils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
public class CopyWorksheet {
public static void main(String... args) throws IOException {
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(CopyWorksheet.class, input);
Path outputFile = Utils.getPath(CopyWorksheet.class, output);
String sourceSheet = "Sheet1";
String copySheet = "Sheet2";
Utils.getStorageSdk().PutCreate(
input,
null,
Utils.STORAGE,
inputFile.toFile()
);
Utils.getCellsSdk().PostCopyWorksheet(
input,
copySheet,
sourceSheet,
null,
Utils.STORAGE
);
com.aspose.storage.model.ResponseMessage sr
= Utils.getStorageSdk().GetDownload(
input,
null,
Utils.STORAGE
);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
}
| [
"saqib@masood.pk"
] | saqib@masood.pk |
7b4ab1709d5dfb311f8c2a0903bbf2c59be3ddb6 | a4847931b379f5d449d04b6085efcbf8555d4fbf | /src/main/java/com/mani/practice/random/InitialHashTableSize.java | 03616eccf45736ae5f5cea1cf07dc7593cf5e914 | [] | no_license | manishdubey13/myProjects | 4bd0eca271cfb35d145dfeaa3c3074e67577d956 | 62e9b0bd5e3c0c5eb155cb2dd20bbd1d3338ffd6 | refs/heads/master | 2020-04-02T08:14:29.374893 | 2019-02-02T16:58:41 | 2019-02-02T16:58:41 | 154,235,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package com.mani.practice.random;
import java.util.HashMap;
public class InitialHashTableSize
{
public static void main(String[] args)
{
//System.out.println(tableSizeFor());
HashMap map = new HashMap();
System.out.println(map.size());
//System.out.println(HashMap.SimpleEntry);
System.out.println(map.entrySet().size());
}
static final int tableSizeFor(int cap)
{
int n = cap - 1;
n |= n >>> 1;
n |= n >>> 2;
n |= n >>> 4;
n |= n >>> 8;
n |= n >>> 16;
return n;
}
}
| [
"manishdubey13@gmail.com"
] | manishdubey13@gmail.com |
fcc9b04f1cc5eeb24e20b46252d7d10b7ff67d76 | 29e19b2e92c2ad9c5682aa90ef39e94517727a15 | /common/src/main/java/com/abbink/n26/common/error/UnauthorizedException.java | 5a54c291d87b4d383ba2c7fc7006befa1f5c07a5 | [] | no_license | derabbink/n26 | 56f3fc55b46937782448d14d51ee977f6b7a8e90 | 7a5d1418bb2aeafc96ac29eecfb85e1653863e38 | refs/heads/master | 2020-07-03T18:27:01.963543 | 2016-08-21T19:06:34 | 2016-08-21T19:06:34 | 66,211,635 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package com.abbink.n26.common.error;
import javax.ws.rs.core.Response.Status;
public class UnauthorizedException extends WebAppError {
private static final long serialVersionUID = 6494575658326412522L;
public UnauthorizedException(int code, String message) {
super(code, message, Status.UNAUTHORIZED);
}
public UnauthorizedException(int code, String message, Throwable cause) {
super(code, message, Status.UNAUTHORIZED, cause);
}
}
| [
"maarten@abbink.me"
] | maarten@abbink.me |
b0dd4a6bfec244700acfadc7ad75eeb9555063e5 | 5660dcd358aac5a794a234a2ceafba5ea0cb4624 | /app/src/main/java/com/example/hacine/mohamed_gads_project/data/PostClient.java | aeffc01269e9d0fe38fcddf93ea1b049294b643f | [] | no_license | mohamed00736/GadsProject-AAD-HacineMohamedAbdelhakim | b11f06af78e43d2c95b94ce3d459b21b5dde0325 | ba99067067083bbaceded2091d5ee778db5c1305 | refs/heads/master | 2022-12-09T05:18:05.304639 | 2020-09-01T18:54:24 | 2020-09-01T18:54:24 | 291,868,384 | 0 | 0 | null | 2020-09-02T16:40:38 | 2020-09-01T01:50:37 | Java | UTF-8 | Java | false | false | 1,158 | java | package com.example.hacine.mohamed_gads_project.data;
import com.example.hacine.mohamed_gads_project.pojo.SkillIqModel;
import com.example.hacine.mohamed_gads_project.pojo.TopLearnerModel;
import java.util.List;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class PostClient {
private static final String BASE_URL = "https://gadsapi.herokuapp.com/";
private PostInterface postInterface;
private static PostClient INSTANCE;
public PostClient( ) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
postInterface = retrofit.create(PostInterface.class);
}
// Singelton
public static PostClient getINSTANCE() {
if (null == INSTANCE){
INSTANCE = new PostClient();
}
return INSTANCE;
}
public Call<List<SkillIqModel>>getTopSkill(){
return postInterface.getTopSkill();
}
public Call<List<TopLearnerModel>>getTopLearners(){ return postInterface.getTopLearners(); }
}
| [
"mohamed.hacine00@gmail.ocm"
] | mohamed.hacine00@gmail.ocm |
e7fcf764021531c03e8d62a49a5629e418008a45 | 4b662021536d63b3357bb10c22fbbfaa601a1c12 | /Demo_01.java | 24b16d0db1e41392adf0a49c1ce70f9b4e259705 | [] | no_license | LiLiLiLaLa/FCode | 37dc5f8db1ba4cc6bfba1c170a599c3b5f44f2e7 | 4fdbb01a1c8cde056effe3ae875f9d6e64bd6258 | refs/heads/master | 2020-04-02T10:37:49.611015 | 2019-01-14T13:28:28 | 2019-01-14T13:28:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | import java.util.Scanner;
abstract class Computer{
public abstract void fun();
}
class SufeBook extends Computer{
public void fun(){
System.out.println("This is SufeBook");
}
}
class MacBookPro extends Computer{
public void fun(){
System.out.println("This is MacBookPro");
}
}
class ComputerFactory{
private ComputerFactory(){}
public static Computer getComuter(String pcType){
Computer ret = null;
if(pcType.equals("mac")){
ret = new MacBookPro();
}else if(pcType.equals("sufe")){
ret = new SufeBook();
}
return ret;
}
}
public class Demo{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入笔记本");
Computer ret = ComputerFactory.getComuter(sc.next());
ret.fun();
}
} | [
"1921300809@qq.com"
] | 1921300809@qq.com |
79feb0d1096b4089d97e51b4236e4267de5430c9 | 998fcc87979884727507629aa3b20ecbb766da26 | /mock/inform/InformEvent.java | 918d44c8454259f34a8fde8db2958d0252152218 | [] | no_license | kanetempletonuiowa/CS2820 | 6bba065d9ec8f24995f5d8571a0efd46baf97636 | 7dcff58fb6f8e5da686090b5db5339a5fe749ed1 | refs/heads/cs2820 | 2020-01-24T20:53:02.395728 | 2016-12-08T11:22:24 | 2016-12-08T11:22:24 | 73,853,961 | 0 | 2 | null | 2016-12-06T03:28:10 | 2016-11-15T20:49:39 | Java | UTF-8 | Java | false | false | 406 | java | package production.mock.inform;
import production.Event;
import production.Task;
//event class to be called by informer. probably didn't need this as a separate class
/*
InformEvent
@author: Kane Templeton
Event to print simulation information
*/
public class InformEvent extends Event {
public InformEvent(int t, Task task) {
super("Print Information",t, task);
}
}
| [
"space@10.11.39.197"
] | space@10.11.39.197 |
bab7859f0f155c118beab4ae66c7e051203776ca | 181b9e97898642a7af489d2728b4cc04fd1a0352 | /src/main/java/com/yet/spring/core/util/AwareBean.java | e86a96ec39dfd0b0587675c14cbdf32f95443191 | [] | no_license | sashamartian/SpringCore | 62ef708e96be90a8bb0b491ac69dae728b9ca9ca | 3987694caed9a29a3c4d477632ec42451f14a4e1 | refs/heads/master | 2021-01-13T13:57:52.291354 | 2016-11-13T07:19:43 | 2016-11-13T07:19:43 | 72,909,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,919 | java | package com.yet.spring.core.util;
import javax.annotation.PostConstruct;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;
@Component
public class AwareBean implements ApplicationContextAware, BeanNameAware,
ApplicationEventPublisherAware {
private ApplicationEventPublisher eventPublisher;
private String name;
private ApplicationContext ctx;
@PostConstruct
public void init() {
System.out.println(this.getClass().getSimpleName() + " > My name is '"
+ name + "'");
if (ctx != null) {
System.out.println(this.getClass().getSimpleName()
+ " > My context is " + ctx.getClass().toString());
} else {
System.out.println(
this.getClass().getSimpleName() + " > Context is not set");
}
if (eventPublisher != null) {
System.out.println(
this.getClass().getSimpleName() + " > My eventPublisher is "
+ eventPublisher.getClass().toString());
} else {
System.out.println(this.getClass().getSimpleName()
+ " > EventPublisher is not set");
}
}
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher ep) {
this.eventPublisher = ep;
}
@Override
public void setBeanName(String name) {
this.name = name;
}
@Override
public void setApplicationContext(ApplicationContext context)
throws BeansException {
this.ctx = context;
}
}
| [
"sasha.martian@yandex.ru"
] | sasha.martian@yandex.ru |
e9667d600b17a53af3f8bcb7586f80d8a822427e | afae0b274335c3010c8b0b009e7913e46d0c6b08 | /src/br/com/safe9/entity/DadosCorporais.java | 5c7f1053b4e712333c1abc742bf27260e100b9ee | [] | no_license | FernandoAmaralG/Safe9 | f81ad176e4e8a42e493e9f9bfaffda2cb3136986 | 7f8556fcdb09bc6f32d04e8dcd558a888175c292 | refs/heads/master | 2020-03-15T22:15:14.939044 | 2018-05-07T02:12:52 | 2018-05-07T02:12:52 | 132,369,734 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,005 | java | package br.com.safe9.entity;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.*;
@Entity
public class DadosCorporais {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer IdDadosCorporais;
@NotNull(message = "Insira uma temperatura")
private Float temperatura;
@Temporal(TemporalType.TIMESTAMP)
@NotNull(message = "Insira uma data")
private Date dataDado;
@NotNull(message = "Insira o valor do inchaço")
private Float inchaco;
@NotNull(message = "Insira o batimento cardíaco")
private Byte batimentoCardiaco;
@NotNull(message = "Insira a pressão")
private Double pressao;
@OneToMany(mappedBy = "dadosCorporais")
private List<Paciente> pacientes;
public Integer getIdDadosCorporais() {
return IdDadosCorporais;
}
public void setIdDadosCorporais(Integer IdDadosCorporais) {
this.IdDadosCorporais = IdDadosCorporais;
}
public Float getTemperatura() {
return temperatura;
}
public void setTemperatura(Float temperatura) {
this.temperatura = temperatura;
}
public Date getDataDado() {
return dataDado;
}
public void setDataDado(Date dataDado) {
this.dataDado = dataDado;
}
public Float getInchaco() {
return inchaco;
}
public void setInchaco(Float inchaco) {
this.inchaco = inchaco;
}
public Byte getBatimentoCardiaco() {
return batimentoCardiaco;
}
public void setBatimentoCardiaco(Byte batimentoCardiaco) {
this.batimentoCardiaco = batimentoCardiaco;
}
public Double getPressao() {
return pressao;
}
public void setPressao(Double pressao) {
this.pressao = pressao;
}
public List<Paciente> getPacientes() {
return pacientes;
}
public void setPacientes(List<Paciente> pacientes) {
this.pacientes = pacientes;
}
}
| [
"fernandoamaral@unipam.edu.br"
] | fernandoamaral@unipam.edu.br |
1e021815a41d16f91cdd1e29da7768f82f651a0c | c7a6037350bbe1590833ee0decdd36b0c4951c4b | /look-zk/src/main/java/com/look/zk/barriers/TestDistributedDoubleBarrier.java | cc3245b375357ad11ce9d93c48c4591c0469b6cc | [] | no_license | chatwith/look | f6bac5b06bfccdb2c5c9bbb14b1828028a6b2023 | 88df5e1fd4aab7311081b76883984c805c36f5aa | refs/heads/master | 2021-01-10T13:32:42.060493 | 2017-06-25T16:04:55 | 2017-06-25T16:04:55 | 48,636,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,668 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.look.zk.barriers;
import com.google.common.collect.Lists;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.barriers.DistributedDoubleBarrier;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.io.Closeable;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
public class TestDistributedDoubleBarrier extends BaseClassForTests
{
private static final int QTY = 5;
@Test
public void testMultiClient() throws Exception
{
final Timing timing = new Timing();
final CountDownLatch postEnterLatch = new CountDownLatch(QTY);
final CountDownLatch postLeaveLatch = new CountDownLatch(QTY);
final AtomicInteger count = new AtomicInteger(0);
final AtomicInteger max = new AtomicInteger(0);
List<Future<Void>> futures = Lists.newArrayList();
ExecutorService service = Executors.newCachedThreadPool();
for ( int i = 0; i < QTY; ++i )
{
Future<Void> future = service.submit
(
new Callable<Void>()
{
@Override
public Void call() throws Exception
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
try
{
client.start();
DistributedDoubleBarrier barrier = new DistributedDoubleBarrier(client, "/barrier", QTY);
Assert.assertTrue(barrier.enter(timing.seconds(), TimeUnit.SECONDS));
synchronized(TestDistributedDoubleBarrier.this)
{
int thisCount = count.incrementAndGet();
if ( thisCount > max.get() )
{
max.set(thisCount);
}
}
postEnterLatch.countDown();
System.out.println("-1--"+count.get());
Assert.assertTrue(timing.awaitLatch(postEnterLatch));
System.out.println("-2--"+count.get());
Assert.assertEquals(count.get(), QTY);
Assert.assertTrue(barrier.leave(timing.seconds(), TimeUnit.SECONDS));
count.decrementAndGet();
System.out.println("-3--"+count.get());
postLeaveLatch.countDown();
Assert.assertTrue(timing.awaitLatch(postEnterLatch));
}
finally
{
CloseableUtils.closeQuietly(client);
}
return null;
}
}
);
futures.add(future);
}
for ( Future<Void> f : futures )
{
f.get();
}
Assert.assertEquals(count.get(), 0);
Assert.assertEquals(max.get(), QTY);
}
@Test
public void testOverSubscribed() throws Exception
{
final Timing timing = new Timing();
final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
ExecutorService service = Executors.newCachedThreadPool();
ExecutorCompletionService<Void> completionService = new ExecutorCompletionService<Void>(service);
try
{
client.start();
final Semaphore semaphore = new Semaphore(0);
final CountDownLatch latch = new CountDownLatch(1);
for ( int i = 0; i < (QTY + 1); ++i )
{
completionService.submit
(
new Callable<Void>()
{
@Override
public Void call() throws Exception
{
DistributedDoubleBarrier barrier = new DistributedDoubleBarrier(client, "/barrier", QTY)
{
@Override
protected List<String> getChildrenForEntering() throws Exception
{
System.out.println("--------ww-------");
semaphore.release();
Assert.assertTrue(timing.awaitLatch(latch));
System.out.println("--------ss-------");
return super.getChildrenForEntering();
}
};
Assert.assertTrue(barrier.enter(timing.seconds(), TimeUnit.SECONDS));
Assert.assertTrue(barrier.leave(timing.seconds(), TimeUnit.SECONDS));
return null;
}
}
);
}
Assert.assertTrue(semaphore.tryAcquire(QTY + 1, timing.seconds(), TimeUnit.SECONDS)); // wait until all QTY+1 barriers are trying to enter
latch.countDown();
for ( int i = 0; i < (QTY + 1); ++i )
{
completionService.take().get(); // to check for assertions
}
}
finally
{
service.shutdown();
CloseableUtils.closeQuietly(client);
}
}
@Test
public void testBasic() throws Exception
{
final Timing timing = new Timing();
final List<Closeable> closeables = Lists.newArrayList();
final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
try
{
closeables.add(client);
client.start();
final CountDownLatch postEnterLatch = new CountDownLatch(QTY);
final CountDownLatch postLeaveLatch = new CountDownLatch(QTY);
final AtomicInteger count = new AtomicInteger(0);
final AtomicInteger max = new AtomicInteger(0);
List<Future<Void>> futures = Lists.newArrayList();
ExecutorService service = Executors.newCachedThreadPool();
for ( int i = 0; i < QTY; ++i )
{
Future<Void> future = service.submit
(
new Callable<Void>()
{
@Override
public Void call() throws Exception
{
DistributedDoubleBarrier barrier = new DistributedDoubleBarrier(client, "/barrier", QTY);
Assert.assertTrue(barrier.enter(timing.seconds(), TimeUnit.SECONDS));
synchronized(TestDistributedDoubleBarrier.this)
{
int thisCount = count.incrementAndGet();
if ( thisCount > max.get() )
{
max.set(thisCount);
}
}
postEnterLatch.countDown();
Assert.assertTrue(timing.awaitLatch(postEnterLatch));
Assert.assertEquals(count.get(), QTY);
Assert.assertTrue(barrier.leave(10, TimeUnit.SECONDS));
count.decrementAndGet();
postLeaveLatch.countDown();
Assert.assertTrue(timing.awaitLatch(postLeaveLatch));
return null;
}
}
);
futures.add(future);
}
for ( Future<Void> f : futures )
{
f.get();
}
Assert.assertEquals(count.get(), 0);
Assert.assertEquals(max.get(), QTY);
}
finally
{
for ( Closeable c : closeables )
{
CloseableUtils.closeQuietly(c);
}
}
}
}
| [
"1721750058@qq.com"
] | 1721750058@qq.com |
8482d503040bd20d139b43aa041e8635a725cf06 | eab32a51c553811c26066c496a7ea89d1e8cb5af | /app/src/main/java/com/example/ctutorial/ProgrammeActivity.java | 43fabb4344566428bc6a9970153ecbaa33ce1741 | [] | no_license | shubham1811/SS | 9e1df410b04c3b8ad21fec91ee9977b458f56aca | 3f4b949ca2df7d8c16addf1302a5a41bd645d098 | refs/heads/master | 2020-04-28T00:14:05.980644 | 2019-03-10T10:29:59 | 2019-03-10T10:29:59 | 174,808,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,612 | java | package com.example.ctutorial;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class ProgrammeActivity extends AppCompatActivity implements View.OnClickListener {
Button b1,b2,b3,b4,b5,b6;
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_programme);
b1=findViewById(R.id.button1);
b2=findViewById(R.id.button2);
b3=findViewById(R.id.button3);
b4=findViewById(R.id.button4);
b5=findViewById(R.id.button5);
b6=findViewById(R.id.button6);
tv=findViewById(R.id.textView);
b1.setOnClickListener(this);
b2.setOnClickListener(this);
b3.setOnClickListener(this);
b4.setOnClickListener(this);
b5.setOnClickListener(this);
b6.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v==b1)
{
tv.setText("#include<stdio.h>\n" +
"int main()\n" +
"{\n" +
" int a,b,c;\n" +
" printf(\"Enter first number\\n\");\n" +
" scanf(\"%d\",&a);\n" +
" printf(\"Enter second number\\n\");\n" +
" scanf(\"%d\",&b);\n" +
" c=a+b;\n" +
" printf(\"Add=%d\",c);\n" +
" \t\n" +
"}");
}
if(v==b2)
{
tv.setText("#include<stdio.h>\n" +
"int main()\n" +
"{\n" +
"\tfloat p,c,m,h,e,avg;\n" +
"\tprintf(\"Enter marks in physics \\n\");\n" +
"\tscanf(\"%f\",&p);\n" +
"\tprintf(\"Enter marks in chemistry \\n\");\n" +
"\tscanf(\"%f\",&c);\n" +
"\tprintf(\"Enter marks in math \\n\");\n" +
"\tscanf(\"%f\",&m);\n" +
"\tprintf(\"Enter marks in hindi \\n\");\n" +
"\tscanf(\"%f\",&h);\n" +
"\tprintf(\"Enter marks in english \\n\");\n" +
"\tscanf(\"%f\",&e);\n" +
"\tavg=(p+c+m+h+e)/5;\n"
);
}
if(v==b3)
{
tv.setText("#include<stdio.h>\n" +
"void area(float radius)\n" +
"{\n" +
"\tfloat ar=3.14*radius*radius;\n" +
"\tprintf(\"Area of circle=%f\",ar);\n" +
"}\n" +
"int main()\n" +
"{\n" +
"float r;\n" +
"\tprintf(\"Enter radius of circle=\");\n" +
"\tscanf(\"%f\",&r);\n" +
" area(r);\n" +
"}");
}
if(v==b4)
{
tv.setText("#include<stdio.h>\n" +
"int main()\n" +
"{\n" +
" int area,side;\n" +
" printf(\"Enter side of square\\n\");\n" +
" scanf(\"%d\",&h);\n" +
" area=side*side;\n" +
" printf(\"Area of square=%d\",area); \t\n" +
"}");
}
if(v==b5)
{
tv.setText("#include<stdio.h>\n" +
"int main()\n" +
"{\n" +
" float a,b,c;\n" +
" printf(\"Enter first number\\n\");\n" +
" scanf(\"%f\",&a);\n" +
" printf(\"Enter second number\\n\");\n" +
" scanf(\"%f\",&b);\n" +
" c=a/b;\n" +
" printf(\"Div=%d\",c);\n" +
" \t\n" +
"}");
}
if(v==b6)
{
tv.setText("#include<stdio.h>\n" +
"int main()\n" +
"{\n" +
"\tfloat p,r,t,si;\n" +
"\tprintf(\"Enter principle\\n\");\n" +
"\tscanf(\"%f\",&p);\n" +
"\tprintf(\"Enter rate of interest \\n\");\n" +
"\tscanf(\"%f\",&r);\t\n" +
"\tprintf(\"Enter time \\n\");\n" +
"\tscanf(\"%f\",&t);\n" +
"\tsi=(p*r*t)/100;\n" +
"\tprintf(\"Simple Interest=%f\",si);\n" +
"}");
}
}
}
| [
"shubham.h.kumar123@gmail.com"
] | shubham.h.kumar123@gmail.com |
6b9e578c5a897f62a80c08acb0daee907b64da0a | bdc09f95d603cb1cc436760db167206a85254887 | /server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java | c07070ca33611f3c7ea390f3e680ccfb36fa69c9 | [
"MIT"
] | permissive | lanaflon/onedev | a2b0ee1fc72076da15cfd899eea73fe9730a6c8d | e1bf7afe7d32d38a3c8d085f1d20dfa2edb2f4c8 | refs/heads/main | 2023-07-05T14:00:54.227424 | 2021-08-07T05:03:58 | 2021-08-07T05:03:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 49,719 | java | package io.onedev.server.web.page.project.blob;
import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
import java.io.IOException;
import java.io.Serializable;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URIBuilder;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.upload.FileUpload;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.IRequestParameters;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.flow.RedirectToUrlException;
import org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.visit.IVisit;
import org.apache.wicket.util.visit.IVisitor;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
import io.onedev.commons.launcher.loader.ListenerRegistry;
import io.onedev.commons.utils.PlanarRange;
import io.onedev.server.OneDev;
import io.onedev.server.buildspec.BuildSpec;
import io.onedev.server.entitymanager.CodeCommentManager;
import io.onedev.server.entitymanager.ProjectManager;
import io.onedev.server.entitymanager.PullRequestManager;
import io.onedev.server.entitymanager.PullRequestUpdateManager;
import io.onedev.server.event.RefUpdated;
import io.onedev.server.git.BlobContent;
import io.onedev.server.git.BlobEdits;
import io.onedev.server.git.BlobIdent;
import io.onedev.server.git.GitUtils;
import io.onedev.server.git.exception.BlobEditException;
import io.onedev.server.git.exception.NotTreeException;
import io.onedev.server.git.exception.ObjectAlreadyExistsException;
import io.onedev.server.git.exception.ObsoleteCommitException;
import io.onedev.server.model.CodeComment;
import io.onedev.server.model.Project;
import io.onedev.server.model.PullRequest;
import io.onedev.server.model.User;
import io.onedev.server.persistence.SessionManager;
import io.onedev.server.persistence.TransactionManager;
import io.onedev.server.search.code.CommitIndexed;
import io.onedev.server.search.code.IndexManager;
import io.onedev.server.search.code.SearchManager;
import io.onedev.server.search.code.hit.QueryHit;
import io.onedev.server.search.code.query.BlobQuery;
import io.onedev.server.search.code.query.TextQuery;
import io.onedev.server.security.SecurityUtils;
import io.onedev.server.util.FilenameUtils;
import io.onedev.server.util.JobSecretAuthorizationContext;
import io.onedev.server.util.JobSecretAuthorizationContextAware;
import io.onedev.server.util.script.identity.JobIdentity;
import io.onedev.server.util.script.identity.ScriptIdentity;
import io.onedev.server.util.script.identity.ScriptIdentityAware;
import io.onedev.server.web.PrioritizedComponentRenderer;
import io.onedev.server.web.behavior.AbstractPostAjaxBehavior;
import io.onedev.server.web.behavior.WebSocketObserver;
import io.onedev.server.web.component.commit.status.CommitStatusPanel;
import io.onedev.server.web.component.floating.FloatingPanel;
import io.onedev.server.web.component.link.DropdownLink;
import io.onedev.server.web.component.link.ViewStateAwareAjaxLink;
import io.onedev.server.web.component.link.ViewStateAwarePageLink;
import io.onedev.server.web.component.menu.MenuItem;
import io.onedev.server.web.component.menu.MenuLink;
import io.onedev.server.web.component.modal.ModalLink;
import io.onedev.server.web.component.modal.ModalPanel;
import io.onedev.server.web.component.revisionpicker.RevisionPicker;
import io.onedev.server.web.page.project.ProjectPage;
import io.onedev.server.web.page.project.blob.navigator.BlobNavigator;
import io.onedev.server.web.page.project.blob.render.BlobRenderContext;
import io.onedev.server.web.page.project.blob.render.BlobRendererContribution;
import io.onedev.server.web.page.project.blob.render.renderers.source.SourceRendererProvider;
import io.onedev.server.web.page.project.blob.render.view.Positionable;
import io.onedev.server.web.page.project.blob.search.SearchMenuContributor;
import io.onedev.server.web.page.project.blob.search.advanced.AdvancedSearchPanel;
import io.onedev.server.web.page.project.blob.search.quick.QuickSearchPanel;
import io.onedev.server.web.page.project.blob.search.result.SearchResultPanel;
import io.onedev.server.web.page.project.commits.ProjectCommitsPage;
import io.onedev.server.web.resource.RawBlobResourceReference;
import io.onedev.server.web.util.EditParamsAware;
import io.onedev.server.web.websocket.WebSocketManager;
@SuppressWarnings("serial")
public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,
ScriptIdentityAware, EditParamsAware, JobSecretAuthorizationContextAware {
private static final String PARAM_REVISION = "revision";
private static final String PARAM_PATH = "path";
private static final String PARAM_INITIAL_NEW_PATH = "initial-new-path";
private static final String PARAM_REQUEST = "request";
private static final String PARAM_COMMENT = "comment";
private static final String PARAM_MODE = "mode";
private static final String PARAM_VIEW_PLAIN = "view-plain";
private static final String PARAM_URL_BEFORE_EDIT = "url-before-edit";
private static final String PARAM_URL_AFTER_EDIT = "url-after-edit";
private static final String PARAM_QUERY = "query";
private static final String PARAM_POSITION = "position";
private static final String PARAM_COVERAGE_REPORT = "coverage-report";
private static final String PARAM_PROBLEM_REPORT = "problem-report";
private static final String PARAM_RAW = "raw";
private static final String REVISION_PICKER_ID = "revisionPicker";
private static final String BLOB_NAVIGATOR_ID = "blobNavigator";
private static final String BLOB_CONTENT_ID = "blobContent";
private static final Logger logger = LoggerFactory.getLogger(ProjectBlobPage.class);
private State state = new State();
private ObjectId resolvedRevision;
private Component revisionIndexing;
private WebMarkupContainer searchResult;
private AbstractPostAjaxBehavior ajaxBehavior;
public ProjectBlobPage(PageParameters params) {
super(params);
List<String> revisionAndPathSegments = new ArrayList<>();
String segment = params.get(PARAM_REVISION).toString();
if (segment != null && segment.length() != 0)
revisionAndPathSegments.add(segment);
segment = params.get(PARAM_PATH).toString();
if (segment != null && segment.length() != 0)
revisionAndPathSegments.add(segment);
for (int i=0; i<params.getIndexedCount(); i++) {
segment = params.get(i).toString();
if (segment.length() != 0)
revisionAndPathSegments.add(segment);
}
BlobIdent blobIdent = new BlobIdent(getProject(), revisionAndPathSegments);
state = new State(blobIdent);
String modeStr = params.get(PARAM_MODE).toString();
if (modeStr != null)
state.mode = Mode.valueOf(modeStr.toUpperCase());
String viewPlain = params.get(PARAM_VIEW_PLAIN).toString();
state.viewPlain = "true".equals(viewPlain);
state.urlBeforeEdit = params.get(PARAM_URL_BEFORE_EDIT).toString();
state.urlAfterEdit = params.get(PARAM_URL_AFTER_EDIT).toString();
if (state.blobIdent.revision != null)
resolvedRevision = getProject().getRevCommit(state.blobIdent.revision, true).copy();
state.position = params.get(PARAM_POSITION).toString();
state.requestId = params.get(PARAM_REQUEST).toOptionalLong();
state.commentId = params.get(PARAM_COMMENT).toOptionalLong();
state.query = params.get(PARAM_QUERY).toString();
state.initialNewPath = params.get(PARAM_INITIAL_NEW_PATH).toString();
state.coverageReport = params.get(PARAM_COVERAGE_REPORT).toOptionalString();
state.problemReport = params.get(PARAM_PROBLEM_REPORT).toOptionalString();
if (state.mode == Mode.ADD || state.mode == Mode.EDIT || state.mode == Mode.DELETE) {
if (!isOnBranch())
throw new IllegalArgumentException("Files can only be edited on branch");
String path = state.blobIdent.path;
if (path != null && state.blobIdent.isTree())
path += "/";
if (!SecurityUtils.canModify(getProject(), state.blobIdent.revision, path))
unauthorized();
}
if (params.get(PARAM_RAW).toBoolean(false)) {
RequestCycle.get().scheduleRequestHandlerAfterCurrent(
new ResourceReferenceRequestHandler(new RawBlobResourceReference(), getPageParameters()));
}
}
@Override
protected void onInitialize() {
super.onInitialize();
newRevisionPicker(null);
newCommitStatus(null);
newBlobNavigator(null);
newBlobOperations(null);
add(revisionIndexing = new WebMarkupContainer("revisionIndexing") {
@Override
protected void onConfigure() {
super.onConfigure();
if (resolvedRevision != null) {
RevCommit commit = getProject().getRevCommit(resolvedRevision, true);
IndexManager indexManager = OneDev.getInstance(IndexManager.class);
if (!indexManager.isIndexed(getProject(), commit)) {
OneDev.getInstance(IndexManager.class).indexAsync(getProject(), commit);
setVisible(true);
} else {
setVisible(false);
}
} else {
setVisible(false);
}
}
}.setOutputMarkupPlaceholderTag(true));
revisionIndexing.add(new WebSocketObserver() {
@Override
public void onObservableChanged(IPartialPageRequestHandler handler) {
handler.add(revisionIndexing);
resizeWindow(handler);
}
@Override
public Collection<String> getObservables() {
Set<String> observables = new HashSet<>();
if (resolvedRevision != null)
observables.add(CommitIndexed.getWebSocketObservable(getProject().getRevCommit(resolvedRevision, true).name()));
return observables;
}
});
newBuildSupportNote(null);
newBlobContent(null);
add(searchResult = new WebMarkupContainer("searchResult"));
List<QueryHit> queryHits;
if (state.query != null) {
BlobQuery query = new TextQuery.Builder()
.term(state.query)
.wholeWord(true)
.caseSensitive(true)
.count(SearchResultPanel.MAX_QUERY_ENTRIES)
.build();
try {
SearchManager searchManager = OneDev.getInstance(SearchManager.class);
queryHits = searchManager.search(projectModel.getObject(), getProject().getRevCommit(resolvedRevision, true),
query);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
} else {
queryHits = null;
}
newSearchResult(null, queryHits);
add(ajaxBehavior = new AbstractPostAjaxBehavior() {
@Override
protected void respond(AjaxRequestTarget target) {
IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
String action = params.getParameterValue("action").toString("");
switch (action) {
case "quickSearch":
new ModalPanel(target) {
@Override
protected Component newContent(String id) {
return newQuickSearchPanel(id, this);
}
};
break;
case "advancedSearch":
new ModalPanel(target) {
@Override
protected Component newContent(String id) {
return newAdvancedSearchPanel(id, this);
}
};
break;
case "permalink":
if (isOnBranch()) {
BlobIdent newBlobIdent = new BlobIdent(state.blobIdent);
newBlobIdent.revision = resolvedRevision.name();
ProjectBlobPage.this.onSelect(target, newBlobIdent, null);
}
break;
default:
throw new IllegalStateException("Unexpected action: " + action);
}
}
});
}
/*
* In case we are on a branch, this operation makes sure that the branch resolves
* to a certain commit during the life cycle of our page, unless the page is
* refreshed. This can avoid the issue that displayed file content and subsequent
* operations encounters different commit if someone commits to the branch while
* we are staying on the page.
*/
@Override
protected Map<String, ObjectId> getObjectIdCache() {
Map<String, ObjectId> objectIdCache = new HashMap<>();
if (resolvedRevision != null)
objectIdCache.put(state.blobIdent.revision, resolvedRevision);
return objectIdCache;
}
@Override
public CodeComment getOpenComment() {
if (state.commentId != null)
return OneDev.getInstance(CodeCommentManager.class).load(state.commentId);
else
return null;
}
@Override
public PullRequest getPullRequest() {
if (state.requestId != null)
return OneDev.getInstance(PullRequestManager.class).load(state.requestId);
else
return null;
}
private void newBlobNavigator(@Nullable AjaxRequestTarget target) {
Component blobNavigator = new BlobNavigator(BLOB_NAVIGATOR_ID, this);
if (target != null) {
replace(blobNavigator);
target.add(blobNavigator);
} else {
add(blobNavigator);
}
}
private void newBlobOperations(@Nullable AjaxRequestTarget target) {
WebMarkupContainer blobOperations = new WebMarkupContainer("blobOperations");
blobOperations.setOutputMarkupId(true);
String revision = state.blobIdent.revision;
AtomicBoolean reviewRequired = new AtomicBoolean(true);
try {
reviewRequired.set(revision!=null && getProject().isReviewRequiredForModification(getLoginUser(), revision, null));
} catch (Exception e) {
logger.error("Error checking review requirement", e);
}
AtomicBoolean buildRequired = new AtomicBoolean(true);
try {
buildRequired.set(revision!=null && getProject().isBuildRequiredForModification(getLoginUser(), revision, null));
} catch (Exception e) {
logger.error("Error checking build requirement", e);
}
blobOperations.add(new MenuLink("add") {
@Override
protected List<MenuItem> getMenuItems(FloatingPanel dropdown) {
List<MenuItem> menuItems = new ArrayList<>();
menuItems.add(new MenuItem() {
@Override
public String getLabel() {
return "Create New File";
}
@Override
public WebMarkupContainer newLink(String id) {
return new ViewStateAwareAjaxLink<Void>(id) {
@Override
public void onClick(AjaxRequestTarget target) {
onModeChange(target, Mode.ADD, null);
dropdown.close();
}
};
}
});
menuItems.add(new MenuItem() {
@Override
public String getLabel() {
return "Upload Files";
}
@Override
public WebMarkupContainer newLink(String id) {
return new ModalLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
super.onClick(target);
dropdown.close();
}
@Override
protected Component newContent(String id, ModalPanel modal) {
return new BlobUploadPanel(id, ProjectBlobPage.this) {
@Override
public void onCancel(AjaxRequestTarget target) {
modal.close();
}
@Override
public void onCommitted(AjaxRequestTarget target, RefUpdated refUpdated) {
ProjectBlobPage.this.onCommitted(target, refUpdated);
modal.close();
}
};
}
};
}
});
return menuItems;
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (reviewRequired.get()) {
tag.append("class", "disabled", " ");
tag.put("title", "Review required for this change. Submit pull request instead");
} else if (buildRequired.get()) {
tag.append("class", "disabled", " ");
tag.put("title", "Build required for this change. Submit pull request instead");
} else {
tag.put("title", "Add on branch " + state.blobIdent.revision);
}
}
@Override
protected void onConfigure() {
super.onConfigure();
Project project = getProject();
if ((state.mode == Mode.VIEW || state.mode == Mode.BLAME)
&& isOnBranch() && state.blobIdent.isTree()
&& SecurityUtils.canWriteCode(project)) {
setVisible(true);
setEnabled(!reviewRequired.get() && !buildRequired.get());
} else {
setVisible(false);
}
}
});
blobOperations.add(new MenuLink("search") {
@Override
protected List<MenuItem> getMenuItems(FloatingPanel dropdown) {
List<MenuItem> menuItems = new ArrayList<>();
menuItems.add(new MenuItem() {
@Override
public String getShortcut() {
return "T";
}
@Override
public String getLabel() {
return "Quick Search";
}
@Override
public WebMarkupContainer newLink(String id) {
return new ModalLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
super.onClick(target);
dropdown.close();
}
@Override
protected Component newContent(String id, ModalPanel modal) {
return newQuickSearchPanel(id, modal);
}
};
}
});
menuItems.add(new MenuItem() {
@Override
public String getShortcut() {
return "V";
}
@Override
public String getLabel() {
return "Advanced Search";
}
@Override
public WebMarkupContainer newLink(String id) {
return new ModalLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
super.onClick(target);
dropdown.close();
}
@Override
protected Component newContent(String id, ModalPanel modal) {
return newAdvancedSearchPanel(id, modal);
}
};
}
});
IVisitor<Component, Component> visitor = new IVisitor<Component, Component>() {
@Override
public void component(Component object, IVisit<Component> visit) {
visit.stop(object);
}
};
SearchMenuContributor contributor = (SearchMenuContributor) getPage().visitChildren(
SearchMenuContributor.class, visitor);
if (contributor != null)
menuItems.addAll(contributor.getMenuItems(dropdown));
return menuItems;
}
});
String compareWith = resolvedRevision!=null?resolvedRevision.name():null;
String query;
if (state.blobIdent.path != null)
query = String.format("path(%s)", state.blobIdent.path);
else
query = null;
blobOperations.add(new ViewStateAwarePageLink<Void>("history", ProjectCommitsPage.class,
ProjectCommitsPage.paramsOf(getProject(), query, compareWith)));
blobOperations.add(new DropdownLink("getCode") {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(state.blobIdent.revision != null && state.blobIdent.path == null);
}
@Override
protected void onInitialize(FloatingPanel dropdown) {
super.onInitialize(dropdown);
dropdown.add(AttributeAppender.append("class", "get-code"));
}
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
return new GetCodePanel(id, this) {
@Override
protected Project getProject() {
return ProjectBlobPage.this.getProject();
}
@Override
protected String getRevision() {
return state.blobIdent.revision;
}
};
}
});
if (target != null) {
replace(blobOperations);
target.add(blobOperations);
} else {
add(blobOperations);
}
}
private QuickSearchPanel newQuickSearchPanel(String id, ModalPanel modal) {
return new QuickSearchPanel(id, projectModel, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return state.blobIdent.revision;
}
}) {
@Override
protected void onSelect(AjaxRequestTarget target, QueryHit hit) {
BlobIdent selected = new BlobIdent(state.blobIdent.revision, hit.getBlobPath(),
FileMode.REGULAR_FILE.getBits());
ProjectBlobPage.this.onSelect(target, selected, SourceRendererProvider.getPosition(hit.getTokenPos()));
modal.close();
}
@Override
protected void onMoreQueried(AjaxRequestTarget target, List<QueryHit> hits) {
newSearchResult(target, hits);
resizeWindow(target);
modal.close();
}
@Override
protected void onCancel(AjaxRequestTarget target) {
modal.close();
}
};
}
private AdvancedSearchPanel advancedSearchPanel;
private ModalPanel advancedSearchPanelModal;
private AdvancedSearchPanel newAdvancedSearchPanel(String id, ModalPanel modal) {
/*
* Re-use advanced search panel instance so that search options can be preserved in the page
*/
advancedSearchPanelModal = modal;
if (advancedSearchPanel == null) {
advancedSearchPanel = new AdvancedSearchPanel(id, projectModel, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return state.blobIdent.revision;
}
}) {
@Override
protected void onSearchComplete(AjaxRequestTarget target, List<QueryHit> hits) {
newSearchResult(target, hits);
resizeWindow(target);
advancedSearchPanelModal.close();
}
@Override
protected void onCancel(AjaxRequestTarget target) {
advancedSearchPanelModal.close();
}
@Override
protected BlobIdent getCurrentBlob() {
return state.blobIdent;
}
};
}
return advancedSearchPanel;
}
private void newBlobContent(@Nullable AjaxRequestTarget target) {
PrioritizedComponentRenderer mostPrioritizedRenderer = null;
for (BlobRendererContribution contribution: OneDev.getExtensions(BlobRendererContribution.class)) {
PrioritizedComponentRenderer renderer = contribution.getRenderer(this);
if (renderer != null) {
if (mostPrioritizedRenderer == null || mostPrioritizedRenderer.getPriority() > renderer.getPriority())
mostPrioritizedRenderer = renderer;
}
}
Component blobContent = Preconditions.checkNotNull(mostPrioritizedRenderer).render(BLOB_CONTENT_ID);
if (target != null) {
replace(blobContent);
target.add(blobContent);
} else {
add(blobContent);
}
}
private void pushState(AjaxRequestTarget target) {
PageParameters params = paramsOf(getProject(), state);
CharSequence url = RequestCycle.get().urlFor(ProjectBlobPage.class, params);
pushState(target, url.toString(), state);
}
private void replaceState(AjaxRequestTarget target) {
PageParameters params = paramsOf(getProject(), state);
CharSequence url = RequestCycle.get().urlFor(ProjectBlobPage.class, params);
replaceState(target, url.toString(), state);
}
private void newCommitStatus(@Nullable AjaxRequestTarget target) {
Component commitStatus;
if (resolvedRevision != null) {
commitStatus = new CommitStatusPanel("buildStatus", resolvedRevision, getRefName()) {
@Override
protected Project getProject() {
return ProjectBlobPage.this.getProject();
}
@Override
protected PullRequest getPullRequest() {
return null;
}
};
} else {
commitStatus = new WebMarkupContainer("buildStatus").add(AttributeAppender.append("class", "d-none"));
}
commitStatus.setOutputMarkupPlaceholderTag(true);
if (target != null) {
replace(commitStatus);
target.add(commitStatus);
} else {
add(commitStatus);
}
}
private void newBuildSupportNote(@Nullable AjaxRequestTarget target) {
Component buildSupportNote = new WebMarkupContainer("buildSupportNote") {
@Override
protected void onInitialize() {
super.onInitialize();
String branch = state.blobIdent.revision;
if (branch == null)
branch = "master";
if (SecurityUtils.canModify(getProject(), branch, BuildSpec.BLOB_PATH)) {
add(new ViewStateAwareAjaxLink<Void>("addFile") {
@Override
public void onClick(AjaxRequestTarget target) {
onModeChange(target, Mode.ADD, BuildSpec.BLOB_PATH);
}
@Override
public IModel<?> getBody() {
return Model.of("adding " + BuildSpec.BLOB_PATH);
}
});
} else {
add(new Label("addFile", "adding " + BuildSpec.BLOB_PATH) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.setName("span");
}
});
}
setOutputMarkupPlaceholderTag(true);
}
@Override
protected void onConfigure() {
super.onConfigure();
if (resolvedRevision != null && isOnBranch() && state.blobIdent.path == null && state.mode == Mode.VIEW) {
BlobIdent oldBlobIdent = new BlobIdent(resolvedRevision.name(), ".onedev-buildspec", FileMode.TYPE_FILE);
BlobIdent blobIdent = new BlobIdent(resolvedRevision.name(), BuildSpec.BLOB_PATH, FileMode.TYPE_FILE);
setVisible(getProject().getBlob(blobIdent, false) == null && getProject().getBlob(oldBlobIdent, false) == null);
} else {
setVisible(false);
}
}
};
if (target != null) {
replace(buildSupportNote);
target.add(buildSupportNote);
} else {
add(buildSupportNote);
}
}
private void newRevisionPicker(@Nullable AjaxRequestTarget target) {
String revision = state.blobIdent.revision;
boolean canCreateRef;
if (revision == null) {
revision = "master";
canCreateRef = false;
} else {
canCreateRef = true;
}
Component revisionPicker = new RevisionPicker(REVISION_PICKER_ID, projectModel, revision, canCreateRef) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (isOnBranch())
tag.put("title", "Press 'y' to get permalink");
}
@Override
protected String getRevisionUrl(String revision) {
BlobIdent blobIdent = new BlobIdent(revision, null, FileMode.TREE.getBits());
State state = new State(blobIdent);
PageParameters params = ProjectBlobPage.paramsOf(projectModel.getObject(), state);
return urlFor(ProjectBlobPage.class, params).toString();
}
@Override
protected void onSelect(AjaxRequestTarget target, String revision) {
BlobIdent newBlobIdent = new BlobIdent(state.blobIdent);
newBlobIdent.revision = revision;
if (newBlobIdent.path != null) {
try (RevWalk revWalk = new RevWalk(getProject().getRepository())) {
RevTree revTree = getProject().getRevCommit(revision, true).getTree();
TreeWalk treeWalk = TreeWalk.forPath(getProject().getRepository(), newBlobIdent.path, revTree);
if (treeWalk != null) {
newBlobIdent.mode = treeWalk.getRawMode(0);
} else {
newBlobIdent.path = null;
newBlobIdent.mode = FileMode.TREE.getBits();
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
ProjectBlobPage.this.onSelect(target, newBlobIdent, null);
}
};
if (target != null) {
replace(revisionPicker);
target.add(revisionPicker);
} else {
add(revisionPicker);
}
}
/*
* This method represents changing of resolved revision, instead of the named revision.
* It is possible that resolved revision changes while named revision remains unchanged.
* For instance when a file on a branch is edited from this page, the named revision
* remains unchanged (still point to the branch), but the underlying resolved revision
* (the commit) has been changed
*
* @param target
*/
private void onResolvedRevisionChange(AjaxRequestTarget target) {
/*
* A hack to reset resolved revision to null to disable getObjectIdCache()
* temporarily as otherwise getObjectId() method below will always
* resolved to existing value of resolvedRevision
*/
resolvedRevision = null;
resolvedRevision = getProject().getRevCommit(state.blobIdent.revision, true).copy();
OneDev.getInstance(WebSocketManager.class).observe(this);
newRevisionPicker(target);
newCommitStatus(target);
target.add(revisionIndexing);
newBlobNavigator(target);
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
}
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new ProjectBlobResourceReference()));
String callback = ajaxBehavior.getCallbackFunction(explicit("action")).toString();
String script = String.format("onedev.server.projectBlob.onDomReady(%s);", callback);
response.render(OnDomReadyHeaderItem.forScript(script));
}
public static State getState(CodeComment comment) {
BlobIdent blobIdent = new BlobIdent(comment.getMark().getCommitHash(), comment.getMark().getPath(),
FileMode.REGULAR_FILE.getBits());
State state = new State(blobIdent);
state.commentId = comment.getId();
state.position = SourceRendererProvider.getPosition(comment.getMark().getRange());
return state;
}
public static PageParameters paramsOf(CodeComment comment) {
return paramsOf(comment.getProject(), getState(comment));
}
public static PageParameters paramsOf(Project project, BlobIdent blobIdent) {
return paramsOf(project, new State(blobIdent));
}
public static void fillParams(PageParameters params, State state) {
if (state.blobIdent.revision != null)
params.add(PARAM_REVISION, state.blobIdent.revision);
if (state.blobIdent.path != null)
params.add(PARAM_PATH, state.blobIdent.path);
if (state.position != null)
params.add(PARAM_POSITION, state.position.toString());
if (state.requestId != null)
params.add(PARAM_REQUEST, state.requestId);
if (state.commentId != null)
params.add(PARAM_COMMENT, state.commentId);
if (state.mode != Mode.VIEW)
params.add(PARAM_MODE, state.mode.name().toLowerCase());
if (state.mode == Mode.VIEW && state.viewPlain)
params.add(PARAM_VIEW_PLAIN, true);
if (state.urlBeforeEdit != null)
params.add(PARAM_URL_BEFORE_EDIT, state.urlBeforeEdit);
if (state.urlAfterEdit != null)
params.add(PARAM_URL_AFTER_EDIT, state.urlAfterEdit);
if (state.coverageReport != null)
params.add(PARAM_COVERAGE_REPORT, state.coverageReport);
if (state.problemReport != null)
params.add(PARAM_PROBLEM_REPORT, state.problemReport);
if (state.query != null)
params.add(PARAM_QUERY, state.query);
if (state.initialNewPath != null)
params.add(PARAM_INITIAL_NEW_PATH, state.initialNewPath);
}
public static PageParameters paramsOf(Project project, State state) {
PageParameters params = paramsOf(project);
fillParams(params, state);
return params;
}
private void newSearchResult(@Nullable AjaxRequestTarget target, @Nullable List<QueryHit> hits) {
Component content;
if (hits != null) {
content = new SearchResultPanel("content", this, hits) {
@Override
protected void onClose(AjaxRequestTarget target) {
newSearchResult(target, null);
resizeWindow(target);
}
};
if (target != null) {
target.appendJavaScript(""
+ "$('.project-blob>.search-result').css('display', 'flex'); "
+ "$('.project-blob .search-result>.body').focus();");
}
} else {
content = new WebMarkupContainer("content").setOutputMarkupId(true);
if (target != null)
target.appendJavaScript("$('.project-blob>.search-result').hide();");
else
searchResult.add(AttributeAppender.replace("style", "display: none;"));
}
if (target != null) {
searchResult.replace(content);
target.add(content);
} else {
searchResult.add(content);
}
}
@Override
protected void onPopState(AjaxRequestTarget target, Serializable data) {
super.onPopState(target, data);
State popState = (State) data;
if (popState.blobIdent.revision != null
&& !popState.blobIdent.revision.equals(state.blobIdent.revision)) {
state = popState;
newSearchResult(target, null);
onResolvedRevisionChange(target);
} else {
state = popState;
newBlobNavigator(target);
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
}
}
@Override
public BlobIdent getBlobIdent() {
return state.blobIdent;
}
@Override
public String getPosition() {
return state.position;
}
@Override
public void onPosition(AjaxRequestTarget target, String position) {
state.position = position;
pushState(target);
}
@Override
public String getPositionUrl(String position) {
State positionState = SerializationUtils.clone(state);
positionState.blobIdent.revision = resolvedRevision.name();
positionState.commentId = null;
positionState.position = position;
PageParameters params = paramsOf(getProject(), positionState);
return RequestCycle.get().urlFor(ProjectBlobPage.class, params).toString();
}
@Override
public Mode getMode() {
return state.mode;
}
@Override
public boolean isViewPlain() {
return state.viewPlain;
}
@Override
public String getUrlBeforeEdit() {
return state.urlBeforeEdit;
}
@Override
public String getUrlAfterEdit() {
return state.urlAfterEdit;
}
@Override
public PageParameters getParamsBeforeEdit() {
return paramsOf(getProject(), state);
}
@Override
public PageParameters getParamsAfterEdit() {
return paramsOf(getProject(), state);
}
@Override
public void onSelect(AjaxRequestTarget target, BlobIdent blobIdent, @Nullable String position) {
String prevPosition = state.position;
state.position = position;
if (!blobIdent.revision.equals(state.blobIdent.revision)) {
state.blobIdent = blobIdent;
state.mode = Mode.VIEW;
state.commentId = null;
state.requestId = null;
newSearchResult(target, null);
onResolvedRevisionChange(target);
resizeWindow(target);
} else if (!Objects.equal(state.blobIdent.path, blobIdent.path)) {
state.blobIdent.path = blobIdent.path;
state.blobIdent.mode = blobIdent.mode;
state.mode = Mode.VIEW;
state.commentId = null;
newBlobNavigator(target);
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
OneDev.getInstance(WebSocketManager.class).observe(this);
} else if (state.position != null) {
if (get(BLOB_CONTENT_ID) instanceof Positionable) {
// This logic is added for performance reason, we do not want to
// reload the file if go to different mark positions in same file
((Positionable)get(BLOB_CONTENT_ID)).position(target, state.position);
} else {
state.mode = Mode.VIEW;
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
}
} else if (prevPosition != null) {
state.mode = Mode.VIEW;
newBlobOperations(target);
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
}
pushState(target);
}
@Override
public void pushState(AjaxRequestTarget target, BlobIdent blobIdent, @Nullable String position) {
state.blobIdent = blobIdent;
state.position = position;
pushState(target);
}
@Override
public void replaceState(AjaxRequestTarget target, BlobIdent blobIdent, @Nullable String position) {
state.blobIdent = blobIdent;
state.position = position;
replaceState(target);
}
@Override
public void onSearchComplete(AjaxRequestTarget target, List<QueryHit> hits) {
newSearchResult(target, hits);
resizeWindow(target);
}
@Override
public void onCommentOpened(AjaxRequestTarget target, CodeComment comment, PlanarRange range) {
state.commentId = comment.getId();
state.position = SourceRendererProvider.getPosition(range);
pushState(target);
}
@Override
public void onCommentClosed(AjaxRequestTarget target) {
state.commentId = null;
state.position = null;
pushState(target);
}
@Override
public void onAddComment(AjaxRequestTarget target, PlanarRange range) {
state.commentId = null;
state.position = SourceRendererProvider.getPosition(range);
pushState(target);
}
@Override
public boolean isOnBranch() {
return state.blobIdent.revision == null || getProject().getBranchRef(state.blobIdent.revision) != null;
}
@Override
public String getRefName() {
if (state.blobIdent.revision != null)
return getProject().getRefName(state.blobIdent.revision);
else
return null;
}
@Override
public RevCommit getCommit() {
if (resolvedRevision != null)
return getProject().getRevCommit(resolvedRevision, true);
else
return null;
}
public static class State implements Serializable {
private static final long serialVersionUID = 1L;
public BlobIdent blobIdent;
public Long requestId;
public Long commentId;
public String position;
public Mode mode = Mode.VIEW;
/*
* Some blob can be rendered in a way for easier understanding, such as .onedev-buildspec.yml,
* In these cases, the VIEW_PLAIN mode enables to view plain text of the blob. Applicable
* only when mode is VIEW
*/
public boolean viewPlain;
public String coverageReport;
public String problemReport;
public String urlBeforeEdit;
public String urlAfterEdit;
public boolean renderSource;
public String query;
public String initialNewPath;
public State(BlobIdent blobIdent) {
this.blobIdent = blobIdent;
}
public State() {
blobIdent = new BlobIdent();
}
}
@Override
public void onModeChange(AjaxRequestTarget target, Mode mode, @Nullable String newPath) {
onModeChange(target, mode, false, newPath);
}
@Override
public void onModeChange(AjaxRequestTarget target, Mode mode, boolean viewPlain, @Nullable String newPath) {
state.viewPlain = viewPlain;
state.initialNewPath = newPath;
/*
* User might be changing blob name when adding a file, and onModeChange will be called.
* In this case, we only need to re-create blob content
*/
if (mode != Mode.ADD || state.mode != Mode.ADD) {
state.mode = mode;
pushState(target);
if (state.mode == Mode.VIEW || state.mode == Mode.EDIT || state.mode == Mode.ADD) {
newBlobNavigator(target);
newBlobOperations(target);
}
}
newBuildSupportNote(target);
newBlobContent(target);
resizeWindow(target);
}
@Override
public void onCommitted(@Nullable AjaxRequestTarget target, RefUpdated refUpdated) {
Project project = getProject();
if (state.blobIdent.revision == null) {
state.blobIdent.revision = "master";
resolvedRevision = refUpdated.getNewCommitId();
project.setDefaultBranch("master");
}
String branch = state.blobIdent.revision;
getProject().cacheObjectId(branch, refUpdated.getNewCommitId());
Long projectId = project.getId();
String refName = refUpdated.getRefName();
ObjectId oldCommitId = refUpdated.getOldCommitId();
ObjectId newCommitId = refUpdated.getNewCommitId();
/*
* Update pull request as this is a direct consequence of editing source branch. Also this
* is necessary to show the latest changes of the pull request after editing
*/
PullRequest request = getPullRequest();
if (request != null)
OneDev.getInstance(PullRequestUpdateManager.class).checkUpdate(request);
OneDev.getInstance(TransactionManager.class).runAfterCommit(new Runnable() {
@Override
public void run() {
OneDev.getInstance(SessionManager.class).runAsync(new Runnable() {
@Override
public void run() {
Project project = OneDev.getInstance(ProjectManager.class).load(projectId);
project.cacheObjectId(branch, newCommitId);
RefUpdated refUpdated = new RefUpdated(project, refName, oldCommitId, newCommitId);
OneDev.getInstance(ListenerRegistry.class).post(refUpdated);
}
});
}
});
if (target != null) {
if (state.urlAfterEdit != null) {
throw new RedirectToUrlException(state.urlAfterEdit);
} else {
BlobIdent newBlobIdent;
if (state.mode == Mode.DELETE) {
try (RevWalk revWalk = new RevWalk(getProject().getRepository())) {
RevTree revTree = getProject().getRevCommit(refUpdated.getNewCommitId(), true).getTree();
String parentPath = StringUtils.substringBeforeLast(state.blobIdent.path, "/");
while (TreeWalk.forPath(getProject().getRepository(), parentPath, revTree) == null) {
if (parentPath.contains("/")) {
parentPath = StringUtils.substringBeforeLast(parentPath, "/");
} else {
parentPath = null;
break;
}
}
newBlobIdent = new BlobIdent(branch, parentPath, FileMode.TREE.getBits());
} catch (IOException e) {
throw new RuntimeException(e);
}
} else if (state.mode == Mode.ADD) {
newBlobIdent = new BlobIdent(branch, getNewPath(), FileMode.REGULAR_FILE.getBits());
} else if (state.mode == Mode.EDIT) {
newBlobIdent = new BlobIdent(branch, getNewPath(), FileMode.REGULAR_FILE.getBits());
} else {
// We've uploaded some files
newBlobIdent = null;
}
if (newBlobIdent != null) {
state.blobIdent = newBlobIdent;
state.commentId = null;
state.mode = Mode.VIEW;
onResolvedRevisionChange(target);
pushState(target);
} else {
state.mode = Mode.VIEW;
onResolvedRevisionChange(target);
}
// fix the issue that sometimes indexing indicator of new commit does not disappear
target.appendJavaScript("Wicket.WebSocket.send('RenderCallback');");
}
}
}
@Override
public String getInitialNewPath() {
return state.initialNewPath;
}
@Override
public String getDirectory() {
String path;
if (state.mode == Mode.ADD || state.mode == Mode.EDIT) {
path = getNewPath();
if (path != null) {
if (path.contains("/"))
path = StringUtils.substringBeforeLast(path, "/");
else
path = null;
} else {
throw new IllegalStateException();
}
} else if (state.blobIdent.isTree()) {
path = state.blobIdent.path;
} else if (state.blobIdent.path.contains("/")) {
path = StringUtils.substringBeforeLast(state.blobIdent.path, "/");
} else {
path = null;
}
return path;
}
@Override
public String getDirectoryUrl() {
String revision = state.blobIdent.revision;
BlobIdent blobIdent = new BlobIdent(revision, getDirectory(), FileMode.TREE.getBits());
ProjectBlobPage.State state = new ProjectBlobPage.State(blobIdent);
return urlFor(ProjectBlobPage.class, ProjectBlobPage.paramsOf(getProject(), state)).toString();
}
@Override
public String getRootDirectoryUrl() {
BlobIdent blobIdent = new BlobIdent(state.blobIdent.revision, null, FileMode.TREE.getBits());
return RequestCycle.get().urlFor(ProjectBlobPage.class,
ProjectBlobPage.paramsOf(getProject(), blobIdent)).toString();
}
@Override
public String getNewPath() {
BlobNavigator blobNavigator = (BlobNavigator) get(BLOB_NAVIGATOR_ID);
return blobNavigator.getNewPath();
}
@Override
public void onEvent(IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof RevisionResolved) {
RevisionResolved revisionResolveEvent = (RevisionResolved) event.getPayload();
resolvedRevision = revisionResolveEvent.getResolvedRevision();
}
}
@Override
public String getCoverageReport() {
return state.coverageReport;
}
@Override
public String getProblemReport() {
return state.problemReport;
}
@Override
public String getAutosaveKey() {
if (state.mode == Mode.ADD) {
return String.format("autosave:addBlob:%d:%s:%s",
getProject().getId(), state.blobIdent.revision, getNewPath());
} else if (state.mode == Mode.EDIT) {
return String.format("autosave:editBlob:%d:%s:%s:%s",
getProject().getId(), state.blobIdent.revision,
state.blobIdent.path, getProject().getBlob(state.blobIdent, true).getBlobId());
} else {
throw new IllegalStateException();
}
}
@Override
public RefUpdated uploadFiles(Collection<FileUpload> uploads, String directory, String commitMessage) {
Map<String, BlobContent> newBlobs = new HashMap<>();
String parentPath = getDirectory();
if (directory != null) {
if (parentPath != null)
parentPath += "/" + directory;
else
parentPath = directory;
}
User user = Preconditions.checkNotNull(SecurityUtils.getUser());
BlobIdent blobIdent = getBlobIdent();
for (FileUpload upload: uploads) {
String blobPath = FilenameUtils.sanitizeFilename(upload.getClientFileName());
if (parentPath != null)
blobPath = parentPath + "/" + blobPath;
if (getProject().isReviewRequiredForModification(user, blobIdent.revision, blobPath))
throw new BlobEditException("Review required for this change. Please submit pull request instead");
else if (getProject().isBuildRequiredForModification(user, blobIdent.revision, blobPath))
throw new BlobEditException("Build required for this change. Please submit pull request instead");
BlobContent blobContent = new BlobContent.Immutable(upload.getBytes(), FileMode.REGULAR_FILE);
newBlobs.put(blobPath, blobContent);
}
BlobEdits blobEdits = new BlobEdits(Sets.newHashSet(), newBlobs);
String refName = blobIdent.revision!=null?GitUtils.branch2ref(blobIdent.revision):"refs/heads/master";
ObjectId prevCommitId;
if (blobIdent.revision != null)
prevCommitId = getProject().getRevCommit(blobIdent.revision, true).copy();
else
prevCommitId = ObjectId.zeroId();
while (true) {
try {
ObjectId newCommitId = blobEdits.commit(getProject().getRepository(), refName, prevCommitId,
prevCommitId, user.asPerson(), commitMessage);
return new RefUpdated(getProject(), refName, prevCommitId, newCommitId);
} catch (ObjectAlreadyExistsException|NotTreeException e) {
throw new BlobEditException(e.getMessage());
} catch (ObsoleteCommitException e) {
prevCommitId = e.getOldCommitId();
}
}
}
@Override
protected boolean isPermitted() {
return SecurityUtils.canReadCode(getProject());
}
@Override
public String appendRaw(String url) {
try {
URIBuilder builder;
builder = new URIBuilder(url);
for (NameValuePair pair: builder.getQueryParams()) {
if (pair.getName().equals(PARAM_RAW))
return url;
}
return builder.addParameter(PARAM_RAW, "true").build().toString();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
@Override
protected String getPageTitle() {
if (state.blobIdent.revision == null)
return getProject().getName();
else if (state.blobIdent.path == null)
return state.blobIdent.revision + " - " + getProject().getName();
else if (state.blobIdent.isFile())
return state.blobIdent.getName() + " at " + state.blobIdent.revision + " - " + getProject().getName();
else
return state.blobIdent.path + " at " + state.blobIdent.revision + " - " + getProject().getName();
}
@Override
public ScriptIdentity getScriptIdentity() {
if (getBlobIdent().revision != null)
return new JobIdentity(getProject(), getCommit().copy());
else // when we add file to an empty project
return new JobIdentity(getProject(), null);
}
@Override
protected Component newProjectTitle(String componentId) {
return new Label(componentId, "Files");
}
@Override
public JobSecretAuthorizationContext getJobSecretAuthorizationContext() {
return new JobSecretAuthorizationContext(getProject(), getCommit(), getPullRequest());
}
}
| [
"robin@onedev.io"
] | robin@onedev.io |
07a89ced979af23756c60bfc957e1f7a9f6e9568 | a2353e4d9dc2b7797dee2587c66c950924b141e2 | /control-stress-application/src/main/java/com/extl/jade/user/RevertToResource.java | c5370b3ce9ea92b500f5acef98c942f174981c0b | [
"Apache-2.0"
] | permissive | tuwiendsg/ADVISE | d06f8efe6658cb0d7b6502ff8d537cf9c1cd8f7e | b7ffadb286fc4e65fbd083b47842c8a62b338af8 | refs/heads/master | 2020-03-30T20:25:35.023813 | 2015-01-30T14:56:28 | 2015-01-30T14:56:28 | 19,457,103 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,913 | java |
package com.extl.jade.user;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* Input parameters for method revertToResource
*
* <p>Java class for revertToResource complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="revertToResource">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="resourceUUID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="newSnapshotName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="when" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "revertToResource", propOrder = {
"resourceUUID",
"newSnapshotName",
"when"
})
public class RevertToResource {
protected String resourceUUID;
protected String newSnapshotName;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar when;
/**
* Gets the value of the resourceUUID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getResourceUUID() {
return resourceUUID;
}
/**
* Sets the value of the resourceUUID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setResourceUUID(String value) {
this.resourceUUID = value;
}
/**
* Gets the value of the newSnapshotName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNewSnapshotName() {
return newSnapshotName;
}
/**
* Sets the value of the newSnapshotName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNewSnapshotName(String value) {
this.newSnapshotName = value;
}
/**
* Gets the value of the when property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getWhen() {
return when;
}
/**
* Sets the value of the when property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setWhen(XMLGregorianCalendar value) {
this.when = value;
}
}
| [
"e.copil@dsg.tuwien.ac.at"
] | e.copil@dsg.tuwien.ac.at |
b61ed7d45d1b17d4bb681ef0af9a5de2dfef4960 | 1c9fff79b172ec9f3f6d73c40ac52be4834e812a | /JavaNIO/src/main/java/filechannel/ReadTest.java | 50edc0ad3f12200eb698554187a1f969d866738f | [] | no_license | DevinKin/JavaNote | a0a76fd8d5ea7bb43d38388b2d6bc450abfb3e4c | 07adb1d3965e84d9c47645a207a7db8f9a3c9016 | refs/heads/master | 2023-08-08T18:39:11.817291 | 2019-11-07T02:09:20 | 2019-11-07T02:09:20 | 187,410,753 | 0 | 0 | null | 2023-07-22T06:04:43 | 2019-05-18T22:25:59 | Java | UTF-8 | Java | false | false | 1,048 | java | package filechannel;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
/**
* @program: JavaNIO
* @author: devinkin
* @create: 2019-08-30 10:17
* @description:
**/
public class ReadTest {
public static void main(String[] args) throws IOException {
RandomAccessFile aFile = new RandomAccessFile("C:\\Users\\devinkin\\Learning\\JavaLearning\\JavaNIO\\src\\main\\resources\\data\\nio-data.txt", "rw");
FileChannel inChannel = aFile.getChannel();
ByteBuffer buf = ByteBuffer.allocate(48);
int bytesRead = inChannel.read(buf);
while (bytesRead != -1) {
System.out.println("Read " + bytesRead);
buf.flip();
while (buf.hasRemaining()) {
System.out.print((char)buf.get());
}
System.out.println();
buf.clear();
bytesRead = inChannel.read(buf);
}
inChannel.close();
}
}
| [
"devinkin@163.com"
] | devinkin@163.com |
2ac4a853cb4b1c894b2f8f7bfeb3a9597a024348 | 4b6dfc0d0094d3dc7a13fd1cb5dbecc2a34b9dd9 | /tests/ballerina-integration-test/src/test/java/org/ballerinalang/test/service/grpc/tool/ProtoDescriptorUtils.java | 499d707dcf46b54fbd31bdb54fd716c69f7b2acc | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-mit-old-style",
"MPL-2.0",
"LicenseRef-scancode-unicode",
"MIT"
] | permissive | stephengroat/ballerina-lang | dde34163c513a66dc4b4b1e73c53edfb92df9b17 | 22ef309ed3369ebd5c48b4d16c87b942f6c64c0a | refs/heads/master | 2022-07-13T09:20:34.582921 | 2018-12-18T08:44:43 | 2018-12-18T08:44:43 | 162,328,652 | 0 | 0 | Apache-2.0 | 2022-07-01T22:18:38 | 2018-12-18T18:15:25 | Java | UTF-8 | Java | false | false | 4,057 | java | /*
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.ballerinalang.test.service.grpc.tool;
import com.google.protobuf.DescriptorProtos;
import org.ballerinalang.protobuf.cmd.OSDetector;
import org.ballerinalang.protobuf.exception.BalGenToolException;
import org.ballerinalang.protobuf.utils.ProtocCommandBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import static org.ballerinalang.protobuf.BalGenerationConstants.PROTOC_PLUGIN_EXE_PREFIX;
import static org.ballerinalang.protobuf.BalGenerationConstants.PROTOC_PLUGIN_EXE_URL_SUFFIX;
import static org.ballerinalang.protobuf.utils.BalFileGenerationUtils.downloadFile;
import static org.ballerinalang.protobuf.utils.BalFileGenerationUtils.generateDescriptor;
import static org.ballerinalang.protobuf.utils.BalFileGenerationUtils.grantPermission;
import static org.ballerinalang.protobuf.utils.BalFileGenerationUtils.resolveProtoFolderPath;
/**
* Test util class contains util functions to retrieve proto descriptor.
*
* @since 0.982.0
*/
public class ProtoDescriptorUtils {
/**
* Download the protoc executor.
*
* @return protoc compiler file.
*/
public static File getProtocCompiler() throws IOException {
File protocExeFile = new File(System.getProperty("java.io.tmpdir"), "protoc-" + OSDetector
.getDetectedClassifier() + ".exe");
String protocExePath = protocExeFile.getAbsolutePath(); // if file already exists will do nothing
String protocVersion = "3.4.0";
if (!protocExeFile.exists()) {
String protocDownloadurl = PROTOC_PLUGIN_EXE_URL_SUFFIX + protocVersion + "/protoc-" + protocVersion
+ "-" + OSDetector.getDetectedClassifier() + PROTOC_PLUGIN_EXE_PREFIX;
try {
downloadFile(new URL(protocDownloadurl), protocExeFile);
//set application user permissions to 455
grantPermission(protocExeFile);
} catch (BalGenToolException e) {
java.nio.file.Files.deleteIfExists(Paths.get(protocExePath));
throw e;
}
} else {
grantPermission(protocExeFile);
}
return protocExeFile;
}
/**
* Generate proto file and convert it to byte array.
*
* @param exePath protoc executor path
* @param protoPath .proto file path
* @return file descriptor of proto file.
*/
public static DescriptorProtos.FileDescriptorSet getProtoFileDescriptor(File exePath, String protoPath) throws
IOException {
File descriptorFile = File.createTempFile("file-desc-", ".desc");
String command = new ProtocCommandBuilder
(exePath.getAbsolutePath(), protoPath, resolveProtoFolderPath(protoPath), descriptorFile
.getAbsolutePath()).build();
generateDescriptor(command);
try (InputStream targetStream = new FileInputStream(descriptorFile)) {
return DescriptorProtos.FileDescriptorSet.parseFrom(targetStream);
} catch (IOException e) {
throw new BalGenToolException("Error reading generated descriptor file.", e);
} finally {
Files.deleteIfExists(descriptorFile.toPath());
}
}
}
| [
"dknkuruppu@gmail.com"
] | dknkuruppu@gmail.com |
42c6d4843a92178c31cc82fcedf505f7f449fa1d | a6bf75731fce03d31bad36a23720e28f50f3dc6a | /src/Garage.java | 5be6ec0e40764c3d39947e748d5ada0846a5c590 | [] | no_license | katgenova/Garage | ffa864833fddd7e9d77225bc6cf46ac536437da6 | d0881a658d5a24cefba9defe3b6e40d88972115b | refs/heads/master | 2020-03-17T17:28:00.118818 | 2018-05-17T09:24:53 | 2018-05-17T09:24:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java | import java.util.ArrayList;
import java.util.Iterator;
public class Garage {
ArrayList<Vehicle> vehicles = new ArrayList<>();
public void addVehicle(Vehicle vehicle){
vehicles.add(vehicle);
}
public void removeVehicleByID(int index){
vehicles.remove(index);
}
public void removeVehicleByType(String type){
for (Iterator<Vehicle> vehicleIterator = vehicles.iterator(); vehicleIterator.hasNext();){
Vehicle temp = vehicleIterator.next();
if (temp.getVehicleType().equalsIgnoreCase(type)){
vehicleIterator.remove();
}
}
}
public void fixVehicle(){
int price = 0;
for (Vehicle vehicles: vehicles){
if (vehicles.getVehicleType().equalsIgnoreCase("car")){
price = 450;
System.out.println("Repair cost for a car is on average £" + price + " per job.");
} else if (vehicles.getVehicleType().equalsIgnoreCase("motorcycle")){
price = 200;
System.out.println("Repair cost for a motorcycle is on average £" + 200 + " per job.");
} else if (vehicles.getVehicleType().equalsIgnoreCase("bicycle")){
price = 90;
System.out.println("Repair cost for a bicycle is on average £" + 90 + " per job");
}
}
}
public void emptyGarage(){
vehicles.removeAll(vehicles);
}
}
| [
"e.genova@live.co.uk"
] | e.genova@live.co.uk |
a23bb81d18587c5623fd7327a5cc6c583fae653d | b8451fb50e8e651dd6d7db751bd8b602ee9f5fc3 | /plugins/com.phonegap.plugins.PushPlugin/src/amazon/PushPlugin.java | 701f5cb7e6d92773c92c3d2227006274f8a379a8 | [
"MIT"
] | permissive | ksg412/pushTest | 3461a59c3f15c1e620917511febe1dd48198e0bd | db116f44aeaea4e47d1b4b08352ae9e56f89e5de | refs/heads/master | 2021-01-10T08:00:00.044028 | 2016-02-14T15:04:30 | 2016-02-14T15:04:30 | 51,631,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,177 | java | /*
* Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.amazon.cordova.plugin;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import com.amazon.device.messaging.ADM;
import org.apache.cordova.*;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Iterator;
public class PushPlugin extends CordovaPlugin {
private static String TAG = "PushPlugin";
/**
* @uml.property name="adm"
* @uml.associationEnd
*/
private ADM adm = null;
/**
* @uml.property name="activity"
* @uml.associationEnd
*/
private Activity activity = null;
private static CordovaWebView webview = null;
private static String notificationHandlerCallBack;
private static boolean isForeground = false;
private static Bundle gCachedExtras = null;
public static final String REGISTER = "register";
public static final String UNREGISTER = "unregister";
public static final String REGISTER_EVENT = "registered";
public static final String UNREGISTER_EVENT = "unregistered";
public static final String MESSAGE = "message";
public static final String ECB = "ecb";
public static final String EVENT = "event";
public static final String PAYLOAD = "payload";
public static final String FOREGROUND = "foreground";
public static final String REG_ID = "regid";
public static final String COLDSTART = "coldstart";
private static final String NON_AMAZON_DEVICE_ERROR = "PushNotifications using Amazon Device Messaging is only supported on Kindle Fire devices (2nd Generation and Later only).";
private static final String ADM_NOT_SUPPORTED_ERROR = "Amazon Device Messaging is not supported on this device.";
private static final String REGISTER_OPTIONS_NULL = "Register options are not specified.";
private static final String ECB_NOT_SPECIFIED = "ecb(eventcallback) option is not specified in register().";
private static final String ECB_NAME_NOT_SPECIFIED = "ecb(eventcallback) value is missing in options for register().";
private static final String REGISTRATION_SUCCESS_RESPONSE = "Registration started...";
private static final String UNREGISTRATION_SUCCESS_RESPONSE = "Unregistration started...";
private static final String MODEL_FIRST_GEN = "Kindle Fire";
public enum ADMReadiness {
INITIALIZED, NON_AMAZON_DEVICE, ADM_NOT_SUPPORTED
}
/**
* Sets the context of the Command. This can then be used to do things like get file paths associated with the
* Activity.
*
* @param cordova
* The context of the main Activity.
* @param webView
* The associated CordovaWebView.
*/
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
// Initialize only for Amazon devices 2nd Generation and later
if (this.isAmazonDevice() && !isFirstGenKindleFireDevice()) {
adm = new ADM(cordova.getActivity());
activity = (CordovaActivity) cordova.getActivity();
webview = this.webView;
isForeground = true;
ADMMessageHandler.saveConfigOptions(activity);
} else {
LOG.e(TAG, NON_AMAZON_DEVICE_ERROR);
}
}
/**
* Checks if current device manufacturer is Amazon by using android.os.Build.MANUFACTURER property
*
* @return returns true for all Kindle Fire OS devices.
*/
private boolean isAmazonDevice() {
String deviceMaker = android.os.Build.MANUFACTURER;
return deviceMaker.equalsIgnoreCase("Amazon");
}
/**
* Check if device is First generation Kindle
*
* @return if device is First generation Kindle
*/
private static boolean isFirstGenKindleFireDevice() {
return android.os.Build.MODEL.equals(MODEL_FIRST_GEN);
}
/**
* Checks if ADM is available and supported - could be one of three 1. Non Amazon device, hence no ADM support 2.
* ADM is not supported on this Kindle device (1st generation) 3. ADM is successfully initialized and ready to be
* used
*
* @return returns true for all Kindle Fire OS devices.
*/
public ADMReadiness isPushPluginReady() {
if (adm == null) {
return ADMReadiness.NON_AMAZON_DEVICE;
} else if (!adm.isSupported()) {
return ADMReadiness.ADM_NOT_SUPPORTED;
}
return ADMReadiness.INITIALIZED;
}
/**
* @see Plugin#execute(String, JSONArray, String)
*/
@Override
public boolean execute(final String request, final JSONArray args,
CallbackContext callbackContext) throws JSONException {
try {
// check ADM readiness
ADMReadiness ready = isPushPluginReady();
if (ready == ADMReadiness.NON_AMAZON_DEVICE) {
callbackContext.error(NON_AMAZON_DEVICE_ERROR);
return false;
} else if (ready == ADMReadiness.ADM_NOT_SUPPORTED) {
callbackContext.error(ADM_NOT_SUPPORTED_ERROR);
return false;
} else if (callbackContext == null) {
LOG.e(TAG,
"CallbackConext is null. Notification to WebView is not possible. Can not proceed.");
return false;
}
// Process the request here
if (REGISTER.equals(request)) {
if (args == null) {
LOG.e(TAG, REGISTER_OPTIONS_NULL);
callbackContext.error(REGISTER_OPTIONS_NULL);
return false;
}
// parse args to get eventcallback name
if (args.isNull(0)) {
LOG.e(TAG, ECB_NOT_SPECIFIED);
callbackContext.error(ECB_NOT_SPECIFIED);
return false;
}
JSONObject jo = args.getJSONObject(0);
if (jo.getString("ecb").isEmpty()) {
LOG.e(TAG, ECB_NAME_NOT_SPECIFIED);
callbackContext.error(ECB_NAME_NOT_SPECIFIED);
return false;
}
callbackContext.success(REGISTRATION_SUCCESS_RESPONSE);
notificationHandlerCallBack = jo.getString(ECB);
String regId = adm.getRegistrationId();
LOG.d(TAG, "regId = " + regId);
if (regId == null) {
adm.startRegister();
} else {
sendRegistrationIdWithEvent(REGISTER_EVENT, regId);
}
// see if there are any messages while app was in background and
// launched via app icon
LOG.d(TAG,"checking for offline message..");
deliverPendingMessageAndCancelNotifiation();
return true;
} else if (UNREGISTER.equals(request)) {
adm.startUnregister();
callbackContext.success(UNREGISTRATION_SUCCESS_RESPONSE);
return true;
} else {
LOG.e(TAG, "Invalid action : " + request);
callbackContext.error("Invalid action : " + request);
return false;
}
} catch (final Exception e) {
callbackContext.error(e.getMessage());
}
return false;
}
/**
* Checks if any bundle extras were cached while app was not running
*
* @return returns tru if cached Bundle is not null otherwise true.
*/
public boolean cachedExtrasAvailable() {
return (gCachedExtras != null);
}
/**
* Checks if offline message was pending to be delivered from notificationIntent. Sends it to webView(JS) if it is
* and also clears notification from the NotificaitonCenter.
*/
private boolean deliverOfflineMessages() {
LOG.d(TAG,"deliverOfflineMessages()");
Bundle pushBundle = ADMMessageHandler.getOfflineMessage();
if (pushBundle != null) {
LOG.d(TAG,"Sending offline message...");
sendExtras(pushBundle);
ADMMessageHandler.cleanupNotificationIntent();
return true;
}
return false;
}
// lifecyle callback to set the isForeground
@Override
public void onPause(boolean multitasking) {
LOG.d(TAG, "onPause");
super.onPause(multitasking);
isForeground = false;
}
@Override
public void onResume(boolean multitasking) {
LOG.d(TAG, "onResume");
super.onResume(multitasking);
isForeground = true;
//Check if there are any offline messages?
deliverPendingMessageAndCancelNotifiation();
}
@Override
public void onDestroy() {
LOG.d(TAG, "onDestroy");
super.onDestroy();
isForeground = false;
webview = null;
notificationHandlerCallBack = null;
}
/**
* Indicates if app is in foreground or not.
*
* @return returns true if app is running otherwise false.
*/
public static boolean isInForeground() {
return isForeground;
}
/**
* Indicates if app is killed or not
*
* @return returns true if app is killed otherwise false.
*/
public static boolean isActive() {
return webview != null;
}
/**
* Delivers pending/offline messages if any
*
* @return returns true if there were any pending messages otherwise false.
*/
public boolean deliverPendingMessageAndCancelNotifiation() {
boolean delivered = false;
LOG.d(TAG,"deliverPendingMessages()");
if (cachedExtrasAvailable()) {
LOG.v(TAG, "sending cached extras");
sendExtras(gCachedExtras);
gCachedExtras = null;
delivered = true;
} else {
delivered = deliverOfflineMessages();
}
// Clear the notification if any exists
ADMMessageHandler.cancelNotification(activity);
return delivered;
}
/**
* Sends register/unregiste events to JS
*
* @param String
* - eventName - "register", "unregister"
* @param String
* - valid registrationId
*/
public static void sendRegistrationIdWithEvent(String event,
String registrationId) {
if (TextUtils.isEmpty(event) || TextUtils.isEmpty(registrationId)) {
return;
}
try {
JSONObject json;
json = new JSONObject().put(EVENT, event);
json.put(REG_ID, registrationId);
sendJavascript(json);
} catch (Exception e) {
Log.getStackTraceString(e);
}
}
/**
* Sends events to JS using cordova nativeToJS bridge.
*
* @param JSONObject
*/
public static boolean sendJavascript(JSONObject json) {
if (json == null) {
LOG.i(TAG, "JSON object is empty. Nothing to send to JS.");
return true;
}
if (notificationHandlerCallBack != null && webview != null) {
String jsToSend = "javascript:" + notificationHandlerCallBack + "("
+ json.toString() + ")";
LOG.v(TAG, "sendJavascript: " + jsToSend);
webview.sendJavascript(jsToSend);
return true;
}
return false;
}
/*
* Sends the pushbundle extras to the client application. If the client application isn't currently active, it is
* cached for later processing.
*/
public static void sendExtras(Bundle extras) {
if (extras != null) {
if (!sendJavascript(convertBundleToJson(extras))) {
LOG.v(TAG,
"sendExtras: could not send to JS. Caching extras to send at a later time.");
gCachedExtras = extras;
}
}
}
// serializes a bundle to JSON.
private static JSONObject convertBundleToJson(Bundle extras) {
if (extras == null) {
return null;
}
try {
JSONObject json;
json = new JSONObject().put(EVENT, MESSAGE);
JSONObject jsondata = new JSONObject();
Iterator<String> it = extras.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
Object value = extras.get(key);
// System data from Android
if (key.equals(FOREGROUND)) {
json.put(key, extras.getBoolean(FOREGROUND));
} else if (key.equals(COLDSTART)) {
json.put(key, extras.getBoolean(COLDSTART));
} else {
// we encourage put the message content into message value
// when server send out notification
if (key.equals(MESSAGE)) {
json.put(key, value);
}
if (value instanceof String) {
// Try to figure out if the value is another JSON object
String strValue = (String) value;
if (strValue.startsWith("{")) {
try {
JSONObject json2 = new JSONObject(strValue);
jsondata.put(key, json2);
} catch (Exception e) {
jsondata.put(key, value);
}
// Try to figure out if the value is another JSON
// array
} else if (strValue.startsWith("[")) {
try {
JSONArray json2 = new JSONArray(strValue);
jsondata.put(key, json2);
} catch (Exception e) {
jsondata.put(key, value);
}
} else {
jsondata.put(key, value);
}
}
} // while
}
json.put(PAYLOAD, jsondata);
LOG.v(TAG, "extrasToJSON: " + json.toString());
return json;
} catch (JSONException e) {
LOG.e(TAG, "extrasToJSON: JSON exception");
}
return null;
}
}
| [
"ksg412@gmail.com"
] | ksg412@gmail.com |
7d208cd04771bf6ca7ad9a6b25e1b2f3a4b37783 | bdb92cf947e14e54942099e4aaa07d2e2b6a942b | /app/src/main/java/blackfundamente/joachim/shilongo/virtualhealthcare/Constants/StringConstants.java | 4ee80d4cb82009fdecc2554c1656f541053c0ce8 | [] | no_license | joachim-shilongo-apps/ProActiv2 | 35e7241c5b599bc63f1896566f365246d48c137e | 20b2146b136d73d2c671af93a4935de7437d4c3f | refs/heads/master | 2022-11-24T15:07:32.804455 | 2020-07-27T21:21:16 | 2020-07-27T21:21:16 | 283,018,984 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package blackfundamente.joachim.shilongo.virtualhealthcare.Constants;
import java.util.ArrayList;
public class StringConstants {
public static final String nameKey="username";
public static final String nameDef=" ";
public static final String emailKey="useremail";
public static final String emailDef=" ";
public static final String picKey="userpic";
public static final String picDef=" ";
public static final String numberKey="number";
public static final String numberDef=" ";
public static final boolean vip=false;
public static final String STORAGE_PATH_UPLOADS = "uploads/";
public static final String DATABASE_PATH_UPLOADS = "uploads";
public static String postEditImage = "SelectedImageUri";
public static final ArrayList<String> insults = new ArrayList<String>();
//insults.add("");
}
| [
"joachim.shilongo.apps@gmail.com"
] | joachim.shilongo.apps@gmail.com |
f36f6655b3f158652b18842f6813bb1c02d56d03 | 56b12a79e6389259a9fc10d8c7961c1dc02f7d9c | /app/src/main/java/com/example/comicsappandroid/data/database/CharacterDAO.java | 18c5798d1bb3fe3433b9b69feda853ff0e377983 | [] | no_license | AntoineMeresse/comics-app-android | 6c55392bbd8e13a753c2206f3d8f5a5216e5bedf | c701e2bfb16235749677473882178597ab96a4d9 | refs/heads/main | 2023-02-10T06:12:29.462902 | 2021-01-03T15:25:58 | 2021-01-03T15:25:58 | 323,627,462 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | package com.example.comicsappandroid.data.database;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
import io.reactivex.Completable;
import io.reactivex.Flowable;
import io.reactivex.Single;
/**
* Room DAO for characters
*/
@Dao
public interface CharacterDAO {
@Query("SELECT * FROM characters_entity")
Flowable<List<CharacterEntity>> getFavoriteCharacters();
@Insert
Completable insertCharacter(CharacterEntity characterEntity);
@Delete
Completable deleteCharacter(CharacterEntity characterEntity);
@Query("SELECT id from characters_entity")
Single<List<Integer>> getIdFavoriteCharacters();
}
| [
"ant.meresse@gmail.com"
] | ant.meresse@gmail.com |
d520e110df338a364f4504225ff8805ba1504706 | 08cf7f04cfee9ec89793cface61464db1543b2b4 | /game-web/src/main/java/com/lodogame/ldsg/web/dao/impl/NoticeDaoMysqlImpl.java | 27a3bdf2a1bbff96ea21d54bdfcb88e7d77acd7a | [] | no_license | hongwu666/trunk | 56f8daa72a11d777a794f9891726c9ba303d3902 | 4e7409624af6baa57362c5044285e25653209fab | refs/heads/master | 2021-05-28T22:29:12.929361 | 2015-06-12T08:22:38 | 2015-06-12T08:22:38 | 37,310,152 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,309 | java | package com.lodogame.ldsg.web.dao.impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.lodogame.common.jdbc.Jdbc;
import com.lodogame.common.jdbc.SqlParameter;
import com.lodogame.ldsg.web.dao.NoticeDao;
import com.lodogame.ldsg.web.model.Notice;
public class NoticeDaoMysqlImpl implements NoticeDao {
@Autowired
private Jdbc jdbc;
@Override
public Notice getNotice(String serverId, String partnerId) {
String sql = "select * from notice where server_id = ? and partner_id = ?";
SqlParameter params = new SqlParameter();
params.setString(serverId);
params.setString(partnerId);
return this.jdbc.get(sql, Notice.class, params);
}
@Override
public boolean updateNotice(Notice notice) {
String sql = "insert into notice values (?, ?, ?, ?, ?, now(), now()) on duplicate key update title = ?, content = ?, updated_time = now(), is_enable = ?";
SqlParameter params = new SqlParameter();
params.setString(notice.getServerId());
params.setString(notice.getPartnerId());
params.setString(notice.getTitle());
params.setString(notice.getContent());
params.setInt(notice.getIsEnable());
params.setString(notice.getTitle());
params.setObject(notice.getContent());
params.setInt(notice.getIsEnable());
return this.jdbc.update(sql, params) > 0;
}
}
| [
"sndy@hyx.com"
] | sndy@hyx.com |
754ebf410bdae880cdb75e841a0f32e2adfe5fe7 | 4ccfa324c24a126f0e2b23cb7cfde956d38e57fa | /cloudalibaba-sentinel-service8401/src/main/java/com/yog/springcloud/alibaba/myhander/CustomerBlockHandler.java | cd8da54b65e64f3f2e842ffff7445e1f31ccf1c1 | [] | no_license | luyouqi727/cloud2020 | 01e923b780e2bb79242854be93ca1093c4d0042e | 9b6e3f5486f43bae039dcedd262097dc9eaffdc8 | refs/heads/master | 2023-02-09T07:50:04.308133 | 2021-01-02T09:45:30 | 2021-01-02T09:45:30 | 326,151,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package com.yog.springcloud.alibaba.myhander;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.yog.springcloud.alibaba.entities.CommonResult;
public class CustomerBlockHandler {
public static CommonResult handlerException1(BlockException exception){
return new CommonResult<>(444,"自定义错误1");
}
public static CommonResult handlerException2(BlockException exception){
return new CommonResult<>(444,"自定义错误2");
}
}
| [
"2454887861@qq.com"
] | 2454887861@qq.com |
74e291330584dad0d1151b6f6cb3c006f4e4e206 | ebe0d2b33470c52ca9ceca595c6c233ae30bbbfc | /pet-clinic-data/src/main/java/dmnk/springframework/sfgpetclinic/services/map/OwnerMapService.java | 58b61352c603b7f25aec4c9417bc558705a3dacd | [] | no_license | dmnksdr/sfg-pet-clinic | 1d43547e5d0c73ad6d15cbbf9c60277363668d73 | be0e23fb40c6662260b10ba94e7e442cc660ecbc | refs/heads/master | 2020-03-27T23:21:11.943537 | 2018-10-15T12:01:49 | 2018-10-15T12:01:49 | 147,311,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,371 | java | package dmnk.springframework.sfgpetclinic.services.map;
import dmnk.springframework.sfgpetclinic.model.Owner;
import dmnk.springframework.sfgpetclinic.model.Pet;
import dmnk.springframework.sfgpetclinic.services.OwnerService;
import dmnk.springframework.sfgpetclinic.services.PetService;
import dmnk.springframework.sfgpetclinic.services.PetTypeService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import java.util.Set;
@Service
@Profile({"default", "map"})
public class OwnerMapService extends AbstractMapService<Owner, Long> implements OwnerService {
private final PetTypeService petTypeService;
private final PetService petService;
public OwnerMapService(PetTypeService petTypeService, PetService petService) {
this.petTypeService = petTypeService;
this.petService = petService;
}
@Override
public Set<Owner> findAll() {
return super.findAll();
}
@Override
public Owner findById(Long id) {
return super.findById(id);
}
@Override
public Owner save(Owner object) {
if (object != null) {
if (object.getPets() != null) {
object.getPets().forEach(pet -> {
if (pet.getPetType() != null) {
if (pet.getPetType().getId() == null) {
pet.setPetType(petTypeService.save(pet.getPetType()));
}
} else {
throw new RuntimeException("Pet Type is required");
}
if (pet.getId() == null) {
Pet savedPet = petService.save(pet);
pet.setId(savedPet.getId());
}
});
}
return super.save(object);
} else {
return null;
}
}
@Override
public void delete(Owner object) {
super.delete(object);
}
@Override
public void deleteById(Long id) {
super.deleteById(id);
}
@Override
public Owner findByLastName(String lastName) {
return this.findAll().stream()
.filter(owner -> owner
.getLastName()
.equalsIgnoreCase(lastName))
.findFirst()
.orElse(null);
}
}
| [
"dmnksdr@gmail.com"
] | dmnksdr@gmail.com |
49ad3d375d925c54256c0283ab2dc37211e11ffc | 1ed6a6562c99a0df80677628dc9b3c24dd613024 | /src/main/java/com/playtech/assignment/URLSplitterApplication.java | 13661539905c065fc8bdfd2ec82114a43b38c7f9 | [] | no_license | sepulrator/url-splitter | d776654f998f14f36a45e1153d99cfd348153fa4 | 9cce6c0d0147bfc6811e4aed85f5db0658d31615 | refs/heads/master | 2021-07-12T16:11:12.276957 | 2017-10-11T20:24:19 | 2017-10-11T20:24:19 | 106,604,850 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | package com.playtech.assignment;
import com.playtech.assignment.model.URLModel;
import com.playtech.assignment.service.RegexURLSplitter;
import com.playtech.assignment.service.StateMachineURLSplitter;
import com.playtech.assignment.service.URLSplitter;
import java.util.Optional;
import java.util.stream.IntStream;
public class URLSplitterApplication {
private static final Integer LIMIT = 10000;
public static void main(String[] args) {
String urlString = args[0];
URLSplitter regexURLSplitter = new RegexURLSplitter();
URLSplitter stateMachineURLSplitter = new StateMachineURLSplitter();
long start = System.currentTimeMillis();
Optional<URLModel> regexUrlModel = IntStream.range(0, LIMIT).mapToObj($ -> regexURLSplitter.splitUrl(urlString)).findFirst();
long regexElapsedTime = System.currentTimeMillis() - start;
start = System.currentTimeMillis();
Optional<URLModel> stateMachineURLResult = IntStream.range(0, LIMIT).mapToObj($ -> stateMachineURLSplitter.splitUrl(urlString)).findFirst();
long stateMachineElapsedTime = System.currentTimeMillis() - start;
System.out.println(stateMachineURLResult.get());
System.out.println("Regex: " + regexElapsedTime+"msec");
System.out.println("State: " + stateMachineElapsedTime+"msec");
}
}
| [
"osman.samil327@gmail.com"
] | osman.samil327@gmail.com |
ad9746c66991f2800fb7d46a36bb90dfebc6f15e | c8838a0040f43c6e10741d4ae641cf2f6aa7ae07 | /LegalStaffService/src/secretaryFactory/secretaryServiceFactory.java | fa4073299ac047c4d5847fde3d30d7472deac459 | [] | no_license | anastasiach/EPL362_OSGI | 4f260c41410b5f9136b82ddb0b1e94f38e33de10 | 7dec2a923059d9caa299e9a3ff204776b42c24b6 | refs/heads/master | 2020-03-07T22:21:15.862109 | 2018-04-30T15:57:00 | 2018-04-30T15:57:00 | 127,751,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package secretaryFactory;
import secretaryModel.secretaryFunctions;
import secretaryService.secretaryFunctionImpl;
/**
* Method that get the side effects of strategy
*
*/
public class secretaryServiceFactory {
private static secretaryFunctions secretaryService = new secretaryFunctionImpl();
public static secretaryFunctions getFactory() {
return secretaryService;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
881964f6e10f67e705a85d4e52ee8f65953e0303 | 59d105d212aa7d188f788a488acf99c1291abf1d | /src/main/java/com/ycb/blog/model/ArticleTag.java | 8848876c6cc41fdb57e611fc7517be972f3211a8 | [] | no_license | xiyangqiaoduan/myblog | 43a5d1fb599525e6fe6e348795384e5fe9595e2d | 2846dc2aba6a069e42944f6c95effede61920ea0 | refs/heads/master | 2020-12-30T17:11:09.721784 | 2017-05-31T09:51:37 | 2017-05-31T09:51:37 | 91,064,982 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package com.ycb.blog.model;
/**
* 标签关联信息
* @author yangcb
* @create 2017-05-19 11:40
**/
public class ArticleTag {
private String id;
private String articleId;
private String tagId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getArticleId() {
return articleId;
}
public void setArticleId(String articleId) {
this.articleId = articleId;
}
public String getTagId() {
return tagId;
}
public void setTagId(String tagId) {
this.tagId = tagId;
}
}
| [
"yangcb@hui10.com"
] | yangcb@hui10.com |
8ce83a29731b79d95b1e09c3d937eebe498a13df | 4ed137d0b45294ae302f562d60062f9df6f58f7b | /src/main/java/org/urish/gwtit/titanium/events/LogoutEvent.java | 042440bbd7174ea6a80c412cbeffbae3c1f57064 | [
"Apache-2.0"
] | permissive | urish/gwt-titanium | b502ccfb1cf39cf51f9f7d2e2d83466e256eb322 | 5b53a312093a84f235366932430f02006a570612 | refs/heads/master | 2019-01-02T08:32:02.230691 | 2011-09-29T09:03:17 | 2011-09-29T09:03:17 | 1,997,369 | 8 | 2 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | /*
* Copyright 2011 Uri Shaked
*
* 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.
*/
/* Automatically generated code, don't edit ! */
package org.urish.gwtit.titanium.events;
import org.urish.gwtit.client.event.AbstractTitaniumEvent;
/**
*
*/
public class LogoutEvent extends AbstractTitaniumEvent {
public final static String NATIVE_EVENT_NAME = "logout";
protected LogoutEvent() {
}
}
| [
"uri@salsa4fun.co.il"
] | uri@salsa4fun.co.il |
74d23d8dd7e094622c930acc8a8c74afc67db71f | 353db39670d4e8db983a8c503a894f891e109e32 | /src/w4practicum1/package-info.java | b34be562117d427885b3f3715ba39facc9ede691 | [] | no_license | janus-magnus/V1OODC1 | dafc1290ab89b44902066a513d731cdbe72c37b0 | d6b5ab2fc92b1321ebd5213bac7ca8d7d910e4c0 | refs/heads/master | 2021-01-22T02:48:44.216127 | 2017-02-22T12:56:57 | 2017-02-22T12:56:57 | 81,073,558 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 63 | java | /**
*
*/
/**
* @author Yannick
*
*/
package w4practicum1; | [
"ykorringa@gmail.com"
] | ykorringa@gmail.com |
09993755c65e90419dcfc907b1c86c20e74ae1f2 | 957d7ed126464e01a81fd9228a7d3b522828a4de | /app/src/main/java/com/zebstudios/cityexpress/ReservacionBD.java | 784bd73095a6d06b4bac7c23569db1eba809a735 | [] | no_license | AppHotelesCity/source | cfecde75c05da39bd8868489a86438999277aef1 | 4fb42674a7672945373ad9f676f66bb9846d4841 | HEAD | 2016-09-12T11:10:54.711270 | 2016-02-02T15:45:54 | 2016-02-02T15:45:54 | 57,154,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,269 | java | package com.zebstudios.cityexpress;
import java.util.Date;
/**
* Created by DanyCarreto on 21/12/15.
*/
public class ReservacionBD {
private int numReservacion;
private String nombreUsuario;
private String apellidoUsuario;
private String nombreHotel;
private String siglasHotel;
private String emailHotel;
private String emailUsuario;
private Date fechaLlegada;
private Date fechaSalida;
private String deschabitacion;
private String descHotel;
private String habCosto;
private String subtotal;
private String iva;
private String total;
private String codigoHabitacion;
private String direccionHotel;
private String descripcionLugarHotel;
private int adultos;
private int infantes;
private int numHabitaciones;
private int numNoches;
private double longitudHotel;
private double latitudHotel;
private boolean checkIn;
private boolean checkOut;
private boolean consultarSaldos;
private String numHabitacionAsigado;
private boolean cityPremios;
public ReservacionBD() {
}
public ReservacionBD(int numReservacion, String nombreUsuario, String apellidoUsuario, String nombreHotel, Date fechaLlegada, Date fechaSalida, String deschabitacion, String descHotel, String habCosto, String total, String direccionHotel, String descripcionLugarHotel, int adultos, int infantes, int numHabitaciones, int numNoches, double longitudHotel, double latitudHotel) {
this.numReservacion = numReservacion;
this.nombreUsuario = nombreUsuario;
this.apellidoUsuario = apellidoUsuario;
this.nombreHotel = nombreHotel;
this.fechaLlegada = fechaLlegada;
this.fechaSalida = fechaSalida;
this.deschabitacion = deschabitacion;
this.descHotel = descHotel;
this.habCosto = habCosto;
this.total = total;
this.direccionHotel = direccionHotel;
this.descripcionLugarHotel = descripcionLugarHotel;
this.adultos = adultos;
this.infantes = infantes;
this.numHabitaciones = numHabitaciones;
this.numNoches = numNoches;
this.longitudHotel = longitudHotel;
this.latitudHotel = latitudHotel;
}
public int getNumReservacion() {
return numReservacion;
}
public void setNumReservacion(int numReservacion) {
this.numReservacion = numReservacion;
}
public String getNombreUsuario() {
return nombreUsuario;
}
public void setNombreUsuario(String nombreUsuario) {
this.nombreUsuario = nombreUsuario;
}
public String getApellidoUsuario() {
return apellidoUsuario;
}
public void setApellidoUsuario(String apellidoUsuario) {
this.apellidoUsuario = apellidoUsuario;
}
public String getNombreHotel() {
return nombreHotel;
}
public void setNombreHotel(String nombreHotel) {
this.nombreHotel = nombreHotel;
}
public Date getFechaLlegada() {
return fechaLlegada;
}
public void setFechaLlegada(Date fechaLlegada) {
this.fechaLlegada = fechaLlegada;
}
public Date getFechaSalida() {
return fechaSalida;
}
public void setFechaSalida(Date fechaSalida) {
this.fechaSalida = fechaSalida;
}
public String getDeschabitacion() {
return deschabitacion;
}
public void setDeschabitacion(String deschabitacion) {
this.deschabitacion = deschabitacion;
}
public String getDescHotel() {
return descHotel;
}
public void setDescHotel(String descHotel) {
this.descHotel = descHotel;
}
public String getHabCosto() {
return habCosto;
}
public void setHabCosto(String habCosto) {
this.habCosto = habCosto;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getDireccionHotel() {
return direccionHotel;
}
public void setDireccionHotel(String direccionHotel) {
this.direccionHotel = direccionHotel;
}
public String getDescripcionLugarHotel() {
return descripcionLugarHotel;
}
public void setDescripcionLugarHotel(String descripcionLugarHotel) {
this.descripcionLugarHotel = descripcionLugarHotel;
}
public int getAdultos() {
return adultos;
}
public void setAdultos(int adultos) {
this.adultos = adultos;
}
public int getInfantes() {
return infantes;
}
public void setInfantes(int infantes) {
this.infantes = infantes;
}
public int getNumHabitaciones() {
return numHabitaciones;
}
public void setNumHabitaciones(int numHabitaciones) {
this.numHabitaciones = numHabitaciones;
}
public int getNumNoches() {
return numNoches;
}
public void setNumNoches(int numNoches) {
this.numNoches = numNoches;
}
public double getLongitudHotel() {
return longitudHotel;
}
public void setLongitudHotel(double longitudHotel) {
this.longitudHotel = longitudHotel;
}
public double getLatitudHotel() {
return latitudHotel;
}
public void setLatitudHotel(double latitudHotel) {
this.latitudHotel = latitudHotel;
}
public String getSiglasHotel() {
return siglasHotel;
}
public void setSiglasHotel(String siglasHotel) {
this.siglasHotel = siglasHotel;
}
public String getCodigoHabitacion() {
return codigoHabitacion;
}
public void setCodigoHabitacion(String codigoHabitacion) {
this.codigoHabitacion = codigoHabitacion;
}
public boolean isCheckIn() {
return checkIn;
}
public void setCheckIn(boolean checkIn) {
this.checkIn = checkIn;
}
public boolean isCheckOut() {
return checkOut;
}
public void setCheckOut(boolean checkOut) {
this.checkOut = checkOut;
}
public boolean isConsultarSaldos() {
return consultarSaldos;
}
public void setConsultarSaldos(boolean consultarSaldos) {
this.consultarSaldos = consultarSaldos;
}
public String getEmailHotel() {
return emailHotel;
}
public void setEmailHotel(String emailHotel) {
this.emailHotel = emailHotel;
}
public String getNumHabitacionAsigado() {
return numHabitacionAsigado;
}
public void setNumHabitacionAsigado(String numHabitacionAsigado) {
this.numHabitacionAsigado = numHabitacionAsigado;
}
public String getEmailUsuario() {
return emailUsuario;
}
public void setEmailUsuario(String emailUsuario) {
this.emailUsuario = emailUsuario;
}
public String getSubtotal() {
return subtotal;
}
public void setSubtotal(String subtotal) {
this.subtotal = subtotal;
}
public String getIva() {
return iva;
}
public void setIva(String iva) {
this.iva = iva;
}
public boolean isCityPremios() {
return cityPremios;
}
public void setCityPremios(boolean cityPremios) {
this.cityPremios = cityPremios;
}
}
| [
"dany7carreto@gmail.com"
] | dany7carreto@gmail.com |
c8a84193e832a35ee0d69a8033b8c95fce443326 | abc86b6f98fdce605581b9330bd6b71bb64a2863 | /app/src/main/java/com/example/administrator/employmentplatform/User_view/Picture.java | b6e0898bb6a78cccf1ca4680ae316643f0cf8dda | [] | no_license | MasterQueen/CEEP-School | fe182be16e534e77eed1099bfc1b46d0e42da8e0 | 8ed28bf670482e89d18bfdc18f2406486dda3c50 | refs/heads/master | 2020-08-03T07:44:28.377679 | 2019-09-29T14:32:09 | 2019-09-29T14:32:09 | 211,672,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package com.example.administrator.employmentplatform.User_view;
/**
* user_school_secondhand界面图片添加
* Created by Administrator on 2/2/2018.
*/
public class Picture {
private String name;
private int imageId;
public Picture(String name, int imageId){
this.name = name;
this.imageId = imageId;
}
public String getName(){
return name;
}
public int getImageId(){
return imageId;
}
}
| [
"952100554@qq.com"
] | 952100554@qq.com |
ed65483cf8fbd2973fe585082723a817dddb74b5 | 8620fb6eaae160f06f7aad7f1345a203b6f0b11f | /NetBeansProjects/Exercises/src/exercises/APIExercise1.java | 84fe6c94e570fd9e80681fa11f8246f65fa042ee | [] | no_license | xelaquartz/SYSINTG | 9be2be99b77eab0250f6d378d3d585ed607e0c26 | ff1bdd950a76d8d0274c2f064e82dcaf381d2395 | refs/heads/master | 2021-04-09T10:46:28.855670 | 2016-06-27T07:33:09 | 2016-06-27T07:33:09 | 61,698,114 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | java | package exercises;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class APIExercise1
{
public static void main(String[] args)
{
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println("It is currently " + df.format(date) + ".");
DateFormat df2 = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault());
System.out.println(df2.format(date));
}
} | [
"Student@G306APC11.manila.dlsu.edu.ph"
] | Student@G306APC11.manila.dlsu.edu.ph |
cc82ff49469dd8b5f3ca8a4f6eec0c580709116f | beab21c7e4fca6433d142ae03d5b48bb0b21aaa2 | /Android/app/src/main/java/pt/ulisboa/tecnico/sirs/ssandroidapp/QRScannerActivity.java | 376d003ce74b5cd5d7f8be93f4d7d70e679eda2d | [] | no_license | ezaki159/Secure-Smartphone | 1e8f43dc7f59dc9e3257494bee7bb8eb133c9e9c | 1a5907139e4a340ce313556c988d52f2106410ad | refs/heads/master | 2020-12-06T20:15:34.060023 | 2020-01-08T10:58:50 | 2020-01-08T10:58:50 | 232,543,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,461 | java | package pt.ulisboa.tecnico.sirs.ssandroidapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class QRScannerActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler {
private ZXingScannerView zXingScannerView;
private String qrMsg = "";
private Computer computer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
computer = (Computer) getIntent().getSerializableExtra(Constants.COMPUTER_OBJ);
zXingScannerView = new ZXingScannerView(getApplicationContext());
setContentView(zXingScannerView); // use zXing qrScanner layout
zXingScannerView.setResultHandler(this);
zXingScannerView.startCamera();
}
@Override
protected void onPause() {
super.onPause();
zXingScannerView.stopCamera(); // when out of focus, stop camera
}
@Override
protected void onResume() {
super.onResume();
zXingScannerView.resumeCameraPreview(this); // back to focus, setup qrReader
zXingScannerView.startCamera();
}
@Override
public void handleResult(Result result) {
Toast.makeText(getApplicationContext(), R.string.qr_code_read_success_msg, Toast.LENGTH_SHORT).show(); // little popup saying qr read was a success
zXingScannerView.stopCamera();
setContentView(R.layout.activity_qrscanner); // change layout
TextView tv = findViewById(R.id.qrMsgTV);
qrMsg = result.getText();
tv.setText(qrMsg); // add qr message to text view
Button button = findViewById(R.id.doneButton);
if (!validPublicKey(qrMsg)) {
button.setEnabled(false);
Toast.makeText(getApplicationContext(), R.string.invalid_public_key, Toast.LENGTH_SHORT).show();
}
else button.setEnabled(true);
}
private boolean validPublicKey(String msg) {
String[] lines = msg.split("\\r?\\n");
return lines[0].equals(Constants.RSA_PUBLIC_BEGIN) && lines[lines.length - 1].equals(Constants.RSA_PUBLIC_END);
}
public void changeActivityRepeat(View view) {
retryQRScanner();
}
private void retryQRScanner(){
setContentView(zXingScannerView);
zXingScannerView.resumeCameraPreview(this);
zXingScannerView.startCamera();
}
public void changeActivityCancel(View view) {
Intent intent = new Intent(this, MainActivity.class); // go back to main activity
startActivity(intent);
}
public void changeActivityDone(View view) {
try {
computer.setupPublicKey(this, qrMsg, getIntent().getStringExtra(Constants.PASSWORD_ID));
} catch (Exception e) { // invalid public key scanned, repeat
Toast.makeText(getApplicationContext(), "Invalid public key scanned", Toast.LENGTH_LONG).show();
retryQRScanner();
return;
}
Intent intent = new Intent(this, KeyExchangeActivity.class);
intent.putExtra(Constants.COMPUTER_OBJ, computer);
intent.putExtra(Constants.PASSWORD_ID, getIntent().getStringExtra(Constants.PASSWORD_ID));
startActivity(intent);
}
}
| [
"guilherme.j.santos@tecnico.ulisboa.pt"
] | guilherme.j.santos@tecnico.ulisboa.pt |
6185451c6458bf14b386765bedebbe5cfba78915 | bb926a7e532f36c27546719f3bf7c91b4ba9315d | /src/com/charlie/notesyllabus/note/Note.java | 5d5bf537944e5c6838b47116759ba5ad3d85a990 | [] | no_license | wushq5/NoteSyllabus | 3890803ee691538e650b8ee92a2affb0ba0ec141 | 6c81b318229543f3ce6e55b742279f514cd500a9 | refs/heads/master | 2021-01-10T21:55:14.496710 | 2015-07-18T11:26:49 | 2015-07-18T11:26:49 | 37,357,978 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,502 | java | package com.charlie.notesyllabus.note;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.charlie.notesyllabus.R;
import com.charlie.notesyllabus.util.Config;
import com.charlie.notesyllabus.util.DataUtil;
public class Note extends Activity implements OnItemClickListener {
private ListView lv_courses;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.note_aty);
lv_courses = (ListView) findViewById(R.id.lv_courses);
initListView();
}
public void initListView() {
// 获取课表名称
ArrayList<String> courseList = DataUtil.getCoursesName(this);
if (courseList.size() > 0) {
lv_courses.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, courseList));
lv_courses.setOnItemClickListener(this);
}
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
String courseName = lv_courses.getItemAtPosition(position).toString();
Toast.makeText(this, courseName, Toast.LENGTH_SHORT).show();
Intent i = new Intent(this, CourseNote.class);
i.putExtra(Config.COURSE_NAME, courseName);
startActivity(i);
}
}
| [
"841773196@qq.com"
] | 841773196@qq.com |
c2cca4242cb9a903339abaae0049f6d32a2c2216 | cec35ef1cde0b64c22e1dd09171730295137b539 | /chatClient/app/src/main/java/com/example/vijay/clientchat/presenter/UserPresenter.java | a313f04bbce43a3883a02bb4613dc509b5830c31 | [] | no_license | vijay-pal/chat-with-nodejs | 7aaf8b3277c2ceb906713262846260722c612041 | 71107e92ada1692aec860b48c0cb984dfdbe66f2 | refs/heads/master | 2020-03-19T12:00:30.830351 | 2018-08-20T06:49:17 | 2018-08-20T06:49:17 | 136,490,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package com.example.vijay.clientchat.presenter;
import com.example.vijay.clientchat.models.FriendRequest;
import com.example.vijay.clientchat.models.User;
/**
* Created by vijay on 24/8/17.
*/
public interface UserPresenter {
void register(User user, int requestCode);
void sendFriendRequest(FriendRequest.Request request, int requestCode);
void confirmFriendRequest(String currentUserId, FriendRequest.Confirmation confirmation, int requestCode);
}
| [
"vijaypal.vishwakarma@careers360.com"
] | vijaypal.vishwakarma@careers360.com |
198ecf2996ad04ccab3f00be0e32bdf199e97e7b | 319302d2c7a05a5cf9e7da09acc87fdda7c9af05 | /TGRA_darriv15_smarig15_SPACE_RACE/core/src/com/ru/tgra/game/SoundManager.java | 7e3545314a4b8965d502e6d6ebeb74fcd420ab8a | [] | no_license | darri19/TGRA_Space_Race | 97fd5dd0dd08026f42d0e314df93df3095d99aa9 | 26b24c9135500d0119e7b509e47da138a4a74373 | refs/heads/master | 2021-08-06T20:10:53.596227 | 2017-11-07T00:49:13 | 2017-11-07T00:49:13 | 109,401,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package com.ru.tgra.game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;
public class SoundManager {
public static final Sound music = Gdx.audio.newSound(Gdx.files.internal("sounds/lepper.mp3"));
private SoundManager(){
}
}
| [
"darri19@gmail.com"
] | darri19@gmail.com |
790ef7b31d3cb554d0bd280e5671dfcfe1924bc7 | 6ae75eac874775733e2b56c867e9078e277cac6b | /src/main/java/ec/foxkey/crud/CrudServicesApplication.java | fb25f7657deeda39e7860abf40c9dd2a5eaf8aed | [] | no_license | Roddyar/crud-services | f6a3a13f50bd0db6c139b9410fd207b31d67a08c | 65f19f28c36bcf204feae741229b2e1bdc0b7199 | refs/heads/master | 2022-12-06T10:24:14.705912 | 2020-07-29T17:09:18 | 2020-07-29T17:09:18 | 276,759,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package ec.foxkey.crud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CrudServicesApplication {
public static void main(String[] args) {
SpringApplication.run(CrudServicesApplication.class, args);
}
}
| [
"roddyaru@gmail.com"
] | roddyaru@gmail.com |
a2eaa607260f9dd1c1fc75f7e167943382a3a2dc | c23fadbd2abd0329e3483471df8b7f1308e12159 | /pet-clinic-data/src/main/java/pl/mateuszkoczan/petclinic/repository/VisitRepository.java | 83ce1058aa9ebdf0c4ff3b0e7ec1ce6564fc0826 | [] | no_license | koczanm/pet-clinic | 5966338c40ff2993976da9e4460b7b0a92183470 | 2e1179f240b728803efe0f00c4fa9381bf481ac0 | refs/heads/master | 2020-03-28T16:08:12.387971 | 2019-02-13T13:40:21 | 2019-02-13T13:40:21 | 148,663,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package pl.mateuszkoczan.petclinic.repository;
import org.springframework.data.repository.CrudRepository;
import pl.mateuszkoczan.petclinic.model.Visit;
public interface VisitRepository extends CrudRepository<Visit, Long> {
}
| [
"xmateuszkoczan@gmail.com"
] | xmateuszkoczan@gmail.com |
d0882962a0f10c094494bf9a75e41596def9d433 | 23a020adcfc67e2268d6fc5c04a31ea1a83baef6 | /outag/formats/mp4/util/tag/Mp4TagField.java | 5fb4b1493d54faf8f1d8844155f7bef09ba27733 | [] | no_license | jeyboy/Outag | 42e25bf40fe7ae05f3dca56f95d8766c8380956a | f638614f47ba323ba63e0f3c45d72071ad377635 | refs/heads/master | 2020-04-06T09:21:52.558636 | 2013-02-24T20:57:30 | 2013-02-24T20:57:30 | null | 0 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 9,118 | java | package outag.formats.mp4.util.tag;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import outag.file_presentation.JBBuffer;
import outag.formats.generic.TagField;
import outag.formats.generic.Utils;
import outag.formats.mp4.Mp4Tag;
import outag.formats.mp4.util.box.Mp4Box;
import outag.formats.mp4.util.box.Mp4DataBox;
public abstract class Mp4TagField implements TagField {
protected String id;
public static void parse(Mp4Tag tag, Mp4Box head, JBBuffer raw) throws Exception {
JBBuffer buffer = raw.slice(head.getLength());
switch(head.getId()) {
case "©ART":
case "©ART":
case "aART": tag.addArtist(new Mp4TagTextField(head.getId(), buffer).getContent());
break;
case "©alb":
case "©alb":
case "alb": tag.addAlbum(new Mp4TagTextField(head.getId(), buffer).getContent());
break;
case "nam":
case "©nam":
case "©nam": tag.addTitle(new Mp4TagTextField(head.getId(), buffer).getContent());
break;
case "trkn": tag.addTrack(new Mp4TrackField(head.getId(), buffer).getContent());
break;
case "day":
case "©day":
case "©day": tag.addYear(new Mp4TagTextField(head.getId(), buffer).getContent());
break;
case "cmt" :
case "©cmt" :
case "©cmt": tag.addComment(new Mp4TagTextField(head.getId(), buffer).getContent());
break;
case "©gen":
case "©gen":
case "gnre": tag.addGenre(new Mp4GenreField(head.getId(), buffer).getContent());
break;
case Mp4TagReverseDnsField.IDENTIFIER: break;
default:
try {
Mp4Box header = Mp4Box.init(buffer, false);
Mp4DataBox databox = new Mp4DataBox(header, buffer);
tag.addComment(databox.getContent());
}
catch(Exception e) {}
break;
}
//
// if (head.getId().equals(Mp4TagReverseDnsField.IDENTIFIER)) {
// try {
// TagField field = new Mp4TagReverseDnsField(header, raw);
// tag.addField(field);
// }
// catch (Exception e)
// {
// logger.warning(ErrorMessage.MP4_UNABLE_READ_REVERSE_DNS_FIELD.getMsg(e.getMessage()));
// TagField field = new Mp4TagRawBinaryField(header, raw);
// tag.addField(field);
// }
// }
// //Normal Parent with Data atom
// else
// {
// int currentPos = raw.position();
// boolean isDataIdentifier = Utils.getString(raw, Mp4BoxHeader.IDENTIFIER_POS, Mp4BoxHeader.IDENTIFIER_LENGTH, "ISO-8859-1").equals(Mp4DataBox.IDENTIFIER);
// raw.position(currentPos);
// if (isDataIdentifier)
// {
// //Need this to decide what type of Field to create
// int type = Utils.getIntBE(raw, Mp4DataBox.TYPE_POS_INCLUDING_HEADER, Mp4DataBox.TYPE_POS_INCLUDING_HEADER + Mp4DataBox.TYPE_LENGTH - 1);
// Mp4FieldType fieldType = Mp4FieldType.getFieldType(type);
// logger.config("Box Type id:" + header.getId() + ":type:" + fieldType);
//
// //Special handling for some specific identifiers otherwise just base on class id
// if (header.getId().equals(Mp4FieldKey.TRACK.getFieldName()))
// {
// TagField field = new Mp4TrackField(header.getId(), raw);
// tag.addField(field);
// }
// else if (header.getId().equals(Mp4FieldKey.DISCNUMBER.getFieldName()))
// {
// TagField field = new Mp4DiscNoField(header.getId(), raw);
// tag.addField(field);
// }
// else if (header.getId().equals(Mp4FieldKey.GENRE.getFieldName()))
// {
// TagField field = new Mp4GenreField(header.getId(), raw);
// tag.addField(field);
// }
// else if (header.getId().equals(Mp4FieldKey.ARTWORK.getFieldName()) || Mp4FieldType.isCoverArtType(fieldType))
// {
// int processedDataSize = 0;
// int imageCount = 0;
// //The loop should run for each image (each data atom)
// while (processedDataSize < header.getDataLength())
// {
// //There maybe a mixture of PNG and JPEG images so have to check type
// //for each subimage (if there are more than one image)
// if (imageCount > 0)
// {
// type = Utils.getIntBE(raw, processedDataSize + Mp4DataBox.TYPE_POS_INCLUDING_HEADER,
// processedDataSize + Mp4DataBox.TYPE_POS_INCLUDING_HEADER + Mp4DataBox.TYPE_LENGTH - 1);
// fieldType = Mp4FieldType.getFieldType(type);
// }
// Mp4TagCoverField field = new Mp4TagCoverField(raw,fieldType);
// tag.addField(field);
// processedDataSize += field.getDataAndHeaderSize();
// imageCount++;
// }
// }
// else if (fieldType == Mp4FieldType.TEXT)
// {
// TagField field = new Mp4TagTextField(header.getId(), raw);
// tag.addField(field);
// }
// else if (fieldType == Mp4FieldType.IMPLICIT)
// {
// TagField field = new Mp4TagTextNumberField(header.getId(), raw);
// tag.addField(field);
// }
// else if (fieldType == Mp4FieldType.INTEGER)
// {
// TagField field = new Mp4TagByteField(header.getId(), raw);
// tag.addField(field);
// }
// else
// {
// boolean existingId = false;
// for (Mp4FieldKey key : Mp4FieldKey.values())
// {
// if (key.getFieldName().equals(header.getId()))
// {
// //The parentHeader is a known id but its field type is not one of the expected types so
// //this field is invalid. i.e I received a file with the TMPO set to 15 (Oxf) when it should
// //be 21 (ox15) so looks like somebody got their decimal and hex numbering confused
// //So in this case best to ignore this field and just write a warning
// existingId = true;
// logger.warning("Known Field:" + header.getId() + " with invalid field type of:" + type + " is ignored");
// break;
// }
// }
//
// //Unknown field id with unknown type so just create as binary
// if (!existingId)
// {
// logger.warning("UnKnown Field:" + header.getId() + " with invalid field type of:" + type + " created as binary");
// TagField field = new Mp4TagBinaryField(header.getId(), raw);
// tag.addField(field);
// }
// }
// }
// //Special Cases
// else
// {
// //MediaMonkey 3 CoverArt Attributes field, does not have data items so just
// //copy parent and child as is without modification
// if (header.getId().equals(Mp4NonStandardFieldKey.AAPR.getFieldName()))
// {
// TagField field = new Mp4TagRawBinaryField(header, raw);
// tag.addField(field);
// }
// //Default case
// else
// {
// TagField field = new Mp4TagRawBinaryField(header, raw);
// tag.addField(field);
// }
// }
// }
}
public Mp4TagField(String id) { this.id = id; }
public Mp4TagField(String id, JBBuffer raw) throws Exception {
this(id);
build(raw);
}
public String getId() { return id; }
public void isBinary(boolean b) { /* One cannot choose if an arbitrary block can be binary or not */ }
public boolean isCommon() {
return getId().equals("ART") ||
getId().equals("alb") ||
getId().equals("nam") ||
getId().equals("trkn") ||
getId().equals("day") ||
getId().equals("cmt") ||
getId().equals("gen");
}
protected byte[] getIdBytes() { return Utils.getDefaultBytes(getId()); }
protected abstract void build(JBBuffer raw) throws UnsupportedEncodingException, IOException, Exception ;
} | [
"jeyboy1985@gmail.com"
] | jeyboy1985@gmail.com |
f29459871338b9ef9827beb3a69a84d1efc68b4d | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava19/Foo480.java | 213934c747bea4f708f4276979d6bbe3b39c7f9c | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package applicationModulepackageJava19;
public class Foo480 {
public void foo0() {
new applicationModulepackageJava19.Foo479().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
524568f75a8493a2b93bc3d52a357ffa3ad04b5d | 4bdf74d8dbb210d29db0fdf1ae97aad08929612c | /data_test/79996/Piece.java | db737a0ab56fc8d1ceea9a6697f39b69e4945c46 | [] | no_license | huyenhuyen1204/APR_data | cba03642f68ce543690a75bcefaf2e0682df5e7e | cb9b78b9e973202e9945d90e81d1bfaef0f9255c | refs/heads/master | 2023-05-13T21:52:20.294382 | 2021-06-02T17:52:30 | 2021-06-02T17:52:30 | 373,250,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | /**
* Created by CCNE on 19/11/2020.
*/
public abstract class Piece {
private int x;
private int y;
private String color;
/**
* Loan .
*/
public Piece(int x, int y) {
this.x = x;
this.y = y;
this.color = "white";
}
/**
* Loan .
*/
public Piece(int x, int y, String color) {
this.x = x;
this.y = y;
this.color = color;
}
/**
* Loan .
*/
public abstract String getSymbol();
/**
* Loan .
*/
public int getX() {
return x;
}
/**
* Loan .
*/
public int getY() {
return y;
}
/**
* Loan .
*/
public String getColor() {
return color;
}
/**
* Loan .
*/
public void setX(int x) {
this.x = x;
}
/**
* Loan .
*/
public void setY(int y) {
this.y = y;
}
/**
* Loan .
*/
public void setColor(String color) {
this.color = color;
}
/**
* Loan .
*/
public abstract boolean canMove(Board board, int x, int y);
}
| [
"nguyenhuyen98pm@gmail.com"
] | nguyenhuyen98pm@gmail.com |
b2df14d74fb07ea8a9591d8b3c0d9f8a32a2a68f | 97bf833513e80a92ce721a387e40496ccd69cea8 | /box_constructor.java | c3a3e4956e9fc84377c04f0530e6fadd14b4828e | [] | no_license | zaismit/java_OOP_study_26_01_2019_box_constructor | 4bd73e30ec40e0e749cbb37b9c8a3d99b444d910 | dd2a657f843debba9047cb2e08ef4fa6eb466540 | refs/heads/master | 2020-04-18T20:13:12.480657 | 2019-01-26T19:51:28 | 2019-01-26T19:51:28 | 167,732,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | public class box_constructor extends main_file
{
int height;
int length;
int width;
box_constructor(int width, int height, int length)
{
this.width = width;
this.height = height;
this.length = length;
}
int volume()
{
int volume;
volume = height * length * width;
return volume;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5bf35982f303a03dc60badb3063fe41a6cf70fed | 34d1c903860f75b3e688caf595681b494db95dfb | /cursoJava/ejercicios/FormacionAvante/ejemplos/com/avante/ejemplo8/Rectangle.java | 863a376c0cf95bddb50bdf01d8bec11dec6436d1 | [] | no_license | oruizrubio/utilidades | 40c038cc398dd61f35411cba97a74c00aa782485 | 66bc01558b86960ac8c4e81bc79590bddc204f3c | refs/heads/master | 2021-09-07T11:42:39.833989 | 2018-02-22T13:14:41 | 2018-02-22T13:14:41 | 109,443,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | package com.avante.ejemplo8;
public class Rectangle implements Shape {
@Override
public void draw() {
System.out.println("Inside Rectangle::draw() method.");
}
} | [
"noreply@github.com"
] | noreply@github.com |
8e0270011bf6f5ae8bae4968339493ddcc07e079 | a42954d02bb20057600e64d2c4f691da47ad312d | /src/main/java/com/cjburkey/bullet/parser/BaseV.java | 9f16b8023291b2380ff3be3bad1bdb41567b9960 | [
"MIT"
] | permissive | cjburkey01/BulletLang | d9c43f837ad69b6f17256afb419c4cecebe3f42e | c19d537674e61d3f1f13987c93babcdcaaaf47e1 | refs/heads/master | 2020-04-04T14:47:42.233199 | 2019-05-03T13:35:29 | 2019-05-03T13:35:29 | 156,013,026 | 5 | 0 | MIT | 2019-01-13T17:55:50 | 2018-11-03T18:40:01 | Java | UTF-8 | Java | false | false | 864 | java | package com.cjburkey.bullet.parser;
import com.cjburkey.bullet.ErrorHandler;
import com.cjburkey.bullet.antlr.BulletLangBaseVisitor;
import com.cjburkey.bullet.parser.component.Scope;
import java.util.Optional;
import org.antlr.v4.runtime.tree.ParseTree;
/**
* Created by CJ Burkey on 2019/02/16
*/
public abstract class BaseV<T> extends BulletLangBaseVisitor<Optional<T>> {
public final Scope scope;
public BaseV(Scope scope) {
this.scope = scope;
}
@Override
public Optional<T> visit(ParseTree tree) {
if (ErrorHandler.hasErrored() || tree == null) return Optional.empty();
// This could be null because it might be unimplemented
Optional<T> output = super.visit(tree);
//noinspection OptionalAssignedToNull
if (output == null) return Optional.empty();
return output;
}
}
| [
"cjburkey01@gmail.com"
] | cjburkey01@gmail.com |
3291dd55f8b98b40783f43ce9813562cd7937f63 | 2d20d8bb373bf10ed1bc3c1c6825000a0eea10e4 | /src/spider/pipeline/MysqlPipeline.java | 68c47c1606ecdb6d40775089519706d3f48931a0 | [] | no_license | amisyy/IntelligenceManager | aa88d52ffba94f9eb252fa86e9a381f448b9f74a | b6baa9009d911c633d835be5175f5ebb8011e23c | refs/heads/master | 2020-03-12T04:46:46.701973 | 2017-05-19T03:27:41 | 2017-05-19T03:27:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,223 | java | package spider.pipeline;
import service.DataManager;
import service.motion.Motion;
import spider.utils.TypeClassify;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import database.DatabaseHelper;
import entity.Record;
//import database.SQLop;
/**
* Write results in MySQL database.<br>
*
* @author code4crafter@gmail.com <br>
* @since 0.1.0
*/
public class MysqlPipeline implements Pipeline {
@Override
public synchronized void process(ResultItems resultItems, Task task) {
String url = null;
String content = null;
Date time = null;
String title = null;
String author = "";
String type = null;
String other = null;
List<String> comments = null;
List<Date> times = null;
System.out.print("pipeline processing.\n");
if (resultItems.get("url") != null)
url = resultItems.get("url");
// 若为评论
if (resultItems.get("comment") != null) {
comments = (List<String>) resultItems.get("comment");
if (resultItems.get("times") != null) {
List<String> temps = (List<String>) resultItems.get("times");
times = new ArrayList<Date>();
for (String temp : temps) {
temp = temp.trim().replace(" ", "").replace(" ", "");
temp = temp.replace("年", "-");
temp = temp.replace("月", "-");
temp = temp.replace(":", "");
temp = temp.replaceAll("[\u4e00-\u9fa5]+", "");
temp = temp.replaceAll("【", "");
temp = temp.replaceAll("】", "");
if (temp.length() > 10)
temp = temp.substring(0, 10);
if (temp.length() < 10) {
if (temp.length()
- temp.indexOf("-", temp.indexOf("-") + 1) < 4)
temp = temp
.substring(0, temp.indexOf("-",
temp.indexOf("-") + 1) + 1)
+ "0"
+ temp.substring(temp.indexOf("-",
temp.indexOf("-") + 1) + 1, temp
.length() - 1);
}
try {
times.add(java.sql.Date.valueOf(temp));
} catch (Exception e) {
System.out.println(e + "\n数据库存入的时间信息格式有误");
times.add(null);
}
}
}
String keyword = DataManager.getKeyword() + "公众评论";
for (String comment : comments) {
other = Float.toString(Motion.getAssessment(comment));
DatabaseHelper
.save(new Record("公众", keyword, comment, url, times
.get(comments.indexOf(comment)), author, other,
0));
}
return;
}
// 不为评论
if (resultItems.get("title") != null)
title = resultItems.get("title");
System.out.print("title set. ");
if (resultItems.get("content") != null)
content = resultItems.get("content");
System.out.print("content set. ");
if (resultItems.get("time") != null) {
try {
time = java.sql.Date.valueOf((String) resultItems.get("time"));
System.out.print("time set. ");
} catch (Exception e) {
System.out.println(e + "\n数据库存入的时间信息格式有误");
return;
}
}
type = TypeClassify.typeClassifyByUrl(url);
System.out.print("type set. ");
try {
other = Float.toString(Motion.getAssessment(content));
} catch (Exception e) {
e.printStackTrace();
return;
}
System.out.print("index set. \n");
System.out.print(DataManager.getCountPipeline());
DatabaseHelper.save(new Record(type, title, content, url, time, "",
other, 0));
/*
* System.out.println("get page: " + resultItems.getRequest().getUrl());
* for (Map.Entry<String, Object> entry :
* resultItems.getAll().entrySet()) { // String temp =
* entry.getValue().toString(); if (entry.getValue().toString() == null)
* continue; if (entry.getKey().equals("title")) { title =
* entry.getValue().toString(); } else if
* (entry.getKey().equals("content")) { content =
* entry.getValue().toString().replaceAll(" ", "\n") .replaceAll(" ",
* "\n").replaceAll(" ", "\n"); } else if
* (entry.getKey().equals("time")) { String temp =
* entry.getValue().toString(); temp=temp.trim().replace(" ",
* "").replace(" ", "").replace(" ", ""); temp = temp.replace("年", "-");
* temp = temp.replace("月", "-"); temp = temp.replace(":", ""); temp =
* temp.replaceAll("[\u4e00-\u9fa5]+", ""); temp = temp.replaceAll("【",
* ""); temp = temp.replaceAll("】", ""); if (temp.length() > 10) temp =
* temp.substring(0, 10); if (temp.length() < 10) { if (temp.length() -
* temp.indexOf("-", temp.indexOf("-") + 1) < 4) temp =
* temp.substring(0, temp.indexOf("-", temp.indexOf("-") + 1) + 1) + "0"
* + temp.substring(temp.indexOf("-", temp.indexOf("-") + 1) + 1, temp
* .length() - 1); } try { time = java.sql.Date.valueOf(temp); } catch
* (Exception e) { System.out.println(e + "\n数据库存入的时间信息格式有误"); } } else
* if (entry.getKey().equals("baseURL")) { url =
* entry.getValue().toString(); } else if
* (entry.getKey().equals("author")) { author =
* entry.getValue().toString(); } else if
* (entry.getKey().equals("type")) { type = entry.getValue().toString();
* } else if (entry.getKey().equals("other")) { other =
* entry.getValue().toString(); } else
*/
}
}
| [
"qijiqijiqiji@sina.com"
] | qijiqijiqiji@sina.com |
7f41ba97316b8ffbb4d7a2113a1a67f08d9b216c | 638b8e9918a255464bc0fe7810be28c4f72cfaf7 | /src/com/neu/po/Avgranklist.java | 5c9e77b031c8357f6b75aef55ed4126a54226669 | [] | no_license | fenglinbailu/Movies | e19e150f7fbab1ade5a5debe934cc168fe4f1696 | cb1bb5b182f3b3f06b43e1103920d8b7852d55ef | refs/heads/master | 2022-11-18T11:39:37.875992 | 2020-07-22T19:17:54 | 2020-07-22T19:17:54 | 278,024,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 399 | java | package com.neu.po;
public class Avgranklist {
private Double avg;
private String m_id;
public Double getAvg() {
return avg;
}
public void setAvg(Double avg) {
this.avg = avg;
}
public String getmId() {
return m_id;
}
public void setmId(String mId) {
this.m_id = mId == null ? null : mId.trim();
}
} | [
"枫林白鹭@fenglinbailu"
] | 枫林白鹭@fenglinbailu |
f33f93ccf5eb97d10a525fb1d0df1014819cb722 | 0b9a0099eedbbba893ddd5a098102f2f79f01b99 | /app/src/main/java/info/akixe/madridguide/MadridGuideApp.java | 8af85944dbd26e677241edeb1ca2545298e21413 | [] | no_license | aki-KeepCoding/MadridGuide | 3111a74e5d3973525adcea55336aa383c9ee681c | 3031e84c40af8b1c5c2464b9e2ab2f4567c735b7 | refs/heads/master | 2021-01-11T20:13:21.363496 | 2017-01-16T00:32:17 | 2017-01-16T00:32:17 | 79,068,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,026 | java | package info.akixe.madridguide;
import android.app.Application;
import android.content.Context;
import com.squareup.picasso.OkHttpDownloader;
import com.squareup.picasso.Picasso;
import java.lang.ref.WeakReference;
public class MadridGuideApp extends Application {
private static WeakReference<Context> appContext;
@Override
public void onCreate() {
super.onCreate();
appContext = new WeakReference<Context>(getApplicationContext());
setupPicasso();
}
private void setupPicasso() {
Picasso picasso = new Picasso.Builder(this).downloader(new OkHttpDownloader(getCacheDir(), 250000000)).build();
Picasso.setSingletonInstance(picasso);
Picasso.with(getApplicationContext()).setLoggingEnabled(true);
Picasso.with(getApplicationContext()).setIndicatorsEnabled(true);
}
@Override
public void onLowMemory() {
super.onLowMemory();
}
public static Context getAppContext(){
return appContext.get();
}
}
| [
"akixe.otegi@sgsmap.com"
] | akixe.otegi@sgsmap.com |
9cea829c416be22b03408ba3c108e68c2e6e2bba | 10d907cccc625bb1a8f178edc9706529d9c8dfde | /src/java/com/tucanchaya/entities/Grupo.java | 6de7622cd2d33dcfaa36d6fdce48285cd35b99e9 | [] | no_license | wgcarvajal/tucanchaya | 711e97a032b7c67cd9eb705b6cec52c3df792dc9 | 363a1aad0309e5843790116879612c3334251545 | refs/heads/master | 2020-03-24T18:37:55.471602 | 2019-12-05T05:30:43 | 2019-12-05T05:30:43 | 142,896,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,020 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.tucanchaya.entities;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author aranda
*/
@Entity
@Table(name = "grupo", catalog = "tucanchaya", schema = "")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Grupo.findAll", query = "SELECT g FROM Grupo g"),
@NamedQuery(name = "Grupo.findByGruId", query = "SELECT g FROM Grupo g WHERE g.gruId = :gruId"),
@NamedQuery(name = "Grupo.findByGruDescripcion", query = "SELECT g FROM Grupo g WHERE g.gruDescripcion = :gruDescripcion")})
public class Grupo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 20)
@Column(name = "gruId")
private String gruId;
@Size(max = 256)
@Column(name = "gruDescripcion")
private String gruDescripcion;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "gruId")
private List<Usuariogrupo> usuariogrupoList;
public Grupo() {
}
public Grupo(String gruId) {
this.gruId = gruId;
}
public String getGruId() {
return gruId;
}
public void setGruId(String gruId) {
this.gruId = gruId;
}
public String getGruDescripcion() {
return gruDescripcion;
}
public void setGruDescripcion(String gruDescripcion) {
this.gruDescripcion = gruDescripcion;
}
@XmlTransient
public List<Usuariogrupo> getUsuariogrupoList() {
return usuariogrupoList;
}
public void setUsuariogrupoList(List<Usuariogrupo> usuariogrupoList) {
this.usuariogrupoList = usuariogrupoList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (gruId != null ? gruId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Grupo)) {
return false;
}
Grupo other = (Grupo) object;
if ((this.gruId == null && other.gruId != null) || (this.gruId != null && !this.gruId.equals(other.gruId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.tucanchaya.entities.Grupo[ gruId=" + gruId + " ]";
}
}
| [
"wgcarvajal@unicauca.edu.co"
] | wgcarvajal@unicauca.edu.co |
5445bdda44862767d69e5ceacbe54cd4be2215b1 | 58fb8ca483de1445c850bf0402c90bd915c3ae4d | /day2_arch/src/main/java/com/andreiverdes/training/expleo/arch/ui/step3/Step3Fragment.java | 536bb66d8d316d06adecee7c502a263bf9e3b757 | [] | no_license | andreiverdes/expleotraining | 14bd3ca94d3decb50f0d41795468f7d47dbd4043 | 4def95ec894fc0a7b0f75131e026b7c154dd0c26 | refs/heads/master | 2021-01-14T16:03:25.088157 | 2020-02-28T14:27:30 | 2020-02-28T14:27:30 | 242,672,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,252 | java | package com.andreiverdes.training.expleo.arch.ui.step3;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.andreiverdes.training.expleo.arch.R;
public class Step3Fragment extends Fragment {
private Step3ViewModel notificationsViewModel;
private TextView textView;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_step3, container, false);
textView = root.findViewById(R.id.time_text);
return root;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
notificationsViewModel = new ViewModelProvider(getActivity()).get(Step3ViewModel.class);
notificationsViewModel.getTimeLiveData().observe(getViewLifecycleOwner(), time -> {
textView.setText("" + time + " seconds since started");
});
}
} | [
""
] | |
01be00c4ad22aa792f0542b72ffe39699f3e6170 | 07e1ae359602427516e1753efb4643a4a381eadd | /src/ru/fizteh/fivt/students/AndreyMaksimov/Parellel/StoreableForParallel/structured/TableProvider.java | a3763da9b118e164fa116331d7b9b3e9c0d22673 | [
"BSD-2-Clause"
] | permissive | AndreyW/fizteh-java-2014 | 7c433874e3d73ce835517c09fde7500a3bf85b9b | 2dbb10e84245546323f1730f8305578de69c40ca | refs/heads/master | 2020-04-06T05:28:08.930467 | 2014-11-30T13:53:36 | 2014-11-30T13:53:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,490 | java | package ru.fizteh.fivt.students.MaksimovAndrey.Parellel.StoreableForParallel.structured;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
/**
* Управляющий класс для работы с {@link ru.fizteh.fivt.students.MaksimovAndrey.Parellel.StoreableForParallel.structured.Table таблицами}
*
* Предполагает, что актуальная версия с устройства хранения, сохраняется при создании
* экземпляра объекта. Далее ввод-вывод выполняется только в момент создания и удаления
* таблиц.
*
* Данный интерфейс не является потокобезопасным.
*/
public interface TableProvider {
/**
* Возвращает таблицу с указанным названием.
*
* Последовательные вызовы метода с одинаковыми аргументами должны возвращать один и тот же объект таблицы,
* если он не был удален с помощью {@link #removeTable(String)}.
*
* @param name Название таблицы.
* @return Объект, представляющий таблицу. Если таблицы с указанным именем не существует, возвращает null.
*
* @throws IllegalArgumentException Если название таблицы null или имеет недопустимое значение.
*/
Table getTable(String name);
/**
* Создаёт таблицу с указанным названием.
* Создает новую таблицу. Совершает необходимые дисковые операции.
*
* @param name Название таблицы.
* @param columnTypes Типы колонок таблицы. Не может быть пустой.
* @return Объект, представляющий таблицу. Если таблица с указанным именем существует, возвращает null.
*
* @throws IllegalArgumentException Если название таблицы null или имеет недопустимое значение. Если список типов
* колонок null или содержит недопустимые значения.
* @throws java.io.IOException При ошибках ввода/вывода.
*/
Table createTable(String name, List<Class<?>> columnTypes) throws IOException;
/**
* Удаляет существующую таблицу с указанным названием.
*
* Объект удаленной таблицы, если был кем-то взят с помощью {@link #getTable(String)},
* с этого момента должен бросать {@link IllegalStateException}.
*
* @param name Название таблицы.
*
* @throws IllegalArgumentException Если название таблицы null или имеет недопустимое значение.
* @throws IllegalStateException Если таблицы с указанным названием не существует.
* @throws java.io.IOException - при ошибках ввода/вывода.
*/
void removeTable(String name) throws IOException;
/**
* Преобразовывает строку в объект {@link Storeable}, соответствующий структуре таблицы.
*
* @param table Таблица, которой должен принадлежать {@link Storeable}.
* @param value Строка, из которой нужно прочитать {@link Storeable}.
* @return Прочитанный {@link Storeable}.
*
* @throws java.text.ParseException - при каких-либо несоответстиях в прочитанных данных.
*/
Storeable deserialize(Table table, String value) throws ParseException;
/**
* Преобразовывает объект {@link Storeable} в строку.
*
* @param table Таблица, которой должен принадлежать {@link Storeable}.
* @param value {@link Storeable}, который нужно записать.
* @return Строка с записанным значением.
*
* @throws ColumnFormatException При несоответствии типа в {@link Storeable} и типа колонки в таблице.
*/
String serialize(Table table, Storeable value) throws ColumnFormatException;
/**
* Создает новый пустой {@link Storeable} для указанной таблицы.
*
* @param table Таблица, которой должен принадлежать {@link Storeable}.
* @return Пустой {@link Storeable}, нацеленный на использование с этой таблицей.
*/
Storeable createFor(Table table);
/**
* Создает новый {@link Storeable} для указанной таблицы, подставляя туда переданные значения.
*
* @param table Таблица, которой должен принадлежать {@link Storeable}.
* @param values Список значений, которыми нужно проинициализировать поля Storeable.
* @return {@link Storeable}, проинициализированный переданными значениями.
* @throws ColumnFormatException При несоответствии типа переданного значения и колонки.
* @throws IndexOutOfBoundsException При несоответствии числа переданных значений и числа колонок.
*/
Storeable createFor(Table table, List<?> values) throws ColumnFormatException, IndexOutOfBoundsException;
/**
* Возвращает имена существующих таблиц, которые могут быть получены с помощью {@link #getTable(String)}.
*
* @return Имена существующих таблиц.
*/
List<String> getTableNames();
}
| [
"andrey_maksimov95@inbox.ru"
] | andrey_maksimov95@inbox.ru |
e67544cea045aac51686303d05c457d5a120db90 | 8935aacdc5e45a1617f7a652fa63b2054f51512e | /Actio/src/actio/app/functions/inappbilling/IabException.java | dd61b138c83a7cd38f55ba226a371339975c58a1 | [
"Apache-2.0"
] | permissive | onnoeberhard/actio | 069bc2d74632245c913702e317da511e394ad536 | ff70c35ee7e7c6984da3b2ce45e0a1d7db84ff24 | refs/heads/master | 2022-11-06T16:23:42.093261 | 2020-06-19T08:38:57 | 2020-06-19T08:38:57 | 113,752,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,499 | java | /* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package actio.app.functions.inappbilling;
/**
* Exception thrown when something went wrong with in-app billing.
* An IabException has an associated IabResult (an error).
* To get the IAB result that caused this exception to be thrown,
* call {@link #getResult()}.
*/
public class IabException extends Exception {
IabResult mResult;
public IabException(IabResult r) {
this(r, null);
}
public IabException(int response, String message) {
this(new IabResult(response, message));
}
public IabException(IabResult r, Exception cause) {
super(r.getMessage(), cause);
mResult = r;
}
public IabException(int response, String message, Exception cause) {
this(new IabResult(response, message), cause);
}
/** Returns the IAB result (error) that this exception signals. */
public IabResult getResult() { return mResult; }
} | [
"OnnoEberhard@gmail.com"
] | OnnoEberhard@gmail.com |
c363196eff82dafd4f1e472cebd99c2c03b04d61 | d5a2d1e9b8bdd73e2aebd5606433cf7637f5abce | /src/AplacacionEjecutaAplicacion.java | 02d3660b12ef2b54f5bac302d63b0e68c6d602bb | [] | no_license | Bohonalo/ProcesosJava | eb873b32e14ee0ffeeebb97ad0fda5de32ae71a3 | 4e714922bb758e539f01ec06cfbc4e9cf9fa9092 | refs/heads/master | 2021-07-13T07:22:21.356235 | 2017-10-10T18:29:44 | 2017-10-10T18:29:44 | 106,411,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class AplacacionEjecutaAplicacion {
public static void main(String[] args) {
// Aplicacion java ejecuta otra aplicacion java
Runtime r = Runtime.getRuntime();
Process p = null;
try {
p = r.exec("java -jar EjecucionComando2.jar");
InputStream is = p.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String linea;
while ((linea=br.readLine()) != null){
System.out.println(linea);
}
br.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"21639999@N209-06.alumnos.uem.es"
] | 21639999@N209-06.alumnos.uem.es |
b0e7e64293cf0633142f4d470f92c31ce36ae3ba | 08cbb7c4f9b0331035de8528a04346e49d47666f | /flexible-adapter-app/src/main/java/eu/davidea/samples/flexibleadapter/views/ProgressBar.java | 9579fb66b8df52859ef66905f5c8e51e350a24c2 | [
"Apache-2.0"
] | permissive | Datalinkdev/FlexibleAdapter | eeb793e002b9c89f822f2690e66cfad8ebab4c76 | 74a4fe316fdb8ebd0a326d1f5ebcb16e51430631 | refs/heads/master | 2020-12-02T21:07:14.615226 | 2017-07-03T11:03:48 | 2017-07-03T11:03:48 | 96,258,518 | 1 | 0 | null | 2017-07-04T23:10:03 | 2017-07-04T23:10:02 | null | UTF-8 | Java | false | false | 5,723 | java | package eu.davidea.samples.flexibleadapter.views;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Interpolator;
import eu.davidea.samples.flexibleadapter.R;
/**
* Procedurally-drawn version of a horizontal indeterminate progress bar. Draws faster and more
* frequently (by making use of the animation timer), requires minimal memory overhead, and allows
* some configuration via attributes:
* <ul>
* <li>barColor (color attribute for the bar's solid color)
* <li>barHeight (dimension attribute for the height of the solid progress bar)
* <li>detentWidth (dimension attribute for the width of each transparent detent in the bar)
* </ul>
* <p>
* This progress bar has no intrinsic height, so you must declare it with one explicitly. (It will
* use the given height as the bar's shadow height.)
*/
public class ProgressBar extends View {
private final ValueAnimator mAnimator;
private final Paint mPaint = new Paint();
private final int mBarColor;
private final int mSolidBarHeight;
private final int mSolidBarDetentWidth;
private final float mDensity;
private int mSegmentCount;
private GradientDrawable mShadow;
private boolean mUseShadow;
/**
* The baseline width that the other constants below are optimized for.
*/
private static final int BASE_WIDTH_DP = 300;
/**
* A reasonable animation duration for the given width above. It will be weakly scaled up and
* down for wider and narrower widths, respectively-- the goal is to provide a relatively
* constant detent velocity.
*/
private static final int BASE_DURATION_MS = 500;
/**
* A reasonable number of detents for the given width above. It will be weakly scaled up and
* down for wider and narrower widths, respectively.
*/
private static final int BASE_SEGMENT_COUNT = 5;
private static final int DEFAULT_BAR_HEIGHT_DP = 4;
private static final int DEFAULT_DETENT_WIDTH_DP = 3;
public ProgressBar(Context c) {
this(c, null);
}
public ProgressBar(Context c, AttributeSet attrs) {
super(c, attrs);
mDensity = c.getResources().getDisplayMetrics().density;
final TypedArray ta = c.obtainStyledAttributes(attrs, R.styleable.ProgressBar);
try {
mBarColor = ta.getColor(
R.styleable.ProgressBar_barColor,
c.getResources().getColor(android.R.color.holo_blue_light));
mSolidBarHeight = ta.getDimensionPixelSize(
R.styleable.ProgressBar_barHeight,
Math.round(DEFAULT_BAR_HEIGHT_DP * mDensity));
mSolidBarDetentWidth = ta.getDimensionPixelSize(
R.styleable.ProgressBar_detentWidth,
Math.round(DEFAULT_DETENT_WIDTH_DP * mDensity));
mUseShadow = ta.getBoolean(
R.styleable.ProgressBar_useShadow,
false);
} finally {
ta.recycle();
}
mAnimator = new ValueAnimator();
mAnimator.setFloatValues(1.0f, 2.0f);
mAnimator.setRepeatCount(ValueAnimator.INFINITE);
mAnimator.setInterpolator(new ExponentialInterpolator());
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
invalidate();
}
});
mPaint.setColor(mBarColor);
if (mUseShadow) {
mShadow = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM,
new int[]{(mBarColor & 0x00ffffff) | 0x22000000, 0});
}
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (changed) {
final int w = getWidth();
if (mUseShadow)
mShadow.setBounds(0, mSolidBarHeight, w, getHeight() - mSolidBarHeight);
final float widthMultiplier = w / mDensity / BASE_WIDTH_DP;
// simple scaling by width is too aggressive, so dampen it first
final float durationMult = 0.3f * (widthMultiplier - 1) + 1;
final float segmentMult = 0.1f * (widthMultiplier - 1) + 1;
mAnimator.setDuration((int) (BASE_DURATION_MS * durationMult));
mSegmentCount = (int) (BASE_SEGMENT_COUNT * segmentMult);
}
}
@Override
protected void onDraw(Canvas canvas) {
if (!mAnimator.isStarted()) return;
if (mUseShadow) mShadow.draw(canvas);
final float val = (Float) mAnimator.getAnimatedValue();
final int w = getWidth();
// Because the left-most segment doesn't start all the way on the left, and because it moves
// towards the right as it animates, we need to offset all drawing towards the left. This
// ensures that the left-most detent starts at the left origin, and that the left portion
// is never blank as the animation progresses towards the right.
final int offset = w >> mSegmentCount - 1;
// segments are spaced at half-width, quarter, eighth (powers-of-two). to maintain a smooth
// transition between segments, we used a power-of-two interpolator.
for (int i = 0; i < mSegmentCount; i++) {
final float l = val * (w >> (i + 1));
final float r = (i == 0) ? w + offset : l * 2;
canvas.drawRect(l + mSolidBarDetentWidth - offset, 0, r - offset, mSolidBarHeight,
mPaint);
}
}
@Override
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (visibility == VISIBLE) start();
else stop();
}
private void start() {
if (mAnimator == null) return;
mAnimator.start();
}
private void stop() {
if (mAnimator == null) return;
mAnimator.cancel();
}
private static class ExponentialInterpolator implements Interpolator {
@Override
public float getInterpolation(float input) {
return (float) Math.pow(2.0, input) - 1;
}
}
} | [
"dave.dna@gmail.com"
] | dave.dna@gmail.com |
7eac64ab4c4b60aea6f7aef1e4494bcd14a9a4e9 | c2f3ba8b991ecba3a2352ee7eb87285f3ae10d02 | /src/main/java/com/LMS/pages/AboutMenuPage/GCEAboutPage.java | 2ceb05f689ba6026d714852e046f8cfbd056d895 | [] | no_license | Sonal-Gulhane/BDD-Framework | c8eacdde306355ea72d3c13182e2aa82090c9268 | b934d0497bbe5961a9dffcfdbc1a731985f22dd2 | refs/heads/master | 2021-03-18T00:22:32.070671 | 2020-03-13T09:27:21 | 2020-03-13T09:27:21 | 247,030,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,236 | java | package com.LMS.pages.AboutMenuPage;
import cucumber.api.PendingException;
import cucumber.api.java.en.Then;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
import org.openqa.selenium.support.PageFactory;
public class GCEAboutPage {
private WebDriver driver;
public GCEAboutPage(WebDriver driver){
this.driver=driver;
PageFactory.initElements(driver,this);
}
@FindBy(how = How.CSS, using = ".nav-link[data-hash='#about']")
public WebElement webEleAboutMenu;
@FindBy(how = How.CSS, using = ".nav-link[href='service-model.html']")
public WebElement webEleServModelSubMenu;
@FindBy(how = How.CSS, using = ".nav-link[href='sustainability.html']")
public WebElement webEleSustanibilitySubMenu;
@FindBy(how = How.CSS, using = ".container.spacing-bottom h2")
public WebElement webEleServModelLabel;
@FindBy(how = How.CSS, using = "[href='procurement.html']")
public WebElement webEleLinkDoingBusiness;
@FindBy(how = How.CSS, using = "[href='assets/forms/1_GCE_Supplier_Code_of_Conduct.pdf']")
public WebElement webEleLinkSuppCodOfConduct;
}
| [
"sonal.gulhane@clairvoyantsoft.com"
] | sonal.gulhane@clairvoyantsoft.com |
580f20cc7908eb8cf5c7401488bbfb44f68e3d48 | 9ef55fbee88b456b8045c6a40eb784b1102ecde9 | /src/me/RafaelAulerDeMeloAraujo/SpecialAbility/TimelordCMD.java | 5b999464def1c7b822a519456d05d1230ae6ddba | [] | no_license | RAFAELESPADA/KP-PVP-Source-BUILD02 | df518dc19524e4d9c20c7b6a5c8a7c1aef588907 | fcd34c2d26170386bb9ad58af84db8fa852f6f04 | refs/heads/master | 2022-01-07T19:49:25.978917 | 2019-06-14T18:29:14 | 2019-06-14T18:29:14 | 115,665,031 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,077 | java | /* */ package me.RafaelAulerDeMeloAraujo.SpecialAbility;
/* */
/* */ import java.util.ArrayList;
/* */ import me.RafaelAulerDeMeloAraujo.TitleAPI.TitleAPI;
/* */ import me.RafaelAulerDeMeloAraujo.main.Main;
/* */ import org.bukkit.Material;
/* */ import org.bukkit.Sound;
/* */ import org.bukkit.command.Command;
/* */ import org.bukkit.command.CommandExecutor;
/* */ import org.bukkit.command.CommandSender;
/* */ import org.bukkit.configuration.file.FileConfiguration;
/* */ import org.bukkit.entity.Player;
/* */ import org.bukkit.inventory.ItemStack;
/* */ import org.bukkit.inventory.PlayerInventory;
/* */ import org.bukkit.inventory.meta.ItemMeta;
/* */
/* */ public class TimelordCMD implements CommandExecutor
/* */ {
/* */ private Main main;
/* */ static Main plugin;
/* */
/* */ public TimelordCMD(Main main)
/* */ {
/* 24 */ this.main = main;
/* 25 */ plugin = main;
/* */ }
/* */
/* */
/* */ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
/* */ {
/* 31 */ Player p = (Player)sender;
/* */
/* 33 */ if (cmd.getName().equalsIgnoreCase("timelord"))
/* */ {
/* 35 */ if (!Join.game.contains(p.getName()))
/* */ {
/* 37 */ p.sendMessage(String.valueOf(this.main.getConfig().getString("Prefix").replace("&", "§")) + " §eYou are not in kitpvp to do choose this kit!");
/* 38 */ return true;
/* */ }
/* 40 */ if (!p.hasPermission("kitpvp.kit.timelord"))
/* */ {
/* 42 */ p.sendMessage(String.valueOf(this.main.getConfig().getString("Prefix").replace("&", "§")) + this.main.getConfig().getString("Permission").replace("&", "§").replaceAll("%permisson%", commandLabel));
/* 43 */ p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.NoPermissionMessage")), 1.0F, 1.0F);
/* 44 */ return true;
/* */ }
/* */
/* 47 */ if (Habilidade.ContainsAbility(p)) {
/* 48 */ p.sendMessage(String.valueOf(this.main.getConfig().getString("Prefix").replace("&", "§")) + this.main.getConfig().getString("Message.KitUse").replace("&", "§"));
/* 49 */ p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.KitUse")), 1.0F, 1.0F);
/* 50 */ return true;
/* */ }
/* 52 */ p.getInventory().clear();
/* 53 */ ItemStack dima = new ItemStack(Material.DIAMOND_SWORD);
/* 54 */ ItemMeta souperaa = dima.getItemMeta();
/* 55 */ souperaa.setDisplayName("§cSword");
/* 56 */ dima.setItemMeta(souperaa);
/* 57 */ ItemStack sopa = new ItemStack(Material.MUSHROOM_SOUP);
/* 58 */ ItemMeta sopas = sopa.getItemMeta();
/* 59 */ sopas.setDisplayName("§6Soup");
/* 60 */ sopa.setItemMeta(sopas);
/* 61 */ ItemStack especial = new ItemStack(Material.WATCH);
/* 62 */ ItemMeta especial2 = especial.getItemMeta();
/* 63 */ especial2.setDisplayName("§bFreeze the Time!");
/* 64 */ especial.setItemMeta(especial2);
/* */
/* 66 */ ItemStack capacete0 = new ItemStack(Material.IRON_HELMET);
/* */
/* 68 */ ItemStack peitoral0 = new ItemStack(Material.IRON_CHESTPLATE);
/* */
/* 70 */ ItemStack calca0 = new ItemStack(Material.IRON_LEGGINGS);
/* */
/* 72 */ ItemStack Bota0 = new ItemStack(Material.IRON_BOOTS);
/* */
/* 74 */ p.getInventory().setHelmet(capacete0);
/* 75 */ p.getInventory().setChestplate(peitoral0);
/* 76 */ p.getInventory().setLeggings(calca0);
/* 77 */ p.getInventory().setBoots(Bota0);
/* */
/* 79 */ p.sendMessage(String.valueOf(this.main.getConfig().getString("Prefix").replace("&", "§")) + this.main.getConfig().getString("Message.Kit").replaceAll("%kit%", "TimeLord").replace("&", "§"));
/* 80 */ Habilidade.setAbility(p, "TimeLord");
/* 81 */ p.getInventory().addItem(new ItemStack[] { dima });
/* 82 */ p.getInventory().addItem(new ItemStack[] { especial });
/* */
/* */
/* */
/* 86 */ for (int i = 0; i <= 34; i++) {
/* 87 */ p.getInventory().addItem(new ItemStack[] { sopa });
/* 88 */ p.playSound(p.getLocation(), Sound.valueOf(this.main.getConfig().getString("Sound.KitUse")), 1.0F, 1.0F);
/* 89 */ TitleAPI.sendTitle(p, Integer.valueOf(5), Integer.valueOf(20), Integer.valueOf(5), this.main.getConfig().getString("Title.KitTitle"), this.main.getConfig().getString("Title.KitSubTitle").replaceAll("%kit%", "Timelord"));
/* */ }
/* */ }
/* */
/* 93 */ return false;
/* */ }
/* */ }
/* Location: D:\Desktop\video\Minhas Coisas do Desktop\KP-PVPvB12 (1).jar!\me\RafaelAulerDeMeloAraujo\SpecialAbility\TimelordCMD.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/
| [
"noreply@github.com"
] | noreply@github.com |
aef55e8402898e20fd62d6b0522ae0c43afb7f12 | 93acb59d6636ef310a8bc7256e4dcbc609c10783 | /secretmanager/src/main/java/com/example/ListSecretVersions.java | e2230a502858ac18e8f6a659eb691abed9919f66 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Luffyy213/java-docs-samples | a7af4e5ddbcfe5c2dd1a3a7126741526497001e2 | 9e0488246b98d859d260e845e9644c7e1b18c4f1 | refs/heads/master | 2021-02-05T14:24:21.788339 | 2020-02-28T00:01:27 | 2020-02-28T00:01:27 | 243,790,653 | 1 | 0 | Apache-2.0 | 2020-02-28T15:13:57 | 2020-02-28T15:13:56 | null | UTF-8 | Java | false | false | 2,487 | java | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example;
// [START secretmanager_list_secret_versions]
import com.google.cloud.secretmanager.v1beta1.ListSecretVersionsRequest;
import com.google.cloud.secretmanager.v1beta1.SecretManagerServiceClient;
import com.google.cloud.secretmanager.v1beta1.SecretManagerServiceClient.ListSecretVersionsPagedResponse;
import com.google.cloud.secretmanager.v1beta1.SecretName;
import java.io.IOException;
public class ListSecretVersions {
public void listSecretVersions() throws IOException {
// TODO(developer): Replace these variables before running the sample.
String projectId = "your-project-id";
String secretId = "your-secret-id";
listSecretVersions(projectId, secretId);
}
// List all secret versions for a secret.
public void listSecretVersions(String projectId, String secretId) throws IOException {
// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests. After completing all of your requests, call
// the "close" method on the client to safely clean up any remaining background resources.
try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) {
// Build the parent name.
SecretName parent = SecretName.of(projectId, secretId);
// Create the request.
ListSecretVersionsRequest request =
ListSecretVersionsRequest.newBuilder().setParent(parent.toString()).build();
// Get all versions.
ListSecretVersionsPagedResponse pagedResponse = client.listSecretVersions(request);
// List all versions and their state.
pagedResponse
.iterateAll()
.forEach(
version -> {
System.out.printf("Secret version %s, %s\n", version.getName(), version.getState());
});
}
}
}
// [END secretmanager_list_secret_versions]
| [
"noreply@github.com"
] | noreply@github.com |
6155e5377197ac76841e23db6d33903a3b1e1449 | f3a9235d41fc2efff1872f084398ec85a6ff0c23 | /Backend/Spring/empspringboot/EmpspringbootApplicationTests.java | 51fe669e6564d9d85227df797596632cb35d3721 | [] | no_license | Puesen/TY_CG_HTD_BANGALORENOVEMBER_JFS_SUSMITA | 2a9f3037fed7d9218352544de055b2796d033c69 | c786de83aaa3398bc80a775079b86a5fd664faaf | refs/heads/master | 2022-12-26T14:49:21.830915 | 2020-02-08T05:58:43 | 2020-02-08T05:58:43 | 225,846,358 | 0 | 0 | null | 2022-12-16T00:46:56 | 2019-12-04T11:02:14 | Java | UTF-8 | Java | false | false | 226 | java | package com.capgimini.empspringboot;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class EmpspringbootApplicationTests {
@Test
void contextLoads() {
}
}
| [
"susmitasen1006@gmail.com"
] | susmitasen1006@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.