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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f9e08447d1c05917ae9644272e89a1e598c1bcb9 | 7bf44321b59aa949005d92fc0151b7aff790ec0c | /src/test/java/edu/cmu/cs/mvelezce/tool/analysis/region/RegionsTest.java | 848812c5c1ffe05c981e825d5056d383ba32f169 | [
"MIT"
] | permissive | miguelvelezmj25/ConfigCrusher | 2b2964a1bc392a5babe528670456d4b8646442cc | 0a67b0fdab3cd32c365b0383be92d0d1be6ee94f | refs/heads/develop | 2023-09-05T16:02:02.904208 | 2021-10-20T13:32:56 | 2021-10-20T13:32:56 | 80,246,353 | 0 | 1 | NOASSERTION | 2020-10-14T00:13:32 | 2017-01-27T21:12:46 | Java | UTF-8 | Java | false | false | 2,035 | java | package edu.cmu.cs.mvelezce.tool.analysis.region;
import org.junit.Test;
/**
* Created by mvelezce on 7/11/17.
*/
public class RegionsTest {
public static void main(String[] args) {
Regions.regionsToOverhead.put("a", 0L);
Regions.regionsToOverhead.put("b", 0L);
Regions.regionsToOverhead.put("c", 0L);
Regions.regionsToOverhead.put("d", 0L);
Regions.regionsToOverhead.put("e", 0L);
int count = 2_000_000_00;
long start = System.nanoTime();
for(int i = 0; i < count; i++) {
Regions.enter("a");
Regions.enter("b");
Regions.enter("c");
Regions.exit("d");
Regions.exit("e");
Regions.exit("c");
Regions.exit("b");
Regions.exit("a");
}
long end = System.nanoTime();
long time = end - start;
System.out.println(time / 1000000000.0);
System.out.println(time / count);
}
// @Test
// public void main() throws Exception {
// System.out.println("Started");
// long start = System.nanoTime();
//
// for(int i = 0; i < 96313444; i++) {
// Regions.enter("dsf");
// Regions.exit("dsf");
// }
//
// long end = System.nanoTime();
// long time = end - start;
//
// System.out.println("start count " + Regions.startCount);
// System.out.println("end count " + Regions.endCount);
// System.out.println(time / 1000000000.0);
//
//
//
// }
@Test
public void testSleep1() throws InterruptedException {
boolean A = false;
Regions.enter("1");
boolean var1;
if(A) {
var1 = true;
}
else {
var1 = false;
}
Regions.exit("1");
Thread.sleep(200L);
Regions.enter("2");
if(var1) {
Thread.sleep(600L);
}
Regions.exit("2");
Thread.sleep(100L);
}
} | [
"miguelvelez@mijecu25.com"
] | miguelvelez@mijecu25.com |
5559ad57411bca4a63b7df25f397025e4add39de | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_f2693d4a7d7f48c2663d728a4c24bb7853e5edb8/DomainEntity/29_f2693d4a7d7f48c2663d728a4c24bb7853e5edb8_DomainEntity_s.java | a36c5c8f5f145fb4bfc3b82ca05ed26eab65c6d4 | [] | 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,356 | java | /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Copyright (C) 2008 CEJUG - Ceará Java Users Group
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This file is part of the CEJUG-CLASSIFIEDS Project - an open source classifieds system
originally used by CEJUG - Ceará Java Users Group.
The project is hosted https://cejug-classifieds.dev.java.net/
You can contact us through the mail dev@cejug-classifieds.dev.java.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
package net.java.dev.cejug.classifieds.server.ejb3.entity;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
/**
* A domain is company or a group of people. The domain should be registered in
* the Cejug-Classifieds system, and a domain has a unique domain name.
*
* @author $Author:felipegaucho $
* @version $Rev:504 $ ($Date:2008-08-24 11:22:52 +0200 (Sun, 24 Aug 2008) $)
*/
@Entity
@Table(name = "DOMAIN")
public class DomainEntity extends AbstractEntity {
@Column(name = "URI", nullable = false, unique = true)
private String uri;
@Column(name = "SHARED_COTA", nullable = false)
private Boolean sharedQuota;
public Boolean getSharedQuota() {
return sharedQuota;
}
public void setSharedQuota(Boolean sharedQuota) {
this.sharedQuota = sharedQuota;
}
@Column(name = "BRAND", nullable = false)
private String brand;
// @OneToMany(mappedBy = "domain")
// private Collection<QuotaEntity> quotas;
@ManyToMany
@JoinTable(name = "DOMAIN_CATEGORY", joinColumns = @JoinColumn(name = "DOMAIN_ID", referencedColumnName = "ID"), inverseJoinColumns = @JoinColumn(name = "CATEGORY_ID", referencedColumnName = "ID"))
private Collection<CategoryEntity> advertisementCategory;
public String getBrand() {
return brand;
}
public void setBrand(final String brand) {
this.brand = brand;
}
public String getUri() {
return uri;
}
public void setUri(final String uri) {
this.uri = uri;
}
/**
* @return the categories
*/
public Collection<CategoryEntity> getAdvertisementCategory() {
return advertisementCategory;
}
/**
* @param categories
* the categories to set
*/
public void setAdvertisementCategory(
final Collection<CategoryEntity> categories) {
this.advertisementCategory = categories;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
d7b1ec91058045b5c7a797df37c26a50c6ddd03d | 9af8fe96b774b77617e8f66846474c44f66fcf74 | /AndroidUtils/src/main/java/com/nityankhanna/androidutils/system/services/ServiceManager.java | 86a30c3f4e3d815ea2c7ab8c892d14ccd0b5869f | [
"MIT"
] | permissive | b3457m0d3/android-utils-1 | 82868365d070fed6b8fab729075ced0a5c41d33e | b2aecf04e28e5fa794874f391e7d9e16e80cd363 | refs/heads/master | 2020-12-31T03:16:11.023342 | 2014-03-09T04:17:55 | 2014-03-09T04:17:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,141 | java | package com.nityankhanna.androidutils.system.services;
import android.annotation.TargetApi;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.nfc.NfcAdapter;
import android.os.Build;
import android.os.IBinder;
import android.provider.Settings;
import com.nityankhanna.androidutils.system.serialization.SerializeManager;
import org.jetbrains.annotations.Nullable;
/**
* Created by Nityan Khanna on 05/07/13.
*/
/**
* A Service Manager providing methods to determine certain service connectivity.
*/
public class ServiceManager extends Service {
private static ServiceManager sharedInstance;
private final Context context;
private ServiceManager() {
this.context = getApplicationContext();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
public static ServiceManager getInstance() {
synchronized (SerializeManager.class) {
if (sharedInstance == null) {
sharedInstance = new ServiceManager();
}
}
return sharedInstance;
}
/**
* Determines if airplane mode is enabled on the device.
*
* @return Returns true if airplane mode is enabled.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public boolean isAirplaneModeOn() {
return Settings.System.getInt(context.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0) != 0;
}
/**
* Determines if Android Beam is available on the device.
*
* @return Returns true if Android Beam is available.
*
* @throws ServiceUnavailableException If the device does not support Android beam.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public boolean isAndroidBeamAvailable() throws ServiceUnavailableException {
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context);
if (nfcAdapter == null) {
throw new ServiceUnavailableException("The device does not support NFC.");
} else {
return nfcAdapter.isNdefPushEnabled();
}
}
/**
* Determines if Bluetooth is available on the device.
*
* @return Returns true if bluetooth is available.
*
* @throws ServiceUnavailableException If the device does not support bluetooth.
*/
public boolean isBluetoothAvailable() throws ServiceUnavailableException {
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter == null) {
throw new ServiceUnavailableException("The device does not support Bluetooth.");
} else {
return bluetoothAdapter.isEnabled();
}
}
/**
* Determines if GPS is enabled.
*
* @return Returns true if GPS is enabled.
*/
public boolean isGPSEnabled() {
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
/**
* Determines if there is internet connectivity.
*
* @return Returns true if there is internet connectivity.
*/
public boolean isNetworkAvailable() {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return (activeNetworkInfo != null && activeNetworkInfo.isConnected());
}
/**
* Determines if Network Provider is available.
*
* @return Returns true if Network Provider is available.
*/
public boolean isNetworkProviderAvailable() {
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
return locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}
/**
* Determines if NFC is available on the device.
*
* @return Returns true if NFC is available.
*
* @throws ServiceUnavailableException If the device does not support NFC.
*/
public boolean isNFCAvailable() throws ServiceUnavailableException {
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context);
if (nfcAdapter == null) {
throw new ServiceUnavailableException("The device does not support NFC.");
} else {
return nfcAdapter.isEnabled();
}
}
/**
* Determines if the user is connected Wi-Fi.
*
* @return Returns true if the user is connected to Wi-Fi.
*/
public boolean isOnWiFi() {
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
return wifi.isConnected();
}
/**
* Determines if the device is running JellyBean or higher.
*
* @return Returns true if the device is running JellyBean or higher.
*/
public boolean isJellyBeanOrHigher() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
}
/**
* Determines if the device is running IceCreamSandwich or higher.
*
* @return Returns true if the device is running IceCreamSandwich or higher.
*/
public boolean isICSOrHigher() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
}
/**
* Determines if the device is running HoneyComb or higher.
*
* @return Returns true if the device is running HoneyComb or higher.
*/
public boolean isHoneycombOrHigher() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
}
/**
* Determines if the device is running Gingerbread or higher.
*
* @return Returns true if the device is running Gingerbread or higher.
*/
public boolean isGingerbreadOrHigher() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD;
}
/**
* Determines if the device is running Froyo or higher.
*
* @return Returns true if the device is running Froyo or higher.
*/
public boolean isFroyoOrHigher() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
}
/**
* Determines if the device is a GoogleTV.
*
* @return Returns true if the device is a GoogleTV.
*/
public boolean isGoogleTV(Context context) {
return context.getPackageManager().hasSystemFeature("com.google.android.tv");
}
}
| [
"nityan.khanna@mohawkcollege.ca"
] | nityan.khanna@mohawkcollege.ca |
dd2f78fc3ee1baf2d4652516361666218e37e629 | bebbeaa2f47786bd63d054bf51942ad5b6d03303 | /Log_MybatisPlus/src/main/java/snod/com/cn/dao/MybatisPlusDao.java | 74275cf02f68c83544b4e8d6ff1dc3a1a347fc14 | [] | no_license | lvjunjie33/Log_Platform | 6d70a1b3b9ca58e850bba1741b3cc2e7ec0c9fee | 8bfc199ec0f002e6017761e0741591dc03716bb0 | refs/heads/master | 2022-12-10T08:26:11.298215 | 2019-12-05T03:12:27 | 2019-12-05T03:12:27 | 200,769,680 | 1 | 0 | null | 2022-12-06T00:43:12 | 2019-08-06T03:29:42 | JavaScript | UTF-8 | Java | false | false | 183 | java | package snod.com.cn.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import snod.com.cn.entity.SysUser;
public interface MybatisPlusDao extends BaseMapper<SysUser>{
}
| [
"junjie.lv@3nod.com.cn"
] | junjie.lv@3nod.com.cn |
e33fbec1dab272af651b81f0d272803f3bb20cd2 | 70f7a06017ece67137586e1567726579206d71c7 | /alimama/src/main/java/android/taobao/windvane/service/WVEventContext.java | 4cb087e88f06d3c135cce41ce3956f21fe2b7817 | [] | no_license | liepeiming/xposed_chatbot | 5a3842bd07250bafaffa9f468562021cfc38ca25 | 0be08fc3e1a95028f8c074f02ca9714dc3c4dc31 | refs/heads/master | 2022-12-20T16:48:21.747036 | 2020-10-14T02:37:49 | 2020-10-14T02:37:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 427 | java | package android.taobao.windvane.service;
import android.content.Context;
import android.taobao.windvane.webview.IWVWebView;
public class WVEventContext {
public Context context = null;
public String url = null;
public IWVWebView webView = null;
public WVEventContext() {
}
public WVEventContext(IWVWebView iWVWebView, String str) {
this.webView = iWVWebView;
this.url = str;
}
}
| [
"zhangquan@snqu.com"
] | zhangquan@snqu.com |
36d4756cbbc913a6ea85f56a14143220373a534e | 63e24adc15dd2155767a477c5026608273d89323 | /scm-data/src/test/java/org/xfs/platform/net/netty/demo/model/LoginMsg.java | 60e2b9becaada56518fb1506748870e5b8f6e2df | [] | no_license | shenfengzhusheng/scm | 17978a395182a3f164357372c5c44242659bc970 | 9b04e91d7c2d4dcac55d326b08606482aba2fea9 | refs/heads/master | 2022-12-21T14:31:37.214723 | 2018-11-17T03:24:01 | 2018-11-17T03:24:01 | 82,155,192 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package org.xfs.platform.net.netty.demo.model;
public class LoginMsg extends BaseMessage {
/**
*
*/
private static final long serialVersionUID = -7034179465254711230L;
private String userName;
private String password;
private String message;
public LoginMsg() {
super.setType(MessageTypeEnum.LOGIN);
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
| [
"xixingyingzhongdui@gmail.com"
] | xixingyingzhongdui@gmail.com |
e8d1f6f7937dea5a229e9fcd9342f42fd3f0c439 | 85a81eb9f58240ebe417f2dce46f3d7b1d22146b | /src/main/java/com/example/user/Users.java | 733473aa3d0323f3ad8cc466a5f5328964fb69af | [
"MIT"
] | permissive | backpaper0/two-factor-authentication-example | 668835cd4499c6fc1db6a1a7f272d40a5fc78b13 | 21e131dfe255dc3f2c3633adb8cc8d4b1387fa1b | refs/heads/master | 2021-03-12T01:56:25.858347 | 2020-03-11T22:24:57 | 2020-03-11T22:24:57 | 246,578,406 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 630 | java | package com.example.user;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public class Users {
private static final Map<String, User> users = new HashMap<>();
static {
save(new User("foo", "secret", true, new byte[20]));
save(new User("bar", "secret", false, null));
}
public static synchronized Optional<User> find(final String username) {
final User user = users.get(username);
return Optional.ofNullable(user).map(User::copy);
}
public static synchronized void save(final User user) {
users.put(user.getUsername(), user);
}
}
| [
"backpaper0@gmail.com"
] | backpaper0@gmail.com |
f7239fb09177211c60a47cb185e9d38fed294bee | 5f498d9c751a7c0263e129544c5a42606541627f | /org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java | 06b756734feac95f0be38f90670b69e8b46de074 | [] | no_license | saatkamp/simpl09 | 2c2f65ea12245888b19283cdcddb8b73d03b9cf0 | 9d81c4f50bed863518497ab950af3d6726f2b3c8 | refs/heads/master | 2021-01-10T03:56:30.975085 | 2011-11-09T19:36:14 | 2011-11-09T19:36:14 | 55,900,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,115 | java | /*******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.bpel.ui.expressions;
import org.eclipse.bpel.ui.commands.CompoundCommand;
import org.eclipse.bpel.ui.properties.BPELPropertySection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.swt.widgets.Composite;
/**
* @author IBM Original Contribution.
* @author Michal Chmielewski (michal.chmielewski@oracle.com)
* @date Jul 16, 2007
*
*/
public interface IExpressionEditor {
/**
* Goto the text marker indicated.
*
* @param marker the marker
* @param codeType code type
* @param modelObject the model object
*/
public void gotoTextMarker(IMarker marker, String codeType, Object modelObject);
/**
* Creates the editor widgets.
* @param parent the parent composite
* @param section the section
*/
void createControls(Composite parent, BPELPropertySection section);
/**
* Dispose of the editor.
*/
void dispose();
/**
* Notifies the editor that its controls are about to be hidden.
*/
void aboutToBeHidden();
/**
* Notifies the editor that its controls are about to be shown.
* Any widget state could be updated at this point.
*/
void aboutToBeShown();
/**
* This method is used just like IDetailsSection.getUserContext().
* @return the user context
*/
Object getUserContext();
/**
* This method is used just like IDetailsSection.restoreUserContext().
* @param userContext the user context
*
*/
void restoreUserContext (Object userContext);
/**
* Return the editor content
* @return return the body of the edited expression
*/
String getEditorContent ();
/**
* Set the editor content
* @param body the content of the editor.
*/
void setEditorContent (String body);
/**
* Add a listener
*
* @param listener the listener to add.
*/
void addListener(Listener listener);
/**
* Remove a listener.
* @param listener the listener to remove.
*/
void removeListener(Listener listener);
/**
* The listener interface.
*/
public static interface Listener {
/**
* Notify that we have changed.
*/
public void notifyChanged();
public void focusOut();
public void focusIn();
}
/**
* Allow the editor to modify
* @param compoundCommand
*/
void addExtraStoreCommands(CompoundCommand compoundCommand);
/**
* Get the default body.
* @return the default body
*/
public String getDefaultContent ();
/**
* Returns true if this editor supports this expression type.
*
* @param exprType the expression type.
* @return true if the expression type is supported.
*/
boolean supportsExpressionType(String exprType);
/**
* Informs the editor of the expression type it will be editing.
* The supportsExpressionType() method will always be called first to make sure
* the editor actually supports this exprType combination.
* @param exprType the expression type
*/
void setExpressionType ( String exprType );
/**
* Informs the editor of the underlying model object in which this expression
* will be stored. The model object's type and relationship to other objects
* may depend on the expression type and context provided above (for example: the
* model for a transition condition is a Link, but the model for a join condition
* is an Activity).
*
* @param modelObject
*/
void setModelObject (Object modelObject);
/**
* Tells the editor to consider itself clean.
*/
void markAsClean();
}
| [
"hahnml@t-online.de"
] | hahnml@t-online.de |
2c3f878842495e7e513e385b9ee7f254e52162be | e5e46ac27edef7410fd1d36741e8cbf01d704a10 | /src/TimeBase/TdfTHelper.java | ee9bed788763bd773ce97fde3486c7a61a617b3e | [] | no_license | thradexIT/tmf814 | 4cc5be43145137f5d58693a5d2e3a60968541799 | 20688a799d5b20ec7e9adbc33ca69cc63347b2a9 | refs/heads/master | 2021-12-25T00:00:44.914802 | 2017-12-21T22:01:40 | 2017-12-21T22:01:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | package TimeBase;
/**
* TimeBase/TdfTHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from TimeBase.idl
* Wednesday, June 15, 2016 7:24:42 PM COT
*/
abstract public class TdfTHelper
{
private static String _id = "IDL:omg.org/TimeBase/TdfT:1.0";
public static void insert (org.omg.CORBA.Any a, short that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static short extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (TimeBase.TdfTHelper.id (), "TdfT", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static short read (org.omg.CORBA.portable.InputStream istream)
{
short value = (short)0;
value = istream.read_short ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, short value)
{
ostream.write_short (value);
}
}
| [
"miplanmobile@gmail.com"
] | miplanmobile@gmail.com |
dcd439e168e16f3c8cee698c5ddc55d34c380399 | f2468a53b5c1c29b5348e063c2a60ef05c09e099 | /src/main/java/com/yibo/designpattern/creational/abstractfactory/Book.java | 0dc407ff6cc71447d5958a737d8d0143b8ccbd11 | [] | no_license | jjhyb/design-pattern | 707d736c5076aa117a5691e2be67a4f65a6fd76d | a5a0672c5032db13ba6f48499d6b7faf262d5ebb | refs/heads/master | 2022-06-10T15:16:08.840020 | 2020-05-01T16:19:37 | 2020-05-01T16:19:37 | 260,504,237 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 222 | java | package com.yibo.designpattern.creational.abstractfactory;
/**
* @author: huangyibo
* @Date: 2020/4/23 22:47
* @Description:
*/
public abstract class Book {
//获取尺寸
protected abstract void getSize();
}
| [
"718649016@qq.com"
] | 718649016@qq.com |
34f25c79d3e4a6a365613cda323de0a412b884c2 | e9a6574e6ec50c39a6923ade3743da1401776f6f | /Homework_10/src/main/java/Problem_02/ShopExceptions/PriceException.java | 3782fe1b4acad682e51d24a6d8eb41826c91af4b | [] | no_license | bardas-oleksandr/Homeworks_All | bc1a6658c5c70aca94c5a5345ba42f00caf9de40 | bf24021afcb4d0287469762761fdfff1d816a329 | refs/heads/master | 2020-04-28T06:47:36.046027 | 2019-03-11T19:34:51 | 2019-03-11T19:34:51 | 175,071,275 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 549 | java | package Problem_02.ShopExceptions;
//Should be thrown in the case of attempt to establish negative price of the flower
public class PriceException extends NoFlowersException {
private double price;
public PriceException(Class flowerType, String color, double price){
super(flowerType, color);
this.price = price;
}
@Override
public String getMessage(){
return new String("Attempt of operating with non-positive price was made.");
}
public double getPrice(){
return this.price;
}
}
| [
"iskander0119@gmail.com"
] | iskander0119@gmail.com |
8d3dbb705d4d95914cab00afecd5a59544c46af8 | 5d9128606e288f4a8ede1f39bf0909a97247dbb8 | /jOOQ-test/src/org/jooq/test/h2/generatedclasses/tables/interfaces/ITDates.java | 734399eee797579e9ecc87ea048f51aa4ee3cfd6 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | Arbonaut/jOOQ | ec62a03a6541444b251ed7f3cdefc22eadf2a03d | 21fbf50ca6129f1bc20cc6c553d99ba92865d192 | refs/heads/master | 2021-01-16T20:32:00.437982 | 2012-11-26T13:28:19 | 2012-11-26T13:28:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | /**
* This class is generated by jOOQ
*/
package org.jooq.test.h2.generatedclasses.tables.interfaces;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings("all")
public interface ITDates extends java.io.Serializable {
/**
* The table column <code>PUBLIC.T_DATES.ID</code>
* <p>
* This column is part of the table's PRIMARY KEY
*/
public void setId(java.lang.Integer value);
/**
* The table column <code>PUBLIC.T_DATES.ID</code>
* <p>
* This column is part of the table's PRIMARY KEY
*/
public java.lang.Integer getId();
/**
* The table column <code>PUBLIC.T_DATES.D</code>
*/
public void setD(java.sql.Date value);
/**
* The table column <code>PUBLIC.T_DATES.D</code>
*/
public java.sql.Date getD();
/**
* The table column <code>PUBLIC.T_DATES.T</code>
*/
public void setT(java.sql.Time value);
/**
* The table column <code>PUBLIC.T_DATES.T</code>
*/
public java.sql.Time getT();
/**
* The table column <code>PUBLIC.T_DATES.TS</code>
*/
public void setTs(java.sql.Timestamp value);
/**
* The table column <code>PUBLIC.T_DATES.TS</code>
*/
public java.sql.Timestamp getTs();
/**
* The table column <code>PUBLIC.T_DATES.D_INT</code>
*/
public void setDInt(java.lang.Integer value);
/**
* The table column <code>PUBLIC.T_DATES.D_INT</code>
*/
public java.lang.Integer getDInt();
/**
* The table column <code>PUBLIC.T_DATES.TS_BIGINT</code>
*/
public void setTsBigint(java.lang.Long value);
/**
* The table column <code>PUBLIC.T_DATES.TS_BIGINT</code>
*/
public java.lang.Long getTsBigint();
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
b13dcab8b5a49f37f119943a4c67ec78071be789 | 6baa09045c69b0231c35c22b06cdf69a8ce227d6 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201602/CustomFieldValue.java | 1ea75548509288c078fa5281adfe32e1498876bb | [
"Apache-2.0"
] | permissive | remotejob/googleads-java-lib | f603b47117522104f7df2a72d2c96ae8c1ea011d | a330df0799de8d8de0dcdddf4c317d6b0cd2fe10 | refs/heads/master | 2020-12-11T01:36:29.506854 | 2016-07-28T22:13:24 | 2016-07-28T22:13:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java |
package com.google.api.ads.dfp.jaxws.v201602;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* The value of a {@link CustomField} that does not have a {@link CustomField#dataType}
* of {@link CustomFieldDataType#DROP_DOWN}.
*
*
* <p>Java class for CustomFieldValue complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CustomFieldValue">
* <complexContent>
* <extension base="{https://www.google.com/apis/ads/publisher/v201602}BaseCustomFieldValue">
* <sequence>
* <element name="value" type="{https://www.google.com/apis/ads/publisher/v201602}Value" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomFieldValue", propOrder = {
"value"
})
public class CustomFieldValue
extends BaseCustomFieldValue
{
protected Value value;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link Value }
*
*/
public Value getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link Value }
*
*/
public void setValue(Value value) {
this.value = value;
}
}
| [
"api.cseeley@gmail.com"
] | api.cseeley@gmail.com |
c7c25cd9de4bd65567d7c9b6191ece9d7460b67b | 8a54e1c1ba300812528a42c4c588f7377ad303a2 | /lottie/src/main/java/com/airbnb/lottie/LottieResult.java | 51058d47528214dda1db7aa5c33fed2e6760ca64 | [] | no_license | niplus/obex | 47493c87aa3b1bd0d411fdd060ad191181b909c8 | b75de893543f60a0742cae64a9c139167f1fa677 | refs/heads/master | 2023-06-08T19:37:54.074589 | 2021-05-08T05:56:26 | 2021-05-08T05:56:26 | 364,802,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package com.airbnb.lottie;
import androidx.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects;
/**
* Contains class to hold the resulting value of an async task or an exception if it failed.
*
* Either value or exception will be non-null.
*/
public final class LottieResult<V> {
@Nullable
private final V value;
@Nullable private final Throwable exception;
public LottieResult(V value) {
this.value = value;
exception = null;
}
public LottieResult(Throwable exception) {
this.exception = exception;
value = null;
}
@Nullable public V getValue() {
return value;
}
@Nullable public Throwable getException() {
return exception;
}
@Override public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof LottieResult)) {
return false;
}
LottieResult<?> that = (LottieResult<?>) o;
if (getValue() != null && getValue().equals(that.getValue())) {
return true;
}
if (getException() != null && that.getException() != null) {
return getException().toString().equals(getException().toString());
}
return false;
}
@Override public int hashCode() {
return Arrays.hashCode(new Object[]{getValue(), getException()});
}
}
| [
"841270527@qq.com"
] | 841270527@qq.com |
2320424209def1ab7074ba9c2b333ae9f15e16b9 | 3d8eb855896fc35302119f34a6f4b5e0e30e7c73 | /src/Main/java/tree/FactorCombinations_Impl_161017_0.java | 50255028f38c8166461d98627d5f2ecfc26296b4 | [] | no_license | wangshen2014/shuati_for_sichu | 83f15544ce86cc6b987da661f6b5769f38ca7805 | 7380d0a9c52d6890bd2acaa5a559c7edb17553e2 | refs/heads/master | 2021-01-17T14:19:31.251583 | 2017-03-06T16:13:42 | 2017-03-06T16:13:42 | 84,084,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,186 | java | package tree;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* Created by patrickyu on 10/17/16.
*/
public class FactorCombinations_Impl_161017_0 implements FactorCombinations {
@Override
public List<List<Integer>> getFactors(int n) {
return helper(1, n);
}
private List<List<Integer>> helper(int left, int right) {
List<List<Integer>> rst = new ArrayList<>();
// left, right -> result
if (left != 1) {
rst.add(new LinkedList<>(Arrays.asList(left, right)));
}
// left, each of right -> result
for (int i = 2; i <= Math.sqrt(right); i++) {
int leftChild = i;
int rightChild = right / leftChild;
if (rightChild * leftChild == right && leftChild >= left) {
List<List<Integer>> rstChild = helper(leftChild, rightChild);
for (List<Integer> list : rstChild) {
if (left != 1) {
list.add(0, left);
}
rst.add(list);
}
}
}
return rst;
}
}
| [
"someone@someplace.com"
] | someone@someplace.com |
5fd8f9c56ea2e58f5d0d22261375ec8d60cac5e6 | 4f24bf08bcb42a079db8e48938f48fe74d68257b | /lizard-node-server/src/main/java/lizard/node/THandlerNodeTable.java | ab247809e9fdf7c64d19d5c5a4fed5f3a347330b | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | anukat2015/lizard | a5d6226c2d809ce8e94f734d93d3a2daaaacae0d | eb9de7407cf7b20531910a77fb29e6be3b9768e3 | refs/heads/master | 2020-12-29T00:29:33.050304 | 2015-08-20T19:10:24 | 2015-08-20T19:10:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,778 | 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.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*/
package lizard.node;
import static lizard.comms.thrift.ThriftLib.decodeFromTLZ ;
import static lizard.comms.thrift.ThriftLib.encodeToTLZ ;
import static org.apache.jena.query.ReadWrite.READ ;
import static org.apache.jena.query.ReadWrite.WRITE ;
import java.util.ArrayList ;
import java.util.List ;
import lizard.api.TxnHandler ;
import lizard.api.TLZ.TLZ_NodeId ;
import lizard.api.TLZ.TLZ_NodeTable ;
import lizard.system.LzLog ;
import org.apache.jena.atlas.logging.FmtLog ;
import org.apache.jena.graph.Node ;
import org.apache.jena.riot.out.NodeFmtLib ;
import org.apache.jena.riot.thrift.wire.RDF_Term ;
import org.apache.thrift.TException ;
import org.seaborne.dboe.transaction.txn.TransactionalSystem ;
import org.seaborne.tdb2.store.NodeId ;
import org.seaborne.tdb2.store.nodetable.NodeTable ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
//XXX Needs efficiency attention.
/* package */ class THandlerNodeTable extends TxnHandler implements TLZ_NodeTable.Iface {
private static Logger log = LoggerFactory.getLogger(THandlerNodeTable.class) ;
private static Logger logtxn = LoggerFactory.getLogger(LzLog.logTxnBase+".NodeTableTxn") ;
@Override
protected Logger log() { return log ; }
@Override
protected Logger logtxn() { return logtxn ; }
private final String label ;
private final NodeTable nodeTable ;
@Override
protected String getLabel() { return label ; }
public THandlerNodeTable(TransactionalSystem txnSystem, String label, NodeTable nodeTable) {
super(txnSystem) ;
this.label = label ;
this.nodeTable = nodeTable ;
}
@Override
public TLZ_NodeId allocNodeId(long id, long txnId, RDF_Term nz) throws TException {
//FmtLog.debug(log, "[%d] allocNodeId : txnId = %d", id, txnId) ;
checkActive() ;
Node n = decodeFromTLZ(nz) ;
return txnAlwaysReturn(txnId, WRITE, ()-> {
NodeId nid = nodeTable.getAllocateNodeId(n) ;
TLZ_NodeId nidz = new TLZ_NodeId() ;
nidz.setNodeId(nid.getId()) ;
FmtLog.info(log, "[%d:%d] Node alloc request : %s => %s", id, txnId, n, nid) ;
return nidz ;
}) ;
}
@Override
public TLZ_NodeId findByNode(long id, long txnId, RDF_Term nz) throws TException {
//FmtLog.debug(log, "[%d] findByNode : txnId = %d", id, txnId) ;
checkActive() ;
Node n = decodeFromTLZ(nz) ;
return txnAlwaysReturn(txnId, READ, ()-> {
NodeId nid = nodeTable.getNodeIdForNode(n) ;
// XXX Remove little structs
TLZ_NodeId nidz = new TLZ_NodeId() ;
nidz.setNodeId(nid.getId()) ;
FmtLog.info(log, "[%d:%d] Node get request : %s => %s", id, txnId, n, nid) ;
return nidz ;
}) ;
}
@Override
public RDF_Term findByNodeId(long id, long txnId, TLZ_NodeId nz) throws TException {
//FmtLog.debug(log, "[%d] findByNodeId : txnId = %d", id, txnId) ;
checkActive() ;
NodeId nid = NodeId.create(nz.getNodeId()) ;
return txnAlwaysReturn(txnId, READ, ()-> {
Node n = nodeTable.getNodeForNodeId(nid) ;
if ( n == null )
FmtLog.error(log, "NodeId not found: "+nid) ;
String str = NodeFmtLib.str(n) ;
FmtLog.info(log, "[%d:%d] NodeId get request : %s => %s", id, txnId, nid, n) ;
RDF_Term nlz = encodeToTLZ(n) ;
return nlz ;
}) ;
}
@Override
public List<TLZ_NodeId> allocNodeIds(long id, long txnId, List<RDF_Term> nodes) throws TException {
FmtLog.info(log, "[%d] allocNodeIds(%d) : txnId = %d", id, nodes.size(), txnId) ;
checkActive() ;
return txnAlwaysReturn(txnId, WRITE, ()-> {
// Local bulk operations?
List<TLZ_NodeId> nodeids = new ArrayList<>(nodes.size()) ;
for ( RDF_Term nz : nodes ) {
Node n = decodeFromTLZ(nz) ;
NodeId nid = nodeTable.getAllocateNodeId(n) ;
TLZ_NodeId nidz = new TLZ_NodeId() ;
nidz.setNodeId(nid.getId()) ;
nodeids.add(nidz) ;
//FmtLog.info(log, "[%d:%d] Batched node alloc : %s => %s", id, txnId, n, nid) ;
}
return nodeids ;
}) ;
}
@Override
public List<RDF_Term> lookupNodeIds(long id, long txnId, List<TLZ_NodeId> nodeIds) throws TException {
FmtLog.debug(log, "[%d] lookupNodeIds : txnId = %d", id, txnId) ;
checkActive() ;
return txnAlwaysReturn(txnId, WRITE, ()-> {
List<RDF_Term> nodes = new ArrayList<>(nodeIds.size()) ;
for ( TLZ_NodeId nz : nodeIds ) {
// Local bulk operations?
NodeId nid = decodeFromTLZ(nz) ;
Node n = nodeTable.getNodeForNodeId(nid) ;
nodes.add(encodeToTLZ(n)) ;
//FmtLog.info(log, "[%d:%d] Batched node alloc : %s => %s", id, txnId, n, nid) ;
}
return nodes ;
}) ;
}
}
| [
"andy@seaborne.org"
] | andy@seaborne.org |
a8668ddaf46b6ec3c1572d09ed7befd164aa42a6 | 0a6e41da01e43562e8a5ef6d227e10159fc253b3 | /server/maintenance/src/main/java/com/spring/maintenance/service/impl/MyHouseServiceImpl.java | 9969c799434216fa7f49abe73ca56e8fa7ac46cf | [] | no_license | chq347796066/base-interface | 917914190be0b487929f38d2cce68f7e396c149e | 356aabbdcf827c9a65083d17c3e7ade259801bfd | refs/heads/main | 2023-02-26T13:53:26.205433 | 2021-02-08T10:24:36 | 2021-02-08T10:24:36 | 337,037,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,007 | java | package com.spring.maintenance.service.impl;
import com.spring.base.dao.BaseDao;
import com.spring.base.entity.baseinfo.CommunityEntity;
import com.spring.base.entity.baseinfo.CompanyEntity;
import com.spring.base.entity.baseinfo.HouseEntity;
import com.spring.base.entity.buiness.MyHouseEntity;
import com.spring.base.service.impl.BaseServiceImpl;
import com.spring.base.vo.baseinfo.user.UserUpdateLogo;
import com.spring.base.vo.buiness.myhouse.MyHouseAddVo;
import com.spring.base.vo.buiness.myhouse.MyHouseUpdateVo;
import com.spring.base.vo.buiness.myhouse.MyHouseVo;
import com.spring.common.constants.MessageCode;
import com.spring.common.feign.client.BaseInfoFeignClient;
import com.spring.common.request.RequestUtils;
import com.spring.common.response.ApiResponseResult;
import com.spring.common.util.id.UUIDFactory;
import com.spring.maintenance.dao.IMyHouseDao;
import com.spring.maintenance.service.IMyHouseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* @author 作者:denglei
* @date : 创建时间:2020-04-17 09:46:08
* @Desc类说明: 我的房屋信息业务接口实现类
*/
@Slf4j
@Service("myHouseService")
public class MyHouseServiceImpl extends BaseServiceImpl<MyHouseEntity, String> implements IMyHouseService {
@Autowired
private IMyHouseDao myHouseDao;
@Autowired
private BaseInfoFeignClient communityBuildCellHouseFeignCilnet;
@Autowired
private BaseInfoFeignClient userFeignCilnet;
@Override
public BaseDao getBaseMapper() {
return myHouseDao;
}
/**
* 新增我的房屋信息
*
* @param vo
* @return
* @throws Exception
* @author 作者:ZhaoJinHua
* @version 创建时间:2020-04-17 09:46:08
*/
@Override
public ApiResponseResult addMyHouse(MyHouseAddVo vo) throws Exception {
// 返回的对象
ApiResponseResult result = new ApiResponseResult();
MyHouseEntity entity = new MyHouseEntity();
BeanUtils.copyProperties(vo, entity);
entity.setId(UUIDFactory.createId());
entity.setCreateUser(RequestUtils.getUserId());
entity.setCreateDate(new Date());
entity.setDelFlag(0);
entity.setCompanyId(RequestUtils.getCompanyId());
entity.setTenantId(RequestUtils.getTenantId());
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
entity.setProcessCode("FB"+dateString);
String processName =entity.getUserName()+entity.getBuildName()+entity.getCellName()+entity.getHouseCode()+"认证";
entity.setProcessName(processName);
//'审核状态(0 待审核 1已通过 2未通过)'
entity.setAuditStatus(0);
//认证类型(1 房屋认证 2公司审核)
entity.setAuthType(1);
//客户业主姓名手机号
HouseEntity houseEntity = new HouseEntity();
houseEntity.setOwnerMobile(entity.getOwnerPhone());
houseEntity.setOwnerName(entity.getOwnerName());
houseEntity.setId(entity.getHouseId());
houseEntity.setHouseCode(entity.getHouseCode());
ApiResponseResult apiResponseResult = communityBuildCellHouseFeignCilnet.queryList(houseEntity);
if(null != apiResponseResult.getData()){
List<HouseEntity> houseEntities= (List<HouseEntity>)apiResponseResult.getData();
if(houseEntities.size() == 0){
result.setCode(MessageCode.FAIL);
result.setMsg("输入的信息与业主预留信息不一致,请核实后输入");
return result;
}
}
// 新增
int no = myHouseDao.insertMyHouse(entity);
if (no > 0) {
result.setCode(MessageCode.SUCCESS);
result.setMsg("成功");
} else {
result.setCode(MessageCode.FAIL);
result.setMsg("新增失败");
}
return result;
}
/**
* 更新我的房屋信息
* @param vo
* @return
* @throws Exception
* @author 作者:ZhaoJinHua
* @version 创建时间:2020-04-17 09:46:08
*/
@Override
public ApiResponseResult updateMyHouse(MyHouseUpdateVo vo) throws Exception {
MyHouseEntity entity = new MyHouseEntity();
BeanUtils.copyProperties(vo, entity);
entity.setModifyUser(RequestUtils.getUserId());
entity.setModifyDate(new Date());
entity.setTenantId(RequestUtils.getTenantId());
//审核状态(0 待审核 1已通过 2未通过)
if(1 == entity.getAuditStatus() || 2==entity.getAuditStatus()){
Date currentTime = new Date();
entity.setAuditDate(currentTime);
}
if(1 == entity.getAuditStatus()){
CommunityEntity communityEntity = communityBuildCellHouseFeignCilnet.queryCommunityEntity(vo.getCommunityId());
if(null != communityEntity){
CompanyEntity companyEntity = communityBuildCellHouseFeignCilnet.queryCompanyEntity(communityEntity.getCompanyId());
if(companyEntity!=null){
entity.setCompanyName(companyEntity.getCompanyName());
}
}
UserUpdateLogo updateLogo = new UserUpdateLogo();
updateLogo.setId(vo.getUserId());
updateLogo.setCommunityId(vo.getCommunityId());
updateLogo.setCompanyId(communityEntity.getCompanyId());
userFeignCilnet.updateLogoUser(updateLogo);
entity.setCompanyId(communityEntity.getCompanyId());
}
// 更新
int no = myHouseDao.updateById(entity);
if (no > 0) {
return createSuccessResult(null);
}
return createFailResult();
}
/**
* @Desc: 删除我的房屋
* @param vo
* @Author:邓磊
* @UpdateDate:2020/4/18 10:06
* @return: 返回
*/
@Override
public ApiResponseResult deleteMyHouse(MyHouseEntity vo) throws Exception {
ApiResponseResult result = new ApiResponseResult();
MyHouseEntity myHouseEntity = myHouseDao.queryMyHouseInfo(vo);
if(null!=myHouseEntity && myHouseEntity.getIdentityType() !=null){
//身份类型(1业主 2家庭成员 3租客)
if(myHouseEntity.getIdentityType() == 1){
result.setCode(MessageCode.FAIL);
result.setMsg("业主房屋不能删除,只允许删除租客或者家庭成员");
return result;
}
}
vo.setDelFlag(1);
int no = myHouseDao.deleteMyHouse(vo);
if (no > 0) {
return createSuccessResult(null);
}else{
return createFailResult();
}
}
/**
* @Desc: 我的租客列表
* @param vo
* @Author:邓磊
* @UpdateDate:2020/4/22 14:36
* @return: 返回
*/
@Override
public ApiResponseResult queryRenterList(MyHouseVo vo) throws Exception {
ApiResponseResult result = new ApiResponseResult();
List<MyHouseEntity> myHouseEntities = myHouseDao.queryRenterList(vo);
result.setData(myHouseEntities);
result.setCode(MessageCode.SUCCESS);
result.setMsg("成功");
return result;
}
/**
* @Desc: 根据条件系统管理用户管理业主APP用户查询列表
* @param vo
* @Author:邓磊
* @UpdateDate:2020/5/7 16:31
* @return: 返回
*/
@Override
public List<MyHouseEntity> queryUserAppHouseList(MyHouseEntity vo) throws Exception {
return myHouseDao.queryList(vo);
}
}
| [
"chq347796066@126.com"
] | chq347796066@126.com |
dc1e35ba32dd4f2e03a7adc5e07c8df1141910f0 | 36073e09d6a12a275cc85901317159e7fffa909e | /jersey_jersey/modifiedFiles/2/fix/JarFileScanner.java | 6d2dbe0503e8db00974c84d3dd0a30080c50cdf3 | [] | no_license | monperrus/bug-fixes-saner16 | a867810451ddf45e2aaea7734d6d0c25db12904f | 9ce6e057763db3ed048561e954f7aedec43d4f1a | refs/heads/master | 2020-03-28T16:00:18.017068 | 2018-11-14T13:48:57 | 2018-11-14T13:48:57 | 148,648,848 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,719 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package org.glassfish.jersey.server.internal.scanning;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.glassfish.jersey.server.ResourceFinder;
/**
* A utility class that scans entries in jar files.
*
* @author Paul Sandoz
*/
public final class JarFileScanner implements ResourceFinder {
private static final Logger LOGGER = Logger.getLogger(JarFileScanner.class.getName());
// platform independent file separator within the jar file
private static final char JAR_FILE_SEPARATOR = '/';
private final JarInputStream jarInputStream;
private final String parent;
private final boolean recursive;
/**
* Create new JAR file scanner.
*
* @param inputStream JAR file input stream
* @param parent JAR file entry prefix.
* @param recursive if ({@code true} the packages will be scanned recursively together with any nested packages, if
* {@code false} only the explicitly listed packages will be scanned.
* @throws IOException if wrapping given input stream into {@link JarInputStream} failed.
*/
public JarFileScanner(final InputStream inputStream, final String parent, final boolean recursive) throws IOException {
this.jarInputStream = new JarInputStream(inputStream);
this.parent = (parent.isEmpty() || parent.endsWith(String.valueOf(JAR_FILE_SEPARATOR))) ? parent : parent + JAR_FILE_SEPARATOR;
this.recursive = recursive;
}
private JarEntry next = null;
@Override
public boolean hasNext() {
if (next == null) {
try {
do {
this.next = jarInputStream.getNextJarEntry();
if (next == null) {
break;
}
if (!next.isDirectory() && next.getName().startsWith(parent)) {
if (recursive || next.getName().substring(parent.length()).indexOf(JAR_FILE_SEPARATOR) == -1) {
break;
}
}
} while (true);
} catch (final IOException e) {
LOGGER.log(Level.CONFIG, "Unable to read the next jar entry.", e);
return false;
} catch (final SecurityException e) {
LOGGER.log(Level.CONFIG, "Unable to read the next jar entry.", e);
return false;
}
}
if (next == null) {
try {
jarInputStream.close();
} catch (final IOException e) {
LOGGER.log(Level.FINE, "Unable to close jar file.", e);
}
return false;
}
return true;
}
@Override
public String next() {
if (next != null || hasNext()) {
final String name = next.getName();
next = null;
return name;
}
throw new NoSuchElementException();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@Override
public void reset() {
throw new UnsupportedOperationException();
}
@Override
public InputStream open() {
return new InputStream() {
@Override
public int read() throws IOException {
return jarInputStream.read();
}
@Override
public int read(final byte[] bytes) throws IOException {
return jarInputStream.read(bytes);
}
@Override
public int read(final byte[] bytes, final int i, final int i2) throws IOException {
return jarInputStream.read(bytes, i, i2);
}
@Override
public long skip(final long l) throws IOException {
return jarInputStream.skip(l);
}
@Override
public int available() throws IOException {
return jarInputStream.available();
}
@Override
public void close() throws IOException {
jarInputStream.closeEntry();
}
@Override
public synchronized void mark(final int i) {
jarInputStream.mark(i);
}
@Override
public synchronized void reset() throws IOException {
jarInputStream.reset();
}
@Override
public boolean markSupported() {
return jarInputStream.markSupported();
}
};
}
}
| [
"martin.monperrus@gnieh.org"
] | martin.monperrus@gnieh.org |
e9acf999148f6dfc55a17c4be862ec21621eb1ea | 7e13d4d315265bc55fabaf424745cf954417d118 | /SLCO1.0-files/SLCO1.0/metamodels-and-grammars/nqc.emf.tests/src/nqc/tests/VariableTest.java | 88ba7d1c1bd846861da10c070e559b7c9e70bcaf | [] | no_license | melroy999/2IMP00-SLCO | 6c4b69d0da58d4f06c662cd046193694979bbae4 | bb5178ffc322c4bb0d7b070760950f29aeb0eb52 | refs/heads/master | 2023-04-05T06:48:10.474608 | 2021-04-07T23:19:46 | 2021-04-07T23:19:46 | 314,880,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,692 | java | /**
*/
package nqc.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import nqc.NqcFactory;
import nqc.Variable;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Variable</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class VariableTest extends TestCase {
/**
* The fixture for this Variable test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Variable fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(VariableTest.class);
}
/**
* Constructs a new Variable test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VariableTest(String name) {
super(name);
}
/**
* Sets the fixture for this Variable test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(Variable fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Variable test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Variable getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(NqcFactory.eINSTANCE.createVariable());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //VariableTest
| [
"d.zhang@tue.nl"
] | d.zhang@tue.nl |
b81b7d3921d1651a1ea62dbf14425c0e3a5badad | 3a65b8241586fda0c2fee4256d38918d8ee5ee8f | /java-basic/src/main/java/bitcamp/java100/Test19_4.java | df54950786899984b3c568f8f0671d5d3bbcc8b6 | [] | no_license | KIMMIAE/bitcamp | 1319f49df3cc3c4e8c5af6655b554d116d9c8678 | ea9d17c38a889ad79b5eae2529457a259bcb4e14 | refs/heads/master | 2021-10-21T17:52:06.080521 | 2019-03-05T12:58:09 | 2019-03-05T12:58:09 | 104,423,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package bitcamp.java100;
import java.util.*;
import java.io.*;
import java.net.*;
// 실무에서는 가능한 와일드 카드 사용을 자제한다.
public class Test19_4 {
public static void main(String[] args) {
ArrayList<String> list = new ArrayList<>();
HashSet<String> set = new HashSet<>();
HashMap<String,Object> map = new HashMap<>();
File f;
FileInputStream in;
FileOutputStream oun;
Socket s;
ServerSocket ss;
URL url;
}
}
| [
"kma613@naver.com"
] | kma613@naver.com |
e9156511be9fb917c3ac62b34e83a92a3a700c24 | a7497fae8dd751b07abe1c61dbb09d52f47f3d76 | /org.isistan.flabot.javamodel.java/src/org/isistan/flabot/javamodel/java/ShortPrimitiveImpl.java | 7a772adf3a538b6013c7cc5c526f3d4c46b3ce72 | [] | no_license | niconistal/FLABot | 639388ec36e514cb6f8c63caa01530bff2e1fcbd | a118b9fd20c3ee44b6d2b456b3f7b362ce92327a | refs/heads/master | 2021-03-12T19:52:59.571266 | 2013-01-29T01:46:46 | 2013-01-29T01:46:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,052 | java | package org.isistan.flabot.javamodel.java;
import org.isistan.flabot.javamodel.JClass;
import org.isistan.flabot.javamodel.JShortPrimitive;
import org.isistan.flabot.javamodel.MixedImplementationsException;
public class ShortPrimitiveImpl extends PrimitiveImpl implements
JShortPrimitive {
private Short javaShortPrimitive;
Short getShortPrimitive() {
return javaShortPrimitive;
}
static Short getShortPrimitive(JShortPrimitive jShortPrimitive) {
if(jShortPrimitive instanceof ShortPrimitiveImpl) {
return ((ShortPrimitiveImpl)jShortPrimitive).getShortPrimitive();
} else {
throw new MixedImplementationsException(jShortPrimitive);
}
}
ShortPrimitiveImpl(Short javaShortPrimitive) {
super(javaShortPrimitive);
this.javaShortPrimitive=javaShortPrimitive;
}
public short getValue() {
return javaShortPrimitive.shortValue();
}
@Override
public JClass getObjectClass() {
return JavaFactory.getInstance().buildClass(short.class);
}
public String getString() {
return javaShortPrimitive.toString();
}
}
| [
"nistal.nicolas@gmail.com"
] | nistal.nicolas@gmail.com |
6de642da1a4fcb0d7c3474a59efe42cde9ddffcb | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module0274_public/src/java/module0274_public/a/Foo2.java | a0cc3005e6b88687dfb8cd6c865d7aa947fc324b | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,591 | java | package module0274_public.a;
import java.nio.file.*;
import java.sql.*;
import java.util.logging.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.annotation.processing.Completion
* @see javax.lang.model.AnnotatedConstruct
* @see javax.management.Attribute
*/
@SuppressWarnings("all")
public abstract class Foo2<K> extends module0274_public.a.Foo0<K> implements module0274_public.a.IFoo2<K> {
javax.naming.directory.DirContext f0 = null;
javax.net.ssl.ExtendedSSLSession f1 = null;
javax.rmi.ssl.SslRMIClientSocketFactory f2 = null;
public K element;
public static Foo2 instance;
public static Foo2 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return module0274_public.a.Foo0.create(input);
}
public String getName() {
return module0274_public.a.Foo0.getInstance().getName();
}
public void setName(String string) {
module0274_public.a.Foo0.getInstance().setName(getName());
return;
}
public K get() {
return (K)module0274_public.a.Foo0.getInstance().get();
}
public void set(Object element) {
this.element = (K)element;
module0274_public.a.Foo0.getInstance().set(this.element);
}
public K call() throws Exception {
return (K)module0274_public.a.Foo0.getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
6ed9673963bada75f5cdc9805af60a7f204411b1 | 6640889c0bd2c66a93aa9dc08550e773fa7e007b | /src/main/java/org/orbeon/saxon/tinytree/WhitespaceTextImpl.java | d693f25dfa26fa22dfb6c7c283b3bfbea8aa1f3e | [] | no_license | orbeon/saxon | ed4405924287a6d4024ec749dcf798c3f7438c33 | a4626186766667a599ff23da0943b49f05819484 | refs/heads/master | 2023-08-26T09:26:01.830128 | 2021-11-09T03:32:52 | 2021-11-09T03:32:52 | 256,231 | 3 | 5 | null | 2016-04-14T23:45:33 | 2009-07-20T23:35:31 | Java | UTF-8 | Java | false | false | 4,043 | java | package org.orbeon.saxon.tinytree;
import org.orbeon.saxon.event.Receiver;
import org.orbeon.saxon.trans.XPathException;
import org.orbeon.saxon.type.Type;
import org.orbeon.saxon.om.FastStringBuffer;
/**
* A node in the XML parse tree representing a text node with compressed whitespace content
* @author Michael H. Kay
*/
public final class WhitespaceTextImpl extends TinyNodeImpl {
// TODO: make this class implement CharSequence directly, avoiding the need to create a CompressedWhitespace object
/**
* Create a compressed whitespace text node
* @param tree the tree to contain the node
* @param nodeNr the internal node number
*/
public WhitespaceTextImpl(TinyTree tree, int nodeNr) {
this.tree = tree;
this.nodeNr = nodeNr;
}
/**
* Return the character value of the node.
* @return the string value of the node
*/
public String getStringValue() {
return getStringValueCS().toString();
}
/**
* Get the value of the item as a CharSequence. This is in some cases more efficient than
* the version of the method that returns a String. For a WhitespaceTextImpl node, it avoids the
* cost of decompressing the whitespace
*/
public CharSequence getStringValueCS() {
long value = ((long)tree.alpha[nodeNr]<<32) | ((long)tree.beta[nodeNr] & 0xffffffffL);
return new CompressedWhitespace(value);
}
/**
* Static method to get the string value of a text node without first constructing the node object
* @param tree the tree
* @param nodeNr the node number of the text node
* @return the string value of the text node
*/
public static CharSequence getStringValue(TinyTree tree, int nodeNr) {
long value = ((long)tree.alpha[nodeNr]<<32) | ((long)tree.beta[nodeNr] & 0xffffffffL);
return new CompressedWhitespace(value);
}
/**
* Static method to get the string value of a text node and append it to a supplied buffer
* without first constructing the node object
* @param tree the tree
* @param nodeNr the node number of the text node
* @param buffer a buffer to which the string value will be appended
*/
public static void appendStringValue(TinyTree tree, int nodeNr, FastStringBuffer buffer) {
long value = ((long)tree.alpha[nodeNr]<<32) | ((long)tree.beta[nodeNr] & 0xffffffffL);
CompressedWhitespace.uncompress(value, buffer);
}
/**
* Static method to get the "long" value representing the content of a whitespace text node
* @param tree the TinyTree
* @param nodeNr the internal node number
* @return a value representing the compressed whitespace content
* @see CompressedWhitespace
*/
public static long getLongValue(TinyTree tree, int nodeNr) {
return ((long)tree.alpha[nodeNr]<<32) | ((long)tree.beta[nodeNr] & 0xffffffffL);
}
/**
* Return the type of node.
* @return Type.TEXT
*/
public final int getNodeKind() {
return Type.TEXT;
}
/**
* Copy this node to a given outputter
*/
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException {
out.characters(getStringValueCS(), 0, 0);
}
}
//
// The contents of this file are subject to the Mozilla Public License Version 1.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.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
// See the License for the specific language governing rights and limitations under the License.
//
// The Original Code is: all this file.
//
// The Initial Developer of the Original Code is Michael H. Kay.
//
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
//
// Contributor(s): none.
//
| [
"ebruchez@orbeon.com"
] | ebruchez@orbeon.com |
3c201a7067a8e8447a642dfc039536c03b4ffde4 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-481-3-5-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/transformation/macro/MacroTransformation_ESTest.java | 17ea06ab10e2b9682572dea785ce8e9d6ee53ef0 | [] | 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 | 594 | java | /*
* This file was automatically generated by EvoSuite
* Thu Apr 02 09:50:12 UTC 2020
*/
package org.xwiki.rendering.internal.transformation.macro;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class MacroTransformation_ESTest extends MacroTransformation_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
e01922d4625c458211d1b2d947d96e49001de4b6 | 6c443ded584ba44306b7761549b78ca4fc02aa79 | /api/src/main/java/com/jxywkj/application/pet/api/consign/CouponApiController.java | 9d5777b73c0736a94a1e85239a371fcb4067c768 | [] | no_license | huji820/pet--consign-server | 4710d41a8b3792314479ee5e6220c696e6dbb226 | b05eeebac79361cb358ace2068ed244efe1d3b5b | refs/heads/master | 2023-01-25T02:54:25.398166 | 2020-12-09T11:40:57 | 2020-12-09T11:40:57 | 319,938,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | package com.jxywkj.application.pet.api.consign;
import com.jxywkj.application.pet.common.utils.JsonResult;
import com.jxywkj.application.pet.service.facade.consign.CustomerCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @ClassName CouponAPIController
* @Description 优惠券
* @Author LiuXiangLin
* @Date 2019/8/20 17:30
* @Version 1.0
**/
@Api(description = "优惠券")
@RestController
@RequestMapping("aip/coupon")
public class CouponApiController {
@Resource
CustomerCouponService customerCouponService;
@ApiOperation(value = "通过openId查询数据")
@GetMapping("/listByCustomerNo")
public JsonResult getByOpnId(@RequestParam("customerNo") String customerNo) {
return JsonResult.success(customerCouponService.listByCustomerNo(customerNo));
}
@ApiOperation(value = "通过customerNo查看用户是否领取新客大礼包 true 未领取 false 已领取")
@GetMapping("/getNewGiftBag")
public JsonResult getNewGiftBag(@RequestParam("customerNo")String customerNo){
return JsonResult.success(customerCouponService.getNewGiftBag(customerNo));
}
}
| [
"101835518@qq.com"
] | 101835518@qq.com |
381bd256c65fb0a69e319eb1c8779021b76e1609 | c096a03908fdc45f29574578b87662e20c1f12d4 | /com/src/main/java/lip/com/google/android/gms/internal/a.java | 1f91cb563f66306567e35586c9f83ae1fadb079a | [] | no_license | aboaldrdaaa2/Myappt | 3762d0572b3f0fb2fbb3eb8f04cb64c6506c2401 | 38f88b7924c987ee9762894a7a5b4f8feb92bfff | refs/heads/master | 2020-03-30T23:55:13.551721 | 2018-10-05T13:41:24 | 2018-10-05T13:41:24 | 151,718,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,289 | java | package lip.com.google.android.gms.internal;
public enum a {
ADVERTISER_ID("_aid"),
ADVERTISING_TRACKING_ENABLED("_ate"),
APP_ID("_ai"),
APP_NAME("_an"),
APP_VERSION("_av"),
ARBITRARY_JAVASCRIPT("_jsm"),
CONSTANT("_c"),
COOKIE("_k"),
CUSTOM_VAR("_v"),
CONTAINER_VERSION("_ctv"),
DEBUG_MODE("_dbg"),
DEVICE_NAME("_dn"),
DEVICE_TYPE("_dt"),
DOM_ELEMENT("_d"),
EVENT("_e"),
FUNCTION_CALL("_func"),
JS_GLOBAL("_j"),
LANGUAGE("_l"),
OS_VERSION("_ov"),
PLATFORM("_p"),
RANDOM("_r"),
REFERRER("_f"),
RESOLUTION("_rs"),
RUNTIME_VERSION("_rv"),
SDK_VERSION("_sv"),
SIMPLE_MAP("_smm"),
TIME("_t"),
URL("_u"),
ADWORDS_CLICK_REFERRER("_awcr"),
DEVICE_ID("_did"),
ENCODE("_enc"),
GTM_VERSION("_gtmv"),
HASH("_hsh"),
INSTALL_REFERRER("_ir"),
JOINER("_jn"),
MOBILE_ADWORDS_UNIQUE_ID("_awid"),
REGEX_GROUP("_reg"),
DATA_LAYER_WRITE("_dlw"),
REGEX("_re"),
STARTS_WITH("_sw"),
ENDS_WITH("_ew"),
CONTAINS("_cn"),
EQUALS("_eq"),
LESS_THAN("_lt"),
LESS_EQUALS("_le"),
GREATER_THAN("_gt"),
GREATER_EQUALS("_ge"),
ARBITRARY_PIXEL("_img"),
ARBITRARY_HTML("_html"),
GOOGLE_TAG_MANAGER("_gtm"),
GOOGLE_ANALYTICS("_ga"),
ADWORDS_CONVERSION("_awct"),
SMART_PIXEL("_sp"),
FLOODLIGHT_COUNTER("_flc"),
FLOODLIGHT_SALES("_fls"),
BIZO_INSIGHT("_bzi"),
QUANTCAST_MEASUREMENT("_qcm"),
TARGUS_ADVISOR("_ta"),
MEDIAPLEX_ROI("_mpr"),
COMSCORE_MEASUREMENT("_csm"),
TURN_CONVERSION("_tc"),
TURN_DATA_COLLECTION("_tdc"),
MEDIA6DEGREES_UNIVERSAL_PIXEL("_m6d"),
UNIVERSAL_ANALYTICS("_ua"),
MEDIAPLEX_MCT("_mpm"),
VISUAL_DNA_CONVERSION("_vdc"),
GOOGLE_AFFILIATE_NETWORK("_gan"),
MARIN_SOFTWARE("_ms"),
ADROLL_SMART_PIXEL("_asp"),
CONFIGURATION_VALUE("_cv"),
CRITEO("_crt"),
TRUSTED_STORES("_ts"),
CLICK_TALE_STANDARD("_cts"),
LINK_CLICK_LISTENER("_lcl"),
FORM_SUBMIT_LISTENER("_fsl"),
TIMER_LISTENER("_tl"),
CLICK_LISTENER("_cl"),
JS_ERROR_LISTENER("_jel");
private final String name;
private a(String str) {
this.name = str;
}
public String toString() {
return this.name;
}
}
| [
"aboaldrdaaa2@gmail.com"
] | aboaldrdaaa2@gmail.com |
e206dba59d3b14782bf37f17815981a6b9605964 | e1a9e8b5af06609cc41e54363b693ce34776a29e | /src/main/java/org/yelong/core/jdbc/sql/AbstractSqlFragment.java | 75be697eab7cc10aeb14e70f3eaca2c5c4c8d038 | [] | no_license | yelong0216/yelong-core | 4c3b32a2d8d783698cbc8a5c0491dd638ab99cf1 | 206ae0c6ec5dd3ae7e532d632866d7f4e6ba8284 | refs/heads/master | 2022-06-22T09:46:38.427834 | 2020-11-19T01:38:07 | 2020-11-19T01:38:07 | 248,439,479 | 0 | 0 | null | 2022-06-21T04:01:46 | 2020-03-19T07:37:08 | Java | UTF-8 | Java | false | false | 513 | java | /**
*
*/
package org.yelong.core.jdbc.sql;
import java.util.Objects;
import org.yelong.core.jdbc.dialect.Dialect;
/**
* 抽象的sql片段
*/
public abstract class AbstractSqlFragment implements SqlFragment {
private final Dialect dialect;
public AbstractSqlFragment(final Dialect dialect) {
this.dialect = Objects.requireNonNull(dialect);
}
public Dialect getDialect() {
return dialect;
}
@Override
public String toString() {
return getSqlFragment();
}
}
| [
"yl1430834495@163.com"
] | yl1430834495@163.com |
f786aa2e064e33fb5108331a27b638441df737d0 | a7628c3d7c5523f08f6abe739748d7308c9ddb53 | /tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/detector/server/wildfly81/OperateWildFly81.java | e16f0e5309953cfcbf6d497dd9d10240c83bab6e | [] | no_license | adietish/jbosstools-integration-tests | 8569e6692f2f1995039744d94c6eae672cfb6c41 | d62e5d6b8d530d70f178daf647b2669a4ddada8e | refs/heads/master | 2020-12-26T03:23:40.040874 | 2017-01-12T10:33:48 | 2017-01-12T10:33:48 | 66,683,262 | 0 | 0 | null | 2016-08-26T22:33:50 | 2016-08-26T22:33:50 | null | UTF-8 | Java | false | false | 400 | java | package org.jboss.tools.runtime.as.ui.bot.test.detector.server.wildfly81;
import org.jboss.reddeer.requirements.jre.JRERequirement.JRE;
import org.jboss.tools.runtime.as.ui.bot.test.template.OperateServerTemplate;
@JRE(cleanup=true, value=1.8)
public class OperateWildFly81 extends OperateServerTemplate {
@Override
protected String getServerName() {
return DetectWildFly81.SERVER_NAME;
}
}
| [
"vpakan@redhat.com"
] | vpakan@redhat.com |
4f9aca9e337d88df4eed2c65b773cce46f50a459 | 96f8d42c474f8dd42ecc6811b6e555363f168d3e | /baike/sources/qsbk/app/slide/NewsRecommendThreeImage.java | ff424ada07a2d6de74d15ed426166e1e499d0d46 | [] | no_license | aheadlcx/analyzeApk | 050b261595cecc85790558a02d79739a789ae3a3 | 25cecc394dde4ed7d4971baf0e9504dcb7fabaca | refs/heads/master | 2020-03-10T10:24:49.773318 | 2018-04-13T09:44:45 | 2018-04-13T09:44:45 | 129,332,351 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,576 | java | package qsbk.app.slide;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import qsbk.app.fragments.BaseFragment;
import qsbk.app.model.News;
import qsbk.app.widget.qbnews.recommend.ThreeImageNewsRecommendCell;
@Deprecated
public class NewsRecommendThreeImage extends BaseFragment {
private News a;
private int b;
public static NewsRecommendThreeImage newInstance(News news, int i) {
NewsRecommendThreeImage newsRecommendThreeImage = new NewsRecommendThreeImage();
Bundle bundle = new Bundle();
bundle.putSerializable(bo.NEWS.getTypeValue(), news);
bundle.putInt("position", i);
newsRecommendThreeImage.setArguments(bundle);
return newsRecommendThreeImage;
}
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.a = (News) getArguments().getSerializable(bo.NEWS.getTypeValue());
this.b = getArguments().getInt("position");
if (this.a == null) {
return null;
}
ThreeImageNewsRecommendCell threeImageNewsRecommendCell = new ThreeImageNewsRecommendCell();
threeImageNewsRecommendCell.performCreate(this.b, viewGroup, this.a);
threeImageNewsRecommendCell.performUpdate(this.b, viewGroup, this.a);
return threeImageNewsRecommendCell.getCellView();
}
public void onViewCreated(View view, @Nullable Bundle bundle) {
super.onViewCreated(view, bundle);
}
}
| [
"aheadlcxzhang@gmail.com"
] | aheadlcxzhang@gmail.com |
65281e25cb578a5fbc429c7f86805f962d1a2f93 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_c5c5cf0fa89e03a1fa8656d07df39121263c8a8d/Markdown_1_1_Test/16_c5c5cf0fa89e03a1fa8656d07df39121263c8a8d_Markdown_1_1_Test_s.java | e367957ab4594ecd57534c6c5bd57760eae8d41c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,344 | java | /*
* Copyright 2011, TAUTUA
*
* 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.tautua.markdownpapers;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
import java.io.*;
import java.util.Arrays;
import java.util.List;
/**
* @author Larry Ruiz
*/
@RunWith(LabelledParameterized.class)
public class Markdown_1_1_Test extends BaseTest {
private static final File OUTPUT_DIR = new File("target/output/1.1/basics");
private static final File INPUT_DIR = new File("target/test-classes/1.1/basics");
public Markdown_1_1_Test(String fileName) {
super(fileName, INPUT_DIR, OUTPUT_DIR, ".text", ".xhtml");
}
@Parameters
public static List<Object[]> data() {
return Arrays.asList(new Object[][]{
{"Amps and angle encoding"},
{"Auto links"},
{"Backslash escapes"},
{"Blockquotes with code blocks"},
{"Code Blocks"},
{"Code Spans"},
{"Hard-wrapped paragraphs with list-like lines"},
{"Horizontal rules"},
{"Images"},
{"Inline HTML (Advanced)"},
{"Inline HTML (Simple)"},
{"Inline HTML comments"},
{"Links, inline style"},
{"Links, reference style"},
{"Links, shortcut references"},
{"Literal quotes in titles"},
{"Markdown Documentation - Basics"},
{"Markdown Documentation - Syntax"},
{"Nested blockquotes"},
{"Ordered and unordered lists"},
{"Strong and em together"},
{"Tabs"},
{"Tidyness"}
});
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
b3e6381fb526b13f4f8e30b1791df68e62deb39f | dc9b239189ff1e7c6ff220b3649d1048e17221d0 | /src/main/java/reactor/core/publisher/ParallelCollect.java | 7888e3e5778a0202a7873c66ac6a6be88ab97cea | [
"Apache-2.0"
] | permissive | josecarloscanova/reactor-core | 0d7b4839f34731531771dc4f75ca258a78464770 | c883dbdc91960f22186bae99ea1f2213a99c74a4 | refs/heads/master | 2021-01-21T16:15:00.549653 | 2016-08-18T23:55:48 | 2016-08-18T23:55:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,710 | java | /*
* Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package reactor.core.publisher;
import java.util.function.*;
import org.reactivestreams.*;
import reactor.core.Fuseable;
/**
* Reduce the sequence of values in each 'rail' to a single value.
*
* @param <T> the input value type
* @param <C> the collection type
*/
final class ParallelCollect<T, C> extends ParallelFlux<C> implements Fuseable {
final ParallelFlux<? extends T> source;
final Supplier<C> initialCollection;
final BiConsumer<C, T> collector;
public ParallelCollect(ParallelFlux<? extends T> source,
Supplier<C> initialCollection, BiConsumer<C, T> collector) {
this.source = source;
this.initialCollection = initialCollection;
this.collector = collector;
}
@Override
public long getPrefetch() {
return Long.MAX_VALUE;
}
@Override
public void subscribe(Subscriber<? super C>[] subscribers) {
if (!validate(subscribers)) {
return;
}
int n = subscribers.length;
@SuppressWarnings("unchecked")
Subscriber<T>[] parents = new Subscriber[n];
for (int i = 0; i < n; i++) {
C initialValue;
try {
initialValue = initialCollection.get();
} catch (Throwable ex) {
reportError(subscribers, Operators.onOperatorError(ex));
return;
}
if (initialValue == null) {
reportError(subscribers, new NullPointerException("The initialSupplier returned a null value"));
return;
}
parents[i] = new ParallelCollectSubscriber<>(subscribers[i], initialValue, collector);
}
source.subscribe(parents);
}
void reportError(Subscriber<?>[] subscribers, Throwable ex) {
for (Subscriber<?> s : subscribers) {
Operators.error(s, ex);
}
}
@Override
public int parallelism() {
return source.parallelism();
}
@Override
public boolean isOrdered() {
return false;
}
static final class ParallelCollectSubscriber<T, C> extends
Operators.MonoSubscriber<T, C> {
final BiConsumer<C, T> collector;
C collection;
Subscription s;
boolean done;
public ParallelCollectSubscriber(Subscriber<? super C> subscriber,
C initialValue, BiConsumer<C, T> collector) {
super(subscriber);
this.collection = initialValue;
this.collector = collector;
}
@Override
public void onSubscribe(Subscription s) {
if (Operators.validate(this.s, s)) {
this.s = s;
subscriber.onSubscribe(this);
s.request(Long.MAX_VALUE);
}
}
@Override
public void onNext(T t) {
if (done) {
return;
}
try {
collector.accept(collection, t);
} catch (Throwable ex) {
onError(Operators.onOperatorError(this, ex, t));
}
}
@Override
public void onError(Throwable t) {
if (done) {
Operators.onErrorDropped(t);
return;
}
done = true;
collection = null;
subscriber.onError(t);
}
@Override
public void onComplete() {
if (done) {
return;
}
done = true;
C c = collection;
collection = null;
complete(c);
}
@Override
public void cancel() {
super.cancel();
s.cancel();
}
}
}
| [
"smaldini@pivotal.io"
] | smaldini@pivotal.io |
b505c84e1dae7a50a24e535f47f9e61ed74a94bd | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project326/src/main/java/org/gradle/test/performance/largejavamultiproject/project326/p1631/Production32624.java | f650eb774bd285d86237fda4ee619bdc519d3da8 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package org.gradle.test.performance.largejavamultiproject.project326.p1631;
public class Production32624 {
private Production32621 property0;
public Production32621 getProperty0() {
return property0;
}
public void setProperty0(Production32621 value) {
property0 = value;
}
private Production32622 property1;
public Production32622 getProperty1() {
return property1;
}
public void setProperty1(Production32622 value) {
property1 = value;
}
private Production32623 property2;
public Production32623 getProperty2() {
return property2;
}
public void setProperty2(Production32623 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
89c56869d7a10cf3ff87be2d1d4db4d3321e7496 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/28/28_5bf2d65d7e875ed9b51cba0cd037aa7b3e817c95/SignupService/28_5bf2d65d7e875ed9b51cba0cd037aa7b3e817c95_SignupService_s.java | dbff78a4f9d519cb38bd6ca45f314dcebb901372 | [] | 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 | 627 | java | package org.jboss.errai.demo.todo.shared;
import org.jboss.errai.bus.server.annotations.Remote;
@Remote
public interface SignupService {
/**
* Attempts to register a new user in the system.
*
* @param newUserObject
* The data about the user to register.
* @return a copy of the newly registered User with its ID filled in.
* @throws RegistrationException
* if the signup is not possible (for example, disallowed password;
* email address already in use; etc).
*/
User register(User newUserObject, String password) throws RegistrationException;
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f7e2e7c8293cd5d7bfa6eb274371d54e6e813eb8 | 4bbfa242353fe0485fb2a1f75fdd749c7ee05adc | /itable/src/main/java/com/ailk/openbilling/persistence/itable/dao/IGroupDaoImpl.java | e0be2117cdf6352aba8dc5eb00d1285a155d4aca | [] | no_license | 859162000/infosystem | 88b23a5b386600503ec49b14f3b4da4df7a6d091 | 96d4d50cd9964e713bb95520d6eeb7e4aa32c930 | refs/heads/master | 2021-01-20T04:39:24.383807 | 2017-04-01T10:59:24 | 2017-04-01T10:59:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | package com.ailk.openbilling.persistence.itable.dao;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
public class IGroupDaoImpl extends IGroupDaoSkeleton implements IGroupDao{
private Log log = LogFactory.getLog(IGroupDaoImpl.class);
} | [
"ljyshiqian@126.com"
] | ljyshiqian@126.com |
6d9e62528729f5ba91c3194e78d702d4250ec5e9 | a6e2cd9ea01bdc5cfe58acce25627786fdfe76e9 | /src/main/java/com/alipay/api/domain/KoubeiRetailWmsOutboundworkDeleteModel.java | 07a372408708fe10693e15cbab134abea43a1de2 | [
"Apache-2.0"
] | permissive | cc-shifo/alipay-sdk-java-all | 38b23cf946b73768981fdeee792e3dae568da48c | 938d6850e63160e867d35317a4a00ed7ba078257 | refs/heads/master | 2022-12-22T14:06:26.961978 | 2020-09-23T04:00:10 | 2020-09-23T04:00:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 删除出库作业记录
*
* @author auto create
* @since 1.0, 2018-04-26 16:34:11
*/
public class KoubeiRetailWmsOutboundworkDeleteModel extends AlipayObject {
private static final long serialVersionUID = 3878324986217329625L;
/**
* 操作上下文
*/
@ApiField("operate_context")
private OperateContext operateContext;
/**
* 出库作业id
*/
@ApiField("outbound_work_id")
private String outboundWorkId;
public OperateContext getOperateContext() {
return this.operateContext;
}
public void setOperateContext(OperateContext operateContext) {
this.operateContext = operateContext;
}
public String getOutboundWorkId() {
return this.outboundWorkId;
}
public void setOutboundWorkId(String outboundWorkId) {
this.outboundWorkId = outboundWorkId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
8320ab791a213e23620a8ce4a7d2ea2fcd06b89b | bccc159c3063829cbd66d845c9f0e12aa93cb5f2 | /Exercise15.6/src/client/view/ClientTaskListConsole.java | 84c87c2fb2809ae1de0f541c005443b3d6c1baeb | [] | no_license | 11michi11/SDJ2 | 012e60437376f04e708643ac7fc1a91eba24fb4f | 46138e29290465f789961eb4f0d3b9625b0b6b1b | refs/heads/master | 2018-09-07T12:53:47.265852 | 2018-06-09T16:35:19 | 2018-06-09T16:35:19 | 120,578,391 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | package client.view;
import java.util.Observable;
import java.util.Scanner;
import client.controller.ClientTaskListConstroller;
public class ClientTaskListConsole implements TaskListView, Runnable {
private Scanner input;
private ClientTaskListConstroller controller;
public ClientTaskListConsole() {
input = new Scanner(System.in);
controller = null;
}
@Override
public String get(String text) {
System.out.println(text);
return input.nextLine();
}
@Override
public void show(String text) {
System.out.println(text);
}
@Override
public void startView(ClientTaskListConstroller controller) {
this.controller = controller;
Thread t = new Thread(this);
t.start();
}
@Override
public void run() {
int choice;
do {
choice = Integer.parseInt(get("1) Type 1 for \"ADD\"\n"
+ "2) Type 2 to \"GET\"\n" + "3) Type 3 to get the \"SIZE\"\n"
+ "0) Type 0 to \"EXIT\"\nEnter choice: "));
controller.execute(choice);
} while (choice != 0);
}
@Override
public void update(Observable arg0, Object arg1) {
show((String)arg1);
}
}
| [
"11michi11@gmail.com"
] | 11michi11@gmail.com |
b2dc156b21f6d424f3c1182e4a46d64b2e891105 | 7ee02c9ba2f22eadac01d4a60022d6e0fb66d6aa | /src/main/java/io/ruin/model/activities/raids/xeric/chamber/combat/Guardian.java | 09ba32c4238b68b9e3420b0ed262edbb86a047e0 | [] | no_license | Dmm-PS/os-fatality-184-runesuite | 1e5bbf3b9adc0e29132ee8c6131fbed0829fe58e | 655799fc3c56432055d91942a77992fd46bd2930 | refs/heads/master | 2022-07-26T02:15:42.725068 | 2020-05-24T21:20:03 | 2020-05-24T21:20:03 | 266,625,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,774 | java | package io.ruin.model.activities.raids.xeric.chamber.combat;
import io.ruin.api.utils.Random;
import io.ruin.model.World;
import io.ruin.model.combat.Hit;
import io.ruin.model.entity.npc.NPCCombat;
import io.ruin.model.entity.shared.listeners.HitListener;
import io.ruin.model.inter.utils.Config;
import io.ruin.model.map.Position;
import io.ruin.model.map.Projectile;
import io.ruin.model.skills.prayer.Prayer;
import io.ruin.utility.Misc;
public class Guardian extends NPCCombat {
private static final Projectile PROJECTILE = new Projectile(856, 150, 0, 0, 50, 0, 0, 0);
@Override
public void init() {
npc.hitListener = new HitListener().preDefend(this::preDefend);
}
@Override
public void startDeath(Hit killHit) {
setDead(true);
npc.faceNone(false);
npc.animate(info.death_animation);
npc.addEvent(event -> {
event.delay(3);
npc.transform(npc.getId() + 2);
});
npc.attackNpcListener = (player, npc1, message) -> {
if (message) player.sendMessage("It's already destroyed.");
return false;
};
if (getKiller() != null) {
super.dropItems(getKiller());
}
}
private void preDefend(Hit hit) {
if ((hit.attackStyle != null && !hit.attackStyle.isMelee())
|| hit.attacker != null && hit.attacker.player != null && Config.WEAPON_TYPE.get(hit.attacker.player) != 11) {
hit.block();
if (hit.attacker.player != null)
hit.attacker.player.sendMessage("The Guardian resists your attack.");
}
}
@Override
public void follow() {
//DONT move
}
@Override
public boolean attack() {
if (Misc.getEffectiveDistance(npc, target) > 1)
return false;
if (Random.rollDie(6,1))
dropBoulder();
else
meleeAttack();
return true;
}
private void meleeAttack() {
int maxDamage = info.max_damage;
if (target.player != null && target.player.getPrayer().isActive(Prayer.PROTECT_FROM_MELEE))
maxDamage /= 2;
npc.animate(info.attack_animation);
target.hit(new Hit(npc, info.attack_style).randDamage(maxDamage).ignorePrayer());
}
private void dropBoulder() {
npc.animate(4278);
Position pos = target.getPosition().copy();
World.sendGraphics(305, 35, PROJECTILE.send(npc, pos.getX(), pos.getY()), pos);
npc.addEvent(event -> {
event.delay(1);
npc.localPlayers().forEach(p -> {
if (p.getPosition().equals(pos)) {
p.hit(new Hit().randDamage(40).delay(0));
}
});
});
}
}
| [
"tardisfan121@gmail.com"
] | tardisfan121@gmail.com |
92225772051d007d5e5f30202a0ddfd1452a4f33 | 832bc04a2ebe67f20a47378df6d042c217584375 | /src/java/javainterview/java/oca/chapter04/arrays/Question10.java | 3160939b28420d034f682585c9d1530f57a5cdfe | [] | no_license | truongquangkhai99/javainterview | 250486401ff82ce279ee55525cfa7661ac6e954d | 273150d6c7a03990952963cc9f82795402010aed | refs/heads/master | 2022-12-15T22:59:53.754504 | 2020-09-18T09:29:40 | 2020-09-18T09:29:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,001 | java | package javainterview.java.oca.chapter04.arrays;
/**
* @author Mariana Azevedo
* @since 14/07/2019
*
* Question 1.4.10 (page 172) - Choose the appropriate option when attempting to compile
* and run the following file:
*
* class A {
* public static void main(String[] args) {
* int zyx[][]=new int[3][];
* int[]x=new int[20];
* int[]y=new int[10];
* int[]z=new int[30];
* zyx[0]=x;
* zyx[1]=y;
* zyx[2]=z;
* System.out.println(zyx[2].length);
* }
* }
*
* a) Doesn't compile, error declaring zyx.
* b) Compile and give error when trying to assign the second array to zyx.
* c) Compile and give error when trying to print array size.
* d) Compiles and prints 10.
* e) Compiles and prints 20.
* f) Compiles and prints 30. (x)
*/
class Question10 {
public static void main(String[] args) {
int zyx[][]=new int[3][];
int[]x=new int[20];
int[]y=new int[10];
int[]z=new int[30];
zyx[0]=x;
zyx[1]=y;
zyx[2]=z;
System.out.println(zyx[2].length);
}
}
| [
"tinvuquang@admicro.vn"
] | tinvuquang@admicro.vn |
81100c366f587b7e1e3d55b582fa119a7bf938ee | c26912f3375141bb2fb3c07357289f20d88bcf2d | /JavaAlgorithm/src/main/java/algo/tzashinorpu/SpecialSubject/TopInterview2Round/isMatch_10.java | e844415e93e5b3af94a88abd2102c25cfcab334d | [
"MIT"
] | permissive | TzashiNorpu/Algorithm | 2013b5781d0ac517f2857633c39aee7d2e64d240 | bc9155c4daf08041041f84c2daa9cc89f82c2240 | refs/heads/main | 2023-07-08T06:30:50.080352 | 2023-06-28T10:01:58 | 2023-06-28T10:01:58 | 219,323,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package algo.tzashinorpu.SpecialSubject.TopInterview2Round;
public class isMatch_10 {
public boolean isMatch_dfs(String s, String p) {
/*
'.' Matches any single character
'*' Matches zero or more of the preceding element
aaa a*
b a*b
a .*
*/
if (p.isEmpty()) return s.isEmpty();
boolean first_match = !s.isEmpty() && (p.charAt(0) == s.charAt(0) || p.charAt(0) == '.');
if (p.length() > 1 && p.charAt(1) == '*') {
// 0 次 | 多次
return (first_match && isMatch_dfs(s.substring(1), p)) || isMatch_dfs(s, p.substring(2));
} else {
return first_match && isMatch_dfs(s.substring(1), p.substring(1));
}
}
}
| [
"tzashinorpu@gmail.com"
] | tzashinorpu@gmail.com |
497536c1432199fd71155196222c6237401eb914 | fd69e33af223c709e6069fe8f847e953d6274adc | /server-core/src/main/java/io/onedev/server/event/agent/AgentConnected.java | eb852bd25bd7bac67710f1604fa715685ad2428e | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | happyguy1986/onedev | 12e0908ad4ae231845b8c2d3e120e2b6ceb192e6 | 34b9742c4083c92284a3a0c852d086ce689bc4d4 | refs/heads/master | 2023-06-22T18:00:28.011111 | 2023-06-11T14:08:02 | 2023-06-11T14:08:02 | 273,154,430 | 0 | 0 | MIT | 2020-06-18T06:00:08 | 2020-06-18T05:59:53 | null | UTF-8 | Java | false | false | 187 | java | package io.onedev.server.event.agent;
import io.onedev.server.model.Agent;
public class AgentConnected extends AgentEvent {
public AgentConnected(Agent agent) {
super(agent);
}
}
| [
"robin@onedev.io"
] | robin@onedev.io |
d49f21e47816fd11b4b2120903f1b916484d7644 | c5c9b0183f39b4d770ad045867329c725792a496 | /guava-tests/test/com/google/common/cache/TestingCacheLoaders.java | c9fd9573ae63634140156fc28e2834118fa4e636 | [
"Apache-2.0"
] | permissive | nicky-chen/guava-study | 36dae7ce48a7fe3648f26356a2d12a79c5f802ac | 62d4bbe9d5b93facd249dafd0b8da13bb68fb7b1 | refs/heads/master | 2021-04-06T20:25:30.800910 | 2018-03-15T08:45:16 | 2018-03-15T08:45:46 | 125,335,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,038 | java | /*
* Copyright (C) 2011 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.common.cache;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Utility {@link CacheLoader} implementations intended for use in testing.
*
* @author mike nonemacher
*/
@GwtCompatible(emulated = true)
class TestingCacheLoaders {
/**
* Returns a {@link CacheLoader} that implements a naive {@link CacheLoader#loadAll}, delegating
* {@link CacheLoader#load} calls to {@code loader}.
*/
static <K, V> CacheLoader<K, V> bulkLoader(final CacheLoader<K, V> loader) {
checkNotNull(loader);
return new CacheLoader<K, V>() {
@Override
public V load(K key) throws Exception {
return loader.load(key);
}
@Override
public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
Map<K, V> result = Maps.newHashMap(); // allow nulls
for (K key : keys) {
result.put(key, load(key));
}
return result;
}
};
}
/** Returns a {@link CacheLoader} that returns the given {@code constant} for every request. */
static <K, V> ConstantLoader<K, V> constantLoader(@NullableDecl V constant) {
return new ConstantLoader<>(constant);
}
/** Returns a {@link CacheLoader} that returns the given {@code constant} for every request. */
static IncrementingLoader incrementingLoader() {
return new IncrementingLoader();
}
/** Returns a {@link CacheLoader} that throws the given error for every request. */
static <K, V> CacheLoader<K, V> errorLoader(final Error e) {
checkNotNull(e);
return new CacheLoader<K, V>() {
@Override
public V load(K key) {
throw e;
}
};
}
/** Returns a {@link CacheLoader} that throws the given exception for every request. */
static <K, V> CacheLoader<K, V> exceptionLoader(final Exception e) {
checkNotNull(e);
return new CacheLoader<K, V>() {
@Override
public V load(K key) throws Exception {
throw e;
}
};
}
/** Returns a {@link CacheLoader} that returns the key for every request. */
static <T> IdentityLoader<T> identityLoader() {
return new IdentityLoader<T>();
}
/**
* Returns a {@code new Object()} for every request, and increments a counter for every request.
* The count is accessible via {@link #getCount}.
*/
static class CountingLoader extends CacheLoader<Object, Object> {
private final AtomicInteger count = new AtomicInteger();
@Override
public Object load(Object from) {
count.incrementAndGet();
return new Object();
}
public int getCount() {
return count.get();
}
}
static final class ConstantLoader<K, V> extends CacheLoader<K, V> {
private final V constant;
ConstantLoader(V constant) {
this.constant = constant;
}
@Override
public V load(K key) {
return constant;
}
}
/**
* Returns a {@code new Object()} for every request, and increments a counter for every request.
* An {@code Integer} loader that returns the key for {@code load} requests, and increments the
* old value on {@code reload} requests. The load counts are accessible via {@link #getLoadCount}
* and {@link #getReloadCount}.
*/
static class IncrementingLoader extends CacheLoader<Integer, Integer> {
private final AtomicInteger countLoad = new AtomicInteger();
private final AtomicInteger countReload = new AtomicInteger();
@Override
public Integer load(Integer key) {
countLoad.incrementAndGet();
return key;
}
@GwtIncompatible // reload
@Override
public ListenableFuture<Integer> reload(Integer key, Integer oldValue) {
countReload.incrementAndGet();
return Futures.immediateFuture(oldValue + 1);
}
public int getLoadCount() {
return countLoad.get();
}
public int getReloadCount() {
return countReload.get();
}
}
static final class IdentityLoader<T> extends CacheLoader<T, T> {
@Override
public T load(T key) {
return key;
}
}
}
| [
"cx52018761@hotmail.com"
] | cx52018761@hotmail.com |
563fb24263f88e22f2ac7c736d3acddc52e4639b | ebd2bbc19f85bec0aec634bd9294fa1945e32061 | /dependencies/woden/1.0.0.M9-wso2v1/woden-tests/src/test/java/testcase/documentation/extension/DocExtensionNoNSTest.java | 5b995ed4ad808285bd69b22af4f3ef96761baf4e | [] | no_license | madusankap/turing-1 | da645af4886d562667dfd2f61b4aa184da093340 | 04edf79deefbe751f0dee518b3891f816cec2dbc | refs/heads/master | 2019-01-02T01:46:09.216852 | 2014-12-18T11:04:09 | 2014-12-18T11:04:09 | 28,171,116 | 0 | 1 | null | 2023-03-20T11:52:10 | 2014-12-18T06:21:53 | Java | UTF-8 | Java | false | false | 3,830 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package testcase.documentation.extension;
import java.net.URL;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.woden.ErrorHandler;
import org.apache.woden.WSDLFactory;
import org.apache.woden.WSDLReader;
import org.apache.woden.resolver.SimpleURIResolverTest;
import org.apache.woden.tests.TestErrorHandler;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.extensions.UnknownExtensionElement;
import org.apache.woden.wsdl20.xml.DescriptionElement;
import org.apache.woden.wsdl20.xml.DocumentationElement;
/**
* Test that when no default namespace is declared in the WSDL,
* that documentation extension elements with no namespace are
* represented correctly - they should return a null NS uri.
*/
public class DocExtensionNoNSTest extends TestCase {
public static Test suite()
{
return new TestSuite(DocExtensionNoNSTest.class);
}
protected void setUp() throws Exception {
super.setUp();
}
public void testNSUriIsNull() throws Exception {
URL wsdlURL = getClass().getClassLoader().getResource("testcase/documentation/extension/resources/nonamespace.wsdl");
assertNotNull("Failed to find nonamespace.wsdl on the classpath",wsdlURL);
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
ErrorHandler handler = new TestErrorHandler();
reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
reader.getErrorReporter().setErrorHandler(handler);
Description descComp = reader.readWSDL(wsdlURL.toString());
assertNotNull("The reader did not return a WSDL description.", descComp);
DescriptionElement desc = descComp.toElement();
DocumentationElement doc = null;
UnknownExtensionElement ee = null;
//wsdl:description
doc = desc.getDocumentationElements()[0];
ee = (UnknownExtensionElement)doc.getExtensionElements()[0];
assertNull(ee.getElement().getNamespaceURI());
//wsdl:types
doc=desc.getTypesElement().getDocumentationElements()[0];
ee = (UnknownExtensionElement)doc.getExtensionElements()[0];
assertNull(ee.getElement().getNamespaceURI());
//wsdl:interface
doc=desc.getInterfaceElements()[0].getDocumentationElements()[0];
ee = (UnknownExtensionElement)doc.getExtensionElements()[0];
assertNull(ee.getElement().getNamespaceURI());
//wsdl:binding
doc=desc.getBindingElements()[0].getDocumentationElements()[0];
ee = (UnknownExtensionElement)doc.getExtensionElements()[0];
assertNull(ee.getElement().getNamespaceURI());
//wsdl:service
doc=desc.getServiceElements()[0].getDocumentationElements()[0];
ee = (UnknownExtensionElement)doc.getExtensionElements()[0];
assertNull(ee.getElement().getNamespaceURI());
}
}
| [
"tharindua@wso2.com"
] | tharindua@wso2.com |
712616d4ecbdd4de90ced109da824f249eb98fa3 | 74b2092269dd5a2f6c2ba41300eb40bdb36327f7 | /core/src/com/johnblakeduffie/game/states/State.java | 8fb711a7896d8690711ffa6a016c3302d4ab7a94 | [] | no_license | johnblakeduffie/JetpackJack | 9485d19a11867739474c2c8da2feb7b8d0f1cbcb | 6080d5ac07583a12450818148ee7a8760c975da8 | refs/heads/master | 2021-01-16T19:10:54.465995 | 2017-09-29T18:22:35 | 2017-09-29T18:22:35 | 100,149,054 | 0 | 0 | null | 2018-03-03T05:52:19 | 2017-08-13T02:32:15 | Java | UTF-8 | Java | false | false | 687 | java | package com.johnblakeduffie.game.states;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector3;
/**
* Created by johnblakeduffie on 7/15/17.
*/
public abstract class State {
protected OrthographicCamera cam;
protected Vector3 mouse;
protected GameStateManager gsm;
protected State(GameStateManager gsm){
this.gsm = gsm;
cam = new OrthographicCamera();
mouse = new Vector3();
}
protected abstract void handleInput();
public abstract void update(float dt);
public abstract void render(SpriteBatch sb);
public abstract void dispose();
}
| [
"you@example.com"
] | you@example.com |
ae61f1e94f39ebcf60fe04199fc781d975829b45 | 5e224ff6d555ee74e0fda6dfa9a645fb7de60989 | /database/src/main/java/adila/db/s120.java | d544d84cd8d8c8b93086ce0f96d081c13502d6af | [
"MIT"
] | permissive | karim/adila | 8b0b6ba56d83f3f29f6354a2964377e6197761c4 | 00f262f6d5352b9d535ae54a2023e4a807449faa | refs/heads/master | 2021-01-18T22:52:51.508129 | 2016-11-13T13:08:04 | 2016-11-13T13:08:04 | 45,054,909 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 189 | java | // This file is automatically generated.
package adila.db;
/*
* KT Tech
*
* DEVICE: s120
* MODEL: KM-S120
*/
final class s120 {
public static final String DATA = "KT Tech||";
}
| [
"keldeeb@gmail.com"
] | keldeeb@gmail.com |
0713b23c7c5cbe478361f42dc5ab076d398292a0 | ea65352c3cc9288eb66a5c1c98a2de7a6a7f6a4b | /src/main/java/net/simpleframework/lib/net/minidev/asm/FieldFilter.java | 7f08264428062774ab96180d7c57cd3409dd3d51 | [] | no_license | simpleframework/simple-common | 5c95611bc48d9c82a9c81976c44c24024fe933db | 97a5c1954eaa2519629c39b7da0c2e1a1453b116 | refs/heads/master | 2021-07-13T03:55:25.417762 | 2021-07-01T07:06:58 | 2021-07-01T07:06:58 | 14,333,099 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 479 | java | package net.simpleframework.lib.net.minidev.asm;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
* allow to control read/write access to field
*
*/
public interface FieldFilter {
/**
* NOT Implemented YET
*/
public boolean canUse(Field field);
public boolean canUse(Field field, Method method);
/**
* NOT Implemented YET
*/
public boolean canRead(Field field);
/**
* NOT Implemented YET
*/
public boolean canWrite(Field field);
}
| [
"cknet@126.com"
] | cknet@126.com |
6b09726a728da74f6aa50c5d7e8124c5e9853e0a | 02bbe3550f1155a5a61ee4b1a33bdcca301fbe07 | /src/com/volmit/sys/util/ExecutiveRunnable.java | 6e94406d9b1764e949a5e29e0b5fbcfe5ba38924 | [] | no_license | cyberpwnn/SystemInfo | 9e0335dce0e0d58249d7ec51dccecf17d085be1a | a9422c12efb1302cd6caa05c3ef08511120b8cc0 | refs/heads/master | 2021-01-25T04:22:46.965566 | 2017-06-06T00:47:09 | 2017-06-06T00:47:09 | 93,436,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,283 | java | package com.volmit.sys.util;
/**
* The runnable callback for all iterators when next is fired
*
* @author cyberpwn
*
* @param <T>
* the iterator type
*/
public class ExecutiveRunnable<T> implements Runnable
{
private T next;
private Boolean cancelled;
private Boolean repeated;
/**
* Run the next iterable element
*
* @param next
* the nexted object
*/
public void run(T next)
{
this.next = next;
this.cancelled = false;
this.repeated = false;
run();
}
@Override
public void run()
{
}
/**
* The next object, calling this multiple times will yeild the same object
* in the same runnable iteration
*
* @return the element
*/
public T next()
{
return next;
}
/**
* Signal cancel to iterator
*/
public void cancel()
{
this.cancelled = true;
}
/**
* Is there a signal to cancel?
*
* @return true if cancelled
*/
public boolean isCancelled()
{
return cancelled;
}
/**
* Repeat this current element in the next iteration, then continue to the
* next element after that as normal.
*/
public void repeat()
{
this.repeated = true;
}
/**
* Is there a signal to repeat?
*
* @return true if yes
*/
public boolean isRepeated()
{
return repeated;
}
}
| [
"danielmillst@gmail.com"
] | danielmillst@gmail.com |
1d119ad38becdaac66b11a4479b7b8eeffd20423 | 1a88b1ec7f4ba65d5c6d42f5e7822a6b04094acb | /src/com/proteus/GV/ext/Simple_arrayed_identifierContextExt.java | 344f17a62d193c19c655ff8a3857c3724a01a56c | [] | no_license | sureshgl/Gate-Verilog | 9dba7f568c9d65feb73fbaba18ad65a544037d7f | 824ad9fa5bd28870d2fbe03ef0060edf476fb171 | refs/heads/master | 2021-01-23T02:41:27.963016 | 2017-03-24T02:49:40 | 2017-03-24T02:49:40 | 86,020,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,091 | java | package com.proteus.GV.ext;
import org.antlr.v4.runtime.ParserRuleContext;
import lombok.Getter;
import com.proteus.GV.PopulateExtendedContextVisitor;
import com.proteus.GV.ANTLRv4.gen.GV_extParser.Simple_arrayed_identifierContext;
public class Simple_arrayed_identifierContextExt extends AbstractBaseExt{
@Getter private Simple_arrayed_identifierContext ctx;
public Simple_arrayed_identifierContextExt(Simple_arrayed_identifierContext ctx) {
this.ctx = ctx;
}
@Override
public ParserRuleContext getContext(){
return ctx;
}
@Override
public ParserRuleContext getContext(String str){
return new PopulateExtendedContextVisitor().visit(getPrimeParser(str).simple_arrayed_identifier());
}
@Override
public void setContext(ParserRuleContext ctx){
if(ctx != null){
if(ctx instanceof Simple_arrayed_identifierContext){
this.ctx = (Simple_arrayed_identifierContext) ctx;
} else {
throw new ClassCastException(ctx.getClass().getSimpleName() + " cannot be cased to "+Simple_arrayed_identifierContext.class.getName());
}
} else {
this.ctx= null;
}
}
} | [
"suresh.goduguluru@gmail.com"
] | suresh.goduguluru@gmail.com |
b02d1540754fc573f59d47538170f5e622b0b632 | 11587fb613dc30e18d2dae493000f4bed0245d2c | /src/test/java/com/moses/spring/config/LazyMainConfigTest.java | 4465b04cf3f76b639daa4653d192c44067e5ff37 | [] | no_license | mosesgi/spring-source | 3351bcc56548a23b64861cf2ba74d30223a1bd85 | 32e279b77a71e1aaf6c6f4cb2f4c5007bbb9b435 | refs/heads/master | 2022-07-09T22:51:53.200432 | 2019-10-22T03:05:57 | 2019-10-22T03:05:57 | 188,761,624 | 0 | 0 | null | 2022-06-21T01:14:20 | 2019-05-27T03:00:21 | Java | UTF-8 | Java | false | false | 504 | java | package com.moses.spring.config;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.moses.spring.entity.Person;
public class LazyMainConfigTest {
@Test
public void testApp() {
ApplicationContext app = new AnnotationConfigApplicationContext(LazyMainConfig.class);
System.out.println("IOC Container initialization complete.");
Person p1 = (Person)app.getBean("person");
}
}
| [
"jimuchen@163.com"
] | jimuchen@163.com |
712b3ffc6ed18d75a78060a94f85fd8abb25e7c3 | dc81649732414dee4d552a240b25cb3d055799b1 | /src/test/java/org/assertj/core/api/objectarray/ObjectArrayAssert_containsSubSequence_Test.java | bd2081c138fdba1ff4d3bdeb74262d165392c333 | [
"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,372 | 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.objectarray;
import org.assertj.core.api.ObjectArrayAssert;
import org.assertj.core.api.ObjectArrayAssertBaseTest;
import static org.assertj.core.util.Arrays.array;
import static org.mockito.Mockito.verify;
/**
* Tests for <code>{@link ObjectArrayAssert#containsSubsequence(Object[])}</code>.
*
* @author Filip Hrisfaov
*/
public class ObjectArrayAssert_containsSubSequence_Test extends ObjectArrayAssertBaseTest {
@Override
protected ObjectArrayAssert<Object> invoke_api_method() {
return assertions.containsSubsequence("Luke", "Yoda");
}
@Override
protected void verify_internal_effects() {
verify(arrays).assertContainsSubsequence(getInfo(assertions), getActual(assertions), array("Luke", "Yoda"));
}
}
| [
"joel.costigliola@gmail.com"
] | joel.costigliola@gmail.com |
6cc4fe6df49bf397462012b3a49499dd902b0750 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /fcc-20210331/src/main/java/com/aliyun/fcc20210331/models/GetAllVideoDevicesRequest.java | b1fca34e0b40e7c44dec05a860938fbb24c32b78 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 931 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.fcc20210331.models;
import com.aliyun.tea.*;
public class GetAllVideoDevicesRequest extends TeaModel {
@NameInMap("CorpId")
public String corpId;
@NameInMap("EdgeDeviceId")
public String edgeDeviceId;
public static GetAllVideoDevicesRequest build(java.util.Map<String, ?> map) throws Exception {
GetAllVideoDevicesRequest self = new GetAllVideoDevicesRequest();
return TeaModel.build(map, self);
}
public GetAllVideoDevicesRequest setCorpId(String corpId) {
this.corpId = corpId;
return this;
}
public String getCorpId() {
return this.corpId;
}
public GetAllVideoDevicesRequest setEdgeDeviceId(String edgeDeviceId) {
this.edgeDeviceId = edgeDeviceId;
return this;
}
public String getEdgeDeviceId() {
return this.edgeDeviceId;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
6f5d724152e6ed2c62b0bf809668fbc14cdb8310 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes6.dex_source_from_JADX/com/facebook/privacy/audience/InlinePrivacySurveyConfigDeserializer.java | 42e9c9c3a6eacbc21646efb6e41ddcf631014c2c | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,180 | java | package com.facebook.privacy.audience;
import com.facebook.common.json.FbJsonDeserializer;
import com.facebook.common.json.FbJsonField;
import com.facebook.common.json.GlobalAutoGenDeserializerCache;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.Sets;
import java.util.Map;
import java.util.Set;
/* compiled from: fetchReview */
public class InlinePrivacySurveyConfigDeserializer extends FbJsonDeserializer {
private static Map<String, FbJsonField> f14974a;
static {
GlobalAutoGenDeserializerCache.a(InlinePrivacySurveyConfig.class, new InlinePrivacySurveyConfigDeserializer());
m22576e();
}
public InlinePrivacySurveyConfigDeserializer() {
a(InlinePrivacySurveyConfig.class);
}
private static synchronized Map<String, FbJsonField> m22576e() {
Map<String, FbJsonField> map;
synchronized (InlinePrivacySurveyConfigDeserializer.class) {
if (f14974a == null) {
try {
Builder builder = new Builder();
builder.b("eligible", FbJsonField.jsonField(InlinePrivacySurveyConfig.class.getDeclaredField("mEligible")));
builder.b("trigger_option", FbJsonField.jsonField(InlinePrivacySurveyConfig.class.getDeclaredField("mTriggerPrivacyOption")));
builder.b("first_option", FbJsonField.jsonField(InlinePrivacySurveyConfig.class.getDeclaredField("mFirstSurveyOption")));
builder.b("second_option", FbJsonField.jsonField(InlinePrivacySurveyConfig.class.getDeclaredField("mSecondSurveyOption")));
f14974a = builder.b();
} catch (Throwable e) {
throw Throwables.propagate(e);
}
}
map = f14974a;
}
return map;
}
public final FbJsonField m22577a(String str) {
FbJsonField fbJsonField = (FbJsonField) m22576e().get(str);
return fbJsonField != null ? fbJsonField : super.a(str);
}
public static Set<String> getJsonFields() {
return Sets.b(m22576e().keySet());
}
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
b5e6e0cc6b9904deab066953bc123becfcefb7af | aac48d1d476b345eb3baac2cddd90f800a17951c | /ardor3d-core/trunk/src/com/ardor3d/util/stat/graph/AbstractStatGrapher.java | 9ae963d8472142174f00635c7120f9d54900216e | [
"Zlib",
"BSD-3-Clause"
] | permissive | stepheneb/ardor3dv1 | 7f146a2ef27cdce954251ea8b26b93e437684426 | a8938538427a079a9bebf644cedffb40c0e40985 | refs/heads/master | 2016-09-06T12:38:18.978105 | 2009-01-08T10:00:08 | 2009-01-08T10:00:08 | 103,306 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,701 | java | /**
* Copyright (c) 2008-2009 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
* Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
package com.ardor3d.util.stat.graph;
import java.util.HashMap;
import java.util.TreeMap;
import com.ardor3d.framework.DisplaySettings;
import com.ardor3d.image.Texture2D;
import com.ardor3d.math.ColorRGBA;
import com.ardor3d.renderer.Renderer;
import com.ardor3d.renderer.TextureRenderer;
import com.ardor3d.renderer.TextureRendererFactory;
import com.ardor3d.util.stat.StatListener;
import com.ardor3d.util.stat.StatType;
/**
* Base class for graphers.
*/
public abstract class AbstractStatGrapher implements StatListener {
protected TextureRenderer texRenderer;
protected Texture2D tex;
protected int gWidth, gHeight;
protected TreeMap<StatType, HashMap<String, Object>> config = new TreeMap<StatType, HashMap<String, Object>>();
protected boolean enabled = true;
/**
* Must be constructed in the GL thread.
*
* @param factory
*/
public AbstractStatGrapher(final int width, final int height, final Renderer renderer) {
gWidth = width;
gHeight = height;
// prepare our TextureRenderer
final DisplaySettings settings = new DisplaySettings(width, height, 0, 0, 0, 8, 0, 0, false);
texRenderer = TextureRendererFactory.INSTANCE.createTextureRenderer(settings, renderer,
TextureRenderer.Target.Texture2D);
if (texRenderer != null) {
texRenderer.setBackgroundColor(new ColorRGBA(ColorRGBA.BLACK));
}
}
// - set a texture for offscreen rendering
public void setTexture(final Texture2D tex) {
texRenderer.setupTexture(tex);
this.tex = tex;
}
public TextureRenderer getTexRenderer() {
return texRenderer;
}
public void clearConfig() {
config.clear();
}
public void clearConfig(final StatType type) {
if (config.get(type) != null) {
config.get(type).clear();
}
}
public void clearConfig(final StatType type, final String key) {
if (config.get(type) != null) {
config.get(type).remove(key);
}
}
public void addConfig(final StatType type, final HashMap<String, Object> configs) {
config.put(type, configs);
}
public void addConfig(final StatType type, final String key, final Object value) {
HashMap<String, Object> vals = config.get(type);
if (vals == null) {
vals = new HashMap<String, Object>();
config.put(type, vals);
}
vals.put(key, value);
}
protected ColorRGBA getColorConfig(final StatType type, final String configName, final ColorRGBA defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof ColorRGBA) {
return (ColorRGBA) val;
}
}
return defaultVal;
}
protected String getStringConfig(final StatType type, final String configName, final String defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof String) {
return (String) val;
}
}
return defaultVal;
}
protected short getShortConfig(final StatType type, final String configName, final short defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Number) {
return ((Number) val).shortValue();
}
}
return defaultVal;
}
protected int getIntConfig(final StatType type, final String configName, final int defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Number) {
return ((Number) val).intValue();
}
}
return defaultVal;
}
protected long getLongConfig(final StatType type, final String configName, final long defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Number) {
return ((Number) val).longValue();
}
}
return defaultVal;
}
protected float getFloatConfig(final StatType type, final String configName, final float defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Number) {
return ((Number) val).floatValue();
}
}
return defaultVal;
}
protected double getDoubleConfig(final StatType type, final String configName, final double defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Number) {
return ((Number) val).doubleValue();
}
}
return defaultVal;
}
protected boolean getBooleanConfig(final StatType type, final String configName, final boolean defaultVal) {
final HashMap<String, Object> vals = config.get(type);
if (vals != null && vals.containsKey(configName)) {
final Object val = vals.get(configName);
if (val instanceof Boolean) {
return (Boolean) val;
}
}
return defaultVal;
}
public boolean hasConfig(final StatType type) {
return config.containsKey(type) && !config.get(type).isEmpty();
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(final boolean enabled) {
this.enabled = enabled;
}
/**
* Called when the graph needs to be reset back to the original display state. (iow, remove all points, lines, etc.)
*/
public abstract void reset();
}
| [
"ardorlabs@82abaa13-a93f-4eff-8987-b3ae9fc18050"
] | ardorlabs@82abaa13-a93f-4eff-8987-b3ae9fc18050 |
ca3a53d5a0dacbb81a2959cecf23a94680d6835e | 5ca3901b424539c2cf0d3dda52d8d7ba2ed91773 | /src_procyon/y/f/c/q.java | e762864fb2b6813edfe9a24b9214068ee8c3ebbe | [] | no_license | fjh658/bindiff | c98c9c24b0d904be852182ecbf4f81926ce67fb4 | 2a31859b4638404cdc915d7ed6be19937d762743 | refs/heads/master | 2021-01-20T06:43:12.134977 | 2016-06-29T17:09:03 | 2016-06-29T17:09:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,398 | java | package y.f.c;
import java.util.*;
import y.c.*;
import y.g.*;
class q implements Comparator
{
private final h a;
q(final h a) {
this.a = a;
}
public int compare(final Object o, final Object o2) {
final d d = (d)o;
final d d2 = (d)o2;
final int b;
final int b2;
final int a = e.a(this.a.f[b = d.b()], this.a.f[b2 = d2.b()]);
if (a != 0) {
return a;
}
final int n = this.a.h[b];
final int n2 = this.a.h[b2];
if (n > 0) {
if (n2 > 0) {
return e.a(n, n2);
}
return -1;
}
else {
if (n2 > 0) {
return 1;
}
final int a2 = e.a(this.a.a[d.c().d()], this.a.a[d2.c().d()]);
if (a2 != 0) {
return a2;
}
final int a3 = e.a(this.a.e[b], this.a.e[b2]);
if (a3 != 0) {
return a3;
}
final int n3 = this.a.g[b];
final int n4 = this.a.g[b2];
if (n3 > 0) {
if (n4 > 0) {
return e.a(n3, n4);
}
return -1;
}
else {
if (n4 > 0) {
return 1;
}
return 0;
}
}
}
}
| [
"manouchehri@riseup.net"
] | manouchehri@riseup.net |
a8aef22243a6419408420f63edaca9c2af4e379b | d90be8f61d116bdbb655adb18c5b1c11ce3a0d7f | /java/bdwl/wechat/src/main/java/com/liaoin/interceptor/AuthorizationInterceptor.java | d4809494ac940ae3c07e1f9d25237a77329cd3aa | [] | no_license | wuxh123/bdwl | 5d7946b07e396da155338feea8be8444019c65d0 | c05034473e6c659f6b99953927758d25a7574ee3 | refs/heads/master | 2020-05-24T19:44:44.559787 | 2019-05-19T06:54:59 | 2019-05-19T06:54:59 | 187,441,649 | 0 | 0 | null | 2019-05-19T06:25:17 | 2019-05-19T06:25:17 | null | UTF-8 | Java | false | false | 1,913 | java | package com.liaoin.interceptor;
import com.google.gson.Gson;
import com.liaoin.bean.WeiXinUser;
import com.liaoin.message.OperateResult;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
* 自定义拦截器,判断此次请求是否有权限
*
*
*/
@Component
public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//如果不是映射到方法直接通过
if (!(handler instanceof HandlerMethod)) {
return true;
}
WeiXinUser weiXinUser = (WeiXinUser) request.getSession().getAttribute("weiXinUser");
// if(weiXinUser == null || request.getRequestURI().equals("/error")){
if(weiXinUser == null){
response.sendRedirect(request.getContextPath()+"/");
return false;
}
return true;
}
/**
* 返回错误信息
*/
public void response(HttpServletResponse response, OperateResult operateResult){
response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragma", "no-cache");
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
response.setCharacterEncoding("UTF-8");
PrintWriter out= null;
try {
out = response.getWriter();
out.write(new Gson().toJson(operateResult));
out.flush();
} catch (IOException e) {
e.printStackTrace();
}finally {
out.close();
}
}
}
| [
"997342977@qq.com"
] | 997342977@qq.com |
ecd0142d2ea4397fa8efa8206ebdbda92ae63323 | 002140e0ea60a9fcfac9fc07f60bb3e9dc49ab67 | /src/main/java/net/ibizsys/paas/core/valuerule/IDEFDataRangeRule.java | ba538f816564470d1ec856eeb4d890a278547e9c | [] | no_license | devibizsys/saibz5_all | ecacc91122920b8133c2cff3c2779c0ee0381211 | 87c44490511253b5b34cd778623f9b6a705cb97c | refs/heads/master | 2021-01-01T16:15:17.146300 | 2017-07-20T07:52:21 | 2017-07-20T07:52:21 | 97,795,014 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | package net.ibizsys.paas.core.valuerule;
/**
* 属性数据范围规则接口
*
* @author Administrator
*
*/
public interface IDEFDataRangeRule extends IDEFValueRule {
/**
* 实体数据集合
*/
static final String DATARANGE_DEDATASET = "DEDATASET";
/**
* 获取 属性值规则实体结果集合
*
* @return
*/
IDEFVRDEDataSet getDEFVRDEDataSet();
}
| [
"dev@ibizsys.net"
] | dev@ibizsys.net |
8e389032d4ca027ecb15780eb43ead97abf73ecd | 184985eabdf4d31cb261cd2c5c3b783e32958fba | /toy-project3/src/main/java/com/jaesay/repository/BoardRepository.java | 06fe157df1c4f7c7c1915414d0775124518438c4 | [] | no_license | jaesay/study | b03d27a4fb4047eab677fe6cfc5c8eaede11ed10 | a321b93125e2c193caead1f1946d5177087652ab | refs/heads/master | 2022-12-20T13:47:07.465369 | 2022-04-30T08:24:16 | 2022-04-30T08:24:16 | 187,467,594 | 0 | 0 | null | 2022-12-16T00:47:17 | 2019-05-19T11:24:25 | Java | UTF-8 | Java | false | false | 1,056 | java | package com.jaesay.repository;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import com.jaesay.domain.Board;
import com.jaesay.domain.QBoard;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Predicate;
public interface BoardRepository extends JpaRepository<Board, Long>, QuerydslPredicateExecutor<Board>{
public default Predicate getPredicate(String type, String keyword) {
BooleanBuilder builder = new BooleanBuilder();
QBoard board = QBoard.board;
String safeType = Optional.ofNullable(type).orElse("");
if(!safeType.trim().isEmpty()) {
if(safeType.equals("t")) {
builder.and(board.title.like("%" + keyword + "%"));
}
if(safeType.equals("w")) {
builder.and(board.member.memberName.like("%" + keyword + "%"));
}
if(safeType.equals("c")) {
builder.and(board.content.like("%" + keyword + "%"));
}
}
builder.and(board.boardId.gt(0));
return builder;
}
}
| [
"jaesay@ajou.ac.kr"
] | jaesay@ajou.ac.kr |
916524a26b67d763c1d68cdfece27f692210ca0c | ccfd187b6425c1a61cab869593ef90bd17fb3d00 | /gms-common/java/gms/core/signal-enhancement/beam/beam-plugin-plane-wave/src/main/java/gms/core/signalenhancement/planewavebeam/plugin/PlaneWaveBeamPlugin.java | 8ec84d55af362247fc54f78f0ea61390115bb0f2 | [
"LicenseRef-scancode-free-unknown",
"BSD-3-Clause"
] | permissive | SNL-GMS/GMS-PI7-OPEN | d5287b0358d5fc867dab36eda25f46df23e03d87 | 4c5f2a33a45566b12897bcdc129609c9e6b95442 | refs/heads/master | 2023-01-22T14:55:19.535320 | 2019-12-17T22:07:07 | 2019-12-17T22:07:07 | 227,190,642 | 5 | 1 | BSD-3-Clause | 2023-01-11T19:53:26 | 2019-12-10T18:37:35 | Java | UTF-8 | Java | false | false | 2,749 | java | package gms.core.signalenhancement.planewavebeam.plugin;
import gms.core.signalenhancement.beamcontrol.plugin.BeamPlugin;
import gms.core.signalenhancement.planewavebeam.PlaneWaveAlgorithm;
import gms.shared.mechanisms.objectstoragedistribution.coi.common.PluginVersion;
import gms.shared.mechanisms.objectstoragedistribution.coi.signaldetection.commonobjects.BeamDefinition;
import gms.shared.mechanisms.objectstoragedistribution.coi.waveforms.commonobjects.ChannelSegment;
import gms.shared.mechanisms.objectstoragedistribution.coi.waveforms.commonobjects.Waveform;
import gms.shared.utilities.geomath.MediumVelocities;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class PlaneWaveBeamPlugin implements BeamPlugin {
private static final String PLUGIN_NAME = "planeWaveBeamPlugin";
private static final String DEFAULT_MODEL_NAME = "ak135";
@Override
public String getName() {
return PLUGIN_NAME;
}
@Override
public PluginVersion getVersion() {
return PluginVersion.from(1, 0, 0);
}
@Override
public void initialize(Map<String, Object> parameterFieldMap) {
}
@Override
public List<Waveform> beam(Collection<ChannelSegment<Waveform>> channelSegments,
BeamDefinition beamDefinition) {
Objects.requireNonNull(channelSegments,
"PlaneWaveBeam cannot calculate beam from null channel segments");
Objects.requireNonNull(beamDefinition,
"PlaneWaveBeam cannot calculate beam from null definition");
MediumVelocities mediumVelocities = new MediumVelocities();
try {
mediumVelocities.initialize(DEFAULT_MODEL_NAME);
} catch (IOException e) {
throw new IllegalStateException("Failed to initialize MediumVelocities Utility", e);
}
PlaneWaveAlgorithm algorithm = new PlaneWaveAlgorithm.Builder()
.withNominalSampleRate(beamDefinition.getNominalWaveformSampleRate())
.withSnappedSampling(beamDefinition.isSnappedSampling())
.withPhaseType(beamDefinition.getPhaseType())
.withRelativePositions(beamDefinition.getRelativePositionsByChannelId())
.withDimensionality(beamDefinition.isTwoDimensional())
.withCoherence(beamDefinition.isCoherent())
.withMediumVelocity(mediumVelocities.getMediumVelocity(beamDefinition.getBeamPoint(), beamDefinition.getPhaseType()))
.withAzimuth(beamDefinition.getAzimuth())
.withSampleRateTolerance(beamDefinition.getWaveformSampleRateTolerance())
.withHorizontalSlowness(beamDefinition.getSlowness())
.withMinimumWaveformsForBeam(beamDefinition.getMinimumWaveformsForBeam())
.build();
return algorithm.generateBeam(channelSegments);
}
}
| [
"teeriks@sandia.gov"
] | teeriks@sandia.gov |
0fe58346ece174198449060292a1714e3c635fab | ac9661913dfd2c646d3ff5866267b33e2ec58e03 | /beangle-cms/beangle-cms-content/src/main/java/org/beangle/website/cms/action/ContentStatisticsAction.java | 46f68ee18b96ce6c35aa893a5e58ebe88bd4b075 | [] | no_license | ERIC0402/beangle-expand | dae385cfe48b6c54dd062f755bfa275a6e98608c | a281dc1303e3fa5d971319d636be5fb563392166 | refs/heads/master | 2021-06-16T02:55:09.250724 | 2017-05-11T03:48:18 | 2017-05-11T03:48:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,927 | java | package org.beangle.website.cms.action;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.beangle.commons.collection.Order;
import org.beangle.model.query.QueryBuilder;
import org.beangle.model.query.builder.Condition;
import org.beangle.model.query.builder.EntityQuery;
import org.beangle.model.query.builder.OqlBuilder;
import org.beangle.website.cms.action.ContentCommonAction;
import org.beangle.website.cms.model.Column;
import org.beangle.website.cms.model.Statistics;
import org.beangle.website.common.util.CommonUtils;
import com.opensymphony.xwork2.ActionContext;
public class ContentStatisticsAction extends ContentCommonAction {
@Override
protected String getEntityName() {
return Statistics.class.getName();
}
/**
* 信息日志
*
* @param args
*/
public String index() {
put("columns", entityDao.getAll(Column.class));
return forward();
}
@Override
protected QueryBuilder<?> getQueryBuilder() {
OqlBuilder<Statistics> oql = OqlBuilder.from(Statistics.class,"statistics");
populateConditions(oql);
oql.orderBy(getOrderString("statistics.viewDate"));
oql.limit(getPageLimit());
return oql;
}
public String search() {
Date time = getDate("startime");
Date time2 = getDate("endtime");
ActionContext.getContext().getSession().put("startDate", time);
ActionContext.getContext().getSession().put("endDate", time2);
Long columnid = getLong("statistics.columns.id");
String title = get("statistics.content.title");
String hql = "select cc.column.site.name, cc.column.orders, cc.column.name, s.content.title, sum(s.views), s.content.id from org.beangle.website.cms.model.ColumnContent cc,org.beangle.website.cms.model.Statistics s "
+ "where s.content=cc.content ";
if(time != null){
hql += " and s.viewDate>=:start";
}
if(time2 != null){
hql += " and s.viewDate<=:end ";
}
String hql1 = "select cc.column.site.name, cc.column.orders, cc.column.name, s.content.title, sum(s.views), s.content.id from org.beangle.website.cms.model.ColumnContent cc,org.beangle.website.cms.model.Statistics s "
+ "where s.content=cc.content ";
if(columnid != null){
hql += " and cc.column.id=" + columnid;
hql1 += " and cc.column.id=" + columnid;
}
if(title != null){
hql += " and cc.content.title like '%"+title+"%'";
hql1 += " and cc.content.title like '%"+title+"%'";
}
hql += "group by cc.column.site.name,cc.column.name, cc.column.orders,s.content.id, s.content.title"
+ " order by cc.column.orders asc";
hql1 += "group by cc.column.site.name,cc.column.name, cc.column.orders,s.content.id, s.content.title"
+ " order by cc.column.orders asc";
EntityQuery query = new EntityQuery(hql);
query.setLimit(getPageLimit());
if (time != null && time2 != null) {
Map params = new HashMap();
if(time != null){
params.put("start", CommonUtils.getStartTime(time));
}
if(time2 != null){
params.put("end", CommonUtils.getStartTime(time2));
}
query.params(params);
put("contentStatisticses", entityDao.search(query));
} else {
put("contentStatisticses", entityDao.search(query));
}
return forward();
}
public String detail(){
Long contentId=getLong("contentId");
Date startDate=(Date)ActionContext.getContext().getSession().get("startDate");
Date endDate=(Date)ActionContext.getContext().getSession().get("endDate");
EntityQuery query = new EntityQuery(Statistics.class,"statistics");
query.add(new Condition("statistics.content.id=:contentId",contentId));
if(startDate != null && endDate != null){
query.add(new Condition("statistics.viewDate >= :startime",startDate));
System.out.println("===="+query.toQueryString());
query.add(new Condition("statistics.viewDate <= :endtime",endDate));
}
query.addOrder(Order.parse("statistics.viewDate"));
put("columnsStatisticses", entityDao.search(query));
return forward();
}
}
| [
"805494859@qq.com"
] | 805494859@qq.com |
f85fea28bba9d5031b8d567e65bef108a878e821 | 9d0517091fe2313c40bcc88a7c82218030d2075c | /apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/xml/GetMetricStatisticsResponseHandler.java | f44f0ae640d11f20af25784dca6fb1160f0bdfa5 | [
"Apache-2.0"
] | permissive | nucoupons/Mobile_Applications | 5c63c8d97f48e1051049c5c3b183bbbaae1fa6e6 | 62239dd0f17066c12a86d10d26bef350e6e9bd43 | refs/heads/master | 2020-12-04T11:49:53.121041 | 2020-01-04T12:00:04 | 2020-01-04T12:00:04 | 231,754,011 | 0 | 0 | Apache-2.0 | 2020-01-04T12:02:30 | 2020-01-04T11:46:54 | Java | UTF-8 | Java | false | false | 2,129 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.cloudwatch.xml;
import java.util.Set;
import javax.inject.Inject;
import org.jclouds.cloudwatch.domain.Datapoint;
import org.jclouds.http.functions.ParseSax;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import com.google.common.collect.Sets;
public class GetMetricStatisticsResponseHandler extends ParseSax.HandlerWithResult<Set<Datapoint>> {
private Set<Datapoint> datapoints = Sets.newLinkedHashSet();
private final DatapointHandler datapointHandler;
@Inject
public GetMetricStatisticsResponseHandler(DatapointHandler DatapointHandler) {
this.datapointHandler = DatapointHandler;
}
public Set<Datapoint> getResult() {
return datapoints;
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
datapointHandler.startElement(uri, localName, qName, attributes);
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
datapointHandler.endElement(uri, localName, qName);
if (qName.equals("member")) {
this.datapoints.add(datapointHandler.getResult());
}
}
public void characters(char ch[], int start, int length) {
datapointHandler.characters(ch, start, length);
}
}
| [
"Administrator@fdp"
] | Administrator@fdp |
712b7966b858b50a745134919371e0582e878818 | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/358496/sourcefiles/forge-1.4.0-5.0.0.326-src/forge/common/net/minecraftforge/event/entity/minecart/MinecartEvent.java | 8c595b7138eb9f613e3e2fc9a16f5c9d148df45c | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | Java | false | false | 393 | java | package net.minecraftforge.event.entity.minecart;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityMinecart;
import net.minecraftforge.event.entity.EntityEvent;
public class MinecartEvent extends EntityEvent
{
public final EntityMinecart minecart;
public MinecartEvent(EntityMinecart minecart)
{
super(minecart);
this.minecart = minecart;
}
}
| [
"mmkaouer@umich.edu"
] | mmkaouer@umich.edu |
44151a5f74be630f2c7c5ac507d4c0afb22329fb | cf8f24320448a1f3ae147ab98c9ad749c5c256f4 | /com.io7m.jmulticlose.tests/src/main/java/module-info.java | 858f1c12d9c067a190e609524e0756ba68a855cc | [] | no_license | io7m/jmulticlose | 9b0cfc67955a34ad0e5742906ea7a53096871cd0 | cb7dc19dd05b6d8915523624488c7f37ca1f6a9f | refs/heads/master | 2023-08-24T04:34:40.269964 | 2023-08-13T18:11:59 | 2023-08-13T18:11:59 | 140,080,820 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,165 | java | /*
* Copyright © 2023 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* Collective try-with-resources (Test suite)
*/
open module com.io7m.jmulticlose.tests
{
requires com.io7m.jmulticlose.core;
requires org.slf4j;
requires transitive org.junit.jupiter.api;
requires transitive org.junit.jupiter.engine;
requires transitive org.junit.platform.commons;
requires transitive org.junit.platform.engine;
}
| [
"code@io7m.com"
] | code@io7m.com |
7d96dd145f271bcfb4f67db9cdb7da18c9a12207 | 45ee32435c345790cae1f10111e37f860395f1ea | /art-extension/opttests/src/OptimizationTests/UnusedLoopRemoval/try_1B_Nested_01/Main.java | 44c26c8639c62f000bb7978475d411dfc9e12e16 | [
"Apache-2.0",
"NCSA",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | android-art-intel/Nougat | b93eb0bc947088ba55d03e62324af88d332c5e93 | ea41b6bfe5c6b62a3163437438b21568cc783a24 | refs/heads/master | 2020-07-05T18:53:19.370466 | 2016-12-16T04:23:40 | 2016-12-16T04:23:40 | 73,984,816 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | /*
* Copyright (C) 2016 Intel Corporation
*
* 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 OptimizationTests.UnusedLoopRemoval.try_1B_Nested_01;
public class Main {
// Test not a simple loop: nested
// M: inner loops are now supported
public int loop() {
int sum = 0;
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 200; j++) {
sum += 5;
}
}
sum++;
try { throw new Exception();}
catch (Exception e){ sum++; }
finally { sum-=2; }
return --sum;
}
public static void main(String[] args) {
int res = new Main().loop();
System.out.println(res);
}
}
| [
"aleksey.v.ignatenko@intel.com"
] | aleksey.v.ignatenko@intel.com |
334f8bf934fe9317f5c6b667f6cc1fdc34090ec0 | c78e0cc12cf115ec92f27f6c4577b25425943cad | /Chapter_01/knight/src/test/java/sia/knights/KnightJavaConfigInjectionTest.java | 1303f7154606af0c341dc4fd5b2fdcd2bdd55a31 | [
"Apache-2.0"
] | permissive | sunjiecheng/SpringiA4_SourceCode | c691e298b40b9cca42c11e97687a42707f0e2007 | afc72fedaabfc909678ca87f625c459f6c359a0d | refs/heads/master | 2022-12-25T00:06:08.073345 | 2019-12-16T09:31:17 | 2019-12-16T09:31:17 | 208,525,554 | 0 | 0 | Apache-2.0 | 2022-12-16T04:23:59 | 2019-09-15T01:24:46 | Java | UTF-8 | Java | false | false | 984 | java | package sia.knights;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import sia.knights.Knight;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=KnightConfig.class,loader=AnnotationConfigContextLoader.class)
public class KnightJavaConfigInjectionTest {
@Autowired
Knight knight;
@Autowired
FakePrintStream printStream;
@After
public void clearPrintStream() {
printStream.clear();
}
@Test
public void shouldInjectKnightWithSlayDragonQuest() {
knight.embarkOnQuest();
assertEquals(
"Embarking on quest to slay the dragon!\n",
printStream.getPrintedString());
}
}
| [
"tojiecheng@163.com"
] | tojiecheng@163.com |
98e2aae6b948075ffe2d1e1bf364a2eedd1afd0f | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13544-7-20-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/display/internal/DocumentContentDisplayer_ESTest_scaffolding.java | c714cfe0f53cc4ee4a6a771662ad32e6661bc9fb | [] | 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 | 455 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Jan 19 21:28:38 UTC 2020
*/
package org.xwiki.display.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DocumentContentDisplayer_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
c1af3cfb98789a2a74bd6db1eda0eb3e4265f983 | f80b9efdd80c44cfba258cfb990b60a69236ede8 | /xxl-job-core/src/main/java/com/xxl/job/core/biz/impl/ExecutorBizImpl.java | c656e47f6a4228e7bea56baa60f60ed726ac944e | [] | no_license | timelapsewithinlive/xxl-job-copy | fa9fcfd0ad86cad7d1a90cdec0170f7c43bf191b | e66ae6769bf8b75feedb4a69a24dba8563b135ce | refs/heads/master | 2020-09-30T09:01:48.924314 | 2018-08-07T03:38:42 | 2018-08-07T03:38:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,025 | java | package com.xxl.job.core.biz.impl;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.LogResult;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.biz.model.TriggerParam;
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.executor.XxlJobExecutor;
import com.xxl.job.core.glue.GlueFactory;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.impl.GlueJobHandler;
import com.xxl.job.core.handler.impl.ScriptJobHandler;
import com.xxl.job.core.log.XxlJobFileAppender;
import com.xxl.job.core.thread.JobThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
/**
* Created by xuxueli on 17/3/1.
*/
public class ExecutorBizImpl implements ExecutorBiz {
private static Logger logger = LoggerFactory.getLogger(ExecutorBizImpl.class);
@Override
public ReturnT<String> beat() {
return ReturnT.SUCCESS;
}
@Override
public ReturnT<String> idleBeat(int jobId) {
// isRunningOrHasQueue
boolean isRunningOrHasQueue = false;
JobThread jobThread = XxlJobExecutor.loadJobThread(jobId);
if (jobThread != null && jobThread.isRunningOrHasQueue()) {
isRunningOrHasQueue = true;
}
if (isRunningOrHasQueue) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue.");
}
return ReturnT.SUCCESS;
}
@Override
public ReturnT<String> kill(int jobId) {
// kill handlerThread, and create new one
JobThread jobThread = XxlJobExecutor.loadJobThread(jobId);
if (jobThread != null) {
XxlJobExecutor.removeJobThread(jobId, "人工手动终止");
return ReturnT.SUCCESS;
}
return new ReturnT<String>(ReturnT.SUCCESS_CODE, "job thread aleady killed.");
}
@Override
public ReturnT<LogResult> log(long logDateTim, int logId, int fromLineNum) {
// log filename: logPath/yyyy-MM-dd/9999.log
String logFileName = XxlJobFileAppender.makeLogFileName(new Date(logDateTim), logId);
LogResult logResult = XxlJobFileAppender.readLog(logFileName, fromLineNum);
return new ReturnT<LogResult>(logResult);
}
@Override
public ReturnT<String> run(TriggerParam triggerParam) {
// load old:jobHandler + jobThread
JobThread jobThread = XxlJobExecutor.loadJobThread(triggerParam.getJobId());
IJobHandler jobHandler = jobThread!=null?jobThread.getHandler():null;
String removeOldReason = null;
// valid:jobHandler + jobThread
GlueTypeEnum glueTypeEnum = GlueTypeEnum.match(triggerParam.getGlueType());
if (GlueTypeEnum.BEAN == glueTypeEnum) {
// new jobhandler
IJobHandler newJobHandler = XxlJobExecutor.loadJobHandler(triggerParam.getExecutorHandler());
// valid old jobThread
if (jobThread!=null && jobHandler != newJobHandler) {
// change handler, need kill old thread
removeOldReason = "更换JobHandler或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
jobHandler = newJobHandler;
if (jobHandler == null) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "job handler [" + triggerParam.getExecutorHandler() + "] not found.");
}
}
} else if (GlueTypeEnum.GLUE_GROOVY == glueTypeEnum) {
// valid old jobThread
if (jobThread != null &&
!(jobThread.getHandler() instanceof GlueJobHandler && ((GlueJobHandler) jobThread.getHandler()).getGlueUpdatetime()==triggerParam.getGlueUpdatetime() )) {
// change handler or gluesource updated, need kill old thread
removeOldReason = "更新任务逻辑或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
try {
IJobHandler originJobHandler = GlueFactory.getInstance().loadNewInstance(triggerParam.getGlueSource());
jobHandler = new GlueJobHandler(originJobHandler, triggerParam.getGlueUpdatetime());
} catch (Exception e) {
logger.error(e.getMessage(), e);
return new ReturnT<String>(ReturnT.FAIL_CODE, e.getMessage());
}
}
} else if (glueTypeEnum!=null && glueTypeEnum.isScript()) {
// valid old jobThread
if (jobThread != null && !(jobThread.getHandler() instanceof ScriptJobHandler && ((ScriptJobHandler) jobThread.getHandler()).getGlueUpdatetime()==triggerParam.getGlueUpdatetime() )) {
// change script or gluesource updated, need kill old thread
removeOldReason = "更新任务逻辑或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
jobHandler = new ScriptJobHandler(triggerParam.getJobId(), triggerParam.getGlueUpdatetime(), triggerParam.getGlueSource(), GlueTypeEnum.match(triggerParam.getGlueType()));
}
} else {
return new ReturnT<String>(ReturnT.FAIL_CODE, "glueType[" + triggerParam.getGlueType() + "] is not valid.");
}
// executor block strategy
if (jobThread != null) {
ExecutorBlockStrategyEnum blockStrategy = ExecutorBlockStrategyEnum.match(triggerParam.getExecutorBlockStrategy(), null);
if (ExecutorBlockStrategyEnum.DISCARD_LATER == blockStrategy) {
// discard when running
if (jobThread.isRunningOrHasQueue()) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "阻塞处理策略-生效:"+ExecutorBlockStrategyEnum.DISCARD_LATER.getTitle());
}
} else if (ExecutorBlockStrategyEnum.COVER_EARLY == blockStrategy) {
// kill running jobThread
if (jobThread.isRunningOrHasQueue()) {
removeOldReason = "阻塞处理策略-生效:" + ExecutorBlockStrategyEnum.COVER_EARLY.getTitle();
jobThread = null;
}
} else {
// just queue trigger
}
}
// replace thread (new or exists invalid)
if (jobThread == null) {
jobThread = XxlJobExecutor.registJobThread(triggerParam.getJobId(), jobHandler, removeOldReason);
}
// push data to queue
ReturnT<String> pushResult = jobThread.pushTriggerQueue(triggerParam);
return pushResult;
}
}
| [
"1120sungang@gmail.com"
] | 1120sungang@gmail.com |
2fa17a0bf2c9accd80d70fb28d13d155f481ed6c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_6ceedee0dada9685b11aa2d3c7ccb33f7103c19c/TaskServiceImpl/15_6ceedee0dada9685b11aa2d3c7ccb33f7103c19c_TaskServiceImpl_t.java | 79a3a3564f8fa1940f10fc16080d36aa80bc9727 | [] | 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 | 1,758 | java | package fr.kevinya.todolist.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import fr.kevinya.todolist.dao.TaskDao;
import fr.kevinya.todolist.model.Task;
@Service
public class TaskServiceImpl implements TaskService {
@Autowired
TaskDao taskDao;
@Transactional
public Task create(String name) {
Task task = new Task(name, 0, 1);
return create(task);
}
@Override
public Task create(Task task) {
Task currentTask = new Task(task.getName(), task.getStatus(), task.getVersion());
return taskDao.create(currentTask);
}
@Transactional
public Task update(Integer id, String name, Integer status, Integer version) {
Task task = find(id);
if (task != null) {
task.setName(name);
task.setStatus(status);
task.setVersion(version);
task = taskDao.update(task);
}
return task;
}
@Transactional
public Task update(Integer id, Task task) {
Task currentTask = find(id);
if (currentTask != null) {
currentTask.setName(task.getName());
currentTask.setStatus(task.getStatus());
currentTask.setVersion(task.getVersion());
currentTask = taskDao.update(currentTask);
}
return currentTask;
}
@Transactional
public void delete(Integer id) {
Task task = find(id);
if (task != null) {
taskDao.delete(task);
}
}
@Transactional
public Task find(Integer id) {
return taskDao.find(id);
}
@Transactional
public List<Task> findAll() {
return taskDao.findAll();
}
@Transactional
public List<Task> findNotDeleted() {
return taskDao.findNotDeleted();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9e69b02869a435fb3934484f22f01cfaf4c67ced | b45673f501ca7c891c8109a714cdf01cde455430 | /AOOP/src/Adapter_Facade_Pattern/ArraysAdapter.java | de334e61f58dbf7ed1946589148e06234a428002 | [] | no_license | kmdngmn/DesignPattern | 1e9afed125d412727b2a85470fcd7e5b2380ffda | 03bcf957eb10022d6c525d80eb1d0e2bebb5c660 | refs/heads/master | 2020-11-25T20:09:59.117899 | 2019-12-23T02:24:50 | 2019-12-23T02:24:50 | 228,822,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package Adapter_Facade_Pattern;
import java.util.Arrays;
import java.util.List;
public class ArraysAdapter {
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] arr = {"1", "2"};
List<String> list = Arrays.asList(arr);
list.set(0, "100");
for(String s: list) {
System.out.println(s);
}
}
}
| [
"enfkdla@gmail.com"
] | enfkdla@gmail.com |
5715c987d8255a28552d8039916575ccb520876d | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_101/Testnull_10041.java | 0f1270e6133a3a9a5304845909c8eaebfcd00721 | [] | 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_101;
import static org.junit.Assert.*;
public class Testnull_10041 {
private final Productionnull_10041 production = new Productionnull_10041("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
bbc7104ca6773e742a19fa3e6d100584fccf2810 | 727a808f191267b89504e5478afb619231ef66fd | /app/src/main/java/javax/microedition/lcdui/pointer/KeyRepeater.java | be83937ae219baad3d33d268abd07ee38edd2af3 | [
"Apache-2.0"
] | permissive | fengdeyingzi/J2ME-Loader | 66cc1fa67e0203cce173e9f77336cb579e742745 | 0c2fa83663a76abd639dde53f0926ab76342c177 | refs/heads/master | 2021-05-06T00:12:59.079882 | 2018-01-11T16:49:13 | 2018-01-11T16:49:13 | 117,123,066 | 1 | 0 | null | 2018-01-11T16:18:50 | 2018-01-11T16:18:50 | null | UTF-8 | Java | false | false | 2,380 | java | /*
* Copyright 2012 Kulikov Dmitriy
*
* 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 javax.microedition.lcdui.pointer;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.event.CanvasEvent;
public class KeyRepeater implements Runnable {
public static long[] INTERVALS =
{
400,
200,
400,
128,
128,
128,
128,
128,
80
};
protected Canvas target;
protected Thread thread;
protected Object waiter;
protected boolean isrunning;
protected boolean enabled;
protected int position;
protected int keyCode;
protected int secondKeyCode;
public KeyRepeater() {
waiter = new Object();
thread = new Thread(this);
thread.start();
}
public void setTarget(Canvas canvas) {
if (canvas == null) {
stop();
}
target = canvas;
}
public void start(int keyCode) {
start(keyCode, 0);
}
public void start(int keyCode, int secondKeyCode) {
if (target == null) {
return;
}
synchronized (waiter) {
if (isrunning) {
return;
}
this.keyCode = keyCode;
this.secondKeyCode = secondKeyCode;
enabled = true;
position = 0;
waiter.notifyAll();
}
}
public void stop() {
enabled = false;
thread.interrupt();
}
public boolean isRunning() {
return isrunning;
}
public void run() {
while (true) {
try {
synchronized (waiter) {
isrunning = false;
waiter.wait();
isrunning = true;
}
while (enabled) {
Thread.sleep(INTERVALS[position]);
target.postEvent(CanvasEvent.getInstance(target, CanvasEvent.KEY_REPEATED, keyCode));
if (secondKeyCode != 0) {
target.postEvent(CanvasEvent.getInstance(target, CanvasEvent.KEY_REPEATED, secondKeyCode));
}
if (position < INTERVALS.length - 1) {
position++;
}
}
} catch (InterruptedException ie) {
}
}
}
} | [
"@"
] | @ |
d1139eea06b2836d26f14e4bf4859757e7408447 | 3a5985651d77a31437cfdac25e594087c27e93d6 | /ojc-core/mqbc/mqbcimpl/src/com/sun/jbi/mqbc/mbeans/AppConfigUsernameField.java | 4e066a4e1f57f6ebaf9a0e4c91d05a48a1b09f13 | [] | no_license | vitalif/openesb-components | a37d62133d81edb3fdc091abd5c1d72dbe2fc736 | 560910d2a1fdf31879e3d76825edf079f76812c7 | refs/heads/master | 2023-09-04T14:40:55.665415 | 2016-01-25T13:12:22 | 2016-01-25T13:12:33 | 48,222,841 | 0 | 5 | null | null | null | null | UTF-8 | Java | false | false | 4,151 | java | /*
* BEGIN_HEADER - DO NOT EDIT
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the "License"). You may not use this file except
* in compliance with the License.
*
* You can obtain a copy of the license at
* https://open-jbi-components.dev.java.net/public/CDDLv1.0.html.
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* HEADER in each file and include the License file at
* https://open-jbi-components.dev.java.net/public/CDDLv1.0.html.
*/
package com.sun.jbi.mqbc.mbeans;
import javax.management.openmbean.SimpleType;
/**
* Application Configuration field for Password.
*
* @author Noel.Ang@sun.com
*/
final class AppConfigUsernameField extends ApplicationConfigurationField {
private String value = "";
AppConfigUsernameField() {
super("username", "User Name", SimpleType.STRING);
}
public String toString() {
return value;
}
public void fromString(String data) {
Object[] validation = validate(data);
if (validation == null) {
value = data;
} else if (validation[0] != null) {
value = validation[0].toString();
} else {
throw new IllegalArgumentException(validation[1].toString());
}
}
public Object clone() {
AppConfigUsernameField clone = new AppConfigUsernameField();
clone.setValue(getValue());
return clone;
}
/**
* Validate the data against the field.
*
* @return If there are no errors, this validation should return null or
* an empty array. If there are correctable errors, this validation
* must return an array with one element that is the corrective
* value. Otherwise, an array of one or more strings describing the
* validation failure(s) must be returned, with the first element
* in array being <code>null</code>.
*/
public Object[] validate(Object data) {
boolean corrected = false;
String value;
// Check against null
if (data == null) {
value = "";
corrected = true;
} else {
value = String.valueOf(data);
}
// Check against whitespace padding
if (value.startsWith(" ") || value.endsWith(" ")) {
value = value.trim();
corrected = true;
}
// Check against illegal characters
// If any are found, create corrective value by removing them all
for (int i = 0, len = value.length(); i < len; ++i) {
if (!Character.isLetterOrDigit(value.charAt(i))) {
StringBuffer newValueBuffer = new StringBuffer(value);
for (int n = 0; n < newValueBuffer.length(); ++n) {
if (!Character.isLetterOrDigit(newValueBuffer.charAt(n))) {
newValueBuffer.deleteCharAt(n);
n--;
}
}
value = newValueBuffer.toString();
corrected = true;
// outer loop only used to find the first indication of
// illegal characters
break;
}
}
return (corrected ? new String[] { value } : null);
}
/**
* Assign a value to this field. Implements can assume that the supplied
* value has already been validated thru a {@link #validate} call.
*
* @throws ClassCastException if the runtime type of the value is invalid
* for the field.
*/
public void setValue(Object value) throws ClassCastException {
this.value = (value != null ? (String) value : "");
}
/**
* Retrieve the value previously assigned to this field.
*
* @return Value previously assigned to this field, or <code>null</code>
* if no value has been
*/
public String getValue() {
return value;
}
} | [
"bitbucket@bitbucket02.private.bitbucket.org"
] | bitbucket@bitbucket02.private.bitbucket.org |
46b2e687ee3f1e43bdd82344e0f2708e738fa12e | 610ae0a8be6b9e0a8371dcbbc20f76896b53d3e3 | /src/main/java/com/tencent/ads/model/ExtractRuleType.java | 3fd2a41cc126119b8081aa2d1610ae4c5dedd80e | [
"Apache-2.0"
] | permissive | TencentAd/marketing-api-java-sdk | d106c6e4cd6e47857a0c63f23fd95e97a34666f3 | f9c7e5d06202e05f8f7317e5bf69b61080829de9 | refs/heads/master | 2023-07-23T10:01:28.748383 | 2023-07-13T03:07:34 | 2023-07-13T03:07:34 | 266,974,939 | 31 | 14 | Apache-2.0 | 2022-05-20T21:54:42 | 2020-05-26T07:32:11 | Java | UTF-8 | Java | false | false | 1,542 | java | /*
* Marketing API
* Marketing API
*
* OpenAPI spec version: 1.3
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.tencent.ads.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/** 行为人群提取类型 */
@JsonAdapter(ExtractRuleType.Adapter.class)
public enum ExtractRuleType {
FILTER("FILTER"),
AGGREGATION("AGGREGATION");
private String value;
ExtractRuleType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ExtractRuleType fromValue(String text) {
for (ExtractRuleType b : ExtractRuleType.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<ExtractRuleType> {
@Override
public void write(final JsonWriter jsonWriter, final ExtractRuleType enumeration)
throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ExtractRuleType read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ExtractRuleType.fromValue(String.valueOf(value));
}
}
}
| [
"dennyqian@tencent.com"
] | dennyqian@tencent.com |
10f2cb3a19b792f98b8c82c5d4f94d4cc8b72674 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/tencent/im/cs/cmd0x388/cmd0x388$TryUpPttReq.java | a744ecc6a70129a3e3a85112b74afce017d11859 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 3,466 | java | package tencent.im.cs.cmd0x388;
import com.tencent.mobileqq.pb.ByteStringMicro;
import com.tencent.mobileqq.pb.MessageMicro;
import com.tencent.mobileqq.pb.MessageMicro.FieldMap;
import com.tencent.mobileqq.pb.PBBoolField;
import com.tencent.mobileqq.pb.PBBytesField;
import com.tencent.mobileqq.pb.PBField;
import com.tencent.mobileqq.pb.PBUInt32Field;
import com.tencent.mobileqq.pb.PBUInt64Field;
public final class cmd0x388$TryUpPttReq
extends MessageMicro
{
public static final int BOOL_NEW_UP_CHAN_FIELD_NUMBER = 13;
public static final int BYTES_BUILD_VER_FIELD_NUMBER = 10;
public static final int BYTES_FILE_MD5_FIELD_NUMBER = 4;
public static final int BYTES_FILE_NAME_FIELD_NUMBER = 6;
public static final int UINT32_BU_TYPE_FIELD_NUMBER = 9;
public static final int UINT32_INNER_IP_FIELD_NUMBER = 11;
public static final int UINT32_PLATFORM_TYPE_FIELD_NUMBER = 8;
public static final int UINT32_SRC_TERM_FIELD_NUMBER = 7;
public static final int UINT32_VOICE_LENGTH_FIELD_NUMBER = 12;
public static final int UINT64_FILE_ID_FIELD_NUMBER = 3;
public static final int UINT64_FILE_SIZE_FIELD_NUMBER = 5;
public static final int UINT64_GROUP_CODE_FIELD_NUMBER = 1;
public static final int UINT64_SRC_UIN_FIELD_NUMBER = 2;
static final MessageMicro.FieldMap __fieldMap__;
public final PBBoolField bool_new_up_chan = PBField.initBool(false);
public final PBBytesField bytes_build_ver = PBField.initBytes(ByteStringMicro.EMPTY);
public final PBBytesField bytes_file_md5 = PBField.initBytes(ByteStringMicro.EMPTY);
public final PBBytesField bytes_file_name = PBField.initBytes(ByteStringMicro.EMPTY);
public final PBUInt32Field uint32_bu_type = PBField.initUInt32(0);
public final PBUInt32Field uint32_inner_ip = PBField.initUInt32(0);
public final PBUInt32Field uint32_platform_type = PBField.initUInt32(0);
public final PBUInt32Field uint32_src_term = PBField.initUInt32(0);
public final PBUInt32Field uint32_voice_length = PBField.initUInt32(0);
public final PBUInt64Field uint64_file_id = PBField.initUInt64(0L);
public final PBUInt64Field uint64_file_size = PBField.initUInt64(0L);
public final PBUInt64Field uint64_group_code = PBField.initUInt64(0L);
public final PBUInt64Field uint64_src_uin = PBField.initUInt64(0L);
static
{
ByteStringMicro localByteStringMicro1 = ByteStringMicro.EMPTY;
ByteStringMicro localByteStringMicro2 = ByteStringMicro.EMPTY;
ByteStringMicro localByteStringMicro3 = ByteStringMicro.EMPTY;
__fieldMap__ = MessageMicro.initFieldMap(new int[] { 8, 16, 24, 34, 40, 50, 56, 64, 72, 82, 88, 96, 104 }, new String[] { "uint64_group_code", "uint64_src_uin", "uint64_file_id", "bytes_file_md5", "uint64_file_size", "bytes_file_name", "uint32_src_term", "uint32_platform_type", "uint32_bu_type", "bytes_build_ver", "uint32_inner_ip", "uint32_voice_length", "bool_new_up_chan" }, new Object[] { Long.valueOf(0L), Long.valueOf(0L), Long.valueOf(0L), localByteStringMicro1, Long.valueOf(0L), localByteStringMicro2, Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0), localByteStringMicro3, Integer.valueOf(0), Integer.valueOf(0), Boolean.valueOf(false) }, TryUpPttReq.class);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: tencent.im.cs.cmd0x388.cmd0x388.TryUpPttReq
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
72ee623ad0d0cc95137a94ea9d1466c9ce2798d7 | 077a33a684c904a3b079a6ee73fe33e7a5242430 | /nlp/core/src/main/java/org/headvances/nlp/query2/match/TreeWordMatcher.java | 0ffbc18413724a8dacee6a55d7d930ab9c54aaa5 | [] | no_license | tuan08/Headances | 8d0eca4dcbe7e8bac4c97b8ec2026abe7ede6c89 | 3d3583bfc4570985f003c9a8fc83c780d4b94644 | refs/heads/master | 2021-01-17T16:44:50.695855 | 2016-06-29T13:28:00 | 2016-06-29T13:28:00 | 57,353,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,770 | java | package org.headvances.nlp.query2.match;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.headvances.nlp.token.IToken;
import org.headvances.nlp.util.ParamHolder;
import org.headvances.util.text.StringUtil;
/**
* $Author: Tuan Nguyen$
**/
public class TreeWordMatcher extends UnitMatcher {
private String word ;
private Map<String, TreeWordMatcher> trees = new HashMap<String, TreeWordMatcher>(5) ;
public TreeWordMatcher() {
}
public TreeWordMatcher(String[] word) {
addWord(word) ;
}
public UnitMatcher init(ParamHolder holder, int allowNextMatchDistance) throws Exception {
setAllowNextMatchDistance(allowNextMatchDistance) ;
return this ;
}
public String getWord() { return this.word ; }
public void setWord(String word) { this.word = word ; }
public void addWord(String word) {
String nword = word.toLowerCase() ;
String[] token = nword.split(" ") ;
add(token, 0) ;
add(new String[] { nword }, 0) ;
}
public void addWord(String[] word) {
if(word == null) return ;
for(int i = 0 ; i < word.length; i++) {
String nword = word[i].toLowerCase() ;
String[] token = nword.split(" ") ;
add(token, 0) ;
add(new String[] { nword }, 0) ;
//System.out.println(nword);
}
}
public void add(String[] token, int pos) {
TreeWordMatcher twm = trees.get(token[pos]) ;
if(twm == null) {
twm = new TreeWordMatcher() ;
trees.put(token[pos], twm) ;
}
if(pos + 1 == token.length) {
twm.setWord(StringUtil.joinStringArray(token, " ")) ;
}
if(pos + 1 < token.length) {
twm.add(token, pos + 1) ;
}
}
public UnitMatch matches(IToken[] token, int pos) {
TreeWordMatcher twm = trees.get(token[pos].getNormalizeForm()) ;
if(twm == null) {
return null ;
}
UnitMatch unitMatch = null ;
if(pos + 1 < token.length) {
unitMatch = twm.matches(token, pos + 1) ;
}
if(unitMatch == null && twm.getWord() != null) {
unitMatch = new UnitMatch(twm.getWord(), pos, pos + 1) ;
}
if(unitMatch != null) {
unitMatch.setFrom(pos) ;
unitMatch.setUnitMatcher(this) ;
}
return unitMatch ;
}
public void dump(int level) {
Iterator<Map.Entry<String, TreeWordMatcher>> i = trees.entrySet().iterator() ;
while(i.hasNext()) {
Map.Entry<String, TreeWordMatcher> entry = i.next() ;
for(int j = 0; j < level; j++) {
System.out.print(' ');
}
String key = entry.getKey() ;
TreeWordMatcher value = entry.getValue() ;
System.out.append(key) ;
if(value.getWord() != null) {
System.out.append('[').append(value.getWord()).append(']') ;
}
System.out.append('\n') ;
value.dump(level + 2) ;
}
}
} | [
"tuan08@gmail.com"
] | tuan08@gmail.com |
50e009b81f750b9e1e8496a3b2044112bb1b55e6 | 4968c5642c5e5261b635d3f31e1890fba7277868 | /fav/src/com/osource/module/map/service/AreaCode.java | 447e160e1bb990763da23bee0fc971050fa22c6d | [] | no_license | cllcsh/collectionplus | 01116dc8594e0be6e5a10623e3db2ec9d103d2c2 | 4a62418d73745a9136d4163527d532e2d3e8b483 | refs/heads/master | 2016-08-11T16:16:24.556377 | 2016-04-21T07:51:03 | 2016-04-21T07:51:03 | 54,613,229 | 0 | 0 | null | 2016-03-24T14:39:53 | 2016-03-24T03:55:39 | null | UTF-8 | Java | false | false | 982 | java | package com.osource.module.map.service;
import java.util.List;
import org.w3c.dom.Document;
import com.osource.module.map.model.AreaCodeBean;
/**
* @author : zhou hao
* @version : 1.0
* @date : 2009-7-13 9:56:53
*/
public interface AreaCode
{
public List<AreaCodeBean> getAreaCode();
/*
* 返回InputStream是因为w3c DOM中Document的parse方法可
* 以接受InputStream类型的参数,方便在下一步对XML的解释
*/
public Document getSoapInputStream();
public String getSoapRequest();
// public static void main(String[] args)
// {
// AreaCode placename = new AreaCode();
// List<AreaCodeBean> acList = placename.getAreaCode();
// System.out.println(acList.size());
// for(AreaCodeBean acb : acList) {
// System.out.println(acb.getAreaCode());
// System.out.println(acb.getAreaName());
// System.out.println(acb.getParentCode());
// System.out.println("-----");
// }
// }
}
| [
"cllc@cllc.me"
] | cllc@cllc.me |
1058a6f2e4fdef1a47f5ca4052ba418f34674037 | 26f522cf638887c35dd0de87bddf443d63640402 | /src/main/java/com/cczu/model/entity/YHPC_CheckHiddenInfoApproveEntity.java | 8503758d46c32598b741261ddb9be2a8a7eb3d70 | [] | no_license | wuyufei2019/JSLYG | 4861ae1b78c1a5d311f45e3ee708e52a0b955838 | 93c4f8da81cecb7b71c2d47951a829dbf37c9bcc | refs/heads/master | 2022-12-25T06:01:07.872153 | 2019-11-20T03:10:18 | 2019-11-20T03:10:18 | 222,839,794 | 0 | 0 | null | 2022-12-16T05:03:09 | 2019-11-20T03:08:29 | JavaScript | UTF-8 | Java | false | false | 2,659 | java | package com.cczu.model.entity;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/**
* 隐患排查---随手拍隐患审核记录
* @author zpc
* @date 2018年1月6日
*/
@Entity
@Table(name="yhpc_checkhiddeninfo_approve")
public class YHPC_CheckHiddenInfoApproveEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 4659242572434313161L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false, columnDefinition="bigint")
@Setter
@Getter
public Long ID;//编号
@Column(name = "sechandletime", nullable = true, columnDefinition="datetime")
@Setter
@Getter
private Timestamp sechandletime;//计划整改时间
@Column(name = "dangerphoto", nullable = true, columnDefinition="varchar(1000)")
@Setter
@Getter
private String dangerphoto;//隐患照片
@Column(name = "createtime", nullable = true, columnDefinition="datetime")
@Setter
@Getter
private Timestamp createtime;//照片拍摄时间
@Column(name = "dangerdesc", nullable = true, columnDefinition="varchar(255)")
@Setter
@Getter
private String dangerdesc;//隐患备注
@Column(name = "qyid", nullable = false, columnDefinition="bigint")
@Setter
@Getter
private Long qyid ;//企业ID
@Column(name = "dangerstatus", nullable = true, columnDefinition="varchar(1)")
@Setter
@Getter
private String dangerstatus;//隐患状态(初始 0未整改 )
@Column(name = "dangerorigin", nullable = true, columnDefinition="varchar(1)")
@Setter
@Getter
private String dangerorigin;//隐患来源(3随手拍)
@Column(name = "userid", nullable = true, columnDefinition="bigint")
@Setter
@Getter
private Long userid ;//隐患发现人ID
@Column(name = "approvestatue", nullable = true, columnDefinition="varchar(1)")
@Setter
@Getter
private String approvestatue;//审核状态(0:待审核1:已审核)
@Column(name = "approveduser", nullable = true, columnDefinition="bigint")
@Setter
@Getter
private Long approveduser ;//审核人ID
@Column(name = "dangerlevel", nullable = true, columnDefinition="varchar(1)")
@Setter
@Getter
private String dangerlevel;//隐患等级(0:无隐患1:一级2:二级3:三级4:四级)
@Column(name = "handlepersons", nullable = true, columnDefinition="varchar(255)")
@Setter
@Getter
private String handlepersons;//指定隐患整改人
}
| [
"wuyufei2019@sina.com"
] | wuyufei2019@sina.com |
bc364d6ac91d1d1eb3bc22e8571a4f078df6b426 | 13cdd0ddb1e5ed977ea9fabe8e1ac0b917b3bf5d | /src/main/java/com/anl/user/constant/UserState.java | 32ef386cdee4c64b3635b98751438b58e2a24ec1 | [] | no_license | kpdtd/card_service | 30bfd5d00d2cb55c6b12fa75d137878cfe39d212 | e596f59459d4e9f839a9daaa7c57d79fef4e7547 | refs/heads/master | 2020-03-22T23:45:07.195325 | 2018-09-26T09:18:37 | 2018-09-26T09:18:37 | 140,826,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 558 | java | package com.anl.user.constant;
/**
* Created by yangyiqiang on 2018/8/28.
*/
public class UserState {
// 预生成用户,流量卡快递期间到用户绑定激活之前的一种状态
public static final int PRE_USER = 1;
//试用期用户,用户完成绑卡认证,但是没有充值,账户有赠送
public static final int PRO_USER = 2;
//正式充值用户
public static final int CHARGE_USER = 3;
//停机用户
public static final int OFF_USER = 4;
//注销的用户
public static final int CANCEL_USER = 5;
}
| [
"yqyanghn@126.com"
] | yqyanghn@126.com |
5e2b9c06d6dd86d9fc98d00125348bb8a090a9f8 | d7c5121237c705b5847e374974b39f47fae13e10 | /airspan.netspan/src/main/java/Netspan/NBI_17_0/Server/FileServerDelete.java | 482c355198b141080f0da8a5703c879bda354678 | [] | no_license | AirspanNetworks/SWITModules | 8ae768e0b864fa57dcb17168d015f6585d4455aa | 7089a4b6456621a3abd601cc4592d4b52a948b57 | refs/heads/master | 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 | Java | UTF-8 | Java | false | false | 1,959 | java |
package Netspan.NBI_17_0.Server;
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.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"name"
})
@XmlRootElement(name = "FileServerDelete")
public class FileServerDelete {
@XmlElement(name = "Name")
protected List<String> name;
/**
* Gets the value of the name 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 name property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getName() {
if (name == null) {
name = new ArrayList<String>();
}
return this.name;
}
}
| [
"dshalom@airspan.com"
] | dshalom@airspan.com |
7a55aea5d732c7ded5f4c3ddb9b0f2459d300194 | d249dae7768b13587c8104a2a77ccadf9a44c0c2 | /src/test/java/library/utils/BookFunctionsTest.java | 941fcbea919c1046ce404e05d98074abefed1c75 | [] | no_license | Radekj512/programowanie2 | 9d4877fc0e862517e0696ebb07d28a5b3d080c41 | cad0126c224fe0f0c6d7c7b815779a87d7c91933 | refs/heads/master | 2022-06-22T15:38:14.322411 | 2019-05-25T07:07:51 | 2019-05-25T07:07:51 | 186,115,117 | 0 | 0 | null | 2022-06-21T01:09:54 | 2019-05-11T09:48:06 | Java | UTF-8 | Java | false | false | 4,342 | java | package library.utils;
import library.Book;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*;
public class BookFunctionsTest {
List<Book> bookList = new ArrayList<>();
BookFunctions sut = new BookFunctions();
@Before
public void setUp() {
bookList.add(new Book(1, "pierwsza", "123", 2003, "m", null, null));
bookList.add(new Book(2, "druga", "456", 1998, "m", null, null));
bookList.add(new Book(3, "trzecia", "789", 2008, "m", null, null));
bookList.add(new Book(4, "czwarta", "012", 2007, "m", null, null));
bookList.add(new Book(5, "piata", "345", 2010, "m", null, null));
bookList.add(new Book(6, "szosta", "678", 2000, "m", null, null));
}
@Test
public void findIsbn() {
assertEquals(bookList.get(0), sut.findIsbn("123", bookList));
}
@Test
public void findIsbnStram() {
assertEquals(bookList.get(1), sut.findIsbnStream("456", bookList));
assertNotEquals(bookList.get(0), sut.findIsbnStream("456", bookList));
}
@Test
public void getLastTwoBooks() {
assertThat(sut.getLastTwoBooks(bookList))
.contains(bookList.get(4))
.contains(bookList.get(5));
}
@Test
public void getLastTwoBooksStream() {
assertThat(sut.getLastTwoBooksStream(bookList))
.contains(bookList.get(4))
.contains(bookList.get(5));
}
@Test
public void findOldestBook() {
assertEquals(bookList.get(1), sut.findOldestBook(bookList));
}
@Test
public void findOldestStream() {
assertEquals(bookList.get(1), sut.findOldestStream(bookList));
}
@Test
public void findYoungestBook() {
assertEquals(bookList.get(4), sut.findYoungestBook(bookList));
}
@Test
public void findYoungestBookStream() {
assertEquals(bookList.get(4), sut.findYoungestBookStream(bookList));
}
@Test
public void sumOfYears() {
assertEquals(12026, sut.sumOfYears(bookList));
}
@Test
public void sumOfYearsStream() {
assertEquals(12026, sut.sumOfYearsStream(bookList));
}
@Test
public void howManyBooksAfter2007() {
assertEquals(2, sut.howManyBooksAfter2007(bookList));
}
@Test
public void howManyBooksAfter2007Stream() {
assertEquals(2, sut.howManyBooksAfter2007Stream(bookList));
}
@Test
public void isAllBooksAreNewerThan2000() {
assertFalse(sut.isAllBooksAreNewerThan2000(bookList));
}
@Test
public void isAllBooksAreNewerThan2000Stream() {
assertFalse(sut.isAllBooksAreNewerThan2000Stream(bookList));
}
@Test
public void averageOfBookYears() {
//2004,(3)
assertThat(sut.averageOfBookYears(bookList))
.isCloseTo(2004.3, Assertions.offset(0.1d));
}
@Test
public void averageOfBookYearsStream() {
assertThat(sut.averageOfBookYearsStream(bookList))
.isCloseTo(2004.3, Assertions.offset(0.1d));
}
@Test
public void isThereAnyBookBefore2003() {
assertTrue(sut.isThereAnyBookBefore2003(bookList));
}
@Test
public void isThereAnyBookBefore2003Stream() {
assertTrue(sut.isThereAnyBookBefore2003Stream(bookList));
}
@Test
public void getBooksWithTitleStartingWithCAndYoungerThan2007() {
assertThat(sut.getBooksWithTitleStartingWithCAndYoungerThan2007(bookList)).hasSize(0);
}
@Test
public void sortBooksByYearDescending() {
sut.sortBooksByYearDescending(bookList);
}
@Test
public void get3Lists() {
System.out.println(sut.get3Lists(bookList));
assertThat(sut.get3Lists(bookList)).hasSize(3);
}
@Test
public void getYearBookMap() {
System.out.println(sut.getYearBookMap(bookList));
}
@Test
public void getBooksAfter2009Map() {
System.out.println(sut.getBooksAfter2009Map(bookList));
}
@Test
public void add100YearsToEveryBook() {
assertThat(sut.add100YearsToEveryBook(bookList.subList(0,2))).extracting("year").contains(2103,2098);
}
} | [
"roszko.radek@gmail.com"
] | roszko.radek@gmail.com |
bc73d7b1dafdb0407a6b0c875be53100e307a021 | f8fd4f956b1e767a082d2606c74cd639647d2bde | /sem9_cts/src/ro/ase/cts/stateV2/StareRezervata.java | 3b904da8d96a992a88c25132bad826bda6165614 | [] | no_license | ruxicirstea/cts_seminare | dff77a1ac8475682bbabcce6e5b479ab553bae2c | f5702b4f3df58dc8e93790a3e89ed382d0c66470 | refs/heads/master | 2023-05-12T03:56:12.179621 | 2021-06-05T12:05:07 | 2021-06-05T12:05:07 | 342,843,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package ro.ase.cts.stateV2;
public class StareRezervata implements Stare{
@Override
public void modificaStare(Masa masa) {
if(masa.getStare() instanceof StareLibera)
{
System.out.println("Masa cu numarul "+masa.getCod() +" a fost rezervata");
masa.setStare(this);
}
else{
System.out.println("Masa nu poate fi rezervata");
}
}
}
| [
"you@example.com"
] | you@example.com |
90459bdad3625c7e8300a72823dfa164c7f02c55 | 985c21b0edcb062bda7812f7531ace31fc0da6d5 | /main/calibration/test/boofcv/alg/geo/calibration/TestZhang99DecomposeHomography.java | 62d84acebbdad0063e0cb3ae3b70ba83a27f3a5c | [
"Apache-2.0"
] | permissive | siarheidevel/BoofCV | 2408c39e035d2046d74cf3bd6bf993a0eee2d501 | 07d4f9dee7f5e1704a547da43bab2c502e3bb5d3 | refs/heads/master | 2021-01-15T22:29:56.944693 | 2012-11-07T01:18:39 | 2012-11-07T01:18:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,733 | java | /*
* Copyright (c) 2011-2012, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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 boofcv.alg.geo.calibration;
import georegression.geometry.RotationMatrixGenerator;
import georegression.struct.point.Vector3D_F64;
import georegression.struct.se.Se3_F64;
import org.ejml.data.DenseMatrix64F;
import org.ejml.ops.MatrixFeatures;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* @author Peter Abeles
*/
public class TestZhang99DecomposeHomography {
/**
* Test against a simple known case
*/
@Test
public void knownCase() {
DenseMatrix64F R = RotationMatrixGenerator.eulerXYZ(0.02, -0.05, 0.01, null);
Vector3D_F64 T = new Vector3D_F64(100,50,-1000);
DenseMatrix64F K = GenericCalibrationGrid.createStandardCalibration();
DenseMatrix64F H = GenericCalibrationGrid.computeHomography(K,R,T);
Zhang99DecomposeHomography alg = new Zhang99DecomposeHomography();
alg.setCalibrationMatrix(K);
Se3_F64 motion = alg.decompose(H);
assertTrue(MatrixFeatures.isIdentical(R, motion.getR(), 1e-5));
assertEquals(T.x,motion.getX(), 1e-5);
}
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
93604717ffa784f7cf70305c928987dc2839c60f | 1247fef001808646655cec7a27302e379b5b4c92 | /src/main/java/com/example/jwt/payload/LoginRequest.java | 010da8421ea8591fb41f39965329b8a7be5972de | [] | no_license | CindoddCindy/jwtFromSiTampvan | 2d75c7e9c7ca42a125438c48c9821b4a83a10dd3 | 9e97182ad0c7f337f11ea7920e48868f87ad7ea2 | refs/heads/main | 2023-03-31T14:20:51.821553 | 2021-04-03T12:20:01 | 2021-04-03T12:20:01 | 302,200,353 | 1 | 1 | null | 2020-10-08T05:23:11 | 2020-10-08T01:14:15 | Java | UTF-8 | Java | false | false | 555 | java | package com.example.jwt.payload;
import javax.validation.constraints.NotBlank;
public class LoginRequest {
@NotBlank
private String usernameOrEmail;
@NotBlank
private String password;
public String getUsernameOrEmail() {
return usernameOrEmail;
}
public void setUsernameOrEmail(String usernameOrEmail) {
this.usernameOrEmail = usernameOrEmail;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"cindodcindy@gmail.com"
] | cindodcindy@gmail.com |
ee575c73e0431bf25cccbcc8ef570bebd2514dd0 | 217d1c12cca97344b4a542b56ac6d49b8b34c7f7 | /src/main/java/com/samy/jhuaa/security/jwt/TokenProvider.java | 824617968aad6fbbcd093b1bea9714d99d71538b | [] | no_license | Sam-WEI/test-jh-uaa | b2c05670e6a38c8079f64142e9078e40c0b1a945 | 4b33580d5a141b973058b3c15fb0d21b1f482507 | refs/heads/master | 2020-08-29T23:46:39.014654 | 2019-10-29T04:46:21 | 2019-10-29T04:46:21 | 218,206,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,246 | java | package com.samy.jhuaa.security.jwt;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.*;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.*;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
@Component
public class TokenProvider implements InitializingBean {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private Key key;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final JHipsterProperties jHipsterProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void afterPropertiesSet() throws Exception {
byte[] keyBytes;
String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret();
if (!StringUtils.isEmpty(secret)) {
log.warn("Warning: the JWT key used is not Base64-encoded. " +
"We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security.");
keyBytes = secret.getBytes(StandardCharsets.UTF_8);
} else {
log.debug("Using a Base64-encoded JWT secret key");
keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret());
}
this.key = Keys.hmacShaKeyFor(keyBytes);
this.tokenValidityInMilliseconds =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds();
this.tokenValidityInMillisecondsForRememberMe =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt()
.getTokenValidityInSecondsForRememberMe();
}
public String createToken(Authentication authentication, boolean rememberMe) {
String authorities = authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.joining(","));
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities)
.signWith(key, SignatureAlgorithm.HS512)
.setExpiration(validity)
.compact();
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser()
.setSigningKey(key)
.parseClaimsJws(token)
.getBody();
Collection<? extends GrantedAuthority> authorities =
Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
User principal = new User(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(key).parseClaimsJws(authToken);
return true;
} catch (JwtException | IllegalArgumentException e) {
log.info("Invalid JWT token.");
log.trace("Invalid JWT token trace.", e);
}
return false;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
99222af79c6535f6b63859e0f5698ced1b759170 | 329b2cb3c91a0c953458efd253c4fcdce6f539c4 | /graphsdk/src/main/java/com/microsoft/graph/extensions/WorkbookTableItemAtRequestBuilder.java | 43a726295c26546ae2deb091acc25fb3c9f74887 | [
"MIT"
] | permissive | sbolotovms/msgraph-sdk-android | 255eeddf19c1b15f04ee3b1549f0cae70d561fdd | 1320795ba1c0b5eb36ef8252b73799d15fc46ba1 | refs/heads/master | 2021-01-20T05:09:00.148739 | 2017-04-28T23:20:23 | 2017-04-28T23:20:23 | 89,751,501 | 1 | 0 | null | 2017-04-28T23:20:37 | 2017-04-28T23:20:37 | null | UTF-8 | Java | false | false | 1,413 | 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.extensions;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.extensions.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.List;
// This file is available for extending, afterwards please submit a pull request.
/**
* The class for the Workbook Table Item At Request Builder.
*/
public class WorkbookTableItemAtRequestBuilder extends BaseWorkbookTableItemAtRequestBuilder implements IWorkbookTableItemAtRequestBuilder {
/**
* The request builder for this WorkbookTableItemAt
*
* @param requestUrl The request url
* @param client The service client
* @param requestOptions The options for this request
*/
public WorkbookTableItemAtRequestBuilder(final String requestUrl, final IBaseClient client, final List<Option> requestOptions, final Integer index) {
super(requestUrl, client, requestOptions, index);
}
}
| [
"brianmel@microsoft.com"
] | brianmel@microsoft.com |
8bf25bbfc099301889d1f4cfbab51387016b93ff | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_de73c33811ffa046181e66935a59c4e747b3949a/ImageBlockContainer/1_de73c33811ffa046181e66935a59c4e747b3949a_ImageBlockContainer_s.java | 4c9686c95c3cf2bd03543488b986109dc3b7e5f2 | [] | 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 | 1,963 | java | /***********************************************************************
* Copyright (c) 2009 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
***********************************************************************/
package org.eclipse.birt.report.engine.nLayout.area.impl;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.report.engine.content.IContent;
import org.eclipse.birt.report.engine.content.IStyle;
import org.eclipse.birt.report.engine.nLayout.LayoutContext;
import org.eclipse.birt.report.engine.nLayout.area.IContainerArea;
import org.eclipse.birt.report.engine.nLayout.area.style.BoxStyle;
public class ImageBlockContainer extends BlockContainerArea
implements
IContainerArea
{
public ImageBlockContainer(ContainerArea parent, LayoutContext context, IContent content)
{
super( parent, context, content);
}
public void initialize( ) throws BirtException
{
IStyle style = content.getStyle( );
if ( style == null || style.isEmpty( ) )
{
hasStyle = false;
boxStyle = BoxStyle.DEFAULT;
localProperties = LocalProperties.DEFAULT;
action = content.getHyperlinkAction( );
bookmark = content.getBookmark( );
}
else
{
buildProperties( content, context );
}
}
public SplitResult split( int height, boolean force ) throws BirtException
{
if ( force )
{
ContainerArea newArea= cloneArea();
newArea.children.addAll( children );
children.clear( );
this.height = 0;
return new SplitResult( newArea, SplitResult.SPLIT_SUCCEED_WITH_PART );
}
return SplitResult.SUCCEED_WITH_NULL;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
47fcd78f1d137ed74bfc42c99c70a3fccd0489de | 770522805e232c1de63a1d55bb67f1bced6ff8a5 | /Design Pattern/src/com/cognizant/builder_pattern/Coke.java | 1c9c78b362ca3bc4a10cba5217e7bef1430d881a | [] | no_license | sovon9/Design-Pattern | ee9c98fd8d2a364dd0b15f1d8ccbaea6d9674c6d | 74f6f2481a306bf1df6c72160f20a2b035dc1627 | refs/heads/main | 2023-03-17T13:53:25.502054 | 2021-03-16T17:43:42 | 2021-03-16T17:43:42 | 348,428,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.cognizant.builder_pattern;
public class Coke extends ColdDrink{
@Override
public String name() {
// TODO Auto-generated method stub
return "Coke";
}
@Override
public float price() {
// TODO Auto-generated method stub
return 30.0f;
}
}
| [
"you@example.com"
] | you@example.com |
652d7a31e861c7f785c75568bf9c0f722931afd8 | 924361eb49bc9ea68beac8f6723144dbbe5642b2 | /jackson/src/main/java/com/webcohesion/enunciate/modules/jackson/api/impl/ObjectDataTypeImpl.java | 641e910b26c8e1a4c5434670a95d6bead35aa2d5 | [
"Apache-2.0"
] | permissive | totomi/enunciate | 8167a37832751ef0cb318019aad98c84c47b4d94 | 45487fddb71577402057ec16e9ee0b07133608c7 | refs/heads/master | 2021-01-15T13:15:00.293575 | 2015-10-02T15:24:19 | 2015-10-02T15:24:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,015 | java | package com.webcohesion.enunciate.modules.jackson.api.impl;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.webcohesion.enunciate.api.datatype.*;
import com.webcohesion.enunciate.facets.FacetFilter;
import com.webcohesion.enunciate.modules.jackson.model.Member;
import com.webcohesion.enunciate.modules.jackson.model.ObjectTypeDefinition;
import com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType;
import com.webcohesion.enunciate.modules.jackson.model.types.JsonType;
import com.webcohesion.enunciate.modules.jackson.model.types.KnownJsonType;
import java.util.*;
/**
* @author Ryan Heaton
*/
public class ObjectDataTypeImpl extends DataTypeImpl {
private final ObjectTypeDefinition typeDefinition;
public ObjectDataTypeImpl(ObjectTypeDefinition typeDefinition) {
super(typeDefinition);
this.typeDefinition = typeDefinition;
}
@Override
public BaseType getBaseType() {
return BaseType.object;
}
@Override
public List<? extends Value> getValues() {
return null;
}
@Override
public List<? extends Property> getProperties() {
SortedSet<Member> members = this.typeDefinition.getMembers();
ArrayList<Property> properties = new ArrayList<Property>(members.size());
FacetFilter facetFilter = this.typeDefinition.getContext().getContext().getConfiguration().getFacetFilter();
for (Member member : members) {
if (!facetFilter.accept(member)) {
continue;
}
if (member.getChoices().size() > 1) {
JsonTypeInfo.As inclusion = member.getSubtypeIdInclusion();
if (inclusion == JsonTypeInfo.As.WRAPPER_ARRAY || inclusion == JsonTypeInfo.As.WRAPPER_OBJECT) {
for (Member choice : member.getChoices()) {
properties.add(new PropertyImpl(choice));
}
}
else {
properties.add(new PropertyImpl(member));
}
}
else {
properties.add(new PropertyImpl(member));
}
}
//sort the properties by name.
Collections.sort(properties, new Comparator<Property>() {
@Override
public int compare(Property o1, Property o2) {
return o1.getName().compareTo(o2.getName());
}
});
return properties;
}
@Override
public List<DataTypeReference> getSupertypes() {
ArrayList<DataTypeReference> supertypes = null;
JsonType supertype = this.typeDefinition.getSupertype();
while (supertype != null) {
if (supertypes == null) {
supertypes = new ArrayList<DataTypeReference>();
}
supertypes.add(new DataTypeReferenceImpl(supertype));
supertype = supertype instanceof JsonClassType ?
((JsonClassType)supertype).getTypeDefinition() instanceof ObjectTypeDefinition ?
((ObjectTypeDefinition)((JsonClassType)supertype).getTypeDefinition()).getSupertype()
: null
: null;
}
return supertypes;
}
@Override
public Example getExample() {
return new ExampleImpl(this.typeDefinition);
}
}
| [
"ryan@webcohesion.com"
] | ryan@webcohesion.com |
bc69c53a5d7cc58a32143bb9567f9c3ceaf2cbe0 | 7f778e827702fdfc0ff45ef0730b1fa6be021cc6 | /OnlineGrocery/src/PurchaseTest_error.java | 5edc9738a7cb83ffcbf94ab839968929f01b3699 | [] | no_license | lamadipen/grocery | 78d8da3d73304ba8e01c64fb98f2da5a3e67e492 | f4b3ec6eeb4d1a0016705502addd3c9e6ffc7c79 | refs/heads/master | 2021-01-10T08:04:32.275421 | 2016-01-28T04:08:12 | 2016-01-28T04:08:12 | 49,364,723 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,916 | java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class PurchaseTest_error {
// declare N as a constant.
// initialise N to a random number in the range 6 to 9.
public static final int N = (int) (6 + (Math.random() * ((9 - 6) + 1)));
//Arrays to hold postcode, payable amount, total payable amount
double[] totalPayable;
public static Purchase purchaseAmountArray[]= new Purchase[N];
public static Purchase postcodeArray[]= new Purchase[N];
//default constructor
public PurchaseTest_error() {
//this is just for testing deleted after successfult testing all feature,
postcodeArray[0] = new Purchase(4121);
postcodeArray[1] = new Purchase(4122);
postcodeArray[2] = new Purchase(4120);
postcodeArray[3] = new Purchase(4122);
purchaseAmountArray[0] = new Purchase(450.50);
purchaseAmountArray[1] = new Purchase(460.23);
purchaseAmountArray[2] = new Purchase(470.75);
purchaseAmountArray[3] = new Purchase(460.23);
}
//Method to read, validate and store postcode and purchase amount for N customers
public void addRecord(int customerCounter) throws IOException
{
int postcode;
double purchaseAmount;
postcode = readPostCode() ;
if(4121 >postcode)
{
System.out.print("Postcode must be greater than 4121");
System.out.print("Try again: ");
postcode = readPostCode() ;
}
else if(postcode > 4123)
{
System.out.print("Postcode must be less than 4123");
System.out.print("Try again: ");
postcode = readPostCode();
}
else
{
BufferedReader breader= new BufferedReader(new InputStreamReader(System.in));
breader= new BufferedReader(new InputStreamReader(System.in));
System.out.println("Purchase Amount: ");
purchaseAmount= Double.parseDouble(breader.readLine());
if(purchaseAmount < 60)
{
System.out.print("Purchase Amount must be greater than $60");
System.out.print("Try again: ");
addRecord(customerCounter);
}
else if(purchaseAmount > 500)
{
System.out.print("Purchase Amount must be greater than $500");
System.out.print("Try again: ");
addRecord(customerCounter);
}
else
{
System.out.print("Done: ");
System.out.print("purchaseAmount: "+purchaseAmount);
System.out.print("postcode: "+postcode);
purchaseAmountArray[customerCounter] = new Purchase(purchaseAmount);
postcodeArray[customerCounter] = new Purchase(postcode);
System.out.println(purchaseAmountArray[1].getPurchaseAmount());
}
}
}
//method to read post code from input
public int readPostCode() throws NumberFormatException, IOException
{
int postcode;
BufferedReader breader= new BufferedReader(new InputStreamReader(System.in));
System.out.print("Postcode: ");
postcode= Integer.parseInt(breader.readLine());
return postcode;
}
//method to read purchase amount from input
public int readPurchaseAmount() throws NumberFormatException, IOException
{
int postcode;
BufferedReader breader= new BufferedReader(new InputStreamReader(System.in));
System.out.print("Postcode: ");
postcode= Integer.parseInt(breader.readLine());
return postcode;
}
//Method to display the total payable for all customers
public void displayTotalPayable()
{
List<Purchase> postacodelist = new ArrayList<Purchase>(Arrays.asList(postcodeArray));
postacodelist.removeAll(Collections.singleton(null));
Purchase[] tempPostcodeArray = postacodelist.toArray(new Purchase[postacodelist.size()]);
List<Purchase> purchaselist = new ArrayList<Purchase>(Arrays.asList(purchaseAmountArray));
purchaselist.removeAll(Collections.singleton(null));
Purchase[] tempPurchaseAmountArray= purchaselist.toArray(new Purchase[purchaselist.size()]);
System.out.println("Postal code \t\t Total Payable");
int postcodeArrayLength = tempPostcodeArray.length;
for (int m= 0; m < postcodeArrayLength; m++)
{
if(tempPostcodeArray[m].getPostcode() == 4121)
{
if(tempPurchaseAmountArray[m].getPurchaseAmount() >= 400)
{
System.out.println(tempPostcodeArray[m].getPostcode() +"\t\t\t $"+ (tempPurchaseAmountArray[m].getPurchaseAmount() ));
}
else
{
System.out.println(tempPostcodeArray[m].getPostcode() +"\t\t\t $"+ (tempPurchaseAmountArray[m].getPurchaseAmount() + 8));
}
}
else if(tempPostcodeArray[m].getPostcode() == 4122)
{
System.out.println(tempPostcodeArray[m].getPostcode() +"\t\t\t $"+ (tempPurchaseAmountArray[m].getPurchaseAmount() + 12));
}
else if(tempPostcodeArray[m].getPostcode() == 4123)
{
System.out.println(tempPostcodeArray[m].getPostcode() +"\t\t\t $"+ (tempPurchaseAmountArray[m].getPurchaseAmount() + 15));
}
else
{
System.out.println(tempPostcodeArray[m].getPostcode() +"\t\t\t $"+ (tempPurchaseAmountArray[m].getPurchaseAmount() ));
}
}
}
//main method
public static void main(String[] args) throws NumberFormatException, IOException
{
// object of type Purchase
Purchase purchaseObj = new Purchase();
int customerCount = 1;
int choice = 0;
BufferedReader breader= new BufferedReader(new InputStreamReader(System.in));
// While loop to continually display menu and read option
while (customerCount <= N) {
//delete after testing
System.out.println("This customer no" + customerCount);
System.out.println("\n");
System.out.println("\n\t\t\t******Enter your choice******");
System.out.println("\n\t\t\t\t1.Add purchase amount");
System.out.println("\n\t\t\t\t2.Display total payable");
System.out.println("\n\t\t\t\t3.Display postcode, and total payable for purchase amounts of $400 and above");
System.out.println("\n\t\t\t\t4.Display postcode/s with the highest purchase amount");
System.out.println("\n\t\t\t\t5.Display postcode/s with the lowest purchase amount");
System.out.println("\n\t\t\t\t6.Display total payable in descending order");
System.out.println("\n\t\t\t\t7.Search");
System.out.println("\n\t\t\t\t8.Exit");
System.out.println(" ");
System.out.print("Make Your Choice: ");
choice= Integer.parseInt(breader.readLine());
// Switch statement within while to invoke method corresponding to each option.
switch(choice)
{
case 1:
PurchaseTest_error purchaseTestObj = new PurchaseTest_error();
purchaseTestObj.addRecord(customerCount);
break;
case 2:
purchaseTestObj = new PurchaseTest_error();
purchaseTestObj.displayTotalPayable();
break;
case 3:
purchaseTestObj = new PurchaseTest_error();
purchaseObj.displayAbove(purchaseTestObj.purchaseAmountArray,purchaseTestObj.postcodeArray);
break;
case 4:
purchaseTestObj = new PurchaseTest_error();
purchaseObj.displayHighestPurchase(purchaseTestObj.purchaseAmountArray,purchaseTestObj.postcodeArray);
break;
case 5:
purchaseTestObj = new PurchaseTest_error();
purchaseObj.displayLowestPurchase(purchaseTestObj.purchaseAmountArray,purchaseTestObj.postcodeArray);
break;
case 6:
purchaseTestObj = new PurchaseTest_error();
purchaseObj.displayTotalPayableDescending(purchaseTestObj.purchaseAmountArray,purchaseTestObj.postcodeArray);
break;
case 7:
purchaseTestObj = new PurchaseTest_error();
purchaseObj.searchByPostcode(purchaseTestObj.purchaseAmountArray,purchaseTestObj.postcodeArray);
break;
case 8:
System.out.println("THANKS FOR USING!");
System.exit(0);
break;
default:
{
System.out.println("Invalid Input!");
}
}
customerCount++;
}
}
}
| [
"lamadipen@yahoo.com"
] | lamadipen@yahoo.com |
ad5822b4bfd87e1918e3a46b5222e45c6538f0d0 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Jetty/Jetty3597.java | a6e662872669b9c548a7e4771ced08f99ab7a15c | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,660 | java | @Test
public void test4_4_3() throws Exception
{
// _content length is ignored, as chunking is used. If it is
// not ignored, the second request wont be seen.
int offset=0;
String response;
LocalEndPoint endp=connector.executeRequest(
"GET /R1 HTTP/1.1\n" +
"Host: localhost\n" +
"Transfer-Encoding: chunked\n" +
"Content-Type: text/plain\n" +
"Content-Length: 100\n" +
"\n" +
"3;\n" +
"123\n" +
"3;\n" +
"456\n" +
"0;\n" +
"\n" +
"GET /R2 HTTP/1.1\n" +
"Host: localhost\n" +
"Connection: close\n" +
"Content-Type: text/plain\n" +
"Content-Length: 6\n" +
"\n" +
"abcdef");
offset=0;
response = endp.getResponse();
offset=checkContains(response,offset,"HTTP/1.1 200 OK","3. ignore c-l")+1;
offset=checkContains(response,offset,"/R1","3. ignore c-l")+1;
offset=checkContains(response,offset,"123456","3. ignore c-l")+1;
offset=0;
response = endp.getResponse();
offset=checkContains(response,offset,"HTTP/1.1 200 OK","3. ignore c-l")+1;
offset=checkContains(response,offset,"/R2","3. _content-length")+1;
offset=checkContains(response,offset,"abcdef","3. _content-length")+1;
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
4030caa5003133e071ee12f4008cb409cded1ea5 | b2b67c94ea1e1a5df4148965e4b9d86f476de297 | /model/notifications-impl/src/main/java/com/evolveum/midpoint/notifications/impl/events/WorkflowEventImpl.java | 4a817d40eeb7f84f1fcb1f0587aeb013eae6b855 | [
"EUPL-1.2",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-proprietary-license",
"CDDL-1.0",
"GPL-1.0-or-later",
"MPL-2.0",
"EPL-1.0",
"MIT",
"Apache-2.0"
] | permissive | martin-lizner/midpoint | 475af71fd307fcd8ec17faed0bd65f02ba13ce49 | db111337b0b62dd0bd3de21839d7e316b4527bff | refs/heads/master | 2021-12-04T17:29:58.082578 | 2021-07-23T05:00:53 | 2021-07-23T05:00:53 | 161,333,785 | 0 | 0 | Apache-2.0 | 2018-12-11T12:55:59 | 2018-12-11T12:55:59 | null | UTF-8 | Java | false | false | 5,031 | java | /*
* Copyright (c) 2020 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.notifications.impl.events;
import com.evolveum.midpoint.notifications.api.OperationStatus;
import com.evolveum.midpoint.notifications.api.events.WorkflowEvent;
import com.evolveum.midpoint.prism.delta.ChangeType;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.task.api.LightweightIdentifierGenerator;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.wf.util.ApprovalUtils;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
abstract public class WorkflowEventImpl extends BaseEventImpl implements WorkflowEvent {
@Nullable protected final ApprovalContextType approvalContext;
@NotNull private final ChangeType changeType;
@NotNull protected final CaseType aCase;
WorkflowEventImpl(@NotNull LightweightIdentifierGenerator lightweightIdentifierGenerator, @NotNull ChangeType changeType,
@Nullable ApprovalContextType approvalContext, @NotNull CaseType aCase, EventHandlerType handler) {
super(lightweightIdentifierGenerator, handler);
this.changeType = changeType;
this.approvalContext = approvalContext;
this.aCase = aCase;
}
@Override
@NotNull
public CaseType getCase() {
return aCase;
}
@Override
public String getProcessInstanceName() {
return aCase.getName().getOrig();
}
@Override
public OperationStatus getOperationStatus() {
return outcomeToStatus(changeType, getOutcome());
}
protected abstract String getOutcome();
@Override
public boolean isStatusType(EventStatusType eventStatus) {
return getOperationStatus().matchesEventStatusType(eventStatus);
}
@Override
public ChangeType getChangeType() {
return changeType;
}
@Override
public boolean isOperationType(EventOperationType eventOperation) {
return changeTypeMatchesOperationType(changeType, eventOperation);
}
@Override
public boolean isApprovalCase() {
return ObjectTypeUtil.hasArchetype(aCase, SystemObjectsType.ARCHETYPE_APPROVAL_CASE.value());
}
@Override
public boolean isManualResourceCase() {
return ObjectTypeUtil.hasArchetype(aCase, SystemObjectsType.ARCHETYPE_MANUAL_CASE.value());
}
@Override
public boolean isResultKnown() {
return !isInProgress(); // for now
}
@Override
public boolean isApproved() {
return isSuccess(); // for now
}
@Override
public boolean isRejected() {
return isFailure(); // for now
}
private OperationStatus outcomeToStatus(ChangeType changeType, String outcome) {
if (changeType != ChangeType.DELETE) {
return OperationStatus.SUCCESS;
} else {
if (outcome == null) {
return OperationStatus.IN_PROGRESS;
} else if (QNameUtil.matchUri(outcome, SchemaConstants.MODEL_APPROVAL_OUTCOME_APPROVE)) {
return OperationStatus.SUCCESS;
} else if (QNameUtil.matchUri(outcome, SchemaConstants.MODEL_APPROVAL_OUTCOME_REJECT)) {
return OperationStatus.FAILURE;
} else {
return OperationStatus.OTHER;
}
}
}
@Override
public boolean isRelatedToItem(ItemPath itemPath) {
return false;
}
@Override
@NotNull
public ApprovalContextType getApprovalContext() {
return approvalContext;
}
@Override
@NotNull
public CaseType getWorkflowTask() {
return aCase;
}
@Override
public String toString() {
return "WorkflowEvent{" +
"event=" + super.toString() +
", processInstanceName='" + getProcessInstanceName() + '\'' +
", changeType=" + changeType +
", outcome=" + getOutcome() +
'}';
}
// This method is not used. It is here just for maven dependency plugin to detect the
// dependency on workflow-api
@SuppressWarnings("unused")
private void notUsed() {
ApprovalUtils.approvalBooleanValueFromUri("");
}
@Override
protected void debugDumpCommon(StringBuilder sb, int indent) {
super.debugDumpCommon(sb, indent);
DebugUtil.debugDumpWithLabelLn(sb, "processInstanceName", getProcessInstanceName(), indent + 1);
DebugUtil.debugDumpWithLabelToStringLn(sb, "changeType", changeType, indent + 1);
DebugUtil.debugDumpWithLabelLn(sb, "outcome", getOutcome(), indent + 1);
}
}
| [
"mederly@evolveum.com"
] | mederly@evolveum.com |
3118dbe988070732baef0be3d7ca8a1b90d8a830 | 2a3f19a4a2b91d9d715378aadb0b1557997ffafe | /sources/android/support/transition/ViewOverlay.java | ec9d7487cc1098e3e5b8dcc209518014e3765776 | [] | no_license | amelieko/McDonalds-java | ce5062f863f7f1cbe2677938a67db940c379d0a9 | 2fe00d672caaa7b97c4ff3acdb0e1678669b0300 | refs/heads/master | 2022-01-09T22:10:40.360630 | 2019-04-21T14:47:20 | 2019-04-21T14:47:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,690 | java | package android.support.transition;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.RequiresApi;
import android.support.p000v4.view.ViewCompat;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import java.lang.reflect.Method;
import java.util.ArrayList;
@TargetApi(14)
@RequiresApi
class ViewOverlay {
protected OverlayViewGroup mOverlayViewGroup;
static class OverlayViewGroup extends ViewGroup {
static Method sInvalidateChildInParentFastMethod;
ArrayList<Drawable> mDrawables = null;
ViewGroup mHostView;
View mRequestingView;
ViewOverlay mViewOverlay;
static class TouchInterceptor extends View {
}
static {
try {
sInvalidateChildInParentFastMethod = ViewGroup.class.getDeclaredMethod("invalidateChildInParentFast", new Class[]{Integer.TYPE, Integer.TYPE, Rect.class});
} catch (NoSuchMethodException e) {
}
}
OverlayViewGroup(Context context, ViewGroup hostView, View requestingView, ViewOverlay viewOverlay) {
super(context);
this.mHostView = hostView;
this.mRequestingView = requestingView;
setRight(hostView.getWidth());
setBottom(hostView.getHeight());
hostView.addView(this);
this.mViewOverlay = viewOverlay;
}
public boolean dispatchTouchEvent(MotionEvent ev) {
return false;
}
public void add(Drawable drawable) {
if (this.mDrawables == null) {
this.mDrawables = new ArrayList();
}
if (!this.mDrawables.contains(drawable)) {
this.mDrawables.add(drawable);
invalidate(drawable.getBounds());
drawable.setCallback(this);
}
}
public void remove(Drawable drawable) {
if (this.mDrawables != null) {
this.mDrawables.remove(drawable);
invalidate(drawable.getBounds());
drawable.setCallback(null);
}
}
/* Access modifiers changed, original: protected */
public boolean verifyDrawable(Drawable who) {
return super.verifyDrawable(who) || (this.mDrawables != null && this.mDrawables.contains(who));
}
public void add(View child) {
if (child.getParent() instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) child.getParent();
if (!(parent == this.mHostView || parent.getParent() == null)) {
int[] parentLocation = new int[2];
int[] hostViewLocation = new int[2];
parent.getLocationOnScreen(parentLocation);
this.mHostView.getLocationOnScreen(hostViewLocation);
ViewCompat.offsetLeftAndRight(child, parentLocation[0] - hostViewLocation[0]);
ViewCompat.offsetTopAndBottom(child, parentLocation[1] - hostViewLocation[1]);
}
parent.removeView(child);
if (child.getParent() != null) {
parent.removeView(child);
}
}
super.addView(child, getChildCount() - 1);
}
public void remove(View view) {
super.removeView(view);
if (isEmpty()) {
this.mHostView.removeView(this);
}
}
/* Access modifiers changed, original: 0000 */
public boolean isEmpty() {
if (getChildCount() == 0 && (this.mDrawables == null || this.mDrawables.size() == 0)) {
return true;
}
return false;
}
public void invalidateDrawable(Drawable drawable) {
invalidate(drawable.getBounds());
}
/* Access modifiers changed, original: protected */
public void dispatchDraw(Canvas canvas) {
int numDrawables = 0;
int[] contentViewLocation = new int[2];
int[] hostViewLocation = new int[2];
ViewGroup parent = (ViewGroup) getParent();
this.mHostView.getLocationOnScreen(contentViewLocation);
this.mRequestingView.getLocationOnScreen(hostViewLocation);
canvas.translate((float) (hostViewLocation[0] - contentViewLocation[0]), (float) (hostViewLocation[1] - contentViewLocation[1]));
canvas.clipRect(new Rect(0, 0, this.mRequestingView.getWidth(), this.mRequestingView.getHeight()));
super.dispatchDraw(canvas);
if (this.mDrawables != null) {
numDrawables = this.mDrawables.size();
}
for (int i = 0; i < numDrawables; i++) {
((Drawable) this.mDrawables.get(i)).draw(canvas);
}
}
/* Access modifiers changed, original: protected */
public void onLayout(boolean changed, int l, int t, int r, int b) {
}
private void getOffset(int[] offset) {
int[] contentViewLocation = new int[2];
int[] hostViewLocation = new int[2];
ViewGroup parent = (ViewGroup) getParent();
this.mHostView.getLocationOnScreen(contentViewLocation);
this.mRequestingView.getLocationOnScreen(hostViewLocation);
offset[0] = hostViewLocation[0] - contentViewLocation[0];
offset[1] = hostViewLocation[1] - contentViewLocation[1];
}
public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
if (this.mHostView != null) {
dirty.offset(location[0], location[1]);
if (this.mHostView instanceof ViewGroup) {
location[0] = 0;
location[1] = 0;
int[] offset = new int[2];
getOffset(offset);
dirty.offset(offset[0], offset[1]);
return super.invalidateChildInParent(location, dirty);
}
invalidate(dirty);
}
return null;
}
}
ViewOverlay(Context context, ViewGroup hostView, View requestingView) {
this.mOverlayViewGroup = new OverlayViewGroup(context, hostView, requestingView, this);
}
static ViewGroup getContentView(View view) {
View parent = view;
while (parent != null) {
if (parent.getId() == 16908290 && (parent instanceof ViewGroup)) {
return (ViewGroup) parent;
}
if (parent.getParent() instanceof ViewGroup) {
parent = (ViewGroup) parent.getParent();
}
}
return null;
}
public static ViewOverlay createFrom(View view) {
ViewGroup contentView = getContentView(view);
if (contentView == null) {
return null;
}
int numChildren = contentView.getChildCount();
for (int i = 0; i < numChildren; i++) {
View child = contentView.getChildAt(i);
if (child instanceof OverlayViewGroup) {
return ((OverlayViewGroup) child).mViewOverlay;
}
}
return new ViewGroupOverlay(contentView.getContext(), contentView, view);
}
public void add(Drawable drawable) {
this.mOverlayViewGroup.add(drawable);
}
public void remove(Drawable drawable) {
this.mOverlayViewGroup.remove(drawable);
}
}
| [
"makfc1234@gmail.com"
] | makfc1234@gmail.com |
72937de4ceb8caaba680aa579ffcab4d2a19b77d | e2579d6ee3e0fe9f9f425d6a5cd6fc96763c8390 | /org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_500_Layers/_505_Selection/_5051_SelectionLayerExample.java | c49235a4413ada9488b1cefacf9e5d8766b5f244 | [] | no_license | doomer0/prova | b74c5bb28c3d921f7aa7f0ba86ec9cfb4cbfdb80 | 605e9d455aab9fa9b3b7f94c42004b555bd78ad6 | refs/heads/master | 2021-01-19T15:05:41.502156 | 2015-07-08T12:58:43 | 2015-07-08T13:35:29 | 38,967,516 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,358 | java | /*******************************************************************************
* Copyright (c) 2013 Dirk Fauth and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dirk Fauth <dirk.fauth@gmail.com> - initial API and implementation
*******************************************************************************/
package org.eclipse.nebula.widgets.nattable.examples._500_Layers._505_Selection;
import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.data.ExtendedReflectiveColumnPropertyAccessor;
import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor;
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
import org.eclipse.nebula.widgets.nattable.examples.AbstractNatExample;
import org.eclipse.nebula.widgets.nattable.examples.data.person.PersonService;
import org.eclipse.nebula.widgets.nattable.examples.data.person.PersonWithAddress;
import org.eclipse.nebula.widgets.nattable.examples.runner.StandaloneNatExampleRunner;
import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* Simple example showing the SelectionLayer.
*
* @author Dirk Fauth
*
*/
public class _5051_SelectionLayerExample extends AbstractNatExample {
public static void main(String[] args) throws Exception {
StandaloneNatExampleRunner.run(600, 400,
new _5051_SelectionLayerExample());
}
@Override
public String getDescription() {
return "This example shows a simple composition using a SelectionLayer.";
}
@Override
public Control createExampleControl(Composite parent) {
// property names of the Person class
String[] propertyNames = { "firstName", "lastName", "gender",
"married", "birthday", "address.street", "address.housenumber",
"address.postalCode", "address.city" };
IColumnPropertyAccessor<PersonWithAddress> columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<PersonWithAddress>(
propertyNames);
IDataProvider bodyDataProvider = new ListDataProvider<PersonWithAddress>(
PersonService.getPersonsWithAddress(50), columnPropertyAccessor);
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);
// as the selection mouse bindings are registered for the region label
// GridRegion.BODY
// we need to set that region label to the viewport so the selection via
// mouse is working correctly
viewportLayer.setRegionName(GridRegion.BODY);
NatTable natTable = new NatTable(parent, viewportLayer);
return natTable;
}
}
| [
"dirk.fauth@googlemail.com"
] | dirk.fauth@googlemail.com |
e69603352d7974fdfa8426974586b0e5904e1f18 | c3d2c07bfbcee009b859cf8598fdf2dca71be148 | /game-utils/src/main/java/com/wjybxx/fastjgame/utils/FunctionUtils.java | 390934bddaf371d951670db1bc2cae18a68c079a | [
"Apache-2.0"
] | permissive | happyjianguo/fastjgame | be8906c3796a36e4dc5817e59426dbb856136e55 | a4b7e35fe30e45eb50f8a5117ca2e09908e8e300 | refs/heads/master | 2020-07-29T18:47:11.613430 | 2019-09-19T09:21:52 | 2019-09-19T09:21:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,330 | java | /*
* Copyright 2019 wjybxx
*
* 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.wjybxx.fastjgame.utils;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
/**
* 常用函数式方法
*
* @author wjybxx
* @version 1.0
* date - 2019/8/4
* github - https://github.com/hl845740757
*/
public final class FunctionUtils {
/**
* 什么也不做的Action
*/
public static final Runnable NO_OP_ACTION = () -> {
};
private static final BiConsumer<?, ?> _emptyBiConsumer = (a, b) -> {
};
private static final Consumer<?> _emptyConsumer = (a) -> {
};
private FunctionUtils() {
}
@SuppressWarnings("unchecked")
public static <T, U> BiConsumer<T, U> emptyBiConsumer() {
return (BiConsumer<T, U>) _emptyBiConsumer;
}
@SuppressWarnings("unchecked")
public static <T> Consumer<T> emptyConsumer() {
return (Consumer<T>) _emptyConsumer;
}
public static <T> boolean TRUE(T t) {
return true;
}
public static <T> boolean FALSE(T t) {
return false;
}
// ---------------------------------- obj - obj -----------------------------
public static <T, U> boolean TRUE(T t, U u) {
return true;
}
public static <T, U> boolean FALSE(T t, U u) {
return false;
}
// ---------------------------------- int - obj -----------------------------
public static <T> boolean TRUE(int a, T b) {
return true;
}
public static <T> boolean FALSE(int a, T b) {
return false;
}
// ---------------------------------- long - obj -----------------------------
public static <T> boolean TRUE(long a, T b) {
return true;
}
public static <T> boolean FALSE(long a, T b) {
return false;
}
}
| [
"845740757@qq.com"
] | 845740757@qq.com |
802eb898df793109e1e80ad546924fc4ea49fe9d | d34971201b9b1aba0b5883508287fcbc72099363 | /memory-types/ashmem/src/main/java/com/facebook/imagepipeline/memory/AshmemMemoryChunk.java | d9f5bf70ed53575208b66b261ee0597f6d7be732 | [
"MIT"
] | permissive | facebook/fresco | 6a9f7c9d501faaf8aefcdae6f495633659812b9f | 8b7ebca781d0ab7029b0c77cc28fab7a0af08a9c | refs/heads/main | 2023-09-05T03:35:16.680080 | 2023-09-04T17:08:32 | 2023-09-04T17:08:32 | 31,533,997 | 19,373 | 5,139 | MIT | 2023-09-14T18:34:31 | 2015-03-02T09:58:04 | Java | UTF-8 | Java | false | false | 6,263 | java | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.imagepipeline.memory;
import android.annotation.TargetApi;
import android.os.SharedMemory;
import android.system.ErrnoException;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.facebook.common.internal.Preconditions;
import com.facebook.infer.annotation.Nullsafe;
import java.io.Closeable;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;
/** Wrapper around chunk of ashmem memory. */
@TargetApi(27)
@Nullsafe(Nullsafe.Mode.LOCAL)
public class AshmemMemoryChunk implements MemoryChunk, Closeable {
private static final String TAG = "AshmemMemoryChunk";
private @Nullable SharedMemory mSharedMemory;
private @Nullable ByteBuffer mByteBuffer;
/** Unique identifier of the chunk */
private final long mId;
public AshmemMemoryChunk(final int size) {
Preconditions.checkArgument(size > 0);
try {
mSharedMemory = SharedMemory.create(TAG, size);
mByteBuffer = mSharedMemory.mapReadWrite();
} catch (ErrnoException e) {
throw new RuntimeException("Fail to create AshmemMemory", e);
}
mId = System.identityHashCode(this);
}
@VisibleForTesting
public AshmemMemoryChunk() {
mSharedMemory = null;
mByteBuffer = null;
mId = System.identityHashCode(this);
}
@Override
public synchronized void close() {
if (!isClosed()) {
if (mSharedMemory != null) {
mSharedMemory.close();
}
if (mByteBuffer != null) {
SharedMemory.unmap(mByteBuffer);
}
mByteBuffer = null;
mSharedMemory = null;
}
}
@Override
public synchronized boolean isClosed() {
return mByteBuffer == null || mSharedMemory == null;
}
@Override
public int getSize() {
Preconditions.checkNotNull(mSharedMemory);
return mSharedMemory.getSize();
}
@Override
public synchronized int write(
final int memoryOffset, final byte[] byteArray, final int byteArrayOffset, final int count) {
Preconditions.checkNotNull(byteArray);
Preconditions.checkNotNull(mByteBuffer);
final int actualCount = MemoryChunkUtil.adjustByteCount(memoryOffset, count, getSize());
MemoryChunkUtil.checkBounds(
memoryOffset, byteArray.length, byteArrayOffset, actualCount, getSize());
mByteBuffer.position(memoryOffset);
mByteBuffer.put(byteArray, byteArrayOffset, actualCount);
return actualCount;
}
@Override
public synchronized int read(
final int memoryOffset, final byte[] byteArray, final int byteArrayOffset, final int count) {
Preconditions.checkNotNull(byteArray);
Preconditions.checkNotNull(mByteBuffer);
final int actualCount = MemoryChunkUtil.adjustByteCount(memoryOffset, count, getSize());
MemoryChunkUtil.checkBounds(
memoryOffset, byteArray.length, byteArrayOffset, actualCount, getSize());
mByteBuffer.position(memoryOffset);
mByteBuffer.get(byteArray, byteArrayOffset, actualCount);
return actualCount;
}
@Override
public synchronized byte read(final int offset) {
Preconditions.checkState(!isClosed());
Preconditions.checkArgument(offset >= 0);
Preconditions.checkArgument(offset < getSize());
Preconditions.checkNotNull(mByteBuffer);
return mByteBuffer.get(offset);
}
@Override
public long getNativePtr() {
throw new UnsupportedOperationException("Cannot get the pointer of an AshmemMemoryChunk");
}
@Override
@Nullable
public ByteBuffer getByteBuffer() {
return mByteBuffer;
}
@Override
public long getUniqueId() {
return mId;
}
@Override
public void copy(
final int offset, final MemoryChunk other, final int otherOffset, final int count) {
Preconditions.checkNotNull(other);
// This implementation acquires locks on this and other objects and then delegates to
// doCopy which does actual copy. In order to avoid deadlocks we have to establish some linear
// order on all AshmemMemoryChunks and acquire locks according to this order. In order
// to do that, we use unique ids.
// So we have to address 3 cases:
// Case 1: other buffer equals this buffer, id comparison
if (other.getUniqueId() == getUniqueId()) {
// we do not allow copying to the same address
// lets log warning and not copy
Log.w(
TAG,
"Copying from AshmemMemoryChunk "
+ Long.toHexString(getUniqueId())
+ " to AshmemMemoryChunk "
+ Long.toHexString(other.getUniqueId())
+ " which are the same ");
Preconditions.checkArgument(false);
}
// Case 2: Other memory chunk id < this memory chunk id
if (other.getUniqueId() < getUniqueId()) {
synchronized (other) {
synchronized (this) {
doCopy(offset, other, otherOffset, count);
}
}
return;
}
// Case 3: Other memory chunk id > this memory chunk id
synchronized (this) {
synchronized (other) {
doCopy(offset, other, otherOffset, count);
}
}
}
/**
* This does actual copy. It should be called only when we hold locks on both this and other
* objects
*/
private void doCopy(
final int offset, final MemoryChunk other, final int otherOffset, final int count) {
if (!(other instanceof AshmemMemoryChunk)) {
throw new IllegalArgumentException("Cannot copy two incompatible MemoryChunks");
}
Preconditions.checkState(!isClosed());
Preconditions.checkState(!other.isClosed());
Preconditions.checkNotNull(mByteBuffer);
Preconditions.checkNotNull(other.getByteBuffer());
MemoryChunkUtil.checkBounds(offset, other.getSize(), otherOffset, count, getSize());
mByteBuffer.position(offset);
// ByteBuffer can't be null at this point
other.getByteBuffer().position(otherOffset);
// Recover the necessary part to be copied as a byte array.
// This requires a copy, for now there is not a more efficient alternative.
byte[] b = new byte[count];
mByteBuffer.get(b, 0, count);
other.getByteBuffer().put(b, 0, count);
}
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
3041b6e5d71cefb9a021968dd1031dbff8d31906 | d2f810efbf145ea3e8b5925a7b5e90419477b586 | /src/nl/x/client/cheat/cheats/fight/Velocity.java | cf05eaaba60fe7fdc1de2b6697ca3665f6d178c0 | [] | no_license | nullexthecodegod/Stealth | 7505536594fda0a577a3406b3ed89b75857dc2be | 334edcd2fc0f2fbda88b8845adb9c1a2f17023dd | refs/heads/master | 2021-05-14T18:15:11.746357 | 2018-01-11T04:32:51 | 2018-01-11T04:32:51 | 116,067,644 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package nl.x.client.cheat.cheats.fight;
import com.google.common.collect.Lists;
import nl.x.api.annotations.Info;
import nl.x.api.cheat.Cheat;
import nl.x.api.cheat.value.values.ArrayValue;
import nl.x.api.cheat.value.values.BooleanValue;
import nl.x.api.event.Event;
import nl.x.api.event.impl.EventPacket;
import nl.x.api.event.impl.EventUpdate;
import nl.x.api.event.impl.EventVelocity;
/**
* @author NullEX
*
*/
@Info(name = "Velocity")
public class Velocity extends Cheat {
public ArrayValue mode = new ArrayValue("Mode", Lists.newArrayList("NCP", "AAC"), "NCP");
public BooleanValue smart = new BooleanValue("Smart", true);
public Velocity() {
this.addValue(this.mode, this.smart);
}
/*
* @see nl.x.api.cheat.Cheat#onEvent(nl.x.api.event.Event)
*/
@Override
public void onEvent(Event e) {
if (e instanceof EventVelocity) {
if (this.smart.getValue() ? mc.thePlayer.hurtTime != 0 : true) {
switch (this.mode.getValue().toString().toLowerCase()) {
case "aac":
mc.thePlayer.setSpeed(0.1);
break;
case "ncp":
((EventVelocity) e).setCanceled(true);
break;
}
}
}
if (e instanceof EventUpdate) {
this.setSuffix(this.mode.getValue() + (this.smart.getValue() ? " | Smart" : ""));
}
if (e instanceof EventPacket) {
}
super.onEvent(e);
}
}
| [
"NullEX@Offset#6604"
] | NullEX@Offset#6604 |
ea06847c166a73297a6a449e360cf2055308a279 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_16f47f4e8a7241db50f84fa4aa757e5a29228f20/Utils/3_16f47f4e8a7241db50f84fa4aa757e5a29228f20_Utils_s.java | 15161ebe2c5f1f59f8d4bbd59d72f505e92f6d54 | [] | 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,626 | java | /*
* Copyright (C) 2012 OTA Updater
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may only use this file in compliance with the license and provided you are not associated with or are in co-operation anyone by the name 'X Vanderpoel'.
* 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.updater.ota;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.NoSuchElementException;
import java.util.Scanner;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.ConnectivityManager;
public class Utils {
private static String cachedRomID = null;
private static Date cachedOtaDate = null;
private static String cachedOtaVer = null;
public static boolean marketAvailable(Context ctx) {
PackageManager pm = ctx.getPackageManager();
try {
pm.getPackageInfo("com.android.vending", 0);
} catch (NameNotFoundException e) {
return false;
}
return true;
}
public static boolean isROMSupported() {
String romID = getRomID();
return romID != null && romID.length() != 0;
}
public static String getRomID() {
if (cachedRomID == null) {
cachedRomID = getprop(Config.OTA_ID_PROP);
}
return cachedRomID;
}
public static Date getOtaDate() {
if (cachedOtaDate == null) {
String otaDateStr = getprop(Config.OTA_DATE_PROP);
if (otaDateStr == null) return null;
cachedOtaDate = parseDate(otaDateStr);
}
return cachedOtaDate;
}
public static String getOtaVersion() {
if (cachedOtaVer == null) {
cachedOtaVer = getprop(Config.OTA_VER_PROP);
}
return cachedOtaVer;
}
private static String getprop(String name) {
ProcessBuilder pb = new ProcessBuilder("/system/bin/getprop", name);
pb.redirectErrorStream(true);
Process p = null;
InputStream is = null;
try {
p = pb.start();
is = p.getInputStream();
String prop = new Scanner(is).next();
if (prop.length() == 0) return null;
return prop;
} catch (NoSuchElementException e) {
return null;
} catch (Exception e) {
e.printStackTrace();
} finally {
if (is != null) {
try { is.close(); }
catch (Exception e) { }
}
}
return null;
}
public static boolean dataAvailable(Context ctx) {
ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo().isConnected();
}
public static Date parseDate(String date) {
try {
return new SimpleDateFormat("yyyyMMdd-kkmm").parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
public static String formatDate(Date date) {
return new SimpleDateFormat("yyyyMMdd-kkmm").format(date);
}
public static boolean isUpdate(RomInfo info) {
if (info == null) return false;
if (info.version == null || getOtaVersion() == null || info.version.equalsIgnoreCase(getOtaVersion())) return false;
if (info.date == null || getOtaDate() == null || !info.date.after(getOtaDate())) return false;
return true;
}
private static final char[] HEX_DIGITS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static String byteArrToStr(byte[] bytes) {
StringBuffer str = new StringBuffer();
for (int q = 0; q < bytes.length; q++) {
str.append(HEX_DIGITS[(0xF0 & bytes[q]) >>> 4]);
str.append(HEX_DIGITS[0xF & bytes[q]]);
}
return str.toString();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
84289ee6eae62c3a803fa58809f0dac4a342fccc | eb17b7997c51f7d626527a8c91a91e0e8a576ad7 | /environment/src/main/java/com/sequenceiq/environment/parameters/dto/YarnParametersDto.java | 1b7ee7b8127791e3bc8670072af5af611032eb91 | [
"LicenseRef-scancode-warranty-disclaimer",
"ANTLR-PD",
"CDDL-1.0",
"bzip2-1.0.6",
"Zlib",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-jdbm-1.00",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | isabella232/cloudbreak | cea66f543d523c467e0fab615c1c339c5d15c46a | d974679739023107a9c232e62c552f2359311eb8 | refs/heads/master | 2023-03-06T23:47:51.554879 | 2020-11-26T12:53:26 | 2020-11-26T16:37:01 | 316,290,003 | 0 | 0 | Apache-2.0 | 2021-02-24T09:19:52 | 2020-11-26T16:55:25 | null | UTF-8 | Java | false | false | 406 | java | package com.sequenceiq.environment.parameters.dto;
public class YarnParametersDto {
private YarnParametersDto(Builder builder) {
}
public static Builder builder() {
return new Builder();
}
public static final class Builder {
private Builder() {
}
public YarnParametersDto build() {
return new YarnParametersDto(this);
}
}
}
| [
"rdoktorics@cloudera.com"
] | rdoktorics@cloudera.com |
850765c33908c276d222b4bf7b9d29a0c0d5f2eb | 66848c4e6efe821af2ae7e41435092f272725d61 | /src/com/agloco/exception/NoMemberMatchesMembercodeException.java | 426cf336d7ad3857b4a957fe12459b65f20fa0fd | [] | no_license | harrysun2006/ag_Guest | 59168e01d23ed27bc50ce20e0ed57b1f66eff68a | 331ada157fe7487901e11bae2e6f859fb80e398b | refs/heads/master | 2021-01-01T06:33:07.027227 | 2014-09-03T10:58:39 | 2014-09-03T10:58:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package com.agloco.exception;
import com.liferay.portal.PortalException;
public class NoMemberMatchesMembercodeException extends PortalException
{
public NoMemberMatchesMembercodeException() {
super();
}
public NoMemberMatchesMembercodeException(String msg) {
super(msg);
}
public NoMemberMatchesMembercodeException(String msg, Throwable cause) {
super(msg, cause);
}
public NoMemberMatchesMembercodeException(Throwable cause) {
super(cause);
}
}
| [
"harrysun2006@gmail.com"
] | harrysun2006@gmail.com |
d8bb7ceb53d2da68eeace045554d19c6f6745c50 | a7fda56105e8413d9cc0b657ab75a2d6a2040735 | /app/src/main/java/com/kara4k/popupblocker/service/PopupService.java | a9924012c02166eef87036c09cec912b900c6590 | [] | no_license | kara4k/PopupBlocker | d300dcad434e3483985e30d8d7fffa2e4bc1c968 | f9d357a7883fcd3f9bcb6a7e58ff2d23828da0dd | refs/heads/master | 2021-04-25T22:03:13.737150 | 2017-11-08T12:29:53 | 2017-11-08T12:29:53 | 109,517,826 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,845 | java | package com.kara4k.popupblocker.service;
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.support.annotation.NonNull;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import com.kara4k.popupblocker.other.App;
import com.kara4k.popupblocker.model.DaoSession;
import com.kara4k.popupblocker.model.Package;
import com.kara4k.popupblocker.model.Rule;
import com.kara4k.popupblocker.model.RuleDao;
import java.util.List;
import javax.inject.Inject;
public class PopupService extends AccessibilityService {
@Inject
DaoSession mDaoSession;
@Override
protected void onServiceConnected() {
super.onServiceConnected();
injectDependencies();
setupServiceInfo();
}
/**
* Setup service info with packages to track
*/
private void setupServiceInfo() {
AccessibilityServiceInfo info = getServiceInfo();
info.packageNames = getRegisteredPackages();
setServiceInfo(info);
}
/**
* Get array of package names from database to track
*
* @return array of package names
*/
@NonNull
private String[] getRegisteredPackages() {
List<Package> packages = mDaoSession.getPackageDao().queryBuilder().build().list();
String[] packagesArray = new String[packages.size()];
for (int i = 0; i < packages.size(); i++) {
packagesArray[i] = packages.get(i).getPackageName();
}
return packagesArray;
}
private void injectDependencies() {
((App) getApplication()).getAppComponent().injectService(this);
}
/**
* Events trigger
*
* @param event current event
*/
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
if (isDialog(event)) {
checkRules(event);
}
}
/**
* Check for event equals rule and apply actions
*
* @param event current event
*/
private void checkRules(AccessibilityEvent event) {
String dialogText = event.getText().toString();
String packageName = event.getPackageName().toString();
List<Rule> rules = getRules(packageName);
for (Rule rule : rules) {
String searchText = rule.getSearchText();
if (searchText == null || searchText.trim().equals("")) break;
if (dialogText.contains(searchText)) {
applyRule(event, rule);
break;
}
}
}
/**
* Apply rule for event
*
* @param event current event
* @param rule rule to apply
*/
private void applyRule(AccessibilityEvent event, Rule rule) {
if (rule.getSendBackPress()) {
performGlobalAction(GLOBAL_ACTION_BACK);
} else if (rule.getPressText() != null && !rule.getPressText().equals("")) {
AccessibilityNodeInfo source = event.getSource();
tryToPerformClick(source, rule.getPressText());
}
}
/**
* Search for inner views recursively and perform action click,
* if view text is equals to rule press text
*
* @param info parent node info
* @param text text used for equals checks
*/
private void tryToPerformClick(AccessibilityNodeInfo info, String text) {
if (info != null) {
int childCount = info.getChildCount();
for (int i = 0; i < childCount; i++) {
AccessibilityNodeInfo child = info.getChild(i);
if (child != null) {
if (child.getText() != null && child.getText().toString().toLowerCase().trim()
.equals(text.toLowerCase().trim())) {
child.performAction(AccessibilityNodeInfo.ACTION_CLICK);
return;
}
tryToPerformClick(child, text);
}
}
}
}
/**
* Get rules for specified package from database
*
* @param packageName name of package
* @return list of rules for specified package
*/
private List<Rule> getRules(String packageName) {
List<Rule> rules = mDaoSession.getRuleDao().queryBuilder()
.where(RuleDao.Properties.PackageName.eq(packageName))
.build().list();
return rules;
}
/**
* Check if triggered event view is dialog, by classname contains "dialog"
*
* @param event current event
* @return is current view a dialog view
*/
private boolean isDialog(AccessibilityEvent event) {
return event.getClassName().toString().toLowerCase().contains("dialog");
}
@Override
public void onInterrupt() {
}
}
| [
"kara4k@gmail.com"
] | kara4k@gmail.com |
42bd456619b37704dd6e2862d3ed37631a8b6376 | 51cf893b29e0025e86efc571a0b20fbbec43f744 | /LuBanOne/app/src/main/java/com/example/administrator/lubanone/videopalyer/VideoijkBean.java | 69b02385c9dac94f0dc05232f893bd44fcf8213c | [] | no_license | quyang-xianzaishi/mylib | 1dfc3c141347a8eee5ad831efab5e18fb9d9f726 | 4cabe396090d820a58e6917f16e57a69cc6485b9 | refs/heads/master | 2018-09-29T16:19:05.253246 | 2018-07-15T15:52:46 | 2018-07-15T15:52:46 | 111,664,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,243 | java | package com.example.administrator.lubanone.videopalyer;
/**
* ========================================
* <p>
* 版 权:dou361.com 版权所有 (C) 2015
* <p>
* 作 者:陈冠明
* <p>
* 个人网站:http://www.dou361.com
* <p>
* 版 本:1.0
* <p>
* 创建日期:2016/7/7
* <p>
* 描 述:使用默认的视频地址对象
* <p>
* <p>
* 修订历史:
* <p>
* ========================================
*/
public class VideoijkBean {
/**
* id
*/
int id;
/**
* 分辨率名称
*/
String stream;
/**
* 分辨率对应视频地址
*/
String url;
/**
* 备注备用
*/
String remarks;
/**
* 当前选中的
*/
boolean select;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getStream() {
return stream;
}
public void setStream(String stream) {
this.stream = stream;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public boolean isSelect() {
return select;
}
public void setSelect(boolean select) {
this.select = select;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VideoijkBean that = (VideoijkBean) o;
if (id != that.id) return false;
if (stream != null ? !stream.equals(that.stream) : that.stream != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
return remarks != null ? remarks.equals(that.remarks) : that.remarks == null;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (stream != null ? stream.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
result = 31 * result + (remarks != null ? remarks.hashCode() : 0);
return result;
}
}
| [
"quyang@xianzaishi.com"
] | quyang@xianzaishi.com |
6fecaf355098f921e5205c479299c9995b12a8fb | 9e72d2ec74a613a586499360707910e983a14370 | /web/org/ace/insurance/web/dialog/CountryDialogActionBean.java | ab77ffb0a81b018175d2a1b17e0bd250a04b8de8 | [] | no_license | pyaesonehein1141991/FNI-LIFE | 30ecefca8b12455c0a90906004f85f32217c5bf4 | a40b502147b32193d467c2db7d49e2872f2fcab6 | refs/heads/master | 2020-08-31T11:20:22.757995 | 2019-10-30T11:02:47 | 2019-10-30T11:02:47 | 218,678,685 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | package org.ace.insurance.web.dialog;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import org.ace.insurance.system.common.country.Country;
import org.ace.insurance.system.common.country.service.interfaces.ICountryService;
import org.ace.java.web.common.BaseBean;
import org.primefaces.context.RequestContext;
@ManagedBean(name = "CountryDialogActionBean")
@ViewScoped
public class CountryDialogActionBean extends BaseBean implements Serializable {
private static final long serialVersionUID = 1L;
@ManagedProperty(value = "#{CountryService}")
private ICountryService countryService;
public void setCountryService(ICountryService countryService) {
this.countryService = countryService;
}
private List<Country> countryList;
@PostConstruct
public void init() {
countryList = countryService.findAllCountry();
}
public List<Country> getCountryList() {
return countryList;
}
public void selectCountry(Country country) {
RequestContext.getCurrentInstance().closeDialog(country);
}
}
| [
"ASUS@DESKTOP-37IOB4I"
] | ASUS@DESKTOP-37IOB4I |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.