blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 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 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ac2439a6cff4d85c269fe8c3a9630376b5701590 | 9b47d61beed9aaeaeafceaa0459ae63102cd923c | /src/barcode/cheng/client/android/demo/WifiReceiver.java | 976de331a97692515c4af536d24ec9177f44edf5 | [] | no_license | chengkaizone/barcode | 20729e5a7e1f8925b5f16c333fd4c1ee2dcddb58 | 231f7e48b5f29e646ef8b94fbf874883cccc7c78 | refs/heads/master | 2021-01-19T14:34:01.051522 | 2014-05-03T09:41:06 | 2014-05-03T09:41:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,939 | java | package barcode.cheng.client.android.demo;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiManager;
import android.util.Log;
import android.widget.TextView;
import barcode.cheng.client.android.demo.R;
import barcode.cheng.client.android.wifi.Killer;
/**
* Get a broadcast when the network is connected, and kill the activity.
*/
public final class WifiReceiver extends BroadcastReceiver {
private static final String TAG = WifiReceiver.class.getSimpleName();
private final WifiManager mWifiManager;
private final WifiActivity parent;
private final TextView statusView;
WifiReceiver(WifiManager wifiManager, WifiActivity wifiActivity,
TextView statusView, String ssid) {
this.parent = wifiActivity;
this.statusView = statusView;
this.mWifiManager = wifiManager;
}
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(
WifiManager.SUPPLICANT_STATE_CHANGED_ACTION)) {
handleChange(
(SupplicantState) intent
.getParcelableExtra(WifiManager.EXTRA_NEW_STATE),
intent.hasExtra(WifiManager.EXTRA_SUPPLICANT_ERROR));
} else if (intent.getAction().equals(
WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
handleNetworkStateChanged((NetworkInfo) intent
.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO));
} else if (intent.getAction().equals(
ConnectivityManager.CONNECTIVITY_ACTION)) {
ConnectivityManager con = (ConnectivityManager) parent
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] s = con.getAllNetworkInfo();
for (NetworkInfo i : s) {
if (i.getTypeName().contentEquals("WIFI")) {
NetworkInfo.State state = i.getState();
String ssid = mWifiManager.getConnectionInfo().getSSID();
if (state == NetworkInfo.State.CONNECTED && ssid != null) {
mWifiManager.saveConfiguration();
String label = parent
.getString(R.string.wifi_connected);
statusView.setText(label + '\n' + ssid);
Runnable delayKill = new Killer(parent);
delayKill.run();
}
if (state == NetworkInfo.State.DISCONNECTED) {
Log.d(TAG, "Got state: " + state + " for ssid: " + ssid);
parent.gotError();
}
}
}
}
}
private void handleNetworkStateChanged(NetworkInfo networkInfo) {
NetworkInfo.DetailedState state = networkInfo.getDetailedState();
if (state == NetworkInfo.DetailedState.FAILED) {
Log.d(TAG, "Detailed Network state failed");
parent.gotError();
}
}
private void handleChange(SupplicantState state, boolean hasError) {
if (hasError || state == SupplicantState.INACTIVE) {
Log.d(TAG, "Found an error");
parent.gotError();
}
}
}
| [
"chengkaizone@163.com"
] | chengkaizone@163.com |
41ea8d817f602868e89774c6c66583ec2bdb86e1 | 884b496950a27b785144ddc714e94c5a51a74c69 | /app/src/main/java/com/sky/imsky/runtimepermissions/PermissionsManager.java | e7f4b5d7be901e3a85185f54a7a08e68a6eb5692 | [] | no_license | S-Sky/IMSky | 1deab31afef0a1d42d671b8b5599c746965aec4a | 070ed1edaf594b69d7a541545e938d1fb5254971 | refs/heads/master | 2021-05-09T17:03:46.291825 | 2018-01-27T05:14:13 | 2018-01-27T05:14:13 | 119,126,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,877 | java | /**
* Copyright 2015 Anthony Restaino
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.sky.imsky.runtimepermissions;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.util.Log;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
/**
* A class to help you manage your permissions simply.
*/
public class PermissionsManager {
private static final String TAG = PermissionsManager.class.getSimpleName();
private final Set<String> mPendingRequests = new HashSet<String>(1);
private final Set<String> mPermissions = new HashSet<String>(1);
private final List<WeakReference<PermissionsResultAction>> mPendingActions = new ArrayList<WeakReference<PermissionsResultAction>>(1);
private static PermissionsManager mInstance = null;
public static PermissionsManager getInstance() {
if (mInstance == null) {
mInstance = new PermissionsManager();
}
return mInstance;
}
private PermissionsManager() {
initializePermissionsMap();
}
/**
* This method uses reflection to read all the permissions in the Manifest class.
* This is necessary because some permissions do not exist on older versions of Android,
* since they do not exist, they will be denied when you check whether you have permission
* which is problematic since a new permission is often added where there was no previous
* permission required. We initialize a Set of available permissions and check the set
* when checking if we have permission since we want to know when we are denied a permission
* because it doesn't exist yet.
*/
private synchronized void initializePermissionsMap() {
Field[] fields = Manifest.permission.class.getFields();
for (Field field : fields) {
String name = null;
try {
name = (String) field.get("");
} catch (IllegalAccessException e) {
Log.e(TAG, "Could not access field", e);
}
mPermissions.add(name);
}
}
/**
* This method retrieves all the permissions declared in the application's manifest.
* It returns a non null array of permisions that can be declared.
*
* @param activity the Activity necessary to check what permissions we have.
* @return a non null array of permissions that are declared in the application manifest.
*/
@NonNull
private synchronized String[] getManifestPermissions(@NonNull final Activity activity) {
PackageInfo packageInfo = null;
List<String> list = new ArrayList<String>(1);
try {
Log.d(TAG, activity.getPackageName());
packageInfo = activity.getPackageManager().getPackageInfo(activity.getPackageName(), PackageManager.GET_PERMISSIONS);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "A problem occurred when retrieving permissions", e);
}
if (packageInfo != null) {
String[] permissions = packageInfo.requestedPermissions;
if (permissions != null) {
for (String perm : permissions) {
Log.d(TAG, "Manifest contained permission: " + perm);
list.add(perm);
}
}
}
return list.toArray(new String[list.size()]);
}
/**
* This method adds the {@link PermissionsResultAction} to the current list
* of pending actions that will be completed when the permissions are
* received. The list of permissions passed to this method are registered
* in the PermissionsResultAction object so that it will be notified of changes
* made to these permissions.
*
* @param permissions the required permissions for the action to be executed.
* @param action the action to add to the current list of pending actions.
*/
private synchronized void addPendingAction(@NonNull String[] permissions,
@Nullable PermissionsResultAction action) {
if (action == null) {
return;
}
action.registerPermissions(permissions);
mPendingActions.add(new WeakReference<PermissionsResultAction>(action));
}
/**
* This method removes a pending action from the list of pending actions.
* It is used for cases where the permission has already been granted, so
* you immediately wish to remove the pending action from the queue and
* execute the action.
*
* @param action the action to remove
*/
private synchronized void removePendingAction(@Nullable PermissionsResultAction action) {
for (Iterator<WeakReference<PermissionsResultAction>> iterator = mPendingActions.iterator();
iterator.hasNext(); ) {
WeakReference<PermissionsResultAction> weakRef = iterator.next();
if (weakRef.get() == action || weakRef.get() == null) {
iterator.remove();
}
}
}
/**
* This static method can be used to check whether or not you have a specific permission.
* It is basically a less verbose method of using {@link ActivityCompat#checkSelfPermission(Context, String)}
* and will simply return a boolean whether or not you have the permission. If you pass
* in a null Context object, it will return false as otherwise it cannot check the permission.
* However, the Activity parameter is nullable so that you can pass in a reference that you
* are not always sure will be valid or not (e.g. getActivity() from Fragment).
*
* @param context the Context necessary to check the permission
* @param permission the permission to check
* @return true if you have been granted the permission, false otherwise
*/
@SuppressWarnings("unused")
public synchronized boolean hasPermission(@Nullable Context context, @NonNull String permission) {
return context != null && (ActivityCompat.checkSelfPermission(context, permission)
== PackageManager.PERMISSION_GRANTED || !mPermissions.contains(permission));
}
/**
* This static method can be used to check whether or not you have several specific permissions.
* It is simpler than checking using {@link ActivityCompat#checkSelfPermission(Context, String)}
* for each permission and will simply return a boolean whether or not you have all the permissions.
* If you pass in a null Context object, it will return false as otherwise it cannot check the
* permission. However, the Activity parameter is nullable so that you can pass in a reference
* that you are not always sure will be valid or not (e.g. getActivity() from Fragment).
*
* @param context the Context necessary to check the permission
* @param permissions the permissions to check
* @return true if you have been granted all the permissions, false otherwise
*/
@SuppressWarnings("unused")
public synchronized boolean hasAllPermissions(@Nullable Context context, @NonNull String[] permissions) {
if (context == null) {
return false;
}
boolean hasAllPermissions = true;
for (String perm : permissions) {
hasAllPermissions &= hasPermission(context, perm);
}
return hasAllPermissions;
}
/**
* This method will request all the permissions declared in your application manifest
* for the specified {@link PermissionsResultAction}. The purpose of this method is to enable
* all permissions to be requested at one shot. The PermissionsResultAction is used to notify
* you of the user allowing or denying each permission. The Activity and PermissionsResultAction
* parameters are both annotated Nullable, but this method will not work if the Activity
* is null. It is only annotated Nullable as a courtesy to prevent crashes in the case
* that you call this from a Fragment where {@link Fragment#getActivity()} could yield
* null. Additionally, you will not receive any notification of permissions being granted
* if you provide a null PermissionsResultAction.
*
* @param activity the Activity necessary to request and check permissions.
* @param action the PermissionsResultAction used to notify you of permissions being accepted.
*/
@SuppressWarnings("unused")
public synchronized void requestAllManifestPermissionsIfNecessary(final @Nullable Activity activity,
final @Nullable PermissionsResultAction action) {
if (activity == null) {
return;
}
String[] perms = getManifestPermissions(activity);
requestPermissionsIfNecessaryForResult(activity, perms, action);
}
/**
* This method should be used to execute a {@link PermissionsResultAction} for the array
* of permissions passed to this method. This method will request the permissions if
* they need to be requested (i.e. we don't have permission yet) and will add the
* PermissionsResultAction to the queue to be notified of permissions being granted or
* denied. In the case of pre-Android Marshmallow, permissions will be granted immediately.
* The Activity variable is nullable, but if it is null, the method will fail to execute.
* This is only nullable as a courtesy for Fragments where getActivity() may yeild null
* if the Fragment is not currently added to its parent Activity.
*
* @param activity the activity necessary to request the permissions.
* @param permissions the list of permissions to request for the {@link PermissionsResultAction}.
* @param action the PermissionsResultAction to notify when the permissions are granted or denied.
*/
@SuppressWarnings("unused")
public synchronized void requestPermissionsIfNecessaryForResult(@Nullable Activity activity,
@NonNull String[] permissions,
@Nullable PermissionsResultAction action) {
if (activity == null) {
return;
}
addPendingAction(permissions, action);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
doPermissionWorkBeforeAndroidM(activity, permissions, action);
} else {
List<String> permList = getPermissionsListToRequest(activity, permissions, action);
if (permList.isEmpty()) {
//if there is no permission to request, there is no reason to keep the action int the list
removePendingAction(action);
} else {
String[] permsToRequest = permList.toArray(new String[permList.size()]);
mPendingRequests.addAll(permList);
ActivityCompat.requestPermissions(activity, permsToRequest, 1);
}
}
}
/**
* This method should be used to execute a {@link PermissionsResultAction} for the array
* of permissions passed to this method. This method will request the permissions if
* they need to be requested (i.e. we don't have permission yet) and will add the
* PermissionsResultAction to the queue to be notified of permissions being granted or
* denied. In the case of pre-Android Marshmallow, permissions will be granted immediately.
* The Fragment variable is used, but if {@link Fragment#getActivity()} returns null, this method
* will fail to work as the activity reference is necessary to check for permissions.
*
* @param fragment the fragment necessary to request the permissions.
* @param permissions the list of permissions to request for the {@link PermissionsResultAction}.
* @param action the PermissionsResultAction to notify when the permissions are granted or denied.
*/
@SuppressWarnings("unused")
public synchronized void requestPermissionsIfNecessaryForResult(@NonNull Fragment fragment,
@NonNull String[] permissions,
@Nullable PermissionsResultAction action) {
Activity activity = fragment.getActivity();
if (activity == null) {
return;
}
addPendingAction(permissions, action);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
doPermissionWorkBeforeAndroidM(activity, permissions, action);
} else {
List<String> permList = getPermissionsListToRequest(activity, permissions, action);
if (permList.isEmpty()) {
//if there is no permission to request, there is no reason to keep the action int the list
removePendingAction(action);
} else {
String[] permsToRequest = permList.toArray(new String[permList.size()]);
mPendingRequests.addAll(permList);
fragment.requestPermissions(permsToRequest, 1);
}
}
}
/**
* This method notifies the PermissionsManager that the permissions have change. If you are making
* the permissions requests using an Activity, then this method should be called from the
* Activity callback onRequestPermissionsResult() with the variables passed to that method. If
* you are passing a Fragment to make the permissions request, then you should call this in
* the {@link Fragment#onRequestPermissionsResult(int, String[], int[])} method.
* It will notify all the pending PermissionsResultAction objects currently
* in the queue, and will remove the permissions request from the list of pending requests.
*
* @param permissions the permissions that have changed.
* @param results the values for each permission.
*/
@SuppressWarnings("unused")
public synchronized void notifyPermissionsChange(@NonNull String[] permissions, @NonNull int[] results) {
int size = permissions.length;
if (results.length < size) {
size = results.length;
}
Iterator<WeakReference<PermissionsResultAction>> iterator = mPendingActions.iterator();
while (iterator.hasNext()) {
PermissionsResultAction action = iterator.next().get();
for (int n = 0; n < size; n++) {
if (action == null || action.onResult(permissions[n], results[n])) {
iterator.remove();
break;
}
}
}
for (int n = 0; n < size; n++) {
mPendingRequests.remove(permissions[n]);
}
}
/**
* When request permissions on devices before Android M (Android 6.0, API Level 23)
* Do the granted or denied work directly according to the permission status
*
* @param activity the activity to check permissions
* @param permissions the permissions names
* @param action the callback work object, containing what we what to do after
* permission check
*/
private void doPermissionWorkBeforeAndroidM(@NonNull Activity activity,
@NonNull String[] permissions,
@Nullable PermissionsResultAction action) {
for (String perm : permissions) {
if (action != null) {
if (!mPermissions.contains(perm)) {
action.onResult(perm, Permissions.NOT_FOUND);
} else if (ActivityCompat.checkSelfPermission(activity, perm)
!= PackageManager.PERMISSION_GRANTED) {
action.onResult(perm, Permissions.DENIED);
} else {
action.onResult(perm, Permissions.GRANTED);
}
}
}
}
/**
* Filter the permissions list:
* If a permission is not granted, add it to the result list
* if a permission is granted, do the granted work, do not add it to the result list
*
* @param activity the activity to check permissions
* @param permissions all the permissions names
* @param action the callback work object, containing what we what to do after
* permission check
* @return a list of permissions names that are not granted yet
*/
@NonNull
private List<String> getPermissionsListToRequest(@NonNull Activity activity,
@NonNull String[] permissions,
@Nullable PermissionsResultAction action) {
List<String> permList = new ArrayList<String>(permissions.length);
for (String perm : permissions) {
if (!mPermissions.contains(perm)) {
if (action != null) {
action.onResult(perm, Permissions.NOT_FOUND);
}
} else if (ActivityCompat.checkSelfPermission(activity, perm) != PackageManager.PERMISSION_GRANTED) {
if (!mPendingRequests.contains(perm)) {
permList.add(perm);
}
} else {
if (action != null) {
action.onResult(perm, Permissions.GRANTED);
}
}
}
return permList;
}
} | [
"15809439371@163.com"
] | 15809439371@163.com |
80246284960b0ad4197d73d5f6893fb0e364e64e | a41b17cbbcbea8cc2b2c1d8bb18cabf37a259419 | /framework/mekatok-framework-ou/mekatok-ou-execute/src/main/java/icu/guokai/mekatok/framework/ou/mapper/UserRoleMapper.java | 13bae216218a787431c67cbeb3659e4957954a58 | [
"MIT"
] | permissive | changwng/Mekatok | 0a2b33c2b77e98d3e631c2b3da04268a6bb7d077 | 1abf261ac72db7fbb686ec97ee8f2f49485c3b81 | refs/heads/main | 2023-08-21T02:59:41.849465 | 2021-10-26T02:15:38 | 2021-10-26T02:15:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package icu.guokai.mekatok.framework.ou.mapper;
import icu.guokai.mekatok.framework.core.mapper.Mapper;
import icu.guokai.mekatok.framework.ou.model.table.UserRole;
/**
* 用于操作用户职位的Mapper
* @author GuoKai
* @date 2021/8/16
*/
public interface UserRoleMapper extends Mapper<UserRole> {
}
| [
"50438949+GamerKk@users.noreply.github.com"
] | 50438949+GamerKk@users.noreply.github.com |
3daf2b8281c7c9bbef2ea3080b705094e259ebf0 | a20343c32d9260b2f82cd688afe6fa59159475a4 | /small_projects_when_learning_java_backend/springboot-09-test/src/main/java/com/zhangyun/springboot09test/controller/AsyncController.java | 4d74c220cf0b5749426e54dcf3b65ab1aeee533e | [] | no_license | yunkai-zhang/BUPT | 9412d797c6d6b18badc6a1c45bd4d1ca560f0321 | 974091e28d5c7f51f3cb4518ee1271938c318807 | refs/heads/main | 2023-08-28T07:08:16.207688 | 2023-08-11T15:52:30 | 2023-08-11T15:52:30 | 249,700,012 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package com.zhangyun.springboot09test.controller;
import com.zhangyun.springboot09test.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class AsyncController {
//从spring容器拿到asyncService实例
@Autowired
AsyncService asyncService;
//写一个方法调用service层异步的方法
@RequestMapping("hello")
public String hello(){
asyncService.hello();//停止三秒,网站是转圈的
return "ok";//走到这才相应一个ok
}
}
| [
"59794765+yunkai-zhang@users.noreply.github.com"
] | 59794765+yunkai-zhang@users.noreply.github.com |
839771627b67838de29c3dbd6e5b3b5689cf563b | a860e1f9ba2b5d49a9a89cfa6cd1a68b1226506a | /src/main/java/com/tanyajava/controller/BadgeController.java | ff5fa8244e4c575a4741e2650d12fc16615db424 | [] | no_license | sinisukahendri/tanyajava | 5df3cb1487cbc94dde34b142813cd8d902c5a0fe | 44a2cac1058bbc47289b6b73d6155a36b89a072b | refs/heads/master | 2020-04-28T09:40:09.198360 | 2012-02-12T13:49:11 | 2012-02-12T13:49:11 | 35,461,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.tanyajava.controller;
/**
*
* @author ifnu
*/
public class BadgeController {
}
| [
"ifnubima@ddd900dc-19ee-11df-8006-ddd0014e6ec4"
] | ifnubima@ddd900dc-19ee-11df-8006-ddd0014e6ec4 |
85a312f4fd2d011b5b57c84064ac2447ff29f0cd | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /eclipseswt_cluster/44705/src_1.java | 9b89cb1f51b7d90f7c3ac30859d4fcf53720179c | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,956 | java | /*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.widgets;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.motif.*;
import org.eclipse.swt.*;
/**
* Instances of this class allow the user to navigate
* the file system and select a directory.
* <p>
* IMPORTANT: This class is intended to be subclassed <em>only</em>
* within the SWT implementation.
* </p>
*/
public class DirectoryDialog extends Dialog {
Display appContext;
String filterPath = "";
boolean cancel = true;
String message = "";
static final String SEPARATOR = System.getProperty ("file.separator");
/**
* Constructs a new instance of this class given only its
* parent.
* <p>
* Note: Currently, null can be passed in for the parent.
* This has the effect of creating the dialog on the currently active
* display if there is one. If there is no current display, the
* dialog is created on a "default" display. <b>Passing in null as
* the parent is not considered to be good coding style,
* and may not be supported in a future release of SWT.</b>
* </p>
*
* @param parent a shell which will be the parent of the new instance
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*/
public DirectoryDialog (Shell parent) {
this (parent, SWT.PRIMARY_MODAL);
}
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
* class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
* Style bits are also inherited from superclasses.
* </p>
* Note: Currently, null can be passed in for the parent.
* This has the effect of creating the dialog on the currently active
* display if there is one. If there is no current display, the
* dialog is created on a "default" display. <b>Passing in null as
* the parent is not considered to be good coding style,
* and may not be supported in a future release of SWT.</b>
* </p>
*
* @param parent a shell which will be the parent of the new instance
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
* <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
* </ul>
*/
public DirectoryDialog (Shell parent, int style) {
super (parent, style);
checkSubclass ();
}
int activate (int widget, int client, int call) {
cancel = client == OS.XmDIALOG_CANCEL_BUTTON;
OS.XtUnmanageChild (widget);
return 0;
}
/**
* Returns the path which the dialog will use to filter
* the directories it shows.
*
* @return the filter path
*/
public String getFilterPath () {
return filterPath;
}
/**
* Returns the dialog's message, which is a description of
* the purpose for which it was opened. This message will be
* visible on the dialog while it is open.
*
* @return the message
*/
public String getMessage () {
return message;
}
/**
* Makes the dialog visible and brings it to the front
* of the display.
*
* @return a string describing the absolute path of the selected directory,
* or null if the dialog was cancelled or an error occurred
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
* </ul>
*/
public String open () {
/* Get the parent */
boolean destroyContext;
appContext = Display.getCurrent ();
if (destroyContext = (appContext == null)) appContext = new Display ();
int display = appContext.xDisplay;
int parentHandle = appContext.shellHandle;
if ((parent != null) && (parent.display == appContext)) {
if (OS.IsAIX) parent.realizeWidget (); /* Fix for bug 17507 */
parentHandle = parent.shellHandle;
}
/* Compute the dialog title */
/*
* Feature in Motif. It is not possible to set a shell
* title to an empty string. The fix is to set the title
* to be a single space.
*/
String string = title;
if (string.length () == 0) string = " ";
/* Use the character encoding for the default locale */
byte [] buffer1 = Converter.wcsToMbcs (null, string, true);
int xmStringPtr1 = OS.XmStringParseText (
buffer1,
0,
OS.XmFONTLIST_DEFAULT_TAG,
OS.XmCHARSET_TEXT,
null,
0,
0);
/* Compute the filter */
/* Use the character encoding for the default locale */
byte [] buffer2 = Converter.wcsToMbcs (null, "*", true);
int xmStringPtr2 = OS.XmStringParseText (
buffer2,
0,
OS.XmFONTLIST_DEFAULT_TAG,
OS.XmCHARSET_TEXT,
null,
0,
0);
/* Compute the filter path */
if (filterPath == null) filterPath = "";
/* Use the character encoding for the default locale */
byte [] buffer3 = Converter.wcsToMbcs (null, filterPath, true);
int xmStringPtr3 = OS.XmStringParseText (
buffer3,
0,
OS.XmFONTLIST_DEFAULT_TAG,
OS.XmCHARSET_TEXT,
null,
0,
0);
/* Use the character encoding for the default locale */
byte [] buffer7 = Converter.wcsToMbcs (null, "Selection", true);
int xmStringPtr4 = OS.XmStringParseText (
buffer7,
0,
OS.XmFONTLIST_DEFAULT_TAG,
OS.XmCHARSET_TEXT,
null,
0,
0);
/* Create the dialog */
int [] argList1 = {
OS.XmNresizePolicy, OS.XmRESIZE_NONE,
OS.XmNdialogStyle, OS.XmDIALOG_PRIMARY_APPLICATION_MODAL,
OS.XmNwidth, OS.XDisplayWidth (display, OS.XDefaultScreen (display)) * 4 / 9,
OS.XmNdialogTitle, xmStringPtr1,
OS.XmNpattern, xmStringPtr2,
OS.XmNdirectory, xmStringPtr3,
OS.XmNpathMode, OS.XmPATH_MODE_FULL,
OS.XmNfilterLabelString, xmStringPtr4
};
/*
* Feature in Linux. For some reason, the XmCreateFileSelectionDialog()
* will not accept NULL for the widget name. This works fine on the other
* Motif platforms and in the other XmCreate calls on Linux. The fix is
* to pass in a NULL terminated string, not a NULL pointer.
*/
byte [] name = new byte [] {0};
int dialog = OS.XmCreateFileSelectionDialog (parentHandle, name, argList1, argList1.length / 2);
int child = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_HELP_BUTTON);
if (child != 0) OS.XtUnmanageChild (child);
child = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_LIST);
if (child != 0) {
int parent2 = OS.XtParent(child);
if (parent2 !=0) OS.XtUnmanageChild (parent2);
}
child = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_LIST_LABEL);
if (child != 0) OS.XtUnmanageChild (child);
child = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_TEXT);
if (child != 0) OS.XtUnmanageChild (child);
child = OS.XmFileSelectionBoxGetChild (dialog, OS.XmDIALOG_SELECTION_LABEL);
if (child != 0) OS.XtUnmanageChild (child);
OS.XmStringFree (xmStringPtr1);
OS.XmStringFree (xmStringPtr2);
OS.XmStringFree (xmStringPtr3);
OS.XmStringFree (xmStringPtr4);
/* Add label widget for message text. */
/* Use the character encoding for the default locale */
byte [] buffer4 = Converter.wcsToMbcs (null, message, true);
int xmString1 = OS.XmStringGenerate(buffer4, null, OS.XmCHARSET_TEXT, null);
int [] argList = {
OS.XmNlabelType, OS.XmSTRING,
OS.XmNlabelString, xmString1
};
int textArea = OS.XmCreateLabel(dialog, name, argList, argList.length/2);
OS.XtManageChild(textArea);
OS.XmStringFree (xmString1);
/* Hook the callbacks. */
Callback callback = new Callback (this, "activate", 3);
int address = callback.getAddress ();
OS.XtAddCallback (dialog, OS.XmNokCallback, address, OS.XmDIALOG_OK_BUTTON);
OS.XtAddCallback (dialog, OS.XmNcancelCallback, address, OS.XmDIALOG_CANCEL_BUTTON);
/* Open the dialog and dispatch events. */
cancel = true;
OS.XtManageChild (dialog);
/* Should be a pure OS message loop (no SWT AppContext) */
while (OS.XtIsRealized (dialog) && OS.XtIsManaged (dialog))
if (!appContext.readAndDispatch ()) appContext.sleep ();
/* Set the new path, file name and filter. */
String directoryPath="";
if (!cancel) {
int [] argList2 = {OS.XmNdirMask, 0};
OS.XtGetValues (dialog, argList2, argList2.length / 2);
int xmString3 = argList2 [1];
int [] table = new int [] {appContext.tabMapping, appContext.crMapping};
int ptr = OS.XmStringUnparse (
xmString3,
null,
OS.XmCHARSET_TEXT,
OS.XmCHARSET_TEXT,
table,
table.length,
OS.XmOUTPUT_ALL);
if (ptr != 0) {
int length = OS.strlen (ptr);
byte [] buffer = new byte [length];
OS.memmove (buffer, ptr, length);
OS.XtFree (ptr);
/* Use the character encoding for the default locale */
directoryPath = new String (Converter.mbcsToWcs (null, buffer));
}
OS.XmStringFree (xmString3);
int length = directoryPath.length ();
if (directoryPath.charAt (length - 1) == '*') {
directoryPath = directoryPath.substring (0, length - 1);
length--;
}
if (directoryPath.endsWith (SEPARATOR) && !directoryPath.equals (SEPARATOR)) {
directoryPath = directoryPath.substring (0, length - 1);
}
filterPath = directoryPath;
}
/* Destroy the dialog and update the display. */
if (OS.XtIsRealized (dialog)) OS.XtDestroyWidget (dialog);
if (destroyContext) appContext.dispose ();
callback.dispose ();
if (cancel) return null;
return directoryPath;
}
/**
* Sets the path which the dialog will use to filter
* the directories it shows to the argument, which may be
* null.
*
* @param string the filter path
*/
public void setFilterPath (String string) {
filterPath = string;
}
/**
* Sets the dialog's message, which is a description of
* the purpose for which it was opened. This message will be
* visible on the dialog while it is open.
*
* @param string the message
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the string is null</li>
* </ul>
*/
public void setMessage (String string) {
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
message = string;
}
}
| [
"375833274@qq.com"
] | 375833274@qq.com |
5a1f145129fe86435ae6ba898a654b0396b4969c | 590f065619a7168d487eec05db0fd519cfb103b5 | /evosuite-tests/com/iluwatar/producer/consumer/Item_ESTest_scaffolding.java | 7d7ad80d4fce71481f8c2dacc5e265a3e48af9ce | [] | no_license | parthenos0908/EvoSuiteTrial | 3de131de94e8d23062ab3ba97048d01d504be1fb | 46f9eeeca7922543535737cca3f5c62d71352baf | refs/heads/master | 2023-02-17T05:00:39.572316 | 2021-01-18T00:06:01 | 2021-01-18T00:06:01 | 323,848,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,797 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Jan 11 10:52:01 GMT 2021
*/
package com.iluwatar.producer.consumer;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class Item_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.iluwatar.producer.consumer.Item";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.dir", "C:\\Users\\disto\\gitrepos\\EvoSuiteTrial");
java.lang.System.setProperty("java.io.tmpdir", "C:\\Users\\disto\\AppData\\Local\\Temp\\");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Item_ESTest_scaffolding.class.getClassLoader() ,
"com.iluwatar.producer.consumer.Item"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Item_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.iluwatar.producer.consumer.Item"
);
}
}
| [
"distortion0908@gmail.com"
] | distortion0908@gmail.com |
7cd2a7c9f43aecd61b6b8c342c63b1a15976d855 | 11b9a30ada6672f428c8292937dec7ce9f35c71b | /src/main/java/java/lang/instrument/IllegalClassFormatException.java | 3794c95eb4da6460c3c0f93bbf9dd0c3ded5d87a | [] | no_license | bogle-zhao/jdk8 | 5b0a3978526723b3952a0c5d7221a3686039910b | 8a66f021a824acfb48962721a20d27553523350d | refs/heads/master | 2022-12-13T10:44:17.426522 | 2020-09-27T13:37:00 | 2020-09-27T13:37:00 | 299,039,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,911 | java | /***** Lobxxx Translate Finished ******/
/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.lang.instrument;
/*
* Copyright 2003 Wily Technology, Inc.
* <p>
* 版权所有2003 Wily Technology,Inc.
*
*/
/**
* Thrown by an implementation of
* {@link java.lang.instrument.ClassFileTransformer#transform ClassFileTransformer.transform}
* when its input parameters are invalid.
* This may occur either because the initial class file bytes were
* invalid or a previously applied transform corrupted the bytes.
*
* <p>
* 当其输入参数无效时,由{@link java.lang.instrument.ClassFileTransformer#transform ClassFileTransformer.transform}
* 的实现引发。
* 这可能由于初始类文件字节无效或者先前应用的变换损坏了字节而发生。
*
*
* @see java.lang.instrument.ClassFileTransformer#transform
* @since 1.5
*/
public class IllegalClassFormatException extends Exception {
private static final long serialVersionUID = -3841736710924794009L;
/**
* Constructs an <code>IllegalClassFormatException</code> with no
* detail message.
* <p>
* 构造一个没有详细消息的<code> IllegalClassFormatException </code>。
*
*/
public
IllegalClassFormatException() {
super();
}
/**
* Constructs an <code>IllegalClassFormatException</code> with the
* specified detail message.
*
* <p>
* 使用指定的详细消息构造一个<code> IllegalClassFormatException </code>。
*
* @param s the detail message.
*/
public
IllegalClassFormatException(String s) {
super(s);
}
}
| [
"zhaobo@MacBook-Pro.local"
] | zhaobo@MacBook-Pro.local |
6bbf851d324d04998db0f61003b736ce647fc086 | 89cce5053a3553e3716d0a341e9fedafb4b4c3b2 | /app/src/androidTest/java/com/example/gayanlakshitha/easylec/ExampleInstrumentedTest.java | 8b2df57c9e44a769f3a5aca1a885454df5586b66 | [] | no_license | gligerglg/EasyLec | c2beea165fda22b3bab79e1bd05f1dbbab6dc3e0 | 6db65ce59b8ee0c791d081fa07a507376f0a901f | refs/heads/master | 2018-02-09T00:36:15.295673 | 2017-12-12T14:11:52 | 2017-12-12T14:11:52 | 96,601,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 772 | java | package com.example.gayanlakshitha.easylec;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.gayanlakshitha.easylec", appContext.getPackageName());
}
}
| [
"gliger.glg@gmail.com"
] | gliger.glg@gmail.com |
bb9a3ddf701f8c31149a58fc82ff3f05aabffacb | 0ccf977c0cc7325d3f433901e87235e11b1399f5 | /app/build/generated/source/buildConfig/client/debug/com/anyvision/facekeyexample/BuildConfig.java | 9ddbf178d2271340a1a54f99a1ce4794344bed58 | [] | no_license | fortknoxDesenv/FindFaceInviteMetting2 | 7635d5166fef34fb5e62f06660c13dc0f28a57ef | 2aa4a89d3c56dd4c59a628eb1ca7e13ba271654c | refs/heads/master | 2023-03-15T00:34:38.627908 | 2021-03-12T18:32:58 | 2021-03-12T18:32:58 | 347,154,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.anyvision.facekeyexample;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.anyvision.facekeyexample.ntec";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "client";
public static final int VERSION_CODE = 5;
public static final String VERSION_NAME = "5";
}
| [
"contato.ewertonrichieri@gmail.com"
] | contato.ewertonrichieri@gmail.com |
063d10453a0150c4db681cfc19a7f93633d73cbc | bd17eb2e7e6b4c5074fc8ca4cdac0a3b20c5b0a4 | /src/main/java/com/adashrod/mkvscanner/FormatConversionException.java | bffdf1c0aaf1d7ba4059830c752bd19308cf0dbf | [
"MIT"
] | permissive | adashrod/MkvScanner | e45b4eeea8a058f628849928107f7c5ecb8352b0 | ae0fecb2f69ce9510f717eea6e60c37d7266fee6 | refs/heads/main | 2022-06-16T08:32:40.985091 | 2019-05-05T14:09:49 | 2019-05-05T14:09:49 | 82,963,076 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package com.adashrod.mkvscanner;
/**
* Thrown when an attempt is made to demux a track and convert it to a format whose conversion is not supported.
*/
public class FormatConversionException extends DemuxerException {
public FormatConversionException(final String filename, final String arguments, final String demuxerOutput) {
super(filename, arguments, demuxerOutput);
}
}
| [
"adashrod@gmail.com"
] | adashrod@gmail.com |
2b46712d34a5578484668819643df8d1ec2ecc31 | 9460b2803223b98328f0dc7665d1b5e6d9c3b8ec | /src/main/java/org/proshin/finapi/account/FpAccount.java | 628b1beaa347ca584c172fa025d70f4f2c50542e | [
"Apache-2.0"
] | permissive | gitter-badger/finapi-java-client | 7a85a57d3ff8c8f344fdd56ef9c6907ffab2c9f1 | 1cb6e3552d9836cc949f08a83ee67c09a3473ff9 | refs/heads/master | 2020-04-03T12:14:55.704352 | 2018-10-29T08:06:18 | 2018-10-29T08:06:18 | 155,245,988 | 0 | 0 | null | 2018-10-29T16:37:14 | 2018-10-29T16:37:13 | null | UTF-8 | Java | false | false | 5,135 | java | /*
* Copyright 2018 Roman Proshin
*
* 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.proshin.finapi.account;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.json.JSONObject;
import org.proshin.finapi.accesstoken.AccessToken;
import org.proshin.finapi.account.in.FpEditParameters;
import org.proshin.finapi.account.out.ClearingAccount;
import org.proshin.finapi.account.out.FpClearingAccount;
import org.proshin.finapi.account.out.FpHolder;
import org.proshin.finapi.account.out.Holder;
import org.proshin.finapi.account.out.Order;
import org.proshin.finapi.account.out.Status;
import org.proshin.finapi.bankconnection.BankConnection;
import org.proshin.finapi.bankconnection.FpBankConnections;
import org.proshin.finapi.endpoint.Endpoint;
import org.proshin.finapi.primitives.IterableJsonArray;
import org.proshin.finapi.primitives.optional.OptionalBigDecimalOf;
import org.proshin.finapi.primitives.optional.OptionalOffsetDateTimeOf;
import org.proshin.finapi.primitives.optional.OptionalStringOf;
/**
* @todo #21 Write unit tests for FpAccount class
*/
public final class FpAccount implements Account {
private final Endpoint endpoint;
private final AccessToken token;
private final JSONObject origin;
private final String url;
public FpAccount(final Endpoint endpoint, final AccessToken token, final JSONObject origin, final String url) {
this.endpoint = endpoint;
this.token = token;
this.origin = origin;
this.url = url;
}
@Override
public Long id() {
return this.origin.getLong("id");
}
@Override
public BankConnection bankConnection() {
return new FpBankConnections(this.endpoint, this.token)
.one(this.origin.getLong("bankConnectionId"));
}
@Override
public Optional<String> name() {
return new OptionalStringOf(this.origin, "accountName").get();
}
@Override
public String number() {
return this.origin.getString("accountNumber");
}
@Override
public Optional<String> subNumber() {
return new OptionalStringOf(this.origin, "subAccountNumber").get();
}
@Override
public Optional<String> iban() {
return new OptionalStringOf(this.origin, "iban").get();
}
@Override
public Holder holder() {
return new FpHolder(this.origin);
}
@Override
public Optional<String> currency() {
return new OptionalStringOf(this.origin, "accountCurrency").get();
}
@Override
public Type type() {
return new Type.TypeOf(this.origin.getInt("accountTypeId")).get();
}
@Override
public Optional<BigDecimal> balance() {
return new OptionalBigDecimalOf(this.origin, "balance").get();
}
@Override
public Optional<BigDecimal> overdraft() {
return new OptionalBigDecimalOf(this.origin, "overdraft").get();
}
@Override
public Optional<BigDecimal> overdraftLimit() {
return new OptionalBigDecimalOf(this.origin, "overdraftLimit").get();
}
@Override
public Optional<BigDecimal> availableFunds() {
return new OptionalBigDecimalOf(this.origin, "availableFunds").get();
}
@Override
public Optional<OffsetDateTime> lastSuccessfulUpdate() {
return new OptionalOffsetDateTimeOf(this.origin, "lastSuccessfulUpdate").get();
}
@Override
public Optional<OffsetDateTime> lastUpdateAttempt() {
return new OptionalOffsetDateTimeOf(this.origin, "lastUpdateAttempt").get();
}
@Override
public boolean isNew() {
return this.origin.getBoolean("isNew");
}
@Override
public Status status() {
return Status.valueOf(this.origin.getString("status"));
}
@Override
public Iterable<Order> supportedOrders() {
return new IterableJsonArray<>(
this.origin.getJSONArray("supportedOrders"),
(array, index) -> Order.valueOf(array.getString(index))
);
}
@Override
public Iterable<ClearingAccount> clearingAccounts() {
return new IterableJsonArray<>(
this.origin.getJSONArray("clearingAccounts"),
(array, index) -> new FpClearingAccount(array.getJSONObject(index))
);
}
@Override
public void edit(final FpEditParameters parameters) {
this.endpoint.patch(this.url + this.id(), this.token, parameters);
}
@Override
public void delete(final Long id) {
this.endpoint.delete(
this.url + this.id(),
this.token
);
}
}
| [
"roman@proshin.org"
] | roman@proshin.org |
11e0e3d0235cd0a2c3ac05c889144d2f15c2edef | 3482b7b905e5f1c04e035cffe9ce4af45a293ce1 | /BinaryTree/InvertBinaryTree.java | 60fbe7335afa9abb6629c9f4b6d4d4a669d804e3 | [] | no_license | RoyceDavison/LeetcodeDailyPractice | c85ac4ac2cf6d1fb83a70b3af3ce12187070e1e6 | 3a986d157cde274394786a703e255fc0847afb97 | refs/heads/master | 2020-05-04T09:30:55.197896 | 2019-04-02T12:26:22 | 2019-04-02T12:26:22 | 179,069,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | public class InvertBinaryTree {
public static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
public static TreeNode invertTree(TreeNode root) {
if (root == null) {
return null;
}
TreeNode right = invertTree(root.right);
TreeNode left = invertTree(root.left);
root.left = right;
root.right = left;
return root;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TreeNode root = new TreeNode(2);
root.left = new TreeNode(1);
root.right = new TreeNode(3);
root = invertTree(root);
System.out.println(" "+root.val);
System.out.print(root.left.val+" ");
System.out.print(root.right.val);
}
}
| [
"roycezabc@gmail.com"
] | roycezabc@gmail.com |
808632a6b5c9d6fafbb4dae7d584cee8d4e5a481 | 506511ed8d28401ecf4f342f4788591f865e5837 | /atcrowdfunding20200623/manager-impl/src/main/java/com/atcrowdfunding/manager/controller/UserController.java | bdb2538b62e84089a1c417a1946b17bd95619f26 | [] | no_license | merucry2017/atcrowdfunding20200618 | 4424428eadb462863c9ee2ac92da4f328ac3cb9f | d41a0a891f0f78a5e9373a76703a2492bfca700d | refs/heads/master | 2022-11-07T09:18:30.148423 | 2020-06-27T07:34:18 | 2020-06-27T07:34:18 | 273,260,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,231 | java | package com.atcrowdfunding.manager.controller;
import com.atcrowdfunding.bean.User;
import com.atcrowdfunding.manager.service.UserService;
import com.atcrowdfunding.util.AjaxResult;
import com.atcrowdfunding.util.MD5Util;
import com.atcrowdfunding.util.Page;
import com.atcrowdfunding.util.StringUtil;
import javafx.beans.binding.ObjectExpression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("/toIndex")
public String index(Integer pageno, Integer pagesize, Map map){
return "user/index";
}
//条件查询
@ResponseBody
@RequestMapping("/doIndex")
public Object index(@RequestParam(value = "pageno", required = false, defaultValue = "1") Integer pageno,
@RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize,
String queryText){
AjaxResult result = new AjaxResult();
try {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("pageno", pageno);
paramMap.put("pagesize", pagesize);
if (StringUtil.isNotEmpty(queryText)){
if (queryText.contains("%")){
queryText = queryText.replaceAll("%", "\\\\%");
}
paramMap.put("queryText", queryText);
}
Page page = userService.queryPage(paramMap);
result.setSuccess(true);
result.setPage(page);
} catch (Exception e) {
result.setSuccess(false);
e.printStackTrace();
result.setMessage("查询数据失败!");
}
return result; //将对象序列化为JSON字符串,以流的形式返回.
}
@RequestMapping("/toAdd")
public String toAdd(){
return "user/add";
}
@ResponseBody
@RequestMapping("/doAdd")
public Object doAdd(User user){
AjaxResult result = new AjaxResult();
try {
int count = userService.saveUser(user);
result.setSuccess(count==1);
}catch (Exception e){
result.setSuccess(false);
e.printStackTrace();
result.setMessage("保存数据失败!");
}
return result;//将对象序列化为JSON字符串,以流的形式返回.
}
@RequestMapping("/toUpdate")
public String toUpdate(Integer id,Map<String, Object> map){
User user = userService.getUserById(id);
map.put("user",user);
return "user/update";
}
@ResponseBody
@RequestMapping("/doUpdate")
public Object doUpdate(User user){
AjaxResult result = new AjaxResult();
try {
int count = userService.updateUser(user);
result.setSuccess(count==1);
}catch (Exception e){
result.setSuccess(false);
e.printStackTrace();
result.setMessage("修改数据失败");
}
return result;
}
@ResponseBody
@RequestMapping("/doDelete")
public Object doDelete(Integer id){
AjaxResult result = new AjaxResult();
try {
int count = userService.deleteUser(id);
result.setSuccess(count==1);
}catch (Exception e){
result.setSuccess(false);
e.printStackTrace();
result.setMessage("删除数据失败");
}
return result;
}
@ResponseBody
@RequestMapping("/doDeleteBatch")
public Object doDeleteBatch(Integer[] id){
AjaxResult result = new AjaxResult();
try {
int count = userService.deleteBatchUser(id);
result.setSuccess(count==1);
}catch (Exception e){
result.setSuccess(false);
e.printStackTrace();
result.setMessage("删除数据失败");
}
return result;
}
// @ResponseBody
// @RequestMapping("/index")
// public Object index(@RequestParam(value = "pageno", required = false, defaultValue = "1") Integer pageno,
// @RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize){
// AjaxResult result = new AjaxResult();
//
// try {
// Page page = userService.queryPage(pageno, pagesize);
//
// result.setSuccess(true);
// result.setPage(page);
// }catch (Exception e){
// result.setSuccess(false);
// e.printStackTrace();
// result.setMessage("查询数据失败!");
// }
// return result;
// }
// @RequestMapping("/index")
// public String index(Integer pageno, Integer pagesize, Map map){
//
// Page page = userService.queryPage(pageno, pagesize);
//
// map.put("page", page);
//
// return "user/index";
// }
}
| [
"865185222@qq.com"
] | 865185222@qq.com |
1bad31deddb796f9f26962955d9888815832ddb8 | 1bf3e173871b1f5b64403a467230fc66d6ec931f | /src/main/java/gov/nih/nlm/nls/metamap/document/BioCDocumentLoaderRegistry.java | 65914ac40d50da046d090a8e90180a7fbbcb9d3e | [] | no_license | espinoj/public_mm_lite | 928574bcba762326d162f3df130de3f04748acce | 5db8e61f9f2132639b621cc52f2fa0c5ace430e9 | refs/heads/master | 2022-07-11T21:45:02.441348 | 2020-07-01T18:44:02 | 2020-07-01T18:44:02 | 252,557,637 | 0 | 0 | null | 2022-07-01T20:39:14 | 2020-04-02T20:22:27 | Java | UTF-8 | Java | false | false | 4,181 | java | //
package gov.nih.nlm.nls.metamap.document;
import java.util.HashMap;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* list document loaders in properties file in the following format:
* <pre>
* bioc.document.loader.{name}: classname
* </pre>
*/
public class BioCDocumentLoaderRegistry {
/** log4j logger instance */
private static final Logger logger = LogManager.getLogger(BioCDocumentLoaderRegistry.class);
/** Map of BioC document loader by document type name */
static final Map<String,BioCDocumentLoader> bioCDocumentLoaderMap = new HashMap<String,BioCDocumentLoader>();
/** Map of document loader description by document type name */
static final Map<String,String> descriptionMap = new HashMap<String,String>();
/**
* Register loader.
* @param name name of loader
* @param description description of loader
* @param className full classname of loader
* @throws ClassNotFoundException class not found exception
* @throws InstantiationException exception during class instantiation
* @throws NoSuchMethodException no such method exception
* @throws IllegalAccessException illegal access exception
*/
public static void register(String name, String description,
String className)
throws ClassNotFoundException, InstantiationException,
NoSuchMethodException, IllegalAccessException
{
Object classInstance = Class.forName(className).newInstance();
if (classInstance instanceof BioCDocumentLoader) {
BioCDocumentLoader instance = (BioCDocumentLoader)classInstance;
synchronized(bioCDocumentLoaderMap) {
bioCDocumentLoaderMap.put(name,instance);
}
synchronized(descriptionMap) {
descriptionMap.put(name,description);
}
} else {
logger.fatal("class " + className +
" for document input type " + name +
" is not of class BioCDocumentLoader. Not adding entry for input type " + name);
throw new RuntimeException("Class instance does not implement the BioCDocumentLoader interface.");
}
}
/**
* Register loader.
* @param name name of loader
* @param description description of loader
* @param instance class instance of document loader
*/
public static void register(String name, String description,
BioCDocumentLoader instance)
{
synchronized(bioCDocumentLoaderMap) {
bioCDocumentLoaderMap.put(name, instance);
}
synchronized(descriptionMap) {
descriptionMap.put(name,description);
}
}
public static Set<String> listNameSet() {
return bioCDocumentLoaderMap.keySet();
}
public static List<String> listInfo() {
List<String> descriptionList = new ArrayList<String>();
for (Map.Entry<String,BioCDocumentLoader> entry: bioCDocumentLoaderMap.entrySet()) {
descriptionList.add(entry.getKey() + ": " + entry.getValue());
}
return descriptionList;
}
public static BioCDocumentLoader getDocumentLoader(String name) {
return bioCDocumentLoaderMap.get(name);
}
public static boolean contains(String name) {
return bioCDocumentLoaderMap.containsKey(name);
}
public static BioCDocumentLoader get(String name) {
return bioCDocumentLoaderMap.get(name);
}
public static void register(Properties properties)
throws ClassNotFoundException, InstantiationException, NoSuchMethodException,IllegalAccessException
{
for (String propname: properties.stringPropertyNames()) {
if (propname.indexOf("bioc.document.loader.") >= 0) {
String name = propname.substring("bioc.document.loader.".length());
String description = properties.getProperty("bioc.document.loader-description.", "");
register(name, description, properties.getProperty(propname));
}
}
if (logger.isDebugEnabled()) {
for (Map.Entry<String,BioCDocumentLoader> entry: bioCDocumentLoaderMap.entrySet()) {
logger.debug(entry.getKey() + " -> " + entry.getValue().getClass().getName());
}
}
}
}
| [
"juest4@pitt.edu"
] | juest4@pitt.edu |
d8226fc77c9047cb8d9449f7fd6f765bbbb5c3cf | 36e726531d9561e14663d318ef1c7accf79d6756 | /pw-service-user/src/main/java/com/pw/service/user/dao/impl/GroupRoleDaoImpl.java | f829c92b7bf28befb506e0d66bad15bc1e8bc464 | [] | no_license | superliu213/pwdubbo | 61661a75ed380c77f9951264b6d61cfea3db1d77 | 2de8965b9c3b017e688bfb28f920063fbd8f382c | refs/heads/master | 2021-05-07T00:40:22.225339 | 2017-11-10T04:05:24 | 2017-11-10T04:05:24 | 110,192,010 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 860 | java | package com.pw.service.user.dao.impl;
import com.pw.api.user.entity.GroupRole;
import com.pw.common.core.dao.impl.BaseDaoImpl;
import com.pw.service.user.dao.GroupRoleDao;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository("groupRoleDao")
public class GroupRoleDaoImpl extends BaseDaoImpl<GroupRole> implements GroupRoleDao {
@Override
public void deleteByGroupId(String groupId) {
super.getSqlSession().delete(getStatement("deleteByGroupId"),groupId);
}
@Override
public void deleteByRoleId(String roleId) {
super.getSqlSession().delete(getStatement("deleteByRoleId"),roleId);
}
@Override
public List<String> getRoleList(String groupId) {
List<String> reuslt = super.getSqlSession().selectList(getStatement("getRoleList"),groupId);
return reuslt;
}
}
| [
"kaka_517727926@qq.com"
] | kaka_517727926@qq.com |
2fb5a0e6673d8be2c890b7db608071aea2553dad | b4ff9b461af2409998134a778b38b37d8a4df9f1 | /adminmaxx/src/main/java/com/project/app/adminmax/controllers/UserController.java | f78f37bc7fd94a7ec499669a8adcac8e0b967eb8 | [] | no_license | SuzyKostumyan/Registration-login-mongoDB-Docker | 7821e9dda0e887a4e6f576f84e53cf6a3cf92e06 | 48ff6acc6889d93b574349a00b60752074d0c335 | refs/heads/master | 2023-07-31T23:36:56.178505 | 2021-09-21T14:55:02 | 2021-09-21T14:55:02 | 408,754,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,183 | java | package com.project.app.adminmax.controllers;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import com.project.app.adminmax.domain.User;
import com.project.app.adminmax.domain.CustomLog;
import com.project.app.adminmax.domain.LoginRequest;
import com.project.app.adminmax.services.UserService;
import java.util.Optional;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author suzy
*/
@RestController
@RequestMapping("/api/v2/user")
@Slf4j
public class UserController {
@Autowired
private UserService userService;
@PostMapping(path = "/registration", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity save(@RequestBody User user) {
Optional<User> saveUser = userService.registration(user);
if (saveUser.isPresent()) {
return ResponseEntity.status(HttpStatus.OK).body(saveUser);
}
return ResponseEntity.status(400).body(saveUser);
}
@GetMapping(path = "/findAll/registered/users", produces = MediaType.APPLICATION_JSON_VALUE)
public List<User> findAll() {
return (List<User>) userService.findAll();
}
@PostMapping(path = "/login", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> loginUser(@RequestBody LoginRequest request) {
Optional<?> loginUser = userService.login(request.getEmail(), request.getPassword());
if (loginUser.isPresent()) {
return ResponseEntity.status(HttpStatus.OK).body(loginUser);
}
return ResponseEntity.status(400).body(loginUser);
}
@PostMapping(path = "/logout", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> logout() {
boolean logoutUser = userService.logout();
return ResponseEntity.status(HttpStatus.OK).body(logoutUser);
}
@DeleteMapping("/delete/byId")
public ResponseEntity delete(@RequestParam String Id) {
String deleteById = userService.deleteById(Id);
if (deleteById.isEmpty()) {
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("Give id");
}
return ResponseEntity.status(HttpStatus.OK).body("Successfullly deleted");
}
@DeleteMapping("/deleteAll/users")
public ResponseEntity deleteAll() {
userService.deleteAll();
return ResponseEntity.status(HttpStatus.OK).body("All users successfullly have been deleted");
}
@PutMapping(path = "/change/fields", produces = MediaType.APPLICATION_JSON_VALUE)
public User put(@RequestBody User user) {
return userService.update(user);
}
@GetMapping("/findbyId")
public ResponseEntity findById(@RequestParam String Id) {
Optional<?> findById = userService.findById(Id);
if (findById.isPresent()) {
return ResponseEntity.status(HttpStatus.OK).body(findById);
}
return ResponseEntity.status(HttpStatus.EXPECTATION_FAILED).body("Something goes wrong");
}
@GetMapping(path = "/findAll/logs/sortByDate", produces = MediaType.APPLICATION_JSON_VALUE)
public List<CustomLog> findAllLogs(@RequestParam Integer pageNo, @RequestParam Integer pageSize, @RequestParam String sortBy) {
return userService.findAllEventLogs(pageNo, pageSize, sortBy);
}
@GetMapping(path = "admin/see/Top10eventLogs/orderByDateDesc", produces = MediaType.APPLICATION_JSON_VALUE)
public List<CustomLog> findTop10ByOrderByDateDesc() {
return userService.findTop10ByOrderByDateDesc();
}
}
| [
"suzy.kostumyan@gmail.com"
] | suzy.kostumyan@gmail.com |
f54ef23b2e264a12ff168d1da58130510032602d | cf83e6b535f92727297a179aaf2a7dc7016c0c3d | /src/fr/univnantes/m1/SecurityManager.java | cc499ca326e8828d26feeba2badf10f29b2314d8 | [] | no_license | damien-maussion/HADL-RM | 19d003b2ddb32c367e3ab2ffdd372d690dff1466 | 1cf4f6026b8b91bdb9ef6b751e45596e3b32edc8 | refs/heads/master | 2021-01-10T12:46:18.345056 | 2015-12-07T13:48:25 | 2015-12-07T13:48:25 | 46,275,861 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,893 | java | package fr.univnantes.m1;
import java.util.Observable;
import fr.univnantes.m2.Configuration.Composant;
import fr.univnantes.m2.Configuration.EventInConfiguration;
import fr.univnantes.m2.InterfaceComposant.PortInput;
import fr.univnantes.m2.InterfaceComposant.PortOutput;
import fr.univnantes.m2.InterfaceComposant.ServiceInput;
import fr.univnantes.m2.InterfaceComposant.ServiceOutput;
public class SecurityManager extends Composant{
public SecurityManager() {
super("SecurityManager");
ServiceInput si1 = new ServiceInput("security_authSR", this);
PortInput pi1 = new PortInput("security_authPR", this);
si1.usePort(pi1);
ServiceOutput so1 = new ServiceOutput("security_authSF", this);
PortOutput po1 = new PortOutput("security_authPF", this);
so1.usePort(po1);
interfaceComposants.add(pi1);
interfaceComposants.add(si1);
interfaceComposants.add(so1);
interfaceComposants.add(po1);
ServiceInput si2 = new ServiceInput("check_querySR", this);
PortInput pi2 = new PortInput("check_queryPR", this);
si2.usePort(pi2);
ServiceOutput so2 = new ServiceOutput("check_querySF", this);
PortOutput po2 = new PortOutput("check_queryPF", this);
so2.usePort(po2);
interfaceComposants.add(pi2);
interfaceComposants.add(si2);
interfaceComposants.add(so2);
interfaceComposants.add(po2);
}
@Override
public void update(Observable o, Object arg) {
//System.out.println(this + " has been notified : "+arg);
boolean treated = false;
EventInConfiguration ev = (EventInConfiguration) arg;
if (ev.getSrc() instanceof PortInput){
PortInput p = (PortInput) ev.getSrc();
treated=true;
if ("security_authPR".equals(p.getName())){
callService("check_querySF", ev.getArg());
}
else{
callService("security_authSF", ev.getArg());
}
}
if (!treated){
setChanged();
notifyObservers(arg);
}
}
}
| [
"damien.maussion@hotmail.fr"
] | damien.maussion@hotmail.fr |
d867a5d18ce7d0d9358cf5f5d1a7193af78144d1 | 58e8fa1c839e7b9661f599e62579b6173c3d8d98 | /src/test/java/com/mysql/repository/CustomAuditEventRepositoryIntTest.java | e63723222390f749f22bf48475388d1e33786ad0 | [] | no_license | nagarajgoud123/jhMySql | 1cc3eb1f11c5bfa964dfefb5a600d004d79ef6d9 | 3395157928ef77e556721beb89b1fd0d1e0994e9 | refs/heads/master | 2020-03-07T09:50:06.853604 | 2018-03-30T10:45:27 | 2018-03-30T10:45:27 | 127,416,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,521 | java | package com.mysql.repository;
import com.mysql.MySqlApp;
import com.mysql.config.Constants;
import com.mysql.config.audit.AuditEventConverter;
import com.mysql.domain.PersistentAuditEvent;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static com.mysql.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH;
/**
* Test class for the CustomAuditEventRepository class.
*
* @see CustomAuditEventRepository
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MySqlApp.class)
@Transactional
public class CustomAuditEventRepositoryIntTest {
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
private CustomAuditEventRepository customAuditEventRepository;
private PersistentAuditEvent testUserEvent;
private PersistentAuditEvent testOtherUserEvent;
private PersistentAuditEvent testOldUserEvent;
@Before
public void setup() {
customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter);
persistenceAuditEventRepository.deleteAll();
Instant oneHourAgo = Instant.now().minusSeconds(3600);
testUserEvent = new PersistentAuditEvent();
testUserEvent.setPrincipal("test-user");
testUserEvent.setAuditEventType("test-type");
testUserEvent.setAuditEventDate(oneHourAgo);
Map<String, String> data = new HashMap<>();
data.put("test-key", "test-value");
testUserEvent.setData(data);
testOldUserEvent = new PersistentAuditEvent();
testOldUserEvent.setPrincipal("test-user");
testOldUserEvent.setAuditEventType("test-type");
testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000));
testOtherUserEvent = new PersistentAuditEvent();
testOtherUserEvent.setPrincipal("other-test-user");
testOtherUserEvent.setAuditEventType("test-type");
testOtherUserEvent.setAuditEventDate(oneHourAgo);
}
@Test
public void testFindAfter() {
persistenceAuditEventRepository.save(testUserEvent);
persistenceAuditEventRepository.save(testOldUserEvent);
List<AuditEvent> events =
customAuditEventRepository.find(Date.from(testUserEvent.getAuditEventDate().minusSeconds(3600)));
assertThat(events).hasSize(1);
AuditEvent event = events.get(0);
assertThat(event.getPrincipal()).isEqualTo(testUserEvent.getPrincipal());
assertThat(event.getType()).isEqualTo(testUserEvent.getAuditEventType());
assertThat(event.getData()).containsKey("test-key");
assertThat(event.getData().get("test-key").toString()).isEqualTo("test-value");
assertThat(event.getTimestamp()).isEqualTo(Date.from(testUserEvent.getAuditEventDate()));
}
@Test
public void testFindByPrincipal() {
persistenceAuditEventRepository.save(testUserEvent);
persistenceAuditEventRepository.save(testOldUserEvent);
persistenceAuditEventRepository.save(testOtherUserEvent);
List<AuditEvent> events = customAuditEventRepository
.find("test-user", Date.from(testUserEvent.getAuditEventDate().minusSeconds(3600)));
assertThat(events).hasSize(1);
AuditEvent event = events.get(0);
assertThat(event.getPrincipal()).isEqualTo(testUserEvent.getPrincipal());
assertThat(event.getType()).isEqualTo(testUserEvent.getAuditEventType());
assertThat(event.getData()).containsKey("test-key");
assertThat(event.getData().get("test-key").toString()).isEqualTo("test-value");
assertThat(event.getTimestamp()).isEqualTo(Date.from(testUserEvent.getAuditEventDate()));
}
@Test
public void testFindByPrincipalNotNullAndAfterIsNull() {
persistenceAuditEventRepository.save(testUserEvent);
persistenceAuditEventRepository.save(testOtherUserEvent);
List<AuditEvent> events = customAuditEventRepository.find("test-user", null);
assertThat(events).hasSize(1);
assertThat(events.get(0).getPrincipal()).isEqualTo("test-user");
}
@Test
public void testFindByPrincipalIsNullAndAfterIsNull() {
persistenceAuditEventRepository.save(testUserEvent);
persistenceAuditEventRepository.save(testOtherUserEvent);
List<AuditEvent> events = customAuditEventRepository.find(null, null);
assertThat(events).hasSize(2);
assertThat(events).extracting("principal")
.containsExactlyInAnyOrder("test-user", "other-test-user");
}
@Test
public void findByPrincipalAndType() {
persistenceAuditEventRepository.save(testUserEvent);
persistenceAuditEventRepository.save(testOldUserEvent);
testOtherUserEvent.setAuditEventType(testUserEvent.getAuditEventType());
persistenceAuditEventRepository.save(testOtherUserEvent);
PersistentAuditEvent testUserOtherTypeEvent = new PersistentAuditEvent();
testUserOtherTypeEvent.setPrincipal(testUserEvent.getPrincipal());
testUserOtherTypeEvent.setAuditEventType("test-other-type");
testUserOtherTypeEvent.setAuditEventDate(testUserEvent.getAuditEventDate());
persistenceAuditEventRepository.save(testUserOtherTypeEvent);
List<AuditEvent> events = customAuditEventRepository.find("test-user",
Date.from(testUserEvent.getAuditEventDate().minusSeconds(3600)), "test-type");
assertThat(events).hasSize(1);
AuditEvent event = events.get(0);
assertThat(event.getPrincipal()).isEqualTo(testUserEvent.getPrincipal());
assertThat(event.getType()).isEqualTo(testUserEvent.getAuditEventType());
assertThat(event.getData()).containsKey("test-key");
assertThat(event.getData().get("test-key").toString()).isEqualTo("test-value");
assertThat(event.getTimestamp()).isEqualTo(Date.from(testUserEvent.getAuditEventDate()));
}
@Test
public void addAuditEvent() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value");
assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp().toInstant());
}
@Test
public void addAuditEventTruncateLargeData() {
Map<String, Object> data = new HashMap<>();
StringBuilder largeData = new StringBuilder();
for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) {
largeData.append("a");
}
data.put("test-key", largeData);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
String actualData = persistentAuditEvent.getData().get("test-key");
assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH);
assertThat(actualData).isSubstringOf(largeData);
assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp().toInstant());
}
@Test
public void testAddEventWithWebAuthenticationDetails() {
HttpSession session = new MockHttpSession(null, "test-session-id");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(session);
request.setRemoteAddr("1.2.3.4");
WebAuthenticationDetails details = new WebAuthenticationDetails(request);
Map<String, Object> data = new HashMap<>();
data.put("test-key", details);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4");
assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id");
}
@Test
public void testAddEventWithNullData() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", null);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null");
}
@Test
public void addAuditEventWithAnonymousUser() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
@Test
public void addAuditEventWithAuthorizationFailureType() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
}
| [
"m.nagaraj@simbalabs.com"
] | m.nagaraj@simbalabs.com |
fc652fa073471de633f0cc36c23e9ce157ee4e9e | 94d391922b685f3a911702f4b4fb5ecfbc67b65f | /web/support/src/main/java/org/yes/cart/cluster/service/impl/WsCacheDirectorImpl.java | dfbe6029da5b51e0a234140633bb437fa42f10f6 | [
"Apache-2.0"
] | permissive | yuzhijia88/yes-cart | 6ee20754ac0c9d4b4c7ea60c3f6a17920f5d2f40 | a93e0b9b640a1c0985bcc8be986802830ec6ddec | refs/heads/master | 2020-04-04T14:12:35.838691 | 2018-11-03T09:16:56 | 2018-11-03T09:16:56 | 155,991,408 | 1 | 0 | null | 2018-11-03T14:35:30 | 2018-11-03T14:35:30 | null | UTF-8 | Java | false | false | 3,665 | java | /*
* Copyright 2013 Denys Pavlov, Igor Azarnyi
*
* 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.yes.cart.cluster.service.impl;
import org.yes.cart.cluster.node.Node;
import org.yes.cart.cluster.node.NodeService;
import org.yes.cart.cluster.service.CacheDirector;
import org.yes.cart.domain.dto.impl.CacheInfoDTO;
import java.util.ArrayList;
import java.util.Map;
/**
* Service responsible to evict particular cache(s) depending on entity and operation.
*
* User: Igor Azarny iazarny@yahoo.com
* Date: 18 Aug 2013
* Time: 9:50 AM
*/
public class WsCacheDirectorImpl extends CacheDirectorImpl implements CacheDirector {
private NodeService nodeService;
public NodeService getNodeService() {
return nodeService;
}
/**
* Spring IoC.
*
* @param nodeService node service
*/
public void setNodeService(final NodeService nodeService) {
this.nodeService = nodeService;
nodeService.subscribe("CacheDirector.getCacheInfo", message -> {
final Node node = nodeService.getCurrentNode();
final ArrayList<CacheInfoDTO> caches = new ArrayList<>();
for (final CacheInfoDTO cache : WsCacheDirectorImpl.this.getCacheInfo()) {
cache.setNodeId(node.getId());
cache.setNodeUri(node.getChannel());
caches.add(cache);
}
return caches;
});
nodeService.subscribe("CacheDirector.evictAllCache", message -> {
final Boolean force = (Boolean) message.getPayload();
WsCacheDirectorImpl.this.evictAllCache(force != null && force);
return "OK";
});
nodeService.subscribe("CacheDirector.evictCache", message -> {
WsCacheDirectorImpl.this.evictCache((String) message.getPayload());
return "OK";
});
nodeService.subscribe("CacheDirector.enableStats", message -> {
WsCacheDirectorImpl.this.enableStats((String) message.getPayload());
return "OK";
});
nodeService.subscribe("CacheDirector.disableStats", message -> {
WsCacheDirectorImpl.this.disableStats((String) message.getPayload());
return "OK";
});
nodeService.subscribe("CacheDirector.onCacheableChange", message -> {
final Map<String, Object> payload = (Map<String, Object>) message.getPayload();
return WsCacheDirectorImpl.this.onCacheableChange(
(String) payload.get("entityOperation"),
(String) payload.get("entityName"),
(Long) payload.get("pkValue")
);
});
nodeService.subscribe("CacheDirector.onCacheableBulkChange", message -> {
final Map<String, Object> payload = (Map<String, Object>) message.getPayload();
return WsCacheDirectorImpl.this.onCacheableBulkChange(
(String) payload.get("entityOperation"),
(String) payload.get("entityName"),
(Long[]) payload.get("pkValues")
);
});
}
}
| [
"denis.v.pavlov@gmail.com"
] | denis.v.pavlov@gmail.com |
c8304b832a7cb3f520eaacbdf7334a2723ed1485 | d31ce08efba80ef6cb8026d6728eadbd6c23c321 | /app/src/main/java/com/sunit/zingo/Activities/SplashScreenActivity.java | e4d788e1db3a6eb1ddd96be4de30cc9ef406883b | [] | no_license | SunitRoy2703/Zingo | b290d443c7317775ce476fe97fe734b7782a4475 | b4ab6d299bde13ea515907a71ee0860f0abefd30 | refs/heads/main | 2023-04-21T11:37:53.349706 | 2021-05-02T09:53:06 | 2021-05-02T09:53:06 | 363,209,478 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,460 | java | package com.sunit.zingo.Activities;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.Handler;
import com.sunit.zingo.R;
public class SplashScreenActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (checkSignInStatus()) {
Intent intent = new Intent(SplashScreenActivity.this, HomeActivity.class);
startActivity(intent);
finish();
} else {
Intent intent = new Intent(SplashScreenActivity.this, AuthenticationActivity.class);
startActivity(intent);
finish();
}
}
}, 1000);
}
private Boolean checkSignInStatus() {
SharedPreferences sharedPref = getSharedPreferences(
getString(R.string.preference_file_key), Context.MODE_PRIVATE);
Boolean signInStatus = sharedPref.getBoolean("SignInStatus", false);
return signInStatus;
}
} | [
"2703iamsry@gmail.com"
] | 2703iamsry@gmail.com |
b0acc19d6e193689e88e96bc258642da90b24ccd | 1d531dfa40ff7bf46d0a41005a56a16fb22d685d | /src/main/java/com/launchacademy/petadoption/seeders/PetSeeder.java | 7ab333154fb3be0f0b85bc6eb722c0171355e27f | [] | no_license | mpnauss/java-spring-express-refactor | 0a31820813f6977dc6c00f2d0ba6690cbd145e43 | 10460a08f40b679d2ca575233a6b8095f2af90db | refs/heads/main | 2023-05-01T11:28:12.138151 | 2021-05-18T22:06:13 | 2021-05-18T22:06:13 | 368,600,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,691 | java | package com.launchacademy.petadoption.seeders;
import com.launchacademy.petadoption.models.Pet;
import com.launchacademy.petadoption.models.PetType;
import com.launchacademy.petadoption.repositories.PetRepository;
import com.launchacademy.petadoption.repositories.PetTypeRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@Component
public class PetSeeder implements CommandLineRunner {
private PetRepository petRepository;
private PetTypeRepository petTypeRepository;
@Autowired
public PetSeeder(PetRepository petRepository, PetTypeRepository petTypeRepository) {
this.petRepository = petRepository;
this.petTypeRepository = petTypeRepository;
}
@Override
public void run(String... args) throws Exception {
List<PetType> petTypes = petTypeRepository.findAll();
List<Pet> pets = (List<Pet>) petRepository.findAll();
PetType cat = new PetType();
PetType dog = new PetType();
if (petTypes.size() == 0) {
cat.setType("Cat");
cat.setImgUrl(
"https://cdn.britannica.com/22/206222-131-E921E1FB/Domestic-feline-tabby-cat.jpg");
cat.setDescription("Adorable, furry tyrants");
petTypeRepository.save(cat);
dog.setType("Dog");
dog.setImgUrl("https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/golden-retriever-royalty-free-image-506756303-1560962726.jpg?crop=0.672xw:1.00xh;0.166xw,0&resize=640:*");
dog.setDescription("Your new slobbery best friend");
petTypeRepository.save(dog);
}
if (pets.size() == 0 ) {
PetType mogwai = new PetType();
mogwai.setType("Mogwai");
mogwai.setImgUrl(
"https://www.thesun.co.uk/wp-content/uploads/2020/01/2015Gremlins_GettyImages-163067748261115-920x610-696x442-1.jpg");
mogwai.setDescription("Don't feed after midnight.");
petTypeRepository.save(mogwai);
Pet pet1 = new Pet();
pet1.setName("Ron Purrlman");
pet1.setImgUrl(
"https://static.wixstatic.com/media/035bec_f0e960d1567648d989fd490f79fd46d7~mv2.jpg/v1/fill/w_640,h_806,al_c,q_85,usm_0.66_1.00_0.01/035bec_f0e960d1567648d989fd490f79fd46d7~mv2.webp");
pet1.setAge(5);
pet1.setVaccinationStatus(true);
pet1.setAdoptionStory(
"Mr Purrlman wishes to retire from the limelight of Hollywood and settle down somewhere on the ocean with a nice family that will give him lots of chin scritches.");
pet1.setAdoptionAvailable(true);
pet1.setPetType(cat);
petRepository.save(pet1);
Pet pet2 = new Pet();
pet2.setName("Daisy");
pet2.setImgUrl(
"https://myanimals.com/wp-content/uploads/2018/06/old-dogs-sleep-a-lot-461x307.jpg");
pet2.setAge(9);
pet2.setVaccinationStatus(true);
pet2.setAdoptionStory(
"Daisy just wants to live somewhere warm and be driven around so she can stick her head out of the window.");
pet2.setAdoptionAvailable(true);
pet2.setPetType(dog);
petRepository.save(pet2);
Pet pet3 = new Pet();
pet3.setName("Gizmo");
pet3.setImgUrl(
"https://www.thesun.co.uk/wp-content/uploads/2020/01/2015Gremlins_GettyImages-163067748261115-920x610-696x442-1.jpg");
pet3.setAge(1);
pet3.setVaccinationStatus(false);
pet3.setAdoptionStory(
"Gizmo comes from a mysterious far away land and is looking for someone to cuddle and talk to him");
pet3.setAdoptionAvailable(true);
pet3.setPetType(mogwai);
petRepository.save(pet3);
}
}
}
| [
"73440342+mpnauss@users.noreply.github.com"
] | 73440342+mpnauss@users.noreply.github.com |
0af6283a76ac444fbcd4a5b07eb2f9bef8b20c0e | dda9f9f540d198bf8f112259a235bb70b8246315 | /src/main/java/com/challenge/currency/service/CurrencyService.java | 742260212ed678378eadbf7832d4d14d31f583f2 | [] | no_license | ernestoagc/currency-api | 1f063599f0a29acac355be19151a104315b5d7a8 | 36ea5d7ecdfb18d58e1124ba9de6b412da14e5ad | refs/heads/main | 2023-05-15T01:07:32.798102 | 2021-06-04T06:45:44 | 2021-06-04T06:45:44 | 373,731,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | package com.challenge.currency.service;
import com.challenge.currency.dto.CurrencyDto;
import com.challenge.currency.dto.CurrencyExchangeDto;
import com.challenge.currency.dto.OperationDto;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
public interface CurrencyService {
Mono<OperationDto> exchangeRate(CurrencyExchangeDto currencyExchangeDto) ;
Flux<CurrencyDto> getCurrencies();
Flux<OperationDto> getOperations();
}
| [
"ernestoagc87@gmail.com"
] | ernestoagc87@gmail.com |
d31805c60c48ff8d9d3d0b9bfeb94e0b5f2c73d1 | b0ca95659ae38b993e06bb1676180bfa485afd4f | /src/main/java/facade/DVDPlayer.java | 44e857a856a3e0c5a05e034f1b8594972ac937e2 | [] | no_license | cs2901-2020-2/lab9-design-pattern-facade-team-zero | 7bacce47a20fe51759f58631279c160a2359de6d | 3e0970b3c9a6b911c0c66eee890aedb0e6007474 | refs/heads/main | 2022-12-27T09:11:30.478064 | 2020-10-13T17:09:06 | 2020-10-13T17:09:06 | 303,743,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 634 | java | package facade;
import java.util.logging.Logger;
public class DVDPlayer extends Player {
static final Logger logger = Logger.getLogger(DVDPlayer.class.getName());
public DVDPlayer(){
turned = false;
stop = false;
ejec = false;
}
public void On(){
logger.info("turned on");
this.turned = true;
}
public void Off(){
logger.info("turned off");
this.turned = false;
}
public void stop(){
logger.info("stopped");
this.stop = true;
}
public void ejec(){
logger.info("ejected");
this.ejec = false;
}
} | [
"root@DESKTOP-OO1V4NK.localdomain"
] | root@DESKTOP-OO1V4NK.localdomain |
abe3e1eddca8d840040b5f4e0397010eb20fe80b | 341827ddb6a4678b875c0a1b39772e3ece211acd | /spring-annotation/src/main/java/com/ch1/config/MainConfig.java | 3b69556a0978d384948482a097b812bea847cfd1 | [] | no_license | liyedan18/practice | a1bab3ed5203013ba894aed47f76f4a2fb8331c0 | 20e9e77922388e749fbd99ab3a4bbe3add3296cb | refs/heads/master | 2022-07-13T01:31:18.328578 | 2022-01-22T10:17:15 | 2022-01-22T10:17:15 | 134,970,262 | 0 | 0 | null | 2022-06-21T04:09:57 | 2018-05-26T14:53:58 | Java | UTF-8 | Java | false | false | 445 | java | package com.ch1.config;
import com.ch1.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//配置类 == 配置文件
@Configuration
public class MainConfig {
/**
* 1.方法名即是bean的id
* 2.也可以指定beanId @Bean(Value="")
*/
// @Bean("abcPerson")
@Bean
public Person person1(){
return new Person("tom", 20);
}
}
| [
"544814490@qq.com"
] | 544814490@qq.com |
e78e60644d90e50e6e627c71b7784a1330971756 | 41535ad8a753a3c5e4088e8229db1d126c112c95 | /mcoq/src/main/java/edu/utexas/ece/mcoq8_10/mutation/Mutations.java | f7d52675ef1fb2e1d5336dff2d1f810fc87700f2 | [
"Apache-2.0"
] | permissive | EngineeringSoftware/mcoq | 771d4f519243c1c398f5673599c63b95389447bd | fbeb89402931f477eed41c855c4f2b010b2cd82e | refs/heads/master | 2020-12-13T08:43:26.728476 | 2020-05-21T18:38:51 | 2020-05-21T18:38:51 | 234,365,176 | 29 | 2 | Apache-2.0 | 2020-10-13T18:54:06 | 2020-01-16T16:42:42 | Java | UTF-8 | Java | false | false | 2,865 | java | package edu.utexas.ece.mcoq8_10.mutation;
/**
* Constants assigned to mutation operators.
*
* @author Ahmet Celik <ahmetcelik@utexas.edu>
* @author Marinela Parovic <marinelaparovic@gmail.com>
*/
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public enum Mutations {
REVERSE_INDUCTIVE_CASES,
REVERSE_MATCH_CASES,
REPLACE_LIST_WITH_TAIL,
REPLACE_LIST_WITH_EMPTY_LIST,
REPLACE_LIST_WITH_HEAD,
REORDER_CONCAT_LISTS,
LEFT_EMPTY_CONCAT_LISTS,
RIGHT_EMPTY_CONCAT_LISTS,
REPLACE_MATCH_EXPRESSION,
REPLACE_FUNCTION_WITH_IDENTITY,
REPLACE_PLUS_WITH_MINUS,
REPLACE_ZERO_WITH_ONE,
REORDER_IF_BRANCHES,
REPLACE_SUCCESSOR_WITH_ZERO,
REMOVE_SUCCESSOR_APPLICATION,
REPLACE_FALSE_WITH_TRUE,
REPLACE_TRUE_WITH_FALSE;
//REPLACE_AND_WITH_OR,
public static Mutation toMutation(Mutations mutation) {
switch (mutation) {
case REVERSE_INDUCTIVE_CASES:
return new ReverseInductiveCases();
case REVERSE_MATCH_CASES:
return new ReverseMatchCases();
case REPLACE_LIST_WITH_TAIL:
return new ReplaceListWithTail();
case REPLACE_LIST_WITH_EMPTY_LIST:
return new ReplaceListWithEmptyList();
case REPLACE_LIST_WITH_HEAD:
return new ReplaceListWithHead();
case REORDER_CONCAT_LISTS:
return new ReorderConcat();
case LEFT_EMPTY_CONCAT_LISTS:
return new LeftEmptyConcat();
case RIGHT_EMPTY_CONCAT_LISTS:
return new RightEmptyConcat();
case REPLACE_MATCH_EXPRESSION:
return new ReplaceMatchExpression();
case REPLACE_FUNCTION_WITH_IDENTITY:
return new ReplaceFunctionWithIdentity();
case REPLACE_PLUS_WITH_MINUS:
return new ReplacePlusWithMinus();
case REPLACE_ZERO_WITH_ONE:
return new ReplaceZeroWithOne();
case REORDER_IF_BRANCHES:
return new ReorderIfBranches();
case REPLACE_SUCCESSOR_WITH_ZERO:
return new ReplaceSuccessorWithZero();
case REMOVE_SUCCESSOR_APPLICATION:
return new RemoveSuccessorApplication();
case REPLACE_FALSE_WITH_TRUE:
return new ReplaceFalseWithTrue();
case REPLACE_TRUE_WITH_FALSE:
return new ReplaceTrueWithFalse();
//case REPLACE_AND_WITH_OR:
//return new ReplaceAndWithOr();
default:
throw new RuntimeException("Unknown mutation!");
}
}
public static final Set<Mutations> BLACKLISTED_MUTATIONS = new HashSet<>(Arrays.asList(Mutations.REVERSE_MATCH_CASES, Mutations.REPLACE_FUNCTION_WITH_IDENTITY));
}
| [
"kjain14@jainfamily.com"
] | kjain14@jainfamily.com |
3d99200160b0bae7b6a96b2971b05c27ab7ae194 | 5490247baf46e7f6ee88680f68f1a766f9188272 | /bangduoduo/src/main/java/com/bangduoduo/web/form/component/Select.java | a45623f6686fa3992ce26d65df291310cbf87c9c | [] | no_license | 53938871/bangduoduo | c9e5dd89dfbf3545eafecb3a728acee1199cb170 | 597ecdde26962bb43541f62068699467e78417ce | refs/heads/master | 2021-01-13T02:22:38.762478 | 2018-08-26T14:16:35 | 2018-08-26T14:16:35 | 10,026,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | package com.bangduoduo.web.form.component;
import com.bangduoduo.web.form.DataSource;
import com.bangduoduo.web.form.Field;
public class Select extends Component {
public Select(DataSource dataSource,Field field){
super(dataSource,field);
}
}
| [
"53938871@qq.com"
] | 53938871@qq.com |
9aabcf3b54dc74c929087164ce35536553325747 | 404883ec42a6aeafc6cd0459137d85d18540d856 | /src/main/java/sample/model/view/MessageView.java | a17c0a091dd0bb4972666ad9b08d470f1889e331 | [] | no_license | maciejkoprek/chat_rsa | fccd971d8734e459e36fd1cc3e96f1ab912f5a9c | dbc58063a73a5a19a0d00d8357da024819516081 | refs/heads/master | 2021-01-11T20:37:14.457402 | 2017-01-21T17:30:32 | 2017-01-21T17:30:32 | 79,154,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 605 | java | package sample.model.view;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalTime;
/**
* Created by maciek on 09.01.17.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MessageView {
private String username;
private String message;
private LocalTime createdAt;
private Boolean error = false;
public MessageView(String username, String message, LocalTime createdAt){
this.username = username;
this.message = message;
this.createdAt = createdAt;
}
}
| [
"maciek.koprek@hotmail.com"
] | maciek.koprek@hotmail.com |
562ba654d23f1cbfeddae5f272b66c35f6bcd54d | f3539169751d531c845bb1ad1e8013e429ccc142 | /src/konto/JugendGiroKonto.java | 79adfd5c6def84d9b7db666171597c04ba13bfe1 | [] | no_license | danielpausackerl/10terLVTermin | b2854027165a6844d1172a0df7dcf6a40ae7702c | c5be6332ac387f38c190f6569e14777a1c28c42e | refs/heads/master | 2016-08-11T13:48:24.694469 | 2016-02-09T19:51:46 | 2016-02-09T19:51:46 | 49,772,220 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 424 | java | package konto;
public class JugendGiroKonto extends GiroKonto {
protected double buchungsLimit;
public JugendGiroKonto(String inhaber, double limit, double buchungsLimit) {
super(inhaber, limit);
this.buchungsLimit = buchungsLimit;
}
@Override
public void auszahlen(double wert) {
if(wert>buchungsLimit){
System.out.println("Buchngslimit überschritten!");
}
else{
super.auszahlen(wert);
}
}
}
| [
"daniel.pausackerl@edu.campus02.at"
] | daniel.pausackerl@edu.campus02.at |
5ac0cd0c5d1c72c24291e3e000ed91fbd5348c1f | 329ba790483278e561be7d090bad8710774a8f8a | /src/test/java/com/atfarm/challenge/config/WebConfigurerTestController.java | cec373a6854d705e11763cd5b0475219e0b67d97 | [] | no_license | BulkSecurityGeneratorProject/Atfarm- | 802e31fd487cbfb618337dac08a6c2af3cb97453 | c269b3c8849fb3fada754abaaef1e0e42fc30f9f | refs/heads/master | 2022-12-23T21:55:40.764197 | 2019-07-12T18:22:21 | 2019-07-12T18:22:21 | 296,564,963 | 0 | 0 | null | 2020-09-18T08:43:57 | 2020-09-18T08:43:56 | null | UTF-8 | Java | false | false | 383 | java | package com.atfarm.challenge.config;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class WebConfigurerTestController {
@GetMapping("/api/test-cors")
public void testCorsOnApiPath() {
}
@GetMapping("/test/test-cors")
public void testCorsOnOtherPath() {
}
}
| [
"imo@crossworkers.com"
] | imo@crossworkers.com |
6f4d5318aee6b343a7b25f3cf46c1c476f8ce61d | d0cc44c701d1a8cf64ba9792a052a506cecdb77a | /shoppingbackend/src/main/java/net/kzn/shoppingbackend/daoImpl/CategoryDAOImpl.java | a9e1f1409a7aa120f4825a9bcc1475cad485e736 | [] | no_license | MosALs/online-shopping | c3e1ef26f09788863ab40aae883eb1f760e1219c | 37ef2039fbfc949bf6f406e650cf6cf8e98c76b2 | refs/heads/master | 2020-03-08T06:30:09.514918 | 2018-10-18T23:22:27 | 2018-10-18T23:22:27 | 118,621,926 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,649 | java | package net.kzn.shoppingbackend.daoImpl;
import java.util.List;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import net.kzn.shoppingbackend.dao.CategoryDAO;
import net.kzn.shoppingbackend.dto.Category;
@Repository("categoryDAO")
@Transactional
public class CategoryDAOImpl implements CategoryDAO {
@Autowired(required = true)
private SessionFactory sessionFactory;
// public static List<Category> categories = new ArrayList<>() ;
//
// static {
//
// Category category = new Category() ;
//
// category.setId(1);
// category.setName("Television");
// category.setDescription("TV IS GOOD");
//
// categories.add(category);
//
// category = new Category() ;
//
// category.setId(2);
// category.setName("Mobile");
// category.setDescription("MOBILE IS GOOD");
//
// categories.add(category);
//
//
// category = new Category() ;
//
// category.setId(3);
// category.setName("Labtop");
// category.setDescription("LAPTOP IS GOOD");
//
// categories.add(category);
// }
@Override
public List<Category> list() {
String selectActiveCategory = "FROM Category WHERE active = :active";
Query query = sessionFactory.getCurrentSession().createQuery(selectActiveCategory);
query.setParameter("active", true);
return query.getResultList();
}
/*
* Getting single category based on id
*/
@Override
public Category get(int id) {
return sessionFactory.getCurrentSession().get(Category.class, id) ;
}
@Override
public boolean add(Category category) {
try {
// add the category to the database table
sessionFactory.getCurrentSession().persist(category);
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
}
/*
* Updating a single category
*/
@Override
public boolean update(Category category) {
try {
// add the category to the database table
sessionFactory.getCurrentSession().update(category);
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
}
@Override
public boolean delete(Category category) {
category.setActive(false);
try {
// add the category to the database table
sessionFactory.getCurrentSession().update(category);
return true;
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
}
}
| [
"mostaffa4444.ma@gmail.com"
] | mostaffa4444.ma@gmail.com |
d06a898f6768403bfe6463b2b6ffbcfe916b2bef | 1b0c53152afa7c876e61a60dd75f868c38f15262 | /src/com/km/controller/UserController.java | ef796ea18b444dcc46f20adfa6921d62051b0b37 | [] | no_license | Kailas1/LoginApp | 5e8f2f19efd6fbe165b6c87e66934c181c670b92 | 724f975ac13da12451c14dd3c434743f44d935be | refs/heads/master | 2021-06-28T07:42:12.319661 | 2017-09-17T10:47:03 | 2017-09-17T10:47:03 | 103,821,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,827 | java | package com.km.controller;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.km.dao.USerDao;
import com.km.model.User;
public class UserController extends HttpServlet {
private static final long serialVersionUID = 1L;
private static String INSERT_OR_EDIT = "user.jsp";
private static String LIST_USER = "listuser.jsp";
private USerDao dao;
public UserController() {
super();
dao = new USerDao();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String forward="";
String action = request.getParameter("action");
if (action.equalsIgnoreCase("delete")){
String userId = request.getParameter("userId");
dao.deleteUser(userId);
forward = LIST_USER;
request.setAttribute("users", dao.getAllUsers());
} else if (action.equalsIgnoreCase("edit")){
forward = INSERT_OR_EDIT;
String userId = request.getParameter("userId");
User user = dao.getUserById(userId);
request.setAttribute("user", user);
} else if (action.equalsIgnoreCase("listUser")){
forward = LIST_USER;
request.setAttribute("users", dao.getAllUsers());
} else {
forward = INSERT_OR_EDIT;
}
RequestDispatcher view = request.getRequestDispatcher(forward);
view.forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
User user = new User();
user.setUname(request.getParameter("uname"));
user.setPassword(request.getParameter("pass"));
try {
Date reg = new SimpleDateFormat("yyyy/MM/dd").parse(request.getParameter("dob"));
System.out.println("rrrrrrrrrrr"+ reg);
user.setRegisteredon(reg);
} catch (ParseException e) {
e.printStackTrace();
}
user.setEmail(request.getParameter("email"));
String userid = request.getParameter("uname");
// if(userid == null || userid.isEmpty())
// {
// dao.addUser(user);
// }
// else
// {
user.setUname(userid);
dao.checkUser(user);
// }
RequestDispatcher view = request.getRequestDispatcher(LIST_USER);
request.setAttribute("users", dao.getAllUsers());
view.forward(request, response);
}
}
| [
"32017067+Kailas1@users.noreply.github.com"
] | 32017067+Kailas1@users.noreply.github.com |
b60b6ce7e36f8b44a0f6a146eb279b88fd8e1dad | 64ef8dc4f67a32325a6a83cbbf17997d451de738 | /common/telnet/src/main/java/com/khubla/telnet/nvt/iac/command/AuthenticationIAICCommandHandlerImpl.java | 36a40904b5915a4c7807ce47296693ce8e47c8bd | [] | no_license | jadrovski/ddd_practice | 1e77583a963cdcb71351090523e3b166891b3efd | 6b947f2509f5924ca7afcee33661b5c88ab08f30 | refs/heads/main | 2023-07-22T04:00:24.489754 | 2021-09-07T13:33:48 | 2021-09-07T13:33:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,001 | java | /*
* Copyright (C) khubla.com - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Tom Everett <tom@khubla.com>, 2018
*/
package com.khubla.telnet.nvt.iac.command;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.khubla.telnet.nvt.IACCommandHandler;
import com.khubla.telnet.nvt.NVT;
import com.khubla.telnet.nvt.iac.IACHandler;
public class AuthenticationIAICCommandHandlerImpl extends AbstractIACCommandHandler {
/**
* logger
*/
private static final Logger logger = LoggerFactory.getLogger(AuthenticationIAICCommandHandlerImpl.class);
/**
* constants...
*/
public static final int IS = 0;
public static final int SEND = 1;
public static final int REPLY = 2;
public static final int NAME = 3;
/**
* auth types
*/
public static final int AUTHTYPE_NULL = 0;
public static final int AUTHTYPE_KERBEROS_V4 = 1;
public static final int AUTHTYPE_KERBEROS_V5 = 2;
public static final int AUTHTYPE_SPX = 3;
public static final int AUTHTYPE_RSA = 6;
public static final int AUTHTYPE_LOKI = 10;
/**
* auth modifiers
*/
public static final int MODIFIER_AUTH_WHO_MASK = 1;
public static final int MODIFIER_AUTH_CLIENT_TO_SERVER = 0;
public static final int MODIFIER_AUTH_SERVER_TO_CLIENT = 1;
public static final int MODIFIER_AUTH_HOW_MASK = 2;
public static final int MODIFIER_AUTH_HOW_ONE_WAY = 0;
public static final int MODIFIER_AUTH_HOW_MUTUAL = 2;
@Override
public void process(NVT nvt, int cmd) throws IOException {
switch (cmd) {
case IACCommandHandler.IAC_COMMAND_DO:
logger.info("Received IAC DO auth");
nvt.sendIACCommand(IACCommandHandler.IAC_COMMAND_WONT, IACHandler.IAC_CODE_AUTHENTICATION);
break;
case IACCommandHandler.IAC_COMMAND_DONT:
logger.info("Received IAC DONT auth");
break;
case IACCommandHandler.IAC_COMMAND_WILL:
logger.info("Received IAC WILL auth");
// request auth
nvt.writeBytes(IACCommandHandler.IAC_IAC, IACCommandHandler.IAC_COMMAND_SB, IACHandler.IAC_CODE_AUTHENTICATION, AUTHTYPE_KERBEROS_V4 | MODIFIER_AUTH_CLIENT_TO_SERVER,
IACCommandHandler.IAC_IAC, IACCommandHandler.IAC_COMMAND_SE);
break;
case IACCommandHandler.IAC_COMMAND_WONT:
logger.info("Received IAC WONT auth");
break;
case IACCommandHandler.IAC_COMMAND_SB:
logger.info("Received IAC SB auth");
final byte[] sn = readSubnegotiation(nvt);
if (sn[0] == NAME) {
readString(sn, 1, sn.length);
} else if (sn[0] == SEND) {
// send the termspeed
}
break;
default:
logger.info("Received Unknown IAC Command:" + cmd);
break;
}
}
}
| [
"eugene.lukianov@gmail.com"
] | eugene.lukianov@gmail.com |
9c9c05a9030123b287fbb98f837de195cf68aac9 | c3352bbcf0075bcebb9343e2228c84a371a2076e | /grpc-server/src/main/java/cn/elmi/grpc/server/props/GrpcServerProp.java | f45fa2a29754191fe99e55b55ed77bfa02fd27c8 | [
"Apache-2.0"
] | permissive | efsn/microservice-framework | 121b90dce5d9c4f5d643d804e1cdc947909213f2 | 6b2499603fbd9d9f45184963025008884aa2817e | refs/heads/master | 2020-03-07T18:10:54.887966 | 2019-12-16T12:38:00 | 2019-12-16T12:38:00 | 127,630,337 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,907 | java | /**
* Copyright (c) 2018 Arthur Chan (codeyn@163.com).
* <p>
* 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:
* <p>
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* <p>
* 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 cn.elmi.grpc.server.props;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author Arthur
* @since 1.0
*/
@Data
@ConfigurationProperties("grpc.server")
public class GrpcServerProp {
/* 是否注册到 etcd */
private boolean registEtcd;
private String name;
private int port;
private List<String> interceptors = new ArrayList<>();
private int minWorker = Runtime.getRuntime().availableProcessors();
private int maxWorker = Runtime.getRuntime().availableProcessors();
private int workerQueueCapacity = 0x400;
private Set<String> servicesNames = new HashSet<>();
}
| [
"codeyn@163.com"
] | codeyn@163.com |
4986e048292c10d1e542fab562cc651475a57ccf | f538b56104c45e04f70ef3473a971d4a67e1b089 | /java/netxms-eclipse/Dashboard/src/org/netxms/ui/eclipse/dashboard/propertypages/Gauge.java | 3ff4a276f7bd890d7e7be58be80da1dfd526bffb | [] | no_license | phongtran0715/SpiderClient | 85d5d0559c6af0393cd058c25584074d80f8df9a | fdc264a85b7ff52c5dc2b6bb3cc83da62aad2aff | refs/heads/master | 2020-03-20T20:07:12.075655 | 2018-08-10T08:37:10 | 2018-08-10T08:37:10 | 137,671,006 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 9,180 | java | /**
* NetXMS - open source network management system
* Copyright (C) 2003-2013 Victor Kirhenshtein
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.netxms.ui.eclipse.dashboard.propertypages;
import org.eclipse.jface.preference.ColorSelector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.dialogs.PropertyPage;
import org.netxms.ui.eclipse.charts.api.GaugeColorMode;
import org.netxms.ui.eclipse.dashboard.Messages;
import org.netxms.ui.eclipse.dashboard.widgets.internal.GaugeConfig;
import org.netxms.ui.eclipse.tools.ColorConverter;
import org.netxms.ui.eclipse.tools.MessageDialogHelper;
import org.netxms.ui.eclipse.tools.WidgetHelper;
import org.netxms.ui.eclipse.widgets.LabeledText;
/**
* Gauge properties
*/
public class Gauge extends PropertyPage {
private GaugeConfig config;
private Combo gaugeType;
private LabeledText fontName;
private Button checkLegendInside;
private Button checkVertical;
private Button checkElementBorders;
private LabeledText minValue;
private LabeledText maxValue;
private LabeledText leftYellowZone;
private LabeledText leftRedZone;
private LabeledText rightYellowZone;
private LabeledText rightRedZone;
private Combo colorMode;
private ColorSelector customColor;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
* .swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
config = (GaugeConfig) getElement().getAdapter(GaugeConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.makeColumnsEqualWidth = true;
dialogArea.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
gaugeType = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY,
Messages.get().Gauge_Type, gd);
gaugeType.add(Messages.get().Gauge_Dial);
gaugeType.add(Messages.get().Gauge_Bar);
gaugeType.add(Messages.get().Gauge_Text);
gaugeType.select(config.getGaugeType());
fontName = new LabeledText(dialogArea, SWT.NONE);
fontName.setLabel(Messages.get().Gauge_FontName);
fontName.setText(config.getFontName());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
fontName.setLayoutData(gd);
minValue = new LabeledText(dialogArea, SWT.NONE);
minValue.setLabel(Messages.get().DialChart_MinVal);
minValue.setText(Double.toString(config.getMinValue()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
minValue.setLayoutData(gd);
maxValue = new LabeledText(dialogArea, SWT.NONE);
maxValue.setLabel(Messages.get().DialChart_MaxVal);
maxValue.setText(Double.toString(config.getMaxValue()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
maxValue.setLayoutData(gd);
leftRedZone = new LabeledText(dialogArea, SWT.NONE);
leftRedZone.setLabel(Messages.get().DialChart_LeftRed);
leftRedZone.setText(Double.toString(config.getLeftRedZone()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
leftRedZone.setLayoutData(gd);
leftYellowZone = new LabeledText(dialogArea, SWT.NONE);
leftYellowZone.setLabel(Messages.get().DialChart_LeftYellow);
leftYellowZone.setText(Double.toString(config.getLeftYellowZone()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
leftYellowZone.setLayoutData(gd);
rightYellowZone = new LabeledText(dialogArea, SWT.NONE);
rightYellowZone.setLabel(Messages.get().DialChart_RightYellow);
rightYellowZone.setText(Double.toString(config.getRightYellowZone()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
rightYellowZone.setLayoutData(gd);
rightRedZone = new LabeledText(dialogArea, SWT.NONE);
rightRedZone.setLabel(Messages.get().DialChart_RightRed);
rightRedZone.setText(Double.toString(config.getRightRedZone()));
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
rightRedZone.setLayoutData(gd);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
colorMode = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY,
Messages.get().Gauge_ColorMode, gd);
colorMode.add(Messages.get().Gauge_ZoneColor);
colorMode.add(Messages.get().Gauge_FixedCustomColor);
colorMode.add(Messages.get().Gauge_ActiveThresholdColor);
colorMode.select(config.getColorMode());
colorMode.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
onColorModeChange(colorMode.getSelectionIndex());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
gd = new GridData();
gd.horizontalAlignment = SWT.LEFT;
customColor = WidgetHelper.createLabeledColorSelector(dialogArea,
Messages.get().Gauge_CustomColor, gd);
customColor.setColorValue(ColorConverter.rgbFromInt(config
.getCustomColor()));
checkLegendInside = new Button(dialogArea, SWT.CHECK);
checkLegendInside.setText(Messages.get().DialChart_LegendInside);
checkLegendInside.setSelection(config.isLegendInside());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
checkLegendInside.setLayoutData(gd);
checkVertical = new Button(dialogArea, SWT.CHECK);
checkVertical.setText(Messages.get().Gauge_Vertical);
checkVertical.setSelection(config.isVertical());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
checkVertical.setLayoutData(gd);
checkElementBorders = new Button(dialogArea, SWT.CHECK);
checkElementBorders.setText(Messages.get().Gauge_ShowBorder);
checkElementBorders.setSelection(config.isElementBordersVisible());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
checkElementBorders.setLayoutData(gd);
onColorModeChange(config.getColorMode());
return dialogArea;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
@Override
public boolean performOk() {
double min, max, ly, lr, ry, rr;
try {
min = Double.parseDouble(minValue.getText().trim());
max = Double.parseDouble(maxValue.getText().trim());
ly = Double.parseDouble(leftYellowZone.getText().trim());
lr = Double.parseDouble(leftRedZone.getText().trim());
ry = Double.parseDouble(rightYellowZone.getText().trim());
rr = Double.parseDouble(rightRedZone.getText().trim());
} catch (NumberFormatException e) {
MessageDialogHelper.openWarning(getShell(),
Messages.get().DialChart_Warning,
Messages.get().DialChart_WarningText);
return false;
}
config.setGaugeType(gaugeType.getSelectionIndex());
config.setFontName(fontName.getText().trim());
config.setMinValue(min);
config.setMaxValue(max);
config.setLeftYellowZone(ly);
config.setLeftRedZone(lr);
config.setRightYellowZone(ry);
config.setRightRedZone(rr);
config.setLegendInside(checkLegendInside.getSelection());
config.setVertical(checkVertical.getSelection());
config.setElementBordersVisible(checkElementBorders.getSelection());
config.setColorMode(colorMode.getSelectionIndex());
config.setCustomColor(ColorConverter.rgbToInt(customColor
.getColorValue()));
return true;
}
/**
* Handle color mode change
*
* @param newMode
*/
private void onColorModeChange(int newMode) {
leftYellowZone.setEnabled(newMode == GaugeColorMode.ZONE.getValue());
leftRedZone.setEnabled(newMode == GaugeColorMode.ZONE.getValue());
rightYellowZone.setEnabled(newMode == GaugeColorMode.ZONE.getValue());
rightRedZone.setEnabled(newMode == GaugeColorMode.ZONE.getValue());
customColor.setEnabled(newMode == GaugeColorMode.CUSTOM.getValue());
}
}
| [
"phongtran0715@gmail.com"
] | phongtran0715@gmail.com |
71ae7c6f7ec06e31f74816ec86b66bc5fc6aebc8 | d8e757e741e263f3e22a7f0745013a256e5acde3 | /WorldSky01302/src/com/wljsms/webservice/PostSmsData.java | e075816ccc568d1c28901d6d09ae6928c651a355 | [] | no_license | fenghao1024/groupphonecall | 67baaaa9f162485d47e8fe1a864ff9dda1d89e86 | 5a9a63d35c1fb82272510eec3788d1ee7e944042 | refs/heads/master | 2021-01-15T10:50:55.618163 | 2014-02-18T09:10:11 | 2014-02-18T09:10:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,435 | java | /**
* Name : PostSmsData.java
* Version : 0.0.1
* Copyright : Copyright (c) wanglaoji Inc. All rights reserved.
* Description :
*/
package com.wljsms.webservice;
import java.util.HashMap;
import java.util.Map;
import com.wljsms.config.ICallBack;
import com.wljsms.config.SoapHelper;
/**
* com.eteng.world.webservice.PostSmsData
*
* @author wanglaoji <br/>
* Create at 2013-2-3 上午10:58:09 Description :
* 提交短信统计数据,包括:ISMI号、手机号码、发送时间、发送短信内容长度、接收人清单、机型 Modified :
*/
public class PostSmsData {
private static final String METHOD = "SmsSendSource";
public String init(String imsi,String groupId,String receiverPhones,String model,String version,int smsLength, String sendDate,String appCome ,ICallBack callBack) {
SoapHelper soapHelper = new SoapHelper(METHOD);
Map<String, Object> m = new HashMap<String, Object>();
m.put("imsi", imsi);
m.put("phones", receiverPhones);
m.put("groupid", groupId);
m.put("mobileModel", model);
m.put("version", version);
m.put("smslength", smsLength);
m.put("sendDate", sendDate);
m.put("appCome", appCome);
Object result = soapHelper.init(callBack, m);
if (callBack != null) {
if (result != null) {
callBack.netSuccess();
} else {
callBack.netFailed();
}
}
if (result != null) {
return result.toString();
}
return null;
}
}
| [
"fenghao1024@qq.com"
] | fenghao1024@qq.com |
9aa1b7d45547303248094a80404ec8357e2862bf | cb0bcd47565b91f9198bb72f252a0c657bfeb919 | /May-2016/5_28/CodeDemo03.java | 73ea3458a4a022c0cf3a58b94810d6556474f9b3 | [] | no_license | fanbrightup/java_training | 346bbe4e45dcb8089df0a14b25c5c6125262370f | 43aa81d66cdd647e49d7759ae8422ecbe56b3fa8 | refs/heads/master | 2016-09-12T23:28:59.796721 | 2016-06-04T13:56:40 | 2016-06-04T13:56:40 | 59,219,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | class Demo{
{
System.out.println("hello world");
}
static {
System.out.println("你好");
}
private Demo(){
System.out.println("2,构造方法");
}
}
public class CodeDemo03{
static{
System.out.println("在主方法所定义的代码块");
}
public CodeDemo03(){
System.out.println("---在主类中的构造");
}
public static void main(String[] args) {
new Demo();
new Demo();
new Demo();
new CodeDemo03();
}
}
| [
"fanbright@126.com"
] | fanbright@126.com |
3f503082d7b69f4f65359b46ffd4063d4c68163e | db528d657d05c533d4d6f08924c4ddf7576e8a23 | /src/jasbro/game/items/usableItemEffects/UsableItemAddGold.java | 5abcdd4029f9980cd597826005aea081f7c648fd | [] | no_license | Crystal-Line/JaSBro | deae8050f7ce10e1244b8a42b2e4fe409bb4aeae | cec1029fbbd8b34008b2923e9236a74033802447 | refs/heads/master | 2020-05-28T01:59:56.660514 | 2019-06-02T17:02:16 | 2019-06-02T17:02:16 | 188,848,810 | 0 | 2 | null | 2019-06-02T17:02:17 | 2019-05-27T13:29:54 | Java | UTF-8 | Java | false | false | 796 | java | package jasbro.game.items.usableItemEffects;
import jasbro.Jasbro;
import jasbro.game.character.Charakter;
import jasbro.game.items.Item;
public class UsableItemAddGold extends UsableItemEffect {
public int amount;
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
@Override
public void apply(Charakter character, Item item) {
if (amount > 0) {
Jasbro.getInstance().getData().earnMoney(amount, item.getName());
}
else if (amount < 0) {
Jasbro.getInstance().getData().spendMoney(-amount, item.getName());
}
}
@Override
public String getName() {
return "Add gold effect";
}
@Override
public UsableItemEffectType getType() {
return UsableItemEffectType.ADDGOLD;
}
}
| [
"jackwrenn@comcast.net"
] | jackwrenn@comcast.net |
dc08189482bef7653e468879027c828059732c93 | 724208ab40fd1aeffceaaeeda0394d5139c83fd4 | /rocker-compiler/src/main/java/com/fizzed/rocker/model/WithBlockBegin.java | fe7e9ea7df7f9819f835d6679e4118f91eb5a345 | [
"Apache-2.0"
] | permissive | fizzed/rocker | ba41309bda7b77280291296a2a244d27fac75035 | d749fbf68179b31a64d541f5e18e0e25bc5c2d1b | refs/heads/master | 2023-08-23T13:58:38.354905 | 2023-01-10T04:28:40 | 2023-01-10T04:28:40 | 32,427,215 | 740 | 111 | null | 2023-07-24T17:24:08 | 2015-03-17T23:52:08 | Java | UTF-8 | Java | false | false | 983 | java | /*
* Copyright 2015 Fizzed Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fizzed.rocker.model;
public class WithBlockBegin extends BlockBegin {
private final WithStatement statement;
public WithBlockBegin(SourceRef sourceRef, String expression, WithStatement statement) {
super(sourceRef, expression);
this.statement = statement;
}
public WithStatement getStatement() {
return statement;
}
}
| [
"joe@lauer.bz"
] | joe@lauer.bz |
8db2c84a51e480690b7eb33ac1ba3768c9ce1722 | 9d6213de286b5dfce17ff56612a7cc110c12808e | /docker/src/main/java/com/stellarity/workingTime/controller/DTo/UserDTo.java | 9cfa4bf9e293bdbabec3b16ca78064946898246f | [] | no_license | krymchak/bazy | 8c813dcbe3797891a11b9413f0ab667f00c720fc | ec86dc9582f10da00413e6a8ec081a2a680591c4 | refs/heads/master | 2023-02-12T23:47:24.038233 | 2021-01-11T18:37:11 | 2021-01-11T18:37:11 | 328,757,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,708 | java | package com.stellarity.workingTime.controller.DTo;
import com.stellarity.workingTime.repository.entity.User;
import com.stellarity.workingTime.controller.DTo.validator.FieldsValueMatch;
import javax.validation.constraints.NotBlank;
@FieldsValueMatch(field = "password", fieldMatch = "verifyPassword", message = "Passwords do not match!")
public class UserDTo {
private Long id;
@NotBlank(message = "First name is mandatory")
private String firstName;
@NotBlank(message = "Last name is mandatory")
private String lastName;
private String type;
@NotBlank(message = "Username is mandatory")
private String username;
@NotBlank(message = "Password is mandatory")
private String password;
@NotBlank(message = "Verify password is mandatory")
private String verifyPassword;
private Float salary = 0f;
public String getUsername() {
return username;
}
public UserDTo() {
}
public UserDTo(String firstName, String lastName, String type) {
this.firstName = firstName;
this.lastName = lastName;
this.type = type;
}
public UserDTo(User user) {
id = user.getId();
firstName = user.getFirstName();
lastName = user.getLastName();
type = user.getType().value();
salary = user.getSalary();
}
public Boolean isManager() {
if (type == "manager")
return true;
return false;
}
public String getVerifyPassword() {
return verifyPassword;
}
public void setVerifyPassword(String verifyPassword) {
this.verifyPassword = verifyPassword;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
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 getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Float getSalary() {
return salary;
}
public void setSalary(Float salary) {
this.salary = salary;
}
} | [
"krm.weronika@gmail.com"
] | krm.weronika@gmail.com |
dc670e5ad76328ab898a1a0b642070f0ded667a9 | 129c42837af0eb17d3d2ce41baf08eb504132a26 | /src/main/java/com/sh/java8/functionalinterface/FunctionalInterfaceAnnonation.java | a09a9b19e99526722442dec38f5c1c9806d38ec7 | [] | no_license | idatya/core-java | c65aca0f6d36c7d22c8eac81d83267898c43a3f8 | 4e735918afaa1b063c724a8d3d0b9d0d3a86907a | refs/heads/master | 2021-06-27T10:37:57.218698 | 2020-10-28T07:57:35 | 2020-10-28T07:57:35 | 170,014,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,468 | java | package com.sh.java8.functionalinterface;
//@FunctionalInterface annotation is used to ensure an interface can’t have more than one abstract method. The use of this annotation is optional.
/*
*
* lambda operator -> body
where lambda operator can be:
Zero parameter:
() -> System.out.println("Zero parameter lambda");
One parameter:–
(p) -> System.out.println("One parameter: " + p);
It is not mandatory to use parentheses, if the type of that variable can be inferred from the context
Multiple parameters :
(p1, p2) -> System.out.println("Multiple parameters: " + p1 + ", " + p2);
===========================================================================
interface Foo { boolean equals(Object obj); }
// Not functional because equals is already an implicit member (Object class)
interface Comparator<T> {
boolean equals(Object obj);
int compare(T o1, T o2);
}
// Functional because Comparator has only one abstract non-Object method
===========================================================================
*/
@FunctionalInterface
interface Square {
int calculate(int x);
}
public class FunctionalInterfaceAnnonation {
public static void main(String args[]) {
int a = 5;
// lambda expression to define the calculate method
Square s = (int x) -> x * x;
// parameter passed and return type must be
// same as defined in the prototype
int ans = s.calculate(a);
System.out.println(ans);
}
}
| [
"iadityasingh@gmail.com"
] | iadityasingh@gmail.com |
2c21b336379e9bd23f8bcce9f703256355c12693 | b386ffba2a4c4da5a13293323c61cd7eadd262bb | /app/src/main/java/com/example/lenovo/map/StatusBarCompat.java | 510ab837848672a4fc51f3253f2e1fe21ff4d63e | [] | no_license | cyx404/Map | b772a24954e85748ff61da038ba46a4ceea8ed94 | ddddcdb408f31d91e262385d10affd7e457f1fd2 | refs/heads/master | 2020-08-21T15:14:33.130596 | 2019-10-19T09:32:08 | 2019-10-19T09:32:08 | 216,182,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,001 | java | package com.example.lenovo.map;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
public class StatusBarCompat {
private static final int INVALID_VAL = -1;
private static final int COLOR_DEFAULT = Color.parseColor("#20000000");
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void compat(Activity activity, int statusColor)
{
//当前手机版本为5.0及以上
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
if (statusColor != INVALID_VAL)
{
activity.getWindow().setStatusBarColor(statusColor);
}
return;
}
//当前手机版本为4.4
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
{
int color = COLOR_DEFAULT;
ViewGroup contentView = (ViewGroup) activity.findViewById(android.R.id.content);
if (statusColor != INVALID_VAL)
{
color = statusColor;
}
View statusBarView = new View(activity);
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
getStatusBarHeight(activity));
statusBarView.setBackgroundColor(color);
contentView.addView(statusBarView, lp);
}
}
public static void compat(Activity activity)
{
compat(activity, INVALID_VAL);
}
public static int getStatusBarHeight(Context context)
{
int result = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0)
{
result = context.getResources().getDimensionPixelSize(resourceId);
}
return result;
}
}
| [
"1270434048@qq.com"
] | 1270434048@qq.com |
f8c81a29ef4b5420b837e05a320992a656330df7 | bf93c826d0f20f102544814b06e6858597ec7fdc | /commons/commons-utils/src/test/java/com/shine/commons/utils/IdcardCheckerTest.java | dd5595569f18974af33e30b112d933a4cd7d46e4 | [] | no_license | fuyongde/shine | 286b60190d24ea7b2461e9a458fac434833409ff | 63f2c2549583d6dd36c4a3f5bdbbee295fd073c4 | refs/heads/master | 2020-03-17T23:51:26.646686 | 2018-06-03T11:18:37 | 2018-06-03T11:18:37 | 134,064,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,936 | java | package com.shine.commons.utils;
import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import static org.junit.Assert.*;
/**
* IdcardChecker Tester.
*
* @author fuyongde
* @version 1.0
* @since <pre>11/10/2017</pre>
*/
public class IdcardCheckerTest {
private static final Logger logger = LoggerFactory.getLogger(IdcardCheckerTest.class);
private List<String> idCardList = Lists.newArrayList();
private List<String> notIDCardList = Lists.newArrayList();
@Before
public void before() throws Exception {
idCardList.add("410184199006013372");
idCardList.add("110101199901018960");
idCardList.add("110101199901012083");
idCardList.add("11010119990101832x");
idCardList.add("110101199901015487");
notIDCardList.add("410184199006013371");
notIDCardList.add("110101199901018961");
notIDCardList.add("110101199901012084");
notIDCardList.add("110101199901018321");
notIDCardList.add("110101199901015488");
}
@After
public void after() throws Exception {
}
/**
* Method: isSecondIDCard(String idCard)
*/
@Test
public void testIsSecondIDCard() throws Exception {
logger.info("-----{}-----", "正确的身份证");
for (String idCard : idCardList) {
boolean isIDCard = IdcardChecker.isIdcard(idCard);
logger.info("{} is IDCard : {}", idCard, isIDCard);
assertTrue(isIDCard);
}
logger.info("-----{}-----", "错误的身份证");
for (String idCard : notIDCardList) {
boolean isIDCard = IdcardChecker.isIdcard(idCard);
logger.info("{} is IDCard : {}", idCard, isIDCard);
assertFalse(isIDCard);
}
String idcard = "310108800902023";
String idcard18 = IdcardChecker.convertIdcardBy15bit(idcard);
assertEquals("310108198009020231", idcard18);
}
}
| [
"fuyongde@foxmail.com"
] | fuyongde@foxmail.com |
88e669935055e40928cb13c182f51d8282c49761 | cfee0b423902d6416b838555f26d957f6dca5acd | /code/Q199BinaryTreeRightSideView.java | 6c19482681073f3dc971ae1281e7814f467ac810 | [] | no_license | JaydenZJX/Leetcode1 | 96eca8f17f165517f01f1f9352678695be506496 | 74e1ba2eaffeb334aa57d1166562979058c021ef | refs/heads/master | 2021-01-17T08:06:31.490887 | 2016-08-07T17:03:57 | 2016-08-07T17:03:57 | 65,142,824 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java |
import java.awt.Queue;
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
public class Solution{
public List<Integer> rightSideView(TreeNode root){
List<Integer> result =new ArrayList<Integer>();
if(root == null)
return result;
Queue<TreeNode> q = new LinkedList<TreeNode>();
q.offer(root);
while(!q.isEmpty()){
int size = q.size();
for(int i = 0; i < size; i++){
TreeNode tmp = q.poll();
if(i == size -1){
result.add(tmp.val);
}
if(tmp.left != null) q.offer(tmp.left);
if(tmp.right != null) q.offer(tmp.right);
}
}
return result;
}
}
| [
"zhangjunxu@zhangjuns-MacBook-Pro.local"
] | zhangjunxu@zhangjuns-MacBook-Pro.local |
4d379849ad59277f343d840f230f11d97df37d69 | 2b83974f507e56c997d362f6f569c95e20fb9941 | /src/main/java/com/lfq/mobileoffice/service/NoticeService.java | 89d12ecbf82216eac38e9ed297f8cf7c35b5a697 | [] | no_license | light-max/mobileoffice | c2a398768e1b94491b9742f43e105c5abc5adfa0 | 9f76d85594edd459ecb3e8e90a5c8363319e3579 | refs/heads/master | 2023-03-03T23:47:20.211192 | 2021-02-19T07:19:22 | 2021-02-19T07:19:22 | 289,450,547 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,108 | java | package com.lfq.mobileoffice.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lfq.mobileoffice.constant.AssertException;
import com.lfq.mobileoffice.model.data.response.NoticeRead_EmployeeName;
import com.lfq.mobileoffice.model.entity.Notice;
import com.lfq.mobileoffice.model.entity.NoticeRead;
import org.springframework.lang.Nullable;
import java.util.List;
import java.util.Map;
/**
* 通知服务
*
* @author 李凤强
*/
public interface NoticeService extends IService<Notice> {
/**
* 添加一条通知
*
* @param notice
* @throws AssertException
*/
void addNotice(Notice notice) throws AssertException;
/**
* 更新通知的内容
*
* @param notice
* @throws AssertException
*/
void updateNotice(Notice notice) throws AssertException;
/**
* 根据通知list查询这些通知的已读数量
*
* @param notices 通知列表
* @return 返回一个map, key:{@link Notice#getId()}, value:已读数量
*/
Map<Integer, Integer> queryReadCountMap(List<Notice> notices);
/**
* 分页查询已读某个通知的员工
*
* @param noticeId 通知id
* @param currentPage 当前页
* @return
*/
Page<NoticeRead> readNoticePage(Integer noticeId, @Nullable Integer currentPage);
/**
* 把{@link NoticeRead}转换为{@link NoticeRead_EmployeeName}
*
* @param list 要转换的list
* @return {@link NoticeRead_EmployeeName}
*/
List<NoticeRead_EmployeeName> cast(List<NoticeRead> list);
/**
* 判断员工是否已读某条通知
*
* @param employeeId 员工id
* @param noticeId 通知id
* @return true:已读 false:未读
*/
boolean isEmployeeReadNotice(int employeeId, int noticeId);
/**
* 员工已读某条通知
*
* @param employeeId 员工id
* @param noticeId 通知id
* @return true
*/
boolean employeeReadNotice(int employeeId, int noticeId);
}
| [
"3045033935@qq.com"
] | 3045033935@qq.com |
53be5762916913c76fa41e8d6231a1c01fff5d47 | aba3d5933e0b02330ff3a00a0986de26e8258f08 | /app/src/main/java/com/fcih/gp/furniturego/BaseActivity.java | 38f108876f78351faa2cab3bf4a7e84cb7dbd6a5 | [] | no_license | flair2005/FurnitureGo | fc05e605c015a1bcbda7854c0c63db7c2694d2ec | e2547b1315015c70e04206279f01d048f3a25885 | refs/heads/master | 2021-06-20T08:35:25.548127 | 2017-07-27T23:24:48 | 2017-07-27T23:24:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,477 | java | package com.fcih.gp.furniturego;
import android.app.SearchManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.login.LoginManager;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.squareup.picasso.Picasso;
import com.wikitude.architect.ArchitectStartupConfiguration;
import com.wikitude.architect.ArchitectView;
import com.wikitude.common.permission.PermissionManager;
import com.wikitude.tools.device.features.MissingDeviceFeatures;
import java.util.Arrays;
public class BaseActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
private static final String TAG = "BaseActivity";
protected NavigationView navigationView;
private DrawerLayout drawer;
private ActionBarDrawerToggle toggle;
private FirebaseAuth mAuth = FirebaseAuth.getInstance();
private FirebaseAuth.AuthStateListener mAuthListener;
private ProfileFragment profileFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MissingDeviceFeatures missingDeviceFeatures = ArchitectView.isDeviceSupported(this,
ArchitectStartupConfiguration.Features.ImageTracking | ArchitectStartupConfiguration.Features.InstantTracking);
//if (false) {
if (missingDeviceFeatures.areFeaturesMissing()) {
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Sorry");
alertDialog.setMessage("Sorry Your Device Is Not Supported." + missingDeviceFeatures.getMissingFeatureMessage());
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
(dialog, which) -> {
finish();
dialog.dismiss();
});
alertDialog.show();
finish();
} else {
setContentView(R.layout.activity_base);
if (mAuth.getCurrentUser() == null) {
Log.e(TAG, "User is signed out");
Intent loginIntent = new Intent(BaseActivity.this, LoginActivity.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(loginIntent);
finish();
} else {
mAuthListener = firebaseAuth -> {
if (firebaseAuth.getCurrentUser() == null) {
Intent loginIntent = new Intent(getApplicationContext(), LoginActivity.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(loginIntent);
finish();
}
};
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
onNavigationItemSelected(navigationView.getMenu().getItem(0));
}
}
}
@Override
public void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
}
@Override
public void onStop() {
super.onStop();
if (mAuthListener != null) {
mAuth.removeAuthStateListener(mAuthListener);
}
}
@Override
public void onBackPressed() {
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
getSupportFragmentManager().popBackStack();
} else {
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.item_menu, menu);
SearchSetup(menu);
UserSetup();
return true;
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
if (mAuth.getCurrentUser() != null) {
toggle.syncState();
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Pass any configuration change to the drawer toggles
toggle.onConfigurationChanged(newConfig);
}
public void UserSetup() {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
ImageView userimage = (ImageView) findViewById(R.id.nav_user_image);
TextView username = (TextView) findViewById(R.id.nav_user_name);
TextView useremail = (TextView) findViewById(R.id.nav_user_email);
if (user != null) {
if (user.getPhotoUrl() != null) {
Picasso.with(getApplicationContext())
.load(user.getPhotoUrl())
.resize(userimage.getWidth(), userimage.getWidth())
.into(userimage);
}
username.setText(user.getDisplayName());
useremail.setText(user.getEmail());
}
}
public void SearchSetup(Menu menu) {
MenuItem searchItem = menu.findItem(R.id.action_search);
final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
final ImageView mCloseButton = (ImageView) searchView.findViewById(android.support.v7.appcompat.R.id.search_close_btn);
searchView.setSearchableInfo(searchManager.getSearchableInfo(
new ComponentName(this, BaseActivity.class)
));
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
SearchFragment fragment = SearchFragment.newInstance(query);
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, fragment, SearchFragment.TAG).commit();
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_search) {
return true;
}
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_home) {
HomeFragment fragment = HomeFragment.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, fragment, HomeFragment.TAG).addToBackStack(null).commit();
} else if (id == R.id.nav_camera) {
PermissionManager mPermissionManager = ArchitectView.getPermissionManager();
String[] permissions = new String[]{android.Manifest.permission.CAMERA, android.Manifest.permission.READ_EXTERNAL_STORAGE};
mPermissionManager.checkPermissions(this, permissions, PermissionManager.WIKITUDE_PERMISSION_REQUEST, new PermissionManager.PermissionManagerCallback() {
@Override
public void permissionsGranted(int requestCode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
startActivity(new Intent(BaseActivity.this, SampleCam2Activity.class));
} else {
startActivity(new Intent(BaseActivity.this, SampleCamActivity.class));
}
}
@Override
public void permissionsDenied(String[] deniedPermissions) {
Toast.makeText(getApplicationContext(), "The Wikitude SDK needs the following permissions to enable an AR experience: " + Arrays.toString(deniedPermissions), Toast.LENGTH_SHORT).show();
}
@Override
public void showPermissionRationale(final int requestCode, final String[] permissions) {
android.app.AlertDialog.Builder alertBuilder = new android.app.AlertDialog.Builder(getApplicationContext());
alertBuilder.setCancelable(true);
alertBuilder.setTitle("Wikitude Permissions");
alertBuilder.setMessage("The Wikitude SDK needs the following permissions to enable an AR experience: " + Arrays.toString(permissions));
alertBuilder.setPositiveButton(android.R.string.yes, (dialog, which) -> mPermissionManager.positiveRationaleResult(requestCode, permissions));
android.app.AlertDialog alert = alertBuilder.create();
alert.show();
}
});
} else if (id == R.id.nav_account) {
profileFragment = ProfileFragment.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, profileFragment, ProfileFragment.TAG).addToBackStack(null).commit();
} else if (id == R.id.nav_models) {
MyModelsFragment fragment = MyModelsFragment.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, fragment, MyModelsFragment.TAG).addToBackStack(null).commit();
} else if (id == R.id.nav_whishlist) {
FavFragment fragment = FavFragment.newInstance();
getSupportFragmentManager().beginTransaction().replace(R.id.flContent, fragment, FavFragment.TAG).addToBackStack(null).commit();
} else if (id == R.id.nav_settings) {
} else if (id == R.id.nav_logout) {
mAuth.signOut();
LoginManager.getInstance().logOut();
}
item.setChecked(true);
setTitle(item.getTitle());
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (profileFragment != null) {
profileFragment.onActivityResult(requestCode, resultCode, data);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (profileFragment != null) {
profileFragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}
| [
"nader_alaa_244@fci.helwan.edu.eg"
] | nader_alaa_244@fci.helwan.edu.eg |
b9b44c8b62d8fd8d71b7bf0e637c15a7bd841c37 | 8665531526a2b8a6201df425de015b7ce484a15f | /src/main/java/com/youcode/spring/sbootapi/controllers/LoginController.java | 0a9fe7dbe31c041988b6e55a41bac82742688c35 | [] | no_license | MarouaneProjects/spring-boot-api | 981336fd6c423d4bdc94fe8ec6874817a9ffe568 | 411730ad3b7b53b382ece1ee950eb624d6d31858 | refs/heads/master | 2020-12-23T03:08:05.793915 | 2020-01-29T15:36:43 | 2020-01-29T15:36:43 | 237,014,458 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package com.youcode.spring.sbootapi.controllers;
import com.youcode.spring.sbootapi.forms.LoginForm;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller("/users")
public class LoginController {
@GetMapping("login")
public String login(Model model) {
model.addAttribute("form", new LoginForm());
return "users/login";
}
}
| [
"boulhiltmarouane@gmail.com"
] | boulhiltmarouane@gmail.com |
a042592dbc7eeddcf790662fce9e62d80fecb06a | eeeb576e953d03b282e931a5848bd4560a9fdd7c | /serverbywanglong/model/src/main/java/com/modianli/power/model/HotProductCategoryTypeDetails.java | 2b8ec27b323af939a141faad0ced9d4bd02e641b | [] | no_license | Qingmutang/controller | 28c0666e2a2ae35cbe8b46aa08108bfe7ff1097b | 8077ed6ccb00232023aa51e5c23e42f921a57550 | refs/heads/master | 2020-03-22T06:43:30.695840 | 2018-07-04T23:05:09 | 2018-07-04T23:05:09 | 139,653,384 | 0 | 0 | null | 2018-07-04T06:43:08 | 2018-07-04T01:27:39 | null | UTF-8 | Java | false | false | 454 | java | package com.modianli.power.model;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Created by gao on 17-2-23.
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class HotProductCategoryTypeDetails implements Serializable{
private String type;
private List<HotProductCategoryDetails> hotProductCategoryDetails;
}
| [
"a1.com"
] | a1.com |
1effe5e7747025130831aa3bcf73e79ec90374ef | 2ea49bfaa6bc1b9301b025c5b2ca6fde7e5bb9df | /contributions/Drexoll/Java/Data Types/2016-11-04.java | fe7f97b2ad4cb4bdb0319ca3e22139059b0836ae | [] | no_license | 0x8801/commit | 18f25a9449f162ee92945b42b93700e12fd4fd77 | e7692808585bc7e9726f61f7f6baf43dc83e28ac | refs/heads/master | 2021-10-13T08:04:48.200662 | 2016-12-20T01:59:47 | 2016-12-20T01:59:47 | 76,935,980 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | `Math` vs `StrictMath` in java
Use primitive types instead of wrapper classes when possible
Multidimensional array declaration
Converting numbers to strings
Finding a substring in a string | [
"darcy@drexollgames.com"
] | darcy@drexollgames.com |
e994f1889d2eb9b1cfa3a492714b266a18702aca | 98d313cf373073d65f14b4870032e16e7d5466f0 | /gradle-open-labs/example/src/main/java/se/molybden/Class16497.java | 0da2b693fb48c080040a9a81c170ad1314ac6836 | [] | no_license | Molybden/gradle-in-practice | 30ac1477cc248a90c50949791028bc1cb7104b28 | d7dcdecbb6d13d5b8f0ff4488740b64c3bbed5f3 | refs/heads/master | 2021-06-26T16:45:54.018388 | 2016-03-06T20:19:43 | 2016-03-06T20:19:43 | 24,554,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 110 | java |
public class Class16497{
public void callMe(){
System.out.println("called");
}
}
| [
"jocce.nilsson@gmail.com"
] | jocce.nilsson@gmail.com |
c2edadca98168c3e18ede55bbaf4666e6d0d2210 | f57f4f9b9d6a922eb89d60c794f36704351033c0 | /src/devseminar/model/RegistrationInfo.java | a8c5aa26baaa725e0a42e22a8cac744c03f0c370 | [] | no_license | nathanshih/WebApplicationDevelopment | 205be74f457dee45b92ece694ca5ad2c1851bcf4 | 59ffead6ed6593ea69d53b27842fd64c01166e02 | refs/heads/master | 2020-05-20T05:30:08.252564 | 2014-11-25T08:59:10 | 2014-11-25T08:59:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package devseminar.model;
import java.util.List;
/**
* This model class holds information relevant to the registration information.
*
* @author Nathan Shih
* @date Sep 24, 2014
*/
public class RegistrationInfo {
private String name;
private String email;
private List<String> courses;
private String employmentStatus;
private String hotel;
private String parking;
private CostInfo costInfo;
public String getName() {
return name;
}
public void setName(String fullName) {
this.name = fullName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public List<String> getCourses() {
return courses;
}
public void setCourses(List<String> courses) {
this.courses = courses;
}
public String getEmploymentStatus() {
return employmentStatus;
}
public void setEmploymentStatus(String employmentStatus) {
this.employmentStatus = employmentStatus;
}
public String getHotel() {
return hotel;
}
public void setHotel(String hotel) {
this.hotel = hotel;
}
public String getParking() {
return parking;
}
public void setParking(String parking) {
this.parking = parking;
}
public CostInfo getCostInfo() {
return costInfo;
}
public void setCostInfo(CostInfo costInfo) {
this.costInfo = costInfo;
}
}
| [
"nathan.shih@disney.com"
] | nathan.shih@disney.com |
621d6027d63e6964e1990f8ee0a75a1ea9f87c5a | 8965438a527863337ffa4936c33423cb6e48719c | /LearningWeb/src/AdministratorServlet/AdminTeaUpd.java | e666803e7a7c5bb97a22ffdaef274ca9d9762d7b | [] | no_license | danzhewuju/LearningWeb_M | a55059f441af125288fc875699a584e7846fae20 | fe7b283e4106d33c9768cf1a7d40c21eb4ec44bc | refs/heads/master | 2020-03-17T16:26:13.104583 | 2018-05-21T04:48:51 | 2018-05-21T04:48:51 | 133,748,582 | 0 | 0 | null | 2018-05-21T07:09:46 | 2018-05-17T02:36:21 | HTML | UTF-8 | Java | false | false | 2,007 | java | package AdministratorServlet;
import DAO.TeacherDAO;
import Page.TeacherPage;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Created by Administrator on 2017/6/26.
*/
@WebServlet(name = "AdminTeaUpd",value = "/AdminTeaUpd")
public class AdminTeaUpd extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
String tid = (String) request.getSession().getAttribute("teacherTno");
PrintWriter out = response.getWriter();
TeacherDAO dao = new TeacherDAO();
TeacherPage t = new TeacherPage();
t.setId(tid);
t.setPassword(request.getParameter("Tpswd"));
t.setUsername(request.getParameter("Tno"));
t.setName(request.getParameter("Tname"));
t.setGender(request.getParameter("Tsex"));
t.setMajor(request.getParameter("Tprofession"));
t.setStatus(request.getParameter("Tstatus"));
t.setEmail(request.getParameter("Temail"));
t.setIntroduction(request.getParameter("Tintroduction"));
t.setPicture(null);
boolean success = dao.Update(t);
if (!success) {
out.print("<script language='javascript'>alert('修改失败!');"
+ "window.location.href='Administrator/Admin-TeaSel.jsp';</script>");
} else {
out.print("<script language='javascript'>alert('修改成功!');"
+ "window.location.href='Administrator/Admin-TeaSel.jsp';</script>");
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
| [
"1668926294@qq.com"
] | 1668926294@qq.com |
e73a9b197a6f7f1dd1e0ff74f85a5a905505faf7 | 1950d5fb7e56bb750a738d9568a6fa0594d9c71c | /src/com/thread/countdownlanch/CountDownLanchDemo.java | 45f83e002634af0c2e726bf449b3771decab1d53 | [] | no_license | PKOMBase/pko_thread | 6ef98673b0da4c4b6aa1e5881aec401a4e85792a | cc7708bf98eaca02c260036f59ecfbb3e36dd9b6 | refs/heads/master | 2021-01-19T22:34:06.936395 | 2017-05-17T10:40:12 | 2017-05-17T10:40:12 | 88,824,078 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,186 | java | package com.thread.countdownlanch;
public class CountDownLanchDemo {
public static void main(String[] args) throws InterruptedException {
MyCountDownLanch countDownLatch = new MyCountDownLanch(2);
Thread mainThread = Thread.currentThread();
Runnable runnable = new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000 + (int) (Math.random() * 1000));
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("thread" + Thread.currentThread().getName() + ", mainThread:" + mainThread.getName()
+ " , " + mainThread.getState());
countDownLatch.countDown();
}
};
Thread thread1 = new Thread(runnable);
Thread thread2 = new Thread(runnable);
Thread thread3 = new Thread(runnable);
Thread thread4 = new Thread(runnable);
thread1.start();
thread2.start();
thread3.start();
thread4.start();
countDownLatch.await();
System.out.println("main end");
}
}
| [
"453167480@qq.com"
] | 453167480@qq.com |
93bd7dec331ec443381627fd42e6200d7f8200d9 | fc917b7d97ff2d339ce492f2c65bafc431510ace | /src/main/java/de/synyx/synli/shared/service/AppRequestFactory.java | 87929a30b7a0487b168ae0b56a3b2f314b9877fb | [] | no_license | bseber/SynLi | e2b01d0d5a4a38578debf5938ca83f25706ffa52 | 64d55d62867a313f6180b221b4822206165e32cc | refs/heads/master | 2016-08-06T15:29:23.740639 | 2012-07-21T14:30:57 | 2012-07-21T14:30:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 219 | java | package de.synyx.synli.shared.service;
import com.google.web.bindery.requestfactory.shared.RequestFactory;
public interface AppRequestFactory extends RequestFactory {
BookServiceRequest getBookServiceRequest();
}
| [
"bennyseber@gmail.com"
] | bennyseber@gmail.com |
489f5743e2d2dfa754be09cc22f15734147bdc16 | 4fabb6f57e838e86937d3d3c66b1ee002c0ffaaa | /app/src/main/java/it/fabaris/wfp/task/FormLoaderTask.java | e930ca778d5187f2b3ac507377f0d63117d00c6d | [] | no_license | ClaudiaAlawi/MyRepo | d5261aebe73c2f9c06ad1e96c02a6686f637e961 | 8dbf6007952e3b4681126cc9ebd2d564b5eb33de | refs/heads/master | 2020-05-21T22:16:27.455953 | 2017-03-18T22:39:09 | 2017-03-18T22:39:09 | 63,018,949 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,349 | java | /*******************************************************************************
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
******************************************************************************/
package it.fabaris.wfp.task;
import android.os.AsyncTask;
import android.util.Log;
import org.javarosa.core.model.FormDef;
import org.javarosa.core.model.condition.EvaluationContext;
import org.javarosa.core.model.instance.TreeElement;
import org.javarosa.core.model.instance.TreeReference;
import org.javarosa.core.reference.ReferenceManager;
import org.javarosa.core.reference.RootTranslator;
import org.javarosa.core.services.PrototypeManager;
import org.javarosa.core.util.externalizable.DeserializationException;
import org.javarosa.core.util.externalizable.ExtUtil;
import org.javarosa.form.api.FormEntryController;
import org.javarosa.form.api.FormEntryModel;
import org.javarosa.xform.parse.XFormParseException;
import org.javarosa.xform.parse.XFormParser;
import org.javarosa.xform.util.XFormUtils;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import it.fabaris.wfp.activities.FormEntryActivity;
import it.fabaris.wfp.application.Collect;
import it.fabaris.wfp.listener.FormLoaderListener;
import it.fabaris.wfp.logic.FileReferenceFactory;
import it.fabaris.wfp.logic.FormController;
import it.fabaris.wfp.utility.FileUtils;
/**
* Background task for loading a form.
* This class is called when the user wants
* compile a new form, here
* all the objects needed to work on the
* form through all the compilation process
* are initialized
* @author Carl Hartung (carlhartung@gmail.com)
* @author Yaw Anokwa (yanokwa@gmail.com)
* @author Mureed (mureedf@unops.org) --add ability to view and send image
*
*/
public class FormLoaderTask extends AsyncTask<String, String, FormLoaderTask.FECWrapper> {
private final static String t = "FormLoaderTask";
//Classes needed to serialize objects. Need to put anything from JR in here.
public final static String[] SERIALIABLE_CLASSES = {
"org.javarosa.core.model.FormDef",
"org.javarosa.core.model.GroupDef",
"org.javarosa.core.model.QuestionDef",
"org.javarosa.core.model.data.DateData",
"org.javarosa.core.model.data.DateTimeData",
"org.javarosa.core.model.data.DecimalData",
"org.javarosa.core.model.data.GeoPointData",
"org.javarosa.core.model.data.helper.BasicDataPointer",
"org.javarosa.core.model.data.IntegerData",
"org.javarosa.core.model.data.MultiPointerAnswerData",
"org.javarosa.core.model.data.PointerAnswerData",
"org.javarosa.core.model.data.SelectMultiData",
"org.javarosa.core.model.data.SelectOneData",
"org.javarosa.core.model.data.StringData",
"org.javarosa.core.model.data.TimeData",
"org.javarosa.core.services.locale.TableLocaleSource",
"org.javarosa.xpath.expr.XPathArithExpr",
"org.javarosa.xpath.expr.XPathBoolExpr",
"org.javarosa.xpath.expr.XPathCmpExpr",
"org.javarosa.xpath.expr.XPathEqExpr",
"org.javarosa.xpath.expr.XPathFilterExpr",
"org.javarosa.xpath.expr.XPathFuncExpr",
"org.javarosa.xpath.expr.XPathNumericLiteral",
"org.javarosa.xpath.expr.XPathNumNegExpr",
"org.javarosa.xpath.expr.XPathPathExpr",
"org.javarosa.xpath.expr.XPathStringLiteral",
"org.javarosa.xpath.expr.XPathUnionExpr",
"org.javarosa.xpath.expr.XPathVariableReference"
};
private FormLoaderListener mStateListener;
private String mErrorMsg;
protected class FECWrapper {
FormController controller;
protected FECWrapper(FormController controller) {
this.controller = controller;
}
protected FormController getController() {
return controller;
}
protected void free() {
controller = null;
}
}
FECWrapper data;
/**
* Initialize {@link FormEntryController} with {@link FormDef} from binary or from XML. If given
* an instance, it will be used to fill the {@link FormDef}.
*/
@Override
protected FECWrapper doInBackground(String... path) {
FormEntryController fec = null;
FormDef fd = null;
FileInputStream fis = null;
mErrorMsg = null;
String formPath = path[0];
File formXml = new File(formPath);
String formHash = FileUtils.getMd5Hash(formXml);
File formBin = new File(Collect.CACHE_PATH + File.separator + formHash + ".formdef");
if (formBin.exists()) {
/**
* if we have binary, deserialize binary
*/
Log.i(t,"Attempting to load " + formXml.getName() + " from cached file: "+ formBin.getAbsolutePath());
fd = deserializeFormDef(formBin);
if (fd == null) {
/**
* some error occured with deserialization. Remove the file, and make a new .formdef
* from xml
*/
Log.w(t,"Deserialization FAILED! Deleting cache file: " + formBin.getAbsolutePath());
formBin.delete();
}
}
if (fd == null) {
/**
* no binary, read from xml
*/
try {
Log.i(t, "Attempting to load from: " + formXml.getAbsolutePath());
fis = new FileInputStream(formXml);
fd = XFormUtils.getFormFromInputStream(fis);
if (fd == null) {
mErrorMsg = "Error reading XForm file";
} else {
serializeFormDef(fd, formPath);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
mErrorMsg = e.getMessage();
} catch (XFormParseException e) {
mErrorMsg = e.getMessage();
e.printStackTrace();
} catch (Exception e) {
mErrorMsg = e.getMessage();
e.printStackTrace();
}
}
if (mErrorMsg != null) {
return null;
}
/**
* new evaluation context for function handlers
*/
EvaluationContext ec = new EvaluationContext();
fd.setEvaluationContext(ec);
/**
* create FormEntryController from formdef
*/
FormEntryModel fem = new FormEntryModel(fd);
fec = new FormEntryController(fem);
try {
/**
* import existing data into formdef
*/
if (FormEntryActivity.mInstancePath != null) {
/**
* This order is important. Import data, then initialize.
*/
try {
Thread.sleep(1000);
importData(FormEntryActivity.mInstancePath, fec);
} catch (InterruptedException e) {
e.printStackTrace();
}
Thread.sleep(1000);
fd.initialize(false);
} else {
fd.initialize(true);
}
} catch (RuntimeException e) {
mErrorMsg = e.getMessage();
return null;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/**
* set paths to /sdcard/odk/forms/formfilename-media/
*/
String formFileName = formXml.getName().substring(0, formXml.getName().lastIndexOf("."));
/**
* Remove previous forms
*/
ReferenceManager._().clearSession();
/**
* This should get moved to the Application Class
*/
if (ReferenceManager._().getFactories().length == 0) {
/**
* this is /sdcard/odk
*/
ReferenceManager._().addReferenceFactory(
new FileReferenceFactory(Collect.FABARISODK_ROOT));
}
/**
* Set jr://... to point to /sdcard/odk/forms/filename-media/
*/
ReferenceManager._().addSessionRootTranslator(
new RootTranslator("jr://images/", "jr://file/forms/" + formFileName + "-media/"));
ReferenceManager._().addSessionRootTranslator(
new RootTranslator("jr://audio/", "jr://file/forms/" + formFileName + "-media/"));
ReferenceManager._().addSessionRootTranslator(
new RootTranslator("jr://video/", "jr://file/forms/" + formFileName + "-media/"));
/**
* clean up vars
*/
fis = null;
fd = null;
formBin = null;
formXml = null;
formPath = null;
FormController fc = new FormController(fec);
data = new FECWrapper(fc);
return data;
}
public boolean importData(String filePath, FormEntryController fec) {
/**
* convert files into a byte array
*/
byte[] fileBytes = FileUtils.getFileAsBytes(new File(filePath));
/**
* get the root of the saved and template instances
*/
TreeElement savedRoot = XFormParser.restoreDataModel(fileBytes, null).getRoot();
TreeElement templateRoot = fec.getModel().getForm().getInstance().getRoot().deepCopy(true);
//savedRoot contains the value inserted by the user during the compilation process. There are all the values, but saved as strings (datatype=0)
//templateRoot contains only the skeleton of the form, without the value inserted by the user. It has just the value of the Labels and the client version
/**
* weak check for matching forms
*/
if (!savedRoot.getName().equals(templateRoot.getName()) || savedRoot.getMult() != 0) {
Log.e(t, "Saved form instance does not match template form definition");
return false;
} else {
/**
* populate the data model
*/
TreeReference tr = TreeReference.rootRef();
tr.add(templateRoot.getName(), TreeReference.INDEX_UNBOUND);
templateRoot.populate(savedRoot, fec.getModel().getForm());
//************************************************* 29/11/2013
ArrayList<String> str = new ArrayList<String>();
/**
* take the answers
*/
str = treePreorder(savedRoot, str);
str.remove(0);
/**
* take the model
*/
ArrayList<TreeElement> treeMod = new ArrayList<TreeElement>();
treeMod = treeModel(templateRoot, treeMod); //put the templateRoot's element
//in the treeMod
setImageDataType(templateRoot); //Add the DataType (7 for radio, 3 for decimal)
//remove it so that the image will not be displayed in the view
/**
* Match the answers to the model
*/
// for(int j=0; j < str.size(); j++)
// {
// if (treeMod.get(j) != null && treeMod.get(j).dataType == Constants.DATATYPE_BINARY && treeMod.get(j).getValue() != null && treeMod.get(j).getValue().getDisplayText().indexOf("jpg") > 0) {
// String x= filePath.substring(0, filePath.lastIndexOf("/") + 1) + str.get(j);
// treeMod.get(j).getValue().setValue(x);
// }
// }
//*************************************************
/**
* populated model to current form
*/
fec.getModel().getForm().getInstance().setRoot(templateRoot);
/**
* fix any language issues
* : http://bitbucket.org/javarosa/main/issue/5/itext-n-appearing-in-restored-instances
*/
if (fec.getModel().getLanguages() != null) {
fec.getModel()
.getForm()
.localeChanged(fec.getModel().getLanguage(),
fec.getModel().getForm().getLocalizer());
}
return true;
}
}
/**
* Read serialized {@link FormDef} from file and recreate as object.
* @param formDef
* @param formDef serialized FormDef file
* @return {@link FormDef} object
* @return
*/
public FormDef deserializeFormDef(File formDef) {
// TODO: any way to remove reliance on jrsp?
/**
* need a list of classes that formdef uses
*/
PrototypeManager.registerPrototypes(SERIALIABLE_CLASSES);
FileInputStream fis = null;
FormDef fd = null;
try {
/**
* create new form def
*/
fd = new FormDef();
fis = new FileInputStream(formDef);
DataInputStream dis = new DataInputStream(fis);
/**
* read serialized formdef into new formdef
*/
fd.readExternal(dis, ExtUtil.defaultPrototypes());
dis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
fd = null;
} catch (IOException e) {
e.printStackTrace();
fd = null;
} catch (DeserializationException e) {
e.printStackTrace();
fd = null;
} catch (Exception e) {
e.printStackTrace();
fd = null;
}
return fd;
}
/**
* Write the FormDef to the file system as a binary blog.
* @param filepath path to the form file
* @param fd
* @param filepath
*/
public void serializeFormDef(FormDef fd, String filepath) {
/**
* calculate unique md5 identifier
*/
String hash = FileUtils.getMd5Hash(new File(filepath));
File formDef = new File(Collect.CACHE_PATH + File.separator + hash + ".formdef");
/**
* formdef does not exist, create one.
*/
if (!formDef.exists()) {
FileOutputStream fos;
try {
fos = new FileOutputStream(formDef);
DataOutputStream dos = new DataOutputStream(fos);
fd.writeExternal(dos);
dos.flush();
dos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
protected void onPostExecute(FECWrapper wrapper) {
try{
synchronized (this) {
if (mStateListener != null) {
if (wrapper == null) {
mStateListener.loadingError(mErrorMsg);
} else {
//THREAD PER L'APERTURA DELLA FORM DAL DATABASE
mStateListener.loadingComplete(wrapper.getController());
}
}
}
}catch (Exception e) {
e.printStackTrace();
}
}
public void setFormLoaderListener(FormLoaderListener sl) {
synchronized (this) {
mStateListener = sl;
}
}
public void destroy() {
if (data != null) {
data.free();
data = null;
}
}
public void setImageDataType(TreeElement tree)
{
if(tree == null);
if(tree.dataType == 12)
{
//tree.dataType = 10;
//tree.
}
Log.e("IL NUOVO DATATYPE E'", String.valueOf(tree.dataType));
int num = tree.getNumChildren();
for (int n=0; n<num; n++)
{
TreeElement child = tree.getChildAt(n);
setImageDataType(child);
}
}
public ArrayList<String> treePreorder(TreeElement tree, ArrayList<String> list)
{
if(tree == null);
if(tree.getValue() == null)
list.add(null);
else if(tree.getValue() != null)
list.add((String) tree.getValue().getValue());
int num = tree.getNumChildren();
for (int n=0; n<num; n++)
{
TreeElement child = tree.getChildAt(n);
treePreorder(child, list);
}
return list;
}
public ArrayList<TreeElement> treeModel(TreeElement tree, ArrayList<TreeElement> list)
{
if(tree == null);
if(!tree.getName().equals("data"))
list.add(tree);
int num = tree.getNumChildren();
for (int n=0; n<num; n++)
{
TreeElement child = tree.getChildAt(n);
treeModel(child, list);
}
return list;
}
}
| [
"Claudia"
] | Claudia |
e2b5ad1d28093269f740914948710c5d823ff98c | 3cd8ad76778ddabfd62414b2bf044def955d0d88 | /pw-new/.svn/pristine/90/90f3a0880c054e6af616da197e6299a56f61a95d.svn-base | 46401e1ecc68f6050be972b463e557786a6bf5cf | [] | no_license | dbc1024/demos | 65f640eb6bbc5b6476645eeb7c42c28e7218f6cb | ebbe48de090af138f55e8a1923768328452f1d69 | refs/heads/master | 2020-03-30T19:08:35.871801 | 2019-05-08T03:14:59 | 2019-05-08T03:14:59 | 151,530,128 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 82,055 | package com.ectrip.ec.report.system.datereport.dao;
import java.util.ArrayList;
import java.util.List;
import com.ectrip.base.dao.GenericDao;
import com.ectrip.ec.model.report.sales.Rwspersonalday;
import com.ectrip.ec.report.system.datereport.dao.idao.IReportDataDAO;
public class ReportDataDAO extends GenericDao implements IReportDataDAO {
/**
* ����ʱ���ѯ���������ս����� Describe:
*
* @auth:huangyuqi
* @param date
* @return return:List Date:2011-11-30
*/
public List updateOrQueryProviderByDate(String type, String date) {
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rproviderdaytab");// �ս�
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rprovidermonthtab");// �½�
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rprovideryeartab");// ���
}
List list = new ArrayList();
String hsql = "";
String hsql2 = "";
if ("1".equals(type)) {
hsql = "select sale.iscenicid as iscenicid, pro.szscenicname as szscenicname,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid,sale.bysalesvouchertype,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl where substr(sale.dtmakedate, 1, 10) = '"
+ date
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid group by sale.iscenicid,pro.szscenicname,sm.isettlementid,sale.bysalesvouchertype";
} else if ("2".equals(type)) {
hsql = "select sale.iscenicid as iscenicid, pro.szscenicname as szscenicname,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid,sale.bysalesvouchertype,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl where substr(sale.dtmakedate, 1, 4) = '"
+ date.substring(1, 4)
+ "' and substr(sale.dtmakedate, 6, 2) = '"
+ date.substring(5, 7)
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid group by sale.iscenicid,pro.szscenicname,sm.isettlementid,sale.bysalesvouchertype";
} else if ("3".equals(type)) {
hsql = "select sale.iscenicid as iscenicid, pro.szscenicname as szscenicname,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid ,sale.bysalesvouchertype,nvl(sum(sl.mderatemoney),0),nvl(sum(sl.ideratenums),0) as ideratenums as mderatemoney from Stssalesvouchertab sale,Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl where substr(sale.dtmakedate, 1, 4) = '"
+ date.substring(1, 4)
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid group by sale.iscenicid,pro.szscenicname,sm.isettlementid,sale.bysalesvouchertype";
}
String hsql3 = "";
if ("1".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where m.orda='"
+ date
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,pro.szscenicname ";
} else if ("2".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and substr(m.orda,6,2)='"
+ date.substring(5, 7)
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,pro.szscenicname ";
} else if ("3".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,pro.szscenicname ";
}
list = this.find(hsql);
List list3 = this.find(hsql3);
if (list != null && list.size() >= 1) {
if (list3 != null && list3.size() >= 1) {
for (int i = 0; i < list3.size(); i++) {
list.add(list3.get(i));
}
}
return list;
} else {
return list3;
}
}
/**
* ��ȡ�������¡��걨������ Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQueryProviderByType(String type, String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
this.deleteDates(date, "2", "Rprovidermonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rprovideryeartab");
}
if ("2".equals(type)) {
hsql.append(" select iscenicid as iscenicid,szscenicname as szscenicname,sum(mont) as mont,sum(zfmont) as zfmont,sum(yhmont) as yhmont,notea,noteb,notec,noted,nvl(sum(duf),0) as duf,nvl(sum(isf),0) as isf from Rproviderdaytab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid ,szscenicname,notea,noteb,notec,noted ");
} else if ("3".equals(type)) {
hsql.append(" select iscenicid as iscenicid,szscenicname as szscenicname,sum(mont) as mont,sum(zfmont) as zfmont,sum(yhmont) as yhmont,notea,noteb,notec,noted,nvl(sum(duf),0) as duf,nvl(sum(isf),0) as isf from Rprovidermonthtab where ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid ,szscenicname,notea,noteb,notec,noted");
}
list = this.find(hsql.toString());
return list;
}
/**
* ����ʱ���ѯ��������������ϸ�б� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-8
*/
public List updateOrQueryProviderList(String type, String date) {
if ("1".equals(type)) {
this.deleteDatesByTable(date, "1", "Rproviderlisttab");
} else if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rproviderlisttab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rproviderlisttab");
}
List list = new ArrayList();
String hsql = "";
// ��Ʊ��
if ("1".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,pro.szscenicname as szscenicname, sl.itickettypeid as itickettypeid, kind.icrowdkindid as icrowdkindid ,sl.mactualsaleprice as pric,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid,sum(sl.iamount) as tdnum,sale.bysalesvouchertype,nvl(sum(sl.ideratenums),0) as ideratenums,nvl(sum(sl.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale, Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl, Edmcrowdkindpricetab kind where substr(sale.dtmakedate, 1, 10) = '"
+ date
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid and sl.icrowdkindpriceid = kind.icrowdkindpriceid group by sale.iscenicid, pro.szscenicname, sl.itickettypeid,kind.icrowdkindid, sl.mactualsaleprice, sm.isettlementid,sale.bysalesvouchertype ";
} else if ("2".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,pro.szscenicname as szscenicname, sl.itickettypeid as itickettypeid, kind.icrowdkindid as icrowdkindid ,sl.mactualsaleprice as pric,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid,sum(sl.iamount) as tdnum,sale.bysalesvouchertype,nvl(sum(sl.ideratenums),0) as ideratenums,nvl(sum(sl.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale, Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl, Edmcrowdkindpricetab kind where substr(sale.dtmakedate, 1, 4) = '"
+ date.substring(0,4)
+ "' and substr(sale.dtmakedate, 6, 2) = '"
+ date.substring(5, 7)
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid and sl.icrowdkindpriceid = kind.icrowdkindpriceid group by sale.iscenicid, pro.szscenicname, sl.itickettypeid, kind.icrowdkindid, sl.mactualsaleprice, sm.isettlementid,sale.bysalesvouchertype ";
} else if ("3".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,pro.szscenicname as szscenicname, sl.itickettypeid as itickettypeid, kind.icrowdkindid as icrowdkindid ,sl.mactualsaleprice as pric,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sum(sl.meventmoney) as tdmont,sum(sl.mhandcharge) as mhandcharge,sm.isettlementid as isettlementid,sum(sl.iamount) as tdnum,sale.bysalesvouchertype,nvl(sum(sl.ideratenums),0) as ideratenums,nvl(sum(sl.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale, Esbscenicareatab pro,Stssalessettlementtab sm,Stssalesvoucherdetailstab sl, Edmcrowdkindpricetab kind where substr(sale.dtmakedate, 1, 4) = '"
+ date.substring(0, 4)
+ "' and pro.iscenicid = sale.iscenicid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sm.id.iticketstationid = sale.id.iticketstationid and sl.id.iticketstationid = sale.id.iticketstationid and sl.icrowdkindpriceid = kind.icrowdkindpriceid group by sale.iscenicid, pro.szscenicname, sl.itickettypeid, kind.icrowdkindid, sl.mactualsaleprice, sm.isettlementid ,sale.bysalesvouchertype";
}
list = this.find(hsql);
String hsql3 = "";
if ("1".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,yl.itickettypeid as itickettypeid,yl.icrowdkindid as icrowdkindid,yl.pric as pric,0 as numb,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,sum(yl.numb) as tdnum,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where m.orda='"
+ date
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,yl.itickettypeid ,yl.icrowdkindid, pro.szscenicname,yl.pric ";
} else if ("2".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,yl.itickettypeid as itickettypeid,yl.icrowdkindid as icrowdkindid,yl.pric as pric,0 as numb,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,sum(yl.numb) as tdnum,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and substr(m.orda,6,2)='"
+ date.substring(5, 7)
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,yl.itickettypeid ,yl.icrowdkindid, pro.szscenicname,yl.pric ";
} else if ("3".equals(type)) {
hsql3 = "select yl.id.iscenicid as iscenicid, pro.szscenicname as szscenicname,yl.itickettypeid as itickettypeid,yl.icrowdkindid as icrowdkindid,yl.pric as pric,0 as numb,0 as mont,0 as tdmont,sum(yl.mhandcharge) as mhandcharge,'99' as isettlementid,sum(yl.numb) as tdnum,'02' as fs from MOrder m,YOrderlist yl, Esbscenicareatab pro where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.id.iscenicid = pro.iscenicid group by yl.id.iscenicid ,yl.itickettypeid ,yl.icrowdkindid, pro.szscenicname,yl.pric ";
}
List list3 = this.find(hsql3);
if (list != null && list.size() >= 1) {
if (list3 != null && list3.size() >= 1) {
for (int i = 0; i < list3.size(); i++) {
list.add(list3.get(i));
}
}
return list;
} else {
return list3;
}
}
/**
* ������������ϸ�¡����б��� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQueryProviderListByType(String type, String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rproviderlisttab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rproviderlisttab");
}
if ("2".equals(type)) {
hsql.append("select iscenicid,szscenicname,itickettypeid,ttypename,icrowdkindid,szcrowdkindname,pric,protype,protypename,sum(numb) as numb,sum(mont),sum(dua),sum(dub),sum(isa),notea,noteb,nvl(sum(duf),0) as duf,nvl(sum(isf),0) as isf from Rproviderlisttab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' and titype='01' group by iscenicid,szscenicname,itickettypeid,ttypename,icrowdkindid,szcrowdkindname,pric,protype,protypename,notea,noteb");
} else if ("3".equals(type)) {
hsql.append("select iscenicid,szscenicname,itickettypeid,ttypename,icrowdkindid,szcrowdkindname,pric,protype,protypename,sum(numb) as numb,sum(mont),sum(dua),sum(dub),sum(isa),notea,noteb,nvl(sum(duf),0) as duf,nvl(sum(isf),0) as isf from Rproviderlisttab where ryear='"
+ date.substring(0, 4)
+ "' and titype='02' group by iscenicid,szscenicname,itickettypeid,ttypename,icrowdkindid,szcrowdkindname,pric,protype,protypename,notea,noteb");
}
list = this.find(hsql.toString());
return list;
}
/**
* ����ʱ���ѯ����Դ������ Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-1
*/
public List updateOrQueryRegionByDate(String type, String date) {
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rregiondaytab");
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rregionmonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rregionyeartab");
}
List list = new ArrayList();
String hsql = "";
if ("1".equals(type)) {// ��
hsql = " select t.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,t.iregionalid as iregionalid,re.szregionalname as szregionalname,sum(list.numb) as counts from MOrder m,TOrder t,Galsourceregiontab re,Esbscenicareatab pro,TOrderlist list where m.orda='"
+ date
+ "' and m.ddzt in('02','01','11') and t.id.orid = m.orid and list.id.orid = t.id.orid and re.iregionalid = t.iregionalid and t.id.iscenicid = pro.iscenicid group by t.id.iscenicid,pro.szscenicname,t.iregionalid,re.szregionalname";
} else if ("2".equals(type)) {// ��
hsql = " select t.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,t.iregionalid as iregionalid,re.szregionalname as szregionalname,sum(list.numb) as counts from MOrder m,TOrder t,Galsourceregiontab re,Esbscenicareatab pro,TOrderlist list where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and substr(m.orda,6,2)='"
+ date.substring(5, 7)
+ "' and m.ddzt in('02','01','11') and t.id.orid = m.orid and list.id.orid = t.id.orid and re.iregionalid = t.iregionalid and t.id.iscenicid = pro.iscenicid group by t.id.iscenicid,pro.szscenicname,t.iregionalid,re.szregionalname";
} else if ("3".equals(type)) {// ��
hsql = " select t.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,t.iregionalid as iregionalid,re.szregionalname as szregionalname,sum(list.numb) as counts from MOrder m,TOrder t,Galsourceregiontab re,Esbscenicareatab pro,TOrderlist list where substr(m.orda,1,4)='"
+ date.substring(0, 4)
+ "' and m.ddzt in('02','01','11') and t.id.orid = m.orid and list.id.orid = t.id.orid and re.iregionalid = t.iregionalid and t.id.iscenicid = pro.iscenicid group by t.id.iscenicid,pro.szscenicname,t.iregionalid,re.szregionalname";
}
list = this.find(hsql);
return list;
}
/**
* ��ѯ����Դ���¡��걨������ Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQueryRegionByType(String type, String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
this.deleteDates(date, "2", "Rregionmonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rregionyeartab");
}
if ("2".equals(type)) {
hsql.append("select iscenicid,szscenicname,iregionalid,szregionalname,sum(numb) from Rregiondaytab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid,szscenicname,iregionalid,szregionalname");
} else if ("3".equals(type)) {
hsql.append("select iscenicid,szscenicname,iregionalid,szregionalname,sum(numb) from Rregionmonthtab where ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid,szscenicname,iregionalid,szregionalname");
}
list = this.find(hsql.toString());
return list;
}
/**
* ����ʱ���ѯ���ο��������� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-1
*/
public List updateOrQueryCustomCountByDate(String type, String date) {
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rcustomdaytab");
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rcustommonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rcustomyeartab");
}
List list = new ArrayList();
String hsql = "";
if ("1".equals(type)) {// ��
// orfl ��ʾ�������࣬02��ʾ��Ʊ
hsql = " select tor.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,sum(lis.numb) as numbs from TOrder tor,TOrderlist lis,Esbscenicareatab pro where tor.dtstartdate='"
+ date
+ "' and tor.ddzt in('01','02','11') and tor.orfl='02' and tor.id.orid = lis.id.orid and tor.id.iscenicid=pro.iscenicid and ( lis.numb >0) group by tor.id.iscenicid ,pro.szscenicname ";
} else if ("2".equals(type)) {// ��
hsql = " select tor.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,sum(lis.numb) as numbs from TOrder tor,TOrderlist lis,Esbscenicareatab pro where substr(tor.dtstartdate,1,4)='"
+ date.substring(0, 4)
+ "' and substr(tor.dtstartdate,6,2)='"
+ date.substring(5, 7)
+ "' and tor.ddzt in('01','02','11') and tor.orfl='02' and tor.id.orid = lis.id.orid and tor.id.iscenicid=pro.iscenicid and ( lis.numb >0) group by tor.id.iscenicid ,pro.szscenicname ";
} else if ("3".equals(type)) {// ��
hsql = " select tor.id.iscenicid as iscenicid,pro.szscenicname as szscenicname,sum(lis.numb) as numbs from TOrder tor,TOrderlist lis,Esbscenicareatab pro where substr(tor.dtstartdate,1,4)='"
+ date.substring(0, 4)
+ "' and tor.ddzt in('01','02','11') and tor.orfl='02' and tor.id.orid = lis.id.orid and tor.id.iscenicid=pro.iscenicid and ( lis.numb >0) group by tor.id.iscenicid ,pro.szscenicname ";
}
list = this.find(hsql);
return list;
}
/**
* ��ѯ���ο������¡��걨������ Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQueryCustomCountByType(String type, String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
this.deleteDates(date, "2", "Rcustommonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rcustomyeartab");
}
if ("2".equals(type)) {
hsql.append("select iscenicid,szscenicname,sum(numb) from Rcustomdaytab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid,szscenicname");
} else if ("3".equals(type)) {
hsql.append("select iscenicid,szscenicname,sum(numb) from Rcustommonthtab where ryear='"
+ date.substring(0, 4)
+ "' group by iscenicid,szscenicname");
}
list = this.find(hsql.toString());
return list;
}
/**
* ����ʱ���ѯ����ƱԱ��Ʊ\��Ʊ���ݣ������ձ��� Describe:
*
* @auth:huangyuqi
* @param type
* @param cztype������ʽ
* ��01��Ʊ02��Ʊ��
* @param date
* @return return:List Date:2011-12-1
*/
public List updateOrQuerySaleCountByDate(String type, String cztype,
String date) {
if ("1".equals(type)) {
this.deleteDatesByEmpTable(date, "1", cztype, "Rsalecounttab");
} else if ("2".equals(type)) {
this.deleteDatesByEmpTable(date, "2", cztype, "Rsalecounttab");
} else if ("3".equals(type)) {
this.deleteDatesByEmpTable(date, "3", cztype, "Rsalecounttab");
}
List list = new ArrayList();
String hsql = "";
if ("1".equals(type)) {// ��
hsql = "select cop.icompanyinfoid as icompanyinfoid,cop.szcompanyname as szcompanyname,js.isettlementid as zffs,emp.empid as empid,emp.szemployeename as empname ,sum(salde.meventmoney) as mont,salde.itickettypeid as itickettypeid,sum(salde.iamount) as nums,salde.mactualsaleprice as mactualsaleprice,pri.icrowdkindid as icrowdkindid,sum(salde.mhandcharge) as mhandcharge, salde.id.iticketstationid as iticketstationid,sale.iticketwinid as iticketwinid,sale.ibusinessid as ibusinessid,sale.usid as usid,sale.iregionalid as iregionalid,sum(salde.iticketnum) as iticketplayer,nvl(sum(salde.ideratenums),0) as ideratenums,nvl(sum(salde.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale,Esfemployeetab emp,Galcompanyinfotab cop,Stssalessettlementtab js,Stssalesvoucherdetailstab salde,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,10)='"
+ date
+ "' and sale.bysalesvouchertype='"
+ cztype
+ "' and emp.iemployeeid = sale.ihandler and cop.icompanyinfoid = emp.icompanyinfoid and sale.id.isalesvoucherid = js.id.isalesvoucherid and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = js.id.iticketstationid and sale.id.iticketstationid = salde.id.iticketstationid and salde.icrowdkindpriceid = pri.icrowdkindpriceid group by cop.icompanyinfoid,cop.szcompanyname,emp.empid,emp.szemployeename,js.isettlementid,salde.itickettypeid,salde.mactualsaleprice, pri.icrowdkindid ,salde.id.iticketstationid,sale.iticketwinid,sale.ibusinessid,sale.usid,sale.iregionalid";
} else if ("2".equals(type)) {// ��
hsql = "select cop.icompanyinfoid as icompanyinfoid,cop.szcompanyname as szcompanyname,js.isettlementid as zffs,emp.empid as empid,emp.szemployeename as empname ,sum(salde.meventmoney) as mont,salde.itickettypeid as itickettypeid,sum(salde.itotalnumber) as nums,salde.mactualsaleprice as mactualsaleprice,pri.icrowdkindid as icrowdkindid,sum(salde.mhandcharge) as mhandcharge, salde.id.iticketstationid as iticketstationid,sale.iticketwinid as iticketwinid,sale.ibusinessid as ibusinessid,sale.usid as usid,sale.iregionalid as iregionalid,sum(salde.iticketnum) as iticketplayer,nvl(sum(salde.ideratenums),0) as ideratenums,nvl(sum(salde.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale,Esfemployeetab emp,Galcompanyinfotab cop,Stssalessettlementtab js,Stssalesvoucherdetailstab salde,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and substr(sale.dtmakedate,6,2)='"
+ date.substring(5, 7)
+ "' and sale.bysalesvouchertype='"
+ cztype
+ "' and emp.iemployeeid = sale.ihandler and cop.icompanyinfoid = emp.icompanyinfoid and sale.id.isalesvoucherid = js.id.isalesvoucherid and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = js.id.iticketstationid and sale.id.iticketstationid = salde.id.iticketstationid and salde.icrowdkindpriceid = pri.icrowdkindpriceid group by cop.icompanyinfoid,cop.szcompanyname,emp.empid,emp.szemployeename,js.isettlementid,salde.itickettypeid,salde.mactualsaleprice, pri.icrowdkindid,salde.id.iticketstationid ,sale.iticketwinid,sale.ibusinessid,sale.usid,sale.iregionalid ";
} else if ("3".equals(type)) {// ��
hsql = "select cop.icompanyinfoid as icompanyinfoid,cop.szcompanyname as szcompanyname,js.isettlementid as zffs,emp.empid as empid,emp.szemployeename as empname ,sum(salde.meventmoney) as mont,salde.itickettypeid as itickettypeid,sum(salde.itotalnumber) as nums,salde.mactualsaleprice as mactualsaleprice,pri.icrowdkindid as icrowdkindid,sum(salde.mhandcharge) as mhandcharge, salde.id.iticketstationid as iticketstationid,sale.iticketwinid as iticketwinid,sale.ibusinessid as ibusinessid,sale.usid as usid,sale.iregionalid as iregionalid,,sum(salde.iticketnum) as iticketplayer,nvl(sum(salde.ideratenums),0) as ideratenums,nvl(sum(salde.mderatemoney),0) as mderatemoney from Stssalesvouchertab sale,Esfemployeetab emp,Galcompanyinfotab cop,Stssalessettlementtab js,Stssalesvoucherdetailstab salde,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and sale.bysalesvouchertype='"
+ cztype
+ "' and emp.iemployeeid = sale.ihandler and cop.icompanyinfoid = emp.icompanyinfoid and sale.id.isalesvoucherid = js.id.isalesvoucherid and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = js.id.iticketstationid and sale.id.iticketstationid = salde.id.iticketstationid and salde.icrowdkindpriceid = pri.icrowdkindpriceid group by cop.icompanyinfoid,cop.szcompanyname,emp.empid,emp.szemployeename,js.isettlementid,salde.itickettypeid,salde.mactualsaleprice, pri.icrowdkindid,salde.id.iticketstationid ,sale.iticketwinid,sale.ibusinessid,sale.usid,sale.iregionalid ";
}
System.out.println("------->>>>" + hsql);
list = this.find(hsql);
return list;
}
/**
* ��ѯ����ƱԱ��Ʊ\��Ʊ�¡��걨������ Describe:
*
* @auth:huangyuqi
* @param type
* @param cztype������ʽ
* ��01��Ʊ02��Ʊ��
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQuerySaleCountByType(String type, String cztype,
String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {// ��
this.deleteDatesByEmpTable(date, "2", cztype, "Rsalecounttab");
} else if ("3".equals(type)) {// ��
this.deleteDatesByEmpTable(date, "3", cztype, "Rsalecounttab");
}
if ("2".equals(type)) {
hsql.append("select iscenicid,szscenicname,skfs,skfsname,empid,szemployeename,itickettypeid,sztickettypename,tickettype,sum(numb),sum(mont),isa,noteb,dua,sum(dub),isb,notec,isc,isd,sum(ise),isf,notee,notef,nvl(sum(due),0) as due,nvl(sum(duf),0) as duf from Rsalecounttab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' and notea='"
+ cztype
+ "' and titype='01' group by iscenicid,szscenicname,empid,szemployeename,itickettypeid,sztickettypename,tickettype,skfs,skfsname,isa,noteb,dua,isb,notec,isc,isd,isf,notee,notef ");
} else if ("3".equals(type)) {
hsql.append("select iscenicid,szscenicname,skfs,skfsname,empid,szemployeename,itickettypeid,sztickettypename,tickettype,sum(numb),sum(mont),isa,noteb,dua,sum(dub),isb,notec,isc,isd,sum(ise),isf,notee,notef,nvl(sum(due),0) as due,nvl(sum(duf),0) as duf from Rsalecounttab where ryear='"
+ date.substring(0, 4)
+ "' and notea='"
+ cztype
+ "' and titype='02' group by iscenicid,szscenicname,empid,szemployeename,itickettypeid,sztickettypename,tickettype,skfs,skfsname,isa,noteb,dua,isb,notec,isc,isd,isf,notee,notef ");
}
list = this.find(hsql.toString());
System.out.println("----emp moth sale report:" + hsql);
return list;
}
/**
* ����ʱ���ѯ����������Ʊ���ݣ������ձ��� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-1
*/
public List updateOrQueryLxsSaleByDate(String type, String date) {
if ("1".equals(type)) {
this.deleteDatesByTable(date, "1", "Rcustomgrouptab");
} else if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rcustomgrouptab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rcustomgrouptab");
}
List list = new ArrayList();
String hsql = "";
if ("1".equals(type)) {// ��
hsql = "select new map(sale.usid as usid,ti.bycategorytype as bycategorytype,sum(salde.iamount) as numb,sum(salde.meventmoney) as mont,nvl(sum(salde.mderatemoney), 0) as mderatemoney,nvl(sum(salde.ideratenums), 0) as ideratenums,price.icrowdkindid as icrowdkindid,"
+ "salde.itickettypeid as itickettypeid,sale.iscenicid as iscenicid,salde.mactualsaleprice as mactualsaleprice,saletype.isettlementid as isettlementid,sale.bysalesvouchertype as bysalesvouchertype) from Stssalesvouchertab sale,Stssalesvoucherdetailstab salde,Custom cus,Edmtickettypetab ti,Edmcrowdkindpricetab price,"
+ "Stssalessettlementtab saletype where sale.id.isalesvoucherid = saletype.id.isalesvoucherid and sale.id.iticketstationid = saletype.id.iticketstationid and price.icrowdkindpriceid = salde.icrowdkindpriceid and cus.ibusinessid != 1 and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = salde.id.iticketstationid and cus.usid = sale.usid and salde.itickettypeid = ti.itickettypeid"
+ " and substr(sale.dtmakedate,1,10)='"
+ date
+ "' group by sale.usid,ti.bycategorytype,saletype.isettlementid,salde.mactualsaleprice, sale.iscenicid,salde.itickettypeid,price.icrowdkindid,sale.bysalesvouchertype";
} else if ("2".equals(type)) {// ��
hsql = "select new map(tickettype as tickettype,ttypename as ttypename,nvl(chiefuser,' ') as chiefuser,nvl(sonuser,' ') as sonuser,nvl(grandsonuser,' ') as grandsonuser,nvl(sum(numb), 0) as numb,nvl(sum(mont), 0) as mont,nvl(sum(duf), 0) as duf,nvl(sum(isf), 0) as isf,isb as isb,isc as isc,isd as isd,dub as dub,notea as notea,noteb as noteb) from Rcustomgrouptab where ryear = '"
+ date.substring(0, 4)
+ "' and rmonth = '"
+ date.substring(5, 7)
+ "' and titype='01' group by chiefuser,sonuser,grandsonuser,isb,isc,isd,dub,notea,noteb,tickettype,ttypename)";
} else if ("3".equals(type)) {// ��
hsql = "select new map(tickettype as tickettype,ttypename as ttypename,nvl(chiefuser,' ') as chiefuser,nvl(sonuser,' ') as sonuser,nvl(grandsonuser,' ') as grandsonuser,nvl(sum(numb), 0) as numb,nvl(sum(mont), 0) as mont,nvl(sum(duf), 0) as duf,nvl(sum(isf), 0) as isf,isb as isb,isc as isc,isd as isd,dub as dub,notea as notea,noteb as noteb) from Rcustomgrouptab where ryear = '"
+ date.substring(0, 4)
+ "' and titype='02' group by chiefuser,sonuser,grandsonuser,isb,isc,isd,dub,notea,noteb,tickettype,ttypename)";
}
list = this.find(hsql);
return list;
}
/**
* ��ѯ���������Ʊ�¡��걨������ Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-16
*/
public List updateOrQueryLxsSaleByType(String type, String date) {
List list = new ArrayList();
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rcustomgrouptab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rcustomgrouptab");
}
if ("2".equals(type)) {
hsql.append("select tickettype,ttypename,chiefuser,sonuser,grandsonuser,sum(numb),sum(mont),nvl(sum(isf),0) as isf,nvl(sum(duf),0) as duf from Rcustomgrouptab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' and titype='01' group by tickettype,ttypename,chiefuser,sonuser,grandsonuser");
} else if ("3".equals(type)) {
hsql.append("select tickettype,ttypename,chiefuser,sonuser,grandsonuser,sum(numb),sum(mont),nvl(sum(isf),0) as isf,nvl(sum(duf),0) from Rcustomgrouptab where ryear='"
+ date.substring(0, 4)
+ "' and titype='02' group by tickettype,ttypename,chiefuser,sonuser,grandsonuser");
}
list = this.find(hsql.toString());
return list;
}
/**
* ��Ʊ���������ձ��� Describe:
*
* @auth:huangyuqi
* @param type��������
* ��1�գ�2�£�3�꣩
* @param date����
* @return return:List Date:2011-12-21
*/
public List updateOrquerySale(String type, String date) {
List list = new ArrayList();
if ("1".equals(type)) {
this.deleteDatesByTable(date, "1", "Rsaletickettab");
} else if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rsaletickettab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rsaletickettab");
}
String hsql = "";
if ("1".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sl.id.iticketstationid as iticketstationid,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,10)='"
+ date
+ "' and sale.bysalesvouchertype='01' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.iscenicid,sl.itickettypeid, sl.mactualsaleprice,pri.icrowdkindid,sl.id.iticketstationid";
} else if ("2".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid, sl.id.iticketstationid as iticketstationid,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and substr(sale.dtmakedate,6,2)='"
+ date.substring(5, 7)
+ "' and sale.bysalesvouchertype='01' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.iscenicid,sl.itickettypeid, sl.mactualsaleprice,pri.icrowdkindid,sl.id.iticketstationid";
} else if ("3".equals(type)) {
hsql = "select sale.iscenicid as iscenicid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as numb,sum(sl.meventmoney) as mont,sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid, sl.id.iticketstationid as iticketstationid,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and sale.bysalesvouchertype='01' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.iscenicid,sl.itickettypeid, sl.mactualsaleprice,pri.icrowdkindid,sl.id.iticketstationid";
}
list = this.find(hsql);
return list;
}
/**
* ��Ʊ�¡��걨�� Describe:
*
* @auth:huangyuqi
* @param type��������
* ��2�£�3�꣩
* @param date����
* @return return:List Date:2011-12-21
*/
public List updateOrquerySalebyType(String type, String date) {
List list = new ArrayList();
if ("2".equals(type)) {
this.deleteDatesByTable(date, "2", "Rsaletickettab");
} else if ("3".equals(type)) {
this.deleteDatesByTable(date, "3", "Rsaletickettab");
}
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
hsql.append("select iscenicid,szscenicname,itickettypeid,sztickettypename,sum(numb),sum(mont),isa,notea,dua,isb,noteb,nvl(sum(isf),0) as isf,nvl(sum(duf),0) as duf from Rsaletickettab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' and titype='01' group by iscenicid,szscenicname,itickettypeid,sztickettypename,isa,notea,dua,isb,noteb ");
} else if ("3".equals(type)) {
hsql.append("select iscenicid,szscenicname,itickettypeid,sztickettypename,sum(numb),sum(mont),isa,notea,dua,isb,noteb,nvl(sum(isf),0) as isf,nvl(sum(duf),0) as duf from Rsaletickettab where ryear='"
+ date.substring(0, 4)
+ "' and titype='02' group by iscenicid,szscenicname,itickettypeid,sztickettypename,isa,notea,dua,isb,noteb ");
}
list = this.find(hsql.toString());
return list;
}
/**
* ���ۻ��ܣ�����Ʒ��������ɢ�ͣ����壨ÿ��) Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-30
*/
public List updateOrQueryTicketSale(String type, String date) {
List list = new ArrayList();
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rticketdaytab");
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rticketmonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rticketyeartab");
}
StringBuffer hsql = new StringBuffer();
if ("1".equals(type)) {
hsql.append(" select sale.ibusinessid as ibusinessid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,10)='"
+ date
+ "' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.ibusinessid,sl.itickettypeid,sl.mactualsaleprice, pri.icrowdkindid,sale.bysalesvouchertype,sl.icrowdkindpriceid,pri.mactualsaleprice");
} else if ("2".equals(type)) {
hsql.append(" select sale.ibusinessid as ibusinessid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and substr(sale.dtmakedate,6,2)='"
+ date.substring(5, 7)
+ "' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.ibusinessid,sl.itickettypeid,sl.mactualsaleprice, pri.icrowdkindid,sale.bysalesvouchertype,sl.icrowdkindpriceid,pri.mactualsaleprice");
} else if ("3".equals(type)) {
hsql.append(" select sale.ibusinessid as ibusinessid,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.ibusinessid,sl.itickettypeid,sl.mactualsaleprice, pri.icrowdkindid,sale.bysalesvouchertype,sl.icrowdkindpriceid,pri.mactualsaleprice");
}
list = this.find(hsql.toString());
return list;
}
/**
* ���۱����¡��걨�� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-30
*/
public List updateOrQueryTicketSaleByType(String type, String date) {
List list = new ArrayList();
if ("2".equals(type)) {
this.deleteDates(date, "2", "Rticketmonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rticketyeartab");
}
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
hsql.append(" select r.itickettypeid,r.sztickettypename,r.tickettype,r.isa,r.notea,sum(r.numb),sum(r.mont),isb,noteb,dua,notec,isc,isd,nvl(sum(isf),0) as isf,nvl(sum(duf),0) as duf from Rticketdaytab r where r.rmonth='"
+ date.substring(5, 7)
+ "' and r.ryear='"
+ date.substring(0, 4)
+ "' group by r.itickettypeid,r.sztickettypename,r.tickettype,r.isa,r.notea,isb,noteb,dua,notec,isc,isd");
} else if ("3".equals(type)) {
hsql.append(" select r.itickettypeid,r.sztickettypename,r.tickettype,r.isa,r.notea,sum(r.numb),sum(r.mont),isb,noteb,dua,notec,isc,isd,nvl(sum(isf),0) as isf,nvl(sum(duf),0) as duf from Rticketmonthtab r where r.ryear='"
+ date.substring(0, 4)
+ "' group by r.itickettypeid,r.sztickettypename,r.tickettype,r.isa,r.notea,isb,noteb,dua,notec,isc,isd ");
}
list = this.find(hsql.toString());
return list;
}
/**
* ǰ̨�������������۱����������ձ��� Describe:
*
* @auth:���ۺ��˶� ���ÿ�������������
* @param type
* @param date
* @return return:List Date:2011-12-31
*/
public List updateOrQueryCusGroupSale(String type, String date) {
List list = new ArrayList();
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rcgroupsaledaytab");
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rcgroupsalemonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rcgroupsaleyeartab");
}
StringBuffer hsql = new StringBuffer();
StringBuffer hsql2 = new StringBuffer();
if ("1".equals(type)) {
hsql.append(" select sale.usid as usid ,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sale.ibusinessid as ibusinessid,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums,st.isettlementid as zffs,nvl(sum(sl.mhandcharge),0) as mhandcharge,sale.iscenicid as iscenicid from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Stssalessettlementtab st,Custom cust,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,10)='"
+ date
+ "' and sale.bysalesvouchertype in ('01','02','04') and sale.ibusinessid!=1 and cust.usid = sale.usid and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sale.id.isalesvoucherid = st.id.isalesvoucherid and sale.id.iticketstationid = st.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.usid,sl.itickettypeid,sl.mactualsaleprice,pri.icrowdkindid,sale.bysalesvouchertype,sale.ibusinessid,sl.icrowdkindpriceid,pri.mactualsaleprice,st.isettlementid,sale.iscenicid");
hsql2.append("select y.usid as usid,yl.itickettypeid as iztickettypeid,0 as iticketnum,0 as mont,yl.pric as mactualsaleprice,yl.icrowdkindid as icrowdkindid,'02' as bysalesvouchertype,c.ibusinessid as ibusinessid,yl.icrowdkindpriceid as icrowdkindpriceid,yl.pric as pric,0 as mderatemoney,0 as ideratenums,y.zffs as zffs,sum(yl.mhandcharge) as mhandcharge,yl.id.iscenicid as iscenicid from MOrder y ,YOrderlist yl,Custom c where y.orda='"
+ date
+ "' and ddzt='06' and y.orid=yl.id.orid and y.usid=c.usid and yl.mhandcharge>0 and y.ortp='02' and y.tpfs='02' group by y.usid,yl.itickettypeid,yl.pric,yl.icrowdkindid,c.ibusinessid,yl.icrowdkindpriceid,y.zffs,yl.id.iscenicid");
} else if ("2".equals(type)) {
hsql.append(" select sale.usid as usid ,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sale.ibusinessid as ibusinessid,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums,st.isettlementid as zffs,nvl(sum(sl.mhandcharge),0) as mhandcharge,sale.iscenicid as iscenicid from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Stssalessettlementtab st,Custom cust,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,7)='"
+ date.substring(1, 7)
+ "' and sale.bysalesvouchertype in ('01','02','04') and sale.ibusinessid!=1 and cust.usid = sale.usid and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sale.id.isalesvoucherid = st.id.isalesvoucherid and sale.id.iticketstationid = st.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.usid,sl.itickettypeid,sl.mactualsaleprice,pri.icrowdkindid,sale.bysalesvouchertype,sale.ibusinessid,sl.icrowdkindpriceid,pri.mactualsaleprice,st.isettlementid,sale.iscenicid");
hsql2.append("select y.usid as usid,yl.itickettypeid as iztickettypeid,0 as iticketnum,0 as mont,yl.pric as mactualsaleprice,yl.icrowdkindid as icrowdkindid,'02' as bysalesvouchertype,c.ibusinessid as ibusinessid,yl.icrowdkindpriceid as icrowdkindpriceid,yl.pric as pric,0 as mderatemoney,0 as ideratenums,y.zffs as zffs,sum(yl.mhandcharge) as mhandcharge,yl.id.iscenicid as iscenicid from MOrder y ,YOrderlist yl,Custom c where substr(y.orda,1,7)='"
+ date.substring(1, 7)
+ "' and ddzt='06' and y.orid=yl.id.orid and y.usid=c.usid and yl.mhandcharge>0 and y.ortp='02' and y.tpfs='02' group by y.usid,yl.itickettypeid,yl.pric,yl.icrowdkindid,c.ibusinessid,yl.icrowdkindpriceid,y.zffs,yl.id.iscenicid");
} else if ("3".equals(type)) {
hsql.append(" select sale.usid as usid ,sl.itickettypeid as itickettypeid,sum(sl.iamount) as iticketnum, sum(sl.meventmoney) as mont, sl.mactualsaleprice as mactualsaleprice, pri.icrowdkindid as icrowdkindid,sale.bysalesvouchertype as bysalesvouchertype,sale.ibusinessid as ibusinessid,sl.icrowdkindpriceid as icrowdkindpriceid,pri.mactualsaleprice as price,nvl(sum(sl.mderatemoney),0) as mderatemoney,nvl(sum(sl.ideratenums),0) as ideratenums,st.isettlementid as zffs,nvl(sum(sl.mhandcharge),0) as mhandcharge,sale.iscenicid as iscenicid from Stssalesvouchertab sale,Stssalesvoucherdetailstab sl,Stssalessettlementtab st,Custom cust,Edmcrowdkindpricetab pri where substr(sale.dtmakedate,1,4)='"
+ date.substring(0, 4)
+ "' and sale.bysalesvouchertype in ('01','02','04') and sale.ibusinessid!=1 and cust.usid = sale.usid and sale.id.isalesvoucherid = sl.id.isalesvoucherid and sale.id.iticketstationid = sl.id.iticketstationid and sale.id.isalesvoucherid = st.id.isalesvoucherid and sale.id.iticketstationid = st.id.iticketstationid and sl.icrowdkindpriceid = pri.icrowdkindpriceid group by sale.usid,sl.itickettypeid,sl.mactualsaleprice,pri.icrowdkindid,sale.bysalesvouchertype,sale.ibusinessid,sl.icrowdkindpriceid,pri.mactualsaleprice,st.isettlementid,sale.iscenicid");
hsql2.append("select y.usid as usid,yl.itickettypeid as iztickettypeid,0 as iticketnum,0 as mont,yl.pric as mactualsaleprice,yl.icrowdkindid as icrowdkindid,'02' as bysalesvouchertype,c.ibusinessid as ibusinessid,yl.icrowdkindpriceid as icrowdkindpriceid,yl.pric as pric,0 as mderatemoney,0 as ideratenums,y.zffs as zffs,sum(yl.mhandcharge) as mhandcharge,yl.id.iscenicid as iscenicid from MOrder y ,YOrderlist yl,Custom c where substr(y.orda,1,4)=='"
+ date.substring(0, 4)
+ "' and ddzt='06' and y.orid=yl.id.orid and y.usid=c.usid and yl.mhandcharge>0 and y.ortp='02' and y.tpfs='02' group by y.usid,yl.itickettypeid,yl.pric,yl.icrowdkindid,c.ibusinessid,yl.icrowdkindpriceid,y.zffs,yl.id.iscenicid");
}
list = this.find(hsql.toString());
List list2 = new ArrayList();
list2 = this.find(hsql2.toString());
for (int i = 0; i < list2.size(); i++) {
list.add(list2.get(i));
}
return list;
}
/**
* ǰ̨�������������۱����������£��걨�� Describe:
*
* @auth:huangyuqi
* @param type
* @param date
* @return return:List Date:2011-12-31
*/
public List updateOrQueryCusGroupSaleByType(String type, String date) {
List list = new ArrayList();
if ("1".equals(type)) {
this.deleteDates(date, "1", "Rcgroupsaledaytab");
} else if ("2".equals(type)) {
this.deleteDates(date, "2", "Rcgroupsalemonthtab");
} else if ("3".equals(type)) {
this.deleteDates(date, "3", "Rcgroupsaleyeartab");
}
StringBuffer hsql = new StringBuffer();
if ("2".equals(type)) {
hsql.append(" select r.itickettypeid,r.sztickettypename,r.usid,r.corpname,sum(r.numb),sum(r.mont),r.isa,r.notea,r.dua,r.noteb,r.isb,r.isc,r.isd,nvl(sum(r.isf),0) as isf,nvl(sum(r.duf),0) as duf,r.notec as notec,sum(due) as due from Rcgroupsaledaytab r where r.rmonth='"
+ date.substring(5, 7)
+ "' and r.ryear='"
+ date.substring(0, 4)
+ "' group by r.itickettypeid,r.sztickettypename,r.usid,r.corpname,r.isa,r.notea,r.dua,r.noteb,r.isb,r.isc,r.duc,r.isd ,r.notec ");
} else if ("3".equals(type)) {
hsql.append(" select r.itickettypeid,r.sztickettypename,r.usid,r.corpname,sum(r.numb),sum(r.mont),r.isa,r.notea,r.dua,r.noteb,r.isb,r.isc,r.isd,nvl(sum(r.isf),0) as isf,nvl(sum(r.duf),0) as duf,r.notec as notec,sum(due) as due from Rcgroupsalemonthtab r where r.ryear='"
+ date.substring(0, 4)
+ "' group by r.itickettypeid,r.sztickettypename,r.usid,r.corpname,r.isa,r.notea,r.dua,r.noteb,r.isb,r.isc,r.isd,r.notec ");
}
list = this.find(hsql.toString());
return list;
}
/**
* ɾ������ Describe:
*
* @auth:huangyuqi
* @param date����
* @param typeʱ������
* @param table����
* return:void Date:2011-12-15
*/
public void deleteDates(String date, String type, String table) {
System.out.println("����ɾ����������� ");
StringBuffer hsql = new StringBuffer();
hsql.append(" from " + table + " where ");
if ("1".equals(type)) {
hsql.append(" rdate='" + date.substring(8, 10) + "' and rmonth='"
+ date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "'");
} else if ("2".equals(type)) {
hsql.append(" rmonth='" + date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "' ");
} else if ("3".equals(type)) {
hsql.append(" ryear='" + date.substring(0, 4) + "' ");
}
System.out.println(hsql.toString());
List list = this.find(hsql.toString());
if (list != null && list.size() >= 1) {
for (int i = 0; i < list.size(); i++) {
Object a = (Object) list.get(i);
this.delete(a);
}
// this.deleteAll(list);
}
}
/**
* ɾ�����ϱ����� Describe:
*
* @auth:huangyuqi
* @param date����
* @param typeʱ������
* @param table����
* return:void Date:2011-12-15
*/
public void deleteDatesByTable(String date, String type, String table) {
StringBuffer hsql = new StringBuffer();
hsql.append(" from " + table + " where ");
if ("1".equals(type)) {
hsql.append(" rdate='" + date.substring(8, 10) + "' and rmonth='"
+ date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "' and titype='01' ");
} else if ("2".equals(type)) {
hsql.append(" rmonth='" + date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "' and titype='02' ");
} else if ("3".equals(type)) {
hsql.append(" ryear='" + date.substring(0, 4)
+ "' and titype='03' ");
}
List list = this.find(hsql.toString());
if (list != null && list.size() >= 1) {
for (int i = 0; i < list.size(); i++) {
Object a = (Object) list.get(i);
this.delete(a);
}
// this.deleteAll(list);
}
}
/**
* ɾ����ƱԱ����Ʊ������ Describe:
*
* @auth:huangyuqi
* @param date����
* @param typeʱ������
* @param table����
* return:void Date:2011-12-15
*/
public void deleteDatesByEmpTable(String date, String type,
String saletype, String table) {
StringBuffer hsql = new StringBuffer();
hsql.append(" from " + table + " where ");
if ("1".equals(type)) {
hsql.append(" rdate='" + date.substring(8, 10) + "' and rmonth='"
+ date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "' and titype='01' and notea='"
+ saletype + "' ");
} else if ("2".equals(type)) {
hsql.append(" rmonth='" + date.substring(5, 7) + "' and ryear ='"
+ date.substring(0, 4) + "' and titype='02' and notea='"
+ saletype + "' ");
} else if ("3".equals(type)) {
hsql.append(" ryear='" + date.substring(0, 4)
+ "' and titype='03' and notea='" + saletype + "' ");
}
List list = this.find(hsql.toString());
if (list != null && list.size() >= 1) {
for (int i = 0; i < list.size(); i++) {
Object a = (Object) list.get(i);
this.delete(a);
}
// this.deleteAll(list);
}
}
/**
* * Describe:�������ڲ�ѯ��ʾ�������IJֿ���Ϣ
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showAllHouseware(java.lang.String,
* java.lang.Long)
* @param statdate����
* @param type
* �������� �ձ���1 �±���2 �����걨��3
* @return
* @author lijingrui Date:2012-8-27
*/
public List showAllHouseware(String statdate, Long type, Long sign) {
StringBuffer sql = new StringBuffer();
if (sign != null && sign == 1L) {
sql.append("select distinct ware.iwarehouseid as iwarehouseid,ware.szwarehousename as szwarehousename from Iomwarehouse ware,Iomstocksbill st where (ware.iwarehouseid=st.istationinid or ware.iwarehouseid=st.istationoutid) ");
} else if (sign != null && sign == 2L) {
sql.append("select distinct ware.iwarehouseid as iwarehouseid,ware.szwarehousename as szwarehousename from Iomwarehouse ware,Kcstocksbilltab st where (ware.iwarehouseid=st.istationinid or ware.iwarehouseid=st.istationoutid) ");
}
if (type != null && type == 1L) {
sql.append(" and substr(st.szstocksbillcode,1,8)='" + statdate
+ "' ");
} else if (type == 2L) {
sql.append(" and substr(st.szstocksbillcode,1,6)='" + statdate
+ "' ");
} else if (type == 3L) {
sql.append(" and substr(st.szstocksbillcode,1,4)='" + statdate
+ "' ");
}
List lst = this.find(sql.toString());
if (lst != null && lst.size() > 0) {
return lst;
} else {
return null;
}
}
/**
* * Describe:�����������ij�ֿ���������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showIamoutcheckin(java.lang.Long,
* java.lang.String, java.lang.Long)
* @param iwarehouseid
* �ֿ�ID
* @param statdate
* ����
* @param type
* �������� �ձ���1 �±���2 �����걨��3
* @param sign
* Ʊ���� 1��Ԥ��Ʊ�� 2��IC��
* @return
* @author lijingrui Date:2012-8-27
*/
public List showIamoutcheckin(Long iwarehouseid, String statdate,
Long type, Long sign) {
StringBuffer sql = new StringBuffer();
if (sign != null && sign == 1L) {
sql.append("select st.istationinid as istationinid,sd.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename,sum(sd.iamount) as iamount from Iomstocksbill st,Iomstocksbilldetails sd,Edmtickettypetab edm where sd.itickettypeid=edm.itickettypeid and st.szstocksbillid=sd.szstocksbillid and st.bystockswayid in (1,3,5) and st.istationinid="
+ iwarehouseid);
} else if (sign != null && sign == 2L) {
sql.append("select st.istationinid as istationinid,sd.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename,sum(sd.iamount) as iamount from Kcstocksbilltab st,Kcstocksbilldetailstab sd,Edmtickettypetab edm where sd.itickettypeid=edm.itickettypeid and st.szstocksbillid=sd.szstocksbillid and st.bystockswayid in (1,3,5) and st.istationinid="
+ iwarehouseid);
}
if (type != null && type == 1L) {
sql.append(" and substr(st.szstocksbillcode,1,8)='" + statdate
+ "' ");
} else if (type == 2L) {
sql.append(" and substr(st.szstocksbillcode,1,6)='" + statdate
+ "' ");
} else if (type == 3L) {
sql.append(" and substr(st.szstocksbillcode,1,4)='" + statdate
+ "' ");
}
sql.append("group by st.istationinid,sd.itickettypeid,edm.sztickettypename");
List lst = this.find(sql.toString());
if (lst != null && lst.size() > 0) {
return lst;
} else {
return null;
}
}
/**
* * Describe:�����������ij�ֿ�ij�������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showIamoutcheckOut(java.lang.Long,
* java.lang.String, java.lang.Long)
* @param iwarehouseid
* �ֿ�ID
* @param statdate
* ����
* @param type
* �������� �ձ���1 �±���2 �����걨��3
* @param sign
* Ʊ���� 1��Ԥ��Ʊ�� 2��IC��
* @return
* @author lijingrui Date:2012-8-27
*/
public List showIamoutcheckOut(Long iwarehouseid, String statdate,
Long type, Long sign) {
StringBuffer sql = new StringBuffer();
if (sign != null && sign == 1L) {
sql.append("select sum(sd.iamount) as iamount,sd.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Iomstocksbill st,Iomstocksbilldetails sd,Edmtickettypetab edm where sd.itickettypeid=edm.itickettypeid and st.szstocksbillid=sd.szstocksbillid and st.bystockswayid in (4,3,6) and st.istationoutid="
+ iwarehouseid);
} else if (sign != null && sign == 2L) {
sql.append("select sum(sd.iamount) as iamount,sd.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Kcstocksbilltab st,Kcstocksbilldetailstab sd,Edmtickettypetab edm where sd.itickettypeid=edm.itickettypeid and st.szstocksbillid=sd.szstocksbillid and st.bystockswayid in (4,3,6) and st.istationoutid="
+ iwarehouseid);
}
if (type != null && type == 1L) {
sql.append(" and substr(st.szstocksbillcode,1,8)='" + statdate
+ "' ");
} else if (type == 2L) {
sql.append(" and substr(st.szstocksbillcode,1,6)='" + statdate
+ "' ");
} else if (type == 3L) {
sql.append(" and substr(st.szstocksbillcode,1,4)='" + statdate
+ "' ");
}
sql.append(" group by sd.itickettypeid,edm.sztickettypename ");
List lst = this.find(sql.toString());
if (lst != null && lst.size() > 0) {
return lst;
} else {
return null;
}
}
/**
* * Describe:�������ڲ�ѯ����ĩ��������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#checkRecenterout(java.lang.String,
* java.lang.Long)
* @param statdate
* @param type
* @param sign
* Ʊ���� 1��Ԥ��Ʊ�� 2��IC��
* @return
* @author lijingrui Date:2012-8-28
*/
public Long checkRecenterout(Long iwarehouseid, Long itickettypeid,
String statdate, Long type, Long sign) {
StringBuffer sql = new StringBuffer();
if (type != null && type == 1L) {
sql.append("select endremain from Rwswarehouseday where itickettypeid="
+ itickettypeid
+ " and iwarehouseid="
+ iwarehouseid
+ " and int1=" + sign + " order by statdate desc ");
} else if (type == 2L) {
sql.append("select endremain from Rwswarehousemonth where itickettypeid="
+ itickettypeid
+ " and iwarehouseid="
+ iwarehouseid
+ " and int1=" + sign + " order by statdate desc ");
} else if (type == 3L) {
sql.append("select endremain from Rwswarehouseyear where itickettypeid="
+ itickettypeid
+ " and iwarehouseid="
+ iwarehouseid
+ " and int1=" + sign + " order by statdate desc ");
}
List list = this.find(sql.toString());
if (list != null && list.size() > 0) {
Long endremain = (Long) list.get(0);
return endremain;
} else {
return null;
}
}
/**
* * Describe:�ж�ij���Ƿ�������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#checkRwswarehouse(java.lang.String,
* java.lang.Long)
* @param statdate
* @param type
* @param sign
* Ʊ���� 1��Ԥ��Ʊ�� 2��IC��
* @return
* @author lijingrui Date:2012-8-28
*/
public List checkRwswarehouse(String statdate, Long type, Long sign) {
StringBuffer sql = new StringBuffer();
if (type != null && type == 1L) {
sql.append(" from Rwswarehouseday where statdate="
+ Long.parseLong(statdate) + " and int1=" + sign);
} else if (type == 2L) {
sql.append(" from Rwswarehousemonth where statdate="
+ Long.parseLong(statdate) + " and int1=" + sign);
} else if (type == 3L) {
sql.append(" from Rwswarehouseyear where statdate="
+ Long.parseLong(statdate) + " and int1=" + sign);
}
List list = this.find(sql.toString());
if (list != null && list.size() > 0) {
return list;
} else {
return null;
}
}
/**
* * Describe:��ʾ��ij�����ó������ƱԱ
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showEmployeetab(java.lang.String)
* @param statdate
* @return
* @author lijingrui Date:2012-8-29
*/
public List showEmployeetab(String statdate, Long sign) {
String date = statdate.replaceAll("-", "");
String hsql = " from Rwspersonalday where statdate="
+ Long.parseLong(date) + " and int2=" + sign;
List list = this.find(hsql);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
Rwspersonalday rwsperson = (Rwspersonalday) list.get(i);
this.delete(rwsperson);
}
}
String msql = null;
if (sign != null && sign == 1L) {
// msql=" select distinct esf.iemployeeid,esf.szemployeename,stk.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Iompersonalticketdetails stk,Esfemployeetab esf,Edmtickettypetab edm where esf.iemployeeid=stk.ireceiverid and edm.itickettypeid=stk.itickettypeid";
// msql =
// "select distinct esf.iemployeeid,esf.szemployeename,std.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Iomstocksbill st,Iomstocksbilldetails std,Esfemployeetab esf,Edmtickettypetab edm where st.szstocksbillid=std.szstocksbillid and st.ihandler=esf.iemployeeid and std.itickettypeid=edm.itickettypeid and st.bystockswayid in (5,6) and substr(st.szstocksbillcode,1,8)='"+
// statdate+"'";
msql = "select esf.iemployeeid as iemployeeid,dp.id.empid as empid, dp.id.empname as empname,sum(dp.id.nums) as nums,dp.id.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Deasplitsalecount dp,Edmtickettypetab edm,Esfemployeetab esf where dp.id.empid=esf.empid and dp.id.itickettypeid=edm.itickettypeid and edm.bymaketicketway='01' and edm.bymediatype in ('00','01') and substr(dp.id.dtmakedate,1,10) = '"
+ statdate
+ "' group by esf.iemployeeid,dp.id.empid, dp.id.empname,dp.id.itickettypeid,edm.sztickettypename ";
} else if (sign != null && sign == 2L) {
// msql=" select distinct esf.iemployeeid,esf.szemployeename,stk.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Kcpersonalticketdetailstab stk,Esfemployeetab esf,Edmtickettypetab edm where esf.iemployeeid=stk.ireceiverid and edm.itickettypeid=stk.itickettypeid";
// msql =
// " select distinct esf.iemployeeid,esf.szemployeename,std.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Kcstocksbilltab st,Kcstocksbilldetailstab std,Esfemployeetab esf,Edmtickettypetab edm where st.szstocksbillid=std.szstocksbillid and st.ihandler=esf.iemployeeid and std.itickettypeid=edm.itickettypeid and st.bystockswayid in (5,6) and substr(st.szstocksbillcode,1,8)='"+
// statdate+"'";
msql = "select esf.iemployeeid as iemployeeid,dp.id.empid as empid, dp.id.empname as empname,sum(dp.id.nums) as nums,dp.id.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Deasplitsalecount dp,Edmtickettypetab edm,Esfemployeetab esf where dp.id.empid=esf.empid and dp.id.itickettypeid=edm.itickettypeid and edm.bymaketicketway='01' and edm.bymediatype not in ('00','01') and substr(dp.id.dtmakedate,1,10) = '"
+ statdate
+ "' group by esf.iemployeeid,dp.id.empid, dp.id.empname,dp.id.itickettypeid,edm.sztickettypename ";
}
List lst = this.find(msql);
if (lst != null && lst.size() > 0) {
return lst;
} else {
msql = null;
if (sign != null && sign == 1L) {
// msql=" select distinct esf.iemployeeid,esf.szemployeename,stk.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Iompersonalticketdetails stk,Esfemployeetab esf,Edmtickettypetab edm where esf.iemployeeid=stk.ireceiverid and edm.itickettypeid=stk.itickettypeid";
msql = "select distinct esf.iemployeeid,esf.empid as empid,esf.szemployeename,0 as nums, std.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Iomstocksbill st,Iomstocksbilldetails std,Esfemployeetab esf,Edmtickettypetab edm where st.szstocksbillid=std.szstocksbillid and st.ihandler=esf.iemployeeid and std.itickettypeid=edm.itickettypeid and st.bystockswayid in (5,6) and substr(st.szstocksbillcode,1,8)='"
+ statdate + "'";
} else if (sign != null && sign == 2L) {
// msql=" select distinct esf.iemployeeid,esf.szemployeename,stk.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Kcpersonalticketdetailstab stk,Esfemployeetab esf,Edmtickettypetab edm where esf.iemployeeid=stk.ireceiverid and edm.itickettypeid=stk.itickettypeid";
msql = " select distinct esf.iemployeeid,esf.empid as empid,esf.szemployeename,0 as nums,std.itickettypeid as itickettypeid,edm.sztickettypename as sztickettypename from Kcstocksbilltab st,Kcstocksbilldetailstab std,Esfemployeetab esf,Edmtickettypetab edm where st.szstocksbillid=std.szstocksbillid and st.ihandler=esf.iemployeeid and std.itickettypeid=edm.itickettypeid and st.bystockswayid in (5,6) and substr(st.szstocksbillcode,1,8)='"
+ statdate + "'";
}
lst = this.find(msql);
return lst;
}
}
/**
* * Describe:��ʾ��ij�����ó�����ƱԱ���õ�����
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showEmpidIamount(java.lang.Long,
* java.lang.String)
* @param epmpid
* @param statdate
* @return
* @author lijingrui Date:2012-8-29
*/
public Long showEmpidIamount(Long epmpid, Long itickettypeid,
String statdate, Long sign) {
String sql = null;
if (sign != null && sign == 1L) {
sql = "select sum(sd.iamount) as iamount from Iomstocksbill stk,Iomstocksbilldetails sd,Edmtickettypetab edm where edm.itickettypeid=sd.itickettypeid and sd.szstocksbillid=stk.szstocksbillid and stk.bystockswayid=6 and stk.ihandler="
+ epmpid
+ " and substr(stk.szstocksbillcode,1,8)='"
+ statdate
+ "' and sd.itickettypeid="
+ itickettypeid
+ " group by sd.itickettypeid,edm.sztickettypename";
} else if (sign != null && sign == 2L) {
sql = "select sum(sd.iamount) as iamount from Kcstocksbilltab stk,Kcstocksbilldetailstab sd,Edmtickettypetab edm where edm.itickettypeid=sd.itickettypeid and sd.szstocksbillid=stk.szstocksbillid and stk.bystockswayid=6 and stk.ihandler="
+ epmpid
+ " and substr(stk.szstocksbillcode,1,8)='"
+ statdate
+ "' and sd.itickettypeid="
+ itickettypeid
+ " group by sd.itickettypeid,edm.sztickettypename";
}
List lst = this.find(sql);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long iamount = (Long) lst.get(0);
if (iamount == null) {
return 0L;
}
return iamount;
}
}
return 0L;
}
/**
* * Describe:��ʾ����ƱԱij����Ʊ������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showIompersonhouse(java.lang.Long,
* java.lang.Long, java.lang.String)
* @param epmpid
* @param itickettypeid
* @param statdate
* @return
* @author lijingrui Date:2012-8-29
*/
public Long showIompersonhouse(Long epmpid, Long itickettypeid,
String statdate, Long sign) {
String sql = sql = "select sum(salde.iticketnum) as nums from Stssalesvouchertab sale,Stssalesvoucherdetailstab salde where substr(sale.dtmakedate, 1, 10) = '"
+ statdate
+ "' and sale.bysalesvouchertype in ( '01' ,'04') and sale.ihandler="
+ epmpid
+ " and salde.itickettypeid="
+ itickettypeid
+ " and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = salde.id.iticketstationid ";
List lst = this.find(sql);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long iamount = (Long) lst.get(0);
if (iamount == null) {
return 0L;
}
return iamount;
}
}
return 0L;
}
/**
* * Describe:��ʾ����ƱԱij����Ʊ������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#checkUpnumsHouse(java.lang.Long,
* java.lang.Long, java.lang.String)
* @param epmpid
* @param itickettypeid
* @param statdate
* @return
* @author lijingrui Date:2012-11-15
*/
public Long checkUpnumsHouse(Long epmpid, Long itickettypeid,
String statdate) {
String sql = sql = "select sum(salde.iticketnum) as nums from Stssalesvouchertab sale,Stssalesvoucherdetailstab salde where substr(sale.dtmakedate, 1, 10) = '"
+ statdate
+ "' and sale.bysalesvouchertype='02' and sale.ihandler="
+ epmpid
+ " and salde.itickettypeid="
+ itickettypeid
+ " and sale.id.isalesvoucherid = salde.id.isalesvoucherid and sale.id.iticketstationid = salde.id.iticketstationid";
List lst = this.find(sql);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long iamount = (Long) lst.get(0);
if (iamount == null) {
return 0L;
}
return iamount;
}
}
return 0L;
}
/**
* * Describe:�������ڲ����ƱԱ��Ʊ��������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showStockhouse(java.lang.Long,
* java.lang.Long, java.lang.String, java.lang.Long)
* @param epmpid
* @param itickettypeid
* @param statdate
* @param sign
* @return
* @author lijingrui Date:2012-10-30
*/
public Long showStockhouse(Long epmpid, Long itickettypeid,
String statdate, Long sign) {
String sql = null;
if (sign != null && sign == 1L) {
sql = "select sum(sd.iamount) as iamount from Iomstocksbill stk,Iomstocksbilldetails sd where sd.szstocksbillid=stk.szstocksbillid and stk.bystockswayid=5 and stk.ihandler="
+ epmpid
+ " and substr(stk.szstocksbillcode,1,8)='"
+ statdate + "' and sd.itickettypeid=" + itickettypeid;
} else if (sign != null && sign == 2L) {
sql = "select sum(sd.iamount) as iamount from Kcstocksbilltab stk,Kcstocksbilldetailstab sd where sd.szstocksbillid=stk.szstocksbillid and stk.bystockswayid=5 and stk.ihandler="
+ epmpid
+ " and substr(stk.szstocksbillcode,1,8)='"
+ statdate + "' and sd.itickettypeid=" + itickettypeid;
}
List lst = this.find(sql);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long iamouint = (Long) lst.get(0);
if (iamouint == null) {
return 0L;
}
return iamouint;
}
}
return 0L;
}
/**
* * Describe:��������\��ƱԱ��ѯ����ĩ��������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#showRwspersonal(java.lang.Long,
* java.lang.Long, java.lang.String)
* @param epmpid
* @param itickettypeid
* @param statdate
* @return
* @author lijingrui Date:2012-8-29
*/
public Long showRwspersonal(Long epmpid, Long itickettypeid,
String statdate, Long sign) {
String sql = "select psn.endremain as endremain from Rwspersonalday psn where psn.personalid="
+ epmpid
+ " and psn.itickettypeid="
+ itickettypeid
+ " and psn.statdate<="
+ statdate
+ " and psn.int2="
+ sign
+ " order by psn.statdate desc";
List lst = this.findTopNumb(sql, 1);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long endremain = (Long) lst.get(0);
if (endremain != null) {
return endremain;
}
}
}
return 0L;
}
/**
* * Describe:��ѯ����ƱԱ����ʣ��Ԥ��Ʊ������
*
* @see com.ectrip.report.system.datereport.dao.idao.IReportDataDAO#searchPersonDetails(java.lang.Long,
* java.lang.Long)
* @param epmpid
* @param itickettypeid
* @return
* @author lijingrui Date:2012-11-15
*/
public Long searchPersonDetails(Long epmpid, Long itickettypeid, Long sign) {
String sql = null;
if (sign != null && sign == 1L) {
sql = "select sum(ps.iamount) as iamount from Iompersonalticketdetails ps where ps.ireceiverid="
+ epmpid + " and ps.itickettypeid=" + itickettypeid;
} else if (sign != null && sign == 2L) {
sql = "select sum(ps.iamount) as iamount from Kcpersonalticketdetailstab ps where ps.ireceiverid="
+ epmpid + " and ps.itickettypeid=" + itickettypeid;
}
List lst = this.find(sql);
if (lst != null && lst.size() > 0) {
if (lst.get(0) == null) {
return 0L;
} else {
Long iamouint = (Long) lst.get(0);
if (iamouint == null) {
return 0L;
}
return iamouint;
}
}
return 0L;
}
/**
* ����ʱ���ѯ���������ս����� Describe:
*
* @auth:huangyuqi
* @param date
* @return return:List Date:2011-11-30
*/
public List updateOrQueryZProviderByDate(String type, String date) {
this.deleteDatesByTable(date, type, "Rpzprovidertab");// �ս�
List list = new ArrayList();
String hsql = "";
if ("1".equals(type)) {
hsql = "select et.iscenicid as iscenicid,sale.bysalesvouchertype as bysalesvouchertype,sale.ibusinessid,sm.isettlementid as isettlementid,sum(sl.isplitamount) as numb,nvl(sum(sl.ideratenums),0) as ideratenums,sum(sl.msplitmoney) as mont,nvl(sum(sl.mderatemoney),0) as mderatemoney,sum(sl.mhandcharge) as mhandcharge from Stssalesvouchertab sale,Stssalessettlementtab sm,Stscomticketsalesdetailstab sl,Edmtickettypetab et where substr(sale.dtmakedate, 1, 10) = '"
+ date
+ "' and sm.id.iticketstationid=sale.id.iticketstationid and sm.id.isalesvoucherid = sale.id.isalesvoucherid and sl.id.isalesvoucherid = sale.id.isalesvoucherid and sale.id.iticketstationid=sl.id.iticketstationid and et.itickettypeid=sl.iztickettypeid group by et.iscenicid,sale.ibusinessid,sm.isettlementid,sale.bysalesvouchertype";
} else if ("2".equals(type)) {
hsql = "select iscenicid,bysalesvouchertype,ibusinessid,isettlementid,sum(numb) as numb,sum(yhnumb) as yhnumb,sum(mont) as mont,sum(yhmont) as yhmont,sum(mhandcharge) as mhandcharge from Rpzprovidertab where rmonth='"
+ date.substring(5, 7)
+ "' and ryear='"
+ date.substring(0, 4)
+ "' and titype='01' group by iscenicid,ibusinessid,isettlementid,bysalesvouchertype";
} else if ("3".equals(type)) {
hsql = "select iscenicid,bysalesvouchertype,ibusinessid,isettlementid,sum(numb) as numb,sum(yhnumb) as yhnumb,sum(mont) as mont,sum(yhmont) as yhmont,sum(mhandcharge) as mhandcharge from Rpzprovidertab where ryear='"
+ date.substring(0, 4)
+ "' and titype='02' group by iscenicid,ibusinessid,isettlementid,bysalesvouchertype";
}
list = this.find(hsql);
String hsql3 = "";
if ("1".equals(type)) {
hsql3 = "select et.iscenicid as iscenicid,'99' as bysalesvouchertype,c.ibusinessid,'00' as isettlementid,0 as numb,0 as yhnumb,0 as mont,0 as yhmont,sum(yl.mhandcharge) as mhandcharge from MOrder m,YZorderlist yl, Edmtickettypetab et,Custom c where m.orda='"
+ date
+ "' and m.ortp='02' and m.tpfs='02' and m.orid = yl.id.orid and yl.iztickettypeid=et.itickettypeid and c.usid=m.usid group by et.iscenicid,c.ibusinessid ";
List list3 = this.find(hsql3);
if (list != null && list.size() >= 1) {
if (list3 != null && list3.size() >= 1) {
for (int i = 0; i < list3.size(); i++) {
list.add(list3.get(i));
}
}
return list;
} else {
return list3;
}
} else {
return list;
}
}
/**
* ����ʱ���ѯ���������ս����� Describe:
*
* @auth:huangyuqi
* @param date
* @return return:List Date:2011-11-30
*/
public List updateOrQueryempfzByDate(String date) {
this.deleteDates(date, "1", "Rproviderfzdaytab");// �ս�
List list = new ArrayList();
String hsql = "select s.bysalesvouchertype,s.iscenicid,s.ibusinessid,st.isettlementid,s.id.iticketstationid,s.ihandler,stcom.itickettypeid,stcom.iztickettypeid,ep.icrowdkindid,stcom.msplitprice,nvl(sum(stcom.isplitamount),0),nvl(sum(stcom.msplitmoney),0),nvl(sum(stcom.ideratenums),0),nvl(sum(stcom.mderatemoney),0),nvl(sum(stcom.mhandcharge),0) from Stssalesvouchertab s,Stssalessettlementtab st,Stscomticketsalesdetailstab stcom,Edmcrowdkindpricetab ep where substr(s.dtmakedate,1,10)='"
+ date
+ "' and s.id.isalesvoucherid=st.id.isalesvoucherid and s.id.iticketstationid=st.id.iticketstationid and s.id.isalesvoucherid=stcom.id.isalesvoucherid and s.id.iticketstationid=stcom.id.iticketstationid and stcom.icrowdkindpriceid=ep.icrowdkindpriceid group by s.bysalesvouchertype,s.iscenicid,s.ibusinessid,st.isettlementid,s.id.iticketstationid,s.ihandler,stcom.itickettypeid,stcom.iztickettypeid,ep.icrowdkindid,stcom.msplitprice";
list = this.find(hsql);
return list;
}
public List updateOrQueryempfzBymonth(String date) {
this.deleteDates(date, "2", "Rproviderfzmonthtab");// �ս�
List list = new ArrayList();
String hsql = "select s.bysalesvouchertype,s.iscenicid,s.ibusinessid,s.isettlementid,s.iticketstationid,s.iemployeeid,s.itickettypeid,s.iztickettypeid,s.icrowdkindid,s.msplitprice,sum(s.iticketplayer),sum(s.msplitmoney),sum(s.ideratenums),sum(s.mderatemoney),sum(s.mhandcharge) from Rproviderfzdaytab s where rmonth='"
+ date.substring(5, 7)
+ "' and ryear ='"
+ date.substring(0, 4)
+ "' group by s.bysalesvouchertype,s.iscenicid,s.ibusinessid,s.isettlementid,s.iticketstationid,s.iemployeeid,s.itickettypeid,s.iztickettypeid,s.icrowdkindid,s.msplitprice";
list = this.find(hsql);
return list;
}
public List updateOrQueryempfznumbByDate(String date) {
this.deleteDates(date, "1", "Rproviderfznumbdaytab");// �ս�
List list = new ArrayList();
String hsql = "select s.bysalesvouchertype,s.iscenicid,s.ibusinessid,st.isettlementid,s.id.iticketstationid,s.ihandler,sd.itickettypeid,sum(sd.iticketnum),sum(sd.iticketplayer),sum(sd.ideratenums) from Stssalesvouchertab s,Stssalessettlementtab st,Stssalesvoucherdetailstab sd where substr(s.dtmakedate,1,10)='"
+ date
+ "' and s.id.isalesvoucherid=st.id.isalesvoucherid and s.id.iticketstationid=st.id.iticketstationid and s.id.isalesvoucherid=sd.id.isalesvoucherid and s.id.iticketstationid=sd.id.iticketstationid group by s.bysalesvouchertype,s.iscenicid,s.ibusinessid,st.isettlementid,s.id.iticketstationid,s.ihandler,sd.itickettypeid ";
list = this.find(hsql);
return list;
}
public List updateOrQueryempfznumbBymonth(String date) {
this.deleteDates(date, "2", "Rproviderfznumbmonthtab");// �½�
List list = new ArrayList();
String hsql = "select s.bysalesvouchertype,s.iscenicid,s.ibusinessid,s.isettlementid,s.iticketstationid,s.iemployeeid,s.itickettypeid,sum(s.iticketnum),sum(s.iticketplayer),sum(s.ideratenums) from Rproviderfznumbdaytab s where rmonth='"
+ date.substring(5, 7)
+ "' and ryear ='"
+ date.substring(0, 4)
+ "' group by s.bysalesvouchertype,s.iscenicid,s.ibusinessid,s.isettlementid,s.iticketstationid,s.iemployeeid,s.itickettypeid ";
list = this.find(hsql);
return list;
}
}
| [
"cy991587100@163.com"
] | cy991587100@163.com | |
e4b6dcc52d3c02ca11004db4c3f22388c750f501 | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/138/397/CWE400_Resource_Exhaustion__getParameter_Servlet_write_53c.java | c7bec8a9ca117c9d7623fd2a99256b79ea6ab642 | [] | no_license | Lanhbao/Static-Testing-for-Juliet-Test-Suite | 6fd3f62713be7a084260eafa9ab221b1b9833be6 | b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68 | refs/heads/master | 2020-08-24T13:34:04.004149 | 2019-10-25T09:26:00 | 2019-10-25T09:26:00 | 216,822,684 | 0 | 1 | null | 2019-11-08T09:51:54 | 2019-10-22T13:37:13 | Java | UTF-8 | Java | false | false | 1,677 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE400_Resource_Exhaustion__getParameter_Servlet_write_53c.java
Label Definition File: CWE400_Resource_Exhaustion.label.xml
Template File: sources-sinks-53c.tmpl.java
*/
/*
* @description
* CWE: 400 Resource Exhaustion
* BadSource: getParameter_Servlet Read count from a querystring using getParameter()
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: write
* GoodSink: Write to a file count number of times, but first validate count
* BadSink : Write to a file count number of times
* Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package
*
* */
import javax.servlet.http.*;
public class CWE400_Resource_Exhaustion__getParameter_Servlet_write_53c
{
public void badSink(int count , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE400_Resource_Exhaustion__getParameter_Servlet_write_53d()).badSink(count , request, response);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(int count , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE400_Resource_Exhaustion__getParameter_Servlet_write_53d()).goodG2BSink(count , request, response);
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(int count , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE400_Resource_Exhaustion__getParameter_Servlet_write_53d()).goodB2GSink(count , request, response);
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
0250b3ef48c48afcf8f928d4ce20fa1af6e091ca | 83c5cc230c2da2e80fdccdc99795f8a0606b28d0 | /app/src/main/java/app/teeramet/money/moneydiary/classmoney/Catalog.java | 22f2302fe18324cb84d2d672695df3e16b8e6a58 | [] | no_license | teeramet10/moneydiary | 6704a0c99d86b29e2bef3caba840f91da02a9433 | ef472add40da355d07221c99e3c692ae68a2cd4e | refs/heads/master | 2020-12-02T21:14:07.114090 | 2017-07-05T04:17:15 | 2017-07-05T04:17:15 | 96,276,076 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package app.teeramet.money.moneydiary.classmoney;
/**
* Created by barbie on 15/8/2559.
*/
public class Catalog {
int id;
String strNameList;
int idtypemoney;
String icon;
public Catalog() {
}
public Catalog(int id, String strNameList) {
this.id = id;
this.strNameList = strNameList;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getStrNameList() {
return strNameList;
}
public void setStrNameList(String strNameList) {
this.strNameList = strNameList;
}
public int getIdtypemoney() {
return idtypemoney;
}
public void setIdtypemoney(int idtypemoney) {
this.idtypemoney = idtypemoney;
}
public String getPathIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
| [
"teeramet.kan@gmail.com"
] | teeramet.kan@gmail.com |
f2b517cb5f1313991e10c35296ac85ecadf8c368 | 52dae9d6c5edb2a18475fb33bf604d62159c63af | /de.eich.funky.core/src/main/java/de/eich/utils/IOUtils.java | 3c7baf0f377cbe91553a3abc419829e5e948aeab | [
"Apache-2.0"
] | permissive | eichhoff/funky | 476ca3517c1c55a27555a240808eee88335ccc42 | 6dc2e6a35ce1fec1e11f2f0975b5338d69f59bb2 | refs/heads/master | 2021-01-10T12:33:12.554897 | 2016-02-04T10:53:23 | 2016-02-04T10:53:23 | 46,974,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,723 | java | /**
* @author Julian Eichhoff
*
* Copyright 2014 Julian Eichhoff
*/
package de.eich.utils;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
public class IOUtils {
public static void write(String path, Object object){
try {
ObjectOutputStream objectStream = new ObjectOutputStream(new FileOutputStream(path));
objectStream.writeObject(object);
objectStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static Object read(String path){
try {
ObjectInputStream objectStream = new ObjectInputStream(new FileInputStream(path));
Object object = objectStream.readObject();
objectStream.close();
return object;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void writeRDFS(String path, Model model){
try {
FileOutputStream fileStream = new FileOutputStream(path);
model.write(fileStream, "RDF/XML");
fileStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static Model readRDFS(String path){
try {
Model model = ModelFactory.createDefaultModel();
FileInputStream fileStream = new FileInputStream(path);
model.read(fileStream, "RDF/XML");
fileStream.close();
return model;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void writeTextFile(String path, String text){
try {
PrintWriter out = new PrintWriter(path);
out.println(text);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"julian.eichhoff@me.com"
] | julian.eichhoff@me.com |
824f336a320a6359fcf8b80c2496e7b4f731dda9 | 22dc150719597aa39ce53301222fdfbdbe6860ba | /teamC_project/src/main/java/kr/ync/project/service/ReplyService.java | d1ea5c93f1e4a79f587872887d8580f86d37b6bb | [
"MIT"
] | permissive | ync-it-2018/ync2018_teamC | aaa50469bdca9bddc10de4ba0dbd0cc90cf0ac0d | 2939f7ab9d9318e03187befd1df056e5016d8c67 | refs/heads/master | 2020-04-25T23:43:25.894021 | 2019-02-28T18:46:43 | 2019-02-28T18:46:43 | 173,154,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package kr.ync.project.service;
import java.util.List;
import kr.ync.project.domain.Criteria;
import kr.ync.project.domain.ReplyVO;
public interface ReplyService {
//댓글 등록
public void addReply(ReplyVO vo) throws Exception;
//댓글 목록
public List<ReplyVO> listReply(Integer bno) throws Exception;
//댓글 수정
public void modifyReply(ReplyVO vo) throws Exception;
//댓글 삭제
public void removeReply(Integer rno) throws Exception;
//댓글 페이징
public List<ReplyVO> listReplyPage(Integer bno, Criteria cri) throws Exception;
public int count(Integer bno) throws Exception;
}
| [
"team_c@791f864d-2a39-41cb-9c68-7b0e3d11f3c2"
] | team_c@791f864d-2a39-41cb-9c68-7b0e3d11f3c2 |
cb64546015362841f22ea8e2be91d6944830b9a1 | fbb451429d7c4bace20f1d1c6ae4123526784491 | /Central/Server/EdgeAppBaseServiceImpl/src/com/ca/arcserve/edge/app/base/webservice/license/MachineInfo.java | 5aa0ec2a3afa3be821d17dc8cacd3b8517879118 | [] | no_license | cliicy/autoupdate | 93ffb71feb958ff08915327b2ea8eec356918286 | 8da1c549847b64a9ea00452bbc97c16621005b4f | refs/heads/master | 2021-01-24T08:11:26.676542 | 2018-02-26T13:33:29 | 2018-02-26T13:33:29 | 122,970,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 89 | java | package com.ca.arcserve.edge.app.base.webservice.license;
public class MachineInfo {
}
| [
"cliicy@gmail.com"
] | cliicy@gmail.com |
9bd672362dc9b0cada3112492ca2865fe869d5f4 | fd8fadf30b2e357c1f432a303115ce5bf30ff57c | /src/net/sourceforge/plantuml/stats/XmlConverter.java | db46a2654cfa09618e839b22d06d217a95bf87cc | [] | no_license | lixinlin/plantuml-code | 6642e452ae8e6834942593a7ecd42f44418b8b6b | f558a8ec50f9ec617528dede774c3f46f1aac5ae | refs/heads/master | 2021-06-28T02:24:29.085869 | 2019-09-22T11:20:25 | 2019-09-22T11:20:25 | 214,447,468 | 0 | 0 | null | 2021-02-03T19:33:31 | 2019-10-11T13:45:25 | Java | UTF-8 | Java | false | false | 7,772 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML 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.
*
* PlantUML 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.stats;
import java.io.OutputStream;
import java.text.DateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.stats.api.Stats;
import net.sourceforge.plantuml.stats.api.StatsColumn;
import net.sourceforge.plantuml.stats.api.StatsLine;
import net.sourceforge.plantuml.stats.api.StatsTable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class XmlConverter {
private final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
private final Stats stats;
public XmlConverter(Stats stats) {
this.stats = stats;
}
private Document getDocument() throws ParserConfigurationException {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document document = builder.newDocument();
document.setXmlStandalone(true);
final Element root = (Element) document.createElement("plantuml".toUpperCase());
document.appendChild(root);
// final Element elt1 = (Element) document.createElement("totalLaunch".toUpperCase());
// elt1.setTextContent("" + stats.totalLaunch());
// root.appendChild(elt1);
addNode(root, document, stats.getLastSessions());
addNode(root, document, stats.getCurrentSessionByDiagramType());
addNode(root, document, stats.getCurrentSessionByFormat());
addNode(root, document, stats.getAllByDiagramType());
addNode(root, document, stats.getAllByFormat());
return document;
}
private void addNode(Element root, Document document, StatsTable table) {
final Element elt = (Element) document.createElement(toXmlName(table.getName()).toUpperCase());
for (StatsLine statsLine : table.getLines()) {
final Element line = (Element) document.createElement("line".toUpperCase());
for (StatsColumn col : table.getColumnHeaders()) {
final Element value = (Element) document.createElement(col.name());
// value.setAttribute("value", toText(statsLine.getValue(col)));
value.setTextContent(toText(statsLine.getValue(col)));
line.appendChild(value);
}
elt.appendChild(line);
}
root.appendChild(elt);
}
private String toXmlName(String name) {
return name.replaceAll("\\W+", "_");
}
private String toText(Object tmp) {
if (tmp instanceof Date) {
return "" + ((Date) tmp).getTime();
}
if (tmp == null) {
return "";
}
return tmp.toString();
}
private Transformer getTransformer() throws TransformerException {
final TransformerFactory xformFactory = TransformerFactory.newInstance();
final Transformer transformer = xformFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
return transformer;
}
public void createXml(OutputStream os) throws TransformerException, ParserConfigurationException {
final DOMSource source = new DOMSource(getDocument());
final StreamResult scrResult = new StreamResult(os);
getTransformer().transform(source, scrResult);
}
public String toHtml() {
final StringBuilder result = new StringBuilder();
result.append("<html>");
result.append("<style type=\"text/css\">");
result.append("body { font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: normal; color: black; background: white;}");
result.append("th,td { font-size: 12px;}");
result.append("table { border-collapse: collapse; border-style: none;}");
result.append("</style>");
result.append("<h2>Statistics</h2>");
printTableHtml(result, stats.getLastSessions());
result.append("<h2>Current session statistics</h2>");
printTableHtml(result, stats.getCurrentSessionByDiagramType());
result.append("<p>");
printTableHtml(result, stats.getCurrentSessionByFormat());
result.append("<h2>General statistics since ever</h2>");
printTableHtml(result, stats.getAllByDiagramType());
result.append("<p>");
printTableHtml(result, stats.getAllByFormat());
result.append("</html>");
return result.toString();
}
private void printTableHtml(StringBuilder result, StatsTable table) {
final Collection<StatsColumn> headers = table.getColumnHeaders();
result.append("<table border=1 cellspacing=0 cellpadding=2>");
result.append(getHtmlHeader(headers));
final List<StatsLine> lines = table.getLines();
for (int i = 0; i < lines.size(); i++) {
final StatsLine line = lines.get(i);
final boolean bold = i == lines.size() - 1;
result.append(getCreoleLine(headers, line, bold));
}
result.append("</table>");
}
private String getCreoleLine(Collection<StatsColumn> headers, StatsLine line, boolean bold) {
final StringBuilder result = new StringBuilder();
if (bold) {
result.append("<tr bgcolor=#f0f0f0>");
} else {
result.append("<tr bgcolor=#fcfcfc>");
}
for (StatsColumn col : headers) {
final Object v = line.getValue(col);
if (v instanceof Long || v instanceof HumanDuration) {
result.append("<td align=right>");
} else {
result.append("<td>");
}
if (bold) {
result.append("<b>");
}
if (v instanceof Long) {
result.append(String.format("%,d", v));
} else if (v instanceof Date) {
result.append(formatter.format(v));
} else if (v == null || v.toString().length() == 0) {
result.append(" ");
} else {
result.append(v.toString());
}
if (bold) {
result.append("</b>");
}
result.append("</td>");
}
result.append("</tr>");
return result.toString();
}
private String getHtmlHeader(Collection<StatsColumn> headers) {
final StringBuilder sb = new StringBuilder();
sb.append("<tr bgcolor=#e0e0e0>");
for (StatsColumn col : headers) {
sb.append("<td><b>");
sb.append(col.getTitle().replace(BackSlash.BS_BS_N, "<br>"));
sb.append("</b></td>");
}
sb.append("</tr>");
return sb.toString();
}
}
| [
"arnaud_roques@2bfd43ce-aac2-44f9-bcbc-61bf0d4e0ab5"
] | arnaud_roques@2bfd43ce-aac2-44f9-bcbc-61bf0d4e0ab5 |
708e84856d9032f74bf5caa150c5dd9432c5ce9a | 440463909aa8c7a65d15e4dcc67059a032b1cde7 | /src/roster/Roster.java | b032546581c06aef7e941715f42ae4b9178101fc | [] | no_license | zdzMAC/gtglxt | e04318b1a917b74ae83baf1c64fd0511a7639ef3 | ccf8e56562eef8fa41748afbaa63e12bb6744c6f | refs/heads/master | 2021-01-22T02:25:15.671372 | 2017-09-03T07:45:03 | 2017-09-03T07:45:03 | 102,242,527 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,164 | java | package roster;
import java.io.Serializable;
import java.util.Date;
/**
* 花名册
* @author Administrator
*/
public class Roster implements Serializable{
private static final long serialVersionUID = 1L;
public Roster(){}
//社保
private String uuid;//人员编号
private String htNumber;//合同编号
private String name;//姓名
private String sex;//性别
private String identityId;//身份证号
private String bankCard;//银行卡号
private String sbNumber;//社保编号
private String address;//地址
private Date htStart;//合同开始日期
private Date htEnd;//合同结束日期
private String jobType;//工种
private String phone;//电话号码
private Date lcTime;//离场日期
private Date sbStart;//社保开始日期
private Date sbEnd;//社保结束日期
private int sbRemind;//用于社保预警
private String bxType;//保险类型
private String del;//在职1 /离职0
private String gsqk;//工伤情况
private Date gsStart;//工伤开始时间
private Date gsEnd; //工伤结束时间
private String source;//人事来源
private String scz;//生产组
private String addinkq="未添加";//否加入考勤
private Date createDate;//创建日期
private String beizhu;//备注
private String image;//图片
private String deal = String.valueOf(0);//离职人员已处理1 /未处理0
//专做导入时的时间区别
private Date createDate2;
public Date getCreateDate2() {
return createDate2;
}
public void setCreateDate2(Date createDate2) {
this.createDate2 = createDate2;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getHtNumber() {
return htNumber;
}
public void setHtNumber(String htNumber) {
this.htNumber = htNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getIdentityId() {
return identityId;
}
public void setIdentityId(String identityId) {
this.identityId = identityId;
}
public String getSbNumber() {
return sbNumber;
}
public void setSbNumber(String sbNumber) {
this.sbNumber = sbNumber;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Date getHtStart() {
return htStart;
}
public void setHtStart(Date htStart) {
this.htStart = htStart;
}
public Date getHtEnd() {
return htEnd;
}
public void setHtEnd(Date htEnd) {
this.htEnd = htEnd;
}
public String getJobType() {
return jobType;
}
public void setJobType(String jobType) {
this.jobType = jobType;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Date getLcTime() {
return lcTime;
}
public void setLcTime(Date lcTime) {
this.lcTime = lcTime;
}
public Date getSbStart() {
return sbStart;
}
public void setSbStart(Date sbStart) {
this.sbStart = sbStart;
}
public Date getSbEnd() {
return sbEnd;
}
public void setSbEnd(Date sbEnd) {
this.sbEnd = sbEnd;
}
public String getBxType() {
return bxType;
}
public void setBxType(String bxType) {
this.bxType = bxType;
}
public String getBeizhu() {
return beizhu;
}
public String getDel() {
return del;
}
public void setDel(String del) {
this.del = del;
}
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
public String getGsqk() {
return gsqk;
}
public void setGsqk(String gsqk) {
this.gsqk = gsqk;
}
public Date getGsStart() {
return gsStart;
}
public void setGsStart(Date gsStart) {
this.gsStart = gsStart;
}
public Date getGsEnd() {
return gsEnd;
}
public void setGsEnd(Date gsEnd) {
this.gsEnd = gsEnd;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public int getSbRemind() {
return sbRemind;
}
public void setSbRemind(int sbRemind) {
this.sbRemind = sbRemind;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getScz() {
return scz;
}
public void setScz(String scz) {
this.scz = scz;
}
public String getAddinkq() {
return addinkq;
}
public void setAddinkq(String addinkq) {
this.addinkq = addinkq;
}
public String getBankCard() {
return bankCard;
}
public void setBankCard(String bankCard) {
this.bankCard = bankCard;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public void setCreateDate(String format) {
}
public String getDeal() {
return deal;
}
public void setDeal(String deal) {
this.deal = deal;
}
}
| [
"duanzhengzhang@gmail.com"
] | duanzhengzhang@gmail.com |
3a450c95f906fef377f91695cb650a1b84620911 | b57853f58a571ba077115e1c08e0590077e889db | /src/main/java/com/elearningportal/apps/web/rest/util/HeaderUtil.java | 9c1d8a315c7ac28de53772d2a9230fe85ce6a11e | [] | no_license | BulkSecurityGeneratorProject/E-learning | ffd0b904ddff0f2207a4ae46dc5857d465d6cc70 | c3d75dbcd268e2cac1bc02718311a3128c71f9ed | refs/heads/master | 2022-12-11T22:57:26.101173 | 2018-03-16T13:33:16 | 2018-03-16T13:33:16 | 296,685,384 | 0 | 0 | null | 2020-09-18T17:18:05 | 2020-09-18T17:18:05 | null | UTF-8 | Java | false | false | 1,611 | java | package com.elearningportal.apps.web.rest.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
/**
* Utility class for HTTP headers creation.
*/
public final class HeaderUtil {
private static final Logger log = LoggerFactory.getLogger(HeaderUtil.class);
private static final String APPLICATION_NAME = "eLearningApp";
private HeaderUtil() {
}
public static HttpHeaders createAlert(String message, String param) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-eLearningApp-alert", message);
headers.add("X-eLearningApp-params", param);
return headers;
}
public static HttpHeaders createEntityCreationAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".created", param);
}
public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".updated", param);
}
public static HttpHeaders createEntityDeletionAlert(String entityName, String param) {
return createAlert(APPLICATION_NAME + "." + entityName + ".deleted", param);
}
public static HttpHeaders createFailureAlert(String entityName, String errorKey, String defaultMessage) {
log.error("Entity processing failed, {}", defaultMessage);
HttpHeaders headers = new HttpHeaders();
headers.add("X-eLearningApp-error", "error." + errorKey);
headers.add("X-eLearningApp-params", entityName);
return headers;
}
}
| [
"vireshkumar@corenet.in.aquevix.com"
] | vireshkumar@corenet.in.aquevix.com |
18a2d210d6c49598ba727e0779fc8e5d6c01ba0b | a39edc98da4378c331753abc1e7fad6bc8f66be2 | /src/voraz/voraz.java | 73e726b095a66a73a0fbb71ead38eb026e60837e | [] | no_license | BelmontIzacc/AAOrdenamiento | 4ff5a3fb10878a0409fba80e21cec2f8af795afc | 96e5de3ea9d6c5f3f13b81cfce042024016d0655 | refs/heads/master | 2021-01-19T14:25:31.277524 | 2017-12-12T00:38:46 | 2017-12-12T00:38:46 | 100,903,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,083 | 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 voraz;
/**
*
* @author Belmont
*/
public class voraz {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int[] moneda = {500, 100, 50, 10, 5, 1};
//Quiero 23456 en monedas
int saldo = 23476;
int [] cambio = voraz.calcula(saldo, moneda);
System.out.println("Vuelto: "+saldo);
for(int i = 0; i < cambio.length; i++)
System.out.println(moneda[i]+" = "+cambio[i]+" unidad(es)");
}
public static int[] calcula(int monto, int[] valor) {
int[] moneda = new int[valor.length];
for (int i = 0; i < valor.length; i++) {
while (valor[i] <= monto) {
moneda[i]++;
monto = monto - valor[i];
}
}
return moneda;
}
}
| [
"jisagiizacc@gmail.com"
] | jisagiizacc@gmail.com |
70e022d0819d2b55958643c4ff4ef99ae3fe122e | dd9ee6240750d1bf56a920f8035e08786742d32c | /resource_server/src/main/java/com/commerce/backend/model/entity/CartItem.java | 10c4edef945c511bd03cbfe7ef56b8088c7145a1 | [
"MIT"
] | permissive | sukruaydinlik/Keyist-Ecommerce | 240a2b605a1b2102368f6732554a774bd345b8df | dbc66adbcd72ebf3f9abfb98b2e0b37043b4811b | refs/heads/master | 2023-08-10T23:29:12.959936 | 2021-09-22T10:44:36 | 2021-09-22T10:44:36 | 409,113,893 | 0 | 3 | MIT | 2021-09-22T10:44:37 | 2021-09-22T07:57:04 | Java | UTF-8 | Java | false | false | 682 | java | package com.commerce.backend.model.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
@Entity
@Table(name = "cart_item")
@Getter
@Setter
@NoArgsConstructor
@ToString(exclude = "cart")
public class CartItem {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@ManyToOne
@JoinColumn(name = "cart_id")
private Cart cart;
@ManyToOne
@JoinColumn(name = "product_variant_id")
private ProductVariant productVariant;
@Column(name = "amount")
private Integer amount;
}
| [
"antkaynak1@gmail.com"
] | antkaynak1@gmail.com |
f9ac6d79154df76dc1e3165fa3a839d96373b5a6 | 013a9133979918adb041b73061255ab67694db09 | /.metadata/.plugins/org.eclipse.wst.server.core/tmp1/work/Catalina/localhost/ROOT/org/apache/jsp/WEB_002dINF/views/main/home_jsp.java | abb49cf65987cae840e550a969ece818260df31e | [] | no_license | noCountJun/blog | 3846ec74d71bf21874ea42aa75e64bedfdf6669c | b402faf0371c7bc0c351dda4e31b79b117877464 | refs/heads/master | 2022-12-21T11:48:32.216003 | 2019-09-03T08:39:27 | 2019-09-03T08:39:27 | 203,744,848 | 0 | 0 | null | 2022-12-16T11:54:06 | 2019-08-22T08:03:55 | JavaScript | UTF-8 | Java | false | false | 12,923 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/8.0.36
* Generated at: 2019-09-03 07:45:03 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.views.main;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
static {
_jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(2);
_jspx_dependants.put("jar:file:/D:/blogProject/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/blogProject2/WEB-INF/lib/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("/WEB-INF/lib/jstl-1.2.jar", Long.valueOf(1565995938335L));
}
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = null;
}
private volatile javax.el.ExpressionFactory _el_expressionfactory;
private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
if (_el_expressionfactory == null) {
synchronized (this) {
if (_el_expressionfactory == null) {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
}
}
}
return _el_expressionfactory;
}
public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
if (_jsp_instancemanager == null) {
synchronized (this) {
if (_jsp_instancemanager == null) {
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
}
}
return _jsp_instancemanager;
}
public void _jspInit() {
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}
final javax.servlet.jsp.PageContext pageContext;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, false, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
out = pageContext.getOut();
_jspx_out = out;
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\t\t\t\t<!-- Banner -->\n");
out.write("\t\t\t\t\t<section id=\"banner\">\n");
out.write("\t\t\t\t\t\t<div class=\"content\">\n");
out.write("\t\t\t\t\t\t\t<header>\n");
out.write("\t\t\t\t\t\t\t\t<h1>an se jun blog </h1>\n");
out.write("\t\t\t\t\t\t\t\t<p> test</p>\n");
out.write("\t\t\t\t\t\t\t</header>\n");
out.write("\t\t\t\t\t\t\t<p>bla~ bla~ bla~ bla~ </p>\n");
out.write("\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t<li>\n");
out.write("\t\t\t\t\t\t\t\t\t<a href=\"/login/loginForm\" class=\"button big\">admin login</a>\n");
out.write("\t\t\t\t\t\t\t\t</li>\n");
out.write("\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t\t<span class=\"image object\">\n");
out.write("\t\t\t\t\t\t\t<img src=\"/resources/images/pic07.jpg\" alt=\"\" />\n");
out.write("\t\t\t\t\t\t</span>\n");
out.write("\t\t\t\t\t</section>\n");
out.write("\n");
out.write("\t\t\t\t<!-- Section -->\n");
out.write("\t\t\t\t\t<section>\n");
out.write("\t\t\t\t\t\t<header class=\"major\">\n");
out.write("\t\t\t\t\t\t\t<h2>Erat lacinia</h2>\n");
out.write("\t\t\t\t\t\t</header>\n");
out.write("\t\t\t\t\t\t<div class=\"features\">\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<span class=\"icon fa-gem\"></span>\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"content\">\n");
out.write("\t\t\t\t\t\t\t\t\t<h3>Portitor ullamcorper</h3>\n");
out.write("\t\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<span class=\"icon solid fa-paper-plane\"></span>\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"content\">\n");
out.write("\t\t\t\t\t\t\t\t\t<h3>Sapien veroeros</h3>\n");
out.write("\t\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<span class=\"icon solid fa-rocket\"></span>\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"content\">\n");
out.write("\t\t\t\t\t\t\t\t\t<h3>Quam lorem ipsum</h3>\n");
out.write("\t\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<span class=\"icon solid fa-signal\"></span>\n");
out.write("\t\t\t\t\t\t\t\t<div class=\"content\">\n");
out.write("\t\t\t\t\t\t\t\t\t<h3>Sed magna finibus</h3>\n");
out.write("\t\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t</section>\n");
out.write("\n");
out.write("\t\t\t\t<!-- Section -->\n");
out.write("\t\t\t\t\t<section>\n");
out.write("\t\t\t\t\t\t<header class=\"major\">\n");
out.write("\t\t\t\t\t\t\t<h2>Ipsum sed dolor</h2>\n");
out.write("\t\t\t\t\t\t</header>\n");
out.write("\t\t\t\t\t\t<div class=\"posts\">\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic01.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Interdum aenean</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic02.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Nulla amet dolore</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic03.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Tempus ullamcorper</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic04.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Sed etiam facilis</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic05.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Feugiat lorem aenean</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t\t<article>\n");
out.write("\t\t\t\t\t\t\t\t<a href=\"#\" class=\"image\"><img src=\"images/pic06.jpg\" alt=\"\" /></a>\n");
out.write("\t\t\t\t\t\t\t\t<h3>Amet varius aliquam</h3>\n");
out.write("\t\t\t\t\t\t\t\t<p>Aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n");
out.write("\t\t\t\t\t\t\t\t<ul class=\"actions\">\n");
out.write("\t\t\t\t\t\t\t\t\t<li><a href=\"#\" class=\"button\">More</a></li>\n");
out.write("\t\t\t\t\t\t\t\t</ul>\n");
out.write("\t\t\t\t\t\t\t</article>\n");
out.write("\t\t\t\t\t\t</div>\n");
out.write("\t\t\t\t\t</section>\n");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"ansejjang@gmail.com"
] | ansejjang@gmail.com |
d5126eff5f5a0cdae1ff1dd3b365fe539e99250b | 64d7610b57f7a14667da2ef0e8eb9d177c767828 | /src/main/java/com/xzbd/mail/utils/mailContentUtil/TextEmailContentItem.java | 546646ea1d325d0617b6650ce7a9c99df6330687 | [
"Apache-2.0"
] | permissive | 745114565/xw-mail | a52097e0e7584a54319552f889a16a30c4bb792b | ab5c7628e50d61910fbe3b8f1fa3abd0ad53e3eb | refs/heads/master | 2020-04-16T02:44:26.736672 | 2019-03-04T05:02:58 | 2019-03-04T05:02:58 | 165,206,197 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | package com.xzbd.mail.utils.mailContentUtil;
public class TextEmailContentItem extends AbstractEmailContentItem {
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
| [
"xzbd745114565@163.com"
] | xzbd745114565@163.com |
fb47d6b813adeeb6a393aebfcfb2a9306f56d7d7 | e57f600798ec889512362eb99147fca115af3936 | /lab5/creatures/TestPlip.java | 160f00cae16c94649451db14044ce6f07848a3e5 | [] | no_license | liu-yuxin98/CS61B-2019spring | b95c06ec38e8055adabe25f612d8bfdb0e589404 | 9b851a199fa7a57ab5a3347c96da75ba2e8f2447 | refs/heads/master | 2023-07-14T06:02:08.704291 | 2021-08-11T15:35:18 | 2021-08-11T15:35:18 | 293,726,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,754 | java | package creatures;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.awt.Color;
import huglife.Direction;
import huglife.Action;
import huglife.Occupant;
import huglife.Impassible;
import huglife.Empty;
/** Tests the plip class
* @authr FIXME
*/
public class TestPlip {
@Test
public void testBasics() {
Plip p = new Plip(2);
assertEquals(2, p.energy(), 0.01);
assertEquals(new Color(99, 255, 76), p.color());
p.move();
assertEquals(1.85, p.energy(), 0.01);
p.move();
assertEquals(1.70, p.energy(), 0.01);
p.stay();
assertEquals(1.90, p.energy(), 0.01);
p.stay();
assertEquals(2.00, p.energy(), 0.01);
}
@Test
public void testReplicate() {
// TODO
Plip p = new Plip(2);
p.color();
Plip rp = p.replicate();
assertEquals(p.energy(),rp.energy(),0.01);
assertEquals(p.color(),rp.color());
}
@Test
public void testChoose() {
// No empty adjacent spaces; stay.
Plip p = new Plip(1.2);
HashMap<Direction, Occupant> surrounded = new HashMap<Direction, Occupant>();
surrounded.put(Direction.TOP, new Impassible());
surrounded.put(Direction.BOTTOM, new Impassible());
surrounded.put(Direction.LEFT, new Impassible());
surrounded.put(Direction.RIGHT, new Impassible());
Action actual = p.chooseAction(surrounded);
Action expected = new Action(Action.ActionType.STAY);
assertEquals(expected, actual);
// Energy >= 1; replicate towards an empty space.
p = new Plip(1.2);
HashMap<Direction, Occupant> findEmpty = new HashMap<Direction, Occupant>();
findEmpty.put(Direction.TOP, new Empty());
findEmpty.put(Direction.BOTTOM, new Empty());
findEmpty.put(Direction.LEFT, new Impassible());
findEmpty.put(Direction.RIGHT, new Impassible());
/* P(TOP) =P(BOTTOM)*/
expected = new Action(Action.ActionType.REPLICATE, Direction.TOP);
Action expected2 = new Action(Action.ActionType.REPLICATE, Direction.BOTTOM);
/* random test*/
int top = 0;
int bottom = 0;
int ntimes = 10000;
for(int i=0;i<ntimes;i++){
actual = p.chooseAction(findEmpty);
if(actual.equals(expected)){
top += 1;
}
if(actual.equals(expected2)){
bottom += 1;
}
}
System.out.println(top);
System.out.println(bottom);
double actualdiffer = Math.abs(top/ntimes-bottom/ntimes);
assertEquals(0,actualdiffer,0.05);
// Energy >= 1; replicate towards an empty space.
p = new Plip(1.2);
HashMap<Direction, Occupant> allEmpty = new HashMap<Direction, Occupant>();
allEmpty.put(Direction.TOP, new Empty());
allEmpty.put(Direction.BOTTOM, new Empty());
allEmpty.put(Direction.LEFT, new Empty());
allEmpty.put(Direction.RIGHT, new Empty());
actual = p.chooseAction(allEmpty);
Action unexpected = new Action(Action.ActionType.STAY);
assertNotEquals(unexpected, actual);
// Energy < 1; stay.
p = new Plip(.99);
actual = p.chooseAction(allEmpty);
expected = new Action(Action.ActionType.STAY);
assertEquals(expected, actual);
// Energy < 1; stay.
p = new Plip(.99);
actual = p.chooseAction(findEmpty);
expected = new Action(Action.ActionType.STAY);
assertEquals(expected, actual);
// We don't have Cloruses yet, so we can't test behavior for when they are nearby right now.
}
}
| [
"3178102653@zju.edu.cn"
] | 3178102653@zju.edu.cn |
719b172dfefec8db65886cd2d797f367489a1e05 | 8dea165fcd9989b393f9d5c164cac088283c3e14 | /src/main/java/com/example/demo/DemoApplication.java | a1203036ebfe1495a7a1484ee037f4721c5760fb | [] | no_license | GuangMing546/demo | e23d584a9b1311c846f8b109e91e59717e6381e5 | 3cf2d66d5e216f8d797d55f972ecdc581143cb65 | refs/heads/master | 2023-01-07T02:41:08.535057 | 2020-11-09T05:54:34 | 2020-11-09T05:54:34 | 311,058,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package com.example.demo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication
@MapperScan("com.example.demo.mapper")
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
| [
"1919595638@qq.com"
] | 1919595638@qq.com |
9aa0f37968b8b6174915f6276bd605052c96bd3e | 5efa9cb86b0fd6edf91df1e13efaa9a2b3252e6d | /src/main/java/ishop/servlet/page/FromSocialController.java | 97ab7177f6e9301b3fb5304e2d9ffd5f38945251 | [] | no_license | bexysuttx/ishop | 724283ff51ca8b8cd9990dd4e2da86a7735d1b6b | cafc63dae6cece5f26e7095d862fde2e700e2a40 | refs/heads/master | 2023-03-16T21:47:36.308480 | 2021-03-10T21:03:27 | 2021-03-10T21:03:27 | 345,735,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,834 | java | package ishop.servlet.page;
import java.io.IOException;
import java.net.URLDecoder;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ishop.Constants;
import ishop.model.CurrentAccount;
import ishop.model.SocialAccount;
import ishop.servlet.AbstractController;
import ishop.utils.RoutingUtils;
import ishop.utils.SessionUtils;
@WebServlet("/from-social")
public class FromSocialController extends AbstractController {
private static final long serialVersionUID = 2167233972512926391L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String code = req.getParameter("code");
if (code != null) {
SocialAccount socialAccount = getSocialService().getSocialAccount(code);
CurrentAccount currentAccount = getOrderService().authentificate(socialAccount);
SessionUtils.setCurrentAccount(req, currentAccount);
redirectToSuccesPage(req,resp);
} else {
LOGGER.warn("Parameter code not found");
if (req.getSession().getAttribute(Constants.SUCCESS_REDIRECT_URL_AFTER_SIGNIN) != null) {
req.getSession().removeAttribute(Constants.SUCCESS_REDIRECT_URL_AFTER_SIGNIN);
}
RoutingUtils.redirect("/sign-in", req, resp);
}
}
private void redirectToSuccesPage(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String targetUrl = (String) req.getSession().getAttribute(Constants.CURRENT_REQUEST_URL);
if (targetUrl != null ) {
req.getSession().removeAttribute(Constants.SUCCESS_REDIRECT_URL_AFTER_SIGNIN);
RoutingUtils.forwardToPage(URLDecoder.decode(targetUrl,"UTF-8"), req, resp);
} else {
RoutingUtils.redirect("/my-orders", req, resp);
}
}
}
| [
"andrei_rodionov@inbox.ru"
] | andrei_rodionov@inbox.ru |
83057e58dd192334d8351f508c24bc87e0f2b92d | 7711c0f09debb7d2da71f3703bf8441dcf7a914c | /src/main/java/com/ktar5/tileeditor/scene/menu/TopMenu.java | 5a26fb2cca88eb146b581c33835a00a1831f93a3 | [] | no_license | Ktar5/LibGDX-TilemapEditor | e7398ae84f7a82b1f8a388ce026160bc75b7f72e | a67275a79c1b841dc1b7e815e74b13cea30928a6 | refs/heads/master | 2020-05-20T18:34:00.968927 | 2019-05-31T20:01:07 | 2019-05-31T20:01:07 | 185,708,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 414 | java | package com.ktar5.tileeditor.scene.menu;
import com.kotcrab.vis.ui.widget.MenuBar;
import lombok.Getter;
@Getter
public class TopMenu extends MenuBar {
private ToolMenu toolMenu;
public TopMenu() {
super();
this.addMenu(new FileMenu());
this.addMenu(new EditMenu());
this.addMenu(new MapMenu());
toolMenu = new ToolMenu();
this.addMenu(toolMenu);
}
}
| [
"ktarfive@gmail.com"
] | ktarfive@gmail.com |
8e31c083d69020b1ae3add257440e46255cf73ed | f6af152c25b0bba5ddf51408e1dda006b29113a7 | /java/lecture02/StringEqualsExample.java | d79c428ef281516ee75893da92b6dd9f0f3d4ecf | [] | no_license | amollania/TIL | 5a9db5b1d1a7e79699c0ae8ee7c8fd232e71d15a | fc5c8f8cc9a9f621598b78cd5a9e9844def06e8a | refs/heads/master | 2020-12-06T16:43:24.317237 | 2020-05-08T08:45:02 | 2020-05-08T08:45:02 | 232,509,530 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 431 | java | public class StringEqualsExample {
public static void main(String[] args) {
String strVar1 = "Shin";
String strVar2 = "Shin";
String strVar3 = new String("Shin");
System.out.println(strVar1 == strVar2);
System.out.println(strVar1 == strVar3);
System.out.println();
System.out.println(strVar1.equals(strVar2));
System.out.println(strVar1.equals(strVar3));
}
} | [
"eyestm10@gmail.com"
] | eyestm10@gmail.com |
514de7a77d67aa6022c7f468be79ef9bf8aeff07 | ff4e455346ca3aaec08cbfcd2172115b91e059b7 | /Clean-Up-Application/app/src/test/java/com/example/communitycleanup/ExampleUnitTest.java | 314b73d828173499318ef1ccc8ad6d90db20a3df | [] | no_license | CalumMortimer/clean-up-application | 423efac8deaf1abc94a618c7339ee977ef6881b7 | f66b051e3cd5472072be0536b4b6c7d9dacd1043 | refs/heads/master | 2021-02-10T15:44:47.490611 | 2020-03-31T09:57:03 | 2020-03-31T09:57:03 | 244,395,640 | 0 | 0 | null | 2020-03-16T13:21:40 | 2020-03-02T14:46:31 | Java | UTF-8 | Java | false | false | 389 | java | package com.example.communitycleanup;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"calum.mortimer@btinternet.com"
] | calum.mortimer@btinternet.com |
786207e7d766ae3aaa074b4588a7826bceb691bc | 4924a4cee8203afec1873e3f94e9a7cb8f80c762 | /src/main/java/com/cjq/accounts/service/impl/AccountsServiceImpl.java | b06ed8c1507758dec096951fba7dca0d2a816adc | [] | no_license | cjq617/accounts | 15f18de96136992526cc5fa62fbcc252a11749f6 | 9cffcbf6d8d0f5afb0554f9f7e2c2506f1dc2c26 | refs/heads/master | 2022-12-21T10:21:42.263522 | 2020-04-07T14:48:18 | 2020-04-07T14:48:18 | 146,455,857 | 0 | 0 | null | 2022-12-16T06:01:19 | 2018-08-28T13:59:02 | JavaScript | UTF-8 | Java | false | false | 9,204 | java | package com.cjq.accounts.service.impl;
import com.cjq.accounts.dao.AccountsMapper;
import com.cjq.accounts.dao.MyUserMapper;
import com.cjq.accounts.dao.OtherAccountsMapper;
import com.cjq.accounts.dto.*;
import com.cjq.accounts.entity.*;
import com.cjq.accounts.service.AccountsService;
import com.cjq.publics.dto.ResultDto;
import com.cjq.publics.dto.ReturnCode;
import com.cjq.publics.entity.Page;
import com.cjq.publics.entity.Pagination;
import com.cjq.publics.util.DateUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
@Service
public class AccountsServiceImpl implements AccountsService {
@Resource
private AccountsMapper accountsMapper;
@Resource
private OtherAccountsMapper otherAccountsMapper;
@Resource
private MyUserMapper myUserMapper;
/**
* @function:计算一天的消费总额
* @author:cjq
* @date:2014-1-7下午3:32:18
*/
@Override
public SumGson getSum(AccountsDto dto) {
//一天伙食费
float foodSum = dto.getBreakfast() + dto.getLunch() + dto.getSupper();
String otherStr = "";//其他消费拼接字符串
float otherSum = 0.0f;//其他消费总额
/*if(dto.getOther() != null && dto.getOther().length >0) {
String[] others = dto.getOther();
float[] oprices = dto.getOprice();
for(int i=0;i<others.length;i++) {
otherStr += others[i] + ":" + oprices[i] + ";";
otherSum += oprices[i];
}
}*/
System.out.println("其他消费总额:" + otherSum);
System.out.println("其他:" + otherStr);
//一天总消费
float sum = dto.getBreakfast() + dto.getLunch() + dto.getSupper() + dto.getEgg() + dto.getFruit() + dto.getDrink() +
dto.getFood() + dto.getRice() + dto.getCake() + dto.getSupermarket() + dto.getTraffic() + dto.getSoy() +
dto.getGass() + dto.getPhone() + dto.getRent() + dto.getFootball() + otherSum;
System.out.println("总金额:" + sum);
//封装返回的json对象
SumGson sg = new SumGson();
sg.setFoodSum(foodSum);
sg.setTotal(sum);
sg.setOtherSum(otherSum);
return sg;
}
/**
* @function:添加一天的消费记录进数据库
* @author:cjq
* @date:2014-1-7下午3:32:41
*/
@Override
public ResultDto add(AccountsDto dto) {
Accounts accounts = new Accounts();
BeanUtils.copyProperties(dto,accounts);
accounts.setAddDate(DateUtil.converDate2(dto.getAddDate()));
int row = accountsMapper.insertSelective(accounts);
if(row > 0) {
int id = accounts.getId();
if(dto.getOtherAccountsList() != null && !dto.getOtherAccountsList().isEmpty()) {
for(OtherAccounts other : dto.getOtherAccountsList()) {
other.setAccountsId(id);
otherAccountsMapper.insertSelective(other);
}
}
return new ResultDto(ReturnCode.SUCCESS, Integer.toString(id));
}
return new ResultDto(ReturnCode.BUSIN_ERROR, "添加失败");
}
/**
* @function:判断是否存在相同的记录
* @author:cjq
* @date:2014-1-7下午3:33:00
*/
@Override
public ResultDto validateExist(String flag, String addDate) {
ResultDto resultDto = new ResultDto(ReturnCode.DATA_ERROR);
AccountsExample example = new AccountsExample();
AccountsExample.Criteria criteria = example.createCriteria();
criteria.andFlagEqualTo(flag);
criteria.andAddDateEqualTo(DateUtil.converDate2(addDate));
List<Accounts> list = accountsMapper.selectByExample(example);
if(list != null && !list.isEmpty()) {
resultDto.setStatus(ReturnCode.SUCCESS);
resultDto.setObj(list.get(0));
}
return resultDto;
}
/**
* @function:条件查询每天消费记录
* @author:cjq
* @date:2014-1-7下午3:15:25
*/
@Override
public Pagination<AccountsDto> queryBills(QueryDto dto) {
AccountsTotalExample totalExample = new AccountsTotalExample();
AccountsExample example = new AccountsExample();
AccountsExample.Criteria criteria = example.createCriteria();
if(StringUtils.hasText(dto.getFlag())) {
criteria.andFlagEqualTo(dto.getFlag());
}
if(StringUtils.hasText(dto.getStartDate())) {
criteria.andAddDateGreaterThanOrEqualTo(DateUtil.converDate(dto.getStartDate() + " 00:00:00:000"));
}
if(StringUtils.hasText(dto.getEndDate())) {
criteria.andAddDateLessThanOrEqualTo(DateUtil.converDate(dto.getEndDate() + " 23:59:59:998"));
}
example.setOrderByClause("add_date desc,flag desc");
totalExample.setAccountsExample(example);
OtherAccountsExample otherAccountsExample = new OtherAccountsExample();
OtherAccountsExample.Criteria oCriteria = otherAccountsExample.createCriteria();
if(StringUtils.hasText(dto.getKeyWord())) {
oCriteria.andOtherLike("%" + dto.getKeyWord() + "%");
}
totalExample.setOtherAccountsExample(otherAccountsExample);
int count = accountsMapper.countByTotalExample(totalExample);
totalExample.setPage(new Page(dto.getCurrentPage(), dto.getPageSize(), count));
List<AccountsDto> list = accountsMapper.selectDtoByTotalExample(totalExample);
Pagination<AccountsDto> pg = new Pagination<>();
pg.setData(list);
pg.setCurrentPage(totalExample.getPage().getCurrentPage());
pg.setPageSize(totalExample.getPage().getPageSize());
pg.setTotalCount(count);
pg.setTotalPage(totalExample.getPage().getTotalPage());
return pg;
}
@Override
public AccountsDto queryDtoById(String id) {
AccountsDto dto = null;
try{
dto = accountsMapper.selectDtoByPrimaryKey(Integer.parseInt(id));
} catch (Exception e) {
dto = null;
}
return dto;
}
@Override
public ResultDto updateAccounts(AccountsDto dto) {
Accounts accounts = new Accounts();
BeanUtils.copyProperties(dto, accounts);
accounts.setAddDate(DateUtil.converDate2(dto.getAddDate()));
int row = accountsMapper.updateByPrimaryKeySelective(accounts);
if(row > 0) {
OtherAccountsExample example = new OtherAccountsExample();
OtherAccountsExample.Criteria criteria = example.createCriteria();
criteria.andAccountsIdEqualTo(dto.getId());
otherAccountsMapper.deleteByExample(example);
if(dto.getOtherAccountsList() != null && !dto.getOtherAccountsList().isEmpty()) {
for(OtherAccounts other : dto.getOtherAccountsList()) {
other.setAccountsId(dto.getId());
otherAccountsMapper.insertSelective(other);
}
}
return new ResultDto(ReturnCode.SUCCESS);
}
return new ResultDto(ReturnCode.DATA_ERROR);
}
@Override
public ResultDto updateInitOther(QueryDto dto) {
AccountsExample example = new AccountsExample();
AccountsExample.Criteria criteria = example.createCriteria();
if(StringUtils.hasText(dto.getFlag())) {
criteria.andFlagEqualTo(dto.getFlag());
}
if(StringUtils.hasText(dto.getStartDate())) {
criteria.andAddDateGreaterThanOrEqualTo(DateUtil.converDate(dto.getStartDate() + " 00:00:00:000"));
}
if(StringUtils.hasText(dto.getEndDate())) {
criteria.andAddDateLessThanOrEqualTo(DateUtil.converDate(dto.getEndDate() + " 23:59:59:998"));
}
criteria.andOtherIsNotNull();
criteria.andOtherNotEqualTo("");
List<Accounts> list = accountsMapper.selectByExample(example);
for(Accounts accounts : list) {
//String[] otherArr = accounts.getOther().split("\\|");
//String[] otherPriceArr = accounts.getOprice().split("\\|");
String[] otherArr = null;
String[] otherPriceArr = null;
for(int i=0;i<otherArr.length;i++) {
OtherAccounts otherAccounts = new OtherAccounts();
otherAccounts.setAccountsId(accounts.getId());
otherAccounts.setOther(otherArr[i]);
otherAccounts.setOtherPrice(new BigDecimal(otherPriceArr[i]));
otherAccountsMapper.insertSelective(otherAccounts);
}
}
return new ResultDto(ReturnCode.SUCCESS);
}
@Override
public ResultDto settleQuery(QueryDto dto) {
List<SettleDto> list = accountsMapper.selectSettle();
return new ResultDto(ReturnCode.SUCCESS, list);
}
@Override
public ResultDto usersQuery() {
List list = myUserMapper.selectByExample(null);
return new ResultDto(ReturnCode.SUCCESS, list);
}
@Override
public ResultDto monthDetail(String month, String flag) {
String date = month + "-01";
String startDate = DateUtil.appendStartTime(DateUtil.getFirstDayStrOfMonth(DateUtil.stringToDate(date)));
String endDate = DateUtil.appendEndTime(DateUtil.getLastDayStrOfMonth(DateUtil.stringToDate(date)));
List<AccountsDto> list = accountsMapper.selectMonthDetails(startDate, endDate, flag);
AccountsDto dto = list.get(0);
dto.setAddDate(month);
dto.setFlag(flag);
List<OtherAccountsDto> otherAccountsList = accountsMapper.selectMonthDetailsOther(startDate, endDate, flag);
BigDecimal otherTotal = BigDecimal.ZERO;
if(otherAccountsList != null && !otherAccountsList.isEmpty()) {
for(OtherAccountsDto other : otherAccountsList) {
otherTotal = otherTotal.add(other.getOtherPrice());
}
OtherAccountsDto total = new OtherAccountsDto();
total.setOther("其他总计");
total.setOtherPrice(otherTotal);
total.setAddDate(month);
otherAccountsList.add(total);
}
dto.setOthers(otherAccountsList);
return new ResultDto(ReturnCode.SUCCESS, dto);
}
}
| [
"568763068@qq.com"
] | 568763068@qq.com |
521e635f35b2ca7f7f0f312f70dc8f44973004d8 | 67ddc3c8ac2e216d2dbd4be8a8fd75be26e95c02 | /src/sakila/controller/IndexServlet.java | fda8c4941337e042dbc3e0d5c8a9c6c9f315ab39 | [] | no_license | baebae98/sakila | d46710091ddaacf18763cd3130655aba5506ee73 | c3ccf0b8b656d2391c2c2eb063e9a4b5fa6a14f7 | refs/heads/main | 2023-02-21T15:20:37.997498 | 2021-01-27T05:02:12 | 2021-01-27T05:02:12 | 305,299,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 777 | java | package sakila.controller;
import java.io.*;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
@WebServlet("/auth/IndexServlet")
public class IndexServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Debug: IndexServlet doGet 실행");
HttpSession session = request.getSession();
System.out.println("Debug: loginStaff(" + session.getAttribute("loginStaff") + ")");
request.getRequestDispatcher("/WEB-INF/views/auth/index.jsp").forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// doPost
}
} | [
"piskk74@naver.com"
] | piskk74@naver.com |
ea2aa9ce1fb655ac9f047e6ff15e8da6f7978d0f | fa9506c8c0a3621b4719f04793e18dc9d09c609a | /Maria_Suvalova_Lab_1/src/com/company/MyThread2.java | ec7c26553635c250c1d6ee05decd2e2b3ec3f2d1 | [] | no_license | MARS22101996/Cross-platform-programming | 8219f7454bd759887ea4ec4533fea724362e8d6b | 6a3103fbe9e2f93f9de614e6df8efb6d56ce6b02 | refs/heads/master | 2021-01-22T06:02:49.466413 | 2017-05-26T14:34:12 | 2017-05-26T14:34:12 | 92,518,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,088 | java | package com.company;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Created by pavel on 30/03/2017.
*/
public class MyThread2 extends Thread {
private int start;
private long time;
private Track track;
public MyThread2(int start, long time, Track track) {
this.start = start;
this.time = time;
this.track = track;
}
public void run() {
try {
PrintWriter writer = new PrintWriter("second.log", "UTF-8");
int counter = 0;
while (start > 0) {
try {
start -= counter;
track.setTrackSecond(start - counter);
writer.println(track.getTrackSecond());
counter++;
sleep(time);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
writer.close();
System.out.println("Thread2 terminated");
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"mariia_suvalova@epam.com"
] | mariia_suvalova@epam.com |
1f1f3ea3379335117f9c19ed6de96913d2c6b7b2 | 680af16ae776098600aec60ca211ed20ae95676c | /src/st/myc/shop/entity/TbGoods.java | a6d4ce0681903ed8d81ff172b3ff052dc72cf94c | [] | no_license | NoErla/Shop | fad80c4dd76375632dd0914d2485524b3e83e41d | 12d14d642761f3fa45f69316a7d3cc6a5d744f57 | refs/heads/master | 2016-09-13T05:36:20.265753 | 2016-05-04T09:12:15 | 2016-05-04T09:12:15 | 58,037,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,803 | java | package st.myc.shop.entity;
import java.util.Date;
public class TbGoods {
private Integer goodsId;
private String goodsName;
private Integer goodsTypeId;
private Double price;
private String image;
private Integer sellCount;
private Date createTime;
private Integer status;
private String descript;
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName == null ? null : goodsName.trim();
}
public Integer getGoodsTypeId() {
return goodsTypeId;
}
public void setGoodsTypeId(Integer goodsTypeId) {
this.goodsTypeId = goodsTypeId;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image == null ? null : image.trim();
}
public Integer getSellCount() {
return sellCount;
}
public void setSellCount(Integer sellCount) {
this.sellCount = sellCount;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getDescript() {
return descript;
}
public void setDescript(String descript) {
this.descript = descript == null ? null : descript.trim();
}
} | [
"34351184@qq.com"
] | 34351184@qq.com |
4743aa694d478e23fdda5a8b7ecf1cb198a940b0 | 4347ea57d9a2f78977c05ade175ed2d70134cde4 | /Trainer Works/DynamicWorks/src/com/fannie/HelloWorld.java | 0ffca738fba2f479d7bd603ab67f394bb0060356 | [] | no_license | adithnaveen/SDET5 | fb92ed5459f43558a3027c4545957eea2ac4e3f3 | 4a3d60f1fe5085b111d32663f7542ed4974e1ab3 | refs/heads/master | 2020-12-30T14:57:29.930662 | 2018-09-11T09:37:13 | 2018-09-11T09:37:13 | 91,100,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,113 | java | package com.fannie;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class HelloWorld
*/
public class HelloWorld extends HttpServlet {
private static final long serialVersionUID = 1L;
public void init(ServletConfig config) throws ServletException {
System.out.println(">>>>>>>>INIT>>>>>>>>>>>>>");
}
public void destroy() {
System.out.println("<<<<<<<<<DESTORY<<<<<<<<<<<<<");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// response type as text render as html
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.print("<h2>Welcome to Servlets </h2>");
out.println("</body>");
out.println("</html>");
out.close();
}
}
| [
"adith.naveen@gmail.com"
] | adith.naveen@gmail.com |
186efab2f60933d4be607988321e280072aec274 | 8512dbdde52db227c3c22c16cfa708a03ca57351 | /src/com/rsreu/igor_sinelshikov/maze/model/solvers/without_cost/breadth_first_search/State.java | 6b8629d0f89978d832bf362ee3e8ecc463646491 | [] | no_license | sinelshchikovigor/RobotInAMaze | 3cce8d90aefaf32dec69aba9fbb9629b32100509 | 3ca4cabae6c5723a2a347fb781a06a77cfb5e4f0 | refs/heads/master | 2021-01-18T02:08:56.619965 | 2014-12-17T21:09:50 | 2014-12-17T21:09:50 | null | 0 | 0 | null | null | null | null | WINDOWS-1251 | Java | false | false | 810 | java | /**
* State
*/
package com.rsreu.igor_sinelshikov.maze.model.solvers.without_cost.breadth_first_search;
/**
* Класс позиции клетки.
*
* @author Игорь_Синельщиков
* @version 1.01
* @since 1.01
*/
public class State {
/** X позиция клетки. */
public int xPos;
/** Y позиция клетки. */
public int yPos;
/** Дистанция до клетки. */
public int dist;
/**
* Конструктор класса позиции клетки.
*
* @param xPos X позиция клетки
* @param yPos Y позиция клетки
* @param dist Дистанция до клетки
*/
public State(int xPos, int yPos, int dist) {
this.xPos = xPos;
this.yPos = yPos;
this.dist = dist;
}
} | [
"sinelshchikovigor@gmail.com"
] | sinelshchikovigor@gmail.com |
83f1baf388efb408a11e7cc47f207c7a8efeadf8 | 584b16d1992e566e76d92c3857270418dfc23e33 | /src/test/evaluation/FSuggPHomtxtFn.java | 635cd9ff510146d5eb7de9f1364962cf19001bd2 | [
"MIT"
] | permissive | mepcotterell/SuggestionEngine | 4485d4a29f96f104562705b8b13b6994a0044018 | b285a026c038b452491878986cbebc41d18bc8ac | refs/heads/master | 2020-04-30T06:36:49.615550 | 2012-07-23T15:50:47 | 2012-07-23T15:50:47 | 2,234,548 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,936 | java |
package test.evaluation;
import java.util.ArrayList;
import java.util.List;
import suggest.ForwardSuggest;
import test.TestMetrics;
import util.WebServiceOpr;
import util.WebServiceOprScore;
/**
* Class to test the Forward Suggestions capability using p-Homomorphism
* input-output matching algorithm.
*
* @author Alok Dhamanaskar
* @see LICENSE (MIT style license file).
*
*/
public class FSuggPHomtxtFn {
public static List<List<Double>> pvals = new ArrayList<List<Double>>();
public static String wublast = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/wublast.sawsdl";
public static String ncbiblast = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/ncbiblast.sawsdl";
public static String psiblast = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/psiblast.sawsdl";
public static String fasta = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/fasta.sawsdl";
public static String clustalW = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/clustalw2.sawsdl";
public static String tcoffee = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/tcoffee.sawsdl";
public static String clustalo = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/clustalo.sawsdl";
public static String muscle = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/muscle.sawsdl";
public static String wsdbfetch = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/WSDbfetch.sawsdl";
public static String wsconverter = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/WSConverter.sawsdl";
public static String filerSeq = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/FilterSequencesWS.sawsdl";
public static String signalp = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/signalp.sawsdl";
public static String iprscan = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/iprscan.sawsdl";
public static String phobius = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/phobius.sawsdl";
public static String wsProtDist = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/wsPhylipProtDist.sawsdl";
public static String wsConsense = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/wsPhylipConsense.sawsdl";
public static String wsProtPars = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/wsPhylipProtPars.sawsdl";
public static String wsNeighbor = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/wsPhylipNeighbor.sawsdl";
public static String clustlPhylogeny = "http://mango.ctegd.uga.edu/jkissingLab/SWS/Wsannotation/resources/clustalw2_phylogeny.sawsdl";
public static String ontology = "owl/obiws.owl";//"http://obi-webservice.googlecode.com/svn/trunk/ontology/webService.owl";
public static void main (String[] args) {
// Specify a desired functionality or operation name
String desiredOps = "";
List<WebServiceOpr> candidateOpsOBI = new ArrayList<WebServiceOpr>();
candidateOpsOBI.add(new WebServiceOpr("filterByEvalScore", filerSeq));
candidateOpsOBI.add(new WebServiceOpr("filterByEvalScoreCSV", filerSeq));
candidateOpsOBI.add(new WebServiceOpr("decode", wsconverter));
candidateOpsOBI.add(new WebServiceOpr("encode", wsconverter));
candidateOpsOBI.add(new WebServiceOpr("csvtoArray", wsconverter));
candidateOpsOBI.add(new WebServiceOpr("arraytoCSV", wsconverter));
candidateOpsOBI.add(new WebServiceOpr("getStyleInfo", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getFormatStyles", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("fetchData", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getSupportedFormats", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getDatabaseInfo", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("fetchBatch", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getSupportedDBs", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getFormatInfo", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getSupportedStyles", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getDatabaseInfoList", wsdbfetch));
candidateOpsOBI.add(new WebServiceOpr("getDbFormats", wsdbfetch));
//----------------------------------------------------------------------
candidateOpsOBI.add(new WebServiceOpr("getParameters", wublast));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", wublast));
candidateOpsOBI.add(new WebServiceOpr("getResult", wublast));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", wublast));
candidateOpsOBI.add(new WebServiceOpr("getStatus", wublast));
candidateOpsOBI.add(new WebServiceOpr("run", wublast));
candidateOpsOBI.add(new WebServiceOpr("getParameters", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("getResult", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("getStatus", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("run", ncbiblast));
candidateOpsOBI.add(new WebServiceOpr("getParameters", psiblast));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", psiblast));
candidateOpsOBI.add(new WebServiceOpr("getResult", psiblast));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", psiblast));
candidateOpsOBI.add(new WebServiceOpr("getStatus", psiblast));
candidateOpsOBI.add(new WebServiceOpr("run", psiblast));
candidateOpsOBI.add(new WebServiceOpr("getParameters", fasta));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", fasta));
candidateOpsOBI.add(new WebServiceOpr("getResult", fasta));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", fasta));
candidateOpsOBI.add(new WebServiceOpr("getStatus", fasta));
candidateOpsOBI.add(new WebServiceOpr("run", fasta));
//----------------------------------------------------------------------
candidateOpsOBI.add(new WebServiceOpr("getParameters", clustalW));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", clustalW));
candidateOpsOBI.add(new WebServiceOpr("getResult", clustalW));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", clustalW));
candidateOpsOBI.add(new WebServiceOpr("getStatus", clustalW));
candidateOpsOBI.add(new WebServiceOpr("run", clustalW));
candidateOpsOBI.add(new WebServiceOpr("getParameters", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("getResult", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("getStatus", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("run", tcoffee));
candidateOpsOBI.add(new WebServiceOpr("getParameters", muscle));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", muscle));
candidateOpsOBI.add(new WebServiceOpr("getResult", muscle));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", muscle));
candidateOpsOBI.add(new WebServiceOpr("getStatus", muscle));
candidateOpsOBI.add(new WebServiceOpr("run", muscle));
candidateOpsOBI.add(new WebServiceOpr("getParameters", clustalo));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", clustalo));
candidateOpsOBI.add(new WebServiceOpr("getResult", clustalo));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", clustalo));
candidateOpsOBI.add(new WebServiceOpr("getStatus", clustalo));
candidateOpsOBI.add(new WebServiceOpr("run", clustalo));
//----------------------------------------------------------------------
candidateOpsOBI.add(new WebServiceOpr("fetchResult", signalp));
candidateOpsOBI.add(new WebServiceOpr("pollQueue", signalp));
candidateOpsOBI.add(new WebServiceOpr("runService", signalp));
candidateOpsOBI.add(new WebServiceOpr("getParameters", iprscan));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", iprscan));
candidateOpsOBI.add(new WebServiceOpr("getResult", iprscan));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", iprscan));
candidateOpsOBI.add(new WebServiceOpr("getStatus", iprscan));
candidateOpsOBI.add(new WebServiceOpr("run", iprscan));
candidateOpsOBI.add(new WebServiceOpr("getParameters", phobius));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", phobius));
candidateOpsOBI.add(new WebServiceOpr("getResult", phobius));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", phobius));
candidateOpsOBI.add(new WebServiceOpr("getStatus", phobius));
candidateOpsOBI.add(new WebServiceOpr("run", phobius));
//----------------------------------------------------------------------
candidateOpsOBI.add(new WebServiceOpr("retrieveNeighborResult", wsNeighbor));
candidateOpsOBI.add(new WebServiceOpr("runNeighbor", wsNeighbor));
candidateOpsOBI.add(new WebServiceOpr("getStatus", wsNeighbor));
candidateOpsOBI.add(new WebServiceOpr("runNeighborDefaultParam", wsNeighbor));
candidateOpsOBI.add(new WebServiceOpr("consenseNonRootedTrees", wsConsense));
candidateOpsOBI.add(new WebServiceOpr("consenseRootedTrees", wsConsense));
candidateOpsOBI.add(new WebServiceOpr("getStatus", wsConsense));
candidateOpsOBI.add(new WebServiceOpr("retrieveConsenseResult", wsConsense));
candidateOpsOBI.add(new WebServiceOpr("protdist", wsProtDist));
candidateOpsOBI.add(new WebServiceOpr("protdistDefaultParameters", wsProtDist));
candidateOpsOBI.add(new WebServiceOpr("getStatus", wsProtDist));
candidateOpsOBI.add(new WebServiceOpr("retrieveProtDistResult", wsProtDist));
candidateOpsOBI.add(new WebServiceOpr("getStatus", wsProtPars));
candidateOpsOBI.add(new WebServiceOpr("runProtPars", wsProtPars));
candidateOpsOBI.add(new WebServiceOpr("retrieveProtParsResult", wsProtPars));
candidateOpsOBI.add(new WebServiceOpr("getParameters", clustlPhylogeny));
candidateOpsOBI.add(new WebServiceOpr("getParameterDetails", clustlPhylogeny));
candidateOpsOBI.add(new WebServiceOpr("getResult", clustlPhylogeny));
candidateOpsOBI.add(new WebServiceOpr("getResultTypes", clustlPhylogeny));
candidateOpsOBI.add(new WebServiceOpr("getStatus", clustlPhylogeny));
candidateOpsOBI.add(new WebServiceOpr("run", clustlPhylogeny));
//----------------------------------------------------------------------
List<WebServiceOpr> workflowOpsOBI = new ArrayList<WebServiceOpr>();
workflowOpsOBI.add(new WebServiceOpr("run", wublast));
desiredOps = "filter sequences";
ForwardSuggest sugg2 = new ForwardSuggest();
List<WebServiceOprScore> suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 2: WUBlast.run -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("getResult", wublast));
desiredOps = "filter sequences";
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 3: WUBlast.run -> WUBlast.getResult -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("filterByEvalScore", filerSeq));
desiredOps = "align multiple sequences";
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 4: WUBlast.run -> WUBlast.getResult -> FilterSequences -> ?");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("run", clustalW));
desiredOps = "construct phylogenetic trees";
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 5: WUBlast.run -> WUBlast.getResult -> FilterSequences ->");
System.out.println("clustalW.run -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("getResult", clustalW));
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 6: WUBlast.run -> WUBlast.getResult -> FilterSequences ->");
System.out.println("clustalW.run -> clustalW.getResult -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("protdistDefaultParameters", wsProtDist));
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 7: WUBlast.run -> WUBlast.getResult -> FilterSequences ->");
System.out.println("clustalW.run -> clustalW.getResult -> protdistDefaultParameters -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("retrieveProtDistResult", wsProtDist));
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 8: WUBlast.run -> WUBlast.getResult -> FilterSequences ->");
System.out.println("clustalW.run -> clustalW.getResult -> protdistDefaultParameters -> retrieveProtDistResult -> ??");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
workflowOpsOBI.add(new WebServiceOpr("runNeighborDefaultParam", wsNeighbor));
suggestOpList2 = sugg2.suggestNextServicepHom(workflowOpsOBI, candidateOpsOBI, desiredOps, ontology, null);
System.out.println("\n");
System.out.println("--------------------------------------------------");
System.out.println("Suggestion for Step 9: WUBlast.run -> WUBlast.getResult -> FilterSequences ->");
System.out.println("clustalW.run -> clustalW.getResult -> protdistDefaultParameters -> retrieveProtDistResult -> "
+ "retrieveProtDistResult -> wsPhylipNeighbor.runNeighborDefaultParam -> ");
System.out.println("--------------------------------------------------");
TestMetrics.printMetrics(suggestOpList2, 0.45);
}// Main ends
}
| [
"alokdhamanaskar@gmail.com"
] | alokdhamanaskar@gmail.com |
8e5719cf5f68f17627a3afa2fdcefcd8a7bb02ff | c9f808b3316a96a4d0a1555a36d6ec47ccb8fd9b | /src/com/javahis/web/form/SysEmrIndexForm.java | 23955006363d05b232e3f1d67ac69001135e1abe | [] | no_license | levonyang/proper-his | f4c19b4ce46b213bf637be8e18bffa3758c64ecd | 2fdcb956b0c61e8be35e056d52a97d4890cbea3f | refs/heads/master | 2022-01-05T09:17:14.716629 | 2018-04-08T01:04:21 | 2018-04-08T01:04:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,224 | java | package com.javahis.web.form;
public class SysEmrIndexForm {
private String adm_date_begin;
private String adm_date_end;
private String adm_type_0;
private String adm_type_1;
private String adm_type_2;
private String adm_type_3;
private String dept_code;
private String sort1;
private String sort2;
private String sort3;
private String view_pattern;
private String case_no;
private String mr_no;
public String getMr_no() {
return mr_no;
}
public void setMr_no(String mrNo) {
mr_no = mrNo;
}
public String getCase_no() {
return case_no;
}
public void setCase_no(String case_no) {
this.case_no = case_no;
}
public String getAdm_date_begin() {
return adm_date_begin;
}
public void setAdm_date_begin(String adm_date_begin) {
this.adm_date_begin = adm_date_begin;
}
public String getAdm_date_end() {
return adm_date_end;
}
public void setAdm_date_end(String adm_date_end) {
this.adm_date_end = adm_date_end;
}
public String getDept_code() {
return dept_code;
}
public void setDept_code(String dept_code) {
this.dept_code = dept_code;
}
public String getSort1() {
return sort1;
}
public void setSort1(String sort1) {
this.sort1 = sort1;
}
public String getSort2() {
return sort2;
}
public void setSort2(String sort2) {
this.sort2 = sort2;
}
public String getSort3() {
return sort3;
}
public void setSort3(String sort3) {
this.sort3 = sort3;
}
public String getView_pattern() {
return view_pattern;
}
public void setView_pattern(String view_pattern) {
this.view_pattern = view_pattern;
}
public String getAdm_type_0() {
return adm_type_0;
}
public void setAdm_type_0(String adm_type_0) {
this.adm_type_0 = adm_type_0;
}
public String getAdm_type_1() {
return adm_type_1;
}
public void setAdm_type_1(String adm_type_1) {
this.adm_type_1 = adm_type_1;
}
public String getAdm_type_2() {
return adm_type_2;
}
public void setAdm_type_2(String adm_type_2) {
this.adm_type_2 = adm_type_2;
}
public String getAdm_type_3() {
return adm_type_3;
}
public void setAdm_type_3(String adm_type_3) {
this.adm_type_3 = adm_type_3;
}
}
| [
"licx@ACA803A0.ipt.aol.com"
] | licx@ACA803A0.ipt.aol.com |
7e4522b72b67b5635893f096781015ac13cf5859 | 189d2ccca390c0b5f53079b40a308831655c17e2 | /src/main/java/microsoft/exchange/webservices/data/ItemWrapper.java | fbd0f5ef2488ec399c07b18b406a1dd0a0cc9982 | [
"Apache-2.0"
] | permissive | XiaoChangyu/EWS-Java-API | 24a26806d07c4d65729651df36c47d88ff59ab49 | 506d3a883d1e94994ed2325d4a97d06291e4a042 | refs/heads/master | 2020-12-02T08:14:31.941615 | 2017-07-10T17:25:33 | 2017-07-10T17:25:33 | 96,792,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,554 | java | /**************************************************************************
* copyright file="ItemWrapper.java" company="Microsoft"
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Defines the ItemWrapper.java.
**************************************************************************/
package microsoft.exchange.webservices.data;
import microsoft.exchange.webservices.data.exceptions.ServiceLocalException;
/***
* Represents an item Id provided by a ItemBase object.
*/
class ItemWrapper extends AbstractItemIdWrapper {
/***
*The ItemBase object providing the Id.
*/
private Item item;
/**
* * Initializes a new instance of ItemWrapper.
*
* @param item
* the item
* @throws ServiceLocalException
* the service local exception
*/
protected ItemWrapper(Item item) throws ServiceLocalException {
EwsUtilities
.EwsAssert(item != null, "ItemWrapper.ctor", "item is null");
EwsUtilities.EwsAssert(!item.isNew(), "ItemWrapper.ctor",
"item does not have an Id");
this.item = item;
}
/***
*Obtains the ItemBase object associated with the wrapper.
*
* @return The ItemBase object associated with the wrapper
*/
public Item getItem() {
return this.item;
}
/**
* * Writes the Id encapsulated in the wrapper to XML.
*
* @param writer
* the writer
* @throws Exception
* the exception
*/
@Override
protected void writeToXml(EwsServiceXmlWriter writer) throws Exception {
this.item.getId().writeToXml(writer);
}
}
| [
"CCCC@gmail.com"
] | CCCC@gmail.com |
faddd49a275af886c01b11b52f8d6bfb77d35e83 | 52ec82cc7a869ffb4886733baadf6003a5524deb | /base-swing/src/main/java/de/freese/base/swing/components/text/AutoCompleteableTextField.java | 5a0d63f951e308c4419b7fe084d99a627a0d36ce | [] | no_license | tfreese/base-components | bcb87e0b82c3f2934004bbf354035030ca026c07 | f9ce5ca3d8a2c26b7e5a0639253eeb4a3b96b53f | refs/heads/master | 2023-08-17T12:02:22.139352 | 2023-08-16T14:46:10 | 2023-08-16T14:46:10 | 5,068,668 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,182 | java | package de.freese.base.swing.components.text;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.Serial;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.MenuElement;
import javax.swing.MenuSelectionManager;
import javax.swing.SwingUtilities;
/**
* TextField was eine Autovervollständigung bietet aus den vorherigen Eingaben.
*
* @author Thomas Freese
*/
public class AutoCompleteableTextField extends JTextField {
@Serial
private static final long serialVersionUID = 8765972663291526963L;
/**
* MenuAction um den darin enthaltenen Text in das Textfeld zu setzten.
*
* @author Thomas Freese
*/
private class PrevSearchAction extends AbstractAction {
@Serial
private static final long serialVersionUID = -6115968950918667824L;
private final String term;
PrevSearchAction(final String term) {
super();
this.term = term;
putValue(Action.NAME, this.term);
}
/**
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(final ActionEvent e) {
Runnable runner = () -> {
setText(PrevSearchAction.this.term);
// getFilterTextField().setCaretPosition(term.length());
requestFocus();
};
SwingUtilities.invokeLater(runner);
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return this.term;
}
}
private final LinkedList<String> prevSearches = new LinkedList<>();
private JPopupMenu prevSearchMenu;
public AutoCompleteableTextField() {
this(0);
}
public AutoCompleteableTextField(final int columns) {
super(columns);
addFocusListener(new FocusAdapter() {
/**
* @see java.awt.event.FocusAdapter#focusLost(java.awt.event.FocusEvent)
*/
@Override
public void focusLost(final FocusEvent e) {
if ((AutoCompleteableTextField.this.prevSearchMenu == null) || !AutoCompleteableTextField.this.prevSearchMenu.isVisible()) {
saveLastSearch();
}
}
});
addKeyListener(new KeyAdapter() {
/**
* @see java.awt.event.KeyAdapter#keyReleased(java.awt.event.KeyEvent)
*/
@Override
public void keyReleased(final KeyEvent e) {
if ((e.getKeyCode() == KeyEvent.VK_ENTER) || (e.getKeyCode() == KeyEvent.VK_TAB)) {
JPopupMenu popupMenu = AutoCompleteableTextField.this.prevSearchMenu;
// Wenn das PopupMenu geöffnet ist, das selektierte MenuItem ausführen.
if ((popupMenu != null) && popupMenu.isVisible()) {
MenuElement[] path = MenuSelectionManager.defaultManager().getSelectedPath();
if (path.length > 0) {
JMenuItem menuItem = (JMenuItem) path[path.length - 1];
menuItem.doClick();
popupMenu.setVisible(false);
}
return;
}
// Bei Enter oder Tabulator den Fokus wechseln und so den neuen Text zu Vervollständigung aufnehmen.
transferFocus();
}
else if (Character.isJavaIdentifierPart(e.getKeyChar())) {
// Popup einblenden
popupMenu(0, (int) getSize().getHeight());
}
}
});
}
private void popupMenu(final int x, final int y) {
if (this.prevSearchMenu != null) {
this.prevSearchMenu.setVisible(false);
this.prevSearchMenu.removeAll();
this.prevSearchMenu = null;
}
if ((!this.prevSearches.isEmpty()) && (getText().strip().length() > 0)) {
this.prevSearchMenu = new JPopupMenu();
Iterator<String> it = this.prevSearches.iterator();
List<String> matches = new ArrayList<>();
// Treffer herausfinden
while (it.hasNext()) {
String search = it.next();
if (search.contains(getText().strip())) {
matches.add(search);
}
}
// Treffer sortieren
Collections.sort(matches);
for (String element : matches) {
Action action = new PrevSearchAction(element);
this.prevSearchMenu.add(action);
}
if (this.prevSearchMenu.getComponentCount() > 0) {
this.prevSearchMenu.show(this, x, y);
// Cursor wieder zurück ins Textfeld.
// if (!hasFocus())
// {
requestFocus();
// }
}
}
}
/**
* Text im Textfeld in die Historie aufnehmen, max. 10 Einträge.
*/
private void saveLastSearch() {
String search = getText().strip();
if ((search != null) && (search.length() > 1) && !this.prevSearches.contains(search)) {
// System.out.println("AutoCompleteableTextField.saveLastSearch(): " + search);
this.prevSearches.addFirst(search);
if (this.prevSearches.size() > 10) {
this.prevSearches.removeLast();
}
}
}
}
| [
"community@freese-home.de"
] | community@freese-home.de |
b78d9bd0bbb8e26289cb7e62e56c1c1453f1c098 | 526dc60ddb0a622a6677ba3481017a1a3c3e2e81 | /factoryMethodPattern/src/test/java/mx/iteso/factory/PozolesTest/PozoleBlancoPiernaTest.java | 8f8551b8ab9eaf170c9c752902a64d6e43036ede | [] | no_license | HoustonSal/software-design | ecc33fee1ec159b5c5d14fa1d75a588d210836fc | 462dbb2c2a26970160f48f1e5ada1988898dd0a0 | refs/heads/master | 2016-09-06T12:38:08.289183 | 2015-12-04T07:33:31 | 2015-12-04T07:33:31 | 42,418,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package mx.iteso.factory.PozolesTest;
import mx.iteso.factory.Pozole;
import mx.iteso.factory.pozoles.PozoleBlancoOreja;
import mx.iteso.factory.pozoles.PozoleBlancoPierna;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
/**
* Created by houstonsalgado on 19/10/15.
*/
public class PozoleBlancoPiernaTest {
private Pozole pozole;
@Before
public void setUp(){
pozole = mock((Pozole.class));
}
@Test
public void testPozole(){
Pozole pozole = new PozoleBlancoPierna();
assertEquals(pozole.getName(),"Pozole Blanco de Pierna");
assertEquals(pozole.broth, "Caldo Blanco");
}
}
| [
"houstonsistemas@gmail.com"
] | houstonsistemas@gmail.com |
1a8931852bbf9461c114379a7829beeb37176763 | cabdbc9cf17efa6b2007f5f12ddb78cf34d47e63 | /app/src/main/java/com/crookk/pkmgosp/local/model/Data.java | aacb95dc5284abf503b45458c5f0d74b480bb638 | [] | no_license | kaiyan910/PokemonGoSP | c1af8d7edac238bc74ead1d3da9df620872e6025 | 0726fb12455f8367baf2d8c32b5d56e6a497d5b1 | refs/heads/master | 2021-01-11T00:03:12.065060 | 2016-10-14T15:38:20 | 2016-10-14T15:38:20 | 70,764,633 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package com.crookk.pkmgosp.local.model;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
public class Data {
@SerializedName("spawns")
private List<Spawn> spawnList = new ArrayList<>();
@SerializedName("gyms")
private List<Gym> gymList = new ArrayList<>();
@SerializedName("stops")
private List<PokeStop> pokeStopList = new ArrayList<>();
public List<Spawn> getSpawnList() {
return spawnList;
}
public void setSpawnList(List<Spawn> spawnList) {
this.spawnList = spawnList;
}
public List<Gym> getGymList() {
return gymList;
}
public void setGymList(List<Gym> gymList) {
this.gymList = gymList;
}
public List<PokeStop> getPokeStopList() {
return pokeStopList;
}
public void setPokeStopList(List<PokeStop> pokeStopList) {
this.pokeStopList = pokeStopList;
}
}
| [
"19890910"
] | 19890910 |
067f97b028ad1c5a401b4bd2fbbb79c8ecb52876 | 9c168da180036731cbbe1652d55b2074a36fe6a0 | /app/src/main/java/com/example/parentapplication/CodeActivity.java | 8cdd140ffeb0b5a2703e68ad58544837a4a9e1cb | [] | no_license | Navjotkaur1999/parent-application | 8a94fe065711d635dd9920393f32b678e198b9b3 | 9d5ca8c0580ac233220381d281c34396dca3ba12 | refs/heads/master | 2021-01-03T11:35:35.784080 | 2020-02-12T17:01:43 | 2020-02-12T17:01:43 | 240,065,685 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.example.parentapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class CodeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_code);
}
}
| [
"jotnav1999@gmail.com"
] | jotnav1999@gmail.com |
6e6e5377f87d1563dc31ca25055e172f5828ee93 | cd5670045206016386ce8d696a1443e8108744b8 | /src/Constants.java | bad08cea10fe4afb7115c9fd0b3a8619a64eaf0a | [] | no_license | mkorniie/QueryPerformer | 130b1c9e079b106e1474f2a4ee7831cdfe01f6fe | 5841b2c481aaf8aaade6464ac42c8d8de430e0fe | refs/heads/master | 2020-03-25T18:04:49.751375 | 2018-08-08T19:08:44 | 2018-08-08T19:08:44 | 144,012,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | import java.text.SimpleDateFormat;
public final class Constants {
public static int MAX_NUMBER_OF_LINES = 100000;
public static int NUMBER_OF_SERVICES = 10;
public static int NUMBER_OF_SERVICE_VARIATIONS = 3;
public static int NUMBER_OF_QUESTION_TYPES = 10;
public static int NUMBER_OF_QUESTION_CATEGORIES = 20;
public static int NUMBER_OF_QUESTION_SUBCATEGORIES = 5;
public static String [] RESPONSE_TYPES = {"P", "N"};
public static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat ("dd.MM.yyyy");
private Constants(){
throw new AssertionError();
}
}
| [
"Maria@MacBook-Air-Maria.local"
] | Maria@MacBook-Air-Maria.local |
4e1b81a937cc6acde4d4d9d78b44f50dae29cc0b | 03462483890d138caa1fad3dca3d5aa75639f7af | /shop/src/main/java/ro/msg/learning/service/interfaces/CustomerService.java | 5920b0ba1f83834f762e9d147de89cf23e1fee5a | [
"MIT"
] | permissive | ro-msg-spring-training/online-shop-PatriciaPopa21 | 18bf2d3f4717ce574629f0ac5cd9e24b6094aa4b | 50fbaefe7282beb6f4e4ef6ef7ae2a31f648f7b9 | refs/heads/master | 2021-03-03T13:33:23.318128 | 2020-04-29T10:41:06 | 2020-04-29T10:41:06 | 245,964,373 | 1 | 0 | MIT | 2020-04-29T10:41:08 | 2020-03-09T06:55:39 | Java | UTF-8 | Java | false | false | 259 | java | package ro.msg.learning.service.interfaces;
import java.util.Optional;
import ro.msg.learning.entity.Customer;
public interface CustomerService {
Optional<Customer> getCustomerById(Integer customerId);
Customer getCustomerByUsername(String username);
}
| [
"popap@msgn12928.int.root.msg.ag"
] | popap@msgn12928.int.root.msg.ag |
bd17df592e224f1ca66c292839f728c8cdede3fe | fe1176770c1ffc3fefdb635b0b9ef186d6d8a13d | /src/main/java/com/cybertek/repositories/RoleRepository.java | 8bc05d85e58f449d8efc115baec979acc9c43530 | [] | no_license | MrtYvz192/jd-ticketing-project-rest | 12f975bcc819e3ee73996d66c36a8c94493fec1d | ac7f49c8c9315ba312bb04056900ff8d967270e2 | refs/heads/master | 2023-06-21T08:27:45.556795 | 2021-07-26T13:06:19 | 2021-07-26T13:06:19 | 383,577,948 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.cybertek.repositories;
import com.cybertek.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface RoleRepository extends JpaRepository<Role,Long> {
Role findByDescription(String description);
}
| [
"wingsoverthesky@gmail.com"
] | wingsoverthesky@gmail.com |
6c009229158625ec6db524054a3072d594f10b45 | 1f69cbc34ea32ed896c117380376d1445181d6e0 | /ListaDeJogos/app/src/androidTest/java/br/senai/sp/informatica/mobileb/listadejogos/ExampleInstrumentedTest.java | d572f039d0048cbd74eb544ce2831dee7663fb9b | [] | no_license | vteodoro/ExerciciosAndroid | cc6de6341f0eddaafaaa857d441b7243310070f0 | 8bdb5627a8b69bc7afbe96a502f3e44ba6c7dacd | refs/heads/master | 2021-05-08T00:02:37.323781 | 2018-02-24T00:58:06 | 2018-02-24T00:58:06 | 107,596,836 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package br.senai.sp.informatica.mobileb.listadejogos;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("br.senai.sp.informatica.mobileb.listadejogos", appContext.getPackageName());
}
}
| [
"viviteodoro19@gmail.com"
] | viviteodoro19@gmail.com |
825f65a00fe60385e0345527b7632969bbfbf1f0 | 100a358a16735e6ca84b3cb8067244c2240f8ecb | /dubbo-learning/dubbo-provider/src/main/java/com/learning/integration/dubbo/provider/api/SpiService.java | cb11de6027fef23aefc67ea61f307d4fb66b3622 | [] | no_license | lovelycheng/learning-integration | 2d195e79efbadcfc4602f0b126129af478076b30 | cc9793f3d56f7e0fd01a1109f2d5de17dd65f0a4 | refs/heads/master | 2022-06-29T19:04:10.799610 | 2021-03-23T05:27:54 | 2021-03-23T05:27:54 | 213,602,327 | 0 | 0 | null | 2022-01-12T23:06:17 | 2019-10-08T09:32:58 | Java | UTF-8 | Java | false | false | 160 | java | package com.learning.integration.dubbo.provider.api;
/**
* @author chengtong
* @date 2019-10-20 22:41
*/
public interface SpiService {
void saySpi();
}
| [
"chengtong@treefinance.com.cn"
] | chengtong@treefinance.com.cn |
a2b089e2883253f9da0b31c659c6249c934f19ae | 8037a5b2396b1970365bde9884faec7d117e932f | /src/easy/canWin/Solution.java | b09eff9a4f8a0587de6061e4a267c13f3f8bbb0f | [] | no_license | dastuer/LeetCode | b4ee6eb1a915cce5f4994a0c364ce1efcf5fcd48 | e47b6ef70e3ed842224a9d92ea5e58e4fabf0175 | refs/heads/master | 2023-08-14T16:36:29.486026 | 2021-09-19T14:42:07 | 2021-09-19T14:42:07 | 372,913,778 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 610 | java | package easy.canWin;
public class Solution {
/**
* https://leetcode-cn.com/problems/nim-game/
* @param
* @return
*/
// 面对4的整数倍的人永远无法翻身,你拿N根对手就会拿4-N根,保证每回合共减4根,你永远对面4倍数,直到4.
// 相反,如果最开始不是4倍数,你可以拿掉刚好剩下4倍数根,让他永远对面4倍数。
// 谁拿的时候是 4的整数倍 必输,因为另外一个人在你拿过后再拿,总能保持剩余数是4的整数倍
public boolean canWinNim(int n) {
return !(n%4==0);
}
}
| [
"2366880229@qq.com"
] | 2366880229@qq.com |
f6adcffbe3744e850dae7c3ec6e48582dd20e00a | 4958afe8b091a3098a335ed97e559c04ef159cbd | /src/main/java/fi/luontola/cqrshotel/reservation/commands/MakeReservationHandler.java | fc8a3af1b5824472b12060ad70fcb9527a0d1a06 | [
"Apache-2.0"
] | permissive | hekailiang/cqrs-hotel | 518866a9fae1bc299d5facdd7c4a7c36e7cf3597 | 01f2832b1957dc64c4950a1703d5f3227ae7066e | refs/heads/master | 2023-08-31T11:47:28.747284 | 2017-04-24T08:44:30 | 2017-04-24T08:44:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | // Copyright © 2016-2017 Esko Luontola
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package fi.luontola.cqrshotel.reservation.commands;
import fi.luontola.cqrshotel.framework.Handler;
import fi.luontola.cqrshotel.reservation.Reservation;
import fi.luontola.cqrshotel.reservation.ReservationRepo;
import java.time.Clock;
public class MakeReservationHandler implements Handler<MakeReservation, Void> {
private final ReservationRepo repo;
private final Clock clock;
public MakeReservationHandler(ReservationRepo repo, Clock clock) {
this.repo = repo;
this.clock = clock;
}
@Override
public Void handle(MakeReservation command) {
Reservation reservation = repo.getById(command.reservationId);
int originalVersion = reservation.getVersion();
reservation.updateContactInformation(command.name, command.email);
reservation.makeReservation(command.startDate, command.endDate, clock);
repo.save(reservation, originalVersion);
return null;
}
}
| [
"esko@luontola.fi"
] | esko@luontola.fi |
377c7d6f11f57f47141543aed666c422ea18a41b | 717ab272d1146c5d3318d826647fb48077bc9ca1 | /modules/cfg-parser/resources/script/Test.java | 703cac436544e8c7aa696de631924930cb19e112 | [
"Unlicense"
] | permissive | mossishahi/scriptplayground | 1b4bbf7a902f929260078c2b71563bd1dcecd456 | 3e06d92bd3daf5c40216867e56e03748526241da | refs/heads/master | 2020-04-11T17:54:50.161947 | 2015-07-06T09:39:59 | 2015-07-06T09:39:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | public class Test {
static int a = 10; // intConst
private static double d = 0.1;
public double value = (((0.943 - 0.3239)));
public static int myFunc1(String args) {
while ((a + d)*d < 200) {
if (d == 0.1) {
a = a + 5;
} else {
a = a - 5;
}
}
// create objects
Integer t1 = new Integer(1);
Integer t2 = new Integer(2).compareTo(new Integer(5));
Integer t3 = new Integer(3).intValue();
// call methods
Test.myFunc2(5, 10);
double b = myFunc2(3, 4);
return a;
}
private static double myFunc2(double b, int c) {
if (true) {
b = b + (d - a);
} else{
}
if (c < 2) {
d = d * 2;
} else {
c = 0;
}
return d * b;
}
}
| [
"mkarlsson@open-software-solutions.ch"
] | mkarlsson@open-software-solutions.ch |
8bf2c9a73ab674502550937618d86d1310c930f8 | c1cd08c4cae988cba62b146efab7e01690bf3e17 | /ZapposAPI/src/com/zappos/sgambhir/tests/TestOutcome.java | 58ed0ee098aa2e4f39d21b0e6d7ba01967a8c6c1 | [] | no_license | shrgam/Restaurant-API | 109562d8405e172a96a56080a23a9e80656ed4d8 | dc219c6b4885d5555c4dec13b457db33b76e6fa0 | refs/heads/master | 2020-03-11T13:47:18.090452 | 2018-04-19T09:55:03 | 2018-04-19T09:55:03 | 129,664,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | package com.zappos.sgambhir.tests;
/**
* @author Shriya
*
*/
public class TestOutcome {
private Boolean result;
private String output ;
/**
* @param result
* @param output
*/
public TestOutcome(Boolean result, String output){
this.result = result;
this.output = output;
}
public TestOutcome(){
this.result = false;
this.output = new String();
}
public Boolean getResult() {
return result;
}
/**
* @param result
*/
public void setResult(Boolean result){
this.result = result;
}
public String getOutput() {
return output ;
}
/**
* @param reason
*/
public void setOutput(String reason){
this.output = reason;
}
@Override
public String toString() {
if (output.equals(""))
{
output = "No error";
}
return String.format(result + " , " + output );
}
} | [
"shriyagambhir94@gmail.com"
] | shriyagambhir94@gmail.com |
35e8fea82b1164d77b16909ddde40a67cb8251dc | 2d27b4d2aca7f590485f914a6fae6e979338a951 | /src/conversation/Conversation.java | 8a81dc69651e0a3ebbcd3293461a283a194717b4 | [] | no_license | dafrito/Riviera | af71c4b40cafed972e6d8c21d87fab42684284bb | 1de0336961b78fde5593645c45e5077cbb49f773 | refs/heads/master | 2021-12-01T01:57:46.068373 | 2021-11-16T13:39:07 | 2021-11-16T13:40:31 | 674,718 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,561 | java | package conversation;
import java.util.Set;
/**
* Represents a logical grouping of {@link Speaker} objects. Conversations may
* be derived from some lower level of conversation. For example, network
* communications represent a conversation, with packets being the messages.
* This global "conversation" is isolated to a network interface. Listeners to
* this conversation may, however, recognize sub-conversations taking place, and
* are encouraged to create their own {@code Conversation} implementations to
* reflect this. Through the derivations of conversations, more and more
* sophisticated translations of messages can occur.
*
* @author Aaron Faanes
*
* @param <E>
* the type of message expected by this conversation
*/
public interface Conversation<E extends Message<E>> {
/**
* Adds a listener to this conversation.
*
* @param listener
* the listener to add
*/
public void addConversationListener(ConversationListener<? super E> listener);
/**
* Removes a listener from this conversation.
*
* @param listener
* the listener to remove
*/
public void removeConversationListener(ConversationListener<? super E> listener);
/**
* Returns all speakers that are currently involved in this conversation.
* <p>
* What defines being "involved" depends on the implementation. Network
* conversations may simply use timeouts to periodically delete inactive
* speakers.
*
* @return the group of active speakers
*/
public Set<Speaker<? extends E>> getSpeakers();
}
| [
"dafrito@gmail.com"
] | dafrito@gmail.com |
8a52ef0977b8cf13737e5413e9e89da5c00e0ed5 | 5f9447b621a7a9aaa55fa320395fce12cd844439 | /COVES/trunk/COVES/COVES-ejb/src/main/java/com/gestion/coves/services/InventarioTiendaServiceLocal.java | 88ed6e0a83ce83a7f6125560a30294d55042fe12 | [] | no_license | alexanderchiran/FindPatternAPI | 4f0b14cee39ea2f1147bccdb1712e59139170162 | 4370f74886d7fd38ceb93d59885ebbb61ce00bcb | refs/heads/master | 2023-04-02T18:36:38.726214 | 2020-08-13T23:17:04 | 2020-08-13T23:17:04 | 153,704,247 | 0 | 1 | null | 2023-03-27T22:16:39 | 2018-10-19T00:28:53 | TSQL | UTF-8 | Java | false | false | 858 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.gestion.coves.services;
import com.gestion.coves.dominio.entities.InventarioTienda;
import com.gestion.coves.dto.InventarioDTO;
import com.gestion.coves.exception.ExceptionControl;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author Alexander Chiran
*/
@Local
public interface InventarioTiendaServiceLocal {
public List<InventarioTienda> findAll();
public void edit(InventarioTienda selected);
public InventarioTienda find(Object id);
public void actualizarInventarioTienda(InventarioDTO inventario) throws ExceptionControl;
public InventarioTienda findByTiendaProducto(Integer idTienda, Integer idProducto);
}
| [
"paulo.alexander12@gmail.com"
] | paulo.alexander12@gmail.com |
a8c118e885350d1a0775377bf9c25029b2f0fc7f | 64bcf7d49332278e9077a17333aa34dbb4b97500 | /src/main/java/com/bevelio/arcade/listeners/GameStateListener.java | bfae557a0d5a01898030ac7a1e6f6474c392ea7f | [] | no_license | CyberFlameGO/BevsArcade | 32c8438772ed2657fc2db1f967628ef20cf17692 | 539c9324e4f35cb9dd3b0380d318e32ec4347f75 | refs/heads/master | 2021-05-16T22:36:21.510813 | 2019-11-17T12:54:57 | 2019-11-17T12:54:57 | 250,498,048 | 0 | 0 | null | 2020-03-27T09:56:03 | 2020-03-27T09:55:13 | null | UTF-8 | Java | false | false | 5,011 | java | package com.bevelio.arcade.listeners;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import com.bevelio.arcade.ArcadePlugin;
import com.bevelio.arcade.commands.DebugCommands;
import com.bevelio.arcade.configs.files.LobbyConfig;
import com.bevelio.arcade.events.PreApplyKitEvent;
import com.bevelio.arcade.games.Game;
import com.bevelio.arcade.managers.GameManager;
import com.bevelio.arcade.misc.CC;
import com.bevelio.arcade.events.GameStateChangeEvent;
import com.bevelio.arcade.types.GameState;
import com.bevelio.arcade.types.Kit;
import com.bevelio.arcade.types.Team;
import com.bevelio.arcade.utils.PlayerUtils;
import com.bevelio.arcade.utils.ShapeUtils;
public class GameStateListener implements Listener
{
private LobbyConfig lc;
private GameManager gm;
public GameStateListener()
{
this.lc = ArcadePlugin.getInstance().getConfigManager().getLobbyConfig();
this.gm = ArcadePlugin.getInstance().getGameManager();
}
@SuppressWarnings("deprecation")
@EventHandler
public void onGameState(GameStateChangeEvent e)
{
if(this.gm.getGame() != null)
{
int minPlayers = ArcadePlugin.getInstance().getConfigManager().getMainConfig().getMinNumberOfPlayersToStart();
if(gm.getInteractivePlayers().size() < minPlayers && (e.getTo() == GameState.STARTING ))
{
e.setCancelled(true);
return;
}
Game game = this.gm.getGame();
if(e.getTo() == game.getRegisterAtState())
Bukkit.getPluginManager().registerEvents(game, ArcadePlugin.getInstance());
if(e.getTo() == GameState.PREGAME)
{
game.onPreStart();
game.onStartAnnouncement();
}
else if(e.getTo() == GameState.LIVE)
{
game.onStart();
e.setSeconds(game.getWorldData().maxSeconds);
}
else if(e.getTo() == GameState.FINISHING)
{
this.gm.getGame().onEndAnnouncement();
}
}
if(e.getTo() == GameState.WAITING)
{
if(e.getFrom() != GameState.STARTING)
{
if(lc.isPlateformGenerate())
{
lc.getPlateformFloorBlocks();
lc.getPlateformWallsBlocks();
int radius = lc.getPlateformRadius();
ShapeUtils.getCircle(lc.getSpawnLocation().clone().add(0, -2, 0), false, radius).forEach(loc ->
{
Block block = loc.getBlock();
block.setType(lc.getPlateformFloorBlocks().getType());
block.setData(lc.getPlateformFloorBlocks().getData().getData());
});
}
HandlerList.unregisterAll(gm.getGame());
gm.nextGame(); //Create new game.
Bukkit.getOnlinePlayers().forEach(player ->
{
if(!gm.isInteractivePlayer(player)) return;
player.setFlying(false);
player.setAllowFlight(false);
DebugCommands.message(player, "You have been respawned.");
player.setMaxHealth(20);
player.setHealth(20);
player.setFoodLevel(20);
player.setSaturation(1f);
Bukkit.getOnlinePlayers().forEach(viewer ->
{
if(viewer != player)
if(!viewer.canSee(player))
viewer.showPlayer(player);
});
if(gm.isInteractivePlayer(player))
{
gm.toLobby(player);
}
});
}
}
if(e.getTo() == GameState.STARTING)
gm.getGame().hanndleTeamPreferences();
if(e.getTo() == GameState.PREGAME)
{
gm.getGame().hanndleTeamPreferences();
Bukkit.getOnlinePlayers().forEach(player ->
{
if(gm.isInteractivePlayer(player))
{
String teamName = null;
for(Entry<String, ArrayList<UUID>> prefTeamSet : gm.getGame().getPlayersPrefTeams().entrySet())
if(prefTeamSet.getValue().contains(player.getUniqueId()))
teamName = prefTeamSet.getKey();
if(teamName == null)
gm.getGame().hanndleTeamPreferences();
Team team = gm.getGame().getTeam(teamName);
if(team == null) return;
gm.getGame().addMember(team, player);
DebugCommands.message(player, "You are in team " + team.getDisplayName() + CC.gray + "!");
}
});
}
if(e.getTo() == GameState.PREGAME)
{
Bukkit.getOnlinePlayers().forEach(player ->
{
if(gm.isInteractivePlayer(player))
gm.getGame().respawnPlayer(player);
});
//this.teleportAllToNewGame();
}
}
public void teleportAllToNewGame()
{
World world = null;
System.out.println("World: " + ArcadePlugin.getInstance().getWorldManager().getWorld());
System.out.println("Next World: " + ArcadePlugin.getInstance().getWorldManager().getNextWorld());
world = ArcadePlugin.getInstance().getWorldManager().getWorld();
Location location = new Location(world , 530, 0, 811);
Bukkit.getOnlinePlayers().forEach(player ->
{
if(gm.isInteractivePlayer(player))
player.teleport(location);
});
}
}
| [
"github@heathlogancampbell.com"
] | github@heathlogancampbell.com |
052b9e0dc4d8b04cc4c61a87bd4ee26c1bd1aca8 | cb4321ccfa2fc59d958276af5948c14a9fd724cb | /src/main/java/com/xt/utils/MailUtils.java | 822931a6caa319e633b898f805ea34aa4d9a80a3 | [] | no_license | xt66570/xtblog | 8c195e6aa2b65a02a02254e466ccc14a770dff4c | 9871a438400d16e7392d49493b187aaff5d73092 | refs/heads/master | 2023-03-22T15:20:22.177237 | 2021-03-16T09:36:53 | 2021-03-16T09:36:53 | 348,281,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,155 | java | package com.xt.utils;
import org.slf4j.Logger;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
public class MailUtils {
//邮件发送器
private JavaMailSenderImpl mailSender;
Logger logger = LogUtils.getInstance(MailUtils.class);
public MailUtils(JavaMailSenderImpl mailSender){
this.mailSender = mailSender;
}
/**
* 发送简单邮件
* @param title 邮件标题
* @param text 邮件内容(简单邮件不支持HTML标签)
* @param acceptEmail 接收方邮件
*/
public void sendSimpleMailMessage(String title,String text,String acceptEmail){
logger.warn("开始发送简单邮件...");
logger.warn("mailSender对象为:"+mailSender);
SimpleMailMessage message = new SimpleMailMessage();
message.setSubject(title);
message.setText(text);
message.setFrom("1799250230@qq.com");
message.setTo(acceptEmail);
System.out.println(mailSender);
logger.warn("message对象为:"+message);
mailSender.send(message);
}
/**
* 发送复杂邮件(支持邮件内容HTML解析)
* @param title 邮件标题
* @param text 邮件内容(简单邮件不支持HTML标签)
* @param acceptEmail 接收方邮件
* @throws MessagingException
*/
public void sentComplexMailMessage(String title,String text,String acceptEmail){
MimeMessage mimeMessage = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage);
try {
helper.setSubject(title);
helper.setText(text,true);
helper.setFrom("1799250230@qq.com");
helper.setTo(acceptEmail);
} catch (MessagingException e) {
e.printStackTrace();
}
mailSender.send(mimeMessage);
}
public void sendReplyEmail(String title,String comment,String url,String acceptEmail){
MimeMessage mimeMessage = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage);
try {
helper.setSubject("作者回复了你在《"+title+"》下的留言");
helper.setText("<div style='padding:25px;border:10px solid rgba(204, 204, 51, 0.8);height:300px;width:220px;font-size:14px;line-height:22px;'>\n" +
" <h1 style='margin:0;padding:0;font-size:18px;'>作者回复</h1>\n" +
" <hr>\n" +
" <p style='margin:0;padding:0;text-indent:2em;'>"+comment+"</p>\n" +
" <hr>\n" +
" <a href='"+url+"' style='float: right;text-underline: none'>查看原文</a>" +
"</div>",true);
helper.setFrom("1799250230@qq.com");
helper.setTo(acceptEmail);
} catch (MessagingException e) {
e.printStackTrace();
}
mailSender.send(mimeMessage);
}
}
| [
"1799250230@qq.com"
] | 1799250230@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.