blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6b80d6090f2cbb400b5e53d0cd9be83c96151cb1
|
91a6b096439979acb5c08266f9309d615125e9ef
|
/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/WirelessFluidGrid.java
|
209fb7742b79dd691d1f1e800f96e4d6c0420c84
|
[
"MIT"
] |
permissive
|
jazzpi/refinedstorage
|
c0cfbbcda8015e8924da1e87ea8cf4bbcd6ca91b
|
d341b7244a3998117142803297c7e7d33c7f5143
|
refs/heads/mc1.11
| 2021-01-13T12:51:01.868364
| 2017-01-09T17:36:28
| 2017-01-09T17:36:28
| 78,469,374
| 0
| 0
| null | 2017-01-09T21:11:12
| 2017-01-09T21:11:12
| null |
UTF-8
|
Java
| false
| false
| 5,796
|
java
|
package com.raoulvdberge.refinedstorage.tile.grid;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
import com.raoulvdberge.refinedstorage.block.EnumGridType;
import com.raoulvdberge.refinedstorage.gui.grid.GridFilter;
import com.raoulvdberge.refinedstorage.gui.grid.GridTab;
import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBasic;
import com.raoulvdberge.refinedstorage.item.ItemWirelessFluidGrid;
import com.raoulvdberge.refinedstorage.network.MessageWirelessFluidGridSettingsUpdate;
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
public class WirelessFluidGrid implements IGrid {
private ItemStack stack;
private int controllerDimension;
private BlockPos controller;
private int sortingType;
private int sortingDirection;
private int searchBoxMode;
private int size;
public WirelessFluidGrid(int controllerDimension, ItemStack stack) {
this.controllerDimension = controllerDimension;
this.controller = new BlockPos(ItemWirelessFluidGrid.getX(stack), ItemWirelessFluidGrid.getY(stack), ItemWirelessFluidGrid.getZ(stack));
this.stack = stack;
this.sortingType = ItemWirelessFluidGrid.getSortingType(stack);
this.sortingDirection = ItemWirelessFluidGrid.getSortingDirection(stack);
this.searchBoxMode = ItemWirelessFluidGrid.getSearchBoxMode(stack);
this.size = ItemWirelessFluidGrid.getSize(stack);
}
public ItemStack getStack() {
return stack;
}
@Override
public EnumGridType getType() {
return EnumGridType.FLUID;
}
@Override
@Nullable
public INetworkMaster getNetwork() {
World world = DimensionManager.getWorld(controllerDimension);
if (world != null) {
TileEntity tile = world.getTileEntity(controller);
return tile instanceof INetworkMaster ? (INetworkMaster) tile : null;
}
return null;
}
@Override
public String getGuiTitle() {
return "gui.refinedstorage:fluid_grid";
}
@Override
public int getViewType() {
return 0;
}
@Override
public int getSortingType() {
return sortingType;
}
@Override
public int getSortingDirection() {
return sortingDirection;
}
@Override
public int getSearchBoxMode() {
return searchBoxMode;
}
@Override
public int getTabSelected() {
return 0;
}
@Override
public int getSize() {
return size;
}
@Override
public void onViewTypeChanged(int type) {
// NO OP
}
@Override
public void onSortingTypeChanged(int type) {
RS.INSTANCE.network.sendToServer(new MessageWirelessFluidGridSettingsUpdate(getSortingDirection(), type, getSearchBoxMode(), getSize()));
this.sortingType = type;
GuiGrid.markForSorting();
}
@Override
public void onSortingDirectionChanged(int direction) {
RS.INSTANCE.network.sendToServer(new MessageWirelessFluidGridSettingsUpdate(direction, getSortingType(), getSearchBoxMode(), getSize()));
this.sortingDirection = direction;
GuiGrid.markForSorting();
}
@Override
public void onSearchBoxModeChanged(int searchBoxMode) {
RS.INSTANCE.network.sendToServer(new MessageWirelessFluidGridSettingsUpdate(getSortingDirection(), getSortingType(), searchBoxMode, getSize()));
this.searchBoxMode = searchBoxMode;
}
@Override
public void onSizeChanged(int size) {
RS.INSTANCE.network.sendToServer(new MessageWirelessFluidGridSettingsUpdate(getSortingDirection(), getSortingType(), getSearchBoxMode(), size));
this.size = size;
if (Minecraft.getMinecraft().currentScreen != null) {
Minecraft.getMinecraft().currentScreen.initGui();
}
}
@Override
public void onTabSelectionChanged(int tab) {
// NO OP
}
@Override
public List<GridFilter> getFilters() {
return Collections.emptyList();
}
@Override
public List<GridTab> getTabs() {
return Collections.emptyList();
}
@Override
public ItemHandlerBasic getFilter() {
return null;
}
@Override
public TileDataParameter<Integer> getRedstoneModeConfig() {
return null;
}
@Override
public InventoryCrafting getCraftingMatrix() {
return null;
}
@Override
public InventoryCraftResult getCraftingResult() {
return null;
}
@Override
public void onCraftingMatrixChanged() {
// NO OP
}
@Override
public void onCrafted(EntityPlayer player) {
// NO OP
}
@Override
public void onCraftedShift(EntityPlayer player) {
// NO OP
}
@Override
public void onRecipeTransfer(EntityPlayer player, ItemStack[][] recipe) {
// NO OP
}
@Override
public boolean isActive() {
return true;
}
@Override
public void onClosed(EntityPlayer player) {
INetworkMaster network = getNetwork();
if (network != null) {
network.getNetworkItemHandler().onClose(player);
}
}
}
|
[
"raoulvdberge@gmail.com"
] |
raoulvdberge@gmail.com
|
eb139792cdae384b18eb0b3efa52870960d32b9f
|
fe83a546146f65f5d29087af825946c1baaae7af
|
/Server/src/main/java/org/xdi/oxauth/model/error/ErrorResponse.java
|
55f593e1af59f0adb88c2a82f88a075225426772
|
[
"MIT"
] |
permissive
|
nixu-corp/oxAuth
|
af04c334a9cc450e0be524cee3d814785de394c7
|
d4d347c182f962fb11e5f1a6cd09a5464154cd53
|
refs/heads/master
| 2020-12-30T21:44:56.173736
| 2015-11-09T08:31:52
| 2015-11-09T08:31:52
| 38,368,200
| 1
| 1
| null | 2015-07-01T11:45:12
| 2015-07-01T11:45:11
| null |
UTF-8
|
Java
| false
| false
| 3,899
|
java
|
/*
* oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2014, Gluu
*/
package org.xdi.oxauth.model.error;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.jboss.seam.log.Log;
import org.jboss.seam.log.Logging;
/**
* Base class for error responses.
*
* @author Javier Rojas Date: 09.22.2011
*
*/
public abstract class ErrorResponse {
private final static Log LOG = Logging.getLog(ErrorResponse.class);
private String errorDescription;
private String errorUri;
/**
* Returns the error code of the response.
*
* @return The error code.
*/
public abstract String getErrorCode();
/**
* If a valid state parameter was present in the request, it returns the
* exact value received from the client.
*
* @return The state value of the request.
*/
public abstract String getState();
/**
* Returns a human-readable UTF-8 encoded text providing additional
* information, used to assist the client developer in understanding the
* error that occurred.
*
* @return Description about the error.
*/
public String getErrorDescription() {
return errorDescription;
}
/**
* Sets a human-readable UTF-8 encoded text providing additional
* information, used to assist the client developer in understanding the
* error that occurred.
*
* @param errorDescription
* Description about the error.
*/
public void setErrorDescription(String errorDescription) {
this.errorDescription = errorDescription;
}
/**
* Return an URI identifying a human-readable web page with information
* about the error, used to provide the client developer with additional
* information about the error.
*
* @return URI with more information about the error.
*/
public String getErrorUri() {
return errorUri;
}
/**
* Sets an URI identifying a human-readable web page with information about
* the error, used to provide the client developer with additional
* information about the error.
*
* @param errorUri
* URI with more information about the error.
*/
public void setErrorUri(String errorUri) {
this.errorUri = errorUri;
}
/**
* Returns a query string representation of the object.
*
* @return The object represented in a query string.
*/
public String toQueryString() {
StringBuilder queryStringBuilder = new StringBuilder();
try {
queryStringBuilder.append("error=").append(getErrorCode());
if (errorDescription != null && !errorDescription.isEmpty()) {
queryStringBuilder.append("&error_description=").append(
URLEncoder.encode(errorDescription, "UTF-8"));
}
if (errorUri != null && !errorUri.isEmpty()) {
queryStringBuilder.append("&error_uri=").append(
URLEncoder.encode(errorUri, "UTF-8"));
}
if (getState() != null && !getState().isEmpty()) {
queryStringBuilder.append("&state=").append(getState());
}
} catch (UnsupportedEncodingException e) {
LOG.error(e.getMessage(), e);
return null;
}
return queryStringBuilder.toString();
}
/**
* Return a JSon string representation of the object.
*
* @return The object represented in a JSon string.
*/
public String toJSonString() {
JSONObject jsonObj = new JSONObject();
try {
jsonObj.put("error", getErrorCode());
if (errorDescription != null && !errorDescription.isEmpty()) {
jsonObj.put("error_description", errorDescription);
}
if (errorUri != null && !errorUri.isEmpty()) {
jsonObj.put("error_uri", errorUri);
}
if (getState() != null && !getState().isEmpty()) {
jsonObj.put("state", getState());
}
} catch (JSONException e) {
LOG.error(e.getMessage(), e);
return null;
}
return jsonObj.toString();
}
}
|
[
"Yuriy.Movchan@gmail.com"
] |
Yuriy.Movchan@gmail.com
|
73bf85c15a8ae1bdadb5864c6d8ba1645cbf54e2
|
f051ee9d89950383a842a6e2094083f6b4b8b316
|
/Lecture/Java/Work/javaApplication/src/main/java/java13/st4emp/EmployeeTest.java
|
dba66063d318052b6b668fd3aef7b301465ae6b3
|
[] |
no_license
|
BBongR/workspace
|
6d3b5c5a05bee75c031a80b971c859b6749e541e
|
2f020cd7809e28a2cae0199cac59375d407f58cf
|
refs/heads/master
| 2021-09-13T14:49:51.825677
| 2018-02-07T09:18:40
| 2018-02-07T09:18:40
| 106,399,804
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,511
|
java
|
package java13.st4emp;
import java.util.Scanner;
public class EmployeeTest {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
// setter 이용
/* Employee employeessetter = new Employee();
for (int i = 0; i < 3; i = i + 1) {
System.out.print("이름: ");
String name = keyboard.next();
System.out.print("주소: ");
String address = keyboard.next();
System.out.print("월급: ");
int salary = keyboard.nextInt();
System.out.print("주민: ");
String rrm = keyboard.next();
employeessetter.setName(name);
employeessetter.setAddress(address);
employeessetter.setSalary(salary);
employeessetter.setRrm(rrm);
System.out.println(employeessetter.toString());
}*/
// 배열 생성자 이용
Employee[] employees = new Employee[3];
for (int i = 0; i < employees.length; i = i + 1) {
System.out.print("이름: ");
String name = keyboard.next();
System.out.print("주소: ");
String address = keyboard.next();
System.out.print("월급: ");
int salary = keyboard.nextInt();
System.out.print("주민: ");
String rrm = keyboard.next();
Employee emp1 = new Employee(name, address, salary, rrm);
employees[i] = emp1;
// employees[i] = new Employee(name, address, salary, rrm);
// System.out.println(employees[i].toString());
}
// for-each문으로 출력
for (Employee j : employees)
System.out.println(j);
keyboard.close();
}
}
|
[
"suv1214@naver.com"
] |
suv1214@naver.com
|
755073ea814e383e32b388e58cfe388ee0621f54
|
fd3e4cc20a58c2a46892b3a38b96d5e2303266d8
|
/src/main/java/com/autonavi/amap/mapcore2d/IPoint.java
|
f32823a99a238e4f68a8f989214d16065e893acf
|
[] |
no_license
|
makewheels/AnalyzeBusDex
|
42ef50f575779b66bd659c096c57f94dca809050
|
3cb818d981c7bc32c3cbd8c046aa78cd38b20e8a
|
refs/heads/master
| 2021-10-22T07:16:40.087139
| 2019-03-09T03:11:05
| 2019-03-09T03:11:05
| 173,123,231
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 266
|
java
|
package com.autonavi.amap.mapcore2d;
public class IPoint {
/* renamed from: x */
public int f3652x;
/* renamed from: y */
public int f3653y;
public IPoint(int i, int i2) {
this.f3652x = i;
this.f3653y = i2;
}
}
|
[
"spring@qbserver.cn"
] |
spring@qbserver.cn
|
c3cee44a8e85c91e4ee18d408833d78a1151462b
|
4cc6fb1fde80a1730b660ba5ec13ad5f3228ea5c
|
/java-lihongjie/thinking-in-java-4-code/src/main/java/generics/ByteSet.java
|
331b53ef9dc018bb40c6ef09a98448de56efaaa0
|
[
"MIT"
] |
permissive
|
lihongjie/tutorials
|
c598425b085549f5f7a29b1c7bf0c86ae9823c94
|
c729ae0eac90564e6366bc4907dcb8a536519956
|
refs/heads/master
| 2023-08-19T05:03:23.754199
| 2023-08-11T08:25:29
| 2023-08-11T08:25:29
| 124,048,964
| 0
| 0
|
MIT
| 2018-04-01T06:26:19
| 2018-03-06T08:51:04
|
Java
|
UTF-8
|
Java
| false
| false
| 352
|
java
|
package generics;//: generics/ByteSet.java
import java.util.*;
public class ByteSet {
Byte[] possibles = {1, 2, 3, 4, 5, 6, 7, 8, 9};
Set<Byte> mySet =
new HashSet<Byte>(Arrays.asList(possibles));
// But you can't do this:
// Set<Byte> mySet2 = new HashSet<Byte>(
// Arrays.<Byte>asList(1,2,3,4,5,6,7,8,9));
} ///:~
|
[
"you@example.com"
] |
you@example.com
|
16cadd5869599b1153b2bb88222a72e80dbfcb55
|
b37726900ee16a5b72a6cd7b2a2d72814fffe924
|
/src/main/java/vn/com/vndirect/web/struts2/portlet/MarketNewsAJAXAction.java
|
50fc4d6585d946e44e0ccd7f8ad16c8a49dc89b2
|
[] |
no_license
|
UnsungHero0/portal
|
6b9cfd7271f2b1d587a6f311de49c67e8dd8ff9f
|
32325d3e1732d900ee3f874c55890afc8f347700
|
refs/heads/master
| 2021-01-20T06:18:01.548033
| 2014-11-12T10:27:43
| 2014-11-12T10:27:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,568
|
java
|
package vn.com.vndirect.web.struts2.portlet;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import vn.com.vndirect.business.INewsInfoManager;
import vn.com.vndirect.commons.i18n.I18NUtility;
import vn.com.vndirect.commons.utility.Constants;
import vn.com.vndirect.domain.extend.SearchIfoNews;
import vn.com.vndirect.domain.struts2.portlet.MarketNewsAJAXModel;
import vn.com.web.commons.domain.db.SearchResult;
import vn.com.web.commons.exception.FunctionalException;
import vn.com.web.commons.exception.SystemException;
import vn.com.web.commons.servercfg.ServerConfig;
import vn.com.web.commons.utility.Utilities;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
@SuppressWarnings("serial")
public class MarketNewsAJAXAction extends ActionSupport implements ModelDriven<MarketNewsAJAXModel> {
/* class logger */
private static Logger logger = Logger.getLogger(MarketNewsAJAXAction.class);
/* data model */
private MarketNewsAJAXModel model = new MarketNewsAJAXModel();
@Autowired
private INewsInfoManager newsInfoManager;
/**
* Setting the manager for NewsOnline
*
* @param newsInfoManager
*/
public void setNewsInfoManager(INewsInfoManager newsInfoManager) {
this.newsInfoManager = newsInfoManager;
}
public MarketNewsAJAXModel getModel() {
return model;
}
@SuppressWarnings("unchecked")
public String executeMarketNewsHome() throws FunctionalException, SystemException {
final String LOCATION = "executeMarketOverviewHome";
if (logger.isDebugEnabled()) {
logger.debug(LOCATION + "::BEGIN");
}
try {
SearchIfoNews searchObj = model.getSearchIfoNews();
searchObj.setOrderByDate(true);
searchObj.setStatus(Constants.IServerConfig.DataRef.ItemCodes.NewsStatus.APPROVED);
searchObj.setNewsType(ServerConfig.getOnlineValue(Constants.IServerConfig.DataRef.ItemCodes.NewsType.MARKET_NEWS));
searchObj.setLocale(I18NUtility.getCurrentLocale());
searchObj.setNumberItem(Integer.parseInt(ServerConfig.getOnlineValue(Constants.IServerConfig.Paging.ITEMS_PER_PAGE)));
SearchResult result = newsInfoManager.searchMartketNews(searchObj, model.getPagingInfo());
logger.debug("result:" + result.size());
// request.setAttribute(Constants.Paging.DEFAULT_KEY, result);
model.setSearchResult(result);
} catch (Exception e) {
logger.error(LOCATION + ":: Exception: " + e);
Utilities.processErrors(this, e);
}
if (logger.isDebugEnabled()) {
logger.debug(LOCATION + "::END");
}
return SUCCESS;
}
}
|
[
"minh.nguyen@vndirect.com.vn"
] |
minh.nguyen@vndirect.com.vn
|
0a389a8cf85aed90cfe675a91215ac4cd58e3a8d
|
28935683223311c6345a7c7a0ed2e5f19cfa94d8
|
/app/src/main/java/com/google/android/apps/exposurenotification/logging/LogcatAnalyticsLogger.java
|
1cfbaad46211a84e6e46493ca8d6eaeba6a6a5e8
|
[
"Apache-2.0"
] |
permissive
|
isabella232/exposure-notifications-android
|
64ba16ea78d56d508874c5eaf2d7611b962cf48f
|
0220325466214966368b1f1e5cc0eb8a6a380df7
|
refs/heads/master
| 2023-06-05T08:16:17.444741
| 2021-06-21T17:25:39
| 2021-06-21T17:28:13
| 380,784,965
| 0
| 0
|
Apache-2.0
| 2021-06-27T16:15:55
| 2021-06-27T16:14:38
| null |
UTF-8
|
Java
| false
| false
| 5,887
|
java
|
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.google.android.apps.exposurenotification.logging;
import android.content.Context;
import android.util.Log;
import androidx.annotation.AnyThread;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import com.google.android.apps.exposurenotification.R;
import com.google.android.apps.exposurenotification.network.VolleyUtils;
import com.google.android.apps.exposurenotification.proto.ApiCall.ApiCallType;
import com.google.android.apps.exposurenotification.proto.RpcCall.RpcCallResult;
import com.google.android.apps.exposurenotification.proto.RpcCall.RpcCallType;
import com.google.android.apps.exposurenotification.proto.UiInteraction.EventType;
import com.google.android.apps.exposurenotification.proto.WorkManagerTask.Status;
import com.google.android.apps.exposurenotification.proto.WorkManagerTask.WorkerTask;
import com.google.android.apps.exposurenotification.storage.AnalyticsLoggingEntity;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.nearby.exposurenotification.ExposureNotificationStatusCodes;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import dagger.hilt.android.qualifiers.ApplicationContext;
import java.util.concurrent.TimeoutException;
import javax.inject.Inject;
/**
* Analytics logger which logs to Logcat only
*/
public class LogcatAnalyticsLogger implements AnalyticsLogger {
private final String healthAuthorityCode;
private final String tag;
@Inject
public LogcatAnalyticsLogger(@ApplicationContext Context context) {
Context appContext = context.getApplicationContext();
healthAuthorityCode = appContext.getResources().getString(R.string.enx_regionIdentifier);
tag = "ENX." + healthAuthorityCode;
Log.i(tag, "Using logcat analytics logger.");
}
@Override
@UiThread
public void logUiInteraction(EventType event) {
if (event == EventType.LOW_STORAGE_WARNING_SHOWN) {
Log.e(tag, event.toString());
} else {
Log.i(tag, event.toString());
}
}
@Override
@AnyThread
public void logWorkManagerTaskStarted(WorkerTask workerTask) {
Log.i(tag, workerTask + " started.");
}
@Override
@AnyThread
public void logApiCallFailure(ApiCallType apiCallType, Exception exception) {
if (exception instanceof ApiException) {
if (((ApiException) exception).getStatusCode()
== ExposureNotificationStatusCodes.RESOLUTION_REQUIRED) {
Log.i(tag, apiCallType + " requires resolution");
return;
}
}
Log.e(tag, apiCallType + " failed.", exception);
}
@Override
@AnyThread
public void logApiCallSuccess(ApiCallType apiCallType) {
Log.i(tag, apiCallType + " succeeded.");
}
@Override
@AnyThread
public ListenableFuture<?> logApiCallFailureAsync(
ApiCallType apiCallType, Exception exception) {
logApiCallFailure(apiCallType, exception);
return Futures.immediateVoidFuture();
}
@Override
@AnyThread
public ListenableFuture<?> logApiCallSuccessAsync(ApiCallType apiCallType) {
logApiCallSuccess(apiCallType);
return Futures.immediateVoidFuture();
}
@Override
@AnyThread
public void logRpcCallSuccess(RpcCallType rpcCallType, int payloadSize) {
Log.i(tag, rpcCallType + " succeeded with payload size: " + payloadSize);
}
@Override
@AnyThread
public void logRpcCallFailure(RpcCallType rpcCallType, Throwable error) {
RpcCallResult rpcCallResult = VolleyUtils.getLoggableResult(error);
int httpStatus = VolleyUtils.getHttpStatus(error);
String errorCode = VolleyUtils.getErrorCode(error);
String errorMessage = VolleyUtils.getErrorMessage(error);
Log.e(tag, rpcCallType + " failed. "
+ " Result:[" + rpcCallResult + "]"
+ " HTTP status:[" + httpStatus + "]"
+ " Server error:[" + errorCode + ":" + errorMessage + "]");
}
@Override
@AnyThread
public ListenableFuture<?> logRpcCallSuccessAsync(RpcCallType rpcCallType, int payloadSize) {
logRpcCallSuccess(rpcCallType, payloadSize);
return Futures.immediateVoidFuture();
}
@Override
@AnyThread
public ListenableFuture<?> logRpcCallFailureAsync(RpcCallType rpcCallType, Throwable error) {
logRpcCallFailure(rpcCallType, error);
return Futures.immediateVoidFuture();
}
@Override
@AnyThread
public void logWorkManagerTaskSuccess(WorkerTask workerTask) {
Log.i(tag, workerTask + " finished with status: " + Status.STATUS_SUCCESS);
}
@Override
@AnyThread
public void logWorkManagerTaskFailure(WorkerTask workerTask, Throwable t) {
Status status = Status.STATUS_FAIL;
if (t instanceof TimeoutException) {
status = Status.STATUS_TIMEOUT;
}
Log.e(tag, workerTask + " failed with status: " + status);
}
@Override
@AnyThread
public void logWorkManagerTaskAbandoned(WorkerTask workerTask) {
Log.e(tag, workerTask + " finished with status: " + Status.STATUS_ABANDONED);
}
@Override
@AnyThread
public ListenableFuture<Void> sendLoggingBatchIfConsented(boolean isENEnabled) {
// No action as logcat logger doesn't send anything off device
Log.i(tag, "LogcatAnalytics logger - no batch upload operation specified");
return Futures.immediateVoidFuture();
}
}
|
[
"noreply@google.com"
] |
noreply@google.com
|
e22dfd5076530e615147c213ad5a03a335eed727
|
d9d6bf45ee70fb26bb775a794ebf497c6ddad59c
|
/src/main/java/com/design/u049/B/TimeoutAlertHander.java
|
2b016f24a12a16d94e04b4127b62d425a94bef32
|
[] |
no_license
|
jiangsiYang/designModel_geekbang
|
60788a9a70cc468a57749a7a8f2a6a2db248e000
|
a48b4e9774ea5f705a0a6d88bf61caa2dc839edb
|
refs/heads/master
| 2022-12-26T03:36:36.400697
| 2022-12-11T12:21:28
| 2022-12-11T12:21:28
| 231,164,579
| 45
| 23
| null | 2022-12-16T05:09:19
| 2020-01-01T01:45:18
|
Java
|
UTF-8
|
Java
| false
| false
| 551
|
java
|
package com.design.u049.B;
/**
* // 改动二:添加新的handler
*/
public class TimeoutAlertHander extends AlertHandler {
public TimeoutAlertHander(AlertRule rule, Notification notification) {
super(rule, notification);
}
@Override
public void check(ApiStatInfo apiStatInfo) {
long timeoutTps = apiStatInfo.getTimeoutCount() / apiStatInfo.getDurationOfSeconds();
if (timeoutTps > rule.getMatchedRule(apiStatInfo.getApi()).getMaxTimeoutTps()) {
notification.notify("...");
}
}
}
|
[
"353098889@qq.com"
] |
353098889@qq.com
|
31e42ac2915832eb9ae5affbaef7af704c292cd3
|
a02424746af6415f784e4930a21d6c715949620e
|
/platform/src/main/java/com/oa/platform/web/interceptor/WebSocketHandshakeInterceptor.java
|
ca07324f954057a2ff977620552867327bd95e53
|
[] |
no_license
|
lylalv/oa
|
0f4f626f4f20e21f0f6f85a319da5ee67329b4b4
|
2e724b5c2c217c604aecd06e4be2faaeca0e6740
|
refs/heads/master
| 2022-04-18T11:26:26.890590
| 2020-04-17T16:59:51
| 2020-04-17T16:59:51
| 256,251,793
| 0
| 0
| null | 2020-04-16T15:15:28
| 2020-04-16T15:15:27
| null |
UTF-8
|
Java
| false
| false
| 2,302
|
java
|
package com.oa.platform.web.interceptor;
import com.oa.platform.common.WebSocketCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.HandshakeInterceptor;
import javax.servlet.http.HttpSession;
import java.util.Map;
/**
* WebSocket握手拦截器
* @author Feng
* @date 2018/10/15
*/
public class WebSocketHandshakeInterceptor implements HandshakeInterceptor {
private static Logger logger = LoggerFactory.getLogger(HandshakeInterceptor.class);
/**
* 在握手之后
*/
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object
> attributes) throws Exception {
logger.debug("beforeHandshake start.....");
logger.debug(request.getClass().getName());
if (request instanceof ServletServerHttpRequest) {
ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request;
HttpSession session = servletRequest.getServletRequest().getSession(false);
if (session != null) {
//使用userName区分WebSocketHandler,以便定向发送消息
String userName = (String) session.getAttribute(WebSocketCache.SESSION_USERNAME);
logger.info(userName+" login");
attributes.put(WebSocketCache.WEBSOCKET_USERNAME,userName);
/*使用websocketSessionKey区分WebSocketHandler modify by feng*/
String websocketSessionKey = userName + ";" + session.getId();
attributes.put(WebSocketCache.WEBSOCKET_SESSION_KEY, websocketSessionKey);
System.err.println("connect success");
}else{
logger.debug("httpsession is null");
}
}
return true;
}
/**
* 在握手之前
*/
@Override
public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) {
}
}
|
[
"445121408@qq.com"
] |
445121408@qq.com
|
50e97e3cb017eb2aec4edd26dc7f8b5535a4bf67
|
a60da0a14b877645bcdb9d9ff0b3ba92ba70bfdb
|
/src/main/java/in/lms/sinchan/model/request/TenantUpdateRequest.java
|
f2ad64c5b6e3905cefcbe1dbb64e6b2eb7e015db
|
[] |
no_license
|
1InfinityDoesExist/LMS
|
cc640deceb5ac84d7362ee1b2e3cf55b8b6cadf1
|
5ff11536a71b78e8cd67277a3b104bd15f12f166
|
refs/heads/master
| 2023-01-28T02:21:38.966576
| 2020-12-02T16:21:57
| 2020-12-02T16:21:57
| 308,910,129
| 0
| 0
| null | 2020-12-02T16:21:59
| 2020-10-31T15:18:55
|
Java
|
UTF-8
|
Java
| false
| false
| 258
|
java
|
package in.lms.sinchan.model.request;
import org.springframework.stereotype.Component;
@Component
@lombok.Data
public class TenantUpdateRequest {
private String description;
private String organizationName;
private String registratioNumber;
}
|
[
"avinash.patel@gaiansolutions.com"
] |
avinash.patel@gaiansolutions.com
|
19c1df23717bcdba766fcd77f0806f827acf5bf6
|
af6251ee729995455081c4f4e48668c56007e1ac
|
/web/src/main/java/mmp/gps/monitor/dao/IMapLayerDao.java
|
becc64a7c6d54dca061bd614f057a5d783f8cb50
|
[] |
no_license
|
LXKing/monitor
|
b7522d5b95d2cca7e37a8bfc66dc7ba389e926ef
|
7d1eca454ce9a93fc47c68f311eca4dcd6f82603
|
refs/heads/master
| 2020-12-01T08:08:53.265259
| 2018-12-24T12:43:32
| 2018-12-24T12:43:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 939
|
java
|
package mmp.gps.monitor.dao;
import mmp.gps.common.util.KeyValue;
import mmp.gps.domain.mapLayer.MapLayerDto;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface IMapLayerDao {
List<MapLayerDto> query(String userId, String filter);
MapLayerDto getMapLayInfo(String mapLayerId);
void create(MapLayerDto dto);
MapLayerDto fetch(String id);
int update(MapLayerDto dto);
void delete(String id);
void deleteAreaInMaplayer(String id);
void addAreas(List<KeyValue> areas);
void removeArea(String mapLayerId, long areaId, int areaType);
List<Long> getCircleAreas(String mapLayerId);
List<Long> getRectangleAreas(String mapLayerId);
List<Long> getPolygonAreas(String mapLayerId);
List<Long> getRouteAreas(String mapLayerId);
List<Long> getPois(String mapLayerId);
void setVisible(String mapLayerId, boolean visible);
}
|
[
"heavenlystate@163.com"
] |
heavenlystate@163.com
|
50662e46ccc099d1b24132c522d1a81da703a6d0
|
c23ee131d72f7a1904282793db6193045bb0218d
|
/김윤하0129/src/a8_반복/ForEx.java
|
7eb317dae3ed7bc9877ac9d969cc72c5f60a356a
|
[] |
no_license
|
xdbsgk/javaStudy20210811
|
59d7522f73981eed87e543275e7bed0022cdec3f
|
d037741429d10e06a4da2953845317d24d8f31b3
|
refs/heads/master
| 2023-08-28T18:24:57.735994
| 2021-10-08T12:02:48
| 2021-10-08T12:02:48
| 397,576,247
| 2
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 297
|
java
|
package a8_반복;
public class ForEx {
public static void main(String[] args) {
for(int i = 0; i < 100; i++) {
System.out.println(i);
}
/* for와 while정리
for(;true;) {
System.out.println("for문");
}
while(true) {
System.out.println("while문");
}
*/
}
}
|
[
"="
] |
=
|
b5efecddf749b06049ec9fd90c6c2905fe621900
|
151a428aa79dadc70f0f611c20ed4d84ad1aa79a
|
/uisp-2017/src/main/java/it/redhat/demo/uisp/rest/mapper/UispNotFoundExceptionMapper.java
|
81d4494027b8d7008b21f49d7ada63cb836ed8fb
|
[
"Apache-2.0"
] |
permissive
|
fax4ever/middleware-play
|
20362d1d9b8c7345ca0303890f74ed94235dffc6
|
231c0f0904c2afdcc3ffcda5ffc9a631ddaf4a1b
|
refs/heads/master
| 2021-01-19T20:05:56.797225
| 2017-09-17T07:47:41
| 2017-09-17T07:47:41
| 88,485,471
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,361
|
java
|
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* 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.
*/
/**
* Created by fabio on 20/08/2017.
*/
package it.redhat.demo.uisp.rest.mapper;
import javax.inject.Inject;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import it.redhat.demo.uisp.service.exception.UispNotFoundException;
import org.slf4j.Logger;
@Provider
public class UispNotFoundExceptionMapper implements ExceptionMapper<UispNotFoundException> {
@Inject
private Logger log;
@Override
public Response toResponse(UispNotFoundException exception) {
return Response.status(404)
.entity(new Error(exception))
.type(MediaType.APPLICATION_JSON)
.build();
}
}
|
[
"fabiomassimo.ercoli@gmail.com"
] |
fabiomassimo.ercoli@gmail.com
|
e8abe8144a927f2b3ed996a95aff9211eae26a69
|
99491debb70866677edc01d9af1bfaadac914978
|
/src/main/java/com/id/wasta/data/repository/jpa/TIdSpecializationInformationJpaRepository.java
|
30899fd1890b1344c734e34ba1b24eac5c70ea17
|
[] |
no_license
|
srnu/wasta
|
a9dbf4772d6584aacb952b12a4d0e6842d8fa77c
|
c55498cd42b8114ee0bb9342c9905868632e9ddc
|
refs/heads/master
| 2022-12-12T06:54:57.769288
| 2020-09-13T09:41:53
| 2020-09-13T09:41:53
| 295,119,733
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 445
|
java
|
package com.id.wasta.data.repository.jpa;
import java.util.List;
import com.id.util.data.repository.jpa.BaseRepository;
import com.id.wasta.bean.jpa.TIdSpecializationInformationEntity;
/**
* Repository : TIdSpecializationInformation.
*/
public interface TIdSpecializationInformationJpaRepository extends BaseRepository<TIdSpecializationInformationEntity, Long> {
List<TIdSpecializationInformationEntity> findByPesPeiKey(Long peiKey);
}
|
[
"venkatrao@infodynamic.in"
] |
venkatrao@infodynamic.in
|
61c93132396da2338f71687c6a0b4ee60ff6b946
|
180e78725121de49801e34de358c32cf7148b0a2
|
/dataset/protocol1/spoon/learning/6537/CtVariableReferenceImpl.java
|
b5668ea851a844299150dd843c7c1e06da4d9d3c
|
[] |
no_license
|
ASSERT-KTH/synthetic-checkstyle-error-dataset
|
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
|
40c057e1669584bfc6fecf789b5b2854660222f3
|
refs/heads/master
| 2023-03-18T12:50:55.410343
| 2019-01-25T09:54:39
| 2019-01-25T09:54:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,432
|
java
|
/**
* Copyright (C) 2006-2018 INRIA and contributors
* Spoon - http://spoon.gforge.inria.fr/
*
* This software is governed by the CeCILL-C License under French law and
* abiding by the rules of distribution of free software. You can use, modify
* and/or redistribute the software under the terms of the CeCILL-C license as
* circulated by CEA, CNRS and INRIA at http://www.cecill.info.
*
* 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 CeCILL-C License for more details.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*/
package spoon.support.reflect.reference;
import spoon.reflect.annotations.MetamodelPropertyField;
import spoon.reflect.declaration.CtVariable;
import spoon.reflect.declaration.ModifierKind;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.reference.CtVariableReference;
import spoon.reflect.visitor.CtVisitor;
import java.lang.reflect.AnnotatedElement;
import java.util.Collections;
import java.util.Set;
import static spoon.reflect.path.CtRole.TYPE;
public abstract class CtVariableReferenceImpl<T> extends CtReferenceImpl implements CtVariableReference<T> {
private static final long serialVersionUID = 1L;
@MetamodelPropertyField(role = TYPE)
CtTypeReference<T> type;
public CtVariableReferenceImpl() {
}
@Override
public void accept(CtVisitor visitor) {
// nothing
}
@Override
public CtTypeReference<T> getType() {
return type;
}
@Override
public <C extends CtVariableReference<T>> C setType(CtTypeReference<T> type) {
if (type != null) {
type.setParent(this);
}
getFactory().getEnvironment().getModelChangeListener().onObjectUpdate(this, TYPE, type, this.type);
this.type = type;
return (C) this;
}
@Override
protected AnnotatedElement getActualAnnotatedElement() {
// this is never available through reflection
return null;
}
@Override
public CtVariable<T> getDeclaration() {
return null;
}
@Override
public Set<ModifierKind> getModifiers() {
CtVariable<T> v = getDeclaration();
if(v != null) {
return v.getModifiers();
}
return Collections.emptySet();
}
@Override
public CtVariableReference<T> clone() {
return (CtVariableReference<T>) super.clone();
}
}
|
[
"bloriot97@gmail.com"
] |
bloriot97@gmail.com
|
5ee1baed485719f10795f078315c9734ccc6716d
|
9c43706cef30060db6e78b3dda2a2f81741c5b00
|
/src/main/java/servlet/GetStationListServlet.java
|
9d00137f7c5da08ae23ccf362eab90878aed6b15
|
[] |
no_license
|
makewheels/PirateBus
|
925941b9655457364361a3048b81a5e54f922aef
|
e03c6ffb5cef643a294f4afd62264e629bec4467
|
refs/heads/master
| 2021-10-20T20:27:44.042512
| 2019-03-01T14:43:58
| 2019-03-01T14:43:58
| 165,213,292
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,433
|
java
|
package servlet;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import bean.stationinfo.my.BusStop;
import bean.stationinfo.my.MyStationInfo;
import util.FileUtil;
/**
* 站点列表
*
* @author Administrator
*
*/
public class GetStationListServlet extends HttpServlet {
private static final long serialVersionUID = 3249228653410736282L;
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String busName = request.getParameter("busName");
String direction = request.getParameter("direction");
// 读公交线路
List<BusStop> busStopList = JSON.parseObject(
FileUtil.readTextFile(
GetStationListServlet.class.getResource("/stationinfo/my/" + busName + ".json").getPath()),
MyStationInfo.class).getBusLineList().get(Integer.parseInt(direction)).getBusStopList();
List<String> clientBusStopList = new ArrayList<>();
for (BusStop busStop : busStopList) {
clientBusStopList.add(busStop.getName());
}
// 回写站点列表
response.setCharacterEncoding("utf-8");
response.getWriter().write(JSON.toJSONString(clientBusStopList));
}
}
|
[
"spring@qbserver.cn"
] |
spring@qbserver.cn
|
6d4b08273a1dc629f421dfc7cbc7d1c5252ff2de
|
ac94ac4e2dca6cbb698043cef6759e328c2fe620
|
/labs/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateInVirtualDatacenter.java
|
e5bb53053c4e48abbe4c3ba303617a699dc6b432
|
[
"Apache-2.0"
] |
permissive
|
andreisavu/jclouds
|
25c528426c8144d330b07f4b646aa3b47d0b3d17
|
34d9d05eca1ed9ea86a6977c132665d092835364
|
refs/heads/master
| 2021-01-21T00:04:41.914525
| 2012-11-13T18:11:04
| 2012-11-13T18:11:04
| 2,503,585
| 2
| 0
| null | 2012-10-16T21:03:12
| 2011-10-03T09:11:27
|
Java
|
UTF-8
|
Java
| false
| false
| 1,581
|
java
|
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.abiquo.domain.cloud;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Wrapper to hold the information of a virtual machine template scoped to a
* concrete hypervisor type.
*
* @author Ignasi Barrera
*/
public class VirtualMachineTemplateInVirtualDatacenter {
private VirtualMachineTemplate template;
private VirtualDatacenter zone;
public VirtualMachineTemplateInVirtualDatacenter(final VirtualMachineTemplate template, final VirtualDatacenter zone) {
super();
this.template = checkNotNull(template, "template");
this.zone = checkNotNull(zone, "zone");
}
public VirtualMachineTemplate getTemplate() {
return template;
}
public VirtualDatacenter getZone() {
return zone;
}
}
|
[
"ignasi.barrera@abiquo.com"
] |
ignasi.barrera@abiquo.com
|
964eea1715fc76a27b76c256c2e5be6968652e25
|
265302da0a7cf8c2f06dd0f96970c75e29abc19b
|
/ar_webapp/src/main/java/org/kuali/kra/common/committee/service/impl/CommitteeNotificationServiceImpl.java
|
f01ea1e944e70788f242ecfd8b62ae3afe9cc08b
|
[
"Apache-2.0",
"ECL-2.0"
] |
permissive
|
Ariah-Group/Research
|
ee7718eaf15b59f526fca6983947c8d6c0108ac4
|
e593c68d44176dbbbcdb033c593a0f0d28527b71
|
refs/heads/master
| 2021-01-23T15:50:54.951284
| 2017-05-05T02:10:59
| 2017-05-05T02:10:59
| 26,879,351
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,011
|
java
|
/*
* Copyright 2005-2014 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl1.php
*
* 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.kuali.kra.common.committee.service.impl;
import org.apache.commons.lang.StringUtils;
import org.kuali.kra.common.committee.bo.CommitteeScheduleBase;
import org.kuali.kra.common.committee.meeting.CommScheduleMinuteDocBase;
import org.kuali.kra.common.committee.meeting.ScheduleAgendaBase;
import org.kuali.kra.common.committee.notification.AgendaCreatedNotificationRenderer;
import org.kuali.kra.common.committee.notification.CommitteeNotificationContext;
import org.kuali.kra.common.committee.notification.MinutesCreatedNotificationRenderer;
import org.kuali.kra.common.committee.service.CommonCommitteeNotificationService;
import org.kuali.kra.common.notification.service.KcNotificationService;
import org.kuali.kra.infrastructure.Constants;
/**
*
* This class generates the notifications for committees.
*/
public class CommitteeNotificationServiceImpl implements CommonCommitteeNotificationService {
private String committeeNotificationType;
private KcNotificationService kcNotificationService;
public String getCommitteeNotificationType() {
return committeeNotificationType;
}
public void setCommitteeNotificationType(String committeeNotificationType) {
this.committeeNotificationType = committeeNotificationType;
}
/**
* This method generates Agenda Generated notifications for a committee.
* @throws Exception
*/
public void generateNotification(String notificationType, ScheduleAgendaBase agenda) {
if (StringUtils.equals(notificationType, Constants.COMMITTEE_AGENDA_NOTIFICATION)) {
CommitteeScheduleBase committeeSchedule = agenda.getCommitteeSchedule();
AgendaCreatedNotificationRenderer renderer = new AgendaCreatedNotificationRenderer(agenda, "action taken");
CommitteeNotificationContext context = new CommitteeNotificationContext(committeeSchedule,
notificationType, "Agenda Generated Notification", renderer);
kcNotificationService.sendNotification(context);
} else {
throw new IllegalArgumentException(committeeNotificationType);
}
}
/**
* This method generates Minutes Generated notifications for a committee.
* @throws Exception
*/
public void generateNotification(String notificationType, CommScheduleMinuteDocBase minuteDoc) {
if (StringUtils.equals(notificationType, Constants.COMMITTEE_MINUTES_NOTIFICATION)) {
CommitteeScheduleBase committeeSchedule = minuteDoc.getCommitteeSchedule();
MinutesCreatedNotificationRenderer renderer = new MinutesCreatedNotificationRenderer(minuteDoc, "action taken");
CommitteeNotificationContext context = new CommitteeNotificationContext(committeeSchedule,
notificationType, "Minutes Generated Notification", renderer);
kcNotificationService.sendNotification(context);
} else {
throw new IllegalArgumentException(committeeNotificationType);
}
}
/**
* Populated by Spring Beans.
* @param kcNotificationService
*/
public void setKcNotificationService(KcNotificationService kcNotificationService) {
this.kcNotificationService = kcNotificationService;
}
}
|
[
"code@ariahgroup.org"
] |
code@ariahgroup.org
|
851ef7f4349f39c875bb53481385cb7ffa41203b
|
d15803d5b16adab18b0aa43d7dca0531703bac4a
|
/com/whatsapp/jz.java
|
35214c75a7cff97d0285f269a9ebf0732545ce77
|
[] |
no_license
|
kenuosec/Decompiled-Whatsapp
|
375c249abdf90241be3352aea38eb32a9ca513ba
|
652bec1376e6cd201d54262cc1d4e7637c6334ed
|
refs/heads/master
| 2021-12-08T15:09:13.929944
| 2016-03-23T06:04:08
| 2016-03-23T06:04:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 192
|
java
|
package com.whatsapp;
class jz implements Runnable {
final tw a;
jz(tw twVar) {
this.a = twVar;
}
public void run() {
App.b(App.z(), 2131231120, 1);
}
}
|
[
"gigalitelk@gmail.com"
] |
gigalitelk@gmail.com
|
9b9c01d44f63cd71619a93f5119f95b6d4f0703b
|
ac2b1c7b26d745bba389cc0de81c28e8e3b01f51
|
/poc_nav/android/app/src/main/java/com/poc/generated/BasePackageList.java
|
0adaf0025b2c088c4dcb901067f617bf5d2fba63
|
[] |
no_license
|
mdsaleem1804/react-native
|
4dd03c5a4b9f960cf09f801c697431e31031b5b6
|
56dd762e82aac537a085598b7d0bc6214ddcf8e2
|
refs/heads/master
| 2023-01-28T08:44:44.611657
| 2020-04-05T13:54:09
| 2020-04-05T13:54:09
| 253,171,932
| 0
| 0
| null | 2023-01-26T18:59:08
| 2020-04-05T06:39:42
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 808
|
java
|
package com.poc.generated;
import java.util.Arrays;
import java.util.List;
import org.unimodules.core.interfaces.Package;
public class BasePackageList {
public List<Package> getPackageList() {
return Arrays.<Package>asList(
new expo.modules.constants.ConstantsPackage(),
new expo.modules.errorrecovery.ErrorRecoveryPackage(),
new expo.modules.filesystem.FileSystemPackage(),
new expo.modules.font.FontLoaderPackage(),
new expo.modules.keepawake.KeepAwakePackage(),
new expo.modules.lineargradient.LinearGradientPackage(),
new expo.modules.location.LocationPackage(),
new expo.modules.permissions.PermissionsPackage(),
new expo.modules.sqlite.SQLitePackage(),
new expo.modules.webbrowser.WebBrowserPackage()
);
}
}
|
[
"mdsaleem1804@gmail.com"
] |
mdsaleem1804@gmail.com
|
542e4902b659a78f73f81b68694de8077fc723bc
|
3d145b67d60021dd3909f76d579949ba0fc719e8
|
/platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedDiffTool.java
|
ca1b431fa14f9ef9b2c6d91ea37bcb599d709ca8
|
[
"Apache-2.0"
] |
permissive
|
shanyaodan/intellij-community
|
cfcf2ca6c08034bc0215ba194ecde67a5bd0ad44
|
a5cd6ac6102731ea9b557dcc1c684340f7d8432a
|
refs/heads/master
| 2021-01-24T00:53:12.270012
| 2015-08-17T23:55:58
| 2015-08-17T23:58:32
| 40,955,877
| 1
| 0
| null | 2015-08-18T06:53:50
| 2015-08-18T06:53:50
| null |
UTF-8
|
Java
| false
| false
| 1,733
|
java
|
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* 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.intellij.diff.tools.fragmented;
import com.intellij.diff.DiffContext;
import com.intellij.diff.FrameDiffTool;
import com.intellij.diff.requests.DiffRequest;
import com.intellij.diff.tools.simple.SimpleOnesideDiffViewer;
import org.jetbrains.annotations.NotNull;
public class UnifiedDiffTool implements FrameDiffTool {
public static final UnifiedDiffTool INSTANCE = new UnifiedDiffTool();
@NotNull
@Override
public DiffViewer createComponent(@NotNull DiffContext context, @NotNull DiffRequest request) {
if (SimpleOnesideDiffViewer.canShowRequest(context, request)) return new SimpleOnesideDiffViewer(context, request);
if (UnifiedDiffViewer.canShowRequest(context, request)) return new UnifiedDiffViewer(context, request);
throw new IllegalArgumentException(request.toString());
}
@Override
public boolean canShow(@NotNull DiffContext context, @NotNull DiffRequest request) {
return SimpleOnesideDiffViewer.canShowRequest(context, request) || UnifiedDiffViewer.canShowRequest(context, request);
}
@NotNull
@Override
public String getName() {
return "Oneside viewer";
}
}
|
[
"AMPivovarov@gmail.com"
] |
AMPivovarov@gmail.com
|
1a3b5c781e1cf47021ed654cc056e64ba47e5b31
|
16d4f9d2195d62323fff3661ef10524e3dd33ecf
|
/project01/src09/bitcamp/pms/ProjectApp01.java
|
25be0842ad681a8f1592a24bc82aec28b775f9f2
|
[] |
no_license
|
eomjinyoung/Java80
|
c967b761698c30c513e45adad11cc7fc2430f3f1
|
e47affad9a4510ff9d13f7afc00de24dd4db2ef4
|
refs/heads/master
| 2021-01-21T04:40:44.181358
| 2016-06-22T08:59:16
| 2016-06-22T08:59:16
| 51,817,374
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,846
|
java
|
/* 목표
- 명령어에 따라 회원 정보를 다룰 수 있도록 변경하라.
명령> add
이름? 홍길동
이메일? hong@test.com
암호? 1111
전화? 111-1111
저장하시겠습니까?(y/n) y
저장하였습니다.
저장하시겠습니까?(y/n) N
저장을 취소하였습니다.
명령> list
0, 홍길동, hong@test.com, 1111, 1111-2222
1, 홍길동, hong@test.com, 1111, 1111-2222
2, 홍길동, hong@test.com, 1111, 1111-2222
3, 홍길동, hong@test.com, 1111, 1111-2222
명령> delete
삭제할 회원의 번호는? 2
정말로 삭제하시겠습니까?(y/n) y
삭제하였습니다.
정말로 삭제하시겠습니까?(y/n) n
삭제를 취소하였습니다.
명령> list
0, 홍길동, hong@test.com, 1111, 1111-2222
1, 홍길동, hong@test.com, 1111, 1111-2222
2,
3, 홍길동, hong@test.com, 1111, 1111-2222
명령> quit
안녕히 가세요!
명령> xxx
올바르지 않은 명령어입니다.
명령>
- 사용 문법:
=> 반복문과 조건문의 활용
*/
package bitcamp.pms;
import java.util.Scanner;
import bitcamp.pms.domain.Member;
public class ProjectApp {
public static void main(String[] args) {
Scanner keyScan = new Scanner(System.in);
String input;
while (true) {
System.out.print("명령> ");
input = keyScan.nextLine();
System.out.println(input);
}
}
static boolean confirm(String message, boolean strictMode) {
Scanner keyScan = new Scanner(System.in);
String input = null;
do {
System.out.printf("%s(y/n) ", message);
input = keyScan.nextLine().toLowerCase();
if (input.equals("y")) {
return true;
} else if (input.equals("n")) {
return false;
} else {
if (!strictMode) {
return false;
}
System.out.println("잘못된 명령어입니다.");
}
} while(true);
}
}
|
[
"jinyoung.eom@gmail.com"
] |
jinyoung.eom@gmail.com
|
5aff088bb6396c7282d84c7acc8b635a934782c8
|
11fa8dcb980983e49877c52ed7e5713e0dca4aad
|
/tags/1.0.1/src/com/aof/service/admin/EmailManager.java
|
9e78a197a3d02a753b3413de9c56fd37ed8f24b8
|
[] |
no_license
|
Novthirteen/oa-system
|
0262a6538aa023ededa1254c26c42bc19a70357c
|
c698a0c09bbd6b902700e9ccab7018470c538e70
|
refs/heads/master
| 2021-01-15T16:29:18.465902
| 2009-03-20T12:41:16
| 2009-03-20T12:41:16
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 4,981
|
java
|
/* =====================================================================
*
* Copyright (c) Atos Origin INFORMATION TECHNOLOGY All rights reserved.
*
* =====================================================================
*/
package com.aof.service.admin;
import java.util.List;
import java.util.Map;
import com.aof.model.admin.Email;
import com.aof.model.admin.EmailBatch;
import com.aof.model.admin.Site;
import com.aof.model.admin.User;
import com.aof.model.admin.query.EmailQueryOrder;
/**
* 定义操作Email的接口
*
* @author ych
* @version 1.0 (Nov 13, 2005)
*/
public interface EmailManager {
public static final String EMAIL_ROLE_APPROVER = "Approver";
public static final String EMAIL_ROLE_FINANCE = "Finance";
public static final String EMAIL_ROLE_HOTEL_MAINTAINER = "Hotel Maintainer";
public static final String EMAIL_ROLE_SUPPLIER_MAINTAINER = "Supplier Maintainer";
public static final String EMAIL_ROLE_PURCHASER = "Purchaser";
public static final String EMAIL_ROLE_REQUESTOR = "Requestor";
public static final String EMAIL_ROLE_CREATOR = "Creator";
public static final String EMAIL_ROLE_NOTIFIER = "Notifier";
public static final String EMAIL_ROLE_CITY_MAINTAINER = "City Maintainer";
public static final String EMAIL_ROLE_USER_MAINTAINER = "User Maintainer";
public static final String EMAIL_ROLE_INSPECTOR = "Inspector";
public static final String EMAIL_ROLE_RECEIVER = "Receiver";
public static final String EMAIL_ROLE_DELEGATE_APPROVER = "Delegate Approver";
/**
* 从数据库取得指定id的Email
*
* @param id
* Email的id
* @return 返回指定的Email
* @
*/
public Email getEmail(Integer id) ;
/**
* 插入指定的Email对象到数据库
*
* @param email
* 要保存的Email对象
* @return 保存后的Email对象
* @
*/
public Email insertEmail(Email email, String body) ;
/**
* 插入指定的Email对象到数据库
*
* @param email
* 要保存的Email对象
* @return 保存后的Email对象
* @
*/
public EmailBatch insertEmailBatch(EmailBatch emailBatch, String body) ;
/**
* 更新指定的Email对象到数据库
*
* @param email
* 要更新的Email对象
* @param body
* 要更新的Email对象的body
*
* @return 更新后的Email对象
* @
*/
public Email updateEmail(Email email) ;
/**
* 返回符合查询条件的Email对象个数
*
* @param conditions
* 包含查询条件到条件值映射的Map,其中查询条件应该来自EmailQueryCondition类的预定义常量
* @return 符合查询条件的Email对象个数
* @
*/
public int getEmailListCount(Map condtions) ;
/**
* 返回符合查询条件的Email对象列表
*
* @param conditions
* 包含查询条件到条件值映射的Map,其中查询条件应该来自EmailQueryCondition类的预定义常量
* @param pageNo
* 第几页,以pageSize为页的大小,pageSize为-1时忽略该参数
* @param pageSize
* 页的大小,-1表示不分页
* @param order
* 排序条件,null表示不排序
* @param descend
* false表示升序,true表示降序
* @return 符合查询条件的Email对象列表
* @
*/
public List getEmailList(Map condtions, int pageNo, int pageSize, EmailQueryOrder order, boolean descend) ;
/**
* 将状态为等待发送的邮件发送
*
*/
public void sendEmail();
/**
* 插入Email对象到数据库
*
* @param from
* Email的from
* @param to
* Email的to
* @param subject
* Email的subject
* @param body
* Email的body
* @
*/
public void insertEmail(Site site,String from, String to, String subject, String body) ;
public void insertEmailBatch(Site site,String from, String to, String body,String batchEmailTemplateName,String refNo, User user);
public void insertEmail(Site site,String to,String templateLocation,Map context) ;
public void insertEmailBatch(Site site,String to,String templateLocation,String refNo,Map context,String batchEmailTemplateName) ;
public void deleteEmailBatch(String refNo);
public void updateEmailBatch(EmailBatch emailBatch);
public EmailBatch findNotSendEmailBatchByRefNo(String refNo);
/**
* 将批量处理的Email插入数据库
*
*/
public void mailReminder();
public void sendBatchEmail();
}
|
[
"novthirteen@1ac4a774-0534-11de-a6e9-d320b29efae0"
] |
novthirteen@1ac4a774-0534-11de-a6e9-d320b29efae0
|
c07d19589d10501d8bc0ead1351da97d2a3174a0
|
96a0aaea05f39f4c2b970d7f30a55270c5b5171f
|
/src/main/java/org/codelibs/elasticsearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java
|
8ba8069dbd2aefede938c3769fea500da773aa52
|
[] |
no_license
|
codelibs/elasticsearch-querybuilders
|
88554ba10e694a0b4418b1045d64fe9f3c31c0aa
|
4fe5687e2aead4f02adb0ecf2c85288f40ec1f15
|
refs/heads/master
| 2023-03-22T04:36:41.422859
| 2017-09-14T13:07:55
| 2017-09-14T13:07:55
| 82,253,963
| 9
| 10
| null | 2017-03-22T12:36:54
| 2017-02-17T03:39:10
|
Java
|
UTF-8
|
Java
| false
| false
| 3,741
|
java
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.codelibs.elasticsearch.search.aggregations.metrics;
import org.codelibs.elasticsearch.common.io.stream.StreamInput;
import org.codelibs.elasticsearch.search.DocValueFormat;
import org.codelibs.elasticsearch.search.aggregations.pipeline.PipelineAggregator;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
*
*/
public abstract class InternalNumericMetricsAggregation extends InternalMetricsAggregation {
private static final DocValueFormat DEFAULT_FORMAT = DocValueFormat.RAW;
protected DocValueFormat format = DEFAULT_FORMAT;
public abstract static class SingleValue extends InternalNumericMetricsAggregation implements NumericMetricsAggregation.SingleValue {
protected SingleValue(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
super(name, pipelineAggregators, metaData);
}
/**
* Read from a stream.
*/
protected SingleValue(StreamInput in) throws IOException {
super(in);
}
@Override
public String getValueAsString() {
return format.format(value());
}
@Override
public Object getProperty(List<String> path) {
if (path.isEmpty()) {
return this;
} else if (path.size() == 1 && "value".equals(path.get(0))) {
return value();
} else {
throw new IllegalArgumentException("path not supported for [" + getName() + "]: " + path);
}
}
}
public abstract static class MultiValue extends InternalNumericMetricsAggregation implements NumericMetricsAggregation.MultiValue {
protected MultiValue(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
super(name, pipelineAggregators, metaData);
}
/**
* Read from a stream.
*/
protected MultiValue(StreamInput in) throws IOException {
super(in);
}
public abstract double value(String name);
public String valueAsString(String name) {
return format.format(value(name));
}
@Override
public Object getProperty(List<String> path) {
if (path.isEmpty()) {
return this;
} else if (path.size() == 1) {
return value(path.get(0));
} else {
throw new IllegalArgumentException("path not supported for [" + getName() + "]: " + path);
}
}
}
private InternalNumericMetricsAggregation(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
super(name, pipelineAggregators, metaData);
}
/**
* Read from a stream.
*/
protected InternalNumericMetricsAggregation(StreamInput in) throws IOException {
super(in);
}
}
|
[
"shinsuke@yahoo.co.jp"
] |
shinsuke@yahoo.co.jp
|
c519b365555ae4a6ec00eac754339da303da183b
|
74dd63d7d113e2ff3a41d7bb4fc597f70776a9d9
|
/timss-attendance/src/main/java/com/timss/attendance/scheduler/StatScheduler.java
|
923b11f6d403b4ab36126ae15dd0401bd7c523b8
|
[] |
no_license
|
gspandy/timssBusiSrc
|
989c7510311d59ec7c9a2bab3b04f5303150d005
|
a5d37a397460a7860cc221421c5f6e31b48cac0f
|
refs/heads/master
| 2023-08-14T02:14:21.232317
| 2017-02-16T07:18:21
| 2017-02-16T07:18:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,119
|
java
|
package com.timss.attendance.scheduler;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.timss.attendance.dao.StatDao;
import com.timss.attendance.service.StatService;
import com.timss.attendance.vo.StatVo;
import com.yudean.itc.dto.Page;
import com.yudean.itc.dto.sec.SecureUser;
import com.yudean.itc.manager.sec.ISecurityMaintenanceManager;
import com.yudean.mvc.bean.userinfo.UserInfo;
import com.yudean.mvc.handler.ThreadLocalHandler;
import com.yudean.mvc.service.ItcMvcService;
/**
*
* @title: 考勤统计定时任务
* @description: {desc}
* @company: gdyd
* @className: StatScheduler.java
* @author: fengzt
* @createDate: 2014年10月17日
* @updateUser: fengzt
* @version: 1.0
*/
@Component
@Lazy(false)
public class StatScheduler {
private Logger log = LoggerFactory.getLogger( StatScheduler.class );
@Autowired
private StatService statService;
@Autowired
private ItcMvcService itcMvcService;
@Autowired
private StatDao statDao;
@Autowired
private ISecurityMaintenanceManager iSecurityMaintenanceManager;
/**
*
* @description:每年定时任务更新整个考勤统计--ITC
* @author: fengzt
* @createDate: 2014年10月17日:
*/
//@Scheduled(cron = " 2 1 0 1 1 ? ")
//@Scheduled(cron = "2/30 * * * * ? ")
public void countStatData() throws Exception{
UserInfo userInfo = itcMvcService.getUserInfo( "890147", "ITC" );
ThreadLocalHandler.createNewVarableOweUserInfo( userInfo );
statService.countStatData( );
}
/**
*
* @description:每年定时任务更新整个考勤统计--湛江风电
* @author: fengzt
* @createDate: 2014年10月17日:
*/
//@Scheduled(cron = " 2 1 0 1 1 ? ")
//@Scheduled(cron = "2/30 * * * * ? ")
public void countZJWStatData() throws Exception{
UserInfo userInfo = itcMvcService.getUserInfo( "180811", "ZJW" );
ThreadLocalHandler.createNewVarableOweUserInfo( userInfo );
statService.countStatData( );
}
//@Scheduled(cron = " 2 1 0 1 1 ? ")
//@Scheduled(cron = "0 8 16 * * ? ")
public void countSWFStatData() throws Exception{
UserInfo userInfo = itcMvcService.getUserInfo( "880040", "SWF" );
ThreadLocalHandler.createNewVarableOweUserInfo( userInfo );
statService.countStatData( );
}
/**
*
* @description:人员不存在更新人员考勤统计状态
* @author: fengzt
* @createDate: 2014年10月17日:
*/
//@Scheduled(cron = "2/30 * * * * ? ")
//@Scheduled(cron = "0 0 3 * * ?")
//@Scheduled(cron = "0 50 9 * * ?")
public void updateITCStatStatus() throws Exception{
//需要更新人员状态的列表
Map<String, String> map = new HashMap<String, String>();
map.put( "ITC", "890147" );
map.put( "ZJW", "180811" );
map.put( "SWF", "880040" );
Set<String> siteSet = map.keySet();
//需要更新用户状态的列表
List<StatVo> uList = new ArrayList<StatVo>();
for( String siteId : siteSet ){
UserInfo userInfo = itcMvcService.getUserInfo( map.get( siteId ), siteId );
ThreadLocalHandler.createNewVarableOweUserInfo( userInfo );
Map<String, Object> paramMap = new HashMap<String, Object>();
int year = Calendar.getInstance().get( Calendar.YEAR );
paramMap.put( "year", year );
paramMap.put( "siteId", userInfo.getSiteId() );
//考勤统计人员数据
List<StatVo> statList = statDao.queryAllStat( paramMap );
//站点下所有用户信息u
Page<SecureUser> pageVo = new Page<SecureUser>( 1, 99999 );
SecureUser secureUser = new SecureUser();
secureUser.setCurrentSite( siteId );
secureUser.setId( map.get( siteId ) );
pageVo.setParameter( "userStatus", "Y" );
Page<SecureUser> userList = iSecurityMaintenanceManager.retrieveUniqueUsers( pageVo, secureUser );
List<SecureUser> personList = userList.getResults();
//比对用户
for( StatVo vo : statList ){
String userId = vo.getUserId();
boolean flag = false;
for( SecureUser u : personList ){
if( StringUtils.equals( u.getId(), userId )){
flag = true;
break;
}
}
//加入离职列表
if( !flag ){
StatVo temp = new StatVo();
temp.setUserId( userId );
temp.setYearLeave( year );
temp.setUserStatus( "离职" );
uList.add( temp );
}
}
}
//批量更新
if( uList.size() > 0 ){
int count = statService.updateBatchStatStatus( uList );
log.info( "每日定时更新考勤统计的用户数量是:" + count + " ; 明细:" + uList.toString() );
}
}
@Scheduled(cron = "0 10 0 * * ?")
public void checkStat() throws Exception{
log.info("statScheduler.checkStat start");
String[]checkSites=new String[]{"SWF","ITC","ZJW","DPP"};
for (String siteId : checkSites) {
log.info("statScheduler.checkStat->"+siteId);
statService.checkPersonStat(false,false,siteId, null,null,null);
}
log.info("statScheduler.checkStat finish");
}
}
|
[
"londalonda@qq.com"
] |
londalonda@qq.com
|
4a6032188daa5683159b7112e1a6311cb1b7ad99
|
a666c798a28223f97d74d21786f9a4f4000d5acb
|
/edu.harvard.i2b2.fr/gensrc/edu/harvard/i2b2/fr/datavo/pm/GetUserConfigurationType.java
|
01412e46690179e431283dbd71060d4b91ad4b77
|
[] |
no_license
|
gmacdonnell/i2b2-fsu-1704
|
d65239edf95aa3b25844a6ed9af599e06dcaa185
|
12638996fe46a7014ac827e359c40e5b0e8c1d3e
|
refs/heads/master
| 2021-01-23T07:02:31.537241
| 2015-01-27T15:09:33
| 2015-01-27T15:09:33
| 29,916,117
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,243
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.01.26 at 12:45:44 PM EST
//
package edu.harvard.i2b2.fr.datavo.pm;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for get_user_configurationType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="get_user_configurationType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="project" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* <element name="data_needed" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "get_user_configurationType", propOrder = {
"project",
"dataNeeded"
})
public class GetUserConfigurationType {
protected List<String> project;
@XmlElement(name = "data_needed")
protected List<String> dataNeeded;
/**
* Gets the value of the project property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the project property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getProject().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getProject() {
if (project == null) {
project = new ArrayList<String>();
}
return this.project;
}
/**
* Gets the value of the dataNeeded property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dataNeeded property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDataNeeded().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getDataNeeded() {
if (dataNeeded == null) {
dataNeeded = new ArrayList<String>();
}
return this.dataNeeded;
}
}
|
[
"gmacdonnell@fsu.edu"
] |
gmacdonnell@fsu.edu
|
e5e139a18ba8ddae509ab1b91e0fc0f72bd20808
|
eb2556a43cc0a8d1c525fb21bb00d5a6158da4ad
|
/basex-core/src/test/java/org/basex/query/index/ValueIndexTest.java
|
21afed6f2bb8978f78113c62bd00009a487ed1a7
|
[
"BSD-3-Clause"
] |
permissive
|
SirOlrac/basex
|
ee22c8336f2430ae38e962399f1cdc89c9a657d3
|
b97a3bbf961178d0c3dc8c65d389c8299fc5d517
|
refs/heads/master
| 2020-06-13T20:08:21.217244
| 2016-12-02T21:48:49
| 2016-12-02T21:48:49
| 75,557,973
| 1
| 0
| null | 2016-12-04T19:08:45
| 2016-12-04T19:08:45
| null |
UTF-8
|
Java
| false
| false
| 4,935
|
java
|
package org.basex.query.index;
import java.util.*;
import java.util.List;
import java.util.Map.Entry;
import org.basex.core.*;
import org.basex.core.cmd.*;
import org.basex.query.ast.*;
import org.basex.query.expr.ft.*;
import org.basex.util.*;
import org.junit.*;
import org.junit.Test;
import org.junit.runner.*;
import org.junit.runners.*;
import org.junit.runners.Parameterized.*;
/**
* This class tests if value indexes will be used.
*
* @author BaseX Team 2005-16, BSD License
* @author Christian Gruen
*/
@RunWith(Parameterized.class)
public final class ValueIndexTest extends QueryPlanTest {
/** Test file. */
private static final String FILE = "src/test/resources/selective.xml";
/** Main memory flag. */
@Parameter
public Object mainmem;
/**
* Mainmem parameters.
* @return parameters
*/
@Parameters
public static Collection<Object[]> params() {
final List<Object[]> params = new ArrayList<>();
params.add(new Object[] { false });
params.add(new Object[] { true });
return params;
}
/**
* Initializes a test.
*/
@Before
public void before() {
set(MainOptions.MAINMEM, mainmem);
}
/**
* Finalizes a test.
*/
@After
public void after() {
set(MainOptions.MAINMEM, false);
set(MainOptions.UPDINDEX, false);
set(MainOptions.FTINDEX, false);
set(MainOptions.TEXTINCLUDE, "");
set(MainOptions.ATTRINCLUDE, "");
set(MainOptions.TOKENINCLUDE, "");
set(MainOptions.FTINCLUDE, "");
}
/**
* Initializes the tests.
*/
@BeforeClass
public static void start() {
execute(new CreateDB(NAME, FILE));
}
/**
* Tests the text index.
*/
@Test
public void textIndex() {
for(final Entry<String, String> entry : map().entrySet()) {
final String key = entry.getKey(), value = entry.getValue();
set(MainOptions.TEXTINCLUDE, key);
execute(new CreateDB(NAME, FILE));
check("count(//" + key + "[text() = " + value + "])",
Integer.toString(value.split(",").length), "exists(//ValueAccess)");
if(!key.equals("*")) check("//X[text() = 'unknown']", "", "exists(//DBNode)");
}
}
/**
* Tests the attribute index.
*/
@Test
public void attrIndex() {
for(final Entry<String, String> entry : map().entrySet()) {
final String key = entry.getKey(), value = entry.getValue();
set(MainOptions.ATTRINCLUDE, key);
execute(new CreateDB(NAME, FILE));
check("count(//*[@" + key + " = " + value + "])",
Integer.toString(value.split(",").length), "exists(//ValueAccess)");
if(!key.equals("*")) check("//*[@x = 'unknown']", "", "exists(//DBNode)");
}
}
/**
* Tests the full-text index.
*/
@Test
public void fulltextIndex() {
// not applicable in main-memory mode
if((Boolean) mainmem) return;
set(MainOptions.FTINDEX, true);
for(final Entry<String, String> entry : map().entrySet()) {
final String key = entry.getKey(), value = entry.getValue();
set(MainOptions.FTINCLUDE, key);
execute(new CreateDB(NAME, FILE));
check("count(//" + key + "[text() contains text { " + value + " }])",
Integer.toString(value.split(",").length),
"exists(//" + Util.className(FTIndexAccess.class) + ")");
if(!key.equals("*")) check("//X[text() contains text 'unknown']", "", "exists(//DBNode)");
}
}
/**
* Tests the text index and update operations.
*/
@Test
public void textUpdates() {
set(MainOptions.UPDINDEX, true);
set(MainOptions.TEXTINCLUDE, "a");
execute(new CreateDB(NAME, "<x><a>text</a><b>TEXT</b></x>"));
check("count(//a[text() = 'text'])", "1", "exists(//ValueAccess)");
check("count(//b[text() = 'TEXT'])", "1", "empty(//ValueAccess)");
query("replace value of node x/a with 'TEXT'");
check("count(//a[text() = 'TEXT'])", "1", "exists(//ValueAccess)");
query("rename node x/a as 'b'");
check("//a[text() = 'TEXT']", "", "exists(//Empty)");
check("count(//b[text() = 'TEXT'])", "2", "empty(ValueAccess)");
query("x/b/(rename node . as 'a')");
check("count(//a[text() = 'TEXT'])", "2", "exists(//ValueAccess)");
check("count(//b[text() = 'TEXT'])", "0", "empty(//ValueAccess)");
query("x/a/(replace value of node . with 'text')");
check("count(//a[text() = 'text'])", "2", "exists(//ValueAccess)");
query("delete node x/a[1]");
check("count(//a[text() = 'text'])", "1", "exists(//ValueAccess)");
query("delete node x/a[1]");
check("//a[text() = 'text']", "", "exists(//Empty)");
}
/**
* Returns a map with name tests.
* @return map
*/
private static HashMap<String, String> map() {
final LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("*", "'A'");
map.put("a", "'A'");
map.put("*:c", "('C','PC')");
map.put("Q{ns}*", "('PC','PD')");
map.put("Q{ns}c", "'PC'");
return map;
}
}
|
[
"christian.gruen@gmail.com"
] |
christian.gruen@gmail.com
|
9909ab74773e813867571c2ea49826f1f6708e2d
|
cb4a7d111ca44fa127c994781fbaab83526ec4e9
|
/gainde-demo/gainde-integral-ejb/gainde-integral-ressources/gainde-integral-rc-api/src/main/java/sn/com/douane/ejb/rc/model/dao/IHistoProduitDao.java
|
f2622ad1b34e6b851f5172cd992ecc9564f5dfd6
|
[] |
no_license
|
jasmineconseil/applicationBlanche
|
56d6493cdf68ae870ddd3584dbc1d4e95df6f402
|
a23247ec783d9cb856c538aacb20f76c6eed5307
|
refs/heads/master
| 2020-12-26T00:06:23.151181
| 2014-03-11T11:07:03
| 2014-03-11T11:07:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 178
|
java
|
package sn.com.douane.ejb.rc.model.dao;
import sn.com.douane.ejb.rc.model.entities.HistoProduit;
public interface IHistoProduitDao extends IGenericDao<HistoProduit>{
}
|
[
"contact@jasforge.com"
] |
contact@jasforge.com
|
1fa313d079cb675e03452959faf805da66cf7ac4
|
cc0458b38bf6d7bac7411a9c6fec9bc3b8282d3f
|
/thirdParty/CSharpParser/src/csmc/javacc/generated/syntaxtree/SelectClause.java
|
4fc3c1a4b648591e40f438f019c01304182a21b3
|
[] |
no_license
|
RinatGumarov/Code-metrics
|
62f99c25b072dd56e9c953d40dac7076a4376180
|
2005b6671c174e09e6ea06431d4711993a33ecb6
|
refs/heads/master
| 2020-07-12T04:01:47.007860
| 2017-08-08T07:19:26
| 2017-08-08T07:19:26
| 94,275,456
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 909
|
java
|
//
// Generated by JTB 1.3.2
//
package csmc.javacc.generated.syntaxtree;
/**
* Grammar production:
* f0 -> <SELECT>
* f1 -> Expression()
*/
public class SelectClause implements Node {
public NodeToken f0;
public Expression f1;
public SelectClause(NodeToken n0, Expression n1) {
f0 = n0;
f1 = n1;
}
public SelectClause(Expression n0) {
f0 = new NodeToken("select");
f1 = n0;
}
public void accept(csmc.javacc.generated.visitor.Visitor v) {
v.visit(this);
}
public <R,A> R accept(csmc.javacc.generated.visitor.GJVisitor<R,A> v, A argu) {
return v.visit(this,argu);
}
public <R> R accept(csmc.javacc.generated.visitor.GJNoArguVisitor<R> v) {
return v.visit(this);
}
public <A> void accept(csmc.javacc.generated.visitor.GJVoidVisitor<A> v, A argu) {
v.visit(this,argu);
}
}
|
[
"tiran678@icloud.com"
] |
tiran678@icloud.com
|
bc384dfcf761b2d74774c9237b92334034310ffc
|
a0e4f155a7b594f78a56958bca2cadedced8ffcd
|
/header/src/main/java/org/zstack/header/storage/snapshot/VolumeSnapshotTreeEO.java
|
e009c124bced5d06c113e90c2d7d05d7749f5b32
|
[
"Apache-2.0"
] |
permissive
|
zhao-qc/zstack
|
e67533eabbbabd5ae9118d256f560107f9331be0
|
b38cd2324e272d736f291c836f01966f412653fa
|
refs/heads/master
| 2020-08-14T15:03:52.102504
| 2019-10-14T03:51:12
| 2019-10-14T03:51:12
| 215,187,833
| 3
| 0
|
Apache-2.0
| 2019-10-15T02:27:17
| 2019-10-15T02:27:16
| null |
UTF-8
|
Java
| false
| false
| 423
|
java
|
package org.zstack.header.storage.snapshot;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
*/
@Entity
@Table
public class VolumeSnapshotTreeEO extends VolumeSnapshotTreeAO {
@Column
private String deleted;
public String getDeleted() {
return deleted;
}
public void setDeleted(String deleted) {
this.deleted = deleted;
}
}
|
[
"xuexuemiao@yeah.net"
] |
xuexuemiao@yeah.net
|
be14ae05087cca147247e1a23cdb07abdc1f89fe
|
d2b385a4d203b106863b1075963b5985be6dbf6b
|
/java8583/src/main/java/com/szxb/java8583/module/BankPay.java
|
212c3fe8c2e1c3bc025a2c78cd9e09d43d9a52f7
|
[] |
no_license
|
wuxinxi/unionpay
|
f0073bc6f4a6d626140afd2928212da27c48ded8
|
ec1f1cbe50c4e2af730a7a520bbc600d67fd5e57
|
refs/heads/master
| 2020-03-21T20:22:00.076608
| 2018-09-14T09:27:57
| 2018-09-14T09:27:57
| 139,002,533
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,432
|
java
|
package com.szxb.java8583.module;
import com.szxb.java8583.core.Iso8583Message;
import com.szxb.java8583.module.manager.BusllPosManage;
import com.szxb.java8583.util.MacEcbUtils;
import static com.szxb.java8583.util.EncodeUtil.hex2byte;
import static com.szxb.java8583.util.EncodeUtil.mergeByte;
import static com.szxb.java8583.util.EncodeUtil.str2Bcd;
import static com.szxb.java8583.util.MacEcbUtils.bytesToHexString;
/**
* 作者:Tangren on 2018-07-05
* 包名:com.szxb.java8583.module
* 邮箱:996489865@qq.com
* TODO:一句话描述
*/
public class BankPay {
private volatile static BankPay instance = null;
private BankPay() {
}
public static BankPay getInstance() {
if (instance == null) {
synchronized (BankPay.class) {
if (instance == null) {
instance = new BankPay();
}
}
}
return instance;
}
public Iso8583Message payMessage(BusCard busCard) {
String cardNum = busCard.getCardNum();
int cardNumLen = cardNum.length();
for (int i = 0; i < 4 - cardNumLen; i++) {
cardNum = "0" + cardNum;
}
busCard.setCardNum(cardNum);
Iso8583Message iso8583Message = payMessageData(busCard);
byte[] dataAll = iso8583Message.getBytes();
byte[] data = new byte[dataAll.length - 2];
System.arraycopy(dataAll, 2, data, 0, data.length);
iso8583Message.setTpdu(BusllPosManage.getPosManager().getTPDU())
.setHeader("613100313031")
.setValue(64, pay_field_64(data, busCard.getMacKey()));
return iso8583Message;
}
private Iso8583Message payMessageData(BusCard busCard) {
Iso8583Message message = new Iso8583Message(BaseFactory.payBaseFactory());
message.setMti("0200")
.setValue(2, busCard.getMainCardNo())//主账号
.setValue(3, "000000")//交易处理码
.setValue(4, String.format("%012d", busCard.getMoney()))//交易金额
.setValue(11, String.format("%06d", busCard.getTradeSeq()))//受卡方系统跟踪号,流水号
.setValue(22, "072")//服务点输入方式码
.setValue(23, busCard.getCardNum())//卡片序列号
.setValue(25, "00")//服务点条件码
.setValue(35, busCard.getMagTrackData())//2 磁道数据
.setValue(41, BusllPosManage.getPosManager().getPosSn())
.setValue(42, BusllPosManage.getPosManager().getMchId())
.setValue(49, "156")//交易货币代码
.setValue(53, String.format("%016d", 0))//安全控制信息
.setValue(55, busCard.getTlv55())
.setValue(60, bytesToHexString(pay_field_60()))
.setValue(64, "");
return message;
}
/**
* @return 64域
*/
private String pay_field_64(byte[] data, String macKey) {
byte[] mac = MacEcbUtils.getMac(hex2byte(macKey), data);
return bytesToHexString(mac);
}
/**
* @return 交易60
*/
private byte[] pay_field_60() {
byte[] field_60_1 = str2Bcd("22");
byte[] field_60_2 = str2Bcd(BusllPosManage.getPosManager().getBatchNum());
byte[] field_60_3 = str2Bcd("000600", 1);
return mergeByte(field_60_1, field_60_2, field_60_3);
}
}
|
[
"996489865@qq.com"
] |
996489865@qq.com
|
c05b421107ffd1c87ff9ae9ade5761f77d4b8450
|
84fbc1625824ba75a02d1777116fe300456842e5
|
/Engagement_Challenges/Engagement_4/airplan_5/source/com/roboticcusp/mapping/ChartTextWriter.java
|
b4e836ff031b1dddf5abf88bc9feacf30a019717
|
[] |
no_license
|
unshorn-forks/STAC
|
bd41dee06c3ab124177476dcb14a7652c3ddd7b3
|
6919d7cc84dbe050cef29ccced15676f24bb96de
|
refs/heads/master
| 2023-03-18T06:37:11.922606
| 2018-04-18T17:01:03
| 2018-04-18T17:01:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,319
|
java
|
package com.roboticcusp.mapping;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class ChartTextWriter extends ChartWriter {
public static final String TYPE = "text";
@Override
public void write(Chart chart, String filename) throws ChartWriterException {
try (PrintWriter writer = new PrintWriter(filename + ".txt")){
for (Vertex v : chart) {
java.util.List<Edge> edges = chart.getEdges(v.getId());
for (int p = 0; p < edges.size(); ) {
for (; (p < edges.size()) && (Math.random() < 0.5); ) {
for (; (p < edges.size()) && (Math.random() < 0.6); ) {
for (; (p < edges.size()) && (Math.random() < 0.4); p++) {
Edge e = edges.get(p);
writer.println(v.getName() + " " + e.getSink().getName() + " "
+ e.getWeight());
}
}
}
}
}
} catch (FileNotFoundException e) {
throw new ChartWriterException(e.getMessage());
} catch (ChartException e) {
throw new ChartWriterException(e.getMessage());
}
}
}
|
[
"rborbely@cyberpointllc.com"
] |
rborbely@cyberpointllc.com
|
2ae614b2ed1e50091b86aec477cbd8bbbbbc4c5a
|
9e048428ca10f604c557784f4b28c68ce9b5cccb
|
/bitcamp-spring-ioc/src/main/java/org/springframework/step03/Exam02.java
|
8b7824704536f79ec425b5aade099561e30404c3
|
[] |
no_license
|
donhee/bitcamp
|
6c90ec687e00de07315f647bdb1fda0e277c3937
|
860aa16d86cbd6faeb56b1f5c70b5ea5d297aef0
|
refs/heads/master
| 2021-01-24T11:44:48.812897
| 2019-02-20T00:06:07
| 2019-02-20T00:06:07
| 123,054,172
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 479
|
java
|
package org.springframework.step03;
import org.springframework.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Exam02 {
public static void main(String[] args) {
ApplicationContext iocContainer = new ClassPathXmlApplicationContext(
"org/springframework/step03/application-context-02.xml");
BeanUtils.printBeanNames(iocContainer);
}
}
|
[
"231313do@gmail.com"
] |
231313do@gmail.com
|
274f694304fe6ccb95dd23799a67efa1cc70e9f1
|
57728206bbcfc486e7a5606b894fa9009a8b9a88
|
/server/src/com/cloud/upgrade/dao/Upgrade2210to2211.java
|
3ba74974b55f71f8ae67f07f5d56830f57ee9dec
|
[] |
no_license
|
chiragjog/CloudStack
|
ae790a261045ebbf68a33d8dd1a86e6b479a5770
|
6279ca28d6e274fba980527f39b89e9af2bf588a
|
refs/heads/master
| 2021-01-18T03:36:30.256959
| 2012-02-24T01:18:50
| 2012-02-24T01:18:50
| 2,956,218
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,897
|
java
|
/**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It 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 any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.upgrade.dao;
import java.io.File;
import java.sql.Connection;
import org.apache.log4j.Logger;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.script.Script;
public class Upgrade2210to2211 implements DbUpgrade {
final static Logger s_logger = Logger.getLogger(Upgrade2210to2211.class);
@Override
public String[] getUpgradableVersionRange() {
return new String[] { "2.2.10", "2.2.10"};
}
@Override
public String getUpgradedVersion() {
return "2.2.11";
}
@Override
public boolean supportsRollingUpgrade() {
return true;
}
@Override
public File[] getPrepareScripts() {
String script = Script.findScript("", "db/schema-2210to2211.sql");
if (script == null) {
throw new CloudRuntimeException("Unable to find db/schema-2210to2211.sql");
}
return new File[] { new File(script) };
}
@Override
public void performDataMigration(Connection conn) {
}
@Override
public File[] getCleanupScripts() {
return null;
}
}
|
[
"prachi@cloud.com"
] |
prachi@cloud.com
|
4d82935e7f403bf082a6d87230c6a2b92149fbaa
|
d502c1e6b24da059f92732b87203ef74aca7d0a2
|
/MyProject/Test/PlayerTest.java
|
f1e540c28aaf2e7d4344638b0dc5b67ef47f1cf6
|
[] |
no_license
|
triest/Java-different
|
a4a326febd1fe1cd7cc43271c7043749db3cb96b
|
f316c3ab4d190d370cf3b1299e57f9c9817a8221
|
refs/heads/master
| 2020-09-07T10:53:42.732416
| 2019-11-10T07:32:15
| 2019-11-10T07:32:15
| 220,755,784
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 645
|
java
|
import static org.junit.Assert.*;
import org.junit.Assert;
import org.junit.Test;
import java.lang.reflect.*;
import static org.junit.Assert.*;
/**
* Created by triest on 13.02.2017.
*/
public class PlayerTest {
@Test
public void getName() throws Exception {
String value="Jon";
Player player=new Player(value,null);
assertEquals(value,player.getName());
}
@Test
public void getFigure() throws Exception{
final Figure input=Figure.X;
final Figure extendValue=input;
Player player=new Player("Jon",input);
assertEquals(extendValue,player.getFigure());
}
}
|
[
"you@example.com"
] |
you@example.com
|
1663eb82f447185bd4f6bd77f01b696db8b42e8a
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/plugin/webview/luggage/jsapi/LuggageUploadMediaFileManager$2.java
|
2a080a82aff4a3eb4a0ef1355b32243c172549a6
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028
| 2019-06-21T09:17:26
| 2019-06-21T09:17:26
| 193,069,132
| 9
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 849
|
java
|
package com.tencent.mm.plugin.webview.luggage.jsapi;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import com.tencent.matrix.trace.core.AppMethodBeat;
final class LuggageUploadMediaFileManager$2
implements DialogInterface.OnClickListener
{
LuggageUploadMediaFileManager$2(LuggageUploadMediaFileManager paramLuggageUploadMediaFileManager)
{
}
public final void onClick(DialogInterface paramDialogInterface, int paramInt)
{
AppMethodBeat.i(6393);
this.ukE.ukD.a(false, null);
AppMethodBeat.o(6393);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.webview.luggage.jsapi.LuggageUploadMediaFileManager.2
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
e24a477447814958361a20444fa636044b5a1d2b
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/single-large-project/src/test/java/org/gradle/test/performancenull_382/Testnull_38142.java
|
5a34df8288a1b601c0f1f4627edc36514ae6080d
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package org.gradle.test.performancenull_382;
import static org.junit.Assert.*;
public class Testnull_38142 {
private final Productionnull_38142 production = new Productionnull_38142("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
692c06c3a572c4122bd0d259fe16fd740000dd3e
|
efd54286d87371d6305fc0a754a9a9ef2147955b
|
/src/net/ememed/user2/util/Rsa.java
|
0ea1b73e4e5db751f394c1b3486684e8a1e6e00b
|
[] |
no_license
|
eltld/user
|
3127b1f58ab294684eba3ff27446da14f2b51da0
|
f5087033d4da190856627a98fe532e158465aa60
|
refs/heads/master
| 2020-12-03T10:26:45.629899
| 2015-04-30T10:22:14
| 2015-04-30T10:22:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,489
|
java
|
/*
* Copyright (C) 2010 The MobileSecurePay Project
* All right reserved.
* author: shiqun.shi@alipay.com
*/
package net.ememed.user2.util;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import javax.crypto.Cipher;
public class Rsa {
private static final String ALGORITHM = "RSA";
/**
* @param algorithm
* @param ins
* @return
* @throws NoSuchAlgorithmException
* @throws AlipayException
*/
private static PublicKey getPublicKeyFromX509(String algorithm,
String bysKey) throws NoSuchAlgorithmException, Exception {
byte[] decodedKey = Base64.decode(bysKey);
X509EncodedKeySpec x509 = new X509EncodedKeySpec(decodedKey);
KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
return keyFactory.generatePublic(x509);
}
public static String encrypt(String content, String key) {
try {
PublicKey pubkey = getPublicKeyFromX509(ALGORITHM, key);
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, pubkey);
byte plaintext[] = content.getBytes("UTF-8");
byte[] output = cipher.doFinal(plaintext);
String s = new String(Base64.encode(output));
return s;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static final String SIGN_ALGORITHMS = "SHA1WithRSA";
public static String sign(String content, String privateKey) {
String charset = "UTF-8";
try {
PKCS8EncodedKeySpec priPKCS8 = new PKCS8EncodedKeySpec(
Base64.decode(privateKey));
KeyFactory keyf = KeyFactory.getInstance("RSA");
PrivateKey priKey = keyf.generatePrivate(priPKCS8);
java.security.Signature signature = java.security.Signature
.getInstance(SIGN_ALGORITHMS);
signature.initSign(priKey);
signature.update(content.getBytes(charset));
byte[] signed = signature.sign();
return Base64.encode(signed);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String getMD5(String content) {
String s = null;
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f' };
try {
java.security.MessageDigest md = java.security.MessageDigest
.getInstance("MD5");
md.update(content.getBytes());
byte tmp[] = md.digest();
char str[] = new char[16 * 2];
int k = 0;
for (int i = 0; i < 16; i++) {
byte byte0 = tmp[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
s = new String(str);
} catch (Exception e) {
e.printStackTrace();
}
return s;
}
public static boolean doCheck(String content, String sign, String publicKey) {
try {
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
byte[] encodedKey = Base64.decode(publicKey);
PublicKey pubKey = keyFactory
.generatePublic(new X509EncodedKeySpec(encodedKey));
java.security.Signature signature = java.security.Signature
.getInstance(SIGN_ALGORITHMS);
signature.initVerify(pubKey);
signature.update(content.getBytes("utf-8"));
// Log.i("Result", "content : "+content);
// Log.i("Result", "sign: "+sign);
boolean bverify = signature.verify(Base64.decode(sign));
// Log.i("Result","bverify = " + bverify);
return bverify;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
}
|
[
"happyjie.1988@163.com"
] |
happyjie.1988@163.com
|
79dfb50a2a223566aa1902b57e99b3ab38c1ee39
|
73c5f5a5545036967df0d5ddf2cbfaa97fbe49ed
|
/src/src/com/rapidminer/tools/math/optimization/ec/pso/PSOOptimization.java
|
0d654618cb202068055f13a878f0833e2ba16a39
|
[] |
no_license
|
hejiming/rapiddataminer
|
74b103cb4523ccba47150045c165dc384cf7d38f
|
177e15fa67dee28b311f6d9176bbfeedae6672e2
|
refs/heads/master
| 2021-01-10T11:35:48.036839
| 2015-12-31T12:29:43
| 2015-12-31T12:29:43
| 48,233,639
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,907
|
java
|
/*
* RapidMiner
*
* Copyright (C) 2001-2008 by Rapid-I and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapid-i.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.tools.math.optimization.ec.pso;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.performance.PerformanceVector;
import com.rapidminer.tools.RandomGenerator;
import com.rapidminer.tools.math.optimization.Optimization;
/**
* This class performs the optimization of a value vector with a particle swarm
* approach.
*
* @author Ingo Mierswa
* @version $Id: PSOOptimization.java,v 1.3 2008/05/09 19:23:19 ingomierswa Exp $
*/
public abstract class PSOOptimization implements Optimization {
private int maxGen;
private int maxWithoutImprovement;
private double inertiaWeight;
private double localWeight;
private double globalWeight;
private double minValue;
private double maxValue;
private double inertiaWeightDelta;
private RandomGenerator random;
private Population population;
/** Creates a new PSO optimization with the given parameters. */
public PSOOptimization(int popSize, int individualSize, int maxGen, int maxWithoutImprovement, double inertiaWeight, double localWeight, double globalWeight, double minValue, double maxValue, boolean dynamicInertiaWeight, RandomGenerator random) {
this.maxGen = maxGen;
this.maxWithoutImprovement = maxWithoutImprovement;
if (this.maxWithoutImprovement < 1)
this.maxWithoutImprovement = this.maxGen;
this.inertiaWeight = inertiaWeight;
this.localWeight = localWeight;
this.globalWeight = globalWeight;
this.minValue = minValue;
this.maxValue = maxValue;
this.inertiaWeightDelta = 0.0d;
if (dynamicInertiaWeight) {
inertiaWeightDelta = inertiaWeight / maxGen;
}
this.random = random;
this.population = createInitialPopulation(popSize, individualSize);
}
/**
* Subclasses must implement this method to calculate the fitness of the
* given individual. Please note that null might be returned for non-valid
* individuals.
*/
public abstract PerformanceVector evaluateIndividual(double[] individual) throws OperatorException;
/**
* This method is invoked after each evaluation. The default implementation
* does nothing but subclasses might implement this method to support online
* plotting or logging.
*/
public void nextIteration() throws OperatorException {}
public void setMinValue(double minValue) {
this.minValue = minValue;
}
public void setMaxValue(double maxValue) {
this.maxValue = maxValue;
}
/** Creates the initial population. */
protected Population createInitialPopulation(int popSize, int individualSize) {
Population initPop = new Population(popSize, individualSize);
for (int i = 0; i < popSize; i++) {
double[] values = new double[individualSize];
for (int j = 0; j < values.length; j++) {
values[j] = random.nextDoubleInRange(minValue, maxValue);
}
initPop.setValues(i, values);
}
return initPop;
}
/** Invoke this method for optimization. */
public void optimize() throws OperatorException {
// velocities
double[][] velocities = new double[population.getNumberOfIndividuals()][population.getIndividualSize()];
for (int p = 0; p < velocities.length; p++) {
for (int a = 0; a < velocities[p].length; a++) {
velocities[p][a] = 0.0d;
}
}
evaluate(population);
population.nextGeneration();
nextIteration();
while (!((population.getGeneration() >= maxGen) || (population.getGenerationsWithoutImprovement() >= maxWithoutImprovement) || (population.getBestFitnessEver() >= population.getBestPerformanceEver().getMainCriterion().getMaxFitness()))) {
// update velocities
double[] globalBest = population.getGlobalBestValues();
for (int i = 0; i < velocities.length; i++) {
double[] localBest = population.getLocalBestValues(i);
double[] current = population.getValues(i);
for (int d = 0; d < velocities[i].length; d++) {
velocities[i][d] = inertiaWeight * velocities[i][d] + localWeight * (random.nextGaussian() + 1.0d) * (localBest[d] - current[d]) + globalWeight * (random.nextGaussian() + 1.0d) * (globalBest[d] - current[d]);
}
}
// update positions
for (int i = 0; i < velocities.length; i++) {
double[] current = population.getValues(i);
double[] newValues = new double[current.length];
for (int d = 0; d < velocities[i].length; d++) {
newValues[d] = current[d] + velocities[i][d];
if (newValues[d] < minValue)
newValues[d] = minValue;
if (newValues[d] > maxValue)
newValues[d] = maxValue;
}
population.setValues(i, newValues);
}
inertiaWeight -= inertiaWeightDelta;
evaluate(population);
population.nextGeneration();
nextIteration();
}
}
/**
* Calculates the fitness for all individuals and gives the fitness values
* to the population.
*/
private void evaluate(Population population) throws OperatorException {
PerformanceVector[] fitnessValues = new PerformanceVector[population.getNumberOfIndividuals()];
for (int i = 0; i < fitnessValues.length; i++) {
double[] individual = population.getValues(i);
fitnessValues[i] = evaluateIndividual(individual);
}
population.setFitnessVector(fitnessValues);
}
/** Returns the current generation. */
public int getGeneration() {
return population.getGeneration();
}
/** Returns the best fitness in the current generation. */
public double getBestFitnessInGeneration() {
return population.getBestFitnessInGeneration();
}
/** Returns the best fitness ever. */
public double getBestFitnessEver() {
return population.getBestFitnessEver();
}
/** Returns the best performance vector ever. */
public PerformanceVector getBestPerformanceEver() {
return population.getBestPerformanceEver();
}
/**
* Returns the best values ever. Use this method after optimization to get
* the best result.
*/
public double[] getBestValuesEver() {
return population.getGlobalBestValues();
}
}
|
[
"dao.xiang.cun@163.com"
] |
dao.xiang.cun@163.com
|
bf64ec72dcc554f89d74412348fbe1d1e074b8bb
|
cca87c4ade972a682c9bf0663ffdf21232c9b857
|
/com/tencent/mm/plugin/fps_lighter/b/a.java
|
f21824995253d8ec39ed0633a32c5c9f217c4954
|
[] |
no_license
|
ZoranLi/wechat_reversing
|
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
|
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
|
refs/heads/master
| 2021-07-05T01:17:20.533427
| 2017-09-25T09:07:33
| 2017-09-25T09:07:33
| 104,726,592
| 12
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,722
|
java
|
package com.tencent.mm.plugin.fps_lighter.b;
import android.app.Activity;
import android.app.Application;
import android.app.Application.ActivityLifecycleCallbacks;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import com.tencent.mm.sdk.platformtools.w;
import java.util.ArrayList;
import java.util.Iterator;
class a implements ActivityLifecycleCallbacks {
public boolean kNU;
private Handler lPA = new Handler(Looper.getMainLooper());
public boolean lPx;
private Activity lPy;
private Runnable lPz;
public ArrayList<a> mListeners = new ArrayList();
protected interface a {
void A(Activity activity);
void x(Activity activity);
void y(Activity activity);
void z(Activity activity);
}
a() {
}
public void c(Application application) {
application.registerActivityLifecycleCallbacks(this);
}
public void d(Application application) {
application.unregisterActivityLifecycleCallbacks(this);
this.mListeners.clear();
}
public void onActivityResumed(final Activity activity) {
this.lPx = false;
w.i("MicroMsg.BaseFrameBeatCore", "[onActivityResumed] foreground:%s", new Object[]{Boolean.valueOf(this.kNU)});
final boolean z = !this.kNU;
this.kNU = true;
if (activity != this.lPy) {
Iterator it = this.mListeners.iterator();
while (it.hasNext()) {
try {
((a) it.next()).A(activity);
} catch (Exception e) {
w.e("MicroMsg.BaseFrameBeatCore", "Listener threw exception!", new Object[]{e});
}
}
this.lPy = activity;
}
Handler handler = this.lPA;
Runnable anonymousClass1 = new Runnable(this) {
final /* synthetic */ a lPC;
public final void run() {
if (z) {
w.i("MicroMsg.BaseFrameBeatCore", "went foreground");
Iterator it = this.lPC.mListeners.iterator();
while (it.hasNext()) {
try {
((a) it.next()).x(activity);
} catch (Exception e) {
w.e("MicroMsg.BaseFrameBeatCore", "Listener threw exception!", new Object[]{e});
}
}
return;
}
w.i("MicroMsg.BaseFrameBeatCore", "still foreground");
}
};
this.lPz = anonymousClass1;
handler.postDelayed(anonymousClass1, 600);
}
public void onActivityPaused(final Activity activity) {
w.i("MicroMsg.BaseFrameBeatCore", "[onActivityPaused] foreground:%s", new Object[]{Boolean.valueOf(this.kNU)});
this.lPx = true;
if (this.lPz != null) {
this.lPA.removeCallbacks(this.lPz);
}
Handler handler = this.lPA;
Runnable anonymousClass2 = new Runnable(this) {
final /* synthetic */ a lPC;
public final void run() {
if (this.lPC.kNU && this.lPC.lPx) {
this.lPC.kNU = false;
w.i("MicroMsg.BaseFrameBeatCore", "went background");
Iterator it = this.lPC.mListeners.iterator();
while (it.hasNext()) {
try {
((a) it.next()).y(activity);
} catch (Exception e) {
w.e("MicroMsg.BaseFrameBeatCore", "Listener threw exception!", new Object[]{e});
}
}
return;
}
w.i("MicroMsg.BaseFrameBeatCore", "still foreground");
}
};
this.lPz = anonymousClass2;
handler.postDelayed(anonymousClass2, 600);
}
public void onActivityCreated(Activity activity, Bundle bundle) {
w.i("MicroMsg.BaseFrameBeatCore", "Activity:%s", new Object[]{activity.getClass().getSimpleName()});
this.lPy = activity;
Iterator it = this.mListeners.iterator();
while (it.hasNext()) {
try {
((a) it.next()).z(activity);
} catch (Exception e) {
w.e("MicroMsg.BaseFrameBeatCore", "Listener threw exception!", new Object[]{e});
}
}
}
public void onActivityStarted(Activity activity) {
}
public void onActivityStopped(Activity activity) {
}
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
public void onActivityDestroyed(Activity activity) {
}
}
|
[
"lizhangliao@xiaohongchun.com"
] |
lizhangliao@xiaohongchun.com
|
18d59b45e7f6a2b816681d1bb73304748284d1a2
|
f039113a31256ec26cc6a347debd59c753f936c2
|
/servlet/java-configuration/data/src/main/java/example/Message.java
|
62f83f28b55eddff31d8fc215b3c87b36c011436
|
[] |
no_license
|
lzqjsk/spring-security-samples
|
3a41002f01dbbf97a1c44463bf290a335f60fd72
|
ca32d8e45dc48edcedf1cecf6e70e43022acd4dd
|
refs/heads/main
| 2023-09-04T16:34:23.742215
| 2021-11-10T17:20:09
| 2021-11-10T17:20:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,782
|
java
|
/*
* Copyright 2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
import java.util.Calendar;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotEmpty;
@Entity
public class Message {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotEmpty(message = "Message is required.")
private String text;
@NotEmpty(message = "Summary is required.")
private String summary;
private Calendar created = Calendar.getInstance();
@OneToOne
private User to;
public User getTo() {
return this.to;
}
public void setTo(User to) {
this.to = to;
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Calendar getCreated() {
return this.created;
}
public void setCreated(Calendar created) {
this.created = created;
}
public String getText() {
return this.text;
}
public void setText(String text) {
this.text = text;
}
public String getSummary() {
return this.summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
}
|
[
"rwinch@users.noreply.github.com"
] |
rwinch@users.noreply.github.com
|
f46b2174459cef9d9634c21c898f222a5fd9c104
|
465df43c3c0d90f7c166e842321cd14ce5516c29
|
/src/Ventana.java
|
e1166049a2772725ac7bd859ef3d24227c5d6b79
|
[] |
no_license
|
Sayra/Memorama
|
9b0f315dc5a2363ff9afe3adacf6ee0c904694a8
|
cfb319add2106e74cee0678fa308c9e1a01174f7
|
refs/heads/master
| 2016-09-05T13:08:01.605755
| 2013-03-23T05:38:42
| 2013-03-23T05:38:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 389
|
java
|
import java.awt.event.MouseListener;
import javax.swing.JFrame;
public class Ventana extends JFrame {
public Ventana(){
this.setSize(800,700);
this.setTitle("JUEGO MEMORAMA");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//this.setVisible(true);
this.setLocationRelativeTo(null);
//this.setResizable(false);
}
}
|
[
"Valery@Valery-PC"
] |
Valery@Valery-PC
|
22a229ce24164b9ea8c75d3868ba385c806ebce7
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-12798-141-14-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/resource/servlet/RoutingFilter_ESTest_scaffolding.java
|
3620a061744337bca701aa55e1ebe60c2e5550bb
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 444
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Apr 07 04:13:23 UTC 2020
*/
package org.xwiki.resource.servlet;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class RoutingFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
cb2cab4bf1dca40d72289624b463b2cd3330ae36
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/4/4_a8ea98d3535df31af15994190f16e1c7dbf64be6/JsonToClassConverter/4_a8ea98d3535df31af15994190f16e1c7dbf64be6_JsonToClassConverter_t.java
|
5cd9002f2459068ef395640c0c3e34ebc708f87b
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,665
|
java
|
/**
*Copyright (C) 2012-2013 Wikimedia Foundation
*
*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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.wikimedia.analytics.kraken.schemas;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
/**
* The JsonToClassConverter is a generic class that can load any file that contains a list
* of JSON objects into a {@link HashMap} with the key specified by the caller and the value
* an instance of the JSON object
*/
public class JsonToClassConverter {
/**
* @param className refers to the name of the class that maps to the JSON file. Make sure that
* all properties in the JSON file are defined in the Java class, else it will throw an error
* @param file contains the name of the JSON file to be loaded. The default place to put this
* file is in the src/main/resource folder
* @param key name of the field from the JSON object that should be used as key to store the
* JSON object in the HashMap. Suppose the field containing the key is called 'foo' then the
* java Class should have a getter called getFoo.
* @return
* @throws JsonMappingException
* @throws JsonParseException
*/
public final HashMap<String, Schema> construct(final String className, final String file, final String key)
throws JsonMappingException, JsonParseException {
JsonFactory jfactory = new JsonFactory();
HashMap<String, Schema> map = new HashMap<String, Schema>();
List<Schema> schemas = null;
InputStream input;
JavaType type;
ObjectMapper mapper = new ObjectMapper();
try {
Schema schema = (Schema) Schema.class
.getClassLoader()
.loadClass(className)
.newInstance();
input = schema.getClass().getClassLoader().getResourceAsStream(file);
type = mapper.getTypeFactory().
constructCollectionType(List.class, schema.getClass());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
try {
JsonParser jParser = jfactory.createJsonParser(input);
schemas = mapper.readValue(jParser, type);
} catch (IOException e) {
System.err.println("Specified file could not be found.");
} finally {
try {
if (input != null) {
input.close();
}
} catch (IOException e){
System.err.println("Could not close filestream");
}
}
if (schemas != null){
for (Schema schemaInstance: schemas) {
try {
Method getKey = schemaInstance.getClass().getMethod(key);
map.put(getKey.invoke(schemaInstance).toString(), schemaInstance);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (NoSuchMethodException e) {
System.err.println("Specified key is not a valid Getter for " + className);
}
}
}
return map;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
afb66bce691b9c874b32570f3303c0c9e7ca01ca
|
17e8438486cb3e3073966ca2c14956d3ba9209ea
|
/dso/tags/2.3.0/code/base/dso-l2/src/com/tc/l2/handler/L2ObjectSyncHandler.java
|
e5f0273b2498cf4636ed17de63696efad8ecb6bd
|
[] |
no_license
|
sirinath/Terracotta
|
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
|
00a7662b9cf530dfdb43f2dd821fa559e998c892
|
refs/heads/master
| 2021-01-23T05:41:52.414211
| 2015-07-02T15:21:54
| 2015-07-02T15:21:54
| 38,613,711
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,003
|
java
|
/*
* All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package com.tc.l2.handler;
import com.tc.async.api.AbstractEventHandler;
import com.tc.async.api.ConfigurationContext;
import com.tc.async.api.EventContext;
import com.tc.async.api.Sink;
import com.tc.l2.context.ManagedObjectSyncContext;
import com.tc.l2.context.SyncObjectsRequest;
import com.tc.l2.msg.ObjectSyncMessage;
import com.tc.l2.msg.RelayedCommitTransactionMessage;
import com.tc.l2.msg.ServerTxnAckMessage;
import com.tc.l2.msg.ServerTxnAckMessageFactory;
import com.tc.l2.objectserver.L2ObjectStateManager;
import com.tc.l2.objectserver.ServerTransactionFactory;
import com.tc.net.groups.NodeID;
import com.tc.net.protocol.tcm.ChannelID;
import com.tc.objectserver.api.ObjectManager;
import com.tc.objectserver.core.api.ServerConfigurationContext;
import com.tc.objectserver.tx.ServerTransaction;
import com.tc.objectserver.tx.TransactionBatchReader;
import com.tc.objectserver.tx.TransactionBatchReaderFactory;
import com.tc.objectserver.tx.TransactionalObjectManager;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class L2ObjectSyncHandler extends AbstractEventHandler {
private final L2ObjectStateManager l2ObjectStateMgr;
private ObjectManager objectManager;
private TransactionalObjectManager txnObjectMgr;
private TransactionBatchReaderFactory batchReaderFactory;
private Sink dehydrateSink;
private Sink sendSink;
public L2ObjectSyncHandler(L2ObjectStateManager l2StateManager) {
l2ObjectStateMgr = l2StateManager;
}
public void handleEvent(EventContext context) {
if (context instanceof SyncObjectsRequest) {
SyncObjectsRequest request = (SyncObjectsRequest) context;
doSyncObjectsRequest(request);
} else if (context instanceof ObjectSyncMessage) {
ObjectSyncMessage syncMsg = (ObjectSyncMessage) context;
doSyncObjectsResponse(syncMsg);
} else if (context instanceof RelayedCommitTransactionMessage) {
RelayedCommitTransactionMessage commitMessage = (RelayedCommitTransactionMessage) context;
Set serverTxnIDs = processCommitTransactionMessage(commitMessage);
ackTransactions(commitMessage, serverTxnIDs);
} else {
throw new AssertionError("Unknown context type : " + context.getClass().getName() + " : " + context);
}
}
//TODO:: Implement throttling between active/passive
private void ackTransactions(RelayedCommitTransactionMessage commitMessage, Set serverTxnIDs) {
ServerTxnAckMessage msg = ServerTxnAckMessageFactory.createServerTxnAckMessage(commitMessage, serverTxnIDs);
sendSink.add(msg);
}
// TODO::recycle msg after use
private Set processCommitTransactionMessage(RelayedCommitTransactionMessage commitMessage) {
try {
final TransactionBatchReader reader = batchReaderFactory.newTransactionBatchReader(commitMessage);
ServerTransaction txn;
List txns = new ArrayList(reader.getNumTxns());
Set serverTxnIDs = new HashSet(reader.getNumTxns());
while ((txn = reader.getNextTransaction()) != null) {
txns.add(txn);
serverTxnIDs.add(txn.getServerTransactionID());
}
// TODO:: remove channelID.NULL_ID thingy
txnObjectMgr.addTransactions(ChannelID.NULL_ID, txns, Collections.EMPTY_LIST);
return serverTxnIDs;
} catch (IOException e) {
throw new AssertionError(e);
}
}
private void doSyncObjectsResponse(ObjectSyncMessage syncMsg) {
ArrayList txns = new ArrayList(1);
ServerTransaction txn = ServerTransactionFactory.createTxnFrom(syncMsg);
txns.add(txn);
// TODO:: remove channelID.NULL_ID thingy
txnObjectMgr.addTransactions(ChannelID.NULL_ID, txns, Collections.EMPTY_LIST);
}
// TODO:: Update stats so that admin console reflects these data
private void doSyncObjectsRequest(SyncObjectsRequest request) {
NodeID nodeID = request.getNodeID();
ManagedObjectSyncContext lookupContext = l2ObjectStateMgr.getSomeObjectsToSyncContext(nodeID, 500, dehydrateSink);
// TODO:: Remove ChannelID from ObjectManager interface
if (lookupContext != null) {
objectManager.lookupObjectsAndSubObjectsFor(ChannelID.NULL_ID, lookupContext, -1);
}
}
public void initialize(ConfigurationContext context) {
super.initialize(context);
ServerConfigurationContext oscc = (ServerConfigurationContext) context;
this.batchReaderFactory = oscc.getTransactionBatchReaderFactory();
this.objectManager = oscc.getObjectManager();
this.txnObjectMgr = oscc.getTransactionalObjectManager();
this.dehydrateSink = oscc.getStage(ServerConfigurationContext.OBJECTS_SYNC_DEHYDRATE_STAGE).getSink();
this.sendSink = oscc.getStage(ServerConfigurationContext.OBJECTS_SYNC_SEND_STAGE).getSink();
}
}
|
[
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] |
jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864
|
af7829f2c7bee56d092f2c781b17a73cc3776ad8
|
ac94ac4e2dca6cbb698043cef6759e328c2fe620
|
/providers/glesys/src/main/java/org/jclouds/glesys/functions/ParseTemplatesFromHttpResponse.java
|
60738f3eb1485102d2fc81adf9a5d07b1fd1929a
|
[
"Apache-2.0"
] |
permissive
|
andreisavu/jclouds
|
25c528426c8144d330b07f4b646aa3b47d0b3d17
|
34d9d05eca1ed9ea86a6977c132665d092835364
|
refs/heads/master
| 2021-01-21T00:04:41.914525
| 2012-11-13T18:11:04
| 2012-11-13T18:11:04
| 2,503,585
| 2
| 0
| null | 2012-10-16T21:03:12
| 2011-10-03T09:11:27
|
Java
|
UTF-8
|
Java
| false
| false
| 2,209
|
java
|
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.glesys.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import java.util.Set;
import javax.inject.Singleton;
import org.jclouds.glesys.domain.OSTemplate;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseFirstJsonValueNamed;
import org.jclouds.json.internal.GsonWrapper;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.TypeLiteral;
/**
* @author Adrian Cole
*/
@Singleton
public class ParseTemplatesFromHttpResponse implements Function<HttpResponse, FluentIterable<OSTemplate>> {
private final ParseFirstJsonValueNamed<Map<String, Set<OSTemplate>>> parser;
@Inject
public ParseTemplatesFromHttpResponse(GsonWrapper gsonView) {
this.parser = new ParseFirstJsonValueNamed<Map<String, Set<OSTemplate>>>(checkNotNull(gsonView,
"gsonView"), new TypeLiteral<Map<String, Set<OSTemplate>>>() {
}, "templates");
}
public FluentIterable<OSTemplate> apply(HttpResponse response) {
checkNotNull(response, "response");
Map<String, Set<OSTemplate>> toParse = parser.apply(response);
checkNotNull(toParse, "parsed result from %s", response);
return FluentIterable.from(Iterables.concat(toParse.values()));
}
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
632e0e9a3c4c8fca672690f307489aaeaf81cf41
|
95a2919168d94bbe8a104bb74ac53b8fe5bc74c1
|
/org.xtext.example.mydsl1.ui/src/org/xtext/example/mydsl1/ui/outline/MyDslOutlineTreeProvider.java
|
0831e5a13bd8f3e198659077e24d9fbcab1ae6f3
|
[] |
no_license
|
TAndrian/xtext-dsl-compiler-example
|
168a3ad72c1808e8652ba10a6bd01c0e296391ef
|
5e3264d1d878a1193161e85e7dd674c18d8f04d1
|
refs/heads/main
| 2023-01-06T10:55:54.663023
| 2020-11-03T14:53:26
| 2020-11-03T14:53:26
| 437,822,457
| 1
| 0
| null | 2021-12-13T10:05:46
| 2021-12-13T10:05:46
| null |
UTF-8
|
Java
| false
| false
| 383
|
java
|
/*
* generated by Xtext 2.21.0
*/
package org.xtext.example.mydsl1.ui.outline;
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
/**
* Customization of the default outline structure.
*
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline
*/
public class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider {
}
|
[
"mathieu.acher@irisa.fr"
] |
mathieu.acher@irisa.fr
|
ef1ad83317ec67ef75389de9fad9de142e0c88c0
|
6baf1fe00541560788e78de5244ae17a7a2b375a
|
/hollywood/com.oculus.systemux-SystemUX/sources/com/oculus/panelapp/androiddialog/databinding/FilePreviewerDialogBinding.java
|
4d6f856d8fd22aa5ccd18e3718f15c3c70c4d720
|
[] |
no_license
|
phwd/quest-tracker
|
286e605644fc05f00f4904e51f73d77444a78003
|
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
|
refs/heads/main
| 2023-03-29T20:33:10.959529
| 2021-04-10T22:14:11
| 2021-04-10T22:14:11
| 357,185,040
| 4
| 2
| null | 2021-04-12T12:28:09
| 2021-04-12T12:28:08
| null |
UTF-8
|
Java
| false
| false
| 3,097
|
java
|
package com.oculus.panelapp.androiddialog.databinding;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.Bindable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.oculus.panelapp.androiddialog.R;
import com.oculus.panelapp.androiddialog.dialogs.filepreviewer.FilePreviewerDialog;
import com.oculus.panelapp.androiddialog.dialogs.filepreviewer.FilePreviewerViewModel;
public abstract class FilePreviewerDialogBinding extends ViewDataBinding {
@NonNull
public final FilePreviewerDialog filePreviewerDialog;
@Bindable
protected FilePreviewerViewModel mViewModel;
@NonNull
public final FilePreviewerPreviewBinding previewLayout;
@NonNull
public final FilePreviewerToolbarBinding previewToolbar;
public abstract void setViewModel(@Nullable FilePreviewerViewModel filePreviewerViewModel);
protected FilePreviewerDialogBinding(Object obj, View view, int i, FilePreviewerDialog filePreviewerDialog2, FilePreviewerPreviewBinding filePreviewerPreviewBinding, FilePreviewerToolbarBinding filePreviewerToolbarBinding) {
super(obj, view, i);
this.filePreviewerDialog = filePreviewerDialog2;
this.previewLayout = filePreviewerPreviewBinding;
setContainedBinding(this.previewLayout);
this.previewToolbar = filePreviewerToolbarBinding;
setContainedBinding(this.previewToolbar);
}
@Nullable
public FilePreviewerViewModel getViewModel() {
return this.mViewModel;
}
@NonNull
public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, boolean z) {
return inflate(layoutInflater, viewGroup, z, DataBindingUtil.getDefaultComponent());
}
@NonNull
@Deprecated
public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, boolean z, @Nullable Object obj) {
return (FilePreviewerDialogBinding) ViewDataBinding.inflateInternal(layoutInflater, R.layout.file_previewer_dialog, viewGroup, z, obj);
}
@NonNull
public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater) {
return inflate(layoutInflater, DataBindingUtil.getDefaultComponent());
}
@NonNull
@Deprecated
public static FilePreviewerDialogBinding inflate(@NonNull LayoutInflater layoutInflater, @Nullable Object obj) {
return (FilePreviewerDialogBinding) ViewDataBinding.inflateInternal(layoutInflater, R.layout.file_previewer_dialog, null, false, obj);
}
public static FilePreviewerDialogBinding bind(@NonNull View view) {
return bind(view, DataBindingUtil.getDefaultComponent());
}
@Deprecated
public static FilePreviewerDialogBinding bind(@NonNull View view, @Nullable Object obj) {
return (FilePreviewerDialogBinding) bind(obj, view, R.layout.file_previewer_dialog);
}
}
|
[
"cyuubiapps@gmail.com"
] |
cyuubiapps@gmail.com
|
bab8fdc56e0a8ffb18f5b1631d56b0ebcfd98037
|
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
|
/bin/platform/ext/processing/testsrc/de/hybris/platform/task/impl/TaskScriptingIntegrationTest.java
|
116b44424f2a5076f3737c01916ba9fc294599fc
|
[] |
no_license
|
jp-developer0/hybrisTrail
|
82165c5b91352332a3d471b3414faee47bdb6cee
|
a0208ffee7fee5b7f83dd982e372276492ae83d4
|
refs/heads/master
| 2020-12-03T19:53:58.652431
| 2020-01-02T18:02:34
| 2020-01-02T18:02:34
| 231,430,332
| 0
| 4
| null | 2020-08-05T22:46:23
| 2020-01-02T17:39:15
| null |
UTF-8
|
Java
| false
| false
| 4,679
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.task.impl;
import static org.fest.assertions.Assertions.assertThat;
import de.hybris.bootstrap.annotations.IntegrationTest;
import de.hybris.platform.servicelayer.ServicelayerBaseTest;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.servicelayer.user.daos.TitleDao;
import de.hybris.platform.task.TaskConditionModel;
import de.hybris.platform.task.TaskService;
import de.hybris.platform.task.model.ScriptingTaskModel;
import de.hybris.platform.task.utils.NeedsTaskEngine;
import de.hybris.platform.testframework.TestUtils;
import de.hybris.platform.util.Config;
import java.util.Collections;
import javax.annotation.Resource;
import org.junit.Before;
import org.junit.Test;
/**
* Integration tests for task scripting
*/
@IntegrationTest
@NeedsTaskEngine
public class TaskScriptingIntegrationTest extends ServicelayerBaseTest
{
@Resource
private TaskService taskService;
@Resource
private ModelService modelService;
@Resource
TitleDao titleDao;
ScriptingTaskModel scriptingTaskForExistingScript;
ScriptingTaskModel scriptingTaskForNotExistingScript;
ScriptingTaskModel scriptingTaskForBadScript;
private static final String CORRECT_TITLE = "CorrectGroovyTitle";
private static final String ERROR_TITLE = "ErrorGroovyTitle";
final double timeFactor = Math.max(15.0, Config.getDouble("platform.test.timefactor", 15.0));
@Before
public void setUp() throws Exception
{
scriptingTaskForExistingScript = modelService.create(ScriptingTaskModel.class);
scriptingTaskForExistingScript.setScriptURI("classpath://task/test/test-script-correct-task-interface.groovy");
scriptingTaskForNotExistingScript = modelService.create(ScriptingTaskModel.class);
scriptingTaskForNotExistingScript.setScriptURI("model://myGroovyScriptDoesNotExist");
scriptingTaskForBadScript = modelService.create(ScriptingTaskModel.class);
scriptingTaskForBadScript.setScriptURI("classpath://task/test/test-script-error-task-interface.groovy");
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull();
assertThat(taskService.getEngine().isRunning()).isTrue();
}
@Test
public void testRunTaskForCorrectScript() throws Exception
{
taskService.scheduleTask(scriptingTaskForExistingScript);
Thread.sleep((long) (1000 * timeFactor));
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNotNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull();
}
@Test
public void testRunTaskForCorrectScriptEventBased() throws Exception
{
final TaskConditionModel condition = modelService.create(TaskConditionModel.class);
condition.setUniqueID("MyEvent");
scriptingTaskForExistingScript.setConditions(Collections.singleton(condition));
taskService.scheduleTask(scriptingTaskForExistingScript);
Thread.sleep((long) (1000 * timeFactor));
// not triggered yet - nothing happens
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull();
taskService.triggerEvent("MyEvent");
Thread.sleep((long) (1000 * timeFactor));
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNotNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull();
}
@Test
public void testRunTaskForNonExistingScript() throws Exception
{
taskService.scheduleTask(scriptingTaskForNotExistingScript);
Thread.sleep((long) (1000 * timeFactor));
// during script lookup - ScripNotFoundException is thrown but the task execution logic swallows it
// This way the Exception is not visible inside the taskRunner (only error logs)
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNull();
}
@Test
public void testRunTaskScriptThrowingException() throws Exception
{
TestUtils.disableFileAnalyzer(
"de.hybris.platform.task.impl.TaskScriptingIntegrationTest.testRunTaskScriptThrowingException()");
try
{
taskService.scheduleTask(scriptingTaskForBadScript);
Thread.sleep((long) (1000 * timeFactor));
assertThat(titleDao.findTitleByCode(CORRECT_TITLE)).isNull();
assertThat(titleDao.findTitleByCode(ERROR_TITLE)).isNotNull();
}
finally
{
TestUtils.enableFileAnalyzer();
}
}
}
|
[
"juan.gonzalez.working@gmail.com"
] |
juan.gonzalez.working@gmail.com
|
30cc1c96beeed392756e4d41b477285fe50e11e8
|
7c8fc99147afff7c20a04cfee561eebfcd90c3de
|
/BarChartDemo/src/main/java/skinsenor/jcgf/com/barchartdemo/wy/Main2Activity.java
|
511a799e9dd060cdeff4b249baf27c08a18f1eec
|
[] |
no_license
|
jsondroid/LoadLayoutDemo
|
3556601c3298106453d2ae98781bae79522b2da5
|
1b40ec3d02f1c45ce6bf0e6ddb27917c1b87db06
|
refs/heads/master
| 2021-05-06T03:43:17.582709
| 2017-12-20T10:24:40
| 2017-12-20T10:24:40
| 114,873,998
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,238
|
java
|
package skinsenor.jcgf.com.barchartdemo.wy;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.github.mikephil.charting.charts.LineChart;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import skinsenor.jcgf.com.barchartdemo.R;
public class Main2Activity extends AppCompatActivity {
RealtimeChartConfig realtimeChartConfig;
private LineChart mChart;
private ImageView imageview;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
mChart= (LineChart) findViewById(R.id.linechart);
imageview= (ImageView) findViewById(R.id.imageview);
realtimeChartConfig=new RealtimeChartConfig(this,mChart);
realtimeChartConfig.initlineChart();
}
private float x=0.1f;
public void addEntry(View view){
// realtimeChartConfig.addEntry(x,(float) ((Math.random() * 40) + 30f));
// x=x+0.1f;
imageview.setImageBitmap(getStorePic("id","img"));
}
public void clearValues(View view){
// mChart.clearValues();
// imageview.setImageBitmap(mChart.getChartBitmap());
storePic("id","img",mChart.getChartBitmap());
Toast.makeText(this, "Chart cleared!", Toast.LENGTH_SHORT).show();
}
public void feedMultiple(View view){
feedMultiple();
}
private Thread thread;
private boolean b=false;
private void feedMultiple() {
if (thread != null)
thread.interrupt();
final Runnable runnable = new Runnable() {
@Override
public void run() {
float y=0;
if(b){
y= (float) ((Math.random() * 40) + 30f);
b=false;
}else{
y= -(float) ((Math.random() * 40) + 30f);
b=true;
}
realtimeChartConfig.addEntry(0,y);
}
};
thread = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 1000; i++) {
// Don't generate garbage runnables inside the loop.
runOnUiThread(runnable);
try {
Thread.sleep(25);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
});
thread.start();
}
public void storePic(String tabid, String key, Bitmap bitmap) {
if(tabid == null || key == null || tabid.isEmpty() || key.isEmpty() || bitmap == null) {
return;
}
FileOutputStream fos = null;
try {
fos = this.openFileOutput(tabid + "_" + key, Context.MODE_PRIVATE);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
} catch (FileNotFoundException e) {
Log.e("storePic", "storePic FileNotFoundException e = " +e);
} finally {
if(fos != null) {
try {
fos.flush();
fos.close();
} catch (IOException e) {
Log.e("storePic", "storePic IOException e = " +e);
}
}
}
}
public Bitmap getStorePic(String tabid, String key) {
if(tabid == null || key == null || tabid.isEmpty() || key.isEmpty()) {
return null;
}
FileInputStream fin = null;
Bitmap bitmap = null;
try {
fin = openFileInput(tabid + "_" + key);
bitmap = BitmapFactory.decodeStream(fin);
} catch (FileNotFoundException e) {
Log.e("storePic", "getStorePic FileNotFoundException e = " + e);
}
return bitmap;
}
}
|
[
"you@example.com"
] |
you@example.com
|
a3f2a1f375f0417155ded4ea8eb56f05c4bec8a5
|
799c885dfac9d6801bc25954e0fa029c72dd0f36
|
/src/chap06/excercise/PrinterEx.java
|
1ed902144df90441846ec138ca4575b4791f56eb
|
[] |
no_license
|
dmswldi/20200929java
|
30dbe41a1321d4930a09b020e202d3111bf668aa
|
7166ac75faa8c5cd76a6052362054abc517e73b5
|
refs/heads/master
| 2023-01-23T08:25:04.734223
| 2020-12-03T10:58:56
| 2020-12-03T10:58:56
| 299,485,614
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 277
|
java
|
package chap06.excercise;
public class PrinterEx {
// 16, 17
public static void main(String[] args) { // main 까먹지마
// Printer printer = new Printer();
Printer.println(10);
Printer.println(true);
Printer.println(5.7);
Printer.println("홍길동");
}
}
|
[
"eeeunzz20@gmail.com"
] |
eeeunzz20@gmail.com
|
f8763897b9cbaa0ba771e61338a3fd989008c0d8
|
83dbd433aeed1f15f6501f39fe152abc0dc803d9
|
/imooc_study/imooc_seckill/src/main/java/com/bd/imooc/seckill/access/AccessLimit.java
|
c1add98103db40f82a5381bbb6d467c09a90bbac
|
[] |
no_license
|
pylrichard/web_service_study
|
d0d42ea0c511b9b15a235a99cde5b4b025c33c6d
|
c1bd8753c6aee69c87707db7f3fb8e0d7f5ddbc0
|
refs/heads/master
| 2021-09-14T23:31:12.454640
| 2018-05-22T06:26:14
| 2018-05-22T06:26:14
| 104,879,563
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 379
|
java
|
package com.bd.imooc.seckill.access;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target(METHOD)
public @interface AccessLimit {
int seconds();
int maxCount();
boolean needLogin() default true;
}
|
[
"pylrichard@qq.com"
] |
pylrichard@qq.com
|
5a92ccbab27b9aa4f7d991c88919cd5b9bb04ebe
|
61c6164c22142c4369d525a0997b695875865e29
|
/SpiritTools/src/main/java/ImportarBasicosYdatClientes/automateImportTxtMySQL.java
|
6a5bc5be9aa03ac63c0c1cc97c563569f45b1aa2
|
[] |
no_license
|
xruiz81/spirit-creacional
|
e5a6398df65ac8afa42be65886b283007d190eae
|
382ee7b1a6f63924b8eb895d4781576627dbb3e5
|
refs/heads/master
| 2016-09-05T14:19:24.440871
| 2014-11-10T17:12:34
| 2014-11-10T17:12:34
| 26,328,756
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,998
|
java
|
package ImportarBasicosYdatClientes;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
public class automateImportTxtMySQL
{
public static void main(String[] args)
{
DBase db =
new DBase();
Connection conn = db.connect(
"jdbc:mysql://localhost:3306/SPIRIT_UMA","root","master");
//"jdbc:mysql://192.168.100.9:3306/SPIRIT_UMA","desarrollo","desarrollo");
//******************LINUX***********************//
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/oficina.txt","OFICINA",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/departamento.txt","DEPARTAMENTO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_empleado.txt","TIPO_EMPLEADO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_contrato.txt","TIPO_CONTRATO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/empleado.txt","EMPLEADO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/linea.txt","LINEA",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cuenta_bancaria.txt","CUENTA_BANCARIA",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_proveedor.txt","TIPO_PROVEEDOR",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_negocio.txt","TIPO_NEGOCIO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/corporacion.txt","CORPORACION",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cliente.txt","CLIENTE",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cliente_oficina.txt","CLIENTE_OFICINA",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_cuenta.txt","TIPO_CUENTA",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_resultado.txt","TIPO_RESULTADO",false);
//db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/cuenta.txt","CUENTA",false);
// db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/familia_generico.txt","FAMILIA_GENERICO",false);
// db.importData(conn,"/tmp/datosbase/archivosACME_EMCATXT/tipo_producto.txt","TIPO_PRODUCTO",false);
//db.importData(conn,"/usr/java/ejemploImportacionEmpresa.txt","EMPRESA",false);
//******************WINDOWS***********************//
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//oficina.txt","OFICINA",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//departamento.txt","DEPARTAMENTO",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_empleado.txt","TIPO_EMPLEADO",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_contrato.txt","TIPO_CONTRATO",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//empleado.txt","EMPLEADO",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//linea.txt","LINEA",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cuenta_bancaria.txt","CUENTA_BANCARIA",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_proveedor.txt","TIPO_PROVEEDOR",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//tipo_negocio.txt","TIPO_NEGOCIO",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//corporacion.txt","CORPORACION",false);
//db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cliente.txt","CLIENTE",false);
// db.importData(conn,"C://Documents and Settings//Winxp//Escritorio//Axis//cliente_oficina.txt","CLIENTE_OFICINA",false);
db.importData(conn,"C://SQL_UMA//cuentas3.txt","CUENTA",false);
}
}
class DBase
{
public DBase()
{
}
public Connection connect(String db_connect_str,
String db_userid, String db_password)
{
Connection conn;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(db_connect_str,db_userid, db_password);
}
catch(Exception e)
{
e.printStackTrace();
conn = null;
}
return conn;
}
public void importData(Connection conn,String filename,String tableName,boolean validar)
{
Statement stmt;
String query;
try
{
if(tableName.equals("CLIENTE"))
{
String[] args=null;
ImportarClientes.main(args);
}
if(!validar){
stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
query = "LOAD DATA INFILE '"+filename+
//empresa
//"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,RUC,EMAIL_CONTADOR,RUC_CONTADOR);";
//oficina
// "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID,CIUDAD_ID,DIRECCION,TELEFONO,FAX,PREIMPRESO_SERIE);";
//departamento
// "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);";
//tipo_empleado:
// "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,VENDEDOR,EMPRESA_ID);";
//tipo_contrato
// "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);";
//empleado
/*
"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRES,APELLIDOS,TIPOIDENTIFICACION_ID ,IDENTIFICACION ,EMPRESA_ID ,PROFESION" +
" ,DIRECCION_DOMICILIO ,TELEFONO_DOMICILIO ,CELULAR ,EMAIL_OFICINA,DEPARTAMENTO_ID,JEFE_ID,TIPOEMPLEADO_ID ," +
"EXTENSION_OFICINA,NIVEL,ESTADO,OFICINA_ID,TIPOCONTRATO_ID );";*/
//linea
// "' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID,NIVEL,ACEPTAITEM);";
//cuenta_bancaria//
//"' INTO TABLE "+tableName+";";
//tipo_proveedor//
//"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,TIPO,EMPRESA_ID);";
//tipo_negocio
//"' INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,NOMBRE,EMPRESA_ID);";
//corporacion//
//"' INTO TABLE "+tableName+";";
//cliente//
/*
"'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,TIPOIDENTIFICACION_ID,IDENTIFICACION,NOMBRE_LEGAL,RAZON_SOCIAL," +
"REPRESENTANTE,CORPORACION_ID,FECHA_CREACION,ESTADO,TIPOCLIENTE_ID,TIPOPROVEEDOR_ID," +
"TIPONEGOCIO_ID,OBSERVACION,USUARIOFINAL,CONTRIBUYENTE_ESPECIAL,TIPO_PERSONA,LLEVA_CONTABILIDAD);";
*/
//cliente_oficina//
/*"'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,CODIGO,CLIENTE_ID,CIUDAD_ID,DIRECCION," +
"TELEFONO,FAX,EMAIL,FECHA_CREACION,MONTO_CREDITO,MONTO_GARANTIA,CALIFICACION," +
"OBSERVACION,ESTADO,DESCRIPCION);";*/
//CUENTA//
"'INTO TABLE "+tableName+" CHARACTER SET latin1 (ID,PLANCUENTA_ID,CODIGO,NOMBRE,NOMBRE_CORTO,TIPOCUENTA_ID," +
"PADRE_ID,RELACIONADA,IMPUTABLE,NIVEL,TIPORESULTADO_ID,EFECTIVO,ACTIVOFIJO,DEPARTAMENTO,LINEA," +
"EMPLEADO,CENTROGASTO,CLIENTE,GASTO,ESTADO,CUENTA_BANCO);";
//FAMILIA GENERICO, TIPO PRODUCTO,
/*"' INTO TABLE "+tableName+";";*/
stmt.executeUpdate(query);
}
}
catch(Exception e)
{
e.printStackTrace();
stmt = null;
}
}
};
|
[
"xruiz@creacional.com"
] |
xruiz@creacional.com
|
99f4dfda996b92fa696bf291a49545d45128c2d5
|
b4e306eaa86db3aa11132433ee6ad7fa6464db7b
|
/project-test/src14/main/java/bitcamp/java106/pms/controller/BoardController.java
|
268720642db9641ac1712b97a28861d24d81225e
|
[] |
no_license
|
donhee/test
|
b00279dde77ff5e7482e7a018efe91ff54d4f677
|
897f301a557325932afc0e4cd19e33f103d74dae
|
refs/heads/master
| 2021-07-01T00:13:06.085468
| 2020-09-10T13:26:18
| 2020-09-10T13:26:18
| 154,077,010
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,214
|
java
|
package bitcamp.java106.pms.controller;
import java.sql.Date;
import java.util.Scanner;
import bitcamp.java106.pms.dao.BoardDao;
import bitcamp.java106.pms.domain.Board;
import bitcamp.java106.pms.util.Console;
public class BoardController {
// 이 클래스를 사용하기 전에 App 클래스에서 준비한 Scanner 객체를
// keyScan 변수에 저장하라!
Scanner keyScan;
BoardDao boardDao = new BoardDao();
public BoardController(Scanner scanner) {
this.keyScan = scanner;
}
public void service(String menu, String option) {
if (menu.equals("board/add")) {
this.onBoardAdd();
} else if (menu.equals("board/list")) {
this.onBoardList();
} else if (menu.equals("board/view")) {
this.onBoardView(option);
} else if (menu.equals("board/update")) {
this.onBoardUpdate(option);
} else if (menu.equals("board/delete")) {
this.onBoardDelete(option);
} else {
System.out.println("명령어가 올바르지 않습니다.");
}
}
void onBoardAdd() {
System.out.println("[게시물 입력]");
Board board = new Board();
System.out.print("제목? ");
board.title = keyScan.nextLine();
System.out.print("내용? ");
board.content = keyScan.nextLine();
System.out.print("등록일? ");
board.createDate = Date.valueOf(keyScan.nextLine());
boardDao.insert(board);
}
void onBoardList() {
System.out.println("[게시물 목록]");
Board[] list = boardDao.list();
for (int i = 0; i < list.length; i++) {
if (list[i] == null) continue;
System.out.printf("%d, %s, %s\n",
i, list[i].title, list[i].createDate);
}
}
void onBoardView(String option) {
System.out.println("[게시물 조회]");
if (option == null) {
System.out.println("번호를 입력하시기 바랍니다.");
return;
}
Board board = boardDao.get(Integer.parseInt(option));
if (board == null) {
System.out.println("해당 게시물 번호가 없습니다.");
} else {
System.out.printf("제목: %s\n", board.title);
System.out.printf("내용: %s\n", board.content);
System.out.printf("시작일: %s\n", board.createDate);
}
}
void onBoardUpdate(String option) {
System.out.println("[게시물 변경]");
if (option == null) {
System.out.println("번호를 입력하시기 바랍니다.");
return;
}
Board board = boardDao.get(Integer.parseInt(option));
// Board board = boards[1];
if (board == null) {
System.out.println("해당 게시물 번호가 없습니다.");
} else {
Board updateBoard = new Board();
System.out.printf("제목(%s)? ", board.title);
updateBoard.title = keyScan.nextLine();
System.out.printf("내용(%s)? ", board.content);
updateBoard.content = keyScan.nextLine();
System.out.printf("시작일(%s)? ", board.createDate);
updateBoard.createDate = Date.valueOf(keyScan.nextLine());
updateBoard.no = board.no;
boardDao.update(updateBoard);
System.out.println("변경하였습니다.");
}
}
void onBoardDelete(String option) {
System.out.println("[게시물 삭제]");
if (option == null) {
System.out.println("번호를 입력하시기 바랍니다.");
return;
}
int i = Integer.parseInt(option);
Board board = boardDao.get(i);
if (board == null) {
System.out.println("해당 게시물이 없습니다.");
} else {
if (Console.confirm("정말 삭제하시겠습니까?")) {
boardDao.delete(i);
System.out.println("삭제하였습니다.");
}
}
}
}
|
[
"231313do@gmail.com"
] |
231313do@gmail.com
|
77fa2809b399f40aaeff35dbed3258db3cafb530
|
612b1b7f5201f3ff1a550b09c96218053e195519
|
/modules/global/src/com/haulmont/cuba/core/sys/jpql/QueryBuilder.java
|
ae6ace5aca9de5cd6e9ca7071a3facd773d4d0ef
|
[
"Apache-2.0"
] |
permissive
|
cuba-platform/cuba
|
ffb83fe0b089056e8da11d96a40c596d8871d832
|
36e0c73d4e3b06f700173c4bc49c113838c1690b
|
refs/heads/master
| 2023-06-24T02:03:12.525885
| 2023-06-19T14:13:06
| 2023-06-19T14:13:06
| 54,624,511
| 1,434
| 303
|
Apache-2.0
| 2023-08-31T18:57:38
| 2016-03-24T07:55:56
|
Java
|
UTF-8
|
Java
| false
| false
| 1,573
|
java
|
/*
* Copyright (c) 2008-2016 Haulmont.
*
* 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.haulmont.cuba.core.sys.jpql;
public class QueryBuilder {
private StringBuilder sb = new StringBuilder();
public void appendSpace() {
if (sb.length() != 0 && sb.charAt(sb.length() - 1) != ' ')
sb.append(' ');
}
public void appendChar(char c) {
if (sb.length() != 0 && getLast() == ' ' && (c == ' ' || c == ')' || c == ',')) {
deleteLast();
}
sb.append(c);
}
public void appendString(String s) {
if (s != null) {
if (sb.length() != 0 && getLast() == ' ' && (s.charAt(0) == ' ' || s.charAt(0) == ')' || s.charAt(0) == ',')) {
deleteLast();
}
sb.append(s);
}
}
public char getLast() {
return sb.charAt(sb.length() - 1);
}
public void deleteLast() {
sb.deleteCharAt(sb.length() - 1);
}
@Override
public String toString() {
return sb.toString();
}
}
|
[
"artamonov@haulmont.com"
] |
artamonov@haulmont.com
|
3fc79477a61067b5bf3f2397a800aacc37a00d11
|
75950d61f2e7517f3fe4c32f0109b203d41466bf
|
/modules/tags/fabric3-modules-parent-pom-1.9.5/kernel/api/fabric3-spi/src/main/java/org/fabric3/spi/security/BasicSecuritySubject.java
|
3c4abd946a859d4b77ff65465d32ec9a3f280244
|
[] |
no_license
|
codehaus/fabric3
|
3677d558dca066fb58845db5b0ad73d951acf880
|
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
|
refs/heads/master
| 2023-07-20T00:34:33.992727
| 2012-10-31T16:32:19
| 2012-10-31T16:32:19
| 36,338,853
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,430
|
java
|
/*
* Fabric3
* Copyright (c) 2009-2012 Metaform Systems
*
* Fabric3 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, with the
* following exception:
*
* Linking this software statically or dynamically with other
* modules is making a combined work based on this software.
* Thus, the terms and conditions of the GNU General Public
* License cover the whole combination.
*
* As a special exception, the copyright holders of this software
* give you permission to link this software with independent
* modules to produce an executable, regardless of the license
* terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided
* that you also meet, for each linked independent module, the
* terms and conditions of the license of that module. An
* independent module is a module which is not derived from or
* based on this software. If you modify this software, you may
* extend this exception to your version of the software, but
* you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* Fabric3 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 Fabric3.
* If not, see <http://www.gnu.org/licenses/>.
*/
package org.fabric3.spi.security;
import java.security.Principal;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.security.auth.Subject;
import org.fabric3.api.Role;
import org.fabric3.api.SecuritySubject;
/**
* SecuritySubject for the Fabric3 basic security implementation.
*
* @version $Rev$ $Date$
*/
public class BasicSecuritySubject implements SecuritySubject, Principal {
private String username;
private String password;
private Set<Role> roles;
private Subject jaasSubject;
public BasicSecuritySubject(String username, String password, Set<Role> roles) {
this.username = username;
this.password = password;
this.roles = roles;
Set<Principal> principals = new HashSet<Principal>(roles);
principals.add(this);
jaasSubject = new Subject(true, principals, Collections.emptySet(), Collections.emptySet());
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public Set<Role> getRoles() {
return roles;
}
@SuppressWarnings({"SuspiciousMethodCalls"})
public boolean hasRole(String name) {
return roles.contains(new Role(name));
}
public <T> T getDelegate(Class<T> type) {
if (!BasicSecuritySubject.class.equals(type)) {
throw new IllegalArgumentException("Unknown delegate type: " + type);
}
return type.cast(this);
}
public Subject getJaasSubject() {
return jaasSubject;
}
public String getName() {
return username;
}
@Override
public String toString() {
return username;
}
}
|
[
"jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf"
] |
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
|
d21cd863e6c143d9ea6d5b1eeeb353866a2d6c6c
|
1d3d1b54f6ba9c61f18ccfc4ce79e06de0381f48
|
/src/examples/page2/Converter.java
|
cc30a381dde620440edbacea893ec3ede208a5fa
|
[] |
no_license
|
Vygovsky/MyTask
|
3add2d219011d209037f6d0465a98db5d45cafff
|
c5955b7036435023bcf5858a5fce25651d22aa63
|
refs/heads/master
| 2021-01-23T09:47:05.670878
| 2018-08-20T13:17:15
| 2018-08-20T13:17:15
| 102,602,006
| 0
| 0
| null | 2018-05-08T10:00:16
| 2017-09-06T11:46:19
|
Java
|
UTF-8
|
Java
| false
| false
| 139
|
java
|
package examples.page2;
/**
* Created by Roman_v on 11.09.2017.
*/
@FunctionalInterface
interface Converter<F, T> {
T con(F from);
}
|
[
"vigmol@ukr.net"
] |
vigmol@ukr.net
|
ef797ca50acae0eaa8dbae5c340f54eb20840d6d
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/elastic--elasticsearch/4ab268bab2cfd7fc3cb4c4808f706d5049c1fae5/after/RestPutRepositoryAction.java
|
c3dfcd9a97069e9cd8c1667cf97916194e7c3b69
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,592
|
java
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.rest.action.admin.cluster.repositories.put;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.action.support.AcknowledgedRestListener;
import static org.elasticsearch.client.Requests.putRepositoryRequest;
import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT;
/**
* Registers repositories
*/
public class RestPutRepositoryAction extends BaseRestHandler {
@Inject
public RestPutRepositoryAction(Settings settings, RestController controller, Client client) {
super(settings, controller, client);
controller.registerHandler(PUT, "/_snapshot/{repository}", this);
controller.registerHandler(POST, "/_snapshot/{repository}", this);
}
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
PutRepositoryRequest putRepositoryRequest = putRepositoryRequest(request.param("repository"));
putRepositoryRequest.listenerThreaded(false);
putRepositoryRequest.source(request.content().toUtf8());
putRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRepositoryRequest.masterNodeTimeout()));
putRepositoryRequest.timeout(request.paramAsTime("timeout", putRepositoryRequest.timeout()));
client.admin().cluster().putRepository(putRepositoryRequest, new AcknowledgedRestListener<PutRepositoryResponse>(channel));
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
a62c6a1a22e5310ae791747964fceea38ae385d5
|
6253283b67c01a0d7395e38aeeea65e06f62504b
|
/decompile/app/Settings/src/main/java/com/android/settings/AppListPreferenceWithSettings.java
|
41f54b98ca36a63d1817149fd7096632f424bae8
|
[] |
no_license
|
sufadi/decompile-hw
|
2e0457a0a7ade103908a6a41757923a791248215
|
4c3efd95f3e997b44dd4ceec506de6164192eca3
|
refs/heads/master
| 2023-03-15T15:56:03.968086
| 2017-11-08T03:29:10
| 2017-11-08T03:29:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,693
|
java
|
package com.android.settings;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.support.v7.preference.PreferenceViewHolder;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
public class AppListPreferenceWithSettings extends AppListPreference {
private ComponentName mSettingsComponent;
private View mSettingsIcon;
public AppListPreferenceWithSettings(Context context, AttributeSet attrs) {
super(context, attrs);
setLayoutResource(2130968977);
setWidgetLayoutResource(2130968998);
}
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
this.mSettingsIcon = view.findViewById(2131886968);
((ViewGroup) this.mSettingsIcon.getParent()).setPaddingRelative(0, 0, 0, 0);
updateSettingsVisibility();
}
private void updateSettingsVisibility() {
if (!(this.mSettingsIcon == null || this.mSettingsComponent == null)) {
this.mSettingsIcon.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(AppListPreferenceWithSettings.this.mSettingsComponent);
AppListPreferenceWithSettings.this.getContext().startActivity(new Intent(intent));
}
});
}
}
protected void setSettingsComponent(ComponentName settings) {
this.mSettingsComponent = settings;
updateSettingsVisibility();
}
}
|
[
"liming@droi.com"
] |
liming@droi.com
|
490bcdb0ebeea9e75745f5e9bb98d72a26a713a2
|
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
|
/tags/2007-06-29/seasar2-2.4.14/s2-framework/src/main/java/org/seasar/framework/convention/impl/PersistenceConventionImpl.java
|
deb2cfd8839ecf6009c31f1393c9dd55931d0c78
|
[
"Apache-2.0"
] |
permissive
|
svn2github/s2container
|
54ca27cf0c1200a93e1cb88884eb8226a9be677d
|
625adc6c4e1396654a7297d00ec206c077a78696
|
refs/heads/master
| 2020-06-04T17:15:02.140847
| 2013-08-09T09:38:15
| 2013-08-09T09:38:15
| 10,850,644
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,414
|
java
|
/*
* Copyright 2004-2007 the Seasar Foundation and the Others.
*
* 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.seasar.framework.convention.impl;
import org.seasar.framework.convention.PersistenceConvention;
import org.seasar.framework.util.AssertionUtil;
import org.seasar.framework.util.StringUtil;
/**
* {@link PersistenceConvention}の実装クラスです。
*
* @author higa
*
*/
public class PersistenceConventionImpl implements PersistenceConvention {
private String ignoreTablePrefix;
private boolean noNameConversion = false;
/**
* 無視するテーブルの<code>prefix</code>を返します。
*
* @return 無視するテーブルの<code>prefix</code>
*/
public String getIgnoreTablePrefix() {
return ignoreTablePrefix;
}
/**
* 無視するテーブルの<code>prefix</code>を設定します。
*
* @param ignoreTablePrefix
*/
public void setIgnoreTablePrefix(String ignoreTablePrefix) {
this.ignoreTablePrefix = ignoreTablePrefix;
}
/**
* 名前を変換しないかどうかを返します。
*
* @return 名前を変換しないかどうか
*/
public boolean isNoNameConversion() {
return noNameConversion;
}
/**
* 名前を変換しないかどうかを設定します。
*
* @param noNameConversion
*/
public void setNoNameConversion(boolean noNameConversion) {
this.noNameConversion = noNameConversion;
}
public String fromTableNameToEntityName(String tableName) {
AssertionUtil.assertNotNull("tableName", tableName);
if (noNameConversion) {
return tableName;
}
return StringUtil.camelize(StringUtil.trimPrefix(tableName,
ignoreTablePrefix));
}
public String fromEntityNameToTableName(String entityName) {
AssertionUtil.assertNotNull("entityName", entityName);
if (noNameConversion) {
return entityName;
}
String tableName = StringUtil.decamelize(entityName);
if (ignoreTablePrefix != null) {
tableName = ignoreTablePrefix + tableName;
}
return tableName;
}
public String fromColumnNameToPropertyName(String columnName) {
AssertionUtil.assertNotNull("columnName", columnName);
if (noNameConversion) {
return columnName;
}
return StringUtil.decapitalize(StringUtil.camelize(columnName));
}
public String fromPropertyNameToColumnName(String propertyName) {
AssertionUtil.assertNotNull("propertyName", propertyName);
if (noNameConversion) {
return propertyName;
}
return StringUtil.decamelize(propertyName);
}
}
|
[
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] |
koichik@319488c0-e101-0410-93bc-b5e51f62721a
|
3f68eb3d996543ea9dea40f09d885b9f795aeb90
|
a06d7c64721f91f5f262ad8ff8d474ce0e46ff69
|
/Project/Practice/src/com/cyq7on/practice/other/Cisco.java
|
783c6029da08ba8e9f1f43fede4b4bcb68192c80
|
[
"Apache-2.0"
] |
permissive
|
cyq7on/DataStructureAndAlgorithm
|
99ad9123598e4b49f4ccde5357d40fc65509b51d
|
aa1ee0cd4c8756ad345430f38b2a38a407716d6d
|
refs/heads/master
| 2021-01-22T07:25:17.298062
| 2020-10-19T12:37:30
| 2020-10-19T12:37:30
| 81,808,591
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 880
|
java
|
package com.cyq7on.practice.other;
import java.util.Scanner;
public class Cisco {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
String[] split = line.substring(1, line.length() - 1).split(",");
int[] arr = new int[split.length];
for (int i = 0; i < split.length; i++) {
arr[i] = Integer.valueOf(split[i]);
}
System.out.println(canJump(arr));
}
public static boolean canJump(int[] nums) {
if (nums == null || nums.length == 0) {
return false;
}
//pos表示需要到达的位置
int pos = nums.length - 1;
for (int i = nums.length - 2; i >= 0; i--) {
if (nums[i] + i >= pos) {
pos = i;
}
}
return pos == 0;
}
}
|
[
"cyq7on@qq.com"
] |
cyq7on@qq.com
|
4dfee39b74eb7808fc8803dc8524117d2b39fac9
|
4421f7c7149b13fc7e5e2ecba3839cc73c571101
|
/src/LeetCode/Math/LC553OptimalDivision.java
|
92ab6d113c8f6c5a19ed47a9eef20ae77c500824
|
[] |
no_license
|
MyvinB/Algo-Learn
|
ade78c6587cbd892d9622351e0420e1dade338e7
|
7da34a9d1cf21931c77a3a5acb132a4239ab37f0
|
refs/heads/master
| 2023-08-18T15:29:45.561872
| 2023-08-12T11:11:17
| 2023-08-12T11:11:17
| 211,624,753
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 534
|
java
|
package LeetCode.Math;/*
@author Myvin Barboza
27/07/20 1:06 PM
*/
public class LC553OptimalDivision {
public String optimalDivision(int[] nums) {
if(nums.length==0) return "";
StringBuilder sb=new StringBuilder();
if(nums.length==1) return ""+nums[0];
if(nums.length==2) return nums[0]+"/"+nums[1];
sb.append(nums[0]+"/("+nums[1]);
for(int i=2;i<nums.length;i++){
sb.append("/"+nums[i]);
}
sb.append(")");
return sb.toString();
}
}
|
[
"myvinbarboza@gmail.com"
] |
myvinbarboza@gmail.com
|
29fece721d1e10f1cae206ff1d9d5cefb8f96a95
|
00e6ec7a14041a979f7de7e8816fd9eca1e0a79f
|
/src/main/java/pl/khuzzuk/wfrpchar/entities/items/usable/AbstractCommodity.java
|
76151396089ce0ab6d2769bfe15ebab9f64d225b
|
[] |
no_license
|
khuzzuk/WFRPCharSheet
|
d4500763c31480fd712ed64913b73119173f561c
|
16433811c1da7f58792c6c26a320f806cdd8bd78
|
refs/heads/master
| 2020-05-22T04:03:52.821842
| 2018-06-23T10:23:57
| 2018-06-23T10:23:57
| 64,210,616
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,570
|
java
|
package pl.khuzzuk.wfrpchar.entities.items.usable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import pl.khuzzuk.wfrpchar.entities.Named;
import pl.khuzzuk.wfrpchar.entities.Price;
import pl.khuzzuk.wfrpchar.entities.items.Accessibility;
import pl.khuzzuk.wfrpchar.entities.items.Commodity;
import java.util.List;
@Getter
@Setter
public abstract class AbstractCommodity implements Commodity, Named<String> {
private String name;
private Accessibility accessibility;
private Price basePrice; // Additional price to calculated - it usualy is like basePrice + (baseType.price * resource.priceMultiplier)
private String specialFeatures;
void fillCommodityFields(List<String> fields) {
fields.add(name);
fields.add(basePrice.toString());
fields.add(accessibility.name());
fields.add(specialFeatures);
}
@Override
public boolean equals(Object o) {
return namedEquals(o);
}
@Override
public int hashCode() {
return namedHashCode();
}
@Override
public String toString() {
return name;
}
@Override
@JsonIgnore
public Price getPrice() {
return basePrice;
}
@Override
@JsonIgnore
public void setPrice(Price price) {
basePrice = price;
}
@Override
public float getWeight() {
throw new UnsupportedOperationException();
}
@Override
public void setWeight(float weight) {
throw new UnsupportedOperationException();
}
}
|
[
"adriandrabik@gmail.com"
] |
adriandrabik@gmail.com
|
d4e2be6ce19beac13f28073458a3ae076fdca532
|
dd80a584130ef1a0333429ba76c1cee0eb40df73
|
/frameworks/base/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java
|
29fb868794f4910f3b9b60436d6987051058ecaf
|
[
"MIT",
"LicenseRef-scancode-unicode",
"Apache-2.0"
] |
permissive
|
karunmatharu/Android-4.4-Pay-by-Data
|
466f4e169ede13c5835424c78e8c30ce58f885c1
|
fcb778e92d4aad525ef7a995660580f948d40bc9
|
refs/heads/master
| 2021-03-24T13:33:01.721868
| 2017-02-18T17:48:49
| 2017-02-18T17:48:49
| 81,847,777
| 0
| 2
|
MIT
| 2020-03-09T00:02:12
| 2017-02-13T16:47:00
| null |
UTF-8
|
Java
| false
| false
| 2,484
|
java
|
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.transitiontests;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.transition.Scene;
import android.widget.Button;
import android.transition.Fade;
import android.transition.TransitionManager;
public class FadingTest extends Activity {
Button mRemovingButton, mInvisibleButton, mGoneButton;
Scene mScene1, mScene2;
ViewGroup mSceneRoot;
static Fade sFade = new Fade();
Scene mCurrentScene;
static {
sFade.addTarget(R.id.removingButton).addTarget(R.id.invisibleButton).
addTarget(R.id.goneButton);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fading_test);
View container = (View) findViewById(R.id.container);
mSceneRoot = (ViewGroup) container.getParent();
mRemovingButton = (Button) findViewById(R.id.removingButton);
mInvisibleButton = (Button) findViewById(R.id.invisibleButton);
mGoneButton = (Button) findViewById(R.id.goneButton);
mGoneButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mGoneButton.setAlpha(mGoneButton.getAlpha() < 1 ? 1 : .6f);
}
});
mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this);
mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this);
mCurrentScene = mScene1;
}
public void sendMessage(View view) {
if (mCurrentScene == mScene1) {
TransitionManager.go(mScene2);
mCurrentScene = mScene2;
} else {
TransitionManager.go(mScene1);
mCurrentScene = mScene1;
}
}
}
|
[
"karun.matharu@gmail.com"
] |
karun.matharu@gmail.com
|
dfdba6269c107fa02800be2296102b41af482069
|
c30d4f174a28aac495463f44b496811ee0c21265
|
/platform/util/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java
|
f5fb2d43332a5408ca48ab53815a4ffe5854db31
|
[
"Apache-2.0"
] |
permissive
|
sarvex/intellij-community
|
cbbf08642231783c5b46ef2d55a29441341a03b3
|
8b8c21f445550bd72662e159ae715e9d944ba140
|
refs/heads/master
| 2023-05-14T14:32:51.014859
| 2023-05-01T06:59:21
| 2023-05-01T06:59:21
| 32,571,446
| 0
| 0
|
Apache-2.0
| 2023-05-01T06:59:22
| 2015-03-20T08:16:17
|
Java
|
UTF-8
|
Java
| false
| false
| 3,787
|
java
|
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* 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.intellij.util.containers;
import junit.framework.TestCase;
public class ConcurrentBitSetTest extends TestCase {
public void test() {
ConcurrentBitSet bitSet = new ConcurrentBitSet();
final ConcurrentBitSet emptySet = new ConcurrentBitSet();
int N = 3000;
assertEquals(0, bitSet.nextClearBit(0));
assertEquals(bitSet, emptySet);
for (int i=0; i<N;i++) {
assertEquals(-1, bitSet.nextSetBit(i));
assertEquals(i, bitSet.nextClearBit(i));
assertFalse(bitSet.get(i));
bitSet.set(i);
assertTrue(bitSet.get(i));
bitSet.clear(i);
assertFalse(bitSet.get(i));
assertEquals(bitSet, emptySet);
}
bitSet = new ConcurrentBitSet();
for (int b=0;b<N;b++) {
assertEquals(bitSet, emptySet);
boolean set = bitSet.flip(b);
assertTrue(set);
assertEquals(b, bitSet.nextSetBit(0));
assertEquals(b==0?1:0, bitSet.nextClearBit(0));
assertEquals(b+1, bitSet.nextClearBit(b));
assertFalse(bitSet.get(b==0?1:0));
assertTrue(bitSet.get(b));
for (int i=0; i<N;i++) {
assertEquals(i<=b?b:-1, bitSet.nextSetBit(i));
assertEquals(i==b?b+1:i, bitSet.nextClearBit(i));
assertEquals(i == b, bitSet.get(i));
}
boolean after = bitSet.flip(b);
assertFalse(after);
assertEquals(-1, bitSet.nextSetBit(0));
assertEquals(0, bitSet.nextClearBit(0));
assertEquals(b, bitSet.nextClearBit(b));
assertFalse(bitSet.get(0));
assertFalse(bitSet.get(b));
for (int i=0; i<N;i++) {
assertEquals(-1, bitSet.nextSetBit(i));
assertEquals(i, bitSet.nextClearBit(i));
assertFalse(bitSet.get(i));
}
}
bitSet.set(100, true);
assertFalse(bitSet.equals(emptySet));
bitSet.clear();
assertEquals(bitSet, emptySet);
}
public void testStress() throws InterruptedException {
final ConcurrentBitSet bitSet = new ConcurrentBitSet();
int N = 100;
final int L = 100;
Thread[] threads = new Thread[N];
for (int i=0; i<N;i++) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 10000; i++) {
for (int j = 0; j < L; j++) {
bitSet.flip(j);
}
}
}
},"conc bit set");
threads[i] = thread;
thread.start();
}
for (Thread thread : threads) {
thread.join();
}
assertEquals(-1, bitSet.nextSetBit(0));
}
public void testStress2_Performance() throws InterruptedException {
final ConcurrentBitSet bitSet = new ConcurrentBitSet();
int N = 10;
final int L = 1000000;
Thread[] threads = new Thread[N];
for (int i=0; i<N;i++) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 100; i++) {
for (int j = 0; j < L; j++) {
bitSet.flip(j);
}
}
}
},"conc bit stress");
threads[i] = thread;
thread.start();
}
for (Thread thread : threads) {
thread.join();
}
assertEquals(-1, bitSet.nextSetBit(0));
}
}
|
[
"cdr@intellij.com"
] |
cdr@intellij.com
|
54839ec175eca10d283cc84d98bdc5b8e93ca026
|
a40af96d9ae03f99187826304a965f768817f356
|
/09Lesson6399/src/java6399/scores/Score6399.java
|
659bf0840c7fd53622329ffb90dd38190443374e
|
[] |
no_license
|
liuchang1220/JavaFX
|
9e44bf673d5f70b0d9ff51183e1fdcecbb19c566
|
91b856960c1fb73a89e7e56309b68ccaf8201422
|
refs/heads/master
| 2023-05-03T18:37:11.827849
| 2021-05-19T16:34:47
| 2021-05-19T16:34:47
| 368,934,614
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,144
|
java
|
package java6399.scores;
public class Score6399 {
private String name;
private int Chinese;
private int math;
private int english;
private int sum;
public Score6399() {
}
public Score6399(String name, int chinese, int math, int english) {
this.name = name;
Chinese = chinese;
this.math = math;
this.english = english;
}
public int getSum() {
return sum;
}
public void setSum(int sum) {
this.sum = sum;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getChinese() {
return Chinese;
}
public void setChinese(int chinese) {
Chinese = chinese;
}
public int getMath() {
return math;
}
public void setMath(int math) {
this.math = math;
}
public int getEnglish() {
return english;
}
public void setEnglish(int english) {
this.english = english;
}
public int getsum(){
sum=this.Chinese+this.english+this.math;
return sum;
}
}
|
[
"you@example.com"
] |
you@example.com
|
cd1cdef1f80eb44c80e3d69679528b9f938af69b
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/12/12_ff7bc372602e70e1e9a6a8e9c0d026e9f19f7e2b/LoginActivity/12_ff7bc372602e70e1e9a6a8e9c0d026e9f19f7e2b_LoginActivity_s.java
|
74b743d3ac54018c8000586ded38857d77129c6f
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 7,258
|
java
|
package com.turbo_extreme_sloth.ezzence.activities;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.turbo_extreme_sloth.ezzence.CurrentUser;
import com.turbo_extreme_sloth.ezzence.R;
import com.turbo_extreme_sloth.ezzence.SharedPreferencesHelper;
import com.turbo_extreme_sloth.ezzence.User;
import com.turbo_extreme_sloth.ezzence.config.Config;
import com.turbo_extreme_sloth.ezzence.rest.RESTRequest;
import com.turbo_extreme_sloth.ezzence.rest.RESTRequestEvent;
import com.turbo_extreme_sloth.ezzence.rest.RESTRequestListener;
public class LoginActivity extends Activity implements RESTRequestListener
{
/** The ID for recognizing a login event. */
protected static final String LOGIN_EVENT_ID = "loginEvent";
/** Stores the user information during the request. */
protected User user;
/** Elements. */
protected EditText userNameEditText;
protected EditText passwordEditText;
protected EditText loginPinEditText;
protected Button loginButtonButton;
protected ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
User user = SharedPreferencesHelper.getUser(this);
// If a user is present in shared preferences, start the unlock activity
if (user.getName() != null &&
user.getPassword() != null &&
user.getPin() != null &&
user.getName().length() > 0 &&
user.getPassword().length() > 0 &&
user.getPin().length() > 0)
{
startActivity(new Intent(this, UnlockActivity.class));
finish();
return;
}
setContentView(R.layout.activity_login);
userNameEditText = (EditText) findViewById(R.id.loginUserNameEditText);
passwordEditText = (EditText) findViewById(R.id.loginPasswordEditText);
loginPinEditText = (EditText) findViewById(R.id.loginPinEditText);
loginButtonButton = (Button) findViewById(R.id.loginButtonButton);
loginButtonButton.setOnClickListener(loginButtonButtonOnClickListener);
}
/**
* The click listener for the login button.
*/
protected OnClickListener loginButtonButtonOnClickListener = new OnClickListener()
{
@Override
public void onClick(View view)
{
String userName = userNameEditText.getText().toString();
String password = passwordEditText.getText().toString();
String pin = loginPinEditText.getText().toString();
// User name must not be empty
if (userName.length() <= 0)
{
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setMessage(R.string.login_empty_userName);
builder.setPositiveButton(R.string.ok, null);
builder.show();
return;
}
// Password must not be empty
if (password.length() <= 0)
{
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setMessage(R.string.login_empty_password);
builder.setPositiveButton(R.string.ok, null);
builder.show();
return;
}
// Pin code must be at least 5 digits
if (pin.length() < 5)
{
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setMessage(R.string.login_pin_too_short);
builder.setPositiveButton(R.string.ok, null);
builder.show();
return;
}
performLoginRequest(userName, password, pin);
}
};
/**
* Performs a RESTful request to the server
*/
protected void performLoginRequest(String userName, String password, String pin)
{
// Store these user credentials in the user class
user = new User(userName, password, (String) null, pin, 0);
// Create new RESTRequest instance and fill it with user data
RESTRequest restRequest = new RESTRequest(Config.REST_REQUEST_BASE_URL + Config.REST_REQUEST_LOGIN, LOGIN_EVENT_ID);
restRequest.putString("username", userName);
restRequest.putString("password", password);
restRequest.addEventListener(this);
// Send an asynchronous RESTful request
restRequest.execute();
}
@Override
public void RESTRequestOnPreExecute(RESTRequestEvent event)
{
progressDialog = new ProgressDialog(this);
progressDialog.setTitle(getResources().getString(R.string.loading));
progressDialog.show();
}
@Override
public void RESTRequestOnPostExecute(RESTRequestEvent event)
{
progressDialog.dismiss();
if (LOGIN_EVENT_ID.equals(event.getID()))
{
handleRESTRequestLoginEvent(event);
}
}
/**
* @param event
*/
private void handleRESTRequestLoginEvent(RESTRequestEvent event)
{
String result = event.getResult();
// Check if the returned string isn't an error generated by the REST class
if (RESTRequest.isExceptionCode(result))
{
Toast.makeText(this, getString(R.string.error_unknown_exception), Toast.LENGTH_SHORT).show();
return;
}
try
{
// Parse JSON
JSONObject jsonObject = new JSONObject(result);
String message = jsonObject.getString("message");
String sessionID = jsonObject.getString("sessionID");
int userType = jsonObject.getInt("userType");
// Show a message when user is blocked
if ("blocked".equals(message))
{
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle(R.string.login_failed);
builder.setMessage(R.string.login_blocked);
builder.setPositiveButton(R.string.ok, null);
builder.show();
return;
}
// Message should be equal to success and sessionID should be available to be logged in successfully
if (!"success".equals(message) ||
sessionID == null ||
sessionID.length() <= 0)
{
Toast.makeText(getApplicationContext(), getResources().getString(R.string.rest_not_found), Toast.LENGTH_SHORT).show();
return;
}
user.setSessionID(sessionID);
user.setType(userType);
}
catch (JSONException e) { }
// Correct login, start main activity
if (user.isLoggedIn())
{
SharedPreferencesHelper.storeUser(this, user);
CurrentUser.setCurrentUser(user);
startActivity(new Intent(this, MainActivity.class));
finish();
}
else
{
String message = event.getMessageFromResult();
// The server couldn't be reached, as no message is set
if (message == null)
{
Toast.makeText(getApplicationContext(), getResources().getString(R.string.rest_not_found), Toast.LENGTH_SHORT).show();
}
// The server did not accept the passed user credentials
else
{
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle(R.string.login_failed);
builder.setMessage(R.string.login_wrong_credentials);
builder.setPositiveButton(R.string.ok, null);
builder.show();
}
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
7d86e8a4fac9b09ccbf046b52dde0d0942e03686
|
eb9f655206c43c12b497c667ba56a0d358b6bc3a
|
/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/OpenAlienProjectAction.java
|
c785048ebfd163cdb2ad1571248feef3714b6675
|
[
"Apache-2.0"
] |
permissive
|
JetBrains/intellij-community
|
2ed226e200ecc17c037dcddd4a006de56cd43941
|
05dbd4575d01a213f3f4d69aa4968473f2536142
|
refs/heads/master
| 2023-09-03T17:06:37.560889
| 2023-09-03T11:51:00
| 2023-09-03T12:12:27
| 2,489,216
| 16,288
| 6,635
|
Apache-2.0
| 2023-09-12T07:41:58
| 2011-09-30T13:33:05
| null |
UTF-8
|
Java
| false
| false
| 2,059
|
java
|
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.wm.impl.welcomeScreen;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.impl.ProjectUtil;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.NlsSafe;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.nio.file.Path;
import java.util.List;
import java.util.Objects;
public class OpenAlienProjectAction extends AnAction {
private final ProjectDetector myDetector;
private List<String> myProjectPaths;
public OpenAlienProjectAction(ProjectDetector detector) {
myDetector = detector;
}
public void scheduleUpdate(JComponent toUpdate) {
toUpdate.setVisible(false);
myDetector.detectProjects(projects -> toUpdate.setVisible(!(myProjectPaths = projects).isEmpty()));
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(ActionPlaces.WELCOME_SCREEN.equals(e.getPlace()));
}
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
if (myProjectPaths == null) return;
DefaultActionGroup actionGroup = new DefaultActionGroup();
for (@NlsSafe String path : myProjectPaths) {
actionGroup.add(new AnAction(path) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
ProjectUtil.openOrImport(Path.of(path));
projectOpened();
}
});
}
JBPopupFactory.getInstance()
.createActionGroupPopup(IdeBundle.message("popup.title.open.project"), actionGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
false).showUnderneathOf(Objects.requireNonNull(e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT)));
}
protected void projectOpened() {}
}
|
[
"intellij-monorepo-bot-no-reply@jetbrains.com"
] |
intellij-monorepo-bot-no-reply@jetbrains.com
|
be5dceaab28df3d1071df3bbe0450251da56b1c4
|
ca992e8df8bdb3a75b02284f8fca8db5a0a64311
|
/bos_management/src/main/java/cn/itcast/bos/dao/WayBillRepository.java
|
1d1b10455103943063af1594bfd3b5d9f1d86323
|
[] |
no_license
|
chenxup/bos
|
d992e6b2aa2ade9cf24279f36c4174df06cb7726
|
c0a81b746b902f5db66add91029956279b2670e0
|
refs/heads/master
| 2021-07-08T14:27:26.032566
| 2017-10-06T08:33:04
| 2017-10-06T08:33:04
| 103,370,416
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 642
|
java
|
package cn.itcast.bos.dao;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import cn.itcast.bos.domain.take_delivery.WayBill;
public interface WayBillRepository extends JpaRepository<WayBill,Integer>,JpaSpecificationExecutor<WayBill> {
WayBill findByWayBillNum(String wayBillNum);
@Query(value="select count(t.c_sign_status) from t_way_bill t group by t.c_sign_status order by t.c_sign_status", nativeQuery=true)
List<Object> findCountWayBill();
}
|
[
"123"
] |
123
|
dd958f415621843c019f8bcc6961700698c868dc
|
54f352a242a8ad6ff5516703e91da61e08d9a9e6
|
/Source Codes/AtCoder/arc091/A/2192600.java
|
d72acaabb8e967b1c7aa1094a206cefeb9a5d91a
|
[] |
no_license
|
Kawser-nerd/CLCDSA
|
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
|
aee32551795763b54acb26856ab239370cac4e75
|
refs/heads/master
| 2022-02-09T11:08:56.588303
| 2022-01-26T18:53:40
| 2022-01-26T18:53:40
| 211,783,197
| 23
| 9
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 877
|
java
|
import java.util.*;
public class Main {
private long N;
private long M;
public void inputData() {
Scanner sc = new Scanner(System.in);
N = sc.nextLong();
M = sc.nextLong();
}
public void printAnswer() {
/*if (N == 1 && M == 1) {
System.out.println(1);
} else if (N == 1) {
System.out.println(M - 2);
} else if (M == 1) {
System.out.println(N - 2);
} else {
System.out.println((N - 2) * (M - 2));
}*/
if (N > 1) {
N -= 2;
}
if (M > 1) {
M -= 2;
}
System.out.println(N * M);
}
public void run() {
inputData();
printAnswer();
}
public static void main(String[] args) {
(new Main()).run();
}
}
|
[
"kwnafi@yahoo.com"
] |
kwnafi@yahoo.com
|
bb8e18d02db007312d758e00a014bd5ea02359b1
|
6635387159b685ab34f9c927b878734bd6040e7e
|
/src/cgq.java
|
93dc7adf8c50d492e00282e81862f94a41c34391
|
[] |
no_license
|
RepoForks/com.snapchat.android
|
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
|
6e28a32ad495cf14f87e512dd0be700f5186b4c6
|
refs/heads/master
| 2021-05-05T10:36:16.396377
| 2015-07-16T16:46:26
| 2015-07-16T16:46:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 370
|
java
|
final class cgq
implements cgi
{
Class a;
String b;
int c;
cgq(Class paramClass, String paramString, int paramInt)
{
a = paramClass;
b = paramString;
c = paramInt;
}
public final String toString()
{
return b + ":" + c;
}
}
/* Location:
* Qualified Name: cgq
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
687344bf4f4bc331b2bcb11e755d288f8c3917b3
|
fa51687f6aa32d57a9f5f4efc6dcfda2806f244d
|
/jdk8-src/src/main/java/java/time/chrono/MinguoEra.java
|
f7cf95855c3d47659cc8869b013977bd0c9c9da7
|
[] |
no_license
|
yida-lxw/jdk8
|
44bad6ccd2d81099bea11433c8f2a0fc2e589eaa
|
9f69e5f33eb5ab32e385301b210db1e49e919aac
|
refs/heads/master
| 2022-12-29T23:56:32.001512
| 2020-04-27T04:14:10
| 2020-04-27T04:14:10
| 258,988,898
| 0
| 1
| null | 2020-10-13T21:32:05
| 2020-04-26T09:21:22
|
Java
|
UTF-8
|
Java
| false
| false
| 4,780
|
java
|
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
/*
*
*
*
*
*
* Copyright (c) 2012, Stephen Colebourne & Michael Nascimento Santos
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of JSR-310 nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package java.time.chrono;
import java.time.DateTimeException;
/**
* An era in the Minguo calendar system.
* <p>
* The Minguo calendar system has two eras.
* The current era, for years from 1 onwards, is known as the 'Republic of China' era.
* All previous years, zero or earlier in the proleptic count or one and greater
* in the year-of-era count, are part of the 'Before Republic of China' era.
*
* <table summary="Minguo years and eras" cellpadding="2" cellspacing="3" border="0" >
* <thead>
* <tr class="tableSubHeadingColor">
* <th class="colFirst" align="left">year-of-era</th>
* <th class="colFirst" align="left">era</th>
* <th class="colFirst" align="left">proleptic-year</th>
* <th class="colLast" align="left">ISO proleptic-year</th>
* </tr>
* </thead>
* <tbody>
* <tr class="rowColor">
* <td>2</td><td>ROC</td><td>2</td><td>1913</td>
* </tr>
* <tr class="altColor">
* <td>1</td><td>ROC</td><td>1</td><td>1912</td>
* </tr>
* <tr class="rowColor">
* <td>1</td><td>BEFORE_ROC</td><td>0</td><td>1911</td>
* </tr>
* <tr class="altColor">
* <td>2</td><td>BEFORE_ROC</td><td>-1</td><td>1910</td>
* </tr>
* </tbody>
* </table>
* <p>
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code MinguoEra}.
* Use {@code getValue()} instead.</b>
*
* @implSpec This is an immutable and thread-safe enum.
* @since 1.8
*/
public enum MinguoEra implements Era {
/**
* The singleton instance for the era before the current one, 'Before Republic of China Era',
* which has the numeric value 0.
*/
BEFORE_ROC,
/**
* The singleton instance for the current era, 'Republic of China Era',
* which has the numeric value 1.
*/
ROC;
//-----------------------------------------------------------------------
/**
* Obtains an instance of {@code MinguoEra} from an {@code int} value.
* <p>
* {@code MinguoEra} is an enum representing the Minguo eras of BEFORE_ROC/ROC.
* This factory allows the enum to be obtained from the {@code int} value.
*
* @param minguoEra the BEFORE_ROC/ROC value to represent, from 0 (BEFORE_ROC) to 1 (ROC)
* @return the era singleton, not null
* @throws DateTimeException if the value is invalid
*/
public static MinguoEra of(int minguoEra) {
switch (minguoEra) {
case 0:
return BEFORE_ROC;
case 1:
return ROC;
default:
throw new DateTimeException("Invalid era: " + minguoEra);
}
}
//-----------------------------------------------------------------------
/**
* Gets the numeric era {@code int} value.
* <p>
* The era BEFORE_ROC has the value 0, while the era ROC has the value 1.
*
* @return the era value, from 0 (BEFORE_ROC) to 1 (ROC)
*/
@Override
public int getValue() {
return ordinal();
}
}
|
[
"yida@caibeike.com"
] |
yida@caibeike.com
|
821b590e7ccd2924b5f69763294062d027e10129
|
b341c1aac764fb29e37d24113102c359f1606757
|
/entry-online-app/entry-online-biz/src/test/java/com/fescotech/apps/admin/biz/admin/Student.java
|
c2ffe25c29c07ab8bb5ce79a5298c555a84bdedb
|
[] |
no_license
|
13849141963/hr-web
|
53400d3938ad04b06a1f843a698bfba24cb88607
|
ea6b3e5165632acbf8ee74a5639f49deb76aa8c8
|
refs/heads/master
| 2022-12-28T06:27:13.082769
| 2019-06-20T13:08:44
| 2019-06-20T13:08:44
| 192,918,646
| 0
| 0
| null | 2022-12-16T08:04:33
| 2019-06-20T12:46:48
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 619
|
java
|
package com.fescotech.apps.admin.biz.admin;
/**
* @author cao.guo.dong
* @create 2017-12-26 9:14
* @desc 学生类
**/
public class Student {
private int age;
private String name;
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Student{" +
"age=" + age +
", name='" + name + '\'' +
'}';
}
}
|
[
"email@example.com"
] |
email@example.com
|
7cb8a95eefbb94b76d0434c300aacc76391f2b37
|
258de8e8d556901959831bbdc3878af2d8933997
|
/utopia-schedule/src/main/java/com/voxlearning/utopia/schedule/schedule/chips/AutoGenChipsRemindRecord.java
|
c1a8f0cdf544bba6c7ded75ac15483d52137cf30
|
[] |
no_license
|
Explorer1092/vox
|
d40168b44ccd523748647742ec376fdc2b22160f
|
701160b0417e5a3f1b942269b0e7e2fd768f4b8e
|
refs/heads/master
| 2020-05-14T20:13:02.531549
| 2019-04-17T06:54:06
| 2019-04-17T06:54:06
| 181,923,482
| 0
| 4
| null | 2019-04-17T15:53:25
| 2019-04-17T15:53:25
| null |
UTF-8
|
Java
| false
| false
| 7,382
|
java
|
package com.voxlearning.utopia.schedule.schedule.chips;
import com.voxlearning.alps.annotation.common.Mode;
import com.voxlearning.alps.annotation.remote.ImportService;
import com.voxlearning.alps.calendar.DateUtils;
import com.voxlearning.alps.core.util.CollectionUtils;
import com.voxlearning.alps.core.util.StringUtils;
import com.voxlearning.alps.lang.calendar.DayRange;
import com.voxlearning.alps.lang.mapper.json.JsonUtils;
import com.voxlearning.alps.schedule.progress.ISimpleProgressMonitor;
import com.voxlearning.alps.spi.queue.AlpsQueueProducer;
import com.voxlearning.alps.spi.queue.Message;
import com.voxlearning.alps.spi.queue.MessageProducer;
import com.voxlearning.alps.spi.schedule.ProgressTotalWork;
import com.voxlearning.alps.spi.schedule.ScheduledJobDefinition;
import com.voxlearning.utopia.schedule.journal.JobJournalLogger;
import com.voxlearning.utopia.schedule.support.ScheduledJobWithJournalSupport;
import com.voxlearning.utopia.service.ai.api.ChipsActiveService;
import com.voxlearning.utopia.service.ai.api.ChipsEnglishClazzService;
import com.voxlearning.utopia.service.ai.api.ChipsEnglishContentLoader;
import com.voxlearning.utopia.service.ai.entity.ChipsEnglishClass;
import com.voxlearning.utopia.service.ai.entity.ChipsEnglishClassUserRef;
import com.voxlearning.utopia.service.ai.entity.ChipsEnglishProductTimetable;
import javax.inject.Named;
import java.util.*;
import java.util.stream.Collectors;
/**
* 薯条英语 生成催课提醒记录
*
* @author zhuxuan
*/
@Named
@ScheduledJobDefinition(
jobName = "薯条英语 生成催课提醒记录",
jobDescription = "每天 0 点执行",
disabled = {Mode.STAGING},
cronExpression = "0 0 0 * * ?"
)
@ProgressTotalWork(100)
public class AutoGenChipsRemindRecord extends ScheduledJobWithJournalSupport {
@ImportService(interfaceClass = ChipsActiveService.class)
private ChipsActiveService chipsActiveService;
@ImportService(interfaceClass = ChipsEnglishClazzService.class)
private ChipsEnglishClazzService chipsEnglishClazzService;
@ImportService(interfaceClass = ChipsEnglishContentLoader.class)
private ChipsEnglishContentLoader chipsEnglishContentLoader;
@AlpsQueueProducer(queue = "utopia.chips.active.service.remind.message.send.queue")
private MessageProducer producer;
/**
* 如果没有班级 跑所有的班级
* 如果有班级 没有userIdCols 跑该班级下所有的
* 如果有班级 且有userIdCols 这跑 班级下的用户和userIdCols 的交集部分
*
* @param jobJournalLogger
* @param startTimestamp
* @param parameters 可以不传,数据样例 {"unitDate":"2019-02-26","clazzId":4,"userIds":[0,1,2,3,4,5,6,7,8,9]}
* @param progressMonitor
* @throws Exception
*/
@Override
protected void executeScheduledJob(JobJournalLogger jobJournalLogger, long startTimestamp, Map<String, Object> parameters, ISimpleProgressMonitor progressMonitor) throws Exception {
Object clazzObj = parameters.get("clazzId");
Object unitDateObj = parameters.get("unitDate");
Object userIds = parameters.get("userIds");
long clazzId = clazzObj == null ? 0l : Long.parseLong(clazzObj.toString());
//如果没有传unitDate 则使用DayRange.current().previous().getStartDate()
Date unitDate = unitDateObj == null ? DayRange.current().previous().getStartDate() : DateUtils.parseDate(unitDateObj.toString(), DateUtils.FORMAT_SQL_DATE);
Collection<Long> userCol = null;
if (userIds != null) {
List<Object> temp = (List) userIds;
userCol = temp.stream().map(e -> Long.valueOf(e.toString())).collect(Collectors.toSet());
}
autoGenChipsRemindRecord(clazzId, userCol, unitDate);
}
public void autoGenChipsRemindRecord(Long clazzId, Collection<Long> userIdCols, Date unitData) {
if (clazzId == null || clazzId == 0l) {//执行所有班级对应的unitData的单元数据
List<ChipsEnglishClass> clazzList = chipsEnglishClazzService.loadAllChipsEnglishClass();
for (ChipsEnglishClass clazz : clazzList) {
handleByClazz(clazz, null, unitData);
}
} else {
ChipsEnglishClass clazz = chipsEnglishClazzService.selectChipsEnglishClassById(clazzId);
if (clazz == null) {
return;
}
handleByClazz(clazz, userIdCols, unitData);
}
}
/**
* 处理一个班级下的
*
* @param clazz
* @param userIdCols
* @param unitData
*/
private void handleByClazz(ChipsEnglishClass clazz, Collection<Long> userIdCols, Date unitData) {
String unitId = loadUnitId(clazz, unitData);
if (StringUtils.isBlank(unitId)) {
return;
}
List<ChipsEnglishClassUserRef> refs = chipsEnglishClazzService.selectChipsEnglishClassUserRefByClazzId(clazz.getId());
if (CollectionUtils.isEmpty(refs)) {
return;
}
List<Long> userIdList;
if (CollectionUtils.isEmpty(userIdCols)) {//跑该班级下的所有用户对应的unitData的单元数据
userIdList = refs.stream().map(ChipsEnglishClassUserRef::getUserId).collect(Collectors.toList());
} else {//跑该班级下的所有用户和userIdCols的交集 对应的unitData的单元数据
userIdList = refs.stream().map(ChipsEnglishClassUserRef::getUserId).filter(e -> userIdCols.contains(e)).collect(Collectors.toList());
}
// logger.info("AutoGenChipsRemindRecord handle clazz: " + clazz.getId() + " ; unitId : " + unitId + "; userIdList size : " + userIdList.size());
sendQueue(clazz, userIdList, unitId);
}
private void sendQueue(ChipsEnglishClass clazz, Collection<Long> userIdCols, String unitId) {
if (CollectionUtils.isEmpty(userIdCols)) {
return;
}
int index = 1;
for (Long userId : userIdCols) {
Map<String, Object> message = new HashMap<>();
message.put("clazzId", clazz.getId());
message.put("userId", userId);
message.put("productId", clazz.getProductId());
message.put("unitId", unitId);
producer.produce(Message.newMessage().withPlainTextBody(JsonUtils.toJson(message)));
if (index % 100 == 0) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
index++;
}
}
private String loadUnitId(ChipsEnglishClass clazz, Date unitData) {
ChipsEnglishProductTimetable timetable = chipsEnglishContentLoader.loadChipsEnglishProductTimetableById(clazz.getProductId());
if (timetable == null) {
return null;
}
// 在开始时间之前 或者 在结束时间之后,不生成
if (timetable.getBeginDate().after(unitData) || timetable.getEndDate().before(unitData)) {
return null;
}
// 单元id
String unitId = timetable.getCourses().stream()
.filter(course -> unitData.equals(course.getBeginDate()))
.map(ChipsEnglishProductTimetable.Course::getUnitId)
.findFirst()
.orElse(null);
return unitId;
}
}
|
[
"wangahai@300.cn"
] |
wangahai@300.cn
|
af746d720a921ad3b2bddd4fae3524f3d63405ed
|
b6bfba71956589aa6f56729ec9ebce824a5fb8f4
|
/src/main/java/com/javapatterns/windowadapter/ServiceAdapter.java
|
4a6382408b6da0090f870f5383830e667229613d
|
[
"Apache-2.0"
] |
permissive
|
plotor/design-pattern
|
5d78d0ef7349a2d637bea5b7270c9557820e5f60
|
4614bab50921b61610693b9b1ed06feddcee9ce6
|
refs/heads/master
| 2022-12-20T17:49:13.396939
| 2020-10-13T14:37:14
| 2020-10-13T14:37:14
| 67,619,122
| 0
| 0
|
Apache-2.0
| 2020-10-13T14:37:15
| 2016-09-07T15:21:45
|
Java
|
UTF-8
|
Java
| false
| false
| 274
|
java
|
package com.javapatterns.windowadapter;
public class ServiceAdapter implements AbstractService {
public void serviceOperation1() {
}
public int serviceOperation2() {
return 0;
}
public String serviceOperation3() {
return null;
}
}
|
[
"zhenchao.wang@hotmail.com"
] |
zhenchao.wang@hotmail.com
|
39c566cbfd88b38f9d09592ba3aac2c928ce885d
|
185c7e7c6d26483c583466ba5c4ea789ed01eecd
|
/src/main/java/com/booknara/problem/hash/ContainsDuplicateII.java
|
acd9f4104cac5fee8c26a2baa1fd3d0f5fe8d207
|
[
"MIT"
] |
permissive
|
booknara/playground
|
49d92d450438f6e7912e85c82e010cc4f1631891
|
60e2097d00097956132688a404c4de3def19c549
|
refs/heads/master
| 2023-08-17T06:30:55.874388
| 2023-08-11T15:16:45
| 2023-08-11T15:16:45
| 226,968,158
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,806
|
java
|
package com.booknara.problem.hash;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* 219. Contains Duplicate II (Easy)
* https://leetcode.com/problems/contains-duplicate-ii/
*/
public class ContainsDuplicateII {
// 04/27/2020 version
public boolean containsNearbyDuplicate(int[] nums, int k) {
if (nums == null || nums.length == 0) {
return false;
}
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
int num = nums[i];
if (map.containsKey(num)) {
int diff = i - map.get(num);
// at most k btw previous and current index
if (diff <= k) {
return true;
}
}
map.put(num, i);
}
return false;
}
// 04/02/2020 version
public boolean containsNearbyDuplicate1(int[] nums, int k) {
if (nums == null || nums.length == 0) {
return false;
}
Set<Integer> set = new HashSet<>();
for (int i = 0; i < nums.length; i++) {
if (i > k) {
set.remove(nums[i - k - 1]);
}
if (!set.add(nums[i])) return true;
}
return false;
}
public boolean containsNearbyDuplicate2(int[] nums, int k) {
if (nums == null || nums.length == 0) {
return false;
}
Set<Integer> set = new HashSet<>();
for (int i = 0; i < nums.length; i++) {
int n = nums[i];
if (set.contains(n)) return true;
set.add(nums[i]);
if (set.size() > k) {
set.remove(nums[i - k]);
}
}
return false;
}
}
|
[
"bookdori81@gmail.com"
] |
bookdori81@gmail.com
|
0be92c719fb9e4a41f7464430f76028ce38d787d
|
dc81649732414dee4d552a240b25cb3d055799b1
|
/src/test/java/org/assertj/core/api/classes/ClassAssert_isProtected_Test.java
|
b198dea37505c01b5156488cd08860f1fdf3f55f
|
[
"Apache-2.0"
] |
permissive
|
darkliang/assertj-core
|
e40de697a5ac19db7a652178963a523dfe6f89ff
|
4a25dab7b99f292d158dc8118ac84dc7b4933731
|
refs/heads/integration
| 2021-05-16T23:22:49.013854
| 2020-05-31T12:36:31
| 2020-05-31T12:36:31
| 250,513,505
| 1
| 0
|
Apache-2.0
| 2020-06-02T09:25:54
| 2020-03-27T11:11:36
|
Java
|
UTF-8
|
Java
| false
| false
| 1,173
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2012-2020 the original author or authors.
*/
package org.assertj.core.api.classes;
import org.assertj.core.api.ClassAssert;
import org.assertj.core.api.ClassAssertBaseTest;
import static org.mockito.Mockito.verify;
/**
* Tests for <code>{@link ClassAssert#isProtected()} ()}</code>.
*/
public class ClassAssert_isProtected_Test extends ClassAssertBaseTest {
@Override
protected ClassAssert invoke_api_method() {
return assertions.isProtected();
}
@Override
protected void verify_internal_effects() {
verify(classes).assertIsProtected(getInfo(assertions), getActual(assertions));
}
}
|
[
"joel.costigliola@gmail.com"
] |
joel.costigliola@gmail.com
|
40651421e0b22363eae0edee894889a508c40b4a
|
ec3df9c3531330d5ab3284b5ded098917c92c10b
|
/src/main/java/com/microwise/uma/dao/impl/UserDaoImpl.java
|
f8c5cb719f677bbd251948f47b36820ac9635216
|
[] |
no_license
|
algsun/uma-daemon
|
b13f27867d0689efddb6c253d56b0ef5b3a0386d
|
77c4676d22292aa7a18e73fabbffa25d1e8aae5f
|
refs/heads/master
| 2020-03-16T01:08:16.502078
| 2018-05-07T09:01:46
| 2018-05-07T09:01:46
| 132,433,536
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,181
|
java
|
package com.microwise.uma.dao.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import com.microwise.uma.dao.BaseDao;
import com.microwise.uma.dao.UserDao;
import com.microwise.uma.po.UserPO;
/**
* 用户信息 Dao 实现
*
* @author li.jianfei
* @date 2013-08-21
*/
@Repository
@Scope("prototype")
public class UserDaoImpl extends BaseDao implements UserDao {
@Override
public List<String> getUserPhoto() {
return getSqlSession().selectList("mybatis.UserInfoDao.getUserPhoto");
}
@Override
public UserPO getUserInfo(long userId) {
return getSqlSession().selectOne("mybatis.UserInfoDao.getUserInfo",userId);
}
@Override
public List<String> getUserLocations(String zoneId, String exciterSn, String cardNO) {
Map<String, Object> paramMap= new HashMap<String, Object>();
paramMap.put("zoneId", zoneId);
paramMap.put("exciterSn", exciterSn);
paramMap.put("cardNO", cardNO);
return getSqlSession().selectList("mybatis.UserInfoDao.getUserLocations",paramMap);
}
}
|
[
"algtrue@163.com"
] |
algtrue@163.com
|
261cd17c8ce2b28b3bdae91e5af94c1dafcad6a2
|
c24e883bba5235840239de3bd5640d92e0c8db66
|
/commons/core/src/main/java/com/smart/website/common/core/utils/AesUtil.java
|
17f75ca4d3151a04c70934aa2c3c351bfa4d00b6
|
[] |
no_license
|
hotHeart48156/mallwebsite
|
12fe2f7d4e108ceabe89b82eacca75898d479357
|
ba865c7ea22955009e2de7b688038ddd8bc9febf
|
refs/heads/master
| 2022-11-23T23:22:28.967449
| 2020-01-07T15:27:27
| 2020-01-07T15:27:27
| 231,905,626
| 0
| 0
| null | 2022-11-15T23:54:56
| 2020-01-05T11:14:43
|
Java
|
UTF-8
|
Java
| false
| false
| 4,200
|
java
|
package com.smart.website.common.core.utils;
import lombok.experimental.UtilityClass;
import org.springframework.util.Assert;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.Charset;
import java.util.Arrays;
/**
* 完全兼容微信所使用的AES加密方式。
* aes的key必须是256byte长(比如32个字符),可以使用AesKit.genAesKey()来生成一组key
* <p>
* 参考自:jFinal AESKit,优化,方便使用
*
* @author L.cm
*/
@UtilityClass
public class AesUtil {
public static String genAesKey() {
return StringUtil.random(32);
}
public static byte[] encrypt(byte[] content, String aesTextKey) {
return encrypt(content, aesTextKey.getBytes(Charsets.UTF_8));
}
public static byte[] encrypt(String content, String aesTextKey) {
return encrypt(content.getBytes(Charsets.UTF_8), aesTextKey.getBytes(Charsets.UTF_8));
}
public static byte[] encrypt(String content, Charset charset, String aesTextKey) {
return encrypt(content.getBytes(charset), aesTextKey.getBytes(Charsets.UTF_8));
}
public static byte[] decrypt(byte[] content, String aesTextKey) {
return decrypt(content, aesTextKey.getBytes(Charsets.UTF_8));
}
public static String decryptToStr(byte[] content, String aesTextKey) {
return new String(decrypt(content, aesTextKey.getBytes(Charsets.UTF_8)), Charsets.UTF_8);
}
public static String decryptToStr(byte[] content, String aesTextKey, Charset charset) {
return new String(decrypt(content, aesTextKey.getBytes(Charsets.UTF_8)), charset);
}
public static byte[] encrypt(byte[] content, byte[] aesKey) {
Assert.isTrue(aesKey.length == 32, "IllegalAesKey, aesKey's length must be 32");
try {
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES");
IvParameterSpec iv = new IvParameterSpec(aesKey, 0, 16);
cipher.init(Cipher.ENCRYPT_MODE, keySpec, iv);
return cipher.doFinal(Pkcs7Encoder.encode(content));
} catch (Exception e) {
throw Exceptions.unchecked(e);
}
}
public static byte[] decrypt(byte[] encrypted, byte[] aesKey) {
Assert.isTrue(aesKey.length == 32, "IllegalAesKey, aesKey's length must be 32");
try {
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
SecretKeySpec keySpec = new SecretKeySpec(aesKey, "AES");
IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16));
cipher.init(Cipher.DECRYPT_MODE, keySpec, iv);
return Pkcs7Encoder.decode(cipher.doFinal(encrypted));
} catch (Exception e) {
throw Exceptions.unchecked(e);
}
}
/**
* 提供基于PKCS7算法的加解密接口.
*/
private static class Pkcs7Encoder {
private static int BLOCK_SIZE = 32;
private static byte[] encode(byte[] src) {
int count = src.length;
// 计算需要填充的位数
int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
if (amountToPad == 0) {
amountToPad = BLOCK_SIZE;
}
// 获得补位所用的字符
byte pad = (byte) (amountToPad & 0xFF);
byte[] pads = new byte[amountToPad];
for (int index = 0; index < amountToPad; index++) {
pads[index] = pad;
}
int length = count + amountToPad;
byte[] dest = new byte[length];
System.arraycopy(src, 0, dest, 0, count);
System.arraycopy(pads, 0, dest, count, amountToPad);
return dest;
}
private static byte[] decode(byte[] decrypted) {
int pad = decrypted[decrypted.length - 1];
if (pad < 1 || pad > BLOCK_SIZE) {
pad = 0;
}
if (pad > 0) {
return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad);
}
return decrypted;
}
}
}
|
[
"2680323775@qq.com"
] |
2680323775@qq.com
|
cdd861f23c4e770a1f8d41b91b8826637266fa7f
|
09171166d8be8e35a4b6dbde8beacd27460dabbb
|
/lib/src/main/java/com/dyh/common/lib/weigit/seekbar/BubbleUtils.java
|
e23ccb5d3d060f3670489fc93201073d2486dd8b
|
[
"Apache-2.0"
] |
permissive
|
dongyonghui/CommonLib
|
d51c99f15258e54344fed6dfdacc0c3aa0c08017
|
a57fb995898644bb7b4bcd259417aca1e11944c9
|
refs/heads/master
| 2021-07-20T06:58:19.536087
| 2021-01-11T09:05:26
| 2021-01-11T09:05:26
| 233,981,794
| 12
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,105
|
java
|
package com.dyh.common.lib.weigit.seekbar;
import android.content.res.Resources;
import android.os.Build;
import android.os.Environment;
import android.text.TextUtils;
import android.util.TypedValue;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Properties;
class BubbleUtils {
private static final String KEY_MIUI_MANE = "ro.miui.ui.version.name";
private static Properties sProperties = new Properties();
private static Boolean miui;
static boolean isMIUI() {
if (miui != null) {
return miui;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
FileInputStream fis = null;
try {
fis = new FileInputStream(new File(Environment.getRootDirectory(), "build.prop"));
sProperties.load(fis);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
miui = sProperties.containsKey(KEY_MIUI_MANE);
} else {
Class<?> clazz;
try {
clazz = Class.forName("android.os.SystemProperties");
Method getMethod = clazz.getDeclaredMethod("get", String.class);
String name = (String) getMethod.invoke(null, KEY_MIUI_MANE);
miui = !TextUtils.isEmpty(name);
} catch (Exception e) {
miui = false;
}
}
return miui;
}
static int dp2px(int dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
Resources.getSystem().getDisplayMetrics());
}
static int sp2px(int sp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
Resources.getSystem().getDisplayMetrics());
}
}
|
[
"648731994@qq.com"
] |
648731994@qq.com
|
5a13cfcf8843f0874625b3d5cbccc715a2a7ac81
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/8/8_c38bc9a111085c0d65bf606e9c72650f4fdb9f76/CollisionDetectionWorker/8_c38bc9a111085c0d65bf606e9c72650f4fdb9f76_CollisionDetectionWorker_t.java
|
5bdab216dc87cf7c094eff7ba055f1e04fb3c128
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 3,805
|
java
|
package com.github.joukojo.testgame;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.joukojo.testgame.world.core.Moveable;
import com.github.joukojo.testgame.world.core.WorldCore;
import com.github.joukojo.testgame.world.core.WorldCoreFactory;
public class CollisionDetectionWorker implements Runnable {
private final static Logger LOG = LoggerFactory.getLogger(CollisionDetectionWorker.class);
private volatile boolean isRunning;
@Override
public void run() {
final WorldCore worldCore = WorldCoreFactory.getWorld();
setRunning(true);
while (isRunning()) {
handleBulletCollisions(worldCore);
handlePlayerCollisions(worldCore);
Thread.yield();
}
}
private void handleBulletCollisions(final WorldCore worldCore) {
final List<Moveable> bullets = worldCore.getMoveableObjects(Constants.BULLETS);
if (bullets != null && !bullets.isEmpty()) {
for (final Moveable moveableBullet : bullets) {
final Bullet bullet = (Bullet) moveableBullet;
isBulletInCollisionWithMonster(worldCore, bullet);
}
}
}
private void handlePlayerCollisions(final WorldCore worldCore) {
final Player player = (Player) worldCore.getMoveable(Constants.PLAYER);
final List<Moveable> monsters = worldCore.getMoveableObjects(Constants.MONSTERS);
for (final Moveable moveable : monsters) {
final Monster monster = (Monster) moveable;
if (monster != null && !monster.isDestroyed() && player != null) {
isPlayerAndMonsterInCollision(worldCore, player, monster);
}
}
}
private void isBulletInCollisionWithMonster(final WorldCore worldCore, final Bullet bullet) {
final List<Moveable> monsters = worldCore.getMoveableObjects(Constants.MONSTERS);
if (monsters != null && !monsters.isEmpty()) {
for (final Moveable moveableMonster : monsters) {
final Monster monster = (Monster) moveableMonster;
if (monster != null && bullet != null) {
isBulletAndMonsterInCollision(worldCore, bullet, monster);
}
}
}
}
private void isBulletAndMonsterInCollision(final WorldCore worldCore, final Bullet bullet, final Monster monster) {
if (!monster.isDestroyed() && !bullet.isDestroyed()) {
// correct the monster location
final int monsterRealX = monster.getLocationX() + 34;
final int monsterRealY = monster.getLocationY() + 34;
final int deltaX = Math.abs(bullet.getLocationX() - monsterRealX);
final int deltaY = Math.abs(bullet.getLocationY() - monsterRealY);
if (LOG.isTraceEnabled()) {
LOG.trace("deltaX {}", deltaX);
LOG.trace("deltaY {}", deltaY);
}
if (deltaX < 30 && deltaY < 30) {
LOG.debug("we have a hit");
monster.setDestroyed(true);
bullet.setDestroyed(true);
final Player player = (Player) worldCore.getMoveable(Constants.PLAYER);
player.setScore(player.getScore() + 100);
}
}
}
private void isPlayerAndMonsterInCollision(final WorldCore worldCore, final Player player, final Monster monster) {
if (!monster.isDestroyed()) {
// correct the monster location
final int monsterRealX = monster.getLocationX() + 34;
final int monsterRealY = monster.getLocationY() + 13;
final int deltaX = Math.abs(player.getPositionX() - monsterRealX);
final int deltaY = Math.abs(player.getPositionY() - monsterRealY);
LOG.trace("deltaX {}", deltaX);
LOG.trace("deltaY {}", deltaY);
if (deltaX < 20 && deltaY < 20) {
LOG.debug("we have a hit with monster");
monster.setDestroyed(true);
player.setHealth(player.getHealth() - 1);
}
}
}
public boolean isRunning() {
return isRunning;
}
public void setRunning(final boolean isRunning) {
this.isRunning = isRunning;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
31f7f3c0743fd3a2f5b046057ef7e4e9c01cf58f
|
aaabffe8bf55973bfb1390cf7635fd00ca8ca945
|
/src/main/java/com/microsoft/graph/requests/generated/BaseWorkbookFunctionsNorm_InvRequestBuilder.java
|
d2859ad21b125be39e7687f3aa1ee8786457c863
|
[
"MIT"
] |
permissive
|
rgrebski/msgraph-sdk-java
|
e595e17db01c44b9c39d74d26cd925b0b0dfe863
|
759d5a81eb5eeda12d3ed1223deeafd108d7b818
|
refs/heads/master
| 2020-03-20T19:41:06.630857
| 2018-03-16T17:31:43
| 2018-03-16T17:31:43
| 137,648,798
| 0
| 0
| null | 2018-06-17T11:07:06
| 2018-06-17T11:07:05
| null |
UTF-8
|
Java
| false
| false
| 3,104
|
java
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.generated;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.models.extensions.*;
import com.microsoft.graph.models.generated.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.requests.extensions.*;
import com.microsoft.graph.requests.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.EnumSet;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Base Workbook Functions Norm_Inv Request Builder.
*/
public class BaseWorkbookFunctionsNorm_InvRequestBuilder extends BaseActionRequestBuilder {
/**
* The request builder for this WorkbookFunctionsNorm_Inv
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
* @param probability the probability
* @param mean the mean
* @param standardDev the standardDev
*/
public BaseWorkbookFunctionsNorm_InvRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends Option> requestOptions, final com.google.gson.JsonElement probability, final com.google.gson.JsonElement mean, final com.google.gson.JsonElement standardDev) {
super(requestUrl, client, requestOptions);
bodyParams.put("probability", probability);
bodyParams.put("mean", mean);
bodyParams.put("standardDev", standardDev);
}
/**
* Creates the IWorkbookFunctionsNorm_InvRequest
*
* @return the IWorkbookFunctionsNorm_InvRequest instance
*/
public IWorkbookFunctionsNorm_InvRequest buildRequest() {
return buildRequest(getOptions());
}
/**
* Creates the IWorkbookFunctionsNorm_InvRequest with specific requestOptions instead of the existing requestOptions
*
* @param requestOptions the options for the request
* @return the IWorkbookFunctionsNorm_InvRequest instance
*/
public IWorkbookFunctionsNorm_InvRequest buildRequest(final java.util.List<? extends Option> requestOptions) {
WorkbookFunctionsNorm_InvRequest request = new WorkbookFunctionsNorm_InvRequest(
getRequestUrl(),
getClient(),
requestOptions
);
if (hasParameter("probability")) {
request.body.probability = getParameter("probability");
}
if (hasParameter("mean")) {
request.body.mean = getParameter("mean");
}
if (hasParameter("standardDev")) {
request.body.standardDev = getParameter("standardDev");
}
return request;
}
}
|
[
"caitbal@microsoft.com"
] |
caitbal@microsoft.com
|
26313b4943ad0b25585e2eb83aae56c64f465868
|
1a32d704493deb99d3040646afbd0f6568d2c8e7
|
/BOOT-INF/lib/com/google/common/collect/SortedIterables.java
|
ac908190db1e50d6f6d8c4bb4f74f801ae1c9ea3
|
[] |
no_license
|
yanrumei/bullet-zone-server-2.0
|
e748ff40f601792405143ec21d3f77aa4d34ce69
|
474c4d1a8172a114986d16e00f5752dc019cdcd2
|
refs/heads/master
| 2020-05-19T11:16:31.172482
| 2019-03-25T17:38:31
| 2019-03-25T17:38:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,828
|
java
|
/* */ package com.google.common.collect;
/* */
/* */ import com.google.common.annotations.GwtCompatible;
/* */ import com.google.common.base.Preconditions;
/* */ import java.util.Comparator;
/* */ import java.util.SortedSet;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GwtCompatible
/* */ final class SortedIterables
/* */ {
/* */ public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements)
/* */ {
/* 37 */ Preconditions.checkNotNull(comparator);
/* 38 */ Preconditions.checkNotNull(elements);
/* */ Comparator<?> comparator2;
/* 40 */ if ((elements instanceof SortedSet)) {
/* 41 */ comparator2 = comparator((SortedSet)elements); } else { Comparator<?> comparator2;
/* 42 */ if ((elements instanceof SortedIterable)) {
/* 43 */ comparator2 = ((SortedIterable)elements).comparator();
/* */ } else
/* 45 */ return false; }
/* */ Comparator<?> comparator2;
/* 47 */ return comparator.equals(comparator2);
/* */ }
/* */
/* */
/* */ public static <E> Comparator<? super E> comparator(SortedSet<E> sortedSet)
/* */ {
/* 53 */ Comparator<? super E> result = sortedSet.comparator();
/* 54 */ if (result == null) {
/* 55 */ result = Ordering.natural();
/* */ }
/* 57 */ return result;
/* */ }
/* */ }
/* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\guava-22.0.jar!\com\google\common\collect\SortedIterables.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/
|
[
"ishankatwal@gmail.com"
] |
ishankatwal@gmail.com
|
eac7bf9c8c128ef1cfb0aafc7c32faa1ed13944a
|
44abee7981ec47704f59d0cb9345efc4b909ad4f
|
/src/chap18/lecture/outputstream/OutputStreamEx2.java
|
e0544fbea82ad30ad2c9a7012a0f3cd43e48b4cb
|
[] |
no_license
|
hyojjjin/java20200929
|
ad24e96c2c3837f695951be783c59418559eceee
|
8a2d7b34bc814465c83ae0efa0bd59f29205c738
|
refs/heads/master
| 2023-03-11T22:56:51.890496
| 2021-03-02T01:08:15
| 2021-03-02T01:08:15
| 299,485,576
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 623
|
java
|
package chap18.lecture.outputstream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
public class OutputStreamEx2 {
public static void main(String[] args) throws Exception {
String source = "도망쳐파이리.png";
String copy = "도망쳐파이리-copy.png";
InputStream is = new FileInputStream(source);
OutputStream os = new FileOutputStream(copy);
int b = 0;
while((b = is.read()) != -1) {
os.write(b);
}
System.out.println("복사 완료");
is.close();
os.close();
}
}
|
[
"hjjin2_@naver.com"
] |
hjjin2_@naver.com
|
6a0198f87fec8847d6e6fc7970e958098fad0fb9
|
195d28f3af6b54e9859990c7d090f76ce9c49983
|
/issac-security-core/src/main/java/com/issac/security/core/authentication/AbstractChannelSecurityConfig.java
|
dbe67ba8112d1c739bbf4f13cabc75123b623205
|
[] |
no_license
|
IssacYoung2013/security
|
a00aa95b7c385937aa1add882d499db91f693253
|
00564b7f1406638cf4fb4cf89d46e1d65e566f1a
|
refs/heads/master
| 2020-04-18T21:28:00.116411
| 2019-01-29T01:27:27
| 2019-01-29T01:27:27
| 167,765,923
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,280
|
java
|
package com.issac.security.core.authentication;
import com.issac.security.core.constants.SecurityConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
/**
*
* author: ywy
* date: 2019-01-27
* desc:
*/
public class AbstractChannelSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
protected AuthenticationSuccessHandler issacAuthenticationSuccessHandler;
@Autowired
protected AuthenticationFailureHandler issacAuthenticationFailureHandler;
protected void applyPasswordAuthenticationConfig(HttpSecurity http) throws Exception {
http.formLogin()
.loginPage(SecurityConstants.DEFAULT_UNAUTHENTICATION_URL)
.loginProcessingUrl(SecurityConstants.DEFAULT_LOGIN_PROCESSING_URL_FORM)
.successHandler(issacAuthenticationSuccessHandler)
.failureHandler(issacAuthenticationFailureHandler);
}
}
|
[
"issacyoung@msn.cn"
] |
issacyoung@msn.cn
|
ea5f37853784fc8db604ed9a2d09be75aa9d1ede
|
9e2962186dae3467ed220d10e500081b239428ae
|
/myblog/src/test/java/com/regisprojects/myblog/myblog/MyblogApplicationTests.java
|
023470714e5087495bb225e6925062ff4549dc95
|
[] |
no_license
|
regisPatrick/NetBeansProjects
|
a227de47b364445f630dee2fcc506c02dd05395d
|
cb24b978e3e8c1c01ea477d723b10e116e188faa
|
refs/heads/master
| 2022-06-24T20:50:07.472400
| 2021-04-12T01:01:02
| 2021-04-12T01:01:02
| 246,128,238
| 0
| 0
| null | 2022-06-21T03:46:57
| 2020-03-09T19:50:41
|
HTML
|
UTF-8
|
Java
| false
| false
| 223
|
java
|
package com.regisprojects.myblog.myblog;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MyblogApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"regis86@hotmail.com"
] |
regis86@hotmail.com
|
532d06249483b8acc490cf2f95aca99a75193b6b
|
e830de2981f0aa2ec32fb57edebcd76ae792c965
|
/src/main/java/dz/elit/clinique/repository/CliniqueRepository.java
|
aaa80accd12e390433575be93ff59de0daad2d01
|
[] |
no_license
|
hayadi/clinique-manager
|
a4dc9283618b3e2dc08c60babbc553aa90561f2d
|
7560753b4d684f829ad8ff46580f2e78a86be99d
|
refs/heads/master
| 2022-12-25T06:59:11.996328
| 2019-10-09T14:00:35
| 2019-10-09T14:00:35
| 213,931,072
| 0
| 0
| null | 2022-12-16T05:06:14
| 2019-10-09T13:49:14
|
Java
|
UTF-8
|
Java
| false
| false
| 1,120
|
java
|
package dz.elit.clinique.repository;
import dz.elit.clinique.domain.Clinique;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
/**
* Spring Data repository for the Clinique entity.
*/
@Repository
public interface CliniqueRepository extends JpaRepository<Clinique, Long> {
@Query(value = "select distinct clinique from Clinique clinique left join fetch clinique.medecins",
countQuery = "select count(distinct clinique) from Clinique clinique")
Page<Clinique> findAllWithEagerRelationships(Pageable pageable);
@Query("select distinct clinique from Clinique clinique left join fetch clinique.medecins")
List<Clinique> findAllWithEagerRelationships();
@Query("select clinique from Clinique clinique left join fetch clinique.medecins where clinique.id =:id")
Optional<Clinique> findOneWithEagerRelationships(@Param("id") Long id);
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
969babc9c9b0cb1ff698dd3dc9dd31f9b5d1a76e
|
c5ca82622d155ca142cebe93b12882992e93b1f6
|
/src/com/geocento/webapps/earthimages/emis/common/share/entities/ORDER_STATUS.java
|
6670d72ab9d6c38dbe177f58f56efec8d6af5d16
|
[] |
no_license
|
leforthomas/EMIS
|
8721a6c21ad418380e1f448322fa5c8c51e33fc0
|
32e58148eca1e18fd21aa583831891bc26d855b1
|
refs/heads/master
| 2020-05-17T08:54:22.044423
| 2019-04-29T20:45:24
| 2019-04-29T20:45:24
| 183,617,011
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 843
|
java
|
package com.geocento.webapps.earthimages.emis.common.share.entities;
public enum ORDER_STATUS {
// user requested the products in the order
REQUESTED,
// supplier rejected the request
CANCELLED,
// supplier quoted the request
QUOTED,
// user rejected the quote
QUOTEREJECTED,
// user accepted and paid the quote
ACCEPTED,
// products are being generated
INPRODUCTION,
// failed to produce the order
FAILED,
// order has been completed and products are available
COMPLETED,
// order has been archived and products have been delivered and are not downloadable anymore
DELIVERED,
//The order has been closed or archived by the user, not possible to add more products
ARCHIVED
};
|
[
"leforthomas@gmail.com"
] |
leforthomas@gmail.com
|
c1cd6afd2068dd6328edb9b2b4c342165a037fb6
|
2b53d9754066a8594f8a839589022893969abf36
|
/src/main/java/mekanism/common/network/PacketUpdateTile.java
|
ed9ecdbdaed5171df6a289df9a3f8996fa86860d
|
[
"MIT"
] |
permissive
|
Dolbaeobik/Mekanism
|
6ccf298e336765144a6139ce72104b7a04a59aec
|
ce8ab6f5240f35f33bf1b3b8145ccaea5c1fde40
|
refs/heads/master
| 2022-04-25T07:04:47.641641
| 2020-04-23T16:24:31
| 2020-04-23T16:24:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,903
|
java
|
package mekanism.common.network;
import java.util.function.Supplier;
import mekanism.common.Mekanism;
import mekanism.common.tile.base.TileEntityUpdateable;
import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.network.NetworkEvent.Context;
public class PacketUpdateTile {
private final CompoundNBT updateTag;
private final BlockPos pos;
public PacketUpdateTile(TileEntityUpdateable tile) {
this(tile.getPos(), tile.getReducedUpdateTag());
}
private PacketUpdateTile(BlockPos pos, CompoundNBT updateTag) {
this.pos = pos;
this.updateTag = updateTag;
}
public static void handle(PacketUpdateTile message, Supplier<Context> context) {
PlayerEntity player = BasePacketHandler.getPlayer(context);
if (player == null) {
return;
}
context.get().enqueueWork(() -> {
TileEntityUpdateable tile = MekanismUtils.getTileEntity(TileEntityUpdateable.class, player.world, message.pos, true);
if (tile == null) {
Mekanism.logger.warn("Update tile packet received for position: {} in world: {}, but no valid tile was found.", message.pos,
player.world.getDimension().getType().getRegistryName());
} else {
tile.handleUpdatePacket(message.updateTag);
}
});
context.get().setPacketHandled(true);
}
public static void encode(PacketUpdateTile pkt, PacketBuffer buf) {
buf.writeBlockPos(pkt.pos);
buf.writeCompoundTag(pkt.updateTag);
}
public static PacketUpdateTile decode(PacketBuffer buf) {
return new PacketUpdateTile(buf.readBlockPos(), buf.readCompoundTag());
}
}
|
[
"richard@freimer.com"
] |
richard@freimer.com
|
1c54ffa1170452d3d8f34f4636040827218771c2
|
b2bc60c46b46b2693369c65df372270861554a67
|
/src/com/company/collection/CollectionGenericTest.java
|
7e1d4bdef452d1c82aadc517957cc79b73404379
|
[] |
no_license
|
SuFarther/JavaProject
|
b4bf0fb3d094044240221af67049b180aae94e09
|
d1dd5c764ecd8a5b24ed8a1e0de7478a160a511b
|
refs/heads/master
| 2023-07-15T17:50:44.915482
| 2021-08-28T04:43:07
| 2021-08-28T04:43:07
| 390,173,245
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,739
|
java
|
package com.company.collection;
import java.util.ArrayList;
/**
* @author 苏东坡
* @version 1.0
* @ClassName CollectionGenericTest
* @company 公司
* @Description Collection下面的实现类ArrayList实现泛型作用
* (1)JDK1.5以后
* (2) 泛型实际就是一个<>引起来的参数类型,这个参数类型具体在使用的时候才可以确定具体的类型
* (3) 使用了泛型以后,可以确定集合中存放的类型,在编译时期,就可以检查出来
* (4) 使用泛型你可能觉得麻烦,实际使用了泛型后才会简单,后期的遍历操作简单
* (5) 泛型的类型,但是引用数据类型,不是基本数据类型
* (6) ArrayList<Integer> al = el ArrayList<Integer>(); 在JDK1.7后ArrayList<Integer> al = el ArrayList<>();
* @createTime 2021年08月10日 06:49:49
*/
public class CollectionGenericTest {
public static void main(String[] args) {
//加入泛型限制数据的类型
ArrayList al = new ArrayList();
al.add(80);
al.add(30);
al.add(20);
al.add("哈哈");
al.add(9.5);
for (Object obj : al){
System.out.println(obj);
}
System.out.println("没有使用泛型之前的集合al为 :" +al);
System.out.println("-------------------------");
// ArrayList<Integer> al2 = new ArrayList<Integer>();
ArrayList<Integer> al2 = new ArrayList<>();
al2.add(10);
al2.add(30);
al2.add(40);
al2.add(10);
// al2.add("哈哈"); //报错,不是Integer指定的类型
for (Integer i:al2){
System.out.println(i);
}
System.out.println("没有使用泛型之前的集合al2为 :" +al2);
}
}
|
[
"2257346739@qq.com"
] |
2257346739@qq.com
|
ebafc2ea1a6b52483546882b3ff6196dcb837e7f
|
2a2c4469b2350c9d455754e7eaf7216bd5a46047
|
/container/container-api/src/main/java/liquid/container/domain/ContainerStatus.java
|
09f866207f5202591ab930a5ce6362a0022a864e
|
[
"Apache-2.0"
] |
permissive
|
woakes070048/liquid
|
51bd790c4317ea14445d392c915194fa1821defe
|
856749db3e9f0faa4226949830ea4979dbb7d804
|
refs/heads/master
| 2020-12-13T11:25:23.707668
| 2016-10-07T12:37:44
| 2016-10-07T12:37:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 551
|
java
|
package liquid.container.domain;
/**
*
* User: tao
* Date: 10/3/13
* Time: 4:26 PM
*/
public enum ContainerStatus {
IN_STOCK(0, "container.in.stock"),
ALLOCATED(1, "container.allocated"),
LOADED(2, "container.loaded");
private final int value;
private final String i18nKey;
private ContainerStatus(int value, String i18nKey) {
this.value = value;
this.i18nKey = i18nKey;
}
public int getValue() {
return value;
}
public String getI18nKey() {
return i18nKey;
}
}
|
[
"redbrick9@gmail.com"
] |
redbrick9@gmail.com
|
1d6bbb79840496fde009467a01c52bb5ff9e5f87
|
3ebaee3a565d5e514e5d56b44ebcee249ec1c243
|
/assetBank 3.77 decomplied fixed/src/java/com/bright/assetbank/attribute/action/MoveListValueAction.java
|
d34a3f1b0b196cee5b913a6eb59d99f37aedd0ad
|
[] |
no_license
|
webchannel-dev/Java-Digital-Bank
|
89032eec70a1ef61eccbef6f775b683087bccd63
|
65d4de8f2c0ce48cb1d53130e295616772829679
|
refs/heads/master
| 2021-10-08T19:10:48.971587
| 2017-11-07T09:51:17
| 2017-11-07T09:51:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,428
|
java
|
/* */ package com.bright.assetbank.attribute.action;
/* */
/* */ import com.bn2web.common.action.Bn2Action;
/* */ import com.bright.assetbank.attribute.form.ListAttributeForm;
/* */ import com.bright.assetbank.attribute.service.AttributeValueManager;
/* */ import com.bright.assetbank.user.bean.ABUserProfile;
/* */ import com.bright.framework.user.bean.UserProfile;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.commons.logging.Log;
/* */ import org.apache.struts.action.ActionForm;
/* */ import org.apache.struts.action.ActionForward;
/* */ import org.apache.struts.action.ActionMapping;
/* */
/* */ public class MoveListValueAction extends Bn2Action
/* */ {
/* 44 */ private AttributeValueManager m_attributeValueManager = null;
/* */
/* */ public ActionForward execute(ActionMapping a_mapping, ActionForm a_form, HttpServletRequest a_request, HttpServletResponse a_response)
/* */ throws Exception
/* */ {
/* 62 */ ActionForward afForward = null;
/* 63 */ ListAttributeForm form = (ListAttributeForm)a_form;
/* 64 */ ABUserProfile userProfile = (ABUserProfile)UserProfile.getUserProfile(a_request.getSession());
/* */
/* 67 */ if (!userProfile.getIsAdmin())
/* */ {
/* 69 */ this.m_logger.debug("This user does not have permission to view the admin pages");
/* 70 */ return a_mapping.findForward("NoPermission");
/* */ }
/* */
/* 73 */ long lAttributeValueId = getLongParameter(a_request, "id");
/* 74 */ boolean bMoveUp = new Boolean(a_request.getParameter("up")).booleanValue();
/* */
/* 76 */ this.m_attributeValueManager.moveListAttributeValue(null, lAttributeValueId, bMoveUp);
/* */
/* 78 */ form.setValue(this.m_attributeValueManager.getListAttributeValue(null, lAttributeValueId));
/* */
/* 80 */ afForward = a_mapping.findForward("Success");
/* */
/* 82 */ return afForward;
/* */ }
/* */
/* */ public void setAttributeValueManager(AttributeValueManager a_attributeValueManager)
/* */ {
/* 87 */ this.m_attributeValueManager = a_attributeValueManager;
/* */ }
/* */ }
/* Location: C:\Users\mamatha\Desktop\com.zip
* Qualified Name: com.bright.assetbank.attribute.action.MoveListValueAction
* JD-Core Version: 0.6.0
*/
|
[
"42003122+code7885@users.noreply.github.com"
] |
42003122+code7885@users.noreply.github.com
|
cd3946b0a5f44b12f541e81e9b3509ce973e43fa
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava17/Foo147.java
|
e73a11364a84b5170ff24c931c7a57b310db4d72
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 348
|
java
|
package applicationModulepackageJava17;
public class Foo147 {
public void foo0() {
new applicationModulepackageJava17.Foo146().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
d5b59aa07805e8dcf02e90803fdf8ecfbc4d6db1
|
896c39c14831c93457476671fdda540a3ef990fa
|
/kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/core/v1/EndpointAddress.java
|
27213a4c60fe443f4dc049c81add0295f1d71199
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] |
permissive
|
manusa/yakc
|
341e4b86e7fd4fa298f255c69dd26d7e3e3f3463
|
7e7ac99aa393178b9d0d86db22039a6dada5107c
|
refs/heads/master
| 2023-07-20T04:53:42.421609
| 2023-07-14T10:09:48
| 2023-07-14T10:09:48
| 252,927,434
| 39
| 15
|
Apache-2.0
| 2023-07-13T15:01:10
| 2020-04-04T06:37:03
|
Java
|
UTF-8
|
Java
| false
| false
| 1,767
|
java
|
/*
* Copyright 2020 Marc Nuri
*
* 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.marcnuri.yakc.model.io.k8s.api.core.v1;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;
/**
* EndpointAddress is a tuple that describes single IP address.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class EndpointAddress implements Model {
/**
* The Hostname of this endpoint
*/
@JsonProperty("hostname")
private String hostname;
/**
* The IP of this endpoint. May not be loopback (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 or fe80::/10), or link-local multicast (224.0.0.0/24 or ff02::/16).
*/
@NonNull
@JsonProperty("ip")
private String ip;
/**
* Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
*/
@JsonProperty("nodeName")
private String nodeName;
@JsonProperty("targetRef")
private ObjectReference targetRef;
}
|
[
"marc@marcnuri.com"
] |
marc@marcnuri.com
|
e0a493cb2bee4abe2377938f763b0074554e95fb
|
54f352a242a8ad6ff5516703e91da61e08d9a9e6
|
/Source Codes/AtCoder/abc066/B/4388320.java
|
2fe6051a74f244f89dae19ff32c750cb335b5726
|
[] |
no_license
|
Kawser-nerd/CLCDSA
|
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
|
aee32551795763b54acb26856ab239370cac4e75
|
refs/heads/master
| 2022-02-09T11:08:56.588303
| 2022-01-26T18:53:40
| 2022-01-26T18:53:40
| 211,783,197
| 23
| 9
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 552
|
java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String po=sc.nextLine();
if(po.length()%2==1)po=po.substring(0,po.length()-1);
else po=po.substring(0,po.length()-2);
while(po.length()!=0){
if(po.substring(0,po.length()/2).equals(po.substring(po.length()/2,po.length())))break;
else if (po.length()==2)po="";
else po=po.substring(0,po.length()-2);
}
System.out.println(po.length());
}
}
|
[
"kwnafi@yahoo.com"
] |
kwnafi@yahoo.com
|
3bdec83e22447b5701c7541aa8677f57f4a06840
|
e75be673baeeddee986ece49ef6e1c718a8e7a5d
|
/submissions/blizzard/Corpus/eclipse.jdt.ui/203.java
|
376e8814421f4d9030183507b58986c860b7cc2a
|
[
"MIT"
] |
permissive
|
zhendong2050/fse18
|
edbea132be9122b57e272a20c20fae2bb949e63e
|
f0f016140489961c9e3c2e837577f698c2d4cf44
|
refs/heads/master
| 2020-12-21T11:31:53.800358
| 2018-07-23T10:10:57
| 2018-07-23T10:10:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 153
|
java
|
package p;
class A<T> {
}
class Outer {
class B extends A<T> {
/**
* comment
*/
void f() {
}
}
}
|
[
"tim.menzies@gmail.com"
] |
tim.menzies@gmail.com
|
2cc8f7f4e0fcb215109c3bebb1a7099a0e6120bd
|
d66be5471ac454345de8f118ab3aa3fe55c0e1ee
|
/providers/slicehost/src/main/java/org/jclouds/slicehost/compute/strategy/SlicehostLifeCycleStrategy.java
|
6a3b01b35764089564843263acd97ec2157d62b4
|
[
"Apache-2.0"
] |
permissive
|
adiantum/jclouds
|
3405b8daf75b8b45e95a24ff64fda6dc3eca9ed6
|
1cfbdf00f37fddf04249feedd6fc18ee122bdb72
|
refs/heads/master
| 2021-01-18T06:02:46.877904
| 2011-04-05T07:14:18
| 2011-04-05T07:14:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,097
|
java
|
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
package org.jclouds.slicehost.compute.strategy;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
import org.jclouds.compute.strategy.RebootNodeStrategy;
import org.jclouds.compute.strategy.ResumeNodeStrategy;
import org.jclouds.compute.strategy.SuspendNodeStrategy;
import org.jclouds.slicehost.SlicehostClient;
/**
*
* @author Adrian Cole
*/
@Singleton
public class SlicehostLifeCycleStrategy implements RebootNodeStrategy, SuspendNodeStrategy, ResumeNodeStrategy {
private final SlicehostClient client;
private final GetNodeMetadataStrategy getNode;
@Inject
protected SlicehostLifeCycleStrategy(SlicehostClient client, GetNodeMetadataStrategy getNode) {
this.client = client;
this.getNode = getNode;
}
@Override
public NodeMetadata rebootNode(String id) {
int sliceId = Integer.parseInt(id);
client.hardRebootSlice(sliceId);
return getNode.getNode(id);
}
@Override
public NodeMetadata suspendNode(String id) {
throw new UnsupportedOperationException("suspend not supported");
}
@Override
public NodeMetadata resumeNode(String id) {
throw new UnsupportedOperationException("resume not supported");
}
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
bdd1d4a32a09d7735820ddc502185c79aab0363f
|
d5515553d071bdca27d5d095776c0e58beeb4a9a
|
/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractConnection.java
|
fa0ec74e26f56af480b675e877d0c1e5bde48a2f
|
[] |
no_license
|
ccamel/plantuml
|
29dfda0414a3dbecc43696b63d4dadb821719489
|
3100d49b54ee8e98537051e071915e2060fe0b8e
|
refs/heads/master
| 2022-07-07T12:03:37.351931
| 2016-12-14T21:01:03
| 2016-12-14T21:01:03
| 77,067,872
| 1
| 0
| null | 2022-05-30T09:56:21
| 2016-12-21T16:26:58
|
Java
|
UTF-8
|
Java
| false
| false
| 1,577
|
java
|
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* 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.activitydiagram3.ftile;
public abstract class AbstractConnection implements Connection {
private final Ftile ftile1;
private final Ftile ftile2;
public AbstractConnection(Ftile ftile1, Ftile ftile2) {
this.ftile1 = ftile1;
this.ftile2 = ftile2;
}
@Override
public String toString() {
return "[" + ftile1 + "]->[" + ftile2 + "]";
}
final public Ftile getFtile1() {
return ftile1;
}
final public Ftile getFtile2() {
return ftile2;
}
}
|
[
"plantuml@gmail.com"
] |
plantuml@gmail.com
|
f52ac5e43882b6cc0a8e031d42dde04fb66a34a1
|
45736204805554b2d13f1805e47eb369a8e16ec3
|
/net/minecraft/creativetab/CreativeTabs.java
|
1f0140d9dc24d19a710d31becf13d39160504ab1
|
[] |
no_license
|
KrOySi/ArchWare-Source
|
9afc6bfcb1d642d2da97604ddfed8048667e81fd
|
46cdf10af07341b26bfa704886299d80296320c2
|
refs/heads/main
| 2022-07-30T02:54:33.192997
| 2021-08-08T23:36:39
| 2021-08-08T23:36:39
| 394,089,144
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,002
|
java
|
/*
* Decompiled with CFR 0.150.
*
* Could not load the following classes:
* javax.annotation.Nullable
*/
package net.minecraft.creativetab;
import javax.annotation.Nullable;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.enchantment.EnumEnchantmentType;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.PotionTypes;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionUtils;
import net.minecraft.util.NonNullList;
public abstract class CreativeTabs {
public static final CreativeTabs[] CREATIVE_TAB_ARRAY = new CreativeTabs[12];
public static final CreativeTabs BUILDING_BLOCKS = new CreativeTabs(0, "buildingBlocks"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Item.getItemFromBlock(Blocks.BRICK_BLOCK));
}
};
public static final CreativeTabs DECORATIONS = new CreativeTabs(1, "decorations"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Item.getItemFromBlock(Blocks.DOUBLE_PLANT), 1, BlockDoublePlant.EnumPlantType.PAEONIA.getMeta());
}
};
public static final CreativeTabs REDSTONE = new CreativeTabs(2, "redstone"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.REDSTONE);
}
};
public static final CreativeTabs TRANSPORTATION = new CreativeTabs(3, "transportation"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Item.getItemFromBlock(Blocks.GOLDEN_RAIL));
}
};
public static final CreativeTabs MISC = new CreativeTabs(6, "misc"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.LAVA_BUCKET);
}
};
public static final CreativeTabs SEARCH = new CreativeTabs(5, "search"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.COMPASS);
}
}.setBackgroundImageName("item_search.png");
public static final CreativeTabs FOOD = new CreativeTabs(7, "food"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.APPLE);
}
};
public static final CreativeTabs TOOLS = new CreativeTabs(8, "tools"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.IRON_AXE);
}
}.setRelevantEnchantmentTypes(EnumEnchantmentType.ALL, EnumEnchantmentType.DIGGER, EnumEnchantmentType.FISHING_ROD, EnumEnchantmentType.BREAKABLE);
public static final CreativeTabs COMBAT = new CreativeTabs(9, "combat"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Items.GOLDEN_SWORD);
}
}.setRelevantEnchantmentTypes(EnumEnchantmentType.ALL, EnumEnchantmentType.ARMOR, EnumEnchantmentType.ARMOR_FEET, EnumEnchantmentType.ARMOR_HEAD, EnumEnchantmentType.ARMOR_LEGS, EnumEnchantmentType.ARMOR_CHEST, EnumEnchantmentType.BOW, EnumEnchantmentType.WEAPON, EnumEnchantmentType.WEARABLE, EnumEnchantmentType.BREAKABLE);
public static final CreativeTabs BREWING = new CreativeTabs(10, "brewing"){
@Override
public ItemStack getTabIconItem() {
return PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER);
}
};
public static final CreativeTabs MATERIALS = MISC;
public static final CreativeTabs field_192395_m = new CreativeTabs(4, "hotbar"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Blocks.BOOKSHELF);
}
@Override
public void displayAllRelevantItems(NonNullList<ItemStack> p_78018_1_) {
throw new RuntimeException("Implement exception client-side.");
}
@Override
public boolean func_192394_m() {
return true;
}
};
public static final CreativeTabs INVENTORY = new CreativeTabs(11, "inventory"){
@Override
public ItemStack getTabIconItem() {
return new ItemStack(Item.getItemFromBlock(Blocks.CHEST));
}
}.setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle();
private final int tabIndex;
private final String tabLabel;
private String theTexture = "items.png";
private boolean hasScrollbar = true;
private boolean drawTitle = true;
private EnumEnchantmentType[] enchantmentTypes = new EnumEnchantmentType[0];
private ItemStack iconItemStack;
public CreativeTabs(int index, String label) {
this.tabIndex = index;
this.tabLabel = label;
this.iconItemStack = ItemStack.field_190927_a;
CreativeTabs.CREATIVE_TAB_ARRAY[index] = this;
}
public int getTabIndex() {
return this.tabIndex;
}
public String getTabLabel() {
return this.tabLabel;
}
public String getTranslatedTabLabel() {
return "itemGroup." + this.getTabLabel();
}
public ItemStack getIconItemStack() {
if (this.iconItemStack.func_190926_b()) {
this.iconItemStack = this.getTabIconItem();
}
return this.iconItemStack;
}
public abstract ItemStack getTabIconItem();
public String getBackgroundImageName() {
return this.theTexture;
}
public CreativeTabs setBackgroundImageName(String texture) {
this.theTexture = texture;
return this;
}
public boolean drawInForegroundOfTab() {
return this.drawTitle;
}
public CreativeTabs setNoTitle() {
this.drawTitle = false;
return this;
}
public boolean shouldHidePlayerInventory() {
return this.hasScrollbar;
}
public CreativeTabs setNoScrollbar() {
this.hasScrollbar = false;
return this;
}
public int getTabColumn() {
return this.tabIndex % 6;
}
public boolean isTabInFirstRow() {
return this.tabIndex < 6;
}
public boolean func_192394_m() {
return this.getTabColumn() == 5;
}
public EnumEnchantmentType[] getRelevantEnchantmentTypes() {
return this.enchantmentTypes;
}
public CreativeTabs setRelevantEnchantmentTypes(EnumEnchantmentType ... types) {
this.enchantmentTypes = types;
return this;
}
public boolean hasRelevantEnchantmentType(@Nullable EnumEnchantmentType enchantmentType) {
if (enchantmentType != null) {
for (EnumEnchantmentType enumenchantmenttype : this.enchantmentTypes) {
if (enumenchantmenttype != enchantmentType) continue;
return true;
}
}
return false;
}
public void displayAllRelevantItems(NonNullList<ItemStack> p_78018_1_) {
for (Item item : Item.REGISTRY) {
item.getSubItems(this, p_78018_1_);
}
}
}
|
[
"67242784+KrOySi@users.noreply.github.com"
] |
67242784+KrOySi@users.noreply.github.com
|
7c298289924d3a3a7c163069c2a13747c8fd5a31
|
e291e86e39c5c381089823b8e0cbc6e37129be0d
|
/backend/src/main/java/com/nchernetsov/fintracking/to/UserTo.java
|
79e817868bdfdf4c112347150b65612f5a1f268f
|
[] |
no_license
|
ChernetsovNG/fintracking_01_04_2017
|
6606b482e1671a0ada3ae6c3126d1f48c9e0e609
|
04b26e364d112d196ac8b00f4b6c188217be9aae
|
refs/heads/master
| 2021-01-19T00:54:03.088799
| 2017-03-20T19:20:27
| 2017-03-20T19:20:27
| 87,216,437
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,774
|
java
|
package com.nchernetsov.fintracking.to;
import com.nchernetsov.fintracking.util.HasId;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.SafeHtml;
import javax.validation.constraints.Size;
import java.io.Serializable;
public class UserTo implements HasId, Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@NotBlank
@SafeHtml
private String name;
@Email
@NotBlank
@SafeHtml
private String email;
@Size(min = 5, max = 64, message = " must between 5 and 64 characters")
@SafeHtml
private String password;
public UserTo() {
}
public UserTo(Integer id, String name, String email, String password) {
this.id = id;
this.name = name;
this.email = email;
this.password = password;
}
@Override
public Integer getId() {
return id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public boolean isNew() {
return id == null;
}
@Override
public String toString() {
return "UserTo{" +
"id=" + id +
", name='" + name + '\'' +
", email='" + email + '\'' +
'}';
}
}
|
[
"n.chernetsov86@gmail.com"
] |
n.chernetsov86@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.