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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8353d26da598102c4fdb68ce3d610495b80c559a | c612fe9597af8f89a8852c1b1866d4a6460de84e | /judge/src/main/java/org/atanasov/judge/service/ProblemValidationService.java | 26101802a59ce3b37e6d02ecf43c4633e682b29f | [
"MIT"
] | permissive | VasAtanasov/SoftUni-Java-Web-Basics-September-2019 | cf8f79190ba2b2b8d727b9b8c1e05dfc06726ae8 | c5456fd987d559159a3ba3dc16da0875138defd1 | refs/heads/master | 2022-07-10T13:10:21.647063 | 2019-10-30T08:56:55 | 2019-10-30T08:56:55 | 211,797,820 | 0 | 0 | MIT | 2022-06-21T02:08:25 | 2019-09-30T07:09:39 | Java | UTF-8 | Java | false | false | 187 | java | package org.atanasov.judge.service;
public interface ProblemValidationService {
boolean isProblemNameValid(String name);
boolean areProblemTotalPointsValid(Integer points);
}
| [
"vas.atanasov@gmail.com"
] | vas.atanasov@gmail.com |
57e6c3ea599b648873336ce0a2b03dd8deb25518 | 6253283b67c01a0d7395e38aeeea65e06f62504b | /decompile/framework/hwWifi-service/com/android/server/wifi/wifipro/WiFiProScoreInfo.java | 15f1b00457803cfcf8d37fc81e02372f96c435d8 | [] | no_license | sufadi/decompile-hw | 2e0457a0a7ade103908a6a41757923a791248215 | 4c3efd95f3e997b44dd4ceec506de6164192eca3 | refs/heads/master | 2023-03-15T15:56:03.968086 | 2017-11-08T03:29:10 | 2017-11-08T03:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,548 | java | package com.android.server.wifi.wifipro;
import android.common.HwFrameworkFactory;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiInfo;
public class WiFiProScoreInfo implements Comparable {
public static final int EVALUATE_FAIL = 1;
public static final int LEVEL_COMMON = 2;
public static final int LEVEL_GOOD = 3;
public static final int LEVEL_POOR = 1;
public static final int LEVEL_UNLEVEL = 0;
public static final int MODE_BACKGROUND = 1;
public static final int MODE_CONNECTED = 0;
public static final int NOINTERNET = 2;
public static final int NORMAL = 4;
public static final int PORTAL = 3;
public static final int REASON_ABANDON = 0;
public static final int REASON_CONN_FAILURE = 5;
public static final int REASON_CONN_TIMEOUT = 4;
public static final int REASON_INTERNET_CHECK_TIMEOUT = 3;
public static final int REASON_NOINTERNET = 2;
public static final int REASON_PORTAL = 1;
private static final String TAG = "WiFi_PRO_ScoreInfo";
public static final int UNKNOWN = 0;
public boolean abandon;
public boolean evaluated;
public int failCounter;
public int internetAccessType;
public boolean invalid;
public boolean is5GHz;
public long lastScoreTime;
public long lastUpdateTime;
public int networkQosLevel;
public int networkQosScore;
public int networkSecurity;
public int probeMode;
public int rssi;
public String ssid;
public boolean trusted;
public WiFiProScoreInfo(ScanResult scanResult) {
if (scanResult != null) {
this.rssi = scanResult.level;
this.ssid = "\"" + scanResult.SSID + "\"";
this.lastUpdateTime = System.currentTimeMillis();
this.networkQosLevel = 0;
this.networkSecurity = -1;
this.internetAccessType = 0;
this.networkQosScore = 0;
this.evaluated = false;
this.invalid = false;
this.is5GHz = scanResult.is5GHz();
this.failCounter = 0;
this.probeMode = -1;
}
}
public WiFiProScoreInfo(WifiInfo wifiInfo) {
if (wifiInfo != null) {
this.rssi = wifiInfo.getRssi();
this.lastUpdateTime = System.currentTimeMillis();
this.ssid = wifiInfo.getSSID();
this.networkQosLevel = 0;
this.networkSecurity = -1;
this.internetAccessType = 0;
this.networkQosScore = 0;
this.trusted = true;
this.evaluated = false;
this.invalid = false;
this.is5GHz = wifiInfo.is5GHz();
this.failCounter = 0;
this.probeMode = -1;
}
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
public static int calculateWiFiLevel(WiFiProScoreInfo properties) {
return (properties == null || properties.abandon || 2 == properties.internetAccessType || 3 == properties.internetAccessType) ? 0 : 0;
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
public static int calculateWiFiScore(WiFiProScoreInfo properties) {
if (properties == null || properties.abandon || !properties.invalid || 2 == properties.internetAccessType || 3 == properties.internetAccessType) {
return 0;
}
int newSignalLevel = HwFrameworkFactory.getHwInnerWifiManager().calculateSignalLevelHW(properties.rssi);
int boost_5G = 0;
if (properties.is5GHz) {
boost_5G = 10;
}
int boost_trusted = 0;
if (properties.trusted) {
boost_trusted = 1;
}
return ((newSignalLevel * 10) + boost_5G) + boost_trusted;
}
/* JADX WARNING: inconsistent code. */
/* Code decompiled incorrectly, please refer to instructions dump. */
public static int calculateTestWiFiLevel(WiFiProScoreInfo properties) {
if (properties == null || properties.abandon || 2 == properties.internetAccessType || 3 == properties.internetAccessType) {
return 0;
}
int newSignalLevel = HwFrameworkFactory.getHwInnerWifiManager().calculateSignalLevelHW(properties.rssi);
int boost_5G = 0;
if (properties.is5GHz) {
boost_5G = 1;
}
int level = newSignalLevel + boost_5G;
if (level > 2) {
return 3;
}
if (level == 2) {
return 2;
}
return 1;
}
public String dump() {
StringBuffer sb = new StringBuffer();
sb.append("networkQosLevel: ").append(this.networkQosLevel).append(", internetAccessType: ").append(this.internetAccessType).append(", lastScoreTime: ").append(WifiproUtils.formatTime(this.lastScoreTime)).append(", rssi: ").append(this.rssi).append(", ssid: ").append(this.ssid).append(", is5GHz: ").append(this.is5GHz);
return sb.toString();
}
public int getRssi() {
return this.rssi;
}
public int hashCode() {
return Integer.valueOf(this.rssi).hashCode();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
return obj != null && getClass() == obj.getClass() && ((WiFiProScoreInfo) obj).getRssi() == this.rssi;
}
public int compareTo(Object obj) {
return Integer.valueOf(this.rssi).compareTo(Integer.valueOf(((WiFiProScoreInfo) obj).getRssi()));
}
}
| [
"liming@droi.com"
] | liming@droi.com |
782daf009a7c8078555e490f66b939c2b30903cc | 300ddcf99f05646e1ea56f4b06a7a735e9d3341a | /kodilla-testing/src/main/java/com/kodilla/testing/forum/statistics/Statistics.java | 9e0e70e1abdecdb7c76b5d3e8a6629becc5fc493 | [] | no_license | MichalGuz/kodilla-course-new | 335c269c90090c944b1a510ff1045b205b82f0f5 | faa4aab8f6e9f1ef92e3789ff06deb96a080939b | refs/heads/master | 2021-09-14T13:58:39.233246 | 2018-05-14T18:24:10 | 2018-05-14T18:24:10 | 118,367,850 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package com.kodilla.testing.forum.statistics;
import java.util.List;
public interface Statistics {
List<String> usersNames(); // list of users names
int postsCount(); // total quantity of forum posts
int commentsCount(); // total quantity of forum comments
}
| [
"michalguz@gmail.com"
] | michalguz@gmail.com |
680569dbf03d6c0c52bf742dfdaf63a991f234bc | bb8c25ecf757892d798dd0ef97de645066d6612b | /src/design17_责任链模式/sample_1/abstractRequest/AbstractRequest.java | 597c8bb8b2260a77fee4593f2c48e2ff445c0f56 | [] | no_license | xiangyutian/DesignPattern | 05be3d830efccea451052e460443fd3919982cd1 | ae6a68736329cb3ffc5ee36ee9be14eddde39f96 | refs/heads/master | 2020-04-14T11:33:37.765305 | 2017-11-20T05:36:32 | 2017-11-20T05:36:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package design17_责任链模式.sample_1.abstractRequest;
//抽象请求者
public abstract class AbstractRequest {
private Object obj;//处理对象
public AbstractRequest(Object obj) {
this.obj = obj;
}
//获取处理的内容对象
public Object getContent(){
return obj;
}
//获取请求者对象的处理级别
public abstract int getRequestLevel();
}
| [
"1341520108@qq.com"
] | 1341520108@qq.com |
238cd33caa611682a93f462e621ce96b73961b8d | fb9506d58c1dc3410a60308066cecc28fdcd360e | /OntologyUpdate/src/com/hp/hpl/jena/sparql/pfunction/library/textMatch.java | 1e039864a0a08644862b3cef4b04245dc756bb27 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | utalo/ontologyUpdate | 37cab2bf8c89f5d2c29d1036169363a9c901969e | 96b8bcd880930a9d19363d2a80eac65496663b1b | refs/heads/master | 2020-06-14T04:03:28.902754 | 2019-07-02T16:45:53 | 2019-07-02T16:45:53 | 194,888,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,284 | java | /*
* (c) Copyright 2006, 2007, 2008 Hewlett-Packard Development Company, LP
* All rights reserved.
* [See end of file]
*/
package com.hp.hpl.jena.sparql.pfunction.library;
import com.hp.hpl.jena.query.larq.IndexLARQ;
import com.hp.hpl.jena.query.larq.LARQ;
import com.hp.hpl.jena.query.larq.LuceneSearch;
import com.hp.hpl.jena.sparql.engine.ExecutionContext;
/** Property function to search the default Lucene index (which is
* the one set by {@link LARQ#setDefaultIndex(IndexLARQ) })
*/
public class textMatch extends LuceneSearch
{
private IndexLARQ index = null ;
protected IndexLARQ getIndex(ExecutionContext execCxt)
{
if ( index == null )
index = LARQ.getDefaultIndex(execCxt.getContext()) ;
return index ;
}
}
/*
* (c) Copyright 2006, 2007, 2008 Hewlett-Packard Development Company, LP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ | [
"uta.loesch@gmx.de"
] | uta.loesch@gmx.de |
2e56e71d516a1f1f4b71d74004aa5cf3d62cba1f | 3fb5956b7ad7fb348d1d8fc8309ae660f0a07d57 | /src/java_hasta_el_video_200/video184/ColeccionesVILinkedList.java | 7eee5a0452320e3eafcab1b22d4e7b55dfa77897 | [] | no_license | german-jongewaard/PildorasTest | c9c5fd1125afd85bea0a59c45d123d2bb8d0fc17 | ef48ab29e8aef5990a814b28ef89b27aafbeb8c2 | refs/heads/master | 2021-10-27T05:45:54.566000 | 2019-04-14T10:22:41 | 2019-04-14T10:22:41 | 111,906,672 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package java_hasta_el_video_200.video184;
import java.util.*;
/**
*
* @author german
*/
public class ColeccionesVILinkedList {
public static void main(String[] args) {
// TODO code application logic here
LinkedList<String> personas = new LinkedList<String>();
personas.add("Pepe");
personas.add("Sandra");
personas.add("Léa");
personas.add("Mia");
System.out.println(personas.size());
ListIterator<String> it = personas.listIterator();
it.next();
it.add("Juan");
for(String persona: personas){
System.out.println(persona);
}
}
}
| [
"germanjongewaard@gmail.com"
] | germanjongewaard@gmail.com |
0417133475a9e75e5aaacfab113d3e65bd0ce76c | 51a27a589439d35ebcd36ef9ab196107d3e0c942 | /JavaParent/CommonDemo/src/main/java/com/wk/thread/SimpleThreadFactory.java | a6f917fd98528daad33c580725a09aa16fe590ce | [] | no_license | emperwang/JavaBase | a9d9a43c782288ed8d18f4773b105e82b53320cb | 0a0423f85a022f9664e44ab852170fa6e09960ed | refs/heads/master | 2023-02-08T07:40:02.418247 | 2023-02-03T14:49:40 | 2023-02-03T14:49:40 | 185,725,768 | 1 | 0 | null | 2022-12-06T00:32:25 | 2019-05-09T04:23:51 | Java | UTF-8 | Java | false | false | 1,076 | java | package com.wk.thread;
import org.apache.commons.lang3.StringUtils;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
public class SimpleThreadFactory implements ThreadFactory {
private static final AtomicInteger poolNumber = new AtomicInteger(0);
private final ThreadGroup group;
private final AtomicInteger threadNumber = new AtomicInteger(0);
private final String namePrefix;
public SimpleThreadFactory(ThreadGroup group, String namePrefix) {
this.group = group;
this.namePrefix = getPrefix(namePrefix) +"-"+poolNumber.incrementAndGet()+"-";
}
private String getPrefix(String prefix){
if(StringUtils.isNotBlank(prefix)){
return prefix;
}
return this.getClass().getSimpleName();
}
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(group, r, namePrefix + threadNumber.incrementAndGet(), 0);
if(thread.isDaemon()){
thread.setDaemon(false);
}
return thread;
}
}
| [
"544094478@qq.com"
] | 544094478@qq.com |
43535eb339f7b65dcd4ad823a5162e09aeab6616 | 1006d2754c0fd1383efa8247dea71383b43066c4 | /core/api/src/main/java/io/novaordis/gld/api/jms/JmsServiceConfiguration.java | d4a15213e0556306c42f219c74ef1bd041942026 | [
"Apache-2.0"
] | permissive | ovidiuf/gld | b1658988cb35a604d8dbd1bf49d9a01822ee52ce | 1366e9e8149704b71df4db85e29040afa0549f6f | refs/heads/master | 2021-09-04T18:52:11.470159 | 2018-01-21T09:39:51 | 2018-01-21T09:39:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,951 | java | /*
* Copyright (c) 2016 Nova Ordis LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 io.novaordis.gld.api.jms;
import io.novaordis.gld.api.configuration.ServiceConfiguration;
/**
* @author Ovidiu Feodorov <ovidiu@novaordis.com>
* @since 12/6/16
*/
public interface JMSServiceConfiguration extends ServiceConfiguration {
// Constants -------------------------------------------------------------------------------------------------------
// Static ----------------------------------------------------------------------------------------------------------
// Attributes ------------------------------------------------------------------------------------------------------
// Constructors ----------------------------------------------------------------------------------------------------
// Public ----------------------------------------------------------------------------------------------------------
// Package protected -----------------------------------------------------------------------------------------------
// Protected -------------------------------------------------------------------------------------------------------
// Private ---------------------------------------------------------------------------------------------------------
// Inner classes ---------------------------------------------------------------------------------------------------
}
| [
"ovidiu@novaordis.com"
] | ovidiu@novaordis.com |
f71929621abe97595b9993c46dd08a724129d8f1 | 482a0fe6424b42de7f2768f7b64c4fd36dd24054 | /apps/gmail/gmail_uncompressed/app/src/android/support/v4/app/aP.java | 45cfadd2168fb3bb6c0fc7987567f96357c2321e | [] | no_license | dan7800/SoftwareTestingGradProjectTeamB | b96d10c6b42e2e554e51fc1d7fd7a7189afe79d6 | 0ad2d46d692c77bdc75f8a82162749e2e652c7ab | refs/heads/master | 2021-01-22T09:27:25.378594 | 2015-05-15T23:59:13 | 2015-05-15T23:59:13 | 30,304,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package android.support.v4.app;
import java.util.*;
import android.os.*;
import android.app.*;
final class ap
{
public static ArrayList<Parcelable> a(final au[] array) {
ArrayList<Parcelable> list;
if (array == null) {
list = null;
}
else {
list = new ArrayList<Parcelable>(array.length);
for (int length = array.length, i = 0; i < length; ++i) {
list.add((Parcelable)b(array[i]));
}
}
return list;
}
public static void a(final Notification$Builder notification$Builder, final au au) {
final Notification$Action$Builder notification$Action$Builder = new Notification$Action$Builder(au.getIcon(), au.getTitle(), au.aj());
if (au.ak() != null) {
final RemoteInput[] a = aS.a(au.ak());
for (int length = a.length, i = 0; i < length; ++i) {
notification$Action$Builder.addRemoteInput(a[i]);
}
}
if (au.getExtras() != null) {
notification$Action$Builder.addExtras(au.getExtras());
}
notification$Builder.addAction(notification$Action$Builder.build());
}
private static Notification$Action b(final au au) {
final Notification$Action$Builder addExtras = new Notification$Action$Builder(au.getIcon(), au.getTitle(), au.aj()).addExtras(au.getExtras());
final aU[] ak = au.ak();
if (ak != null) {
final RemoteInput[] a = aS.a(ak);
for (int length = a.length, i = 0; i < length; ++i) {
addExtras.addRemoteInput(a[i]);
}
}
return addExtras.build();
}
}
| [
"mjthornton0112@gmail.com"
] | mjthornton0112@gmail.com |
c4db0561338c9e05cbe772b0c911bdbeb251197d | bc2ceac4f2e5b8d5cbd10c40d1db6fe7f23882a1 | /src/main/java/tombenpotter/emt/common/util/EMTCreativeTab.java | 3d962c5c6f707f45543ed4079bd2b59aba58cef8 | [] | no_license | gonglinyuan/Electro-Magic-Tools | d0be659647d96c51c87aca354947018e83a70659 | 427c2ce5d19ca1f17c411738d1b9132c4863136a | refs/heads/master | 2020-12-11T08:02:26.539773 | 2016-01-05T07:19:16 | 2016-01-05T07:19:16 | 49,047,746 | 0 | 0 | null | 2016-01-05T06:49:54 | 2016-01-05T06:49:53 | null | UTF-8 | Java | false | false | 663 | java | package tombenpotter.emt.common.util;
import tombenpotter.emt.common.init.ItemRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class EMTCreativeTab extends CreativeTabs {
public EMTCreativeTab(String tabLabel) {
super(tabLabel);
setBackgroundImageName("emt.png");
}
@Override
public ItemStack getIconItemStack() {
return new ItemStack(ItemRegistry.rockbreakerDrill);
}
@Override
public Item getTabIconItem() {
return new Item();
}
@Override
public boolean hasSearchBar() {
return true;
}
@Override
public int getSearchbarWidth() {
return 60;
}
}
| [
"hazeevaidar@yandex.ru"
] | hazeevaidar@yandex.ru |
e68f51594e06d1ff426de2384ba8b15914343e4a | 9d9c48034112db0f1d93b10c1bfda684f6753bb0 | /Library_TreeFramework/src/main/java/net/sf/anathema/platform/tree/document/components/ExtensibleArrow.java | 520c1409df4bc8c337b9d67dad4759be0a8e28fb | [] | no_license | tienelle/anathema_3e | 804690e37492e77dad041dc6996bdc44755b038e | fd1f0a95e40a5e8b8ca93d0dd8b32fd1239a6787 | refs/heads/master | 2020-12-11T06:15:32.858381 | 2016-08-31T11:02:38 | 2016-08-31T11:02:38 | 66,630,488 | 0 | 1 | null | 2016-08-26T08:25:03 | 2016-08-26T08:25:03 | null | UTF-8 | Java | false | false | 128 | java | package net.sf.anathema.platform.tree.document.components;
public interface ExtensibleArrow {
void addPoint(int x, int y);
}
| [
"ursreupke@gmail.com"
] | ursreupke@gmail.com |
b3b4b8c372e8829710c15bb9ab0a6d8a125f07bd | c64bec932c0a572f18a953fbb35b2217178c650f | /collection/src/main/java/org/dfpl/collection/linkedlist/JNode.java | bf8afd3a3b78f506e491570e6eaa2ec074879123 | [] | no_license | dfpl/collection | ac1bf0bdc060386ec12eaabc7ed5e5748db2ee0f | 3cf3b8ecfe17a97ee576b3da1f8e3ae15f75b8ef | refs/heads/main | 2023-04-15T10:32:43.506830 | 2021-05-04T10:19:35 | 2021-05-04T10:19:35 | 356,454,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package org.dfpl.collection.linkedlist;
@SuppressWarnings("unused")
public class JNode<E> {
private JNode<E> prev;
private E value;
private JNode<E> next;
public JNode(JNode<E> prev, E value, JNode<E> next) {
this.prev = prev;
this.value = value;
this.next = next;
}
}
| [
"bjw0829@gmail.com"
] | bjw0829@gmail.com |
e8e11470b17f224c0a6bae2f1745170ed3c329a5 | 995e655293513d0b9f93d62e28f74b436245ae74 | /src/a/a/e/b/ag.java | b8b70187aef71ba9d2077abf9194b6a0150c1640 | [] | no_license | JALsnipe/HTC-RE-YouTube-Live-Android | 796e7c97898cac41f0f53120e79cde90d3f2fab1 | f941b64ad6445c0a0db44318651dc76715291839 | refs/heads/master | 2021-01-17T09:46:50.725810 | 2015-01-09T23:32:14 | 2015-01-09T23:32:14 | 29,039,855 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,416 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package a.a.e.b;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import sun.misc.Unsafe;
final class ag extends AtomicReferenceFieldUpdater
{
private final long a;
private final Unsafe b;
ag(Unsafe unsafe, Class class1, String s)
{
Field field = class1.getDeclaredField(s);
if (!Modifier.isVolatile(field.getModifiers()))
{
throw new IllegalArgumentException("Must be volatile");
} else
{
b = unsafe;
a = unsafe.objectFieldOffset(field);
return;
}
}
public boolean compareAndSet(Object obj, Object obj1, Object obj2)
{
return b.compareAndSwapObject(obj, a, obj1, obj2);
}
public Object get(Object obj)
{
return b.getObjectVolatile(obj, a);
}
public void lazySet(Object obj, Object obj1)
{
b.putOrderedObject(obj, a, obj1);
}
public void set(Object obj, Object obj1)
{
b.putObjectVolatile(obj, a, obj1);
}
public boolean weakCompareAndSet(Object obj, Object obj1, Object obj2)
{
return b.compareAndSwapObject(obj, a, obj1, obj2);
}
}
| [
"josh.lieberman92@gmail.com"
] | josh.lieberman92@gmail.com |
af99ec53d807be1d3fcf39cfb66cf445dba5a1e4 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/jaxrs-resteasy-eap/generated/src/gen/java/org/openapitools/model/OrgApacheSlingHapiImplHApiUtilImplInfo.java | 7b4e98fe514a2da7db939df9f0977569edb70f62 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 3,256 | java | package org.openapitools.model;
import java.util.Objects;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.OrgApacheSlingHapiImplHApiUtilImplProperties;
import javax.validation.constraints.*;
import io.swagger.annotations.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyEapServerCodegen", date = "2019-08-05T01:00:05.540Z[GMT]")
public class OrgApacheSlingHapiImplHApiUtilImplInfo {
private String pid = null;
private String title = null;
private String description = null;
private OrgApacheSlingHapiImplHApiUtilImplProperties properties = null;
/**
**/
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
@ApiModelProperty(value = "")
@JsonProperty("properties")
public OrgApacheSlingHapiImplHApiUtilImplProperties getProperties() {
return properties;
}
public void setProperties(OrgApacheSlingHapiImplHApiUtilImplProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrgApacheSlingHapiImplHApiUtilImplInfo orgApacheSlingHapiImplHApiUtilImplInfo = (OrgApacheSlingHapiImplHApiUtilImplInfo) o;
return Objects.equals(pid, orgApacheSlingHapiImplHApiUtilImplInfo.pid) &&
Objects.equals(title, orgApacheSlingHapiImplHApiUtilImplInfo.title) &&
Objects.equals(description, orgApacheSlingHapiImplHApiUtilImplInfo.description) &&
Objects.equals(properties, orgApacheSlingHapiImplHApiUtilImplInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OrgApacheSlingHapiImplHApiUtilImplInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
81e8620f742178a182949ce2536acef9f4d407ca | 7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b | /Crawler/data/listStudy.java | 79824b8a08fa105ffa3010e5963048d7e08ce44e | [] | no_license | NayrozD/DD2476-Project | b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0 | 94dfb3c0a470527b069e2e0fd9ee375787ee5532 | refs/heads/master | 2023-03-18T04:04:59.111664 | 2021-03-10T15:03:07 | 2021-03-10T15:03:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | 10
https://raw.githubusercontent.com/hzc869046779/JAVA-STUDY/master/src/javaStudy/listStudy/listStudy.java
package javaStudy.listStudy;
class ArrayUtil{
public static int sum(int ... data){ //变种数组
int sum = 0;
for( int temp:data){
sum += temp;
}
return sum;
}
}
public class listStudy {
public static void main(String[] args){
//一位数组定义使用
int []arr = new int[]{2,3,5,7,4};
// 二维数组定义使用
// int data2 [][] = new int[][]{{1,3,5},{2,4,5}};
// System.out.println(data2[0][0]);
// for(int x[] : data2){
// for(int y : x){
// System.out.println(y);
// }
// }
// 数组排序
// Arrays.sort(arr);
// for(int x : arr){
// System.out.print(x);
// }
// 数组拷贝
// int []arr2 = new int[]{2,3,5,6,7};
// System.arraycopy(arr,0,arr2,2,3);
// System.out.println(Arrays.toString(arr2));
// 变种数组 可变参数
System.out.println(ArrayUtil.sum(1,2,3));
System.out.println(ArrayUtil.sum(new int[] {1,2,3}));
}
}
| [
"veronika.cucorova@gmail.com"
] | veronika.cucorova@gmail.com |
d157eb7ab51e0eda2bb22be3c41d2cdde63ffc00 | 83786eb19d635af09d92f8c7bf47c864d8b961d9 | /李佳怡6月16日/代码/Everylesson/app/src/main/java/com/wsy/everylesson/net/HttpUrlConnetionUtils.java | 8f514727781539b9ea05aeb5945fa41ed06ea687 | [] | no_license | ljy0505/HomeWork | 350a887d16ca96c507009c68a8af43499ccd1569 | ae2e5c612366afbc0d077e64e8c72c6a1ca47464 | refs/heads/master | 2022-11-04T11:42:20.334830 | 2020-06-15T16:38:57 | 2020-06-15T16:38:57 | 268,204,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,245 | java | package com.wsy.everylesson.net;
import java.util.HashMap;
/**
* httpurl 请求方式--- 切换使用 不需要更改代码,做到网络请求的切换
* 工厂设计模式
* 工厂设计类
*/
public class HttpUrlConnetionUtils implements INetWork{
private static HttpUrlConnetionUtils httpUrlConnetionUtils;
private HttpUrlConnetionUtils() {
}
public static HttpUrlConnetionUtils getInstance() {
if(httpUrlConnetionUtils == null){
synchronized (RetrofitUtils.class){
if (httpUrlConnetionUtils == null){
httpUrlConnetionUtils = new HttpUrlConnetionUtils();
}
}
}
return httpUrlConnetionUtils;
}
@Override
public <T> void get(String url,ResultCallBack<T> netCallBack) {
// 也做网络请求
//将请求到的结果通过咱们的 INetCallBack 返回的
}
@Override
public <T> void get(String url, HashMap<String, String> s,ResultCallBack<T> netCallBack) {
}
@Override
public <T> void post(String url,ResultCallBack<T> netCallBack) {
}
@Override
public <T> void post(String url, HashMap<String, String> s,ResultCallBack<T> netCallBack) {
}
}
| [
"floveandroid@sina.com"
] | floveandroid@sina.com |
4f2761b6f90a5adaea1ab9abfeb56606b30ca289 | 2903eadab6dad7e8d66462b9647f4baacfeababa | /day180404/src/com/stringtokenizer/StringTokenizerEx1.java | c582b71282bee86f5b707fe294a90685adb92e8f | [] | no_license | swchod1/multicampus_javaworkspace | 53f9f811d2beac15dc3f11354b7c55fc70ed4e47 | 1c2296836a3fc50190df9c16f19ae353a382981c | refs/heads/master | 2023-01-21T16:08:33.085840 | 2020-11-30T13:40:10 | 2020-11-30T13:40:10 | 316,420,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,639 | java | package com.stringtokenizer;
import java.util.StringTokenizer;
public class StringTokenizerEx1 {
StringTokenizer st;
public StringTokenizerEx1(String str) {
// TODO Auto-generated constructor stub
// 생성자에 전달된 str 인자값을 출력
System.out.println("str : " + str);
// 멤버 객체 생성
st = new StringTokenizer(str);
}
public StringTokenizerEx1(String str, String delim) {
// TODO Auto-generated constructor stub
// 생성자에 전달된 str 인자값을 출력
System.out.println("str : " + str);
// 문자열을 구분하기 위한 두번째 매개변수를 사용(토큰 식별)
// delim("/") --> /로 구분 위 처럼 아무것도 없으면 스페이스바(공백으로 구분)
st = new StringTokenizer(str, delim);
}
public void print() {
System.out.println("Token count : " + st.countTokens()); // 토큰의 갯수를 센다.
while(st.hasMoreTokens()) { // 토큰이 있는지 없는지 구별
String token = st.nextToken();
System.out.println(token);
}
System.out.println("======================================");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
StringTokenizerEx1 st1 = new StringTokenizerEx1("나 보기가 역겨워 가실때에는 말없이 고이"); // 마지막 띄어쓰기로 6개
st1.print();
StringTokenizerEx1 st2 = new StringTokenizerEx1("2018/04/04", "/");
st2.print();
/*
* StringTokenizer의 경우 공백을 무시하고 제거한다.
* String은 공백도 하나의 문자로 인식 --> Ex2에서 이를 제거해 봄.
*/
}
}
| [
"swchod1@gmail.com"
] | swchod1@gmail.com |
1dc252a46f52d2bcfbf4fe8c4b4f686562f0b58e | af0c4995d4bf5f76a6ca283fc55dfdca4e52ca3a | /program/src/main/java/com/whaley/biz/program/uiview/viewmodel/BaseUIViewModel.java | 13794d15ffb9bfb990970b0d0fc28836faa8cbe6 | [] | no_license | portal-io/portal-android | da60c4a7d54fb56fbc983c635bb1d2c4d542f78e | 623757fbb4d7979745b4c8ee34cebbf395cbd249 | refs/heads/master | 2020-03-20T07:58:08.196164 | 2019-03-16T02:30:48 | 2019-03-16T02:30:48 | 137,295,692 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,233 | java | package com.whaley.biz.program.uiview.viewmodel;
import com.whaley.biz.common.ui.viewmodel.IViewModel;
import com.whaley.biz.program.uiview.model.ClickModel;
import com.whaley.biz.program.uiview.model.PageModel;
/**
* Author: qxw
* Date: 2017/3/16
*/
public abstract class BaseUIViewModel implements ListUIViewModel, SeverBindViewModel, OutRectUIViewModel, IViewModel {
public static final int RECT_LEFT = 1;
public static final int RECT_RIGHT = 2;
public static final int RECT_LEFT_AND_RIGHT = 3;
int outTop;
int outLeft;
int outRight;
int outBottom;
int spanSize;
String eventId;
String key;
Object serverModel;
PageModel pageModel;
ClickModel clickModel;
@Override
public PageModel getPageModel() {
return pageModel;
}
public void setPageModel(PageModel pageModel) {
this.pageModel = pageModel;
}
@Override
public ClickModel getClickModel() {
return clickModel;
}
public void setClickModel(ClickModel clickModel) {
this.clickModel = clickModel;
}
@Override
public int getSpanSize() {
return spanSize;
}
@Override
public void setSpanSize(int spanSize) {
this.spanSize = spanSize;
}
@Override
public void convert(Object severModel) {
this.serverModel = severModel;
}
@Override
public <M> M getSeverModel() {
return (M) serverModel;
}
@Override
public int getOutTop() {
return outTop;
}
@Override
public void setOutTop(int outTop) {
this.outTop = outTop;
}
@Override
public int getOutLeft() {
return outLeft;
}
@Override
public void setOutLeft(int outLeft) {
this.outLeft = outLeft;
}
@Override
public int getOutRight() {
return outRight;
}
@Override
public void setOutRight(int outRight) {
this.outRight = outRight;
}
@Override
public int getOutBottom() {
return outBottom;
}
@Override
public void setOutBottom(int outBottom) {
this.outBottom = outBottom;
}
@Override
public boolean isCanClick() {
return false;
}
}
| [
"lizs@snailvr.com"
] | lizs@snailvr.com |
2df01d2f38a7abe95aff2ee3d2e04085b9e1c678 | 307c96177195afafc1277b6bbc99f2220fb37584 | /src/main/java/com/laptrinhjavaweb/converter/BuildingConverter.java | 16f2a8f41ebc1033799610ab22a204ee69ebe659 | [] | no_license | taivtse/estate-jsp-servlet-project | d71c853a2922acdcf8b3967a121d0cf4534e0d73 | a21de2c317feb64f38c76109b1e0e90fab081909 | refs/heads/master | 2020-04-22T10:18:21.461926 | 2019-05-07T10:52:02 | 2019-05-07T10:52:02 | 170,300,543 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.laptrinhjavaweb.converter;
import com.laptrinhjavaweb.dto.BuildingDto;
import com.laptrinhjavaweb.entity.BuildingEntity;
public class BuildingConverter extends AbstractConverter<BuildingDto, BuildingEntity> {
}
| [
"taivtse@gmail.com"
] | taivtse@gmail.com |
7647a420bc21be7a31cd815960b334e0bbf7b6db | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a029/A029105Test.java | 67e57aee17bf81d58d86a67c7263bb422cca3ca3 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a029;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A029105Test extends AbstractSequenceTest {
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
21cb52347cd9716dcc12806f38de0548cbaa4d73 | b2619de33f6cb49bb4d49e0f9aa3d13a5d1e9159 | /app/src/main/java/com/fanfan/robot/adapter/recycler/other/ImportAdapter.java | c28614c987783a1d14c90cdf8756bde8b0cf833a | [] | no_license | HaiFengZhiNeng/FanFan | fbe268fe04f1c687b8b13af2f9e08850f565d85b | 4404dbcd12fc808f979dec9c78641b8d368bef5f | refs/heads/master | 2021-01-25T10:55:52.769035 | 2018-08-06T01:30:10 | 2018-08-06T01:30:10 | 123,375,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,228 | java | package com.fanfan.robot.adapter.recycler.other;
import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fanfan.robot.R;
import com.fanfan.robot.model.Channel;
import java.util.List;
/**
* Created by android on 2018/2/23.
*/
public class ImportAdapter extends BaseMultiItemQuickAdapter<Channel, BaseViewHolder> {
private boolean mIsEdit;
private RecyclerView mRecyclerView;
public ImportAdapter(List<Channel> data) {
super(data);
mIsEdit = false;
addItemType(Channel.TYPE_TITLE, R.layout.item_channel_title);
addItemType(Channel.TYPE_CONTENT, R.layout.channel_rv_item);
}
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
mRecyclerView = (RecyclerView) parent;
return super.onCreateViewHolder(parent, viewType);
}
@Override
protected void convert(BaseViewHolder helper, Channel item) {
switch (helper.getItemViewType()) {
case Channel.TYPE_TITLE:
helper.setText(R.id.tvTitle, item.getChannelName());
helper.getView(R.id.tv_edit).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!mIsEdit) {
startEditMode(true);
} else {
startEditMode(false);
}
}
});
break;
case Channel.TYPE_CONTENT:
helper.setText(R.id.tv_channelname, item.getChannelName())
.setVisible(R.id.img_edit, mIsEdit)
.addOnClickListener(R.id.img_edit);
break;
}
}
private void startEditMode(boolean isEdit) {
mIsEdit = isEdit;
int visibleChildCount = mRecyclerView.getChildCount();
for (int i = 0; i < visibleChildCount; i++) {
View view = mRecyclerView.getChildAt(i);
ImageView imgEdit = (ImageView) view.findViewById(R.id.img_edit);
TextView tvName = (TextView) view.findViewById(R.id.tv_channelname);
TextView tvEdit = (TextView) view.findViewById(R.id.tv_edit);
if (imgEdit != null) {
imgEdit.setVisibility(imgEdit.getTag() != null && isEdit ? View.VISIBLE : View.INVISIBLE);
}
if (tvName != null) {
if (tvName.getTag() == null) return;
if (isEdit && (Boolean) tvName.getTag()) {
tvName.setTextColor(Color.GRAY);
} else {
tvName.setTextColor(Color.BLACK);
}
}
if (tvEdit != null) {
if (isEdit) {
tvEdit.setText("完成");
} else {
tvEdit.setText("编辑");
}
}
}
}
}
| [
"765151629@qq.com"
] | 765151629@qq.com |
867594acce6bea8727d7861588a683a8cbb74a3b | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/mapstruct/learning/746/JodaTimeConstants.java | 5920b3f423918758926c282689bb636934f8c0d9 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 909 | java | /*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct.ap.internal.util;
/**
* Helper holding constants for working with Joda-Time.
*
* @author Timo Eckhardt
*/
public final class JodaTimeConstants {
private JodaTimeConstants() {
}
public static final String DATE_TIME_FQN = "org.joda.time.DateTime";
public static final String LOCAL_DATE_TIME_FQN = "org.joda.time.LocalDateTime";
public static final String LOCAL_DATE_FQN =
"org.joda.time.LocalDate";
public static final String LOCAL_TIME_FQN = "org.joda.time.LocalTime";
public static final String DATE_TIME_FORMAT_FQN = "org.joda.time.format.DateTimeFormat";
public static final String DATE_TIME_ZONE_FQN = "org.joda.time.DateTimeZone";
public static final String DATE_TIME_FORMAT = "LL";
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
ce213455a5ee21b9730d7f6a240aa4ca0c5329eb | 5bb943fc7dafbfd3cd831775dd32c28453baf2ec | /manifold-core-parent/manifold/src/main/java/manifold/internal/javac/JavaDynamicJdk_8.java | 4e0990475267eb5c640020fca87f14138b6ed6fe | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | permissive | escanda/manifold | 98cf93bb2288d597fe81aec088a7851e2c9284e0 | b558fadc9b3064dcefc9c884c80f18e398457f54 | refs/heads/master | 2022-08-28T14:46:18.222669 | 2022-07-22T02:52:16 | 2022-07-22T02:52:16 | 261,657,072 | 0 | 0 | Apache-2.0 | 2020-05-06T05:06:13 | 2020-05-06T05:06:12 | null | UTF-8 | Java | false | false | 5,345 | java | /*
* Copyright (c) 2018 - Manifold Systems LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 manifold.internal.javac;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symtab;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.model.JavacElements;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Log;
import com.sun.tools.javac.util.Name;
import com.sun.tools.javac.util.Names;
import java.util.Collections;
import java.util.Locale;
import java.util.function.Predicate;
import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;
public class JavaDynamicJdk_8 implements IDynamicJdk
{
@Override
public <T> void report( Log issueLogger, Diagnostic<? extends T> diagnostic )
{
// Adapted from JavacMessager.printMessage. Following same basic routine regarding use of Log
JavaFileObject oldSource = issueLogger.useSource( (JavaFileObject)diagnostic.getSource() );
boolean oldMultipleErrors = issueLogger.multipleErrors;
issueLogger.multipleErrors = true;
try
{
switch( diagnostic.getKind() )
{
case ERROR:
issueLogger.error( new IssueReporter.Position( diagnostic ), "proc.messager", diagnostic.getMessage( Locale.getDefault() ) );
break;
case WARNING:
issueLogger.warning( new IssueReporter.Position( diagnostic ), "proc.messager", diagnostic.getMessage( Locale.getDefault() ) );
break;
case MANDATORY_WARNING:
issueLogger.mandatoryWarning( new IssueReporter.Position( diagnostic ), "proc.messager", diagnostic.getMessage( Locale.getDefault() ) );
break;
case NOTE:
case OTHER:
issueLogger.note( new IssueReporter.Position( diagnostic ), "proc.messager", diagnostic.getMessage( Locale.getDefault() ) );
break;
}
}
finally
{
issueLogger.useSource( oldSource );
issueLogger.multipleErrors = oldMultipleErrors;
}
}
@Override
public Iterable<Symbol> getMembers( Symbol.ClassSymbol classSym, boolean completeFirst )
{
Scope members = completeFirst ? classSym.members() : classSym.members_field;
return members == null ? Collections.emptyList() : members.getElements();
}
@Override
public Iterable<Symbol> getMembers( Symbol.ClassSymbol classSym, Predicate<Symbol> predicate, boolean completeFirst )
{
Scope members = completeFirst ? classSym.members() : classSym.members_field;
return members == null ? Collections.emptyList() : members.getElements( t -> predicate.test( t ) );
}
@Override
public Iterable<Symbol> getMembersByName( Symbol.ClassSymbol classSym, Name call, boolean completeFirst )
{
Scope members = completeFirst ? classSym.members() : classSym.members_field;
return members == null ? Collections.emptyList() : members.getElementsByName( call );
}
@Override
public Symbol.ClassSymbol getTypeElement( Context ctx, Object ignore, String fqn )
{
return JavacElements.instance( ctx ).getTypeElement( fqn );
}
@Override
public Symbol.ClassSymbol getLoadedClass( Context ctx, String fqn )
{
Name name = Names.instance( ctx ).fromString( fqn );
return Symtab.instance( ctx ).classes.get( name );
}
public void setOperatorSymbol( Context ctx, JCTree.JCBinary cond, JCTree.Tag tag, String op, Symbol operandType )
{
Symbol.OperatorSymbol operatorSym = (Symbol.OperatorSymbol)IDynamicJdk.instance().getMembers(
Symtab.instance( ctx ).predefClass,
(Symbol s) -> s instanceof Symbol.OperatorSymbol &&
s.name.toString().equals( op ) &&
((Symbol.MethodSymbol)s).params().get( 0 ).type.tsym == operandType )
.iterator().next(); // should be just one
setOperator( cond, operatorSym );
}
@Override
public List<Type> getTargets( JCTree.JCLambda tree )
{
return tree.targets;
}
@Override
public void setTargets( JCTree.JCLambda tree, List<Type> targets )
{
tree.targets = targets;
}
@Override
public Symbol getOperator( JCTree.JCExpression tree )
{
return tree instanceof JCTree.JCBinary ? ((JCTree.JCBinary)tree).operator : ((JCTree.JCUnary)tree).operator;
}
@Override
public void setOperator( JCTree.JCExpression tree, Symbol.OperatorSymbol operator )
{
if( tree instanceof JCTree.JCBinary )
{
((JCTree.JCBinary)tree).operator = operator;
}
else
{
((JCTree.JCUnary)tree).operator = operator;
}
}
@Override
public void logError( Log logger, JCDiagnostic.DiagnosticPosition pos, String key, Object... args )
{
logger.error( pos, key, args );
}
}
| [
"rsmckinney@hotmail.com"
] | rsmckinney@hotmail.com |
404ba47810c300a5a2869dd562d156b3a4f9823d | 1a32d704493deb99d3040646afbd0f6568d2c8e7 | /BOOT-INF/lib/ch/qos/logback/core/pattern/color/GrayCompositeConverter.java | 8214ba327047d0300a52f920a1b6023003e31b42 | [] | no_license | yanrumei/bullet-zone-server-2.0 | e748ff40f601792405143ec21d3f77aa4d34ce69 | 474c4d1a8172a114986d16e00f5752dc019cdcd2 | refs/heads/master | 2020-05-19T11:16:31.172482 | 2019-03-25T17:38:31 | 2019-03-25T17:38:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | /* */ package ch.qos.logback.core.pattern.color;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class GrayCompositeConverter<E>
/* */ extends ForegroundCompositeConverterBase<E>
/* */ {
/* */ protected String getForegroundColorCode(E event)
/* */ {
/* 30 */ return "1;30";
/* */ }
/* */ }
/* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\logback-core-1.1.11.jar!\ch\qos\logback\core\pattern\color\GrayCompositeConverter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"ishankatwal@gmail.com"
] | ishankatwal@gmail.com |
6f3cbb37851776e5c6731fa1e76598368b36709e | e6345f2b1f20deaa0af75f313ba3daf72d723d62 | /actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/viewmodel/UploadFileCallback.java | 6d123c4a10a887e0db0b4880bbad2d1ee1032bee | [
"Apache-2.0"
] | permissive | chinningzeng/dangchat-sdk | 4b821a762b898408b6bb4b9c31fc1eea0ae6e484 | 16a4b4dff4ad6c7d18d28525eb13195d1139e2ac | refs/heads/master | 2020-12-31T00:39:52.452282 | 2016-10-12T05:46:48 | 2016-10-12T05:47:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | /*
* Copyright (C) 2015 Actor LLC. <https://actor.im>
*/
package im.actor.core.viewmodel;
import com.google.j2objc.annotations.ObjectiveCName;
/**
* Upload file callback. Methods always called on background thread.
*/
public interface UploadFileCallback {
/**
* On File not uploading
*/
@ObjectiveCName("onNotUploading")
void onNotUploading();
/**
* On File upload in progress
*
* @param progress progress value in [0..1]
*/
@ObjectiveCName("onUploading:")
void onUploading(float progress);
/**
* On file uploaded
*/
@ObjectiveCName("onUploaded")
void onUploaded();
}
| [
"song@justep.com"
] | song@justep.com |
8b0b909a0fdf83d4e702ef6667636511d0bb60fd | 0296b2c9341e334ce41fe7d2cd5e0287b1975889 | /tags/isoparser-1.0-beta-6/src/main/java/com/coremedia/iso/boxes/fragment/SampleFlags.java | da6e8fe25a9f0af1e708e0aff35dfa48e0f82bd1 | [] | no_license | Angiefl/mp4parser | 0133aed52915e16108be218c3077f50e5c31996c | a556eeb220fb6240cd5399d1b92212e749902f0c | refs/heads/master | 2021-01-13T14:37:03.226591 | 2014-07-22T09:29:26 | 2014-07-22T09:29:26 | 51,381,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,365 | java | /*
* Copyright 2009 castLabs GmbH, Berlin
*
* 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.coremedia.iso.boxes.fragment;
import com.coremedia.iso.IsoOutputStream;
import java.io.IOException;
/**
* bit(6) reserved=0;
* unsigned int(2) sample_depends_on;
* unsigned int(2) sample_is_depended_on;
* unsigned int(2) sample_has_redundancy;
* bit(3) sample_padding_value;
* bit(1) sample_is_difference_sample;
* // i.e. when 1 signals a non-key or non-sync sample
* unsigned int(16) sample_degradation_priority;
*/
public class SampleFlags {
private int reserved;
private int sampleDependsOn;
private int sampleIsDependentOn;
private int sampleHasRedundancy;
private int samplePaddingValue;
private boolean sampleIsDifferenceSample;
private int sampleDegradationPriority;
public SampleFlags(long flags) {
reserved = (int) (flags >> 26);
sampleDependsOn = (int) (flags >> 24) & 0x3;
sampleIsDependentOn = (int) (flags >> 22) & 0x3;
sampleHasRedundancy = (int) (flags >> 20) & 0x3;
samplePaddingValue = (int) (flags >> 17) & 0x7;
sampleIsDifferenceSample = ((flags >> 16) & 0x1) == 1;
sampleDegradationPriority = (int) flags & 0xFFFF;
}
public int getReserved() {
return reserved;
}
public int getSampleDependsOn() {
return sampleDependsOn;
}
public int getSampleIsDependentOn() {
return sampleIsDependentOn;
}
public int getSampleHasRedundancy() {
return sampleHasRedundancy;
}
public int getSamplePaddingValue() {
return samplePaddingValue;
}
public boolean isSampleIsDifferenceSample() {
return sampleIsDifferenceSample;
}
public int getSampleDegradationPriority() {
return sampleDegradationPriority;
}
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("SampleFlags");
sb.append("{reserved=").append(reserved);
sb.append(", sampleDependsOn=").append(sampleDependsOn);
sb.append(", sampleIsDependentOn=").append(sampleIsDependentOn);
sb.append(", sampleHasRedundancy=").append(sampleHasRedundancy);
sb.append(", samplePaddingValue=").append(samplePaddingValue);
sb.append(", sampleIsDifferenceSample=").append(sampleIsDifferenceSample);
sb.append(", sampleDegradationPriority=").append(sampleDegradationPriority);
sb.append('}');
return sb.toString();
}
public void getContent(IsoOutputStream os) throws IOException {
long flags = reserved << 26;
flags = flags | (sampleDependsOn << 24);
flags = flags | (sampleHasRedundancy << 22);
flags = flags | (samplePaddingValue << 19);
flags = flags | ((sampleIsDifferenceSample ? 1 : 0) << 18);
flags = flags | sampleDegradationPriority;
os.writeUInt32(flags);
}
}
| [
"Sebastian.Annies@gmail.com"
] | Sebastian.Annies@gmail.com |
e471de336fbcbeb4adbe08222a560d37318bb741 | 853f5824e0ac30c3e14ec787ee9c487b6e117da4 | /src/main/java/com/hong/py/jwt/RestAuthenticationEntryPoint.java | a9d0b9a8d61d71e5172b4b8d1642be7315e0aedb | [] | no_license | hongpingyang/springbootdemo | 1604d61efcf2177d09648210a01e15a5ffe3266d | 119ce2f5b5f37b3d54768d24dcf8c82f9453f222 | refs/heads/master | 2022-12-02T02:13:01.002110 | 2020-03-10T13:43:36 | 2020-03-10T13:43:36 | 226,439,145 | 1 | 0 | null | 2022-11-15T23:33:18 | 2019-12-07T01:37:00 | Java | UTF-8 | Java | false | false | 1,255 | java | package com.hong.py.jwt;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hong.py.common.CommonResult;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 当未登录或者token失效访问接口时,自定义的返回结果
*/
@Component
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
ObjectMapper objectMapper = new ObjectMapper();
System.out.println(objectMapper.writeValueAsString(CommonResult.unauthorized(authException.getMessage())));
response.getWriter().println(objectMapper.writeValueAsString(CommonResult.unauthorized(authException.getMessage())));
response.getWriter().flush();
}
}
| [
"hpymn123@163.com"
] | hpymn123@163.com |
abf8a659a07901d53323be2b4fc7d8fb7c536477 | b6ea417b48402d85b6fe90299c51411b778c07cc | /spring-webflux/src/test/java/org/springframework/web/reactive/DispatcherHandlerTests.java | 6f38771f26f2912419f9866435a9e9300839c80c | [
"Apache-2.0"
] | permissive | DevHui/spring-framework | 065f24e96eaaed38495b9d87bc322db82b6a046c | 4a2f291e26c6f78c3875dea13432be21bb1c0ed6 | refs/heads/master | 2020-12-04T21:08:18.445815 | 2020-01-15T03:54:42 | 2020-01-15T03:54:42 | 231,526,595 | 1 | 0 | Apache-2.0 | 2020-01-03T06:28:30 | 2020-01-03T06:28:29 | null | UTF-8 | Java | false | false | 4,064 | java | /*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.reactive;
import org.junit.Test;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.MethodParameter;
import org.springframework.core.Ordered;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
import org.springframework.mock.web.test.server.MockServerWebExchange;
import org.springframework.web.method.ResolvableMethod;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.function.Supplier;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.withSettings;
/**
* Unit tests for {@link DispatcherHandler}.
*
* @author Rossen Stoyanchev
*/
public class DispatcherHandlerTests {
private static final MethodParameter RETURN_TYPE =
ResolvableMethod.on(DispatcherHandler.class).named("handle").resolveReturnType();
@Test
public void handlerMappingOrder() {
HandlerMapping hm1 = mock(HandlerMapping.class, withSettings().extraInterfaces(Ordered.class));
HandlerMapping hm2 = mock(HandlerMapping.class, withSettings().extraInterfaces(Ordered.class));
when(((Ordered) hm1).getOrder()).thenReturn(1);
when(((Ordered) hm2).getOrder()).thenReturn(2);
when((hm1).getHandler(any())).thenReturn(Mono.just((Supplier<String>) () -> "1"));
when((hm2).getHandler(any())).thenReturn(Mono.just((Supplier<String>) () -> "2"));
StaticApplicationContext context = new StaticApplicationContext();
context.registerBean("b2", HandlerMapping.class, () -> hm2);
context.registerBean("b1", HandlerMapping.class, () -> hm1);
context.registerBean(HandlerAdapter.class, SupplierHandlerAdapter::new);
context.registerBean(HandlerResultHandler.class, StringHandlerResultHandler::new);
context.refresh();
DispatcherHandler dispatcherHandler = new DispatcherHandler(context);
MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/"));
dispatcherHandler.handle(exchange).block(Duration.ofSeconds(0));
assertEquals("1", exchange.getResponse().getBodyAsString().block(Duration.ofSeconds(5)));
}
@SuppressWarnings("unused")
private void handle() {
}
private static class SupplierHandlerAdapter implements HandlerAdapter {
@Override
public boolean supports(Object handler) {
return handler instanceof Supplier;
}
@Override
public Mono<HandlerResult> handle(ServerWebExchange exchange, Object handler) {
return Mono.just(new HandlerResult(handler, ((Supplier<?>) handler).get(), RETURN_TYPE));
}
}
private static class StringHandlerResultHandler implements HandlerResultHandler {
@Override
public boolean supports(HandlerResult result) {
Object value = result.getReturnValue();
return value != null && String.class.equals(value.getClass());
}
@Override
public Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result) {
byte[] bytes = ((String) result.getReturnValue()).getBytes(StandardCharsets.UTF_8);
DataBuffer dataBuffer = new DefaultDataBufferFactory().wrap(bytes);
return exchange.getResponse().writeWith(Mono.just(dataBuffer));
}
}
}
| [
"pengshaohui@markor.com.cn"
] | pengshaohui@markor.com.cn |
d4e7d9fe8679d59719e8ddb84ce2834a0b21c11f | 96dfb134bf443e6bf2c5b6f38a3eb1814b6e8236 | /scim-sdk-common/src/main/java/de/captaingoldfish/scim/sdk/common/resources/multicomplex/Email.java | 386b33d86bb770a2a7d63c6c5e467276fbbb9e00 | [] | permissive | Captain-P-Goldfish/SCIM-SDK | 58843a21ef701509bf840158f8ec46b882ec6b39 | a95d421d5834cd44b6f6d40c583b96e212d97ba9 | refs/heads/master | 2023-07-27T02:25:44.575852 | 2023-04-26T18:37:27 | 2023-04-26T18:37:27 | 217,992,347 | 98 | 30 | BSD-3-Clause | 2023-07-21T14:26:20 | 2019-10-28T07:48:51 | Java | UTF-8 | Java | false | false | 1,182 | java | package de.captaingoldfish.scim.sdk.common.resources.multicomplex;
import lombok.Builder;
import lombok.NoArgsConstructor;
/**
* author Pascal Knueppel <br>
* created at: 11.10.2019 - 13:13 <br>
* <br>
* Email addresses for the User. The value SHOULD be specified according to [RFC5321]. Service providers
* SHOULD canonicalize the value according to [RFC5321], e.g., "bjensen@example.com" instead of
* "bjensen@EXAMPLE.COM". The "display" sub-attribute MAY be used to return the canonicalized representation
* of the email value. The "type" sub-attribute is used to provide a classification meaningful to the (human)
* user. The user interface should encourage the use of basic values of "work", "home", and "other" and MAY
* allow additional type values to be used at the discretion of SCIM clients.
*/
@NoArgsConstructor
public class Email extends MultiComplexNode
{
@Builder
public Email(String type, Boolean primary, String display, String value, String ref)
{
super(type, primary, display, value, ref);
}
/**
* override lombok builder with public constructor
*/
public static class EmailBuilder
{
public EmailBuilder()
{}
}
}
| [
"captain.p.goldfish@gmx.de"
] | captain.p.goldfish@gmx.de |
ef9f397e7f9c04ca7e4c0e6f8fbaadf7b2575ce8 | 28bee3beb9632b8f344957caae6490e71ba85d64 | /CSVM-Modelling-and-Validation/src/org.activiti.designer.model/src/main/java/org/eclipse/bpmn2/impl/RelationshipImpl.java | 7212ca4493780eba94e8bed6e8c30dd31e6908a3 | [
"Apache-2.0"
] | permissive | AniketosEU/Security-Service-Validation-and-Verification | c37672458719b83a405f436d233997cf25491f28 | d5381915e183788c09af6d69035409f9424527bc | refs/heads/master | 2021-03-12T20:18:16.363883 | 2015-06-15T07:25:54 | 2015-06-15T07:25:54 | 15,805,871 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,725 | java | /**
* <copyright>
*
* Copyright (c) 2010 SAP AG.
* 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:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
* </copyright>
*/
package org.eclipse.bpmn2.impl;
import java.util.Collection;
import java.util.List;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Relationship;
import org.eclipse.bpmn2.RelationshipDirection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Relationship</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.bpmn2.impl.RelationshipImpl#getSources <em>Sources</em>}</li>
* <li>{@link org.eclipse.bpmn2.impl.RelationshipImpl#getTargets <em>Targets</em>}</li>
* <li>{@link org.eclipse.bpmn2.impl.RelationshipImpl#getDirection <em>Direction</em>}</li>
* <li>{@link org.eclipse.bpmn2.impl.RelationshipImpl#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RelationshipImpl extends BaseElementImpl implements Relationship {
/**
* The cached value of the '{@link #getSources() <em>Sources</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSources()
* @generated
* @ordered
*/
protected EList<EObject> sources;
/**
* The cached value of the '{@link #getTargets() <em>Targets</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTargets()
* @generated
* @ordered
*/
protected EList<EObject> targets;
/**
* The default value of the '{@link #getDirection() <em>Direction</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDirection()
* @generated
* @ordered
*/
protected static final RelationshipDirection DIRECTION_EDEFAULT = RelationshipDirection.NONE;
/**
* The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDirection()
* @generated
* @ordered
*/
protected RelationshipDirection direction = DIRECTION_EDEFAULT;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final String TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected String type = TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RelationshipImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.RELATIONSHIP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List<EObject> getSources() {
if (sources == null) {
sources = new EObjectResolvingEList<EObject>(EObject.class, this,
Bpmn2Package.RELATIONSHIP__SOURCES);
}
return sources;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public List<EObject> getTargets() {
if (targets == null) {
targets = new EObjectResolvingEList<EObject>(EObject.class, this,
Bpmn2Package.RELATIONSHIP__TARGETS);
}
return targets;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RelationshipDirection getDirection() {
return direction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDirection(RelationshipDirection newDirection) {
RelationshipDirection oldDirection = direction;
direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Bpmn2Package.RELATIONSHIP__DIRECTION, oldDirection,
direction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(String newType) {
String oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Bpmn2Package.RELATIONSHIP__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.RELATIONSHIP__SOURCES:
return getSources();
case Bpmn2Package.RELATIONSHIP__TARGETS:
return getTargets();
case Bpmn2Package.RELATIONSHIP__DIRECTION:
return getDirection();
case Bpmn2Package.RELATIONSHIP__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.RELATIONSHIP__SOURCES:
getSources().clear();
getSources().addAll((Collection<? extends EObject>) newValue);
return;
case Bpmn2Package.RELATIONSHIP__TARGETS:
getTargets().clear();
getTargets().addAll((Collection<? extends EObject>) newValue);
return;
case Bpmn2Package.RELATIONSHIP__DIRECTION:
setDirection((RelationshipDirection) newValue);
return;
case Bpmn2Package.RELATIONSHIP__TYPE:
setType((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.RELATIONSHIP__SOURCES:
getSources().clear();
return;
case Bpmn2Package.RELATIONSHIP__TARGETS:
getTargets().clear();
return;
case Bpmn2Package.RELATIONSHIP__DIRECTION:
setDirection(DIRECTION_EDEFAULT);
return;
case Bpmn2Package.RELATIONSHIP__TYPE:
setType(TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.RELATIONSHIP__SOURCES:
return sources != null && !sources.isEmpty();
case Bpmn2Package.RELATIONSHIP__TARGETS:
return targets != null && !targets.isEmpty();
case Bpmn2Package.RELATIONSHIP__DIRECTION:
return direction != DIRECTION_EDEFAULT;
case Bpmn2Package.RELATIONSHIP__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT
.equals(type);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (direction: ");
result.append(direction);
result.append(", type: ");
result.append(type);
result.append(')');
return result.toString();
}
} //RelationshipImpl
| [
"adbrucker@0x5f.org"
] | adbrucker@0x5f.org |
37a871125027638d3831b68fa0d45505d5ed7fc9 | 093f97eeda83ddde5dd7425af6f3b918d7bdfb13 | /core/src/main/java/harmony/core/impl/condition/Not.java | 28b8f0022a8077d8137e9d412c347dccc7a35b06 | [] | no_license | enridaga/harmony | 816f599c058895c0b628b33a0da226864d7341f6 | 96fcafbe4d298bdf234867315e879e88196b7c9f | refs/heads/master | 2022-11-26T13:22:11.179280 | 2022-11-20T17:28:00 | 2022-11-20T17:28:00 | 53,848,687 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package harmony.core.impl.condition;
import harmony.core.api.condition.Condition;
import harmony.core.api.condition.ConditionVisitor;
public final class Not implements Condition {
private Condition cond = null;
public Not(Condition cond) {
this.cond = cond;
}
public Condition getCondition() {
return cond;
}
@Override
public boolean accept(ConditionVisitor assessment) {
return assessment.visit(this);
}
@Override
public int compareTo(Condition o) {
if(o instanceof Bool){
return 1;
}
return cond.compareTo(o);
}
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append("(not ");
sb.append(cond.toString());
sb.append(")");
return sb.toString();
}
}
| [
"enricodaga@gmail.com"
] | enricodaga@gmail.com |
a2e184c8da3bbd5d3c0051bc7e682588d94903dd | d2845579ea6aa51a2e150f0ffe6ccfda85d035ce | /fusion/fusion-service/src/main/java/com/welab/wefe/data/fusion/service/repo/AbstractStorage.java | 1d3af7a503ca075309bdbfedbccd6975a1106e3a | [
"Apache-2.0"
] | permissive | as23187/WeFe | d8de9ff626f9f3e5d98e0850b0b717a80fd73e72 | ba92871d4b1d2eef6c606c34795f4575e84703bd | refs/heads/main | 2023-08-22T12:01:06.718246 | 2021-10-28T01:54:05 | 2021-10-28T01:54:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,693 | java | /**
* Copyright 2021 Tianmian Tech. 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 com.welab.wefe.data.fusion.service.repo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import javax.sql.DataSource;
import java.sql.*;
/**
* @author hunter.zhao
*/
public abstract class AbstractStorage extends Storage {
protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
private final static char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
@Qualifier("storageDataSource")
@Autowired
protected DataSource dataSource;
/**
* Calculate the number of nodes based on the node size
*/
public int getCountByByteSize(String dbName, String tbName, long byteSize) throws Exception {
return 1000;
}
/**
* For a link
*/
protected Connection getConnection() {
Connection conn = null;
try {
conn = dataSource.getConnection();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}
/**
* Release resources
*/
protected void close(Statement stat, Connection conn) {
if (stat != null) {
try {
stat.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
/**
* Release resources
*/
protected void close(ResultSet rs, Statement stat, Connection conn) {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (stat != null) {
try {
stat.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
protected String formatTableName(String dbName, String tbName) {
return String.format("`%s`.`%s`", dbName, tbName);
}
/**
* Check create table
*
* @param dbName
* @param tbName
* @throws SQLException
*/
protected void checkTB(String dbName, String tbName) throws SQLException {
Connection conn = null;
PreparedStatement statement = null;
try {
conn = getConnection();
String sql = "CREATE TABLE IF NOT EXISTS " + formatTableName(dbName, tbName) + "(`eventDate` Date, `k` String, `v` String, `id` String) ENGINE = MergeTree() PARTITION BY toDate(eventDate) ORDER BY (id) SETTINGS index_granularity = 8192";
statement = conn.prepareStatement(sql);
statement.execute();
} finally {
close(statement, conn);
}
}
}
| [
"winter.zou@welab-inc.com"
] | winter.zou@welab-inc.com |
09136d4e21e0fb6b07bb7b799b772a4ada24ed79 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a018/A018893Test.java | 6b84d854d651806ab1ff9c53833b501acf8577bc | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a018;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A018893Test extends AbstractSequenceTest {
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
ea762464d28b71f6f5763dd4599770685c7c2519 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /api-vs-impl-small/core/src/main/java/org/gradle/testcore/performancenull_37/Productionnull_3658.java | 4fd0398ce9ee2dd4957031e099a80d25177f73d9 | [] | 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 | 589 | java | package org.gradle.testcore.performancenull_37;
public class Productionnull_3658 {
private final String property;
public Productionnull_3658(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
e02d8ee21931963577dff9972c92c278f973f769 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/model_seeding/80_wheelwebtool-wheel.components.Image-0.5-1/wheel/components/Image_ESTest_scaffolding.java | 5ad876d6f75a29f7b0bd757d15a99a3620cc5c15 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Oct 29 08:48:44 GMT 2019
*/
package wheel.components;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class Image_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
917a01b97e5ae724f54e56d4958d324b047607f7 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_447ed64480268cd8af75e072633c89a74eddedbb/EmailSenderApp/1_447ed64480268cd8af75e072633c89a74eddedbb_EmailSenderApp_t.java | 99820d725c79694251c717432fc2d3b7d73cf983 | [] | 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,854 | java | /**
* Copyright (C) 2013 Robert Munteanu (robert@lmn.ro)
*
* 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 ro.lmn.presos.di.emailsender.impl.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ro.lmn.presos.di.emailsender.api.RecipientFinder;
import ro.lmn.presos.di.emailsender.api.SmtpService;
import ro.lmn.presos.di.emailsender.api.TextFormatter;
@Configuration
public class EmailSenderApp {
public static void main(String[] args) {
ApplicationContext context = new AnnotationConfigApplicationContext(EmailSenderApp.class);
context.getBean(EmailSender.class).sendMail("Hello there", "Buy cheap $product");
}
@Bean
public SmtpService smtpService() {
return new DebuggingSmtpService();
}
@Bean
public RecipientFinder recipientFinder() {
return new InMemoryRecipientFinder();
}
@Bean
public TextFormatter textFormatter() {
return new DoNothingTextFormatter();
}
@Bean
public EmailSender emailSender() {
return new EmailSender();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
0d3269c9bb515ad6e3cf15efbd4911a27b2525a9 | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-newhomework/utopia-newhomework-api/src/main/java/com/voxlearning/utopia/service/newhomework/api/mapper/response/intelligentteaching/IntelligentTeachingReport.java | bed7b0b6f4a178a44ec25584b606920b1547b4d3 | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 1,748 | java | package com.voxlearning.utopia.service.newhomework.api.mapper.response.intelligentteaching;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Comparator;
import java.util.List;
/**
* 分享报告>>讲练测总结
*
* @author majianxin
* @version V1.0
* @date 2018/8/14
*/
@Getter
@Setter
public class IntelligentTeachingReport implements Serializable {
private static final long serialVersionUID = -7138331315702386426L;
private int hasCourseGraspUserCount; //订正完成且有课程掌握学生数
private int hitCourseStudentCount; //命中课程学生数
private double advanceAccuracy; //进步学生比率(四舍五入取整)
private List<AdvanceStudent> advanceStudents; //进步学生详情
@Getter
@Setter
public static class AdvanceStudent implements Serializable {
private static final long serialVersionUID = 4118888741394521614L;
private Long studentId; //学生ID
private String studentName; //学生姓名
private String advanceType; //掌握类型 QUESTION:掌握题目数, ORAL
private int count; //掌握数量
}
public static class AdvanceStudentComparator implements Comparator<AdvanceStudent> {
@Override
public int compare(AdvanceStudent o1, AdvanceStudent o2) {
String oral = "ORAL";
if (o1.getAdvanceType().equals(o2.getAdvanceType())) {
return o1.getStudentId().compareTo(o2.getStudentId());
} else {
if (oral.equals(o1.getAdvanceType())) {
return -1;
} else {
return 1;
}
}
}
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
00a59cb93513b6df26e95acf6e1d374808379271 | f67b12d2c12c95a14ec2b5e7b2c1ceaaa1b6f47c | /JAVAStudy6-集合/src/i泛型机制/GenericTest02.java | 2648239bd67d751de41de6b931480c08d3093f9c | [] | no_license | Milianjie/JAVASEStudy2020 | eb187241f75397bb923bab43c5ea2a4f962799f6 | 7c747f941f7484ea3d268c38e65bc18f4fc07b67 | refs/heads/master | 2023-02-03T09:48:34.820388 | 2020-12-21T14:53:38 | 2020-12-21T14:53:38 | 307,290,488 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 420 | java | package i泛型机制;
import java.util.ArrayList;
import java.util.List;
/*
* JDK8之后引入了自动类型推断机制,或者说砖石表达式
*/
public class GenericTest02 {
public static void main(String[] args) {
//引入的自动类型推断机制,就是在创建集合new对象的语句中不用再写类名进去,可根据前面自动推断
List<Animal> list = new ArrayList<>();
}
}
| [
"1256478773@qq.com"
] | 1256478773@qq.com |
260572e8ca65b1a39f44fee886a342d321ec1105 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_40703.java | 7b27293f428737f6fec0000ff4b96fe0d195e0c5 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | /**
* Look for a attribute named {@code attr} and if found, return its type.
*/
@Nullable public Type lookupAttrType(String attr){
List<Binding> bs=lookupAttr(attr);
if (bs == null) {
return null;
}
else {
return makeUnion(bs);
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
b08ce9a739faa88a1db54298bd70e36858436cbf | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/34/org/apache/commons/lang3/time/DateUtils_setMilliseconds_594.java | 116e8f0d8b3ba95e274b7194e8c117fa9c2a0f48 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,660 | java |
org apach common lang3 time
suit util surround
link java util calendar link java util date object
date util dateutil lot common method manipul
date calendar method requir extra explan
truncat ceil round method consid math floor
math ceil math round version date
date field bottom order
complement method introduc fragment method
method date field top order
date year valid date decid
kind date field result instanc millisecond dai
author apach softwar foundat
author href mailto sergek lokitech serg knystauta
author janek bogucki
author href mailto ggregori seagullsw gari gregori
author phil steitz
author robert scholt
version
date util dateutil
set milisecond field date return object
origin date object unchang
param date date
param amount amount set
date object set
illeg argument except illegalargumentexcept date
date set millisecond setmillisecond date date amount
set date calendar millisecond amount
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
fa98c220c9f70721207b9c253f6e4c6981ae4e81 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/10/10_54fa005aa98a5467ec64a40852aea734d503c25b/VirtualKeyboard/10_54fa005aa98a5467ec64a40852aea734d503c25b_VirtualKeyboard_t.java | ce384eafa95692455665dad3089492d913bb3550 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,210 | java | package com.github.jvirtualkb;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.lang.reflect.Method;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
/**
* @author Fábio Gomes
*
*/
public class VirtualKeyboard extends JDialog {
private static final long serialVersionUID = 1L;
/**
*
*/
public static final int MODE_ALPHANUMERIC = 0;
/**
*
*/
public static final int MODE_ALPHABETIC = 1;
/**
*
*/
public static final int MODE_NUMERIC = 2;
private static final char TK_TAB = '-';
private static final char TK_CAPS_LOCK = '>';
private static final char TK_SHIFT = '<';
private static final char TK_OK = '.';
private static final String KEYPAD = "-QWERTYUIOP>ASDFGHJKL\u2190<ZXCVBNM .";
private static final String NUMPAD = "6789234501\u2190.";
private Component source;
private Method eventProcessor;
private boolean sendEnterOnFinish;
private final Color clrBtnBackgrChk = new Color(53, 147, 194);
private Color clrBtnBackgrDef;
private Button btnTab;
private Button btnShift;
private Button btnCapsLock;
/**
*
*/
private final ActionListener keyAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Button bt = (Button) e.getSource();
String txt = bt.getText();
if (bt == btnTab) {
sendKey('\t', KeyEvent.KEY_PRESSED);
} else if (bt == btnCapsLock) {
btnShift.release();
bt.toggle();
} else if (bt == btnShift) {
btnCapsLock.release();
bt.toggle();
} else if (txt.equals("\u2190")) {
sendKey('\b', KeyEvent.KEY_PRESSED);
} else if (txt.equals("OK")) {
setVisible(false);
if (sendEnterOnFinish) {
sendKey('\n', KeyEvent.KEY_PRESSED);
}
} else {
char ch = bt.getText().charAt(0);
if (btnShift != null && btnCapsLock != null) {
if (btnShift.isHeld()) {
btnShift.release();
} else if (!btnCapsLock.isHeld()) {
ch = Character.toLowerCase(ch);
}
}
sendKey(ch, KeyEvent.KEY_TYPED);
}
}
};
/**
* @param source
* @param mode
* @throws AWTException
*/
public VirtualKeyboard(Component source, int mode) {
if (source == null) {
throw new NullPointerException("source cannot be null");
}
this.source = source;
this.eventProcessor = getEventProcessor(source.getClass());
setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
setResizable(false);
setUndecorated(true);
getContentPane().setBackground(new Color(65, 92, 131));
setLayout(new FlowLayout());
JPanel p1, p2 = null;
if (mode != MODE_NUMERIC) {
p1 = new JPanel(new GridLayout(3, 1));
p1.setOpaque(false);
for (int i = 0; i < KEYPAD.length(); i++) {
if (i % 11 == 0) {
if (i > 0) {
p1.add(p2);
}
if (i == 22) {
p2 = new JPanel(new GridLayout(1, 11));
} else {
p2 = new JPanel(new GridLayout(1, 11));
}
p2.setOpaque(false);
}
char ch = KEYPAD.charAt(i);
Button btn = new Button(ch);
if (ch == TK_TAB) {
btnTab = btn;
} else if (ch == TK_CAPS_LOCK) {
btnCapsLock = btn;
} else if (ch == TK_SHIFT) {
btnShift = btn;
}
p2.add(btn);
}
p1.add(p2);
getContentPane().add(p1);
}
if (mode != MODE_ALPHABETIC) {
p1 = new JPanel(new GridLayout(0, 4));
p1.setOpaque(false);
for (int i = 0; i < NUMPAD.length(); i++) {
p1.add(new Button(NUMPAD.charAt(i)));
}
getContentPane().add(p1);
}
pack();
setLocationRelativeTo(null);
setAlwaysOnTop(true);
}
/**
*
*/
@Override
public void setVisible(boolean b) {
int x = (int) source.getLocationOnScreen().getX();
int y = (int) (source.getLocationOnScreen().getY() + source.getSize().getHeight());
double xr = x + getSize().getWidth();
Dimension win = Toolkit.getDefaultToolkit().getScreenSize();
if (xr > win.getWidth()) {
x = (int) (x - (xr - win.getWidth()));
}
if (x < 0) {
x = 0;
}
setLocation(x, y);
super.setVisible(b);
}
public Component getSource() {
return source;
}
public void setSource(Component source) {
if (source == null) {
throw new NullPointerException("source cannot be null");
}
this.source = source;
this.eventProcessor = getEventProcessor(source.getClass());
}
public boolean isSendEnterOnFinish() {
return sendEnterOnFinish;
}
public void setSendEnterOnFinish(boolean sendEnterOnFinish) {
this.sendEnterOnFinish = sendEnterOnFinish;
}
/**
* @author Fábio Gomes
*/
private class Button extends JButton {
private static final long serialVersionUID = 1L;
private Button(char ch) {
String val;
switch (ch) {
case TK_TAB:
val = "TAB";
break;
case TK_CAPS_LOCK:
val = "CAPS";
break;
case TK_SHIFT:
val = "SHIFT";
break;
case TK_OK:
val = "OK";
break;
default:
val = String.valueOf(ch);
break;
}
setText(val);
setPreferredSize(new Dimension(55, 50));
setFont(new Font("Sans-Serif", Font.BOLD, 14));
setMargin(new Insets(0, 0, 0, 0));
addActionListener(keyAction);
if (clrBtnBackgrDef == null) {
clrBtnBackgrDef = getBackground();
}
setOpaque(true);
}
private boolean isHeld() {
return getBackground().equals(clrBtnBackgrChk);
}
private void hold() {
setBackground(clrBtnBackgrChk);
}
private void release() {
setBackground(clrBtnBackgrDef);
}
private void toggle() {
if (isHeld()) {
release();
} else {
hold();
}
}
}
/**
* @param cl
*/
private Method getEventProcessor(Class<?> cl) {
try {
Method m = cl.getDeclaredMethod("processKeyEvent", KeyEvent.class);
m.setAccessible(true);
return m;
} catch (NoSuchMethodException e) {
cl = cl.getSuperclass();
if (cl != null && !cl.equals(Object.class)) {
return getEventProcessor(cl);
} else
return null;
} catch (Exception e) {
return null;
}
}
/**
* @param ch
*/
private void sendKey(char ch, int keyEvent) {
KeyEvent evt;
if (ch == '\b') {
evt = new KeyEvent(source, keyEvent, System.currentTimeMillis(), 0,
KeyEvent.VK_BACK_SPACE, '\b');
} else if (ch == '\t') {
evt = new KeyEvent(source, keyEvent, System.currentTimeMillis(), 0, KeyEvent.VK_TAB,
'\t');
} else if (ch == '\n') {
evt = new KeyEvent(source, keyEvent, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER,
'\n');
} else {
evt = new KeyEvent(source, keyEvent, System.currentTimeMillis(), 0,
KeyEvent.VK_UNDEFINED, ch);
}
try {
eventProcessor.invoke(source, evt);
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
7b6b8f5fb2b143cc896d4608cc56d1278274721c | d62d163af6852f893f5f2619a5bc2f408064ef0b | /shared/src/main/java/org/gluu/casa/rest/ProtectedApi.java | 4ce1428f1276b6bd9c3f29aed20d843d05f5c3c9 | [
"Apache-2.0"
] | permissive | GluuFederation/casa | 693ab56926668e18e064f3e91884acf3f04fca51 | debfa481e1a1ebef56653658cd279d415d72811c | refs/heads/master | 2023-08-16T17:47:05.099253 | 2023-06-09T13:27:51 | 2023-06-09T13:27:51 | 140,332,921 | 19 | 12 | Apache-2.0 | 2023-09-11T11:44:47 | 2018-07-09T19:29:44 | Java | UTF-8 | Java | false | false | 1,090 | java | package org.gluu.casa.rest;
import javax.ws.rs.NameBinding;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotate a JAX-RS resource method with this annotation to make the endpoint protected. Clients hitting your endpoint
* must pass a valid OAuth bearer token (with proper scopes) in the request header to have access. Example:
* <pre>
*
* import javax.ws.rs.GET;
* import javax.ws.rs.Path;
*
* {@literal @}Path("/library")
* public class LibraryRestService {
*
* {@literal @}GET
* {@literal @}Path("/books")
* {@literal @}ProtectedApi(scopes = {"read"})
* public String getBooks() {
* return ...
* }
*
* }
* </pre>
*
* If all methods of your class are protected using the same scopes, apply the annotation at the class level instead
*
* @author jgomer
*/
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface ProtectedApi {
String[] scopes() default {};
}
| [
"bonustrack310@gmail.com"
] | bonustrack310@gmail.com |
377d8608ec002d95ec996d35ae505ff1fe22fc76 | b75badb20cf913069d96e2e18e95d1f458c73fb9 | /app/src/main/java/com/app/worki/Login.java | 9a1057ddf2508492d054e63a4b13b43df0535a7b | [] | no_license | saif0347/Worki | fcdb30fa99b4341a632d48c44af89c55884673a5 | c3b6134bc6fc941013d49d8bac9d935ba71cad3d | refs/heads/master | 2022-09-05T04:28:51.880108 | 2020-05-30T00:19:39 | 2020-05-30T00:19:39 | 254,893,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,038 | java | package com.app.worki;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.app.worki.model.UserModel;
import com.app.worki.util.FirestoreUtil;
import com.app.worki.util.LogUtil;
import com.app.worki.util.PrefsUtil;
import com.app.worki.util.Utils;
import com.app.worki.util.ValidUtil;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import java.util.HashMap;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class Login extends AppCompatActivity {
@BindView(R.id.username)
EditText username;
@BindView(R.id.login)
Button login;
@BindView(R.id.admin)
TextView admin;
@BindView(R.id.progressBar)
ProgressBar progressBar;
String pushToken = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
if (PrefsUtil.isLogin(this)) {
if (PrefsUtil.getUserType(this).equals("admin")) {
Intent adminHome = new Intent(this, AdminHome.class);
startActivity(adminHome);
finish();
} else {
Intent userHome = new Intent(this, UserHome.class);
startActivity(userHome);
finish();
}
}
FirestoreUtil.getPushToken(this, new FirestoreUtil.FirebasePushToken() {
@Override
public void pushToken(String token) {
pushToken = token;
}
});
}
@OnClick({R.id.login, R.id.admin})
public void onViewClicked(View view) {
Utils.clickEffect(view);
switch (view.getId()) {
case R.id.login:
loginUser();
break;
case R.id.admin:
Intent admin = new Intent(this, AdminLogin.class);
startActivity(admin);
break;
}
}
private void loginUser() {
if(username.getText().toString().isEmpty()){
username.setError("Full name Required");
return;
}
if(!ValidUtil.checkTextOnly(Utils.txt(username))){
username.setError("Invalid full name");
return;
}
progressBar.setVisibility(View.VISIBLE);
FirestoreUtil.getDocsFiltered(FirestoreUtil.users, "username", Utils.txt(username).toLowerCase(), new FirestoreUtil.LoadResultDocs() {
@Override
public void success(QuerySnapshot querySnapshot) {
if(querySnapshot.size() == 0){
LogUtil.loge("does not exist: create user");
UserModel userModel = new UserModel();
userModel.setType("user");
userModel.setUsername(Utils.txt(username).toLowerCase());
userModel.setAdmin_name("");
userModel.setPhoto("photo.png");
userModel.setToken(pushToken);
userModel.setDate_added(""+System.currentTimeMillis());
userModel.setStatus(0);
userModel.setStatus_time("");
FirestoreUtil.addDoc(userModel, FirestoreUtil.users, new FirestoreUtil.AddDocResult() {
@Override
public void success(DocumentReference docRef) {
LogUtil.loge("created: login");
updateToken(docRef);
moveToHome(userModel);
}
@Override
public void fail(String error) {
progressBar.setVisibility(View.GONE);
Toast.makeText(Login.this, ""+error, Toast.LENGTH_SHORT).show();
}
});
}
else{
LogUtil.loge("exist: login");
for (QueryDocumentSnapshot snapshot : querySnapshot) {
updateToken(snapshot.getReference());
UserModel userModel = snapshot.toObject(UserModel.class);
moveToHome(userModel);
}
}
}
@Override
public void error(String error) {
progressBar.setVisibility(View.GONE);
Toast.makeText(Login.this, ""+error, Toast.LENGTH_SHORT).show();
}
});
}
private void updateToken(DocumentReference reference) {
PrefsUtil.setUserId(this, reference.getId());
LogUtil.loge("update token");
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("token", pushToken);
FirestoreUtil.addUpdateDoc(hashMap, FirestoreUtil.users, reference.getId(), new FirestoreUtil.AddUpdateResult() {
@Override
public void success() {
LogUtil.loge("token updated");
}
@Override
public void fail(String error) {
Toast.makeText(Login.this, ""+error, Toast.LENGTH_SHORT).show();
}
});
}
private void moveToHome(UserModel userModel) {
progressBar.setVisibility(View.VISIBLE);
PrefsUtil.setLogin(Login.this, true);
PrefsUtil.setUserType(Login.this, "user");
PrefsUtil.setUsername(Login.this, userModel.getUsername());
PrefsUtil.setPhoto(this, userModel.getPhoto());
Intent user = new Intent(Login.this, UserHome.class);
startActivity(user);
finishAffinity();
}
}
| [
"saif@saifs-MacBook-Pro.local"
] | saif@saifs-MacBook-Pro.local |
d045f54d3095b23e376ec7c73067f09c8b5d3664 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/protocal/protobuf/bup.java | 49def65268037288583d4fe1f872423d85845d28 | [] | 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 | 5,237 | java | package com.tencent.mm.protocal.protobuf;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bx.b;
import java.util.LinkedList;
public final class bup
extends erp
{
public atz YIY;
public String aaaG;
public String aabM;
public b aacl;
public String query;
public String request_id;
public final int op(int paramInt, Object... paramVarArgs)
{
AppMethodBeat.i(259243);
if (paramInt == 0)
{
paramVarArgs = (i.a.a.c.a)paramVarArgs[0];
if (this.BaseRequest != null)
{
paramVarArgs.qD(1, this.BaseRequest.computeSize());
this.BaseRequest.writeFields(paramVarArgs);
}
if (this.YIY != null)
{
paramVarArgs.qD(2, this.YIY.computeSize());
this.YIY.writeFields(paramVarArgs);
}
if (this.aacl != null) {
paramVarArgs.d(3, this.aacl);
}
if (this.query != null) {
paramVarArgs.g(4, this.query);
}
if (this.request_id != null) {
paramVarArgs.g(5, this.request_id);
}
if (this.aabM != null) {
paramVarArgs.g(6, this.aabM);
}
if (this.aaaG != null) {
paramVarArgs.g(7, this.aaaG);
}
AppMethodBeat.o(259243);
return 0;
}
if (paramInt == 1) {
if (this.BaseRequest == null) {
break label722;
}
}
label722:
for (int i = i.a.a.a.qC(1, this.BaseRequest.computeSize()) + 0;; i = 0)
{
paramInt = i;
if (this.YIY != null) {
paramInt = i + i.a.a.a.qC(2, this.YIY.computeSize());
}
i = paramInt;
if (this.aacl != null) {
i = paramInt + i.a.a.b.b.a.c(3, this.aacl);
}
paramInt = i;
if (this.query != null) {
paramInt = i + i.a.a.b.b.a.h(4, this.query);
}
i = paramInt;
if (this.request_id != null) {
i = paramInt + i.a.a.b.b.a.h(5, this.request_id);
}
paramInt = i;
if (this.aabM != null) {
paramInt = i + i.a.a.b.b.a.h(6, this.aabM);
}
i = paramInt;
if (this.aaaG != null) {
i = paramInt + i.a.a.b.b.a.h(7, this.aaaG);
}
AppMethodBeat.o(259243);
return i;
if (paramInt == 2)
{
paramVarArgs = new i.a.a.a.a((byte[])paramVarArgs[0], unknownTagHandler);
for (paramInt = erp.getNextFieldNumber(paramVarArgs); paramInt > 0; paramInt = erp.getNextFieldNumber(paramVarArgs)) {
if (!super.populateBuilderWithField(paramVarArgs, this, paramInt)) {
paramVarArgs.kFT();
}
}
AppMethodBeat.o(259243);
return 0;
}
if (paramInt == 3)
{
Object localObject1 = (i.a.a.a.a)paramVarArgs[0];
bup localbup = (bup)paramVarArgs[1];
paramInt = ((Integer)paramVarArgs[2]).intValue();
Object localObject2;
switch (paramInt)
{
default:
AppMethodBeat.o(259243);
return -1;
case 1:
paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject1 = (byte[])paramVarArgs.get(paramInt);
localObject2 = new kc();
if ((localObject1 != null) && (localObject1.length > 0)) {
((kc)localObject2).parseFrom((byte[])localObject1);
}
localbup.BaseRequest = ((kc)localObject2);
paramInt += 1;
}
AppMethodBeat.o(259243);
return 0;
case 2:
paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject1 = (byte[])paramVarArgs.get(paramInt);
localObject2 = new atz();
if ((localObject1 != null) && (localObject1.length > 0)) {
((atz)localObject2).parseFrom((byte[])localObject1);
}
localbup.YIY = ((atz)localObject2);
paramInt += 1;
}
AppMethodBeat.o(259243);
return 0;
case 3:
localbup.aacl = ((i.a.a.a.a)localObject1).ajGk.kFX();
AppMethodBeat.o(259243);
return 0;
case 4:
localbup.query = ((i.a.a.a.a)localObject1).ajGk.readString();
AppMethodBeat.o(259243);
return 0;
case 5:
localbup.request_id = ((i.a.a.a.a)localObject1).ajGk.readString();
AppMethodBeat.o(259243);
return 0;
case 6:
localbup.aabM = ((i.a.a.a.a)localObject1).ajGk.readString();
AppMethodBeat.o(259243);
return 0;
}
localbup.aaaG = ((i.a.a.a.a)localObject1).ajGk.readString();
AppMethodBeat.o(259243);
return 0;
}
AppMethodBeat.o(259243);
return -1;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.protocal.protobuf.bup
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
2c4c4768e422e89f90bd21e43a80fda33e869b18 | ca0e9689023cc9998c7f24b9e0532261fd976e0e | /src/com/tencent/mm/plugin/talkroom/model/s.java | e9784eb75fbeec9a48f5c9f1e128c27484ad21aa | [] | no_license | honeyflyfish/com.tencent.mm | c7e992f51070f6ac5e9c05e9a2babd7b712cf713 | ce6e605ff98164359a7073ab9a62a3f3101b8c34 | refs/heads/master | 2020-03-28T15:42:52.284117 | 2016-07-19T16:33:30 | 2016-07-19T16:33:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.tencent.mm.plugin.talkroom.model;
final class s
implements Runnable
{
s(l paraml, int paramInt) {}
public final void run()
{
l.a(fUT, cec - 1);
}
}
/* Location:
* Qualified Name: com.tencent.mm.plugin.talkroom.model.s
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
df87e7c7db789c3f1137bb04fdde7724b49869eb | 9a2d885bf748bb25bdf8895e301781de3b5b147d | /strategy/src/com/bccv/strategy/utils/SerializationUtil.java | 0017f080bd43bd96ae417540a583d9cf3ef575dc | [] | no_license | Jisucloud/android | 918215138ed4b558eb32ee61d89b6cbd046cf414 | ae886daf4a29f9e46612a58197abb2f4895c0fbc | refs/heads/master | 2023-03-19T22:26:54.391865 | 2017-04-11T07:26:09 | 2017-04-11T07:26:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,686 | java | package com.bccv.strategy.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import android.content.Context;
public class SerializationUtil {
public static final String LOCAL_CARE = "local_care.txt";//本地关注
public static final String LOCAL_LIKE = "local_like.txt";//本地喜欢
public static final String LOCAL_DIGG = "local_digg.txt";//本地喜欢
/**
* 保存本地关注
* @param mContext
* @param ser
*/
public static void wirteCareSerialization(Context mContext,Serializable ser){
saveObject(mContext, ser, LOCAL_CARE);
}
/**
* 读取本地关注列表
* @param mContext
* @return
*/
@SuppressWarnings("unchecked")
public static ArrayList<String> readCareSerialization(Context mContext){
return (ArrayList<String>)readObject(mContext, LOCAL_CARE);
}
/**
* 清除本地关注列表
* @param context
*/
public static void removeLocalCare(Context context){
removeLocalDataSerialization(context, LOCAL_CARE);
}
/**
* 保存本地关注
* @param mContext
* @param ser
*/
public static void wirteDiggSerialization(Context mContext,Serializable ser){
saveObject(mContext, ser, LOCAL_DIGG);
}
/**
* 读取本地关注列表
* @param mContext
* @return
*/
@SuppressWarnings("unchecked")
public static ArrayList<String> readDiggSerialization(Context mContext){
return (ArrayList<String>)readObject(mContext, LOCAL_DIGG);
}
/**
* 清除本地关注列表
* @param context
*/
public static void removeLocalDigg(Context context){
removeLocalDataSerialization(context, LOCAL_DIGG);
}
/**
* 保存喜欢关注
* @param mContext
* @param ser
*/
public static void wirteLikeSerialization(Context mContext,Serializable ser){
saveObject(mContext, ser, LOCAL_LIKE);
}
/**
* 读取本地喜欢列表
* @param mContext
* @return
*/
@SuppressWarnings("unchecked")
public static ArrayList<String> readLikeSerialization(Context mContext){
return (ArrayList<String>)readObject(mContext, LOCAL_LIKE);
}
/**
* 清除本地喜欢列表
* @param context
*/
public static void removeLocalLike(Context context){
removeLocalDataSerialization(context, LOCAL_LIKE);
}
/**
* 清除本地数据
* @param mContext
* @param type
*/
private static void removeLocalDataSerialization(Context mContext,String type){
File data = mContext.getFileStreamPath(type);
if (data.exists()){
data.delete();
}
}
// public static void wirteUserSerialization(Context mContext,Serializable ser){
// saveObject(mContext, ser, USER);
// }
//
// public static UserInfo readUserSerialization(Context mContext){
// return (UserInfo)readObject(mContext, USER);
// }
//
// public static void removeUserSerialization(Context mContext){
// File data = mContext.getFileStreamPath(USER);
// if (data.exists()){
// data.delete();
// }
// }
// public static void writeHomeRoomListSerialization(Context mContext,Serializable ser){
// saveObject(mContext, ser, HOMEROOMLIST);
// }
//
// public static Serializable readHomeRoomListSerialization(Context mContext){
// return readObject(mContext, HOMEROOMLIST);
// }
// /**
// * 保存本地化授权信息
// * @param mContext
// * @param ser
// * @param type
// */
// public static void wirteSNSInfoSerialization(Context mContext,Serializable ser,String type){
// saveObject(mContext, ser, type);
// }
//
// /**
// * 读取本地化授权信息
// * @param mContext
// * @param type
// * @return
// */
// public static SNSUserInfo readSNSInfoSerialization(Context mContext,String type){
// return (SNSUserInfo)readObject(mContext, type);
// }
//
// /**
// * 清除本地化授权信息
// * @param mContext
// * @param type
// */
// public static void removeSNSInfoSerialization(Context mContext,String type){
// File data = mContext.getFileStreamPath(type);
// if (data.exists()){
// data.delete();
// }
// }
//
// /**
// * 序列化历史登陆记录
// * @param mContext
// * @param userList
// * @param type
// */
// public static void wirteUserListSerialization(Context mContext,ArrayList<String> userList,String type){
// saveObject(mContext, userList, type);
// }
//
// /**
// * 反序列化历史登陆记录
// * @param mContext
// * @param type
// * @return
// */
// @SuppressWarnings("unchecked")
// public static ArrayList<String> readUserListSerialization(Context mContext,String type){
// return(ArrayList<String>)readObject(mContext, type);
// }
//
// /**
// * 清除本地化登陆历史记录
// * @param mContext
// * @param type
// */
// public static void removeUserListSerialization(Context mContext,String type){
// File data = mContext.getFileStreamPath(type);
// if (data.exists()){
// data.delete();
// }
// }
/**
* 判断缓存是否存在
* @param cachefile
* @return
*/
public static boolean isExistDataCache(Context mContext, String cachefile)
{
boolean exist = false;
File data = mContext.getFileStreamPath(cachefile);
if(data.exists())
exist = true;
return exist;
}
/**
* 读取对象
* @param file
* @return
* @throws IOException
*/
private static Serializable readObject(Context mContext, String file){
if(!isExistDataCache(mContext, file))
return null;
FileInputStream fis = null;
ObjectInputStream ois = null;
try{
fis = mContext.openFileInput(file);
ois = new ObjectInputStream(fis);
return (Serializable)ois.readObject();
}catch(FileNotFoundException e){
}catch(Exception e){
e.printStackTrace();
//反序列化失败 - 删除缓存文件
if(e instanceof InvalidClassException){
File data = mContext.getFileStreamPath(file);
data.delete();
}
}finally{
try {
ois.close();
} catch (Exception e) {}
try {
fis.close();
} catch (Exception e) {}
}
return null;
}
/**
* 保存对象
* @param ser
* @param file
* @throws IOException
*/
private static boolean saveObject(Context mContext, Serializable ser, String file) {
FileOutputStream fos = null;
ObjectOutputStream oos = null;
try{
fos = mContext.openFileOutput(file, Context.MODE_PRIVATE);
oos = new ObjectOutputStream(fos);
oos.writeObject(ser);
oos.flush();
return true;
}catch(Exception e){
e.printStackTrace();
return false;
}finally{
try {
oos.close();
} catch (Exception e) {}
try {
fos.close();
} catch (Exception e) {}
}
}
}
| [
"admin@xxc.local"
] | admin@xxc.local |
cd71716b370eaf2c84692c84f69f457ff2837cf9 | 27a13543c5a21811e696278b5212755ecdebca53 | /hsco/src/main/java/hsco/mis/hrm/HRM070112/HRM070112Service.java | f48cc0a277ad255039d8d9f5fe93f45a68075773 | [] | no_license | chaseDeveloper/hsco | 9dad73c971500c4bd98adfefa3e91a91d26ca318 | 7052d6da3ac772cd3b13ec391818139355935916 | refs/heads/master | 2023-06-15T23:55:10.592683 | 2021-07-06T07:46:07 | 2021-07-06T07:46:07 | 383,377,343 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 791 | java | package hsco.mis.hrm.HRM070112;
/**
* <pre>
* @Project Name : 화성도시공사 차세대정보시스템
* @Class Name : HRM070112Service.java
* @Description :
* @author : 김형태
* @since : 2015. 12. 03.
* @version : 1.0
* @see :
* @COPYRIGHT (c) 2015 나눔아이씨티, Inc. All Right Reserved.
* <pre>
* ------------------------------------------------------------------
* Modification Information
* ------------------------------------------------------------------
* 작성일 작성자 내용
* ------------------------------------------------------------------
* 2015. 12. 03. 김형태 최초생성
* </pre>
*/
public interface HRM070112Service {
}
| [
"kdk@ichase.co.kr"
] | kdk@ichase.co.kr |
84bd2bbce41fa92d1b021acbb1a77b40f3ad42ca | 599eef4743e47c91aff53dcf38680c88f72f89dc | /src/test/java/com/github/tomakehurst/wiremock/EditMappingAcceptanceTest.java | 6e5c017ef0c7239321ae4db91b9cbd90d815628a | [
"Apache-2.0"
] | permissive | spirion/wiremock | 008bca23916cf067dd7f84c151a82b11d2fd98a1 | b94d8d76c0f493b05bbd241d9de4af80c96a766a | refs/heads/master | 2021-01-13T05:15:36.080778 | 2016-08-05T07:15:11 | 2016-08-05T07:15:11 | 64,217,341 | 0 | 0 | null | 2016-07-26T11:52:14 | 2016-07-26T11:52:14 | null | UTF-8 | Java | false | false | 2,054 | java | package com.github.tomakehurst.wiremock;
import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class EditMappingAcceptanceTest extends AcceptanceTestBase {
public static final String MAPPING_REQUEST_WITH_UUID =
"{ " +
" \"uuid\":\"bff18359-a74e-4c3e-95f0-dab304cd3a5a\", \n" +
" \"request\": { \n" +
" \"method\": \"GET\", \n" +
" \"url\": \"/a/registered/resource\" \n" +
" }, \n" +
" \"response\": { \n" +
" \"status\": 401, \n" +
" \"headers\": { \n" +
" \"Content-Type\": \"text/plain\" \n" +
" }, \n" +
" \"body\": \"Not allowed!\" \n" +
" } \n" +
"} ";
public static final String MODIFY_MAPPING_REQUEST_WITH_UUID =
"{ " +
" \"uuid\":\"bff18359-a74e-4c3e-95f0-dab304cd3a5a\", \n" +
" \"request\": { \n" +
" \"method\": \"GET\", \n" +
" \"url\": \"/a/registered/resource\" \n" +
" }, \n" +
" \"response\": { \n" +
" \"status\": 200, \n" +
" \"headers\": { \n" +
" \"Content-Type\": \"text/html\" \n" +
" }, \n" +
" \"body\": \"OK\" \n" +
" } \n" +
"} ";
@Test
public void editMappingWithExactUrlAndMethodMatchIsCreatedAndReturned() {
testClient.addResponse(MAPPING_REQUEST_WITH_UUID);
WireMockResponse response = testClient.get("/a/registered/resource");
assertThat(response.statusCode(), is(401));
assertThat(response.content(), is("Not allowed!"));
assertThat(response.firstHeader("Content-Type"), is("text/plain"));
testClient.editMapping(MODIFY_MAPPING_REQUEST_WITH_UUID);
response = testClient.get("/a/registered/resource");
assertThat(response.statusCode(), is(200));
assertThat(response.content(), is("OK"));
assertThat(response.firstHeader("Content-Type"), is("text/html"));
}
}
| [
"t.m.akehurst@googlemail.com"
] | t.m.akehurst@googlemail.com |
d94a5e742e4778d1eb81585f80fd736fc6ed72ad | f66d1752c6cbd2731b55f7f8717615ad1b8df2bd | /Java17XML/src/com/lanou/practice/SAXParseHandler.java | b217ff3a153d984dd3bd35012adae6e5499fc342 | [] | no_license | leizhaojiang/java1106-mater | 6c98afa6c84b1187077da30e776323120b1f53c7 | 012582802f25bcd5fa3ba78bd51443701494134e | refs/heads/master | 2022-12-06T11:49:13.698891 | 2020-07-02T01:06:50 | 2020-07-02T01:06:50 | 217,801,345 | 0 | 0 | null | 2022-11-24T10:01:28 | 2019-10-27T03:43:06 | JavaScript | GB18030 | Java | false | false | 1,919 | java | package com.lanou.practice;
import java.util.ArrayList;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class SAXParseHandler extends DefaultHandler{
int bookindex = 0;
Book book = null;
String value = null;
ArrayList<Book> books = new ArrayList<Book>();
@Override
public void startDocument() throws SAXException {
// TODO Auto-generated method stub
super.startDocument();
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
// TODO Auto-generated method stub
super.startElement(uri, localName, qName, attributes);
if (qName.equals("book")) {
book = new Book();
bookindex++;
System.out.println("开始遍历第 " + bookindex + " 本书");
}
for (int i = 0; i < attributes.getLength(); i++) {
System.out.println("属性名 : " + attributes.getQName(i) +
" 属性值 : " + attributes.getValue(i));
}
}
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
// TODO Auto-generated method stub
super.characters(ch, start, length);
value = new String(ch, start, length);
if (!value.trim().equals("")) {
System.out.println(value);
}
}
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
// TODO Auto-generated method stub
super.endElement(uri, localName, qName);
switch (qName) {
case "name":
book.setName(value);
break;
case "date":
book.setDate(value);
break;
case "price":
book.setPrice(value);
break;
case "author":
book.setAuthor(value);
break;
case "language":
book.setLanguage(value);
break;
case "book":
books.add(book);
default:
break;
}
}
@Override
public void endDocument() throws SAXException {
// TODO Auto-generated method stub
super.endDocument();
}
}
| [
"leizhaojiang@163.com"
] | leizhaojiang@163.com |
b6bf7081b8f92ee0ab34e09b5c89ffa525c3a708 | 6a6ba9c31d2a53383be3094914f438c4fe06d60d | /src/main/java/com/command/parser/impl/ShowParser.java | d0f74a385f3c75f958871caff14e1f883ea3c718 | [] | no_license | glj381413362/Exam-12790-20161229-1 | 877bccc70bcfc8f7043c71c2db6a49a49f725071 | a029f1eebc559d0b8ac29724ed74075af1501038 | refs/heads/master | 2021-01-12T04:22:31.560692 | 2017-01-05T03:20:02 | 2017-01-05T03:20:02 | 77,597,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | package com.command.parser.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Component;
import com.MainApp;
import com.command.Command;
import com.command.parser.Parser;
import com.utils.ReadPropertiesUtils;
@Component
public class ShowParser implements Parser{
private static final List< String> list;
static{
list = new ArrayList<String>();
Map<String, String> argsMap = ReadPropertiesUtils.loadToMap("src/main/java/argsCommand.properties");
String showStr = argsMap.get("show");//-like<start end>,-like,<start end>,-id
String[] arr = null;
if(showStr.contains(",")){
arr = showStr.split(",");
for(String str : arr){
list.add(str);
}
}else {
list.add(showStr);
}
}
@Override
public boolean isRightOption(Map<String,String> argsMap) {
boolean res = false;
if(argsMap.size()==0)
{
res =true;
}else{
Iterator<String> iterator = argsMap.keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
if(list.contains(key)){
res =true;
}
}
}
return res;
}
@Override
public Command parse(String cmdName) {
//获得Command
return (Command) MainApp.getaContext().getBean(cmdName);
}
}
| [
"381413362@qq.com"
] | 381413362@qq.com |
1524ae3f291e73ce28cedcabd9ac87d058c07fed | cca87c4ade972a682c9bf0663ffdf21232c9b857 | /com/tencent/mm/plugin/sns/ui/g.java | f10499dc06fc6c1751c2caf9118bb633a362eeaa | [] | no_license | ZoranLi/wechat_reversing | b246d43f7c2d7beb00a339e2f825fcb127e0d1a1 | 36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a | refs/heads/master | 2021-07-05T01:17:20.533427 | 2017-09-25T09:07:33 | 2017-09-25T09:07:33 | 104,726,592 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,923 | java | package com.tencent.mm.plugin.sns.ui;
import com.tencent.mm.modelsfs.FileOp;
import com.tencent.mm.protocal.c.aeg;
import com.tencent.mm.protocal.c.alh;
import com.tencent.mm.protocal.c.cc;
import com.tencent.mm.protocal.c.dl;
import com.tencent.mm.sdk.platformtools.w;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public final class g extends d<alh> {
private List<alh> fRK = new ArrayList();
private String naR = "";
private String path = "";
private int qoX = 0;
private int qoY = 0;
private dl qpo;
private cc qpp;
private a qpq;
public interface a {
void a(List<alh> list, Map<Integer, Integer> map, Map<Integer, Integer> map2, int i, int i2, dl dlVar);
void bib();
}
public g(a aVar) {
this.qpq = aVar;
}
public final void by(List<alh> list) {
if (this.qpq == null) {
return;
}
if (list != null) {
Map hashMap = new HashMap();
Map hashMap2 = new HashMap();
hashMap.clear();
hashMap2.clear();
int size = list.size();
w.d("MicroMsg.ArtistAdapterHelper", "initFixType " + size);
int i = 0;
int i2 = 0;
int i3;
for (int i4 = 0; i4 < size; i4 = i3 + i4) {
String str = ((alh) list.get(i4)).msk;
i3 = i4 + 1 < size ? !str.equals(((alh) list.get(i4 + 1)).msk) ? 1 : i4 + 2 < size ? !str.equals(((alh) list.get(i4 + 2)).msk) ? 2 : 3 : 2 : 1;
hashMap.put(Integer.valueOf(i), Integer.valueOf(i2));
hashMap2.put(Integer.valueOf(i), Integer.valueOf(i3));
i2 += i3;
i++;
}
this.qoX = i + 1;
this.qoY = list.size();
w.d("MicroMsg.ArtistAdapterHelper", "icount " + this.qoX);
this.fRK = list;
this.qpq.a(this.fRK, hashMap, hashMap2, this.qoY, this.qoX, this.qpo);
return;
}
this.qpq.bib();
}
public final List<alh> bia() {
List<alh> arrayList = new ArrayList();
try {
arrayList.clear();
this.qpp = null;
String str = this.path + this.naR + "_ARTISTF.mm";
if (FileOp.aO(str)) {
this.qpp = (cc) new cc().aD(FileOp.c(str, 0, -1));
}
if (this.qpp == null) {
String str2 = this.path + this.naR + "_ARTIST.mm";
this.qpp = com.tencent.mm.plugin.sns.g.a.FP(new String(FileOp.c(str2, 0, (int) FileOp.ki(str2))));
if (this.qpp == null) {
FileOp.deleteFile(str2);
return null;
}
FileOp.deleteFile(str);
FileOp.k(str, this.qpp.toByteArray());
}
if (this.qpp == null) {
return null;
}
Iterator it = this.qpp.tfz.iterator();
while (it.hasNext()) {
aeg com_tencent_mm_protocal_c_aeg = (aeg) it.next();
String str3 = com_tencent_mm_protocal_c_aeg.msj;
Iterator it2 = com_tencent_mm_protocal_c_aeg.tsO.iterator();
while (it2.hasNext()) {
alh com_tencent_mm_protocal_c_alh = (alh) it2.next();
com_tencent_mm_protocal_c_alh.msk = str3;
arrayList.add(com_tencent_mm_protocal_c_alh);
}
}
this.qpo = this.qpp.tfy;
return arrayList;
} catch (Throwable e) {
w.printErrStackTrace("MicroMsg.ArtistAdapterHelper", e, "loadData failed.", new Object[0]);
return null;
}
}
public final void dE(String str, String str2) {
this.naR = str;
this.path = str2;
fu(true);
}
}
| [
"lizhangliao@xiaohongchun.com"
] | lizhangliao@xiaohongchun.com |
0abdb173cfbe5cd23edc094bd0885dae5b7396cb | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project485/src/test/java/org/gradle/test/performance/largejavamultiproject/project485/p2428/Test48569.java | b36855c5acc3782c5622808a5c12e35ec2841144 | [] | 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 | 2,182 | java | package org.gradle.test.performance.largejavamultiproject.project485.p2428;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test48569 {
Production48569 objectUnderTest = new Production48569();
@Test
public void testProperty0() {
Production48566 value = new Production48566();
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
Production48567 value = new Production48567();
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
Production48568 value = new Production48568();
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
919e72b3f4bc7103a46c7b46f4240e9de61c3038 | 47ea37f56c712cd3f7f3063ce817d640cc76d1c7 | /umlModels/src/model/package1/util/Package1AdapterFactory.java | 2197745f28f17c012b98fba90f463824bcece3ea | [] | no_license | Xilaew/uml-activity-testcasegenerator | c194e0f93d8ff6e92e04582bee39f9dce1d7f5fb | 33b1833aaa70ebd2d05d2cf9fa2dc545129ea025 | refs/heads/master | 2020-05-18T06:51:19.024164 | 2014-07-08T23:31:13 | 2014-07-08T23:31:13 | 38,853,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,596 | java | /**
*/
package model.package1.util;
import model.package1.*;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
* @see model.package1.Package1Package
* @generated
*/
public class Package1AdapterFactory extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected static Package1Package modelPackage;
/**
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Package1AdapterFactory() {
if (modelPackage == null) {
modelPackage = Package1Package.eINSTANCE;
}
}
/**
* Returns whether this factory is applicable for the type of the object.
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@Override
public boolean isFactoryForType(Object object) {
if (object == modelPackage) {
return true;
}
if (object instanceof EObject) {
return ((EObject)object).eClass().getEPackage() == modelPackage;
}
return false;
}
/**
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Package1Switch<Adapter> modelSwitch =
new Package1Switch<Adapter>() {
@Override
public Adapter caseclass1(class1 object) {
return createclass1Adapter();
}
@Override
public Adapter casetype1(type1 object) {
return createtype1Adapter();
}
@Override
public Adapter caseclass1_testActivity(class1_testActivity object) {
return createclass1_testActivityAdapter();
}
@Override
public Adapter caseclass2(class2 object) {
return createclass2Adapter();
}
@Override
public Adapter casetype2(type2 object) {
return createtype2Adapter();
}
@Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
};
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param target the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
return modelSwitch.doSwitch((EObject)target);
}
/**
* Creates a new adapter for an object of class '{@link model.package1.class1 <em>class1</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see model.package1.class1
* @generated
*/
public Adapter createclass1Adapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link model.package1.type1 <em>type1</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see model.package1.type1
* @generated
*/
public Adapter createtype1Adapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link model.package1.class1_testActivity <em>class1 test Activity</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see model.package1.class1_testActivity
* @generated
*/
public Adapter createclass1_testActivityAdapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link model.package1.class2 <em>class2</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see model.package1.class2
* @generated
*/
public Adapter createclass2Adapter() {
return null;
}
/**
* Creates a new adapter for an object of class '{@link model.package1.type2 <em>type2</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see model.package1.type2
* @generated
*/
public Adapter createtype2Adapter() {
return null;
}
/**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter() {
return null;
}
} //Package1AdapterFactory
| [
"xilaew@gmail.com"
] | xilaew@gmail.com |
5cf4b75d58e69b17f610a391af9030367a61648e | ceeea83e2553c0ffef73bb8d3dc784477e066531 | /e-ResourceOrginal/src/java/com/svs/erp/Hr/BO/prorated.java | 8e646a29ad3bb7136e66eb0a00e06c5c1ec6d9a5 | [
"Apache-2.0"
] | permissive | anupammaiti/ERP | 99bf67f9335a2fea96e525a82866810875bc8695 | 8c124deb41c4945c7cd55cc331b021eae4100c62 | refs/heads/master | 2020-08-13T19:30:59.922232 | 2019-10-09T17:04:58 | 2019-10-09T17:04:58 | 215,025,440 | 1 | 0 | Apache-2.0 | 2019-10-14T11:26:11 | 2019-10-14T11:26:10 | null | UTF-8 | Java | false | false | 6,294 | java | package com.svs.erp.Hr.BO;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.log4j.Logger;
import com.svs.erp.Hr.db.ConnectionUtils;
import com.svs.util.ConvertStackTracetoString;
import java.text.SimpleDateFormat;
public class prorated extends HttpServlet
{
private static Logger logger =Logger.getLogger(Loadtomysqltrans.class);
ConvertStackTracetoString util_stacktrace=new ConvertStackTracetoString();
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException
{
//PropertyConfigurator.configure("log4j.properties");
PrintWriter pw=response.getWriter();
// String s="";
Connection con=null;
ConnectionUtils connectionUtils=new ConnectionUtils();
PreparedStatement pr=null,pr1=null,pr2=null,pr3=null;
ResultSet rs=null,rs1=null,rs2=null,rs3=null;
double cl=0,cl1=0,cl2=0,fcl=0;
double sl=0,sl1=0,sl2=0,fsl=0;
double pl=0,pl1=0,pl2=0,fpl=0;
HttpSession session=request.getSession();
String pro="Please follow pro-rata method";
String empid=request.getParameter("empid");
String jod=null;
//////System.out.println("EMP ID in....Prorated......"+empid);
try{
//Class.forName("com.mysql.jdbc.Driver");
//con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+"hrerp", "root", "root");
con=connectionUtils.getDBConnection();
//~~~code to get joining date from employeeeee~~~~~~~~
pr=con.prepareStatement("select joiningdate from employee where empno=?");
pr.setString(1,empid);
rs=pr.executeQuery();
while(rs.next())
{
jod=rs.getString(1);
//////System.out.println("JOD in....Prorated......"+jod);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~code to get system current date and month
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
String curdate = formatter.format(currentDate.getTime());
String curmonth=null;
PreparedStatement pcmonth=con.prepareStatement("select monthname(?) from dual;");
pcmonth.setString(1,curdate);
ResultSet rcmonth=pcmonth.executeQuery();
while(rcmonth.next())
{
curmonth=rcmonth.getString(1);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
//////////////String splitting for first date
String array[]=jod.split("-");
String val1=array[0].trim();
int val11=Integer.parseInt(val1);
////////System.out.println(val11);
String val2=array[1].trim();
int val12=Integer.parseInt(val2);
////////System.out.println(val12);
String val3=array[2].trim();
int val13=Integer.parseInt(val3);
////////System.out.println("END OF FIRST DATE"+val13);
////////System.out.println("FD"+val11+val12+val13);
///////////////////////////////////////////
//////////////String splitting for last date
String arr[]=curdate.split("-");
String val4=arr[0].trim();
int val14=Integer.parseInt(val4);
////////System.out.println(val14);
String val5=arr[1].trim();
int val15=Integer.parseInt(val5);
////////System.out.println(val15);
String val6=arr[2].trim();
int val16=Integer.parseInt(val6);
////////System.out.println("END OF LAST DATE"+val16);
////////System.out.println("FD"+val14+val15+val16);
cal1.set(val11, val12, val13);
cal2.set(val14, val15, val16);
long milis1 = cal1.getTimeInMillis();
long milis2 = cal2.getTimeInMillis();
long diff = milis2 - milis1;
long diffDays = diff / (24 * 60 * 60 * 1000);
int findiff=(int)diffDays+1;
int prodays=365-findiff;
if(prodays>=0)
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~find cl in currentmonth~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pr1=con.prepareStatement("select sum(cl) from leaveapplications where empid=? and monthname(fromdate)=?");
pr1.setString(1,empid);
pr1.setString(2,curmonth);
rs1=pr1.executeQuery();
while(rs1.next())
{
cl=rs1.getDouble(1);
}//while]
if(cl>=1)
{
fcl=0;
}
else if(cl==0.5)
{
fcl=0.5;
}
else
{
fcl=1;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code ends here for CL
if((prodays<=182)&&(prodays>=0)) // apply after 6 months(182==6months)
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~find sl in currentmonth~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pr2=con.prepareStatement("select sum(sl) from leaveapplications where empid=? and monthname(fromdate)=?");
pr2.setString(1,empid);
pr2.setString(2,curmonth);
rs2=pr2.executeQuery();
while(rs2.next())
{
sl=rs2.getDouble(1);
}//while]
if(sl>=0.5)
{
fsl=0;
}
else
{
fsl=0.5;
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code ends here for SL
/*if(prodays<=0) // apply after 1yr(365==1 yr)
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~find pl in currentmonth~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pr3=con.prepareStatement("select sum(pl) from leaveapplications where empid=? and monthname(fromdate)=?");
pr3.setString(1,empid);
pr3.setString(2,curmonth);
rs3=pr3.executeQuery();
while(pr3.next())
{
pl=rs3.getDouble(1);
}//while]
if(pl>=1.5)
{
fpl=0;
}
else if(pl==0.5)
{
fpl=1;
}
else if(pl==1)
{
fpl=0.5;
}
else
{
fpl=1.5;
}*/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~code ends here for CL
}//if prodays>=0
else
{
pro="Pro-rata period completed";
}
}//try
catch(Exception e){
logger.error(util_stacktrace.sendingErrorAsString(e));
}
finally {
try
{
if (con != null) connectionUtils.setDBClose();
} catch (SQLException e)
{
logger.error(util_stacktrace.sendingErrorAsString(e));
}
}
//request.setAttribute("msg1",stname);
HttpSession se=request.getSession(true);
//se.setAttribute("msg1",stname);
//RequestDispatcher dispatcher = request.getRequestDispatcher("/loadtomysqlinout.jsp");
//dispatcher.forward(request, response);
response.sendRedirect("leaveauthentication.jsp?empid="+empid+"&fcl="+fcl+"&fsl="+fsl+"&fpl="+fpl+"&pro="+pro+"");
//pw.println("<font color=#EF6216 face=verdana size=2> <font color=#900F8E face=verdana size=2>"+stname+"</font>");
}
}
| [
"rrkravikiranrrk@gmail.com"
] | rrkravikiranrrk@gmail.com |
e5ad88e630722041257421df4f54ec5d3fe6db6c | ecec63abce09bdf2dc9ffbf8007ae1a8508612e7 | /app/src/main/java/app/zingo/merabihars/CustomViews/CustomAutoComplete.java | ba90157c40a8f9f442539d54f5f6b43846adce11 | [] | no_license | Dummyurl/MeraBihar | b532130e8a5e9c53f144f985879ade64b94af590 | 6eb8be4a16e4786a321f383e5be511bfda711f5e | refs/heads/master | 2020-04-08T10:41:14.203032 | 2018-10-29T13:27:54 | 2018-10-29T13:27:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package app.zingo.merabihars.CustomViews;
import android.content.Context;
import android.util.AttributeSet;
/**
* Created by ZingoHotels Tech on 23-10-2018.
*/
public class CustomAutoComplete extends android.support.v7.widget.AppCompatAutoCompleteTextView {
public CustomAutoComplete(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public CustomAutoComplete(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public CustomAutoComplete(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
// this is how to disable AutoCompleteTextView filter
@Override
protected void performFiltering(final CharSequence text, final int keyCode) {
String filterText = "";
super.performFiltering(filterText, keyCode);
}
}
| [
"nishar@zingohotels.com"
] | nishar@zingohotels.com |
5bedb697bc4aff1a9302325645edfeb979cfa97b | 4472796266749a7f2e031274041ea583a50de121 | /java/arrays/leetcode/count_special_quadruplets.java | a6bc711e9eec5b2d53ba3a6b651409b2f64950c9 | [] | no_license | vetkolisanket/ds_algo | 879324430c97732a0aa31678138b9f9c88803e79 | 7c6e4c82a75ba19eafc57f0765b048b198a9ece9 | refs/heads/master | 2023-09-03T11:15:01.902084 | 2023-09-03T10:02:06 | 2023-09-03T10:02:06 | 250,981,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,870 | java | /*
1995. Count Special Quadruplets
Given a 0-indexed integer array nums, return the number of distinct quadruplets (a, b, c, d) such that:
nums[a] + nums[b] + nums[c] == nums[d], and
a < b < c < d
Example 1:
Input: nums = [1,2,3,6]
Output: 1
Explanation: The only quadruplet that satisfies the requirement is (0, 1, 2, 3) because 1 + 2 + 3 == 6.
Example 2:
Input: nums = [3,3,6,4,5]
Output: 0
Explanation: There are no such quadruplets in [3,3,6,4,5].
Example 3:
Input: nums = [1,1,1,3,5]
Output: 4
Explanation: The 4 quadruplets that satisfy the requirement are:
- (0, 1, 2, 3): 1 + 1 + 1 == 3
- (0, 1, 3, 4): 1 + 1 + 3 == 5
- (0, 2, 3, 4): 1 + 1 + 3 == 5
- (1, 2, 3, 4): 1 + 1 + 3 == 5
Constraints:
4 <= nums.length <= 50
1 <= nums[i] <= 100
*/
//O(n^2) soln
class Solution {
public int countQuadruplets(int[] nums) {
int count = 0;
int n = nums.length;
Map<Integer, Integer> map = new HashMap();
map.put(nums[n-1] - nums[n-2], 1);
for (int i=n-3;i>=1;i--) {
for (int j=i-1;j>=0;j--) {
count += map.getOrDefault(nums[j] + nums[i], 0);
}
for (int j=n-1;j>i;j--) {
map.put(nums[j] - nums[i], map.getOrDefault(nums[j] - nums[i], 0) + 1);
}
}
return count;
}
}
//My O(n^4) soln
class Solution {
public int countQuadruplets(int[] nums) {
int count = 0;
int n = nums.length;
for (int i=0;i<n;i++) {
for (int j=i+1;j<n;j++) {
for (int k=j+1;k<n;k++) {
for (int l=k+1;l<n;l++) {
if (nums[i]+nums[j]+nums[k] == nums[l]) {
count++;
}
}
}
}
}
return count;
}
}
| [
"sanket.vetkoli@agrostar.in"
] | sanket.vetkoli@agrostar.in |
3767de5f96b6a89cffa8680a26069abd9dc84966 | 92fdcc1a6b5e18a52ae5153b72aa83d5428840cb | /core/src/main/java/org/infinispan/protostream/Version.java | dae9e307661e55d2d66c49199b312c68af700e92 | [
"Apache-2.0",
"LicenseRef-scancode-protobuf"
] | permissive | infinispan/protostream | 6332aa56b2dfe03f0186b29667911c29da14167f | daecb41b7f26acfdbff716f04d633d0f422b1e97 | refs/heads/main | 2023-08-31T23:49:10.725739 | 2023-08-29T18:30:08 | 2023-08-29T18:30:08 | 11,369,509 | 35 | 28 | Apache-2.0 | 2023-09-13T09:41:51 | 2013-07-12T13:39:36 | Java | UTF-8 | Java | false | false | 3,327 | java | package org.infinispan.protostream;
import java.util.Objects;
/**
* Provides version information about this ProtoStream release.
*
* @author anistor@redhat.com
* @since 4.2
*/
public final class Version implements Comparable<Version> {
private static final Version VERSION = getVersion(Version.class);
/**
* Try to obtain the version from the manifest.
*/
public static Version getVersion(Class<?> clazz) {
String version = clazz.getPackage().getImplementationVersion();
if (version != null) {
try {
String[] versionParts = version.split("[.\\-]");
int major = Integer.parseInt(versionParts[0]);
int minor = versionParts.length > 1 ? Integer.parseInt(versionParts[1]) : 0;
int micro = versionParts.length > 2 ? Integer.parseInt(versionParts[2]) : 0;
String suffix = versionParts.length > 3 ? versionParts[3] : null;
return new Version(major, minor, micro, suffix);
} catch (Exception e) {
// ignore
}
}
return new Version(0, 0, 0, "UNKNOWN");
}
public static Version getVersion() {
return VERSION;
}
public static void main(String[] args) {
System.out.println("ProtoStream version " + getVersion());
}
private final int major;
private final int minor;
private final int micro;
private final String suffix;
private final String versionString;
public Version(int major, int minor, int micro) {
this(major, minor, micro, null);
}
public Version(int major, int minor, int micro, String suffix) {
this.major = major;
this.minor = minor;
this.micro = micro;
this.suffix = suffix;
if (suffix == null) {
suffix = "";
} else if ("SNAPSHOT".equals(suffix)) {
suffix = "-SNAPSHOT";
} else {
suffix = '.' + suffix;
}
versionString = major + "." + minor + "." + micro + suffix;
}
public int getMajor() {
return major;
}
public int getMinor() {
return minor;
}
public int getMicro() {
return micro;
}
public String getSuffix() {
return suffix;
}
@Override
public String toString() {
return versionString;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj == null || obj.getClass() != getClass()) {
return false;
}
Version other = (Version) obj;
return other.major == major && other.minor == minor && other.micro == micro && Objects.equals(suffix, other.suffix);
}
@Override
public int hashCode() {
return 31 * (31 * (31 * major + minor) + micro) + (suffix != null ? suffix.hashCode() : 0);
}
@Override
public int compareTo(Version other) {
if (this == other) {
return 0;
}
int d = major - other.major;
if (d == 0) {
d = minor - other.minor;
if (d == 0) {
d = micro - other.micro;
if (d == 0) {
if (suffix == null) {
d = other.suffix == null ? 0 : -1;
} else {
d = other.suffix == null ? 1 : suffix.compareTo(other.suffix);
}
}
}
}
return d;
}
}
| [
"anistor@redhat.com"
] | anistor@redhat.com |
48a4cdf9f10e742929516ee7b14dce385e1a4258 | b21d13e05d144bf46e3b0f764378fc12d6bf55e6 | /core/common/src/main/java/hera/api/model/Payload.java | f7c5a1322af61b0de6541b36de04560c309e7751 | [
"MIT"
] | permissive | aergoio/heraj | 557ffda977598be6bc2fc613f9dd5a9d8860d9ce | 7a3b3d5a54d654235419b44a6c64b7ee2d2ce5f4 | refs/heads/develop | 2022-09-23T07:24:53.788548 | 2022-06-16T02:17:19 | 2022-06-19T12:34:21 | 142,944,814 | 23 | 8 | MIT | 2023-09-04T09:39:29 | 2018-07-31T01:10:55 | Java | UTF-8 | Java | false | false | 341 | java | /*
* @copyright defined in LICENSE.txt
*/
package hera.api.model;
import hera.annotation.ApiAudience;
import hera.annotation.ApiStability;
/**
* An marker interface to represent it can be used as payload to represent some information.
*
* @author taeiklim
*/
@ApiAudience.Public
@ApiStability.Unstable
public interface Payload {
}
| [
"sibera21@gmail.com"
] | sibera21@gmail.com |
6202249538f162c14db3aeceacea6b0cb0bdb16c | 0622dc7e0789f46762036232550aea1c54e87358 | /xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/VelocityExecutionContextInitializer.java | c26144db11791c36953ddb50a1d0285a8d14743b | [] | no_license | arunreddy/xwiki-commons | 2841ac9da356c2158c6c64b92426980736670c70 | 32b6254299145e90ac936d24aa1477cac1ebce94 | refs/heads/master | 2021-01-18T06:39:58.840997 | 2012-05-16T14:40:42 | 2012-05-16T14:42:54 | 3,798,318 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,619 | java | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.velocity.internal;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.velocity.VelocityContext;
import org.xwiki.component.annotation.Component;
import org.xwiki.context.ExecutionContext;
import org.xwiki.context.ExecutionContextInitializer;
import org.xwiki.context.ExecutionContextException;
import org.xwiki.velocity.VelocityContextFactory;
import org.xwiki.velocity.XWikiVelocityException;
/**
* Allow registering the Velocity Context in the Execution Context object since it's shared during the whole execution
* of the current request.
*
* @see org.xwiki.context.ExecutionContextInitializer
* @since 1.5M1
* @version $Id$
*/
@Component
@Named("velocity")
@Singleton
public class VelocityExecutionContextInitializer implements ExecutionContextInitializer
{
/**
* The id under which the Velocity Context is stored in the Execution Context.
*/
public static final String VELOCITY_CONTEXT_ID = "velocityContext";
/**
* The Velocity context factory component used for creating the Velocity Context (injected automatically by the
* Component subsystem).
*/
@Inject
private VelocityContextFactory velocityContextFactory;
@Override
public void initialize(ExecutionContext executionContext) throws ExecutionContextException
{
try {
VelocityContext context = this.velocityContextFactory.createContext();
executionContext.setProperty(VelocityExecutionContextInitializer.VELOCITY_CONTEXT_ID, context);
} catch (XWikiVelocityException e) {
throw new ExecutionContextException("Failed to initialize Velocity Context", e);
}
}
}
| [
"vincent@massol.net"
] | vincent@massol.net |
21a9e7286def9b97b71f512778e3a70ff93ccd99 | c5488473c8114647c12b835cd7b36e1dfb4c95a9 | /Mobile App/Code/sources/com/android/volley/toolbox/JsonArrayRequest.java | 1f5eab702d826678a40f1cef800c836d4ea78c2d | [
"MIT"
] | permissive | shivi98g/EpilNet-EpilepsyPredictor | 5cf86835473112f98c130bb066edba4cf8fa3f20 | 15a98fb9ac7ee535005fb2aebb36548f28c7f6d1 | refs/heads/main | 2023-08-04T09:43:24.941854 | 2021-09-24T12:25:42 | 2021-09-24T12:25:42 | 389,867,899 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,434 | java | package com.android.volley.toolbox;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Response;
import java.io.UnsupportedEncodingException;
import org.json.JSONArray;
import org.json.JSONException;
public class JsonArrayRequest extends JsonRequest<JSONArray> {
public JsonArrayRequest(String url, Response.Listener<JSONArray> listener, Response.ErrorListener errorListener) {
super(0, url, (String) null, listener, errorListener);
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public JsonArrayRequest(int method, String url, JSONArray jsonRequest, Response.Listener<JSONArray> listener, Response.ErrorListener errorListener) {
super(method, url, jsonRequest == null ? null : jsonRequest.toString(), listener, errorListener);
}
/* access modifiers changed from: protected */
public Response<JSONArray> parseNetworkResponse(NetworkResponse response) {
try {
return Response.success(new JSONArray(new String(response.data, HttpHeaderParser.parseCharset(response.headers, "utf-8"))), HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError((Throwable) e));
} catch (JSONException je) {
return Response.error(new ParseError((Throwable) je));
}
}
}
| [
"31238277+shivi98g@users.noreply.github.com"
] | 31238277+shivi98g@users.noreply.github.com |
debfcb1d3109a2b6abdc546cab820ad26c57eb24 | 010c576e1b973e4d7cc34a01b3446488498b89d3 | /projects-parent/archetypes-parent/java-koans-archetype/src/main/resources/archetype-resources/src/beginner/AboutLoops.java | ae8d228ebb96c4941d75a8542f005f5dccc171a1 | [
"Apache-2.0"
] | permissive | DavidWhitlock/PortlandStateJava | 1460097b63b488be2dc25f86d4b6428f9c4fd411 | 3a50f18b1ebbd35856dd7598bfacbdb5c1c5ac89 | refs/heads/main | 2023-06-28T03:59:10.729893 | 2023-06-10T18:10:34 | 2023-06-10T18:10:34 | 9,431,642 | 17 | 12 | Apache-2.0 | 2023-06-10T18:10:35 | 2013-04-14T16:31:58 | Java | UTF-8 | Java | false | false | 3,836 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package beginner;
import com.sandwich.koan.Koan;
import static com.sandwich.koan.constant.KoanConstants.__;
import static com.sandwich.util.Assert.assertEquals;
public class AboutLoops {
@Koan
public void basicForLoop1() {
String s = "";
for (int i = 0; i < 5; i++) {
s += i + " ";
}
assertEquals(s, __);
}
@Koan
public void basicForLoop2() {
String s = "";
for (int i = -5; i < 1; i++) {
s += i + " ";
}
assertEquals(s, __);
}
@Koan
public void basicForLoop3() {
String s = "";
for (int i = 5; i > 0; i--) {
s += i + " ";
}
assertEquals(s, __);
}
@Koan
public void basicForLoop4() {
String s = "";
for (int i = 0; i < 11; i += 2) {
s += i + " ";
}
assertEquals(s, __);
}
@Koan
public void basicForLoop5() {
String s = "";
for (int i = 1; i <= 16; i *= 2) {
s += i + " ";
}
assertEquals(s, __);
}
@Koan
public void basicForLoopWithTwoVariables1() {
String s = "";
for (int i = 0, j = 10; i < 5 && j > 5; i++, j--) {
s += i + " " + j + " ";
}
assertEquals(s, __);
}
@Koan
public void nestedLoops() {
String s = "";
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
s += "(" + i + ", " + j + ") ";
}
s += " - ";
}
assertEquals(s, __);
}
@Koan
public void extendedForLoop() {
int[] is = {1, 2, 3, 4};
String s = "";
for (int j : is) {
s += j + " ";
}
assertEquals(s, __);
}
@Koan
public void whileLoop() {
int result = 0;
while (result < 3) {
result++;
}
assertEquals(result, __);
}
@Koan
public void doLoop() {
int result = 0;
do {
result++;
} while (false);
assertEquals(result, __);
}
@Koan
public void extendedForLoopBreak() {
String[] sa = {"Dog", "Cat", "Tiger"};
int count = 0;
for (String current : sa) {
if ("Cat".equals(current)) {
break;
}
count++;
}
assertEquals(count, __);
}
@Koan
public void extendedForLoopContinue() {
String[] sa = {"Dog", "Cat", "Tiger"};
int count = 0;
for (String current : sa) {
if ("Dog".equals(current)) {
continue;
} else {
count++;
}
}
assertEquals(count, __);
}
@Koan
public void forLoopContinueLabel() {
int count = 0;
outerLabel:
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
count++;
if (count > 2) {
continue outerLabel;
}
}
count += 10;
}
// What does continue with a label mean?
// What gets executed? Where does the program flow continue?
assertEquals(count, __);
}
@Koan
public void forLoopBreakLabel() {
int count = 0;
outerLabel:
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
count++;
if (count > 2) {
break outerLabel;
}
}
count += 10;
}
// What does break with a label mean?
// What gets executed? Where does the program flow continue?
assertEquals(count, __);
}
}
| [
"david.m.whitlock@gmail.com"
] | david.m.whitlock@gmail.com |
fe04e6b9de98d8e5eaacb37efe301a0acad74ea7 | b7936f9a99afb096bc6d68448c32631d7416e177 | /build/tmp/recompileMc/sources/net/minecraft/block/BlockLilyPad.java | 8a7b7a2725faf1e3c68abfcdbe02cffc3dea2f49 | [] | no_license | AlphaWolf21/JATMA | ff786893893879d1f158a549659bbf13a5e0763c | 93cf49cca9e23fa1660099999b2b46ce26fb3bbb | refs/heads/master | 2021-01-19T02:43:34.989869 | 2016-11-07T04:06:16 | 2016-11-07T04:06:16 | 73,483,501 | 2 | 0 | null | 2016-11-11T14:20:06 | 2016-11-11T14:20:05 | null | UTF-8 | Java | false | false | 2,516 | java | package net.minecraft.block;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockLilyPad extends BlockBush
{
protected static final AxisAlignedBB LILY_PAD_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.09375D, 0.9375D);
protected BlockLilyPad()
{
this.setCreativeTab(CreativeTabs.DECORATIONS);
}
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn)
{
if (!(entityIn instanceof EntityBoat))
{
addCollisionBoxToList(pos, entityBox, collidingBoxes, LILY_PAD_AABB);
}
}
/**
* Called When an Entity Collided with the Block
*/
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
{
super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
if (entityIn instanceof EntityBoat)
{
worldIn.destroyBlock(new BlockPos(pos), true);
}
}
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
return LILY_PAD_AABB;
}
/**
* Return true if the block can sustain a Bush
*/
protected boolean canSustainBush(IBlockState state)
{
return state.getBlock() == Blocks.WATER || state.getMaterial() == Material.ICE;
}
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
if (pos.getY() >= 0 && pos.getY() < 256)
{
IBlockState iblockstate = worldIn.getBlockState(pos.down());
Material material = iblockstate.getMaterial();
return material == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 || material == Material.ICE;
}
else
{
return false;
}
}
/**
* Convert the BlockState into the correct metadata value
*/
public int getMetaFromState(IBlockState state)
{
return 0;
}
} | [
"techperson71@gmail.com"
] | techperson71@gmail.com |
ee903ba701c8ce725e565ad543548f7417b03bc4 | b85d0ce8280cff639a80de8bf35e2ad110ac7e16 | /com/fossil/eoi.java | 58db41c9d7c3bd023797abedd1945afe21b5430d | [] | no_license | MathiasMonstrey/fosil_decompiled | 3d90433663db67efdc93775145afc0f4a3dd150c | 667c5eea80c829164220222e8fa64bf7185c9aae | refs/heads/master | 2020-03-19T12:18:30.615455 | 2018-06-07T17:26:09 | 2018-06-07T17:26:09 | 136,509,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,777 | java | package com.fossil;
import android.content.Context;
import com.misfit.frameworks.common.constants.MFNetworkReturnCode;
import io.fabric.sdk.android.services.common.CommonUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.TreeSet;
import java.util.concurrent.CopyOnWriteArrayList;
public abstract class eoi<T> {
protected final enj aIg;
protected final Context context;
protected final eoh<T> dOX;
protected final eol dOY;
private final int dOZ;
protected volatile long dPa;
protected final List<eom> dPb = new CopyOnWriteArrayList();
class C34851 implements Comparator<C3486a> {
final /* synthetic */ eoi dPc;
C34851(eoi com_fossil_eoi) {
this.dPc = com_fossil_eoi;
}
public /* synthetic */ int compare(Object obj, Object obj2) {
return m10984a((C3486a) obj, (C3486a) obj2);
}
public int m10984a(C3486a c3486a, C3486a c3486a2) {
return (int) (c3486a.timestamp - c3486a2.timestamp);
}
}
static class C3486a {
final File file;
final long timestamp;
public C3486a(File file, long j) {
this.file = file;
this.timestamp = j;
}
}
protected abstract String xo();
public eoi(Context context, eoh<T> com_fossil_eoh_T, enj com_fossil_enj, eol com_fossil_eol, int i) throws IOException {
this.context = context.getApplicationContext();
this.dOX = com_fossil_eoh_T;
this.dOY = com_fossil_eol;
this.aIg = com_fossil_enj;
this.dPa = this.aIg.aFr();
this.dOZ = i;
}
public void di(T t) throws IOException {
byte[] bk = this.dOX.bk(t);
pi(bk.length);
this.dOY.av(bk);
}
public void m2902a(eom com_fossil_eom) {
if (com_fossil_eom != null) {
this.dPb.add(com_fossil_eom);
}
}
public boolean aFS() throws IOException {
boolean z = true;
String str = null;
if (this.dOY.aFZ()) {
z = false;
} else {
str = xo();
this.dOY.mt(str);
CommonUtils.a(this.context, 4, "Fabric", String.format(Locale.US, "generated new file %s", new Object[]{str}));
this.dPa = this.aIg.aFr();
}
mq(str);
return z;
}
private void pi(int i) throws IOException {
if (!this.dOY.cs(i, xq())) {
CommonUtils.a(this.context, 4, "Fabric", String.format(Locale.US, "session analytics events file is %d bytes, new event is %d bytes, this is over flush limit of %d, rolling it over", new Object[]{Integer.valueOf(this.dOY.aFY()), Integer.valueOf(i), Integer.valueOf(xq())}));
aFS();
}
}
protected int xp() {
return this.dOZ;
}
protected int xq() {
return MFNetworkReturnCode.REQUEST_NOT_FOUND;
}
private void mq(String str) {
for (eom ms : this.dPb) {
try {
ms.ms(str);
} catch (Throwable e) {
CommonUtils.a(this.context, "One of the roll over listeners threw an exception", e);
}
}
}
public List<File> aFV() {
return this.dOY.pj(1);
}
public void aG(List<File> list) {
this.dOY.aH(list);
}
public void aFW() {
this.dOY.aH(this.dOY.aGa());
this.dOY.aGb();
}
public void aFX() {
List<File> aGa = this.dOY.aGa();
int xp = xp();
if (aGa.size() > xp) {
int size = aGa.size() - xp;
CommonUtils.Z(this.context, String.format(Locale.US, "Found %d files in roll over directory, this is greater than %d, deleting %d oldest files", new Object[]{Integer.valueOf(aGa.size()), Integer.valueOf(xp), Integer.valueOf(size)}));
TreeSet treeSet = new TreeSet(new C34851(this));
for (File file : aGa) {
treeSet.add(new C3486a(file, mr(file.getName())));
}
List arrayList = new ArrayList();
Iterator it = treeSet.iterator();
while (it.hasNext()) {
arrayList.add(((C3486a) it.next()).file);
if (arrayList.size() == size) {
break;
}
}
this.dOY.aH(arrayList);
}
}
public long mr(String str) {
long j = 0;
String[] split = str.split("_");
if (split.length == 3) {
try {
j = Long.valueOf(split[2]).longValue();
} catch (NumberFormatException e) {
}
}
return j;
}
}
| [
"me@mathiasmonstrey.be"
] | me@mathiasmonstrey.be |
5ac422a77b497bb1d385927a451d4ff2c48aed5e | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/com/google/zxing/common/PerspectiveTransform.java | 5b5d7d741276ce6b28daca39c65e4eeaf4a3f73b | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,474 | java | package com.google.zxing.common;
public final class PerspectiveTransform {
public final float a;
public final float b;
public final float c;
public final float d;
public final float e;
public final float f;
public final float g;
public final float h;
public final float i;
public PerspectiveTransform(float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10) {
this.a = f2;
this.b = f5;
this.c = f8;
this.d = f3;
this.e = f6;
this.f = f9;
this.g = f4;
this.h = f7;
this.i = f10;
}
public static PerspectiveTransform quadrilateralToQuadrilateral(float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13, float f14, float f15, float f16, float f17) {
PerspectiveTransform quadrilateralToSquare = quadrilateralToSquare(f2, f3, f4, f5, f6, f7, f8, f9);
PerspectiveTransform squareToQuadrilateral = squareToQuadrilateral(f10, f11, f12, f13, f14, f15, f16, f17);
float f18 = squareToQuadrilateral.a;
float f19 = quadrilateralToSquare.a;
float f20 = squareToQuadrilateral.d;
float f21 = quadrilateralToSquare.b;
float f22 = squareToQuadrilateral.g;
float f23 = quadrilateralToSquare.c;
float f24 = (f20 * f21) + (f18 * f19) + (f22 * f23);
float f25 = quadrilateralToSquare.d;
float f26 = quadrilateralToSquare.e;
float f27 = quadrilateralToSquare.f;
float f28 = (f20 * f26) + (f18 * f25) + (f22 * f27);
float f29 = quadrilateralToSquare.g;
float f30 = quadrilateralToSquare.h;
float f31 = quadrilateralToSquare.i;
float f32 = f22 * f31;
float f33 = f32 + (f20 * f30) + (f18 * f29);
float f34 = squareToQuadrilateral.b;
float f35 = squareToQuadrilateral.e;
float f36 = squareToQuadrilateral.h;
float f37 = (f36 * f23) + (f35 * f21) + (f34 * f19);
float f38 = (f35 * f26) + (f34 * f25);
float f39 = (f35 * f30) + (f34 * f29) + (f36 * f31);
float f40 = squareToQuadrilateral.c;
float f41 = squareToQuadrilateral.f;
float f42 = f21 * f41;
float f43 = squareToQuadrilateral.i;
return new PerspectiveTransform(f24, f28, f33, f37, (f36 * f27) + f38, f39, (f23 * f43) + f42 + (f19 * f40), (f27 * f43) + (f26 * f41) + (f25 * f40), (f43 * f31) + (f41 * f30) + (f40 * f29));
}
public static PerspectiveTransform quadrilateralToSquare(float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9) {
PerspectiveTransform squareToQuadrilateral = squareToQuadrilateral(f2, f3, f4, f5, f6, f7, f8, f9);
float f10 = squareToQuadrilateral.e;
float f11 = squareToQuadrilateral.i;
float f12 = squareToQuadrilateral.f;
float f13 = squareToQuadrilateral.h;
float f14 = (f10 * f11) - (f12 * f13);
float f15 = squareToQuadrilateral.g;
float f16 = squareToQuadrilateral.d;
float f17 = (f12 * f15) - (f16 * f11);
float f18 = (f16 * f13) - (f10 * f15);
float f19 = squareToQuadrilateral.c;
float f20 = squareToQuadrilateral.b;
float f21 = squareToQuadrilateral.a;
return new PerspectiveTransform(f14, f17, f18, (f19 * f13) - (f20 * f11), (f11 * f21) - (f19 * f15), (f15 * f20) - (f13 * f21), (f20 * f12) - (f19 * f10), (f19 * f16) - (f12 * f21), (f21 * f10) - (f20 * f16));
}
public static PerspectiveTransform squareToQuadrilateral(float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9) {
float f10 = ((f2 - f4) + f6) - f8;
float f11 = ((f3 - f5) + f7) - f9;
if (f10 == 0.0f && f11 == 0.0f) {
return new PerspectiveTransform(f4 - f2, f6 - f4, f2, f5 - f3, f7 - f5, f3, 0.0f, 0.0f, 1.0f);
}
float f12 = f4 - f6;
float f13 = f8 - f6;
float f14 = f5 - f7;
float f15 = f9 - f7;
float f16 = (f12 * f15) - (f13 * f14);
float f17 = ((f15 * f10) - (f13 * f11)) / f16;
float f18 = ((f12 * f11) - (f10 * f14)) / f16;
return new PerspectiveTransform((f17 * f4) + (f4 - f2), (f18 * f8) + (f8 - f2), f2, (f17 * f5) + (f5 - f3), (f18 * f9) + (f9 - f3), f3, f17, f18, 1.0f);
}
public void transformPoints(float[] fArr) {
int length = fArr.length;
float f2 = this.a;
float f3 = this.b;
float f4 = this.c;
float f5 = this.d;
float f6 = this.e;
float f7 = this.f;
float f8 = this.g;
float f9 = this.h;
float f10 = this.i;
for (int i2 = 0; i2 < length; i2 += 2) {
float f11 = fArr[i2];
int i3 = i2 + 1;
float f12 = fArr[i3];
float f13 = (f7 * f12) + (f4 * f11) + f10;
fArr[i2] = (((f5 * f12) + (f2 * f11)) + f8) / f13;
fArr[i3] = (((f12 * f6) + (f11 * f3)) + f9) / f13;
}
}
public void transformPoints(float[] fArr, float[] fArr2) {
int length = fArr.length;
for (int i2 = 0; i2 < length; i2++) {
float f2 = fArr[i2];
float f3 = fArr2[i2];
float f4 = (this.f * f3) + (this.c * f2) + this.i;
fArr[i2] = (((this.d * f3) + (this.a * f2)) + this.g) / f4;
fArr2[i2] = (((this.e * f3) + (this.b * f2)) + this.h) / f4;
}
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
a626f46b96f02d34cae82f6dc9692caecdf40b23 | d689636bd2902a115d914db25004ea1c1ba7e6ee | /src/main/java/jit/wxs/breed/domain/bo/ProviderDeviceSelectWrapper.java | 61ac6b50f0705a0997f20d29b8567cda5e958d56 | [
"Apache-2.0"
] | permissive | xuesinuan/breed | 816071a74aa780f7ba0db9caa72391123117bc55 | b0b989d04e5a0fffd7d42cb15d303015f66e9aec | refs/heads/master | 2023-04-25T08:05:06.765378 | 2020-05-13T14:50:42 | 2020-05-13T14:50:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package jit.wxs.breed.domain.bo;
import java.io.Serializable;
/**
* 供应商设备查询条件
* @author jitwxs
* @since 2018/5/17 16:00
*/
public class ProviderDeviceSelectWrapper implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 设备状态
*/
private Boolean status;
/**
* 设备名
*/
private String deviceName;
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
}
| [
"jitwxs@foxmail.com"
] | jitwxs@foxmail.com |
7a779f7f1e208c656400f7826c25c40598c9d810 | 58f239a9aebd8992ac3cd4adde855d407460f1f5 | /lds-test/src/main/java/com/weweibuy/lds/iop/model/TestModel.java | d93ddbfd69f83df98784f87a823376d8b0095518 | [] | no_license | weweibuy/lds | 7f6fb3cb93da5928a5d545e3374fc2c634e946af | 336bd540f5d4f3b4d7625a5e26d470a9c4a7b88b | refs/heads/master | 2023-07-29T09:58:29.462613 | 2021-09-13T05:40:43 | 2021-09-13T05:40:43 | 402,376,313 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 144 | java | package com.weweibuy.lds.iop.model;
import lombok.Data;
/**
* @author durenhao
* @date 2021/9/4 19:58
**/
@Data
public class TestModel {
}
| [
"ak514250@126.com"
] | ak514250@126.com |
88db01f46b7ddf8945cb10990689bfc8280f9c93 | cebab5906e9ce39791f0c136bb61a21846e922d3 | /TeachDroid/datalink_old/com/keba/kemro/plc/network/sdr/TCI/RpcTcSaveEditorIn.java | d288dfc54cfa21f747a69c4b2f8a38feb81e7238 | [] | no_license | hauserkristof/TeachDroid | 7927965fb66fbfe917430106d40fa2c005d32188 | 9edfcfd9aa8b75847db97a5798df7baa124c6e31 | refs/heads/master | 2021-05-27T16:17:41.448040 | 2014-03-05T07:54:56 | 2014-03-05T07:54:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | package com.keba.kemro.plc.network.sdr.TCI;
import com.keba.jsdr.sdr.*;
import java.io.*;
public class RpcTcSaveEditorIn implements SDR {
/** Int */
public int clientId;
/** Int */
public int editHnd;
/** Added by SdrGen */
private int mMemberDone = 0;
public RpcTcSaveEditorIn() {
}
public void read(SDRInputStream in, SDRContext context) throws SDRException, IOException {
/** Added by SdrGen */
int actMember = 0;
if (mMemberDone == actMember) {
clientId = in.readInt(context);
if (!context.done)
return;
mMemberDone++;
}
actMember++;
if (mMemberDone == actMember) {
editHnd = in.readInt(context);
if (!context.done)
return;
mMemberDone++;
}
actMember++;
}
public void write(SDROutputStream out, SDRContext context) throws SDRException, IOException {
/** Added by SdrGen */
int actMember = 0;
if (mMemberDone == actMember) {
out.writeInt(clientId, context);
if (!context.done)
return;
mMemberDone++;
}
actMember++;
if (mMemberDone == actMember) {
out.writeInt(editHnd, context);
if (!context.done)
return;
mMemberDone++;
}
actMember++;
}
public int size() {
int size = 0;
size += SDRUtil.sizeInt(clientId);
size += SDRUtil.sizeInt(editHnd);
return size;
}
public void reset() {
mMemberDone = 0;
}
}
| [
"paul.latzelsperger@gmail.com"
] | paul.latzelsperger@gmail.com |
6821203674c0b453bbeb299a828360293deaac52 | 3ca423fdea12e839c994c8be70cd5859ee7dece9 | /spring/src/test/java/com/github/kuangcp/proxy/salary/proxy/ProxyTest.java | 51630b54e653133e46219454c8ca2281aa923d51 | [
"MIT"
] | permissive | suixinlu2017/JavaBase | 8f2ccc677af16351d078bb237607c6ffbcffa85e | f6a9b7483d3a78773c1174eab9a602f413903e1a | refs/heads/master | 2022-01-30T13:19:50.094976 | 2019-07-18T08:51:47 | 2019-07-18T08:51:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | package com.github.kuangcp.proxy.salary.proxy;
import org.junit.Test;
public class ProxyTest {
@Test
public void test(){
Logger logger = new Logger();
Privilege privilege = new Privilege();
privilege.setAccess("asdf");
Security security = new Security();
SalaryManager target = new SalaryManagerImpl();
SalaryManagerProxy proxy = new SalaryManagerProxy(logger, security, privilege, target);
proxy.showSalary();
}
}
| [
"kuangcp@aliyun.com"
] | kuangcp@aliyun.com |
b1d23ed46d1e6a9359c08960055bee7c1bfa4267 | b78d96a8660f90649035c7a6d6698cabb2946d62 | /solutions/ModelJoin/src/main/java/CIM/IEC61970/Informative/InfCommon/DocPsrRole.java | f851dd26727785f302599bd4341d92e6a93d322e | [
"MIT"
] | permissive | suchaoxiao/ttc2017smartGrids | d7b677ddb20a0adc74daed9e3ae815997cc86e1a | 2997f1c202f5af628e50f5645c900f4d35f44bb7 | refs/heads/master | 2021-06-19T10:21:22.740676 | 2017-07-14T12:13:22 | 2017-07-14T12:13:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,659 | java | /**
*/
package CIM.IEC61970.Informative.InfCommon;
import CIM.IEC61968.Common.Document;
import CIM.IEC61970.Core.PowerSystemResource;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Doc Psr Role</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link CIM.IEC61970.Informative.InfCommon.DocPsrRole#getDocument <em>Document</em>}</li>
* <li>{@link CIM.IEC61970.Informative.InfCommon.DocPsrRole#getPowerSystemResource <em>Power System Resource</em>}</li>
* </ul>
*
* @see CIM.IEC61970.Informative.InfCommon.InfCommonPackage#getDocPsrRole()
* @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Potential roles that might played by a document relative to a type of PowerSystemResource.'"
* annotation="http://langdale.com.au/2005/UML Profile\040documentation='Potential roles that might played by a document relative to a type of PowerSystemResource.'"
* annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Potential roles that might played by a document relative to a type of PowerSystemResource.' Profile\040documentation='Potential roles that might played by a document relative to a type of PowerSystemResource.'"
* @generated
*/
public interface DocPsrRole extends Role {
/**
* Returns the value of the '<em><b>Document</b></em>' reference.
* It is bidirectional and its opposite is '{@link CIM.IEC61968.Common.Document#getPowerSystemResourceRoles <em>Power System Resource Roles</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Document</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Document</em>' reference.
* @see #setDocument(Document)
* @see CIM.IEC61970.Informative.InfCommon.InfCommonPackage#getDocPsrRole_Document()
* @see CIM.IEC61968.Common.Document#getPowerSystemResourceRoles
* @model opposite="PowerSystemResourceRoles"
* @generated
*/
Document getDocument();
/**
* Sets the value of the '{@link CIM.IEC61970.Informative.InfCommon.DocPsrRole#getDocument <em>Document</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Document</em>' reference.
* @see #getDocument()
* @generated
*/
void setDocument(Document value);
/**
* Returns the value of the '<em><b>Power System Resource</b></em>' reference.
* It is bidirectional and its opposite is '{@link CIM.IEC61970.Core.PowerSystemResource#getDocumentRoles <em>Document Roles</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Power System Resource</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Power System Resource</em>' reference.
* @see #setPowerSystemResource(PowerSystemResource)
* @see CIM.IEC61970.Informative.InfCommon.InfCommonPackage#getDocPsrRole_PowerSystemResource()
* @see CIM.IEC61970.Core.PowerSystemResource#getDocumentRoles
* @model opposite="DocumentRoles"
* @generated
*/
PowerSystemResource getPowerSystemResource();
/**
* Sets the value of the '{@link CIM.IEC61970.Informative.InfCommon.DocPsrRole#getPowerSystemResource <em>Power System Resource</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Power System Resource</em>' reference.
* @see #getPowerSystemResource()
* @generated
*/
void setPowerSystemResource(PowerSystemResource value);
} // DocPsrRole
| [
"hinkel@fzi.de"
] | hinkel@fzi.de |
d8233ea6130453bd95b1c86db36427c858c01cd6 | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201311/LineItemCreativeAssociationServiceInterfacegetLineItemCreativeAssociation.java | 78450d32ad879672e58c7d1ad81e7c31105ae170 | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,717 | java |
package com.google.api.ads.dfp.jaxws.v201311;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Returns the {@link LineItemCreativeAssociation} uniquely identified by the
* given line item and creative IDs.
*
* @param lineItemId the ID of the line item, which must already exist
* @param creativeId the ID of the creative, which must already exist
* @return the {@code LineItemCreativeAssociation} uniquely identified by the
* line item and creative IDs
*
*
* <p>Java class for getLineItemCreativeAssociation element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="getLineItemCreativeAssociation">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="lineItemId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* <element name="creativeId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"lineItemId",
"creativeId"
})
@XmlRootElement(name = "getLineItemCreativeAssociation")
public class LineItemCreativeAssociationServiceInterfacegetLineItemCreativeAssociation {
protected Long lineItemId;
protected Long creativeId;
/**
* Gets the value of the lineItemId property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getLineItemId() {
return lineItemId;
}
/**
* Sets the value of the lineItemId property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setLineItemId(Long value) {
this.lineItemId = value;
}
/**
* Gets the value of the creativeId property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getCreativeId() {
return creativeId;
}
/**
* Sets the value of the creativeId property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setCreativeId(Long value) {
this.creativeId = value;
}
}
| [
"jradcliff@google.com"
] | jradcliff@google.com |
405c25fe15969fa01cb9eae9824853374402a187 | 3c4425d520faeaa78a24ade0673da6cff431671e | /后台调试版/src/main/java/lottery/domains/content/vo/bill/UserBetsReportVO.java | 5da60b481f84257b91cc284d0df65f411b3c8f0c | [] | no_license | yuruyigit/lotteryServer | de5cc848b9c7967817a33629efef4e77366b74c0 | 2cc97c54a51b9d76df145a98d72d3fe097bdd6af | refs/heads/master | 2020-06-17T03:39:24.838151 | 2019-05-25T11:32:00 | 2019-05-25T11:32:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package lottery.domains.content.vo.bill;
public class UserBetsReportVO
{
private String field;
private double money;
private double returnMoney;
private double prizeMoney;
public String getField()
{
return this.field;
}
public void setField(String field)
{
this.field = field;
}
public double getMoney()
{
return this.money;
}
public void setMoney(double money)
{
this.money = money;
}
public double getReturnMoney()
{
return this.returnMoney;
}
public void setReturnMoney(double returnMoney)
{
this.returnMoney = returnMoney;
}
public double getPrizeMoney()
{
return this.prizeMoney;
}
public void setPrizeMoney(double prizeMoney)
{
this.prizeMoney = prizeMoney;
}
}
| [
"nengbowan@163.com"
] | nengbowan@163.com |
42be90a9e3a3e1c0aa28fd4ebf80289fc84d572e | 9a2186406604c63f87d2039227c7d3544b98a301 | /src/com/baiyun2/vo/parcelable/VoPicPar.java | c5945211f53e0f2e8274b4bdf14f270bd38268a2 | [] | no_license | Holyn/BaiYun2 | 179441d9e39ffb991d3e8e3dc23f8718a8994316 | a8b5af4836bc70b3aea0109a1ab62a937f0893ab | refs/heads/master | 2021-01-17T05:28:33.824167 | 2015-09-23T07:37:04 | 2015-09-23T07:37:04 | 39,782,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package com.baiyun2.vo.parcelable;
import android.os.Parcel;
import android.os.Parcelable;
public class VoPicPar implements Parcelable {
private String id;
private String url;
private String type;
private String name;
private String content;
private String width;
private String height;
private String sortOrder;
private String createTime;
@Override
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(id);
dest.writeString(url);
dest.writeString(type);
dest.writeString(name);
dest.writeString(content);
dest.writeString(width);
dest.writeString(height);
dest.writeString(sortOrder);
dest.writeString(createTime);
}
public static final Parcelable.Creator<VoPicPar> CREATOR = new Parcelable.Creator<VoPicPar>() {
public VoPicPar createFromParcel(Parcel in) {
VoPicPar par = new VoPicPar();
par.id = in.readString();
par.url = in.readString();
par.type = in.readString();
par.name = in.readString();
par.content = in.readString();
par.width = in.readString();
par.height = in.readString();
par.sortOrder = in.readString();
par.createTime = in.readString();
return par;
}
public VoPicPar[] newArray(int size) {
return new VoPicPar[size];
}
};
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getWidth() {
return width;
}
public void setWidth(String width) {
this.width = width;
}
public String getHeight() {
return height;
}
public void setHeight(String height) {
this.height = height;
}
public String getSortOrder() {
return sortOrder;
}
public void setSortOrder(String sortOrder) {
this.sortOrder = sortOrder;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
}
| [
"328550680@qq.com"
] | 328550680@qq.com |
48f73e9246f80154a3f3174ff91ec5a39293654f | 587861bceaa9b85e995d986225622828dc77e0cc | /android/app/src/main/java/com/satsuscreens_dev_1527/MainApplication.java | 20bee1c491d1ad38878e70ec28e956ae24bf8ca8 | [] | no_license | crowdbotics-apps/satsuscreens-dev-1527 | 144fd0f67bd7a12a5157fd8381ccb3bb180986b7 | 420f264dbee19d6365c81b07bf8c45d03edfedc2 | refs/heads/master | 2022-04-09T22:58:18.190399 | 2020-01-21T17:10:57 | 2020-01-21T17:10:57 | 235,396,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,374 | java | package com.satsuscreens_dev_1527;
import android.app.Application;
import android.util.Log;
import com.facebook.react.PackageList;
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"team@crowdbotics.com"
] | team@crowdbotics.com |
fd8f80ff3c604c5297cfa7d5c45a932c825932a7 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_bdbf2ebcee03cd50a22b72d9ed92ab6615e7b8c6/RangeIntGenerator/2_bdbf2ebcee03cd50a22b72d9ed92ab6615e7b8c6_RangeIntGenerator_t.java | 3fa9781b361ddbd88cd668ce6b36c95322384254 | [] | 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,854 | java | /**
Copyright 2013 Intel Corporation, 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 com.intel.cosbench.driver.random;
import java.util.Random;
import org.apache.commons.lang.StringUtils;
import com.intel.cosbench.config.ConfigException;
class RangeIntGenerator implements IntGenerator {
private int lower;
private int upper;
private int cursor;
public RangeIntGenerator(int lower, int upper) {
if (lower <= 0 || upper <= 0 || lower > upper)
throw new IllegalArgumentException();
this.lower = lower;
this.upper = upper;
this.cursor = 0;
}
@Override
public int next(Random random) {
return next(random, 1, 1);
}
@Override
public int next(Random random, int idx, int all) {
int range = upper - lower + 1;
int base = range / all;
int extra = range % all;
int offset = base * (idx - 1) + (extra >= idx - 1 ? idx - 1 : extra);
int segment = base + (extra >= idx ? 1 : 0);
int limit = segment + offset + lower;
cursor = cursor <= 0 ? limit - segment : cursor + 1;
return cursor < limit ? cursor : lower;
}
public static RangeIntGenerator parse(String pattern) {
try {
return tryParseOld(pattern);
} catch (Exception e1) {
if (!StringUtils.startsWith(pattern, "r("))
return null;
try {
return tryParse(pattern);
} catch (Exception e2) {
}
}
String msg = "illegal iteration pattern: " + pattern;
throw new ConfigException(msg);
}
private static RangeIntGenerator tryParse(String pattern) {
pattern = StringUtils.substringBetween(pattern, "(", ")");
String[] args = StringUtils.split(pattern, ",");
int lower = Integer.parseInt(args[0]);
int upper = Integer.parseInt(args[1]);
return new RangeIntGenerator(lower, upper);
}
private static RangeIntGenerator tryParseOld(String pattern) {
String[] args = StringUtils.split(pattern, '-');
int lower = Integer.parseInt(args[0]);
int upper = Integer.parseInt(args[1]);
return new RangeIntGenerator(lower, upper);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
221a25e5d2f21b319011a58a946d901e37952bd8 | 09891aaff36ef0db918828a1382041cce1e136e3 | /src/main/java/ofx/AbstractSyncResponse.java | bbb87d994fbfa7f83b974743fa2a396b081a4483 | [] | no_license | proyleg/InvestiaGenOFX2_mv | 7f01555282b094581ae773421b23b3cae8656723 | 4d5524717067f66c1bec2d0702fbb8e448588611 | refs/heads/master | 2021-01-20T03:21:46.991208 | 2018-12-18T14:48:04 | 2018-12-18T14:48:04 | 89,526,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,067 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.12 at 04:58:05 PM EST
//
package ofx;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AbstractSyncResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AbstractSyncResponse">
* <complexContent>
* <extension base="{http://ofx.net/types/2003/04}AbstractResponse">
* <sequence>
* <element name="TOKEN" type="{http://ofx.net/types/2003/04}ServerIdType"/>
* <element name="LOSTSYNC" type="{http://ofx.net/types/2003/04}BooleanType" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractSyncResponse", propOrder = {
"token",
"lostsync"
})
@XmlSeeAlso({
MailSyncResponse.class,
InvestmentMailSyncResponse.class,
BankMailSyncResponse.class,
AccountSyncResponse.class,
PaymentSyncResponse.class,
RecurringIntraSyncResponse.class,
WireSyncResponse.class,
PaymentMailSyncResponse.class,
RecurringPaymentSyncResponse.class,
ChangeUserInfoSyncResponse.class,
PayeeSyncResponse.class,
RecurringInterSyncResponse.class,
PresentmentMailSyncResponse.class,
IntraSyncResponse.class,
InterSyncResponse.class,
StopCheckSyncResponse.class
})
public abstract class AbstractSyncResponse
extends AbstractResponse
{
@XmlElement(name = "TOKEN", required = true)
protected String token;
@XmlElement(name = "LOSTSYNC")
protected BooleanType lostsync;
/**
* Gets the value of the token property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTOKEN() {
return token;
}
/**
* Sets the value of the token property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTOKEN(String value) {
this.token = value;
}
/**
* Gets the value of the lostsync property.
*
* @return
* possible object is
* {@link BooleanType }
*
*/
public BooleanType getLOSTSYNC() {
return lostsync;
}
/**
* Sets the value of the lostsync property.
*
* @param value
* allowed object is
* {@link BooleanType }
*
*/
public void setLOSTSYNC(BooleanType value) {
this.lostsync = value;
}
}
| [
"proy_leg@hotmail.com"
] | proy_leg@hotmail.com |
296dd159cf3b17a0fd06259ba2a5376c2396b44b | e9ad092dfc4efe87fe49e3d3083482311f765731 | /lang/src/main/java/nl/knaw/dans/common/lang/ResourceNotFoundException.java | babaddea98774c711b26f48424969ba402dbb745 | [
"Apache-2.0"
] | permissive | DANS-KNAW/dccd-legacy-libs | e0f863cc5953dcceb9b91d4eb6ffdd0d37831bbb | 687d2e434359ad80af0b192748475ec4a76529c4 | refs/heads/master | 2021-01-01T19:35:17.114074 | 2019-09-03T13:58:30 | 2019-09-03T13:58:30 | 37,195,178 | 0 | 1 | Apache-2.0 | 2020-10-13T06:53:30 | 2015-06-10T12:15:06 | Java | UTF-8 | Java | false | false | 1,451 | java | /*******************************************************************************
* Copyright 2015 DANS - Data Archiving and Networked Services
*
* 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 nl.knaw.dans.common.lang;
/**
* Signals that a resource was not found.
*
* @author ecco Sep 27, 2009
*/
public class ResourceNotFoundException extends Exception
{
private static final long serialVersionUID = 6846502885709367426L;
// ecco (Sep 29, 2009): CHECKSTYLE: OFF
public ResourceNotFoundException()
{
}
public ResourceNotFoundException(final String message)
{
super(message);
}
public ResourceNotFoundException(final Throwable cause)
{
super(cause);
}
public ResourceNotFoundException(final String message, final Throwable cause)
{
super(message, cause);
}
}
| [
"jan.van.mansum@dans.knaw.nl"
] | jan.van.mansum@dans.knaw.nl |
97c703869528d737507f47f24b29d2e3a7a40dff | a6c60b030d82a93799f6620b487f9016d9ae1c2f | /src/test/java/com/apptium/customer/config/WebConfigurerTest.java | 67a1c8a654426a6feb8f6f58640a81c2daa9cf47 | [] | no_license | ravi7mech/com-customer-mgmt | 19ca4f791d44235d555a737a602049fecde34e61 | 3bd45494e1172141a803056f50cb2357dc76707c | refs/heads/main | 2023-06-19T20:07:02.114947 | 2021-07-14T13:27:33 | 2021-07-14T13:27:33 | 385,949,596 | 0 | 0 | null | 2021-07-14T13:29:00 | 2021-07-14T13:27:23 | Java | UTF-8 | Java | false | false | 5,737 | java | package com.apptium.customer.config;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.*;
import javax.servlet.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import tech.jhipster.config.JHipsterConstants;
import tech.jhipster.config.JHipsterProperties;
/**
* Unit tests for the {@link WebConfigurer} class.
*/
class WebConfigurerTest {
private WebConfigurer webConfigurer;
private MockServletContext servletContext;
private MockEnvironment env;
private JHipsterProperties props;
@BeforeEach
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class)).when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class)).when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
}
@Test
void shouldStartUpProdServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
assertThatCode(() -> webConfigurer.onStartup(servletContext)).doesNotThrowAnyException();
}
@Test
void shouldStartUpDevServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
assertThatCode(() -> webConfigurer.onStartup(servletContext)).doesNotThrowAnyException();
}
@Test
void shouldCorsFilterOnApiPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("other.domain.com"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build();
mockMvc
.perform(
options("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")
)
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"))
.andExpect(header().string(HttpHeaders.VARY, "Origin"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"));
mockMvc
.perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"));
}
@Test
void shouldCorsFilterOnOtherPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build();
mockMvc
.perform(get("/test/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
void shouldCorsFilterDeactivatedForNullAllowedOrigins() throws Exception {
props.getCors().setAllowedOrigins(null);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build();
mockMvc
.perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
void shouldCorsFilterDeactivatedForEmptyAllowedOrigins() throws Exception {
props.getCors().setAllowedOrigins(new ArrayList<>());
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build();
mockMvc
.perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
911f67b877a4899fd21c9893b1838d208d1bea78 | f5b0c9be6293194dd81d3af987bd513ab4e87221 | /src/com/codeforces/competitions/year2015/round321div2/Second.java | 1713cc4727e55f0db3cfc656361afdd7b87a074a | [] | no_license | rahulkhairwar/dsa-library | 13f8eb7765d3fa4e8cf2a746a3007e3a9447b2f8 | b14d14b4e3227ef596375bab55e88d50c7b950a6 | refs/heads/master | 2022-04-28T06:37:16.098693 | 2020-04-04T19:00:11 | 2020-04-04T19:00:11 | 43,200,287 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,567 | java | package com.codeforces.competitions.year2015.round321div2;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
public final class Second
{
static int n, d;
static Friend fr[];
static InputReader reader;
static OutputWriter writer;
public static void main(String[] args)
{
Second second = new Second();
reader = second.new InputReader(System.in);
writer = second.new OutputWriter(System.out);
getAttributes();
writer.flush();
reader.close();
writer.close();
}
static void getAttributes()
{
n = reader.nextInt();
d = reader.nextInt();
fr = new Friend[n];
for (int i = 0; i < n; i++)
fr[i] = new Friend(reader.nextInt(), reader.nextInt());
Friend.sortMoney(fr);
long max[] = new long[n];
long cum[] = new long[n];
max[n - 1] = fr[n - 1].fr;
cum[0] = fr[0].fr;
for (int i = 1; i < n; i++)
cum[i] = cum[i - 1] + fr[i].fr;
for (int i = 0; i < n - 1; i++)
{
int srch = binS(fr[i].money, i + 1, n - 1);
if (srch == -1)
max[i] = fr[i].fr;
else
max[i] = cum[srch] - cum[i] + fr[i].fr;
}
long fin = max[0];
for (int i = 1; i < n; i++)
if (max[i] > fin)
fin = max[i];
writer.print(fin);
}
static int binS(int left, int from, int to)
{
int mid;
while (from <= to)
{
mid = from + (to - from) / 2;
if (fr[mid].money - left < d)
{
if (mid == n - 1)
return mid;
else if (fr[mid + 1].money - left >= d)
return mid;
else
from = mid + 1;
}
else
to = mid - 1;
}
return -1;
}
static class Friend
{
int money;
int fr;
public Friend(int money, int fr)
{
super();
this.money = money;
this.fr = fr;
}
static void sortMoney(Friend fr[])
{
Arrays.sort(fr, new Comparator<Friend>()
{
@Override
public int compare(Friend o1, Friend o2)
{
return o1.money - o2.money;
}
});
}
}
class InputReader
{
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public InputReader(InputStream stream)
{
this.stream = stream;
}
public int read()
{
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars)
{
curChar = 0;
try
{
numChars = stream.read(buf);
}
catch (IOException e)
{
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt()
{
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = read();
}
int res = 0;
do
{
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c & 15;
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong()
{
int c = read();
while (isSpaceChar(c))
c = read();
int sign = 1;
if (c == '-')
{
sign = -1;
c = read();
}
long result = 0;
do
{
if (c < '0' || c > '9')
throw new InputMismatchException();
result *= 10;
result += c & 15;
c = read();
} while (!isSpaceChar(c));
return result * sign;
}
public float nextFloat() // problematic
{
float result, div;
byte c;
result = 0;
div = 1;
c = (byte) read();
while (c <= ' ')
c = (byte) read();
boolean isNegative = (c == '-');
if (isNegative)
c = (byte) read();
do
{
result = result * 10 + c - '0';
} while ((c = (byte) read()) >= '0' && c <= '9');
if (c == '.')
while ((c = (byte) read()) >= '0' && c <= '9')
result += (c - '0') / (div *= 10);
if (isNegative)
return -result;
return result;
}
public double nextDouble() // not completely accurate
{
double ret = 0, div = 1;
byte c = (byte) read();
while (c <= ' ')
c = (byte) read();
boolean neg = (c == '-');
if (neg)
c = (byte) read();
do
{
ret = ret * 10 + c - '0';
} while ((c = (byte) read()) >= '0' && c <= '9');
if (c == '.')
while ((c = (byte) read()) >= '0' && c <= '9')
ret += (c - '0') / (div *= 10);
if (neg)
return -ret;
return ret;
}
public String next()
{
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do
{
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c)
{
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public void close()
{
try
{
stream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
class OutputWriter
{
private PrintWriter writer;
public OutputWriter(OutputStream stream)
{
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
stream)));
}
public OutputWriter(Writer writer)
{
this.writer = new PrintWriter(writer);
}
public void println(int x)
{
writer.println(x);
}
public void print(int x)
{
writer.print(x);
}
public void println(int array[], int size)
{
for (int i = 0; i < size; i++)
println(array[i]);
}
public void print(int array[], int size)
{
for (int i = 0; i < size; i++)
print(array[i] + " ");
}
public void println(long x)
{
writer.println(x);
}
public void print(long x)
{
writer.print(x);
}
public void println(long array[], int size)
{
for (int i = 0; i < size; i++)
println(array[i]);
}
public void print(long array[], int size)
{
for (int i = 0; i < size; i++)
print(array[i]);
}
public void println(float num)
{
writer.println(num);
}
public void print(float num)
{
writer.print(num);
}
public void println(double num)
{
writer.println(num);
}
public void print(double num)
{
writer.print(num);
}
public void println(String s)
{
writer.println(s);
}
public void print(String s)
{
writer.print(s);
}
public void println()
{
writer.println();
}
public void printSpace()
{
writer.print(" ");
}
public void flush()
{
writer.flush();
}
public void close()
{
writer.close();
}
}
}
/*
3 20
100 100
50 50
60 60
3 20
100 100
20 20
60 60
*/
| [
"rahulkhairwar@gmail.com"
] | rahulkhairwar@gmail.com |
45ba96f5e31529baff31f8993e4d2c79edb1a7ba | 8b9190a8c5855d5753eb8ba7003e1db875f5d28f | /sources/com/google/android/gms/internal/vision/zzjg.java | cbc1b5f2f0dbf4bd3f0a6fdce4b51f5b00371522 | [] | no_license | stevehav/iowa-caucus-app | 6aeb7de7487bd800f69cb0b51cc901f79bd4666b | e3c7eb39de0be6bbfa8b6b063aaa85dcbcee9044 | refs/heads/master | 2020-12-29T10:25:28.354117 | 2020-02-05T23:15:52 | 2020-02-05T23:15:52 | 238,565,283 | 21 | 3 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package com.google.android.gms.internal.vision;
/* 'enum' modifier removed */
final class zzjg extends zzjd {
zzjg(String str, int i, zzji zzji, int i2) {
super(str, 10, zzji, 2, (zzjc) null);
}
}
| [
"steve@havelka.co"
] | steve@havelka.co |
304aec2dc688fcca2708869fa6af99e1bda0c528 | af8f2d1b600d794aea496f5f8005a20ed016960b | /office/trunk/src_mysql/java/net/zdsoft/office/bulletin/service/OfficeBulletinReadService.java | 1278972506eb78c5a91b53b5a79b530699370fd3 | [] | no_license | thyjxcf/learn | 46c033f8434c0b0b0809e2a6b1d5601910b36c0d | 99b9e04aa9c0e7ee00571dffb8735283cf33b1c1 | refs/heads/master | 2021-01-06T20:43:53.071081 | 2017-09-15T10:11:53 | 2017-09-15T10:11:53 | 99,546,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,675 | java | package net.zdsoft.office.bulletin.service;
import java.util.List;
import java.util.Map;
import net.zdsoft.keel.util.Pagination;
import net.zdsoft.office.bulletin.entity.OfficeBulletinRead;
/**
* office_bulletin_read
* @author
*
*/
public interface OfficeBulletinReadService{
/**
* 新增office_bulletin_read
* @param officeBulletinRead
* @return
*/
public void save(OfficeBulletinRead officeBulletinRead);
/**
* 根据ids数组删除office_bulletin_read数据
* @param ids
* @return
*/
public Integer delete(String[] ids);
/**
* 更新office_bulletin_read
* @param officeBulletinRead
* @return
*/
public Integer update(OfficeBulletinRead officeBulletinRead);
/**
* 根据id获取office_bulletin_read
* @param id
* @return
*/
public OfficeBulletinRead getOfficeBulletinReadById(String id);
/**
* 根据ids数组查询office_bulletin_readmap
* @param ids
* @return
*/
public Map<String, OfficeBulletinRead> getOfficeBulletinReadMapByIds(String[] ids);
/**
* 获取office_bulletin_read列表
* @return
*/
public List<OfficeBulletinRead> getOfficeBulletinReadList();
/**
* 分页获取office_bulletin_read列表
* @param page
* @return
*/
public List<OfficeBulletinRead> getOfficeBulletinReadPage(Pagination page);
/**
* 根据UnitId获取office_bulletin_read列表
* @param unitId
* @return
*/
public List<OfficeBulletinRead> getOfficeBulletinReadByUnitIdList(String unitId);
/**
* 根据UnitId分页获取office_bulletin_read
* @param unitId
* @param page
* @return
*/
public List<OfficeBulletinRead> getOfficeBulletinReadByUnitIdPage(String unitId, Pagination page);
} | [
"1129820421@qq.com"
] | 1129820421@qq.com |
605235a551ae9a95fd07e754676e182a4e0ee47e | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/apache--kafka/d0e436c471ba4122ddcc0f7a1624546f97c4a517/after/RecordContextStub.java | bc3f952c733d077a8e3fd634b3a3518bf2044c3f | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,658 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.kafka.streams.processor.internals;
public class RecordContextStub implements RecordContext {
private final long offset;
private final long timestamp;
private final int partition;
private final String topic;
public RecordContextStub() {
this(-1, -1, -1, "");
}
public RecordContextStub(final long offset, final long timestamp, final int partition, final String topic) {
this.offset = offset;
this.timestamp = timestamp;
this.partition = partition;
this.topic = topic;
}
@Override
public long offset() {
return offset;
}
@Override
public long timestamp() {
return timestamp;
}
@Override
public String topic() {
return topic;
}
@Override
public int partition() {
return partition;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
5c4196c9ef7818be5871a2333d2c32321d41cd4c | 0962f1385c483396cb85c2bcd9a7339d26376bec | /sponge-rest-api-common/src/main/java/org/openksavi/sponge/restapi/type/converter/unit/TypeTypeUnitConverter.java | 4b499f92221a387cfc08865ac4cdf7cc9c531c4f | [
"Apache-2.0"
] | permissive | linuxerwang/sponge | d26946b1030b15f2952a61501bce604bb8cd13b7 | 5fcb5cce276a8ab5eaf181c6fd38943298e32e23 | refs/heads/master | 2020-12-01T21:16:04.048108 | 2019-12-20T17:55:56 | 2019-12-20T17:55:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,051 | java | /*
* Copyright 2016-2019 The Sponge authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openksavi.sponge.restapi.type.converter.unit;
import org.openksavi.sponge.restapi.type.converter.BaseUnitTypeConverter;
import org.openksavi.sponge.restapi.type.converter.TypeConverter;
import org.openksavi.sponge.type.DataType;
import org.openksavi.sponge.type.DataTypeKind;
import org.openksavi.sponge.type.TypeType;
import org.openksavi.sponge.util.DataTypeUtils;
@SuppressWarnings("rawtypes")
public class TypeTypeUnitConverter extends BaseUnitTypeConverter<DataType, TypeType> {
public TypeTypeUnitConverter() {
super(DataTypeKind.TYPE);
}
@Override
public DataType marshal(TypeConverter converter, TypeType type, DataType value) {
// Recursively marshal default values.
DataType result = value.clone();
for (DataType t : DataTypeUtils.getTypes(result)) {
t.setDefaultValue(converter.marshal(t, t.getDefaultValue()));
}
return result;
}
@Override
public DataType unmarshal(TypeConverter converter, TypeType type, Object value) {
DataType unmarshalled =
value instanceof DataType ? (DataType) value : converter.getObjectMapper().convertValue(value, DataType.class);
// Recursively unmarshal default values.
for (DataType t : DataTypeUtils.getTypes(unmarshalled)) {
t.setDefaultValue(converter.unmarshal(t, t.getDefaultValue()));
}
return unmarshalled;
}
}
| [
"marcin.pas@softelnet.com"
] | marcin.pas@softelnet.com |
e751028debe7072e557b2660c990faed461e7502 | ffa90365de64c57afdb214afdf19a0a0aef6cbcd | /bos-parent/bos-service/src/main/java/com/itheima/bos/service/WorkordermanagerService.java | f968053c85cb5147f95286b66e21c181da187c45 | [] | no_license | 951132436/test | 511957764c6af0dd7d00850db4b3d988b90bc17d | cbb78605384305935c418e3b04f7ce1c1a1cca10 | refs/heads/master | 2021-01-22T05:42:40.778492 | 2017-05-26T09:14:41 | 2017-05-26T12:58:06 | 92,487,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.itheima.bos.service;
import java.util.List;
import com.itheima.bos.domain.Workordermanager;
import com.itheima.bos.utils.PageBean;
public interface WorkordermanagerService {
void save(Workordermanager model);
void batchImport(List<Workordermanager> list);
void pageQuery(PageBean pageBean);
}
| [
"123@163.com"
] | 123@163.com |
87a47339271924fb6cacf635448b629ce706f168 | 5a088135a99a386e473f94f971c571864373865c | /A2017001-费森尤斯项目/02.Engineering/03.代码/01.server/branches/0608/05.HCP-payment/src/main/java/com/lenovohit/hcp/payment/manager/impl/TradeNotifyManagerImpl.java | c4cf0e5598eec230c9da5dd4e024b46331d4f032 | [] | no_license | jacky-cyber/work | a7bebd2cc910da1e9e227181def880a78cc1de07 | e58558221b2a8f410b087fa2ce88017cea12efa4 | refs/heads/master | 2022-02-25T09:48:53.940782 | 2018-05-01T10:04:53 | 2018-05-01T10:04:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package com.lenovohit.hcp.payment.manager.impl;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lenovohit.core.manager.GenericManager;
import com.lenovohit.hcp.base.manager.HisForOutChargeManager;
import com.lenovohit.hcp.payment.manager.TradeNofityManager;
import com.lenovohit.hcp.payment.model.HcpOrder;
import com.lenovohit.hcp.payment.model.HcpSettlement;
import com.lenovohit.hcp.payment.model.HisPayResult;
@Service
public class TradeNotifyManagerImpl implements TradeNofityManager {
@Autowired
private GenericManager<HcpSettlement, String> hcpSettlementManager;
@Autowired
private GenericManager<HcpOrder, String> hcpOrderManager;
@Autowired
// TODO 现在接口调用,后续独立可改为webservice、http、rpc等
private HisForOutChargeManager hisForOutChargeManager;
@Override
public void payResultNofity(boolean isSuccess, String orderNo) {
HcpOrder order = hcpOrderManager.findOneByProp("orderNo", orderNo);
List<HcpSettlement> settlements = hcpSettlementManager.findByProp("order", order);
HisPayResult result = new HisPayResult();
result.setSuccess(isSuccess);
result.setOrderNo(order.getOrderNo());
result.setOperator(order.getOperator());
result.setAmt(order.getAmt());
Map<String, BigDecimal> map = result.getResultMap();
for (HcpSettlement h : settlements) {
map.put(h.getPayChannelCode(), h.getAmt());
}
hisForOutChargeManager.payConfirmed(result);
}
}
| [
"liuximing2016@qq.com"
] | liuximing2016@qq.com |
8afa9de3d23463982a8a82b41ba1e0b29adee6ed | 4691ae3d4854aca619a9a4da154d9ab859a530ea | /first/src/xiecheng/Test1.java | 4e956e909db1846edcf64dfd9b8761dd9854f15d | [
"Apache-2.0"
] | permissive | hyfangcong/2018-chunzhao-suanfa | d0bed5f49c8cb34463cc9c013d2d51a916b0c2cb | 0360b4dd83957a54da10bdeb21b4c478d61e86ee | refs/heads/master | 2020-03-13T18:21:42.794264 | 2018-07-15T04:47:33 | 2018-07-15T04:47:33 | 131,234,182 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 609 | java | package xiecheng;
import java.util.Scanner;
public class Test1 {
public static void f(int[] a){
int j=0;
for(int i=0;i<a.length;i++){
while(a[j]!=0 && j<a.length){
j++;
}
i=j+1;
while(a[i]==0 && i<a.length){
i++;
}
a[j] = a[i];
a[i] = 0;
j++;
}
}
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = Integer.parseInt(in.nextLine());
int[] a = new int[n];
int i=0;
for(i=0;i<n;i++){
a[i] = Integer.parseInt(in.nextLine());
}
f(a);
for(int j=0;j<a.length;j++){
System.out.println(a[j]);
}
}
}
| [
"1186977171@qq.com"
] | 1186977171@qq.com |
57958fa03c8fd7ade850393b9e4d1dddf5bf800e | 298a5fb8a071de20eb80bb3f4dca014465989207 | /src/com/team/engine/rendering/Texture.java | dd02bfd5936d4a278166ebd0f0e886b74d1912f7 | [] | no_license | zodsoft/Game-Engine | 77c168024fa1f90ac64a46d7152efa998d4bf522 | 3368c625ab2fb19e5b61ffe3be4c1aeda0dbaec4 | refs/heads/master | 2020-12-24T08:00:10.220397 | 2016-11-10T03:39:22 | 2016-11-10T03:39:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,177 | java | package com.team.engine.rendering;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL21.*;
import static org.lwjgl.opengl.GL13.*;
import static org.lwjgl.opengl.GL30.*;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.stb.STBImage;
import com.team.engine.Settings;
import com.team.engine.vecmath.Vec2i;
public class Texture {
public int id;
public Vec2i dimensions;
public Texture(String path) {
this(path, false, false);
}
public Texture(int id, Vec2i dimensions) {
this.id = id;
this.dimensions = dimensions;
}
/**
* Creates a new texture object that can be bound later, from the specified path.
*
* It is advised to use the texture management system in Engine rather than handle texture objects yourself.
*/
public Texture(String path, boolean pixelated, boolean srgb) {
id = glGenTextures();
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, id);
IntBuffer w = BufferUtils.createIntBuffer(1);
IntBuffer h = BufferUtils.createIntBuffer(1);
IntBuffer comp = BufferUtils.createIntBuffer(1);
STBImage.stbi_set_flip_vertically_on_load(true);
boolean hdr = STBImage.stbi_is_hdr(Settings.RESOURCE_PATH + path);
System.out.println("loading texture: " + path);
if (hdr) {
FloatBuffer buffer = STBImage.stbi_loadf(Settings.RESOURCE_PATH + path, w, h, comp, 0);
int width = w.get(0);
int height = h.get(0);
System.out.println(buffer.remaining());
dimensions = new Vec2i(width, height);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, buffer);
//STBImage.stbi_image_free(buffer);
}
else {
ByteBuffer buffer = STBImage.stbi_load(Settings.RESOURCE_PATH + path, w, h, comp, 4);
int width = w.get(0);
int height = h.get(0);
dimensions = new Vec2i(width, height);
glTexImage2D(GL_TEXTURE_2D, 0, srgb ? GL_SRGB_ALPHA : GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
//STBImage.stbi_image_free(buffer);
}
glGenerateMipmap(GL_TEXTURE_2D);
if (pixelated) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
}
else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
}
glBindTexture(GL_TEXTURE_2D, 0);
}
/**
* Binds the texture for rendering in the first texture location.
*/
public void bind() {
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, id);
}
/**
* Binds the texture for rendering in the specified texture location. Multiple textures can be sent
* to the same shader if they are in different locations.
*/
public void bind(int num) {
glActiveTexture(GL_TEXTURE0 + num);
glBindTexture(GL_TEXTURE_2D, id);
}
public static void unBind(int num) {
glActiveTexture(GL_TEXTURE0 + num);
glBindTexture(GL_TEXTURE_2D, 0);
}
}
| [
"jholley373@yahoo.com"
] | jholley373@yahoo.com |
74e9a4fda99972e0fec1767ee17d43539b73407e | 6138af219efc3a8f31060e30ebc532ffcbad1768 | /astrogrid/desktop/impl/test/java/org/astrogrid/desktop/modules/ivoa/resource/ResourceParserUnitTest.java | 0a68281be1051321cb17d80f1a298dd92298d538 | [] | no_license | Javastro/astrogrid-legacy | dd794b7867a4ac650d1a84bdef05dfcd135b8bb6 | 51bdbec04bacfc3bcc3af6a896e8c7f603059cd5 | refs/heads/main | 2023-06-26T10:23:01.083788 | 2021-07-30T11:17:12 | 2021-07-30T11:17:12 | 391,028,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,073 | java | /**
*
*/
package org.astrogrid.desktop.modules.ivoa.resource;
import java.net.URI;
import org.astrogrid.acr.ivoa.resource.Contact;
import org.astrogrid.acr.ivoa.resource.Creator;
import org.astrogrid.acr.ivoa.resource.Date;
import org.astrogrid.acr.ivoa.resource.Relationship;
import org.astrogrid.acr.ivoa.resource.Resource;
import org.astrogrid.acr.ivoa.resource.ResourceName;
/** tests for basic resource type.
* @author Noel.Winstanley@manchester.ac.uk
* @since Feb 20, 200711:45:09 PM
*/
public class ResourceParserUnitTest extends AbstractTestForParser {
public void testSingleResource() throws Exception{
ResourceStreamParser p = parse("frass.xml");
Resource r =assertOnlyOne(p);
validateResource(r);
checkResource(r
, "ivo://nasa.heasarc/skyview/rass"
, "RASS"
, "ROSAT All-Sky X-ray Survey 1.5 keV"
, "CatalogService");
checkCuration(r.getCuration()
, new Contact[] {
new Contact() {{
setName(new ResourceName() {{setValue("SkyView Help");}});
setEmail("Skyview@skyview.gsfc.nasa.gov");
}}
}
, new Creator[] {
new Creator() {{
setName(new ResourceName() {{setValue("Max Planck Institute for Exterrestrial Physics (Garching FRG)");}});
}}
}
, new ResourceName[] {
new ResourceName() {{
setValue("Skyview Project");
}}
}, new Date[] {
new Date() {{
setValue("2006-03-27");
setRole("created");
}}
}
, new ResourceName() {{
setValue("NASA/GSFC HEASARC");
setId(URI.create("ivo://nasa.heasarc"));
}}
, null);
checkContent(r.getContent()
, new String[] {"surveys"}
, new String[] { "archive"} // nb, note lower casing here.
,new String[] { "research"}
, new Relationship[] {
new Relationship() {{
setRelationshipType("service-for");
setRelatedResources(new ResourceName[]{
new ResourceName() {{
setValue("NASA/GSFC Exploration of the Universe Division");
setId(URI.create("ivo://nasa.heasarc/eud"));
}}
});
}}
});
basicResourceRendererTests(r);
}
public void testAnotherSingleResource() throws Exception{
ResourceStreamParser p = parse("tmpRofROrg.xml");
Resource r =assertOnlyOne(p);
validateResource(r);
checkResource(r
,"ivo://astrogrid.pub.rofr/organisation"
,null
,"Temporary Astrogrid Registry of Registries"
,"Organisation");
checkContent(r.getContent()
,new String[] {"organisation"}
,new String[] {"organisation"}
,new String[] {}
,new Relationship[] {}
);
checkCuration(r.getCuration()
,new Contact[] {
new Contact() {{
setEmail("kmb@mssl.ucl.ac.uk");
setName(new ResourceName() {{
setValue("Kevin Benson");
}});
}}
}
, new Creator[] {}
, new ResourceName[] {}
,new Date[] {}
, new ResourceName() {{setValue("MSSL");}}
, null
);
basicResourceRendererTests(r);
}
}
| [
"Noel.Winstanley@astrogrid.org"
] | Noel.Winstanley@astrogrid.org |
fd13e0484fe911ec27b3e5fc3ee4ed661de941d5 | 3f95c975874e745f980e64e76d5b897149fb7465 | /app/src/main/java/com/peihou/willgood2/esptouch/EsptouchTask.java | 6977e2c54dbff90e13c8299c2497971b4e4b0653 | [] | no_license | WHD597312/WillGood2 | 1f5224480c0e0077afad42197e962f7a16268d5b | 53925a3d3f9d11b0455c9357c3062528da61b215 | refs/heads/master | 2020-04-30T19:51:34.432473 | 2020-04-28T03:24:54 | 2020-04-28T03:24:54 | 177,050,364 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,990 | java | package com.peihou.willgood2.esptouch;
import android.content.Context;
import com.peihou.willgood2.esptouch.task.EsptouchTaskParameter;
import com.peihou.willgood2.esptouch.task.IEsptouchTaskParameter;
import com.peihou.willgood2.esptouch.task.__EsptouchTask;
import java.util.List;
public class EsptouchTask implements IEsptouchTask {
public __EsptouchTask _mEsptouchTask;
private IEsptouchTaskParameter _mParameter;
/**
* Constructor of EsptouchTask
*
* @param apSsid
* the Ap's ssid
* @param apBssid
* the Ap's bssid
* @param apPassword
* the Ap's password
* @param isSsidHidden
* whether the Ap's ssid is hidden
* @param context
* the Context of the Application
*/
public EsptouchTask(String apSsid, String apBssid, String apPassword, Context context) {
_mParameter = new EsptouchTaskParameter();
_mEsptouchTask = new __EsptouchTask(apSsid, apBssid, apPassword,
context, _mParameter, true);
}
/**
* @deprecated Use the new {{@link #EsptouchTask(String, String, String, Context)} API
*/
public EsptouchTask(String apSsid, String apBssid, String apPassword,
boolean isSsidHidden, Context context) {
this(apSsid, apBssid, apPassword, context);
}
/**
* Constructor of EsptouchTask
*
* @param apSsid
* the Ap's ssid
* @param apBssid
* the Ap's bssid
* @param apPassword
* the Ap's password
* @param timeoutMillisecond
* (it should be >= 15000+6000) millisecond of total timeout
* @param context
* the Context of the Application
*/
public EsptouchTask(String apSsid, String apBssid, String apPassword, int timeoutMillisecond, Context context) {
_mParameter = new EsptouchTaskParameter();
_mParameter.setWaitUdpTotalMillisecond(timeoutMillisecond);
_mEsptouchTask = new __EsptouchTask(apSsid, apBssid, apPassword,
context, _mParameter, true);
}
/**
* @deprecated Use the new {{@link #EsptouchTask(String, String, String, int, Context)} API
*/
public EsptouchTask(String apSsid, String apBssid, String apPassword,
boolean isSsidHidden, int timeoutMillisecond, Context context) {
this(apSsid, apBssid, apPassword, context);
}
@Override
public void interrupt() {
_mEsptouchTask.interrupt();
}
@Override
public IEsptouchResult executeForResult() throws RuntimeException {
return _mEsptouchTask.executeForResult();
}
@Override
public boolean isCancelled() {
return _mEsptouchTask.isCancelled();
}
@Override
public List<IEsptouchResult> executeForResults(int expectTaskResultCount)
throws RuntimeException {
if (expectTaskResultCount <= 0) {
expectTaskResultCount = Integer.MAX_VALUE;
}
return _mEsptouchTask.executeForResults(expectTaskResultCount);
}
@Override
public void setEsptouchListener(IEsptouchListener esptouchListener) {
_mEsptouchTask.setEsptouchListener(esptouchListener);
}
}
| [
"1352250152@qq.com"
] | 1352250152@qq.com |
d017e0b8ce63b0d0566a8524f3ceaef2e494a320 | 0f78eb1bd70ee3ea0cbd7b795d7e946255366efd | /src-common/com/qfw/common/gateway/impl/HttpEndPointBS.java | 9808c4a349ac1864d2388ad361aff792b2e57444 | [] | no_license | xie-summer/sjct | b8484bc4ee7d61b3713fa2e88762002f821045a6 | 4674af9a0aa587b5765e361ecaa6a07f966f0edb | refs/heads/master | 2021-06-16T22:06:06.646687 | 2017-05-12T09:24:52 | 2017-05-12T09:24:52 | 92,924,351 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,707 | java | package com.qfw.common.gateway.impl;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.params.ConnPerRouteBean;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.apache.log4j.Logger;
import com.qfw.common.exception.BizException;
public class HttpEndPointBS {
private static Logger log = Logger.getLogger(HttpEndPointBS.class);
/**
* 最大连接数
*/
public final static int MAX_TOTAL_CONNECTIONS = 800;
/**
* 获取连接的最大等待时间
*/
public final static int WAIT_TIMEOUT = 60000;
/**
* 每个路由最大连接数
*/
public final static int MAX_ROUTE_CONNECTIONS = 400;
/**
* 连接超时时间
*/
public final static int CONNECT_TIMEOUT = 10000;
/**
* 读取超时时间
*/
public final static int READ_TIMEOUT = 10000;
public static String send(String uri, Map<String, String> param,String encoding) throws BizException {
try {
if (encoding == null || encoding.isEmpty()) {
encoding = HTTP.UTF_8;
}
DefaultHttpClient client = new DefaultHttpClient();
HttpPost httppost = new HttpPost(uri);
HttpParams httpParams = new BasicHttpParams();
ConnManagerParams.setMaxTotalConnections(httpParams,
MAX_TOTAL_CONNECTIONS);
// 设置获取连接的最大等待时间
ConnManagerParams.setTimeout(httpParams, WAIT_TIMEOUT);
// 设置每个路由最大连接数
ConnPerRouteBean connPerRoute = new ConnPerRouteBean(
MAX_ROUTE_CONNECTIONS);
ConnManagerParams.setMaxConnectionsPerRoute(httpParams,
connPerRoute);
// 设置连接超时时间
HttpConnectionParams.setConnectionTimeout(httpParams,
CONNECT_TIMEOUT);
// 设置读取超时时间
HttpConnectionParams.setSoTimeout(httpParams, READ_TIMEOUT);
httppost.setParams(httpParams);
/*
* if(header!=null && !header.isEmpty()){ Set<Map.Entry<String,
* String>> headers = param.entrySet(); for (Map.Entry<String,
* String> hearder : headers) { httppost.setHeader(hearder.getKey(),
* hearder.getValue()); } }
*/
if (param != null && !param.isEmpty()) {
List<BasicNameValuePair> nvps = new ArrayList<BasicNameValuePair>();
Set<Map.Entry<String, String>> params = param.entrySet();
for (Map.Entry<String, String> entry : params) {
nvps.add(new BasicNameValuePair(entry.getKey(), entry
.getValue()));
// p.setParameter(entry.getKey(), entry.getValue());
}
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nvps, encoding);
/*//System.out.println(entity.getContentType());
//System.out.println(entity.getContentLength());
//System.out.println(EntityUtils.getContentCharSet(entity));
//System.out.println(EntityUtils.toString(entity));*/
httppost.setEntity(entity);
////System.out.println(httppost.getRequestLine());
}
//Scheme sch = new Scheme("https", SSLSocketFactory.getSocketFactory(), 443);
//client.getConnectionManager().getSchemeRegistry().register(sch);
HttpResponse response = client.execute(httppost);
//System.out.println(response.getStatusLine().getStatusCode());
HttpEntity entity = response.getEntity();
String result = IOUtils.toString(entity.getContent(), entity
.getContentEncoding() == null ? encoding : entity
.getContentEncoding().getValue());
client.getConnectionManager().shutdown();
return result;
} catch (ClientProtocolException e) {
log.error("http发送失败", e);
throw new BizException("http发送失败");
} catch (UnsupportedEncodingException e) {
log.error("http发送失败", e);
throw new BizException("http发送失败");
} catch (IOException e) {
log.error("http发送失败", e);
throw new BizException("http发送失败");
}
}
}
| [
"271673805@qq.com"
] | 271673805@qq.com |
64cfd8f1fd44fbd4b97fd2f52374607fbf6a7b4a | 3f87df2a878de64eccdcac22bb09b8944ba06fd4 | /java/microservices/BreweryBeer/mssc-beer-order-service/src/main/java/guru/springframework/mssc_beer_order_service/domain/BeerOrder.java | 2e089f08a9955f51da21415547d42871c0dbfb8d | [] | no_license | juncevich/workshop | 621d1262a616ea4664198338b712898af9e61a76 | fbaeecfb399be65a315c60d0aa24ecae4067918d | refs/heads/master | 2023-04-30T14:53:43.154005 | 2023-04-15T17:26:53 | 2023-04-15T17:26:53 | 78,441,425 | 0 | 0 | null | 2023-03-28T20:52:35 | 2017-01-09T15:27:29 | JavaScript | UTF-8 | Java | false | false | 2,285 | java | /*
* Copyright 2019 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package guru.springframework.mssc_beer_order_service.domain;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import java.sql.Timestamp;
import java.util.Set;
import java.util.UUID;
/**
* Created by jt on 2019-01-26.
*/
@Getter
@Setter
@Entity
@NoArgsConstructor
public class BeerOrder extends BaseEntity {
private String customerRef;
@ManyToOne
private Customer customer;
@OneToMany(mappedBy = "beerOrder", cascade = CascadeType.ALL)
@Fetch(FetchMode.JOIN)
private Set<BeerOrderLine> beerOrderLines;
private BeerOrderStatusEnum orderStatus = BeerOrderStatusEnum.NEW;
private String orderStatusCallbackUrl;
@Builder
public BeerOrder(UUID id, Long version, Timestamp createdDate, Timestamp lastModifiedDate, String customerRef, Customer customer,
Set<BeerOrderLine> beerOrderLines, BeerOrderStatusEnum orderStatus,
String orderStatusCallbackUrl) {
super(id, version, createdDate, lastModifiedDate);
this.customerRef = customerRef;
this.customer = customer;
this.beerOrderLines = beerOrderLines;
this.orderStatus = orderStatus;
this.orderStatusCallbackUrl = orderStatusCallbackUrl;
}
}
| [
"a.juncevich@gmail.com"
] | a.juncevich@gmail.com |
d190582619f7bf6c38f959f44385da9a629a7440 | d349ed27f01e2c8e494c1c3cd18d165b9bd13c53 | /game-context/src/main/java/com/sky/game/context/annotation/HandlerException.java | 87f492ddfd8b5ffc88501cc517404483b2d7095b | [] | no_license | autumnsparrow/poker-game | 385ce3e4146013caf894a4b80c4e1b74e5e826f9 | 7766a7529e4feed95c3a2c2cfc27ce25ad913bb6 | refs/heads/master | 2021-04-06T20:46:38.077347 | 2018-03-14T15:11:44 | 2018-03-14T15:11:44 | 125,230,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 467 | java | /**
*
*/
package com.sky.game.context.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* method annotation - shows mean may throws the exceptions.
*
* @author sparrow
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface HandlerException {
int[] states();
String[] messages();
}
| [
"ruiqiuzhang@gmail.com"
] | ruiqiuzhang@gmail.com |
86d6a7f87e68289bf8bd393f2817fa4e92026274 | 18c70f2a4f73a9db9975280a545066c9e4d9898e | /mirror-cmdb/cmdb-service/src/main/java/com/aspire/ums/cmdb/ipCollect/service/CmdbIpCollectService.java | f191d07388aa2d2eabda0f801d5badb8ed286d48 | [] | no_license | iu28igvc9o0/cmdb_aspire | 1fe5d8607fdacc436b8a733f0ea44446f431dfa8 | 793eb6344c4468fe4c61c230df51fc44f7d8357b | refs/heads/master | 2023-08-11T03:54:45.820508 | 2021-09-18T01:47:25 | 2021-09-18T01:47:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,419 | java | package com.aspire.ums.cmdb.ipCollect.service;
import java.util.List;
import java.util.Map;
import com.aspire.ums.cmdb.ipCollect.payload.entity.BaseIpCollectEntity;
import com.aspire.ums.cmdb.ipCollect.payload.entity.CmdbIpCollectRequest;
import com.aspire.ums.cmdb.ipCollect.payload.entity.CmdbIpCollectResponse;
import com.aspire.ums.cmdb.ipCollect.payload.entity.CmdbIpCollectTopTotalResponse;
/**
* @Author: fanshenquan
* @Datetime: 2020/6/5 19:46
*/
public interface CmdbIpCollectService {
/**
* 分页查询
*
* @return
*/
List<CmdbIpCollectResponse> findPage(CmdbIpCollectRequest request);
/**
* 条件查询统计
*
* @param request
* @return
*/
Integer findPageCount(CmdbIpCollectRequest request);
/**
* 头栏统计
*
* @param request
* @return
*/
CmdbIpCollectTopTotalResponse findTopTotal(CmdbIpCollectRequest request);
/**
* 获取资源池列表
*
* @return
*/
List<Map> getResource();
/**
* 获取来源列表
*
* @return
*/
List<Map> getSource();
/**
* 批量新增存活IP
*
* @param obj
* @param clazz
* @param <T>
* @param autoFlag 是否自动化调用接口,1-是,2-不是
* @param updateFlag 是否更新地址库信息,1-需要更新
* @param ipClashFlag 是否需要处理冲突IP,1-需要处理
*/
<T extends BaseIpCollectEntity> void batchAdd(List<T> obj, Class<T> clazz,String autoFlag,String updateFlag,String ipClashFlag);
/**
* 根据instanceIds批量逻辑删除
*
* @param instanceIds
* @param clazz
* @param <T>
*/
<T extends BaseIpCollectEntity> void batchDeleteByInstanceId(List<String> instanceIds, Class<T> clazz);
/**
* 修改(map)
*
* @param obj
* @param clazz
* @param <T>
*/
<T extends BaseIpCollectEntity> void modifyForMap(Map<String, Object> obj, Class<T> clazz);
/**
* 修改(对象)
*
* @param obj
* @param clazz
* @param <T>
*/
<T extends BaseIpCollectEntity> void modifyForEntity(T obj, Class<T> clazz);
/**
* 根据instanceId返回实例基类
*
* @param instanceId
* @param clazz
* @param <T>
* @return
*/
<T extends BaseIpCollectEntity> BaseIpCollectEntity findBaseByInstanceId(String instanceId, Class<T> clazz);
/**
* 根据instanceId集合返回实例集合
*
* @param instanceId
* @param clazz
* @param <T>
* @return
*/
<T extends BaseIpCollectEntity> List<T> findEntityByInstanceId(List<String> instanceId, Class<T> clazz);
/**
* 获取所有instanceId
* @param clazz
* @param <T>
* @return
*/
<T extends BaseIpCollectEntity> List<String> getAllInstanceId(Class<T> clazz);
void updateCmdbAssetAllIpInfo();
void updatePublicIpInfo();
void updateIpv6Info();
void updateIpBusinessByAsset();
String getIpUpdateConfig(String config);
/**
* 构建数据字典的map实体
* @param config 数据字典编码
*/
Map<String,String> buildConfig4Map(String config);
void updateFirstSurvivalTime4IpInfo();
/**
* 通过新实例的IP查找当天系统的存活IP是否存在,有就比对mac地址
* @param ip 新实例的IP
* @param clazz 存活类型
* @param <T> 基类
*/
<T extends BaseIpCollectEntity> BaseIpCollectEntity findDataByIpList(String ip, Class<T> clazz);
/**
* 构建并保存当天的冲突IP
*/
void buildAndSaveIpClashList4Now();
/**
* 新增当天的存活IP历史表分区
*/
void alterCmdbIpPart(String type);
/**
* 更新资产的存活信息(存活状态和最近存活时间)
*/
void updateCmdbAssetSurvialInfo();
/**
* 更新内网IP的可用数量
*/
void updateInnerIpFreeCount();
/**
* 查询资产的存活信息不为空的资产并推送到kafka上,同步更新旧网管
*/
void findCmdbAssetSurvial2Kafka();
/**
* 全量同步网段-端口组数据
*/
void synAllNetworkPortGroup();
/**
* 更新cmdb资产为 已存活 存活时间和存活状态.
*
* @param
* @return
*/
void updateCmdbAssetSurvival();
/**
* 更新cmdb资产为 未存活
*
* @param
* @return
*/
void updateCmdbAsset2UnSurvival();
/**
* 自动化采集异常设备报表.
*
* @param
* @return
*/
void reportCmdbAutoStatus();
/**
* 更新IP地址库的所有IP存活状态为未存活
*/
void synAllInnerIpSurvival();
void deleteCmdbIpAddressNowDay(String nowDay);
void deleteCmdbIpConfNowDay(String nowDay);
void deleteCmdbIpArpNowDay(String nowDay);
/**
* 更新同步资产的其他IP
*/
void updateAssetOtherIp();
/**
* 通过存活IP,更新IP地址库的存活和分配信息
*/
void updateBaseCollectIp();
/**
* 初始化资产表的承载网IP:
* IP管理资产表根据资产表的管理ip、业务ip1、业务ip2、consoleip、other_ip(自动化采集ip)和关联表的“其他ip”匹配,同步资产表的承载网IP字段,若不存在则追加
*/
void initCarrierNetworkForAsset();
}
| [
"jiangxuwen7515@163.com"
] | jiangxuwen7515@163.com |
b1f1966d58bec0c165c77c03cf30602645fa55af | 01f427904ee271c41e6bb1f94793b43720fa431c | /epcis-server/src/main/java/org/oliot/epcis/query/converter/seq/EQSourceConverter.java | 6c248e55b760d9d1609fea721b9324845ce591f1 | [
"Apache-2.0"
] | permissive | JaewookByun/epcis | 261e1278f2821e25621c424299742175dc86600e | c2b7fbe455e654a1c42adad15efd6ce135588ba8 | refs/heads/master | 2023-08-20T23:34:44.610093 | 2023-08-18T07:38:24 | 2023-08-18T07:38:24 | 23,309,105 | 47 | 63 | Apache-2.0 | 2023-08-16T02:02:53 | 2014-08-25T09:46:02 | Java | UTF-8 | Java | false | false | 1,825 | java | package org.oliot.epcis.query.converter.seq;
import java.util.ArrayList;
import java.util.List;
import org.bson.Document;
import org.oliot.epcis.model.QueryParameterException;
import org.oliot.epcis.model.ValidationException;
import org.oliot.epcis.query.converter.BaseConverter;
import org.oliot.epcis.query.converter.QueryConverter;
import org.oliot.epcis.resource.StaticResource;
import org.oliot.epcis.validation.IdentifierValidator;
/**
* This is not a single parameter, but a family of parameters. If a parameter of
* this form is specified, the result will only include events that (a) include
* a sourceList; (b) where the source list includes an entry whose type subfield
* is equal to type extracted from the name of this parameter; and (c) where the
* source subfield of that entry is equal to one of the values specified in this
* parameter.
*
* List of URIs
*
*/
public class EQSourceConverter extends BaseConverter implements QueryConverter {
@Override
public Document convert(String key, Object value) throws QueryParameterException {
List<String> valueList = getListOfString(value);
String type = retrieveParameterType(key, 10);
if (!StaticResource.sourceDestinationTypes.contains(type))
throw new QueryParameterException(
"the value of a parameter should be one of " + StaticResource.sourceDestinationTypes);
List<Document> docList = new ArrayList<Document>();
for (String v : valueList) {
try {
IdentifierValidator.checkSourceDestinationEPCPureIdentity(StaticResource.gcpLength, v);
docList.add(new Document("sourceList",
new Document("$elemMatch", new Document().append("type", type).append("value", v))));
} catch (ValidationException e) {
throw new QueryParameterException(e.getReason());
}
}
return new Document("$or", docList);
}
}
| [
"bjw0829@gmail.com"
] | bjw0829@gmail.com |
dd8739e3c3f2c76bfde34a522000aac8fc80e068 | 85fa1f4bf5e4ad2df27a77bf7633e203b6421245 | /forever/src/main/java/com/forever/zhb/utils/password/symmetric/IDEAUtil.java | 71547d09033f6b8ea7294a26d952d5078ae81f5f | [] | no_license | ZHB1024/zhb-forever | 1765d1926121be5046aded899b56d2525fa420a7 | 4a1e71d776b0bf004aaf0cf5089029e1a9300f73 | refs/heads/master | 2018-10-16T09:18:32.855468 | 2018-08-18T15:36:37 | 2018-08-18T15:36:37 | 112,721,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,579 | java | package com.forever.zhb.utils.password.symmetric;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.encoders.Base64;
public class IDEAUtil {
/*
* IDEA (International Data Encryption Algorithm,国际数据加密算法)
*
* 通过BouncyCastle来实现
*
* 秘钥长度:128位
*/
public static final String KEY_ALGORITHM = "IDEA";
// 加密、解密模式/工作模式/填充方式
public static final String CIPHER_ALGORITHM = "IDEA/ECB/ISO10126Padding";
public static byte[] encrypt(String data,byte[] key) throws Exception{
byte[] bytes = data.getBytes();
Security.addProvider(new BouncyCastleProvider());
SecretKey sk = toKey(key);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, sk);
return cipher.doFinal(bytes);
}
public static byte[] decrypt(byte[] datas,byte[] key) throws Exception{
Security.addProvider(new BouncyCastleProvider());
SecretKey sk = toKey(key);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, sk);
return cipher.doFinal(datas);
}
public static byte[] initKey() throws NoSuchAlgorithmException{
Security.addProvider(new BouncyCastleProvider());
KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM);
kg.init(128);
SecretKey sk = kg.generateKey();
return sk.getEncoded();
}
public static SecretKey toKey(byte[] key){
SecretKey sk = new SecretKeySpec(key,KEY_ALGORITHM);
return sk;
}
public static void main(String[] args) throws Exception{
String data = "zhanghuibin";
System.out.println("加密前:" + data);
System.out.println("------------------------------");
byte[] keys = initKey();// 生成key
byte[] bytes = encrypt(data, keys);// 加密
System.out.println("加密后:");
for (byte b : bytes) {
System.out.print(b);
}
System.out.println();
System.out.println("------------------------------");
// 解密
byte[] decrypt = decrypt(bytes, keys);
String decryptValue = new String(decrypt);
System.out.println("解密后:" + decryptValue);
System.out.println("--------------Base64处理----------------");
String base64 = Base64.toBase64String(bytes);
System.out.println(base64);
byte[] temp = Base64.decode(base64);
for (byte b : temp) {
System.out.print(b);
}
}
}
| [
"zhb20111503@126.com"
] | zhb20111503@126.com |
6945deb14292ea0cd117f405d765073f2bdb9208 | 58da62dfc6e145a3c836a6be8ee11e4b69ff1878 | /src/main/java/com/alipay/api/domain/InvoiceItemContent.java | d9552705403560901a04bfda189486be40ade3de | [
"Apache-2.0"
] | permissive | zhoujiangzi/alipay-sdk-java-all | 00ef60ed9501c74d337eb582cdc9606159a49837 | 560d30b6817a590fd9d2c53c3cecac0dca4449b3 | refs/heads/master | 2022-12-26T00:27:31.553428 | 2020-09-07T03:39:05 | 2020-09-07T03:39:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,152 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 电子发票平台发票明细项
*
* @author auto create
* @since 1.0, 2019-06-21 17:05:22
*/
public class InvoiceItemContent extends AlipayObject {
private static final long serialVersionUID = 1277581798751576346L;
/**
* 价税合计。(等于sumPrice和tax之和)
*/
@ApiField("item_amount")
private String itemAmount;
/**
* 发票项目名称(或商品名称)
*/
@ApiField("item_name")
private String itemName;
/**
* 商品编号
*/
@ApiField("item_no")
private String itemNo;
/**
* 单价,格式:100.00。新版电子发票,折扣行此参数不能传,非折扣行必传
*/
@ApiField("item_price")
private String itemPrice;
/**
* 数量。新版电子发票,折扣行此参数不能传,非折扣行必传
*/
@ApiField("item_quantity")
private Long itemQuantity;
/**
* 单项总价,格式:100.00
*/
@ApiField("item_sum_price")
private String itemSumPrice;
/**
* 税额
*/
@ApiField("item_tax_price")
private String itemTaxPrice;
/**
* 税率
*/
@ApiField("item_tax_rate")
private String itemTaxRate;
/**
* 台
*/
@ApiField("item_unit")
private String itemUnit;
/**
* 发票行性质。0表示正常行,1表示折扣行,2表示被折扣行。比如充电器单价100元,折扣10元,则明细为2行,充电器行性质为2,折扣行性质为1。如果充电器没有折扣,则值应为0
*/
@ApiField("row_type")
private Long rowType;
public String getItemAmount() {
return this.itemAmount;
}
public void setItemAmount(String itemAmount) {
this.itemAmount = itemAmount;
}
public String getItemName() {
return this.itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemNo() {
return this.itemNo;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getItemPrice() {
return this.itemPrice;
}
public void setItemPrice(String itemPrice) {
this.itemPrice = itemPrice;
}
public Long getItemQuantity() {
return this.itemQuantity;
}
public void setItemQuantity(Long itemQuantity) {
this.itemQuantity = itemQuantity;
}
public String getItemSumPrice() {
return this.itemSumPrice;
}
public void setItemSumPrice(String itemSumPrice) {
this.itemSumPrice = itemSumPrice;
}
public String getItemTaxPrice() {
return this.itemTaxPrice;
}
public void setItemTaxPrice(String itemTaxPrice) {
this.itemTaxPrice = itemTaxPrice;
}
public String getItemTaxRate() {
return this.itemTaxRate;
}
public void setItemTaxRate(String itemTaxRate) {
this.itemTaxRate = itemTaxRate;
}
public String getItemUnit() {
return this.itemUnit;
}
public void setItemUnit(String itemUnit) {
this.itemUnit = itemUnit;
}
public Long getRowType() {
return this.rowType;
}
public void setRowType(Long rowType) {
this.rowType = rowType;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
81b89014a3d8627b40a603df8284ae8175edaabb | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/27/27_2a28bdf9c8c9d79e842870d95f38c76eb78e6fa0/Review/27_2a28bdf9c8c9d79e842870d95f38c76eb78e6fa0_Review_t.java | 801f2c47eda0fd436e59025d267daf813041f7d6 | [] | 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 | 326 | java | package main;
public class Review {
public String b_id;
public String u_id;
public int stars;
public int useful;
public int funny;
public int cool;
public Review(String b, String u, int s, int us, int f, int c) {
b_id = b;
u_id = u;
stars = s;
useful = us;
funny = f;
cool = c;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9c95721e85c66193be0931595f4b1d04892850f7 | c4b3c4c595524b25a2c2c209e1e00facb56ff435 | /src/com/viewscenes/web/sysmgr/userLog/UserLog.java | 7a581a39ed4f1600f860024bdcb6db8b26a19acb | [] | no_license | liubinswift/hw3 | d4c2e4bc6be746b1b103e31d5e77e52ef292c7d9 | 0b6c7548d7d852afbf1ffeb2d67fe58d001005af | refs/heads/master | 2021-07-04T15:38:02.997165 | 2020-05-11T12:48:48 | 2020-05-11T12:48:48 | 123,068,376 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 4,145 | java | package com.viewscenes.web.sysmgr.userLog;
import com.viewscenes.pub.GDSet;
import com.viewscenes.dao.database.DbComponent;
import java.util.ArrayList;
import com.viewscenes.util.StringTool;
import flex.messaging.io.amf.ASObject;
import org.jmask.web.controller.EXEException;
/**
* *************************************
*
* 项目名称:HW
* 类名称:OperateLogManager
* 类描述: 用户日志查询。
* 创建人:刘斌
* 创建时间:Aug 10, 2012 3:16:25 PM
* 修改人:刘斌
* 修改时间:Aug 10, 2012 3:16:25 PM
* 修改备注:
* @version
*
***************************************
*/
public class UserLog {
public UserLog() {
}
/**
* queryOperateLog
* 获得用户操作日志列表
* @param msg
* @return
*/
public Object queryOperateLog(ASObject obj) {
String param_userID = (String)obj.get("param_userID"); //用户ID
String param_opType =(String)obj.get("param_opType"); //操作类型
String param_begintime =(String)obj.get("param_begintime"); //开始时间
String param_endtime = (String)obj.get("param_endtime"); //结束时间
String subsql = "";
String tableStr = "";
if(!param_userID.equals("")){
subsql = " and user_id="+param_userID;
}
if(!param_opType.equals("")){
subsql = " and detail.operation_name=ol.operation_name and detail.detail_id="+param_opType;
tableStr = " ,sec_operation_detail_tab detail ";
}
String sql = " select ol.log_datetime,ol.user_name,ol.operation_name,ol.description "
+ " from sec_operation_log_tab ol "+tableStr+" where 1=1"+subsql;
sql += " and ol.log_datetime>=to_date('"+param_begintime+"','YYYY-MM-DD HH24:MI:SS') "
+ " and ol.log_datetime<=to_date('"+param_endtime+"','YYYY-MM-DD HH24:MI:SS') ";
sql += " order by ol.log_datetime desc";
try{
return StringTool.pageQuerySql(sql.toString(), obj);
}catch (Exception e) {
return new EXEException("","获得用户操作日志列表错误:"+ e.getMessage(),null);
}
}
/**
* getAllUserList
* 获得用户列表
* @param msg
* @return
*/
public Object getAllUserList() {
String sql = "select user_id, user_name from sec_user_tab order by user_name";
ArrayList list=new ArrayList();
try{
GDSet set = DbComponent.Query(sql);
ASObject obj2=new ASObject();
obj2.put("label","全部");
obj2.put("data","");
list.add(obj2);
for(int i=0;i<set.getRowCount();i++){
ASObject obj=new ASObject();
obj.put("label",set.getString(i, "user_name"));
obj.put("data",set.getString(i, "user_id"));
list.add(obj);
}
}catch (Exception e) {
e.printStackTrace();
return new EXEException("","查询用户列表出错:"+ e.getMessage(),null);
}
return list;
}
/**
* getAllOpTypeList
* 获得日志操作类型列表
* @param msg
* @return
*/
public Object getAllOpTypeList( ) {
ArrayList list = new ArrayList();
String sql = " select detail_id,operation_name from sec_operation_detail_tab where is_log=1 ";
try{
GDSet set = DbComponent.Query(sql);
ASObject obj2=new ASObject();
obj2.put("label","全部");
obj2.put("data","");
list.add(obj2);
for(int i=0;i<set.getRowCount();i++){
ASObject obj=new ASObject();
obj.put("data",set.getString(i, "detail_id"));
obj.put("label",set.getString(i, "operation_name"));
list.add(obj);
}
}catch (Exception e) {
e.printStackTrace();
return new EXEException("","查询用户列表出错:"+ e.getMessage(),null);
}
return list;
}
}
| [
"liubin11@jd.com"
] | liubin11@jd.com |
a2ed92c608ada90c07a9acb03cdae0b6d2678a09 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Math-6/org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer/BBC-F0-opt-10/tests/13/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer_ESTest.java | c31a1b450446bb16fce55f9157aa077c572100d1 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 3,351 | java | /*
* This file was automatically generated by EvoSuite
* Thu Oct 21 11:40:33 GMT 2021
*/
package org.apache.commons.math3.optim.nonlinear.vector.jacobian;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.math3.optim.PointVectorValuePair;
import org.apache.commons.math3.optim.SimplePointChecker;
import org.apache.commons.math3.optim.SimpleVectorValueChecker;
import org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class LevenbergMarquardtOptimizer_ESTest extends LevenbergMarquardtOptimizer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
SimpleVectorValueChecker simpleVectorValueChecker0 = new SimpleVectorValueChecker(2625.3441047, 3010.4);
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer(0.0, simpleVectorValueChecker0, 3010.4, 3010.4, 2625.3441047, 0.0);
assertEquals(0.0, levenbergMarquardtOptimizer0.getChiSquare(), 0.01);
}
@Test(timeout = 4000)
public void test1() throws Throwable {
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer(0.0, 0.0, (-2870.16760786), 558.0933745515915, 0.0);
assertEquals(0.0, levenbergMarquardtOptimizer0.getChiSquare(), 0.01);
}
@Test(timeout = 4000)
public void test2() throws Throwable {
SimplePointChecker<PointVectorValuePair> simplePointChecker0 = new SimplePointChecker<PointVectorValuePair>(0.0, 0.0, 2168);
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer(0.0, simplePointChecker0, 0.0, 2168, 0.0, 2168);
// Undeclared exception!
try {
levenbergMarquardtOptimizer0.doOptimize();
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer", e);
}
}
@Test(timeout = 4000)
public void test3() throws Throwable {
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer();
assertEquals(0.0, levenbergMarquardtOptimizer0.getChiSquare(), 0.01);
}
@Test(timeout = 4000)
public void test4() throws Throwable {
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer((-1831.6), (-1831.6), (-1831.6));
assertEquals(0.0, levenbergMarquardtOptimizer0.getChiSquare(), 0.01);
}
@Test(timeout = 4000)
public void test5() throws Throwable {
SimplePointChecker<PointVectorValuePair> simplePointChecker0 = new SimplePointChecker<PointVectorValuePair>(256.586715295, 256.586715295);
LevenbergMarquardtOptimizer levenbergMarquardtOptimizer0 = new LevenbergMarquardtOptimizer(simplePointChecker0);
assertEquals(0.0, levenbergMarquardtOptimizer0.getChiSquare(), 0.01);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
ed1b430bfeb5cd5fba439e6128fcff98dc9b9eec | 48e013de4833035fb34b30b02f0903f4ce4ceed7 | /aura/src/main/java/org/auraframework/throwable/AuraJWTError.java | 163643134588e3069af23c228fcc46d635e64214 | [
"BSD-3-Clause",
"Apache-2.0",
"LGPL-2.0-or-later",
"ICU",
"LicenseRef-scancode-mx4j",
"W3C",
"CC-BY-4.0",
"SAX-PD",
"MPL-2.0",
"WTFPL",
"CDDL-1.0",
"MIT"
] | permissive | nagyist/forcedotcom-aura | 064609732afa4bc7551eec9972218dc9f1a30fd8 | 779ffdcc715565d3b961becd28aa163d289557aa | refs/heads/master | 2022-12-21T13:31:26.447628 | 2022-02-12T08:35:12 | 2022-02-12T08:35:12 | 27,166,886 | 0 | 0 | Apache-2.0 | 2022-12-16T22:49:11 | 2014-11-26T08:29:51 | JavaScript | UTF-8 | Java | false | false | 1,313 | java | /*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.auraframework.throwable;
/**
* Aura-related error arising from abnormal conditions which no one should
* reasonably try to catch. One example might be if Aura was missing some key
* source code of the engine itself.
* "Even if you could recover, things will continue to not go your way."
*
* @see AuraException
* @see AuraRuntimeException
*/
public class AuraJWTError extends Error {
private static final long serialVersionUID = -3941038157435067048L;
public AuraJWTError(Throwable t) {
super(t);
}
public AuraJWTError(String message) {
super(message);
}
public AuraJWTError(String message, Throwable t) {
super(message, t);
}
}
| [
"byao@salesforce.com"
] | byao@salesforce.com |
44629c0a63725513f9bb64cf63e0a35b42baca9d | af4e2fa003e7cb4cd77ea6d36851b60b3e5c94e8 | /modules/activiti-rest/src/main/java/org/activiti/rest/api/RestResponseFactory.java | c19f3aafca20c8bf3925f925d01aaf57ceb5c709 | [
"Apache-2.0"
] | permissive | cloudfoundry-blueprints/Activiti | aada7657e3b67047982359a9e8bd02c05168632c | de1fae4d2563effe0408a6c944e7a9bb03085123 | refs/heads/master | 2021-01-18T14:55:14.853184 | 2013-04-23T15:43:27 | 2013-04-23T15:43:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,703 | 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.
*/
package org.activiti.rest.api;
import org.activiti.engine.impl.bpmn.deployer.BpmnDeployer;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Task;
import org.activiti.rest.api.repository.DeploymentResourceResponse;
import org.activiti.rest.api.repository.DeploymentResourceResponse.DeploymentResourceType;
import org.activiti.rest.api.repository.DeploymentResponse;
import org.activiti.rest.api.repository.ProcessDefinitionResponse;
import org.activiti.rest.api.task.TaskResponse;
import org.restlet.data.MediaType;
/**
* Default implementation of a {@link RestResponseFactory}.
*
* @author Frederik Heremans
*/
public class RestResponseFactory {
public TaskResponse createTaskReponse(SecuredResource resourceContext, Task task) {
TaskResponse response = new TaskResponse(task);
response.setUrl(resourceContext.createFullResourceUrl(RestUrls.URL_TASK, task.getId()));
// Add references to other resources, if needed
if(task.getParentTaskId() != null) {
response.setParentTask(resourceContext.createFullResourceUrl(RestUrls.URL_TASK, task.getParentTaskId()));
}
if(task.getProcessDefinitionId() != null) {
response.setProcessDefinition(resourceContext.createFullResourceUrl(RestUrls.URL_PROCESS_DEFINITION, task.getProcessDefinitionId()));
}
if(task.getExecutionId() != null) {
response.setExecution(resourceContext.createFullResourceUrl(RestUrls.URL_EXECUTION, task.getExecutionId()));
}
if(task.getProcessInstanceId() != null) {
response.setProcessInstance(resourceContext.createFullResourceUrl(RestUrls.URL_PROCESS_INSTANCE, task.getProcessInstanceId()));
}
return response;
}
public DeploymentResponse createDeploymentResponse(SecuredResource resourceContext, Deployment deployment) {
return new DeploymentResponse(deployment, resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT, deployment.getId()));
}
public DeploymentResourceResponse createDeploymentResourceResponse(SecuredResource resourceContext, String deploymentId, String resourceId) {
// Create URL's
String resourceUrl = resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT_RESOURCE, deploymentId, resourceId);
String resourceContentUrl = resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT_RESOURCE_CONTENT, deploymentId, resourceId);
// Fetch media-type
MediaType mediaType = resourceContext.resolveMediaType(resourceId);
String mediaTypeString = (mediaType != null) ? mediaType.toString() : null;
// Determine type
// TODO: do based on the returned resource-POJO from the API once ready instead of doing it here
DeploymentResourceType type = DeploymentResourceType.RESOURCE;
for(String suffix : BpmnDeployer.BPMN_RESOURCE_SUFFIXES) {
if(resourceId.endsWith(suffix)) {
type = DeploymentResourceType.PROCESS_DEFINITION;
break;
}
}
return new DeploymentResourceResponse(resourceId, resourceUrl, resourceContentUrl, mediaTypeString, type);
}
public ProcessDefinitionResponse createProcessDefinitionResponse(SecuredResource resourceContext, ProcessDefinition processDefinition) {
ProcessDefinitionResponse response = new ProcessDefinitionResponse();
response.setUrl(resourceContext.createFullResourceUrl(RestUrls.URL_PROCESS_DEFINITION, processDefinition.getId()));
response.setId(processDefinition.getId());
response.setKey(processDefinition.getKey());
response.setVersion(processDefinition.getVersion());
response.setCategory(processDefinition.getCategory());
response.setName(processDefinition.getName());
response.setDescription(processDefinition.getDescription());
response.setSuspended(processDefinition.isSuspended());
response.setStartFormDefined(processDefinition.hasStartFormKey());
// Check if graphical notation defined
// TODO: this method does an additional check to see if the process-definition exists which causes an additional query on top
// of the one we already did to retrieve the processdefinition in the first place.
ProcessDefinition deployedDefinition = ActivitiUtil.getRepositoryService().getProcessDefinition(processDefinition.getId());
response.setGraphicalNotationDefined(((ProcessDefinitionEntity) deployedDefinition).isGraphicalNotationDefined());
// Links to other resources
response.setDeployment(resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT, processDefinition.getDeploymentId()));
response.setResource(resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT_RESOURCE, processDefinition.getDeploymentId(), processDefinition.getResourceName()));
if(processDefinition.getDiagramResourceName() != null) {
response.setDiagramResource(resourceContext.createFullResourceUrl(RestUrls.URL_DEPLOYMENT_RESOURCE,
processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName()));
}
return response;
}
}
| [
"frederik.heremans@gmail.com"
] | frederik.heremans@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.