blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
639d451656792512354f4c350966fba2fc74bb12 | d5c5cfe894ae5833918bd396c5bd01fc8a1a8ffa | /orig/fitlibrary/FitLibrary20100521/fitnesse/lib/src/rentEzSrc/rps/transactionItems/RentalTransactionItem.java | 962f4f2cdf6b6654ca667d00561cad1ea362e6c8 | [] | no_license | afamee/DbFit-deps | 80db2fc3919c30b900c01012788d293ea5e1c07c | 2610dfc6f4573e3eda3a8c68369d23b4571547da | refs/heads/master | 2020-04-02T18:28:37.519147 | 2015-07-11T13:55:42 | 2015-07-11T13:55:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,748 | java | package rps.transactionItems;
import rps.Rental;
import rps.RentalItemType;
import rps.Reservation;
import rps.paymentMethod.Money;
import rps.time.Duration;
import rps.time.MyDate;
import rps.transaction.ClientTransaction;
public class RentalTransactionItem extends ClientTransactionItem {
private /*final*/ Reservation reservation;
public RentalTransactionItem(ClientTransaction transaction, int count,
RentalItemType hireItemType, Duration duration) {
super(transaction);
Duration actualDuration = hireItemType.getRates().fairDuration(duration);
this.reservation = new Reservation(hireItemType, count, getStartDate(), actualDuration);
}
public boolean editRentalTransactionItem(int newCount, Duration newDuration){
int oldCount = reservation.getCount();
RentalItemType itemType = reservation.getHireItemType();
MyDate oldStartDate = reservation.getStartDate();
Duration oldDuration = reservation.getPeriod();
try{
this.reservation.removeAll();
this.reservation = new Reservation(itemType, newCount, oldStartDate, newDuration);
return true;
}catch(RuntimeException ex){
this.reservation = new Reservation(itemType, oldCount, oldStartDate, oldDuration);
return false;
}
}
public Money getTotalCost() {
return reservation.totalRentalCost();
}
public void complete() {
new Rental(reservation,getClient(),getStaffMember());
}
public boolean isSame(int count, RentalItemType hireItemType, Duration duration) {
return (reservation.getCount() == count
&& (reservation.getHireItemType().getName()).equals(hireItemType.getName())
&& reservation.getPeriod().equals(duration));
}
} | [
"[email protected]"
] | |
d2c64bac198b062180916ba8b455ae4af3e44040 | 5e5153f502292f8a5d3203d183342a08e98eb575 | /app/src/main/java/com/example/sirojiddinjumaev/niholeatit/Cart.java | aeb0edd4c8fae29d1fff147a67b4fad7625f7f55 | [] | no_license | JorisJD/Delivery-App-for-the-Client-Side | 4e5ee6b5cd8d7c728186c16a96bda6a279e6cb8a | abf572085e1b1ded2db9cb40c9e933130b8f5a4d | refs/heads/master | 2022-12-04T08:09:21.122366 | 2020-08-05T16:16:24 | 2020-08-05T16:24:03 | 285,333,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,937 | java | package com.example.sirojiddinjumaev.niholeatit;
import android.Manifest;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.location.Location;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.sirojiddinjumaev.niholeatit.Common.Common;
import com.example.sirojiddinjumaev.niholeatit.Database.Database;
import com.example.sirojiddinjumaev.niholeatit.Helper.RecyclerItemTouchHelper;
import com.example.sirojiddinjumaev.niholeatit.Interface.RecyclerItemTouchHelperListener;
import com.example.sirojiddinjumaev.niholeatit.Model.DataMessage;
import com.example.sirojiddinjumaev.niholeatit.Model.MyResponse;
import com.example.sirojiddinjumaev.niholeatit.Model.Order;
import com.example.sirojiddinjumaev.niholeatit.Model.Request;
import com.example.sirojiddinjumaev.niholeatit.Model.Token;
import com.example.sirojiddinjumaev.niholeatit.Remote.APIService;
import com.example.sirojiddinjumaev.niholeatit.Remote.IGoogleService;
import com.example.sirojiddinjumaev.niholeatit.ViewHolder.CartAdapter;
import com.example.sirojiddinjumaev.niholeatit.ViewHolder.CartViewHolder;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.libraries.places.api.Places;
import com.google.android.libraries.places.api.model.Place;
import com.google.android.libraries.places.api.net.PlacesClient;
import com.google.android.libraries.places.widget.AutocompleteSupportFragment;
import com.google.android.libraries.places.widget.listener.PlaceSelectionListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import com.rengwuxian.materialedittext.MaterialEditText;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
public class Cart extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener, RecyclerItemTouchHelperListener {
RecyclerView recyclerView;
RecyclerView.LayoutManager layoutManager;
FirebaseDatabase database;
DatabaseReference requests;
public TextView txtTotalPrice;
Button btnPlace;
List<Order> cart = new ArrayList<>();
CartAdapter adapter;
PlacesClient placesClient;
Place shippingAddress;
String address;
List<Place.Field> placeFields = Arrays.asList(Place.Field.ID,
Place.Field.NAME,
Place.Field.LAT_LNG,
Place.Field.ADDRESS);
AutocompleteSupportFragment autocompleteSupportFragment;
//Location
private LocationRequest mLocationRequest;
private GoogleApiClient mGoogleApiClient;
private Location mLastLocation;
private static final int UPDATE_INTERVAL = 5000;
private static final int FATEST_INTERVAL = 3000;
private static final int DISPLACEMENT = 10;
private static final int LOCATION_REQUEST_CODE = 9999;
private static final int PLAY_SERVICES_REQUEST = 9997;
//Declare Google Map API
IGoogleService mGoogleMapService;
APIService mService;
RelativeLayout rootLayout;
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Press ctrl+o
//Note: add this code before setContentView method
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/restaurant_font.ttf")
.setFontAttrId(R.attr.fontPath)
.build());
setContentView(R.layout.activity_cart);
//Init
mGoogleMapService =Common.getGoogleMapAPI();
rootLayout = (RelativeLayout) findViewById(R.id.rootLayout);
//Runtime Permission
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(this, new String []
{
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION
},LOCATION_REQUEST_CODE);
}
else
{
if (checkPlayServices()) //If have play services on device
{
buildGoogleApiClient();
createLocationRequest();
}
}
//init Service
mService = Common.getFCMService();
//Firebase
database = FirebaseDatabase.getInstance();
requests = database.getReference("Requests");
//init
recyclerView = (RecyclerView) findViewById(R.id.listCart);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
//Swipe to delete
ItemTouchHelper.SimpleCallback itemTouchHelperCallback = new RecyclerItemTouchHelper(0, ItemTouchHelper.LEFT, this);
new ItemTouchHelper(itemTouchHelperCallback).attachToRecyclerView(recyclerView);
txtTotalPrice = (TextView) findViewById(R.id.total);
btnPlace = (Button) findViewById(R.id.btnPlaceOrder);
btnPlace.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (cart.size()>0)
showAlertDialog();
else
Toast.makeText(Cart.this, "Your cart is empty !!!", Toast.LENGTH_SHORT).show();
}
});
loadListFood();
}
private void createLocationRequest() {
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(UPDATE_INTERVAL);
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
}
private synchronized void buildGoogleApiClient() {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API).build();
mGoogleApiClient.connect();
}
private boolean checkPlayServices() {
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS)
{
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode))
GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICES_REQUEST).show();
else
{
Toast.makeText(this, "This device is not supported", Toast.LENGTH_SHORT).show();
finish();
}
return false;
}
return true;
}
private void showAlertDialog() {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(Cart.this);
alertDialog.setTitle("One more step!");
alertDialog.setMessage("Enter your address: ");
LayoutInflater inflater = this.getLayoutInflater();
View order_address_comment = inflater.inflate(R.layout.order_address_comment, null);
// final MaterialEditText edtAddress = (MaterialEditText) order_address_comment.findViewById(R.id.edtAddress);
// PlaceAutocompleteFragment edtAddress = (PlaceAutocompleteFragment)getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
//
// //Hide Search Icon before fragment
// edtAddress.getView().findViewById(R.id.place_autocomplete_search_button).setVisibility(View.GONE);
//
// //Set Hint for AutoComplete EditText
// ((EditText)edtAddress.getView().findViewById(R.id.place_autocomplete_search_input))
// .setHint("Enter your address");
// //Set Text size
// ((EditText)edtAddress.getView().findViewById(R.id.place_autocomplete_search_input))
// .setTextSize(14);
//
// //Get address from Place AutoComplete
// edtAddress.setOnPlaceSelectedListener(new PlaceSelectionListener() {
// @Override
// public void onPlaceSelected(Place place) {
// shippingAddress =place;
//
// }
//
// @Override
// public void onError(Status status) {
// Log.e("ERROR", status.getStatusMessage());
//
// }
// });
initPlaces();
setupPlaceAutocomplete();
final MaterialEditText edtComment= order_address_comment.findViewById(R.id.edtComment);
//Radio Button
final RadioButton rdiShipToAddress = (RadioButton) order_address_comment.findViewById(R.id.rdiShipToAddress);
final RadioButton rdiHomeAddress = (RadioButton) order_address_comment.findViewById(R.id.rdiHomeAddress);
//Radio Button
final RadioButton rdiCOD = (RadioButton) order_address_comment.findViewById(R.id.rdiCOD);
//Event Radio
rdiHomeAddress.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b)
{
if (Common.currentUser.getHomeAddress() != null ||
!TextUtils.isEmpty(Common.currentUser.getHomeAddress()))
{
address=Common.currentUser.getHomeAddress();
((EditText)autocompleteSupportFragment.getView().findViewById(R.id.places_autocomplete_search_input)).setText(address);
}
else
{
Toast.makeText(Cart.this, "Please Update your Home Address", Toast.LENGTH_SHORT).show();
}
}
}
});
rdiShipToAddress.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) //b==true
{
mGoogleMapService.getAddressName(String.format("https://maps.googleapis.com/maps/api/geocode/json?latlng="+mLastLocation.getLatitude()+","+mLastLocation.getLongitude()+"&sensor=false",
mLastLocation.getLatitude(),
mLastLocation.getLongitude()))
.enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
//If fetch API ok
try {
JSONObject jsonObject = new JSONObject(response.body());
JSONArray resultsArray = jsonObject.getJSONArray("results");
JSONObject firstObject = resultsArray.getJSONObject(0);
address = firstObject.getString("formatted_address");
//Set this address to edtAddress
((EditText)autocompleteSupportFragment.getView().findViewById(R.id.places_autocomplete_search_input)).setText(address);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Toast.makeText(Cart.this, ""+t.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
});
// final MaterialEditText edtComment = (MaterialEditText) order_address_comment.findViewById(R.id.edtComment);
alertDialog.setView(order_address_comment);
alertDialog.setIcon(R.drawable.ic_shopping_cart_black_24dp);
alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
//Add check Condition here
//If user select address from Place fragment, just use it
//If user select Ship to this address, get Address rom location and use it
//If user select Home Address, get Home Address from Profile and use it
if (!rdiShipToAddress.isChecked()&& !rdiHomeAddress.isChecked()){
//If both radio is not selected ->
if (shippingAddress != null)
{
address = shippingAddress.getAddress().toString();
}
else
{
Toast.makeText(Cart.this, "Please Enter Address or select option address", Toast.LENGTH_SHORT).show();
//Fix crash Fragment
getSupportFragmentManager().beginTransaction()
.remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
.commit();
return;
}
}
if (TextUtils.isEmpty(address))
{
Toast.makeText(Cart.this, "Please Enter Address or select option address", Toast.LENGTH_SHORT).show();
//Fix crash Fragment
getSupportFragmentManager().beginTransaction()
.remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
.commit();
return;
}
//Check Payment
if (!rdiCOD.isChecked()) //If Delivery Method not choosen
{
Toast.makeText(Cart.this, "Please Select Payment option", Toast.LENGTH_SHORT).show();
//Fix crash Fragment
getSupportFragmentManager().beginTransaction()
.remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
.commit();
return;
}
else if(rdiCOD.isChecked())
{
//Copy code from onActivityResult
//Create new request
Request request = new Request(
Common.currentUser.getPhone(),
Common.currentUser.getName(),
address,
txtTotalPrice.getText().toString(),
"0", //status
edtComment.getText().toString(),
"COD",
String.format("%s, %s",mLastLocation.getLatitude(), mLastLocation.getLongitude()),
cart
);
//Submit to Firebase
//We will using System.CurrentMilli to key
String order_number = String.valueOf(System.currentTimeMillis());
requests.child(order_number).setValue(request);
//Delete cart
new Database(getBaseContext()).cleanCart(Common.currentUser.getPhone());
sendNotificationOrder(order_number);
// getSupportFragmentManager().beginTransaction()
// .remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
// .commit();
Toast.makeText(Cart.this, "Thank you, Order Place", Toast.LENGTH_SHORT).show();
finish();
}
//Create new request
Request request = new Request(
Common.currentUser.getPhone(),
Common.currentUser.getName(),
address,
txtTotalPrice.getText().toString(),
"0", //status
edtComment.getText().toString(),
"COD",
String.format("%s, %s",mLastLocation.getLatitude(), mLastLocation.getLongitude()),
cart
);
//Submit to Firebase
//We will using System.CurrentMilli to key
String order_number = String.valueOf(System.currentTimeMillis());
requests.child(order_number).setValue(request);
//Delete cart
new Database(getBaseContext()).cleanCart(Common.currentUser.getPhone());
sendNotificationOrder(order_number);
getSupportFragmentManager().beginTransaction()
.remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
.commit();
// Toast.makeText(Cart.this, "Thank you, Order Place", Toast.LENGTH_SHORT).show();
// finish();
}
});
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
getSupportFragmentManager().beginTransaction()
.remove(getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment))
.commit();
dialogInterface.dismiss();
}
});
alertDialog.show();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode)
{
case LOCATION_REQUEST_CODE:
{
if (grantResults.length> 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
{
if (checkPlayServices()) //If have play services on device
{
buildGoogleApiClient();
createLocationRequest();
}
}
}
break;
}
}
private void sendNotificationOrder(final String order_number) {
DatabaseReference tokens = FirebaseDatabase.getInstance().getReference("Tokens");
final Query data = tokens.orderByChild("serverToken").equalTo(true);
data.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot postSnapshot:dataSnapshot.getChildren())
{
Token serverToken = postSnapshot.getValue(Token.class);
//create raw payload to send
// Notification notification = new Notification("Nihol company", "You have new order"+order_number);
// Sender content = new Sender(serverToken.getToken(), notification);
Map<String, String> dataSend = new HashMap<>();
dataSend.put("title", "Nihol company");
dataSend.put("message", "You have new order"+order_number);
DataMessage dataMessage = new DataMessage(serverToken.getToken(), dataSend);
mService.sendNotification(dataMessage)
.enqueue(new Callback<MyResponse>() {
@Override
public void onResponse(Call<MyResponse> call, Response<MyResponse> response) {
//Only run when get result
if (response.code() == 200) {
if (response.body().success == 1) {
Toast.makeText(Cart.this, "Thank you, Order Place", Toast.LENGTH_SHORT).show();
finish();
} else {
Toast.makeText(Cart.this, "Failed!", Toast.LENGTH_SHORT).show();
}
}
}
@Override
public void onFailure(Call<MyResponse> call, Throwable t) {
Log.e("ERROR", t.getMessage());
}
});
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void loadListFood() {
cart = new Database(this).getCarts(Common.currentUser.getPhone());
adapter = new CartAdapter(cart,this);
adapter.notifyDataSetChanged();
recyclerView.setAdapter(adapter);
//Calculate Total Price
int total=0;
for (Order order:cart)
total+=(Integer.parseInt(order.getPrice()))*(Integer.parseInt(order.getQuantity()));
Locale locale = new Locale("en", "US");
NumberFormat fmt = NumberFormat.getCurrencyInstance(locale);
txtTotalPrice.setText(fmt.format(total));
}
@Override
public boolean onContextItemSelected(MenuItem item) {
if (item.getTitle().equals(Common.DELETE))
deleteCart(item.getOrder());
return true;
}
private void deleteCart(int position) {
//we will remove item at List<Order> by position
cart.remove(position);
//After that, we will delete all old data from SQLITE
new Database(this).cleanCart(Common.currentUser.getPhone());
//And final, we will upload new data from list<Order> SQLITE
for (Order item:cart)
new Database(this).addToCart(item);
//Refresh
loadListFood();
}
private void setupPlaceAutocomplete() {
autocompleteSupportFragment =(AutocompleteSupportFragment)getSupportFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
//hide search icon before fragment
autocompleteSupportFragment.getView().findViewById(R.id.places_autocomplete_search_button).setVisibility(View.GONE);
//set hint for autocomplete EditText
((EditText)autocompleteSupportFragment.getView().findViewById(R.id.places_autocomplete_search_input)).setHint("Enter your Address");
//set Text size
((EditText)autocompleteSupportFragment.getView().findViewById(R.id.places_autocomplete_search_input)).setTextSize(14);
autocompleteSupportFragment.setPlaceFields(placeFields);
autocompleteSupportFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
@Override
public void onPlaceSelected(@NonNull Place place) {
shippingAddress = place;
}
@Override
public void onError(@NonNull Status status) {
Toast.makeText(Cart.this,""+status.getStatusMessage(),Toast.LENGTH_LONG).show();
}
});
}
private void initPlaces() {
//copy your api to string.xml
Places.initialize(this,getString(R.string.google_place_api));
placesClient = Places.createClient(this);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onConnected(@Nullable Bundle bundle) {
displayLocation();
startLocationUpdates();
}
private void startLocationUpdates() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
{
return;
}
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
}
private void displayLocation() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
{
return;
}
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if (mLastLocation != null)
{
Log.d("Location", "Your Location : "+mLastLocation.getLatitude()+","+mLastLocation.getLongitude());
}
else
{
Log.d("Location", "Could not get your Location");
}
}
@Override
public void onConnectionSuspended(int i) {
mGoogleApiClient.connect();
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
@Override
public void onLocationChanged(Location location) {
mLastLocation = location;
displayLocation();
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction, int position) {
if (viewHolder instanceof CartViewHolder)
{
String name = ((CartAdapter)recyclerView.getAdapter()).getItem(viewHolder.getAdapterPosition()).getProductName();
final Order deleteItem = ((CartAdapter)recyclerView.getAdapter()).getItem(viewHolder.getAdapterPosition());
final int deleteIndex = viewHolder.getAdapterPosition();
adapter.removeItem(deleteIndex);
new Database(getBaseContext()).removeFromCart(deleteItem.getProductId(), Common.currentUser.getPhone());
//Update txttotal
//Calculate Total Price
int total=0;
List<Order> orders = new Database(getBaseContext()).getCarts(Common.currentUser.getPhone());
for (Order item:orders)
total+=(Integer.parseInt(item.getPrice()))*(Integer.parseInt(item.getQuantity()));
Locale locale = new Locale("en", "US");
NumberFormat fmt = NumberFormat.getCurrencyInstance(locale);
txtTotalPrice.setText(fmt.format(total));
//Make Snackbar
Snackbar snackbar = Snackbar.make(rootLayout, name+" removed from cart!", Snackbar.LENGTH_LONG);
snackbar.setAction("UNDO", new View.OnClickListener() {
@Override
public void onClick(View v) {
adapter.restoreItem(deleteItem, deleteIndex);
new Database(getBaseContext()).addToCart(deleteItem);
//Update txttotal
//Calculate Total Price
int total=0;
List<Order> orders = new Database(getBaseContext()).getCarts(Common.currentUser.getPhone());
for (Order item:orders)
total+=(Integer.parseInt(item.getPrice()))*(Integer.parseInt(item.getQuantity()));
Locale locale = new Locale("en", "US");
NumberFormat fmt = NumberFormat.getCurrencyInstance(locale);
txtTotalPrice.setText(fmt.format(total));
}
});
snackbar.setActionTextColor(Color.YELLOW);
snackbar.show();
}
}
}
| [
"[email protected]"
] | |
017ca63028f83f5d1cbe486347893f83ce8f058b | 8ad9410c1553cc59965028740fb004a4dafac671 | /code/boss-gyl-web/target/tomcat/work/localEngine/localhost/boss-gyl-web/org/apache/jsp/WEB_002dINF/views/approveContract/approveContractIndex_jsp.java | e43ba050dfca679cb440d1d052c40335bb90a104 | [] | no_license | zhulihuaaaaa/mgl | d0600a625bff8b2fe4c1f2eab787af90e2c624a9 | 48287560390ee96a00453e9a87cc7726cda33e11 | refs/heads/main | 2023-04-20T05:13:35.796456 | 2021-05-09T12:53:18 | 2021-05-09T12:53:18 | 365,750,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 61,251 | java | package org.apache.jsp.WEB_002dINF.views.approveContract;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
public final class approveContractIndex_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
static {
_jspx_dependants = new java.util.ArrayList(7);
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/head.jsp");
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/./include.jsp");
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/./../include/basePath.jsp");
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/navgation.jsp");
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/left_menu.jsp");
_jspx_dependants.add("/WEB-INF/views/approveContract/../include/footer.jsp");
_jspx_dependants.add("/WEB-INF/custom_common.tld");
}
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.release();
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("<!DOCTYPE html>\r\n");
out.write("<html lang=\"en\">\r\n");
out.write("<head>\r\n");
out.write("\r\n");
out.write("<head>\r\n");
out.write("<meta charset=\"utf-8\">\r\n");
out.write("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge, chrome=1\">\r\n");
out.write("<meta name=\"renderer\" content=\"webkit\">\r\n");
out.write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\r\n");
out.write("<meta content=\"telephone=no\" name=\"format-detection\">\r\n");
out.write("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\r\n");
out.write("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">\r\n");
out.write("<meta name=\"keywords\" content=\"买钢乐,erp,不锈钢,钢铁,电商\">\r\n");
out.write("<meta name=\"description\" content=\"买钢乐客源系统\">\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
String path=request.getContextPath();/* 获取当前的系统路径 */
out.write('\r');
out.write('\n');
if (_jspx_meth_c_005fset_005f0(_jspx_page_context))
return;
out.write("<!--输当前所在的项目名称 -->\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!--å¼åç¸å
³å¾çå°å -->\r\n");
if (_jspx_meth_c_005fset_005f1(_jspx_page_context))
return;
out.write('\r');
out.write('\n');
if (_jspx_meth_c_005fset_005f2(_jspx_page_context))
return;
out.write("\r\n");
out.write("<!--æµè¯ç¸å
³å¾çå°å -->\r\n");
out.write("\r\n");
out.write("<!--æ£å¼ç¸å
³å¾çå°å -->\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<script type=\"text/javascript\">\r\n");
out.write("var showGylImage = \"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${fileUrlBase}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write('/');
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${gylImageUrl}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\";\r\n");
out.write("</script>");
out.write("\r\n");
out.write("\r\n");
out.write("<!-- MglUI core CSS -->\r\n");
out.write("<link rel=\"icon\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/images/favicon.png\">\r\n");
out.write("<link href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/css/mgl-style.css\" rel=\"stylesheet\" charset=\"utf-8\">\r\n");
out.write("<link href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/plugin/elementui/index.css\" rel=\"stylesheet\" charset=\"utf-8\">\r\n");
out.write("<link href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/css/gyl-style.css\" rel=\"stylesheet\" charset=\"utf-8\">\r\n");
out.write("\r\n");
out.write("<!-- HTML5shiv 和 Respond.js IE9支持HTML5 tooltipss和媒体查询 -->\r\n");
out.write("<!--[if lt IE 9]>\r\n");
out.write(" <script src=\"http://cdn.maigangle.com/js/common/html5.js\"></script>\r\n");
out.write("<![endif]-->");
out.write("\r\n");
out.write("<script>\r\n");
out.write(" // 百度统计\r\n");
out.write(" var _hmt = _hmt || [];\r\n");
out.write(" (function() {\r\n");
out.write(" var hm = document.createElement(\"script\");\r\n");
out.write(" hm.src = \"https://hm.baidu.com/hm.js?be559848fda14738459ab27a4db1be48\";\r\n");
out.write(" var s = document.getElementsByTagName(\"script\")[0];\r\n");
out.write(" s.parentNode.insertBefore(hm, s);\r\n");
out.write(" })();\r\n");
out.write("</script>\r\n");
out.write("</head>");
out.write("\r\n");
out.write("<title>待审批合同管理</title>\r\n");
out.write("</head>\r\n");
out.write("<body>\r\n");
out.write("\t<div id='slideEidt'></div>\r\n");
out.write("\t<section id=\"container\">\r\n");
out.write("\t\t<!--header start-->\r\n");
out.write("\t\t");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!--header start-->\r\n");
out.write("<header class=\"ui-header ui-header-positive clearfix\">\r\n");
out.write("\t<script type=\"text/javascript\">\r\n");
out.write(" \tfunction changeUrl(uiasUrl,code){\r\n");
out.write(" \t\tvar URL = uiasUrl+\"/auth/setCookie\";\r\n");
out.write(" \t\t//JSON跨域解决getScript动态添加脚本 \r\n");
out.write(" \t\t$.ajax({\r\n");
out.write(" \t\t\ttype : \"get\",\r\n");
out.write(" \t\t\tasync : false,\r\n");
out.write(" \t\t\turl : URL,\r\n");
out.write(" \t\t\tdataType : \"jsonp\",\r\n");
out.write(" \t\t\tjsonp : \"systemCode\",\r\n");
out.write(" \t\t\tjsonpCallback : code,\r\n");
out.write(" \t\t\tsuccess : function(json) {\r\n");
out.write(" \t\t\t\twindow.location = uiasUrl;\r\n");
out.write(" \t\t\t}\r\n");
out.write(" \t\t});\t\r\n");
out.write(" \t}\r\n");
out.write(" </script>\r\n");
out.write("\t<div class=\"ui-col ui-col-20\">\r\n");
out.write("\t\t<h2 class=\"logo\">\r\n");
out.write("\t\t\t<a href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/main\">BOSS管理系统</a>\r\n");
out.write("\t\t</h2>\r\n");
out.write("\t</div>\r\n");
out.write("\t<div class=\"ui-col ui-col-60\">\r\n");
out.write("\t\t<ul class=\"header-nav-sys\">\r\n");
out.write("\t\t\t");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t</div>\r\n");
out.write("\t<div class=\"ui-col ui-col-80\">\r\n");
out.write("\t\t<ul class=\"top-menu pull-right\">\r\n");
out.write("\t\t\t<li>\r\n");
out.write("\t\t\t\t<a class=\"menu-down\" href=\"javascript:;\"><i class=\"icon-people\"></i>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${loginName}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</a>\r\n");
out.write("\t\t\t\t<div class=\"dropdown-menu\">\r\n");
out.write("\t\t\t\t\t<a href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${uiasUrl}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/auth/edPwdShow\">修改密码</a>\r\n");
out.write("\t\t\t\t\t<a href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${uiasUrl}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/auth/logout\">退出</a>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t</li>\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t</div>\r\n");
out.write("</header>");
out.write("\r\n");
out.write("\t\t<!--header end-->\r\n");
out.write("\r\n");
out.write("\t\t<!--sidebar start-->\r\n");
out.write("\t\t");
out.write("\r\n");
out.write("\r\n");
out.write("<!--sidebar start-->\r\n");
out.write("<div class=\"ui-sidebar ui-sidebar-positive sidebar-scroll\"\r\n");
out.write("\tid=\"sidebar-menu\">\r\n");
out.write("\t<div class=\"sidebar-toggle\">\r\n");
out.write("\t\t<i class=\"icon-sanshuxian\"></i>\r\n");
out.write("\t</div>\r\n");
out.write("\t<!-- sidebar menu start-->\r\n");
out.write("\t<ul class=\"sidebar-menu\">\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/contract/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>合同管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/approveContract/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>待审批合同管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/contractBalance/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>合同对账信息</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/instockBill/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>入库管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/stock/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>库存管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/checkInv/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>库存盘点</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/invoice/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>发票管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/stockFinancial/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>金融库存管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/stockStorekeeper/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>仓管库存管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<!-- 交收管理下的列表 -->\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/settle/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>验货单查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/financial/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>金融货物信息审核</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/settleAudit/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>结算货物信息审核</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/warranty/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>质保书查询</span>\r\n");
out.write("<!-- \t\t</a></li> -->\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/redRedeemBill/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-photogallery\"></i> <span>赎货单查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/redRedeemBillFinance/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-photogallery\"></i> <span>金融赎货申请审核</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/redRedeemBillBalance/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-photogallery\"></i> <span>结算赎货申请审核</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/outstockBill/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>提货单管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/outstockBills/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>提货委托单管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/approveOutstock/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>待审批提货单管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/approveOutstocks/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>待审批提货委托单管理</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/finance/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>财务单查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/balance/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>余额查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/deposit/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>保证金查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseInfo/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>基础信息设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseProduct/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>品类设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseCost/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>手续费设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseCosts/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>开票费设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseMargin/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>保证金设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseCompany/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>甲方设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/baseApproval/main\"> <i\r\n");
out.write("\t\t\t\tclass=\"icon-iconxuexisel\"></i> <span>审批流程设置</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/overdue/main\"> <i\r\n");
out.write("\t\t\tclass=\"icon-iconxuexisel\"></i> <span>逾期合同查询</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/overdueApply/main\"> <i\r\n");
out.write("\t\t\tclass=\"icon-iconxuexisel\"></i> <span>逾期延期审核</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t\t<li><a class=\"ui-arrowadd drop\" href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/feeFinalReport/main\"> <i\r\n");
out.write("\t\t\tclass=\"icon-iconxuexisel\"></i> <span>期末期初报表</span>\r\n");
out.write("\t\t</a></li>\r\n");
out.write("\t</ul>\r\n");
out.write("\t<!-- sidebar menu end-->\r\n");
out.write("</div>\r\n");
out.write("<!--sidebar end-->\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t\t<!--sidebar end-->\r\n");
out.write("\r\n");
out.write("\t\t<section class=\"main-content\" v-cloak>\r\n");
out.write("\t\t\t<footer class=\"warp-footer\"></footer>\r\n");
out.write("\t\t\t<section class=\"wrapper\">\r\n");
out.write("\t\t\t\t<div class=\"ui-row\">\r\n");
out.write("\t\t\t\t\t<!-- title start -->\r\n");
out.write("\t\t\t\t\t<div class=\"panel-tit clearfix\">\r\n");
out.write("\t\t\t\t\t\t<div class=\"ui-col-50 ui-pt6\">\r\n");
out.write("\t\t\t\t\t\t\t<label>待审批合同管理</label>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t<!-- title end -->\r\n");
out.write("\t\t\t\t\t<div class=\"panel-control clearfix\">\r\n");
out.write("\t\t\t\t\t\t<div class=\"search-opt ui-pw20 ui-col\">\r\n");
out.write("\t\t\t\t\t\t\t<div class=\"ui-col ui-mb16\">\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"ui-col col-240 ui-border-r\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<label class=\"ui-col-10 tip-label\">业务类型:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"ui-col-70\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160\">\r\n");
out.write("\t\t <component-select v-model=\"searchParam.dto.contractType\" type=\"BusinessType\" @change=\"fetchData()\">\r\n");
out.write(" \t</component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"ui-col col-240 ui-ml28\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<button type=\"button\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tclass=\"ui-btn btn-opt-link btn-opt-screen\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class=\"icon-paixujiang\"></i>筛选\r\n");
out.write("\t\t\t\t\t\t\t\t\t</button>\r\n");
out.write("\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t<div class=\"ui-col search-criter ui-hidden\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"ui-col-90\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">合同自编号</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t <component-select v-model=\"searchParam.dto.contractId\" type=\"contractCode\" :search=\"true\" :remoteseach=\"true\">\r\n");
out.write(" \t\t\t </component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">合同编号</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<component-select v-model=\"searchParam.dto.contractId\" type=\"contractNum\" :search=\"true\">\r\n");
out.write(" \t\t\t </component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">甲方:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t<component-select v-model=\"searchParam.dto.sellerId\" type=\"PartyA\" :search=\"true\">\r\n");
out.write("\t \t</component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">乙方:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t<component-select v-model=\"searchParam.dto.buyerId\" type=\"crmClients\" :search=\"true\" :remoteseach=\"true\" >\r\n");
out.write("\t \t</component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">供应方:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr12 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t <component-select v-model=\"searchParam.dto.mallMnfct\" type=\"mallMnfcts\" >\r\n");
out.write("\t \t</component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">合约状态:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t <component-select v-model=\"searchParam.dto.contractState\" type=\"ContractBillState\" >\r\n");
out.write("\t \t</component-select>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group pull-left\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">签订日期:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr12 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"searchParam.dto.startSignDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\tclass=\"ui-input-control daterange-start\" placeholder=\"起始时间\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr24 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"searchParam.dto.endSignDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\tclass=\"ui-input-control daterange-end\" placeholder=\"结束时间\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<div class=\"ui-form-group\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<label class=\"ui-label-control pull-left\">创建日期:</label>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr12 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"searchParam.dto.startCreateDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"ui-input-control daterange-start1\" placeholder=\"起始时间\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<div class=\"ui-col col-160 ui-mr12 ui-ml4\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"searchParam.dto.endCreateDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t\tclass=\"ui-input-control daterange-end1\" placeholder=\"结束时间\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<div class=\"ui-col-10 ui-txt-right\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<button type=\"button\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tclass=\"ui-btn ui-btn-primary btn-search-data\" @click=\"fetchData()\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class=\"icon-sousuo\"></i>搜索\r\n");
out.write("\t\t\t\t\t\t\t\t\t</button>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t\t</div>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t<div class=\"ui-col slide-overflow\">\r\n");
out.write("\t\t\t\t\t\t\t<div class=\"main-cnt-scroll\">\r\n");
out.write("\t\t\t\t\t\t\t\t<component-table\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tid=\"contractIndex\" \r\n");
out.write("\t\t\t\t\t\t\t\t\t\t@fetch-data=\"fetchData\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t@detail=\"detail\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:data=\"tableData\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\trow-key=\"contractId\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:loading=\"tableConfig.loading\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:columns=\"tableConfig.columns\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:operation=\"tableConfig.operation\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmodule=\"contract\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:pagination=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"contractCode\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"合同自编号\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"contractNo\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"合同编号\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"signDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"签订日期\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"contractType\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"业务类型\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ scope.row.contractTypeName }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"seller.companyName\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"甲方\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"buyer.clientName\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"乙方\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"供应方\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ scope.row.mnfct != null ? scope.row.mnfct.mnfctName : '' }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"contractState\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"合约状态\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ scope.row.contractStateName }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"货物总重量(吨)\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\twidth=\"180\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ util.formatNumber((scope.row.totalWeight / 1000), 3) }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"货物总价(万)\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"160\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ util.formatNumber((scope.row.totalMoney / 10000), 2) }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"保证金(万)\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t\t{{ util.formatNumber((scope.row.depositFee / 10000), 2) }}\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t</template>\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t</el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"contractPeriod\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"合同期限(天)\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"140\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"createUser\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"创建人\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<el-table-column\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tprop=\"createDate\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tsortable=\"custom\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tlabel=\"创建时间\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\tmin-width=\"120\"\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t:show-overflow-tooltip=\"true\"></el-table-column>\r\n");
out.write("\t\t\t\t\t\t\t\t</component-table>\r\n");
out.write("\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t</section>\r\n");
out.write("\t\t</section>\r\n");
out.write("\t</section>\r\n");
out.write("</body>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!-- mgljs -->\r\n");
out.write("<script>\r\n");
out.write("var ctx = '");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("';\r\n");
out.write("</script>\r\n");
out.write("\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/mgljs/app/util.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/plugin/vue/vue.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/plugin/elementui/index.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/mgljs/require.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/mgljs/config.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/js/common/mgui.js\"></script>\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/js/common/gyl-common.js\"></script>\r\n");
out.write("<!-- 快速新建 -->\r\n");
out.write('\r');
out.write('\n');
out.write("\r\n");
out.write("\r\n");
out.write("<!-- 私有JS -->\r\n");
out.write("<script src=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("/js/approveContract/approveContractIndex.js\"></script>\r\n");
out.write("\r\n");
out.write("<!-- 模块部分公用js -->\r\n");
out.write("\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fset_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f0.setParent(null);
// /WEB-INF/views/approveContract/../include/./include.jsp(8,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setVar("ctx");
// /WEB-INF/views/approveContract/../include/./include.jsp(8,0) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setValue(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/approveContract/../include/./include.jsp(8,0) '${pageContext.request.contextPath}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${pageContext.request.contextPath}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return false;
}
private boolean _jspx_meth_c_005fset_005f1(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f1 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f1.setParent(null);
// /WEB-INF/views/approveContract/../include/./../include/basePath.jsp(4,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f1.setVar("fileUrlBase");
// /WEB-INF/views/approveContract/../include/./../include/basePath.jsp(4,0) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f1.setValue(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/approveContract/../include/./../include/basePath.jsp(4,0) 'http://192.168.8.206'",_el_expressionfactory.createValueExpression("http://192.168.8.206",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int _jspx_eval_c_005fset_005f1 = _jspx_th_c_005fset_005f1.doStartTag();
if (_jspx_th_c_005fset_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f1);
return false;
}
private boolean _jspx_meth_c_005fset_005f2(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f2 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f2.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f2.setParent(null);
// /WEB-INF/views/approveContract/../include/./../include/basePath.jsp(5,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f2.setVar("gylImageUrl");
// /WEB-INF/views/approveContract/../include/./../include/basePath.jsp(5,0) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f2.setValue(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/approveContract/../include/./../include/basePath.jsp(5,0) 'devgyl'",_el_expressionfactory.createValueExpression("devgyl",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
int _jspx_eval_c_005fset_005f2 = _jspx_th_c_005fset_005f2.doStartTag();
if (_jspx_th_c_005fset_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f2);
return true;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f2);
return false;
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /WEB-INF/views/approveContract/../include/navgation.jsp(31,3) name = items type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems(new org.apache.jasper.el.JspValueExpression("/WEB-INF/views/approveContract/../include/navgation.jsp(31,3) '${privSystem}'",_el_expressionfactory.createValueExpression(_jspx_page_context.getELContext(),"${privSystem}",java.lang.Object.class)).getValue(_jspx_page_context.getELContext()));
// /WEB-INF/views/approveContract/../include/navgation.jsp(31,3) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("item");
// /WEB-INF/views/approveContract/../include/navgation.jsp(31,3) name = varStatus type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVarStatus("status");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t<li>\r\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_c_005fif_005f0(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t");
if (_jspx_meth_c_005fif_005f1(_jspx_th_c_005fforEach_005f0, _jspx_page_context, _jspx_push_body_count_c_005fforEach_005f0))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t<a href=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item.systemUrl}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" onclick=\"changeUrl('");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${uiasUrl}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write('\'');
out.write(',');
out.write('\'');
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item.systemCode}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("')\">");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item.systemName}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</a>\r\n");
out.write("\t\t\t\t</li>\r\n");
out.write("\t\t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_0026_005fvarStatus_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/views/approveContract/../include/navgation.jsp(33,5) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item.systemCode == 'CRM'}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null, false)).booleanValue());
int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t<i class=\"ico-crm-sprite ico-crm-sys\"></i>\r\n");
out.write("\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
return false;
}
private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_005fforEach_005f0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_005fforEach_005f0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fif_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_005fforEach_005f0);
// /WEB-INF/views/approveContract/../include/navgation.jsp(36,5) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fif_005f1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item.systemCode == 'SETTLEMENT'}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null, false)).booleanValue());
int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag();
if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t<i class=\"ico-crm-sprite ico-settle-sys\"></i> \r\n");
out.write("\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
return false;
}
}
| [
"417886896"
] | 417886896 |
0651a71ed0f77b54ff1d7d8e400f0ce4fbd7a703 | e102f765b105640fa20450ad58db482a27a4686e | /QueueTest.java | d6845e504eb768269241965f7ffc7bef28e06680 | [] | no_license | DanearTSY/store_operation | 87db221f80796797501c1fcbabcb0b46769e4fc3 | f5e685fa8b4f0ac40ec178e92bfafce85b7c724c | refs/heads/master | 2020-05-09T16:14:03.381536 | 2017-07-19T18:44:53 | 2017-07-19T18:44:53 | 181,263,678 | 1 | 0 | null | 2019-04-14T05:17:41 | 2019-04-14T05:17:41 | null | UTF-8 | Java | false | false | 1,030 | java | import java.io.File;
import java.io.FileNotFoundException;
public class QueueTest {
public static void main(String[] args) throws FileNotFoundException {
File customers = new File("CustomersData.txt");
File queries = new File("QueriesContent.txt");
//one queue for all customers in a day
CustomerList today = new CustomerList();
today.createList(customers);
//getting queries
today.getQueries(queries);
//one queue to model customers in the store at any given time.
CustomerList store = new CustomerList();
while (!today.isEmpty()) {
System.out.println("Before");
System.out.println("Today:");
today.displayCustomers();
System.out.println("Store");
store.displayCustomers();
CustomerNode current = today.dequeue();
store.enqueue(current);
System.out.println("After");
System.out.println("Today:");
today.displayCustomers();
System.out.println("Store");
store.displayCustomers();
}
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
e4de63cb7fa6a9507996bfee11f8dc1164fd503e | 13b89199b2147bd1c7d3a062a606f0edd723c8d6 | /AlgorithmStudy/src/baekjoon/그리디알고리즘/ATM.java | 1754d8b9cb21e3681262062c41a5c92ac13d4286 | [] | no_license | chlals862/Algorithm | 7bcbcf09b5d4ecad5af3a99873dc960986d1709f | ab4a6d0160ad36404b64ad4b32ce38b67994609f | refs/heads/master | 2022-11-28T13:05:58.232855 | 2022-11-23T09:56:27 | 2022-11-23T09:56:27 | 243,694,528 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,215 | java | package baekjoon.그리디알고리즘;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Scanner;
public class ATM {
// static BufferedReader br = new BufferedReader(new
// InputStreamReader(System.in));
// static BufferedWriter bw = new BufferedWriter(new
// OutputStreamWriter(System.out));
static int inputNum;
static int num[];
static int min;
public static void main(String[] args) {
// logic();
// private static void logic() {
//
// for(int i=0; i<num.length;i++) {
//
// }
// }
//입력
Scanner sc = new Scanner(System.in);
inputNum = sc.nextInt();
int num[] = new int[inputNum];
for (int i = 0; i < inputNum; i++) {
num[i] = sc.nextInt();
}
// 로직
//31432 -> 12334
Arrays.sort(num);
for (int i = 0; i < inputNum; i++) {
for (int j = 0; j < i + 1; j++) {
min += num[j];
//System.out.println("num[i] = " + num[i]);
//System.out.println("num[j] = " + num[j]);
//1 + 1+2 + 1+2+3 + 1+2+3+3 + 1+2+3+3+4 -> 1+3+6+9+13 -> 32
//System.out.println("min = " + min);
}
}
//출력
System.out.println(min);
}
}
| [
"[email protected]"
] | |
f2fa11f48520f00dc711b6ce0d7c005a9410bf86 | f09d0193dd2a43d9f2106bb5ae22cfe6f46cbac9 | /src/main/java/com/fruitbox/online/enums/Categories.java | fb0b8837996475704a73810ff8ea3f189e9c9e41 | [] | no_license | prodizy69/fruit-box | 33dd2bd56145303c92177bfd1ba315268a4bd0f3 | 4cbd9574aa37b073b5ad52cd31d3de803a7e4d6a | refs/heads/master | 2020-04-30T21:38:48.572998 | 2019-03-22T08:10:26 | 2019-03-22T08:10:26 | 177,098,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127 | java | package com.fruitbox.online.enums;
/**
* Categories.
*
* @author sateeshdubasi
*
*/
public enum Categories {
FRUITS
}
| [
"[email protected]"
] | |
0b38dd70a6d7938f7b735d2ed60d64de7d41eea4 | 819d05293d84e709b1c0a8cb73e553b164625d41 | /src/evonyproxy/common/module/common/MapCastleResponse.java | f603eaec823e9dfc87bd7f1d00116643e3b4af8d | [] | no_license | Pilsburgh/Efony | dabd9510d8c93ce9f6b2e9da2c29535fa65c424e | 6c9830940729f2fda682f1a526ea2e7f1b0aa363 | refs/heads/master | 2016-09-03T07:29:50.517392 | 2014-09-13T22:22:18 | 2014-09-13T22:22:18 | 10,364,412 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,986 | java | package evonyproxy.common.module.common;
import flex.messaging.io.amf.ASObject;
import java.lang.reflect.Method;
import java.util.ArrayList;
import evonyproxy.common.ASObjectable;
import flex.messaging.io.ArrayCollection;
import evonyproxy.common.beans.*;
/**
* @version .02
* @author Michael Archibald
* @deprecated
* This only exists for reverse compatability. Use the modularized version of
* this class instead.
*/
public class MapCastleResponse implements ASObjectable {
public Double packageId = null;
public String msg = null;
public String errorMsg = null;
public Integer ok = null;
public ArrayList<MapCastleBean> castle = null;
public MapCastleResponse(ASObject aso) {
castle = new ArrayList<MapCastleBean>();
if(aso.get("packageId") != null) {
this.packageId = (Double) aso.get("packageId");
}
if(aso.get("msg") != null) {
this.msg = (String) aso.get("msg");
}
if(aso.get("errorMsg") != null) {
this.errorMsg = (String) aso.get("errorMsg");
}
if(aso.get("ok") != null) {
this.ok = (Integer) aso.get("ok");
}
if(aso.get("castle") != null) {
Object[] objArr = (Object[]) aso.get("castle");
for(int j = 0; j < objArr.length; j++) {
castle.add(new MapCastleBean((ASObject) objArr[j]));
}
}
}
public MapCastleResponse() {
}
@Override
public MapCastleResponse clone() {
MapCastleResponse clone = new MapCastleResponse();
if(this.packageId != null) {
clone.setPackageId(this.packageId);
}
if(this.msg != null) {
clone.setMsg(this.msg);
}
if(this.errorMsg != null) {
clone.setErrorMsg(this.errorMsg);
}
if(this.ok != null) {
clone.setOk(this.ok);
}
if(this.castle != null) {
ArrayList tmpArrLst = new ArrayList<MapCastleBean>();
for(Object bean : castle) {
MapCastleBean tmpBean = (MapCastleBean) bean;
tmpArrLst.add(tmpBean.clone());
}
clone.setCastle(tmpArrLst);
}
return clone;
}
public ASObject toASObject() {
ASObject aso = new ASObject();
if(this.packageId != null) {
aso.put("packageId", packageId);
}
if(this.msg != null) {
aso.put("msg", msg);
}
if(this.errorMsg != null) {
aso.put("errorMsg", errorMsg);
}
if(this.ok != null) {
aso.put("ok", ok);
}
if(this.castle != null) {
ArrayList al = new ArrayList();
for(Object obj : castle) {
ASObjectable as = (ASObjectable) obj;
al.add(as.toASObject());
}
aso.put("castle", al);
}
return aso;
}
public Double getPackageId() {
return packageId;
}
public void setPackageId(Double packageId) {
this.packageId = packageId;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public Integer getOk() {
return ok;
}
public void setOk(Integer ok) {
this.ok = ok;
}
public ArrayList getCastle() {
return castle;
}
public void setCastle(ArrayList castle) {
this.castle = castle;
}
}
| [
"[email protected]"
] | |
2d55b52d58d52aed2e767decd4b2f9bc5d5dc1bf | 3610f8af8df0dece40a908c4503dad2109d5ce41 | /src/java/controlador/checkLoginClass.java | dec6c24df3ce329ae6aa8aea06311051420dc8d8 | [] | no_license | ijosafat/VetWebFinal | ba19aee89d8912cc3136df51e7371378ac2a9706 | 47cf6a23def3df41e5effbc362f2063b0911e4e1 | refs/heads/main | 2023-05-20T00:20:31.708442 | 2021-06-15T03:49:59 | 2021-06-15T03:49:59 | 377,027,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,652 | 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 controlador;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.logging.Level;
import java.util.logging.Logger;
import sv.edu.ujmd.modelo.conexion;
/**
*
* @author Alexander-Siguenza
*/
public class checkLoginClass {
public checkLoginClass() {
}
// CREATE DEFINER=`root`@`localhost` PROCEDURE `verifyUser`(IN pusuario TEXT, IN ppassword TEXT, OUT outCout INT)
// READS SQL DATA
// BEGIN
// SELECT count(*) INTO outCout FROM usuarios WHERE usuario = pusuario and password = ppassword;
// END
public static int verifyUser(String Usuario, String clave) {
int val = 0;
try {
Connection con = conexion.Conectar();
CallableStatement cmst = con.prepareCall("CALL verifyUser(?,?,?)");
cmst.setString(1, Usuario);
cmst.setString(2, clave);
cmst.registerOutParameter(3, Types.VARCHAR); // para recuperarparametros de salidad de MYSQL -> OUT outCout INT
cmst.executeUpdate();
val = cmst.getInt(3);
con.close();
} catch (SQLException sqlex) {
System.out.println(sqlex.getMessage());
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
return val;
}
} | [
"[email protected]"
] | |
ce9fcec12286f97ad283c8a9f5b877d3d1f8c1cc | b5615b31084bad5a96a7b2fc90dd584c1ec3f696 | /src/main/java/com/mlouardi/springbootsecurity/entities/Role.java | 42240c3c19c3288209cc54d766d0f3a9110ab2c6 | [] | no_license | LMohamedPro/springbootsecurity | 6d35cc7ab082a69c1f2caf7e63a1882a1689c7f7 | dcd3f9eb6a74e0f4b4f1bde8c57b8b4e83bdcef5 | refs/heads/master | 2021-01-03T15:17:42.915447 | 2020-02-12T22:40:16 | 2020-02-12T22:40:16 | 240,129,031 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.mlouardi.springbootsecurity.entities;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "roles")
@Setter
@Getter
public class Role {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(nullable = false, unique = true)
private String name;
@ManyToMany(mappedBy = "roles")
private List <User> users;
}
| [
"[email protected]"
] | |
9fd61529c200df31b5ddd0ce297478e2aa24dece | 2034cb72df2e986e482c9354b07355ee7b07edb4 | /app/src/androidTest/java/david/com/myapplication/ExampleInstrumentedTest.java | c7760806cd34edbd1b2ef8bfd3743796552659f1 | [] | no_license | eternalgooner/AndroidViewWeights | e570fdecfb4e33dcfa93c67658ed40e620eccea5 | 377abe692199a6d4b67e9adeb69e1edbd140d25c | refs/heads/master | 2021-01-20T13:55:54.836921 | 2017-05-07T14:44:03 | 2017-05-07T14:44:03 | 90,539,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package david.com.myapplication;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("david.com.myapplication", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
a8fa4ebb5f723bb69411611ccbbcca3cc076f402 | 61662b95c45e89976f3ea65c5856db2fa277739e | /AlgorithmsAndDataStructures/Assignment 2/PointsTest.java | b2a684b60b23e93489af9eff222954e1e1bb0192 | [] | no_license | adimitrova/TUDelft | 175bc3a688bd973a0466c867eace3f60db2e209a | decdd881ccc42f64418f38b01ac44d47ade6c7d4 | refs/heads/master | 2020-12-25T16:47:45.189737 | 2019-02-05T10:19:35 | 2019-02-05T10:19:35 | 66,623,007 | 2 | 0 | null | 2017-10-14T22:33:53 | 2016-08-26T06:35:53 | Java | UTF-8 | Java | false | false | 989 | java | import static org.junit.Assert.*;
import org.junit.Test;
public class UTest {
final static Point p = new Point(4.0, 5.0, 6.0);
final static Point q = new Point(1.0, 2.0, 3.0);
@Test
public void testToStringP() {
assertEquals("<4.0, 5.0, 6.0>", p.toString());
}
@Test
public void testToStringQ() {
assertEquals("<1.0, 2.0, 3.0>", q.toString());
}
@Test
public void testRotateP() {
Point r = p.rotate(1, 2, 3, 90);
assertEquals(1.4839305599770118, r.getX(), 0.0001);
assertEquals(6.174996022903118, r.getY(), 0.0001);
assertEquals(6.055359131405586, r.getZ(), 0.0001);
}
@Test
public void testRotateQ() {
Point r = q.rotate(4, 5, 6, 45);
assertEquals(1.4357410990710693, r.getX(), 0.0001);
assertEquals(1.539329069804002, r.getY(), 0.0001);
assertEquals(3.0933983757826184, r.getZ(), 0.0001);
}
@Test
public void testRobustRotate() {
try {
p.rotate(0, 0, 0, 180);
} catch (IllegalArgumentException e) { return; }
fail();
}
}
//
| [
"[email protected]"
] | |
ef64312b831184a8f76ff90fb6ef217edf02e4c7 | 9b78bd058ec1c5e2659306a862c173c93651dae7 | /3D ConvexHull/pv/PV3.java | f8c72a1ef9d3946d068d8a23970a70c638b62816 | [] | no_license | E-Coli-BW/Computational_Geometry | 691e3916c2d0f2a93077a6aa12bde02ce35ec875 | 1d31e6e5b7a9cd00913796b6013fa1be9af4a8a0 | refs/heads/master | 2021-07-09T11:34:20.405159 | 2020-07-21T17:51:45 | 2020-07-21T17:51:45 | 168,403,399 | 1 | 0 | null | 2019-06-12T03:47:05 | 2019-01-30T19:38:54 | Java | UTF-8 | Java | false | false | 2,364 | java | package pv;
import acp.Real;
import acp.XYZ;
public class PV3 implements XYZ,Cloneable {
public Real x, y, z;
public static final PV3 X = PV3.constant(1, 0, 0);
public static final PV3 Y = PV3.constant(0, 1, 0);
public static final PV3 Z = PV3.constant(0, 0, 1);
public int size () { return 3; }
public Real get (int i) {
switch (i) {
case 0: return x;
case 1: return y;
case 2: return z;
default: throw new IndexOutOfBoundsException();
}
}
public Real set (int i, Real v) {
switch (i) {
case 0: return x = v;
case 1: return y = v;
case 2: return z = v;
default: throw new IndexOutOfBoundsException();
}
}
public Object clone () {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
public PV3 (Real x, Real y, Real z) { this.x = x; this.y = y; this.z = z; }
static public PV3 input (double x, double y, double z) {
return new PV3(Real.input(x), Real.input(y), Real.input(z));
}
static public PV3 constant (double x, double y, double z) {
return new PV3(Real.constant(x), Real.constant(y), Real.constant(z));
}
public PV3 plus (PV3 that) {
return new PV3(this.x.plus(that.x), this.y.plus(that.y), this.z.plus(that.z));
}
public PV3 minus (PV3 that) {
return new PV3(this.x.minus(that.x), this.y.minus(that.y), this.z.minus(that.z));
}
public PV3 times (Real s) { return new PV3(x.times(s), y.times(s), z.times(s)); }
public PV3 over (Real s) { return new PV3(x.over(s), y.over(s), z.over(s)); }
public Real dot (PV3 that) {
return this.x.times(that.x).plus(this.y.times(that.y)).plus(this.z.times(that.z));
}
public PV3 cross (PV3 that) {
return new PV3(this.y.times(that.z).minus(this.z.times(that.y)),
this.z.times(that.x).minus(this.x.times(that.z)),
this.x.times(that.y).minus(this.y.times(that.x)));
}
/**
* The norm is x^2 + y^2, but x and y should not appear in your
* implementation!
*/
public Real norm () { return this.dot(this); }
public Real length () { return norm().sqrt(); }
/**
* The unit vector pointing in the same direction.
*/
public PV3 unit () { return this.over(length()); }
public Real distance (PV3 that) { return that.minus(this).length(); }
}
| [
"[email protected]"
] | |
2ceee414302ccb002fd024722d9cf2d2d239bc56 | 3e62f907cd7f68bdfa535271433ab6c6ad6829c0 | /source_code/aws/src/main/java/th/co/geek/action/UserLoginAction.java | 116508a4bf5fe3dc1f1b2a33a301ee1b667fc4d6 | [] | no_license | tha3k/TestPathMaven | fef32d924b1301ddb83fa7dc228fd0ed3b23bc56 | cb7e5b18fc2c57c7447afc4bbf9f278b56e9c5f0 | refs/heads/master | 2021-01-12T07:35:19.521205 | 2016-12-20T18:08:03 | 2016-12-20T18:08:03 | 76,979,930 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 927 | java | package th.co.geek.action;
import th.co.geek.action.exception.UserAuthenticationException;
import th.co.geek.bean.UserProfile;
import th.co.geek.dao.UserProfileDAO;
public class UserLoginAction {
public UserProfile login(String userName, String password) throws Exception {
return authenticate(userName, password);
}
public UserProfile authenticate(String userName, String password) throws Exception {
UserProfile userProfile = UserProfileDAO.getInstance().getUserProfile(userName);
System.out.println(password+":"+userProfile.getPassword());
if (password.equals(userProfile.getPassword()))
System.out.println("log in success!!");
else {
System.out.println("log in failed!!");
throw new UserAuthenticationException();
}
return userProfile;
}
public static void main(String[] args) throws Exception {
UserLoginAction a = new UserLoginAction();
a.authenticate("tha3k", "11111");
}
}
| [
"[email protected]"
] | |
432c5a9d5ade56b4dde103ee90cd664444a1b3a2 | 75fd40bedcc951cc820ec921f13989cce85c81fa | /src/main/java/br/com/analytics/util/CalcUtils.java | 5bb18c2407d34981f32ebe4ce253784165078eda | [] | no_license | sergioadsf/analytics | 783042c3147ab784030e483b1984e6cf79d1a35b | bb005722252f155c79973546c65aac6e3eed94fe | refs/heads/master | 2021-01-01T04:14:00.472508 | 2018-10-17T23:51:06 | 2018-10-17T23:51:06 | 97,143,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,466 | java | package br.com.analytics.util;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class CalcUtils {
public static BigDecimal calcPercentage(BigDecimal total, BigDecimal value) {
BigDecimal totalBig = total.setScale(2, RoundingMode.HALF_EVEN);
BigDecimal valorBig = value.setScale(2, RoundingMode.HALF_EVEN);
BigDecimal cemBig = new BigDecimal(100).setScale(2, RoundingMode.HALF_EVEN);
valorBig = valorBig.multiply(cemBig).setScale(2, RoundingMode.HALF_EVEN);
return valorBig.divide(totalBig, 2, RoundingMode.HALF_EVEN);
}
public static BigDecimal calcDifferentSessions(BigDecimal qtdActual, BigDecimal qtdPast) {
if (qtdPast.compareTo(new BigDecimal(0)) == 0) {
return new BigDecimal(0);
}
BigDecimal actBig = qtdActual.setScale(2, RoundingMode.HALF_EVEN);
BigDecimal pastBig = qtdPast.setScale(2, RoundingMode.HALF_EVEN);
BigDecimal hundBig = new BigDecimal(100).setScale(2, RoundingMode.HALF_EVEN);
actBig = actBig.subtract(pastBig);
actBig = actBig.multiply(hundBig);
return actBig.divide(pastBig, 2, RoundingMode.HALF_EVEN);
}
public static BigDecimal calcularTempo(String timeAverage) {
timeAverage = timeAverage.replace("m", "").replace("s", "");
String[] time = timeAverage.split(" ");
BigDecimal min = new BigDecimal(time[0].trim());
BigDecimal seg = new BigDecimal(time[1].trim());
min = min.multiply(new BigDecimal(60));
return min.add(seg);
}
}
| [
"[email protected]"
] | |
0ce4547182b2ac875ec11c72dc6db4fe9c994596 | 98e8d423929a899b1360fb176c25b44414c943c1 | /src/Ch02_variable/variableExample.java | f36b990e4f55be799389c145b20d5e166df45d72 | [] | no_license | wjunheo/Chapter02_JavaStart | ecf2378aa72ba3f144fcf0f8f6da457808d5a008 | 02b38498ea141a9b250db604654554e5961d3ad9 | refs/heads/master | 2023-06-26T08:45:54.047978 | 2021-07-27T01:41:27 | 2021-07-27T01:41:27 | 389,810,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | package Ch02_variable;
public class variableExample {
public static void main(String[] args) {
int value = 10;
int sum = value +20;
System.out.println(sum);
}
}
| [
"bitcamp@DESKTOP-4EG6L0P"
] | bitcamp@DESKTOP-4EG6L0P |
d9c7c2d6934bee7c026b671e049308aa64c64bd3 | b8160f2789d31fa55b08c2c00ec4f7bab8d8ca26 | /V0/vieux_wao/element.java | 04ca7fa2a3396b9f55ce56bf98fa0b073e4eecdd | [] | no_license | hugodro/WAO | b3f9b62aaa661f7b9233e65c17ade10b6462e905 | e9bbbb44c55653d084a7ddb4d693bbf3c46c953f | refs/heads/master | 2022-07-05T07:49:37.424206 | 2020-05-20T03:35:12 | 2020-05-20T03:35:12 | 265,440,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | /************************************************
* Fichier: element.java.
* Desc: .
* Module: AkraLog : WAO.
* Rev: 2 mai 1997 : REV 0 : Hugo DesRosiers : Creation.
*************************************************/
package wao;
public class wElement extends Object {
public htmlSelf(wHtmlContext context)
{
}
} | [
""
] | |
2ec52ee253d4dd2e5e2e114c704da13f05429cc2 | cca52ae4e4fdfe494e859a376f8152f2bffb4d79 | /src/main/java/org/win/cowin/vaccinealert/dto/Center.java | 12a72fc4257efe3ea5147b73b2f47cda51d15f09 | [] | no_license | winster/vaccinealert | 30cd3276c6897269c9745f19aca4e9dc604d196b | 0853d4380de0a9232e4ab78387068dcff0b95088 | refs/heads/master | 2023-04-24T23:34:14.699486 | 2021-05-06T15:24:07 | 2021-05-06T15:24:07 | 364,340,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package org.win.cowin.vaccinealert.dto;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class Center {
private String fee_type;
private String name;
private List<Session> sessions;
}
| [
"[email protected]"
] | |
922efa4b143285dff31260fdc90d420e5a8125fa | dacd75e4b48ed93511f127fcfa63ebc06ef82e45 | /spi/src/main/java/com/yuliyao/spi/java/OptimusPrime.java | 39359938a1f7684c706dc0ce05ca9973c9839763 | [] | no_license | myloveyuvip/growth-demo | f2f45cf1323214cd7733db2ccfe86435014eda55 | 43df1480377e7fe714ec82e297b0bc779f852aea | refs/heads/master | 2022-06-21T12:13:15.560425 | 2020-12-29T02:06:58 | 2020-12-29T02:06:58 | 163,428,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 229 | java | package com.yuliyao.spi.java;
/**
* @author yuliyao
* @date 2019/8/10
*/
public class OptimusPrime implements Robot{
@Override
public void sayHello() {
System.out.println("hello,I am Optimus prime!");
}
}
| [
"[email protected]"
] | |
1023112189f59df742700dfccf0dc773efb0c2a1 | f12ebe506ec40a4be795d5ba8dd416726d5e9a31 | /src/main/java/com/ufc/br/service/RoupaService.java | 8037df7369a9954e1fe84f4f04d53b49316d2559 | [] | no_license | iraneideLima/TrabalhoFinal | 829e7022e7c0e6af177e0493cd2ec99671d8db24 | 8dc675b509972b2684ef8ed072f741c1ff5b50dd | refs/heads/master | 2020-03-21T16:40:09.974332 | 2018-06-26T20:25:03 | 2018-06-26T20:25:03 | 138,784,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package com.ufc.br.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.ufc.br.model.Roupa;
import com.ufc.br.repository.RoupaRepository;
import com.ufc.br.util.FileUtil;
import java.util.List;
@Service
public class RoupaService {
@Autowired
RoupaRepository roupaRepository;
public void salvarRoupa(Roupa roupa, MultipartFile imagem) {
String caminho = "images/" + roupa.getDescricao() + ".png";
FileUtil.salvarIMG(caminho, imagem);
roupaRepository.save(roupa);
}
public List<Roupa> listarRoupa(){
return roupaRepository.findAll();
}
public Roupa buscarRoupaPorId(Long id) {
return roupaRepository.getOne(id);
}
public void deletarRoupaPorId(Long id) {
roupaRepository.deleteById(id);
}
}
| [
"[email protected]"
] | |
aeffe290a73ca1e04cc1c37c0b7a81cf027aee85 | f52d89e3adb2b7f5dc84337362e4f8930b3fe1c2 | /com.fudanmed.platform.core.web/src/main/java/com/fudanmed/platform/core/web/client/deliver/PatientDeliverMethodContentProviderServiceAsync.java | ab90182799e3db4fc14f5ffc4a13fbb6e3d347cf | [] | no_license | rockguo2015/med | a4442d195e04f77c6c82c4b82b9942b6c5272892 | b3db5a4943e190370a20cc4fac8faf38053ae6ae | refs/heads/master | 2016-09-08T01:30:54.179514 | 2015-05-18T10:23:02 | 2015-05-18T10:23:02 | 34,060,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.fudanmed.platform.core.web.client.deliver;
import com.fudanmed.platform.core.deliver.proxy.DLPatientDeliverMethodProxy;
import com.google.gwt.user.client.rpc.AsyncCallback;
import java.util.Collection;
public interface PatientDeliverMethodContentProviderServiceAsync {
public abstract void load(final AsyncCallback<Collection<DLPatientDeliverMethodProxy>> callback);
}
| [
"[email protected]"
] | |
aff0d00fb1b273a3285789e25a4ffebb852f12aa | 2c5164f038abb5b89de9238fefcb2cbe5dad4985 | /src/main/java/springboot_demo1/demo/filter/ServletFilterConfig.java | 1fa5452eaff3174a4034b3884dd0a841568c7254 | [] | no_license | DongBudong99999/SpringBoot_demo1 | d44bb6922922010e92ea030e3865caff6c386791 | 3a72b48f21e25c361ba79b1e86d01d59a3c00e17 | refs/heads/master | 2020-04-08T00:04:48.184664 | 2018-11-23T13:29:07 | 2018-11-23T13:29:07 | 158,837,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package springboot_demo1.demo.filter;
//
//@Configuration
//public class ServletFilterConfig {
// @Bean
// public StrutsPrepareAndExecuteFilter strutsPrepareAndExecuteFilter(){
// return new StrutsPrepareAndExecuteFilter();
// }
//}
| [
"[email protected]"
] | |
b5fd0cbdbcb0996addaac680018c95fcaa254eaf | c899074b4ecf0784d9546743edb53767a3d3ec58 | /src/main/java/com/project/ipldashboard/data/JobCompletionNotificationListener.java | ea9b42404256794a15053b4eb0cdb6d1834ed9b9 | [] | no_license | ayushiatri12/ipl-dashboard | 301a5406c59e84d8bdb880d8046722664f05255c | 7be3d80c9eb5dd6e6d48361333b735e1c6ade351 | refs/heads/master | 2023-04-27T01:37:46.876986 | 2021-05-10T17:13:46 | 2021-05-10T17:13:46 | 366,117,358 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,795 | java | package com.project.ipldashboard.data;
import com.project.ipldashboard.model.MatchData;
import com.project.ipldashboard.model.Team;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.listener.JobExecutionListenerSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import java.util.HashMap;
import java.util.Map;
@Component
public class JobCompletionNotificationListener extends JobExecutionListenerSupport {
private static final Logger log = LoggerFactory.getLogger(JobCompletionNotificationListener.class);
private final EntityManager entityManager;
@Autowired
public JobCompletionNotificationListener(EntityManager entityManager) {
this.entityManager = entityManager;
}
@Override
@Transactional
public void afterJob(JobExecution jobExecution) {
if(jobExecution.getStatus() == BatchStatus.COMPLETED) {
log.info("!!! JOB FINISHED! Time to verify the results");
/*jdbcTemplate.query("SELECT team1, team2, date FROM matchData",
(rs, row) -> "Team 1 "+rs.getString(1)+"Team 2 "+rs.getString(2)+
"Date " +rs.getString(3)
).forEach(obj -> System.out.println(obj));*/
Map<String, Team> teamData = new HashMap<>();
entityManager.createQuery("select m.team1, count(*) from MatchData m group by m.team1",
Object[].class).getResultList().stream()
.map(e -> new Team((String) e[0], (long) e[1]))
.forEach(team -> teamData.put(team.getTeamName(),team));
entityManager.createQuery("select m.team2, count(*) from MatchData m group by m.team2",
Object[].class).getResultList().stream().
forEach(e -> {
Team team = teamData.get((String) e[0]);
team.setTotalMatches(team.getTotalMatches() + (long) e[1]);
});
entityManager.createQuery("select m.winner, count(*) from MatchData m group by m.winner",
Object[].class).getResultList().stream()
.forEach(e -> {
Team team = teamData.get((String) e[0]);
if(team!=null) team.setTotalWins((long) e[1]);
});
teamData.values().forEach(team -> entityManager.persist(team));
teamData.values().forEach(team -> System.out.println(team));
}
}
} | [
"[email protected]"
] | |
7cbd5d213e4904313332503cce3a843a426b1eef | a23ae7b8c3a90bdfb8d0e7f8db5be2c87aa7ff7a | /Lambdas/test/GetRemindersTest.java | 9f7b4effb7da6563ffc28e34aca8a8b98b973063 | [] | no_license | SanjanaKoka/DoctorsNote | f2b52c4cef9b7e3c85f30280fe27598a82bd6dbd | ab264a9496a3bdc624753cce94ec426c6518e990 | refs/heads/master | 2022-04-23T09:09:21.791175 | 2020-04-24T14:30:57 | 2020-04-24T14:30:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,749 | java | import DoctorsNote.GetReminders;
import DoctorsNote.ReminderGetter;
import com.amazonaws.services.lambda.runtime.Context;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.sql.SQLException;
import java.util.HashMap;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
public class GetRemindersTest {
Context contextMock;
GetReminders getReminders;
ReminderGetter reminderGetterMock;
@Before
public void beforeTests() {
contextMock = Mockito.mock(Context.class);
getReminders = spy(new GetReminders());
reminderGetterMock = Mockito.mock(ReminderGetter.class);
doReturn(reminderGetterMock).when(getReminders).makeReminderGetter();
}
@Test
public void testValidReturn() throws SQLException {
ReminderGetter.GetReminderResponse responseMock = Mockito.mock(ReminderGetter.GetReminderResponse.class);
when(reminderGetterMock.get(Mockito.anyMap(), Mockito.any())).thenReturn(responseMock);
HashMap<String, Object> inputMap = new HashMap<String, Object>();
Assert.assertEquals(responseMock, getReminders.handleRequest(inputMap, contextMock));
}
@Test
public void testInvalidReturn() throws SQLException {
when(reminderGetterMock.get(Mockito.anyMap(), Mockito.any())).thenReturn(null);
HashMap<String, Object> inputMap = new HashMap<String, Object>();
try {
getReminders.handleRequest(inputMap, contextMock);
Assert.fail();
} catch (RuntimeException e) {
Assert.assertEquals("Server experienced an error", e.getMessage());
}
}
}
| [
"[email protected]"
] | |
6eb782da43874a6010bd6f604848e11bc1ece9e4 | 3402440b48ac69035e0898bff3dc53c377b0b151 | /Umsetzung/Database/src/DBKunde.java | 3395c4ae23142918b97aa8ca82bc8c8293d95799 | [] | no_license | mcmyffin/SE2P_FahrradKonfigurator | c864ef5401619fbee16b868c88af1a06ffd812b0 | ff09c3038fedf9fe9a4833e6e8b790791ab20045 | refs/heads/master | 2020-12-24T15:41:03.202067 | 2015-06-15T08:07:04 | 2015-06-15T08:07:04 | 28,534,755 | 0 | 1 | null | 2015-06-15T10:43:40 | 2014-12-27T11:01:42 | HTML | UTF-8 | Java | false | false | 1,283 | java | import java.sql.Connection;
import java.util.List;
/**
* Created by tin on 08.04.15.
*
* Tja, ich weiß zwar manchmal nicht was ich mache, aber ich mache viel ^^
*/
final class DBKunde implements IKunde {
Connection con;
@Override
public boolean isKundeExistByMail(String mailadr) {
return false;
}
@Override
public List<String> getKundeByID(int id) {
return null;
}
@Override
public int getKundeIDByLogin(String mail, String pass) {
return 0;
}
@Override
public List<String> getAdressByID(int id) {
return null;
}
@Override
public boolean setVorname(int id, String vorname) {
return false;
}
@Override
public boolean setNachname(int id, String nachname) {
return false;
}
@Override
public boolean setAdresse(int id, List<String> adresse) {
return false;
}
@Override
public boolean setEMail(int id, String email) {
return false;
}
@Override
public boolean setPasswort(int id, String passwort) {
return false;
}
@Override
public boolean getConnectionFile() {
return false;
}
@Override
public boolean createConnectionFile() {
return false;
}
}
| [
"[email protected]"
] | |
1bf01d9e35d89fde858e8a027e876e71db58d5f4 | 4aca521aaf65fd8cc47b25d45cccb3b6743ba2b5 | /src/main/java/com/sparta/lt/northwindrest/repositories/EmployeeRepository.java | bcd3594bcde56732c144aef4f1764f7cf8ba30cb | [] | no_license | LewisT543/Northwind-REST-API | a3d2a0d8444e02284a33cd94746818d49bf1b17a | e22c493f4ac8d6c3733218477196a64f4566b9ba | refs/heads/dev | 2023-08-24T05:51:58.337938 | 2021-10-24T23:12:47 | 2021-10-24T23:12:47 | 419,348,482 | 0 | 0 | null | 2021-10-25T00:23:10 | 2021-10-20T13:46:47 | Java | UTF-8 | Java | false | false | 260 | java | package com.sparta.lt.northwindrest.repositories;
import com.sparta.lt.northwindrest.entities.EmployeeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
public interface EmployeeRepository extends JpaRepository<EmployeeEntity, Integer> {
} | [
"[email protected]"
] | |
abb064c911e976b3fac5df452177ee13c20ff818 | 9b296c49e9e4e1ef85ce7b4885c9810ed9f181ab | /src/com/luv2code/springdemo/configurationAnnotation/Pehli.java | 70b3745bfe5d53b8db748929f9848dcd935d786f | [] | no_license | Yavdhesh/ishpring-initialization-di-property-autowire-scan-demo | 23c7f7b8777677baf85cf7d905a861ba8bb38115 | 24e2a2dde56df200d887f47a1ae0ae25b6f647ff | refs/heads/master | 2020-12-12T03:52:16.458798 | 2020-01-16T01:26:13 | 2020-01-16T01:26:13 | 234,035,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package com.luv2code.springdemo.configurationAnnotation;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
public class Pehli {
@PostConstruct
public void postCon(){
System.out.println("pehli kaa postcon");
}
@PreDestroy
public void predest(){
System.out.println("pehli kaa pre dest");
}
public void aiseHi(){
System.out.println("aise Hi Pehli ro");
}
}
| [
"[email protected]"
] | |
0203ef722b9e211c46b82fb064732c52f555c237 | f2798a9a415fc3148cc77fe02bac0927de5ba3b4 | /src/main/java/com/mysoft/b2b/search/controller/SupplierController.java | 16d1cdaf2d179e93b90caef9480be423dcbf62b0 | [] | no_license | ganq/search-web | a266d9e8fd69d4ba597f50348f4205ce7a43a050 | 3ef9d28301aa3b669e4f548167b80735075f7aa5 | refs/heads/master | 2022-12-22T12:06:01.580871 | 2015-02-05T07:19:09 | 2015-02-05T07:19:09 | 28,620,631 | 1 | 1 | null | 2022-12-16T01:18:01 | 2014-12-30T06:41:22 | Java | UTF-8 | Java | false | false | 8,222 | java | package com.mysoft.b2b.search.controller;
import com.mysoft.b2b.basicsystem.settings.api.DictionaryService;
import com.mysoft.b2b.basicsystem.settings.api.Region;
import com.mysoft.b2b.basicsystem.settings.api.RegionNode;
import com.mysoft.b2b.bizsupport.api.*;
import com.mysoft.b2b.bizsupport.api.OperationCategoryService.DataType;
import com.mysoft.b2b.cms.api.AdpositionService;
import com.mysoft.b2b.commons.taglib.DomainTag;
import com.mysoft.b2b.search.api.SupplierSearchService;
import com.mysoft.b2b.search.param.SupplierParam;
import com.mysoft.b2b.search.util.CommonUtil;
import com.mysoft.b2b.search.util.TDKUtil;
import com.mysoft.b2b.search.vo.SearchCategoryVO;
import com.mysoft.b2b.search.vo.SupplierVO;
import com.mysoft.b2b.sso.api.OnlineService;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Controller
@SuppressWarnings("unchecked")
public class SupplierController {
private Logger logger = Logger.getLogger(this.getClass());
@Autowired
private DictionaryService dictionaryService;
@Autowired
private OnlineService onlineService;
@Autowired
private QualificationService qualificationService;
@Autowired
private QualificationLevelService qualificationLevelService;
@Autowired
private SupplierSearchService supplierSearchService;
@Autowired
private DomainService domainService;
@Autowired
private OperationCategoryService operationCategoryService;
@Autowired
private AdpositionService adpositionService;
@Autowired
private CommonUtil commonUtil;
@Autowired
private TDKUtil tdkUtil;
private Map<String, List<RegionNode>> regionArea = new LinkedHashMap<String, List<RegionNode>>();
@PostConstruct
public void init() {
regionArea = commonUtil.getRegionArea();
}
@RequestMapping(value = "/supplier", method = RequestMethod.GET)
public String supplier(Model model, SupplierParam supplierParam, HttpServletRequest request) {
try {
String errorUrl = commonUtil.checkCategory(DataType.SUPPLIER, supplierParam);
if (!StringUtils.isBlank(errorUrl)) {
return errorUrl;
}
supplierParam.setPageSize(10);
supplierParam.setKeyword(commonUtil.separateStringByLen(supplierParam.getKeyword(), 50).trim());
// 设置userid和userType 统计搜索用
String[] userIdAndType = commonUtil.getUserIdAndType(request);
supplierParam.setUserId(userIdAndType[0]);
supplierParam.setUserType(userIdAndType[1]);
supplierParam.setIpAddress(request.getRemoteAddr());
Map<String, Object> result = supplierSearchService.getSearchResult(supplierParam);
List<SupplierVO> searchResult = (List<SupplierVO>) result.get("searchResult");
List<String> supplierIds = new ArrayList<String>();
// 设置供应商旗舰店的url
if (searchResult != null) {
for (SupplierVO supplierVO : searchResult) {
String domain = domainService.getDomainByCompanyId(supplierVO.getSupplierId());
String newUrl;
if (domain.equalsIgnoreCase(supplierVO.getSupplierId())) {//默认url
newUrl = DomainTag.getDomainUrlByKey("g.archives", "/") + domain;
} else { // 二级域名
newUrl = DomainTag.getDomainUrlByKey("mainpage", "/").replace("www", domain);
}
supplierVO.setSupplierUrl(newUrl);
supplierIds.add(supplierVO.getSupplierId());
}
}
model.addAttribute("supplierIds", StringUtils.join(supplierIds.toArray(), ","));
List<SearchCategoryVO> level3Category = (List<SearchCategoryVO>) result.get("level3Category");
model.addAllAttributes(commonUtil.getLvl3MenuIsExpandAndScroll(level3Category, supplierParam.getCodelevel3()));
result.put("searchResult", searchResult);
model.addAttribute("regionArea", regionArea);
model.addAttribute("currentCategoryCode", getCurrentCategoryCode(supplierParam.getCodelevel2(), result));
model.addAllAttributes(result);
model.addAllAttributes(getCurrentParam(supplierParam, result));
model.addAttribute("encodeKeyword", commonUtil.replaceKeywordStr(supplierParam.getKeyword()));
model.addAttribute("adPosition", commonUtil.getAdposition("recruit_ad_list"));
model.addAllAttributes(tdkUtil.getPageTDK(DataType.SUPPLIER, supplierParam));
} catch (Exception e) {
logger.error("Search supplier controller error", e);
}
return "supplier";
}
/**
* 获取当前已选择的参数
*/
private Map<String, Object> getCurrentParam(SupplierParam supplierParam, Map<String, Object> searchResult) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("currentLocation", "不限");
map.put("currentRegcapital", "不限");
map.put("currentQualification", "不限");
map.put("currentQualificationLevel", "不限");
map.put("currentEstablishYear", "不限");
Region region = dictionaryService.getRegionByCode(supplierParam.getLocation());
if (region != null) {
map.put("currentLocation", region.getName());
} else {
if ("china".equals(supplierParam.getLocation())) {
map.put("currentLocation", "全国");
}
}
if (!StringUtils.isBlank(supplierParam.getRegisteredcapital()) && NumberUtils.isNumber(supplierParam.getRegisteredcapital())) {
map.put("currentRegcapital", supplierParam.getRegisteredcapital());
}
if (!StringUtils.isBlank(supplierParam.getYear()) && NumberUtils.isNumber(supplierParam.getYear())) {
map.put("currentEstablishYear", supplierParam.getYear());
}
if (!StringUtils.isBlank(supplierParam.getQualification())) {
Qualification qualification = qualificationService.getQualificationByCode(supplierParam.getQualification());
if (qualification != null) {
map.put("currentQualification", qualification.getQualificationName());
}
}
if (!StringUtils.isBlank(supplierParam.getQualificationLevel())) {
QualificationLevel qualificationLevel = qualificationLevelService.getQualificationLevelByCode(supplierParam.getQualificationLevel());
if (qualificationLevel != null) {
map.put("currentQualificationLevel", qualificationLevel.getLevelName());
}
}
return map;
}
/**
* 得到当前搜索结果分类的上级分类编码
*/
private String getCurrentCategoryCode(String fccode, Map<String, Object> result) {
String currentCategoryCode = "";
if (!StringUtils.isBlank(fccode)) {
List<SearchCategoryVO> bcnList = (List<SearchCategoryVO>) result.get("relatedCategory");
for (SearchCategoryVO searchCategoryVO : bcnList) {
String parentCode = StringUtils.defaultString(searchCategoryVO.getCode());
boolean checked = false;
for (SearchCategoryVO child : searchCategoryVO.getChildrenList()) {
if (fccode.equals(child.getCode())) {
checked = true;
break;
}
}
if (checked) {
currentCategoryCode = parentCode;
break;
}
}
}
return currentCategoryCode;
}
} | [
"[email protected]"
] | |
74e7a4d987f27fa0e092e343785c4392a8183d19 | fa930bee168bd79923768d783dc7758948c367cc | /src/main/java/monnef/jaffas/food/command/CommandFridgeDebug.java | 101314f3d320f883ca74479abdb8f26863e518c1 | [
"LicenseRef-scancode-public-domain"
] | permissive | mnn/jaffas | d3ad9aefca71257f084977b0eebfcb81fa89d19b | 73f12e934a4b0c5425d6ca7a3b8fc93093844ffb | refs/heads/master | 2016-09-01T22:27:17.726980 | 2014-12-06T13:33:19 | 2014-12-06T13:33:19 | 6,065,869 | 3 | 3 | null | 2015-02-20T00:43:27 | 2012-10-03T19:57:31 | Java | UTF-8 | Java | false | false | 652 | java | /*
* Jaffas and more!
* author: monnef
*/
package monnef.jaffas.food.command;
import monnef.jaffas.food.block.TileFridge;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
public class CommandFridgeDebug extends CommandBase {
@Override
public String getCommandName() {
return "fridgedebug";
}
@Override
public String getCommandUsage(ICommandSender icommandsender) {
return "command.fridgedebug.usage";
}
@Override
public void processCommand(ICommandSender var1, String[] var2) {
TileFridge.tickDivider = TileFridge.tickDivider == 1 ? 20 : 1;
}
}
| [
"[email protected]"
] | |
46f08f843401e79c7fdf17d9c949597d0173d4c2 | 4aca56947e379a37f7265405802c3b85abb9ac34 | /rop-common/src/main/java/rop/thirdparty/com/google/common/escape/UnicodeEscaper.java | 097121e1a037f41bbeccaf70ec97b501861c89c4 | [] | no_license | icanfly/rop-plus | 1ae59ff86ae10457fa212c5ab3ca32f6839f2f43 | 1fd99541a81a3a339b9bcd190017d2769ed32ea0 | refs/heads/master | 2021-01-19T09:44:47.836028 | 2015-01-16T02:43:09 | 2015-01-16T02:43:09 | 21,155,040 | 3 | 4 | null | null | null | null | UTF-8 | Java | false | false | 13,356 | java | /*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rop.thirdparty.com.google.common.escape;
import static rop.thirdparty.com.google.common.base.Preconditions.checkNotNull;
import rop.thirdparty.com.google.common.annotations.Beta;
import rop.thirdparty.com.google.common.annotations.GwtCompatible;
/**
* An {@link Escaper} that converts literal text into a format safe for
* inclusion in a particular context (such as an XML document). Typically (but
* not always), the inverse process of "unescaping" the text is performed
* automatically by the relevant parser.
*
* <p>For example, an XML escaper would convert the literal string {@code
* "Foo<Bar>"} into {@code "Foo<Bar>"} to prevent {@code "<Bar>"} from
* being confused with an XML tag. When the resulting XML document is parsed,
* the parser API will return this text as the original literal string {@code
* "Foo<Bar>"}.
*
* <p><b>Note:</b> This class is similar to {@link CharEscaper} but with one
* very important difference. A CharEscaper can only process Java
* <a href="http://en.wikipedia.org/wiki/UTF-16">UTF16</a> characters in
* isolation and may not cope when it encounters surrogate pairs. This class
* facilitates the correct escaping of all Unicode characters.
*
* <p>As there are important reasons, including potential security issues, to
* handle Unicode correctly if you are considering implementing a new escaper
* you should favor using UnicodeEscaper wherever possible.
*
* <p>A {@code UnicodeEscaper} instance is required to be stateless, and safe
* when used concurrently by multiple threads.
*
* <p>Several popular escapers are defined as constants in classes like {@link
* rop.thirdparty.com.google.common.html.HtmlEscapers}, {@link
* rop.thirdparty.com.google.common.xml.XmlEscapers}, and {@link SourceCodeEscapers}. To create
* your own escapers extend this class and implement the {@link #escape(int)}
* method.
*
* @author David Beaumont
* @since 15.0
*/
@Beta
@GwtCompatible
public abstract class UnicodeEscaper extends Escaper {
/** The amount of padding (chars) to use when growing the escape buffer. */
private static final int DEST_PAD = 32;
/** Constructor for use by subclasses. */
protected UnicodeEscaper() {}
/**
* Returns the escaped form of the given Unicode code point, or {@code null}
* if this code point does not need to be escaped. When called as part of an
* escaping operation, the given code point is guaranteed to be in the range
* {@code 0 <= cp <= Character#MAX_CODE_POINT}.
*
* <p>If an empty array is returned, this effectively strips the input
* character from the resulting text.
*
* <p>If the character does not need to be escaped, this method should return
* {@code null}, rather than an array containing the character representation
* of the code point. This enables the escaping algorithm to perform more
* efficiently.
*
* <p>If the implementation of this method cannot correctly handle a
* particular code point then it should either throw an appropriate runtime
* exception or return a suitable replacement character. It must never
* silently discard invalid input as this may constitute a security risk.
*
* @param cp the Unicode code point to escape if necessary
* @return the replacement characters, or {@code null} if no escaping was
* needed
*/
protected abstract char[] escape(int cp);
/**
* Scans a sub-sequence of characters from a given {@link CharSequence},
* returning the index of the next character that requires escaping.
*
* <p><b>Note:</b> When implementing an escaper, it is a good idea to override
* this method for efficiency. The base class implementation determines
* successive Unicode code points and invokes {@link #escape(int)} for each of
* them. If the semantics of your escaper are such that code points in the
* supplementary range are either all escaped or all unescaped, this method
* can be implemented more efficiently using {@link CharSequence#charAt(int)}.
*
* <p>Note however that if your escaper does not escape characters in the
* supplementary range, you should either continue to validate the correctness
* of any surrogate characters encountered or provide a clear warning to users
* that your escaper does not validate its input.
*
* <p>See {@link rop.thirdparty.com.google.common.net.PercentEscaper} for an example.
*
* @param csq a sequence of characters
* @param start the index of the first character to be scanned
* @param end the index immediately after the last character to be scanned
* @throws IllegalArgumentException if the scanned sub-sequence of {@code csq}
* contains invalid surrogate pairs
*/
protected int nextEscapeIndex(CharSequence csq, int start, int end) {
int index = start;
while (index < end) {
int cp = codePointAt(csq, index, end);
if (cp < 0 || escape(cp) != null) {
break;
}
index += Character.isSupplementaryCodePoint(cp) ? 2 : 1;
}
return index;
}
/**
* Returns the escaped form of a given literal string.
*
* <p>If you are escaping input in arbitrary successive chunks, then it is not
* generally safe to use this method. If an input string ends with an
* unmatched high surrogate character, then this method will throw
* {@link IllegalArgumentException}. You should ensure your input is valid <a
* href="http://en.wikipedia.org/wiki/UTF-16">UTF-16</a> before calling this
* method.
*
* <p><b>Note:</b> When implementing an escaper it is a good idea to override
* this method for efficiency by inlining the implementation of
* {@link #nextEscapeIndex(CharSequence, int, int)} directly. Doing this for
* {@link rop.thirdparty.com.google.common.net.PercentEscaper} more than doubled the
* performance for unescaped strings (as measured by {@link
* CharEscapersBenchmark}).
*
* @param string the literal string to be escaped
* @return the escaped form of {@code string}
* @throws NullPointerException if {@code string} is null
* @throws IllegalArgumentException if invalid surrogate characters are
* encountered
*/
@Override
public String escape(String string) {
checkNotNull(string);
int end = string.length();
int index = nextEscapeIndex(string, 0, end);
return index == end ? string : escapeSlow(string, index);
}
/**
* Returns the escaped form of a given literal string, starting at the given
* index. This method is called by the {@link #escape(String)} method when it
* discovers that escaping is required. It is protected to allow subclasses
* to override the fastpath escaping function to inline their escaping test.
* See {@link CharEscaperBuilder} for an example usage.
*
* <p>This method is not reentrant and may only be invoked by the top level
* {@link #escape(String)} method.
*
* @param s the literal string to be escaped
* @param index the index to start escaping from
* @return the escaped form of {@code string}
* @throws NullPointerException if {@code string} is null
* @throws IllegalArgumentException if invalid surrogate characters are
* encountered
*/
protected final String escapeSlow(String s, int index) {
int end = s.length();
// Get a destination buffer and setup some loop variables.
char[] dest = Platform.charBufferFromThreadLocal();
int destIndex = 0;
int unescapedChunkStart = 0;
while (index < end) {
int cp = codePointAt(s, index, end);
if (cp < 0) {
throw new IllegalArgumentException(
"Trailing high surrogate at end of input");
}
// It is possible for this to return null because nextEscapeIndex() may
// (for performance reasons) yield some false positives but it must never
// give false negatives.
char[] escaped = escape(cp);
int nextIndex = index + (Character.isSupplementaryCodePoint(cp) ? 2 : 1);
if (escaped != null) {
int charsSkipped = index - unescapedChunkStart;
// This is the size needed to add the replacement, not the full
// size needed by the string. We only regrow when we absolutely must.
int sizeNeeded = destIndex + charsSkipped + escaped.length;
if (dest.length < sizeNeeded) {
int destLength = sizeNeeded + (end - index) + DEST_PAD;
dest = growBuffer(dest, destIndex, destLength);
}
// If we have skipped any characters, we need to copy them now.
if (charsSkipped > 0) {
s.getChars(unescapedChunkStart, index, dest, destIndex);
destIndex += charsSkipped;
}
if (escaped.length > 0) {
System.arraycopy(escaped, 0, dest, destIndex, escaped.length);
destIndex += escaped.length;
}
// If we dealt with an escaped character, reset the unescaped range.
unescapedChunkStart = nextIndex;
}
index = nextEscapeIndex(s, nextIndex, end);
}
// Process trailing unescaped characters - no need to account for escaped
// length or padding the allocation.
int charsSkipped = end - unescapedChunkStart;
if (charsSkipped > 0) {
int endIndex = destIndex + charsSkipped;
if (dest.length < endIndex) {
dest = growBuffer(dest, destIndex, endIndex);
}
s.getChars(unescapedChunkStart, end, dest, destIndex);
destIndex = endIndex;
}
return new String(dest, 0, destIndex);
}
/**
* Returns the Unicode code point of the character at the given index.
*
* <p>Unlike {@link Character#codePointAt(CharSequence, int)} or
* {@link String#codePointAt(int)} this method will never fail silently when
* encountering an invalid surrogate pair.
*
* <p>The behaviour of this method is as follows:
* <ol>
* <li>If {@code index >= end}, {@link IndexOutOfBoundsException} is thrown.
* <li><b>If the character at the specified index is not a surrogate, it is
* returned.</b>
* <li>If the first character was a high surrogate value, then an attempt is
* made to read the next character.
* <ol>
* <li><b>If the end of the sequence was reached, the negated value of
* the trailing high surrogate is returned.</b>
* <li><b>If the next character was a valid low surrogate, the code point
* value of the high/low surrogate pair is returned.</b>
* <li>If the next character was not a low surrogate value, then
* {@link IllegalArgumentException} is thrown.
* </ol>
* <li>If the first character was a low surrogate value,
* {@link IllegalArgumentException} is thrown.
* </ol>
*
* @param seq the sequence of characters from which to decode the code point
* @param index the index of the first character to decode
* @param end the index beyond the last valid character to decode
* @return the Unicode code point for the given index or the negated value of
* the trailing high surrogate character at the end of the sequence
*/
protected static int codePointAt(CharSequence seq, int index, int end) {
checkNotNull(seq);
if (index < end) {
char c1 = seq.charAt(index++);
if (c1 < Character.MIN_HIGH_SURROGATE ||
c1 > Character.MAX_LOW_SURROGATE) {
// Fast path (first test is probably all we need to do)
return c1;
} else if (c1 <= Character.MAX_HIGH_SURROGATE) {
// If the high surrogate was the last character, return its inverse
if (index == end) {
return -c1;
}
// Otherwise look for the low surrogate following it
char c2 = seq.charAt(index);
if (Character.isLowSurrogate(c2)) {
return Character.toCodePoint(c1, c2);
}
throw new IllegalArgumentException(
"Expected low surrogate but got char '" + c2 +
"' with value " + (int) c2 + " at index " + index +
" in '" + seq + "'");
} else {
throw new IllegalArgumentException(
"Unexpected low surrogate character '" + c1 +
"' with value " + (int) c1 + " at index " + (index - 1) +
" in '" + seq + "'");
}
}
throw new IndexOutOfBoundsException("Index exceeds specified range");
}
/**
* Helper method to grow the character buffer as needed, this only happens
* once in a while so it's ok if it's in a method call. If the index passed
* in is 0 then no copying will be done.
*/
private static char[] growBuffer(char[] dest, int index, int size) {
char[] copy = new char[size];
if (index > 0) {
System.arraycopy(dest, 0, copy, 0, index);
}
return copy;
}
}
| [
"[email protected]"
] | |
fd2429e2cb11e9b069c0a99d561f79c74ab41394 | cdaf2ae441681e01735e47fa19d8bd9da69ab9b9 | /app/src/test/java/demo/com/hightlighttextview/ExampleUnitTest.java | d695efbc2dd3bf27bf9f83a4eaed52a40b27a022 | [] | no_license | ouyang1596/HightLightTextView | 6be6880b549ce6159baa3811f8a762d9c73787bd | 60f8770df4c8167cd1d838383e3225f129b6aa00 | refs/heads/master | 2020-07-27T20:31:28.399748 | 2019-09-18T08:40:39 | 2019-09-18T08:40:39 | 209,208,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package demo.com.hightlighttextview;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
2c985998ab3cc78f0afd27277b5ffeb1af414f2b | 3907166d1edee80d4c2f55ea0990f8450874db24 | /src/com/yoxi/hudongtui/vo/user/ThirdVO.java | 4df3f6f0cf5e354ea5b14cd8a6d8cb9b3ad8188b | [] | no_license | yhguojunjie/youhui | 7c0e25ea5c572efdf946d2393f3ad68ceb4624d5 | a4a6ccccc50d436ac74198ddbf1bba091b93ff71 | refs/heads/master | 2021-01-23T08:56:20.178897 | 2015-08-25T14:38:25 | 2015-08-25T14:38:25 | 39,307,420 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package com.yoxi.hudongtui.vo.user;
/**
*
* 第三方用户登录注册返回
*
* @author wql
*
*/
public class ThirdVO {
/**
* 用户id
*/
public Integer userId;
/**
* 是否已更新
*/
private Boolean isUpdated;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Boolean getIsUpdated() {
return isUpdated;
}
public void setIsUpdated(Boolean isUpdated) {
this.isUpdated = isUpdated;
}
}
| [
"[email protected]"
] | |
dafc174213db613a8d31aa7d44d2c2787e74e24d | d0b66cfbc11e9d7453351acc342ed1222875ee1d | /app/src/main/java/com/example/calendarmanagerbeta/onParamsChangedListener.java | 2cbb60db67f1ea2400eba66f2df0d63f574b6ad7 | [] | no_license | durianpancakes/Calendar_manager | be0427a5891bc53dd88d7a97bc3495aacdd69ec9 | 637267928edbe30c62642217f6774e0ddce8a729 | refs/heads/master | 2022-12-03T20:48:33.483606 | 2020-08-19T16:57:42 | 2020-08-19T16:57:42 | 264,445,365 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.example.calendarmanagerbeta;
public interface onParamsChangedListener {
void lectureChanged(String moduleCode, String lessonType, String classNo);
void tutorialChanged(String moduleCode, String lessonType, String classNo);
void stChanged(String moduleCode, String lessonType, String classNo);
void recitationChanged(String moduleCode, String lessonType, String classNo);
void moduleRemoved(String moduleCode);
void laboratoryChanged(String moduleCode, String lessonType, String classNo);
void examObtained(String moduleCode, String lessonType, String classNo);
}
| [
"[email protected]"
] | |
d31ff50ee833d45dce94c6c670053bc0bee4f5fe | 76a3d260eb7e48df372daef31b83424e80d2e96c | /signBillsFlow/app/ec/com/kruger/business/BillingApiControllerImpInterface.java | 524784eab47f323f43d0c116898371d6353df31f | [
"MIT"
] | permissive | christiandgv/fbkSign | 753b77dc5b59459e63935369a7fed2bd25786f65 | e3304495fd47ac5ce0fdbb968d5d7146db5e55a9 | refs/heads/master | 2020-08-22T00:29:56.400068 | 2019-10-19T23:12:47 | 2019-10-19T23:12:47 | 216,280,974 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package ec.com.kruger.business;
import java.util.concurrent.CompletionStage;
import ec.com.kruger.data.Billing;
import ec.com.kruger.data.ModelApiResponse;
import ec.com.kruger.data.RequestMessage;
public interface BillingApiControllerImpInterface {
CompletionStage<ModelApiResponse> newBilling(RequestMessage body) throws Exception;
}
| [
"[email protected]"
] | |
9ec31f9675852cb22e4832effed775788aced702 | e6212ad90c51db28c03641675dbce0a5acd2d637 | /app/src/main/java/com/scout/mvp_retrofit_recyclerview/MVP/MainActivityPresenter.java | 3000efc50b69cd4399d780a1d23f92a4fdd71152 | [] | no_license | bhavesh3005sharma/MVP-Tutorial | e1a6362c6b50ef4ca84cc4e0a4a834289a18fa54 | 9820d482e93e2a7a4024aea0cf5abe30f60b9ecd | refs/heads/master | 2022-11-13T04:01:29.549514 | 2020-07-03T09:04:18 | 2020-07-03T09:04:18 | 276,856,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | package com.scout.mvp_retrofit_recyclerview.MVP;
import com.scout.mvp_retrofit_recyclerview.Model.ModelMainActivity;
import com.scout.mvp_retrofit_recyclerview.Model.ModelUsers;
import java.util.ArrayList;
public class MainActivityPresenter implements MainActivityContract.Presenter {
MainActivityContract.View view;
MainActivityContract.Model model;
public MainActivityPresenter(MainActivityContract.View view) {
this.view = view;
this.model = new ModelMainActivity(MainActivityPresenter.this);
}
@Override
public void loadUsersData() {
model.getUsersList();
}
@Override
public void OnSuccess(ArrayList<ModelUsers> data) {
if (view!=null) {
view.updateUi(data);
}
}
@Override
public void onError(String error) {
if (view!=null)
view.setErrorUi(error);
}
@Override
public void start() {
view.initUi();
}
}
| [
"[email protected]"
] | |
2e39e42559d8b714a3ff7b6531c2952e22275b1b | 17c1a4187beaf04be45284c71b872b94442471d3 | /app/src/main/java/com/example/michalizralevitch/memorygame/MainActivity.java | b02e874ef47f831ce3c34d4083e77666d3008c4e | [] | no_license | Mizralevitch/Memory-Game | 7404cb3803b6d43a0b86421dccb052d36001379b | 55f38a7c5fb2303ec5386f58bce2e2382ec5cb63 | refs/heads/master | 2021-01-09T06:44:45.841992 | 2017-02-06T10:21:01 | 2017-02-06T10:21:01 | 81,074,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,313 | java | package com.example.michalizralevitch.memorygame;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import java.util.Random;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
//Memory game with 3 stages
private Toolbar toolbar;
private static final int GAME_OVER_REQUEST_CODE=1;
private int NUM_ROWS;
private int NUM_COLUMNS;
public LinearLayout linearLayout;
int counter;
int[]numbers;
private static int scoreSoFar=0;
private int scoreTemporarly;
boolean streamMusic=true;
int[]images={R.drawable.monster1,R.drawable.monster2,R.drawable.monster3,R.drawable.monster4
,R.drawable.monster5,R.drawable.monster6,R.drawable.monster7,R.drawable.monster8,
R.drawable.monster9,R.drawable.monster10,R.drawable.monster11,R.drawable.monster12,
R.drawable.monster13,R.drawable.monster14,R.drawable.monster15};
private int turns;
private ImageView previousCard;
int rightGuesses =0;
private AdView mAdView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.tool_bar);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
}
mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.build();
mAdView.loadAd(adRequest);
startNewGame(4, 3, 0);
}
private void startNewGame(int numRows, int numColoums, int score){
if (numRows==7){
this.NUM_ROWS=6;
this.NUM_COLUMNS=5;
}else {
this.NUM_ROWS = numRows;
this.NUM_COLUMNS = numColoums;
}
numbers=new int[(NUM_COLUMNS*NUM_ROWS)];
scoreTemporarly=0;
scoreSoFar=score;
buildBoard();
setUpNumbersArray();
counter=0;
rightGuesses=0;
turns=0;
for (int i = 0; i <numbers.length ; i++) {
previousCard=(ImageView)linearLayout.findViewWithTag(i);
previousCard.setImageResource(R.drawable.card1);
previousCard.setOnClickListener(this);
}
shuffle();
}
private void buildBoard() {
if (linearLayout!=null)
linearLayout.removeAllViews();
linearLayout=(LinearLayout)findViewById(R.id.main_layout);
LinearLayout.LayoutParams params =new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
params.weight=1;
for (int i = 0; i <NUM_ROWS ; i++) {
LinearLayout rowLayout=new LinearLayout(this);
for (int j = 0; j <NUM_COLUMNS ; j++) {
ImageView imageView = new ImageView(this);
imageView.setTag(counter++);
imageView.setOnClickListener(this);
imageView.setImageResource(R.drawable.card1);
imageView.setPadding(5,3,5,3);
rowLayout.addView(imageView,params);
}
linearLayout.addView(rowLayout,params);
}
}
private void setUpNumbersArray() {
for (int i = 0; i <numbers.length ; i++) {
numbers[i]=(i/2);
}
}
private void shuffle(){
int temp=0;
Random random=new Random();
for (int i = 0; i <numbers.length ; i++) {
int r=random.nextInt(numbers.length);
temp=numbers[i];
numbers[i]=numbers[r];
numbers[r]=temp;
}
}
@Override
public void onClick(View v) {
ImageView clickCard = (ImageView) v;
int image = images[numbers[(int) v.getTag()]];
clickCard.setImageResource(image);
if (clickCard != previousCard) {
if (turns % 2 != 0) {
if (checkCards(clickCard, previousCard)) {
clickCard.setOnClickListener(null);
previousCard.setOnClickListener(null);
MediaPlayer mPlayer = MediaPlayer.create(this,R.raw.tada);
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
if (streamMusic)
mPlayer.start();
rightGuesses++;
} else {
WrongThread thread = new WrongThread(clickCard, previousCard);
thread.start();
}
} else
previousCard = clickCard;
turns++;
if (rightGuesses==(NUM_COLUMNS*NUM_ROWS)/2){
scoreTemporarly=(NUM_COLUMNS*NUM_ROWS*3-turns);
if (scoreTemporarly<0)
scoreTemporarly=0;
scoreSoFar+=scoreTemporarly;
Intent intent= new Intent(this,EndActivity.class);
intent.putExtra("SCORE", scoreSoFar);
intent.putExtra("MUTE?",streamMusic);
startActivityForResult(intent,GAME_OVER_REQUEST_CODE);
}
}
}
private boolean checkCards(ImageView clickedCard, ImageView previousCard){
return numbers[(int)previousCard.getTag()]==numbers[(int)clickedCard.getTag()];
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode==GAME_OVER_REQUEST_CODE){
switch (resultCode){
case EndActivity.PREVIOUSLEVEL:
startNewGame(NUM_ROWS,NUM_COLUMNS,scoreSoFar-scoreTemporarly);
break;
case EndActivity.NEXTLEVEL:
startNewGame(NUM_ROWS+1,NUM_COLUMNS+1,scoreSoFar);
break;
case EndActivity.QUIT:
finish();
}
}
}
@Override
public void onPause() {
if (mAdView != null) {
mAdView.pause();
}
super.onPause();
}
@Override
public void onResume() {
super.onResume();
if (mAdView != null) {
mAdView.resume();
}
}
@Override
public void onDestroy() {
if (mAdView != null) {
mAdView.destroy();
}
super.onDestroy();
}
public void muteOrUnmute(final View view) {
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (streamMusic) {
view.setBackgroundResource(R.drawable.mute_sound);
streamMusic = false;
}else {
view.setBackgroundResource(R.drawable.unmute_sounds);
streamMusic=true;
}
}
});
}
}
| [
"[email protected]"
] | |
f55fe96adc0fe86495d2bd07dafb3ec49c4adbd8 | 6ca4085e43374e90742b6032b15303fb3b1c1602 | /Project 0/NBody.java | a0a6486a58085b5774df797164776c679eeb08d9 | [] | no_license | hanaoli/CS61B-Data-Structures | 1e06024f1417bd62393333a5362161fe0826fb7c | f14a5bcdc911b0d5f083b7dd9ecaa17b66600976 | refs/heads/master | 2022-06-25T15:47:16.098642 | 2020-05-05T01:21:30 | 2020-05-05T01:21:30 | 260,802,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,514 | java | public class NBody {
/* Return radius of the universe */
public static double readRadius(String path) {
In file = new In(path);
file.readDouble();
return file.readDouble();
}
/* Return array of planets in the path text file */
public static Planet[] readPlanets(String path) {
In file = new In(path);
int N = file.readInt();
Planet[] p = new Planet[N];
file.readDouble();
int i = 0;
while (i < N) {
double xP = file.readDouble();
double yP = file.readDouble();
double xV = file.readDouble();
double yV = file.readDouble();
double m = file.readDouble();
String img = file.readString();
p[i] = new Planet(xP, yP, xV, yV, m, img);
i += 1;
}
return p;
}
public static void main(String[] args) {
if (args.length < 3) {
System.out.println("Please enter the correct command line arguments.");
System.out.println("e.g. java NBody 157788000.0 25000.0 data/planets.txt");
}
double T = Double.parseDouble(args[0]);
double dT = Double.parseDouble(args[1]);
String filename = args[2];
double radius = readRadius(filename);
Planet[] p = readPlanets(filename);
String imageToDraw = "images/starfield.jpg";
int i = 0;
double time = 0.0;
while (time < T) {
double[] xForces = new double[p.length];
double[] yForces = new double[p.length];
i = 0;
while (i < p.length) {
xForces[i] = p[i].calcNetForceExertedByX(p);
yForces[i] = p[i].calcNetForceExertedByY(p);
i += 1;
}
i = 0;
while (i < p.length) {
p[i].update(dT, xForces[i], yForces[i]);
i += 1;
}
StdDraw.setScale(-radius, radius);
StdDraw.picture(0, 0, imageToDraw);
i = 0;
while (i < p.length) {
p[i].draw();
i += 1;
}
StdDraw.show(10);
time += dT;
}
StdOut.printf("%d\n", p.length);
StdOut.printf("%.2e\n", radius);
for (i = 0; i < p.length; i++) {
StdOut.printf("%11.4e %11.4e %11.4e %11.4e %11.4e %12s\n", p[i].xxPos, p[i].yyPos, p[i].xxVel, p[i].yyVel, p[i].mass, p[i].imgFileName);
}
}
}
| [
"[email protected]"
] | |
6974d651b06703cc4a3591973ee8a39d4b724f61 | a17ef4174f6141939c28886e72e6f827454386c2 | /common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/other/HolderEditor.java | d714f4db2b7c285db9cb151f7b71fd4acbe824ed | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | SpongeAPI-Russian/LuckPerms | 794055d483f71181116458ac0d63875d9c024742 | 36b6478c77ba5a816c537f19d6cb832dc18d7e4c | refs/heads/master | 2021-09-04T23:50:43.327626 | 2018-01-22T21:53:27 | 2018-01-22T21:53:27 | 113,488,559 | 0 | 0 | null | 2017-12-07T19:09:06 | 2017-12-07T19:09:05 | null | UTF-8 | Java | false | false | 5,273 | java | /*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <[email protected]>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.lucko.luckperms.common.commands.impl.generic.other;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import me.lucko.luckperms.common.commands.ArgumentPermissions;
import me.lucko.luckperms.common.commands.CommandPermission;
import me.lucko.luckperms.common.commands.CommandResult;
import me.lucko.luckperms.common.commands.abstraction.SubCommand;
import me.lucko.luckperms.common.commands.sender.Sender;
import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.locale.CommandSpec;
import me.lucko.luckperms.common.locale.LocaleManager;
import me.lucko.luckperms.common.locale.Message;
import me.lucko.luckperms.common.model.PermissionHolder;
import me.lucko.luckperms.common.model.User;
import me.lucko.luckperms.common.node.NodeModel;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.utils.Predicates;
import me.lucko.luckperms.common.webeditor.WebEditorUtils;
import net.kyori.text.Component;
import net.kyori.text.TextComponent;
import net.kyori.text.event.ClickEvent;
import net.kyori.text.event.HoverEvent;
import net.kyori.text.format.TextColor;
import java.util.List;
public class HolderEditor<T extends PermissionHolder> extends SubCommand<T> {
public HolderEditor(LocaleManager locale, boolean user) {
super(CommandSpec.HOLDER_EDITOR.spec(locale), "editor", user ? CommandPermission.USER_EDITOR : CommandPermission.GROUP_EDITOR, Predicates.alwaysFalse());
}
@Override
public CommandResult execute(LuckPermsPlugin plugin, Sender sender, T holder, List<String> args, String label) {
if (ArgumentPermissions.checkViewPerms(plugin, sender, getPermission().get(), holder)) {
Message.COMMAND_NO_PERMISSION.send(sender);
return CommandResult.NO_PERMISSION;
}
Message.EDITOR_START.send(sender);
// form the payload data
JsonObject payload = new JsonObject();
payload.addProperty("who", WebEditorUtils.getHolderIdentifier(holder));
payload.addProperty("whoFriendly", holder.getFriendlyName());
if (holder.getType().isUser()) {
payload.addProperty("whoUuid", ((User) holder).getUuid().toString());
}
payload.addProperty("cmdAlias", label);
payload.addProperty("uploadedBy", sender.getNameWithLocation());
payload.addProperty("uploadedByUuid", sender.getUuid().toString());
payload.addProperty("time", System.currentTimeMillis());
// attach the holders permissions
payload.add("nodes", WebEditorUtils.serializePermissions(holder.getEnduringNodes().values().stream().map(NodeModel::fromNode)));
// attach an array of all permissions known to the server, to use for tab completion in the editor
JsonArray knownPermsArray = new JsonArray();
for (String perm : plugin.getPermissionVault().rootAsList()) {
knownPermsArray.add(new JsonPrimitive(perm));
}
payload.add("knownPermissions", knownPermsArray);
// upload the payload data to gist
String gistId = WebEditorUtils.postToGist(new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create().toJson(payload));
if (gistId == null) {
Message.EDITOR_UPLOAD_FAILURE.send(sender);
return CommandResult.STATE_ERROR;
}
// form a url for the editor
String url = plugin.getConfiguration().get(ConfigKeys.WEB_EDITOR_URL_PATTERN) + "?" + gistId;
Message.EDITOR_URL.send(sender);
Component message = TextComponent.builder(url).color(TextColor.AQUA)
.clickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url))
.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to open the editor.").color(TextColor.GRAY)))
.build();
sender.sendMessage(message);
return CommandResult.SUCCESS;
}
}
| [
"[email protected]"
] | |
4538b02edbde62bf73500d2186b65733558352b2 | 34b96ee59b8a7ec9c0ccba9d08ef6c2cd8ef7572 | /library/router/src/main/java/com/freeme/freemelite/attendance/router/datapush/interfaces/IDataPush.java | 8a9f7aabd76904c9c99e77f9edd068e6a311e489 | [] | no_license | pinmingqigou/checkindevice | b3eda758c6fcef6b3229e3360ac8701880045d1b | cea319ee6f0cb0979a07da888fe64833f82b7b50 | refs/heads/master | 2020-03-22T15:48:31.340487 | 2018-07-09T12:09:39 | 2018-07-09T12:09:39 | 140,280,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | package com.freeme.freemelite.attendance.router.datapush.interfaces;
import android.app.Application;
import com.freeme.freemelite.attendance.router.datapush.model.BaseDataPushRequestModel;
public interface IDataPush {
void init(Application context);
void pushSingleData(BaseDataPushRequestModel baseRequestModel);
void pushGroupData();
void release();
}
| [
"[email protected]"
] | |
95522393e404d5edc7254988ec3725b8ae4df9a3 | e61e265fe51121d3789b240511e1aea8361efc6d | /proj1/src/_04_Abstract/wildanimal.java | ae119f6738efef52ed0cf6ac0b6f06e7bc0c72c2 | [] | no_license | vlvlearning/Java | 2b6d8ac6b9417a07a4f76c3cc5d21a14eb00e950 | bbf4704cdaf3dd250b18fe9dc020563de4684c26 | refs/heads/master | 2021-07-20T15:24:54.159058 | 2020-09-26T16:54:20 | 2020-09-26T16:54:20 | 216,403,149 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | package _04_Abstract;
public class wildanimal extends Animal {
@Override
void sound() {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
c518f789b728a89e74d73be19448a14b9b27dab0 | 0a4150ee2d25ec3bdab8f284e4e1aca98260e4a3 | /DesktopApp/src/main/java/desktopApp/LoaderFXML.java | a1b0967417517b5a753d08b430cc9183ec80fdf6 | [] | no_license | NorbertKusmierczyk/PWSIP_2019_PZ2_GR3 | 10e4a59d3a64ad778ea05d7da43ba9fec5756226 | d79610716c7477c9169ca557953cc05afd8a8c0a | refs/heads/master | 2022-07-20T07:28:16.515585 | 2019-06-20T10:33:24 | 2019-06-20T10:33:24 | 175,230,262 | 3 | 0 | null | 2022-06-21T01:05:45 | 2019-03-12T14:33:33 | Java | UTF-8 | Java | false | false | 766 | java | package desktopApp;
import desktopApp.config.Config;
import desktopApp.controlers.LoginBarController;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Label;
import javafx.util.Callback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;
@Component
public class LoaderFXML {
@Autowired
private AnnotationConfigApplicationContext context;
public FXMLLoader getLoader(String path){
FXMLLoader loader = new FXMLLoader();
loader.setControllerFactory(context::getBean);
loader.setLocation(getClass().getResource(path));
return loader;
}
}
| [
"[email protected]"
] | |
8a97dab7fab6157082adc15567b8e791e7f1e4a8 | c07697b7f4e45147055eb74a5e8fbabe419b15d8 | /thezo/src/main/java/com/kh/thezo/mail/controller/CheckInbox.java | 0cabd61ed53a49ec116e2d5bab3b7c71d8ff09e0 | [] | no_license | Frodo-J/thezo | 28a11630b1f59c78034c8c5c7a83a835117ed7d9 | 0d27b13c3b134d49e3613d9c4ab37a206420456b | refs/heads/main | 2023-07-12T21:57:46.917772 | 2021-08-25T12:05:29 | 2021-08-25T12:05:29 | 399,685,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,269 | java | package com.kh.thezo.mail.controller;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.NoSuchProviderException;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.internet.MimeBodyPart;
import org.springframework.stereotype.Controller;
import com.kh.thezo.mail.model.vo.Attachment;
import com.kh.thezo.mail.model.vo.Mail;
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
import com.sun.org.apache.xml.internal.security.utils.Base64;
@Controller
public class CheckInbox {
public ArrayList<Mail> receiveMailAttachedFile(String savePath, int memNo, String user, String currentTime) throws MessagingException {
ArrayList<Mail> mList = new ArrayList<>();
if (user.equals("[email protected]") || user.equals("[email protected]")) {
// 로그인에 필요한 계정 세팅
String host = "pop.daum.net";
String password = "skfem11!";
try {
// mail에 pop3 로 연결
Properties prop = new Properties();
prop.put("mail.pop3.host", host);
prop.put("mail.pop3.port", 995);
prop.put("mail.pop3.starttls.enable", "true");
Session emailSession = Session.getDefaultInstance(prop);
Store store = emailSession.getStore("pop3s");
store.connect(host, user, password);
// 받은편지함을 INBOX 라고 한다.
Folder inbox = store.getFolder("INBOX");
inbox.open(Folder.READ_WRITE);
Message[] arrayMessages = inbox.getMessages();
for (int i = arrayMessages.length; i > 0; i--) {
// 메일객체를 생성해서 마지막에 arrayList에 담은 후 service에 넘길예정
Mail mm = new Mail();
mm.setMemNo(memNo);
Message msg = arrayMessages[i - 1];
if (msg != null) {
// 메일 내용 변수에 담기(보낸사람)
Address[] fromAddress = msg.getFrom();
String from = fromAddress[0].toString();
// 만약 꺽쇠로 되어있다면 꺽쇠 안의 내용만 가져옴
if (from.indexOf(">") != -1) {
mm.setSender(from.substring(from.indexOf("<") + 1, from.indexOf(">")));
} else {
mm.setSender(from);
}
// 메일 내용 변수에 담기(제목)
String subject = msg.getSubject();
mm.setMailTitle(subject);
if (msg.getSentDate() != null) {
mm.setSendDate(new SimpleDateFormat("yyyy-MM-dd").format(msg.getSentDate()));
mm.setReceiveDate(new SimpleDateFormat("yyyy-MM-dd").format(msg.getSentDate()));
} else {
mm.setSendDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
mm.setReceiveDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
}
mm.setFolder("받은");
// 첨부파일이 있는지 확인하기 위해 contentType을 변수에 담음
String contentType = msg.getContentType();
// 디코딩 작업 이후에 담기위한 빈 변수 생성
String messageContent = "";
String attachFiles = "";
String sendTo = "";
if (msg.getRecipients(Message.RecipientType.TO) != null) {
for (int j = 0; j < msg.getRecipients(Message.RecipientType.TO).length; j++) {
String tempRecip = msg.getRecipients(Message.RecipientType.TO)[j].toString();
if (tempRecip.indexOf(">") != -1) {
int idx = tempRecip.indexOf("<") + 1;
int idx2 = tempRecip.indexOf(">");
sendTo += tempRecip.substring(idx, idx2) + ",";
} else {
sendTo += tempRecip + ",";
}
}
mm.setReceiver(sendTo);
} else {
mm.setReceiver(user);
}
String refTo = "";
if (msg.getRecipients(Message.RecipientType.CC) != null) {
for (int j = 0; j < msg.getRecipients(Message.RecipientType.CC).length; j++) {
String tempRefTo = msg.getRecipients(Message.RecipientType.CC)[j].toString();
if (tempRefTo.indexOf(">") != -1) {
int idx = tempRefTo.indexOf("<") + 1;
int idx2 = tempRefTo.indexOf(">");
refTo += tempRefTo.substring(idx, idx2) + ",";
} else {
refTo += tempRefTo + ",";
}
}
mm.setRefReceiver(refTo);
}
// 첨부파일이 있는지 확인
if (contentType.contains("multipart")) {
// service에 넘겨주기위한 첨부 arrayList객체 생성
ArrayList<Attachment> atList = new ArrayList<>();
// multipart객체에 내용을 담고
Multipart multiPart = (Multipart) msg.getContent();
int numberOfParts = multiPart.getCount();
// 첨부파일 있을 경우 지정 폴더로 저장
int attachLevel = 1;
for (int partCount = 0; partCount < numberOfParts; partCount++) {
MimeBodyPart part = (MimeBodyPart) multiPart.getBodyPart(partCount);
if (Part.ATTACHMENT.equalsIgnoreCase(part.getDisposition())) {
// fileName을 우선 디코드 해준다
String fileName = "";
try {
fileName = FilenameBase64Decode(part.getFileName());
} catch (Base64DecodingException e) {
e.printStackTrace();
}
// arrayList에 담기위한 첨부파일 객체를 생성하고
Attachment at = new Attachment();
// 저장경로를 생성
int ranNum = (int) (Math.random() * 90000 + 10000);
// 디코드 된 파일 이름을 originName에 담고
String originName = fileName;
at.setOriginName(fileName);
// 새로운 파일 이름에 붙여줄 확장자 가져옴
String ext = originName.substring(originName.lastIndexOf("."));
// 랜덤함수를 이용해서 새로운 파일이름 설정
String changeName = currentTime + ranNum + ext;
// 파일 경로를 지정해주고
at.setFileUrl("resources/uploadFiles/mail/" + changeName);
// 파일이 여러개일경우 순차적으로 접근하기 위해 레벨을 설정
at.setFileLevel(attachLevel);
attachLevel++;
at.setFileType("받은메일");
// 폴더에 저장하는 메소드
part.saveFile(savePath + File.separator + changeName);
atList.add(at);
}
// 첨부파일이 아닌 메일 내용은 따로 저장
if (part.getContentType().contains("multipart/alternative")
|| part.getContentType().contains("text")) {
try {
messageContent = FilenameBase64Decode(getText(part));
} catch (Base64DecodingException e) {
e.printStackTrace();
}
}
}
if (attachFiles.length() > 1) {
attachFiles = attachFiles.substring(0, attachFiles.length() - 2);
}
mm.setAt(atList);
// 첨부파일이 없다면
} else if (contentType.contains("text/plain") || contentType.contains("text/html")) {
// 그냥 내용을 그대로 저장
Object content = msg.getContent();
if (content != null) {
messageContent = content.toString();
}
}
mm.setMailContent(messageContent);
mList.add(mm);
msg.setFlag(Flags.Flag.DELETED, true);
}
}
// disconnect
inbox.close(true);
store.close();
} catch (NoSuchProviderException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
}
return mList;
}
// 첨부파일이 담긴 메일 수신 시 내용 출력
private String getText(Part p) throws MessagingException, IOException {
boolean textIsHtml = false;
if (p.isMimeType("text/*")) {
String s = (String)p.getContent();
textIsHtml = p.isMimeType("text/html");
return s;
}
if (p.isMimeType("multipart/alternative")) {
Multipart mp = (Multipart)p.getContent();
String text = null;
for (int i = 0; i < mp.getCount(); i++) {
Part bp = mp.getBodyPart(i);
if (bp.isMimeType("text/plain")) {
if (text == null)
text = getText(bp);
continue;
} else if (bp.isMimeType("text/html")) {
String s = getText(bp);
if (s != null)
return s;
} else {
return getText(bp);
}
}
return text;
} else if (p.isMimeType("multipart/*")) {
Multipart mp = (Multipart)p.getContent();
for (int i = 0; i < mp.getCount(); i++) {
String s = getText(mp.getBodyPart(i));
if (s != null)
return s;
}
}
return null;
}
//base64인코딩 된 내용 디코딩처리
public static String FilenameBase64Decode(String fileName)
throws UnsupportedEncodingException, Base64DecodingException {
String result = "";
String tmpStr = "";
String[] decodeInfo;
int startIndex = 0;
int endIndex = 0;
boolean decodingFlag = true;
//1. 문자열을 디코딩 해야 하는지 판단하고
if(fileName.indexOf("=?") == -1){
decodingFlag = false;
result = fileName;
}
while (decodingFlag) {
if ((startIndex = fileName.indexOf("=?")) != -1) {
endIndex = fileName.indexOf("?=");
//2. 문자열에서 구분자를 제거해주고
tmpStr = fileName.substring(startIndex + "=?".length(), endIndex);
//3. 인코딩 정보들을 분리한 후에
decodeInfo = tmpStr.split("\\?");
//4. Base64로 디코딩 해준다
result += new String(Base64.decode(decodeInfo[2]), decodeInfo[0]);
fileName = fileName.substring(endIndex + "?=".length());
} else {
break;
}
}
return result;
}
} | [
"[email protected]"
] | |
462622c70c1cebb7e933aa3545ef83c520528db6 | 38039b3df9bc81293ccaa743cbb3cfc1052066b5 | /src/main/java/com/vs/realestate/service/SalePlotService.java | b70bdb12786815141b1fe346a0039cc1fc698a00 | [] | no_license | sandeepbatule/real-estate | c7b47b0673a4a862009532e00733d91281e0aa0f | 6344e4d9129236e07d0b1ff6840a51f708fc57c5 | refs/heads/master | 2020-03-07T09:37:36.039783 | 2018-03-30T09:58:36 | 2018-03-30T09:58:36 | 126,968,022 | 0 | 0 | null | 2018-03-27T10:11:12 | 2018-03-27T10:11:12 | null | UTF-8 | Java | false | false | 187 | java | package com.vs.realestate.service;
import java.util.List;
import com.vs.realestate.entity.Plotting;
public interface SalePlotService {
List<Plotting> getPlotNames(String siteId);
}
| [
"sarang@sarang-Inspiron-3521"
] | sarang@sarang-Inspiron-3521 |
b6e22426d88530cd55bf17f6f50cd98602849774 | 8e8559cec2955320f7049835100cc32a48984066 | /ZombieCommie/test/domain/GameTest.java | 4c7bfa4ccde90459c7b0c37b9fffdcffa2448c68 | [] | no_license | Heugal/ZombieCom | 36fb2d50aa2d13e93fb16f90c2116bda0db1a1ef | 61c75e6dd181ba09794ba05987db7a45a0808780 | refs/heads/master | 2021-01-25T10:00:45.548554 | 2013-12-20T23:36:01 | 2013-12-20T23:36:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,667 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package domain;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Kelly
*/
public class GameTest {
/**
*
*/
public GameTest() {
}
/**
*
*/
@BeforeClass
public static void setUpClass() {
}
/**
*
*/
@AfterClass
public static void tearDownClass() {
}
/**
*
*/
@Before
public void setUp() {
}
/**
*
*/
@After
public void tearDown() {
}
/**
* Test of canAfford method, of class Game.
*/
@Test
public void testCanAfford() {
System.out.println("canAfford");
Defender item = null;
Game instance = new Game();
boolean expResult = false;
boolean result = instance.canAfford(item.getPrice());
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of buy method, of class Game.
*/
@Test
public void testBuy() {
System.out.println("buy");
Defender item = null;
Game instance = new Game();
boolean expResult = false;
boolean result = instance.buy(item);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
} | [
"[email protected]"
] | |
865655812949cdbf49a51a2bc0fc2bb4c2c91668 | f58f413acdd6127ad0ca4267f445393ed34cdf0f | /XianJinDai101/ruishua/build/generated/source/kapt/release/com/ryx/payment/ruishua/bindcard/BindedCardListActivity_.java | 6df91a4688946ee4992a0dec47a6ff9e5e0179e9 | [] | no_license | showdpro/project | 798f6dc3a428e0ffc1a6411debf225428f6a5441 | 8f1df7ed9b2d368467636b521d5e59989ecd85ac | refs/heads/master | 2021-07-25T11:59:50.383484 | 2017-10-30T08:37:22 | 2017-10-30T08:37:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,406 | java | //
// DO NOT EDIT THIS FILE.
// Generated using AndroidAnnotations 4.3.0.
//
// You can create a larger work that contains this file and distribute that work under terms of your choice.
//
package com.ryx.payment.ruishua.bindcard;
import android.app.Activity;
import android.content.Context;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import com.baoyz.swipemenulistview.SwipeMenuListView;
import com.ryx.payment.ruishua.R;
import com.ryx.payment.ruishua.bindcard.adapter.BindedCardListAdapter_;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;
import org.androidannotations.api.builder.ActivityIntentBuilder;
import org.androidannotations.api.builder.PostActivityStarter;
import org.androidannotations.api.view.HasViews;
import org.androidannotations.api.view.OnViewChangedListener;
import org.androidannotations.api.view.OnViewChangedNotifier;
public final class BindedCardListActivity_
extends BindedCardListActivity
implements HasViews, OnViewChangedListener
{
private final OnViewChangedNotifier onViewChangedNotifier_ = new OnViewChangedNotifier();
@Override
public void onCreate(Bundle savedInstanceState) {
OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_);
init_(savedInstanceState);
super.onCreate(savedInstanceState);
OnViewChangedNotifier.replaceNotifier(previousNotifier);
setContentView(R.layout.activity_binded_card_list);
}
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
this.cardListAdapter = BindedCardListAdapter_.getInstance_(this);
}
@Override
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
onViewChangedNotifier_.notifyViewChanged(this);
}
@Override
public void setContentView(View view, LayoutParams params) {
super.setContentView(view, params);
onViewChangedNotifier_.notifyViewChanged(this);
}
@Override
public void setContentView(View view) {
super.setContentView(view);
onViewChangedNotifier_.notifyViewChanged(this);
}
public static BindedCardListActivity_.IntentBuilder_ intent(Context context) {
return new BindedCardListActivity_.IntentBuilder_(context);
}
public static BindedCardListActivity_.IntentBuilder_ intent(android.app.Fragment fragment) {
return new BindedCardListActivity_.IntentBuilder_(fragment);
}
public static BindedCardListActivity_.IntentBuilder_ intent(android.support.v4.app.Fragment supportFragment) {
return new BindedCardListActivity_.IntentBuilder_(supportFragment);
}
@Override
public void onViewChanged(HasViews hasViews) {
this.lv_bindedcard = ((SwipeMenuListView) hasViews.findViewById(R.id.lv_bindedcard));
this.lay_binded_addcard = ((AutoLinearLayout) hasViews.findViewById(R.id.lay_binded_addcard));
this.img_no_item = ((ImageView) hasViews.findViewById(R.id.img_no_item));
this.lay_instruction = ((AutoRelativeLayout) hasViews.findViewById(R.id.bindcard_lay_instruction));
afterInitView();
}
public static class IntentBuilder_
extends ActivityIntentBuilder<BindedCardListActivity_.IntentBuilder_>
{
private android.app.Fragment fragment_;
private android.support.v4.app.Fragment fragmentSupport_;
public IntentBuilder_(Context context) {
super(context, BindedCardListActivity_.class);
}
public IntentBuilder_(android.app.Fragment fragment) {
super(fragment.getActivity(), BindedCardListActivity_.class);
fragment_ = fragment;
}
public IntentBuilder_(android.support.v4.app.Fragment fragment) {
super(fragment.getActivity(), BindedCardListActivity_.class);
fragmentSupport_ = fragment;
}
@Override
public PostActivityStarter startForResult(int requestCode) {
if (fragmentSupport_!= null) {
fragmentSupport_.startActivityForResult(intent, requestCode);
} else {
if (fragment_!= null) {
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
fragment_.startActivityForResult(intent, requestCode, lastOptions);
} else {
fragment_.startActivityForResult(intent, requestCode);
}
} else {
if (context instanceof Activity) {
Activity activity = ((Activity) context);
ActivityCompat.startActivityForResult(activity, intent, requestCode, lastOptions);
} else {
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
context.startActivity(intent, lastOptions);
} else {
context.startActivity(intent);
}
}
}
}
return new PostActivityStarter(context);
}
}
}
| [
"[email protected]"
] | |
d456515c325abaa2d1dfd8c9452aca38af97b7c5 | 48f1a815bf0ba2f7997d299044562d1b6d4c1a52 | /src/main/java/model/ProductModel.java | 9b3fbffc99e25a6f4a5f3f2014e4a62f0a90162c | [] | no_license | annafulgione98/FreshFood2.0 | 5f5d223e728cd802ca33659d9f5a9ab6cf182b01 | d59b5284a61d811fb93fa4926689405b56299d29 | refs/heads/master | 2023-03-24T01:13:28.379992 | 2021-03-15T15:43:46 | 2021-03-15T15:43:46 | 348,026,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,665 | java | package model;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import control.*;
public interface ProductModel {
/**Salva un nuovo prodotto
* @param product prodotto da salvare
* @return void di conseguenza non ritorna niente, il metodo si limita a salvare il nuovo prodotto
* @throws SQLException in caso di errore con il database
*/
public void doSave(ProductBean product) throws SQLException;
/**
* Elimina un prodotto dal database in base al codice fornito
* @param code il codice del prodotto da eliminare
* @return true in caso di eliminazione avvenuta, false altrimenti
* @throws SQLException in caso di errore con il database
*/
public boolean doDelete(int code) throws SQLException;
/**
* Permette di ricerca un prodotto fornendo il codice
* @param code il codice del prodotto da ricercare
* @return un oggetto di tipo ProductBean
* @throws SQLException in caso di errore con il database
*/
public ProductBean doRetrieveByKey(int code) throws SQLException;
/**Permette di selezionare i prodotti di un determinato tipo
* @param tipo del prodotto da selezionare
* @return una lista dei prodotti di quel particolare tipo
* @throws SQLException in caso di errore con il database*/
public Collection<ProductBean> doRetrieveByProd(String tipo) throws SQLException;
/**
*Permette di cercare i prodotti di un determinato tipo
*@return un arraylist contenente i prodotti del tipo specificato
* @throws SQLException in caso di errore con il database
*/
public ArrayList<ProductBean> cercaPerTipo(String tipo) throws SQLException;
/**
* Carica tutti i prodotti presenti nel database
* @return una collezione di prodotti
* @throws SQLException in caso di errore con il database
*/
public Collection<ProductBean> doRetrieveAll(String order) throws SQLException;
/**
* Permette di caricare tutti i prodotti dal database
* @return un arraylist contenente tutti i prodotti presenti
* @throws SQLException in caso di errore con il database
*/
public ArrayList<ProductBean> doRetrieveAll2() throws SQLException;
/**Riservato agli amministratori associa un nuovo codice(non associato gi?ad un altro prodotto) per inserire un nuovo prodotto nel datatbase
* @return un intero che corrisponde al codice del nuovo prodotto
* @throws SQLException in caso di errore con il database
* */
public int getNewCode() throws SQLException;
/** Aggiunge un prodotto al database
* @param bean il nuovo prodotto da inserire
* @throws SQLException in caso di errore con il database
*/
public void AddProduct(ProductBean bean) throws SQLException;
} | [
"[email protected]"
] | |
170104d4a3a0b09d6ab42363b0dfd497215e2e96 | ab4d6ea90398a6cf9fe7adfebd3843d0504d0c75 | /zmUser/src/main/java/com/zm/user/dao/impl/RoleResourceDaoImpl.java | c7d4d9d46bad39ef848c121f3fbb968899da1ef7 | [] | no_license | 3056075/common | 4650935e7aa27b23cf86215d1530a89de37dea29 | f182b9e937eec034c3490b2cfd136ce356acb991 | refs/heads/master | 2020-06-05T21:13:14.372927 | 2015-04-20T06:33:30 | 2015-04-20T06:33:30 | 33,104,482 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | package com.zm.user.dao.impl;
import org.springframework.stereotype.Repository;
import com.zm.common.dao.impl.BaseDaoImpl;
import com.zm.user.dao.RoleResourceDao;
import com.zm.user.entity.RoleResource;
@Repository
public class RoleResourceDaoImpl extends BaseDaoImpl<RoleResource> implements RoleResourceDao {
}
| [
"ccbdev115@ccbdev115-PC"
] | ccbdev115@ccbdev115-PC |
57c9e9f554d3ee885eaf533fd748a2d157d7ec72 | 7723edae93c02ba3f3770bda1bea2528ebe8780d | /src/main/java/com/sample/beerstock/dto/request/QuantidadeDTO.java | ed45b19e9542879f7e1ec8dbdb710e9e747244da | [] | no_license | ciceroakiles/beerstock-tests | 8b18335791c5fc351d45debba06755d6290d0ef3 | 3f2b5a8a82b151446ff091ae282015ec218afe8e | refs/heads/master | 2023-06-24T09:36:25.852985 | 2021-07-27T18:55:43 | 2021-07-27T18:55:43 | 381,287,272 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.sample.beerstock.dto.request;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class QuantidadeDTO {
@NotNull
@Max(100)
private Integer qtde;
}
| [
"[email protected]"
] | |
1e7eccc95e7b0245dc58b8c4e039b436012eca4f | 4fb0e1f0d013a346d8e72975599bf2e809d14f1d | /src/main/java/com/guohuai/ams/channel/ChannelRemarksRep.java | 898f3d402947b7ce862b7ebf0b82941707d64578 | [] | no_license | soldiers1989/baofeng.mimosa | 86af96bb1638c6b15713c00ed4c29f8efe3bd66c | 477296925b6e8d1a7b8fc1400921e12bb35696ce | refs/heads/master | 2020-03-28T23:54:35.805684 | 2018-04-24T06:27:57 | 2018-04-24T06:27:57 | 149,315,065 | 0 | 1 | null | 2018-09-18T15:57:01 | 2018-09-18T15:57:01 | null | UTF-8 | Java | false | false | 251 | java | package com.guohuai.ams.channel;
import java.sql.Timestamp;
import lombok.EqualsAndHashCode;
@lombok.Data
@EqualsAndHashCode(callSuper = false)
@lombok.Builder
public class ChannelRemarksRep {
private String remark;
private Timestamp time;
}
| [
"[email protected]"
] | |
41766dded872ad73197bf371e2c5110076501262 | a168a63496efdea58e4e0252644c22b58562e046 | /Dominio/src/main/java/com/msocial/app/dominio/Delegacion.java | 54b969fdd4156cb7bc9e6853b62fa7c644daf616 | [] | no_license | JulioCarballo/MSocialApp | e82df570843d28ef7b8193a034912b975a647200 | 88237a2c512c3e69a327111bae3723723d439f13 | refs/heads/master | 2020-03-22T09:25:14.497332 | 2019-04-26T07:35:30 | 2019-04-26T07:35:30 | 139,836,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 592 | java | package com.msocial.app.dominio;
/**
*
* @author Julio Carballo Alomar
*/
public class Delegacion extends Generic{
private static final long serialVersionUID = 1L;
private String delCodigo;
private String delNombre;
private boolean status = false;
public String getDelCodigo() {
return delCodigo;
}
public void setDelCodigo(String delCodigo) {
this.delCodigo = delCodigo;
}
public String getDelNombre() {
return delNombre;
}
public void setDelNombre(String delNombre) {
this.delNombre = delNombre;
}
}
| [
"[email protected]"
] | |
2976bf1bc1ba89f09328dd0371ac8fa1f2acc287 | 46a6770f7bfae8eac5362a3e5e06c1cd93cd4a4d | /src/test/java/com/sg/vendingmachine/dao/ItemDaoTest.java | 3453da3048a036a1b6371b70942b9f9ffab6562a | [] | no_license | thuanhuynh89/4_VendingMachine | a6cc81284e5c3ce94736f0725baa015034c56fdb | c5d99d6e16af977d5c005090016b53b8ec6959e2 | refs/heads/master | 2021-01-23T02:05:02.352916 | 2017-06-06T04:33:57 | 2017-06-06T04:33:57 | 92,904,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,906 | 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.sg.vendingmachine.dao;
//
//import com.sg.vendingmachine.dto.Item;
//import com.sg.vendingmachine.servicelayer.ServiceLayer;
//import com.sg.vendingmachine.servicelayer.ServiceLayerImpl;
//import java.math.BigDecimal;
//import org.junit.After;
//import org.junit.AfterClass;
//import org.junit.Before;
//import org.junit.BeforeClass;
//import org.junit.Test;
//import static org.junit.Assert.*;
//
///**
// *
// * @author yingy
// */
//public class ItemDaoTest {
// ItemDao dao = new ItemDaoImpl();
// ServiceLayer layer = new ServiceLayerImpl();
//
// public ItemDaoTest() {
// }
//
// @BeforeClass
// public static void setUpClass() {
// }
//
// @AfterClass
// public static void tearDownClass() {
// }
//
// @Before
// public void setUp() {
//
//
// }
//
// @After
// public void tearDown() {
// }
//
// /**
// * Test of addItem method, of class ItemDao.
// */
// @Test
// public void testAddItem() throws Exception {
//
// }
//
// /**
// * Test of getAllItemsAvailable method, of class ItemDao.
// */
// @Test
// public void testGetAllItemsAvailable() throws Exception {
//
// Item item = new Item("001");
// item.setItemName("Grape");
// item.setItemPrice(new BigDecimal("10"));
//
// dao.addItem(item.getItemId(), item);
//
// Item item2 = new Item("002");
// item.setItemName("Du");
// item.setItemPrice(new BigDecimal("10"));
//
// dao.addItem(item2.getItemId(), item);
//
// assertEquals(12, dao.getAllItemsAvailable().size());
// }
//
//
//
//
//}
| [
"[email protected]"
] | |
f7c791728cf0a89fa1a54bee3b304fc544b332fc | 7775d63f96b67c0f7ea77160e2a1a8e44957ff86 | /src/com/javarush/test/level31/lesson04/home01/Solution.java | 946f709886975c865e7dfb965ca05ac783a8d921 | [] | no_license | saudabaew/com.javarush.test | 58390fdfa44bd09ce3226de674b62224e8d87b1e | d689012c6bbf105015bde0c205a8dafcbcf809eb | refs/heads/master | 2021-05-16T07:00:40.896234 | 2018-02-14T02:18:10 | 2018-02-14T02:18:10 | 103,628,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,485 | java | package com.javarush.test.level31.lesson04.home01;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
/* Своя реализация
Реализуйте логику методов:
1. readBytes - должен возвращать все байты файла fileName
2. readLines - должен возвращать все строки файла fileName. Используйте дефолтовую кодировку
3. writeBytes - должен записывать массив bytes в файл fileName
4. copy - должен копировать файл resourceFileName на место destinationFileName
ГЛАВНОЕ УСЛОВИЕ:
Никаких других импортов!
*/
public class Solution {
public static byte[] readBytes(String fileName) throws IOException {
byte[] bytes = Files.readAllBytes(Paths.get(fileName));
return bytes;
}
public static List<String> readLines(String fileName) throws IOException {
return Files.readAllLines(Paths.get(fileName), Charset.defaultCharset());
}
public static void writeBytes(String fileName, byte[] bytes) throws IOException {
Files.write(Paths.get(fileName), bytes);
}
public static void copy(String resourceFileName, String destinationFileName) throws IOException {
Files.copy(Paths.get(resourceFileName), Paths.get(destinationFileName));
}
}
| [
"[email protected]"
] | |
afc034738467f300159d9b40067c23c314d33588 | cbea23d5e087a862edcf2383678d5df7b0caab67 | /aws-java-sdk-ssoadmin/src/main/java/com/amazonaws/services/ssoadmin/model/ListPermissionSetsProvisionedToAccountRequest.java | e4a2ad8eb133fbd29d8e39f27ce415dece301f09 | [
"Apache-2.0"
] | permissive | phambryan/aws-sdk-for-java | 66a614a8bfe4176bf57e2bd69f898eee5222bb59 | 0f75a8096efdb4831da8c6793390759d97a25019 | refs/heads/master | 2021-12-14T21:26:52.580137 | 2021-12-03T22:50:27 | 2021-12-03T22:50:27 | 4,263,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,823 | java | /*
* Copyright 2016-2021 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.ssoadmin.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/sso-admin-2020-07-20/ListPermissionSetsProvisionedToAccount"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListPermissionSetsProvisionedToAccountRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services
* Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
* </p>
*/
private String instanceArn;
/**
* <p>
* The identifier of the Amazon Web Services account from which to list the assignments.
* </p>
*/
private String accountId;
/**
* <p>
* The status object for the permission set provisioning operation.
* </p>
*/
private String provisioningStatus;
/**
* <p>
* The maximum number of results to display for the assignment.
* </p>
*/
private Integer maxResults;
/**
* <p>
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make
* subsequent calls.
* </p>
*/
private String nextToken;
/**
* <p>
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services
* Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
* </p>
*
* @param instanceArn
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs,
* see <a href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web
* Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
*/
public void setInstanceArn(String instanceArn) {
this.instanceArn = instanceArn;
}
/**
* <p>
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services
* Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
* </p>
*
* @return The ARN of the SSO instance under which the operation will be executed. For more information about ARNs,
* see <a href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web
* Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
*/
public String getInstanceArn() {
return this.instanceArn;
}
/**
* <p>
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs, see <a
* href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services
* Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
* </p>
*
* @param instanceArn
* The ARN of the SSO instance under which the operation will be executed. For more information about ARNs,
* see <a href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web
* Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPermissionSetsProvisionedToAccountRequest withInstanceArn(String instanceArn) {
setInstanceArn(instanceArn);
return this;
}
/**
* <p>
* The identifier of the Amazon Web Services account from which to list the assignments.
* </p>
*
* @param accountId
* The identifier of the Amazon Web Services account from which to list the assignments.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
* <p>
* The identifier of the Amazon Web Services account from which to list the assignments.
* </p>
*
* @return The identifier of the Amazon Web Services account from which to list the assignments.
*/
public String getAccountId() {
return this.accountId;
}
/**
* <p>
* The identifier of the Amazon Web Services account from which to list the assignments.
* </p>
*
* @param accountId
* The identifier of the Amazon Web Services account from which to list the assignments.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPermissionSetsProvisionedToAccountRequest withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
* <p>
* The status object for the permission set provisioning operation.
* </p>
*
* @param provisioningStatus
* The status object for the permission set provisioning operation.
* @see ProvisioningStatus
*/
public void setProvisioningStatus(String provisioningStatus) {
this.provisioningStatus = provisioningStatus;
}
/**
* <p>
* The status object for the permission set provisioning operation.
* </p>
*
* @return The status object for the permission set provisioning operation.
* @see ProvisioningStatus
*/
public String getProvisioningStatus() {
return this.provisioningStatus;
}
/**
* <p>
* The status object for the permission set provisioning operation.
* </p>
*
* @param provisioningStatus
* The status object for the permission set provisioning operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProvisioningStatus
*/
public ListPermissionSetsProvisionedToAccountRequest withProvisioningStatus(String provisioningStatus) {
setProvisioningStatus(provisioningStatus);
return this;
}
/**
* <p>
* The status object for the permission set provisioning operation.
* </p>
*
* @param provisioningStatus
* The status object for the permission set provisioning operation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProvisioningStatus
*/
public ListPermissionSetsProvisionedToAccountRequest withProvisioningStatus(ProvisioningStatus provisioningStatus) {
this.provisioningStatus = provisioningStatus.toString();
return this;
}
/**
* <p>
* The maximum number of results to display for the assignment.
* </p>
*
* @param maxResults
* The maximum number of results to display for the assignment.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
* <p>
* The maximum number of results to display for the assignment.
* </p>
*
* @return The maximum number of results to display for the assignment.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
* <p>
* The maximum number of results to display for the assignment.
* </p>
*
* @param maxResults
* The maximum number of results to display for the assignment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPermissionSetsProvisionedToAccountRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
* <p>
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make
* subsequent calls.
* </p>
*
* @param nextToken
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls
* to make subsequent calls.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make
* subsequent calls.
* </p>
*
* @return The pagination token for the list API. Initially the value is null. Use the output of previous API calls
* to make subsequent calls.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls to make
* subsequent calls.
* </p>
*
* @param nextToken
* The pagination token for the list API. Initially the value is null. Use the output of previous API calls
* to make subsequent calls.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListPermissionSetsProvisionedToAccountRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getInstanceArn() != null)
sb.append("InstanceArn: ").append(getInstanceArn()).append(",");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getProvisioningStatus() != null)
sb.append("ProvisioningStatus: ").append(getProvisioningStatus()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListPermissionSetsProvisionedToAccountRequest == false)
return false;
ListPermissionSetsProvisionedToAccountRequest other = (ListPermissionSetsProvisionedToAccountRequest) obj;
if (other.getInstanceArn() == null ^ this.getInstanceArn() == null)
return false;
if (other.getInstanceArn() != null && other.getInstanceArn().equals(this.getInstanceArn()) == false)
return false;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getProvisioningStatus() == null ^ this.getProvisioningStatus() == null)
return false;
if (other.getProvisioningStatus() != null && other.getProvisioningStatus().equals(this.getProvisioningStatus()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceArn() == null) ? 0 : getInstanceArn().hashCode());
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getProvisioningStatus() == null) ? 0 : getProvisioningStatus().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListPermissionSetsProvisionedToAccountRequest clone() {
return (ListPermissionSetsProvisionedToAccountRequest) super.clone();
}
}
| [
""
] | |
af52dd8afef940bb9c4a9cfa5cbfcdcdb16d37ef | de4cacdc57f101fd60ec5680d9185c56c7367d35 | /webfx-platform/webfx-platform-feature-scheduler/webfx-platform-java-scheduler-impl/src/main/java/webfx/platform/java/services/scheduler/spi/impl/JavaSchedulerProvider.java | a63b4a1bcf1da0ceb033e84a2c5b84da8de98dcb | [] | no_license | doytsujin/webfx | 7efd181ce0e0ff133fbaf6e6ba4632d3b048cc25 | 50b1ac03b1be2a52f3effa363893dea86e294a42 | refs/heads/master | 2022-12-08T23:14:19.381279 | 2020-09-04T11:02:35 | 2020-09-04T11:02:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,281 | java | /*
* Note: this code is a fork of Goodow realtime-android project https://github.com/goodow/realtime-android
*/
/*
* Copyright 2014 Goodow.com
*
* 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 webfx.platform.java.services.scheduler.spi.impl;
import webfx.platform.shared.services.scheduler.Scheduled;
import webfx.platform.shared.services.scheduler.spi.SchedulerProvider;
import webfx.platform.shared.services.log.Logger;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
/*
* @author Bruno Salmon
*/
public final class JavaSchedulerProvider implements SchedulerProvider {
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
public JavaSchedulerProvider() {
/* Commented as this scheduler may still be used by other shutdown tasks (avoiding a RejectedExecutionException)
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
// shutdown our thread pool
try {
executor.shutdown();
executor.awaitTermination(1, TimeUnit.SECONDS);
} catch (InterruptedException ie) {
// nothing to do here except go ahead and exit
}
}));
*/
}
@Override
public void scheduleDeferred(Runnable runnable) {
executor.execute(caughtRunnable(runnable));
}
@Override
public JavaScheduled scheduleDelay(long delayMs, Runnable runnable) {
return new JavaScheduled(executor.schedule(caughtRunnable(runnable), delayMs, TimeUnit.MILLISECONDS));
}
@Override
public JavaScheduled schedulePeriodic(long delayMs, Runnable runnable) {
return new JavaScheduled(executor.scheduleAtFixedRate(caughtRunnable(runnable), delayMs, delayMs, TimeUnit.MILLISECONDS));
}
private static Runnable caughtRunnable(Runnable runnable) {
return () -> {
try {
runnable.run();
} catch (Throwable t) {
Logger.log("Uncaught exception in scheduled runnable " + runnable, t);
}
};
}
@Override
public void runInBackground(Runnable runnable) {
executor.execute(caughtRunnable(runnable));
}
private static final class JavaScheduled implements Scheduled {
private final ScheduledFuture scheduledFuture;
private JavaScheduled(ScheduledFuture scheduledFuture) {
this.scheduledFuture = scheduledFuture;
}
@Override
public boolean cancel() {
return scheduledFuture.cancel(false);
}
}
@Override
public long nanoTime() {
return System.nanoTime();
}
}
| [
"[email protected]"
] | |
9afb322659aa915743d364fd4cd8a97ffb7121a0 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_d2645224d68707e5be33426e23aad6e92970c333/CompositeFileListFilter/29_d2645224d68707e5be33426e23aad6e92970c333_CompositeFileListFilter_s.java | ad64df55ba30385c19a95295e8aaed1be0e0bb9b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,630 | java | /*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.file;
import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Composition that delegates to multiple {@link FileFilter}s. The composition
* is AND based, meaning that a file must pass through each filter's
* {@link #filterFiles(File)} method in order to be accepted by the composite.
*
* @author Iwein Fuld
*/
public class CompositeFileListFilter implements FileListFilter {
private final Set<FileListFilter> fileFilters;
public CompositeFileListFilter(FileListFilter... fileFilters) {
this.fileFilters = new HashSet<FileListFilter>(Arrays.asList(fileFilters));
}
public CompositeFileListFilter(Collection<FileListFilter> fileFilters) {
this.fileFilters = new HashSet<FileListFilter>(fileFilters);
}
/**
* {@inheritDoc}
*/
public List<File> filterFiles(File[] files) {
List<File> leftOver = Arrays.asList(files);
for (FileListFilter fileFilter : fileFilters) {
leftOver = fileFilter.filterFiles(leftOver.toArray(new File[] {}));
}
return leftOver;
}
/**
* @see #addFilters(Collection)
* @param filters one or more new filters to be used
* @return a new CompositeFileFilter with the additional filters
*/
public CompositeFileListFilter addFilter(FileListFilter... filters) {
return addFilters(Arrays.asList(filters));
}
/**
* Creates a new CompositeFileFilter that delegates to both the filters of
* this Composite and the new filters passed in.
*
* @param filtersToAdd
* @return a new CompositeFileFilter with the added filters
*/
public CompositeFileListFilter addFilters(Collection<FileListFilter> filtersToAdd) {
HashSet<FileListFilter> newFilterSet = new HashSet<FileListFilter>(filtersToAdd);
newFilterSet.addAll(fileFilters);
return new CompositeFileListFilter(newFilterSet);
}
}
| [
"[email protected]"
] | |
3679544988773595a9a7496827f8de15e126fe6f | 69e40a010fe93c48da2135160273cb8272cd2904 | /src/main/java/com/keshar/activemqexample/producer/ProducerResource.java | 6094f97a04ee2bae442b49751a48ae535bf91ebd | [
"Apache-2.0"
] | permissive | pkeshu/active-mq-example | 3b5fc7b0b5805caa5d6a166fb8edcd73424c918f | a6d83e5f32282ab016228c7c08df40b8d208f2f0 | refs/heads/main | 2023-02-04T09:55:48.031342 | 2020-12-29T14:29:48 | 2020-12-29T14:29:48 | 325,300,301 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 793 | java | package com.keshar.activemqexample.producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.jms.Queue;
@RestController
@RequestMapping("/producers")
public class ProducerResource {
@Autowired
private JmsTemplate jmsTemplate;
@Autowired
private Queue queue;
@GetMapping("/{message}")
public String publish(@PathVariable final String message) {
jmsTemplate.convertAndSend(queue, message);
return "Message published";
}
}
| [
"[email protected]"
] | |
f612b22efdb7b52b1455dac3279d68fe04c17760 | b688d81cb4a24a7dd9679b188daf9596a3b10360 | /BusinessProcessModelingTool/src/bp/model/data/ConditionalEdge.java | 3972d3bbfbafac47e1e8ae3ecdfe4e29fffc5cd9 | [] | no_license | Sholy/BusinessProcessModelingTool | c9f2cd1c4496ce26b7e64aab249b16f198da3293 | a06d33e9c318ce8019bc8a2cd6b1b0724df8b3ea | refs/heads/master | 2016-09-06T06:19:00.090110 | 2014-02-03T18:10:03 | 2014-02-03T18:10:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package bp.model.data;
import bp.details.ConditionalEdgeDetails;
import bp.model.graphic.BPEdge;
import bp.model.util.BPKeyWords;
import bp.model.util.Controller;
/**
* Connects Vertices under some condition
*
* @author Sholy
*
*/
public class ConditionalEdge extends Edge {
private String condition;
public String getCondition() {
return this.condition;
}
public void updateCondition(final String condition, final Controller source) {
this.condition = condition;
fireAttributeChanged(BPKeyWords.CONDITION, this.condition, source);
}
public ConditionalEdge(final String uniqueName) {
super(uniqueName);
}
@Override
protected void initializeComponent() {
this.component = new BPEdge(BPEdge.CONDITIONAL_EDGE);
this.component.setzIndex(301);
}
@Override
protected void initializeDetails() {
this.details = new ConditionalEdgeDetails(this);
}
}
| [
"[email protected]"
] | |
2cef8b9b78ae948b573da8d45bb6e978eff3bea9 | 9c9e3a946e6d6f09b14b4243d6191d17bbd964db | /src/jd/plugins/hoster/WstreamVideo.java | 8559c6166434f22d3d441963ba2b18b0607bbf85 | [] | no_license | liancastellon/jd-trunk | 3ebf496cc57ab4dc8c283e4c999576d741ea0881 | 9c34cd6b90b477781c2d3fecce8793c0e08f86e3 | refs/heads/master | 2020-07-18T03:05:20.768922 | 2019-09-03T19:47:01 | 2019-09-03T19:47:01 | 206,158,196 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 10,429 | java | //jDownloader - Downloadmanager
//Copyright (C) 2013 JD-Team [email protected]
//
//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 3 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, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.appwork.utils.StringUtils;
import org.appwork.utils.formatter.SizeFormatter;
import org.jdownloader.plugins.components.XFileSharingProBasic;
import jd.PluginWrapper;
import jd.http.Browser;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.plugins.Account;
import jd.plugins.Account.AccountType;
import jd.plugins.DownloadLink;
import jd.plugins.HostPlugin;
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = {}, urls = {})
public class WstreamVideo extends XFileSharingProBasic {
public WstreamVideo(final PluginWrapper wrapper) {
super(wrapper);
this.enablePremium(super.getPurchasePremiumURL());
}
public static String[] buildAnnotationUrls(List<String[]> pluginDomains) {
/* 2019-07-11: Special */
final List<String> ret = new ArrayList<String>();
for (final String[] domains : pluginDomains) {
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/(?:w?embed\\-|video/)?[a-z0-9]{12}(?:/[^/]+\\.html)?");
}
return ret.toArray(new String[0]);
}
@Override
public void correctDownloadLink(final DownloadLink link) {
/* 2019-07-11: Special */
final String fuid = this.fuid != null ? this.fuid : getFUIDFromURL(link);
if (fuid != null) {
/* link cleanup, prefer https if possible */
if (link.getPluginPatternMatcher() != null && link.getPluginPatternMatcher().matches("https?://[A-Za-z0-9\\-\\.]+/w?embed-[a-z0-9]{12}")) {
link.setContentUrl(getMainPage() + "/embed-" + fuid + ".html");
}
link.setPluginPatternMatcher(getMainPage() + "/" + fuid);
link.setLinkID(getHost() + "://" + fuid);
}
}
@Override
public String getFUIDFromURL(final DownloadLink dl) {
/* 2019-07-11: Special */
try {
final String result = new Regex(new URL(dl.getPluginPatternMatcher()).getPath(), "/(?:w?embed-)?([a-z0-9]{12})").getMatch(0);
return result;
} catch (MalformedURLException e) {
e.printStackTrace();
}
return null;
}
/**
* DEV NOTES XfileSharingProBasic Version SEE SUPER-CLASS<br />
* mods: See overridden functions<br />
* limit-info:<br />
* captchatype-info: null<br />
* other:<br />
*/
@Override
public boolean isResumeable(final DownloadLink link, final Account account) {
if (account != null && account.getType() == AccountType.FREE) {
/* Free Account */
return true;
} else if (account != null && account.getType() == AccountType.PREMIUM) {
/* Premium account */
return true;
} else {
/* Free(anonymous) and unknown account type */
return true;
}
}
@Override
public int getMaxChunks(final Account account) {
if (account != null && account.getType() == AccountType.FREE) {
/* Free Account */
return -2;
} else if (account != null && account.getType() == AccountType.PREMIUM) {
/* Premium account */
return 0;
} else {
/* Free(anonymous) and unknown account type */
return -2;
}
}
@Override
public String[] scanInfo(final String[] fileInfo) {
/* 2019-04-24: Special */
super.scanInfo(fileInfo);
if (StringUtils.isEmpty(fileInfo[0])) {
fileInfo[0] = new Regex(correctedBR, "<h3>(?:\\s*?<div class=\"[^\"]+\">)?([^<>\"]+)(?:</div>\\s*?)?</h3>").getMatch(0);
}
return fileInfo;
}
@Override
public int getMaxSimultaneousFreeAnonymousDownloads() {
return 1;
}
@Override
public int getMaxSimultaneousFreeAccountDownloads() {
return 1;
}
@Override
public int getMaxSimultanPremiumDownloadNum() {
return 1;
}
/** Checks if official video download is possible and returns downloadlink if possible. */
public String checkOfficialVideoDownload(final DownloadLink link, final Account account) throws Exception {
/* 2019-06-27: Special - used for ALL download modes (including premium!) */
String dllink = null;
final String redirect = br.getRegex("<meta http-equiv=\"refresh\" content=\"\\d+;URL=(https[^<>\"]+)\">").getMatch(0);
if (redirect != null) {
this.getPage(redirect);
}
final boolean force_download_attempt = true;
if (br.containsHTML("https://download\\.wstream\\.video/" + this.fuid) || force_download_attempt) {
logger.info("Attempting official video download");
final Browser brc = br.cloneBrowser();
this.getPage(brc, "https://download.wstream.video/" + this.fuid);
String dlFunctionURL = brc.getRegex("\\$\\(document\\)\\.ready\\(function\\(\\)\\{\\s*?\\$\\.get\\(\"([^\"]+)\"").getMatch(0);
if (dlFunctionURL == null) {
/* Fallback! Last updated: 2019-06-27: They might frequently change this!! */
final String b64 = Encoding.Base64Encode(this.fuid + "|600");
dlFunctionURL = "https://video.wstream.video/dwn.php?f=" + b64;
}
/* 2019-06-13: Skip waittime (6-10 seconds) */
this.getPage(brc, dlFunctionURL);
/* Cat/mouse games... */
// final String[] hosts = siteSupportedNames();
final String[] dlinfo = brc.getRegex("class='[^\\']+' href='[^\\']+'>Download [^<>]+</a>").getColumn(-1);
String dllink_last = null;
String filesize_last = null;
int qualityMax = 0;
int qualityTemp = 0;
for (final String dlinfoSingle : dlinfo) {
final String dllink_temp = new Regex(dlinfoSingle, "href=\\'(http[^\"\\']+)").getMatch(0);
if (StringUtils.isEmpty(dllink_temp)) {
continue;
}
boolean dllinkValid = dllink_temp.contains(".mp4") || dllink_temp.contains(".mkv") || dllink_temp.contains(link.getName());
// for (final String host : hosts) {
// if (dllink_temp.contains(host)) {
// dllinkValid = true;
// break;
// }
// }
if (!dllinkValid) {
/* Skip invalid URLs */
continue;
}
dllink_last = dllink_temp;
filesize_last = new Regex(dlinfoSingle, ">Download [A-Za-z0-9 ]+ (\\d+(?:\\.\\d+)? [A-Za-z]{1,5})\\s*?<").getMatch(0);
if (dlinfoSingle.contains("Download Original")) {
qualityTemp = 100;
} else if (dlinfoSingle.contains("Download Standard")) {
qualityTemp = 50;
} else if (dlinfoSingle.contains("Download Mobile")) {
qualityTemp = 10;
} else {
/* Unknown quality */
qualityTemp = 1;
}
if (qualityTemp > qualityMax) {
qualityMax = qualityTemp;
dllink = dllink_temp;
}
}
if (dllink == null && dllink_last != null) {
/* Failed to find original download? Fallback to ANY video-quality. */
logger.info("Failed to find highest quality, falling back to (???)");
dllink = dllink_last;
}
if (link.getView().getBytesTotal() <= 0 && filesize_last != null) {
/*
* 2019-06-13: Sure if everything goes as planned this makes no sense BUT in case the download fails to start, now we at
* least found our filesize :)
*/
logger.info("Setting filesize here as availablecheck was unable to find it");
link.setDownloadSize(SizeFormatter.getSize(filesize_last));
}
}
if (dllink != null) {
logger.info("Successfully found official video downloadlink");
} else {
logger.info("Failed to find official video downloadlink");
}
return dllink;
}
@Override
public boolean isVideohosterEmbed() {
return true;
}
@Override
public boolean isVideohoster_enforce_video_filename() {
return true;
}
@Override
protected boolean supports_availablecheck_filesize_html() {
/* 2019-04-24: Special */
return true;
}
public static List<String[]> getPluginDomains() {
final List<String[]> ret = new ArrayList<String[]>();
// each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain
ret.add(new String[] { "wstream.video", "download.wstream.video" });
return ret;
}
public static String[] getAnnotationNames() {
return buildAnnotationNames(getPluginDomains());
}
@Override
public String[] siteSupportedNames() {
return buildSupportedNames(getPluginDomains());
}
public static String[] getAnnotationUrls() {
return buildAnnotationUrls(getPluginDomains());
}
} | [
"psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4"
] | psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4 |
e2253007f4ee28794ae98585032652a0da931581 | 2ad2ccc9a3c43bf8b0ad93886074ac2b2c2f206d | /src/main/utils/Log.java | c09c51080445cd20d56d3bb94ee4980f29d6ac67 | [] | no_license | Alwaysonly/android-selector-chapek | 756b3f82e14c22ec602a70c6781c10d22a6bb8a4 | 1be1f5ea28f236eefa894d8222a9cd80967615ec | refs/heads/master | 2020-03-22T20:59:48.109866 | 2018-07-12T10:05:19 | 2018-07-12T10:05:19 | 140,645,936 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 286 | java | package main.utils;
public class Log {
public static final boolean DEBUG = false;
public static void d(String output) {
if (DEBUG) {
System.out.println(output);
}
}
public static void e(Exception e) {
e.printStackTrace();
}
}
| [
"[email protected]"
] | |
e980eec87e5b82971f6e143c9c69180f6fcc5534 | c4e80817398b9d9f3284a0b5bce2dd3e8d02a46d | /src/main/java/view/graphics/Face.java | b2205ad6c8c8e02324a7c3f22ab599179cebaf3f | [] | no_license | LayoutXML/Dont-Stop-Moving.-The-Game | b6bcbc6ed9ba58b2d3a151c745700a8b84f849ba | 458f982cb2e28f44f732c7d6188b63cab6fff903 | refs/heads/main | 2023-04-25T02:38:25.549675 | 2021-05-02T13:33:24 | 2021-05-02T13:33:24 | 338,355,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,170 | java | package view.graphics;
import lombok.Getter;
import model.exceptions.ResourceException;
@Getter
public class Face {
private final IndexGroup[] faceVertexIndexes = new IndexGroup[3];
public Face(String line0, String line1, String line2) throws ResourceException {
faceVertexIndexes[0] = parseLine(line0);
faceVertexIndexes[1] = parseLine(line1);
faceVertexIndexes[2] = parseLine(line2);
}
private IndexGroup parseLine(String line) throws ResourceException {
IndexGroup indexGroup = new IndexGroup();
String[] tokens = line.split("/");
if (tokens.length == 0) {
throw new ResourceException("Resource read error");
}
indexGroup.setIndexPosition(Integer.parseInt(tokens[0]) - 1);
if (tokens.length > 1) {
String textureCoordinates = tokens[1];
indexGroup.setIndexTextureCoordinate(textureCoordinates.length() > 0 ? Integer.parseInt(textureCoordinates) - 1 : -1);
if (tokens.length > 2) {
indexGroup.setIndexVectorNormal(Integer.parseInt(tokens[2]) - 1);
}
}
return indexGroup;
}
}
| [
"[email protected]"
] | |
0b9578f72e31674a6f7ae996a64f9eeb4dfd0d41 | 53e64438a746693451c01c75408c271fb2cf64e0 | /src/com/faculdade/sistemas_distribuidos/lab3/Test.java | 76a575a46eb9cf9ec6548c72fbdc62876338ba2a | [] | no_license | luizcarlosfx/Faculdade | 4a35f31190b522745dad88bd4d72dfba6628566d | 78878cdfbf9d9cf723e72d75d34e8213f154371d | refs/heads/master | 2021-01-19T19:35:28.515876 | 2015-04-30T12:18:10 | 2015-04-30T12:18:10 | 20,297,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 286 | java | package com.faculdade.sistemas_distribuidos.lab3;
public class Test
{
public static void main(String[] args)
{
Level level = new Level();
level.setLevel1(40);
level.setLevel2(30);
level.setLevel3(90);
new LevelMonitor("c:/users/luizcarlos/desktop/", level).start();
}
}
| [
"[email protected]"
] | |
5e8cfbe741bceb2a7a602a3491b0a3ca9d89ba9b | 61ecb9b4a05a537d4dcc06ab69a984caa2824abe | /src/exception/OrderNotFoundException.java | c547057f7b42c12375c1f7bf63b832ca69c385d2 | [] | no_license | jschuringa/SE350project | 3358a8de0ab9cefa95a1162e40bc091117b85756 | 44afd6573f72fd98cc9201ad6d38d57c6ee4a074 | refs/heads/master | 2016-09-06T10:50:42.477586 | 2015-06-03T06:46:11 | 2015-06-03T06:46:11 | 34,359,098 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | package exception;
public class OrderNotFoundException extends Exception{
public OrderNotFoundException(String message) {
super(message);
}
public OrderNotFoundException() {
super();
}
}
| [
"[email protected]"
] | |
de55502ac0038bd84ba026ad1041aec5316b9c4a | 0c2e2e06c56ec0e05ddb74679fdfe6c4404274b1 | /hibernate/src/main/java/com/sda/hibernate/dao/UserJdbcDao.java | 7ca822cf4765617e91407144687ca00a7d1628ab | [] | no_license | cosminbucur/sda-upskill | d9ef46237c3cc93a25219b9ecbca60d0b7d5d14b | 71fcab3705a8fb8c72bfa7dfa33d17fbde6a31fd | refs/heads/master | 2023-08-11T20:19:51.710710 | 2021-09-11T20:16:18 | 2021-09-11T20:16:18 | 333,095,665 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,243 | java | package com.sda.hibernate.dao;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
public class UserJdbcDao implements UserDao {
public static final String URL = "jdbc:mysql://localhost:3306/hibernate?serverTimezone=UTC";
public static final String USERNAME = "root";
public static final String PASSWORD = "root";
private static final Logger logger = Logger.getLogger(UserJdbcDao.class.getName());
public void create(User user) {
Connection connection = null;
Statement statement = null;
try {
// create connection
connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
// create statement
statement = connection.createStatement();
String sql = "INSERT INTO user(name, email, password) VALUES "
+ "('" + user.getName() + "','" + user.getEmail() + "','" + user.getPassword() + "')";
// execute
statement.execute(sql);
// * process response (if needed)
} catch (SQLException e) {
// handle jdbc exceptions
logger.severe("failed to create user");
} catch (Exception e) {
// handle other exceptions
logger.severe("something went wrong");
} finally {
// close resources
try {
if (statement != null) {
statement.close();
}
} catch (SQLException e) {
logger.severe("failed to close statement");
}
try {
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
logger.severe("failed to close connection");
}
}
}
public List<User> findAll() {
String sql = "SELECT * FROM user";
List<User> result = new ArrayList<>();
try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(sql)) {
// iterate result set and get all values
while (resultSet.next()) {
long id = resultSet.getLong("id");
String name = resultSet.getString("name");
String email = resultSet.getString("email");
String password = resultSet.getString("password");
logger.info(id + ", " + name + ", " + email + ", " + password);
User user = new User(name, email, password);
user.setId(id);
logger.info(user.toString());
result.add(user);
}
} catch (SQLException e) {
logger.severe("failed to update");
}
return result;
}
public User findById(Long id) {
String sql = "SELECT * FROM user WHERE id = " + id;
User result = null;
try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(sql)) {
while (resultSet.next()) {
String name = resultSet.getString("name");
String email = resultSet.getString("email");
String password = resultSet.getString("password");
logger.info(id + ", " + name + ", " + email + ", " + password);
result = new User(name, email, password);
result.setId(id);
logger.info("found user " + result);
}
} catch (SQLException e) {
logger.severe("failed to update");
}
return result;
}
public void update(Long id, User userData) {
try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
Statement statement = connection.createStatement()) {
String sql = "UPDATE user SET name = '" + userData.getName() + "', " +
"email = '" + userData.getEmail() + "', " +
"password = '" + userData.getPassword() +
"' WHERE id = " + id;
statement.executeUpdate(sql);
} catch (SQLException e) {
logger.severe("failed to update");
}
}
public void delete(Long id) {
try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
Statement statement = connection.createStatement()) {
String sql = "DELETE FROM user WHERE id = " + id;
statement.execute(sql);
} catch (SQLException e) {
logger.severe("failed to delete");
}
}
@Override
public void deleteAll() {
try (Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
Statement statement = connection.createStatement()) {
String sql = "DELETE FROM user";
statement.execute(sql);
} catch (SQLException e) {
logger.severe("failed to delete");
}
}
}
| [
"[email protected]"
] | |
d105ab8533629a7b2f6ebd0dc49eaf1b35e828b5 | 69a800c30a08f23d008697d121d8e8b0ff49e680 | /fsa/src/main/java/com/hcl/fsa/repository/LedgerRepository.java | 71a8844900a5bf3938994c31db7340c3d26277f7 | [] | no_license | Dsilk1/petpeersapp | 40b0e5f31622a3e92aa8cb35d6047ab38838bd16 | effedec67f8919165c404f4c27601eec2770f68d | refs/heads/master | 2020-05-17T20:05:50.998341 | 2019-05-09T06:45:13 | 2019-05-09T06:45:13 | 183,934,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package com.hcl.fsa.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.hcl.fsa.entity.LedgerEntity;
@Repository
public interface LedgerRepository extends JpaRepository<LedgerEntity, Long>{
}
| [
"[email protected]"
] | |
4365be906aad2e19da4ba592cefe71a0b9acfe54 | a5d0a98f97c0616c2ab4fc82d3078d41028b578b | /core/src/ru/geekbrains/sprite/Background.java | f54728a8713c58b6a3b6ca485b72625abc6080f1 | [] | no_license | akutepov/StarGameProject | 5712a2d9a3f3f02ed64e1dae4599ba6eb673df89 | f1dda28a77ff85bd296a73831d5289e58df64bdc | refs/heads/master | 2020-06-17T08:23:54.838679 | 2019-08-01T17:33:16 | 2019-08-01T17:33:16 | 195,860,324 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | package ru.geekbrains.sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import ru.geekbrains.base.Sprite;
import ru.geekbrains.math.Rect;
public class Background extends Sprite {
public Background(TextureRegion region) {
super(region);
}
@Override
public void resize(Rect worldBounds) {
setHeightProportion(worldBounds.getHeight());
pos.set(worldBounds.pos);
}
}
| [
"[email protected]"
] | |
b8e3575da403d0cfdf602dde02be42549f9be31e | de3ccaace4f196c13789501e4b22af1d2cd98702 | /src/cobspecpasser/ParametersResponder.java | 69111e291d9e4e26204aee1e94d02cbb0937e982 | [] | no_license | davetorre/cobspecpasser | c00fddf330d808fea3a7916e2b69376a721c7c78 | f495deeb71e3e00d3c31f5dad6051e6c86ed6665 | refs/heads/master | 2016-09-16T14:32:42.698432 | 2014-10-23T15:29:15 | 2014-10-23T15:29:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 900 | java | package cobspecpasser;
import httpserver.HTTPRequest;
import httpserver.HTTPResponse;
import httpserver.Responder;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
public class ParametersResponder implements Responder {
public String decode(String input) {
input = input.replace("&", "\n");
input = input.replace("=", " = ");
try {
input = URLDecoder.decode(input, "UTF-8");
} catch (Exception e) {
input = "There was a problem decoding parameters.";
}
return input;
}
public HTTPResponse respond(HTTPRequest request) {
String decodedParams = decode(request.parameters);
return new HTTPResponse("HTTP/1.1 200 OK",
new HashMap<String, String>(),
decodedParams.getBytes());
}
}
| [
"[email protected]"
] | |
201bea69d7943558a5dbe2449bac8a8a233cb5d1 | 8c706b0cda72bc7a4d931c76210f424ef36a4895 | /main/java/vvr/vvr-it/src/test/java/io/eguan/vvr/it/package-info.java | b4c8f50076dadab46e47f810d2124725d5b1c350 | [] | no_license | llbrt/eguan | 6abd812f233648e8b4243d1154faac7283aa3cd5 | 85889da6cd7a6986468baa1019df1a0ccdd85997 | refs/heads/master | 2020-09-20T04:07:10.099211 | 2018-09-09T13:09:25 | 2018-09-09T13:09:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 801 | java | /**
* package for all client-side integration tests on the core repository API.
* <p>
* @author oodrive
* @author pwehrle
*/
package io.eguan.vvr.it;
/*
* #%L
* Project eguan
* %%
* Copyright (C) 2012 - 2017 Oodrive
* %%
* 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.
* #L%
*/
| [
"[email protected]"
] | |
04760add0df764e49c8b22bb00a4f1c795ed144f | 900aa6c4e14e05c85b4435e804c7fe5f6e6d9c13 | /src/pack1/AlertHandling.java | c87eef231c4ba80217f9b4ac3afb07d74ff57210 | [] | no_license | Ramakrishnac468/selenium | 21426fc92a7ffbe14dc88262c4501bd61b13ad58 | 51e96e494c68c81c939bb720c07e81b89b37c368 | refs/heads/master | 2020-03-22T00:19:28.502371 | 2018-06-30T09:45:15 | 2018-06-30T09:45:15 | 139,237,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | package pack1;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class AlertHandling {
public static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.gecko.driver", "D:\\Softwares\\Drivers\\geckodriver.exe");
driver = new FirefoxDriver();
//driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://toolsqa.wpengine.com/handling-alerts-using-selenium-webdriver/");
// Simple alert
//driver.findElement(By.xpath(".//*[@id='content']/p[4]/button")).click();
//Confirmation alert
//driver.findElement(By.xpath(".//*[@id='content']/p[8]/button")).click();
Thread.sleep(3000);
//driver.switchTo().alert().accept();
//Prompt alert
driver.findElement(By.xpath(".//*[@id='content']/p[11]/button")).click();
Alert alt=driver.switchTo().alert();
Thread.sleep(3000);
alt.sendKeys("hello");
Thread.sleep(3000);
alt.accept();
}
}
| [
"[email protected]"
] | |
71a38a233be644a773fde185b7299862cbe545e0 | 4b15394669b73561de5f1078b659c59400f74507 | /app/src/main/java/com/materialdesignstudy/adapter/MyStaggeredAdapter.java | a2f60f1a29343b50da8a3d923a778431079abaed | [] | no_license | HLQ-Struggle/MaterialDesignStudy | d5ac02257d2bb19e15e7fb9dea3774ac4001dde3 | 9c1d16021aebda5abcd18a4f428ba1c6ec96cb48 | refs/heads/master | 2021-01-23T17:04:09.226037 | 2018-07-09T04:29:54 | 2018-07-09T04:29:54 | 102,754,862 | 12 | 2 | null | null | null | null | UTF-8 | Java | false | false | 5,057 | java | package com.materialdesignstudy.adapter;
import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.TextView;
import com.materialdesignstudy.R;
import java.util.ArrayList;
import java.util.List;
/**
* Created by HLQ on 2017/9/25
*/
public class MyStaggeredAdapter extends RecyclerView.Adapter<MyStaggeredAdapter.ViewHolder> {
private final List<String> mStrlist;
private final List<Integer> mHeightlist;
private OnItemClickListener mOnItemClickListener;
private onItemLongClickListener mOnItemLongClickListener;
public MyStaggeredAdapter(List<String> strList) {
mStrlist = strList;
mHeightlist = new ArrayList<>();
for (int i = 0; i < strList.size(); i++) {
mHeightlist.add((int) Math.max(200, Math.random() * 550));
}
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
ViewHolder viewHolder = new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_recycle_view, parent, false));
return viewHolder;
}
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) { // 数据绑定
LayoutParams params = holder.tvShow.getLayoutParams();
params.height = mHeightlist.get(position);
holder.tvShow.setBackgroundColor(Color.rgb(100, (int) (Math.random() * 255), (int) (Math.random() * 255)));
holder.tvShow.setLayoutParams(params);
holder.tvShow.setText(mStrlist.get(position));
// 设置点击事件
if (mOnItemClickListener != null) {
// holder.itemView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// mOnItemClickListener.onItemClick(view, position);
// }
// });
// 解决item position错位
holder.itemView.setOnClickListener(new MyClickListener(position));
}
// 设置长按事件
if (mOnItemLongClickListener != null) {
holder.itemView.setOnLongClickListener(new MyLongClickListener(position));
}
}
@Override
public int getItemCount() {
return mStrlist.size();
}
/**
* 新增item数据
*
* @param position
*/
public void addItemData(int position) {
mStrlist.add(position, "新增item:" + position);
// 会影响效率
// notifyDataSetChanged();
// 刷新新增数据位置
notifyItemInserted(position);
// 更新下方所有item position
if (position != mStrlist.size()) {
notifyItemRangeChanged(position, mStrlist.size() - position);
}
}
/**
* 删除item数据
*
* @param position
*/
public void removeItemData(int position) {
mStrlist.remove(position);
// notifyDataSetChanged();
// 刷新removed位置数据
notifyItemRemoved(position);
// 更新下方所有item position
if (position != mStrlist.size()) {
notifyItemRangeChanged(position, mStrlist.size() - position);
}
}
class ViewHolder extends RecyclerView.ViewHolder {
private TextView tvShow;
public ViewHolder(View itemView) {
super(itemView);
tvShow = (TextView) itemView.findViewById(R.id.id_item_r);
}
}
/**
* 单击事件
*/
public interface OnItemClickListener {
void onItemClick(View view, int position);
}
/**
* 设置单击事件
*
* @param onItemClickListener
*/
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
this.mOnItemClickListener = onItemClickListener;
}
/**
* 长按事件
*/
public interface onItemLongClickListener {
void onItemLongClick(View view, int position);
}
public void setOnItemLongClickListener(onItemLongClickListener onItemLongClickListener) {
this.mOnItemLongClickListener = onItemLongClickListener;
}
/**
* 重写OnClick解决item点击时position可能出现错位bug
*/
class MyClickListener implements View.OnClickListener {
private int mPosition;
public MyClickListener(int position) {
this.mPosition = position;
}
@Override
public void onClick(View v) {
mOnItemClickListener.onItemClick(v, mPosition);
}
}
class MyLongClickListener implements View.OnLongClickListener {
private int mPosition;
public MyLongClickListener(int position) {
this.mPosition = position;
}
@Override
public boolean onLongClick(View v) {
mOnItemLongClickListener.onItemLongClick(v, mPosition);
return true;
}
}
}
| [
"[email protected]"
] | |
49abcac28a5d2c214f50cc7c5a0c7708e60782d4 | 0e71221a4492010c0254f98b29535b66f2811679 | /app/src/test/java/com/raza/twitterfeed/ExampleUnitTest.java | 3c58bf10a7fd01ca5479644ec179cb433dc77967 | [] | no_license | jaffarraza/TwitterFeed | 7b319d3bf7926e26b0c6a98d1b5b44557b929258 | e21380daafa9d205d8fdc66c31acda41b12be76f | refs/heads/master | 2021-01-19T04:34:59.859308 | 2016-08-08T05:27:37 | 2016-08-08T05:27:37 | 65,174,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 313 | java | package com.raza.twitterfeed;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
1ce813d32cfa911cc4c92dfed272b350b49cdc28 | 5d7c8d78e72ae3ea6e61154711fdd23248c19614 | /sources/com/iflytek/xiri/scene/ISceneListener.java | 73aa03ba685b8c75161869c2c5d163a2c890d78b | [] | no_license | activeliang/tv.taobao.android | 8058497bbb45a6090313e8445107d987d676aff6 | bb741de1cca9a6281f4c84a6d384333b6630113c | refs/heads/master | 2022-11-28T10:12:53.137874 | 2020-08-06T05:43:15 | 2020-08-06T05:43:15 | 285,483,760 | 7 | 6 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | package com.iflytek.xiri.scene;
import android.content.Intent;
public interface ISceneListener {
void onExecute(Intent intent);
String onQuery();
}
| [
"[email protected]"
] | |
fe7afc5185df00508b502750de0327427f15714e | 642ae23ecf7f15eeeefdd381584c25f31d5d10ab | /src/test/java/EmpRoleTestCase/EmpApplyWFHTestCase.java | fee1b6ecb03e81f3b15b809bf15a57b52fb574f0 | [] | no_license | VivekJai91/HRMS-POM | 56c709fa5f09a25916e6553d53eca3e50a8a1b3d | 9442c8767893faca8758a1a629c0c783f53d271f | refs/heads/master | 2023-04-11T00:33:54.785949 | 2021-04-25T09:11:22 | 2021-04-25T09:11:22 | 361,381,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,343 | java | package EmpRoleTestCase;
import java.io.IOException;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import Base.Base;
import DataProvider.FetchDataFromExcel;
import EmpRolePages.EmpApplyWFH;
import EmpRolePages.LoginPage;
import Report.ExtentReport;
import junit.framework.Assert;
public class EmpApplyWFHTestCase extends Base {
LoginPage login;
EmpApplyWFH applyWFH;
String acutalText;
public EmpApplyWFHTestCase()
{
super();
}
@BeforeTest
public void setupExtentReport()
{
ExtentReport.setExtent();
}
@AfterTest
public void endReport()
{
ExtentReport.endReport();
}
@BeforeMethod
@Parameters("browser")
public void setUp(String browsername)
{
browserStart(browsername);
login = new LoginPage();
applyWFH= new EmpApplyWFH();
login.Emplogin(prop.getProperty("username"),prop.getProperty("password"));
}
@Test(dataProvider="ApplyWFHRequest",dataProviderClass=FetchDataFromExcel.class, priority=1)
public void verifyApplyWFH(String StartMonth, String StartDate, String EndMonth, String EndDate ,String ContactNo, String AssignPerson, String WFHReason, String verifyText)
{
ExtentReport.startTest("verifyApplyWFH");
acutalText=applyWFH.addNewWFHRequest(StartMonth, StartDate, EndMonth, EndDate,ContactNo, AssignPerson, WFHReason);
Assert.assertEquals(acutalText, verifyText);
}
@Test(dataProvider="CancelWFHRequest",dataProviderClass=FetchDataFromExcel.class, priority=2)
public void verifyCancelWFHRequest(String WFHStatus, String WFHDate, String verifyText )
{
ExtentReport.startTest("verifyCancelWFHRequest");
acutalText= applyWFH.cancelWFHRequest(WFHStatus, WFHDate);
Assert.assertEquals(acutalText, verifyText);
}
@AfterMethod
public void tearDown(ITestResult result) throws IOException{
ExtentReport.tearDown(result, driver);
driver.quit();
}
}
| [
"[email protected]"
] | |
7a0afce82cc01ed6feabb428dbc2b279f92336c2 | 13c9af76bc58a89cef4001d403bb0eb83424a935 | /Java/Trend.Nxt Core Java L1 Learning Path/t2a2.java | fbe02f29e45d2837011268a33934caee389f7224 | [
"MIT"
] | permissive | vaibhavkrishna-bhosle/Trendnxt-Projects | 94eab2af09388708579d6871bfba1a2023eaef66 | 6c8a31be2f05ec79cfc5086ee09adff161b836ad | refs/heads/main | 2023-06-01T23:28:23.862339 | 2021-06-18T13:11:39 | 2021-06-18T13:11:39 | 374,156,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | import java.util.*;
public class Main
{
static int flag = 1;
public static void main(String[] args)
{
while (true && flag<=11)
{
Calendar a = Calendar.getInstance();
String wTime = "HH:MM:SS";
String sec = Integer.toString(a.get(Calendar.SECOND));
String min = Integer.toString(a.get(Calendar.MINUTE));
String hour = Integer.toString(a.get(Calendar.HOUR_OF_DAY));
String time = hour + ":" + min + ":" + sec;
if(time == wTime)
{
}
try
{
System.out.println(time);
Thread.sleep(2000);
flag++;
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
}
} | [
"[email protected]"
] | |
55a3f9c1201b1fece8bc43f80a92f8eaa281f3f0 | 51a738face943b2b169aec34301ccbb41bda813f | /Metrel.Android/obj/Debug/90/android/src/android/support/mediacompat/R.java | d107f30c8dbe3a6b4e7919c2713e4cd8d58cc921 | [] | no_license | NejcPivec/Xamarin_Metr | f6be034ef25c2a07e347fb08117a98221442a0fa | f4ec70c3f35dd820be58ebaf3f068e4dba8eb665 | refs/heads/main | 2023-02-28T12:01:08.441435 | 2021-01-28T12:24:52 | 2021-01-28T12:24:52 | 319,031,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,314 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by
* Xamarin.Android from the resource data it found.
* It should not be modified by hand.
*/
package android.support.mediacompat;
public final class R {
public static final class attr {
public static final int alpha = 0x7f030027;
public static final int font = 0x7f0300d1;
public static final int fontProviderAuthority = 0x7f0300d3;
public static final int fontProviderCerts = 0x7f0300d4;
public static final int fontProviderFetchStrategy = 0x7f0300d5;
public static final int fontProviderFetchTimeout = 0x7f0300d6;
public static final int fontProviderPackage = 0x7f0300d7;
public static final int fontProviderQuery = 0x7f0300d8;
public static final int fontStyle = 0x7f0300d9;
public static final int fontVariationSettings = 0x7f0300da;
public static final int fontWeight = 0x7f0300db;
public static final int ttcIndex = 0x7f0301d1;
}
public static final class color {
public static final int notification_action_color_filter = 0x7f05006f;
public static final int notification_icon_bg_color = 0x7f050070;
public static final int notification_material_background_media_default_color = 0x7f050071;
public static final int primary_text_default_material_dark = 0x7f050076;
public static final int ripple_material_light = 0x7f05007b;
public static final int secondary_text_default_material_dark = 0x7f05007c;
public static final int secondary_text_default_material_light = 0x7f05007d;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f060050;
public static final int compat_button_inset_vertical_material = 0x7f060051;
public static final int compat_button_padding_horizontal_material = 0x7f060052;
public static final int compat_button_padding_vertical_material = 0x7f060053;
public static final int compat_control_corner_material = 0x7f060054;
public static final int compat_notification_large_icon_max_height = 0x7f060055;
public static final int compat_notification_large_icon_max_width = 0x7f060056;
public static final int notification_action_icon_size = 0x7f0600c2;
public static final int notification_action_text_size = 0x7f0600c3;
public static final int notification_big_circle_margin = 0x7f0600c4;
public static final int notification_content_margin_start = 0x7f0600c5;
public static final int notification_large_icon_height = 0x7f0600c6;
public static final int notification_large_icon_width = 0x7f0600c7;
public static final int notification_main_column_padding_top = 0x7f0600c8;
public static final int notification_media_narrow_margin = 0x7f0600c9;
public static final int notification_right_icon_size = 0x7f0600ca;
public static final int notification_right_side_padding_top = 0x7f0600cb;
public static final int notification_small_icon_background_padding = 0x7f0600cc;
public static final int notification_small_icon_size_as_large = 0x7f0600cd;
public static final int notification_subtext_size = 0x7f0600ce;
public static final int notification_top_pad = 0x7f0600cf;
public static final int notification_top_pad_large_text = 0x7f0600d0;
public static final int subtitle_corner_radius = 0x7f0600d1;
public static final int subtitle_outline_width = 0x7f0600d2;
public static final int subtitle_shadow_offset = 0x7f0600d3;
public static final int subtitle_shadow_radius = 0x7f0600d4;
}
public static final class drawable {
public static final int notification_action_background = 0x7f07008c;
public static final int notification_bg = 0x7f07008d;
public static final int notification_bg_low = 0x7f07008e;
public static final int notification_bg_low_normal = 0x7f07008f;
public static final int notification_bg_low_pressed = 0x7f070090;
public static final int notification_bg_normal = 0x7f070091;
public static final int notification_bg_normal_pressed = 0x7f070092;
public static final int notification_icon_background = 0x7f070093;
public static final int notification_template_icon_bg = 0x7f070094;
public static final int notification_template_icon_low_bg = 0x7f070095;
public static final int notification_tile_bg = 0x7f070096;
public static final int notify_panel_notification_icon_bg = 0x7f070097;
}
public static final class id {
public static final int action0 = 0x7f080007;
public static final int action_container = 0x7f08000f;
public static final int action_divider = 0x7f080011;
public static final int action_image = 0x7f080012;
public static final int action_text = 0x7f080018;
public static final int actions = 0x7f080019;
public static final int async = 0x7f08001f;
public static final int blocking = 0x7f080022;
public static final int cancel_action = 0x7f08002c;
public static final int chronometer = 0x7f080031;
public static final int end_padder = 0x7f080045;
public static final int forever = 0x7f080052;
public static final int icon = 0x7f080057;
public static final int icon_group = 0x7f080058;
public static final int info = 0x7f08005b;
public static final int italic = 0x7f08005c;
public static final int line1 = 0x7f080061;
public static final int line3 = 0x7f080062;
public static final int media_actions = 0x7f08006a;
public static final int normal = 0x7f080074;
public static final int notification_background = 0x7f080075;
public static final int notification_main_column = 0x7f080076;
public static final int notification_main_column_container = 0x7f080077;
public static final int right_icon = 0x7f080081;
public static final int right_side = 0x7f080082;
public static final int status_bar_latest_event_content = 0x7f0800aa;
public static final int tag_transition_group = 0x7f0800af;
public static final int tag_unhandled_key_event_manager = 0x7f0800b0;
public static final int tag_unhandled_key_listeners = 0x7f0800b1;
public static final int text = 0x7f0800b2;
public static final int text2 = 0x7f0800b3;
public static final int time = 0x7f0800bb;
public static final int title = 0x7f0800bc;
}
public static final class integer {
public static final int cancel_button_image_alpha = 0x7f090004;
public static final int status_bar_notification_info_maxnum = 0x7f09000e;
}
public static final class layout {
public static final int notification_action = 0x7f0b0031;
public static final int notification_action_tombstone = 0x7f0b0032;
public static final int notification_media_action = 0x7f0b0033;
public static final int notification_media_cancel_action = 0x7f0b0034;
public static final int notification_template_big_media = 0x7f0b0035;
public static final int notification_template_big_media_custom = 0x7f0b0036;
public static final int notification_template_big_media_narrow = 0x7f0b0037;
public static final int notification_template_big_media_narrow_custom = 0x7f0b0038;
public static final int notification_template_custom_big = 0x7f0b0039;
public static final int notification_template_icon_group = 0x7f0b003a;
public static final int notification_template_lines_media = 0x7f0b003b;
public static final int notification_template_media = 0x7f0b003c;
public static final int notification_template_media_custom = 0x7f0b003d;
public static final int notification_template_part_chronometer = 0x7f0b003e;
public static final int notification_template_part_time = 0x7f0b003f;
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f0d0036;
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f0e0117;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0118;
public static final int TextAppearance_Compat_Notification_Info_Media = 0x7f0e0119;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e011a;
public static final int TextAppearance_Compat_Notification_Line2_Media = 0x7f0e011b;
public static final int TextAppearance_Compat_Notification_Media = 0x7f0e011c;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0e011d;
public static final int TextAppearance_Compat_Notification_Time_Media = 0x7f0e011e;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0e011f;
public static final int TextAppearance_Compat_Notification_Title_Media = 0x7f0e0120;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01c6;
public static final int Widget_Compat_NotificationActionText = 0x7f0e01c7;
}
public static final class styleable {
public static final int[] ColorStateListItem = new int[] { 0x010101a5, 0x0101031f, 0x7f030027 };
public static final int ColorStateListItem_alpha = 2;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_android_color = 0;
public static final int[] FontFamily = new int[] { 0x7f0300d3, 0x7f0300d4, 0x7f0300d5, 0x7f0300d6, 0x7f0300d7, 0x7f0300d8 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = new int[] { 0x01010532, 0x01010533, 0x0101053f, 0x0101056f, 0x01010570, 0x7f0300d1, 0x7f0300d9, 0x7f0300da, 0x7f0300db, 0x7f0301d1 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = new int[] { 0x0101019d, 0x0101019e, 0x010101a1, 0x010101a2, 0x010101a3, 0x010101a4, 0x01010201, 0x0101020b, 0x01010510, 0x01010511, 0x01010512, 0x01010513 };
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_type = 2;
public static final int[] GradientColorItem = new int[] { 0x010101a5, 0x01010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"[email protected]"
] | |
886d98964266e8a80266c8883a02a4bfb76a125a | b280a34244a58fddd7e76bddb13bc25c83215010 | /scmv6/center-batch/src/main/java/com/smate/center/batch/dao/rol/pub/PubAssignCnkiAuthorDao.java | 8dd0d4f28f4abc848246017fc5184e6c917c67c4 | [] | no_license | hzr958/myProjects | 910d7b7473c33ef2754d79e67ced0245e987f522 | d2e8f61b7b99a92ffe19209fcda3c2db37315422 | refs/heads/master | 2022-12-24T16:43:21.527071 | 2019-08-16T01:46:18 | 2019-08-16T01:46:18 | 202,512,072 | 2 | 3 | null | 2022-12-16T05:31:05 | 2019-08-15T09:21:04 | Java | UTF-8 | Java | false | false | 3,311 | java | package com.smate.center.batch.dao.rol.pub;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.springframework.stereotype.Repository;
import com.smate.center.batch.model.rol.pub.PubAssignCnkiAuthor;
import com.smate.core.base.utils.data.RolHibernateDao;
import com.smate.core.base.utils.string.ServiceUtil;
/**
* CNKI成果作者名称DAO.
*
* @author liqinghua
*
*/
@Repository
public class PubAssignCnkiAuthorDao extends RolHibernateDao<PubAssignCnkiAuthor, Long> {
/**
* 判断成果是否已经拆分过作者.
*
* @param pubId
* @return
*/
public boolean isExistsPubAuthor(Long pubId) {
String hql = "select count(id) from PubAssignCnkiAuthor where pubId = ? ";
Long count = super.findUnique(hql, pubId);
if (count > 0) {
return true;
}
return false;
}
/**
* 获取单位用户名称匹配上成果作者的人员ID列表.
*
* @param pubId
* @param insId
* @return
*/
public List<Object[]> getCnkiNameMatchPubAuthor(Long pubId, Long insId) {
StringBuilder hql = new StringBuilder();
hql.append(
"select distinct rp.pk.psnId,pa.seqNo,pa.insId from PubAssignCnkiAuthor pa,PsnPmCnkiName pp,RolPsnIns rp ");
// 用户必须在职
hql.append(
" where rp.pk.insId = ? and rp.pk.psnId = pp.psnId and pa.pubId = ? and rp.status = 1 and rp.isIns = 0 ");
// insid=2表示单位为空
hql.append(" and pp.name = pa.name and (pa.insId = ? or pa.insId =2 )");
return super.find(hql.toString(), insId, pubId, insId);
}
/**
* 获取匹配上单位人员的CNKI成果列表.
*
* @param pubId
* @param insId
* @return
*/
@SuppressWarnings("unchecked")
public List<Object[]> getCnkiPubAuthorMatchPsn(Long psnId, Long insId) {
StringBuilder hql = new StringBuilder();
hql.append("select distinct pa.pubId,pa.seqNo,pa.insId from PubAssignCnkiAuthor pa,PsnPmCnkiName pp ");
hql.append(" where pa.pubInsId = :insId and pp.psnId = :psnId ");
// 名称匹配
hql.append(" and pp.name = pa.name and (pa.insId = :insId or pa.insId =2)");
return super.createQuery(hql.toString()).setParameter("insId", insId).setParameter("psnId", psnId).list();
}
/**
* 获取单位用户合作者匹配上成果作者的人员ID列表.
*
* @param pubId
* @param psnIds
* @return
*/
@SuppressWarnings("unchecked")
public List<Object[]> getCnkiConMatchPubAuthor(Long pubId, Set<Long> psnIds) {
String hql =
"select pp.psnId,count(pp.psnId) from PubAssignCnkiAuthor pa ,PsnPmCnkiConame pp where pa.pubId =:pubId and pp.psnId in(:psnIds) and pp.name = pa.name group by pp.psnId ";
Collection<Collection<Long>> container = ServiceUtil.splitList(psnIds, 80);
List<Object[]> listResult = new ArrayList<Object[]>();
for (Collection<Long> item : container) {
listResult.addAll(super.createQuery(hql).setParameter("pubId", pubId).setParameterList("psnIds", item).list());
}
return listResult;
}
/**
* 获取成果作者列表.
*
* @param pubId
* @return
*/
public List<PubAssignCnkiAuthor> getPubAuthor(Long pubId) {
String hql = "from PubAssignCnkiAuthor where pubId = ? ";
return super.find(hql, pubId);
}
}
| [
"[email protected]"
] | |
947cec8ee0c194a563a4c7589af82671f66e1a4e | d8f6d06a331e4f571ad905e07f68f0a72247b318 | /ta_ice/lib/toplink-src/oracle/toplink/exceptions/XMLMarshalException.java | 0eb027eedc9c1dcea76348c2a989b8531133c1d6 | [] | no_license | reggiej/TA_ICE_Dlittle | daabc425c3bba71226ac57a7287fc29954546a73 | 6b3dad230772480c1c07dbd5f953b17261f89a4a | refs/heads/master | 2016-09-06T04:25:06.713090 | 2014-05-19T17:26:18 | 2014-05-19T17:26:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,857 | java | // Copyright (c) 1998, 2006, Oracle. All rights reserved.
package oracle.toplink.exceptions;
import oracle.toplink.exceptions.ValidationException;
import oracle.toplink.mappings.DatabaseMapping;
import oracle.toplink.ox.XMLDescriptor;
import oracle.toplink.exceptions.i18n.ExceptionMessageGenerator;
public class XMLMarshalException extends ValidationException {
public static final int INVALID_XPATH_STRING = 25001;
public static final int INVALID_XPATH_INDEX_STRING = 25002;
public static final int MARSHAL_EXCEPTION = 25003;
public static final int UNMARSHAL_EXCEPTION = 25004;
public static final int VALIDATE_EXCEPTION = 25005;
public static final int DEFAULT_ROOT_ELEMENT_NOT_SPECIFIED = 25006;
public static final int DESCRIPTOR_NOT_FOUND_IN_PROJECT = 25007;
public static final int NO_DESCRIPTOR_WITH_MATCHING_ROOT_ELEMENT = 25008;
public static final int SCHEMA_REFERENCE_NOT_SET = 25010;
public static final int NULL_ARGUMENT = 25011;
public static final int ERROR_RESOLVING_XML_SCHEMA = 25012;
public static final int ERROR_SETTING_SCHEMAS = 25013;
public static final int ERROR_INSTANTIATING_SCHEMA_PLATFORM = 25014;
public static final int NAMESPACE_RESOLVER_NOT_SPECIFIED = 25015;
public static final int NAMESPACE_NOT_FOUND = 25016;
public static final int ENUM_CLASS_NOT_SPECIFIED = 25017;
public static final int FROMSTRING_METHOD_ERROR = 25018;
public static final int INVALID_ENUM_CLASS_SPECIFIED = 25019;
public static final int ILLEGAL_STATE_XML_UNMARSHALLER_HANDLER = 25020;
public static final int INVALID_SWA_REF_ATTRIBUTE_TYPE = 25021;
public static final int NO_ENCODER_FOR_MIME_TYPE = 25022;
public static final int NO_DESCRIPTOR_FOUND = 25023;
public static final int ERROR_INSTANTIATING_UNMAPPED_CONTENTHANDLER = 25024;
public static final int UNMAPPED_CONTENTHANDLER_DOESNT_IMPLEMENT = 25025;
// ==========================================================================================
protected XMLMarshalException(String message) {
super(message);
}
protected XMLMarshalException(String message, Exception internalException) {
super(message, internalException);
}
// ==========================================================================================
public static XMLMarshalException invalidXPathString(String xpathString, Exception nestedException) {
Object[] args = { xpathString };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, INVALID_XPATH_STRING, args), nestedException);
exception.setErrorCode(INVALID_XPATH_STRING);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException invalidXPathIndexString(String xpathString) {
Object[] args = { xpathString };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, INVALID_XPATH_INDEX_STRING, args));
exception.setErrorCode(INVALID_XPATH_INDEX_STRING);
return exception;
}
public static XMLMarshalException marshalException(Exception nestedException) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, MARSHAL_EXCEPTION, args), nestedException);
exception.setErrorCode(MARSHAL_EXCEPTION);
return exception;
}
public static XMLMarshalException unmarshalException() {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, UNMARSHAL_EXCEPTION, args));
exception.setErrorCode(UNMARSHAL_EXCEPTION);
return exception;
}
public static XMLMarshalException unmarshalException(Exception nestedException) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, UNMARSHAL_EXCEPTION, args), nestedException);
exception.setErrorCode(UNMARSHAL_EXCEPTION);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException validateException(Exception nestedException) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, VALIDATE_EXCEPTION, args), nestedException);
exception.setErrorCode(VALIDATE_EXCEPTION);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException defaultRootElementNotSpecified(XMLDescriptor descriptor) {
Object[] args = { descriptor.getJavaClassName() };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, DEFAULT_ROOT_ELEMENT_NOT_SPECIFIED, args));
exception.setErrorCode(DEFAULT_ROOT_ELEMENT_NOT_SPECIFIED);
return exception;
}
public static XMLMarshalException descriptorNotFoundInProject(String className) {
Object[] args = { className };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, DESCRIPTOR_NOT_FOUND_IN_PROJECT, args));
exception.setErrorCode(DESCRIPTOR_NOT_FOUND_IN_PROJECT);
return exception;
}
public static XMLMarshalException noDescriptorWithMatchingRootElement(String rootElementName) {
Object[] args = { rootElementName };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NO_DESCRIPTOR_WITH_MATCHING_ROOT_ELEMENT, args));
exception.setErrorCode(NO_DESCRIPTOR_WITH_MATCHING_ROOT_ELEMENT);
return exception;
}
public static XMLMarshalException schemaReferenceNotSet(XMLDescriptor descriptor) {
Object[] args = { descriptor.getJavaClassName() };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, SCHEMA_REFERENCE_NOT_SET, args));
exception.setErrorCode(SCHEMA_REFERENCE_NOT_SET);
return exception;
}
public static XMLMarshalException nullArgumentException() {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NULL_ARGUMENT, args));
exception.setErrorCode(NULL_ARGUMENT);
return exception;
}
public static XMLMarshalException errorResolvingXMLSchema(Exception nestedException) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ERROR_RESOLVING_XML_SCHEMA, args), nestedException);
exception.setErrorCode(ERROR_RESOLVING_XML_SCHEMA);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException errorSettingSchemas(Exception nestedException, Object[] schemas) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ERROR_RESOLVING_XML_SCHEMA, args), nestedException);
exception.setErrorCode(ERROR_SETTING_SCHEMAS);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException errorInstantiatingSchemaPlatform(Exception nestedException) {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ERROR_INSTANTIATING_SCHEMA_PLATFORM, args), nestedException);
exception.setErrorCode(ERROR_INSTANTIATING_SCHEMA_PLATFORM);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException namespaceResolverNotSpecified(String localName) {
Object[] args = { localName };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NAMESPACE_RESOLVER_NOT_SPECIFIED, args));
exception.setErrorCode(NAMESPACE_RESOLVER_NOT_SPECIFIED);
return exception;
}
public static XMLMarshalException namespaceNotFound(String prefix) {
Object[] args = { prefix };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NAMESPACE_NOT_FOUND, args));
exception.setErrorCode(NAMESPACE_NOT_FOUND);
return exception;
}
public static XMLMarshalException enumClassNotSpecified() {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ENUM_CLASS_NOT_SPECIFIED, args));
exception.setErrorCode(ENUM_CLASS_NOT_SPECIFIED);
return exception;
}
public static XMLMarshalException errorInvokingFromStringMethod(Exception nestedException, String className) {
Object[] args = { className };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, FROMSTRING_METHOD_ERROR, args), nestedException);
exception.setErrorCode(FROMSTRING_METHOD_ERROR);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException invalidEnumClassSpecified(Exception nestedException, String className) {
Object[] args = { className };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, INVALID_ENUM_CLASS_SPECIFIED, args), nestedException);
exception.setErrorCode(INVALID_ENUM_CLASS_SPECIFIED);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException illegalStateXMLUnmarshallerHandler() {
Object[] args = { };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ILLEGAL_STATE_XML_UNMARSHALLER_HANDLER, args));
exception.setErrorCode(ILLEGAL_STATE_XML_UNMARSHALLER_HANDLER);
return exception;
}
public static XMLMarshalException invalidSwaRefAttribute(String attributeClassification) {
Object[] args = { attributeClassification };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, INVALID_SWA_REF_ATTRIBUTE_TYPE, args));
exception.setErrorCode(INVALID_SWA_REF_ATTRIBUTE_TYPE);
return exception;
}
public static XMLMarshalException noEncoderForMimeType(String mimeType) {
Object[] args = { mimeType };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NO_ENCODER_FOR_MIME_TYPE, args));
exception.setErrorCode(NO_ENCODER_FOR_MIME_TYPE);
return exception;
}
public static XMLMarshalException noDescriptorFound(DatabaseMapping mapping) {
Object[] args = { mapping.getAttributeName() };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, NO_DESCRIPTOR_FOUND, args));
exception.setErrorCode(NO_DESCRIPTOR_FOUND);
return exception;
}
public static XMLMarshalException errorInstantiatingUnmappedContentHandler(Exception nestedException, String className) {
Object[] args = { className };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, ERROR_INSTANTIATING_UNMAPPED_CONTENTHANDLER, args), nestedException);
exception.setErrorCode(ERROR_INSTANTIATING_UNMAPPED_CONTENTHANDLER);
exception.setInternalException(nestedException);
return exception;
}
public static XMLMarshalException unmappedContentHandlerDoesntImplement(Exception nestedException, String className) {
Object[] args = { className };
XMLMarshalException exception = new XMLMarshalException(ExceptionMessageGenerator.buildMessage(XMLMarshalException.class, UNMAPPED_CONTENTHANDLER_DOESNT_IMPLEMENT, args), nestedException);
exception.setErrorCode(UNMAPPED_CONTENTHANDLER_DOESNT_IMPLEMENT);
exception.setInternalException(nestedException);
return exception;
}
}
| [
"[email protected]"
] | |
b8559f2605bc43b0961bdb3bb60a47691730320e | 68b76d238cebf5c39698d8a87578d237545dcd91 | /demo/src/main/java/com/foodbird/demo/entity/CourseRecord.java | d19038c669f46dafb9c17f1ef08babe728cfba4b | [] | no_license | yuyangi/foodbird | ae39dcb5e4ae310c739a3800b982f666a0907be2 | 5856b856dd5c7a69b3398169fa42a53d09d06692 | refs/heads/master | 2021-01-24T12:14:49.646529 | 2019-02-17T03:25:59 | 2019-02-17T03:25:59 | 59,343,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package com.foodbird.demo.entity;
/**
* @author yuyang48
* @prject com.foodbird.coder
* @date 2019/1/18
*/
public class CourseRecord {
}
| [
"[email protected]"
] | |
a9779d4b39c8bdc24f1426d25286926eed0db5c5 | 98e2513391aa29182dd6bf0918efe71ea7e6e14c | /src/main/java/com/openhome/controllers/place/PlaceDeleteController.java | 6bd15ba83ce1ad8d627be81eea62a57fedf59970 | [] | no_license | abhilashvadnala/OpenHome | 73a7454d94fa7a7b1590ea4906d027bb8ac00148 | b770679a6ecc86954cc0be078bcdce0acdb1856f | refs/heads/master | 2022-03-26T09:09:53.240568 | 2019-12-20T21:30:55 | 2019-12-20T21:30:55 | 274,629,898 | 1 | 0 | null | 2020-06-24T09:34:41 | 2020-06-24T09:34:40 | null | UTF-8 | Java | false | false | 2,363 | java | package com.openhome.controllers.place;
import java.util.Date;
import java.util.List;
import javax.persistence.Transient;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.openhome.aop.helper.annotation.ValidPlaceId;
import com.openhome.controllers.helper.ControllerHelper;
import com.openhome.controllers.helper.Mail;
import com.openhome.OpenHomeMvcApplication;
import com.openhome.aop.helper.annotation.PlaceHostLoginRequired;
import com.openhome.aop.helper.annotation.ValidAlivePlaceId;
import com.openhome.dao.PlaceDAO;
import com.openhome.data.Reservation;
import com.openhome.data.helper.PlaceManager;
import com.openhome.exception.CustomException;
import com.openhome.exception.ExceptionManager;
import com.openhome.data.Host;
import com.openhome.data.Place;
import com.openhome.session.SessionManager;
import com.openhome.tam.TimeAdvancementManagement;
@Controller
@RequestMapping("/place/delete")
public class PlaceDeleteController {
@Autowired(required=true)
PlaceManager placeManager;
@Autowired(required=true)
TimeAdvancementManagement timeAdvancementManagement;
@Autowired(required=true)
ExceptionManager exceptionManager;
@RequestMapping(method=RequestMethod.GET)
@ValidAlivePlaceId
@PlaceHostLoginRequired
public String deleteForm( @RequestParam(value="placeId",required=false) Long placeId, Model model , HttpSession httpSession ) {
System.out.println("PlaceDeleteController");
try {
Place s = placeManager.deletePlace(timeAdvancementManagement.getCurrentDate(), placeId);
return ControllerHelper.popupMessageAndRedirect("Deleted Place Successfully.", "/place/view?placeId="+s.getId(),new Mail(
s.getHost().getUserDetails().getEmail(),
"OpenHome: Place Deleted Successfully",
"Link to your deleted place : "+OpenHomeMvcApplication.baseUrl+"/place/view?placeId="+s.getId()
));
} catch (Exception e) {
exceptionManager.reportException(e);
return ControllerHelper.popupMessageAndRedirect(e.getMessage(), "/place/view?placeId="+placeId);
}
}
}
| [
"[email protected]"
] | |
7b937c4a7078047b83a181e3273e8271b10d5bb3 | 6e7b2d5ed319e356d811d06d3c381af2cc5506cd | /gkpt-server/src/main/java/com/dong/server/controller/course/ChapterController.java | a307593908a80b6904c1ce4be67ec57a76c79590 | [] | no_license | sweetbetter/gkpt-bishe | c2cdc245c752f2e6e28538fe97da290822924fe6 | 90595ca80c36df7182711be2b2828bcca56c82dd | refs/heads/master | 2023-03-23T08:10:17.816990 | 2021-03-20T17:22:42 | 2021-03-20T17:22:42 | 346,048,503 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.dong.server.controller.course;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 课程 前端控制器
* </p>
*
* @author caojingdong
* @since 2021-03-19
*/
@RestController
@RequestMapping("/course/chapter")
public class ChapterController {
}
| [
"[email protected]"
] | |
fef48d79bc92f242a8d42f5fbf77bcdc62d51a9c | 0c4f4be0ac158924865ebd5830fb07bd13b695a1 | /src/SetAccountDialog.java | 713e010add785ff6b2622cac029529f49a917f2c | [] | no_license | yokosogithub/AccountManager | 35d126fa98b09ba02d6972c3f5f2875fe679466d | e664e8ac45f4cae60941aba6d2eb1af4dcca315e | refs/heads/master | 2021-01-01T17:00:53.222040 | 2013-08-17T08:50:22 | 2013-08-17T08:50:22 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,617 | java | import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class SetAccountDialog extends JDialog{
protected JTextField IDText1;
protected JTextField IDText2;
protected JTextArea Intro;
protected String code;
protected JButton okButton;
protected FunctionFrame frame;
protected Container container;
protected DataBaseOperate con;
public SetAccountDialog(FunctionFrame parentframe,DataBaseOperate m)
{
super(parentframe,"增加一个账号",true);
this.con=m;
Dimension screensize=Toolkit.getDefaultToolkit().getScreenSize();
this.setSize(335,325);
Dimension framesize=this.getSize();
int x=(int)screensize.getWidth()/2-(int)framesize.getWidth()/2;
int y=(int)screensize.getHeight()/2-(int)framesize.getHeight()/2;
this.setLocation(x,y);
container=this.getContentPane();
container.setLayout(null);
JLabel picLabel=new JLabel();
ImageIcon loginIcon=new ImageIcon("addAccount.jpg");
picLabel.setIcon(loginIcon);
picLabel.setBounds(0, 0, 320, 300);
IDText1=new JTextField(50);
IDText1.setBounds(125, 110, 120, 25);
picLabel.add(IDText1);
IDText2=new JTextField(50);
IDText2.setBounds(125, 145, 120,25);
picLabel.add(IDText2);
Intro=new JTextArea(3,40);
Intro.setBounds(125, 180, 130, 40);
picLabel.add(Intro);
JButton okButton=new JButton("确定");
okButton.addActionListener(new AddAccountListener());
okButton.setBounds(130, 240, 80, 25);
okButton.setBackground(Color.orange);
okButton.setForeground(Color.BLACK);
picLabel.add(okButton);
container.add(picLabel);
}
class AddAccountListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(IDText1.getText().equals(""))
{
inputusernull();
}
else if(IDText1.getText().length()>50)
{
lengthtoolong();
}
else if(Intro.getText().length()>255)
{
lengthtoolong();
}
else
{
if(IDText1.getText().equals(IDText2.getText()))
{
if(!con.SearchAccountInDB(IDText1.getText()))
{
boolean rs;
rs=con.addAccountListinfo(IDText1.getText(),Intro.getText());
if(rs==true)
{
setVisible(false);
Okmsg();
}
}
else
{
searchErr();
}
}
else
{
setErr();
}
}
}
}
public void Okmsg()
{
String msg="账号添加成功";
String title="提示";
JOptionPane.showMessageDialog(container, msg,title,JOptionPane.INFORMATION_MESSAGE);
}
public void setErr()
{
String msg="两次账号输入的不一样,请重新输入";
String title="提示";
JOptionPane.showMessageDialog(container, msg,title,JOptionPane.WARNING_MESSAGE);
}
public void searchErr()
{
String msg="你输入的账号已经存在,请重新输入";
String title="提示";
JOptionPane.showMessageDialog(container, msg,title,JOptionPane.WARNING_MESSAGE);
}
public void inputusernull()
{
String msg="账号不能为空";
String title="错误提示";
JOptionPane.showMessageDialog(container, msg,title,JOptionPane.WARNING_MESSAGE);
}
public void lengthtoolong()
{
String msg="输入长度过长,请重新输入";
String title="错误提示";
JOptionPane.showMessageDialog(container, msg,title,JOptionPane.WARNING_MESSAGE);
}
}
| [
"[email protected]"
] | |
65e4df7a54d0dcfa4497986d01c3c63a981fffcb | 72cee097005539f1860cd2381d12108236741a03 | /eagle-security/eagle-security-hdfs-auditlog/src/main/java/org/apache/eagle/security/auditlog/HdfsUserCommandPatternByFileImpl.java | bb3229c7dc68a101e9e300adc3f23015b916928e | [
"Apache-2.0",
"MIT",
"BSD-2-Clause"
] | permissive | phenixmzy/apache-eagle-0.5.0 | f43247ff9c2aea85d2c066794ef5bb00a093f839 | 0598e55d027083838c013b9a7171c0d72a7072a1 | refs/heads/master | 2022-11-22T18:28:13.891207 | 2019-08-19T03:02:25 | 2019-08-19T03:02:25 | 182,820,976 | 0 | 1 | Apache-2.0 | 2022-11-15T02:57:01 | 2019-04-22T15:58:42 | Java | UTF-8 | Java | false | false | 1,975 | 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.eagle.security.auditlog;
import org.apache.eagle.security.entity.HdfsUserCommandPatternEntity;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.type.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.InputStream;
import java.util.List;
/**
* get HdfsUserCommandPattern from eagle database
*/
public class HdfsUserCommandPatternByFileImpl implements HdfsUserCommandPatternDAO {
private final Logger LOG = LoggerFactory.getLogger(HdfsUserCommandPatternByFileImpl.class);
@Override
public List<HdfsUserCommandPatternEntity> findAllPatterns() throws Exception{
ObjectMapper mapper = new ObjectMapper();
InputStream is = this.getClass().getResourceAsStream("/hdfsUserCommandPattern.json");
try{
Object o = mapper.readValue(is, new TypeReference<List<HdfsUserCommandPatternEntity>>(){});
return (List<HdfsUserCommandPatternEntity>)o;
}catch(Exception ex){
LOG.error("can't read hdfsUserCommandPattern.json", ex);
throw ex;
}
}
}
| [
"[email protected]"
] | |
d5cb8856263ab148c48b090a5a34ebcfe2caa8db | c4e58778f94d31497b5579a5c1a2936786c4bb80 | /app/src/main/java/com/ichwan/memoapp/LoginActivity.java | de20725505c56a9f9aa1c4f823f44731a8564a0c | [] | no_license | iChwn/AndroidStudioMemoApp | c3354aa01f344bc24a904f3a71061fb9c21ce302 | 57ccb7bcd878b354208e731b81b6dab623c65bd1 | refs/heads/master | 2023-07-06T02:46:51.567009 | 2021-08-02T07:10:38 | 2021-08-02T07:10:38 | 391,827,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,561 | java | package com.ichwan.memoapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
public class LoginActivity extends AppCompatActivity {
DatabaseHelper db;
Button login, register;
EditText username, password;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
db = new DatabaseHelper(this);
username = (EditText)findViewById(R.id.input_username);
password = (EditText)findViewById(R.id.input_password);
login = (Button)findViewById(R.id.login_btn);
// register text on click
TextView textRegis = (TextView)findViewById(R.id.register_text);
textRegis.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent registerIntent = new Intent(LoginActivity.this, RegisterActivity.class);
startActivity(registerIntent);
finish();
}
});
//login btn on click
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String strUsername = username.getText().toString();
String strPassword= password.getText().toString();
if(strUsername.isEmpty() || strPassword.isEmpty()) {
Toast.makeText(getApplicationContext(), "Semua Field Harus di isi", Toast.LENGTH_SHORT).show();
} else {
Boolean masuk = db.checkLogin(strUsername, strPassword);
if(masuk == true) {
Boolean updateSession = db.upgradeSession("ada", 1);
if (updateSession == true) {
Toast.makeText(getApplicationContext(), "Berhasil Masuk", Toast.LENGTH_SHORT).show();
Intent mainIntent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(mainIntent);
finish();
}
} else {
Toast.makeText(getApplicationContext(), "Email atau Password anda Salah!", Toast.LENGTH_SHORT).show();
}
}
}
});
}
}
| [
"[email protected]"
] | |
35ecfb112a5f632faca0208f08bc1b5d0f25feea | c5fb179b656580ca3e68a94d1dec99fd425f547f | /src/main/java/cn/zero/demo/entity/Simple.java | c66a1ea5d9537594cee6143fb354ba692ae53247 | [] | no_license | zeropsycho/zero | 8d53d0a70ed239303116bce9acd19795a73f737f | bb89de232f0ce413f26db7dff692249d506ea044 | refs/heads/master | 2020-04-01T10:27:52.814187 | 2018-10-16T01:29:05 | 2018-10-16T01:29:05 | 153,118,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 677 | java | package cn.zero.demo.entity;
/**
* @author ZERO
* @version V1.4
* @description
* @package cn.zero.demo.entity
* @date 2018 10-15 下午 2:13
*/
public class Simple {
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Simple() {
}
@Override
public String toString() {
return "Simple{" +
"id=" + id +
", name='" + name + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
b8b8be638e8a1e713ee86e8ab85a572892a63f96 | 6d0e58e600465bf17cc0270a67f59fd23fc357f9 | /currency-exchange-service/src/main/java/com/currency/currencyexchangeservice/repository/ExchangeServiceRepository.java | 576222831fb68a6f3302cbe0c9c81ca918b7e99d | [] | no_license | shivang-bansal/Microservice-with-spring-boot | 1dea238fece2bba506b405a1b4b740223d81a9c7 | 3f735ac2e97a4702c9ca7dbe5cc588008747b526 | refs/heads/main | 2023-06-12T10:27:25.799892 | 2021-07-09T12:32:56 | 2021-07-09T12:32:56 | 380,699,680 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package com.currency.currencyexchangeservice.repository;
import com.currency.currencyexchangeservice.entity.CurrencyExchangeRate;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ExchangeServiceRepository extends JpaRepository<CurrencyExchangeRate,Integer> {
CurrencyExchangeRate findByFromAndTo(String from, String to);
}
| [
"[email protected]"
] | |
a7d86005ab52f4ffd1df91d647578623ab15045f | 9b6827f13e5b5aec7c36b969411f4badf61bdd93 | /src/unal/od/np/FilterFrame.java | 1e9f706405b725c578f65211d3baeca9a91f3fac | [] | no_license | unal-optodigital/NumericalPropagation | dd61a46dab4e116e265f8ad1ac0f984782a31289 | 3ec9e1e6efc8102f2cdfe031269318f8cec8aad3 | refs/heads/master | 2022-01-21T23:25:16.030071 | 2022-01-10T20:43:23 | 2022-01-10T20:43:23 | 34,027,831 | 4 | 4 | null | null | null | null | UTF-8 | Java | false | false | 24,871 | java | /*
* Copyright 2015 Universidad Nacional de Colombia
*
* 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 unal.od.np;
import ij.IJ;
import ij.ImageListener;
import ij.ImagePlus;
import ij.measure.Calibration;
import ij.process.FloatProcessor;
import ij.process.ImageProcessor;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.util.prefs.Preferences;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import unal.od.jdiffraction.cpu.utils.ArrayUtils;
/**
*
* @author Raul Castañeda ([email protected])
* @author Pablo Piedrahita-Quintero ([email protected])
* @author Jorge Garcia-Sucerquia ([email protected])
*/
public class FilterFrame extends javax.swing.JFrame implements ImageListener, PreferencesKeys {
private static final String TITLE = "Filter";
// <editor-fold defaultstate="collapsed" desc="Prefs variables">
private boolean phaseEnabled;
private boolean amplitudeEnabled;
private boolean intensityEnabled;
private boolean realEnabled;
private boolean imaginaryEnabled;
private String xString;
private String yString;
private String wString;
private String hString;
private boolean manual;
private boolean showFreqDialog;
private boolean isPlane;
private float curvRadius;
private boolean fftLogSelected;
private boolean amplitudeLogSelected;
private boolean intensityLogSelected;
private boolean fftByteSelected;
private boolean phaseByteSelected;
private boolean amplitudeByteSelected;
private boolean intensityByteSelected;
// private boolean realByteSelected;
// private boolean imaginaryByteSelected;
// </editor-fold>
private final Preferences pref;
private final Data data;
private final ImageProcessor ip;
private final ImagePlus imp;
private final int idx;
private final int fftID;
private final MainFrame parent;
/**
* Creates new form FilterFrame1
*
* @param parent
* @param idx
*/
public FilterFrame(MainFrame parent, int idx) {
pref = Preferences.userNodeForPackage(getClass());
data = Data.getInstance();
this.idx = idx;
this.parent = parent;
loadPrefs();
data.calculateFFT();
ip = new FloatProcessor(data.getImageSpectrum());
if (fftLogSelected) {
ip.log();
}
imp = new ImagePlus("FFT", fftByteSelected ? ip.convertToByteProcessor() : ip);
imp.show();
fftID = imp.getID();
ImagePlus.addImageListener(this);
setLocationRelativeTo(parent);
initComponents();
setVisible(true);
if (showFreqDialog) {
JCheckBox showChk = new JCheckBox("Do not show this message again.", false);
String msg = "Please select the area of interest on the FFT's spectrum of the input hologram.";
Object[] msgContent = {msg, showChk};
JOptionPane.showMessageDialog(this, msgContent, "Information",
JOptionPane.INFORMATION_MESSAGE);
showFreqDialog = !showChk.isSelected();
}
IJ.setTool(3);
}
private void enableFields(boolean enabled) {
xField.setEnabled(enabled);
yField.setEnabled(enabled);
wField.setEnabled(enabled);
hField.setEnabled(enabled);
}
private void savePrefs() {
pref.put(ROI_X, xField.getText());
pref.put(ROI_Y, yField.getText());
pref.put(ROI_WIDTH, wField.getText());
pref.put(ROI_HEIGHT, hField.getText());
pref.putBoolean(IS_MANUAL, manualRadio.isSelected());
pref.putBoolean(SHOW_FREQUENCIES_DIALOG, showFreqDialog);
}
private void loadPrefs() {
phaseEnabled = pref.getBoolean(PHASE_CHECKED, false);
amplitudeEnabled = pref.getBoolean(AMPLITUDE_CHECKED, false);
intensityEnabled = pref.getBoolean(INTENSITY_CHECKED, false);
realEnabled = pref.getBoolean(REAL_CHECKED, false);
imaginaryEnabled = pref.getBoolean(IMAGINARY_CHECKED, false);
xString = pref.get(ROI_X, "");
yString = pref.get(ROI_Y, "");
wString = pref.get(ROI_WIDTH, "");
hString = pref.get(ROI_HEIGHT, "");
manual = pref.getBoolean(IS_MANUAL, true);
showFreqDialog = pref.getBoolean(SHOW_FREQUENCIES_DIALOG, true);
isPlane = pref.getBoolean(IS_PLANE, true);
curvRadius = pref.getFloat(CURV_RADIUS, 1E6f);
fftLogSelected = pref.getBoolean(FFT_LOG, true);
amplitudeLogSelected = pref.getBoolean(AMPLITUDE_LOG, true);
intensityLogSelected = pref.getBoolean(INTENSITY_LOG, true);
fftByteSelected = pref.getBoolean(FFT_8_BIT, true);
phaseByteSelected = pref.getBoolean(PHASE_8_BIT, true);
amplitudeByteSelected = pref.getBoolean(AMPLITUDE_8_BIT, true);
intensityByteSelected = pref.getBoolean(INTENSITY_8_BIT, true);
// realByteSelected = pref.getBoolean(REAL_8_BIT, true);
// imaginaryByteSelected = pref.getBoolean(IMAGINARY_8_BIT, true);
}
public void close(boolean showDialog) {
ImagePlus.removeImageListener(this);
imp.hide();
setVisible(false);
if (showDialog) {
JOptionPane.showMessageDialog(this, "Input field must be filtered.",
"Error", JOptionPane.ERROR_MESSAGE);
}
dispose();
}
@Override
public void imageClosed(ImagePlus imp) {
if (imp.getID() == fftID) {
close(true);
}
}
@Override
public void imageOpened(ImagePlus imp) {
}
@Override
public void imageUpdated(ImagePlus imp) {
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
group = new javax.swing.ButtonGroup();
coordinatesPanel = new javax.swing.JPanel();
xLabel = new javax.swing.JLabel();
xField = new javax.swing.JTextField();
yLabel = new javax.swing.JLabel();
yField = new javax.swing.JTextField();
hLabel = new javax.swing.JLabel();
hField = new javax.swing.JTextField();
wField = new javax.swing.JTextField();
wLabel = new javax.swing.JLabel();
radioPanel = new javax.swing.JPanel();
manualRadio = new javax.swing.JRadioButton();
coordRadio = new javax.swing.JRadioButton();
btnsPanel = new javax.swing.JPanel();
okBtn = new javax.swing.JButton();
cancelBtn = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle(TITLE);
setAlwaysOnTop(true);
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icon.png")));
setMaximumSize(new java.awt.Dimension(179, 164));
setMinimumSize(new java.awt.Dimension(179, 164));
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
coordinatesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Coordinates"));
xLabel.setText("X:");
xField.setColumns(4);
xField.setText(xString);
xField.setEnabled(!manual);
yLabel.setText("Y:");
yField.setColumns(4);
yField.setText(yString);
yField.setEnabled(!manual);
hLabel.setText("Height");
hField.setColumns(4);
hField.setText(hString);
hField.setEnabled(!manual);
wField.setColumns(4);
wField.setText(wString);
wField.setEnabled(!manual);
wLabel.setText("Width:");
javax.swing.GroupLayout coordinatesPanelLayout = new javax.swing.GroupLayout(coordinatesPanel);
coordinatesPanel.setLayout(coordinatesPanelLayout);
coordinatesPanelLayout.setHorizontalGroup(
coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(coordinatesPanelLayout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(coordinatesPanelLayout.createSequentialGroup()
.addComponent(yLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(yField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(hLabel))
.addGroup(coordinatesPanelLayout.createSequentialGroup()
.addComponent(xLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(xField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(wLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(wField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(hField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5))
);
coordinatesPanelLayout.setVerticalGroup(
coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(coordinatesPanelLayout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(xLabel)
.addComponent(xField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(wField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(wLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(coordinatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(yLabel)
.addComponent(yField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(hLabel)
.addComponent(hField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5))
);
group.add(manualRadio);
manualRadio.setSelected(manual);
manualRadio.setText("Manual");
manualRadio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
manualRadioActionPerformed(evt);
}
});
group.add(coordRadio);
coordRadio.setSelected(!manual);
coordRadio.setText("Coordinates");
coordRadio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
coordRadioActionPerformed(evt);
}
});
javax.swing.GroupLayout radioPanelLayout = new javax.swing.GroupLayout(radioPanel);
radioPanel.setLayout(radioPanelLayout);
radioPanelLayout.setHorizontalGroup(
radioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(radioPanelLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(manualRadio)
.addGap(18, 18, 18)
.addComponent(coordRadio)
.addGap(0, 0, Short.MAX_VALUE))
);
radioPanelLayout.setVerticalGroup(
radioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(radioPanelLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(radioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(manualRadio)
.addComponent(coordRadio))
.addGap(0, 0, 0))
);
okBtn.setText("Ok");
okBtn.setPreferredSize(new java.awt.Dimension(65, 23));
okBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
okBtnActionPerformed(evt);
}
});
cancelBtn.setText("Cancel");
cancelBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout btnsPanelLayout = new javax.swing.GroupLayout(btnsPanel);
btnsPanel.setLayout(btnsPanelLayout);
btnsPanelLayout.setHorizontalGroup(
btnsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btnsPanelLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(okBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(cancelBtn)
.addGap(0, 0, 0))
);
btnsPanelLayout.setVerticalGroup(
btnsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btnsPanelLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(btnsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(okBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cancelBtn))
.addGap(0, 0, 0))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(btnsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(coordinatesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.CENTER, layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(radioPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(5, 5, 5))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(radioPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(coordinatesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void manualRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manualRadioActionPerformed
enableFields(!manualRadio.isSelected());
}//GEN-LAST:event_manualRadioActionPerformed
private void coordRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_coordRadioActionPerformed
enableFields(coordRadio.isSelected());
}//GEN-LAST:event_coordRadioActionPerformed
private void okBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBtnActionPerformed
if (manualRadio.isSelected()) {
ImageProcessor ipRoi = imp.getProcessor();
Rectangle roi = ipRoi.getRoi();
ImageProcessor ipMask = imp.getMask();
ImagePlus.removeImageListener(this);
imp.hide();
data.setROI(roi.x, roi.y, roi.width, roi.height, (ipMask != null) ? ipMask.getIntArray() : null);
data.center();
} else if (coordRadio.isSelected()) {
ImagePlus.removeImageListener(this);
imp.hide();
int x, y, w, h;
try {
x = Integer.parseInt(xField.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please insert a valid x value.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
try {
y = Integer.parseInt(yField.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please insert a valid y value.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
try {
w = Integer.parseInt(wField.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please insert a valid width value.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
try {
h = Integer.parseInt(hField.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please insert a valid height value.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
data.setROI(x, y, w, h, null);
data.center();
}
data.propagate(idx, true, isPlane, curvRadius);
String[] parameters = parent.getFormattedParameters(true);
StringBuilder info = new StringBuilder();
info.append("\nMethod: " + MainFrame.PROPAGATION_METHOD[idx]
+ "\nReal input: " + parameters[0]
+ "\nImaginary input: " + parameters[1]
+ "\nWavelength: " + parameters[2]
+ "\nDistance: " + parameters[3]
+ "\nInput Width: " + parameters[4]
+ "\nInput Height: " + parameters[5]);
if (idx == 2) {
info.append("\nOutput Width: " + parameters[6]
+ "\nOutput Height: " + parameters[7]);
}
parent.updateLog(true, info.toString());
float[][] field = data.getOutputField();
parent.setStepDistance();
parent.enableAfterPropagationOpt(true);
parent.setImageProps();
Calibration cal = parent.getCalibration();
String names = "; Re: " + parameters[0] + "; Im: " + parameters[1];
float[][] amplitude = null;
float max = Float.MIN_VALUE;
if (realEnabled || imaginaryEnabled) {
amplitude = ArrayUtils.modulus(field);
max = ArrayUtils.max(amplitude);
}
if (phaseEnabled) {
ImageProcessor ip1 = new FloatProcessor(ArrayUtils.phase(field));
ImagePlus imp1 = new ImagePlus("Phase; z = " + parameters[3] + names,
phaseByteSelected ? ip1.convertToByteProcessor() : ip1);
imp1.setCalibration(cal);
imp1.show();
}
if (amplitudeEnabled) {
ImageProcessor ip2 = new FloatProcessor(realEnabled || imaginaryEnabled ? amplitude : ArrayUtils.modulus(field));
if (amplitudeLogSelected) {
ip2.log();
}
ImagePlus imp2 = new ImagePlus("Amplitude; z = " + parameters[3] + names,
amplitudeByteSelected ? ip2.convertToByteProcessor() : ip2);
imp2.setCalibration(cal);
imp2.show();
}
if (intensityEnabled) {
ImageProcessor ip3 = new FloatProcessor(ArrayUtils.modulusSq(field));
if (intensityLogSelected) {
ip3.log();
}
ImagePlus imp3 = new ImagePlus("Intensity; z = " + parameters[3] + names,
intensityByteSelected ? ip3.convertToByteProcessor() : ip3);
imp3.setCalibration(cal);
imp3.show();
}
if (realEnabled) {
float[][] real = ArrayUtils.real(field);
ArrayUtils.divide(real, max);
ImageProcessor ip4 = new FloatProcessor(real);
ImagePlus imp4 = new ImagePlus("Real; z = " + parameters[3] + names, ip4);
imp4.setCalibration(cal);
imp4.show();
}
if (imaginaryEnabled) {
float[][] imaginary = ArrayUtils.imaginary(field);
ArrayUtils.divide(imaginary, max);
ImageProcessor ip5 = new FloatProcessor(imaginary);
ImagePlus imp5 = new ImagePlus("Imaginary; z = " + parameters[3] + names, ip5);
imp5.setCalibration(cal);
imp5.show();
}
savePrefs();
setVisible(false);
dispose();
}//GEN-LAST:event_okBtnActionPerformed
private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBtnActionPerformed
close(true);
}//GEN-LAST:event_cancelBtnActionPerformed
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
close(true);
}//GEN-LAST:event_formWindowClosing
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel btnsPanel;
private javax.swing.JButton cancelBtn;
private javax.swing.JRadioButton coordRadio;
private javax.swing.JPanel coordinatesPanel;
private javax.swing.ButtonGroup group;
private javax.swing.JTextField hField;
private javax.swing.JLabel hLabel;
private javax.swing.JRadioButton manualRadio;
private javax.swing.JButton okBtn;
private javax.swing.JPanel radioPanel;
private javax.swing.JTextField wField;
private javax.swing.JLabel wLabel;
private javax.swing.JTextField xField;
private javax.swing.JLabel xLabel;
private javax.swing.JTextField yField;
private javax.swing.JLabel yLabel;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
601715ef3091d81c531dbef3eb20e61c8fa29518 | f89ed3d1f82f0e188afad85121ba0ffec08e52c1 | /src/main/java/domain/Task.java | 97615327018234044fc5332aa316eeea2c49a798 | [] | no_license | henricharles/week2_extra_credit | 45f4800d503f38ea8851d9cbd8571004ad3ed274 | dd6d90410494954197e7382769c556b8868a66f9 | refs/heads/master | 2020-07-23T13:28:33.501308 | 2016-11-15T13:51:50 | 2016-11-15T13:51:50 | 73,807,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,215 | java | package domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
@Entity
public class Task {
@Id
@GeneratedValue
private int Task_Id;
public Task(){
}
@Temporal(TemporalType.DATE)
private Date start;
public Date getStart() {
return start;
}
public void setStart(Date start) {
this.start = start;
}
public Date getEnd() {
return end;
}
public void setEnd(Date end) {
this.end = end;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
public List<Skill> getSkils() {
return skils;
}
public void setSkils(List<Skill> skils) {
this.skils = skils;
}
@Temporal(TemporalType.DATE)
private Date end;
@Enumerated(EnumType.STRING)
private Status status;
@ManyToOne
@JoinColumn(name="Project_Id")
Project project;
@OneToMany(mappedBy="task")
List<Skill>skils=new ArrayList<Skill>();
@OneToMany(mappedBy="task")
List<Volenteer>volenteers=new ArrayList<Volenteer>();
void addVolenteer(Volenteer v){
volenteers.add(v);
}
}
| [
"[email protected]"
] | |
336198070df076958592057eb163d97068730f19 | 124e5857d30314a9391d5d934527326bd3b5a760 | /server-side/src/main/java/com/cth/codetroopers/pixelwars/serverside/GameUtils/Exceptions/NoItemException.java | 809d6cc511eee93b22bda4603b315e45003d24fd | [] | no_license | fantomsol/codetroopers | aa1f8901d15eb09cff7b983a00ec30db50ff051a | 153476c8c17bf0bc85c65316046e233350b9dcc6 | refs/heads/master | 2022-12-30T12:36:44.176098 | 2019-11-04T15:48:36 | 2019-11-04T16:02:00 | 85,565,095 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package com.cth.codetroopers.pixelwars.serverside.GameUtils.Exceptions;
/**
* Created by latiif on 5/19/17.
*/
public class NoItemException extends GameException {
public NoItemException(String message) {
super("Item not found", message);
}
}
| [
"[email protected]"
] | |
95907a430a17421542695b4c7295e434b263b95a | 91deafe328e2e97737a2342a768c9a7839688be0 | /src/main/java/org/async/json/jpath/points/WildCardPoint.java | 121709c4e49e0d70d10203e2df104412f4a4c1b1 | [] | no_license | alun/async-json-library | cb46f2901578c70a499115edf19e36e956067983 | 2a8d11a7a82a9178197c8a1c51f5314a1b9a8b2f | refs/heads/master | 2020-07-26T22:29:33.847305 | 2010-06-18T05:42:11 | 2010-06-18T05:42:11 | 707,461 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package org.async.json.jpath.points;
import org.async.json.jpath.Iterable;
import org.async.json.jpath.JPathPoint;
public class WildCardPoint extends JPathPoint {
public WildCardPoint() {
super();
}
@SuppressWarnings("unchecked")
@Override
public boolean matches(Iterable<Object, Object> current,
Iterable<Object, Object> root) {
return true;
}
}
| [
"[email protected]"
] | |
11b04aa2764bb8af07e3a847893e0a69254295ef | 3ad70c35f3866d2bc38797c20a7dcd1043dd3ca4 | /src/test/java/services/PreprocessFileStepDefs.java | 5bcc0072a3adf10c77cc033447f279ee1c4bf745 | [
"Apache-2.0"
] | permissive | zach-cloud/JSyntaxTree | c7362494b334929b7fcaa1c422eecec15ea59084 | 707942a6c9ad62eaec47281c15be35cf9498d8b5 | refs/heads/master | 2023-07-25T23:39:07.001941 | 2021-09-03T22:10:01 | 2021-09-03T22:10:01 | 271,916,095 | 1 | 0 | Apache-2.0 | 2021-09-03T22:10:02 | 2020-06-13T00:54:12 | Java | UTF-8 | Java | false | false | 582 | java | package services;
import generic.TestContext;
import io.cucumber.java.en.Then;
import org.junit.Assert;
public class PreprocessFileStepDefs {
@Then("Preprocessed data should be:")
public void preprocessed_data_should_be(String body) {
StringBuilder assembledData = new StringBuilder();
while(TestContext.inputScanner.hasNextLine()) {
assembledData.append(TestContext.inputScanner.nextLine()).append("\n");
}
assembledData.setLength(assembledData.length()-1);
Assert.assertEquals(body, assembledData.toString());
}
}
| [
"Immohax123gogo"
] | Immohax123gogo |
0bcd030d3ce7e78fc7cf87c228c875fa8943bd0b | 4e6d8e4d867489480c3ddd5b6631a448e5f13a87 | /src/tests/org/xins/tests/common/types/standard/Base64Tests.java | 1e1af495c4542cd9583a152e594114abbab0f88d | [
"BSD-2-Clause"
] | permissive | touchrank-dev/xins | fe988d6f965a6ecf6109b064b2579dd65e0bc961 | f8a3a97fc30d98ee05f4d26337d20f3fcf31f494 | refs/heads/master | 2022-11-08T04:29:19.522256 | 2020-07-01T07:50:06 | 2020-07-01T07:50:06 | 286,267,745 | 1 | 0 | NOASSERTION | 2020-08-09T15:50:39 | 2020-08-09T15:50:38 | null | UTF-8 | Java | false | false | 3,873 | java | package org.xins.tests.common.types.standard;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.xins.common.types.TypeValueException;
import org.xins.common.types.standard.Base64;
/**
* Tests for class <code>Base64</code>.
*
* @version $Revision: 1.11 $ $Date: 2007/09/18 11:20:31 $
* @author <a href="mailto:[email protected]">Anthony Goubard</a>
*/
public class Base64Tests extends TestCase {
ShortBinary lowerLimit = new ShortBinary();
/**
* Constructs a new <code>Base64Tests</code> test suite with
* the specified name. The name will be passed to the superconstructor.
*
* @param name
* the name for this test suite.
*/
public Base64Tests(String name) {
super(name);
}
/**
* Returns a test suite with all test cases defined by this class.
*
* @return
* the test suite, never <code>null</code>.
*/
public static Test suite() {
return new TestSuite(Base64Tests.class);
}
public void testToString() throws Throwable {
byte[] hello = { 'h', 'e', 'l', 'l', 'o' };
assertEquals("aGVsbG8=", lowerLimit.toString(hello));
assertEquals("aGVsbG8=", lowerLimit.toString((Object)hello));
assertNull("lowerLimit.toString(null) should return null", lowerLimit.toString(null));
}
public void testFromString() throws Throwable {
byte[] hello = (byte[])lowerLimit.fromString("aGVsbG8=");
assertEquals(5, hello.length);
assertEquals('o', hello[4]);
try {
byte[] hello2 = (byte[])lowerLimit.fromString("h\u00e9llo");
fail("Converted an invalid base64 String.");
} catch (TypeValueException tve) {
// As expected
}
}
public void testFromStringForRequired() throws Throwable {
try {
lowerLimit.fromStringForRequired(null);
fail("fromStringForRequired(null) should have thrown a String is null error");
} catch (IllegalArgumentException iae) {
// this is good
}
try {
byte[] hello = lowerLimit.fromStringForRequired("aGVsbG8=");
assertEquals(5, hello.length);
assertEquals('o', hello[4]);
} catch (Exception e) {
fail("lowerLimit.fromStringForRequired(\"aGVsbG8=\") caught an unexpected error.");
}
}
public void testFromStringForOptional() throws Throwable {
try {
String fred = new String(lowerLimit.fromStringForOptional("f\t.,red"));
fail("lowerLimit.fromStringForOptional(\"f\\t.,red\") should have thrown a TypeValueException but returned \"" + fred + "\".");
} catch (TypeValueException tve2) {
// this is good
}
try {
byte[] hello = lowerLimit.fromStringForOptional("aGVsbG8=");
assertEquals(5, hello.length);
assertEquals('o', hello[4]);
} catch (Exception e1) {
fail("lowerLimit.fromStringForOptional(\"aGVsbG8=\") caught an unexpected error.");
}
assertNull("lowerLimit.fromStringForOptional(null) should return a null.", lowerLimit.fromStringForOptional(null));
}
public void testValidValue() throws Throwable {
assertFalse("f\\t.,red is not a valid value.",lowerLimit.isValidValue("f\t.,red"));
assertFalse("aGVsbG8gc2ly is outside the bounds of the instance.",lowerLimit.isValidValue("aGVsbG8gc2ly"));
assertTrue("aGVsbG8= is a valid value as it is within the bounds.",lowerLimit.isValidValue("aGVsbG8="));
assertTrue("null is considered to be a valid object",lowerLimit.isValidValue(null));
}
class ShortBinary extends Base64 {
// constructor
public ShortBinary() {
super("ShortBinary", 0, 6);
}
}
}
| [
"[email protected]"
] | |
ac576d2a4a0f9c6b51da17ee1cff6a4931a121a8 | b9b371822d004d2c0bacee766a17f291a35da2db | /src/main/java/com/geely/design/pattern/creational/abstractfactory/Video.java | 725486041de1ceaf36717d459fb5063f2c06888b | [] | no_license | YRAbner/design | a1ab44f59a2d252b89f63f8db683ac5e88a7bfea | 306c175e304680be5d3b4159f0572abb214ebad7 | refs/heads/main | 2023-05-15T09:15:23.164970 | 2021-06-08T05:38:38 | 2021-06-08T05:38:38 | 373,151,421 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package com.geely.design.pattern.creational.abstractfactory;
public abstract class Video {
public abstract void produce();
}
| [
"[email protected]"
] | |
1050510a2f5444020a16e77241f98b72f6e2fddc | 1290740340dd811de7d54374154bec60bec598e8 | /app/src/main/java/com/geoodk/collect/android/activities/SplashScreenActivity.java | e86e50942506fc99e0f5d8cbf9321e3b11095876 | [] | no_license | saeed4u/GeoCollect | 29a7ad5187ecf39680b5623cfa199ac7f70bce2b | 75d84595b2ad01517e66bb991f527032d0b85c12 | refs/heads/master | 2021-01-09T05:41:14.830484 | 2017-02-03T11:30:02 | 2017-02-03T11:30:02 | 80,811,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,191 | java | /*
* Copyright (C) 2011 University of Washington
*
* 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.geoodk.collect.android.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Window;
import com.geoodk.collect.android.R;
import com.geoodk.collect.android.application.Collect;
import com.geoodk.collect.android.preferences.MapSettings;
import com.geoodk.collect.android.preferences.PreferencesActivity;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class SplashScreenActivity extends Activity {
private static final int mSplashTimeout = 1000; // milliseconds
private static final boolean EXIT = true;
private int mImageMaxWidth;
private AlertDialog mAlertDialog;
private String theme;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// must be at the beginning of any activity that can be called from an external intent
try {
Collect.createODKDirs();
} catch (RuntimeException e) {
createErrorDialog(e.getMessage(), EXIT);
return;
}
mImageMaxWidth = getWindowManager().getDefaultDisplay().getWidth();
// this splash screen should be a blank slate
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.splash_screen);
// get the shared preferences object
SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
theme = mSharedPreferences.getString(MapSettings.KEY_geoodk_theme, "map");
Editor editor = mSharedPreferences.edit();
// get the package info object with version number
PackageInfo packageInfo = null;
try {
packageInfo =
getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_META_DATA);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
boolean firstRun = mSharedPreferences.getBoolean(PreferencesActivity.KEY_FIRST_RUN, true);
boolean showSplash =
mSharedPreferences.getBoolean(PreferencesActivity.KEY_SHOW_SPLASH, false);
String splashPath =
mSharedPreferences.getString(PreferencesActivity.KEY_SPLASH_PATH,
getString(R.string.default_splash_path));
// if you've increased version code, then update the version number and set firstRun to true
if (mSharedPreferences.getLong(PreferencesActivity.KEY_LAST_VERSION, 0) < packageInfo.versionCode) {
editor.putLong(PreferencesActivity.KEY_LAST_VERSION, packageInfo.versionCode);
editor.commit();
firstRun = true;
}
// do all the first run things
if (firstRun || showSplash) {
editor.putBoolean(PreferencesActivity.KEY_FIRST_RUN, false);
editor.commit();
startSplashScreen(splashPath);
} else {
//startSplashScreen(splashPath);
endSplashScreen();
}
}
private void endSplashScreen() {
// launch new activity and close splash screen
// startActivity(new Intent(SplashScreenActivity.this, OSM_Map.class));
//Used when testing specific activity :)
// startActivity(new Intent(SplashScreenActivity.this, GeoODKClassicActivity.class));
if (theme.equals("map")){
startActivity(new Intent(SplashScreenActivity.this, GeoODKMapThemeActivity.class));
}else{
startActivity(new Intent(SplashScreenActivity.this, GeoODKClassicActivity.class));
}
//startActivity(new Intent(SplashScreenActivity.this, GeoODKMapThemeActivity.class));
//startActivity(new Intent(SplashScreenActivity.this, GeoTraceActivity.class));
//startActivity(new Intent(SplashScreenActivity.this, MainMenuActivity.class));
finish();
}
// decodes image and scales it to reduce memory consumption
private Bitmap decodeFile(File f) {
Bitmap b = null;
try {
// Decode image size
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
FileInputStream fis = new FileInputStream(f);
BitmapFactory.decodeStream(fis, null, o);
try {
fis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int scale = 1;
if (o.outHeight > mImageMaxWidth || o.outWidth > mImageMaxWidth) {
scale =
(int) Math.pow(
2,
(int) Math.round(Math.log(mImageMaxWidth
/ (double) Math.max(o.outHeight, o.outWidth))
/ Math.log(0.5)));
}
// Decode with inSampleSize
BitmapFactory.Options o2 = new BitmapFactory.Options();
o2.inSampleSize = scale;
fis = new FileInputStream(f);
b = BitmapFactory.decodeStream(fis, null, o2);
try {
fis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (FileNotFoundException e) {
}
return b;
}
private void startSplashScreen(String path) {
// // add items to the splash screen here. makes things less distracting.
// ImageView iv = (ImageView) findViewById(R.id.splash);
// LinearLayout ll = (LinearLayout) findViewById(R.id.splash_default);
//
// File f = new File(path);
// if (f.exists()) {
// iv.setImageBitmap(decodeFile(f));
// ll.setVisibility(View.GONE);
// iv.setVisibility(View.VISIBLE);
// }
// create a thread that counts up to the timeout
Thread t = new Thread() {
int count = 0;
@Override
public void run() {
try {
super.run();
while (count < mSplashTimeout) {
if (count > (mSplashTimeout - 300)){
}
sleep(100);
count += 100;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
endSplashScreen();
}
}
};
t.start();
}
private void createErrorDialog(String errorMsg, final boolean shouldExit) {
Collect.getInstance().getActivityLogger().logAction(this, "createErrorDialog", "show");
mAlertDialog = new AlertDialog.Builder(this).create();
mAlertDialog.setIcon(android.R.drawable.ic_dialog_info);
mAlertDialog.setMessage(errorMsg);
DialogInterface.OnClickListener errorListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
switch (i) {
case DialogInterface.BUTTON_POSITIVE:
Collect.getInstance().getActivityLogger().logAction(this, "createErrorDialog", "OK");
if (shouldExit) {
finish();
}
break;
}
}
};
mAlertDialog.setCancelable(false);
mAlertDialog.setButton(getString(R.string.ok), errorListener);
mAlertDialog.show();
}
@Override
protected void onStart() {
super.onStart();
Collect.getInstance().getActivityLogger().logOnStart(this);
}
@Override
protected void onStop() {
Collect.getInstance().getActivityLogger().logOnStop(this);
super.onStop();
}
}
| [
"[email protected]"
] | |
f444c6a3c18fc10d97961ecc15d16be5ea6093d5 | ff563e1292aa21983f9380b9fef4118228b15473 | /src/InOrderTraversal.java | 0d38b8a74407d23cd48cca6cc9de1bec75298b56 | [] | no_license | GitAmrita/Algorithm | b14333b5a864a7ec2ab2284e6fb03f2848e62262 | be60be123d9fb8cf46a20168428226748e42a16b | refs/heads/master | 2021-01-25T07:07:42.303381 | 2017-09-18T17:02:21 | 2017-09-18T17:02:21 | 41,318,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,240 | java | import java.util.Stack;
/**
* Created by achowdhury on 6/7/2015.
*/
// left -> root -> right
public class InOrderTraversal {
public class Node {
public int value;
public Node left;
public Node right;
public Node(int val){
value= val; left = null; right = null;}
}
public void TraverseInorder(){
Node root = CreateTree();
Stack<Node> store = new Stack<Node>();
if(root == null)
return;
while(! store.isEmpty() || root != null){
if(root != null){
store.push(root);
root=root.left ;
}
else{
root = store.pop();
System.out.println(root.value);
root = root.right;
}
}
}
public Node CreateTree(){
Node n10 = new Node(10);
Node n6 = new Node(6);
Node n3 = new Node(3);
Node n7 = new Node(7);
Node n15 = new Node(15);
Node n11 = new Node(11);
Node n17 = new Node(17);
n10.left = n6;
n10.right = n15;
n6.left = n3;
n6.right = n7;
n15.left = n11;
n15.right = n17;
return n10;
}
}
| [
"[email protected]"
] | |
260825204e6733d0d77c8e255151f6231744ef67 | 0bbdc7bd167f55c3539308b1365445498dffe27d | /src/equipments/Projector.java | 48e62d185bb758c1e1185d5ce751366a8b24d06b | [] | no_license | andrewhenriquef/20170419_facade-homeTheater | 57ab75704c7652db54ed52d8f56dc6788e031a54 | de317443b91465f7364af09508d1bac3cc3f0682 | refs/heads/master | 2021-01-19T23:46:57.984617 | 2017-04-21T19:17:56 | 2017-04-21T19:17:56 | 89,016,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package equipments;
public class Projector {
DvdPlayer dvdPlayer;
public void on(){
System.out.println("Projector on");
}
public void off(){
System.out.println("Projector off");
}
public void tvMode(){
System.out.println("TV mode");
}
public void wideScreenMode(){
System.out.println("wide Screen");
}
}
| [
"[email protected]"
] | |
604c2629e8a644a0caa5c33c3c8980907aab741e | 1e212405cd1e48667657045ad91fb4dc05596559 | /lib/openflowj-3.3.0-SNAPSHOT-sources (copy)/org/projectfloodlight/openflow/protocol/errormsg/OFQueueOpFailedErrorMsg.java | f6b9b82e313f0e6e31c3ff488386f2ffbfabe4dd | [
"Apache-2.0"
] | permissive | aamorim/floodlight | 60d4ef0b6d7fe68b8b4688f0aa610eb23dd790db | 1b7d494117f3b6b9adbdbcf23e6cb3cc3c6187c9 | refs/heads/master | 2022-07-10T21:50:11.130010 | 2019-09-03T19:02:41 | 2019-09-03T19:02:41 | 203,223,614 | 1 | 0 | Apache-2.0 | 2022-07-06T20:07:15 | 2019-08-19T18:00:01 | Java | UTF-8 | Java | false | false | 2,146 | java | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_interface.java
// Do not modify
package org.projectfloodlight.openflow.protocol.errormsg;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import io.netty.buffer.ByteBuf;
public interface OFQueueOpFailedErrorMsg extends OFObject, OFErrorMsg {
OFVersion getVersion();
OFType getType();
long getXid();
OFErrorType getErrType();
OFQueueOpFailedCode getCode();
OFErrorCauseData getData();
void writeTo(ByteBuf channelBuffer);
Builder createBuilder();
public interface Builder extends OFErrorMsg.Builder {
OFQueueOpFailedErrorMsg build();
OFVersion getVersion();
OFType getType();
long getXid();
Builder setXid(long xid);
OFErrorType getErrType();
OFQueueOpFailedCode getCode();
Builder setCode(OFQueueOpFailedCode code);
OFErrorCauseData getData();
Builder setData(OFErrorCauseData data);
}
}
| [
"alex@VM-UFS-001"
] | alex@VM-UFS-001 |
9d8ef1f2579c94698fb6ff17cb69eae2475bc185 | 59158ff773a627f299a309b8be955aa5c2022c87 | /lubbo-common/src/main/java/com/lucky/lubbo/common/utils/ConcurrentHashSet.java | 0f8a3a03ca9da920cc09a32786719c500f42d003 | [] | no_license | larry2722/lubbo | 17c70c444dfdf0791b3809724bae50f95d970391 | 16525d718cf3c302cc00cd7122e58482fa49e8d2 | refs/heads/master | 2020-05-19T13:18:13.390326 | 2014-03-17T06:00:39 | 2014-03-17T06:00:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,455 | java | /**
* Copyright: Copyright (c) 2014
* Company: LuckyStar Lubbo
* @author: Larry.Li
* @version: v1.0.0
* Create Date: 2014年2月21日 下午4:49:49
*/
package com.lucky.lubbo.common.utils;
import java.util.AbstractSet;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class ConcurrentHashSet<E> extends AbstractSet<E> implements Set<E>, java.io.Serializable {
private static final long serialVersionUID = -8672117787651310382L;
private static final Object PRESENT = new Object();
private final ConcurrentHashMap<E, Object> map;
public ConcurrentHashSet(){
map = new ConcurrentHashMap<E, Object>();
}
public ConcurrentHashSet(int initialCapacity){
map = new ConcurrentHashMap<E, Object>(initialCapacity);
}
/**
* Returns an iterator over the elements in this set. The elements are
* returned in no particular order.
*
* @return an Iterator over the elements in this set
* @see ConcurrentModificationException
*/
public Iterator<E> iterator() {
return map.keySet().iterator();
}
/**
* Returns the number of elements in this set (its cardinality).
*
* @return the number of elements in this set (its cardinality)
*/
public int size() {
return map.size();
}
/**
* Returns <tt>true</tt> if this set contains no elements.
*
* @return <tt>true</tt> if this set contains no elements
*/
public boolean isEmpty() {
return map.isEmpty();
}
/**
* Returns <tt>true</tt> if this set contains the specified element. More
* formally, returns <tt>true</tt> if and only if this set contains an
* element <tt>e</tt> such that
* <tt>(o==null ? e==null : o.equals(e))</tt>.
*
* @param o
* element whose presence in this set is to be tested
* @return <tt>true</tt> if this set contains the specified element
*/
public boolean contains(Object o) {
return map.containsKey(o);
}
/**
* Adds the specified element to this set if it is not already present. More
* formally, adds the specified element <tt>e</tt> to this set if this set
* contains no element <tt>e2</tt> such that
* <tt>(e==null ? e2==null : e.equals(e2))</tt>. If this
* set already contains the element, the call leaves the set unchanged and
* returns <tt>false</tt>.
*
* @param e
* element to be added to this set
* @return <tt>true</tt> if this set did not already contain the specified
* element
*/
public boolean add(E e) {
return map.put(e, PRESENT) == null;
}
/**
* Removes the specified element from this set if it is present. More
* formally, removes an element <tt>e</tt> such that
* <tt>(o==null ? e==null : o.equals(e))</tt>, if this
* set contains such an element. Returns <tt>true</tt> if this set contained
* the element (or equivalently, if this set changed as a result of the
* call). (This set will not contain the element once the call returns.)
*
* @param o
* object to be removed from this set, if present
* @return <tt>true</tt> if the set contained the specified element
*/
public boolean remove(Object o) {
return map.remove(o) == PRESENT;
}
/**
* Removes all of the elements from this set. The set will be empty after
* this call returns.
*/
public void clear() {
map.clear();
}
}
| [
"[email protected]"
] | |
e956dd866d10eb31041d897ef85f5349af01d00f | 10044dbe5f92c4160a303d199cff6b59b5605a7e | /src/ch9/dahye/item65/RflectionMain.java | ed74654e37ede53f40822cf8942e3712bda325ec | [] | no_license | Study-Cow/java | cb5a98cffa8ad5bd58b27509c5886804e24a709f | 0476e055961f53d7991ad98fcf7a3489b5ca860e | refs/heads/master | 2023-07-12T05:05:13.471698 | 2021-08-01T05:04:23 | 2021-08-01T05:04:23 | 327,622,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,298 | java | package ch9.dahye.item65;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Set;
public class RflectionMain {
public static void main(String[] args) {
// 클래스명 Class 객체로 변환
Class<? extends Set<String>> cl = null;
try {
cl = (Class<? extends Set<String>>) Class.forName(args[0]);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
// 생성자
Constructor<? extends Set<String>> cons = null;
try {
cons = cl.getDeclaredConstructor();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
// 집합의 인스턴스를 만든다.
Set<String> s = null;
try {
s = cons.newInstance();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
s.addAll(Arrays.asList(args).subList(1, args.length));
}
private static void fatalError(String msg) {
System.err.println(msg);
System.exit(1);
}
}
| [
"[email protected]"
] | |
cd364aebad2bedda9ec5377b62eb6f7d0b85d43d | fd23955ff88dc987ec9dfd2d1095f06ba68b5c18 | /堆栈与设计/20.有效的括号.java | 0871d2cf3dcbae51cdfddec897f394fa598321b2 | [] | no_license | FriedPencil/leetcode | 321ac628dd468ebc594eb585c10505643f99b814 | 7a2637cb5f7295c6ebc66898b5e68a342c83c21b | refs/heads/master | 2020-04-25T14:26:55.935417 | 2020-04-19T08:53:38 | 2020-04-19T08:53:38 | 172,841,718 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,013 | java | /*
给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。
有效字符串需满足:
左括号必须用相同类型的右括号闭合。
左括号必须以正确的顺序闭合。
注意空字符串可被认为是有效字符串。
示例 1:
输入: "()"
输出: true
示例 2:
输入: "()[]{}"
输出: true
示例 3:
输入: "(]"
输出: false
示例 4:
输入: "([)]"
输出: false
示例 5:
输入: "{[]}"
输出: true
*/
class Solution {
public boolean isValid(String s) {
Stack<Character> stack = new Stack<Character>();
stack.push('0');
for(int i=0;i<s.length();i++){
if(stack.peek() == '(' && s.charAt(i) == ')') stack.pop();
else if(stack.peek() == '{' && s.charAt(i) == '}') stack.pop();
else if(stack.peek() == '[' && s.charAt(i) == ']') stack.pop();
else stack.push(s.charAt(i));
}
if (stack.peek() == '0') return true;
else return false;
}
} | [
"[email protected]"
] | |
c83c522b69e63e6a9119220db9506f181541c220 | 13dc965e897f04fa76ee6507681532f1a70482d5 | /src/com/patterns/proxy/Subject.java | 5ad74ce9cdb88ba7dd4e76202458bdd0f2929df4 | [] | no_license | albanybuipe96/DesignPatternSnippets | de8ee472aafd433f4e872e374680ca528c4c6dd4 | aa66a12e938d05b584ef3ff6c8d4b51ef08db789 | refs/heads/master | 2021-01-09T03:41:39.776596 | 2020-02-22T05:28:32 | 2020-02-22T05:28:32 | 242,233,964 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 87 | java | package com.patterns.proxy;
public interface Subject {
RealSubject request();
}
| [
"[email protected]"
] | |
034aeeca3f0e294cd2babaefb63cacb19851853a | d5f59407e338e4b6b9d14f2020bbc175d49a578c | /src/rsa/tests/StringsAndByteArrays.java | 600d40b81fb11551e8b73526c688b3b72f81dcdb | [] | no_license | aiman-al-masoud/cheap_security | 764453c8bf23a88799a0defbdd886a0e6b9cc714 | cefddb94796836aca1d3a284f65ad3000e05b0c8 | refs/heads/master | 2023-05-14T22:35:50.437807 | 2021-06-13T15:42:02 | 2021-06-13T15:42:02 | 372,332,776 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,182 | java | package rsa.tests;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
public class StringsAndByteArrays {
public static void main(String[] args) {
String plaintext = "ciao, questo e' abbastanza migliore";
byte[] bytes = plaintext.getBytes(StandardCharsets.US_ASCII);
//convert to binary string
String binaryString = "";
String byteBuf = null;
for(byte b : bytes) {
byteBuf=Integer.toBinaryString(b);
byteBuf = addBinaryPadding(8, byteBuf);
binaryString+=byteBuf;
}
//reconstruct byte array from binary string
byte[] bytesCopy = new BigInteger(binaryString, 2).toByteArray();
String copy = new String(bytesCopy, StandardCharsets.US_ASCII);
System.out.println(copy);
}
/**
* Make a binary word compatible with a given word-size by adding zeroes to the left.
* @param sizeOfWordInBits
* @param word
* @return
*/
public static String addBinaryPadding(int sizeOfWordInBits, String word) {
//int STANDARD_SIZE = 8;//size of a byte in bits
String padding = "";
for(int i =0; i<sizeOfWordInBits-word.length(); i++) {
padding+="0";
}
return padding+word;
}
}
| [
"[email protected]"
] | |
1cf9ab119dc4264a6ab7b3d76442d244214f4cbd | 38d11ae23b8a45e7e896bca54bc60492b22e95b1 | /ABEBAPI/src/com/kcdata/abe/bapi/Y_Api_Order_Pymt_Hist_Display_Output.java | ecc914f9761d3cd3a41e0437d3d1cab006a0fc45 | [] | no_license | rvarghes/core-platform-service | caae700105061539ef5d4cee46a5e85c5d603a3e | edbb3558a37a7c61bad0a63dab157f6f6ed151a0 | refs/heads/master | 2021-01-15T11:48:50.742327 | 2015-01-05T01:41:59 | 2015-01-05T01:41:59 | 26,297,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,806 | java | package com.kcdata.abe.bapi;
public class Y_Api_Order_Pymt_Hist_Display_Output extends com.sap.aii.proxy.framework.core.AbstractType{
private static final com.sap.aii.proxy.framework.core.BaseTypeDescriptor staticDescriptor ;
private static final com.sap.aii.proxy.framework.core.GenerationInfo staticGenerationInfo = new com.sap.aii.proxy.framework.core.GenerationInfo("2.0", 1280932265859L) ;
private Y_Api_Order_Pymt_Hist_Display_Output.MetaData metadata = new MetaData(this) ;
static {
com.sap.aii.proxy.framework.core.BaseTypeDescriptor descriptor = createNewBaseTypeDescriptor(com.sap.aii.proxy.framework.core.XsdlConstants.WSDL_MESSAGE_FOR_JCO, "urn:sap-com:document:sap:rfc:functions", "Y_API_ORDER_PYMT_HIST_DISPLAY.Output", 2, 0, com.kcdata.abe.bapi.Y_Api_Order_Pymt_Hist_Display_Output.class, com.sap.aii.proxy.framework.core.FactoryConstants.CONNECTION_TYPE_JCO, "Y_API_ORDER_PYMT_HIST_DISPLAY", 0, 0, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ifr:container xmlns:ifr=\"urn:sap-com:ifr:v2:metamodel\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><ifr:descriptor><ifr:description language=\"EN\">Payment History</ifr:description></ifr:descriptor><ifr:properties><ifr:sourceSystem /><ifr:sourceClient>300</ifr:sourceClient><ifr:release>700 </ifr:release><ifr:package>YABE</ifr:package><ifr:akhNode>HLB0009075</ifr:akhNode><ifr:released>no</ifr:released><ifr:outbound>false</ifr:outbound><ifr:synchronous>true</ifr:synchronous><ifr:asynchronous>false</ifr:asynchronous><ifr:unicode1>true</ifr:unicode1><ifr:unicode2>true</ifr:unicode2></ifr:properties><ifr:definition /></ifr:container>");
descriptorSetElementProperties(descriptor, 0, "RETURN", null, null, "unqualified", "urn:sap-com:document:sap:rfc:functions:BAPIRETURN", "urn:sap-com:document:sap:rfc:functions", false, 0, 1, false, null, "Return", com.kcdata.abe.bapi.BapireturnType.class, new com.kcdata.abe.bapi.BapireturnType(), new java.lang.String[][]{}, "RETURN", 0, 0, -1, -1, -1, -1, com.sap.mw.jco.JCO.TYPE_STRUCTURE, com.sap.mw.jco.JCO.EXPORT_PARAMETER, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ifr:parameter name=\"RETURN\"><ifr:descriptor><ifr:description language=\"EN\">Return Message</ifr:description></ifr:descriptor><ifr:definition><ifr:complexType name=\"BAPIRETURN\" type=\"structure\" xlink:role=\"type\" xlink:href=\"/Content?TYPE=type&NAME=BAPIRETURN\" /></ifr:definition><ifr:properties><ifr:direction>out</ifr:direction><ifr:class>export</ifr:class><ifr:type>structure</ifr:type><ifr:optional>true</ifr:optional><ifr:basedOnDictionaryReference>true</ifr:basedOnDictionaryReference></ifr:properties></ifr:parameter>");
descriptorSetElementProperties(descriptor, 1, "PAYMENTSTODATE", null, null, "unqualified", null, "urn:sap-com:document:sap:rfc:functions", false, 0, -1, false, null, "Paymentstodate", com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List.class, new com.kcdata.abe.bapi.Zapi_Tourop_Itn_PaytodateType(), new java.lang.String[][]{}, "PAYMENTSTODATE", 0, 0, -1, -1, -1, -1, com.sap.mw.jco.JCO.TYPE_TABLE, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ifr:parameter name=\"PAYMENTSTODATE\"><ifr:descriptor><ifr:description language=\"EN\">Structure for Itinerary Payments to Date</ifr:description></ifr:descriptor><ifr:definition><ifr:complexType name=\"ZAPI_TOUROP_ITN_PAYTODATE\" type=\"structure\" xlink:role=\"type\" xlink:href=\"/Content?TYPE=type&NAME=ZAPI_TOUROP_ITN_PAYTODATE\" /></ifr:definition><ifr:properties><ifr:direction>inout</ifr:direction><ifr:class>tables</ifr:class><ifr:type>structure</ifr:type><ifr:optional>false</ifr:optional><ifr:basedOnDictionaryReference>true</ifr:basedOnDictionaryReference></ifr:properties></ifr:parameter>");
staticDescriptor = descriptor;
}
protected Y_Api_Order_Pymt_Hist_Display_Output (com.sap.aii.proxy.framework.core.BaseTypeDescriptor descriptor, com.sap.aii.proxy.framework.core.GenerationInfo staticGenerationInfo, int connectionType) {
super(descriptor, staticGenerationInfo, connectionType);
}
public Y_Api_Order_Pymt_Hist_Display_Output () {
super(staticDescriptor, staticGenerationInfo, com.sap.aii.proxy.framework.core.FactoryConstants.CONNECTION_TYPE_JCO);
}
public void setReturn(com.kcdata.abe.bapi.BapireturnType Return) {
baseTypeData().setElementValue(0, Return);
}
public com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List get_as_listPaymentstodate() {
return (com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List)baseTypeData().getElementValue(1);
}
public com.kcdata.abe.bapi.BapireturnType getReturn() {
return (com.kcdata.abe.bapi.BapireturnType)baseTypeData().getElementValue(0);
}
public MetaData metadataY_Api_Order_Pymt_Hist_Display_Output() {
return metadata;
}
public void setPaymentstodate(com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List Paymentstodate) {
baseTypeData().setElementValue(1, Paymentstodate);
}
public void setPaymentstodate(com.kcdata.abe.bapi.Zapi_Tourop_Itn_PaytodateType[] Paymentstodate) {
baseTypeData().setElementValue(1, new com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List());
com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List list$ = get_as_listPaymentstodate();
for (int i$ = 0; i$ < Paymentstodate.length; i$++){
list$.addZapi_Tourop_Itn_PaytodateType(Paymentstodate[ i$]);
}
}
public com.kcdata.abe.bapi.Zapi_Tourop_Itn_PaytodateType[] getPaymentstodate() {
com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List i$ = (com.kcdata.abe.bapi.util.Zapi_Tourop_Itn_PaytodateType_List)baseTypeData().getElementValue(1);
if ( i$ == null){return null;}
return i$.toArrayZapi_Tourop_Itn_PaytodateType();
}
public static class MetaData implements java.io.Serializable {
private Y_Api_Order_Pymt_Hist_Display_Output parent ;
private static final long serialVersionUID = -386313361L ;
protected MetaData (Y_Api_Order_Pymt_Hist_Display_Output parent) {
this.parent = parent;
}
public com.sap.aii.proxy.framework.core.JcoMetaData getReturn() {
return (com.sap.aii.proxy.framework.core.JcoMetaData)parent.baseTypeMetaData().getElement(0);
}
public com.sap.aii.proxy.framework.core.TypeMetaData typeMetadata() {
return (com.sap.aii.proxy.framework.core.TypeMetaData)parent.baseTypeMetaData();
}
public com.sap.aii.proxy.framework.core.JcoMetaData getPaymentstodate() {
return (com.sap.aii.proxy.framework.core.JcoMetaData)parent.baseTypeMetaData().getElement(1);
}
}
}
| [
"[email protected]"
] |
Subsets and Splits