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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
064254e908592a43f5d6538c540084aaf301d010 | 8615446cfa47a86a905363037c02ad339b618bc4 | /services/cart/cart-domain/src/main/java/ninja/cero/ecommerce/cart/domain/Cart.java | 92c86a12705d8440edf1975aa4508bd0ef802b4f | [
"Apache-2.0"
] | permissive | cero-t/spring-cloud-kinoko-2017 | 510e54b56a240c8b8b286840f1389a2e23e334ff | eec447e169a85fca8680d0459954117dca034c6a | refs/heads/master | 2021-05-13T17:21:35.024683 | 2018-04-18T15:04:48 | 2018-04-18T15:04:48 | 116,819,582 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package ninja.cero.ecommerce.cart.domain;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.data.annotation.Id;
public class Cart implements Serializable {
private static final long serialVersionUID = 1L;
@Id
public Long cartId;
public Map<Long, Integer> items = new LinkedHashMap<>();
}
| [
"[email protected]"
] | |
531817e0863bf63015c58129560a20548e8f883a | 2f6a8dbbf440833eed6159558e7210c455e85820 | /customer/src/com/netease/nim/uikit/contact_selector/viewholder/ContactsSelectHolder.java | a94867830af819a4dc3f7ced896552f5013c3431 | [] | no_license | zhaozw/CustomerRuralbank | fdb67749a4dd05050743951001030110985ac8d5 | 5ae1c80065c2673d23b49fab8f3cd8549fe05108 | refs/heads/master | 2021-01-18T17:02:30.582429 | 2017-02-24T06:38:58 | 2017-02-24T06:38:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,352 | java | package com.netease.nim.uikit.contact_selector.viewholder;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.netease.nim.uikit.NimUIKit;
import com.grgbanking.ruralbank.R;
import com.netease.nim.uikit.common.ui.imageview.HeadImageView;
import com.netease.nim.uikit.common.ui.ptr.ViewCompat;
import com.netease.nim.uikit.contact.core.item.ContactItem;
import com.netease.nim.uikit.contact.core.model.ContactDataAdapter;
import com.netease.nim.uikit.contact.core.model.IContact;
import com.netease.nim.uikit.contact.core.viewholder.AbsContactViewHolder;
import com.netease.nim.uikit.contact_selector.adapter.ContactSelectAdapter;
public class ContactsSelectHolder extends AbsContactViewHolder<ContactItem> {
private final boolean multi;
private HeadImageView image;
private TextView nickname;
private ImageView select;
private Drawable defaultBackground;
public ContactsSelectHolder() {
this(false);
}
public ContactsSelectHolder(boolean multi) {
this.multi = multi;
}
@Override
public void refresh(ContactDataAdapter adapter, int position, ContactItem item) {
if (multi) {
boolean disabled = !adapter.isEnabled(position);
boolean selected = adapter instanceof ContactSelectAdapter ? ((ContactSelectAdapter) adapter).isSelected(position) : false;
this.select.setVisibility(View.VISIBLE);
if (disabled) {
this.select.setBackgroundResource(R.drawable.nim_contact_checkbox_checked_grey);
getView().setBackgroundColor(context.getResources().getColor(R.color.transparent));
} else if (selected) {
ViewCompat.setBackground(getView(), defaultBackground);
this.select.setBackgroundResource(R.drawable.nim_contact_checkbox_checked_green);
} else {
ViewCompat.setBackground(getView(), defaultBackground);
this.select.setBackgroundResource(R.drawable.nim_contact_checkbox_unchecked);
}
} else {
this.select.setVisibility(View.GONE);
}
IContact contact = item.getContact();
this.nickname.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
this.nickname.setText(contact.getDisplayName());
if (contact.getContactType() == IContact.Type.Friend || contact.getContactType() == IContact.Type.TeamMember) {
this.nickname.setText(contact.getDisplayName());
this.image.loadBuddyAvatar(contact.getContactId());
} else if (contact.getContactType() == IContact.Type.Team) {
this.image.setImageBitmap(NimUIKit.getUserInfoProvider().getTeamIcon(contact.getContactId()));
}
this.image.setVisibility(View.VISIBLE);
}
@Override
public View inflate(LayoutInflater inflater) {
View view = inflater.inflate(R.layout.nim_contacts_select_item, null);
defaultBackground = view.getBackground();
this.image = (HeadImageView) view.findViewById(R.id.img_head);
this.nickname = (TextView) view.findViewById(R.id.tv_nickname);
this.select = (ImageView) view.findViewById(R.id.imgSelect);
return view;
}
}
| [
"[email protected]"
] | |
5edec572e6d4e564f951b6e5d501c89749da3953 | f2532eb82b2a00f616c50ac969e0ece19bbe3f44 | /src/main/java/dev/sanket/GenericExtFilter.java | c0274e3a98522e14eee31a372fc361c127c22d03 | [] | no_license | sanketmeghani/java-testify | 117a43aac4566ae475d6780b0c0cbfd4d06bf38c | 7864649d2ab7e0bfdf847065b65a5df876dabe5c | refs/heads/master | 2021-01-10T03:57:56.481537 | 2015-12-15T05:21:20 | 2015-12-15T05:21:20 | 48,020,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package dev.sanket;
import java.io.File;
import java.io.FilenameFilter;
public class GenericExtFilter implements FilenameFilter {
private String ext;
public GenericExtFilter(String ext) {
this.ext = ext;
}
public boolean accept(File dir, String name) {
return (name.endsWith(ext));
}
} | [
"[email protected]"
] | |
84afff8ab287e5738df9018ad96f2df1dfce2c55 | 955073f063caf4c8feaa3cb4eade2e5c0557b12c | /src/test/java/com/zuosh/bt/BtApplicationTests.java | b097322009afd7d6759b654e3866b5de606da86d | [] | no_license | feixueck/btrace.test | a864e614c16dcf2948d757b52ddcbb6feef8507a | d579d32c31658dd5e03f6caa4c87933c30b4d326 | refs/heads/master | 2021-05-03T22:07:34.783344 | 2018-03-16T10:33:07 | 2018-03-16T10:33:07 | 120,388,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.zuosh.bt;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class BtApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
2b51c699922ef38341e5bf574569c5dcbcd70fe6 | b7df419285ca3eaec45e04f0f6d58f666795a76a | /app/src/main/java/com/crazymike/alert/TerminalTimePickerDialog.java | dc53b9f8d19deef77d85c4756ec2b422a9436e3b | [] | no_license | brianbc4/CrazyMikeNativeStudy | 9ce0d9ab424f8c20a6ce9d817d8b3d06aeaa4a5f | a7bd6e88ce70914094b532a992e3738b765f2cdb | refs/heads/master | 2021-01-22T20:21:49.820766 | 2017-08-18T10:39:37 | 2017-08-18T10:39:37 | 100,702,099 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,731 | java | package com.crazymike.alert;
import android.content.Context;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TimePicker;
import com.crazymike.R;
import com.crazymike.util.PreferencesKey;
import com.crazymike.util.PreferencesTool;
import org.joda.time.LocalTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
/**
* Created by Elliot on 2017/3/27.
*/
public class TerminalTimePickerDialog extends AlertDialog implements View.OnClickListener {
private static final String TAG = TerminalTimePickerDialog.class.getSimpleName();
private Context context;
private Listener listener;
private PreferencesKey preferencesKey;
private TimePicker timePicker;
private DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("HH:mm:ss");
@RequiresApi(api = Build.VERSION_CODES.M)
public TerminalTimePickerDialog(@NonNull Context context, Listener listener, PreferencesKey preferencesKey) {
super(context);
this.context = context;
this.listener = listener;
this.preferencesKey = preferencesKey;
initView();
}
@RequiresApi(api = Build.VERSION_CODES.M)
private void initView() {
View view = LayoutInflater.from(context).inflate(R.layout.dialog_terminal_time_picker, null);
setView(view);
timePicker = (TimePicker) view.findViewById(R.id.timePicker);
Button buttonConfirm = (Button) view.findViewById(R.id.button_confirm);
String time = PreferencesTool.getInstance().get(preferencesKey, String.class);
LocalTime localTime = LocalTime.parse(time, dateTimeFormatter);
timePicker.setHour(localTime.getHourOfDay());
timePicker.setMinute(localTime.getMinuteOfHour());
buttonConfirm.setOnClickListener(this);
}
public interface Listener {
void onTimePick(PreferencesKey preferencesKey, String time);
}
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.button_confirm:
LocalTime localTime =
new LocalTime().hourOfDay().setCopy(timePicker.getHour())
.minuteOfHour().setCopy(timePicker.getMinute())
.secondOfMinute().setCopy("00");
listener.onTimePick(preferencesKey, localTime.toString(dateTimeFormatter));
dismiss();
break;
}
}
}
| [
"[email protected]"
] | |
e379cab7a0eecf33e44e5d9da077b021edb0b033 | 088cad7c00db1e05ad2ab219e393864f3bf7add6 | /classes/android/support/v4/widget/ExploreByTouchHelper$1.java | 7d0da5df4efbaa277fe55a4cabd98843e7063c2b | [] | no_license | devidwfreitas/com-santander-app.7402 | 8e9f344f5132b1c602d80929f1ff892293f4495d | e9a92b20dc3af174f9b27ad140643b96fb78f04d | refs/heads/main | 2023-05-01T09:33:58.835056 | 2021-05-18T23:54:43 | 2021-05-18T23:54:43 | 368,692,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package android.support.v4.widget;
import android.graphics.Rect;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
final class ExploreByTouchHelper$1 implements FocusStrategy$BoundsAdapter<AccessibilityNodeInfoCompat> {
public void obtainBounds(AccessibilityNodeInfoCompat paramAccessibilityNodeInfoCompat, Rect paramRect) {
paramAccessibilityNodeInfoCompat.getBoundsInParent(paramRect);
}
}
/* Location: C:\Users\devid\Downloads\SAST\Santander\dex2jar-2.0\classes-dex2jar.jar!\android\support\v4\widget\ExploreByTouchHelper$1.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/ | [
"[email protected]"
] | |
20aae7d3186d00bf4bcc9a569d5b12fdc186f5d5 | 393cd3c7b389a6cebc189562b49f73f282df0b07 | /src/main/java/mainPackage/App.java | 0d0f0317d37acace5c8fbfeefa54f4ef0a145121 | [] | no_license | barteq2011/Text_Editor | 2b65f3809d6f87b58bc77898552d78755fe6ddd2 | ac12e3fd28a5c01c5f359c40d8421256f1fcac5c | refs/heads/master | 2022-11-25T15:42:31.093129 | 2020-07-28T12:03:24 | 2020-07-28T12:03:24 | 283,196,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,731 | java | package mainPackage;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class App extends Application {
// Variables used for make window draggable without Windows default frame
double XOffset, YOffset;
@Override
public void start(Stage primaryStage) throws Exception{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("mainWindow.fxml"));
Parent root = loader.load();
Controller controller = loader.getController();
primaryStage.setTitle("Text Editor");
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setOpacity(0.92);
// Set draggable window area used to change position on the screen
controller.getMenuBar().setOnMousePressed(mouseEvent -> {
XOffset = mouseEvent.getSceneX();
YOffset = mouseEvent.getSceneY();
});
controller.getMenuBar().setOnMouseDragged(mouseEvent -> {
primaryStage.setX(mouseEvent.getScreenX() - XOffset);
primaryStage.setY(mouseEvent.getScreenY() - YOffset);
});
// Ask for save if working on opened file
primaryStage.setOnCloseRequest(windowEvent -> {
controller.handleExitMenuItem();
windowEvent.consume();
});
primaryStage.getIcons().add(new Image(getClass().getResource("icon.png").toExternalForm()));
primaryStage.setScene(new Scene(root, 900, 575));
primaryStage.show();
}
public static void main(String[] args) {
launch();
}
} | [
"[email protected]"
] | |
5fc6de813bc744b0ee588e7fb7fae971e9d3e332 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_2bd42761423535240549b1eef59c178ad28c7cef/DeliveredReceiver/11_2bd42761423535240549b1eef59c178ad28c7cef_DeliveredReceiver_t.java | 69a65ff7083044a6665d4f709627daf211d3deb1 | [] | 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 | 4,614 | java | /*
* Copyright 2013 Jacob Klinker
*
* 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.klinker.android.send_message;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;
import java.util.Calendar;
public class DeliveredReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.v("delivery_receiver", "marking message as delivered");
Uri uri;
try {
uri = Uri.parse(intent.getStringExtra("message_uri"));
if (uri.equals("")) {
uri = null;
}
} catch (Exception e) {
uri = null;
}
switch (getResultCode()) {
case Activity.RESULT_OK:
// notify user that message was delivered
Intent delivered = new Intent(Transaction.NOTIFY_OF_DELIVERY);
delivered.putExtra("result", true);
context.sendBroadcast(delivered);
if (uri != null) {
ContentValues values = new ContentValues();
values.put("status", "0");
values.put("date_sent", Calendar.getInstance().getTimeInMillis());
values.put("read", true);
context.getContentResolver().update(uri, values, null, null);
} else {
Cursor query = context.getContentResolver().query(Uri.parse("content://sms/sent"), null, null, null, "date desc");
// mark message as delivered in database
if (query.moveToFirst()) {
String id = query.getString(query.getColumnIndex("_id"));
ContentValues values = new ContentValues();
values.put("status", "0");
values.put("date_sent", Calendar.getInstance().getTimeInMillis());
values.put("read", true);
context.getContentResolver().update(Uri.parse("content://sms/sent"), values, "_id=" + id, null);
}
query.close();
}
break;
case Activity.RESULT_CANCELED:
// notify user that message failed to be delivered
Intent notDelivered = new Intent(Transaction.NOTIFY_OF_DELIVERY);
notDelivered.putExtra("result", false);
context.sendBroadcast(notDelivered);
if (uri != null) {
ContentValues values = new ContentValues();
values.put("status", "64");
values.put("date_sent", Calendar.getInstance().getTimeInMillis());
values.put("read", true);
values.put("error_code", getResultCode());
context.getContentResolver().update(uri, values, null, null);
} else {
Cursor query2 = context.getContentResolver().query(Uri.parse("content://sms/sent"), null, null, null, "date desc");
// mark failed in database
if (query2.moveToFirst()) {
String id = query2.getString(query2.getColumnIndex("_id"));
ContentValues values = new ContentValues();
values.put("status", "64");
values.put("read", true);
values.put("error_code", getResultCode());
context.getContentResolver().update(Uri.parse("content://sms/sent"), values, "_id=" + id, null);
}
query2.close();
}
break;
}
context.sendBroadcast(new Intent("com.klinker.android.send_message.REFRESH"));
}
}
| [
"[email protected]"
] | |
b06e4079fc6781cdea6175cbf37ba0cfed631fca | 43287734722484d6ed7817042e886d446733561c | /src/EqualiseHistogram.java | 991c8b15b1a7b75dd5650419d879e3fb3b880e1d | [] | no_license | GuptaAkshay/ImageEnhancementAndEditingTool | e78c073ec5d51197b2e0532a2e55bd9b19410d0b | ca536f4607aba3fdd7b5c2da37bea1b439c1f606 | refs/heads/master | 2021-01-22T01:04:53.146035 | 2015-10-30T05:32:16 | 2015-10-30T05:32:16 | 41,664,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,851 | java | /**
*
*/
/**
* @author Sinner
*
*/
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
public class EqualiseHistogram {
public static BufferedImage histogramEqualization(BufferedImage original) {
int red;
int green;
int blue;
int alpha;
int newPixel = 0;
// Get the Lookup table for histogram equalization
ArrayList<int[]> histLUT = histogramEqualizationLUT(original);
BufferedImage histogramEQ = new BufferedImage(original.getWidth(), original.getHeight(), original.getType());
for(int i=0; i<original.getWidth(); i++) {
for(int j=0; j<original.getHeight(); j++) {
// Get pixels by R, G, B
alpha = new Color(original.getRGB (i, j)).getAlpha();
red = new Color(original.getRGB (i, j)).getRed();
green = new Color(original.getRGB (i, j)).getGreen();
blue = new Color(original.getRGB (i, j)).getBlue();
// Set new pixel values using the histogram lookup table
red = histLUT.get(0)[red];
green = histLUT.get(1)[green];
blue = histLUT.get(2)[blue];
// Return back to original format
newPixel = colorToRGB(alpha, red, green, blue);
// Write pixels into image
histogramEQ.setRGB(i, j, newPixel);
}
}
return histogramEQ;
}
// Get the histogram equalization lookup table for separate R, G, B channels
private static ArrayList<int[]> histogramEqualizationLUT(BufferedImage input) {
// Get an image histogram - calculated values by R, G, B channels
ArrayList<int[]> imageHist = imageHistogram(input);
// Create the lookup table
ArrayList<int[]> imageLUT = new ArrayList<int[]>();
// Fill the lookup table
int[] rhistogram = new int[256];
int[] ghistogram = new int[256];
int[] bhistogram = new int[256];
for(int i=0; i<rhistogram.length; i++) rhistogram[i] = 0;
for(int i=0; i<ghistogram.length; i++) ghistogram[i] = 0;
for(int i=0; i<bhistogram.length; i++) bhistogram[i] = 0;
long sumr = 0;
long sumg = 0;
long sumb = 0;
// Calculate the scale factor
float scale_factor = (float) (255.0 / (input.getWidth() * input.getHeight()));
for(int i=0; i<rhistogram.length; i++) {
sumr += imageHist.get(0)[i];
int valr = (int) (sumr * scale_factor);
if(valr > 255) {
rhistogram[i] = 255;
}
else rhistogram[i] = valr;
sumg += imageHist.get(1)[i];
int valg = (int) (sumg * scale_factor);
if(valg > 255) {
ghistogram[i] = 255;
}
else ghistogram[i] = valg;
sumb += imageHist.get(2)[i];
int valb = (int) (sumb * scale_factor);
if(valb > 255) {
bhistogram[i] = 255;
}
else bhistogram[i] = valb;
}
imageLUT.add(rhistogram);
imageLUT.add(ghistogram);
imageLUT.add(bhistogram);
return imageLUT;
}
// Return an ArrayList containing histogram values for separate R, G, B channels
public static ArrayList<int[]> imageHistogram(BufferedImage input) {
int[] rhistogram = new int[256];
int[] ghistogram = new int[256];
int[] bhistogram = new int[256];
for(int i=0; i<rhistogram.length; i++) rhistogram[i] = 0;
for(int i=0; i<ghistogram.length; i++) ghistogram[i] = 0;
for(int i=0; i<bhistogram.length; i++) bhistogram[i] = 0;
for(int i=0; i<input.getWidth(); i++) {
for(int j=0; j<input.getHeight(); j++) {
int red = new Color(input.getRGB (i, j)).getRed();
int green = new Color(input.getRGB (i, j)).getGreen();
int blue = new Color(input.getRGB (i, j)).getBlue();
// Increase the values of colors
rhistogram[red]++; ghistogram[green]++; bhistogram[blue]++;
}
}
ArrayList<int[]> hist = new ArrayList<int[]>();
hist.add(rhistogram);
hist.add(ghistogram);
hist.add(bhistogram);
return hist;
}
// Convert R, G, B, Alpha to standard 8 bit
private static int colorToRGB(int alpha, int red, int green, int blue) {
int newPixel = 0;
newPixel += alpha;
newPixel = newPixel << 8;
newPixel += red;
newPixel = newPixel << 8;
newPixel += green;
newPixel = newPixel << 8;
newPixel += blue;
return newPixel;
}
} | [
"[email protected]"
] | |
47a7622e2d131292a8580149b4271a1930a50918 | d8fd65857843831403a64ff4bfdc308d2d593f54 | /src/main/java/com/aspose/spreadsheeteditor/WorksheetView.java | 0197c662969eb041681e30ef9807aa265ad9003f | [
"MIT"
] | permissive | carlosgili/html5spreadsheeteditor | c68131702f38e205c97d4fc0fdf73b535afc48de | 69a846e3d6195c89fd2b78a9fa09201ad90ca7ed | refs/heads/master | 2021-01-12T17:00:44.015414 | 2015-04-02T13:32:08 | 2015-04-02T13:32:08 | 71,490,343 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,138 | java | package com.aspose.spreadsheeteditor;
import java.awt.Color;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import javax.faces.context.FacesContext;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.context.RequestContext;
import org.primefaces.event.CellEditEvent;
import org.primefaces.event.ColumnResizeEvent;
@Named(value = "worksheet")
@ViewScoped
public class WorksheetView implements Serializable {
private static final Logger LOGGER = Logger.getLogger(WorksheetView.class.getName());
private int currentColumnId;
private int currentRowId;
private String currentCellClientId;
@Inject
private WorkbookService workbook;
@Inject
private CellsService cells;
@Inject
private MessageService msg;
@Inject
private LoaderService loader;
@Inject
FormattingService formatting;
public boolean isLoaded() {
return workbook.isLoaded();
}
public int getDefaultColumnWidth() {
try {
return getAsposeWorksheet().getCells().getStandardWidthPixels();
} catch (com.aspose.cells.CellsException | NullPointerException x) {
LOGGER.throwing(null, null, x);
return 64;
}
}
public List<Integer> getColumnWidth() {
return cells.getColumnWidth(workbook.getCurrent());
}
public List<Integer> getRowHeight() {
return cells.getRowHeight(workbook.getCurrent());
}
private com.aspose.cells.Worksheet getAsposeWorksheet() {
com.aspose.cells.Workbook w = workbook.getAsposeWorkbook();
return w.getWorksheets().get(w.getWorksheets().getActiveSheetIndex());
}
public List<Column> getColumns() {
return cells.getColumns(workbook.getCurrent());
}
public List<Row> getRows() {
return cells.getRows(workbook.getCurrent());
}
public void applyCellFormatting() {
if (!isLoaded()) {
return;
}
com.aspose.cells.Cell c = getAsposeWorksheet().getCells().get(currentRowId, currentColumnId);
com.aspose.cells.Style s = c.getStyle();
s.getFont().setBold(formatting.isBoldOptionEnabled());
s.getFont().setItalic(formatting.isItalicOptionEnabled());
s.getFont().setUnderline(formatting.isUnderlineOptionEnabled() ? com.aspose.cells.FontUnderlineType.SINGLE : com.aspose.cells.FontUnderlineType.NONE);
s.getFont().setName(formatting.getFontSelectionOption());
s.getFont().setSize(formatting.getFontSizeOption());
switch (formatting.getAlignSelectionOption()) {
case "al":
s.setHorizontalAlignment(com.aspose.cells.TextAlignmentType.LEFT);
break;
case "ac":
s.setHorizontalAlignment(com.aspose.cells.TextAlignmentType.CENTER);
break;
case "ar":
s.setHorizontalAlignment(com.aspose.cells.TextAlignmentType.RIGHT);
break;
case "aj":
s.setHorizontalAlignment(com.aspose.cells.TextAlignmentType.JUSTIFY);
break;
default:
}
try {
s.getFont().setColor(com.aspose.cells.Color.fromArgb(Color.decode("0x" + formatting.getFontColorSelectionOption()).getRGB()));
} catch (NumberFormatException x) {
// Ignore
}
try {
s.setForegroundArgbColor(Color.decode("0x" + formatting.getFillColorSelectionOption()).getRGB());
} catch (NumberFormatException x) {
// Ignore
}
c.setStyle(s);
RequestContext.getCurrentInstance().update(currentCellClientId);
purge();
}
public int getCurrentColumnId() {
return currentColumnId;
}
public void setCurrentColumnId(int currentColumnId) {
this.currentColumnId = currentColumnId;
}
public int getCurrentRowId() {
return currentRowId;
}
public void setCurrentRowId(int currentRowId) {
this.currentRowId = currentRowId;
}
public String getCurrentCellClientId() {
return currentCellClientId;
}
public void setCurrentCellClientId(String currentCellClientId) {
this.currentCellClientId = currentCellClientId;
}
public void onCellEdit(CellEditEvent e) {
Cell newCell = (Cell) e.getNewValue();
int columnId = newCell.getColumnId();
int rowId = newCell.getRowId();
try {
com.aspose.cells.Cell c = getAsposeWorksheet().getCells().get(rowId, columnId);
if (newCell.getFormula() != null) {
c.setFormula(newCell.getFormula(), null);
} else {
c.putValue(newCell.getValue(), true);
}
cells.putCell(workbook.getCurrent(), columnId, rowId, newCell);
} catch (com.aspose.cells.CellsException x) {
LOGGER.throwing(null, null, x);
}
}
public void onColumnResize(ColumnResizeEvent e) {
if (!isLoaded()) {
return;
}
int columnId = com.aspose.cells.CellsHelper.columnNameToIndex(e.getColumn().getHeaderText());
try {
getAsposeWorksheet().getCells().setColumnWidthPixel(columnId, e.getWidth());
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not resize column", cx.getMessage());
return;
}
reloadColumnWidth(columnId);
}
public void addRowAbove() {
try {
getAsposeWorksheet().getCells().insertRows(currentRowId, 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not add row", cx.getMessage());
return;
}
purge();
reloadRowHeight(currentRowId);
}
public void addRowBelow() {
if (getCurrentRowId() < 0) {
msg.sendMessage("No cell selected", null);
return;
}
int newRowId = currentRowId + 1;
try {
getAsposeWorksheet().getCells().insertRows(newRowId, 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not add row", cx.getMessage());
return;
}
purge();
reloadRowHeight(newRowId);
}
public void deleteRow() {
try {
getAsposeWorksheet().getCells().deleteRows(currentRowId, 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not delete row", cx.getMessage());
return;
}
cells.getRows(workbook.getCurrent()).remove(currentRowId);
getRowHeight().remove(currentRowId);
purge();
}
public void addColumnBefore() {
try {
getAsposeWorksheet().getCells().insertColumns(getCurrentColumnId(), 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not add column", cx.getMessage());
return;
}
reloadColumnWidth(currentColumnId);
purge();
}
public void addColumnAfter() {
int newColumnId = currentColumnId + 1;
try {
getAsposeWorksheet().getCells().insertColumns(newColumnId, 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not add column", cx.getMessage());
return;
}
reloadColumnWidth(newColumnId);
purge();
}
public void deleteColumn() {
try {
getAsposeWorksheet().getCells().deleteColumns(currentColumnId, 1, true);
} catch (com.aspose.cells.CellsException cx) {
LOGGER.throwing(null, null, cx);
msg.sendMessage("Could not delete column", cx.getMessage());
return;
}
cells.getColumns(workbook.getCurrent()).remove(currentColumnId);
getRowHeight().remove(currentColumnId);
purge();
}
public void addCellShiftRight() {
if (!isLoaded()) {
return;
}
com.aspose.cells.CellArea a = new com.aspose.cells.CellArea();
a.StartColumn = a.EndColumn = currentColumnId;
a.StartRow = a.EndRow = currentRowId;
getAsposeWorksheet().getCells().insertRange(a, com.aspose.cells.ShiftType.RIGHT);
purge();
}
public void addCellShiftDown() {
if (!isLoaded()) {
return;
}
com.aspose.cells.CellArea a = new com.aspose.cells.CellArea();
a.StartColumn = a.EndColumn = currentColumnId;
a.StartRow = a.EndRow = currentRowId;
getAsposeWorksheet().getCells().insertRange(a, com.aspose.cells.ShiftType.DOWN);
purge();
}
public void removeCellShiftUp() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().deleteRange(currentRowId, currentColumnId, currentRowId, currentColumnId, com.aspose.cells.ShiftType.UP);
purge();
}
public void removeCellShiftLeft() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().deleteRange(currentRowId, currentColumnId, currentRowId, currentColumnId, com.aspose.cells.ShiftType.LEFT);
purge();
}
public void clearCurrentCellFormatting() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearFormats(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
}
public void clearCurrentCellContents() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearContents(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
}
public void clearCurrentCell() {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().clearRange(currentRowId, currentColumnId, currentRowId, currentColumnId);
reloadCell(currentColumnId, currentRowId);
RequestContext.getCurrentInstance().update(currentCellClientId);
}
public int getCurrentColumnWidth() {
return getColumnWidth().get(currentColumnId);
}
public void setCurrentColumnWidth(int width) {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().setColumnWidthPixel(currentColumnId, width);
reloadColumnWidth(currentColumnId);
RequestContext.getCurrentInstance().update("sheet");
}
public int getCurrentRowHeight() {
return getRowHeight().get(currentRowId);
}
public void setCurrentRowHeight(int height) {
if (!isLoaded()) {
return;
}
getAsposeWorksheet().getCells().setRowHeightPixel(currentRowId, height);
reloadRowHeight(currentRowId);
RequestContext.getCurrentInstance().update("sheet");
}
public List<String> getFonts() {
List<String> list = new ArrayList<>();
if (isLoaded()) {
// TODO: get list of fonts used by the workboook
}
return list;
}
public void updatePartialView() {
String id = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");
if (id != null) {
RequestContext.getCurrentInstance().update(id);
}
}
private void reloadColumnWidth(int columnId) {
int width = getAsposeWorksheet().getCells().getColumnWidthPixel(columnId);
getColumnWidth().remove(columnId);
getColumnWidth().add(columnId, width);
}
private void reloadRowHeight(int rowId) {
int height = getAsposeWorksheet().getCells().getRowHeightPixel(rowId);
getRowHeight().remove(rowId);
getRowHeight().add(rowId, height);
}
private void reloadCell(int columnId, int rowId) {
com.aspose.cells.Cell a = getAsposeWorksheet().getCells().get(rowId, columnId);
Cell c = cells.fromAsposeCell(a);
cells.getRows(workbook.getCurrent()).get(rowId).putCell(columnId, c);
}
public void purge() {
loader.buildCellsCache(workbook.getCurrent());
}
}
| [
"[email protected]"
] | |
50a4a7b3e25979a4d0a02c3c57b20d1bd18df657 | f2e42a4b47bc5e2add9ea09bd91ad30d1eead40e | /src/entity/AdminDao.java | 1f20fed32088bf0839633fb9dc683cef50c7b0d7 | [] | no_license | kento8025/Auction | a767f616c447d6e39cbedba73c2c5f6a17cb6717 | 2f44ed00f510409b49d45892266e136be50860c9 | refs/heads/master | 2020-08-27T20:03:15.465504 | 2019-12-17T07:52:27 | 2019-12-17T07:52:27 | 217,427,991 | 0 | 0 | null | null | null | null | SHIFT_JIS | Java | false | false | 1,963 | java | package entity;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import util.Util;
public class AdminDao {
private Connection con;
private void Setup() {
System.out.println("接続開始");
con = Util.getConnection();
try {
con.setAutoCommit(false);
} catch (SQLException e) {
e.printStackTrace();
System.out.println("トランザクションエラー");
}
}
public void tearDown() {
try {
con.rollback();
System.out.println("開始前にロールバックします");
System.out.println("接続終了");
} catch (SQLException e) {
e.printStackTrace();
}
}
public void delete(int id) {
Setup();
try (PreparedStatement stmt = con.prepareStatement("DELETE FROM Product WHERE id = ? ;")) {
stmt.setInt(1, id);
stmt.executeUpdate();
System.out.println("削除完了");
con.commit();
} catch (Exception e) {
System.out.println("delete メソッド");
System.out.println("削除失敗");
tearDown();
}
}
public void hidden(int id) {
Setup();
try (PreparedStatement stmt = con.prepareStatement("UPDATE Product SET should_show = 2 WHERE id = ?")) {
stmt.setInt(1, id);
stmt.executeUpdate();
System.out.println("非表示");
con.commit();
} catch (Exception e) {
System.out.println("hidden メソッド");
System.out.println("更新失敗");
tearDown();
}
}
public void hiddenCancel(int id) {
Setup();
try (PreparedStatement stmt = con.prepareStatement("UPDATE Product SET should_show = 1 WHERE id = ?")) {
stmt.setInt(1, id);
stmt.executeUpdate();
System.out.println("公開");
con.commit();
} catch (Exception e) {
System.out.println("hiddenCancel メソッド");
System.out.println("更新失敗");
tearDown();
}
}
}
| [
"[email protected]"
] | |
9ecbf776726915dfefe1a26d1d988506e3e1cd2b | 5e7545f3cf6c0afce8cdcd4d78aa56732162f363 | /test/Implementations/Messaging/MessageHubTest.java | 9f2f01f24f36bb7bdea8f9e7916949854a22a067 | [
"MIT"
] | permissive | HenryGeorgist/Core | dd2c13c3827df206bc25089f902d92c758d5ad73 | c243eb5b9e7a426acbd4dc78cb0263e7fef1a972 | refs/heads/master | 2020-03-28T00:00:17.846073 | 2018-09-05T21:22:29 | 2018-09-05T21:22:29 | 147,367,599 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,744 | 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 Implementations.Messaging;
import Interfaces.Messaging.Message;
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.*;
import Interfaces.Messaging.MessageReceiver;
/**
*
* @author willyp
*/
public class MessageHubTest {
private MessageHub mh;
public MessageHubTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
mh = MessageHub.getInstance();
}
@After
public void tearDown() {
}
/**
* Test of getInstance method, of class MessageHub.
*/
@Test
public void testGetInstance() {
MessageHub expResult = mh;
MessageHub result = MessageHub.getInstance();
assertEquals(expResult, result);
}
/**
* Test of register method, of class MessageHub.
*/
@Test
public void testRegister() {
MessageReceiver reciever = new Implementations.Messaging.MessageReceiver();
MessageHub instance = mh;
instance.register(reciever);
}
/**
* Test of sendMessage method, of class MessageHub.
*/
@Test
public void testSendMessage() {
Object sender = this;
Message incomingMessage = new Implementations.Messaging.Message("This is a cool message");
MessageHub instance = mh;
instance.sendMessage(sender, incomingMessage);
}
}
| [
"[email protected]"
] | |
53fd280049794020b858daa32d0dd5878b29139f | 0eda2d667bf7b248bc97162dd20e1364785758e9 | /code2doc-demo-documentation/src/main/java/de/jcup/code2doc/demo/documentation/usecase/lastbutnotleast/UC_14_NO_LOGIN_DONE.java | 92f6db0dd45b5a38e948a1241c65d4c02ef14b41 | [
"Apache-2.0"
] | permissive | de-jcup/code2doc | ca18d3f42ded255514630ad84a88d52a75410561 | fd02f528bc148122da32c4be63953a7737c5b291 | refs/heads/master | 2021-01-19T01:52:14.370489 | 2016-07-13T07:14:59 | 2016-07-13T07:14:59 | 32,853,913 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,278 | 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 de.jcup.code2doc.demo.documentation.usecase.lastbutnotleast;
import de.jcup.code2doc.api.UseCase;
import de.jcup.code2doc.demo.documentation.security.AnonymousUserRole;
public class UC_14_NO_LOGIN_DONE extends UseCase{
@Override
protected void doSetup(UseCaseSetup useCaseSetup) {
useCaseSetup.setHeadline("No login done");
useCaseSetup.setDescription("The user has not done any login. So he keeps anonymous!");
useCaseSetup.addRole(AnonymousUserRole.class);
}
} | [
"[email protected]"
] | |
79e930fe03de8d5f0b32d142ac49303bee095d9c | 339b79eb11f8f8e69675b9ffd6b7c34700580e42 | /src/processamento/FolderesToTxtFiles.java | c0044d1493d0bcfd17f17a2f464dc5a4505369c8 | [] | no_license | caiosouza/ProcessaBase | 4693421aac73f8c3e7771abd48e3ad66910faca6 | 9d273e314dfa09258ad21050447e48220b6da396 | refs/heads/master | 2016-09-06T09:09:41.704592 | 2014-12-29T17:49:31 | 2014-12-29T17:49:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,805 | java | package processamento;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import util.Arquivo;
public class FolderesToTxtFiles {
//TODO Fazer adaptacoes para receber parametro e para ler de properties
public static void folderesToTxtFiles(String[] args){
String local = System.getProperty("user.dir");
List<String> allTexts = new ArrayList<String>();
List<String> clusterGabaritoOrdem = new ArrayList<String>();
List<String> clusterCategoria = new ArrayList<String>();
List<String> categorias = new ArrayList<String>();
File pastaRaiz = new File(local);
File[] subpastas = pastaRaiz.listFiles();
int clusterId = 0;
for (File pastaAtual : subpastas) {
if (pastaAtual.isDirectory()){
//monta o relacionamento entre cluster e categoria
clusterId = clusterId + 1;
clusterCategoria.add(clusterId + ";"+ pastaAtual.getName());
//gera a lista das categorias
categorias.add(pastaAtual.getName());
File[] arquivosPastaAtual = pastaAtual.listFiles();
for (File arquivoAtual : arquivosPastaAtual) {
//monta a ordem dos documentos no cluster usando a categoria como gabarito
clusterGabaritoOrdem.add(""+ clusterId);
//monta o arquivo contendo todos os documentos separados por uma linha em branco
allTexts.add(Arquivo.contatenaLinhas(Arquivo.abreArquivo(arquivoAtual)));
//coloca uma linha separando cada arquivo
allTexts.add("");
}
}
}
Arquivo.salvaArquivo(allTexts, pastaRaiz+"_allTextTxtFile.txt");
Arquivo.salvaArquivo(clusterGabaritoOrdem, pastaRaiz+"_clusterGabaritoOrdem.txt");
Arquivo.salvaArquivo(clusterCategoria, pastaRaiz+"_clusterCategoria.txt");
Arquivo.salvaArquivo(categorias, pastaRaiz+"_categorias.txt");
}
}
| [
"[email protected]"
] | |
e98ffe646876afa34e02296551726b8a7087778b | 74f220bb490b8b9e3872a72f4fe0dce747c19b2b | /aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/AWSRoboMakerAsyncClient.java | d1c09b300c648de16080e77ccf5273bbdd829f48 | [
"Apache-2.0"
] | permissive | eginez/aws-sdk-java | 13f463d2f801b72bf4b65a54f73dc69b69157cce | fc5034d88b02731361ee12cbc34b600c97793557 | refs/heads/master | 2020-05-22T19:44:49.199107 | 2019-05-13T20:29:27 | 2019-05-13T20:29:27 | 186,497,171 | 1 | 0 | Apache-2.0 | 2019-05-13T21:19:19 | 2019-05-13T21:19:19 | null | UTF-8 | Java | false | false | 49,052 | java | /*
* Copyright 2014-2019 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.robomaker;
import javax.annotation.Generated;
import com.amazonaws.services.robomaker.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing RoboMaker asynchronously. Each asynchronous method will return a Java Future object representing
* the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive notification when
* an asynchronous operation completes.
* <p>
* <p>
* This section provides documentation for the AWS RoboMaker API operations.
* </p>
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSRoboMakerAsyncClient extends AWSRoboMakerClient implements AWSRoboMakerAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSRoboMakerAsyncClientBuilder asyncBuilder() {
return AWSRoboMakerAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on RoboMaker using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSRoboMakerAsyncClient(AwsAsyncClientParams asyncClientParams) {
super(asyncClientParams);
this.executorService = asyncClientParams.getExecutor();
}
/**
* Returns the executor service used by this client to execute async requests.
*
* @return The executor service used by this client to execute async requests.
*/
public ExecutorService getExecutorService() {
return executorService;
}
@Override
public java.util.concurrent.Future<BatchDescribeSimulationJobResult> batchDescribeSimulationJobAsync(BatchDescribeSimulationJobRequest request) {
return batchDescribeSimulationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<BatchDescribeSimulationJobResult> batchDescribeSimulationJobAsync(final BatchDescribeSimulationJobRequest request,
final com.amazonaws.handlers.AsyncHandler<BatchDescribeSimulationJobRequest, BatchDescribeSimulationJobResult> asyncHandler) {
final BatchDescribeSimulationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<BatchDescribeSimulationJobResult>() {
@Override
public BatchDescribeSimulationJobResult call() throws Exception {
BatchDescribeSimulationJobResult result = null;
try {
result = executeBatchDescribeSimulationJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CancelSimulationJobResult> cancelSimulationJobAsync(CancelSimulationJobRequest request) {
return cancelSimulationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<CancelSimulationJobResult> cancelSimulationJobAsync(final CancelSimulationJobRequest request,
final com.amazonaws.handlers.AsyncHandler<CancelSimulationJobRequest, CancelSimulationJobResult> asyncHandler) {
final CancelSimulationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CancelSimulationJobResult>() {
@Override
public CancelSimulationJobResult call() throws Exception {
CancelSimulationJobResult result = null;
try {
result = executeCancelSimulationJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateDeploymentJobResult> createDeploymentJobAsync(CreateDeploymentJobRequest request) {
return createDeploymentJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateDeploymentJobResult> createDeploymentJobAsync(final CreateDeploymentJobRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateDeploymentJobRequest, CreateDeploymentJobResult> asyncHandler) {
final CreateDeploymentJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateDeploymentJobResult>() {
@Override
public CreateDeploymentJobResult call() throws Exception {
CreateDeploymentJobResult result = null;
try {
result = executeCreateDeploymentJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateFleetResult> createFleetAsync(CreateFleetRequest request) {
return createFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateFleetResult> createFleetAsync(final CreateFleetRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateFleetRequest, CreateFleetResult> asyncHandler) {
final CreateFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateFleetResult>() {
@Override
public CreateFleetResult call() throws Exception {
CreateFleetResult result = null;
try {
result = executeCreateFleet(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateRobotResult> createRobotAsync(CreateRobotRequest request) {
return createRobotAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateRobotResult> createRobotAsync(final CreateRobotRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateRobotRequest, CreateRobotResult> asyncHandler) {
final CreateRobotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateRobotResult>() {
@Override
public CreateRobotResult call() throws Exception {
CreateRobotResult result = null;
try {
result = executeCreateRobot(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateRobotApplicationResult> createRobotApplicationAsync(CreateRobotApplicationRequest request) {
return createRobotApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateRobotApplicationResult> createRobotApplicationAsync(final CreateRobotApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateRobotApplicationRequest, CreateRobotApplicationResult> asyncHandler) {
final CreateRobotApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateRobotApplicationResult>() {
@Override
public CreateRobotApplicationResult call() throws Exception {
CreateRobotApplicationResult result = null;
try {
result = executeCreateRobotApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateRobotApplicationVersionResult> createRobotApplicationVersionAsync(CreateRobotApplicationVersionRequest request) {
return createRobotApplicationVersionAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateRobotApplicationVersionResult> createRobotApplicationVersionAsync(
final CreateRobotApplicationVersionRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateRobotApplicationVersionRequest, CreateRobotApplicationVersionResult> asyncHandler) {
final CreateRobotApplicationVersionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateRobotApplicationVersionResult>() {
@Override
public CreateRobotApplicationVersionResult call() throws Exception {
CreateRobotApplicationVersionResult result = null;
try {
result = executeCreateRobotApplicationVersion(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateSimulationApplicationResult> createSimulationApplicationAsync(CreateSimulationApplicationRequest request) {
return createSimulationApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateSimulationApplicationResult> createSimulationApplicationAsync(final CreateSimulationApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateSimulationApplicationRequest, CreateSimulationApplicationResult> asyncHandler) {
final CreateSimulationApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateSimulationApplicationResult>() {
@Override
public CreateSimulationApplicationResult call() throws Exception {
CreateSimulationApplicationResult result = null;
try {
result = executeCreateSimulationApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateSimulationApplicationVersionResult> createSimulationApplicationVersionAsync(
CreateSimulationApplicationVersionRequest request) {
return createSimulationApplicationVersionAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateSimulationApplicationVersionResult> createSimulationApplicationVersionAsync(
final CreateSimulationApplicationVersionRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateSimulationApplicationVersionRequest, CreateSimulationApplicationVersionResult> asyncHandler) {
final CreateSimulationApplicationVersionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateSimulationApplicationVersionResult>() {
@Override
public CreateSimulationApplicationVersionResult call() throws Exception {
CreateSimulationApplicationVersionResult result = null;
try {
result = executeCreateSimulationApplicationVersion(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<CreateSimulationJobResult> createSimulationJobAsync(CreateSimulationJobRequest request) {
return createSimulationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<CreateSimulationJobResult> createSimulationJobAsync(final CreateSimulationJobRequest request,
final com.amazonaws.handlers.AsyncHandler<CreateSimulationJobRequest, CreateSimulationJobResult> asyncHandler) {
final CreateSimulationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<CreateSimulationJobResult>() {
@Override
public CreateSimulationJobResult call() throws Exception {
CreateSimulationJobResult result = null;
try {
result = executeCreateSimulationJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DeleteFleetResult> deleteFleetAsync(DeleteFleetRequest request) {
return deleteFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future<DeleteFleetResult> deleteFleetAsync(final DeleteFleetRequest request,
final com.amazonaws.handlers.AsyncHandler<DeleteFleetRequest, DeleteFleetResult> asyncHandler) {
final DeleteFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DeleteFleetResult>() {
@Override
public DeleteFleetResult call() throws Exception {
DeleteFleetResult result = null;
try {
result = executeDeleteFleet(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DeleteRobotResult> deleteRobotAsync(DeleteRobotRequest request) {
return deleteRobotAsync(request, null);
}
@Override
public java.util.concurrent.Future<DeleteRobotResult> deleteRobotAsync(final DeleteRobotRequest request,
final com.amazonaws.handlers.AsyncHandler<DeleteRobotRequest, DeleteRobotResult> asyncHandler) {
final DeleteRobotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DeleteRobotResult>() {
@Override
public DeleteRobotResult call() throws Exception {
DeleteRobotResult result = null;
try {
result = executeDeleteRobot(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DeleteRobotApplicationResult> deleteRobotApplicationAsync(DeleteRobotApplicationRequest request) {
return deleteRobotApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<DeleteRobotApplicationResult> deleteRobotApplicationAsync(final DeleteRobotApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<DeleteRobotApplicationRequest, DeleteRobotApplicationResult> asyncHandler) {
final DeleteRobotApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DeleteRobotApplicationResult>() {
@Override
public DeleteRobotApplicationResult call() throws Exception {
DeleteRobotApplicationResult result = null;
try {
result = executeDeleteRobotApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DeleteSimulationApplicationResult> deleteSimulationApplicationAsync(DeleteSimulationApplicationRequest request) {
return deleteSimulationApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<DeleteSimulationApplicationResult> deleteSimulationApplicationAsync(final DeleteSimulationApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<DeleteSimulationApplicationRequest, DeleteSimulationApplicationResult> asyncHandler) {
final DeleteSimulationApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DeleteSimulationApplicationResult>() {
@Override
public DeleteSimulationApplicationResult call() throws Exception {
DeleteSimulationApplicationResult result = null;
try {
result = executeDeleteSimulationApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DeregisterRobotResult> deregisterRobotAsync(DeregisterRobotRequest request) {
return deregisterRobotAsync(request, null);
}
@Override
public java.util.concurrent.Future<DeregisterRobotResult> deregisterRobotAsync(final DeregisterRobotRequest request,
final com.amazonaws.handlers.AsyncHandler<DeregisterRobotRequest, DeregisterRobotResult> asyncHandler) {
final DeregisterRobotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DeregisterRobotResult>() {
@Override
public DeregisterRobotResult call() throws Exception {
DeregisterRobotResult result = null;
try {
result = executeDeregisterRobot(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeDeploymentJobResult> describeDeploymentJobAsync(DescribeDeploymentJobRequest request) {
return describeDeploymentJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeDeploymentJobResult> describeDeploymentJobAsync(final DescribeDeploymentJobRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeDeploymentJobRequest, DescribeDeploymentJobResult> asyncHandler) {
final DescribeDeploymentJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeDeploymentJobResult>() {
@Override
public DescribeDeploymentJobResult call() throws Exception {
DescribeDeploymentJobResult result = null;
try {
result = executeDescribeDeploymentJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeFleetResult> describeFleetAsync(DescribeFleetRequest request) {
return describeFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeFleetResult> describeFleetAsync(final DescribeFleetRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeFleetRequest, DescribeFleetResult> asyncHandler) {
final DescribeFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeFleetResult>() {
@Override
public DescribeFleetResult call() throws Exception {
DescribeFleetResult result = null;
try {
result = executeDescribeFleet(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeRobotResult> describeRobotAsync(DescribeRobotRequest request) {
return describeRobotAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeRobotResult> describeRobotAsync(final DescribeRobotRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeRobotRequest, DescribeRobotResult> asyncHandler) {
final DescribeRobotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeRobotResult>() {
@Override
public DescribeRobotResult call() throws Exception {
DescribeRobotResult result = null;
try {
result = executeDescribeRobot(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeRobotApplicationResult> describeRobotApplicationAsync(DescribeRobotApplicationRequest request) {
return describeRobotApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeRobotApplicationResult> describeRobotApplicationAsync(final DescribeRobotApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeRobotApplicationRequest, DescribeRobotApplicationResult> asyncHandler) {
final DescribeRobotApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeRobotApplicationResult>() {
@Override
public DescribeRobotApplicationResult call() throws Exception {
DescribeRobotApplicationResult result = null;
try {
result = executeDescribeRobotApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeSimulationApplicationResult> describeSimulationApplicationAsync(DescribeSimulationApplicationRequest request) {
return describeSimulationApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeSimulationApplicationResult> describeSimulationApplicationAsync(
final DescribeSimulationApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeSimulationApplicationRequest, DescribeSimulationApplicationResult> asyncHandler) {
final DescribeSimulationApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeSimulationApplicationResult>() {
@Override
public DescribeSimulationApplicationResult call() throws Exception {
DescribeSimulationApplicationResult result = null;
try {
result = executeDescribeSimulationApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<DescribeSimulationJobResult> describeSimulationJobAsync(DescribeSimulationJobRequest request) {
return describeSimulationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<DescribeSimulationJobResult> describeSimulationJobAsync(final DescribeSimulationJobRequest request,
final com.amazonaws.handlers.AsyncHandler<DescribeSimulationJobRequest, DescribeSimulationJobResult> asyncHandler) {
final DescribeSimulationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<DescribeSimulationJobResult>() {
@Override
public DescribeSimulationJobResult call() throws Exception {
DescribeSimulationJobResult result = null;
try {
result = executeDescribeSimulationJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListDeploymentJobsResult> listDeploymentJobsAsync(ListDeploymentJobsRequest request) {
return listDeploymentJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListDeploymentJobsResult> listDeploymentJobsAsync(final ListDeploymentJobsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListDeploymentJobsRequest, ListDeploymentJobsResult> asyncHandler) {
final ListDeploymentJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListDeploymentJobsResult>() {
@Override
public ListDeploymentJobsResult call() throws Exception {
ListDeploymentJobsResult result = null;
try {
result = executeListDeploymentJobs(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListFleetsResult> listFleetsAsync(ListFleetsRequest request) {
return listFleetsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListFleetsResult> listFleetsAsync(final ListFleetsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListFleetsRequest, ListFleetsResult> asyncHandler) {
final ListFleetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListFleetsResult>() {
@Override
public ListFleetsResult call() throws Exception {
ListFleetsResult result = null;
try {
result = executeListFleets(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListRobotApplicationsResult> listRobotApplicationsAsync(ListRobotApplicationsRequest request) {
return listRobotApplicationsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListRobotApplicationsResult> listRobotApplicationsAsync(final ListRobotApplicationsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListRobotApplicationsRequest, ListRobotApplicationsResult> asyncHandler) {
final ListRobotApplicationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListRobotApplicationsResult>() {
@Override
public ListRobotApplicationsResult call() throws Exception {
ListRobotApplicationsResult result = null;
try {
result = executeListRobotApplications(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListRobotsResult> listRobotsAsync(ListRobotsRequest request) {
return listRobotsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListRobotsResult> listRobotsAsync(final ListRobotsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListRobotsRequest, ListRobotsResult> asyncHandler) {
final ListRobotsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListRobotsResult>() {
@Override
public ListRobotsResult call() throws Exception {
ListRobotsResult result = null;
try {
result = executeListRobots(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListSimulationApplicationsResult> listSimulationApplicationsAsync(ListSimulationApplicationsRequest request) {
return listSimulationApplicationsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListSimulationApplicationsResult> listSimulationApplicationsAsync(final ListSimulationApplicationsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListSimulationApplicationsRequest, ListSimulationApplicationsResult> asyncHandler) {
final ListSimulationApplicationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListSimulationApplicationsResult>() {
@Override
public ListSimulationApplicationsResult call() throws Exception {
ListSimulationApplicationsResult result = null;
try {
result = executeListSimulationApplications(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListSimulationJobsResult> listSimulationJobsAsync(ListSimulationJobsRequest request) {
return listSimulationJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListSimulationJobsResult> listSimulationJobsAsync(final ListSimulationJobsRequest request,
final com.amazonaws.handlers.AsyncHandler<ListSimulationJobsRequest, ListSimulationJobsResult> asyncHandler) {
final ListSimulationJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListSimulationJobsResult>() {
@Override
public ListSimulationJobsResult call() throws Exception {
ListSimulationJobsResult result = null;
try {
result = executeListSimulationJobs(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(ListTagsForResourceRequest request) {
return listTagsForResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(final ListTagsForResourceRequest request,
final com.amazonaws.handlers.AsyncHandler<ListTagsForResourceRequest, ListTagsForResourceResult> asyncHandler) {
final ListTagsForResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<ListTagsForResourceResult>() {
@Override
public ListTagsForResourceResult call() throws Exception {
ListTagsForResourceResult result = null;
try {
result = executeListTagsForResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<RegisterRobotResult> registerRobotAsync(RegisterRobotRequest request) {
return registerRobotAsync(request, null);
}
@Override
public java.util.concurrent.Future<RegisterRobotResult> registerRobotAsync(final RegisterRobotRequest request,
final com.amazonaws.handlers.AsyncHandler<RegisterRobotRequest, RegisterRobotResult> asyncHandler) {
final RegisterRobotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<RegisterRobotResult>() {
@Override
public RegisterRobotResult call() throws Exception {
RegisterRobotResult result = null;
try {
result = executeRegisterRobot(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<RestartSimulationJobResult> restartSimulationJobAsync(RestartSimulationJobRequest request) {
return restartSimulationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<RestartSimulationJobResult> restartSimulationJobAsync(final RestartSimulationJobRequest request,
final com.amazonaws.handlers.AsyncHandler<RestartSimulationJobRequest, RestartSimulationJobResult> asyncHandler) {
final RestartSimulationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<RestartSimulationJobResult>() {
@Override
public RestartSimulationJobResult call() throws Exception {
RestartSimulationJobResult result = null;
try {
result = executeRestartSimulationJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<SyncDeploymentJobResult> syncDeploymentJobAsync(SyncDeploymentJobRequest request) {
return syncDeploymentJobAsync(request, null);
}
@Override
public java.util.concurrent.Future<SyncDeploymentJobResult> syncDeploymentJobAsync(final SyncDeploymentJobRequest request,
final com.amazonaws.handlers.AsyncHandler<SyncDeploymentJobRequest, SyncDeploymentJobResult> asyncHandler) {
final SyncDeploymentJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<SyncDeploymentJobResult>() {
@Override
public SyncDeploymentJobResult call() throws Exception {
SyncDeploymentJobResult result = null;
try {
result = executeSyncDeploymentJob(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(TagResourceRequest request) {
return tagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(final TagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler<TagResourceRequest, TagResourceResult> asyncHandler) {
final TagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<TagResourceResult>() {
@Override
public TagResourceResult call() throws Exception {
TagResourceResult result = null;
try {
result = executeTagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest request) {
return untagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(final UntagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler<UntagResourceRequest, UntagResourceResult> asyncHandler) {
final UntagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<UntagResourceResult>() {
@Override
public UntagResourceResult call() throws Exception {
UntagResourceResult result = null;
try {
result = executeUntagResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<UpdateRobotApplicationResult> updateRobotApplicationAsync(UpdateRobotApplicationRequest request) {
return updateRobotApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<UpdateRobotApplicationResult> updateRobotApplicationAsync(final UpdateRobotApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<UpdateRobotApplicationRequest, UpdateRobotApplicationResult> asyncHandler) {
final UpdateRobotApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<UpdateRobotApplicationResult>() {
@Override
public UpdateRobotApplicationResult call() throws Exception {
UpdateRobotApplicationResult result = null;
try {
result = executeUpdateRobotApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future<UpdateSimulationApplicationResult> updateSimulationApplicationAsync(UpdateSimulationApplicationRequest request) {
return updateSimulationApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future<UpdateSimulationApplicationResult> updateSimulationApplicationAsync(final UpdateSimulationApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler<UpdateSimulationApplicationRequest, UpdateSimulationApplicationResult> asyncHandler) {
final UpdateSimulationApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable<UpdateSimulationApplicationResult>() {
@Override
public UpdateSimulationApplicationResult call() throws Exception {
UpdateSimulationApplicationResult result = null;
try {
result = executeUpdateSimulationApplication(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending
* asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should
* call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to
* calling this method.
*/
@Override
public void shutdown() {
super.shutdown();
executorService.shutdownNow();
}
}
| [
""
] | |
84cb643ea7eb7d18be6b209f51ea9aeeddb2a82e | 3aac66d35ea909b25f3c4875819112e7c77157b9 | /app/src/main/java/com/bbva/intranet/behappy/models/EventosAdapter.java | 85cd1add0e6f46c3aaf2ee2a7336dc9199b7e055 | [] | no_license | CapGemeni/BeHappy | f0b59c6840e89f28e77d166d2ce4fc6096c0f0b0 | 3f4cf309a9d34096aa09d55c3179bfbd9589d8b8 | refs/heads/master | 2021-04-09T03:54:32.034766 | 2018-03-15T22:43:23 | 2018-03-15T22:43:23 | 125,407,012 | 0 | 0 | null | 2018-03-15T22:43:24 | 2018-03-15T18:01:37 | Java | UTF-8 | Java | false | false | 1,049 | java | package com.bbva.intranet.behappy.models;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.bbva.intranet.behappy.modules.eventos.HistorialEventosFragment;
import com.bbva.intranet.behappy.modules.eventos.HistorialFragment;
import com.bbva.intranet.behappy.modules.eventos.ProximosFragment;
/**
* Created by Martin Vega on 09/03/2018.
*/
public class EventosAdapter extends FragmentStatePagerAdapter {
private int numberOfTaps;
public EventosAdapter(FragmentManager fm, int numberOfTaps) {
super(fm);
this.numberOfTaps = numberOfTaps;
}
@Override
public Fragment getItem(int position) {
switch ( position){
case 0 :
return new ProximosFragment();
case 1:
return new HistorialFragment();
default:
return null;
}
}
@Override
public int getCount() {
return numberOfTaps;
}
}
| [
"[email protected]"
] | |
5767f1df81025744e101162f5e3f776917836562 | 0fd8b323dac5b32dde440985bad39d2285ef3cfc | /src/main/java/com/uv/app/service/dto/UserDTO.java | 3ce2c832fd14a97fe2921d4ef2e1ca70481539ab | [] | no_license | BulkSecurityGeneratorProject/UnlimitedVoucher | d41736d75ddb59fc07625142e1fe3e2d209b2727 | 800d9897d5f400ad9ab90adcff0a5d9360702472 | refs/heads/master | 2022-12-20T18:51:00.827079 | 2018-01-04T13:36:58 | 2018-01-04T13:36:58 | 296,586,322 | 0 | 0 | null | 2020-09-18T10:14:43 | 2020-09-18T10:14:42 | null | UTF-8 | Java | false | false | 4,605 | java | package com.uv.app.service.dto;
import com.uv.app.config.Constants;
import com.uv.app.domain.Authority;
import com.uv.app.domain.User;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.*;
import java.time.Instant;
import java.util.Set;
import java.util.stream.Collectors;
/**
* A DTO representing a user, with his authorities.
*/
public class UserDTO {
private Long id;
@NotBlank
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 100)
private String login;
@Size(max = 50)
private String firstName;
@Size(max = 50)
private String lastName;
@Email
@Size(min = 5, max = 100)
private String email;
@Size(max = 256)
private String imageUrl;
private boolean activated = false;
@Size(min = 2, max = 6)
private String langKey;
private String createdBy;
private Instant createdDate;
private String lastModifiedBy;
private Instant lastModifiedDate;
private Set<String> authorities;
public UserDTO() {
// Empty constructor needed for Jackson.
}
public UserDTO(User user) {
this.id = user.getId();
this.login = user.getLogin();
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
this.email = user.getEmail();
this.activated = user.getActivated();
this.imageUrl = user.getImageUrl();
this.langKey = user.getLangKey();
this.createdBy = user.getCreatedBy();
this.createdDate = user.getCreatedDate();
this.lastModifiedBy = user.getLastModifiedBy();
this.lastModifiedDate = user.getLastModifiedDate();
this.authorities = user.getAuthorities().stream()
.map(Authority::getName)
.collect(Collectors.toSet());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public boolean isActivated() {
return activated;
}
public void setActivated(boolean activated) {
this.activated = activated;
}
public String getLangKey() {
return langKey;
}
public void setLangKey(String langKey) {
this.langKey = langKey;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public Set<String> getAuthorities() {
return authorities;
}
public void setAuthorities(Set<String> authorities) {
this.authorities = authorities;
}
@Override
public String toString() {
return "UserDTO{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated=" + activated +
", langKey='" + langKey + '\'' +
", createdBy=" + createdBy +
", createdDate=" + createdDate +
", lastModifiedBy='" + lastModifiedBy + '\'' +
", lastModifiedDate=" + lastModifiedDate +
", authorities=" + authorities +
"}";
}
}
| [
"[email protected]"
] | |
d3099d8a52363ad4cd653e12269fd4f216f919ce | 06aee0e3dbb456c57fa92bc184f9af36c425d322 | /book-records/book-records-ejb/src/main/java/pit/kos/book/ejb/entity/Author.java | f283ce51c170ae80036f3e6cf07885ba2ff2f620 | [] | no_license | piotrkosyoo/javaee | 7a9805cedc6455bdaa6e2a6d0e6052e6eb2fd64b | 85821862456262c979cc22e42485314a5029b047 | refs/heads/master | 2021-01-10T06:16:50.324661 | 2016-03-21T20:23:12 | 2016-03-21T20:23:12 | 52,219,777 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,950 | java | /**
*
*/
package pit.kos.book.ejb.entity;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;
/**
* @author Piotr Kosmala
*18 mar 2016
*20:02:23
*/
@Entity(name="author")
@Table(name="author")
@NamedQueries(value = {
@NamedQuery(name="Author.findauthor", query="SELECT a FROM author a where lower(a.forename)=:forename and lower(a.surname)=:surname")
})
public class Author implements Serializable {
private static final long serialVersionUID = 2680439161315466265L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id_author;
@NotNull
@Column(name = "forename")
@Size(min=1,max=40,message="Size forename must be between 1 and 40")
private String forename;
@NotNull
@Column(name = "surname")
@Size(min=2,max=40,message="Size surname must be between 2 and 40")
private String surname;
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="author")
private List<Book> books;
public Author() {
}
public Long getId_author() {
return id_author;
}
public void setId_author(Long id_author) {
this.id_author = id_author;
}
public String getForename() {
return forename;
}
public void setForename(String forename) {
this.forename = forename;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public List<Book> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
this.books = books;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((forename == null) ? 0 : forename.hashCode());
result = prime * result
+ ((id_author == null) ? 0 : id_author.hashCode());
result = prime * result + ((surname == null) ? 0 : surname.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Author other = (Author) obj;
if (forename == null) {
if (other.forename != null)
return false;
} else if (!forename.equals(other.forename))
return false;
if (id_author == null) {
if (other.id_author != null)
return false;
} else if (!id_author.equals(other.id_author))
return false;
if (surname == null) {
if (other.surname != null)
return false;
} else if (!surname.equals(other.surname))
return false;
return true;
}
}
| [
"[email protected]"
] | |
5caf681b7ea95bc63af8c41339dc49fea2dfc36d | 3be5b9b42e3e36f5ca996a6e1c10ae48767a7f64 | /L2J_SunriseProject_Data/dist/game/data/scripts/quests/Q00112_WalkOfFate/Q00112_WalkOfFate.java | c32df43c79c6c77db270ca8e28c2cd3e883a922a | [] | no_license | flbzs/sunrise-dp | 28b560da569a7514a30100ddd8af1db8072b46f3 | a7f977932f7e4bc79de48154b7e0ea853c215485 | refs/heads/master | 2022-12-19T01:30:35.705014 | 2020-09-12T00:01:24 | 2020-09-12T00:01:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,889 | java | /*
* Copyright (C) 2004-2013 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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 quests.Q00112_WalkOfFate;
import l2r.gameserver.model.actor.L2Npc;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.quest.Quest;
import l2r.gameserver.model.quest.QuestState;
import l2r.gameserver.model.quest.State;
/**
* Walk of Fate (112)
* @author Zoey76
*/
public class Q00112_WalkOfFate extends Quest
{
// NPCs
private static final int LIVINA = 30572;
private static final int KARUDA = 32017;
// Item
private static final int SCROLL_ENCHANT_ARMOR_D_GRADE = 956;
// Misc
private static final int MIN_LEVEL = 20;
public Q00112_WalkOfFate()
{
super(112, Q00112_WalkOfFate.class.getSimpleName(), "Walk of Fate");
addStartNpc(LIVINA);
addTalkId(LIVINA, KARUDA);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = player.getQuestState(getName());
if ((st == null) || (player.getLevel() < MIN_LEVEL))
{
return null;
}
String htmltext = null;
switch (event)
{
case "30572-04.htm":
{
st.startQuest();
htmltext = event;
break;
}
case "32017-02.html":
{
st.giveAdena(22308, true);
st.addExpAndSp(112876, 5774);
st.giveItems(SCROLL_ENCHANT_ARMOR_D_GRADE, 1);
st.exitQuest(false, true);
htmltext = event;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState st = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (st == null)
{
return htmltext;
}
switch (st.getState())
{
case State.CREATED:
htmltext = (player.getLevel() < MIN_LEVEL) ? "30572-03.html" : "30572-01.htm";
break;
case State.STARTED:
switch (npc.getId())
{
case LIVINA:
{
htmltext = "30572-05.html";
break;
}
case KARUDA:
{
htmltext = "32017-01.html";
break;
}
}
break;
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
return htmltext;
}
}
| [
"vGodFather@7628a37d-9d16-49c9-a037-77158a4058ea"
] | vGodFather@7628a37d-9d16-49c9-a037-77158a4058ea |
b85371eccdbec7cbcbe768b87f4b2d44c55702f3 | 6e3583e33679734f26acf6188512afb8b620dbe9 | /src/JavaBasics/dateDemo.java | 4c2655dd224d7215ebe08c98746a6ade244da4b8 | [] | no_license | Shanshan1980/CoreJava | cf7d85227f9202d32bf8948b7ae806366bddcbfe | b8c7808bde8549f5ddab60c1898c71c8d20b5ab3 | refs/heads/master | 2023-02-22T21:20:57.099555 | 2021-01-31T23:06:42 | 2021-01-31T23:06:42 | 334,775,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package JavaBasics;
import java.text.SimpleDateFormat;
import java.util.Date;
public class dateDemo {
public static void main(String[] args) {
Date d=new Date();
SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf2=new SimpleDateFormat("yyyy.MMMM.dd hh:mm:ss");
System.out.println(sdf1.format(d));
System.out.println(sdf2.format(d));
System.out.println(d.toString());
}
}
| [
"[email protected]"
] | |
0cee562a48c6beaa864a241c18b5308c6c58ed3f | ab7857781114ff7bf28c0549ff53df541bb8b51a | /epicamweb/src/main/java/org/imogene/epicam/domain/entity/backup/ExamenSerologieBck.java | 3ea3ca9805a73fafe59fbd067c29b4da81d5c4c5 | [] | no_license | ummiscolirima/epicam_tb | e367eeebb02e69060fc435ac43b4ef6e58af090a | df0faf27cebcce49888485eb6481bfe4ed4a8658 | refs/heads/master | 2021-01-10T02:02:38.000112 | 2015-11-01T23:23:03 | 2015-11-01T23:23:03 | 45,359,211 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,770 | java | package org.imogene.epicam.domain.entity.backup;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.imogene.lib.common.entity.GeoField;
import org.imogene.lib.common.entity.ImogBeanImpl;
import org.imogene.lib.common.entity.ImogBeanBck;
import org.imogene.epicam.domain.entity.LocalizedText;
/**
* ImogBean implementation for the entity ExamenSerologie Backup
* @author MEDES-IMPS
*/
@Entity
@Table(name = "ExamenSerologie_Bck")
public class ExamenSerologieBck extends ImogBeanBck {
private static final long serialVersionUID = -1938499601683805156L;
/* Description group fields */
private String patient;
@Temporal(TemporalType.TIMESTAMP)
private Date dateTest;
private String nature;
private String resultatVIH;
private Integer resultatCD4;
/**
* Constructor
*/
public ExamenSerologieBck() {
}
/* Getters and Setters for Description group fields */
public String getPatient() {
return patient;
}
public void setPatient(String value) {
patient = value;
}
public Date getDateTest() {
return dateTest;
}
public void setDateTest(Date value) {
dateTest = value;
}
public String getNature() {
return nature;
}
public void setNature(String value) {
nature = value;
}
public String getResultatVIH() {
return resultatVIH;
}
public void setResultatVIH(String value) {
resultatVIH = value;
}
public Integer getResultatCD4() {
return resultatCD4;
}
public void setResultatCD4(Integer value) {
resultatCD4 = value;
}
}
| [
"[email protected]"
] | |
4a1254226ab52dbaa9249789032ec5a335aae7a4 | b8bfc6d7a1a18cf23ce0550dbe25c24de84af2a3 | /FinalProject1/app/src/main/java/com/example/paloma/finalproject1/DBOpenHelper.java | 483b0a6c148155e73671b922cd0b5a4c031f8556 | [] | no_license | paloma316/Artigos | 2c190b53b6f6f3447af188f17462a131c078e39f | 532b8ee3ae0564aa8571ce244f458b91f4aa9c8b | refs/heads/master | 2020-03-19T19:21:32.423175 | 2018-06-10T23:54:59 | 2018-06-10T23:54:59 | 136,851,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,838 | java | package com.example.paloma.finalproject1;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
public class DBOpenHelper extends SQLiteOpenHelper{
public static final String database_name="Questions.db";
public static final String table_name="table_questions";
public static final String col1="Id";
public static final String col2="Question";
public static final String col3="op1";
public static final String col4="op2";
public static final String col5="op3";
public static final String col6="op4";
public static final String col7="subject";
public static final String col8="answer_nr";
public SQLiteDatabase db;
public DBOpenHelper(Context context) {
super(context, database_name, null, 1);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
this.db=sqLiteDatabase;
// db=getWritableDatabase();
final String SQL_Create_Table="create table "+table_name + " ( Id integer primary key autoincrement ,Question text," +
" op1 text, op2 text,op3 text,op4 text ,subject text,answer_nr integer ) " ;
db.execSQL(SQL_Create_Table);
fillQuestion();
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
db.execSQL( "drop table if exists "+table_name);
onCreate(db);
}
//public Question(String question, String op1, String op2, String op3, String op4, String subject, int answer_nr)
public void fillQuestion(){
Question qL1= new Question(" what is the portuguese language code?","pt","pg","en","gp","language",1);
Question qL2=new Question("how to say \"good-bye\" in portuguese?","ola","bem-vindo","meus","adeus","language",4);
Question qL3=new Question("how many countries has portuguese as official language?","5","10","3","6","language",2);
Question qL4=new Question("when was adopted the portuguese as the official language of Portugal","1290","1390","1490","1920","language",1);
Question qL5=new Question("which language is similar to portuguese?","chinese","german","spanish","turkish","language",3);
Question qG1=new Question("where is Portugal located?","northern europe","southwestern europe","northeastern","north europe","geograph",2);
Question qG2= new Question("which country borders Portugal?","France","England","Spain","Germany","geograph",3);
Question qG3= new Question("what is the percentage of population in Portugal?","around 10,379,573","around 11,379,573","around 12,379,573","around 13,379,573 ","geograph",1);
Question qG4= new Question("what is the capital of portugal?","lisbon","porto","coimbra","faro","geograph",1);
Question qG5= new Question("what kind of climate does Portugal have?","tropical","desert","a Mediterranean climate ","sub-artic","geograph",3);
Question qH1=new Question("In what year did Portugal host the world expo?","1990","1994","1999","1998","history",3);
Question qH2=new Question("who was Camoes?","portuguese politician","portuguese poet","portuguese painter","portuguese famous","history",2);
Question qH3=new Question("who discovered Brasil?","Pedro Alvares Cabral","Joao de Santarem","Vasco da Gama","Crsitovao Colombo","history",1);
Question qH4 = new Question("who discovered the path to India?","Pero Escobar","Vasco da Gama","Pedro Alvares Cabral","Marcelo Rebelo de Sousa","history",2);
Question qH5= new Question("When Sao tome and principe became an independent country?","1778","1889","1775","1774","history",3);
addQuestion(qL1);
addQuestion(qL2);
addQuestion(qL3);
addQuestion(qL4);
addQuestion(qL5);
addQuestion(qG1);
addQuestion(qG2);
addQuestion(qG3);
addQuestion(qG4);
addQuestion(qG5);
addQuestion(qH1);
addQuestion(qH2);
addQuestion(qH3);
addQuestion(qH4);
addQuestion(qH5);
}
public boolean addQuestion(Question q){
ContentValues cv= new ContentValues();
cv.put(col2,q.getQuestion());
cv.put(col3,q.getOp1());
cv.put(col4,q.getOp2());
cv.put(col5,q.getOp3());
cv.put(col6,q.getOp4());
cv.put(col7,q.getSubject());
cv.put(col8,q.getAnswer_nr());
// db.insert(table_name,null,cv);
long result = db.insert(table_name,null ,cv);
if(result == -1)
return false;
else
return true;
}
public List<Question> getAllQuestion(String subject1){
// public List<Question> getAllQuestion(){
List<Question> questionList=new ArrayList<>();
db=getReadableDatabase();
Cursor c=db.rawQuery("Select * from "+table_name + " where subject = '"+subject1+"' " ,null);
// Cursor c=db.rawQuery("Select * from "+table_name ,null);
if(c.moveToFirst()){
do{
Question q= new Question();
q.setQuestion(c.getString(c.getColumnIndex(col2)));
q.setOp1(c.getString(c.getColumnIndex(col3)));
q.setOp2(c.getString(c.getColumnIndex(col4)));
q.setOp3(c.getString(c.getColumnIndex(col5)));
q.setOp4(c.getString(c.getColumnIndex(col6)));
q.setSubject(c.getString(c.getColumnIndex(col7)));
q.setAnswer_nr(c.getInt(c.getColumnIndex(col8)));
questionList.add(q);
}while(c.moveToNext());
}
c.close();
return questionList;
}
//achieve the data from database
/* public List<Question> getAllQuestions(String subject){
}*/
}
| [
"[email protected]"
] | |
4a8b5b362de3cf0c9fc1f2d067d91f928586e823 | b889b7a9eab94940ef8a90f42bdced09f710e39c | /app/src/main/java/com/jiangziandroid/zhihuspider/ui/SlideImageFragment.java | 5e564de60a13d5a4cc8a627d662348d5caaa9af9 | [] | no_license | JeremyYCJiang/ZhihuSpider | 5f4d89e528d3cb1108830da83545c03fc560870b | 13628bb2429fe6986b2386bf46f04ff529c11bfd | refs/heads/master | 2018-12-31T20:29:48.820246 | 2015-06-11T16:12:47 | 2015-06-11T16:12:47 | 35,292,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,960 | java | package com.jiangziandroid.zhihuspider.ui;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.jiangziandroid.zhihuspider.R;
import com.squareup.picasso.Picasso;
// Create a Fragment class that returns the layout that you just created in the onCreateView() method.
// You can then create instances of this fragment in the parent activity whenever you need a new page
// to display to the user:
public class SlideImageFragment extends Fragment{
protected ImageView mImageView;
protected TextView mTextView;
protected long mStoryId;
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup rootView = (ViewGroup) inflater.inflate(
R.layout.slide_image, container, false);
mImageView = (ImageView) rootView.findViewById(R.id.fragmentImageView);
mTextView = (TextView) rootView.findViewById(R.id.fragmentTextView);
rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), StoryActivity.class);
intent.putExtra("StoryId", mStoryId);
startActivity(intent);
}
});
return rootView;
}
@Override
public void onResume() {
super.onResume();
Bundle bundle = this.getArguments();
mStoryId = bundle.getLong("StoryId");
String imageStringUri = bundle.getString("ImageStringUri");
String imageTitle = bundle.getString("ImageTitle");
Picasso.with(getActivity()).load(imageStringUri).into(mImageView);
mTextView.setText(imageTitle);
}
} | [
"[email protected]"
] | |
8eab09d437b2c274c94ff4ae00d55507b3c275a7 | 7b94fb9c98d85d17668fbf775f540cb2feefd26b | /src/observable/TwitterSenior.java | 5879c9fc7f1e47d11a2bf7884f41136dd7029bb0 | [] | no_license | Fyziik/Observer-Pattern-Example | 902207d4d03e18d471445d38a7aa5aa8a53b55fa | 716f57c92b44ca79e5d3df91d00fdad0bb19237a | refs/heads/main | 2023-02-03T22:13:24.255926 | 2020-12-27T23:31:00 | 2020-12-27T23:31:00 | 324,868,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package observable;
public class TwitterSenior implements ITwitterApps {
@Override
public void update(String tweet) {
System.out.println("Senior says: " + tweet);
}
}
| [
"[email protected]"
] | |
5f5be5d3ed6366399b787f5a84aea887744a8a9c | a346793c3a1c85e3d711f181adcf0e26d5dd1967 | /src/main/java/com/example/demo/controller/PersonController.java | 4a835dabd9803d28284cb2e21b3f95c7692dbc02 | [] | no_license | otinu/RememberYou | 5520d51dc38a3fa48e732590c2483020f00d3f3e | 42cecb39c60cf691cf24472e399ffa82461dd1ff | refs/heads/master | 2023-08-24T20:45:58.664429 | 2021-11-04T09:36:37 | 2021-11-04T09:36:37 | 415,885,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | package com.example.demo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import com.example.demo.model.Person;
import com.example.demo.repository.PersonRepository;
@Controller
public class PersonController {
private final PersonRepository repository;
public PersonController(PersonRepository repository) {
this.repository = repository;
}
@GetMapping("/")
// もし、「getAllPeople」に変更したらエラー発生する?」
public String getAllPersons(@ModelAttribute Person person, Model model) {
model.addAttribute("persons", repository.findAll());
return "list";
}
}
| [
"[email protected]"
] | |
1bab752c1527a45d9391a6f17bc3225ab0eb41f1 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-codebuild/src/main/java/com/amazonaws/services/codebuild/model/transform/DescribeCodeCoveragesResultJsonUnmarshaller.java | b6c989a96aa6831b582ef772b1c07775b07d9232 | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 3,232 | java | /*
* Copyright 2018-2023 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.codebuild.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.codebuild.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DescribeCodeCoveragesResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeCodeCoveragesResultJsonUnmarshaller implements Unmarshaller<DescribeCodeCoveragesResult, JsonUnmarshallerContext> {
public DescribeCodeCoveragesResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DescribeCodeCoveragesResult describeCodeCoveragesResult = new DescribeCodeCoveragesResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return describeCodeCoveragesResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("nextToken", targetDepth)) {
context.nextToken();
describeCodeCoveragesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("codeCoverages", targetDepth)) {
context.nextToken();
describeCodeCoveragesResult.setCodeCoverages(new ListUnmarshaller<CodeCoverage>(CodeCoverageJsonUnmarshaller.getInstance())
.unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return describeCodeCoveragesResult;
}
private static DescribeCodeCoveragesResultJsonUnmarshaller instance;
public static DescribeCodeCoveragesResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DescribeCodeCoveragesResultJsonUnmarshaller();
return instance;
}
}
| [
""
] | |
e28341852f15d08e3b8cd37a2048847b4353586f | bfd45ffd535ded031fca88aeb22f1198ed16100f | /app/src/main/java/com/example/corona_tracker/EnterData.java | 85f9a7f478c590962b8dce65204e45b16140990e | [] | no_license | pooya98/Corona_tracker | c80313ad4d72fa273de79934ef38d5a9314ae7ab | 00dd2d1de27c1c6cfb94997a69dff8b25d79f124 | refs/heads/master | 2023-01-22T13:28:11.850756 | 2020-12-10T18:30:41 | 2020-12-10T18:30:41 | 310,264,395 | 0 | 0 | null | 2020-12-05T09:48:19 | 2020-11-05T10:29:40 | Java | UTF-8 | Java | false | false | 826 | java | package com.example.corona_tracker;
public class EnterData {
private String user_id;
private String user_phone;
private String enter_time;
public EnterData(String user_id, String user_phone, String enter_time) {
this.user_id = user_id;
this.user_phone = user_phone;
this.enter_time = enter_time;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getUser_phone() {
return user_phone;
}
public void setUser_phone(String user_phone) {
this.user_phone = user_phone;
}
public String getEnter_time() {
return enter_time;
}
public void setEnter_time(String enter_time) {
this.enter_time = enter_time;
}
}
| [
"[email protected]"
] | |
33c944fed099c998d3083e0460dbd73472f47748 | 07fb3d2c6260ad2792e527cb06ec2bc18d79f71d | /src/com/common/annotation/AuthorAnnotation.java | b45caf59e1b8df1d44a9ff1acb48866f43d0cdb6 | [] | no_license | jibingbing123/CommonClass | d0a663dc88031ba9b34e3bfdf587fb14db7422c9 | 6566d55fb4954e596133b75c33b077c792928d91 | refs/heads/master | 2020-03-27T10:14:41.148984 | 2018-08-28T07:03:38 | 2018-08-28T07:03:38 | 146,405,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java | package com.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @description:
* @author: jibingbing
* @create: 2018/01/31
**/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface AuthorAnnotation {
String name();
String company();
}
| [
"[email protected]"
] | |
f002d828118cffc1d65897343c5871e4f484a987 | 431f3bdf45897ee07da07f9644042e1fa9f134f7 | /sdingmenufony/src/main/java/com/fony/menu/widget/slidingmenu/BaseSdingActivity.java | 55e34ce8bb8bc96a722f6a162f48afde57a374ff | [] | no_license | superfony/WZDPS | 3dc8aed886c3413eb76803149762dc5a58ee5dee | 266eafdfe9b1cdc8d3825832b3a4efcd8df592d3 | refs/heads/master | 2021-01-10T03:09:50.951695 | 2015-12-02T08:39:20 | 2015-12-02T08:39:20 | 47,248,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,553 | java | package com.fony.menu.widget.slidingmenu;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import com.fony.menu.sding.R;
import com.fony.menu.widget.slidingmenu.app.SlidingFragmentActivity;
import com.fony.menu.widget.slidingmenu.basic.SlidingMenu;
import com.fony.menu.widget.slidingmenu.basic.SlidingMenu.OnClosedListener;
import com.fony.menu.widget.slidingmenu.basic.SlidingMenu.OnOpenedListener;
import com.fony.menu.widget.slidingmenu.fragment.ActivityUtils;
import com.fony.menu.widget.slidingmenu.fragment.SlidingMenuFragment;
public class BaseSdingActivity extends SlidingFragmentActivity implements
OnClickListener {
protected Fragment mContent;
protected FrameLayout sdingCloseBar;
protected SlidingMenu sm;
public void setSmGone() {
// sm.setBehindWidth(0);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
sdingCloseBar.setVisibility(View.GONE);
}
public void setSmShow() {
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
// sm.setBehindWidth(185);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initSdingBar(savedInstanceState);
// 初始化菜单布局
setBehindContentView(R.layout.slide_frame_menu);
FragmentTransaction fragmentTransaction = getSupportFragmentManager()
.beginTransaction();
SlidingMenuFragment menuFragment = addSlidingMenuFragment();
fragmentTransaction.replace(R.id.menu, menuFragment);
fragmentTransaction.commit();
initSlidingMenu();
}
protected void initSdingBar(Bundle savedInstanceState) {
// 设置主视图界面
// ActivityUtils.requestNotTitleBar(this);
setContentView(R.layout.sding_content_fragment);
getSupportFragmentManager().beginTransaction()
.replace(R.id.content, mContent).commit();
sdingCloseBar = (FrameLayout) findViewById(R.id.sding_close_side_lay);
}
/**
* 不是具体的实现
*
* @return
*/
public SlidingMenuFragment addSlidingMenuFragment() {
SlidingMenuFragment menuFragment = new SlidingMenuFragment();
return menuFragment;
}
/**
* 切换Fragment,也是切换视图的内容
*/
public void switchContent(Fragment fragment) {
mContent = fragment;
getSupportFragmentManager().beginTransaction()
.replace(R.id.content, fragment).commit();
getSlidingMenu().showContent();
}
/**
* 关闭时显示sdingBar
*
* @param sdingBar
*/
public void visibleSdingBar() {
TranslateAnimation mShowAction = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f);
mShowAction.setDuration(500);
sdingCloseBar.setAnimation(mShowAction);
sdingCloseBar.setVisibility(View.VISIBLE);
}
public void invisibleSdingBar() {
sdingCloseBar.setVisibility(View.INVISIBLE);
}
public void goneSdingBar() {
TranslateAnimation mHiddenAction = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
-1.0f, Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f);
mHiddenAction.setDuration(500);
sdingCloseBar.setAnimation(mHiddenAction);
sdingCloseBar.setVisibility(View.GONE);
}
public void initSlidingMenu() {
setSlidingActionBarEnabled(false);
sm = getSlidingMenu();
sm.setMode(SlidingMenu.LEFT);
sm.setBehindWidth(185);
sm.setFadeDegree(0.35f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
sm.setOnClosedListener(new OnClosedListener() {
@Override
public void onClosed() {
visibleSdingBar();
}
});
sm.setOnOpenedListener(new OnOpenedListener() {
@Override
public void onOpened() {
goneSdingBar();
}
});
}
/**
* 销毁之前
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
getSupportFragmentManager().putFragment(outState, "mContent", mContent);
}
@Override
public void onClick(View v) {
toggle();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (getSlidingMenu().isMenuShowing()) {
toggle();
return true;
}
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
toggle();
return true;
}
return super.onKeyDown(keyCode, event);
}
} | [
"[email protected]"
] | |
30b5e9d6eb5fdb27405d9e6ae3d5676191ebf03e | bdc424c6715e71d955d37766e7eeec0267c0f177 | /RebelsTransfer/src/main/java/commandSenders/APICallSender.java | b521d6daa4a9bba42be4e4311a9e5531e864a361 | [] | no_license | SvanSomeren/MinecraftMods | e29c73bb47e97bdbca59fd3a32618325afeb060d | 6b660d039512ebbc416fb36199ec3848d5570e62 | refs/heads/master | 2021-07-09T16:15:07.442152 | 2019-08-18T21:49:30 | 2019-08-18T21:49:30 | 197,075,931 | 0 | 0 | null | 2020-10-13T14:42:57 | 2019-07-15T21:38:01 | Java | UTF-8 | Java | false | false | 9,507 | java | package commandSenders;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.conversations.Conversation;
import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.entity.Player;
import org.bukkit.permissions.*;
import org.bukkit.plugin.Plugin;
import java.util.*;
public class APICallSender extends Observable implements ConsoleCommandSender {
private ServerOperator opable;
private Permissible parent = this;
private final List<PermissionAttachment> attachments = new LinkedList<PermissionAttachment>();
private final Map<String, PermissionAttachmentInfo> permissions = new HashMap<String, PermissionAttachmentInfo>();
private Player player;
private String blocksToSpend;
public APICallSender( ServerOperator opable, Player player) {
this.opable = opable;
this.player = player;
if (opable instanceof Permissible) {
this.parent = (Permissible) opable;
}
recalculatePermissions();
}
public void setBlocksToSpend(String blocksToSpend) {
synchronized (this) {
this.blocksToSpend = blocksToSpend;
}
setChanged();
notifyObservers();
}
public synchronized String getSomeVariable() {
return blocksToSpend;
}
@Override
public boolean isOp() {
return true;
}
@Override
public void setOp(boolean value) {
if (opable == null) {
throw new UnsupportedOperationException("Cannot change op value as no ServerOperator is set");
} else {
opable.setOp(value);
}
}
@Override
public boolean isPermissionSet( String name) {
if (name == null) {
throw new IllegalArgumentException("Permission name cannot be null");
}
return permissions.containsKey(name.toLowerCase(java.util.Locale.ENGLISH));
}
@Override
public boolean isPermissionSet( Permission perm) {
if (perm == null) {
throw new IllegalArgumentException("Permission cannot be null");
}
return isPermissionSet(perm.getName());
}
@Override
public boolean hasPermission( String inName) {
if (inName == null) {
throw new IllegalArgumentException("Permission name cannot be null");
}
String name = inName.toLowerCase(java.util.Locale.ENGLISH);
if (isPermissionSet(name)) {
return permissions.get(name).getValue();
} else {
Permission perm = Bukkit.getServer().getPluginManager().getPermission(name);
if (perm != null) {
return perm.getDefault().getValue(isOp());
} else {
return Permission.DEFAULT_PERMISSION.getValue(isOp());
}
}
}
@Override
public boolean hasPermission( Permission perm) {
if (perm == null) {
throw new IllegalArgumentException("Permission cannot be null");
}
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
if (isPermissionSet(name)) {
return permissions.get(name).getValue();
}
return perm.getDefault().getValue(isOp());
}
@Override
public PermissionAttachment addAttachment( Plugin plugin, String name, boolean value) {
if (name == null) {
throw new IllegalArgumentException("Permission name cannot be null");
} else if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
} else if (!plugin.isEnabled()) {
throw new IllegalArgumentException("Plugin " + plugin.getDescription().getFullName() + " is disabled");
}
PermissionAttachment result = addAttachment(plugin);
result.setPermission(name, value);
recalculatePermissions();
return result;
}
@Override
public PermissionAttachment addAttachment( Plugin plugin) {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
} else if (!plugin.isEnabled()) {
throw new IllegalArgumentException("Plugin " + plugin.getDescription().getFullName() + " is disabled");
}
PermissionAttachment result = new PermissionAttachment(plugin, parent);
attachments.add(result);
recalculatePermissions();
return result;
}
@Override
public void removeAttachment( PermissionAttachment attachment) {
if (attachment == null) {
throw new IllegalArgumentException("Attachment cannot be null");
}
if (attachments.contains(attachment)) {
attachments.remove(attachment);
PermissionRemovedExecutor ex = attachment.getRemovalCallback();
if (ex != null) {
ex.attachmentRemoved(attachment);
}
recalculatePermissions();
} else {
throw new IllegalArgumentException("Given attachment is not part of Permissible object " + parent);
}
}
@Override
public void recalculatePermissions() {
clearPermissions();
Set<Permission> defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp());
Bukkit.getServer().getPluginManager().subscribeToDefaultPerms(isOp(), parent);
for (Permission perm : defaults) {
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
permissions.put(name, new PermissionAttachmentInfo(parent, name, null, true));
Bukkit.getServer().getPluginManager().subscribeToPermission(name, parent);
calculateChildPermissions(perm.getChildren(), false, null);
}
for (PermissionAttachment attachment : attachments) {
calculateChildPermissions(attachment.getPermissions(), false, attachment);
}
}
public synchronized void clearPermissions() {
Set<String> perms = permissions.keySet();
for (String name : perms) {
Bukkit.getServer().getPluginManager().unsubscribeFromPermission(name, parent);
}
Bukkit.getServer().getPluginManager().unsubscribeFromDefaultPerms(false, parent);
Bukkit.getServer().getPluginManager().unsubscribeFromDefaultPerms(true, parent);
permissions.clear();
}
private void calculateChildPermissions( Map<String, Boolean> children, boolean invert, PermissionAttachment attachment) {
for (Map.Entry<String, Boolean> entry : children.entrySet()) {
String name = entry.getKey();
Permission perm = Bukkit.getServer().getPluginManager().getPermission(name);
boolean value = entry.getValue() ^ invert;
String lname = name.toLowerCase(java.util.Locale.ENGLISH);
permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
Bukkit.getServer().getPluginManager().subscribeToPermission(name, parent);
if (perm != null) {
calculateChildPermissions(perm.getChildren(), !value, attachment);
}
}
}
@Override
public PermissionAttachment addAttachment( Plugin plugin, String name, boolean value, int ticks) {
if (name == null) {
throw new IllegalArgumentException("Permission name cannot be null");
} else if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
} else if (!plugin.isEnabled()) {
throw new IllegalArgumentException("Plugin " + plugin.getDescription().getFullName() + " is disabled");
}
PermissionAttachment result = addAttachment(plugin, ticks);
if (result != null) {
result.setPermission(name, value);
}
return result;
}
@Override
public PermissionAttachment addAttachment( Plugin plugin, int ticks) {
return null;
}
@Override
public Set<PermissionAttachmentInfo> getEffectivePermissions() {
return new HashSet<PermissionAttachmentInfo>(permissions.values());
}
@Override
public void sendMessage(String message) {
setBlocksToSpend(message);
}
@Override
public void sendMessage(String[] messages) {
}
@Override
public Server getServer() {
return null;
}
@Override
public String getName() {
return null;
}
@Override
public Spigot spigot() {
return null;
}
@Override
public boolean isConversing() {
return false;
}
@Override
public void acceptConversationInput(String input) {
}
@Override
public boolean beginConversation(Conversation conversation) {
return false;
}
@Override
public void abandonConversation(Conversation conversation) {
}
@Override
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
}
@Override
public void sendRawMessage(String message) {
}
private static class RemoveAttachmentRunnable implements Runnable {
private PermissionAttachment attachment;
public RemoveAttachmentRunnable(PermissionAttachment attachment) {
this.attachment = attachment;
}
@Override
public void run() {
attachment.remove();
}
}
}
| [
"[email protected]"
] | |
6d0fa67b830680e28b9f7606f8a7578329890337 | 6f6f41c2c13c9a3b42a46cbc935deb5afcc3331a | /String18.java | 29ffc567e0774131ec24b35a143c20c90312f343 | [] | no_license | MarieAnneCyril/Marie-Anne-Cyril--845212 | d64d2d65976cc32625b9f8a5d838c33b41320264 | 73a7c770d96d4784bc29231e7236e7187e16c734 | refs/heads/master | 2022-04-12T04:28:59.876641 | 2020-04-04T05:50:49 | 2020-04-04T05:50:49 | 231,372,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | /*..18. ount the number of times the second word in second string occurs in
first string-case sensitive..*/
import java.util.*;
import java.util.StringTokenizer;
public class String18 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1= sc.nextLine();
String s2= sc.nextLine();
getvalues(s1,s2);
}
public static void getvalues(String s1, String s2) {
int count=0;
StringTokenizer st=new StringTokenizer(s2," ");
String s3=st.nextToken();
String s4=st.nextToken();
//System.out.println(s4);
StringTokenizer st1=new StringTokenizer(s1," ");
while(st1.hasMoreTokens())
{
String s5=st1.nextToken();
if(s4.equals(s5))
{
count++;
}
}
System.out.println(count);
}
} | [
"[email protected]"
] | |
062c6b34059d5492d6b16136957df15554f6ae6d | 6f29bc4f8a6c9cfb42e3d8864ac6032a0b0f414e | /src/ch05/LongestIncreasingSubsequence.java | fbbd6d5133b9842fbfa6fa2e0f5b1228ad680b54 | [] | no_license | Nurdiansyah-Syah/Alpro_25_02 | 0f6836dcbe9f8e116dd24f37bf6a58ea754d2396 | 51ac3b899f9c9b1dce67389560f6f6c9ce162e3b | refs/heads/master | 2022-09-02T06:05:03.585454 | 2020-05-21T16:50:18 | 2020-05-21T16:50:18 | 261,227,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,009 | java | package ch05;
public class LongestIncreasingSubsequence {
/* lis() returns the length of the longest increasing
subsequence in arr[] of size n */
static int lis(int arr[], int n)
{
int lis[] = new int[n];
int i, j, max = 0;
/* Initialize LIS values for all indexes */
for (i = 0; i < n; i++)
lis[i] = 1;
/* Compute optimized LIS values in bottom up manner */
for (i = 1; i < n; i++)
for (j = 0; j < i; j++)
if (arr[i] > arr[j] && lis[i] < lis[j] + 1)
lis[i] = lis[j] + 1;
/* Pick maximum of all LIS values */
for (i = 0; i < n; i++)
if (max < lis[i])
max = lis[i];
return max;
}
public static void main(String args[])
{
int arr[] = { 10, 22, 9, 33, 21, 50, 41, 60 };
int n = arr.length;
System.out.println("Length of lis is " + lis(arr, n) + "\n");
}
} | [
"[email protected]"
] | |
ee0f7a8c468e6e2250ddaa5bfe2a9fed8639275b | 67bcbf60148a09867df048d55db4cf7988af5890 | /app/src/main/java/com/hishixi/tiku/custom/recycler/animators/ScaleInAnimation.java | 930417cce75ecef6f0d8a5f60b1fe22547d94469 | [] | no_license | hbdzp/mvp_architecture | ce327af71d457b84c530d85534e13ee236e3b3af | 36c8aeb01ad152bfeb883e1cb19790f73d535246 | refs/heads/master | 2020-05-20T09:52:47.368377 | 2017-11-14T08:18:14 | 2017-11-14T08:18:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package com.hishixi.tiku.custom.recycler.animators;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.view.View;
/**
* 缩放进入动画
*/
public class ScaleInAnimation implements IAnimation {
private final float DEFAULT_SCALE_FROM = 0.5F;
private final float mFrom;
public ScaleInAnimation() {
mFrom = DEFAULT_SCALE_FROM;
}
public ScaleInAnimation(float from) {
mFrom = from;
}
@Override
public Animator[] getAnimators(View view) {
return new Animator[]{
ObjectAnimator.ofFloat(view, "scaleX", mFrom, 1.0F),
ObjectAnimator.ofFloat(view, "scaleY", mFrom, 1.0F)
};
}
}
| [
"[email protected]"
] | |
eb440924cbc6b9e1d948d84611da9b5a1faba8ae | 2b6a5d7c2adf6de1e4da8e7cde07922ba08f8f6c | /src/main/java/com/l2yy/webgis/util/AESUtil.java | 6c63ba45f018812487a90ada31481b9998d42b6a | [] | no_license | JinJiangHuang/WebGis | 3c7eb3237c90006d35accf96e71e000e9fe437c9 | c4ad2c45c56e68eb879e34710d2e30b8c35dc35b | refs/heads/master | 2023-07-13T09:39:22.915236 | 2021-03-10T06:33:21 | 2021-03-10T06:33:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,356 | java | package com.l2yy.webgis.util;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
/**
* @author :hjl
* @date :Created in 2020/3/29 9:08 下午
* @description:
*/
public class AESUtil {
private static final String ENCODE_RULES = "ml";
/**
* 加密
* 1.构造密钥生成器
* 2.根据ecnodeRules规则初始化密钥生成器
* 3.产生密钥
* 4.创建和初始化密码器
* 5.内容加密
* 6.返回字符串
*/
public static String aesEncode(String content) {
try {
//1.构造密钥生成器,指定为AES算法,不区分大小写
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
//2.根据ecnodeRules规则初始化密钥生成器
//生成一个128位的随机源,根据传入的字节数组
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(ENCODE_RULES.getBytes());
keyGenerator.init(128, random);
//3.产生原始对称密钥
SecretKey originalKey = keyGenerator.generateKey();
//4.获得原始对称密钥的字节数组
byte[] raw = originalKey.getEncoded();
//5.根据字节数组生成AES密钥
SecretKey key = new SecretKeySpec(raw, "AES");
//6.根据指定算法AES自成密码器
Cipher cipher = Cipher.getInstance("AES");
//7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密解密(Decrypt_mode)操作,第二个参数为使用的KEY
cipher.init(Cipher.ENCRYPT_MODE, key);
//8.获取加密内容的字节数组(这里要设置为utf-8)不然内容中如果有中文和英文混合中文就会解密为乱码
byte[] byteEncode = content.getBytes("utf-8");
//9.根据密码器的初始化方式--加密:将数据加密
byte[] byteAES = cipher.doFinal(byteEncode);
//10.将加密后的数据转换为字符串
//这里用Base64Encoder中会找不到包
//解决办法:
//在项目的Build path中先移除JRE System Library,再添加库JRE System Library,重新编译后就一切正常了。
String aesEncode = new String(new BASE64Encoder().encode(byteAES));
//11.将字符串返回
return aesEncode;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//如果有错就返加nulll
return null;
}
/**
* 解密
* 解密过程:
* 1.同加密1-4步
* 2.将加密后的字符串反纺成byte[]数组
* 3.将加密内容解密
*/
public static String aesDecode(String content) {
try {
//1.构造密钥生成器,指定为AES算法,不区分大小写
KeyGenerator keygen = KeyGenerator.getInstance("AES");
//2.根据ecnodeRules规则初始化密钥生成器
//生成一个128位的随机源,根据传入的字节数组
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(ENCODE_RULES.getBytes());
keygen.init(128, random);
//3.产生原始对称密钥
SecretKey originalKey = keygen.generateKey();
//4.获得原始对称密钥的字节数组
byte[] raw = originalKey.getEncoded();
//5.根据字节数组生成AES密钥
SecretKey key = new SecretKeySpec(raw, "AES");
//6.根据指定算法AES自成密码器
Cipher cipher = Cipher.getInstance("AES");
//7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密(Decrypt_mode)操作,第二个参数为使用的KEY
cipher.init(Cipher.DECRYPT_MODE, key);
//8.将加密并编码后的内容解码成字节数组
byte[] byteContent = new BASE64Decoder().decodeBuffer(content);
/*
* 解密
*/
byte[] byteDecode = cipher.doFinal(byteContent);
String aesDecode = new String(byteDecode, "utf-8");
return aesDecode;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
throw new RuntimeException("兄弟,配置文件中的密码需要使用AES加密,请使用com.zheng.common.util.AESUtil工具类修改这些值!");
//e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
}
//如果有错就返加nulll
return null;
}
public static void main(String[] args) throws InvalidKeyException {
String[] keys = {
"", "123456"
};
System.out.println("key | AESEncode | AESDecode");
for (String key : keys) {
System.out.print(key + " | ");
String encryptString = aesEncode(key);
System.out.print(encryptString + " | ");
String decryptString = aesDecode(encryptString);
System.out.println(decryptString);
}
String aa="111111";
String jimi = aesEncode(aa);
String jiemmi=aesDecode(jimi);
// String jiemmi1=aesDecode(aa);
System.out.println("加密:"+jimi);
System.out.println("解密:"+jiemmi);
// System.out.println("解密2:"+jiemmi1);
}
} | [
"[email protected]"
] | |
8535dae0b3057d06f30f104a342d55b3d1961982 | ad0351b1277c0534192a87409070926a3f0ddf02 | /deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/domain/NamedEntity.java | 77bb42eb742ef8cdffb50c43c3e903e5ef2311f5 | [
"Apache-2.0"
] | permissive | struberg/deltaspike | 3c2d5ed6fc41c4497babe5052e8ead7dd9dee95f | f49e38635b10bfb8dac16f739eef48a1795a4a12 | refs/heads/master | 2022-11-25T03:07:25.712466 | 2021-12-04T12:25:48 | 2021-12-04T12:25:48 | 3,175,585 | 1 | 1 | Apache-2.0 | 2022-11-19T02:58:56 | 2012-01-14T00:49:21 | Java | UTF-8 | Java | false | false | 1,455 | 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.deltaspike.data.test.domain;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public class NamedEntity
{
@Id
@GeneratedValue
private Long id;
private String name;
public NamedEntity()
{
}
public NamedEntity(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public Long getId()
{
return id;
}
}
| [
"[email protected]"
] | |
85b016bb859f8de49ccc6e215e5720b44e0f9cdb | f1ebf0d1cd049df72c246c50058a6f66986c8cef | /tuner/src/com/android/tv/tuner/livetuner/LiveTvTunerTvInputService.java | 92701db81a3d4a272c37ad86a5b252cb31eaba6e | [
"Apache-2.0"
] | permissive | CooperCao/LiveTv | 946bf8d853b29d64b7d136130bfd048c6b16d920 | 553e3d12c74332f2aa5f04a0181a2c40e02582c5 | refs/heads/master | 2020-09-30T18:24:18.564228 | 2020-02-16T14:10:22 | 2020-02-16T14:10:22 | 227,346,801 | 4 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,202 | java | /*
* Copyright (C) 2018 The Android Open Source Project
*
* 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.android.tv.tuner.livetuner;
import com.android.tv.tuner.tvinput.BaseTunerTvInputService;
import dagger.android.ContributesAndroidInjector;
/** Live TV embedded tuner. */
public class LiveTvTunerTvInputService extends BaseTunerTvInputService {
/**
* Exports {@link LiveTvTunerTvInputService} for Dagger codegen to create the appropriate
* injector.
*/
@dagger.Module
public abstract static class Module {
@ContributesAndroidInjector
abstract LiveTvTunerTvInputService contributesLiveTvTunerTvInputServiceInjector();
}
}
| [
"[email protected]"
] | |
7032694dffcf70aa368fb80a830083a169478654 | 412d3f039e2d001ad6c48c7c16d14e3fe941f851 | /src/main/java/io/vertx/reactivex/ext/web/handler/sockjs/BridgeEventHandler.java | 64a78f7c7fdeffc9f4af2a654645ff22c20c3090 | [] | no_license | sanjaygong/api-framework | 41da9908c9d22f6c7ec2f56fd942696dae21b545 | 0b8bf48a0979e3b6289036e4b26b191c17aea753 | refs/heads/master | 2020-04-15T17:24:59.545468 | 2019-01-09T14:43:35 | 2019-01-09T14:43:35 | 164,873,490 | 0 | 0 | null | 2019-01-09T14:01:10 | 2019-01-09T14:01:09 | null | UTF-8 | Java | false | false | 6,806 | java | package io.vertx.reactivex.ext.web.handler.sockjs;
import com.codahale.metrics.Meter;
import io.vertx.reactivex.ext.web.handler.sockjs.processor.BridgeEventProcessor;
import io.reactivex.Observable;
import io.reactivex.Single;
import io.vertx.core.Handler;
import java.util.UUID;
import org.apache.logging.log4j.Logger;
/**
*
* @author vinay
*/
public class BridgeEventHandler implements Handler<BridgeEvent> {
private Logger mLog;
private BridgeEventProcessor[] mPublishProcessors;
private BridgeEventProcessor[] mReceiveProcessors;
private BridgeEventProcessor[] mRegisterProcessors;
private BridgeEventProcessor[] mSendProcessors;
private BridgeEventProcessor[] mSocketClosedProcessors;
private BridgeEventProcessor[] mSocketCreatedProcessors;
private BridgeEventProcessor[] mSocketIdleProcessors;
private BridgeEventProcessor[] mSoketPingProcessors;
private BridgeEventProcessor[] mUnregisterProcessors;
private Meter mMetricsBridgeEventSend;
private Meter mMetricsBridgeEventPublish;
private Meter mMetricsBridgeEventReceive;
private Meter mMetricsBridgeEventRegister;
private Meter mMetricsBridgeEventUnregister;
@Override
public void handle(BridgeEvent pEvent) {
switch (pEvent.type()) {
case PUBLISH:
getMetricsBridgeEventPublish().mark();
process(getPublishProcessors(), pEvent);
break;
case RECEIVE:
getMetricsBridgeEventReceive().mark();
process(getReceiveProcessors(), pEvent);
break;
case REGISTER:
getMetricsBridgeEventRegister().mark();
process(getRegisterProcessors(), pEvent);
break;
case SEND:
getMetricsBridgeEventSend().mark();
process(getSendProcessors(), pEvent);
break;
case SOCKET_CLOSED:
process(getSocketClosedProcessors(), pEvent);
break;
case SOCKET_CREATED:
process(getSocketCreatedProcessors(), pEvent);
break;
case SOCKET_IDLE:
process(getSocketIdleProcessors(), pEvent);
break;
case SOCKET_PING:
process(getSoketPingProcessors(), pEvent);
break;
case UNREGISTER:
getMetricsBridgeEventUnregister().mark();
process(getUnregisterProcessors(), pEvent);
break;
}
}
protected void process(BridgeEventProcessor[] pProcessors, BridgeEvent pEvent) {
if (pProcessors == null || pProcessors.length == 0) {
pEvent.complete(true);
return;
}
BridgeEventContext ctx = new BridgeEventContext();
ctx.setBridgeEvent(pEvent);
if (getLog().isDebugEnabled()) {
ctx.setId(UUID.randomUUID().toString());
}
Observable
.fromArray(pProcessors)
.reduce(Single.just(ctx), (acc, processor) -> processor.process(acc))
.flatMap((context) -> context)
.doFinally(() -> {
if (ctx.getBridgeEvent().failed()) {
getLog().debug(() -> String.format("[%s] BridgeEvent Failed: [%s]", ctx.getId(), ctx.getBridgeEvent().getRawMessage()));
return;
}
getLog().debug(() -> String.format("[%s] BridgeEvent Success [%s]", ctx.getId(), ctx.getBridgeEvent().getRawMessage()));
ctx.getBridgeEvent().complete(true);
})
.subscribe();
}
public BridgeEventProcessor[] getPublishProcessors() {
return mPublishProcessors;
}
public void setPublishProcessors(BridgeEventProcessor[] pPublishProcessors) {
this.mPublishProcessors = pPublishProcessors;
}
public BridgeEventProcessor[] getReceiveProcessors() {
return mReceiveProcessors;
}
public void setReceiveProcessors(BridgeEventProcessor[] pReceiveProcessors) {
this.mReceiveProcessors = pReceiveProcessors;
}
public BridgeEventProcessor[] getRegisterProcessors() {
return mRegisterProcessors;
}
public void setRegisterProcessors(BridgeEventProcessor[] pRegisterProcessors) {
this.mRegisterProcessors = pRegisterProcessors;
}
public BridgeEventProcessor[] getSendProcessors() {
return mSendProcessors;
}
public void setSendProcessors(BridgeEventProcessor[] pSendProcessors) {
this.mSendProcessors = pSendProcessors;
}
public BridgeEventProcessor[] getSocketClosedProcessors() {
return mSocketClosedProcessors;
}
public void setSocketClosedProcessors(BridgeEventProcessor[] pSocketClosedProcessors) {
this.mSocketClosedProcessors = pSocketClosedProcessors;
}
public BridgeEventProcessor[] getSocketCreatedProcessors() {
return mSocketCreatedProcessors;
}
public void setSocketCreatedProcessors(BridgeEventProcessor[] pSocketCreatedProcessors) {
this.mSocketCreatedProcessors = pSocketCreatedProcessors;
}
public BridgeEventProcessor[] getSocketIdleProcessors() {
return mSocketIdleProcessors;
}
public void setSocketIdleProcessors(BridgeEventProcessor[] pSocketIdleProcessors) {
this.mSocketIdleProcessors = pSocketIdleProcessors;
}
public BridgeEventProcessor[] getSoketPingProcessors() {
return mSoketPingProcessors;
}
public void setSoketPingProcessors(BridgeEventProcessor[] pSoketPingProcessors) {
this.mSoketPingProcessors = pSoketPingProcessors;
}
public BridgeEventProcessor[] getUnregisterProcessors() {
return mUnregisterProcessors;
}
public void setUnregisterProcessors(BridgeEventProcessor[] pUnregisterProcessors) {
this.mUnregisterProcessors = pUnregisterProcessors;
}
public Logger getLog() {
return mLog;
}
public void setLog(Logger pLog) {
this.mLog = pLog;
}
public Meter getMetricsBridgeEventSend() {
return mMetricsBridgeEventSend;
}
public void setMetricsBridgeEventSend(Meter pMetricsBridgeEventSend) {
this.mMetricsBridgeEventSend = pMetricsBridgeEventSend;
}
public Meter getMetricsBridgeEventPublish() {
return mMetricsBridgeEventPublish;
}
public void setMetricsBridgeEventPublish(Meter pMetricsBridgeEventPublish) {
this.mMetricsBridgeEventPublish = pMetricsBridgeEventPublish;
}
public Meter getMetricsBridgeEventReceive() {
return mMetricsBridgeEventReceive;
}
public void setMetricsBridgeEventReceive(Meter pMetricsBridgeEventReceive) {
this.mMetricsBridgeEventReceive = pMetricsBridgeEventReceive;
}
public Meter getMetricsBridgeEventRegister() {
return mMetricsBridgeEventRegister;
}
public void setMetricsBridgeEventRegister(Meter pMetricsBridgeEventRegister) {
this.mMetricsBridgeEventRegister = pMetricsBridgeEventRegister;
}
public Meter getMetricsBridgeEventUnregister() {
return mMetricsBridgeEventUnregister;
}
public void setMetricsBridgeEventUnregister(Meter pMetricsBridgeEventUnregister) {
this.mMetricsBridgeEventUnregister = pMetricsBridgeEventUnregister;
}
}
| [
"[email protected]"
] | |
14e5d39934e867c0a22054a0e72b4cbd9572cbf1 | 955c40aaa3aa851352c6bbe07b36c7f3439a2b62 | /example/autoimporter/src/main/java/org/ow2/chameleon/rose/importer/essay/BinaryLightInterface1Tester.java | 7e4e95d5d7d79cd41fe54a8c03eaa3200a9e175a | [
"Apache-2.0"
] | permissive | ow2-chameleon/arvensis | cb4fb7ab82a3c1119aa1b763b5e997e88bef23dc | fffdd98348b778f78dd0cd43879aca6065214f7b | refs/heads/master | 2023-05-29T16:16:29.481837 | 2013-12-20T17:21:23 | 2013-12-20T17:21:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,372 | java | package org.ow2.chameleon.rose.importer.essay;
import org.apache.felix.ipojo.annotations.Bind;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Invalidate;
import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Unbind;
import org.apache.felix.ipojo.annotations.Validate;
import org.osgi.framework.BundleContext;
import org.ow2.chameleon.rose.importer.module.generic.BinaryLight;
public class BinaryLightInterface1Tester extends Thread {
@Requires
BinaryLight light;
boolean isRunning;
public BinaryLightInterface1Tester(BundleContext bc) {
super.setDaemon(true);
}
@Bind
public void bind(BinaryLight lightBinded){
this.start();
}
@Unbind
public void unbind(BinaryLight lightBinded){
try {
this.wait(5000);
} catch (InterruptedException e) {
}
}
public void run() {
while (isRunning) {
try {
light.setState(!light.getState());
} catch (Exception e) {
//Device probably disconnected
isRunning = false;
} finally {
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
}
}
@Validate
public void validate() {
isRunning = true;
}
@Invalidate
public void invalidate() {
isRunning = false;
}
}
| [
"[email protected]"
] | |
8b8f21bf60a14c36d1f2af1a991ad58bf05578cb | cad351d6744f25b154adc8fcd16c0052d8aab531 | /app/src/main/java/com/rgc/AdvScheduledAction.java | 6fc08ecb4b330856b0470e8b74cb61f5b7a7dbaa | [
"MIT"
] | permissive | qsoMaster/remote-GPIO-control-client | 98aac1765e3eeb45a162137a958368062d71186d | 7c9f64c3a014b18115187e4bad9fde3c06951aa9 | refs/heads/master | 2023-03-25T02:35:18.005528 | 2019-12-28T15:30:27 | 2019-12-28T15:30:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,066 | java | package com.rgc;
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AdvScheduledAction {
public int id,out_id,pwm_id,chain_id;
public boolean keepLog;
public String typ,out_stan,rodzaj,koniunkcja,nazwa,triggers,op_nazwa,pwm_ss,pwm_fr,pwm_dc;
public List<AdvScheduledActionTrigger> triggersList = new ArrayList<>();
AdvScheduledAction(){
//this.adv = adv;
}
AdvScheduledAction(int id, String typ,String rodzaj,String koniunkcja,String nazwa,String triggers,int out_id,String out_stan,String op_nazwa,boolean keepLog){
this.id = id; this.typ =typ; this.rodzaj=rodzaj;this.koniunkcja = koniunkcja; this.nazwa = nazwa; this.triggers=triggers; this.out_id = out_id;this.out_stan = out_stan;this.op_nazwa=op_nazwa;this.keepLog=keepLog;
parseTriggers();
}
AdvScheduledAction(int id, String typ,String rodzaj,String koniunkcja,String nazwa,String triggers,int pwm_id,String pwm_ss,String pwm_fr,String pwm_dc,String op_nazwa,boolean keepLog){
this.id = id; this.typ =typ; this.rodzaj=rodzaj;this.koniunkcja = koniunkcja; this.nazwa = nazwa; this.triggers=triggers; this.pwm_id = pwm_id;this.pwm_ss = pwm_ss; this.pwm_fr = pwm_fr;this.pwm_dc = pwm_dc;this.op_nazwa=op_nazwa;this.keepLog=keepLog;
parseTriggers();
}
AdvScheduledAction(int id, String typ,String rodzaj,String koniunkcja,String nazwa,String triggers,int chain_id,String op_nazwa,boolean keepLog){
this.id = id; this.typ =typ; this.rodzaj=rodzaj;this.koniunkcja = koniunkcja; this.nazwa = nazwa; this.triggers=triggers; this.chain_id = chain_id;this.op_nazwa=op_nazwa;this.keepLog=keepLog;
out_stan = "EXECUTE";
parseTriggers();
}
private void parseTriggers(){
triggersList.clear();
List<String> triggersStrings = new ArrayList<>(Arrays.asList(triggers.split("\\$")));
for (int i = 0;i<triggersStrings.size()-1;i+=11) {
if(triggersStrings.get(i+1).equals("None")||triggersStrings.get(i+1).isEmpty())
triggersList.add(new AdvScheduledActionTrigger(
Integer.parseInt(triggersStrings.get(i)),
id,
Integer.parseInt(triggersStrings.get(i+2)),
triggersStrings.get(i+3),
triggersStrings.get(i+4),
triggersStrings.get(i+5)
));
else {
String iosp_name = "";
if(triggersStrings.get(i + 3).equals("i/o"))
iosp_name = triggersStrings.get(i + 6);
else if(triggersStrings.get(i + 3).matches("pwm"))
iosp_name = triggersStrings.get(i + 8);
else if(triggersStrings.get(i + 3).equals("sensor"))
iosp_name = triggersStrings.get(i + 9);
triggersList.add(new AdvScheduledActionTrigger(
Integer.parseInt(triggersStrings.get(i)),
id,
Integer.parseInt(triggersStrings.get(i + 2)),
triggersStrings.get(i + 3),
triggersStrings.get(i + 4),
triggersStrings.get(i + 5),
triggersStrings.get(i + 1),
iosp_name,
triggersStrings.get(i + 10)
));
}
}
}
public void conjDialog(final Context context){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); ;
View view = inflater.inflate(R.layout.conj_edit, null);
final EditText conj = view.findViewById(R.id.conj);
if(koniunkcja != null)
if(!koniunkcja.equals("None"))
conj.setText(koniunkcja);
MaterialDialog d = new MaterialDialog.Builder(context)
//.title(R.string.title)
.customView(view, true)
.autoDismiss(false)
.positiveText("SAVE")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
int trNumberMax = triggersList.size();
boolean valid = true;
String conjS = conj.getText().toString();
Matcher syntax = Pattern.compile("(\\(*#|#)[0-9]*(#\\)*|#)( and | or |)").matcher(conjS);
int syntaxLenght = 0;
while (syntax.find()) {
//System.out.println("Found: " + syntax.group(0));
syntaxLenght += syntax.group(0).length();
}
if(syntaxLenght != conjS.length()) {
valid = false;
Toast.makeText(context, "Bad syntax !", Toast.LENGTH_SHORT).show();
}
Matcher numbers = Pattern.compile("#[0-9]*#").matcher(conjS);
while (numbers.find()) {
int trNumber = Integer.parseInt(numbers.group(0).replace("#",""));
if (trNumber > trNumberMax ){
valid = false;
Toast.makeText(context, "Trigger number "+trNumber+" not exist !", Toast.LENGTH_SHORT).show();
}
}
Matcher leftBracket = Pattern.compile("\\(").matcher(conjS);
int leftBracketN = 0;
while (leftBracket.find())
leftBracketN++;
Matcher rightBracket = Pattern.compile("\\)").matcher(conjS);
int rightBracketN = 0;
while (rightBracket.find())
rightBracketN++;
if(leftBracketN != rightBracketN){
valid = false;
Toast.makeText(context, "Bracket not closed ?!", Toast.LENGTH_SHORT).show();
}
if(valid){
dialog.dismiss();
AdvScheduledActions.AdvScheduledActionsTask edit_Conj = new AdvScheduledActions.AdvScheduledActionsTask(new AdvScheduledActions.AsyncResponse() {
@Override
public void processFinish(String output) {
}
});
edit_Conj.execute("GPIO_ASA_SetConj",conjS,String.valueOf(id));
}
}
})
.negativeText("CANCEL")
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
})
.show();
}
public void actionDialog(final boolean editMode, final Context context,final SparseArray targetOList,final SparseArray targetPWMList, final SparseArray targetChainList){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); ;
View view = inflater.inflate(R.layout.action_edit, null);
TextView title = view.findViewById(R.id.titleL);
final EditText name = view.findViewById(R.id.name);
final Spinner type = view.findViewById(R.id.type);
List<String> typeList = new ArrayList<String>();
typeList.add("output");
typeList.add("pwm");
typeList.add("chain");
ArrayAdapter<String> typeAdapter = new ArrayAdapter<String>(context, R.layout.spinner_item, typeList);
typeAdapter.setDropDownViewResource(R.layout.spinner_item);
type.setAdapter(typeAdapter);
final Spinner targetO = view.findViewById(R.id.targeto);
ArrayAdapter<String> targetOAdapter = new ArrayAdapter<String>(context, R.layout.spinner_item, ConvertToList(targetOList));
targetOAdapter.setDropDownViewResource(R.layout.spinner_item);
targetO.setAdapter(targetOAdapter);
final Spinner targetPWM = view.findViewById(R.id.targetpwm);
ArrayAdapter<String> targetPWMAdapter = new ArrayAdapter<String>(context, R.layout.spinner_item, ConvertToList(targetPWMList));
targetPWMAdapter.setDropDownViewResource(R.layout.spinner_item);
targetPWM.setAdapter(targetPWMAdapter);
final Spinner targetChain = view.findViewById(R.id.targetChain);
ArrayAdapter<String> targetChainAdapter = new ArrayAdapter<String>(context, R.layout.spinner_item, ConvertToList(targetChainList));
targetChainAdapter.setDropDownViewResource(R.layout.spinner_item);
targetChain.setAdapter(targetChainAdapter);
final EditText noe = view.findViewById(R.id.noe);
final Spinner state = (Spinner) view.findViewById(R.id.state);
final ArrayAdapter<CharSequence> stateAdapter = ArrayAdapter.createFromResource(context, R.array.states, android.R.layout.simple_spinner_item);
final EditText pwmFR = view.findViewById(R.id.pwmFR);
final EditText pwmDC = view.findViewById(R.id.pwmDC);
final CheckBox keeplogsCh = view.findViewById(R.id.keepLogs);
final TableRow targetoRow = view.findViewById(R.id.targetoRow);
final TableRow targetpwmRow = view.findViewById(R.id.targetpwmRow);
final TableRow pwmFRRow = view.findViewById(R.id.pwmFRRow);
final TableRow pwmDCRow = view.findViewById(R.id.pwmDCRow);
final TableRow targetChainRow = view.findViewById(R.id.targetChainRow);
final TableRow stateRow = view.findViewById(R.id.stateRow);
type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (position == 0) {
targetoRow.setVisibility(View.VISIBLE);
targetpwmRow.setVisibility(View.GONE);
pwmFRRow.setVisibility(View.GONE);
pwmDCRow.setVisibility(View.GONE);
targetChainRow.setVisibility(View.GONE);
stateRow.setVisibility(View.VISIBLE);
} else if (position == 1) {
targetoRow.setVisibility(View.GONE);
targetpwmRow.setVisibility(View.VISIBLE);
pwmFRRow.setVisibility(View.VISIBLE);
pwmDCRow.setVisibility(View.VISIBLE);
targetChainRow.setVisibility(View.GONE);
stateRow.setVisibility(View.VISIBLE);
}else if (position == 2) {
targetoRow.setVisibility(View.GONE);
targetpwmRow.setVisibility(View.GONE);
pwmFRRow.setVisibility(View.GONE);
pwmDCRow.setVisibility(View.GONE);
targetChainRow.setVisibility(View.VISIBLE);
stateRow.setVisibility(View.GONE);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
if(editMode){
title.setText("Edit action:");
type.setSelection(typeAdapter.getPosition(typ));
name.setText(nazwa);
if(type.getSelectedItemPosition() == 0) {
targetO.setSelection(targetOList.indexOfKey(out_id));
state.setSelection(stateAdapter.getPosition(out_stan));
}
else if (type.getSelectedItemPosition() == 1){
targetPWM.setSelection(targetPWMList.indexOfKey(pwm_id));
if(pwm_fr != null)pwmFR.setText(pwm_fr);
if(pwm_dc != null)pwmDC.setText(pwm_dc);
state.setSelection(stateAdapter.getPosition(pwm_ss));
}else if(type.getSelectedItemPosition() == 2) {
targetChain.setSelection(targetChainList.indexOfKey(chain_id));
}
noe.setText(rodzaj);
keeplogsCh.setChecked(keepLog);
}
final AdvScheduledActions.AdvScheduledActionsTask exec = new AdvScheduledActions.AdvScheduledActionsTask(new AdvScheduledActions.AsyncResponse() {
@Override
public void processFinish(String output) {
}
});
MaterialDialog d = new MaterialDialog.Builder(context)
//.title(R.string.title)
.customView(view, true)
.autoDismiss(false)
.positiveText("SAVE")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
if((type.getSelectedItemPosition() == 0 &&(targetO.getSelectedItem() == null||name.getText().toString().isEmpty()||noe.getText().toString().isEmpty()))||
(type.getSelectedItemPosition() == 1 &&(targetPWM.getSelectedItem() == null||name.getText().toString().isEmpty()||noe.getText().toString().isEmpty()))||
(type.getSelectedItemPosition() == 2 &&(targetChain.getSelectedItem() == null||name.getText().toString().isEmpty()||noe.getText().toString().isEmpty()))
)
Toast.makeText(context, "Fill Name, target and number of executions !", Toast.LENGTH_SHORT).show();
else{
dialog.dismiss();
int target = -1;
switch (type.getSelectedItemPosition()){
case 0: target = targetOList.keyAt(targetO.getSelectedItemPosition());break;
case 1: target = targetPWMList.keyAt(targetPWM.getSelectedItemPosition());break;
case 2: target = targetChainList.keyAt(targetChain.getSelectedItemPosition());break;
}
if(!editMode)
exec.execute("GPIO_ASA_Add",name.getText().toString(),type.getSelectedItem().toString(),String.valueOf(target)
,noe.getText().toString(),String.valueOf(state.getSelectedItemPosition()),pwmFR.getText().toString(),pwmDC.getText().toString(),(keeplogsCh.isChecked()?"1":"0"));
else
exec.execute("GPIO_ASA_Update",name.getText().toString(),type.getSelectedItem().toString(),String.valueOf(target)
,noe.getText().toString(),String.valueOf(state.getSelectedItemPosition()),pwmFR.getText().toString(),pwmDC.getText().toString(),String.valueOf(id),(keeplogsCh.isChecked()?"1":"0"));
}
}
})
.neutralText("DELETE")
.onNeutral(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
exec.execute("GPIO_ASA_Delete",String.valueOf(id));
}
})
.negativeText("CANCEL")
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
})
.show();
if(!editMode)
d.getActionButton(DialogAction.NEUTRAL).setVisibility(View.INVISIBLE);
}
public static <C> List<C> ConvertToList(SparseArray<C> sparseArray) {
if (sparseArray == null) return null;
List<C> arrayList = new ArrayList<C>(sparseArray.size());
for (int i = 0; i < sparseArray.size(); i++)
arrayList.add(sparseArray.valueAt(i));
return arrayList;
}
}
| [
"[email protected]"
] | |
68bfd7a241061097e0deaff7de43ae5c082ec06c | f94004f722d3b096b93c9b1da1e2c3af352b872f | /app/src/main/java/com/jpz/myleakedactivity/SingletonSavesContext.java | 3e7e98a10a55c71d4837387273c0efe32a6eddea | [] | no_license | jeanpierreZ/MyLeakedActivity | bbaf031794f9c620c49eae2db09e4bfc420da398 | 69fd77d54131c41f8e7490cd8f8fc9460aa3ffab | refs/heads/master | 2020-05-15T06:18:09.946459 | 2019-04-18T16:22:45 | 2019-04-18T16:22:45 | 182,120,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | package com.jpz.myleakedactivity;
import android.content.Context;
public class SingletonSavesContext {
private Context context;
private static SingletonSavesContext instance;
public Context getContext() {
return context;
}
public void setContext(Context context) {
this.context = context;
}
public static SingletonSavesContext getInstance() {
if (instance == null) {
instance = new SingletonSavesContext();
}
return instance;
}
}
| [
"[email protected]"
] | |
6802f3a1941b69f95761269cd72abe93a7582ff2 | ffa16073891a43bfe69d0e0f14be33e687e341d6 | /src/tree/segmentTree/SegmentTreeNode.java | 3cc96b486b575bde8542137706ebcf357079d508 | [] | no_license | xuchengyun/cspir | 1abc78ae28aa5a359e92375079a5f7e57a34dee8 | 547119ab3a02c6106e9118369761c42cebd6eff7 | refs/heads/master | 2020-07-01T19:06:53.655115 | 2019-08-16T16:28:33 | 2019-08-16T16:28:33 | 201,266,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package tree.segmentTree;
public class SegmentTreeNode {
int start;
int end;
SegmentTreeNode left;
SegmentTreeNode right;
int sum;
public SegmentTreeNode(int start, int end) {
this.start = start;
this.end = end;
this.left = null;
this.right = null;
this.sum = 0;
}
}
| [
"[email protected]"
] | |
92c49d80cabca8b94eddc7ec2cfe7d19f6bc45ac | e78ad086f6e6aac1dcb3bfd6d639811925e89c22 | /src/main/java/com/mingsoft/basic/biz/impl/ColumnBizImpl.java | 70c6b468329872ca350a4c3f093baa653406e2f2 | [
"MIT"
] | permissive | zhouchaoyi/mcms_dev | ca49d9453c99ba366adb7a676d6db6f927f63be5 | 85684da0bacf9d4504b335d91334feceab2c642f | refs/heads/master | 2021-01-17T07:28:55.102485 | 2016-08-04T07:02:05 | 2016-08-04T07:02:05 | 64,371,791 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,963 | java | /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* 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 com.mingsoft.basic.biz.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mchange.v1.util.ArrayUtils;
import com.mingsoft.base.dao.IBaseDao;
import com.mingsoft.basic.biz.impl.CategoryBizImpl;
import com.mingsoft.basic.entity.BasicEntity;
import com.mingsoft.basic.biz.IColumnBiz;
import com.mingsoft.basic.dao.IColumnDao;
import com.mingsoft.basic.entity.ColumnEntity;
/**
*
*
* <p>
* <b>铭飞CMS-铭飞内容管理系统</b>
* </p>
*
* <p>
* Copyright: Copyright (c) 2014 - 2015
* </p>
*
* <p>
* Company:景德镇铭飞科技有限公司
* </p>
*
* @author 刘继平
*
* @version 300-001-001
*
* <p>
* 版权所有 铭飞科技
* </p>
*
* <p>
* Comments:栏目业务层实现类,继承CategoryBizImpl,实现接口IColumnBiz
* </p>
*
* <p>
* Create Date:2014-7-14
* </p>
*
* <p>
* Modification history:
* </p>
*/
@Service("columnBiz")
public class ColumnBizImpl extends CategoryBizImpl implements IColumnBiz {
/**
* 栏目持久化层注入
*/
private IColumnDao columnDao;
/**
* 获取 columnDao
*
* @return columnDao
*/
public IColumnDao getColumnDao() {
return columnDao;
}
/**
* 设置 columnDao
*
* @param columnDao
*/
@Autowired
public void setColumnDao(IColumnDao columnDao) {
this.columnDao = columnDao;
}
@Override
protected IBaseDao getDao() {
return columnDao;
}
/**
* 根据站点ID查询该站点下的栏目集合
*
* @param columnWebsiteId
* 站点Id
* @return 栏目集合
*/
public List<ColumnEntity> queryColumnListByWebsiteId(int columnWebsiteId) {
return columnDao.queryColumnListByWebsiteId(columnWebsiteId);
}
public List<ColumnEntity> queryChild(int categoryCategoryId, int columnWebsiteId, Integer modelId, Integer size) {
return columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(categoryCategoryId, columnWebsiteId, modelId,
size);
}
public List<ColumnEntity> queryAll(int appId, int modelId,String status) {
return columnDao.queryByAppIdAndModelId(appId, modelId,status);
}
/**
* 通过站点Id查询栏目的同级栏目和他的父级栏目(包括他的间接父栏目直到顶级栏目)的同级栏目集合
*
* @param categoryId
* 栏目ID
* @param columnWebsiteId
* 站点Id
* @return 栏目集合
*/
public List<ColumnEntity> queryColumnChildListRecursionByWebsiteId(int categoryId, int columnWebsiteId) {
List<ColumnEntity> list = new ArrayList<ColumnEntity>();
ColumnEntity columnEntity = (ColumnEntity) (columnDao.getEntity(categoryId));
if (columnEntity != null) {
int categoryCategoryId = columnEntity.getCategoryCategoryId();
queryExpansionColumnListByWebsiteId(categoryCategoryId, list, columnWebsiteId);
}
return list;
}
/**
* 通过栏目的站点ID查询该站点下的栏目的父栏目Id为categoryCategoryId子栏目
* 通过递归查询将父栏目ID为categoryCategoryId的子栏目集合和他对应在同一节点树的父级栏目的集合全部查询装入List中
*
* @param categoryCategoryId
* 栏目ID
* @param list
* 栏目集合
* @param columnWebsiteId
* 站点ID
*/
private void queryExpansionColumnListByWebsiteId(int categoryCategoryId, List<ColumnEntity> list,
int columnWebsiteId) {
List<ColumnEntity> queryChildList = new ArrayList<ColumnEntity>();
queryChildList = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(categoryCategoryId, columnWebsiteId,
null, null);
for (int i = 0; i < queryChildList.size(); i++) {
list.add(queryChildList.get(i));
}
if (categoryCategoryId != 0) {
ColumnEntity columnEntity = (ColumnEntity) (columnDao.getEntity(categoryCategoryId));
queryExpansionColumnListByWebsiteId(columnEntity.getCategoryCategoryId(), list, columnWebsiteId);
}
}
/**
* 通过栏目ID查询该栏目同级栏目
*
* @param columnId
* 栏目ID
* @return 同级栏目集合
*/
public List<ColumnEntity> querySibling(int columnId, Integer size) {
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(columnId);
List<ColumnEntity> list = new ArrayList<ColumnEntity>();
if (columnEntity != null) {
list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryCategoryId(),
columnEntity.getColumnWebsiteId(), null, size);
}
return list;
}
/**
* 通过栏目ID查询顶级栏目的同级栏目
*
* @param columnId
* 栏目ID
* @return 顶级同级栏目集合
*/
public List<ColumnEntity> queryTopSiblingListByColumnId(int columnId, Integer size) {
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(columnId);
List<ColumnEntity> list = null;
if (columnEntity != null) {
list = querySibling(columnEntity.getCategoryCategoryId(), size);
}
return list;
}
/**
* 根据栏目Id查询栏目的子栏目集
*
* @param columnId
* 栏目ID
* @return 子栏目集合
*/
public List<ColumnEntity> queryChildListByColumnId(int columnId, Integer size) {
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(columnId);
List<ColumnEntity> list = null;
if (columnEntity != null) {
list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryId(),
columnEntity.getColumnWebsiteId(), null, size);
}
return list;
}
/**
* 根据栏目ID查询其子栏目ID集合
*
* @param categoryId
* 栏目ID
* @return 子栏目ID集合
*/
public int[] queryChildIdsByColumnId(int categoryId, int appId) {
List<Integer> ids = columnDao.queryColumnChildIdList(categoryId, appId);
int[] ret = new int[ids.size()];
for (int i = 0; i < ret.length; i++)
ret[i] = ids.get(i).intValue();
return ret;
}
/**
* 根据栏目属性查询栏目站点id为columnWebsiteId的栏目集合
*
* @param columnType
* 栏目属性
* @param columnWebsiteId
* 栏目所属站点ID
* @return 栏目集合
*/
public List<ColumnEntity> queryColumnListBycolumnType(int columnType, int columnWebsiteId) {
return columnDao.queryColumnListBycolumnType(columnType, columnWebsiteId);
}
/**
* 用递归通过栏目ID查询栏目的父级栏目,将查询结果装入List集合中
*
* @param columnId
* 栏目ID
* @param list
* 父级栏目集合
*/
private void queryColumnParent(ColumnEntity column, List<ColumnEntity> list) {
if (column.getCategoryCategoryId() != 0) {
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(column.getCategoryCategoryId());
list.add(columnEntity);
queryColumnParent(columnEntity, list);
}
}
/**
* 通过栏目ID查询栏目对应节点路径上的父级栏目集合
*
* @param columnId
* 栏目ID
* @return 栏目及其父级栏目集合
*/
public List<ColumnEntity> queryParentColumnByColumnId(int columnId) {
List<ColumnEntity> list = null;
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(columnId);
if (columnEntity != null) {
list = new ArrayList<ColumnEntity>();
// 递归的查询所有父节点
queryColumnParent(columnEntity, list);
}
return list;
}
/**
* 根据站点Id查询该站点下的栏目的父栏目Id为categoryCategoryId的子栏目集合数目统计
*
* @param categoryCategoryId
* 父栏目ID
* @param columnWebsiteId
* 站点ID
* @return 子栏目统计数目
*/
public int queryColumnChildListCountByWebsiteId(int categoryCategoryId, int columnWebsiteId) {
return columnDao.queryColumnChildListCountByWebsiteId(categoryCategoryId, columnWebsiteId);
}
/**
* 通过管理员ID和模块ID查询订单类型集合
*
* @param categoryManagerId
* 管理员ID
* @param categoryModelId
* 模块ID
* @return 返回订单集合
*/
public List<BasicEntity> queryCategoryByManagerIdAndModelId(int categoryManagerId, int categoryModelId) {
return columnDao.queryCategoryByManagerIdAndModelId(categoryManagerId, categoryModelId);
}
@Override
public List<ColumnEntity> querSibListByColumnId(int columnId) {
// TODO Auto-generated method stub
ColumnEntity columnEntity = (ColumnEntity) columnDao.getEntity(columnId);
List<ColumnEntity> list = null;
if (columnEntity != null) {
if (columnEntity.getCategoryId() != 0) {
list = columnDao.queryColumnByCategoryIdAndWebsiteIdAndModelId(columnEntity.getCategoryId(),
columnEntity.getColumnWebsiteId(), null, null);
}
}
return list;
}
} | [
"[email protected]"
] | |
0b2c316b862d957419b99aba202eebc91cdd74a4 | 09231b405725ea53483a53c0856c5115637a04b0 | /src/de/tor/tribes/types/DefenseTimeSpan.java | 99a24ab16e4b8f88ab788bac71588654067aa01e | [] | no_license | Jujuedv/dsworkbench | a7738bb4f9857f07a0eb367f5b419c37cc6ed60e | 5b9351160e30053967923d961103613321ab20b7 | refs/heads/master | 2021-01-21T16:34:56.796100 | 2015-05-11T21:24:52 | 2015-05-11T21:24:52 | 35,283,961 | 0 | 0 | null | 2015-05-08T14:31:59 | 2015-05-08T14:31:58 | null | UTF-8 | Java | false | false | 3,980 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.tor.tribes.types;
import de.tor.tribes.types.ext.Village;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.math.IntRange;
import org.apache.commons.lang.math.LongRange;
/**
*
* @author Charon
*/
public class DefenseTimeSpan extends TimeSpan {
@Override
public DefenseTimeSpan clone() throws CloneNotSupportedException {
if (getDirection().equals(DIRECTION.NONE)) {
throw new CloneNotSupportedException("Divider cannot be cloned");
}
DefenseTimeSpan s = new DefenseTimeSpan(validFor, span);
s.setDirection(getDirection());
return s;
}
private Village validFor = null;
private LongRange span = null;
public DefenseTimeSpan() {
}
public DefenseTimeSpan(Village pVillage, LongRange pSpan) {
validFor = pVillage;
span = pSpan;
}
@Override
public IntRange getSpan() {
return null;
}
@Override
public int compareTo(TimeSpan o) {
if (getDirection().equals(DefenseTimeSpan.DIRECTION.SEND) && o.getDirection().equals(DefenseTimeSpan.DIRECTION.NONE)) {
return -1;
} else if (getDirection().equals(DefenseTimeSpan.DIRECTION.ARRIVE) && o.getDirection().equals(DefenseTimeSpan.DIRECTION.NONE)) {
return 1;
} else if (getDirection().equals(DefenseTimeSpan.DIRECTION.SEND) && o.getDirection().equals(DefenseTimeSpan.DIRECTION.ARRIVE)) {
return -1;
} else if (getDirection().equals(DefenseTimeSpan.DIRECTION.ARRIVE) && o.getDirection().equals(DefenseTimeSpan.DIRECTION.SEND)) {
return 1;
} else if (getDirection().equals(o.getDirection())) {
if (getAtDate() != null && o.getAtDate() == null) {
return -1;
} else if (getAtDate() == null && o.getAtDate() != null) {
return 1;
} else if (getAtDate() == null && o.getAtDate() == null) {
//return new Integer(getSpan().getMinimumInteger()).compareTo(o.getSpan().getMinimumInteger());
return 0;
}
}
return 0;
}
@Override
public boolean isValidAtExactTime() {
return false;
}
@Override
public DIRECTION getDirection() {
return TimeSpan.DIRECTION.ARRIVE;
}
@Override
public boolean isValidAtEveryDay() {
return false;
}
@Override
public boolean isValidAtSpecificDay() {
return false;
}
@Override
public boolean isValid() {
return (span.getMaximumLong() > System.currentTimeMillis());
}
@Override
public String getValidityInfo() {
if (!isValid()) {
return "Ankunft in der Vergangenheit";
}
//date/frame is valid or we use each day
return null;
}
@Override
public boolean intersectsWithNightBonus() {
return false;
}
public LongRange getDefenseSpan() {
return span;
}
public void setDefenseSpan(LongRange pSpan) {
span = pSpan;
}
public boolean isValidForVillage(Village pVillage) {
return validFor.equals(pVillage);
}
@Override
public boolean intersects(TimeSpan pSpan) {
return false;
}
public boolean intersects(DefenseTimeSpan pSpan) {
return false;
}
public static DefenseTimeSpan fromPropertyString(String pString) {
return null;
}
@Override
public String toPropertyString() {
return "";
}
@Override
public String toString() {
String result = "Verteidigung " + validFor + " vom ";
SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy 'um' HH:mm:ss 'Uhr'");
result += f.format(new Date(span.getMinimumLong())) + " bis " + f.format(new Date(span.getMaximumLong()));
return result;
}
}
| [
"Torridity.de@c07c46f2-564f-0410-a54b-ed66933a7292"
] | Torridity.de@c07c46f2-564f-0410-a54b-ed66933a7292 |
1d40ddb28a4cbdc9f339ef6fc2c62967792d41b7 | 8aa2489b94084773b961ab79e8a9722aa6281c9f | /library/src/main/java/hiennguyen/me/bindingadapterdelegate/actionhandler/util/DebounceHelper.java | 5c92dc0ec9bf4e1cabd01b6942ab8e0ef4712c04 | [
"MIT"
] | permissive | vhnguyen1001/Android-Binding-AdapterDelegate | 89116aca03a4920097fb88278797795af25f8f9f | 085f5f0d8fd009b88bfe3e1304454ceb6c9381bc | refs/heads/master | 2021-05-04T17:37:17.637626 | 2018-08-15T15:07:46 | 2018-08-15T15:07:46 | 120,275,247 | 1 | 0 | MIT | 2018-03-25T10:56:30 | 2018-02-05T08:21:13 | Java | UTF-8 | Java | false | false | 2,932 | java | /*
* Copyright Roman Donchenko. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package hiennguyen.me.bindingadapterdelegate.actionhandler.util;
import java.util.HashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* Helper to handle debounce time
* Created on 25.07.2017.
*/
public class DebounceHelper {
private final HashMap<String, Long> mDebounceMap = new HashMap<>();
private final ReentrantReadWriteLock mLock = new ReentrantReadWriteLock();
/**
* Check if time "debounceMillis" elapsed since last timer reset by call {@link #resetTime}
* or {@link #checkTimeAndResetIfElapsed(String, long)}
*
* @param tag the tag
* @param debounceMillis the debounce time for defined tag
* @return true if debounce time has been elapsed since last call, false otherwise
*/
public boolean checkTimeElapsed(String tag, long debounceMillis) {
mLock.readLock().lock();
Long lastCallMillis = this.mDebounceMap.get(tag);
mLock.readLock().unlock();
long nowMillis = System.currentTimeMillis();
return lastCallMillis == null
|| nowMillis - lastCallMillis > debounceMillis;
}
/**
* Reset timer for specific tag
*
* @param tag the tag
*/
public void resetTime(String tag){
mLock.writeLock().lock();
this.mDebounceMap.put(tag, System.currentTimeMillis());
mLock.writeLock().unlock();
}
/**
* Check if time "debounceMillis" elapsed since last timer reset by call {@link #resetTime}
* or {@link #checkTimeAndResetIfElapsed(String, long)}
*
* @param tag the tag
* @param debounceMillis the debounce time for defined tag
* @return true if debounce time has been elapsed since last call, false otherwise
*/
public boolean checkTimeAndResetIfElapsed(String tag, long debounceMillis) {
mLock.readLock().lock();
Long lastCallMillis = this.mDebounceMap.get(tag);
mLock.readLock().unlock();
long nowMillis = System.currentTimeMillis();
if(lastCallMillis == null || nowMillis - lastCallMillis > debounceMillis) {
mLock.writeLock().lock();
this.mDebounceMap.put(tag, nowMillis);
mLock.writeLock().unlock();
return true;
}
return false;
}
}
| [
"[email protected]"
] | |
9c9276e18aa8c72229af21d6d7466695204d8f67 | f35e5a38b56a07c755f4ec00d869b393949510a9 | /admin-app/src/commands/product/AddProductCmd.java | 35f039c318bce8f95307daefaac1d2b8f3b1ae32 | [] | no_license | mohamed-moubarak/Walmart-Replica---MSA | 3db6ae11cb9bf35d2475c7d5470e26da35f0c6ea | 3dc2b199a9a4f588217cc39886ab9b48ea43a238 | refs/heads/master | 2021-01-18T15:29:32.389119 | 2017-05-09T06:43:59 | 2017-05-09T06:43:59 | 86,656,366 | 1 | 0 | null | 2017-05-09T06:28:00 | 2017-03-30T03:48:34 | SQLPL | UTF-8 | Java | false | false | 1,470 | java | package commands.product;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;
import java.util.Map;
import java.math.BigDecimal;
import commands.Command;
class AddProductCmd extends Command implements Runnable {
public StringBuffer execute(Connection connection, Map<String, Object> mapUserData ) throws Exception {
StringBuffer strbufResult;
CallableStatement sqlProc;
String strName,
strDescription;
BigDecimal bdclPrice;
Integer intStock;
strName = (String)mapUserData.get( "name" );
strDescription = (String)mapUserData.get( "description" );
bdclPrice = BigDecimal.valueOf((Double)mapUserData.get( "price" ));
intStock = (Integer)mapUserData.get( "stock" );
if( strName == null || strName.trim( ).length( ) == 0 ||
intStock == null )
return null;
sqlProc = connection.prepareCall("{?=call addProduct(?,?,?,?)}");
sqlProc.registerOutParameter(1, Types.INTEGER );
sqlProc.setString(2, strName );
sqlProc.setString(3, strDescription );
sqlProc.setBigDecimal(4, bdclPrice );
sqlProc.setInt(5, intStock );
sqlProc.execute( );
strbufResult = makeJSONResponseEnvelope( sqlProc.getInt( 1 ) , null, null );
sqlProc.close( );
return strbufResult;
}
}
| [
"[email protected]"
] | |
53c7b8c643cbc33078af3189248d87ea61b28c6e | b082a6f60de747b47c36bca28c9367965df3ef8d | /solutions/1423. Maximum Points You Can Obtain from Cards.java | 5bd736cba5ac9f297c63f258fd37acb23412fcbc | [] | no_license | RajibIT/leetcode | d603060e27fa97b74352ecab40b0c33dca5ef880 | 6e36c70c0159b26a619c7a36656f0056cbb195b2 | refs/heads/main | 2023-08-01T03:46:30.519186 | 2021-09-19T06:33:46 | 2021-09-19T06:33:46 | 393,973,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | class Solution {
public int maxScore(int[] arr, int k) {
int i = arr.length - k;
int sum = 0;
int max = Integer.MIN_VALUE;
int j;
for(j = i; j < arr.length; j++) {
sum += arr[j];
}
max = Math.max(sum, max);
int size = 0;
while(i < arr.length) {
j = j % arr.length;
sum += arr[j] - arr[i];
max = Math.max(max, sum);
i++; j++;
}
return max;
}
}
| [
"[email protected]"
] | |
f0f7339ae4480fa463c862111fa0c70a32fc86d3 | 8aaa1aaf1d9e602fbd21552c0f8b642aec662a56 | /ProjectWBS/backend/src/main/java/com/example/actors/controller/ActorController.java | 963cc3c29a57174f34c63d861cbef84bc4825e5e | [] | no_license | JovanoskaAnaMarija/vbs | a33da9766d3d1ae440b7f736a0eda7467b2c4949 | befee74a58f655eaf2817d73d1354c748e9d4e1f | refs/heads/master | 2023-08-15T03:35:57.073972 | 2021-09-08T21:26:03 | 2021-09-08T21:26:03 | 404,492,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,818 | java | package com.example.actors.controller;
import com.bordercloud.sparql.SparqlClient;
import com.bordercloud.sparql.SparqlClientException;
import com.bordercloud.sparql.SparqlResult;
import com.bordercloud.sparql.SparqlResultModel;
import com.example.actors.model.Actor;
import com.example.actors.model.exceptions.ActorNotFoundException;
import com.example.actors.service.ActorService;
import org.apache.commons.lang3.text.WordUtils;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
import java.net.URISyntaxException;
@RestController
@RequestMapping(value = "/api/actors")
@CrossOrigin(origins = "http://localhost:3000")
public class ActorController {
private final ActorService actorService;
public ActorController(ActorService actorService) {
this.actorService = actorService;
}
@GetMapping("/hello")
public String hello() {
return "Hello";
}
@GetMapping("/search")
public Actor getActorInfo(@RequestParam(name = "actor", required = false) String actor,
@RequestParam(name = "uri", required = false) String uri) throws ActorNotFoundException {
if(uri != null) {
return actorService.getActorInfoWithURI(uri);
}
return actorService.getActorInfo(WordUtils.capitalizeFully(actor));
}
@RequestMapping(method =RequestMethod.GET, value = "/directorWinners")
public SparqlResultModel getDirectorWinners() {
try {
URI endpoint = new URI("https://query.wikidata.org/sparql");
String querySelect = "PREFIX bd: <http://www.bigdata.com/rdf#> \n"
+ "PREFIX p: <http://www.wikidata.org/prop/> \n"
+ "PREFIX pq: <http://www.wikidata.org/prop/qualifier/> \n"
+ "PREFIX ps: <http://www.wikidata.org/prop/statement/> \n"
+ "PREFIX wd: <http://www.wikidata.org/entity/> \n"
+ "PREFIX wdt: <http://www.wikidata.org/prop/direct/> \n"
+ "PREFIX wikibase: <http://wikiba.se/ontology#> \n"
+ " \n"
+ "SELECT DISTINCT ?item ?itemLabel ?awardLabel ?time \n"
+ "{ \n"
+ " # Items with the Occupation(P 106) of Director(Q 3455803) or a subclass(P 279) \n"
+ " ?item wdt:P106/wdt:P279* wd:Q3455803 ; \n"
+ " # ... with an awarded(P 166) statement \n"
+ " p:P166 ?awardStat . \n"
+ " # Get the award (which is \"subject of\" XXth Academy Awards) \n"
+ " ?awardStat pq:P805 ?award ; \n"
+ " # ... that has the value Academy Award for Best Director(Q 103360) \n"
+ " ps:P166 wd:Q103360 . \n"
+ " # the \"point of time\" of the Academy Award \n"
+ " ?award wdt:P585 ?time . \n"
+ " SERVICE wikibase:label { \n"
+ " # ... include the labels \n"
+ " bd:serviceParam wikibase:language \"[AUTO_LANGUAGE],en\" \n"
+ " } \n"
+ "} \n"
+ "ORDER BY DESC(?time) \n";
SparqlClient sc = new SparqlClient(false);
sc.setEndpointRead(endpoint);
SparqlResult sr = sc.query(querySelect);
//sc.printLastQueryAndResult();
return sr.getModel();
} catch (URISyntaxException | SparqlClientException e) {
System.out.println(e);
e.printStackTrace();
}
return null;
}
@RequestMapping(method = RequestMethod.GET, value = "/bestActors")
public SparqlResultModel getBestActorWinnersSorted() {
try {
URI endpoint = new URI("https://query.wikidata.org/sparql");
String queryBestActor = "PREFIX bd: <http://www.bigdata.com/rdf#> \n"
+ "PREFIX p: <http://www.wikidata.org/prop/> \n"
+ "PREFIX pq: <http://www.wikidata.org/prop/qualifier/> \n"
+ "PREFIX ps: <http://www.wikidata.org/prop/statement/> \n"
+ "PREFIX wd: <http://www.wikidata.org/entity/> \n"
+ "PREFIX wdt: <http://www.wikidata.org/prop/direct/> \n"
+ "PREFIX wikibase: <http://wikiba.se/ontology#> \n"
+ " \n" +
"SELECT DISTINCT ?item ?itemLabel ?awardLabel ?time WHERE {"+
"?item (wdt:P106/(wdt:P279*)) wd:Q33999;"+
"p:P166 ?awardStat."+
"?awardStat pq:P805 ?award;"+
"ps:P166 wd:Q103916."+
" ?award wdt:P585 ?time."+
"SERVICE wikibase:label { bd:serviceParam wikibase:language \"[AUTO_LANGUAGE],en\". }"+
"}"+
"ORDER BY DESC (?time)";
SparqlClient sc = new SparqlClient(false);
sc.setEndpointRead(endpoint);
SparqlResult sr = sc.query(queryBestActor);
//sc.printLastQueryAndResult();
return sr.getModel();
} catch (URISyntaxException | SparqlClientException e) {
System.out.println(e);
e.printStackTrace();
}
return null;
}
@RequestMapping(method = RequestMethod.GET, value = "/allBestActors")
public SparqlResultModel getBestActorWinners()
{
try {
URI endpoint = new URI("https://query.wikidata.org/sparql");
String queryBestActor = "PREFIX bd: <http://www.bigdata.com/rdf#> \n"
+ "PREFIX p: <http://www.wikidata.org/prop/> \n"
+ "PREFIX pq: <http://www.wikidata.org/prop/qualifier/> \n"
+ "PREFIX ps: <http://www.wikidata.org/prop/statement/> \n"
+ "PREFIX wd: <http://www.wikidata.org/entity/> \n"
+ "PREFIX wdt: <http://www.wikidata.org/prop/direct/> \n"
+ "PREFIX wikibase: <http://wikiba.se/ontology#> \n"
+ " \n" +
"SELECT ?Academy_Award_for_Best_Actor ?Academy_Award_for_Best_ActorLabel WHERE {"+
"SERVICE wikibase:label { bd:serviceParam wikibase:language \"[AUTO_LANGUAGE],en\". }"+
"?Academy_Award_for_Best_Actor wdt:P1411 wd:Q103916."+
"}";
SparqlClient sc = new SparqlClient(false);
sc.setEndpointRead(endpoint);
SparqlResult sr = sc.query(queryBestActor);
//sc.printLastQueryAndResult();
return sr.getModel();
} catch (URISyntaxException | SparqlClientException e) {
System.out.println(e);
e.printStackTrace();
}
return null;
}
}
| [
"[email protected]"
] | |
21413773c969d6df1a690ee93ea58c83814de617 | 3c0e7baf7caceb75275faf0b134fc2e32e557435 | /src/javasyntax/Array2.java | 4ffc91cbbe8a069800a97560432c8d10bd9036cc | [] | no_license | andhiku/OOPConcept | 7b002ab2ccd458238f90d93c591d08bce75fd72c | dc0a0342ca9c6c82c9f5d63b0318d15c20ce3cbe | refs/heads/master | 2020-03-07T11:34:50.143950 | 2018-04-27T06:54:17 | 2018-04-27T06:54:17 | 127,459,380 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package javasyntax;
public class Array2 {
public static void main(String[] args) {
String[] kota = {"Jakarta", "Surabaya", "Bandung"};
System.out.println(kota[0]);
System.out.println(kota[1]);
System.out.println(kota[2]);
}
}
| [
"[email protected]"
] | |
982a84871c0e559c0100d10cdb92b074e8002177 | 59712eb6994c9854655cd8a0e2b563e3999dfd31 | /src/main/java/edu/rice/cs/caper/vision/core/synthesizer/Variable.java | 21c90f93e6d6afa4759dbcff754a6d097d54cc68 | [
"Apache-2.0"
] | permissive | FoxxyMoxxy/Vision | 4107f75ebe648abd56085084ab41e5be482da0cc | dde4835857ff28f339b8aa379f4d6e6eb1d4b0c7 | refs/heads/master | 2020-03-15T17:08:20.298533 | 2018-05-05T14:17:08 | 2018-05-05T14:17:08 | 132,252,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,012 | java | /*
Copyright 2017 Rice University
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 edu.rice.cs.caper.vision.core.synthesizer;
import org.eclipse.jdt.core.dom.*;
import java.util.*;
/**
* A variable in the synthesizer's type system
*/
public class Variable {
/**
* Name of the variable
*/
private String name;
/**
* Type of the variable
*/
private final Type type;
/**
* Reference count of the variable (used for cost metric)
*/
private int refCount;
/**
* Set of AST node references of this variable. If/when the variable is refactored, these
* AST nodes will be updated. Nodes are automatically added when createASTNode() is called.
*/
private Set<SimpleName> astNodeRefs;
/**
* Properties of this variable
*/
private VariableProperties properties;
/**
* List of variables are variables that are .equals() to this variable but not ==. Typically,
* these were created in different a scope, and when joining scopes, this variable was kept,
* whereas the ones in this list were discarded. Used when refactoring this variable to correctly
* refactor these aliases too.
*/
private List<Variable> aliases;
/**
* Initializes a variable with the given parameters
*
* @param name variable name
* @param type variable type
* @param properties variable properties
*/
Variable(String name, Type type, VariableProperties properties) {
this.name = name;
this.type = type;
this.refCount = 0;
this.astNodeRefs = new HashSet<>();
this.properties = properties;
this.aliases = new ArrayList<>();
}
/**
* Gets the variable name
*
* @return variable name
*/
public String getName() {
return name;
}
/**
* Gets the variable type
*
* @return variable type
*/
public Type getType() {
return type;
}
/**
* Checks if this variable can participate in joins
*
* @return current value
*/
public boolean isJoinVar() {
return properties.getJoin();
}
/**
* Checks if this variable is a user-defined variable
*
* @return current value
*/
public boolean isUserVar() {
return properties.getUserVar();
}
/**
* Checks if a default initializer needs to be synthesized for this variable
*
* @return current value
*/
public boolean isDefaultInit() {
return properties.getDefaultInit();
}
/**
* Checks if this variable is a single use variable
*
* @return current value
*/
public boolean isSingleUseVar() {
return properties.getSingleUse();
}
/**
* Increments the reference counter of this variable
*/
public void addRefCount() {
refCount += 1;
}
/**
* Gets the reference counter of this variable
*
* @return current value
*/
public int getRefCount() {
return refCount;
}
/**
* Adds a variable that is an alias to this variable
*
* @param v the alias variable
*/
public void addAlias(Variable v) {
aliases.add(v);
}
/**
* Creates and associates an AST node (of type SimpleName) referring to this variable
*
* @param ast the owner of the node
* @return the AST node corresponding to this variable
*/
public SimpleName createASTNode(AST ast) {
SimpleName node = ast.newSimpleName(getName());
astNodeRefs.add(node);
return node;
}
/**
* Refactors this variable's name and updates all AST nodes associated with this variable.
* It is the responsibility of the refactoring method to ensure the name is unique wherever
* this variable is referenced. Note: a variable's type cannot be refactored.
*
* @param newName the new name of this variable
*/
public void refactor(String newName) {
this.name = newName;
for (SimpleName node : astNodeRefs)
node.setIdentifier(newName);
List<Variable> refactorDone = new ArrayList<>();
refactorDone.add(this);
for (Variable v : aliases)
v.refactor(newName, refactorDone);
}
/**
* Same as refactor(String) but uses an additional argument to detect and stop cycles in calling refactor
*
* @param newName the new name of this variable
* @param refactorDone list of variables for which refactoring has already been done for this refactor task
*/
private void refactor(String newName, List<Variable> refactorDone) {
this.name = newName;
for (SimpleName node : astNodeRefs)
node.setIdentifier(newName);
refactorDone.add(this);
for (Variable v : aliases) {
boolean done = false;
for (Variable v2 : refactorDone) {
if (v == v2) {
done = true;
break;
}
}
if (! done)
v.refactor(newName, refactorDone);
}
}
/**
* Creates a default initializer expression for this variable
*
* @param ast the owner of the expression
* @return expression that initializes this variable
*/
public Expression createDefaultInitializer(AST ast) {
CastExpression cast = ast.newCastExpression();
cast.setType(type.simpleT(ast, null));
MethodInvocation invocation = ast.newMethodInvocation();
invocation.setExpression(ast.newSimpleName("Vision"));
invocation.setName(ast.newSimpleName("$init"));
cast.setExpression(invocation);
return cast;
}
/**
* Compares two variables based on their name AND type
*
* @param o the object to compare with
* @return whether they are equal
*/
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof Variable))
return false;
Variable v = (Variable) o;
return v.getName().equals(getName()) && v.getType().equals(getType());
}
@Override
public int hashCode() {
return 7 * name.hashCode() + 17 * type.hashCode();
}
/**
* Returns a string representation of this variable (for debug purposes only)
*
* @return string
*/
@Override
public String toString() {
return name + ":" + type;
}
}
| [
"[email protected]"
] | |
3fc0b391c91ea37aea5e632e90cfcc337fa0b4d0 | 2f8ee9f8ccbdbed924c0e507e0d57700a92a8b3d | /src/main/java/IPayable.java | 0723a013874814ca30b0f51986c301f27c3dc8ad | [] | no_license | jonyboi21/EmployeePieLab2 | 68251c4ebcb84a79fe75209206b2b4f292c17bbd | 7edd17daecd363fc42dae4c8009f2ef7db0a472b | refs/heads/main | 2023-03-31T07:06:29.948731 | 2021-04-02T17:44:41 | 2021-04-02T17:44:41 | 354,091,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59 | java | public interface IPayable {
double calculatePay();
}
| [
"[email protected]"
] | |
63f8029eb2cd514eb965cd86d9e6fdc86f48365a | f002e2169fd0eb41d9d24be5f7e6560008f92dfa | /CustomerArrayList.java | dedb6aaceaa190b28c4ead16233d9994a6be17c1 | [] | no_license | csr88/LabQuestions | f476525c3887d680206a5f51f0e949eb96a8003f | bedeb947b051d6989730e8702dc00654ce75e4ab | refs/heads/master | 2023-04-27T08:01:12.884470 | 2021-05-19T03:16:20 | 2021-05-19T03:16:20 | 364,916,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,529 | java |
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.ArrayList;
public class CustomerArrayList {
String name;
double purchase_amount;
double discountAmount;
CustomerArrayList(String name, double purchase_amount){
this.name = name;
this.purchase_amount = purchase_amount;
}
String getName()
{
return name;
}
double getPurchase_amount(){
return purchase_amount;
}
double getDiscountAmount(double discountAmount){
this.discountAmount = discountAmount;
return discountAmount;
}
public static void main(String[] args) throws FileNotFoundException {
ArrayList <CustomerArrayList> list = new ArrayList<CustomerArrayList>();
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of customers you want to add: ");
int count = sc.nextInt();
System.out.println("Customer : "+count);
String names;
double pa;
for(int i = 0;i<count;i++){
System.out.println("Enter name: ");
names = sc.next();
System.out.println("Enter purchase amount: ");
pa = sc.nextDouble();
list.add(new CustomerArrayList(names,pa));
}
PrintWriter outF = new PrintWriter("/home/shishir/IdeaProjects/Shishir/Javalab 10 qsns/src/CustomerArrayList.txt");
outF.printf("ID");
outF.printf("\tName");
outF.printf("\t\tPurchase Amount");
outF.printf("\t\t\tTotal Payable\n");
System.out.println("List of customers");
for(int i = 0;i<count;i++){
System.out.println(list.get(i).name+"==="+list.get(i).purchase_amount);
// outF.printf((i+1) + "\t" + list.get(i).name + "\t\t\t" + list.get(i).purchase_amount + "\n" );
// outF.printf("\t"+list.get(i).name);
// outF.printf("\t\t\t"+ list.get(i).purchase_amount + "\n");
}
//getting the discount
double discountpercentage;
double payableamount = 0;
double totalamount =0;
for(int i=0;i<count;i++){
// can do both of these, one called from varible and one from method
// outF.printf((i+1) + "\t" + list.get(i).name + "\t\t\t\t\t" + list.get(i).purchase_amount );
outF.printf((i+1) + "\t" + list.get(i).getName() + "\t\t\t\t\t" + list.get(i).getPurchase_amount() );
if(list.get(i).purchase_amount<=1000){
discountpercentage =0.05;
list.get(i).discountAmount = discountpercentage * list.get(i).purchase_amount;
payableamount = list.get(i).purchase_amount - list.get(i).discountAmount;
outF.printf("\t\t\t"+ payableamount + "\n");
totalamount += payableamount;
}
else{
discountpercentage=0.10;
list.get(i).discountAmount = discountpercentage * list.get(i).purchase_amount;
payableamount = list.get(i).purchase_amount - list.get(i).discountAmount;
outF.printf("\t\t\t"+ payableamount + "\n");
totalamount += payableamount;
}
}
outF.printf("\n.\n.");
outF.printf("\n===================================================================");
outF.printf("\nTotal Amount:");
outF.printf("\t\t\t\t\t\t\t\tRs." + payableamount );
outF.close();
sc.close();
}
} | [
"[email protected]"
] | |
94d1dfa1d35e25689f3f0e525b067f93c77a9679 | e4cd2f9952127d4cb7863ec85082dd2e3e1e6f66 | /src/main/java/com/project/swordsmanhouse/utils/GenericException.java | 2acbdd41a678854d859aefa5bbb5d570274bbe56 | [] | no_license | Wangyaoyo/SwordManHouse | a784fb5617d74995c72664ba2774688e4bbf839a | 3803fcd68d36a1d260ec68eeb6ceba5a06e9aae5 | refs/heads/main | 2023-07-18T21:01:10.003057 | 2021-08-31T01:54:14 | 2021-08-31T01:54:14 | 401,532,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package com.project.swordsmanhouse.utils;
/**
* 自定义异常类
*
* @author wy
* @version 1.0
*/
public class GenericException extends RuntimeException {
private static final long serialVersionUID = 1L;
public GenericException(String message) {
super(message);
}
}
| [
"[email protected]"
] | |
4a6df096688d835237bacb8650f5b086de3a4580 | beb2fbdd8e5343fe76c998824c7228a546884c5e | /com.kabam.marvelbattle/src/com/google/android/gms/common/data/h.java | 978d1d05fc022cd8e7a43bad80352002ffcda2b6 | [] | no_license | alamom/mcoc_11.2.1_store_apk | 4a988ab22d6c7ad0ca5740866045083ec396841b | b43c41d3e8a43f63863d710dad812774cd14ace0 | refs/heads/master | 2021-01-11T17:13:02.358134 | 2017-01-22T19:51:35 | 2017-01-22T19:51:35 | 79,740,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 885 | java | package com.google.android.gms.common.data;
import java.util.NoSuchElementException;
public class h<T>
extends c<T>
{
private T Kr;
public h(DataBuffer<T> paramDataBuffer)
{
super(paramDataBuffer);
}
public T next()
{
if (!hasNext()) {
throw new NoSuchElementException("Cannot advance the iterator beyond " + this.JW);
}
this.JW += 1;
if (this.JW == 0)
{
this.Kr = this.JV.get(0);
if (!(this.Kr instanceof d)) {
throw new IllegalStateException("DataBuffer reference of type " + this.Kr.getClass() + " is not movable");
}
}
else
{
((d)this.Kr).ap(this.JW);
}
return (T)this.Kr;
}
}
/* Location: C:\tools\androidhack\com.kabam.marvelbattle\classes.jar!\com\google\android\gms\common\data\h.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
30de65b7e66c2f7230397eb2426f45ec278be0d4 | 1930d97ebfc352f45b8c25ef715af406783aabe2 | /src/main/java/com/alipay/api/domain/AlipayEcoEprintTaskSubmitModel.java | ecf485f50ff142a2afc54d23dbf1deb0ba434264 | [
"Apache-2.0"
] | permissive | WQmmm/alipay-sdk-java-all | 57974d199ee83518523e8d354dcdec0a9ce40a0c | 66af9219e5ca802cff963ab86b99aadc59cc09dd | refs/heads/master | 2023-06-28T03:54:17.577332 | 2021-08-02T10:05:10 | 2021-08-02T10:05:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,805 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 易联云打印对外接口服务
*
* @author auto create
* @since 1.0, 2019-09-06 17:56:47
*/
public class AlipayEcoEprintTaskSubmitModel extends AlipayObject {
private static final long serialVersionUID = 8729774365764186927L;
/**
* 应用ID
*/
@ApiField("client_id")
private String clientId;
/**
* 应用Secret
*/
@ApiField("client_secret")
private String clientSecret;
/**
* 打印内容
*/
@ApiField("content")
private String content;
/**
* 应用访问凭证
*/
@ApiField("eprint_token")
private String eprintToken;
/**
* 终端号
*/
@ApiField("machine_code")
private String machineCode;
/**
* 业务内部编号
*/
@ApiField("origin_id")
private String originId;
public String getClientId() {
return this.clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getClientSecret() {
return this.clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public String getEprintToken() {
return this.eprintToken;
}
public void setEprintToken(String eprintToken) {
this.eprintToken = eprintToken;
}
public String getMachineCode() {
return this.machineCode;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getOriginId() {
return this.originId;
}
public void setOriginId(String originId) {
this.originId = originId;
}
}
| [
"[email protected]"
] | |
5454cfc6c62a9c860297f5edad000bccef971026 | 97c39697b5a6e39b994bcc9418165d8721573158 | /MainApp.java | 504767d21311c853ddc7545068312e15994df4ae | [] | no_license | arya545/Spring2-Assignment3 | c571fcd55043fb50dd9acd0857aed34ffb9d2416 | 68aa4d4a4d5395ece1bb20691f03dc0ae22922d5 | refs/heads/master | 2021-01-22T08:14:12.673181 | 2017-05-27T15:53:38 | 2017-05-27T15:53:38 | 92,608,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | /**
*
*/
package com.setter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author SURYA
*
*/
public class MainApp {
/**
*
*/
public MainApp() {
// TODO Auto-generated constructor stub
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
TextEditor te=(TextEditor) context.getBean("texteditor");
te.spellCheck();
}
}
| [
"[email protected]"
] | |
6453df071569909778af3d6b11e5eb67f8dc84a7 | 058c491052d289459bf70886dc9f31a25d2daf6b | /provider-ticket/src/main/java/com/wh/ticket/service/TicketService.java | b357595e07e7807d11f90324bb5e59167ac0ce66 | [] | no_license | Dongdonghe1981/spring-boot-demo | 0eb8f77e2171f7886c78386b4d8a4baeec1ddb93 | 0381d4fc4ff21bb82cf1354abb519c87201d03a7 | refs/heads/master | 2022-06-21T21:19:44.290808 | 2020-01-05T12:53:23 | 2020-01-05T12:53:23 | 226,982,873 | 0 | 0 | null | 2022-06-10T20:00:56 | 2019-12-09T22:48:21 | Java | UTF-8 | Java | false | false | 91 | java | package com.wh.ticket.service;
public interface TicketService {
String getTicket();
}
| [
"“[email protected]”"
] | |
df7b27d5eb53e1ec5127e621f1a5708a18d65e47 | a6e4c8550310fae4389b04089db75aaccd53120e | /High School/USACO Training Pages/Section1_3/crypt1.java | 33741859368092e257061eeb1e9c078a9dc70be5 | [] | no_license | screenhunter/High-School | 6a29946cdfa628e864310d1d08f0d3eeb1681b74 | 7a7fe464a5f17c85338faaed0567f10534a0177a | refs/heads/master | 2021-03-19T16:42:56.021547 | 2018-01-10T01:16:52 | 2018-01-10T01:16:52 | 116,891,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,367 | java | /*
PROG: crypt1
LANG: JAVA
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
public class crypt1 {
private static int N;
private static ArrayList<String> nums;
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("crypt1.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("crypt1.out")));
N = Integer.parseInt(in.readLine());
nums = new ArrayList<String>();
String[] line = in.readLine().split(" ");
for (int i = 0; i < N; i++)
nums.add(line[i]);
int count = 0;
for (int i = 100; i <= 999; i++) {
if (!check(i))
continue;
for (int j = 10; j <= 99; j++) {
if (!check(j))
continue;
if ((i*j + "").length() != 4 || !check(i*j))
continue;
if ((i*(j/10) + "").length() != 3 || !check(i*(j/10)))
continue;
if ((i*(j%10) + "").length() != 3 || !check(i*(j%10)))
continue;
count++;
}
}
out.println(count);
in.close();
out.close();
System.exit(0);
}
private static boolean check(int x) {
for (char c: (x + "").toCharArray())
if (!nums.contains(c + ""))
return false;
return true;
}
}
| [
"[email protected]"
] | |
1c1f5a5801896d575e8eb2c2463be098aa7bad5f | d498aa247b1cdbd88e8ef964f2498230c1195bdf | /src/com/how2java/controller/PageController.java | 3353ff8df92f47ce2024fc3f1c8136e4b4c41bfc | [] | no_license | cong921/shiro | b338b6bdb8c696c72a36533050b7d5773a6d38c0 | 47f9db0b5b268714cc546b2424ee88cee9260c18 | refs/heads/master | 2020-03-28T01:26:08.651386 | 2018-09-06T01:29:14 | 2018-09-06T01:29:14 | 147,503,470 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,253 | java | package com.how2java.controller;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
//专门用于显示页面的控制器
@Controller
@RequestMapping("")
public class PageController {
@RequestMapping("index")
public String index(){
return "index";
}
@RequiresPermissions("deleteOrder")
@RequestMapping("deleteOrder")
public String deleteOrder(){
return "deleteOrder";
}
@RequiresRoles("productManage")
@RequestMapping("deleteProduct")
public String deleteProduct(){
return "deleteProduct";
}
@RequestMapping("listProduct")
public String listProduct(){
return "listProduct";
}
@RequestMapping("updateOrder")
public String updateOrder(){
return "updateOrder";
}
@RequestMapping(value="/login",method=RequestMethod.GET)
public String login(){
return "login";
}
@RequestMapping("unauthorized")
public String noPerms(){
return "unauthorized";
}
} | [
"[email protected]"
] | |
fea247d4a85e59ed9cab20b2e042ea1fe33ebd82 | 632d183eb9eff0c49eafc93bf27487052be75cc5 | /src/test/java/com/example/bddspring1586283734/DemoApplicationTests.java | 8dae01b9608667aac0ee749b281382e8b35ebb43 | [] | no_license | cb-kubecd/bdd-spring-1586283734 | a22633ba6b6aafcc09f5f20453148ebb723393ab | 41115b291131fa21f534b4f6071ee45102e94e33 | refs/heads/master | 2021-05-25T18:50:15.750568 | 2020-04-07T18:22:38 | 2020-04-07T18:22:38 | 253,877,777 | 0 | 0 | null | 2020-04-07T18:33:09 | 2020-04-07T18:22:43 | Makefile | UTF-8 | Java | false | false | 221 | java | package com.example.bddspring1586283734;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}
| [
"[email protected]"
] | |
840123d31c694e33f52724594c367756a3af0696 | 71f03502b40720852fe9f22876adbbb9061d06b9 | /_extend/solon.cloud/src/main/java/org/noear/solon/cloud/integration/springboot/EnableCloud.java | 38d9ca8a9b20bb0c7f95b0809fd275d4fdfa1f54 | [
"Apache-2.0"
] | permissive | hack0303/solon | 1083bb48e80768e6fdce2330c64d1d89198c648b | bfd23a163a0dfb70632ee0dc163346e7b347b8d4 | refs/heads/master | 2023-04-09T14:36:40.261976 | 2021-04-09T14:44:37 | 2021-04-09T14:44:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package org.noear.solon.cloud.integration.springboot;
import org.noear.solon.annotation.Import;
import java.lang.annotation.*;
/**
* @author noear
* @since 1.3
*/
@Import(AutoConfigurationCloud.class)
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface EnableCloud {
}
| [
"[email protected]"
] | |
d4abc74189caf1cac6945d141d5bd54f747aeadd | b8b7b827642da83c5a9dc49c2aa7ca79e2ad048f | /common/src/main/java/ru/ares4322/distributedcounter/common/sender/SenderTask.java | 324d7fd160fc0ada563e4d4363c27a8bbb9aa60e | [] | no_license | grigoriy-orlov/disributed-counter | 32c5b324e7484389aa24069a5d8594dd5e98db3b | b0592185e971f2e42777a4ce6f2150639d1125cd | refs/heads/master | 2021-01-24T22:07:13.384299 | 2014-06-11T08:04:17 | 2014-06-11T08:04:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | package ru.ares4322.distributedcounter.common.sender;
import ru.ares4322.distributedcounter.common.domain.Packet;
public interface SenderTask extends Runnable {
void setPacket(Packet packet);
}
| [
"[email protected]"
] | |
e83db0eb8081ccdb170b60464aa3f92eb59bdfce | be6958ea90788ac4d3d4e83b2da92017c46c422c | /app/src/main/java/com/kammo/alokrabi/be_a_android_developer/ExpandableListAdapter2.java | 531621440d1d8f00c3066a0559ce8a2cca28a919 | [] | no_license | Ritu1911/AndroidDeveloperGuide | 8c821ba806b8ed0f7aa50e6b836d47c595adce3f | 59e8b439d51902c60bb828210fe3f092be7d51fd | refs/heads/master | 2020-04-05T02:36:09.585895 | 2018-11-07T03:06:14 | 2018-11-07T03:06:14 | 156,481,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,428 | java | package com.kammo.alokrabi.be_a_android_developer;
/**
* Created by Kamala on 2/8/2018.
*/
import java.util.HashMap;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
public class ExpandableListAdapter2 extends BaseExpandableListAdapter{
private Context _context;
private List<String> _listDataHeader2; // header titles
// child data in format of header title, child title
private HashMap<String, List<String>> _listDataChild2;
public ExpandableListAdapter2(Context context, List<String> listDataHeader2,
HashMap<String, List<String>> listChildData2) {
this._context = context;
this._listDataHeader2 = listDataHeader2;
this._listDataChild2 = listChildData2;
}
@Override
public Object getChild(int groupPosition, int childPosititon) {
return this._listDataChild2.get(this._listDataHeader2.get(groupPosition))
.get(childPosititon);
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
final String childText = (String) getChild(groupPosition, childPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_item2, null);
}
TextView txtListChild = (TextView) convertView
.findViewById(R.id.lblListItem2);
txtListChild.setText(childText);
return convertView;
}
@Override
public int getChildrenCount(int groupPosition) {
return this._listDataChild2.get(this._listDataHeader2.get(groupPosition))
.size();
}
@Override
public Object getGroup(int groupPosition) {
return this._listDataHeader2.get(groupPosition);
}
@Override
public int getGroupCount() {
return this._listDataHeader2.size();
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
String headerTitle2 = (String) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_group2, null);
}
TextView lblListHeader2 = (TextView) convertView
.findViewById(R.id.lblListHeader2);
lblListHeader2.setTypeface(null, Typeface.BOLD);
lblListHeader2.setText(headerTitle2);
return convertView;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
}
| [
"[email protected]"
] | |
dc087f38e8e2f4fcb084879de45f5ffbaca3568c | abfbcdcaace95a146de6d281d1d905b1b2cea8e7 | /src/main/java/com/google/api/codegen/transformer/SchemaTypeNameConverter.java | 7ff1d078b2050b66e60f6d1754b7d379bdb33127 | [
"Apache-2.0"
] | permissive | toongegi/gapic-generator | f52a69bd1e1205c6b8ee5916437c225a42b1ecb7 | ce3411305d0bc377a83fe1d4b4ae870ab7d3f496 | refs/heads/master | 2020-03-21T11:39:40.378457 | 2018-06-22T20:04:00 | 2018-06-22T20:04:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,921 | java | /* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.codegen.transformer;
import com.google.api.codegen.config.DiscoveryField;
import com.google.api.codegen.config.DiscoveryRequestType;
import com.google.api.codegen.config.FieldModel;
import com.google.api.codegen.config.InterfaceModel;
import com.google.api.codegen.config.TypeModel;
import com.google.api.codegen.discogapic.transformer.DiscoGapicNamer;
import com.google.api.codegen.discovery.Method;
import com.google.api.codegen.discovery.Schema;
import com.google.api.codegen.util.TypeName;
import com.google.api.codegen.util.TypedValue;
import com.google.api.tools.framework.model.EnumValue;
/** SchemaTypeNameConverter maps Schema instances to TypeName instances. */
public abstract class SchemaTypeNameConverter implements TypeNameConverter {
public abstract DiscoGapicNamer getDiscoGapicNamer();
public abstract SurfaceNamer getNamer();
public enum BoxingBehavior {
// Box primitive types, e.g. Boolean instead of boolean.
BOX_PRIMITIVES,
// Don't box primitive types.
NO_BOX_PRIMITIVES
}
/**
* Provides a TypeName for the given Schema.
*
* @param field
*/
public abstract TypeName getTypeName(DiscoveryField field);
/** Provides a TypeName for the given Schema. */
public abstract TypeName getTypeName(DiscoveryField type, BoxingBehavior boxingBehavior);
/**
* Provides a TypedValue containing the zero value of the given type, plus the TypeName of the
* type; suitable for use within code snippets.
*/
public abstract TypedValue getSnippetZeroValue(DiscoveryField field);
/**
* Provides a TypedValue containing the zero value of the given type, plus the TypeName of the
* type; suitable for use within code snippets.
*/
public abstract TypedValue getSnippetZeroValue(TypeModel type);
/**
* Provides a TypedValue containing the zero value of the given type, plus the TypeName of the
* type; suitable for use within code snippets.
*/
public abstract TypedValue getEnumValue(DiscoveryField field, String value);
/** Provides a TypeName for the element type of the given schema. */
public abstract TypeName getTypeNameForElementType(DiscoveryField type);
/** Provides a TypeName for the element type of the given TypeModel. */
public abstract TypeName getTypeNameForElementType(TypeModel type);
/**
* Provides a TypedValue containing the zero value of the given type, for use internally within
* the vkit layer; plus the TypeName of the type. This will often return the same value as {@link
* #getSnippetZeroValue(DiscoveryField)}.
*/
public abstract TypedValue getImplZeroValue(DiscoveryField discoveryField);
/** Renders the given value if it is a primitive type. */
public abstract String renderPrimitiveValue(Schema schema, String value);
/** Renders the given value if it is a primitive type. */
public abstract String renderPrimitiveValue(TypeModel type, String value);
/** Renders the value as a string. */
public abstract String renderValueAsString(String value);
@Override
public TypeName getTypeName(InterfaceModel interfaceModel) {
return new TypeName(interfaceModel.getFullName());
}
@Override
public TypeName getTypeName(FieldModel type) {
return getTypeName((DiscoveryField) type);
}
@Override
public TypeName getTypeName(TypeModel type) {
if (type instanceof DiscoveryRequestType) {
Method method = ((DiscoveryRequestType) type).parentMethod().getDiscoMethod();
return getDiscoGapicNamer().getRequestTypeName(method, getNamer());
}
return getTypeNameForElementType(type);
}
@Override
public TypedValue getEnumValue(FieldModel type, EnumValue value) {
return TypedValue.create(getTypeName(type), "%s." + value.getSimpleName());
}
@Override
public TypeName getTypeNameForElementType(FieldModel type) {
return getTypeNameForElementType(type.getType());
}
@Override
public TypedValue getSnippetZeroValue(FieldModel type) {
return getSnippetZeroValue(type.getType());
}
@Override
public TypedValue getImplZeroValue(FieldModel type) {
return getImplZeroValue((DiscoveryField) type);
}
@Override
public String renderPrimitiveValue(FieldModel type, String value) {
return renderPrimitiveValue(((DiscoveryField) type).getDiscoveryField(), value);
}
}
| [
"[email protected]"
] | |
b9f7e62dd02bf54527d3b592e39b7e0e93ef3355 | 476c08924cd7bae8b25dc6395dbf05a8edb7428d | /questrush/src/main/java/com/example/questrush/questrush/Activity_Login.java | a5a3d7a94d1c05e8081f47b09e167b5ea913a841 | [] | no_license | raskin-aleksandr/QuestRush_gradle | addab6d59041156dbf9c5178a5e79b4a393cd25d | 072999b70e5b36ca626bf7a615e331deb857e71a | refs/heads/master | 2021-01-19T06:59:14.422316 | 2015-03-21T10:06:33 | 2015-03-21T10:06:33 | 32,627,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,023 | java | package com.example.questrush.questrush;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.Toast;
import com.gc.materialdesign.views.ButtonRectangle;
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.RequestPasswordResetCallback;
public class Activity_Login extends ActionBarActivity {
ProgressDialog pd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity__login);
ButtonRectangle loginButton = (ButtonRectangle) findViewById(R.id.loginButton);
loginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
EditText name = (EditText) findViewById(R.id.loginName);
EditText password = (EditText) findViewById(R.id.loginPassword);
pd = new ProgressDialog(Activity_Login.this);
pd.setTitle(getString(R.string.login_login));
pd.setMessage(getString(R.string.loggin_in));
pd.show();
ParseUser.logInInBackground(name.getText().toString(), password.getText().toString(), new LogInCallback() {
@Override
public void done(ParseUser arg0, ParseException e) {
if (e == null) {
pd.cancel();
Intent intent = new Intent(getApplicationContext(), Activity_QuestList.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else {
pd.cancel();
Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
});
final ButtonRectangle resetPassword = (ButtonRectangle) findViewById(R.id.resetButton);
resetPassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final Dialog resetDialog = new Dialog(Activity_Login.this);
resetDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
resetDialog.setContentView(R.layout.dialog_reset);
resetDialog.setTitle(getString(R.string.reset_title));
final EditText eMail = (EditText) resetDialog.findViewById(R.id.reset);
ButtonRectangle reset = (ButtonRectangle) resetDialog.findViewById(R.id.resetSend);
reset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ParseUser.requestPasswordResetInBackground(eMail.getText().toString(), new RequestPasswordResetCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Toast.makeText(getApplicationContext(), getString(R.string.reset_toast) + eMail.getText().toString(), Toast.LENGTH_SHORT).show();
resetDialog.cancel();
} else {
Toast.makeText(getApplicationContext(), e.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
resetDialog.cancel();
}
}
});
}
});
resetDialog.show();
}
});
}
} | [
"[email protected]"
] | |
977f2db4350c0279dea70ffc8cbdcb35f536c36f | 51c67d93c5ebc14d00cdddd82b34b2f8282e9516 | /src/io/github/woulfiee/ally/listener/Listeners.java | 2313c242603c585e37e399c5bfe93c8ec12769ea | [] | no_license | Woulfiee/BSCWoulfiee | 937d1fbb3f7d82ef6ed2126a570a8c3deda16369 | a2b35eb30588e0327ce7f3e93f6b39e47c734051 | refs/heads/master | 2020-03-25T08:20:17.985077 | 2018-08-05T11:31:50 | 2018-08-05T11:31:50 | 143,607,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,600 | java | package io.github.woulfiee.ally.listener;
import io.github.woulfiee.ally.Ally;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
/**
* Copyright (c) 2018 by Woulfiee. Created on 8/5/2018.
* You are not permitted to use this code without my permission.
* Contact: [email protected]
*/
public class Listeners implements Listener {
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof Player && event.getEntity() instanceof Player) {
if (areAllies((Player) event.getEntity(), (Player) event.getDamager())) {
event.setCancelled(true);
}
}
}
@EventHandler
public void onInvInteract(InventoryClickEvent event) {
if (event.getInventory().getName().equals("Twoje sojusze")) {
event.setResult(Event.Result.DENY);
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
if (Ally.getInstance().getConfig().getStringList(event.getWhoClicked().getName()).contains(event.getCurrentItem().getItemMeta().getDisplayName())) {
if (Bukkit.getPlayer(event.getCurrentItem().getItemMeta().getDisplayName()) != null) {
Player player = Bukkit.getPlayer(event.getCurrentItem().getItemMeta().getDisplayName());
Location location = player.getLocation();
event.getWhoClicked().closeInventory();
event.getWhoClicked().teleport(location);
event.getWhoClicked().sendMessage("§6[Sojusz] §aPrzeteleportowano do gracza §e" + player.getName() + "§a.");
player.sendMessage("§6[Sojusz] §aGracz §e" + player.getName() + " §aprzeteleportowal sie do Ciebie");
} else {
event.getWhoClicked().sendMessage("§6[Sojusz] §aTego gracza nie ma na serwerze.");
}
}
}
}
}
private boolean areAllies(Player player1, Player player2) {
return (Ally.getInstance().getConfig().getStringList(player1.getName()).contains(player2.getName())
&& Ally.getInstance().getConfig().getStringList(player2.getName()).contains(player1.getName()));
}
}
| [
"[email protected]"
] | |
2c461b71d83c6b7a57a3b6f9de320625999c074c | bd5332cca03852b70e15ec408426dc5bc31278e4 | /wear/src/main/java/com/gilcu2/gridpageviewer2/SimpleGridActivity.java | ea59f3d8b58e305bb68af43c8925663f9f24fbe1 | [] | no_license | gilcu2/GridPageViewer2 | 886fbfd4a78b99d7b154a087d0b22d0f433d5ae2 | be4a358625bf6839ae0430150eec66470c741b77 | refs/heads/master | 2021-01-21T08:02:20.788306 | 2017-02-27T16:30:12 | 2017-02-27T16:30:12 | 83,331,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,251 | java | package com.gilcu2.gridpageviewer2;
/**
* Created by gilcu2 on 2/27/17.
*/
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.wearable.view.DotsPageIndicator;
import android.support.wearable.view.GridViewPager;
import com.learnandroidwear.simplegridview.R;
public class SimpleGridActivity extends Activity {
private Resources res;
private GridViewPager mPager;
private int[] mImages = {R.drawable.ic_brightness_4_black_24dp,
R.drawable.ic_brightness_5_black_24dp,
R.drawable.ic_brightness_6_black_24dp,
R.drawable.ic_filter_1_black_24dp,
R.drawable.ic_filter_2_black_24dp
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
res = getResources();
mPager = (GridViewPager) findViewById(R.id.pager);
//---Assigns an adapter to provide the content for this pager---
mPager.setAdapter(new MyGridAdapter(this, mImages));
DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
dotsPageIndicator.setPager(mPager);
}
} | [
"[email protected]"
] | |
009aca8784737bdd0855c25227192c6c5b35ca31 | 6d7c381f8e2c06f43aad9d5186f0fa805cc10c96 | /app/src/main/java/com/example/myapplication/ParseContent.java | aa436665082035600615a921be34c4c44d7e3253 | [] | no_license | hnpineda/AMST_2da_Evaluacion | 617f38bfec15ba0c13ee24a76bf40442ff7d8dd0 | 5ee325cc9b3f605e75aba6473235f8fbb144e9f8 | refs/heads/master | 2020-12-15T20:21:20.857171 | 2020-01-22T00:43:09 | 2020-01-22T00:43:09 | 235,243,709 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,019 | java | package com.example.myapplication;
import android.app.Activity;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
public class ParseContent {
private final String KEY_SUCCESS = "status";
private final String KEY_MSG = "message";
private Activity activity;
public ArrayList<PlayersModel> playersModelArrayList = new ArrayList<>();
public ParseContent(Activity activity) {
this.activity = activity;
}
public boolean isSuccess(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.optString(KEY_SUCCESS).equals("true")) {
return true;
} else {
return false;
}
} catch (JSONException e) {
e.printStackTrace();
}
return false;
}
public String getErrorCode(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
return jsonObject.getString(KEY_MSG);
} catch (JSONException e) {
e.printStackTrace();
}
return "No data";
}
public ArrayList<PlayersModel> getInfo(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
if (jsonObject.getString(KEY_SUCCESS).equals("true")) {
JSONArray dataArray = jsonObject.getJSONArray("data");
for (int i = 0; i < dataArray.length(); i++) {
PlayersModel playersModel = new PlayersModel();
JSONObject dataobj = dataArray.getJSONObject(i);
playersModel.setName(dataobj.getString(AndyConstants.Params.NAME)); //Set del nombrE
playersModelArrayList.add(playersModel);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return playersModelArrayList;
}
} | [
"[email protected]"
] | |
c1dab3cfb7d46f9562aa35662ecefd781c502299 | a6e7d1c5170382550ba07e96140e31e0995a4ef1 | /src/Definition.java | 3311fe414fb4f474329e5ab4ed2bd9f8660b9823 | [
"MIT"
] | permissive | aaptxstate/Project-A | 674c82e1477a56daa0ced9792c8b2a026244b99a | d228d93386d998ccf1018b50db5e1cd000718a38 | refs/heads/master | 2021-07-22T23:28:11.409936 | 2017-10-30T18:22:27 | 2017-10-30T18:22:27 | 106,953,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | public class Definition {
String name;
String[] definitions;
Definition(String name, String[] definitions) {
this.name = name;
this.definitions = definitions;
}
}
| [
"[email protected]"
] | |
4419a3d2c354bf1529ca75766fb82a9b7eaaea96 | 20591524b55c1ce671fd325cbe41bd9958fc6bbd | /service-consumer/src/main/java/com/rongdu/loans/loan/option/LoanProductTermOP.java | 7c1cfd1f990f0e8f92cfdedb3e6e97643568d5fd | [] | no_license | ybak/loans-suniu | 7659387eab42612fce7c0fa80181f2a2106db6e1 | b8ab9bfa5ad8be38dc42c0e02b73179b11a491d5 | refs/heads/master | 2021-03-24T01:00:17.702884 | 2019-09-25T15:28:35 | 2019-09-25T15:28:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 957 | java | package com.rongdu.loans.loan.option;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class LoanProductTermOP implements Serializable {
/**
* 序列号
*/
private static final long serialVersionUID = 3740550595241138961L;
@NotBlank(message="产品代码不能为空")
private String productId; // 产品代码
@NotBlank(message="产品期限单位不能为空")
private String termUnit; // 产品期限单位(D-天,M-月)
@NotBlank(message="产品期限不能为空")
private String term; // 产品期限(天或月)
public String getProductId() {
return productId;
}
public String getTermUnit() {
return termUnit;
}
public String getTerm() {
return term;
}
public void setProductId(String productId) {
this.productId = productId;
}
public void setTermUnit(String termUnit) {
this.termUnit = termUnit;
}
public void setTerm(String term) {
this.term = term;
}
}
| [
"[email protected]"
] | |
93358f9511b611af4d18a4b28020899ba3c75791 | e25ba719aca74e204b8688f9b9f2c9c4b2d39357 | /WeatherAPI/src/main/java/com/weatherinfo/java/model/Data.java | 83be78fc8ecbc384c05b11e90dde1780a77baa12 | [] | no_license | k-samta/Innovecture | 51b5a2697f14250ce2b3adce23ed2e8938000317 | 9af6af3965e17bff1c80a5c0a93675dd6e1abf88 | refs/heads/main | 2023-02-15T14:20:50.505094 | 2021-01-08T06:49:12 | 2021-01-08T06:49:12 | 327,818,288 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 983 | java | package com.weatherinfo.java.model;
import io.swagger.annotations.ApiModel;
@ApiModel(description="All details about Weather.")
public class Data {
Location LocationObject;
Current CurrentObject;
Forecast ForecastObject;
Alerts AlertsObject;
// Getter Methods
public Location getLocation() {
return LocationObject;
}
public Current getCurrent() {
return CurrentObject;
}
public Forecast getForecast() {
return ForecastObject;
}
public Alerts getAlerts() {
return AlertsObject;
}
// Setter Methods
public void setLocation(Location locationObject) {
this.LocationObject = locationObject;
}
public void setCurrent(Current currentObject) {
this.CurrentObject = currentObject;
}
public void setForecast(Forecast forecastObject) {
this.ForecastObject = forecastObject;
}
public void setAlerts(Alerts alertsObject) {
this.AlertsObject = alertsObject;
}
}
| [
"[email protected]"
] | |
28b3fb7d1a6e4ea9ca9bbec309de33a2fa749f12 | 1cc602a7cacd51ccf8afcbb0aa6f646be42633b0 | /JavaSE/Day21/src/com/homeWork/utils/ClassUtils.java | b9feba47c1aa6a3b7562458af150870b9dc9cdec | [] | no_license | huaiyanchen/WebHomeWork | 57e30391fdcdba86033db560fc282d000fee18e4 | 0b7c53fd90360588f7d596728f46b9baf1fa6c2d | refs/heads/master | 2023-05-12T09:59:23.030397 | 2021-04-27T07:01:15 | 2021-04-27T07:01:15 | 374,512,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,115 | java | package com.homeWork.utils;
/**
* @Author:chy
* @Version:1.0
* @Date:2021/4/20-17:06
* @Since:jdk1.8
* @Description:TODO
*/
public class ClassUtils {
public static String classStringCast(String columnLabel) {
StringBuilder stringBuilder = new StringBuilder("set");
stringBuilder.append(columnLabel.substring(0,1).toUpperCase());
stringBuilder.append(columnLabel.substring(1,columnLabel.length()));
if (stringBuilder.toString().contains("_")) {
}
return stringBuilder.toString();
}
public static Class classCast(String columnTypeName) {
Class<?> aClass = null;
try {
//两种特殊的时间类
if("java.sql.Timestamp".equals(columnTypeName)){
columnTypeName = "java.util.Date";
}
if("java.sql.Date".equals(columnTypeName)){
columnTypeName = "java.util.Date";
}
aClass =Class.forName(columnTypeName);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return aClass;
}
} | [
"[email protected]"
] | |
bc3235ee0759c1c16559fe5561752400a01975ae | 78e57cb3cd5e0e512f7dcfa933d4db12ab661d4a | /src/test/java/Step_Def/LoginStepDef.java | 6cb13619143624a3d0bf16cf313489a55502ae53 | [] | no_license | marvinra/AutomationFramework | 6b0ad4a8758196cf2ca5646251f2e90a8feabf72 | 61c141029a402864d33fbcfaa25632546d2fe03b | refs/heads/master | 2020-03-22T21:00:22.262025 | 2018-07-12T04:10:48 | 2018-07-12T04:10:48 | 140,648,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package Step_Def;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import utilities.Base;
import utilities.LoginPage;
import utilities.ReadPropertyFile;
public class LoginStepDef extends Base{
LoginPage userLoginPage = new LoginPage();
ReadPropertyFile data = new ReadPropertyFile();
@Given("^user goes to url$")
public void user_goes_to_url() throws Throwable {
String server = System.getProperty("target.server");
String url = data.geturl();
switch (server) {
case "App":
driver.get(url);
userLoginPage.userLogsInToApp(data.getUserName(), data.getPassword());
break;
}
}
}
| [
"[email protected]"
] | |
9238242bbc138e217bae3d2048a8f098c1eb7937 | c7708899b17000c4fefe7b42ba616717356226fd | /Main.java | ac9aef81460141a9ad8a0fde5f746c29ecc3d1c5 | [] | no_license | DeimosC1/ShipsOOP | 6350b83ff218d233375c9b3a7fa7dd210e962caf | cdb0ff4fcc09a481a1c417b77d6ec8d2dbaff7d6 | refs/heads/main | 2023-02-01T03:18:07.638983 | 2020-12-17T16:04:20 | 2020-12-17T16:04:20 | 322,343,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 479 | java | public class Main {
public static void main(String[] args) {
Ship destroyer = new Builder("Destroyer",3 ,2,).hitpoints(100).damage(50);
Ship PTB = new Builder("Patrol Boat",2 ,1,).hitpoints(20).damage(45);
Ship Carrier = new Builder("Carrier",5 ,2,).hitpoints(150).damage(20);
Ship Battleship = new Builder("Battleship",4 ,1,).hitpoints(110).damage(120);
Ship Submarine = new Builder("Submarine",3 ,1,).hitpoints(15).damage(150);
}
}
| [
"[email protected]"
] | |
3a351e209db151b6ebfee0459f3a61b1cf18a88d | b5412b93ce25e262697163c0805ff5aa05172d22 | /src/main/java/com/latmod/yabba/tile/TileCompoundItemBarrel.java | db46948e744c0160b0309266765cae5b2f2854ca | [] | no_license | Emirhangg/YABBA | be02503fc38b8348ede18fd37e116e4b4a45eb63 | 8fdbabed3ef64bff863bef4165ccff3a772d77b9 | refs/heads/master | 2020-03-19T18:15:32.765454 | 2018-06-07T07:43:49 | 2018-06-07T07:43:49 | 136,801,642 | 0 | 0 | null | 2018-06-10T11:07:05 | 2018-06-10T11:07:04 | null | UTF-8 | Java | false | false | 4,240 | java | package com.latmod.yabba.tile;
import com.feed_the_beast.ftblib.lib.tile.EnumSaveType;
import com.latmod.yabba.Yabba;
import com.latmod.yabba.api.YabbaConfigEvent;
import com.latmod.yabba.util.UpgradeInst;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import javax.annotation.Nullable;
import java.util.List;
/**
* @author LatvianModder
*/
public class TileCompoundItemBarrel extends TileBarrelBase implements IItemBarrel
{
private ItemStack storedItem = ItemStack.EMPTY;
private int itemCount = 0;
@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
{
return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}
@Override
@SuppressWarnings("unchecked")
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
{
return (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) ? (T) this : super.getCapability(capability, facing);
}
@Override
protected void writeData(NBTTagCompound nbt, EnumSaveType type)
{
if (type != EnumSaveType.SAVE)
{
return;
}
if (itemCount > 0)
{
nbt.setInteger("Count", itemCount);
}
super.writeData(nbt, type);
if (!storedItem.isEmpty())
{
storedItem.setCount(1);
nbt.setTag("Item", storedItem.serializeNBT());
}
}
@Override
protected void readData(NBTTagCompound nbt, EnumSaveType type)
{
if (type != EnumSaveType.SAVE)
{
return;
}
setRawItemCount(nbt.getInteger("Count"));
super.readData(nbt, type);
storedItem = nbt.hasKey("Item") ? new ItemStack(nbt.getCompoundTag("Item")) : ItemStack.EMPTY;
if (storedItem.isEmpty())
{
storedItem = ItemStack.EMPTY;
}
}
@Override
public void validate()
{
super.validate();
if (world != null && !world.isRemote)
{
TileItemBarrelConnector.markAllDirty(pos, world.provider.getDimension());
}
}
@Override
public void invalidate()
{
super.invalidate();
if (world != null && !world.isRemote)
{
TileItemBarrelConnector.markAllDirty(pos, world.provider.getDimension());
}
}
@Override
public void markDirty()
{
sendDirtyUpdate();
}
@Override
public int getItemCount()
{
return itemCount;
}
@Override
public void setRawItemCount(int v)
{
itemCount = v;
}
@Override
public ItemStack getStoredItemType()
{
return storedItem;
}
@Override
public void setRawItemType(ItemStack type)
{
storedItem = type;
}
@Override
public void createConfig(YabbaConfigEvent event)
{
super.createConfig(event);
String group = Yabba.MOD_ID;
event.getConfig().setGroupName(group, new TextComponentString(Yabba.MOD_NAME));
if (!tier.creative())
{
event.getConfig().add(group, "locked", isLocked);
}
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(List<String> tooltip, ITooltipFlag flagIn)
{
tooltip.add(I18n.format("lang.yabba.tier", I18n.format(tier.getLangKey())));
if (isLocked())
{
tooltip.add(I18n.format("barrel_config.yabba.locked"));
}
if (!storedItem.isEmpty())
{
tooltip.add(I18n.format("lang.yabba.item", storedItem.getDisplayName()));
}
if (!tier.creative())
{
if (tier.infiniteCapacity())
{
tooltip.add(I18n.format("lang.yabba.item_count_inf", itemCount));
}
else if (!storedItem.isEmpty())
{
tooltip.add(I18n.format("lang.yabba.item_count", itemCount, getMaxItems(storedItem)));
}
else
{
tooltip.add(I18n.format("lang.yabba.item_count_max", tier.maxItemStacks));
}
}
if (!upgrades.isEmpty())
{
tooltip.add(I18n.format("lang.yabba.upgrades"));
for (UpgradeInst upgrade : upgrades.values())
{
tooltip.add("> " + upgrade.getStack().getDisplayName());
}
}
}
@Override
public boolean shouldDrop()
{
return itemCount > 0 || super.shouldDrop();
}
} | [
"[email protected]"
] | |
6af5899fa1fd1d6d5b03c6fa4521ccea8f10474a | aab5f129f51e1475f90d5394874e5d50bfcfec86 | /src/com/storedValRecord/model/StoredValRecodeDAO_Interface.java | 68e01537cafdcd2c04cf1db92d3f37c42434ebd0 | [] | no_license | Billy-Chung/CFA102G4 | 1a55dc8899c50f56b1014af80e3385e7a437ef79 | 90f05ad9992b2bb3677fe42d64d2ad2cfcfaf76c | refs/heads/main | 2023-07-14T22:10:58.671766 | 2021-08-31T06:55:01 | 2021-08-31T06:55:01 | 398,172,782 | 1 | 0 | null | 2021-08-24T15:59:06 | 2021-08-20T06:05:28 | Java | UTF-8 | Java | false | false | 340 | java | package com.storedValRecord.model;
import java.util.List;
public interface StoredValRecodeDAO_Interface {
public void insert(StoredValRecodeVO svrVO);
public void update(StoredValRecodeVO svrVO);
public void delete(Integer svrno);
public StoredValRecodeVO findByPrimaryKey(Integer svrno);
public List<StoredValRecodeVO> getAll();
}
| [
"[email protected]"
] | |
6ca6d6be157238e40f8e37587ca631c8ca304f63 | 28da2b5924bbb183f9abbd5815bf9e5902352489 | /src-core/org/pentaho/di/core/exception/KettleJobException.java | 353a3e26f3cc9caae98736c9bd45796fb5bc9ea1 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jianjunchu/etl_designer_30 | 079ed1bcd2b208cf3bb86842a12c815f1db49204 | 996951c4b0ab9d89bffdb550161c2f3871bcf03e | refs/heads/master | 2023-08-09T09:19:43.992255 | 2023-07-20T23:22:35 | 2023-07-20T23:22:35 | 128,722,775 | 3 | 4 | Apache-2.0 | 2018-04-18T06:07:17 | 2018-04-09T06:08:53 | Java | UTF-8 | Java | false | false | 2,447 | java | /*******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2012 by Pentaho : http://www.pentaho.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 org.pentaho.di.core.exception;
/**
* This exception is used when handling Jobs.
*
* @author Matt
* @since 9-12-2004
*
*/
public class KettleJobException extends KettleException
{
public static final long serialVersionUID = 0x8D8EA0264F7A1C14L;
/**
* Constructs a new throwable with null as its detail message.
*/
public KettleJobException()
{
super();
}
/**
* Constructs a new throwable with the specified detail message.
* @param message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
*/
public KettleJobException(String message)
{
super(message);
}
/**
* Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
* @param cause the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public KettleJobException(Throwable cause)
{
super(cause);
}
/**
* Constructs a new throwable with the specified detail message and cause.
* @param message the detail message (which is saved for later retrieval by the getMessage() method).
* @param cause the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
public KettleJobException(String message, Throwable cause)
{
super(message, cause);
}
}
| [
"[email protected]"
] | |
64f87bbc8a0725c4ac0db76a2dab5e782cd47643 | 13639b9aa91611cbd03301db41cdc33a5ed4986a | /lichkin-projects-core-entities/src/main/java/com/lichkin/springframework/entities/impl/SysAdminLoginRoleEntity.java | e0c584e01a7520d3c9a39b3fe111b8873a95bb86 | [
"MIT"
] | permissive | LichKinContributor/lichkin-projects-core | 95fe3c36d2a754996fc6688ee2d725ffbf802982 | 2acc0c430b3107f0ef9b01fca16e58e95460d839 | refs/heads/master | 2020-03-30T01:13:14.117132 | 2019-05-21T14:58:13 | 2019-05-21T14:58:13 | 150,565,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.lichkin.springframework.entities.impl;
import javax.persistence.Column;
import javax.persistence.Entity;
import com.lichkin.springframework.entities.suppers.IDEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
/**
* 管理员登录&角色关联表实体类
* @author SuZhou LichKin Information Technology Co., Ltd.
*/
@Getter
@Setter
@Entity
@NoArgsConstructor
@RequiredArgsConstructor
public class SysAdminLoginRoleEntity extends IDEntity {
/** serialVersionUID */
private static final long serialVersionUID = 10008L;
/** 管理员登录ID(SysAdminLoginEntity.id) */
@NonNull
@Column(length = 64, nullable = false)
private String loginId;
/** 角色ID(SysRoleEntity.id) */
@NonNull
@Column(length = 64, nullable = false)
private String roleId;
}
| [
"[email protected]"
] | |
1b6e40f79e8a517c80a059b99eedca6145cf1da0 | b59c1fe16845965d5e6d567df0225f0f5905b0af | /src/main/java/io/kimos/talentpipe/service/SectorService.java | 5f0e4b80e67be365f00632ef2c650abce4dec608 | [] | no_license | ernesto-albarez/talentpipe-monolith | 3b7b3490e4d0ac634f791476a488e4b7d5877bf2 | 3e075cee2561d5e5098332a3d241bce8afc49ded | refs/heads/master | 2022-12-14T23:43:28.249026 | 2019-06-15T21:10:09 | 2019-06-15T21:10:09 | 156,850,943 | 0 | 0 | null | 2022-12-08T08:42:36 | 2018-11-09T11:07:29 | Java | UTF-8 | Java | false | false | 1,171 | java | package io.kimos.talentpipe.service;
import io.kimos.talentpipe.domain.Sector;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.Optional;
/**
* Service Interface for managing Sector.
*/
public interface SectorService {
/**
* Save a sector.
*
* @param sector the entity to save
* @return the persisted entity
*/
Sector save(Sector sector);
/**
* Get all the sectors.
*
* @param pageable the pagination information
* @return the list of entities
*/
Page<Sector> findAll(Pageable pageable);
/**
* Get the "id" sector.
*
* @param id the id of the entity
* @return the entity
*/
Optional<Sector> findOne(Long id);
/**
* Delete the "id" sector.
*
* @param id the id of the entity
*/
void delete(Long id);
/**
* Search for the sector corresponding to the query.
*
* @param query the query of the search
* @param pageable the pagination information
* @return the list of entities
*/
Page<Sector> search(String query, Pageable pageable);
}
| [
"[email protected]"
] | |
264b3066571a49d67492b2a9667699f5b561c952 | 9e161a0c09c718fd4e4446c8941defbe4de3f3d4 | /Project/李杭/auto/src/com/webtest/utils/MailUtil.java | 2fea715f452458bbb4e1e329126201e790a144a5 | [] | no_license | messtang/18-training | 4720773cf90eaefc73433f62b99353517a911144 | 041ca4700b6271e506fe1a0cc5df83a6c0e6f948 | refs/heads/main | 2023-01-23T19:46:51.642799 | 2020-12-17T05:10:18 | 2020-12-17T05:10:18 | 311,514,948 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,010 | java | package com.webtest.utils;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.NoSuchProviderException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailUtil {
static int port = 25;
static String server = "smtp.126.com";
static String from = "lihang";
static String user = "[email protected]";
static String password = "QSLYJTUOBMPRWUZL";
public static void sendEmail(String email, String subject, String body) throws UnsupportedEncodingException {
try {
Properties props = new Properties();
props.put("mail.smtp.host", server);
props.put("mail.smtp.port", String.valueOf(port));
props.put("mail.smtp.auth", "true");
Transport transport = null;
Session session = Session.getDefaultInstance(props, null);
transport = session.getTransport("smtp");
transport.connect(server, user, password);
MimeMessage msg = new MimeMessage(session);
msg.setSentDate(new Date());
InternetAddress fromAddress = new InternetAddress(user, from, "UTF-8");
msg.setFrom(fromAddress);
String emailList[] = email.split(",");
InternetAddress[] toAddress = new InternetAddress[emailList.length];
for (int i = 0; i < emailList.length; i++) {
toAddress[i] = new InternetAddress(emailList[i]);
}
// msg.setRecipients(Message.RecipientType.TO, toAddress);
msg.addRecipients(Message.RecipientType.TO, toAddress);
msg.setSubject(subject, "UTF-8");
msg.setContent(body, "text/html;charset=utf-8");
msg.saveChanges();
transport.sendMessage(msg, msg.getAllRecipients());
} catch (NoSuchProviderException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}
}
public static void main(String args[]) throws UnsupportedEncodingException {
MailUtil.sendEmail(from, "ceshi", "ce");
}
} | [
"[email protected]"
] | |
343b324a7c55ef6a24e12f2a5d0abbe14df4b6ce | ba3ba840b4945bdc42ca011fabce7a7fca4748f0 | /app/src/main/java/com/example/relativelayout/Onboarding.java | 9f64ff9e3659a75588a026f05ed16e240f589e9d | [] | no_license | Talhakamal/all-assignment | 4b987467da040c4278a42a37830f425ce465915c | 960baed1a32e676bbf543fa88000722a4b31fda5 | refs/heads/master | 2020-12-18T15:28:04.714051 | 2020-01-21T20:52:37 | 2020-01-21T20:52:37 | 235,438,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java | package com.example.relativelayout;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Color;
import android.os.Bundle;
import com.hololo.tutorial.library.TutorialActivity;
import android.Manifest;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Toast;
import com.hololo.tutorial.library.PermissionStep;
import com.hololo.tutorial.library.Step;
import com.hololo.tutorial.library.TutorialActivity;
public class Onboarding extends TutorialActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_onboarding);
addFragment(new Step.Builder().setTitle("This is header")
.setContent("This is content")
.setBackgroundColor(Color.parseColor("#FF0957")) // int background color
.setDrawable(R.drawable.cover) // int top drawable
.setSummary("This is summary")
.build());
addFragment(new Step.Builder().setTitle("This is header")
.setContent("This is content")
.setBackgroundColor(Color.parseColor("#FF0957")) // int background color
.setDrawable(R.drawable.star) // int top drawable
.setSummary("This is summary")
.build());
addFragment(new Step.Builder().setTitle("This is header")
.setContent("This is content")
.setBackgroundColor(Color.parseColor("#FF0957")) // int background color
.setDrawable(R.drawable.logo) // int top drawable
.setSummary("This is summary")
.build());
}
@Override
public void currentFragmentPosition(int position) {
}
@Override
public void onPointerCaptureChanged(boolean hasCapture) {
}
}
| [
"[email protected]"
] | |
4089147ef7196cd62c44db0334848ea10664bc16 | 40cf7ca025c026ca1c1d44d920e3c26a4990b16a | /HaruEngine/gen/kr/dsuplex/haruengine/BuildConfig.java | 0d956c0850f6922b2fe38228e7e83953e766d282 | [
"Apache-2.0"
] | permissive | hyejini63/HaruEngine | 3f477fb2b3b5a6047b21d955fd01edf33ea9a3b3 | be025e15e7340997e250276e44ddb9a4d38e0905 | refs/heads/master | 2021-01-10T10:10:48.407684 | 2015-10-31T17:59:39 | 2015-10-31T17:59:39 | 44,487,637 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 163 | java | /** Automatically generated file. DO NOT MODIFY */
package kr.dsuplex.haruengine;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"[email protected]"
] | |
1f9a9fe801d57029b2e9be330b356b869c5c6e5b | 04ec480dd55e69a60bd48c4dc57a0a8405ff3026 | /CompieTest/app/src/main/java/compie/test/silve/compietest/ItemData.java | baaa8e016d1d0640bb1a10d15b1890b45690683e | [
"Apache-2.0"
] | permissive | BezMan/CompieTest | bfa46787b492d3d02e5cebbabd848aa47c6f63f7 | fe6fffda2d72a2be7c4c4d4dfd7d790c2ac0226a | refs/heads/master | 2021-01-10T23:28:13.031566 | 2016-10-10T21:24:07 | 2016-10-10T21:24:07 | 70,585,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package compie.test.silve.compietest;
/**
* Created by silve on 10-Oct-16.
*/
class ItemData {
private String Title;
private String Link;
private String Thumb;
String getTitle() {
return Title;
}
void setTitle(String title) {
Title = title;
}
String getLink() {
return Link;
}
void setLink(String link) {
Link = link;
}
String getThumb() {
return Thumb;
}
void setThumb(String thumb) {
Thumb = thumb;
}
}
| [
"[email protected]"
] | |
a097b75e2b3e9a67a466e0efb772fe5a30d624da | 7235802913ee710f868a04ad5b7455ec75dc49df | /Chapter07/src/test/scala/com/packt/ScalaMLQuickStartGuide/AppTest.java | 9ba63e0d402d58fcfe56c7536ce245d01d463c59 | [
"MIT"
] | permissive | PacktPublishing/Machine-Learning-with-Scala-Quick-Start-Guide | f8e7f015de8c6b0be8a1e520ccde5100a3a228ab | 597dd3416a4638f48cfa02c1264c1568083e135e | refs/heads/master | 2023-08-10T10:09:32.776349 | 2023-01-30T08:46:52 | 2023-01-30T08:46:52 | 163,277,553 | 20 | 12 | MIT | 2023-07-20T16:35:16 | 2018-12-27T09:52:35 | Scala | UTF-8 | Java | false | false | 660 | java | package com.packt.ScalaMLQuickStartGuide;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| [
"[email protected]"
] | |
92e0e75ef2bcddb328b889da4f96a6765f6127ac | 3f7d27ca2487a6484e67117eeefd292143b67828 | /hello-world-f/src/main/java/com/gaodashang/demo/domain/Note.java | 10eac167610b06331ddd613373938ff97bd6a4d8 | [] | no_license | springprojects/spring-boot-demos | 086ed8da6ef05b87373ab9b14711ebdd7824fd35 | 5820521c97aa91927bd7a6faec4e0476943ced70 | refs/heads/master | 2020-05-17T01:50:49.225913 | 2015-04-20T07:15:27 | 2015-04-20T07:15:27 | 31,783,929 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,122 | java | package com.gaodashang.demo.domain;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@Entity
public class Note {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotNull
private String title;
@NotNull
@Size(max = 4000)
private String text;
@NotNull
@DateTimeFormat(style = "M-")
private Date created = new Date();
@NotNull
private String tags;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Date getCreated() {
return created;
}
public void setTags(String tags) {
this.tags = tags;
}
public String getTags() {
return tags;
}
}
| [
"[email protected]"
] | |
054c86f76579611a9a4ff2024c6f769481388d31 | 6491bfe160097913b5c754473f76f1e21c303826 | /src/TicTacToe.java | ef7ce3336e34b76333d775370bcbeeac53082433 | [] | no_license | wazsup/TicTacToe | ac6c1842a57fd2339bfe425d6a997b953990f539 | 94389ac57b609b6ae9e1d05b73659309d4d51b46 | refs/heads/master | 2020-04-24T01:16:26.123045 | 2013-07-27T17:04:06 | 2013-07-27T17:04:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,094 | java | // [email protected]
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class TicTacToe {
public static void main(String[] args) throws java.io.IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Привет, как тебя зовут?");
String name = input.readLine();
System.out.print(name+", введи ширину доски ");
Board newGame = new Board(Integer.parseInt(input.readLine()));
System.out.println("C кем будем играть?");
System.out.println(" 1. С другом");
System.out.println(" 2. C компьютером");
System.out.println(" 3. Будем наблюдать за игрой");
System.out.print(" Ожидаю ввод... ");
Player player1;
Player player2;
Player tempPlayer;
switch (Integer.parseInt(input.readLine())){
case 1: System.out.println("Как зовут друга? ");
player1 = new Player(name,'X',newGame);
player2 = new Player(input.readLine(),'O',newGame);
break;
case 2: player1 = new Player(name,'X',newGame);
player2 = new BotPlayer(newGame);
break;
default: player1 = new BotPlayer("Bot#1",'X',newGame);
player2 = new BotPlayer("Bot#2",'O',newGame);
break;
}
newGame.drawBoard();
int step = 0;
boolean draw = false;
while (!draw) {
step++;
tempPlayer = step % 2 != 0 ? player1 : player2;
tempPlayer.makeMove();
newGame.drawBoard();
if (newGame.checkWin(tempPlayer)){
tempPlayer.sayWin();
break;
} else if (step == newGame.getSize()*newGame.getSize()){
draw = true;
System.out.println("У нас ничья.");
}
}
}
}
| [
"[email protected]"
] | |
0011fd23c12dadcdad3603c11124bc4804f2b934 | a3f4617302d0df3efe74419c7200047bfdc3b79a | /app/src/main/java/adapter/ReceivedListAdapter.java | d5e9434c8724f0330cd79aa3617d6518acef0ec3 | [] | no_license | LisztCSU/App | ed7c18597e1576d74981cc00ca3b2a8975f78f85 | 85d70df9f1420135a8db45a899f3c1cf3e1f9e85 | refs/heads/master | 2020-05-17T19:34:48.702050 | 2019-05-06T17:21:21 | 2019-05-06T17:21:21 | 183,918,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,007 | java | package adapter;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import com.liszt.wesee.R;
import com.liszt.wesee.activity.LoginActivity;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ReceivedListAdapter extends SimpleAdapter {
private Context mcontext = null;
private SharedPreferences sharedPreferences;
private String uid;
List<? extends Map<String, ?>> dataList;
public ReceivedListAdapter(Context context,
List<? extends Map<String, ?>> data, int resource,
String[] from, int[] to) {
super(context, data, resource, from, to);
// TODO Auto-generated constructor stub
mcontext = context;
dataList = data;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View view = super.getView(position, convertView, parent);
HashMap<String, Object> map = (HashMap<String, Object>) getItem(position);
Button accept = (Button) view.findViewById(R.id.bt_operation1);
accept.setText("接受");
sharedPreferences = mcontext.getSharedPreferences("Cookies_Prefs",mcontext.MODE_PRIVATE);
uid = sharedPreferences.getString("uid","0");
String str = map.get("operation1").toString();
accept.setTag(str);
accept.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new MyThread(uid,v.getTag().toString(),mcontext).start();
dataList.remove(position);
ReceivedListAdapter.this.notifyDataSetChanged();
}
});
Button reject = (Button) view.findViewById(R.id.bt_operation2);
reject.setText("拒绝");
String str2 = map.get("operation2").toString();
reject.setTag(str2);
reject.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new MyThread2(uid,v.getTag().toString(),mcontext).start();
dataList.remove(position);
ReceivedListAdapter.this.notifyDataSetChanged();
}
});
return view;
}
static class MyThread extends Thread{
private String id;
private String uid;
private Context mcontext;
public MyThread(String uid,String id,Context mcontext){
this.uid = uid;
this.id = id;
this.mcontext = mcontext;
}
@Override
public void run() {
EasyHttp.get("appointment/accept").params("uid",uid).params("id",id).execute(new SimpleCallBack<String>() {
@Override
public void onError(ApiException e) {
Toast.makeText(mcontext, "操作失败", Toast.LENGTH_LONG).show();
}
@Override
public void onSuccess(String result) {
try {
JSONObject obj = new JSONObject(result);
int code = obj.optInt("code");
if (code == 1) {
Toast.makeText(mcontext, "成功接受邀请", Toast.LENGTH_LONG).show();
}
else if(code == -1){
Toast.makeText(mcontext, "未登录", Toast.LENGTH_LONG).show();
Intent intent = new Intent(mcontext, LoginActivity.class);
mcontext.startActivity(intent);
}else {
Toast.makeText(mcontext, "操作失败", Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}
static class MyThread2 extends Thread{
private String id;
private String uid;
private Context mcontext;
public MyThread2(String uid,String id,Context mcontext){
this.uid = uid;
this.id = id;
this.mcontext = mcontext;
}
@Override
public void run() {
EasyHttp.get("appointment/reject").params("uid",uid).params("id",id).execute(new SimpleCallBack<String>() {
@Override
public void onError(ApiException e) {
Toast.makeText(mcontext, "操作失败", Toast.LENGTH_LONG).show();
}
@Override
public void onSuccess(String result) {
try {
JSONObject obj = new JSONObject(result);
int code = obj.optInt("code");
if (code == 1) {
Toast.makeText(mcontext, "拒绝邀请成功", Toast.LENGTH_LONG).show();
}
else if(code == -1){
Toast.makeText(mcontext, "未登录", Toast.LENGTH_LONG).show();
Intent intent = new Intent(mcontext, LoginActivity.class);
mcontext.startActivity(intent);
}else {
Toast.makeText(mcontext, "操作失败", Toast.LENGTH_LONG).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
}
}
| [
"[email protected]"
] | |
ff242bd21dd4768f80f7e5d56e59a483aad72fcf | bed9a7589ae670e98ddeb4e2c2dc5340cbe1935e | /src/main/java/co/com/sofka/okrApp/modelo/OkrList.java | 8cced2ffcc7655887811646cd548e60ff820f9af | [] | no_license | andreasuarezc/okrApp | 5d5759a36f94ac5acf5b0e9fe022cfec2b19d678 | 7293ca93d6c45ae42f57020bd96baf41a0921751 | refs/heads/main | 2023-04-16T16:56:23.233041 | 2021-04-24T15:56:40 | 2021-04-24T15:56:40 | 361,203,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package co.com.sofka.okrApp.modelo;
import lombok.Data;
@Data
public class OkrList {
private String id;
private String nombre;
private float avancePorcentual;
public OkrList(String id, String nombre, float avancePorcentual) {
this.id = id;
this.nombre = nombre;
this.avancePorcentual = avancePorcentual;
}
}
| [
"[email protected]"
] | |
4e4ebe3c9671ebfc2ece37eb473f5c59c2b8d48d | e41a2411f84f79340ae0b8ac968918ad5e637f50 | /chap06/code06_01/Calc.java | dffe4bf61f65c457e581c696274b19ab2e77e7b0 | [] | no_license | yamaguchi122702/workspace | 1cb80d74736ce97251aa7a380dada5c9dc1f00df | 09d71a0cd8a5fc046ee2f0c7fec90817f13d0cd9 | refs/heads/main | 2023-03-22T18:11:43.916205 | 2021-03-16T06:31:10 | 2021-03-16T06:31:10 | 348,218,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package code06_01;
public class Calc {
public static void main(String[] args) {
int a = 10; int b = 2;
int total = tasu(a, b);
int delta = hiku(a, b);
System.out.println("足すと" + total + "、引くと" + delta);
}
public static int tasu(int a, int b) {
return (a + b);
}
public static int hiku(int a, int b) {
return (a - b);
}
}
| [
"[email protected]"
] | |
eebe0083762785f76f8860c8bebd4c2c4effe658 | 2fd242c3c67a98afedf073d07cf7466a8c8c87c7 | /TP/TP3Prog/src/MainClientSmtp.java | cd8439a5d935e202411d3b7d7156c80f417414e3 | [] | no_license | axel-ribes/CoursEtTpPROGREPARTIE | 2421fe387ac1a5670bdf46c509481ee1958dacb5 | d020ed2ec67a9e378e20c1d775378110c834b9b6 | refs/heads/master | 2020-04-30T15:44:03.947829 | 2019-03-28T11:15:10 | 2019-03-28T11:15:10 | 176,927,891 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | import java.io.IOException;
public class MainClientSmtp {
// public static void main(String args[]) throws IOException {
//
// ClientSmtp client = new ClientSmtp(,25, );
// for(int i=0;i<30;i++){
// client.sendMail(,,, );
// }
//
// }
}
| [
"[email protected]"
] | |
e97d072e59e5b8595c20ccaf4e57da4a87826d85 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes2.dex_source_from_JADX/com/facebook/api/feed/xconfig/FeedClientXConfig.java | 72bef87d5709981ffd13537e78a2711abca77cba | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 961 | java | package com.facebook.api.feed.xconfig;
import com.facebook.xconfig.core.XConfig;
import com.facebook.xconfig.core.XConfigName;
import com.facebook.xconfig.core.XConfigSetting;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import javax.inject.Inject;
/* compiled from: session_request_count */
public class FeedClientXConfig extends XConfig {
public static final XConfigName f5467c = new XConfigName("feed_client");
public static final XConfigSetting f5468d;
public static final ImmutableSet<XConfigSetting> f5469e;
private static final ImmutableSet<XConfigSetting> f5470f = new Builder().m4809b(f5469e).m4812b();
static {
XConfigSetting xConfigSetting = new XConfigSetting(f5467c, "ranking_config");
f5468d = xConfigSetting;
f5469e = ImmutableSet.of(xConfigSetting);
}
@Inject
public FeedClientXConfig() {
super(f5467c, f5470f);
}
}
| [
"[email protected]"
] | |
6b862d863e2aee4a4e8f8d414d7cbea39999de2f | 2da1895c5ef4fd907350ea6ba1a3c6417683aafc | /src/RightSpiderWeb.java | 56a1b104332810805a580af4c6a9ba6bccc52848 | [] | no_license | veeyuan/HalloweenVirtualHouse | c82d2e1ffd7ad418720dd8a61f9512e15174fae0 | f4c364ad0d671c96298ad706a5997e067cb496a5 | refs/heads/master | 2023-02-08T14:38:11.038684 | 2020-12-27T07:20:32 | 2020-12-27T07:20:32 | 310,952,787 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,464 | java | import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class RightSpiderWeb implements SpiderWeb {
private BufferedImage img = ImageIO.read(new File("src/resource/spider-1777668_1280.png"));;
private int xCoor = 740;
private int yCoor = 195;
private int width = 130;
private int length = 100;
private boolean show = true;
public RightSpiderWeb() throws IOException {
}
@Override
public BufferedImage getImg() {
return this.img;
}
@Override
public void setImg(BufferedImage img) {
this.img = img;
}
@Override
public int getxCoor() {
return this.xCoor;
}
@Override
public void setxCoor(int xCoor) {
this.xCoor = xCoor;
}
@Override
public int getyCoor() {
return this.yCoor;
}
@Override
public void setyCoor(int yCoor) {
this.yCoor = yCoor;
}
@Override
public int getWidth() {
return this.width;
}
@Override
public void setWidth(int width) {
this.width = width;
}
@Override
public int getLength() {
return this.length;
}
@Override
public void setLength(int length) {
this.length = length;
}
@Override
public boolean isShow() {
return show;
}
@Override
public void setShow(boolean show) {
this.show = show;
}
}
| [
"[email protected]"
] | |
36b3637cbe3757cdf4358a9f0244623a10ada960 | 0ddca32360b2d6664425c3f501fc5d155bc58f52 | /siaamweb/sauth/src/main/java/com/siaam/auth/handler/SiaamRESTAuthenticationEntryPoint.java | ddd718ea5a256835e0e27e139a645a0985f9f0bd | [] | no_license | kapilpruthi/siaamrepo | 2b08a1b72ac61e92e174d5291936c6d2ab8ce9b5 | 40596133e0906fe74a23fb3cdb9a4d0a9ab748ba | refs/heads/master | 2022-12-27T15:40:44.311146 | 2019-11-14T04:40:32 | 2019-11-14T04:40:32 | 81,061,815 | 0 | 0 | null | 2017-07-26T05:05:02 | 2017-02-06T07:52:09 | null | UTF-8 | Java | false | false | 810 | java | package com.siaam.auth.handler;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
/**
* Return 401 for any un-Authenticated hit to authenticated URL.
* @author Kapil Pruthi
*/
public class SiaamRESTAuthenticationEntryPoint implements AuthenticationEntryPoint {
/**
* Return 401-Unauthorized.
*/
@Override
public void commence(HttpServletRequest request, HttpServletResponse response,
AuthenticationException authException) throws IOException, ServletException {
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
}
}
| [
"[email protected]"
] | |
9f7aadf2ea645cd3d69bd3dd3f7f5fda8c43137e | a50186061ccaaa1ab9023045686e7268e34cdd67 | /WEB-PROYECTO-BLOG/WEB-PROYECTO-BLOG/src/main/java/WebBackendBlog/models/entities/Creator.java | 844d3590adedfc7ba72454d29e1751cda0b85675 | [] | no_license | tatorres1/BLog | b89615c701050a7a1e895dea41b4f60e6d8968b0 | b1417d0cf39346e935f2a118eb12b844e9c5071f | refs/heads/main | 2023-08-22T23:44:32.594533 | 2021-09-16T23:09:45 | 2021-09-16T23:09:45 | 406,159,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,975 | java | package WebBackendBlog.models.entities;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
@Entity
@Table(name="Creators")
public class Creator extends Person implements Serializable{
private static final long serialVersionUID =1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY )
@Basic(optional = false)
@Column(name="IdCreator")
private Integer Id_Creator;
@Column(name="IdCreators")
private String Id_Creators;
@Column(name="CreatorPassword")
private String Creator_Password;
@OneToMany(mappedBy = "creator")
private List<Publication> publicationsList;
public Creator() {
super();
}
public Creator(int Id) {
super();
this.Id_Creator= Id;
}
public Integer getId_Creator() {
return Id_Creator;
}
public void setId_Creator(Integer id_Creator) {
Id_Creator = id_Creator;
}
public String getId_Creators() {
return Id_Creators;
}
public void setId_Creators(String id_Creators) {
Id_Creators = id_Creators;
}
public String getCreator_Password() {
return Creator_Password;
}
public void setCreator_Password(String creator_Password) {
Creator_Password = creator_Password;
}
public void setPublicationsList(List<Publication> publicationsList) {
this.publicationsList = publicationsList;
}
@JsonIgnore
public List<Publication> getPublicationsList() {
return publicationsList;
}
@JsonProperty(access = Access.WRITE_ONLY)
public void setPublications(List<Publication> publicationsList) {
this.publicationsList = publicationsList;
}
}
| [
"[email protected]"
] | |
54b5a80ffd74acb937495227af9f9b1fabeb408d | 77dcbcb9be74d61eab84c9a731d2dd811a918c52 | /src/main/java/com/ws/altanet/model/CommentsRowMapper.java | 7a92bf46a4d6e212fbace87d015252b2a0702694 | [] | no_license | ksggroup/altanet | 03a4f9a1ebf8e1e1ff742abcf8e8bca971240a19 | 70f424169e8ecc430fdff13f497d4214d9f01063 | refs/heads/master | 2021-01-20T06:00:10.586335 | 2017-03-12T15:34:36 | 2017-03-12T15:34:36 | 83,861,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package com.ws.altanet.model;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
public class CommentsRowMapper implements RowMapper<Comments> {
public Comments mapRow(ResultSet rs, int rwNumber) throws SQLException {
Comments comment = new Comments();
comment.setComment_id(rs.getLong(1));
comment.setContent(rs.getString(2));
comment.setDate_time(rs.getTimestamp(3).toString());
comment.setPost_id(rs.getLong(4));
comment.setUser_id(rs.getLong(5));
return comment;
}
}
| [
"[email protected]"
] | |
3dca89f9ac411895a555cd5988bb55806a825dab | 91c9d7e1a0f9713a90853d7fdf00b0f662f4289b | /src/main/resources/servlets/AccountOperationServelt.java | f83b9ad00e3c1a9d5d9cd4130de4642b5ae2d6a9 | [] | no_license | unshiv/BankingWebApplication | e20225aa5f952414b5d54fe43aa7cb9085e50d6d | 34cfde00008aa0d0bc5ade5d77753b7ec6417b8b | refs/heads/master | 2021-01-12T00:12:19.274130 | 2017-01-11T22:41:30 | 2017-01-11T22:41:30 | 78,686,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,598 | java | package servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import dbOperations.AccountTranscations;
/**
* Servlet implementation class AccountOperationServelt
*/
public class AccountOperationServelt extends HttpServlet {
private static final long serialVersionUID = 1L;
AccountTranscations ats;
/**
* @see HttpServlet#HttpServlet()
*/
public AccountOperationServelt() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see Servlet#init(ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(false);
ats = new AccountTranscations(Integer.parseInt(session.getAttribute("accNo").toString()));
PrintWriter out = response.getWriter();
RequestDispatcher rd = request.getRequestDispatcher("/MemberAccountPage.jsp");
if(request.getParameter("operation").equals("Debit"))
{
int success = ats.debitMoney(Double.parseDouble(request.getParameter("debit")));
if(success >0)
{
out.println("Low Balance");
session.setAttribute("balance", ats.getBalance());
rd.forward(request, response);
}
else
{
session.setAttribute("balance", ats.getBalance());
session.setAttribute("transfered", 0);
rd.forward(request, response);
}
}
else if(request.getParameter("operation").equals("Credit"))
{
ats.creditMoney(Double.parseDouble(request.getParameter("credit")));
session.setAttribute("balance", ats.getBalance());
session.setAttribute("transfered", 0);
rd.forward(request, response);
}
else
{
if(0 > ats.transferMoney(Integer.parseInt(request.getParameter("transferAccountNo")), Double.parseDouble(request.getParameter("transferAmount"))))
{
out.println("Transfer Failed");
session.setAttribute("balance", ats.getBalance());
session.setAttribute("transfered", 1);
rd.forward(request, response);
}
else
{
session.setAttribute("balance", ats.getBalance());
rd.forward(request, response);
}
}
}
}
| [
"[email protected]"
] | |
5981b5fd121af139bc2a9378b83fd79d7de4216d | a14deb218f7e90e16e9fdcfe7723b924a7851f2b | /src/main/java/net/sourceforge/plantuml/preproc/IfManagerPositif.java | 49e388ced90910528e89bf9d66e2202912baafac | [
"Apache-2.0"
] | permissive | btomala/sbt-plantuml-plugin | aac0dc27b5597452cc8dd5c3cd2576c8565cfc28 | 7b710ebbd9da6c9b5e95c66c592cf9a021f42987 | refs/heads/master | 2021-01-16T18:57:14.036051 | 2016-02-26T14:45:05 | 2016-02-26T14:45:05 | 67,075,540 | 0 | 0 | null | 2016-09-07T18:27:29 | 2016-08-31T21:42:49 | Java | UTF-8 | Java | false | false | 1,634 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2014, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* 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.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.preproc;
import java.io.IOException;
import java.util.regex.Matcher;
class IfManagerPositif extends IfManager {
public IfManagerPositif(ReadLine source, Defines defines) {
super(source, defines);
}
@Override
protected String readLineInternal() throws IOException {
String s = super.readLineInternal();
if (s == null) {
return null;
}
Matcher m = endifPattern.matcher(s);
if (m.find()) {
return null;
}
m = elsePattern.matcher(s);
if (m.find()) {
do {
s = readLine();
if (s == null) {
return null;
}
m = endifPattern.matcher(s);
if (m.find()) {
return null;
}
} while (true);
}
return s;
}
}
| [
"[email protected]"
] | |
21a8d2213c31a3703ba87dc1c539766e404b1db8 | fda61ab2dc623a62e0e5aeae1733bf53f0b285fc | /src/main/java/mrs/app/home/HomeController.java | 4c343b40ab209397a0e44952eb3afe0bbecaf1fe | [] | no_license | yamaguchi-vorn/mrs | 7002f7ce4c75533e1a8e18b2d30139f7edc8f41b | d69e080b11d7bfe254eaac55c82c71ab3a798cce | refs/heads/master | 2021-05-24T18:15:35.086645 | 2020-04-28T01:49:14 | 2020-04-28T01:49:14 | 253,694,845 | 0 | 0 | null | 2020-04-28T01:49:15 | 2020-04-07T05:23:11 | Java | UTF-8 | Java | false | false | 402 | java | package mrs.app.home;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("home")
public class HomeController {
@RequestMapping(method = RequestMethod.GET)
String home(Model model) {
return "home/home";
}
}
| [
"[email protected]"
] | |
31818494d4d9aaa6fbb5a4939e4edc48040c1f78 | d1749b2ae5bd400c0b01be09ad1e37c11c18492b | /app/src/main/java/se/rebtel/countriesinfo/data/source/remote/net/injection/RemoteCountriesRetrofit.java | ffb479a8feb66dfe8a49ce9083cb672319903d36 | [] | no_license | gurappa/Countries-Info | 9085be9255a88bfed42a53889b1daa3b316dec1b | 1c4ac65ae29ade8a235990b3890719f19d9e0968 | refs/heads/master | 2021-01-19T20:43:13.616027 | 2017-04-25T08:11:13 | 2017-04-25T08:11:13 | 88,539,092 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | /*
* Copyright (c) 2017 CountriesInfo. All rights reserved.
*/
package se.rebtel.countriesinfo.data.source.remote.net.injection;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Qualifier;
/**
* Annotation to identify Retrofit Countries class.
*/
@Qualifier
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface RemoteCountriesRetrofit {
} | [
"[email protected]"
] | |
62fadcbaaeb6b0a426450a67844ef94d3a9152de | 53072e56d1f0f3ab33c3b06ef303f19a245cb26d | /src/main/java/com/seata/demo/model/dto/OrderDTO.java | 05f54b25722aa7489eca80815dfccc6f5d31ae35 | [] | no_license | Yuan-sw/seata-nacos-demo | ce6d5865e475cf2e63b7533f9a926c84969e3939 | 66b96b0ed62f47f3fffaf398279eb80d70ab1b6b | refs/heads/master | 2023-07-02T09:21:24.303278 | 2021-08-04T07:59:42 | 2021-08-04T07:59:42 | 379,921,838 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | package com.seata.demo.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OrderDTO implements Serializable {
/**
* 订单所属用户id
*/
private Long userId;
/**
* 订单号
*/
private String orderNumber;
/**
* 订单备注
*/
private String remark;
/**
* 下单时间,时间戳
*/
private LocalDateTime createTime;
}
| [
"1"
] | 1 |
8a8d4b6a36c6d5bcad73461bd5f77799ac6bd2c8 | f198c641fab32663e00bf59551cbb79e617f1529 | /src/main/gen/dev/blachut/svelte/lang/psi/impl/SvelteEachBlockOpeningImpl.java | 1bb85c73677a1629ce1a8726fc85cca707ffbda9 | [
"MIT"
] | permissive | convincely/svelte-intellij | 4f4151077c375ecfe7f35a3ef060a7f5c82a3dba | f8906d30b8c175d578b40b81f65d53e4eeaad310 | refs/heads/master | 2021-04-01T05:46:55.925145 | 2020-03-18T07:16:35 | 2020-03-18T07:16:35 | 248,160,749 | 0 | 0 | MIT | 2020-03-18T07:01:13 | 2020-03-18T07:01:12 | null | UTF-8 | Java | false | true | 1,210 | java | // This is a generated file. Not intended for manual editing.
package dev.blachut.svelte.lang.psi.impl;
import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static dev.blachut.svelte.lang.psi.SvelteTypes.*;
import dev.blachut.svelte.lang.psi.SveltePsiElementImpl;
import dev.blachut.svelte.lang.psi.*;
public class SvelteEachBlockOpeningImpl extends SveltePsiElementImpl implements SvelteEachBlockOpening {
public SvelteEachBlockOpeningImpl(@NotNull ASTNode node) {
super(node);
}
public void accept(@NotNull SvelteVisitor visitor) {
visitor.visitEachBlockOpening(this);
}
public void accept(@NotNull PsiElementVisitor visitor) {
if (visitor instanceof SvelteVisitor) accept((SvelteVisitor)visitor);
else super.accept(visitor);
}
@Override
@NotNull
public SvelteEachBlockOpeningTag getEachBlockOpeningTag() {
return findNotNullChildByClass(SvelteEachBlockOpeningTag.class);
}
@Override
@NotNull
public SvelteScope getScope() {
return findNotNullChildByClass(SvelteScope.class);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.